{"version":3,"file":"es.js","sources":["../src/index.js"],"sourcesContent":["(() => {\n\tconst FIREHOSE_PERCENTAGE = parseInt(\n\t\tdocument.getElementById('firehose-percentage').dataset.firehosePercentage,\n\t\t10\n\t);\n\n\twindow.DDC = window.DDC || {};\n\twindow.DDC.dataLayer = window.DDC.dataLayer || {};\n\twindow.DDC.dataLayer.page = window.DDC.dataLayer.page || {};\n\n\tconst wueActionMap = {\n\t\t'auto updated': 'auto update',\n\t\tadded: 'add',\n\t\tapplied: 'apply',\n\t\tchanged: 'change',\n\t\tclicked: 'click',\n\t\tcollapsed: 'collapse',\n\t\tcompleted: 'complete',\n\t\tdisplayed: 'display',\n\t\texpanded: 'expand',\n\t\timpression: 'view',\n\t\tnavigated: 'navigate',\n\t\topened: 'open',\n\t\treceived: 'receive',\n\t\tremoved: 'remove',\n\t\tsaved: 'save',\n\t\tselected: 'select',\n\t\tsubmitted: 'submit',\n\t\tswiped: 'swipe',\n\t\tupdated: 'update',\n\t\tviewed: 'view'\n\t};\n\n\tconst replaceValues = (inputString, map) => {\n\t\tlet str;\n\t\tif (typeof inputString === 'string') {\n\t\t\tstr = inputString\n\t\t\t\t.toLowerCase()\n\t\t\t\t.split(' ')\n\t\t\t\t.map((word) => map[word] || word)\n\t\t\t\t.join(' ');\n\t\t}\n\t\treturn str;\n\t};\n\n\tconst filterCdlProperties = (payload) => {\n\t\tlet propsToFilter = [];\n\t\tif (payload.event.gtmEvent === 'specialsEvent') {\n\t\t\tpropsToFilter = [\n\t\t\t\t'specialPersonalized',\n\t\t\t\t'title',\n\t\t\t\t'specialId',\n\t\t\t\t'specialAutoGen',\n\t\t\t\t'promoIndex',\n\t\t\t\t'customAsset',\n\t\t\t\t'gtm.uniqueEventId',\n\t\t\t\t'promoIndex',\n\t\t\t\t'oemId',\n\t\t\t\t'specialCategory'\n\t\t\t];\n\t\t}\n\n\t\tif (payload.event.gtmEvent === 'widgetUserEvent') {\n\t\t\tpropsToFilter = [\n\t\t\t\t'formId',\n\t\t\t\t'fieldValue',\n\t\t\t\t'formEventId',\n\t\t\t\t'sourceData',\n\t\t\t\t'value',\n\t\t\t\t'widgetState',\n\t\t\t\t'gtm.uniqueEventId',\n\t\t\t\t'uuid'\n\t\t\t];\n\t\t}\n\n\t\tif (payload.event.gtmEvent === 'thirdPartyUserEvent') {\n\t\t\tpropsToFilter = [\n\t\t\t\t'gtm.uniqueEventId',\n\t\t\t\t'intention',\n\t\t\t\t'vehicleUuid',\n\t\t\t\t'product',\n\t\t\t\t'step'\n\t\t\t];\n\t\t}\n\n\t\tpropsToFilter.forEach((prop) => {\n\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\tdelete payload.event[prop];\n\t\t});\n\n\t\tif (payload.event.windowId) {\n\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\tpayload.event.widgetId = payload.event.windowId;\n\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\tdelete payload.event.windowId;\n\t\t}\n\t};\n\n\tconst replaceUrl = (inputString) => {\n\t\tconst urlPattern = /(https?:\\/\\/[^\\s]+)/g;\n\t\tconst match = inputString.match(urlPattern);\n\t\tlet destinationUrl = '';\n\n\t\tif (match) {\n\t\t\t[destinationUrl] = match;\n\t\t\tconst updatedString = inputString.replace(urlPattern, 'destination url');\n\t\t\treturn { updatedString, destinationUrl };\n\t\t}\n\n\t\treturn { updatedString: inputString, destinationUrl: '' };\n\t};\n\n\tconst validateNonZeroLengthString = (str, name) => {\n\t\tif (typeof str !== 'string' || str.length === 0) {\n\t\t\tthrow new Error(`${name} must be a non-zero length string. Got: ${str}.`);\n\t\t}\n\t};\n\n\t// Unique eventId generation for each page\n\tconst generateIdCrypto = () => {\n\t\tconst randomBuffer = new window.Uint32Array(24);\n\t\twindow.crypto.getRandomValues(randomBuffer);\n\t\tlet id = '';\n\t\tfor (let i = 0; i < randomBuffer.length; i++) {\n\t\t\tconst random = Math.floor((randomBuffer[i] / (0xffffffff + 1)) * 62);\n\t\t\tif (random > 35) {\n\t\t\t\tid += (random - 26).toString(36).toUpperCase();\n\t\t\t} else {\n\t\t\t\tid += random.toString(36);\n\t\t\t}\n\t\t}\n\t\treturn id;\n\t};\n\n\tconst generateId = () => {\n\t\tif (window.crypto && window.crypto.getRandomValues) {\n\t\t\treturn generateIdCrypto();\n\t\t} else {\n\t\t\treturn Math.trunc(Math.random() * 1000000000);\n\t\t}\n\t};\n\n\tconst shouldTrack = () => {\n\t\tconst host = window.location.hostname;\n\t\tconst isDev = host.includes('.web-np.') || host.includes('.localhost.');\n\t\treturn isDev || Math.floor(Math.random() * (100 - 0) + 1) <= 10;\n\t};\n\n\twindow.DDC.dataLayer.page.generateId = generateId;\n\n\t// Set the pageViewId\n\twindow.DDC.dataLayer.page.pageViewId = generateId();\n\n\tif (!window.setNRAttr) {\n\t\twindow.setNRAttr = (k, v) => {\n\t\t\tif (window?.newrelic && k && v) {\n\t\t\t\twindow.newrelic.setCustomAttribute(k, v);\n\t\t\t}\n\t\t};\n\t}\n\tif (!window.sendNRAction) {\n\t\twindow.sendNRAction = (k, o) => {\n\t\t\tconst obj = o;\n\t\t\tif (window?.newrelic && k && obj) {\n\t\t\t\tobj.eventType = 'PageAction';\n\t\t\t\twindow.newrelic.addPageAction(k, obj);\n\t\t\t}\n\t\t};\n\t}\n\n\twindow.DDC.pushToFirehose = (\n\t\teventCategory,\n\t\teventName,\n\t\tpayload,\n\t\tpercentageToSend = 1\n\t) => {\n\t\tif (Math.ceil(Math.random() * 100) <= percentageToSend) {\n\t\t\tconst { element: _element, ...eventData } = payload || {};\n\n\t\t\tconst apiUri = '/api/widget/ws-tagging/firehose';\n\t\t\tconst options = {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\teventCategory,\n\t\t\t\t\teventName,\n\t\t\t\t\tpayload: {\n\t\t\t\t\t\t...eventData,\n\t\t\t\t\t\t...(Object.keys(eventData).length && {\n\t\t\t\t\t\t\teventData\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t};\n\t\t\tfetch(apiUri, options)\n\t\t\t\t.then((response) => response.json())\n\t\t\t\t.then((data) => {\n\t\t\t\t\twindow?.DDC?.log?.('log', data);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\twindow?.DDC?.log?.('warn', error);\n\t\t\t\t});\n\t\t}\n\t};\n\n\twindow.DDC.pushToPixall = (payloadIn, { event, source } = {}) => {\n\t\tconst payload = JSON.parse(JSON.stringify(payloadIn));\n\t\tconst { pageViewId } = window.DDC.dataLayer.page;\n\n\t\tpayload.experimental = payload.experimental || {};\n\t\tif (\n\t\t\t!payload.experimental.eventId ||\n\t\t\t(event !== 'cms-web-pixall-pageview' &&\n\t\t\t\tpayload.experimental.eventId === pageViewId)\n\t\t) {\n\t\t\tpayload.experimental.eventId = generateId();\n\t\t}\n\t\tpayload.experimental.pageViewId = pageViewId;\n\n\t\twindow._pxam.push(payload);\n\n\t\tconst { category = '', eventSource = '', eventType = '' } = payload;\n\n\t\tconst eventName =\n\t\t\tevent || [eventSource, eventType, category].filter(Boolean).join('|');\n\n\t\twindow.DDC.pushToFirehose(\n\t\t\t'pixall',\n\t\t\tpayload.eventType || eventName,\n\t\t\tpayload,\n\t\t\tFIREHOSE_PERCENTAGE || 1\n\t\t);\n\n\t\tif (shouldTrack()) {\n\t\t\tconst additionalProperties = [\n\t\t\t\t'category',\n\t\t\t\t'contentType',\n\t\t\t\t'description',\n\t\t\t\t'eventSource',\n\t\t\t\t'eventType',\n\t\t\t\t'label'\n\t\t\t].reduce((acc, key) => {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(payload, key)) {\n\t\t\t\t\tconst newKey = `pixall${key.charAt(0).toUpperCase()}${key.slice(1)}`;\n\t\t\t\t\tacc[newKey] = payload[key];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t}, {});\n\n\t\t\twindow.sendNRAction('pixall_send_data', {\n\t\t\t\t...(source && { mappingSource: source }),\n\t\t\t\teventId: payload.experimental.eventId,\n\t\t\t\tpageViewId: payload.experimental.pageViewId,\n\t\t\t\teventName,\n\t\t\t\t...additionalProperties\n\t\t\t});\n\t\t}\n\n\t\tif (window?.sendToEventViewer) {\n\t\t\twindow?.sendToEventViewer?.(event, payload, source);\n\t\t}\n\t};\n\n\t/**\n\t * Method for pushing events into the Google Tag Manager DataLayer\n\t * @param event {Object} The event object to check against\n\t * @param dataToExclude {Object} This is data that was excluded from the widgetUserEvent\n\t */\n\twindow.DDC.pushToGtmDataLayer = (event, dataToExclude) => {\n\t\tlet pushedToGtmDataLayer = false;\n\t\tconst eventOut = event;\n\t\tif (window?.dataLayer?.push) {\n\t\t\tconst { pageViewId } = window.DDC.dataLayer.page;\n\t\t\tif (eventOut?.event?.includes('ddc.')) {\n\t\t\t\teventOut.eventData = eventOut.eventData || {};\n\t\t\t\teventOut.eventData.eventId =\n\t\t\t\t\teventOut.event === 'ddc.page.view' ? pageViewId : generateId();\n\t\t\t\teventOut.eventData.pageViewId = pageViewId;\n\t\t\t\t// adding event, eventName, eventType as OSIRIS widgets may not add this\n\t\t\t\tconst attributes = ['event', 'eventName', 'eventType'];\n\t\t\t\tattributes.forEach((attr) => {\n\t\t\t\t\teventOut.eventData[attr] = eventOut.eventData[attr] || eventOut.event;\n\t\t\t\t});\n\t\t\t\t// added to be consistent with DDC.dataLayer.vehicles[N].modelyear\n\t\t\t\tif (event.eventData.year) {\n\t\t\t\t\teventOut.eventData.modelYear = event.eventData.year;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\teventOut.eventId =\n\t\t\t\t\teventOut.event === 'ddc.page.view' ? pageViewId : generateId();\n\t\t\t}\n\t\t\twindow.dataLayer.push(eventOut);\n\t\t\tpushedToGtmDataLayer = true;\n\t\t} else {\n\t\t\twindow?.DDC?.log('dataLayer or dataLayer.push is undefined', eventOut);\n\t\t}\n\n\t\t/*\n\t\t * \tSend to coxAutoDataLayer if in the allow list of widgets.\n\t\t */\n\t\tif (\n\t\t\tnew Set(['ws-car-customizer', 'ws-inv-facets']).has(event.widgetName) ||\n\t\t\t(window.DDC.Flags['cms-web-all-wue-to-cdl'] &&\n\t\t\t\tevent.event === 'widgetUserEvent') ||\n\t\t\t(window.DDC.Flags['cms-web-all-specialsEvent-to-cdl'] &&\n\t\t\t\tevent.event === 'specialsEvent') ||\n\t\t\t(window.DDC.Flags['cms-web-all-thirdPartyUserEvent-to-cdl'] &&\n\t\t\t\tevent.event === 'thirdPartyUserEvent')\n\t\t) {\n\t\t\tconst {\n\t\t\t\taction,\n\t\t\t\tresult,\n\t\t\t\tevent: gtmEvent,\n\t\t\t\telementCTA,\n\t\t\t\t// specialsEvent data\n\t\t\t\ttitle,\n\t\t\t\tspecialType,\n\t\t\t\tspecialPlacementType,\n\t\t\t\t// thirdPartyUserEvent data\n\t\t\t\tstep,\n\t\t\t\t// misc\n\t\t\t\t...remainingCdlData\n\t\t\t} = event;\n\n\t\t\tlet intention = result;\n\t\t\tlet destinationUrl;\n\n\t\t\tif (typeof intention === 'string') {\n\t\t\t\tintention = replaceValues(result, wueActionMap) || result;\n\t\t\t\tconst replacementObj = replaceUrl(intention);\n\n\t\t\t\tintention = replacementObj.updatedString;\n\t\t\t\tdestinationUrl = replacementObj.destinationUrl;\n\t\t\t}\n\n\t\t\tconst payload = {\n\t\t\t\tevent: {\n\t\t\t\t\t...(intention && { intention }),\n\t\t\t\t\telementText: elementCTA,\n\t\t\t\t\tgtmEvent,\n\t\t\t\t\t...remainingCdlData,\n\t\t\t\t\t...(typeof remainingCdlData?.element !== 'string' && { element: '' }),\n\t\t\t\t\t...(event.event === 'specialsEvent' && { element: title || '' }),\n\t\t\t\t\t...(event.event === 'thirdPartyUserEvent' && {\n\t\t\t\t\t\telement: `${event.element} ${step}` || ''\n\t\t\t\t\t}),\n\t\t\t\t\t...dataToExclude,\n\t\t\t\t\taction:\n\t\t\t\t\t\treplaceValues(action || specialType, wueActionMap) ||\n\t\t\t\t\t\taction ||\n\t\t\t\t\t\tspecialType,\n\t\t\t\t\t...(destinationUrl && { destinationUrl }),\n\t\t\t\t\t...(specialPlacementType && { location: specialPlacementType })\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tfilterCdlProperties(payload);\n\t\t\twindow.coxAutoDataLayer?.push?.(payload);\n\t\t}\n\n\t\treturn pushedToGtmDataLayer;\n\t};\n\n\t/**\n\t * Method used by OSIRIS widgets to push widgetUserEvents to Google Analytics and Google Tag Manager DataLayer\n\t * @param {Object} data - The event object to pass along to trackEvent\n\t * @param {Object} data.dataToExcludeFromWidgetUserEvent - Data to exclude from the widgetUserEvent\n\t */\n\twindow.DDC.fireTrackingEvent = (data) => {\n\t\t/* Remove dataToExcludeFromWidgetUserEvent so it does not go into widgetUserEvent. It is only needed for tracking widgets.\n\t\t\tThis is how we pass additional data from OSIRIS widgets to our tracking widgets.\n\t\t\tSee how this is used in v9/viewmodel/widgets/tracking/framework/runtime/InteractionListener.js\n\t\t\t*/\n\t\tconst {\n\t\t\tdataToExcludeFromWidgetUserEvent,\n\t\t\t...dataToIncludeInWidgetUserEvent\n\t\t} = data;\n\t\tjQuery(document).trigger('trackEvent', [\n\t\t\tdataToIncludeInWidgetUserEvent,\n\t\t\tdataToExcludeFromWidgetUserEvent\n\t\t]);\n\t};\n\n\t/**\n\t * Method used by ws-tagging to receive trackEvents for tracking purposes.\n\t *\n\t * @param {Function} callback - The callback function to handle the trackEvent\n\t * @param {Object} callback.event - The event object\n\t * @param {Object} callback.eventData - The event data object\n\t * @param {Object} [callback.optionalData] - Optional additional data\n\t */\n\twindow.DDC.receiveTrackingEvent = (callback) => {\n\t\tjQuery(document).on('trackEvent', (event, eventData, optionalData) => {\n\t\t\tcallback(event, eventData, optionalData);\n\t\t});\n\t};\n\n\t/**\n\t * Method used by tracking code that wants the additional properties that ws-tracking appends to events\n\t * before they go into window.dataLayer\n\t *\n\t * @param {String} event - A string for the event name\n\t * @param {Object} eventData - An object of properties for the eventData\n\t * @param {Element} eventData.element - A DOM Element associated with the event\n\t * @throws {Error} If event is not a non-zero length string or eventData.element is not a DOM Element\n\t * @description This method is used to add things to window.dataLayer through the DDC.pushEvent method on Dealer.com sites.\n\t * This method will make sure ws-tracking manipulates the event as necessary to add missing properties.\n\t */\n\twindow.DDC.pushEvent = ({ event, eventData }) => {\n\t\tvalidateNonZeroLengthString(event, 'event name');\n\t\tif (!(eventData?.element instanceof Element)) {\n\t\t\tthrow new Error('eventData.element must be a DOM Element.');\n\t\t}\n\n\t\tif (window?.DDC?.WidgetData?.['ws-tracking']?.pushEvent) {\n\t\t\twindow.DDC.WidgetData['ws-tracking'].pushEvent({\n\t\t\t\tevent,\n\t\t\t\teventData\n\t\t\t});\n\t\t} else {\n\t\t\twindow.addEventListener('pushEventReady', () => {\n\t\t\t\twindow.DDC.WidgetData['ws-tracking'].pushEvent({\n\t\t\t\t\tevent,\n\t\t\t\t\teventData\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t};\n})();\n"],"names":["FIREHOSE_PERCENTAGE","parseInt","document","getElementById","dataset","firehosePercentage","window","DDC","dataLayer","page","wueActionMap","added","applied","changed","clicked","collapsed","completed","displayed","expanded","impression","navigated","opened","received","removed","saved","selected","submitted","swiped","updated","viewed","replaceValues","inputString","map","str","toLowerCase","split","word","join","generateId","crypto","getRandomValues","generateIdCrypto","randomBuffer","Uint32Array","id","i","length","random","Math","floor","toString","toUpperCase","trunc","pageViewId","setNRAttr","k","v","_window","newrelic","setCustomAttribute","sendNRAction","o","_window2","obj","eventType","addPageAction","pushToFirehose","eventCategory","eventName","payload","percentageToSend","arguments","undefined","ceil","element","_element","eventData","apiUri","options","method","headers","body","JSON","stringify","Object","keys","fetch","then","response","json","data","_window3","_window3$log","log","call","catch","error","_window4","_window4$log","pushToPixall","payloadIn","_window5","event","source","parse","experimental","eventId","_pxam","push","category","eventSource","filter","Boolean","shouldTrack","host","location","hostname","includes","additionalProperties","reduce","acc","key","prototype","hasOwnProperty","charAt","slice","mappingSource","_window6","_window6$sendToEventV","sendToEventViewer","pushToGtmDataLayer","dataToExclude","_window7","pushedToGtmDataLayer","eventOut","_eventOut$event","forEach","attr","year","modelYear","_window8","Set","has","widgetName","Flags","_window$coxAutoDataLa","_window$coxAutoDataLa2","action","result","gtmEvent","elementCTA","title","specialType","specialPlacementType","step","remainingCdlData","destinationUrl","intention","replacementObj","urlPattern","match","updatedString","replace","replaceUrl","elementText","propsToFilter","prop","windowId","widgetId","filterCdlProperties","coxAutoDataLayer","fireTrackingEvent","dataToExcludeFromWidgetUserEvent","dataToIncludeInWidgetUserEvent","jQuery","trigger","receiveTrackingEvent","callback","on","optionalData","pushEvent","_ref","_window9","validateNonZeroLengthString","name","Error","Element","WidgetData","addEventListener"],"mappings":"AAAA,MACC,MAAMA,EAAsBC,SAC3BC,SAASC,eAAe,uBAAuBC,QAAQC,mBACvD,IAGDC,OAAOC,IAAMD,OAAOC,KAAO,CAAA,EAC3BD,OAAOC,IAAIC,UAAYF,OAAOC,IAAIC,WAAa,GAC/CF,OAAOC,IAAIC,UAAUC,KAAOH,OAAOC,IAAIC,UAAUC,MAAQ,GAEzD,MAAMC,EAAe,CACpB,eAAgB,cAChBC,MAAO,MACPC,QAAS,QACTC,QAAS,SACTC,QAAS,QACTC,UAAW,WACXC,UAAW,WACXC,UAAW,UACXC,SAAU,SACVC,WAAY,OACZC,UAAW,WACXC,OAAQ,OACRC,SAAU,UACVC,QAAS,SACTC,MAAO,OACPC,SAAU,SACVC,UAAW,SACXC,OAAQ,QACRC,QAAS,SACTC,OAAQ,QAGHC,EAAgBA,CAACC,EAAaC,KACnC,IAAIC,EAQJ,MAP2B,iBAAhBF,IACVE,EAAMF,EACJG,cACAC,MAAM,KACNH,KAAKI,GAASJ,EAAII,IAASA,IAC3BC,KAAK,MAEDJ,CAAG,EA4FLK,EAAaA,IACdhC,OAAOiC,QAAUjC,OAAOiC,OAAOC,gBAhBXC,MACxB,MAAMC,EAAe,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