{"version":3,"file":"CustomerInfo.js","names":["CustomerInfo","a","setters","Component","default","Event","on","off","deepMerge","CrossRequestStorage","execute","constructor","element","options","arguments","length","section","id","reloadData","afterInit","processDelayedActionForSocialLogin","bindEvents","reload","bind","onClick","emit","category","action","label","extraData","event_name","cta_name","destroy","removeListener"],"sources":["components/header/CustomerInfo.js"],"sourcesContent":["import Component from 'core/Component';\nimport { Event } from 'services/EventEmitter';\nimport { on, off } from 'toolbox/event';\nimport { deepMerge } from 'toolbox/deepMerge';\nimport CrossRequestStorage from 'services/CrossRequestStorage';\n\n/**\n * This is a description of the CustomerInfo constructor function.\n * @class\n * @classdesc This is a description of the CustomerInfo class.\n * @extends Component\n */\nexport default class CustomerInfo extends Component {\n /**\n * Constructor of the class that mainly merge the options of the components\n *\n * @param {HTMLElement} element HTMLElement of the component\n * @param {Object} options That belongs to the component\n */\n constructor(element, options = {}) {\n super(element, deepMerge({\n section: 'header',\n id: 'headercustomerinfo',\n reloadData: {\n section: 'header',\n id: 'headercustomerinfo',\n },\n }, options));\n }\n\n /**\n * After init\n * Run any script after the component is fully initialized\n */\n afterInit() {\n CrossRequestStorage.processDelayedActionForSocialLogin();\n }\n\n /**\n * Should contain only event listeners and nothing else\n * All the event handlers should be into a separated function. No usage of anonymous function\n */\n bindEvents() {\n Event.on('registration.success', this.reload.bind(this));\n Event.on('login.success', this.reload.bind(this));\n on('click', this.element, this.onClick.bind(this));\n }\n\n /**\n * Click event handler\n */\n onClick() {\n Event.emit('analytics.event', {\n category: 'header',\n action: 'select',\n label: 'account',\n extraData: {\n event_name: 'header_click',\n cta_name: 'account',\n },\n });\n }\n\n /**\n * Destroy is called automatically after the component is being removed from the DOM\n * You must always destroy the listeners attached to an element to avoid any memory leaks\n */\n destroy() {\n Event.removeListener('registration.success', this.reload.bind(this));\n Event.removeListener('login.success', this.reload.bind(this));\n off('click', this.element);\n }\n}\n"],"mappings":"oLAYqBA,CAAY,QAAAC,CAAA,oBAAAC,OAAA,WAAAD,CAAA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