{"version":3,"sources":["priceguideapp.js"],"names":["vm","Vue","el","data","isMember","selectedYear","code","showSearchForm","selectedMake","selectedModel","showError","years","makes","models","loading","searchInputYear","priceResult","priceSearchLoading","cond","methods","getModels","make","_this","this","clearResult","getUrl","axios","get","then","res","catch","error","getMakes","year","_this2","getPrice","model","_this3","priceSearchUrl","encodeURIComponent","price","err","console","log","runTeaser","teaserTimeout","target","$","setTimeout","event","animate","scrollTop","offset","top","window","on","clearTimeout","showInfoText","target2","mounted","_this4","excellent","fair","good","push","getParameterByName","name","url","location","href","replace","results","RegExp","exec","decodeURIComponent"],"mappings":"AAAA,aAEA,IAAIA,GAAK,IAAIC,IAAI,CACbC,GAAI,kBACJC,KAAM,CACFC,UAAU,EACVC,aAAc,GACdC,KAAM,GACNC,gBAAgB,EAChBC,aAAc,GACdC,cAAe,GACfC,UAAW,GACXC,MAAO,GACPC,MAAO,GACPC,OAAQ,GACRC,SAAS,EACTC,gBAAiB,GACjBC,YAAa,GACbC,oBAAoB,EACpBC,KAAM,GAGVC,QAAS,CACLC,UAAW,SAAmBC,GAC1B,IAAIC,EAAQC,KAEZA,KAAKf,aAAea,EACpBE,KAAKC,cACL,IAAIC,EAAS,8BAAgCF,KAAKlB,aAAe,SAAWkB,KAAKf,aACjFkB,MAAMC,IAAIF,GAAQG,MAAK,SAAUC,GAC7BP,EAAMT,OAASgB,EAAI1B,QACpB2B,OAAM,SAAUC,GACfT,EAAMZ,WAAY,MAG1BsB,SAAU,SAAkBC,GACxB,IAAIC,EAASX,KAEbA,KAAKlB,aAAe4B,EACpBV,KAAKf,aAAe,aACpBe,KAAKd,cAAgB,aACrBc,KAAKC,cACL,IAAIC,EAAS,6BAA+BF,KAAKlB,aACjDqB,MAAMC,IAAIF,GAAQG,MAAK,SAAUC,GAC7BK,EAAOtB,MAAQiB,EAAI1B,QACpB2B,OAAM,SAAUC,GACfG,EAAOxB,WAAY,MAG3ByB,SAAU,SAAkBC,GACxB,IAAIC,EAASd,KAEbA,KAAK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D,EAAOrD,gBAAiB,KACzBuB,OAAM,SAAUW,GACfC,QAAQC,IAAIF,SAKxB,SAASwB,mBAAmBC,EAAMC,GACzBA,IAAKA,EAAMb,OAAOc,SAASC,MAChCH,EAAOA,EAAKI,QAAQ,UAAW,QAC/B,IACIC,EADQ,IAAIC,OAAO,OAASN,EAAO,qBACnBO,KAAKN,GACzB,OAAKI,EACAA,EAAQ,GACNG,mBAAmBH,EAAQ,GAAGD,QAAQ,MAAO,MAD5B,GADH","file":"priceguideapp.js","sourcesContent":["\"use strict\";\n\nvar vm = new Vue({\n el: \"#priceguide-app\",\n data: {\n isMember: false,\n selectedYear: \"\",\n code: \"\",\n showSearchForm: false,\n selectedMake: \"\",\n selectedModel: \"\",\n showError: \"\",\n years: [],\n makes: [],\n models: [],\n loading: true,\n searchInputYear: \"\",\n priceResult: \"\",\n priceSearchLoading: false,\n cond: 0\n },\n\n methods: {\n getModels: function getModels(make) {\n var _this = this;\n\n this.selectedMake = make;\n this.clearResult();\n var getUrl = \"/priceguide/getModels?year=\" + this.selectedYear + \"&make=\" + this.selectedMake;\n axios.get(getUrl).then(function (res) {\n _this.models = res.data;\n }).catch(function (error) {\n _this.showError = true;\n });\n },\n getMakes: function getMakes(year) {\n var _this2 = this;\n\n this.selectedYear = year;\n this.selectedMake = \"Velg merke\";\n this.selectedModel = \"Velg model\";\n this.clearResult();\n var getUrl = \"/priceguide/getmakes?year=\" + this.selectedYear;\n axios.get(getUrl).then(function (res) {\n _this2.makes = res.data;\n }).catch(function (error) {\n _this2.showError = true;\n });\n },\n getPrice: function getPrice(model) {\n var _this3 = this;\n\n this.clearResult();\n this.selectedModel = model;\n this.priceSearchLoading = true;\n\n var priceSearchUrl = \"/priceguide/getpriceforcar?year=\" + encodeURIComponent(this.selectedYear) + \"&make=\" + encodeURIComponent(this.selectedMake) + \"&model=\" + encodeURIComponent(this.selectedModel);\n\n axios.get(priceSearchUrl).then(function (res) {\n _this3.priceResult = res.data.price;\n _this3.priceSearchLoading = false;\n }).catch(function (err) {\n console.log(err);\n });\n },\n clearResult: function clearResult() {\n this.showError = false;\n this.loading = false;\n this.priceResult = \"\";\n },\n runTeaser: function runTeaser() {\n var teaserTimeout = void 0;\n var target = $('#amcarTeaserSection');\n\n teaserTimeout = setTimeout(function (event) {\n $('html, body').animate({\n scrollTop: target.offset().top\n }, 1000);\n }, 10000);\n\n $(window).on('scroll', function (event) {\n clearTimeout(teaserTimeout);\n });\n },\n showInfoText: function showInfoText(cond) {\n this.cond = cond;\n\n var target2 = $('#condtext');\n $('html, body').animate({\n scrollTop: target2.offset().top\n }, 500);\n }\n },\n\n mounted: function mounted() {\n var _this4 = this;\n\n axios.get(\"/priceguide/getUserSearchInfo/\").then(function (res) {\n _this4.loading = false;\n var data = res.data;\n if (data.isMember) {\n _this4.isMember = true;\n axios.get(\"/priceguide/getyears\").then(function (res) {\n _this4.years = res.data;\n }).catch(function (res) {\n _this4.showError = true;\n });\n } else {\n _this4.priceResult = {\n excellent: \"500 000\",\n fair: \"350 000\",\n good: \"450 000\"\n };\n\n _this4.makes.push(\"Ford\");\n _this4.models.push(\"Mustang Shelby GT500 Coupe\");\n _this4.years.push(\"2007\");\n\n _this4.selectedMake = \"Ford\";\n _this4.selectedModel = \"Mustang Shelby GT500 Coupe\";\n _this4.selectedYear = \"2007\";\n }\n _this4.showSearchForm = true;\n }).catch(function (err) {\n console.log(err);\n });\n }\n});\n\nfunction getParameterByName(name, url) {\n if (!url) url = window.location.href;\n name = name.replace(/[\\[\\]]/g, \"\\\\$&\");\n var regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n results = regex.exec(url);\n if (!results) return null;\n if (!results[2]) return \"\";\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n}"]}