@ordergroove/offers 2.27.19-alpha-PR-659-2.1 → 2.27.19

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.27.19](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.27.18...@ordergroove/offers@2.27.19) (2022-09-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **offers:** Selling plan should be converted to OG frequency every,period when impulse upsell offer ([43538e3](https://github.com/ordergroove/plush-toys/commit/43538e361dc8d251a0a85eeea64ac27b1d0ebd25))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.27.18](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.27.17...@ordergroove/offers@2.27.18) (2022-09-19)
7
18
 
8
19
 
@@ -4,7 +4,7 @@
4
4
  │ └ examples/index.js
5
5
  └ examples/index.js ───────────────────────────────────────── 8.5kb ─── 3.3%
6
6
 
7
- dist/offers.js ───────────────────────────────────────────── 123.1kb ─ 100.0%
7
+ dist/offers.js ───────────────────────────────────────────── 123.0kb ─ 100.0%
8
8
  ├ src/components/Offer.js ─────────────────────────────────── 8.1kb ─── 6.6%
9
9
  │ └ src/make-api.js
10
10
  │ └ src/index.js
@@ -31,7 +31,7 @@
31
31
  │ └ src/index.js
32
32
  ├ src/shopify/shopifyMiddleware.ts ────────────────────────── 4.9kb ─── 4.0%
33
33
  │ └ src/index.js
34
- ├ src/components/Modal.js ─────────────────────────────────── 4.7kb ─── 3.8%
34
+ ├ src/components/Modal.js ─────────────────────────────────── 4.7kb ─── 3.9%
35
35
  │ └ src/make-api.js
36
36
  │ └ src/index.js
37
37
  ├ src/components/Tooltip.js ───────────────────────────────── 4.4kb ─── 3.6%
@@ -56,7 +56,7 @@
56
56
  ├ src/components/OptinStatus.js ───────────────────────────── 2.4kb ─── 2.0%
57
57
  │ └ src/make-api.js
58
58
  │ └ src/index.js
59
- ├ src/core/actions-preview.js ─────────────────────────────── 2.3kb ─── 1.8%
59
+ ├ src/core/actions-preview.js ─────────────────────────────── 2.3kb ─── 1.9%
60
60
  │ └ src/components/Offer.js
61
61
  │ └ src/make-api.js
62
62
  │ └ src/index.js
@@ -104,12 +104,12 @@
104
104
  │ └ src/components/Price.js
105
105
  │ └ src/make-api.js
106
106
  │ └ src/index.js
107
- ├ src/core/utils.ts ───────────────────────────────────────── 1.3kb ─── 1.0%
108
- │ └ src/index.js
109
107
  ├ src/core/descriptors.js ─────────────────────────────────── 1.2kb ─── 1.0%
110
108
  │ └ src/components/When.js
111
109
  │ └ src/make-api.js
112
110
  │ └ src/index.js
111
+ ├ src/core/utils.ts ───────────────────────────────────────── 1.2kb ─── 1.0%
112
+ │ └ src/index.js
113
113
  ├ src/shopify/shopifyBootstrap.ts ─────────────────────────── 1.1kb ─── 0.9%
114
114
  │ └ src/index.js
115
115
  ├ src/core/constants.js ───────────────────────────────────── 1.1kb ─── 0.9%
package/dist/offers.js CHANGED
@@ -8,7 +8,7 @@ else {
8
8
  window.og['offers'] = factory();
9
9
  }
10
10
  })(()=>{
11
- var lib=(()=>{var Gi=Object.create;var Be=Object.defineProperty;var Bi=Object.getOwnPropertyDescriptor;var zi=Object.getOwnPropertyNames;var Wi=Object.getPrototypeOf,Yi=Object.prototype.hasOwnProperty;var nn=t=>Be(t,"__esModule",{value:!0}),n=(t,e)=>Be(t,"name",{value:e,configurable:!0});var x=(t,e)=>()=>(t&&(e=t(t=0)),e);var fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xr=(t,e)=>{nn(t);for(var r in e)Be(t,r,{get:e[r],enumerable:!0})},Ji=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of zi(e))!Yi.call(t,o)&&o!=="default"&&Be(t,o,{get:()=>e[o],enumerable:!(r=Bi(e,o))||r.enumerable});return t},te=t=>Ji(nn(Be(t!=null?Gi(Wi(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Et=fe((_t,fn)=>{(function(t,e){typeof _t=="object"&&typeof fn!="undefined"?e(_t):typeof define=="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.throttleDebounce={}))})(_t,function(t){"use strict";function e(o,s,i,a){var c,l=!1,d=0;function h(){c&&clearTimeout(c)}n(h,"clearExistingTimeout");function u(){h(),l=!0}n(u,"cancel"),typeof s!="boolean"&&(a=i,i=s,s=void 0);function m(){for(var O=arguments.length,_=new Array(O),f=0;f<O;f++)_[f]=arguments[f];var y=this,w=Date.now()-d;if(l)return;function b(){d=Date.now(),i.apply(y,_)}n(b,"exec");function C(){c=void 0}n(C,"clear"),a&&!c&&b(),h(),a===void 0&&w>o?b():s!==!0&&(c=setTimeout(a?C:b,a===void 0?o-w:o))}return n(m,"wrapper"),m.cancel=u,m}n(e,"throttle");function r(o,s,i){return i===void 0?e(o,s,!1):e(o,i,s!==!1)}n(r,"debounce"),t.debounce=r,t.throttle=e,Object.defineProperty(t,"__esModule",{value:!0})})});function mn(){return typeof window.og_auth!="undefined"?xt(window.og_auth):null}async function sa(t=100){return new Promise(e=>{setTimeout(()=>e(mn()),t)})}async function gn(t,e=ra,r=oa){let o;if(o=xt(mn())||xt(e()),o)return o;if(t&&typeof t=="string"){let s=await fetch(t);s.status>=200&&s.status<300&&(o=e()||await(na(s)?s.json():Promise.resolve(r(t)).then(e)))}else o||(o=await sa());if(o=xt(o),o)return o;throw new Error("Unauthorized")}var hn,ra,xt,oa,na,yn=x(()=>{hn=/^og_auth=/,ra=n((t=hn)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace(hn,""),"c"),xt=n(t=>{if(typeof t=="object")return t;let e=String(t||"").split("|");return e.length===3?{sig_field:e[0],ts:parseInt(e[1],10),sig:e[2]}:null},"r"),oa=n(t=>new Promise((e,r)=>{let o=document.createElement("iframe");o.style.setProperty("display","none","important"),document.body.appendChild(o),o.onload=e,o.onerror=r,o.src=t}),"p"),na=n(t=>(t.headers.get("content-type")||"").indexOf("application/json")!==-1,"d");n(mn,"a");n(sa,"f");n(gn,"u")});var I,q,U,St,z,P,We,Tt,vt,bn,Ot,Re,_n,wt,Ct,En,Pt,Rt,At,xn,Sn,Nt,Tn,kt,Ae,vn,It,qt,Ye,Je,Ut,Dt,he,re,Ft,Lt,Q,W,oe,me,jt,ge,Ne,Cr,Pr,On,$=x(()=>{I="OPTIN_PRODUCT",q="OPTOUT_PRODUCT",U="PRODUCT_CHANGE_FREQUENCY",St="SET_MERCHANT_ID",z="REQUEST_OFFER",P="RECEIVE_OFFER",We="PRODUCT_HAS_CHANGED",Tt="CREATED_SESSION_ID",vt="SET_AUTH_URL",bn="REQUEST_AUTH",Ot="AUTHORIZE",Re="UNAUTHORIZED",_n="REQUEST_ORDERS",wt="RECEIVE_ORDERS",Ct="RECEIVE_ORDER_ITEMS",En="FETCH_RESPONSE_ERROR",Pt="SET_ENVIRONMENT_STAGING",Rt="SET_ENVIRONMENT_DEV",At="SET_ENVIRONMENT_PROD",xn="CONCLUDE_UPSELL",Sn="REQUEST_CREATE_IU_ORDER",Nt="CREATE_ONE_TIME",Tn="REQUEST_CONVERT_ONE_TIME",kt="CONVERT_ONE_TIME",Ae="CHECKOUT",vn="RECEIVE_FETCH",It="SET_LOCALE",qt="SET_CONFIG",Ye="SET_PREVIEW_STANDARD_OFFER",Je="SET_PREVIEW_UPSELL_OFFER",Ut="ADD_TEMPLATE",Dt="SET_TEMPLATES",he="LOCAL_STORAGE_CHANGE",re="LOCAL_STORAGE_CLEAR",Ft="SET_FIRST_ORDER_PLACE_DATE",Lt="SET_PRODUCT_TO_SUBSCRIBE",Q="RECEIVE_PRODUCT_PLANS",W="SETUP_PRODUCT",oe="SETUP_CART",me="pdp",jt="dev",ge="staging",Ne="prod",Cr="static.ordergroove.com",Pr="staging.static.ordergroove.com",On="og-cart-updated"});var Ke=fe((bu,In)=>{var ia="Expected a function",wn="__lodash_hash_undefined__",aa="[object Function]",ca="[object GeneratorFunction]",la=/[\\^$.*+?()[\]{}|]/g,ua=/^\[object .+?Constructor\]$/,pa=typeof window=="object"&&window&&window.Object===Object&&window,da=typeof self=="object"&&self&&self.Object===Object&&self,Cn=pa||da||Function("return this")();function fa(t,e){return t==null?void 0:t[e]}n(fa,"getValue");function ha(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}n(ha,"isHostObject");var ma=Array.prototype,ga=Function.prototype,Pn=Object.prototype,Rr=Cn["__core-js_shared__"],Rn=function(){var t=/[^.]+$/.exec(Rr&&Rr.keys&&Rr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),An=ga.toString,Ar=Pn.hasOwnProperty,ya=Pn.toString,ba=RegExp("^"+An.call(Ar).replace(la,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_a=ma.splice,Ea=Nn(Cn,"Map"),Qe=Nn(Object,"create");function ye(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(ye,"Hash");function xa(){this.__data__=Qe?Qe(null):{}}n(xa,"hashClear");function Sa(t){return this.has(t)&&delete this.__data__[t]}n(Sa,"hashDelete");function Ta(t){var e=this.__data__;if(Qe){var r=e[t];return r===wn?void 0:r}return Ar.call(e,t)?e[t]:void 0}n(Ta,"hashGet");function va(t){var e=this.__data__;return Qe?e[t]!==void 0:Ar.call(e,t)}n(va,"hashHas");function Oa(t,e){var r=this.__data__;return r[t]=Qe&&e===void 0?wn:e,this}n(Oa,"hashSet");ye.prototype.clear=xa;ye.prototype.delete=Sa;ye.prototype.get=Ta;ye.prototype.has=va;ye.prototype.set=Oa;function ke(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(ke,"ListCache");function wa(){this.__data__=[]}n(wa,"listCacheClear");function Ca(t){var e=this.__data__,r=Mt(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():_a.call(e,r,1),!0}n(Ca,"listCacheDelete");function Pa(t){var e=this.__data__,r=Mt(e,t);return r<0?void 0:e[r][1]}n(Pa,"listCacheGet");function Ra(t){return Mt(this.__data__,t)>-1}n(Ra,"listCacheHas");function Aa(t,e){var r=this.__data__,o=Mt(r,t);return o<0?r.push([t,e]):r[o][1]=e,this}n(Aa,"listCacheSet");ke.prototype.clear=wa;ke.prototype.delete=Ca;ke.prototype.get=Pa;ke.prototype.has=Ra;ke.prototype.set=Aa;function be(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(be,"MapCache");function Na(){this.__data__={hash:new ye,map:new(Ea||ke),string:new ye}}n(Na,"mapCacheClear");function ka(t){return $t(this,t).delete(t)}n(ka,"mapCacheDelete");function Ia(t){return $t(this,t).get(t)}n(Ia,"mapCacheGet");function qa(t){return $t(this,t).has(t)}n(qa,"mapCacheHas");function Ua(t,e){return $t(this,t).set(t,e),this}n(Ua,"mapCacheSet");be.prototype.clear=Na;be.prototype.delete=ka;be.prototype.get=Ia;be.prototype.has=qa;be.prototype.set=Ua;function Mt(t,e){for(var r=t.length;r--;)if(Ma(t[r][0],e))return r;return-1}n(Mt,"assocIndexOf");function Da(t){if(!kn(t)||La(t))return!1;var e=$a(t)||ha(t)?ba:ua;return e.test(ja(t))}n(Da,"baseIsNative");function $t(t,e){var r=t.__data__;return Fa(e)?r[typeof e=="string"?"string":"hash"]:r.map}n($t,"getMapData");function Nn(t,e){var r=fa(t,e);return Da(r)?r:void 0}n(Nn,"getNative");function Fa(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}n(Fa,"isKeyable");function La(t){return!!Rn&&Rn in t}n(La,"isMasked");function ja(t){if(t!=null){try{return An.call(t)}catch{}try{return t+""}catch{}}return""}n(ja,"toSource");function Nr(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(ia);var r=n(function(){var o=arguments,s=e?e.apply(this,o):o[0],i=r.cache;if(i.has(s))return i.get(s);var a=t.apply(this,o);return r.cache=i.set(s,a),a},"memoized");return r.cache=new(Nr.Cache||be),r}n(Nr,"memoize");Nr.Cache=be;function Ma(t,e){return t===e||t!==t&&e!==e}n(Ma,"eq");function $a(t){var e=kn(t)?ya.call(t):"";return e==aa||e==ca}n($a,"isFunction");function kn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}n(kn,"isObject");In.exports=Nr});var Vt,kr,Ze,Xe,Ht,qn,Un,Va,Ha,Ga,Ba,za,et,Ir,Wa,Dn,tt,Ya,ne,se=x(()=>{Vt=te(Ke()),kr=n((...t)=>JSON.stringify(t),"memoizeKey"),Ze=n(t=>(...e)=>fetch(...t(...e)).then(r=>r.json()),"withFetchJson"),Xe=n(t=>(e,...r)=>{if(!e)throw Error("host required");let[o,s={}]=t(...r);return[`${e.replace(/\/+$/,"")}${o}`,s]},"withHost"),Ht=n(t=>(e,...r)=>{if(!e)throw Error("auth required");let[o,s={}]=t(...r);return[o,{...s,headers:{Authorization:JSON.stringify(e),...s.headers}}]},"withAuth"),qn=n(t=>(...e)=>{let[r,o={}]=t(...e);return[r,{method:"POST",...o,body:JSON.stringify(o.body),headers:{"Content-type":"application/json",...o.headers}}]},"withJsonBody"),Un=n((t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([e,r])=>[e,encodeURIComponent(r)].join("=")).join("&"),"toQuery"),Va=n(t=>JSON.stringify([].concat(t).map(e=>typeof e=="object"?e.id:e).filter(e=>e)),"toProductId"),Ha=(0,Vt.default)(Ze(Xe((t,e,r,o="pdp")=>{if(!t)throw Error("merchantId required");if(!e)throw Error("sessionId required");if(!r)throw Error("product required");let s=Un([["session_id",e],["page_type",1],["p",Va(r)],["module_view",JSON.stringify(["regular"])]]);return[`/offer/${t}/${o}?${s}`]})),kr),Ga=(0,Vt.default)(Ze(Xe(Ht((t=1,e="place")=>[`/orders/?${Un([["status",t],["ordering",e],["exclude_prepaid_orders","true"]])}`]))),kr),Ba=(0,Vt.default)(Ze(Xe(Ht(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),kr),za=Ze(Xe(Ht(qn((t,e,r,o)=>{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(!o)throw Error("offer required");return["/items/iu/",{body:{product:t,order:e,quantity:r,offer:o}}]})))),et=n(t=>{if(typeof t=="object")return{...t};let[e,r]=(t||"").split(/_/).map(o=>parseInt(o,10));return e&&r&&{every:e,every_period:r}},"parseFrequency"),Ir=n(t=>t.match(/^\d+_\d$/),"isFrequencyValid"),Wa=n((t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),"compareFrequencies"),Dn=n(t=>[...new Set(t&&t.split(/\s+/))].filter(Ir).sort(Wa),"parseFrequenciesList"),tt=n(t=>{if(typeof t=="object"){let{every:e,period:r,every_period:o}=t;return`${e}_${r||o}`}return typeof t=="string"?t:""},"stringifyFrequency"),Ya=Ze(Xe(Ht(qn((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");let o=et(e);if(!o)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:t.public_id,offer:r,...o}}]})))),ne={fetchOffer:Ha,fetchOrders:Ga,fetchItems:Ba,createOneTime:za,convertOneTimeToSubscription:Ya}});var Ie,_e,qr=x(()=>{V();Ie=rt(),_e={shopify:typeof(Ie==null?void 0:Ie.dataset.shopifySellingPlans)!="undefined",shopify_selling_plans:typeof(Ie==null?void 0:Ie.dataset.shopifySellingPlans)!="undefined"}});function ot(t){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t()}function rt(){return document.querySelector([`script[src^="https://${Cr}"]`,`script[src^="https://${Pr}"]`,`script[src^="http://${Cr}"]`,`script[src^="http://${Pr}"]`].join(","))}function Ur(){let t=rt();if(!t)return[];let e=new URL(t.src),r=e.host.startsWith(ge)?ge:Ne,o=e.pathname.split("/")[1];return!r&&!o?[]:[o,r,t]}function Ln(t){if(t.isReady())return;let[e,r]=Ur();!r&&!e||t.initialize(e,r)}function Mn(t){let e=document.cookie.match(`(^|;) ?${t}=([^;]*)(;|$)`);return e?e[2]:null}var R,Fn,jn,V=x(()=>{qr();$();n(ot,"onReady");n(rt,"getMainJs");n(Ur,"resolveEnvAndMerchant");R=n(t=>{var r;if(!t)return"";let e=`${t.id||t}`;return((r=_e)==null?void 0:r.shopify_selling_plans)&&(e=e.split(":")[0]),e},"safeProductId"),Fn=n((t,e)=>{var r,o;if((r=_e)==null?void 0:r.shopify_selling_plans){let s=(o=e==null?void 0:e.frequencies)==null?void 0:o.indexOf(t);if(s>=0&&(e==null?void 0:e.frequenciesEveryPeriod[s]))return e==null?void 0:e.frequenciesEveryPeriod[s];throw`OG Can't convert selling_plain_id ${t} to OG frequency every period`}return t},"safeOgFrequency");n(Ln,"autoInitializeOffers");jn=n(t=>{document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`},"clearCookie");n(Mn,"getCookieValue")});var ie,qe,$n,Gt,Vn,Hn,Ja,Qa,nt,ae,Gn,Bt,Bn,Ka,Dr,Fr,zt,Lr,Wt,Ue,jr,Za,zn,Wn,Xa,ec,tc,rc,Yn,Jn,Qn,Kn,Zn,Xn,es,N=x(()=>{yn();$();se();V();ie=n((t,e,r)=>({type:I,payload:{product:t,frequency:e,offer:r}}),"optinProduct"),qe=n((t,e)=>({type:q,payload:{product:t,offer:e}}),"optoutProduct"),$n=n((t,e)=>({type:We,payload:{newProduct:t,product:e}}),"productHasChangedComponents"),Gt=n((t,e,r)=>({type:U,payload:{product:t,frequency:e,offer:r}}),"productChangeFrequency"),Vn=n(t=>({type:xn,payload:{product:t}}),"concludeUpsell"),Hn=n(t=>({type:St,payload:t}),"setMerchantId"),Ja=n(t=>({type:Tt,payload:`${t}.${Math.floor(Math.random()*999999)}.${Math.round(new Date().getTime()/1e3)}`}),"createSessionId"),Qa=n(t=>({type:bn,payload:t}),"requestAuth"),nt=n((t,e,r,o)=>({type:Ot,payload:{public_id:t,sig_field:e,ts:r,sig:o}}),"authorize"),ae=n(t=>({type:Re,payload:t}),"unauthorized"),Gn=n(t=>({type:vt,payload:t}),"setAuthUrl"),Bt=n(t=>({type:vn,payload:t}),"fetchDone"),Bn=n((t=gn)=>n(function(r,o){if(window.og&&window.og.previewMode)return r(ae({message:"Offers are running in preview mode"}));let{merchantId:s,authUrl:i}=o(),a=Qa(i);return r(a),t(i).then(({sig_field:c,ts:l,sig:d})=>r(nt(s,c,l,d)),c=>r(ae(c))).finally(()=>r(Bt(a)))},"fetchAuthThunk"),"fetchAuth"),Ka=n((t,e)=>({type:_n,payload:{status:t,ordering:e}}),"requestOrders"),Dr=n(t=>({type:wt,payload:t}),"receiveOrders"),Fr=n(t=>({type:Ct,payload:t}),"receiveItems"),zt=n((t=1,e="place")=>n(function(o,s){let{environment:{legoUrl:i},auth:a}=s();if(!a)return o(ae("No auth set."));let c=Ka(t,e);return o(c),ne.fetchOrders(i,a,t,e).then(l=>{if(l.results){o(Dr(l));let d=(l.results[0]||{}).public_id;if(d)return ne.fetchItems(i,a,d).then(h=>o(Fr(h)))}return o(ae(l.detail)),null},l=>o(ae(l))).finally(()=>o(Bt(c)))},"fetchOrdersThunk"),"fetchOrders"),Lr=n(t=>{switch(t){case jt:return{type:Rt,payload:t};case ge:return{type:Pt,payload:t};case Ne:return{type:At,payload:t};default:throw new Error(`${t} is not a supported environment`)}},"setEnvironment"),Wt=n(()=>(t,e)=>{let{merchantId:r,sessionId:o}=e();return(!o||r&&!o.startsWith(r))&&t(Ja(r)),o},"requestSessionId"),Ue=n((t,e)=>({type:P,payload:{...t,offer:e}}),"receiveOffer"),jr=n(t=>({type:En,payload:t}),"fetchResponseError"),Za=n((t,e=me,r)=>({type:z,payload:{product:t,module:e,offer:r}}),"requestOffer"),zn=n((t,e=me,r)=>n(function(s,i){let{merchantId:a,sessionId:c,environment:{apiUrl:l}}=i(),d=Za(t,e,r);s(d);let h=R(t);return h?ne.fetchOffer(l,a,c,h,e).then(u=>s(Ue(u,r)),u=>s(jr(u))).finally(()=>s(Bt(d))):null},"fetchOfferThunk"),"fetchOffer"),Wn=n(()=>({type:Ae}),"checkout"),Xa=n((t,e,r,o)=>({type:Sn,payload:{product:t,order:e,quantity:r,offerId:o}}),"requestCreateOneTime"),ec=n(t=>({type:Nt,payload:t}),"receiveCreateOneTime"),tc=n((t,e)=>({type:Tn,payload:{item:t,frequency:e}}),"requestConvertOneTimeToSubscription"),rc=n((t,e)=>({type:kt,payload:{response:t,product:e}}),"receiveConvertOneTime"),Yn=n((t,e,r,o=!1,s=null)=>n(function(a,c){let{auth:l,config:d,environment:{legoUrl:h},previewUpsellOffer:u,offerId:m}=c();if(!l)return a(ae("No auth set."));let O=Fn(s,d),_=Xa(t,e,r,m);return a(_),(u?Promise.resolve({legoUrl:h,product:t,order:e,quantity:r,offer:m}):ne.createOneTime(h,l,t.id,e,r,m)).then(f=>(a(ec(f)),o?(a(tc(f,O)),(u?Promise.resolve({item:f,frequency:O}):ne.convertOneTimeToSubscription(h,l,f,O,m)).then(y=>a(rc(y,t)),y=>a(jr(y)))):f),f=>a(jr(f))).finally(()=>a(Bt(_)))},"createIuThunk"),"createIu"),Jn=n(t=>({type:It,payload:t}),"setLocale"),Qn=n(t=>({type:qt,payload:t}),"setConfig"),Kn=n((t,e,r)=>({type:Ut,payload:{selector:t,markup:e,config:r}}),"addTemplate"),Zn=n(t=>({type:Dt,payload:t}),"setTemplates"),Xn=n((t,e)=>({type:Ft,payload:{product:t,firstOrderPlaceDate:e}}),"setFirstOrderPlaceDate"),es=n((t,e)=>({type:Lt,payload:{product:t,productToSubscribe:e}}),"setProductToSubscribe")});var Br,xe,Se=x(()=>{Br=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,xe=n((t,e,r=null)=>{for(;e!==r;){let o=e.nextSibling;t.removeChild(e),e=o}},"removeNodes")});var j,zr,ys,Le,Te,bs,it,J,er,ce=x(()=>{j=`{{lit-${String(Math.random()).slice(2)}}}`,zr=`<!--${j}-->`,ys=new RegExp(`${j}|${zr}`),Le="$lit$",Te=class{constructor(e,r){this.parts=[],this.element=r;let o=[],s=[],i=document.createTreeWalker(r.content,133,null,!1),a=0,c=-1,l=0,{strings:d,values:{length:h}}=e;for(;l<h;){let u=i.nextNode();if(u===null){i.currentNode=s.pop();continue}if(c++,u.nodeType===1){if(u.hasAttributes()){let m=u.attributes,{length:O}=m,_=0;for(let f=0;f<O;f++)bs(m[f].name,Le)&&_++;for(;_-- >0;){let f=d[l],y=er.exec(f)[2],w=y.toLowerCase()+Le,b=u.getAttribute(w);u.removeAttribute(w);let C=b.split(ys);this.parts.push({type:"attribute",index:c,name:y,strings:C}),l+=C.length-1}}u.tagName==="TEMPLATE"&&(s.push(u),i.currentNode=u.content)}else if(u.nodeType===3){let m=u.data;if(m.indexOf(j)>=0){let O=u.parentNode,_=m.split(ys),f=_.length-1;for(let y=0;y<f;y++){let w,b=_[y];if(b==="")w=J();else{let C=er.exec(b);C!==null&&bs(C[2],Le)&&(b=b.slice(0,C.index)+C[1]+C[2].slice(0,-Le.length)+C[3]),w=document.createTextNode(b)}O.insertBefore(w,u),this.parts.push({type:"node",index:++c})}_[f]===""?(O.insertBefore(J(),u),o.push(u)):u.data=_[f],l+=f}}else if(u.nodeType===8)if(u.data===j){let m=u.parentNode;(u.previousSibling===null||c===a)&&(c++,m.insertBefore(J(),u)),a=c,this.parts.push({type:"node",index:c}),u.nextSibling===null?u.data="":(o.push(u),c--),l++}else{let m=-1;for(;(m=u.data.indexOf(j,m+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(let u of o)u.parentNode.removeChild(u)}};n(Te,"Template");bs=n((t,e)=>{let r=t.length-e.length;return r>=0&&t.slice(r)===e},"endsWith"),it=n(t=>t.index!==-1,"isTemplatePartActive"),J=n(()=>document.createComment(""),"createMarker"),er=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function Yr(t,e){let{element:{content:r},parts:o}=t,s=document.createTreeWalker(r,Wr,null,!1),i=at(o),a=o[i],c=-1,l=0,d=[],h=null;for(;s.nextNode();){c++;let u=s.currentNode;for(u.previousSibling===h&&(h=null),e.has(u)&&(d.push(u),h===null&&(h=u)),h!==null&&l++;a!==void 0&&a.index===c;)a.index=h!==null?-1:a.index-l,i=at(o,i),a=o[i]}d.forEach(u=>u.parentNode.removeChild(u))}function _s(t,e,r=null){let{element:{content:o},parts:s}=t;if(r==null){o.appendChild(e);return}let i=document.createTreeWalker(o,Wr,null,!1),a=at(s),c=0,l=-1;for(;i.nextNode();)for(l++,i.currentNode===r&&(c=yc(e),r.parentNode.insertBefore(e,r));a!==-1&&s[a].index===l;){if(c>0){for(;a!==-1;)s[a].index+=c,a=at(s,a);return}a=at(s,a)}}var Wr,yc,at,Es=x(()=>{ce();Wr=133;n(Yr,"removeNodesFromTemplate");yc=n(t=>{let e=t.nodeType===11?0:1,r=document.createTreeWalker(t,Wr,null,!1);for(;r.nextNode();)e++;return e},"countNodes"),at=n((t,e=-1)=>{for(let r=e+1;r<t.length;r++){let o=t[r];if(it(o))return r}return-1},"nextActiveIndexInTemplateParts");n(_s,"insertNodeIntoTemplate")});var bc,ve,Jr=x(()=>{bc=new WeakMap,ve=n(t=>typeof t=="function"&&bc.has(t),"isDirective")});var D,tr,Qr=x(()=>{D={},tr={}});var le,rr=x(()=>{Se();ce();le=class{constructor(e,r,o){this.__parts=[],this.template=e,this.processor=r,this.options=o}update(e){let r=0;for(let o of this.__parts)o!==void 0&&o.setValue(e[r]),r++;for(let o of this.__parts)o!==void 0&&o.commit()}_clone(){let e=Br?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),r=[],o=this.template.parts,s=document.createTreeWalker(e,133,null,!1),i=0,a=0,c,l=s.nextNode();for(;i<o.length;){if(c=o[i],!it(c)){this.__parts.push(void 0),i++;continue}for(;a<c.index;)a++,l.nodeName==="TEMPLATE"&&(r.push(l),s.currentNode=l.content),(l=s.nextNode())===null&&(s.currentNode=r.pop(),l=s.nextNode());if(c.type==="node"){let d=this.processor.handleTextExpression(this.options);d.insertAfterNode(l.previousSibling),this.__parts.push(d)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));i++}return Br&&(document.adoptNode(e),customElements.upgrade(e)),e}};n(le,"TemplateInstance")});var xs,Ec,Z,or=x(()=>{Se();ce();xs=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),Ec=` ${j} `,Z=class{constructor(e,r,o,s){this.strings=e,this.values=r,this.type=o,this.processor=s}getHTML(){let e=this.strings.length-1,r="",o=!1;for(let s=0;s<e;s++){let i=this.strings[s],a=i.lastIndexOf("<!--");o=(a>-1||o)&&i.indexOf("-->",a+1)===-1;let c=er.exec(i);c===null?r+=i+(o?Ec:zr):r+=i.substr(0,c.index)+c[1]+c[2]+Le+c[3]+j}return r+=this.strings[e],r}getTemplateElement(){let e=document.createElement("template"),r=this.getHTML();return xs!==void 0&&(r=xs.createHTML(r)),e.innerHTML=r,e}};n(Z,"TemplateResult")});var nr,sr,je,ct,X,lt,ut,ir,Ss,pt,xc,ar=x(()=>{Jr();Se();Qr();rr();or();ce();nr=n(t=>t===null||!(typeof t=="object"||typeof t=="function"),"isPrimitive"),sr=n(t=>Array.isArray(t)||!!(t&&t[Symbol.iterator]),"isIterable"),je=class{constructor(e,r,o){this.dirty=!0,this.element=e,this.name=r,this.strings=o,this.parts=[];for(let s=0;s<o.length-1;s++)this.parts[s]=this._createPart()}_createPart(){return new ct(this)}_getValue(){let e=this.strings,r=e.length-1,o=this.parts;if(r===1&&e[0]===""&&e[1]===""){let i=o[0].value;if(typeof i=="symbol")return String(i);if(typeof i=="string"||!sr(i))return i}let s="";for(let i=0;i<r;i++){s+=e[i];let a=o[i];if(a!==void 0){let c=a.value;if(nr(c)||!sr(c))s+=typeof c=="string"?c:String(c);else for(let l of c)s+=typeof l=="string"?l:String(l)}}return s+=e[r],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}};n(je,"AttributeCommitter");ct=class{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==D&&(!nr(e)||e!==this.value)&&(this.value=e,ve(e)||(this.committer.dirty=!0))}commit(){for(;ve(this.value);){let e=this.value;this.value=D,e(this)}this.value!==D&&this.committer.commit()}};n(ct,"AttributePart");X=class{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(J()),this.endNode=e.appendChild(J())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=J()),e.__insert(this.endNode=J())}insertAfterPart(e){e.__insert(this.startNode=J()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;ve(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=D,r(this)}let e=this.__pendingValue;e!==D&&(nr(e)?e!==this.value&&this.__commitText(e):e instanceof Z?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):sr(e)?this.__commitIterable(e):e===tr?(this.value=tr,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){let r=this.startNode.nextSibling;e=e??"";let o=typeof e=="string"?e:String(e);r===this.endNode.previousSibling&&r.nodeType===3?r.data=o:this.__commitNode(document.createTextNode(o)),this.value=e}__commitTemplateResult(e){let r=this.options.templateFactory(e);if(this.value instanceof le&&this.value.template===r)this.value.update(e.values);else{let o=new le(r,e.processor,this.options),s=o._clone();o.update(e.values),this.__commitNode(s),this.value=o}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());let r=this.value,o=0,s;for(let i of e)s=r[o],s===void 0&&(s=new X(this.options),r.push(s),o===0?s.appendIntoPart(this):s.insertAfterPart(r[o-1])),s.setValue(i),s.commit(),o++;o<r.length&&(r.length=o,this.clear(s&&s.endNode))}clear(e=this.startNode){xe(this.startNode.parentNode,e.nextSibling,this.endNode)}};n(X,"NodePart");lt=class{constructor(e,r,o){if(this.value=void 0,this.__pendingValue=void 0,o.length!==2||o[0]!==""||o[1]!=="")throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=r,this.strings=o}setValue(e){this.__pendingValue=e}commit(){for(;ve(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=D,r(this)}if(this.__pendingValue===D)return;let e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=D}};n(lt,"BooleanAttributePart");ut=class extends je{constructor(e,r,o){super(e,r,o);this.single=o.length===2&&o[0]===""&&o[1]===""}_createPart(){return new ir(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}};n(ut,"PropertyCommitter");ir=class extends ct{};n(ir,"PropertyPart");Ss=!1;(()=>{try{let t={get capture(){return Ss=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{}})();pt=class{constructor(e,r,o){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=r,this.eventContext=o,this.__boundHandleEvent=s=>this.handleEvent(s)}setValue(e){this.__pendingValue=e}commit(){for(;ve(this.__pendingValue);){let i=this.__pendingValue;this.__pendingValue=D,i(this)}if(this.__pendingValue===D)return;let e=this.__pendingValue,r=this.value,o=e==null||r!=null&&(e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive),s=e!=null&&(r==null||o);o&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=xc(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=D}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}};n(pt,"EventPart");xc=n(t=>t&&(Ss?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),"getOptions")});function Kr(t){let e=Oe.get(t.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},Oe.set(t.type,e));let r=e.stringsArray.get(t.strings);if(r!==void 0)return r;let o=t.strings.join(j);return r=e.keyString.get(o),r===void 0&&(r=new Te(t,t.getTemplateElement()),e.keyString.set(o,r)),e.stringsArray.set(t.strings,r),r}var Oe,cr=x(()=>{ce();n(Kr,"templateFactory");Oe=new Map});var ue,Zr,Xr=x(()=>{Se();ar();cr();ue=new WeakMap,Zr=n((t,e,r)=>{let o=ue.get(e);o===void 0&&(xe(e,e.firstChild),ue.set(e,o=new X(Object.assign({templateFactory:Kr},r))),o.appendInto(e)),o.setValue(t),o.commit()},"render")});var lr,eo,to=x(()=>{ar();lr=class{handleAttributeExpressions(e,r,o,s){let i=r[0];return i==="."?new ut(e,r.slice(1),o).parts:i==="@"?[new pt(e,r.slice(1),s.eventContext)]:i==="?"?[new lt(e,r.slice(1),o)]:new je(e,r,o).parts}handleTextExpression(e){return new X(e)}};n(lr,"DefaultTemplateProcessor");eo=new lr});var p,ro=x(()=>{to();or();to();Jr();Se();Qr();ar();Xr();cr();rr();or();ce();typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");p=n((t,...e)=>new Z(t,e,"html",eo),"html")});var vs,ur,Tc,vc,Oc,Os,wc,ws,Cs=x(()=>{Se();Es();Xr();cr();rr();ce();ro();vs=n((t,e)=>`${t}--${e}`,"getTemplateCacheKey"),ur=!0;typeof window.ShadyCSS=="undefined"?ur=!1:typeof window.ShadyCSS.prepareTemplateDom=="undefined"&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),ur=!1);Tc=n(t=>e=>{let r=vs(e.type,t),o=Oe.get(r);o===void 0&&(o={stringsArray:new WeakMap,keyString:new Map},Oe.set(r,o));let s=o.stringsArray.get(e.strings);if(s!==void 0)return s;let i=e.strings.join(j);if(s=o.keyString.get(i),s===void 0){let a=e.getTemplateElement();ur&&window.ShadyCSS.prepareTemplateDom(a,t),s=new Te(e,a),o.keyString.set(i,s)}return o.stringsArray.set(e.strings,s),s},"shadyTemplateFactory"),vc=["html","svg"],Oc=n(t=>{vc.forEach(e=>{let r=Oe.get(vs(e,t));r!==void 0&&r.keyString.forEach(o=>{let{element:{content:s}}=o,i=new Set;Array.from(s.querySelectorAll("style")).forEach(a=>{i.add(a)}),Yr(o,i)})})},"removeStylesFromLitTemplates"),Os=new Set,wc=n((t,e,r)=>{Os.add(t);let o=r?r.element:document.createElement("template"),s=e.querySelectorAll("style"),{length:i}=s;if(i===0){window.ShadyCSS.prepareTemplateStyles(o,t);return}let a=document.createElement("style");for(let d=0;d<i;d++){let h=s[d];h.parentNode.removeChild(h),a.textContent+=h.textContent}Oc(t);let c=o.content;r?_s(r,a,c.firstChild):c.insertBefore(a,c.firstChild),window.ShadyCSS.prepareTemplateStyles(o,t);let l=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&l!==null)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(r){c.insertBefore(a,c.firstChild);let d=new Set;d.add(a),Yr(r,d)}},"prepareTemplateStyles"),ws=n((t,e,r)=>{if(!r||typeof r!="object"||!r.scopeName)throw new Error("The `scopeName` option is required.");let o=r.scopeName,s=ue.has(e),i=ur&&e.nodeType===11&&!!e.host,a=i&&!Os.has(o),c=a?document.createDocumentFragment():e;if(Zr(t,c,Object.assign({templateFactory:Tc(o)},r)),a){let l=ue.get(c);ue.delete(c);let d=l.value instanceof le?l.value.template:void 0;wc(o,c,d),xe(e,e.firstChild),e.appendChild(c),ue.set(e,l)}!s&&i&&window.ShadyCSS.styleElement(e.host)},"render")});var Ps,oo,Rs,no,so,io,ao,co,lo,dt,uo=x(()=>{window.JSCompiler_renameProperty=(t,e)=>t;oo={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return t!==null;case Number:return t===null?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},Rs=n((t,e)=>e!==t&&(e===e||t===t),"notEqual"),no={attribute:!0,type:String,converter:oo,reflect:!1,hasChanged:Rs},so=1,io=1<<2,ao=1<<3,co=1<<4,lo="finalized",dt=class extends HTMLElement{constructor(){super();this.initialize()}static get observedAttributes(){this.finalize();let e=[];return this._classProperties.forEach((r,o)=>{let s=this._attributeNameForProperty(o,r);s!==void 0&&(this._attributeToPropertyMap.set(s,o),e.push(s))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;let e=Object.getPrototypeOf(this)._classProperties;e!==void 0&&e.forEach((r,o)=>this._classProperties.set(o,r))}}static createProperty(e,r=no){if(this._ensureClassProperties(),this._classProperties.set(e,r),r.noAccessor||this.prototype.hasOwnProperty(e))return;let o=typeof e=="symbol"?Symbol():`__${e}`,s=this.getPropertyDescriptor(e,o,r);s!==void 0&&Object.defineProperty(this.prototype,e,s)}static getPropertyDescriptor(e,r,o){return{get(){return this[r]},set(s){let i=this[e];this[r]=s,this.requestUpdateInternal(e,i,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||no}static finalize(){let e=Object.getPrototypeOf(this);if(e.hasOwnProperty(lo)||e.finalize(),this[lo]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){let r=this.properties,o=[...Object.getOwnPropertyNames(r),...typeof Object.getOwnPropertySymbols=="function"?Object.getOwnPropertySymbols(r):[]];for(let s of o)this.createProperty(s,r[s])}}static _attributeNameForProperty(e,r){let o=r.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}static _valueHasChanged(e,r,o=Rs){return o(e,r)}static _propertyValueFromAttribute(e,r){let o=r.type,s=r.converter||oo,i=typeof s=="function"?s:s.fromAttribute;return i?i(e,o):e}static _propertyValueToAttribute(e,r){if(r.reflect===void 0)return;let o=r.type,s=r.converter;return(s&&s.toAttribute||oo.toAttribute)(e,o)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,r)=>{if(this.hasOwnProperty(r)){let o=this[r];delete this[r],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(r,o)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,r)=>this[r]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){this._enableUpdatingResolver!==void 0&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,r,o){r!==o&&this._attributeToProperty(e,o)}_propertyToAttribute(e,r,o=no){let s=this.constructor,i=s._attributeNameForProperty(e,o);if(i!==void 0){let a=s._propertyValueToAttribute(r,o);if(a===void 0)return;this._updateState=this._updateState|ao,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._updateState=this._updateState&~ao}}_attributeToProperty(e,r){if(this._updateState&ao)return;let o=this.constructor,s=o._attributeToPropertyMap.get(e);if(s!==void 0){let i=o.getPropertyOptions(s);this._updateState=this._updateState|co,this[s]=o._propertyValueFromAttribute(r,i),this._updateState=this._updateState&~co}}requestUpdateInternal(e,r,o){let s=!0;if(e!==void 0){let i=this.constructor;o=o||i.getPropertyOptions(e),i._valueHasChanged(this[e],r,o.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,r),o.reflect===!0&&!(this._updateState&co)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,o))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,r){return this.requestUpdateInternal(e,r),this.updateComplete}async _enqueueUpdate(){this._updateState=this._updateState|io;try{await this._updatePromise}catch{}let e=this.performUpdate();return e!=null&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return this._updateState&io}get hasUpdated(){return this._updateState&so}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1,r=this._changedProperties;try{e=this.shouldUpdate(r),e?this.update(r):this._markUpdated()}catch(o){throw e=!1,this._markUpdated(),o}e&&(this._updateState&so||(this._updateState=this._updateState|so,this.firstUpdated(r)),this.updated(r))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~io}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){this._reflectingProperties!==void 0&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((r,o)=>this._propertyToAttribute(o,this[o],r)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}};n(dt,"UpdatingElement");Ps=lo;dt[Ps]=!0});var As,Jp,Ns=x(()=>{As=Element.prototype,Jp=As.msMatchesSelector||As.webkitMatchesSelector});var pr,po,ft,ks,Cc,T,fo=x(()=>{pr=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,po=Symbol(),ft=class{constructor(e,r){if(r!==po)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return this._styleSheet===void 0&&(pr?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}};n(ft,"CSSResult");ks=n(t=>new ft(String(t),po),"unsafeCSS"),Cc=n(t=>{if(t instanceof ft)return t.cssText;if(typeof t=="number")return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but
11
+ var lib=(()=>{var Gi=Object.create;var Be=Object.defineProperty;var Bi=Object.getOwnPropertyDescriptor;var zi=Object.getOwnPropertyNames;var Wi=Object.getPrototypeOf,Yi=Object.prototype.hasOwnProperty;var nn=t=>Be(t,"__esModule",{value:!0}),n=(t,e)=>Be(t,"name",{value:e,configurable:!0});var x=(t,e)=>()=>(t&&(e=t(t=0)),e);var fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xr=(t,e)=>{nn(t);for(var r in e)Be(t,r,{get:e[r],enumerable:!0})},Ji=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of zi(e))!Yi.call(t,o)&&o!=="default"&&Be(t,o,{get:()=>e[o],enumerable:!(r=Bi(e,o))||r.enumerable});return t},te=t=>Ji(nn(Be(t!=null?Gi(Wi(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Et=fe((_t,fn)=>{(function(t,e){typeof _t=="object"&&typeof fn!="undefined"?e(_t):typeof define=="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.throttleDebounce={}))})(_t,function(t){"use strict";function e(o,s,i,a){var c,l=!1,d=0;function h(){c&&clearTimeout(c)}n(h,"clearExistingTimeout");function u(){h(),l=!0}n(u,"cancel"),typeof s!="boolean"&&(a=i,i=s,s=void 0);function m(){for(var O=arguments.length,_=new Array(O),f=0;f<O;f++)_[f]=arguments[f];var y=this,w=Date.now()-d;if(l)return;function b(){d=Date.now(),i.apply(y,_)}n(b,"exec");function C(){c=void 0}n(C,"clear"),a&&!c&&b(),h(),a===void 0&&w>o?b():s!==!0&&(c=setTimeout(a?C:b,a===void 0?o-w:o))}return n(m,"wrapper"),m.cancel=u,m}n(e,"throttle");function r(o,s,i){return i===void 0?e(o,s,!1):e(o,i,s!==!1)}n(r,"debounce"),t.debounce=r,t.throttle=e,Object.defineProperty(t,"__esModule",{value:!0})})});function mn(){return typeof window.og_auth!="undefined"?xt(window.og_auth):null}async function sa(t=100){return new Promise(e=>{setTimeout(()=>e(mn()),t)})}async function gn(t,e=ra,r=oa){let o;if(o=xt(mn())||xt(e()),o)return o;if(t&&typeof t=="string"){let s=await fetch(t);s.status>=200&&s.status<300&&(o=e()||await(na(s)?s.json():Promise.resolve(r(t)).then(e)))}else o||(o=await sa());if(o=xt(o),o)return o;throw new Error("Unauthorized")}var hn,ra,xt,oa,na,yn=x(()=>{hn=/^og_auth=/,ra=n((t=hn)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace(hn,""),"c"),xt=n(t=>{if(typeof t=="object")return t;let e=String(t||"").split("|");return e.length===3?{sig_field:e[0],ts:parseInt(e[1],10),sig:e[2]}:null},"r"),oa=n(t=>new Promise((e,r)=>{let o=document.createElement("iframe");o.style.setProperty("display","none","important"),document.body.appendChild(o),o.onload=e,o.onerror=r,o.src=t}),"p"),na=n(t=>(t.headers.get("content-type")||"").indexOf("application/json")!==-1,"d");n(mn,"a");n(sa,"f");n(gn,"u")});var I,q,U,St,z,P,We,Tt,vt,bn,Ot,Re,_n,wt,Ct,En,Pt,Rt,At,xn,Sn,Nt,Tn,kt,Ae,vn,It,qt,Ye,Je,Ut,Dt,he,re,Ft,Lt,Q,W,oe,me,jt,ge,Ne,Cr,Pr,On,$=x(()=>{I="OPTIN_PRODUCT",q="OPTOUT_PRODUCT",U="PRODUCT_CHANGE_FREQUENCY",St="SET_MERCHANT_ID",z="REQUEST_OFFER",P="RECEIVE_OFFER",We="PRODUCT_HAS_CHANGED",Tt="CREATED_SESSION_ID",vt="SET_AUTH_URL",bn="REQUEST_AUTH",Ot="AUTHORIZE",Re="UNAUTHORIZED",_n="REQUEST_ORDERS",wt="RECEIVE_ORDERS",Ct="RECEIVE_ORDER_ITEMS",En="FETCH_RESPONSE_ERROR",Pt="SET_ENVIRONMENT_STAGING",Rt="SET_ENVIRONMENT_DEV",At="SET_ENVIRONMENT_PROD",xn="CONCLUDE_UPSELL",Sn="REQUEST_CREATE_IU_ORDER",Nt="CREATE_ONE_TIME",Tn="REQUEST_CONVERT_ONE_TIME",kt="CONVERT_ONE_TIME",Ae="CHECKOUT",vn="RECEIVE_FETCH",It="SET_LOCALE",qt="SET_CONFIG",Ye="SET_PREVIEW_STANDARD_OFFER",Je="SET_PREVIEW_UPSELL_OFFER",Ut="ADD_TEMPLATE",Dt="SET_TEMPLATES",he="LOCAL_STORAGE_CHANGE",re="LOCAL_STORAGE_CLEAR",Ft="SET_FIRST_ORDER_PLACE_DATE",Lt="SET_PRODUCT_TO_SUBSCRIBE",Q="RECEIVE_PRODUCT_PLANS",W="SETUP_PRODUCT",oe="SETUP_CART",me="pdp",jt="dev",ge="staging",Ne="prod",Cr="static.ordergroove.com",Pr="staging.static.ordergroove.com",On="og-cart-updated"});var Ke=fe((bu,In)=>{var ia="Expected a function",wn="__lodash_hash_undefined__",aa="[object Function]",ca="[object GeneratorFunction]",la=/[\\^$.*+?()[\]{}|]/g,ua=/^\[object .+?Constructor\]$/,pa=typeof window=="object"&&window&&window.Object===Object&&window,da=typeof self=="object"&&self&&self.Object===Object&&self,Cn=pa||da||Function("return this")();function fa(t,e){return t==null?void 0:t[e]}n(fa,"getValue");function ha(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}n(ha,"isHostObject");var ma=Array.prototype,ga=Function.prototype,Pn=Object.prototype,Rr=Cn["__core-js_shared__"],Rn=function(){var t=/[^.]+$/.exec(Rr&&Rr.keys&&Rr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),An=ga.toString,Ar=Pn.hasOwnProperty,ya=Pn.toString,ba=RegExp("^"+An.call(Ar).replace(la,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_a=ma.splice,Ea=Nn(Cn,"Map"),Qe=Nn(Object,"create");function ye(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(ye,"Hash");function xa(){this.__data__=Qe?Qe(null):{}}n(xa,"hashClear");function Sa(t){return this.has(t)&&delete this.__data__[t]}n(Sa,"hashDelete");function Ta(t){var e=this.__data__;if(Qe){var r=e[t];return r===wn?void 0:r}return Ar.call(e,t)?e[t]:void 0}n(Ta,"hashGet");function va(t){var e=this.__data__;return Qe?e[t]!==void 0:Ar.call(e,t)}n(va,"hashHas");function Oa(t,e){var r=this.__data__;return r[t]=Qe&&e===void 0?wn:e,this}n(Oa,"hashSet");ye.prototype.clear=xa;ye.prototype.delete=Sa;ye.prototype.get=Ta;ye.prototype.has=va;ye.prototype.set=Oa;function ke(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(ke,"ListCache");function wa(){this.__data__=[]}n(wa,"listCacheClear");function Ca(t){var e=this.__data__,r=Mt(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():_a.call(e,r,1),!0}n(Ca,"listCacheDelete");function Pa(t){var e=this.__data__,r=Mt(e,t);return r<0?void 0:e[r][1]}n(Pa,"listCacheGet");function Ra(t){return Mt(this.__data__,t)>-1}n(Ra,"listCacheHas");function Aa(t,e){var r=this.__data__,o=Mt(r,t);return o<0?r.push([t,e]):r[o][1]=e,this}n(Aa,"listCacheSet");ke.prototype.clear=wa;ke.prototype.delete=Ca;ke.prototype.get=Pa;ke.prototype.has=Ra;ke.prototype.set=Aa;function be(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(be,"MapCache");function Na(){this.__data__={hash:new ye,map:new(Ea||ke),string:new ye}}n(Na,"mapCacheClear");function ka(t){return $t(this,t).delete(t)}n(ka,"mapCacheDelete");function Ia(t){return $t(this,t).get(t)}n(Ia,"mapCacheGet");function qa(t){return $t(this,t).has(t)}n(qa,"mapCacheHas");function Ua(t,e){return $t(this,t).set(t,e),this}n(Ua,"mapCacheSet");be.prototype.clear=Na;be.prototype.delete=ka;be.prototype.get=Ia;be.prototype.has=qa;be.prototype.set=Ua;function Mt(t,e){for(var r=t.length;r--;)if(Ma(t[r][0],e))return r;return-1}n(Mt,"assocIndexOf");function Da(t){if(!kn(t)||La(t))return!1;var e=$a(t)||ha(t)?ba:ua;return e.test(ja(t))}n(Da,"baseIsNative");function $t(t,e){var r=t.__data__;return Fa(e)?r[typeof e=="string"?"string":"hash"]:r.map}n($t,"getMapData");function Nn(t,e){var r=fa(t,e);return Da(r)?r:void 0}n(Nn,"getNative");function Fa(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}n(Fa,"isKeyable");function La(t){return!!Rn&&Rn in t}n(La,"isMasked");function ja(t){if(t!=null){try{return An.call(t)}catch{}try{return t+""}catch{}}return""}n(ja,"toSource");function Nr(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(ia);var r=n(function(){var o=arguments,s=e?e.apply(this,o):o[0],i=r.cache;if(i.has(s))return i.get(s);var a=t.apply(this,o);return r.cache=i.set(s,a),a},"memoized");return r.cache=new(Nr.Cache||be),r}n(Nr,"memoize");Nr.Cache=be;function Ma(t,e){return t===e||t!==t&&e!==e}n(Ma,"eq");function $a(t){var e=kn(t)?ya.call(t):"";return e==aa||e==ca}n($a,"isFunction");function kn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}n(kn,"isObject");In.exports=Nr});var Vt,kr,Ze,Xe,Ht,qn,Un,Va,Ha,Ga,Ba,za,et,Ir,Wa,Dn,tt,Ya,ne,se=x(()=>{Vt=te(Ke()),kr=n((...t)=>JSON.stringify(t),"memoizeKey"),Ze=n(t=>(...e)=>fetch(...t(...e)).then(r=>r.json()),"withFetchJson"),Xe=n(t=>(e,...r)=>{if(!e)throw Error("host required");let[o,s={}]=t(...r);return[`${e.replace(/\/+$/,"")}${o}`,s]},"withHost"),Ht=n(t=>(e,...r)=>{if(!e)throw Error("auth required");let[o,s={}]=t(...r);return[o,{...s,headers:{Authorization:JSON.stringify(e),...s.headers}}]},"withAuth"),qn=n(t=>(...e)=>{let[r,o={}]=t(...e);return[r,{method:"POST",...o,body:JSON.stringify(o.body),headers:{"Content-type":"application/json",...o.headers}}]},"withJsonBody"),Un=n((t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([e,r])=>[e,encodeURIComponent(r)].join("=")).join("&"),"toQuery"),Va=n(t=>JSON.stringify([].concat(t).map(e=>typeof e=="object"?e.id:e).filter(e=>e)),"toProductId"),Ha=(0,Vt.default)(Ze(Xe((t,e,r,o="pdp")=>{if(!t)throw Error("merchantId required");if(!e)throw Error("sessionId required");if(!r)throw Error("product required");let s=Un([["session_id",e],["page_type",1],["p",Va(r)],["module_view",JSON.stringify(["regular"])]]);return[`/offer/${t}/${o}?${s}`]})),kr),Ga=(0,Vt.default)(Ze(Xe(Ht((t=1,e="place")=>[`/orders/?${Un([["status",t],["ordering",e],["exclude_prepaid_orders","true"]])}`]))),kr),Ba=(0,Vt.default)(Ze(Xe(Ht(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),kr),za=Ze(Xe(Ht(qn((t,e,r,o)=>{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(!o)throw Error("offer required");return["/items/iu/",{body:{product:t,order:e,quantity:r,offer:o}}]})))),et=n(t=>{if(typeof t=="object")return{...t};let[e,r]=(t||"").split(/_/).map(o=>parseInt(o,10));return e&&r&&{every:e,every_period:r}},"parseFrequency"),Ir=n(t=>t.match(/^\d+_\d$/),"isFrequencyValid"),Wa=n((t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),"compareFrequencies"),Dn=n(t=>[...new Set(t&&t.split(/\s+/))].filter(Ir).sort(Wa),"parseFrequenciesList"),tt=n(t=>{if(typeof t=="object"){let{every:e,period:r,every_period:o}=t;return`${e}_${r||o}`}return typeof t=="string"?t:""},"stringifyFrequency"),Ya=Ze(Xe(Ht(qn((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");let o=et(e);if(!o)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:t.public_id,offer:r,...o}}]})))),ne={fetchOffer:Ha,fetchOrders:Ga,fetchItems:Ba,createOneTime:za,convertOneTimeToSubscription:Ya}});var Ie,_e,qr=x(()=>{V();Ie=rt(),_e={shopify:typeof(Ie==null?void 0:Ie.dataset.shopifySellingPlans)!="undefined",shopify_selling_plans:typeof(Ie==null?void 0:Ie.dataset.shopifySellingPlans)!="undefined"}});function ot(t){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t()}function rt(){return document.querySelector([`script[src^="https://${Cr}"]`,`script[src^="https://${Pr}"]`,`script[src^="http://${Cr}"]`,`script[src^="http://${Pr}"]`].join(","))}function Ur(){let t=rt();if(!t)return[];let e=new URL(t.src),r=e.host.startsWith(ge)?ge:Ne,o=e.pathname.split("/")[1];return!r&&!o?[]:[o,r,t]}function Ln(t){if(t.isReady())return;let[e,r]=Ur();!r&&!e||t.initialize(e,r)}function Mn(t){let e=document.cookie.match(`(^|;) ?${t}=([^;]*)(;|$)`);return e?e[2]:null}var R,Fn,jn,V=x(()=>{qr();$();n(ot,"onReady");n(rt,"getMainJs");n(Ur,"resolveEnvAndMerchant");R=n(t=>{var r;if(!t)return"";let e=`${t.id||t}`;return((r=_e)==null?void 0:r.shopify_selling_plans)&&(e=e.split(":")[0]),e},"safeProductId"),Fn=n((t,e)=>{var r;if(_e.shopify_selling_plans){let o=(r=e.frequencies)==null?void 0:r.indexOf(t);if(o>=0&&e.frequenciesEveryPeriod[o])return e.frequenciesEveryPeriod[o];throw`OG Can't convert selling_plan_id ${t} to OG frequency every period`}return t},"safeOgFrequency");n(Ln,"autoInitializeOffers");jn=n(t=>{document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`},"clearCookie");n(Mn,"getCookieValue")});var ie,qe,$n,Gt,Vn,Hn,Ja,Qa,nt,ae,Gn,Bt,Bn,Ka,Dr,Fr,zt,Lr,Wt,Ue,jr,Za,zn,Wn,Xa,ec,tc,rc,Yn,Jn,Qn,Kn,Zn,Xn,es,N=x(()=>{yn();$();se();V();ie=n((t,e,r)=>({type:I,payload:{product:t,frequency:e,offer:r}}),"optinProduct"),qe=n((t,e)=>({type:q,payload:{product:t,offer:e}}),"optoutProduct"),$n=n((t,e)=>({type:We,payload:{newProduct:t,product:e}}),"productHasChangedComponents"),Gt=n((t,e,r)=>({type:U,payload:{product:t,frequency:e,offer:r}}),"productChangeFrequency"),Vn=n(t=>({type:xn,payload:{product:t}}),"concludeUpsell"),Hn=n(t=>({type:St,payload:t}),"setMerchantId"),Ja=n(t=>({type:Tt,payload:`${t}.${Math.floor(Math.random()*999999)}.${Math.round(new Date().getTime()/1e3)}`}),"createSessionId"),Qa=n(t=>({type:bn,payload:t}),"requestAuth"),nt=n((t,e,r,o)=>({type:Ot,payload:{public_id:t,sig_field:e,ts:r,sig:o}}),"authorize"),ae=n(t=>({type:Re,payload:t}),"unauthorized"),Gn=n(t=>({type:vt,payload:t}),"setAuthUrl"),Bt=n(t=>({type:vn,payload:t}),"fetchDone"),Bn=n((t=gn)=>n(function(r,o){if(window.og&&window.og.previewMode)return r(ae({message:"Offers are running in preview mode"}));let{merchantId:s,authUrl:i}=o(),a=Qa(i);return r(a),t(i).then(({sig_field:c,ts:l,sig:d})=>r(nt(s,c,l,d)),c=>r(ae(c))).finally(()=>r(Bt(a)))},"fetchAuthThunk"),"fetchAuth"),Ka=n((t,e)=>({type:_n,payload:{status:t,ordering:e}}),"requestOrders"),Dr=n(t=>({type:wt,payload:t}),"receiveOrders"),Fr=n(t=>({type:Ct,payload:t}),"receiveItems"),zt=n((t=1,e="place")=>n(function(o,s){let{environment:{legoUrl:i},auth:a}=s();if(!a)return o(ae("No auth set."));let c=Ka(t,e);return o(c),ne.fetchOrders(i,a,t,e).then(l=>{if(l.results){o(Dr(l));let d=(l.results[0]||{}).public_id;if(d)return ne.fetchItems(i,a,d).then(h=>o(Fr(h)))}return o(ae(l.detail)),null},l=>o(ae(l))).finally(()=>o(Bt(c)))},"fetchOrdersThunk"),"fetchOrders"),Lr=n(t=>{switch(t){case jt:return{type:Rt,payload:t};case ge:return{type:Pt,payload:t};case Ne:return{type:At,payload:t};default:throw new Error(`${t} is not a supported environment`)}},"setEnvironment"),Wt=n(()=>(t,e)=>{let{merchantId:r,sessionId:o}=e();return(!o||r&&!o.startsWith(r))&&t(Ja(r)),o},"requestSessionId"),Ue=n((t,e)=>({type:P,payload:{...t,offer:e}}),"receiveOffer"),jr=n(t=>({type:En,payload:t}),"fetchResponseError"),Za=n((t,e=me,r)=>({type:z,payload:{product:t,module:e,offer:r}}),"requestOffer"),zn=n((t,e=me,r)=>n(function(s,i){let{merchantId:a,sessionId:c,environment:{apiUrl:l}}=i(),d=Za(t,e,r);s(d);let h=R(t);return h?ne.fetchOffer(l,a,c,h,e).then(u=>s(Ue(u,r)),u=>s(jr(u))).finally(()=>s(Bt(d))):null},"fetchOfferThunk"),"fetchOffer"),Wn=n(()=>({type:Ae}),"checkout"),Xa=n((t,e,r,o)=>({type:Sn,payload:{product:t,order:e,quantity:r,offerId:o}}),"requestCreateOneTime"),ec=n(t=>({type:Nt,payload:t}),"receiveCreateOneTime"),tc=n((t,e)=>({type:Tn,payload:{item:t,frequency:e}}),"requestConvertOneTimeToSubscription"),rc=n((t,e)=>({type:kt,payload:{response:t,product:e}}),"receiveConvertOneTime"),Yn=n((t,e,r,o=!1,s=null)=>n(function(a,c){let{auth:l,config:d,environment:{legoUrl:h},previewUpsellOffer:u,offerId:m}=c();if(!l)return a(ae("No auth set."));let O=Fn(s,d),_=Xa(t,e,r,m);return a(_),(u?Promise.resolve({legoUrl:h,product:t,order:e,quantity:r,offer:m}):ne.createOneTime(h,l,t.id,e,r,m)).then(f=>(a(ec(f)),o?(a(tc(f,O)),(u?Promise.resolve({item:f,frequency:O}):ne.convertOneTimeToSubscription(h,l,f,O,m)).then(y=>a(rc(y,t)),y=>a(jr(y)))):f),f=>a(jr(f))).finally(()=>a(Bt(_)))},"createIuThunk"),"createIu"),Jn=n(t=>({type:It,payload:t}),"setLocale"),Qn=n(t=>({type:qt,payload:t}),"setConfig"),Kn=n((t,e,r)=>({type:Ut,payload:{selector:t,markup:e,config:r}}),"addTemplate"),Zn=n(t=>({type:Dt,payload:t}),"setTemplates"),Xn=n((t,e)=>({type:Ft,payload:{product:t,firstOrderPlaceDate:e}}),"setFirstOrderPlaceDate"),es=n((t,e)=>({type:Lt,payload:{product:t,productToSubscribe:e}}),"setProductToSubscribe")});var Br,xe,Se=x(()=>{Br=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,xe=n((t,e,r=null)=>{for(;e!==r;){let o=e.nextSibling;t.removeChild(e),e=o}},"removeNodes")});var j,zr,ys,Le,Te,bs,it,J,er,ce=x(()=>{j=`{{lit-${String(Math.random()).slice(2)}}}`,zr=`<!--${j}-->`,ys=new RegExp(`${j}|${zr}`),Le="$lit$",Te=class{constructor(e,r){this.parts=[],this.element=r;let o=[],s=[],i=document.createTreeWalker(r.content,133,null,!1),a=0,c=-1,l=0,{strings:d,values:{length:h}}=e;for(;l<h;){let u=i.nextNode();if(u===null){i.currentNode=s.pop();continue}if(c++,u.nodeType===1){if(u.hasAttributes()){let m=u.attributes,{length:O}=m,_=0;for(let f=0;f<O;f++)bs(m[f].name,Le)&&_++;for(;_-- >0;){let f=d[l],y=er.exec(f)[2],w=y.toLowerCase()+Le,b=u.getAttribute(w);u.removeAttribute(w);let C=b.split(ys);this.parts.push({type:"attribute",index:c,name:y,strings:C}),l+=C.length-1}}u.tagName==="TEMPLATE"&&(s.push(u),i.currentNode=u.content)}else if(u.nodeType===3){let m=u.data;if(m.indexOf(j)>=0){let O=u.parentNode,_=m.split(ys),f=_.length-1;for(let y=0;y<f;y++){let w,b=_[y];if(b==="")w=J();else{let C=er.exec(b);C!==null&&bs(C[2],Le)&&(b=b.slice(0,C.index)+C[1]+C[2].slice(0,-Le.length)+C[3]),w=document.createTextNode(b)}O.insertBefore(w,u),this.parts.push({type:"node",index:++c})}_[f]===""?(O.insertBefore(J(),u),o.push(u)):u.data=_[f],l+=f}}else if(u.nodeType===8)if(u.data===j){let m=u.parentNode;(u.previousSibling===null||c===a)&&(c++,m.insertBefore(J(),u)),a=c,this.parts.push({type:"node",index:c}),u.nextSibling===null?u.data="":(o.push(u),c--),l++}else{let m=-1;for(;(m=u.data.indexOf(j,m+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(let u of o)u.parentNode.removeChild(u)}};n(Te,"Template");bs=n((t,e)=>{let r=t.length-e.length;return r>=0&&t.slice(r)===e},"endsWith"),it=n(t=>t.index!==-1,"isTemplatePartActive"),J=n(()=>document.createComment(""),"createMarker"),er=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function Yr(t,e){let{element:{content:r},parts:o}=t,s=document.createTreeWalker(r,Wr,null,!1),i=at(o),a=o[i],c=-1,l=0,d=[],h=null;for(;s.nextNode();){c++;let u=s.currentNode;for(u.previousSibling===h&&(h=null),e.has(u)&&(d.push(u),h===null&&(h=u)),h!==null&&l++;a!==void 0&&a.index===c;)a.index=h!==null?-1:a.index-l,i=at(o,i),a=o[i]}d.forEach(u=>u.parentNode.removeChild(u))}function _s(t,e,r=null){let{element:{content:o},parts:s}=t;if(r==null){o.appendChild(e);return}let i=document.createTreeWalker(o,Wr,null,!1),a=at(s),c=0,l=-1;for(;i.nextNode();)for(l++,i.currentNode===r&&(c=yc(e),r.parentNode.insertBefore(e,r));a!==-1&&s[a].index===l;){if(c>0){for(;a!==-1;)s[a].index+=c,a=at(s,a);return}a=at(s,a)}}var Wr,yc,at,Es=x(()=>{ce();Wr=133;n(Yr,"removeNodesFromTemplate");yc=n(t=>{let e=t.nodeType===11?0:1,r=document.createTreeWalker(t,Wr,null,!1);for(;r.nextNode();)e++;return e},"countNodes"),at=n((t,e=-1)=>{for(let r=e+1;r<t.length;r++){let o=t[r];if(it(o))return r}return-1},"nextActiveIndexInTemplateParts");n(_s,"insertNodeIntoTemplate")});var bc,ve,Jr=x(()=>{bc=new WeakMap,ve=n(t=>typeof t=="function"&&bc.has(t),"isDirective")});var D,tr,Qr=x(()=>{D={},tr={}});var le,rr=x(()=>{Se();ce();le=class{constructor(e,r,o){this.__parts=[],this.template=e,this.processor=r,this.options=o}update(e){let r=0;for(let o of this.__parts)o!==void 0&&o.setValue(e[r]),r++;for(let o of this.__parts)o!==void 0&&o.commit()}_clone(){let e=Br?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),r=[],o=this.template.parts,s=document.createTreeWalker(e,133,null,!1),i=0,a=0,c,l=s.nextNode();for(;i<o.length;){if(c=o[i],!it(c)){this.__parts.push(void 0),i++;continue}for(;a<c.index;)a++,l.nodeName==="TEMPLATE"&&(r.push(l),s.currentNode=l.content),(l=s.nextNode())===null&&(s.currentNode=r.pop(),l=s.nextNode());if(c.type==="node"){let d=this.processor.handleTextExpression(this.options);d.insertAfterNode(l.previousSibling),this.__parts.push(d)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));i++}return Br&&(document.adoptNode(e),customElements.upgrade(e)),e}};n(le,"TemplateInstance")});var xs,Ec,Z,or=x(()=>{Se();ce();xs=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),Ec=` ${j} `,Z=class{constructor(e,r,o,s){this.strings=e,this.values=r,this.type=o,this.processor=s}getHTML(){let e=this.strings.length-1,r="",o=!1;for(let s=0;s<e;s++){let i=this.strings[s],a=i.lastIndexOf("<!--");o=(a>-1||o)&&i.indexOf("-->",a+1)===-1;let c=er.exec(i);c===null?r+=i+(o?Ec:zr):r+=i.substr(0,c.index)+c[1]+c[2]+Le+c[3]+j}return r+=this.strings[e],r}getTemplateElement(){let e=document.createElement("template"),r=this.getHTML();return xs!==void 0&&(r=xs.createHTML(r)),e.innerHTML=r,e}};n(Z,"TemplateResult")});var nr,sr,je,ct,X,lt,ut,ir,Ss,pt,xc,ar=x(()=>{Jr();Se();Qr();rr();or();ce();nr=n(t=>t===null||!(typeof t=="object"||typeof t=="function"),"isPrimitive"),sr=n(t=>Array.isArray(t)||!!(t&&t[Symbol.iterator]),"isIterable"),je=class{constructor(e,r,o){this.dirty=!0,this.element=e,this.name=r,this.strings=o,this.parts=[];for(let s=0;s<o.length-1;s++)this.parts[s]=this._createPart()}_createPart(){return new ct(this)}_getValue(){let e=this.strings,r=e.length-1,o=this.parts;if(r===1&&e[0]===""&&e[1]===""){let i=o[0].value;if(typeof i=="symbol")return String(i);if(typeof i=="string"||!sr(i))return i}let s="";for(let i=0;i<r;i++){s+=e[i];let a=o[i];if(a!==void 0){let c=a.value;if(nr(c)||!sr(c))s+=typeof c=="string"?c:String(c);else for(let l of c)s+=typeof l=="string"?l:String(l)}}return s+=e[r],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}};n(je,"AttributeCommitter");ct=class{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==D&&(!nr(e)||e!==this.value)&&(this.value=e,ve(e)||(this.committer.dirty=!0))}commit(){for(;ve(this.value);){let e=this.value;this.value=D,e(this)}this.value!==D&&this.committer.commit()}};n(ct,"AttributePart");X=class{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(J()),this.endNode=e.appendChild(J())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=J()),e.__insert(this.endNode=J())}insertAfterPart(e){e.__insert(this.startNode=J()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;ve(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=D,r(this)}let e=this.__pendingValue;e!==D&&(nr(e)?e!==this.value&&this.__commitText(e):e instanceof Z?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):sr(e)?this.__commitIterable(e):e===tr?(this.value=tr,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){let r=this.startNode.nextSibling;e=e??"";let o=typeof e=="string"?e:String(e);r===this.endNode.previousSibling&&r.nodeType===3?r.data=o:this.__commitNode(document.createTextNode(o)),this.value=e}__commitTemplateResult(e){let r=this.options.templateFactory(e);if(this.value instanceof le&&this.value.template===r)this.value.update(e.values);else{let o=new le(r,e.processor,this.options),s=o._clone();o.update(e.values),this.__commitNode(s),this.value=o}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());let r=this.value,o=0,s;for(let i of e)s=r[o],s===void 0&&(s=new X(this.options),r.push(s),o===0?s.appendIntoPart(this):s.insertAfterPart(r[o-1])),s.setValue(i),s.commit(),o++;o<r.length&&(r.length=o,this.clear(s&&s.endNode))}clear(e=this.startNode){xe(this.startNode.parentNode,e.nextSibling,this.endNode)}};n(X,"NodePart");lt=class{constructor(e,r,o){if(this.value=void 0,this.__pendingValue=void 0,o.length!==2||o[0]!==""||o[1]!=="")throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=r,this.strings=o}setValue(e){this.__pendingValue=e}commit(){for(;ve(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=D,r(this)}if(this.__pendingValue===D)return;let e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=D}};n(lt,"BooleanAttributePart");ut=class extends je{constructor(e,r,o){super(e,r,o);this.single=o.length===2&&o[0]===""&&o[1]===""}_createPart(){return new ir(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}};n(ut,"PropertyCommitter");ir=class extends ct{};n(ir,"PropertyPart");Ss=!1;(()=>{try{let t={get capture(){return Ss=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{}})();pt=class{constructor(e,r,o){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=r,this.eventContext=o,this.__boundHandleEvent=s=>this.handleEvent(s)}setValue(e){this.__pendingValue=e}commit(){for(;ve(this.__pendingValue);){let i=this.__pendingValue;this.__pendingValue=D,i(this)}if(this.__pendingValue===D)return;let e=this.__pendingValue,r=this.value,o=e==null||r!=null&&(e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive),s=e!=null&&(r==null||o);o&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=xc(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=D}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}};n(pt,"EventPart");xc=n(t=>t&&(Ss?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),"getOptions")});function Kr(t){let e=Oe.get(t.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},Oe.set(t.type,e));let r=e.stringsArray.get(t.strings);if(r!==void 0)return r;let o=t.strings.join(j);return r=e.keyString.get(o),r===void 0&&(r=new Te(t,t.getTemplateElement()),e.keyString.set(o,r)),e.stringsArray.set(t.strings,r),r}var Oe,cr=x(()=>{ce();n(Kr,"templateFactory");Oe=new Map});var ue,Zr,Xr=x(()=>{Se();ar();cr();ue=new WeakMap,Zr=n((t,e,r)=>{let o=ue.get(e);o===void 0&&(xe(e,e.firstChild),ue.set(e,o=new X(Object.assign({templateFactory:Kr},r))),o.appendInto(e)),o.setValue(t),o.commit()},"render")});var lr,eo,to=x(()=>{ar();lr=class{handleAttributeExpressions(e,r,o,s){let i=r[0];return i==="."?new ut(e,r.slice(1),o).parts:i==="@"?[new pt(e,r.slice(1),s.eventContext)]:i==="?"?[new lt(e,r.slice(1),o)]:new je(e,r,o).parts}handleTextExpression(e){return new X(e)}};n(lr,"DefaultTemplateProcessor");eo=new lr});var p,ro=x(()=>{to();or();to();Jr();Se();Qr();ar();Xr();cr();rr();or();ce();typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");p=n((t,...e)=>new Z(t,e,"html",eo),"html")});var vs,ur,Tc,vc,Oc,Os,wc,ws,Cs=x(()=>{Se();Es();Xr();cr();rr();ce();ro();vs=n((t,e)=>`${t}--${e}`,"getTemplateCacheKey"),ur=!0;typeof window.ShadyCSS=="undefined"?ur=!1:typeof window.ShadyCSS.prepareTemplateDom=="undefined"&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),ur=!1);Tc=n(t=>e=>{let r=vs(e.type,t),o=Oe.get(r);o===void 0&&(o={stringsArray:new WeakMap,keyString:new Map},Oe.set(r,o));let s=o.stringsArray.get(e.strings);if(s!==void 0)return s;let i=e.strings.join(j);if(s=o.keyString.get(i),s===void 0){let a=e.getTemplateElement();ur&&window.ShadyCSS.prepareTemplateDom(a,t),s=new Te(e,a),o.keyString.set(i,s)}return o.stringsArray.set(e.strings,s),s},"shadyTemplateFactory"),vc=["html","svg"],Oc=n(t=>{vc.forEach(e=>{let r=Oe.get(vs(e,t));r!==void 0&&r.keyString.forEach(o=>{let{element:{content:s}}=o,i=new Set;Array.from(s.querySelectorAll("style")).forEach(a=>{i.add(a)}),Yr(o,i)})})},"removeStylesFromLitTemplates"),Os=new Set,wc=n((t,e,r)=>{Os.add(t);let o=r?r.element:document.createElement("template"),s=e.querySelectorAll("style"),{length:i}=s;if(i===0){window.ShadyCSS.prepareTemplateStyles(o,t);return}let a=document.createElement("style");for(let d=0;d<i;d++){let h=s[d];h.parentNode.removeChild(h),a.textContent+=h.textContent}Oc(t);let c=o.content;r?_s(r,a,c.firstChild):c.insertBefore(a,c.firstChild),window.ShadyCSS.prepareTemplateStyles(o,t);let l=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&l!==null)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(r){c.insertBefore(a,c.firstChild);let d=new Set;d.add(a),Yr(r,d)}},"prepareTemplateStyles"),ws=n((t,e,r)=>{if(!r||typeof r!="object"||!r.scopeName)throw new Error("The `scopeName` option is required.");let o=r.scopeName,s=ue.has(e),i=ur&&e.nodeType===11&&!!e.host,a=i&&!Os.has(o),c=a?document.createDocumentFragment():e;if(Zr(t,c,Object.assign({templateFactory:Tc(o)},r)),a){let l=ue.get(c);ue.delete(c);let d=l.value instanceof le?l.value.template:void 0;wc(o,c,d),xe(e,e.firstChild),e.appendChild(c),ue.set(e,l)}!s&&i&&window.ShadyCSS.styleElement(e.host)},"render")});var Ps,oo,Rs,no,so,io,ao,co,lo,dt,uo=x(()=>{window.JSCompiler_renameProperty=(t,e)=>t;oo={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return t!==null;case Number:return t===null?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},Rs=n((t,e)=>e!==t&&(e===e||t===t),"notEqual"),no={attribute:!0,type:String,converter:oo,reflect:!1,hasChanged:Rs},so=1,io=1<<2,ao=1<<3,co=1<<4,lo="finalized",dt=class extends HTMLElement{constructor(){super();this.initialize()}static get observedAttributes(){this.finalize();let e=[];return this._classProperties.forEach((r,o)=>{let s=this._attributeNameForProperty(o,r);s!==void 0&&(this._attributeToPropertyMap.set(s,o),e.push(s))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;let e=Object.getPrototypeOf(this)._classProperties;e!==void 0&&e.forEach((r,o)=>this._classProperties.set(o,r))}}static createProperty(e,r=no){if(this._ensureClassProperties(),this._classProperties.set(e,r),r.noAccessor||this.prototype.hasOwnProperty(e))return;let o=typeof e=="symbol"?Symbol():`__${e}`,s=this.getPropertyDescriptor(e,o,r);s!==void 0&&Object.defineProperty(this.prototype,e,s)}static getPropertyDescriptor(e,r,o){return{get(){return this[r]},set(s){let i=this[e];this[r]=s,this.requestUpdateInternal(e,i,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||no}static finalize(){let e=Object.getPrototypeOf(this);if(e.hasOwnProperty(lo)||e.finalize(),this[lo]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){let r=this.properties,o=[...Object.getOwnPropertyNames(r),...typeof Object.getOwnPropertySymbols=="function"?Object.getOwnPropertySymbols(r):[]];for(let s of o)this.createProperty(s,r[s])}}static _attributeNameForProperty(e,r){let o=r.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}static _valueHasChanged(e,r,o=Rs){return o(e,r)}static _propertyValueFromAttribute(e,r){let o=r.type,s=r.converter||oo,i=typeof s=="function"?s:s.fromAttribute;return i?i(e,o):e}static _propertyValueToAttribute(e,r){if(r.reflect===void 0)return;let o=r.type,s=r.converter;return(s&&s.toAttribute||oo.toAttribute)(e,o)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,r)=>{if(this.hasOwnProperty(r)){let o=this[r];delete this[r],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(r,o)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,r)=>this[r]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){this._enableUpdatingResolver!==void 0&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,r,o){r!==o&&this._attributeToProperty(e,o)}_propertyToAttribute(e,r,o=no){let s=this.constructor,i=s._attributeNameForProperty(e,o);if(i!==void 0){let a=s._propertyValueToAttribute(r,o);if(a===void 0)return;this._updateState=this._updateState|ao,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._updateState=this._updateState&~ao}}_attributeToProperty(e,r){if(this._updateState&ao)return;let o=this.constructor,s=o._attributeToPropertyMap.get(e);if(s!==void 0){let i=o.getPropertyOptions(s);this._updateState=this._updateState|co,this[s]=o._propertyValueFromAttribute(r,i),this._updateState=this._updateState&~co}}requestUpdateInternal(e,r,o){let s=!0;if(e!==void 0){let i=this.constructor;o=o||i.getPropertyOptions(e),i._valueHasChanged(this[e],r,o.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,r),o.reflect===!0&&!(this._updateState&co)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,o))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,r){return this.requestUpdateInternal(e,r),this.updateComplete}async _enqueueUpdate(){this._updateState=this._updateState|io;try{await this._updatePromise}catch{}let e=this.performUpdate();return e!=null&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return this._updateState&io}get hasUpdated(){return this._updateState&so}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1,r=this._changedProperties;try{e=this.shouldUpdate(r),e?this.update(r):this._markUpdated()}catch(o){throw e=!1,this._markUpdated(),o}e&&(this._updateState&so||(this._updateState=this._updateState|so,this.firstUpdated(r)),this.updated(r))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~io}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){this._reflectingProperties!==void 0&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((r,o)=>this._propertyToAttribute(o,this[o],r)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}};n(dt,"UpdatingElement");Ps=lo;dt[Ps]=!0});var As,Jp,Ns=x(()=>{As=Element.prototype,Jp=As.msMatchesSelector||As.webkitMatchesSelector});var pr,po,ft,ks,Cc,T,fo=x(()=>{pr=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,po=Symbol(),ft=class{constructor(e,r){if(r!==po)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return this._styleSheet===void 0&&(pr?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}};n(ft,"CSSResult");ks=n(t=>new ft(String(t),po),"unsafeCSS"),Cc=n(t=>{if(t instanceof ft)return t.cssText;if(typeof t=="number")return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but
12
12
  take care to ensure page security.`)},"textFromCSSResult"),T=n((t,...e)=>{let r=e.reduce((o,s,i)=>o+Cc(s)+t[i+1],t[0]);return new ft(r,po)},"css")});var Is,S,v=x(()=>{Cs();uo();uo();Ns();ro();fo();fo();(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");Is={},S=class extends dt{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;let e=this.getStyles();if(Array.isArray(e)){let r=n((i,a)=>i.reduceRight((c,l)=>Array.isArray(l)?r(l,c):(c.add(l),c),a),"addStyles"),o=r(e,new Set),s=[];o.forEach(i=>s.unshift(i)),this._styles=s}else this._styles=e===void 0?[]:[e];this._styles=this._styles.map(r=>{if(r instanceof CSSStyleSheet&&!pr){let o=Array.prototype.slice.call(r.cssRules).reduce((s,i)=>s+i.cssText,"");return ks(o)}return r})}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(){let e=this.constructor._styles;e.length!==0&&(window.ShadyCSS!==void 0&&!window.ShadyCSS.nativeShadow?window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(r=>r.cssText),this.localName):pr?this.renderRoot.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):this._needsShimAdoptedStyleSheets=!0)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&window.ShadyCSS!==void 0&&window.ShadyCSS.styleElement(this)}update(e){let r=this.render();super.update(e),r!==Is&&this.constructor.render(r,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(o=>{let s=document.createElement("style");s.textContent=o.cssText,this.renderRoot.appendChild(s)}))}render(){return Is}};n(S,"LitElement");S.finalized=!0;S.render=ws});var dr=fe((id,qs)=>{var Pc={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"};qs.exports=Pc});var Ds=fe((ad,Us)=>{var we=dr(),Rc=n(t=>{let e="",r=[];for(let o of t){let s=o.charCodeAt(0);switch(s){case we.PAR_OPEN:case we.PAR_CLOSE:case we.OP_NOT:case we.BINARY_AND:case we.BINARY_OR:e&&(r.push({type:we.LITERAL,value:e}),e=""),r.push({type:s,value:o});break;default:e+=o}}return e&&r.push({type:we.LITERAL,value:e}),r},"Tokenizer");Us.exports=Rc});var Ls=fe((cd,Fs)=>{var pe=dr(),Ac=n(t=>{let e=[],r=[];return t.forEach(s=>{switch(s.type){case pe.LITERAL:e.unshift(s);break;case pe.BINARY_AND:case pe.BINARY_OR:case pe.OP_NOT:case pe.PAR_OPEN:r.push(s);break;case pe.PAR_CLOSE:for(;r.length&&r[r.length-1].type!==pe.PAR_OPEN;)e.unshift(r.pop());r.pop(),r.length&&r[r.length-1].type===pe.OP_NOT&&e.unshift(r.pop());break;default:break}}),r.length&&[...r.reverse(),...e]||e},"PolishNotation"),Nc=n(function*(t){for(let e=0;e<t.length-1;e++)yield t[e];return t[t.length-1]},"PolishGenerator");Fs.exports={PolishNotation:Ac,PolishGenerator:Nc}});var Ms=fe((ld,js)=>{var F=dr(),G=class{constructor(e,r,o,s){this.op=e,this.left=r,this.right=o,this.literal=s}isLeaf(){return this.op===F.LEAF}isAtomic(){return this.isLeaf()||this.op===F.OP_NOT&&this.left.isLeaf()}getLiteralValue(){return this.literal}static CreateAnd(e,r){return new G(F.BINARY_AND,e,r)}static CreateNot(e){return new G(F.OP_NOT,e)}static CreateOr(e,r){return new G(F.BINARY_OR,e,r)}static CreateLiteral(e){return new G(F.LEAF,null,null,e)}};n(G,"ExpNode");var Me=n(t=>{let e=t.next().value;switch(e.type){case F.LITERAL:return G.CreateLiteral(e.value);case F.OP_NOT:return G.CreateNot(Me(t));case F.BINARY_AND:{let r=Me(t),o=Me(t);return G.CreateAnd(r,o)}case F.BINARY_OR:{let r=Me(t),o=Me(t);return G.CreateOr(r,o)}}return null},"make"),$e=n((t,e)=>{if(t.isLeaf())return e(t.getLiteralValue());if(t.op===F.OP_NOT)return!$e(t.left,e);if(t.op===F.BINARY_OR)return $e(t.left,e)||$e(t.right,e);if(t.op===F.BINARY_AND)return $e(t.left,e)&&$e(t.right,e)},"nodeEvaluator");js.exports={make:Me,nodeEvaluator:$e}});var Gs=fe((ud,Hs)=>{var kc=Ds(),$s=Ls(),Vs=Ms(),Ic=n((t,e)=>{let r=kc(t),o=$s.PolishNotation(r),s=$s.PolishGenerator(o),i=Vs.make(s);return Vs.nodeEvaluator(i,e)},"parse");Hs.exports={parse:Ic}});var xi={};xr(xi,{TestWizard:()=>_r,default:()=>rl});var _r,rl,Si=x(()=>{v();N();_r=class extends S{static get styles(){return T`
13
13
  :host {
14
14
  position: fixed;