!function(){"use strict";function e(){}function t(e){return e()}function o(e){e.forEach(t)}function n(t){if(null==t)return e;for(var o=arguments.length,n=new Array(o>1?o-1:0),i=1;ie.length)&&(t=e.length);for(var o=0,n=new Array(t);o1&&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,o)){var n,s=!a.length,c=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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,c=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==o.return||o.return()}finally{if(c)throw a}}}}(i);try{for(c.s();!(n=c.n()).done;){var l=n.value;l[1](),a.push(l,t)}}catch(e){c.e(e)}finally{c.f()}if(s){for(var d=0;d1&&void 0!==arguments[1]?arguments[1]:e];return i.add(a),1===i.size&&(o=n(s)||e),r(t),function(){i.delete(a),0===i.size&&o&&(o(),o=null)}}}}function c(t,i,r){var a=!Array.isArray(t),c=a?[t]:t,l=i.length<2;return{subscribe:s(r,(function(t){var r=!1,s=[],d=0,p=e,u=function(){if(!d){p();var o=i(a?s[0]:s,t);l?t(o):p="function"==typeof o?o:e}},_=c.map((function(e,t){return n(e,(function(e){s[t]=e,d&=~(1<{if(r=o,l&&(a=e),!s){let n=t(e,o);if(!(t.length<2))return n;o(n)}s=!1}),n),p=!Array.isArray(e),u=t=>{p?(s=!0,e.set(t)):t.forEach(((t,o)=>{s=!0,e[o].set(t)})),s=!1};l&&(o=o.withOld);var _=o.length>=(l?3:2),f=null,m=!1;function w(e){var t,n,s,c;if(m)return c=e(i(d)),void r(c);var p=d.subscribe((e=>{m?t?n=!0:t=!0:s=e}));c=e(s),m=!0,r(c),p(),m=!1,n&&(c=i(d)),t&&function(e){if(f&&(f(),f=null),l)var t=o(e,a,u);else t=o(e,u);_?"function"==typeof t&&(f=t):u(t)}(c)}return{subscribe:d.subscribe,set(e){w((()=>e))},update:w}}function d(e,t){if(Array.isArray(t)){let o=t.concat();return l(e,(e=>{for(let t=0;te[t]),{withOld(e,o){return o[t]=e,o}})}function p(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e){for(var t=1;t{const n=u({},e);return i=Reflect.set(n,t,o),n})),i},has(e,t){return Reflect.has(i(e),t)},ownKeys(e){return Reflect.ownKeys(i(e))},defineProperty(e,t,o){let n;return e.update((e=>{const i=u({},e);return n=Reflect.defineProperty(i,t,o),i})),n},deleteProperty(e,t){let o;return t in i(e)&&(e.update((e=>{const n=u({},e);return o=Reflect.deleteProperty(n,t),n})),o)},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,o){return Reflect.apply(i(e),t,o)},construct(e,t,o){return Reflect.construct(i(e),t,o)}})}let m;try{m=(window.Cypress?window:window.parent).Rivo}catch(e){console.error(e),m=window.Rivo}const w=s(m),g=f(w),v=d(w,"loy_config"),h=f(v);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o1&&void 0!==arguments[1]?arguments[1]:function(){};var o=document.createElement("script");o.src=e,o.defer=!0,o.onload=function(){t()},document.head.appendChild(o)}function k(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){const e=document.getElementById("rivo-profile-main");e&&e.insertAdjacentHTML("beforeend","
")}const o=()=>{const t=RivoProfileAlpine.store("rivo_orders");if(t?.length){const e=t.filter((e=>new Date(e.created_at)>=new Date(Date.now()-2592e6))).sort(((e,t)=>new Date(t.created_at)-new Date(e.created_at)))[0];e&&RivoProfileAlpine.store("rivo_latest_order",e)}if(RivoProfileAlpine.store("rivo_profile_customer",e.customer),window.Rivo.common.customer=e.customer,Object.assign(window.Rivo.account_profile,{visitor_token:window.Rivo.visitor_token,customer_id:e.customer.id,last_updated_at:Date.now()}),localStorage.setItem("rivo_account_profile",JSON.stringify(window.Rivo.account_profile)),RivoProfileAlpine.store("rivo_aw_settings")?.saved_cart_enabled&&window.RivoAPI.saved_cart_items("db").then((e=>{RivoProfileAlpine.store("rivo_saved_cart_items",e.products)})),localStorage.getItem("rivo_account_creation_survey_needed")){const e=(o=localStorage.getItem("rivo_account_creation_survey_needed").split("--"),n=2,function(e){if(Array.isArray(e))return e}(o)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,i,r,a,s=[],c=!0,l=!1;try{if(r=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;c=!1}else for(;!(c=(n=r.call(o)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=o.return&&(a=o.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(o,n)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}(o,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),t=e[0],i=e[1];return localStorage.removeItem("rivo_account_creation_survey_needed"),void(window.location.hash=`rivo-survey--${t}--${i}`)}var o,n};!RivoProfileAlpine.store("rivo_orders")&&e.customer?.orders_count>0?window.RivoAPI.orders("loggedin").then((function(e){RivoProfileAlpine.store("rivo_orders",e.orders),o()})):o(),t&&document.querySelector(".rivo-full-page-overlay")?.remove(),RivoProfileAlpine.store("rivo_aw_settings")?.post_sign_in_javascript&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return;const o=new Function(...Object.keys(t),`"use strict";\n try {\n ${e}\n } catch (error) {\n console.error('Error executing custom JavaScript:', error);\n }`);try{return o.apply(null,Object.values(t))}catch(e){console.error("Error executing custom JavaScript:",e)}}(RivoProfileAlpine.store("rivo_aw_settings").post_sign_in_javascript,{Alpine:RivoProfileAlpine,store:RivoProfileAlpine.store}),["rivo-order-details","rivo-profile","rivo-favorites"].some((e=>window.location.hash.includes(e)))&&setTimeout((()=>{window.dispatchEvent(new HashChangeEvent("hashchange"))}),1500),setTimeout((()=>{document.querySelector(".rivo-full-page-overlay")?.remove()}),2e3)}var R,$,S;c(w,(e=>e.common.shop.money_format||"{{amount_with_comma_separator}}$")),d(v,"ways_to_earn"),d(v,"referral_rewards"),d(v,"vip_tiers"),d(w,["common","customer"]),s(),s(),s(),s([]),d(v,"rewards"),s(),s({bottom:void 0}),s(),R={},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&&R[t.dataset.action]){e.stopPropagation(),e.preventDefault();var o=t.dataset.data;return o=o?o.split(",").map((function(e){try{return JSON.parse(e)}catch(t){return e}})):[],o.unshift(e),R[t.dataset.action].apply(void 0,o),!1}}),!0),$={},S={on:function(e,t){if("object"!=typeof e)S._has_clb(e,t)||($[e]||($[e]=[]),$[e].push(t));else for(var o in e)S.on(o,e[o])},_has_clb:function(e,t){return!!$[e]&&-1!==$[e].indexOf(t)},once:function(e,t){if("object"!=typeof e)t.once=!0,S.on(e,t);else for(var o in e)S.once(o,e[o])},emit:function(e,t){t||(t=[]),$[e]&&$[e].forEach((function(o){o.apply(void 0,t),o.once&&S.remove(e,o)}))},remove:function(e,t){if("object"!=typeof e){if($[e]){var o=$[e].indexOf(t);-1!==o&&$[e].splice(o,1)}}else for(var n in e)S.remove(n,e[n])}};const j=["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 O(){return window.location.search.substr(1).split("&").reduce((function(e,t){var o=t.split("=");return e[o[0]]=decodeURIComponent(o[1]),e}),{})}const L=async e=>{for(;null===document.querySelector(e);)await new Promise((e=>requestAnimationFrame(e)));return document.querySelector(e)};function E(e){var t="/discount/"+e.code,o={method:"GET"};return new Promise((function(n,i){fetch(t,o).then((function(t){if(void 0===e.variant_ids)return n({});var o=e.variant_ids.split(",");if(0===o.length)return n({});if(1===o.length)return fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:o[0],quantity:1}]})}).then((function(e){return window.location="/cart",n({})}));var i=h.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}),n(e||{})}))})).catch((function(e){console.error(e),n({})}))}))}!function(){const e=window.Rivo.global_config.asset_urls;if(window.baMet&&(window.Rivo.visit_token=window.baMet.getVisitId(),window.Rivo.visitor_token=window.baMet.getVisitorId()),window.Rivo.multipass_request_token=[...Array(32)].map((()=>Math.random().toString(36).substring(2,3))).join(""),h.membership_tiers&&window.Rivo.common?.product?.tags&&-1!==window.Rivo.common.product.tags.indexOf("Rivo Membership"))return void(window.location=h.paid_membership_settings.landing_path||"/");if(h.account_widget_settings?.enabled&&h.account_widget_settings?.redirect_from_account_page){const e=["account/reset"];if(/^\/account($|\/)/.test(window.location.pathname)&&"true"!=b("skip_rivo_redirect")&&!e.some((e=>window.location.pathname.includes(e)))){const e=b("checkout_url");return void(window.location.href=e?`/?rivo_post_sign_in_redirect_url=${encodeURIComponent(e)}#rivo`:"/#rivo")}}h.account_widget_settings?.enabled&&h.account_widget_settings?.replace_account_links&&function(){if("true"===b("skip_rivo_redirect"))return void document.querySelectorAll('a[href*="/account/register"]').forEach((e=>{e.href.includes("skip_rivo_redirect")||(e.href=e.href+"?skip_rivo_redirect=true")}));const e=h.account_widget_settings.replace_legacy_app_links,t=window.Rivo.loy_config.account_widget_settings.replace_account_links_url?window.Rivo.loy_config.account_widget_settings.replace_account_links_url.replace("#rivo",`&return_to=${window.location.pathname}#rivo`):"#rivo",o=()=>{let o='a[href*="/account"]:not([href*="/a/account"]):not([href*="/apps/account"]):not([href*="/community/account"]), a[href*="/customer_authentication/redirect"], a[href*="/customer-identity"]';e&&(o+=', a[href*="#status"]'),document.querySelectorAll(o).forEach((e=>{"/account/logout"===e.getAttribute("href")||0!=e.getAttribute("href").includes("skip_rivo_redirect")||e.hasAttribute("data-rivo-accounts-ignore")||(e.href=t)}))};o(),e&&setTimeout(o,1e3)}(),h.account_widget_settings?.enabled&&h.account_widget_settings?.replace_legacy_app_links&&function(){const e=window.location.hash;if(e.includes("status-confirmation")){const t=e.match(/status-confirmation:(\d+)(?:\D|$)/)?.[1];t&&(window.location.hash=`#rivo-order-details--${t}`)}}(),window.Rivo.preview_mode="undefined"==typeof Shopify;let t=localStorage.getItem("rivo_advocate_profile");t&&(window.Rivo.advocate_profile=JSON.parse(t));let o=localStorage.getItem("rivo_friend_profile");o&&(window.Rivo.friend_profile=JSON.parse(o));let n=localStorage.getItem("rivo_referral_data")||"{}";var i,r,a;function s(){let e=localStorage.getItem("rivo_account_profile")||"{}";e&&(window.Rivo.account_profile=JSON.parse(e),h.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))));const t=h.auto_login?.auto_login_bypass_only_mode_enabled,o=localStorage.getItem("rivo_ap_invalidated_at")&&Date.now()-localStorage.getItem("rivo_ap_invalidated_at")<6e5;if((h.persisted_login_enabled||h?.auto_login?.enabled)&&!window.Rivo.common.customer){const e=O()[h.auto_login.email_identifier];if(Object.keys(window.Rivo.account_profile).length>0||e){window.Nostra?fetch("/?skip_cache=1"):window.edgemesh?fetch("/?em-bypass=all"):Promise.resolve();const n=!window.Rivo.account_profile.visitor_token&&e||t?"/a-l":"/a-p",i=JSON.parse(localStorage.getItem("extensionStorage")||"{}"),r=Object.keys(i).find((e=>e.endsWith("rivo_thank_you_page_data"))),a=r?i[r]:{},s=baMet.getBrowserInfo(),c={screen_width:window.screen.width,screen_height:window.screen.height,browser:s.browser,os:s.os};if("/a-p"===n&&o)return;fetch(`${h.api_endpoint}${n}`,{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||("function"==typeof window.baMet?.getVisitorId?window.baMet.getVisitorId():void 0),visit_token:window.Rivo.visit_token||("function"==typeof window.baMet?.getVisitId?window.baMet.getVisitId():void 0),landing_page:window.location.href,thank_you_storage:a,browser_details:c,multipass_request_token:window.Rivo.multipass_request_token})}).then((e=>e.json())).then((o=>{o.hint&&(localStorage.setItem("rivo_profile_hint",JSON.stringify(o.hint)),document.dispatchEvent(new CustomEvent("rivo:profile-hint-identified")));const i=o.visitor_token==window.Rivo.visitor_token&&o.visit_token==window.Rivo.visit_token&&o.multipass_request_token==window.Rivo.multipass_request_token;o.url&&window.Rivo.multipass_request_token&&i?t?window.location.href=o.url:fetch(o.url).then((()=>{k(o,!0),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))})):"/a-p"===n&&localStorage.setItem("rivo_ap_invalidated_at",Date.now())})).catch(console.error)}}}let c;n&&(window.Rivo.referral_data=JSON.parse(n)),window.Rivo.global_config.loy_js_api_enabled&&x(e.loy.api_js),h.pages_config&&!window.rivo_page_loader_enabled&&x(e.loy.page_init_js),h.forms&&h.forms.length>0&&x(e.forms.init_js),window.Rivo.visit_token?s():(i=e.global.helper_js,!1,r=function(){setTimeout(s,200)},(a=document.createElement("script")).src=i,a.defer=false,a.onload=function(){r()},a.onerror=function(){r(new Error("Failed to load script "+i))},document.head.appendChild(a)),window.rivo_page_loader_enabled?h.account_widget_settings?.enabled?x(e.loy.profile_js,(function(){x(e.loy.lp_js)})):x(e.loy.lp_js):h.account_widget_settings?.enabled&&x(e.loy.profile_js),h.ping_enabled&&window.Rivo.common?.customer&&Rivo.visitor_token&&fetch(`${h.api_endpoint}/customers/loggedin/ping`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({visitor_token:window.Rivo.visitor_token||("function"==typeof window.baMet?.getVisitorId?window.baMet.getVisitorId():void 0),visit_token:window.Rivo.visit_token||("function"==typeof window.baMet?.getVisitId?window.baMet.getVisitId():void 0)})}).then((e=>e.json())).then((e=>{e.ping&&(fetch("/account/logout"),localStorage.removeItem("rivo_account_profile"))})),window.addEventListener("message",(function(e){if(e.origin===window.location.origin)switch(e.data.msg_action){case"widget.register":e.data.msg_options?.redirect_url?window.location.href=`${h.custom_account_register_path||"/account/register"}?checkout_url=${e.data.msg_options.redirect_url}`:window.location.href=`${h.custom_account_register_path||"/account/register"}`;break;case"widget.login":e.data.msg_options?.redirect_url?window.location.href=`${h.custom_account_login_path||"/account/login"}?checkout_url=${e.data.msg_options.redirect_url}`:window.location.href=`${h.custom_account_login_path||"/account/login"}`;break;case"widget.apply_discount_code":E(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"rivo_account_open":const t=new URL(window.location.href);e.data.msg_options.rivo_post_sign_in_redirect_url&&(t.searchParams.set("rivo_post_sign_in_redirect_url",e.data.msg_options.rivo_post_sign_in_redirect_url),window.history.pushState({},"",t)),window.location.hash="rivo";break;case"widget.popup":!function(e,t,o){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"right";new Promise((function(i,r){if("right"==n)var a="960";else a="0";var s=window.open(e,t||"_blank",o||"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,h.floating_widget_settings.desktop_placement);break;case"widget.new_tab":window.open(e.data.msg_options.url,"_blank");break;case"widget.open":c(!0,e.data.msg_options.page);break;case"widget.close":c(!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 l=()=>{const e=document.createElement("script"),t="https:"==document.location.protocol?"https://":"http://";e.src=`${t}${h.domain_name}/preview_loy.js`,e.type="text/javascript",document.head.appendChild(e)},d={"#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"},p='\n \n \n ';window.addSellingPlanToCart=function(e,t){const o=window.Rivo.common?.cart?.items?.find((t=>t.id===e));if(o)return void(window.location="/cart");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=O(),t={},o=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":o?(t.referral_code=o,window.Rivo.advocate_profile?t.page="invalid_referral":function(e){const t=void 0!==e&&""!==e.trim(),o=null==localStorage.getItem("ba_referral_claimed");return t&&o}(o)?(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")):d[window.location.hash]?t.page=window.Rivo.common?.customer?d[window.location.hash]:d["#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 o=e;for(;null!==o&&o.tagName!=="A".toUpperCase();)o=o.parentNode;return o}(e.target||e.srcElement);if(!t)return;const o=t.hash;if(!o||!d[o])return;return event.preventDefault(),t.setAttribute("onclick","return false;"),window.Rivo.deepLinks.page=d[o],void c(!0,d[o])}}));var u={gift:'',star:''};const _="data-ba-met-app='loy' data-ba-met-name='widget_loy_panel_click'";function f(e,t,o){var n=e[t+"_layout"]||e.layout,i=e[t+"_text"]||e.text,r=e[t+"_icon"]||e.icon,a="";return"icon_with_text"!=n&&"image_only"!=n||(a+='
"+(o?``:u[r])+"
"),n.includes("text")&&(a+='
"+i+"
"),a}function m(e){fetch(`${window.Rivo.loy_config.api_endpoint}/customers/loggedin/logout`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({visitor_token:window.Rivo.visitor_token||("function"==typeof window.baMet?.getVisitorId?window.baMet.getVisitorId():void 0),visit_token:window.Rivo.visit_token||("function"==typeof window.baMet?.getVisitId?window.baMet.getVisitId():void 0),silent:!0,silent_reason:e})}).then((e=>e.json())).then((e=>{fetch("/account/logout"),window.Rivo.common.customer=void 0,localStorage.removeItem("ba_loy_customer_id"),localStorage.removeItem("rivo_account_profile"),RivoProfileAlpine&&RivoProfileAlpine.store("rivo_profile_customer",!1)}))}function w(){let e=`${h.api_endpoint}/customers/loggedin/status?verification_customer_id=${window.Rivo.common?.customer?.id}&visitor_token=${window.Rivo.visitor_token}&visit_token=${window.Rivo.visit_token}`;fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}}).then((e=>{if(!window.Rivo.loy_config.account_widget_settings.cache_app_enabled||404!==e.status)return e.json();m("customer_id_verification_404")})).then((function(e){if(e)if(window.Rivo.loy_config.account_widget_settings.account_verification_enabled&&e.hasOwnProperty("account_enabled")&&!e.account_enabled)m("account_verification");else{if(!e.verified&&h.customer_id_verification_enabled)return fetch("/account/logout"),window.Rivo.common.customer=void 0,void localStorage.removeItem("ba_loy_customer_id");h.viewable=e.viewable,window.Rivo.common.customer.status_points_tally=e.points,window.Rivo.common.customer.status_credits_tally=e.credits,window.Rivo.common.customer.expected_completed_actions=e.expected_completed_actions,window.Rivo.common.customer.first_order_at=e.first_order_at,window.Rivo.common.customer.account_activated_at=e.account_activated_at,e.viewable&&h?.js_api_config?.emit_points_balances_on_load&&(window.RivoJS?window.parent.postMessage({msg_action:"event.points_update",msg_options:{points_tally:e.pretty_points_tally,credits_tally:e.pretty_credits_tally,entries_tally:e.pretty_entries_tally}}):document.addEventListener("rivo-js-loaded",(function(){window.parent.postMessage({msg_action:"event.points_update",msg_options:{points_tally:e.pretty_points_tally,credits_tally:e.pretty_credits_tally,entries_tally:e.pretty_entries_tally}})}))),e.viewable&&1==h?.account_embed_widget_settings?.enabled&&function(e,t){const o=window.Rivo.common?.customer,n=h.account_embed_widget_settings,i=n.target_page||"customers/account";if(window.Rivo.common.template!=i||!o)return;let r=document.createElement("style");r.id="loyalty-program-and-rewards",r.innerHTML=`#rivo-loyalty-program-and-rewards{margin-top: 30px;}\n\t\t\t.account-loyalty-wrapper{margin: 15px 0;}\n\t\t\t.account-loyalty-wrapper p{margin: 0 0 10px; text-transform: none; font-size: 15px; font-weight: 400;}\n\t\t\th2#loyalty-program-header{text-transform: none;}\n\t\t\tp#freeform-text{white-space: pre-wrap;}\n\t\t\tp#widget-click a{color: #006eff;}\n\t\t\t#see-more-on-widget{cursor:pointer}#see-more-on-widget:hover{text-decoration: underline;}\n\t\t\t${n.custom_css}`,document.head.appendChild(r);const a=h.translations,s=`${function(e,t){var o=0,n="",i="";if(Number(e)===e&&e%1!=0){var r=Math.abs(e).toFixed(2).split(".");i=r[0].split("").reverse(),n="."+r[1]}else i=Math.abs(e).toString().split("").reverse();return i.forEach((function(e){3==o&&(n=","+n,o=0),n=e+n,o++})),e<0&&(n="- "+n),n}(e)}`,c=`${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===e||null==e)return"";if("string"==typeof e&&0==e.length)return"";var n=g.global_config.base_money_format||g.common.shop.money_format,i=/\{\{\s*(\w+)\s*\}\}0?/;function r(e,t){return void 0===e?t:e}var a=e<0;function s(e,t,o,n,i){if(t=r(t,2),o=r(o,","),n=r(n,"."),isNaN(e)||null==e)return 0;var a=(e=Math.abs(e)).toString().split("."),s=a[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+o),c=a[1]||"";return i||c?s+n+(c=(c+"00").slice(0,t)):s}var c="";switch(n.match(i)[1]){case"amount":case"amount_no_decimals":c=s(e,t,",",".",o);break;case"amount_with_comma_separator":case"amount_no_decimals_with_comma_separator":default:c=s(e,t,".",",");break;case"amount_no_decimals_with_space_separator":c=s(e,t,"."," ");break;case"amount_with_space_separator":case"amount_with_period_and_space_separator":c=s(e,t," ",".");break;case"amount_with_apostrophe_separator":c=s(e,t,".","'")}return(a?"- ":"")+n.replace(i,c)}(t,2)}`;let l=`
\n

${a.general_loyalty_program_and_rewards||"Loyalty Program & Rewards"}

\n\t \n\t\t
`;const d=document.querySelector(`${n.custom_placement||"main .grid > div:first-child *:first-child, main div.customer, main div"}`);d&&d.insertAdjacentHTML(`${n.custom_insert_method||"beforeend"}`,l);const p=document.getElementById("see-more-on-widget");p&&p.addEventListener("click",(function(e){if(e.preventDefault(),n.custom_link){const e=`${window.top.location.origin}${n.custom_link}`;window.postMessage({msg_action:"widget.go_to_url",msg_options:{url:e}},"*")}else{let e=document.querySelector("#launcher-wrapper");e.classList.contains("up")||e.click()}}))}(e.points,e.credits),e.viewable&&window.Rivo.common.customer&&e.auto_applied_discount_code&&(window.Rivo.common.customer.auto_applied_discount_code=e.auto_applied_discount_code,document.dispatchEvent(new CustomEvent("rivo:auto-discount-code-identified")),(t=e.auto_applied_discount_code)&&function(e){let t=document.cookie.match(RegExp("(?:^|;\\s*)"+"discount_code".replace(/([.*+?\^$(){}|\[\]\/\\])/g,"\\$1")+"=([^;]*)"));return t?t[1]:null}()!==t&&fetch(`/discount/${t}`)),L("#ba-loy-container").then((t=>{e.viewable?t.style.display="block":t.remove()}))}var t}))}let v=document.location.search.indexOf("ba-loy-preview=1")>-1,y=document.location.search.indexOf("hide-preview-popup=1")>-1;function R(e,t){if(!t)return"";let o,n="";return o="inherit"===t?`font-family: ${t} !important;`:`font-family: '${t}', sans-serif !important;`,"primary_font"==e?n=``:"secondary_font"==e&&(n=``),j.includes(t)?n:`${n}`}function $(){h.referral_campaigns&&h.referral_campaigns.forEach((function(e){S(e)}))}function S(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(o){let n=e.display_type,i=window.Rivo.deepLinks.referral_campaign_id;if("none"==n)return void o();if(i&&parseInt(i)!=e.id)return;let r=document.getElementById(`rivo-referral-campaign-${e.id}`);const a=h?.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 o=Date.now(),n=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==n||!isNaN(e)&&o-e=60*e.post_order_advocate_overlay_delay*1e3&&(t.rivo_advocate_signup_overlay_last_shown=o,localStorage.setItem("rivo_recent_order",JSON.stringify(t)),!0)}(e);if(s&&(e.display_type="overlay",n="overlay",r?r.querySelector("iframe.rivo-referral.overlay")&&(r.querySelector("iframe.rivo-referral.overlay").style.display="contents"):(r=document.createElement("div"),r.id=`rivo-referral-campaign-${e.id}`,document.body.appendChild(r)),window.Rivo.deepLinks.overlay_mode=!0),!r)return void o();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 l=window.Rivo?window.Rivo.common.shop:void 0,d=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 _=document.getElementById(`rivo-referral-container-${e.id}`);_.contentWindow.document.write(`\n \n \n \n ${p}\n \n \n \n ${a?.primary_font?R("primary_font",a.primary_font):""}\n ${a?.secondary_font?R("secondary_font",a.secondary_font):""}\n \n ${l?`