{"version":3,"file":"bundle.37.99b31aabce6fa03f592738b62dc5c1af.js","mappings":"4JAEA,MAqEA,EArE4BA,KAC3BC,EAAAA,EAAAA,WAAUD,EAAK,iCAEf,MACCE,KAAK,SAAEC,IACJH,EAmBJG,EAASC,MAAMC,WAAWC,gBAAkB,cAC3CH,EAASI,UAAUC,QAAQC,wBAO5BN,EAASC,MAAMC,WAAWC,gBAAgBI,UAAUC,YAEnD,6BAWDR,EAASC,MAAMC,WAAWC,gBAAgBI,UAAUE,kBACnD,SAA+BC,GAC9B,MAAMC,EAAeD,EACrBC,EAAaC,mBACZD,EAAaC,mBAAmBC,QAAQ,aAAc,KACvDC,KAAKC,SAASN,kBAAkBE,EAChC,EAQFX,EAASC,MAAMC,WAAWC,gBAAgBI,UAAUS,qBACnD,SAA8BN,GACA,qBAAzBA,EAAUO,WAIdH,KAAKC,SAASC,qBAAqBN,GAHlCI,KAAKI,IAAIC,KAAK,kCAIf,CAPF,C","sources":["webpack://ws-tagging/./src/utils/legacy/projects/shift/decorators/GlobalDecorator.js"],"sourcesContent":["import { namespace } from 'wsm-tagging-utils';\n\nconst runGlobalDecorator = (win) => {\n\tnamespace(win, 'DDC.tracking.shift.decorators');\n\n\tconst {\n\t\tDDC: { tracking }\n\t} = win;\n\n\t/**\n\t * The GlobalDecorator will be applied to all EventHandler implementations and\n\t * anything in here should be considered \"program-wide\" behavior.\n\t *\n\t * @param {Object} window The window object\n\t * @param {tracking.framework.runtime.Page} page A Page instance for page related queries\n\t * @param {tracking.framework.runtime.EventHandler} delegate The EventHandler implementation to which all interface\n\t * operations are delegated\n\t * @constructor\n\t */\n\t// tracking.shift.decorators.GlobalDecorator = function GlobalDecorator(window, page, delegate, form) {\n\t// \ttracking.framework.runtime.EventHandlerDecorator.call(this, window, page, delegate, form);\n\t// };\n\n\t// Make GlobalDecorator inherit from EventHandlerDecorator\n\t// DDC.classes.extend(tracking.shift.decorators.GlobalDecorator, tracking.framework.runtime.EventHandlerDecorator);\n\n\ttracking.shift.decorators.GlobalDecorator = class extends (\n\t\ttracking.framework.runtime.EventHandlerDecorator\n\t) {\n\t\t// constructor(window, page, delegate, form) {\n\t\t// \tsuper(window, page, delegate, form)\n\t\t// }\n\t};\n\n\ttracking.shift.decorators.GlobalDecorator.prototype.logCategory =\n\t\t// maybe we should add the word 'shift' here?\n\t\t'ws-tagging:GlobalDecorator';\n\n\t/**\n\t * Replaces all spaces in the typed search content with \"|\"\n\t *\n\t * @param {Object} eventData The event data object.\n\t *\n\t * Relevant eventData properties:\n\t * {string} trackingId The DDC racking identifier of the form\n\t * {string} content The typed search content\n\t */\n\ttracking.shift.decorators.GlobalDecorator.prototype.handleTypedSearch =\n\t\tfunction addTypedSearchContent(eventData) {\n\t\t\tconst newEventData = eventData;\n\t\t\tnewEventData.typedSearchContent =\n\t\t\t\tnewEventData.typedSearchContent.replace(/([\\s,|]+)/g, '|');\n\t\t\tthis.delegate.handleTypedSearch(newEventData);\n\t\t};\n\n\t/**\n\t * Consumes the form initiation event if it originates from an inventory search.\n\t *\n\t * @param {Object} eventData The event data object. Relevant properties:\n\t * {string} trackingId The DDC tracking identifier of the form\n\t */\n\ttracking.shift.decorators.GlobalDecorator.prototype.handleFormInitiation =\n\t\tfunction handleFormInitiation(eventData) {\n\t\t\tif (eventData.trackingId === 'INVENTORY_SEARCH') {\n\t\t\t\tthis.log.info('Consuming form initiation event');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.delegate.handleFormInitiation(eventData);\n\t\t};\n};\n\nexport default runGlobalDecorator;\n"],"names":["win","namespace","DDC","tracking","shift","decorators","GlobalDecorator","framework","runtime","EventHandlerDecorator","prototype","logCategory","handleTypedSearch","eventData","newEventData","typedSearchContent","replace","this","delegate","handleFormInitiation","trackingId","log","info"],"sourceRoot":""}