@heycater/qualification-funnel 1.19.23 → 1.19.24
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.
- package/dist/heycater-funnel.iife.js +31 -8
- package/dist/index.cjs.js +31 -8
- package/dist/index.esm.js +36 -11
- package/package.json +1 -1
|
@@ -1612,6 +1612,11 @@
|
|
|
1612
1612
|
justify-content: center;
|
|
1613
1613
|
max-width: 790px;
|
|
1614
1614
|
}
|
|
1615
|
+
|
|
1616
|
+
@media (min-width: 1200px) {
|
|
1617
|
+
gap: 18px;
|
|
1618
|
+
max-width: 950px;
|
|
1619
|
+
}
|
|
1615
1620
|
`,dV=_p.button`
|
|
1616
1621
|
position: relative;
|
|
1617
1622
|
background: ${({$selected:e})=>e?VW:PW};
|
|
@@ -1634,6 +1639,12 @@
|
|
|
1634
1639
|
padding: 16px 12px;
|
|
1635
1640
|
}
|
|
1636
1641
|
|
|
1642
|
+
@media (min-width: 1200px) {
|
|
1643
|
+
width: 165px;
|
|
1644
|
+
height: 165px;
|
|
1645
|
+
border-radius: 16px;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1637
1648
|
@media (max-width: 639px) {
|
|
1638
1649
|
height: 118px;
|
|
1639
1650
|
padding: 12px 8px;
|
|
@@ -1700,6 +1711,11 @@
|
|
|
1700
1711
|
justify-content: center;
|
|
1701
1712
|
max-width: 620px;
|
|
1702
1713
|
}
|
|
1714
|
+
|
|
1715
|
+
@media (min-width: 1200px) {
|
|
1716
|
+
gap: 18px;
|
|
1717
|
+
max-width: 750px;
|
|
1718
|
+
}
|
|
1703
1719
|
`,xV=_p.button`
|
|
1704
1720
|
position: relative;
|
|
1705
1721
|
background: ${({$selected:e})=>e?VW:PW};
|
|
@@ -1722,6 +1738,12 @@
|
|
|
1722
1738
|
padding: 16px 12px;
|
|
1723
1739
|
}
|
|
1724
1740
|
|
|
1741
|
+
@media (min-width: 1200px) {
|
|
1742
|
+
width: 165px;
|
|
1743
|
+
height: 165px;
|
|
1744
|
+
border-radius: 16px;
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1725
1747
|
@media (max-width: 639px) {
|
|
1726
1748
|
height: 118px;
|
|
1727
1749
|
padding: 12px 8px;
|
|
@@ -2594,7 +2616,7 @@
|
|
|
2594
2616
|
opacity: 0.9;
|
|
2595
2617
|
transform: translateY(-1px);
|
|
2596
2618
|
}
|
|
2597
|
-
`,$H=({ratings:e,onCancel:t,funnelContextRef:n,updateContext:r})=>{var o;const{i18n:i}=Wd(),a=null==(o=i.language)?void 0:o.startsWith("de"),s=LE(),{state:l,actions:u,answerOf:c}=tj(),[d,f]=g.useState(0),[p,h]=g.useState("questions"),[m,v]=g.useState(20),[y,b]=g.useState(!1),[w,x]=g.useState(null),[k,S]=g.useState(null),E=g.useRef(!1),{submitAsNewCustomer:_}=Vq(),L=lU[d],O=t||(()=>window.history.back());g.useEffect(()=>{if("redesign_people_count"===L){const e=c("min_order_number"),t=c("price_per_person");void 0===e&&u.answerQuestion("min_order_number",100),void 0===t&&u.answerQuestion("price_per_person",m)}},[L,u,c,m]),g.useEffect(()=>{!E.current&&n.current.session_id&&(E.current=!0,gM(n.current,L))},[n.current.session_id,L]);const j=g.useCallback((e,t)=>{let r=t;t instanceof Date&&(r=DL(t,"yyyy-MM-dd")),pM(n.current,{step_id:L,step_index:d,question_id:e,answer_value:r,is_last_question:!0})},[n,d,L]),M=g.useCallback(()=>{const e=d+1;e>=lU.length?h("loading"):f(e)},[d]),T=g.useCallback(()=>{d>0&&f(d-1)},[d]),P=g.useCallback(e=>{const t=lU.indexOf(e);t>=0&&
|
|
2619
|
+
`,$H=({ratings:e,onCancel:t,funnelContextRef:n,updateContext:r})=>{var o;const{i18n:i}=Wd(),a=null==(o=i.language)?void 0:o.startsWith("de"),s=LE(),{state:l,actions:u,answerOf:c}=tj(),[d,f]=g.useState(0),[p,h]=g.useState("questions"),[m,v]=g.useState(20),[y,b]=g.useState(!1),[w,x]=g.useState(null),[k,S]=g.useState(null),E=g.useRef(!1),{submitAsNewCustomer:_}=Vq(),L=lU[d],O=t||(()=>window.history.back());g.useEffect(()=>{if("redesign_people_count"===L){const e=c("min_order_number"),t=c("price_per_person");void 0===e&&u.answerQuestion("min_order_number",100),void 0===t&&u.answerQuestion("price_per_person",m)}},[L,u,c,m]),g.useEffect(()=>{!E.current&&n.current.session_id&&(E.current=!0,gM(n.current,L))},[n.current.session_id,L]);const j=g.useCallback((e,t)=>{let r=t;t instanceof Date&&(r=DL(t,"yyyy-MM-dd")),pM(n.current,{step_id:L,step_index:d,question_id:e,answer_value:r,is_last_question:!0})},[n,d,L]),M=g.useCallback(()=>{const e=d+1;e>=lU.length?h("loading"):f(e)},[d]),T=g.useCallback(()=>{d>0&&f(d-1)},[d]),P=g.useCallback(e=>{const t=lU.indexOf(e);t>=0&&("contact"===p&&h("questions"),f(t))},[p]),D=g.useCallback(e=>{u.answerQuestion("city",e),j("city",e),r({city:e}),M()},[u,j,r,M]),N=g.useCallback(e=>{const t=function(e){return lO[e]}(e);u.answerQuestion("event_type",e),u.answerQuestion("service_type",t.service_type),u.answerQuestion("catering_categories",[t.catering_category]),j("event_type",e),r({service_type:t.service_type,total_steps:cU()}),M()},[u,j,r,M]),R=g.useCallback(e=>{e&&(u.answerQuestion("event_date",e),j("event_date",e))},[u,j]),A=g.useCallback(e=>{u.answerQuestion("is_multi_day",e),j("is_multi_day",e)},[u,j]),F=g.useCallback(e=>{u.answerQuestion("min_order_number",e),j("min_order_number",e)},[u,j]),I=g.useCallback(e=>{v(e),u.answerQuestion("price_per_person",e),j("price_per_person",e)},[u,j]),z=g.useCallback(()=>{h("contact")},[]),$=g.useCallback(async e=>{b(!0);try{const t={first_name:e.vorname,last_name:e.nachname,company:e.firma,email:e.email,phone:e.telefon,deliveryAddressStreet:e.deliveryAddressStreet,deliveryAddressStreetNumber:e.deliveryAddressStreetNumber,deliveryAddressPostalCode:e.deliveryAddressPostalCode,deliveryAddressCity:e.deliveryAddressCity,deliveryAddressCountry:e.deliveryAddressCountry||"Germany",comment:e.kommentar},r=await _(t),{signInToken:o,opportunity:i}=r||{};if(null==i?void 0:i.id){const e=o?`/${s.locale}/account/requests/${i.id}?one_time_sign_in_token=${o}`:`/${s.locale}/account/external/requests/${i.id}`;S(e)}mM(n.current),x(e),h("done")}catch(t){console.error("Failed to submit request:",t),b(!1)}},[_,n,s.locale]),B=g.useCallback(()=>{h("questions"),f(lU.length-1)},[]),q=g.useCallback(()=>{switch(L){case"redesign_city":return!!c("city");case"redesign_event_type":return!!c("event_type");case"redesign_date":return!!c("event_date");case"redesign_people_count":const e=c("min_order_number");return"number"==typeof e&&e>0;default:return!1}},[L,c]);if("loading"===p)return C.jsx(qH,{children:C.jsx(WH,{$fullWidth:!0,children:C.jsx(FU,{onComplete:z})})});if("contact"===p){const e=a?"Fast geschafft – nur noch deine Kontaktdaten":"Almost done – just your contact details",t=a?"Danach meldet sich dein Cateringexperte und schickt dir passende Angebote.":"Your catering expert will then get in touch and send you matching offers.";return C.jsxs(qH,{children:[C.jsx(fU,{currentStepId:sU,onStepClick:P}),C.jsxs(WH,{children:[C.jsxs(VH,{children:[C.jsx(UH,{children:C.jsx(xD,{height:20})}),C.jsx(HH,{children:C.jsx(ZH,{children:a?"Schritt 5 von 5":"Step 5 of 5"})}),C.jsx(KH,{children:C.jsx(GH,{$progress:100})})]}),C.jsxs(QH,{children:[C.jsx(JH,{onClick:O,children:a?"Abbrechen":"Cancel"}),C.jsx(XH,{children:a?"Schritt 5 von 5":"Step 5 of 5"})]}),C.jsxs(fZ,{children:[C.jsx(tZ,{children:e}),C.jsx(nZ,{children:t}),C.jsx(JU,{onSubmit:$,onBack:B,isSubmitting:y})]})]})]})}if("done"===p){const e=(null==w?void 0:w.vorname)||"",t=(null==w?void 0:w.email)||"",n=a?[{n:"1",title:"Wir prüfen deine Anfrage",desc:"Unser Team schaut sich deine Anfrage an."},{n:"2",title:"Du erhältst Angebote",desc:"Innerhalb weniger Stunden bekommst du bis zu 3 passende Angebote."},{n:"3",title:"Buche deinen Favoriten",desc:"Vergleiche die Angebote und buche, wenn du bereit bist."}]:[{n:"1",title:"We review your request",desc:"Our team will look at your request."},{n:"2",title:"You receive offers",desc:"Within a few hours you'll receive up to 3 matching offers."},{n:"3",title:"Book your favorite",desc:"Compare the offers and book when you're ready."}];return C.jsx(qH,{children:C.jsx(WH,{$fullWidth:!0,children:C.jsxs(pZ,{children:[C.jsx(hZ,{children:C.jsx(xD,{height:24})}),C.jsxs(mZ,{children:[C.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("path",{d:"M20 6L9 17l-5-5"})}),a?"Anfrage gesendet":"Request sent"]}),C.jsx(gZ,{children:a?`Danke, ${e}!`:`Thank you, ${e}!`}),C.jsx(vZ,{children:a?"Wir haben deine Anfrage erhalten und stellen jetzt passende Angebote für dich zusammen.":"We have received your request and are now putting together matching offers for you."}),C.jsxs(yZ,{children:[C.jsx(bZ,{children:a?"So geht es weiter":"What happens next"}),C.jsx(wZ,{children:n.map(e=>C.jsxs(xZ,{children:[C.jsx(CZ,{children:e.n}),C.jsxs(kZ,{children:[C.jsx(SZ,{children:e.title}),C.jsx(EZ,{children:e.desc})]})]},e.n))})]}),C.jsx(_Z,{children:a?C.jsxs(C.Fragment,{children:["Eine Bestätigung ist unterwegs an ",C.jsx("strong",{children:t}),"."]}):C.jsxs(C.Fragment,{children:["A confirmation is on its way to ",C.jsx("strong",{children:t}),"."]})}),k&&C.jsx(LZ,{onClick:()=>window.location.href=k,children:a?"Zu meiner Anfrage":"View my request"})]})})})}const W=uU[L],V=a?W.titleDe:W.titleEn,U=a?W.subtitleDe:W.subtitleEn,H=cU(),Z=(()=>{const e=[],t=c("city"),n=c("event_type"),r=c("event_date");if(t&&e.push(eV[t]||t),n&&d>=2){const t=a?tV:nV;e.push(t[n]||n)}return d>=3&&r&&e.push(DL(r,"dd.MM.yy")),e})(),Y=d>0,K=d>=1&&Z.length>0;return C.jsxs(qH,{children:[C.jsx(fU,{currentStepId:L,onStepClick:P}),C.jsxs(WH,{children:[C.jsxs(VH,{children:[C.jsx(UH,{children:C.jsx(xD,{height:20})}),C.jsxs(HH,{children:[C.jsx(ZH,{children:a?`Schritt ${d+1} von ${H}`:`Step ${d+1} of ${H}`}),C.jsx(YH,{onClick:O,children:a?"Abbrechen":"Cancel"})]}),C.jsx(KH,{children:C.jsx(GH,{$progress:(d+1)/H*100})})]}),C.jsxs(QH,{children:[C.jsx(JH,{onClick:O,children:a?"Abbrechen":"Cancel"}),C.jsx(XH,{children:a?`Schritt ${d+1} von ${H}`:`Step ${d+1} of ${H}`})]}),C.jsxs(eZ,{children:[C.jsx(tZ,{children:V}),U&&C.jsx(nZ,{children:U}),C.jsx(rZ,{children:(()=>{switch(L){case"redesign_city":return C.jsx(aV,{selected:c("city"),onSelect:D});case"redesign_event_type":return C.jsx(gV,{selected:c("event_type"),onSelect:N,variant:"primary"});case"redesign_date":return C.jsx(EV,{value:c("event_date"),onChange:R,isMultiDay:!!c("is_multi_day"),onMultiDayChange:A});case"redesign_people_count":return C.jsx(qV,{peopleCount:c("min_order_number")||100,budgetPerPerson:m,onPeopleCountChange:F,onBudgetPerPersonChange:I});default:return null}})()})]}),C.jsxs(oZ,{children:[K&&C.jsxs(iZ,{children:[C.jsx(aZ,{children:a?"Deine Auswahl:":"Your selection:"}),Z.map((e,t)=>C.jsx(lZ,{children:e},t))]}),C.jsxs(sZ,{children:[C.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("path",{d:"M20 6L9 17l-5-5"})}),a?"Deine Anfrage ist kostenlos & unverbindlich":"Your request is free & non-binding"]}),C.jsxs(uZ,{children:[Y&&C.jsx(cZ,{type:"button",onClick:T,children:a?"Zurück":"Back"}),C.jsx(dZ,{type:"button",onClick:M,disabled:!q(),children:a?"Weiter":"Continue"})]})]})]})]})},BH=Op`
|
|
2598
2620
|
from { opacity: 0; transform: translateY(8px); }
|
|
2599
2621
|
to { opacity: 1; transform: none; }
|
|
2600
2622
|
`,qH=_p.div`
|
|
@@ -2606,6 +2628,9 @@
|
|
|
2606
2628
|
display: flex;
|
|
2607
2629
|
flex-direction: column;
|
|
2608
2630
|
min-width: 0;
|
|
2631
|
+
min-height: 0;
|
|
2632
|
+
height: 100vh;
|
|
2633
|
+
overflow: hidden;
|
|
2609
2634
|
${({$fullWidth:e})=>e&&"width: 100%;"}
|
|
2610
2635
|
`,VH=_p.div`
|
|
2611
2636
|
flex: none;
|
|
@@ -2672,13 +2697,14 @@
|
|
|
2672
2697
|
display: flex;
|
|
2673
2698
|
flex-direction: column;
|
|
2674
2699
|
align-items: center;
|
|
2675
|
-
justify-content:
|
|
2700
|
+
justify-content: flex-start;
|
|
2676
2701
|
overflow-y: auto;
|
|
2677
|
-
padding: 14px 18px
|
|
2702
|
+
padding: 14px 18px 20px;
|
|
2678
2703
|
animation: ${BH} 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both;
|
|
2679
2704
|
|
|
2680
2705
|
@media (min-width: 960px) {
|
|
2681
|
-
padding: 40px 44px
|
|
2706
|
+
padding: 40px 44px 30px;
|
|
2707
|
+
justify-content: center;
|
|
2682
2708
|
}
|
|
2683
2709
|
`,tZ=_p.h1`
|
|
2684
2710
|
font-family: ${ZW};
|
|
@@ -2719,10 +2745,7 @@
|
|
|
2719
2745
|
margin-top: 32px;
|
|
2720
2746
|
}
|
|
2721
2747
|
`,oZ=_p.div`
|
|
2722
|
-
|
|
2723
|
-
bottom: 0;
|
|
2724
|
-
left: 0;
|
|
2725
|
-
right: 0;
|
|
2748
|
+
flex: none;
|
|
2726
2749
|
padding: 12px 18px 16px;
|
|
2727
2750
|
display: flex;
|
|
2728
2751
|
flex-direction: column;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1524,6 +1524,11 @@ object-assign
|
|
|
1524
1524
|
justify-content: center;
|
|
1525
1525
|
max-width: 790px;
|
|
1526
1526
|
}
|
|
1527
|
+
|
|
1528
|
+
@media (min-width: 1200px) {
|
|
1529
|
+
gap: 18px;
|
|
1530
|
+
max-width: 950px;
|
|
1531
|
+
}
|
|
1527
1532
|
`,eO=o.button`
|
|
1528
1533
|
position: relative;
|
|
1529
1534
|
background: ${({$selected:e})=>e?zE:CE};
|
|
@@ -1546,6 +1551,12 @@ object-assign
|
|
|
1546
1551
|
padding: 16px 12px;
|
|
1547
1552
|
}
|
|
1548
1553
|
|
|
1554
|
+
@media (min-width: 1200px) {
|
|
1555
|
+
width: 165px;
|
|
1556
|
+
height: 165px;
|
|
1557
|
+
border-radius: 16px;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1549
1560
|
@media (max-width: 639px) {
|
|
1550
1561
|
height: 118px;
|
|
1551
1562
|
padding: 12px 8px;
|
|
@@ -1612,6 +1623,11 @@ object-assign
|
|
|
1612
1623
|
justify-content: center;
|
|
1613
1624
|
max-width: 620px;
|
|
1614
1625
|
}
|
|
1626
|
+
|
|
1627
|
+
@media (min-width: 1200px) {
|
|
1628
|
+
gap: 18px;
|
|
1629
|
+
max-width: 750px;
|
|
1630
|
+
}
|
|
1615
1631
|
`,cO=o.button`
|
|
1616
1632
|
position: relative;
|
|
1617
1633
|
background: ${({$selected:e})=>e?zE:CE};
|
|
@@ -1634,6 +1650,12 @@ object-assign
|
|
|
1634
1650
|
padding: 16px 12px;
|
|
1635
1651
|
}
|
|
1636
1652
|
|
|
1653
|
+
@media (min-width: 1200px) {
|
|
1654
|
+
width: 165px;
|
|
1655
|
+
height: 165px;
|
|
1656
|
+
border-radius: 16px;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1637
1659
|
@media (max-width: 639px) {
|
|
1638
1660
|
height: 118px;
|
|
1639
1661
|
padding: 12px 8px;
|
|
@@ -2506,7 +2528,7 @@ object-assign
|
|
|
2506
2528
|
opacity: 0.9;
|
|
2507
2529
|
transform: translateY(-1px);
|
|
2508
2530
|
}
|
|
2509
|
-
`,ED=({ratings:e,onCancel:r,funnelContextRef:o,updateContext:a})=>{var s;const{i18n:l}=i.useTranslation(),u=null==(s=l.language)?void 0:s.startsWith("de"),c=du(),{state:d,actions:f,answerOf:p}=Mf(),[h,m]=n.useState(0),[g,y]=n.useState("questions"),[v,b]=n.useState(20),[x,C]=n.useState(!1),[w,L]=n.useState(null),[k,j]=n.useState(null),M=n.useRef(!1),{submitAsNewCustomer:S}=z_(),_=QO[h],E=r||(()=>window.history.back());n.useEffect(()=>{if("redesign_people_count"===_){const e=p("min_order_number"),t=p("price_per_person");void 0===e&&f.answerQuestion("min_order_number",100),void 0===t&&f.answerQuestion("price_per_person",v)}},[_,f,p,v]),n.useEffect(()=>{!M.current&&o.current.session_id&&(M.current=!0,qp(o.current,_))},[o.current.session_id,_]);const O=n.useCallback((e,t)=>{let n=t;t instanceof Date&&(n=rd(t,"yyyy-MM-dd")),Rp(o.current,{step_id:_,step_index:h,question_id:e,answer_value:n,is_last_question:!0})},[o,h,_]),$=n.useCallback(()=>{const e=h+1;e>=QO.length?y("loading"):m(e)},[h]),D=n.useCallback(()=>{h>0&&m(h-1)},[h]),z=n.useCallback(e=>{const t=QO.indexOf(e);t>=0&&
|
|
2531
|
+
`,ED=({ratings:e,onCancel:r,funnelContextRef:o,updateContext:a})=>{var s;const{i18n:l}=i.useTranslation(),u=null==(s=l.language)?void 0:s.startsWith("de"),c=du(),{state:d,actions:f,answerOf:p}=Mf(),[h,m]=n.useState(0),[g,y]=n.useState("questions"),[v,b]=n.useState(20),[x,C]=n.useState(!1),[w,L]=n.useState(null),[k,j]=n.useState(null),M=n.useRef(!1),{submitAsNewCustomer:S}=z_(),_=QO[h],E=r||(()=>window.history.back());n.useEffect(()=>{if("redesign_people_count"===_){const e=p("min_order_number"),t=p("price_per_person");void 0===e&&f.answerQuestion("min_order_number",100),void 0===t&&f.answerQuestion("price_per_person",v)}},[_,f,p,v]),n.useEffect(()=>{!M.current&&o.current.session_id&&(M.current=!0,qp(o.current,_))},[o.current.session_id,_]);const O=n.useCallback((e,t)=>{let n=t;t instanceof Date&&(n=rd(t,"yyyy-MM-dd")),Rp(o.current,{step_id:_,step_index:h,question_id:e,answer_value:n,is_last_question:!0})},[o,h,_]),$=n.useCallback(()=>{const e=h+1;e>=QO.length?y("loading"):m(e)},[h]),D=n.useCallback(()=>{h>0&&m(h-1)},[h]),z=n.useCallback(e=>{const t=QO.indexOf(e);t>=0&&("contact"===g&&y("questions"),m(t))},[g]),A=n.useCallback(e=>{f.answerQuestion("city",e),O("city",e),a({city:e}),$()},[f,O,a,$]),T=n.useCallback(e=>{const t=function(e){return Dd[e]}(e);f.answerQuestion("event_type",e),f.answerQuestion("service_type",t.service_type),f.answerQuestion("catering_categories",[t.catering_category]),O("event_type",e),a({service_type:t.service_type,total_steps:XO()}),$()},[f,O,a,$]),P=n.useCallback(e=>{e&&(f.answerQuestion("event_date",e),O("event_date",e))},[f,O]),F=n.useCallback(e=>{f.answerQuestion("is_multi_day",e),O("is_multi_day",e)},[f,O]),R=n.useCallback(e=>{f.answerQuestion("min_order_number",e),O("min_order_number",e)},[f,O]),I=n.useCallback(e=>{b(e),f.answerQuestion("price_per_person",e),O("price_per_person",e)},[f,O]),N=n.useCallback(()=>{y("contact")},[]),q=n.useCallback(async e=>{C(!0);try{const t={first_name:e.vorname,last_name:e.nachname,company:e.firma,email:e.email,phone:e.telefon,deliveryAddressStreet:e.deliveryAddressStreet,deliveryAddressStreetNumber:e.deliveryAddressStreetNumber,deliveryAddressPostalCode:e.deliveryAddressPostalCode,deliveryAddressCity:e.deliveryAddressCity,deliveryAddressCountry:e.deliveryAddressCountry||"Germany",comment:e.kommentar},n=await S(t),{signInToken:r,opportunity:i}=n||{};if(null==i?void 0:i.id){const e=r?`/${c.locale}/account/requests/${i.id}?one_time_sign_in_token=${r}`:`/${c.locale}/account/external/requests/${i.id}`;j(e)}Np(o.current),L(e),y("done")}catch(t){console.error("Failed to submit request:",t),C(!1)}},[S,o,c.locale]),Z=n.useCallback(()=>{y("questions"),m(QO.length-1)},[]),B=n.useCallback(()=>{switch(_){case"redesign_city":return!!p("city");case"redesign_event_type":return!!p("event_type");case"redesign_date":return!!p("event_date");case"redesign_people_count":const e=p("min_order_number");return"number"==typeof e&&e>0;default:return!1}},[_,p]);if("loading"===g)return t.jsx($D,{children:t.jsx(DD,{$fullWidth:!0,children:t.jsx(M$,{onComplete:N})})});if("contact"===g){const e=u?"Fast geschafft – nur noch deine Kontaktdaten":"Almost done – just your contact details",n=u?"Danach meldet sich dein Cateringexperte und schickt dir passende Angebote.":"Your catering expert will then get in touch and send you matching offers.";return t.jsxs($D,{children:[t.jsx(t$,{currentStepId:YO,onStepClick:z}),t.jsxs(DD,{children:[t.jsxs(zD,{children:[t.jsx(AD,{children:t.jsx(xm,{height:20})}),t.jsx(TD,{children:t.jsx(PD,{children:u?"Schritt 5 von 5":"Step 5 of 5"})}),t.jsx(RD,{children:t.jsx(ID,{$progress:100})})]}),t.jsxs(ND,{children:[t.jsx(qD,{onClick:E,children:u?"Abbrechen":"Cancel"}),t.jsx(ZD,{children:u?"Schritt 5 von 5":"Step 5 of 5"})]}),t.jsxs(tz,{children:[t.jsx(WD,{children:e}),t.jsx(VD,{children:n}),t.jsx(q$,{onSubmit:q,onBack:Z,isSubmitting:x})]})]})]})}if("done"===g){const e=(null==w?void 0:w.vorname)||"",n=(null==w?void 0:w.email)||"",r=u?[{n:"1",title:"Wir prüfen deine Anfrage",desc:"Unser Team schaut sich deine Anfrage an."},{n:"2",title:"Du erhältst Angebote",desc:"Innerhalb weniger Stunden bekommst du bis zu 3 passende Angebote."},{n:"3",title:"Buche deinen Favoriten",desc:"Vergleiche die Angebote und buche, wenn du bereit bist."}]:[{n:"1",title:"We review your request",desc:"Our team will look at your request."},{n:"2",title:"You receive offers",desc:"Within a few hours you'll receive up to 3 matching offers."},{n:"3",title:"Book your favorite",desc:"Compare the offers and book when you're ready."}];return t.jsx($D,{children:t.jsx(DD,{$fullWidth:!0,children:t.jsxs(nz,{children:[t.jsx(rz,{children:t.jsx(xm,{height:24})}),t.jsxs(iz,{children:[t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M20 6L9 17l-5-5"})}),u?"Anfrage gesendet":"Request sent"]}),t.jsx(oz,{children:u?`Danke, ${e}!`:`Thank you, ${e}!`}),t.jsx(az,{children:u?"Wir haben deine Anfrage erhalten und stellen jetzt passende Angebote für dich zusammen.":"We have received your request and are now putting together matching offers for you."}),t.jsxs(sz,{children:[t.jsx(lz,{children:u?"So geht es weiter":"What happens next"}),t.jsx(uz,{children:r.map(e=>t.jsxs(cz,{children:[t.jsx(dz,{children:e.n}),t.jsxs(fz,{children:[t.jsx(pz,{children:e.title}),t.jsx(hz,{children:e.desc})]})]},e.n))})]}),t.jsx(mz,{children:u?t.jsxs(t.Fragment,{children:["Eine Bestätigung ist unterwegs an ",t.jsx("strong",{children:n}),"."]}):t.jsxs(t.Fragment,{children:["A confirmation is on its way to ",t.jsx("strong",{children:n}),"."]})}),k&&t.jsx(gz,{onClick:()=>window.location.href=k,children:u?"Zu meiner Anfrage":"View my request"})]})})})}const W=JO[_],V=u?W.titleDe:W.titleEn,U=u?W.subtitleDe:W.subtitleEn,H=XO(),G=(()=>{const e=[],t=p("city"),n=p("event_type"),r=p("event_date");if(t&&e.push(BE[t]||t),n&&h>=2){const t=u?WE:VE;e.push(t[n]||n)}return h>=3&&r&&e.push(rd(r,"dd.MM.yy")),e})(),K=h>0,Y=h>=1&&G.length>0;return t.jsxs($D,{children:[t.jsx(t$,{currentStepId:_,onStepClick:z}),t.jsxs(DD,{children:[t.jsxs(zD,{children:[t.jsx(AD,{children:t.jsx(xm,{height:20})}),t.jsxs(TD,{children:[t.jsx(PD,{children:u?`Schritt ${h+1} von ${H}`:`Step ${h+1} of ${H}`}),t.jsx(FD,{onClick:E,children:u?"Abbrechen":"Cancel"})]}),t.jsx(RD,{children:t.jsx(ID,{$progress:(h+1)/H*100})})]}),t.jsxs(ND,{children:[t.jsx(qD,{onClick:E,children:u?"Abbrechen":"Cancel"}),t.jsx(ZD,{children:u?`Schritt ${h+1} von ${H}`:`Step ${h+1} of ${H}`})]}),t.jsxs(BD,{children:[t.jsx(WD,{children:V}),U&&t.jsx(VD,{children:U}),t.jsx(UD,{children:(()=>{switch(_){case"redesign_city":return t.jsx(KE,{selected:p("city"),onSelect:A});case"redesign_event_type":return t.jsx(oO,{selected:p("event_type"),onSelect:T,variant:"primary"});case"redesign_date":return t.jsx(hO,{value:p("event_date"),onChange:P,isMultiDay:!!p("is_multi_day"),onMultiDayChange:F});case"redesign_people_count":return t.jsx($O,{peopleCount:p("min_order_number")||100,budgetPerPerson:v,onPeopleCountChange:R,onBudgetPerPersonChange:I});default:return null}})()})]}),t.jsxs(HD,{children:[Y&&t.jsxs(GD,{children:[t.jsx(KD,{children:u?"Deine Auswahl:":"Your selection:"}),G.map((e,n)=>t.jsx(QD,{children:e},n))]}),t.jsxs(YD,{children:[t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M20 6L9 17l-5-5"})}),u?"Deine Anfrage ist kostenlos & unverbindlich":"Your request is free & non-binding"]}),t.jsxs(JD,{children:[K&&t.jsx(XD,{type:"button",onClick:D,children:u?"Zurück":"Back"}),t.jsx(ez,{type:"button",onClick:$,disabled:!B(),children:u?"Weiter":"Continue"})]})]})]})]})},OD=o.keyframes`
|
|
2510
2532
|
from { opacity: 0; transform: translateY(8px); }
|
|
2511
2533
|
to { opacity: 1; transform: none; }
|
|
2512
2534
|
`,$D=o.div`
|
|
@@ -2518,6 +2540,9 @@ object-assign
|
|
|
2518
2540
|
display: flex;
|
|
2519
2541
|
flex-direction: column;
|
|
2520
2542
|
min-width: 0;
|
|
2543
|
+
min-height: 0;
|
|
2544
|
+
height: 100vh;
|
|
2545
|
+
overflow: hidden;
|
|
2521
2546
|
${({$fullWidth:e})=>e&&"width: 100%;"}
|
|
2522
2547
|
`,zD=o.div`
|
|
2523
2548
|
flex: none;
|
|
@@ -2584,13 +2609,14 @@ object-assign
|
|
|
2584
2609
|
display: flex;
|
|
2585
2610
|
flex-direction: column;
|
|
2586
2611
|
align-items: center;
|
|
2587
|
-
justify-content:
|
|
2612
|
+
justify-content: flex-start;
|
|
2588
2613
|
overflow-y: auto;
|
|
2589
|
-
padding: 14px 18px
|
|
2614
|
+
padding: 14px 18px 20px;
|
|
2590
2615
|
animation: ${OD} 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both;
|
|
2591
2616
|
|
|
2592
2617
|
@media (min-width: 960px) {
|
|
2593
|
-
padding: 40px 44px
|
|
2618
|
+
padding: 40px 44px 30px;
|
|
2619
|
+
justify-content: center;
|
|
2594
2620
|
}
|
|
2595
2621
|
`,WD=o.h1`
|
|
2596
2622
|
font-family: ${PE};
|
|
@@ -2631,10 +2657,7 @@ object-assign
|
|
|
2631
2657
|
margin-top: 32px;
|
|
2632
2658
|
}
|
|
2633
2659
|
`,HD=o.div`
|
|
2634
|
-
|
|
2635
|
-
bottom: 0;
|
|
2636
|
-
left: 0;
|
|
2637
|
-
right: 0;
|
|
2660
|
+
flex: none;
|
|
2638
2661
|
padding: 12px 18px 16px;
|
|
2639
2662
|
display: flex;
|
|
2640
2663
|
flex-direction: column;
|
package/dist/index.esm.js
CHANGED
|
@@ -30441,6 +30441,11 @@ const TilesWrapper$1 = styled.div`
|
|
|
30441
30441
|
justify-content: center;
|
|
30442
30442
|
max-width: 790px;
|
|
30443
30443
|
}
|
|
30444
|
+
|
|
30445
|
+
@media (min-width: 1200px) {
|
|
30446
|
+
gap: 18px;
|
|
30447
|
+
max-width: 950px;
|
|
30448
|
+
}
|
|
30444
30449
|
`;
|
|
30445
30450
|
const CityTile = styled.button`
|
|
30446
30451
|
position: relative;
|
|
@@ -30464,6 +30469,12 @@ const CityTile = styled.button`
|
|
|
30464
30469
|
padding: 16px 12px;
|
|
30465
30470
|
}
|
|
30466
30471
|
|
|
30472
|
+
@media (min-width: 1200px) {
|
|
30473
|
+
width: 165px;
|
|
30474
|
+
height: 165px;
|
|
30475
|
+
border-radius: 16px;
|
|
30476
|
+
}
|
|
30477
|
+
|
|
30467
30478
|
@media (max-width: 639px) {
|
|
30468
30479
|
height: 118px;
|
|
30469
30480
|
padding: 12px 8px;
|
|
@@ -30595,6 +30606,11 @@ const TilesWrapper = styled.div`
|
|
|
30595
30606
|
justify-content: center;
|
|
30596
30607
|
max-width: 620px;
|
|
30597
30608
|
}
|
|
30609
|
+
|
|
30610
|
+
@media (min-width: 1200px) {
|
|
30611
|
+
gap: 18px;
|
|
30612
|
+
max-width: 750px;
|
|
30613
|
+
}
|
|
30598
30614
|
`;
|
|
30599
30615
|
const EventTile = styled.button`
|
|
30600
30616
|
position: relative;
|
|
@@ -30618,6 +30634,12 @@ const EventTile = styled.button`
|
|
|
30618
30634
|
padding: 16px 12px;
|
|
30619
30635
|
}
|
|
30620
30636
|
|
|
30637
|
+
@media (min-width: 1200px) {
|
|
30638
|
+
width: 165px;
|
|
30639
|
+
height: 165px;
|
|
30640
|
+
border-radius: 16px;
|
|
30641
|
+
}
|
|
30642
|
+
|
|
30621
30643
|
@media (max-width: 639px) {
|
|
30622
30644
|
height: 118px;
|
|
30623
30645
|
padding: 12px 8px;
|
|
@@ -32281,10 +32303,13 @@ const RedesignedFunnel = ({
|
|
|
32281
32303
|
}, [currentStepIndex]);
|
|
32282
32304
|
const goToStep = useCallback((stepId) => {
|
|
32283
32305
|
const index = REDESIGN_STEP_ORDER.indexOf(stepId);
|
|
32284
|
-
if (index >= 0
|
|
32306
|
+
if (index >= 0) {
|
|
32307
|
+
if (phase === "contact") {
|
|
32308
|
+
setPhase("questions");
|
|
32309
|
+
}
|
|
32285
32310
|
setCurrentStepIndex(index);
|
|
32286
32311
|
}
|
|
32287
|
-
}, [
|
|
32312
|
+
}, [phase]);
|
|
32288
32313
|
const handleCitySelect = useCallback((city) => {
|
|
32289
32314
|
actions.answerQuestion("city", city);
|
|
32290
32315
|
trackAnswer("city", city);
|
|
@@ -32395,8 +32420,7 @@ const RedesignedFunnel = ({
|
|
|
32395
32420
|
const contactTitle = isGerman ? "Fast geschafft – nur noch deine Kontaktdaten" : "Almost done – just your contact details";
|
|
32396
32421
|
const contactSubtitle = isGerman ? "Danach meldet sich dein Cateringexperte und schickt dir passende Angebote." : "Your catering expert will then get in touch and send you matching offers.";
|
|
32397
32422
|
return /* @__PURE__ */ jsxs(FunnelContainer, { children: [
|
|
32398
|
-
/* @__PURE__ */ jsx(StepRail, { currentStepId: REDESIGN_STEP_IDS.contact, onStepClick:
|
|
32399
|
-
} }),
|
|
32423
|
+
/* @__PURE__ */ jsx(StepRail, { currentStepId: REDESIGN_STEP_IDS.contact, onStepClick: goToStep }),
|
|
32400
32424
|
/* @__PURE__ */ jsxs(MainContent, { children: [
|
|
32401
32425
|
/* @__PURE__ */ jsxs(MobileHeader, { children: [
|
|
32402
32426
|
/* @__PURE__ */ jsx(MobileLogoWrapper, { children: /* @__PURE__ */ jsx(Logo, { height: 20 }) }),
|
|
@@ -32573,6 +32597,9 @@ const MainContent = styled.div`
|
|
|
32573
32597
|
display: flex;
|
|
32574
32598
|
flex-direction: column;
|
|
32575
32599
|
min-width: 0;
|
|
32600
|
+
min-height: 0;
|
|
32601
|
+
height: 100vh;
|
|
32602
|
+
overflow: hidden;
|
|
32576
32603
|
${({ $fullWidth }) => $fullWidth && "width: 100%;"}
|
|
32577
32604
|
`;
|
|
32578
32605
|
const MobileHeader = styled.div`
|
|
@@ -32650,13 +32677,14 @@ const ContentArea = styled.div`
|
|
|
32650
32677
|
display: flex;
|
|
32651
32678
|
flex-direction: column;
|
|
32652
32679
|
align-items: center;
|
|
32653
|
-
justify-content:
|
|
32680
|
+
justify-content: flex-start;
|
|
32654
32681
|
overflow-y: auto;
|
|
32655
|
-
padding: 14px 18px
|
|
32682
|
+
padding: 14px 18px 20px;
|
|
32656
32683
|
animation: ${fadeIn} 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both;
|
|
32657
32684
|
|
|
32658
32685
|
@media (min-width: 960px) {
|
|
32659
|
-
padding: 40px 44px
|
|
32686
|
+
padding: 40px 44px 30px;
|
|
32687
|
+
justify-content: center;
|
|
32660
32688
|
}
|
|
32661
32689
|
`;
|
|
32662
32690
|
const StepTitle = styled.h1`
|
|
@@ -32701,10 +32729,7 @@ const StepContent = styled.div`
|
|
|
32701
32729
|
}
|
|
32702
32730
|
`;
|
|
32703
32731
|
const FooterBar = styled.div`
|
|
32704
|
-
|
|
32705
|
-
bottom: 0;
|
|
32706
|
-
left: 0;
|
|
32707
|
-
right: 0;
|
|
32732
|
+
flex: none;
|
|
32708
32733
|
padding: 12px 18px 16px;
|
|
32709
32734
|
display: flex;
|
|
32710
32735
|
flex-direction: column;
|