@heycater/qualification-funnel 1.19.5 → 1.19.6

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.
@@ -877,7 +877,7 @@
877
877
  ${({theme:e})=>e.breakpoints.up("md")} {
878
878
  max-width: 320px;
879
879
  }
880
- `;function sP(){var e,t;const n=_E(),{answerOf:r,actions:o,state:i}=KO(),{trackAnswer:a}=dj(),s=r("event_date"),l=s?new Date(s):void 0,u=function(e,t){if(h_(2,arguments),!t||"object"!==he(t))return new Date(NaN);var n=t.years?p_(t.years):0,r=t.months?p_(t.months):0,o=t.weeks?p_(t.weeks):0,i=t.days?p_(t.days):0,a=t.hours?p_(t.hours):0,s=t.minutes?p_(t.minutes):0,l=t.seconds?p_(t.seconds):0,u=m_(e),c=r||n?v_(u,r+12*n):u,d=i||o?g_(c,i+7*o):c,f=1e3*(l+60*(s+60*a));return new Date(d.getTime()+f)}(new Date,{days:2}),c="qualification"in i?UL.getAttributes({answers:i.qualification.answers,selectedCaterer:i.qualification.selectedCaterer}):null,d="en"===n.locale?null==(e=null==c?void 0:c.minDate)?void 0:e.messageEn:null==(t=null==c?void 0:c.minDate)?void 0:t.messageDe,[f]=g.useState(!!r(VL.id));g.useEffect(()=>{s&&o.answerQuestion("has_recurring_need",f)},[f]);const[p,h]=g.useState(l||u);return C.jsx(nP,{dateSelector:C.jsxs(pP,{children:[C.jsx(hP,{children:C.jsx(tP,{components:{Caption:uP,Row:cP,Day:lP},formatters:{formatWeekdayName:(e,t)=>TL(e,"EEEEE",{locale:null==t?void 0:t.locale})},month:p,onDayClick:e=>{o.answerQuestion("event_date",e),a("event_date",TL(e,"yyyy-MM-dd"))},selected:l,fromDate:u,onMonthChange:h,captionLayout:"buttons",locale:n.locale?hM[n.locale]:void 0,showOutsideDays:!0,mode:"single"})}),d&&C.jsx(Fm,{textAlign:"center",mt:2,children:C.jsxs(fP,{children:["*",d]})})]}),sideContent:C.jsx(oP,{})})}function lP(e){const{outside:t}=DT(e.date,e.displayMonth),n=$j();return t&&function(e){return h_(1,arguments),1===m_(e).getDate()}(e.date)?C.jsxs(Fm,{position:"relative",children:[C.jsx(Fm,{position:"absolute",top:"-3px",left:"-3px",children:C.jsx(Qm,{fontSize:9,children:TL(e.date,"MMM",{locale:n.locale})})}),C.jsx(qT,{...e})]}):C.jsx(qT,{...e})}function uP(e){const{goToMonth:t,nextMonth:n,previousMonth:r}=Yj(),o=$j();return C.jsxs(Fm,{display:"flex",justifyContent:"space-between",alignItems:"center",py:1.5,children:[C.jsx(dP,{id:"datepicker__prev-month",type:"button",disabled:!r,onClick:()=>r&&t(r),children:C.jsx(Qj,{})}),C.jsx(Qm,{fontSize:15,fontWeight:600,children:TL(e.displayMonth,"MMMM yyyy",{locale:o.locale})}),C.jsx(dP,{id:"datepicker__next-month",type:"button",disabled:!n,onClick:()=>n&&t(n),children:C.jsx(Jj,{})})]})}function cP(e){const t=new Date;if(FL(t,e.displayMonth)){const n=RL(e.displayMonth),r=RL(t)-n,o=e.dates.map(e=>__(e,r));return o.some(t=>FL(t,e.displayMonth))?C.jsx(UT,{...e,weekNumber:e.weekNumber+r,dates:o}):C.jsx(C.Fragment,{})}return C.jsx(UT,{...e})}const dP=_p.button`
880
+ `;function sP(){var e,t,n;const r=_E(),{answerOf:o,actions:i,state:a}=KO(),{trackAnswer:s}=dj(),l=o("event_date"),u=l?new Date(l):void 0,c=function(e,t){if(h_(2,arguments),!t||"object"!==he(t))return new Date(NaN);var n=t.years?p_(t.years):0,r=t.months?p_(t.months):0,o=t.weeks?p_(t.weeks):0,i=t.days?p_(t.days):0,a=t.hours?p_(t.hours):0,s=t.minutes?p_(t.minutes):0,l=t.seconds?p_(t.seconds):0,u=m_(e),c=r||n?v_(u,r+12*n):u,d=i||o?g_(c,i+7*o):c,f=1e3*(l+60*(s+60*a));return new Date(d.getTime()+f)}(new Date,{days:2}),d="qualification"in a?UL.getAttributes({answers:a.qualification.answers,selectedCaterer:a.qualification.selectedCaterer}):null,f=(null==(e=r.locale)?void 0:e.startsWith("en"))?null==(t=null==d?void 0:d.minDate)?void 0:t.messageEn:null==(n=null==d?void 0:d.minDate)?void 0:n.messageDe,[p]=g.useState(!!o(VL.id));g.useEffect(()=>{l&&i.answerQuestion("has_recurring_need",p)},[p]);const[h,m]=g.useState(u||c);return C.jsx(nP,{dateSelector:C.jsxs(pP,{children:[C.jsx(hP,{children:C.jsx(tP,{components:{Caption:uP,Row:cP,Day:lP},formatters:{formatWeekdayName:(e,t)=>TL(e,"EEEEE",{locale:null==t?void 0:t.locale})},month:h,onDayClick:e=>{i.answerQuestion("event_date",e),s("event_date",TL(e,"yyyy-MM-dd"))},selected:u,fromDate:c,onMonthChange:m,captionLayout:"buttons",locale:r.locale?hM[r.locale]:void 0,showOutsideDays:!0,mode:"single"})}),f&&C.jsx(Fm,{textAlign:"center",mt:2,children:C.jsxs(fP,{children:["*",f]})})]}),sideContent:C.jsx(oP,{})})}function lP(e){const{outside:t}=DT(e.date,e.displayMonth),n=$j();return t&&function(e){return h_(1,arguments),1===m_(e).getDate()}(e.date)?C.jsxs(Fm,{position:"relative",children:[C.jsx(Fm,{position:"absolute",top:"-3px",left:"-3px",children:C.jsx(Qm,{fontSize:9,children:TL(e.date,"MMM",{locale:n.locale})})}),C.jsx(qT,{...e})]}):C.jsx(qT,{...e})}function uP(e){const{goToMonth:t,nextMonth:n,previousMonth:r}=Yj(),o=$j();return C.jsxs(Fm,{display:"flex",justifyContent:"space-between",alignItems:"center",py:1.5,children:[C.jsx(dP,{id:"datepicker__prev-month",type:"button",disabled:!r,onClick:()=>r&&t(r),children:C.jsx(Qj,{})}),C.jsx(Qm,{fontSize:15,fontWeight:600,children:TL(e.displayMonth,"MMMM yyyy",{locale:o.locale})}),C.jsx(dP,{id:"datepicker__next-month",type:"button",disabled:!n,onClick:()=>n&&t(n),children:C.jsx(Jj,{})})]})}function cP(e){const t=new Date;if(FL(t,e.displayMonth)){const n=RL(e.displayMonth),r=RL(t)-n,o=e.dates.map(e=>__(e,r));return o.some(t=>FL(t,e.displayMonth))?C.jsx(UT,{...e,weekNumber:e.weekNumber+r,dates:o}):C.jsx(C.Fragment,{})}return C.jsx(UT,{...e})}const dP=_p.button`
881
881
  background-color: transparent;
882
882
  border: none;
883
883
  cursor: pointer;
package/dist/index.cjs.js CHANGED
@@ -726,7 +726,7 @@
726
726
  ${({theme:e})=>e.breakpoints.up("md")} {
727
727
  max-width: 320px;
728
728
  }
729
- `;function lh(){var e,r;const i=du(),{answerOf:o,actions:a,state:s}=xf(),{trackAnswer:l}=$p(),c=o("event_date"),d=c?new Date(c):void 0,f=rc(new Date,{days:2}),p="qualification"in s?gd.getAttributes({answers:s.qualification.answers,selectedCaterer:s.qualification.selectedCaterer}):null,h="en"===i.locale?null==(e=null==p?void 0:p.minDate)?void 0:e.messageEn:null==(r=null==p?void 0:p.minDate)?void 0:r.messageDe,[m]=n.useState(!!o(md.id));n.useEffect(()=>{c&&a.answerQuestion("has_recurring_need",m)},[m]);const[g,y]=n.useState(d||f);return t.jsx(rh,{dateSelector:t.jsxs(hh,{children:[t.jsx(mh,{children:t.jsx(u.DayPicker,{components:{Caption:ch,Row:dh,Day:uh},formatters:{formatWeekdayName:(e,t)=>rd(e,"EEEEE",{locale:null==t?void 0:t.locale})},month:g,onDayClick:e=>{a.answerQuestion("event_date",e),l("event_date",rd(e,"yyyy-MM-dd"))},selected:d,fromDate:f,onMonthChange:y,captionLayout:"buttons",locale:i.locale?qf[i.locale]:void 0,showOutsideDays:!0,mode:"single"})}),h&&t.jsx(v,{textAlign:"center",mt:2,children:t.jsxs(ph,{children:["*",h]})})]}),sideContent:t.jsx(oh,{})})}function uh(e){const{outside:n}=u.useActiveModifiers(e.date,e.displayMonth),r=u.useDayPicker();return n&&function(e){return ec(1,arguments),1===tc(e).getDate()}(e.date)?t.jsxs(v,{position:"relative",children:[t.jsx(v,{position:"absolute",top:"-3px",left:"-3px",children:t.jsx(D,{fontSize:9,children:rd(e.date,"MMM",{locale:r.locale})})}),t.jsx(u.Day,{...e})]}):t.jsx(u.Day,{...e})}function ch(e){const{goToMonth:n,nextMonth:r,previousMonth:i}=u.useNavigation(),o=u.useDayPicker();return t.jsxs(v,{display:"flex",justifyContent:"space-between",alignItems:"center",py:1.5,children:[t.jsx(fh,{id:"datepicker__prev-month",type:"button",disabled:!i,onClick:()=>i&&n(i),children:t.jsx(u.IconLeft,{})}),t.jsx(D,{fontSize:15,fontWeight:600,children:rd(e.displayMonth,"MMMM yyyy",{locale:o.locale})}),t.jsx(fh,{id:"datepicker__next-month",type:"button",disabled:!r,onClick:()=>r&&n(r),children:t.jsx(u.IconRight,{})})]})}function dh(e){const n=new Date;if(pd(n,e.displayMonth)){const r=od(e.displayMonth),i=od(n)-r,o=e.dates.map(e=>function(e,t){return ec(2,arguments),nc(e,7*Xu(t))}(e,i));return o.some(t=>pd(t,e.displayMonth))?t.jsx(u.Row,{...e,weekNumber:e.weekNumber+i,dates:o}):t.jsx(t.Fragment,{})}return t.jsx(u.Row,{...e})}const fh=o.button`
729
+ `;function lh(){var e,r,i;const o=du(),{answerOf:a,actions:s,state:l}=xf(),{trackAnswer:c}=$p(),d=a("event_date"),f=d?new Date(d):void 0,p=rc(new Date,{days:2}),h="qualification"in l?gd.getAttributes({answers:l.qualification.answers,selectedCaterer:l.qualification.selectedCaterer}):null,m=(null==(e=o.locale)?void 0:e.startsWith("en"))?null==(r=null==h?void 0:h.minDate)?void 0:r.messageEn:null==(i=null==h?void 0:h.minDate)?void 0:i.messageDe,[g]=n.useState(!!a(md.id));n.useEffect(()=>{d&&s.answerQuestion("has_recurring_need",g)},[g]);const[y,b]=n.useState(f||p);return t.jsx(rh,{dateSelector:t.jsxs(hh,{children:[t.jsx(mh,{children:t.jsx(u.DayPicker,{components:{Caption:ch,Row:dh,Day:uh},formatters:{formatWeekdayName:(e,t)=>rd(e,"EEEEE",{locale:null==t?void 0:t.locale})},month:y,onDayClick:e=>{s.answerQuestion("event_date",e),c("event_date",rd(e,"yyyy-MM-dd"))},selected:f,fromDate:p,onMonthChange:b,captionLayout:"buttons",locale:o.locale?qf[o.locale]:void 0,showOutsideDays:!0,mode:"single"})}),m&&t.jsx(v,{textAlign:"center",mt:2,children:t.jsxs(ph,{children:["*",m]})})]}),sideContent:t.jsx(oh,{})})}function uh(e){const{outside:n}=u.useActiveModifiers(e.date,e.displayMonth),r=u.useDayPicker();return n&&function(e){return ec(1,arguments),1===tc(e).getDate()}(e.date)?t.jsxs(v,{position:"relative",children:[t.jsx(v,{position:"absolute",top:"-3px",left:"-3px",children:t.jsx(D,{fontSize:9,children:rd(e.date,"MMM",{locale:r.locale})})}),t.jsx(u.Day,{...e})]}):t.jsx(u.Day,{...e})}function ch(e){const{goToMonth:n,nextMonth:r,previousMonth:i}=u.useNavigation(),o=u.useDayPicker();return t.jsxs(v,{display:"flex",justifyContent:"space-between",alignItems:"center",py:1.5,children:[t.jsx(fh,{id:"datepicker__prev-month",type:"button",disabled:!i,onClick:()=>i&&n(i),children:t.jsx(u.IconLeft,{})}),t.jsx(D,{fontSize:15,fontWeight:600,children:rd(e.displayMonth,"MMMM yyyy",{locale:o.locale})}),t.jsx(fh,{id:"datepicker__next-month",type:"button",disabled:!r,onClick:()=>r&&n(r),children:t.jsx(u.IconRight,{})})]})}function dh(e){const n=new Date;if(pd(n,e.displayMonth)){const r=od(e.displayMonth),i=od(n)-r,o=e.dates.map(e=>function(e,t){return ec(2,arguments),nc(e,7*Xu(t))}(e,i));return o.some(t=>pd(t,e.displayMonth))?t.jsx(u.Row,{...e,weekNumber:e.weekNumber+i,dates:o}):t.jsx(t.Fragment,{})}return t.jsx(u.Row,{...e})}const fh=o.button`
730
730
  background-color: transparent;
731
731
  border: none;
732
732
  cursor: pointer;
package/dist/index.esm.js CHANGED
@@ -10849,7 +10849,7 @@ const SwitchesWrapper = styled.div`
10849
10849
  `;
10850
10850
  const defaultLeadTimeInDays = DEFAULT_LEAD_DAYS;
10851
10851
  function DatePickerEmbedded() {
10852
- var _a2, _b;
10852
+ var _a2, _b, _c;
10853
10853
  const router = useRouter();
10854
10854
  const { answerOf, actions, state } = useQualification();
10855
10855
  const { trackAnswer } = useTracking();
@@ -10863,7 +10863,7 @@ function DatePickerEmbedded() {
10863
10863
  answers: state.qualification.answers,
10864
10864
  selectedCaterer: state.qualification.selectedCaterer
10865
10865
  }) : null;
10866
- const minDateMessage = router.locale === "en" ? (_a2 = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _a2.messageEn : (_b = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _b.messageDe;
10866
+ const minDateMessage = ((_a2 = router.locale) == null ? void 0 : _a2.startsWith("en")) ? (_b = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _b.messageEn : (_c = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _c.messageDe;
10867
10867
  const [isRecurringNeedSelected] = useState(
10868
10868
  !!answerOf(isRecurringQuestion.id)
10869
10869
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.19.5",
3
+ "version": "1.19.6",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",