@ordergroove/offers 2.22.1-alpha-PR-555-2.33 → 2.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/offers.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.offers=e():(t.og=t.og||{},t.og.offers=e())}(window,(function(){return function(t){function e(e){for(var r,o,i=e[0],s=e[1],a=0,u=[];a<i.length;a++)o=i[a],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&u.push(n[o][0]),n[o]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r]);for(c&&c(e);u.length;)u.shift()()}var r={},n={1:0};function o(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(t){var e=[],r=n[t];if(0!==r)if(r)e.push(r[2]);else{var i=new Promise((function(e,o){r=n[t]=[e,o]}));e.push(r[2]=i);var s,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(t){return o.p+""+({2:"offers-preview-mode",3:"offers-test-mode"}[t]||t)+".bundle.js"}(t);var c=new Error;s=function(e){a.onerror=a.onload=null,clearTimeout(u);var r=n[t];if(0!==r){if(r){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",c.name="ChunkLoadError",c.type=o,c.request=i,r[1](c)}n[t]=void 0}};var u=setTimeout((function(){s({type:"timeout",target:a})}),12e4);a.onerror=a.onload=s,document.head.appendChild(a)}return Promise.all(e)},o.m=t,o.c=r,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o.oe=function(t){throw console.error(t),t};var i=window.webpackJsonp=window.webpackJsonp||[],s=i.push.bind(i);i.push=e,i=i.slice();for(var a=0;a<i.length;a++)e(i[a]);var c=s;return o(o.s=29)}([function(t,e,r){"use strict";r.d(e,"k",(function(){return n})),r.d(e,"l",(function(){return o})),r.d(e,"m",(function(){return i})),r.d(e,"E",(function(){return s})),r.d(e,"v",(function(){return a})),r.d(e,"p",(function(){return c})),r.d(e,"n",(function(){return u})),r.d(e,"f",(function(){return l})),r.d(e,"x",(function(){return d})),r.d(e,"s",(function(){return p})),r.d(e,"b",(function(){return f})),r.d(e,"J",(function(){return h})),r.d(e,"w",(function(){return g})),r.d(e,"q",(function(){return y})),r.d(e,"r",(function(){return m})),r.d(e,"h",(function(){return b})),r.d(e,"B",(function(){return v})),r.d(e,"z",(function(){return _})),r.d(e,"A",(function(){return w})),r.d(e,"d",(function(){return O})),r.d(e,"u",(function(){return S})),r.d(e,"g",(function(){return x})),r.d(e,"t",(function(){return T})),r.d(e,"e",(function(){return E})),r.d(e,"c",(function(){return C})),r.d(e,"o",(function(){return P})),r.d(e,"D",(function(){return k})),r.d(e,"y",(function(){return j})),r.d(e,"F",(function(){return q})),r.d(e,"G",(function(){return A})),r.d(e,"a",(function(){return N})),r.d(e,"I",(function(){return I})),r.d(e,"i",(function(){return R})),r.d(e,"j",(function(){return F})),r.d(e,"C",(function(){return L})),r.d(e,"H",(function(){return U}));const n="OPTIN_PRODUCT",o="OPTOUT_PRODUCT",i="PRODUCT_CHANGE_FREQUENCY",s="SET_MERCHANT_ID",a="REQUEST_OFFER",c="RECEIVE_OFFER",u="PRODUCT_HAS_CHANGED",l="CREATED_SESSION_ID",d="SET_AUTH_URL",p="REQUEST_AUTH",f="AUTHORIZE",h="UNAUTHORIZED",g="REQUEST_ORDERS",y="RECEIVE_ORDERS",m="RECEIVE_ORDER_ITEMS",b="FETCH_RESPONSE_ERROR",v="SET_ENVIRONMENT_STAGING",_="SET_ENVIRONMENT_DEV",w="SET_ENVIRONMENT_PROD",O="CONCLUDE_UPSELL",S="REQUEST_CREATE_IU_ORDER",x="CREATE_ONE_TIME",T="REQUEST_CONVERT_ONE_TIME",E="CONVERT_ONE_TIME",C="CHECKOUT",P="RECEIVE_FETCH",k="SET_LOCALE",j="SET_CONFIG",q="SET_PREVIEW_STANDARD_OFFER",A="SET_PREVIEW_UPSELL_OFFER",N="ADD_TEMPLATE",I="SET_TEMPLATES",R="LOCAL_STORAGE_CHANGE",F="LOCAL_STORAGE_CLEAR",L="SET_FIRST_ORDER_PLACE_DATE",U="SET_PRODUCT_TO_SUBSCRIBE"},function(t,e,r){"use strict";
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.offers=e():(t.og=t.og||{},t.og.offers=e())}(window,(function(){return function(t){function e(e){for(var r,o,i=e[0],s=e[1],a=0,u=[];a<i.length;a++)o=i[a],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&u.push(n[o][0]),n[o]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r]);for(c&&c(e);u.length;)u.shift()()}var r={},n={1:0};function o(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(t){var e=[],r=n[t];if(0!==r)if(r)e.push(r[2]);else{var i=new Promise((function(e,o){r=n[t]=[e,o]}));e.push(r[2]=i);var s,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(t){return o.p+""+({2:"offers-preview-mode",3:"offers-test-mode"}[t]||t)+".bundle.js"}(t);var c=new Error;s=function(e){a.onerror=a.onload=null,clearTimeout(u);var r=n[t];if(0!==r){if(r){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",c.name="ChunkLoadError",c.type=o,c.request=i,r[1](c)}n[t]=void 0}};var u=setTimeout((function(){s({type:"timeout",target:a})}),12e4);a.onerror=a.onload=s,document.head.appendChild(a)}return Promise.all(e)},o.m=t,o.c=r,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o.oe=function(t){throw console.error(t),t};var i=window.webpackJsonp=window.webpackJsonp||[],s=i.push.bind(i);i.push=e,i=i.slice();for(var a=0;a<i.length;a++)e(i[a]);var c=s;return o(o.s=29)}([function(t,e,r){"use strict";r.d(e,"k",(function(){return n})),r.d(e,"l",(function(){return o})),r.d(e,"m",(function(){return i})),r.d(e,"E",(function(){return s})),r.d(e,"v",(function(){return a})),r.d(e,"p",(function(){return c})),r.d(e,"n",(function(){return u})),r.d(e,"f",(function(){return l})),r.d(e,"x",(function(){return d})),r.d(e,"s",(function(){return p})),r.d(e,"b",(function(){return f})),r.d(e,"J",(function(){return h})),r.d(e,"w",(function(){return g})),r.d(e,"q",(function(){return y})),r.d(e,"r",(function(){return m})),r.d(e,"h",(function(){return b})),r.d(e,"B",(function(){return v})),r.d(e,"z",(function(){return _})),r.d(e,"A",(function(){return w})),r.d(e,"d",(function(){return O})),r.d(e,"u",(function(){return S})),r.d(e,"g",(function(){return x})),r.d(e,"t",(function(){return E})),r.d(e,"e",(function(){return T})),r.d(e,"c",(function(){return C})),r.d(e,"o",(function(){return P})),r.d(e,"D",(function(){return k})),r.d(e,"y",(function(){return j})),r.d(e,"F",(function(){return q})),r.d(e,"G",(function(){return A})),r.d(e,"a",(function(){return N})),r.d(e,"I",(function(){return I})),r.d(e,"i",(function(){return R})),r.d(e,"j",(function(){return F})),r.d(e,"C",(function(){return L})),r.d(e,"H",(function(){return U}));const n="OPTIN_PRODUCT",o="OPTOUT_PRODUCT",i="PRODUCT_CHANGE_FREQUENCY",s="SET_MERCHANT_ID",a="REQUEST_OFFER",c="RECEIVE_OFFER",u="PRODUCT_HAS_CHANGED",l="CREATED_SESSION_ID",d="SET_AUTH_URL",p="REQUEST_AUTH",f="AUTHORIZE",h="UNAUTHORIZED",g="REQUEST_ORDERS",y="RECEIVE_ORDERS",m="RECEIVE_ORDER_ITEMS",b="FETCH_RESPONSE_ERROR",v="SET_ENVIRONMENT_STAGING",_="SET_ENVIRONMENT_DEV",w="SET_ENVIRONMENT_PROD",O="CONCLUDE_UPSELL",S="REQUEST_CREATE_IU_ORDER",x="CREATE_ONE_TIME",E="REQUEST_CONVERT_ONE_TIME",T="CONVERT_ONE_TIME",C="CHECKOUT",P="RECEIVE_FETCH",k="SET_LOCALE",j="SET_CONFIG",q="SET_PREVIEW_STANDARD_OFFER",A="SET_PREVIEW_UPSELL_OFFER",N="ADD_TEMPLATE",I="SET_TEMPLATES",R="LOCAL_STORAGE_CHANGE",F="LOCAL_STORAGE_CLEAR",L="SET_FIRST_ORDER_PLACE_DATE",U="SET_PRODUCT_TO_SUBSCRIBE"},function(t,e,r){"use strict";
2
2
  /**
3
3
  * @license
4
4
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -66,7 +66,7 @@ class _{constructor(t,e,r){this.__parts=[],this.template=t,this.processor=e,this
66
66
  * subject to an additional IP rights grant found at
67
67
  * http://polymer.github.io/PATENTS.txt
68
68
  */
69
- const x=t=>null===t||!("object"==typeof t||"function"==typeof t),T=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class E{constructor(t,e,r){this.dirty=!0,this.element=t,this.name=e,this.strings=r,this.parts=[];for(let t=0;t<r.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new C(this)}_getValue(){const t=this.strings,e=t.length-1,r=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=r[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!T(t))return t}let n="";for(let o=0;o<e;o++){n+=t[o];const e=r[o];if(void 0!==e){const t=e.value;if(x(t)||!T(t))n+="string"==typeof t?t:String(t);else for(const e of t)n+="string"==typeof e?e:String(e)}}return n+=t[e],n}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class C{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===b||x(t)&&t===this.value||(this.value=t,m(t)||(this.committer.dirty=!0))}commit(){for(;m(this.value);){const t=this.value;this.value=b,t(this)}this.value!==b&&this.committer.commit()}}class P{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(d()),this.endNode=t.appendChild(d())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=d()),t.__insert(this.endNode=d())}insertAfterPart(t){t.__insert(this.startNode=d()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;m(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}const t=this.__pendingValue;t!==b&&(x(t)?t!==this.value&&this.__commitText(t):t instanceof S?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):T(t)?this.__commitIterable(t):t===v?(this.value=v,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,r="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=r:this.__commitNode(document.createTextNode(r)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof _&&this.value.template===e)this.value.update(t.values);else{const r=new _(e,t.processor,this.options),n=r._clone();r.update(t.values),this.__commitNode(n),this.value=r}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let r,n=0;for(const o of t)r=e[n],void 0===r&&(r=new P(this.options),e.push(r),0===n?r.appendIntoPart(this):r.insertAfterPart(e[n-1])),r.setValue(o),r.commit(),n++;n<e.length&&(e.length=n,this.clear(r&&r.endNode))}clear(t=this.startNode){o(this.startNode.parentNode,t.nextSibling,this.endNode)}}class k{constructor(t,e,r){if(this.value=void 0,this.__pendingValue=void 0,2!==r.length||""!==r[0]||""!==r[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=r}setValue(t){this.__pendingValue=t}commit(){for(;m(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}if(this.__pendingValue===b)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=b}}class j extends E{constructor(t,e,r){super(t,e,r),this.single=2===r.length&&""===r[0]&&""===r[1]}_createPart(){return new q(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class q extends C{}let A=!1;(()=>{try{const t={get capture(){return A=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class N{constructor(t,e,r){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=r,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;m(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}if(this.__pendingValue===b)return;const t=this.__pendingValue,e=this.value,r=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),n=null!=t&&(null==e||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),n&&(this.__options=I(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=b}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const I=t=>t&&(A?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)
69
+ const x=t=>null===t||!("object"==typeof t||"function"==typeof t),E=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class T{constructor(t,e,r){this.dirty=!0,this.element=t,this.name=e,this.strings=r,this.parts=[];for(let t=0;t<r.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new C(this)}_getValue(){const t=this.strings,e=t.length-1,r=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=r[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!E(t))return t}let n="";for(let o=0;o<e;o++){n+=t[o];const e=r[o];if(void 0!==e){const t=e.value;if(x(t)||!E(t))n+="string"==typeof t?t:String(t);else for(const e of t)n+="string"==typeof e?e:String(e)}}return n+=t[e],n}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class C{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===b||x(t)&&t===this.value||(this.value=t,m(t)||(this.committer.dirty=!0))}commit(){for(;m(this.value);){const t=this.value;this.value=b,t(this)}this.value!==b&&this.committer.commit()}}class P{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(d()),this.endNode=t.appendChild(d())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=d()),t.__insert(this.endNode=d())}insertAfterPart(t){t.__insert(this.startNode=d()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;m(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}const t=this.__pendingValue;t!==b&&(x(t)?t!==this.value&&this.__commitText(t):t instanceof S?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):E(t)?this.__commitIterable(t):t===v?(this.value=v,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,r="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=r:this.__commitNode(document.createTextNode(r)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof _&&this.value.template===e)this.value.update(t.values);else{const r=new _(e,t.processor,this.options),n=r._clone();r.update(t.values),this.__commitNode(n),this.value=r}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let r,n=0;for(const o of t)r=e[n],void 0===r&&(r=new P(this.options),e.push(r),0===n?r.appendIntoPart(this):r.insertAfterPart(e[n-1])),r.setValue(o),r.commit(),n++;n<e.length&&(e.length=n,this.clear(r&&r.endNode))}clear(t=this.startNode){o(this.startNode.parentNode,t.nextSibling,this.endNode)}}class k{constructor(t,e,r){if(this.value=void 0,this.__pendingValue=void 0,2!==r.length||""!==r[0]||""!==r[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=r}setValue(t){this.__pendingValue=t}commit(){for(;m(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}if(this.__pendingValue===b)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=b}}class j extends T{constructor(t,e,r){super(t,e,r),this.single=2===r.length&&""===r[0]&&""===r[1]}_createPart(){return new q(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class q extends C{}let A=!1;(()=>{try{const t={get capture(){return A=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class N{constructor(t,e,r){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=r,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;m(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}if(this.__pendingValue===b)return;const t=this.__pendingValue,e=this.value,r=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),n=null!=t&&(null==e||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),n&&(this.__options=I(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=b}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const I=t=>t&&(A?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)
70
70
  /**
71
71
  * @license
72
72
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -106,7 +106,7 @@ const x=t=>null===t||!("object"==typeof t||"function"==typeof t),T=t=>Array.isAr
106
106
  * subject to an additional IP rights grant found at
107
107
  * http://polymer.github.io/PATENTS.txt
108
108
  */
109
- class{handleAttributeExpressions(t,e,r,n){const o=e[0];if("."===o){return new j(t,e.slice(1),r).parts}return"@"===o?[new N(t,e.slice(1),n.eventContext)]:"?"===o?[new k(t,e.slice(1),r)]:new E(t,e,r).parts}handleTextExpression(t){return new P(t)}};
109
+ class{handleAttributeExpressions(t,e,r,n){const o=e[0];if("."===o){return new j(t,e.slice(1),r).parts}return"@"===o?[new N(t,e.slice(1),n.eventContext)]:"?"===o?[new k(t,e.slice(1),r)]:new T(t,e,r).parts}handleTextExpression(t){return new P(t)}};
110
110
  /**
111
111
  * @license
112
112
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -144,7 +144,7 @@ const Q=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
144
144
  * subject to an additional IP rights grant found at
145
145
  * http://polymer.github.io/PATENTS.txt
146
146
  */
147
- (window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const et={};class rt extends W{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,r)=>t.reduceRight((t,r)=>Array.isArray(r)?e(r,t):(t.add(r),t),r),r=e(t,new Set),n=[];r.forEach(t=>n.unshift(t)),this._styles=n}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map(t=>{if(t instanceof CSSStyleSheet&&!Q){const e=Array.prototype.slice.call(t.cssRules).reduce((t,e)=>t+e.cssText,"");return new X(String(e),K)}return t})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Q?this.renderRoot.adoptedStyleSheets=t.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==et&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){return et}}rt.finalized=!0,rt.render=(t,e,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const n=r.scopeName,i=L.has(e),s=$&&11===e.nodeType&&!!e.host,a=s&&!z.has(n),c=a?document.createDocumentFragment():e;if(((t,e,r)=>{let n=L.get(e);void 0===n&&(o(e,e.firstChild),L.set(e,n=new P(Object.assign({templateFactory:R},r))),n.appendInto(e)),n.setValue(t),n.commit()})(t,c,Object.assign({templateFactory:B(n)},r)),a){const t=L.get(c);L.delete(c);const r=t.value instanceof _?t.value.template:void 0;H(n,c,r),o(e,e.firstChild),e.appendChild(c),L.set(e,t)}!i&&s&&window.ShadyCSS.styleElement(e.host)}},function(t,e,r){"use strict";function n(t,e){return t===e}function o(t,e,r){if(null===e||null===r||e.length!==r.length)return!1;for(var n=e.length,o=0;o<n;o++)if(!t(e[o],r[o]))return!1;return!0}function i(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every((function(t){return"function"==typeof t}))){var r=e.map((function(t){return typeof t})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return e}var s=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];var s=0,a=n.pop(),c=i(n),u=t.apply(void 0,[function(){return s++,a.apply(null,arguments)}].concat(r)),l=t((function(){for(var t=[],e=c.length,r=0;r<e;r++)t.push(c[r].apply(null,arguments));return u.apply(null,t)}));return l.resultFunc=a,l.dependencies=c,l.recomputations=function(){return s},l.resetRecomputations=function(){return s=0},l}}((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,r=null,i=null;return function(){return o(e,r,arguments)||(i=t.apply(null,arguments)),r=arguments,i}}));var a=r(7),c=r.n(a),u=r(5);r.d(e,"c",(function(){return l})),r.d(e,"j",(function(){return d})),r.d(e,"a",(function(){return f})),r.d(e,"e",(function(){return g})),r.d(e,"i",(function(){return y})),r.d(e,"f",(function(){return m})),r.d(e,"h",(function(){return b})),r.d(e,"g",(function(){return v})),r.d(e,"d",(function(){return _})),r.d(e,"b",(function(){return w})),r.d(e,"k",(function(){return O})),c.a.Cache=Map;const l=(t,e)=>{if(t===e)return!0;if("object"==typeof t&&"object"==typeof e&&t&&e&&t.id===e.id){if(!Array.isArray(t.components)||!Array.isArray(e.components))return!0;if(function(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}((t.components||[]).sort(),(e.components||[]).sort()))return!0}return!1},d=t=>t.optedin||[],p=t=>t.optedout||[],f=t=>t.autoshipByDefault||{},h=t=>t.defaultFrequencies||{},g=c()(t=>s(d,p,f,(e,r,n)=>{const o=e.find(e=>l(t,e));return o||!r.find(e=>l(t,e))&&(!(!t||!n[t.id])&&{id:t.id})}),t=>JSON.stringify(t)),y=c()(t=>s(d,e=>{const r=e.find(e=>l(t,e));return r||!1}),t=>JSON.stringify(t)),m=c()(t=>s(p,e=>e.find(e=>l(t,e)))),b=c()(t=>s(g(t),t=>t&&t.frequency||null)),v=c()(t=>s(h,e=>e[t]&&Object(u.stringifyFrequency)(e[t])||null)),_=t=>t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),w=(t,e,r,n)=>({[r]:e&&e.hasAttribute&&e.hasAttribute(_(r))&&e[r]||e.offer&&typeof("undefined"!==e.offer[r])&&e.offer[r]||t.config&&t.config[r]||n}),O=t=>({templates:t.templates||[]})},function(t,e,r){"use strict";r.r(e),r.d(e,"optinProduct",(function(){return s})),r.d(e,"optoutProduct",(function(){return a})),r.d(e,"productHasChangedComponents",(function(){return c})),r.d(e,"productChangeFrequency",(function(){return u})),r.d(e,"concludeUpsell",(function(){return l})),r.d(e,"setMerchantId",(function(){return d})),r.d(e,"createSessionId",(function(){return p})),r.d(e,"requestAuth",(function(){return f})),r.d(e,"authorize",(function(){return h})),r.d(e,"unauthorized",(function(){return g})),r.d(e,"setAuthUrl",(function(){return y})),r.d(e,"fetchDone",(function(){return m})),r.d(e,"fetchAuth",(function(){return b})),r.d(e,"requestOrders",(function(){return v})),r.d(e,"receiveOrders",(function(){return _})),r.d(e,"receiveItems",(function(){return w})),r.d(e,"fetchOrders",(function(){return O})),r.d(e,"setEnvironment",(function(){return S})),r.d(e,"requestSessionId",(function(){return x})),r.d(e,"receiveOffer",(function(){return T})),r.d(e,"fetchResponseError",(function(){return E})),r.d(e,"requestOffer",(function(){return C})),r.d(e,"fetchOffer",(function(){return P})),r.d(e,"checkout",(function(){return k})),r.d(e,"requestCreateOneTime",(function(){return j})),r.d(e,"receiveCreateOneTime",(function(){return q})),r.d(e,"requestConvertOneTimeToSubscription",(function(){return A})),r.d(e,"receiveConvertOneTime",(function(){return N})),r.d(e,"createIu",(function(){return I})),r.d(e,"setLocale",(function(){return R})),r.d(e,"setConfig",(function(){return F})),r.d(e,"addTemplate",(function(){return L})),r.d(e,"setTemplates",(function(){return U})),r.d(e,"setFirstOrderPlaceDate",(function(){return D})),r.d(e,"setProductToSubscribe",(function(){return M}));var n=r(15),o=r(0),i=r(5);const s=(t,e)=>({type:o.k,payload:{product:t,frequency:e}}),a=t=>({type:o.l,payload:{product:t}}),c=(t,e)=>({type:o.n,payload:{newProduct:t,product:e}}),u=(t,e)=>({type:o.m,payload:{product:t,frequency:e}}),l=t=>({type:o.d,payload:{product:t}}),d=t=>({type:o.E,payload:t}),p=t=>({type:o.f,payload:`${t}.${Math.floor(999999*Math.random())}.${Math.round((new Date).getTime()/1e3)}`}),f=t=>({type:o.s,payload:t}),h=(t,e,r,n)=>({type:o.b,payload:{public_id:t,sig_field:e,ts:r,sig:n}}),g=t=>({type:o.J,payload:t}),y=t=>({type:o.x,payload:t}),m=t=>({type:o.o,payload:t}),b=(t=n.resolveAuth)=>function(e,r){if(window.og&&window.og.previewMode)return e(g({message:"Offers are running in preview mode"}));const{merchantId:n,authUrl:o}=r(),i=f(o);return e(i),t(o).then(({sig_field:t,ts:r,sig:o})=>e(h(n,t,r,o)),t=>e(g(t))).finally(()=>e(m(i)))},v=(t,e)=>({type:o.w,payload:{status:t,ordering:e}}),_=t=>({type:o.q,payload:t}),w=t=>({type:o.r,payload:t}),O=(t=1,e="place")=>function(r,n){const{environment:{legoUrl:o},auth:s}=n();if(!s)return r(g("No auth set."));const a=v(t,e);return r(a),i.api.fetchOrders(o,s,t,e).then(t=>{r(_(t));const e=(t.results[0]||{}).public_id;return e?i.api.fetchItems(o,s,e).then(t=>r(w(t))):null},t=>r(g(t))).finally(()=>r(m(a)))},S=t=>{switch(t){case"dev":return{type:o.z,payload:t};case"staging":return{type:o.B,payload:t};case"prod":return{type:o.A,payload:t};default:throw new Error(`${t} is not a supported environment`)}},x=()=>(t,e)=>{const{merchantId:r,sessionId:n}=e();return(!n||r&&!n.startsWith(r))&&t(p(r)),n},T=t=>({type:o.p,payload:t}),E=t=>({type:o.h,payload:t}),C=(t,e="pdp")=>({type:o.v,payload:{product:t,module:e}}),P=(t,e="pdp")=>function(r,n){const{merchantId:o,sessionId:s,environment:{apiUrl:a}}=n(),c=C(t,e);return r(c),i.api.fetchOffer(a,o,s,t,e).then(t=>r(T(t)),t=>r(E(t))).finally(()=>r(m(c)))},k=()=>({type:o.c}),j=(t,e,r,n)=>({type:o.u,payload:{product:t,order:e,quantity:r,offerId:n}}),q=t=>({type:o.g,payload:t}),A=(t,e)=>({type:o.t,payload:{item:t,frequency:e}}),N=(t,e)=>({type:o.e,payload:{response:t,product:e}}),I=(t,e,r,n=!1,o=null)=>function(s,a){const{auth:c,environment:{legoUrl:u},previewUpsellOffer:l,offerId:d}=a();if(!c)return s(g("No auth set."));const p=j(t,e,r,d);return s(p),(l?Promise.resolve({legoUrl:u,product:t,order:e,quantity:r,offer:d}):i.api.createOneTime(u,c,t.id,e,r,d)).then(e=>(s(q(e)),n?(s(A(e,o)),(l?Promise.resolve({item:e,frequency:o}):i.api.convertOneTimeToSubscription(u,c,e,o,d)).then(e=>s(N(e,t)),t=>s(E(t)))):e),t=>s(E(t))).finally(()=>s(m(p)))},R=t=>({type:o.D,payload:t}),F=t=>({type:o.y,payload:t}),L=(t,e,r)=>({type:o.a,payload:{selector:t,markup:e,config:r}}),U=t=>({type:o.I,payload:t}),D=(t,e)=>({type:o.C,payload:{product:t,firstOrderPlaceDate:e}}),M=(t,e)=>({type:o.H,payload:{product:t,productToSubscribe:e}})},function(t,e,r){"use strict";r.r(e),r.d(e,"resolveStore",(function(){return s})),r.d(e,"createRecalcProps",(function(){return a})),r.d(e,"connect",(function(){return c})),r.d(e,"setStore",(function(){return u})),r.d(e,"unsetStore",(function(){return l}));var n=r(12);let o=null;const i=t=>({dispatch:t}),s=t=>{if(!o)throw new Error("Missing redux store.");return o},a=(t,e)=>r=>{const{getState:n,dispatch:o}=s(r),i=t?t(n(),r):{},a=e(o,r);Object.assign(r,i,a)},c=(t,e=i)=>r=>{const i=a(t,"function"==typeof e?e:t=>Object(n.b)(e,t));return class extends r{get store(){return o}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=s(this).subscribe(()=>i(this)),i(this)}attributeChangedCallback(t,e,r){super.attributeChangedCallback&&super.attributeChangedCallback(t,e,r),this._storeUnsubscribe&&e!==r&&i(this)}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}}},u=t=>{o=t},l=()=>{o=void 0};e.default=c},function(t,e,r){"use strict";r.r(e),r.d(e,"withFetchJson",(function(){return s})),r.d(e,"withHost",(function(){return a})),r.d(e,"withAuth",(function(){return c})),r.d(e,"withJsonBody",(function(){return u})),r.d(e,"toQuery",(function(){return l})),r.d(e,"toProductId",(function(){return d})),r.d(e,"fetchOffer",(function(){return p})),r.d(e,"fetchOrders",(function(){return f})),r.d(e,"fetchItems",(function(){return h})),r.d(e,"createOneTime",(function(){return g})),r.d(e,"parseFrequency",(function(){return y})),r.d(e,"isFrequencyValid",(function(){return m})),r.d(e,"compareFrequencies",(function(){return b})),r.d(e,"parseFrequenciesList",(function(){return v})),r.d(e,"stringifyFrequencies",(function(){return _})),r.d(e,"stringifyFrequency",(function(){return w})),r.d(e,"convertOneTimeToSubscription",(function(){return O})),r.d(e,"api",(function(){return S}));var n=r(7),o=r.n(n);const i=(...t)=>JSON.stringify(t),s=t=>(...e)=>fetch(...t(...e)).then(t=>t.json()),a=t=>(e,...r)=>{if(!e)throw Error("host required");const[n,o={}]=t(...r);return[`${e.replace(/\/+$/,"")}${n}`,o]},c=t=>(e,...r)=>{if(!e)throw Error("auth required");const[n,o={}]=t(...r);return[n,{...o,headers:{Authorization:JSON.stringify(e),...o.headers}}]},u=t=>(...e)=>{const[r,n={}]=t(...e);return[r,{method:"POST",...n,body:JSON.stringify(n.body),headers:{"Content-type":"application/json",...n.headers}}]},l=(t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([t,e])=>[t,encodeURIComponent(e)].join("=")).join("&"),d=t=>JSON.stringify([].concat(t).map(t=>"object"==typeof t?t.id:t).filter(t=>t)),p=o()(s(a((t,e,r,n="pdp")=>{if(!t)throw Error("merchantId required");if(!e)throw Error("sessionId required");if(!r)throw Error("product required");return[`/offer/${t}/${n}?${l([["session_id",e],["page_type",1],["p",d(r)],["module_view",JSON.stringify(["regular"])]])}`]})),i),f=o()(s(a(c((t=1,e="place")=>[`/orders/?${l([["status",t],["ordering",e]])}`]))),i),h=o()(s(a(c(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),i),g=s(a(c(u((t,e,r,n)=>{if(!t)throw Error("product required");if(!e)throw Error("order required");if(!r)throw Error("quantity required");if(r<=0)throw Error("quantity must be greater or equal than one");if(!n)throw Error("offer required");return["/items/iu/",{body:{product:t,order:e,quantity:r,offer:n}}]})))),y=t=>{if("object"==typeof t)return{...t};const[e,r]=(t||"").split(/_/).map(t=>parseInt(t,10));return e&&r&&{every:e,every_period:r}},m=t=>t.match(/^\d+_\d$/),b=(t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),v=t=>[...new Set(t&&t.split(/\s+/))].filter(m).sort(b),_=t=>null==t?t:t.join(" "),w=t=>{if("object"==typeof t){const{every:e,period:r,every_period:n}=t;return`${e}_${r||n}`}return"string"==typeof t?t:""},O=s(a(c(u((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");const n=y(e);if(!n)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:t.public_id,offer:r,...n}}]})))),S={fetchOffer:p,fetchOrders:f,fetchItems:h,createOneTime:g,convertOneTimeToSubscription:O};e.default=S},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"c",(function(){return i})),r.d(e,"d",(function(){return s})),r.d(e,"b",(function(){return a}));r(1);const n=t=>t.hasAttribute("product")&&{id:t.getAttribute("product"),...t.hasAttribute("product-components")&&{components:JSON.parse(t.getAttribute("product-components"))}},o=t=>{let e=n(t);if(!e){const r=t.offer;r&&(e=n(r))}return e},i=t=>class extends t{get offer(){return(t=>{let e=t;for(;e;){if("OG-OFFER"===e.tagName)return e;e=11===e.nodeType?e.host:e.parentNode}})(this)}connectedCallback(){super.connectedCallback(),this.offersChangeTemplate=this.offersChangeTemplate.bind(this),this.offer&&this.offer.addEventListener("template-changed",this.offersChangeTemplate)}disconnectedCallback(){super.disconnectedCallback(),this.offer&&this.offer.removeEventListener("template-changed",this.offersChangeTemplate)}offersChangeTemplate(){this._enqueueUpdate()}},s=t=>class extends(i(t)){get product(){return o(this)}},a=t=>class extends t{get childOptions(){return this._childOptions||{options:[]}}connectedCallback(){const t=[];let e=null;this.querySelectorAll("option").forEach(r=>{const n=(t=>{const e=String(t||"").trim().match(/(\d+)\s*([dwm])/);return e?`${e[1]}_${{d:1,w:2,m:3}[e[2]]}`:t})(r.value),o=r.innerText.trim();t.push({value:n,text:o}),!e&&r.selected&&(e=n)}),this._childOptions={options:t,isSelected:e},super.connectedCallback&&super.connectedCallback()}}},function(t,e,r){(function(e){var r=/^\[object .+?Constructor\]$/,n="object"==typeof e&&e&&e.Object===Object&&e,o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();var s,a=Array.prototype,c=Function.prototype,u=Object.prototype,l=i["__core-js_shared__"],d=(s=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",p=c.toString,f=u.hasOwnProperty,h=u.toString,g=RegExp("^"+p.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=a.splice,m=T(i,"Map"),b=T(Object,"create");function v(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function _(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function w(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function O(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}function S(t){return!(!C(t)||(e=t,d&&d in e))&&(function(t){var e=C(t)?h.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?g:r).test(function(t){if(null!=t){try{return p.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function x(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function T(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return S(r)?r:void 0}function E(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,n);return r.cache=i.set(o,s),s};return r.cache=new(E.Cache||w),r}function C(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}v.prototype.clear=function(){this.__data__=b?b(null):{}},v.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},v.prototype.get=function(t){var e=this.__data__;if(b){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return f.call(e,t)?e[t]:void 0},v.prototype.has=function(t){var e=this.__data__;return b?void 0!==e[t]:f.call(e,t)},v.prototype.set=function(t,e){return this.__data__[t]=b&&void 0===e?"__lodash_hash_undefined__":e,this},_.prototype.clear=function(){this.__data__=[]},_.prototype.delete=function(t){var e=this.__data__,r=O(e,t);return!(r<0)&&(r==e.length-1?e.pop():y.call(e,r,1),!0)},_.prototype.get=function(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]},_.prototype.has=function(t){return O(this.__data__,t)>-1},_.prototype.set=function(t,e){var r=this.__data__,n=O(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},w.prototype.clear=function(){this.__data__={hash:new v,map:new(m||_),string:new v}},w.prototype.delete=function(t){return x(this,t).delete(t)},w.prototype.get=function(t){return x(this,t).get(t)},w.prototype.has=function(t){return x(this,t).has(t)},w.prototype.set=function(t,e){return x(this,t).set(t,e),this},E.Cache=w,t.exports=E}).call(this,r(11))},function(t,e,r){"use strict";r.d(e,"c",(function(){return o})),r.d(e,"b",(function(){return i})),r.d(e,"d",(function(){return s})),r.d(e,"a",(function(){return a}));var n=r(5);const o={type:Object,converter:{toAttribute:t=>null==t?t:JSON.stringify(t),fromAttribute:t=>t&&t.match(/[{[]/)?JSON.parse(t):{id:t}}},i={type:String,attribute:"default-frequency",converter:{fromAttribute:t=>t&&Object(n.isFrequencyValid)(t)?t:null}},s={type:Boolean,attribute:!0,reflect:!0},a={type:Object,attribute:!1}},function(t,e,r){"use strict";r.r(e),r.d(e,"OptinStatus",(function(){return u})),r.d(e,"mapStateToProps",(function(){return l})),r.d(e,"ConnectedOptinStatus",(function(){return d}));var n=r(1),o=r(2),i=r(4),s=r(8),a=r(6),c=r(10);class u extends(Object(a.d)(c.a)){static get properties(){return{subscribed:s.d,frequencyMatch:{type:Boolean,reflect:!0,attribute:"frequency-match"}}}static get styles(){return n.b`
147
+ (window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const et={};class rt extends W{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,r)=>t.reduceRight((t,r)=>Array.isArray(r)?e(r,t):(t.add(r),t),r),r=e(t,new Set),n=[];r.forEach(t=>n.unshift(t)),this._styles=n}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map(t=>{if(t instanceof CSSStyleSheet&&!Q){const e=Array.prototype.slice.call(t.cssRules).reduce((t,e)=>t+e.cssText,"");return new X(String(e),K)}return t})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Q?this.renderRoot.adoptedStyleSheets=t.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==et&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){return et}}rt.finalized=!0,rt.render=(t,e,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const n=r.scopeName,i=L.has(e),s=$&&11===e.nodeType&&!!e.host,a=s&&!z.has(n),c=a?document.createDocumentFragment():e;if(((t,e,r)=>{let n=L.get(e);void 0===n&&(o(e,e.firstChild),L.set(e,n=new P(Object.assign({templateFactory:R},r))),n.appendInto(e)),n.setValue(t),n.commit()})(t,c,Object.assign({templateFactory:B(n)},r)),a){const t=L.get(c);L.delete(c);const r=t.value instanceof _?t.value.template:void 0;H(n,c,r),o(e,e.firstChild),e.appendChild(c),L.set(e,t)}!i&&s&&window.ShadyCSS.styleElement(e.host)}},function(t,e,r){"use strict";function n(t,e){return t===e}function o(t,e,r){if(null===e||null===r||e.length!==r.length)return!1;for(var n=e.length,o=0;o<n;o++)if(!t(e[o],r[o]))return!1;return!0}function i(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every((function(t){return"function"==typeof t}))){var r=e.map((function(t){return typeof t})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return e}var s=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];var s=0,a=n.pop(),c=i(n),u=t.apply(void 0,[function(){return s++,a.apply(null,arguments)}].concat(r)),l=t((function(){for(var t=[],e=c.length,r=0;r<e;r++)t.push(c[r].apply(null,arguments));return u.apply(null,t)}));return l.resultFunc=a,l.dependencies=c,l.recomputations=function(){return s},l.resetRecomputations=function(){return s=0},l}}((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,r=null,i=null;return function(){return o(e,r,arguments)||(i=t.apply(null,arguments)),r=arguments,i}}));var a=r(7),c=r.n(a),u=r(5);r.d(e,"c",(function(){return l})),r.d(e,"j",(function(){return d})),r.d(e,"a",(function(){return f})),r.d(e,"e",(function(){return g})),r.d(e,"i",(function(){return y})),r.d(e,"f",(function(){return m})),r.d(e,"h",(function(){return b})),r.d(e,"g",(function(){return v})),r.d(e,"d",(function(){return _})),r.d(e,"b",(function(){return w})),r.d(e,"k",(function(){return O})),c.a.Cache=Map;const l=(t,e)=>{if(t===e)return!0;if("object"==typeof t&&"object"==typeof e&&t&&e&&t.id===e.id){if(!Array.isArray(t.components)||!Array.isArray(e.components))return!0;if(function(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}((t.components||[]).sort(),(e.components||[]).sort()))return!0}return!1},d=t=>t.optedin||[],p=t=>t.optedout||[],f=t=>t.autoshipByDefault||{},h=t=>t.defaultFrequencies||{},g=c()(t=>s(d,p,f,(e,r,n)=>{const o=e.find(e=>l(t,e));return o||!r.find(e=>l(t,e))&&(!(!t||!n[t.id])&&{id:t.id})}),t=>JSON.stringify(t)),y=c()(t=>s(d,e=>{const r=e.find(e=>l(t,e));return r||!1}),t=>JSON.stringify(t)),m=c()(t=>s(p,e=>e.find(e=>l(t,e)))),b=c()(t=>s(g(t),t=>t&&t.frequency||null)),v=c()(t=>s(h,e=>e[t]&&Object(u.stringifyFrequency)(e[t])||null)),_=t=>t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),w=(t,e,r,n)=>({[r]:e&&e.hasAttribute&&e.hasAttribute(_(r))&&e[r]||e.offer&&typeof("undefined"!==e.offer[r])&&e.offer[r]||t.config&&t.config[r]||n}),O=t=>({templates:t.templates||[]})},function(t,e,r){"use strict";r.r(e),r.d(e,"optinProduct",(function(){return s})),r.d(e,"optoutProduct",(function(){return a})),r.d(e,"productHasChangedComponents",(function(){return c})),r.d(e,"productChangeFrequency",(function(){return u})),r.d(e,"concludeUpsell",(function(){return l})),r.d(e,"setMerchantId",(function(){return d})),r.d(e,"createSessionId",(function(){return p})),r.d(e,"requestAuth",(function(){return f})),r.d(e,"authorize",(function(){return h})),r.d(e,"unauthorized",(function(){return g})),r.d(e,"setAuthUrl",(function(){return y})),r.d(e,"fetchDone",(function(){return m})),r.d(e,"fetchAuth",(function(){return b})),r.d(e,"requestOrders",(function(){return v})),r.d(e,"receiveOrders",(function(){return _})),r.d(e,"receiveItems",(function(){return w})),r.d(e,"fetchOrders",(function(){return O})),r.d(e,"setEnvironment",(function(){return S})),r.d(e,"requestSessionId",(function(){return x})),r.d(e,"receiveOffer",(function(){return E})),r.d(e,"fetchResponseError",(function(){return T})),r.d(e,"requestOffer",(function(){return C})),r.d(e,"fetchOffer",(function(){return P})),r.d(e,"checkout",(function(){return k})),r.d(e,"requestCreateOneTime",(function(){return j})),r.d(e,"receiveCreateOneTime",(function(){return q})),r.d(e,"requestConvertOneTimeToSubscription",(function(){return A})),r.d(e,"receiveConvertOneTime",(function(){return N})),r.d(e,"createIu",(function(){return I})),r.d(e,"setLocale",(function(){return R})),r.d(e,"setConfig",(function(){return F})),r.d(e,"addTemplate",(function(){return L})),r.d(e,"setTemplates",(function(){return U})),r.d(e,"setFirstOrderPlaceDate",(function(){return D})),r.d(e,"setProductToSubscribe",(function(){return M}));var n=r(15),o=r(0),i=r(5);const s=(t,e)=>({type:o.k,payload:{product:t,frequency:e}}),a=t=>({type:o.l,payload:{product:t}}),c=(t,e)=>({type:o.n,payload:{newProduct:t,product:e}}),u=(t,e)=>({type:o.m,payload:{product:t,frequency:e}}),l=t=>({type:o.d,payload:{product:t}}),d=t=>({type:o.E,payload:t}),p=t=>({type:o.f,payload:`${t}.${Math.floor(999999*Math.random())}.${Math.round((new Date).getTime()/1e3)}`}),f=t=>({type:o.s,payload:t}),h=(t,e,r,n)=>({type:o.b,payload:{public_id:t,sig_field:e,ts:r,sig:n}}),g=t=>({type:o.J,payload:t}),y=t=>({type:o.x,payload:t}),m=t=>({type:o.o,payload:t}),b=(t=n.resolveAuth)=>function(e,r){if(window.og&&window.og.previewMode)return e(g({message:"Offers are running in preview mode"}));const{merchantId:n,authUrl:o}=r(),i=f(o);return e(i),t(o).then(({sig_field:t,ts:r,sig:o})=>e(h(n,t,r,o)),t=>e(g(t))).finally(()=>e(m(i)))},v=(t,e)=>({type:o.w,payload:{status:t,ordering:e}}),_=t=>({type:o.q,payload:t}),w=t=>({type:o.r,payload:t}),O=(t=1,e="place")=>function(r,n){const{environment:{legoUrl:o},auth:s}=n();if(!s)return r(g("No auth set."));const a=v(t,e);return r(a),i.api.fetchOrders(o,s,t,e).then(t=>{r(_(t));const e=(t.results[0]||{}).public_id;return e?i.api.fetchItems(o,s,e).then(t=>r(w(t))):null},t=>r(g(t))).finally(()=>r(m(a)))},S=t=>{switch(t){case"dev":return{type:o.z,payload:t};case"staging":return{type:o.B,payload:t};case"prod":return{type:o.A,payload:t};default:throw new Error(`${t} is not a supported environment`)}},x=()=>(t,e)=>{const{merchantId:r,sessionId:n}=e();return(!n||r&&!n.startsWith(r))&&t(p(r)),n},E=t=>({type:o.p,payload:t}),T=t=>({type:o.h,payload:t}),C=(t,e="pdp")=>({type:o.v,payload:{product:t,module:e}}),P=(t,e="pdp")=>function(r,n){const{merchantId:o,sessionId:s,environment:{apiUrl:a}}=n(),c=C(t,e);return r(c),i.api.fetchOffer(a,o,s,t,e).then(t=>r(E(t)),t=>r(T(t))).finally(()=>r(m(c)))},k=()=>({type:o.c}),j=(t,e,r,n)=>({type:o.u,payload:{product:t,order:e,quantity:r,offerId:n}}),q=t=>({type:o.g,payload:t}),A=(t,e)=>({type:o.t,payload:{item:t,frequency:e}}),N=(t,e)=>({type:o.e,payload:{response:t,product:e}}),I=(t,e,r,n=!1,o=null)=>function(s,a){const{auth:c,environment:{legoUrl:u},previewUpsellOffer:l,offerId:d}=a();if(!c)return s(g("No auth set."));const p=j(t,e,r,d);return s(p),(l?Promise.resolve({legoUrl:u,product:t,order:e,quantity:r,offer:d}):i.api.createOneTime(u,c,t.id,e,r,d)).then(e=>(s(q(e)),n?(s(A(e,o)),(l?Promise.resolve({item:e,frequency:o}):i.api.convertOneTimeToSubscription(u,c,e,o,d)).then(e=>s(N(e,t)),t=>s(T(t)))):e),t=>s(T(t))).finally(()=>s(m(p)))},R=t=>({type:o.D,payload:t}),F=t=>({type:o.y,payload:t}),L=(t,e,r)=>({type:o.a,payload:{selector:t,markup:e,config:r}}),U=t=>({type:o.I,payload:t}),D=(t,e)=>({type:o.C,payload:{product:t,firstOrderPlaceDate:e}}),M=(t,e)=>({type:o.H,payload:{product:t,productToSubscribe:e}})},function(t,e,r){"use strict";r.r(e),r.d(e,"resolveStore",(function(){return s})),r.d(e,"createRecalcProps",(function(){return a})),r.d(e,"connect",(function(){return c})),r.d(e,"setStore",(function(){return u})),r.d(e,"unsetStore",(function(){return l}));var n=r(12);let o=null;const i=t=>({dispatch:t}),s=t=>{if(!o)throw new Error("Missing redux store.");return o},a=(t,e)=>r=>{const{getState:n,dispatch:o}=s(r),i=t?t(n(),r):{},a=e(o,r);Object.assign(r,i,a)},c=(t,e=i)=>r=>{const i=a(t,"function"==typeof e?e:t=>Object(n.b)(e,t));return class extends r{get store(){return o}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=s(this).subscribe(()=>i(this)),i(this)}attributeChangedCallback(t,e,r){super.attributeChangedCallback&&super.attributeChangedCallback(t,e,r),this._storeUnsubscribe&&e!==r&&i(this)}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}}},u=t=>{o=t},l=()=>{o=void 0};e.default=c},function(t,e,r){"use strict";r.r(e),r.d(e,"withFetchJson",(function(){return s})),r.d(e,"withHost",(function(){return a})),r.d(e,"withAuth",(function(){return c})),r.d(e,"withJsonBody",(function(){return u})),r.d(e,"toQuery",(function(){return l})),r.d(e,"toProductId",(function(){return d})),r.d(e,"fetchOffer",(function(){return p})),r.d(e,"fetchOrders",(function(){return f})),r.d(e,"fetchItems",(function(){return h})),r.d(e,"createOneTime",(function(){return g})),r.d(e,"parseFrequency",(function(){return y})),r.d(e,"isFrequencyValid",(function(){return m})),r.d(e,"compareFrequencies",(function(){return b})),r.d(e,"parseFrequenciesList",(function(){return v})),r.d(e,"stringifyFrequencies",(function(){return _})),r.d(e,"stringifyFrequency",(function(){return w})),r.d(e,"convertOneTimeToSubscription",(function(){return O})),r.d(e,"api",(function(){return S}));var n=r(7),o=r.n(n);const i=(...t)=>JSON.stringify(t),s=t=>(...e)=>fetch(...t(...e)).then(t=>t.json()),a=t=>(e,...r)=>{if(!e)throw Error("host required");const[n,o={}]=t(...r);return[`${e.replace(/\/+$/,"")}${n}`,o]},c=t=>(e,...r)=>{if(!e)throw Error("auth required");const[n,o={}]=t(...r);return[n,{...o,headers:{Authorization:JSON.stringify(e),...o.headers}}]},u=t=>(...e)=>{const[r,n={}]=t(...e);return[r,{method:"POST",...n,body:JSON.stringify(n.body),headers:{"Content-type":"application/json",...n.headers}}]},l=(t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([t,e])=>[t,encodeURIComponent(e)].join("=")).join("&"),d=t=>JSON.stringify([].concat(t).map(t=>"object"==typeof t?t.id:t).filter(t=>t)),p=o()(s(a((t,e,r,n="pdp")=>{if(!t)throw Error("merchantId required");if(!e)throw Error("sessionId required");if(!r)throw Error("product required");return[`/offer/${t}/${n}?${l([["session_id",e],["page_type",1],["p",d(r)],["module_view",JSON.stringify(["regular"])]])}`]})),i),f=o()(s(a(c((t=1,e="place")=>[`/orders/?${l([["status",t],["ordering",e]])}`]))),i),h=o()(s(a(c(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),i),g=s(a(c(u((t,e,r,n)=>{if(!t)throw Error("product required");if(!e)throw Error("order required");if(!r)throw Error("quantity required");if(r<=0)throw Error("quantity must be greater or equal than one");if(!n)throw Error("offer required");return["/items/iu/",{body:{product:t,order:e,quantity:r,offer:n}}]})))),y=t=>{if("object"==typeof t)return{...t};const[e,r]=(t||"").split(/_/).map(t=>parseInt(t,10));return e&&r&&{every:e,every_period:r}},m=t=>t.match(/^\d+_\d$/),b=(t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),v=t=>[...new Set(t&&t.split(/\s+/))].filter(m).sort(b),_=t=>null==t?t:t.join(" "),w=t=>{if("object"==typeof t){const{every:e,period:r,every_period:n}=t;return`${e}_${r||n}`}return"string"==typeof t?t:""},O=s(a(c(u((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");const n=y(e);if(!n)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:t.public_id,offer:r,...n}}]})))),S={fetchOffer:p,fetchOrders:f,fetchItems:h,createOneTime:g,convertOneTimeToSubscription:O};e.default=S},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"c",(function(){return i})),r.d(e,"d",(function(){return s})),r.d(e,"b",(function(){return a}));r(1);const n=t=>t.hasAttribute("product")&&{id:t.getAttribute("product"),...t.hasAttribute("product-components")&&{components:JSON.parse(t.getAttribute("product-components"))}},o=t=>{let e=n(t);if(!e){const r=t.offer;r&&(e=n(r))}return e},i=t=>class extends t{get offer(){return(t=>{let e=t;for(;e;){if("OG-OFFER"===e.tagName)return e;e=11===e.nodeType?e.host:e.parentNode}})(this)}connectedCallback(){super.connectedCallback(),this.offersChangeTemplate=this.offersChangeTemplate.bind(this),this.offer&&this.offer.addEventListener("template-changed",this.offersChangeTemplate)}disconnectedCallback(){super.disconnectedCallback(),this.offer&&this.offer.removeEventListener("template-changed",this.offersChangeTemplate)}offersChangeTemplate(){this._enqueueUpdate()}},s=t=>class extends(i(t)){get product(){return o(this)}},a=t=>class extends t{get childOptions(){return this._childOptions||{options:[]}}connectedCallback(){const t=[];let e=null;this.querySelectorAll("option").forEach(r=>{const n=(t=>{const e=String(t||"").trim().match(/(\d+)\s*([dwm])/);return e?`${e[1]}_${{d:1,w:2,m:3}[e[2]]}`:t})(r.value),o=r.innerText.trim();t.push({value:n,text:o}),!e&&r.selected&&(e=n)}),this._childOptions={options:t,isSelected:e},super.connectedCallback&&super.connectedCallback()}}},function(t,e,r){(function(e){var r=/^\[object .+?Constructor\]$/,n="object"==typeof e&&e&&e.Object===Object&&e,o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();var s,a=Array.prototype,c=Function.prototype,u=Object.prototype,l=i["__core-js_shared__"],d=(s=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",p=c.toString,f=u.hasOwnProperty,h=u.toString,g=RegExp("^"+p.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=a.splice,m=E(i,"Map"),b=E(Object,"create");function v(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function _(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function w(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function O(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}function S(t){return!(!C(t)||(e=t,d&&d in e))&&(function(t){var e=C(t)?h.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?g:r).test(function(t){if(null!=t){try{return p.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function x(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function E(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return S(r)?r:void 0}function T(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,n);return r.cache=i.set(o,s),s};return r.cache=new(T.Cache||w),r}function C(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}v.prototype.clear=function(){this.__data__=b?b(null):{}},v.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},v.prototype.get=function(t){var e=this.__data__;if(b){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return f.call(e,t)?e[t]:void 0},v.prototype.has=function(t){var e=this.__data__;return b?void 0!==e[t]:f.call(e,t)},v.prototype.set=function(t,e){return this.__data__[t]=b&&void 0===e?"__lodash_hash_undefined__":e,this},_.prototype.clear=function(){this.__data__=[]},_.prototype.delete=function(t){var e=this.__data__,r=O(e,t);return!(r<0)&&(r==e.length-1?e.pop():y.call(e,r,1),!0)},_.prototype.get=function(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]},_.prototype.has=function(t){return O(this.__data__,t)>-1},_.prototype.set=function(t,e){var r=this.__data__,n=O(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},w.prototype.clear=function(){this.__data__={hash:new v,map:new(m||_),string:new v}},w.prototype.delete=function(t){return x(this,t).delete(t)},w.prototype.get=function(t){return x(this,t).get(t)},w.prototype.has=function(t){return x(this,t).has(t)},w.prototype.set=function(t,e){return x(this,t).set(t,e),this},T.Cache=w,t.exports=T}).call(this,r(11))},function(t,e,r){"use strict";r.d(e,"c",(function(){return o})),r.d(e,"b",(function(){return i})),r.d(e,"d",(function(){return s})),r.d(e,"a",(function(){return a}));var n=r(5);const o={type:Object,converter:{toAttribute:t=>null==t?t:JSON.stringify(t),fromAttribute:t=>t&&t.match(/[{[]/)?JSON.parse(t):{id:t}}},i={type:String,attribute:"default-frequency",converter:{fromAttribute:t=>t&&Object(n.isFrequencyValid)(t)?t:null}},s={type:Boolean,attribute:!0,reflect:!0},a={type:Object,attribute:!1}},function(t,e,r){"use strict";r.r(e),r.d(e,"OptinStatus",(function(){return u})),r.d(e,"mapStateToProps",(function(){return l})),r.d(e,"ConnectedOptinStatus",(function(){return d}));var n=r(1),o=r(2),i=r(4),s=r(8),a=r(6),c=r(10);class u extends(Object(a.d)(c.a)){static get properties(){return{subscribed:s.d,frequencyMatch:{type:Boolean,reflect:!0,attribute:"frequency-match"}}}static get styles(){return n.b`
148
148
  :host {
149
149
  cursor: default;
150
150
  display: inline-block;
@@ -208,7 +208,7 @@ const Q=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
208
208
  <slot name="frequency-mismatch"></slot>
209
209
  `:n.c`
210
210
  <slot name="not-subscribed"></slot>
211
- `}}const l=(t,e={})=>({subscribed:Object(o.e)(e.product)(t),frequency:Object(o.h)(e.product)(t),...Object(o.b)(t,e,"defaultFrequency"),...Object(o.k)(t,e)}),d=Object(i.connect)(l)(u);e.default=d},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(1),o=r(2);const i=(s=n.a,class extends s{getOption(t,e=t){const r=Object(o.d)(t);if(this.hasAttribute(r)){const t=this.getAttribute(r);return"true"===t.toString().toLowerCase()||"false"!==t.toString().toLowerCase()&&t}return this.template&&this.template.config&&void 0!==this.template.config[e]?this.template.config[e]:this.config&&void 0!==this.config[e]?this.config[e]:void 0}applyTemplate(t){this.template=t;const e=void 0===t.markup?this.constructor.initialTemplate:t.markup;e&&this._templateMarkup!==e&&(this._templateMarkup=e,this.innerHTML=e)}refreshTemplate(){if(this._templates&&this._templates.length){const t=this._templates.find(({selector:t})=>{console.log({selector:t});try{return this.matches(t)}catch(t){return!1}});console.log("refreshTemplate",t),t&&this.applyTemplate(t||{})}}set templates(t){this._templates!==t&&(this._templates=t,this.refreshTemplate())}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.constructor.initialTemplate&&!this.innerHTML.trim()&&(this._templateMarkup=this.constructor.initialTemplate,this.innerHTML=this.constructor.initialTemplate)}});var s},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.d(e,"a",(function(){return y})),r.d(e,"b",(function(){return d})),r.d(e,"c",(function(){return u})),r.d(e,"d",(function(){return g})),r.d(e,"e",(function(){return a}));var n=r(24),o=function(){return Math.random().toString(36).substring(7).split("").join(".")},i={INIT:"@@redux/INIT"+o(),REPLACE:"@@redux/REPLACE"+o(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+o()}};function s(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function a(t,e,r){var o;if("function"==typeof e&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof e&&void 0===r&&(r=e,e=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(a)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var c=t,u=e,l=[],d=l,p=!1;function f(){d===l&&(d=l.slice())}function h(){if(p)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return u}function g(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(p)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var e=!0;return f(),d.push(t),function(){if(e){if(p)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");e=!1,f();var r=d.indexOf(t);d.splice(r,1),l=null}}}function y(t){if(!s(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,u=c(u,t)}finally{p=!1}for(var e=l=d,r=0;r<e.length;r++){(0,e[r])()}return t}function m(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");c=t,y({type:i.REPLACE})}function b(){var t,e=g;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function r(){t.next&&t.next(h())}return r(),{unsubscribe:e(r)}}})[n.a]=function(){return this},t}return y({type:i.INIT}),(o={dispatch:y,subscribe:g,getState:h,replaceReducer:m})[n.a]=b,o}function c(t,e){var r=e&&e.type;return"Given "+(r&&'action "'+String(r)+'"'||"an action")+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function u(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var o=e[n];0,"function"==typeof t[o]&&(r[o]=t[o])}var s,a=Object.keys(r);try{!function(t){Object.keys(t).forEach((function(e){var r=t[e];if(void 0===r(void 0,{type:i.INIT}))throw new Error('Reducer "'+e+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+e+"\" returned undefined when probed with a random type. Don't try to handle "+i.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(r)}catch(t){s=t}return function(t,e){if(void 0===t&&(t={}),s)throw s;for(var n=!1,o={},i=0;i<a.length;i++){var u=a[i],l=r[u],d=t[u],p=l(d,e);if(void 0===p){var f=c(u,e);throw new Error(f)}o[u]=p,n=n||p!==d}return(n=n||a.length!==Object.keys(t).length)?o:t}}function l(t,e){return function(){return e(t.apply(this,arguments))}}function d(t,e){if("function"==typeof t)return l(t,e);if("object"!=typeof t||null===t)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===t?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var r={};for(var n in t){var o=t[n];"function"==typeof o&&(r[n]=l(o,e))}return r}function p(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f(t,e){var r=Object.keys(t);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(t)),e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(r,!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function g(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function y(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return h({},r,{dispatch:n=g.apply(void 0,i)(r.dispatch)})}}}},function(t,e,r){"use strict";r.r(e),r.d(e,"frequencyText",(function(){return l})),r.d(e,"FrequencyStatus",(function(){return d})),r.d(e,"mapStateToProps",(function(){return p})),r.d(e,"ConnectedFrequencyStatus",(function(){return f}));var n=r(1),o=r(2),i=r(4),s=r(8),a=r(5),c=r(6),u=r(10);const l=(t,e)=>{const{every:r,every_period:o}=Object(a.parseFrequency)(t);return n.c`
211
+ `}}const l=(t,e={})=>({subscribed:Object(o.e)(e.product)(t),frequency:Object(o.h)(e.product)(t),...Object(o.b)(t,e,"defaultFrequency"),...Object(o.k)(t,e)}),d=Object(i.connect)(l)(u);e.default=d},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(1),o=r(2);const i=(s=n.a,class extends s{getOption(t,e=t){const r=Object(o.d)(t);if(this.hasAttribute(r)){const t=this.getAttribute(r);return"true"===t.toString().toLowerCase()||"false"!==t.toString().toLowerCase()&&t}return this.template&&this.template.config&&void 0!==this.template.config[e]?this.template.config[e]:this.config&&void 0!==this.config[e]?this.config[e]:void 0}applyTemplate(t){this.template=t;const e=void 0===t.markup?this.constructor.initialTemplate:t.markup;e&&this._templateMarkup!==e&&(this._templateMarkup=e,this.innerHTML=e)}refreshTemplate(){if(this._templates&&this._templates.length){const t=this._templates.find(({selector:t})=>{try{return this.matches(t)}catch(t){return!1}});this.applyTemplate(t||{})}}set templates(t){this._templates=t,this.refreshTemplate()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.constructor.initialTemplate&&!this.innerHTML.trim()&&(this.innerHTML=this.constructor.initialTemplate)}});var s},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.d(e,"a",(function(){return y})),r.d(e,"b",(function(){return d})),r.d(e,"c",(function(){return u})),r.d(e,"d",(function(){return g})),r.d(e,"e",(function(){return a}));var n=r(24),o=function(){return Math.random().toString(36).substring(7).split("").join(".")},i={INIT:"@@redux/INIT"+o(),REPLACE:"@@redux/REPLACE"+o(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+o()}};function s(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function a(t,e,r){var o;if("function"==typeof e&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof e&&void 0===r&&(r=e,e=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(a)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var c=t,u=e,l=[],d=l,p=!1;function f(){d===l&&(d=l.slice())}function h(){if(p)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return u}function g(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(p)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var e=!0;return f(),d.push(t),function(){if(e){if(p)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");e=!1,f();var r=d.indexOf(t);d.splice(r,1),l=null}}}function y(t){if(!s(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,u=c(u,t)}finally{p=!1}for(var e=l=d,r=0;r<e.length;r++){(0,e[r])()}return t}function m(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");c=t,y({type:i.REPLACE})}function b(){var t,e=g;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function r(){t.next&&t.next(h())}return r(),{unsubscribe:e(r)}}})[n.a]=function(){return this},t}return y({type:i.INIT}),(o={dispatch:y,subscribe:g,getState:h,replaceReducer:m})[n.a]=b,o}function c(t,e){var r=e&&e.type;return"Given "+(r&&'action "'+String(r)+'"'||"an action")+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function u(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var o=e[n];0,"function"==typeof t[o]&&(r[o]=t[o])}var s,a=Object.keys(r);try{!function(t){Object.keys(t).forEach((function(e){var r=t[e];if(void 0===r(void 0,{type:i.INIT}))throw new Error('Reducer "'+e+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+e+"\" returned undefined when probed with a random type. Don't try to handle "+i.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(r)}catch(t){s=t}return function(t,e){if(void 0===t&&(t={}),s)throw s;for(var n=!1,o={},i=0;i<a.length;i++){var u=a[i],l=r[u],d=t[u],p=l(d,e);if(void 0===p){var f=c(u,e);throw new Error(f)}o[u]=p,n=n||p!==d}return(n=n||a.length!==Object.keys(t).length)?o:t}}function l(t,e){return function(){return e(t.apply(this,arguments))}}function d(t,e){if("function"==typeof t)return l(t,e);if("object"!=typeof t||null===t)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===t?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var r={};for(var n in t){var o=t[n];"function"==typeof o&&(r[n]=l(o,e))}return r}function p(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f(t,e){var r=Object.keys(t);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(t)),e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(r,!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function g(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function y(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return h({},r,{dispatch:n=g.apply(void 0,i)(r.dispatch)})}}}},function(t,e,r){"use strict";r.r(e),r.d(e,"frequencyText",(function(){return l})),r.d(e,"FrequencyStatus",(function(){return d})),r.d(e,"mapStateToProps",(function(){return p})),r.d(e,"ConnectedFrequencyStatus",(function(){return f}));var n=r(1),o=r(2),i=r(4),s=r(8),a=r(5),c=r(6),u=r(10);const l=(t,e)=>{const{every:r,every_period:o}=Object(a.parseFrequency)(t);return n.c`
212
212
  ${r}
213
213
  <og-text key="frequencyPeriods" variant="${o}" pluralize="${r}"></og-text>
214
214
  ${e&&e===t?n.c`
@@ -233,7 +233,7 @@ const Q=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
233
233
  <slot name="frequency-mismatch"></slot>
234
234
  `||""}
235
235
  </span>
236
- `}}const p=(t,e)=>({subscribed:Object(o.e)(e.product)(t),frequency:Object(o.h)(e.product)(t),productDefaultFrequency:Object(o.g)((e.product||{}).id)(t),...Object(o.b)(t,e,"frequencies",[]),...Object(o.b)(t,e,"defaultFrequency"),...Object(o.k)(t,e)}),f=Object(i.connect)(p)(d);e.default=f},function(t,e,r){"use strict";r.r(e),function(t){r.d(e,"STORE_ROOT",(function(){return s})),r.d(e,"safeParseState",(function(){return a})),r.d(e,"loadState",(function(){return u})),r.d(e,"serializeState",(function(){return l})),r.d(e,"saveState",(function(){return d})),r.d(e,"listenLocalStorageChanges",(function(){return p})),r.d(e,"clearState",(function(){return f}));var n=r(17),o=r(3),i=r(0);const s="OG_STATE",a=t=>{try{if(null===t)return;return JSON.parse(t)}catch(t){return}},c=()=>window.og&&window.og.previewMode,u=()=>c()?{}:a(localStorage.getItem(s)),l=t=>!(!t||!t.sessionId)&&JSON.stringify({sessionId:t.sessionId,optedin:t.optedin,optedout:t.optedout,productOffer:t.productOffer,firstOrderPlaceDate:t.firstOrderPlaceDate,productToSubscribe:t.productToSubscribe}),d=t=>{if(c())return;const e=l(t);e&&localStorage.getItem(s)!==e&&localStorage.setItem(s,e)},p=e=>Object(n.throttle)(500,r=>{if(c())return;const{key:n,newValue:u}=r;n===s&&null===u?(e.dispatch({type:i.j}),t(()=>e.dispatch(Object(o.requestSessionId)()))):n===s&&e.dispatch({type:i.i,newValue:a(u)})}),f=()=>localStorage.removeItem(s)}.call(this,r(16).setImmediate)},function(t,e,r){window,t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";r.r(e),r.d(e,"ogAuthRegExp",(function(){return n})),r.d(e,"readAuthCookie",(function(){return o})),r.d(e,"parseAuth",(function(){return i})),r.d(e,"iframeLoad",(function(){return s})),r.d(e,"isJsonResponse",(function(){return a})),r.d(e,"resolveAuth",(function(){return c}));const n=/^og_auth=/,o=(t=n)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace(n,""),i=t=>{if("object"==typeof t)return t;const e=(t||"").split("|");return 3===e.length?{sig_field:e[0],ts:parseInt(e[1],10),sig:e[2]}:null},s=t=>new Promise((e,r)=>{const n=document.createElement("iframe");n.style.setProperty("display","none","important"),document.body.appendChild(n),n.onload=e,n.onerror=r,n.src=t}),a=t=>-1!==(t.headers.get("content-type")||"").indexOf("application/json"),c=(t,e=o,r=s)=>Promise.resolve(e()||t&&"string"==typeof t&&fetch(t).then(n=>n.status>=200&&n.status<300?e()||(a(n)?n.json():Promise.resolve(r(t)).then(e)):null)).then(i).then(t=>null===t?Promise.reject(new Error("Unauthorized")):t);e.default=c}])},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(o.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new i(o.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(19),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(11))},function(t,e,r){!function(t){"use strict";function e(t,e,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function c(){for(var c=arguments.length,u=new Array(c),l=0;l<c;l++)u[l]=arguments[l];var d=this,p=Date.now()-s;function f(){s=Date.now(),r.apply(d,u)}function h(){o=void 0}i||(n&&!o&&f(),a(),void 0===n&&p>t?f():!0!==e&&(o=setTimeout(n?h:f,void 0===n?t-p:t)))}return"boolean"!=typeof e&&(n=r,r=e,e=void 0),c.cancel=function(){a(),i=!0},c}t.debounce=function(t,r,n){return void 0===n?e(t,r,!1):e(t,n,!1!==r)},t.throttle=e,Object.defineProperty(t,"__esModule",{value:!0})}(e)},,function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,o,i,s,a,c=1,u={},l=!1,d=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){h(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){h(t.data)},n=function(t){i.port2.postMessage(t)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,n=function(t){var e=d.createElement("script");e.onreadystatechange=function(){h(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):n=function(t){setTimeout(h,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&h(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(s+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var o={callback:t,args:e};return u[c]=o,n(c),c++},p.clearImmediate=f}function f(t){delete u[t]}function h(t){if(l)setTimeout(h,0,t);else{var e=u[t];if(e){l=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{f(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(11),r(20))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var c,u=[],l=!1,d=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!l){var t=a(p);l=!0;for(var e=u.length;e;){for(c=u,u=[];++d<e;)c&&c[d].run();d=-1,e=u.length}c=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new h(t,e)),1!==u.length||l||a(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){const r={PAR_OPEN:"(".charCodeAt(0),PAR_CLOSE:")".charCodeAt(0),OP_NOT:"!".charCodeAt(0),BINARY_AND:"&".charCodeAt(0),BINARY_OR:"|".charCodeAt(0),LITERAL:"LITERAL",END:"END",LEAF:"LEAF",ATOMIC:"ATOMIC"};t.exports=r},,function(t,e,r){"use strict";r.r(e),r.d(e,"optedin",(function(){return a})),r.d(e,"optedout",(function(){return c})),r.d(e,"nextUpcomingOrder",(function(){return u})),r.d(e,"autoshipEligible",(function(){return l})),r.d(e,"inStock",(function(){return d})),r.d(e,"eligibilityGroups",(function(){return p})),r.d(e,"incentives",(function(){return h})),r.d(e,"frequency",(function(){return g})),r.d(e,"auth",(function(){return y})),r.d(e,"merchantId",(function(){return m})),r.d(e,"authUrl",(function(){return b})),r.d(e,"offer",(function(){return v})),r.d(e,"offerId",(function(){return _})),r.d(e,"sessionId",(function(){return w})),r.d(e,"productOffer",(function(){return O})),r.d(e,"firstOrderPlaceDate",(function(){return S})),r.d(e,"productToSubscribe",(function(){return x})),r.d(e,"environment",(function(){return T})),r.d(e,"locale",(function(){return E})),r.d(e,"config",(function(){return C})),r.d(e,"previewStandardOffer",(function(){return P})),r.d(e,"previewUpsellOffer",(function(){return k})),r.d(e,"autoshipByDefault",(function(){return j})),r.d(e,"defaultFrequencies",(function(){return q})),r.d(e,"templates",(function(){return A}));var n=r(12),o=r(0),i=r(2),s=r(5);const a=(t=[],e)=>{switch(e.type){case o.j:return[];case o.i:return e.newValue?e.newValue.optedin:t;case o.k:case o.m:const[[r],n]=t.reduce((t,r)=>t[Object(i.c)(e.payload.product,r)?0:1].push(r)&&t,[[],[]]);return(n||[]).concat({...r,...e.payload.product,frequency:e.payload.frequency});case o.l:return t.filter(t=>!Object(i.c)(e.payload.product,t));case o.n:return t.map(t=>Object(i.c)(e.payload.product,t)?{...t,...e.payload.newProduct}:t);case o.e:return t.filter(t=>!Object(i.c)(e.payload.product,t));case o.c:return[];default:return t}},c=(t=[],e)=>{switch(e.type){case o.j:return[];case o.i:return e.newValue?e.newValue.optedout:t;case o.k:case o.m:return t.filter(t=>!Object(i.c)(e.payload.product,t));case o.l:const[[r],n]=t.reduce((t,r)=>t[Object(i.c)(e.payload.product,r)?0:1].push(r)&&t,[[],[]]);return(n||[]).concat({...r,...e.payload.product,frequency:e.payload.frequency});case o.n:return t.map(t=>Object(i.c)(e.payload.product,t)?{...t,...e.payload.newProduct}:t);case o.c:return[];default:return t}},u=(t={},{type:e,payload:r})=>{switch(e){case o.q:return r&&r.count>0?{...t,...r.results[0]&&{...r.results[0],place:new Date(Date.parse(r.results[0].place.replace(/-/gi,"/")))}}:t;case o.r:return{...t,products:(r.results||[]).map(t=>t.product)};case o.g:return{...t,...r,public_id:r.order,...r.product&&{products:(t.products||[]).concat(r.product)}};default:return t}},l=(t={},e)=>{switch(e.type){case o.p:return{...t,...e.payload.autoship};default:return t}},d=(t={},e)=>{switch(e.type){case o.p:return{...t,...e.payload.in_stock};default:return t}},p=(t={},e)=>{switch(e.type){case o.p:return{...t,...e.payload.eligibility_groups};default:return t}},f=(t,e)=>t.map(t=>({...e[t],id:[t][0]})),h=(t={},e)=>{switch(e.type){case o.p:return{...t,...[...new Set(Object.keys(e.payload.incentives||{}))].reduce((t,r)=>({...t,[r]:Object.entries(e.payload.incentives).filter(([t])=>t===r).reduce((t,[,{initial:r,ongoing:n}])=>({...t,initial:[...t.initial||[],...f(r,e.payload.incentives_display)],ongoing:[...t.ongoing||[],...f(n,e.payload.incentives_display)]}),{})}),{})};default:return t}},g=(t={},e)=>{switch(e.type){case o.k:case o.m:return{...t,[e.payload.product]:e.payload.frequency};case o.l:return{...t,[e.payload.product]:void 0};default:return t}},y=(t=!1,e)=>{switch(e.type){case o.b:return{...e.payload};case o.J:return!1;default:return t}},m=(t="",e)=>{switch(e.type){case o.E:return e.payload;default:return t}},b=(t=null,e)=>{switch(e.type){case o.x:return e.payload;default:return t}},v=(t={},e)=>{switch(e.type){case o.p:return{...t,offerId:(e.payload.module_view||{}).regular,...e.payload.modifiers};default:return t}},_=(t="",e)=>{switch(e.type){case o.p:return(e.payload.module_view||{}).regular||"";default:return t}},w=(t=null,e)=>{switch(e.type){case o.j:return null;case o.f:return e.payload;default:return t}},O=(t={},e)=>{switch(e.type){case o.p:return{...t,...Object.entries(e.payload.autoship).map(([t])=>({[t]:Object.keys(e.payload.modifiers)})).reduce((t,e)=>({...t,...e}))};case o.c:return{};default:return t}},S=(t={},e)=>{switch(e.type){case o.C:return{...t,[e.payload.product]:e.payload.firstOrderPlaceDate};default:return t}},x=(t={},e)=>{switch(e.type){case o.H:return{...t,[e.payload.product]:e.payload.productToSubscribe};default:return t}},T=(t={},e)=>{switch(e.type){case o.B:return{...t,name:"staging",apiUrl:"https://staging.om.ordergroove.com",legoUrl:"https://staging.restapi.ordergroove.com"};case o.z:return{...t,name:"dev",apiUrl:"https://dev.om.ordergroove.com",legoUrl:"https://dev.restapi.ordergroove.com"};case o.A:return{...t,name:"prod",apiUrl:"https://om.ordergroove.com",legoUrl:"https://restapi.ordergroove.com"};default:return t}},E=(t={offerOptInLabel:"Subscribe",offerOptOutLabel:"Purchase one time",offerEveryLabel:"Every",offerTooltipTrigger:"Hover for additional info",offerTooltipContent:"Seems this is a great subscription offering. Many fun details about this program exist.",optinButtonLabel:"•",optoutButtonLabel:"•",optinStatusOptedInLabel:"You're opted in!",optinStatusOptedOutLabel:"You're not opted in.",optinToggleLabel:"•",upsellButtonLabel:"Add item to order on ",upsellButtonPrefix:"",upsellModalContent:"Some upsell modal content",upsellModalOptInLabel:"Subscribe",upsellModalOptOutLabel:"Purchase one time",upsellModalTitle:"Impulse Upsell",upsellModalConfirmLabel:"Ok",upsellModalCancelLabel:"Cancel",defaultFrequencyCopy:"(Recommended)",frequencyPeriods:{1:"day",2:"week",3:"month"}},e)=>{switch(e.type){case o.D:return{...t,...e.payload};default:return t}},C=(t={frequencies:["1_2","1_2","1_3"],offerType:"radio"},e)=>{switch(e.type){case o.y:return{...t,...e.payload,defaultFrequency:e.payload.defaultFrequency?Object(s.stringifyFrequency)(e.payload.defaultFrequency):t.defaultFrequency,frequencies:e.payload.frequencies?e.payload.frequencies.map(s.stringifyFrequency):t.frequencies};default:return t}},P=(t=!1,e)=>{switch(e.type){case o.F:return e.payload;default:return t}},k=(t=!1,e)=>{switch(e.type){case o.G:return e.payload;default:return t}},j=(t=[],e)=>{switch(e.type){case o.p:return{...t,...e.payload.autoship_by_default};default:return t}},q=(t=[],e)=>{switch(e.type){case o.p:return{...t,...e.payload.default_frequencies};default:return t}},A=(t=[],e)=>{switch(e.type){case o.I:return[...e.payload||[]];case o.a:return[e.payload,...t];default:return t}};e.default=Object(n.c)({environment:T,optedin:a,optedout:c,merchantId:m,offer:v,offerId:_,productOffer:O,sessionId:w,inStock:d,eligibilityGroups:p,autoshipByDefault:j,autoshipEligible:l,incentives:h,nextUpcomingOrder:u,auth:y,authUrl:b,locale:E,config:C,previewStandardOffer:P,previewUpsellOffer:k,templates:A,defaultFrequencies:q,firstOrderPlaceDate:S,productToSubscribe:x})},function(t,e,r){"use strict";(function(t,n){var o,i=r(26);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:n;var s=Object(i.a)(o);e.a=s}).call(this,r(11),r(31)(t))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return c})),r.d(e,"b",(function(){return u}));var n=r(17),o=r(0),i=(r(2),r(14));const s=e=>({payload:{product:{id:r,components:n}={}}={}}={})=>t(()=>((t,e,r=document)=>r.dispatchEvent(new CustomEvent(t,{detail:e})))("optin-changed",{productId:r,components:n,optedIn:e})),a=[{expressions:[({type:t}={})=>t===o.k,({type:t}={})=>t===o.m],fn:s(!0)},{expressions:[({type:t}={})=>t===o.l],fn:s(!1)}],c=t=>e=>r=>{const n=t.getState();a.forEach(t=>{t.expressions.some(t=>t(r,n))&&t.fn(r)}),e(r)},u=t=>e=>r=>{e(r);const s=Object(n.throttle)(500,()=>{Object(i.saveState)({...t.getState()})});r.type!==o.i&&s()}}).call(this,r(16).setImmediate)},function(t,e,r){"use strict";function n(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}r.d(e,"a",(function(){return n}))},function(t,e,r){const n=r(33),o=r(34),i=r(35);t.exports={parse:(t,e)=>{const r=n(t),s=o.PolishNotation(r),a=o.PolishGenerator(s),c=i.make(a);return i.nodeEvaluator(c,e)}}},,function(t,e,r){const{offersLiveEditor:n}=r(30),{setStore:o}=r(4),{getStore:i}=r(51),{listenLocalStorageChanges:s}=r(14),a=r(32),c=r(3),{ConnectedWhen:u}=r(52),{ConnectedOptinButton:l}=r(36),{ConnectedOptoutButton:d}=r(37),{ConnectedOptinSelect:p}=r(38),{ConnectedUpsellButton:f}=r(39),{ConnectedUpsellModal:h}=r(40),{ConnectedOptinToggle:g}=r(41),{ConnectedOptinStatus:y}=r(9),{ConnectedText:m}=r(42),{ConnectedIncentiveText:b}=r(43),{ConnectedSelectFrequency:v}=r(44),{ConnectedNextUpcomingOrder:_}=r(53),{ConnectedOffer:w}=r(45),{Modal:O}=r(46),{Select:S}=r(47),{Tooltip:x}=r(48),{ConnectedFrequencyStatus:T}=r(13),E=r(49),{default:C}=r(5),{environment:P}=r(23);let k;E.enable();const j={setEnvironment:t=>(k.dispatch(c.setEnvironment(t)),j),setMerchantId:t=>(k.dispatch(c.setMerchantId(t)),j),setAuthUrl:t=>(k.dispatch(c.setAuthUrl(t)),j),getProductsForPurchasePost:(t=[])=>a.getProductsForPurchasePost(k.getState(),t),getOptins:(t=[])=>a.getProductsForPurchasePost(k.getState(),t),clear(){k.dispatch(c.checkout())},addOptinChangedCallback(t){"function"==typeof t&&document.addEventListener("optin-changed",e=>t(e.detail))},disableOptinChangedCallbacks(){document.addEventListener("optin-changed",t=>t.stopPropagation(),!0)},register(){try{customElements.define("og-when",u),customElements.define("og-text",m),customElements.define("og-incentive-text",b),customElements.define("og-offer",w),customElements.define("og-select-frequency",v),customElements.define("og-optout-button",d),customElements.define("og-optin-toggle",g),customElements.define("og-optin-status",y),customElements.define("og-optin-button",l),customElements.define("og-optin-select",p),customElements.define("og-upsell-button",f),customElements.define("og-frequency-status",T),customElements.define("og-modal",O),customElements.define("og-select",S),customElements.define("og-tooltip",x),customElements.define("og-upsell-modal",h),customElements.define("og-next-upcoming-order",_)}catch(t){console.error(t)}j.register=()=>0},previewMode(t){return window.og=window.og||{},!1===t?delete window.og:window.og.previewMode=!0,this},initialize(t,e,r){if(j.isReady)return console.warn("og.offers has been initialized already. Skipping."),j;k=i();const n=window.og_settings;if(t&&e&&n){let r=[];n.product?r.push(n.product):n.cart&&Array.isArray(n.cart.products)&&(r=r.concat(n.cart.products));const{apiUrl:o}=P({},c.setEnvironment(e)),{sessionId:i}=k.getState();i&&r.forEach(e=>C.fetchOffer(o,t,i,`${e}`,"pdp"))}return o(k),t&&j.setMerchantId(t),e&&j.setEnvironment(e),r&&j.setAuthUrl(r),window.addEventListener("storage",s(k)),t&&e&&(k.dispatch(c.requestSessionId()),k.dispatch(c.fetchAuth()),j.register()),j.isReady=!0,j},config:t=>(k.dispatch(c.setConfig(t)),j),setLocale:t=>(k.dispatch(c.setLocale(t)),j),addTemplate:(t,e,r)=>(k.dispatch(c.addTemplate(t,e,r)),j),setTemplates:t=>(k.dispatch(c.setTemplates(t)),j),setPublicPath:t=>(r.p=t,j)};window.OG=window.OG||{},Object.assign(window.OG,j),Object.assign(j.initialize,j),n(),window.OG_START=window.OG_START||performance.now(),console.log("main.js",performance.now()-window.OG_START),t.exports=j.initialize},function(t,e,r){window,t.exports=function(t){function e(e){for(var r,o,i=e[0],s=e[1],a=0,u=[];a<i.length;a++)o=i[a],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&u.push(n[o][0]),n[o]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r]);for(c&&c(e);u.length;)u.shift()()}var r={},n={0:0};function o(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(t){var e=[],r=n[t];if(0!==r)if(r)e.push(r[2]);else{var i=new Promise((function(e,o){r=n[t]=[e,o]}));e.push(r[2]=i);var s,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(t){return o.p+""+t+".offers-live-editor.js"}(t);var c=new Error;s=function(e){a.onerror=a.onload=null,clearTimeout(u);var r=n[t];if(0!==r){if(r){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",c.name="ChunkLoadError",c.type=o,c.request=i,r[1](c)}n[t]=void 0}};var u=setTimeout((function(){s({type:"timeout",target:a})}),12e4);a.onerror=a.onload=s,document.head.appendChild(a)}return Promise.all(e)},o.m=t,o.c=r,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="//static.ordergroove.com/@ordergroove/offers-live-editor/0.3.0/dist/",o.oe=function(t){throw console.error(t),t};var i=window.webpackJsonp=window.webpackJsonp||[],s=i.push.bind(i);i.push=e,i=i.slice();for(var a=0;a<i.length;a++)e(i[a]);var c=s;return o(o.s=0)}([function(t,e,r){"use strict";r.r(e),r.d(e,"offersLiveEditor",(function(){return s}));const n=["https://rc3.ordergroove.com","https://rc3.stg.ordergroove.com","http://localhost:3000",window.location.origin],o=t=>(e,r)=>{n.forEach(n=>t.postMessage({ogType:e,...r},n))};function i(t){const e=(t=>e=>t.indexOf(e.origin)>=0)(n),s=o(t.source);e(t)&&"READY"===t.data.ogType&&r.e(1).then(r.bind(null,2)).then(({initializeClient:t})=>{t(e,s),window.removeEventListener("message",i)})}function s(t=window.opener){t&&t!==window&&(window.addEventListener("message",i),o(t)("READY"))}e.default=s}])},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,r){"use strict";r.r(e),r.d(e,"getProductsForPurchasePost",(function(){return o}));var n=r(5);const o=(t={},e=[])=>(t.optedin||[]).map(e=>{const r={product:e.id,subscription_info:{components:e.components||[]},tracking_override:{offer:((t.productOffer||{})[e.id]||[])[0],...Object(n.parseFrequency)(e.frequency)}};return t.firstOrderPlaceDate&&t.firstOrderPlaceDate[e.id]&&(r.subscription_info.first_order_place_date=t.firstOrderPlaceDate[e.id]),t.productToSubscribe&&t.productToSubscribe[e.id]&&(r.tracking_override.product=t.productToSubscribe[e.id]),r}).filter(t=>t.tracking_override.offer).filter(t=>e.length?e.includes(t.product):t);e.default={getProductsForPurchasePost:o}},function(t,e,r){const n=r(21);t.exports=t=>{let e="";const r=[];for(const o of t){const t=o.charCodeAt(0);switch(t){case n.PAR_OPEN:case n.PAR_CLOSE:case n.OP_NOT:case n.BINARY_AND:case n.BINARY_OR:e&&(r.push({type:n.LITERAL,value:e}),e=""),r.push({type:t,value:o});break;default:e+=o}}return e&&r.push({type:n.LITERAL,value:e}),r}},function(t,e,r){const n=r(21);t.exports={PolishNotation:t=>{const e=[],r=[];return t.forEach(t=>{switch(t.type){case n.LITERAL:e.unshift(t);break;case n.BINARY_AND:case n.BINARY_OR:case n.OP_NOT:case n.PAR_OPEN:r.push(t);break;case n.PAR_CLOSE:for(;r.length&&r[r.length-1].type!==n.PAR_OPEN;)e.unshift(r.pop());r.pop(),r.length&&r[r.length-1].type===n.OP_NOT&&e.unshift(r.pop())}}),r.length&&[...r.reverse(),...e]||e},PolishGenerator:function*(t){for(let e=0;e<t.length-1;e++)yield t[e];return t[t.length-1]}}},function(t,e,r){const n=r(21);class o{constructor(t,e,r,n){this.op=t,this.left=e,this.right=r,this.literal=n}isLeaf(){return this.op===n.LEAF}isAtomic(){return this.isLeaf()||this.op===n.OP_NOT&&this.left.isLeaf()}getLiteralValue(){return this.literal}static CreateAnd(t,e){return new o(n.BINARY_AND,t,e)}static CreateNot(t){return new o(n.OP_NOT,t)}static CreateOr(t,e){return new o(n.BINARY_OR,t,e)}static CreateLiteral(t){return new o(n.LEAF,null,null,t)}}const i=t=>{const e=t.next().value;switch(e.type){case n.LITERAL:return o.CreateLiteral(e.value);case n.OP_NOT:return o.CreateNot(i(t));case n.BINARY_AND:{const e=i(t),r=i(t);return o.CreateAnd(e,r)}case n.BINARY_OR:{const e=i(t),r=i(t);return o.CreateOr(e,r)}}return null},s=(t,e)=>t.isLeaf()?e(t.getLiteralValue()):t.op===n.OP_NOT?!s(t.left,e):t.op===n.BINARY_OR?s(t.left,e)||s(t.right,e):t.op===n.BINARY_AND?s(t.left,e)&&s(t.right,e):void 0;t.exports={make:i,nodeEvaluator:s}},function(t,e,r){"use strict";r.r(e),r.d(e,"OptinButton",(function(){return u})),r.d(e,"ConnectedOptinButton",(function(){return l}));var n=r(1),o=r(3),i=r(9),s=r(4),a=r(8),c=r(6);class u extends i.OptinStatus{static get properties(){return{...super.properties,frequency:{type:String,reflect:!0},defaultFrequency:a.b,optinButtonLabel:{type:String}}}handleClick(t){this.optinProduct(Object(c.a)(this),this.defaultFrequency),t.preventDefault()}render(){return n.c`
236
+ `}}const p=(t,e)=>({subscribed:Object(o.e)(e.product)(t),frequency:Object(o.h)(e.product)(t),productDefaultFrequency:Object(o.g)((e.product||{}).id)(t),...Object(o.b)(t,e,"frequencies",[]),...Object(o.b)(t,e,"defaultFrequency"),...Object(o.k)(t,e)}),f=Object(i.connect)(p)(d);e.default=f},function(t,e,r){"use strict";r.r(e),function(t){r.d(e,"STORE_ROOT",(function(){return s})),r.d(e,"safeParseState",(function(){return a})),r.d(e,"loadState",(function(){return u})),r.d(e,"serializeState",(function(){return l})),r.d(e,"saveState",(function(){return d})),r.d(e,"listenLocalStorageChanges",(function(){return p})),r.d(e,"clearState",(function(){return f}));var n=r(17),o=r(3),i=r(0);const s="OG_STATE",a=t=>{try{if(null===t)return;return JSON.parse(t)}catch(t){return}},c=()=>window.og&&window.og.previewMode,u=()=>c()?{}:a(localStorage.getItem(s)),l=t=>!(!t||!t.sessionId)&&JSON.stringify({sessionId:t.sessionId,optedin:t.optedin,optedout:t.optedout,productOffer:t.productOffer,firstOrderPlaceDate:t.firstOrderPlaceDate,productToSubscribe:t.productToSubscribe}),d=t=>{if(c())return;const e=l(t);e&&localStorage.getItem(s)!==e&&localStorage.setItem(s,e)},p=e=>Object(n.throttle)(500,r=>{if(c())return;const{key:n,newValue:u}=r;n===s&&null===u?(e.dispatch({type:i.j}),t(()=>e.dispatch(Object(o.requestSessionId)()))):n===s&&e.dispatch({type:i.i,newValue:a(u)})}),f=()=>localStorage.removeItem(s)}.call(this,r(16).setImmediate)},function(t,e,r){window,t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";r.r(e),r.d(e,"ogAuthRegExp",(function(){return n})),r.d(e,"readAuthCookie",(function(){return o})),r.d(e,"parseAuth",(function(){return i})),r.d(e,"iframeLoad",(function(){return s})),r.d(e,"isJsonResponse",(function(){return a})),r.d(e,"resolveAuth",(function(){return c}));const n=/^og_auth=/,o=(t=n)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace(n,""),i=t=>{if("object"==typeof t)return t;const e=(t||"").split("|");return 3===e.length?{sig_field:e[0],ts:parseInt(e[1],10),sig:e[2]}:null},s=t=>new Promise((e,r)=>{const n=document.createElement("iframe");n.style.setProperty("display","none","important"),document.body.appendChild(n),n.onload=e,n.onerror=r,n.src=t}),a=t=>-1!==(t.headers.get("content-type")||"").indexOf("application/json"),c=(t,e=o,r=s)=>Promise.resolve(e()||t&&"string"==typeof t&&fetch(t).then(n=>n.status>=200&&n.status<300?e()||(a(n)?n.json():Promise.resolve(r(t)).then(e)):null)).then(i).then(t=>null===t?Promise.reject(new Error("Unauthorized")):t);e.default=c}])},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(o.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new i(o.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(19),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(11))},function(t,e,r){!function(t){"use strict";function e(t,e,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function c(){for(var c=arguments.length,u=new Array(c),l=0;l<c;l++)u[l]=arguments[l];var d=this,p=Date.now()-s;function f(){s=Date.now(),r.apply(d,u)}function h(){o=void 0}i||(n&&!o&&f(),a(),void 0===n&&p>t?f():!0!==e&&(o=setTimeout(n?h:f,void 0===n?t-p:t)))}return"boolean"!=typeof e&&(n=r,r=e,e=void 0),c.cancel=function(){a(),i=!0},c}t.debounce=function(t,r,n){return void 0===n?e(t,r,!1):e(t,n,!1!==r)},t.throttle=e,Object.defineProperty(t,"__esModule",{value:!0})}(e)},,function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,o,i,s,a,c=1,u={},l=!1,d=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){h(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){h(t.data)},n=function(t){i.port2.postMessage(t)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,n=function(t){var e=d.createElement("script");e.onreadystatechange=function(){h(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):n=function(t){setTimeout(h,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&h(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(s+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var o={callback:t,args:e};return u[c]=o,n(c),c++},p.clearImmediate=f}function f(t){delete u[t]}function h(t){if(l)setTimeout(h,0,t);else{var e=u[t];if(e){l=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{f(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(11),r(20))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var c,u=[],l=!1,d=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!l){var t=a(p);l=!0;for(var e=u.length;e;){for(c=u,u=[];++d<e;)c&&c[d].run();d=-1,e=u.length}c=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new h(t,e)),1!==u.length||l||a(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){const r={PAR_OPEN:"(".charCodeAt(0),PAR_CLOSE:")".charCodeAt(0),OP_NOT:"!".charCodeAt(0),BINARY_AND:"&".charCodeAt(0),BINARY_OR:"|".charCodeAt(0),LITERAL:"LITERAL",END:"END",LEAF:"LEAF",ATOMIC:"ATOMIC"};t.exports=r},,function(t,e,r){"use strict";r.r(e),r.d(e,"optedin",(function(){return a})),r.d(e,"optedout",(function(){return c})),r.d(e,"nextUpcomingOrder",(function(){return u})),r.d(e,"autoshipEligible",(function(){return l})),r.d(e,"inStock",(function(){return d})),r.d(e,"eligibilityGroups",(function(){return p})),r.d(e,"incentives",(function(){return h})),r.d(e,"frequency",(function(){return g})),r.d(e,"auth",(function(){return y})),r.d(e,"merchantId",(function(){return m})),r.d(e,"authUrl",(function(){return b})),r.d(e,"offer",(function(){return v})),r.d(e,"offerId",(function(){return _})),r.d(e,"sessionId",(function(){return w})),r.d(e,"productOffer",(function(){return O})),r.d(e,"firstOrderPlaceDate",(function(){return S})),r.d(e,"productToSubscribe",(function(){return x})),r.d(e,"environment",(function(){return E})),r.d(e,"locale",(function(){return T})),r.d(e,"config",(function(){return C})),r.d(e,"previewStandardOffer",(function(){return P})),r.d(e,"previewUpsellOffer",(function(){return k})),r.d(e,"autoshipByDefault",(function(){return j})),r.d(e,"defaultFrequencies",(function(){return q})),r.d(e,"templates",(function(){return A}));var n=r(12),o=r(0),i=r(2),s=r(5);const a=(t=[],e)=>{switch(e.type){case o.j:return[];case o.i:return e.newValue?e.newValue.optedin:t;case o.k:case o.m:const[[r],n]=t.reduce((t,r)=>t[Object(i.c)(e.payload.product,r)?0:1].push(r)&&t,[[],[]]);return(n||[]).concat({...r,...e.payload.product,frequency:e.payload.frequency});case o.l:return t.filter(t=>!Object(i.c)(e.payload.product,t));case o.n:return t.map(t=>Object(i.c)(e.payload.product,t)?{...t,...e.payload.newProduct}:t);case o.e:return t.filter(t=>!Object(i.c)(e.payload.product,t));case o.c:return[];default:return t}},c=(t=[],e)=>{switch(e.type){case o.j:return[];case o.i:return e.newValue?e.newValue.optedout:t;case o.k:case o.m:return t.filter(t=>!Object(i.c)(e.payload.product,t));case o.l:const[[r],n]=t.reduce((t,r)=>t[Object(i.c)(e.payload.product,r)?0:1].push(r)&&t,[[],[]]);return(n||[]).concat({...r,...e.payload.product,frequency:e.payload.frequency});case o.n:return t.map(t=>Object(i.c)(e.payload.product,t)?{...t,...e.payload.newProduct}:t);case o.c:return[];default:return t}},u=(t={},{type:e,payload:r})=>{switch(e){case o.q:return r&&r.count>0?{...t,...r.results[0]&&{...r.results[0],place:new Date(Date.parse(r.results[0].place.replace(/-/gi,"/")))}}:t;case o.r:return{...t,products:(r.results||[]).map(t=>t.product)};case o.g:return{...t,...r,public_id:r.order,...r.product&&{products:(t.products||[]).concat(r.product)}};default:return t}},l=(t={},e)=>{switch(e.type){case o.p:return{...t,...e.payload.autoship};default:return t}},d=(t={},e)=>{switch(e.type){case o.p:return{...t,...e.payload.in_stock};default:return t}},p=(t={},e)=>{switch(e.type){case o.p:return{...t,...e.payload.eligibility_groups};default:return t}},f=(t,e)=>t.map(t=>({...e[t],id:[t][0]})),h=(t={},e)=>{switch(e.type){case o.p:return{...t,...[...new Set(Object.keys(e.payload.incentives||{}))].reduce((t,r)=>({...t,[r]:Object.entries(e.payload.incentives).filter(([t])=>t===r).reduce((t,[,{initial:r,ongoing:n}])=>({...t,initial:[...t.initial||[],...f(r,e.payload.incentives_display)],ongoing:[...t.ongoing||[],...f(n,e.payload.incentives_display)]}),{})}),{})};default:return t}},g=(t={},e)=>{switch(e.type){case o.k:case o.m:return{...t,[e.payload.product]:e.payload.frequency};case o.l:return{...t,[e.payload.product]:void 0};default:return t}},y=(t=!1,e)=>{switch(e.type){case o.b:return{...e.payload};case o.J:return!1;default:return t}},m=(t="",e)=>{switch(e.type){case o.E:return e.payload;default:return t}},b=(t=null,e)=>{switch(e.type){case o.x:return e.payload;default:return t}},v=(t={},e)=>{switch(e.type){case o.p:return{...t,offerId:(e.payload.module_view||{}).regular,...e.payload.modifiers};default:return t}},_=(t="",e)=>{switch(e.type){case o.p:return(e.payload.module_view||{}).regular||"";default:return t}},w=(t=null,e)=>{switch(e.type){case o.j:return null;case o.f:return e.payload;default:return t}},O=(t={},e)=>{switch(e.type){case o.p:return{...t,...Object.entries(e.payload.autoship).map(([t])=>({[t]:Object.keys(e.payload.modifiers)})).reduce((t,e)=>({...t,...e}))};case o.c:return{};default:return t}},S=(t={},e)=>{switch(e.type){case o.C:return{...t,[e.payload.product]:e.payload.firstOrderPlaceDate};default:return t}},x=(t={},e)=>{switch(e.type){case o.H:return{...t,[e.payload.product]:e.payload.productToSubscribe};default:return t}},E=(t={},e)=>{switch(e.type){case o.B:return{...t,name:"staging",apiUrl:"https://staging.om.ordergroove.com",legoUrl:"https://staging.restapi.ordergroove.com"};case o.z:return{...t,name:"dev",apiUrl:"https://dev.om.ordergroove.com",legoUrl:"https://dev.restapi.ordergroove.com"};case o.A:return{...t,name:"prod",apiUrl:"https://om.ordergroove.com",legoUrl:"https://restapi.ordergroove.com"};default:return t}},T=(t={offerOptInLabel:"Subscribe",offerOptOutLabel:"Purchase one time",offerEveryLabel:"Every",offerTooltipTrigger:"Hover for additional info",offerTooltipContent:"Seems this is a great subscription offering. Many fun details about this program exist.",optinButtonLabel:"•",optoutButtonLabel:"•",optinStatusOptedInLabel:"You're opted in!",optinStatusOptedOutLabel:"You're not opted in.",optinToggleLabel:"•",upsellButtonLabel:"Add item to order on ",upsellButtonPrefix:"",upsellModalContent:"Some upsell modal content",upsellModalOptInLabel:"Subscribe",upsellModalOptOutLabel:"Purchase one time",upsellModalTitle:"Impulse Upsell",upsellModalConfirmLabel:"Ok",upsellModalCancelLabel:"Cancel",defaultFrequencyCopy:"(Recommended)",frequencyPeriods:{1:"day",2:"week",3:"month"}},e)=>{switch(e.type){case o.D:return{...t,...e.payload};default:return t}},C=(t={frequencies:["1_2","1_2","1_3"],offerType:"radio"},e)=>{switch(e.type){case o.y:return{...t,...e.payload,defaultFrequency:e.payload.defaultFrequency?Object(s.stringifyFrequency)(e.payload.defaultFrequency):t.defaultFrequency,frequencies:e.payload.frequencies?e.payload.frequencies.map(s.stringifyFrequency):t.frequencies};default:return t}},P=(t=!1,e)=>{switch(e.type){case o.F:return e.payload;default:return t}},k=(t=!1,e)=>{switch(e.type){case o.G:return e.payload;default:return t}},j=(t=[],e)=>{switch(e.type){case o.p:return{...t,...e.payload.autoship_by_default};default:return t}},q=(t=[],e)=>{switch(e.type){case o.p:return{...t,...e.payload.default_frequencies};default:return t}},A=(t=[],e)=>{switch(e.type){case o.I:return[...e.payload||[]];case o.a:return[e.payload,...t];default:return t}};e.default=Object(n.c)({environment:E,optedin:a,optedout:c,merchantId:m,offer:v,offerId:_,productOffer:O,sessionId:w,inStock:d,eligibilityGroups:p,autoshipByDefault:j,autoshipEligible:l,incentives:h,nextUpcomingOrder:u,auth:y,authUrl:b,locale:T,config:C,previewStandardOffer:P,previewUpsellOffer:k,templates:A,defaultFrequencies:q,firstOrderPlaceDate:S,productToSubscribe:x})},function(t,e,r){"use strict";(function(t,n){var o,i=r(26);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:n;var s=Object(i.a)(o);e.a=s}).call(this,r(11),r(31)(t))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return c})),r.d(e,"b",(function(){return u}));var n=r(17),o=r(0),i=(r(2),r(14));const s=e=>({payload:{product:{id:r,components:n}={}}={}}={})=>t(()=>((t,e,r=document)=>r.dispatchEvent(new CustomEvent(t,{detail:e})))("optin-changed",{productId:r,components:n,optedIn:e})),a=[{expressions:[({type:t}={})=>t===o.k,({type:t}={})=>t===o.m],fn:s(!0)},{expressions:[({type:t}={})=>t===o.l],fn:s(!1)}],c=t=>e=>r=>{const n=t.getState();a.forEach(t=>{t.expressions.some(t=>t(r,n))&&t.fn(r)}),e(r)},u=t=>e=>r=>{e(r);const s=Object(n.throttle)(500,()=>{Object(i.saveState)({...t.getState()})});r.type!==o.i&&s()}}).call(this,r(16).setImmediate)},function(t,e,r){"use strict";function n(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}r.d(e,"a",(function(){return n}))},function(t,e,r){const n=r(33),o=r(34),i=r(35);t.exports={parse:(t,e)=>{const r=n(t),s=o.PolishNotation(r),a=o.PolishGenerator(s),c=i.make(a);return i.nodeEvaluator(c,e)}}},,function(t,e,r){const{offersLiveEditor:n}=r(30),{setStore:o}=r(4),{getStore:i}=r(51),{listenLocalStorageChanges:s}=r(14),a=r(32),c=r(3),{ConnectedWhen:u}=r(52),{ConnectedOptinButton:l}=r(36),{ConnectedOptoutButton:d}=r(37),{ConnectedOptinSelect:p}=r(38),{ConnectedUpsellButton:f}=r(39),{ConnectedUpsellModal:h}=r(40),{ConnectedOptinToggle:g}=r(41),{ConnectedOptinStatus:y}=r(9),{ConnectedText:m}=r(42),{ConnectedIncentiveText:b}=r(43),{ConnectedSelectFrequency:v}=r(44),{ConnectedNextUpcomingOrder:_}=r(53),{ConnectedOffer:w}=r(45),{Modal:O}=r(46),{Select:S}=r(47),{Tooltip:x}=r(48),{ConnectedFrequencyStatus:E}=r(13),T=r(49),{default:C}=r(5),{environment:P}=r(23);let k;T.enable();const j={setEnvironment:t=>(k.dispatch(c.setEnvironment(t)),j),setMerchantId:t=>(k.dispatch(c.setMerchantId(t)),j),setAuthUrl:t=>(k.dispatch(c.setAuthUrl(t)),j),getProductsForPurchasePost:(t=[])=>a.getProductsForPurchasePost(k.getState(),t),getOptins:(t=[])=>a.getProductsForPurchasePost(k.getState(),t),clear(){k.dispatch(c.checkout())},addOptinChangedCallback(t){"function"==typeof t&&document.addEventListener("optin-changed",e=>t(e.detail))},disableOptinChangedCallbacks(){document.addEventListener("optin-changed",t=>t.stopPropagation(),!0)},register(){try{customElements.define("og-when",u),customElements.define("og-text",m),customElements.define("og-incentive-text",b),customElements.define("og-offer",w),customElements.define("og-select-frequency",v),customElements.define("og-optout-button",d),customElements.define("og-optin-toggle",g),customElements.define("og-optin-status",y),customElements.define("og-optin-button",l),customElements.define("og-optin-select",p),customElements.define("og-upsell-button",f),customElements.define("og-frequency-status",E),customElements.define("og-modal",O),customElements.define("og-select",S),customElements.define("og-tooltip",x),customElements.define("og-upsell-modal",h),customElements.define("og-next-upcoming-order",_)}catch(t){console.error(t)}j.register=()=>0},previewMode(t){return window.og=window.og||{},!1===t?delete window.og:window.og.previewMode=!0,this},initialize(t,e,r){if(j.isReady)return console.warn("og.offers has been initialized already. Skipping."),j;k=i();const n=window.og_settings;if(t&&e&&n){let r=[];n.product?r.push(n.product):n.cart&&Array.isArray(n.cart.products)&&(r=r.concat(n.cart.products));const{apiUrl:o}=P({},c.setEnvironment(e)),{sessionId:i}=k.getState();i&&r.forEach(e=>C.fetchOffer(o,t,i,`${e}`,"pdp"))}return o(k),t&&j.setMerchantId(t),e&&j.setEnvironment(e),r&&j.setAuthUrl(r),window.addEventListener("storage",s(k)),t&&e&&(k.dispatch(c.requestSessionId()),k.dispatch(c.fetchAuth()),j.register()),j.isReady=!0,j},config:t=>(k.dispatch(c.setConfig(t)),j),setLocale:t=>(k.dispatch(c.setLocale(t)),j),addTemplate:(t,e,r)=>(k.dispatch(c.addTemplate(t,e,r)),j),setTemplates:t=>(k.dispatch(c.setTemplates(t)),j),setPublicPath:t=>(r.p=t,j)};window.OG=window.OG||{},Object.assign(window.OG,j),Object.assign(j.initialize,j),n(),t.exports=j.initialize},function(t,e,r){window,t.exports=function(t){function e(e){for(var r,o,i=e[0],s=e[1],a=0,u=[];a<i.length;a++)o=i[a],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&u.push(n[o][0]),n[o]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r]);for(c&&c(e);u.length;)u.shift()()}var r={},n={0:0};function o(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(t){var e=[],r=n[t];if(0!==r)if(r)e.push(r[2]);else{var i=new Promise((function(e,o){r=n[t]=[e,o]}));e.push(r[2]=i);var s,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(t){return o.p+""+t+".offers-live-editor.js"}(t);var c=new Error;s=function(e){a.onerror=a.onload=null,clearTimeout(u);var r=n[t];if(0!==r){if(r){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",c.name="ChunkLoadError",c.type=o,c.request=i,r[1](c)}n[t]=void 0}};var u=setTimeout((function(){s({type:"timeout",target:a})}),12e4);a.onerror=a.onload=s,document.head.appendChild(a)}return Promise.all(e)},o.m=t,o.c=r,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="//static.ordergroove.com/@ordergroove/offers-live-editor/0.3.0/dist/",o.oe=function(t){throw console.error(t),t};var i=window.webpackJsonp=window.webpackJsonp||[],s=i.push.bind(i);i.push=e,i=i.slice();for(var a=0;a<i.length;a++)e(i[a]);var c=s;return o(o.s=0)}([function(t,e,r){"use strict";r.r(e),r.d(e,"offersLiveEditor",(function(){return s}));const n=["https://rc3.ordergroove.com","https://rc3.stg.ordergroove.com","http://localhost:3000",window.location.origin],o=t=>(e,r)=>{n.forEach(n=>t.postMessage({ogType:e,...r},n))};function i(t){const e=(t=>e=>t.indexOf(e.origin)>=0)(n),s=o(t.source);e(t)&&"READY"===t.data.ogType&&r.e(1).then(r.bind(null,2)).then(({initializeClient:t})=>{t(e,s),window.removeEventListener("message",i)})}function s(t=window.opener){t&&t!==window&&(window.addEventListener("message",i),o(t)("READY"))}e.default=s}])},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,r){"use strict";r.r(e),r.d(e,"getProductsForPurchasePost",(function(){return o}));var n=r(5);const o=(t={},e=[])=>(t.optedin||[]).map(e=>{const r={product:e.id,subscription_info:{components:e.components||[]},tracking_override:{offer:((t.productOffer||{})[e.id]||[])[0],...Object(n.parseFrequency)(e.frequency)}};return t.firstOrderPlaceDate&&t.firstOrderPlaceDate[e.id]&&(r.subscription_info.first_order_place_date=t.firstOrderPlaceDate[e.id]),t.productToSubscribe&&t.productToSubscribe[e.id]&&(r.tracking_override.product=t.productToSubscribe[e.id]),r}).filter(t=>t.tracking_override.offer).filter(t=>e.length?e.includes(t.product):t);e.default={getProductsForPurchasePost:o}},function(t,e,r){const n=r(21);t.exports=t=>{let e="";const r=[];for(const o of t){const t=o.charCodeAt(0);switch(t){case n.PAR_OPEN:case n.PAR_CLOSE:case n.OP_NOT:case n.BINARY_AND:case n.BINARY_OR:e&&(r.push({type:n.LITERAL,value:e}),e=""),r.push({type:t,value:o});break;default:e+=o}}return e&&r.push({type:n.LITERAL,value:e}),r}},function(t,e,r){const n=r(21);t.exports={PolishNotation:t=>{const e=[],r=[];return t.forEach(t=>{switch(t.type){case n.LITERAL:e.unshift(t);break;case n.BINARY_AND:case n.BINARY_OR:case n.OP_NOT:case n.PAR_OPEN:r.push(t);break;case n.PAR_CLOSE:for(;r.length&&r[r.length-1].type!==n.PAR_OPEN;)e.unshift(r.pop());r.pop(),r.length&&r[r.length-1].type===n.OP_NOT&&e.unshift(r.pop())}}),r.length&&[...r.reverse(),...e]||e},PolishGenerator:function*(t){for(let e=0;e<t.length-1;e++)yield t[e];return t[t.length-1]}}},function(t,e,r){const n=r(21);class o{constructor(t,e,r,n){this.op=t,this.left=e,this.right=r,this.literal=n}isLeaf(){return this.op===n.LEAF}isAtomic(){return this.isLeaf()||this.op===n.OP_NOT&&this.left.isLeaf()}getLiteralValue(){return this.literal}static CreateAnd(t,e){return new o(n.BINARY_AND,t,e)}static CreateNot(t){return new o(n.OP_NOT,t)}static CreateOr(t,e){return new o(n.BINARY_OR,t,e)}static CreateLiteral(t){return new o(n.LEAF,null,null,t)}}const i=t=>{const e=t.next().value;switch(e.type){case n.LITERAL:return o.CreateLiteral(e.value);case n.OP_NOT:return o.CreateNot(i(t));case n.BINARY_AND:{const e=i(t),r=i(t);return o.CreateAnd(e,r)}case n.BINARY_OR:{const e=i(t),r=i(t);return o.CreateOr(e,r)}}return null},s=(t,e)=>t.isLeaf()?e(t.getLiteralValue()):t.op===n.OP_NOT?!s(t.left,e):t.op===n.BINARY_OR?s(t.left,e)||s(t.right,e):t.op===n.BINARY_AND?s(t.left,e)&&s(t.right,e):void 0;t.exports={make:i,nodeEvaluator:s}},function(t,e,r){"use strict";r.r(e),r.d(e,"OptinButton",(function(){return u})),r.d(e,"ConnectedOptinButton",(function(){return l}));var n=r(1),o=r(3),i=r(9),s=r(4),a=r(8),c=r(6);class u extends i.OptinStatus{static get properties(){return{...super.properties,frequency:{type:String,reflect:!0},defaultFrequency:a.b,optinButtonLabel:{type:String}}}handleClick(t){this.optinProduct(Object(c.a)(this),this.defaultFrequency),t.preventDefault()}render(){return n.c`
237
237
  <slot name="default">
238
238
  <button id="action-trigger" class="btn radio ${this.subscribed?"active":""}"></button>
239
239
  <label for="action-trigger">