!function(){"use strict";function e(){}function t(e){return e()}function n(e){e.forEach(t)}function o(t){if(null==t)return e;for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;ie.length)&&(t=e.length);for(var n=0,o=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:e,i=new Set;function s(e){if(u=e,((p=t)!=p?u==u:p!==u||p&&"object"==typeof p||"function"==typeof p)&&(t=e,n)){var o,s=!a.length,l=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}(i);try{for(l.s();!(o=l.n()).done;){var c=o.value;c[1](),a.push(c,t)}}catch(e){l.e(e)}finally{l.f()}if(s){for(var d=0;d1&&void 0!==arguments[1]?arguments[1]:e];return i.add(a),1===i.size&&(n=o(s)||e),r(t),function(){i.delete(a),0===i.size&&n&&(n(),n=null)}}}}function l(t,i,r){var a=!Array.isArray(t),l=a?[t]:t,c=i.length<2;return{subscribe:s(r,(function(t){var r=!1,s=[],d=0,p=e,u=function(){if(!d){p();var n=i(a?s[0]:s,t);c?t(n):p="function"==typeof n?n:e}},f=l.map((function(e,t){return o(e,(function(e){s[t]=e,d&=~(1<{if(r=n,c&&(a=e),!s){let o=t(e,n);if(!(t.length<2))return o;n(o)}s=!1}),o),p=!Array.isArray(e),u=t=>{p?(s=!0,e.set(t)):t.forEach(((t,n)=>{s=!0,e[n].set(t)})),s=!1};c&&(n=n.withOld);var f=n.length>=(c?3:2),m=null,_=!1;function g(e){var t,o,s,l;if(_)return l=e(i(d)),void r(l);var p=d.subscribe((e=>{_?t?o=!0:t=!0:s=e}));l=e(s),_=!0,r(l),p(),_=!1,o&&(l=i(d)),t&&function(e){if(m&&(m(),m=null),c)var t=n(e,a,u);else t=n(e,u);f?"function"==typeof t&&(m=t):u(t)}(l)}return{subscribe:d.subscribe,set(e){g((()=>e))},update:g}}function d(e,t){if(Array.isArray(t)){let n=t.concat();return c(e,(e=>{for(let t=0;te[t]),{withOld(e,n){return n[t]=e,n}})}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function u(e){for(var t=1;t{const o=u({},e);return i=Reflect.set(o,t,n),o})),i},has(e,t){return Reflect.has(i(e),t)},ownKeys(e){return Reflect.ownKeys(i(e))},defineProperty(e,t,n){let o;return e.update((e=>{const i=u({},e);return o=Reflect.defineProperty(i,t,n),i})),o},deleteProperty(e,t){let n;return t in i(e)&&(e.update((e=>{const o=u({},e);return n=Reflect.deleteProperty(o,t),o})),n)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(i(e),t)},getPrototypeOf(e){return Reflect.getPrototypeOf(i(e))},setPrototypeOf(e,t){return Reflect.setPrototypeOf(e,t)},isExtensible(e){return Reflect.isExtensible(i(e))},preventExtensions(e){return Reflect.preventExtensions(e)},apply(e,t,n){return Reflect.apply(i(e),t,n)},construct(e,t,n){return Reflect.construct(i(e),t,n)}})}let _;try{_=(window.Cypress?window:window.parent).Rivo}catch(e){console.error(e),_=window.Rivo}const g=s(_),w=m(g),h=d(g,"loy_config"),y=m(h);function v(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");let n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};var n=document.createElement("script");n.src=e,n.defer=!0,n.onload=function(){t()},document.head.appendChild(n)}var x,k,$;l(g,(e=>e.common.shop.money_format||"{{amount_with_comma_separator}}$")),d(h,"ways_to_earn"),d(h,"referral_rewards"),d(h,"vip_tiers"),d(g,["common","customer"]),s(),s(),s(),s([]),d(h,"rewards"),s(),s({bottom:void 0}),s(),x={},window.addEventListener("click",(function(e){for(var t=e.target;t&&t.dataset&&!t.dataset.action;)t=t.parentNode;if(t&&t.dataset&&t.dataset.action&&x[t.dataset.action]){e.stopPropagation(),e.preventDefault();var n=t.dataset.data;return n=n?n.split(",").map((function(e){try{return JSON.parse(e)}catch(t){return e}})):[],n.unshift(e),x[t.dataset.action].apply(void 0,n),!1}}),!0),k={},$={on:function(e,t){if("object"!=typeof e)$._has_clb(e,t)||(k[e]||(k[e]=[]),k[e].push(t));else for(var n in e)$.on(n,e[n])},_has_clb:function(e,t){return!!k[e]&&-1!==k[e].indexOf(t)},once:function(e,t){if("object"!=typeof e)t.once=!0,$.on(e,t);else for(var n in e)$.once(n,e[n])},emit:function(e,t){t||(t=[]),k[e]&&k[e].forEach((function(n){n.apply(void 0,t),n.once&&$.remove(e,n)}))},remove:function(e,t){if("object"!=typeof e){if(k[e]){var n=k[e].indexOf(t);-1!==n&&k[e].splice(n,1)}}else for(var o in e)$.remove(o,e[o])}};const R=["inherit","Arial","Arial Black","Comic Sans MS","Brush Script MT","Courier New","Georgia","Garamond","Helvetica","Impact","Lato","Lucida Grande","Microsoft Sans Serif","Palatino","Tahoma","Trebuchet MS","Times New Roman","Verdana"];function S(){return window.location.search.substr(1).split("&").reduce((function(e,t){var n=t.split("=");return e[n[0]]=decodeURIComponent(n[1]),e}),{})}const L=async e=>{for(;null===document.querySelector(e);)await new Promise((e=>requestAnimationFrame(e)));return document.querySelector(e)};function O(e){var t="/discount/"+e.code,n={method:"GET"};return new Promise((function(o,i){fetch(t,n).then((function(t){if(void 0===e.variant_ids)return o({});var n=e.variant_ids.split(",");if(0===n.length)return o({});if(1===n.length)return fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:n[0],quantity:1}]})}).then((function(e){return window.location="/cart",o({})}));var i=y.api_endpoint;return fetch(`${i}/products/${e.product_id}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){return e.json()})).then((function(e){return window.Rivo.sendMessageToWidget&&window.Rivo.sendMessageToWidget({msg_action:"app.redeem.product-options",msg_options:e}),o(e||{})}))})).catch((function(e){console.error(e),o({})}))}))}!function(){const e=window.Rivo.global_config.asset_urls;if(window.baMet&&(window.Rivo.visit_token=baMet.getVisitId(),window.Rivo.visitor_token=baMet.getVisitorId()),y.membership_tiers&&window.Rivo.common?.product?.tags&&-1!==window.Rivo.common.product.tags.indexOf("Rivo Membership"))return void(window.location=y.paid_membership_settings.landing_path||"/");if(y.account_widget_settings?.enabled&&y.account_widget_settings?.replace_account_links&&/^\/account($|\/)/.test(window.location.pathname))return void(window.location.href="/#rivo");window.Rivo.preview_mode="undefined"==typeof Shopify;let t=localStorage.getItem("rivo_advocate_profile");t&&(window.Rivo.advocate_profile=JSON.parse(t));let n=localStorage.getItem("rivo_friend_profile");n&&(window.Rivo.friend_profile=JSON.parse(n));let o=localStorage.getItem("rivo_account_profile")||"{}";o&&(window.Rivo.account_profile=JSON.parse(o),y.persisted_login_enabled&&window.Rivo.common.customer&&!window.Rivo.account_profile?.visitor_token&&(Object.assign(window.Rivo.account_profile,{customer_id:window.Rivo.common.customer.id,visitor_token:window.Rivo.visitor_token,last_updated_at:Date.now()}),localStorage.setItem("rivo_account_profile",JSON.stringify(window.Rivo.account_profile))));let i,r=localStorage.getItem("rivo_referral_data")||"{}";if(r&&(window.Rivo.referral_data=JSON.parse(r)),window.Rivo.global_config.loy_js_api_enabled&&b(e.loy.api_js),y.pages_config&&!window.rivo_page_loader_enabled&&b(e.loy.page_init_js),y.forms&&y.forms.length>0&&b(e.forms.init_js),window.rivo_page_loader_enabled?y.account_widget_settings?.enabled?b(e.loy.profile_js,(function(){b(e.loy.lp_js)})):b(e.loy.lp_js):y.account_widget_settings?.enabled&&b(e.loy.profile_js),y.persisted_login_enabled||y?.auto_login?.enabled)if(window.Rivo.common.customer)document.querySelectorAll('a[href^="/account/logout"]').forEach((e=>{e.addEventListener("click",(e=>{try{e.preventDefault(),localStorage.removeItem("rivo_account_profile"),window.location.href="/account/logout"}catch(e){window.location.href="/account/logout"}}))}));else{const e=S()[y.auto_login.email_identifier];if(Object.keys(window.Rivo.account_profile).length>0||e){const t=!window.Rivo.account_profile.visitor_token&&e?"/a-l":"/a-p";fetch(`${y.api_endpoint}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ael_query_token:e,ael_persisted_token:window.Rivo.account_profile.ael_token,visitor_token:window.Rivo.visitor_token,visit_token:window.Rivo.visit_token,landing_page:window.location.href})}).then((e=>e.json())).then((t=>{t.url&&fetch(t.url).then((()=>{RivoProfileAlpine.store("rivo_profile_customer",t.customer),window.Rivo.common.customer=t.customer,Object.assign(window.Rivo.account_profile,{ael_token:window.Rivo.account_profile?.ael_token||e,last_updated_at:Date.now(),visitor_token:window.Rivo.visitor_token}),localStorage.setItem("rivo_account_profile",JSON.stringify(window.Rivo.account_profile))}))})).catch(console.error)}}window.addEventListener("message",(function(e){switch(e.data.msg_action){case"widget.register":e.data.msg_options?.redirect_url?window.location.href=`${y.custom_account_register_path||"/account/register"}?checkout_url=${e.data.msg_options.redirect_url}`:window.location.href=`${y.custom_account_register_path||"/account/register"}`;break;case"widget.login":e.data.msg_options?.redirect_url?window.location.href=`${y.custom_account_login_path||"/account/login"}?checkout_url=${e.data.msg_options.redirect_url}`:window.location.href=`${y.custom_account_login_path||"/account/login"}`;break;case"widget.apply_discount_code":O(e.data.msg_options).then((function(e){if(!e.url)return;let t=document.querySelector(".rivo-visit-product.text-warning");t&&(t.style.display="",t.querySelector("a").href=e.url)}));break;case"widget.visit":window.location.href=e.data.msg_options.url;break;case"widget.popup":!function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"right";new Promise((function(i,r){if("right"==o)var a="960";else a="0";var s=window.open(e,t||"_blank",n||"height=500,width=700,left="+a);return window.focus&&s.focus(),i({})}))}(e.data.msg_options.url,e.data.msg_options.windowName,e.data.msg_options.windowFeatures,y.floating_widget_settings.desktop_placement);break;case"widget.new_tab":window.open(e.data.msg_options.url,"_blank");break;case"widget.open":i(!0,e.data.msg_options.page);break;case"widget.close":i(!1);break;case"widget.referral_claimed":!function(e){e.email;let t=e.code;localStorage.setItem("ba_referral_claimed",t),localStorage.removeItem("ba_referral_customer_signup")}(e.data.msg_options);break;case"widget.referral_via_email":Object.assign(document.createElement("a"),{target:"_blank",href:`mailto:?subject=${e.data.msg_options.subject}&body=${e.data.msg_options.body}`}).click();break;case"widget.go_to_url":Object.assign(document.createElement("a"),{target:"_blank",href:e.data.msg_options.url}).click()}}));const a=()=>{const e=document.createElement("script"),t="https:"==document.location.protocol?"https://":"http://";e.src=`${t}${y.domain_name}/preview_loy.js`,e.type="text/javascript",document.head.appendChild(e)},s={"#ba-loyalty-home":"index","#ba-loyalty-rewards":"my_rewards","#ba-loyalty-ways-to-earn":"ways_to_earn","#ba-loyalty-redeem":"ways_to_redeem","#ba-referral-program":"referrals","#ba-referrals":"my_referrals"},l='\n \n \n ';window.addSellingPlanToCart=function(e,t){const n={id:e,selling_plan:t,quantity:1};fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>e.json())).then((e=>{window.location="/cart"})).catch((e=>console.error("Error:",e)))},window.Rivo.deepLinks=function(){let e=S(),t={},n=e.referral_code||e.xrc;return"loyalty_points_redeemed"===e.preset_type?(t.page="reward",t.reward_id=e.record_id):"loyalty_birthday"===e.preset_type?t.page="home":n?(t.referral_code=n,window.Rivo.advocate_profile?t.page="invalid_referral":function(e){const t=void 0!==e&&""!==e.trim(),n=null==localStorage.getItem("ba_referral_claimed");return t&&n}(n)?(t.page="referral_signup",e.rci&&(t.referral_campaign_id=e.rci)):window.Rivo.friend_profile&&localStorage.getItem("ba_referral_claimed")&&(t.reward_discount_code=localStorage.getItem("ba_referral_claimed"),t.page="friend_reward")):s[window.location.hash]?t.page=window.Rivo.common?.customer?s[window.location.hash]:s["#ba-loyalty-home"]:"email"==e.utm_medium&&"rivo"==e.utm_source&&(t.page="home"),e.advocate_rdc?(t.reward_discount_code=e.advocate_rdc,t.page="advocate_reward"):e.friend_rdc?(t.reward_discount_code=e.friend_rdc,t.page="friend_reward"):e.popup_panel&&(t.popup_panel=e.popup_panel),e.fpr_pid&&e.fpr_vids&&(t.free_product_reward={product_id:e.fpr_pid,variant_id:e.fpr_vids}),t}(),window.addEventListener("ontouchstart"in window||window.navigator.msPointerEnabled?"click":"mouseup",(function(e){if(0===e.button){const t=function(e,t){let n=e;for(;null!==n&&n.tagName!=="A".toUpperCase();)n=n.parentNode;return n}(e.target||e.srcElement);if(!t)return;const n=t.hash;if(!n||!s[n])return;return event.preventDefault(),t.setAttribute("onclick","return false;"),window.Rivo.deepLinks.page=s[n],void i(!0,s[n])}}));var c={gift:'',star:''};const d="data-ba-met-app='loy' data-ba-met-name='app_widget_loy_panel_click'";function p(e,t,n){var o=e[t+"_layout"]||e.layout,i=e[t+"_text"]||e.text,r=e[t+"_icon"]||e.icon,a="";return"icon_with_text"!=o&&"image_only"!=o||(a+='
"+(n?``:c[r])+"
"),o.includes("text")&&(a+='
"+i+"
"),a}let u=document.location.search.indexOf("ba-loy-preview=1")>-1,f=document.location.search.indexOf("hide-preview-popup=1")>-1;function m(e,t){if(!t)return"";let n,o="";return n="inherit"===t?`font-family: ${t} !important;`:`font-family: '${t}', sans-serif !important;`,"primary_font"==e?o=``:"secondary_font"==e&&(o=``),R.includes(t)?o:`${o}`}function _(){y.referral_campaigns&&y.referral_campaigns.forEach((function(e){g(e)}))}function g(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(n){let o=e.display_type,i=window.Rivo.deepLinks.referral_campaign_id;if("none"==o)return void n();if(i&&parseInt(i)!=e.id)return;let r=document.getElementById(`rivo-referral-campaign-${e.id}`);const a=y?.font_settings||"",s=window.Rivo.deepLinks.referral_code||window.Rivo.deepLinks.reward_discount_code||t||function(e){const t=JSON.parse(localStorage.getItem("rivo_recent_order"));if(!e.post_order_advocate_overlay_enabled||window.Rivo.advocate_profile||!t)return!1;const n=Date.now(),o=60*e.post_order_advocate_overlay_frequency*1e3,i=t.rivo_advocate_signup_overlay_last_shown;if(i){const e=parseInt(i,10);if(0==o||!isNaN(e)&&n-e=60*e.post_order_advocate_overlay_delay*1e3&&(t.rivo_advocate_signup_overlay_last_shown=n,localStorage.setItem("rivo_recent_order",JSON.stringify(t)),!0)}(e);if(s&&(e.display_type="overlay",r=document.getElementById(`rivo-referral-campaign-${e.id}`),r?r.querySelector("iframe.rivo-referral.overlay").style.display="contents":(r=document.createElement("div"),r.id=`rivo-referral-campaign-${e.id}`,o="overlay",document.body.appendChild(r)),window.Rivo.deepLinks.overlay_mode=!0),!r)return void n();let c=document.createElement("style");c.id=`rivo-referral-styles-${e.id}`,c.innerHTML=`\n #rivo-referral-campaign-${e.id} { width: 100%; height: 100%; display: contents;}\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n iframe.rivo-referral{\n position: relative;\n width: 100%;\n height: ${e.design_settings.desktop_inline_height}px;\n border: none;\n animation: fadeIn 0.3s ease forwards;\n }\n\n @media (max-width: 680px){\n iframe.rivo-referral{\n height: ${e.design_settings.mobile_inline_height}px;\n }\n }\n\n iframe.rivo-referral.overlay{\n display: flex;\n position: fixed;\n z-index: 2147483644;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: rgb(0,0,0);\n background-color: rgba(0,0,0,0.4);\n opacity: 1;\n visibility: visible;\n }`,document.head.appendChild(c);let d=window.Rivo?window.Rivo.common.shop:void 0,p=window.Rivo?window.Rivo.common.customer:void 0;r.innerHTML=``;const u=`\n .background-image, .background-cover{\n background-image: url(${e.background_image_url});\n }\n .content .header{\n background-color: ${e.design_settings.header_background_color};\n color: ${e.design_settings.header_font_color};\n text-align: ${e.design_settings.header_text_align};\n }\n .content-title{\n color: ${e.design_settings.title_font_color};\n font-size: var(--title-font-size);\n text-align: ${e.design_settings.title_text_align};\n }\n .content-subtitle{\n color: ${e.design_settings.subtitle_font_color};\n font-size: var(--subtitle-font-size);\n text-align: ${e.design_settings.subtitle_text_align};\n }\n .button{\n background-color: ${e.design_settings.button_background_color};\n border-color: ${e.design_settings.button_border_color};\n color: ${e.design_settings.button_font_color};\n font-size: ${e.design_settings.button_font_size}px;\n }\n .button:hover{opacity: 0.9;}\n .footer{\n color: ${e.design_settings.footer_font_color};\n font-size: ${e.design_settings.footer_font_size}px;\n text-align: ${e.design_settings.footer_text_align};\n }\n .content .content-wrapper .section-footer{\n color: ${e.design_settings.footer_font_color};\n font-size: ${e.design_settings.footer_font_size}px;\n text-align: ${e.design_settings.footer_text_align};\n }\n @media (max-width: 680px){\n .mobile-image{\n background-image: url('${e.background_image_url}');\n }\n }\n `;let f=document.getElementById(`rivo-referral-container-${e.id}`);f.contentWindow.document.write(`\n \n \n \n ${l}\n \n \n \n ${a?.primary_font?m("primary_font",a.primary_font):""}\n ${a?.secondary_font?m("secondary_font",a.secondary_font):""}\n \n ${d?`