Created
June 21, 2017 11:54
-
-
Save dsdenes/59ca0e302396367606fdd040fc37f494 to your computer and use it in GitHub Desktop.
OIWARREN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function t(r) { | |
return r[0].toUpperCase() + r.substring(1) | |
} | |
this.warren = this.warren || {}, this.warren.angular = this.warren.angular || {}, warren.angular.controller = function(r, e, n) { | |
n = n || {}; | |
var l = r.replace("warren.", "").split(".")[0], | |
a = r.replace(/^warren\.\w+\./, "").split("."), | |
o = a[a.length - 1], | |
i = a.map(function(r) { | |
return t(r) | |
}).join(""), | |
c = "c_" + o, | |
u = "warren" + i + "Controller", | |
p = "warren" + i, | |
s = "app/" + l + "/"; | |
1 === a.length ? s += a[0] + "/" + a[0] : 2 === a.length ? s += a[0] + "/pages/" + a[1] : console.warn('Not sure how to define template url of "' + r + '", please define manually.'), s += ".template.html", angular.module(r, []).controller(n.controllerId || u, e).directive(n.directiveId || p, function() { | |
return { | |
templateUrl: n.templateUrl || s, | |
controller: n.controller || e, | |
controllerAs: n.controllerAs || c | |
} | |
}) | |
}; | |
var isDesktop = "undefined" != typeof module && module.exports; | |
if (isDesktop) var warren = { | |
enums: {} | |
}; | |
else this.warren = this.warren || {}, this.warren.enums = this.warren.enums || {}; | |
! function() { | |
"use strict"; | |
warren.enums.UserStatus = { | |
prospect: "Prospect (only the email)", | |
register: "Register (email + password)", | |
valid: "Valid (email has been verified)", | |
complete: "Complete (user completed its profile)", | |
approved: "Approved (Warren validated the profile)" | |
}, warren.enums.PortfolioGoals = { | |
emergency: "Quero uma reserva rápida para uma emergência", | |
target: "Não tenho um objetivo financeiro e/ou prazo especÃficos", | |
monthly_income: "Quero investir para uma aposentadoria tranquila", | |
free: "Tenho um objetivo financeiro e/ou prazo especÃficos" | |
}, warren.enums.UserRole = { | |
admin: "Administrador" | |
}, warren.enums.Sex = { | |
male: "Masculino", | |
female: "Feminino" | |
}, warren.enums.MaritalStatus = { | |
"casado-brasileiro-nato": "Casado(a) com Brasileiro(a) nato(a)", | |
"casado-brasileiro-naturalizado": "Casado(a) com Brasileiro(a) naturalizado(a)", | |
"casado-estrangeiro": "Casado(a) com Estrangeiro(a)", | |
desquitado: "Desquitado(a)", | |
divorciado: "Divorciado(a)", | |
solteiro: "Solteiro", | |
"uniao-estavel": "União Estável", | |
viuvo: "Viúvo" | |
}, warren.enums.Nationality = { | |
"brasileiro-nato": "Brasileiro(a) NATO(A)", | |
"brasileiro-naturalizado": "Brasileiro(a) NATURALIZADO(A)", | |
estrangeiro: "Estrangeiro" | |
}, warren.enums.State = { | |
AC: "Acre", | |
AL: "Alagoas", | |
AP: "Amapá", | |
AM: "Amazonas", | |
BA: "Bahia", | |
CE: "Ceará", | |
DF: "Distrito Federal", | |
ES: "EspÃrito Santo", | |
GO: "Goiás", | |
MA: "Maranhão", | |
MT: "Mato Grosso", | |
MS: "Mato Grosso do Sul", | |
MG: "Minas Gerais", | |
PA: "Pará", | |
PB: "ParaÃba", | |
PR: "Paraná", | |
PE: "Pernambuco", | |
PI: "PiauÃ", | |
RJ: "Rio de Janeiro", | |
RN: "Rio Grande do Norte", | |
RS: "Rio Grande do Sul", | |
RO: "Rondônia", | |
RR: "Roraima", | |
SC: "Santa Catarina", | |
SP: "São Paulo", | |
SE: "Sergipe", | |
TO: "Tocantins" | |
}, warren.enums.Profession = { | |
"001": "Administrador", | |
"002": "Advogado", | |
"003": "Agente de viagem e guia de turismo", | |
"004": "Agrônomo", | |
"005": "Analista de sistemas", | |
"006": "Aposentado (exceto funcionário público)", | |
"007": "Arquiteto", | |
"008": "Assistente social", | |
"009": "Atleta profissional e técnico em desportos", | |
"010": "Autônomo", | |
"011": "Auxiliar de escritório e assemelhados", | |
"012": "Bancário e economiário", | |
"013": "Biólogo e biomédico", | |
"014": "Bolsista", | |
"015": "Cabeleireiro", | |
"016": "Capitalista", | |
"017": "Contador", | |
"018": "Corretor de imóveis", | |
"019": "Decorador", | |
"020": "Diretor de empresas", | |
"021": "Economista", | |
"022": "Eletricista e assemelhados", | |
"023": "Empresário", | |
"024": "Enfermeiro e nutricionista", | |
"025": "Engenheiro", | |
"026": "Estudante", | |
"027": "Farmacêutico", | |
"028": "FÃsico", | |
"029": "Fisioterapeuta e terapeuta ocupacional", | |
"030": "Fonoaudiólogo", | |
"031": "Funcionário público civil aposentado", | |
"032": "Geólogo", | |
"033": "Jornalista", | |
"034": "Mecânico de manutenção de veÃculos autos e máquinas", | |
"035": "Médico", | |
"036": "Membro do poder executivo: pres.república", | |
"037": "Membro do poder judiciário: ministro de trib. sup", | |
"038": "Membro do poder legislativo: senador", | |
"039": "Militar em geral", | |
"040": "Militar reformado", | |
"041": "Modelo de modas", | |
"042": "Motorista de veÃculos de transporte de carga", | |
"043": "Motorista de veÃculos de transporte de passageiros", | |
"044": "Músico", | |
"045": "Odontólogo e dentista", | |
"046": "Pensionista", | |
"047": "Piloto de aeronaves", | |
"048": "Professor de ensino superior", | |
"049": "Professor de primeiro e segundo graus", | |
"050": "Proprietário de estabelecimento agrÃcola", | |
"051": "Proprietário de estabelecimento comercial", | |
"052": "Proprietário de estabelecimento de prestação de serviço", | |
"053": "Proprietário de estabelecimento industrial", | |
"054": "Proprietário de imóvel (recebendo renda de aluguel)", | |
"055": "Proprietário de microempresas", | |
"056": "Psicólogo", | |
"057": "Publicitário", | |
"058": "QuÃmico", | |
"059": "Relações públicas", | |
"060": "Roteirista / escritora", | |
"061": "Sacerdote ou membro de ordens ou seitas religiosas", | |
"062": "Securitário", | |
"063": "Servidor público estadual", | |
"064": "Servidor público federal", | |
"065": "Servidor público municipal", | |
"066": "Sociólogo", | |
"067": "Técnico de biologia", | |
"068": "Técnico de contabilidade e de estatÃstica", | |
"069": "Técnico de eletricidade", | |
"070": "Técnico de quÃmica", | |
"071": "Trabalhador de construção civil", | |
"072": "Trabalhador metalúrgico e siderúrgico", | |
"073": "Vendedor de comércio varejista e atacadista", | |
"074": "Veterinário e zootecnista" | |
}, warren.enums.DocumentType = { | |
rg: "RG (Registro Geral)", | |
cnh: "CNH (Carteira Nacional de Habilitação)" | |
}, warren.enums.DocumentEmissor = { | |
detran: "Detran", | |
ifp: "(IFP) Instituto Félix Pacheco", | |
sjs: "(SJS) Secretaria da Justiça e da Segurança", | |
sds: "(SDS) Secretaria de Defesa Social", | |
sej: "(SEJ) Secretaria de Estado e Justiça", | |
secc: "(SECC) Secretaria Estado da Casa Civil", | |
sesp: "(SESP) Secretaria Estado Segurança Pública", | |
ssp: "(SSP) Secretaria Segurança Pública" | |
}, warren.enums.Bank = { | |
735: "Neon", | |
"001": "Banco do Brasil S/A", | |
"003": "Banco da Amazonia", | |
"004": "Banco do Nordeste do Brasil S/A", | |
"014": "Natixis Brasil S/A Banco Múltiplo", | |
"017": "BNY Mellon Banco S/A.", | |
"018": "Banco Tricury S/A", | |
"019": "Banco Azteca do Brasil S/A", | |
"021": "Banestes", | |
"024": "Estado de Pernambuco S/A", | |
"025": "Banco Alfa", | |
"029": "Banco do Estado do Rio de Janeiro", | |
"033": "Santander", | |
"036": "Estado do Maranhao S/A", | |
"037": "Banco Banpara", | |
"040": "Banco Cargill S/A", | |
"041": "Banrisul", | |
"047": "Banco de Sergipe", | |
"060": "Confidence Corretora de Câmbio S/A", | |
"062": "Hipercard Banco Múltiplo S/A", | |
"063": "Banco Bradescard S/A", | |
"064": "Goldman Sachs do Brasil Banco Múltiplo S/A", | |
"065": "Banco Bracce S/A", | |
"066": "Banco Morgan Stanley S/A", | |
"069": "BPN Brasil Banco Múltiplo S/A", | |
"070": "BRB", | |
"074": "Banco J Safra", | |
"075": "Banco ABN AMRO S/A", | |
"076": "Banco KDB do Brasil S/A", | |
"077": "Banco Intermedium S/A", | |
212: "Banco Original S/A", | |
"081": "Bbn Banco Brasileiro de Negocios S/A", | |
"082": "Banco Topazio S/A", | |
"083": "Banco Da China Brasil S/A", | |
"085": "Cooperativa Central de Crédito Urbano", | |
"087": "CC Unicred Central SC/PR", | |
"088": "Banco Randon S/A", | |
"090": "CC Unicred Central SP", | |
"091": "Unicred Central RS", | |
"094": "Banco Petra S/A", | |
"095": "Banco Confidence de Câmbio S/A", | |
"096": "Banco Bm&f de Liquidacao e Custodia S/A", | |
"097": "BEP", | |
"098": "BERS", | |
"099": "BN BCO do Nordeste do Brasil S/A", | |
101: "BEB", | |
102: "BEP", | |
104: "Caixa Economica Federal S/A", | |
105: "Suritomo Brasileiro S/A", | |
107: "Mitsubishi Brasileiro S/A", | |
111: "BEG", | |
112: "Paraiban", | |
113: "BEM", | |
117: "Mult Banco S/A", | |
118: "BEPI", | |
119: "Battistella S/A", | |
120: "Augusgo Indal. Coml. S/A", | |
121: "Porto Real S/A", | |
122: "Bradesco BERJ", | |
123: "BESE", | |
124: "BEAM", | |
125: "Brasil Plural", | |
126: "Exprinter Losan S/A", | |
127: "Equatorial S/A", | |
129: "BEMT", | |
130: "BEAC", | |
132: "MAXI", | |
138: "Ficrisa Axelrud S/A", | |
184: "Bba Creditanstal S/A", | |
204: "Srl S/A", | |
208: "Pactual S/A", | |
213: "Arbi S/A", | |
214: "Dibens S/A", | |
217: "Agroinvest S/A", | |
218: "Banco Bonsucesso S/A", | |
222: "Banco Calyon S/A", | |
224: "Fibra S/A", | |
230: "Bandeirantes S/A", | |
233: "Mappin S/A", | |
237: "Bradesco S/A", | |
241: "Classico S/A", | |
243: "Stock S/A", | |
246: "Abc Roma S/A", | |
248: "Banco Boavista Interatlântico S/A", | |
249: "Investcred S/A", | |
250: "Schahin Cury S/A", | |
254: "Parana Banco S/A", | |
263: "Cacique S/A", | |
265: "Fator S/A", | |
266: "Cedula S/A", | |
300: "Nacion Argentina S/A", | |
318: "Bmg S/A", | |
320: "Indl e Comercial S/A", | |
341: "Banco Itau S/A", | |
366: "Sogeral S/A", | |
370: "Europru P/AM. Latina", | |
376: "Chase Manhattan S/A", | |
389: "Mercantil do Brasil S/A", | |
394: "Bmc S/A", | |
399: "Banco HSBC S/A", | |
412: "Nacional Da Bahia S/A", | |
422: "Safra S/A", | |
456: "Tokio S/A", | |
464: "Sumitomo S/A", | |
473: "Financial Portugues S/A", | |
477: "Citibank S/A", | |
479: "ITAU BANK PERSONALITTE", | |
487: "Deutsche Bank S/A", | |
488: "Morgan Guaranty Trust Company of NY", | |
492: "Internat. Nederlanden Bank NV", | |
494: "Republica Oriental Del Uruguay", | |
495: "Provincia de Buenos Aires", | |
505: "Garantia S/A", | |
600: "Luso Brasileiro S/A", | |
604: "Indl do Brasil S/A", | |
610: "V R S/A", | |
611: "Paulista S/A", | |
612: "Guanabara S/A", | |
613: "Pecunia S/A", | |
623: "Panamericano S/A", | |
626: "Ficsa S/A", | |
630: "Intercap S/A", | |
633: "Rendimento S/A", | |
634: "Triangulo S/A", | |
637: "Sofisa S/A", | |
641: "BBV Banco Bilbao Vizcaya", | |
643: "Segmentos S/A", | |
652: "Itaú Unibanco Holding S/A", | |
653: "Indusval S/A", | |
654: "A.J. Renner S/A", | |
655: "Votorantim S/A", | |
707: "Daycoval S/A", | |
712: "Banco Ourinvest S/A", | |
719: "Banif Primus S/A", | |
739: "Bgn S/A", | |
740: "Bcn Barclays S/A", | |
741: "Ribeirao Preto S/A", | |
745: "Banco Citibank S/A", | |
746: "Banco Modal S/A", | |
747: "Banco Rabobank International Brasil S/A", | |
748: "Banco Cooperativo Sicredi S/A", | |
751: "Scotiabank Brasil S/A Banco Múltiplo", | |
752: "Banco BNP Paribas Brasil S/A", | |
753: "Novo Banco Continental S/A", | |
755: "Bank of America Merrill Lynch Banco Múltiplo S/A", | |
756: "Bancoob", | |
757: "Banco Keb do Brasil S/A", | |
901: "Boston S/A" | |
}, warren.enums.BankImages = { | |
"001": "/assets/imgs/banks/bancodobrasil.svg", | |
"033": "/assets/imgs/banks/santander.svg", | |
104: "/assets/imgs/banks/caixa.svg", | |
237: "/assets/imgs/banks/bradesco.svg", | |
341: "/assets/imgs/banks/itau.svg", | |
399: "/assets/imgs/banks/hsbc.svg", | |
477: "/assets/imgs/banks/citibank.svg", | |
479: "/assets/imgs/banks/itau.svg", | |
745: "/assets/imgs/banks/citibank.svg", | |
other: "/assets/imgs/icons/ic_3dots_black.svg" | |
}, warren.enums.BankAccountType = { | |
savings: "Conta poupança", | |
current: "Conta corrente" | |
}, warren.enums.CreditCardType = { | |
VI: "Visa", | |
AX: "American Express", | |
BC: "BC Card", | |
CA: "MasterCard", | |
DS: "Discover", | |
DC: "Diners Club", | |
T: "Carta Si", | |
R: "Carte Bleue", | |
E: "Visa Electron", | |
JC: "Japan Credit Bureau", | |
TO: "Maestro" | |
}, warren.enums.Education = { | |
kindergarten: "Infantil", | |
elementary: "Fundamental", | |
high_school: "Médio", | |
superior: "Superior", | |
technical: "Técnico", | |
masters_doctorate: "Mestrado/Doutorado", | |
postgraduate_specialization: "Pós Graduação/Especialização" | |
} | |
}(), isDesktop && (module.exports = warren.enums); | |
this.warren = this.warren || {}, this.warren.finance = this.warren.finance || {}, | |
function() { | |
"use strict"; | |
var n = warren.finance; | |
n.futureValue = function(n, r, e, a) { | |
0 === e && (e = 1e-5); | |
var t = Math.pow(1 + e, r), | |
i = n * t, | |
u = 0; | |
return a && (u = a * ((t - 1) / e)), i + u || 0 | |
} | |
}(); | |
this.warren = this.warren || {}, this.warren.goals = this.warren.goals || {}, this.warren.utils = this.warren.utils || {}, | |
function() { | |
"use strict"; | |
var t = warren.goals, | |
n = warren.utils; | |
n.futureValue = function(t, n, e, a) { | |
0 === e && (e = 1e-5); | |
var r = Math.pow(1 + e, n), | |
u = t * r, | |
i = 0; | |
return a && (i = a * ((r - 1) / e)), u + i || 0 | |
}, n.round = function(t, n) { | |
var e = t % n; | |
return 0 !== e && (t += n - e), t | |
}, t.emergency = { | |
suggestGoalAmount: function(t) { | |
return n.round(Math.max(6 * t, 3e3), 1e3) | |
}, | |
suggestGoalTime: function() { | |
return 3 | |
}, | |
suggestInitialInvestment: function(t, e, a, r) { | |
var u = .05 * t, | |
i = Math.pow(1 + a, e), | |
o = u * ((i - 1) / a), | |
s = (r - o) / i; | |
return s = Math.ceil(Math.min(Math.max(s, 1e3), r)), n.round(s, 1e3) | |
}, | |
suggestMonthlyInvestment: function(t, e, a, r) { | |
var u = Math.pow(1 + a, e), | |
i = t * u, | |
o = (r - i) * a / (u - 1); | |
return o = Math.ceil(Math.min(Math.max(o, 100), r)), n.round(o, 50) | |
} | |
}, t.target = { | |
suggestInitialInvestment: function(t, e, a, r) { | |
var u = .05 * t, | |
i = Math.pow(1 + a, e), | |
o = u * ((i - 1) / a), | |
s = (r - o) / i; | |
return s = Math.ceil(Math.min(Math.max(s, 1e3), r)), n.round(s, 1e3) | |
}, | |
suggestMonthlyInvestment: function(t, e, a, r) { | |
var u = Math.pow(1 + a, e), | |
i = t * u, | |
o = (r - i) * a / (u - 1); | |
return o = Math.ceil(Math.min(Math.max(o, 100), r)), n.round(o, 50) | |
} | |
}, t.monthlyIncome = { | |
suggestGoalIncome: function(t) { | |
return n.round(t, 100) | |
}, | |
suggestGoalTime: function(t) { | |
return t > 45 ? null : Math.min(Math.max(60 - t, 8), 60) | |
}, | |
suggestInitialInvestment: function(t, e, a, r) { | |
var u = .05 * t, | |
i = Math.pow(1 + a, e), | |
o = u * ((i - 1) / a), | |
s = (r - o) / i; | |
return s = Math.ceil(Math.min(Math.max(s, 1e3), r)), n.round(s, 1e3) | |
}, | |
suggestMonthlyInvestment: function(t, e, a, r) { | |
var u = Math.pow(1 + a, e), | |
i = t * u, | |
o = (r - i) * a / (u - 1); | |
return o = Math.ceil(Math.min(Math.max(o, 100), r)), n.round(o, 10) | |
} | |
}, t.free = {} | |
}(); | |
! function() { | |
if (String.prototype.startsWith || (String.prototype.startsWith = function(n, t) { | |
return t = t || 0, this.substr(t, n.length) === n | |
}), "performance" in window == !1 && (window.performance = {}), Date.now = Date.now || function() { | |
return (new Date).getTime() | |
}, "now" in window.performance == !1) { | |
var n = Date.now(); | |
performance.timing && performance.timing.navigationStart && (n = performance.timing.navigationStart), window.performance.now = function() { | |
return Date.now() - n | |
} | |
} | |
}(); | |
this.warren = this.warren || {}, this.warren.utils = this.warren.utils || {}, | |
function() { | |
"use strict"; | |
var e = warren.utils; | |
e.clamp = function(e, t, n) { | |
return Math.min(Math.max(e, t), n) | |
}, e.getEnumValues = function(e) { | |
var t = []; | |
for (var n in e) t.push(e[n]); | |
return t | |
}, e.toTitleCase = function(e) { | |
return e.replace(/\w\S*/g, function(e) { | |
return e.charAt(0).toUpperCase() + e.substr(1).toLowerCase() | |
}) | |
}, e.toCapitalCase = function(e) { | |
return e[0].toUpperCase() + e.slice(1).toLowerCase() | |
}, e.bankAccountToString = function(e) { | |
var t = warren.enums.Bank[e.bank], | |
n = e.number; | |
return t = t.replace(" S/A", ""), n = n.slice(0, 4), t + " (" + n + "*)" | |
}, e.deepmerge = function(t, n) { | |
var r = Array.isArray(n), | |
a = r && [] || {}; | |
return r ? (t = t || [], a = a.concat(t), n.forEach(function(n, r) { | |
"undefined" == typeof a[r] ? a[r] = n : "object" == typeof n ? a[r] = e.deepmerge(t[r], n) : t.indexOf(n) === -1 && a.push(n) | |
})) : (t && "object" == typeof t && Object.keys(t).forEach(function(e) { | |
a[e] = t[e] | |
}), Object.keys(n).forEach(function(r) { | |
"object" == typeof n[r] && n[r] && t[r] ? a[r] = e.deepmerge(t[r], n[r]) : a[r] = n[r] | |
})), a | |
}, e.deepcopy = function(e) { | |
return JSON.parse(JSON.stringify(e)) | |
}, e.deepdiff = function(t, n) { | |
var r = {}; | |
if (!t) return n; | |
for (var a in n) | |
if ("undefined" != typeof t[a]) | |
if (null !== n[a]) { | |
var o = null; | |
Array.isArray(n[a]) ? r[a] = n[a] : "object" == typeof n[a] ? (o = e.deepdiff(t[a], n[a]), Object.keys(o).length > 0 && (r[a] = o)) : t[a] !== n[a] && (r[a] = n[a]) | |
} else null !== t[a] && (r[a] = null); | |
else r[a] = n[a]; | |
return r | |
}, e.dataUriToBlob = function(e) { | |
var t; | |
t = e.split(",")[0].indexOf("base64") >= 0 ? atob(e.split(",")[1]) : unescape(e.split(",")[1]); | |
for (var n = e.split(",")[0].split(":")[1].split(";")[0], r = new Uint8Array(t.length), a = 0; a < t.length; a++) r[a] = t.charCodeAt(a); | |
return new Blob([r], { | |
type: n | |
}) | |
}, e.getElementHeight = function(e) { | |
return e.offsetHeight | |
}, e.getElementOuterHeight = function(e) { | |
var t = e.offsetHeight, | |
n = getComputedStyle(e); | |
return t += parseInt(n.marginTop) + parseInt(n.marginBottom) | |
}, e.getGlobalOffset = function(e) { | |
for (var t = 0, n = 0; e;) t += e.offsetLeft, n += e.offsetTop, e = e.offsetParent; | |
return { | |
left: t, | |
top: n | |
} | |
}, e.getDocumentTop = function() { | |
return window.pageYOffset ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0 | |
}, e.isSafari = function() { | |
var e = navigator.userAgent.toLowerCase(); | |
return e.indexOf("safari") != -1 && e.indexOf("chrome") < 0 | |
}, e.browserVersion = function() { | |
var e, t = navigator.userAgent, | |
n = t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; | |
return /trident/i.test(n[1]) ? (e = /\brv[ :]+(\d+)/g.exec(t) || [], parseInt(e[1])) : "Chrome" === n[1] && (e = t.match(/\b(OPR|Edge)\/(\d+)/), null != e) ? parseInt(e.slice(1)[1]) : (n = n[2] ? [n[1], n[2]] : [navigator.appName, navigator.appVersion, "-?"], null != (e = t.match(/version\/(\d+)/i)) && n.splice(1, 1, e[1]), parseInt(n[1])) | |
}, e.isNumber = function(e) { | |
return !isNaN(parseFloat(e)) | |
}, e.notTypewriter = function(e) { | |
return e.replace(/\^\d+/g, "") | |
}, e.addClass = function(e, t) { | |
var n = new RegExp("(\\s+|\\b)" + t + "(\\b)", "gi"); | |
n.test(e.className) || (e.className += " " + t) | |
}, e.hasClass = function(e, t) { | |
var n = new RegExp("(\\s+|\\b)" + t + "(\\b)", "gi"); | |
return !!n.test(e.className) | |
}, e.removeClass = function(e, t) { | |
var n = new RegExp("(\\s+|\\b)" + t + "(\\b)", "gi"); | |
e.className = e.className.replace(n, "") | |
}, e.isDraggingFile = function(e) { | |
var t = e.dataTransfer || e.orinalEvent && e.orinalEvent.dataTransfer; | |
return !!t && !!(t.types && t.types.length && "files" === t.types[0].toLowerCase() || t.files && t.files.length) | |
}, e.isMobile = function() { | |
var e = !1; | |
return function(t) { | |
(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0, 4))) && (e = !0) | |
}(navigator.userAgent || navigator.vendor || window.opera), e | |
} | |
}(); | |
! function(t) { | |
function n() { | |
if (!(this instanceof n)) return new n | |
} | |
var e = t.Moip || {}; | |
t.Moip = e, n.prototype = { | |
calculateAccount: function(t) { | |
for (var n = t.split(""), e = 0, o = 0; o < n.length; o++) seq = 9 - o, e += parseInt(n[o]) * seq; | |
return this.module(e) | |
}, | |
calculateAgency: function(t) { | |
for (var n = t.split(""), e = 0, o = 0; o < n.length; o++) seq = 5 - o, e += parseInt(n[o]) * seq; | |
return this.module(e) | |
}, | |
module: function(t) { | |
var n = 11 - t % 11; | |
return 10 === n ? "X" : 11 === n ? "0" : n.toString() | |
} | |
}, e.BancoDoBrasilCheckNumberCalculator = n() | |
}(window); | |
! function(n) { | |
function c() { | |
if (!(this instanceof c)) return new c | |
} | |
var e = n.Moip || {}; | |
n.Moip = e, c.prototype = { | |
agencyNumberIsValid: function(n) { | |
return e.CommonBankAccountValidator.agencyNumberIsValid(n) | |
}, | |
agencyCheckNumberIsValid: function(n) { | |
return n.length == this.agencyCheckNumberLength() && e.CommonBankAccountValidator.agencyCheckNumberIsValid(n) | |
}, | |
accountNumberIsValid: function(n) { | |
return n.length == this.accountNumberLength() && e.CommonBankAccountValidator.accountNumberIsValid(n) | |
}, | |
accountCheckNumberIsValid: function(n) { | |
return e.CommonBankAccountValidator.accountCheckNumberIsValid(n) | |
}, | |
agencyCheckNumberMatch: function(n) { | |
var c = e.BancoDoBrasilCheckNumberCalculator.calculateAgency(n.agencyNumber); | |
return c === n.agencyCheckNumber.toUpperCase() | |
}, | |
accountCheckNumberMatch: function(n) { | |
var c = e.BancoDoBrasilCheckNumberCalculator.calculateAccount(n.accountNumber); | |
return "X" == c && "0" == n.accountCheckNumber.toUpperCase() || c === n.accountCheckNumber.toUpperCase() | |
}, | |
agencyNumberMsgError: function() { | |
return e.CommonBankAccountValidator.agencyNumberMsgError() | |
}, | |
agencyCheckNumberMsgError: function() { | |
return e.CommonBankAccountValidator.agencyCheckNumberMsgError(this.agencyCheckNumberLength()) | |
}, | |
accountNumberMsgError: function() { | |
return e.CommonBankAccountValidator.accountNumberMsgError(this.accountNumberLength()) | |
}, | |
agencyCheckNumberLength: function() { | |
return 1 | |
}, | |
accountNumberLength: function() { | |
return 8 | |
} | |
}, e.BancoDoBrasilValidator = c() | |
}(window); | |
! function(a) { | |
function e() { | |
if (!(this instanceof e)) return new e | |
} | |
var c = a.Moip || {}; | |
a.Moip = c, e.prototype = { | |
validator: function(a) { | |
var e = { | |
"001": c.BancoDoBrasilValidator, | |
237: c.BradescoValidator, | |
341: c.ItauValidator, | |
"033": c.SantanderValidator, | |
"041": c.BanrisulValidator, | |
745: c.CitibankValidator, | |
399: c.HSBCValidator | |
}; | |
return e[a] ? e[a] : c.GenericBankAccountValidator | |
}, | |
validate: function(a) { | |
var e = [], | |
n = this.validator(a.bankNumber); | |
n.accountNumberLength && a.accountNumber.length < n.accountNumberLength() && (a.accountNumber = "0".repeat(n.accountNumberLength() - a.accountNumber.length) + a.accountNumber), c.GenericBankAccountValidator.bankNumberIsValid(a.bankNumber) || e.push({ | |
description: "Banco inválido", | |
code: "INVALID_BANK_NUMBER" | |
}), n.agencyNumberIsValid(a.agencyNumber) || e.push({ | |
description: n.agencyNumberMsgError(), | |
code: "INVALID_AGENCY_NUMBER" | |
}), n.agencyCheckNumberIsValid(a.agencyCheckNumber) || e.push({ | |
description: n.agencyCheckNumberMsgError(), | |
code: "INVALID_AGENCY_CHECK_NUMBER" | |
}), n.accountNumberIsValid(a.accountNumber) || e.push({ | |
description: n.accountNumberMsgError(), | |
code: "INVALID_ACCOUNT_NUMBER" | |
}), n.accountCheckNumberIsValid(a.accountCheckNumber) || e.push({ | |
description: "DÃgito da conta corrente inválido", | |
code: "INVALID_ACCOUNT_CHECK_NUMBER" | |
}), n.agencyNumberIsValid(a.agencyNumber) && n.agencyCheckNumberIsValid(a.agencyCheckNumber) && (n.agencyCheckNumberMatch(a) || e.push({ | |
description: "DÃgito da agência não corresponde ao número da agência preenchido", | |
code: "AGENCY_CHECK_NUMBER_DONT_MATCH" | |
})), n.accountNumberIsValid(a.accountNumber) && n.accountCheckNumberIsValid(a.accountCheckNumber) && (n.accountCheckNumberMatch(a) || e.push({ | |
description: "DÃgito da conta não corresponde ao número da conta/agência preenchido", | |
code: "ACCOUNT_CHECK_NUMBER_DONT_MATCH" | |
})), 0 === e.length ? a.valid() : a.invalid({ | |
errors: e | |
}) | |
} | |
}, c.BankAccount = e() | |
}(window); | |
! function(t) { | |
function n() { | |
if (!(this instanceof n)) return new n | |
} | |
var i = t.Moip || {}; | |
t.Moip = i, n.prototype = { | |
calculateAccount: function(t) { | |
for (var n = t.split(""), i = 0, r = 0; r < n.length; r++) { | |
var e = parseInt(n[r]); | |
i += this.multiplyAccordingWeight(e, r) | |
} | |
return this.moduleAccount(i) | |
}, | |
multiplyAccordingWeight: function(t, n) { | |
var i = [3, 2, 4, 7, 6, 5, 4, 3, 2]; | |
return t * i[n] | |
}, | |
moduleAccount: function(t) { | |
var n = t % 11; | |
return 0 === n ? "0" : 1 === n ? "6" : (11 - n).toString() | |
}, | |
calculateAgency: function(t) { | |
var n = t.split(""), | |
i = this.firstAgencyDigit(n), | |
r = this.secondAgencyDigit(n, i); | |
return i + r | |
}, | |
firstAgencyDigit: function(t) { | |
for (var n = 0, i = 0, r = 0; r < t.length; r++) { | |
var e = parseInt(t[r]); | |
i = this.multiplyAccordingParity(e, r), i = this.adjustAccordingLength(i), n += i | |
} | |
return this.moduleAgencyFirstDigit(n) | |
}, | |
secondAgencyDigit: function(t, n) { | |
t.push(n); | |
for (var i = 0, r = 0; r < t.length; r++) seq = 6 - r, i += parseInt(t[r]) * seq; | |
var e = this.moduleAgencySecondDigit(i); | |
return "1" === e && (9 != n ? n += 1 : n = 0, this.secondAgencyDigit(t, n)), e | |
}, | |
multiplyAccordingParity: function(t, n) { | |
return t * (n % 2 === 0 ? 1 : 2) | |
}, | |
adjustAccordingLength: function(t) { | |
if (t > 9) { | |
var n = t.toString().split(""); | |
t = 0; | |
for (var i = 0; i < n.length; i++) t += parseInt(n[i]) | |
} | |
return t | |
}, | |
moduleAgencyFirstDigit: function(t) { | |
var n = t % 10; | |
return 0 === n ? "0" : (10 - n).toString() | |
}, | |
moduleAgencySecondDigit: function(t) { | |
var n = t % 11; | |
return 0 === n ? "0" : 1 === n ? "1" : (11 - n).toString() | |
} | |
}, i.BanrisulCheckNumberCalculator = n() | |
}(window); | |
! function(n) { | |
function c() { | |
if (!(this instanceof c)) return new c | |
} | |
var r = n.Moip || {}; | |
n.Moip = r, c.prototype = { | |
agencyNumberIsValid: function(n) { | |
return r.CommonBankAccountValidator.agencyNumberIsValid(n) | |
}, | |
agencyCheckNumberIsValid: function(n) { | |
return n.length == this.agencyCheckNumberLength() && r.GenericBankAccountValidator.agencyCheckNumberIsValid(n) | |
}, | |
accountNumberIsValid: function(n) { | |
return n.length == this.accountNumberLength() && r.CommonBankAccountValidator.accountNumberIsValid(n) | |
}, | |
accountCheckNumberIsValid: function(n) { | |
return r.CommonBankAccountValidator.accountCheckNumberIsValid(n) | |
}, | |
agencyCheckNumberMatch: function(n) { | |
var c = r.BanrisulCheckNumberCalculator.calculateAgency(n.agencyNumber); | |
return c === n.agencyCheckNumber | |
}, | |
accountCheckNumberMatch: function(n) { | |
var c = r.BanrisulCheckNumberCalculator.calculateAccount(n.accountNumber); | |
return c === n.accountCheckNumber | |
}, | |
agencyNumberMsgError: function() { | |
return r.CommonBankAccountValidator.agencyNumberMsgError() | |
}, | |
agencyCheckNumberMsgError: function() { | |
return r.CommonBankAccountValidator.agencyCheckNumberMsgError(this.agencyCheckNumberLength()) | |
}, | |
accountNumberMsgError: function() { | |
return r.CommonBankAccountValidator.accountNumberMsgError(this.accountNumberLength()) | |
}, | |
agencyCheckNumberLength: function() { | |
return 2 | |
}, | |
accountNumberLength: function() { | |
return 9 | |
} | |
}, r.BanrisulValidator = c() | |
}(window); | |
! function(t) { | |
function n() { | |
if (!(this instanceof n)) return new n | |
} | |
var r = t.Moip || {}; | |
t.Moip = r, n.prototype = { | |
calculateAccount: function(t) { | |
for (var n = t.split(""), r = 0, e = 0; e < n.length; e++) { | |
var c = parseInt(n[e]); | |
r += this.multiplyAccordingWeight(c, e) | |
} | |
return this.accountModule(r) | |
}, | |
multiplyAccordingWeight: function(t, n) { | |
var r = [2, 7, 6, 5, 4, 3, 2]; | |
return t * r[n] | |
}, | |
accountModule: function(t) { | |
var n = t % 11; | |
return 0 === n ? "0" : 1 === n ? "P" : (11 - n).toString() | |
}, | |
calculateAgency: function(t) { | |
for (var n = t.split(""), r = 0, e = 0; e < n.length; e++) seq = 5 - e, r += parseInt(n[e]) * seq; | |
return this.agencyModule(r) | |
}, | |
agencyModule: function(t) { | |
var n = 11 - t % 11; | |
return 10 === n ? "P" : 11 === n ? "0" : n.toString() | |
} | |
}, r.BradescoCheckNumberCalculator = n() | |
}(window); | |
! function(n) { | |
function c() { | |
if (!(this instanceof c)) return new c | |
} | |
var e = n.Moip || {}; | |
n.Moip = e, c.prototype = { | |
agencyNumberIsValid: function(n) { | |
return e.CommonBankAccountValidator.agencyNumberIsValid(n) | |
}, | |
agencyCheckNumberIsValid: function(n) { | |
return n.length == this.agencyCheckNumberLength() && e.CommonBankAccountValidator.agencyCheckNumberIsValid(n) | |
}, | |
accountNumberIsValid: function(n) { | |
return n.length == this.accountNumberLength() && e.CommonBankAccountValidator.accountNumberIsValid(n) | |
}, | |
accountCheckNumberIsValid: function(n) { | |
return e.CommonBankAccountValidator.accountCheckNumberIsValid(n) | |
}, | |
agencyCheckNumberMatch: function(n) { | |
var c = e.BradescoCheckNumberCalculator.calculateAgency(n.agencyNumber), | |
r = n.agencyCheckNumber.toUpperCase(); | |
return "0" === r && (r = "P"), c === r | |
}, | |
accountCheckNumberMatch: function(n) { | |
var c = e.BradescoCheckNumberCalculator.calculateAccount(n.accountNumber); | |
return "P" == c && "0" == n.accountCheckNumber.toUpperCase() || c === n.accountCheckNumber.toUpperCase() | |
}, | |
agencyNumberMsgError: function() { | |
return e.CommonBankAccountValidator.agencyNumberMsgError() | |
}, | |
agencyCheckNumberMsgError: function() { | |
return e.CommonBankAccountValidator.agencyCheckNumberMsgError(this.agencyCheckNumberLength()) | |
}, | |
accountNumberMsgError: function() { | |
return e.CommonBankAccountValidator.accountNumberMsgError(this.accountNumberLength()) | |
}, | |
agencyCheckNumberLength: function() { | |
return 1 | |
}, | |
accountNumberLength: function() { | |
return 7 | |
} | |
}, e.BradescoValidator = c() | |
}(window); | |
! function(n) { | |
function r() { | |
if (!(this instanceof r)) return new r | |
} | |
var c = n.Moip || {}; | |
n.Moip = c, r.prototype = { | |
agencyNumberIsValid: function(n) { | |
return c.CommonBankAccountValidator.agencyNumberIsValid(n) | |
}, | |
agencyCheckNumberIsValid: function(n) { | |
return void 0 === n || "" === n | |
}, | |
accountNumberIsValid: function(n) { | |
return n.length == this.accountNumberLength() && c.CommonBankAccountValidator.accountNumberIsValid(n) | |
}, | |
accountCheckNumberIsValid: function(n) { | |
return c.CommonBankAccountValidator.accountCheckNumberIsValid(n) | |
}, | |
agencyCheckNumberMatch: function(n) { | |
return !0 | |
}, | |
accountCheckNumberMatch: function(n) { | |
return !0 | |
}, | |
agencyNumberMsgError: function() { | |
return c.CommonBankAccountValidator.agencyNumberMsgError() | |
}, | |
agencyCheckNumberMsgError: function() { | |
return c.CommonBankAccountValidator.agencyCheckNumberMsgError() | |
}, | |
accountNumberMsgError: function() { | |
return c.CommonBankAccountValidator.accountNumberMsgError(this.accountNumberLength()) | |
}, | |
accountNumberLength: function() { | |
return 7 | |
} | |
}, c.CitibankValidator = r() | |
}(window); | |
! function(e) { | |
function n() { | |
if (!(this instanceof n)) return new n | |
} | |
var r = e.Moip || {}; | |
e.Moip = r, n.prototype = { | |
agencyNumberIsValid: function(e) { | |
return /^(?!0000)([0-9]{4})$/.test(e) | |
}, | |
agencyCheckNumberIsValid: function(e) { | |
return /^[a-zA-Z0-9]{0,1}$/.test(e) | |
}, | |
accountNumberIsValid: function(e) { | |
return /^[0-9]{1,12}$/.test(e) && parseInt(e) > 0 | |
}, | |
accountCheckNumberIsValid: function(e) { | |
return /^[a-zA-Z0-9]{1}$/.test(e) | |
}, | |
agencyNumberMsgError: function(e) { | |
return void 0 === e && (e = this.agencyNumberLength()), "A agência deve conter " + e + " números. Complete com zeros a esquerda se necessário." | |
}, | |
agencyCheckNumberMsgError: function(e) { | |
return void 0 === e || 0 === e ? "O dÃgito da agência deve ser vazio" : 1 === e ? "O dÃgito da agência deve conter 1 dÃgito" : "O dÃgito da agência deve conter " + e + " números. Complete com zeros a esquerda se necessário." | |
}, | |
accountNumberMsgError: function(e) { | |
return "A conta corrente deve conter " + e + " números. Complete com zeros a esquerda se necessário." | |
}, | |
agencyNumberLength: function() { | |
return 4 | |
} | |
}, r.CommonBankAccountValidator = n() | |
}(window); | |
! function(n) { | |
function t() { | |
if (!(this instanceof t)) return new t | |
} | |
var r = n.Moip || {}; | |
n.Moip = r, t.prototype = { | |
bankNumberIsValid: function(n) { | |
return /^([0-9-A-Za-x]{3,5})$/.test(n) | |
}, | |
agencyNumberIsValid: function(n) { | |
return /^[0-9]{1,5}$/.test(n) && parseInt(n) > 0 | |
}, | |
agencyCheckNumberIsValid: function(n) { | |
return /^[a-zA-Z0-9]{0,2}$/.test(n) | |
}, | |
accountNumberIsValid: function(n) { | |
return /^[0-9]{1,12}$/.test(n) && parseInt(n) > 0 | |
}, | |
accountCheckNumberIsValid: function(n) { | |
return /^[a-zA-Z0-9]{0,2}$/.test(n) | |
}, | |
agencyCheckNumberMatch: function(n) { | |
return !0 | |
}, | |
accountCheckNumberMatch: function(n) { | |
return !0 | |
}, | |
agencyNumberMsgError: function(n) { | |
return "Agência inválida" | |
}, | |
agencyCheckNumberMsgError: function() { | |
return "DÃgito da agência inválido" | |
}, | |
accountNumberMsgError: function(n) { | |
return "Conta corrente inválida" | |
} | |
}, r.GenericBankAccountValidator = t() | |
}(window); | |
! function(n) { | |
function r() { | |
if (!(this instanceof r)) return new r | |
} | |
var c = n.Moip || {}; | |
n.Moip = c, r.prototype = { | |
agencyNumberIsValid: function(n) { | |
return c.CommonBankAccountValidator.agencyNumberIsValid(n) | |
}, | |
agencyCheckNumberIsValid: function(n) { | |
return void 0 === n || "" === n | |
}, | |
accountNumberIsValid: function(n) { | |
return n.length == this.accountNumberLength() && c.CommonBankAccountValidator.accountNumberIsValid(n) | |
}, | |
accountCheckNumberIsValid: function(n) { | |
return !0 | |
}, | |
agencyCheckNumberMatch: function(n) { | |
return !0 | |
}, | |
accountCheckNumberMatch: function(n) { | |
return !0 | |
}, | |
agencyNumberMsgError: function() { | |
return c.CommonBankAccountValidator.agencyNumberMsgError() | |
}, | |
agencyCheckNumberMsgError: function() { | |
return c.CommonBankAccountValidator.agencyCheckNumberMsgError() | |
}, | |
accountNumberMsgError: function() { | |
return c.CommonBankAccountValidator.accountNumberMsgError(this.accountNumberLength()) | |
}, | |
accountNumberLength: function() { | |
return 6 | |
} | |
}, c.HSBCValidator = r() | |
}(window); | |
! function(t) { | |
function n() { | |
if (!(this instanceof n)) return new n | |
} | |
var r = t.Moip || {}; | |
t.Moip = r, n.prototype = { | |
calculate: function(t, n) { | |
for (var r = (t + n).split(""), i = 0, o = 0, u = 0; u < r.length; u++) { | |
var c = parseInt(r[u]); | |
o = this.multiplyAccordingParity(c, u), o = this.adjustAccordingLength(o), i += o | |
} | |
return this.module(i) | |
}, | |
multiplyAccordingParity: function(t, n) { | |
return t * (n % 2 === 0 ? 2 : 1) | |
}, | |
adjustAccordingLength: function(t) { | |
if (t > 9) { | |
var n = t.toString().split(""); | |
t = 0; | |
for (var r = 0; r < n.length; r++) t += parseInt(n[r]) | |
} | |
return t | |
}, | |
module: function(t) { | |
var n = t % 10; | |
return 0 === n ? "0" : (10 - n).toString() | |
} | |
}, r.ItauCheckNumberCalculator = n() | |
}(window); | |
! function(n) { | |
function r() { | |
if (!(this instanceof r)) return new r | |
} | |
var c = n.Moip || {}; | |
n.Moip = c, r.prototype = { | |
agencyNumberIsValid: function(n) { | |
return c.CommonBankAccountValidator.agencyNumberIsValid(n) | |
}, | |
agencyCheckNumberIsValid: function(n) { | |
return void 0 === n || "" === n | |
}, | |
accountNumberIsValid: function(n) { | |
return n.length == this.accountNumberLength() && c.CommonBankAccountValidator.accountNumberIsValid(n) | |
}, | |
accountCheckNumberIsValid: function(n) { | |
return c.CommonBankAccountValidator.accountCheckNumberIsValid(n) | |
}, | |
agencyCheckNumberMatch: function(n) { | |
return !0 | |
}, | |
accountCheckNumberMatch: function(n) { | |
var r = c.ItauCheckNumberCalculator.calculate(n.agencyNumber, n.accountNumber); | |
return r === n.accountCheckNumber | |
}, | |
agencyNumberMsgError: function() { | |
return c.CommonBankAccountValidator.agencyNumberMsgError() | |
}, | |
agencyCheckNumberMsgError: function() { | |
return c.CommonBankAccountValidator.agencyCheckNumberMsgError() | |
}, | |
accountNumberMsgError: function() { | |
return c.CommonBankAccountValidator.accountNumberMsgError(this.accountNumberLength()) | |
}, | |
accountNumberLength: function() { | |
return 5 | |
} | |
}, c.ItauValidator = r() | |
}(window); | |
! function(n) { | |
function r() { | |
if (!(this instanceof r)) return new r | |
} | |
var c = n.Moip || {}; | |
n.Moip = c, r.prototype = { | |
agencyNumberIsValid: function(n) { | |
return c.CommonBankAccountValidator.agencyNumberIsValid(n) | |
}, | |
agencyCheckNumberIsValid: function(n) { | |
return void 0 === n || "" === n | |
}, | |
accountNumberIsValid: function(n) { | |
return n.length == this.accountNumberLength() && c.CommonBankAccountValidator.accountNumberIsValid(n) | |
}, | |
accountCheckNumberIsValid: function(n) { | |
return c.CommonBankAccountValidator.accountCheckNumberIsValid(n) | |
}, | |
agencyCheckNumberMatch: function(n) { | |
return !0 | |
}, | |
accountCheckNumberMatch: function(n) { | |
return !0 | |
}, | |
agencyNumberMsgError: function() { | |
return c.CommonBankAccountValidator.agencyNumberMsgError() | |
}, | |
agencyCheckNumberMsgError: function() { | |
return c.CommonBankAccountValidator.agencyCheckNumberMsgError() | |
}, | |
accountNumberMsgError: function() { | |
return c.CommonBankAccountValidator.accountNumberMsgError(this.accountNumberLength()) | |
}, | |
accountNumberLength: function() { | |
return 8 | |
} | |
}, c.SantanderValidator = r() | |
}(window); | |
this.warren = this.warren || {}, this.warren.utils = this.warren.utils || {}, this.warren.utils.easing = this.warren.utils.easing || {}, | |
function() { | |
"use strict"; | |
function t(t) { | |
return function(n, u, r) { | |
return r = Math.pow(r, t), (1 - r) * n + r * u | |
} | |
} | |
function n(t) { | |
return function(n, u, r) { | |
return r = 1 - Math.pow(1 - r, t), (1 - r) * n + r * u | |
} | |
} | |
function u(t) { | |
return function(n, u, r) { | |
return r = (r *= 2) < 1 ? .5 * Math.pow(r, t) : 1 - .5 * Math.abs(Math.pow(2 - r, t)), (1 - r) * n + r * u | |
} | |
} | |
var r = warren.utils.easing; | |
r.lerp = function(t, n, u) { | |
return (1 - u) * t + u * n | |
}, r.linear = r.lerp, r.quadIn = t(2), r.quadOut = n(2), r.quadInOut = u(2), r.cubicIn = t(3), r.cubicOut = n(3), r.cubicInOut = u(3), r.quartIn = t(4), r.quartOut = n(4), r.quartInOut = u(4), r.quintIn = t(5), r.quintOut = n(5), r.quintInOut = u(5), r.sineIn = function(t, n, u) { | |
return u = 1 - Math.cos(u * Math.PI / 2), (1 - u) * t + u * n | |
}, r.sineOut = function(t, n, u) { | |
return u = Math.sin(u * Math.PI / 2), (1 - u) * t + u * n | |
}, r.sineInOut = function(t, n, u) { | |
return u = -.5 * (Math.cos(Math.PI * u) - 1), (1 - u) * t + u * n | |
} | |
}(); | |
this.warren = this.warren || {}, this.warren.utils = this.warren.utils || {}, this.warren.utils.random = this.warren.utils.random || {}, | |
function() { | |
"use strict"; | |
var r = warren.utils.random; | |
r.choice = function(r) { | |
return r[Math.floor(r.length * Math.random())] | |
} | |
}(); | |
this.warren = this.warren || {}, this.warren.utils = this.warren.utils || {}, this.warren.utils.search = this.warren.utils.search || {}, | |
function() { | |
"use strict"; | |
var e = warren.utils.search; | |
e.allFilter = function(e, r, t, n) { | |
n = n || {}; | |
for (var s = "undefined" == typeof n.maxResults ? -1 : n.maxResults, a = [], i = 0; i < r.length; i++) { | |
var u = r[i]; | |
t && (u = t(u)), a.push(u) | |
} | |
return s >= 0 && (a = a.slice(0, s)), a | |
}, e.exactFilter = function(r, t, n, s) { | |
if (!r) return e.allFilter(r, t, n, s); | |
s = s || {}; | |
var a = "undefined" == typeof s.ignoreCase || s.ignoreCase, | |
i = "undefined" == typeof s.trim || s.trim, | |
u = "undefined" == typeof s.maxResults ? -1 : s.maxResults; | |
a && (r = r.toLowerCase()), i && (r = r.trim()); | |
for (var l = [], f = 0; f < t.length; f++) { | |
var h = t[f]; | |
a && (h = h.toLowerCase()), 0 === h.indexOf(r) && (n && (h = n(h)), l.push(h)) | |
} | |
return u >= 0 && (l = l.slice(0, u)), l | |
}, e.fuzzyFilter = function(r, t, n, s) { | |
if (!r) return e.allFilter(r, t, n, s); | |
s = s || {}, s.maxPatternLength || (s.maxPatternLength = 100); | |
for (var a = "undefined" == typeof s.maxResults ? -1 : s.maxResults, i = new Fuse(t, s), u = i.search(r), l = [], f = 0; f < u.length; f++) { | |
var h = t[u[f]]; | |
n && (h = n(h)), l.push(h) | |
} | |
return a >= 0 && (l = l.slice(0, a)), l | |
} | |
}(); | |
angular.module("warren", ["ngMessages", "ngAnimate", "ngFileUpload", "ui.router", "ui.mask", "ngMask", "templates", "resources", "angular.filter", "720kb.tooltips", "warren.common.directives.autoresize", "warren.common.directives.charts.donutchart", "warren.common.directives.charts.futurechart", "warren.common.directives.charts.barchart", "warren.common.directives.charts.performancechart", "warren.common.directives.charts.fundchart", "warren.common.directives.curtain", "warren.common.directives.date", "warren.common.directives.escape", "warren.common.directives.focusif", "warren.common.directives.jumpwith", "warren.common.directives.script", "warren.common.directives.smoothscroll", "warren.common.directives.sticky", "warren.common.directives.typewrite", "warren.common.directives.inputrisk", "warren.common.directives.keepbottom", "warren.common.directives.showafter", "warren.common.directives.focusafter", "warren.common.directives.whenscrolled", "warren.common.filters.asset", "warren.common.filters.cpf", "warren.common.filters.safehtml", "warren.common.filters.money", "warren.common.filters.percentage", "warren.common.filters.reverse", "warren.common.filters._s", "warren.common.filters._sa", "warren.common.filters._qs", "warren.common.filters._link", "warren.common.filters._value", "warren.common.filters.notypewriter", "warren.common.filters.trust", "warren.common.filters.datetime", "warren.common.masks.currency", "warren.common.masks.bankcurrency", "warren.common.models.portfolio", "warren.common.models.transaction", "warren.common.models.user", "warren.common.models.post", "warren.common.models.invites", "warren.common.models.notifications", "warren.common.models.crm", "warren.common.services.analytics", "warren.common.services.dialog", "warren.common.services.backend", "warren.common.services.context", "warren.common.services.crash", "warren.common.services.facebook", "warren.common.services.flash", "warren.common.services.history", "warren.common.services.maps", "warren.common.services.moip", "warren.common.services.session", "warren.common.services.smoothscroll", "warren.common.services.resources", "warren.common.services.webcam", "warren.common.services.connectionflash", "warren.common.services.clipboard", "warren.common.services.moment", "warren.common.services.weekdays", "warren.common.services.chartist", "warren.common.services.c3", "warren.common.services.waitlist", "warren.common.services.path", "warren.common.services.promise", "warren.common.services.zendesk", "warren.common.services.theme", "warren.common.validators.cpf", "warren.common.validators.date", "warren.common.validators.maxdate", "warren.common.validators.mindate", "warren.common.validators.whitelist", "warren.common.validators.match", "warren.common.validators.minstrings", "warren.common.validators.email", "warren.common.validators.any", "warren.common.validators.all", "warren.common.validators.minvalue", "warren.components.account.bankaccounts", "warren.components.account.contacts", "warren.components.account.documents", "warren.components.account.finances", "warren.components.account.personal", "warren.components.dashheader", "warren.components.header", "warren.components.loader", "warren.components.stylemenu", "warren.components.suitability", "warren.components.suitability.buttons", "warren.components.suitability.input", "warren.components.suitability.message", "warren.components.wizard", "warren.components.usermenu", "warren.components.notifications", "warren.components.sharepanel", "warren.pages.404", "warren.pages.incognito", "warren.pages.about", "warren.pages.builder", "warren.pages.builder.chat", "warren.pages.builder.edit", "warren.pages.builder.summary", "warren.pages.builder.name", "warren.pages.dash", "warren.pages.startregisterfaq", "warren.pages.history", "warren.pages.home", "warren.pages.line", "warren.pages.lineplace", "warren.pages.lineregister", "warren.pages.ricometro", "warren.pages.ricometroResult", "warren.pages.loseometer", "warren.pages.loseometerResult", "warren.pages.teaser", "warren.pages.portfolio", "warren.pages.portfolio.edit", "warren.pages.portfolio.editgroup", "warren.pages.portfolio.directives.deposit", "warren.pages.portfolio.directives.invoice", "warren.pages.portfolio.directives.withdraw", "warren.pages.portfolio.directives.photos", "warren.pages.portfoliogroupaccept", "warren.pages.portfoliogroupinvites", "warren.pages.post", "warren.pages.posts", "warren.pages.profile", "warren.pages.register", "warren.pages.register.directives.fadein", "warren.pages.register.step1", "warren.pages.register.step2", "warren.pages.register.step3", "warren.pages.register.step4", "warren.pages.reset", "warren.pages.resetpassword", "warren.pages.setup", "warren.pages.instantlogin", "warren.pages.instantloginintranet", "warren.pages.signin", "warren.pages.signout", "warren.pages.signup", "warren.pages.style", "warren.pages.style.assets", "warren.pages.style.buttons", "warren.pages.style.colors", "warren.pages.style.components", "warren.pages.style.forms", "warren.pages.style.javascript", "warren.pages.style.layout", "warren.pages.style.typography", "warren.pages.suitability", "warren.pages.team", "warren.pages.transactions", "warren.pages.deposits", "warren.pages.fundsdata", "warren.pages.deposit", "warren.pages.invoice", "warren.pages.withdraw", "warren.pages.withdrawals", "warren.pages.user", "warren.pages.user.account", "warren.pages.user.contact", "warren.pages.user.email", "warren.pages.user.notifications", "warren.pages.user.password", "warren.pages.user.riskprofile", "warren.pages.user.terms", "warren.pages.user.quotes", "warren.pages.quotes", "warren.pages.unsubscribe", "warren.pages.verifiedemail", "warren.pages.test"]); | |
! function() { | |
"use strict"; | |
angular.module("warren").constant("config", { | |
app: { | |
wizard: { | |
timeout: 1500 | |
}, | |
connection: { | |
timeslow: 1e4, | |
timeout: 3e4, | |
timeretry: 2e3 | |
} | |
}, | |
google: { | |
analytics: { | |
key: "UA-57376500-2" | |
} | |
}, | |
facebook: { | |
appId: "1636715299924634", | |
apiVersion: "v2.5" | |
}, | |
environment: { | |
key: "prd", | |
name: "production", | |
port: "443", | |
api: "https://api.oiwarren.com", | |
assets: "http://test.oiwarren.com.s3-website-us-east-1.amazonaws.com/" | |
}, | |
stylesheets: { | |
app: "app-pink-3b47c9b.css", | |
vendor: "vendor-55db1cd.min.css" | |
} | |
}), angular.module("warren").value("uiMaskConfig", { | |
maskDefinitions: { | |
9: /\d/, | |
A: /[a-zA-Z]/, | |
"*": /[a-zA-Z0-9]/ | |
}, | |
clearOnBlur: !1, | |
eventsToHandle: ["input", "keyup", "click", "focus"] | |
}) | |
}(); | |
angular.module("warren").config(["$compileProvider", function(n) { | |
n.debugInfoEnabled(!1), n.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|whatsapp):/) | |
}]).run(["wrnAnalytics", function(n) { | |
try { | |
n.start() | |
} catch (n) {} | |
}]).run(["$rootScope", "$state", function(n, t) { | |
n.noScrollBody = !1, n.setScrollBody = function(t) { | |
"undefined" == typeof t ? n.noScrollBody = !n.noScrollBody : n.noScrollBody = t | |
}, n.getCurrentRoute = function() { | |
var n = t.current.name, | |
e = n.indexOf("_"); | |
return e > 0 ? n.substring(0, e) : n | |
} | |
}]).run(["$rootScope", "wrnSmoothScroll", function(n, t) { | |
n.$on("$stateChangeSuccess", function(e, o, r, i, c) { | |
t.toPosition(0), n.setScrollBody(!1) | |
}) | |
}]).run(["$rootScope", "wrnAnalytics", function(n, t) { | |
n.event = function(n, e, o, r) { | |
if (n && e) try { | |
t.event(n, e, o, r) | |
} catch (n) {} | |
}, n.timing = function(n, e, o, r) { | |
if (n && e && o) try { | |
t.timing(n, e, o, r) | |
} catch (n) {} | |
} | |
}]).run(["$rootScope", "$state", "wrnSession", "wrnUser", "$q", "wrnTheme", function(n, t, e, o, r, i) { | |
function c(n, c, a, s, u) { | |
if (c.auth) | |
if (e.isEmpty("accounts.accessToken")) { | |
var f = c.name; | |
n.preventDefault(), t.go("signin", { | |
backTo: f, | |
params: JSON.stringify(a) | |
}) | |
} else r.all([o.become()]).then(function(n) { | |
var e = o.isBlack() ? "black" : "pink"; | |
i.setTheme(e), n[0].goWaitList && t.go("dash") | |
}, function(n) { | |
console.error(n), "discardAccessToken" === n.suggestedAction && (e.remove("accounts.accessToken"), e.remove("session.welcome"), t.go("signin")) | |
}) | |
} | |
n.$on("$stateChangeStart", c) | |
}]).run(["$rootScope", "wrnResources", function(n, t) { | |
n._s = t.getString, n._sa = t.getStringArray, n._qs = t.getQuantityString, n._v = t.getValue | |
}]).run(["$rootScope", "wrnClipboard", function(n, t) { | |
n.isSafari = warren.utils.isSafari, n.supportsCopy = t.isSupported | |
}]).run([function() { | |
window.addEventListener("keydown", function(n) { | |
if ("U+0008" === n.key || "Backspace" === n.key || 8 === n.keyCode) { | |
var t = n.target.nodeName.toLowerCase(); | |
if ("input" !== t && "textarea" !== t || "checkbox" === n.target.type || "radio" === n.target.type) return n.preventDefault(), !1 | |
} else if ("Enter" === n.key || 13 === n.keyCode) { | |
var e = document.getElementById("wrnClickOnEnter"); | |
if (e) try { | |
e.click() | |
} catch (n) {} | |
} | |
}, !0) | |
}]); | |
! function() { | |
"use strict"; | |
angular.module("warren").config(["$stateProvider", "$urlRouterProvider", function(e, t) { | |
t.when("", "/dash"), e.state("home", { | |
url: "/?affiliate&home&referralId", | |
template: "<warren-home></warren-home>" | |
}).state("loseometer", { | |
url: "/descubra", | |
template: "<warren-loseometer></warren-loseometer>" | |
}).state("ricometro", { | |
url: "/aproveitando-a-vida", | |
template: "<warren-ricometro></warren-ricometro>" | |
}).state("line", { | |
url: "/fila", | |
template: "<warren-line></warren-line>" | |
}).state("lineplace", { | |
url: "/fila/seu-lugar", | |
template: "<warren-lineplace></warren-lineplace>" | |
}).state("lineregister", { | |
url: "/fila/cadastro", | |
template: "<warren-lineregister></warren-lineregister>", | |
params: { | |
name: null, | |
email: null | |
} | |
}).state("loseometer-result", { | |
url: "/descubra/resultado", | |
template: "<warren-loseometer-result></warren-loseometer-result>", | |
params: { | |
salary: null | |
} | |
}).state("ricometro-result", { | |
url: "/aproveitando-a-vida/resultado", | |
template: "<warren-ricometro-result></warren-ricometro-result>", | |
params: { | |
salary: null | |
} | |
}).state("teaser", { | |
url: "/teaser?affiliate", | |
template: "<warren-teaser></warren-teaser>" | |
}).state("test", { | |
url: "/__test", | |
template: "<warren-test></warren-test>" | |
}).state("about", { | |
url: "/sobre", | |
template: "<warren-about></warren-about>" | |
}).state("funds-data", { | |
url: "/fundos", | |
template: "<warren-funds-data></warren-funds-data>" | |
}).state("team", { | |
url: "/time", | |
template: "<warren-team></warren-team>" | |
}).state("profile", { | |
url: "/profile/:profile?suitability", | |
template: "<warren-profile></warren-profile>" | |
}).state("signin", { | |
url: "/signin?backTo¶ms", | |
template: "<warren-signin></warren-signin>" | |
}).state("instantlogin", { | |
url: "/instant-login/:hash?backTo¶ms", | |
template: "<warren-instant-login></warren-instant-login>" | |
}).state("instantloginintranet", { | |
url: "/instant-login-intranet/:hash?backTo¶ms", | |
template: "<warren-instant-login-intranet></warren-instant-login-intranet>" | |
}).state("signup", { | |
url: "/signup", | |
template: "<warren-signup></warren-signup>" | |
}).state("signout", { | |
url: "/signout", | |
template: "<warren-signout></warren-signout>" | |
}).state("setup", { | |
url: "/setup/:token?backTo", | |
template: "<warren-setup></warren-setup>" | |
}).state("summary", { | |
url: "/summary", | |
template: "<warren-summary></warren-summary>" | |
}).state("reset", { | |
url: "/reset", | |
template: "<warren-reset></warren-reset>" | |
}).state("reset-password", { | |
url: "/reset-password/:token", | |
template: "<warren-reset-password></warren-reset-password>" | |
}).state("suitability", { | |
url: "/suitability?affiliate&home&referralId&context", | |
template: "<warren-suitability></warren-suitability>" | |
}).state("verifiedemail", { | |
url: "/verify-email/:hash", | |
template: "<warren-verifiedemail></warren-verifiedemail>" | |
}).state("post", { | |
url: "/post/:id?backTo", | |
template: "<warren-post></warren-post>" | |
}).state("posts", { | |
url: "/posts", | |
template: "<warren-posts></warren-posts>" | |
}).state("unsubscribe", { | |
url: "/unsubscribe/:token", | |
template: "<warren-unsubscribe></warren-unsubscribe>" | |
}).state("portfoliogroupaccept", { | |
url: "/portfolio-group-accept/:id/:token", | |
template: "<warren-portfolio-group-accept></warren-portfolio-group-accept>" | |
}).state("dash", { | |
url: "/dash", | |
template: "<warren-dash></warren-dash>", | |
auth: !0 | |
}).state("startregisterfaq", { | |
url: "/cadastro-faq", | |
template: "<warren-start-register-faq></warren-start-register-faq>", | |
auth: !0 | |
}).state("builder", { | |
url: "/builder", | |
template: "<warren-builder></warren-builder>", | |
auth: !0 | |
}).state("register", { | |
url: "/register", | |
template: "<warren-register></warren-register>", | |
auth: !0 | |
}).state("portfolio", { | |
url: "/portfolio/:id?action&deposit&invoice", | |
template: "<warren-portfolio></warren-portfolio>", | |
auth: !0 | |
}).state("portfoliogroupinvites", { | |
url: "/portfolio-invites/:id?builder", | |
template: "<warren-portfolio-group-invites></warren-portfolio-group-invites>", | |
auth: !0 | |
}).state("history", { | |
url: "/history", | |
template: "<warren-history></warren-history>", | |
auth: !0 | |
}).state("transactions", { | |
url: "/transactions/:id?choice", | |
template: "<warren-transactions></warren-transactions>", | |
auth: !0 | |
}).state("deposits", { | |
url: "/deposits/:id?backTo", | |
template: "<warren-deposits></warren-deposits>", | |
auth: !0 | |
}).state("deposit", { | |
url: "/deposit/:id", | |
template: "<warren-deposit></warren-deposit>", | |
auth: !0 | |
}).state("invoice", { | |
url: "/invoice/:id", | |
template: "<warren-invoice></warren-invoice>", | |
auth: !0 | |
}).state("withdraw", { | |
url: "/withdraw/:id", | |
template: "<warren-withdraw></warren-withdraw>", | |
auth: !0 | |
}).state("withdrawals", { | |
url: "/withdrawals/:id?backTo", | |
template: "<warren-withdrawals></warren-withdrawals>", | |
auth: !0 | |
}).state("user", { | |
url: "/user", | |
template: "<warren-user></warren-user>", | |
abstract: !0, | |
auth: !0 | |
}).state("user.account", { | |
url: "/account", | |
template: "<warren-user-account></warren-user-account>", | |
auth: !0 | |
}).state("user.riskprofile", { | |
url: "/riskprofile", | |
template: "<warren-user-riskprofile></warren-user-riskprofile>", | |
auth: !0 | |
}).state("user.email", { | |
url: "/email", | |
template: "<warren-user-email></warren-user-email>", | |
auth: !0 | |
}).state("user.password", { | |
url: "/password", | |
template: "<warren-user-password></warren-user-password>", | |
auth: !0 | |
}).state("user.contact", { | |
url: "/contact", | |
template: "<warren-user-contact></warren-user-contact>", | |
auth: !0 | |
}).state("user.notifications", { | |
url: "/notifications", | |
template: "<warren-user-notifications></warren-user-notifications>", | |
auth: !0 | |
}).state("user.terms", { | |
url: "/terms", | |
template: "<warren-user-terms></warren-user-terms>", | |
auth: !0 | |
}).state("user.quotes", { | |
url: "/meus-investimentos", | |
template: "<warren-user-quotes></warren-user-quotes>", | |
auth: !0 | |
}).state("quotes", { | |
url: "/quotes/:fundId", | |
template: "<warren-quotes></warren-quotes>", | |
auth: !0 | |
}).state("404", { | |
url: "/404", | |
template: "<warren-404></warren-404>" | |
}).state("incognito", { | |
url: "/incognito", | |
template: "<warren-incognito></warren-incognito>" | |
}).state("style", { | |
url: "/style", | |
template: "<warren-style></warren-style>" | |
}).state("style-typography", { | |
url: "/style/typography", | |
template: "<warren-style-typography></warren-style-typography>" | |
}).state("style-buttons", { | |
url: "/style/buttons", | |
template: "<warren-style-buttons></warren-style-buttons>" | |
}).state("style-assets", { | |
url: "/style/assets", | |
template: "<warren-style-assets></warren-style-assets>" | |
}).state("style-colors", { | |
url: "/style/colors", | |
template: "<warren-style-colors></warren-style-colors>" | |
}).state("style-layout", { | |
url: "/style/layout", | |
template: "<warren-style-layout></warren-style-layout>" | |
}).state("style-forms", { | |
url: "/style/forms", | |
template: "<warren-style-forms></warren-style-forms>" | |
}).state("style-components", { | |
url: "/style/components", | |
template: "<warren-style-components></warren-style-components>" | |
}).state("style-javascript", { | |
url: "/style/javascript", | |
template: "<warren-style-javascript></warren-style-javascript>" | |
}), t.otherwise(function(e) { | |
var t = e.get("$state"); | |
t.go("404", null, { | |
location: !1 | |
}) | |
}) | |
}]) | |
}(); | |
! function() { | |
"use strict"; | |
function a(a, t, e, r, n) { | |
function o(t, e, o, i) { | |
function s() { | |
var a, o = ["x"], | |
i = ["projection"], | |
s = ["warren"], | |
u = []; | |
if (t.isFull) { | |
var h, p; | |
for (a = 0; a < t.dateRange.length - 1; a++) h = n(t.dateRange[a]).month(), p = n(t.dateRange[a + 1]).month(), p != h && (o.push(n(t.dateRange[a]).format("MMM/YY")), u.push(a)); | |
for (o.push(n(t.dateRange[t.dateRange.length - 1]).format("MMM/YY")), u.push(t.dateRange.length - 1), a = 0; a < u.length; a++) 0 == u[a] ? (i.push(t.projectionData[u[a]]), s.push(t.warrenData[u[a]])) : (i.push(t.projectionData[u[a]] - t.projectionData[u[a] - 1]), s.push(t.warrenData[u[a]] - t.warrenData[u[a] - 1])) | |
} else { | |
for (a = 0; a < t.dateRange.length; a++) o.push(n(t.dateRange[a]).format("DD MMM YY")), u.push(a); | |
for (i.push(t.projectionData[0]), a = 1; a < t.projectionData.length; a++) i.push(t.projectionData[a] - t.projectionData[a - 1]); | |
for (t.warrenData[0] && s.push(t.warrenData[0]), a = 1; a < t.warrenData.length; a++) s.push(t.warrenData[a] - t.warrenData[a - 1]) | |
} | |
l = r.generate({ | |
grid: { | |
lines: { | |
front: !1 | |
}, | |
x: { | |
show: !1 | |
}, | |
y: { | |
show: !1, | |
lines: [{ | |
value: 0, | |
text: "", | |
position: "start" | |
}] | |
} | |
}, | |
bindto: e.children()[0], | |
padding: { | |
right: 20, | |
left: 20 | |
}, | |
data: { | |
colors: { | |
projection: "#696A75", | |
warren: "#0581FF" | |
}, | |
type: "bar", | |
x: "x", | |
names: { | |
projection: "Projetado", | |
warren: t.isVirtual ? "Rendimentos previstos" : "Realizado" | |
}, | |
columns: [o, i, s] | |
}, | |
axis: { | |
x: { | |
type: "categories", | |
tick: { | |
values: [0, Math.floor((u.length - 1) / 2), u.length - 1] | |
} | |
}, | |
y: { | |
show: !1, | |
tick: { | |
count: 4, | |
format: function(a, t, e) { | |
var r = c.format(".2%"); | |
return r(a).replace(".", ",") | |
} | |
} | |
} | |
}, | |
tooltip: { | |
format: { | |
value: function(a, t, e) { | |
var r = c.format(".2%"); | |
return r(a).replace(".", ",") | |
} | |
} | |
} | |
}) | |
} | |
var l = null, | |
c = a.d3; | |
s() | |
} | |
return { | |
restrict: "E", | |
template: '<div class="wrn-line-chart wrn-bar-chart"></div>', | |
link: o, | |
scope: { | |
dateRange: "=", | |
warrenData: "=", | |
projectionData: "=", | |
warrenEnabled: "=", | |
savingsEnabled: "=", | |
projectionEnabled: "=", | |
isVirtual: "=", | |
isFull: "=" | |
} | |
} | |
} | |
angular.module("warren.common.directives.charts.barchart", []).directive("wrnBarChart", a), a.$inject = ["$window", "$filter", "$timeout", "c3", "moment"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t) { | |
function n(n, r, e, a) { | |
function c() { | |
return (o = t.d3) ? (g = n.radius || 40, l = 2 * g, d = 2 * g, h = n.thickness || 8, A = n.transition || 300, f = n.data || [], v = o.select(r.children()[0]).attr("width", l).attr("height", d).attr("viewBox", "0 0 " + l + " " + d).classed("wrn-chart wrn-chart-donut", !0), p = v.append("g").attr("transform", "translate(" + l / 2 + ", " + d / 2 + ")"), w = o.svg.arc().innerRadius(g - h - 1).outerRadius(g - 1).startAngle(function(t) { | |
return t.startAngle | |
}).endAngle(function(t) { | |
return t.endAngle | |
}), void n.$watch("data", function(t) { | |
i(t) | |
})) : void console.error("D3 has not been loaded!") | |
} | |
function i(t) { | |
var n = p.selectAll(".arc").data(u(t)); | |
n.transition().duration(A).attr("class", function(t, n) { | |
return "arc arc-" + n | |
}).attrTween("d", s), n.enter().append("path").attr("class", function(t, n) { | |
return "arc arc-" + n | |
}).attr("d", w).each(function(t) { | |
this._curStartAngle = t.startAngle, this._curEndAngle = t.endAngle | |
}) | |
} | |
function s(t, n) { | |
var r = this, | |
e = o.interpolate(r._curStartAngle, t.startAngle), | |
a = o.interpolate(r._curEndAngle, t.endAngle); | |
return r._curStartAngle = t.startAngle, r._curEndAngle = t.endAngle, | |
function(t) { | |
var r = { | |
startAngle: e(t), | |
endAngle: a(t) | |
}; | |
return w(r, n) | |
} | |
} | |
function u(t) { | |
var n, r = [], | |
e = 2 * Math.PI, | |
a = o.sum(t); | |
for (n = 0; n < t.length; n++) t[n] = t[n] / a; | |
var c = 0, | |
i = 0; | |
for (n = 0; n < t.length; n++) { | |
var s = t[n]; | |
c = i, i += e * s, r.push({ | |
startAngle: c, | |
endAngle: i | |
}) | |
} | |
return r | |
} | |
var o, l, d, g, h, A, f, v, p, w; | |
c() | |
} | |
return { | |
restrict: "E", | |
template: "<svg></svg>", | |
link: n, | |
scope: { | |
data: "=", | |
radius: "=", | |
thickness: "=", | |
transition: "=" | |
} | |
} | |
} | |
angular.module("warren.common.directives.charts.donutchart", []).directive("wrnDonutChart", t), t.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, e, r, a) { | |
function i(t, e, i, o) { | |
function f() { | |
var n = ["x"], | |
i = ["#EE2E5D", "#FF9001", "#00B563", "#0581FF", "#6960DA"], | |
o = {}, | |
f = {}, | |
h = []; | |
h.push(n); | |
for (var u = 0; u < t.info.chart.label.length; u++) { | |
var d = t.info.chart.label[u].slice(0, -1); | |
n.push(a(d).format("DD MMM YY")) | |
} | |
if (t.infoLength > 1) { | |
for (var s = 1; s < Object.keys(t.info.chart.data).length / i.length; s++) i = i.concat(i); | |
for (var s = 0; s < t.info.performances.length; s++) { | |
var g = t.info.performances[s]; | |
o[g.fund] = i[s], f[g.fund] = g.fundName, h.push([g.fund].concat(t.info.chart.data[g.fund])) | |
} | |
} else { | |
for (var s = 1; s < t.info.fundId / i.length; s++) i = i.concat(i); | |
o[t.info.fund] = i[t.info.fundId - 1], f[t.info.fund] = t.info.fundName, h.push([t.info.fund].concat(t.info.chart.data[t.info.fund])) | |
} | |
c = r.generate({ | |
grid: { | |
lines: { | |
front: !1 | |
}, | |
x: { | |
show: !1 | |
}, | |
y: { | |
show: !1, | |
lines: [{ | |
value: 0, | |
text: "", | |
position: "start" | |
}] | |
} | |
}, | |
bindto: t.infoLength > 1 ? e[0].children[0] : e[0].children[1], | |
padding: { | |
right: 20, | |
left: 20 | |
}, | |
data: { | |
type: "area", | |
x: "x", | |
colors: o, | |
names: f, | |
columns: h | |
}, | |
axis: { | |
x: { | |
type: "categories", | |
tick: { | |
values: [0, Math.floor((t.info.chart.label.length - 1) / 2), t.info.chart.label.length - 1] | |
} | |
}, | |
y: { | |
show: !1, | |
tick: { | |
count: 4, | |
format: function(n, t, e) { | |
var r = l.format(".2%"); | |
return r(n).replace(".", ",") | |
} | |
} | |
} | |
}, | |
tooltip: { | |
format: { | |
value: function(n, t, e) { | |
var r = l.format(".2%"); | |
return r(n).replace(".", ",") | |
} | |
} | |
} | |
}), 1 == t.infoLength && c.legend.hide(t.info.fund) | |
} | |
var c = null, | |
l = n.d3; | |
f() | |
} | |
return { | |
restrict: "E", | |
template: '<div class="wrn-line-chart wrn-line-chart-fund wrn-line-chart-fund-multiple" ng-show="infoLength > 1"></div><div class="wrn-line-chart wrn-line-chart-fund wrn-line-chart-fund-single" ng-show="infoLength == 1"></div>', | |
link: i, | |
scope: { | |
info: "=", | |
infoLength: "=" | |
} | |
} | |
} | |
angular.module("warren.common.directives.charts.fundchart", []).directive("wrnFundChart", n), n.$inject = ["$window", "$filter", "$timeout", "c3", "moment"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, e, a, t, r) { | |
function o(a, r, o, i) { | |
function s() { | |
var n = m(), | |
o = { | |
warrenMin: "MÃnimo esperado Warren", | |
warrenMax: "Máximo esperado Warren", | |
warren: "Warren" | |
}, | |
i = [ | |
["x"].concat(n.x), ["warren"].concat(n.warren), ["warrenMax"].concat(n.warrenMax), ["warrenMin"].concat(n.warrenMin) | |
]; | |
a.goalAmount && (o.goal = "Objetivo", i.push(["goal"].concat(n.goal))), g = t.generate({ | |
grid: { | |
lines: { | |
front: !1 | |
}, | |
x: { | |
show: !1 | |
}, | |
y: { | |
show: !1, | |
lines: [{ | |
value: 0, | |
text: "", | |
position: "start" | |
}] | |
} | |
}, | |
bindto: r[0].children[0], | |
padding: { | |
right: 20, | |
left: 20, | |
bottom: 20 | |
}, | |
data: { | |
colors: { | |
warren: "#0581FF", | |
warrenMin: "#92C8FF", | |
warrenMax: "#92C8FF", | |
goal: "#00B563" | |
}, | |
type: "area", | |
x: "x", | |
names: o, | |
columns: i | |
}, | |
axis: { | |
x: { | |
tick: { | |
count: 3, | |
fit: !0, | |
format: u, | |
values: [0, 12 * a.goalYears, n.x[n.x.length - 1]] | |
} | |
}, | |
y: { | |
padding: { | |
bottom: 0 | |
}, | |
min: 0, | |
show: !1 | |
} | |
}, | |
tooltip: { | |
format: { | |
value: function(n, a, t) { | |
return n = Math.round(n), e("money")(n, "R$ ", 0) | |
} | |
} | |
} | |
}), g.legend.hide("warrenMin"), g.legend.hide("warrenMax"), w = !0 | |
} | |
function l() { | |
function n(n) { | |
w && c() | |
} | |
a.$watch("goalAmount", n), a.$watch("goalYears", n), a.$watch("interest", n), a.$watch("minInterest", n), a.$watch("maxInterest", n), a.$watch("initialInvestment", n), a.$watch("monthlyInvestment", n) | |
} | |
function c() { | |
var n = m(), | |
e = [ | |
["x"].concat(n.x), ["warren"].concat(n.warren), ["warrenMax"].concat(n.warrenMax), ["warrenMin"].concat(n.warrenMin) | |
]; | |
a.goalAmount && e.push(["goal"].concat(n.goal)), g.internal.config.axis_x_tick_values = [0, 12 * a.goalYears, n.x[n.x.length - 1]], g.load({ | |
columns: e | |
}) | |
} | |
function u(n) { | |
if (0 === n) return "Hoje"; | |
if (n < 12) return 1 === n ? parseInt(n) + " mes" : parseInt(n) + " meses"; | |
var e = Math.floor(n / 12), | |
a = Math.floor(n % 12), | |
t = e; | |
return t += 1 === e ? " ano" : " anos", 1 === a ? t += " e " + a + " mes" : a > 1 && (t += " e " + a + " meses"), t | |
} | |
function m() { | |
var n, e = [], | |
t = [], | |
r = [], | |
o = [], | |
i = []; | |
n = a.goalYears > 50 ? a.goalYears + 10 : a.goalYears > 40 ? a.goalYears + 4 : a.goalYears > 30 ? a.goalYears + 3 : a.goalYears > 20 ? a.goalYears + 5 : a.goalYears > 15 ? a.goalYears + 10 : 2 * a.goalYears, n *= 12; | |
for (var s = 0; s < n + 1; s++) e.push(s), t.push(a.goalAmount), r.push(warren.finance.futureValue(a.initialInvestment, s, a.interest, a.monthlyInvestment)), o.push(warren.finance.futureValue(a.initialInvestment, s, a.minInterest, a.monthlyInvestment)), i.push(warren.finance.futureValue(a.initialInvestment, s, a.maxInterest, a.monthlyInvestment)); | |
return { | |
x: e, | |
warren: r, | |
warrenMin: o, | |
warrenMax: i, | |
goal: t | |
} | |
} | |
var w = !1, | |
g = null; | |
n.d3; | |
l(), s() | |
} | |
return { | |
restrict: "E", | |
template: '<div class="wrn-line-chart wrn-line-chart-future"></div>', | |
link: o, | |
scope: { | |
goalAmount: "=", | |
goalYears: "=", | |
interest: "=", | |
minInterest: "=", | |
maxInterest: "=", | |
initialInvestment: "=", | |
monthlyInvestment: "=", | |
fnSimulation: "&" | |
} | |
} | |
} | |
angular.module("warren.common.directives.charts.futurechart", []).directive("wrnFutureChart", n), n.$inject = ["$window", "$filter", "$timeout", "c3", "moment"] | |
}(); | |
! function() { | |
"use strict"; | |
function a(a, t, r) { | |
function e(e, n) { | |
function o() { | |
for (var a = 0; a < e.data.chart.label.length; a++) { | |
var o = e.data.chart.label[a]; | |
o = r(o.substring(6, 10) + "-" + o.substring(3, 5) + "-" + o.substring(0, 2)).format("DD MMM YY"), "Invalid date" != o && (e.data.chart.label[a] = o) | |
} | |
c = t.generate({ | |
grid: { | |
lines: { | |
front: !1 | |
}, | |
x: { | |
show: !1 | |
}, | |
y: { | |
show: !1, | |
lines: [{ | |
value: 0, | |
text: "", | |
position: "start" | |
}] | |
} | |
}, | |
bindto: n.children()[0], | |
padding: { | |
right: 20, | |
left: 20 | |
}, | |
data: { | |
colors: { | |
projection: "#52525C", | |
warren: "#0581FF" | |
}, | |
type: "area", | |
x: "x", | |
names: { | |
projection: "Projetado", | |
warren: e.isVirtual ? "Rendimentos previstos" : "Realizado" | |
}, | |
columns: [ | |
["x"].concat(e.data.chart.label), ["projection"].concat(e.data.chart.data.projection), ["warren"].concat(e.data.chart.data.portfolio) | |
] | |
}, | |
axis: { | |
x: { | |
type: "categories", | |
tick: { | |
values: [0, Math.floor((e.data.chart.label.length - 1) / 2), e.data.chart.label.length - 1] | |
} | |
}, | |
y: { | |
show: !1, | |
tick: { | |
format: function(a, t, r) { | |
var e = i.format(".2%"); | |
return e(a).replace(".", ",") | |
} | |
} | |
} | |
}, | |
tooltip: { | |
format: { | |
value: function(a, t, r) { | |
var e = i.format(".2%"); | |
return e(a).replace(".", ",") | |
} | |
} | |
} | |
}) | |
} | |
var c = null, | |
i = a.d3; | |
e.$watch("data", function() { | |
o() | |
}) | |
} | |
return { | |
restrict: "E", | |
template: '<div class="wrn-line-chart wrn-line-chart-performance"></div>', | |
link: e, | |
scope: { | |
data: "=", | |
isVirtual: "=" | |
} | |
} | |
} | |
angular.module("warren.common.directives.charts.performancechart", []).directive("wrnPerformanceChart", a), a.$inject = ["$window", "c3", "moment"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, n) { | |
function t(e, t, o, s) { | |
function i() { | |
if (e.options) { | |
u = {}; | |
var n = e.options.types; | |
n && (u.types = Array.isArray(n) ? n.slice() : [n]), d.setTypes(n || ["(cities)"]); | |
var t = e.options.bounds; | |
t && (u.bounds = t), d.setBounds(t || null); | |
var o = e.options.country; | |
u.componentRestrictions = { | |
country: o || "br" | |
}, d.setComponentRestrictions(u.componentRestrictions) | |
} | |
} | |
function r() { | |
var e = d.getPlace(); | |
e && e.address_components && (e = n.parseGeocoderResult(e), a(e)) | |
} | |
function a(n) { | |
e.$apply(function() { | |
s.$setViewValue(t.val()), e.mapsChange && e.mapsChange()(n) | |
}) | |
} | |
function c(e) { | |
var n = e.keyCode || e.which; | |
if (9 === n && a({ | |
address: t.val() | |
}), 13 === n) return e.preventDefault(), !1 | |
} | |
var p = n.getMaps(); | |
if (p) { | |
var u = { | |
types: ["address"] | |
}, | |
d = new p.places.Autocomplete(t[0], u); | |
p.event.addListener(d, "place_changed", r), t.bind("keypress keydown", c), s.$render = function() { | |
t.val(s.$viewValue) | |
}, e.$watch("options", function() { | |
i() | |
}, !0) | |
} | |
} | |
return { | |
require: "ngModel", | |
scope: { | |
ngModel: "=", | |
options: "=?", | |
mapsChange: "&" | |
}, | |
link: t | |
} | |
} | |
angular.module("warren").directive("mapsAutocomplete", e), e.$inject = ["$parse", "wrnMaps"] | |
}(); | |
angular.module("ui.mask", []).value("uiMaskConfig", { | |
maskDefinitions: { | |
9: /\d/, | |
A: /[a-zA-Z]/, | |
"*": /[a-zA-Z0-9]/ | |
}, | |
clearOnBlur: !0, | |
eventsToHandle: ["input", "keyup", "click", "focus"] | |
}).directive("uiMask", ["$parse", "uiMaskConfig", function(e, n) { | |
function t(e) { | |
return e === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) | |
} | |
return { | |
priority: 100, | |
require: "ngModel", | |
restrict: "A", | |
compile: function() { | |
var r = n; | |
return function(n, i, a, u) { | |
function o(e) { | |
return angular.isDefined(e) ? (y(e), K ? (d(), v(), !0) : h()) : h() | |
} | |
function l(e) { | |
e && (R = e, K && i.val(b(m(i.val())))) | |
} | |
function c() { | |
return o(a.uiMask) | |
} | |
function s(e) { | |
return K ? (F = m(e || ""), z = p(F), u.$setValidity("mask", z), z && F.length ? b(F) : void 0) : e | |
} | |
function f(e) { | |
if (!K) return e; | |
if (F = m(e || ""), z = p(F), u.$viewValue = F.length ? b(F) : "", u.$setValidity("mask", z), "" === F && a.required && u.$setValidity("required", !u.$error.required), z) { | |
var n = J ? u.$viewValue : F; | |
return n ? n : null | |
} | |
} | |
function h() { | |
return K = !1, g(), angular.isDefined(W) ? i.attr("placeholder", W) : i.removeAttr("placeholder"), angular.isDefined(G) ? i.attr("maxlength", G) : i.removeAttr("maxlength"), i.val(u.$modelValue), u.$viewValue = u.$modelValue, !1 | |
} | |
function d() { | |
F = B = m(u.$modelValue || ""), H = Z = b(F), z = p(F), a.maxlength && i.attr("maxlength", 2 * C[C.length - 1]), W || i.attr("placeholder", R); | |
for (var e = u.$modelValue, n = 0; n < u.$formatters.length; n++) e = u.$formatters[n](e); | |
u.$viewValue = e || "", u.$render() | |
} | |
function v() { | |
N || (i.bind("blur", w), i.bind("mousedown mouseup", E), i.bind(Q.eventsToHandle.join(" "), O), i.bind("paste", V), N = !0) | |
} | |
function g() { | |
N && (i.unbind("blur", w), i.unbind("mousedown", E), i.unbind("mouseup", E), i.unbind("input", O), i.unbind("keyup", O), i.unbind("click", O), i.unbind("focus", O), i.unbind("paste", V), N = !1) | |
} | |
function p(e) { | |
return !e.length || e.length >= q | |
} | |
function m(e) { | |
var n = "", | |
t = _.slice(); | |
return e = e.toString(), angular.forEach(T, function(n) { | |
e = e.replace(n, "") | |
}), angular.forEach(e.split(""), function(e) { | |
t.length && t[0].test(e) && (n += e, t.shift()) | |
}), n | |
} | |
function b(e) { | |
var n = "", | |
t = C.slice(); | |
return angular.forEach(R.split(""), function(r, i) { | |
e.length && i === t[0] ? (n += e.charAt(0) || "_", e = e.substr(1), t.shift()) : n += r | |
}), n | |
} | |
function k(e) { | |
var n, t = angular.isDefined(a.uiMaskPlaceholder) ? a.uiMaskPlaceholder : a.placeholder; | |
return "undefined" != typeof t && t[e] ? t[e] : (n = angular.isDefined(a.uiMaskPlaceholderChar) && a.uiMaskPlaceholderChar ? a.uiMaskPlaceholderChar : "_", "space" === n.toLowerCase() ? " " : n[0]) | |
} | |
function $() { | |
return R.replace(/[_]+/g, "_").replace(/([^_]+)([a-zA-Z0-9])([^_])/g, "$1$2_$3").split("_") | |
} | |
function y(e) { | |
var n = 0; | |
if (C = [], _ = [], R = "", "string" == typeof e) { | |
q = 0; | |
var t = !1, | |
r = 0, | |
i = e.split(""); | |
angular.forEach(i, function(e, i) { | |
Q.maskDefinitions[e] ? (C.push(n), R += k(i - r), _.push(Q.maskDefinitions[e]), n++, t || q++) : "?" === e ? (t = !0, r++) : (R += e, n++) | |
}) | |
} | |
C.push(C.slice().pop() + 1), T = $(), K = C.length > 1 | |
} | |
function w() { | |
Q.clearOnBlur && (L = 0, I = 0, z && 0 !== F.length || (H = "", i.val(""), n.$apply(function() { | |
u.$setViewValue("") | |
}))), F !== U && M(i[0]), U = F | |
} | |
function M(e) { | |
var n; | |
"function" != typeof window.Event || e.fireEvent ? "createEvent" in document ? (n = document.createEvent("HTMLEvents"), n.initEvent("change", !1, !0), e.dispatchEvent(n)) : e.fireEvent && e.fireEvent("onchange") : (n = new Event("change", { | |
view: window, | |
bubbles: !0, | |
cancelable: !1 | |
}), e.dispatchEvent(n)) | |
} | |
function E(e) { | |
"mousedown" === e.type ? i.bind("mouseout", x) : i.unbind("mouseout", x) | |
} | |
function x() { | |
I = S(this), i.unbind("mouseout", x) | |
} | |
function V() { | |
P(this, i.val().length) | |
} | |
function O(e) { | |
e = e || {}; | |
var t = e.which, | |
r = e.type; | |
if (16 !== t && 91 !== t) { | |
var a, l = i.val(), | |
c = Z, | |
s = B, | |
f = D(this) || 0, | |
h = L || 0, | |
d = f - h; | |
j && o(j(l || "")); | |
var v = m(l), | |
g = C[0], | |
p = C[v.length] || C.slice().shift(), | |
k = I || 0, | |
$ = S(this) > 0, | |
y = k > 0, | |
w = l.length > c.length || k && l.length > c.length - k, | |
M = l.length < c.length || k && l.length === c.length - k, | |
E = t >= 37 && t <= 40 && e.shiftKey, | |
x = 37 === t, | |
V = 8 === t || "keyup" !== r && M && d === -1, | |
O = 46 === t || "keyup" !== r && M && 0 === d && !y, | |
_ = (x || V || "click" === r) && f > g; | |
if (I = S(this), !E && (!$ || "click" !== r && "keyup" !== r)) { | |
if ("input" === r && M && !y && v === s) { | |
for (; V && f > g && !A(f);) f--; | |
for (; O && f < p && C.indexOf(f) === -1;) f++; | |
var R = C.indexOf(f); | |
v = v.substring(0, R) + v.substring(R + 1) | |
} | |
for (a = b(v), Z = a, B = v, i.val(a), n.$apply(function() { | |
u.$setViewValue(v) | |
}), w && f <= g && (f = g + 1), _ && f--, f = f > p ? p : f < g ? g : f; !A(f) && f > g && f < p;) f += _ ? -1 : 1; | |
(_ && f < p || w && !A(h)) && f++, L = f, P(this, f) | |
} | |
} | |
} | |
function A(e) { | |
return C.indexOf(e) > -1 | |
} | |
function D(e) { | |
if (!e) return 0; | |
if (void 0 !== e.selectionStart) return e.selectionStart; | |
if (document.selection && t(i[0])) { | |
e.focus(); | |
var n = document.selection.createRange(); | |
return n.moveStart("character", e.value ? -e.value.length : 0), n.text.length | |
} | |
return 0 | |
} | |
function P(e, n) { | |
if (!e) return 0; | |
if (0 !== e.offsetWidth && 0 !== e.offsetHeight) | |
if (e.setSelectionRange) t(i[0]) && (e.focus(), e.setSelectionRange(n, n)); | |
else if (e.createTextRange) { | |
var r = e.createTextRange(); | |
r.collapse(!0), r.moveEnd("character", n), r.moveStart("character", n), r.select() | |
} | |
} | |
function S(e) { | |
return e ? void 0 !== e.selectionStart ? e.selectionEnd - e.selectionStart : document.selection ? document.selection.createRange().text.length : 0 : 0 | |
} | |
var C, _, R, T, j, q, F, H, z, Z, B, L, I, K = !1, | |
N = !1, | |
W = a.placeholder, | |
G = a.maxlength; | |
a.wrnMaskFn && (j = e(a.wrnMaskFn)(n)); | |
var J = !1; | |
a.$observe("modelViewValue", function(e) { | |
"true" === e && (J = !0) | |
}); | |
var Q = {}; | |
a.uiOptions ? (Q = n.$eval("[" + a.uiOptions + "]"), Q = angular.isObject(Q[0]) ? function(e, n) { | |
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && (void 0 === n[t] ? n[t] = angular.copy(e[t]) : angular.isObject(n[t]) && !angular.isArray(n[t]) && (n[t] = angular.extend({}, e[t], n[t]))); | |
return n | |
}(r, Q[0]) : r) : Q = r, a.$observe("uiMask", o), angular.isDefined(a.uiMaskPlaceholder) ? a.$observe("uiMaskPlaceholder", l) : a.$observe("placeholder", l), angular.isDefined(a.uiMaskPlaceholderChar) && a.$observe("uiMaskPlaceholderChar", c), u.$formatters.unshift(s), u.$parsers.unshift(f); | |
var U = i.val(); | |
i.bind("mousedown mouseup", E), Array.prototype.indexOf || (Array.prototype.indexOf = function(e) { | |
if (null === this) throw new TypeError; | |
var n = Object(this), | |
t = n.length >>> 0; | |
if (0 === t) return -1; | |
var r = 0; | |
if (arguments.length > 1 && (r = Number(arguments[1]), r !== r ? r = 0 : 0 !== r && r !== 1 / 0 && r !== -(1 / 0) && (r = (r > 0 || -1) * Math.floor(Math.abs(r)))), r >= t) return -1; | |
for (var i = r >= 0 ? r : Math.max(t - Math.abs(r), 0); i < t; i++) | |
if (i in n && n[i] === e) return i; | |
return -1 | |
}) | |
} | |
} | |
} | |
}]); | |
angular.module("warren").directive("massAutocomplete", ["$timeout", "$window", "$document", "$q", function(e, t, n, o) { | |
"use strict"; | |
return { | |
restrict: "A", | |
scope: { | |
options: "&massAutocomplete" | |
}, | |
transclude: !0, | |
template: '<span ng-transclude></span><div class="ac-container" ng-show="show_autocomplete && results.length > 0" style="position:absolute;"><ul class="ac-menu"><li ng-repeat="result in results" ng-if="$index > 0" class="ac-menu-item" ng-class="$index == selected_index ? \'ac-state-focus\': \'\'"><a href ng-click="apply_selection($index)" ng-bind-html="result.label"></a></li></ul></div>', | |
link: function(e, t) { | |
e.container = angular.element(t[0].getElementsByClassName("ac-container")[0]) | |
}, | |
controller: ["$scope", function(l) { | |
function s(e, t, n) { | |
var o; | |
return function() { | |
var l = this, | |
s = arguments, | |
c = function() { | |
o = null, n || e.apply(l, s) | |
}, | |
a = n && !o; | |
clearTimeout(o), o = setTimeout(c, t), a && e.apply(l, s) | |
} | |
} | |
function c() { | |
if (h) { | |
var e = h[0].getBoundingClientRect(), | |
o = (n[0].body.scrollTop || n[0].documentElement.scrollTop || t.pageYOffset, n[0].body.scrollLeft || n[0].documentElement.scrollLeft || t.pageXOffset, l.container[0]); | |
o.style.top = e.height + 20 + "px", o.style.width = e.width + "px" | |
} | |
} | |
function a(e, t, o) { | |
h !== t && (h && p.detach(), t[0] === n[0].activeElement && (o.on_attach && o.on_attach(), h = t, g = e, w = o, b = e.$viewValue, l.results = [], l.selected_index = -1, d(), v = l.$watch(function() { | |
return e.$modelValue | |
}, function(e, t) { | |
e === E && "undefined" != typeof e || (c(), R(e, h)) | |
}), o.show_on_focus && R(e.$modelValue, h))) | |
} | |
function u(e, t) { | |
e = e || "", l.selected_index = 0, l.waiting_for_suggestion = !0, "string" == typeof e ? o.when(w.suggest(e), function(n) { | |
h && h === t && (n && n.length > 0 ? (l.results = [{ | |
value: e, | |
label: "" | |
}].concat(n), l.show_autocomplete = !0, w.auto_select_first && r(1)) : l.results = []) | |
}, function(e) { | |
l.show_autocomplete = !1, w.on_error && w.on_error(e) | |
}).finally(function() { | |
l.waiting_for_suggestion = !1 | |
}) : (l.waiting_for_suggestion = !1, l.show_autocomplete = !1, l.$apply()) | |
} | |
function i(e) { | |
g.$modelValue !== e && (g.$setViewValue(e), g.$render()) | |
} | |
function r(e) { | |
var t = l.results[e]; | |
return h.val(t.value), l.selected_index = e, t | |
} | |
function d() { | |
angular.element(t).bind(f.RESIZE, x), m[f.BLUR] = function() { | |
e(function() { | |
h && h[0] === n[0].activeElement || p.detach() | |
}, $.debounce_blur) | |
}, h.bind(f.BLUR, m[f.BLUR]), m[f.KEYDOWN] = function(e) { | |
if (!e.shiftKey) switch (e.keyCode) { | |
case _.ESC: | |
l.show_autocomplete ? (l.show_autocomplete = !1, l.$apply()) : h.val(b); | |
break; | |
case _.ENTER: | |
l.show_autocomplete && l.selected_index > 0 && !l.waiting_for_suggestion && (l.apply_selection(l.selected_index), e.stopPropagation(), e.preventDefault()), l.show_autocomplete = !1, l.$apply(); | |
break; | |
case _.TAB: | |
if (!l.show_autocomplete) break; | |
e.preventDefault(); | |
case _.DOWN: | |
l.results.length > 0 && (l.show_autocomplete ? r(l.selected_index + 1 > l.results.length - 1 ? 0 : l.selected_index + 1) : (l.show_autocomplete = !0, l.selected_index = 0), l.$apply()); | |
break; | |
case _.UP: | |
l.show_autocomplete && (e.preventDefault(), r(l.selected_index - 1 >= 0 ? l.selected_index - 1 : l.results.length - 1), l.$apply()) | |
} | |
}, h.bind(f.KEYDOWN, m[f.KEYDOWN]) | |
} | |
var p = this, | |
_ = { | |
TAB: 9, | |
ESC: 27, | |
ENTER: 13, | |
UP: 38, | |
DOWN: 40 | |
}, | |
f = { | |
KEYDOWN: "keydown", | |
RESIZE: "resize", | |
BLUR: "blur" | |
}, | |
m = {}; | |
m[f.BLUR] = null, m[f.KEYDOWN] = null, m[f.RESIZE] = null; | |
var h, g, w, b, v, E, y = l.options() || {}, | |
$ = { | |
debounce_position: y.debounce_position || 150, | |
debounce_attach: y.debounce_attach || 300, | |
debounce_suggest: y.debounce_suggest || 100, | |
debounce_blur: y.debounce_blur || 150 | |
}; | |
l.show_autocomplete = !1; | |
var x = s(c, $.debounce_position); | |
p.attach = s(a, $.debounce_attach); | |
var R = s(u, $.debounce_suggest); | |
p.detach = function() { | |
if (h) { | |
var e = h.val(); | |
i(e), w.on_detach && w.on_detach(e), h.unbind(f.KEYDOWN, m[f.KEYDOWN]), h.unbind(f.BLUR, m[f.BLUR]) | |
} | |
l.show_autocomplete = !1, angular.element(t).unbind(f.RESIZE, m[f.RESIZE]), v && v(), l.selected_index = l.results = void 0, g = h = b = void 0 | |
}, l.apply_selection = function(e) { | |
if (h[0].focus(), !(!l.show_autocomplete || e > l.results.length || e < 0)) { | |
var t = r(e); | |
E = t.value, i(t.value), l.show_autocomplete = !1, w.on_select && w.on_select(t) | |
} | |
}, l.$on("$destroy", function() { | |
p.detach(), l.container.remove() | |
}) | |
}] | |
} | |
}]).directive("massAutocompleteItem", function() { | |
"use strict"; | |
return { | |
restrict: "A", | |
require: ["^massAutocomplete", "ngModel"], | |
scope: { | |
massAutocompleteItem: "&" | |
}, | |
link: function(e, t, n, o) { | |
n.$set("autocomplete", "off"), t.bind("focus", function() { | |
var n = e.massAutocompleteItem(); | |
if (!n) throw "Invalid options"; | |
o[0].attach(o[1], t, n) | |
}) | |
} | |
} | |
}); | |
! function(t, o) { | |
"use strict"; | |
var e = "tooltips", | |
i = function() { | |
var t = [], | |
e = 0, | |
i = function(o) { | |
o - e >= 15 && (t.forEach(function(t) { | |
t() | |
}), e = o) | |
}, | |
r = function() { | |
o.requestAnimationFrame(i) | |
}, | |
l = function(o) { | |
o && t.push(o) | |
}; | |
return { | |
add: function(e) { | |
t.length || o.addEventListener("resize", r), l(e) | |
} | |
} | |
}(), | |
r = function(t) { | |
var o = {}; | |
return t.removeAttr(e), void 0 !== t.attr("tooltip-template") && (o["tooltip-template"] = t.attr("tooltip-template"), t.removeAttr("tooltip-template")), void 0 !== t.attr("tooltip-template-url") && (o["tooltip-template-url"] = t.attr("tooltip-template-url"), t.removeAttr("tooltip-template-url")), void 0 !== t.attr("tooltip-controller") && (o["tooltip-controller"] = t.attr("tooltip-controller"), t.removeAttr("tooltip-controller")), void 0 !== t.attr("tooltip-side") && (o["tooltip-side"] = t.attr("tooltip-side"), t.removeAttr("tooltip-side")), void 0 !== t.attr("tooltip-show-trigger") && (o["tooltip-show-trigger"] = t.attr("tooltip-show-trigger"), t.removeAttr("tooltip-show-trigger")), void 0 !== t.attr("tooltip-hide-trigger") && (o["tooltip-hide-trigger"] = t.attr("tooltip-hide-trigger"), t.removeAttr("tooltip-hide-trigger")), void 0 !== t.attr("tooltip-smart") && (o["tooltip-smart"] = t.attr("tooltip-smart"), t.removeAttr("tooltip-smart")), void 0 !== t.attr("tooltip-class") && (o["tooltip-class"] = t.attr("tooltip-class"), t.removeAttr("tooltip-class")), void 0 !== t.attr("tooltip-close-button") && (o["tooltip-close-button"] = t.attr("tooltip-close-button"), t.removeAttr("tooltip-close-button")), void 0 !== t.attr("tooltip-size") && (o["tooltip-size"] = t.attr("tooltip-size"), t.removeAttr("tooltip-size")), void 0 !== t.attr("tooltip-speed") && (o["tooltip-speed"] = t.attr("tooltip-speed"), t.removeAttr("tooltip-speed")), o | |
}, | |
l = function(t) { | |
return o.getComputedStyle ? o.getComputedStyle(t, "") : t.currentStyle ? t.currentStyle : void 0 | |
}, | |
n = function(e) { | |
for (var i, r, l = o.document.querySelectorAll("._exradicated-tooltip"), n = 0, p = l.length; n < p; n += 1) | |
if (i = l.item(n), i && (r = t.element(i), r.data("_tooltip-parent") && r.data("_tooltip-parent") === e)) return r | |
}, | |
p = function(t) { | |
var o = n(t); | |
o && o.remove() | |
}, | |
a = function(t) { | |
if (t) { | |
var e = t[0].getBoundingClientRect(); | |
return (e.top < 0 || e.top > o.document.body.offsetHeight || e.left < 0 || e.left > o.document.body.offsetWidth || e.bottom < 0 || e.bottom > o.document.body.offsetHeight || e.right < 0 || e.right > o.document.body.offsetWidth) && (t.css({ | |
top: "", | |
left: "", | |
bottom: "", | |
right: "" | |
}), !0) | |
} | |
throw new Error("You must provide a position") | |
}, | |
d = function() { | |
var t = { | |
side: "top", | |
showTrigger: "mouseover", | |
hideTrigger: "mouseleave", | |
class: "", | |
smart: !1, | |
closeButton: !1, | |
size: "", | |
speed: "steady" | |
}; | |
return { | |
configure: function(o) { | |
var e, i = Object.keys(t), | |
r = 0; | |
if (o) | |
for (; r < i.length; r += 1) e = i[r], e && o[e] && (t[e] = o[e]) | |
}, | |
$get: function() { | |
return t | |
} | |
} | |
}, | |
s = ["$log", "$http", "$compile", "$timeout", "$controller", "$injector", "tooltipsConf", function(e, d, s, c, u, m, g) { | |
var f = function(e, m, f, h, v) { | |
if (f.tooltipTemplate && f.tooltipTemplateUrl) throw new Error("You can not define tooltip-template and tooltip-url together"); | |
if (!f.tooltipTemplateUrl && !f.tooltipTemplate && f.tooltipController) throw new Error("You can not have a controller without a template or templateUrl defined"); | |
var y, b = "_" + g.side, | |
_ = g.showTrigger, | |
C = g.hideTrigger, | |
w = g.size, | |
S = "_" + g.speed; | |
f.tooltipSide = f.tooltipSide || g.side, f.tooltipShowTrigger = f.tooltipShowTrigger || g.showTrigger, f.tooltipHideTrigger = f.tooltipHideTrigger || g.hideTrigger, f.tooltipClass = f.tooltipClass || g.class, f.tooltipSmart = "true" === f.tooltipSmart || g.smart, f.tooltipCloseButton = f.tooltipCloseButton || g.closeButton.toString(), f.tooltipSize = f.tooltipSize || g.size, f.tooltipWidth = f.tooltipWidth || g.width, f.tooltipSpeed = f.tooltipSpeed || g.speed, f.tooltipAppendToBody = "true" === f.tooltipAppendToBody, v(e, function(e, g) { | |
var h = r(e), | |
v = t.element(o.document.createElement("tooltip")), | |
T = t.element(o.document.createElement("tip-cont")), | |
$ = t.element(o.document.createElement("tip")), | |
A = t.element(o.document.createElement("tip-tip")), | |
x = t.element(o.document.createElement("span")), | |
B = t.element(o.document.createElement("tip-arrow")), | |
E = function() { | |
return T.html() | |
}, | |
H = function(t) { | |
void 0 !== t && T[0].getClientRects().length > 1 ? v.addClass("_multiline") : v.removeClass("_multiline") | |
}, | |
z = function(e) { | |
if ($.addClass("_hidden"), $.on("click", W), f.tooltipSmart) { | |
var i = { | |
top: ["_top", "_left", "_bottom", "_right", "_top"], | |
left: ["_left", "_bottom", "_right", "_top", "_left"], | |
bottom: ["_bottom", "_left", "_top", "_right", "_bottom"], | |
right: ["_right", "_top", "_left", "_bottom", "_right"] | |
}, | |
r = f.tooltipSide; | |
if (!i[r]) throw new Error("Position not supported"); | |
for (var n = i[r].slice(); n.length > 1 && a($);) { | |
var d = n.shift(), | |
s = n[0]; | |
v.removeClass(d), v.addClass(s) | |
} | |
} | |
if (f.tooltipAppendToBody) { | |
var c, u, m, g, h, y = l(A[0]), | |
b = l(B[0]), | |
_ = l($[0]), | |
C = $[0].getBoundingClientRect(), | |
w = t.copy($), | |
S = 0, | |
T = y.length, | |
x = 0, | |
E = b.length, | |
H = 0, | |
z = _.length, | |
P = {}, | |
V = {}, | |
k = {}; | |
for ($.removeClass("_hidden"), w.removeClass("_hidden"), w.data("_tooltip-parent", v), p(v); S < T; S += 1) c = y[S], c && y.getPropertyValue(c) && (P[c] = y.getPropertyValue(c)); | |
for (; x < E; x += 1) c = b[x], c && b.getPropertyValue(c) && (k[c] = b.getPropertyValue(c)); | |
for (; H < z; H += 1) c = _[H], c && "position" !== c && "display" !== c && "opacity" !== c && "z-index" !== c && "bottom" !== c && "height" !== c && "left" !== c && "right" !== c && "top" !== c && "width" !== c && _.getPropertyValue(c) && (V[c] = _.getPropertyValue(c)); | |
u = o.parseInt(_.getPropertyValue("padding-top"), 10), m = o.parseInt(_.getPropertyValue("padding-bottom"), 10), g = o.parseInt(_.getPropertyValue("padding-left"), 10), h = o.parseInt(_.getPropertyValue("padding-right"), 10), V.top = C.top + o.scrollY + "px", V.left = C.left + o.scrollX + "px", V.height = C.height - (u + m) + "px", V.width = C.width - (g + h) + "px", console.log("square:", V), w.css(V), w.children().css(P), w.children().next().css(k), e && "true" !== f.tooltipHidden && (w.addClass("_exradicated-tooltip"), t.element(o.document.body).append(w)) | |
} else f.tooltipWidth && ($[0].style.width = f.tooltipWidth), $.removeClass("_hidden"), e && "true" !== f.tooltipHidden && v.addClass("active"); | |
var R = $[0].getBoundingClientRect(), | |
I = o.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, | |
L = (o.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, $[0]), | |
U = $[0].children[1]; | |
R.left < 0 ? (L.style.left = "35px", U.style.marginLeft = "-33px") : R.right > I ? (L.style.left = "-35px", U.style.marginLeft = "37px") : U.style.marginLeft = "-2px" | |
}, | |
W = function t() { | |
$.css({ | |
top: "", | |
left: "", | |
bottom: "", | |
right: "" | |
}), $.off("click", t), f.tooltipAppendToBody ? p(v) : v.removeClass("active") | |
}, | |
P = function t(o) { | |
var e, i = o.parent(); | |
o[0] && (o[0].scrollHeight > o[0].clientHeight || o[0].scrollWidth > o[0].clientWidth) && o.on("scroll", function() { | |
var t = this; | |
e && c.cancel(e), e = c(function() { | |
var o = n(v), | |
e = v[0].getBoundingClientRect(), | |
i = t.getBoundingClientRect(); | |
e.top < i.top || e.bottom > i.bottom || e.left < i.left || e.right > i.right ? p(v) : o && z(!0) | |
}) | |
}), i && i.length && t(i) | |
}, | |
V = function(t) { | |
t && (A.empty(), A.append(x), A.append(t), c(function() { | |
z() | |
})) | |
}, | |
k = function(t) { | |
t && d.get(t).then(function(t) { | |
t && t.data && (A.empty(), A.append(x), A.append(s(t.data)(g)), c(function() { | |
z() | |
})) | |
}) | |
}, | |
R = function(t) { | |
t && (b && v.removeAttr("_" + b), v.addClass("_" + t), b = t) | |
}, | |
I = function(t) { | |
t && (_ && v.off(_), v.on(t, z), _ = t) | |
}, | |
L = function(t) { | |
t && (C && v.off(C), v.on(t, W), C = t) | |
}, | |
U = function(t) { | |
t && (y && $.removeClass(y), $.addClass(t), y = t) | |
}, | |
Y = function() { | |
"boolean" != typeof f.tooltipSmart && (f.tooltipSmart = "true" === f.tooltipSmart) | |
}, | |
q = function(t) { | |
var o = "true" === t; | |
o ? (x.on("click", W), x.css("display", "block")) : (x.off("click"), x.css("display", "none")) | |
}, | |
j = function(o) { | |
if (o) { | |
var e, i = u(o, { | |
$scope: g | |
}), | |
r = g.$new(!1, g), | |
l = o.indexOf("as"); | |
l >= 0 ? (e = o.substr(l + 3), r[e] = i) : t.extend(r, i), A.replaceWith(s(A)(r)), Z() | |
} | |
}, | |
O = function(t) { | |
t && (w && A.removeClass("_" + w), A.addClass("_" + t), w = t) | |
}, | |
F = function(t) { | |
t && (S && v.removeClass("_" + S), v.addClass("_" + t), S = t) | |
}, | |
X = f.$observe("tooltipTemplate", V), | |
D = f.$observe("tooltipTemplateUrl", k), | |
G = f.$observe("tooltipSide", R), | |
J = f.$observe("tooltipShowTrigger", I), | |
K = f.$observe("tooltipHideTrigger", L), | |
M = f.$observe("tooltipClass", U), | |
N = f.$observe("tooltipSmart", Y), | |
Q = f.$observe("tooltipCloseButton", q), | |
Z = f.$observe("tooltipController", j), | |
tt = f.$observe("tooltipSize", O), | |
ot = f.$observe("tooltipSpeed", F), | |
et = g.$watch(E, H); | |
x.attr({ | |
id: "close-button" | |
}), x.html("×"), $.addClass("_hidden"), A.append(x), A.append(f.tooltipTemplate), $.append(A), $.append(B), T.append(e), v.attr(h), v.addClass("tooltips"), v.append(T), v.append($), m.after(v), f.tooltipAppendToBody && (i.add(function() { | |
P(v) | |
}), P(v)), i.add(function() { | |
H(), z() | |
}), c(function() { | |
z(), $.removeClass("_hidden"), v.addClass("_ready") | |
}), g.$on("$destroy", function() { | |
X(), D(), G(), J(), K(), M(), N(), Q(), tt(), ot(), et(), e.off(f.tooltipShowTrigger + " " + f.tooltipHideTrigger) | |
}) | |
}) | |
}; | |
return { | |
restrict: "A", | |
transclude: "element", | |
priority: 1, | |
terminal: !0, | |
link: f | |
} | |
}]; | |
t.module("720kb.tooltips", []).provider(e + "Conf", d).directive(e, s) | |
}(angular, window); | |
! function() { | |
"use strict"; | |
function e(e, n) { | |
function t(t, i, r, u) { | |
function a() { | |
var e = angular.element("<span>" + i.val() + "</span>"), | |
n = i.parent(); | |
n.append(e); | |
var t = i[0].getBoundingClientRect().height, | |
r = e[0].getBoundingClientRect().width + 20; | |
r = Math.max(r, t), i.css("width", r + "px"), e.remove() | |
} | |
e.document; | |
i.bind("input paste cut", a), t.$watch(function() { | |
return u.$viewValue | |
}, a), a(), n(a, 100) | |
} | |
return { | |
restrict: "A", | |
link: t, | |
require: "ngModel" | |
} | |
} | |
angular.module("warren.common.directives.autoresize", []).directive("wrnAutoResize", e), e.$inject = ["$window", "$timeout"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t) { | |
function n(n, o, i, r) { | |
function c() { | |
if (o.addClass("wrn-curtain"), "undefined" != typeof i.fixed) a = !0, o.addClass("wrn-curtain-fixed"); | |
else { | |
var r = angular.element(e); | |
n.$on("$destroy", function() { | |
r.unbind("resize", u) | |
}), r.bind("resize", function() { | |
t(u, 10) | |
}), t(u, 10) | |
} | |
} | |
function u() { | |
var e = l.getBoundingClientRect(), | |
t = d(); | |
a ? s.style.top = e.top + "px" : s.style.top = e.top + t + "px", s.style.left = e.left + "px", s.style.height = e.height + "px", s.style.width = e.width + "px" | |
} | |
function d() { | |
return e.pageYOffset ? e.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0 | |
} | |
var l = o.parent()[0], | |
s = o[0], | |
a = !1; | |
c() | |
} | |
return { | |
restrict: "E", | |
link: n | |
} | |
} | |
angular.module("warren.common.directives.curtain", []).directive("wrnCurtain", e), e.$inject = ["$window", "$timeout"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t) { | |
function n(n, r, e, u) { | |
function i(n) { | |
return n && (n = t.utc(n).format("DDMMYYYY")), n | |
} | |
function c(n) { | |
return n = (n || "").replace(/[\/|_]/g, ""), !n || n.length < 8 ? null : t.utc(n, "DDMMYYYY").toISOString() | |
} | |
u.$formatters.unshift(i), u.$parsers.push(c) | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: n | |
} | |
} | |
angular.module("warren.common.directives.date", []).directive("wrnDate", t), t.$inject = ["moment"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
function e(e, n, r) { | |
var t = n.html(); | |
if ("undefined" != typeof r.wrnEscapeTrim) { | |
for (var i = t.search(/\S/) - 1, c = new RegExp("\\s{" + i + "}"), a = t.split("\n"), s = 0; s < a.length; s++) a[s] = a[s].replace(c, ""); | |
t = a.join("\n").trim() | |
} | |
n.text(t) | |
} | |
return { | |
restrict: "A", | |
link: e | |
} | |
} | |
angular.module("warren.common.directives.escape", []).directive("wrnEscape", e), e.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, r) { | |
function e(r, e, c) { | |
var t = function() {}; | |
if (!warren.utils.isMobile()) { | |
r.wrnFocusThen && (t = r.wrnFocusThen); | |
r.wrnFocusAfter; | |
n(function() { | |
e[0].focus(), t() | |
}, r.wrnFocusAfter) | |
} | |
} | |
return { | |
restrict: "A", | |
link: e, | |
scope: { | |
wrnFocusAfter: "=", | |
wrnFocusThen: "&" | |
} | |
} | |
} | |
n.$inject = ["$timeout", "$parse"], angular.module("warren.common.directives.focusafter", []).directive("wrnFocusAfter", n) | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, e) { | |
function i(e, i, t) { | |
var c = function() {}; | |
if (!warren.utils.isMobile()) { | |
e.wrnFocusThen && (c = e.wrnFocusThen); | |
var o = e.wrnFocusIf; | |
"undefined" == typeof o ? (i[0].focus(), c()) : e.$watch("wrnFocusIf", function(e) { | |
var t = window, | |
o = document, | |
u = o.documentElement, | |
r = o.getElementsByTagName("body")[0], | |
s = t.innerWidth || u.clientWidth || r.clientWidth; | |
s < 560 || angular.isDefined(e) && e && n(function() { | |
i[0].focus(), c() | |
}) | |
}, !0) | |
} | |
} | |
return { | |
restrict: "A", | |
link: i, | |
scope: { | |
wrnFocusIf: "=", | |
wrnFocusThen: "&" | |
} | |
} | |
} | |
angular.module("warren.common.directives.focusif", []).directive("wrnFocusIf", n), n.$inject = ["$timeout", "$parse"] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
function n(n, e, t, i) { | |
function c() { | |
n.$watch(t.ngModel, r) | |
} | |
function o() {} | |
function r(n) {} | |
n.$on("$destroy", o), c(), n.select = function(e) { | |
n.ngModel = e, n.fnChange && n.fnChange({ | |
value: e | |
}) | |
} | |
} | |
return { | |
restrict: "E", | |
link: n, | |
templateUrl: "app/common/directives/wrn_inputrisk.template.html", | |
scope: { | |
ngModel: "=", | |
fnChange: "&" | |
} | |
} | |
} | |
angular.module("warren.common.directives.inputrisk", []).directive("wrnInputRisk", n), n.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e) { | |
function n(e, n, r, u) { | |
var c = null, | |
l = i; | |
"valid" !== r.wrnJumpWith && (c = parseInt(r.wrnJumpWith), l = t), n.bind("keyup", function(e) { | |
var t = e.which; | |
if (!(t <= 46 || t >= 112 && t <= 185) && l(u, c)) | |
for (var i = n[0], r = document.querySelectorAll("input, button, select, textarea"), o = 0; o < r.length - 1; o++) | |
if (r[o] === i) { | |
r[o + 1].focus(); | |
break | |
} | |
}) | |
} | |
function t(e, n) { | |
return e.$viewValue && e.$viewValue.length === n | |
} | |
function i(e, n) { | |
return e.$viewValue && e.$valid | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: n | |
} | |
} | |
angular.module("warren.common.directives.jumpwith", []).directive("wrnJumpWith", e), e.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e) { | |
function t(t, n, r) { | |
function i() { | |
s = a(), s && (c = l(s), e.addEventListener("resize", u), t.$on("$destroy", o), u()) | |
} | |
function o() { | |
e.removeEventListener("resize", u) | |
} | |
function a() { | |
for (var e = n.parent()[0], t = 100, r = 0; r < t;) { | |
var i = warren.utils.getElementHeight(e); | |
if (i && i > 0) break; | |
if (e = e.parentElement, !e) break; | |
r++ | |
} | |
return r === t && console.error("leaving due to max iterations"), e | |
} | |
function l(e) { | |
for (var t = e.children, n = 0, r = 0; r < t.length; r++) { | |
var i = t[r], | |
o = warren.utils.getElementOuterHeight(i); | |
o && 0 !== o || !i.children || (o = l(i)), n += o || 0 | |
} | |
return n | |
} | |
function u() { | |
if (s) { | |
var e = warren.utils.getElementHeight(s); | |
c = l(s), e > c ? (n[0].style.position = "absolute", n[0].style.bottom = "0") : n[0].style.position = "relative" | |
} | |
} | |
var s = null, | |
c = 0; | |
i() | |
} | |
return { | |
restrict: "A", | |
link: t | |
} | |
} | |
angular.module("warren.common.directives.keepbottom", []).directive("wrnKeepBottom", e), e.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e) { | |
function t(t, n, c) { | |
var r = c.src, | |
i = n.text(), | |
d = e.document.createElement("script"); | |
d.type = "text/javascript", "undefined" != typeof r ? (d.src = r, d.onload = function() { | |
var t = e.document.createElement("script"); | |
t.type = "text/javascript", t.text = i, e.document.head.appendChild(t) | |
}) : d.text = i, e.document.head.appendChild(d), n.remove() | |
} | |
return { | |
restrict: "E", | |
link: t, | |
scope: !1 | |
} | |
} | |
angular.module("warren.common.directives.script", []).directive("wrnScript", e), e.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, r) { | |
function t(t, n, s) { | |
var i = t.wrnShowAfter, | |
o = t.wrnShowAfterClass || "ng-hide", | |
a = !!t.wrnShowAfterForce, | |
w = !!t.wrnShowAfterDisabled; | |
a && (n[0].style.opacity = "", "none" === n[0].style.display && (n[0].style.display = "block"), n[0].style.visibility = ""), w || (n.addClass(o), e(function() { | |
r.removeClass(n, o, { | |
tempClasses: o + "-animate" | |
}) | |
}, i)) | |
} | |
return { | |
restrict: "A", | |
link: t, | |
scope: { | |
wrnShowAfter: "=", | |
wrnShowAfterClass: "@", | |
wrnShowAfterForce: "=", | |
wrnShowAfterDisabled: "=" | |
} | |
} | |
} | |
angular.module("warren.common.directives.showafter", []).directive("wrnShowAfter", e), e.$inject = ["$timeout", "$animate"] | |
}(); | |
! function() { | |
"use strict"; | |
function o(o) { | |
function r(r, n, t) { | |
var l = t.wrnSmoothScroll, | |
i = t.wrnSmoothScrollEase, | |
c = t.wrnSmoothScrollTime, | |
e = t.wrnSmoothScrollDelta || 0, | |
s = o.to; | |
/^\d+$/.test(l) && (l = parseInt(l), s = o.toPosition), i = i && warren.utils.easing[i] ? warren.utils.easing[i] : null, n.bind("click", function() { | |
s(l, i, c, e) | |
}) | |
} | |
return { | |
restrict: "A", | |
link: r, | |
scope: {} | |
} | |
} | |
angular.module("warren.common.directives.smoothscroll", []).directive("wrnSmoothScroll", o), o.$inject = ["wrnSmoothScroll"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, e, t, i) { | |
function r(r, s, l) { | |
function o() { | |
n.addEventListener("scroll", a), s.addClass("sticky"), s.addClass("ng-hide"); | |
var e = l.wrnSticky; | |
"" === e ? (c = 0, s.removeClass("ng-hide"), f = !0) : warren.utils.isNumber(e) ? c = parseInt(e) : (d = e, c = null), t(function() { | |
a() | |
}, 100) | |
} | |
function u() { | |
n.removeEventListener("scroll", a) | |
} | |
function a() { | |
if (d) { | |
var n = e[0].getElementById(d); | |
c = n ? warren.utils.getGlobalOffset(n).top : null | |
} | |
var r = warren.utils.getDocumentTop(); | |
c && (r >= c ? f || (f = !0, t(function() { | |
i.removeClass(s, "ng-hide") | |
}, 0)) : f && (f = !1, t(function() { | |
i.addClass(s, "ng-hide") | |
}, 0))) | |
} | |
var c = null, | |
d = null, | |
f = !1; | |
r.$on("$destroy", u), o() | |
} | |
return { | |
restrict: "A", | |
link: r | |
} | |
} | |
angular.module("warren.common.directives.sticky", []).directive("wrnSticky", n), n.$inject = ["$window", "$document", "$timeout", "$animate"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t, n) { | |
function i(n, i, e) { | |
function r() { | |
n.finished ? (i.html(warren.utils.notTypewriter(f)), n.callbackFn && n.callbackFn()) : x = t(function() { | |
a(i, k, 0, f) | |
}, p) | |
} | |
function a(i, e, r, c) { | |
var o = v; | |
if (e <= c.length) { | |
var u = c.substring(e - 1, e); | |
if ("^" === u) { | |
var h = e; | |
e++, u = c.substring(e - 1, e); | |
for (var g = ""; u && !isNaN(u);) g += u, e++, u = c.substring(e - 1, e); | |
var m = ""; | |
return " " === u && (m = " "), c = c.replace("^" + g + m, ""), o = parseInt(g), e = h, void(x = t(function() { | |
a(i, e, r, c) | |
}, o)) | |
} | |
if ("<" !== u) return n.beforeCharFn && n.beforeCharFn(), i.html(c.substring(0, e) + w), n.afterCharFn && n.afterCharFn(), e++, void(x = t(function() { | |
a(i, e, r, c) | |
}, o)); | |
for (var k = "<"; u && ">" !== u;) k += c.substring(0, e), e++, u = c.substring(e - 1, e); | |
i.html(c.substring(0, e) + w), e++, x = t(function() { | |
a(i, e, r, c) | |
}, o) | |
} else e--, b && r < b.length - 1 ? x = t(function() { | |
var t = b[r]; | |
t = t.replace(/\^\d+\s?/g, ""), l(i, e, r, t) | |
}, p) : (C(), x && t.cancel(x), n.callbackFn && n.callbackFn(), d && s(i, e, f)) | |
} | |
function s(t, n) { | |
var i = t.text().substring(0, t.text().length - 1); | |
F ? m ? (g = "-webkit-animation:blink-it steps(1) " + m + " infinite;-moz-animation:blink-it steps(1) " + m + " infinite -ms-animation:blink-it steps(1) " + m + " infinite;-o-animation:blink-it steps(1) " + m + " infinite; animation:blink-it steps(1) " + m + " infinite;", t.html(i.substring(0, n) + '<span class="blink" style="' + g + '">' + w + "</span>")) : t.html(i.substring(0, n) + '<span class="blink">' + w + "</span>") : t.html(i.substring(0, n)) | |
} | |
function l(n, i, e, r) { | |
return i > 0 ? (r = r.slice(0, -1), n.html(r + w), i--, void(x = t(function() { | |
l(n, i, e, r) | |
}, y))) : (e++, r = u(b[e]), x = t(function() { | |
a(n, 0, e, r) | |
}, v), void 0) | |
} | |
function c(t) { | |
return "string" == typeof t ? "s" === t.charAt(t.length - 1) ? 1e3 * parseInt(t.substring(0, t.length - 1), 10) : +t : 200 | |
} | |
function o(t) { | |
return "string" == typeof t && ("s" === t.charAt(t.length - 1) ? t : parseInt(t.substring(0, t.length - 1), 10) / 1e3) | |
} | |
function u(t) { | |
return t.replace(/<a /g, '<a target="_blank" ') | |
} | |
var f, b, h, g, p = c(e.initialDelay), | |
m = o(e.blinkDelay), | |
k = e.startAt || 0, | |
v = e.typeDelay || 50, | |
y = e.eraseDelay || v / 2, | |
d = "true" === e.showCursor, | |
F = "true" === e.blinkCursor, | |
w = d && (e.cursor || "|") || "", | |
x = null; | |
n.$on("$destroy", function() { | |
x && t.cancel(x) | |
}); | |
var C = n.$watch("start", function(t) { | |
!h && t && (h = !h, r()) | |
}); | |
n.$watch("text", function(i) { | |
n.text = i, n.text && (n.text instanceof Array ? (b = n.text, f = u(b[0])) : f = u(n.text)), ("undefined" == typeof n.start || n.start) && (h && t.cancel(x), i && r()) | |
}) | |
} | |
return { | |
restrict: "A", | |
link: i, | |
scope: { | |
callbackFn: "&", | |
beforeCharFn: "&", | |
afterCharFn: "&", | |
start: "=", | |
text: "=", | |
finished: "=" | |
} | |
} | |
} | |
angular.module("warren.common.directives.typewrite", []).directive("wrnTypewrite", t), t.$inject = ["$timeout", "$parse"] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
function n(n, e, r) { | |
var c = function() {}, | |
l = e[0]; | |
e.bind("scroll", function() { | |
l.scrollTop + l.offsetHeight >= l.scrollHeight && n.wrnWhenScrolled && (c = n.wrnWhenScrolled)() | |
}) | |
} | |
return { | |
restrict: "A", | |
link: n, | |
scope: { | |
wrnWhenScrolled: "&" | |
} | |
} | |
} | |
angular.module("warren.common.directives.whenscrolled", []).directive("wrnWhenScrolled", n) | |
}(); | |
! function() { | |
"use strict"; | |
function n(n) { | |
function r() { | |
return n.getLink.apply(void 0, arguments) | |
} | |
return r | |
} | |
angular.module("warren.common.filters._link", []).filter("_l", n).filter("_link", n), n.$inject = ["wrnResources"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n) { | |
function t() { | |
return n.getQuantityString.apply(void 0, arguments) | |
} | |
return t | |
} | |
angular.module("warren.common.filters._qs", []).filter("_qs", n), n.$inject = ["wrnResources"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n) { | |
function r() { | |
return n.getString.apply(void 0, arguments) | |
} | |
return r | |
} | |
angular.module("warren.common.filters._s", []).filter("_s", n).filter("_string", n), n.$inject = ["wrnResources"] | |
}(); | |
! function() { | |
"use strict"; | |
function r(r) { | |
function n(n) { | |
return r.getStringArray(n) | |
} | |
return n | |
} | |
angular.module("warren.common.filters._sa", []).filter("_sa", r), r.$inject = ["wrnResources"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e) { | |
function n() { | |
return e.getValue.apply(void 0, arguments) | |
} | |
return n | |
} | |
angular.module("warren.common.filters._value", []).filter("_v", e).filter("_value", e), e.$inject = ["wrnResources"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n) { | |
return function(t) { | |
return void 0 === typeof t || null === t ? t : n.environment.assets + ("" + t) | |
} | |
} | |
angular.module("warren.common.filters.asset", []).filter("asset", n), n.$inject = ["config"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t) { | |
function r(n) { | |
return n && n.length && 11 == n.length ? n.substring(0, 3) + "." + n.substring(3, 6) + "." + n.substring(6, 9) + "-" + n.substring(9, 11) : "" | |
} | |
return r | |
} | |
angular.module("warren.common.filters.cpf", []).filter("cpf", n), n.$inject = ["$locale", "$filter"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t, e) { | |
function n(t, e) { | |
return moment.locale("pt-br"), moment(t).format(e || "DD/MM/YYYY") | |
} | |
return n | |
} | |
angular.module("warren.common.filters.datetime", []).filter("datetime", t), t.$inject = ["$locale", "$filter"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, r) { | |
function n(e, n, c, l) { | |
var t = null === c; | |
t && (c = 100); | |
var a = r("currency")(e, n, c); | |
return a ? (t && (a = a.replace(/\.?0*$/g, "")), a = a.replace(/\./, "!!!"), a = a.replace(/,/g, "."), a = a.replace(/!!!/, ","), l && e >= 0 && (a = "+" + a), a) : "0,00" | |
} | |
return n | |
} | |
angular.module("warren.common.filters.money", []).filter("money", e), e.$inject = ["$locale", "$filter"] | |
}(); | |
! function() { | |
"use strict"; | |
function r(r, t) { | |
function e(t) { | |
return t = warren.utils.notTypewriter(t), r.trustAs("html", t) | |
} | |
return e | |
} | |
angular.module("warren.common.filters.notypewriter", []).filter("notypewriter", r), r.$inject = ["$sce", "wrnResources"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t) { | |
function n(e, t, n, r) { | |
e = e || 0, "undefined" == typeof t && (t = "%"), e = (100 * e).toFixed(n || 0), 0 == e && (e = Math.abs(e).toFixed(n)); | |
var i = e.replace(/\./, ",") + t; | |
return r && (t = e >= 0 ? "+" : "", i = t + i), i | |
} | |
return n | |
} | |
angular.module("warren.common.filters.percentage", []).filter("percentage", e), e.$inject = ["$locale", "$filter"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, r) { | |
function n(e) { | |
return (e || []).slice().reverse() | |
} | |
return n | |
} | |
angular.module("warren.common.filters.reverse", []).filter("reverse", e), e.$inject = ["$locale", "$filter"] | |
}(); | |
! function() { | |
"use strict"; | |
angular.module("warren.common.filters.safehtml", []).filter("safeHtml", ["$sce", function(t) { | |
return function(n) { | |
return t.trustAsHtml(n) | |
} | |
}]) | |
}(); | |
! function() { | |
"use strict"; | |
function t(t) { | |
function r(r, n) { | |
return t.trustAs(n || "html", r) | |
} | |
return r | |
} | |
angular.module("warren.common.filters.trust", []).filter("trust", t), t.$inject = ["$sce"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t) { | |
function r(r, e, a, i) { | |
function l(t) { | |
t = (t || 0).toString(), t = t.replace(/[^0-9]/g, ""), t = parseInt(t, 10).toString(); | |
var r = "000"; | |
t = r.substring(0, r.length - t.length) + t; | |
var a = t.substring(0, t.length - 2), | |
i = t.substring(t.length - 2); | |
a = n("number")(a).replace(/,/g, "."), i = "," + i, e.val(b + a + i) | |
} | |
function s(n) { | |
return n ? (n = n.toString().replace(/[^0-9]/g, ""), n = parseFloat(n) / 100, n || 0) : 0 | |
} | |
function c() { | |
for (var n = e[0].selectionStart, t = e[0].selectionEnd, r = e.val().substring(0, n), a = 0, i = 0; i < n && !(i > r.length); i++) /[^0-9]/.test(r[i]) && a++; | |
return { | |
rawStart: n, | |
rawEnd: t, | |
start: n - a, | |
end: t - a | |
} | |
} | |
function u(n) { | |
for (var t = e.val(), r = n.start, a = n.end, i = 0; i < r && !(i > t.length); i++) /[^0-9]/g.test(t[i]) && (r++, a++); | |
"," === t[i] && (r++, a++), e[0].selectionStart = r, e[0].selectionEnd = r | |
} | |
function o(n) { | |
var t = n.rawStart, | |
r = p, | |
a = r[t], | |
i = r[t + 1], | |
l = (r[t - 1], e.val()); | |
"." === a ? e.val(l.slice(0, t) + l.slice(t + 1)) : 0 === t && "," === i && e.val(l.slice(t + 1)) | |
} | |
function v(n) { | |
var t = n.rawStart, | |
r = p, | |
a = r[t], | |
i = (r[0], r[t + 1], r[t - 1]); | |
e.val(); | |
1 === t && "0" === i && "," === a && (n.start = 0, n.end = 0) | |
} | |
function g(n) { | |
var t = e.val(); | |
"," === t && (n.start = 2, n.end = 2) | |
} | |
function f(n) { | |
h = n && n.keyCode, h && 9 <= h && h <= 40 || t.defer(d) | |
} | |
function d(n) { | |
var t = c(); | |
if (46 === h && o(t), 8 === h && v(t), 188 === h && g(t), 110 === h) { | |
g(t); | |
var r = e.val(); | |
"." === r.slice(-1) && (r = r.slice(0, -1) + ","), l(r) | |
} else { | |
var r = s(e.val()); | |
l(e.val()) | |
} | |
u(t), p = e.val() | |
} | |
var b = a.wrnMaskPrefix || "", | |
h = null, | |
p = e.val(); | |
i.$parsers.unshift(s), i.$render = function() { | |
var n = i.$modelValue.toString().split("."), | |
t = n[0], | |
r = n[1] ? n[1].substring(0, 2) : "00", | |
e = "00"; | |
return r += e.substring(0, e.length - r.length), l(t + r) | |
}, e.bind("change", d), e.bind("paste cut", f), e.bind("keydown", f), e.bind("keyup", f) | |
} | |
return { | |
priority: 100, | |
restrict: "A", | |
require: "ngModel", | |
link: r | |
} | |
} | |
angular.module("warren.common.masks.bankcurrency", []).directive("wrnMaskBankCurrency", n), n.$inject = ["$filter", "$browser"] | |
}(); | |
! function() { | |
"use strict"; | |
function r(r, e) { | |
function n(n, t, a, l) { | |
function i(e) { | |
if (0 === e && (e = "0"), e = (e || "").toString().replace(k, "").replace(/,/, ".").replace(/,/g, ""), "" === e) return void t.val(""); | |
var n = e.split(".")[0] || "", | |
a = e.split(".")[1]; | |
n = r("number")(n).replace(/,/g, "."), a && (a = a.substring(0, 2)), g && (n = g + n), "string" == typeof a ? t.val(n + "," + a) : t.val(n) | |
} | |
function c(r) { | |
if (r) return r = (r || "").toString().replace(k, "").replace(/,/, ".").replace(/,/g, ""), r = parseFloat(r), r || 0 === r ? r : null | |
} | |
function s() { | |
for (var r = t[0].selectionStart, e = t[0].selectionEnd, n = t.val().substring(0, r), a = 0, l = 0; l < r && !(l > n.length); l++) /[^0-9]/.test(n[l]) && a++; | |
return { | |
rawStart: r, | |
rawEnd: e, | |
start: r - a, | |
end: e - a | |
} | |
} | |
function o(r) { | |
for (var e = t.val(), n = r.start, a = r.end, l = 0; l < n && !(l > e.length); l++) /[^0-9]/g.test(e[l]) && (n++, a++); | |
"," === e[l] && (n++, a++), t[0].selectionStart = n, t[0].selectionEnd = n | |
} | |
function u(r) { | |
var e = r.rawStart, | |
n = y, | |
a = n[e], | |
l = n[e + 1], | |
i = (n[e - 1], t.val()); | |
"." === a ? t.val(i.slice(0, e) + i.slice(e + 1)) : 0 === e && "," === l && t.val(i.slice(e + 1)) | |
} | |
function v(r) { | |
var e = r.rawStart, | |
n = y, | |
a = n[e], | |
l = (n[0], n[e + 1], n[e - 1]); | |
t.val(); | |
1 === e && "0" === l && "," === a && (r.start = 0, r.end = 0) | |
} | |
function f(r) { | |
var e = t.val(); | |
"," === e && (r.start = 2, r.end = 2) | |
} | |
function d(r) { | |
b = r && r.keyCode, b && 9 <= b && b <= 40 || e.defer(p) | |
} | |
function p(r) { | |
var e = s(); | |
if (46 === b && u(e), 8 === b && v(e), 188 === b && f(e), 110 === b) { | |
f(e); | |
var n = t.val(); | |
"." === n.slice(-1) && (n = n.slice(0, -1) + ","), i(n) | |
} else { | |
var n = c(t.val()); | |
i(t.val()) | |
} | |
o(e), y = t.val() | |
} | |
var g = a.wrnMaskPrefix || "", | |
w = ("false" !== a.wrnMaskAllowZero, a.wrnMaskType || "int"), | |
k = "int" === w ? /[^0-9]/g : /[^0-9,]/g, | |
b = null, | |
y = t.val(); | |
l.$parsers.push(c), l.$render = function() { | |
return i(l.$modelValue) | |
}, t.bind("change", p), t.bind("paste cut", d), t.bind("keydown", d), t.bind("keyup", d) | |
} | |
return { | |
priority: 100, | |
restrict: "A", | |
require: "ngModel", | |
link: n | |
} | |
} | |
angular.module("warren.common.masks.currency", []).directive("wrnMaskCurrency", r), r.$inject = ["$filter", "$browser"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, c) { | |
function t(t) { | |
return n(function(n, r) { | |
c.put("/api/v2/account/crm-unsubscribe-commit/" + t).then(function(c) { | |
n(c.data) | |
}, function(n) { | |
r(n.data) | |
}) | |
}) | |
} | |
var r = { | |
unsubscribe: t | |
}; | |
return r | |
} | |
n.$inject = ["$q", "wrnBackend"], angular.module("warren.common.models.crm", []).factory("wrnCrm", n) | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, i) { | |
function e() { | |
return n(function(n, t) { | |
i.get("/api/v2/account/invites/mine").then(function(t) { | |
n(t.data) | |
}, function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function a(t) { | |
return n(function(n, e) { | |
i.put("/api/v2/account/invites/add", { | |
email: t | |
}).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function c(t) { | |
return n(function(n, e) { | |
i.post("/api/v2/account/invites/resend", { | |
email: t | |
}).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
var u = { | |
mine: e, | |
invite: a, | |
resend: c | |
}; | |
return u | |
} | |
angular.module("warren.common.models.invites", []).factory("wrnInvites", n), n.$inject = ["$q", "wrnSession", "wrnBackend"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, i) { | |
function o() { | |
return n(function(n, t) { | |
n(s) | |
}) | |
} | |
function a() { | |
return n(function(n, t) { | |
i.get("/api/v2/logs/count").then(function(t) { | |
d = t.data.unreadLogsCount, n(t.data) | |
}, function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function u() { | |
return s | |
} | |
function e() { | |
for (var t = [], o = 0; o < s.length && !s[o].isRead; o++) s[o].isRead = !0, t.push(s[o]._id); | |
return n(t.length ? function(n, o) { | |
i.put("/api/v2/logs/read", { | |
ids: t | |
}).then(function(t) { | |
d = 0, n(t.data) | |
}, function(n) { | |
o(n.data) | |
}) | |
} : function(n, t) { | |
n() | |
}) | |
} | |
function r() { | |
for (var n = 0, t = 0; t < s.length && !s[t].isRead; t++) n += 1; | |
return n || d | |
} | |
function c() { | |
return n(function(n, t) { | |
i.get("/api/v2/logs/mine").then(function(t) { | |
s = t.data.logs, n({ | |
notifications: s, | |
hasNewNotification: f() | |
}) | |
}, function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function f() { | |
var n = s[0]; | |
return !(!n || n.isRead) | |
} | |
var s = [], | |
d = 0, | |
l = { | |
syncGetAll: u, | |
getAll: o, | |
getUnreadCount: a, | |
sync: c, | |
markAsRead: e, | |
unreadAmount: r | |
}; | |
return l | |
} | |
angular.module("warren.common.models.notifications", []).factory("wrnNotifications", n), n.$inject = ["$q", "wrnSession", "wrnBackend"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t, n) { | |
function o(o) { | |
return t(function(t, i) { | |
n.post("/api/v2/portfolios/builder/message", o).then(function(n) { | |
t(n.data) | |
}, function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function i(o) { | |
return t(function(t, i) { | |
n.post("/api/v2/portfolios/create", o).then(function(n) { | |
t(n.data) | |
}, function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function a() { | |
return t(function(t, o) { | |
n.get("/api/v2/portfolios/mine").then(function(n) { | |
t(n.data) | |
}, function(t) { | |
o(t.data) | |
}) | |
}) | |
} | |
function u(o) { | |
return t(function(t, i) { | |
n.get("/api/v2/portfolios/single/" + o).then(function(n) { | |
t(n.data.portfolio) | |
}, function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function e(o) { | |
return t(function(t, i) { | |
n.get("/api/v2/portfolios/single/" + o + "/performance").then(function(n) { | |
t(n.data) | |
}, function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function c(o) { | |
return t(function(t, i) { | |
n.post("/api/v2/portfolios/chart", o).then(function(n) { | |
t(n.data) | |
}, function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function f(o, i) { | |
return t(function(t, a) { | |
n.put("/api/v2/portfolios/single/" + o, i).then(function(n) { | |
t(n.data) | |
}, function(t) { | |
a(t.data) | |
}) | |
}) | |
} | |
function r(o) { | |
return t(function(t, i) { | |
n.delete_("/api/v2/portfolios/single/" + o).then(function(n) { | |
t(n.data) | |
}, function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function p() { | |
return t(function(t, o) { | |
n.get("api/v2/portfolios/funds").then(function(n) { | |
t(g(n.data)) | |
}, function(t) { | |
o(t.data) | |
}) | |
}) | |
} | |
function d(o) { | |
return t(function(t, i) { | |
n.get("api/v2/portfolios/fund/" + o).then(function(n) { | |
t(g(n.data)) | |
}, function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function s() { | |
return t(function(t, o) { | |
n.get("api/v2/portfolios/suggestions").then(function(n) { | |
t(g(n.data)) | |
}, function(t) { | |
o(t.data) | |
}) | |
}) | |
} | |
function l(o) { | |
return t(function(t, i) { | |
n.put("/api/v2/portfolios/single/" + o + "/visit").then(function(n) { | |
t(g(n.data)) | |
}, function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function g(t) { | |
for (var n = 0; n < t.length; n++) { | |
for (var o = t[n], i = {}, a = 0; a < o.allocations.length; a++) { | |
var u = o.allocations[a]; | |
i[u.type] || (i[u.type] = {}), i[u.type][u.subtype] || (i[u.type][u.subtype] = []), i[u.type][u.subtype].push(u) | |
} | |
o.infos = i | |
} | |
return t | |
} | |
function h(o) { | |
return t(function(t, i) { | |
n.post("/api/v2/portfolios/group/create", o).then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function v(o, i) { | |
return t(function(t, a) { | |
n.put("/api/v2/portfolios/group/" + o + "/update", i).then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
a(t.data) | |
}) | |
}) | |
} | |
function m(o) { | |
return t(function(t, i) { | |
n.post("/api/v2/portfolios/group/invite", o).then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function y(o, i, a) { | |
return t(function(t, u) { | |
n.put("/api/v2/portfolios/group/" + o + "/member/" + i + "/remove", a).then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
u(t.data) | |
}) | |
}) | |
} | |
function b(o, i) { | |
return t(function(t, a) { | |
n.post("/api/v2/portfolios/group/" + o + "/admin", i).then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
a(t.data) | |
}) | |
}) | |
} | |
function I(o) { | |
return t(function(t, i) { | |
n.put("/api/v2/portfolios/group/invite/" + o + "/accept").then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function B(o) { | |
return t(function(t, i) { | |
n.put("/api/v2/portfolios/group/invite/" + o + "/cancel").then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
i(t.data) | |
}) | |
}) | |
} | |
function P() { | |
return t(function(t, o) { | |
n.get("/api/v2/portfolios/group/invites/mine").then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
o(t.data) | |
}) | |
}) | |
} | |
function k(o, i) { | |
return t(function(t, a) { | |
n.post("/api/v2/portfolios/group/" + o + "/reminder", i).then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
a(t.data) | |
}) | |
}) | |
} | |
function w(o, i, a) { | |
return t(function(t, u) { | |
n.post("/api/v2/portfolios/images/search", { | |
query: o, | |
page: i, | |
perPage: a | |
}).then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
u(t.data) | |
}) | |
}) | |
} | |
function q(o, i) { | |
return t(function(t, a) { | |
n.put("/api/v2/portfolios/single/" + o + "/background", i).then(function(n) { | |
t(n.data) | |
}).catch(function(t) { | |
a(t.data) | |
}) | |
}) | |
} | |
var A = { | |
save: i, | |
getAll: a, | |
getById: u, | |
getPerformanceById: e, | |
getChart: c, | |
getFunds: p, | |
getFundById: d, | |
getSuggestions: s, | |
update: f, | |
remove: r, | |
visitPortfolio: l, | |
builder: o, | |
searchPhotos: w, | |
updateBackground: q, | |
share: h, | |
editGroup: v, | |
invite: m, | |
setAdmin: b, | |
acceptInvite: I, | |
cancelInvite: B, | |
removeMember: y, | |
reminderMember: k, | |
getInvites: P | |
}; | |
return A | |
} | |
angular.module("warren.common.models.portfolio", []).factory("wrnPortfolio", t), t.$inject = ["$q", "wrnBackend"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, o, i) { | |
function a(t) { | |
return n(function(n, i) { | |
var a = "/api/v2/notifications/posts"; | |
t && (a += "/10/" + t), o.post(a).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
i(n.data) | |
}) | |
}) | |
} | |
function c() { | |
return n(function(n, t) { | |
o.get("/api/v2/notifications/posts/mine").then(function(t) { | |
n(t.data) | |
}, function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function u(t) { | |
return n(function(n, i) { | |
o.get("/api/v2/notifications/posts/single/" + t).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
i(n.data) | |
}) | |
}) | |
} | |
function e(t) { | |
return n(function(n, i) { | |
o.put("/api/v2/notifications/posts/public-read/" + t).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
i(n.data) | |
}) | |
}) | |
} | |
function r(t, i) { | |
return n(function(n, a) { | |
o.put("/api/v2/notifications/posts/track/" + t, i).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
a(n.data) | |
}) | |
}) | |
} | |
function f(t) { | |
return n(function(n, o) { | |
i.post("https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyB9O_xTdjl8brvydY-ocwQCZLb0CJU1M6k", { | |
longUrl: t | |
}).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
o(n.data) | |
}) | |
}) | |
} | |
var s = { | |
getAll: a, | |
getMine: c, | |
getById: u, | |
track: r, | |
publicRead: e, | |
getShortenedURL: f | |
}; | |
return s | |
} | |
angular.module("warren.common.models.post", []).factory("wrnPost", n), n.$inject = ["$q", "wrnSession", "wrnBackend", "$http"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, i) { | |
function e(t) { | |
return n(function(n, e) { | |
i.post("/api/v2/invoices/create", t).then(function(t) { | |
n(t.data.invoice) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function a(t) { | |
return n(function(n, e) { | |
i.post("/api/v2/transactions/message", t).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function o(t) { | |
return n(function(n, e) { | |
i.post("/api/v2/deposits/create", t).then(function(t) { | |
n(t.data.deposit) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function c(t) { | |
return n(function(n, e) { | |
i.post("/api/v2/withdraws/create", t).then(function(t) { | |
n(t.data.withdraw) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function u() { | |
return n(function(n, t) { | |
i.get("/api/v2/finances/mine").then(function(t) { | |
n(t.data) | |
}, function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function f(t) { | |
return n(function(n, e) { | |
i.get("/api/v2/finances/portfolio/" + t).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function r(t) { | |
return n(function(n, e) { | |
i.get("/api/v2/invoices/single/" + t).then(function(t) { | |
n(t.data.invoice) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function s(t) { | |
return n(function(n, e) { | |
i.get("/api/v2/deposits/single/" + t).then(function(t) { | |
n(t.data.deposit) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function d(t) { | |
return n(function(n, e) { | |
i.get("/api/v2/withdraws/single/" + t).then(function(t) { | |
n(t.data.withdraw) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function p(t) { | |
return n(function(n, e) { | |
i.post("/api/v2/invoices/single/" + t + "/send-email").then(function(t) { | |
n() | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function v(t) { | |
return n(function(n, e) { | |
i.post("/api/v2/deposits/single/" + t + "/send-email", { | |
resume: !0 | |
}).then(function(t) { | |
n() | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function l(t) { | |
return n(function(n, e) { | |
i.put("/api/v2/deposits/single/" + t + "/cancel").then(function(t) { | |
n(t.data) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function g(t) { | |
return n(function(n, e) { | |
i.put("/api/v2/invoices/single/" + t + "/cancel").then(function(t) { | |
n(t.data) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function h(t) { | |
return n(function(n, e) { | |
i.put("/api/v2/withdraws/single/" + t + "/cancel").then(function(t) { | |
n(t.data) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function m() { | |
return n(function(n, t) { | |
i.get("/api/v2/finances/investment-summary/").then(function(t) { | |
n(t.data) | |
}, function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function w(t) { | |
return n(function(n, e) { | |
i.get("/api/v2/finances/positions/" + t).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function y(t) { | |
return n(function(n, e) { | |
i.post("/api/v2/finances/fund-performance/", t).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
var I = { | |
message: a, | |
createInvoice: e, | |
createDeposit: o, | |
createWithdraw: c, | |
getInvoiceById: r, | |
getDepositById: s, | |
getWithdrawById: d, | |
sendInvoiceByEmail: p, | |
sendDepositByEmail: v, | |
getAll: u, | |
getAllByPortoflio: f, | |
cancelDeposit: l, | |
cancelInvoice: g, | |
cancelWithdraw: h, | |
getInvestmentSummary: m, | |
getPositions: w, | |
getFundPerformance: y | |
}; | |
return I | |
} | |
n.$inject = ["$q", "wrnSession", "wrnBackend"], angular.module("warren.common.models.transaction", []).factory("wrnTransaction", n) | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, a, c) { | |
function o(n) { | |
N = n, S = warren.utils.deepcopy(n), U = n.isBlack, c.setPerson(n._id, n.username) | |
} | |
function u() { | |
return _black | |
} | |
function e() { | |
return n(function(n, t) { | |
a.get("/api/v2/account/me").then(function(t) { | |
o(t.data.customer), n(N) | |
}).catch(function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function u() { | |
return U | |
} | |
function i(t) { | |
return t ? N : n(function(n, t) { | |
N ? n(N) : e().then(function(t) { | |
n(t) | |
}, function(n) { | |
t(n) | |
}) | |
}) | |
} | |
function s(c, u) { | |
return n(function(n, e) { | |
a.post("/api/v2/account/login", { | |
email: c, | |
password: u | |
}).then(function(a) { | |
var c = a.data.accessToken; | |
t.set("accounts.accessToken", c), o(a.data.user), n(a.data.user) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function r(c) { | |
return n(function(n, u) { | |
a.post("/api/v2/account/instant-login/commit", { | |
hash: c | |
}).then(function(a) { | |
var c = a.data.accessToken; | |
t.set("accounts.accessToken", c), o(a.data.user), n(a.data.user) | |
}, function(n) { | |
u(n.data) | |
}) | |
}) | |
} | |
function f(c) { | |
return n(function(n, u) { | |
a.post("/api/v2/account/instant-login/accept", { | |
hash: c | |
}).then(function(a) { | |
var c = a.data.accessToken; | |
t.set("accounts.accessToken", c), o(a.data.user), n(a.data.user) | |
}, function(n) { | |
u(n.data) | |
}) | |
}) | |
} | |
function d(c) { | |
return n(function(n, u) { | |
a.post("/api/v2/account/facebook", { | |
facebook: c | |
}).then(function(a) { | |
var c = a.data.accessToken; | |
t.set("accounts.accessToken", c), o(a.data.user), n(a.data.user) | |
}, function(n) { | |
u(n.data) | |
}) | |
}) | |
} | |
function p(n, a) { | |
return t.set("accounts.accessToken", n), o(a), a | |
} | |
function h() { | |
return n(function(n, t) { | |
a.post("/api/v2/account/logout").then(function(t) { | |
n() | |
}, function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function v(t) { | |
return n(function(n, c) { | |
a.post("/api/v2/account/reset-password/request", { | |
email: t | |
}).then(function(t) { | |
n() | |
}, function(n) { | |
c(n.data) | |
}) | |
}) | |
} | |
function l(t) { | |
return n(function(n, c) { | |
a.post("/api/v2/account/reset-password/check", { | |
hash: t | |
}).then(function(t) { | |
n() | |
}, function(n) { | |
c(n.data) | |
}) | |
}) | |
} | |
function k(c, u) { | |
return n(function(n, e) { | |
a.post("/api/v2/account/reset-password/commit", { | |
hash: c, | |
password: u | |
}).then(function(a) { | |
if (a.data.accessToken) { | |
var c = a.data.accessToken; | |
t.set("accounts.accessToken", c), o(a.data.user) | |
} | |
n() | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function m(t) { | |
return n(function(n, c) { | |
a.post("/api/v2/account/setup/check", { | |
hash: t | |
}).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
c(n.data) | |
}) | |
}) | |
} | |
function g(c, u) { | |
return n(function(n, e) { | |
a.post("/api/v2/account/setup/commit", { | |
hash: c, | |
password: u | |
}).then(function(a) { | |
var c = a.data.accessToken; | |
t.set("accounts.accessToken", c), o(a.data.user), n() | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function w(c) { | |
return n(function(n, u) { | |
a.post("/api/v2/account/verify-email/commit", { | |
hash: c | |
}).then(function(a) { | |
if (a.data.accessToken) { | |
var c = a.data.accessToken; | |
t.set("accounts.accessToken", c), o(a.data.user) | |
} | |
n(a.data.user) | |
}, function(n) { | |
u(n.data) | |
}) | |
}) | |
} | |
function T(t) { | |
return n(function(n, c) { | |
a.post("/api/v2/account/setup/request", { | |
email: t | |
}).then(function(t) { | |
n(t.data) | |
}, function(n) { | |
c(n.data) | |
}) | |
}) | |
} | |
function b(t, c, o, u) { | |
var e = "/api/v2/account/upload"; | |
return o && (e += "/" + o), n(function(n, o) { | |
a.upload(e, c, { | |
type: t | |
}).then(function(t) { | |
n(t.data.path) | |
}, function(n) { | |
o(n.data) | |
}, u) | |
}) | |
} | |
function y(c, u) { | |
return n(function(n, e) { | |
a.post("/api/v2/account/signup", { | |
email: c, | |
password: u | |
}).then(function(a) { | |
var c = a.data.accessToken; | |
t.set("accounts.accessToken", c), o(a.data.user), n(a.data.user) | |
}, function(n) { | |
e(n.data) | |
}) | |
}) | |
} | |
function A(n) {} | |
function C() {} | |
function B(t, c) { | |
var u = warren.utils.deepdiff(S, t), | |
e = { | |
user: u | |
}; | |
return c && (e.password = c), n(function(n, t) { | |
return Object.keys(u).length ? void a.put("/api/v3/account/update", e).then(function(t) { | |
o(t.data), n(t.data) | |
}).catch(function(n) { | |
t(n.data) | |
}) : void n(N) | |
}) | |
} | |
function P(t) { | |
var c = warren.utils.deepdiff(S, t); | |
return n(function(n, t) { | |
return Object.keys(c).length ? void a.put("/api/v2/account/update", c).then(function(t) { | |
o(t.data), n(t.data) | |
}).catch(function(n) { | |
t(n.data) | |
}) : void n(N) | |
}) | |
} | |
function _() { | |
return n(function(n, t) { | |
a.post("/api/v2/bank-accounts/create").then(function(t) { | |
n(t.data) | |
}).catch(function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function E(t) { | |
return n(function(n, c) { | |
a.delete_("/api/v2/bank-accounts/single/" + t).then(function(t) { | |
n(t.data) | |
}).catch(function(n) { | |
c(n.data) | |
}) | |
}) | |
} | |
function L(t) { | |
return n(function(n, c) { | |
a.get("/api/v2/bank-accounts/mine").then(function(a) { | |
for (var o = 0; o < a.data.bankAccounts.length; o++) a.data.bankAccounts[o]._id === t && n(a.data.bankAccounts[o]); | |
c() | |
}).catch(function(n) { | |
c(n.data) | |
}) | |
}) | |
} | |
function j(t, c) { | |
var o = { | |
currentPassword: t, | |
newPassword: c | |
}; | |
return n(function(n, t) { | |
a.put("/api/v2/account/password", o).then(function(t) { | |
n(t.data) | |
}).catch(function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function q(t, c) { | |
var o = { | |
currentPassword: t, | |
newEmail: c | |
}; | |
return n(function(n, t) { | |
a.post("/api/v2/account/change-email", o).then(function(t) { | |
n(t.data) | |
}).catch(function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
function I(t) { | |
return n(function(n, c) { | |
a.put("/api/v2/account/configurations/update", t).then(function(t) { | |
n(t.data) | |
}).catch(function(n) { | |
c(n.data) | |
}) | |
}) | |
} | |
function O(t) { | |
return n(function(n, c) { | |
a.post("/api/v2/account/terms/mine", { | |
names: t | |
}).then(function(t) { | |
n(t.data) | |
}).catch(function(n) { | |
c(n.data) | |
}) | |
}) | |
} | |
function $(t) { | |
return n(function(n, c) { | |
a.put("/api/v2/account/terms/accept", { | |
name: t | |
}).then(function(t) { | |
n(t.data) | |
}).catch(function(n) { | |
c(n.data) | |
}) | |
}) | |
} | |
function x() { | |
return n(function(n, t) { | |
a.delete_("/api/v2/account/delete").then(function(t) { | |
n(t.data) | |
}).catch(function(n) { | |
t(n.data) | |
}) | |
}) | |
} | |
var N = null, | |
S = null, | |
U = null, | |
V = { | |
become: e, | |
getCurrent: i, | |
isBlack: u, | |
login: s, | |
instantLogin: r, | |
instantLoginIntranet: f, | |
facebookLogin: d, | |
logout: h, | |
reset: v, | |
resetCheck: l, | |
resetConfirm: k, | |
setupCheck: m, | |
setupConfirm: g, | |
verifyEmail: w, | |
resendVerifyEmail: T, | |
addBankAccount: _, | |
removeBankAccount: E, | |
getBankAccount: L, | |
updatePassword: j, | |
updateEmail: q, | |
signup: y, | |
getById: A, | |
getAll: C, | |
update: B, | |
upload: b, | |
externalLogin: p, | |
updateConfigs: I, | |
getTerms: O, | |
acceptTerm: $, | |
deleteAccount: x, | |
updateNotificationsConfig: P | |
}; | |
return V | |
} | |
n.$inject = ["$q", "wrnSession", "wrnBackend", "wrnCrash"], angular.module("warren.common.models.user", []).factory("wrnUser", n) | |
}(); | |
! function() { | |
"use strict"; | |
function c(c) { | |
return c.c3 | |
} | |
angular.module("warren.common.services.c3", []).factory("c3", c), c.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t) { | |
return t.Chartist | |
} | |
angular.module("warren.common.services.chartist", []).factory("chartist", t), t.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n) { | |
return n.Moip || {} | |
} | |
angular.module("warren.common.services.moip", []).factory("wrnMoip", n), n.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n) { | |
return n.moment.locale("pt-br"), n.moment | |
} | |
angular.module("warren.common.services.moment", []).factory("moment", n), n.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n) { | |
function r(r, o) { | |
return n(function(n, t) { | |
r.then(n, function(r) { | |
n(o) | |
}) | |
}) | |
} | |
var o = { | |
optional: r | |
}; | |
return o | |
} | |
angular.module("warren.common.services.promise", []).factory("promise", n).factory("pr", n), n.$inject = ["$q"] | |
}(); | |
! function() { | |
"use strict"; | |
function i(i, e, n, t, r) { | |
function a(i, e) { | |
i && (d.name = i), e && (d.email = e) | |
} | |
function o(i) { | |
d.affiliate = i | |
} | |
function l() { | |
return !!d && !!d.affiliate | |
} | |
function s() { | |
return !!m | |
} | |
function u(n, t) { | |
return i(function(i, r) { | |
var o = !!e.Waitlisted; | |
if (!o) return void r("Waitlisted blocked by client or not loaded"); | |
if (a(n, t), !d.email) return void r("Ops... Precisamos do seu e-mail."); | |
var l = new Waitlisted.Api({ | |
domain: "oiwarren.app.waitlisted.co" | |
}); | |
l.reserve({ | |
email: d.email, | |
name: d.name, | |
refcode: d.affiliate | |
}).then(function(e) { | |
m = e, i(e) | |
}, function(i) { | |
r(i.errors && i.errors.email ? 404 : "Ops... Tivemos um problema.") | |
}) | |
}) | |
} | |
function f(n, t) { | |
return i(function(i, r) { | |
var o = !!e.Waitlisted; | |
if (!o) return void r("Waitlisted blocked by client or not loaded"); | |
if (a(n, t), !d.email) return void r("Ops... Precisamos do seu e-mail."); | |
var l = new Waitlisted.Api({ | |
domain: "oiwarren.app.waitlisted.co" | |
}); | |
l.position(d.email).then(function(e) { | |
m = e, i(e) | |
}, function(i) { | |
r("E-mail não cadastrado.") | |
}) | |
}) | |
} | |
function c() { | |
return m | |
} | |
var d = (!!e.Waitlisted, r.environment, { | |
name: null, | |
email: null, | |
affiliate: null | |
}), | |
m = null, | |
v = { | |
config: a, | |
referral: o, | |
affiliate: l, | |
reserve: u, | |
position: f, | |
reserved: s, | |
reservation: c | |
}; | |
return v | |
} | |
angular.module("warren.common.services.waitlist", []).factory("waitlist", i), i.$inject = ["$q", "$window", "wrnFlash", "wrnResources", "config"] | |
}(); | |
! function() { | |
"use strict"; | |
function a() { | |
function a(a, e) { | |
if (0 === e || isNaN(e)) return a; | |
var n = r(e), | |
t = a.day(), | |
u = Math.abs(e), | |
o = 0; | |
0 === t && n === -1 ? o = 1 : 6 === t && 1 === n && (o = 1); | |
var s = u; | |
0 !== t && 6 !== t && n > 0 ? s += t : 0 !== t && 6 !== t && n < 0 && (s += 6 - t); | |
var c = Math.max(Math.floor(s / 5) - 1, 0) + (s > 5 && s % 5 > 0 ? 1 : 0); | |
return o += u + 2 * c, a.add(n * o, "days"), a | |
} | |
function r(a) { | |
return a = +a, a > 0 ? 1 : -1 | |
} | |
return { | |
addWeekDays: a | |
} | |
} | |
angular.module("warren.common.services.weekdays", []).factory("weekdays", a), a.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t, i, s) { | |
function o(t, i) { | |
if ("prd" === y.key || "hml" === y.key) { | |
if (f) { | |
var s = "undefined" != typeof i ? i : t; | |
e.ga("send", "pageView", { | |
page: "/" + t, | |
title: s | |
}) | |
} | |
if (g && e.fbq("track", "PageView"), S) try { | |
e.mixpanel.track("PageView", { | |
page: "/" + t, | |
title: s | |
}) | |
} catch (e) {} | |
} | |
} | |
function r(t, i, s, o, r) { | |
"prd" !== y.key && "hml" !== y.key || f && e.ga("send", "event", t, i, s, o, r) | |
} | |
function a(t, i, s, o) { | |
"prd" !== y.key && "hml" !== y.key || f && e.ga("send", "timing", t, i, s, o) | |
} | |
function d(t, i) { | |
if (("prd" === y.key || "hml" === y.key) && g) { | |
var i = "undefined" != typeof i ? i : {}; | |
e.fbq("trackCustom", t, i) | |
} | |
} | |
function n(e) { | |
if ("prd" === y.key || "hml" === y.key) return e ? void(S && mixpanel.identify(e._id.toString())) : null | |
} | |
function c(e, t, i, s) { | |
if ("prd" === y.key || "hml" === y.key) { | |
var o = p(e); | |
if (S) try { | |
u(t), m(t), e && "Suitability Finished" == t && s && mixpanel.alias(o.traitsOnce.customerId), e && (0 !== Object.keys(o.traitsOnce).length && mixpanel.people.set_once(o.traitsOnce), mixpanel.people.set(o.traits)), mixpanel.track(t, i) | |
} catch (e) {} | |
if (f) try { | |
ga("send", "event", "All", t, null, 1) | |
} catch (e) {} | |
} | |
} | |
function l() { | |
try { | |
mixpanel && mixpanel.reset() | |
} catch (e) {} | |
} | |
function u(e) { | |
var t = ["Suitability Started", "Suitability Finished", "Builder Started", "Builder Finished", "Register Step 1", "Register Step 2", "Register Step 3", "Register Step 4", "Deposit Created", "Invite Sent"], | |
i = { | |
"Suitability Started": "Suitability Finished", | |
"Suitability Finished": "Builder Started", | |
"Builder Started": "Builder Finished", | |
"Builder Finished": "Register Step 1", | |
"Register Step 1": "Register Step 2", | |
"Register Step 2": "Register Step 3", | |
"Register Step 3": "Register Step 4", | |
"Register Step 4": "Deposit Created" | |
}; | |
t.includes(e) && mixpanel.time_event(i[e]) | |
} | |
function m(e) { | |
document.addEventListener("DOMContentLoaded", function(t) { | |
var i = document.querySelectorAll(".mixpanel-trackclick"); | |
i.forEach(function(t) { | |
mixpanel.track_links(t, e + " (links)", { | |
category: t.getAttribute("mix-category"), | |
device: t.getAttribute("mix-device"), | |
position: t.getAttribute("mix-position"), | |
description: t.getAttribute("mix-description"), | |
text: t.innerText | |
}) | |
}) | |
}) | |
} | |
function p(e) { | |
var t = {}, | |
i = {}; | |
if (S) try { | |
e && (void 0 !== e._id && (i.customerId = e._id.toString()), void 0 !== e.name && (t.customerName = e.name), void 0 !== e.totalBalance && (t.customerTotalBalance = e.totalBalance), void 0 !== e.totalEarnings && (t.customerTotalEarnings = e.totalEarnings), void 0 !== e.createdAt && (i.customerCreatedAt = e.createdAt), void 0 !== e.isEmailVerified && (t.customerIsEmailVerified = e.isEmailVerified), void 0 !== e.isPasswordSet && (t.customerIsPasswordSet = e.isPasswordSet), void 0 !== e.isSuitabilityStarted && (t.customerIsSuitabilityStarted = e.isSuitabilityStarted), void 0 !== e.isSuitabilityFinished && (t.customerIsSuitabilityFinished = e.isSuitabilityFinished), void 0 !== e.isPortfolioStarted && (t.customerIsPortfolioStarted = e.isPortfolioStarted), void 0 !== e.isPortfolioFinished && (t.customerIsPortfolioFinished = e.isPortfolioFinished), void 0 !== e.portfolioFirstFinishedAt && (i.customerPortfolioFirstFinishedAt = e.portfolioFirstFinishedAt), void 0 !== e.isRegisterStarted && (t.customerIsRegisterStarted = e.isRegisterStarted), void 0 !== e.isRegisterFinished && (t.customerIsRegisterFinished = e.isRegisterFinished), void 0 !== e.isRegisterValidated && (t.customerIsRegisterValidated = e.isRegisterValidated), void 0 !== e.registerNotValidatedReason && (t.customerRegisterNotValidatedReason = e.registerNotValidatedReason), void 0 !== e.isRegisterVerified && (t.customerIsRegisterVerified = e.isRegisterVerified), void 0 !== e.isRegisterRejected && (t.customerIsRegisterRejected = e.isRegisterRejected), void 0 !== e.isRegisterModified && (t.customerIsRegisterModified = e.isRegisterModified), void 0 !== e.hasPortfolio && (t.customerHasPortfolio = e.hasPortfolio), void 0 !== e.registerRejectedReason && (t.customerRegisterRejectedReason = e.registerRejectedReason), void 0 !== e.registerLastStartedAt && (i.customerRegisterLastStartedAt = e.registerLastStartedAt), void 0 !== e.isInvestStarted && (t.customerIsInvestStarted = e.isInvestStarted), void 0 !== e.isInvestFinished && (t.customerIsInvestFinished = e.isInvestFinished), void 0 !== e.status && (t.customerStatus = e.status), void 0 !== e.dash && (t.customerDash = e.dash), void 0 !== e.crmCommunicationType && (t.customerCrmCommunicationType = e.crmCommunicationType), void 0 !== e.isPreregistered && (t.customerIsPreregistered = e.isPreregistered), void 0 !== e.acceptedTerms && (t.customerAcceptedTerms = e.acceptedTerms), void 0 !== e.lastAcceptedTermsAt && (t.customerLastAcceptedTermsAt = e.lastAcceptedTermsAt), void 0 !== e.firstAcceptedTermsAt && (i.customerFirstAcceptedTermsAt = e.firstAcceptedTermsAt), void 0 !== e.acceptedTermsCount && (t.customerAcceptedTermsCount = e.acceptedTermsCount), void 0 !== e.goWaitList && (t.customerGoWaitList = e.goWaitList), void 0 !== e.canCreateInvoice && (t.customerCanCreateInvoice = e.canCreateInvoice), void 0 !== e.depositAcceptedCount && (t.customerDepositAcceptedCount = e.depositAcceptedCount), void 0 !== e.depositFirstAcceptedAt && (i.customerDepositFirstAcceptedAt = e.depositFirstAcceptedAt), void 0 !== e.depositLastAcceptedAt && (t.customerDepositLastAcceptedAt = e.depositLastAcceptedAt), void 0 !== e.waitlistUnlockedVia && (i.customerWaitlistUnlockedVia = e.waitlistUnlockedVia), void 0 !== e.waitlistUnlockedAt && (i.customerWaitlistUnlockedAt = e.waitlistUnlockedAt), void 0 !== e.personalProfile && (void 0 !== e.personalProfile.sex && (t.customerSex = e.personalProfile.sex), void 0 !== e.personalProfile.birthDate && (t.customerBirthDate = e.personalProfile.birthDate), void 0 !== e.personalProfile.birthState && (t.customerBirthState = e.personalProfile.birthState), void 0 !== e.personalProfile.profession && (t.customerProfession = e.personalProfile.profession), void 0 !== e.personalProfile.maritalStatus && (t.customerMaritalStatus = e.personalProfile.maritalStatus)), void 0 !== e.address && void 0 !== e.address.state && (t.customerState = e.address.state), void 0 !== e.bankAccounts && void 0 !== e.bankAccounts.bank && (t.customerBank = e.bankAccounts.map(function(e) { | |
return e.bank | |
})), void 0 !== e.investmentProfile && (void 0 !== e.investmentProfile.monthlyIncome && (t.customerMonthlyIncome = e.investmentProfile.monthlyIncome), void 0 !== e.investmentProfile.deposit && (t.customerPatrimony = e.investmentProfile.deposit)), void 0 !== e.suitability && void 0 !== e.suitability.computedProfileType && (t.customerComputedProfileType = e.suitability.computedProfileType)) | |
} catch (e) {} | |
return { | |
traits: t, | |
traitsOnce: i | |
} | |
} | |
function v(e) { | |
return i(function(t, i) { | |
s.post("https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyB9O_xTdjl8brvydY-ocwQCZLb0CJU1M6k", { | |
longUrl: e | |
}).then(function(e) { | |
t(e.data) | |
}, function(e) { | |
i(e.data) | |
}) | |
}) | |
} | |
var f = !!e.ga, | |
g = !!e.fbq, | |
S = (!!e.analytics, !!e.mixpanel), | |
y = t.environment, | |
h = { | |
pageView: o, | |
event: r, | |
timing: a, | |
pixelFB: d, | |
track: c, | |
signout: l, | |
identify: n, | |
getShortenedURL: v | |
}; | |
return h | |
} | |
angular.module("warren.common.services.analytics", []).factory("wrnAnalytics", e), e.$inject = ["$window", "config", "$q", "$http"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, e, t, o, r, c, i, s, a, u, m) { | |
function p(n, e, t) { | |
var o = w(); | |
return t = t || {}, t.file = e, i.upload({ | |
url: v(n), | |
method: "PUT", | |
headers: o.headers, | |
data: t | |
}) | |
} | |
function f(n) { | |
return h(t.get, [v(n), w()]) | |
} | |
function l(n) { | |
return h(t.delete, [v(n), w()]) | |
} | |
function d(n, e) { | |
return h(t.post, [v(n), e, w()]) | |
} | |
function g(n, e) { | |
return h(t.put, [v(n), e, w()]) | |
} | |
function h(e, c) { | |
var i = m.app.connection.timeslow, | |
p = m.app.connection.timeretry; | |
return n(function(n, m) { | |
var f = r(function() { | |
a.show(u.getString("common_connection_slow_message")) | |
}, i); | |
e.apply(t, c).then(function(e) { | |
r.cancel(f), a.hide(), n(e) | |
}, function(t) { | |
if (r.cancel(f), a.hide(), t.status === -1) a.show(u.getString("common_connection_timeout_message")), r(function() { | |
h(e, i).then(n, m) | |
}, p); | |
else if (401 === t.status) { | |
if ("signin" === o.current.name) return; | |
s.remove("accounts.accessToken"), s.remove("session.welcome"); | |
var c = o.current.name, | |
i = o.params; | |
o.go("signin", { | |
backTo: c, | |
params: JSON.stringify(i) | |
}) | |
} else m(t) | |
}) | |
}) | |
} | |
function v(n) { | |
n.startsWith("/") || (n = "/" + n); | |
var e = m.environment; | |
return T + ":" + e.port + n | |
} | |
function w() { | |
var n = { | |
headers: { | |
"Content-Type": "application/json" | |
}, | |
timeout: m.app.connection.timeout | |
}; | |
return s.isEmpty("accounts.accessToken") || (n.headers["Access-Token"] = s.get("accounts.accessToken")), n | |
} | |
var k = m.environment, | |
T = k.api, | |
$ = { | |
upload: p, | |
get: f, | |
delete_: l, | |
post: d, | |
put: g | |
}; | |
return $ | |
} | |
angular.module("warren.common.services.backend", []).factory("wrnBackend", n), n.$inject = ["$q", "$window", "$http", "$state", "$timeout", "$stateParams", "Upload", "wrnSession", "wrnConnectionFlash", "wrnResources", "config"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t, o) { | |
function n() { | |
var e = "queryCommandSupported" in document && document.queryCommandSupported("copy"); | |
return warren.utils.isSafari() ? e && warren.utils.browserVersion() >= 10 : e | |
} | |
function r(e) { | |
var t = u(e); | |
c(t), i(t), d(t) | |
} | |
function u(e) { | |
var t = "rtl" == document.documentElement.getAttribute("dir"), | |
o = window.pageYOffset || document.documentElement.scrollTop, | |
n = document.createElement("textarea"); | |
return n.style.fontSize = "12pt", n.style.border = "0", n.style.padding = "0", n.style.margin = "0", n.style.position = "absolute", n.style[t ? "right" : "left"] = "-9999px", n.style.top = o + "px", n.value = e, n.addEventListener("focus", window.scrollTo(0, o)), n.setAttribute("readonly", ""), document.body.appendChild(n), n | |
} | |
function c(e) { | |
e.focus(), e.setSelectionRange(0, e.value.length), document.execCommand("copy") || console.error("copy error") | |
} | |
function i(e) { | |
e.blur(), window.getSelection().removeAllRanges() | |
} | |
function d(e) { | |
document.body.removeChild(e) | |
} | |
var l = { | |
isSupported: n, | |
copy: r | |
}; | |
return l | |
} | |
angular.module("warren.common.services.clipboard", []).factory("wrnClipboard", e), e.$inject = ["$window", "$document", "config"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, e, t, o, a, r) { | |
function c(n) { | |
var e = s(); | |
e.removeClass("wrn-hidden"), e.html(n) | |
} | |
function i() { | |
var n = s(); | |
n.addClass("wrn-hidden") | |
} | |
function s() { | |
var n = r[0].getElementsByClassName("wrn-connection-flash"); | |
if (n.length) return angular.element(n[0]); | |
var e = o(l)({}); | |
return angular.element(document.getElementsByTagName("body")).append(e), e | |
} | |
var l = '<div class="wrn-connection-flash"></div>', | |
u = { | |
show: c, | |
hide: i | |
}; | |
return u | |
} | |
angular.module("warren.common.services.connectionflash", []).factory("wrnConnectionFlash", n), n.$inject = ["$window", "$timeout", "$sce", "$compile", "$rootScope", "$document"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t) { | |
function n() { | |
Object.keys(a).forEach(function(t) { | |
t.startsWith("warren.context.") && o(t) | |
}) | |
} | |
function e(t) { | |
var n = a["warren.context." + t]; | |
return n ? JSON.parse(n) : n | |
} | |
function r(t, n) { | |
try { | |
a["warren.context." + t] = JSON.stringify(n) | |
} catch (t) {} | |
} | |
function c(t) { | |
return "undefined" != typeof a["warren.context." + t] | |
} | |
function o(t) { | |
delete a["warren.context." + t] | |
} | |
var a = t.localStorage || {}, | |
i = { | |
clear: n, | |
get: e, | |
set: r, | |
has: c, | |
remove: o | |
}; | |
return i | |
} | |
angular.module("warren.common.services.context", []).factory("wrnContext", t), t.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, r) { | |
function o(n, r) { | |
l && c.configure({ | |
payload: { | |
person: { | |
id: n, | |
email: r | |
} | |
} | |
}) | |
} | |
function a() { | |
l && "local" !== r.environment.name && c.warning.apply(c, arguments) | |
} | |
function e() { | |
l && "local" !== r.environment.name && c.error.apply(c, arguments) | |
} | |
function i() { | |
l && "local" !== r.environment.name && c.critical.apply(c, arguments) | |
} | |
var c = n.Rollbar, | |
l = !!c, | |
t = { | |
setPerson: o, | |
warning: a, | |
error: e, | |
critical: i | |
}; | |
return t | |
} | |
angular.module("warren.common.services.crash", []).factory("wrnCrash", n), n.$inject = ["$window", "config"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, e, i, r, a, s, o) { | |
function d(n, t, e) { | |
return u(n, t, "alert", e) | |
} | |
function l(n, t, e) { | |
return u(n, t, "dialog", e) | |
} | |
function p(n, t, e) { | |
return u(n, t, "prompt", e) | |
} | |
function c(n, t, e) { | |
return u(n, t, "password", e) | |
} | |
function v(n, t, e) { | |
return u(n, t, "groupInvite", e) | |
} | |
function w(n, t, e) { | |
return u(n, t, "inviteDetails", e) | |
} | |
function u(t, e, o, d) { | |
d = d || {}; | |
var l = d.textCancel || "Cancelar", | |
p = d.textOk || "Continuar"; | |
return n(function(n) { | |
a.setScrollBody(!0); | |
var c = g(o, d), | |
v = '<form ng-submit="close(\'ok\')"><div class="wrn-a-fade"><div class="wrn-dialog-overlay" ng-click="close(\'cancel\')"></div><div class="wrn-box-shadow-dialog wrn-dialog wrn-dialog-{{type}}"><!-- Dialog Title --><div class="wrn-navbar wrn-navbar-absolute wrn-text-center wrn-divider-bottom wrn-bg-white"><p class="wrn-navbar-text wrn-text-u-2 wrn-color-black">' + t + '</p></div><!-- Dialog Content --><div class="wrn-dialog-wrap"><div class="wrn-dialog-content wrn-text-center wrn-text-p-3 wrn-p-b-1 wrn-p-x-1"><div class="wrn-valign"><div class="wrn-valign-middle"><div class="message" ng-bind-html="message"></div>' + c + '</div></div></div></div><!-- Dialog option buttons --><div class="wrn-text-center inputs wrn-display-inline wrn-c-12 wrn-bg-gray-4 wrn-p-x-1"><span class="wrn-p-r-1"><a href="" class="wrn-link-u-1 wrn-link" ng-click="close(\'cancel\')">' + l + '</a></span><span class="wrn-p-l-1"><a id="dialog_submit" href="" class="wrn-link-u-1 wrn-link" ng-click="close(\'ok\')"ng-keydown="close(\'ok\', $event)">' + p + "</a></span></div></div></div></form>", | |
w = a.$new(); | |
w.type = o, w.message = i.trustAsHtml(e), w.close = function(t, e) { | |
if (!e || 13 === e.keyCode) { | |
if ("prompt" === o || "password" === o) { | |
var i = document.getElementById("dialog_" + o).value; | |
t = { | |
response: t, | |
value: i | |
} | |
} | |
if ("groupInvite" === o) { | |
var r = document.getElementById("dialog_" + o).value, | |
s = document.getElementById("dialog_" + o + "Adm").checked; | |
t = { | |
response: t, | |
value: { | |
email: r, | |
isAdmin: s | |
} | |
} | |
} | |
n(t), u.remove(), a.setScrollBody(!1) | |
} | |
}; | |
var u = r(v)(w); | |
angular.element(document.getElementsByTagName("body")).append(u); | |
var m = "dialog_submit"; | |
"prompt" !== o && "password" !== o || (m = "dialog_" + o), s(function() { | |
document.getElementById(m).focus() | |
}, 50) | |
}) | |
} | |
function g(n, t) { | |
var e = (("password" === n).toString(), ("prompt" === n).toString(), ("groupInvite" === n).toString(), ("inviteDetails" === n).toString(), t.goalName || ""); | |
switch (n) { | |
case "password": | |
return '<div class="input"><input id="dialog_password" type="password"/></div>'; | |
case "prompt": | |
return '<div class="input"><input id="dialog_prompt" type="text"/></div>'; | |
case "groupInvite": | |
return '<div class="wrn-p-t-1"><p class="wrn-text-h-3 wrn-m-0">“' + e + 'â€</p><p class="wrn-text-p-5 wrn-m-t-0">Objetivo</p><p class="wrn-text-p-3 wrn-m-b-0">Insira abaixo o e-mail de quem você quer convidar a alcançar este objetivo com você.</p></div><div class="input"><div class="wrn-c-10 wrn-c-offset-1 wrn-p-y-05"><label class=" wrn-hidden-mobile wrn-c-3 wrn-c-pull-1" for="dialog_groupInvite"> E-mail</label><label class=" wrn-hidden-desktop wrn-c-4 wrn-c-pull-1" for="dialog_groupInvite"> E-mail</label><input id="dialog_groupInvite" type="email"/></div></div><div class="wrn-checkbox-container"><input id="dialog_groupInviteAdm" type="checkbox" checked/><label for="dialog_groupInviteAdm" class="wrn-link wrn-c-10 wrn-c-offset-1 wrn-p-sm-05 wrn-bg-gray-4 wrn-text-p-3 wrn-text-left">Administrador</label><p class="wrn-text-p-5" style="padding-top: 4px;">Pode editar o objetivo, adicionar e remover participantes.</p></div>'; | |
case "inviteDetails": | |
return '<div class="wrn-p-x-1"><div class="wrn-text-center wrn-c-12 wrn-text-h-3 wrn-p-b-1" style="padding-top: 8px">Detalhes do Objetivo</div><div class="wrn-text-left wrn-c-12 wrn-divider-top wrn-p-b-1" style="padding-top: 8px"><div class="wrn-text-p-2">' + t.group.name + '</div><div class="wrn-text-p-6">Nome do Objetivo</div></div><div class="wrn-text-left wrn-c-12 wrn-divider-top wrn-p-b-1" style="padding-top: 8px"><div class="wrn-text-p-2">' + t.group.memberQuantityOnBuilder + '</div><div class="wrn-text-p-6">Participantes</div></div><div class="wrn-text-left wrn-c-12 wrn-divider-top wrn-p-b-1" style="padding-top: 8px"><div class="wrn-text-p-2">' + o("money")(t.group.goalAmount, "R$ ", 2) + '</div><div class="wrn-text-p-6">Objetivo</div></div><div class="wrn-text-left wrn-c-12 wrn-divider-top wrn-p-b-1" style="padding-top: 8px"><div class="wrn-text-p-2">' + t.group.goalDuration + ' ano(s)</div><div class="wrn-text-p-6">Tempo</div></div><div class="wrn-text-left wrn-c-12 wrn-divider-top wrn-p-b-1" style="padding-top: 8px"><div class="wrn-text-p-2">' + o("money")(t.group.initialInvestmentPerMember, "R$ ", 2) + '</div><div class="wrn-text-p-6">Investimento inicial</div></div><div class="wrn-text-left wrn-c-12 wrn-divider-top" style="padding-top: 8px"><div class="wrn-text-p-2">' + o("money")(t.group.monthlyInvestmentPerMember, "R$ ", 2) + '</div><div class="wrn-text-p-6">Investimento mensal</div></div></div>'; | |
default: | |
return "" | |
} | |
} | |
var m = { | |
alert: d, | |
confirm: l, | |
prompt: p, | |
password: c, | |
groupInvite: v, | |
inviteDetails: w | |
}; | |
return m | |
} | |
n.$inject = ["$q", "$window", "$document", "$sce", "$compile", "$rootScope", "$timeout", "$filter"], angular.module("warren.common.services.dialog", []).factory("wrnDialog", n) | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, o, e) { | |
function t() { | |
if (!s) { | |
var o = n.FB; | |
o.init({ | |
appId: e.facebook.appId, | |
version: e.facebook.apiVersion, | |
status: !0, | |
cookie: !0, | |
xfbml: !0 | |
}), s = !0 | |
} | |
} | |
function i() { | |
return !!n.FB | |
} | |
function u() { | |
var e = n.FB; | |
return e ? (t(), o(function(n, o) { | |
e.getLoginStatus(function(e) { | |
"connected" === e.status ? n(e) : o(e) | |
}) | |
})) : o(function(n, o) { | |
o() | |
}) | |
} | |
function c() { | |
var e = n.FB; | |
return e ? (t(), o(function(n, o) { | |
var t = {}; | |
e.login(function(e) { | |
e.authResponse ? (t.accessToken = e.authResponse.accessToken, t.expiresIn = e.authResponse.expiresIn, t.userId = e.authResponse.userID, n(t)) : o() | |
}, { | |
scope: "public_profile,email" | |
}) | |
})) : o(function(n, o) { | |
o() | |
}) | |
} | |
function r() { | |
var e = n.FB; | |
return e ? (t(), o(function(n, o) { | |
e.logout(function(o) { | |
n() | |
}) | |
})) : o(function(n, o) { | |
o() | |
}) | |
} | |
var s = !1, | |
a = { | |
status: u, | |
login: c, | |
logout: r, | |
scriptLoaded: i | |
}; | |
return a | |
} | |
angular.module("warren.common.services.facebook", []).factory("wrnFacebook", n), n.$inject = ["$window", "$q", "config"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, e, s, a, i, t) { | |
function r(n) { | |
var r = '<nav class="wrn-navbar wrn-navbar-absolute wrn-bg-white wrn-flash wrn-box-shadow-soft wrn-flash-{{type}}"><div class="wrn-container-fluid wrn-row"><div class="wrn-c-1 wrn-text-left"><a href="" class="wrn-link"><img class="wrn-rotate-90 wrn-navbar-icon" src="/assets/imgs/icons/ic_close_white.svg" alt="Fechar"></a></div><div class="wrn-c-10 wrn-text-center"><p class="wrn-flash-message wrn-navbar-text wrn-text-u-2" ng-show="message" ng-bind-html="message"></p></div></div></nav>', | |
o = i.$new(); | |
o.type = "undefined" != typeof n.type ? n.type : "default", o.message = "undefined" != typeof n.message ? n.message : "", o.icon = "undefined" != typeof n.icon && n.icon, o.delay = "undefined" != typeof n.delay ? n.delay : 2e3, n.raw || (o.message = t.getString(o.message) || t.getString("error_default")), o.message = s.trustAsHtml(o.message); | |
var c = a(r)(o); | |
c.bind("webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd", function(n) { | |
n = n.originalEvent || n, ("click" === n.type || c.hasClass("killed")) && c.remove() | |
}), c.bind("click", function(n) { | |
c.addClass("killed") | |
}), angular.isNumber(o.delay) && e(function() { | |
c.addClass("killed") | |
}, o.delay), e(function() { | |
c.addClass("started") | |
}, 0), angular.element(document.getElementsByTagName("body")).append(c) | |
} | |
function o(n, e) { | |
e = e || {}, e.message = n, e.type = "default", r(e) | |
} | |
function c(n, e) { | |
e = e || {}, e.message = n, e.type = "success", e.icon = e.icon || "fa-check", r(e) | |
} | |
function l(n, e) { | |
e = e || {}, e.message = n, e.type = "error", e.icon = e.icon || "fa-close", r(e) | |
} | |
function d(n, e) { | |
e = e || {}, e.message = n, e.type = "info", e.icon = e.icon || "fa-info", r(e) | |
} | |
function f(n, e) { | |
e = e || {}, e.message = n, e.type = "warning", e.icon = e.icon || "fa-warning", r(e) | |
} | |
var u = { | |
notify: r, | |
simple: o, | |
success: c, | |
error: l, | |
info: d, | |
warning: f | |
}; | |
return u | |
} | |
angular.module("warren.common.services.flash", []).factory("wrnFlash", n), n.$inject = ["$window", "$timeout", "$sce", "$compile", "$rootScope", "wrnResources"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t) { | |
function n(t, n) { | |
e.push({ | |
state: t, | |
params: n | |
}) | |
} | |
function r() { | |
return e | |
} | |
function u(n) { | |
var r = a(n || -1); | |
return !!r && t.go(r.state, r.params) | |
} | |
function a(t) { | |
return e[e.length - Math.abs(t || 1)] | |
} | |
function s() { | |
return u(-1) | |
} | |
var e = [], | |
o = { | |
push: n, | |
all: r, | |
go: u, | |
previous: a, | |
back: s | |
}; | |
return o | |
} | |
function n(t, n, r) { | |
function u(t, n, u, a, s) { | |
a.abstract || r.push(a, s) | |
} | |
t.$on("$stateChangeSuccess", u), r.push(n.current, n.params) | |
} | |
angular.module("warren.common.services.history", []).factory("wrnHistory", t).run(n), t.$inject = ["$state"], n.$inject = ["$rootScope", "$state", "wrnHistory"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, o) { | |
function n() { | |
if ("undefined" == typeof e.google) return null; | |
var o = e.google.maps; | |
return o | |
} | |
function r(n) { | |
var r = e.google.maps; | |
return o(function(e, o) { | |
var a = new r.Geocoder, | |
s = { | |
address: n + ", Brasil", | |
region: "BR" | |
}; | |
a.geocode(s, function(n, a) { | |
a === r.GeocoderStatus.OK ? e(t(n[0])) : o(a) | |
}) | |
}) | |
} | |
function a(n) { | |
var r = e.google.maps; | |
return o(function(e, o) { | |
var a = new r.Geocoder, | |
s = { | |
address: n + ", Brasil", | |
bounds: new r.LatLngBounds(new r.LatLng(-30.2614377, -57.6298431), new r.LatLng(-22.1660297, -41.0898052)), | |
region: "br" | |
}; | |
a.geocode(s, function(n, a) { | |
if (a === r.GeocoderStatus.OK) { | |
for (var s = [], i = 0; i < n.length; i++) s.push(t(n[i])); | |
e(s) | |
} else o(a) | |
}) | |
}) | |
} | |
function t(e) { | |
var o = {}; | |
o.latitude = e.geometry.location.lat(), o.longitude = e.geometry.location.lng(); | |
for (var n = 0; n < e.address_components.length; n++) | |
for (var r = e.address_components[n], a = 0; a < r.types.length; a++) { | |
var t = r.types[a]; | |
if ("street_number" === t) { | |
o.number = r.long_name; | |
break | |
} | |
if ("route" === t || "street_address" === n) { | |
o.address = r.long_name; | |
break | |
} | |
if ("sublocality_level_1" === t || "sublocality" === t) { | |
o.neighborhood = r.long_name; | |
break | |
} | |
if ("locality" === t || "administrative_area_level_2" === t) { | |
o.city = r.long_name; | |
break | |
} | |
if ("administrative_area_level_1" === t) { | |
o.state = r.long_name, o.stateCode = r.short_name; | |
break | |
} | |
if ("country" === t) { | |
o.country = r.long_name, o.countryCode = r.short_name; | |
break | |
} | |
if ("postal_code" === t) { | |
o.zipcode = r.long_name.replace("-", ""); | |
break | |
} | |
} | |
return o | |
} | |
var s = { | |
getMaps: n, | |
getGeocodeByAddress: r, | |
getGeocodesByAddress: a, | |
parseGeocoderResult: t | |
}; | |
return s | |
} | |
angular.module("warren.common.services.maps", []).factory("wrnMaps", e), e.$inject = ["$window", "$q"] | |
}(); | |
! function() { | |
"use strict"; | |
function o(o) { | |
function n(n) { | |
var t = o.location.protocol + "//" + o.location.host; | |
o.location.href = t + n | |
} | |
var t = { | |
go: n | |
}; | |
return t | |
} | |
angular.module("warren.common.services.path", []).factory("wrnPath", o), o.$inject = ["$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t, r) { | |
function n() { | |
c("resources.xml") | |
} | |
function a(e) { | |
var t = Array.prototype.slice.call(arguments, 1); | |
if (w[e]) return k(w[e].value, t) | |
} | |
function u(e, t) { | |
if (M[e]) return t = t || "value", M[e][t] | |
} | |
function i(e, t) { | |
if (T[e]) return t = t || "value", T[e][t] | |
} | |
function o(e) { | |
if (N[e]) return N[e].value | |
} | |
function l(e) { | |
if (L[e]) return L[e].value | |
} | |
function s(e, t) { | |
if (x[e]) { | |
var r = Array.prototype.slice.call(arguments, 2), | |
n = x[e] ? x[e].value : {}, | |
a = null; | |
return a = 0 === t ? n.zero : 1 === t ? n.one : 2 === t ? n.two : n.other, k(a || "", r) | |
} | |
} | |
function c(t) { | |
var n = r[t]; | |
if (!n) return void console.warn('Resource "' + t + '" not loaded'); | |
var a = null; | |
if (e.DOMParser) { | |
var u = new DOMParser; | |
a = u.parseFromString(n, "text/xml") | |
} else a = new ActiveXObject("Microsoft.XMLDOM"), a.async = !1, a.loadXML(n); | |
if (!a) throw new Error('Invalid resource file "' + t + '"'); | |
for (var i = a.documentElement.childNodes, o = 0; o < i.length; o++) v(i[o]) | |
} | |
function v(e) { | |
if (1 === e.nodeType) switch (e.nodeName) { | |
case "string": | |
f(e); | |
break; | |
case "value": | |
p(e); | |
break; | |
case "link": | |
d(e); | |
break; | |
case "string-array": | |
g(e); | |
break; | |
case "value-array": | |
b(e); | |
break; | |
case "plurals": | |
m(e) | |
} | |
} | |
function f(e) { | |
w[e.attributes.name.value] = { | |
value: h(e.innerHTML || e.textContent) | |
} | |
} | |
function p(e) { | |
M[e.attributes.name.value] = { | |
type: e.attributes.type.value, | |
mask: e.attributes.mask && e.attributes.mask.value, | |
value: y(e.innerHTML || e.textContent, e.attributes.type.value) | |
} | |
} | |
function d(e) { | |
T[e.attributes.name.value] = { | |
href: e.attributes.href.value, | |
value: h(e.innerHTML || e.textContent) | |
} | |
} | |
function g(e) { | |
for (var t = [], r = 0; r < e.childNodes.length; r++) { | |
var n = e.childNodes[r]; | |
1 === n.nodeType && t.push(h(n.innerHTML || n.textContent)) | |
} | |
N[e.attributes.name.value] = { | |
value: t | |
} | |
} | |
function b(e) { | |
for (var t = t && e.attributes.type.value, r = e.attributes.mask && e.attributes.mask.value, n = [], a = 0; a < e.childNodes.length; a++) { | |
var u = e.childNodes[a]; | |
1 === u.nodeType && n.push(y(u.innerHTML || u.textContent, t)) | |
} | |
L[e.attributes.name.value] = { | |
type: t, | |
mask: r, | |
value: n | |
} | |
} | |
function m(e) { | |
for (var t = {}, r = 0; r < e.childNodes.length; r++) { | |
var n = e.childNodes[r]; | |
if (1 === n.nodeType) { | |
var a = n.attributes.quantity.value; | |
t[a] = h(n.innerHTML || n.textContent) | |
} | |
} | |
x[e.attributes.name.value] = { | |
value: t | |
} | |
} | |
function y(e, t) { | |
return "integer" === t ? parseInt(e) : "float" === t ? parseFloat(e) : "true" === e | |
} | |
function h(e) { | |
return e.replace(/<!\[CDATA\[/g, "").replace(/]]>/g, "").replace(/\\"/g, '"').replace(/\\'/g, "'").replace(/\\n/g, "<br/>").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&") | |
} | |
function k(t, r) { | |
return r ? e.vsprintf(t, r) : t | |
} | |
var w = {}, | |
M = {}, | |
T = {}, | |
x = {}, | |
L = {}, | |
N = {}, | |
A = { | |
initialize: n, | |
getString: a, | |
getValue: u, | |
getLink: i, | |
getStringArray: o, | |
getValueArray: l, | |
getQuantityString: s | |
}; | |
return A | |
} | |
function t(e, t) { | |
t.initialize() | |
} | |
angular.module("warren.common.services.resources", []).factory("wrnResources", e).run(t), e.$inject = ["$window", "$filter", "resources"], t.$inject = ["$rootScope", "wrnResources"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t) { | |
function n(e) { | |
return !o(e) | |
} | |
function r(e) { | |
e = "warren." + e, c ? (i.removeItem(e), m.removeItem(e)) : (delete i[e], delete m[e], delete u[e]) | |
} | |
function o(e) { | |
return e = "warren." + e, u[e] ? u[e] : c ? m.hasOwnProperty(e) ? m.getItem(e) : i.getItem(e) : i[e] | |
} | |
function a(e, t, n) { | |
if (e = "warren." + e, n = "undefined" != typeof n && n, c) try { | |
n ? m.setItem(e, t) : i.setItem(e, t) | |
} catch (n) { | |
u[e] = t | |
} else i[e] = t | |
} | |
function s() { | |
i.clear(), m.clear() | |
} | |
var c = !!e.localStorage, | |
i = e.localStorage || {}, | |
m = e.sessionStorage || {}, | |
u = {}, | |
l = { | |
isEmpty: n, | |
remove: r, | |
get: o, | |
set: a, | |
clean: s | |
}; | |
return l | |
} | |
angular.module("warren.common.services.session", []).factory("wrnSession", e), e.$inject = ["$window", "$stateParams"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t) { | |
function o(e, t, o, n) { | |
n = n || 0, t = "undefined" == typeof t ? 500 : t, o = o || warren.utils.easing.sineInOut; | |
var s = i(), | |
l = Math.min(c(e) + n, f()); | |
if (!isNaN(l)) { | |
var a = t / u, | |
m = 1 / u; | |
r(s, l, a, m, o) | |
} | |
} | |
function n(e, t, o) { | |
if (0 === t) r(0, e, 0, 0, 0, 1); | |
else { | |
t = "undefined" == typeof t ? 500 : t, o = o || warren.utils.easing.sineInOut; | |
var n = i(), | |
c = t / u, | |
f = 1 / u; | |
r(n, e, c, f, o) | |
} | |
} | |
function r(o, n, i, c, f, u) { | |
if (u = u || 0, u >= 1) return void e.scrollTo(0, n); | |
var s = f(o, n, u); | |
e.scrollTo(0, s), t(function() { | |
r(o, n, i, c, f, u + c) | |
}, i) | |
} | |
function i() { | |
return e.pageYOffset ? e.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0 | |
} | |
function c(e) { | |
var t = document.getElementById(e); | |
if (t) { | |
for (var o = t.offsetTop; t.offsetParent && t.offsetParent != document.body;) t = t.offsetParent, o += t.offsetTop; | |
return o | |
} | |
} | |
function f() { | |
var t = document.body, | |
o = document.documentElement, | |
n = Math.max(t.scrollHeight, t.offsetHeight, o.clientHeight, o.scrollHeight, o.offsetHeight); | |
return Math.max(n - e.innerHeight, 0) | |
} | |
var u = 30, | |
s = { | |
to: o, | |
toPosition: n | |
}; | |
return s | |
} | |
angular.module("warren.common.services.smoothscroll", []).factory("wrnSmoothScroll", e), e.$inject = ["$window", "$timeout"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t, n, r) { | |
function c(t) { | |
if (t !== m) return e(function(e, r) { | |
var c = o[t]; | |
if (c) { | |
m = t; | |
var i = n.get(u + t + ".name"); | |
if (i != c) n.remove(u + t + ".name"), n.remove(u + t + ".file"), s(t, c); | |
else { | |
var f = n.get(u + t + ".file"); | |
a(f) | |
} | |
e() | |
} | |
}) | |
} | |
function i() { | |
return r.isBlack() ? "black" : "pink" | |
} | |
function a(e) { | |
var t; | |
t = document.getElementById("theme-style-override"), t || (t = document.createElement("style"), t.setAttribute("id", "theme-style-override"), document.body.appendChild(t)), t.innerHTML = e | |
} | |
function s(e) { | |
t.get("/assets/css/" + o[e], { | |
responseType: "text" | |
}).then(function(t) { | |
a(t.data), n.set(u + e + ".name", e), n.set(u + e + ".data", t.data) | |
}, function(e) {}) | |
} | |
var o = { | |
pink: "app-pink-3b47c9b.css", | |
black: "app-black-3b47c9b.css" | |
}, | |
m = "pink", | |
u = "themes_cache.", | |
f = { | |
setTheme: c, | |
getTheme: i | |
}; | |
return f | |
} | |
e.$inject = ["$q", "$http", "wrnSession", "wrnUser"], angular.module("warren.common.services.theme", []).factory("wrnTheme", e) | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, c) { | |
function t(n) { | |
c.Webcam && c.Webcam.attach(n) | |
} | |
function a(n) { | |
c.Webcam && c.Webcam.set(n) | |
} | |
function e() { | |
return !!c.Webcam | |
} | |
function i() { | |
c.Webcam && c.Webcam.reset() | |
} | |
function o() { | |
if (c.Webcam) return n(function(n, t) { | |
try { | |
c.Webcam.snap(function(c) { | |
n(c) | |
}) | |
} catch (n) { | |
t(n) | |
} | |
}) | |
} | |
var r = { | |
attach: t, | |
config: a, | |
isReady: e, | |
shutdown: i, | |
snap: o | |
}; | |
return r | |
} | |
angular.module("warren.common.services.webcam", []).factory("wrnWebcam", n), n.$inject = ["$q", "$window"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, o) { | |
function e() { | |
if (!n.$zopim) return void console.warn("Zopim chat could not be loaded."); | |
if (!l) { | |
if (f = n.$zopim.livechat, !f) return void console.warn("Chat not loaded yet."); | |
f.setLanguage("pt_BR"), f.setOnConnected(d), f.setOnUnreadMsgs(r), f.setOnChatEnd(h), f.setOnChatStart(w), f.window.onShow(s), f.window.onHide(u), f.isChatting() && i(), l = !0 | |
} | |
} | |
function i() { | |
try { | |
window.$zopim.livechat.window.show() | |
} catch (n) { | |
o.alert("Ops!", "Não foi possÃvel abrir o chat.", { | |
textCancel: " ", | |
textOk: "Ok" | |
}) | |
} | |
} | |
function a(o, e, i) { | |
function a() { | |
f && (f.setName(o), f.setEmail(e), i && f.setPhone(i)) | |
} | |
n.$zopim ? a() : (t(a, 3e3), t(a, 6e3)) | |
} | |
function c() { | |
f.window.hide(), f.isChatting() && f.button.show() | |
} | |
function s(n) { | |
f.button.hide(), i() | |
} | |
function u(n) { | |
f.isChatting() && f.button.show() | |
} | |
function r(n) { | |
n > 0 && i() | |
} | |
function d(n) {} | |
function h(n) {} | |
function w(n) {} | |
var f = null, | |
l = !1; | |
n.$zopim ? e() : (t(e, 3e3), t(e, 6e3), t(e, 15e3)); | |
var m = { | |
openChat: i, | |
closeChat: c, | |
setUser: a | |
}; | |
return m | |
} | |
n.$inject = ["$window", "$timeout", "wrnDialog"], angular.module("warren.common.services.zendesk", []).factory("zendesk", n) | |
}(); | |
! function() { | |
"use strict"; | |
function r() { | |
function r(r, e, t, i) { | |
var a = t.wrnValidatorAll || "$default"; | |
n[a] || (n[a] = []), n[a].push(i), i.$parsers.unshift(function(r) { | |
var e, t = n[a], | |
i = !0; | |
for (e = 0; e < t.length; e++) | |
if (!t[e].$viewValue) { | |
i = !1; | |
break | |
} | |
for (e = 0; e < t.length; e++) t[e].$setValidity("any", i); | |
return r | |
}), e.on("$destroy", function() { | |
n[a].splice(n[a].indexOf(i), 1) | |
}) | |
} | |
var n = {}; | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: r | |
} | |
} | |
angular.module("warren.common.validators.all", []).directive("wrnValidatorAll", r), r.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
function n(n, e, t, i) { | |
var a = t.wrnValidatorAny || "$default"; | |
r[a] || (r[a] = []), r[a].push(i), i.$parsers.unshift(function(n) { | |
var e, t = r[a], | |
i = !1; | |
for (e = 0; e < t.length; e++) | |
if (t[e].$viewValue) { | |
i = !0; | |
break | |
} | |
for (e = 0; e < t.length; e++) t[e].$setValidity("any", i); | |
return n | |
}), e.on("$destroy", function() { | |
r[a].splice(r[a].indexOf(i), 1) | |
}) | |
} | |
var r = {}; | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: n | |
} | |
} | |
angular.module("warren.common.validators.any", []).directive("wrnValidatorAny", n), n.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function r() { | |
function r(r, n, i, e) { | |
e.$parsers.unshift(function(r) { | |
var n = (r || "").toString(), | |
i = !0; | |
return 11 != n.length ? i = !1 : n.match(/^([0-9])\1*$/) ? i = !1 : t(n, 9) ? t(n, 10) || (i = !1) : i = !1, e.$setValidity("cpf", i), r | |
}) | |
} | |
function t(r, t) { | |
for (var n = 0, i = 0, e = t + 1; i < t; i++, e--) n += parseInt(r[i]) * e; | |
var a = n % 11 < 2 ? 0 : 11 - n % 11; | |
return a.toString() === r[t] | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: r | |
} | |
} | |
angular.module("warren.common.validators.cpf", []).directive("wrnValidatorCpf", r), r.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
function t(t, r, n, e) { | |
e.$parsers.unshift(function(t) { | |
var r = (t || "").toString().replace(/[\/|-]/g, ""), | |
n = !0, | |
i = parseInt(r.substring(0, 2)), | |
a = parseInt(r.substring(2, 4)), | |
s = parseInt(r.substring(4)); | |
return 8 !== r.length ? n = !1 : !i || i < 1 || i > 31 ? n = !1 : !a || a < 1 || a > 12 ? n = !1 : (!s || s < 0) && (n = !1), e.$setValidity("date", n), t | |
}) | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: t | |
} | |
} | |
angular.module("warren.common.validators.date", []).directive("wrnValidatorDate", t), t.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function r(r) { | |
function t(r, t, n, Z) { | |
function e(r) { | |
var t = i.test(r); | |
return Z.$setValidity("email", t), r | |
} | |
var i = /(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*))*)?;\s*)/; | |
Z.$parsers.unshift(function(r) { | |
return e(r) | |
}), Z.$formatters.unshift(function(r) { | |
return e(r) | |
}) | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: t, | |
scope: !1 | |
} | |
} | |
angular.module("warren.common.validators.email", []).directive("wrnValidatorEmail", r), r.$inject = ["$parse"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t) { | |
function n(t, n, r, e) { | |
function a(t) { | |
var n = i.val(), | |
r = n === t; | |
return e.$setValidity("match", r), t | |
} | |
var i = r.wrnValidatorMatch; | |
i && (i = document.getElementById(i), i && (i = angular.element(i), e.$parsers.unshift(function(t) { | |
return a(t) | |
}), e.$formatters.unshift(function(t) { | |
return a(t) | |
}))) | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: n, | |
scope: !1 | |
} | |
} | |
angular.module("warren.common.validators.match", []).directive("wrnValidatorMatch", t), t.$inject = ["$parse"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
function t(t, e, r, a) { | |
var n = r.wrnValidatorMaxdate; | |
if (n) { | |
var i, s, l; | |
if ("today" === n) n = new Date, i = n.getFullYear(), s = n.getMonth() + 1, l = n.getDate(); | |
else { | |
var o = n.split("-"); | |
i = parseInt(o[0]), s = parseInt(o[1]), l = parseInt(o[2]) | |
} | |
if (!l || !s || !i) throw 'Invalid date "' + n + '".'; | |
a.$parsers.unshift(function(t) { | |
var e = (t || "").toString().replace(/[\/|-]/g, ""), | |
r = !0, | |
n = parseInt(e.substring(0, 2)), | |
o = parseInt(e.substring(2, 4)), | |
u = parseInt(e.substring(4)); | |
return 8 !== e.length ? r = !1 : u > i ? r = !1 : u === i && o > s ? r = !1 : u === i && o === s && n > l && (r = !1), a.$setValidity("maxdate", r), t | |
}) | |
} | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: t | |
} | |
} | |
angular.module("warren.common.validators.maxdate", []).directive("wrnValidatorMaxdate", t), t.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
function t(t, e, n, r) { | |
var a = n.wrnValidatorMindate; | |
if (a) { | |
var i, s, l; | |
if ("today" === a) a = new Date, i = a.getFullYear(), s = a.getMonth(), l = a.getDate(); | |
else { | |
var o = a.split("-"); | |
i = parseInt(o[0]), s = parseInt(o[1]), l = parseInt(o[2]) | |
} | |
if (!l || !s || !i) throw 'Invalid date "' + a + '".'; | |
r.$parsers.unshift(function(t) { | |
var e = (t || "").toString().replace(/[\/|-]/g, ""), | |
n = !0, | |
a = parseInt(e.substring(0, 2)), | |
o = parseInt(e.substring(2, 4)), | |
u = parseInt(e.substring(4)); | |
return 8 !== e.length ? n = !1 : u < i ? n = !1 : u === i && o < s ? n = !1 : u === i && o === s && a < l && (n = !1), r.$setValidity("mindate", n), t | |
}) | |
} | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: t | |
} | |
} | |
angular.module("warren.common.validators.mindate", []).directive("wrnValidatorMindate", t), t.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n) { | |
function r(n, r, t, i) { | |
function e(n) { | |
var r = !1; | |
"undefined" != typeof n && null !== n || (n = ""); | |
var t = n.trim().replace(/\s+/g, " ").split(" "); | |
return t.length > 1 && (r = !0), i.$setValidity("minstrings", r), n | |
} | |
i.$parsers.unshift(function(n) { | |
return e(n) | |
}), i.$formatters.unshift(function(n) { | |
return e(n) | |
}) | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: r, | |
scope: !1 | |
} | |
} | |
angular.module("warren.common.validators.minstrings", []).directive("wrnValidatorMinstring", n), n.$inject = ["$parse"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n) { | |
function r(n, r, t, e) { | |
function i(n) { | |
var r = !1; | |
return "undefined" != typeof n && null !== n || (n = ""), n = n.split(".").join(""), n >= 100 && (r = !0), e.$setValidity("minvalue", r), n | |
} | |
e.$parsers.unshift(function(n) { | |
return i(n) | |
}), e.$formatters.unshift(function(n) { | |
return i(n) | |
}) | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: r, | |
scope: !1 | |
} | |
} | |
angular.module("warren.common.validators.minvalue", []).directive("wrnValidatorMinvalue", n), n.$inject = ["$parse"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t) { | |
function e(t, e, i, n) { | |
function r(t) { | |
var e = !1; | |
if ("undefined" != typeof t && null !== t || (t = ""), "undefined" != typeof u) | |
for (var i = u.length - 1; i >= 0; i--) | |
if (t === u[i]) { | |
e = !0; | |
break | |
} | |
return n.$setValidity("whitelist", e), t | |
} | |
var u = t.$eval(i.wrnValidatorWhitelist); | |
n.$parsers.unshift(function(t) { | |
return r(t) | |
}), n.$formatters.unshift(function(t) { | |
return r(t) | |
}) | |
} | |
return { | |
restrict: "A", | |
require: "ngModel", | |
link: e, | |
scope: !1 | |
} | |
} | |
angular.module("warren.common.validators.whitelist", []).directive("wrnValidatorWhitelist", t), t.$inject = ["$parse"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, n) { | |
function a(a, t, i, d, s) { | |
function r() { | |
a.data.isOpen = !a.data.isOpen | |
} | |
function o(n, a) { | |
for (var t = 0; t < n.length; t++) { | |
var i = n[t], | |
d = e.document.createElement("li"); | |
d.appendChild(i), a.append(d) | |
} | |
} | |
a.data = { | |
isOpen: !1, | |
isLoggedIn: !1, | |
classType: "", | |
classPosition: "" | |
}, a.toggleMenu = r, a.data.isLoggedIn = !n.isEmpty("accounts.accessToken"); | |
var l = s(), | |
f = angular.element(l[0] || t.find("defaults-mobile")), | |
p = angular.element(l[1] || t.find("defaults-desktop")), | |
c = f.find("a"), | |
u = p.find("a"); | |
o(c, t.find("mobile-links")), o(u, t.find("desktop-links")); | |
var m = ""; | |
"undefined" != typeof i.primary && (m = "primary"), "undefined" != typeof i.secondary && (m = "secondary"), "undefined" != typeof i.tertiary && (m = "tertiary"), a.data.classType = "wrn-navbar-" + m; | |
var y = ""; | |
"undefined" != typeof i.absolute && (y = "absolute"), "undefined" != typeof i.fixed && (y = "fixed"), a.data.classPosition = "wrn-navbar-" + y | |
} | |
return { | |
scope: { | |
initial: "=" | |
}, | |
templateUrl: "app/components/dashheader/dashheader.template.html", | |
link: a, | |
transclude: !0 | |
} | |
} | |
angular.module("warren.components.dashheader", []).directive("wrnDashHeader", e), e.$inject = ["$window", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, n) { | |
function a(a, t, d, i, r) { | |
function o() { | |
a.data.isOpen = !a.data.isOpen | |
} | |
function s(n, a) { | |
for (var t = 0; t < n.length; t++) { | |
var d = n[t], | |
i = e.document.createElement("li"); | |
i.appendChild(d), a.append(i) | |
} | |
} | |
a.data = { | |
isOpen: !1, | |
isLoggedIn: !1, | |
classType: "", | |
classPosition: "" | |
}, a.toggleMenu = o, a.data.isLoggedIn = !n.isEmpty("accounts.accessToken"); | |
var f = r(), | |
p = angular.element(f[0] || t.find("defaults-mobile")), | |
l = angular.element(f[1] || t.find("defaults-desktop")), | |
u = p.find("a"), | |
c = l.find("a"); | |
s(u, t.find("mobile-links")), s(c, t.find("desktop-links")); | |
var g = ""; | |
"undefined" != typeof d.primary && (g = "primary"), "undefined" != typeof d.secondary && (g = "secondary"), "undefined" != typeof d.tertiary && (g = "tertiary"), "undefined" != typeof d.gradient1 && (g = "gradient-1"), "undefined" != typeof d.gradient2 && (g = "gradient-2"), "undefined" != typeof d.gradient3 && (g = "gradient-3"), "undefined" != typeof d.gradient4 && (g = "gradient-4"), "undefined" != typeof d.gradient5 && (g = "gradient-5"), a.data.classType = "wrn-navbar-" + g; | |
var y = ""; | |
"undefined" != typeof d.absolute && (y = "absolute"), "undefined" != typeof d.fixed && (y = "fixed"), a.data.classPosition = "wrn-navbar-" + y | |
} | |
return { | |
scope: {}, | |
templateUrl: "app/components/header/header.template.html", | |
link: a, | |
transclude: !0 | |
} | |
} | |
angular.module("warren.components.header", []).directive("wrnHeader", e), e.$inject = ["$window", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function s() { | |
return { | |
scope: {}, | |
template: '<div class="wrn-fullscreen-loader"><img src="/assets/imgs/icons/loaders/01.svg" class="img img-1"><img src="/assets/imgs/icons/loaders/02.svg" class="img img-2"><img src="/assets/imgs/icons/loaders/03.svg" class="img img-3"><img src="/assets/imgs/icons/loaders/04.svg" class="img img-4"></div>' | |
} | |
} | |
angular.module("warren.components.loader", []).directive("wrnLoader", s), s.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, i, o) { | |
function t(t, e, s) { | |
var c = n.syncGetAll(); | |
c = warren.utils.deepcopy(c), t.notifications = c, t.config = !1, n.markAsRead(), t.loading = !0, n.sync().then(function(i) { | |
t.loading = !1, c = n.syncGetAll(), t.notifications = warren.utils.deepcopy(c), n.markAsRead() | |
}), t.configs = i.getCurrent(!0).notificationsConfig, t.saveConfig = function() { | |
t.isSaving = !0, i.updateNotificationsConfig({ | |
notificationsConfig: t.configs | |
}).then(function(n) { | |
t.isSaving = !1, o.success("user_config_save_success") | |
}, function(n) { | |
console.error(n), o.error(n.message) | |
}) | |
} | |
} | |
return { | |
templateUrl: "app/components/notifications/notifications.template.html", | |
link: t | |
} | |
} | |
angular.module("warren.components.notifications", []).directive("wrnNotifications", n), n.$inject = ["wrnNotifications", "wrnUser", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, n, t, i, o, a, r, s) { | |
function c(e, c, d) { | |
function m() { | |
var n, r = e.user.referralId; | |
switch (a.environment.name) { | |
case "local": | |
n = "local.oiwarren.com:5000/"; | |
break; | |
case "development": | |
n = "https://develop.oiwarren.com/"; | |
break; | |
case "staging": | |
n = "https://staging.oiwarren.com/"; | |
break; | |
case "production": | |
n = "https://oiwarren.com/"; | |
break; | |
default: | |
n = "https://oiwarren.com/" | |
} | |
if ("production" === a.environment.name) { | |
r = "&referralId=" + r; | |
var s = { | |
twitter: n + "?utm_medium=social&utm_source=referral&utm_campaign=sharepanel&utm_content=twitter", | |
facebook: n + "?utm_medium=social&utm_source=referral&utm_campaign=sharepanel&utm_content=facebook", | |
whatsapp: n + "?utm_medium=social&utm_source=referral&utm_campaign=sharepanel&utm_content=whatsapp", | |
messenger: n + "?utm_medium=social&utm_source=referral&utm_campaign=sharepanel&utm_content=messenger", | |
email: n + "?utm_medium=email&utm_source=referral&utm_campaign=sharepanel&utm_content=link", | |
directLink: n + "?utm_source=referral&utm_campaign=sharepanel&utm_content=link" | |
} | |
} else { | |
r = "?referralId=" + r; | |
var s = { | |
twitter: n, | |
facebook: n, | |
whatsapp: n, | |
messenger: n, | |
email: n, | |
directLink: n | |
} | |
} | |
r && (s.twitter += r, s.facebook += r, s.whatsapp += r, s.messenger += r, s.email += r, s.directLink += r), e.c_dash = e.$parent.c_dash, e.email = null, o.all([i.getShortenedURL(s.twitter), i.getShortenedURL(s.facebook), i.getShortenedURL(s.whatsapp), i.getShortenedURL(s.messenger), i.getShortenedURL(s.email), i.getShortenedURL(s.directLink)]).then(function(n) { | |
u(n), e.sharepanelIsLoading = !1 | |
}, function(n) { | |
e.sharepanelIsLoading = !1, t.error(n.message) | |
}) | |
} | |
function u(n) { | |
var t, i, o, a = "%0D%0A"; | |
t = "https://twitter.com/intent/tweet?", i = encodeURIComponent("Estou usando o Warren (uma nova forma de investir) e estou adorando! Acho que você deveria experimentar: "), o = "oiwarren"; | |
var r = "https://twitter.com/intent/tweet?text=" + i + "&url=" + n[0].id + "&hashtags=" + o; | |
i = encodeURIComponent("Oi! Estou usando o Warren e adorando!") + a + a + encodeURIComponent("O Warren é uma nova plataforma de investimentos, fácil, inteligente e divertida.") + a + encodeURIComponent("Com ele você descobre seu perfil de investidor, cria objetivos de investimentos,") + a + encodeURIComponent("investe e acompanha o desempenho deles. Tudo no mesmo lugar!") + a + a + encodeURIComponent("Acho que você vai gostar :)") + a + encodeURIComponent("Experimente! "); | |
var s = "https://www.facebook.com/dialog/feed?app_id=1636715299924634&link=" + n[1].id + "&name=Warren&caption=Invista bem com o Warren!&description=" + i, | |
c = "whatsapp://send?text=" + i + n[2].id, | |
d = "https://www.facebook.com/dialog/send?app_id=1636715299924634&link=" + n[3].id + "&redirect_uri=" + n[3].id, | |
m = encodeURIComponent("Warren: Você investindo bem"), | |
u = encodeURIComponent("Oi! Estou usando o Warren e adorando!") + a + a + encodeURIComponent("O Warren é uma nova plataforma de investimentos, fácil, inteligente e divertida.") + a + encodeURIComponent("Com ele você descobre seu perfil de investidor, cria objetivos de investimentos, investe e acompanha o desempenho deles. Tudo no mesmo lugar!") + a + a + encodeURIComponent("Acho que você vai gostar:)") + a + encodeURIComponent("Experimente! ") + n[4].id, | |
p = "mailto:?&subject=" + m + "&body=" + u, | |
l = n[5].id; | |
e.shortenedShareLinks = { | |
twitter: r, | |
facebook: s, | |
whatsapp: c, | |
messenger: d, | |
email: p, | |
directLink: l | |
} | |
} | |
function p(n) { | |
if (n) { | |
if (n.ranking) var t = n.ranking; | |
n.invite ? (e.invite = n.invite, e.$parent.c_dash.invitationsLeft = e.invite.invitationsLeft) : (e.invite = {}, e.invite.invitationsLeft = 10, e.$parent.c_dash.invitationsLeft = 10), e.inviteds = t.slice(), e.invitedsRow || (e.invitedsRow = []), e.inviteds || (e.inviteds = []); | |
for (var i = 0; i < 10 - e.invite.invitationsLeft; i++) e.invitedsRow[i] = { | |
hasAcceptedInvite: !0, | |
email: !0 | |
}; | |
for (var i = 10 - e.invite.invitationsLeft; i < e.invite.invitationsLeft; i++) e.invitedsRow[i] = { | |
hasAcceptedInvite: !1 | |
} | |
} | |
} | |
var l = function() { | |
e.sharepanelIsLoading = !0, o.all([n.mine()]).then(function(e) { | |
p(e[0]) | |
}) | |
}; | |
l(), e.sendInvite = function(o) { | |
n.invite(o).then(function(n) { | |
i.track(e.c_dash.user, "Invite Sent", {}), t.success("Convite enviado", { | |
raw: !0 | |
}), p(n) | |
}, function(e) { | |
t.error(e.message) | |
}) | |
}, e.trackShare = function(n) { | |
i.track(e.c_dash.user, "Share Click", { | |
media: n, | |
userCanInvite: e.c_dash.user.isRegisterVerified | |
}) | |
}, e.resend = function(e) { | |
n.resend(e).then(function(e) { | |
t.success("Convite reenviado", { | |
raw: !0 | |
}) | |
}, function(e) { | |
t.error(e.message) | |
}) | |
}, e.$watch("$parent.c_dash.show_notifications", function(n, t) { | |
e.user || (e.user = r.getCurrent(!0)), n && e.sharepanelIsLoading && m() | |
}), e.doCopy = function(e) { | |
s.copy(e), t.success("Link único copiado!", { | |
raw: !0 | |
}) | |
}, e.getNumber = function(e) { | |
return new Array(e) | |
} | |
} | |
return { | |
scope: { | |
closeFn: "&" | |
}, | |
templateUrl: "app/components/sharepanel/sharepanel.template.html", | |
link: c | |
} | |
} | |
angular.module("warren.components.sharepanel", []).directive("wrnSharepanel", e), e.$inject = ["$window", "wrnInvites", "wrnFlash", "wrnAnalytics", "$q", "config", "wrnUser", "wrnClipboard"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, n, t) { | |
function i(e, n, t) { | |
e.page = t.page | |
} | |
return { | |
scope: { | |
active: "=" | |
}, | |
templateUrl: "app/components/stylemenu/stylemenu.template.html", | |
link: i | |
} | |
} | |
angular.module("warren.components.stylemenu", []).directive("wrnStylemenu", e), e.$inject = ["$window", "$timeout", "config"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/components/suitability/suitability.template.html", | |
link: t, | |
controller: i, | |
controllerAs: "c_suitability" | |
} | |
} | |
function t(e, t, i) { | |
e.anchor = t[0], e.terminal = angular.element(t[0].querySelector("#terminal")), e.operations = angular.element(t[0].querySelector("#operations")), e.c_suitability.onScroll() | |
} | |
function i(e, t, i, n, a, r, s, o, l, u, c, p, m, f, y) { | |
function g() { | |
try { | |
o.pixelFB("Suitability Started"), o.track(null, "Suitability Started", {}) | |
} catch (e) {} | |
O = y.isEmpty("accounts.accessToken"), I = t.performance.now() | |
} | |
function w() {} | |
function b() { | |
W = !0, d() | |
} | |
function h() { | |
var e = { | |
answers: B, | |
referralId: f.referralId, | |
context: f.context | |
}; | |
s.post("/api/v2/suitability/finish", e).then(function(e) { | |
var i = e.data; | |
A = i.user.investmentProfile.computedProfileType, C.hasFinished = !0, c.set("tutorial", !0), i.accessToken && p.externalLogin(i.accessToken, i.user), j = t.performance.now(); | |
try { | |
o.pixelFB("Lead"), o.track(i.user, "Suitability Finished", {}, O), m.affiliate() && o.event("invitee", "leftEmail", "suitability", "1") | |
} catch (e) {} | |
}, function(e) { | |
u.error("Error while finishing the suitability.", e, { | |
messageId: F, | |
answers: JSON.stringify(B) | |
}), console.error(e) | |
}) | |
} | |
function d() { | |
var e = { | |
id: F, | |
answers: B, | |
context: f.context | |
}, | |
i = F; | |
if ("question_email" !== F && "email_already_taken" !== F || (B.email_already_taken && (B.question_email = B.email_already_taken), h()), F) { | |
var a = t.performance.now() - j; | |
try { | |
o.event("suitability", "answer", F), o.timing("suitability", F, a) | |
} catch (e) {} | |
} | |
C.isWaitingServer = !0, l.toPosition(1e6, 0), s.post("/api/v2/suitability/message", e).then(function(e) { | |
C.isWaitingServer = !1, P = e.data, v(e.data), "final" !== e.data.id || f.home || "question_email" == i || "email_already_taken" == i || n(function() { | |
h() | |
}, 5e3) | |
}, function(e) { | |
C.isWaitingServer = !1, u.error("Error while getting a suitability message.", e, { | |
messageId: F, | |
answers: JSON.stringify(B) | |
}), console.error(e) | |
}) | |
} | |
function v(e) { | |
var t; | |
for (e.answers && (e.answers.question_name && (B.question_name = e.answers.question_name), e.answers.question_email && (B.question_email = e.answers.question_email), e.answers.question_age && (B.question_age = e.answers.question_age)), F = e.id, t = 0; t < e.messages.length; t++) { | |
var i = e.messages[t]; | |
i = i.split("<erase>"), i = "['" + i.join("', '") + "']", H.push({ | |
type: "message", | |
value: i | |
}) | |
} | |
e.inputs.length && H.push({ | |
type: "input", | |
value: e.inputs[0] | |
}), e.buttons.length && H.push({ | |
type: "buttons", | |
value: e.buttons | |
}), _() | |
} | |
function _() { | |
if (H.length) { | |
var a, r, s = H.shift(); | |
"message" === s.type ? (a = '<wrn-suitability-message text="%1"></wrn-suitability-message>', r = a.replace("%1", s.value), r = i(r)(e), e.terminal.append(r)) : "input" === s.type ? (a = '<wrn-suitability-input id="%1" type="%2"></wrn-suitability-input>', r = a.replace("%1", F), r = r.replace("%2", s.value), r = i(r)(e), e.operations.append(r)) : "buttons" === s.type && (a = '<wrn-suitability-buttons id="%1" buttons="{{temp_buttons}}"></wrn-suitability-buttons>', r = a.replace("%1", F), e.temp_buttons = s.value, r = i(r)(e), e.operations.append(r)), n(function() { | |
if (C.onAfterWrite(), "message" !== s.type) { | |
j = t.performance.now(); | |
try { | |
o.event("suitability", "view", F) | |
} catch (e) {} | |
} | |
}, 50) | |
} | |
} | |
function S(t, n, r) { | |
"question_email" == t && (n = n.replace(/\s/g, "")), B[t] = n, e.operations.html(""); | |
var s = r || n; | |
if (P.responses.length) { | |
s = P.responses[0]; | |
var o = s.match(/{{([^}]+)}}/g); | |
if (o) | |
for (var l = 0; l < o.length; l++) { | |
var u = o[l], | |
c = u.substring(2, u.length - 2), | |
p = "return " + c + ";", | |
m = new Function("answers", p); | |
s = s.replace(new RegExp(u, "g"), m(B)) | |
} | |
} else P.inputs.length && "currency" === P.inputs[0] && (s = a("money")(n, "R$ ")); | |
var f = '<wrn-suitability-message owner="user" initial="%1" text="%2"></wrn-suitability-message>', | |
y = f.replace("%1", B.question_name[0]); | |
y = y.replace("%2", "'" + s + "'"), y = i(y)(e), e.terminal.append(y), d() | |
} | |
function q() { | |
try { | |
var e = t.performance.now() - j; | |
o.event("suitability", "answer", "go_profile"), o.timing("suitability", "go_profile", e); | |
var i = t.performance.now() - I; | |
o.event("suitability", "link", "profile"), o.timing("suitability", "link", i, "profile") | |
} catch (e) {} | |
var n = B.question_name, | |
a = B.question_email; | |
m.config(n, a), r.go("profile", { | |
profile: A | |
}) | |
} | |
function k() { | |
_() | |
} | |
function $() { | |
E = window.innerHeight + window.scrollY >= document.body.offsetHeight - 50 | |
} | |
function x() { | |
E && l.toPosition(1e6, 0) | |
} | |
function T() { | |
if (!W) { | |
var i = t.innerHeight, | |
n = document.body.scrollTop || document.documentElement.scrollTop, | |
a = warren.utils.getGlobalOffset(e.anchor).top, | |
r = a > n && a < n + i; | |
if (r) try { | |
b() | |
} catch (t) { | |
e.$apply(b) | |
} | |
} | |
} | |
e.$on("$destroy", w); | |
var W = !1, | |
E = !1, | |
F = null, | |
P = null, | |
A = null, | |
B = {}, | |
I = null, | |
j = null, | |
H = [], | |
O = null, | |
C = this; | |
C.hasFinished = !1, C.isWaitingServer = !1, C.onBeforeWrite = $, C.onAfterWrite = x, C.onAfterMessage = k, C.onScroll = T, C.answer = S, C.goToProfile = q, g() | |
} | |
i.$inject = ["$scope", "$window", "$compile", "$timeout", "$filter", "$state", "wrnBackend", "wrnAnalytics", "wrnSmoothScroll", "wrnCrash", "wrnContext", "wrnUser", "waitlist", "$stateParams", "wrnSession"], angular.module("warren.components.suitability", []).directive("wrnSuitability", e), e.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t, n, a, o, i, r, c, s) { | |
function u(e, u, d, l) { | |
e.data = { | |
tab: "menu", | |
numberNotifications: o.unreadAmount() | |
}, e.action = { | |
toMenu: function() { | |
e.data.tab = "menu", e.data.numberNotifications = o.unreadAmount() | |
}, | |
toNotifications: function() { | |
e.data.tab = "notifications" | |
}, | |
toFaq: function() { | |
e.data.tab = "faq" | |
}, | |
toUseraccount: function() { | |
e.data.tab = "useraccount" | |
}, | |
toContact: function() { | |
e.data.tab = "contact" | |
} | |
}, e.deleteAccount = function() { | |
var o = e.$parent.c_dash.totalBalance; | |
o > 0 ? i.alert("Deletar Conta", "Você não pode deletar sua conta antes de resgatar todo dinheiro investido!") : i.confirm("Deletar Conta", "Tem certeza que deseja deletar sua conta? Seus dados, objetivos e históricos serão deletados. Essa ação não pode ser revertida.", { | |
textCancel: "Não", | |
textOk: "Sim" | |
}).then(function(e) { | |
"ok" === e && r.deleteAccount().then(function(e) { | |
c.success("Conta deletada com sucesso!", { | |
raw: !0 | |
}), n(function() { | |
a.clean(), t.go("home") | |
}, 500) | |
}, function(e) { | |
c.error(e.message) | |
}) | |
}) | |
}, e.$watch("isOpen", function(t, n) { | |
t === !0 ? e.data.numberNotifications = o.unreadAmount() : t === !1 && e.action.toMenu() | |
}), e.computedProfileType = function() { | |
if (!e.$parent.c_dash.user || !e.$parent.c_dash.user.investmentProfile) return ""; | |
var t = e.$parent.c_dash.user.investmentProfile.computedProfileType; | |
return t | |
}, e.openChat = function() { | |
s.openChat(), e.closeFn() | |
} | |
} | |
return { | |
scope: { | |
name: "=", | |
initial: "=", | |
email: "=", | |
registerFinished: "=", | |
isOpen: "=", | |
closeFn: "&" | |
}, | |
templateUrl: "app/components/usermenu/usermenu.template.html", | |
link: u | |
} | |
} | |
e.$inject = ["$window", "$state", "$timeout", "wrnSession", "wrnNotifications", "wrnDialog", "wrnUser", "wrnFlash", "zendesk"], angular.module("warren.components.usermenu", []).directive("wrnUserMenu", e) | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t, n, o) { | |
function c(c, r, a) { | |
function i() { | |
t.addEventListener ? (t.addEventListener("mousewheel", s, !1), t.addEventListener("DOMMouseScroll", s, !1), r[0].addEventListener("click", s, !1), t.addEventListener("touchstart", s, !1)) : (t.attachEvent("onmousewheel", s), r[0].attachEvent("onclick", s), t.attachEvent("ontouchstart", s)), e.setScrollBody(!0), n(d, o.app.wizard.timeout) | |
} | |
function l() { | |
t.removeEventListener ? (t.removeEventListener("mousewheel", s), t.removeEventListener("DOMMouseScroll", s), r[0].removeEventListener("click", s), t.removeEventListener("touchstart", s)) : (t.dettachEvent("onmousewheel", s), r[0].dettachEvent("onclick", s), t.dettachEvent("ontouchstart", s)), e.setScrollBody(!1) | |
} | |
function s(e) { | |
e = t.event || e, c.$apply(function() { | |
d() | |
}), e.preventDefault() | |
} | |
function d() { | |
l(), c.active = !1, c.callbackFn && c.callbackFn() | |
} | |
c.$on("$destroy", l), c.color = a.color, c.hide = a.hide, c.active = !0, i() | |
} | |
return { | |
scope: { | |
callbackFn: "&" | |
}, | |
transclude: !0, | |
templateUrl: "app/components/wizard/wizard.template.html", | |
link: c | |
} | |
} | |
angular.module("warren.components.wizard", []).directive("wrnWizard", e), e.$inject = ["$rootScope", "$window", "$timeout", "config"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, e, t, a, c) { | |
function u(e, t, a, c, u) { | |
function r() { | |
if (o = e.user, o.$pendingBankAccounts = [], o.$pendingAddBankAccounts = [], o.$pendingRemoveBankAccounts = [], e.fnLoad && e.fnLoad()(e.form), o.bankAccounts && o.bankAccounts.length) | |
for (var t = 0; t < o.bankAccounts.length; t++) { | |
var a = warren.utils.deepcopy(o.bankAccounts[t]); | |
if (a.bank) { | |
var c = warren.enums.Bank[a.bank]; | |
["041", "074", "033", "237", "104", "341", "001"].indexOf(a.bank) == -1 && e.setBank(a, "other"), a.$dirtyBank = warren.utils.toCapitalCase(c) | |
} | |
o.$pendingBankAccounts.push(a) | |
} else e.addAccount(); | |
e.whitelistBanks = Object.keys(warren.enums.Bank); | |
var u = warren.utils.getEnumValues(warren.enums.Bank), | |
r = warren.utils.search.fuzzyFilter; | |
e.optionsBank = { | |
show_on_focus: !0, | |
suggest: function(e) { | |
return r(e, u, function(e) { | |
return { | |
label: n.trustAsHtml(e), | |
value: e | |
} | |
}) | |
} | |
} | |
} | |
var o; | |
e.addAccount = function() { | |
var n = { | |
_id: null, | |
bank: null, | |
type: "current", | |
agency: null, | |
number: null, | |
digit: null, | |
hasSecondHolder: !1, | |
firstHolderCPF: null, | |
firstHolderName: null | |
}; | |
o.$pendingBankAccounts.push(n), o.$pendingAddBankAccounts.push(n) | |
}, e.removeAccount = function(n, e) { | |
var t = o.$pendingBankAccounts[e]; | |
if (o.$pendingBankAccounts.splice(e, 1), t._id) o.$pendingRemoveBankAccounts.push(t); | |
else { | |
var a = o.$pendingAddBankAccounts.indexOf(t); | |
o.$pendingAddBankAccounts.splice(a, 1) | |
} | |
}, e.canRemoveAccount = function() { | |
return o.$pendingBankAccounts.length > 1 && !e.isAddingAccount | |
}, e.isBank = function(n, e) { | |
if ("other" === e) { | |
var t = ["041", "074", "033", "237", "104", "341", "001", "other"]; | |
return !(t.indexOf(e) !== -1 && !n.$other) | |
} | |
return n.bank === e && !n.$other | |
}, e.isInitialBankState = function(n) { | |
var e = null === n.bank, | |
t = "undefined" == typeof n.bank; | |
return (e || t) && !n.$other | |
}, e.setBank = function(n, e) { | |
"other" === e ? n.$other = !0 : (n.$other = !1, n.$dirtyBank = warren.enums.Bank[e], n.bank = e), n.$peste = e | |
}, e.setBankInput = function(n) { | |
var e = (n.$dirtyBank || "").toLowerCase(), | |
t = null; | |
Object.keys(warren.enums.Bank).forEach(function(n) { | |
var a = warren.enums.Bank[n]; | |
e === a.toLowerCase() && (t = n) | |
}), n.bank = t | |
}, r() | |
} | |
return { | |
scope: { | |
user: "=", | |
fnSubmit: "&", | |
fnLoad: "&" | |
}, | |
templateUrl: "app/components/account/bankaccounts/bankaccounts.template.html", | |
link: u | |
} | |
} | |
angular.module("warren.components.account.bankaccounts", []).directive("wrnAccountBankaccounts", n), n.$inject = ["$sce", "$timeout", "wrnUser", "wrnSmoothScroll", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t, o) { | |
function s(e, o, s) { | |
function d() { | |
e.fnLoad && e.fnLoad()(e.form), r.personalProfile.mobile && ("+" == r.personalProfile.mobile.charAt(0) ? e.webFormattedMobile = r.personalProfile.mobile.substring(3) : e.webFormattedMobile = r.personalProfile.mobile), e.address = r.address | |
} | |
var r = e.user; | |
e.$watch("webFormattedMobile", function() { | |
e.webFormattedMobile && (r.personalProfile.mobile = "+55" + e.webFormattedMobile.replace("(", "").replace(")", "").replace(" ", "").replace("-", "")) | |
}), e.guessAddress = function(t) { | |
t && (e.address.street = t.address, t.number && (e.address.number = t.number), t.city && (e.address.city = t.city), t.stateCode && 2 === t.stateCode.length && (e.address.state = t.stateCode), t.zipcode && 8 === t.zipcode.length && (e.address.zipcode = t.zipcode), t.neighborhood && (e.address.neighborhood = t.neighborhood)) | |
}, e.findZipcode = function() { | |
e.address.zipcode || t.getGeocodeByAddress(e.address.street + ", " + e.address.number + "- " + e.address.city + ". " + e.address.state).then(function(t) { | |
t.zipcode && 8 === t.zipcode.length && (e.address.zipcode = t.zipcode) | |
}) | |
}, e.findState = function() { | |
t.getGeocodeByAddress(e.address.city).then(function(t) { | |
t.stateCode && 2 === t.stateCode.length && (e.address.state = t.stateCode) | |
}) | |
}, d() | |
} | |
return { | |
scope: { | |
user: "=", | |
fnSubmit: "&", | |
fnLoad: "&" | |
}, | |
templateUrl: "app/components/account/contacts/contacts.template.html", | |
link: s | |
} | |
} | |
angular.module("warren.components.account.contacts", []).directive("wrnAccountContacts", e), e.$inject = ["wrnUser", "wrnMaps", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, n, r, t, o, a, d) { | |
function s(e, s, l) { | |
function u() { | |
function n(e) { | |
e.addEventListener("drop", function(n) { | |
c(n, e) | |
}), e.addEventListener("dragover", function(n) { | |
m(n, e) | |
}), e.addEventListener("dragleave", function(n) { | |
f(n, e) | |
}) | |
} | |
e.fnLoad && e.fnLoad()(e.form), e.user.document && (_ = e.user.document.issuedBy, h = e.user.document.type), e.document = b.document, e.address = b.address, e.profile = b.personalProfile, e.disableTerms || w(), n(y), n(k), n(B), window.addEventListener("drop", p, !1), window.addEventListener("dragover", g, !1), window.addEventListener("dragleave", v, !1), e.setDefaultIssuedBy() | |
} | |
function i() { | |
window.removeEventListener("drop", p), window.removeEventListener("dragover", g), window.removeEventListener("dragleave", v) | |
} | |
function c(n) { | |
switch (n.target.offsetParent.id) { | |
case "photo_document_front_field": | |
var r = "document_front"; | |
break; | |
case "photo_document_back_field": | |
var r = "document_back"; | |
if (!b.document.imageFront) return; | |
break; | |
case "photo_address_field": | |
var r = "address_front" | |
} | |
e.upload(r, n.dataTransfer.files[0]), n.preventDefault() | |
} | |
function m(e, n) { | |
warren.utils.isDraggingFile(e) && warren.utils.addClass(n, "drag") | |
} | |
function f(e, n) { | |
warren.utils.removeClass(n, "drag") | |
} | |
function p(e) { | |
e.preventDefault(), warren.utils.isDraggingFile(e) && (warren.utils.removeClass(y, "fixed"), warren.utils.removeClass(k, "fixed"), warren.utils.removeClass(B, "fixed"), warren.utils.removeClass(y, "drag"), warren.utils.removeClass(k, "drag"), warren.utils.removeClass(B, "drag"), warren.utils.removeClass(window.document.body, "page-overlay")) | |
} | |
function g(e) { | |
e.preventDefault(), warren.utils.isDraggingFile(e) && (E = !0, warren.utils.addClass(y, "fixed"), warren.utils.addClass(k, "fixed"), warren.utils.addClass(B, "fixed"), warren.utils.addClass(window.document.body, "page-overlay")) | |
} | |
function v(e) { | |
e.preventDefault(), warren.utils.isDraggingFile(e) && (E = !1, n(function() { | |
E || (warren.utils.removeClass(y, "fixed"), warren.utils.removeClass(k, "fixed"), warren.utils.removeClass(B, "fixed"), warren.utils.removeClass(window.document.body, "page-overlay")) | |
}, 100)) | |
} | |
function w() { | |
return d(function(n, t) { | |
r.getTerms([""]).then(function(r) { | |
if (e.terms = [], r) { | |
for (var t = 0; t < r.allTerms.length; t++) "termsOfUse" === r.allTerms[t].name && e.terms.push(r.allTerms[t]); | |
for (var t = 0; t < e.terms.length; t++) e.terms[t].checked && (e.terms[t].disabled = !0, e.updateTerm(e.terms[t])) | |
} | |
n(r) | |
}, function(e) { | |
o.error(e.message), t() | |
}) | |
}) | |
} | |
var b = e.user, | |
_ = null, | |
h = null; | |
e.disableRemoveImage = "undefined" != typeof l.disableRemoveImage, e.disableTerms = "true" == l.disableTerms, e.disableExposed = "undefined" != typeof l.disableExposed, e.documentUpload = null, e.addressUpload = null, e.documentWebcam = !1, e.addressWebcam = !1, e.acceptedTerms = [], e.$on("$destroy", i); | |
var y = document.getElementById("photo_document_front_field"), | |
k = document.getElementById("photo_document_back_field"), | |
B = document.getElementById("photo_address_field"), | |
E = !1; | |
e.startWebcam = function(n) { | |
b.document.imageFront && (a.config({ | |
width: 960, | |
height: 540, | |
image_format: "jpeg", | |
jpeg_quality: 90 | |
}), e.closeWebcam(), "photo_document_front" === n ? e.documentFrontWebcam = !0 : "photo_document_back" === n ? e.documentBackWebcam = !0 : e.addressFrontWebcam = !0, a.attach(n), t.to(n + "_field", null, null, -60)) | |
}, e.closeWebcam = function() { | |
e.documentFrontWebcam = !1, e.documentBackWebcam = !1, e.addressFrontWebcam = !1, a.shutdown() | |
}, e.snapWebcam = function(n) { | |
a.snap().then(function(r) { | |
e.closeWebcam(); | |
var t = warren.utils.dataUriToBlob(r); | |
e.upload(n, t) | |
}, function(e) { | |
o.error("Não foi possÃvel usar a imagem da webcam =(", { | |
raw: !0 | |
}) | |
}) | |
}, e.isWebcamEnabled = function() { | |
return !warren.utils.isSafari() | |
}, e.upload = function(n, t, a) { | |
function d(r) { | |
var t = parseInt(100 * r.loaded / r.total); | |
"document_front" === n ? e.documentFrontUpload = t : "document_back" === n ? e.documentBackUpload = t : e.addressUpload = t | |
} | |
function s() { | |
"document_front" === n ? e.documentFrontUpload = null : "document_back" === n ? e.documentBackUpload = null : e.addressUpload = null | |
} | |
a && a.length && ("maxSize" === a[0].$error ? o.error("error_upload_file_too_big") : o.error("error_upload_invalid_type")), t && (self.isSaving = !0, r.upload(n, t, null, d).then(function(e) { | |
s(), "document_front" === n ? (b.document.imageFront || (b.document.imageFront = null), b.document.imageFront = e) : "document_back" === n ? (b.document.imageBack || (b.document.imageBack = null), b.document.imageBack = e) : (b.address.imageFront || (b.address.imageFront = null), b.address.imageFront = e), self.isSaving = !1 | |
}, function(e) { | |
s(), console.error(e); | |
var n = null; | |
if (e.errors) { | |
n = "<ul>"; | |
for (var r = 0; r < e.errors.length; r++) n += "<li>" + e.errors[r].msg + "</li>"; | |
n += "</ul>" | |
} | |
o.error(e.message, n), self.isSaving = !1 | |
})) | |
}, e.remove = function(n) { | |
"documents" === n ? e.documentUpload = 100 : e.addressUpload = 100, r.removeDocument(n).then(function(r) { | |
"documents" === n ? (e.documentUpload = null, e.document.image = null) : (e.addressUpload = null, e.address.image = null) | |
}, function(r) { | |
console.error(r); | |
var t = null; | |
if (r.errors) { | |
t = "<ul>"; | |
for (var a = 0; a < r.errors.length; a++) t += "<li>" + r.errors[a].msg + "</li>"; | |
t += "</ul>" | |
} | |
o.error(r.message, t), "documents" === n ? e.documentUpload = null : e.addressUpload = null | |
}) | |
}, e.setDefaultIssuedBy = function(n) { | |
n || h || _ || (e.document.type = "cnh", e.document.issuedBy = "detran"), h != n ? "rg" == n ? e.document.issuedBy = "ssp" : "cnh" == n && (e.document.issuedBy = "detran") : h == n && (e.document.issuedBy = _, e.document.type = h) | |
}, e.exposeRefresh = function() { | |
e.profile.isExposed || (e.profile.isExposedAsPublicServant = !1, e.profile.isExposedAsGovernmentServant = !1, e.profile.isExposedByRelationship = !1) | |
}, e.updateTerm = function(n) { | |
var r = e.acceptedTerms.indexOf(n.name); | |
r === -1 ? e.acceptedTerms.push(n.name) : r >= 0 && e.acceptedTerms.splice(r, 1), e.user.acceptedTerms = e.acceptedTerms.length === e.terms.length, e.user.termsToAccept = e.acceptedTerms | |
}, e.updateAllTerms = function(n) { | |
for (var r = 0; r < e.terms.length; r++) { | |
var t = document.getElementById(e.terms[r].id); | |
(n && !t.checked || !n && t.checked) && t.click() | |
} | |
}, u() | |
} | |
return { | |
scope: { | |
user: "=", | |
fnSubmit: "&", | |
fnLoad: "&" | |
}, | |
templateUrl: "app/components/account/documents/documents.template.html", | |
link: s | |
} | |
} | |
angular.module("warren.components.account.documents", []).directive("wrnAccountDocuments", e), e.$inject = ["$document", "$timeout", "wrnUser", "wrnSmoothScroll", "wrnFlash", "wrnWebcam", "$q"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, e) { | |
function c(n, e, c) { | |
function t() { | |
n.fnLoad && n.fnLoad()(n.form) | |
} | |
n.user; | |
t() | |
} | |
return { | |
scope: { | |
user: "=", | |
fnSubmit: "&", | |
fnLoad: "&" | |
}, | |
templateUrl: "app/components/account/finances/finances.template.html", | |
link: c | |
} | |
} | |
angular.module("warren.components.account.finances", []).directive("wrnAccountFinances", n), n.$inject = ["$window", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t, a, o, r, s, i) { | |
function n(e, t, o) { | |
function r() { | |
e.fnLoad && e.fnLoad()(e.form), c.nationality || (c.nationality = "brasileiro-nato"), c.maritalStatus || (c.maritalStatus = "solteiro", f = c.maritalStatus), e.guessSex(), e.guessMarital(), e.guessState(), e.guessCity() | |
} | |
var n, l, u, f, m = e.user, | |
c = m.personalProfile, | |
d = m.address; | |
e.hasProfession = e.user.personalProfile.profession !== i.getString("common_field_profession_unemployed"), e.isMarried = function() { | |
return "casado-brasileiro-nato" === c.maritalStatus || "casado-brasileiro-naturalizado" === c.maritalStatus || "casado-estrangeiro" === c.maritalStatus || "uniao-estavel" === c.maritalStatus | |
}, e.guessSex = function() { | |
if ((m.name || m.personalProfile.name) && c.sex === n) { | |
var e = m.personalProfile.name || m.name; | |
e = e.trim().replace(/\s+/, " "); | |
var t = e.split(" ")[0]; | |
if (!t) return; | |
var a = t.slice(-1); | |
"o" === a ? (c.sex = "male", n = "male") : (c.sex = "female", n = "female") | |
} else n = void 0 | |
}, e.guessMarital = function() { | |
if (c.birthDate && c.maritalStatus === f) { | |
var e = s(c.birthDate), | |
t = s().diff(e, "years"); | |
t < 28 ? c.maritalStatus = "solteiro" : c.maritalStatus = "casado-brasileiro-nato", f = c.maritalStatus | |
} else f = void 0 | |
}, e.guessCity = function() { | |
l = c.birthCity && d.city === l ? c.birthCity : void 0 | |
}, e.guessState = function() { | |
u = c.birthState && d.state === u ? c.birthState : void 0 | |
}, e.findBirthState = function() { | |
a.getGeocodeByAddress(c.birthCity).then(function(e) { | |
e.stateCode && (c.birthState = e.stateCode) | |
}) | |
}, e.unemployed = function(t) { | |
e.hasProfession = !t, t && (e.user.personalProfile.profession = i.getString("common_field_profession_unemployed"), e.user.personalProfile.workOrganization = "") | |
}, e.changeProfession = function() { | |
e.unemployed(e.user.personalProfile.profession === i.getString("common_field_profession_unemployed")) | |
}, r() | |
} | |
return { | |
scope: { | |
user: "=", | |
fnSubmit: "&", | |
fnLoad: "&" | |
}, | |
templateUrl: "app/components/account/personal/personal.template.html", | |
link: n | |
} | |
} | |
angular.module("warren.components.account.personal", []).directive("wrnAccountPersonal", e), e.$inject = ["$sce", "wrnUser", "wrnMaps", "wrnSmoothScroll", "wrnFlash", "moment", "wrnResources"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
scope: { | |
id: "@", | |
buttons: "@" | |
}, | |
templateUrl: "app/components/suitability/directives/wrn_suitability_buttons.template.html", | |
link: i | |
} | |
} | |
function i(t, i, n) { | |
t.items = JSON.parse(t.buttons), t.answer = function(i, n) { | |
t.$parent.c_suitability.answer(t.id, i, n) | |
} | |
} | |
angular.module("warren.components.suitability.buttons", []).directive("wrnSuitabilityButtons", t), t.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t, i) { | |
function n(n, e, o) { | |
n.data = { | |
value: null | |
}, n.scroll = function() { | |
i.toPosition(1e4), t(function() { | |
i.toPosition(1e4) | |
}, 10), t(function() { | |
i.toPosition(1e4) | |
}, 50), t(function() { | |
i.toPosition(1e4) | |
}, 100) | |
}, n.answer = function() { | |
var t = n.data.value; | |
if (null !== t && ("string" === n.type && (t = t.replace(/["'\\/<>]/g, ""), t = t.charAt(0).toUpperCase() + t.slice(1), t = t.substring(0, 30), "question_email" === n.id && (t = t.toLowerCase())), !("number" === n.type && t < 0))) { | |
if ("currency" === n.type) { | |
if (t < 0) return; | |
("" + t).length > 8 && (t = parseInt(("" + t).substring(0, 8))) | |
} | |
n.$parent.c_suitability.answer(n.id, t) | |
} | |
} | |
} | |
return { | |
scope: { | |
id: "@", | |
type: "@" | |
}, | |
templateUrl: "app/components/suitability/directives/wrn_suitability_input.template.html", | |
link: n | |
} | |
} | |
angular.module("warren.components.suitability.input", []).directive("wrnSuitabilityInput", t), t.$inject = ["$timeout", "wrnSmoothScroll"] | |
}(); | |
! function() { | |
"use strict"; | |
function i() { | |
return { | |
scope: { | |
owner: "@", | |
initial: "@", | |
text: "=" | |
}, | |
templateUrl: "app/components/suitability/directives/wrn_suitability_message.template.html", | |
link: t | |
} | |
} | |
function t(i, t, e) { | |
i.c_suitability = i.$parent.c_suitability, i.side = "left", i.owner && "user" === i.owner && (i.side = "right"), i.letter = i.initial || "W" | |
} | |
angular.module("warren.components.suitability.message", []).directive("wrnSuitabilityMessage", i), i.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/404/404.template.html" | |
} | |
} | |
function t() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/404/404.incognito.template.html" | |
} | |
} | |
angular.module("warren.pages.404", []).directive("warren404", e), angular.module("warren.pages.incognito", []).directive("warrenIncognito", t), e.$inject = [], t.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
templateUrl: "app/pages/about/about.template.html", | |
controller: o, | |
controllerAs: "c_about" | |
} | |
} | |
function o(t, o, r, e, n, a, l) { | |
function c() { | |
try { | |
e.pageView("about") | |
} catch (t) {} | |
} | |
c() | |
} | |
angular.module("warren.pages.about", []).controller("warrenAboutController", o).directive("warrenAbout", t), t.$inject = [], o.$inject = ["$scope", "$timeout", "wrnUser", "wrnAnalytics", "wrnContext", "wrnPortfolio", "wrnSmoothScroll"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, o, e, t, r, i, u) { | |
function s() { | |
try { | |
e.pageView("builder") | |
} catch (n) {} | |
return i.isEmpty("accounts.accessToken") ? o.go("home") : (d.page = "chat", d.isLoading = !0, d.wizards = { | |
shouldOpen1: !1, | |
shouldOpen2: !1 | |
}, void n.all([c(), l()]).then(function() { | |
d.isLoading = !1; | |
try { | |
e.track(d.user, "Builder Started", {}) | |
} catch (n) {} | |
}, function() { | |
console.log("reject") | |
})) | |
} | |
function c() { | |
return n(function(n, o) { | |
t.become().then(function(o) { | |
d.user = o, d.user.isPortfolioFinished || (d.wizards.shouldOpen1 = !0, d.wizards.shouldOpen2 = !1), n() | |
}, function(n) { | |
console.error(n), o() | |
}) | |
}) | |
} | |
function l() { | |
return n(function(n, o) { | |
r.getSuggestions().then(function(o) { | |
d.funds = {}; | |
for (var e = 0; e < o.length; e++) d.funds[o[e].apiId] = o[e]; | |
n() | |
}, function(n) { | |
console.error(n), o() | |
}) | |
}) | |
} | |
function a(n, o) { | |
d.page = n, "undefined" != typeof o && (d.context = o), u.toPosition(0) | |
} | |
var d = this; | |
d.user = null, d.funds = null, d.page = null, d.context = null, d.wizards = null, d.isLoading = null, d.toPage = a, s() | |
} | |
n.$inject = ["$q", "$state", "wrnAnalytics", "wrnUser", "wrnPortfolio", "wrnSession", "wrnSmoothScroll"], warren.angular.controller("warren.pages.builder", n) | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/dash/dash.template.html", | |
controller: t, | |
controllerAs: "c_dash" | |
} | |
} | |
function t(e, t, n, o, i, a, s, r, l, c, u, g, f, d, p, m, h, v, w, _) { | |
function E() { | |
try { | |
r.pageView("dash") | |
} catch (e) {} | |
var o = (new Date).getTime(); | |
t.all([l.become(), c.getAll(), m.optional(d.getMine()), m.optional(c.getInvites())]).then(function(t) { | |
var i = 0, | |
a = t[0], | |
s = t[1].portfolios, | |
l = t[2], | |
c = t[3].invites, | |
g = null; | |
for (i = 0; i < s.length; i++) { | |
var d = s[i]; | |
if (!d.isVirtual) { | |
var p = w(d.lastUpdatedAt); | |
g || (g = p), g = w.max(g, p) | |
} | |
} | |
if (g) { | |
var m = "", | |
h = w().date(), | |
_ = h - 1; | |
g.date() !== h && (m += g.date() === _ ? "ontem " : "no dia " + g.format("DD/MM") + " "), m += "Ã s " + g.format("HH:mm"), G.updateMessage = f.getString("portfolio_update_time_updateat", m) | |
} else G.updateMessage = f.getString("portfolio_update_time_noupdate"); | |
var E = (a.personalProfile || {}).mobile; | |
v.setUser(a.name, a.email, E), t[0].configs && t[0].configs.dashboardValue ? G.toggleHide = t[0].configs.dashboardValue : G.toggleHide = "show", P(a, s, l, c); | |
var A = b(a, s); | |
D(); | |
var B = 0, | |
V = 0; | |
for (i = 0; i < s.length; i++) s[i].isVirtual ? B++ : V++; | |
a.totalBalance = G.totalBalance, a.totalEarnings = G.totalEarnings; | |
try { | |
r.identify(a), r.track(a, "Login", { | |
virtualPortfoliosCount: B, | |
realPortfoliosCount: V, | |
totalBalance: G.totalBalance, | |
totalEarnings: G.totalEarnings, | |
depositAcceptedCount: a.depositAcceptedCount, | |
firstDepositAcceptedAt: a.firstDepositAcceptedAt, | |
lastDepositAcceptedAt: a.lastDepositAcceptedAt | |
}) | |
} catch (e) {} | |
if (!A) { | |
if (u.isEmpty("session.welcome")) { | |
G.isAnimationDisabled = !1; | |
var y = (new Date).getTime() - o, | |
C = warren.utils.clamp(2e3 - y, 0, 2e3); | |
n(function() { | |
N("interval") | |
}, C), n(function() { | |
N("welcome") | |
}, C + 500), n(function() { | |
N("finished"), u.set("session.welcome", !0, !0) | |
}, 3e3 + C + 500) | |
} else N("finished"); | |
a.goWaitList && L(), e.refreshEmoji() | |
} | |
}, function(e) { | |
console.error(e) | |
}) | |
} | |
function A() { | |
G.hideGrossValue = !G.hideGrossValue | |
} | |
function B() { | |
i.cancel(x) | |
} | |
function P(e, t, n, o) { | |
G.user = e, G.posts = n, G.groupInvites = o, G.posts[0] && d.track(G.posts[0].id, { | |
see: !0 | |
}), t.sort(function(e, t) { | |
return new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime() | |
}), G.portfolios = t, G.totalBalance = 0, G.totalEarnings = 0, G.totalEarningsPercentage = 0, G.netBalance = 0; | |
for (var i = 0; i < G.portfolios.length; i++) { | |
var a = G.portfolios[i]; | |
a.totalBalance = a.totalBalance || 0, a.netBalance = a.netBalance || 0, a.totalEarnings = a.totalEarnings || 0, a.totalEarningsPercentage = a.totalEarningsPercentage || 0, a.monthEarnings = a.monthEarnings || 0, a.monthEarningsPercentage = a.monthEarningsPercentage || 0, a.isVirtual || (G.totalBalance += a.totalBalance, G.totalEarnings += a.totalEarnings, G.totalEarningsPercentage += a.totalEarningsPercentage, G.netBalance += a.netBalance), a.goalAmount && "free" !== a.goal && (a.goalPercentage = Math.min(1, a.totalBalance / a.goalAmount)) | |
} | |
G.totalBalance = G.totalBalance || 0, G.totalEarnings = G.totalEarnings || 0, G.totalEarningsPercentage = G.totalEarningsPercentage || 0, "checkEmailForSetupNotification" === e.dash && (G.resendEmail = $) | |
} | |
function b(e, t) { | |
var n = "app/pages/dash/messages/"; | |
return "doFirstSuitability" === e.dash ? (o.go("suitability"), 1) : void(e.goWaitList ? G.summaryTemplate = n + "goWaitList.template.html" : "buildFirstPortfolio" === e.dash ? o.go("builder") : (!e.isPortfolioVisited && G.portfolios && G.portfolios[0] && G.portfolios[0].isShared && o.go("portfolio", { | |
id: G.portfolios[0]._id | |
}), G.summaryTemplate = n + e.dash + ".template.html")) | |
} | |
function D() { | |
V(), x = i(function() { | |
V() | |
}, 3e4) | |
} | |
function V() { | |
g.getUnreadCount().then(function(e) { | |
G.numberNotifications = e.unreadLogsCount, G.hasNewNotification = e.unreadLogsCount > 0 | |
}) | |
} | |
function N(e) { | |
R = e | |
} | |
function y(e) { | |
return j === e | |
} | |
function C(e) { | |
return "welcome" === e && "finished" === R || R === e | |
} | |
function S() { | |
G.show_notifications = !G.show_notifications, a.setScrollBody(G.show_notifications), G.show_notifications && (G.hasNewNotification = !1) | |
} | |
function H() { | |
G.show_sidepanel = !G.show_sidepanel, a.setScrollBody(G.show_sidepanel), G.numberNotifications = g.unreadAmount() | |
} | |
function L() { | |
G.processingReserve = !0, h.config(G.user.name, G.user.email), h.position().then(function(e) { | |
G.user.reservation = e.reservation, G.processingReserve = !1, n(function() { | |
o.go("lineplace") | |
}, 4e3) | |
}, function(e) { | |
G.processingReserve = !1, o.go("lineregister", { | |
name: G.user.name, | |
email: G.user.email | |
}) | |
}) | |
} | |
function k(e) { | |
if (e) { | |
for (var t = 0; t < G.posts.length; t++) | |
if (G.posts[t].id === e) { | |
G.posts.splice(t, 1); | |
break | |
} | |
G.posts[0] && d.track(G.posts[0].id, { | |
see: !0 | |
}), d.track(e, { | |
discard: !0 | |
}).then(function(e) { | |
n(function() { | |
G.posts.length || (G.allPostsRead = f.getString("dash_posts_read")) | |
}, 100) | |
}) | |
} | |
} | |
function T() { | |
e.canCreateNewGoal() && o.go("builder") | |
} | |
function I() { | |
"hide" == G.toggleHide ? G.toggleHide = "show" : G.toggleHide = "hide", l.updateConfigs({ | |
dashboardValue: G.toggleHide | |
}).then(function(e) {}) | |
} | |
function M() { | |
return "hide" == G.toggleHide ? "ic_preview_hidden_24px_white.svg" : "ic_preview_24px_white.svg" | |
} | |
function $() { | |
G.resendingEmail = !0, l.resendVerifyEmail(G.user.email).then(function(e) { | |
G.resendingEmail = !1, p.success("dash_context_checkemailforsetupnotification_sent") | |
}, function(e) { | |
G.resendingEmail = !1, p.error(error.message) | |
}) | |
} | |
e.$on("$destroy", B); | |
var R = "loading", | |
j = "none", | |
x = null, | |
G = this; | |
G.user = null, G.DELAY_NAVBAR = 1e3, G.DELAY_GOALLIST = 1500, G.DELAY_HEROTITLE = 0, G.DELAY_HEROMESSAGE = 0, G.DELAY_HEROBUTTON = 300, G.summaryTemplate = null, G.portfolios = null, G.totalBalance = null, G.netBalance = null, G.hideGrossValue = null, G.monthEarnings = null, G.monthEarningsPercentage = null, G.isStep = y, G.isLoading = C, G.toggleMenuPanel = H, G.toggleNotificationsPanel = S, G.hasNewNotification = !1, G.numberNotifications = 0, G.newGoal = T, G.isAnimationDisabled = !0, G.discardPost = k, G.swapNetGrossValue = A, G.getPreview = M, G.changeHideValue = I, G.show_notifications = !1, G.updateMessage = null, E(), e.canCreateNewGoal = function() { | |
for (var e = 0, t = 0, n = 0; n < G.portfolios.length; n++) G.portfolios[n].isVirtual || 0 === G.portfolios[n].totalBalance ? t++ : e++; | |
return !(e >= f.getValue("portfolios_limit_with_money")) && !(t >= f.getValue("portfolios_limit_without_money")) | |
}, e.refreshEmoji = function() { | |
var t = f.getStringArray("dash_context_hidden_balance_emojis"), | |
n = Math.floor(Math.random() * t.length); | |
e.emoji = s.trustAsHtml(t[n]), e.emojiPortfolio = s.trustAsHtml(t[n].substring(0, 2)) | |
}, e.seeInvite = function(e) { | |
e && e.group && _.inviteDetails("Convite", "", { | |
textCancel: "Cancelar", | |
textOk: "Aceitar", | |
group: e.group | |
}).then(function(t) { | |
"ok" === t && c.acceptInvite(e._id).then(function(e) { | |
o.go("portfolio", { | |
id: e.portfolio._id | |
}) | |
}, function(e) { | |
p.error(e.message) | |
}) | |
}) | |
}, e.cancelInvite = function(e) { | |
e && _.confirm("Recusar convite", "Você tem certeza que deseja recusar o convite para o objetivo “<b>" + e.group.name + "</b>�", { | |
textOk: "Sim", | |
textCancel: "Não" | |
}).then(function(t) { | |
if ("ok" === t) { | |
for (var n = e._id, o = 0; o < G.groupInvites.length; o++) | |
if (G.groupInvites[o]._id === n) { | |
G.groupInvites.splice(o, 1); | |
break | |
} | |
c.cancelInvite(e._id).then(function(e) { | |
p.success("Convite recusado!", { | |
raw: !0 | |
}) | |
}, function(e) { | |
p.error(e.message) | |
}) | |
} | |
}) | |
} | |
} | |
t.$inject = ["$scope", "$q", "$timeout", "$state", "$interval", "$rootScope", "$sce", "wrnAnalytics", "wrnUser", "wrnPortfolio", "wrnSession", "wrnNotifications", "wrnResources", "wrnPost", "wrnFlash", "pr", "waitlist", "zendesk", "moment", "wrnDialog"], angular.module("warren.pages.dash", []).controller("warrenDashController", t).directive("warrenDash", e), e.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function o() { | |
return { | |
templateUrl: "app/pages/deposit/deposit.template.html", | |
controller: n, | |
controllerAs: "c_deposit" | |
} | |
} | |
function n(o, n, t, e, i, r, a, l, s) { | |
function p() { | |
try { | |
i.pageView("deposit") | |
} catch (o) {} | |
return t.id ? void r.getDepositById(t.id).then(function(o) { | |
d.deposit = o, d.deposit.paymentBankImg = warren.enums.BankImages[d.deposit.paymentBankCode], a.getById(o.toPortfolio).then(function(o) { | |
d.loading = !1, d.portfolio = o | |
}, function(o) { | |
console.error(o) | |
}) | |
}, function(o) { | |
console.error(o) | |
}) : void n.go("404") | |
} | |
function c() { | |
d.inputVisible = !0 | |
} | |
var d = this; | |
d.loading = !0, d.sendingEmail = null, d.deposit = null, d.portfolio = null, d.inputVisible = !1, d.showInput = c, p(), o.doCopy = function(o, n) { | |
"CNPJ copiado" == n && (o = o.replace(/[-\/.]/g, "")), l.copy(o), s.info(n, { | |
raw: !0 | |
}) | |
} | |
} | |
angular.module("warren.pages.deposit", []).controller("warrenDepositController", n).directive("warrenDeposit", o), o.$inject = [], n.$inject = ["$scope", "$state", "$stateParams", "$document", "wrnAnalytics", "wrnTransaction", "wrnPortfolio", "wrnClipboard", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/deposits/deposits.template.html", | |
controller: o, | |
controllerAs: "c_deposits" | |
} | |
} | |
function o(e, o, t, n, i, r, s, a, l, u, c, p, f) { | |
function d() { | |
try { | |
r.pageView("deposits") | |
} catch (e) {} | |
return P.id = t.id, P.id ? void e.all([v(), m()]).then(function() { | |
$(P.portfolio.fund), P.data.value = M(), P.user.isRegisterVerified || o.go("register") | |
}) : void o.go("404") | |
} | |
function v() { | |
return e(function(e, o) { | |
s.getCurrent().then(function(o) { | |
P.user = o, e() | |
}, function(e) { | |
console.error(e), o() | |
}) | |
}) | |
} | |
function m() { | |
return e(function(e, o) { | |
a.getById(P.id).then(function(o) { | |
P.portfolio = o, e() | |
}, function(e) { | |
console.error(e), o() | |
}) | |
}) | |
} | |
function g() { | |
P.user.canCreateInvoice ? P.showInvoiceInfo = !0 : P.invoiceNotAvailableMessage = "Ops! Por enquanto esta opção não está disponÃvel." | |
} | |
function h() { | |
A(P.data.value) && (P.data.value && (P.step = "type"), P.inputVisible = !1, l.toPosition(0)) | |
} | |
function y(e) { | |
if (l.toPosition(0), e && (P.type = e), P.portfolio.monthlyInvestment && P.portfolio.isVirtual && !P.portfolio.isInvoiceCreated && !P.portfolio.isDepositCreated && "schedule" != P.step) return void(P.step = "schedule"); | |
var t = { | |
amount: P.data.value, | |
toPortfolio: P.id | |
}; | |
"invoice" === P.type ? (P.savingInvoice = !0, u.createInvoice(t).then(function(e) { | |
try { | |
r.pixelFB("Deposit Created"), r.track(P.user, "Deposit Created", { | |
type: "Invoice", | |
amount: e.amount | |
}) | |
} catch (e) {} | |
P.invoice = e, o.go("invoice", { | |
id: e._id | |
}) | |
}, function(e) { | |
console.error(e), P.savingInvoice = !1, c.error(e.message) | |
})) : (P.savingDoc = !0, u.createDeposit(t).then(function(e) { | |
try { | |
r.pixelFB("Deposit Created"), r.track(P.user, "Deposit Created", { | |
type: "TED/DOC", | |
amount: e.amount | |
}) | |
} catch (e) {} | |
P.deposit = e, o.go("deposit", { | |
id: e._id | |
}) | |
}, function(e) { | |
console.error(e), P.savingDoc = !1, c.error(e.message) | |
})) | |
} | |
function I() { | |
l.toPosition(1e4) | |
} | |
function D() { | |
return i("money")(P.data.value, "R$ ") | |
} | |
function w() { | |
P.invoiceNotAvailableMessage = null, P.showInvoiceInfo = !1, "type" === P.step ? P.step = "value" : "ted" === P.step || "boleto" === P.step || "schedule" === P.step ? P.step = "type" : o.go(t.backTo || "portfolio", { | |
id: P.id | |
}) | |
} | |
function V() { | |
P.inputVisible = !0 | |
} | |
function A() { | |
var e = !P.portfolio.totalBalance || P.portfolio.isVirtual ? "initial" : "monthly"; | |
return void 0 === P.data.value || C(P.data.value, e) ? (P.suggestedMessage = "", !0) : (P.suggestedMessage = p.getString("deposits_error_" + e + "_min"), !1) | |
} | |
function C(e, o) { | |
return "initial" === o ? e >= p.getValue("deposits_minimum_initial") : "monthly" === o ? e >= p.getValue("deposits_minimum_monthly") : void 0 | |
} | |
function _(e) { | |
return i("money")(e, "R$ ", 0) | |
} | |
function b() { | |
return i("money")(P.portfolio.monthlyInvestment, "R$ ") | |
} | |
function M() { | |
return P.portfolio.isVirtual || !P.portfolio.totalBalance ? P.portfolio.initialInvestment : P.portfolio.monthlyInvestment | |
} | |
function R(o) { | |
return P.isAcceptingTerms = !0, e(function(e, t) { | |
s.acceptTerm(o).then(function(e) { | |
P.isAcceptingTerms = !1, P.inputVisible = !1, P.step = "value" | |
}, function(e) { | |
c.error(e.message) | |
}) | |
}) | |
} | |
function T() { | |
!P.portfolio.investReminderDay || P.portfolio.investReminderDay < 1 || P.portfolio.investReminderDay > 28 || (P.portfolioData = { | |
name: P.portfolio.name, | |
goal: P.portfolio.goal, | |
goalAmount: P.portfolio.goalAmount, | |
goalYears: P.portfolio.goalDuration, | |
goalMonthlyIncome: P.portfolio.goalMonthlyIncome, | |
initialInvestment: P.portfolio.initialInvestment, | |
monthlyInvestment: P.portfolio.monthlyInvestment, | |
investReminderDay: P.portfolio.investReminderDay | |
}, P.saving = !0, a.update(P.portfolio._id, P.portfolioData).then(function() { | |
y() | |
}, function(e) { | |
P.saving = !1, c.error(e.message) | |
})) | |
} | |
function $(o) { | |
return e(function(e, t) { | |
s.getTerms([o]).then(function(o) { | |
o && o.askedNotAcceptedTerms && (P.step = "terms"), P.loading = !1, e(o) | |
}, function(e) { | |
c.error(e.message), t() | |
}) | |
}) | |
} | |
var P = this; | |
P.invoiceNotAvailableMessage = null, P.id = null, P.loading = !0, P.user = null, P.portfolio = null, P.step = "value", P.savingDoc = !1, P.savingInvoice = !1, P.deposit = null, P.inputVisible = !1, P.scheduled = !1, P.type = null, P.data = { | |
value: null | |
}, P.portfolioData = {}, P.validateChoice = g, P.setValue = h, P.setType = y, P.doScroll = I, P.getValueAsMoney = D, P.back = w, P.showInput = V, P.checkValue = A, P.asMoney = _, P.acceptTerm = R, P.setSchedule = T, P.getMonthlyInvestment = b, d() | |
} | |
angular.module("warren.pages.deposits", []).controller("warrenDepositsController", o).directive("warrenDeposits", e), e.$inject = [], o.$inject = ["$q", "$state", "$stateParams", "$scope", "$filter", "wrnAnalytics", "wrnUser", "wrnPortfolio", "wrnSmoothScroll", "wrnTransaction", "wrnFlash", "wrnResources", "config"] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/fundsdata/fundsdata.template.html", | |
controller: t, | |
controllerAs: "c_fundsdata" | |
} | |
} | |
function t(n, t, a, r, e, o) { | |
function u() { | |
try { | |
r.pageView("fundsData") | |
} catch (n) {} | |
a.all([e.getFundPerformance({ | |
allFunds: !0 | |
})]).then(function(n) { | |
i.fundsInfo = n[0], i.isLoading = !1 | |
}) | |
} | |
function c(n) { | |
d = d === n ? null : n | |
} | |
function s(n) { | |
return d === n | |
} | |
function l(n) { | |
return o(n).format("DD/MM/YYYY") | |
} | |
var i = this, | |
d = null; | |
i.isLoading = !0, i.fundsInfo = null, i.setAccordion = c, i.isAccordion = s, i.formatDate = l, u() | |
} | |
angular.module("warren.pages.fundsdata", []).controller("warrenFundsDataController", t).directive("warrenFundsData", n), n.$inject = [], t.$inject = ["$scope", "$stateParams", "$q", "wrnAnalytics", "wrnTransaction", "moment"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/history/history.template.html", | |
controller: o, | |
controllerAs: "c_history" | |
} | |
} | |
function o(t, o) { | |
function r() { | |
try { | |
t.pageView("history") | |
} catch (t) {} | |
o.getAll().then(function(t) { | |
i.transactions = t | |
}, function(t) { | |
console.error(t) | |
}) | |
} | |
function n(t) { | |
var o = ""; | |
return o = "deposit" === t.type ? "Depósito" : "withdraw" === t.type ? "Retirada" : "Entre objetivos", t.isPending && (o += " (pendente)"), o | |
} | |
function e(t) { | |
var o, r; | |
return "deposit" === t.type ? (o = t.fromAccount.number + "-" + t.fromAccount.digit, r = t.toPortfolio.name) : "withdraw" === t.type ? (o = t.fromPortfolio.name, r = t.toAccount.number + "-" + t.toAccount.digit) : (o = t.fromPortfolio.name, r = t.toPortfolio.name), o + " → " + r | |
} | |
var i = this; | |
i.transactions = null, i.formatType = n, i.formatMovement = e, r() | |
} | |
angular.module("warren.pages.history", []).controller("warrenHistoryController", o).directive("warrenHistory", t), t.$inject = [], o.$inject = ["wrnAnalytics", "wrnTransaction"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/home/home.template.html", | |
controller: t, | |
controllerAs: "c_home" | |
} | |
} | |
function t(e, t, r, o, n, l) { | |
return void r.go("dash") | |
} | |
angular.module("warren.pages.home", []).controller("warrenHomeController", t).directive("warrenHome", e), e.$inject = [], t.$inject = ["$window", "$stateParams", "$state", "wrnSmoothScroll", "wrnAnalytics", "waitlist"] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/instantlogin/instantlogin.template.html", | |
controller: t, | |
controllerAs: "c_instantlogin" | |
} | |
} | |
function t(n, t, a, o, r, i) { | |
function e() { | |
try { | |
a.track(null, "Signin"), a.pageView("instantlogin") | |
} catch (n) {} | |
o.instantLogin(t.hash).then(function() { | |
s() | |
}, function(a) { | |
console.error(a), r.error(a.message), n.go("signin", { | |
backTo: t.backTo, | |
params: t.params | |
}) | |
}) | |
} | |
function s() { | |
if (t.backTo && "signin" !== t.backTo && "instantlogin" !== t.backTo) { | |
var a = JSON.parse(t.params || "{}"); | |
n.go(t.backTo, a) | |
} else n.go("dash") | |
} | |
e() | |
} | |
angular.module("warren.pages.instantlogin", []).controller("warrenInstantLoginController", t).directive("warrenInstantLogin", n), n.$inject = [], t.$inject = ["$state", "$stateParams", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/instantloginintranet/instantloginintranet.template.html", | |
controller: t, | |
controllerAs: "c_instantloginintranet" | |
} | |
} | |
function t(n, t, a, e, o, r, i) { | |
function s() { | |
try { | |
e.pageView("instantloginintranet") | |
} catch (n) {} | |
i.clean(), i.isEmpty("accounts.accessToken") || c(), o.instantLoginIntranet(a.hash).then(function() { | |
n.onbeforeunload = function() { | |
i.clean() | |
}, c() | |
}, function(n) { | |
console.error(n), r.error(n.message), t.go("signin", { | |
backTo: a.backTo, | |
params: a.params | |
}) | |
}) | |
} | |
function c() { | |
if (a.backTo && "signin" !== a.backTo && "instantlogin" !== a.backTo) { | |
var n = JSON.parse(a.params || "{}"); | |
t.go(a.backTo, n) | |
} else t.go("dash") | |
} | |
s() | |
} | |
angular.module("warren.pages.instantloginintranet", []).controller("warrenInstantLoginIntranetController", t).directive("warrenInstantLoginIntranet", n), n.$inject = [], t.$inject = ["$window", "$state", "$stateParams", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
return { | |
templateUrl: "app/pages/invoice/invoice.template.html", | |
controller: o, | |
controllerAs: "c_invoice" | |
} | |
} | |
function o(n, o, i, e, t, r, c, l, a) { | |
function u() { | |
try { | |
t.pageView("invoice") | |
} catch (n) {} | |
return o.id ? void r.getInvoiceById(o.id).then(function(n) { | |
p.invoice = n, c.getById(n.toPortfolio).then(function(n) { | |
p.loading = !1, p.portfolio = n | |
}, function(n) { | |
console.error(n) | |
}) | |
}, function(n) { | |
console.error(n) | |
}) : void n.go("404") | |
} | |
function d() { | |
return l.isSupported() | |
} | |
function s() { | |
var n = p.invoice.barCodeString || ""; | |
n = n.replace(/\./g, "").replace(/\s/g, ""), l.copy(n), a.info("Números copiados!", { | |
raw: !0 | |
}) | |
} | |
function f() { | |
p.sendingEmail = !0, r.sendInvoiceByEmail(p.invoice._id).then(function() { | |
p.sendingEmail = !1 | |
}) | |
} | |
function v() { | |
return e("money")(p.invoice.amount, "R$ ", 0) | |
} | |
var p = this; | |
p.loading = !0, p.sendingEmail = null, p.invoice = null, p.portfolio = null, p.doCopy = s, p.doEmail = f, p.canShowCopy = d, p.getFormattedAmount = v, u() | |
} | |
angular.module("warren.pages.invoice", []).controller("warrenInvoiceController", o).directive("warrenInvoice", n), n.$inject = [], o.$inject = ["$state", "$stateParams", "$document", "$filter", "wrnAnalytics", "wrnTransaction", "wrnPortfolio", "wrnClipboard", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/line/line.template.html", | |
controller: n, | |
controllerAs: "c_line" | |
} | |
} | |
function n(e, n, r, i, t, a, l) { | |
function c() { | |
try { | |
n.pageView("line") | |
} catch (e) {} | |
} | |
function o() { | |
s.processingReserve = !0; | |
var n = s.data.name, | |
r = s.data.email; | |
l.config(n, r), l.position().then(function(n) { | |
s.processingReserve = !1, e.go("lineplace") | |
}, function(e) { | |
s.processingReserve = !1, i.error(e, { | |
raw: !0 | |
}) | |
}) | |
} | |
var s = this; | |
s.processingReserve = !1, s.data = { | |
name: null, | |
email: null | |
}, s.checkPlace = o, c() | |
} | |
angular.module("warren.pages.line", []).controller("warrenLineController", n).directive("warrenLine", e), e.$inject = [], n.$inject = ["$state", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession", "waitlist"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/loseometer/loseometer.template.html", | |
controller: t, | |
controllerAs: "c_loseometer" | |
} | |
} | |
function t(e, t, r, o, n, l) { | |
function s() { | |
try { | |
t.pageView("loseometer") | |
} catch (e) {} | |
} | |
function a() { | |
c.inputVisible = !0 | |
} | |
function i() { | |
c.data.salary < 1e3 || (c.inputVisible = !1, e.go("loseometer-result", { | |
salary: c.data.salary | |
})) | |
} | |
var c = this; | |
c.inputVisible = !1, c.data = { | |
salary: null | |
}, c.showResult = i, c.showInput = a, s() | |
} | |
angular.module("warren.pages.loseometer", []).controller("warrenLoseometerController", t).directive("warrenLoseometer", e), e.$inject = [], t.$inject = ["$state", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function o() { | |
return { | |
templateUrl: "app/pages/portfolio/portfolio.template.html", | |
controller: t, | |
controllerAs: "c_portfolio" | |
} | |
} | |
function t(o, t, e, n, r, i, a, s, c, l, u, f, d, p, g, m, h) { | |
function v() { | |
return n.id ? (mo.id = n.id, n.action && ("goal" === n.action ? po = 0 : "allocation" === n.action ? po = 2 : "history" === n.action && (po = 3)), void t.all([D(n.id), P({ | |
portfolio: n.id | |
}), V(), A(), F(n.id), S()]).then(E).then(function() { | |
if (!_() && (mo.loading = !1, J(), x(), R(), N(), B(), Y(), O(), mo.hasBackground = !!mo.portfolio.background.full, mo.pendingCount = mo._pendingTransactions.length, mo.invites = [], mo.portfolio.isShared)) try { | |
mo.portfolio.isAdmin = mo.portfolio.group.admins.indexOf(mo.portfolio._id) >= 0; | |
for (var o = 0; o < mo.portfolio.group.invites.length; o++) { | |
var t = mo.portfolio.group.invites[o]; | |
"pending" === t.status && mo.invites.push(t) | |
} | |
} catch (o) {} | |
})) : void e.go("404") | |
} | |
function _() { | |
var o = mo.portfolio.canCreateNewTransaction; | |
if ("true" === n.invoice) { | |
for (var t = mo.transactions.pendingInvoices, e = 0; e < t.length; e++) | |
if (t[e].amount === mo.portfolio.monthlyInvestment) return w("invoice", t[e]._id), !0; | |
if (o) return b("invoice"), !0; | |
h.search("invoice", null) | |
} else if ("true" === n.deposit) { | |
for (var r = mo.transactions.pendingDeposits, e = 0; e < r.length; e++) | |
if (r[e].amount === mo.portfolio.monthlyInvestment) return w("deposit", r[e]._id), !0; | |
if (o) return b("deposit"), !0; | |
h.search("deposit", null) | |
} | |
return !1 | |
} | |
function w(o, t) { | |
e.go(o, { | |
id: t | |
}) | |
} | |
function b(o) { | |
var t = { | |
amount: mo.portfolio.monthlyInvestment, | |
toPortfolio: mo.portfolio._id | |
}; | |
"deposit" === o ? l.createDeposit(t).then(function(t) { | |
try { | |
a.pixelFB("Deposit Created"), a.track(mo.user, "Deposit Created", { | |
type: "TED/DOC", | |
amount: t.amount | |
}) | |
} catch (o) {} | |
w(o, t._id) | |
}, co) : "invoice" === o && l.createInvoice(t).then(function(t) { | |
try { | |
a.pixelFB("Deposit Created"), a.track(mo.user, "Deposit Created", { | |
type: "Invoice", | |
amount: t.amount | |
}) | |
} catch (o) {} | |
w(o, t._id) | |
}, co) | |
} | |
function T() { | |
n.action && f.to("id_tabs") | |
} | |
function y() { | |
return ["Conservador", "Conservador-moderado", "Moderado", "Moderado-arrojado", "Arrojado"][mo.portfolio.fund - 1] | |
} | |
function k(o, t) { | |
return "free" === mo.portfolio.goal || (o ? 1 === K(o) || o.isOnTrack : t && mo.portfolio.isShared ? mo.portfolio.group.isOnTrack : mo.portfolio.isOnTrack) | |
} | |
function S() { | |
return t(function(o, t) { | |
u.mine().then(function(t) { | |
var e = !1; | |
try { | |
for (var n = 0; n < t.ranking.length; n++) t.ranking[n].hasAcceptedInvite && (e = !0) | |
} catch (o) {} | |
mo.hasAcceptedInvite = e, o(t) | |
}, t) | |
}) | |
} | |
function D(o) { | |
return t(function(t, e) { | |
s.getPerformanceById(o).then(function(o) { | |
mo.portfolio = o.portfolio, mo.performance = o.performance, mo.portfolio.goalAmount && (mo.portfolio.goalPercentage = Math.min(1, mo.portfolio.totalBalance / mo.portfolio.goalAmount)), t() | |
}, e) | |
}) | |
} | |
function P(o) { | |
return mo.isLoadingChart = !0, t(function(t, e) { | |
s.getChart(o).then(function(o) { | |
mo.chart = o, mo.isLoadingChart = !1, mo.availableLengths || (mo.availableLengths = o.availableLengths), t() | |
}, e) | |
}) | |
} | |
function M() { | |
mo.hideGrossValue = !mo.hideGrossValue | |
} | |
function I() { | |
return t(function(o, t) { | |
l.getFundPerformance({ | |
fundId: mo.portfolio.fund | |
}).then(function(t) { | |
mo.fundPerformance = t, o() | |
}, t) | |
}) | |
} | |
function V() { | |
return t(function(o, t) { | |
s.getFunds().then(function(t) { | |
mo.funds = t, o() | |
}, t) | |
}) | |
} | |
function E() { | |
mo.fund = U(mo.portfolio.fund) | |
} | |
function A() { | |
return t(function(o, t) { | |
c.become().then(function(t) { | |
mo.user = t, o() | |
}, t) | |
}) | |
} | |
function F(o) { | |
return t(function(t, e) { | |
l.getAllByPortoflio(o).then(function(o) { | |
mo.transactions = o, t() | |
}, e) | |
}) | |
} | |
function C(o) { | |
return t(function(t, e) { | |
s.visitPortfolio(mo.portfolio._id).then(function(e) { | |
mo.user = e.customer, o(null, mo.user.dash), t() | |
}, e) | |
}) | |
} | |
function x() { | |
var o = mo.performance.productAllocations.slice(); | |
o.sort(function(o, t) { | |
return t.allocValue - o.allocValue | |
}), mo._fundAllocationTable = o; | |
for (var t = 0, e = 0, n = 0, r = 0, i = 0; i < o.length; i++) { | |
var a = o[i]; | |
"Renda Fixa" === a.product.type ? (t += a.totalEarnings, e += a.totalEarningsPercentage) : (n += a.totalEarnings, r += a.totalEarningsPercentage) | |
} | |
mo._allocationTable = o, mo._allocationTable.fixedIncomeEarnings = t, mo._allocationTable.fixedIncomeEarningsPercentage = e, mo._allocationTable.stocksEarnings = n, mo._allocationTable.stocksEarningsPercentage = r | |
} | |
function R() { | |
mo._pendingTransactions = [], mo._completedTransactions = []; | |
var o, t; | |
for (o = 0; o < mo.transactions.pendingDeposits.length; o++) t = mo.transactions.pendingDeposits[o], t.type = "deposit", t.typeName = "💰 Depósito", mo._pendingTransactions.push(t); | |
for (o = 0; o < mo.transactions.pendingInvoices.length; o++) t = mo.transactions.pendingInvoices[o], t.type = "invoice", t.typeName = "💰 Depósito", mo._pendingTransactions.push(t); | |
for (o = 0; o < mo.transactions.pendingWithdraws.length; o++) t = mo.transactions.pendingWithdraws[o], t.type = "withdraw", t.typeName = "💸 Resgate", mo._pendingTransactions.push(t); | |
for (mo._pendingTransactions.sort(function(o, t) { | |
var e = new Date(o.createdAt), | |
n = new Date(t.createdAt); | |
return e < n ? 1 : e > n ? -1 : 0 | |
}), mo._completedTransactions = mo.transactions.transactions, o = 0; o < mo._completedTransactions.length; o++) t = mo._completedTransactions[o], "withdraw" === t.type ? t.typeName = "💸 Resgate" : t.typeName = "💰 Depósito" | |
} | |
function N() { | |
var o = "app/pages/portfolio/messages/", | |
t = "showValues"; | |
t = function() { | |
switch (mo.user.dash) { | |
case "checkEmailForSetupNotification": | |
case "checkEmailForVerifyPasswordNotification": | |
return "checkEmail"; | |
case "requestVerifyEmail": | |
return "checkEmail"; | |
case "visitPortfolio": | |
return "visitPortfolio"; | |
case "startRegister": | |
return "startRegister"; | |
case "finishRegister": | |
return "finishRegister"; | |
case "registerWaitingVerification": | |
return "waitingVerification"; | |
case "registerDeniedVerification": | |
case "registerDeniedAndWaitingNewVerification": | |
return "registerDenied"; | |
default: | |
if (mo.portfolio.isShared) { | |
if (mo.portfolio.group && mo.portfolio.group.members && 1 == mo.portfolio.group.members.length && 0 == mo.portfolio.group.invites.length) return "invites"; | |
if (mo.portfolio.isVirtual) return "groupVirtual" | |
} | |
return mo.performance.totalEarnings || mo._pendingTransactions.length || "standard" === mo.user.dash ? mo._pendingTransactions.length && 0 === mo.portfolio.totalBalance ? "showPayAndWait" : "showValues" : "showDeposit" | |
} | |
}(), mo._heroState = o + t + ".template.html" | |
} | |
function B() { | |
!mo.performance.chart || mo.performance.chart.data.portfolio.length ? mo._goalGraphState = "show_placeholder" : mo._goalGraphState = "show_graph" | |
} | |
function Y() { | |
mo._pendingTransactions.length || mo._completedTransactions.length ? mo._historyState = "show_table" : mo._historyState = "show_placeholder" | |
} | |
function O() { | |
var o = null; | |
if (mo.portfolio.isVirtual || (o = d(mo.portfolio.lastUpdatedAt)), o) { | |
var t = ""; | |
o.date() !== d().date() && (t += o.date() === d().subtract(1, "days").date() ? "ontem " : "no dia " + o.format("DD/MM") + " "), t += "Ã s " + o.format("HH:mm"), mo.updateMessage = m.getString("portfolio_update_time_updateat", t) | |
} else mo.updateMessage = m.getString("portfolio_update_time_noupdate") | |
} | |
function L(o) { | |
po = o, f.to("id_tabs", 300) | |
} | |
function $(o) { | |
return po === o | |
} | |
function j() { | |
mo.seeFundPerformance = !mo.seeFundPerformance | |
} | |
function G(o, t) { | |
return 2 == t ? d(o).format("DD/MM/YYYY") : d(o).format("MMM YY") | |
} | |
function q() { | |
return mo.seeFundPerformance | |
} | |
function W(o) { | |
return go === o | |
} | |
function z(o) { | |
go = go === o ? null : o | |
} | |
function H(o) { | |
"undefined" == typeof o && (o = !mo.showEdit), mo.showEdit = o, i.setScrollBody(o) | |
} | |
function U(o) { | |
for (var t = 0; t < mo.funds.length; t++) | |
if (mo.funds[t].apiId === o) return mo.funds[t] | |
} | |
function J() { | |
var o = new Date(mo.portfolio.createdAt), | |
t = U(mo.fund.apiId), | |
e = t.avgMonthlyInterestRate, | |
n = new Date(o.getFullYear() + mo.portfolio.goalDuration, o.getMonth(), o.getDate()), | |
r = 12 * (n.getFullYear() - (new Date).getFullYear()); | |
n.getMonth() > o.getMonth() ? r += n.getMonth() - o.getMonth() : n.getMonth() < o.getMonth() && (r -= o.getMonth() - n.getMonth()), mo.portfolio.futureValue = warren.finance.futureValue(mo.portfolio.totalBalance, r, e, mo.portfolio.monthlyInvestment) | |
} | |
function K(o) { | |
if (o && o.isVirtual) return 0; | |
if (!o && mo.portfolio.isVirtual) return 0; | |
try { | |
var t = o.totalBalance / mo.portfolio.group.totalBalance; | |
return t > 1 ? 1 : t | |
} catch (o) { | |
return 0 | |
} | |
} | |
function Q() { | |
var o = m.getValue("portfolios_group_limit"); | |
try { | |
if (mo.invites.length + mo.portfolio.group.members.length >= o) return void g.error("error_portfolio_group_is_full") | |
} catch (o) {} | |
p.groupInvite("Adicionar participante", "", { | |
textCancel: "Cancelar", | |
textOk: "Convidar", | |
goalName: mo.portfolio.name | |
}).then(function(o) { | |
"ok" === o.response && (mo.portfolio.isShared ? Z(o.value) : X([o.value])) | |
}) | |
} | |
function X(o) { | |
s.share({ | |
portfolioId: mo.portfolio._id, | |
invites: o | |
}).then(function(o) { | |
e.reload(), g.success("Seu objetivo foi compartilhado!", { | |
raw: !0 | |
}) | |
}, co) | |
} | |
function Z(o) { | |
s.invite({ | |
portfolioId: mo.portfolio._id, | |
invite: o | |
}).then(function(t) { | |
mo.invites && (mo.invites = mo.invites.concat(t.invites)), g.success("Convite enviado para " + o.email, { | |
raw: !0 | |
}) | |
}, co) | |
} | |
function oo(o) { | |
Z(o) | |
} | |
function to(o) { | |
p.confirm("Remover participante", "Você tem certeza que deseja remover este participante?", { | |
textOk: "Remover" | |
}).then(function(t) { | |
"ok" === t && s.cancelInvite(o._id).then(function(t) { | |
for (var e = mo.invites, n = 0; n < e.length; n++) | |
if (e[n]._id === o._id) { | |
e.splice(n, 1); | |
break | |
} | |
g.success(o.email + " foi removido!", { | |
raw: !0 | |
}) | |
}, function(o) { | |
g.error(o.message) | |
}) | |
}) | |
} | |
function eo(o) { | |
p.confirm("Remover participante", "Você tem certeza que deseja remover este participante?", { | |
textOk: "Remover" | |
}).then(function(t) { | |
"ok" === t && s.removeMember(mo.portfolio.group._id, o._id).then(function(t) { | |
var e = mo.portfolio.group.members; | |
e.splice(e.indexOf(o), 1), g.success(o.customer.name + " foi removido!", { | |
raw: !0 | |
}) | |
}, co) | |
}) | |
} | |
function no() { | |
p.confirm("Deixar o grupo", "Você tem certeza que deseja sair deste grupo?", { | |
textOk: "Sair" | |
}).then(function(o) { | |
"ok" === o && s.removeMember(mo.portfolio.group._id, mo.portfolio._id).then(function(o) { | |
mo.portfolio.isShared = !1, mo.portfolio.group = null, g.success("Você saiu do grupo!", { | |
raw: !0 | |
}), f.toPosition(0) | |
}, co) | |
}) | |
} | |
function ro(o) { | |
p.confirm("Lembrar participante", "Confirma o envio do lembrete de depósito para " + o.customer.name + "?", { | |
textOk: "Enviar" | |
}).then(function(t) { | |
"ok" === t && s.reminderMember(mo.portfolio.group._id, { | |
portfolioId: o._id | |
}).then(function(o) { | |
g.success("Lembrete enviado!", { | |
raw: !0 | |
}) | |
}, co) | |
}) | |
} | |
function io(o) { | |
o && s.setAdmin(mo.portfolio.group._id, { | |
portfolioId: o._id | |
}).then(function(t) { | |
mo.portfolio.group.admins = t.admins, g.success(o.customer.name + " foi atualizado!", { | |
raw: !0 | |
}) | |
}, co) | |
} | |
function ao() { | |
return mo.fund.stocksShare <= .06 ? m.getString("portfolio_chart_mm1_explanation") : mo.fund.stocksShare <= .12 ? m.getString("portfolio_chart_mm2_explanation") : mo.fund.stocksShare <= .2 ? m.getString("portfolio_chart_mm3_explanation") : mo.fund.stocksShare > .2 ? m.getString("portfolio_chart_mm4_explanation") : void 0 | |
} | |
function so(o) { | |
var t = mo.portfolio.group.members, | |
e = mo.invites; | |
o._id == mo.portfolio._id ? mo.portfolio.seeTransactions = !mo.portfolio.seeTransactions : mo.portfolio.seeTransactions = !1; | |
for (var n = 0; n < t.length; n++) t[n]._id == o._id ? t[n].seeTransactions = !t[n].seeTransactions : t[n].seeTransactions = !1; | |
for (var n = 0; n < e.length; n++) e[n]._id == o._id ? e[n].seeTransactions = !e[n].seeTransactions : e[n].seeTransactions = !1 | |
} | |
function co(o) { | |
o && o.message && g.error(o.message) | |
} | |
function lo() { | |
r.accordionTabFund = !r.accordionTabFund, mo.fundPerformance || I() | |
} | |
function uo(o) { | |
P({ | |
portfolio: mo.id, | |
length: o | |
}) | |
} | |
function fo(o) { | |
if (mo.portfolio.background) try { | |
var t = document.getElementById(o ? "portfolio-background-mobile" : "portfolio-background"), | |
e = o ? mo.portfolio.background.regular : mo.portfolio.background.full; | |
t && (t.style.backgroundImage = "url('" + e + "')") | |
} catch (o) { | |
console.log(o) | |
} | |
} | |
var po = 0, | |
go = null, | |
mo = this; | |
mo.id = null, mo.loading = !0, mo.portfolio = null, mo.funds = null, mo.fund = null, mo.transactions = null, mo.performance = null, mo.fundPerformance = null, mo.seeFundPerformance = !1, mo.updateMessage = null, mo.chart = null, mo.isLoadingChart = !0, mo.availableLengths = null, mo.pendingCount = 0, mo._heroState = null, mo._goalGraphState = null, mo._historyState = null, mo._allocationTable = null, mo._pendingTransactions = [], mo._completedTransactions = [], mo.setTab = L, mo.isTab = $, mo.formatDate = G, mo.toggleEditPanel = H, mo.endWizard = T, mo.isSelected = W, mo.toggleTransaction = z, mo.getRiskName = y, mo.withinGoal = k, mo.computeFutureValue = J, mo.findFundByApiId = U, mo.swapNetGrossValue = M, mo.updateChart = uo, mo.openFundPerformance = j, mo.getSeeFundPerformance = q, mo.addMember = Q, mo.removeMember = eo, mo.setAdmin = io, mo.memberPercentage = K, mo.leaveGroup = no, mo.resendInvite = oo, mo.cancelInvite = to, mo.reminderMember = ro, mo.seeMemberTransactions = so, mo.openHistoryAccordion = lo, mo.getNegativeEarningsResource = ao, mo.loadBackground = fo, v(), mo.reload = function() { | |
v(), mo._pendingTransactions.length || o(function() { | |
f.toPosition(0) | |
}, 1500) | |
}, r.startRegister = function() { | |
"visitPortfolio" !== mo.user.dash && "checkEmailForSetupNotification" !== mo.user.dash && "checkEmailForVerifyPasswordNotification" !== mo.user.dash && "requestVerifyEmail" !== mo.user.dash ? (mo.user.dash = "startRegister", N()) : C(function(o, t) { | |
mo.user.dash = t, N() | |
}) | |
}, r.formatScheduletAt = function(o) { | |
return o ? d.utc(o).format("DD/MM/YYYY") : "" | |
} | |
} | |
t.$inject = ["$timeout", "$q", "$state", "$stateParams", "$scope", "$rootScope", "wrnAnalytics", "wrnPortfolio", "wrnUser", "wrnTransaction", "wrnInvites", "wrnSmoothScroll", "moment", "wrnDialog", "wrnFlash", "wrnResources", "$location"], angular.module("warren.pages.portfolio", []).controller("warrenPortfolioController", t).directive("warrenPortfolio", o), o.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function o() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/portfoliogroup/portfoliogroupaccept.template.html", | |
controller: t, | |
controllerAs: "c_portfoliogroupaccept" | |
} | |
} | |
function t(o, t, r, n, i) { | |
function e() { | |
r.instantLogin(t.token).then(function(o) { | |
c(o) | |
}, function(t) { | |
i.error(t.message), o.go("signin") | |
}) | |
} | |
function c(r) { | |
n.acceptInvite(t.id).then(function(t) { | |
r.isSuitabilityFinished ? o.go("portfolio", { | |
id: t.portfolio._id | |
}) : o.go("suitability") | |
}, function(t) { | |
i.error(t.message), o.go("signin") | |
}) | |
} | |
e() | |
} | |
t.$inject = ["$state", "$stateParams", "wrnUser", "wrnPortfolio", "wrnFlash"], angular.module("warren.pages.portfoliogroupaccept", []).controller("warrenPortfolioGroupAcceptController", t).directive("warrenPortfolioGroupAccept", o), o.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
templateUrl: "app/pages/post/post.template.html", | |
controller: e, | |
controllerAs: "c_post" | |
} | |
} | |
function e(t, e, o, a, n, s, i, r) { | |
function p() { | |
l.loading = !0, l.backTo = n.backTo || "dash"; | |
var a; | |
switch (r.environment.name) { | |
case "local": | |
a = "local.oiwarren.com:5000/app/#/post/"; | |
break; | |
case "development": | |
a = "https://develop.oiwarren.com/app/#/post/"; | |
break; | |
case "staging": | |
a = "https://staging.oiwarren.com/app/#/post/"; | |
break; | |
case "production": | |
a = "https://oiwarren.com/app/#/post/"; | |
break; | |
default: | |
a = "https://oiwarren.com/app/#/post/" | |
} | |
var s, p = (new Date).getTime(), | |
c = !t.isEmpty("accounts.accessToken"); | |
s = c ? [e.getMine(), e.getById(n.id)] : [e.getById(n.id)], o.all(s).then(function(t) { | |
var n = (new Date).getTime(); | |
if (c ? (l.posts = t[0], l.post = t[1], e.track(l.post.id, { | |
read: !0 | |
})) : (l.post = t[0], e.publicRead(l.post.id)), "production" === r.environment.name) var s = { | |
twitter: a + l.post.id + "?utm_medium=referral&utm_source=twitter&utm_campaign=" + l.post.dashboardTitle + "&utm_content=link", | |
facebook: a + l.post.id + "?utm_medium=referral&utm_source=facebook&utm_campaign=" + l.post.dashboardTitle + "&utm_content=link", | |
whatsapp: a + l.post.id + "?utm_medium=referral&utm_source=whatsapp&utm_campaign=" + l.post.dashboardTitle + "&utm_content=link", | |
messenger: a + l.post.id + "?utm_medium=referral&utm_source=messenger&utm_campaign=" + l.post.dashboardTitle + "&utm_content=link", | |
email: a + l.post.id + "?utm_medium=referral&utm_source=email&utm_campaign=" + l.post.dashboardTitle + "&utm_content=link" | |
}; | |
else var s = { | |
twitter: a + l.post.id, | |
facebook: a + l.post.id, | |
whatsapp: a + l.post.id, | |
messenger: a + l.post.id, | |
email: a + l.post.id | |
}; | |
o.all([e.getShortenedURL(s.twitter), e.getShortenedURL(s.facebook), e.getShortenedURL(s.whatsapp), e.getShortenedURL(s.messenger), e.getShortenedURL(s.email)]).then(function(t) { | |
m(t), i(function() { | |
l.loading = !1 | |
}, Math.max(1e3 - n + p, 0)) | |
}, function(t) { | |
i(function() { | |
l.loading = !1 | |
}, Math.max(1e3 - n + p, 0)) | |
}) | |
}) | |
} | |
function c(t, o) { | |
if (!o) | |
for (var a = 0; a < l.posts.length; a++) | |
if (l.posts[a].id === t) { | |
l.posts.splice(a, 1); | |
break | |
} | |
e.track(l.post.id, { | |
interact: !0 | |
}).then(function(t) { | |
o && s.go("dash") | |
}) | |
} | |
function d() { | |
e.track(l.post.id, { | |
interact: !0 | |
}).then(function(t) { | |
s.go("post", { | |
id: l.posts[1].id | |
}) | |
}) | |
} | |
function m(t) { | |
var e, o; | |
e = encodeURIComponent("Warren News: " + l.post.dashboardTitle + " " + l.post.dashboardSubtitle), o = "oiwarren"; | |
var n = "https://twitter.com/intent/tweet?text=" + e + "&url=" + t[0].id + "&hashtags=" + o, | |
s = "https://www.facebook.com/dialog/feed?app_id=1636715299924634&link=" + t[1].id + "&picture=https://oiwarren.com/assets/imgs/icons/ic_warren-news_facebook_1200x630.png&name=Warren News: " + l.post.dashboardTitle + "&caption=Invista bem com o Warren!&description=" + l.post.dashboardSubtitle, | |
i = "whatsapp://send?text=*Warren News*: " + l.post.dashboardTitle + " " + l.post.dashboardSubtitle + " " + t[2].id, | |
r = "https://www.facebook.com/dialog/send?app_id=1636715299924634&link=" + t[3].id + "&redirect_uri=" + t[3].id, | |
p = encodeURIComponent("Olhe esta notÃcia no Warren"), | |
c = encodeURIComponent("Olhe esta notÃcia: ") + t[4].id, | |
d = "mailto:?&subject=" + p + "&body=" + c; | |
a.shortenedShareLinks = { | |
twitter: n, | |
facebook: s, | |
whatsapp: i, | |
messenger: r, | |
email: d | |
} | |
} | |
var l = this; | |
l.interactPost = c, l.nextPost = d, p() | |
} | |
angular.module("warren.pages.post", []).controller("warrenPostController", e).directive("warrenPost", t), t.$inject = [], e.$inject = ["wrnSession", "wrnPost", "$q", "$scope", "$stateParams", "$state", "$timeout", "config"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/profile/profile.redirect.html", | |
controller: t, | |
controllerAs: "c_profile" | |
} | |
} | |
function t(e, t, i, n, r, o, s, l, a, c, u) { | |
function f() { | |
d(); | |
var t = e.profile; | |
b = t; | |
try { | |
n.pageView("profile/" + t) | |
} catch (e) {} | |
y.title = "profile_" + t + "_title", y.subtitle = "profile_" + t + "_subtitle", y.description = "profile_" + t + "_description_tw", y.description2 = "profile_" + t + "_description2_tw", y.title || i.go("404"), w() | |
} | |
function p() { | |
y.isStarted = !0 | |
} | |
function h() { | |
o.toPosition(1e5, 0) | |
} | |
function w() { | |
return y.suitability = !!e.suitability, y.suitability | |
} | |
function d() { | |
c.isEmpty("accounts.accessToken") || u.all([a.getCurrent()]).then(function(e) { | |
y.user = e[0], y.hasTutorial = !y.user.isPortfolioFinished | |
}, function(e) { | |
console.error(e) | |
}) | |
} | |
function g() { | |
y.showNextDescription = !y.suitability, y.suitability && m() | |
} | |
function m() { | |
t(function() { | |
y.showShareButtons = !y.suitability && !y.user.isPortfolioFinished, o.toPosition(1e4), t(function() { | |
y.showInputBar = !0 | |
}, 500) | |
}, 500) | |
} | |
function v() { | |
return "https://oiwarren.com/%23/profile/" + b | |
} | |
function _() { | |
y.processingReserve = !0, s.config(y.user.name, y.user.email), s.reserve().then(function(e) { | |
y.processingReserve = !1, i.go("lineplace"), s.affiliate() && (n.track(null, "Waitlist Inserted", { | |
name: name | |
}), n.event("invitee", "enteredTheLine", "profile", "1")) | |
}, function(e) { | |
404 == e ? s.position().then(function(e) { | |
y.processingReserve = !1, i.go("lineplace") | |
}, function(e) { | |
y.processingReserve = !1, l.error(e, { | |
raw: !0 | |
}) | |
}) : (y.processingReserve = !1, l.error(e, { | |
raw: !0 | |
})) | |
}) | |
} | |
var b = null, | |
y = this; | |
y.title = null, y.subtitle = null, y.description = null, y.isStarted = !1, y.shouldContinue = !1, y.start = p, y.finishChat = m, y.scroll = h, y.getProfileUrl = v, y.waitlistReservation = _, y.hasTutorial = r.has("tutorial") || !1, y.nextDescription = g, f() | |
} | |
angular.module("warren.pages.profile", []).controller("warrenProfileController", t).directive("warrenProfile", e), e.$inject = [], t.$inject = ["$stateParams", "$timeout", "$state", "wrnAnalytics", "wrnContext", "wrnSmoothScroll", "waitlist", "wrnFlash", "wrnUser", "wrnSession", "$q"] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
return { | |
templateUrl: "app/pages/quotes/quotes.template.html", | |
controller: t, | |
controllerAs: "c_quotes" | |
} | |
} | |
function t(n, t, e, o, r, u) { | |
function i() { | |
try { | |
o.pageView("quotes") | |
} catch (n) {} | |
return t.fundId ? (d.fundId = t.fundId, void e.all([a(), s()]).then(function(n) { | |
d.summary = n[0], d.positions = n[1], d.isLoading = !1 | |
})) : void $state.go("404") | |
} | |
function a() { | |
return r.getInvestmentSummary() | |
} | |
function s() { | |
return r.getPositions(d.fundId) | |
} | |
function c(n) { | |
return u(n).format("DD/MM/YYYY - HH:mm") | |
} | |
function l(n) { | |
f = f === n ? null : n | |
} | |
function m(n) { | |
return f === n | |
} | |
var d = this; | |
d.summary = null, d.isLoading = !0, d.formatDate = c, d.setAccordion = l, d.isAccordion = m; | |
var f = null; | |
i() | |
} | |
t.$inject = ["$scope", "$stateParams", "$q", "wrnAnalytics", "wrnTransaction", "moment"], angular.module("warren.pages.quotes", []).controller("warrenQuotesController", t).directive("warrenQuotes", n), n.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/register/register.template.html", | |
controller: t, | |
controllerAs: "c_register" | |
} | |
} | |
function t(e, t, n, r, c) { | |
function s() { | |
try { | |
t.pageView("register") | |
} catch (e) {} | |
e.become().then(function(t) { | |
l.user = t, t.document && (t.document.type = t.document.type || "rg"), t.bankAccounts.length ? t.bankAccounts[0].type = t.bankAccounts[0].type || "current" : e.addBankAccount().then(function(e) { | |
e.type = e.type || "current", t.bankAccounts.push(e) | |
}, function(e) { | |
console.error(e) | |
}) | |
}).catch(function(e) { | |
console.error(e) | |
}) | |
} | |
function a() { | |
var e = r.$$childTail; | |
e && e.c_step4 && e.c_step4.user && (e.c_step4.user.document.state || e.c_step4.updateState(e.c_step2.user.address.state)) | |
} | |
function i() { | |
var e = r.$$childTail; | |
switch (u) { | |
case 1: | |
e.c_step1.submit(); | |
break; | |
case 2: | |
e.c_step2.submit(); | |
break; | |
case 3: | |
e.c_step3.submit(), a(); | |
break; | |
case 4: | |
e.c_step4.submit() | |
} | |
} | |
var u = 1, | |
o = 1, | |
l = this; | |
l.user = null, l.setTab = function(e) { | |
u = e, o = Math.max(o, e) | |
}, l.getTab = function() { | |
return u | |
}, l.isTab = function(e) { | |
return u === e | |
}, l.isEnabled = function(e) { | |
return e <= o || l.user.isRegisterValidated | |
}, l.isSaving = !1, l.submit = i, s() | |
} | |
angular.module("warren.pages.register", []).controller("warrenRegisterController", t).directive("warrenRegister", e), e.$inject = [], t.$inject = ["wrnUser", "wrnAnalytics", "wrnMaps", "$scope", "$timeout"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/reset/reset.template.html", | |
controller: r, | |
controllerAs: "c_reset" | |
} | |
} | |
function r(e, r, t, n) { | |
function s() { | |
try { | |
r.pageView("reset") | |
} catch (e) {} | |
} | |
function o() { | |
a.processing = !0, t.reset(a.data.email).then(function() { | |
a.finished = !0 | |
}, function(e) { | |
console.error(e), a.processing = !1; | |
var r = ""; | |
if (e.errors) { | |
r += "\n"; | |
for (var t = 0; t < e.errors.length; t++) r += "-" + e.errors[t].msg + "\n" | |
} | |
n.error(e.message, r) | |
}) | |
} | |
var a = this; | |
a.doReset = o, a.finished = !1, a.processing = !1, a.data = { | |
email: null | |
}, s() | |
} | |
angular.module("warren.pages.reset", []).controller("warrenResetController", r).directive("warrenReset", e), e.$inject = [], r.$inject = ["$state", "wrnAnalytics", "wrnUser", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/resetpassword/resetpassword.template.html", | |
controller: s, | |
controllerAs: "c_resetpassword" | |
} | |
} | |
function s(e, s, r, n, t) { | |
function o() { | |
try { | |
r.pageView("resetpassword") | |
} catch (e) {} | |
a() | |
} | |
function a() { | |
var e = s.token; | |
l.loading = !0, n.resetCheck(e).then(function() { | |
l.loading = !1 | |
}, function(e) { | |
l.loading = !1, l.error = !0 | |
}) | |
} | |
function c() { | |
var r = s.token; | |
l.processing = !0, n.resetConfirm(r, l.data.password).then(function() { | |
l.processing = !1, l.finished = !0, t.success("Senha alterada com sucesso", { | |
raw: !0 | |
}), e.go("dash") | |
}, function(e) { | |
l.processing = !1, t.error(e.message) | |
}) | |
} | |
function i(e) { | |
document.getElementsByName("password")[0].focus() | |
} | |
var l = this; | |
l.doReset = c, l.focusPassword = i, l.loading = null, l.processing = null, l.error = null, l.finished = null, l.data = { | |
password: null | |
}, o() | |
} | |
angular.module("warren.pages.resetpassword", []).controller("warrenResetPasswordController", s).directive("warrenResetPassword", e), e.$inject = [], s.$inject = ["$state", "$stateParams", "wrnAnalytics", "wrnUser", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function r() { | |
return { | |
templateUrl: "app/pages/ricometro/ricometro.template.html", | |
controller: t, | |
controllerAs: "c_ricometro" | |
} | |
} | |
function t(r, t, i, e, n, o) { | |
function a() { | |
try { | |
t.pageView("ricometro") | |
} catch (r) {} | |
} | |
function l() { | |
u.inputVisible = !0 | |
} | |
function s() { | |
u.isWizardFinished = !0 | |
} | |
function c() { | |
u.data.salary < 1e3 || (u.inputVisible = !1, r.go("ricometro-result", { | |
salary: u.data.salary | |
})) | |
} | |
var u = this; | |
u.inputVisible = !1, u.data = { | |
salary: null | |
}, u.showResult = c, u.showInput = l, u.finishWizard = s, a() | |
} | |
angular.module("warren.pages.ricometro", []).controller("warrenRicometroController", t).directive("warrenRicometro", r), r.$inject = [], t.$inject = ["$state", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/setup/setup.template.html", | |
controller: n, | |
controllerAs: "c_setup" | |
} | |
} | |
function n(e, n, t, r, o) { | |
function s() { | |
try { | |
t.pageView("setup") | |
} catch (e) {} | |
a() | |
} | |
function a() { | |
var e = n.token; | |
u.loading = !0, r.setupCheck(e).then(function(e) { | |
u.userEmail = e.email, u.loading = !1 | |
}, function(e) { | |
u.loading = !1, u.error = !0 | |
}) | |
} | |
function l() { | |
var t = n.token; | |
u.processing = !0, r.setupConfirm(t, u.data.password).then(function() { | |
u.processing = !1, u.finished = !0, n.backTo ? e.go(n.backTo) : e.go("dash") | |
}, function(e) { | |
u.processing = !1, o.error(e.message) | |
}) | |
} | |
function i(e) { | |
document.getElementsByName("password")[0].focus() | |
} | |
var u = this; | |
u.doReset = l, u.focusPassword = i, u.loading = null, u.processing = null, u.error = null, u.finished = null, u.data = { | |
password: null | |
}, u.userEmail = null, s() | |
} | |
angular.module("warren.pages.setup", []).controller("warrenSetupController", n).directive("warrenSetup", e), e.$inject = [], n.$inject = ["$state", "$stateParams", "wrnAnalytics", "wrnUser", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function o(o, n, e, s, a, r, i, c) { | |
function t() { | |
try { | |
e.pageView("signin") | |
} catch (o) {} | |
i.isEmpty("accounts.accessToken") || g(); | |
var o = new Date, | |
n = o.getHours(); | |
n >= 6 && n < 12 ? d.greetings = "Bom dia :)" : n >= 12 && n < 18 ? d.greetings = "Boa tarde :)" : n >= 18 && n < 24 ? d.greetings = "Boa noite :)" : d.greetings = "Na madruga? Olá!" | |
} | |
function g() { | |
if (n.backTo && "signout" !== n.backTo && "signin" !== n.backTo && "instantlogin" !== n.backTo) { | |
var e = JSON.parse(n.params || "{}"); | |
o.go(n.backTo, e) | |
} else o.go("dash") | |
} | |
function u(o) { | |
document.getElementsByName("password")[0].focus() | |
} | |
function f() { | |
d.processingLogin = !0, s.login(d.data.email, d.data.password).then(function() { | |
g() | |
}, function(o) { | |
d.processingLogin = !1, console.error(o), a.error(o.message) | |
}) | |
} | |
function l() { | |
d.processingFacebook = !0, r.login().then(function(o) { | |
s.facebookLogin(o).then(function(o) { | |
g() | |
}, function(o) { | |
d.processingFacebook = !1, a.error(o.message) | |
}) | |
}, function() { | |
d.processingFacebook = !1, d.processing = !1, a.error("Erro ao logar pelo Facebook", { | |
raw: !0 | |
}) | |
}) | |
} | |
function p() { | |
return r.scriptLoaded() | |
} | |
var d = this; | |
d.greetings = "", d.processingLogin = !1, d.processingFacebook = !1, d.data = { | |
email: "", | |
password: "" | |
}, d.doLogin = f, d.doFacebookLogin = l, d.focusPassword = u, d.facebookLoginAllowed = p, t() | |
} | |
o.$inject = ["$state", "$stateParams", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnFacebook", "wrnSession", "wrnResources"], warren.angular.controller("warren.pages.signin", o) | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/signout/signout.template.html", | |
controller: t, | |
controllerAs: "c_signout" | |
} | |
} | |
function t(n, t, e, o, r, i) { | |
function s() { | |
try { | |
t.pageView("signout") | |
} catch (n) {} | |
c() | |
} | |
function c() { | |
e.logout().then(function() { | |
i.clean(), t.signout(), n.go("/") | |
}, function(e) { | |
i.clean(), t.signout(), e.message && o.error(e.message), n.go("/") | |
}) | |
} | |
s() | |
} | |
angular.module("warren.pages.signout", []).controller("warrenSignoutController", t).directive("warrenSignout", n), n.$inject = [], t.$inject = ["wrnPath", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/signup/signup.template.html", | |
controller: o, | |
controllerAs: "c_signup" | |
} | |
} | |
function o(n, o, e, r, s, i) { | |
function t() { | |
try { | |
o.pageView("signup") | |
} catch (n) {} | |
i.isEmpty("accounts.accessToken") || n.go("dash") | |
} | |
function c(n) { | |
document.getElementsByName("password")[0].focus() | |
} | |
function a() { | |
g.processingSignup = !0, e.signup(g.data.email, g.data.password).then(function() { | |
n.go("suitability") | |
}, function(n) { | |
g.processingSignup = !1; | |
var o = ""; | |
if (n.errors) { | |
o += "\n"; | |
for (var e = 0; e < n.errors.length; e++) o += "-" + n.errors[e].msg + "\n" | |
} | |
r.error(n.message, o) | |
}) | |
} | |
function u() { | |
g.processingFacebook = !0, s.login().then(function(o) { | |
e.facebookLogin(o).then(function(o) { | |
n.go("dash") | |
}, function(n) { | |
g.processingFacebook = !1, console.error(n), r.error(n.message) | |
}) | |
}, function() { | |
console.error("facebook error") | |
}) | |
} | |
var g = this; | |
g.processingSignup = !1, g.processingFacebook = !1, g.finished = !1, g.data = { | |
email: "", | |
password: "" | |
}, g.doSignup = a, g.doFacebookSignup = u, g.focusPassword = c, t() | |
} | |
angular.module("warren.pages.signup", []).controller("warrenSignupController", o).directive("warrenSignup", n), n.$inject = [], o.$inject = ["$state", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnFacebook", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/style/style.template.html", | |
controller: l, | |
controllerAs: "c_style" | |
} | |
} | |
function l(t) { | |
function l() { | |
try { | |
t.pageView("style") | |
} catch (t) {} | |
e.components = [{ | |
title: "Typography", | |
file: "typography.html" | |
}, { | |
title: "Headings", | |
file: "headings.html" | |
}, { | |
title: "Display Headings", | |
file: "display_headings.html" | |
}, { | |
title: "Paragraph", | |
file: "paragraph.html" | |
}, { | |
title: "Lists", | |
file: "lists.html" | |
}, { | |
title: "Grid", | |
file: "grid.html" | |
}, { | |
title: "Buttons", | |
file: "buttons.html" | |
}, { | |
title: "Hero", | |
file: "hero.html" | |
}, { | |
title: "Initials", | |
file: "initials.html" | |
}, { | |
title: "Chat", | |
file: "chat.html" | |
}, { | |
title: "Navbar", | |
file: "navbar.html" | |
}, { | |
title: "Navtab", | |
file: "navtab.html" | |
}, { | |
title: "Progressbar", | |
file: "progressbar.html" | |
}, { | |
title: "Blankslate", | |
file: "blankslate.html" | |
}, { | |
title: "Inputs", | |
file: "inputs.html" | |
}, { | |
title: "Forms", | |
file: "forms.html" | |
}] | |
} | |
var e = this; | |
e.fileBase = "app/pages/style/blocks/", e.components = null, l() | |
} | |
angular.module("warren.pages.style", []).controller("warrenStyleController", l).directive("warrenStyle", t), t.$inject = [], l.$inject = ["wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
templateUrl: "app/pages/suitability/suitability.template.html", | |
controller: i, | |
controllerAs: "c_suitability" | |
} | |
} | |
function i(t, i, a, e) { | |
function r() { | |
(t.home || t.context) && e.clean(); | |
var r = t.affiliate; | |
r && a.referral(r); | |
try { | |
i.pageView("suitability") | |
} catch (t) {} | |
} | |
function n() { | |
l.isReady = !0 | |
} | |
var l = this; | |
l.isReady = !1, l.start = n, r() | |
} | |
angular.module("warren.pages.suitability", []).controller("warrenSuitabilityController", i).directive("warrenSuitability", t), t.$inject = [], i.$inject = ["$stateParams", "wrnAnalytics", "waitlist", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/team/team.template.html", | |
controller: t, | |
controllerAs: "c_team" | |
} | |
} | |
function t(e, t, r, n, a, c) { | |
function l() { | |
try { | |
t.pageView("team") | |
} catch (e) {} | |
} | |
l() | |
} | |
angular.module("warren.pages.team", []).controller("warrenTeamController", t).directive("warrenTeam", e), e.$inject = [], t.$inject = ["$state", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession"] | |
}(); | |
! function() { | |
"use string"; | |
function n(n) { | |
function t() {} | |
function e() {} | |
n.$on("$destroy", e), n.blah = 145; | |
t() | |
} | |
n.$inject = ["$scope"], warren.angular.controller("warren.pages.test", n) | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t, n, i, o, s, a, r, c, u, d, l, p) { | |
function f() { | |
return s.pageView("transactions"), Y.portfolio = i.id, Y.question_choice = i.choice, Y.portfolio ? (Y.isLoading = !0, Y.answers = { | |
question_choice: Y.question_choice | |
}, void o.getCurrent().then(function(e) { | |
Y.user = e, r.message({ | |
id: Y.question_choice ? "question_choice" : "initial", | |
portfolio: Y.portfolio, | |
answers: Y.answers | |
}).then(function(e) { | |
m(e) | |
}, function(e) { | |
console.error(e) | |
}) | |
}, function(e) { | |
c.error(err.message), C() | |
})) : void t.go("404") | |
} | |
function m(e, t) { | |
if (t || Y.state && Y.state.id === e.id || Y.stateHistory.push(e), e.buttons.length) e.type = "buttons"; | |
else if (e.inputs.length) | |
if ("currency" === e.inputs[0].mask) e.type = "currency", Y.inputBuffer = e.inputs[0].defaultValue || 0; | |
else if ("date" === e.inputs[0].mask) { | |
e.type = "date"; | |
var n = l(e.inputs[0].defaultValue, "DDMMYYYY"); | |
Y.inputBuffer = n.format("DDMMYYYY") | |
} else "string" === e.inputs[0].type ? (e.type = "string", Y.inputBuffer = e.inputs[0].defaultValue || "") : "integer" === e.inputs[0].mask && (e.type = "integer", Y.inputBuffer = e.inputs[0].defaultValue || ""); | |
else "deposit_final" === e.id ? e.type = "deposit" : "invoice_final" === e.id ? e.type = "invoice" : (e.id = "withdraw_final") && (e.type = "withdraw"); | |
"deposit" === e.type ? y(e) : "invoice" === e.type ? h(e) : "withdraw" === e.type ? g(e) : (Y.state = e, Y.isChatting = !0, Y.messageIndex = 0, Y.isLoading = !1) | |
} | |
function g(e) { | |
r.createWithdraw(e.transaction).then(function(t) { | |
try { | |
s.pixelFB("Withdrawal Created"), s.track(Y.user, "Withdrawal Created", { | |
amount: t.amount, | |
isTotal: t.isTotal | |
}) | |
} catch (e) {} | |
Y.withdraw = t, Y.state = e, Y.isLoading = !1, Y.isChatting = !0, Y.messageIndex = 0, Y.forecast = e.transaction.forecast | |
}, function(e) { | |
console.error(e), C(), c.error(e.message) | |
}) | |
} | |
function y(e) { | |
r.createDeposit(e.transaction).then(function(t) { | |
try { | |
0 == Y.user.depositAcceptedCount ? s.pixelFB("First Deposit Created") : s.pixelFB("Deposit Created"), s.track(Y.user, "Deposit Created", { | |
type: "TED/DOC", | |
amount: t.amount | |
}) | |
} catch (e) {} | |
Y.deposit = t, Y.state = e, Y.isLoading = !1, Y.isChatting = !0, Y.messageIndex = 0, Y.deposit.paymentBankImg = warren.enums.BankImages[Y.deposit.paymentBankCode] || warren.enums.BankImages.other | |
}, function(e) { | |
console.error(e), C(), c.error(e.message) | |
}) | |
} | |
function h(e) { | |
r.createInvoice(e.transaction).then(function(t) { | |
try { | |
0 == Y.user.depositAcceptedCount ? s.pixelFB("First Deposit Created") : s.pixelFB("Deposit Created"), s.track(Y.user, "Deposit Created", { | |
type: "Invoice", | |
amount: t.amount | |
}) | |
} catch (e) {} | |
Y.invoice = t, Y.state = e, Y.isLoading = !1, Y.isChatting = !0, Y.messageIndex = 0 | |
}, function(e) { | |
console.error(e), C(), c.error(e.message) | |
}) | |
} | |
function w() { | |
Y.messageIndex += 1, Y.messageIndex >= Y.state.messages.length && (Y.isChatting = !1) | |
} | |
function B(e) { | |
"date" === Y.state.type ? e = l(e, "DDMMYYYY").format("DD/MM/YYYY") : "integer" === Y.state.type && (e = parseInt(e)), Y.answers[Y.state.id] = e, Y.isLoading = !0, r.message({ | |
portfolio: Y.portfolio, | |
id: Y.state.id, | |
answers: Y.answers | |
}).then(function(e) { | |
m(e) | |
}, function(e) { | |
console.error(e) | |
}) | |
} | |
function v(e, t) { | |
"float" === t && (e = parseFloat(e)), Y.inputBuffer = e | |
} | |
function I(e) { | |
return e.value.replace(/\\n/g, "<br>") | |
} | |
function k(e) { | |
for (var t = 0; t < Y.user.bankAccounts.length; t++) | |
if (Y.user.bankAccounts[t]._id === e) return Y.selectedBank = Y.user.bankAccounts[t], Y.selectedBank.name = warren.enums.Bank[Y.user.bankAccounts[t].bank], Y.selectedBank.img = warren.enums.BankImages[Y.user.bankAccounts[t].bank] || warren.enums.BankImages.other, Y.selectedBank | |
} | |
function C() { | |
return "deposit" === Y.state.type || "invoice" === Y.state.type || "withdraw" === Y.state.type ? void t.go("portfolio", { | |
id: Y.portfolio | |
}) : (Y.stateHistory.pop(), Y.stateHistory.length ? void m(Y.stateHistory[Y.stateHistory.length - 1], !0) : void t.go("portfolio", { | |
id: Y.portfolio | |
})) | |
} | |
function D() { | |
Y.sendingEmail = !0, Y.invoice ? r.sendInvoiceByEmail(Y.invoice._id).then(function() { | |
Y.sendingEmail = !1 | |
}) : Y.deposit && r.sendDepositByEmail(Y.deposit._id).then(function() { | |
Y.sendingEmail = !1 | |
}, function(e) { | |
c.error(e.message) | |
}) | |
} | |
function b() { | |
var e = Y.invoice.barCodeString || ""; | |
e = e.replace(/\./g, "").replace(/\s/g, ""), d.copy(e), c.info("Números copiados!", { | |
raw: !0 | |
}) | |
} | |
var Y = this; | |
Y.portfolio = null, Y.id = null, Y.user = null, Y.answers = null, Y.state = null, Y.stateHistory = [], Y.inputBuffer = null, Y.isLoading = null, Y.isChatting = null, Y.isWizardFinished = null, Y.finishChat = w, Y.setInput = B, Y.changeInput = v, Y.filterMessage = I, Y.getAccountById = k, Y.back = C, Y.doEmail = D, Y.copyInvoiceNumber = b, Y.sendingEmail = null, f(), n.doCopy = function(e, t) { | |
"CNPJ copiado" == t && (e = e.replace(/[-\/.]/g, "")), d.copy(e), c.info(t, { | |
raw: !0 | |
}) | |
}, n.print = function(e) { | |
var t = window.open("", "PRINT"), | |
n = document.getElementById(e), | |
i = p.stylesheets; | |
t.document.write("<html><head><title>Informações para transferência</title>"), t.document.write('<link rel="stylesheet" href="/assets/css/' + i.app + '" type="text/css" />'), t.document.write('<link rel="stylesheet" href="/assets/css/' + i.vendor + '" type="text/css" />'), t.document.write("</head><body >"), t.document.write(n.innerHTML), t.document.write("</body></html>"), t.document.getElementById("copyCNPJ").remove(), t.document.getElementById("copyAgency").remove(), t.document.getElementById("copyAccount").remove(), t.document.getElementById("copyBeneficiary").remove(), t.document.getElementById("copyAmount").remove(), t.document.getElementById("options").remove(), setTimeout(function() { | |
t.print(), t.close() | |
}, 300) | |
} | |
} | |
e.$inject = ["$q", "$state", "$scope", "$stateParams", "wrnUser", "wrnAnalytics", "wrnPortfolio", "wrnTransaction", "wrnFlash", "wrnResources", "wrnClipboard", "moment", "config"], warren.angular.controller("warren.pages.transactions", e) | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, i, r, s, a) { | |
function t() { | |
try { | |
r.pageView("unsubscribe") | |
} catch (n) {} | |
e() | |
} | |
function e() { | |
c.isLoading = !0, s.unsubscribe(i.token).then(function() { | |
c.isLoading = !1 | |
}, function(n) { | |
c.isLoading = !1, a.error(n.message) | |
}) | |
} | |
var c = this; | |
c.isLoading = !1, t() | |
} | |
n.$inject = ["$q", "$stateParams", "wrnAnalytics", "wrnCrm", "wrnFlash"], warren.angular.controller("warren.pages.unsubscribe", n) | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/user/user.template.html", | |
controller: r, | |
controllerAs: "c_user" | |
} | |
} | |
function r(e, r) { | |
function t() { | |
try { | |
r.pageView("user") | |
} catch (e) {} | |
} | |
t() | |
} | |
angular.module("warren.pages.user", []).controller("warrenUserController", r).directive("warrenUser", e), e.$inject = [], r.$inject = ["$state", "wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/verifiedemail/verifiedemail.template.html", | |
controller: r, | |
controllerAs: "c_verifiedemail" | |
} | |
} | |
function r(e, r, i, a) { | |
function n() { | |
t.loading = !0, i.verifyEmail(r.hash).then(function() { | |
t.loading = !1 | |
}, function(i) { | |
a.error(i.message), e.go("signin", { | |
backTo: r.backTo, | |
params: r.params | |
}) | |
}) | |
} | |
var t = this; | |
n() | |
} | |
angular.module("warren.pages.verifiedemail", []).controller("warrenVerifiedemailController", r).directive("warrenVerifiedemail", e), e.$inject = [], r.$inject = ["$state", "$stateParams", "wrnUser", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function n() { | |
return { | |
templateUrl: "app/pages/withdraw/withdraw.template.html", | |
controller: t, | |
controllerAs: "c_withdraw" | |
} | |
} | |
function t(n, t, r, e, o, i, a, c, u) { | |
function s() { | |
try { | |
o.pageView("withdraw") | |
} catch (n) {} | |
return r.id ? void n.all([l(), d()]).then(function() { | |
h.loading = !1, h.user.isRegisterVerified || t.go("register") | |
}) : void t.go("404") | |
} | |
function l() { | |
return n(function(n, t) { | |
a.getCurrent().then(function(t) { | |
h.user = t, h.user.bankAccounts.length && (h.account = h.user.bankAccounts[0]._id, f(h.account)), n() | |
}, function(n) { | |
console.error(n), t() | |
}) | |
}) | |
} | |
function d() { | |
return n(function(n, t) { | |
i.getWithdrawById(r.id).then(function(r) { | |
h.withdraw = r, c.getById(r.fromPortfolio).then(function(t) { | |
h.portfolio = t, n() | |
}, function(n) { | |
console.error(n), t() | |
}) | |
}, function(n) { | |
console.error(n), t() | |
}) | |
}) | |
} | |
function w() { | |
h.inputVisible = !0 | |
} | |
function f(n) { | |
for (var t = 0; t < h.user.bankAccounts.length; t++) | |
if (h.user.bankAccounts[t]._id === n) return h.selectedBank = h.user.bankAccounts[t], h.selectedBank.name = warren.enums.Bank[h.user.bankAccounts[t].bank], h.selectedBank.img = warren.enums.BankImages[h.user.bankAccounts[t].bank] || warren.enums.BankImages.other, h.selectedBank | |
} | |
var h = this; | |
h.loading = !0, h.withdraw = null, h.portfolio = null, h.inputVisible = !1, h.showInput = w, h.getAccountById = f, s() | |
} | |
angular.module("warren.pages.withdraw", []).controller("warrenWithdrawController", t).directive("warrenWithdraw", n), n.$inject = [], t.$inject = ["$q", "$state", "$stateParams", "$document", "wrnAnalytics", "wrnTransaction", "wrnUser", "wrnPortfolio", "wrnClipboard"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
templateUrl: "app/pages/withdrawals/withdrawals.template.html", | |
controller: e, | |
controllerAs: "c_withdrawals" | |
} | |
} | |
function e(t, e, a, n, o, r, i, s, u, l, d, c) { | |
function h() { | |
try { | |
r.pageView("withdrawals") | |
} catch (t) {} | |
return j.id = a.id, j.id ? void t.all([g(), w(), f()]).then(function() { | |
j.loading = !1, j.withdrawThreshold = j.portfolio.totalBalance - j.pendingWithdrawals.totalAmount, j.withdrawThresholdNet = j.portfolio.totalBalance - j.pendingWithdrawals.totalAmount - j.portfolio.incomeTax - j.portfolio.transactionTax, j.user.bankAccounts.length > 1 ? (j.step = "account", j.suggeestionBankAccounts = Y()) : (j.data.account && (x(V(j.data.account).bank) || (j.withdrawThresholdNet = j.withdrawThresholdNet - parseFloat(l.getValue("withdrawals_transfer_cost")))), j.step = "value"), j.user.isRegisterVerified || e.go("register"), v() | |
}) : void e.go("404") | |
} | |
function g() { | |
return t(function(t, e) { | |
s.getCurrent().then(function(e) { | |
j.user = e, j.user.bankAccounts.length && (j.data.account = j.user.bankAccounts[0]._id, V(j.data.account)), t() | |
}, function(t) { | |
console.error(t), e() | |
}) | |
}) | |
} | |
function w() { | |
return t(function(t, e) { | |
i.getById(j.id).then(function(e) { | |
j.portfolio = e, t() | |
}, function(t) { | |
console.error(t), e() | |
}) | |
}) | |
} | |
function f() { | |
return t(function(t, e) { | |
u.getAllByPortoflio(j.id).then(function(e) { | |
j.pendingWithdrawals = e.pendingWithdraws, j.pendingWithdrawals.totalAmount = 0; | |
for (var a = 0; a < j.pendingWithdrawals.length; a++) j.pendingWithdrawals.totalAmount += j.pendingWithdrawals[a].amount; | |
t() | |
}, function(t) { | |
console.error(t), e() | |
}) | |
}) | |
} | |
function p() { | |
j.data.value = String(j.withdrawThresholdNet.toFixed(2)).replace(/\./g, ",") | |
} | |
function m() { | |
var t = ("FWRF1" !== j.portfolio.fund, d(j.data.scheduleAt)), | |
e = v(); | |
return j.isScheduledDateValid = !1, !(t.diff(e, "days") < 0) && (j.isScheduledDateValid = !0, !0) | |
} | |
function v() { | |
var t = d.utc(new Date), | |
e = "FWRF1" !== j.portfolio.fund; | |
return e ? c.addWeekDays(t, 3) : c.addWeekDays(t, 1), d().hour() > 13 && c.addWeekDays(t, 1), j.getMinScheduleDate = t.format("DD/MM/YYYY"), t | |
} | |
function A() { | |
if (j.data.scheduleAt && d(j.data.scheduleAt).isValid()) { | |
try { | |
if (!m()) throw new Error("Invalid date"); | |
j.data.scheduleAt = d(j.data.scheduleAt), j.data.scheduleAt = d.utc(j.data.scheduleAt).format("DD/MM/YYYY") | |
} catch (t) { | |
return | |
} | |
b() | |
} | |
} | |
function k() { | |
j.scheduled = !0, b() | |
} | |
function b() { | |
if ("value" == j.step) { | |
if (!j.data.value) return; | |
if (j.withdrawThresholdNet < j.data.value) return | |
} | |
"scheduling" === j.step ? (String(j.data.value).indexOf(",") >= 0 ? j.data.valueNumber = parseFloat(String(j.data.value).replace(/,/g, ".")) : j.data.valueNumber = parseFloat(j.data.value), j.step = "summary") : "value" === j.step ? j.step = "scheduling" : (j.step = "value", j.data.account && (x(V(j.data.account).bank) || (j.withdrawThresholdNet = j.withdrawThresholdNet - parseFloat(l.getValue("withdrawals_transfer_cost"))))), j.inputVisible = !1 | |
} | |
function T() { | |
j.saving = !0, String(j.data.value).indexOf(",") >= 0 && (j.data.value = parseFloat(String(j.data.value).replace(/,/g, "."))), j.data.value == j.withdrawThresholdNet.toFixed(2) ? j.data.isTotal = !0 : j.data.isTotal = !1; | |
var t = { | |
amount: j.data.value, | |
fromPortfolio: j.id, | |
toAccount: j.data.account, | |
isTotal: j.data.isTotal, | |
scheduled: j.scheduled, | |
scheduleAt: j.data.scheduleAt | |
}; | |
u.createWithdraw(t).then(function(t) { | |
r.track(j.user, "Withdrawal Created", { | |
amount: t.amount, | |
isTotal: t.isTotal | |
}), e.go("portfolio", { | |
id: j.id, | |
action: "history" | |
}) | |
}, function(t) { | |
console.error(t), j.saving = !1 | |
}) | |
} | |
function W() { | |
j.messageScheduleMin = "", "scheduling" === j.step ? (String(j.data.value).indexOf(".") >= 0 && (j.data.value = String(j.data.value).replace(/\./g, ",")), j.data.scheduleAt = null, j.scheduled = !1, j.scheduleAt = null, j.step = "value") : "value" === j.step && j.user.bankAccounts.length > 1 ? (j.data.scheduleAt = null, j.scheduled = !1, j.step = "account") : "summary" === j.step ? (j.data.scheduleAt = null, j.scheduled = !1, j.step = "scheduling") : e.go(a.backTo || "portfolio", { | |
id: j.id | |
}) | |
} | |
function y() { | |
return o("money")(j.portfolio.totalBalance || 0, "R$ ") | |
} | |
function N() { | |
return o("money")(j.withdrawThresholdNet || 0, "R$ ") | |
} | |
function S() { | |
return o("money")(j.portfolio.transactionTax || 0, "R$ ") | |
} | |
function $() { | |
return o("money")(j.portfolio.incomeTax || 0, "R$ ") | |
} | |
function B() { | |
var t = 0; | |
return x(V(j.data.account).bank) || (t = l.getValue("withdrawals_transfer_cost")), o("money")(t || 0, "R$ ") | |
} | |
function _() { | |
return o("money")(j.pendingWithdrawals.totalAmount || 0, "R$ ") | |
} | |
function R() { | |
for (var t = {}, e = 0; e < j.user.bankAccounts.length; e++) { | |
var a = j.user.bankAccounts[e]; | |
t[a._id] = warren.utils.bankAccountToString(a) | |
} | |
return t | |
} | |
function V(t) { | |
for (var e = 0; e < j.user.bankAccounts.length; e++) | |
if (j.user.bankAccounts[e]._id === t) return j.selectedBank = j.user.bankAccounts[e], j.selectedBank.name = warren.enums.Bank[j.user.bankAccounts[e].bank], j.selectedBank.img = warren.enums.BankImages[j.user.bankAccounts[e].bank] || warren.enums.BankImages.other, j.selectedBank | |
} | |
function M() { | |
j.inputVisible = !0, j.withdrawAll = l.getString("withdrawals_value_total_balance") | |
} | |
function F() { | |
j.pendingWithdrawals.totalAmount > 0 ? j.withdrawThresholdNet < j.data.value && (j.pendingWithdrawals.length > 1 ? j.suggestionMessage = j.user.name + ", o saldo lÃquido disponÃvel para resgate é de " + o("money")(j.withdrawThresholdNet || 0, "R$ ") + ". (Você já possui outros resgates solicitados neste objetivo)" : j.suggestionMessage = j.user.name + ", o saldo lÃquido disponÃvel para resgate é de " + o("money")(j.withdrawThresholdNet || 0, "R$ ") + ". (Você já possui outro resgate solicitado neste objetivo)") : j.withdrawThresholdNet < j.data.value ? j.suggestionMessage = j.user.name + ", o saldo lÃquido disponÃvel para resgate neste objetivo é de " + o("money")(j.withdrawThresholdNet || 0, "R$ ") : j.suggestionMessage = "" | |
} | |
function D() { | |
return o("money")(j.data.value, "R$ ") | |
} | |
function x(t) { | |
if (!t) return !1; | |
var e = l.getStringArray("withdrawals_warren_bank_accounts"); | |
return e.indexOf(t) >= 0 | |
} | |
function Y() { | |
if (!j.user || !j.user.bankAccounts) return []; | |
for (var t = j.user.bankAccounts, e = [], a = 0; a < t.length; a++) x(t[a].bank) && e.push(warren.utils.bankAccountToString(t[a])); | |
if (e.length > 1) { | |
j.suggeestionBankAccountsMessage = ""; | |
for (var a = 0; a < e.length; a++) j.suggeestionBankAccountsMessage += "<b>" + e[a] + "</b>" + (a === e.length - 2 ? " ou " : a < e.length - 2 ? ", " : "") | |
} | |
return e | |
} | |
var j = this; | |
j.id = null, j.loading = !0, j.user = null, j.portfolio = null, j.saving = !1, j.inputVisible = !1, j.data = { | |
value: null, | |
account: null | |
}, j.pendingWithdraws = null, j.withdrawThreshold = null, j.setValue = b, j.doWithdraw = T, j.getWithdrawAmountLimit = y, j.getWithdrawAmountLimitNet = N, j.getAccounts = R, j.back = W, j.dialogEnded = M, j.getAccountById = V, j.valitedAmount = F, j.withdrawAmountLimit = p, j.schedule = k, j.setSchedule = A, j.getValueAsMoney = D, j.getWithdrawIOFCost = S, j.getWithdrawIRCost = $, j.getWithdrawTransferCost = B, j.getPendingWithdrawalsTotalAmount = _, j.validateScheduleAt = m, h() | |
} | |
angular.module("warren.pages.withdrawals", []).controller("warrenWithdrawalsController", e).directive("warrenWithdrawals", t), t.$inject = [], e.$inject = ["$q", "$state", "$stateParams", "$scope", "$filter", "wrnAnalytics", "wrnPortfolio", "wrnUser", "wrnTransaction", "wrnResources", "moment", "weekdays"] | |
}(); | |
! function() { | |
"use strict"; | |
function t(t, n, e, i) { | |
function s() { | |
g.answers = {}, g.isWizardFinished = !c.wizards.shouldOpen1, g.isLoading = !0, i.builder().then(function(t) { | |
r(t), g.isLoading = !1 | |
}, function(t) { | |
console.error(t) | |
}) | |
} | |
function a() {} | |
function r(t, n) { | |
if (n || g.state && g.state.id === t.id || g.stateHistory.push(t), t.buttons.length) t.type = "button"; | |
else if (t.inputs.length) t.type = "input", g.inputBuffer = t.inputs[0].defaultValue || null; | |
else if (t.portfolio) return c.toPage("summary", t); | |
g.state = t, g.isChatting = !0, g.messageIndex = 0 | |
} | |
function o() { | |
g.messageIndex += 1, g.messageIndex >= g.state.messages.length && (g.isChatting = !1) | |
} | |
function u() { | |
g.isWizardFinished = !0, e(function() { | |
c.wizards.shouldOpen1 = !1 | |
}, 600) | |
} | |
function l(t) { | |
g.answers[g.state.id] = t, g.isLoading = !0, i.builder({ | |
id: g.state.id, | |
answers: g.answers | |
}).then(function(t) { | |
r(t), g.isLoading = !1 | |
}, function(t) { | |
console.error(t) | |
}) | |
} | |
function d(t) { | |
return t.replace(/\\n/g, "<br>") | |
} | |
function f() { | |
return g.stateHistory.pop(), g.stateHistory.length ? void r(g.stateHistory[g.stateHistory.length - 1], !0) : void n.go("dash") | |
} | |
t.$on("$destroy", a); | |
var c = t.$parent.c_builder, | |
g = this; | |
g.parent = c, g.answers = null, g.state = null, g.stateHistory = [], g.messageIndex = null, g.inputBuffer = null, g.isLoading = null, g.isChatting = null, g.isWizardFinished = null, g.finishWizard = u, g.finishChat = o, g.setInput = l, g.filterMessage = d, g.back = f, s() | |
} | |
t.$inject = ["$scope", "$state", "$timeout", "wrnPortfolio"], warren.angular.controller("warren.pages.builder.chat", t) | |
}(); | |
! function() { | |
"use strict"; | |
function t(t, o) { | |
function n() { | |
c.state = p.context, c.portfolio = warren.utils.deepcopy(c.state.portfolio), c.fund = p.funds[c.portfolio.fund], c.isChatting = !0, c.messageIndex = 0, i(), l() | |
} | |
function e() {} | |
function l() { | |
c.allocations = c.fund.allocations.slice(), c.allocations.sort(function(t, o) { | |
return o.allocValue - t.allocValue | |
}) | |
} | |
function i(o) { | |
o = o || 12 * c.portfolio.goalDuration, c.simulation = {}, c.simulation.futureValue = warren.finance.futureValue(c.portfolio.initialInvestment, o, c.fund.avgMonthlyInterestRate, c.portfolio.monthlyInvestment), c.simulation.futureValueMin = warren.finance.futureValue(c.portfolio.initialInvestment, o, c.fund.minMonthlyInterestRate, c.portfolio.monthlyInvestment), c.simulation.futureValueMax = warren.finance.futureValue(c.portfolio.initialInvestment, o, c.fund.maxMonthlyInterestRate, c.portfolio.monthlyInvestment), c.simulation.futureSavings = warren.finance.futureValue(c.portfolio.initialInvestment, o, .0061, c.portfolio.monthlyInvestment), t.$$phase || t.$apply() | |
} | |
function a() { | |
return c.simulation.futureValue >= c.portfolio.goalAmount | |
} | |
function r() { | |
c.portfolio = warren.utils.deepcopy(c.state.portfolio), c.fund = p.funds[c.portfolio.fund], f() | |
} | |
function u() { | |
var t = c.portfolio, | |
o = c.state.portfolio; | |
return t.fund != o.fund || t.goalAmount != o.goalAmount || t.goalDuration != o.goalDuration || t.initialInvestment != o.initialInvestment || t.monthlyInvestment != o.monthlyInvestment || t.goalMonthlyIncome != o.goalMonthlyIncome | |
} | |
function f(t) { | |
var n = o.getValue("deposits_minimum_initial"), | |
e = o.getValue("deposits_minimum_monthly"), | |
a = o.getValue("builder_edit_goalyears_max"); | |
if (c.portfolio.goalDuration = parseInt(c.portfolio.goalDuration), c.portfolio.goalDuration = warren.utils.clamp(c.portfolio.goalDuration, 1, a), c.portfolio.initialInvestment = parseInt(c.portfolio.initialInvestment), c.portfolio.initialInvestment = Math.max(c.portfolio.initialInvestment, n), c.portfolio.monthlyInvestment = parseInt(c.portfolio.monthlyInvestment), c.portfolio.monthlyInvestment <= 50 ? c.portfolio.monthlyInvestment = 0 : c.portfolio.monthlyInvestment < e && (c.portfolio.monthlyInvestment = e), "monthly_income" === c.portfolio.goal) { | |
c.portfolio.goalMonthlyIncome = Math.max(c.portfolio.goalMonthlyIncome || 0, 100); | |
var r = o.getValue("builder_interest_inflation_year"), | |
f = Math.round(warren.finance.futureValue(c.portfolio.goalMonthlyIncome, c.portfolio.goalDuration, r) / c.fund.avgMonthlyInterestRate) * c.fund.avgMonthlyInterestRate; | |
c.portfolio.goalAmount = Math.round(f / p.funds.FWRF1.avgMonthlyInterestRate) | |
} | |
c.fund = p.funds[t || c.portfolio.fund], i(), l(), u() && (c.portfolio.isCustomerAwareOfOwnRisk = !0, c.portfolio.isEdited = !0) | |
} | |
function s(t, n) { | |
if ("monthlyInvestment" === t && 0 === c.portfolio.monthlyInvestment && n > 0) c.portfolio.monthlyInvestment = o.getValue("deposits_minimum_monthly"); | |
else if ("fund" === t) { | |
var e = Object.keys(p.funds), | |
l = e.indexOf(c.portfolio.fund); | |
l = warren.utils.clamp(l + n, 0, e.length - 1), c.portfolio.fund = e[l] | |
} else c.portfolio[t] += n || 0; | |
f() | |
} | |
function m() { | |
var t = warren.utils.deepcopy(c.state); | |
t.portfolio = c.portfolio, p.toPage("name", t) | |
} | |
t.$on("$destroy", e); | |
var p = t.$parent.c_builder, | |
c = this; | |
c.parent = p, c.state = null, c.fund = null, c.portfolio = null, c.allocations = null, c.simulation = null, c.withinGoal = a, c.reset = r, c.canReset = u, c.updateInfo = f, c.setValue = s, c.simulate = i, c.next = m, n() | |
} | |
t.$inject = ["$scope", "wrnResources"], warren.angular.controller("warren.pages.builder.edit", t) | |
}(); | |
! function() { | |
"use strict"; | |
function o(o, n, t, e, i, r, l) { | |
function s() { | |
c.isSaving = !1, c.shouldFocus = !1, c.state = d.context, c.portfolio = c.state.portfolio, c.fund = d.funds[c.portfolio.fund], c.suggestion = u() | |
} | |
function a() {} | |
function u() { | |
var o = { | |
target: "builder_step4_namesuggestion_target", | |
monthly_income: "builder_step4_namesuggestion_monthly_income", | |
emergency: "builder_step4_namesuggestion_emergency", | |
free: "builder_step4_namesuggestion_free" | |
}, | |
n = e.getStringArray(o[c.portfolio.goal] || o.free); | |
return n[Math.floor(Math.random() * n.length)] | |
} | |
function g() { | |
c.isSaving || d.toPage("summary") | |
} | |
function m() { | |
c.isSaving = !0; | |
var o = { | |
name: c.name, | |
goal: c.portfolio.goal, | |
goalDuration: c.portfolio.goalDuration, | |
goalAmount: c.portfolio.goalAmount, | |
initialInvestment: c.portfolio.initialInvestment, | |
monthlyInvestment: c.portfolio.monthlyInvestment, | |
goalMonthlyIncome: c.portfolio.goalMonthlyIncome, | |
fund: c.fund.apiId, | |
isCustomerAwareOfOwnRisk: c.portfolio.isCustomerAwareOfOwnRisk || null, | |
isEdited: c.portfolio.isEdited || !1, | |
isShared: c.portfolio.isShared, | |
members: c.portfolio.members | |
}; | |
t.save(o).then(function(t) { | |
l.pixelFB("Builder Finished"), l.track(c.parent.user, "Builder Finished", { | |
goal: o.goal, | |
goalDuration: o.goalDuration, | |
goalAmount: o.goalAmount, | |
initialInvestment: o.initialInvestment, | |
monthlyInvestment: o.monthlyInvestment | |
}), t.isShared ? n.go("portfoliogroupinvites", { | |
id: t._id, | |
builder: !0 | |
}) : n.go("dash"), i.remove("tutorial") | |
}, function(o) { | |
o && o.message && r.error(o.message), c.isSaving = !1 | |
}) | |
} | |
function f() { | |
c.shouldFocus = !0 | |
} | |
o.$on("$destroy", a); | |
var d = o.$parent.c_builder, | |
c = this; | |
c.parent = d, c.state = null, c.portfolio = null, c.name = null, c.fund = null, c.isSaving = null, c.suggestion = null, c.shouldFocus = null, c.back = g, c.next = m, c.focus = f, s() | |
} | |
o.$inject = ["$scope", "$state", "wrnPortfolio", "wrnResources", "wrnContext", "wrnFlash", "wrnAnalytics"], warren.angular.controller("warren.pages.builder.name", o) | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t) { | |
function e() { | |
h.state = m.context, h.portfolio = h.state.portfolio, h.fund = m.funds[h.portfolio.fund], h.isWizardFinished = !m.wizards.shouldOpen2, h.isChatting = !0, h.messageIndex = 0, i(), a() | |
} | |
function o() {} | |
function i() { | |
h.simulation = {}; | |
var n = 12 * h.portfolio.goalDuration; | |
h.simulation.futureValue = warren.finance.futureValue(h.portfolio.initialInvestment, n, h.fund.avgMonthlyInterestRate, h.portfolio.monthlyInvestment), h.simulation.futureValueMin = warren.finance.futureValue(h.portfolio.initialInvestment, n, h.fund.minMonthlyInterestRate, h.portfolio.monthlyInvestment), h.simulation.futureValueMax = warren.finance.futureValue(h.portfolio.initialInvestment, n, h.fund.maxMonthlyInterestRate, h.portfolio.monthlyInvestment), h.simulation.futureSavings = warren.finance.futureValue(h.portfolio.initialInvestment, n, .0061, h.portfolio.monthlyInvestment) | |
} | |
function a() { | |
h.allocations = h.fund.allocations.slice(), h.allocations.sort(function(n, t) { | |
return t.allocValue - n.allocValue | |
}) | |
} | |
function r() { | |
h.messageIndex += 1, h.messageIndex >= h.state.messages.length && (h.isChatting = !1) | |
} | |
function u() { | |
h.isWizardFinished = !0, t(function() { | |
m.wizards.shouldOpen2 = !1 | |
}, 600) | |
} | |
function l(n) { | |
return n.replace(/\\n/g, "<br>") | |
} | |
function s() { | |
m.toPage("chat") | |
} | |
function f() { | |
var n = h.portfolio.fund, | |
t = Object.keys(m.funds); | |
return ["Conservador", "Conservador-moderado", "Moderado", "Moderado-arrojado", "Arrojado"][t.indexOf(n)] | |
} | |
function d() { | |
return h.simulation.futureValue >= h.portfolio.goalAmount | |
} | |
function c() { | |
switch (h.portfolio.fund) { | |
case "FWRF1": | |
return "Fundo Warren Renda Fixa 1"; | |
case "FWMM1": | |
return "Fundo Warren Multimercado 1"; | |
case "FWMM2": | |
return "Fundo Warren Multimercado 2"; | |
case "FWMM3": | |
return "Fundo Warren Multimercado 3"; | |
case "FWMM4": | |
return "Fundo Warren Multimercado 4" | |
} | |
} | |
n.$on("$destroy", o); | |
var m = n.$parent.c_builder, | |
h = this; | |
h.parent = m, h.state = null, h.fund = null, h.portfolio = null, h.allocations = null, h.messageIndex = null, h.isChatting = null, h.simulation = null, h.isWizardFinished = null, h.finishWizard = u, h.finishChat = r, h.filterMessage = l, h.back = s, h.getRiskName = f, h.withinGoal = d, h.fundName = c, e() | |
} | |
n.$inject = ["$scope", "$timeout"], warren.angular.controller("warren.pages.builder.summary", n) | |
}(); | |
! function() { | |
"use strict"; | |
function r() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/dash/blocks/startregisterfaq.template.html", | |
controller: t, | |
controllerAs: "c_startregisterfaq" | |
} | |
} | |
function t(r, t, e, n, a, s) { | |
function i() {} | |
i() | |
} | |
angular.module("warren.pages.startregisterfaq", []).controller("warrenStartRegisterFaqController", t).directive("warrenStartRegisterFaq", r), r.$inject = [], t.$inject = ["wrnPath", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/home/teaser/teaser.template.html", | |
controller: t, | |
controllerAs: "c_teaser" | |
} | |
} | |
function t(e, t, r, n, o, a, s, i) { | |
function c() { | |
var e = t.affiliate; | |
if (e) { | |
i.referral(e); | |
try { | |
r.event("invitee", "viewHome", "teaser", "1") | |
} catch (e) {} | |
} | |
try { | |
r.pageView("teaser") | |
} catch (e) {} | |
} | |
function l() { | |
var t = 500, | |
r = 500, | |
n = 500; | |
e(function() { | |
u.showSubtitle = !0, e(function() { | |
u.showButton = !0, e(function() { | |
u.showLogo = !0 | |
}, n) | |
}, r) | |
}, t) | |
} | |
var u = this; | |
u.showSubtitle = !1, u.showButton = !1, u.showLogo = !1, u.onAfterText = l, c() | |
} | |
angular.module("warren.pages.teaser", []).controller("warrenTeaserController", t).directive("warrenTeaser", e), e.$inject = [], t.$inject = ["$timeout", "$stateParams", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession", "waitlist"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/line/blocks/lineplace.template.html", | |
controller: n, | |
controllerAs: "c_lineplace" | |
} | |
} | |
function n(e, n, i, o, t, r, a, s, c, l) { | |
function p() { | |
if (d(), s.reserved()) { | |
var e = s.reservation().reservation; | |
m.position = e.position, m.affiliate = e.affiliate, m.url += m.affiliate | |
} | |
try { | |
n.pageView("lineplace") | |
} catch (e) {} | |
} | |
function f() { | |
return c.isSupported() | |
} | |
function u() { | |
var e = m.url; | |
c.copy(e), o.info("link copiado!", { | |
raw: !0 | |
}) | |
} | |
function h() { | |
return encodeURIComponent(m.url) | |
} | |
function w(e) { | |
n.event("fila", "share", e, "1") | |
} | |
function v() { | |
m.chatFinished = !0 | |
} | |
function d() { | |
a.isEmpty("accounts.accessToken") ? (m.position = "Oops", m.affiliate = "oops") : l.all([i.getCurrent()]).then(function(e) { | |
m.user = e[0], m.position || g() | |
}, function(e) { | |
console.error(e) | |
}) | |
} | |
function g() { | |
m.processingReserve = !0, s.config(m.user.name, m.user.email), s.position().then(function(e) { | |
m.position = e.reservation.position, m.affiliate = e.reservation.affiliate, m.url += m.affiliate, m.processingReserve = !1 | |
}, function(e) { | |
m.position = "Oops", m.affiliate = "oops", m.processingReserve = !1, o.error(e, { | |
raw: !0 | |
}) | |
}) | |
} | |
var m = this; | |
m.url = "https://oiwarren.com/#/?affiliate=", m.chatFinished = !1, m.canShowCopy = f, m.doCopy = u, m.encodedUrl = h, m.analytics = w, m.finishChat = v, p() | |
} | |
angular.module("warren.pages.lineplace", []).controller("warrenLineplaceController", n).directive("warrenLineplace", e), e.$inject = [], n.$inject = ["$state", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnPath", "wrnHistory", "wrnSession", "waitlist", "wrnClipboard", "$q"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/line/blocks/lineregister.template.html", | |
controller: r, | |
controllerAs: "c_lineregister" | |
} | |
} | |
function r(e, r, n, i, t, a, s, l) { | |
function o() { | |
g.data.name = r.name, g.data.email = r.email; | |
try { | |
n.pageView("lineregister") | |
} catch (e) {} | |
} | |
function c() { | |
g.processingReserve = !0; | |
var r = g.data.name, | |
i = g.data.email; | |
l.config(r, i), l.reserve().then(function(i) { | |
g.processingReserve = !1, e.go("lineplace"), l.affiliate() && (n.track(null, "Waitlist Inserted", { | |
name: r | |
}), n.event("invitee", "enteredTheLine", "profile", "1")) | |
}, function(r) { | |
404 == r ? l.position().then(function(r) { | |
g.processingReserve = !1, e.go("lineplace") | |
}, function(e) { | |
g.processingReserve = !1, t.error(e, { | |
raw: !0 | |
}) | |
}) : (g.processingReserve = !1, t.error(r, { | |
raw: !0 | |
})) | |
}) | |
} | |
var g = this; | |
g.processingReserve = !1, g.data = { | |
name: null, | |
email: null | |
}, g.waitlistReservation = c, o() | |
} | |
angular.module("warren.pages.lineregister", []).controller("warrenLineregisterController", r).directive("warrenLineregister", e), e.$inject = [], r.$inject = ["$state", "$stateParams", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession", "waitlist"] | |
}(); | |
! function() { | |
"use strict"; | |
function a() { | |
return { | |
templateUrl: "app/pages/loseometer/blocks/loseometer.result.html", | |
controller: t, | |
controllerAs: "c_loseometerResult" | |
} | |
} | |
function t(a, t, e, n, r, o, s) { | |
function l() { | |
w.data.salary <= 3e3 ? w.data.initialInvestment = 5e3 : w.data.initialInvestment = 1e4, w.data.monthlyInvestment = .1 * w.data.salary, w.updateInfo(); | |
try { | |
e.pageView("loseometerResult") | |
} catch (a) {} | |
} | |
function i() { | |
w.isStarted = !0 | |
} | |
function u() { | |
wrnSmoothScroll.toPosition(1e5, 0) | |
} | |
function d(a, t) { | |
var e = w.data[a], | |
n = e + (t || 0); | |
n >= 0 && (w.data[a] = n, c()) | |
} | |
function c() { | |
w.data.wage = w.data.salary / w.data.workHoursPerMonth, w.data.totalSavings = warren.finance.futureValue(w.data.initialInvestment, 12 * w.data.goalYears, w.benchmarks.savings, w.data.monthlyInvestment), w.data.totalWarren = warren.finance.futureValue(w.data.initialInvestment, 12 * w.data.goalYears, w.benchmarks.warren, w.data.monthlyInvestment), w.data.lostMoney = w.data.totalWarren - w.data.totalSavings; | |
var a = w.data.lostMoney / w.data.wage; | |
w.data.hours = Math.floor(a) | |
} | |
function m() { | |
a.go("suitability") | |
} | |
var w = this; | |
w.data = { | |
salary: t.salary || 3e3, | |
workHoursPerMonth: 180, | |
goalYears: 10, | |
hours: 8 | |
}, w.benchmarks = { | |
savings: .0061, | |
warren: .009435 | |
}, w.start = i, w.scroll = u, w.updateInfo = c, w.updateValue = d, w.goSuita = m, l() | |
} | |
angular.module("warren.pages.loseometerResult", []).controller("warrenLoseometerResultController", t).directive("warrenLoseometerResult", a), a.$inject = [], t.$inject = ["$state", "$stateParams", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, o, n, t, i, r, c) { | |
function s(r, s, a, p) { | |
function d(e) { | |
for (var o = r.c_portfolio._pendingTransactions, n = 0; n < o.length; n++) o[n]._id === e && r.c_portfolio._pendingTransactions.splice(n, 1); | |
r.c_portfolio.reload() | |
} | |
var l = a.id; | |
if (r.isLoading = !0, r.sendingEmail = null, r.$parent.c_portfolio) { | |
r.portfolio = r.$parent.c_portfolio.portfolio; | |
for (var f = 0; f < r.$parent.c_portfolio._pendingTransactions.length; f++) | |
if (r.$parent.c_portfolio._pendingTransactions[f]._id == l) { | |
r.deposit = r.$parent.c_portfolio._pendingTransactions[f]; | |
break | |
} | |
} | |
r.portfolio && r.deposit ? r.isLoading = !1 : e.getDepositById(l).then(function(e) { | |
r.deposit = e, o.getById(e.toPortfolio).then(function(e) { | |
r.isLoading = !1, r.portfolio = e | |
}, function(e) { | |
console.error(e) | |
}) | |
}, function(e) { | |
console.error(e) | |
}), r.canShowCopy = function() { | |
return n.isSupported() | |
}, r.doCopy = function(e, o) { | |
"CNPJ copiado" == o && (e = e.replace(/[-\/.]/g, "")), n.copy(e), t.info(o, { | |
raw: !0 | |
}) | |
}, r.getBankImg = function(e) { | |
return warren.enums.BankImages[e] || warren.enums.BankImages.other | |
}, r.print = function(e) { | |
var o = window.open("", "PRINT"), | |
n = document.getElementById(e), | |
t = c.stylesheets; | |
o.document.write("<html><head><title>Informações para transferência</title>"), o.document.write('<link rel="stylesheet" href="/assets/css/' + t.app + '" type="text/css" />'), o.document.write('<link rel="stylesheet" href="/assets/css/' + t.vendor + '" type="text/css" />'), o.document.write("</head><body >"), o.document.write(n.innerHTML), o.document.write("</body></html>"), o.document.getElementById("copyCNPJ").remove(), o.document.getElementById("copyAgency").remove(), o.document.getElementById("copyAccount").remove(), o.document.getElementById("copyBeneficiary").remove(), o.document.getElementById("cancelDeposit").remove(), setTimeout(function() { | |
o.print(), o.close() | |
}, 300) | |
}, r.doEmail = function(o) { | |
r.sendingEmail = !0, e.sendDepositByEmail(o).then(function() { | |
r.sendingEmail = !1 | |
}, function(e) { | |
t.error(e.message) | |
}) | |
}, r.cancelDeposit = function() { | |
r.deposit.isPending ? i.confirm("Cancelar Depósito?", "Tem certeza que deseja cancelar este depósito? Essa ação não pode ser revertida.", { | |
textCancel: "Não", | |
textOk: "Sim" | |
}).then(function(o) { | |
"ok" === o && e.cancelDeposit(r.deposit._id).then(function(e) { | |
d(e._id), t.success("Depósito cancelado com sucesso!", { | |
raw: !0 | |
}) | |
}, function(e) { | |
t.error(e.message) | |
}) | |
}) : t.info("Depósito já processado, não pode ser cancelado", { | |
raw: !0 | |
}) | |
} | |
} | |
return { | |
restrict: "E", | |
link: s, | |
templateUrl: "app/pages/portfolio/directives/deposit.template.html" | |
} | |
} | |
e.$inject = ["wrnTransaction", "wrnPortfolio", "wrnClipboard", "wrnFlash", "wrnDialog", "$window", "config"], angular.module("warren.pages.portfolio.directives.deposit", []).directive("wrnPortfolioDeposit", e) | |
}(); | |
! function() { | |
"use strict"; | |
function o(o, n, i, e, r) { | |
function t(t, c, a, l) { | |
function s(o) { | |
for (var n = t.c_portfolio._pendingTransactions, i = 0; i < n.length; i++) n[i]._id === o && t.c_portfolio._pendingTransactions.splice(i, 1); | |
t.c_portfolio.reload() | |
} | |
var p = a.id; | |
if (t.isLoading = !0, t.isSendingEmail = null, t.invoice = null, t.portfolio = null, t.$parent.c_portfolio) { | |
t.portfolio = t.$parent.c_portfolio.portfolio; | |
for (var d = 0; d < t.$parent.c_portfolio._pendingTransactions.length; d++) | |
if (t.$parent.c_portfolio._pendingTransactions[d]._id == p) { | |
t.invoice = t.$parent.c_portfolio._pendingTransactions[d]; | |
break | |
} | |
} | |
t.portfolio && t.invoice ? t.isLoading = !1 : o.getInvoiceById(p).then(function(o) { | |
t.invoice = o, n.getById(o.toPortfolio).then(function(o) { | |
t.isLoading = !1, t.portfolio = o | |
}, function(o) { | |
console.error(o) | |
}) | |
}, function(o) { | |
console.error(o) | |
}), t.canShowCopy = function() { | |
return i.isSupported() | |
}, t.doCopy = function() { | |
var o = t.invoice.barCodeString; | |
o = o.replace(/\./g, "").replace(/\s/g, ""), i.copy(o), e.info("Código de barras copiado", { | |
raw: !0 | |
}) | |
}, t.doEmail = function() { | |
t.isSendingEmail = !0, o.sendInvoiceByEmail(t.invoice._id).then(function() { | |
t.isSendingEmail = !1 | |
}) | |
}, t.cancelInvoice = function() { | |
t.invoice.isPending ? r.confirm("Cancelar Boleto?", "Tem certeza que deseja cancelar este boleto? Essa ação não pode ser revertida.", { | |
textCancel: "Não", | |
textOk: "Sim" | |
}).then(function(n) { | |
"ok" === n && o.cancelInvoice(t.invoice._id).then(function(o) { | |
s(o._id), e.success("Boleto cancelado com sucesso!", { | |
raw: !0 | |
}) | |
}, function(o) { | |
e.error(o.message) | |
}) | |
}) : e.info("Depósito já processado, não pode ser cancelado", { | |
raw: !0 | |
}) | |
} | |
} | |
return { | |
restrict: "E", | |
link: t, | |
templateUrl: "app/pages/portfolio/directives/invoice.template.html" | |
} | |
} | |
angular.module("warren.pages.portfolio.directives.invoice", []).directive("wrnPortfolioInvoice", o), o.$inject = ["wrnTransaction", "wrnPortfolio", "wrnClipboard", "wrnFlash", "wrnDialog"] | |
}(); | |
! function() { | |
"use strict"; | |
function o(o, t, e) { | |
function n(o, n, r) { | |
function i(n, r, a) { | |
o.isLoading = !r, o.isLoadingMore = !!r, a || r || (o.notFound = !1); | |
var p = r ? 20 : 19; | |
e.searchPhotos(n, r, p).then(function(t) { | |
t.photos.length ? (o.photos = r ? o.photos.concat(t.photos) : t.photos, o.pagination = { | |
first: t.first, | |
prev: t.prev, | |
next: t.next, | |
last: t.last | |
}, o.isLoading = !1, o.isLoadingMore = !1) : a || (o.photos = [], o.notFound = !0, i("", 1, !0)) | |
}, function(e) { | |
t.error(e.message), o.isLoading = !1, o.isLoadingMore = !1 | |
}) | |
} | |
function a() { | |
o.pagination && o.pagination.next && (o.notFound ? i(null, o.pagination.next) : i(o.query, o.pagination.next)) | |
} | |
function p(n) { | |
n && n.urls || (n = { | |
urls: {} | |
}), o.$parent.c_portfolio && (o.$parent.c_portfolio.hasBackground = !!n.urls.full); | |
var r = document.getElementById("portfolio-background"), | |
i = document.getElementById("portfolio-background-mobile"); | |
r.style.backgroundImage = "url('" + n.urls.full + "')", i.style.backgroundImage = "url('" + n.urls.regular + "')", e.updateBackground(o.portfolio._id, n.urls).then(function(o) {}, function(o) { | |
t.error(o.message) | |
}) | |
} | |
o.isLoading = !0, o.isLoadingMore = !1, o.searchPhotos = i, o.selectBackground = p, o.photos = [], o.$parent.c_edit ? (o.portfolio = o.$parent.c_edit.portfolio, o.$parent.c_edit.morePhotos = a) : o.$parent.c_editgroup && (o.portfolio = o.$parent.c_editgroup.portfolio, o.$parent.c_editgroup.morePhotos = a), i(), o.back = function(t) { | |
o.$parent.c_edit && (o.$parent.c_edit.selectBackground = !1, t && o.$parent.c_edit.refreshPortfolioData()), o.$parent.c_editgroup && (o.$parent.c_editgroup.selectBackground = !1, t && o.$parent.c_editgroup.refreshPortfolioData()), t && o.$parent.c_portfolio && o.$parent.c_portfolio.toggleEditPanel() | |
} | |
} | |
return { | |
scope: { | |
closeFn: "&" | |
}, | |
templateUrl: "app/pages/portfolio/directives/photos.template.html", | |
link: n | |
} | |
} | |
o.$inject = ["$window", "wrnFlash", "wrnPortfolio"], angular.module("warren.pages.portfolio.directives.photos", []).directive("wrnPhotos", o) | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, o, t, r, e, a, i) { | |
function c(r, c, s, u) { | |
function f(o) { | |
return n(function(n, e) { | |
t.getById(o).then(function(o) { | |
r.portfolio = o, n() | |
}, function(n) { | |
e(n) | |
}) | |
}) | |
} | |
function l(o) { | |
return n(function(n, t) { | |
e.getBankAccount(o).then(function(o) { | |
r.account = o, n() | |
}, function(n) { | |
t(n) | |
}) | |
}) | |
} | |
function d(n) { | |
for (var o = r.c_portfolio._pendingTransactions, t = 0; t < o.length; t++) o[t]._id === n && r.c_portfolio._pendingTransactions.splice(t, 1) | |
} | |
var p = s.id; | |
if (r.isLoading = !0, r.withdraw = null, r.portfolio = null, r.account = null, r.$parent.c_portfolio) { | |
r.portfolio = r.$parent.c_portfolio.portfolio; | |
for (var w = 0; w < r.$parent.c_portfolio._pendingTransactions.length; w++) | |
if (r.$parent.c_portfolio._pendingTransactions[w]._id == p) { | |
r.withdraw = r.$parent.c_portfolio._pendingTransactions[w]; | |
break | |
} | |
for (var w = 0; w < r.$parent.c_portfolio.user.bankAccounts.length; w++) | |
if (r.withdraw && r.$parent.c_portfolio.user.bankAccounts[w]._id == r.withdraw.toAccount) { | |
r.account = r.$parent.c_portfolio.user.bankAccounts[w]; | |
break | |
} | |
} | |
r.portfolio && r.withdraw && r.account ? r.isLoading = !1 : o.getWithdrawById(p).then(function(o) { | |
r.withdraw = o, n.all([f(o.fromPortfolio), l(o.toAccount)]).then(function() { | |
r.isLoading = !1 | |
}) | |
}, function(n) { | |
console.error(n) | |
}), r.cancelWithdraw = function() { | |
r.withdraw.isPending ? a.confirm("Cancelar Resgate?", "Tem certeza que deseja cancelar este resgate? Essa ação não pode ser revertida.", { | |
textCancel: "Não", | |
textOk: "Sim" | |
}).then(function(n) { | |
"ok" === n && o.cancelWithdraw(r.withdraw._id).then(function(n) { | |
d(n._id), i.success("Resgate cancelado com sucesso!", { | |
raw: !0 | |
}) | |
}, function(n) { | |
i.error(n.message) | |
}) | |
}) : i.info("Resgate já processado, não pode ser cancelado", { | |
raw: !0 | |
}) | |
}, r.getBankImg = function(n) { | |
return warren.enums.BankImages[n] || warren.enums.BankImages.other | |
}, r.getBankName = function() { | |
return warren.enums.Bank[r.account.bank] | |
} | |
} | |
return { | |
restrict: "E", | |
link: c, | |
templateUrl: "app/pages/portfolio/directives/withdraw.template.html" | |
} | |
} | |
angular.module("warren.pages.portfolio.directives.withdraw", []).directive("wrnPortfolioWithdraw", n), n.$inject = ["$q", "wrnTransaction", "wrnPortfolio", "wrnClipboard", "wrnUser", "wrnDialog", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
templateUrl: "app/pages/portfolio/pages/edit.template.html", | |
controller: a, | |
controllerAs: "c_edit" | |
} | |
} | |
function a(t, a, e, o, n, i, l) { | |
function r() { | |
D = t.$parent.c_portfolio, A.fundInterest = m(), A.portfolio = D.portfolio; | |
i(D.createdAt); | |
d(), I({ | |
emergency: 0, | |
monthly_income: 1, | |
target: 2, | |
free: 3 | |
}[A.portfolio.goal]) | |
} | |
function d() { | |
A.data = { | |
name: D.portfolio.name, | |
goal: D.portfolio.goal, | |
goalAmount: D.portfolio.goalAmount, | |
goalYears: D.portfolio.goalDuration, | |
goalMonthlyIncome: D.portfolio.goalMonthlyIncome, | |
initialInvestment: D.portfolio.initialInvestment, | |
monthlyInvestment: D.portfolio.monthlyInvestment, | |
investReminderDay: D.portfolio.investReminderDay, | |
group: D.portfolio.group, | |
isShared: D.portfolio.isShared, | |
skipInvestReminder: "undefined" != typeof D.portfolio.skipInvestReminder && null !== D.portfolio.skipInvestReminder && D.portfolio.skipInvestReminder | |
}, A.data.goalMonthlyIncome ? _ = A.data.goalMonthlyIncome : (A.data.goalMonthlyIncome = 100, _ = A.data.goalMonthlyIncome), A.data.goalAmount ? M = A.data.goalAmount : (A.data.goalAmount = 1e3, M = A.data.goalAmount), I({ | |
emergency: 0, | |
monthly_income: 1, | |
target: 2, | |
free: 3 | |
}[A.data.goal]) | |
} | |
function m() { | |
var t = D.findFundByApiId("FWRF1"); | |
return t.avgMonthlyInterestRate | |
} | |
function s(t, a, e) { | |
return Math.round(t / Math.pow(1 + a, e)) | |
} | |
function g(t, a) { | |
"undefined" != typeof t && (A.data.goalMonthlyIncome += parseInt(t)), A.data.goalMonthlyIncome || (A.data.goalMonthlyIncome = 100), A.data.goalMonthlyIncome = Math.max(A.data.goalMonthlyIncome, 100); | |
var e = l.getValue("builder_interest_inflation_year"), | |
o = Math.round(warren.finance.futureValue(A.data.goalMonthlyIncome, A.data.goalYears, e) / A.fundInterest) * A.fundInterest; | |
a || (A.data.goalAmount = Math.round(o / A.fundInterest)); | |
var n = A.data.goalAmount, | |
i = 10, | |
r = n % i; | |
0 !== r && (n += i - r), A.data.goalAmount = n, _ = A.data.goalMonthlyIncome | |
} | |
function u(t) { | |
"undefined" != typeof t && (A.data.goalAmount += t), A.data.goalAmount || (A.data.goalAmount = 1e3), A.data.goalAmount = Math.max(A.data.goalAmount, 1e3), "monthly_income" === A.data.goal ? (A.data.goalMonthlyIncome = (A.data.goalAmount * A.fundInterest).toFixed(0), A.data.goalMonthlyIncome = s(A.data.goalMonthlyIncome, l.getValue("builder_interest_inflation_year"), A.data.goalYears)) : M = A.data.goalAmount | |
} | |
function f(t) { | |
"undefined" != typeof t && (A.data.goalYears += t), A.data.goalYears || (A.data.goalYears = 1), A.data.goalYears = parseInt(A.data.goalYears), A.data.goalYears = warren.utils.clamp(A.data.goalYears, 1, 60), "monthly_income" == A.data.goal && g(void 0, !0) | |
} | |
function c(t) { | |
A.data.monthlyInvestment || (A.data.monthlyInvestment = 0), "undefined" != typeof t && (50 === t && 0 === A.data.monthlyInvestment ? A.data.monthlyInvestment += 2 * t : A.data.monthlyInvestment += t), A.data.monthlyInvestment <= 50 ? A.data.monthlyInvestment = 0 : A.data.monthlyInvestment < 100 && (A.data.monthlyInvestment = 100), A.data.monthlyInvestment = parseInt(A.data.monthlyInvestment) | |
} | |
function y(t) { | |
A.data.investReminderDay || (A.data.investReminderDay = 0), "undefined" != typeof t && (A.data.investReminderDay += t), A.data.investReminderDay > 28 ? A.data.investReminderDay = 1 : A.data.investReminderDay < 1 && (A.data.investReminderDay = 28), A.data.investReminderDay = parseInt(A.data.investReminderDay) | |
} | |
function p() { | |
u(), f(), c(), A.data.goalDuration = A.data.goalYears; | |
var t = (new Date).getDate(); | |
t > 28 && (t = 28), A.portfolio.investReminderDay !== A.data.investReminderDay && A.data.investReminderDay > t && !A.portfolio.isVirtual ? n.confirm("Lembrete de investimento mensal", "Gostaria de receber o lembrete neste mês ou no próximo?", { | |
textCancel: "Neste mês", | |
textOk: "Próximo mês" | |
}).then(function(t) { | |
"ok" === t ? (A.data.skipInvestReminder = !0, v()) : (A.data.skipInvestReminder = !1, v()) | |
}) : (A.portfolio.investReminderDay !== A.data.investReminderDay && (A.data.skipInvestReminder = !1), v()) | |
} | |
function v() { | |
A.saving = !0, e.update(A.portfolio._id, A.data).then(function() { | |
a.reload(), o.success("Objetivo atualizado", { | |
raw: !0 | |
}) | |
}, function(t) { | |
A.saving = !1, o.error(t.message) | |
}) | |
} | |
function h() { | |
n.confirm("Deletar objetivo?", "Tem certeza que deseja deletar este objetivo? Essa ação não pode ser revertida.", { | |
textCancel: "Cancelar", | |
textOk: "Deletar" | |
}).then(function(t) { | |
"ok" === t && (A.saving = !0, e.remove(A.portfolio._id).then(function() { | |
a.go("dash"), o.success("Objetivo deletado", { | |
raw: !0 | |
}) | |
}, function(t) { | |
A.saving = !1, o.error(t.message) | |
})) | |
}) | |
} | |
function I(t) { | |
A.data.goal = ["emergency", "monthly_income", "target", "free"][t], A.info = { | |
id: t, | |
image: t + 1, | |
title: "builder_step1_" + A.data.goal + "_title1", | |
description: "builder_step1_" + A.data.goal + "_description1" | |
}, "monthly_income" == A.data.goal ? g(void 0, A.portfolio.goal === A.data.goal) : M && (A.data.goalAmount = M) | |
} | |
function R(t) { | |
var a = A.info.id; | |
"next" === t ? a = 3 === a ? 0 : a + 1 : "prev" === t && (a = 0 === a ? 3 : a - 1), I(a) | |
} | |
var D, M, _, A = this; | |
A.data = null, A.info = null, A.saving = !1, A.changeGoalAmount = u, A.changeGoalYears = f, A.changeMonthlyInvestment = c, A.changeGoalMonthlyIncome = g, A.changeInvestReminderDay = y, A.save = p, A.remove = h, A.updateGoal = I, A.refreshPortfolioData = d, A.changeGoal = R, r() | |
} | |
a.$inject = ["$scope", "$state", "wrnPortfolio", "wrnFlash", "wrnDialog", "moment", "wrnResources"], angular.module("warren.pages.portfolio.edit", []).controller("warrenPortfolioEditController", a).directive("warrenPortfolioEdit", t), t.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
templateUrl: "app/pages/portfolio/pages/editGroup.template.html", | |
controller: o, | |
controllerAs: "c_editgroup" | |
} | |
} | |
function o(t, o, a, n, e, r, l) { | |
function i() { | |
A = t.$parent.c_portfolio, G.fundInterest = g(), G.portfolio = A.portfolio; | |
r(A.createdAt); | |
d(), u(), M({ | |
emergency: 0, | |
monthly_income: 1, | |
target: 2, | |
free: 3 | |
}[G.portfolio.goal]) | |
} | |
function u() { | |
for (var t = A.portfolio.group.members, o = G.data.monthlyInvestment, a = 0; a < t.length; a++) o += t[a].monthlyInvestment || 0; | |
G.monthlyInvestmentMin = o >= A.portfolio.group.monthlyInvestment | |
} | |
function d() { | |
G.data = { | |
portfolioId: A.portfolio._id, | |
group: A.portfolio.group, | |
initialInvestment: A.portfolio.initialInvestment, | |
monthlyInvestment: A.portfolio.monthlyInvestment, | |
investReminderDay: A.portfolio.investReminderDay | |
}, G.data.group.goalMonthlyIncome ? w = G.data.group.goalMonthlyIncome : (G.data.group.goalMonthlyIncome = 100, w = G.data.group.goalMonthlyIncome), G.data.group.goalAmount ? R = G.data.group.goalAmount : (G.data.group.goalAmount = 1e3, R = G.data.group.goalAmount), M({ | |
emergency: 0, | |
monthly_income: 1, | |
target: 2, | |
free: 3 | |
}[G.data.group.goal]) | |
} | |
function g() { | |
var t = A.findFundByApiId("FWRF1"); | |
return t.avgMonthlyInterestRate | |
} | |
function m(t, o, a) { | |
return Math.round(t / Math.pow(1 + o, a)) | |
} | |
function p(t, o) { | |
"undefined" != typeof t && (G.data.group.goalMonthlyIncome += parseInt(t)), G.data.group.goalMonthlyIncome || (G.data.group.goalMonthlyIncome = 100), G.data.group.goalMonthlyIncome = Math.max(G.data.group.goalMonthlyIncome, 100); | |
var a = l.getValue("builder_interest_inflation_year"), | |
n = Math.round(warren.finance.futureValue(G.data.group.goalMonthlyIncome, G.data.group.goalDuration, a) / G.fundInterest) * G.fundInterest; | |
o || (G.data.group.goalAmount = Math.round(n / G.fundInterest)); | |
var e = G.data.group.goalAmount, | |
r = 10, | |
i = e % r; | |
0 !== i && (e += r - i), G.data.group.goalAmount = e, w = G.data.group.goalMonthlyIncome | |
} | |
function s(t) { | |
"undefined" != typeof t && (G.data.group.goalAmount += t), G.data.group.goalAmount || (G.data.group.goalAmount = 1e3), G.data.group.goalAmount = Math.max(G.data.group.goalAmount, 1e3), "monthly_income" === G.data.group.goal ? (G.data.group.goalMonthlyIncome = (G.data.group.goalAmount * G.fundInterest).toFixed(0), G.data.group.goalMonthlyIncome = m(G.data.group.goalMonthlyIncome, l.getValue("builder_interest_inflation_year"), G.data.group.goalDuration)) : R = G.data.group.goalAmount | |
} | |
function c(t) { | |
"undefined" != typeof t && (G.data.group.goalDuration += t), G.data.group.goalDuration || (G.data.group.goalDuration = 1), G.data.group.goalDuration = parseInt(G.data.group.goalDuration), G.data.group.goalDuration = warren.utils.clamp(G.data.group.goalDuration, 1, 60), "monthly_income" == G.data.group.goal && p(void 0, !0) | |
} | |
function f(t) { | |
G.data.monthlyInvestment || (G.data.monthlyInvestment = 0), "undefined" != typeof t && (50 === t && 0 === G.data.monthlyInvestment ? G.data.monthlyInvestment += 2 * t : G.data.monthlyInvestment += t), G.data.monthlyInvestment <= 50 ? G.data.monthlyInvestment = 0 : G.data.monthlyInvestment < 100 && (G.data.monthlyInvestment = 100), G.data.monthlyInvestment = parseInt(G.data.monthlyInvestment), u() | |
} | |
function y(t) { | |
G.data.group.monthlyInvestment || (G.data.group.monthlyInvestment = 0), "undefined" != typeof t && (50 === t && 0 === G.data.group.monthlyInvestment ? G.data.group.monthlyInvestment += 2 * t : G.data.group.monthlyInvestment += t), G.data.group.monthlyInvestment <= 50 ? G.data.group.monthlyInvestment = 0 : G.data.group.monthlyInvestment < 100 && (G.data.group.monthlyInvestment = 100), G.data.group.monthlyInvestment = parseInt(G.data.group.monthlyInvestment), u() | |
} | |
function h(t) { | |
G.data.investReminderDay || (G.data.investReminderDay = 0), "undefined" != typeof t && (G.data.investReminderDay += t), G.data.investReminderDay > 28 ? G.data.investReminderDay = 1 : G.data.investReminderDay < 1 && (G.data.investReminderDay = 28), G.data.investReminderDay = parseInt(G.data.investReminderDay) | |
} | |
function v() { | |
s(), c(), f(), G.data.group.skipInvestReminder = !1, G.data.group.goalDuration = G.data.group.goalDuration; | |
var t = (new Date).getDate(); | |
t > 28 && (t = 28), G.portfolio.investReminderDay != G.data.investReminderDay && G.data.investReminderDay > t && !G.portfolio.isVirtual ? e.confirm("Lembrete de investimento mensal", "Gostaria de receber o lembrete neste mês ou no próximo?", { | |
textCancel: "Neste mês", | |
textOk: "Próximo mês" | |
}).then(function(t) { | |
"ok" === t ? (G.data.group.skipInvestReminder = !0, I()) : I() | |
}) : I() | |
} | |
function I() { | |
G.saving = !0, a.update(G.portfolio._id, G.data).then(function() { | |
G.portfolio.isAdmin ? D(function(t) { | |
G.saving = !1, t || n.success("Objetivo atualizado", { | |
raw: !0 | |
}) | |
}) : (G.saving = !1, o.reload(), n.success("Objetivo atualizado", { | |
raw: !0 | |
})) | |
}, function(t) { | |
G.saving = !1, n.error(t.message) | |
}) | |
} | |
function D(t) { | |
a.editGroup(G.data.group._id, G.data).then(function() { | |
o.reload(), t(null) | |
}, function(o) { | |
n.error(o.message), t(o) | |
}) | |
} | |
function M(t) { | |
G.data.group.goal = ["emergency", "monthly_income", "target", "free"][t], G.info = { | |
id: t, | |
image: t + 1, | |
title: "builder_step1_" + G.data.group.goal + "_title1", | |
description: "builder_step1_" + G.data.group.goal + "_description1" | |
}, "monthly_income" == G.data.group.goal ? p(void 0, G.portfolio.goal === G.data.group.goal) : R && (G.data.group.goalAmount = R) | |
} | |
function _(t) { | |
var o = G.info.id; | |
"next" === t ? o = 3 === o ? 0 : o + 1 : "prev" === t && (o = 0 === o ? 3 : o - 1), M(o) | |
} | |
var A, R, w, G = this; | |
G.data = null, G.info = null, G.saving = !1, G.changeGoalAmount = s, G.changeGoalDuration = c, G.changeMonthlyInvestment = f, G.changeGroupMonthlyInvestment = y, G.changeGoalMonthlyIncome = p, G.changeInvestReminderDay = h, G.save = v, G.updateGoal = M, G.refreshPortfolioData = d, G.changeGoal = _, G.selectBackground = !1, i() | |
} | |
o.$inject = ["$scope", "$state", "wrnPortfolio", "wrnFlash", "wrnDialog", "moment", "wrnResources"], angular.module("warren.pages.portfolio.editgroup", []).controller("warrenPortfolioEditGroupController", o).directive("warrenPortfolioEditGroup", t), t.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function i() { | |
return { | |
templateUrl: "app/pages/portfoliogroup/pages/invites.template.html", | |
controller: o, | |
controllerAs: "c_groupinvites" | |
} | |
} | |
function o(i, o, r, t, e, n) { | |
function l() { | |
return o.id ? (f.id = o.id, void t.getById(f.id).then(function(i) { | |
f.portfolio = i; | |
var o = 1; | |
u(o), f.loading = !1 | |
}, function(i) { | |
r.go("404") | |
})) : void r.go("404") | |
} | |
function s() { | |
var i = n.getValue("portfolios_group_limit"); | |
try { | |
if (f.invites.length + f.portfolio.group.members.length >= i) return void e.error("error_portfolio_group_is_full") | |
} catch (i) {} | |
f.invites.push({ | |
email: "", | |
isAdmin: !0 | |
}), f.lastInput = f.invites.length - 1 | |
} | |
function a() { | |
for (var i = [], o = 0; o < f.invites.length; o++) f.invites[o].email && i.push(f.invites[o]); | |
return 0 == i.length ? e.error("Você deve incluir ao menos um e-mail!", { | |
raw: !0 | |
}) : (f.saving = !0, void(f.portfolio.isShared ? t.invite({ | |
portfolioId: f.id, | |
invites: i | |
}).then(function(i) { | |
r.go("portfolio", { | |
id: f.id | |
}) | |
}, function(i) { | |
f.saving = !1, e.error(i.message) | |
}) : t.share({ | |
portfolioId: f.id, | |
invites: i | |
}).then(function(i) { | |
r.go("portfolio", { | |
id: f.id | |
}) | |
}, function(i) { | |
f.saving = !1, e.error(i.message) | |
}))) | |
} | |
function u(i) { | |
for (var o = 0; o < i; o++) s() | |
} | |
var f = this; | |
f.sendInvites = a, f.loading = !0, f.addLine = s, f.invites = [], f.builder = o.builder, l() | |
} | |
o.$inject = ["$scope", "$stateParams", "$state", "wrnPortfolio", "wrnFlash", "wrnResources"], angular.module("warren.pages.portfoliogroupinvites", []).controller("warrenPortfolioGroupInvitesController", o).directive("warrenPortfolioGroupInvites", i), i.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
templateUrl: "app/pages/post/pages/posts.template.html", | |
controller: o, | |
controllerAs: "c_posts" | |
} | |
} | |
function o(t, o, n, e) { | |
function r() { | |
i.loading = !0, s() | |
} | |
function a(t) { | |
i.pagination = { | |
pages: t.pages, | |
totalPages: t.totalPages, | |
currentPage: t.currentPage, | |
previous: t.previous, | |
next: t.next, | |
last: t.totalPages, | |
total: t.total | |
} | |
} | |
function s(n) { | |
n !== !1 && (i.pagination && i.pagination.currentPage === n || t.all([o.getAll(n)]).then(function(t) { | |
i.posts = t[0].results, a(t[0]), i.loading = !1, e.toPosition(0) | |
}, function(t) { | |
console.error(t) | |
})) | |
} | |
function l(t) { | |
return t ? "ic_chevron_right_24px_black.svg" : "ic_chevron_right_24px_gray.svg" | |
} | |
var i = this; | |
i.getPosts = s, i.getChevronIcon = l, r() | |
} | |
o.$inject = ["$q", "wrnPost", "$state", "wrnSmoothScroll"], angular.module("warren.pages.posts", []).controller("warrenPostsController", o).directive("warrenPosts", t) | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, t) { | |
function n(t, n, r) { | |
for (var i = n[0].getElementsByClassName("wrn-form-item"), a = function(e) { | |
e.style.opacity = 1 | |
}, s = 0; s < i.length; s++) { | |
var c = i[s]; | |
e(a, 50 * s, !0, c) | |
} | |
} | |
return { | |
restrict: "A", | |
link: n, | |
scope: !1 | |
} | |
} | |
angular.module("warren.pages.register.directives.fadein", []).directive("wrnFadein", e), e.$inject = ["$timeout", "$parse"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/register/steps/step1.template.html", | |
controller: r, | |
controllerAs: "c_step1" | |
} | |
} | |
function r(e, r, t, i, s, o) { | |
function n() { | |
p.user = t.getCurrent(!0) | |
} | |
function a(e) { | |
c = e | |
} | |
function l() { | |
p.started = !0, 1 === p.c_register.getTab() && (p.c_register.started = !0) | |
} | |
function u() { | |
if (c.$submitted = !0, !c.$valid) return void f(); | |
var e = { | |
name: p.user.name, | |
personalProfile: { | |
fullName: p.user.personalProfile.fullName, | |
cpf: p.user.personalProfile.cpf, | |
birthDate: p.user.personalProfile.birthDate, | |
birthCity: p.user.personalProfile.birthCity, | |
birthState: p.user.personalProfile.birthState, | |
nationality: p.user.personalProfile.nationality, | |
sex: p.user.personalProfile.sex, | |
maritalStatus: p.user.personalProfile.maritalStatus, | |
partnerName: p.user.personalProfile.partnerName || void 0, | |
motherName: p.user.personalProfile.motherName, | |
profession: p.user.personalProfile.profession, | |
workOrganization: p.user.personalProfile.workOrganization, | |
education: p.user.personalProfile.education | |
} | |
}; | |
p.c_register.isSaving = !0, i.toPosition(0), t.update(e).then(function(r) { | |
o.track(p.user, "Register Step 1", { | |
sex: e.sex, | |
birthDate: e.birthDate, | |
birthState: e.birthState, | |
profession: e.profession, | |
maritalStatus: e.maritalStatus | |
}), p.c_register.setTab(2), p.c_register.isSaving = !1 | |
}, function(e) { | |
console.error(e); | |
var r = null; | |
if (e.errors) { | |
r = "<ul>"; | |
for (var t = 0; t < e.errors.length; t++) r += "<li>" + e.errors[t].msg + "</li>"; | |
r += "</ul>" | |
} | |
s.error(e.message, r), p.c_register.isSaving = !1 | |
}) | |
} | |
function f() { | |
function e(e, t) { | |
r(function() { | |
e.style.opacity = 1 | |
}, t) | |
} | |
function t(e, t) { | |
r(function() { | |
e.style.opacity = 0 | |
}, t) | |
} | |
for (var s in c) { | |
var o = c[s]; | |
if (o && o.$invalid) { | |
var n = document.getElementById(o.$name), | |
a = warren.utils.getGlobalOffset(n); | |
i.toPosition(a.top - 100), t(n, 500), e(n, 800), t(n, 1e3), e(n, 1200), t(n, 1400), e(n, 1600); | |
break | |
} | |
} | |
} | |
var c = null, | |
p = this; | |
p.c_register = e.$parent.c_register, p.user = null, p.registerForm = a, p.submit = u, p.started = !1, p.start = l, n() | |
} | |
angular.module("warren.pages.register.step1", []).controller("warrenRegisterStep1Controller", r).directive("warrenRegisterStep1", e), e.$inject = [], r.$inject = ["$scope", "$timeout", "wrnUser", "wrnSmoothScroll", "wrnFlash", "wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/register/steps/step2.template.html", | |
controller: r, | |
controllerAs: "c_step2" | |
} | |
} | |
function r(e, r, t, n, s, i) { | |
function o() { | |
f.user = t.getCurrent(!0) | |
} | |
function a(e) { | |
g = e | |
} | |
function l() { | |
f.started = !0 | |
} | |
function c() { | |
if (g.$submitted = !0, !g.$valid) return void u(); | |
var e = { | |
personalProfile: { | |
mobile: f.user.personalProfile.mobile | |
}, | |
address: f.user.address | |
}; | |
f.c_register.isSaving = !0, n.toPosition(0), t.update(e).then(function(r) { | |
i.track(f.user, "Register Step 2", { | |
state: e.address.state | |
}), f.c_register.setTab(3), f.c_register.isSaving = !1 | |
}, function(e) { | |
console.error(e); | |
var r = null; | |
if (e.errors) { | |
r = "<ul>"; | |
for (var t = 0; t < e.errors.length; t++) r += "<li>" + e.errors[t].msg + "</li>"; | |
r += "</ul>" | |
} | |
s.error(e.message, r), f.c_register.isSaving = !1 | |
}) | |
} | |
function u() { | |
function e(e, t) { | |
r(function() { | |
e.style.opacity = 1 | |
}, t) | |
} | |
function t(e, t) { | |
r(function() { | |
e.style.opacity = 0 | |
}, t) | |
} | |
for (var s in g) { | |
var i = g[s]; | |
if (i && i.$invalid) { | |
var o = document.getElementById(i.$name), | |
a = warren.utils.getGlobalOffset(o); | |
n.toPosition(a.top - 100), t(o, 500), e(o, 800), t(o, 1e3), e(o, 1200), t(o, 1400), e(o, 1600); | |
break | |
} | |
} | |
} | |
var g = null, | |
f = this; | |
f.c_register = e.$parent.c_register, f.user = null, f.registerForm = a, f.submit = c, f.started = !1, f.start = l, o() | |
} | |
angular.module("warren.pages.register.step2", []).controller("warrenRegisterStep2Controller", r).directive("warrenRegisterStep2", e), e.$inject = [], r.$inject = ["$scope", "$timeout", "wrnUser", "wrnSmoothScroll", "wrnFlash", "wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/register/steps/step3.template.html", | |
controller: n, | |
controllerAs: "c_step3" | |
} | |
} | |
function n(e, n, r, t, o, i, s, c) { | |
function a() { | |
B.user = t.getCurrent(!0), B.user.verifyBankError = function(e) { | |
return B.bankaccountErrors.indexOf(e) >= 0 | |
} | |
} | |
function u(e) { | |
$ = e | |
} | |
function l(e) { | |
y = e | |
} | |
function d() { | |
B.started = !0 | |
} | |
function f() { | |
if ($.$submitted = !0, y.$submitted = !0, !$.$valid) return void p($); | |
if (!y.$valid) return void p(y); | |
var n = B.user.$pendingAddBankAccounts, | |
r = B.user.$pendingRemoveBankAccounts, | |
t = n && n.length || r && r.length || A(B.user.bankAccounts, B.user.$pendingBankAccounts), | |
i = B.user.$pendingBankAccounts; | |
h(i, t).then(function(n) { | |
if (!n) { | |
for (var r = (B.user.$pendingRemoveBankAccount, 0); r < B.user.$pendingBankAccounts.length; r++) { | |
var t = B.user.$pendingBankAccounts[r]; | |
t.hasSecondHolder || (t.hasSecondHolder = !1, delete t.firstHolderCPF, delete t.firstHolderName) | |
} | |
B.user.bankAccounts = B.user.$pendingBankAccounts, B.c_register.isSaving = !0, o.toPosition(0), e.all([g(), m()]) | |
} | |
}) | |
} | |
function g() { | |
for (var n = [], r = B.user.$pendingRemoveBankAccounts || [], o = 0; o < r.length; o++) n.push(t.removeBankAccount(r[o]._id)); | |
e.all(n).then(function(e) { | |
for (o = 0; o < r.length; o++) | |
for (var n = r[o], t = B.user.bankAccounts.lenght - 1; t >= 0; t--) { | |
var i = B.user.bankAccounts[t]; | |
if (i._id === n._id) { | |
B.user.bankAccounts.splice(t, 1); | |
break | |
} | |
} | |
B.user.$pendingRemoveBankAccounts = [] | |
}, function(e) { | |
i.error(e.message) | |
}) | |
} | |
function m() { | |
var e = { | |
bankAccounts: B.user.bankAccounts, | |
investmentProfile: { | |
monthlyIncome: B.user.investmentProfile.monthlyIncome, | |
deposit: B.user.investmentProfile.deposit | |
} | |
}; | |
t.update(e).then(function(n) { | |
s.track(B.user, "Register Step 3", { | |
bank: e.bankAccounts.map(function(e) { | |
return e.bank | |
}), | |
monthlyIncome: e.investmentProfile.monthlyIncome, | |
patrimony: e.investmentProfile.deposit | |
}), B.user.$pendingAddBankAccounts = []; | |
for (var r = 0; r < e.bankAccounts.length; r++) | |
for (var t = 0; t < B.user.$pendingBankAccounts.length; t++) { | |
var o = n.bankAccounts[r], | |
i = B.user.$pendingBankAccounts[t]; | |
o.agency == i.agency && o.bank == i.bank && o.digit == i.digit && o.number == i.number && o.type == i.type && o.hasSecondHolder == i.hasSecondHolder && o.firstHolderCPF == i.firstHolderCPF && o.firstHolderName == i.firstHolderName && (i._id = o._id) | |
} | |
B.c_register.setTab(4), B.c_register.isSaving = !1 | |
}, function(e) { | |
console.error(e); | |
var n = null; | |
if (e.errors) { | |
n = "<ul>"; | |
for (var r = 0; r < e.errors.length; r++) n += "<li>" + e.errors[r].msg + "</li>"; | |
n += "</ul>" | |
} | |
i.error(e.message, n), B.user.$pendingAddBankAccounts = [], B.c_register.isSaving = !1 | |
}) | |
} | |
function p(e) { | |
for (var n in e) { | |
var r = e[n]; | |
if (r && r.$invalid) { | |
var t = document.getElementById(r.$name), | |
i = warren.utils.getGlobalOffset(t); | |
0 === i.top && r.$name.includes("billingbank") ? (t = document.getElementById(r.$name.replace("billingbank", "rowbank")), i = warren.utils.getGlobalOffset(t), o.toPosition(i.top - 100)) : (o.toPosition(i.top - 100), v(t)); | |
break | |
} | |
} | |
} | |
function v(e) { | |
function n(e, n) { | |
r(function() { | |
e && (e.style.opacity = 1) | |
}, n) | |
} | |
function t(e, n) { | |
r(function() { | |
e && (e.style.opacity = 0) | |
}, n) | |
} | |
t(e, 500), n(e, 800), t(e, 1e3), n(e, 1200), t(e, 1400), n(e, 1600) | |
} | |
function h(n, r) { | |
var t = [], | |
o = 0; | |
return e(function(e, i) { | |
if (!r) return e(!1); | |
if (n) { | |
B.bankaccountErrors = []; | |
for (var s = 0; s < n.length; s++) b(n[s]).then(function(r) { | |
if (r.invalid && t.push({ | |
index: o, | |
errors: r.errors | |
}), o++, s === n.length) return t.length ? (k(t), e(!0)) : e(!1) | |
}, function(r) { | |
if (s === n.length) return t.length ? (k(t), e(!0)) : e(!1) | |
}) | |
} | |
}) | |
} | |
function k(e) { | |
for (var n = [], r = 0; r < e.length; r++) | |
for (var t = 0; t < e[r].errors.length; t++) { | |
var i = e[r].errors[t].code + "_" + e[r].index, | |
s = document.getElementById(i); | |
B.bankaccountErrors.push(i), n.push(s) | |
} | |
if (n.length) { | |
for (var r = 0; r < n.length; r++) v(n[r]); | |
var c = warren.utils.getGlobalOffset(n[0]); | |
o.toPosition(c.top - 100) | |
} | |
} | |
function b(n) { | |
return e(function(e, r) { | |
return c.BankAccount ? void c.BankAccount.validate({ | |
bankNumber: n.bank, | |
agencyNumber: n.agency, | |
agencyCheckNumber: "", | |
accountNumber: n.number, | |
accountCheckNumber: n.digit, | |
valid: function() { | |
return e({ | |
invalid: !1 | |
}) | |
}, | |
invalid: function(n) { | |
if (!n) return e({ | |
invalid: !0 | |
}); | |
if (1 === n.errors.length && "INVALID_AGENCY_CHECK_NUMBER" === n.errors[0].code) return e({ | |
invalid: !1 | |
}); | |
if (n.errors.length) | |
for (var r = 0; r < n.errors.length; r++) "INVALID_AGENCY_CHECK_NUMBER" === n.errors[r].code && n.errors.splice(r, 1); | |
return e({ | |
invalid: !0, | |
errors: n.errors | |
}) | |
} | |
}) : r("moip_isnt_available") | |
}) | |
} | |
function A(e, n) { | |
for (var r = [], t = 0; t < n.length; t++) r[t] = JSON.parse(JSON.stringify(n))[t], delete r[t].$$hashKey, delete r[t].$dirtyBank, delete r[t].$other, delete r[t].$peste; | |
return Object.keys(warren.utils.deepdiff(e, r)).length > 0 | |
} | |
var $ = null, | |
y = null, | |
B = this; | |
B.c_register = n.$parent.c_register, B.user = null, B.registerForm1 = u, B.registerForm2 = l, B.submit = f, B.started = !1, B.start = d, B.bankaccountErrors = [], a() | |
} | |
n.$inject = ["$q", "$scope", "$timeout", "wrnUser", "wrnSmoothScroll", "wrnFlash", "wrnAnalytics", "wrnMoip"], angular.module("warren.pages.register.step3", []).controller("warrenRegisterStep3Controller", n).directive("warrenRegisterStep3", e), e.$inject = [] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/register/steps/step4.template.html", | |
controller: r, | |
controllerAs: "c_step4" | |
} | |
} | |
function r(e, r, t, s, n, o, i) { | |
function u() { | |
m.user = s.getCurrent(!0) | |
} | |
function a(e) { | |
f = e | |
} | |
function l() { | |
m.started = !0 | |
} | |
function c() { | |
f.$submitted = !0; | |
var e = m.user.document.imageFront && m.user.address.imageFront; | |
if (!f.$valid || !e) return void(m.user.acceptedTerms && d()); | |
if (!m.user.personalProfile.isExposed || m.user.personalProfile.isExposedAsPublicServant || m.user.personalProfile.isExposedAsGovernmentServant || m.user.personalProfile.isExposedByRelationship) { | |
var u = { | |
document: { | |
issueDate: m.user.document.issueDate, | |
issuedBy: m.user.document.issuedBy, | |
number: m.user.document.number, | |
state: m.user.document.state, | |
type: m.user.document.type | |
}, | |
personalProfile: { | |
isExposed: m.user.personalProfile.isExposed, | |
isExposedAsPublicServant: m.user.personalProfile.isExposedAsPublicServant, | |
isExposedAsGovernmentServant: m.user.personalProfile.isExposedAsGovernmentServant, | |
isExposedByRelationship: m.user.personalProfile.isExposedByRelationship | |
}, | |
termsToAccept: m.user.termsToAccept | |
}; | |
m.c_register.isSaving = !0, n.toPosition(0), s.update(u).then(function(e) { | |
t(function() { | |
"invite" == m.user.unlockedVia && i.track(m.user, "Invite Converted", {}), i.pixelFB("Register Step 4"), i.track(m.user, "Register Step 4", {}), m.c_register.isSaving = !1 | |
}, 300), r.go("dash") | |
}, function(e) { | |
console.error(e); | |
var r = null; | |
if (e.errors) { | |
r = "<ul>"; | |
for (var t = 0; t < e.errors.length; t++) r += "<li>" + e.errors[t].msg + "</li>"; | |
r += "</ul>" | |
} | |
o.error(e.message, r), m.c_register.isSaving = !1 | |
}) | |
} | |
} | |
function p(e) { | |
e && (m.user.document.state = e) | |
} | |
function d(e) { | |
function r(e, r) { | |
t(function() { | |
e && (e.style.opacity = 1) | |
}, r) | |
} | |
function s(e, r) { | |
t(function() { | |
e && (e.style.opacity = 0) | |
}, r) | |
} | |
function o(e) { | |
s(e, 500), r(e, 800), s(e, 1e3), r(e, 1200), s(e, 1400), r(e, 1600) | |
} | |
if (m.user.document.imageFront) { | |
if (!m.user.address.imageFront) { | |
var i = document.getElementById("addressError"), | |
u = warren.utils.getGlobalOffset(i); | |
n.toPosition(u.top - 100), o(i) | |
} | |
} else { | |
var i = document.getElementById("documentError"), | |
u = warren.utils.getGlobalOffset(i); | |
n.toPosition(u.top - 100), o(i) | |
} | |
for (var a in e) { | |
var l = e[a]; | |
if (l && l.$invalid) { | |
var i = document.getElementById(l.$name), | |
u = warren.utils.getGlobalOffset(i); | |
n.toPosition(u.top - 100), o(i); | |
break | |
} | |
} | |
} | |
var f = null, | |
m = this; | |
m.c_register = e.$parent.c_register, m.user = null, m.registerForm = a, m.submit = c, m.started = !1, m.start = l, m.updateState = p, u() | |
} | |
angular.module("warren.pages.register.step4", []).controller("warrenRegisterStep4Controller", r).directive("warrenRegisterStep4", e), e.$inject = [], r.$inject = ["$scope", "$state", "$timeout", "wrnUser", "wrnSmoothScroll", "wrnFlash", "wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function a() { | |
return { | |
templateUrl: "app/pages/ricometro/blocks/ricometro.result.html", | |
controller: t, | |
controllerAs: "c_ricometroResult" | |
} | |
} | |
function t(a, t, e, r, n, o, s) { | |
function l() { | |
w.data.salary <= 3e3 ? w.data.initialInvestment = 5e3 : w.data.initialInvestment = 1e4, w.data.monthlyInvestment = .1 * w.data.salary, w.updateInfo(); | |
try { | |
e.pageView("ricometroResult") | |
} catch (a) {} | |
} | |
function i() { | |
w.isStarted = !0 | |
} | |
function c() { | |
wrnSmoothScroll.toPosition(1e5, 0) | |
} | |
function u(a, t) { | |
var e = w.data[a], | |
r = e + (t || 0); | |
r >= 0 && (w.data[a] = r, d()) | |
} | |
function d() { | |
w.data.wage = w.data.salary / w.data.workHoursPerMonth, w.data.totalSavings = warren.finance.futureValue(w.data.initialInvestment, 12 * w.data.goalYears, w.benchmarks.savings, w.data.monthlyInvestment), w.data.totalWarren = warren.finance.futureValue(w.data.initialInvestment, 12 * w.data.goalYears, w.benchmarks.warren, w.data.monthlyInvestment), w.data.lostMoney = w.data.totalWarren - w.data.totalSavings; | |
var a = w.data.lostMoney / w.data.wage; | |
w.data.hours = Math.floor(a) | |
} | |
function m() { | |
a.go("suitability") | |
} | |
var w = this; | |
w.data = { | |
salary: t.salary || 3e3, | |
workHoursPerMonth: 180, | |
goalYears: 10, | |
hours: 8 | |
}, w.benchmarks = { | |
savings: .0061, | |
warren: .009435 | |
}, w.start = i, w.scroll = c, w.updateInfo = d, w.updateValue = u, w.goSuita = m, l() | |
} | |
angular.module("warren.pages.ricometroResult", []).controller("warrenRicometroResultController", t).directive("warrenRicometroResult", a), a.$inject = [], t.$inject = ["$state", "$stateParams", "wrnAnalytics", "wrnUser", "wrnFlash", "wrnHistory", "wrnSession"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/style/pages/assets.template.html", | |
controller: t, | |
controllerAs: "c_assets" | |
} | |
} | |
function t(e) {} | |
angular.module("warren.pages.style.assets", []).controller("warrenAssetsController", t).directive("warrenStyleAssets", e), e.$inject = [], t.$inject = ["wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/style/pages/buttons.template.html", | |
controller: e, | |
controllerAs: "c_buttons" | |
} | |
} | |
function e(t) {} | |
angular.module("warren.pages.style.buttons", []).controller("warrenButtonsController", e).directive("warrenStyleButtons", t), t.$inject = [], e.$inject = ["wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function r() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/style/pages/colors.template.html", | |
controller: e, | |
controllerAs: "c_colors" | |
} | |
} | |
function e(r) {} | |
angular.module("warren.pages.style.colors", []).controller("warrenColorsController", e).directive("warrenStyleColors", r), r.$inject = [], e.$inject = ["wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/style/pages/components.template.html", | |
controller: n, | |
controllerAs: "c_components" | |
} | |
} | |
function n(e) {} | |
angular.module("warren.pages.style.components", []).controller("warrenComponentsController", n).directive("warrenStyleComponents", e), e.$inject = [], n.$inject = ["wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function r() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/style/pages/forms.template.html", | |
controller: e, | |
controllerAs: "c_forms" | |
} | |
} | |
function e(r) {} | |
angular.module("warren.pages.style.forms", []).controller("warrenFormsController", e).directive("warrenStyleForms", r), r.$inject = [], e.$inject = ["wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/style/pages/javascript.template.html", | |
controller: r, | |
controllerAs: "c_javascript" | |
} | |
} | |
function r(t) {} | |
angular.module("warren.pages.style.javascript", []).controller("warrenJavascriptController", r).directive("warrenStyleJavascript", t), t.$inject = [], r.$inject = ["wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/style/pages/layout.template.html", | |
controller: e, | |
controllerAs: "c_layout" | |
} | |
} | |
function e(t) {} | |
angular.module("warren.pages.style.layout", []).controller("warrenLayoutController", e).directive("warrenStyleLayout", t), t.$inject = [], e.$inject = ["wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function r() { | |
return { | |
scope: {}, | |
templateUrl: "app/pages/style/pages/typography.template.html", | |
controller: e, | |
controllerAs: "c_typography" | |
} | |
} | |
function e(r) {} | |
angular.module("warren.pages.style.typography", []).controller("warrenTypographyController", e).directive("warrenStyleTypography", r), r.$inject = [], e.$inject = ["wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function e(e, n, r, t, o, i, s, a, u) { | |
function c() { | |
try { | |
t.pageView("account") | |
} catch (e) {} | |
o.getCurrent().then(function(e) { | |
w.user = e, w.showUnderApproval = e.isRegisterVerified && e.isRegisterModified, w.user.verifyBankError = function(e) { | |
return w.bankaccountErrors.indexOf(e) >= 0 | |
} | |
}, function(e) { | |
console.error(e) | |
}) | |
} | |
function l(e) { | |
return e === N | |
} | |
function d(e) { | |
N = e | |
} | |
function f(e) { | |
E.push(e) | |
} | |
function g() { | |
if (!w.isSubmitted && v()) { | |
var e = w.user.$pendingAddBankAccounts, | |
n = w.user.$pendingRemoveBankAccounts, | |
r = e && e.length || n && n.length || y(w.user.bankAccounts, w.user.$pendingBankAccounts), | |
t = w.user.$pendingBankAccounts; | |
A(t, r).then(function(e) { | |
e || (w.isSubmitted = !0, w.user.isRegisterValidated && w.user.isRegisterVerified ? a.password("Entre com sua senha", "", { | |
textCancel: "Cancelar", | |
textOk: "Enviar" | |
}).then(function(e) { | |
"ok" === e.response ? (p(e.value), w.isSubmitted = !1) : w.isSubmitted = !1 | |
}) : p()) | |
}) | |
} | |
} | |
function v() { | |
for (var e = !1, n = 0; n < E.length; n++) { | |
var r = E[n]; | |
r.$submitted = !0; | |
var t = w.user.document.imageFront && w.user.address.imageFront; | |
if (!r.$valid && n >= 0 || 4 === n && !t) { | |
e = !0, 0 === n ? d(1) : 1 === n ? d(2) : 2 === n ? d(3) : 3 === n ? d(3) : 4 === n && d(4), b(r); | |
break | |
} | |
} | |
return w.user.personalProfile.isExposed && (w.user.personalProfile.isExposedByRelationship || w.user.personalProfile.isExposedAsPublicServant || w.user.personalProfile.isExposedAsGovernmentServant || (e = !0)), !e | |
} | |
function p(n) { | |
w.isSaving = !0; | |
for (var r = (w.user.$pendingRemoveBankAccount, 0); r < w.user.$pendingBankAccounts.length; r++) { | |
var t = w.user.$pendingBankAccounts[r]; | |
t.hasSecondHolder || (t.hasSecondHolder = !1, delete t.firstHolderCPF, delete t.firstHolderName) | |
} | |
w.user.bankAccounts = w.user.$pendingBankAccounts, e.all([m(), h(n)]) | |
} | |
function m() { | |
for (var n = [], r = w.user.$pendingRemoveBankAccounts || [], t = 0; t < r.length; t++) n.push(o.removeBankAccount(r[t]._id)); | |
e.all(n).then(function(e) { | |
for (t = 0; t < r.length; t++) { | |
for (var n = r[t], o = w.user.bankAccounts.lenght - 1; o >= 0; o--) { | |
var i = w.user.bankAccounts[o]; | |
if (i._id === n._id) { | |
w.user.bankAccounts.splice(o, 1); | |
break | |
} | |
} | |
w.user.$pendingRemoveBankAccounts = [] | |
} | |
}, function(e) { | |
s.error(e.message) | |
}) | |
} | |
function h(e) { | |
o.update(w.user, e).then(function(e) { | |
w.showUnderApproval = e.isRegisterVerified && e.isRegisterModified, w.user.$pendingAddBankAccounts = []; | |
for (var n = 0; n < e.bankAccounts.length; n++) | |
for (var r = 0; r < w.user.$pendingBankAccounts.length; r++) { | |
var t = e.bankAccounts[n], | |
o = w.user.$pendingBankAccounts[r]; | |
t.agency == o.agency && t.bank == o.bank && t.digit == o.digit && t.number == o.number && t.type == o.type && t.hasSecondHolder == o.hasSecondHolder && t.firstHolderCPF == o.firstHolderCPF && t.firstHolderName == o.firstHolderName && (o._id = t._id) | |
} | |
w.isSaving = !1, w.isSubmitted = !1, i.toPosition(0), s.success("Seus dados foram atualizados", { | |
raw: !0 | |
}) | |
}, function(e) { | |
console.error(e); | |
var n = null; | |
if (e.errors) { | |
n = "<ul>"; | |
for (var r = 0; r < e.errors.length; r++) n += "<li>" + e.errors[r].msg + "</li>"; | |
n += "</ul>" | |
} | |
s.error(e.message, n), w.isSaving = !1, w.isSubmitted = !1, w.user.$pendingAddBankAccounts = [] | |
}) | |
} | |
function b(e) { | |
if (w.user.document.imageFront) { | |
if (!w.user.address.imageFront) { | |
var n = document.getElementById("addressError"), | |
r = warren.utils.getGlobalOffset(n); | |
i.toPosition(r.top - 100), k(n) | |
} | |
} else { | |
var n = document.getElementById("documentError"), | |
r = warren.utils.getGlobalOffset(n); | |
i.toPosition(r.top - 100), k(n) | |
} | |
for (var t in e) { | |
var o = e[t]; | |
if (o && o.$invalid) { | |
var n = document.getElementById(o.$name), | |
r = warren.utils.getGlobalOffset(n); | |
0 === r.top && o.$name.includes("billingbank") ? (n = document.getElementById(o.$name.replace("billingbank", "rowbank")), r = warren.utils.getGlobalOffset(n), i.toPosition(r.top - 100)) : (i.toPosition(r.top - 100), k(n)); | |
break | |
} | |
} | |
} | |
function k(e) { | |
function n(e, n) { | |
r(function() { | |
e && (e.style.opacity = 1) | |
}, n) | |
} | |
function t(e, n) { | |
r(function() { | |
e && (e.style.opacity = 0) | |
}, n) | |
} | |
t(e, 500), n(e, 800), t(e, 1e3), n(e, 1200), t(e, 1400), n(e, 1600) | |
} | |
function A(n, r) { | |
var t = [], | |
o = 0; | |
return e(function(e, i) { | |
if (!r) return e(!1); | |
if (n) { | |
w.bankaccountErrors = []; | |
for (var s = 0; s < n.length; s++) B(n[s]).then(function(r) { | |
if (r.invalid && t.push({ | |
index: o, | |
errors: r.errors | |
}), o++, o === n.length) return t.length ? ($(t), e(!0)) : e(!1) | |
}, function(r) { | |
if (o === n.length) return t.length ? ($(t), e(!0)) : e(!1) | |
}) | |
} | |
}) | |
} | |
function $(e) { | |
for (var n = [], r = 0; r < e.length; r++) | |
for (var t = 0; t < e[r].errors.length; t++) { | |
var o = e[r].errors[t].code + "_" + e[r].index, | |
s = document.getElementById(o); | |
w.bankaccountErrors.push(o), n.push(s) | |
} | |
if (n.length) { | |
for (var r = 0; r < n.length; r++) k(n[r]); | |
var a = warren.utils.getGlobalOffset(n[0]); | |
i.toPosition(a.top - 100) | |
} | |
} | |
function B(n) { | |
return e(function(e, r) { | |
return u.BankAccount ? void u.BankAccount.validate({ | |
bankNumber: n.bank, | |
agencyNumber: n.agency, | |
agencyCheckNumber: "", | |
accountNumber: n.number, | |
accountCheckNumber: n.digit, | |
valid: function() { | |
return e({ | |
invalid: !1 | |
}) | |
}, | |
invalid: function(n) { | |
if (!n) return e({ | |
invalid: !0 | |
}); | |
if (1 === n.errors.length && "INVALID_AGENCY_CHECK_NUMBER" === n.errors[0].code) return e({ | |
invalid: !1 | |
}); | |
if (n.errors.length) | |
for (var r = 0; r < n.errors.length; r++) "INVALID_AGENCY_CHECK_NUMBER" === n.errors[r].code && n.errors.splice(r, 1); | |
return e({ | |
invalid: !0, | |
errors: n.errors | |
}) | |
} | |
}) : r("moip_isnt_available") | |
}) | |
} | |
function y(e, n) { | |
for (var r = [], t = 0; t < n.length; t++) r[t] = JSON.parse(JSON.stringify(n))[t], delete r[t].$$hashKey, delete r[t].$dirtyBank, delete r[t].$other, delete r[t].$peste; | |
return Object.keys(warren.utils.deepdiff(e, r)).length > 0 | |
} | |
var E = [], | |
S = n.$parent.c_user; | |
S.navbarTitle = "Dados cadastrais"; | |
var w = this; | |
w.isTab = l, w.setTab = d, w.registerForm = f, w.submit = g, w.isSaving = !1, w.isSubmitted = !1, w.showUnderApproval = !1, w.bankaccountErrors = [], c(); | |
var N = 1 | |
} | |
e.$inject = ["$q", "$scope", "$timeout", "wrnAnalytics", "wrnUser", "wrnSmoothScroll", "wrnFlash", "wrnDialog", "wrnMoip"], warren.angular.controller("warren.pages.user.account", e) | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
templateUrl: "app/pages/user/pages/contact.template.html", | |
controller: e, | |
controllerAs: "c_contact" | |
} | |
} | |
function e(t, e) { | |
function n() { | |
try { | |
e.pageView("contact") | |
} catch (t) {} | |
} | |
var r = t.$parent.c_user; | |
r.navbarTitle = "Contato", n() | |
} | |
angular.module("warren.pages.user.contact", []).controller("warrenContactController", e).directive("warrenUserContact", t), t.$inject = [], e.$inject = ["$scope", "wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/user/pages/email.template.html", | |
controller: n, | |
controllerAs: "c_email" | |
} | |
} | |
function n(e, n, r, a) { | |
function t() { | |
try { | |
n.pageView("email") | |
} catch (e) {} | |
r.getCurrent().then(function(e) { | |
l.user = e | |
}, function(e) { | |
console.error(e) | |
}) | |
} | |
function i(e) { | |
e.$setSubmitted(!0), e.$invalid || (l.isSaving = !0, r.updateEmail(l.data.currentPassword, l.data.newEmail).then(function() { | |
l.isSaving = !1, a.success("E-mail enviado para confirmação", { | |
raw: !0 | |
}) | |
}, function(e) { | |
l.isSaving = !1, a.error(e.message) | |
})) | |
} | |
var l = this, | |
s = e.$parent.c_user; | |
s.navbarTitle = "Trocar e-mail", l.data = { | |
currentPassword: null, | |
newEmail: null | |
}, l.isSaving = !1, l.submit = i, t() | |
} | |
angular.module("warren.pages.user.email", []).controller("warrenEmailController", n).directive("warrenUserEmail", e), e.$inject = [], n.$inject = ["$scope", "wrnAnalytics", "wrnUser", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function t() { | |
return { | |
templateUrl: "app/pages/user/pages/notifications.template.html", | |
controller: n, | |
controllerAs: "c_notifications" | |
} | |
} | |
function n(t, n) { | |
function i() { | |
try { | |
n.pageView("notifications") | |
} catch (t) {} | |
} | |
var e = t.$parent.c_user; | |
e.navbarTitle = "Notificações", i() | |
} | |
angular.module("warren.pages.user.notifications", []).controller("warrenNotificationsController", n).directive("warrenUserNotifications", t), t.$inject = [], n.$inject = ["$scope", "wrnAnalytics"] | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/user/pages/password.template.html", | |
controller: s, | |
controllerAs: "c_password" | |
} | |
} | |
function s(e, s, r, a) { | |
function n() { | |
try { | |
s.pageView("password") | |
} catch (e) {} | |
r.getCurrent().then(function(e) { | |
i.user = e | |
}, function(e) { | |
a.error(e.message), console.error(e) | |
}) | |
} | |
function o(e) { | |
e.$setSubmitted(!0), e.$invalid || (i.isSaving = !0, r.updatePassword(i.data.oldPass, i.data.newPass).then(function() { | |
i.isSaving = !1, a.success("Senha alterada com sucesso", { | |
raw: !0 | |
}) | |
}, function(e) { | |
i.isSaving = !1, a.error(e.message), console.error(e) | |
})) | |
} | |
function t() { | |
i.isSaving = !0, console.log(i), r.reset(i.user.email).then(function(e) { | |
e ? (a.error(e.message), console.error(e)) : a.success("Um link para resetar sua senha foi enviado para o seu e-mail", { | |
raw: !0 | |
}), i.isSaving = !1 | |
}) | |
} | |
var i = this, | |
l = e.$parent.c_user; | |
l.navbarTitle = "Trocar senha", i.data = { | |
oldPass: null, | |
newPass: null, | |
confirmPass: null | |
}, i.isSaving = !1, i.submit = o, i.doReset = t, i.user = null, n() | |
} | |
angular.module("warren.pages.user.password", []).controller("warrenPasswordController", s).directive("warrenUserPassword", e), e.$inject = [], s.$inject = ["$scope", "wrnAnalytics", "wrnUser", "wrnFlash"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, o, r, a) { | |
function e() { | |
try { | |
r.pageView("quotes") | |
} catch (n) {} | |
a.getInvestmentSummary().then(function(t) { | |
m.summary = t, n.isLoading = !1 | |
}) | |
} | |
function i(n) { | |
n === m.accordionTab ? m.accordionTab = null : m.accordionTab = n | |
} | |
function u(n) { | |
s(n) && t.go("quotes", { | |
fundId: n | |
}) | |
} | |
function s(n) { | |
return m.summary && m.summary.positions.hasOwnProperty(n) | |
} | |
function c(n) { | |
if (!m.summary) return "0"; | |
var t = m.summary.positions[n]; | |
return t && t.quantity ? o("money")(t.quantity, "", 2) : "0" | |
} | |
var m = this, | |
f = n.$parent.c_user; | |
f.navbarTitle = "Meus Investimentos", m.accordionTab = null, m.setAccordion = i, m.formatQuote = c, m.hasQuote = s, m.goTo = u, m.funds = {}, n.isLoading = !0, e() | |
} | |
n.$inject = ["$scope", "$state", "$filter", "wrnAnalytics", "wrnTransaction"], warren.angular.controller("warren.pages.user.quotes", n) | |
}(); | |
! function() { | |
"use strict"; | |
function e() { | |
return { | |
templateUrl: "app/pages/user/pages/riskprofile.template.html", | |
controller: r, | |
controllerAs: "c_riskprofile" | |
} | |
} | |
function r(e, r, t) { | |
function i() { | |
try { | |
r.pageView("riskprofile") | |
} catch (e) {} | |
t.getCurrent().then(function(e) { | |
var r = e.investmentProfile.computedProfileType; | |
l.user = e, l.title = "profile_" + r + "_title", l.subtitle = "profile_" + r + "_subtitle", l.description = "profile_" + r + "_description_tw" | |
}, function(e) { | |
console.error(e) | |
}) | |
} | |
var l = this, | |
n = e.$parent.c_user; | |
n.navbarTitle = "Perfil de risco", l.title = null, l.subtitle = null, l.description = null, i() | |
} | |
angular.module("warren.pages.user.riskprofile", []).controller("warrenRiskprofileController", r).directive("warrenUserRiskprofile", e), e.$inject = [], r.$inject = ["$scope", "wrnAnalytics", "wrnUser"] | |
}(); | |
! function() { | |
"use strict"; | |
function n(n, t, r, a) { | |
function o() { | |
try { | |
r.pageView("terms") | |
} catch (n) {} | |
a.getInvestmentSummary().then(function(t) { | |
c.summary = t, n.isLoading = !1 | |
}) | |
} | |
function i(n) { | |
n === c.accordionTab ? c.accordionTab = null : c.accordionTab = n | |
} | |
function e(n) { | |
if (!c.summary) return "0"; | |
var r = c.summary.positions[n]; | |
return r && r.quantity ? t("money")(r.quantity, "", 2) : "0" | |
} | |
var c = this, | |
s = n.$parent.c_user; | |
s.navbarTitle = "Documentos e Contratos", c.accordionTab = null, c.setAccordion = i, c.formatQuote = e, c.funds = {}, n.isLoading = !0, o() | |
} | |
n.$inject = ["$scope", "$filter", "wrnAnalytics", "wrnTransaction"], warren.angular.controller("warren.pages.user.terms", n) | |
}(); | |
//# sourceMappingURL=/js/app-3b47c9b.min.js.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment