{"version":3,"file":"bundle.min.js","sources":["../node_modules/preact/dist/preact.module.js","../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js","../node_modules/preact/hooks/dist/hooks.module.js","../node_modules/preact-router/dist/preact-router.mjs","../src/assets/images/get_more_logo_black.png","../src/services/shareIdService.js","../src/services/analyticsService.js","../src/services/i18nService.jsx","../src/services/customerService.js","../src/components/customerCard/index.jsx","../src/components/header/index.jsx","../node_modules/classnames/index.js","../src/components/circularProgress/index.jsx","../src/components/button/index.jsx","../src/components/errorMessage/index.jsx","../src/services/loyaltyDataService.js","../src/components/partnerCouponControls/index.jsx","../src/components/coupons/index.jsx","../src/assets/images/profile.png","../src/assets/images/profile_male.png","../src/assets/images/profile_female.png","../src/components/user-profile/index.jsx","../src/components/sectionHeader/index.jsx","../src/components/textInput/index.jsx","../src/components/receiptInput/index.jsx","../src/components/history/index.jsx","../src/components/shareButton/index.jsx","../src/services/shortenerService.js","../src/components/referAFriend/index.jsx","../src/components/welcome/index.jsx","../src/assets/images/mobile_phone.png","../src/assets/images/apple_app_store.png","../src/assets/images/google_play.png","../src/assets/images/huawei_app_gallery.png","../src/components/getMobileApp/index.jsx","../src/components/menu/index.jsx","../src/components/doiBanner/index.jsx","../src/routes/dashboard/index.jsx","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/history/index.js","../src/routes/couponDetails/index.jsx","../src/assets/images/get_more_logo_white.png","../src/assets/images/landing/login_register.jpg","../src/assets/images/landing/landing_page_club_offers.jpg","../src/assets/images/landing/landing_page_cooperation.jpg","../src/assets/images/landing/landing_page_points.jpg","../src/assets/images/video-overlay.jpg","../src/assets/images/landing/landing_page_membership.jpg","../src/components/infoItem/index.jsx","../src/components/checkbox/index.jsx","../src/routes/home/index.jsx","../src/routes/login/index.jsx","../src/services/countryService.js","../src/services/trackingService.js","../src/routes/register/index.jsx","../src/components/picker/index.jsx","../src/components/mapSearch/index.jsx","../src/services/storesService.js","../src/assets/images/ic_store_marker_32x32.png","../src/assets/images/ic_store_marker_96x96.png","../src/components/map/index.jsx","../node_modules/flatpickr/dist/l10n/de.js","../node_modules/flatpickr/dist/esm/types/options.js","../node_modules/flatpickr/dist/esm/l10n/default.js","../node_modules/flatpickr/dist/esm/utils/index.js","../node_modules/flatpickr/dist/esm/utils/dom.js","../node_modules/flatpickr/dist/esm/utils/formatting.js","../node_modules/flatpickr/dist/esm/utils/dates.js","../node_modules/flatpickr/dist/esm/utils/polyfills.js","../node_modules/flatpickr/dist/esm/index.js","../src/components/flatpickr/index.jsx","../src/routes/additionalUserData/index.jsx","../src/routes/acceptTos/index.jsx","../src/components/app.jsx","../src/index.jsx"],"sourcesContent":["var n,l,u,t,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var u in l)n[u]=l[u];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,u,t){var i,r,o,e={};for(o in u)\"key\"==o?i=u[o]:\"ref\"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),\"function\"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var u;lu&&i.sort(e));P.__r=0}function $(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,d,w,_,g=t&&t.__k||v,m=l.length;for(f=I(u,l,g,f),a=0;a0?m(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=n,r.__b=n.__b+1,o=null,-1!==(f=r.__i=T(r,u,e,a))&&(a--,(o=u[f])&&(o.__u|=2)),null==o||null===o.__v?(-1==f&&h--,\"function\"!=typeof r.type&&(r.__u|=4)):f!==e&&(f==e-1?h--:f==e+1?h++:(f>e?h--:h++,r.__u|=4))):r=n.__k[i]=null;if(a)for(i=0;i(null!=f&&0==(2&f.__u)?1:0))for(;o>=0||e=0){if((f=l[o])&&0==(2&f.__u)&&i==f.key&&r===f.type)return o;o--}if(e2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}function J(n,l){var u={__c:l=\"__cC\"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),\"function\"==typeof n&&(n=n(w({},u),this.props)),n&&w(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],o=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=O(!1),a=O(!0),h=0;export{x as Component,k as Fragment,G as cloneElement,J as createContext,g as createElement,b as createRef,g as h,E as hydrate,t as isValidElement,l as options,D as render,L as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n","import{options as r,Fragment as e}from\"preact\";export{Fragment}from\"preact\";var t=/[\"&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o=\"\",f=\"\";n=u.__.length&&u.__.push({}),u.__[n]}function h(n){return o=1,p(D,n)}function p(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return o=5,T(function(){return{current:n}},[])}function F(n,t,r){o=6,_(function(){return\"function\"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n)}function b(n){var u=d(t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__}function j(){for(var n;n=f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],c.__e(t,n.__v)}}c.__b=function(n){r=null,e&&e(n)},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],t=0)),u=r},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),u=r=null},c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],c.__e(r,n.__v)}}),l&&l(n,t)},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&c.__e(t,r.__v))};var k=\"function\"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return\"function\"==typeof t?t(n):t}export{q as useCallback,x as useContext,P as useDebugValue,y as useEffect,b as useErrorBoundary,g as useId,F as useImperativeHandle,_ as useLayoutEffect,T as useMemo,p as useReducer,A as useRef,h as useState};\n//# sourceMappingURL=hooks.module.js.map\n","import{createContext as n,Component as t,toChildArray as r,cloneElement as i,h as o}from\"preact\";import{useContext as e,useState as u,useEffect as f}from\"preact/hooks\";var a={};function c(n,t){for(var r in t)n[r]=t[r];return n}function s(n,t,r){var i,o=/(?:\\?([^#]*))?(#.*)?$/,e=n.match(o),u={};if(e&&e[1])for(var f=e[1].split(\"&\"),c=0;ct.rank?-1:n.index-t.index}function v(n,t){return n.index=t,n.rank=function(n){return n.props.default?0:d(n.props.path).map(l).join(\"\")}(n),n.props}function d(n){return n.replace(/(^\\/+|\\/+$)/g,\"\").split(\"/\")}function l(n){return\":\"==n.charAt(0)?1+\"*+?\".indexOf(n.charAt(n.length-1))||4:5}var p={},m=[],y=[],U=null,g={url:R()},k=n(g);function C(){var n=e(k);if(n===g){var t=u()[1];f(function(){return y.push(t),function(){return y.splice(y.indexOf(t),1)}},[])}return[n,$]}function R(){var n;return\"\"+((n=U&&U.location?U.location:U&&U.getCurrentLocation?U.getCurrentLocation():\"undefined\"!=typeof location?location:p).pathname||\"\")+(n.search||\"\")}function $(n,t){return void 0===t&&(t=!1),\"string\"!=typeof n&&n.url&&(t=n.replace,n=n.url),function(n){for(var t=m.length;t--;)if(m[t].canRoute(n))return!0;return!1}(n)&&function(n,t){void 0===t&&(t=\"push\"),U&&U[t]?U[t](n):\"undefined\"!=typeof history&&history[t+\"State\"]&&history[t+\"State\"](null,null,n)}(n,t?\"replace\":\"push\"),I(n)}function I(n){for(var t=!1,r=0;r/;\n const translation = this._translations[key] ? this._translations[key].toString() : key.toString();\n\n if (args.length > 0) {\n return this.replaceWildcards(key, args);\n }\n\n if(isHtml === null){\n isHtml = regex.test(translation);\n }\n\n return isHtml ?
: translation;\n }\n\n async initTranslations() {\n const language = this.getLanguage();\n\n return await this._loadTranslations(language);\n }\n\n getLanguage() {\n // no defaultLanguage -> get it from the url\n const url = window.location.href;\n const fragments = url.substring(url.indexOf('newyorker.de/') + 13).split('/'); // split URL path in segments\n\n if (fragments && fragments.length > 0) {\n let langFromUrl = fragments[0];\n\n if (!langFromUrl || langFromUrl === '' || langFromUrl.startsWith(\"host\") || langFromUrl.length > 2) {\n return conf.defaultLocale // if no language is found in the URL\n } else {\n return langFromUrl; // use the language from the url\n }\n }\n }\n\n replaceWildcards(key, array) {\n let translation = this.translate(key, {isHtml: false});\n\n if (translation) {\n return translation.replace(/%[0-9]+\\$s/g, (wildcard) => {\n let index = parseInt(wildcard.match(/\\d+/g));\n return array[index - 1] ? array[index - 1] : wildcard;\n\n });\n } else\n return false;\n }\n}\n\nexport let i18nService = new I18nService();","import {shareIdService} from './shareIdService';\nimport {analyticsService} from \"./analyticsService\";\nimport {i18nService} from \"./i18nService\";\n\nclass CustomerService {\n\n constructor() {\n this.tag = 'LOYALTY_CLIENT';\n\n this.subscribers = [];\n this.customerNotAvailableSubscribers = [];\n this.customerNotAvailable = false;\n\n if (window && window.NY_CUSTOMER_SERVICE) {\n this.customerService = window.NY_CUSTOMER_SERVICE;\n // noinspection JSUnresolvedFunction\n this.customerService.subscribeForCustomer(this.tag, (user) => {\n this.currentUser = user;\n this.notifySubscribers(user);\n });\n\n this.customerService.subscribeForCustomerNotAvailable(this.tag, () => {\n this.customerNotAvailable = true;\n this.notifyCustomerNotAvailableSubscribers();\n });\n }\n }\n\n _subscribeForUser(callback) {\n this.subscribers.push(callback);\n if (this.currentUser) {\n callback(this.currentUser);\n }\n }\n\n _subscribeForUserNotAvailable(callback) {\n this.customerNotAvailableSubscribers.push(callback);\n if (this.customerNotAvailable) {\n this.notifyCustomerNotAvailableSubscribers();\n }\n }\n\n notifySubscribers(user) {\n for (let i = 0; i < this.subscribers.length; i++) {\n const subscriber = this.subscribers[i];\n subscriber(user);\n }\n }\n\n notifyCustomerNotAvailableSubscribers() {\n for (let i = 0; i < this.customerNotAvailableSubscribers.length; i++) {\n const subscriber = this.customerNotAvailableSubscribers[i];\n subscriber();\n }\n }\n\n async login(email, password, saveLogin) {\n if (this.customerService) {\n return this.customerService.login(email, password, saveLogin);\n }\n }\n\n async registerCustomer(\n email, password, firstName, lastName, countryId, postalCode, optInEmailAdvertisementConsent, optInEmailChannelNewsletter, optInEmailChannelLoyalty, saveLogin = true) {\n if (this.customerService) {\n const registerData = {\n email: email,\n password: password,\n firstName: firstName,\n lastName: lastName,\n countryCode: countryId,\n postalCode: postalCode,\n optInEmailAdvertisementConsent: optInEmailAdvertisementConsent,\n optInEmailChannelLoyalty: optInEmailChannelLoyalty,\n optInEmailChannelNewsletter: optInEmailChannelNewsletter\n };\n\n let shareId = shareIdService.getShareId();\n\n if (shareId) {\n registerData.shareId = shareId;\n }\n\n const fromCampaign = analyticsService.getAllParameters();\n if (Object.keys(fromCampaign).length > 0) {\n registerData.fromCampaign = fromCampaign;\n }\n\n return this.customerService.registerCustomer(registerData, saveLogin);\n }\n }\n\n async acceptLoyalty() {\n if (this.customerService) {\n let data = {shareId: shareIdService.getShareId()};\n return this.customerService.acceptLoyalty(data);\n }\n }\n\n async resendVerificationEmail() {\n if (this.customerService) {\n return this.customerService.resendVerificationEmail();\n }\n }\n\n async loadOptInState() {\n if (this.customerService) {\n return this.customerService.loadOptInState();\n }\n }\n\n async updateProfile(profile) {\n if (this.customerService) {\n return this.customerService.updateProfile(profile);\n }\n }\n\n async getReferralLink() {\n const language = i18nService.getLanguage();\n\n\n if (this.customerService) {\n let response = await this.customerService.getShareId();\n if (response && response['shareId']) {\n let shareId = response['shareId'];\n return `https://app.newyorker.de/share/get-more-club/${shareId}?country=${language}`\n }\n }\n return false;\n }\n\n async getShareId() {\n if (this.customerService) {\n let response = await this.customerService.getShareId();\n if (response && response['shareId']) {\n return response['shareId'];\n }\n }\n return false;\n }\n\n async getLoyaltyQRCode(rewardIds, couponIds) {\n if (this.customerService) {\n return this.customerService.getLoyaltyQRCode(rewardIds, couponIds);\n }\n return false;\n }\n\n setFirstVisit(active) {\n localStorage.setItem('LOYALTY_FIRST_VISIT', active)\n }\n}\n\nexport let customerService = new CustomerService();","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport {customerService} from '../../services/customerService';\nimport {i18nService} from \"../../services/i18nService\";\n\nexport default class CustomerCard extends Component {\n\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n async componentDidMount() {\n let result = await customerService.getLoyaltyQRCode();\n if (result.imageData) {\n this.setState(\n {imageData: result.imageData, cardNumber: result.cardNumber});\n }\n }\n\n render(props, state) {\n return (\n
\n
{this._renderCloseIcon(props)}
\n\n
{i18nService.translate('dasgboard_mobile_custom_card_label')}
\n\n {state.imageData &&\n
\n \n
\n }\n\n
{i18nService.translate('dasgboard_mobile_custom_card_text')}
\n
{i18nService.translate('dasgboard_mobile_custom_card_number')} {state.cardNumber}
\n\n
\n );\n }\n\n _renderCloseIcon(props) {\n return (\n props.closeCallback()}>\n \n \n \n \n );\n }\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport Logo from '../../assets/images/get_more_logo_black.png';\nimport CustomerCard from \"../customerCard\";\nimport {customerService} from '../../services/customerService';\n\nexport default class Header extends Component {\n\n constructor(props) {\n super(props);\n this.state = {displayGetMoreCard: false, user: false};\n }\n\n componentDidMount() {\n customerService._subscribeForUser((user) => this.setState({user: user}))\n }\n\n render(props, state) {\n return (\n
\n \n
\n

GET MORE club

\n {state.user && state.user.loyalty ? this.renderCard(props, state) : null}\n {state && state.displayGetMoreCard && {\n this.setState(prevState => ({displayGetMoreCard: !prevState.displayGetMoreCard}))\n }}/>}\n
\n
\n );\n }\n\n renderCard() {\n return (\n
{\n this.setState(\n (prevState) => ({displayGetMoreCard: !prevState.displayGetMoreCard}));\n }}\n aria-hidden=\"true\"\n class={[style.icon, style.solid].join(' ')}>\n \n \n \n
\n );\n }\n}\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import {Component} from 'preact';\nimport classNames from 'classnames';\nimport styles from './style.module.scss';\n\nexport default class CircularProgress extends Component {\n\n constructor(props) {\n super(props);\n this.state = {};\n\n props.color = props.color ? props.color : 'white';\n props.size = props.size ? props.size : 40;\n props.thickness = props.thickness ? props.thickness : 4;\n props.value = 0;\n props.variant = 'indeterminate';\n }\n\n render(props, state) {\n const {className, color, size, style, thickness, ...other} = props;\n\n const circleStyle = {};\n const rootStyle = {};\n const rootProps = {};\n const classes = styles;\n\n const divClasses = classNames(\n classes.root,\n {\n [classes[`color${color}`]]: color !== 'inherit',\n [classes.indeterminate]: true,\n },\n className,\n );\n\n const circleClasses = classNames(classes.circle, {\n [classes.circleIndeterminate]: true,\n });\n\n return (\n \n \n \n \n \n );\n }\n\n getRelativeValue(value, min, max) {\n const clampedValue = Math.min(Math.max(min, value), max);\n return (clampedValue - min) / (max - min);\n }\n\n easeOut(t) {\n t = this.getRelativeValue(t, 0, 1);\n // https://gist.github.com/gre/1650294\n t = (t -= 1) * t * t + 1;\n return t;\n }\n\n easeIn(t) {\n return t * t;\n }\n\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport CircularProgress from '../circularProgress';\n\nexport default class Button extends Component {\n\n constructor(props) {\n super(props);\n\n this.handleOnClick = this.handleOnClick.bind(this);\n }\n\n render(props, state) {\n\n const classNames = this.getClassNames(props);\n if (props.form) {\n\n return (\n \n );\n }\n return (\n \n );\n }\n\n handleOnClick(event) {\n event.stopPropagation();\n if (this.props.onClickCallback) {\n this.props.onClickCallback();\n }\n }\n\n getClassNames(props) {\n\n let classNames = [];\n classNames.push(style.button);\n if (props.textStyle) {\n classNames.push(style.text);\n }\n if (props.dark) {\n classNames.push(style.dark);\n }\n\n if (props.black) {\n classNames.push(style.black);\n }\n\n if (props.green) {\n classNames.push(style.green);\n }\n\n if (props.grey) {\n classNames.push(style.grey);\n }\n\n if (props.white) {\n classNames.push(style.white);\n }\n\n if (props.invalid !== undefined && !props.invalid) {\n classNames.push(style.valid)\n }\n\n return classNames.join(' ');\n\n }\n\n _renderLoadInidcator() {\n return (\n
\n \n
\n )\n }\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\n\nexport default class ErrorMessage extends Component {\n\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n render(props, state) {\n if (props.message) {\n\n return (\n
\n {props.message}\n
\n )\n } else {\n return null\n }\n }\n}","class LoyaltyDataService {\n\n constructor() {\n this.tag = 'LOYALTY_DATA_SERVICE';\n\n this.dataSubscribers = [];\n this.historySubscribers = [];\n\n\n if (window && window.NY_CUSTOMER_SERVICE) {\n this.customerService = window.NY_CUSTOMER_SERVICE;\n this.reload();\n }\n }\n\n _subscribeForLoyaltyData(callback) {\n if (this.dataSubscribers.length <= 0) {\n this.reload();\n }\n this.dataSubscribers.push(callback);\n if (this.currentLoyaltyData) {\n callback(this.currentLoyaltyData);\n }\n }\n\n _subscribeForHistoryData(callback) {\n if (this.historySubscribers.length <= 0) {\n this.reload();\n }\n this.historySubscribers.push(callback);\n if (this.currentHistoryData) {\n callback(this.currentHistoryData);\n }\n }\n\n\n notifyDataSubscribers(data) {\n for (let i = 0; i < this.dataSubscribers.length; i++) {\n const subscriber = this.dataSubscribers[i];\n subscriber(data);\n }\n }\n\n notifyHistorySubscribers(data) {\n for (let i = 0; i < this.historySubscribers.length; i++) {\n const subscriber = this.historySubscribers[i];\n subscriber(data);\n }\n }\n\n reload() {\n // noinspection JSUnresolvedFunction\n this.customerService.getLoyaltyData().then(data => {\n this.currentLoyaltyData = data;\n this.notifyDataSubscribers(data);\n });\n\n // noinspection JSUnresolvedFunction\n this.customerService.getLoyaltyHistory().then(data => {\n this.currentHistoryData = data;\n this.notifyHistorySubscribers(data);\n });\n }\n\n async addReceipt(receiptNumber) {\n if (this.customerService) {\n return this.customerService.addReceipt(receiptNumber);\n }\n return null;\n }\n\n async checkPartnerPromotion(promotionCode) {\n if (this.customerService) {\n return this.customerService.checkPartnerPromotion(promotionCode);\n }\n return null;\n }\n\n async consumePartnerPromotion(promotionCode) {\n if (this.customerService) {\n return this.customerService.consumePartnerPromotion(promotionCode);\n }\n return null;\n }\n}\n\nexport let loyaltyDataService = new LoyaltyDataService();","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport Button from '../button';\nimport ErrorMessage from '../errorMessage';\nimport {loyaltyDataService} from '../../services/loyaltyDataService';\nimport {i18nService} from \"../../services/i18nService\";\n\nexport default class CouponControls extends Component {\n\n constructor(props) {\n super(props);\n this.state = {\n partnerUrl: false,\n showLoadIndicator: false,\n };\n\n this._consumePartnerCoupon = this._consumePartnerCoupon.bind(this);\n }\n\n async componentDidMount() {\n if (this.props && this.props.coupon && this.props.coupon.externalCode &&\n this.props.coupon.externalCode.startsWith('pa_')) {\n try {\n const response = await loyaltyDataService.checkPartnerPromotion(this.props.coupon.externalCode);\n if (response && response.code) {\n this.setState({partnerUrl: response.code});\n }\n } catch (_) {\n }\n }\n }\n\n render(props, state) {\n let coupon = props.coupon;\n if (coupon.externalCode &&\n coupon.externalCode.startsWith('pa_')) {\n return (\n
\n
\n {!this.state.partnerUrl &&\n
\n\n {this.state.showError &&\n
\n \n
}\n
\n );\n } else {\n return (\n
\n
\n \n
\n
\n );\n }\n }\n\n async _consumePartnerCoupon(externalId) {\n this.setState({showLoadIndicator: true, showError: false});\n try {\n const result = await loyaltyDataService.consumePartnerPromotion(externalId);\n if (result.code) {\n this.setState({\n partnerUrl: result.code,\n showLoadIndicator: false,\n });\n }\n } catch (e) {\n this.setState({\n showLoadIndicator: false,\n showError: true,\n });\n }\n }\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\n\nimport {route} from 'preact-router';\nimport CouponControls from '../partnerCouponControls';\nimport {loyaltyDataService} from \"../../services/loyaltyDataService\";\nimport {i18nService} from \"../../services/i18nService\";\n\nexport default class Coupons extends Component {\n\n constructor() {\n super();\n\n this.state = {\n selectedCoupon: {id: null},\n coupons: [],\n rewards: [],\n };\n }\n\n async componentDidMount() {\n\n loyaltyDataService._subscribeForLoyaltyData((data)=> {\n let loyaltyData = data;\n\n let coupons;\n try {\n coupons = loyaltyData.coupons.filter((coupon) => {\n if (coupon.validTo) {\n\n let toDate = new Date(coupon.validTo);\n let now = new Date();\n\n return now.getTime() < toDate.getTime();\n }\n return true\n });\n coupons.sort((couponA, couponB) => {\n return new Date(couponB.validFrom).getTime() - new Date(couponA.validFrom).getTime() ||\n new Date(couponB.validTo).getTime() - new Date(couponA.validTo).getTime() ||\n new Date(couponB.createDate).getTime() - new Date(couponA.createDate).getTime()\n });\n for (let coupon of coupons) {coupon.type = 'COUPON'}\n } catch (e) {\n coupons = [];\n }\n\n let rewards;\n\n try {\n rewards = loyaltyData.rewards;\n rewards.sort((rewardA, rewardB) => {\n return new Date(rewardB.validFrom).getTime() - new Date(rewardA.validFrom).getTime() ||\n new Date(rewardB.validTo).getTime() - new Date(rewardA.validTo).getTime() ||\n new Date(rewardB.createDate).getTime() - new Date(rewardA.createDate).getTime()\n });\n\n for (let reward of rewards) {reward.type = 'REWARD'}\n } catch (e) {\n rewards = [];\n }\n\n this.setState({\n coupons: coupons,\n rewards: rewards,\n });\n });\n }\n\n render(props, state) {\n\n return (\n
\n
\n
\n {state.rewards.map(\n this._renderCoupon.bind(this))}\n {state.coupons.map(\n this._renderCoupon.bind(this))}\n
\n
\n
\n );\n }\n\n _getImageSrc(coupon) {\n try {\n let image = null;\n\n for (let i of coupon.images) {\n let tag = false;\n for (let t of i.tags) {\n if (t === 'list_web') {\n image = i;\n tag = true;\n break;\n }\n }\n if (tag)\n break;\n }\n\n if (image)\n return image.url;\n\n return '';\n } catch (err) {\n return '';\n }\n }\n\n _navigateToCouponDetails(coupon) {\n route('/coupon/' + coupon.id);\n }\n\n _renderCoupon(coupon) {\n let backgroundStyle = {\n backgroundImage: 'url(' + this._getImageSrc(coupon) + ')',\n };\n\n let validityString = this._getValidityString(\n coupon.validFrom, coupon.validTo, coupon.isAllDay);\n\n let translations = coupon.translations && coupon.translations.de;\n\n let hasPoints = !!(coupon.points && coupon.points !== 0);\n return (\n
\n
\n
this._navigateToCouponDetails(coupon)} className={style['rich-media']} style={backgroundStyle}>\n {hasPoints &&\n
\n
\n
{coupon.points}
\n
{i18nService.translate('dashboard_coupons_pointsText')}
\n
\n
\n }\n
\n\n\n
\n {translations && translations.title &&\n
{translations.title}
}\n
{translations.subtitle}
\n \n
\n {!coupon.isUnlimited &&
{this._renderCalendarIcon()}\n {validityString &&\n {validityString}}
}\n
\n
\n
\n
\n );\n }\n\n _renderCalendarIcon() {\n return (\n \n \n \n \n \n );\n }\n\n _getValidityString(validFrom, validTo, isAllDay) {\n try {\n let fromDate = new Date(validFrom);\n let toDate = new Date(validTo);\n\n if (validFrom && fromDate.getTime() > new Date().getTime()) {\n return 'COMING SOON';\n }\n let options = {year: 'numeric', month: '2-digit', day: '2-digit'};\n\n if (validTo) {\n // if (!isAllDay)\n return i18nService.translate('dashboard_coupon_valid_to_date_time', toDate.toLocaleDateString('de-DE', options), toDate.toLocaleTimeString('de-DE', {hour: '2-digit', minute:'2-digit'}));\n // else\n // return i18nService.translate('dashboard_coupon_valid_to_date', toDate.toLocaleDateString('de-DE', options));\n } else return false;\n } catch (e) {\n return '';\n }\n\n }\n}\n","export default \"__VITE_ASSET__DA0UNRk7__\"","export default \"__VITE_ASSET__DKbX94Ke__\"","export default \"__VITE_ASSET__6z2ptLJD__\"","import {Component} from 'preact';\nimport {customerService} from '../../services/customerService';\nimport style from './style.module.scss';\nimport FallBackAvatar from '../../assets/images/profile.png';\nimport FallBackAvatarMale from '../../assets/images/profile_male.png';\nimport FallBackAvatarFemale from '../../assets/images/profile_female.png';\nimport classNames from \"classnames\";\nimport {loyaltyDataService} from \"../../services/loyaltyDataService\";\nimport {i18nService} from \"../../services/i18nService\";\n\nexport default class UserProfile extends Component {\n\n constructor(props) {\n super(props);\n this.state = {userData: false};\n\n customerService._subscribeForUser((user) => {\n this.setState({userData: user});\n });\n\n loyaltyDataService._subscribeForLoyaltyData((loyaltyData) => {\n this.setState({loyaltyData: loyaltyData});\n });\n }\n\n render(props, state) {\n\n if (state.userData) {\n let user = state.userData;\n let profile = user.profile ? user.profile : false;\n return (\n
\n
\n \n
\n\n
\n
\n
\n {this._renderCard()}\n {state.loyaltyData && state.loyaltyData.cards && state.loyaltyData.cards.length > 0 && state.loyaltyData.cards[0].number}\n
\n
\n {i18nService.translate('dashboard_profile_customer_card_text')}\n
\n
\n\n
\n
{profile && profile.firstName ?\n profile.firstName : ''} {profile && profile.lastName ?\n profile.lastName : ''}
\n
{user.email}
\n
\n\n
{this._renderEditProfile()}
\n\n
\n
{i18nService.translate('dashboard_profile_points_text')}
\n
{state.loyaltyData && state.loyaltyData.totalPoints ?\n state.loyaltyData.totalPoints :\n '0'}
\n
\n
\n
\n );\n }\n return (\n
\n
\n
\n
\n );\n\n }\n\n _renderEditProfile() {\n return (\n location.href = '/customer-profile/#/private/customer-profile/change-user-data'}\n aria-hidden=\"true\"\n class={classNames(style.icon, style.editProfile, style.solid)}>\n \n \n \n \n );\n }\n\n _renderCard() {\n return (\n \n \n \n \n \n );\n }\n\n getCustomerAvatar(profile) {\n if (profile) {\n if (profile.avatarUrl) {\n return profile.avatarUrl;\n }\n\n switch (profile.gender) {\n case 'MALE': {\n return FallBackAvatarMale;\n }\n case 'FEMALE': {\n return FallBackAvatarFemale;\n }\n }\n }\n return FallBackAvatar;\n }\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\n\nexport default class SectionHeader extends Component {\n\n render(props) {\n\n return (\n
\n {props.separator === false ? null :
}\n {props.children &&

{props.children}

}\n
\n );\n }\n\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport classNames from 'classnames';\n\nexport default class TextInput extends Component {\n\n\n dontRecycle = () => {\n // wait 1 tick for the recycler to reclaim this component, then destroy its cached DOM tree\n Promise.resolve(this).then(this.clearBase);\n };\n\n clearBase = (component) => {\n // Note: __b is the compressed name (it's always this in a prod build, but nextBase is not a public API)\n component.nextBase = component.__b = null;\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n disabled: false\n };\n\n this.handleInputChange = this.handleInputChange.bind(this);\n this.handleReturnEvent = this.handleReturnEvent.bind(this);\n }\n\n componentWillUnmount() {\n this.dontRecycle();\n }\n\n\n render(props, state) {\n\n if (props.value) {\n state.input = props.value;\n }\n\n if (props.disabled) {\n state.disabled = props.disabled\n }\n\n const inputType = this.getInputType(props.type);\n\n let labelStyle = style.label;\n if (props.errorMessage) {\n labelStyle = `${style.label} ${style[\"error-message\"]}`\n }\n\n return (\n
\n {\n this.handleReturnEvent(e);\n }}\n autocomplete={props.autocomplete}\n placeholder={`${this.props.placeholder ? this.props.placeholder : ''}${this.props.required ? '*' : ''}`}\n />\n
{this.props.errorMessage ? this._renderErrorMessage() : this.props.label}{this.props.required && !this.props.errorMessage && this.props.label && '*'}
\n
\n );\n }\n\n _renderErrorMessage() {\n return (\n
\n \n \n \n \n \n {this.props.errorMessage}\n
\n );\n }\n\n getInputType(type) {\n switch (type) {\n case 'password':\n return 'password';\n case 'email':\n return 'email';\n default:\n return 'text';\n }\n }\n\n handleInputChange(event) {\n const target = event.target;\n const value = target.value;\n\n if (this.props.type === 'numbers') {\n let numberValue = !!value.match(/\\d+/g) ? value.match(/\\d+/g).toString() : '';\n this.setState({input: numberValue});\n if (this.props && this.props.inputCallback) {\n this.props.inputCallback(numberValue);\n }\n } else {\n this.setState({\n input: value,\n });\n if (this.props && this.props.inputCallback) {\n this.props.inputCallback(value);\n }\n }\n }\n\n handleReturnEvent(keyEvent) {\n if (keyEvent && keyEvent.key && keyEvent.key === 'Enter') {\n if (this.props && this.props.returnCallback) {\n this.props.returnCallback();\n }\n }\n }\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport TextInput from '../textInput';\nimport Button from '../button';\nimport ErrorMessage from '../errorMessage';\nimport {i18nService} from \"../../services/i18nService\";\nimport {loyaltyDataService} from \"../../services/loyaltyDataService\";\n\nexport default class ReceiptInput extends Component {\n\n constructor(props) {\n super(props);\n this.state = {code: '', errorMessage: false, successMessage: false};\n }\n\n async componentDidMount() {\n let inputPlaceholder = await i18nService.translate('dashboard_receipt_input_placeholder');\n this.setState({inputPlaceholder: inputPlaceholder})\n }\n\n render(props, state) {\n return (\n
\n
\n {i18nService.translate('dashboard_points_receipt_input_headline')}\n
\n\n
{i18nService.translate('dashboard_receipt_input_text')}
\n\n
\n {\n this.setState({code: code});\n }}/>\n
\n
\n {state.successMessage &&
{state.successMessage}
}\n
\n \n
\n
\n );\n }\n\n async addReceipt(code) {\n try {\n await loyaltyDataService.addReceipt(code);\n loyaltyDataService.reload();\n this.setState({\n successMessage: i18nService.translate('dashboard_history_receipt_input_success'),\n errorMessage: false\n });\n } catch (e) {\n let errorMessageKey = 'dashboard_history_receipt_input_error';\n if (e.error) {\n errorMessageKey = this.parseErrorMessage(e.error);\n }\n this.setState({errorMessage: i18nService.translate(errorMessageKey), successMessage: false})\n }\n }\n\n parseErrorMessage(error) {\n switch (error) {\n case \"VALIDATION_ERROR\":\n return 'dashboard_history_receipt_validation_error';\n case \"ALREADY_ADDED_RECEIPT\":\n return 'dashboard_history_receipt_already_added_error';\n default:\n return 'dashboard_history_receipt_input_error';\n }\n }\n}","/* eslint-disable react/no-did-mount-set-state */\nimport {Component} from 'preact';\nimport style from './style.module.scss';\nimport SectionHeader from '../sectionHeader';\nimport {i18nService} from '../../services/i18nService';\nimport ReceiptInput from '../../components/receiptInput';\nimport {loyaltyDataService} from \"../../services/loyaltyDataService\";\n\nexport default class History extends Component {\n\n async componentDidMount() {\n\n loyaltyDataService._subscribeForHistoryData((history) => {\n this.setState({history: history});\n });\n\n let headline = await i18nService.translate('dashboard_points_history_headline');\n this.setState({headline: headline});\n\n const TransactionSubTypes = {\n RM: i18nService.translate('dashboard_points_history_type_purchase'),\n RMB: i18nService.translate('dashboard_points_history_type_purchase'),\n RMBX: i18nService.translate('dashboard_points_history_type_purchase'),\n ERM: i18nService.translate('dashboard_points_history_type_purchase'),\n PCI: i18nService.translate('dashboard_points_history_type_purchase'),\n FRI: i18nService.translate('dashboard_points_history_type_friends'),\n COU: i18nService.translate('dashboard_points_history_type_coupon'),\n CAN: i18nService.translate('dashboard_points_history_type_cancellation'),\n ERC: i18nService.translate('dashboard_points_history_type_cancellation'),\n CRC: i18nService.translate('dashboard_points_history_type_correction'),\n WLC: i18nService.translate('dashboard_points_history_type_welcome'),\n EVE: i18nService.translate('dashboard_points_history_type_event'),\n ELSE: i18nService.translate('dashboard_points_history_type_other')\n };\n this.setState({TransactionSubTypes: TransactionSubTypes});\n }\n\n render(props, state) {\n if (state && state.history && state.history.transactions &&\n state.history.transactions.length > 0) {\n\n let transactions = [];\n if (state.history.transactions && state.history.transactions.length > 3) {\n transactions = state.history.transactions.slice(0, 3);\n }\n else {\n transactions = state.history.transactions ?\n state.history.transactions :\n [];\n }\n\n return (\n
\n {state.headline}\n
\n {i18nService.translate('dashboard_points_history_text1')}\n
\n
\n
\n {i18nService.translate('dashboard_points_history_text2')}\n
\n
{transactions.map(\n this.renderTransaction.bind(this))}
\n\n \n
\n );\n }\n return (\n
\n {state.headline}\n
\n {i18nService.translate('dashboard_points_zero_history_text')}\n
\n
\n \n
\n );\n }\n\n renderTransaction(transaction) {\n const SubTypeCodes = this.state && this.state.TransactionSubTypes ? this.state.TransactionSubTypes : {};\n return (\n
\n {transaction && transaction.date &&
\n {new Date(transaction.date).toLocaleDateString(\"de-DE\", {year: 'numeric', month: '2-digit', day: '2-digit'})}\n
}\n
\n {SubTypeCodes.hasOwnProperty(transaction.subTypeCode) ? SubTypeCodes[transaction.subTypeCode] : SubTypeCodes['ELSE']}\n
\n \n {(transaction.points >= 0) ? \"+\" + transaction.points : transaction.points.toString()}\n \n
\n );\n }\n\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport classNames from 'classnames';\n\nexport default class ShareButton extends Component {\n\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n render(props, state) {\n\n let shareUrl = props.shareUrl;\n let shareText = props.shareText;\n switch (props.type) {\n case 'facebook':\n return this._renderFacebook(shareUrl);\n case 'twitter':\n return this._renderTwitter(shareUrl, shareText);\n case 'threads':\n return this._renderThreads(shareUrl);\n case 'google_plus':\n return this.renderGoogle(shareUrl);\n case 'email':\n return this._renderEmail(shareUrl, shareText);\n case 'pinterest':\n return this._renderPinterest(shareUrl, shareText);\n case 'whatsapp':\n return this._renderWhatsapp(shareUrl, shareText);\n case 'telegram':\n return this._renderTelegram(shareUrl, shareText);\n default :\n return this.renderError();\n }\n }\n\n _renderFacebook(shareUrl) {\n const href = `https://facebook.com/sharer/sharer.php?u=${shareUrl}`;\n return (\n \n \n
\n \n \n \n
\n
\n \n );\n }\n\n _renderTwitter(shareUrl, shareText) {\n\n const href = `https://twitter.com/intent/tweet/?text=${shareText}&url=${shareUrl}`;\n return (\n \n \n
\n \n \n \n
\n
\n \n );\n }\n\n _renderThreads(shareUrl) {\n\n const href = `https://threads.net/intent/post?text=${shareUrl}`;\n return (\n \n \n
\n \n \n \n
\n
\n \n );\n }\n\n renderGoogle(shareUrl) {\n\n const href = `https://plus.google.com/share?url=${shareUrl}`;\n\n return (\n \n \n
\n \n \n \n
\n
\n \n );\n }\n\n _renderEmail(shareUrl, shareText) {\n\n const href = `mailto:?subject=${shareUrl}&body=${encodeURIComponent(shareText)}`;\n\n return (\n \n \n
\n \n \n \n
\n \n
\n );\n }\n\n _renderPinterest(shareUrl, shareText) {\n const href = `https://www.pinterest.com/pin/create/button/?description=${encodeURIComponent(shareText)}&url=${shareUrl}`;\n\n return (\n \n
\n
\n \n \n \n
\n
\n
\n );\n }\n\n _renderWhatsapp(shareUrl, shareText) {\n\n const href = `whatsapp://send?text=${shareText}%20${shareUrl}`;\n\n return (\n \n \n
\n \n \n \n
\n \n
\n );\n }\n\n _renderTelegram(shareUrl, shareText) {\n\n const href = `https://telegram.me/share/url?text=${shareText}&url=${shareUrl}`;\n\n return (\n \n \n
\n \n \n \n
\n \n
\n );\n }\n\n renderError() {\n\n return (\n Du musst einen Typ angegeben\n )\n }\n}\n","import conf from '../index';\n\nclass ShortenerService {\n short = async (url) => {\n\n try {\n const response = await fetch(`${conf.shortenerUrl}/api/shorten`, {\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({url: url}),\n method: 'Post',\n });\n\n if (response.ok) {\n const body = await response.json();\n return body['shortUrl'] ? body['shortUrl'] : '';\n } else {\n return {error: body};\n }\n } catch (e) {\n return e;\n }\n\n\n\n }\n}\n\nexport let shortenerService = new ShortenerService();","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport SectionHeader from '../sectionHeader';\nimport {customerService} from '../../services/customerService';\nimport ShareButton from '../shareButton';\nimport {shortenerService} from '../../services/shortenerService';\nimport {i18nService} from \"../../services/i18nService\";\n\nexport default class ReferAFriend extends Component {\n\n constructor(props) {\n super(props);\n this.state = {};\n\n customerService._subscribeForUser(async (user) => {\n this.setState({user: user});\n });\n }\n\n async componentDidMount() {\n\n let referralLink;\n try {\n referralLink = await customerService.getReferralLink();\n } catch (_) {\n }\n\n try {\n if (referralLink) {\n referralLink = await shortenerService.short(referralLink);\n }\n } catch (_) {\n }\n\n if (referralLink) {\n this.setState({referralLink: referralLink});\n }\n\n let shareId;\n try {\n shareId = await customerService.getShareId();\n } catch (_) {\n }\n\n let referralText;\n if (this.state.user) {\n let profile = this.state.user.profile ? this.state.user.profile : false;\n\n let replacements = [\n profile.firstName,\n shareId,\n referralLink\n ];\n\n try {\n referralText = await i18nService.replaceWildcards('loyalty_share_referral_message_text', replacements);\n } catch (_) {\n }\n\n if (referralText)\n this.setState({referralText: referralText});\n } else\n return false;\n }\n\n render(props, state) {\n return (\n
\n
\n {i18nService.translate('dashboard_refer_a_friend_headline')}\n {state.referralLink &&\n
\n

{i18nService.translate('dashboard_refer_a_friend_text')}

\n
\n
{state.referralLink}
\n
\n
\n \n\n \n\n \n\n \n\n \n\n \n
\n
\n }\n
\n
\n );\n }\n}\n","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport {customerService} from '../../services/customerService';\nimport {i18nService} from \"../../services/i18nService\";\n\nexport default class Welcome extends Component {\n\n constructor(props) {\n super(props);\n this.state = {firstVisit: false};\n }\n\n componentDidMount() {\n customerService._subscribeForUser(async (user) => {\n this.setState({user: user});\n });\n\n let firstVisit = null;\n const storageItem = localStorage.getItem('LOYALTY_FIRST_VISIT');\n if (storageItem) {\n firstVisit = JSON.parse(storageItem);\n\n if (firstVisit) {\n customerService.setFirstVisit(false);\n this.setState({firstVisit: true});\n } else {\n customerService.setFirstVisit(false);\n this.setState({firstVisit: false});\n }\n\n } else {\n customerService.setFirstVisit(false);\n this.setState({firstVisit: true});\n }\n }\n\n render(props, state) {\n if (state.firstVisit && state.user && state.user.profile &&\n state.user.profile.firstName) {\n return (\n
\n

{i18nService.translate('dashboard_welcome_hello_text')} {state.user.profile.firstName},

\n
{i18nService.translate('dashboard_welcome_first_visit_text')}
\n
\n );\n } else if (state.user && state.user.profile &&\n state.user.profile.firstName) {\n return (\n
\n

{i18nService.translate('dashboard_welcome_hello_text')} {state.user.profile.firstName},

\n
{i18nService.translate('dashboard_welcome_visit_text')}
\n
\n );\n\n }\n else {\n return null;\n }\n }\n}","export default \"__VITE_ASSET__D7CeWVyl__\"","export default \"__VITE_ASSET__Bmp7WruB__\"","export default \"__VITE_ASSET__DPqI$mef__\"","export default \"__VITE_ASSET__DRvBvpB6__\"","import style from './style.module.scss';\nimport MobilePhone from '../../assets/images/mobile_phone.png';\nimport AppleAppStore from '../../assets/images/apple_app_store.png';\nimport GooglePlay from '../../assets/images/google_play.png';\nimport AppGallery from '../../assets/images/huawei_app_gallery.png';\nimport {i18nService} from \"../../services/i18nService\";\n\nconst GetMobileApp = () => (\n
\n
\n
\n \"Mobile\n
\n
\n
\n
\n
\n
{i18nService.translate('dashboard_getMobileApp_text')}
\n
\n
\n \n \"App\n \n
\n
\n \n \"Google\n \n
\n
\n \n \"Huawei\n \n
\n
\n
\n
\n);\n\n\nexport default GetMobileApp;","import {Component} from 'preact';\nimport style from \"./style.module.scss\";\nimport classNames from \"classnames\";\nimport {i18nService} from \"../../services/i18nService\";\n\nexport default class Menu extends Component {\n\n jumpTo(id, e) {\n e.preventDefault();\n let itemPos = document.getElementById(id).offsetTop + 310;\n\n if (!this.isInternetExplorer()) {\n window.scrollTo({top: itemPos, left: 0, behavior: 'smooth'});\n } else {\n document.getElementById(id).scrollIntoView();\n }\n }\n\n isInViewport = (elem) => {\n let bounding = document.getElementById(elem).getBoundingClientRect();\n let windowHeight = (window.innerHeight || document.documentElement.clientHeight);\n\n return (bounding.top <= windowHeight) && ((bounding.top + bounding.height) >= 25);\n };\n\n isInternetExplorer() {\n return navigator.appName === 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/))\n }\n\n onScroll() {\n if (this.isInViewport('userProfile')) {\n this.setState({selectedItem: 0});\n }\n else if (this.isInViewport('coupons')) {\n this.setState({selectedItem: 1});\n }\n else if (this.isInViewport('referAFriend')) {\n this.setState({selectedItem: 2});\n }\n else if (this.isInViewport('history')) {\n this.setState({selectedItem: 3});\n }\n }\n\n\n constructor(props) {\n super(props);\n\n this.state = {\n selectedItem: 0\n };\n }\n\n componentDidMount() {\n let isScrolling = false;\n document.addEventListener('scroll', () => {\n if (isScrolling) {\n return false;\n }\n isScrolling = true;\n this.onScroll();\n\n window.setTimeout(() => isScrolling = false, 50);\n });\n\n }\n\n render(props, state) {\n return (\n \n );\n }\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport {customerService} from \"../../services/customerService\";\nimport Button from \"../button\";\nimport {i18nService} from \"../../services/i18nService\";\n\nexport const OptInStates = {\n NO_REMINDER: 'NO_REMINDER',\n SHOW_DOI_REMINDER: 'SHOW_DOI_REMINDER',\n SHOW_VERIFICATION_REMINDER: 'SHOW_VERIFICATION_REMINDER',\n};\n\nexport default class DOIBanner extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n user: false,\n optInState: false,\n bannerDisplayed: false,\n };\n\n this.handleResend = this.handleResend.bind(this);\n }\n\n async componentDidMount() {\n customerService._subscribeForUser(async (user) => {\n this.setState({user: user});\n if (user) {\n const flags = await customerService.loadOptInState();\n this.setState({optInState: flags, bannerDisplayed: (flags.action === OptInStates.SHOW_DOI_REMINDER) || (flags.action === OptInStates.SHOW_VERIFICATION_REMINDER)});\n }\n });\n }\n\n render(props, state) {\n if (state.bannerDisplayed) {\n return (\n
\n
this.setState({bannerDisplayed: false})}>{this.renderCloseIcon()}
\n
\n {state.user.countryCode === 'DE' && state.optInState.advertisementConsent === true ? i18nService.translate('doi_with_advertisement_consent') : null}\n {state.user.countryCode !== 'DE' && state.optInState.advertisementConsent === true ? i18nService.translate('doi_with_advertisement_consent_international') : null}\n {state.optInState.emailVerified === false && state.optInState.advertisementConsent === false ? i18nService.translate('doi_no_advertisement_consent') : null}\n
\n\n
\n
\n
\n )\n }\n }\n\n async handleResend() {\n try {\n await customerService.resendVerificationEmail();\n this.setState({bannerDisplayed: false});\n } catch (ignored) {\n }\n }\n\n renderCloseIcon() {\n return (\n \n \n \n \n \n );\n }\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport Header from '../../components/header';\nimport Coupons from '../../components/coupons';\nimport UserProfile from '../../components/user-profile';\nimport History from '../../components/history';\nimport ReferAFriend from '../../components/referAFriend';\nimport Welcome from '../../components/welcome';\nimport GetMobileApp from '../../components/getMobileApp';\nimport Menu from '../../components/menu';\nimport DOIBanner from '../../components/doiBanner';\n\nexport default class Dashboard extends Component {\n\n render(props, state) {\n return (\n
\n \n
\n
\n
\n \n
\n
\n \n
\n \n \n \n \n \n \n
\n
\n
\n
\n );\n }\n}\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import _extends from '@babel/runtime/helpers/esm/extends';\n\n/**\r\n * Actions represent the type of change to a location value.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#action\r\n */\nvar Action;\n\n(function (Action) {\n /**\r\n * A POP indicates a change to an arbitrary index in the history stack, such\r\n * as a back or forward navigation. It does not describe the direction of the\r\n * navigation, only that the current index changed.\r\n *\r\n * Note: This is the default action for newly created history objects.\r\n */\n Action[\"Pop\"] = \"POP\";\n /**\r\n * A PUSH indicates a new entry being added to the history stack, such as when\r\n * a link is clicked and a new page loads. When this happens, all subsequent\r\n * entries in the stack are lost.\r\n */\n\n Action[\"Push\"] = \"PUSH\";\n /**\r\n * A REPLACE indicates the entry at the current index in the history stack\r\n * being replaced by a new one.\r\n */\n\n Action[\"Replace\"] = \"REPLACE\";\n})(Action || (Action = {}));\n\nvar readOnly = process.env.NODE_ENV !== \"production\" ? function (obj) {\n return Object.freeze(obj);\n} : function (obj) {\n return obj;\n};\n\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== 'undefined') console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nvar BeforeUnloadEventType = 'beforeunload';\nvar HashChangeEventType = 'hashchange';\nvar PopStateEventType = 'popstate';\n/**\r\n * Browser history stores the location in regular URLs. This is the standard for\r\n * most web apps, but it requires some configuration on the server to ensure you\r\n * serve the same app at multiple URLs.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\r\n */\n\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$window = _options.window,\n window = _options$window === void 0 ? document.defaultView : _options$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation[0],\n nextLocation = _getIndexAndLocation[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better what\n // is going on and how to avoid it.\n \"You are trying to block a POP navigation to a location that was not \" + \"created by the history library. The block will fail silently in \" + \"production, but in general you should do all navigation with the \" + \"history library (instead of using window.history.pushState directly) \" + \"to avoid this situation.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop);\n var action = Action.Pop;\n\n var _getIndexAndLocation2 = getIndexAndLocation(),\n index = _getIndexAndLocation2[0],\n location = _getIndexAndLocation2[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n } // state defaults to `null` because `window.history.state` does\n\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation3 = getIndexAndLocation();\n\n index = _getIndexAndLocation3[0];\n location = _getIndexAndLocation3[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr[0],\n url = _getHistoryStateAndUr[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr2[0],\n url = _getHistoryStateAndUr2[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Hash history stores the location in window.location.hash. This makes it ideal\r\n * for situations where you don't want to send the location to the server for\r\n * some reason, either because you do cannot configure it or the URL space is\r\n * reserved for something else.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\r\n */\n\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options2 = options,\n _options2$window = _options2.window,\n window = _options2$window === void 0 ? document.defaultView : _options2$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _parsePath = parsePath(window.location.hash.substr(1)),\n _parsePath$pathname = _parsePath.pathname,\n pathname = _parsePath$pathname === void 0 ? '/' : _parsePath$pathname,\n _parsePath$search = _parsePath.search,\n search = _parsePath$search === void 0 ? '' : _parsePath$search,\n _parsePath$hash = _parsePath.hash,\n hash = _parsePath$hash === void 0 ? '' : _parsePath$hash;\n\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation4 = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation4[0],\n nextLocation = _getIndexAndLocation4[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better\n // what is going on and how to avoid it.\n \"You are trying to block a POP navigation to a location that was not \" + \"created by the history library. The block will fail silently in \" + \"production, but in general you should do all navigation with the \" + \"history library (instead of using window.history.pushState directly) \" + \"to avoid this situation.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop); // popstate does not fire on hashchange in IE 11 and old (trident) Edge\n // https://developer.mozilla.org/de/docs/Web/API/Window/popstate_event\n\n window.addEventListener(HashChangeEventType, function () {\n var _getIndexAndLocation5 = getIndexAndLocation(),\n nextLocation = _getIndexAndLocation5[1]; // Ignore extraneous hashchange events.\n\n\n if (createPath(nextLocation) !== createPath(location)) {\n handlePop();\n }\n });\n var action = Action.Pop;\n\n var _getIndexAndLocation6 = getIndexAndLocation(),\n index = _getIndexAndLocation6[0],\n location = _getIndexAndLocation6[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function getBaseHref() {\n var base = document.querySelector('base');\n var href = '';\n\n if (base && base.getAttribute('href')) {\n var url = window.location.href;\n var hashIndex = url.indexOf('#');\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href;\n }\n\n function createHref(to) {\n return getBaseHref() + '#' + (typeof to === 'string' ? to : createPath(to));\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation7 = getIndexAndLocation();\n\n index = _getIndexAndLocation7[0];\n location = _getIndexAndLocation7[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr3 = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr3[0],\n url = _getHistoryStateAndUr3[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr4 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr4[0],\n url = _getHistoryStateAndUr4[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Memory history stores the current location in memory. It is designed for use\r\n * in stateful non-browser environments like tests and React Native.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#creatememoryhistory\r\n */\n\nfunction createMemoryHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options3 = options,\n _options3$initialEntr = _options3.initialEntries,\n initialEntries = _options3$initialEntr === void 0 ? ['/'] : _options3$initialEntr,\n initialIndex = _options3.initialIndex;\n var entries = initialEntries.map(function (entry) {\n var location = readOnly(_extends({\n pathname: '/',\n search: '',\n hash: '',\n state: null,\n key: createKey()\n }, typeof entry === 'string' ? parsePath(entry) : entry));\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: \" + JSON.stringify(entry) + \")\") : void 0;\n return location;\n });\n var index = clamp(initialIndex == null ? entries.length - 1 : initialIndex, 0, entries.length - 1);\n var action = Action.Pop;\n var location = entries[index];\n var listeners = createEvents();\n var blockers = createEvents();\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n search: '',\n hash: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction, nextLocation) {\n action = nextAction;\n location = nextLocation;\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n applyTx(nextAction, nextLocation);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n entries[index] = nextLocation;\n applyTx(nextAction, nextLocation);\n }\n }\n\n function go(delta) {\n var nextIndex = clamp(index + delta, 0, entries.length - 1);\n var nextAction = Action.Pop;\n var nextLocation = entries[nextIndex];\n\n function retry() {\n go(delta);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index = nextIndex;\n applyTx(nextAction, nextLocation);\n }\n }\n\n var history = {\n get index() {\n return index;\n },\n\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n return blockers.push(blocker);\n }\n };\n return history;\n} ////////////////////////////////////////////////////////////////////////////////\n// UTILS\n////////////////////////////////////////////////////////////////////////////////\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n\nfunction promptBeforeUnload(event) {\n // Cancel the event.\n event.preventDefault(); // Chrome (and legacy IE) requires returnValue to be set.\n\n event.returnValue = '';\n}\n\nfunction createEvents() {\n var handlers = [];\n return {\n get length() {\n return handlers.length;\n },\n\n push: function push(fn) {\n handlers.push(fn);\n return function () {\n handlers = handlers.filter(function (handler) {\n return handler !== fn;\n });\n };\n },\n call: function call(arg) {\n handlers.forEach(function (fn) {\n return fn && fn(arg);\n });\n }\n };\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\r\n * Creates a string URL path from the given pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createpath\r\n */\n\n\nfunction createPath(_ref) {\n var _ref$pathname = _ref.pathname,\n pathname = _ref$pathname === void 0 ? '/' : _ref$pathname,\n _ref$search = _ref.search,\n search = _ref$search === void 0 ? '' : _ref$search,\n _ref$hash = _ref.hash,\n hash = _ref$hash === void 0 ? '' : _ref$hash;\n if (search && search !== '?') pathname += search.charAt(0) === '?' ? search : '?' + search;\n if (hash && hash !== '#') pathname += hash.charAt(0) === '#' ? hash : '#' + hash;\n return pathname;\n}\n/**\r\n * Parses a string URL path into its separate pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#parsepath\r\n */\n\nfunction parsePath(path) {\n var parsedPath = {};\n\n if (path) {\n var hashIndex = path.indexOf('#');\n\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n var searchIndex = path.indexOf('?');\n\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport { Action, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, parsePath };\n//# sourceMappingURL=index.js.map\n","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport Header from '../../components/header';\nimport CouponControls from '../../components/partnerCouponControls';\nimport GetMobileApp from \"../../components/getMobileApp\";\nimport classNames from 'classnames';\nimport {loyaltyDataService} from \"../../services/loyaltyDataService\";\nimport {customerService} from \"../../services/customerService\";\nimport {route} from 'preact-router';\nimport Logo from '../../assets/images/get_more_logo_black.png';\nimport {i18nService} from \"../../services/i18nService\";\n\nexport default class CouponDetails extends Component {\n\n async componentDidMount() {\n const regWidget = document.querySelector(\"registration-widget\");\n regWidget.addEventListener('ny-customer-logged-in', (e) => {\n loyaltyDataService.reload();\n });\n\n customerService._subscribeForUser((user) => {\n if (!user) {\n route('/');\n }\n });\n\n customerService._subscribeForUserNotAvailable(() => {\n this.setState({notLoggedIn: true});\n });\n\n loyaltyDataService._subscribeForLoyaltyData((data) => {\n if(!data) return\n\n this.setState({\n loggedIn: true,\n notLoggedIn: false\n });\n\n let loyaltyData = data;\n\n let coupons;\n try {\n coupons = loyaltyData.coupons;\n } catch (e) {\n coupons = [];\n }\n\n let coupon = this._findMatchingCoupon(this.props.id, coupons);\n\n if (coupon) {\n coupon.type = 'COUPON';\n this.setState({coupon: coupon});\n }\n\n if (!coupon) {\n\n let rewards;\n try {\n rewards = loyaltyData.rewards;\n } catch (e) {\n rewards = [];\n }\n\n let reward = this._findMatchingCoupon(this.props.id, rewards);\n if (reward) {\n reward.type = 'REWARD';\n this.setState({coupon: reward});\n }\n }\n\n if (this.state.coupon) {\n let coupon = this.state.coupon;\n if (coupon.externalCode.startsWith('pa_'))\n coupon.isPartnerCoupon = true;\n }\n });\n\n window.scrollTo(0,0);\n }\n\n render(props, state) {\n if (props && props.id && state && state.coupon) {\n\n return (\n
\n
\n
\n
\n
\n
{this._renderArrowLeft()}
\n
\n {this._renderCoupon(state.coupon)}\n
\n \n
\n
\n
\n
\n\n );\n }\n else {\n return (\n
\n
\n
\n \n {state.loggedIn && !state.coupon ? this._renderNoCouponFound() : null}\n
\n
\n );\n }\n }\n\n _renderNoCouponFound() {\n return (\n
\n
\n {'GET-MORE\n
\n
\n {i18nService.translate('error_message_no_coupon_found')}\n
\n route('/dashboard')}>{i18nService.translate('button_back_dashboard')}\n
\n )\n }\n\n _getImageSrc(coupon) {\n try {\n let image = null;\n\n for (let i of coupon.images) {\n let tag = false;\n for (let t of i.tags) {\n if (t === 'list_web') {\n image = i;\n tag = true;\n break;\n }\n }\n if (tag)\n break;\n }\n\n if (image)\n return image.url;\n return '';\n } catch (err) {\n return '';\n }\n }\n\n _renderCoupon(coupon) {\n let backgroundStyle = {\n backgroundImage: 'url(' + this._getImageSrc(coupon) + ')',\n };\n\n let validityString = this._getValidityString(\n coupon.validFrom, coupon.validTo, coupon.isAllDay);\n\n let translations = coupon.translations && coupon.translations.de;\n\n let hasPoints = !!(coupon.points && coupon.points !== 0);\n\n return (\n
\n
\n
\n {hasPoints &&\n
\n
\n
{coupon.points}
\n
{i18nService.translate('dashboard_coupons_pointsText')}
\n
\n
\n }\n
\n\n\n
\n {translations && translations.title &&\n
\n
{translations.title}
\n
{translations.subtitle}
\n
}\n
{translations.body}
\n {coupon.isPartnerCoupon ? null :\n coupon.type === 'COUPON' ?\n
{i18nService.translate('loyalty_coupon_legal_text')}
:\n coupon.type === 'REWARD' ?\n
{i18nService.translate('loyalty_reward_legal_text')}
: null}\n \n
\n {!coupon.isUnlimited &&
{this._renderCalendarIcon()}\n {validityString &&\n {validityString}}
}\n
\n
\n
\n
\n );\n }\n\n _renderCalendarIcon() {\n return (\n \n \n \n \n \n );\n }\n\n _renderArrowLeft() {\n // history.back() reminds the scroll position so it's a better user experience instead of going back to the dashboard in every case\n const historyEmpty = window.history.length <= 2;\n\n return (\n historyEmpty ? route('/dashboard') : window.history.back()}>\n \n \n \n \n );\n }\n\n _getValidityString(validFrom, validTo, isAllDay) {\n try {\n let fromDate = new Date(validFrom);\n let toDate = new Date(validTo);\n\n if (validFrom && fromDate.getTime() > new Date().getTime()) {\n return 'COMING SOON';\n }\n let options = {year: 'numeric', month: '2-digit', day: '2-digit' };\n\n if (validTo) {\n if (!isAllDay)\n return i18nService.translate('dashboard_coupon_valid_to_date_time', toDate.toLocaleDateString('de-DE', options), toDate.toLocaleTimeString('de-DE', {hour: '2-digit', minute:'2-digit'}));\n else\n return i18nService.translate('dashboard_coupon_valid_to_date', toDate.toLocaleDateString('de-DE', options));\n } else return false;\n } catch (e) {\n return '';\n }\n\n }\n\n _findMatchingCoupon(id, coupons) {\n for (const coupon of coupons) {\n if (coupon.id === id) {\n return coupon;\n }\n }\n return null;\n }\n}\n","export default \"__VITE_ASSET__TL7O4U6$__\"","export default \"__VITE_ASSET__B3SZEVJm__\"","export default \"__VITE_ASSET__b5nf8$AX__\"","export default \"__VITE_ASSET__Din0$bPo__\"","export default \"__VITE_ASSET__DPR6oB5Y__\"","export default \"__VITE_ASSET__520pBgal__\"","export default \"__VITE_ASSET__CI_7nch2__\"","import {Component} from 'preact';\nimport style from './style.module.scss';\n\nexport default class InfoItem extends Component {\n\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n render(props, state) {\n\n if (props.infoData) {\n\n return (\n
\n
\n \"start\n
\n

{props.infoData.headline}

\n
\n\n
{props.infoData.text}
\n
\n )\n }\n }\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport classNames from 'classnames';\n\nexport default class Checkbox extends Component {\n\n constructor(props) {\n super(props);\n this.state = {};\n\n this.handleOnChange = this.handleOnChange.bind(this);\n }\n\n render(props, state) {\n let label = this.renderLabel(props);\n return (\n
\n \n
\n );\n }\n\n renderLabel(props) {\n if (props.unsafeLabel) {\n return ()\n } else {\n return({this.props.label}{this.props.required ? '*' : ''})\n }\n }\n\n handleOnChange(event) {\n const target = event.target;\n this.setState((prevState => ({\n isChecked: !prevState.isChecked,\n })));\n if (this.props.inputCallback) {\n this.props.inputCallback(this.state.isChecked);\n }\n }\n}","import {Component} from 'preact';\nimport style from './style.module.scss';\nimport LogoWhite from '../../assets/images/get_more_logo_white.png';\nimport LogoBlack from '../../assets/images/get_more_logo_black.png';\nimport ImgLoginRegister from '../../assets/images/landing/login_register.jpg';\nimport ImgInfoClubOffers from '../../assets/images/landing/landing_page_club_offers.jpg';\nimport ImgInfoCooperation from '../../assets/images/landing/landing_page_cooperation.jpg';\nimport ImgInfoPoints from '../../assets/images/landing/landing_page_points.jpg';\nimport VideoOverlay from '../../assets/images/video-overlay.jpg';\nimport ImgInfoMembership from '../../assets/images/landing/landing_page_membership.jpg';\nimport InfoItem from '../../components/infoItem';\nimport {route} from 'preact-router';\nimport Checkbox from '../../components/checkbox';\nimport {i18nService} from '../../services/i18nService';\nimport Button from '../../components/button';\nimport {customerService} from '../../services/customerService';\nimport ErrorMessage from '../../components/errorMessage';\nimport {shareIdService} from '../../services/shareIdService';\n\nexport default class Home extends Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n errorMessage: false,\n infoItems: [],\n };\n\n if (props.shareId) {\n shareIdService.setShareId(props.shareId);\n }\n\n this.goToLogin = this.goToLogin.bind(this);\n this.goToRegister = this.goToRegister.bind(this);\n this.handleActivateLoyalty = this.handleActivateLoyalty.bind(this);\n }\n\n async componentDidMount() {\n this.setState({infoItems: [\n {\n url: ImgInfoMembership,\n headline: i18nService.translate('home_join_club_headline'),\n text: i18nService.translate('home_join_club_text')\n },\n {\n url: ImgInfoPoints,\n headline: i18nService.translate('home_collect_points_headline'),\n text: i18nService.translate('home_collect_points_text'),\n },\n {\n url: ImgInfoClubOffers,\n headline: i18nService.translate('home_club_rewards_headline'),\n text: i18nService.translate('home_club_rewards_text'),\n },\n {\n url: ImgInfoCooperation,\n headline: i18nService.translate('home_cooperation_headline'),\n text: i18nService.translate('home_cooperation_text'),\n }\n ]});\n }\n\n render(props, state) {\n return (\n
\n
\n
\n\n {this.renderActions(props, state)}\n\n
\n
\n {this.renderInfoItem(state.infoItems[0])}\n
\n
\n
\n {this.renderInfoItem(state.infoItems[1])}\n
\n
\n
\n
\n {this.renderInfoItem(state.infoItems[2])}\n
\n
\n
\n {this.renderInfoItem(state.infoItems[3])}\n
\n
\n\n
\n
\n
\n \n