{"version":3,"file":"components/epricemodal/epricemodalBundle.js","mappings":";;UAAA;UACA;;;;;WCDA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;;ACAA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,+HAA+H;AACpK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B,mBAAmB,WAAW,mBAAmB,SAAS;AAC/H;AACA;AACA;AACA;AACA;AACA,4BAA4B,mCAAmC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA,qFAAqF;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,KAAK;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,0CAA0C;AAClI;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,qEAAqE;AACrI;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qHAAqH,KAAK,SAAS,MAAM;AACzI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,8CAA8C;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wFAAwF;AACnI,2CAA2C,wFAAwF;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,6BAA6B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL","sources":["webpack://site-client-side/webpack/bootstrap","webpack://site-client-side/webpack/runtime/define property getters","webpack://site-client-side/webpack/runtime/hasOwnProperty shorthand","webpack://site-client-side/./src/components/epricemodal/epricemodal.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nclass EPriceModalSettings {\r\n constructor() {\r\n }\r\n}\r\nclass ModalButtonConfig {\r\n constructor() {\r\n this.comments = \"\";\r\n }\r\n}\r\nclass EPriceModalButtonConfig {\r\n constructor(data) {\r\n this.buttons = data;\r\n }\r\n}\r\nexport class EPriceModal {\r\n constructor() {\r\n this._mostRecentMode = \"\";\r\n this._mostRecentCPO = \"\";\r\n this._vehicleModelCode = \"\";\r\n this._legacyEPriceButtonConfig = null;\r\n this._setupComplete = false;\r\n this.onHideModalHandler = (e) => {\r\n e.currentTarget.setAttribute('aria-hidden', true);\r\n document.getElementById('thankyou-popup').style.display = 'none';\r\n document.getElementById('eprice-main-content').style.display = 'block';\r\n document.getElementById('ePriceModalSubmitButton').removeAttribute('disabled');\r\n window.ePriceModal.teardownOneTimeLeadEvents();\r\n };\r\n this.onShowModalHandler = (e) => {\r\n const button = e.relatedTarget;\r\n this.trySetModalLabelsByAttribute(button);\r\n this.setupOneTimeLeadEvents();\r\n };\r\n this.getLeadSource = () => {\r\n const page = {\r\n isMobile: ('ontouchstart' in document.documentElement && navigator.userAgent.match(/Mobi/)),\r\n isSrp: this._settings.pageIsSrp,\r\n isVdp: this._settings.pageIsVdp,\r\n isMrp: this._settings.pageIsMrp,\r\n isNew: this._settings.pageIsNew,\r\n };\r\n const vehicle = {\r\n type: document.getElementById('eprice_vehType').innerHTML.trim().toLowerCase(),\r\n isCpo: function () { return typeof this.MostRecentCPO != 'undefined' && this.MostRecentCPO != null && this.MostRecentCPO.toLowerCase() === 'true'; },\r\n };\r\n /* Special ePrice cases */\r\n if (this._mostRecentMode === 'ReserveThisVehicle') {\r\n return this.getReserveThisVehicleLeadSource(page, vehicle);\r\n }\r\n if (this._mostRecentMode === 'PriceDropAlert') {\r\n return this.getPriceDropAlertLeadSource(page, vehicle);\r\n }\r\n if (this._mostRecentMode === 'GetSalePrice') {\r\n return this.getGetSalePriceLeadSource(page, vehicle);\r\n }\r\n if (this._mostRecentMode === 'ConfirmAvailability') {\r\n return this.getConfirmAvailabilityLeadSource(page, vehicle);\r\n }\r\n if (this._mostRecentMode === 'PriceStakPayments') {\r\n return this.getPriceStakPaymentsLeadSource(page, vehicle);\r\n }\r\n /* Basic Vdp Or Srp Cases */\r\n if (page.isVdp) {\r\n return this.getVdpLeadSource(page, vehicle);\r\n }\r\n if (page.isMrp) {\r\n return this.getMrpLeadSource(page, vehicle);\r\n }\r\n else {\r\n return this.getSrpLeadSource(page, vehicle);\r\n }\r\n };\r\n this.getLeadType = () => {\r\n const type = document.getElementById('eprice_vehType').innerHTML.trim().toLowerCase();\r\n if (type === 'u') {\r\n return 2;\r\n }\r\n else if (type === 'n') {\r\n return 1;\r\n }\r\n else {\r\n return this._settings.pageLeadType;\r\n }\r\n };\r\n this.ePriceData = () => {\r\n var _a, _b, _c, _d, _e;\r\n let comment = (_a = document.getElementById(\"ePriceModalComments\")) === null || _a === void 0 ? void 0 : _a.value;\r\n const spinCarUserRef = window.spinCarUserReference;\r\n if (spinCarUserRef) {\r\n if ((typeof spinCarUserRef == \"string\") && spinCarUserRef.trim() != '') {\r\n comment += ' SpinCar report: ' + spinCarUserRef;\r\n }\r\n }\r\n let optOut = window.jQuery('#optOut', '#epriceForm')[0];\r\n if (optOut) {\r\n comment += ', Do Not Sell Personal Info: ' + optOut.checked;\r\n }\r\n //NOTE: See PriceModeEPriceConfiguration.cs\r\n this._settings.includeUrlForEPriceLeads;\r\n const vin = (_b = document.getElementById('eprice_vehVin')) === null || _b === void 0 ? void 0 : _b.innerHTML.trim();\r\n const vehicleId = (_c = document.getElementById('eprice_vehId')) === null || _c === void 0 ? void 0 : _c.innerHTML.trim();\r\n // if the location dropdown is there, we need to use its selection\r\n // otherwise we just use the value from the CTA data attribute\r\n let location = (_d = document.getElementById('eprice_vehLocation')) === null || _d === void 0 ? void 0 : _d.innerHTML.trim();\r\n let isChildDealer = false;\r\n if (this._toggles && (this._toggles[\"DO38300\"] === true)) {\r\n const altDealerElem = document.querySelector(\"#selDealerEPriceModal\");\r\n if (altDealerElem) {\r\n // GoVirtual and GMBrazil set it as a \"ChildDealer\" if SendLeadToChildSite customization is disabled\r\n // In theory, this prevents the lead from being sent to the dealer chosen in the dropdown\r\n // see GroupDealerList.cs\r\n isChildDealer = altDealerElem.getAttribute(\"name\") == \"ChildDealerId\";\r\n if (isChildDealer) {\r\n var dealerName = altDealerElem.options[altDealerElem.selectedIndex].text;\r\n var dealerId = altDealerElem.value;\r\n comment += `${comment.length > 0 ? ', ' : ''}ChildDealerName: ${dealerName}, ChildDealerId: ${dealerId}`;\r\n }\r\n location = altDealerElem.value;\r\n }\r\n }\r\n const toyotaEnhancedLeadForm = document.querySelectorAll('[data-toyota-enhanced-lead]');\r\n for (let i = 0; i < toyotaEnhancedLeadForm.length; i++) {\r\n const checkbox = toyotaEnhancedLeadForm[i];\r\n comment += checkbox.checked ? '\\n' + toyotaEnhancedLeadForm[i].getAttribute('data-toyota-enhanced-lead') : '';\r\n }\r\n let result = {\r\n Comments: comment,\r\n VehicleModelCode: this._vehicleModelCode,\r\n VehicleId: vehicleId,\r\n };\r\n if (((_e = this._settings.vehicleType) === null || _e === void 0 ? void 0 : _e.toLowerCase()) !== \"virtual\") {\r\n result[\"Vin\"] = vin;\r\n result[\"VehicleType\"] = this._settings.vehicleType;\r\n if (isChildDealer) {\r\n result[\"ChildDealerId\"] = location;\r\n }\r\n else {\r\n result[\"AltDealerId\"] = location;\r\n }\r\n }\r\n //NOTE: See PriceModeEPriceConfiguration.cs \r\n if (this._settings.bodyCodeBottom) {\r\n eval(this._settings.bodyCodeBottom);\r\n }\r\n return result;\r\n };\r\n this.getSettings();\r\n }\r\n getSettings() {\r\n var jsonElement = document.getElementById('epriceModalSettings');\r\n const jsonText = jsonElement === null || jsonElement === void 0 ? void 0 : jsonElement.text;\r\n this._settings = jsonText == null ? {} : JSON.parse(jsonText);\r\n this._toggles = this.getLocalStorageToggles();\r\n }\r\n init() {\r\n var modalConfig = document.getElementById(\"epriceModalConfig\");\r\n const modalConfigText = modalConfig === null || modalConfig === void 0 ? void 0 : modalConfig.text;\r\n this._buttonConfig = modalConfigText == null ? new EPriceModalButtonConfig({}) : new EPriceModalButtonConfig(JSON.parse(modalConfigText));\r\n this.setupEvents();\r\n this.getLeadJsContent();\r\n }\r\n setupEvents() {\r\n var targets = \".reserveVehicleBtn, .btnPriceDropAlert, .confirmAvailabilityBtn, [data-eprice-modal-button]\";\r\n if (this._settings.shouldDisplayEPrice || !this._settings.pageIsSrp) {\r\n targets += \", .ePriceBtn\";\r\n }\r\n var targetElems = document.querySelectorAll(targets);\r\n targetElems.forEach((elem) => {\r\n //NOTE: Only wire up the event once per button\r\n if (!elem.dataset.epriceModalProcessed) {\r\n elem.dataset.epriceModalProcessed = 'true';\r\n elem.addEventListener(\"click\", (e) => {\r\n this.setupPrimaryButtonPageModal(e);\r\n });\r\n elem.addEventListener(\"touchend\", (e) => {\r\n e.preventDefault();\r\n this.setupPrimaryButtonPageModal(e);\r\n });\r\n }\r\n });\r\n const closeButton = document.querySelector('.close');\r\n if (closeButton !== null && !closeButton.dataset.epriceModalProcessed) {\r\n closeButton.dataset.epriceModalProcessed = 'true';\r\n closeButton.addEventListener(\"click\", () => {\r\n //Declared in various Tracker.cs\r\n window.ResetTracker();\r\n });\r\n }\r\n //NOTE: this is calling bootstrap events so we have to use jQuery\r\n //NOTE: use .off before on to prevent adding this multiple times\r\n window.jQuery('#primaryButtonPageModal').off('hide.bs.modal', this.onHideModalHandler);\r\n window.jQuery('#primaryButtonPageModal').on('hide.bs.modal', this.onHideModalHandler);\r\n //NOTE: Legacy pricestack custom buttons is below, this is the logic for current\r\n // price stack. It uses data attributes set on the triggering \r\n //NOTE: use .off before on to prevent adding this multiple times\r\n window.jQuery('#primaryButtonPageModal').off('shown.bs.modal', this.onShowModalHandler);\r\n window.jQuery('#primaryButtonPageModal').on('shown.bs.modal', this.onShowModalHandler);\r\n // see DO-26059\r\n for (const primaryButton of Array.from(document.querySelectorAll(\"[id^=primaryButtonPageModalButton]\"))) {\r\n const button = primaryButton;\r\n //NOTE: Only wire up the event once per button\r\n if (!button.dataset.epriceModalProcessed) {\r\n button.dataset.epriceModalProcessed = 'true';\r\n button.addEventListener(\"click\", (e) => {\r\n const trigger = e.currentTarget;\r\n //NOTE: this is calling bootstrap events so we have to use jQuery\r\n window.jQuery(\"#primaryButtonPageModal\").on(\"hidden.bs.modal\", function () {\r\n trigger.focus();\r\n });\r\n });\r\n }\r\n }\r\n }\r\n //this method takes precendence over legacy pricing. If a legacy pricing button\r\n // ever has these attributes (which is shouldn't), then the legacy config labels \r\n // will get over written \r\n trySetModalLabelsByAttribute(button) {\r\n var _a, _b;\r\n const ePriceSubmitButton = document.getElementById(\"ePriceModalSubmitButton\");\r\n const ePriceModalTitle = document.getElementById(\"ePriceModalTitle\");\r\n const ePriceModalSubtitle = document.getElementById(\"ePriceModalSubtitle\");\r\n const ePriceModalDefaultDisclaimer = document.getElementById(\"defaultDisclaimer\");\r\n const ePriceModalEmail = document.getElementById(\"ePriceModalEmail\");\r\n if (button.dataset.formTitle) {\r\n ePriceModalTitle.innerHTML = button.dataset.formTitle;\r\n }\r\n if (button.dataset.formSubtitle) {\r\n ePriceModalSubtitle.innerHTML = button.dataset.formSubtitle;\r\n }\r\n if (button.dataset.formDisclaimer) {\r\n ePriceModalDefaultDisclaimer.innerHTML = button.dataset.formDisclaimer;\r\n }\r\n if (button.dataset.formButtonLabel) {\r\n ePriceSubmitButton.innerHTML = button.dataset.formButtonLabel;\r\n ePriceSubmitButton.value = button.dataset.formTitle;\r\n }\r\n if (button.dataset.formEmail) {\r\n ePriceModalEmail.value = button.dataset.formEmail;\r\n }\r\n const ePriceModal = document.getElementById(\"primaryButtonPageModal\");\r\n const ctaName = ePriceModal.querySelector('input[name=\"ctaName\"]');\r\n if (!ctaName) {\r\n return;\r\n }\r\n // Site speed: if button's only descendant is a plain text node, use innerHTML instead of innerText to avoid recalculating layout. innerText should cover any other cases where the button has actual elements as children.\r\n if (button.childNodes.length == 1 && button.childNodes[0].nodeType == Node.TEXT_NODE) {\r\n ctaName.value = (_a = button.innerHTML) === null || _a === void 0 ? void 0 : _a.trim();\r\n }\r\n else {\r\n ctaName.value = (_b = button.innerText) === null || _b === void 0 ? void 0 : _b.trim();\r\n }\r\n }\r\n setupPrimaryButtonPageModal(e) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;\r\n const modalElem = document.getElementById(\"primaryButtonPageModal\");\r\n const btnData = e.currentTarget;\r\n const mode = btnData.getAttribute('data-mode');\r\n this._mostRecentMode = mode;\r\n //NOTE: These are defaults, but any data attributes on the price stack button\r\n // that have values will override these in the 'shown.bs.modal' event\r\n const currentConfig = this._buttonConfig.buttons.find(x => x.name == mode);\r\n if (currentConfig) {\r\n const ePriceSubmitButton = document.getElementById(\"ePriceModalSubmitButton\");\r\n const ePriceModalTitle = document.getElementById(\"ePriceModalTitle\");\r\n const ePriceModalSubtitle = document.getElementById(\"ePriceModalSubtitle\");\r\n ePriceSubmitButton.innerHTML = currentConfig.label;\r\n ePriceSubmitButton.value = currentConfig.label;\r\n ePriceModalTitle.innerHTML = currentConfig.title;\r\n ePriceModalSubtitle.innerHTML = currentConfig.comments;\r\n }\r\n else {\r\n console.warn(`Unsupported EPriceModal mode ${mode}`);\r\n }\r\n const name = btnData.getAttribute('data-name');\r\n const vin = btnData.getAttribute('data-vin');\r\n const color = btnData.getAttribute('data-color');\r\n const stock = btnData.getAttribute('data-stock');\r\n const photo = btnData.getAttribute('data-photo');\r\n const vehicleId = btnData.getAttribute('data-vehicleid');\r\n const year = btnData.getAttribute('data-year');\r\n const make = btnData.getAttribute('data-make');\r\n const model = btnData.getAttribute('data-model');\r\n const trim = btnData.getAttribute('data-trim');\r\n const location = btnData.getAttribute('data-altdealerlocation');\r\n const type = btnData.getAttribute('data-type');\r\n const taggingParentElement = document.querySelector(`[data-dotagging-item-id=\"${vin !== null && vin !== void 0 ? vin : \"\"}\"]`);\r\n this._mostRecentCPO = btnData.getAttribute('data-cpo');\r\n this._vehicleModelCode = btnData.getAttribute('data-modelcd');\r\n //DEV-23638: Only send DigitalGarage leads for new vehicles\r\n if (this._settings.isDigitalGarageEnabled && this._settings.pageIsNew) {\r\n const dgDataHub = window.DGDataHub;\r\n const dgId = dgDataHub ? dgDataHub.getDgid() : \"\";\r\n window.DealeronLead.thirdPartyJsonAdapter.setData({ 'dg_dgid': dgId, 'dg_modelCd': btnData.getAttribute('data-modelcd') });\r\n }\r\n document.querySelectorAll('.ePriceComments').forEach((item) => {\r\n item.innerHTML = item.innerHTML.replace('#VEHICLE#', name);\r\n });\r\n document.getElementById('eprice_vehId').innerHTML = vehicleId;\r\n document.getElementById('eprice_vehType').innerHTML = type;\r\n // The rest of the eprice_veh elements aren't rendered on VdpVirtual \r\n if (((_a = this._settings.vehicleType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== \"virtual\") {\r\n document.getElementById('eprice_vehName').innerHTML = '' + name + '';\r\n const vinElemLabel = modalElem === null || modalElem === void 0 ? void 0 : modalElem.querySelector('.vehVin');\r\n const vinElem = document.getElementById('eprice_vehVin');\r\n if (vinElem) {\r\n if (vin !== \"\") {\r\n vinElem.innerHTML = vin;\r\n vinElem.classList.remove(\"hidden\");\r\n vinElemLabel === null || vinElemLabel === void 0 ? void 0 : vinElemLabel.classList.remove(\"hidden\");\r\n }\r\n else {\r\n vinElem.classList.add(\"hidden\");\r\n vinElemLabel === null || vinElemLabel === void 0 ? void 0 : vinElemLabel.classList.add(\"hidden\");\r\n }\r\n }\r\n const colorElemLabel = modalElem === null || modalElem === void 0 ? void 0 : modalElem.querySelector('.vehColor');\r\n const colorElem = document.getElementById('eprice_vehColor');\r\n if (colorElem) {\r\n if (color !== \"\") {\r\n colorElem.innerHTML = color;\r\n colorElem.classList.remove(\"hidden\");\r\n colorElemLabel === null || colorElemLabel === void 0 ? void 0 : colorElemLabel.classList.remove(\"hidden\");\r\n }\r\n else {\r\n colorElem.classList.add(\"hidden\");\r\n colorElemLabel === null || colorElemLabel === void 0 ? void 0 : colorElemLabel.classList.add(\"hidden\");\r\n }\r\n }\r\n const stockElemLabel = modalElem === null || modalElem === void 0 ? void 0 : modalElem.querySelector('.vehStock');\r\n const stockElem = document.getElementById('eprice_vehStock');\r\n if (stockElem) {\r\n if (stock !== \"\") {\r\n stockElem.innerHTML = stock;\r\n stockElem.classList.remove(\"hidden\");\r\n stockElemLabel === null || stockElemLabel === void 0 ? void 0 : stockElemLabel.classList.remove(\"hidden\");\r\n }\r\n else {\r\n stockElem.classList.add(\"hidden\");\r\n stockElemLabel === null || stockElemLabel === void 0 ? void 0 : stockElemLabel.classList.add(\"hidden\");\r\n }\r\n }\r\n document.getElementById('eprice_vehYear').innerHTML = year;\r\n document.getElementById('eprice_vehMake').innerHTML = make;\r\n document.getElementById('eprice_vehModel').innerHTML = model;\r\n document.getElementById('eprice_vehTrim').innerHTML = trim;\r\n document.getElementById('eprice_vehLocation').innerHTML = location;\r\n document.getElementById('eprice_vehIsCpo').innerHTML = this._mostRecentCPO;\r\n //DEV-24403: Add the img after the modal renders to avoid ADA violations\r\n document.getElementById('epriceImage').innerHTML = `
`;\r\n }\r\n // Added to be able to find the srpVehicle element with all vehicle data on it\r\n const form = document.getElementById('epriceForm');\r\n form.setAttribute('data-vin', vin);\r\n // DO-21595\r\n if ((_b = taggingParentElement === null || taggingParentElement === void 0 ? void 0 : taggingParentElement.hasAttributes()) !== null && _b !== void 0 ? _b : false) {\r\n form.setAttribute('data-dotagging-item-id', vin);\r\n form.setAttribute('data-dotagging-item-number', (_e = (_d = (_c = taggingParentElement.attributes) === null || _c === void 0 ? void 0 : _c.getNamedItem('data-dotagging-item-number')) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : '');\r\n form.setAttribute('data-dotagging-item-price', (_h = (_g = (_f = taggingParentElement.attributes) === null || _f === void 0 ? void 0 : _f.getNamedItem('data-dotagging-item-price')) === null || _g === void 0 ? void 0 : _g.value) !== null && _h !== void 0 ? _h : '');\r\n form.setAttribute('data-dotagging-item-condition', (_l = (_k = (_j = taggingParentElement.attributes) === null || _j === void 0 ? void 0 : _j.getNamedItem('data-dotagging-item-condition')) === null || _k === void 0 ? void 0 : _k.value) !== null && _l !== void 0 ? _l : '');\r\n form.setAttribute('data-dotagging-item-year', (_p = (_o = (_m = taggingParentElement.attributes) === null || _m === void 0 ? void 0 : _m.getNamedItem('data-dotagging-item-year')) === null || _o === void 0 ? void 0 : _o.value) !== null && _p !== void 0 ? _p : '');\r\n form.setAttribute('data-dotagging-item-make', (_s = (_r = (_q = taggingParentElement.attributes) === null || _q === void 0 ? void 0 : _q.getNamedItem('data-dotagging-item-make')) === null || _r === void 0 ? void 0 : _r.value) !== null && _s !== void 0 ? _s : '');\r\n form.setAttribute('data-dotagging-item-model', (_v = (_u = (_t = taggingParentElement.attributes) === null || _t === void 0 ? void 0 : _t.getNamedItem('data-dotagging-item-model')) === null || _u === void 0 ? void 0 : _u.value) !== null && _v !== void 0 ? _v : '');\r\n form.setAttribute('data-dotagging-item-variant', (_y = (_x = (_w = taggingParentElement.attributes) === null || _w === void 0 ? void 0 : _w.getNamedItem('data-dotagging-item-variant')) === null || _x === void 0 ? void 0 : _x.value) !== null && _y !== void 0 ? _y : '');\r\n form.setAttribute('data-dotagging-item-color', (_1 = (_0 = (_z = taggingParentElement.attributes) === null || _z === void 0 ? void 0 : _z.getNamedItem('data-dotagging-item-color')) === null || _0 === void 0 ? void 0 : _0.value) !== null && _1 !== void 0 ? _1 : '');\r\n form.setAttribute('data-dotagging-item-category', (_4 = (_3 = (_2 = taggingParentElement.attributes) === null || _2 === void 0 ? void 0 : _2.getNamedItem('data-dotagging-item-category')) === null || _3 === void 0 ? void 0 : _3.value) !== null && _4 !== void 0 ? _4 : '');\r\n form.setAttribute('data-dotagging-item-fuel-type', (_7 = (_6 = (_5 = taggingParentElement.attributes) === null || _5 === void 0 ? void 0 : _5.getNamedItem('data-dotagging-item-fuel-type')) === null || _6 === void 0 ? void 0 : _6.value) !== null && _7 !== void 0 ? _7 : '');\r\n form.setAttribute('data-dotagging-item-item-type', (_10 = (_9 = (_8 = taggingParentElement.attributes) === null || _8 === void 0 ? void 0 : _8.getNamedItem('data-dotagging-item-item-type')) === null || _9 === void 0 ? void 0 : _9.value) !== null && _10 !== void 0 ? _10 : '');\r\n form.setAttribute('data-dotagging-item-inventory-date', (_13 = (_12 = (_11 = taggingParentElement.attributes) === null || _11 === void 0 ? void 0 : _11.getNamedItem('data-dotagging-item-inventory-date')) === null || _12 === void 0 ? void 0 : _12.value) !== null && _13 !== void 0 ? _13 : '');\r\n form.setAttribute('data-dotagging-item-recommended', (_16 = (_15 = (_14 = taggingParentElement.attributes) === null || _14 === void 0 ? void 0 : _14.getNamedItem('data-dotagging-item-recommended')) === null || _15 === void 0 ? void 0 : _15.value) !== null && _16 !== void 0 ? _16 : '');\r\n }\r\n //NOTE: Legacy Pricing (See DealerPricingEPriceConfiguration.cs.) This is terrible. Good luck.\r\n this.tryReadLegacyEPriceButtonConfig(btnData);\r\n //Modal opening is done here instead of wih data-toggle and data-target attributes to account for slow connections (see DEV-12380)\r\n window.jQuery('#primaryButtonPageModal').modal(\"show\", btnData);\r\n //clear form\r\n if (modalElem) {\r\n modalElem.removeAttribute('aria-hidden');\r\n // When reseting the form, do not set checkbox values to an empty string (allowing them to send a boolean if checked)\r\n modalElem.querySelectorAll(\"input:not([type='hidden']):not([type='checkbox'])\").forEach((elem) => elem.value = \"\");\r\n modalElem.querySelectorAll(\"textarea\").forEach((elem) => elem.value = \"\");\r\n modalElem.querySelectorAll(\".has-error\").forEach((elem) => {\r\n if (elem.nodeName.toLocaleLowerCase() === \"label\") {\r\n elem.parentElement.removeChild(elem);\r\n }\r\n else {\r\n elem.classList.remove('has-error');\r\n }\r\n });\r\n modalElem.querySelectorAll('.has-success').forEach((elem) => elem.classList.remove('has-success'));\r\n }\r\n window.ResetTracker();\r\n }\r\n tryReadLegacyEPriceButtonConfig(btnData) {\r\n var _a, _b, _c, _d, _e;\r\n const epriceconfiglocation = btnData.getAttribute('data-epriceconfiglocation');\r\n const buttonIdentifier = btnData.getAttribute('data-buttonIdentifier');\r\n const ePriceSubmitButton = document.getElementById(\"ePriceModalSubmitButton\");\r\n const ePriceModalTitle = document.getElementById(\"ePriceModalTitle\");\r\n const ePriceModalSubtitle = document.getElementById(\"ePriceModalSubtitle\");\r\n const ePriceModalDefaultDisclaimer = document.getElementById(\"defaultDisclaimer\");\r\n if (!this._legacyEPriceButtonConfig) {\r\n const jsonEpriceConfiguration = this._settings.ePriceConfigJsContent;\r\n let epriceConfiguration = {};\r\n if (jsonEpriceConfiguration) {\r\n try {\r\n //NOTE: This is ridiculously brittle and there isn't really much we can do about it. \r\n //ePrice configuration comes from the price stack. This is a unicode encoded string of json and the \r\n // epriceconfiguration button is a property that holds json so we have two layers of unicode\r\n // encoded json. And, there's a rogue /r/n at the end of the config line as well. \r\n //cleanup escape characters\r\n const cleanConfigString = `\"${jsonEpriceConfiguration.replace(/\\\"/g, '\\\\\"')}\"`;\r\n //now decode the unicode\r\n const decodedConfig = decodeURIComponent(JSON.parse(cleanConfigString));\r\n //now make it a json object\r\n const epriceConfiguration = JSON.parse(decodedConfig);\r\n this._legacyEPriceButtonConfig = epriceConfiguration;\r\n }\r\n catch (err) {\r\n if (ePriceModalDefaultDisclaimer) {\r\n ePriceModalDefaultDisclaimer.innerHTML = \"\";\r\n }\r\n console.error(\"Error reading legacy eprice button config\", [err, epriceConfiguration[buttonIdentifier]]);\r\n }\r\n }\r\n }\r\n if (this._legacyEPriceButtonConfig && this._legacyEPriceButtonConfig[buttonIdentifier]) {\r\n ePriceModalTitle.innerHTML = (_a = this._legacyEPriceButtonConfig[buttonIdentifier].TitleDictionary[epriceconfiglocation]) !== null && _a !== void 0 ? _a : ePriceModalTitle.innerHTML;\r\n ePriceModalSubtitle.innerHTML = (_b = this._legacyEPriceButtonConfig[buttonIdentifier].HeaderDictionary[epriceconfiglocation]) !== null && _b !== void 0 ? _b : ePriceModalSubtitle.innerHTML;\r\n ePriceSubmitButton.innerHTML = (_c = this._legacyEPriceButtonConfig[buttonIdentifier].ButtonLabelDictionary[epriceconfiglocation]) !== null && _c !== void 0 ? _c : ePriceSubmitButton.innerHTML;\r\n ePriceSubmitButton.value = (_d = this._legacyEPriceButtonConfig[buttonIdentifier].ButtonLabelDictionary[epriceconfiglocation]) !== null && _d !== void 0 ? _d : ePriceSubmitButton.value;\r\n ePriceModalDefaultDisclaimer.innerHTML = (_e = this._legacyEPriceButtonConfig[buttonIdentifier].DisclaimerDictionary[epriceconfiglocation]) !== null && _e !== void 0 ? _e : ePriceModalDefaultDisclaimer.innerHTML;\r\n }\r\n }\r\n ePriceSuccessCallback(data) {\r\n let days = 2;\r\n let cookieLife = days * 24 * 60 * 60;\r\n //Dealeron Cookie\r\n if (window.DealeronCookie) {\r\n window.DealeronCookie.setItem(window.DlronGlobal_PriceUnlocked, '?v=7HWvMx0ytdM', cookieLife);\r\n // Let the SRP SPA know that the lead submission was successful\r\n document.dispatchEvent(new CustomEvent('trigger-adjust-pricing-visibility'));\r\n var eventValue;\r\n var response = JSON.parse(data);\r\n window.DealeronLead.thirdPartyJsonAdapter.reset();\r\n if (typeof (window.DealeronCookie) == 'object') {\r\n var dataString = \"\";\r\n if (response.hasOwnProperty('internalId')) {\r\n dataString += \"InternalId=\" + response[\"internalId\"] + \"|\";\r\n }\r\n var daysToKeep = 30 * 60; // 30 minutes converted to seconds\r\n window.DealeronCookie.setItem(window.DlronGlobal_DealeronLeadResponseCookieName, dataString, daysToKeep);\r\n }\r\n window.DealerOnTrack.event('Lead', response.leadId, response.leadSource, eventValue, function (leadId) {\r\n const thankyouIframe = document.getElementById('thankyou-iframe');\r\n thankyouIframe.addEventListener(\"load\", function () {\r\n const innerIframe = thankyouIframe.contentDocument || thankyouIframe.contentWindow.document;\r\n // remove header and footer\r\n var header = innerIframe.getElementsByClassName('headerWrapper')[0];\r\n var footer = innerIframe.getElementsByTagName('footer')[0];\r\n if (header) {\r\n header.remove();\r\n }\r\n if (footer) {\r\n footer.remove();\r\n }\r\n // set links to open in parent page\r\n var links = innerIframe.getElementsByTagName('a');\r\n for (var i = 0; i < links.length; i++) {\r\n links[i].setAttribute('target', '_parent');\r\n }\r\n // update display\r\n document.getElementById('thankyou-popup').style.display = 'block';\r\n document.getElementById('eprice-main-content').style.display = 'none';\r\n });\r\n thankyouIframe.src = \"/thankyou.aspx?modal=true&lid=\" + leadId;\r\n });\r\n }\r\n }\r\n getReserveThisVehicleLeadSource(page, vehicle) {\r\n if (vehicle.type === 'n') {\r\n return (page.isMobile) ? this._settings.leadSource.MobileReserveVehicleNew.Id : this._settings.leadSource.ReserveVehicleNew.Id;\r\n }\r\n else if (vehicle.type === 'u') {\r\n return (page.isMobile) ? this._settings.leadSource.MobileReserveVehicleUsed.Id : this._settings.leadSource.ReserveVehicleUsed.Id;\r\n }\r\n else {\r\n /* Reservice this vehicle catchLeadSource */\r\n if (page.isNew) {\r\n return (page.isMobile) ? this._settings.leadSource.MobileReserveVehicleNew.Id : this._settings.leadSource.ReserveVehicleNew.Id;\r\n }\r\n else {\r\n return (page.isMobile) ? this._settings.leadSource.MobileReserveVehicleUsed.Id : this._settings.leadSource.ReserveVehicleUsed.Id;\r\n }\r\n }\r\n }\r\n getPriceDropAlertLeadSource(page, vehicle) {\r\n if (vehicle.type === 'n') {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceDropAlertNew.Id : this._settings.leadSource.PriceDropAlertNew.Id;\r\n }\r\n else if (vehicle.type === 'u') {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceDropAlertUsed.Id : this._settings.leadSource.PriceDropAlertUsed.Id;\r\n }\r\n else {\r\n /* Price Drop Alert catchLeadSource */\r\n if (page.isNew) {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceDropAlertNew.Id : this._settings.leadSource.PriceDropAlertNew.Id;\r\n }\r\n else {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceDropAlertUsed.Id : this._settings.leadSource.PriceDropAlertUsed.Id;\r\n }\r\n }\r\n }\r\n getGetSalePriceLeadSource(page, vehicle) {\r\n if (vehicle.type === 'n') {\r\n return (page.isMobile) ? this._settings.leadSource.MobileGetSalePriceVdpNew.Id : this._settings.leadSource.GetSalePriceVdpNew.Id;\r\n }\r\n else if (vehicle.type === 'u') {\r\n return (page.isMobile) ? this._settings.leadSource.MobileGetSalePriceVdpUsed.Id : this._settings.leadSource.GetSalePriceVdpUsed.Id;\r\n }\r\n else {\r\n /* Get Sale Price catchLeadSource */\r\n if (page.isNew) {\r\n return (page.isMobile) ? this._settings.leadSource.MobileGetSalePriceVdpNew.Id : this._settings.leadSource.GetSalePriceVdpNew.Id;\r\n }\r\n else {\r\n return (page.isMobile) ? this._settings.leadSource.MobileGetSalePriceVdpUsed.Id : this._settings.leadSource.GetSalePriceVdpUsed.Id;\r\n }\r\n }\r\n }\r\n getConfirmAvailabilityLeadSource(page, vehicle) {\r\n if (vehicle.type === 'n') {\r\n return (page.isMobile) ? this._settings.leadSource.MobileConfirmAvailabilityVdpNew.Id : this._settings.leadSource.ConfirmAvailabilityVdpNew.Id;\r\n }\r\n else if (vehicle.type === 'u') {\r\n return (page.isMobile) ? this._settings.leadSource.MobileConfirmAvailabilityVdpUsed.Id : this._settings.leadSource.ConfirmAvailabilityVdpUsed.Id;\r\n }\r\n else {\r\n /* Confirm Availability catchLeadSource */\r\n if (page.isNew) {\r\n return (page.isMobile) ? this._settings.leadSource.MobileConfirmAvailabilityVdpNew.Id : this._settings.leadSource.ConfirmAvailabilityVdpNew.Id;\r\n }\r\n else {\r\n return (page.isMobile) ? this._settings.leadSource.MobileConfirmAvailabilityVdpUsed.Id : this._settings.leadSource.ConfirmAvailabilityVdpUsed.Id;\r\n }\r\n }\r\n }\r\n getPriceStakPaymentsLeadSource(page, vehicle) {\r\n if (vehicle.type === 'n') {\r\n if (page.isVdp) {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceStakDetailsNew.Id : this._settings.leadSource.PriceStakDetailsNew.Id;\r\n }\r\n else {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceStakInventoryNew.Id : this._settings.leadSource.PriceStakInventoryNew.Id;\r\n }\r\n }\r\n else if (vehicle.type === 'u') {\r\n if (page.isVdp) {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceStakDetailsUsed.Id : this._settings.leadSource.PriceStakDetailsUsed.Id;\r\n }\r\n else {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceStakInventoryUsed.Id : this._settings.leadSource.PriceStakInventoryUsed.Id;\r\n }\r\n }\r\n else {\r\n /*PriceStak Payment catchLeadSource */\r\n if (page.isNew) {\r\n if (page.isVdp) {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceStakDetailsNew.Id : this._settings.leadSource.PriceStakDetailsNew.Id;\r\n }\r\n else {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceStakInventoryNew.Id : this._settings.leadSource.PriceStakInventoryNew.Id;\r\n }\r\n }\r\n else {\r\n if (page.isVdp) {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceStakDetailsUsed.Id : this._settings.leadSource.PriceStakDetailsUsed.Id;\r\n }\r\n else {\r\n return (page.isMobile) ? this._settings.leadSource.MobilePriceStakInventoryUsed.Id : this._settings.leadSource.PriceStakInventoryUsed.Id;\r\n }\r\n }\r\n }\r\n }\r\n getVdpLeadSource(page, vehicle) {\r\n if (vehicle.type === 'u') {\r\n if (page.isMobile) {\r\n return this._settings.leadSource.MobileEPriceDetailsUsed.Id;\r\n }\r\n else if (vehicle.isCpo()) {\r\n return this._settings.leadSource.VehicleCertified.Id;\r\n }\r\n else {\r\n return this._settings.leadSource.EPriceDetailsUsed.Id;\r\n }\r\n }\r\n else if (vehicle.type === 'n') {\r\n return (page.isMobile) ? this._settings.leadSource.MobileEPriceDetailsNew.Id : this._settings.leadSource.EPriceDetailsNew.Id;\r\n }\r\n else {\r\n return this.catchLeadSource(page, vehicle);\r\n }\r\n }\r\n getSrpLeadSource(page, vehicle) {\r\n if (vehicle.type === 'n') {\r\n return (page.isMobile) ? this._settings.leadSource.MobileEPriceInventoryNew.Id : this._settings.leadSource.EPriceInventoryNew.Id;\r\n }\r\n else if (vehicle.type === 'u') {\r\n if (page.isMobile) {\r\n return this._settings.leadSource.MobileEPriceInventoryUsed.Id;\r\n }\r\n else if (vehicle.isCpo()) {\r\n return this._settings.leadSource.VehicleCertified.Id;\r\n }\r\n else {\r\n return this._settings.leadSource.EPriceInventoryUsed.Id;\r\n }\r\n }\r\n else {\r\n return this.catchLeadSource(page, vehicle);\r\n }\r\n }\r\n getMrpLeadSource(page, vehicle) {\r\n if (vehicle.type === 'n') {\r\n return (page.isMobile) ? this._settings.leadSource.MobileEPriceModelResearchNew.Id : this._settings.leadSource.EPriceModelResearchNew.Id;\r\n }\r\n else {\r\n return this.catchLeadSource(page, vehicle);\r\n }\r\n }\r\n catchLeadSource(page, vehicle) {\r\n if (page.isVdp) {\r\n if (page.isNew) {\r\n return (page.isMobile) ? this._settings.leadSource.MobileEPriceDetailsNew.Id : this._settings.leadSource.EPriceDetailsNew.Id;\r\n }\r\n else {\r\n if (page.isMobile) {\r\n return this._settings.leadSource.MobileEPriceDetailsUsed.Id;\r\n }\r\n else if (vehicle.isCpo()) {\r\n return this._settings.leadSource.VehicleCertified.Id;\r\n }\r\n else {\r\n return this._settings.leadSource.EPriceDetailsUsed.Id;\r\n }\r\n }\r\n }\r\n else if (page.isMrp) {\r\n return (page.isMobile) ? this._settings.leadSource.MobileEPriceModelResearchNew.Id : this._settings.leadSource.EPriceModelResearchNew.Id;\r\n }\r\n else {\r\n if (page.isNew) {\r\n return (page.isMobile) ? this._settings.leadSource.MobileEPriceInventoryNew.Id : this._settings.leadSource.EPriceInventoryNew.Id;\r\n }\r\n else {\r\n if (page.isMobile) {\r\n return this._settings.leadSource.MobileEPriceInventoryUsed.Id;\r\n }\r\n else if (vehicle.isCpo()) {\r\n return this._settings.leadSource.VehicleCertified.Id;\r\n }\r\n else {\r\n return this._settings.leadSource.EPriceInventoryUsed.Id;\r\n }\r\n }\r\n }\r\n }\r\n setupOneTimeLeadEvents() {\r\n const ePriceModal = document.querySelector('#primaryButtonPageModal');\r\n const formInputs = ePriceModal === null || ePriceModal === void 0 ? void 0 : ePriceModal.querySelectorAll(\"input, textarea, select\");\r\n formInputs.forEach((input) => {\r\n input.addEventListener(\"focusout\", this.trackerHookListener, false);\r\n });\r\n }\r\n teardownOneTimeLeadEvents() {\r\n //remove the trackerHookListener because we only want to instantiate this one time\r\n const ePriceModal = document.querySelector('#primaryButtonPageModal');\r\n const formInputs = ePriceModal === null || ePriceModal === void 0 ? void 0 : ePriceModal.querySelectorAll(\"input, textarea, select\");\r\n formInputs.forEach((input) => {\r\n input.removeEventListener(\"focusout\", this.trackerHookListener, false);\r\n });\r\n }\r\n getLeadJsContent() {\r\n var _a, _b;\r\n window.DealeronLead.addSubmissionMethod('sendePriceSubmit', {\r\n leadSource: this.getLeadSource,\r\n leadType: this.getLeadType,\r\n additionalData: this.ePriceData,\r\n successCallback: this.ePriceSuccessCallback\r\n });\r\n window.DealeronLead.initialize('#epriceForm', 'sendePriceSubmit');\r\n if (this._settings.trackerType === \"Scion\") {\r\n const year = document.getElementById('eprice_vehYear').innerHTML;\r\n const model = document.getElementById('eprice_vehModel').innerHTML;\r\n const tmsomniTracker = window.tmsomni;\r\n if (tmsomniTracker) {\r\n tmsomniTracker.prop2 = year;\r\n tmsomniTracker.eVar2 = year;\r\n tmsomniTracker.prop9 = model;\r\n tmsomniTracker.eVar9 = model;\r\n tmsomniTracker.prop10 = `${(_a = this._settings.vehicleType) === null || _a === void 0 ? void 0 : _a.toLowerCase()}`;\r\n tmsomniTracker.eVar16 = `${(_b = this._settings.vehicleType) === null || _b === void 0 ? void 0 : _b.toLowerCase()}`;\r\n }\r\n }\r\n window.ResetTracker();\r\n this.ePriceData();\r\n }\r\n trackerHookListener() {\r\n window.DealeronLead.begin();\r\n window.ResetTracker();\r\n window.trackerHook({ trackId: this.getLeadSource });\r\n window.ePriceModal.teardownOneTimeLeadEvents();\r\n }\r\n getLocalStorageToggles() {\r\n const storageLocation = \"sessionToggles_\" + window.DlronGlobal_DealerId;\r\n try {\r\n const toggleString = sessionStorage.getItem(storageLocation);\r\n return JSON.parse(toggleString);\r\n }\r\n catch (error) {\r\n console.error(\"Error parsing sessionStorage:\", error);\r\n return {};\r\n }\r\n }\r\n}\r\ninstantiateEPriceModal();\r\nfunction instantiateEPriceModal() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n window.ePriceModal = new EPriceModal();\r\n if (document.readyState === 'loading') {\r\n window.addEventListener('DOMContentLoaded', () => window.ePriceModal.init());\r\n }\r\n else {\r\n window.ePriceModal.init();\r\n }\r\n });\r\n}\r\n"],"names":[],"sourceRoot":""}
Asian-sports-betting-platform-contactus@cesametal.net
365体育投注
Crown-betting-info@jyycl.com
新欧洲
府谷在线网
再读读小说
European-Cup-buying-feedback@at-funeral.com
徐州公交网
Sports-in-Sabah-customerservice@swissabc.net
ii23休闲社区
bet365-Sports-sales@media2v-api.net
皇冠体育
皇冠体育
皇冠体育博彩
Vista之家
书阁网
美团网丹东站
马鞍山二中
365体育投注
体育博彩
马鞍山二中
房车之家
江苏自考网
海购丰运
深圳鹏程医院官网
游戏名字
龙膜官网
嘉禾院线
北京大学总裁班
红网交通频道
盛传奇归来 官方网站
站点地图
运城人才网
风帜拓展训练