@heycater/qualification-funnel 1.3.5 → 1.3.7

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/index.cjs.js CHANGED
@@ -324,10 +324,8 @@
324
324
  ::-webkit-scrollbar-thumb:hover {
325
325
  background: #555;
326
326
  }
327
- `,Gf=({title:e,subtitle:n,content:r,containerSize:i="sm",disableGutters:o,answerContainerSize:a=826,side:s,wrapper:l,mode:u="embedded",...c})=>{const d="fullscreen"===u,{state:f}=yf(),p=kf("sm");if(f.status!==V&&f.status!==W&&f.status!==U)return null;const h=f.status===W?f.qualification.step:null,g=f.qualification.steps,m=h?g.findIndex(({id:e})=>e===h.id):-1,y=f.status===W&&m>0;return t.jsxs(Z,{size:i,disableGutters:o,...d?{style:{display:"flex",flexDirection:"column",flexGrow:1}}:{},...c,children:[t.jsxs(Kf,{bgcolor:"white"===l?"white":"transparent",minHeight:d?void 0:{xs:0,md:"670px"},display:"flex",width:"100%",color:"rgba(0,0,0,0.8)",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",position:p?"inherit":"relative",...d?{flexGrow:1,style:{paddingBottom:"80px"}}:{},children:[t.jsxs(Yf,{position:"inherit",width:"100%",flexGrow:1,display:"flex",flexDirection:{xs:"column",md:"row"},mb:d?0:4,alignItems:{xs:"center",md:"flex-start"},children:[t.jsx(v,{flexGrow:0,width:{xs:"100%",md:"min-content"},maxWidth:"500px",children:s}),t.jsxs(v,{flexGrow:1,display:"flex",flexDirection:"column",alignSelf:"stretch",children:[t.jsxs(Qf,{children:[t.jsx(v,{textAlign:"center",mb:d?4:2,maxWidth:d?650:550,mx:"auto",children:"string"==typeof e?d?t.jsxs(Xf,{children:[e," "]}):t.jsxs(Jf,{variant:"subtitle2",children:[e," "]}):e}),n&&t.jsxs(v,{as:"p",textAlign:"center",mb:d?2:0,children:[n," "]})]}),t.jsx(v,{my:"auto",children:r}),!d&&t.jsx(v,{mt:2,children:t.jsx(xf,{onBackground:"light",mode:"embedded"})})]})]}),!d&&t.jsx(Z,{mt:"auto",size:a,disableGutters:o,children:t.jsx(v,{bgcolor:"white",borderRadius:{xs:0,sm:8},visibility:y?"visible":"hidden",children:t.jsx(Wf,{currentStep:h||g[1]})})})]}),d&&t.jsxs(ep,{children:[y&&t.jsx(Z,{size:a,disableGutters:o,children:t.jsx(v,{bgcolor:"white",borderRadius:{xs:0,sm:8},children:t.jsx(Wf,{currentStep:h||g[1]})})}),t.jsx(xf,{onBackground:"light",mode:"fullscreen"})]})]})},Kf=o(v)`
327
+ `,Gf=({title:e,subtitle:n,content:r,containerSize:i="sm",disableGutters:o,answerContainerSize:a=826,side:s,wrapper:l,mode:u="embedded",...c})=>{const d="fullscreen"===u,{state:f}=yf(),p=kf("sm");if(f.status!==V&&f.status!==W&&f.status!==U)return null;const h=f.status===W?f.qualification.step:null,g=f.qualification.steps,m=h?g.findIndex(({id:e})=>e===h.id):-1,y=f.status===W&&m>0;return t.jsxs(Z,{size:i,disableGutters:o,...d?{style:{display:"flex",flexDirection:"column",flexGrow:1}}:{},...c,children:[t.jsxs(Kf,{bgcolor:"white"===l?"white":"transparent",minHeight:d?void 0:{xs:0,md:"670px"},display:"flex",width:"100%",color:"rgba(0,0,0,0.8)",flexDirection:"column",justifyContent:d?"center":{xs:"flex-start",md:"center"},alignItems:"flex-start",position:p?"inherit":"relative",...d?{flexGrow:1,style:{paddingBottom:"80px"}}:{},children:[t.jsxs(Yf,{position:"inherit",width:"100%",flexGrow:1,display:"flex",flexDirection:{xs:"column",md:"row"},mb:d?0:4,alignItems:{xs:"center",md:"flex-start"},children:[t.jsx(v,{flexGrow:0,width:{xs:"100%",md:"min-content"},maxWidth:"500px",children:s}),t.jsxs(v,{flexGrow:1,display:"flex",flexDirection:"column",alignSelf:"stretch",children:[t.jsxs(Qf,{children:[t.jsx(v,{textAlign:"center",mb:d?4:2,maxWidth:d?650:550,mx:"auto",children:"string"==typeof e?d?t.jsxs(Xf,{children:[e," "]}):t.jsxs(Jf,{variant:"subtitle2",children:[e," "]}):e}),n&&t.jsxs(v,{as:"p",textAlign:"center",mb:d?2:0,children:[n," "]})]}),t.jsx(v,{my:"auto",children:r}),!d&&t.jsx(v,{mt:2,children:t.jsx(xf,{onBackground:"light",mode:"embedded"})})]})]}),!d&&t.jsx(Z,{mt:"auto",size:a,disableGutters:o,children:t.jsx(v,{bgcolor:"white",borderRadius:{xs:0,sm:8},visibility:y?"visible":"hidden",children:t.jsx(Wf,{currentStep:h||g[1]})})})]}),d&&t.jsxs(ep,{children:[y&&t.jsx(Z,{size:a,disableGutters:o,children:t.jsx(v,{bgcolor:"white",borderRadius:{xs:0,sm:8},children:t.jsx(Wf,{currentStep:h||g[1]})})}),t.jsx(xf,{onBackground:"light",mode:"fullscreen"})]})]})},Kf=o(v)`
328
328
  border-radius: 8px;
329
- justify-content: center;
330
- align-items: center;
331
329
  width: 100%;
332
330
  padding: ${({theme:e})=>e.spacing(1)}px;
333
331
  padding-bottom: ${({theme:e})=>e.spacing(2)}px;
@@ -963,12 +961,15 @@
963
961
  text-align: center;
964
962
  height: 150px;
965
963
  width: 130px;
964
+ flex-shrink: 1;
965
+ min-width: 90px;
966
966
  overflow: visible;
967
967
  gap: ${({theme:e})=>e.spacing(.5)}px;
968
968
 
969
969
  ${({theme:e})=>e.breakpoints.up("sm")} {
970
970
  height: 200px;
971
971
  width: 200px;
972
+ flex-shrink: 0;
972
973
  gap: ${({theme:e})=>e.spacing(1)}px;
973
974
  }
974
975
  `,Rh=o(v)`
@@ -1574,5 +1575,5 @@ object-assign
1574
1575
  display: none;
1575
1576
  }
1576
1577
 
1577
- `,hE="trustedshops_ratings",gE=3e5;let mE=null;exports.QualificationFunnel=function({apiEndpoint:e="https://api.heycater.com/graphql",googleMapsApiKey:s="",locale:u="de",storageKey:c="heycater-funnel",onBackground:d="light",highlightColor:f="primary",mode:p="embedded",onCancel:h}){const[g,m]=n.useState(null),[y,v]=n.useState(!1);if(n.useEffect(()=>{var t;(t={graphqlEndpoint:e,googleMapsApiKey:s,locale:u})&&(mu={...pu,...t}),"undefined"!=typeof window&&window.__HEYCATER_CONFIG__&&(mu={...mu,...window.__HEYCATER_CONFIG__}),v(!0)},[e,s,u]),n.useEffect(()=>{y&&(async()=>{if(mE&&Date.now()-mE.timestamp<gE)return mE.data;if("undefined"!=typeof window)try{const e=sessionStorage.getItem(hE);if(e){const t=JSON.parse(e);if(t.timestamp&&Date.now()-t.timestamp<gE)return mE=t,t.data}}catch{}const e=await fetch("https://integrations.etrusted.com/feeds/grades/v1/channels/chl-735bd2eb-de5a-4bf6-8510-55080217cff2/touchpoints/all/feed.json",{headers:{"Content-Type":"application/json"},method:"GET"}),t=(await e.json()).grades;if(t){const e={data:t,timestamp:Date.now()};if(mE=e,"undefined"!=typeof window)try{sessionStorage.setItem(hE,JSON.stringify(e))}catch{}}return t})().then(m).catch(console.error)},[y]),!y)return null;const b=((e={})=>{const t=e.locale||"de",n=e.locales||pg;return l.isInitialized?Object.entries(R_).forEach(([e,t])=>{Object.entries(t).forEach(([t,n])=>{l.addResourceBundle(e,t,n,!0,!1)})}):l.use(i.initReactI18next).init({lng:t,supportedLngs:n,preload:pg,fallbackLng:N_,resources:R_,interpolation:{escapeValue:!1},initImmediate:!1,react:{useSuspense:!1}}),l.language!==t&&l.changeLanguage(t),l})({locale:u}),C=(x=e,new a.Client({url:x,exchanges:[a.cacheExchange,a.mapExchange({onError:cE}),dE,a.fetchExchange],fetch:fE}));var x;return t.jsx(a.Provider,{value:C,children:t.jsx(i.I18nextProvider,{i18n:b,children:t.jsx(lu,{locale:u,children:t.jsx(o.ThemeProvider,{theme:uE,children:t.jsx(r.ThemeProvider,{theme:uE,children:t.jsxs(r.StylesProvider,{injectFirst:!0,children:[t.jsx(r.CssBaseline,{}),t.jsx(pE,{}),t.jsx(bf,{initialized:!0,storageKey:c,storage:"sessionStorage",children:t.jsx(V_,{onBackground:d,highlightColor:f,ratings:g,mode:p,onCancel:h})})]})})})})})})};
1578
+ `,hE="trustedshops_ratings",gE=3e5;let mE=null;exports.QualificationFunnel=function({apiEndpoint:e="https://api.heycater.com/graphql",googleMapsApiKey:s="",locale:u="de",storageKey:c="heycater-funnel",onBackground:d="light",highlightColor:f="primary",mode:p="embedded",onCancel:h,assetBaseUrl:g="https://cdn.jsdelivr.net/npm/@heycater/qualification-funnel@latest/dist"}){const[m,y]=n.useState(null),[v,b]=n.useState(!1);if(n.useEffect(()=>{var t;hu=g.replace(/\/$/,""),(t={graphqlEndpoint:e,googleMapsApiKey:s,locale:u})&&(mu={...pu,...t}),"undefined"!=typeof window&&window.__HEYCATER_CONFIG__&&(mu={...mu,...window.__HEYCATER_CONFIG__}),b(!0)},[e,s,u,g]),n.useEffect(()=>{v&&(async()=>{if(mE&&Date.now()-mE.timestamp<gE)return mE.data;if("undefined"!=typeof window)try{const e=sessionStorage.getItem(hE);if(e){const t=JSON.parse(e);if(t.timestamp&&Date.now()-t.timestamp<gE)return mE=t,t.data}}catch{}const e=await fetch("https://integrations.etrusted.com/feeds/grades/v1/channels/chl-735bd2eb-de5a-4bf6-8510-55080217cff2/touchpoints/all/feed.json",{headers:{"Content-Type":"application/json"},method:"GET"}),t=(await e.json()).grades;if(t){const e={data:t,timestamp:Date.now()};if(mE=e,"undefined"!=typeof window)try{sessionStorage.setItem(hE,JSON.stringify(e))}catch{}}return t})().then(y).catch(console.error)},[v]),!v)return null;const C=((e={})=>{const t=e.locale||"de",n=e.locales||pg;return l.isInitialized?Object.entries(R_).forEach(([e,t])=>{Object.entries(t).forEach(([t,n])=>{l.addResourceBundle(e,t,n,!0,!1)})}):l.use(i.initReactI18next).init({lng:t,supportedLngs:n,preload:pg,fallbackLng:N_,resources:R_,interpolation:{escapeValue:!1},initImmediate:!1,react:{useSuspense:!1}}),l.language!==t&&l.changeLanguage(t),l})({locale:u}),x=(w=e,new a.Client({url:w,exchanges:[a.cacheExchange,a.mapExchange({onError:cE}),dE,a.fetchExchange],fetch:fE}));var w;return t.jsx(a.Provider,{value:x,children:t.jsx(i.I18nextProvider,{i18n:C,children:t.jsx(lu,{locale:u,children:t.jsx(o.ThemeProvider,{theme:uE,children:t.jsx(r.ThemeProvider,{theme:uE,children:t.jsxs(r.StylesProvider,{injectFirst:!0,children:[t.jsx(r.CssBaseline,{}),t.jsx(pE,{}),t.jsx(bf,{initialized:!0,storageKey:c,storage:"sessionStorage",children:t.jsx(V_,{onBackground:d,highlightColor:f,ratings:m,mode:p,onCancel:h})})]})})})})})})};
1578
1579
  //# sourceMappingURL=index.cjs.js.map