{"version":3,"sources":["webpack:///./src/views/share/projects_resale/RecoveredProjects.vue","webpack:///src/views/share/projects_resale/RecoveredProjects.vue","webpack:///./src/views/share/projects_resale/RecoveredProjects.vue?cb1e","webpack:///./src/views/share/projects_resale/RecoveredProjects.vue?08a9","webpack:///./src/components/mixins/formatHelper.js"],"names":["render","_vm","this","_c","_self","_v","staticClass","attrs","_l","networks","network","key","sharing","url","title","description","quote","color","icon","model","value","stateSelected","callback","$$v","expression","activeStates","item","index","id","name","on","$event","getProjects","isMounted","projects","project","params","states","getCoverUrl","total_capacity","_s","location","format_price","saving_per_year","decimalPercentFormat","discount","_e","staticRenderFns","mixins","data","firstTime","methods","checkIfImageExists","img","response","component","decimales","val","toFixed","replace","toString","costFormat","costFormatNoCents","prcgFormat","decimalsFormat","explicitMoneyFormat","mxnFormat","parseInt","moneyFormat","roundedFormat","c","cd","Math","round","phoneFormat","substr","phoneFormatV2","visibleLastNChars","chars","valueString","length","phoneLength","firstChars","repeat","last4Digits","slice","visibleOnlyLastNChars","capitalizeFirstLetter","arr","split","i","charAt","toUpperCase","join","isValidRfcFormat","rfc","patternPM","patternPF","match","isValidRfcFormatByPersonType","isMoral","pattern","genericRFC1","genericRFC2","isValidCurpFormat","curp","isValid","diccionario","lngSuma","lngDigito","indexOf","verifierDigit","anonymousFormatPhone","genderTranslate","getLoanTypeIcon","loanType","loanTypeIcons","filename","find","lt","getAmountWithNoCommissionTax","amount","processingAdministrationCommission","mexicoTaxIva","commissionWithTaxPercentage","percentage","amountNoCommision"],"mappings":"uHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACA,EAAG,YAAY,CAACF,EAAII,GAAG,cAAcF,EAAG,OAAO,CAACF,EAAII,GAAG,iBAAiBJ,EAAII,GAAG,iBAAiBF,EAAG,UAAU,CAACG,YAAY,OAAOC,MAAM,CAAC,MAAQ,2DAA2D,CAACJ,EAAG,MAAM,C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AAQ,iBAAkB,aAG3CsD,gBAAgB7F,GACd,OAAgB,GAATA,EAAa,SAAW,SAGjC8F,gBAAgBC,GACd,MAAMC,EAAgB,CACpB,CACExF,GAAI,EACJf,IAAK,mEACLwG,SAAU,iBAEZ,CACEzF,GAAI,EACJf,IAAK,kEACLwG,SAAU,gBAEZ,CACEzF,GAAI,EACJf,IAAK,kEACLwG,SAAU,oBAEZ,CACEzF,GAAI,EACJf,IAAK,kEACLwG,SAAU,uBAId,GAAgB,OAAZF,EACF,OAAOC,EACF,CACL,IAAIlG,EAAOkG,EAAcE,KAAKC,GAAMA,EAAG3F,KAAOuF,GAC1CtG,EAAM,mEAIV,OAHIK,IACFL,EAAMK,EAAKL,KAENA,IAGX2G,6BAA6BC,GAC3B,GAAIA,GAAU,EACZ,OAAO,EAET,MAAMC,EAAqC,IACrCC,EAAe,IACrB,IAAIC,EAA8BF,EAAmCC,EACjEE,EAAc,EAAEH,EAAmCE,EACnDE,EAAoBL,EAAOI,EAC/B,OAAOC","file":"js/chunk-2de07330.df7161c4.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('big-title',[_vm._v(\" Sistemas \"),_c('span',[_vm._v(\"recuperados\")]),_vm._v(\" en venta. \")]),_c('vx-card',{staticClass:\"mt-4\",attrs:{\"title\":\"Descubre sistemas recuperados con ¡precios especiales!\"}},[_c('div',{staticClass:\"vx-row\"},[_c('div',{staticClass:\"vx-col w-full\"},[_c('p',{staticClass:\"mb-5\"},[_vm._v(\" A continuación podrás encontrar los proyectos recuperados de solicitantes que no pudieron continuar con su crédito. Estos equipos tienen muy poco tiempo de uso, están en excelente estado y cuentan con garantía de fabricante \"),_c('strong',[_vm._v(\"¿Te gustaría instalarlos en tu hogar o negocio? ¿Conoces a alguien que esté interesado?\")]),_vm._v(\" Comparte en tus redes sociales estos equipos con ¡precios especiales! \")]),_c('div',{staticClass:\"flex flex-wrap mt-5\"},_vm._l((_vm.networks),function(network){return _c('share-network',{key:network.network,attrs:{\"network\":network.network,\"url\":_vm.sharing.url,\"title\":_vm.sharing.title,\"description\":_vm.sharing.description,\"quote\":_vm.sharing.quote}},[_c('vs-button',{staticClass:\"mr-4\",attrs:{\"type\":\"flat\",\"color\":network.color,\"icon-pack\":\"feather\",\"icon\":network.icon}})],1)}),1),_c('p',{staticClass:\"mt-5\"},[_vm._v(\" Filtra por ubicación los proyectos en venta o contáctanos a través de whatsapp en el (81) 1577 9100 y en el chat de la plataforma para más información.\"),_c('strong',[_vm._v(\" Recuerda que estos proyectos también se encuentran públicos en redgirasol.com/recuperados\")])])]),_c('div',{staticClass:\"vx-col w-full\"},[_c('div',{staticClass:\"vx-col w-full flex\"},[_c('vs-select',{staticClass:\"mt-5\",attrs:{\"placeholder\":\"Estado\"},model:{value:(_vm.stateSelected),callback:function ($$v) {_vm.stateSelected=$$v},expression:\"stateSelected\"}},_vm._l((_vm.activeStates),function(item,index){return _c('vs-select-item',{key:index,attrs:{\"value\":item.id,\"text\":item.name}})}),1),_c('vs-button',{staticClass:\"ml-2 mt-5\",attrs:{\"color\":\"primary\"},on:{\"click\":function($event){return _vm.getProjects(_vm.stateSelected)}}},[_vm._v(\"Filtrar\")])],1)])])]),(_vm.isMounted)?_c('div',{staticClass:\"vx-row\"},_vm._l((_vm.projects),function(project,index){return _c('div',{key:index,staticClass:\"vx-col md:w-1/3 w-full flex justify-center\"},[_c('vx-card',{staticClass:\"mt-4\"},[_c('router-link',{attrs:{\"to\":{name: 'recoverdProjectDetail', params: {id:project.id, project: project, states: _vm.states}}}},[_c('img',{staticClass:\"responsive rounded-lg\",attrs:{\"src\":_vm.getCoverUrl(project),\"alt\":\"content-img\"}})]),_c('div',{staticClass:\"my-6\"},[(project.total_capacity)?[_c('h5',{staticClass:\"mb-2\"},[_vm._v(\"Sistema #\"+_vm._s(project.id)+\" de \"),_c('span',{staticClass:\"text-primary\"},[_vm._v(_vm._s(project.total_capacity))])]),_c('p',{staticClass:\"text-grey\"},[_vm._v(\"en \"+_vm._s(project.location))])]:[_c('h5',{staticClass:\"mb-2\"},[_vm._v(\"Sistema #\"+_vm._s(project.id))]),_c('p',{staticClass:\"text-grey\"},[_vm._v(\"en \"+_vm._s(project.location))])]],2),_c('vs-divider'),_c('div',{staticClass:\"flex justify-between flex-wrap\"},[_c('span',[_c('p',{staticClass:\"text-xl\"},[_vm._v(\"$\"+_vm._s(_vm.format_price(project.saving_per_year/12)))]),_c('p',{staticClass:\"text-grey\"},[_vm._v(\"Ahorro mensual\")])]),_c('span',[_c('p',{staticClass:\"text-xl\"},[_vm._v(_vm._s(_vm.decimalPercentFormat(project.discount,0)))]),_c('p',{staticClass:\"text-grey\"},[_vm._v(\"Descuento\")])])])],1)],1)}),0):_vm._e()],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./RecoveredProjects.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./RecoveredProjects.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./RecoveredProjects.vue?vue&type=template&id=693752aa&scoped=true&\"\nimport script from \"./RecoveredProjects.vue?vue&type=script&lang=js&\"\nexport * from \"./RecoveredProjects.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"693752aa\",\n null\n \n)\n\nexport default component.exports","export default {\n methods: {\n format_price(value, decimales = 0) {\n let val = (value / 1).toFixed(decimales).replace(\",\", \".\");\n return val.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n },\n costFormat(value) {\n if (!value) { return \"$0\"; }\n if (value == \"Pendiente\") { return value; }\n else {\n return \"$\" + this.format_price(value, 2);\n }\n },\n costFormatNoCents(value) {\n if (!value) { return \"$0\"; }\n if (value === \"Pendiente\") { return value; }\n else return \"$\" + this.format_price(value);\n },\n prcgFormat(value, decimales = 0) {\n if (!value) { return \"0%\"; }\n if (value == \"Pendiente\") { return value; }\n else { return value.toFixed(decimales) + \"%\"; }\n },\n decimalsFormat(value, decimales = 0) {\n if (!value) { return 0; }\n if (value == \"Pendiente\") { return 0; }\n else { return value.toFixed(decimales); }\n },\n explicitMoneyFormat(value, decimales = 2) {\n if (value == null) return \"\";\n else {\n return \"$\" + this.format_price(value, decimales);\n }\n },\n mxnFormat(value, decimales = 0) {\n if (!value) { return \"$0MXN\"; }\n else {\n return \"$\" + this.format_price(parseInt(value), decimales) + \" MXN\";\n }\n },\n moneyFormat(value) {\n if (!value) { return \"$0\"; }\n else {\n return \"$\" + this.format_price(parseInt(value), 0);\n }\n },\n decimalPercentFormat(value, decimales = 2) {\n if (!value) return \"0%\";\n else {\n return (value * 100).toFixed(decimales) + \"%\";\n }\n },\n roundedFormat(value, decimales = 2) {\n if (!value) { return 0; }\n else {\n let c = value.toFixed(decimales);\n let cd = Math.round(c);\n return cd.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }\n },\n phoneFormat(value) {\n if (!value) return value\n else {\n return '(' + value.substr(0, 2) + ') ' + value.substr(2, 4) + '-' + value.substr(6, 4)\n }\n },\n phoneFormatV2(value) {\n if (!value) return value\n else {\n return '(' + value.substr(0, 3) + ') ' + value.substr(2, 3) + ' ' + value.substr(6, 4)\n }\n },\n visibleLastNChars(value, chars = 4) {\n if (!value) return value\n else {\n let valueString = value.toString();\n if (chars > valueString.length || chars < 0) return value\n else {\n let phoneLength = valueString.length;\n const firstChars = \"*\".repeat(phoneLength - chars);\n const last4Digits = valueString.slice(firstChars.length);\n return firstChars + last4Digits;\n }\n }\n },\n visibleOnlyLastNChars(value, chars = 4) {\n if (!value) return value\n else {\n let valueString = value.toString();\n if (chars > valueString.length || chars < 0) return value\n else {\n return valueString.slice(-4);\n }\n }\n },\n capitalizeFirstLetter(value) {\n if (!value) return value\n else {\n const arr = value.split(\" \");\n for (let i = 0; i < arr.length; i++) {\n arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);\n\n }\n\n return arr.join(\" \");\n }\n },\n //Función para validar un RFC\n isValidRfcFormat(rfc) {\n if(rfc) {\n const patternPM = \"^(([A-ZÑ&]{3})([0-9]{2})([0][13578]|[1][02])(([0][1-9]|[12][\\\\d])|[3][01])([A-Z0-9]{3}))|\" +\n \"(([A-ZÑ&]{3})([0-9]{2})([0][13456789]|[1][012])(([0][1-9]|[12][\\\\d])|[3][0])([A-Z0-9]{3}))|\" +\n \"(([A-ZÑ&]{3})([02468][048]|[13579][26])[0][2]([0][1-9]|[12][\\\\d])([A-Z0-9]{3}))|\" +\n \"(([A-ZÑ&]{3})([0-9]{2})[0][2]([0][1-9]|[1][0-9]|[2][0-8])([A-Z0-9]{3}))$\";\n const patternPF = \"^(([A-ZÑ&]{4})([0-9]{2})([0][13578]|[1][02])(([0][1-9]|[12][\\\\d])|[3][01])([A-Z0-9]{3}))|\" +\n \"(([A-ZÑ&]{4})([0-9]{2})([0][13456789]|[1][012])(([0][1-9]|[12][\\\\d])|[3][0])([A-Z0-9]{3}))|\" +\n \"(([A-ZÑ&]{4})([02468][048]|[13579][26])[0][2]([0][1-9]|[12][\\\\d])([A-Z0-9]{3}))|\" +\n \"(([A-ZÑ&]{4})([0-9]{2})[0][2]([0][1-9]|[1][0-9]|[2][0-8])([A-Z0-9]{3}))$\";\n return rfc.match(patternPM) || rfc.match(patternPF);\n } else {\n return false;\n }\n },\n //Función para validar un RFC por tipo de persona\n isValidRfcFormatByPersonType(rfc, isMoral) {\n if(rfc) {\n // Formato para PF\n let pattern = /^[A-Z]{4}(\\d{2})((0[13578]|1[02])([0-2]\\d|3[01])|(0[469]|11)([0-2]\\d|30)|(02)([0-2]\\d))([A-Z0-9]{3})$/;\n let genericRFC1 = \"XAXX010101000\";\n let genericRFC2 = \"XEXX010101000\";\n if(isMoral) {\n // Formato para PM\n pattern = /^[A-Z]{3}(\\d{2})((0[13578]|1[02])([0-2]\\d|3[01])|(0[469]|11)([0-2]\\d|30)|(02)([0-2]\\d))([A-Z0-9]{3})$/;\n }\n\n return rfc.match(pattern) && rfc != genericRFC1 && rfc != genericRFC2;\n } else {\n return false;\n }\n },\n //Función para validar una CURP\n isValidCurpFormat(curp) {\n if(curp) {\n const pattern = /^([A-Z][AEIOUX][A-Z]{2}\\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\\d|3[01])[HM](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\\d])(\\d)$/;\n let isValid = curp.match(pattern);\n if (!isValid) //Coincide con el formato general?\n return false;\n //Fuente https://consultas.curp.gob.mx/CurpSP/\n let diccionario = \"0123456789ABCDEFGHIJKLMNÑOPQRSTUVWXYZ\";\n let lngSuma = 0.0;\n let lngDigito = 0.0;\n for (let i = 0; i < 17; i++) {\n lngSuma = lngSuma + diccionario.indexOf(isValid[1].charAt(i)) * (18 - i);\n }\n lngDigito = 10 - lngSuma % 10;\n let verifierDigit = (lngDigito != 10) ? lngDigito : 0;\n return isValid[2] == verifierDigit;\n } else {\n return false;\n }\n },\n anonymousFormatPhone(value){\n if (value === \"\") return value\n else {\n return value.replace(/^(?:\\D*\\d){8}/g, \"********\");\n }\n },\n genderTranslate(value) {\n return value == 1 ? \"Hombre\" : \"Mujer\";\n },\n //Función para obtener el icono del tipo de proyecto o todos con el param 'all'\n getLoanTypeIcon(loanType) {\n const loanTypeIcons = [\n {\n id: 1,\n url: \"https://cdn.redgirasol.com/nuevo_portal/icons/icon-inv-solar.png\",\n filename: \"Crédito Solar\"\n },\n {\n id: 4,\n url: \"https://cdn.redgirasol.com/nuevo_portal/icons/icon-inv-pyme.png\",\n filename: \"Crédito PyME\"\n },\n {\n id: 5,\n url: \"https://cdn.redgirasol.com/nuevo_portal/icons/icon-inv-pers.png\",\n filename: \"Crédito Personal\"\n },\n {\n id: 6,\n url: \"https://cdn.redgirasol.com/nuevo_portal/icons/icon-inv-auto.png\",\n filename: \"Crédito Automotriz\"\n }\n ];\n\n if (loanType == \"all\") {\n return loanTypeIcons;\n } else {\n let icon = loanTypeIcons.find(lt => lt.id === loanType);\n let url = \"https://cdn.redgirasol.com/nuevo_portal/icons/icon-inv-solar.png\";\n if (icon) {\n url = icon.url;\n }\n return url;\n }\n },\n getAmountWithNoCommissionTax(amount){\n if (amount <= 0) {\n return 0;\n }\n const processingAdministrationCommission = .02;\n const mexicoTaxIva = .16;\n let commissionWithTaxPercentage = processingAdministrationCommission*mexicoTaxIva;\n let percentage = (1+processingAdministrationCommission+commissionWithTaxPercentage);\n let amountNoCommision = amount/percentage;\n return amountNoCommision;\n }\n }\n}"],"sourceRoot":""}