@nuskin/react-loyalty-elements 1.0.3 → 1.0.5

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 @@
1
+ function n(n,e){if(e==null||e>n.length)e=n.length;for(var r=0,o=new Array(e);r<e;r++)o[r]=n[r];return o}function e(n){if(Array.isArray(n))return n}function r(n){if(n===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return n}function o(n,e,r){e=l(e);return d(n,y()?Reflect.construct(e,r||[],l(n).constructor):e.apply(n,r))}function t(n,e){if(!(n instanceof e)){throw new TypeError("Cannot call a class as a function")}}function i(n,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(n,o.key,o)}}function a(n,e,r){if(e)i(n.prototype,e);if(r)i(n,r);return n}function l(n){l=Object.setPrototypeOf?Object.getPrototypeOf:function n(n){return n.__proto__||Object.getPrototypeOf(n)};return l(n)}function c(n,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:true,configurable:true}});if(e)p(n,e)}function u(n,e){var r=n==null?null:typeof Symbol!=="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(r==null)return;var o=[];var t=true;var i=false;var a,l;try{for(r=r.call(n);!(t=(a=r.next()).done);t=true){o.push(a.value);if(e&&o.length===e)break}}catch(n){i=true;l=n}finally{try{if(!t&&r["return"]!=null)r["return"]()}finally{if(i)throw l}}return o}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(n,e){if(e&&(h(e)==="object"||typeof e==="function")){return e}return r(n)}function p(n,e){p=Object.setPrototypeOf||function n(n,e){n.__proto__=e;return n};return p(n,e)}function m(n,r){return e(n)||u(n,r)||f(n,r)||s()}function v(n,e){if(!e){e=n.slice(0)}return Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}function h(n){"@swc/helpers - typeof";return n&&typeof Symbol!=="undefined"&&n.constructor===Symbol?"symbol":typeof n}function f(e,r){if(!e)return;if(typeof e==="string")return n(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor)o=e.constructor.name;if(o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,r)}function y(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(n){}return(y=function(){return!!n})()}function g(){var n=v(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n align-content: center;\n background-color: #f5f5f5;\n border: 1px solid #e0e0e0;\n border-radius: 10px;\n padding: 1.5rem;\n margin-bottom: 20px;\n height: 50%;\n margin: auto;\n\n @media (max-width: 950px) {\n flex-direction: column;\n }\n"]);g=function e(){return n};return n}function b(){var n=v(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n align-content: center;\n\n .reward-logo {\n width: 200px;\n margin-bottom: 12px;\n }\n\n .reward-progress {\n height: 150px;\n width: 150px;\n }\n .progress-bar {\n background-color: #e0e0e0;\n height: 100%;\n }\n\n @media (max-width: 950px) {\n flex-direction: column;\n\n .info-container {\n margin-left: 0px;\n align-items: center;\n }\n .reward-progress-total-div {\n margin-top: 10px;\n }\n }\n"]);b=function e(){return n};return n}function w(){var n=v(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-left: 16px;\n\n .info-item {\n margin: 5px 0;\n font-weight: 600;\n }\n"]);w=function e(){return n};return n}function x(){var n=v(["\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n"]);x=function e(){return n};return n}function C(){var n=v(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n color: black;\n\n .center-value-progress-bar-price {\n margin: 0;\n }\n .center-value-progress-bar-voucher {\n margin: 0;\n letter-spacing: 0.01em;\n }\n"]);C=function e(){return n};return n}function _(){var n=v(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n\n .total-button {\n display: flex;\n align-items: center;\n background-color: #e5edf6;\n border-radius: 20px;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n }\n .reward-subtitle {\n letter-spacing: 0;\n display: flex;\n }\n\n @media (max-width: 950px) {\n .reward-subtitle {\n letter-spacing: 0;\n display: flex;\n text-align: center;\n }\n margin-top: 10px;\n }\n"]);_=function e(){return n};return n}function M(){var n=v(["\n display: flex;\n align-items: center;\n background-color: #e5edf6;\n border-radius: 20px;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n padding: 1rem;\n margin-bottom: 14px;\n\n @media (max-width: 950px) {\n margin-top: 14px;\n }\n"]);M=function e(){return n};return n}function L(){var n=v(["\n .info-icon {\n margin-left: 6px !important;\n }\n .loyalty-icon {\n height: 19px !important;\n width: 19px !important;\n margin-left: 6px !important;\n }\n .loyalty-warning-icon {\n height: 19px !important;\n width: 19px !important;\n margin-right: 6px !important;\n }\n .outline-exclamation-icon {\n height: 48px !important;\n width: 48px !important;\n }\n"]);L=function e(){return n};return n}function T(){var n=v(["\n position: absolute;\n height: 100%;\n"]);T=function e(){return n};return n}function A(){var n=v(["\n background: #fff;\n width: 6px;\n height: 17%;\n"]);A=function e(){return n};return n}import{a as j,b as k,c as F,d as O}from"../chunk-B5UVKXR6.mjs";import{e as N,v as S}from"../chunk-YZGRTK3A.mjs";import{useState as B}from"react";import V from"react";import{CircularProgressbarWithChildren as R,buildStyles as E}from"react-circular-progressbar";var P=N(O()),Z=P.styled.div(g()),D=P.styled.div(b()),Q=P.styled.div(w()),W=P.styled.div(x()),I=P.styled.div(C()),z=P.styled.div(_()),H=P.styled.div(M()),Y=P.styled.span(L()),U=P.styled.div(T()),K=P.styled.div(A());import{jsx as X}from"react/jsx-runtime";function q(n){return X(U,{style:{transform:"rotate(".concat(n.turns,"turn)")},children:X(K,{})})}function G(n){var e=1/n.count;return Array(n.count).fill(null).map(function(n,r){return X(q,{turns:r*e+.5},r)})}var $=G;import{FaExclamationTriangle as J}from"react-icons/fa";import{jsx as nn,jsxs as ne}from"react/jsx-runtime";function nr(){return ne("svg",{width:"71",height:"42",viewBox:"0 0 71 42",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[nn("path",{d:"M5.32847 36.176C3.52571 36.176 2.06348 34.7138 2.06348 32.911L2.15695 28.3574L4.8277 28.4108L4.73422 32.9378C4.73422 33.2382 5.0013 33.5053 5.32847 33.5053H30.7606L34.0056 33.3584L34.1258 36.0291L30.8207 36.1827H5.32847V36.176Z",fill:"#405E50"}),nn("path",{d:"M68.3914 12.9147H65.7207V9.1156C65.7207 8.78843 65.4536 8.52136 65.1264 8.52136L36.3491 8.48129V5.81055L65.1264 5.85061C66.9225 5.85061 68.3914 7.31284 68.3914 9.1156V12.9147Z",fill:"#405E50"}),nn("path",{d:"M62.3222 41.6454C62.1152 41.6454 61.9082 41.6253 61.7012 41.5853L2.99822 30.2079C2.14358 30.041 1.40245 29.5536 0.915037 28.8325C0.427626 28.1114 0.24735 27.2434 0.414272 26.3821L4.94119 3.0197C5.10811 2.16506 5.59552 1.42393 6.31662 0.936522C7.03772 0.44911 7.90572 0.268835 8.76703 0.435756L67.47 11.8131C69.2394 12.1537 70.3945 13.8696 70.054 15.639L65.5271 39.0013C65.2199 40.5637 63.8512 41.6454 62.3222 41.6454ZM62.2087 38.968C62.5225 39.028 62.843 38.8211 62.9031 38.5006L67.43 15.1382C67.4901 14.8177 67.2831 14.5039 66.9626 14.4438L8.25291 3.05977C8.04593 3.0197 7.88569 3.09983 7.80556 3.15324C7.73212 3.20666 7.59858 3.32016 7.55184 3.53382L3.02493 26.8962C2.96484 27.2167 3.17182 27.5305 3.49231 27.5906L62.2087 38.968Z",fill:"#405E50"}),nn("path",{d:"M13.5344 22.0957C13.1405 22.0957 12.7398 22.0556 12.3392 21.9822C8.95406 21.3279 6.73066 18.0362 7.385 14.651C7.70549 13.0085 8.64025 11.593 10.029 10.6582C11.4178 9.72348 13.0804 9.38296 14.7229 9.70345C16.3654 10.0239 17.7809 10.9587 18.7156 12.3475C19.6504 13.7363 19.9909 15.3988 19.6704 17.0413C19.0895 20.0125 16.4655 22.0957 13.5344 22.0957ZM13.521 12.254C12.8133 12.254 12.1189 12.461 11.5247 12.8683C10.7301 13.4024 10.196 14.217 10.009 15.1584C9.6351 17.1014 10.9037 18.9843 12.8467 19.3582C14.7896 19.7321 16.6725 18.4635 17.0464 16.5205C17.2267 15.5791 17.0331 14.6243 16.4989 13.8298C15.9648 13.0352 15.1502 12.5011 14.2088 12.3141C13.9817 12.274 13.7481 12.254 13.521 12.254Z",fill:"#405E50"}),nn("path",{d:"M23.9338 15.4855L23.4255 18.1074L59.9361 25.1845L60.4443 22.5626L23.9338 15.4855Z",fill:"#405E50"}),nn("path",{d:"M22.8916 19.7002L22.3838 22.3223L58.8956 29.393L59.4034 26.771L22.8916 19.7002Z",fill:"#405E50"})]})}var no=nr;import{jsx as nt,jsxs as ni}from"react/jsx-runtime";function na(){return ni("svg",{width:"71",height:"42",viewBox:"0 0 71 42",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[nt("path",{d:"M5.32847 36.176C3.52571 36.176 2.06348 34.7138 2.06348 32.911L2.15695 28.3574L4.8277 28.4108L4.73422 32.9378C4.73422 33.2382 5.0013 33.5053 5.32847 33.5053H30.7606L34.0056 33.3584L34.1258 36.0291L30.8207 36.1827H5.32847V36.176Z",fill:"#B0B0B0"}),nt("path",{d:"M68.3914 12.9147H65.7207V9.1156C65.7207 8.78843 65.4536 8.52136 65.1264 8.52136L36.3491 8.48129V5.81055L65.1264 5.85061C66.9225 5.85061 68.3914 7.31284 68.3914 9.1156V12.9147Z",fill:"#B0B0B0"}),nt("path",{d:"M62.3222 41.6454C62.1152 41.6454 61.9082 41.6253 61.7012 41.5853L2.99822 30.2079C2.14358 30.041 1.40245 29.5536 0.915037 28.8325C0.427626 28.1114 0.24735 27.2434 0.414272 26.3821L4.94119 3.0197C5.10811 2.16506 5.59552 1.42393 6.31662 0.936522C7.03772 0.44911 7.90572 0.268835 8.76703 0.435756L67.47 11.8131C69.2394 12.1537 70.3945 13.8696 70.054 15.639L65.5271 39.0013C65.2199 40.5637 63.8512 41.6454 62.3222 41.6454ZM62.2087 38.968C62.5225 39.028 62.843 38.8211 62.9031 38.5006L67.43 15.1382C67.4901 14.8177 67.2831 14.5039 66.9626 14.4438L8.25291 3.05977C8.04593 3.0197 7.88569 3.09983 7.80556 3.15324C7.73212 3.20666 7.59858 3.32016 7.55184 3.53382L3.02493 26.8962C2.96484 27.2167 3.17182 27.5305 3.49231 27.5906L62.2087 38.968Z",fill:"#B0B0B0"}),nt("path",{d:"M13.5344 22.0957C13.1405 22.0957 12.7398 22.0556 12.3392 21.9822C8.95406 21.3279 6.73066 18.0362 7.385 14.651C7.70549 13.0085 8.64025 11.593 10.029 10.6582C11.4178 9.72348 13.0804 9.38296 14.7229 9.70345C16.3654 10.0239 17.7809 10.9587 18.7156 12.3475C19.6504 13.7363 19.9909 15.3988 19.6704 17.0413C19.0895 20.0125 16.4655 22.0957 13.5344 22.0957ZM13.521 12.254C12.8133 12.254 12.1189 12.461 11.5247 12.8683C10.7301 13.4024 10.196 14.217 10.009 15.1584C9.6351 17.1014 10.9037 18.9843 12.8467 19.3582C14.7896 19.7321 16.6725 18.4635 17.0464 16.5205C17.2267 15.5791 17.0331 14.6243 16.4989 13.8298C15.9648 13.0352 15.1502 12.5011 14.2088 12.3141C13.9817 12.274 13.7481 12.254 13.521 12.254Z",fill:"#B0B0B0"}),nt("path",{d:"M23.9338 15.4855L23.4255 18.1074L59.9361 25.1845L60.4443 22.5626L23.9338 15.4855Z",fill:"#B0B0B0"}),nt("path",{d:"M22.8916 19.7002L22.3838 22.3223L58.8956 29.393L59.4034 26.771L22.8916 19.7002Z",fill:"#B0B0B0"})]})}var nl=na;import nc from"react";var nu=function(n,e){return Object.keys(e).reduce(function(n,r){var o;var t=(o=e[r])!==null&&o!==void 0?o:"";return n.replace(new RegExp("%".concat(r,"%"),"g"),String(t))},n)};import{jsx as ns,jsxs as nd}from"react/jsx-runtime";var np=/*#__PURE__*/function(n){"use strict";c(e,n);function e(n){t(this,e);return o(this,e,[n])}a(e,[{key:"render",value:function n(){var n=this.props,e=n.value,r=n.voucherValue,o=n.maxMonths,t=n.handleOpenSubscriptionRewardPopup,i=n.notQualifyForRewardThisMonth,a=n.translationConfig,l=a===void 0?{voucherTargetAmount:"",monthsComplete:"",voucherEarned:"",learnMore:"",learn3xMore:"",callToAction:"",notQualify:"",approximateMonthly:"",approximateTotal:"",currentlyTrack:"",loyaltyLogoBlack:""}:a,c=n.learnMoreConfig,u=c===void 0?{tagLine:"",cardOneDescription:"",cardOneVoucherAmount:"",cardTwoDescription:"",cardTwoVoucherAmount:"",header:"",loyaltyLogoWhite:"",loyaltyBanner:"",learnMore:""}:c,s=n.currencyAbbreviate,d=s===void 0?!1:s,p=n.currencyFormat,m=p===void 0?function(){}:p,v="";r===50&&!i?v=l.learn3xMore:r===150||i?v=u.learnMore:r==null&&(v=l.learnMore);var h=nu(l.monthsComplete,{completed_months:e,total_months:o}),f=m(r||0,!0,d),y=l.voucherEarned.replace("%currency_symbol%%currency_amount%","".concat(f));return nd(Q,{children:[ns("img",{className:"reward-logo",src:l.loyaltyLogoBlack,alt:"Rewards Logo"}),e===o?ns("div",{className:"info-item",children:y}):ns("div",{className:"info-item",children:h}),ns(W,{id:"learnMore",onClick:t,children:ns("u",{children:v})})]})}}]);return e}(nc.Component),nm=np;import{NsTypography as nv}from"@nuskin/foundation-ui-components";import{jsx as nh,jsxs as nf}from"react/jsx-runtime";var ny=/*#__PURE__*/function(n){"use strict";c(e,n);function e(n){t(this,e);return o(this,e,[n])}a(e,[{key:"render",value:function n(){var n=this.props,e=n.value,r=e===void 0?0:e,o=n.voucherValue,t=o===void 0?0:o,i=n.maxMonths,a=i===void 0?0:i,l=n.handleOpenSubscriptionRewardPopup,c=l===void 0?function(){}:l,u=n.notQualifyForRewardThisMonth,s=u===void 0?!1:u,d=n.translationConfig,p=d===void 0?{voucherTargetAmount:"",monthsComplete:"",voucherEarned:"",learnMore:"",learn3xMore:"",callToAction:"",notQualify:"",approximateMonthly:"",approximateTotal:"",currentlyTrack:"",loyaltyLogoBlack:""}:d,m=n.learnMoreConfig,v=m===void 0?{tagLine:"",cardOneDescription:"",cardOneVoucherAmount:"",cardTwoDescription:"",cardTwoVoucherAmount:"",header:"",loyaltyLogoWhite:"",loyaltyBanner:"",learnMore:""}:m,h=n.currencyAbbreviate,f=h===void 0?!1:h,y=n.currencyFormat,g=y===void 0?function(){}:y,b=nu(p.voucherTargetAmount,{currency_symbol:"",voucher_amount:""}),w=g(t||0,!0,f);return nf(D,{children:[nh("div",{className:"reward-progress",children:nf(R,{value:r/a*100,strokeWidth:12,background:!0,styles:E({rotation:.5,strokeLinecap:"butt",backgroundColor:r===a&&!s?"rgb(195 240 194)":"#fff",pathColor:"#6BC56A",trailColor:"#E0E0E0"}),children:[nh($,{count:a}),r===a&&!s?nh(no,{}):s?nh(Y,{children:nh(J,{className:"outline-exclamation-icon",color:"#91ACC8"})}):t!=null||t!=null?nf(I,{children:[nh(nv,{component:"div",className:"center-value-progress-bar-price",variant:"title-l",weight:"bold",children:"".concat(w)}),nh(nv,{variant:"label-s",weight:"bold",component:"div",className:"center-value-progress-bar-voucher",children:b})]}):nh(I,{children:nh(nl,{})})]})}),nh(nm,{value:r,voucherValue:t,notQualifyForRewardThisMonth:s,handleOpenSubscriptionRewardPopup:c,maxMonths:a,translationConfig:p,learnMoreConfig:v,currencyAbbreviate:f,currencyFormat:g})]})}}]);return e}(V.Component),ng=ny;import nb from"react";import{FaExclamationTriangle as nw}from"react-icons/fa";import{NsTypography as nx}from"@nuskin/foundation-ui-components";import{jsx as nC,jsxs as n_}from"react/jsx-runtime";function nM(){return n_("svg",{width:"19",height:"19",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[nC("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.833344 9.99967C0.833344 4.93706 4.9374 0.833008 10 0.833008C15.0626 0.833008 19.1667 4.93706 19.1667 9.99967C19.1667 15.0623 15.0626 19.1663 10 19.1663C4.9374 19.1663 0.833344 15.0623 0.833344 9.99967ZM10 2.49967C5.85787 2.49967 2.50001 5.85754 2.50001 9.99967C2.50001 14.1418 5.85787 17.4997 10 17.4997C14.1421 17.4997 17.5 14.1418 17.5 9.99967C17.5 5.85754 14.1421 2.49967 10 2.49967Z",fill:"#4A6987"}),nC("line",{x1:"10.1667",y1:"9.375",x2:"10.1667",y2:"14.7917",stroke:"#4A6987",strokeWidth:"2"}),nC("path",{d:"M10.0052 7.75009C10.6338 7.75009 11.1718 7.22807 11.1771 6.57821C11.1718 5.93901 10.6338 5.41699 10.0052 5.41699C9.35537 5.41699 8.82803 5.93901 8.83335 6.57821C8.82803 7.22807 9.35537 7.75009 10.0052 7.75009Z",fill:"#4A6987"})]})}var nL=nM;F();import{Fragment as nT,jsx as nA,jsxs as nj}from"react/jsx-runtime";var nk=/*#__PURE__*/function(n){"use strict";c(e,n);function e(n){t(this,e);return o(this,e,[n])}a(e,[{key:"render",value:function n(){var n,e;var r=this.props,o=r.value,t=r.voucherValue,i=r.maxMonths,a=r.notQualifyForRewardThisMonth,l=r.amountShow,c=r.translationConfig,u=c===void 0?{voucherTargetAmount:"",monthsComplete:"",voucherEarned:"",learnMore:"",learn3xMore:"",callToAction:"",notQualify:"",approximateMonthly:"",approximateTotal:"",currentlyTrack:"",loyaltyLogoBlack:"",estimateDisclaimer:""}:c,s=r.storeConfig,d=s===void 0?{tiers:[{consecutive_months:0,min_spend:0,max_spend:0,promo_code:""},{consecutive_months:0,min_spend:0,promo_code:""}]}:s,p=r.currencyAbbreviate,m=p===void 0?!1:p,v=r.currencyFormat,h=v===void 0?function(){}:v,f=h(t||0,!0,m),y=u.currentlyTrack.replace("%currency_symbol%%currency_amount%","".concat(f)),g=nu(u.approximateTotal,{currency_symbol:"",projected_month_spend:""}),b=parseFloat(String(d===null||d===void 0?void 0:(e=d.tiers)===null||e===void 0?void 0:(n=e[0])===null||n===void 0?void 0:n.min_spend))||0,w=h(b,!0,m),x=u.callToAction.replace("%currency_symbol%%current_spend_target%","".concat(w)),C=nu(u.approximateMonthly,{currency_symbol:"",estimated_running_subscription_spend:""}),_=h(l!==null&&l!==void 0?l:0,!1,!1);return nj(z,{children:[nA(H,{children:a?nj(nT,{children:[nA(Y,{children:nA(nw,{className:"loyalty-warning-icon",color:"#4A6987"})}),nA(nx,{variant:"body-s",weight:"normal",className:"reward-subtitle",colorOverride:"#293A4A",noSpacing:!0,children:u.notQualify})]}):nj(nT,{children:[nA(nx,{variant:"body-s",weight:"normal",colorOverride:"#252525",className:"reward-subtitle",component:"span",noSpacing:!0,children:C}),"\xa0",nA(nx,{weight:"bold",className:"button-price",variant:"body-s",component:"span",children:"".concat(_)}),nA(Y,{children:nA(k,{slotProps:{tooltip:{sx:{color:"#FFFFFF",backgroundColor:"#252525",fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"20px","& .MuiTooltip-arrow":{color:"#252525"}}}},title:u.estimateDisclaimer,arrow:!0,placement:"top",children:nA("span",{className:"info-icon",children:nA(j,{children:nA(nL,{})})})})})]})}),o===i?"":a?nj(nx,{variant:"body-s",weight:"normal",className:"reward-subtitle",colorOverride:"#252525",component:"div",children:[g,"\xa0",nA(nx,{component:"span",className:"button-price",variant:"body-s",weight:"bold",children:"".concat(_)})]}):t!=null||t!=null?nA(nx,{variant:"body-s",weight:"bold",className:"reward-subtitle",colorOverride:"#252525",children:y}):nA(nx,{variant:"body-s",weight:"bold",className:"reward-subtitle",colorOverride:"#252525",children:x})]})}}]);return e}(nb.Component),nF=nk;import{useState as nO}from"react";import{FaExclamationTriangle as nN}from"react-icons/fa";import{NsTypography as nS}from"@nuskin/foundation-ui-components";import{CircularProgressbarWithChildren as nB,buildStyles as nV}from"react-circular-progressbar";F();import{Fragment as nR,jsx as nE,jsxs as nP}from"react/jsx-runtime";var nZ=function(n){var e,r;var o=m(nO(!1),2),t=o[0],i=o[1],a=function(){i(!t)},l=n.handleOpenSubscriptionRewardPopup,c=l===void 0?function(){}:l,u=n.notQualifyForRewardThisMonth,s=u===void 0?!1:u,d=n.value,p=d===void 0?0:d,v=n.voucherValue,h=v===void 0?0:v,f=n.amountShow,y=n.maxMonths,g=y===void 0?0:y,b=n.translationConfig,w=b===void 0?{voucherTargetAmount:"",monthsComplete:"",voucherEarned:"",learnMore:"",learn3xMore:"",callToAction:"",notQualify:"",approximateMonthly:"",approximateTotal:"",currentlyTrack:"",loyaltyLogoBlack:"",estimateDisclaimer:""}:b,x=n.learnMoreConfig,C=x===void 0?{tagLine:"",cardOneDescription:"",cardOneVoucherAmount:"",cardTwoDescription:"",cardTwoVoucherAmount:"",header:"",loyaltyLogoWhite:"",loyaltyBanner:"",learnMore:""}:x,_=n.storeConfig,M=_===void 0?{tiers:[{consecutive_months:"",min_spend:"",max_spend:"",promo_code:""},{consecutive_months:"",min_spend:"",promo_code:""}]}:_,L=n.currencyAbbreviate,T=L===void 0?!1:L,A=n.currencyFormat,F=A===void 0?function(){}:A,O="";h===50&&!s?O=w.learn3xMore:h===150||s?O=C.learnMore:h==null&&(O=w.learnMore);var N=nu(w.monthsComplete,{completed_months:p,total_months:g}),S=F(h||0,!0,T),B=w.voucherEarned.replace("%currency_symbol%%currency_amount%","".concat(S)),V=w.currentlyTrack.replace("%currency_symbol%%currency_amount%","".concat(S)),R=nu(w.approximateTotal,{currency_symbol:"",projected_month_spend:""}),E=parseFloat(String(M===null||M===void 0?void 0:(r=M.tiers)===null||r===void 0?void 0:(e=r[0])===null||e===void 0?void 0:e.min_spend))||0,P=F(E,!0,T),Z=w.callToAction.replace("%currency_symbol%%current_spend_target%","".concat(P)),U=nu(w.approximateMonthly,{currency_symbol:"",estimated_running_subscription_spend:""}),K=nu(w.voucherTargetAmount,{currency_symbol:"",voucher_amount:""}),X=F(f!==null&&f!==void 0?f:0,!1,!1);return nP(D,{children:[nE(Q,{children:nE("img",{className:"reward-logo",src:w.loyaltyLogoBlack,alt:"Rewards Logo"})}),nE("div",{className:"reward-progress",children:nP(nB,{value:p/g*100,strokeWidth:12,background:!0,styles:nV({rotation:.5,strokeLinecap:"butt",backgroundColor:p===g&&!s?"rgb(195 240 194)":"#fff",pathColor:"#6BC56A",trailColor:"#E0E0E0"}),children:[nE($,{count:g}),p===g&&!s?nE(no,{}):s?nE(Y,{children:nE(nN,{className:"outline-exclamation-icon",color:"#91ACC8"})}):h!=null||h!=null?nP(I,{children:[nE(nS,{component:"div",className:"center-value-progress-bar-price",variant:"title-l",weight:"bold",children:"".concat(S)}),nE(nS,{variant:"label-s",weight:"bold",component:"div",className:"center-value-progress-bar-voucher",children:K})]}):nE(I,{children:nE(nl,{})})]})}),nE(Q,{children:p===g&&f!==void 0&&f>E?nE("div",{className:"info-item",children:B}):nE("div",{className:"info-item",children:N})}),nP(z,{children:[p===g?"":s?nP(nS,{variant:"body-s",weight:"normal",className:"reward-subtitle",colorOverride:"#252525",component:"div",children:[R," ",nE(nS,{component:"span",className:"button-price",variant:"body-s",weight:"bold",children:"".concat(X)})]}):h!=null||h!=null?nE(nS,{variant:"body-s",weight:"bold",className:"reward-subtitle",colorOverride:"#252525",children:V}):nE(nS,{variant:"body-s",weight:"bold",className:"reward-subtitle",colorOverride:"#252525",children:Z}),nE(H,{children:s?nP(nR,{children:[nE(Y,{children:nE(nN,{className:"loyalty-warning-icon",color:"#4A6987"})}),nE(nS,{variant:"body-s",weight:"normal",className:"reward-subtitle",colorOverride:"#293A4A",noSpacing:!0,children:w.notQualify})]}):nP(nR,{children:[nP(nS,{variant:"body-s",weight:"normal",colorOverride:"#252525",className:"reward-subtitle",component:"span",noSpacing:!0,children:[U," "]}),"\xa0",nE(nS,{weight:"bold",className:"button-price",variant:"body-s",component:"span",children:"".concat(X)}),nE(Y,{children:nE(k,{slotProps:{tooltip:{sx:{color:"#FFFFFF",backgroundColor:"#252525",fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"20px","& .MuiTooltip-arrow":{color:"#252525"}}}},title:w.estimateDisclaimer,arrow:!0,placement:"top",open:t,onClose:function(){return i(!1)},children:nE("span",{className:"info-icon",children:nE(j,{onClick:a,children:nE(nL,{})})})})})]})})]}),nE(Q,{children:nE(W,{onClick:c,children:nE("u",{children:O})})})]})},nD=nZ;var nQ=(typeof window==="undefined"?"undefined":h(window))=="object",nW=/*#__PURE__*/function(){"use strict";function n(){t(this,n);this.width=nQ?window.innerWidth:0;this.scroll={vertical:nQ?window.scrollY:0,horizontal:nQ?window.scrollX:0,direction:"none"}}a(n,[{key:"isMobile",get:function n(){return this.isPhone}},{key:"isPhone",get:function n(){return nQ?window.innerWidth<768:this.width<768}}]);return n}(),nI=new nW;var nz=function(n,e,r,o,t,i,a,l,c){if(n){var u,s,d;var p,m;var v=n===null||n===void 0?void 0:(u=n.csmMonthlySubsOrderTotal)===null||u===void 0?void 0:u.sort(function(n,e){return n.year===e.year?e.month-n.month:e.year-n.year}),h=v===null||v===void 0?void 0:v.some(function(n){return n.month===c.getMonth()+1&&n.year===c.getFullYear()}),f=v===null||v===void 0?void 0:v.filter(function(n){return n.month===c.getMonth()+1&&n.year===c.getFullYear()}),y=(p=f===null||f===void 0?void 0:(s=f.map(function(n){return n.totalAmount}))===null||s===void 0?void 0:s[0])!==null&&p!==void 0?p:0,g=parseInt((m=n===null||n===void 0?void 0:(d=n.approximateMonthlyTotalResponse)===null||d===void 0?void 0:d.currentMonthTotal)!==null&&m!==void 0?m:"0"),b=0;g>r?b=r:b=e;var w=f===null||f===void 0?void 0:f.some(function(n){return n.totalAmount>=b}),x=h&&w?new Date(c.getFullYear(),c.getMonth()-(l-1),1):new Date(c.getFullYear(),c.getMonth()-l,1),C=v===null||v===void 0?void 0:v.filter(function(n){return new Date(n.year,n.month-1)>=x});C=C===null||C===void 0?void 0:C.filter(function(n){return n.promocode===null||n.promocode===void 0||n.promocode===""}),w||(C=C===null||C===void 0?void 0:C.filter(function(n){return!(n.month===c.getMonth()+1&&n.year===c.getFullYear())}));var _=C===null||C===void 0?void 0:C.slice(0,l),M=_===null||_===void 0?void 0:_.every(function(n){return n.totalAmount>=r}),L=_===null||_===void 0?void 0:_.map(function(n){return n===null||n===void 0?void 0:n.promocode}),T=!(L===null||L===void 0?void 0:L.some(function(n){return n===void 0}))?!1:L===null||L===void 0?void 0:L.every(function(n){return n===L[0]}),A=w?c.getMonth():c.getMonth()-1,j=2;if(_!=null&&L!=null)for(var k=0;k<(_===null||_===void 0?void 0:_.length);k++){var F,O,N;var S=(F=_[k])===null||F===void 0?void 0:F.totalAmount,B=c.getFullYear();if(((O=_[k])===null||O===void 0?void 0:O.month)&&((N=_[k])===null||N===void 0?void 0:N.month)!==new Date(B,A-k).getMonth()+1)return{monthCompletionValue:a,voucherValue:i};if(T&&(L[k]!==void 0||L[k]!==""||L[k]!==null))return{monthCompletionValue:0,voucherValue:i};if(S>=e&&(!L[k]||L[k]===void 0||L[k]===""||L[k]===null))a=a+1,M||j===2&&S>=r?i=t:(i=o,j=1);else if(S<e)return{monthCompletionValue:a,voucherValue:i}}(!h||!w)&&i!==o&&(g>=r?i=t:i=o),!w&&i===o&&a<l&&y>=e&&(a=a+1)}return{monthCompletionValue:a,voucherValue:i}};import{Fragment as nH,jsx as nY,jsxs as nU}from"react/jsx-runtime";var nK=function(n){var e,r,o,t,i,a,l,c,u;var s,d,p;var v=n.title,h=n.subscriptionData,f=n.translationConfig,y=n.learnMoreConfig,g=n.storeConfig,b=n.currencyFormat,w=2,x=(s=g===null||g===void 0?void 0:(r=g.tiers)===null||r===void 0?void 0:(e=r[0])===null||e===void 0?void 0:e.max_spend)!==null&&s!==void 0?s:0,C=(d=g===null||g===void 0?void 0:(t=g.tiers)===null||t===void 0?void 0:(o=t[0])===null||o===void 0?void 0:o.min_spend)!==null&&d!==void 0?d:0,_=(p=g===null||g===void 0?void 0:(a=g.tiers)===null||a===void 0?void 0:(i=a[0])===null||i===void 0?void 0:i.consecutive_months)!==null&&p!==void 0?p:0,M=m(B(!1),2),L=M[0],T=M[1],A=function(){return T(!0)},j=function(){return T(!1)},k=h,F=0,O=0,N=0;g===null||g===void 0?void 0:(l=g.tiers)===null||l===void 0?void 0:l.map(function(n){n.min_spend<C&&(C=n.min_spend),"max_spend"in n&&n.max_spend>x&&(x=n.max_spend)}),g===null||g===void 0?void 0:(c=g.tiers)===null||c===void 0?void 0:c.map(function(n){if(n.min_spend===C){var e,r;var o=n.promo_code;o=o===null||o===void 0?void 0:(r=o.split("-"))===null||r===void 0?void 0:(e=r[0])===null||e===void 0?void 0:e.replace("NSR",""),F=parseInt(o)}if(n.min_spend===x){var t,i;var a=n.promo_code;a=a===null||a===void 0?void 0:(i=a.split("-"))===null||i===void 0?void 0:(t=i[0])===null||t===void 0?void 0:t.replace("NSR",""),O=parseInt(a)}});var V;var R=0,E=parseInt((V=k===null||k===void 0?void 0:(u=k.approximateMonthlyTotalResponse)===null||u===void 0?void 0:u.currentMonthTotal)!==null&&V!==void 0?V:"0");E<C||E<x?R=F:E>x?R=O:R=0;var P=E<C&&R!==0&&w!==_,D=nz(k,C,x,F,O,R,N,_,new Date),Q=D.monthCompletionValue,W=D.voucherValue;return w=Q,R=W,nU(Z,{children:[nI.isMobile?nY(nD,{value:w,title:v,voucherValue:R,maxMonths:_,handleOpenSubscriptionRewardPopup:A,storeConfig:g,amountShow:E,notQualifyForRewardThisMonth:P,translationConfig:f,learnMoreConfig:y,currencyAbbreviate:g===null||g===void 0?void 0:g.currencyAbbreviate,currencyFormat:b}):nU(nH,{children:[nY(ng,{value:w,title:v,notQualifyForRewardThisMonth:P,monthCompletionValue:N,storeConfig:g,maxMonths:_,voucherValue:R,handleOpenSubscriptionRewardPopup:A,translationConfig:f,learnMoreConfig:y,currencyAbbreviate:g===null||g===void 0?void 0:g.currencyAbbreviate,currencyFormat:b}),nY(nF,{notQualifyForRewardThisMonth:P,value:w,voucherValue:R,maxMonths:_,title:v,monthCompletionValue:N,storeConfig:g,translationConfig:f,learnMoreConfig:y,handleOpenSubscriptionRewardPopup:A,amountShow:E,currencyAbbreviate:g===null||g===void 0?void 0:g.currencyAbbreviate,currencyFormat:b})]}),nY(S,{show:L,close:j,amountShow:E,learnMoreConfig:y,translationConfig:f})]})},nX=nK;export{nX as SubscriptionReward};//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/gitlab-runner-data/builds/nextgen-development/loyalty/npm/react-loyalty-elements/dist/CircularProgressBar/index.mjs","../../src/CircularProgressBar/SubscriptionReward.tsx","../../src/CircularProgressBar/RewardProgressBar.tsx","../../src/CircularProgressBar/CircularProgressBar.styled.tsx","../../src/CircularProgressBar/RadialSeparator.tsx","../../src/Icons/SubscriptionVoucherIcon.tsx","../../src/Icons/SubscriptionVoucherIconGrey.tsx","../../src/CircularProgressBar/RewardSubscriptionMonthDescription.tsx","../../src/Utils/helper.ts","../../src/CircularProgressBar/RewardSubscriptionTotal.tsx","../../src/Icons/Info.tsx","../../src/CircularProgressBar/SubscriptionRewardMobile.tsx","../../src/Utils/application/application.ts","../../src/CircularProgressBar/logic/calculateMonthCompletionValues.ts"],"names":["a","$","b","H","c","pe","d","Re","e","Le","v","ce","useState","React","CircularProgressbarWithChildren","buildStyles","import_foundation_theme","RewardProgressBarContainer","M","styled","div","LoyaltyProgressSubContainer","StyledCard","Learn3XLink","ProgressBarCenter","RewardProgressTotalContainer","RewardProgressTotalButtonWithIcon","IconContainer","span","SeparatorCard","SeparatorInnerCard","jsx","Separator","props","style","transform","turns","children","RadialSeparators","count","Array","fill","map","_","index","RadialSeparator_default","FaExclamationTriangle","jsxs","SubscriptionVoucherIcon","width","height","viewBox","xmlns","SubscriptionVoucherIcon_default","SubscriptionVoucherIconGrey","SubscriptionVoucherIconGrey_default","replacePlaceholders","template","values","Object","keys","reduce","result","key","value","replace","RegExp","String","RewardSubscriptionMonthDescription","render","voucherValue","maxMonths","handleOpenSubscriptionRewardPopup","notQualifyForRewardThisMonth","translationConfig","voucherTargetAmount","monthsComplete","voucherEarned","learnMore","learn3xMore","callToAction","notQualify","approximateMonthly","approximateTotal","currentlyTrack","loyaltyLogoBlack","learnMoreConfig","tagLine","cardOneDescription","cardOneVoucherAmount","cardTwoDescription","cardTwoVoucherAmount","header","loyaltyLogoWhite","loyaltyBanner","currencyAbbreviate","currencyFormat","popupText","monthsCompleteText","completed_months","total_months","voucherEarnedText","className","src","alt","id","onClick","Component","RewardSubscriptionMonthDescription_default","NsTypography","RewardProgressBar","currency_symbol","voucher_amount","strokeWidth","background","styles","rotation","strokeLinecap","backgroundColor","pathColor","trailColor","color","component","variant","weight","RewardProgressBar_default","Info","fillRule","clipRule","x1","y1","x2","y2","stroke","Info_default","init_material","Fragment","RewardSubscriptionTotal","storeConfig","amountShow","estimateDisclaimer","tiers","consecutive_months","min_spend","max_spend","promo_code","currentlyTrackText","approximateTotalText","projected_month_spend","minAmount","parseFloat","minAmountShow","callToActionText","approximateMonthlyText","estimated_running_subscription_spend","amountShowText","colorOverride","noSpacing","Tooltip_default","slotProps","tooltip","sx","fontFamily","fontWeight","fontSize","lineHeight","title","arrow","placement","IconButton_default","RewardSubscriptionTotal_default","SubscriptionRewardMobile","open","setOpen","handleTooltipToggle","onClose","SubscriptionRewardMobile_default","IS_BROWSER","window","ApplicationStore","innerWidth","scroll","vertical","scrollY","horizontal","scrollX","direction","isMobile","isPhone","applicationContainer","calculateMonthCompletionValues","data","maxAmount","minVoucher","maxVoucher","monthCompletionValue","today","currentMonthData","sortedRecords","csmMonthlySubsOrderTotal","sort","year","month","hasCurrentMonthData","some","record","getMonth","getFullYear","filter","sub","currentMonthTotalAmount","totalAmount","approxMonthTotal","parseInt","approximateMonthlyTotalResponse","currentMonthTotal","currentMonthEligibleAmount","isCurrentMonthEligible","threeMonthsAgo","Date","threeMonthsRecords","promocode","lastThreeMonths","slice","allMonthsAboveMaxAmount","every","promoCodes","allSamePromoCode","code","todayMonth","tier","i","length","todayYear","SubscriptionReward","rewardData","subscriptionData","show","setShow","handleOpen","handleClose","split","calculatedMonthCompletionValue","calculatedVoucherValue","SubscriptionRewardModal","close","SubscriptionReward_default"],"mappings":"iiMAAA,OAAOA,KAAKC,CAAC,CAACC,KAAKC,CAAC,CAACC,KAAKC,CAAE,CAACC,KAAKC,CAAE,KAAK,uBAAwB,QAAOC,KAAKC,CAAE,CAACC,KAAKC,CAAE,KAAK,uBCA5F,QAAgBC,YAAAA,CAAAA,KAAgB,OCAhC,QAAOC,MAAW,OAClB,QAASC,mCAAAA,CAAAA,CAAiCC,eAAAA,CAAAA,KAAmB,4BCD7D,CAAA,IAAAC,EAAuBP,EAAAF,KAEVU,EAA6BC,EAAAC,MAAA,CAAOC,GAAA,MAmBpCC,EAA8BH,EAAAC,MAAA,CAAOC,GAAA,MAiCrCE,EAAaJ,EAAAC,MAAA,CAAOC,GAAA,MAWpBG,EAAcL,EAAAC,MAAA,CAAOC,GAAA,MAKrBI,EAAoBN,EAAAC,MAAA,CAAOC,GAAA,MAgB3BK,EAA+BP,EAAAC,MAAA,CAAOC,GAAA,MA8BtCM,EAAoCR,EAAAC,MAAA,CAAOC,GAAA,MAgB3CO,EAAgBT,EAAAC,MAAA,CAAOS,IAAA,MAoBvBC,EAAgBX,EAAAC,MAAA,CAAOC,GAAA,MAKvBU,EAAqBZ,EAAAC,MAAA,CAAOC,GAAA,KCnJ7B,QAAAW,OAAAA,CAAAA,KAAA,mBAPZ,CAAA,SAASC,EAAUC,CAAAA,EACf,OACIF,EAACF,EAAA,CACGK,MAAO,CACHC,UAAW,UAAqB,OAAXF,EAAMG,KAAK,CAAA,QACpC,EAEAC,SAAAN,EAACD,EAAA,CAAA,EAAmB,EAGhC,CAEA,SAASQ,EAAiBL,CAAAA,EACtB,IAAMG,EAAQ,EAAIH,EAAMM,KAAA,CACxB,OAAOC,MAAMP,EAAMM,KAA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CpG,WAAYA,EACZ5C,kBAAA,CAAoB2C,UAAAA,kBAAAA,EAAa3C,kBAAA,CACjCC,eAAgBA,CAAAA,GACpB,GAGRjE,GAACqN,EAAA,CACGP,KAAMA,EACNQ,MAAOL,EACPrG,WAAYA,EACZrD,gBAAiBA,EACjBZ,kBAAmBA,CAAAA,GACvB,EAGZ,EAEO4K,GAAQZ,UAAAA,MAAAA,kBAAAA","sourcesContent":["import{a as $,b as H,c as pe,d as Re}from\"../chunk-B5UVKXR6.mjs\";import{e as Le,v as ce}from\"../chunk-YZGRTK3A.mjs\";import{useState as Xe}from\"react\";import Ie from\"react\";import{CircularProgressbarWithChildren as Ee,buildStyles as Ve}from\"react-circular-progressbar\";var M=Le(Re()),me=M.styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n align-content: center;\n background-color: #f5f5f5;\n border: 1px solid #e0e0e0;\n border-radius: 10px;\n padding: 1.5rem;\n margin-bottom: 20px;\n height: 50%;\n margin: auto;\n\n @media (max-width: 950px) {\n flex-direction: column;\n }\n`,Y=M.styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n align-content: center;\n\n .reward-logo {\n width: 200px;\n margin-bottom: 12px;\n }\n\n .reward-progress {\n height: 150px;\n width: 150px;\n }\n .progress-bar {\n background-color: #e0e0e0;\n height: 100%;\n }\n\n @media (max-width: 950px) {\n flex-direction: column;\n\n .info-container {\n margin-left: 0px;\n align-items: center;\n }\n .reward-progress-total-div {\n margin-top: 10px;\n }\n }\n`,I=M.styled.div`\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-left: 16px;\n\n .info-item {\n margin: 5px 0;\n font-weight: 600;\n }\n`,z=M.styled.div`\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n`,E=M.styled.div`\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n color: black;\n\n .center-value-progress-bar-price {\n margin: 0;\n }\n .center-value-progress-bar-voucher {\n margin: 0;\n letter-spacing: 0.01em;\n }\n`,X=M.styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n\n .total-button {\n display: flex;\n align-items: center;\n background-color: #e5edf6;\n border-radius: 20px;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n }\n .reward-subtitle {\n letter-spacing: 0;\n display: flex;\n }\n\n @media (max-width: 950px) {\n .reward-subtitle {\n letter-spacing: 0;\n display: flex;\n text-align: center;\n }\n margin-top: 10px;\n }\n`,G=M.styled.div`\n display: flex;\n align-items: center;\n background-color: #e5edf6;\n border-radius: 20px;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n padding: 1rem;\n margin-bottom: 14px;\n\n @media (max-width: 950px) {\n margin-top: 14px;\n }\n`,P=M.styled.span`\n .info-icon {\n margin-left: 6px !important;\n }\n .loyalty-icon {\n height: 19px !important;\n width: 19px !important;\n margin-left: 6px !important;\n }\n .loyalty-warning-icon {\n height: 19px !important;\n width: 19px !important;\n margin-right: 6px !important;\n }\n .outline-exclamation-icon {\n height: 48px !important;\n width: 48px !important;\n }\n`,ue=M.styled.div`\n position: absolute;\n height: 100%;\n`,de=M.styled.div`\n background: #fff;\n width: 6px;\n height: 17%;\n`;import{jsx as oe}from\"react/jsx-runtime\";function Se(d){return oe(ue,{style:{transform:`rotate(${d.turns}turn)`},children:oe(de,{})})}function Pe(d){let n=1/d.count;return Array(d.count).fill(null).map((a,c)=>oe(Se,{turns:c*n+.5},c))}var q=Pe;import{FaExclamationTriangle as De}from\"react-icons/fa\";import{jsx as V,jsxs as Be}from\"react/jsx-runtime\";function _e(){return Be(\"svg\",{width:\"71\",height:\"42\",viewBox:\"0 0 71 42\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[V(\"path\",{d:\"M5.32847 36.176C3.52571 36.176 2.06348 34.7138 2.06348 32.911L2.15695 28.3574L4.8277 28.4108L4.73422 32.9378C4.73422 33.2382 5.0013 33.5053 5.32847 33.5053H30.7606L34.0056 33.3584L34.1258 36.0291L30.8207 36.1827H5.32847V36.176Z\",fill:\"#405E50\"}),V(\"path\",{d:\"M68.3914 12.9147H65.7207V9.1156C65.7207 8.78843 65.4536 8.52136 65.1264 8.52136L36.3491 8.48129V5.81055L65.1264 5.85061C66.9225 5.85061 68.3914 7.31284 68.3914 9.1156V12.9147Z\",fill:\"#405E50\"}),V(\"path\",{d:\"M62.3222 41.6454C62.1152 41.6454 61.9082 41.6253 61.7012 41.5853L2.99822 30.2079C2.14358 30.041 1.40245 29.5536 0.915037 28.8325C0.427626 28.1114 0.24735 27.2434 0.414272 26.3821L4.94119 3.0197C5.10811 2.16506 5.59552 1.42393 6.31662 0.936522C7.03772 0.44911 7.90572 0.268835 8.76703 0.435756L67.47 11.8131C69.2394 12.1537 70.3945 13.8696 70.054 15.639L65.5271 39.0013C65.2199 40.5637 63.8512 41.6454 62.3222 41.6454ZM62.2087 38.968C62.5225 39.028 62.843 38.8211 62.9031 38.5006L67.43 15.1382C67.4901 14.8177 67.2831 14.5039 66.9626 14.4438L8.25291 3.05977C8.04593 3.0197 7.88569 3.09983 7.80556 3.15324C7.73212 3.20666 7.59858 3.32016 7.55184 3.53382L3.02493 26.8962C2.96484 27.2167 3.17182 27.5305 3.49231 27.5906L62.2087 38.968Z\",fill:\"#405E50\"}),V(\"path\",{d:\"M13.5344 22.0957C13.1405 22.0957 12.7398 22.0556 12.3392 21.9822C8.95406 21.3279 6.73066 18.0362 7.385 14.651C7.70549 13.0085 8.64025 11.593 10.029 10.6582C11.4178 9.72348 13.0804 9.38296 14.7229 9.70345C16.3654 10.0239 17.7809 10.9587 18.7156 12.3475C19.6504 13.7363 19.9909 15.3988 19.6704 17.0413C19.0895 20.0125 16.4655 22.0957 13.5344 22.0957ZM13.521 12.254C12.8133 12.254 12.1189 12.461 11.5247 12.8683C10.7301 13.4024 10.196 14.217 10.009 15.1584C9.6351 17.1014 10.9037 18.9843 12.8467 19.3582C14.7896 19.7321 16.6725 18.4635 17.0464 16.5205C17.2267 15.5791 17.0331 14.6243 16.4989 13.8298C15.9648 13.0352 15.1502 12.5011 14.2088 12.3141C13.9817 12.274 13.7481 12.254 13.521 12.254Z\",fill:\"#405E50\"}),V(\"path\",{d:\"M23.9338 15.4855L23.4255 18.1074L59.9361 25.1845L60.4443 22.5626L23.9338 15.4855Z\",fill:\"#405E50\"}),V(\"path\",{d:\"M22.8916 19.7002L22.3838 22.3223L58.8956 29.393L59.4034 26.771L22.8916 19.7002Z\",fill:\"#405E50\"})]})}var J=_e;import{jsx as D,jsxs as Ne}from\"react/jsx-runtime\";function Ae(){return Ne(\"svg\",{width:\"71\",height:\"42\",viewBox:\"0 0 71 42\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[D(\"path\",{d:\"M5.32847 36.176C3.52571 36.176 2.06348 34.7138 2.06348 32.911L2.15695 28.3574L4.8277 28.4108L4.73422 32.9378C4.73422 33.2382 5.0013 33.5053 5.32847 33.5053H30.7606L34.0056 33.3584L34.1258 36.0291L30.8207 36.1827H5.32847V36.176Z\",fill:\"#B0B0B0\"}),D(\"path\",{d:\"M68.3914 12.9147H65.7207V9.1156C65.7207 8.78843 65.4536 8.52136 65.1264 8.52136L36.3491 8.48129V5.81055L65.1264 5.85061C66.9225 5.85061 68.3914 7.31284 68.3914 9.1156V12.9147Z\",fill:\"#B0B0B0\"}),D(\"path\",{d:\"M62.3222 41.6454C62.1152 41.6454 61.9082 41.6253 61.7012 41.5853L2.99822 30.2079C2.14358 30.041 1.40245 29.5536 0.915037 28.8325C0.427626 28.1114 0.24735 27.2434 0.414272 26.3821L4.94119 3.0197C5.10811 2.16506 5.59552 1.42393 6.31662 0.936522C7.03772 0.44911 7.90572 0.268835 8.76703 0.435756L67.47 11.8131C69.2394 12.1537 70.3945 13.8696 70.054 15.639L65.5271 39.0013C65.2199 40.5637 63.8512 41.6454 62.3222 41.6454ZM62.2087 38.968C62.5225 39.028 62.843 38.8211 62.9031 38.5006L67.43 15.1382C67.4901 14.8177 67.2831 14.5039 66.9626 14.4438L8.25291 3.05977C8.04593 3.0197 7.88569 3.09983 7.80556 3.15324C7.73212 3.20666 7.59858 3.32016 7.55184 3.53382L3.02493 26.8962C2.96484 27.2167 3.17182 27.5305 3.49231 27.5906L62.2087 38.968Z\",fill:\"#B0B0B0\"}),D(\"path\",{d:\"M13.5344 22.0957C13.1405 22.0957 12.7398 22.0556 12.3392 21.9822C8.95406 21.3279 6.73066 18.0362 7.385 14.651C7.70549 13.0085 8.64025 11.593 10.029 10.6582C11.4178 9.72348 13.0804 9.38296 14.7229 9.70345C16.3654 10.0239 17.7809 10.9587 18.7156 12.3475C19.6504 13.7363 19.9909 15.3988 19.6704 17.0413C19.0895 20.0125 16.4655 22.0957 13.5344 22.0957ZM13.521 12.254C12.8133 12.254 12.1189 12.461 11.5247 12.8683C10.7301 13.4024 10.196 14.217 10.009 15.1584C9.6351 17.1014 10.9037 18.9843 12.8467 19.3582C14.7896 19.7321 16.6725 18.4635 17.0464 16.5205C17.2267 15.5791 17.0331 14.6243 16.4989 13.8298C15.9648 13.0352 15.1502 12.5011 14.2088 12.3141C13.9817 12.274 13.7481 12.254 13.521 12.254Z\",fill:\"#B0B0B0\"}),D(\"path\",{d:\"M23.9338 15.4855L23.4255 18.1074L59.9361 25.1845L60.4443 22.5626L23.9338 15.4855Z\",fill:\"#B0B0B0\"}),D(\"path\",{d:\"M22.8916 19.7002L22.3838 22.3223L58.8956 29.393L59.4034 26.771L22.8916 19.7002Z\",fill:\"#B0B0B0\"})]})}var K=Ae;import Fe from\"react\";var v=(d,n)=>Object.keys(n).reduce((a,c)=>{let u=n[c]??\"\";return a.replace(new RegExp(`%${c}%`,\"g\"),String(u))},d);import{jsx as Z,jsxs as ke}from\"react/jsx-runtime\";var te=class extends Fe.Component{constructor(n){super(n)}render(){let{value:n,voucherValue:a,maxMonths:c,handleOpenSubscriptionRewardPopup:u,notQualifyForRewardThisMonth:r,translationConfig:o={voucherTargetAmount:\"\",monthsComplete:\"\",voucherEarned:\"\",learnMore:\"\",learn3xMore:\"\",callToAction:\"\",notQualify:\"\",approximateMonthly:\"\",approximateTotal:\"\",currentlyTrack:\"\",loyaltyLogoBlack:\"\"},learnMoreConfig:p={tagLine:\"\",cardOneDescription:\"\",cardOneVoucherAmount:\"\",cardTwoDescription:\"\",cardTwoVoucherAmount:\"\",header:\"\",loyaltyLogoWhite:\"\",loyaltyBanner:\"\",learnMore:\"\"},currencyAbbreviate:t=!1,currencyFormat:i=()=>{}}=this.props,l=\"\";a===50&&!r?l=o.learn3xMore:a===150||r?l=p.learnMore:a==null&&(l=o.learnMore);let y=v(o.monthsComplete,{completed_months:n,total_months:c}),C=i(a||0,!0,t),h=o.voucherEarned.replace(\"%currency_symbol%%currency_amount%\",`${C}`);return ke(I,{children:[Z(\"img\",{className:\"reward-logo\",src:o.loyaltyLogoBlack,alt:\"Rewards Logo\"}),n===c?Z(\"div\",{className:\"info-item\",children:h}):Z(\"div\",{className:\"info-item\",children:y}),Z(z,{id:\"learnMore\",onClick:u,children:Z(\"u\",{children:l})})]})}},he=te;import{NsTypography as fe}from\"@nuskin/foundation-ui-components\";import{jsx as L,jsxs as ne}from\"react/jsx-runtime\";var ae=class extends Ie.Component{constructor(n){super(n)}render(){let{value:n=0,voucherValue:a=0,maxMonths:c=0,handleOpenSubscriptionRewardPopup:u=()=>{},notQualifyForRewardThisMonth:r=!1,translationConfig:o={voucherTargetAmount:\"\",monthsComplete:\"\",voucherEarned:\"\",learnMore:\"\",learn3xMore:\"\",callToAction:\"\",notQualify:\"\",approximateMonthly:\"\",approximateTotal:\"\",currentlyTrack:\"\",loyaltyLogoBlack:\"\"},learnMoreConfig:p={tagLine:\"\",cardOneDescription:\"\",cardOneVoucherAmount:\"\",cardTwoDescription:\"\",cardTwoVoucherAmount:\"\",header:\"\",loyaltyLogoWhite:\"\",loyaltyBanner:\"\",learnMore:\"\"},currencyAbbreviate:t=!1,currencyFormat:i=()=>{}}=this.props,l=v(o.voucherTargetAmount,{currency_symbol:\"\",voucher_amount:\"\"}),T=i(a||0,!0,t);return ne(Y,{children:[L(\"div\",{className:\"reward-progress\",children:ne(Ee,{value:n/c*100,strokeWidth:12,background:!0,styles:Ve({rotation:.5,strokeLinecap:\"butt\",backgroundColor:n===c&&!r?\"rgb(195 240 194)\":\"#fff\",pathColor:\"#6BC56A\",trailColor:\"#E0E0E0\"}),children:[L(q,{count:c}),n===c&&!r?L(J,{}):r?L(P,{children:L(De,{className:\"outline-exclamation-icon\",color:\"#91ACC8\"})}):a!=null||a!=null?ne(E,{children:[L(fe,{component:\"div\",className:\"center-value-progress-bar-price\",variant:\"title-l\",weight:\"bold\",children:`${T}`}),L(fe,{variant:\"label-s\",weight:\"bold\",component:\"div\",className:\"center-value-progress-bar-voucher\",children:l})]}):L(E,{children:L(K,{})})]})}),L(he,{value:n,voucherValue:a,notQualifyForRewardThisMonth:r,handleOpenSubscriptionRewardPopup:u,maxMonths:c,translationConfig:o,learnMoreConfig:p,currencyAbbreviate:t,currencyFormat:i})]})}},ge=ae;import Ze from\"react\";import{FaExclamationTriangle as Qe}from\"react-icons/fa\";import{NsTypography as N}from\"@nuskin/foundation-ui-components\";import{jsx as ie,jsxs as We}from\"react/jsx-runtime\";function Oe(){return We(\"svg\",{width:\"19\",height:\"19\",viewBox:\"0 0 20 20\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[ie(\"path\",{fillRule:\"evenodd\",clipRule:\"evenodd\",d:\"M0.833344 9.99967C0.833344 4.93706 4.9374 0.833008 10 0.833008C15.0626 0.833008 19.1667 4.93706 19.1667 9.99967C19.1667 15.0623 15.0626 19.1663 10 19.1663C4.9374 19.1663 0.833344 15.0623 0.833344 9.99967ZM10 2.49967C5.85787 2.49967 2.50001 5.85754 2.50001 9.99967C2.50001 14.1418 5.85787 17.4997 10 17.4997C14.1421 17.4997 17.5 14.1418 17.5 9.99967C17.5 5.85754 14.1421 2.49967 10 2.49967Z\",fill:\"#4A6987\"}),ie(\"line\",{x1:\"10.1667\",y1:\"9.375\",x2:\"10.1667\",y2:\"14.7917\",stroke:\"#4A6987\",strokeWidth:\"2\"}),ie(\"path\",{d:\"M10.0052 7.75009C10.6338 7.75009 11.1718 7.22807 11.1771 6.57821C11.1718 5.93901 10.6338 5.41699 10.0052 5.41699C9.35537 5.41699 8.82803 5.93901 8.83335 6.57821C8.82803 7.22807 9.35537 7.75009 10.0052 7.75009Z\",fill:\"#4A6987\"})]})}var U=Oe;pe();import{Fragment as ye,jsx as b,jsxs as j}from\"react/jsx-runtime\";var le=class extends Ze.Component{constructor(n){super(n)}render(){let{value:n,voucherValue:a,maxMonths:c,notQualifyForRewardThisMonth:u,amountShow:r,translationConfig:o={voucherTargetAmount:\"\",monthsComplete:\"\",voucherEarned:\"\",learnMore:\"\",learn3xMore:\"\",callToAction:\"\",notQualify:\"\",approximateMonthly:\"\",approximateTotal:\"\",currentlyTrack:\"\",loyaltyLogoBlack:\"\",estimateDisclaimer:\"\"},storeConfig:p={tiers:[{consecutive_months:0,min_spend:0,max_spend:0,promo_code:\"\"},{consecutive_months:0,min_spend:0,promo_code:\"\"}]},currencyAbbreviate:t=!1,currencyFormat:i=()=>{}}=this.props,l=i(a||0,!0,t),T=o.currentlyTrack.replace(\"%currency_symbol%%currency_amount%\",`${l}`),R=v(o.approximateTotal,{currency_symbol:\"\",projected_month_spend:\"\"}),y=parseFloat(String(p?.tiers?.[0]?.min_spend))||0,C=i(y,!0,t),h=o.callToAction.replace(\"%currency_symbol%%current_spend_target%\",`${C}`),S=v(o.approximateMonthly,{currency_symbol:\"\",estimated_running_subscription_spend:\"\"}),w=i(r??0,!1,!1);return j(X,{children:[b(G,{children:u?j(ye,{children:[b(P,{children:b(Qe,{className:\"loyalty-warning-icon\",color:\"#4A6987\"})}),b(N,{variant:\"body-s\",weight:\"normal\",className:\"reward-subtitle\",colorOverride:\"#293A4A\",noSpacing:!0,children:o.notQualify})]}):j(ye,{children:[b(N,{variant:\"body-s\",weight:\"normal\",colorOverride:\"#252525\",className:\"reward-subtitle\",component:\"span\",noSpacing:!0,children:S}),\"\\xA0\",b(N,{weight:\"bold\",className:\"button-price\",variant:\"body-s\",component:\"span\",children:`${w}`}),b(P,{children:b(H,{slotProps:{tooltip:{sx:{color:\"#FFFFFF\",backgroundColor:\"#252525\",fontFamily:\"Inter\",fontWeight:400,fontSize:\"14px\",lineHeight:\"20px\",\"& .MuiTooltip-arrow\":{color:\"#252525\"}}}},title:o.estimateDisclaimer,arrow:!0,placement:\"top\",children:b(\"span\",{className:\"info-icon\",children:b($,{children:b(U,{})})})})})]})}),n===c?\"\":u?j(N,{variant:\"body-s\",weight:\"normal\",className:\"reward-subtitle\",colorOverride:\"#252525\",component:\"div\",children:[R,\"\\xA0\",b(N,{component:\"span\",className:\"button-price\",variant:\"body-s\",weight:\"bold\",children:`${w}`})]}):a!=null||a!=null?b(N,{variant:\"body-s\",weight:\"bold\",className:\"reward-subtitle\",colorOverride:\"#252525\",children:T}):b(N,{variant:\"body-s\",weight:\"bold\",className:\"reward-subtitle\",colorOverride:\"#252525\",children:h})]})}},Ce=le;import{useState as $e}from\"react\";import{FaExclamationTriangle as be}from\"react-icons/fa\";import{NsTypography as _}from\"@nuskin/foundation-ui-components\";import{CircularProgressbarWithChildren as He,buildStyles as Ye}from\"react-circular-progressbar\";pe();import{Fragment as we,jsx as s,jsxs as B}from\"react/jsx-runtime\";var ze=d=>{let[n,a]=$e(!1),c=()=>{a(!n)},{handleOpenSubscriptionRewardPopup:u=()=>{},notQualifyForRewardThisMonth:r=!1,value:o=0,voucherValue:p=0,amountShow:t,maxMonths:i=0,translationConfig:l={voucherTargetAmount:\"\",monthsComplete:\"\",voucherEarned:\"\",learnMore:\"\",learn3xMore:\"\",callToAction:\"\",notQualify:\"\",approximateMonthly:\"\",approximateTotal:\"\",currentlyTrack:\"\",loyaltyLogoBlack:\"\",estimateDisclaimer:\"\"},learnMoreConfig:T={tagLine:\"\",cardOneDescription:\"\",cardOneVoucherAmount:\"\",cardTwoDescription:\"\",cardTwoVoucherAmount:\"\",header:\"\",loyaltyLogoWhite:\"\",loyaltyBanner:\"\",learnMore:\"\"},storeConfig:R={tiers:[{consecutive_months:\"\",min_spend:\"\",max_spend:\"\",promo_code:\"\"},{consecutive_months:\"\",min_spend:\"\",promo_code:\"\"}]},currencyAbbreviate:y=!1,currencyFormat:C=()=>{}}=d,h=\"\";p===50&&!r?h=l.learn3xMore:p===150||r?h=T.learnMore:p==null&&(h=l.learnMore);let x=v(l.monthsComplete,{completed_months:o,total_months:i}),f=C(p||0,!0,y),m=l.voucherEarned.replace(\"%currency_symbol%%currency_amount%\",`${f}`),F=l.currentlyTrack.replace(\"%currency_symbol%%currency_amount%\",`${f}`),O=v(l.approximateTotal,{currency_symbol:\"\",projected_month_spend:\"\"}),k=parseFloat(String(R?.tiers?.[0]?.min_spend))||0,g=C(k,!0,y),e=l.callToAction.replace(\"%currency_symbol%%current_spend_target%\",`${g}`),A=v(l.approximateMonthly,{currency_symbol:\"\",estimated_running_subscription_spend:\"\"}),W=v(l.voucherTargetAmount,{currency_symbol:\"\",voucher_amount:\"\"}),Q=C(t??0,!1,!1);return B(Y,{children:[s(I,{children:s(\"img\",{className:\"reward-logo\",src:l.loyaltyLogoBlack,alt:\"Rewards Logo\"})}),s(\"div\",{className:\"reward-progress\",children:B(He,{value:o/i*100,strokeWidth:12,background:!0,styles:Ye({rotation:.5,strokeLinecap:\"butt\",backgroundColor:o===i&&!r?\"rgb(195 240 194)\":\"#fff\",pathColor:\"#6BC56A\",trailColor:\"#E0E0E0\"}),children:[s(q,{count:i}),o===i&&!r?s(J,{}):r?s(P,{children:s(be,{className:\"outline-exclamation-icon\",color:\"#91ACC8\"})}):p!=null||p!=null?B(E,{children:[s(_,{component:\"div\",className:\"center-value-progress-bar-price\",variant:\"title-l\",weight:\"bold\",children:`${f}`}),s(_,{variant:\"label-s\",weight:\"bold\",component:\"div\",className:\"center-value-progress-bar-voucher\",children:W})]}):s(E,{children:s(K,{})})]})}),s(I,{children:o===i&&t!==void 0&&t>k?s(\"div\",{className:\"info-item\",children:m}):s(\"div\",{className:\"info-item\",children:x})}),B(X,{children:[o===i?\"\":r?B(_,{variant:\"body-s\",weight:\"normal\",className:\"reward-subtitle\",colorOverride:\"#252525\",component:\"div\",children:[O,\" \",s(_,{component:\"span\",className:\"button-price\",variant:\"body-s\",weight:\"bold\",children:`${Q}`})]}):p!=null||p!=null?s(_,{variant:\"body-s\",weight:\"bold\",className:\"reward-subtitle\",colorOverride:\"#252525\",children:F}):s(_,{variant:\"body-s\",weight:\"bold\",className:\"reward-subtitle\",colorOverride:\"#252525\",children:e}),s(G,{children:r?B(we,{children:[s(P,{children:s(be,{className:\"loyalty-warning-icon\",color:\"#4A6987\"})}),s(_,{variant:\"body-s\",weight:\"normal\",className:\"reward-subtitle\",colorOverride:\"#293A4A\",noSpacing:!0,children:l.notQualify})]}):B(we,{children:[B(_,{variant:\"body-s\",weight:\"normal\",colorOverride:\"#252525\",className:\"reward-subtitle\",component:\"span\",noSpacing:!0,children:[A,\" \"]}),\"\\xA0\",s(_,{weight:\"bold\",className:\"button-price\",variant:\"body-s\",component:\"span\",children:`${Q}`}),s(P,{children:s(H,{slotProps:{tooltip:{sx:{color:\"#FFFFFF\",backgroundColor:\"#252525\",fontFamily:\"Inter\",fontWeight:400,fontSize:\"14px\",lineHeight:\"20px\",\"& .MuiTooltip-arrow\":{color:\"#252525\"}}}},title:l.estimateDisclaimer,arrow:!0,placement:\"top\",open:n,onClose:()=>a(!1),children:s(\"span\",{className:\"info-icon\",children:s($,{onClick:c,children:s(U,{})})})})})]})})]}),s(I,{children:s(z,{onClick:u,children:s(\"u\",{children:h})})})]})},xe=ze;var ee=typeof window==\"object\",se=class{constructor(){this.width=ee?window.innerWidth:0;this.scroll={vertical:ee?window.scrollY:0,horizontal:ee?window.scrollX:0,direction:\"none\"}}get isMobile(){return this.isPhone}get isPhone(){return ee?window.innerWidth<768:this.width<768}},ve=new se;var Te=(d,n,a,c,u,r,o,p,t)=>{if(d){let i=d?.csmMonthlySubsOrderTotal?.sort((e,A)=>e.year===A.year?A.month-e.month:A.year-e.year),l=i?.some(e=>e.month===t.getMonth()+1&&e.year===t.getFullYear()),T=i?.filter(e=>e.month===t.getMonth()+1&&e.year===t.getFullYear()),R=T?.map(e=>e.totalAmount)?.[0]??0,y=parseInt(d?.approximateMonthlyTotalResponse?.currentMonthTotal??\"0\"),C=0;y>a?C=a:C=n;let h=T?.some(e=>e.totalAmount>=C),S=l&&h?new Date(t.getFullYear(),t.getMonth()-(p-1),1):new Date(t.getFullYear(),t.getMonth()-p,1),w=i?.filter(e=>new Date(e.year,e.month-1)>=S);w=w?.filter(e=>e.promocode===null||e.promocode===void 0||e.promocode===\"\"),h||(w=w?.filter(e=>!(e.month===t.getMonth()+1&&e.year===t.getFullYear())));let x=w?.slice(0,p),f=x?.every(e=>e.totalAmount>=a),m=x?.map(e=>e?.promocode),O=!m?.some(e=>e===void 0)?!1:m?.every(e=>e===m[0]),k=h?t.getMonth():t.getMonth()-1,g=2;if(x!=null&&m!=null)for(let e=0;e<x?.length;e++){let W=x[e]?.totalAmount,Q=t.getFullYear();if(x[e]?.month&&x[e]?.month!==new Date(Q,k-e).getMonth()+1)return{monthCompletionValue:o,voucherValue:r};if(O&&(m[e]!==void 0||m[e]!==\"\"||m[e]!==null))return{monthCompletionValue:0,voucherValue:r};if(W>=n&&(!m[e]||m[e]===void 0||m[e]===\"\"||m[e]===null))o=o+1,f||g===2&&W>=a?r=u:(r=c,g=1);else if(W<n)return{monthCompletionValue:o,voucherValue:r}}(!l||!h)&&r!==c&&(y>=a?r=u:r=c),!h&&r===c&&o<p&&R>=n&&(o=o+1)}return{monthCompletionValue:o,voucherValue:r}};import{Fragment as Je,jsx as re,jsxs as Me}from\"react/jsx-runtime\";var Ge=d=>{let{title:n,subscriptionData:a,translationConfig:c,learnMoreConfig:u,storeConfig:r,currencyFormat:o}=d,p=2,t=r?.tiers?.[0]?.max_spend??0,i=r?.tiers?.[0]?.min_spend??0,l=r?.tiers?.[0]?.consecutive_months??0,[T,R]=Xe(!1),y=()=>R(!0),C=()=>R(!1),h=a,S=0,w=0,x=0;r?.tiers?.map(g=>{g.min_spend<i&&(i=g.min_spend),\"max_spend\"in g&&g.max_spend>t&&(t=g.max_spend)}),r?.tiers?.map(g=>{if(g.min_spend===i){let e=g.promo_code;e=e?.split(\"-\")?.[0]?.replace(\"NSR\",\"\"),S=parseInt(e)}if(g.min_spend===t){let e=g.promo_code;e=e?.split(\"-\")?.[0]?.replace(\"NSR\",\"\"),w=parseInt(e)}});let f=0,m=parseInt(h?.approximateMonthlyTotalResponse?.currentMonthTotal??\"0\");m<i||m<t?f=S:m>t?f=w:f=0;let F=m<i&&f!==0&&p!==l,{monthCompletionValue:O,voucherValue:k}=Te(h,i,t,S,w,f,x,l,new Date);return p=O,f=k,Me(me,{children:[ve.isMobile?re(xe,{value:p,title:n,voucherValue:f,maxMonths:l,handleOpenSubscriptionRewardPopup:y,storeConfig:r,amountShow:m,notQualifyForRewardThisMonth:F,translationConfig:c,learnMoreConfig:u,currencyAbbreviate:r?.currencyAbbreviate,currencyFormat:o}):Me(Je,{children:[re(ge,{value:p,title:n,notQualifyForRewardThisMonth:F,monthCompletionValue:x,storeConfig:r,maxMonths:l,voucherValue:f,handleOpenSubscriptionRewardPopup:y,translationConfig:c,learnMoreConfig:u,currencyAbbreviate:r?.currencyAbbreviate,currencyFormat:o}),re(Ce,{notQualifyForRewardThisMonth:F,value:p,voucherValue:f,maxMonths:l,title:n,monthCompletionValue:x,storeConfig:r,translationConfig:c,learnMoreConfig:u,handleOpenSubscriptionRewardPopup:y,amountShow:m,currencyAbbreviate:r?.currencyAbbreviate,currencyFormat:o})]}),re(ce,{show:T,close:C,amountShow:m,learnMoreConfig:u,translationConfig:c})]})},qe=Ge;export{qe as SubscriptionReward};\n","import React, { useState } from 'react';\nimport { SubscriptionRewardModal } from '../SubscriptionRewardModal';\nimport RewardProgressBar from './RewardProgressBar';\nimport RewardSubscriptionTotal from './RewardSubscriptionTotal';\nimport { RewardProgressBarContainer } from './CircularProgressBar.styled';\nimport { RewardProgressBarProps } from './types';\nimport SubscriptionRewardMobile from './SubscriptionRewardMobile';\nimport { application } from '../Utils/application';\nimport { calculateMonthCompletionValues } from './logic/calculateMonthCompletionValues';\n\nconst SubscriptionReward = (props: RewardProgressBarProps) => {\n const { title, subscriptionData, translationConfig, learnMoreConfig, storeConfig, currencyFormat } = props;\n let value = 2;\n let maxAmount = storeConfig?.tiers?.[0]?.max_spend ?? 0;\n let minAmount = storeConfig?.tiers?.[0]?.min_spend ?? 0;\n const maxMonths = storeConfig?.tiers?.[0]?.consecutive_months ?? 0;\n const [show, setShow] = useState(false);\n const handleOpen = () => setShow(true);\n const handleClose = () => setShow(false);\n const rewardData = subscriptionData;\n let minVoucher = 0;\n let maxVoucher = 0;\n const monthCompletionValue = 0;\n\n storeConfig?.tiers?.map((tier) => {\n if (tier.min_spend < minAmount) {\n minAmount = tier.min_spend;\n }\n // Check if 'max_spend' exists before trying to access it\n if ('max_spend' in tier && tier.max_spend > maxAmount) {\n maxAmount = tier.max_spend;\n }\n });\n\n storeConfig?.tiers?.map((tier) => {\n if (tier.min_spend === minAmount) {\n let promocode = tier.promo_code;\n promocode = promocode?.split('-')?.[0]?.replace('NSR', '');\n minVoucher = parseInt(promocode);\n }\n if (tier.min_spend === maxAmount) {\n let promocode = tier.promo_code;\n promocode = promocode?.split('-')?.[0]?.replace('NSR', '');\n maxVoucher = parseInt(promocode);\n }\n });\n let voucherValue = 0;\n const amountShow = parseInt(rewardData?.approximateMonthlyTotalResponse?.currentMonthTotal ?? '0');\n if (amountShow < minAmount) {\n voucherValue = minVoucher;\n } else if (amountShow < maxAmount) {\n voucherValue = minVoucher;\n } else if (amountShow > maxAmount) {\n voucherValue = maxVoucher;\n } else {\n voucherValue = 0;\n }\n const notQualifyForRewardThisMonth = amountShow < minAmount && voucherValue !== 0 && value !== maxMonths;\n\n // Calculate monthCompletionValue and voucherValue\n const { monthCompletionValue: calculatedMonthCompletionValue, voucherValue: calculatedVoucherValue } =\n calculateMonthCompletionValues(\n rewardData,\n minAmount,\n maxAmount,\n minVoucher,\n maxVoucher,\n voucherValue,\n monthCompletionValue,\n maxMonths,\n new Date(),\n );\n\n // Use the calculated values\n value = calculatedMonthCompletionValue; // or however you want to use it\n voucherValue = calculatedVoucherValue;\n return (\n <RewardProgressBarContainer>\n {application.isMobile ? (\n <SubscriptionRewardMobile\n value={value}\n title={title}\n voucherValue={voucherValue}\n maxMonths={maxMonths}\n handleOpenSubscriptionRewardPopup={handleOpen}\n storeConfig={storeConfig}\n amountShow={amountShow}\n notQualifyForRewardThisMonth={notQualifyForRewardThisMonth}\n translationConfig={translationConfig}\n learnMoreConfig={learnMoreConfig}\n currencyAbbreviate={storeConfig?.currencyAbbreviate}\n currencyFormat={currencyFormat}\n />\n ) : (\n <>\n <RewardProgressBar\n value={value}\n title={title}\n notQualifyForRewardThisMonth={notQualifyForRewardThisMonth}\n monthCompletionValue={monthCompletionValue}\n storeConfig={storeConfig}\n maxMonths={maxMonths}\n voucherValue={voucherValue}\n handleOpenSubscriptionRewardPopup={handleOpen}\n translationConfig={translationConfig}\n learnMoreConfig={learnMoreConfig}\n currencyAbbreviate={storeConfig?.currencyAbbreviate}\n currencyFormat={currencyFormat}\n />\n <RewardSubscriptionTotal\n notQualifyForRewardThisMonth={notQualifyForRewardThisMonth}\n value={value}\n voucherValue={voucherValue}\n maxMonths={maxMonths}\n title={title}\n monthCompletionValue={monthCompletionValue}\n storeConfig={storeConfig}\n translationConfig={translationConfig}\n learnMoreConfig={learnMoreConfig}\n handleOpenSubscriptionRewardPopup={handleOpen}\n amountShow={amountShow}\n currencyAbbreviate={storeConfig?.currencyAbbreviate}\n currencyFormat={currencyFormat}\n />\n </>\n )}\n <SubscriptionRewardModal\n show={show}\n close={handleClose}\n amountShow={amountShow}\n learnMoreConfig={learnMoreConfig}\n translationConfig={translationConfig}\n />\n </RewardProgressBarContainer>\n );\n};\n\nexport default SubscriptionReward;\nexport { SubscriptionReward };\n","import React from 'react';\nimport { CircularProgressbarWithChildren, buildStyles } from 'react-circular-progressbar';\nimport RadialSeparators from './RadialSeparator';\nimport { FaExclamationTriangle } from 'react-icons/fa';\nimport SubscriptionVoucherIcon from '../Icons/SubscriptionVoucherIcon';\nimport SubscriptionVoucherIconGrey from '../Icons/SubscriptionVoucherIconGrey';\nimport { IconContainer, LoyaltyProgressSubContainer, ProgressBarCenter } from './CircularProgressBar.styled';\nimport RewardSubscriptionMonthDescription from './RewardSubscriptionMonthDescription';\nimport { NsTypography } from '@nuskin/foundation-ui-components';\nimport { RewardProgressBarProps } from './types';\nimport { replacePlaceholders } from '../Utils/helper';\n\nclass RewardProgressBar extends React.Component<RewardProgressBarProps> {\n constructor(props: RewardProgressBarProps) {\n super(props);\n }\n\n render() {\n const {\n value = 0,\n voucherValue = 0,\n maxMonths = 0,\n handleOpenSubscriptionRewardPopup = () => {},\n notQualifyForRewardThisMonth = false,\n translationConfig = {\n voucherTargetAmount: '',\n monthsComplete: '',\n voucherEarned: '',\n learnMore: '',\n learn3xMore: '',\n callToAction: '',\n notQualify: '',\n approximateMonthly: '',\n approximateTotal: '',\n currentlyTrack: '',\n loyaltyLogoBlack: '',\n },\n learnMoreConfig = {\n tagLine: '',\n cardOneDescription: '',\n cardOneVoucherAmount: '',\n cardTwoDescription: '',\n cardTwoVoucherAmount: '',\n header: '',\n loyaltyLogoWhite: '',\n loyaltyBanner: '',\n learnMore: '',\n },\n currencyAbbreviate = false,\n currencyFormat = () => {},\n } = this.props;\n const voucherTargetAmount = replacePlaceholders(translationConfig.voucherTargetAmount, {\n currency_symbol: '',\n voucher_amount: '',\n });\n const voucherEarned = voucherValue\n ? currencyFormat(voucherValue, true, currencyAbbreviate)\n : currencyFormat(0, true, currencyAbbreviate);\n return (\n <LoyaltyProgressSubContainer>\n <div className=\"reward-progress\">\n <CircularProgressbarWithChildren\n value={(value / maxMonths) * 100}\n strokeWidth={12}\n background\n styles={buildStyles({\n rotation: 0.5,\n strokeLinecap: 'butt',\n backgroundColor: (() => {\n if (value === maxMonths && !notQualifyForRewardThisMonth) {\n return 'rgb(195 240 194)';\n }\n if (notQualifyForRewardThisMonth) {\n return '#fff';\n }\n return '#fff';\n })(),\n pathColor: '#6BC56A',\n trailColor: '#E0E0E0',\n })}\n >\n <RadialSeparators count={maxMonths} />\n {(() => {\n if (value === maxMonths && !notQualifyForRewardThisMonth) {\n return <SubscriptionVoucherIcon />;\n } else if (notQualifyForRewardThisMonth) {\n return (\n <IconContainer>\n <FaExclamationTriangle className=\"outline-exclamation-icon\" color=\"#91ACC8\" />\n </IconContainer>\n );\n } else if (voucherValue != null || voucherValue != undefined) {\n return (\n <ProgressBarCenter>\n <NsTypography\n component=\"div\"\n className=\"center-value-progress-bar-price\"\n variant=\"title-l\"\n weight=\"bold\"\n >{`${voucherEarned}`}</NsTypography>\n <NsTypography\n variant=\"label-s\"\n weight=\"bold\"\n component=\"div\"\n className=\"center-value-progress-bar-voucher\"\n >\n {voucherTargetAmount}\n </NsTypography>\n </ProgressBarCenter>\n );\n } else {\n return (\n <ProgressBarCenter>\n <SubscriptionVoucherIconGrey />\n </ProgressBarCenter>\n );\n }\n })()}\n </CircularProgressbarWithChildren>\n </div>\n <RewardSubscriptionMonthDescription\n value={value}\n voucherValue={voucherValue}\n notQualifyForRewardThisMonth={notQualifyForRewardThisMonth}\n handleOpenSubscriptionRewardPopup={handleOpenSubscriptionRewardPopup}\n maxMonths={maxMonths}\n translationConfig={translationConfig}\n learnMoreConfig={learnMoreConfig}\n currencyAbbreviate={currencyAbbreviate}\n currencyFormat={currencyFormat}\n />\n </LoyaltyProgressSubContainer>\n );\n }\n}\n\nexport default RewardProgressBar;\nexport { RewardProgressBar };\n","import { styled } from '@nuskin/foundation-theme';\n\nexport const RewardProgressBarContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n align-content: center;\n background-color: #f5f5f5;\n border: 1px solid #e0e0e0;\n border-radius: 10px;\n padding: 1.5rem;\n margin-bottom: 20px;\n height: 50%;\n margin: auto;\n\n @media (max-width: 950px) {\n flex-direction: column;\n }\n`;\n\nexport const LoyaltyProgressSubContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n align-content: center;\n\n .reward-logo {\n width: 200px;\n margin-bottom: 12px;\n }\n\n .reward-progress {\n height: 150px;\n width: 150px;\n }\n .progress-bar {\n background-color: #e0e0e0;\n height: 100%;\n }\n\n @media (max-width: 950px) {\n flex-direction: column;\n\n .info-container {\n margin-left: 0px;\n align-items: center;\n }\n .reward-progress-total-div {\n margin-top: 10px;\n }\n }\n`;\nexport const StyledCard = styled.div`\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-left: 16px;\n\n .info-item {\n margin: 5px 0;\n font-weight: 600;\n }\n`;\nexport const Learn3XLink = styled.div`\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n`;\nexport const ProgressBarCenter = styled.div`\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n color: black;\n\n .center-value-progress-bar-price {\n margin: 0;\n }\n .center-value-progress-bar-voucher {\n margin: 0;\n letter-spacing: 0.01em;\n }\n`;\nexport const RewardProgressTotalContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n\n .total-button {\n display: flex;\n align-items: center;\n background-color: #e5edf6;\n border-radius: 20px;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n }\n .reward-subtitle {\n letter-spacing: 0;\n display: flex;\n }\n\n @media (max-width: 950px) {\n .reward-subtitle {\n letter-spacing: 0;\n display: flex;\n text-align: center;\n }\n margin-top: 10px;\n }\n`;\n\nexport const RewardProgressTotalButtonWithIcon = styled.div`\n display: flex;\n align-items: center;\n background-color: #e5edf6;\n border-radius: 20px;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n padding: 1rem;\n margin-bottom: 14px;\n\n @media (max-width: 950px) {\n margin-top: 14px;\n }\n`;\n\nexport const IconContainer = styled.span`\n .info-icon {\n margin-left: 6px !important;\n }\n .loyalty-icon {\n height: 19px !important;\n width: 19px !important;\n margin-left: 6px !important;\n }\n .loyalty-warning-icon {\n height: 19px !important;\n width: 19px !important;\n margin-right: 6px !important;\n }\n .outline-exclamation-icon {\n height: 48px !important;\n width: 48px !important;\n }\n`;\n\nexport const SeparatorCard = styled.div`\n position: absolute;\n height: 100%;\n`;\n\nexport const SeparatorInnerCard = styled.div`\n background: #fff;\n width: 6px;\n height: 17%;\n`;\n","import React from 'react';\nimport { SeparatorCard, SeparatorInnerCard } from './CircularProgressBar.styled';\n\nfunction Separator(props: { readonly turns: number }) {\n return (\n <SeparatorCard\n style={{\n transform: `rotate(${props.turns}turn)`,\n }}\n >\n <SeparatorInnerCard />\n </SeparatorCard>\n );\n}\n\nfunction RadialSeparators(props: { count: number }) {\n const turns = 1 / props.count;\n return Array(props.count)\n .fill(null)\n .map((_, index) => <Separator key={index} turns={index * turns + 0.5} />);\n}\n\nexport default RadialSeparators;\n","import React from 'react';\n\nfunction SubscriptionVoucherIcon() {\n return (\n <svg width=\"71\" height=\"42\" viewBox=\"0 0 71 42\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M5.32847 36.176C3.52571 36.176 2.06348 34.7138 2.06348 32.911L2.15695 28.3574L4.8277 28.4108L4.73422 32.9378C4.73422 33.2382 5.0013 33.5053 5.32847 33.5053H30.7606L34.0056 33.3584L34.1258 36.0291L30.8207 36.1827H5.32847V36.176Z\"\n fill=\"#405E50\"\n />\n <path\n d=\"M68.3914 12.9147H65.7207V9.1156C65.7207 8.78843 65.4536 8.52136 65.1264 8.52136L36.3491 8.48129V5.81055L65.1264 5.85061C66.9225 5.85061 68.3914 7.31284 68.3914 9.1156V12.9147Z\"\n fill=\"#405E50\"\n />\n <path\n d=\"M62.3222 41.6454C62.1152 41.6454 61.9082 41.6253 61.7012 41.5853L2.99822 30.2079C2.14358 30.041 1.40245 29.5536 0.915037 28.8325C0.427626 28.1114 0.24735 27.2434 0.414272 26.3821L4.94119 3.0197C5.10811 2.16506 5.59552 1.42393 6.31662 0.936522C7.03772 0.44911 7.90572 0.268835 8.76703 0.435756L67.47 11.8131C69.2394 12.1537 70.3945 13.8696 70.054 15.639L65.5271 39.0013C65.2199 40.5637 63.8512 41.6454 62.3222 41.6454ZM62.2087 38.968C62.5225 39.028 62.843 38.8211 62.9031 38.5006L67.43 15.1382C67.4901 14.8177 67.2831 14.5039 66.9626 14.4438L8.25291 3.05977C8.04593 3.0197 7.88569 3.09983 7.80556 3.15324C7.73212 3.20666 7.59858 3.32016 7.55184 3.53382L3.02493 26.8962C2.96484 27.2167 3.17182 27.5305 3.49231 27.5906L62.2087 38.968Z\"\n fill=\"#405E50\"\n />\n <path\n d=\"M13.5344 22.0957C13.1405 22.0957 12.7398 22.0556 12.3392 21.9822C8.95406 21.3279 6.73066 18.0362 7.385 14.651C7.70549 13.0085 8.64025 11.593 10.029 10.6582C11.4178 9.72348 13.0804 9.38296 14.7229 9.70345C16.3654 10.0239 17.7809 10.9587 18.7156 12.3475C19.6504 13.7363 19.9909 15.3988 19.6704 17.0413C19.0895 20.0125 16.4655 22.0957 13.5344 22.0957ZM13.521 12.254C12.8133 12.254 12.1189 12.461 11.5247 12.8683C10.7301 13.4024 10.196 14.217 10.009 15.1584C9.6351 17.1014 10.9037 18.9843 12.8467 19.3582C14.7896 19.7321 16.6725 18.4635 17.0464 16.5205C17.2267 15.5791 17.0331 14.6243 16.4989 13.8298C15.9648 13.0352 15.1502 12.5011 14.2088 12.3141C13.9817 12.274 13.7481 12.254 13.521 12.254Z\"\n fill=\"#405E50\"\n />\n <path\n d=\"M23.9338 15.4855L23.4255 18.1074L59.9361 25.1845L60.4443 22.5626L23.9338 15.4855Z\"\n fill=\"#405E50\"\n />\n <path d=\"M22.8916 19.7002L22.3838 22.3223L58.8956 29.393L59.4034 26.771L22.8916 19.7002Z\" fill=\"#405E50\" />\n </svg>\n );\n}\n\nexport default SubscriptionVoucherIcon;\n","import React from 'react';\n\nfunction SubscriptionVoucherIconGrey() {\n return (\n <svg width=\"71\" height=\"42\" viewBox=\"0 0 71 42\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M5.32847 36.176C3.52571 36.176 2.06348 34.7138 2.06348 32.911L2.15695 28.3574L4.8277 28.4108L4.73422 32.9378C4.73422 33.2382 5.0013 33.5053 5.32847 33.5053H30.7606L34.0056 33.3584L34.1258 36.0291L30.8207 36.1827H5.32847V36.176Z\"\n fill=\"#B0B0B0\"\n />\n <path\n d=\"M68.3914 12.9147H65.7207V9.1156C65.7207 8.78843 65.4536 8.52136 65.1264 8.52136L36.3491 8.48129V5.81055L65.1264 5.85061C66.9225 5.85061 68.3914 7.31284 68.3914 9.1156V12.9147Z\"\n fill=\"#B0B0B0\"\n />\n <path\n d=\"M62.3222 41.6454C62.1152 41.6454 61.9082 41.6253 61.7012 41.5853L2.99822 30.2079C2.14358 30.041 1.40245 29.5536 0.915037 28.8325C0.427626 28.1114 0.24735 27.2434 0.414272 26.3821L4.94119 3.0197C5.10811 2.16506 5.59552 1.42393 6.31662 0.936522C7.03772 0.44911 7.90572 0.268835 8.76703 0.435756L67.47 11.8131C69.2394 12.1537 70.3945 13.8696 70.054 15.639L65.5271 39.0013C65.2199 40.5637 63.8512 41.6454 62.3222 41.6454ZM62.2087 38.968C62.5225 39.028 62.843 38.8211 62.9031 38.5006L67.43 15.1382C67.4901 14.8177 67.2831 14.5039 66.9626 14.4438L8.25291 3.05977C8.04593 3.0197 7.88569 3.09983 7.80556 3.15324C7.73212 3.20666 7.59858 3.32016 7.55184 3.53382L3.02493 26.8962C2.96484 27.2167 3.17182 27.5305 3.49231 27.5906L62.2087 38.968Z\"\n fill=\"#B0B0B0\"\n />\n <path\n d=\"M13.5344 22.0957C13.1405 22.0957 12.7398 22.0556 12.3392 21.9822C8.95406 21.3279 6.73066 18.0362 7.385 14.651C7.70549 13.0085 8.64025 11.593 10.029 10.6582C11.4178 9.72348 13.0804 9.38296 14.7229 9.70345C16.3654 10.0239 17.7809 10.9587 18.7156 12.3475C19.6504 13.7363 19.9909 15.3988 19.6704 17.0413C19.0895 20.0125 16.4655 22.0957 13.5344 22.0957ZM13.521 12.254C12.8133 12.254 12.1189 12.461 11.5247 12.8683C10.7301 13.4024 10.196 14.217 10.009 15.1584C9.6351 17.1014 10.9037 18.9843 12.8467 19.3582C14.7896 19.7321 16.6725 18.4635 17.0464 16.5205C17.2267 15.5791 17.0331 14.6243 16.4989 13.8298C15.9648 13.0352 15.1502 12.5011 14.2088 12.3141C13.9817 12.274 13.7481 12.254 13.521 12.254Z\"\n fill=\"#B0B0B0\"\n />\n <path\n d=\"M23.9338 15.4855L23.4255 18.1074L59.9361 25.1845L60.4443 22.5626L23.9338 15.4855Z\"\n fill=\"#B0B0B0\"\n />\n <path d=\"M22.8916 19.7002L22.3838 22.3223L58.8956 29.393L59.4034 26.771L22.8916 19.7002Z\" fill=\"#B0B0B0\" />\n </svg>\n );\n}\n\nexport default SubscriptionVoucherIconGrey;\n","import React from 'react';\nimport { Learn3XLink, StyledCard } from './CircularProgressBar.styled';\nimport { RewardSubscriptionMonthDescriptionProps } from './types';\nimport { replacePlaceholders } from '../Utils/helper';\n\nclass RewardSubscriptionMonthDescription extends React.Component<RewardSubscriptionMonthDescriptionProps> {\n constructor(props: RewardSubscriptionMonthDescriptionProps) {\n super(props);\n }\n\n render() {\n const {\n value,\n voucherValue,\n maxMonths,\n handleOpenSubscriptionRewardPopup,\n notQualifyForRewardThisMonth,\n translationConfig = {\n voucherTargetAmount: '',\n monthsComplete: '',\n voucherEarned: '',\n learnMore: '',\n learn3xMore: '',\n callToAction: '',\n notQualify: '',\n approximateMonthly: '',\n approximateTotal: '',\n currentlyTrack: '',\n loyaltyLogoBlack: '',\n },\n learnMoreConfig = {\n tagLine: '',\n cardOneDescription: '',\n cardOneVoucherAmount: '',\n cardTwoDescription: '',\n cardTwoVoucherAmount: '',\n header: '',\n loyaltyLogoWhite: '',\n loyaltyBanner: '',\n learnMore: '',\n },\n currencyAbbreviate = false,\n currencyFormat = () => {},\n } = this.props;\n\n let popupText = '';\n const minVoucher = 50;\n const maxVoucher = 150;\n if (voucherValue === minVoucher && !notQualifyForRewardThisMonth) {\n popupText = translationConfig.learn3xMore;\n } else if (voucherValue === maxVoucher || notQualifyForRewardThisMonth) {\n popupText = learnMoreConfig.learnMore;\n } else if (voucherValue === null || voucherValue === undefined) {\n popupText = translationConfig.learnMore;\n }\n const monthsCompleteText = replacePlaceholders(translationConfig.monthsComplete, {\n completed_months: value,\n total_months: maxMonths,\n });\n\n const voucherEarned = voucherValue\n ? currencyFormat(voucherValue, true, currencyAbbreviate)\n : currencyFormat(0, true, currencyAbbreviate);\n const voucherEarnedText = translationConfig.voucherEarned.replace(\n '%currency_symbol%%currency_amount%',\n `${voucherEarned}`,\n );\n\n return (\n <StyledCard>\n <img className=\"reward-logo\" src={translationConfig.loyaltyLogoBlack} alt=\"Rewards Logo\" />\n {value === maxMonths ? (\n <div className=\"info-item\">{voucherEarnedText}</div>\n ) : (\n <div className=\"info-item\">{monthsCompleteText}</div>\n )}\n <Learn3XLink id=\"learnMore\" onClick={handleOpenSubscriptionRewardPopup}>\n <u>{popupText}</u>\n </Learn3XLink>\n </StyledCard>\n );\n }\n}\n\nexport default RewardSubscriptionMonthDescription;\nexport { RewardSubscriptionMonthDescription };\n","export const replacePlaceholders = (\n template: string,\n values: { [key: string]: string | number | null }, // Add null\n) => {\n return Object.keys(values).reduce((result, key) => {\n const value = values[key] ?? ''; // Replace null with empty string\n return result.replace(new RegExp(`%${key}%`, 'g'), String(value));\n }, template);\n};\n\nexport const currencySymbol = () => {\n return '$';\n};\n","import React from 'react';\nimport { FaExclamationTriangle } from 'react-icons/fa';\nimport {\n IconContainer,\n RewardProgressTotalButtonWithIcon,\n RewardProgressTotalContainer,\n} from './CircularProgressBar.styled';\nimport { NsTypography } from '@nuskin/foundation-ui-components';\nimport { RewardProgressBarProps } from './types';\nimport Info from '../Icons/Info';\nimport { Tooltip, IconButton } from '@mui/material';\nimport { replacePlaceholders } from '../Utils/helper';\nclass RewardSubscriptionTotal extends React.Component<RewardProgressBarProps> {\n constructor(props: RewardProgressBarProps) {\n super(props);\n }\n\n render() {\n const {\n value,\n voucherValue,\n maxMonths,\n notQualifyForRewardThisMonth,\n amountShow,\n translationConfig = {\n voucherTargetAmount: '',\n monthsComplete: '',\n voucherEarned: '',\n learnMore: '',\n learn3xMore: '',\n callToAction: '',\n notQualify: '',\n approximateMonthly: '',\n approximateTotal: '',\n currentlyTrack: '',\n loyaltyLogoBlack: '',\n estimateDisclaimer: '',\n },\n storeConfig = {\n tiers: [\n {\n consecutive_months: 0,\n min_spend: 0,\n max_spend: 0,\n promo_code: '',\n },\n {\n consecutive_months: 0,\n min_spend: 0,\n promo_code: '',\n },\n ],\n },\n currencyAbbreviate = false,\n currencyFormat = () => {},\n } = this.props;\n\n const voucherEarned = voucherValue\n ? currencyFormat(voucherValue, true, currencyAbbreviate)\n : currencyFormat(0, true, currencyAbbreviate);\n const currentlyTrackText = translationConfig.currentlyTrack.replace(\n '%currency_symbol%%currency_amount%',\n `${voucherEarned}`,\n );\n const approximateTotalText = replacePlaceholders(translationConfig.approximateTotal, {\n currency_symbol: '',\n projected_month_spend: '',\n });\n const minAmount = parseFloat(String(storeConfig?.tiers?.[0]?.min_spend)) || 0;\n const minAmountShow = currencyFormat(minAmount, true, currencyAbbreviate);\n const callToActionText = translationConfig.callToAction.replace(\n '%currency_symbol%%current_spend_target%',\n `${minAmountShow}`,\n );\n const approximateMonthlyText = replacePlaceholders(translationConfig.approximateMonthly, {\n currency_symbol: '',\n estimated_running_subscription_spend: '',\n });\n const amountShowText = currencyFormat(amountShow ?? 0, false, false);\n return (\n <RewardProgressTotalContainer>\n <RewardProgressTotalButtonWithIcon>\n {notQualifyForRewardThisMonth ? (\n <>\n <IconContainer>\n <FaExclamationTriangle className=\"loyalty-warning-icon\" color=\"#4A6987\" />\n </IconContainer>\n <NsTypography\n variant=\"body-s\"\n weight=\"normal\"\n className=\"reward-subtitle\"\n colorOverride=\"#293A4A\"\n noSpacing\n >\n {translationConfig.notQualify}\n </NsTypography>\n </>\n ) : (\n <>\n <NsTypography\n variant=\"body-s\"\n weight=\"normal\"\n colorOverride=\"#252525\"\n className=\"reward-subtitle\"\n component=\"span\"\n noSpacing\n >\n {approximateMonthlyText}\n </NsTypography>\n &nbsp;\n <NsTypography weight=\"bold\" className=\"button-price\" variant=\"body-s\" component=\"span\">\n {`${amountShowText}`}\n </NsTypography>\n <IconContainer>\n <Tooltip\n slotProps={{\n tooltip: {\n sx: {\n color: '#FFFFFF',\n backgroundColor: '#252525',\n fontFamily: 'Inter',\n fontWeight: 400,\n fontSize: '14px',\n lineHeight: '20px',\n '& .MuiTooltip-arrow': {\n color: '#252525',\n },\n },\n },\n }}\n title={translationConfig.estimateDisclaimer}\n arrow\n placement=\"top\"\n >\n <span className=\"info-icon\">\n <IconButton>\n <Info />\n </IconButton>\n </span>\n </Tooltip>\n </IconContainer>\n </>\n )}\n </RewardProgressTotalButtonWithIcon>\n {(() => {\n if (value === maxMonths) {\n return '';\n } else if (notQualifyForRewardThisMonth) {\n return (\n <NsTypography\n variant=\"body-s\"\n weight=\"normal\"\n className=\"reward-subtitle\"\n colorOverride=\"#252525\"\n component=\"div\"\n >\n {approximateTotalText}&nbsp;\n <NsTypography component=\"span\" className=\"button-price\" variant=\"body-s\" weight=\"bold\">\n {`${amountShowText}`}\n </NsTypography>\n </NsTypography>\n );\n } else if (voucherValue != null || voucherValue != undefined) {\n return (\n <NsTypography\n variant=\"body-s\"\n weight=\"bold\"\n className=\"reward-subtitle\"\n colorOverride=\"#252525\"\n >\n {currentlyTrackText}\n </NsTypography>\n );\n } else {\n return (\n <NsTypography\n variant=\"body-s\"\n weight=\"bold\"\n className=\"reward-subtitle\"\n colorOverride=\"#252525\"\n >\n {callToActionText}\n </NsTypography>\n );\n }\n })()}\n </RewardProgressTotalContainer>\n );\n }\n}\n\nexport default RewardSubscriptionTotal;\nexport { RewardSubscriptionTotal };\n","import React from 'react';\n\nfunction Info() {\n return (\n <svg width=\"19\" height=\"19\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.833344 9.99967C0.833344 4.93706 4.9374 0.833008 10 0.833008C15.0626 0.833008 19.1667 4.93706 19.1667 9.99967C19.1667 15.0623 15.0626 19.1663 10 19.1663C4.9374 19.1663 0.833344 15.0623 0.833344 9.99967ZM10 2.49967C5.85787 2.49967 2.50001 5.85754 2.50001 9.99967C2.50001 14.1418 5.85787 17.4997 10 17.4997C14.1421 17.4997 17.5 14.1418 17.5 9.99967C17.5 5.85754 14.1421 2.49967 10 2.49967Z\"\n fill=\"#4A6987\"\n />\n <line x1=\"10.1667\" y1=\"9.375\" x2=\"10.1667\" y2=\"14.7917\" stroke=\"#4A6987\" strokeWidth=\"2\" />\n <path\n d=\"M10.0052 7.75009C10.6338 7.75009 11.1718 7.22807 11.1771 6.57821C11.1718 5.93901 10.6338 5.41699 10.0052 5.41699C9.35537 5.41699 8.82803 5.93901 8.83335 6.57821C8.82803 7.22807 9.35537 7.75009 10.0052 7.75009Z\"\n fill=\"#4A6987\"\n />\n </svg>\n );\n}\n\nexport default Info;\n","import React, { useState } from 'react';\nimport {\n IconContainer,\n Learn3XLink,\n LoyaltyProgressSubContainer,\n ProgressBarCenter,\n StyledCard,\n} from './CircularProgressBar.styled';\nimport { RewardProgressBarProps } from './types';\nimport RadialSeparators from './RadialSeparator';\nimport SubscriptionVoucherIcon from '../Icons/SubscriptionVoucherIcon';\nimport SubscriptionVoucherIconGrey from '../Icons/SubscriptionVoucherIconGrey';\nimport { FaExclamationTriangle } from 'react-icons/fa';\nimport { NsTypography } from '@nuskin/foundation-ui-components';\nimport { CircularProgressbarWithChildren, buildStyles } from 'react-circular-progressbar';\nimport { RewardProgressTotalButtonWithIcon, RewardProgressTotalContainer } from './CircularProgressBar.styled';\nimport Info from '../Icons/Info';\nimport { Tooltip, IconButton } from '@mui/material';\nimport { replacePlaceholders } from '../Utils/helper';\n\nconst SubscriptionRewardMobile = (props: RewardProgressBarProps) => {\n const [open, setOpen] = useState(false);\n const handleTooltipToggle = () => {\n setOpen(!open);\n };\n const {\n handleOpenSubscriptionRewardPopup = () => {},\n notQualifyForRewardThisMonth = false,\n value = 0,\n voucherValue = 0,\n amountShow,\n maxMonths = 0,\n translationConfig = {\n voucherTargetAmount: '',\n monthsComplete: '',\n voucherEarned: '',\n learnMore: '',\n learn3xMore: '',\n callToAction: '',\n notQualify: '',\n approximateMonthly: '',\n approximateTotal: '',\n currentlyTrack: '',\n loyaltyLogoBlack: '',\n estimateDisclaimer: '',\n },\n learnMoreConfig = {\n tagLine: '',\n cardOneDescription: '',\n cardOneVoucherAmount: '',\n cardTwoDescription: '',\n cardTwoVoucherAmount: '',\n header: '',\n loyaltyLogoWhite: '',\n loyaltyBanner: '',\n learnMore: '',\n },\n storeConfig = {\n tiers: [\n {\n consecutive_months: '',\n min_spend: '',\n max_spend: '',\n promo_code: '',\n },\n {\n consecutive_months: '',\n min_spend: '',\n promo_code: '',\n },\n ],\n },\n currencyAbbreviate = false,\n currencyFormat = () => {},\n } = props;\n\n let popupText = '';\n const minVoucher = 50;\n const maxVoucher = 150;\n if (voucherValue === minVoucher && !notQualifyForRewardThisMonth) {\n popupText = translationConfig.learn3xMore;\n } else if (voucherValue === maxVoucher || notQualifyForRewardThisMonth) {\n popupText = learnMoreConfig.learnMore;\n } else if (voucherValue === null || voucherValue === undefined) {\n popupText = translationConfig.learnMore;\n }\n\n const monthsCompleteText = replacePlaceholders(translationConfig.monthsComplete, {\n completed_months: value,\n total_months: maxMonths,\n });\n const voucherEarned = voucherValue\n ? currencyFormat(voucherValue, true, currencyAbbreviate)\n : currencyFormat(0, true, currencyAbbreviate);\n const voucherEarnedText = translationConfig.voucherEarned.replace(\n '%currency_symbol%%currency_amount%',\n `${voucherEarned}`,\n );\n const currentlyTrackText = translationConfig.currentlyTrack.replace(\n '%currency_symbol%%currency_amount%',\n `${voucherEarned}`,\n );\n const approximateTotalText = replacePlaceholders(translationConfig.approximateTotal, {\n currency_symbol: '',\n projected_month_spend: '',\n });\n const minAmount = parseFloat(String(storeConfig?.tiers?.[0]?.min_spend)) || 0;\n const minAmountShow = currencyFormat(minAmount, true, currencyAbbreviate);\n const callToActionText = translationConfig.callToAction.replace(\n '%currency_symbol%%current_spend_target%',\n `${minAmountShow}`,\n );\n const approximateMonthlyText = replacePlaceholders(translationConfig.approximateMonthly, {\n currency_symbol: '',\n estimated_running_subscription_spend: '',\n });\n const voucherTargetAmount = replacePlaceholders(translationConfig.voucherTargetAmount, {\n currency_symbol: '',\n voucher_amount: '',\n });\n const amountShowText = currencyFormat(amountShow ?? 0, false, false);\n\n return (\n <LoyaltyProgressSubContainer>\n <StyledCard>\n <img className=\"reward-logo\" src={translationConfig.loyaltyLogoBlack} alt=\"Rewards Logo\" />\n </StyledCard>\n <div className=\"reward-progress\">\n <CircularProgressbarWithChildren\n value={(value / maxMonths) * 100}\n strokeWidth={12}\n background\n styles={buildStyles({\n rotation: 0.5,\n strokeLinecap: 'butt',\n backgroundColor:\n value === maxMonths && !notQualifyForRewardThisMonth\n ? 'rgb(195 240 194)'\n : notQualifyForRewardThisMonth\n ? '#fff'\n : '#fff',\n pathColor: '#6BC56A',\n trailColor: '#E0E0E0',\n })}\n >\n <RadialSeparators count={maxMonths} />\n {value === maxMonths && !notQualifyForRewardThisMonth ? (\n <SubscriptionVoucherIcon />\n ) : notQualifyForRewardThisMonth ? (\n <IconContainer>\n <FaExclamationTriangle className=\"outline-exclamation-icon\" color=\"#91ACC8\" />\n </IconContainer>\n ) : voucherValue != null || voucherValue != undefined ? (\n <ProgressBarCenter>\n <NsTypography\n component=\"div\"\n className=\"center-value-progress-bar-price\"\n variant=\"title-l\"\n weight=\"bold\"\n >{`${voucherEarned}`}</NsTypography>\n <NsTypography\n variant=\"label-s\"\n weight=\"bold\"\n component=\"div\"\n className=\"center-value-progress-bar-voucher\"\n >\n {voucherTargetAmount}\n </NsTypography>\n </ProgressBarCenter>\n ) : (\n <ProgressBarCenter>\n <SubscriptionVoucherIconGrey />\n </ProgressBarCenter>\n )}\n </CircularProgressbarWithChildren>\n </div>\n <StyledCard>\n {value === maxMonths && amountShow !== undefined && amountShow > minAmount ? (\n <div className=\"info-item\">{voucherEarnedText}</div>\n ) : (\n <div className=\"info-item\">{monthsCompleteText}</div>\n )}\n </StyledCard>\n <RewardProgressTotalContainer>\n {value === maxMonths ? (\n ''\n ) : notQualifyForRewardThisMonth ? (\n <NsTypography\n variant=\"body-s\"\n weight=\"normal\"\n className=\"reward-subtitle\"\n colorOverride=\"#252525\"\n component=\"div\"\n >\n {approximateTotalText}{' '}\n <NsTypography component=\"span\" className=\"button-price\" variant=\"body-s\" weight=\"bold\">\n {`${amountShowText}`}\n </NsTypography>\n </NsTypography>\n ) : voucherValue != null || voucherValue != undefined ? (\n <NsTypography variant=\"body-s\" weight=\"bold\" className=\"reward-subtitle\" colorOverride=\"#252525\">\n {currentlyTrackText}\n </NsTypography>\n ) : (\n <NsTypography variant=\"body-s\" weight=\"bold\" className=\"reward-subtitle\" colorOverride=\"#252525\">\n {callToActionText}\n </NsTypography>\n )}\n <RewardProgressTotalButtonWithIcon>\n {notQualifyForRewardThisMonth ? (\n <>\n <IconContainer>\n <FaExclamationTriangle className=\"loyalty-warning-icon\" color=\"#4A6987\" />\n </IconContainer>\n <NsTypography\n variant=\"body-s\"\n weight=\"normal\"\n className=\"reward-subtitle\"\n colorOverride=\"#293A4A\"\n noSpacing\n >\n {translationConfig.notQualify}\n </NsTypography>\n </>\n ) : (\n <>\n <NsTypography\n variant=\"body-s\"\n weight=\"normal\"\n colorOverride=\"#252525\"\n className=\"reward-subtitle\"\n component=\"span\"\n noSpacing\n >\n {approximateMonthlyText}{' '}\n </NsTypography>\n &nbsp;\n <NsTypography weight=\"bold\" className=\"button-price\" variant=\"body-s\" component=\"span\">\n {`${amountShowText}`}\n </NsTypography>\n <IconContainer>\n <Tooltip\n slotProps={{\n tooltip: {\n sx: {\n color: '#FFFFFF',\n backgroundColor: '#252525',\n fontFamily: 'Inter',\n fontWeight: 400,\n fontSize: '14px',\n lineHeight: '20px',\n '& .MuiTooltip-arrow': {\n color: '#252525',\n },\n },\n },\n }}\n title={translationConfig.estimateDisclaimer}\n arrow\n placement=\"top\"\n open={open}\n onClose={() => setOpen(false)}\n >\n <span className=\"info-icon\">\n <IconButton onClick={handleTooltipToggle}>\n <Info />\n </IconButton>\n </span>\n </Tooltip>\n </IconContainer>\n </>\n )}\n </RewardProgressTotalButtonWithIcon>\n </RewardProgressTotalContainer>\n <StyledCard>\n <Learn3XLink onClick={handleOpenSubscriptionRewardPopup}>\n <u>{popupText}</u>\n </Learn3XLink>\n </StyledCard>\n </LoyaltyProgressSubContainer>\n );\n};\n\nexport default SubscriptionRewardMobile;\nexport { SubscriptionRewardMobile };\n","const IS_BROWSER = typeof window === 'object';\n\nclass ApplicationStore {\n width = IS_BROWSER ? window.innerWidth : 0;\n\n scroll = {\n vertical: IS_BROWSER ? window.scrollY : 0,\n horizontal: IS_BROWSER ? window.scrollX : 0,\n direction: 'none',\n };\n\n get isMobile() {\n return this.isPhone;\n }\n\n get isPhone() {\n return IS_BROWSER ? window.innerWidth < 768 : this.width < 768;\n }\n}\n\nconst applicationContainer = new ApplicationStore();\nexport { IS_BROWSER, ApplicationStore, applicationContainer, applicationContainer as application };\nexport default applicationContainer;\n","import { MonthlyData } from '../types';\n\nexport const calculateMonthCompletionValues = (\n data: MonthlyData | null | undefined,\n minAmount: number,\n maxAmount: number,\n minVoucher: number,\n maxVoucher: number,\n voucherValue: number,\n monthCompletionValue: number,\n maxMonths: number,\n today: Date,\n) => {\n if (data) {\n const sortedRecords = data?.csmMonthlySubsOrderTotal?.sort(\n (a: { year: number; month: number }, b: { year: number; month: number }) => {\n if (a.year === b.year) {\n return b.month - a.month;\n }\n return b.year - a.year;\n },\n );\n\n const hasCurrentMonthData = sortedRecords?.some(\n (record: { year: number; month: number }) =>\n record.month === today.getMonth() + 1 && record.year === today.getFullYear(),\n );\n const currentMonthData = sortedRecords?.filter((sub: { year: number; month: number }) => {\n return sub.month === today.getMonth() + 1 && sub.year === today.getFullYear();\n });\n const currentMonthTotalAmount =\n currentMonthData?.map((sub: { totalAmount: number }) => {\n return sub.totalAmount;\n })?.[0] ?? 0;\n const approxMonthTotal = parseInt(data?.approximateMonthlyTotalResponse?.currentMonthTotal ?? '0');\n let currentMonthEligibleAmount = 0;\n if (approxMonthTotal > maxAmount) {\n currentMonthEligibleAmount = maxAmount;\n } else {\n currentMonthEligibleAmount = minAmount;\n }\n const isCurrentMonthEligible = currentMonthData?.some(\n (sub: { totalAmount: number }) => sub.totalAmount >= currentMonthEligibleAmount,\n );\n const threeMonthsAgo =\n hasCurrentMonthData && isCurrentMonthEligible\n ? new Date(today.getFullYear(), today.getMonth() - (maxMonths - 1), 1)\n : new Date(today.getFullYear(), today.getMonth() - maxMonths, 1);\n let threeMonthsRecords = sortedRecords?.filter((sub: { year: number; month: number }) => {\n const subDate = new Date(sub.year, sub.month - 1);\n return subDate >= threeMonthsAgo;\n });\n threeMonthsRecords = threeMonthsRecords?.filter((sub: { promocode: string | null }) => {\n return sub.promocode === null || sub.promocode === undefined || sub.promocode === '';\n });\n if (!isCurrentMonthEligible) {\n threeMonthsRecords = threeMonthsRecords?.filter((sub: { year: number; month: number }) => {\n return !(sub.month === today.getMonth() + 1 && sub.year === today.getFullYear());\n });\n }\n const lastThreeMonths = threeMonthsRecords?.slice(0, maxMonths);\n const allMonthsAboveMaxAmount = lastThreeMonths?.every(\n (sub: { totalAmount: number }) => sub.totalAmount >= maxAmount,\n );\n\n const promoCodes = lastThreeMonths?.map((sub: { promocode: string | null }) => sub?.promocode);\n const isValid = !promoCodes?.some((code: string | null) => code === undefined);\n // Ensure you have at least two promo codes to compare.\n const allSamePromoCode = !isValid ? promoCodes?.every((code: string | null) => code === promoCodes[0]) : false;\n const todayMonth = isCurrentMonthEligible ? today.getMonth() : today.getMonth() - 1;\n let tier = 2;\n\n if (lastThreeMonths != undefined && promoCodes != undefined) {\n for (let i = 0; i < lastThreeMonths?.length; i++) {\n const currentMonthData = lastThreeMonths[i];\n\n const totalAmount = currentMonthData?.totalAmount;\n const todayYear = today.getFullYear();\n\n if (\n lastThreeMonths[i]?.month &&\n lastThreeMonths[i]?.month !== new Date(todayYear, todayMonth - i).getMonth() + 1\n ) {\n return { monthCompletionValue, voucherValue };\n }\n\n if (\n allSamePromoCode &&\n (promoCodes[i] !== undefined || promoCodes[i] !== '' || promoCodes[i] !== null)\n ) {\n return { monthCompletionValue: 0, voucherValue };\n } else {\n if (\n totalAmount >= minAmount &&\n (!promoCodes[i] ||\n promoCodes[i] === undefined ||\n promoCodes[i] === '' ||\n promoCodes[i] === null)\n ) {\n monthCompletionValue = monthCompletionValue + 1;\n if (allMonthsAboveMaxAmount) {\n voucherValue = maxVoucher;\n } else {\n if (tier === 2 && totalAmount >= maxAmount) {\n voucherValue = maxVoucher;\n } else {\n voucherValue = minVoucher;\n tier = 1;\n }\n }\n } else {\n if (totalAmount < minAmount) {\n return { monthCompletionValue, voucherValue };\n }\n }\n }\n }\n }\n if ((!hasCurrentMonthData || !isCurrentMonthEligible) && voucherValue !== minVoucher) {\n if (approxMonthTotal >= maxAmount) {\n voucherValue = maxVoucher;\n } else {\n voucherValue = minVoucher;\n }\n }\n if (\n !isCurrentMonthEligible &&\n voucherValue === minVoucher &&\n monthCompletionValue < maxMonths &&\n currentMonthTotalAmount >= minAmount\n ) {\n monthCompletionValue = monthCompletionValue + 1;\n }\n }\n\n return { monthCompletionValue, voucherValue };\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { MonthlyData } from '../types';
2
- export declare const calculateMonthCompletionValues: (data: MonthlyData | null | undefined, minAmount: number, maxAmount: number, minVoucher: number, maxVoucher: number, voucherValue: number, monthCompletionValue: number) => {
2
+ export declare const calculateMonthCompletionValues: (data: MonthlyData | null | undefined, minAmount: number, maxAmount: number, minVoucher: number, maxVoucher: number, voucherValue: number, monthCompletionValue: number, maxMonths: number, today: Date) => {
3
3
  monthCompletionValue: number;
4
4
  voucherValue: number;
5
5
  };
@@ -16,10 +16,10 @@ export type StoreMonthlySubsOrder = {
16
16
  };
17
17
  export type MonthlyData = {
18
18
  approximateMonthlyTotalResponse?: {
19
- currentMonthTotal?: number;
19
+ currentMonthTotal?: string;
20
20
  };
21
21
  approximateMonthlyTotal?: ApproximateMonthlyTotal;
22
- storeMonthlySubsOrderTotal?: StoreMonthlySubsOrder[];
22
+ csmMonthlySubsOrderTotal?: StoreMonthlySubsOrder[];
23
23
  };
24
24
  export type TranslationConfig = {
25
25
  header?: string | undefined;
@@ -48,17 +48,17 @@ export type LearnMoreConfig = {
48
48
  learnMore: string;
49
49
  };
50
50
  export type RewardProgressBarProps = {
51
- value: number;
52
- title: string;
51
+ value?: number;
52
+ title?: string;
53
53
  amountShow?: number | undefined;
54
- voucherValue: number | null;
54
+ voucherValue?: number | null;
55
55
  monthCompletionValue?: number;
56
56
  minAmount?: number;
57
- maxMonths: number;
57
+ maxMonths?: number;
58
58
  approximateMonthlyTotalResponse?: object;
59
59
  subscriptionData?: null | MonthlyData;
60
- handleOpenSubscriptionRewardPopup: () => void;
61
- notQualifyForRewardThisMonth: boolean;
60
+ handleOpenSubscriptionRewardPopup?: () => void;
61
+ notQualifyForRewardThisMonth?: boolean;
62
62
  translationConfig: TranslationConfig;
63
63
  learnMoreConfig: LearnMoreConfig;
64
64
  storeConfig: {