@bikdotai/bik-component-library 0.0.697-5 → 0.0.698-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  2. package/dist/cjs/components/data-source-panel/DataSourceInfoFooter.d.ts +1 -0
  3. package/dist/cjs/components/data-source-panel/DataSourceInfoFooter.js +1 -1
  4. package/dist/cjs/components/data-source-panel/DataSourcePanel.d.ts +1 -0
  5. package/dist/cjs/components/data-source-panel/DataSourcePanel.js +1 -1
  6. package/dist/cjs/components/data-source-panel/DataSourcePanel.style.js +10 -8
  7. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +2 -2
  8. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  9. package/dist/cjs/components/template-context-mapper/utils/constants.d.ts +1 -0
  10. package/dist/cjs/components/template-context-mapper/utils/constants.js +1 -1
  11. package/dist/cjs/components/template-preview/models/TemplateMeta.d.ts +5 -0
  12. package/dist/cjs/components/template-preview/models/TemplateMeta.js +1 -1
  13. package/dist/cjs/index.js +1 -1
  14. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  15. package/dist/esm/components/data-source-panel/DataSourceInfoFooter.d.ts +1 -0
  16. package/dist/esm/components/data-source-panel/DataSourceInfoFooter.js +1 -1
  17. package/dist/esm/components/data-source-panel/DataSourcePanel.d.ts +1 -0
  18. package/dist/esm/components/data-source-panel/DataSourcePanel.js +1 -1
  19. package/dist/esm/components/data-source-panel/DataSourcePanel.style.js +7 -5
  20. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +2 -2
  21. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  22. package/dist/esm/components/template-context-mapper/utils/constants.d.ts +1 -0
  23. package/dist/esm/components/template-context-mapper/utils/constants.js +1 -1
  24. package/dist/esm/components/template-preview/models/TemplateMeta.d.ts +5 -0
  25. package/dist/esm/components/template-preview/models/TemplateMeta.js +1 -1
  26. package/dist/esm/index.js +1 -1
  27. package/package.json +1 -1
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -19,6 +19,7 @@ interface SourceInfoFooterProps {
19
19
  isFooterLoading?: boolean;
20
20
  reasonForAiGeneratedResponse?: string;
21
21
  showAiResponseReason?: boolean;
22
+ aiResponseLoading?: boolean;
22
23
  }
23
24
  declare const SourceInfoFooter: import("react").MemoExoticComponent<(props: SourceInfoFooterProps) => import("react/jsx-runtime").JSX.Element>;
24
25
  export default SourceInfoFooter;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("@bikdotai/bik-models/growth/models/bik-store"),s=require("../../assets/icons/alert_triangle.svg.js"),o=require("../../assets/icons/plus.svg.js"),n=require("react"),i=require("../../constants/Theme.js"),r=require("../button/Button.js"),a=require("../shimmer/ShimmerComponent/BikShimmer.js"),d=require("../TypographyStyle.js"),l=require("./DataSourcePanel.style.js");const u=n.memo((u=>{const{appType:x,sourceIntent:m,hideHeading:j,messageSource:h,trainingSourceCount:g={},ShowTrainingDataSource:R={},faqCount:v,ChecklistType:E,footerButtonOption:y,isFooterLoading:T,reasonForAiGeneratedResponse:b,showAiResponseReason:A}=u,O=R,[C,S]=n.useState(!0),[f,I]=n.useState(!0),_="/bik-ai/training",[F,w]=n.useState({buttonTitle:"",redirectUrl:"",addFaqProps:{}}),[N,k]=n.useState({title:"",subTitle:""}),D=n.useMemo((()=>{const e=(null==g?void 0:g[m])||0;return e<=1?"There is "+e+"data source added to the identified intent":`There are ${e} data sources added to the identified intent`}),[g,m]),q=()=>{var e;(null==F?void 0:F.redirectUrl)?window.open(`${window.location.origin}${null==F?void 0:F.redirectUrl}`,"_self"):Object.keys(null!==(e=null==F?void 0:F.addFaqProps)&&void 0!==e?e:{}).length>0?null==y||y.onClick(F):(null==y?void 0:y.navigate)&&(null==y||y.navigate("Training",x==t.ApplicationType.MANIFEST?{tab:"/custom_data"}:{},{},!0))};return n.useEffect((()=>{var e,s,o,n;if(m){if(null===(e=null==h?void 0:h.sources)||void 0===e?void 0:e.length){const e=h.sources[0];if(O[m])m===E.ORDER_ENQUIRY&&I(!1);else{let i=null==e?void 0:e.insights,r="";switch(m){case E.PRODUCT_DETAILS:"Product reviews"!==(null==e?void 0:e.title)&&(i=`${v||"No"} FAQs added for this product`,r="Add product-specific information via FAQs to improve responses",w({buttonTitle:"Add FAQ",addFaqProps:{faqProducts:[{id:null==e?void 0:e.productId,variantId:null==e?void 0:e.variantId,name:null==e?void 0:e.title,imageUrl:null==e?void 0:e.imageUrl}]},redirectUrl:""}));break;case E.ORDER_MODIFICATION:i=(null==g?void 0:g[m])?void 0:"Customers who are looking to modify their orders would be redirected to your live agents via the agent handover flow.",i&&w({buttonTitle:x==t.ApplicationType.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:x==t.ApplicationType.MANIFEST?"/customise?tab=AgentHandover":_,addFaqProps:{}});break;case E.ORDER_CANCELLATION:i=(null==g?void 0:g[m])?void 0:"Customers who are looking to cancel their orders would be redirected to your live agents via the agent handover flow.",w({buttonTitle:x==t.ApplicationType.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:x==t.ApplicationType.MANIFEST?"/customise?tab=AgentHandover":_,addFaqProps:{}});break;case E.ORDER_TRACKING:if("ORDER_NOT_FOUND"===(null==e?void 0:e.subIntent))break;w({buttonTitle:x==t.ApplicationType.MANIFEST?"Add order tracking link":"Add relevant data",redirectUrl:x==t.ApplicationType.MANIFEST?"/training/order-management":_,addFaqProps:{}});break;case E.PRODUCT_SEARCH:if("QUIZ"===(null==e?void 0:e.type))break;if(-1!==(null===(n=null===(o=null===(s=null==h?void 0:h.sources)||void 0===s?void 0:s[0])||void 0===o?void 0:o.title)||void 0===n?void 0:n.toLowerCase().indexOf("collection"))){i="Collections are recommended by matching queries with collection names and descriptions. Add relevant keywords to your collection description to improve results.";break}i="Products are recommended by matching queries with product names, descriptions, tags, and collections. Add relevant keywords and tags to your products to improve results."}k({title:null!=i?i:"",subTitle:r})}}(O[m]||[E.PRODUCT_DETAILS,E.ORDER_MODIFICATION,E.ORDER_CANCELLATION,E.ORDER_TRACKING].includes(m))&&S(!1)}}),[null==h?void 0:h.messageId,g,m,null==h?void 0:h.sources,O,E,v,x,h]),e.jsxRuntimeExports.jsx(l.SourceInfoFooterStyle,{children:T?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(a.BikShimmer,{gap:"8px",direction:"column",boxes:[{height:"20px",width:"300px"},{height:"80px",width:"300px"}]})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!(null==N?void 0:N.title)&&g&&m in g?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(c,{hideHeading:null!=j&&j}),e.jsxRuntimeExports.jsx(p,{reason:b||"",showAiResponseReason:null!=A&&A}),e.jsxRuntimeExports.jsxs("div",Object.assign({className:"source_info_details "+(g[m]>0?"":"no_data_source")},{children:[g[m]>0&&f?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(d.BodyCaption,{children:D}),e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:i.COLORS.content.secondary},{children:"Improve responses by adding more data sources for the identified intent"}))]}):f&&e.jsxRuntimeExports.jsxs("div",Object.assign({className:"no_data_source_title"},{children:[e.jsxRuntimeExports.jsx(s.default,{width:15,height:15,color:i.COLORS.content.negative,style:{marginTop:2}}),e.jsxRuntimeExports.jsx(d.BodyCaption,{children:"No data sources added to the identified link"})]})),!y||y.hideAddDataButton||C?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(r.Button,{size:"small",buttonType:"tertiary",LeadingIcon:o.default,buttonText:(null==F?void 0:F.buttonTitle.length)>0?null==F?void 0:F.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>q(),style:{backgroundColor:"unset"}})]}))]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(c,{hideHeading:null!=j&&j}),e.jsxRuntimeExports.jsx(p,{reason:b||"",showAiResponseReason:null!=A&&A}),e.jsxRuntimeExports.jsxs("div",Object.assign({className:"source_info_details"},{children:[f&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(d.BodyCaption,{children:null==N?void 0:N.title}),e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:i.COLORS.content.secondary},{children:null==N?void 0:N.subTitle}))]}),!y||y.hideAddDataButton||C?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(r.Button,{size:"small",buttonType:"tertiary",LeadingIcon:o.default,buttonText:(null==F?void 0:F.buttonTitle.length)>0?null==F?void 0:F.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>q(),style:{backgroundColor:"unset"}})]}))]})})})})),c=n.memo((t=>t.hideHeading?null:e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:i.COLORS.content.secondary},{children:"Training insights"})))),p=n.memo((t=>{const[s,o]=n.useState(!1),r=t.reason&&t.reason.length>50,a=r&&!s?t.reason.substring(0,50)+"...":t.reason;return t.showAiResponseReason?e.jsxRuntimeExports.jsxs("div",Object.assign({className:"source_info_details"},{children:[e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:i.COLORS.content.primary,className:"why_ai_gave_this_response"},{children:"Here’s why your AI gave this response"})),e.jsxRuntimeExports.jsxs(d.BodyCaption,Object.assign({color:i.COLORS.content.secondary,className:"clamp-text"},{children:[a||"No reason provided for this response.",r&&e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:i.COLORS.content.brand,style:{cursor:"pointer",textDecoration:"underline",marginTop:"4px"},onClick:()=>o(!s)},{children:s?"Show less":"Show more"}))]}))]})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})}));p.displayName="WhyAiGaveThisResponse",c.displayName="TrainingInsightsHeading",u.displayName="SourceInfoFooter",exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("@bikdotai/bik-models/growth/models/bik-store"),i=require("../../assets/icons/alert_triangle.svg.js"),s=require("../../assets/icons/plus.svg.js"),n=require("react"),o=require("../../constants/Theme.js"),r=require("../button/Button.js"),a=require("../shimmer/ShimmerComponent/BikShimmer.js"),d=require("../TypographyStyle.js"),l=require("./DataSourcePanel.style.js");const u=n.memo((u=>{const{appType:x,sourceIntent:m,hideHeading:h,messageSource:j,trainingSourceCount:g={},ShowTrainingDataSource:R={},faqCount:v,ChecklistType:E,footerButtonOption:y,isFooterLoading:T,reasonForAiGeneratedResponse:b,showAiResponseReason:A,aiResponseLoading:O}=u,C=R,[S,f]=n.useState(!0),[I,F]=n.useState(!0),_="/bik-ai/training",[w,N]=n.useState({buttonTitle:"",redirectUrl:"",addFaqProps:{}}),[k,D]=n.useState({title:"",subTitle:""}),L=n.useMemo((()=>{const e=(null==g?void 0:g[m])||0;return e<=1?"There is "+e+"data source added to the identified intent":`There are ${e} data sources added to the identified intent`}),[g,m]),q=()=>{var e;(null==w?void 0:w.redirectUrl)?window.open(`${window.location.origin}${null==w?void 0:w.redirectUrl}`,"_self"):Object.keys(null!==(e=null==w?void 0:w.addFaqProps)&&void 0!==e?e:{}).length>0?null==y||y.onClick(w):(null==y?void 0:y.navigate)&&(null==y||y.navigate("Training",x==t.ApplicationType.MANIFEST?{tab:"/custom_data"}:{},{},!0))};return n.useEffect((()=>{var e,i,s,n;if(m){if(null===(e=null==j?void 0:j.sources)||void 0===e?void 0:e.length){const e=j.sources[0];if(C[m])m===E.ORDER_ENQUIRY&&F(!1);else{let o=null==e?void 0:e.insights,r="";switch(m){case E.PRODUCT_DETAILS:"Product reviews"!==(null==e?void 0:e.title)&&(o=`${v||"No"} FAQs added for this product`,r="Add product-specific information via FAQs to improve responses",N({buttonTitle:"Add FAQ",addFaqProps:{faqProducts:[{id:null==e?void 0:e.productId,variantId:null==e?void 0:e.variantId,name:null==e?void 0:e.title,imageUrl:null==e?void 0:e.imageUrl}]},redirectUrl:""}));break;case E.ORDER_MODIFICATION:o=(null==g?void 0:g[m])?void 0:"Customers who are looking to modify their orders would be redirected to your live agents via the agent handover flow.",o&&N({buttonTitle:x==t.ApplicationType.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:x==t.ApplicationType.MANIFEST?"/customise?tab=AgentHandover":_,addFaqProps:{}});break;case E.ORDER_CANCELLATION:o=(null==g?void 0:g[m])?void 0:"Customers who are looking to cancel their orders would be redirected to your live agents via the agent handover flow.",N({buttonTitle:x==t.ApplicationType.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:x==t.ApplicationType.MANIFEST?"/customise?tab=AgentHandover":_,addFaqProps:{}});break;case E.ORDER_TRACKING:if("ORDER_NOT_FOUND"===(null==e?void 0:e.subIntent))break;N({buttonTitle:x==t.ApplicationType.MANIFEST?"Add order tracking link":"Add relevant data",redirectUrl:x==t.ApplicationType.MANIFEST?"/training/order-management":_,addFaqProps:{}});break;case E.PRODUCT_SEARCH:if("QUIZ"===(null==e?void 0:e.type))break;if(-1!==(null===(n=null===(s=null===(i=null==j?void 0:j.sources)||void 0===i?void 0:i[0])||void 0===s?void 0:s.title)||void 0===n?void 0:n.toLowerCase().indexOf("collection"))){o="Collections are recommended by matching queries with collection names and descriptions. Add relevant keywords to your collection description to improve results.";break}o="Products are recommended by matching queries with product names, descriptions, tags, and collections. Add relevant keywords and tags to your products to improve results."}D({title:null!=o?o:"",subTitle:r})}}(C[m]||[E.PRODUCT_DETAILS,E.ORDER_MODIFICATION,E.ORDER_CANCELLATION,E.ORDER_TRACKING].includes(m))&&f(!1)}}),[null==j?void 0:j.messageId,g,m,null==j?void 0:j.sources,C,E,v,x,j]),e.jsxRuntimeExports.jsx(l.SourceInfoFooterStyle,{children:T?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(a.BikShimmer,{gap:"8px",direction:"column",boxes:[{height:"20px",width:"300px"},{height:"80px",width:"300px"}]})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:!(null==k?void 0:k.title)&&g&&m in g?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(c,{hideHeading:null!=h&&h}),e.jsxRuntimeExports.jsx(p,{reason:b||"",showAiResponseReason:null!=A&&A,isLoading:null!=O&&O,appType:x}),e.jsxRuntimeExports.jsxs("div",Object.assign({className:"source_info_details "+(g[m]>0?"":"no_data_source")},{children:[g[m]>0&&I?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(d.BodyCaption,{children:L}),e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:o.COLORS.content.secondary},{children:"Improve responses by adding more data sources for the identified intent"}))]}):I&&e.jsxRuntimeExports.jsxs("div",Object.assign({className:"no_data_source_title"},{children:[e.jsxRuntimeExports.jsx(i.default,{width:15,height:15,color:o.COLORS.content.negative,style:{marginTop:2}}),e.jsxRuntimeExports.jsx(d.BodyCaption,{children:"No data sources added to the identified link"})]})),!y||y.hideAddDataButton||S?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(r.Button,{size:"small",buttonType:"tertiary",LeadingIcon:s.default,buttonText:(null==w?void 0:w.buttonTitle.length)>0?null==w?void 0:w.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>q(),style:{backgroundColor:"unset"}})]}))]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(c,{hideHeading:null!=h&&h}),e.jsxRuntimeExports.jsx(p,{reason:b||"",showAiResponseReason:null!=A&&A,isLoading:null!=O&&O,appType:x}),e.jsxRuntimeExports.jsxs("div",Object.assign({className:"source_info_details"},{children:[I&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(d.BodyCaption,{children:null==k?void 0:k.title}),e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:o.COLORS.content.secondary},{children:null==k?void 0:k.subTitle}))]}),!y||y.hideAddDataButton||S?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(r.Button,{size:"small",buttonType:"tertiary",LeadingIcon:s.default,buttonText:(null==w?void 0:w.buttonTitle.length)>0?null==w?void 0:w.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>q(),style:{backgroundColor:"unset"}})]}))]})})})})),c=n.memo((t=>t.hideHeading?null:e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:o.COLORS.content.secondary},{children:"Training insights"})))),p=n.memo((i=>{const[s,r]=n.useState(!1),l=i.reason&&i.reason.length>150,u=l&&!s?i.reason.substring(0,150)+"...":i.reason;return i.appType!==t.ApplicationType.MANIFEST?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i.isLoading?e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:70,width:"100%",marginBottom:8}},{children:e.jsxRuntimeExports.jsx(a.BikShimmer,{boxes:[{height:"20px",width:"30%"},{height:"20px",width:"100%"}],direction:"column",gap:"2px",isBrand:!1})})):e.jsxRuntimeExports.jsxs("div",Object.assign({className:"source_info_details"},{children:[e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:o.COLORS.content.primary,className:"why_ai_gave_this_response"},{children:"Here’s why your AI gave this response"})),e.jsxRuntimeExports.jsxs(d.BodyCaption,Object.assign({color:o.COLORS.content.secondary,className:"clamp-text"},{children:[u||"No reason provided for this response.",l&&e.jsxRuntimeExports.jsx(d.BodyCaption,Object.assign({color:o.COLORS.content.brand,style:{cursor:"pointer",textDecoration:"underline",marginTop:"4px"},onClick:()=>r(!s)},{children:s?"Show less":"Show more"}))]}))]}))})}));p.displayName="WhyAiGaveThisResponse",c.displayName="TrainingInsightsHeading",u.displayName="SourceInfoFooter",exports.default=u;
@@ -37,6 +37,7 @@ export interface DataSourcePanelProps {
37
37
  productSourceData?: ProductSourceData;
38
38
  reasonForAiGeneratedResponse?: string;
39
39
  showAiResponseReason?: boolean;
40
+ aiResponseLoading?: boolean;
40
41
  productSearchRule?: ProductSearchRuleDB;
41
42
  onEditProductSearchRule?: (ruleId: string) => void;
42
43
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("@bikdotai/bik-models/growth/models/bik-store"),s=require("../../assets/icons/box_search.svg.js"),i=require("../../assets/icons/boxV2.svg.js"),o=require("../../assets/icons/chevronDownOutline.svg.js"),n=require("../../assets/icons/chevronUpOutline.svg.js"),r=require("../../assets/icons/cross.svg.js"),l=require("../../assets/icons/edit.svg.js"),a=require("../../assets/icons/filePdf.svg.js"),d=require("../../assets/icons/help.svg.js"),c=require("../../assets/icons/info.svg.js"),u=require("../../assets/icons/openai.svg.js"),x=require("../../assets/icons/plus.svg.js"),p=require("../../assets/icons/redirect.svg.js"),j=require("../../assets/icons/text_t9.svg.js"),m=require("../../assets/icons/website.svg.js"),g=require("react"),h=require("../../constants/Theme.js"),y=require("../button/Button.js"),E=require("../icon-button/IconButton.js"),C=require("../shimmer/ShimmerComponent/BikShimmer.js"),R=require("../side-modal/SideModal.js"),O=require("../tag/Tag.js"),f=require("../tooltips/Tooltip.js"),v=require("../TypographyStyle.js"),S=require("./DataSourceInfoFooter.js"),T=require("./DataSourcePanel.style.js"),I=require("./IntentConfig.js"),b=require("./Modals/DescriptionModal.js"),L=require("./model.js");exports.DataSourcePanel=w=>{var D,N;const{appType:A,storeId:_,messageSource:k,setMessageSourcePanel:F,hideCloseButton:B,isSourceInfoFetched:q,allSourceInfoDetail:P,ChecklistType:M,title:U,zeroStateButton:K,editableSources:W,preFillTrainingSourceCount:$,redirect:H,footerButtonOption:Q,fetchTrainingSourceCount:G,fetchProductFAQCount:Y,productSourceData:z,reasonForAiGeneratedResponse:X,showAiResponseReason:V,productSearchRule:J,onEditProductSearchRule:Z}=w,{sources:ee}=k,te=["blog","article","page","policy"],[se,ie]=g.useState(!1),[oe,ne]=g.useState(!1),[re,le]=g.useState(!1),[ae,de]=g.useState(0),[ce,ue]=g.useState(),[xe,pe]=g.useState(null!=$?$:{}),[je,me]=g.useState(!1),[ge,he]=g.useState(!1),ye={};I.intentConfig.forEach((t=>{let{key:s,type:i,tagText:o}=t;M[s]&&(ye[M[s]]=e.jsxRuntimeExports.jsx(O.Tag,{theme:"light",type:i,tagText:o,cursor:"pointer"}))}));const Ee=ee.filter((e=>"PRODUCTS"==e.type||"Products"==e.subTitle||e.productId)),Ce=ee.filter((e=>"PRODUCTS"!=e.type&&"Products"!=e.subTitle&&!e.productId)),Re=g.useMemo((()=>{const e={};return["STORE_INFORMATION","CONTACT_INFO","STORE_LOCATION","SHIPPING_POLICY","RETURN_AND_REFUND","SALES_AND_OFFERS","SALES_AND_OFFERS_ISSUES","PRODUCT_CUSTOMISATION","PAYMENT_METHODS","CHECKOUT_ENQUIRY","ORDER_ENQUIRY"].forEach((t=>{M[t]&&(e[M[t]]=M[t])})),["COLLABORATION","SUBSCRIPTION_ENQUIRY"].forEach((t=>{e[t]=t})),e}),[M]);g.useEffect((()=>{var e,t,s,i;if(!(null==k?void 0:k.messageId))return;ie(!0),ne(!0),le(!1!==(null===(t=null===(e=k.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(i=null===(s=k.sources)||void 0===s?void 0:s[0])||void 0===i?void 0:i.insights));const o=k.sources.filter((e=>!!e.productId)).map((e=>e.productId)),n=Array.from(new Set(o)).filter((e=>!!e));Y(_,n).then((e=>de(e))).then((()=>{$?(pe($),setTimeout((()=>{ie(!1),ne(!1)}),100)):(setTimeout((()=>ie(!1)),100),G(_).then((e=>pe(e))).then((()=>setTimeout((()=>{ne(!1)}),100))))}))}),[Y,G,null==k?void 0:k.messageId,k.sources,$,_]);const Oe=e=>!!(e&&0===e.length||(null==k?void 0:k.isUnsatisfactoryAnswer)),fe=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var s;return"custom"==e?e=L.CustomDataType.FILES:te.includes(e)?e=L.CustomDataType.FETCHED_LINKS:"url"==e?e=L.CustomDataType.WEBSITE_LINKS:"text"===e?e=L.CustomDataType.TEXTS:"faq"===e&&(e=L.CustomDataType.FAQ),t?e:null===(s=null==e?void 0:e.toLowerCase())||void 0===s?void 0:s.replace(/_/g," ")},ve=e=>e?"faq"==e.toLocaleLowerCase()?"FAQ":"openai"==e.toLocaleLowerCase()?"OPENAI":"files"==e.toLocaleLowerCase()?"PDF":"texts"==e.toLocaleLowerCase()?"Custom text":((e=(e=e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(e=e.slice(0,-1)),e.replace("Website","Manual")):"",Se=t=>"products"==t||"product"==t?e.jsxRuntimeExports.jsx(i.default,{height:16,width:16,color:h.COLORS.content.secondary}):"files"==t?e.jsxRuntimeExports.jsx(a.default,{height:16,width:16,color:h.COLORS.content.secondary}):"website links"==t||"fetched links"==t?e.jsxRuntimeExports.jsx(m.default,{height:16,width:16,color:h.COLORS.content.secondary}):"faq"==t?e.jsxRuntimeExports.jsx(d.default,{height:16,width:16,color:h.COLORS.content.secondary}):"texts"==t?e.jsxRuntimeExports.jsx(j.default,{height:16,width:16,color:h.COLORS.content.secondary}):e.jsxRuntimeExports.jsx(u.default,{height:16,width:16,color:h.COLORS.content.secondary}),Te=e=>{const t=e.replace(/(<([^>]+)>)/gi,""),s=document.createElement("textarea");return s.innerHTML=t,s.value};if(se||!q)return e.jsxRuntimeExports.jsx(T.SourceInfoDetailsStyle,{children:e.jsxRuntimeExports.jsx(C.BikShimmer,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})});const Ie=s=>{const{title:i,count:r,isExpanded:l,onToggle:a,children:d}=s;return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",cursor:"pointer"},onClick:a},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({style:{fontWeight:"600"}},{children:i})),A===t.ApplicationType.MANIFEST?e.jsxRuntimeExports.jsx("div",Object.assign({style:{backgroundColor:h.COLORS.surface.subdued,color:h.COLORS.content.secondary,padding:"2px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"500"}},{children:r})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})]})),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:A===t.ApplicationType.BIK?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):l?e.jsxRuntimeExports.jsx(o.default,{width:20,height:20,color:h.COLORS.content.primary}):e.jsxRuntimeExports.jsx(n.default,{width:20,height:20,color:h.COLORS.content.primary})})]})),l&&d]})};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(T.SourceInfoDetailsStyle,{children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",padding:0,paddingBottom:"12px"}},{children:[!!U&&e.jsxRuntimeExports.jsx(v.TitleSmall,{children:U}),e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:"Intent"})),null!==(D=ye[k.intent])&&void 0!==D?D:ye.GENERIC,!B&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>F(void 0)},{children:e.jsxRuntimeExports.jsx(r.default,{height:20,width:20,color:h.COLORS.content.secondary})}))]})),J&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"12px",marginTop:"6px"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[e.jsxRuntimeExports.jsx(v.BodySecondary,Object.assign({color:h.COLORS.content.primary},{children:J.rule_name})),Z&&J.rule_id&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[e.jsxRuntimeExports.jsx(s.default,{width:14,color:h.COLORS.content.secondary}),e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:"Edit search rule"})),e.jsxRuntimeExports.jsx(E.IconButton,{Icon:l.default,height:16,width:16,bordered:!0,iconColor:h.COLORS.content.primary,onClick:()=>Z(null==J?void 0:J.rule_id)})]}))]})),J.keywords&&J.keywords.length>0&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px",backgroundColor:h.COLORS.surface.subdued,borderRadius:"8px",border:`1px dashed ${h.COLORS.stroke.primary}`}},{children:J.keywords.map(((t,s)=>e.jsxRuntimeExports.jsx(O.Tag,{tagText:t,theme:"light"},`keyword-${s}`)))}))]})),Oe(ee)?e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var t,s;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${h.COLORS.background.negative.light}`,borderRadius:"100px"}},{children:e.jsxRuntimeExports.jsx(c.default,{width:24,height:24,color:h.COLORS.stroke.negative.vibrant})})),e.jsxRuntimeExports.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e.jsxRuntimeExports.jsx(v.TitleSmall,{children:"Insufficient data"})})),e.jsxRuntimeExports.jsx(v.BodySecondary,Object.assign({color:h.COLORS.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),K&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsxRuntimeExports.jsx(y.Button,{LeadingIcon:null!==(t=K.leadingIcon)&&void 0!==t?t:x.default,buttonText:null!==(s=K.title)&&void 0!==s?s:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{K.onClick()}})}))]}))})()})):!J&&e.jsxRuntimeExports.jsx(O.Tag,{LeadingIcon:c.default,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:k.isEditable?`If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in ${A===t.ApplicationType.BIK?"BIK":"Manifest"}.`:"Edit the original source and save again to update the response"})]})),!Oe(ee)&&e.jsxRuntimeExports.jsxs("div",Object.assign({className:"info-container"},{children:[e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Ee.length>0&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"info-product-source"},{children:e.jsxRuntimeExports.jsx(Ie,Object.assign({title:"Product Sources",count:Ee.length,isExpanded:A!==t.ApplicationType.MANIFEST||je,onToggle:()=>me(!je)},{children:e.jsxRuntimeExports.jsx("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Ee.map(((t,s)=>{var i,o,n,r;const a=fe(t.type||t.subTitle||"OpenAI"),d=fe(t.type||t.subTitle||"OpenAI",!0),c=ve(a),u=null==W?void 0:W.includes(d),x=P[null!==(i=t.productId)&&void 0!==i?i:"Products"],j=t.title,m=t.productId&&(null==z?void 0:z[t.productId]),g=m&&m.metafield.join(", ");return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:s+1<(null==Ee?void 0:Ee.length)?`1px solid ${h.COLORS.stroke.primary}`:"none"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Se(a),e.jsxRuntimeExports.jsx(f.Tooltip,Object.assign({body:j,placement:"top"},{children:e.jsxRuntimeExports.jsx(v.BodySecondary,Object.assign({style:d==L.CustomDataType.FETCHED_LINKS||d==L.CustomDataType.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:h.COLORS.content.primary,className:"clamp-title",onClick:()=>d==L.CustomDataType.FETCHED_LINKS||d==L.CustomDataType.WEBSITE_LINKS?H(t):{}},{children:j}))}))]})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[t.intent!==M.EMAIL_COLLECTION&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:c}))}),(t.link||t.docId)&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:u?e.jsxRuntimeExports.jsx(E.IconButton,{Icon:l.default,height:16,width:16,iconColor:h.COLORS.content.secondary,onClick:()=>null==x?void 0:x.onEditClick(x.data,x.type),disabled:!x,disabledTooltip:"This source is deleted"}):e.jsxRuntimeExports.jsx(E.IconButton,{Icon:p.default,height:16,width:16,iconColor:h.COLORS.content.secondary,disabled:"custom"===t.type&&!x,disabledTooltip:"This source is deleted",onClick:()=>H(t)})}))]}))]})),m&&e.jsxRuntimeExports.jsxs(v.BodyCaption,{children:[e.jsxRuntimeExports.jsx("span",Object.assign({className:"product-data-text1",onClick:()=>{var e;ue({title:j,description:Te(m.description),imageUrl:null!==(e=t.imageUrl)&&void 0!==e?e:"",onClose:()=>ue(void 0)})}},{children:`${null===(o=m.description)||void 0===o?void 0:o.length} characters description,`})),e.jsxRuntimeExports.jsx("span",Object.assign({className:"product-data-text1",onClick:()=>m.onEditFaqClick(m.faqs)},{children:`${null===(n=m.faqs)||void 0===n?void 0:n.length} FAQs, `})),e.jsxRuntimeExports.jsx("span",Object.assign({className:"product-data-text2"},{children:"and"})),e.jsxRuntimeExports.jsx(f.Tooltip,Object.assign({body:g,placement:"top"},{children:e.jsxRuntimeExports.jsx("span",Object.assign({className:"product-data-text1"},{children:`${null===(r=m.metafield)||void 0===r?void 0:r.length} metafields`}))}))]})]}),`info-${s}`)}))}))}))}))}),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Ce.length>0&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"info-content-source"},{children:e.jsxRuntimeExports.jsx(Ie,Object.assign({title:"Content Sources",count:Ce.length,isExpanded:A!==t.ApplicationType.MANIFEST||ge,onToggle:()=>he(!ge)},{children:e.jsxRuntimeExports.jsx("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Ce.map(((t,s)=>{var i,o,n,r,a,d,c,u,x,j,m,g,y,C,R,O,S;const T=fe(t.type||t.subTitle||"OpenAI"),I=fe(t.type||t.subTitle||"OpenAI",!0),b=ve(T),w=null==W?void 0:W.includes(I),D="Products"===t.subTitle?P[null!==(i=t.productId)&&void 0!==i?i:"Products"]:P[null!==(o=t.docId)&&void 0!==o?o:""],N=I.toLowerCase()===(null===(n=L.CustomDataType.FAQ)||void 0===n?void 0:n.toLowerCase())?"faq"===(null===(r=t.title)||void 0===r?void 0:r.toLowerCase())?t.subTitle:t.title:I.toLowerCase()===(null===(a=L.CustomDataType.FILES)||void 0===a?void 0:a.toLowerCase())||I.toLowerCase()===(null===(d=L.CustomDataType.FETCHED_LINKS)||void 0===d?void 0:d.toLowerCase())||I.toLowerCase()===(null===(c=L.CustomDataType.TEXTS)||void 0===c?void 0:c.toLowerCase())?t.title:I.toLowerCase()===(null===(u=L.CustomDataType.WEBSITE_LINKS)||void 0===u?void 0:u.toLowerCase())?t.title.split("/")[t.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,s)=>t.toUpperCase()+s)):t.intent===M.EMAIL_COLLECTION?b:t.title,A="faq"===I.toLowerCase()?null!==(m=null!==(x=null==D?void 0:D.content)&&void 0!==x?x:null===(j=null==D?void 0:D.data)||void 0===j?void 0:j.answer)&&void 0!==m?m:"":I.toLowerCase()===(null===(g=L.CustomDataType.FETCHED_LINKS)||void 0===g?void 0:g.toLowerCase())||I.toLowerCase()===(null===(y=L.CustomDataType.WEBSITE_LINKS)||void 0===y?void 0:y.toLowerCase())||I.toLowerCase()===(null===(C=L.CustomDataType.TEXTS)||void 0===C?void 0:C.toLowerCase())?null!==(S=null!==(R=null==D?void 0:D.content)&&void 0!==R?R:null===(O=null==D?void 0:D.data)||void 0===O?void 0:O.fileContentText)&&void 0!==S?S:"":t.intent===M.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:s+1<(null==Ce?void 0:Ce.length)?`1px solid ${h.COLORS.stroke.primary}`:"none"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Se(T),e.jsxRuntimeExports.jsx(f.Tooltip,Object.assign({body:N,placement:"top"},{children:e.jsxRuntimeExports.jsx(v.BodySecondary,Object.assign({style:I==L.CustomDataType.FETCHED_LINKS||I==L.CustomDataType.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:h.COLORS.content.primary,className:"clamp-title",onClick:()=>I==L.CustomDataType.FETCHED_LINKS||I==L.CustomDataType.WEBSITE_LINKS?H(t):{}},{children:N}))}))]})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[t.intent!==M.EMAIL_COLLECTION&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:b}))}),(t.link||t.docId)&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:w?e.jsxRuntimeExports.jsx(E.IconButton,{Icon:l.default,height:16,width:16,iconColor:h.COLORS.content.secondary,onClick:()=>null==D?void 0:D.onEditClick(D.data,D.type),disabled:!D,disabledTooltip:"This source is deleted"}):e.jsxRuntimeExports.jsx(E.IconButton,{Icon:p.default,height:16,width:16,iconColor:h.COLORS.content.secondary,disabled:"custom"===t.type&&!D,disabledTooltip:"This source is deleted",onClick:()=>H(t)})}))]}))]})),(null!=A?A:"").trim()&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${h.COLORS.stroke.primary}`,borderRadius:"4px",backgroundColor:h.COLORS.surface.subdued}},{children:e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.primary,className:"clamp-description"},{children:Te(null!=A?A:"").trim()}))}))]}),`info-${s}`)}))}))}))}))})]})),re&&!Oe(ee)&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"footer"},{children:e.jsxRuntimeExports.jsx(S.default,{appType:A,storeId:_,messageSource:k,sourceIntent:null!==(N=k.intent)&&void 0!==N?N:M.GENERIC,faqCount:ae,trainingSourceCount:xe,ShowTrainingDataSource:Re,ChecklistType:M,footerButtonOption:Q,isFooterLoading:oe,reasonForAiGeneratedResponse:X,showAiResponseReason:V})}))]})}),ce&&e.jsxRuntimeExports.jsx(R.SideModal,Object.assign({header:"Product description",onClose:()=>ue(void 0),width:"30%"},{children:e.jsxRuntimeExports.jsx(b.DescriptionModal,{title:ce.title,description:ce.description,imageUrl:ce.imageUrl,onClose:ce.onClose})}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("@bikdotai/bik-models/growth/models/bik-store"),s=require("../../assets/icons/box_search.svg.js"),i=require("../../assets/icons/boxV2.svg.js"),o=require("../../assets/icons/chevronDownOutline.svg.js"),n=require("../../assets/icons/chevronUpOutline.svg.js"),r=require("../../assets/icons/cross.svg.js"),l=require("../../assets/icons/edit.svg.js"),a=require("../../assets/icons/filePdf.svg.js"),d=require("../../assets/icons/help.svg.js"),c=require("../../assets/icons/info.svg.js"),x=require("../../assets/icons/openai.svg.js"),u=require("../../assets/icons/plus.svg.js"),p=require("../../assets/icons/redirect.svg.js"),j=require("../../assets/icons/text_t9.svg.js"),m=require("../../assets/icons/website.svg.js"),g=require("react"),h=require("../../constants/Theme.js"),y=require("../button/Button.js"),E=require("../icon-button/IconButton.js"),C=require("../shimmer/ShimmerComponent/BikShimmer.js"),R=require("../side-modal/SideModal.js"),O=require("../tag/Tag.js"),f=require("../tooltips/Tooltip.js"),v=require("../TypographyStyle.js"),S=require("./DataSourceInfoFooter.js"),T=require("./DataSourcePanel.style.js"),I=require("./IntentConfig.js"),b=require("./Modals/DescriptionModal.js"),L=require("./model.js");exports.DataSourcePanel=w=>{var D,N;const{appType:A,storeId:k,messageSource:_,setMessageSourcePanel:F,hideCloseButton:B,isSourceInfoFetched:q,allSourceInfoDetail:P,ChecklistType:M,title:U,zeroStateButton:K,editableSources:W,preFillTrainingSourceCount:$,redirect:H,footerButtonOption:Q,fetchTrainingSourceCount:G,fetchProductFAQCount:Y,productSourceData:z,reasonForAiGeneratedResponse:X,showAiResponseReason:V,aiResponseLoading:J,productSearchRule:Z,onEditProductSearchRule:ee}=w,{sources:te}=_,se=["blog","article","page","policy"],[ie,oe]=g.useState(!1),[ne,re]=g.useState(!1),[le,ae]=g.useState(!1),[de,ce]=g.useState(0),[xe,ue]=g.useState(),[pe,je]=g.useState(null!=$?$:{}),[me,ge]=g.useState(!1),[he,ye]=g.useState(!1),Ee={};I.intentConfig.forEach((t=>{let{key:s,type:i,tagText:o}=t;M[s]&&(Ee[M[s]]=e.jsxRuntimeExports.jsx(O.Tag,{theme:"light",type:i,tagText:o,cursor:"pointer"}))}));const Ce=te.filter((e=>"PRODUCTS"==e.type||"Products"==e.subTitle||e.productId)),Re=te.filter((e=>"PRODUCTS"!=e.type&&"Products"!=e.subTitle&&!e.productId)),Oe=g.useMemo((()=>{const e={};return["STORE_INFORMATION","CONTACT_INFO","STORE_LOCATION","SHIPPING_POLICY","RETURN_AND_REFUND","SALES_AND_OFFERS","SALES_AND_OFFERS_ISSUES","PRODUCT_CUSTOMISATION","PAYMENT_METHODS","CHECKOUT_ENQUIRY","ORDER_ENQUIRY"].forEach((t=>{M[t]&&(e[M[t]]=M[t])})),["COLLABORATION","SUBSCRIPTION_ENQUIRY"].forEach((t=>{e[t]=t})),e}),[M]);g.useEffect((()=>{var e,t,s,i;if(!(null==_?void 0:_.messageId))return;oe(!0),re(!0),ae(!1!==(null===(t=null===(e=_.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(i=null===(s=_.sources)||void 0===s?void 0:s[0])||void 0===i?void 0:i.insights));const o=_.sources.filter((e=>!!e.productId)).map((e=>e.productId)),n=Array.from(new Set(o)).filter((e=>!!e));Y(k,n).then((e=>ce(e))).then((()=>{$?(je($),setTimeout((()=>{oe(!1),re(!1)}),100)):(setTimeout((()=>oe(!1)),100),G(k).then((e=>je(e))).then((()=>setTimeout((()=>{re(!1)}),100))))}))}),[Y,G,null==_?void 0:_.messageId,_.sources,$,k]);const fe=e=>!!(e&&0===e.length||(null==_?void 0:_.isUnsatisfactoryAnswer)),ve=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var s;return"custom"==e?e=L.CustomDataType.FILES:se.includes(e)?e=L.CustomDataType.FETCHED_LINKS:"url"==e?e=L.CustomDataType.WEBSITE_LINKS:"text"===e?e=L.CustomDataType.TEXTS:"faq"===e&&(e=L.CustomDataType.FAQ),t?e:null===(s=null==e?void 0:e.toLowerCase())||void 0===s?void 0:s.replace(/_/g," ")},Se=e=>e?"faq"==e.toLocaleLowerCase()?"FAQ":"openai"==e.toLocaleLowerCase()?"OPENAI":"files"==e.toLocaleLowerCase()?"PDF":"texts"==e.toLocaleLowerCase()?"Custom text":((e=(e=e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(e=e.slice(0,-1)),e.replace("Website","Manual")):"",Te=t=>"products"==t||"product"==t?e.jsxRuntimeExports.jsx(i.default,{height:16,width:16,color:h.COLORS.content.secondary}):"files"==t?e.jsxRuntimeExports.jsx(a.default,{height:16,width:16,color:h.COLORS.content.secondary}):"website links"==t||"fetched links"==t?e.jsxRuntimeExports.jsx(m.default,{height:16,width:16,color:h.COLORS.content.secondary}):"faq"==t?e.jsxRuntimeExports.jsx(d.default,{height:16,width:16,color:h.COLORS.content.secondary}):"texts"==t?e.jsxRuntimeExports.jsx(j.default,{height:16,width:16,color:h.COLORS.content.secondary}):e.jsxRuntimeExports.jsx(x.default,{height:16,width:16,color:h.COLORS.content.secondary}),Ie=e=>{const t=e.replace(/(<([^>]+)>)/gi,""),s=document.createElement("textarea");return s.innerHTML=t,s.value};if(ie||!q)return e.jsxRuntimeExports.jsx(T.SourceInfoDetailsStyle,{children:e.jsxRuntimeExports.jsx(C.BikShimmer,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})});const be=s=>{const{title:i,count:r,isExpanded:l,onToggle:a,children:d}=s;return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",cursor:"pointer"},onClick:a},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[e.jsxRuntimeExports.jsx(v.BodySecondary,{children:i}),A===t.ApplicationType.MANIFEST?e.jsxRuntimeExports.jsx("div",Object.assign({style:{backgroundColor:h.COLORS.surface.subdued,color:h.COLORS.content.secondary,padding:"2px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"500",border:`1px solid ${h.COLORS.stroke.primary}`}},{children:r})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})]})),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:A===t.ApplicationType.BIK?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):l?e.jsxRuntimeExports.jsx(n.default,{width:20,height:20,color:h.COLORS.content.primary}):e.jsxRuntimeExports.jsx(o.default,{width:20,height:20,color:h.COLORS.content.primary})})]})),l&&d]})};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(T.SourceInfoDetailsStyle,{children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",padding:0,paddingBottom:"12px"}},{children:[!!U&&e.jsxRuntimeExports.jsx(v.TitleSmall,{children:U}),e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:"Intent"})),null!==(D=Ee[_.intent])&&void 0!==D?D:Ee.GENERIC,!B&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>F(void 0)},{children:e.jsxRuntimeExports.jsx(r.default,{height:20,width:20,color:h.COLORS.content.secondary})}))]})),Z&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"12px",marginTop:"6px"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[e.jsxRuntimeExports.jsx(v.BodySecondary,Object.assign({color:h.COLORS.content.primary},{children:Z.rule_name})),ee&&Z.rule_id&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[e.jsxRuntimeExports.jsx(s.default,{width:14,color:h.COLORS.content.secondary}),e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:"Edit search rule"})),e.jsxRuntimeExports.jsx(E.IconButton,{Icon:l.default,height:16,width:16,bordered:!0,iconColor:h.COLORS.content.primary,onClick:()=>ee(null==Z?void 0:Z.rule_id)})]}))]})),Z.keywords&&Z.keywords.length>0&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px",backgroundColor:h.COLORS.surface.subdued,borderRadius:"8px",border:`1px dashed ${h.COLORS.stroke.primary}`}},{children:Z.keywords.map(((t,s)=>e.jsxRuntimeExports.jsx(O.Tag,{tagText:t,theme:"light"},`keyword-${s}`)))}))]})),fe(te)?e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var t,s;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${h.COLORS.background.negative.light}`,borderRadius:"100px"}},{children:e.jsxRuntimeExports.jsx(c.default,{width:24,height:24,color:h.COLORS.stroke.negative.vibrant})})),e.jsxRuntimeExports.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e.jsxRuntimeExports.jsx(v.TitleSmall,{children:"Insufficient data"})})),e.jsxRuntimeExports.jsx(v.BodySecondary,Object.assign({color:h.COLORS.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),K&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsxRuntimeExports.jsx(y.Button,{LeadingIcon:null!==(t=K.leadingIcon)&&void 0!==t?t:u.default,buttonText:null!==(s=K.title)&&void 0!==s?s:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{K.onClick()}})}))]}))})()})):!Z&&e.jsxRuntimeExports.jsx(O.Tag,{LeadingIcon:c.default,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:_.isEditable?`If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in ${A===t.ApplicationType.BIK?"BIK":"Manifest"}.`:"Edit the original source and save again to update the response"})]})),le&&!fe(te)&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"footer"},{children:e.jsxRuntimeExports.jsx(S.default,{appType:A,storeId:k,messageSource:_,sourceIntent:null!==(N=_.intent)&&void 0!==N?N:M.GENERIC,faqCount:de,trainingSourceCount:pe,ShowTrainingDataSource:Oe,ChecklistType:M,footerButtonOption:Q,isFooterLoading:ne,reasonForAiGeneratedResponse:X,showAiResponseReason:V,aiResponseLoading:J})})),!fe(te)&&e.jsxRuntimeExports.jsxs("div",Object.assign({className:"info-container"},{children:[e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Ce.length>0&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"info-product-source"},{children:e.jsxRuntimeExports.jsx(be,Object.assign({title:"Product Sources",count:Ce.length,isExpanded:A!==t.ApplicationType.MANIFEST||me,onToggle:()=>ge(!me)},{children:e.jsxRuntimeExports.jsx("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Ce.map(((t,s)=>{var i,o,n,r;const a=ve(t.type||t.subTitle||"OpenAI"),d=ve(t.type||t.subTitle||"OpenAI",!0),c=Se(a),x=null==W?void 0:W.includes(d),u=P[null!==(i=t.productId)&&void 0!==i?i:"Products"],j=t.title,m=t.productId&&(null==z?void 0:z[t.productId]),g=m&&m.metafield.join(", ");return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:s+1<(null==Ce?void 0:Ce.length)?`1px solid ${h.COLORS.stroke.primary}`:"none"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Te(a),e.jsxRuntimeExports.jsx(f.Tooltip,Object.assign({body:j,placement:"top"},{children:e.jsxRuntimeExports.jsx(v.BodySecondary,Object.assign({style:d==L.CustomDataType.FETCHED_LINKS||d==L.CustomDataType.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:h.COLORS.content.primary,className:"clamp-title",onClick:()=>d==L.CustomDataType.FETCHED_LINKS||d==L.CustomDataType.WEBSITE_LINKS?H(t):{}},{children:j}))}))]})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[t.intent!==M.EMAIL_COLLECTION&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:c}))}),(t.link||t.docId)&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:x?e.jsxRuntimeExports.jsx(E.IconButton,{Icon:l.default,height:16,width:16,iconColor:h.COLORS.content.secondary,onClick:()=>null==u?void 0:u.onEditClick(u.data,u.type),disabled:!u,disabledTooltip:"This source is deleted"}):e.jsxRuntimeExports.jsx(E.IconButton,{Icon:p.default,height:16,width:16,iconColor:h.COLORS.content.secondary,disabled:"custom"===t.type&&!u,disabledTooltip:"This source is deleted",onClick:()=>H(t)})}))]}))]})),m&&e.jsxRuntimeExports.jsxs(v.BodyCaption,{children:[e.jsxRuntimeExports.jsx("span",Object.assign({className:"product-data-text1",onClick:()=>{var e;ue({title:j,description:Ie(m.description),imageUrl:null!==(e=t.imageUrl)&&void 0!==e?e:"",onClose:()=>ue(void 0)})}},{children:`${null===(o=m.description)||void 0===o?void 0:o.length} characters description,`})),e.jsxRuntimeExports.jsx("span",Object.assign({className:"product-data-text1",onClick:()=>m.onEditFaqClick(m.faqs)},{children:`${null===(n=m.faqs)||void 0===n?void 0:n.length} FAQs, `})),e.jsxRuntimeExports.jsx("span",Object.assign({className:"product-data-text2"},{children:"and"})),e.jsxRuntimeExports.jsx(f.Tooltip,Object.assign({body:g,placement:"top"},{children:e.jsxRuntimeExports.jsx("span",Object.assign({className:"product-data-text1"},{children:`${null===(r=m.metafield)||void 0===r?void 0:r.length} metafields`}))}))]})]}),`info-${s}`)}))}))}))}))}),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Re.length>0&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"info-content-source"},{children:e.jsxRuntimeExports.jsx(be,Object.assign({title:"Content Sources",count:Re.length,isExpanded:A!==t.ApplicationType.MANIFEST||he,onToggle:()=>ye(!he)},{children:e.jsxRuntimeExports.jsx("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Re.map(((t,s)=>{var i,o,n,r,a,d,c,x,u,j,m,g,y,C,R,O,S;const T=ve(t.type||t.subTitle||"OpenAI"),I=ve(t.type||t.subTitle||"OpenAI",!0),b=Se(T),w=null==W?void 0:W.includes(I),D="Products"===t.subTitle?P[null!==(i=t.productId)&&void 0!==i?i:"Products"]:P[null!==(o=t.docId)&&void 0!==o?o:""],N=I.toLowerCase()===(null===(n=L.CustomDataType.FAQ)||void 0===n?void 0:n.toLowerCase())?"faq"===(null===(r=t.title)||void 0===r?void 0:r.toLowerCase())?t.subTitle:t.title:I.toLowerCase()===(null===(a=L.CustomDataType.FILES)||void 0===a?void 0:a.toLowerCase())||I.toLowerCase()===(null===(d=L.CustomDataType.FETCHED_LINKS)||void 0===d?void 0:d.toLowerCase())||I.toLowerCase()===(null===(c=L.CustomDataType.TEXTS)||void 0===c?void 0:c.toLowerCase())?t.title:I.toLowerCase()===(null===(x=L.CustomDataType.WEBSITE_LINKS)||void 0===x?void 0:x.toLowerCase())?t.title.split("/")[t.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,s)=>t.toUpperCase()+s)):t.intent===M.EMAIL_COLLECTION?b:t.title,A="faq"===I.toLowerCase()?null!==(m=null!==(u=null==D?void 0:D.content)&&void 0!==u?u:null===(j=null==D?void 0:D.data)||void 0===j?void 0:j.answer)&&void 0!==m?m:"":I.toLowerCase()===(null===(g=L.CustomDataType.FETCHED_LINKS)||void 0===g?void 0:g.toLowerCase())||I.toLowerCase()===(null===(y=L.CustomDataType.WEBSITE_LINKS)||void 0===y?void 0:y.toLowerCase())||I.toLowerCase()===(null===(C=L.CustomDataType.TEXTS)||void 0===C?void 0:C.toLowerCase())?null!==(S=null!==(R=null==D?void 0:D.content)&&void 0!==R?R:null===(O=null==D?void 0:D.data)||void 0===O?void 0:O.fileContentText)&&void 0!==S?S:"":t.intent===M.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:s+1<(null==Re?void 0:Re.length)?`1px solid ${h.COLORS.stroke.primary}`:"none"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Te(T),e.jsxRuntimeExports.jsx(f.Tooltip,Object.assign({body:N,placement:"top"},{children:e.jsxRuntimeExports.jsx(v.BodySecondary,Object.assign({style:I==L.CustomDataType.FETCHED_LINKS||I==L.CustomDataType.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:h.COLORS.content.primary,className:"clamp-title",onClick:()=>I==L.CustomDataType.FETCHED_LINKS||I==L.CustomDataType.WEBSITE_LINKS?H(t):{}},{children:N}))}))]})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[t.intent!==M.EMAIL_COLLECTION&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:b}))}),(t.link||t.docId)&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:w?e.jsxRuntimeExports.jsx(E.IconButton,{Icon:l.default,height:16,width:16,iconColor:h.COLORS.content.secondary,onClick:()=>null==D?void 0:D.onEditClick(D.data,D.type),disabled:!D,disabledTooltip:"This source is deleted"}):e.jsxRuntimeExports.jsx(E.IconButton,{Icon:p.default,height:16,width:16,iconColor:h.COLORS.content.secondary,disabled:"custom"===t.type&&!D,disabledTooltip:"This source is deleted",onClick:()=>H(t)})}))]}))]})),(null!=A?A:"").trim()&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${h.COLORS.stroke.primary}`,borderRadius:"4px",backgroundColor:h.COLORS.surface.subdued}},{children:e.jsxRuntimeExports.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.primary,className:"clamp-description"},{children:Ie(null!=A?A:"").trim()}))}))]}),`info-${s}`)}))}))}))}))})]}))]})}),xe&&e.jsxRuntimeExports.jsx(R.SideModal,Object.assign({header:"Product description",onClose:()=>ue(void 0),width:"30%"},{children:e.jsxRuntimeExports.jsx(b.DescriptionModal,{title:xe.title,description:xe.description,imageUrl:xe.imageUrl,onClose:xe.onClose})}))]})};
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),o=require("../../constants/Theme.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(e);const l=i.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),o=require("../../constants/Theme.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(e);const p=i.default.div`
2
2
  display: flex;
3
3
  margin: 0px 8px 0px 8px;
4
4
  padding: 20px 0px 20px 0px;
@@ -9,13 +9,14 @@
9
9
  flex-direction: column;
10
10
  border-radius: 8px;
11
11
  gap: 12px;
12
+ margin-top: 12px;
12
13
  }
13
14
  .info-content-source {
14
15
  border-radius: 8px;
15
16
  display: flex;
16
17
  flex-direction: column;
17
18
  gap: 8px;
18
- background-color: ${o.COLORS.surface.hovered};
19
+ background-color: ${o.COLORS.surface.grey};
19
20
  .source {
20
21
  border-radius: 12px;
21
22
  }
@@ -25,7 +26,7 @@
25
26
  display: flex;
26
27
  flex-direction: column;
27
28
  gap: 8px;
28
- background-color: ${o.COLORS.surface.hovered};
29
+ background-color: ${o.COLORS.surface.grey};
29
30
 
30
31
  .product-data-text1 {
31
32
  padding: 2px;
@@ -45,7 +46,7 @@
45
46
  }
46
47
  }
47
48
  .pop-up-header {
48
- padding: 6px 8px;
49
+ padding: 6px 0px;
49
50
  background-color: rgba(255, 255, 255, 0.1);
50
51
  display: flex;
51
52
  flex-direction: column;
@@ -54,7 +55,7 @@
54
55
  .footer {
55
56
  display: flex;
56
57
  flex-direction: column;
57
- margin: 24px 8px 0px 8px;
58
+ margin: 24px 0px 0px 0px;
58
59
  }
59
60
  .clamp-title {
60
61
  overflow: hidden;
@@ -92,6 +93,7 @@
92
93
  background-color: ${o.COLORS.surface.grey};
93
94
  max-height: calc(100vh - 380px);
94
95
  overflow-y: scroll;
96
+ margin-top: 12px;
95
97
  &::-webkit-scrollbar-thumb {
96
98
  background: #888;
97
99
  border-radius: 8px;
@@ -102,7 +104,7 @@
102
104
  }
103
105
  }
104
106
  .pop-up-header {
105
- padding: 6px 8px;
107
+ padding: 6px 0px;
106
108
  background-color: rgba(255, 255, 255, 0.1);
107
109
  display: flex;
108
110
  flex-direction: column;
@@ -137,7 +139,7 @@
137
139
  -webkit-box-orient: vertical;
138
140
  white-space: pre-line;
139
141
  }
140
- `;const p=i.default.div`
142
+ `;const l=i.default.div`
141
143
  display: flex;
142
144
  flex-direction: column;
143
145
  gap: 8px;
@@ -166,4 +168,4 @@
166
168
  background-color: ${o.COLORS.surface.subdued};
167
169
  border-radius: 22px;
168
170
  border: 1px solid ${o.COLORS.stroke.primary};
169
- `,exports.SourceInfoDetailsStyle=l,exports.SourceInfoFooterStyle=p;
171
+ `,exports.SourceInfoDetailsStyle=p,exports.SourceInfoFooterStyle=l;
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/react/jsx-runtime.js");require("../../curtain/CurtainHelper.js");var n=require("../../variable-picker-v3/model.js"),t=require("lodash"),o=require("react"),i=require("styled-components"),l=require("../../input/Input.js"),a=require("../../input-with-vars/InputWithVariables.js"),s=require("../../template-preview/helpers/templateMiscHelper.js"),d=require("../../template-preview/models/TemplateMeta.js"),r=require("../../template-preview/models/WhatsAppTemplate.js"),u=require("../context/templateModalContext.js"),p=require("../utils/constants.js"),c=require("../utils/getDataFromTemplateComponent.js"),v=require("../utils/validateIsUrl.js"),m=require("../utils/validateName.js"),b=require("./BackTrackComponent.js"),g=require("./DiscountCodeComponent.js"),x=require("./EditMediaModal.js"),j=require("./EditMediaV2.js"),h=require("./EditMediaV2.style.js"),f=require("./useEditWhtasappTemplateMedia.js"),C=require("./VariableConnector.js"),T=require("./VariableConnectorsPanel.js"),E=require("./VariableConnectorWhatsApp.js"),O=require("./VariableEditorHeader.js"),y=require("./WhatsAppTemplateCardButtonV2.js");function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const V=R(i).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/react/jsx-runtime.js");require("../../curtain/CurtainHelper.js");var t=require("../../variable-picker-v3/model.js"),n=require("lodash"),o=require("react"),i=require("styled-components"),l=require("../../input/Input.js"),a=require("../../input-with-vars/InputWithVariables.js"),s=require("../../template-preview/helpers/templateMiscHelper.js"),d=require("../../template-preview/models/TemplateMeta.js"),r=require("../../template-preview/models/WhatsAppTemplate.js"),u=require("../context/templateModalContext.js"),p=require("../utils/constants.js"),c=require("../utils/getDataFromTemplateComponent.js"),v=require("../utils/validateIsUrl.js"),m=require("../utils/validateName.js"),b=require("./BackTrackComponent.js"),g=require("./DiscountCodeComponent.js"),x=require("./EditMediaModal.js"),j=require("./EditMediaV2.js"),h=require("./EditMediaV2.style.js"),f=require("./useEditWhtasappTemplateMedia.js"),C=require("./VariableConnector.js"),T=require("./VariableConnectorsPanel.js"),E=require("./VariableConnectorWhatsApp.js"),O=require("./VariableEditorHeader.js"),y=require("./WhatsAppTemplateCardButtonV2.js");function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const V=R(i).default.div`
2
2
  padding-top: 24px;
3
3
  padding-left: 10px;
4
4
  padding-right: 10px;
5
5
  margin-bottom: 8px;
6
6
  line-height: normal;
7
- `;exports.default=i=>{let{template:R,onTemplateChange:B,whatsappSpecificPickerMeta:M,showVariableModal:k,variableListForImage:D,setDiscountCode:I,fileName:q,setFileName:P}=i;var L,w,A,U,N,_,H,S,F,Q,Y,W,K,$,G,X,z,J,Z,ee,ne,te,oe,ie,le,ae,se,de,re,ue,pe,ce,ve,me,be,ge,xe,je,he;const fe=R.isCarouselType,{originalVariableList:Ce,pod:Te,extras:Ee,selectedCarouselIndex:Oe,isProductCarouselType:ye,disableCopyCode:Re,isError:Ve,cardIndex:Be}=u.useTemplateModalContext(),{descriptionComponents:Me,urlBtns:ke,qrbBtns:De,imageComponent:Ie,bodyVariables:qe,headerVariables:Pe,titleVariables:Le}=c.getAllDataFromTemplateComponent(R),we=o.useRef(null),[Ae,Ue]=o.useState(!1),[Ne,_e]=o.useState(-1===Oe?{descriptionComponents:Me,urlBtns:ke,qrbBtns:De,imageComponent:Ie,bodyVariables:qe,headerVariables:Pe,titleVariables:Le}:{}),{uploadMediaLink:He,uploadMediaFiles:Se,validateMimeType:Fe}=M,Qe=f.useEditWhatsappTemplateMedia({uploadMediaLink:He,uploadMediaFiles:Se,updateTemplateImageUrl:function(e,n){var o,i,l,a,s,d,r,u;let p;p=null!=Oe&&Oe>-1?{components:null===(i=null===(o=R.components[Be])||void 0===o?void 0:o.cards)||void 0===i?void 0:i[Oe].components,mapping:null===(a=null===(l=null==R?void 0:R.mapping)||void 0===l?void 0:l.cards)||void 0===a?void 0:a[Oe]}:Object.assign({},R);const c=null===(s=null==p?void 0:p.components)||void 0===s?void 0:s.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==c&&c>-1&&(null==p?void 0:p.components[c])){const t=Object.assign(Object.assign({},p.components[c]),{format:n,example:{header_handle:[e]}}),o=[...p.components];o[c]=t,p=Object.assign(Object.assign({},p),{components:o})}p.mapping&&(p.mapping=Object.assign(Object.assign({},p.mapping),{header:void 0}));if(null!=Oe&&Oe>-1){const e=t.cloneDeep(R);e.components[Be].cards[Oe].components=p.components,(null===(d=null==e?void 0:e.mapping)||void 0===d?void 0:d.cards)&&(null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.cards.length)>0&&(e.mapping.cards[Oe]=null!==(u=p.mapping)&&void 0!==u?u:{}),null==B||B(Object.assign({},e)),We(!0)}else null==B||B(Object.assign({},p))},validateMimeType:Fe,mediaComponent:fe?Ne.imageComponent:Ie,fileRef:we}),[Ye,We]=o.useState(!1),[Ke,$e]=o.useState(q),[Ge,Xe]=o.useState();function ze(e,n,o){var i,l,a,d,r,u,p,c,v,m;const b=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},R).components[Be].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},R).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},R),g=t.cloneDeep(b),x="custom"===n&&"string"==typeof e,j=x?e:"string"!=typeof e?e.defaultValue?e.defaultValue:"https://d.bik.ai/":"https://d.bik.ai";if(null!=Oe&&Oe>-1&&ye){const n=Object.assign({},R).components.map((e=>{var n;return s.isCarouselComponent(e.type)?Object.assign(Object.assign({},e),{cards:null===(n=e.cards)||void 0===n?void 0:n.map((e=>Object.assign(Object.assign({},e),{components:e.components.map((e=>{var n,t,i;if("BUTTONS"===e.type){const l=null===(n=e.buttons)||void 0===n?void 0:n.filter((e=>"URL"===e.type));let a=null!==(t=null==l?void 0:l[o])&&void 0!==t?t:{};a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[j]});const s=null===(i=e.buttons)||void 0===i?void 0:i.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e));return Object.assign(Object.assign({},e),{buttons:s})}return e}))})))}):e})),i=null===(d=null===(a=Object.assign({},R).mapping)||void 0===a?void 0:a.cards)||void 0===d?void 0:d.map((n=>{var t;return Object.assign(Object.assign({},n),{buttons:null===(t=null==n?void 0:n.buttons)||void 0===t?void 0:t.map(((n,t)=>t===o?x?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"":n))})})),l=t.cloneDeep(R);return l.components=n,l.mapping.cards=i,void(null==B||B(Object.assign({},l)))}const h=null==g?void 0:g.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==h&&h>-1){const t=null===(r=null==g?void 0:g.components[h].buttons)||void 0===r?void 0:r.filter((e=>"URL"===e.type));if((null==t?void 0:t.length)>0){const i="custom"===n&&"string"==typeof e,l=i?e:"string"!=typeof e&&e.defaultValue?e.defaultValue:"https://d.bik.ai/";let a=t[o];a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[l]});const s=[...null!==(c=null===(p=null===(u=g.components)||void 0===u?void 0:u[h])||void 0===p?void 0:p.buttons)&&void 0!==c?c:[]].map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e)),d=Object.assign(Object.assign({},g.components[h]),{buttons:s}),r=null===(v=g.mapping)||void 0===v?void 0:v.buttons;r&&r.length>0&&(r[o]=i?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"");const m=Object.assign(Object.assign({},g.mapping),{buttons:r});g.mapping=m;const b=[...g.components];b[h]=d,g.components=b}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(m=e.placeHolder)||void 0===m?void 0:m.slice(2,-2))?Ue(!0):(Ue(!1),null==I||I(""))}if(null!=Oe&&Oe>-1){const e=t.cloneDeep(R);e.components[Be].cards[Oe].components=g.components,e.mapping.cards[Oe]=g.mapping,null==B||B(Object.assign({},e))}else null==B||B(g)}function Je(e,n,o){var i,l,a,d,r,u,p;const c=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},R).components[Be].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},R).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},R);if(null!=Oe&&Oe>-1&&ye){const n=Object.assign({},R).components.map((n=>{var t;return s.isCarouselComponent(n.type)?Object.assign(Object.assign({},n),{cards:null===(t=n.cards)||void 0===t?void 0:t.map((n=>Object.assign(Object.assign({},n),{components:n.components.map((n=>{var t,i,l;if("BUTTONS"===n.type){const a=null===(t=null==n?void 0:n.buttons)||void 0===t?void 0:t.filter((e=>"QUICK_REPLY"===e.type));let s=null!==(i=null==a?void 0:a[o])&&void 0!==i?i:{};s=Object.assign(Object.assign({},s),{flowId:e.flowId,flowName:e.flowName});const d=null===(l=null==n?void 0:n.buttons)||void 0===l?void 0:l.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==s?void 0:s.text)?s:e));return Object.assign(Object.assign({},n),{buttons:d})}return n}))})))}):n})),i=t.cloneDeep(R);return i.components=n,void(null==B||B(Object.assign({},i)))}const v=null==c?void 0:c.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==v&&v>-1){const n=null===(d=null===(a=null==c?void 0:c.components[v])||void 0===a?void 0:a.buttons)||void 0===d?void 0:d.filter((e=>"QUICK_REPLY"===e.type));if(n){let t=n[o];t=Object.assign(Object.assign({},t),{flowId:e.flowId,flowName:e.flowName});const i=[...null!==(p=null===(u=null===(r=c.components)||void 0===r?void 0:r[v])||void 0===u?void 0:u.buttons)&&void 0!==p?p:[]].map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),l=Object.assign(Object.assign({},c.components[v]),{buttons:i}),a=[...c.components];a[v]=l,c.components=a}}if(null!=Oe&&Oe>-1){const e=t.cloneDeep(R);e.components[Be].cards[Oe].components=c.components,null==B||B(Object.assign({},e))}else null==B||B(c)}o.useEffect((()=>{var e,n;if(null===(e=R.mapping.buttons)||void 0===e?void 0:e.find((e=>"checkout.checkoutUrl"===e.slice(2,-2))))Ue(!0);else{Ue(!1);const e=null===(n=null==Ee?void 0:Ee.discountCodeExtra)||void 0===n?void 0:n[1];null==e||e("")}}),[R]),o.useEffect((()=>{var e,n,t,o;if(null!=Oe&&Oe>-1){const i={components:null===(n=null===(e=R.components[Be])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[Oe].components,mapping:null===(o=null===(t=null==R?void 0:R.mapping)||void 0===t?void 0:t.cards)||void 0===o?void 0:o[Oe]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u,titleVariables:p}=c.getAllDataFromTemplateComponent(i);_e({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u,titleVariables:p})}else if(null!=Oe&&-1===Oe){const{descriptionComponents:e,urlBtns:n,qrbBtns:t,imageComponent:o,bodyVariables:i,headerVariables:l,titleVariables:a}=c.getAllDataFromTemplateComponent(R);_e({descriptionComponents:e,urlBtns:n,qrbBtns:t,imageComponent:o,bodyVariables:i,headerVariables:l,titleVariables:a})}}),[Oe]),o.useEffect((()=>{var e,n,t,o;if(null!=Oe&&Oe>-1&&Ye){const i={components:null===(n=null===(e=R.components[Be])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[Oe].components,mapping:null===(o=null===(t=null==R?void 0:R.mapping)||void 0===t?void 0:t.cards)||void 0===o?void 0:o[Oe]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u,titleVariables:p}=c.getAllDataFromTemplateComponent(i);_e({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u,titleVariables:p}),We(!1)}}),[Ye]);o.useEffect((()=>{Ve&&Te===r.POD.CHATBOT&&(()=>{if(!q)return void Xe("PDF name is Required");const e=m.validateInputNameChatbot(q);null==P||P(null!=q?q:""),Xe(e?"Please enter a valid PDF name":void 0)})()}),[Ve]);const Ze=fe?Ne.imageComponent:Ie;return Qe.openEditMedia?e.jsxRuntimeExports.jsx(T.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e.jsxRuntimeExports.jsx(x.default,{mediaComponentFormat:null!==(L=Ze.format)&&void 0!==L?L:d.HEADER_TYPES.IMAGE,uploadMedia:Qe.uploadMedia,variableListForImage:D||[],useEditWhatsappTemplateMediaResponse:Qe,setOpenEditMedia:Qe.setOpenEditMedia,openEditMedia:Qe.openEditMedia,editIconRef:Qe.editIconRef,fileRef:we})})):e.jsxRuntimeExports.jsxs(T.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:ye?"420px":"auto"}},{children:[!!Ne.imageComponent&&!ye&&!s.isRCSChannel(null==R?void 0:R.channel)&&e.jsxRuntimeExports.jsxs(h.EditTemplateMediaContainer,{children:[e.jsxRuntimeExports.jsx(j.default,{imageName:null!==(A=null===(w=null==Ze?void 0:Ze.example)||void 0===w?void 0:w.header_handle)&&void 0!==A?A:[],handleImageChange:Qe.handleImageChange,mediaType:null==Ze?void 0:Ze.format,error:Qe.error,isLoading:Qe.loading,setOpenEditMedia:Qe.setOpenEditMedia,selectedVariable:v.isVariable(null!==(_=null===(N=null===(U=null==Ze?void 0:Ze.example)||void 0===U?void 0:U.header_handle)||void 0===N?void 0:N[0])&&void 0!==_?_:"")?null===(S=null===(H=null==Ze?void 0:Ze.example)||void 0===H?void 0:H.header_handle)||void 0===S?void 0:S[0]:(null===(Q=null===(F=null==R?void 0:R.mapping)||void 0===F?void 0:F.header)||void 0===Q?void 0:Q[0])?null===(W=null===(Y=null==R?void 0:R.mapping)||void 0===Y?void 0:Y.header)||void 0===W?void 0:W[0]:Qe.selectedVariable}),(null==Ie?void 0:Ie.format)==d.HEADER_TYPES.DOCUMENT?e.jsxRuntimeExports.jsx(V,{children:Te===r.POD.CHATBOT?e.jsxRuntimeExports.jsx(a.InputWithVariables,{labelText:"PDF Name",placeHolder:"Enter the name",errorMessage:Ge||void 0,onChange:e=>{var n;Xe(""),null==P||P(null!==(n=null==e?void 0:e.actualValue)&&void 0!==n?n:"")},pickerType:n.PickerType.EMBEDDED,noMaxCharCheck:!0,allowMix:!0,showVarHeader:!0,varHeaderText:"Select variable",prevVariable:{actualValue:null!=q?q:"",variableType:"string"},variablesList:D,showAddButton:!0}):e.jsxRuntimeExports.jsx(l.Input,{labelText:"PDF Name",placeholder:"Enter the name",value:Ke,errorMessage:Ge||void 0,onBlur:()=>{if(!Ke)return null==P||P(""),void Xe("PDF name is Required");const e=m.validateInputName(Ke);null==P||P(Ke),Xe(e?"Please enter a valid PDF name":void 0)},onChangeText:e=>{Xe(""),$e(e)}})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})]}),(null===(K=Ne.bodyVariables)||void 0===K?void 0:K.length)>0&&e.jsxRuntimeExports.jsx(O.default,{containerStyle:{paddingTop:Ne.mediaComponent?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null===($=Ne.descriptionComponents)||void 0===$?void 0:$.map(((n,t)=>e.jsxRuntimeExports.jsx(E.default,{originalVariableList:null!=Oe&&Oe>-1?Ce.cards[Oe]:Ce,type:n.type,descriptionComponent:n.component,showVariableModal:k},t))),(null===(z=null===(X=null!=Oe&&Oe>-1?null===(G=Ce.cards[Oe])||void 0===G?void 0:G.buttons:null==Ce?void 0:Ce.buttons)||void 0===X?void 0:X.filter((e=>"URL"===e.type)))||void 0===z?void 0:z.length)>0&&e.jsxRuntimeExports.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(ee=null===(Z=null!=Oe&&Oe>-1?null===(J=Ce.cards[Oe])||void 0===J?void 0:J.buttons:null==Ce?void 0:Ce.buttons)||void 0===Z?void 0:Z.filter((e=>Te===r.POD.CHATBOT||"URL"===e.type)))||void 0===ee?void 0:ee.map(((n,t)=>{const o=n.buttonVariable===p.STATIC_URL_VARIABLE_NAME;if("URL"===n.type)return e.jsxRuntimeExports.jsx(y.default,{variableListIndex:t,disableEdit:o,CTAoptions:null==M?void 0:M.CTAoptions,button:n,currentVariableList:null!=Oe&&Oe>-1?Object.assign({},Ce.cards[Oe]):Object.assign({},Ce),updateSelectedURLTemplateBtn:ze},`${t}_${Oe}`)})),Te===r.POD.CHATBOT&&(null===(te=null===(ne=De[0])||void 0===ne?void 0:ne.component)||void 0===te?void 0:te.buttons)&&(null===(le=null===(ie=null===(oe=De[0])||void 0===oe?void 0:oe.component)||void 0===ie?void 0:ie.buttons)||void 0===le?void 0:le.length)>0&&e.jsxRuntimeExports.jsx(b.BackTrackComponent,{backTrackMessage:null===(ae=null==Ee?void 0:Ee.backTrackExtra)||void 0===ae?void 0:ae[0],setBackTrackMessage:null===(se=null==Ee?void 0:Ee.backTrackExtra)||void 0===se?void 0:se[1]}),!s.isRCSChannel(null==R?void 0:R.channel)&&(null===(ue=null===(re=null!=Oe&&Oe>-1?null===(de=Ce.cards[Oe])||void 0===de?void 0:de.buttons:null==Ce?void 0:Ce.buttons)||void 0===re?void 0:re.filter((e=>"QUICK_REPLY"===e.type)))||void 0===ue?void 0:ue.length)>0&&(Te!==r.POD.CHATBOT?e.jsxRuntimeExports.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):e.jsxRuntimeExports.jsx(b.BackTrackComponent,{backTrackMessage:null===(pe=null==Ee?void 0:Ee.backTrackExtra)||void 0===pe?void 0:pe[0],setBackTrackMessage:null===(ce=null==Ee?void 0:Ee.backTrackExtra)||void 0===ce?void 0:ce[1]})),!s.isRCSChannel(null==R?void 0:R.channel)&&(null===(be=null===(me=null!=Oe&&Oe>-1?null===(ve=Ce.cards[Oe])||void 0===ve?void 0:ve.buttons:null==Ce?void 0:Ce.buttons)||void 0===me?void 0:me.filter((e=>"QUICK_REPLY"===e.type)))||void 0===be?void 0:be.map(((n,t)=>{if("QUICK_REPLY"===n.type&&Te!==r.POD.CHATBOT)return e.jsxRuntimeExports.jsx(y.default,{variableListIndex:t,QRBoptions:null==M?void 0:M.QRBoptions,button:n,currentVariableList:null!=Oe&&Oe>-1?Object.assign({},Ce.cards[Oe]):Object.assign({},Ce),updateSelectedQRBTemplateBtn:Je},`${t}_${Oe}`)}))),Te===r.POD.CHATBOT&&Ae&&e.jsxRuntimeExports.jsx(g.DiscountCodeComponent,{discountCode:null===(ge=null==Ee?void 0:Ee.discountCodeExtra)||void 0===ge?void 0:ge[0],setDiscountCode:null===(xe=null==Ee?void 0:Ee.discountCodeExtra)||void 0===xe?void 0:xe[1]}),null===(he=null!=Oe&&Oe>-1?null===(je=Ce.cards[Oe])||void 0===je?void 0:je.buttons:null==Ce?void 0:Ce.buttons)||void 0===he?void 0:he.map(((n,t)=>{var o,i,a,s,d;if("COPY_CODE"===n.type)return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Re?e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:20,borderRadius:4,padding:"8px 10px"}},{children:e.jsxRuntimeExports.jsx(l.Input,{state:"disabled",labelText:null!==(o=n.text)&&void 0!==o?o:"Copy Code",value:null!==(i=n.buttonVariable)&&void 0!==i?i:"",onChangeText:()=>{}})})):e.jsxRuntimeExports.jsx(C.default,{index:t,variable:{variableName:null!==(a=n.text)&&void 0!==a?a:"Copy Code",updatedValue:null!==(s=n.buttonVariable)&&void 0!==s?s:"",type:"string",isEditableVariable:!0,index:null!==(d=n.index)&&void 0!==d?d:0},showVariableModal:!0,componentType:"BUTTONS",buttonType:n.type},t)})}))]}))};
7
+ `;exports.default=i=>{let{template:R,onTemplateChange:B,whatsappSpecificPickerMeta:M,showVariableModal:k,variableListForImage:I,setDiscountCode:D,fileName:q,setFileName:P}=i;var L,U,A,w,_,N,S,H,F,Q,Y,W,K,$,G,X,z,J,Z,ee,te,ne,oe,ie,le,ae,se,de,re,ue,pe,ce,ve,me,be,ge,xe,je,he;const fe=R.isCarouselType,{originalVariableList:Ce,pod:Te,extras:Ee,selectedCarouselIndex:Oe,isProductCarouselType:ye,disableCopyCode:Re,isError:Ve,cardIndex:Be}=u.useTemplateModalContext(),{descriptionComponents:Me,urlBtns:ke,qrbBtns:Ie,imageComponent:De,bodyVariables:qe,headerVariables:Pe,titleVariables:Le}=c.getAllDataFromTemplateComponent(R),Ue=o.useRef(null),[Ae,we]=o.useState(!1),[_e,Ne]=o.useState(-1===Oe?{descriptionComponents:Me,urlBtns:ke,qrbBtns:Ie,imageComponent:De,bodyVariables:qe,headerVariables:Pe,titleVariables:Le}:{}),{uploadMediaLink:Se,uploadMediaFiles:He,validateMimeType:Fe}=M,Qe=f.useEditWhatsappTemplateMedia({uploadMediaLink:Se,uploadMediaFiles:He,updateTemplateImageUrl:function(e,t){var o,i,l,a,s,d,r,u;let p;p=null!=Oe&&Oe>-1?{components:null===(i=null===(o=R.components[Be])||void 0===o?void 0:o.cards)||void 0===i?void 0:i[Oe].components,mapping:null===(a=null===(l=null==R?void 0:R.mapping)||void 0===l?void 0:l.cards)||void 0===a?void 0:a[Oe]}:Object.assign({},R);const c=null===(s=null==p?void 0:p.components)||void 0===s?void 0:s.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==c&&c>-1&&(null==p?void 0:p.components[c])){const n=Object.assign(Object.assign({},p.components[c]),{format:t,example:{header_handle:[e]}}),o=[...p.components];o[c]=n,p=Object.assign(Object.assign({},p),{components:o})}p.mapping&&(p.mapping=Object.assign(Object.assign({},p.mapping),{header:void 0}));if(null!=Oe&&Oe>-1){const e=n.cloneDeep(R);e.components[Be].cards[Oe].components=p.components,(null===(d=null==e?void 0:e.mapping)||void 0===d?void 0:d.cards)&&(null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.cards.length)>0&&(e.mapping.cards[Oe]=null!==(u=p.mapping)&&void 0!==u?u:{}),null==B||B(Object.assign({},e)),We(!0)}else null==B||B(Object.assign({},p))},validateMimeType:Fe,mediaComponent:fe?_e.imageComponent:De,fileRef:Ue}),[Ye,We]=o.useState(!1),[Ke,$e]=o.useState(q),[Ge,Xe]=o.useState();function ze(e,t,o){var i,l,a,d,r,u,p,c,v,m;const b=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},R).components[Be].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},R).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},R),g=n.cloneDeep(b),x="custom"===t&&"string"==typeof e,j=x?e:"string"!=typeof e?e.defaultValue?e.defaultValue:"https://d.bik.ai/":"https://d.bik.ai";if(null!=Oe&&Oe>-1&&ye){const t=Object.assign({},R).components.map((e=>{var t;return s.isCarouselComponent(e.type)?Object.assign(Object.assign({},e),{cards:null===(t=e.cards)||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{components:e.components.map((e=>{var t,n,i;if("BUTTONS"===e.type){const l=null===(t=e.buttons)||void 0===t?void 0:t.filter((e=>"URL"===e.type));let a=null!==(n=null==l?void 0:l[o])&&void 0!==n?n:{};a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[j]});const s=null===(i=e.buttons)||void 0===i?void 0:i.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e));return Object.assign(Object.assign({},e),{buttons:s})}return e}))})))}):e})),i=null===(d=null===(a=Object.assign({},R).mapping)||void 0===a?void 0:a.cards)||void 0===d?void 0:d.map((t=>{var n;return Object.assign(Object.assign({},t),{buttons:null===(n=null==t?void 0:t.buttons)||void 0===n?void 0:n.map(((t,n)=>n===o?x?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"":t))})})),l=n.cloneDeep(R);return l.components=t,l.mapping.cards=i,void(null==B||B(Object.assign({},l)))}const h=null==g?void 0:g.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==h&&h>-1){const n=null===(r=null==g?void 0:g.components[h].buttons)||void 0===r?void 0:r.filter((e=>"URL"===e.type));if((null==n?void 0:n.length)>0){const i="custom"===t&&"string"==typeof e,l=i?e:"string"!=typeof e&&e.defaultValue?e.defaultValue:"https://d.bik.ai/";let a=n[o];a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[l]});const s=[...null!==(c=null===(p=null===(u=g.components)||void 0===u?void 0:u[h])||void 0===p?void 0:p.buttons)&&void 0!==c?c:[]].map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e)),d=Object.assign(Object.assign({},g.components[h]),{buttons:s}),r=null===(v=g.mapping)||void 0===v?void 0:v.buttons;r&&r.length>0&&(r[o]=i?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"");const m=Object.assign(Object.assign({},g.mapping),{buttons:r});g.mapping=m;const b=[...g.components];b[h]=d,g.components=b}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(m=e.placeHolder)||void 0===m?void 0:m.slice(2,-2))?we(!0):(we(!1),null==D||D(""))}if(null!=Oe&&Oe>-1){const e=n.cloneDeep(R);e.components[Be].cards[Oe].components=g.components,e.mapping.cards[Oe]=g.mapping,null==B||B(Object.assign({},e))}else null==B||B(g)}function Je(e,t,o){var i,l,a,d,r,u,p;const c=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},R).components[Be].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},R).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},R);if(null!=Oe&&Oe>-1&&ye){const t=Object.assign({},R).components.map((t=>{var n;return s.isCarouselComponent(t.type)?Object.assign(Object.assign({},t),{cards:null===(n=t.cards)||void 0===n?void 0:n.map((t=>Object.assign(Object.assign({},t),{components:t.components.map((t=>{var n,i,l;if("BUTTONS"===t.type){const a=null===(n=null==t?void 0:t.buttons)||void 0===n?void 0:n.filter((e=>"QUICK_REPLY"===e.type));let s=null!==(i=null==a?void 0:a[o])&&void 0!==i?i:{};s=Object.assign(Object.assign({},s),{flowId:e.flowId,flowName:e.flowName});const d=null===(l=null==t?void 0:t.buttons)||void 0===l?void 0:l.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==s?void 0:s.text)?s:e));return Object.assign(Object.assign({},t),{buttons:d})}return t}))})))}):t})),i=n.cloneDeep(R);return i.components=t,void(null==B||B(Object.assign({},i)))}const v=null==c?void 0:c.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==v&&v>-1){const t=null===(d=null===(a=null==c?void 0:c.components[v])||void 0===a?void 0:a.buttons)||void 0===d?void 0:d.filter((e=>"QUICK_REPLY"===e.type));if(t){let n=t[o];n=Object.assign(Object.assign({},n),{flowId:e.flowId,flowName:e.flowName});const i=[...null!==(p=null===(u=null===(r=c.components)||void 0===r?void 0:r[v])||void 0===u?void 0:u.buttons)&&void 0!==p?p:[]].map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==n?void 0:n.text)?n:e)),l=Object.assign(Object.assign({},c.components[v]),{buttons:i}),a=[...c.components];a[v]=l,c.components=a}}if(null!=Oe&&Oe>-1){const e=n.cloneDeep(R);e.components[Be].cards[Oe].components=c.components,null==B||B(Object.assign({},e))}else null==B||B(c)}o.useEffect((()=>{var e,t;if(null===(e=R.mapping.buttons)||void 0===e?void 0:e.find((e=>"checkout.checkoutUrl"===e.slice(2,-2))))we(!0);else{we(!1);const e=null===(t=null==Ee?void 0:Ee.discountCodeExtra)||void 0===t?void 0:t[1];null==e||e("")}}),[R]),o.useEffect((()=>{var e,t,n,o;if(null!=Oe&&Oe>-1){const i={components:null===(t=null===(e=R.components[Be])||void 0===e?void 0:e.cards)||void 0===t?void 0:t[Oe].components,mapping:null===(o=null===(n=null==R?void 0:R.mapping)||void 0===n?void 0:n.cards)||void 0===o?void 0:o[Oe]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u,titleVariables:p}=c.getAllDataFromTemplateComponent(i);Ne({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u,titleVariables:p})}else if(null!=Oe&&-1===Oe){const{descriptionComponents:e,urlBtns:t,qrbBtns:n,imageComponent:o,bodyVariables:i,headerVariables:l,titleVariables:a}=c.getAllDataFromTemplateComponent(R);Ne({descriptionComponents:e,urlBtns:t,qrbBtns:n,imageComponent:o,bodyVariables:i,headerVariables:l,titleVariables:a})}}),[Oe]),o.useEffect((()=>{var e,t,n,o;if(null!=Oe&&Oe>-1&&Ye){const i={components:null===(t=null===(e=R.components[Be])||void 0===e?void 0:e.cards)||void 0===t?void 0:t[Oe].components,mapping:null===(o=null===(n=null==R?void 0:R.mapping)||void 0===n?void 0:n.cards)||void 0===o?void 0:o[Oe]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u,titleVariables:p}=c.getAllDataFromTemplateComponent(i);Ne({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u,titleVariables:p}),We(!1)}}),[Ye]);o.useEffect((()=>{Ve&&Te===r.POD.CHATBOT&&(()=>{if(!q)return void Xe("PDF name is Required");const e=m.validateInputNameChatbot(q);null==P||P(null!=q?q:""),Xe(e?"Please enter a valid PDF name":void 0)})()}),[Ve]);const Ze=fe?_e.imageComponent:De;return Qe.openEditMedia?e.jsxRuntimeExports.jsx(T.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e.jsxRuntimeExports.jsx(x.default,{mediaComponentFormat:null!==(L=Ze.format)&&void 0!==L?L:d.HEADER_TYPES.IMAGE,uploadMedia:Qe.uploadMedia,variableListForImage:I||[],useEditWhatsappTemplateMediaResponse:Qe,setOpenEditMedia:Qe.setOpenEditMedia,openEditMedia:Qe.openEditMedia,editIconRef:Qe.editIconRef,fileRef:Ue})})):e.jsxRuntimeExports.jsxs(T.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:ye?"420px":"auto"}},{children:[!!_e.imageComponent&&!ye&&!s.isRCSChannel(null==R?void 0:R.channel)&&e.jsxRuntimeExports.jsxs(h.EditTemplateMediaContainer,{children:[e.jsxRuntimeExports.jsx(j.default,{imageName:null!==(A=null===(U=null==Ze?void 0:Ze.example)||void 0===U?void 0:U.header_handle)&&void 0!==A?A:[],handleImageChange:Qe.handleImageChange,mediaType:null==Ze?void 0:Ze.format,error:Qe.error,isLoading:Qe.loading,setOpenEditMedia:Qe.setOpenEditMedia,selectedVariable:v.isVariable(null!==(N=null===(_=null===(w=null==Ze?void 0:Ze.example)||void 0===w?void 0:w.header_handle)||void 0===_?void 0:_[0])&&void 0!==N?N:"")?null===(H=null===(S=null==Ze?void 0:Ze.example)||void 0===S?void 0:S.header_handle)||void 0===H?void 0:H[0]:(null===(Q=null===(F=null==R?void 0:R.mapping)||void 0===F?void 0:F.header)||void 0===Q?void 0:Q[0])?null===(W=null===(Y=null==R?void 0:R.mapping)||void 0===Y?void 0:Y.header)||void 0===W?void 0:W[0]:Qe.selectedVariable}),(null==De?void 0:De.format)==d.HEADER_TYPES.DOCUMENT?e.jsxRuntimeExports.jsx(V,{children:Te===r.POD.CHATBOT?e.jsxRuntimeExports.jsx(a.InputWithVariables,{labelText:"PDF Name",placeHolder:"Enter the name",errorMessage:Ge||void 0,onChange:e=>{var t;Xe(""),null==P||P(null!==(t=null==e?void 0:e.actualValue)&&void 0!==t?t:"")},pickerType:t.PickerType.EMBEDDED,noMaxCharCheck:!0,allowMix:!0,showVarHeader:!0,varHeaderText:"Select variable",prevVariable:{actualValue:null!=q?q:"",variableType:"string"},variablesList:I,showAddButton:!0}):e.jsxRuntimeExports.jsx(l.Input,{labelText:"PDF Name",placeholder:"Enter the name",value:Ke,errorMessage:Ge||void 0,onBlur:()=>{if(!Ke)return null==P||P(""),void Xe("PDF name is Required");const e=m.validateInputName(Ke);null==P||P(Ke),Xe(e?"Please enter a valid PDF name":void 0)},onChangeText:e=>{Xe(""),$e(e)}})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})]}),(null===(K=_e.bodyVariables)||void 0===K?void 0:K.length)>0&&e.jsxRuntimeExports.jsx(O.default,{containerStyle:{paddingTop:_e.mediaComponent?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null===($=_e.descriptionComponents)||void 0===$?void 0:$.map(((t,n)=>e.jsxRuntimeExports.jsx(E.default,{originalVariableList:null!=Oe&&Oe>-1?Ce.cards[Oe]:Ce,type:t.type,descriptionComponent:t.component,showVariableModal:k},n))),(null===(z=null===(X=null!=Oe&&Oe>-1?null===(G=Ce.cards[Oe])||void 0===G?void 0:G.buttons:null==Ce?void 0:Ce.buttons)||void 0===X?void 0:X.filter((e=>"URL"===e.type)))||void 0===z?void 0:z.length)>0&&e.jsxRuntimeExports.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(ee=null===(Z=null!=Oe&&Oe>-1?null===(J=Ce.cards[Oe])||void 0===J?void 0:J.buttons:null==Ce?void 0:Ce.buttons)||void 0===Z?void 0:Z.filter((e=>Te===r.POD.CHATBOT||"URL"===e.type)))||void 0===ee?void 0:ee.map(((t,n)=>{const o=t.buttonVariable===p.STATIC_URL_VARIABLE_NAME,i=t.buttonVariable===p.UNSUBSCRIBE_URL_VARIABLE;if("URL"===t.type)return e.jsxRuntimeExports.jsx(y.default,{variableListIndex:n,disableEdit:o||i,CTAoptions:null==M?void 0:M.CTAoptions,button:t,currentVariableList:null!=Oe&&Oe>-1?Object.assign({},Ce.cards[Oe]):Object.assign({},Ce),updateSelectedURLTemplateBtn:ze},`${n}_${Oe}`)})),Te===r.POD.CHATBOT&&(null===(ne=null===(te=Ie[0])||void 0===te?void 0:te.component)||void 0===ne?void 0:ne.buttons)&&(null===(le=null===(ie=null===(oe=Ie[0])||void 0===oe?void 0:oe.component)||void 0===ie?void 0:ie.buttons)||void 0===le?void 0:le.length)>0&&e.jsxRuntimeExports.jsx(b.BackTrackComponent,{backTrackMessage:null===(ae=null==Ee?void 0:Ee.backTrackExtra)||void 0===ae?void 0:ae[0],setBackTrackMessage:null===(se=null==Ee?void 0:Ee.backTrackExtra)||void 0===se?void 0:se[1]}),!s.isRCSChannel(null==R?void 0:R.channel)&&(null===(ue=null===(re=null!=Oe&&Oe>-1?null===(de=Ce.cards[Oe])||void 0===de?void 0:de.buttons:null==Ce?void 0:Ce.buttons)||void 0===re?void 0:re.filter((e=>"QUICK_REPLY"===e.type)))||void 0===ue?void 0:ue.length)>0&&(Te!==r.POD.CHATBOT?e.jsxRuntimeExports.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):e.jsxRuntimeExports.jsx(b.BackTrackComponent,{backTrackMessage:null===(pe=null==Ee?void 0:Ee.backTrackExtra)||void 0===pe?void 0:pe[0],setBackTrackMessage:null===(ce=null==Ee?void 0:Ee.backTrackExtra)||void 0===ce?void 0:ce[1]})),!s.isRCSChannel(null==R?void 0:R.channel)&&(null===(be=null===(me=null!=Oe&&Oe>-1?null===(ve=Ce.cards[Oe])||void 0===ve?void 0:ve.buttons:null==Ce?void 0:Ce.buttons)||void 0===me?void 0:me.filter((e=>"QUICK_REPLY"===e.type)))||void 0===be?void 0:be.map(((t,n)=>{if("QUICK_REPLY"===t.type&&Te!==r.POD.CHATBOT)return e.jsxRuntimeExports.jsx(y.default,{variableListIndex:n,QRBoptions:null==M?void 0:M.QRBoptions,button:t,currentVariableList:null!=Oe&&Oe>-1?Object.assign({},Ce.cards[Oe]):Object.assign({},Ce),updateSelectedQRBTemplateBtn:Je},`${n}_${Oe}`)}))),Te===r.POD.CHATBOT&&Ae&&e.jsxRuntimeExports.jsx(g.DiscountCodeComponent,{discountCode:null===(ge=null==Ee?void 0:Ee.discountCodeExtra)||void 0===ge?void 0:ge[0],setDiscountCode:null===(xe=null==Ee?void 0:Ee.discountCodeExtra)||void 0===xe?void 0:xe[1]}),null===(he=null!=Oe&&Oe>-1?null===(je=Ce.cards[Oe])||void 0===je?void 0:je.buttons:null==Ce?void 0:Ce.buttons)||void 0===he?void 0:he.map(((t,n)=>{var o,i,a,s,d;if("COPY_CODE"===t.type)return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Re?e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:20,borderRadius:4,padding:"8px 10px"}},{children:e.jsxRuntimeExports.jsx(l.Input,{state:"disabled",labelText:null!==(o=t.text)&&void 0!==o?o:"Copy Code",value:null!==(i=t.buttonVariable)&&void 0!==i?i:"",onChangeText:()=>{}})})):e.jsxRuntimeExports.jsx(C.default,{index:n,variable:{variableName:null!==(a=t.text)&&void 0!==a?a:"Copy Code",updatedValue:null!==(s=t.buttonVariable)&&void 0!==s?s:"",type:"string",isEditableVariable:!0,index:null!==(d=t.index)&&void 0!==d?d:0},showVariableModal:!0,componentType:"BUTTONS",buttonType:t.type},n)})}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/react/jsx-runtime.js"),t=require("lodash"),l=require("react"),s=require("../../dropdown/Dropdown.js"),a=require("../../input/Input.js"),n=require("../../template-preview/constants/regexPatterns.js"),i=require("../../template-preview/models/TemplateMeta.js"),o=require("../../template-preview/models/WhatsAppTemplate.js"),r=require("../../TypographyStyle.js"),u=require("../../../constants/Theme.js"),c=require("../context/templateModalContext.js"),d=require("../utils/constants.js"),b=require("../utils/validateIsUrl.js"),p=require("./VariableConnector.js");exports.default=j=>{let{variableListIndex:m,button:v,updateSelectedURLTemplateBtn:x,updateSelectedQRBTemplateBtn:O,currentVariableList:g,CTAoptions:f,QRBoptions:R,disableEdit:y}=j;var L,U,T,h,E;const[C,I]=l.useState(""),[_,V]=l.useState(),q=null==f?void 0:f.map((e=>Object.assign(Object.assign({},e),{selected:(null==_?void 0:_.value)===e.value&&_.label===e.label}))),P=null==R?void 0:R.map((e=>Object.assign(Object.assign({},e),{selected:(null==_?void 0:_.value)===e.value}))),{isError:w,disableEditVariable:N,pod:S,selectedCarouselIndex:A,originalVariableList:B,setOriginalVariableList:H,isProductCarouselType:M,ctaOptionsErrors:Q,setCtaOptionsErrors:k}=c.useTemplateModalContext();function D(e){if(I(e),null!=A&&A>-1&&M){const l=t.cloneDeep(B);if("URL"===v.type){const t=l.cards.map((t=>{let l=t.buttons.filter((e=>"URL"===e.type))[m];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=t.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e));return Object.assign(Object.assign({},t),{buttons:s})}));null==H||H((e=>Object.assign(Object.assign({},e),{cards:t}))),null==x||x(`https://${e}`,"custom",m)}return}let l=g.buttons.filter((e=>"URL"===e.type))[m];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=g.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e)),a=Object.assign({},null!=A&&A>-1?B.cards[A]:B);if(a.buttons=s,null!=A&&A>-1){const e=[...B.cards];e[A]=a,null==H||H((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==H||H((e=>Object.assign(Object.assign({},e),{buttons:[...s]})));null==x||x(`https://${e}`,"custom",m)}return l.useEffect((()=>{var e;if(v.buttonVariable&&n.editableVarPattern.test(v.buttonVariable))v.buttonVariable===d.STATIC_URL_VARIABLE_NAME?V(i.STATIC_URL_CTA_OPTION):V(i.CUSTOM_URL_NAME),I((null===(e=v.example)||void 0===e?void 0:e[0].split("https://")[1])||"");else{let e=-1;const t="URL"===v.type?f:R;e="URL"===v.type?t.findIndex((e=>e.placeHolder===v.buttonVariable)):t.findIndex((e=>e.label===v.flowName)),e>-1?V(t[e]):null==k||k((e=>Object.assign(Object.assign({},e),{[m]:"Required field!"})))}}),[]),S!==o.POD.CHATBOT?e.jsxRuntimeExports.jsxs(p.Container,{children:[e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:8}},{children:e.jsxRuntimeExports.jsxs(r.BodySecondary,Object.assign({style:{color:u.COLORS.content.primary}},{children:[v.text," button"]}))})),e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:12}},{children:e.jsxRuntimeExports.jsx(s.Dropdown,{disabled:N||y,truncatedText:!1,options:"URL"===v.type?"static_link"===(null==_?void 0:_.value)?[i.STATIC_URL_CTA_OPTION]:q:P,isSearchable:!0,onSelect:function(e,l){null==k||k((e=>(delete e[m],Object.assign({},e))));const s=e;V(s);const a=("URL"===v.type?f:R).find((e=>e.placeHolder===s.placeHolder));if(a)if("custom_link"!==a.value){if(null!=A&&A>-1&&M){const e=t.cloneDeep(B);if("URL"===v.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"URL"===e.type))[m];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder});const l=e.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==x||x({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",m),null==H||H((e=>Object.assign(Object.assign({},e),{cards:t})))}else if("QUICK_REPLY"===v.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"QUICK_REPLY"===e.type))[m];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value});const l=e.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==O||O({flowName:s.label,flowId:s.value},"placeholder",m),null==H||H((e=>Object.assign(Object.assign({},e),{cards:t})))}return}let e;if("URL"===v.type){let t=g.buttons.filter((e=>"URL"===e.type))[m];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder,example:[(null==s?void 0:s.value)||"https://d.bik.ai/"]}),e=g.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==x||x({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",m)}else{let t=g.buttons.filter((e=>"QUICK_REPLY"===e.type))[m];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value}),e=g.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==O||O({flowName:s.label,flowId:s.value},"placeholder",m)}const l=Object.assign({},null!=A&&A>-1?B.cards[A]:B);if(l.buttons=e,null!=A&&A>-1){const e=[...B.cards];e[A]=l,null==H||H((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==H||H((t=>Object.assign(Object.assign({},t),{buttons:[...e]})))}else D("")},defaultOptions:_?[Object.assign(Object.assign({},_),{selected:!0})]:[],error:w?null==Q?void 0:Q[m]:void 0})})),("custom_link"===(null==_?void 0:_.value)||"static_link"===(null==_?void 0:_.value))&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:20}},{children:e.jsxRuntimeExports.jsx(a.Input,{state:N||y?"disabled":"none",errorMessage:w?C?b.validateIsUrl(C)?"":"Enter valid URL":"Required field":"",value:C,prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:D,maxCharLimit:2e3})}))]}):e.jsxRuntimeExports.jsx(p.default,{index:m,variable:{variableName:null!==(L=v.text)&&void 0!==L?L:"",updatedValue:"((customPlaceholderName))"===v.buttonVariable?`${null===(U=v.example)||void 0===U?void 0:U[0]}`:null!==(T=v.buttonVariable)&&void 0!==T?T:"",type:"link",isEditableVariable:!0,index:null!==(h=v.index)&&void 0!==h?h:0,queryParams:null!==(E=v.queryParams)&&void 0!==E?E:[]},showVariableModal:!0,componentType:"BUTTONS",buttonType:v.type,CTAoptions:f})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/react/jsx-runtime.js"),t=require("lodash"),l=require("react"),s=require("../../dropdown/Dropdown.js"),a=require("../../input/Input.js"),n=require("../../template-preview/constants/regexPatterns.js"),i=require("../../template-preview/models/TemplateMeta.js"),o=require("../../template-preview/models/WhatsAppTemplate.js"),r=require("../../TypographyStyle.js"),u=require("../../../constants/Theme.js"),c=require("../context/templateModalContext.js"),d=require("../utils/constants.js"),b=require("../utils/validateIsUrl.js"),p=require("./VariableConnector.js");exports.default=j=>{let{variableListIndex:m,button:v,updateSelectedURLTemplateBtn:O,updateSelectedQRBTemplateBtn:x,currentVariableList:g,CTAoptions:R,QRBoptions:f,disableEdit:y}=j;var L,U,T,h,E;const[I,_]=l.useState(""),[C,V]=l.useState(),q=null==R?void 0:R.map((e=>Object.assign(Object.assign({},e),{selected:(null==C?void 0:C.value)===e.value&&C.label===e.label}))),P=null==f?void 0:f.map((e=>Object.assign(Object.assign({},e),{selected:(null==C?void 0:C.value)===e.value}))),{isError:S,disableEditVariable:N,pod:w,selectedCarouselIndex:B,originalVariableList:A,setOriginalVariableList:H,isProductCarouselType:M,ctaOptionsErrors:Q,setCtaOptionsErrors:k}=c.useTemplateModalContext();function D(e){if(_(e),null!=B&&B>-1&&M){const l=t.cloneDeep(A);if("URL"===v.type){const t=l.cards.map((t=>{let l=t.buttons.filter((e=>"URL"===e.type))[m];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=t.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e));return Object.assign(Object.assign({},t),{buttons:s})}));null==H||H((e=>Object.assign(Object.assign({},e),{cards:t}))),null==O||O(`https://${e}`,"custom",m)}return}let l=g.buttons.filter((e=>"URL"===e.type))[m];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=g.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e)),a=Object.assign({},null!=B&&B>-1?A.cards[B]:A);if(a.buttons=s,null!=B&&B>-1){const e=[...A.cards];e[B]=a,null==H||H((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==H||H((e=>Object.assign(Object.assign({},e),{buttons:[...s]})));null==O||O(`https://${e}`,"custom",m)}return l.useEffect((()=>{var e,t;if(v.buttonVariable===d.UNSUBSCRIBE_URL_VARIABLE)return V(i.UNSUBSCRIBE_URL_OPTION),void _((null===(e=v.example)||void 0===e?void 0:e[0].split("https://")[1])||"");if(v.buttonVariable&&n.editableVarPattern.test(v.buttonVariable))v.buttonVariable===d.STATIC_URL_VARIABLE_NAME?V(i.STATIC_URL_CTA_OPTION):V(i.CUSTOM_URL_NAME),_((null===(t=v.example)||void 0===t?void 0:t[0].split("https://")[1])||"");else{let e=-1;const t="URL"===v.type?R:f;e="URL"===v.type?t.findIndex((e=>e.placeHolder===v.buttonVariable)):t.findIndex((e=>e.label===v.flowName)),e>-1?V(t[e]):null==k||k((e=>Object.assign(Object.assign({},e),{[m]:"Required field!"})))}}),[]),w!==o.POD.CHATBOT?e.jsxRuntimeExports.jsxs(p.Container,{children:[e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:8}},{children:e.jsxRuntimeExports.jsxs(r.BodySecondary,Object.assign({style:{color:u.COLORS.content.primary}},{children:[v.text," button"]}))})),e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:12}},{children:e.jsxRuntimeExports.jsx(s.Dropdown,{disabled:N||y,truncatedText:!1,options:"URL"===v.type?"static_link"===(null==C?void 0:C.value)?[i.STATIC_URL_CTA_OPTION]:q:P,isSearchable:!0,onSelect:function(e,l){null==k||k((e=>(delete e[m],Object.assign({},e))));const s=e;V(s);const a=("URL"===v.type?R:f).find((e=>e.placeHolder===s.placeHolder));if(a)if("custom_link"!==a.value){if(null!=B&&B>-1&&M){const e=t.cloneDeep(A);if("URL"===v.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"URL"===e.type))[m];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder});const l=e.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==O||O({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",m),null==H||H((e=>Object.assign(Object.assign({},e),{cards:t})))}else if("QUICK_REPLY"===v.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"QUICK_REPLY"===e.type))[m];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value});const l=e.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==x||x({flowName:s.label,flowId:s.value},"placeholder",m),null==H||H((e=>Object.assign(Object.assign({},e),{cards:t})))}return}let e;if("URL"===v.type){let t=g.buttons.filter((e=>"URL"===e.type))[m];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder,example:[(null==s?void 0:s.value)||"https://d.bik.ai/"]}),e=g.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==O||O({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",m)}else{let t=g.buttons.filter((e=>"QUICK_REPLY"===e.type))[m];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value}),e=g.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==x||x({flowName:s.label,flowId:s.value},"placeholder",m)}const l=Object.assign({},null!=B&&B>-1?A.cards[B]:A);if(l.buttons=e,null!=B&&B>-1){const e=[...A.cards];e[B]=l,null==H||H((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==H||H((t=>Object.assign(Object.assign({},t),{buttons:[...e]})))}else D("")},defaultOptions:C?[Object.assign(Object.assign({},C),{selected:!0})]:[],error:S?null==Q?void 0:Q[m]:void 0})})),("custom_link"===(null==C?void 0:C.value)||"static_link"===(null==C?void 0:C.value))&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:20}},{children:e.jsxRuntimeExports.jsx(a.Input,{state:N||y?"disabled":"none",errorMessage:S?I?b.validateIsUrl(I)?"":"Enter valid URL":"Required field":"",value:I,prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:D,maxCharLimit:2e3})}))]}):e.jsxRuntimeExports.jsx(p.default,{index:m,variable:{variableName:null!==(L=v.text)&&void 0!==L?L:"",updatedValue:"((customPlaceholderName))"===v.buttonVariable?`${null===(U=v.example)||void 0===U?void 0:U[0]}`:null!==(T=v.buttonVariable)&&void 0!==T?T:"",type:"link",isEditableVariable:!0,index:null!==(h=v.index)&&void 0!==h?h:0,queryParams:null!==(E=v.queryParams)&&void 0!==E?E:[]},showVariableModal:!0,componentType:"BUTTONS",buttonType:v.type,CTAoptions:R})};
@@ -1,2 +1,3 @@
1
1
  export declare const BACKGROUND_PREVIEW_IMAGE = "https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f";
2
2
  export declare const STATIC_URL_VARIABLE_NAME = "((staticPlaceholderName))";
3
+ export declare const UNSUBSCRIBE_URL_VARIABLE = "{{unsubscribeUrl}}";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.BACKGROUND_PREVIEW_IMAGE="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f",exports.STATIC_URL_VARIABLE_NAME="((staticPlaceholderName))";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.BACKGROUND_PREVIEW_IMAGE="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f",exports.STATIC_URL_VARIABLE_NAME="((staticPlaceholderName))",exports.UNSUBSCRIBE_URL_VARIABLE="{{unsubscribeUrl}}";
@@ -60,6 +60,11 @@ export declare const STATIC_URL_CTA_OPTION: {
60
60
  value: string;
61
61
  placeHolder: string;
62
62
  };
63
+ export declare const UNSUBSCRIBE_URL_OPTION: {
64
+ label: string;
65
+ value: string;
66
+ placeHolder: string;
67
+ };
63
68
  export type GlobalPlaceholderType = {
64
69
  MARKETING: {
65
70
  customer: baseAPITemplateVariableType[];
@@ -1 +1 @@
1
- "use strict";var E,T,e,A;Object.defineProperty(exports,"__esModule",{value:!0}),exports.TEMPLATE_EDITOR=void 0,(E=exports.TEMPLATE_EDITOR||(exports.TEMPLATE_EDITOR={})).SEND_GRID="sendgrid",E.BEE="bee",exports.TEMPLATE_STATUS=void 0,(T=exports.TEMPLATE_STATUS||(exports.TEMPLATE_STATUS={})).APPROVED="APPROVED",T.DISABLED="DISABLED",T.FLAGGED="FLAGGED",T.PENDING="PENDING",T.DRAFT="DRAFT",T.REJECTED="REJECTED",T.PENDING_DELETION="PENDING_DELETION",T.IN_REVIEW="IN REVIEW",T.PAUSED="PAUSED",T.ACTIVE="ACTIVE",T.LIBRARY="LIBRARY",exports.HEADER_TYPES=void 0,(e=exports.HEADER_TYPES||(exports.HEADER_TYPES={})).NONE="NONE",e.TEXT="TEXT",e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.DOCUMENT="DOCUMENT",exports.ACTIONS_TYPES=void 0,(A=exports.ACTIONS_TYPES||(exports.ACTIONS_TYPES={})).NONE="NONE",A.CTA_BTN="CTA_BTN",A.QUICK_REPLY="QUICK_REPLY";exports.CUSTOM_URL_NAME={value:"custom_link",label:"Custom URL",placeHolder:"custom placeholder"},exports.STATIC_URL_CTA_OPTION={label:"Custom URL (No tracking)",value:"static_link",placeHolder:"{{staticUrl}}"};
1
+ "use strict";var E,T,e,A;Object.defineProperty(exports,"__esModule",{value:!0}),exports.TEMPLATE_EDITOR=void 0,(E=exports.TEMPLATE_EDITOR||(exports.TEMPLATE_EDITOR={})).SEND_GRID="sendgrid",E.BEE="bee",exports.TEMPLATE_STATUS=void 0,(T=exports.TEMPLATE_STATUS||(exports.TEMPLATE_STATUS={})).APPROVED="APPROVED",T.DISABLED="DISABLED",T.FLAGGED="FLAGGED",T.PENDING="PENDING",T.DRAFT="DRAFT",T.REJECTED="REJECTED",T.PENDING_DELETION="PENDING_DELETION",T.IN_REVIEW="IN REVIEW",T.PAUSED="PAUSED",T.ACTIVE="ACTIVE",T.LIBRARY="LIBRARY",exports.HEADER_TYPES=void 0,(e=exports.HEADER_TYPES||(exports.HEADER_TYPES={})).NONE="NONE",e.TEXT="TEXT",e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.DOCUMENT="DOCUMENT",exports.ACTIONS_TYPES=void 0,(A=exports.ACTIONS_TYPES||(exports.ACTIONS_TYPES={})).NONE="NONE",A.CTA_BTN="CTA_BTN",A.QUICK_REPLY="QUICK_REPLY";exports.CUSTOM_URL_NAME={value:"custom_link",label:"Custom URL",placeHolder:"custom placeholder"},exports.STATIC_URL_CTA_OPTION={label:"Custom URL (No tracking)",value:"static_link",placeHolder:"{{staticUrl}}"},exports.UNSUBSCRIBE_URL_OPTION={label:"Unsubscribe URL",value:"{{unsubscribeUrl}}",placeHolder:"{{unsubscribeUrl}}"};
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),a=require("./components/checkBox/CheckBox.js"),i=require("./components/list-item/ListItem.js"),s=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),T=require("./components/icon-button/IconButton.js"),x=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),S=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),A=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),b=require("./components/template-preview/models/WhatsAppTemplate.js"),j=require("./components/template-preview/models/Channels.js"),E=require("./components/template-context-mapper/TemplateContextMapper.js"),g=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),R=require("./components/template-context-mapper/utils/validateIsUrl.js");require("./_virtual/_tslib.js");var h=require("./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js"),B=require("./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js"),I=require("./components/fab-menu/FABMenu.js"),_=require("./components/floating-action-button/FloatingActionButton.js"),q=require("./components/floating-action-button/FloatingActionButton.styles.js"),f=require("./components/image-compress/ImageCompress.js"),D=require("./components/TypographyStyle.js"),k=require("./components/button/Button.js"),N=require("./components/progress-bar/ProgressBarComponent.js");require("./node_modules/react/jsx-runtime.js");var L=require("./components/progress-bar-v2/ProgressBarV2.js"),w=require("./components/QueryBuilder/QueryBuilder.js"),M=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),V=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),v=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),U=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),G=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),F=require("./components/modals/styledModal.js"),H=require("./components/dropdown/DropdownPopover/index.js"),W=require("./components/dropdown/Dropdown.js"),Y=require("./components/dropdown/ChipDropdown.js"),Q=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),K=require("./components/dropdown/MenuItem/MenuItem.js"),z=require("./components/analytics-card/AnalyticsCard.js"),Z=require("./components/analytics-card/AnalyticsCard.styled.js"),X=require("./components/input/Input.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),ee=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),re=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),te=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),se=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),le=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),Te=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),xe=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),Pe=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),Se=require("./components/avatar/Avatar.js"),Ae=require("./components/avatar/AvatarHelper.js"),Ce=require("./components/alerts/Alert.js"),ye=require("./components/alerts/AlertHelper.js"),Oe=require("./components/thumbnail/Thumbnail.js"),be=require("./components/curtain/Curtain.js"),je=require("./components/datePicker/DatePicker.js"),Ee=require("./components/datePicker/DatePickerWrapper.js"),ge=require("./components/switch/Switch.js"),Re=require("./components/plans/SubscriptionPlan.js"),he=require("./components/plans/SubscriptionPlanSelector.js"),Be=require("./components/plans/NewSubscriptionPlan.js"),Ie=require("./components/plans/SubscriptionPlansCollected.js"),_e=require("./components/tabs/Tabs.js"),qe=require("./components/dynamic-tabs/DynamicTabs.js"),fe=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),De=require("./components/TablePagination/TablePagination.js"),ke=require("./components/TablePagination/TablePaginationCard.js"),Ne=require("./components/states-modal/StateModalComponent.js"),Le=require("./components/states-modal/DeleteConfirmationModal.js"),we=require("./components/states/StateComponent.js"),Me=require("./components/states/ShopifyScopeWrapper.js"),Ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Ue=require("./helpers/BaseWhatsappContentLang.helper.js"),Ge=require("./components/curtain/CurtainHelper.js"),Fe=require("./utils/resizeImage.js"),He=require("./components/variable-picker-v3/model.js"),We=require("./components/card-selection-modal/CardSelectionModal.js"),Ye=require("./components/image-cropper/BikImageCropper.js"),Qe=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),Ke=require("./components/buttonGroup/ButtonGroup.js"),ze=require("./components/accordion/Accordion.js"),Ze=require("./components/file-uploader/FileUploader.js"),Xe=require("./components/colourInput/ColourInput.js"),Je=require("./components/code-block/CodeBlock.js"),$e=require("./components/code-block/types.js"),er=require("./components/code-block/languageSpecificFormatting/html.js"),rr=require("./components/code-block/languageSpecificFormatting/javascript.js"),tr=require("./components/bik-layout/BikHeader.js"),or=require("./components/bik-layout/BikLayout.js"),nr=require("./components/bik-layout/BikProfile.js"),ar=require("./components/bik-layout/SimpleSidebar.js"),ir=require("./components/bik-layout/BikSidebar.js"),sr=require("./components/bik-layout/FeatureModal.js"),pr=require("./components/bik-layout/SidebarSkeleton.js"),ur=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),cr=require("./components/bik-layout/FeatureModalV2.js"),lr=require("./components/searchBar/searchBar.js"),dr=require("./components/custom-date-time/CustomDateTime.js"),mr=require("./components/product-picker/ProductPickerModal.js"),Tr=require("./components/discount-modal/DiscountModal.js"),xr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),Pr=require("./components/discount-modal/type.js"),Sr=require("./components/country-code-picker/CountryCodePicker.js"),Ar=require("./components/country-code-picker/CountryCodePicker.modal.js"),Cr=require("./components/shimmer-image/ShimmerImage.js"),yr=require("./components/product-picker-v2/modal.js"),Or=require("./components/product-picker-v2/type.js"),br=require("./components/carousel/carousel.js"),jr=require("./components/carousel-secondary/CarouselSecondary.js"),Er=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),gr=require("./components/radioList/RadioList.js"),Rr=require("./components/checkList/CheckList.js"),hr=require("./components/postPicker/postPicker.js"),Br=require("./components/dropdown-button/DropdownButton.js"),Ir=require("./components/side-modal/SideModal.js"),_r=require("./components/keywords-input/KeywordsInput.js"),qr=require("./components/add-variableV2/AddVariableV2SideModal.js"),fr=require("./components/add-variableV2/AddVariableV2.js"),Dr=require("./components/navigation-hyperlink/NavigationHyperlink.js"),kr=require("./components/SearchFilter/index.js"),Nr=require("./components/input-with-vars/InputWithVariables.js"),Lr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),wr=require("./components/star-rating/StarRating.js"),Mr=require("./components/testimonial-card/TestimonialCard.js"),Vr=require("./components/slider/slider.js"),vr=require("./components/resizeImage/index.js"),Ur=require("./utils/validator.js"),Gr=require("./components/carousel-preview/CarouselPreview.js"),Fr=require("./components/floater/floater.js"),Hr=require("./components/card-selector/CardSelector.js"),Wr=require("./components/card-selector/CardSelectorGroup.js"),Yr=require("./components/variable-picker-v3/VariablePicker.js"),Qr=require("./components/action-button/ActionButtons.js"),Kr=require("./components/ai-modals/ActivateBikAI.js"),zr=require("./components/ai-modals/AiSyncProgress.js"),Zr=require("./components/ai-modals/AiCreditsExhausted.js"),Xr=require("./components/ai-modals/AiCreditsLow.js"),Jr=require("./components/input-with-vars/customPortal.js"),$r=require("./components/floating-input-dropdown/FloatingInputDropdown.js"),et=require("./components/dropdown/MultilevelDropdownPopover/index.js"),rt=require("./components/dropShadow/DropShadow.js"),tt=require("./components/multi-level-dropdown/MultiLevelDropdown.js"),ot=require("./components/data-source-panel/DataSourcePanel.js"),nt=require("./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js"),at=require("./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js"),it=require("./components/data-source-panel/model.js"),st=require("./components/carousel-secondary/model.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=a.CheckBox,exports.ListItem=i.ListItem,exports.Pagination=s.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=T.IconButton,exports.TemplatePreview=x.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=S.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=A.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),exports.STATIC_URL_CTA_OPTION=O.STATIC_URL_CTA_OPTION,Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return b.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return b.POD}}),Object.defineProperty(exports,"TEMPLATE_QUALITY",{enumerable:!0,get:function(){return b.TEMPLATE_QUALITY}}),Object.defineProperty(exports,"CHANNEL_TYPE",{enumerable:!0,get:function(){return j.CHANNEL_TYPE}}),exports.TemplateContextMapper=E.TemplateContextMapper,exports.getAllDataFromTemplateComponent=g.getAllDataFromTemplateComponent,exports.getAllDataFromWebpushTemplateComponent=g.getAllDataFromWebpushTemplateComponent,exports.isVariable=R.isVariable,exports.validateIsUrl=R.validateIsUrl,exports.TemplateAnalyticsSkeleton=h.TemplateAnalyticsSkeleton,exports.AnalyticsItem=B.AnalyticsItem,exports.RightPanelTemplateAnalytics=B.RightPanelTemplateAnalytics,exports.TemplateAnalyticsComponent=B.TemplateAnalyticsComponent,exports.FABMenu=I.FABMenu,exports.FloatingActionButton=_.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return q.DROP_POSITION}}),exports.DropdownToggleContainer=q.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return q.FAB_POSITION}}),exports.FloatingActionButtonContainer=q.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=q.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return q.MENU_ALIGNMENT}}),exports.StyledDropdown=q.StyledDropdown,exports.TooltipStyled=q.TooltipStyled,exports.ImageService=f.ImageService,exports.AiBodyCaption=D.AiBodyCaption,exports.AiBodyTiny=D.AiBodyTiny,exports.BodyCaption=D.BodyCaption,exports.BodyLarge=D.BodyLarge,exports.BodyPrimary=D.BodyPrimary,exports.BodyPrimaryLink=D.BodyPrimaryLink,exports.BodyRegular=D.BodyRegular,exports.BodySecondary=D.BodySecondary,exports.BodySecondaryLink=D.BodySecondaryLink,exports.BodySmall=D.BodySmall,exports.BodyTiny=D.BodyTiny,exports.ButtonLarge=D.ButtonLarge,exports.ButtonLargeAI=D.ButtonLargeAI,exports.ButtonRegular=D.ButtonRegular,exports.ButtonRegularAI=D.ButtonRegularAI,exports.Caption=D.Caption,exports.CaptionBold=D.CaptionBold,exports.Display=D.Display,exports.SmallRegular=D.SmallRegular,exports.SubHeading=D.SubHeading,exports.TextPlaceholder=D.TextPlaceholder,exports.Tiny=D.Tiny,exports.TitleFour=D.TitleFour,exports.TitleLarge=D.TitleLarge,exports.TitleMedium=D.TitleMedium,exports.TitleRegular=D.TitleRegular,exports.TitleSmall=D.TitleSmall,exports.TitleXlarge=D.TitleXlarge,exports.Button=k.Button,exports.ProgressBarComponent=N.ProgressBarComponent,exports.ProgressCompletedBar=N.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return L.ProgressBarType}}),exports.ProgressBarV2=L.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return L.TextAlignment}}),exports.QueryBuilder=w.QueryBuilder,exports.BaseQueryBuilderNode=M.BaseQueryBuilderNode,exports.PropertyNode=V.PropertyNode,exports.PropertyNodeHeadless=V.PropertyNodeHeadless,exports.queryBuilderSlice=v.queryBuilderSlice,exports.queryBuilderCacheSlice=U.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return G.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return G.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return G.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return G.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return G.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return G.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return G.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return G.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return G.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return G.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return G.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return G.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return G.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return G.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return G.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=F.StyledModal,exports.DropdownPopover=H.DropdownPopover,exports.Dropdown=W.Dropdown,exports.ChipDropdown=Y.ChipDropdown,exports.ChipDropdownContainer=Y.ChipDropdownContainer,exports.OpenedDropdown=Q.OpenedDropdown,exports.MenuItemDropdown=K.MenuItemDropdown,exports.AnalyticsCard=z.AnalyticsCard,exports.AnalyticsContainer=Z.AnalyticsContainer,exports.CardDataContainer=Z.CardDataContainer,exports.Input=X.Input,exports.AnalyticsChip=J.AnalyticsChip,exports.AnalyticsDropdown=$.AnalyticsDropdown,exports.EachItem=$.EachItem,exports.formatDate=$.formatDate,exports.AnalyticsMultiChip=ee.AnalyticsMultiChip,exports.AnalyticsMetric=re.AnalyticsMetric,exports.AnalyticsTrend=te.AnalyticsTrend,exports.LineChart=oe.LineChart,exports.LinearChipGroupedChart=ne.LinearChipGroupedChart,exports.Card=ae.Card,exports.PieChartAnalytics=ae.PieChartAnalytics,exports.PieChart=ie.PieChart,exports.HorizontalGraph=se.HorizontalGraph,exports.StackedBarChart=pe.StackedBarChart,exports.StackedBarDistributionChart=ue.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return ce.GRAPH_ORIENTATION}}),exports.VerticalGraph=le.VerticalGraph,exports.FunnelVerticalBarGraph=de.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return me.HEAT}}),exports.HEAT_COLORS=me.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return me.HEAT_GRADING_TYPE}}),exports.HeatMap=me.HeatMap,exports.HeatBoxStyled=Te.HeatBoxStyled,exports.HeatMapVertical=Te.HeatMapVertical,exports.VerticalBarAndLinearGraph=xe.VerticalBarAndLinearGraph,Object.defineProperty(exports,"TruncateValue",{enumerable:!0,get:function(){return Pe.TruncateValue}}),exports.calculatePercentage=Pe.calculatePercentage,exports.roundNumber=Pe.roundNumber,exports.truncateValueForIndianStore=Pe.truncateValueForIndianStore,exports.truncateValueForInternationalStore=Pe.truncateValueForInternationalStore,exports.truncateValueTo10K=Pe.truncateValueTo10K,exports.truncateValueToA=Pe.truncateValueToA,exports.truncateValueToB=Pe.truncateValueToB,exports.truncateValueToC=Pe.truncateValueToC,exports.truncateValueToK=Pe.truncateValueToK,exports.truncateValueToL=Pe.truncateValueToL,exports.truncateValueToM=Pe.truncateValueToM,exports.truncateValueToT=Pe.truncateValueToT,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=Se.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=Se.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=Se.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"MESSAGE_CHANNELS",{enumerable:!0,get:function(){return Se.MESSAGE_CHANNELS}}),Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Ae.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Ae.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Ae.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Ae.SIZE}}),exports.Alert=Ce.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return ye.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=ye.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return ye.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Oe.RATIO}}),exports.Thumbnail=Oe.Thumbnail,exports.Curtain=be.Curtain,exports.DatePicker=je.DatePicker,exports.DatePickerWrapper=Ee.DatePickerWrapper,exports.Loader=ge.Loader,exports.Switch=ge.Switch,exports.SwitchContainer=ge.SwitchContainer,exports.Thumb=ge.Thumb,exports.SubscriptionPlan=Re.SubscriptionPlan,exports.BottomWrapper=he.BottomWrapper,exports.HeaderWrapper=he.HeaderWrapper,exports.SubscriptionPlanSelector=he.SubscriptionPlanSelector,exports.defaultTabs=he.defaultTabs,exports.NewSubscriptionPlan=Be.NewSubscriptionPlan,exports.SubscriptionPlansCollected=Ie.SubscriptionPlansCollected,exports.TabItemComponent=_e.TabItemComponent,exports.Tabs=_e.Tabs,exports.DynamicTabs=qe.DynamicTabs,exports.BikShimmer=fe.BikShimmer,exports.TablePagination=De.TablePagination,exports.TablePaginationCard=ke.TablePaginationCard,exports.TablePaginationCardStyled=ke.TablePaginationCardStyled,exports.StateModalComponent=Ne.StateModalComponent,exports.DeleteConfirmationModal=Le.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return we.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return we.ButtonTypes}}),exports.StateComponent=we.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return we.StateInterface}}),exports.ShopifyScopeWrapper=Me.ShopifyScopeWrapper,exports.WhatsAppTextEditor=Ve.WhatsAppTextEditor,exports.CustomRightBorder=ve.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return ve.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=ve.WhatsAppTextEditorHeader,exports.BaseWhatsappContentLangHelper=Ue.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Ge.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Ge.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Ge.CURTAIN_TYPES}}),exports.resizeImage=Fe.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return He.PickerType}}),exports.CardSelectionModal=We.CardSelectionModal,exports.BikImageCropper=Ye.BikImageCropper,exports.BikImagePipeline=Qe.BikImagePipeline,exports.ButtonGroup=Ke.ButtonGroup,exports.BikAccordion=ze.BikAccordion,exports.FileUploader=Ze.FileUploader,exports.ColourInput=Xe.ColourInput,exports.CodeBlock=Je.CodeBlock,Object.defineProperty(exports,"CodeLanguage",{enumerable:!0,get:function(){return $e.CodeLanguage}}),exports.format=er.format,exports.colorMap=rr.colorMap,exports.colorOverWrite=rr.colorOverWrite,exports.BikHeader=tr.BikHeader,exports.BikLayout=or.BikLayout,exports.BikProfile=nr.BikProfile,exports.SimpleSidebar=ar.SimpleSidebar,exports.BikSidebar=ir.BikSidebar,exports.FeatureModal=sr.FeatureModal,exports.SidebarSkeleton=pr.SidebarSkeleton,exports.ShowShopifyRestrictedModal=ur.ShowShopifyRestrictedModal,exports.FeatureModalV2=cr.FeatureModalV2,exports.SearchBar=lr.SearchBar,exports.CustomDateTime=dr.CustomDateTime,exports.PricePleaseProductPicker=mr.PricePleaseProductPicker,exports.ProductPickerContent=mr.ProductPickerContent,exports.DiscountModal=Tr.DiscountModal,exports.CouponExpiration=xr.CouponExpiration,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return Pr.COUPON_EXPIRATION}}),Object.defineProperty(exports,"DISCOUNT_APPLIES_TO",{enumerable:!0,get:function(){return Pr.DISCOUNT_APPLIES_TO}}),Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return Pr.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return Pr.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return Pr.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return Pr.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return Pr.MIN_PURCHASE_REQUIREMENT}}),Object.defineProperty(exports,"OFFER_APPLIES_TO",{enumerable:!0,get:function(){return Pr.OFFER_APPLIES_TO}}),exports.initialDynamicCouponErrorState=Pr.initialDynamicCouponErrorState,exports.initialStaticCouponErrorState=Pr.initialStaticCouponErrorState,exports.CountryCodePicker=Sr.CountryCodePicker,exports.CountriesData=Ar.CountriesData,exports.DEFAULT_IMAGE=Cr.DEFAULT_IMAGE,exports.ShimmerImage=Cr.ShimmerImage,exports.ProductPickerModal=yr.ProductPickerModal,Object.defineProperty(exports,"ScreenName",{enumerable:!0,get:function(){return Or.ScreenName}}),exports.Carousel=br.Carousel,exports.CarouselSecondary=jr.CarouselSecondary,exports.AccessTokenTroubleshootDialog=Er.AccessTokenTroubleshootDialog,exports.RadioList=gr.RadioList,exports.CheckList=Rr.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return hr.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return hr.MEDIA_TYPES}}),exports.PostPicker=hr.PostPicker,exports.dateOptions=hr.dateOptions,exports.DropdownButton=Br.DropdownButton,exports.SideModal=Ir.SideModal,exports.KeywordsInput=_r.KeywordsInput,exports.AddVariableV2SideModal=qr.AddVariableV2SideModal,exports.AddVariableV2=fr.AddVariableV2,exports.NaLinkWrapper=Dr.NaLinkWrapper,exports.NavigationHyperlink=Dr.NavigationHyperlink,exports.SearchFilter=kr.SearchFilter,exports.InputWithVariables=Nr.InputWithVariables,exports.DashboardReviewPopUp=Lr.DashboardReviewPopUp,exports.StarRating=wr.StarRating,exports.TestimonialCard=Mr.TestimonialCard,exports.BikSlider=Vr.BikSlider,exports.ResizableImage=vr.ResizableImage,exports.validateURL=Ur.validateURL,exports.CarouselPreview=Gr.CarouselPreview,exports.Floater=Fr.Floater,exports.CardSelector=Hr.CardSelector,exports.CardSelectorGroup=Wr.CardSelectorGroup,exports.VariablePicker=Yr.VariablePicker,exports.ActionButtons=Qr.ActionButtons,exports.ActivateBikAi=Kr.ActivateBikAi,exports.AiSyncProgress=zr.AiSyncProgress,exports.AiCreditsExhausted=Zr.AiCreditsExhausted,exports.AiCreditsLow=Xr.AiCreditsLow,exports.CustomPortal=Jr.CustomPortal,exports.FloatingInputDropdown=$r.FloatingInputDropdown,exports.MultilevelDropdownPopover=et.MultilevelDropdownPopover,exports.DropShadow=rt.DropShadow,exports.MultiLevelDropdown=tt.MultiLevelDropdown,exports.DataSourcePanel=ot.DataSourcePanel,exports.UnsatisfactoryResponseList=nt.UnsatisfactoryResponseList,exports.UnsatisfactoryCountIntentWiseModal=at.UnsatisfactoryCountIntentWiseModal,Object.defineProperty(exports,"CustomDataCategories",{enumerable:!0,get:function(){return it.CustomDataCategories}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return it.CustomDataType}}),Object.defineProperty(exports,"CarouselVersion",{enumerable:!0,get:function(){return st.CarouselVersion}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),a=require("./components/checkBox/CheckBox.js"),i=require("./components/list-item/ListItem.js"),s=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),T=require("./components/icon-button/IconButton.js"),x=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),S=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),A=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),b=require("./components/template-preview/models/WhatsAppTemplate.js"),j=require("./components/template-preview/models/Channels.js"),E=require("./components/template-context-mapper/TemplateContextMapper.js"),g=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),R=require("./components/template-context-mapper/utils/validateIsUrl.js");require("./_virtual/_tslib.js");var h=require("./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js"),B=require("./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js"),I=require("./components/fab-menu/FABMenu.js"),_=require("./components/floating-action-button/FloatingActionButton.js"),q=require("./components/floating-action-button/FloatingActionButton.styles.js"),f=require("./components/image-compress/ImageCompress.js"),D=require("./components/TypographyStyle.js"),N=require("./components/button/Button.js"),k=require("./components/progress-bar/ProgressBarComponent.js");require("./node_modules/react/jsx-runtime.js");var L=require("./components/progress-bar-v2/ProgressBarV2.js"),w=require("./components/QueryBuilder/QueryBuilder.js"),M=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),V=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),v=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),U=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),G=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),F=require("./components/modals/styledModal.js"),H=require("./components/dropdown/DropdownPopover/index.js"),W=require("./components/dropdown/Dropdown.js"),Y=require("./components/dropdown/ChipDropdown.js"),Q=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),K=require("./components/dropdown/MenuItem/MenuItem.js"),z=require("./components/analytics-card/AnalyticsCard.js"),Z=require("./components/analytics-card/AnalyticsCard.styled.js"),X=require("./components/input/Input.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),ee=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),re=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),te=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),se=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),le=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),Te=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),xe=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),Pe=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),Se=require("./components/avatar/Avatar.js"),Ae=require("./components/avatar/AvatarHelper.js"),Ce=require("./components/alerts/Alert.js"),ye=require("./components/alerts/AlertHelper.js"),Oe=require("./components/thumbnail/Thumbnail.js"),be=require("./components/curtain/Curtain.js"),je=require("./components/datePicker/DatePicker.js"),Ee=require("./components/datePicker/DatePickerWrapper.js"),ge=require("./components/switch/Switch.js"),Re=require("./components/plans/SubscriptionPlan.js"),he=require("./components/plans/SubscriptionPlanSelector.js"),Be=require("./components/plans/NewSubscriptionPlan.js"),Ie=require("./components/plans/SubscriptionPlansCollected.js"),_e=require("./components/tabs/Tabs.js"),qe=require("./components/dynamic-tabs/DynamicTabs.js"),fe=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),De=require("./components/TablePagination/TablePagination.js"),Ne=require("./components/TablePagination/TablePaginationCard.js"),ke=require("./components/states-modal/StateModalComponent.js"),Le=require("./components/states-modal/DeleteConfirmationModal.js"),we=require("./components/states/StateComponent.js"),Me=require("./components/states/ShopifyScopeWrapper.js"),Ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Ue=require("./helpers/BaseWhatsappContentLang.helper.js"),Ge=require("./components/curtain/CurtainHelper.js"),Fe=require("./utils/resizeImage.js"),He=require("./components/variable-picker-v3/model.js"),We=require("./components/card-selection-modal/CardSelectionModal.js"),Ye=require("./components/image-cropper/BikImageCropper.js"),Qe=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),Ke=require("./components/buttonGroup/ButtonGroup.js"),ze=require("./components/accordion/Accordion.js"),Ze=require("./components/file-uploader/FileUploader.js"),Xe=require("./components/colourInput/ColourInput.js"),Je=require("./components/code-block/CodeBlock.js"),$e=require("./components/code-block/types.js"),er=require("./components/code-block/languageSpecificFormatting/html.js"),rr=require("./components/code-block/languageSpecificFormatting/javascript.js"),tr=require("./components/bik-layout/BikHeader.js"),or=require("./components/bik-layout/BikLayout.js"),nr=require("./components/bik-layout/BikProfile.js"),ar=require("./components/bik-layout/SimpleSidebar.js"),ir=require("./components/bik-layout/BikSidebar.js"),sr=require("./components/bik-layout/FeatureModal.js"),pr=require("./components/bik-layout/SidebarSkeleton.js"),ur=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),cr=require("./components/bik-layout/FeatureModalV2.js"),lr=require("./components/searchBar/searchBar.js"),dr=require("./components/custom-date-time/CustomDateTime.js"),mr=require("./components/product-picker/ProductPickerModal.js"),Tr=require("./components/discount-modal/DiscountModal.js"),xr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),Pr=require("./components/discount-modal/type.js"),Sr=require("./components/country-code-picker/CountryCodePicker.js"),Ar=require("./components/country-code-picker/CountryCodePicker.modal.js"),Cr=require("./components/shimmer-image/ShimmerImage.js"),yr=require("./components/product-picker-v2/modal.js"),Or=require("./components/product-picker-v2/type.js"),br=require("./components/carousel/carousel.js"),jr=require("./components/carousel-secondary/CarouselSecondary.js"),Er=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),gr=require("./components/radioList/RadioList.js"),Rr=require("./components/checkList/CheckList.js"),hr=require("./components/postPicker/postPicker.js"),Br=require("./components/dropdown-button/DropdownButton.js"),Ir=require("./components/side-modal/SideModal.js"),_r=require("./components/keywords-input/KeywordsInput.js"),qr=require("./components/add-variableV2/AddVariableV2SideModal.js"),fr=require("./components/add-variableV2/AddVariableV2.js"),Dr=require("./components/navigation-hyperlink/NavigationHyperlink.js"),Nr=require("./components/SearchFilter/index.js"),kr=require("./components/input-with-vars/InputWithVariables.js"),Lr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),wr=require("./components/star-rating/StarRating.js"),Mr=require("./components/testimonial-card/TestimonialCard.js"),Vr=require("./components/slider/slider.js"),vr=require("./components/resizeImage/index.js"),Ur=require("./utils/validator.js"),Gr=require("./components/carousel-preview/CarouselPreview.js"),Fr=require("./components/floater/floater.js"),Hr=require("./components/card-selector/CardSelector.js"),Wr=require("./components/card-selector/CardSelectorGroup.js"),Yr=require("./components/variable-picker-v3/VariablePicker.js"),Qr=require("./components/action-button/ActionButtons.js"),Kr=require("./components/ai-modals/ActivateBikAI.js"),zr=require("./components/ai-modals/AiSyncProgress.js"),Zr=require("./components/ai-modals/AiCreditsExhausted.js"),Xr=require("./components/ai-modals/AiCreditsLow.js"),Jr=require("./components/input-with-vars/customPortal.js"),$r=require("./components/floating-input-dropdown/FloatingInputDropdown.js"),et=require("./components/dropdown/MultilevelDropdownPopover/index.js"),rt=require("./components/dropShadow/DropShadow.js"),tt=require("./components/multi-level-dropdown/MultiLevelDropdown.js"),ot=require("./components/data-source-panel/DataSourcePanel.js"),nt=require("./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js"),at=require("./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js"),it=require("./components/data-source-panel/model.js"),st=require("./components/carousel-secondary/model.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=a.CheckBox,exports.ListItem=i.ListItem,exports.Pagination=s.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=T.IconButton,exports.TemplatePreview=x.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=S.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=A.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),exports.STATIC_URL_CTA_OPTION=O.STATIC_URL_CTA_OPTION,Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),exports.UNSUBSCRIBE_URL_OPTION=O.UNSUBSCRIBE_URL_OPTION,Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return b.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return b.POD}}),Object.defineProperty(exports,"TEMPLATE_QUALITY",{enumerable:!0,get:function(){return b.TEMPLATE_QUALITY}}),Object.defineProperty(exports,"CHANNEL_TYPE",{enumerable:!0,get:function(){return j.CHANNEL_TYPE}}),exports.TemplateContextMapper=E.TemplateContextMapper,exports.getAllDataFromTemplateComponent=g.getAllDataFromTemplateComponent,exports.getAllDataFromWebpushTemplateComponent=g.getAllDataFromWebpushTemplateComponent,exports.isVariable=R.isVariable,exports.validateIsUrl=R.validateIsUrl,exports.TemplateAnalyticsSkeleton=h.TemplateAnalyticsSkeleton,exports.AnalyticsItem=B.AnalyticsItem,exports.RightPanelTemplateAnalytics=B.RightPanelTemplateAnalytics,exports.TemplateAnalyticsComponent=B.TemplateAnalyticsComponent,exports.FABMenu=I.FABMenu,exports.FloatingActionButton=_.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return q.DROP_POSITION}}),exports.DropdownToggleContainer=q.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return q.FAB_POSITION}}),exports.FloatingActionButtonContainer=q.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=q.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return q.MENU_ALIGNMENT}}),exports.StyledDropdown=q.StyledDropdown,exports.TooltipStyled=q.TooltipStyled,exports.ImageService=f.ImageService,exports.AiBodyCaption=D.AiBodyCaption,exports.AiBodyTiny=D.AiBodyTiny,exports.BodyCaption=D.BodyCaption,exports.BodyLarge=D.BodyLarge,exports.BodyPrimary=D.BodyPrimary,exports.BodyPrimaryLink=D.BodyPrimaryLink,exports.BodyRegular=D.BodyRegular,exports.BodySecondary=D.BodySecondary,exports.BodySecondaryLink=D.BodySecondaryLink,exports.BodySmall=D.BodySmall,exports.BodyTiny=D.BodyTiny,exports.ButtonLarge=D.ButtonLarge,exports.ButtonLargeAI=D.ButtonLargeAI,exports.ButtonRegular=D.ButtonRegular,exports.ButtonRegularAI=D.ButtonRegularAI,exports.Caption=D.Caption,exports.CaptionBold=D.CaptionBold,exports.Display=D.Display,exports.SmallRegular=D.SmallRegular,exports.SubHeading=D.SubHeading,exports.TextPlaceholder=D.TextPlaceholder,exports.Tiny=D.Tiny,exports.TitleFour=D.TitleFour,exports.TitleLarge=D.TitleLarge,exports.TitleMedium=D.TitleMedium,exports.TitleRegular=D.TitleRegular,exports.TitleSmall=D.TitleSmall,exports.TitleXlarge=D.TitleXlarge,exports.Button=N.Button,exports.ProgressBarComponent=k.ProgressBarComponent,exports.ProgressCompletedBar=k.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return L.ProgressBarType}}),exports.ProgressBarV2=L.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return L.TextAlignment}}),exports.QueryBuilder=w.QueryBuilder,exports.BaseQueryBuilderNode=M.BaseQueryBuilderNode,exports.PropertyNode=V.PropertyNode,exports.PropertyNodeHeadless=V.PropertyNodeHeadless,exports.queryBuilderSlice=v.queryBuilderSlice,exports.queryBuilderCacheSlice=U.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return G.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return G.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return G.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return G.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return G.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return G.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return G.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return G.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return G.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return G.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return G.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return G.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return G.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return G.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return G.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=F.StyledModal,exports.DropdownPopover=H.DropdownPopover,exports.Dropdown=W.Dropdown,exports.ChipDropdown=Y.ChipDropdown,exports.ChipDropdownContainer=Y.ChipDropdownContainer,exports.OpenedDropdown=Q.OpenedDropdown,exports.MenuItemDropdown=K.MenuItemDropdown,exports.AnalyticsCard=z.AnalyticsCard,exports.AnalyticsContainer=Z.AnalyticsContainer,exports.CardDataContainer=Z.CardDataContainer,exports.Input=X.Input,exports.AnalyticsChip=J.AnalyticsChip,exports.AnalyticsDropdown=$.AnalyticsDropdown,exports.EachItem=$.EachItem,exports.formatDate=$.formatDate,exports.AnalyticsMultiChip=ee.AnalyticsMultiChip,exports.AnalyticsMetric=re.AnalyticsMetric,exports.AnalyticsTrend=te.AnalyticsTrend,exports.LineChart=oe.LineChart,exports.LinearChipGroupedChart=ne.LinearChipGroupedChart,exports.Card=ae.Card,exports.PieChartAnalytics=ae.PieChartAnalytics,exports.PieChart=ie.PieChart,exports.HorizontalGraph=se.HorizontalGraph,exports.StackedBarChart=pe.StackedBarChart,exports.StackedBarDistributionChart=ue.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return ce.GRAPH_ORIENTATION}}),exports.VerticalGraph=le.VerticalGraph,exports.FunnelVerticalBarGraph=de.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return me.HEAT}}),exports.HEAT_COLORS=me.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return me.HEAT_GRADING_TYPE}}),exports.HeatMap=me.HeatMap,exports.HeatBoxStyled=Te.HeatBoxStyled,exports.HeatMapVertical=Te.HeatMapVertical,exports.VerticalBarAndLinearGraph=xe.VerticalBarAndLinearGraph,Object.defineProperty(exports,"TruncateValue",{enumerable:!0,get:function(){return Pe.TruncateValue}}),exports.calculatePercentage=Pe.calculatePercentage,exports.roundNumber=Pe.roundNumber,exports.truncateValueForIndianStore=Pe.truncateValueForIndianStore,exports.truncateValueForInternationalStore=Pe.truncateValueForInternationalStore,exports.truncateValueTo10K=Pe.truncateValueTo10K,exports.truncateValueToA=Pe.truncateValueToA,exports.truncateValueToB=Pe.truncateValueToB,exports.truncateValueToC=Pe.truncateValueToC,exports.truncateValueToK=Pe.truncateValueToK,exports.truncateValueToL=Pe.truncateValueToL,exports.truncateValueToM=Pe.truncateValueToM,exports.truncateValueToT=Pe.truncateValueToT,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=Se.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=Se.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=Se.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"MESSAGE_CHANNELS",{enumerable:!0,get:function(){return Se.MESSAGE_CHANNELS}}),Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Ae.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Ae.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Ae.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Ae.SIZE}}),exports.Alert=Ce.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return ye.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=ye.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return ye.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Oe.RATIO}}),exports.Thumbnail=Oe.Thumbnail,exports.Curtain=be.Curtain,exports.DatePicker=je.DatePicker,exports.DatePickerWrapper=Ee.DatePickerWrapper,exports.Loader=ge.Loader,exports.Switch=ge.Switch,exports.SwitchContainer=ge.SwitchContainer,exports.Thumb=ge.Thumb,exports.SubscriptionPlan=Re.SubscriptionPlan,exports.BottomWrapper=he.BottomWrapper,exports.HeaderWrapper=he.HeaderWrapper,exports.SubscriptionPlanSelector=he.SubscriptionPlanSelector,exports.defaultTabs=he.defaultTabs,exports.NewSubscriptionPlan=Be.NewSubscriptionPlan,exports.SubscriptionPlansCollected=Ie.SubscriptionPlansCollected,exports.TabItemComponent=_e.TabItemComponent,exports.Tabs=_e.Tabs,exports.DynamicTabs=qe.DynamicTabs,exports.BikShimmer=fe.BikShimmer,exports.TablePagination=De.TablePagination,exports.TablePaginationCard=Ne.TablePaginationCard,exports.TablePaginationCardStyled=Ne.TablePaginationCardStyled,exports.StateModalComponent=ke.StateModalComponent,exports.DeleteConfirmationModal=Le.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return we.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return we.ButtonTypes}}),exports.StateComponent=we.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return we.StateInterface}}),exports.ShopifyScopeWrapper=Me.ShopifyScopeWrapper,exports.WhatsAppTextEditor=Ve.WhatsAppTextEditor,exports.CustomRightBorder=ve.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return ve.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=ve.WhatsAppTextEditorHeader,exports.BaseWhatsappContentLangHelper=Ue.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Ge.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Ge.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Ge.CURTAIN_TYPES}}),exports.resizeImage=Fe.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return He.PickerType}}),exports.CardSelectionModal=We.CardSelectionModal,exports.BikImageCropper=Ye.BikImageCropper,exports.BikImagePipeline=Qe.BikImagePipeline,exports.ButtonGroup=Ke.ButtonGroup,exports.BikAccordion=ze.BikAccordion,exports.FileUploader=Ze.FileUploader,exports.ColourInput=Xe.ColourInput,exports.CodeBlock=Je.CodeBlock,Object.defineProperty(exports,"CodeLanguage",{enumerable:!0,get:function(){return $e.CodeLanguage}}),exports.format=er.format,exports.colorMap=rr.colorMap,exports.colorOverWrite=rr.colorOverWrite,exports.BikHeader=tr.BikHeader,exports.BikLayout=or.BikLayout,exports.BikProfile=nr.BikProfile,exports.SimpleSidebar=ar.SimpleSidebar,exports.BikSidebar=ir.BikSidebar,exports.FeatureModal=sr.FeatureModal,exports.SidebarSkeleton=pr.SidebarSkeleton,exports.ShowShopifyRestrictedModal=ur.ShowShopifyRestrictedModal,exports.FeatureModalV2=cr.FeatureModalV2,exports.SearchBar=lr.SearchBar,exports.CustomDateTime=dr.CustomDateTime,exports.PricePleaseProductPicker=mr.PricePleaseProductPicker,exports.ProductPickerContent=mr.ProductPickerContent,exports.DiscountModal=Tr.DiscountModal,exports.CouponExpiration=xr.CouponExpiration,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return Pr.COUPON_EXPIRATION}}),Object.defineProperty(exports,"DISCOUNT_APPLIES_TO",{enumerable:!0,get:function(){return Pr.DISCOUNT_APPLIES_TO}}),Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return Pr.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return Pr.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return Pr.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return Pr.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return Pr.MIN_PURCHASE_REQUIREMENT}}),Object.defineProperty(exports,"OFFER_APPLIES_TO",{enumerable:!0,get:function(){return Pr.OFFER_APPLIES_TO}}),exports.initialDynamicCouponErrorState=Pr.initialDynamicCouponErrorState,exports.initialStaticCouponErrorState=Pr.initialStaticCouponErrorState,exports.CountryCodePicker=Sr.CountryCodePicker,exports.CountriesData=Ar.CountriesData,exports.DEFAULT_IMAGE=Cr.DEFAULT_IMAGE,exports.ShimmerImage=Cr.ShimmerImage,exports.ProductPickerModal=yr.ProductPickerModal,Object.defineProperty(exports,"ScreenName",{enumerable:!0,get:function(){return Or.ScreenName}}),exports.Carousel=br.Carousel,exports.CarouselSecondary=jr.CarouselSecondary,exports.AccessTokenTroubleshootDialog=Er.AccessTokenTroubleshootDialog,exports.RadioList=gr.RadioList,exports.CheckList=Rr.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return hr.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return hr.MEDIA_TYPES}}),exports.PostPicker=hr.PostPicker,exports.dateOptions=hr.dateOptions,exports.DropdownButton=Br.DropdownButton,exports.SideModal=Ir.SideModal,exports.KeywordsInput=_r.KeywordsInput,exports.AddVariableV2SideModal=qr.AddVariableV2SideModal,exports.AddVariableV2=fr.AddVariableV2,exports.NaLinkWrapper=Dr.NaLinkWrapper,exports.NavigationHyperlink=Dr.NavigationHyperlink,exports.SearchFilter=Nr.SearchFilter,exports.InputWithVariables=kr.InputWithVariables,exports.DashboardReviewPopUp=Lr.DashboardReviewPopUp,exports.StarRating=wr.StarRating,exports.TestimonialCard=Mr.TestimonialCard,exports.BikSlider=Vr.BikSlider,exports.ResizableImage=vr.ResizableImage,exports.validateURL=Ur.validateURL,exports.CarouselPreview=Gr.CarouselPreview,exports.Floater=Fr.Floater,exports.CardSelector=Hr.CardSelector,exports.CardSelectorGroup=Wr.CardSelectorGroup,exports.VariablePicker=Yr.VariablePicker,exports.ActionButtons=Qr.ActionButtons,exports.ActivateBikAi=Kr.ActivateBikAi,exports.AiSyncProgress=zr.AiSyncProgress,exports.AiCreditsExhausted=Zr.AiCreditsExhausted,exports.AiCreditsLow=Xr.AiCreditsLow,exports.CustomPortal=Jr.CustomPortal,exports.FloatingInputDropdown=$r.FloatingInputDropdown,exports.MultilevelDropdownPopover=et.MultilevelDropdownPopover,exports.DropShadow=rt.DropShadow,exports.MultiLevelDropdown=tt.MultiLevelDropdown,exports.DataSourcePanel=ot.DataSourcePanel,exports.UnsatisfactoryResponseList=nt.UnsatisfactoryResponseList,exports.UnsatisfactoryCountIntentWiseModal=at.UnsatisfactoryCountIntentWiseModal,Object.defineProperty(exports,"CustomDataCategories",{enumerable:!0,get:function(){return it.CustomDataCategories}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return it.CustomDataType}}),Object.defineProperty(exports,"CarouselVersion",{enumerable:!0,get:function(){return st.CarouselVersion}});
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -19,6 +19,7 @@ interface SourceInfoFooterProps {
19
19
  isFooterLoading?: boolean;
20
20
  reasonForAiGeneratedResponse?: string;
21
21
  showAiResponseReason?: boolean;
22
+ aiResponseLoading?: boolean;
22
23
  }
23
24
  declare const SourceInfoFooter: import("react").MemoExoticComponent<(props: SourceInfoFooterProps) => import("react/jsx-runtime").JSX.Element>;
24
25
  export default SourceInfoFooter;
@@ -1 +1 @@
1
- import{j as e}from"../../node_modules/react/jsx-runtime.js";import{ApplicationType as t}from"@bikdotai/bik-models/growth/models/bik-store";import o from"../../assets/icons/alert_triangle.svg.js";import n from"../../assets/icons/plus.svg.js";import{memo as i,useState as s,useMemo as r,useEffect as a}from"react";import{COLORS as d}from"../../constants/Theme.js";import{Button as l}from"../button/Button.js";import{BikShimmer as c}from"../shimmer/ShimmerComponent/BikShimmer.js";import{BodyCaption as u}from"../TypographyStyle.js";import{SourceInfoFooterStyle as h}from"./DataSourcePanel.style.js";const m=i((i=>{const{appType:m,sourceIntent:p,hideHeading:b,messageSource:j,trainingSourceCount:T={},ShowTrainingDataSource:x={},faqCount:A,ChecklistType:f,footerButtonOption:y,isFooterLoading:I,reasonForAiGeneratedResponse:R,showAiResponseReason:O}=i,F=x,[_,w]=s(!0),[N,k]=s(!0),C="/bik-ai/training",[D,E]=s({buttonTitle:"",redirectUrl:"",addFaqProps:{}}),[S,P]=s({title:"",subTitle:""}),U=r((()=>{const e=(null==T?void 0:T[p])||0;return e<=1?"There is "+e+"data source added to the identified intent":`There are ${e} data sources added to the identified intent`}),[T,p]),M=()=>{var e;(null==D?void 0:D.redirectUrl)?window.open(`${window.location.origin}${null==D?void 0:D.redirectUrl}`,"_self"):Object.keys(null!==(e=null==D?void 0:D.addFaqProps)&&void 0!==e?e:{}).length>0?null==y||y.onClick(D):(null==y?void 0:y.navigate)&&(null==y||y.navigate("Training",m==t.MANIFEST?{tab:"/custom_data"}:{},{},!0))};return a((()=>{var e,o,n,i;if(p){if(null===(e=null==j?void 0:j.sources)||void 0===e?void 0:e.length){const e=j.sources[0];if(F[p])p===f.ORDER_ENQUIRY&&k(!1);else{let s=null==e?void 0:e.insights,r="";switch(p){case f.PRODUCT_DETAILS:"Product reviews"!==(null==e?void 0:e.title)&&(s=`${A||"No"} FAQs added for this product`,r="Add product-specific information via FAQs to improve responses",E({buttonTitle:"Add FAQ",addFaqProps:{faqProducts:[{id:null==e?void 0:e.productId,variantId:null==e?void 0:e.variantId,name:null==e?void 0:e.title,imageUrl:null==e?void 0:e.imageUrl}]},redirectUrl:""}));break;case f.ORDER_MODIFICATION:s=(null==T?void 0:T[p])?void 0:"Customers who are looking to modify their orders would be redirected to your live agents via the agent handover flow.",s&&E({buttonTitle:m==t.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:m==t.MANIFEST?"/customise?tab=AgentHandover":C,addFaqProps:{}});break;case f.ORDER_CANCELLATION:s=(null==T?void 0:T[p])?void 0:"Customers who are looking to cancel their orders would be redirected to your live agents via the agent handover flow.",E({buttonTitle:m==t.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:m==t.MANIFEST?"/customise?tab=AgentHandover":C,addFaqProps:{}});break;case f.ORDER_TRACKING:if("ORDER_NOT_FOUND"===(null==e?void 0:e.subIntent))break;E({buttonTitle:m==t.MANIFEST?"Add order tracking link":"Add relevant data",redirectUrl:m==t.MANIFEST?"/training/order-management":C,addFaqProps:{}});break;case f.PRODUCT_SEARCH:if("QUIZ"===(null==e?void 0:e.type))break;if(-1!==(null===(i=null===(n=null===(o=null==j?void 0:j.sources)||void 0===o?void 0:o[0])||void 0===n?void 0:n.title)||void 0===i?void 0:i.toLowerCase().indexOf("collection"))){s="Collections are recommended by matching queries with collection names and descriptions. Add relevant keywords to your collection description to improve results.";break}s="Products are recommended by matching queries with product names, descriptions, tags, and collections. Add relevant keywords and tags to your products to improve results."}P({title:null!=s?s:"",subTitle:r})}}(F[p]||[f.PRODUCT_DETAILS,f.ORDER_MODIFICATION,f.ORDER_CANCELLATION,f.ORDER_TRACKING].includes(p))&&w(!1)}}),[null==j?void 0:j.messageId,T,p,null==j?void 0:j.sources,F,f,A,m,j]),e.jsx(h,{children:I?e.jsx(e.Fragment,{children:e.jsx(c,{gap:"8px",direction:"column",boxes:[{height:"20px",width:"300px"},{height:"80px",width:"300px"}]})}):e.jsx(e.Fragment,{children:!(null==S?void 0:S.title)&&T&&p in T?e.jsxs(e.Fragment,{children:[e.jsx(g,{hideHeading:null!=b&&b}),e.jsx(v,{reason:R||"",showAiResponseReason:null!=O&&O}),e.jsxs("div",Object.assign({className:"source_info_details "+(T[p]>0?"":"no_data_source")},{children:[T[p]>0&&N?e.jsxs(e.Fragment,{children:[e.jsx(u,{children:U}),e.jsx(u,Object.assign({color:d.content.secondary},{children:"Improve responses by adding more data sources for the identified intent"}))]}):N&&e.jsxs("div",Object.assign({className:"no_data_source_title"},{children:[e.jsx(o,{width:15,height:15,color:d.content.negative,style:{marginTop:2}}),e.jsx(u,{children:"No data sources added to the identified link"})]})),!y||y.hideAddDataButton||_?e.jsx(e.Fragment,{}):e.jsx(l,{size:"small",buttonType:"tertiary",LeadingIcon:n,buttonText:(null==D?void 0:D.buttonTitle.length)>0?null==D?void 0:D.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>M(),style:{backgroundColor:"unset"}})]}))]}):e.jsxs(e.Fragment,{children:[e.jsx(g,{hideHeading:null!=b&&b}),e.jsx(v,{reason:R||"",showAiResponseReason:null!=O&&O}),e.jsxs("div",Object.assign({className:"source_info_details"},{children:[N&&e.jsxs(e.Fragment,{children:[e.jsx(u,{children:null==S?void 0:S.title}),e.jsx(u,Object.assign({color:d.content.secondary},{children:null==S?void 0:S.subTitle}))]}),!y||y.hideAddDataButton||_?e.jsx(e.Fragment,{}):e.jsx(l,{size:"small",buttonType:"tertiary",LeadingIcon:n,buttonText:(null==D?void 0:D.buttonTitle.length)>0?null==D?void 0:D.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>M(),style:{backgroundColor:"unset"}})]}))]})})})})),g=i((t=>t.hideHeading?null:e.jsx(u,Object.assign({color:d.content.secondary},{children:"Training insights"})))),v=i((t=>{const[o,n]=s(!1),i=t.reason&&t.reason.length>50,r=i&&!o?t.reason.substring(0,50)+"...":t.reason;return t.showAiResponseReason?e.jsxs("div",Object.assign({className:"source_info_details"},{children:[e.jsx(u,Object.assign({color:d.content.primary,className:"why_ai_gave_this_response"},{children:"Here’s why your AI gave this response"})),e.jsxs(u,Object.assign({color:d.content.secondary,className:"clamp-text"},{children:[r||"No reason provided for this response.",i&&e.jsx(u,Object.assign({color:d.content.brand,style:{cursor:"pointer",textDecoration:"underline",marginTop:"4px"},onClick:()=>n(!o)},{children:o?"Show less":"Show more"}))]}))]})):e.jsx(e.Fragment,{})}));v.displayName="WhyAiGaveThisResponse",g.displayName="TrainingInsightsHeading",m.displayName="SourceInfoFooter";export{m as default};
1
+ import{j as e}from"../../node_modules/react/jsx-runtime.js";import{ApplicationType as t}from"@bikdotai/bik-models/growth/models/bik-store";import o from"../../assets/icons/alert_triangle.svg.js";import n from"../../assets/icons/plus.svg.js";import{memo as i,useState as s,useMemo as r,useEffect as a}from"react";import{COLORS as d}from"../../constants/Theme.js";import{Button as l}from"../button/Button.js";import{BikShimmer as c}from"../shimmer/ShimmerComponent/BikShimmer.js";import{BodyCaption as u}from"../TypographyStyle.js";import{SourceInfoFooterStyle as h}from"./DataSourcePanel.style.js";const g=i((i=>{const{appType:g,sourceIntent:v,hideHeading:j,messageSource:b,trainingSourceCount:x={},ShowTrainingDataSource:T={},faqCount:y,ChecklistType:A,footerButtonOption:f,isFooterLoading:I,reasonForAiGeneratedResponse:F,showAiResponseReason:O,aiResponseLoading:w}=i,R=T,[N,_]=s(!0),[k,C]=s(!0),E="/bik-ai/training",[S,D]=s({buttonTitle:"",redirectUrl:"",addFaqProps:{}}),[P,U]=s({title:"",subTitle:""}),L=r((()=>{const e=(null==x?void 0:x[v])||0;return e<=1?"There is "+e+"data source added to the identified intent":`There are ${e} data sources added to the identified intent`}),[x,v]),M=()=>{var e;(null==S?void 0:S.redirectUrl)?window.open(`${window.location.origin}${null==S?void 0:S.redirectUrl}`,"_self"):Object.keys(null!==(e=null==S?void 0:S.addFaqProps)&&void 0!==e?e:{}).length>0?null==f||f.onClick(S):(null==f?void 0:f.navigate)&&(null==f||f.navigate("Training",g==t.MANIFEST?{tab:"/custom_data"}:{},{},!0))};return a((()=>{var e,o,n,i;if(v){if(null===(e=null==b?void 0:b.sources)||void 0===e?void 0:e.length){const e=b.sources[0];if(R[v])v===A.ORDER_ENQUIRY&&C(!1);else{let s=null==e?void 0:e.insights,r="";switch(v){case A.PRODUCT_DETAILS:"Product reviews"!==(null==e?void 0:e.title)&&(s=`${y||"No"} FAQs added for this product`,r="Add product-specific information via FAQs to improve responses",D({buttonTitle:"Add FAQ",addFaqProps:{faqProducts:[{id:null==e?void 0:e.productId,variantId:null==e?void 0:e.variantId,name:null==e?void 0:e.title,imageUrl:null==e?void 0:e.imageUrl}]},redirectUrl:""}));break;case A.ORDER_MODIFICATION:s=(null==x?void 0:x[v])?void 0:"Customers who are looking to modify their orders would be redirected to your live agents via the agent handover flow.",s&&D({buttonTitle:g==t.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:g==t.MANIFEST?"/customise?tab=AgentHandover":E,addFaqProps:{}});break;case A.ORDER_CANCELLATION:s=(null==x?void 0:x[v])?void 0:"Customers who are looking to cancel their orders would be redirected to your live agents via the agent handover flow.",D({buttonTitle:g==t.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:g==t.MANIFEST?"/customise?tab=AgentHandover":E,addFaqProps:{}});break;case A.ORDER_TRACKING:if("ORDER_NOT_FOUND"===(null==e?void 0:e.subIntent))break;D({buttonTitle:g==t.MANIFEST?"Add order tracking link":"Add relevant data",redirectUrl:g==t.MANIFEST?"/training/order-management":E,addFaqProps:{}});break;case A.PRODUCT_SEARCH:if("QUIZ"===(null==e?void 0:e.type))break;if(-1!==(null===(i=null===(n=null===(o=null==b?void 0:b.sources)||void 0===o?void 0:o[0])||void 0===n?void 0:n.title)||void 0===i?void 0:i.toLowerCase().indexOf("collection"))){s="Collections are recommended by matching queries with collection names and descriptions. Add relevant keywords to your collection description to improve results.";break}s="Products are recommended by matching queries with product names, descriptions, tags, and collections. Add relevant keywords and tags to your products to improve results."}U({title:null!=s?s:"",subTitle:r})}}(R[v]||[A.PRODUCT_DETAILS,A.ORDER_MODIFICATION,A.ORDER_CANCELLATION,A.ORDER_TRACKING].includes(v))&&_(!1)}}),[null==b?void 0:b.messageId,x,v,null==b?void 0:b.sources,R,A,y,g,b]),e.jsx(h,{children:I?e.jsx(e.Fragment,{children:e.jsx(c,{gap:"8px",direction:"column",boxes:[{height:"20px",width:"300px"},{height:"80px",width:"300px"}]})}):e.jsx(e.Fragment,{children:!(null==P?void 0:P.title)&&x&&v in x?e.jsxs(e.Fragment,{children:[e.jsx(m,{hideHeading:null!=j&&j}),e.jsx(p,{reason:F||"",showAiResponseReason:null!=O&&O,isLoading:null!=w&&w,appType:g}),e.jsxs("div",Object.assign({className:"source_info_details "+(x[v]>0?"":"no_data_source")},{children:[x[v]>0&&k?e.jsxs(e.Fragment,{children:[e.jsx(u,{children:L}),e.jsx(u,Object.assign({color:d.content.secondary},{children:"Improve responses by adding more data sources for the identified intent"}))]}):k&&e.jsxs("div",Object.assign({className:"no_data_source_title"},{children:[e.jsx(o,{width:15,height:15,color:d.content.negative,style:{marginTop:2}}),e.jsx(u,{children:"No data sources added to the identified link"})]})),!f||f.hideAddDataButton||N?e.jsx(e.Fragment,{}):e.jsx(l,{size:"small",buttonType:"tertiary",LeadingIcon:n,buttonText:(null==S?void 0:S.buttonTitle.length)>0?null==S?void 0:S.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>M(),style:{backgroundColor:"unset"}})]}))]}):e.jsxs(e.Fragment,{children:[e.jsx(m,{hideHeading:null!=j&&j}),e.jsx(p,{reason:F||"",showAiResponseReason:null!=O&&O,isLoading:null!=w&&w,appType:g}),e.jsxs("div",Object.assign({className:"source_info_details"},{children:[k&&e.jsxs(e.Fragment,{children:[e.jsx(u,{children:null==P?void 0:P.title}),e.jsx(u,Object.assign({color:d.content.secondary},{children:null==P?void 0:P.subTitle}))]}),!f||f.hideAddDataButton||N?e.jsx(e.Fragment,{}):e.jsx(l,{size:"small",buttonType:"tertiary",LeadingIcon:n,buttonText:(null==S?void 0:S.buttonTitle.length)>0?null==S?void 0:S.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>M(),style:{backgroundColor:"unset"}})]}))]})})})})),m=i((t=>t.hideHeading?null:e.jsx(u,Object.assign({color:d.content.secondary},{children:"Training insights"})))),p=i((o=>{const[n,i]=s(!1),r=o.reason&&o.reason.length>150,a=r&&!n?o.reason.substring(0,150)+"...":o.reason;return o.appType!==t.MANIFEST?e.jsx(e.Fragment,{}):e.jsx(e.Fragment,{children:o.isLoading?e.jsx("div",Object.assign({style:{height:70,width:"100%",marginBottom:8}},{children:e.jsx(c,{boxes:[{height:"20px",width:"30%"},{height:"20px",width:"100%"}],direction:"column",gap:"2px",isBrand:!1})})):e.jsxs("div",Object.assign({className:"source_info_details"},{children:[e.jsx(u,Object.assign({color:d.content.primary,className:"why_ai_gave_this_response"},{children:"Here’s why your AI gave this response"})),e.jsxs(u,Object.assign({color:d.content.secondary,className:"clamp-text"},{children:[a||"No reason provided for this response.",r&&e.jsx(u,Object.assign({color:d.content.brand,style:{cursor:"pointer",textDecoration:"underline",marginTop:"4px"},onClick:()=>i(!n)},{children:n?"Show less":"Show more"}))]}))]}))})}));p.displayName="WhyAiGaveThisResponse",m.displayName="TrainingInsightsHeading",g.displayName="SourceInfoFooter";export{g as default};
@@ -37,6 +37,7 @@ export interface DataSourcePanelProps {
37
37
  productSourceData?: ProductSourceData;
38
38
  reasonForAiGeneratedResponse?: string;
39
39
  showAiResponseReason?: boolean;
40
+ aiResponseLoading?: boolean;
40
41
  productSearchRule?: ProductSearchRuleDB;
41
42
  onEditProductSearchRule?: (ruleId: string) => void;
42
43
  }
@@ -1 +1 @@
1
- import{j as e}from"../../node_modules/react/jsx-runtime.js";import{ApplicationType as t}from"@bikdotai/bik-models/growth/models/bik-store";import s from"../../assets/icons/box_search.svg.js";import i from"../../assets/icons/boxV2.svg.js";import o from"../../assets/icons/chevronDownOutline.svg.js";import n from"../../assets/icons/chevronUpOutline.svg.js";import r from"../../assets/icons/cross.svg.js";import l from"../../assets/icons/edit.svg.js";import c from"../../assets/icons/filePdf.svg.js";import d from"../../assets/icons/help.svg.js";import a from"../../assets/icons/info.svg.js";import p from"../../assets/icons/openai.svg.js";import u from"../../assets/icons/plus.svg.js";import g from"../../assets/icons/redirect.svg.js";import x from"../../assets/icons/text_t9.svg.js";import h from"../../assets/icons/website.svg.js";import{useState as j,useMemo as m,useEffect as f}from"react";import{COLORS as y}from"../../constants/Theme.js";import{Button as v}from"../button/Button.js";import{IconButton as b}from"../icon-button/IconButton.js";import{BikShimmer as C}from"../shimmer/ShimmerComponent/BikShimmer.js";import{SideModal as I}from"../side-modal/SideModal.js";import{Tag as O}from"../tag/Tag.js";import{Tooltip as T}from"../tooltips/Tooltip.js";import{TitleSmall as E,BodyCaption as w,BodySecondary as S}from"../TypographyStyle.js";import L from"./DataSourceInfoFooter.js";import{SourceInfoDetailsStyle as N}from"./DataSourcePanel.style.js";import{intentConfig as F}from"./IntentConfig.js";import{DescriptionModal as k}from"./Modals/DescriptionModal.js";import{CustomDataType as A}from"./model.js";const _=_=>{var D,R;const{appType:P,storeId:B,messageSource:U,setMessageSourcePanel:K,hideCloseButton:M,isSourceInfoFetched:W,allSourceInfoDetail:$,ChecklistType:H,title:q,zeroStateButton:Q,editableSources:G,preFillTrainingSourceCount:Y,redirect:z,footerButtonOption:X,fetchTrainingSourceCount:V,fetchProductFAQCount:J,productSourceData:Z,reasonForAiGeneratedResponse:ee,showAiResponseReason:te,productSearchRule:se,onEditProductSearchRule:ie}=_,{sources:oe}=U,ne=["blog","article","page","policy"],[re,le]=j(!1),[ce,de]=j(!1),[ae,pe]=j(!1),[ue,ge]=j(0),[xe,he]=j(),[je,me]=j(null!=Y?Y:{}),[fe,ye]=j(!1),[ve,be]=j(!1),Ce={};F.forEach((t=>{let{key:s,type:i,tagText:o}=t;H[s]&&(Ce[H[s]]=e.jsx(O,{theme:"light",type:i,tagText:o,cursor:"pointer"}))}));const Ie=oe.filter((e=>"PRODUCTS"==e.type||"Products"==e.subTitle||e.productId)),Oe=oe.filter((e=>"PRODUCTS"!=e.type&&"Products"!=e.subTitle&&!e.productId)),Te=m((()=>{const e={};return["STORE_INFORMATION","CONTACT_INFO","STORE_LOCATION","SHIPPING_POLICY","RETURN_AND_REFUND","SALES_AND_OFFERS","SALES_AND_OFFERS_ISSUES","PRODUCT_CUSTOMISATION","PAYMENT_METHODS","CHECKOUT_ENQUIRY","ORDER_ENQUIRY"].forEach((t=>{H[t]&&(e[H[t]]=H[t])})),["COLLABORATION","SUBSCRIPTION_ENQUIRY"].forEach((t=>{e[t]=t})),e}),[H]);f((()=>{var e,t,s,i;if(!(null==U?void 0:U.messageId))return;le(!0),de(!0),pe(!1!==(null===(t=null===(e=U.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(i=null===(s=U.sources)||void 0===s?void 0:s[0])||void 0===i?void 0:i.insights));const o=U.sources.filter((e=>!!e.productId)).map((e=>e.productId)),n=Array.from(new Set(o)).filter((e=>!!e));J(B,n).then((e=>ge(e))).then((()=>{Y?(me(Y),setTimeout((()=>{le(!1),de(!1)}),100)):(setTimeout((()=>le(!1)),100),V(B).then((e=>me(e))).then((()=>setTimeout((()=>{de(!1)}),100))))}))}),[J,V,null==U?void 0:U.messageId,U.sources,Y,B]);const Ee=e=>!!(e&&0===e.length||(null==U?void 0:U.isUnsatisfactoryAnswer)),we=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var s;return"custom"==e?e=A.FILES:ne.includes(e)?e=A.FETCHED_LINKS:"url"==e?e=A.WEBSITE_LINKS:"text"===e?e=A.TEXTS:"faq"===e&&(e=A.FAQ),t?e:null===(s=null==e?void 0:e.toLowerCase())||void 0===s?void 0:s.replace(/_/g," ")},Se=e=>e?"faq"==e.toLocaleLowerCase()?"FAQ":"openai"==e.toLocaleLowerCase()?"OPENAI":"files"==e.toLocaleLowerCase()?"PDF":"texts"==e.toLocaleLowerCase()?"Custom text":((e=(e=e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(e=e.slice(0,-1)),e.replace("Website","Manual")):"",Le=t=>"products"==t||"product"==t?e.jsx(i,{height:16,width:16,color:y.content.secondary}):"files"==t?e.jsx(c,{height:16,width:16,color:y.content.secondary}):"website links"==t||"fetched links"==t?e.jsx(h,{height:16,width:16,color:y.content.secondary}):"faq"==t?e.jsx(d,{height:16,width:16,color:y.content.secondary}):"texts"==t?e.jsx(x,{height:16,width:16,color:y.content.secondary}):e.jsx(p,{height:16,width:16,color:y.content.secondary}),Ne=e=>{const t=e.replace(/(<([^>]+)>)/gi,""),s=document.createElement("textarea");return s.innerHTML=t,s.value};if(re||!W)return e.jsx(N,{children:e.jsx(C,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})});const Fe=s=>{const{title:i,count:r,isExpanded:l,onToggle:c,children:d}=s;return e.jsxs("div",{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",cursor:"pointer"},onClick:c},{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[e.jsx(w,Object.assign({style:{fontWeight:"600"}},{children:i})),P===t.MANIFEST?e.jsx("div",Object.assign({style:{backgroundColor:y.surface.subdued,color:y.content.secondary,padding:"2px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"500"}},{children:r})):e.jsx(e.Fragment,{})]})),e.jsx(e.Fragment,{children:P===t.BIK?e.jsx(e.Fragment,{}):l?e.jsx(o,{width:20,height:20,color:y.content.primary}):e.jsx(n,{width:20,height:20,color:y.content.primary})})]})),l&&d]})};return e.jsxs(e.Fragment,{children:[e.jsx(N,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",padding:0,paddingBottom:"12px"}},{children:[!!q&&e.jsx(E,{children:q}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e.jsx(w,Object.assign({color:y.content.secondary},{children:"Intent"})),null!==(D=Ce[U.intent])&&void 0!==D?D:Ce.GENERIC,!M&&e.jsx("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>K(void 0)},{children:e.jsx(r,{height:20,width:20,color:y.content.secondary})}))]})),se&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"12px",marginTop:"6px"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[e.jsx(S,Object.assign({color:y.content.primary},{children:se.rule_name})),ie&&se.rule_id&&e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[e.jsx(s,{width:14,color:y.content.secondary}),e.jsx(w,Object.assign({color:y.content.secondary},{children:"Edit search rule"})),e.jsx(b,{Icon:l,height:16,width:16,bordered:!0,iconColor:y.content.primary,onClick:()=>ie(null==se?void 0:se.rule_id)})]}))]})),se.keywords&&se.keywords.length>0&&e.jsx("div",Object.assign({style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px",backgroundColor:y.surface.subdued,borderRadius:"8px",border:`1px dashed ${y.stroke.primary}`}},{children:se.keywords.map(((t,s)=>e.jsx(O,{tagText:t,theme:"light"},`keyword-${s}`)))}))]})),Ee(oe)?e.jsx("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var t,s;return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${y.background.negative.light}`,borderRadius:"100px"}},{children:e.jsx(a,{width:24,height:24,color:y.stroke.negative.vibrant})})),e.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e.jsx(E,{children:"Insufficient data"})})),e.jsx(S,Object.assign({color:y.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),Q&&e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(v,{LeadingIcon:null!==(t=Q.leadingIcon)&&void 0!==t?t:u,buttonText:null!==(s=Q.title)&&void 0!==s?s:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{Q.onClick()}})}))]}))})()})):!se&&e.jsx(O,{LeadingIcon:a,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:U.isEditable?`If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in ${P===t.BIK?"BIK":"Manifest"}.`:"Edit the original source and save again to update the response"})]})),!Ee(oe)&&e.jsxs("div",Object.assign({className:"info-container"},{children:[e.jsx(e.Fragment,{children:Ie.length>0&&e.jsx("div",Object.assign({className:"info-product-source"},{children:e.jsx(Fe,Object.assign({title:"Product Sources",count:Ie.length,isExpanded:P!==t.MANIFEST||fe,onToggle:()=>ye(!fe)},{children:e.jsx("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Ie.map(((t,s)=>{var i,o,n,r;const c=we(t.type||t.subTitle||"OpenAI"),d=we(t.type||t.subTitle||"OpenAI",!0),a=Se(c),p=null==G?void 0:G.includes(d),u=$[null!==(i=t.productId)&&void 0!==i?i:"Products"],x=t.title,h=t.productId&&(null==Z?void 0:Z[t.productId]),j=h&&h.metafield.join(", ");return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:s+1<(null==Ie?void 0:Ie.length)?`1px solid ${y.stroke.primary}`:"none"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Le(c),e.jsx(T,Object.assign({body:x,placement:"top"},{children:e.jsx(S,Object.assign({style:d==A.FETCHED_LINKS||d==A.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:y.content.primary,className:"clamp-title",onClick:()=>d==A.FETCHED_LINKS||d==A.WEBSITE_LINKS?z(t):{}},{children:x}))}))]})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[t.intent!==H.EMAIL_COLLECTION&&e.jsx(e.Fragment,{children:e.jsx(w,Object.assign({color:y.content.secondary},{children:a}))}),(t.link||t.docId)&&e.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:p?e.jsx(b,{Icon:l,height:16,width:16,iconColor:y.content.secondary,onClick:()=>null==u?void 0:u.onEditClick(u.data,u.type),disabled:!u,disabledTooltip:"This source is deleted"}):e.jsx(b,{Icon:g,height:16,width:16,iconColor:y.content.secondary,disabled:"custom"===t.type&&!u,disabledTooltip:"This source is deleted",onClick:()=>z(t)})}))]}))]})),h&&e.jsxs(w,{children:[e.jsx("span",Object.assign({className:"product-data-text1",onClick:()=>{var e;he({title:x,description:Ne(h.description),imageUrl:null!==(e=t.imageUrl)&&void 0!==e?e:"",onClose:()=>he(void 0)})}},{children:`${null===(o=h.description)||void 0===o?void 0:o.length} characters description,`})),e.jsx("span",Object.assign({className:"product-data-text1",onClick:()=>h.onEditFaqClick(h.faqs)},{children:`${null===(n=h.faqs)||void 0===n?void 0:n.length} FAQs, `})),e.jsx("span",Object.assign({className:"product-data-text2"},{children:"and"})),e.jsx(T,Object.assign({body:j,placement:"top"},{children:e.jsx("span",Object.assign({className:"product-data-text1"},{children:`${null===(r=h.metafield)||void 0===r?void 0:r.length} metafields`}))}))]})]}),`info-${s}`)}))}))}))}))}),e.jsx(e.Fragment,{children:Oe.length>0&&e.jsx("div",Object.assign({className:"info-content-source"},{children:e.jsx(Fe,Object.assign({title:"Content Sources",count:Oe.length,isExpanded:P!==t.MANIFEST||ve,onToggle:()=>be(!ve)},{children:e.jsx("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Oe.map(((t,s)=>{var i,o,n,r,c,d,a,p,u,x,h,j,m,f,v,C,I;const O=we(t.type||t.subTitle||"OpenAI"),E=we(t.type||t.subTitle||"OpenAI",!0),L=Se(O),N=null==G?void 0:G.includes(E),F="Products"===t.subTitle?$[null!==(i=t.productId)&&void 0!==i?i:"Products"]:$[null!==(o=t.docId)&&void 0!==o?o:""],k=E.toLowerCase()===(null===(n=A.FAQ)||void 0===n?void 0:n.toLowerCase())?"faq"===(null===(r=t.title)||void 0===r?void 0:r.toLowerCase())?t.subTitle:t.title:E.toLowerCase()===(null===(c=A.FILES)||void 0===c?void 0:c.toLowerCase())||E.toLowerCase()===(null===(d=A.FETCHED_LINKS)||void 0===d?void 0:d.toLowerCase())||E.toLowerCase()===(null===(a=A.TEXTS)||void 0===a?void 0:a.toLowerCase())?t.title:E.toLowerCase()===(null===(p=A.WEBSITE_LINKS)||void 0===p?void 0:p.toLowerCase())?t.title.split("/")[t.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,s)=>t.toUpperCase()+s)):t.intent===H.EMAIL_COLLECTION?L:t.title,_="faq"===E.toLowerCase()?null!==(h=null!==(u=null==F?void 0:F.content)&&void 0!==u?u:null===(x=null==F?void 0:F.data)||void 0===x?void 0:x.answer)&&void 0!==h?h:"":E.toLowerCase()===(null===(j=A.FETCHED_LINKS)||void 0===j?void 0:j.toLowerCase())||E.toLowerCase()===(null===(m=A.WEBSITE_LINKS)||void 0===m?void 0:m.toLowerCase())||E.toLowerCase()===(null===(f=A.TEXTS)||void 0===f?void 0:f.toLowerCase())?null!==(I=null!==(v=null==F?void 0:F.content)&&void 0!==v?v:null===(C=null==F?void 0:F.data)||void 0===C?void 0:C.fileContentText)&&void 0!==I?I:"":t.intent===H.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:s+1<(null==Oe?void 0:Oe.length)?`1px solid ${y.stroke.primary}`:"none"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Le(O),e.jsx(T,Object.assign({body:k,placement:"top"},{children:e.jsx(S,Object.assign({style:E==A.FETCHED_LINKS||E==A.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:y.content.primary,className:"clamp-title",onClick:()=>E==A.FETCHED_LINKS||E==A.WEBSITE_LINKS?z(t):{}},{children:k}))}))]})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[t.intent!==H.EMAIL_COLLECTION&&e.jsx(e.Fragment,{children:e.jsx(w,Object.assign({color:y.content.secondary},{children:L}))}),(t.link||t.docId)&&e.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:N?e.jsx(b,{Icon:l,height:16,width:16,iconColor:y.content.secondary,onClick:()=>null==F?void 0:F.onEditClick(F.data,F.type),disabled:!F,disabledTooltip:"This source is deleted"}):e.jsx(b,{Icon:g,height:16,width:16,iconColor:y.content.secondary,disabled:"custom"===t.type&&!F,disabledTooltip:"This source is deleted",onClick:()=>z(t)})}))]}))]})),(null!=_?_:"").trim()&&e.jsx("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${y.stroke.primary}`,borderRadius:"4px",backgroundColor:y.surface.subdued}},{children:e.jsx(w,Object.assign({color:y.content.primary,className:"clamp-description"},{children:Ne(null!=_?_:"").trim()}))}))]}),`info-${s}`)}))}))}))}))})]})),ae&&!Ee(oe)&&e.jsx("div",Object.assign({className:"footer"},{children:e.jsx(L,{appType:P,storeId:B,messageSource:U,sourceIntent:null!==(R=U.intent)&&void 0!==R?R:H.GENERIC,faqCount:ue,trainingSourceCount:je,ShowTrainingDataSource:Te,ChecklistType:H,footerButtonOption:X,isFooterLoading:ce,reasonForAiGeneratedResponse:ee,showAiResponseReason:te})}))]})}),xe&&e.jsx(I,Object.assign({header:"Product description",onClose:()=>he(void 0),width:"30%"},{children:e.jsx(k,{title:xe.title,description:xe.description,imageUrl:xe.imageUrl,onClose:xe.onClose})}))]})};export{_ as DataSourcePanel};
1
+ import{j as e}from"../../node_modules/react/jsx-runtime.js";import{ApplicationType as t}from"@bikdotai/bik-models/growth/models/bik-store";import s from"../../assets/icons/box_search.svg.js";import i from"../../assets/icons/boxV2.svg.js";import o from"../../assets/icons/chevronDownOutline.svg.js";import n from"../../assets/icons/chevronUpOutline.svg.js";import r from"../../assets/icons/cross.svg.js";import l from"../../assets/icons/edit.svg.js";import d from"../../assets/icons/filePdf.svg.js";import a from"../../assets/icons/help.svg.js";import c from"../../assets/icons/info.svg.js";import p from"../../assets/icons/openai.svg.js";import u from"../../assets/icons/plus.svg.js";import g from"../../assets/icons/redirect.svg.js";import x from"../../assets/icons/text_t9.svg.js";import h from"../../assets/icons/website.svg.js";import{useState as j,useMemo as m,useEffect as f}from"react";import{COLORS as y}from"../../constants/Theme.js";import{Button as v}from"../button/Button.js";import{IconButton as b}from"../icon-button/IconButton.js";import{BikShimmer as C}from"../shimmer/ShimmerComponent/BikShimmer.js";import{SideModal as I}from"../side-modal/SideModal.js";import{Tag as O}from"../tag/Tag.js";import{Tooltip as T}from"../tooltips/Tooltip.js";import{TitleSmall as E,BodyCaption as w,BodySecondary as S}from"../TypographyStyle.js";import L from"./DataSourceInfoFooter.js";import{SourceInfoDetailsStyle as N}from"./DataSourcePanel.style.js";import{intentConfig as k}from"./IntentConfig.js";import{DescriptionModal as F}from"./Modals/DescriptionModal.js";import{CustomDataType as A}from"./model.js";const _=_=>{var D,R;const{appType:P,storeId:B,messageSource:U,setMessageSourcePanel:K,hideCloseButton:M,isSourceInfoFetched:W,allSourceInfoDetail:$,ChecklistType:H,title:q,zeroStateButton:Q,editableSources:G,preFillTrainingSourceCount:Y,redirect:z,footerButtonOption:X,fetchTrainingSourceCount:V,fetchProductFAQCount:J,productSourceData:Z,reasonForAiGeneratedResponse:ee,showAiResponseReason:te,aiResponseLoading:se,productSearchRule:ie,onEditProductSearchRule:oe}=_,{sources:ne}=U,re=["blog","article","page","policy"],[le,de]=j(!1),[ae,ce]=j(!1),[pe,ue]=j(!1),[ge,xe]=j(0),[he,je]=j(),[me,fe]=j(null!=Y?Y:{}),[ye,ve]=j(!1),[be,Ce]=j(!1),Ie={};k.forEach((t=>{let{key:s,type:i,tagText:o}=t;H[s]&&(Ie[H[s]]=e.jsx(O,{theme:"light",type:i,tagText:o,cursor:"pointer"}))}));const Oe=ne.filter((e=>"PRODUCTS"==e.type||"Products"==e.subTitle||e.productId)),Te=ne.filter((e=>"PRODUCTS"!=e.type&&"Products"!=e.subTitle&&!e.productId)),Ee=m((()=>{const e={};return["STORE_INFORMATION","CONTACT_INFO","STORE_LOCATION","SHIPPING_POLICY","RETURN_AND_REFUND","SALES_AND_OFFERS","SALES_AND_OFFERS_ISSUES","PRODUCT_CUSTOMISATION","PAYMENT_METHODS","CHECKOUT_ENQUIRY","ORDER_ENQUIRY"].forEach((t=>{H[t]&&(e[H[t]]=H[t])})),["COLLABORATION","SUBSCRIPTION_ENQUIRY"].forEach((t=>{e[t]=t})),e}),[H]);f((()=>{var e,t,s,i;if(!(null==U?void 0:U.messageId))return;de(!0),ce(!0),ue(!1!==(null===(t=null===(e=U.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(i=null===(s=U.sources)||void 0===s?void 0:s[0])||void 0===i?void 0:i.insights));const o=U.sources.filter((e=>!!e.productId)).map((e=>e.productId)),n=Array.from(new Set(o)).filter((e=>!!e));J(B,n).then((e=>xe(e))).then((()=>{Y?(fe(Y),setTimeout((()=>{de(!1),ce(!1)}),100)):(setTimeout((()=>de(!1)),100),V(B).then((e=>fe(e))).then((()=>setTimeout((()=>{ce(!1)}),100))))}))}),[J,V,null==U?void 0:U.messageId,U.sources,Y,B]);const we=e=>!!(e&&0===e.length||(null==U?void 0:U.isUnsatisfactoryAnswer)),Se=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var s;return"custom"==e?e=A.FILES:re.includes(e)?e=A.FETCHED_LINKS:"url"==e?e=A.WEBSITE_LINKS:"text"===e?e=A.TEXTS:"faq"===e&&(e=A.FAQ),t?e:null===(s=null==e?void 0:e.toLowerCase())||void 0===s?void 0:s.replace(/_/g," ")},Le=e=>e?"faq"==e.toLocaleLowerCase()?"FAQ":"openai"==e.toLocaleLowerCase()?"OPENAI":"files"==e.toLocaleLowerCase()?"PDF":"texts"==e.toLocaleLowerCase()?"Custom text":((e=(e=e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(e=e.slice(0,-1)),e.replace("Website","Manual")):"",Ne=t=>"products"==t||"product"==t?e.jsx(i,{height:16,width:16,color:y.content.secondary}):"files"==t?e.jsx(d,{height:16,width:16,color:y.content.secondary}):"website links"==t||"fetched links"==t?e.jsx(h,{height:16,width:16,color:y.content.secondary}):"faq"==t?e.jsx(a,{height:16,width:16,color:y.content.secondary}):"texts"==t?e.jsx(x,{height:16,width:16,color:y.content.secondary}):e.jsx(p,{height:16,width:16,color:y.content.secondary}),ke=e=>{const t=e.replace(/(<([^>]+)>)/gi,""),s=document.createElement("textarea");return s.innerHTML=t,s.value};if(le||!W)return e.jsx(N,{children:e.jsx(C,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})});const Fe=s=>{const{title:i,count:r,isExpanded:l,onToggle:d,children:a}=s;return e.jsxs("div",{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",cursor:"pointer"},onClick:d},{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[e.jsx(S,{children:i}),P===t.MANIFEST?e.jsx("div",Object.assign({style:{backgroundColor:y.surface.subdued,color:y.content.secondary,padding:"2px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"500",border:`1px solid ${y.stroke.primary}`}},{children:r})):e.jsx(e.Fragment,{})]})),e.jsx(e.Fragment,{children:P===t.BIK?e.jsx(e.Fragment,{}):l?e.jsx(n,{width:20,height:20,color:y.content.primary}):e.jsx(o,{width:20,height:20,color:y.content.primary})})]})),l&&a]})};return e.jsxs(e.Fragment,{children:[e.jsx(N,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",padding:0,paddingBottom:"12px"}},{children:[!!q&&e.jsx(E,{children:q}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e.jsx(w,Object.assign({color:y.content.secondary},{children:"Intent"})),null!==(D=Ie[U.intent])&&void 0!==D?D:Ie.GENERIC,!M&&e.jsx("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>K(void 0)},{children:e.jsx(r,{height:20,width:20,color:y.content.secondary})}))]})),ie&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"12px",marginTop:"6px"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[e.jsx(S,Object.assign({color:y.content.primary},{children:ie.rule_name})),oe&&ie.rule_id&&e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[e.jsx(s,{width:14,color:y.content.secondary}),e.jsx(w,Object.assign({color:y.content.secondary},{children:"Edit search rule"})),e.jsx(b,{Icon:l,height:16,width:16,bordered:!0,iconColor:y.content.primary,onClick:()=>oe(null==ie?void 0:ie.rule_id)})]}))]})),ie.keywords&&ie.keywords.length>0&&e.jsx("div",Object.assign({style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px",backgroundColor:y.surface.subdued,borderRadius:"8px",border:`1px dashed ${y.stroke.primary}`}},{children:ie.keywords.map(((t,s)=>e.jsx(O,{tagText:t,theme:"light"},`keyword-${s}`)))}))]})),we(ne)?e.jsx("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var t,s;return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${y.background.negative.light}`,borderRadius:"100px"}},{children:e.jsx(c,{width:24,height:24,color:y.stroke.negative.vibrant})})),e.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e.jsx(E,{children:"Insufficient data"})})),e.jsx(S,Object.assign({color:y.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),Q&&e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(v,{LeadingIcon:null!==(t=Q.leadingIcon)&&void 0!==t?t:u,buttonText:null!==(s=Q.title)&&void 0!==s?s:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{Q.onClick()}})}))]}))})()})):!ie&&e.jsx(O,{LeadingIcon:c,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:U.isEditable?`If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in ${P===t.BIK?"BIK":"Manifest"}.`:"Edit the original source and save again to update the response"})]})),pe&&!we(ne)&&e.jsx("div",Object.assign({className:"footer"},{children:e.jsx(L,{appType:P,storeId:B,messageSource:U,sourceIntent:null!==(R=U.intent)&&void 0!==R?R:H.GENERIC,faqCount:ge,trainingSourceCount:me,ShowTrainingDataSource:Ee,ChecklistType:H,footerButtonOption:X,isFooterLoading:ae,reasonForAiGeneratedResponse:ee,showAiResponseReason:te,aiResponseLoading:se})})),!we(ne)&&e.jsxs("div",Object.assign({className:"info-container"},{children:[e.jsx(e.Fragment,{children:Oe.length>0&&e.jsx("div",Object.assign({className:"info-product-source"},{children:e.jsx(Fe,Object.assign({title:"Product Sources",count:Oe.length,isExpanded:P!==t.MANIFEST||ye,onToggle:()=>ve(!ye)},{children:e.jsx("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Oe.map(((t,s)=>{var i,o,n,r;const d=Se(t.type||t.subTitle||"OpenAI"),a=Se(t.type||t.subTitle||"OpenAI",!0),c=Le(d),p=null==G?void 0:G.includes(a),u=$[null!==(i=t.productId)&&void 0!==i?i:"Products"],x=t.title,h=t.productId&&(null==Z?void 0:Z[t.productId]),j=h&&h.metafield.join(", ");return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:s+1<(null==Oe?void 0:Oe.length)?`1px solid ${y.stroke.primary}`:"none"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Ne(d),e.jsx(T,Object.assign({body:x,placement:"top"},{children:e.jsx(S,Object.assign({style:a==A.FETCHED_LINKS||a==A.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:y.content.primary,className:"clamp-title",onClick:()=>a==A.FETCHED_LINKS||a==A.WEBSITE_LINKS?z(t):{}},{children:x}))}))]})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[t.intent!==H.EMAIL_COLLECTION&&e.jsx(e.Fragment,{children:e.jsx(w,Object.assign({color:y.content.secondary},{children:c}))}),(t.link||t.docId)&&e.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:p?e.jsx(b,{Icon:l,height:16,width:16,iconColor:y.content.secondary,onClick:()=>null==u?void 0:u.onEditClick(u.data,u.type),disabled:!u,disabledTooltip:"This source is deleted"}):e.jsx(b,{Icon:g,height:16,width:16,iconColor:y.content.secondary,disabled:"custom"===t.type&&!u,disabledTooltip:"This source is deleted",onClick:()=>z(t)})}))]}))]})),h&&e.jsxs(w,{children:[e.jsx("span",Object.assign({className:"product-data-text1",onClick:()=>{var e;je({title:x,description:ke(h.description),imageUrl:null!==(e=t.imageUrl)&&void 0!==e?e:"",onClose:()=>je(void 0)})}},{children:`${null===(o=h.description)||void 0===o?void 0:o.length} characters description,`})),e.jsx("span",Object.assign({className:"product-data-text1",onClick:()=>h.onEditFaqClick(h.faqs)},{children:`${null===(n=h.faqs)||void 0===n?void 0:n.length} FAQs, `})),e.jsx("span",Object.assign({className:"product-data-text2"},{children:"and"})),e.jsx(T,Object.assign({body:j,placement:"top"},{children:e.jsx("span",Object.assign({className:"product-data-text1"},{children:`${null===(r=h.metafield)||void 0===r?void 0:r.length} metafields`}))}))]})]}),`info-${s}`)}))}))}))}))}),e.jsx(e.Fragment,{children:Te.length>0&&e.jsx("div",Object.assign({className:"info-content-source"},{children:e.jsx(Fe,Object.assign({title:"Content Sources",count:Te.length,isExpanded:P!==t.MANIFEST||be,onToggle:()=>Ce(!be)},{children:e.jsx("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Te.map(((t,s)=>{var i,o,n,r,d,a,c,p,u,x,h,j,m,f,v,C,I;const O=Se(t.type||t.subTitle||"OpenAI"),E=Se(t.type||t.subTitle||"OpenAI",!0),L=Le(O),N=null==G?void 0:G.includes(E),k="Products"===t.subTitle?$[null!==(i=t.productId)&&void 0!==i?i:"Products"]:$[null!==(o=t.docId)&&void 0!==o?o:""],F=E.toLowerCase()===(null===(n=A.FAQ)||void 0===n?void 0:n.toLowerCase())?"faq"===(null===(r=t.title)||void 0===r?void 0:r.toLowerCase())?t.subTitle:t.title:E.toLowerCase()===(null===(d=A.FILES)||void 0===d?void 0:d.toLowerCase())||E.toLowerCase()===(null===(a=A.FETCHED_LINKS)||void 0===a?void 0:a.toLowerCase())||E.toLowerCase()===(null===(c=A.TEXTS)||void 0===c?void 0:c.toLowerCase())?t.title:E.toLowerCase()===(null===(p=A.WEBSITE_LINKS)||void 0===p?void 0:p.toLowerCase())?t.title.split("/")[t.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,s)=>t.toUpperCase()+s)):t.intent===H.EMAIL_COLLECTION?L:t.title,_="faq"===E.toLowerCase()?null!==(h=null!==(u=null==k?void 0:k.content)&&void 0!==u?u:null===(x=null==k?void 0:k.data)||void 0===x?void 0:x.answer)&&void 0!==h?h:"":E.toLowerCase()===(null===(j=A.FETCHED_LINKS)||void 0===j?void 0:j.toLowerCase())||E.toLowerCase()===(null===(m=A.WEBSITE_LINKS)||void 0===m?void 0:m.toLowerCase())||E.toLowerCase()===(null===(f=A.TEXTS)||void 0===f?void 0:f.toLowerCase())?null!==(I=null!==(v=null==k?void 0:k.content)&&void 0!==v?v:null===(C=null==k?void 0:k.data)||void 0===C?void 0:C.fileContentText)&&void 0!==I?I:"":t.intent===H.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:s+1<(null==Te?void 0:Te.length)?`1px solid ${y.stroke.primary}`:"none"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Ne(O),e.jsx(T,Object.assign({body:F,placement:"top"},{children:e.jsx(S,Object.assign({style:E==A.FETCHED_LINKS||E==A.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:y.content.primary,className:"clamp-title",onClick:()=>E==A.FETCHED_LINKS||E==A.WEBSITE_LINKS?z(t):{}},{children:F}))}))]})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[t.intent!==H.EMAIL_COLLECTION&&e.jsx(e.Fragment,{children:e.jsx(w,Object.assign({color:y.content.secondary},{children:L}))}),(t.link||t.docId)&&e.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:N?e.jsx(b,{Icon:l,height:16,width:16,iconColor:y.content.secondary,onClick:()=>null==k?void 0:k.onEditClick(k.data,k.type),disabled:!k,disabledTooltip:"This source is deleted"}):e.jsx(b,{Icon:g,height:16,width:16,iconColor:y.content.secondary,disabled:"custom"===t.type&&!k,disabledTooltip:"This source is deleted",onClick:()=>z(t)})}))]}))]})),(null!=_?_:"").trim()&&e.jsx("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${y.stroke.primary}`,borderRadius:"4px",backgroundColor:y.surface.subdued}},{children:e.jsx(w,Object.assign({color:y.content.primary,className:"clamp-description"},{children:ke(null!=_?_:"").trim()}))}))]}),`info-${s}`)}))}))}))}))})]}))]})}),he&&e.jsx(I,Object.assign({header:"Product description",onClose:()=>je(void 0),width:"30%"},{children:e.jsx(F,{title:he.title,description:he.description,imageUrl:he.imageUrl,onClose:he.onClose})}))]})};export{_ as DataSourcePanel};
@@ -9,13 +9,14 @@ import e from"styled-components";import{COLORS as o}from"../../constants/Theme.j
9
9
  flex-direction: column;
10
10
  border-radius: 8px;
11
11
  gap: 12px;
12
+ margin-top: 12px;
12
13
  }
13
14
  .info-content-source {
14
15
  border-radius: 8px;
15
16
  display: flex;
16
17
  flex-direction: column;
17
18
  gap: 8px;
18
- background-color: ${o.surface.hovered};
19
+ background-color: ${o.surface.grey};
19
20
  .source {
20
21
  border-radius: 12px;
21
22
  }
@@ -25,7 +26,7 @@ import e from"styled-components";import{COLORS as o}from"../../constants/Theme.j
25
26
  display: flex;
26
27
  flex-direction: column;
27
28
  gap: 8px;
28
- background-color: ${o.surface.hovered};
29
+ background-color: ${o.surface.grey};
29
30
 
30
31
  .product-data-text1 {
31
32
  padding: 2px;
@@ -45,7 +46,7 @@ import e from"styled-components";import{COLORS as o}from"../../constants/Theme.j
45
46
  }
46
47
  }
47
48
  .pop-up-header {
48
- padding: 6px 8px;
49
+ padding: 6px 0px;
49
50
  background-color: rgba(255, 255, 255, 0.1);
50
51
  display: flex;
51
52
  flex-direction: column;
@@ -54,7 +55,7 @@ import e from"styled-components";import{COLORS as o}from"../../constants/Theme.j
54
55
  .footer {
55
56
  display: flex;
56
57
  flex-direction: column;
57
- margin: 24px 8px 0px 8px;
58
+ margin: 24px 0px 0px 0px;
58
59
  }
59
60
  .clamp-title {
60
61
  overflow: hidden;
@@ -92,6 +93,7 @@ import e from"styled-components";import{COLORS as o}from"../../constants/Theme.j
92
93
  background-color: ${o.surface.grey};
93
94
  max-height: calc(100vh - 380px);
94
95
  overflow-y: scroll;
96
+ margin-top: 12px;
95
97
  &::-webkit-scrollbar-thumb {
96
98
  background: #888;
97
99
  border-radius: 8px;
@@ -102,7 +104,7 @@ import e from"styled-components";import{COLORS as o}from"../../constants/Theme.j
102
104
  }
103
105
  }
104
106
  .pop-up-header {
105
- padding: 6px 8px;
107
+ padding: 6px 0px;
106
108
  background-color: rgba(255, 255, 255, 0.1);
107
109
  display: flex;
108
110
  flex-direction: column;
@@ -1,7 +1,7 @@
1
- import{j as e}from"../../../node_modules/react/jsx-runtime.js";import"../../curtain/CurtainHelper.js";import{PickerType as o}from"../../variable-picker-v3/model.js";import{cloneDeep as n}from"lodash";import{useRef as t,useState as i,useEffect as l}from"react";import a from"styled-components";import{Input as s}from"../../input/Input.js";import{InputWithVariables as d}from"../../input-with-vars/InputWithVariables.js";import{isRCSChannel as r,isCarouselComponent as p}from"../../template-preview/helpers/templateMiscHelper.js";import{HEADER_TYPES as u}from"../../template-preview/models/TemplateMeta.js";import{POD as c}from"../../template-preview/models/WhatsAppTemplate.js";import{useTemplateModalContext as v}from"../context/templateModalContext.js";import{STATIC_URL_VARIABLE_NAME as m}from"../utils/constants.js";import{getAllDataFromTemplateComponent as b}from"../utils/getDataFromTemplateComponent.js";import{isVariable as g}from"../utils/validateIsUrl.js";import{validateInputName as h,validateInputNameChatbot as f}from"../utils/validateName.js";import{BackTrackComponent as j}from"./BackTrackComponent.js";import{DiscountCodeComponent as x}from"./DiscountCodeComponent.js";import C from"./EditMediaModal.js";import O from"./EditMediaV2.js";import{EditTemplateMediaContainer as T}from"./EditMediaV2.style.js";import{useEditWhatsappTemplateMedia as y}from"./useEditWhtasappTemplateMedia.js";import V from"./VariableConnector.js";import{Container as E}from"./VariableConnectorsPanel.js";import B from"./VariableConnectorWhatsApp.js";import M from"./VariableEditorHeader.js";import k from"./WhatsAppTemplateCardButtonV2.js";const I=a=>{let{template:I,onTemplateChange:L,whatsappSpecificPickerMeta:R,showVariableModal:U,variableListForImage:P,setDiscountCode:H,fileName:N,setFileName:D}=a;var A,F,_,q,Q,S,Y,K,W,$,G,X,z,J,Z,ee,oe,ne,te,ie,le,ae,se,de,re,pe,ue,ce,ve,me,be,ge,he,fe,je,xe,Ce,Oe,Te;const ye=I.isCarouselType,{originalVariableList:Ve,pod:Ee,extras:Be,selectedCarouselIndex:Me,isProductCarouselType:ke,disableCopyCode:Ie,isError:we,cardIndex:Le}=v(),{descriptionComponents:Re,urlBtns:Ue,qrbBtns:Pe,imageComponent:He,bodyVariables:Ne,headerVariables:De,titleVariables:Ae}=b(I),Fe=t(null),[_e,qe]=i(!1),[Qe,Se]=i(-1===Me?{descriptionComponents:Re,urlBtns:Ue,qrbBtns:Pe,imageComponent:He,bodyVariables:Ne,headerVariables:De,titleVariables:Ae}:{}),{uploadMediaLink:Ye,uploadMediaFiles:Ke,validateMimeType:We}=R,$e=y({uploadMediaLink:Ye,uploadMediaFiles:Ke,updateTemplateImageUrl:function(e,o){var t,i,l,a,s,d,r,p;let u;u=null!=Me&&Me>-1?{components:null===(i=null===(t=I.components[Le])||void 0===t?void 0:t.cards)||void 0===i?void 0:i[Me].components,mapping:null===(a=null===(l=null==I?void 0:I.mapping)||void 0===l?void 0:l.cards)||void 0===a?void 0:a[Me]}:Object.assign({},I);const c=null===(s=null==u?void 0:u.components)||void 0===s?void 0:s.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==c&&c>-1&&(null==u?void 0:u.components[c])){const n=Object.assign(Object.assign({},u.components[c]),{format:o,example:{header_handle:[e]}}),t=[...u.components];t[c]=n,u=Object.assign(Object.assign({},u),{components:t})}u.mapping&&(u.mapping=Object.assign(Object.assign({},u.mapping),{header:void 0}));if(null!=Me&&Me>-1){const e=n(I);e.components[Le].cards[Me].components=u.components,(null===(d=null==e?void 0:e.mapping)||void 0===d?void 0:d.cards)&&(null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.cards.length)>0&&(e.mapping.cards[Me]=null!==(p=u.mapping)&&void 0!==p?p:{}),null==L||L(Object.assign({},e)),Xe(!0)}else null==L||L(Object.assign({},u))},validateMimeType:We,mediaComponent:ye?Qe.imageComponent:He,fileRef:Fe}),[Ge,Xe]=i(!1),[ze,Je]=i(N),[Ze,eo]=i();function oo(e,o,t){var i,l,a,s,d,r,u,c,v,m;const b=null!=Me&&Me>-1?{components:null===(i=Object.assign({},I).components[Le].cards)||void 0===i?void 0:i[Me].components,mapping:null===(l=Object.assign({},I).mapping.cards)||void 0===l?void 0:l[Me]}:Object.assign({},I),g=n(b),h="custom"===o&&"string"==typeof e,f=h?e:"string"!=typeof e?e.defaultValue?e.defaultValue:"https://d.bik.ai/":"https://d.bik.ai";if(null!=Me&&Me>-1&&ke){const o=Object.assign({},I).components.map((e=>{var o;return p(e.type)?Object.assign(Object.assign({},e),{cards:null===(o=e.cards)||void 0===o?void 0:o.map((e=>Object.assign(Object.assign({},e),{components:e.components.map((e=>{var o,n,i;if("BUTTONS"===e.type){const l=null===(o=e.buttons)||void 0===o?void 0:o.filter((e=>"URL"===e.type));let a=null!==(n=null==l?void 0:l[t])&&void 0!==n?n:{};a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[f]});const s=null===(i=e.buttons)||void 0===i?void 0:i.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e));return Object.assign(Object.assign({},e),{buttons:s})}return e}))})))}):e})),i=null===(s=null===(a=Object.assign({},I).mapping)||void 0===a?void 0:a.cards)||void 0===s?void 0:s.map((o=>{var n;return Object.assign(Object.assign({},o),{buttons:null===(n=null==o?void 0:o.buttons)||void 0===n?void 0:n.map(((o,n)=>n===t?h?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"":o))})})),l=n(I);return l.components=o,l.mapping.cards=i,void(null==L||L(Object.assign({},l)))}const j=null==g?void 0:g.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==j&&j>-1){const n=null===(d=null==g?void 0:g.components[j].buttons)||void 0===d?void 0:d.filter((e=>"URL"===e.type));if((null==n?void 0:n.length)>0){const i="custom"===o&&"string"==typeof e,l=i?e:"string"!=typeof e&&e.defaultValue?e.defaultValue:"https://d.bik.ai/";let a=n[t];a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[l]});const s=[...null!==(c=null===(u=null===(r=g.components)||void 0===r?void 0:r[j])||void 0===u?void 0:u.buttons)&&void 0!==c?c:[]].map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e)),d=Object.assign(Object.assign({},g.components[j]),{buttons:s}),p=null===(v=g.mapping)||void 0===v?void 0:v.buttons;p&&p.length>0&&(p[t]=i?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"");const m=Object.assign(Object.assign({},g.mapping),{buttons:p});g.mapping=m;const b=[...g.components];b[j]=d,g.components=b}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(m=e.placeHolder)||void 0===m?void 0:m.slice(2,-2))?qe(!0):(qe(!1),null==H||H(""))}if(null!=Me&&Me>-1){const e=n(I);e.components[Le].cards[Me].components=g.components,e.mapping.cards[Me]=g.mapping,null==L||L(Object.assign({},e))}else null==L||L(g)}function no(e,o,t){var i,l,a,s,d,r,u;const c=null!=Me&&Me>-1?{components:null===(i=Object.assign({},I).components[Le].cards)||void 0===i?void 0:i[Me].components,mapping:null===(l=Object.assign({},I).mapping.cards)||void 0===l?void 0:l[Me]}:Object.assign({},I);if(null!=Me&&Me>-1&&ke){const o=Object.assign({},I).components.map((o=>{var n;return p(o.type)?Object.assign(Object.assign({},o),{cards:null===(n=o.cards)||void 0===n?void 0:n.map((o=>Object.assign(Object.assign({},o),{components:o.components.map((o=>{var n,i,l;if("BUTTONS"===o.type){const a=null===(n=null==o?void 0:o.buttons)||void 0===n?void 0:n.filter((e=>"QUICK_REPLY"===e.type));let s=null!==(i=null==a?void 0:a[t])&&void 0!==i?i:{};s=Object.assign(Object.assign({},s),{flowId:e.flowId,flowName:e.flowName});const d=null===(l=null==o?void 0:o.buttons)||void 0===l?void 0:l.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==s?void 0:s.text)?s:e));return Object.assign(Object.assign({},o),{buttons:d})}return o}))})))}):o})),i=n(I);return i.components=o,void(null==L||L(Object.assign({},i)))}const v=null==c?void 0:c.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==v&&v>-1){const o=null===(s=null===(a=null==c?void 0:c.components[v])||void 0===a?void 0:a.buttons)||void 0===s?void 0:s.filter((e=>"QUICK_REPLY"===e.type));if(o){let n=o[t];n=Object.assign(Object.assign({},n),{flowId:e.flowId,flowName:e.flowName});const i=[...null!==(u=null===(r=null===(d=c.components)||void 0===d?void 0:d[v])||void 0===r?void 0:r.buttons)&&void 0!==u?u:[]].map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==n?void 0:n.text)?n:e)),l=Object.assign(Object.assign({},c.components[v]),{buttons:i}),a=[...c.components];a[v]=l,c.components=a}}if(null!=Me&&Me>-1){const e=n(I);e.components[Le].cards[Me].components=c.components,null==L||L(Object.assign({},e))}else null==L||L(c)}l((()=>{var e,o;if(null===(e=I.mapping.buttons)||void 0===e?void 0:e.find((e=>"checkout.checkoutUrl"===e.slice(2,-2))))qe(!0);else{qe(!1);const e=null===(o=null==Be?void 0:Be.discountCodeExtra)||void 0===o?void 0:o[1];null==e||e("")}}),[I]),l((()=>{var e,o,n,t;if(null!=Me&&Me>-1){const i={components:null===(o=null===(e=I.components[Le])||void 0===e?void 0:e.cards)||void 0===o?void 0:o[Me].components,mapping:null===(t=null===(n=null==I?void 0:I.mapping)||void 0===n?void 0:n.cards)||void 0===t?void 0:t[Me]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:p,titleVariables:u}=b(i);Se({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:p,titleVariables:u})}else if(null!=Me&&-1===Me){const{descriptionComponents:e,urlBtns:o,qrbBtns:n,imageComponent:t,bodyVariables:i,headerVariables:l,titleVariables:a}=b(I);Se({descriptionComponents:e,urlBtns:o,qrbBtns:n,imageComponent:t,bodyVariables:i,headerVariables:l,titleVariables:a})}}),[Me]),l((()=>{var e,o,n,t;if(null!=Me&&Me>-1&&Ge){const i={components:null===(o=null===(e=I.components[Le])||void 0===e?void 0:e.cards)||void 0===o?void 0:o[Me].components,mapping:null===(t=null===(n=null==I?void 0:I.mapping)||void 0===n?void 0:n.cards)||void 0===t?void 0:t[Me]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:p,titleVariables:u}=b(i);Se({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:p,titleVariables:u}),Xe(!1)}}),[Ge]);l((()=>{we&&Ee===c.CHATBOT&&(()=>{if(!N)return void eo("PDF name is Required");const e=f(N);null==D||D(null!=N?N:""),eo(e?"Please enter a valid PDF name":void 0)})()}),[we]);const to=ye?Qe.imageComponent:He;return $e.openEditMedia?e.jsx(E,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e.jsx(C,{mediaComponentFormat:null!==(A=to.format)&&void 0!==A?A:u.IMAGE,uploadMedia:$e.uploadMedia,variableListForImage:P||[],useEditWhatsappTemplateMediaResponse:$e,setOpenEditMedia:$e.setOpenEditMedia,openEditMedia:$e.openEditMedia,editIconRef:$e.editIconRef,fileRef:Fe})})):e.jsxs(E,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:ke?"420px":"auto"}},{children:[!!Qe.imageComponent&&!ke&&!r(null==I?void 0:I.channel)&&e.jsxs(T,{children:[e.jsx(O,{imageName:null!==(_=null===(F=null==to?void 0:to.example)||void 0===F?void 0:F.header_handle)&&void 0!==_?_:[],handleImageChange:$e.handleImageChange,mediaType:null==to?void 0:to.format,error:$e.error,isLoading:$e.loading,setOpenEditMedia:$e.setOpenEditMedia,selectedVariable:g(null!==(S=null===(Q=null===(q=null==to?void 0:to.example)||void 0===q?void 0:q.header_handle)||void 0===Q?void 0:Q[0])&&void 0!==S?S:"")?null===(K=null===(Y=null==to?void 0:to.example)||void 0===Y?void 0:Y.header_handle)||void 0===K?void 0:K[0]:(null===($=null===(W=null==I?void 0:I.mapping)||void 0===W?void 0:W.header)||void 0===$?void 0:$[0])?null===(X=null===(G=null==I?void 0:I.mapping)||void 0===G?void 0:G.header)||void 0===X?void 0:X[0]:$e.selectedVariable}),(null==He?void 0:He.format)==u.DOCUMENT?e.jsx(w,{children:Ee===c.CHATBOT?e.jsx(d,{labelText:"PDF Name",placeHolder:"Enter the name",errorMessage:Ze||void 0,onChange:e=>{var o;eo(""),null==D||D(null!==(o=null==e?void 0:e.actualValue)&&void 0!==o?o:"")},pickerType:o.EMBEDDED,noMaxCharCheck:!0,allowMix:!0,showVarHeader:!0,varHeaderText:"Select variable",prevVariable:{actualValue:null!=N?N:"",variableType:"string"},variablesList:P,showAddButton:!0}):e.jsx(s,{labelText:"PDF Name",placeholder:"Enter the name",value:ze,errorMessage:Ze||void 0,onBlur:()=>{if(!ze)return null==D||D(""),void eo("PDF name is Required");const e=h(ze);null==D||D(ze),eo(e?"Please enter a valid PDF name":void 0)},onChangeText:e=>{eo(""),Je(e)}})}):e.jsx(e.Fragment,{})]}),(null===(z=Qe.bodyVariables)||void 0===z?void 0:z.length)>0&&e.jsx(M,{containerStyle:{paddingTop:Qe.mediaComponent?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null===(J=Qe.descriptionComponents)||void 0===J?void 0:J.map(((o,n)=>e.jsx(B,{originalVariableList:null!=Me&&Me>-1?Ve.cards[Me]:Ve,type:o.type,descriptionComponent:o.component,showVariableModal:U},n))),(null===(oe=null===(ee=null!=Me&&Me>-1?null===(Z=Ve.cards[Me])||void 0===Z?void 0:Z.buttons:null==Ve?void 0:Ve.buttons)||void 0===ee?void 0:ee.filter((e=>"URL"===e.type)))||void 0===oe?void 0:oe.length)>0&&e.jsx(M,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(ie=null===(te=null!=Me&&Me>-1?null===(ne=Ve.cards[Me])||void 0===ne?void 0:ne.buttons:null==Ve?void 0:Ve.buttons)||void 0===te?void 0:te.filter((e=>Ee===c.CHATBOT||"URL"===e.type)))||void 0===ie?void 0:ie.map(((o,n)=>{const t=o.buttonVariable===m;if("URL"===o.type)return e.jsx(k,{variableListIndex:n,disableEdit:t,CTAoptions:null==R?void 0:R.CTAoptions,button:o,currentVariableList:null!=Me&&Me>-1?Object.assign({},Ve.cards[Me]):Object.assign({},Ve),updateSelectedURLTemplateBtn:oo},`${n}_${Me}`)})),Ee===c.CHATBOT&&(null===(ae=null===(le=Pe[0])||void 0===le?void 0:le.component)||void 0===ae?void 0:ae.buttons)&&(null===(re=null===(de=null===(se=Pe[0])||void 0===se?void 0:se.component)||void 0===de?void 0:de.buttons)||void 0===re?void 0:re.length)>0&&e.jsx(j,{backTrackMessage:null===(pe=null==Be?void 0:Be.backTrackExtra)||void 0===pe?void 0:pe[0],setBackTrackMessage:null===(ue=null==Be?void 0:Be.backTrackExtra)||void 0===ue?void 0:ue[1]}),!r(null==I?void 0:I.channel)&&(null===(me=null===(ve=null!=Me&&Me>-1?null===(ce=Ve.cards[Me])||void 0===ce?void 0:ce.buttons:null==Ve?void 0:Ve.buttons)||void 0===ve?void 0:ve.filter((e=>"QUICK_REPLY"===e.type)))||void 0===me?void 0:me.length)>0&&(Ee!==c.CHATBOT?e.jsx(M,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):e.jsx(j,{backTrackMessage:null===(be=null==Be?void 0:Be.backTrackExtra)||void 0===be?void 0:be[0],setBackTrackMessage:null===(ge=null==Be?void 0:Be.backTrackExtra)||void 0===ge?void 0:ge[1]})),!r(null==I?void 0:I.channel)&&(null===(je=null===(fe=null!=Me&&Me>-1?null===(he=Ve.cards[Me])||void 0===he?void 0:he.buttons:null==Ve?void 0:Ve.buttons)||void 0===fe?void 0:fe.filter((e=>"QUICK_REPLY"===e.type)))||void 0===je?void 0:je.map(((o,n)=>{if("QUICK_REPLY"===o.type&&Ee!==c.CHATBOT)return e.jsx(k,{variableListIndex:n,QRBoptions:null==R?void 0:R.QRBoptions,button:o,currentVariableList:null!=Me&&Me>-1?Object.assign({},Ve.cards[Me]):Object.assign({},Ve),updateSelectedQRBTemplateBtn:no},`${n}_${Me}`)}))),Ee===c.CHATBOT&&_e&&e.jsx(x,{discountCode:null===(xe=null==Be?void 0:Be.discountCodeExtra)||void 0===xe?void 0:xe[0],setDiscountCode:null===(Ce=null==Be?void 0:Be.discountCodeExtra)||void 0===Ce?void 0:Ce[1]}),null===(Te=null!=Me&&Me>-1?null===(Oe=Ve.cards[Me])||void 0===Oe?void 0:Oe.buttons:null==Ve?void 0:Ve.buttons)||void 0===Te?void 0:Te.map(((o,n)=>{var t,i,l,a,d;if("COPY_CODE"===o.type)return e.jsx(e.Fragment,{children:Ie?e.jsx("div",Object.assign({style:{marginBottom:20,borderRadius:4,padding:"8px 10px"}},{children:e.jsx(s,{state:"disabled",labelText:null!==(t=o.text)&&void 0!==t?t:"Copy Code",value:null!==(i=o.buttonVariable)&&void 0!==i?i:"",onChangeText:()=>{}})})):e.jsx(V,{index:n,variable:{variableName:null!==(l=o.text)&&void 0!==l?l:"Copy Code",updatedValue:null!==(a=o.buttonVariable)&&void 0!==a?a:"",type:"string",isEditableVariable:!0,index:null!==(d=o.index)&&void 0!==d?d:0},showVariableModal:!0,componentType:"BUTTONS",buttonType:o.type},n)})}))]}))},w=a.div`
1
+ import{j as e}from"../../../node_modules/react/jsx-runtime.js";import"../../curtain/CurtainHelper.js";import{PickerType as o}from"../../variable-picker-v3/model.js";import{cloneDeep as n}from"lodash";import{useRef as t,useState as i,useEffect as l}from"react";import a from"styled-components";import{Input as s}from"../../input/Input.js";import{InputWithVariables as d}from"../../input-with-vars/InputWithVariables.js";import{isRCSChannel as r,isCarouselComponent as p}from"../../template-preview/helpers/templateMiscHelper.js";import{HEADER_TYPES as u}from"../../template-preview/models/TemplateMeta.js";import{POD as c}from"../../template-preview/models/WhatsAppTemplate.js";import{useTemplateModalContext as v}from"../context/templateModalContext.js";import{STATIC_URL_VARIABLE_NAME as m,UNSUBSCRIBE_URL_VARIABLE as b}from"../utils/constants.js";import{getAllDataFromTemplateComponent as g}from"../utils/getDataFromTemplateComponent.js";import{isVariable as h}from"../utils/validateIsUrl.js";import{validateInputName as f,validateInputNameChatbot as j}from"../utils/validateName.js";import{BackTrackComponent as x}from"./BackTrackComponent.js";import{DiscountCodeComponent as C}from"./DiscountCodeComponent.js";import O from"./EditMediaModal.js";import T from"./EditMediaV2.js";import{EditTemplateMediaContainer as y}from"./EditMediaV2.style.js";import{useEditWhatsappTemplateMedia as V}from"./useEditWhtasappTemplateMedia.js";import E from"./VariableConnector.js";import{Container as B}from"./VariableConnectorsPanel.js";import M from"./VariableConnectorWhatsApp.js";import k from"./VariableEditorHeader.js";import I from"./WhatsAppTemplateCardButtonV2.js";const w=a=>{let{template:w,onTemplateChange:R,whatsappSpecificPickerMeta:U,showVariableModal:P,variableListForImage:H,setDiscountCode:N,fileName:D,setFileName:A}=a;var F,_,q,Q,S,Y,K,W,$,G,X,z,J,Z,ee,oe,ne,te,ie,le,ae,se,de,re,pe,ue,ce,ve,me,be,ge,he,fe,je,xe,Ce,Oe,Te,ye;const Ve=w.isCarouselType,{originalVariableList:Ee,pod:Be,extras:Me,selectedCarouselIndex:ke,isProductCarouselType:Ie,disableCopyCode:we,isError:Le,cardIndex:Re}=v(),{descriptionComponents:Ue,urlBtns:Pe,qrbBtns:He,imageComponent:Ne,bodyVariables:De,headerVariables:Ae,titleVariables:Fe}=g(w),_e=t(null),[qe,Qe]=i(!1),[Se,Ye]=i(-1===ke?{descriptionComponents:Ue,urlBtns:Pe,qrbBtns:He,imageComponent:Ne,bodyVariables:De,headerVariables:Ae,titleVariables:Fe}:{}),{uploadMediaLink:Ke,uploadMediaFiles:We,validateMimeType:$e}=U,Ge=V({uploadMediaLink:Ke,uploadMediaFiles:We,updateTemplateImageUrl:function(e,o){var t,i,l,a,s,d,r,p;let u;u=null!=ke&&ke>-1?{components:null===(i=null===(t=w.components[Re])||void 0===t?void 0:t.cards)||void 0===i?void 0:i[ke].components,mapping:null===(a=null===(l=null==w?void 0:w.mapping)||void 0===l?void 0:l.cards)||void 0===a?void 0:a[ke]}:Object.assign({},w);const c=null===(s=null==u?void 0:u.components)||void 0===s?void 0:s.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==c&&c>-1&&(null==u?void 0:u.components[c])){const n=Object.assign(Object.assign({},u.components[c]),{format:o,example:{header_handle:[e]}}),t=[...u.components];t[c]=n,u=Object.assign(Object.assign({},u),{components:t})}u.mapping&&(u.mapping=Object.assign(Object.assign({},u.mapping),{header:void 0}));if(null!=ke&&ke>-1){const e=n(w);e.components[Re].cards[ke].components=u.components,(null===(d=null==e?void 0:e.mapping)||void 0===d?void 0:d.cards)&&(null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.cards.length)>0&&(e.mapping.cards[ke]=null!==(p=u.mapping)&&void 0!==p?p:{}),null==R||R(Object.assign({},e)),ze(!0)}else null==R||R(Object.assign({},u))},validateMimeType:$e,mediaComponent:Ve?Se.imageComponent:Ne,fileRef:_e}),[Xe,ze]=i(!1),[Je,Ze]=i(D),[eo,oo]=i();function no(e,o,t){var i,l,a,s,d,r,u,c,v,m;const b=null!=ke&&ke>-1?{components:null===(i=Object.assign({},w).components[Re].cards)||void 0===i?void 0:i[ke].components,mapping:null===(l=Object.assign({},w).mapping.cards)||void 0===l?void 0:l[ke]}:Object.assign({},w),g=n(b),h="custom"===o&&"string"==typeof e,f=h?e:"string"!=typeof e?e.defaultValue?e.defaultValue:"https://d.bik.ai/":"https://d.bik.ai";if(null!=ke&&ke>-1&&Ie){const o=Object.assign({},w).components.map((e=>{var o;return p(e.type)?Object.assign(Object.assign({},e),{cards:null===(o=e.cards)||void 0===o?void 0:o.map((e=>Object.assign(Object.assign({},e),{components:e.components.map((e=>{var o,n,i;if("BUTTONS"===e.type){const l=null===(o=e.buttons)||void 0===o?void 0:o.filter((e=>"URL"===e.type));let a=null!==(n=null==l?void 0:l[t])&&void 0!==n?n:{};a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[f]});const s=null===(i=e.buttons)||void 0===i?void 0:i.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e));return Object.assign(Object.assign({},e),{buttons:s})}return e}))})))}):e})),i=null===(s=null===(a=Object.assign({},w).mapping)||void 0===a?void 0:a.cards)||void 0===s?void 0:s.map((o=>{var n;return Object.assign(Object.assign({},o),{buttons:null===(n=null==o?void 0:o.buttons)||void 0===n?void 0:n.map(((o,n)=>n===t?h?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"":o))})})),l=n(w);return l.components=o,l.mapping.cards=i,void(null==R||R(Object.assign({},l)))}const j=null==g?void 0:g.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==j&&j>-1){const n=null===(d=null==g?void 0:g.components[j].buttons)||void 0===d?void 0:d.filter((e=>"URL"===e.type));if((null==n?void 0:n.length)>0){const i="custom"===o&&"string"==typeof e,l=i?e:"string"!=typeof e&&e.defaultValue?e.defaultValue:"https://d.bik.ai/";let a=n[t];a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[l]});const s=[...null!==(c=null===(u=null===(r=g.components)||void 0===r?void 0:r[j])||void 0===u?void 0:u.buttons)&&void 0!==c?c:[]].map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e)),d=Object.assign(Object.assign({},g.components[j]),{buttons:s}),p=null===(v=g.mapping)||void 0===v?void 0:v.buttons;p&&p.length>0&&(p[t]=i?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"");const m=Object.assign(Object.assign({},g.mapping),{buttons:p});g.mapping=m;const b=[...g.components];b[j]=d,g.components=b}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(m=e.placeHolder)||void 0===m?void 0:m.slice(2,-2))?Qe(!0):(Qe(!1),null==N||N(""))}if(null!=ke&&ke>-1){const e=n(w);e.components[Re].cards[ke].components=g.components,e.mapping.cards[ke]=g.mapping,null==R||R(Object.assign({},e))}else null==R||R(g)}function to(e,o,t){var i,l,a,s,d,r,u;const c=null!=ke&&ke>-1?{components:null===(i=Object.assign({},w).components[Re].cards)||void 0===i?void 0:i[ke].components,mapping:null===(l=Object.assign({},w).mapping.cards)||void 0===l?void 0:l[ke]}:Object.assign({},w);if(null!=ke&&ke>-1&&Ie){const o=Object.assign({},w).components.map((o=>{var n;return p(o.type)?Object.assign(Object.assign({},o),{cards:null===(n=o.cards)||void 0===n?void 0:n.map((o=>Object.assign(Object.assign({},o),{components:o.components.map((o=>{var n,i,l;if("BUTTONS"===o.type){const a=null===(n=null==o?void 0:o.buttons)||void 0===n?void 0:n.filter((e=>"QUICK_REPLY"===e.type));let s=null!==(i=null==a?void 0:a[t])&&void 0!==i?i:{};s=Object.assign(Object.assign({},s),{flowId:e.flowId,flowName:e.flowName});const d=null===(l=null==o?void 0:o.buttons)||void 0===l?void 0:l.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==s?void 0:s.text)?s:e));return Object.assign(Object.assign({},o),{buttons:d})}return o}))})))}):o})),i=n(w);return i.components=o,void(null==R||R(Object.assign({},i)))}const v=null==c?void 0:c.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==v&&v>-1){const o=null===(s=null===(a=null==c?void 0:c.components[v])||void 0===a?void 0:a.buttons)||void 0===s?void 0:s.filter((e=>"QUICK_REPLY"===e.type));if(o){let n=o[t];n=Object.assign(Object.assign({},n),{flowId:e.flowId,flowName:e.flowName});const i=[...null!==(u=null===(r=null===(d=c.components)||void 0===d?void 0:d[v])||void 0===r?void 0:r.buttons)&&void 0!==u?u:[]].map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==n?void 0:n.text)?n:e)),l=Object.assign(Object.assign({},c.components[v]),{buttons:i}),a=[...c.components];a[v]=l,c.components=a}}if(null!=ke&&ke>-1){const e=n(w);e.components[Re].cards[ke].components=c.components,null==R||R(Object.assign({},e))}else null==R||R(c)}l((()=>{var e,o;if(null===(e=w.mapping.buttons)||void 0===e?void 0:e.find((e=>"checkout.checkoutUrl"===e.slice(2,-2))))Qe(!0);else{Qe(!1);const e=null===(o=null==Me?void 0:Me.discountCodeExtra)||void 0===o?void 0:o[1];null==e||e("")}}),[w]),l((()=>{var e,o,n,t;if(null!=ke&&ke>-1){const i={components:null===(o=null===(e=w.components[Re])||void 0===e?void 0:e.cards)||void 0===o?void 0:o[ke].components,mapping:null===(t=null===(n=null==w?void 0:w.mapping)||void 0===n?void 0:n.cards)||void 0===t?void 0:t[ke]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:p,titleVariables:u}=g(i);Ye({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:p,titleVariables:u})}else if(null!=ke&&-1===ke){const{descriptionComponents:e,urlBtns:o,qrbBtns:n,imageComponent:t,bodyVariables:i,headerVariables:l,titleVariables:a}=g(w);Ye({descriptionComponents:e,urlBtns:o,qrbBtns:n,imageComponent:t,bodyVariables:i,headerVariables:l,titleVariables:a})}}),[ke]),l((()=>{var e,o,n,t;if(null!=ke&&ke>-1&&Xe){const i={components:null===(o=null===(e=w.components[Re])||void 0===e?void 0:e.cards)||void 0===o?void 0:o[ke].components,mapping:null===(t=null===(n=null==w?void 0:w.mapping)||void 0===n?void 0:n.cards)||void 0===t?void 0:t[ke]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:p,titleVariables:u}=g(i);Ye({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:p,titleVariables:u}),ze(!1)}}),[Xe]);l((()=>{Le&&Be===c.CHATBOT&&(()=>{if(!D)return void oo("PDF name is Required");const e=j(D);null==A||A(null!=D?D:""),oo(e?"Please enter a valid PDF name":void 0)})()}),[Le]);const io=Ve?Se.imageComponent:Ne;return Ge.openEditMedia?e.jsx(B,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e.jsx(O,{mediaComponentFormat:null!==(F=io.format)&&void 0!==F?F:u.IMAGE,uploadMedia:Ge.uploadMedia,variableListForImage:H||[],useEditWhatsappTemplateMediaResponse:Ge,setOpenEditMedia:Ge.setOpenEditMedia,openEditMedia:Ge.openEditMedia,editIconRef:Ge.editIconRef,fileRef:_e})})):e.jsxs(B,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:Ie?"420px":"auto"}},{children:[!!Se.imageComponent&&!Ie&&!r(null==w?void 0:w.channel)&&e.jsxs(y,{children:[e.jsx(T,{imageName:null!==(q=null===(_=null==io?void 0:io.example)||void 0===_?void 0:_.header_handle)&&void 0!==q?q:[],handleImageChange:Ge.handleImageChange,mediaType:null==io?void 0:io.format,error:Ge.error,isLoading:Ge.loading,setOpenEditMedia:Ge.setOpenEditMedia,selectedVariable:h(null!==(Y=null===(S=null===(Q=null==io?void 0:io.example)||void 0===Q?void 0:Q.header_handle)||void 0===S?void 0:S[0])&&void 0!==Y?Y:"")?null===(W=null===(K=null==io?void 0:io.example)||void 0===K?void 0:K.header_handle)||void 0===W?void 0:W[0]:(null===(G=null===($=null==w?void 0:w.mapping)||void 0===$?void 0:$.header)||void 0===G?void 0:G[0])?null===(z=null===(X=null==w?void 0:w.mapping)||void 0===X?void 0:X.header)||void 0===z?void 0:z[0]:Ge.selectedVariable}),(null==Ne?void 0:Ne.format)==u.DOCUMENT?e.jsx(L,{children:Be===c.CHATBOT?e.jsx(d,{labelText:"PDF Name",placeHolder:"Enter the name",errorMessage:eo||void 0,onChange:e=>{var o;oo(""),null==A||A(null!==(o=null==e?void 0:e.actualValue)&&void 0!==o?o:"")},pickerType:o.EMBEDDED,noMaxCharCheck:!0,allowMix:!0,showVarHeader:!0,varHeaderText:"Select variable",prevVariable:{actualValue:null!=D?D:"",variableType:"string"},variablesList:H,showAddButton:!0}):e.jsx(s,{labelText:"PDF Name",placeholder:"Enter the name",value:Je,errorMessage:eo||void 0,onBlur:()=>{if(!Je)return null==A||A(""),void oo("PDF name is Required");const e=f(Je);null==A||A(Je),oo(e?"Please enter a valid PDF name":void 0)},onChangeText:e=>{oo(""),Ze(e)}})}):e.jsx(e.Fragment,{})]}),(null===(J=Se.bodyVariables)||void 0===J?void 0:J.length)>0&&e.jsx(k,{containerStyle:{paddingTop:Se.mediaComponent?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null===(Z=Se.descriptionComponents)||void 0===Z?void 0:Z.map(((o,n)=>e.jsx(M,{originalVariableList:null!=ke&&ke>-1?Ee.cards[ke]:Ee,type:o.type,descriptionComponent:o.component,showVariableModal:P},n))),(null===(ne=null===(oe=null!=ke&&ke>-1?null===(ee=Ee.cards[ke])||void 0===ee?void 0:ee.buttons:null==Ee?void 0:Ee.buttons)||void 0===oe?void 0:oe.filter((e=>"URL"===e.type)))||void 0===ne?void 0:ne.length)>0&&e.jsx(k,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(le=null===(ie=null!=ke&&ke>-1?null===(te=Ee.cards[ke])||void 0===te?void 0:te.buttons:null==Ee?void 0:Ee.buttons)||void 0===ie?void 0:ie.filter((e=>Be===c.CHATBOT||"URL"===e.type)))||void 0===le?void 0:le.map(((o,n)=>{const t=o.buttonVariable===m,i=o.buttonVariable===b;if("URL"===o.type)return e.jsx(I,{variableListIndex:n,disableEdit:t||i,CTAoptions:null==U?void 0:U.CTAoptions,button:o,currentVariableList:null!=ke&&ke>-1?Object.assign({},Ee.cards[ke]):Object.assign({},Ee),updateSelectedURLTemplateBtn:no},`${n}_${ke}`)})),Be===c.CHATBOT&&(null===(se=null===(ae=He[0])||void 0===ae?void 0:ae.component)||void 0===se?void 0:se.buttons)&&(null===(pe=null===(re=null===(de=He[0])||void 0===de?void 0:de.component)||void 0===re?void 0:re.buttons)||void 0===pe?void 0:pe.length)>0&&e.jsx(x,{backTrackMessage:null===(ue=null==Me?void 0:Me.backTrackExtra)||void 0===ue?void 0:ue[0],setBackTrackMessage:null===(ce=null==Me?void 0:Me.backTrackExtra)||void 0===ce?void 0:ce[1]}),!r(null==w?void 0:w.channel)&&(null===(be=null===(me=null!=ke&&ke>-1?null===(ve=Ee.cards[ke])||void 0===ve?void 0:ve.buttons:null==Ee?void 0:Ee.buttons)||void 0===me?void 0:me.filter((e=>"QUICK_REPLY"===e.type)))||void 0===be?void 0:be.length)>0&&(Be!==c.CHATBOT?e.jsx(k,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):e.jsx(x,{backTrackMessage:null===(ge=null==Me?void 0:Me.backTrackExtra)||void 0===ge?void 0:ge[0],setBackTrackMessage:null===(he=null==Me?void 0:Me.backTrackExtra)||void 0===he?void 0:he[1]})),!r(null==w?void 0:w.channel)&&(null===(xe=null===(je=null!=ke&&ke>-1?null===(fe=Ee.cards[ke])||void 0===fe?void 0:fe.buttons:null==Ee?void 0:Ee.buttons)||void 0===je?void 0:je.filter((e=>"QUICK_REPLY"===e.type)))||void 0===xe?void 0:xe.map(((o,n)=>{if("QUICK_REPLY"===o.type&&Be!==c.CHATBOT)return e.jsx(I,{variableListIndex:n,QRBoptions:null==U?void 0:U.QRBoptions,button:o,currentVariableList:null!=ke&&ke>-1?Object.assign({},Ee.cards[ke]):Object.assign({},Ee),updateSelectedQRBTemplateBtn:to},`${n}_${ke}`)}))),Be===c.CHATBOT&&qe&&e.jsx(C,{discountCode:null===(Ce=null==Me?void 0:Me.discountCodeExtra)||void 0===Ce?void 0:Ce[0],setDiscountCode:null===(Oe=null==Me?void 0:Me.discountCodeExtra)||void 0===Oe?void 0:Oe[1]}),null===(ye=null!=ke&&ke>-1?null===(Te=Ee.cards[ke])||void 0===Te?void 0:Te.buttons:null==Ee?void 0:Ee.buttons)||void 0===ye?void 0:ye.map(((o,n)=>{var t,i,l,a,d;if("COPY_CODE"===o.type)return e.jsx(e.Fragment,{children:we?e.jsx("div",Object.assign({style:{marginBottom:20,borderRadius:4,padding:"8px 10px"}},{children:e.jsx(s,{state:"disabled",labelText:null!==(t=o.text)&&void 0!==t?t:"Copy Code",value:null!==(i=o.buttonVariable)&&void 0!==i?i:"",onChangeText:()=>{}})})):e.jsx(E,{index:n,variable:{variableName:null!==(l=o.text)&&void 0!==l?l:"Copy Code",updatedValue:null!==(a=o.buttonVariable)&&void 0!==a?a:"",type:"string",isEditableVariable:!0,index:null!==(d=o.index)&&void 0!==d?d:0},showVariableModal:!0,componentType:"BUTTONS",buttonType:o.type},n)})}))]}))},L=a.div`
2
2
  padding-top: 24px;
3
3
  padding-left: 10px;
4
4
  padding-right: 10px;
5
5
  margin-bottom: 8px;
6
6
  line-height: normal;
7
- `;export{I as default};
7
+ `;export{w as default};
@@ -1 +1 @@
1
- import{j as e}from"../../../node_modules/react/jsx-runtime.js";import{cloneDeep as t}from"lodash";import{useState as l,useEffect as s}from"react";import{Dropdown as a}from"../../dropdown/Dropdown.js";import{Input as n}from"../../input/Input.js";import{editableVarPattern as i}from"../../template-preview/constants/regexPatterns.js";import{STATIC_URL_CTA_OPTION as o,CUSTOM_URL_NAME as r}from"../../template-preview/models/TemplateMeta.js";import{POD as u}from"../../template-preview/models/WhatsAppTemplate.js";import{BodySecondary as c}from"../../TypographyStyle.js";import{COLORS as d}from"../../../constants/Theme.js";import{useTemplateModalContext as b}from"../context/templateModalContext.js";import{STATIC_URL_VARIABLE_NAME as p}from"../utils/constants.js";import{validateIsUrl as m}from"../utils/validateIsUrl.js";import j,{Container as v}from"./VariableConnector.js";const g=g=>{let{variableListIndex:O,button:f,updateSelectedURLTemplateBtn:x,updateSelectedQRBTemplateBtn:y,currentVariableList:h,CTAoptions:L,QRBoptions:R,disableEdit:U}=g;var V,T,w,C,I;const[E,P]=l(""),[H,N]=l(),_=null==L?void 0:L.map((e=>Object.assign(Object.assign({},e),{selected:(null==H?void 0:H.value)===e.value&&H.label===e.label}))),B=null==R?void 0:R.map((e=>Object.assign(Object.assign({},e),{selected:(null==H?void 0:H.value)===e.value}))),{isError:Q,disableEditVariable:k,pod:S,selectedCarouselIndex:K,originalVariableList:Y,setOriginalVariableList:$,isProductCarouselType:q,ctaOptionsErrors:A,setCtaOptionsErrors:M}=b();function D(e){if(P(e),null!=K&&K>-1&&q){const l=t(Y);if("URL"===f.type){const t=l.cards.map((t=>{let l=t.buttons.filter((e=>"URL"===e.type))[O];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=t.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e));return Object.assign(Object.assign({},t),{buttons:s})}));null==$||$((e=>Object.assign(Object.assign({},e),{cards:t}))),null==x||x(`https://${e}`,"custom",O)}return}let l=h.buttons.filter((e=>"URL"===e.type))[O];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=h.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e)),a=Object.assign({},null!=K&&K>-1?Y.cards[K]:Y);if(a.buttons=s,null!=K&&K>-1){const e=[...Y.cards];e[K]=a,null==$||$((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==$||$((e=>Object.assign(Object.assign({},e),{buttons:[...s]})));null==x||x(`https://${e}`,"custom",O)}return s((()=>{var e;if(f.buttonVariable&&i.test(f.buttonVariable))f.buttonVariable===p?N(o):N(r),P((null===(e=f.example)||void 0===e?void 0:e[0].split("https://")[1])||"");else{let e=-1;const t="URL"===f.type?L:R;e="URL"===f.type?t.findIndex((e=>e.placeHolder===f.buttonVariable)):t.findIndex((e=>e.label===f.flowName)),e>-1?N(t[e]):null==M||M((e=>Object.assign(Object.assign({},e),{[O]:"Required field!"})))}}),[]),S!==u.CHATBOT?e.jsxs(v,{children:[e.jsx("div",Object.assign({style:{marginBottom:8}},{children:e.jsxs(c,Object.assign({style:{color:d.content.primary}},{children:[f.text," button"]}))})),e.jsx("div",Object.assign({style:{marginBottom:12}},{children:e.jsx(a,{disabled:k||U,truncatedText:!1,options:"URL"===f.type?"static_link"===(null==H?void 0:H.value)?[o]:_:B,isSearchable:!0,onSelect:function(e,l){null==M||M((e=>(delete e[O],Object.assign({},e))));const s=e;N(s);const a=("URL"===f.type?L:R).find((e=>e.placeHolder===s.placeHolder));if(a)if("custom_link"!==a.value){if(null!=K&&K>-1&&q){const e=t(Y);if("URL"===f.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"URL"===e.type))[O];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder});const l=e.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==x||x({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",O),null==$||$((e=>Object.assign(Object.assign({},e),{cards:t})))}else if("QUICK_REPLY"===f.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"QUICK_REPLY"===e.type))[O];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value});const l=e.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==y||y({flowName:s.label,flowId:s.value},"placeholder",O),null==$||$((e=>Object.assign(Object.assign({},e),{cards:t})))}return}let e;if("URL"===f.type){let t=h.buttons.filter((e=>"URL"===e.type))[O];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder,example:[(null==s?void 0:s.value)||"https://d.bik.ai/"]}),e=h.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==x||x({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",O)}else{let t=h.buttons.filter((e=>"QUICK_REPLY"===e.type))[O];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value}),e=h.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==y||y({flowName:s.label,flowId:s.value},"placeholder",O)}const l=Object.assign({},null!=K&&K>-1?Y.cards[K]:Y);if(l.buttons=e,null!=K&&K>-1){const e=[...Y.cards];e[K]=l,null==$||$((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==$||$((t=>Object.assign(Object.assign({},t),{buttons:[...e]})))}else D("")},defaultOptions:H?[Object.assign(Object.assign({},H),{selected:!0})]:[],error:Q?null==A?void 0:A[O]:void 0})})),("custom_link"===(null==H?void 0:H.value)||"static_link"===(null==H?void 0:H.value))&&e.jsx("div",Object.assign({style:{marginBottom:20}},{children:e.jsx(n,{state:k||U?"disabled":"none",errorMessage:Q?E?m(E)?"":"Enter valid URL":"Required field":"",value:E,prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:D,maxCharLimit:2e3})}))]}):e.jsx(j,{index:O,variable:{variableName:null!==(V=f.text)&&void 0!==V?V:"",updatedValue:"((customPlaceholderName))"===f.buttonVariable?`${null===(T=f.example)||void 0===T?void 0:T[0]}`:null!==(w=f.buttonVariable)&&void 0!==w?w:"",type:"link",isEditableVariable:!0,index:null!==(C=f.index)&&void 0!==C?C:0,queryParams:null!==(I=f.queryParams)&&void 0!==I?I:[]},showVariableModal:!0,componentType:"BUTTONS",buttonType:f.type,CTAoptions:L})};export{g as default};
1
+ import{j as e}from"../../../node_modules/react/jsx-runtime.js";import{cloneDeep as t}from"lodash";import{useState as l,useEffect as s}from"react";import{Dropdown as a}from"../../dropdown/Dropdown.js";import{Input as n}from"../../input/Input.js";import{editableVarPattern as i}from"../../template-preview/constants/regexPatterns.js";import{UNSUBSCRIBE_URL_OPTION as o,STATIC_URL_CTA_OPTION as r,CUSTOM_URL_NAME as u}from"../../template-preview/models/TemplateMeta.js";import{POD as c}from"../../template-preview/models/WhatsAppTemplate.js";import{BodySecondary as d}from"../../TypographyStyle.js";import{COLORS as b}from"../../../constants/Theme.js";import{useTemplateModalContext as p}from"../context/templateModalContext.js";import{UNSUBSCRIBE_URL_VARIABLE as m,STATIC_URL_VARIABLE_NAME as j}from"../utils/constants.js";import{validateIsUrl as v}from"../utils/validateIsUrl.js";import g,{Container as f}from"./VariableConnector.js";const O=O=>{let{variableListIndex:x,button:y,updateSelectedURLTemplateBtn:h,updateSelectedQRBTemplateBtn:L,currentVariableList:R,CTAoptions:U,QRBoptions:V,disableEdit:T}=O;var w,C,I,E,P;const[H,N]=l(""),[_,B]=l(),Q=null==U?void 0:U.map((e=>Object.assign(Object.assign({},e),{selected:(null==_?void 0:_.value)===e.value&&_.label===e.label}))),k=null==V?void 0:V.map((e=>Object.assign(Object.assign({},e),{selected:(null==_?void 0:_.value)===e.value}))),{isError:S,disableEditVariable:K,pod:Y,selectedCarouselIndex:$,originalVariableList:q,setOriginalVariableList:A,isProductCarouselType:M,ctaOptionsErrors:D,setCtaOptionsErrors:W}=p();function z(e){if(N(e),null!=$&&$>-1&&M){const l=t(q);if("URL"===y.type){const t=l.cards.map((t=>{let l=t.buttons.filter((e=>"URL"===e.type))[x];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=t.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e));return Object.assign(Object.assign({},t),{buttons:s})}));null==A||A((e=>Object.assign(Object.assign({},e),{cards:t}))),null==h||h(`https://${e}`,"custom",x)}return}let l=R.buttons.filter((e=>"URL"===e.type))[x];l=Object.assign(Object.assign({},l),{buttonVariable:"((customPlaceholderName))",example:[`https://${e}`]});const s=R.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==l?void 0:l.text)?l:e)),a=Object.assign({},null!=$&&$>-1?q.cards[$]:q);if(a.buttons=s,null!=$&&$>-1){const e=[...q.cards];e[$]=a,null==A||A((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==A||A((e=>Object.assign(Object.assign({},e),{buttons:[...s]})));null==h||h(`https://${e}`,"custom",x)}return s((()=>{var e,t;if(y.buttonVariable===m)return B(o),void N((null===(e=y.example)||void 0===e?void 0:e[0].split("https://")[1])||"");if(y.buttonVariable&&i.test(y.buttonVariable))y.buttonVariable===j?B(r):B(u),N((null===(t=y.example)||void 0===t?void 0:t[0].split("https://")[1])||"");else{let e=-1;const t="URL"===y.type?U:V;e="URL"===y.type?t.findIndex((e=>e.placeHolder===y.buttonVariable)):t.findIndex((e=>e.label===y.flowName)),e>-1?B(t[e]):null==W||W((e=>Object.assign(Object.assign({},e),{[x]:"Required field!"})))}}),[]),Y!==c.CHATBOT?e.jsxs(f,{children:[e.jsx("div",Object.assign({style:{marginBottom:8}},{children:e.jsxs(d,Object.assign({style:{color:b.content.primary}},{children:[y.text," button"]}))})),e.jsx("div",Object.assign({style:{marginBottom:12}},{children:e.jsx(a,{disabled:K||T,truncatedText:!1,options:"URL"===y.type?"static_link"===(null==_?void 0:_.value)?[r]:Q:k,isSearchable:!0,onSelect:function(e,l){null==W||W((e=>(delete e[x],Object.assign({},e))));const s=e;B(s);const a=("URL"===y.type?U:V).find((e=>e.placeHolder===s.placeHolder));if(a)if("custom_link"!==a.value){if(null!=$&&$>-1&&M){const e=t(q);if("URL"===y.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"URL"===e.type))[x];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder});const l=e.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==h||h({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",x),null==A||A((e=>Object.assign(Object.assign({},e),{cards:t})))}else if("QUICK_REPLY"===y.type){const t=e.cards.map((e=>{let t=e.buttons.filter((e=>"QUICK_REPLY"===e.type))[x];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value});const l=e.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e));return Object.assign(Object.assign({},e),{buttons:l})}));null==L||L({flowName:s.label,flowId:s.value},"placeholder",x),null==A||A((e=>Object.assign(Object.assign({},e),{cards:t})))}return}let e;if("URL"===y.type){let t=R.buttons.filter((e=>"URL"===e.type))[x];t=Object.assign(Object.assign({},t),{buttonVariable:s.placeHolder,example:[(null==s?void 0:s.value)||"https://d.bik.ai/"]}),e=R.buttons.map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==h||h({defaultValue:a.value,placeHolder:a.placeHolder},"placeholder",x)}else{let t=R.buttons.filter((e=>"QUICK_REPLY"===e.type))[x];t=Object.assign(Object.assign({},t),{flowName:s.label,flowId:s.value}),e=R.buttons.map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==t?void 0:t.text)?t:e)),null==L||L({flowName:s.label,flowId:s.value},"placeholder",x)}const l=Object.assign({},null!=$&&$>-1?q.cards[$]:q);if(l.buttons=e,null!=$&&$>-1){const e=[...q.cards];e[$]=l,null==A||A((t=>Object.assign(Object.assign({},t),{cards:e})))}else null==A||A((t=>Object.assign(Object.assign({},t),{buttons:[...e]})))}else z("")},defaultOptions:_?[Object.assign(Object.assign({},_),{selected:!0})]:[],error:S?null==D?void 0:D[x]:void 0})})),("custom_link"===(null==_?void 0:_.value)||"static_link"===(null==_?void 0:_.value))&&e.jsx("div",Object.assign({style:{marginBottom:20}},{children:e.jsx(n,{state:K||T?"disabled":"none",errorMessage:S?H?v(H)?"":"Enter valid URL":"Required field":"",value:H,prefixText:"https://",placeholder:"Enter custom URL here",onChangeText:z,maxCharLimit:2e3})}))]}):e.jsx(g,{index:x,variable:{variableName:null!==(w=y.text)&&void 0!==w?w:"",updatedValue:"((customPlaceholderName))"===y.buttonVariable?`${null===(C=y.example)||void 0===C?void 0:C[0]}`:null!==(I=y.buttonVariable)&&void 0!==I?I:"",type:"link",isEditableVariable:!0,index:null!==(E=y.index)&&void 0!==E?E:0,queryParams:null!==(P=y.queryParams)&&void 0!==P?P:[]},showVariableModal:!0,componentType:"BUTTONS",buttonType:y.type,CTAoptions:U})};export{O as default};
@@ -1,2 +1,3 @@
1
1
  export declare const BACKGROUND_PREVIEW_IMAGE = "https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f";
2
2
  export declare const STATIC_URL_VARIABLE_NAME = "((staticPlaceholderName))";
3
+ export declare const UNSUBSCRIBE_URL_VARIABLE = "{{unsubscribeUrl}}";
@@ -1 +1 @@
1
- const e="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f",a="((staticPlaceholderName))";export{e as BACKGROUND_PREVIEW_IMAGE,a as STATIC_URL_VARIABLE_NAME};
1
+ const e="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f",a="((staticPlaceholderName))",b="{{unsubscribeUrl}}";export{e as BACKGROUND_PREVIEW_IMAGE,a as STATIC_URL_VARIABLE_NAME,b as UNSUBSCRIBE_URL_VARIABLE};
@@ -60,6 +60,11 @@ export declare const STATIC_URL_CTA_OPTION: {
60
60
  value: string;
61
61
  placeHolder: string;
62
62
  };
63
+ export declare const UNSUBSCRIBE_URL_OPTION: {
64
+ label: string;
65
+ value: string;
66
+ placeHolder: string;
67
+ };
63
68
  export type GlobalPlaceholderType = {
64
69
  MARKETING: {
65
70
  customer: baseAPITemplateVariableType[];
@@ -1 +1 @@
1
- var E,D,N,I;!function(E){E.SEND_GRID="sendgrid",E.BEE="bee"}(E||(E={})),function(E){E.APPROVED="APPROVED",E.DISABLED="DISABLED",E.FLAGGED="FLAGGED",E.PENDING="PENDING",E.DRAFT="DRAFT",E.REJECTED="REJECTED",E.PENDING_DELETION="PENDING_DELETION",E.IN_REVIEW="IN REVIEW",E.PAUSED="PAUSED",E.ACTIVE="ACTIVE",E.LIBRARY="LIBRARY"}(D||(D={})),function(E){E.NONE="NONE",E.TEXT="TEXT",E.IMAGE="IMAGE",E.VIDEO="VIDEO",E.DOCUMENT="DOCUMENT"}(N||(N={})),function(E){E.NONE="NONE",E.CTA_BTN="CTA_BTN",E.QUICK_REPLY="QUICK_REPLY"}(I||(I={}));const A={value:"custom_link",label:"Custom URL",placeHolder:"custom placeholder"},T={label:"Custom URL (No tracking)",value:"static_link",placeHolder:"{{staticUrl}}"};export{I as ACTIONS_TYPES,A as CUSTOM_URL_NAME,N as HEADER_TYPES,T as STATIC_URL_CTA_OPTION,E as TEMPLATE_EDITOR,D as TEMPLATE_STATUS};
1
+ var E,D,N,I;!function(E){E.SEND_GRID="sendgrid",E.BEE="bee"}(E||(E={})),function(E){E.APPROVED="APPROVED",E.DISABLED="DISABLED",E.FLAGGED="FLAGGED",E.PENDING="PENDING",E.DRAFT="DRAFT",E.REJECTED="REJECTED",E.PENDING_DELETION="PENDING_DELETION",E.IN_REVIEW="IN REVIEW",E.PAUSED="PAUSED",E.ACTIVE="ACTIVE",E.LIBRARY="LIBRARY"}(D||(D={})),function(E){E.NONE="NONE",E.TEXT="TEXT",E.IMAGE="IMAGE",E.VIDEO="VIDEO",E.DOCUMENT="DOCUMENT"}(N||(N={})),function(E){E.NONE="NONE",E.CTA_BTN="CTA_BTN",E.QUICK_REPLY="QUICK_REPLY"}(I||(I={}));const l={value:"custom_link",label:"Custom URL",placeHolder:"custom placeholder"},e={label:"Custom URL (No tracking)",value:"static_link",placeHolder:"{{staticUrl}}"},A={label:"Unsubscribe URL",value:"{{unsubscribeUrl}}",placeHolder:"{{unsubscribeUrl}}"};export{I as ACTIONS_TYPES,l as CUSTOM_URL_NAME,N as HEADER_TYPES,e as STATIC_URL_CTA_OPTION,E as TEMPLATE_EDITOR,D as TEMPLATE_STATUS,A as UNSUBSCRIBE_URL_OPTION};
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- export{AmplitudeEvent}from"./amplitude/index.js";import*as o from"./components/template-preview/constants/regexPatterns.js";export{o as regexPatterns};export{default as StringUtils}from"./utils/StringUtils.js";export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{ComponentZindex}from"./constants/zindex.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{PureSpinner,Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";export{TemplatePreview}from"./components/template-preview/TemplatePreview.js";export{WhatsappLikePreview}from"./components/template-preview/WhatsApp/WhatsAppLikePreview.js";export{WhatsappLikePreviewV2}from"./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js";export{renderVariableUIForPreview}from"./components/template-preview/helpers/SmsTemplateHelper.js";export{WhatsAppFormatToHTML}from"./components/template-preview/helpers/WhatsAppFormatToHTML.js";export{VariableEditorHelper}from"./components/template-preview/helpers/VariableEditorHelper.js";export{ACTIONS_TYPES,CUSTOM_URL_NAME,HEADER_TYPES,STATIC_URL_CTA_OPTION,TEMPLATE_EDITOR,TEMPLATE_STATUS}from"./components/template-preview/models/TemplateMeta.js";export{BUTTON_TYPE,POD,TEMPLATE_QUALITY}from"./components/template-preview/models/WhatsAppTemplate.js";export{CHANNEL_TYPE}from"./components/template-preview/models/Channels.js";export{TemplateContextMapper}from"./components/template-context-mapper/TemplateContextMapper.js";export{getAllDataFromTemplateComponent,getAllDataFromWebpushTemplateComponent}from"./components/template-context-mapper/utils/getDataFromTemplateComponent.js";export{isVariable,validateIsUrl}from"./components/template-context-mapper/utils/validateIsUrl.js";import"./_virtual/_tslib.js";export{TemplateAnalyticsSkeleton}from"./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js";export{AnalyticsItem,RightPanelTemplateAnalytics,TemplateAnalyticsComponent}from"./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown,TooltipStyled}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{AiBodyCaption,AiBodyTiny,BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodyRegular,BodySecondary,BodySecondaryLink,BodySmall,BodyTiny,ButtonLarge,ButtonLargeAI,ButtonRegular,ButtonRegularAI,Caption,CaptionBold,Display,SmallRegular,SubHeading,TextPlaceholder,Tiny,TitleFour,TitleLarge,TitleMedium,TitleRegular,TitleSmall,TitleXlarge}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";import"./node_modules/react/jsx-runtime.js";export{ProgressBarType,ProgressBarV2,TextAlignment}from"./components/progress-bar-v2/ProgressBarV2.js";export{QueryBuilder}from"./components/QueryBuilder/QueryBuilder.js";export{BaseQueryBuilderNode}from"./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";export{PropertyNode,PropertyNodeHeadless}from"./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js";export{queryBuilderSlice}from"./components/QueryBuilder/redux/queryBuilder.reducer.js";export{queryBuilderCacheSlice}from"./components/QueryBuilder/redux/queryBuilderCache.reducer.js";export{AD_STRING_OPERATORS,ANY_AD_OPERATORS,ANY_IG_OPERATORS,BOOLEAN_OPERATORS,DATE_OPERATORS,EVENT_VALUES,EXACTLY_OPERATORS,FREQUENCY_OPERATORS,ICE_BREAKER_OPERATORS,IG_STRING_OPERATORS,INTEGER_OPERATORS,MAIL_SUBJECT_OPERATORS,REACTION_OPERATORS,SPECIFIC_IG_OPERATORS,STRING_OPERATORS,STRING_RESTRICTED_OPERATORS,STRING_RESTRICTED_OPERATORS_2,STRING_RESTRICTED_OPERATORS_3}from"./components/QueryBuilder/types/QueryBuilderOperator.type.js";export{StyledModal}from"./components/modals/styledModal.js";export{DropdownPopover}from"./components/dropdown/DropdownPopover/index.js";export{Dropdown}from"./components/dropdown/Dropdown.js";export{ChipDropdown,ChipDropdownContainer}from"./components/dropdown/ChipDropdown.js";export{OpenedDropdown}from"./components/dropdown/OpenedDropdown/components/OpennedDropdown.js";export{MenuItemDropdown}from"./components/dropdown/MenuItem/MenuItem.js";export{AnalyticsCard}from"./components/analytics-card/AnalyticsCard.js";export{AnalyticsContainer,CardDataContainer}from"./components/analytics-card/AnalyticsCard.styled.js";export{Input}from"./components/input/Input.js";export{AnalyticsChip}from"./components/analytics-chips-and-dropdowns/AnalyticsChip.js";export{AnalyticsDropdown,EachItem,formatDate}from"./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js";export{AnalyticsMultiChip}from"./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js";export{AnalyticsMetric}from"./components/analytics-chips-and-dropdowns/AnalyticsMetric.js";export{AnalyticsTrend}from"./components/analytics-chips-and-dropdowns/AnalyticsTrend.js";export{LineChart}from"./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";export{LinearChipGroupedChart}from"./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js";export{Card,PieChartAnalytics}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";export{PieChart}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js";export{HorizontalGraph}from"./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";export{StackedBarChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";export{StackedBarDistributionChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js";export{GRAPH_ORIENTATION}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js";export{VerticalGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";export{FunnelVerticalBarGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js";export{HEAT,HEAT_COLORS,HEAT_GRADING_TYPE,HeatMap}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";export{HeatBoxStyled,HeatMapVertical}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js";export{VerticalBarAndLinearGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";export{TruncateValue,calculatePercentage,roundNumber,truncateValueForIndianStore,truncateValueForInternationalStore,truncateValueTo10K,truncateValueToA,truncateValueToB,truncateValueToC,truncateValueToK,truncateValueToL,truncateValueToM,truncateValueToT}from"./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js";export{AVATAR_SIZE_VS_ICON_SIZE_MAP,Avatar,BACKGROUND_VS_TEXT_COLOR_MAP,MESSAGE_CHANNELS}from"./components/avatar/Avatar.js";export{AVATAR_BACKGROUND,AVATAR_SIZE_MAP,AVATAR_TYPES,SIZE}from"./components/avatar/AvatarHelper.js";export{Alert}from"./components/alerts/Alert.js";export{ALERT_TYPES,COLOR_CONFIG_MAP,CONTENT_POSITION}from"./components/alerts/AlertHelper.js";export{RATIO,Thumbnail}from"./components/thumbnail/Thumbnail.js";export{Curtain}from"./components/curtain/Curtain.js";export{DatePicker}from"./components/datePicker/DatePicker.js";export{DatePickerWrapper}from"./components/datePicker/DatePickerWrapper.js";export{Loader,Switch,SwitchContainer,Thumb}from"./components/switch/Switch.js";export{SubscriptionPlan}from"./components/plans/SubscriptionPlan.js";export{BottomWrapper,HeaderWrapper,SubscriptionPlanSelector,defaultTabs}from"./components/plans/SubscriptionPlanSelector.js";export{NewSubscriptionPlan}from"./components/plans/NewSubscriptionPlan.js";export{SubscriptionPlansCollected}from"./components/plans/SubscriptionPlansCollected.js";export{TabItemComponent,Tabs}from"./components/tabs/Tabs.js";export{DynamicTabs}from"./components/dynamic-tabs/DynamicTabs.js";export{BikShimmer}from"./components/shimmer/ShimmerComponent/BikShimmer.js";export{TablePagination}from"./components/TablePagination/TablePagination.js";export{TablePaginationCard,TablePaginationCardStyled}from"./components/TablePagination/TablePaginationCard.js";export{StateModalComponent}from"./components/states-modal/StateModalComponent.js";export{DeleteConfirmationModal}from"./components/states-modal/DeleteConfirmationModal.js";export{ButtonActions,ButtonTypes,StateComponent,StateInterface}from"./components/states/StateComponent.js";export{ShopifyScopeWrapper}from"./components/states/ShopifyScopeWrapper.js";export{WhatsAppTextEditor}from"./components/WhatsAppTextEditor/WhatsAppTextEditor.js";export{CustomRightBorder,EditorActionTypes,WhatsAppTextEditorHeader}from"./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js";export{BaseWhatsappContentLangHelper}from"./helpers/BaseWhatsappContentLang.helper.js";export{CURTAIN_COLOR_CONFIG_MAP,CURTAIN_MODE,CURTAIN_TYPES}from"./components/curtain/CurtainHelper.js";export{resizeImage}from"./utils/resizeImage.js";export{PickerType}from"./components/variable-picker-v3/model.js";export{CardSelectionModal}from"./components/card-selection-modal/CardSelectionModal.js";export{BikImageCropper}from"./components/image-cropper/BikImageCropper.js";export{BikImagePipeline}from"./components/image-cropper/BikImagePipeline/BikImagePipeline.js";export{ButtonGroup}from"./components/buttonGroup/ButtonGroup.js";export{BikAccordion}from"./components/accordion/Accordion.js";export{FileUploader}from"./components/file-uploader/FileUploader.js";export{ColourInput}from"./components/colourInput/ColourInput.js";export{CodeBlock}from"./components/code-block/CodeBlock.js";export{CodeLanguage}from"./components/code-block/types.js";export{format}from"./components/code-block/languageSpecificFormatting/html.js";export{colorMap,colorOverWrite}from"./components/code-block/languageSpecificFormatting/javascript.js";export{BikHeader}from"./components/bik-layout/BikHeader.js";export{BikLayout}from"./components/bik-layout/BikLayout.js";export{BikProfile}from"./components/bik-layout/BikProfile.js";export{SimpleSidebar}from"./components/bik-layout/SimpleSidebar.js";export{BikSidebar}from"./components/bik-layout/BikSidebar.js";export{FeatureModal}from"./components/bik-layout/FeatureModal.js";export{SidebarSkeleton}from"./components/bik-layout/SidebarSkeleton.js";export{ShowShopifyRestrictedModal}from"./components/bik-layout/ShowShopifyRestrictedModal.js";export{FeatureModalV2}from"./components/bik-layout/FeatureModalV2.js";export{SearchBar}from"./components/searchBar/searchBar.js";export{CustomDateTime}from"./components/custom-date-time/CustomDateTime.js";export{PricePleaseProductPicker,ProductPickerContent}from"./components/product-picker/ProductPickerModal.js";export{DiscountModal}from"./components/discount-modal/DiscountModal.js";export{CouponExpiration}from"./components/discount-modal/CouponExpiration/CouponExpiration.js";export{COUPON_EXPIRATION,DISCOUNT_APPLIES_TO,DISCOUNT_TARGET_SELECTION,DISCOUNT_TARGET_TYPES,DISCOUNT_TYPES,DISCOUNT_VALUE_TYPES,MIN_PURCHASE_REQUIREMENT,OFFER_APPLIES_TO,initialDynamicCouponErrorState,initialStaticCouponErrorState}from"./components/discount-modal/type.js";export{CountryCodePicker}from"./components/country-code-picker/CountryCodePicker.js";export{CountriesData}from"./components/country-code-picker/CountryCodePicker.modal.js";export{DEFAULT_IMAGE,ShimmerImage}from"./components/shimmer-image/ShimmerImage.js";export{ProductPickerModal}from"./components/product-picker-v2/modal.js";export{ScreenName}from"./components/product-picker-v2/type.js";export{Carousel}from"./components/carousel/carousel.js";export{CarouselSecondary}from"./components/carousel-secondary/CarouselSecondary.js";export{AccessTokenTroubleshootDialog}from"./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js";export{RadioList}from"./components/radioList/RadioList.js";export{CheckList}from"./components/checkList/CheckList.js";export{DateKeys,MEDIA_TYPES,PostPicker,dateOptions}from"./components/postPicker/postPicker.js";export{DropdownButton}from"./components/dropdown-button/DropdownButton.js";export{SideModal}from"./components/side-modal/SideModal.js";export{KeywordsInput}from"./components/keywords-input/KeywordsInput.js";export{AddVariableV2SideModal}from"./components/add-variableV2/AddVariableV2SideModal.js";export{AddVariableV2}from"./components/add-variableV2/AddVariableV2.js";export{NaLinkWrapper,NavigationHyperlink}from"./components/navigation-hyperlink/NavigationHyperlink.js";export{SearchFilter}from"./components/SearchFilter/index.js";export{InputWithVariables}from"./components/input-with-vars/InputWithVariables.js";export{DashboardReviewPopUp}from"./components/dashboard-review-popup/DashboardReviewPopUp.js";export{StarRating}from"./components/star-rating/StarRating.js";export{TestimonialCard}from"./components/testimonial-card/TestimonialCard.js";export{BikSlider}from"./components/slider/slider.js";export{ResizableImage}from"./components/resizeImage/index.js";export{validateURL}from"./utils/validator.js";export{CarouselPreview}from"./components/carousel-preview/CarouselPreview.js";export{Floater}from"./components/floater/floater.js";export{CardSelector}from"./components/card-selector/CardSelector.js";export{CardSelectorGroup}from"./components/card-selector/CardSelectorGroup.js";export{VariablePicker}from"./components/variable-picker-v3/VariablePicker.js";export{ActionButtons}from"./components/action-button/ActionButtons.js";export{ActivateBikAi}from"./components/ai-modals/ActivateBikAI.js";export{AiSyncProgress}from"./components/ai-modals/AiSyncProgress.js";export{AiCreditsExhausted}from"./components/ai-modals/AiCreditsExhausted.js";export{AiCreditsLow}from"./components/ai-modals/AiCreditsLow.js";export{CustomPortal}from"./components/input-with-vars/customPortal.js";export{FloatingInputDropdown}from"./components/floating-input-dropdown/FloatingInputDropdown.js";export{MultilevelDropdownPopover}from"./components/dropdown/MultilevelDropdownPopover/index.js";export{DropShadow}from"./components/dropShadow/DropShadow.js";export{MultiLevelDropdown}from"./components/multi-level-dropdown/MultiLevelDropdown.js";export{DataSourcePanel}from"./components/data-source-panel/DataSourcePanel.js";export{UnsatisfactoryResponseList}from"./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js";export{UnsatisfactoryCountIntentWiseModal}from"./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js";export{CustomDataCategories,CustomDataType}from"./components/data-source-panel/model.js";export{CarouselVersion}from"./components/carousel-secondary/model.js";
1
+ export{AmplitudeEvent}from"./amplitude/index.js";import*as o from"./components/template-preview/constants/regexPatterns.js";export{o as regexPatterns};export{default as StringUtils}from"./utils/StringUtils.js";export{BASE_COLORS,COLORS,DEFAULT_THEME,FONTS}from"./constants/Theme.js";export{ComponentZindex}from"./constants/zindex.js";export{CheckBox}from"./components/checkBox/CheckBox.js";export{ListItem}from"./components/list-item/ListItem.js";export{Pagination}from"./components/pagination/Pagination.js";export{RadioButton}from"./components/radioButton/RadioButton.js";export{Toaster}from"./components/toaster/Toaster.js";export{Tooltip}from"./components/tooltips/Tooltip.js";export{PureSpinner,Spinner}from"./components/spinner/Spinner.js";export{Stepper}from"./components/stepper/Stepper.js";export{Tag}from"./components/tag/Tag.js";export{IconButton}from"./components/icon-button/IconButton.js";export{TemplatePreview}from"./components/template-preview/TemplatePreview.js";export{WhatsappLikePreview}from"./components/template-preview/WhatsApp/WhatsAppLikePreview.js";export{WhatsappLikePreviewV2}from"./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js";export{renderVariableUIForPreview}from"./components/template-preview/helpers/SmsTemplateHelper.js";export{WhatsAppFormatToHTML}from"./components/template-preview/helpers/WhatsAppFormatToHTML.js";export{VariableEditorHelper}from"./components/template-preview/helpers/VariableEditorHelper.js";export{ACTIONS_TYPES,CUSTOM_URL_NAME,HEADER_TYPES,STATIC_URL_CTA_OPTION,TEMPLATE_EDITOR,TEMPLATE_STATUS,UNSUBSCRIBE_URL_OPTION}from"./components/template-preview/models/TemplateMeta.js";export{BUTTON_TYPE,POD,TEMPLATE_QUALITY}from"./components/template-preview/models/WhatsAppTemplate.js";export{CHANNEL_TYPE}from"./components/template-preview/models/Channels.js";export{TemplateContextMapper}from"./components/template-context-mapper/TemplateContextMapper.js";export{getAllDataFromTemplateComponent,getAllDataFromWebpushTemplateComponent}from"./components/template-context-mapper/utils/getDataFromTemplateComponent.js";export{isVariable,validateIsUrl}from"./components/template-context-mapper/utils/validateIsUrl.js";import"./_virtual/_tslib.js";export{TemplateAnalyticsSkeleton}from"./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js";export{AnalyticsItem,RightPanelTemplateAnalytics,TemplateAnalyticsComponent}from"./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js";export{FABMenu}from"./components/fab-menu/FABMenu.js";export{FloatingActionButton}from"./components/floating-action-button/FloatingActionButton.js";export{DROP_POSITION,DropdownToggleContainer,FAB_POSITION,FloatingActionButtonContainer,FloatingActionButtonOuterContainer,MENU_ALIGNMENT,StyledDropdown,TooltipStyled}from"./components/floating-action-button/FloatingActionButton.styles.js";export{ImageService}from"./components/image-compress/ImageCompress.js";export{AiBodyCaption,AiBodyTiny,BodyCaption,BodyLarge,BodyPrimary,BodyPrimaryLink,BodyRegular,BodySecondary,BodySecondaryLink,BodySmall,BodyTiny,ButtonLarge,ButtonLargeAI,ButtonRegular,ButtonRegularAI,Caption,CaptionBold,Display,SmallRegular,SubHeading,TextPlaceholder,Tiny,TitleFour,TitleLarge,TitleMedium,TitleRegular,TitleSmall,TitleXlarge}from"./components/TypographyStyle.js";export{Button}from"./components/button/Button.js";export{ProgressBarComponent,ProgressCompletedBar}from"./components/progress-bar/ProgressBarComponent.js";import"./node_modules/react/jsx-runtime.js";export{ProgressBarType,ProgressBarV2,TextAlignment}from"./components/progress-bar-v2/ProgressBarV2.js";export{QueryBuilder}from"./components/QueryBuilder/QueryBuilder.js";export{BaseQueryBuilderNode}from"./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";export{PropertyNode,PropertyNodeHeadless}from"./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js";export{queryBuilderSlice}from"./components/QueryBuilder/redux/queryBuilder.reducer.js";export{queryBuilderCacheSlice}from"./components/QueryBuilder/redux/queryBuilderCache.reducer.js";export{AD_STRING_OPERATORS,ANY_AD_OPERATORS,ANY_IG_OPERATORS,BOOLEAN_OPERATORS,DATE_OPERATORS,EVENT_VALUES,EXACTLY_OPERATORS,FREQUENCY_OPERATORS,ICE_BREAKER_OPERATORS,IG_STRING_OPERATORS,INTEGER_OPERATORS,MAIL_SUBJECT_OPERATORS,REACTION_OPERATORS,SPECIFIC_IG_OPERATORS,STRING_OPERATORS,STRING_RESTRICTED_OPERATORS,STRING_RESTRICTED_OPERATORS_2,STRING_RESTRICTED_OPERATORS_3}from"./components/QueryBuilder/types/QueryBuilderOperator.type.js";export{StyledModal}from"./components/modals/styledModal.js";export{DropdownPopover}from"./components/dropdown/DropdownPopover/index.js";export{Dropdown}from"./components/dropdown/Dropdown.js";export{ChipDropdown,ChipDropdownContainer}from"./components/dropdown/ChipDropdown.js";export{OpenedDropdown}from"./components/dropdown/OpenedDropdown/components/OpennedDropdown.js";export{MenuItemDropdown}from"./components/dropdown/MenuItem/MenuItem.js";export{AnalyticsCard}from"./components/analytics-card/AnalyticsCard.js";export{AnalyticsContainer,CardDataContainer}from"./components/analytics-card/AnalyticsCard.styled.js";export{Input}from"./components/input/Input.js";export{AnalyticsChip}from"./components/analytics-chips-and-dropdowns/AnalyticsChip.js";export{AnalyticsDropdown,EachItem,formatDate}from"./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js";export{AnalyticsMultiChip}from"./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js";export{AnalyticsMetric}from"./components/analytics-chips-and-dropdowns/AnalyticsMetric.js";export{AnalyticsTrend}from"./components/analytics-chips-and-dropdowns/AnalyticsTrend.js";export{LineChart}from"./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js";export{LinearChipGroupedChart}from"./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js";export{Card,PieChartAnalytics}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js";export{PieChart}from"./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js";export{HorizontalGraph}from"./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js";export{StackedBarChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js";export{StackedBarDistributionChart}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js";export{GRAPH_ORIENTATION}from"./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js";export{VerticalGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js";export{FunnelVerticalBarGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js";export{HEAT,HEAT_COLORS,HEAT_GRADING_TYPE,HeatMap}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js";export{HeatBoxStyled,HeatMapVertical}from"./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js";export{VerticalBarAndLinearGraph}from"./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";export{TruncateValue,calculatePercentage,roundNumber,truncateValueForIndianStore,truncateValueForInternationalStore,truncateValueTo10K,truncateValueToA,truncateValueToB,truncateValueToC,truncateValueToK,truncateValueToL,truncateValueToM,truncateValueToT}from"./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js";export{AVATAR_SIZE_VS_ICON_SIZE_MAP,Avatar,BACKGROUND_VS_TEXT_COLOR_MAP,MESSAGE_CHANNELS}from"./components/avatar/Avatar.js";export{AVATAR_BACKGROUND,AVATAR_SIZE_MAP,AVATAR_TYPES,SIZE}from"./components/avatar/AvatarHelper.js";export{Alert}from"./components/alerts/Alert.js";export{ALERT_TYPES,COLOR_CONFIG_MAP,CONTENT_POSITION}from"./components/alerts/AlertHelper.js";export{RATIO,Thumbnail}from"./components/thumbnail/Thumbnail.js";export{Curtain}from"./components/curtain/Curtain.js";export{DatePicker}from"./components/datePicker/DatePicker.js";export{DatePickerWrapper}from"./components/datePicker/DatePickerWrapper.js";export{Loader,Switch,SwitchContainer,Thumb}from"./components/switch/Switch.js";export{SubscriptionPlan}from"./components/plans/SubscriptionPlan.js";export{BottomWrapper,HeaderWrapper,SubscriptionPlanSelector,defaultTabs}from"./components/plans/SubscriptionPlanSelector.js";export{NewSubscriptionPlan}from"./components/plans/NewSubscriptionPlan.js";export{SubscriptionPlansCollected}from"./components/plans/SubscriptionPlansCollected.js";export{TabItemComponent,Tabs}from"./components/tabs/Tabs.js";export{DynamicTabs}from"./components/dynamic-tabs/DynamicTabs.js";export{BikShimmer}from"./components/shimmer/ShimmerComponent/BikShimmer.js";export{TablePagination}from"./components/TablePagination/TablePagination.js";export{TablePaginationCard,TablePaginationCardStyled}from"./components/TablePagination/TablePaginationCard.js";export{StateModalComponent}from"./components/states-modal/StateModalComponent.js";export{DeleteConfirmationModal}from"./components/states-modal/DeleteConfirmationModal.js";export{ButtonActions,ButtonTypes,StateComponent,StateInterface}from"./components/states/StateComponent.js";export{ShopifyScopeWrapper}from"./components/states/ShopifyScopeWrapper.js";export{WhatsAppTextEditor}from"./components/WhatsAppTextEditor/WhatsAppTextEditor.js";export{CustomRightBorder,EditorActionTypes,WhatsAppTextEditorHeader}from"./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js";export{BaseWhatsappContentLangHelper}from"./helpers/BaseWhatsappContentLang.helper.js";export{CURTAIN_COLOR_CONFIG_MAP,CURTAIN_MODE,CURTAIN_TYPES}from"./components/curtain/CurtainHelper.js";export{resizeImage}from"./utils/resizeImage.js";export{PickerType}from"./components/variable-picker-v3/model.js";export{CardSelectionModal}from"./components/card-selection-modal/CardSelectionModal.js";export{BikImageCropper}from"./components/image-cropper/BikImageCropper.js";export{BikImagePipeline}from"./components/image-cropper/BikImagePipeline/BikImagePipeline.js";export{ButtonGroup}from"./components/buttonGroup/ButtonGroup.js";export{BikAccordion}from"./components/accordion/Accordion.js";export{FileUploader}from"./components/file-uploader/FileUploader.js";export{ColourInput}from"./components/colourInput/ColourInput.js";export{CodeBlock}from"./components/code-block/CodeBlock.js";export{CodeLanguage}from"./components/code-block/types.js";export{format}from"./components/code-block/languageSpecificFormatting/html.js";export{colorMap,colorOverWrite}from"./components/code-block/languageSpecificFormatting/javascript.js";export{BikHeader}from"./components/bik-layout/BikHeader.js";export{BikLayout}from"./components/bik-layout/BikLayout.js";export{BikProfile}from"./components/bik-layout/BikProfile.js";export{SimpleSidebar}from"./components/bik-layout/SimpleSidebar.js";export{BikSidebar}from"./components/bik-layout/BikSidebar.js";export{FeatureModal}from"./components/bik-layout/FeatureModal.js";export{SidebarSkeleton}from"./components/bik-layout/SidebarSkeleton.js";export{ShowShopifyRestrictedModal}from"./components/bik-layout/ShowShopifyRestrictedModal.js";export{FeatureModalV2}from"./components/bik-layout/FeatureModalV2.js";export{SearchBar}from"./components/searchBar/searchBar.js";export{CustomDateTime}from"./components/custom-date-time/CustomDateTime.js";export{PricePleaseProductPicker,ProductPickerContent}from"./components/product-picker/ProductPickerModal.js";export{DiscountModal}from"./components/discount-modal/DiscountModal.js";export{CouponExpiration}from"./components/discount-modal/CouponExpiration/CouponExpiration.js";export{COUPON_EXPIRATION,DISCOUNT_APPLIES_TO,DISCOUNT_TARGET_SELECTION,DISCOUNT_TARGET_TYPES,DISCOUNT_TYPES,DISCOUNT_VALUE_TYPES,MIN_PURCHASE_REQUIREMENT,OFFER_APPLIES_TO,initialDynamicCouponErrorState,initialStaticCouponErrorState}from"./components/discount-modal/type.js";export{CountryCodePicker}from"./components/country-code-picker/CountryCodePicker.js";export{CountriesData}from"./components/country-code-picker/CountryCodePicker.modal.js";export{DEFAULT_IMAGE,ShimmerImage}from"./components/shimmer-image/ShimmerImage.js";export{ProductPickerModal}from"./components/product-picker-v2/modal.js";export{ScreenName}from"./components/product-picker-v2/type.js";export{Carousel}from"./components/carousel/carousel.js";export{CarouselSecondary}from"./components/carousel-secondary/CarouselSecondary.js";export{AccessTokenTroubleshootDialog}from"./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js";export{RadioList}from"./components/radioList/RadioList.js";export{CheckList}from"./components/checkList/CheckList.js";export{DateKeys,MEDIA_TYPES,PostPicker,dateOptions}from"./components/postPicker/postPicker.js";export{DropdownButton}from"./components/dropdown-button/DropdownButton.js";export{SideModal}from"./components/side-modal/SideModal.js";export{KeywordsInput}from"./components/keywords-input/KeywordsInput.js";export{AddVariableV2SideModal}from"./components/add-variableV2/AddVariableV2SideModal.js";export{AddVariableV2}from"./components/add-variableV2/AddVariableV2.js";export{NaLinkWrapper,NavigationHyperlink}from"./components/navigation-hyperlink/NavigationHyperlink.js";export{SearchFilter}from"./components/SearchFilter/index.js";export{InputWithVariables}from"./components/input-with-vars/InputWithVariables.js";export{DashboardReviewPopUp}from"./components/dashboard-review-popup/DashboardReviewPopUp.js";export{StarRating}from"./components/star-rating/StarRating.js";export{TestimonialCard}from"./components/testimonial-card/TestimonialCard.js";export{BikSlider}from"./components/slider/slider.js";export{ResizableImage}from"./components/resizeImage/index.js";export{validateURL}from"./utils/validator.js";export{CarouselPreview}from"./components/carousel-preview/CarouselPreview.js";export{Floater}from"./components/floater/floater.js";export{CardSelector}from"./components/card-selector/CardSelector.js";export{CardSelectorGroup}from"./components/card-selector/CardSelectorGroup.js";export{VariablePicker}from"./components/variable-picker-v3/VariablePicker.js";export{ActionButtons}from"./components/action-button/ActionButtons.js";export{ActivateBikAi}from"./components/ai-modals/ActivateBikAI.js";export{AiSyncProgress}from"./components/ai-modals/AiSyncProgress.js";export{AiCreditsExhausted}from"./components/ai-modals/AiCreditsExhausted.js";export{AiCreditsLow}from"./components/ai-modals/AiCreditsLow.js";export{CustomPortal}from"./components/input-with-vars/customPortal.js";export{FloatingInputDropdown}from"./components/floating-input-dropdown/FloatingInputDropdown.js";export{MultilevelDropdownPopover}from"./components/dropdown/MultilevelDropdownPopover/index.js";export{DropShadow}from"./components/dropShadow/DropShadow.js";export{MultiLevelDropdown}from"./components/multi-level-dropdown/MultiLevelDropdown.js";export{DataSourcePanel}from"./components/data-source-panel/DataSourcePanel.js";export{UnsatisfactoryResponseList}from"./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js";export{UnsatisfactoryCountIntentWiseModal}from"./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js";export{CustomDataCategories,CustomDataType}from"./components/data-source-panel/model.js";export{CarouselVersion}from"./components/carousel-secondary/model.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.697-5",
3
+ "version": "0.0.698-beta.01",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",