window.cura = window.cura || {}; (function() {if(window.rEditor){return};if(!cura.css){var h=document.createElement('style');h.type = 'text/css';h.innerHTML=".curaForgot { font-size: 12px; padding:5px 0 10px; color:#2da4a8; cursor:pointer } #curaLogin,#curaSMS { background: #fff; border-radius: 8px; position: fixed; top: 100px; left: 15px; right: 15px; color: #999; padding: 22px 15px; max-width: 300px; margin: auto; opacity: 1; transform-origin: 50% 0; -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,.12); -moz-box-shadow: 0 2px 4px 0 rgba(0,0,0,.12); box-shadow: 0 2px 4px 0 rgba(0,0,0,.12); z-index: 1000; text-align:center; transition: opacity .2s; opacity:0; display:none; transition: all 0.5s ease; } #curaAlert { background: #ffeca0; border-radius: 8px; position: fixed; top: 10px; left: 15px; right: 15px; color: #000; padding: 10px 15px 14px; font-size:.9em; max-width: 350px; margin: auto; -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,.12); -moz-box-shadow: 0 2px 4px 0 rgba(0,0,0,.12); box-shadow: 0 2px 4px 0 rgba(0,0,0,.12); z-index: 1000; opacity: 0; display:none; transition: opacity .2s; z-index: 2000; } #curaModal { position:fixed; top:0; bottom:0; left:0; right:0; background:#DDE1E0; overflow-y:auto !important; overflow-x:hidden; color:black; -webkit-overflow-scrolling: touch !important; -webkit-perspective: 0; background: linear-gradient(305deg, #09a6a7, #534ca0); background-size: 400% 400%; color:white; -webkit-animation: nM 28s ease infinite; -moz-animation: nM 28s ease infinite; animation: nM 28s ease infinite; z-index:999; transition: opacity .2s; opacity:0; display:none; } #curaLogin label { -webkit-font-smoothing: antialiased; user-select: none; position: absolute; top: 38px; transition: all 450ms cubic-bezier(.23,1,.32,1) 0s; z-index: 1; transform: scale(1) translate(5px,0) translateZ(0); line-height: 22px; pointer-events: none; color: #bfbfbf; font-weight: 500; font-size: 14px; transform-origin: left top 0; } .curaF { max-width: 206px; line-height: 24px; width: 256px; height: 72px; display: block; position: relative; margin: -6px auto; overflow: hidden; } #curaLogin hr { border: 0; border-bottom: 1px solid #e0e0e0; bottom: 7px; box-sizing: content-box; margin: 0; position: absolute; width: 100%; } #curaLogin hr.sel { transform: scaleX(0); transition: all 450ms cubic-bezier(.23,1,.32,1) 0s; border-bottom: #2da4a8 2px solid; } .curaGreen { color:#2da4a8 } .curaButton { min-width:100px; margin: 22px auto 30px; border-radius: 60px; padding: 9px 43px; font-size: .9em; cursor: pointer; color: #fff; background: #2da4a8; -webkit-tap-highlight-color: transparent; outline: 0; border:0; display:inline-block; text-align:center; } .curaButton.purple { background:#524c9b; color:#fff; } .curaButton.white { background:#fff; color:#524c9b; } .curaButton:disabled { background:#ccc; } .curaEmail { display:block; margin:0 auto; max-width: 250px; font-size:1.1em; border-radius:4px; border:1px solid #999; padding: 6px 6px; } .curaTxt { -webkit-appearance: textfield; -webkit-tap-highlight-color: transparent; width: 100%; border: none; outline: 0; background-color: rgba(0,0,0,0); color: rgba(0,0,0,.870588); position: relative; padding: 0 5px; height: 100%; box-sizing: border-box; margin: 14px 0 0; box-shadow: #fff 0 0 0 1000px inset; font-size: 1em; } #curaAccept { margin: 0 6px; float: left; } .curaTerms { padding: 12px 0 3px; font-size: .8em; overflow: hidden; margin: 0 auto; display:inline-block; } .curaCBox { text-align:center; } #curaLogin h2 { font-size: 1.2em; color: #333; margin: 0 0 6px; padding: 0; font-weight: 400; } #curaLogin .a { color: #2da4a8; } #curaSwitch { color:white; position:absolute; text-align:center; bottom: -100px; left:0; right:0; padding: 10px; border-radius:30px; background:rgba(255,255,255,.1); font-size:.8em; max-width: 225px; margin: auto; } .curaSign, #curaSubForgot { display:none; } .curaSwitch { cursor:pointer; } #curaX { cursor:pointer; padding:7px 18px 30px 30px; color:white; font-size:2em; position:absolute; top:0; right:0; } #curaSwitch .a { color:white; text-decoration: underline; } #curaLoad { position: absolute; right: 6px; bottom: 10px; height: 26px; display:none; } .curaIfLoggedIn, .curaHideOffer { display:none; } .curaPurchaseInline { max-width:330px; margin:0 auto; } .curaInterest { display:none; padding-top:15px; } #curaAddToCal { background:#fff; box-shadow: rgba(0,0,0,0.3) 0px 9px 25px; width:215px; z-index:99999999; border-radius:6px; display:none; position: absolute; } #curaAddToCal div { padding:10px 10px 10px 50px; cursor:pointer; position:relative } #curaAddToCal div:hover { background:rgba(0,0,3,.03) } #curaAddToCal svg { width:20px;height:20px; position:absolute; top:9px; left:13px; } .curaCalG { color:#777; font-style: italic; font-size:.85em; } #curaSMS h2 { margin:10px 0 0 } #curaSMSTel { display:block; margin:20px auto 10px; max-width: 250px; font-size:1.3em; text-align:center; border-radius:4px; border:1px solid #999; padding: 6px 6px; } /* slvg */ .curaEditTitle, .curaOfferSuccess { display:none; } .editor .curaEditTitle { background: #f0f0f0; text-align: right; padding: 5px 15px; border-top-right-radius: 8px; border-top-left-radius: 8px; display: inline-block; float: right; margin-top: -30px } .editor .curaEditBox { border: 3px dashed #f0f0f0; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; border-top-left-radius: 8px; } .curaEditBox { margin: 50px 0 30px; } .curaSlvgBox { max-width:800px; margin:0 auto; } .curaSlvgTitle { padding: 0; text-align:left; font-size:1.2em; margin: 10px 31px 45px; } .curaSlvgP { margin: 10px 31px 25px; } #curaSlvgCardContainer { display:flex; align-items:center; justify-content: center; gap: 20px; /*height:400px;*/ flex-wrap:wrap; } .curaSlvgCard { height: 325px; width: 200px; border-radius:20px; border-color: #fcc973; border-width: 8px; border-style: solid; display: flex; flex-direction: column; gap: 8px; } .curaSlvgCard:hover{ cursor:pointer; transform: scale(1.05); } .curaSlvgCard img{ width:100%; height:100px; object-fit: cover; } .curaSlvgCard p{ font-size: 0.9em; } .curaSlvgCard h3{ font-size: 1.06em; } .curaSurveyAnswer { border-top: 1px solid #e4e4e4; border-bottom: 1px solid #e4e4e4; padding: 17px 15px; margin:-1px 25px 0; cursor: pointer; } .curaSurveyAnswer:hover { color:#2da4a8; } .curaOffers { margin-top: 60px; display:none; } .curaOffer { border-radius: 15px; border: 1px solid #524c9b; margin: 30px auto; cursor: pointer; width: 350px; background:#f7f7f7; } .curaOffer .curaButton { float:left; padding:10px 15px; margin: 0px 5px 12px; } .curaButton.single { max-width:100px; } .curaOfferTop { padding: 20px 20px 10px; text-align: center; } .curaOffer h3 { margin: 0 0 13px; color:#000; text-align: left; } .curaOffer p { margin: 0 0 13px; color:#000; text-align: left; font-size:.85em; } .curaOfferBottom { padding: 0 18px 10px; display: flex; } .curaOfferBottom .curaButton { flex: 1; width: 50%; } .curaSlvgPage { position:fixed; top:50px; bottom:50px; left:10px; right:10px; border-radius:10px; overflow-y:auto !important; overflow-x:hidden; -webkit-overflow-scrolling: touch !important; background: #fff; z-index:1000; transition: opacity .2s; opacity:0; display:none; padding:13px; max-width:600px; margin:0 auto; } .curaSlvgX { cursor:pointer; position:absolute; top:5px; right:0; padding:0 14px 20px; font-size:2em; } .editor .curaOffers, .editor .curaOfferSuccess { display:block; } .editor .curaSlvgPage { display:block; opacity:1; position:relative; padding:0 0 50px; overflow:visible !important; z-index:0; } .centerTxt { text-align:center; } .curaBLink { text-decoration:underline; padding:10px 0 2px; margin: 10px auto; cursor: pointer; display:inline-block; } .curaSlvgSys { margin-top:30px; } .curaSlvgSysA { max-width:400px; margin: 20px auto; clear:both; } .curaSlvgSys ul, .curaSlvgSys p { padding: 0 25px 10px; } "; cura.css=1;document.getElementsByTagName('head')[0].appendChild(h);}})();;(function() {if(window.rEditor){return};if(!cura.html){var h=document.createElement('div');h.innerHTML="
"; cura.html=1;var chk=function(){var a=document.body;console.log('try',a);a?a.appendChild(h):setTimeout(chk,100)};};chk();})();
(function () {
'use strict';
if(window.rEditor){
return
}
//var cura = window.cura || {},
var url = '/login'
cura.toSignup = function(){
cura.tog(1)
cura.alert()
url = '/newaccount'
cura.show('curaForgot',1)
if(cura.afterSignup) cura.afterSignup()
}
cura.toLogin = function(){
cura.tog(0)
cura.alert()
url = '/login'
cura.show('curaForgot')
}
cura.show = function(id, doHide){
var d = document.getElementById(id)
if(d) d.style.display = doHide? 'none': 'block'
}
var app = window.app
app = app || {}
app.action = app.action || {};
app.action.LoginToSignUp = cura.toSignup
window.app = app;
cura.getCookie = function(name){
var b = document.cookie.match('(^|[^;]+)\\s*' + a + '\\s*=\\s*([^;]+)');
return b ? b.pop() : '';
}
cura.getUrlParam = function(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^]*)'),
results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
cura.lbls = function(el, isFocus) {
var t = el.target,
pa = t.parentNode,
l = pa.getElementsByTagName('label')[0],
hr = pa.getElementsByClassName('sel')[0];
if(isFocus || t.value) {
l.style.transform = "scale(0.75) translate(0px, -28px)"
} else {
l.style.transform = "scale(1) translate(5px, 0px)"
}
if(isFocus){
hr.style.transform = "scaleX(1)"
} else {
hr.style.transform = "scaleX(0)"
}
}
cura.retry = {
cur: 250,
backoff: function(toRetry, r){
console.log('register backoff', cura.retry.cur)
setTimeout(function(){console.log('backoff fired'); toRetry() }, cura.retry.cur *= 2)
},
reset: function(){
cura.retry.cur = 200
}
}
cura.trk = function(ev){
if(!cura.account.got){
setTimeout(function(){ cura.trk(ev) },1000)
return
}
cura.ajax({url:'/event?'+ev})
}
cura.ajax = function(o){
var xhr = new XMLHttpRequest(),
lL = document.getElementById('curaLoad'),
method = o.method ? o.method : 'GET',
url = o.url,
params, praw = [];
method = method.toUpperCase();
o.data = (o.data)? o.data: {};
if(o.cache === false) o.data['_c'] = (+new Date);
Object.keys(o.data).forEach(function(k) {
praw.push(k + '=' + encodeURIComponent(o.data[k]))
});
params = praw.join('&');
if (method == 'GET' && params) {
url += '?' + params
}
xhr.open(method, url, true);
if(lL) lL.style.display = 'block'
xhr.onreadystatechange = function() {
console.log(xhr, o)
if (xhr.readyState == 4) {
var data = xhr.response? JSON.parse(xhr.response): {};
if (xhr.status == 200) {
if ('success' in o) {
o.success(data);
if(lL) lL.style.display = 'none'
}
cura.retry.reset()
} else {
if ('error' in o) {
console.log('has error thing')
o.error(data);
} else {
console.log('performing backoff')
cura.retry.backoff(function(){cura.ajax(o)}, data)
}
if(lL) lL.style.display = 'none'
}
}
}
if (method == 'PUT' || method == 'POST') {
xhr.send(JSON.stringify(o.data));
} else {
xhr.send();
}
}
cura.setPass = function(email) {
var s = document.getElementById('curaSignTxt'),
e = document.getElementById('curaEmail'),
l = document.getElementById('curaELbl');
e.value = cura.goodEmail(email)
l.style.transform = "scale(0.75) translate(0px, -28px)"
s.innerHTML = "Set a Password to Continue"
cura.toSignup();
cura.logModal()
}
cura.logModal = function(){
document.getElementById('curaSwitch').style.display = 'none'
document.getElementById('curaX').style.display = 'none'
cura.logIsModal = 1;
}
cura.tog = function(toShow){
chg(document.getElementsByClassName('curaSign'), toShow)
chg(document.getElementsByClassName('curaLog'), !toShow)
}
var chg = function(e, show){
var s = show?'block':'none'
for(var x=0;x < e.length;x++){
e[x].style.display = s
}
}
cura.alert = function(t, leaveTime){
var c = document.getElementById('curaAlert')
if(t) c.innerHTML = t;
setTimeout(function(){
c.style.display = t?'block':'none';
},t?0:200)
c.style.opacity = t?1:0
clearTimeout(cura.alertTimer);
if(leaveTime) {
cura.alertTimer = setTimeout(function(){ cura.alert() }, leaveTime)
}
}
cura.callback = function(){}
cura.showLogin = function(callback, orHide, modOpacity){
var a = document.getElementById('curaModal'),
b = document.getElementById('curaAlert'),
c = document.getElementById('curaLogin'),
d = orHide ? 'none':'block',
o = orHide ? 0: 1,
//wo = orHide ? 0: 200,
wd = orHide ? 200:0,
modO = modO ?modO : .95,
isSetPass = cura.getUrlParam('curasetp');
if(cura.logIsModal && wd) return
//setTimeout(function(){
a.style.opacity = modO
b.style.opacity = 0
c.style.opacity = o
//},wo)
setTimeout(function(){
a.style.display = d
b.style.display = 'none'
c.style.display = d
if(orHide){
document.getElementById('curaPassword').value = ''
}
cura.putInView(c)
},wd)
if(callback) cura.callback = callback
if(!cura.logInit) {
window.addEventListener('resize', function(){ //scroll to bottom on android
cura.resize(c)
}, true);
if (isSetPass) cura.setPass(isSetPass)
}
cura.logInit =1
}
var rTime = {};
cura.resize = function(c){
clearTimeout(rTime[c.id]);
rTime[c.id] = setTimeout(function(){cura.putInView(c)},150)
}
cura.event = function(name){
var e = document.createEvent('Event');
e.initEvent(name, true, true)
window.dispatchEvent(e)
}
cura.putInView = function(c){
var iH = window.innerHeight, y
if (iH >= 400) {
y = (iH - 450) /2
} else if (iH >= 290) {
y = 5
} else {
y = -62
}
c.style.top = y+'px'
}
cura.enter = function(e){
if(e.keyCode == 13) {
cura.login()
}
}
cura.goodEmail = function(e){
return e.replace(/(@[^.]+\.c)(ome|omm|im|on)$/, '$1om' ).replace(/(@gmail)$/,'$1.com')
}
cura.login = function(){
var b = document.getElementById('curaButton'),
e = cura.goodEmail(document.getElementById('curaEmail').value),
pa = document.getElementById('curaPassword'),
p = pa.value,
c = document.getElementById('curaAccept').checked,
u = window.userId ? window.userId : 0,
d = {email:e,password:p, uid:u};
if((!e && !p) || (!u && !p) || !p ) {
cura.alert("Please enter your email and password to continue.")
return
}
if (url == '/newaccount') {
d.accept = c
if(!c) {
cura.alert('Please check the box if you agree to the terms to continue');return
}
}
b.disabled = true
cura.ajax({url:url,
data:d,
method:"POST",
success: function(data){
if(data && data.error){
var w = 0
if(url == '/newaccount'){
cura.toLogin()
pa.value = ''
w=200
}
setTimeout(function(){cura.alert(data.error)},w)
} else {
var s = data.settings
cura.isLoggedInDom(e,s)
cura.logIsModal = 0
cura.showLogin(0,1)
s.e = e
s.u = data.uid
cura.account.settings = s
cura.event('curaLogin')
cura.callback(data)
}
b.disabled = false
}/*,
error: function(e){
console.log('error loging in',e)
b.disabled = false
}*/
})
}
cura.account = {
settings: {}
}
cura.getAccount = function(inCallback, outCallback){
inCallback = inCallback || function(){}
outCallback = outCallback || function(){}
window.addEventListener('curaLogin', function() {
inCallback(cura.account.settings)
})
window.addEventListener('curaLogout', function() {
outCallback(cura.account.settings)
})
if(!cura.account.get){
cura.account.get = 1
cura.account.request()
} else if(cura.account.got) {
if(cura.account.settings.e){
cura.event('curaLogin')
} else {
cura.event('curaLogout')
}
}
}
cura.modal = function(isOn){
if(isOn){
if(!cura.modalDom) {
var box = document.createElement('div'),
cSvg = document.getElementById('curaLoad');
box.id = "curaModal";
box.appendChild(cSvg);
document.body.appendChild(box);
cura.modalDom = box
}
var s = cura.modalDom.style
s.display = 'block'
setTimeout(function(){
s.opacity = .6
}, 10);
} else if(cura.modalDom) {
var s = cura.modalDom.style
s.opacity = 0;
setTimeout(function(){
s.display = 'none'
}, 500)
}
}
cura.account.request = function(){
cura.ajax({url:"/settings/all?loaded=1",
cache: false,
success: function(d){
var e = d.settings.e
d.settings.u = d.uid
cura.account.settings = d.settings
if(d.settings && e){ // logged in
cura.isLoggedInDom(e,cura.account.settings)
cura.event('curaLogin')
} else {
cura.event('curaLogout')
}
cura.account.got = 1
}
})
}
cura.getVar = function(key, callback){
cura.ajax({url:"global/get",
data: {key: key},
cache: false,
success: function(d){
cura.vars[key] = d.val
if(callback) callback(d.val)
}
})
}
cura.forgot = function(a){
var b = 'curaSubForgot',
c = 'curaSubLogin', z
if(a == 1) {
z = c; c = b; b = z;
}
document.getElementById(c).style.display = 'none'
document.getElementById(b).style.display = 'block'
}
app.action.loginForgot = cura.forgot
cura.sendForgot = function(){
var el =document.getElementById('curaEmail'),
e = el? el.value :'',
b = document.getElementById('curaForgB')
if(!e){
cura.alert("Please type in your email address")
return
}
b.disabled = true
cura.ajax({method:"POST",
data: {
email: cura.goodEmail(e)
},
url:"/forgot",
success: function(data){
cura.alert("We just sent you a password reset email to "+e+". It should arrive soon.")
b.disabled = false
}});
}
cura.logout = function(callback){
callback = callback || function(){}
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i];
var eqPos = cookie.indexOf("=");
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
cura.account.get = 0
cura.account.got = 1
cura.account.settings = {}
}
cura.ajax({url:"/logout",
success:function(d){
cura.isLoggedInDom()
cura.event('curaLogout')
//logout of parent app
if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova_iab) { //ios
window.webkit.messageHandlers.cordova_iab.postMessage(`{"logout":1}`)
} else if (parent.cordova_iab){ //android
parent.cordova_iab.postMessage(`{"logout":1}`)
}
callback(d)
}
})
}
cura.switchUser = function(){
cura.logout(cura.showLogin())
}
cura.isLoggedInDom = function(e, s) {
if (!e) e = ""
var x, d = document.getElementsByClassName("curaMyEmail")
for (x = 0; x < d.length; x++) {
d[x].innerHTML = e
}
d = document.getElementsByClassName("curaHideOffer")
if(s){
var pstr = s.pp+"", prods = pstr.split(',')
for (x = 0; x < d.length; x++) {
var y,show = 1
if(pstr) {
if(d[x].className.indexOf("curaShowIfHas") > -1){
show = 0;
for (y = 0; y < prods.length; y++) { //hide if
if(d[x].className.indexOf("curaShowIfHas"+prods[y]) > -1){
show = 1;
}
}
}
for (y = 0; y < prods.length; y++) { //hide if
if(d[x].className.indexOf("curaHideIfHas"+prods[y]) > -1){
show = 0;
}
}
}
if(show) d[x].style.display ='block'
}
} else {
for (x = 0; x < d.length; x++) {
d[x].style.display ='none'
}
}
d = document.getElementsByClassName("curaIfNotLoggedIn")
for (x = 0; x < d.length; x++) {
d[x].style.display = e? 'none':'block'
}
d = document.getElementsByClassName("curaIfLoggedIn")
for (x = 0; x < d.length; x++) {
d[x].style.display = e?'block':'none'
}
}
cura.switch = {
init: function(){
var d = document.getElementsByClassName("curaSwitchUser")
if(!d.length) return
console.log('cura.switch.init')
window.iab = cura.getUrlParam("iab")
if(iab != "" && iab != null){
cura.getAccount(function(){/*doIABhide();*/cura.switch.loggedIn(d)},function(){/*logIAB()*/})
} else {
cura.getAccount(function(){cura.switch.loggedIn(d)}, function(){cura.switch.loggedOut(d)})
}
},
loggedIn: function(d){
console.log('cura.switch.loggedIn fired')
for (var x = 0; x < d.length; x++) {
d[x].innerHTML = "You are logged in as "+cura.account.settings.e+""+
"
If that is not correct tap here to log out of this account."
}
},
loggedOut: function(d){
console.log('cura.swtich.loggedout fired')
for (var x = 0; x < d.length; x++) {
d[x].innerHTML = ""
}
}
}
window.addEventListener('beforeunload', function() {
var isCheckedDom = document.getElementById('curaTerms') || document.getElementById('curaPurchaseTerms'),
isChecked = (isCheckedDom && isCheckedDom.checked) ? '1' : '0'
localStorage.setItem('curaTermsChecked', isChecked);
});
window.addEventListener('DOMContentLoaded', function() {
cura.switch.init()
});
// if (window.rEditor) return
window.cura = cura;
cura.event('curaLoaded')
})();
(function () {
'use strict';
if(window.rEditor){
return
}
cura.iab = {}
window.cura = cura;
cura.iab.X = function(url, reload){
var json = reload ? {"reload":reload, "url":url} : {"close":1};
var jsonStr = JSON.stringify(json)
var parent = window.parent
if(parent && parent.app && parent.app.iab) {
var action = reload? "reload" : "close"
parent.app.iab[action](url)
} else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova_iab) { //ios
window.webkit.messageHandlers.cordova_iab.postMessage(jsonStr)
} else if (parent.cordova_iab){
parent.cordova_iab.postMessage(jsonStr)
} else {
document.location.href = reload && url?url: "/clara"
}
}
var iabTry = 15, iabCnt = 0
var logIAB = function(){
cura.ajax({url:'/auth/iab/get?id='+iab, method:'GET', success:function(data){
cura.account.get = 0;
cura.getAccount(function(){
doIABhide(); document.location.href = window.orgUrl
}, function(){
iabTry--;iabCnt++;
if(iabTry > 0){
setTimeout(function(){logIAB()},300*iabCnt/2)
}else{
doIABhide();
}
});
}});
}
/*var doIABhide = function(){
if(window.TweenLite){
TweenLite.to("#iabauth", .2, {display:'none',opacity:0})
} else {
document.getElementById('iabauth').style.display = 'none'
}
}*/
})();