{"version":3,"sources":["inventory-search-results/hcpv_car.js"],"names":["hcpv_car","vin","stock","dealerId","dealerName","dealerDistance","modelId","specialLease","offerDescription","year","groupName","trim","trimName","transmission","transmissionName","msrp","mileage","dsrp","certDate","exColor","cpoTier","exColorName","inColor","photo","stockPhoto","styles","attributes","specials","specialAPR","specialTerm","inColorCD","exColorCD","engineName","vhrurl","iceurl","VehicleType","hasBuyOnline","buyOnlineURL","specialDescription","specialMonthlyPayment","specialEndDate","specialId","_classCallCheck","this","Object","defineProperty","enumerable","writable","value","split","fullAttributeObj","fullAttributesArray","lmpg","hmpg","cmpg","dealer","photos","Photos","i","honda","undefined","Photo","length","Array","push","Special","imgNASmall","offers","imgNABig","distance","drive","features","style","seating","engine","vhrsource","seats_Array","sa","idVal","$","inArray","fullAttributes","attr","modelAttributeList","getAttributeById2","indexOf","index","featureStrMap","attrData","modelAttributes","map","featureStr","modelAttr","toLowerCase","context","attrID","aData","mpg_city","mpg_highway","mpg_combined"],"mappings":"6XAkEMA,oBAqDF,QAAAA,GAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAvBAC,EAwBAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAqDA,GApDAC,gBAAAC,KAAA3C,GAAA4C,OAAAC,eAAAF,KAAA,cAAAG,YAAA,EAAAC,UAAA,EAAAC,MA3EW,8IAA8IC,MACzJ,OA0EAL,OAAAC,eAAAF,KAAA,iBAAAG,YAAA,EAAAC,UAAA,EAAAC,MAxEc,kHAAkHC,MAChI,OAuEAL,OAAAC,eAAAF,KAAA,YAAAG,YAAA,EAAAC,UAAA,EAAAC,MAvBA,+CAuBAJ,OAAAC,eAAAF,KAAA,cAAAG,YAAA,E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3B,KAAAO,iBAAA,MAAA,eACAU,IAAAjB,KAAAO,iBAAA,iBACAP,KAAA+B,OAAA/B,KAAAO,iBAAA,eAAA,WAEAP,KAAI2C,6DAOFH,GACD,OAAAvB,IAAAjB,KAAAjB,YAOesC,MAAdrB,KAAAjB,WAMH,IAAA,GAAAgC,GAAA,EAAAA,EAAAf,KAAAjB,WAAAoC,OAAAJ,IAAA,CACD,GAAAwB,GAAAC,EAAAC,kBAAAzC,KAAAjB,WAAAgC,IACA4B,EAAA3C,KAAA4C,cAAAF,QAAAH,EAAA,WAQQM,GAAJF,IADF,qBAICJ,EAJD,WAKA,GAAAA,EAAA,UAAOxD,cAAP2D,QAAA,YAGFI,KAAAA,SAAgBC,KAAI/C,KAAAgD,WAASC,IAIxB,SAAAV,EAAA,WACiD,GAAlDA,EAAA,UAAUW,cAAaR,QAAA,aAGvB1C,KAAA4B,SAAUP,KAANrB,KAAAgD,WAAJL,IAEC,QAAAJ,EAAA,UAAAW,eAVLlD,KAAA4B,SAAAP,KAAArB,KAAAgD,WAAAL,oDAZoBH,GACpB,GAAIW,GAAUnD,IACQA,MAAKjB,WAAWgE,IAAI,SAASK,GACjD,GAAIrE,KAMJ,OALAyD,GAAmBO,IAAI,SAASF,GAC1BA,EAAS,SAAWO,GACtBrE,EAAWsC,KAAKwB,KAGb9D,IAGOgE,IAAI,SAASE,GAC3BA,EAAUF,IAAI,SAASM,GACE,yBAAnBA,EAAM,WACRF,EAAQG,SAAWD,EAAM,WAEJ,4BAAnBA,EAAM,WACRF,EAAQI,YAAcF,EAAM,WAEP,aAAnBA,EAAM,WACRF,EAAQK,aAAeH,EAAM","file":"hcpv_car.min.js","sourcesContent":["/*\r\n\r\nSample Vehicle\r\n\r\n\r\n{\r\n \"@DealerCrossReferenceID\": \"1\",\r\n \"@DealerId\": \"206568\",\r\n \"@ModelId\": \"CT1B7DJW\",\r\n \"@resultIndex\": \"1\",\r\n \"@id\": \"1\",\r\n \"ModelYear\": \"2013\",\r\n \"ModelGroupName\": \"Accord Coupe\",\r\n \"ModelTrim\": \"EX\",\r\n \"ModelMarketingName\": \"EX\",\r\n \"ModelTransmission\": \"CVT\",\r\n \"ModelTransmissionMarketingName\": \"CVT\",\r\n \"ModelBaseColor\": null,\r\n \"ModelExteriorColorCD\": null,\r\n \"ModelInteriorColorCD\": null,\r\n \"ModelMSRP\": \"25875.00\",\r\n \"DHCost\": null,\r\n \"ModelVINsOnSite\": {\r\n \"@Count\": \"1\",\r\n \"VIN\": [\r\n {\r\n \"VIN\": \"1HGCT1B74DA022878\",\r\n \"Mileage\": \"21673\",\r\n \"DSRP\": \"16592.00\",\r\n \"CertDate\": \"2016-11-16\",\r\n \"ModelExteriorColorName\": \"ALABASTER SILVER METALLIC\",\r\n \"ModelInteriorColorName\": \"BLACK\",\r\n \"Photos\": null\r\n }\r\n ]\r\n },\r\n \"ModelVINsInTransit\": {\r\n \"@Count\": \"0\"\r\n },\r\n \"ModelStockPhotos\": {\r\n \"Photos\": null\r\n },\r\n \"BodyStyles\": {\r\n \"BodyStyle\": [\r\n \"1\",\r\n \"5\",\r\n \"7\"\r\n ]\r\n },\r\n \"ModelAttributes\": {\r\n \"ModelAttribute\": [\r\n \"6\",\r\n \"13\",\r\n \"17\",\r\n \"25\"\r\n ]\r\n },\r\n \"Specials\": null\r\n },\r\n\r\n\r\n*/\r\n\r\n/*\r\n * This class is used on Inventory and Vehicle details\r\n */\r\nclass hcpv_car {\r\n featureStr = \"Leather Interiors|AWD / 4WD|Moonroof|Bluetooth|Android Auto|Apple CarPlay|Rearview Camera|Heated Seats|Rear Entertainment System|Navigation\".split(\r\n \"|\"\r\n );\r\n featureStrMap = \"INTERIOR MATERIAL|DRIVE|Moonroof|BTUTH|AAUTO|CPLAY|Rearview Camera|Heated Seats|Rear Entertainment System|NAVIG\".split(\r\n \"|\"\r\n );\r\n\r\n imgNABig = \"/images/vehicle-details/NIA-900x450-01.jpg\";\r\n imgNASmall = \"/images/vehicle-details/NIA-690x520-01.jpg\";\r\n\r\n constructor(\r\n vin,\r\n stock,\r\n dealerId,\r\n dealerName,\r\n dealerDistance,\r\n modelId,\r\n specialLease,\r\n offerDescription,\r\n year,\r\n groupName,\r\n trim,\r\n trimName,\r\n transmission,\r\n transmissionName,\r\n msrp,\r\n mileage,\r\n dsrp,\r\n certDate,\r\n exColor,\r\n cpoTier,\r\n exColorName,\r\n inColor,\r\n photo,\r\n stockPhoto,\r\n styles,\r\n attributes,\r\n specials,\r\n specialAPR,\r\n specialTerm,\r\n inColorCD,\r\n exColorCD,\r\n engineName,\r\n vhrurl,\r\n iceurl,\r\n VehicleType,\r\n hasBuyOnline,\r\n buyOnlineURL,\r\n specialDescription,\r\n specialMonthlyPayment,\r\n specialEndDate,\r\n specialId\r\n ) {\r\n this.vin = vin;\r\n this.hasBuyOnline = hasBuyOnline;\r\n this.buyOnlineURL = buyOnlineURL;\r\n this.stock = stock;\r\n this.dealerId = dealerId;\r\n this.dealerName = dealerName;\r\n this.dealerDistance = dealerDistance;\r\n this.modelId = modelId;\r\n this.specialLease = specialLease;\r\n this.offerDescription = offerDescription;\r\n this.year = year;\r\n this.groupName = groupName;\r\n this.trim = trim;\r\n this.trimName = trimName;\r\n this.transmission = transmission;\r\n this.transmissionName = transmissionName;\r\n this.msrp = msrp;\r\n this.mileage = mileage;\r\n this.dsrp = dsrp;\r\n this.certDate = certDate;\r\n this.exColor = exColor;\r\n this.cpoTier = cpoTier;\r\n this.VehicleType = VehicleType;\r\n this.exColorName = exColorName;\r\n this.inColor = inColor;\r\n\r\n this.stockPhoto = stockPhoto;\r\n this.styles = styles;\r\n this.attributes = attributes;\r\n\r\n this.fullAttributeObj = {};\r\n this.fullAttributesArray = new Array();\r\n this.lmpg = 0;\r\n this.hmpg = 0;\r\n this.cmpg = 0;\r\n this.dealer = null;\r\n\r\n this.photos = null;\r\n this.photo = photo;\r\n if (photo !== null) {\r\n if (photo.Photos.Photo !== undefined) {\r\n this.photos = photo.Photos.Photo;\r\n if (photo.Photos.Photo[0] != undefined)\r\n this.photo = photo.Photos.Photo[0][\"#text\"];\r\n }\r\n }\r\n if (this.photo == null && stockPhoto !== undefined && stockPhoto !== null) {\r\n if (stockPhoto.Photos !== undefined) {\r\n if (stockPhoto.Photos !== null) {\r\n if (stockPhoto.Photos.length > 0) {\r\n if (stockPhoto.Photos[0].Photo !== undefined) {\r\n if (stockPhoto.Photos[0].Photo !== null) {\r\n this.photo =\r\n \"https://automobiles.honda.com\" +\r\n stockPhoto.Photos[0].Photo[0][\"#text\"];\r\n if (this.photos == null) {\r\n this.photos = new Array();\r\n for (var i = 0; i < stockPhoto.Photos[0].Photo.length; i++) {\r\n this.photos.push({\r\n \"#text\":\r\n \"https://automobiles.honda.com\" +\r\n stockPhoto.Photos[0].Photo[i][\"#text\"],\r\n honda: \"true\"\r\n });\r\n // this.photos.push({\"#text\":\"https://automobiles.honda.com\"+stockPhoto.Photos[1].Photo[i][\"#text\"], \"honda\":\"true\"});\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Image Not Available\r\n if (this.photo == null) {\r\n this.photo = this.imgNASmall;\r\n if (this.photos == null) {\r\n this.photos = new Array();\r\n this.photos.push({ \"#text\": this.imgNABig, honda: \"true\" });\r\n this.photos.push({ \"#text\": this.imgNABig, honda: \"true\" });\r\n }\r\n }\r\n\r\n this.offers = \"off\";\r\n this.specials = null;\r\n if (specials.Special !== undefined) {\r\n this.specials = specials.Special;\r\n \r\n // temporarily suppressing offers for Used and Honda True Used vehicles\r\n // remove the && condition to undo\r\n if (this.specials.length > 0 && this.VehicleType != 'U' && this.cpoTier != 'BT') {\r\n this.offers = \"on\";\r\n this.specialAPR = specialAPR;\r\n this.specialTerm = specialTerm;\r\n this.specialDescription = specialDescription;\r\n this.specialMonthlyPayment = specialMonthlyPayment;\r\n this.specialEndDate = specialEndDate;\r\n this.specialId = specialId;\r\n }\r\n }\r\n if (specials != undefined && specials.Special !== undefined) {\r\n // temporarily suppressing offers for Used and Honda True Used vehicles \r\n // remove the && condition to undo \r\n if (specials[\"@Count\"] != \"0\" && this.VehicleType != 'U' && this.cpoTier != 'BT') {\r\n this.offers = \"on\";\r\n this.specialAPR = specialAPR;\r\n this.specialTerm = specialTerm;\r\n this.specialDescription = specialDescription;\r\n this.specialMonthlyPayment = specialMonthlyPayment;\r\n this.specialEndDate = specialEndDate;\r\n this.specialId = specialId;\r\n }\r\n }\r\n\r\n this.distance = 0;\r\n this.style = null;\r\n this.seating = null;\r\n this.engine = null;\r\n this.drive = null;\r\n\r\n this.inColorCD = inColorCD;\r\n this.exColorCD = exColorCD;\r\n\r\n this.features = new Array();\r\n this.engineName = engineName;\r\n\r\n this.vhrsource = null;\r\n this.vhrurl = null;\r\n if (vhrurl != null) {\r\n if (vhrurl[\"@Source\"] != undefined) {\r\n this.vhrsource = vhrurl[\"@Source\"];\r\n if (vhrurl[\"#text\"] != undefined) {\r\n this.vhrurl = vhrurl[\"#text\"];\r\n }\r\n } else this.vhrurl = vhrurl;\r\n }\r\n //fair Subscription\r\n // this.SubscriptionStatus = \"off\";\r\n // this.SubscriptionAmount = null;\r\n // this.Subscription = null;\r\n\r\n // if (Subscription != null && Subscription[\"@Amount\"] != \"\") {\r\n // this.SubscriptionStatus = \"on\";\r\n // this.SubscriptionAmount = Subscription[\"@Amount\"];\r\n // this.SubscriptionUrl = Subscription[\"#text\"];\r\n // this.SubscriptionTerm = Subscription[\"@Term\"];\r\n // this.SubscriptionPayment = Subscription[\"@DownPayment\"];\r\n // }\r\n\r\n this.iceurl = iceurl;\r\n }\r\n\r\n generateSeating(seats_Array) {\r\n // var a = data.Output.Results.ModelAttributes.ModelAttribute;\r\n if (this.attributes == undefined) {\r\n // console.log(this.vin);\r\n return;\r\n }\r\n if (this.attributes == null) {\r\n // console.log(this.vin);\r\n return;\r\n }\r\n\r\n var sa = seats_Array;\r\n //search ModelAttribute [#of Passenger] for this VIN\r\n for (var i = 0; i < sa.length; i++) {\r\n var idVal = sa[i][\"@id\"];\r\n //5J6RM3H53EL025021\r\n // if(this.vin =='5J6RM3H53EL025021' && this.dealerId =='206534') { //Scott Robinbson Honda and Honda Pilot\r\n // console.log('generateSeating 218');\r\n // console.log('seating Array Id - ', idVal);\r\n // }\r\n if ($.inArray(idVal, this.attributes) != -1) {\r\n this.seating = sa[i][\"@Value\"];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Generate a list of attributes for this instance of car from the list of attributes from the ajax data\r\n generateFullAttributes(modelAttributeList) {\r\n if (this.attributes == undefined) {\r\n // console.log(this.vin);\r\n return;\r\n }\r\n if (this.attributes == null) {\r\n // console.log(this.vin);\r\n return;\r\n }\r\n\r\n for (var i = 0; i < this.attributes.length; i++) {\r\n var attr = modelAttributeList.getAttributeById2(this.attributes[i]);\r\n this.fullAttributesArray.push(attr);\r\n this.fullAttributeObj[attr[\"@Code\"]] = attr;\r\n }\r\n\r\n if (this.fullAttributeObj[\"City Fuel Efficiency\"] != undefined)\r\n this.lmpg = this.fullAttributeObj[\"City Fuel Efficiency\"][\"@Value\"];\r\n if (this.fullAttributeObj[\"Highway Fuel Efficiency\"] != undefined)\r\n this.hmpg = this.fullAttributeObj[\"Highway Fuel Efficiency\"][\"@Value\"];\r\n if (this.fullAttributeObj[\"COMB_MPG\"] != undefined)\r\n this.cmpg = this.fullAttributeObj[\"COMB_MPG\"][\"@Value\"];\r\n if (this.fullAttributeObj[\"# of Passengers\"] != undefined)\r\n this.seating = this.fullAttributeObj[\"# of Passengers\"][\"@Value\"];\r\n if (this.fullAttributeObj[\"DRIVE\"] != undefined)\r\n this.drive = this.fullAttributeObj[\"DRIVE\"][\"@Value\"];\r\n if (this.fullAttributeObj[\"Engine Name\"] != undefined)\r\n this.engine = this.fullAttributeObj[\"Engine Name\"][\"@Value\"];\r\n\r\n return this.fullAttributes;\r\n }\r\n\r\n // Generate a list of features from model attributes\r\n generateFeaturesList(modelAttributeList) {\r\n if (this.attributes == undefined) {\r\n // console.log(this.vin);\r\n return;\r\n }\r\n if (this.attributes == null) {\r\n // console.log(this.vin);\r\n return;\r\n }\r\n // console.log('225',this.attributes.length);\r\n\r\n for (var i = 0; i < this.attributes.length; i++) {\r\n var attr = modelAttributeList.getAttributeById2(this.attributes[i]);\r\n var index = this.featureStrMap.indexOf(attr[\"@Code\"]);\r\n\r\n //Special Case For CPLAY\r\n // if(attr[\"@Code\"]==\"CPLAY\"){\r\n // if(attr[\"@Value\"].toLowerCase()==\"true\"){\r\n // index=this.featureStrMap.indexOf(\"AAUTO\");\r\n // }\r\n // }\r\n\r\n if (index == -1) continue;\r\n\r\n if (\r\n attr[\"@Code\"] == \"INTERIOR MATERIAL\" &&\r\n attr[\"@Value\"].toLowerCase().indexOf(\"leather\") != -1\r\n ) {\r\n //this.features.push([this.featureStr[index]]=\"True\");\r\n this.features.push(this.featureStr[index]);\r\n }\r\n // AWD ali\r\n if (\r\n attr[\"@Code\"] == \"DRIVE\" &&\r\n attr[\"@Value\"].toLowerCase().indexOf(\"all-wheel\") != -1\r\n ) {\r\n //this.features.push([this.featureStr[index]]=\"True\");\r\n this.features.push(this.featureStr[index]);\r\n // console.log('252: ', this.featureStr[index])\r\n } else if (attr[\"@Value\"].toLowerCase() == \"true\") {\r\n //this.features[this.featureStr[index]]=attr[\"@Value\"];\r\n this.features.push(this.featureStr[index]);\r\n }\r\n }\r\n //if(this.features[\"Navigation\"]==undefined)this.features[\"Navigation\"]=\"False\";\r\n //if(this.features[\"Android Auto / Apple CarPlay\"]==undefined)this.features[\"Android Auto / Apple CarPlay\"]=\"False\";\r\n }\r\n\r\n generateMpgAttributes(modelAttributeList) {\r\n var context = this;\r\n var modelAttributes = this.attributes.map(function(attrID) {\r\n var attributes = [];\r\n modelAttributeList.map(function(attrData) {\r\n if (attrData[\"@id\"] === attrID) {\r\n attributes.push(attrData);\r\n }\r\n });\r\n return attributes;\r\n });\r\n\r\n modelAttributes.map(function(modelAttr) {\r\n modelAttr.map(function(aData) {\r\n if (aData[\"@Code\"] === \"City Fuel Efficiency\") {\r\n context.mpg_city = aData[\"@Value\"];\r\n }\r\n if (aData[\"@Code\"] === \"Highway Fuel Efficiency\") {\r\n context.mpg_highway = aData[\"@Value\"];\r\n }\r\n if (aData[\"@Code\"] === \"COMB_MPG\") {\r\n context.mpg_combined = aData[\"@Value\"];\r\n }\r\n });\r\n });\r\n }\r\n}\r\n"]}