@bikdotai/bik-component-library 0.0.628-beta.0 → 0.0.628-beta.10

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.
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare const Funnel: React.FC<{
3
+ labels: string[];
4
+ funnelData: number[];
5
+ funnelBackgroundColor?: string[];
6
+ }>;
7
+ export default Funnel;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js"),l=require("react"),r=require("react-chartjs-2"),n=require("../../../TypographyStyle.js"),i=require("../../../../constants/Theme.js"),o=require("../utils/calcPercentage.js"),a=require("./LineChart.styled.js");t.Chart.register(t.CategoryScale,t.LinearScale,t.PointElement,t.BarElement,t.LineElement,t.ArcElement,t.Filler,t.Title,t.Tooltip,t.Legend);exports.LineChart=t=>{let{scaleText:s,labels:d,canvasHeight:c,datas:u,maintainAspectRatio:g=!1,stepSize:p,min:y,max:b,isZeroState:v,tension:C,isNewStyles:O,prefixCurrencyInYAxis:h,pointRadius:x,useKFormat:j,lineThickness:m,ticksLabelCallback:L,labelCallback:S,afterBodyCallBack:f,titleTooltipCallback:k}=t;var R,q,B;const[w,T]=l.useState(null),E=l.useRef();l.useEffect((()=>{var e,t,l,r;if(null===(r=null===(l=null===(t=null===(e=E.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===r?void 0:r.length){const e=38*E.current.scales.y.ticks.length;T(e)}}),[E]);const F=u.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?i.COLORS.content.placeholder:i.COLORS.background.brand,square:e.squareLegends}))),z={labels:d,datasets:u.map(((e,t)=>{var l,r,n;return Object.assign(Object.assign({tension:null!=C?C:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)};return O?Object.assign({pointStyle:"circle",pointRadius:x||(d&&d.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)},l):Object.assign({pointRadius:null!=x?x:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(r=null!==(l=e.lineWidth)&&void 0!==l?l:m)&&void 0!==r?r:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,w?w-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(n=e.backgroundColor)&&void 0!==n?n:"transparent",legend:e.legend})}))},$={maintainAspectRatio:g,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=O&&O,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>i.COLORS.content.primaryInverse,backgroundColor:i.COLORS.content.primary,callbacks:{labelTextColor:()=>i.COLORS.content.primaryInverse,title:k,label:S,afterBody:f},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:v?0:y,max:v?10:b,ticks:{color:i.COLORS.content.secondary,callback:e=>{var t,l;return j?`${null!==(t=null==s?void 0:s.yPrefix)&&void 0!==t?t:""}${o.truncateValueToK(e)}${null!=h?h:""}`:`${null!==(l=null==s?void 0:s.yPrefix)&&void 0!==l?l:""}${e}${null!=h?h:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:v?1:p,padding:O?24:0},title:{display:!!(null==s?void 0:s.y),text:null==s?void 0:s.y},grid:{color:i.COLORS.background.base,drawBorder:null===(R=null==s?void 0:s.yDrawBorder)||void 0===R||R}},x:{ticks:{callback:L,color:i.COLORS.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==s?void 0:s.x),text:null==s?void 0:s.x},grid:{display:!1,drawBorder:null!==(q=null==s?void 0:s.xDrawBorder)&&void 0!==q&&q}}}};return e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},g?{}:{height:null!==(B=null!=c?c:w)&&void 0!==B?B:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e.jsx(a.LegendWrapper,{children:F.map(((t,l)=>{let{text:r,color:i,square:o}=t;return r?e.jsxs(a.LegendContainer,{children:[e.jsx(a.LegendColor,{color:i,square:o,newStyle:O}),e.jsx(n.BodyTiny,Object.assign({color:"#667085"},{children:r}))]},l):e.jsx(e.Fragment,{})}))}),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(r.Line,{ref:E,options:$,data:z})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js");require("../../../../node_modules/chart.js/auto/auto.js");var l=require("react"),r=require("react-chartjs-2"),n=require("../../../TypographyStyle.js"),i=require("../../../../constants/Theme.js"),o=require("../utils/calcPercentage.js"),a=require("./LineChart.styled.js");require("../../../../node_modules/chart.js/dist/chart.js").Chart.register(t.CategoryScale,t.LinearScale,t.PointElement,t.BarElement,t.LineElement,t.ArcElement,t.Filler,t.Title,t.Tooltip,t.Legend);exports.LineChart=t=>{let{scaleText:s,labels:d,canvasHeight:c,datas:u,maintainAspectRatio:g=!1,stepSize:p,min:y,max:b,isZeroState:v,tension:C,isNewStyles:h,prefixCurrencyInYAxis:O,pointRadius:x,useKFormat:j,lineThickness:m,ticksLabelCallback:L,labelCallback:S,afterBodyCallBack:f,titleTooltipCallback:k}=t;var R,q,B;const[w,T]=l.useState(null),E=l.useRef();l.useEffect((()=>{var e,t,l,r;if(null===(r=null===(l=null===(t=null===(e=E.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===r?void 0:r.length){const e=38*E.current.scales.y.ticks.length;T(e)}}),[E]);const F=u.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?i.COLORS.content.placeholder:i.COLORS.background.brand,square:e.squareLegends}))),z={labels:d,datasets:u.map(((e,t)=>{var l,r,n;return Object.assign(Object.assign({tension:null!=C?C:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)};return h?Object.assign({pointStyle:"circle",pointRadius:x||(d&&d.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)},l):Object.assign({pointRadius:null!=x?x:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(r=null!==(l=e.lineWidth)&&void 0!==l?l:m)&&void 0!==r?r:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,w?w-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(n=e.backgroundColor)&&void 0!==n?n:"transparent",legend:e.legend})}))},$={maintainAspectRatio:g,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=h&&h,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>i.COLORS.content.primaryInverse,backgroundColor:i.COLORS.content.primary,callbacks:{labelTextColor:()=>i.COLORS.content.primaryInverse,title:k,label:S,afterBody:f},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{type:"linear",beginAtZero:!0,min:v?0:y,max:v?10:b,ticks:{color:i.COLORS.content.secondary,callback:e=>{var t,l;return j?`${null!==(t=null==s?void 0:s.yPrefix)&&void 0!==t?t:""}${o.truncateValueToK(e)}${null!=O?O:""}`:`${null!==(l=null==s?void 0:s.yPrefix)&&void 0!==l?l:""}${e}${null!=O?O:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:v?1:p,padding:h?24:0},title:{display:!!(null==s?void 0:s.y),text:null==s?void 0:s.y},grid:{color:i.COLORS.background.base,drawBorder:null===(R=null==s?void 0:s.yDrawBorder)||void 0===R||R}},x:{type:"category",ticks:{callback:L,color:i.COLORS.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==s?void 0:s.x),text:null==s?void 0:s.x},grid:{display:!1,drawBorder:null!==(q=null==s?void 0:s.xDrawBorder)&&void 0!==q&&q}}}};return e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},g?{}:{height:null!==(B=null!=c?c:w)&&void 0!==B?B:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e.jsx(a.LegendWrapper,{children:F.map(((t,l)=>{let{text:r,color:i,square:o}=t;return r?e.jsxs(a.LegendContainer,{children:[e.jsx(a.LegendColor,{color:i,square:o,newStyle:h}),e.jsx(n.BodyTiny,Object.assign({color:"#667085"},{children:r}))]},l):e.jsx(e.Fragment,{})}))}),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(r.Line,{ref:E,options:$,data:z})}))]}))};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../curtain/CurtainHelper.js");var n=require("../../variable-picker-v3/model.js"),o=require("lodash"),t=require("react"),i=require("styled-components"),l=require("../../input/Input.js"),a=require("../../input-with-vars/InputWithVariables.js"),s=require("../../template-preview/models/TemplateMeta.js"),d=require("../../template-preview/models/WhatsAppTemplate.js"),r=require("../context/templateModalContext.js"),u=require("../utils/constants.js"),p=require("../utils/getDataFromTemplateComponent.js"),c=require("../utils/validateIsUrl.js"),v=require("../utils/validateName.js"),m=require("./BackTrackComponent.js"),b=require("./DiscountCodeComponent.js"),g=require("./EditMediaModal.js"),h=require("./EditMediaV2.js"),f=require("./EditMediaV2.style.js"),j=require("./useEditWhtasappTemplateMedia.js"),C=require("./VariableConnector.js"),x=require("./VariableConnectorsPanel.js"),T=require("./VariableConnectorWhatsApp.js"),O=require("./VariableEditorHeader.js"),E=require("./WhatsAppTemplateCardButtonV2.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const V=y(i).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");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/models/TemplateMeta.js"),d=require("../../template-preview/models/WhatsAppTemplate.js"),r=require("../context/templateModalContext.js"),u=require("../utils/constants.js"),p=require("../utils/getDataFromTemplateComponent.js"),c=require("../utils/validateIsUrl.js"),v=require("../utils/validateName.js"),m=require("./BackTrackComponent.js"),b=require("./DiscountCodeComponent.js"),g=require("./EditMediaModal.js"),h=require("./EditMediaV2.js"),f=require("./EditMediaV2.style.js"),j=require("./useEditWhtasappTemplateMedia.js"),C=require("./VariableConnector.js"),T=require("./VariableConnectorsPanel.js"),x=require("./VariableConnectorWhatsApp.js"),O=require("./VariableEditorHeader.js"),E=require("./WhatsAppTemplateCardButtonV2.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const V=y(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:y,onTemplateChange:B,whatsappSpecificPickerMeta:M,showVariableModal:k,variableListForImage:D,setDiscountCode:I,fileName:q,setFileName:R}=i;var P,L,A,U,w,N,_,H,S,F,Q,Y,W,K,$,G,X,z,J,Z,ee,ne,oe,te,ie,le,ae,se,de,re,ue,pe,ce,ve,me,be,ge,he,fe;const je=y.isCarouselType,{originalVariableList:Ce,pod:xe,extras:Te,selectedCarouselIndex:Oe,isProductCarouselType:Ee,disableCopyCode:ye,isError:Ve}=r.useTemplateModalContext(),{descriptionComponents:Be,urlBtns:Me,qrbBtns:ke,imageComponent:De,bodyVariables:Ie,headerVariables:qe}=p.getAllDataFromTemplateComponent(y),Re=t.useRef(null),[Pe,Le]=t.useState(!1),[Ae,Ue]=t.useState(-1===Oe?{descriptionComponents:Be,urlBtns:Me,qrbBtns:ke,imageComponent:De,bodyVariables:Ie,headerVariables:qe}:{}),{uploadMediaLink:we,uploadMediaFiles:Ne,validateMimeType:_e}=M,He=j.useEditWhatsappTemplateMedia({uploadMediaLink:we,uploadMediaFiles:Ne,updateTemplateImageUrl:function(e,n){var t,i,l,a,s,d,r,u;let p;p=null!=Oe&&Oe>-1?{components:null===(i=null===(t=y.components[1])||void 0===t?void 0:t.cards)||void 0===i?void 0:i[Oe].components,mapping:null===(a=null===(l=null==y?void 0:y.mapping)||void 0===l?void 0:l.cards)||void 0===a?void 0:a[Oe]}:Object.assign({},y);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 o=Object.assign(Object.assign({},p.components[c]),{format:n,example:{header_handle:[e]}}),t=[...p.components];t[c]=o,p=Object.assign(Object.assign({},p),{components:t})}p.mapping&&(p.mapping=Object.assign(Object.assign({},p.mapping),{header:void 0}));if(null!=Oe&&Oe>-1){const e=o.cloneDeep(y);e.components[1].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)),Fe(!0)}else null==B||B(Object.assign({},p))},validateMimeType:_e,mediaComponent:je?Ae.imageComponent:De,fileRef:Re}),[Se,Fe]=t.useState(!1),[Qe,Ye]=t.useState(q),[We,Ke]=t.useState();function $e(e,n,t){var i,l,a,s,d,r,u,p,c,v;console.log("val",e),console.log("mode",n),console.log("btnIndex",t);const m=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},y).components[1].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},y).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},y),b=o.cloneDeep(m),g="custom"===n&&"string"==typeof e,h=g?e:"string"!=typeof e?e.defaultValue?e.defaultValue:"https://d.bik.ai/":"https://d.bik.ai";if(null!=Oe&&Oe>-1&&Ee){const n=Object.assign({},y).components.map((e=>{var n;return"CAROUSEL"===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,o,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!==(o=null==l?void 0:l[t])&&void 0!==o?o:{};a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[h]});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}));console.log("old mapping",y.mapping);const i=null===(s=null===(a=Object.assign({},y).mapping)||void 0===a?void 0:a.cards)||void 0===s?void 0:s.map((n=>{var o;return Object.assign(Object.assign({},n),{buttons:null===(o=null==n?void 0:n.buttons)||void 0===o?void 0:o.map(((n,o)=>(console.log("button",n),console.log("ind",o),o===t?g?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"":n)))})}));console.log("new mapping",i);const l=o.cloneDeep(y);return l.components=n,l.mapping.cards=i,void(null==B||B(Object.assign({},l)))}const f=null==b?void 0:b.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==f&&f>-1){const o=null===(d=null==b?void 0:b.components[f].buttons)||void 0===d?void 0:d.filter((e=>"URL"===e.type));if((null==o?void 0:o.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=o[t];a=Object.assign(Object.assign({},a),{url:"https://d.bik.ai/{{1}}",example:[l]});const s=[...null!==(p=null===(u=null===(r=b.components)||void 0===r?void 0:r[f])||void 0===u?void 0:u.buttons)&&void 0!==p?p:[]].map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e)),d=Object.assign(Object.assign({},b.components[f]),{buttons:s}),v=null===(c=b.mapping)||void 0===c?void 0:c.buttons;v&&v.length>0&&(v[t]=i?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"");const m=Object.assign(Object.assign({},b.mapping),{buttons:v});b.mapping=m;const g=[...b.components];g[f]=d,b.components=g}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(v=e.placeHolder)||void 0===v?void 0:v.slice(2,-2))?Le(!0):(Le(!1),null==I||I(""))}if(null!=Oe&&Oe>-1){const e=o.cloneDeep(y);e.components[1].cards[Oe].components=b.components,e.mapping.cards[Oe]=b.mapping,null==B||B(Object.assign({},e))}else null==B||B(b)}function Ge(e,n,t){var i,l,a,s,d,r,u;const p=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},y).components[1].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},y).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},y);if(null!=Oe&&Oe>-1&&Ee){const n=Object.assign({},y).components.map((n=>{var o;return"CAROUSEL"===n.type?Object.assign(Object.assign({},n),{cards:null===(o=n.cards)||void 0===o?void 0:o.map((n=>Object.assign(Object.assign({},n),{components:n.components.map((n=>{var o,i,l;if("BUTTONS"===n.type){const a=null===(o=null==n?void 0:n.buttons)||void 0===o?void 0:o.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==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=o.cloneDeep(y);return i.components=n,void(null==B||B(Object.assign({},i)))}const c=null==p?void 0:p.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==c&&c>-1){const n=null===(s=null===(a=null==p?void 0:p.components[c])||void 0===a?void 0:a.buttons)||void 0===s?void 0:s.filter((e=>"QUICK_REPLY"===e.type));if(n){let o=n[t];o=Object.assign(Object.assign({},o),{flowId:e.flowId,flowName:e.flowName});const i=[...null!==(u=null===(r=null===(d=p.components)||void 0===d?void 0:d[c])||void 0===r?void 0:r.buttons)&&void 0!==u?u:[]].map((e=>"QUICK_REPLY"===e.type&&(null==e?void 0:e.text)===(null==o?void 0:o.text)?o:e)),l=Object.assign(Object.assign({},p.components[c]),{buttons:i}),a=[...p.components];a[c]=l,p.components=a}}if(null!=Oe&&Oe>-1){const e=o.cloneDeep(y);e.components[1].cards[Oe].components=p.components,null==B||B(Object.assign({},e))}else null==B||B(p)}t.useEffect((()=>{var e,n;if(null===(e=y.mapping.buttons)||void 0===e?void 0:e.find((e=>"checkout.checkoutUrl"===e.slice(2,-2))))Le(!0);else{Le(!1);const e=null===(n=null==Te?void 0:Te.discountCodeExtra)||void 0===n?void 0:n[1];null==e||e("")}}),[y]),t.useEffect((()=>{var e,n,o,t;if(null!=Oe&&Oe>-1){const i={components:null===(n=null===(e=y.components[1])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[Oe].components,mapping:null===(t=null===(o=null==y?void 0:y.mapping)||void 0===o?void 0:o.cards)||void 0===t?void 0:t[Oe]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u}=p.getAllDataFromTemplateComponent(i);Ue({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u})}else if(null!=Oe&&-1===Oe){const{descriptionComponents:e,urlBtns:n,qrbBtns:o,imageComponent:t,bodyVariables:i,headerVariables:l}=p.getAllDataFromTemplateComponent(y);Ue({descriptionComponents:e,urlBtns:n,qrbBtns:o,imageComponent:t,bodyVariables:i,headerVariables:l})}}),[Oe]),t.useEffect((()=>{var e,n,o,t;if(null!=Oe&&Oe>-1&&Se){const i={components:null===(n=null===(e=y.components[1])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[Oe].components,mapping:null===(t=null===(o=null==y?void 0:y.mapping)||void 0===o?void 0:o.cards)||void 0===t?void 0:t[Oe]},{descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u}=p.getAllDataFromTemplateComponent(i);Ue({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u}),Fe(!1)}}),[Se]);t.useEffect((()=>{Ve&&xe===d.POD.CHATBOT&&(()=>{if(!q)return void Ke("PDF name is Required");const e=v.validateInputNameChatbot(q);null==R||R(null!=q?q:""),Ke(e?"Please enter a valid PDF name":void 0)})()}),[Ve]);const Xe=je?Ae.imageComponent:De;return He.openEditMedia?e.jsx(x.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e.jsx(g.default,{mediaComponentFormat:null!==(P=Xe.format)&&void 0!==P?P:s.HEADER_TYPES.IMAGE,uploadMedia:He.uploadMedia,variableListForImage:D||[],useEditWhatsappTemplateMediaResponse:He,setOpenEditMedia:He.setOpenEditMedia,openEditMedia:He.openEditMedia,editIconRef:He.editIconRef,fileRef:Re})})):e.jsxs(x.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:Ee?"420px":"auto"}},{children:[!!Ae.imageComponent&&!Ee&&e.jsxs(f.EditTemplateMediaContainer,{children:[e.jsx(h.default,{imageName:null!==(A=null===(L=null==Xe?void 0:Xe.example)||void 0===L?void 0:L.header_handle)&&void 0!==A?A:[],handleImageChange:He.handleImageChange,mediaType:null==Xe?void 0:Xe.format,error:He.error,isLoading:He.loading,setOpenEditMedia:He.setOpenEditMedia,selectedVariable:c.isVariable(null!==(N=null===(w=null===(U=null==Xe?void 0:Xe.example)||void 0===U?void 0:U.header_handle)||void 0===w?void 0:w[0])&&void 0!==N?N:"")?null===(H=null===(_=null==Xe?void 0:Xe.example)||void 0===_?void 0:_.header_handle)||void 0===H?void 0:H[0]:(null===(F=null===(S=null==y?void 0:y.mapping)||void 0===S?void 0:S.header)||void 0===F?void 0:F[0])?null===(Y=null===(Q=null==y?void 0:y.mapping)||void 0===Q?void 0:Q.header)||void 0===Y?void 0:Y[0]:He.selectedVariable}),(null==De?void 0:De.format)==s.HEADER_TYPES.DOCUMENT?e.jsx(V,{children:xe===d.POD.CHATBOT?e.jsx(a.InputWithVariables,{labelText:"PDF Name",placeHolder:"Enter the name",errorMessage:We||void 0,onChange:e=>{var n;Ke(""),null==R||R(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.jsx(l.Input,{labelText:"PDF Name",placeholder:"Enter the name",value:Qe,errorMessage:We||void 0,onBlur:()=>{if(!Qe)return null==R||R(""),void Ke("PDF name is Required");const e=v.validateInputName(Qe);null==R||R(Qe),Ke(e?"Please enter a valid PDF name":void 0)},onChangeText:e=>{Ke(""),Ye(e)}})}):e.jsx(e.Fragment,{})]}),(null===(W=Ae.bodyVariables)||void 0===W?void 0:W.length)>0&&e.jsx(O.default,{containerStyle:{paddingTop:Ae.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===(K=Ae.descriptionComponents)||void 0===K?void 0:K.map(((n,o)=>e.jsx(T.default,{originalVariableList:null!=Oe&&Oe>-1?Ce.cards[Oe]:Ce,type:n.type,descriptionComponent:n.component,showVariableModal:k},o))),(null===(X=null===(G=null!=Oe&&Oe>-1?null===($=Ce.cards[Oe])||void 0===$?void 0:$.buttons:null==Ce?void 0:Ce.buttons)||void 0===G?void 0:G.filter((e=>"URL"===e.type)))||void 0===X?void 0:X.length)>0&&e.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(Z=null===(J=null!=Oe&&Oe>-1?null===(z=Ce.cards[Oe])||void 0===z?void 0:z.buttons:null==Ce?void 0:Ce.buttons)||void 0===J?void 0:J.filter((e=>xe===d.POD.CHATBOT||"URL"===e.type)))||void 0===Z?void 0:Z.map(((n,o)=>{const t=n.buttonVariable===u.STATIC_URL_VARIABLE_NAME;if("URL"===n.type)return e.jsx(E.default,{variableListIndex:o,disableEdit:t,CTAoptions:null==M?void 0:M.CTAoptions,button:n,currentVariableList:null!=Oe&&Oe>-1?Object.assign({},Ce.cards[Oe]):Object.assign({},Ce),updateSelectedURLTemplateBtn:$e},`${o}_${Oe}`)})),xe===d.POD.CHATBOT&&(null===(ne=null===(ee=ke[0])||void 0===ee?void 0:ee.component)||void 0===ne?void 0:ne.buttons)&&(null===(ie=null===(te=null===(oe=ke[0])||void 0===oe?void 0:oe.component)||void 0===te?void 0:te.buttons)||void 0===ie?void 0:ie.length)>0&&e.jsx(m.BackTrackComponent,{backTrackMessage:null===(le=null==Te?void 0:Te.backTrackExtra)||void 0===le?void 0:le[0],setBackTrackMessage:null===(ae=null==Te?void 0:Te.backTrackExtra)||void 0===ae?void 0:ae[1]}),(null===(re=null===(de=null!=Oe&&Oe>-1?null===(se=Ce.cards[Oe])||void 0===se?void 0:se.buttons:null==Ce?void 0:Ce.buttons)||void 0===de?void 0:de.filter((e=>"QUICK_REPLY"===e.type)))||void 0===re?void 0:re.length)>0&&(xe!==d.POD.CHATBOT?e.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.jsx(m.BackTrackComponent,{backTrackMessage:null===(ue=null==Te?void 0:Te.backTrackExtra)||void 0===ue?void 0:ue[0],setBackTrackMessage:null===(pe=null==Te?void 0:Te.backTrackExtra)||void 0===pe?void 0:pe[1]})),null===(me=null===(ve=null!=Oe&&Oe>-1?null===(ce=Ce.cards[Oe])||void 0===ce?void 0:ce.buttons:null==Ce?void 0:Ce.buttons)||void 0===ve?void 0:ve.filter((e=>"QUICK_REPLY"===e.type)))||void 0===me?void 0:me.map(((n,o)=>{if("QUICK_REPLY"===n.type&&xe!==d.POD.CHATBOT)return e.jsx(E.default,{variableListIndex:o,QRBoptions:null==M?void 0:M.QRBoptions,button:n,currentVariableList:null!=Oe&&Oe>-1?Object.assign({},Ce.cards[Oe]):Object.assign({},Ce),updateSelectedQRBTemplateBtn:Ge},`${o}_${Oe}`)})),xe===d.POD.CHATBOT&&Pe&&e.jsx(b.DiscountCodeComponent,{discountCode:null===(be=null==Te?void 0:Te.discountCodeExtra)||void 0===be?void 0:be[0],setDiscountCode:null===(ge=null==Te?void 0:Te.discountCodeExtra)||void 0===ge?void 0:ge[1]}),null===(fe=null!=Oe&&Oe>-1?null===(he=Ce.cards[Oe])||void 0===he?void 0:he.buttons:null==Ce?void 0:Ce.buttons)||void 0===fe?void 0:fe.map(((n,o)=>{var t,i,a,s,d;if("COPY_CODE"===n.type)return e.jsx(e.Fragment,{children:ye?e.jsx("div",Object.assign({style:{marginBottom:20,borderRadius:4,padding:"8px 10px"}},{children:e.jsx(l.Input,{state:"disabled",labelText:null!==(t=n.text)&&void 0!==t?t:"Copy Code",value:null!==(i=n.buttonVariable)&&void 0!==i?i:"",onChangeText:()=>{}})})):e.jsx(C.default,{index:o,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},o)})}))]}))};
7
+ `;exports.default=i=>{let{template:y,onTemplateChange:B,whatsappSpecificPickerMeta:M,showVariableModal:k,variableListForImage:D,setDiscountCode:I,fileName:q,setFileName:R}=i;var P,L,A,U,w,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,he,fe;const je=y.isCarouselType,{originalVariableList:Ce,pod:Te,extras:xe,selectedCarouselIndex:Oe,isProductCarouselType:Ee,disableCopyCode:ye,isError:Ve}=r.useTemplateModalContext(),{descriptionComponents:Be,urlBtns:Me,qrbBtns:ke,imageComponent:De,bodyVariables:Ie,headerVariables:qe}=p.getAllDataFromTemplateComponent(y),Re=o.useRef(null),[Pe,Le]=o.useState(!1),[Ae,Ue]=o.useState(-1===Oe?{descriptionComponents:Be,urlBtns:Me,qrbBtns:ke,imageComponent:De,bodyVariables:Ie,headerVariables:qe}:{}),{uploadMediaLink:we,uploadMediaFiles:Ne,validateMimeType:_e}=M,He=j.useEditWhatsappTemplateMedia({uploadMediaLink:we,uploadMediaFiles:Ne,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=y.components[1])||void 0===o?void 0:o.cards)||void 0===i?void 0:i[Oe].components,mapping:null===(a=null===(l=null==y?void 0:y.mapping)||void 0===l?void 0:l.cards)||void 0===a?void 0:a[Oe]}:Object.assign({},y);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(y);e.components[1].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)),Fe(!0)}else null==B||B(Object.assign({},p))},validateMimeType:_e,mediaComponent:je?Ae.imageComponent:De,fileRef:Re}),[Se,Fe]=o.useState(!1),[Qe,Ye]=o.useState(q),[We,Ke]=o.useState();function $e(e,n,o){var i,l,a,s,d,r,u,p,c,v;const m=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},y).components[1].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},y).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},y),b=t.cloneDeep(m),g="custom"===n&&"string"==typeof e,h=g?e:"string"!=typeof e?e.defaultValue?e.defaultValue:"https://d.bik.ai/":"https://d.bik.ai";if(null!=Oe&&Oe>-1&&Ee){const n=Object.assign({},y).components.map((e=>{var n;return"CAROUSEL"===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:[h]});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({},y).mapping)||void 0===a?void 0:a.cards)||void 0===s?void 0:s.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=>g?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:""))})})),l=t.cloneDeep(y);return l.components=n,l.mapping.cards=i,void(null==B||B(Object.assign({},l)))}const f=null==b?void 0:b.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==f&&f>-1){const t=null===(d=null==b?void 0:b.components[f].buttons)||void 0===d?void 0:d.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!==(p=null===(u=null===(r=b.components)||void 0===r?void 0:r[f])||void 0===u?void 0:u.buttons)&&void 0!==p?p:[]].map((e=>"URL"===e.type&&(null==e?void 0:e.text)===(null==a?void 0:a.text)?a:e)),d=Object.assign(Object.assign({},b.components[f]),{buttons:s}),v=null===(c=b.mapping)||void 0===c?void 0:c.buttons;v&&v.length>0&&(v[o]=i?"((customBtnPlaceholder))":"string"!=typeof e?e.placeHolder:"");const m=Object.assign(Object.assign({},b.mapping),{buttons:v});b.mapping=m;const g=[...b.components];g[f]=d,b.components=g}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(v=e.placeHolder)||void 0===v?void 0:v.slice(2,-2))?Le(!0):(Le(!1),null==I||I(""))}if(null!=Oe&&Oe>-1){const e=t.cloneDeep(y);e.components[1].cards[Oe].components=b.components,e.mapping.cards[Oe]=b.mapping,null==B||B(Object.assign({},e))}else null==B||B(b)}function Ge(e,n,o){var i,l,a,s,d,r,u;const p=null!=Oe&&Oe>-1?{components:null===(i=Object.assign({},y).components[1].cards)||void 0===i?void 0:i[Oe].components,mapping:null===(l=Object.assign({},y).mapping.cards)||void 0===l?void 0:l[Oe]}:Object.assign({},y);if(null!=Oe&&Oe>-1&&Ee){const n=Object.assign({},y).components.map((n=>{var t;return"CAROUSEL"===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(y);return i.components=n,void(null==B||B(Object.assign({},i)))}const c=null==p?void 0:p.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==c&&c>-1){const n=null===(s=null===(a=null==p?void 0:p.components[c])||void 0===a?void 0:a.buttons)||void 0===s?void 0:s.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!==(u=null===(r=null===(d=p.components)||void 0===d?void 0:d[c])||void 0===r?void 0:r.buttons)&&void 0!==u?u:[]].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({},p.components[c]),{buttons:i}),a=[...p.components];a[c]=l,p.components=a}}if(null!=Oe&&Oe>-1){const e=t.cloneDeep(y);e.components[1].cards[Oe].components=p.components,null==B||B(Object.assign({},e))}else null==B||B(p)}o.useEffect((()=>{var e,n;if(null===(e=y.mapping.buttons)||void 0===e?void 0:e.find((e=>"checkout.checkoutUrl"===e.slice(2,-2))))Le(!0);else{Le(!1);const e=null===(n=null==xe?void 0:xe.discountCodeExtra)||void 0===n?void 0:n[1];null==e||e("")}}),[y]),o.useEffect((()=>{var e,n,t,o;if(null!=Oe&&Oe>-1){const i={components:null===(n=null===(e=y.components[1])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[Oe].components,mapping:null===(o=null===(t=null==y?void 0:y.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}=p.getAllDataFromTemplateComponent(i);Ue({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u})}else if(null!=Oe&&-1===Oe){const{descriptionComponents:e,urlBtns:n,qrbBtns:t,imageComponent:o,bodyVariables:i,headerVariables:l}=p.getAllDataFromTemplateComponent(y);Ue({descriptionComponents:e,urlBtns:n,qrbBtns:t,imageComponent:o,bodyVariables:i,headerVariables:l})}}),[Oe]),o.useEffect((()=>{var e,n,t,o;if(null!=Oe&&Oe>-1&&Se){const i={components:null===(n=null===(e=y.components[1])||void 0===e?void 0:e.cards)||void 0===n?void 0:n[Oe].components,mapping:null===(o=null===(t=null==y?void 0:y.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}=p.getAllDataFromTemplateComponent(i);Ue({descriptionComponents:l,urlBtns:a,qrbBtns:s,imageComponent:d,bodyVariables:r,headerVariables:u}),Fe(!1)}}),[Se]);o.useEffect((()=>{Ve&&Te===d.POD.CHATBOT&&(()=>{if(!q)return void Ke("PDF name is Required");const e=v.validateInputNameChatbot(q);null==R||R(null!=q?q:""),Ke(e?"Please enter a valid PDF name":void 0)})()}),[Ve]);const Xe=je?Ae.imageComponent:De;return He.openEditMedia?e.jsx(T.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:e.jsx(g.default,{mediaComponentFormat:null!==(P=Xe.format)&&void 0!==P?P:s.HEADER_TYPES.IMAGE,uploadMedia:He.uploadMedia,variableListForImage:D||[],useEditWhatsappTemplateMediaResponse:He,setOpenEditMedia:He.setOpenEditMedia,openEditMedia:He.openEditMedia,editIconRef:He.editIconRef,fileRef:Re})})):e.jsxs(T.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460,minWidth:Ee?"420px":"auto"}},{children:[!!Ae.imageComponent&&!Ee&&e.jsxs(f.EditTemplateMediaContainer,{children:[e.jsx(h.default,{imageName:null!==(A=null===(L=null==Xe?void 0:Xe.example)||void 0===L?void 0:L.header_handle)&&void 0!==A?A:[],handleImageChange:He.handleImageChange,mediaType:null==Xe?void 0:Xe.format,error:He.error,isLoading:He.loading,setOpenEditMedia:He.setOpenEditMedia,selectedVariable:c.isVariable(null!==(N=null===(w=null===(U=null==Xe?void 0:Xe.example)||void 0===U?void 0:U.header_handle)||void 0===w?void 0:w[0])&&void 0!==N?N:"")?null===(H=null===(_=null==Xe?void 0:Xe.example)||void 0===_?void 0:_.header_handle)||void 0===H?void 0:H[0]:(null===(F=null===(S=null==y?void 0:y.mapping)||void 0===S?void 0:S.header)||void 0===F?void 0:F[0])?null===(Y=null===(Q=null==y?void 0:y.mapping)||void 0===Q?void 0:Q.header)||void 0===Y?void 0:Y[0]:He.selectedVariable}),(null==De?void 0:De.format)==s.HEADER_TYPES.DOCUMENT?e.jsx(V,{children:Te===d.POD.CHATBOT?e.jsx(a.InputWithVariables,{labelText:"PDF Name",placeHolder:"Enter the name",errorMessage:We||void 0,onChange:e=>{var n;Ke(""),null==R||R(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.jsx(l.Input,{labelText:"PDF Name",placeholder:"Enter the name",value:Qe,errorMessage:We||void 0,onBlur:()=>{if(!Qe)return null==R||R(""),void Ke("PDF name is Required");const e=v.validateInputName(Qe);null==R||R(Qe),Ke(e?"Please enter a valid PDF name":void 0)},onChangeText:e=>{Ke(""),Ye(e)}})}):e.jsx(e.Fragment,{})]}),(null===(W=Ae.bodyVariables)||void 0===W?void 0:W.length)>0&&e.jsx(O.default,{containerStyle:{paddingTop:Ae.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===(K=Ae.descriptionComponents)||void 0===K?void 0:K.map(((n,t)=>e.jsx(x.default,{originalVariableList:null!=Oe&&Oe>-1?Ce.cards[Oe]:Ce,type:n.type,descriptionComponent:n.component,showVariableModal:k},t))),(null===(X=null===(G=null!=Oe&&Oe>-1?null===($=Ce.cards[Oe])||void 0===$?void 0:$.buttons:null==Ce?void 0:Ce.buttons)||void 0===G?void 0:G.filter((e=>"URL"===e.type)))||void 0===X?void 0:X.length)>0&&e.jsx(O.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(Z=null===(J=null!=Oe&&Oe>-1?null===(z=Ce.cards[Oe])||void 0===z?void 0:z.buttons:null==Ce?void 0:Ce.buttons)||void 0===J?void 0:J.filter((e=>Te===d.POD.CHATBOT||"URL"===e.type)))||void 0===Z?void 0:Z.map(((n,t)=>{const o=n.buttonVariable===u.STATIC_URL_VARIABLE_NAME;if("URL"===n.type)return e.jsx(E.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:$e},`${t}_${Oe}`)})),Te===d.POD.CHATBOT&&(null===(ne=null===(ee=ke[0])||void 0===ee?void 0:ee.component)||void 0===ne?void 0:ne.buttons)&&(null===(ie=null===(oe=null===(te=ke[0])||void 0===te?void 0:te.component)||void 0===oe?void 0:oe.buttons)||void 0===ie?void 0:ie.length)>0&&e.jsx(m.BackTrackComponent,{backTrackMessage:null===(le=null==xe?void 0:xe.backTrackExtra)||void 0===le?void 0:le[0],setBackTrackMessage:null===(ae=null==xe?void 0:xe.backTrackExtra)||void 0===ae?void 0:ae[1]}),(null===(re=null===(de=null!=Oe&&Oe>-1?null===(se=Ce.cards[Oe])||void 0===se?void 0:se.buttons:null==Ce?void 0:Ce.buttons)||void 0===de?void 0:de.filter((e=>"QUICK_REPLY"===e.type)))||void 0===re?void 0:re.length)>0&&(Te!==d.POD.CHATBOT?e.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.jsx(m.BackTrackComponent,{backTrackMessage:null===(ue=null==xe?void 0:xe.backTrackExtra)||void 0===ue?void 0:ue[0],setBackTrackMessage:null===(pe=null==xe?void 0:xe.backTrackExtra)||void 0===pe?void 0:pe[1]})),null===(me=null===(ve=null!=Oe&&Oe>-1?null===(ce=Ce.cards[Oe])||void 0===ce?void 0:ce.buttons:null==Ce?void 0:Ce.buttons)||void 0===ve?void 0:ve.filter((e=>"QUICK_REPLY"===e.type)))||void 0===me?void 0:me.map(((n,t)=>{if("QUICK_REPLY"===n.type&&Te!==d.POD.CHATBOT)return e.jsx(E.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:Ge},`${t}_${Oe}`)})),Te===d.POD.CHATBOT&&Pe&&e.jsx(b.DiscountCodeComponent,{discountCode:null===(be=null==xe?void 0:xe.discountCodeExtra)||void 0===be?void 0:be[0],setDiscountCode:null===(ge=null==xe?void 0:xe.discountCodeExtra)||void 0===ge?void 0:ge[1]}),null===(fe=null!=Oe&&Oe>-1?null===(he=Ce.cards[Oe])||void 0===he?void 0:he.buttons:null==Ce?void 0:Ce.buttons)||void 0===fe?void 0:fe.map(((n,t)=>{var o,i,a,s,d;if("COPY_CODE"===n.type)return e.jsx(e.Fragment,{children:ye?e.jsx("div",Object.assign({style:{marginBottom:20,borderRadius:4,padding:"8px 10px"}},{children:e.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.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)})}))]}))};
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /*!
3
+ * @kurkle/color v0.3.4
4
+ * https://github.com/kurkle/color#readme
5
+ * (c) 2024 Jukka Kurkela
6
+ * Released under the MIT License
7
+ */
8
+ function e(e){return e+.5|0}Object.defineProperty(exports,"__esModule",{value:!0});const t=(e,t,r)=>Math.max(Math.min(e,r),t);function r(r){return t(e(2.55*r),0,255)}function f(r){return t(e(255*r),0,255)}function a(r){return t(e(r/2.55)/100,0,1)}function n(r){return t(e(100*r),0,100)}const s={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},i=[..."0123456789ABCDEF"],c=e=>i[15&e],b=e=>i[(240&e)>>4]+i[15&e],o=e=>(240&e)>>4==(15&e);function g(e){var t,r=e.length;return"#"===e[0]&&(4===r||5===r?t={r:255&17*s[e[1]],g:255&17*s[e[2]],b:255&17*s[e[3]],a:5===r?17*s[e[4]]:255}:7!==r&&9!==r||(t={r:s[e[1]]<<4|s[e[2]],g:s[e[3]]<<4|s[e[4]],b:s[e[5]]<<4|s[e[6]],a:9===r?s[e[7]]<<4|s[e[8]]:255})),t}function d(e){var t=(e=>o(e.r)&&o(e.g)&&o(e.b)&&o(e.a))(e)?c:b;return e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0}const u=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function h(e,t,r){const f=t*Math.min(r,1-r),a=(t,a=(t+e/30)%12)=>r-f*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function l(e,t,r){const f=(f,a=(f+e/60)%6)=>r-r*t*Math.max(Math.min(a,4-a,1),0);return[f(5),f(3),f(1)]}function p(e,t,r){const f=h(e,1,.5);let a;for(t+r>1&&(a=1/(t+r),t*=a,r*=a),a=0;a<3;a++)f[a]*=1-t-r,f[a]+=t;return f}function x(e){const t=e.r/255,r=e.g/255,f=e.b/255,a=Math.max(t,r,f),n=Math.min(t,r,f),s=(a+n)/2;let i,c,b;return a!==n&&(b=a-n,c=s>.5?b/(2-a-n):b/(a+n),i=function(e,t,r,f,a){return e===a?(t-r)/f+(t<r?6:0):t===a?(r-e)/f+2:(e-t)/f+4}(t,r,f,b,a),i=60*i+.5),[0|i,c||0,s]}function m(e,t,r,a){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,r,a)).map(f)}function y(e,t,r){return m(h,e,t,r)}function Y(e,t,r){return m(p,e,t,r)}function v(e,t,r){return m(l,e,t,r)}function w(e){return(e%360+360)%360}function _(e){const t=u.exec(e);let a,n=255;if(!t)return;t[5]!==a&&(n=t[6]?r(+t[5]):f(+t[5]));const s=w(+t[2]),i=+t[3]/100,c=+t[4]/100;return a="hwb"===t[1]?Y(s,i,c):"hsv"===t[1]?v(s,i,c):y(s,i,c),{r:a[0],g:a[1],b:a[2],a:n}}function F(e,t){var r=x(e);r[0]=w(r[0]+t),r=y(r),e.r=r[0],e.g=r[1],e.b=r[2]}function M(e){if(!e)return;const t=x(e),r=t[0],f=n(t[1]),s=n(t[2]);return e.a<255?`hsla(${r}, ${f}%, ${s}%, ${a(e.a)})`:`hsl(${r}, ${f}%, ${s}%)`}const X={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},k={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let S;function O(e){S||(S=function(){const e={},t=Object.keys(k),r=Object.keys(X);let f,a,n,s,i;for(f=0;f<t.length;f++){for(s=i=t[f],a=0;a<r.length;a++)n=r[a],i=i.replace(n,X[n]);n=parseInt(k[s],16),e[i]=[n>>16&255,n>>8&255,255&n]}return e}(),S.transparent=[0,0,0,0]);const t=S[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}const P=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function T(e){const f=P.exec(e);let a,n,s,i=255;if(f){if(f[7]!==a){const e=+f[7];i=f[8]?r(e):t(255*e,0,255)}return a=+f[1],n=+f[3],s=+f[5],a=255&(f[2]?r(a):t(a,0,255)),n=255&(f[4]?r(n):t(n,0,255)),s=255&(f[6]?r(s):t(s,0,255)),{r:a,g:n,b:s,a:i}}}function Z(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${a(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const $=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,E=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function R(e,t,r){if(e){let f=x(e);f[t]=Math.max(0,Math.min(f[t]+f[t]*r,0===t?360:1)),f=y(f),e.r=f[0],e.g=f[1],e.b=f[2]}}function A(e,t){return e?Object.assign(t||{},e):e}function U(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=f(e[3]))):(t=A(e,{r:0,g:0,b:0,a:1})).a=f(t.a),t}class V{constructor(e){if(e instanceof V)return e;const t=typeof e;let r;var f;"object"===t?r=U(e):"string"===t&&(r=g(e)||O(e)||("r"===(f=e).charAt(0)?T(f):_(f))),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=A(this._rgb);return e&&(e.a=a(e.a)),e}set rgb(e){this._rgb=U(e)}rgbString(){return this._valid?Z(this._rgb):void 0}hexString(){return this._valid?d(this._rgb):void 0}hslString(){return this._valid?M(this._rgb):void 0}mix(e,t){if(e){const r=this.rgb,f=e.rgb;let a;const n=t===a?.5:t,s=2*n-1,i=r.a-f.a,c=((s*i==-1?s:(s+i)/(1+s*i))+1)/2;a=1-c,r.r=255&c*r.r+a*f.r+.5,r.g=255&c*r.g+a*f.g+.5,r.b=255&c*r.b+a*f.b+.5,r.a=n*r.a+(1-n)*f.a,this.rgb=r}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,r){const n=E(a(e.r)),s=E(a(e.g)),i=E(a(e.b));return{r:f($(n+r*(E(a(t.r))-n))),g:f($(s+r*(E(a(t.g))-s))),b:f($(i+r*(E(a(t.b))-i))),a:e.a+r*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new V(this.rgb)}alpha(e){return this._rgb.a=f(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const t=this._rgb,r=e(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=r,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return R(this._rgb,2,e),this}darken(e){return R(this._rgb,2,-e),this}saturate(e){return R(this._rgb,1,e),this}desaturate(e){return R(this._rgb,1,-e),this}rotate(e){return F(this._rgb,e),this}}exports.Color=V,exports.b2n=a,exports.hexParse=g,exports.hexString=d,exports.hsl2rgb=y,exports.hslString=M,exports.hsv2rgb=v,exports.hueParse=_,exports.hwb2rgb=Y,exports.lim=t,exports.n2b=f,exports.n2p=n,exports.nameParse=O,exports.p2b=r,exports.rgb2hsl=x,exports.rgbParse=T,exports.rgbString=Z,exports.rotate=F,exports.round=e;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../dist/chart.js");e.Chart.register(...e.registerables),e.Chart,exports.Animation=e.Animation,exports.Animations=e.Animations,exports.ArcElement=e.ArcElement,exports.BarController=e.BarController,exports.BarElement=e.BarElement,exports.BasePlatform=e.BasePlatform,exports.BasicPlatform=e.BasicPlatform,exports.BubbleController=e.BubbleController,exports.CategoryScale=e.CategoryScale,exports.Chart=e.Chart,exports.Colors=e.Colors,exports.DatasetController=e.DatasetController,exports.Decimation=e.Decimation,exports.DomPlatform=e.DomPlatform,exports.DoughnutController=e.DoughnutController,exports.Element=e.Element,exports.Filler=e.Filler,exports.Interaction=e.Interaction,exports.Legend=e.Legend,exports.LineController=e.LineController,exports.LineElement=e.LineElement,exports.LinearScale=e.LinearScale,exports.LogarithmicScale=e.LogarithmicScale,exports.PieController=e.PieController,exports.PointElement=e.PointElement,exports.PolarAreaController=e.PolarAreaController,exports.RadarController=e.RadarController,exports.RadialLinearScale=e.RadialLinearScale,exports.Scale=e.Scale,exports.ScatterController=e.ScatterController,exports.SubTitle=e.SubTitle,exports.TimeScale=e.TimeScale,exports.TimeSeriesScale=e.TimeSeriesScale,exports.Title=e.Title,exports.Tooltip=e.Tooltip,exports._adapters=e._adapters,exports._detectPlatform=e._detectPlatform,exports.animator=e.animator,exports.controllers=e.controllers,exports.elements=e.elements,exports.layouts=e.layouts,exports.plugins=e.plugins,exports.registerables=e.registerables,exports.registry=e.registry,exports.scales=e.scales;