@heycater/qualification-funnel 1.3.11 → 1.3.12

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.
@@ -1674,4 +1674,4 @@
1674
1674
  box-sizing: border-box;
1675
1675
  }
1676
1676
 
1677
- `,pW="trustedshops_ratings",hW=3e5;let mW=null;const gW=KP;function vW(){var e,t;const n=null==(e=document.documentElement.lang)?void 0:e.toLowerCase();if(n&&gW.includes(n))return n;const r=null==(t=window.location.pathname.split("/")[1])?void 0:t.toLowerCase();return r&&gW.includes(r)?r:void 0}let yW=null;function bW(){const e=m.useMemo(()=>function(){const e="undefined"!=typeof window?window.__HEYCATER_CONFIG__:void 0;return{apiEndpoint:(null==e?void 0:e.graphqlEndpoint)||"https://api.heycater.com/graphql",googleMapsApiKey:(null==e?void 0:e.googleMapsApiKey)||"",locale:(null==e?void 0:e.locale)||vW()||"de",storageKey:"heycater-funnel",onBackground:"light",highlightColor:"primary",mode:(null==e?void 0:e.mode)||"embedded",onCancel:null==e?void 0:e.onCancel}}(),[]),[t,n]=m.useState(e.locale),[r,o]=m.useState(null);m.useEffect(()=>(yW=n,()=>{yW=null}),[]),m.useEffect(()=>{const e=new MutationObserver(e=>{var t;for(const r of e)if("lang"===r.attributeName){const e=null==(t=document.documentElement.lang)?void 0:t.toLowerCase();e&&gW.includes(e)&&n(e)}});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>e.disconnect()},[]),m.useEffect(()=>{const e=()=>{const e=(()=>{var e;const t=null==(e=window.location.pathname.split("/")[1])?void 0:e.toLowerCase();return t&&gW.includes(t)?t:void 0})();e&&n(e)};window.addEventListener("popstate",e);const t=history.pushState.bind(history),r=history.replaceState.bind(history);return history.pushState=(...n)=>{t(...n),e()},history.replaceState=(...t)=>{r(...t),e()},()=>{window.removeEventListener("popstate",e),history.pushState=t,history.replaceState=r}},[]),m.useEffect(()=>{var n;(n={graphqlEndpoint:e.apiEndpoint,googleMapsApiKey:e.googleMapsApiKey,locale:t})&&(aE={...rE,...n}),"undefined"!=typeof window&&window.__HEYCATER_CONFIG__&&(aE={...aE,...window.__HEYCATER_CONFIG__})},[t,e.apiEndpoint,e.googleMapsApiKey]),m.useEffect(()=>{(async()=>{if(mW&&Date.now()-mW.timestamp<hW)return mW.data;if("undefined"!=typeof window)try{const e=sessionStorage.getItem(pW);if(e){const t=JSON.parse(e);if(t.timestamp&&Date.now()-t.timestamp<hW)return mW=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(mW=e,"undefined"!=typeof window)try{sessionStorage.setItem(pW,JSON.stringify(e))}catch{}}return t})().then(o).catch(console.error)},[]);const i=((e={})=>{const t=e.locale||"de",n=e.locales||KP;return YS.isInitialized?Object.entries(AV).forEach(([e,t])=>{Object.entries(t).forEach(([t,n])=>{YS.addResourceBundle(e,t,n,!0,!1)})}):YS.use(vd).init({lng:t,supportedLngs:n,preload:KP,fallbackLng:IV,resources:AV,interpolation:{escapeValue:!1},initImmediate:!1,react:{useSuspense:!1}}),YS.language!==t&&YS.changeLanguage(t),YS})({locale:t}),a=m.useMemo(()=>{return t=e.apiEndpoint,new Xh({url:t,exchanges:[Yh,Qh({onError:uW}),cW,Gh],fetch:dW});var t},[e.apiEndpoint]);return x.jsx(rm,{value:a,children:x.jsx(Ed,{i18n:i,children:x.jsx(JS,{locale:t,children:x.jsx(Jf,{theme:lW,children:x.jsx(pa,{theme:lW,children:x.jsxs(Bi,{injectFirst:!0,children:[x.jsx(Zs,{}),x.jsx(fW,{}),x.jsx(xO,{initialized:!0,storageKey:e.storageKey,storage:"sessionStorage",children:x.jsx(UV,{onBackground:e.onBackground,highlightColor:e.highlightColor,ratings:r,mode:e.mode,onCancel:e.onCancel})})]})})})})})})}function wW(){document.querySelectorAll("[data-heycater-funnel]").forEach(e=>{W.render(x.jsx(bW,{}),e)})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",wW):wW(),window.HeycaterFunnel={mount:function(e){const t="string"==typeof e?document.querySelector(e):e;t&&W.render(x.jsx(bW,{}),t)},setLocale:function(e){yW&&yW(e)}};const xW=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})),CW=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))}();
1677
+ `,pW="trustedshops_ratings",hW=3e5;let mW=null;const gW=KP;function vW(){var e;const t=null==(e=window.location.pathname.split("/")[1])?void 0:e.toLowerCase();if(t&&gW.includes(t))return t}let yW=null;function bW(){const e=m.useMemo(()=>function(){const e="undefined"!=typeof window?window.__HEYCATER_CONFIG__:void 0;return{apiEndpoint:(null==e?void 0:e.graphqlEndpoint)||"https://api.heycater.com/graphql",googleMapsApiKey:(null==e?void 0:e.googleMapsApiKey)||"",locale:vW()||(null==e?void 0:e.locale)||"de",storageKey:"heycater-funnel",onBackground:"light",highlightColor:"primary",mode:(null==e?void 0:e.mode)||"embedded",onCancel:null==e?void 0:e.onCancel}}(),[]),[t,n]=m.useState(e.locale),[r,o]=m.useState(null);m.useEffect(()=>(yW=n,()=>{yW=null}),[]),m.useEffect(()=>{const e=new MutationObserver(e=>{var t;for(const r of e)if("lang"===r.attributeName){const e=null==(t=document.documentElement.lang)?void 0:t.toLowerCase();e&&gW.includes(e)&&n(e)}});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>e.disconnect()},[]),m.useEffect(()=>{const e=()=>{const e=(()=>{var e;const t=null==(e=window.location.pathname.split("/")[1])?void 0:e.toLowerCase();return t&&gW.includes(t)?t:void 0})();e&&n(e)};window.addEventListener("popstate",e);const t=history.pushState.bind(history),r=history.replaceState.bind(history);return history.pushState=(...n)=>{t(...n),e()},history.replaceState=(...t)=>{r(...t),e()},()=>{window.removeEventListener("popstate",e),history.pushState=t,history.replaceState=r}},[]),m.useEffect(()=>{var n;(n={graphqlEndpoint:e.apiEndpoint,googleMapsApiKey:e.googleMapsApiKey,locale:t})&&(aE={...rE,...n}),"undefined"!=typeof window&&window.__HEYCATER_CONFIG__&&(aE={...aE,...window.__HEYCATER_CONFIG__})},[t,e.apiEndpoint,e.googleMapsApiKey]),m.useEffect(()=>{(async()=>{if(mW&&Date.now()-mW.timestamp<hW)return mW.data;if("undefined"!=typeof window)try{const e=sessionStorage.getItem(pW);if(e){const t=JSON.parse(e);if(t.timestamp&&Date.now()-t.timestamp<hW)return mW=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(mW=e,"undefined"!=typeof window)try{sessionStorage.setItem(pW,JSON.stringify(e))}catch{}}return t})().then(o).catch(console.error)},[]);const i=((e={})=>{const t=e.locale||"de",n=e.locales||KP;return YS.isInitialized?Object.entries(AV).forEach(([e,t])=>{Object.entries(t).forEach(([t,n])=>{YS.addResourceBundle(e,t,n,!0,!1)})}):YS.use(vd).init({lng:t,supportedLngs:n,preload:KP,fallbackLng:IV,resources:AV,interpolation:{escapeValue:!1},initImmediate:!1,react:{useSuspense:!1}}),YS.language!==t&&YS.changeLanguage(t),YS})({locale:t}),a=m.useMemo(()=>{return t=e.apiEndpoint,new Xh({url:t,exchanges:[Yh,Qh({onError:uW}),cW,Gh],fetch:dW});var t},[e.apiEndpoint]);return x.jsx(rm,{value:a,children:x.jsx(Ed,{i18n:i,children:x.jsx(JS,{locale:t,children:x.jsx(Jf,{theme:lW,children:x.jsx(pa,{theme:lW,children:x.jsxs(Bi,{injectFirst:!0,children:[x.jsx(Zs,{}),x.jsx(fW,{}),x.jsx(xO,{initialized:!0,storageKey:e.storageKey,storage:"sessionStorage",children:x.jsx(UV,{onBackground:e.onBackground,highlightColor:e.highlightColor,ratings:r,mode:e.mode,onCancel:e.onCancel})})]})})})})})})}function wW(){document.querySelectorAll("[data-heycater-funnel]").forEach(e=>{W.render(x.jsx(bW,{}),e)})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",wW):wW(),window.HeycaterFunnel={mount:function(e){const t="string"==typeof e?document.querySelector(e):e;t&&W.render(x.jsx(bW,{}),t)},setLocale:function(e){yW&&yW(e)}};const xW=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})),CW=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))}();