@ordergroove/offers 2.27.2 → 2.27.3
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 +8 -0
- package/dist/bundle-report.html +4 -4
- package/dist/offers.js +1 -1
- package/dist/offers.js.map +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.3](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.27.2...@ordergroove/offers@2.27.3) (2022-08-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ordergroove/offers
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [2.27.2](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.27.1...@ordergroove/offers@2.27.2) (2022-08-05)
|
|
7
15
|
|
|
8
16
|
|
package/dist/bundle-report.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
│ └ examples/index.js
|
|
5
5
|
└ examples/index.js ───────────────────────────────────────── 8.4kb ─── 3.3%
|
|
6
6
|
|
|
7
|
-
dist/offers.js ─────────────────────────────────────────────
|
|
7
|
+
dist/offers.js ───────────────────────────────────────────── 121.0kb ─ 100.0%
|
|
8
8
|
├ src/components/Offer.js ─────────────────────────────────── 8.1kb ─── 6.7%
|
|
9
9
|
│ └ src/make-api.js
|
|
10
10
|
│ └ src/index.js
|
|
@@ -152,6 +152,9 @@
|
|
|
152
152
|
│ └ src/index.js
|
|
153
153
|
├ src/core/utils.ts ───────────────────────────────────────── 945b ──── 0.8%
|
|
154
154
|
│ └ src/index.js
|
|
155
|
+
├ ../offers-live-editor/dist/offers-live-editor.js ────────── 923b ──── 0.7%
|
|
156
|
+
│ └ src/make-api.js
|
|
157
|
+
│ └ src/index.js
|
|
155
158
|
├ src/components/Price.js ─────────────────────────────────── 904b ──── 0.7%
|
|
156
159
|
│ └ src/make-api.js
|
|
157
160
|
│ └ src/index.js
|
|
@@ -161,9 +164,6 @@
|
|
|
161
164
|
├ src/components/Text.js ──────────────────────────────────── 862b ──── 0.7%
|
|
162
165
|
│ └ src/make-api.js
|
|
163
166
|
│ └ src/index.js
|
|
164
|
-
├ ../offers-live-editor/dist/offers-live-editor.js ────────── 856b ──── 0.7%
|
|
165
|
-
│ └ src/make-api.js
|
|
166
|
-
│ └ src/index.js
|
|
167
167
|
├ src/core/localStorage.js ────────────────────────────────── 810b ──── 0.7%
|
|
168
168
|
│ └ src/make-api.js
|
|
169
169
|
│ └ src/index.js
|
package/dist/offers.js
CHANGED
|
@@ -107,7 +107,7 @@ var lib=(()=>{var Vi=Object.create;var Be=Object.defineProperty;var $i=Object.ge
|
|
|
107
107
|
`}
|
|
108
108
|
<button ?disabled=${this.disabled} @click="${this.runTests.bind(this)}" class="primary">Run Test</button>
|
|
109
109
|
</div>
|
|
110
|
-
`}};n(Er,"TestWizard");Xc=Er});var au={};xr(au,{addOptinChangedCallback:()=>Ml,addTemplate:()=>Vl,clear:()=>$l,config:()=>Hl,default:()=>iu,disableOptinChangedCallbacks:()=>Gl,getOptins:()=>Bl,getProductsForPurchasePost:()=>zl,initialize:()=>Wl,isReady:()=>jl,offers:()=>E,platform:()=>Ne,previewMode:()=>Yl,register:()=>Jl,resolveSettings:()=>Ql,setAuthUrl:()=>Kl,setEnvironment:()=>Zl,setLocale:()=>Xl,setMerchantId:()=>eu,setPublicPath:()=>tu,setTemplates:()=>ru,setupCart:()=>ou,setupProduct:()=>nu,setupProducts:()=>su,store:()=>Li});function Sr(t){var e,r=t.Symbol;return typeof r=="function"?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}n(Sr,"symbolObservablePonyfill");var Oe;typeof self!="undefined"?Oe=self:typeof window!="undefined"||typeof window!="undefined"?Oe=window:typeof module!="undefined"?Oe=module:Oe=Function("return this")();var Wi=Sr(Oe),Tr=Wi;var vr=n(function(){return Math.random().toString(36).substring(7).split("").join(".")},"randomString"),ze={INIT:"@@redux/INIT"+vr(),REPLACE:"@@redux/REPLACE"+vr(),PROBE_UNKNOWN_ACTION:n(function(){return"@@redux/PROBE_UNKNOWN_ACTION"+vr()},"PROBE_UNKNOWN_ACTION")};function Yi(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}n(Yi,"isPlainObject");function Or(t,e,r){var o;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")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(typeof e=="function"&&typeof r=="undefined"&&(r=e,e=void 0),typeof r!="undefined"){if(typeof r!="function")throw new Error("Expected the enhancer to be a function.");return r(Or)(t,e)}if(typeof t!="function")throw new Error("Expected the reducer to be a function.");var s=t,i=e,c=[],a=c,l=!1;function d(){a===c&&(a=c.slice())}n(d,"ensureCanMutateNextListeners");function h(){if(l)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 i}n(h,"getState");function u(f){if(typeof f!="function")throw new Error("Expected the listener to be a function.");if(l)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 x=!0;return d(),a.push(f),n(function(){if(!!x){if(l)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.");x=!1,d();var y=a.indexOf(f);a.splice(y,1),c=null}},"unsubscribe")}n(u,"subscribe");function m(f){if(!Yi(f))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(typeof f.type=="undefined")throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(l)throw new Error("Reducers may not dispatch actions.");try{l=!0,i=s(i,f)}finally{l=!1}for(var x=c=a,w=0;w<x.length;w++){var y=x[w];y()}return f}n(m,"dispatch");function _(f){if(typeof f!="function")throw new Error("Expected the nextReducer to be a function.");s=f,m({type:ze.REPLACE})}n(_,"replaceReducer");function b(){var f,x=u;return f={subscribe:n(function(y){if(typeof y!="object"||y===null)throw new TypeError("Expected the observer to be an object.");function C(){y.next&&y.next(h())}n(C,"observeState"),C();var L=x(C);return{unsubscribe:L}},"subscribe")},f[Tr]=function(){return this},f}return n(b,"observable"),m({type:ze.INIT}),o={dispatch:m,subscribe:u,getState:h,replaceReducer:_},o[Tr]=b,o}n(Or,"createStore");function Ji(t,e){var r=e&&e.type,o=r&&'action "'+String(r)+'"'||"an action";return"Given "+o+', 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.'}n(Ji,"getUndefinedStateErrorMessage");function Qi(t){Object.keys(t).forEach(function(e){var r=t[e],o=r(void 0,{type:ze.INIT});if(typeof o=="undefined")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(typeof r(void 0,{type:ze.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error('Reducer "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle "+ze.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.")})}n(Qi,"assertReducerShape");function bt(t){for(var e=Object.keys(t),r={},o=0;o<e.length;o++){var s=e[o];typeof t[s]=="function"&&(r[s]=t[s])}var i=Object.keys(r),c,a;try{Qi(r)}catch(l){a=l}return n(function(d,h){if(d===void 0&&(d={}),a)throw a;if(!1)var u;for(var m=!1,_={},b=0;b<i.length;b++){var f=i[b],x=r[f],w=d[f],y=x(w,h);if(typeof y=="undefined"){var C=Ji(f,h);throw new Error(C)}_[f]=y,m=m||y!==w}return m=m||i.length!==Object.keys(d).length,m?_:d},"combination")}n(bt,"combineReducers");function on(t,e){return function(){return e(t.apply(this,arguments))}}n(on,"bindActionCreator");function nn(t,e){if(typeof t=="function")return on(t,e);if(typeof t!="object"||t===null)throw new Error("bindActionCreators expected an object or a function, instead received "+(t===null?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var r={};for(var o in t){var s=t[o];typeof s=="function"&&(r[o]=on(s,e))}return r}n(nn,"bindActionCreators");function Ki(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n(Ki,"_defineProperty");function sn(t,e){var r=Object.keys(t);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(t)),e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r}n(sn,"ownKeys");function Zi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sn(r,!0).forEach(function(o){Ki(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sn(r).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}n(Zi,"_objectSpread2");function wr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(o){return o}:e.length===1?e[0]:e.reduce(function(o,s){return function(){return o(s.apply(void 0,arguments))}})}n(wr,"compose");function an(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(o){return function(){var s=o.apply(void 0,arguments),i=n(function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},"dispatch"),c={getState:s.getState,dispatch:n(function(){return i.apply(void 0,arguments)},"dispatch")},a=e.map(function(l){return l(c)});return i=wr.apply(void 0,a)(s.dispatch),Zi({},s,{dispatch:i})}}}n(an,"applyMiddleware");function cn(t){var e=n(function(o){var s=o.dispatch,i=o.getState;return function(c){return function(a){return typeof a=="function"?a(s,i,t):c(a)}}},"middleware");return e}n(cn,"createThunkMiddleware");var ln=cn();ln.withExtraArgument=cn;var un=ln;var Zn=ee(Et());N();V();var st="OG_STATE",Xn=n(t=>{try{return t===null?void 0:JSON.parse(t)}catch{return}},"safeParseState"),jr=n(()=>window.og&&window.og.previewMode,"isPreviewMode"),es=n(()=>jr()?{}:Xn(localStorage.getItem(st)),"loadState"),ec=n(t=>!t||!t.sessionId?!1:JSON.stringify({sessionId:t.sessionId,optedin:t.optedin,optedout:t.optedout,productOffer:t.productOffer,firstOrderPlaceDate:t.firstOrderPlaceDate,productToSubscribe:t.productToSubscribe}),"serializeState"),ts=n(t=>{if(jr())return;let e=ec(t);e&&localStorage.getItem(st)!==e&&localStorage.setItem(st,e)},"saveState"),rs=n(t=>(0,Zn.throttle)(500,e=>{if(jr())return;let{key:r,newValue:o}=e;r===st&&o===null?(t.dispatch({type:te}),setTimeout(()=>t.dispatch(Yt()),0)):r===st&&t.dispatch({type:fe,newValue:Xn(o)})}),"listenLocalStorageChanges");var ns=ee(Et());V();function tc(t,e){return t===e}n(tc,"defaultEqualityCheck");function rc(t,e,r){if(e===null||r===null||e.length!==r.length)return!1;for(var o=e.length,s=0;s<o;s++)if(!t(e[s],r[s]))return!1;return!0}n(rc,"areArgumentsShallowlyEqual");function oc(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tc,r=null,o=null;return function(){return rc(e,r,arguments)||(o=t.apply(null,arguments)),r=arguments,o}}n(oc,"defaultMemoize");function nc(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every(function(o){return typeof o=="function"})){var r=e.map(function(o){return typeof o}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, "+("instead received the following types: ["+r+"]"))}return e}n(nc,"getDependencies");function sc(t){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];return function(){for(var s=arguments.length,i=Array(s),c=0;c<s;c++)i[c]=arguments[c];var a=0,l=i.pop(),d=nc(i),h=t.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(r)),u=t(function(){for(var m=[],_=d.length,b=0;b<_;b++)m.push(d[b].apply(null,arguments));return h.apply(null,m)});return u.resultFunc=l,u.dependencies=d,u.recomputations=function(){return a},u.resetRecomputations=function(){return a=0},u}}n(sc,"createSelectorCreator");var qe=sc(oc);var be=ee(Ke());ne();be.default.Cache=Map;function ic(t,e){if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}n(ic,"arraysEqual");var A=n((t,e)=>!!(t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&t.id===e.id&&(!(Array.isArray(t.components)&&Array.isArray(e.components))||ic((t.components||[]).sort(),(e.components||[]).sort()))),"isSameProduct"),Jt=n(t=>t.optedin||[],"optedinSelector"),os=n(t=>t.optedout||[],"optedoutSelector"),Mr=n(t=>t.autoshipByDefault||{},"autoshipSelector"),ac=n(t=>t.defaultFrequencies||{},"defaultFrequenciesSelector"),J=(0,be.default)(t=>qe(Jt,os,Mr,(e,r,o)=>{let s=e.find(i=>A(t,i));return s||(r.find(i=>A(t,i))?!1:t&&o[t.id]?{id:t.id}:!1)}),t=>JSON.stringify(t)),Qt=(0,be.default)(t=>qe(Jt,e=>{let r=e.find(o=>A(t,o));return r||!1}),t=>JSON.stringify(t)),Kt=(0,be.default)(t=>qe(os,e=>e.find(r=>A(t,r))));var B=(0,be.default)(t=>qe(J(t),e=>e&&e.frequency||null)),Zt=(0,be.default)(t=>qe(ac,e=>e[t]&&tt(e[t])||null)),Vr=n(t=>t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),"kebabCase"),Q=n((t,e,r,o)=>({[r]:t.config&&t.config[r]||e&&e.hasAttribute&&e.hasAttribute(Vr(r))&&e[r]||e.offer&&typeof(e.offer[r]!=="undefined")&&e.offer[r]||o}),"configSelector"),De=n(t=>({templates:t.templates||[]}),"templatesSelector");var cc=n((t,e,r=document)=>r.dispatchEvent(new CustomEvent(t,{detail:e})),"dispatchEvent"),ss=n(t=>({payload:{product:{id:e,components:r}={}}={}}={})=>setTimeout(()=>cc("optin-changed",{productId:e,components:r,optedIn:t}),0),"dispatchOptinChangedEvent"),lc=[{expressions:[({type:t}={})=>t===I,({type:t}={})=>t===q],fn:ss(!0)},{expressions:[({type:t}={})=>t===U],fn:ss(!1)}],is=n(t=>e=>r=>{let o=t.getState();lc.forEach(s=>{s.expressions.some(i=>i(r,o))&&s.fn(r)}),e(r)},"dispatchMiddleware"),as=n(t=>e=>r=>{var s;let o;switch(r.type){case P:case U:case I:case q:o=new CustomEvent(`og-${r.type.toLowerCase().replace(/_/g,"-")}`,{bubbles:!0,cancelable:!0,detail:r.payload}),(((s=r.payload)==null?void 0:s.offer)||document).dispatchEvent(o);break;default:}(o==null?void 0:o.defaultPrevented)||e(r)},"offerEvents"),cs=n(t=>e=>r=>{e(r);let o=(0,ns.throttle)(500,()=>{ts({...t.getState()})});r.type!==fe&&o()},"localStorageMiddleware");function ls(t,...e){if(window.og&&window.og.store)return window.og.store;let r=window.og&&window.og.previewMode,o=typeof window=="object"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):wr,s=[un,is,as],i={};if(!r)try{i=es(),s.push(cs)}catch{}let c=o(an(...s,...e)),a=Or(t,i,c);return window.og=window.og||{},window.og.store=a,a}n(ls,"makeStore");var uc=Object.defineProperty,Xt=n((t,e)=>uc(t,"name",{value:e,configurable:!0}),"s"),pc=Xt(t=>e=>t.indexOf(e.origin)>=0,"createIsMessageAllowed"),us=["https://rc3.ordergroove.com","https://rc3.stg.ordergroove.com","http://localhost:3000",window.location.origin],ps=Xt(t=>(e,r)=>{us.forEach(o=>t.postMessage({ogType:e,...r},o))},"createBroadcastMessage");function $r(t){let e=pc(us),r=ps(t.source);if(e(t)&&t.data.ogType==="READY"){let o="//static.ordergroove.com/@ordergroove/offers-live-editor/0.4.2/dist/";o.startsWith("//")&&(o=window.location.protocol+o),o.endsWith("/")||(o+="/"),import(`${o}client.js`).then(({initializeClient:s})=>{s(e,r),window.removeEventListener("message",$r)})}}n($r,"c");Xt($r,"handleReady");function Hr(t=window.opener){t&&t!==window&&(window.addEventListener("message",$r),ps(t)("READY"))}n(Hr,"w");Xt(Hr,"offersLiveEditor");var er=null,dc=n(t=>({dispatch:t}),"defaultMapDispatchToProps"),ds=n(t=>{if(!er)throw new Error("Missing redux store.");return er},"resolveStore"),fc=n((t,e)=>r=>{let{getState:o,dispatch:s}=ds(r),i=t?t(o(),r):{},c=e(s,r);Object.assign(r,i,c)},"createRecalcProps"),g=n((t,e=dc)=>r=>{let s=fc(t,typeof e=="function"?e:i=>nn(e,i));return class extends r{get store(){return er}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=ds(this).subscribe(()=>s(this)),s(this)}attributeChangedCallback(i,c,a){super.attributeChangedCallback&&super.attributeChangedCallback(i,c,a),this._storeUnsubscribe&&c!==a&&s(this)}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}}},"connect"),fs=n(t=>{er=t},"setStore");ne();var Gr=n((t={},e=[])=>(t.optedin||[]).map(r=>{let o={product:r.id,subscription_info:{components:r.components||[]},tracking_override:{offer:((t.productOffer||{})[r.id]||[])[0],...et(r.frequency)}};return t.firstOrderPlaceDate&&t.firstOrderPlaceDate[r.id]&&(o.subscription_info.first_order_place_date=t.firstOrderPlaceDate[r.id]),t.productToSubscribe&&t.productToSubscribe[r.id]&&(o.tracking_override.product=t.productToSubscribe[r.id]),o}).filter(r=>r.tracking_override.offer).filter(r=>e.length?e.includes(r.product):r),"getProductsForPurchasePost");N();O();var Js=ee(Vs());O();var Nc=n(t=>{let e=String(t||"").trim().match(/(\d+)\s*([dwm])/);return e?`${e[1]}_${{d:1,w:2,m:3}[e[2]]}`:t},"sanitizeFrequencyString"),$s=n(t=>t.hasAttribute("product")&&{id:t.getAttribute("product"),...t.hasAttribute("product-components")&&{components:JSON.parse(t.getAttribute("product-components"))}},"buildProduct");var ho=n(t=>{let e=$s(t);if(!e){let r=t.offer;r&&(e=$s(r))}return e},"resolveProduct"),kc=n(t=>{let e=t;for(;e;){if(e.tagName==="OG-OFFER")return e;e=e.nodeType===11?e.host:e.parentNode}},"resolveOffer"),mo=n(t=>class extends t{get offer(){return kc(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()}},"withOfferTemplate"),k=n(t=>class extends mo(t){get product(){return ho(this)}},"withProduct"),hr=n(t=>class extends t{get childOptions(){let e=[],r=null;return this.querySelectorAll("option").forEach(o=>{let s=Nc(o.value),i=o.innerText.trim();e.push({value:s,text:i}),!r&&o.selected&&(r=s)}),{options:e,isSelected:r}}},"withChildOptions");var mr={};xr(mr,{autoshipByDefault:()=>Ic,eligibilityGroups:()=>Bs,eligible:()=>Hs,hasUpcomingOrder:()=>Ws,hasUpsellGroup:()=>zs,inStock:()=>go,optedout:()=>qc,regularEligible:()=>Fc,subscribed:()=>Uc,subscriptionEligible:()=>Gs,upcomingOrderContainsProduct:()=>Dc,upsellEligible:()=>Ys});var go=n((t,e)=>(t.inStock||{})[(e.product||{}).id],"inStock"),Hs=n((t,e)=>(t.autoshipEligible||{})[(e.product||{}).id]||!1,"eligible"),Ic=n((t,e)=>(t.autoshipByDefault||{})[(e.product||{}).id]||!1,"autoshipByDefault"),Gs=n((t,e)=>(t.offerId&&t.offerId!=="0"||!1)&&Hs(t,e)&&go(t,e),"subscriptionEligible"),Bs=n((t,e)=>(t.eligibilityGroups||{})[(e.product||{}).id]||null,"eligibilityGroups"),zs=n((t,e)=>{let r=Bs(t,e);return r===null||!!r.find(o=>o==="upsell"||o==="impulse_upsell")},"hasUpsellGroup"),Uc=n((t,e)=>Qt(e.product)(t),"subscribed"),qc=n((t,e)=>Kt(e.product)(t),"optedout"),Ws=n(t=>!!(t.nextUpcomingOrder&&t.nextUpcomingOrder.public_id),"hasUpcomingOrder"),Dc=n((t,e)=>(t.nextUpcomingOrder&&t.nextUpcomingOrder.products||[]).includes((e.product||{}).id),"upcomingOrderContainsProduct"),Ys=n((t,e)=>!e.offer.isCart&&t.offerId&&t.offerId!=="0"&&t.auth&&go(t,e)&&Ws(t)&&zs(t,e),"upsellEligible"),Fc=n((t,e)=>Gs(t,e)&&!Ys(t,e),"regularEligible");var Lc=n(t=>t.replace(/(\r\n|\n|\r|\s)+/gm,""),"removeWhitespace"),yo=class extends k(T){static get properties(){return{...super.properties,state:{type:Object,attribute:!1},test:{type:String}}}render(){return this.test&&Js.default.parse(Lc(this.test),r=>mr[r]&&mr[r](this.state,this))?p`
|
|
110
|
+
`}};n(Er,"TestWizard");Xc=Er});var au={};xr(au,{addOptinChangedCallback:()=>Ml,addTemplate:()=>Vl,clear:()=>$l,config:()=>Hl,default:()=>iu,disableOptinChangedCallbacks:()=>Gl,getOptins:()=>Bl,getProductsForPurchasePost:()=>zl,initialize:()=>Wl,isReady:()=>jl,offers:()=>E,platform:()=>Ne,previewMode:()=>Yl,register:()=>Jl,resolveSettings:()=>Ql,setAuthUrl:()=>Kl,setEnvironment:()=>Zl,setLocale:()=>Xl,setMerchantId:()=>eu,setPublicPath:()=>tu,setTemplates:()=>ru,setupCart:()=>ou,setupProduct:()=>nu,setupProducts:()=>su,store:()=>Li});function Sr(t){var e,r=t.Symbol;return typeof r=="function"?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}n(Sr,"symbolObservablePonyfill");var Oe;typeof self!="undefined"?Oe=self:typeof window!="undefined"||typeof window!="undefined"?Oe=window:typeof module!="undefined"?Oe=module:Oe=Function("return this")();var Wi=Sr(Oe),Tr=Wi;var vr=n(function(){return Math.random().toString(36).substring(7).split("").join(".")},"randomString"),ze={INIT:"@@redux/INIT"+vr(),REPLACE:"@@redux/REPLACE"+vr(),PROBE_UNKNOWN_ACTION:n(function(){return"@@redux/PROBE_UNKNOWN_ACTION"+vr()},"PROBE_UNKNOWN_ACTION")};function Yi(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}n(Yi,"isPlainObject");function Or(t,e,r){var o;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")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(typeof e=="function"&&typeof r=="undefined"&&(r=e,e=void 0),typeof r!="undefined"){if(typeof r!="function")throw new Error("Expected the enhancer to be a function.");return r(Or)(t,e)}if(typeof t!="function")throw new Error("Expected the reducer to be a function.");var s=t,i=e,c=[],a=c,l=!1;function d(){a===c&&(a=c.slice())}n(d,"ensureCanMutateNextListeners");function h(){if(l)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 i}n(h,"getState");function u(f){if(typeof f!="function")throw new Error("Expected the listener to be a function.");if(l)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 x=!0;return d(),a.push(f),n(function(){if(!!x){if(l)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.");x=!1,d();var y=a.indexOf(f);a.splice(y,1),c=null}},"unsubscribe")}n(u,"subscribe");function m(f){if(!Yi(f))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(typeof f.type=="undefined")throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(l)throw new Error("Reducers may not dispatch actions.");try{l=!0,i=s(i,f)}finally{l=!1}for(var x=c=a,w=0;w<x.length;w++){var y=x[w];y()}return f}n(m,"dispatch");function _(f){if(typeof f!="function")throw new Error("Expected the nextReducer to be a function.");s=f,m({type:ze.REPLACE})}n(_,"replaceReducer");function b(){var f,x=u;return f={subscribe:n(function(y){if(typeof y!="object"||y===null)throw new TypeError("Expected the observer to be an object.");function C(){y.next&&y.next(h())}n(C,"observeState"),C();var L=x(C);return{unsubscribe:L}},"subscribe")},f[Tr]=function(){return this},f}return n(b,"observable"),m({type:ze.INIT}),o={dispatch:m,subscribe:u,getState:h,replaceReducer:_},o[Tr]=b,o}n(Or,"createStore");function Ji(t,e){var r=e&&e.type,o=r&&'action "'+String(r)+'"'||"an action";return"Given "+o+', 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.'}n(Ji,"getUndefinedStateErrorMessage");function Qi(t){Object.keys(t).forEach(function(e){var r=t[e],o=r(void 0,{type:ze.INIT});if(typeof o=="undefined")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(typeof r(void 0,{type:ze.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error('Reducer "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle "+ze.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.")})}n(Qi,"assertReducerShape");function bt(t){for(var e=Object.keys(t),r={},o=0;o<e.length;o++){var s=e[o];typeof t[s]=="function"&&(r[s]=t[s])}var i=Object.keys(r),c,a;try{Qi(r)}catch(l){a=l}return n(function(d,h){if(d===void 0&&(d={}),a)throw a;if(!1)var u;for(var m=!1,_={},b=0;b<i.length;b++){var f=i[b],x=r[f],w=d[f],y=x(w,h);if(typeof y=="undefined"){var C=Ji(f,h);throw new Error(C)}_[f]=y,m=m||y!==w}return m=m||i.length!==Object.keys(d).length,m?_:d},"combination")}n(bt,"combineReducers");function on(t,e){return function(){return e(t.apply(this,arguments))}}n(on,"bindActionCreator");function nn(t,e){if(typeof t=="function")return on(t,e);if(typeof t!="object"||t===null)throw new Error("bindActionCreators expected an object or a function, instead received "+(t===null?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var r={};for(var o in t){var s=t[o];typeof s=="function"&&(r[o]=on(s,e))}return r}n(nn,"bindActionCreators");function Ki(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n(Ki,"_defineProperty");function sn(t,e){var r=Object.keys(t);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(t)),e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r}n(sn,"ownKeys");function Zi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sn(r,!0).forEach(function(o){Ki(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sn(r).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}n(Zi,"_objectSpread2");function wr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(o){return o}:e.length===1?e[0]:e.reduce(function(o,s){return function(){return o(s.apply(void 0,arguments))}})}n(wr,"compose");function an(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(o){return function(){var s=o.apply(void 0,arguments),i=n(function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},"dispatch"),c={getState:s.getState,dispatch:n(function(){return i.apply(void 0,arguments)},"dispatch")},a=e.map(function(l){return l(c)});return i=wr.apply(void 0,a)(s.dispatch),Zi({},s,{dispatch:i})}}}n(an,"applyMiddleware");function cn(t){var e=n(function(o){var s=o.dispatch,i=o.getState;return function(c){return function(a){return typeof a=="function"?a(s,i,t):c(a)}}},"middleware");return e}n(cn,"createThunkMiddleware");var ln=cn();ln.withExtraArgument=cn;var un=ln;var Zn=ee(Et());N();V();var st="OG_STATE",Xn=n(t=>{try{return t===null?void 0:JSON.parse(t)}catch{return}},"safeParseState"),jr=n(()=>window.og&&window.og.previewMode,"isPreviewMode"),es=n(()=>jr()?{}:Xn(localStorage.getItem(st)),"loadState"),ec=n(t=>!t||!t.sessionId?!1:JSON.stringify({sessionId:t.sessionId,optedin:t.optedin,optedout:t.optedout,productOffer:t.productOffer,firstOrderPlaceDate:t.firstOrderPlaceDate,productToSubscribe:t.productToSubscribe}),"serializeState"),ts=n(t=>{if(jr())return;let e=ec(t);e&&localStorage.getItem(st)!==e&&localStorage.setItem(st,e)},"saveState"),rs=n(t=>(0,Zn.throttle)(500,e=>{if(jr())return;let{key:r,newValue:o}=e;r===st&&o===null?(t.dispatch({type:te}),setTimeout(()=>t.dispatch(Yt()),0)):r===st&&t.dispatch({type:fe,newValue:Xn(o)})}),"listenLocalStorageChanges");var ns=ee(Et());V();function tc(t,e){return t===e}n(tc,"defaultEqualityCheck");function rc(t,e,r){if(e===null||r===null||e.length!==r.length)return!1;for(var o=e.length,s=0;s<o;s++)if(!t(e[s],r[s]))return!1;return!0}n(rc,"areArgumentsShallowlyEqual");function oc(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tc,r=null,o=null;return function(){return rc(e,r,arguments)||(o=t.apply(null,arguments)),r=arguments,o}}n(oc,"defaultMemoize");function nc(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every(function(o){return typeof o=="function"})){var r=e.map(function(o){return typeof o}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, "+("instead received the following types: ["+r+"]"))}return e}n(nc,"getDependencies");function sc(t){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];return function(){for(var s=arguments.length,i=Array(s),c=0;c<s;c++)i[c]=arguments[c];var a=0,l=i.pop(),d=nc(i),h=t.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(r)),u=t(function(){for(var m=[],_=d.length,b=0;b<_;b++)m.push(d[b].apply(null,arguments));return h.apply(null,m)});return u.resultFunc=l,u.dependencies=d,u.recomputations=function(){return a},u.resetRecomputations=function(){return a=0},u}}n(sc,"createSelectorCreator");var qe=sc(oc);var be=ee(Ke());ne();be.default.Cache=Map;function ic(t,e){if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}n(ic,"arraysEqual");var A=n((t,e)=>!!(t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&t.id===e.id&&(!(Array.isArray(t.components)&&Array.isArray(e.components))||ic((t.components||[]).sort(),(e.components||[]).sort()))),"isSameProduct"),Jt=n(t=>t.optedin||[],"optedinSelector"),os=n(t=>t.optedout||[],"optedoutSelector"),Mr=n(t=>t.autoshipByDefault||{},"autoshipSelector"),ac=n(t=>t.defaultFrequencies||{},"defaultFrequenciesSelector"),J=(0,be.default)(t=>qe(Jt,os,Mr,(e,r,o)=>{let s=e.find(i=>A(t,i));return s||(r.find(i=>A(t,i))?!1:t&&o[t.id]?{id:t.id}:!1)}),t=>JSON.stringify(t)),Qt=(0,be.default)(t=>qe(Jt,e=>{let r=e.find(o=>A(t,o));return r||!1}),t=>JSON.stringify(t)),Kt=(0,be.default)(t=>qe(os,e=>e.find(r=>A(t,r))));var B=(0,be.default)(t=>qe(J(t),e=>e&&e.frequency||null)),Zt=(0,be.default)(t=>qe(ac,e=>e[t]&&tt(e[t])||null)),Vr=n(t=>t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),"kebabCase"),Q=n((t,e,r,o)=>({[r]:t.config&&t.config[r]||e&&e.hasAttribute&&e.hasAttribute(Vr(r))&&e[r]||e.offer&&typeof(e.offer[r]!=="undefined")&&e.offer[r]||o}),"configSelector"),De=n(t=>({templates:t.templates||[]}),"templatesSelector");var cc=n((t,e,r=document)=>r.dispatchEvent(new CustomEvent(t,{detail:e})),"dispatchEvent"),ss=n(t=>({payload:{product:{id:e,components:r}={}}={}}={})=>setTimeout(()=>cc("optin-changed",{productId:e,components:r,optedIn:t}),0),"dispatchOptinChangedEvent"),lc=[{expressions:[({type:t}={})=>t===I,({type:t}={})=>t===q],fn:ss(!0)},{expressions:[({type:t}={})=>t===U],fn:ss(!1)}],is=n(t=>e=>r=>{let o=t.getState();lc.forEach(s=>{s.expressions.some(i=>i(r,o))&&s.fn(r)}),e(r)},"dispatchMiddleware"),as=n(t=>e=>r=>{var s;let o;switch(r.type){case P:case U:case I:case q:o=new CustomEvent(`og-${r.type.toLowerCase().replace(/_/g,"-")}`,{bubbles:!0,cancelable:!0,detail:r.payload}),(((s=r.payload)==null?void 0:s.offer)||document).dispatchEvent(o);break;default:}(o==null?void 0:o.defaultPrevented)||e(r)},"offerEvents"),cs=n(t=>e=>r=>{e(r);let o=(0,ns.throttle)(500,()=>{ts({...t.getState()})});r.type!==fe&&o()},"localStorageMiddleware");function ls(t,...e){if(window.og&&window.og.store)return window.og.store;let r=window.og&&window.og.previewMode,o=typeof window=="object"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):wr,s=[un,is,as],i={};if(!r)try{i=es(),s.push(cs)}catch{}let c=o(an(...s,...e)),a=Or(t,i,c);return window.og=window.og||{},window.og.store=a,a}n(ls,"makeStore");var uc=Object.defineProperty,Xt=n((t,e)=>uc(t,"name",{value:e,configurable:!0}),"s"),pc=Xt(t=>e=>t.indexOf(e.origin)>=0,"createIsMessageAllowed"),us=["https://rc3.ordergroove.com","https://rc3.stg.ordergroove.com","http://localhost:3000",window.location.origin],ps=Xt(t=>(e,r)=>{us.forEach(o=>t.postMessage({ogType:e,...r},o))},"createBroadcastMessage");function $r(t){let e=pc(us),r=ps(t.source),o=t.data.options||{};if(e(t)&&t.data.ogType==="READY"){let s="//static.ordergroove.com/@ordergroove/offers-live-editor/0.5.0/dist/";s.startsWith("//")&&(s=window.location.protocol+s),s.endsWith("/")||(s+="/"),import(`${s}client.js`).then(({initializeClient:i})=>{i({isMessageAllowed:e,broadcastMessage:r,options:o}),window.removeEventListener("message",$r)})}}n($r,"d");Xt($r,"handleReady");function Hr(t=window.opener){t&&t!==window&&(window.addEventListener("message",$r),ps(t)("READY"))}n(Hr,"g");Xt(Hr,"offersLiveEditor");var er=null,dc=n(t=>({dispatch:t}),"defaultMapDispatchToProps"),ds=n(t=>{if(!er)throw new Error("Missing redux store.");return er},"resolveStore"),fc=n((t,e)=>r=>{let{getState:o,dispatch:s}=ds(r),i=t?t(o(),r):{},c=e(s,r);Object.assign(r,i,c)},"createRecalcProps"),g=n((t,e=dc)=>r=>{let s=fc(t,typeof e=="function"?e:i=>nn(e,i));return class extends r{get store(){return er}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=ds(this).subscribe(()=>s(this)),s(this)}attributeChangedCallback(i,c,a){super.attributeChangedCallback&&super.attributeChangedCallback(i,c,a),this._storeUnsubscribe&&c!==a&&s(this)}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}}},"connect"),fs=n(t=>{er=t},"setStore");ne();var Gr=n((t={},e=[])=>(t.optedin||[]).map(r=>{let o={product:r.id,subscription_info:{components:r.components||[]},tracking_override:{offer:((t.productOffer||{})[r.id]||[])[0],...et(r.frequency)}};return t.firstOrderPlaceDate&&t.firstOrderPlaceDate[r.id]&&(o.subscription_info.first_order_place_date=t.firstOrderPlaceDate[r.id]),t.productToSubscribe&&t.productToSubscribe[r.id]&&(o.tracking_override.product=t.productToSubscribe[r.id]),o}).filter(r=>r.tracking_override.offer).filter(r=>e.length?e.includes(r.product):r),"getProductsForPurchasePost");N();O();var Js=ee(Vs());O();var Nc=n(t=>{let e=String(t||"").trim().match(/(\d+)\s*([dwm])/);return e?`${e[1]}_${{d:1,w:2,m:3}[e[2]]}`:t},"sanitizeFrequencyString"),$s=n(t=>t.hasAttribute("product")&&{id:t.getAttribute("product"),...t.hasAttribute("product-components")&&{components:JSON.parse(t.getAttribute("product-components"))}},"buildProduct");var ho=n(t=>{let e=$s(t);if(!e){let r=t.offer;r&&(e=$s(r))}return e},"resolveProduct"),kc=n(t=>{let e=t;for(;e;){if(e.tagName==="OG-OFFER")return e;e=e.nodeType===11?e.host:e.parentNode}},"resolveOffer"),mo=n(t=>class extends t{get offer(){return kc(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()}},"withOfferTemplate"),k=n(t=>class extends mo(t){get product(){return ho(this)}},"withProduct"),hr=n(t=>class extends t{get childOptions(){let e=[],r=null;return this.querySelectorAll("option").forEach(o=>{let s=Nc(o.value),i=o.innerText.trim();e.push({value:s,text:i}),!r&&o.selected&&(r=s)}),{options:e,isSelected:r}}},"withChildOptions");var mr={};xr(mr,{autoshipByDefault:()=>Ic,eligibilityGroups:()=>Bs,eligible:()=>Hs,hasUpcomingOrder:()=>Ws,hasUpsellGroup:()=>zs,inStock:()=>go,optedout:()=>qc,regularEligible:()=>Fc,subscribed:()=>Uc,subscriptionEligible:()=>Gs,upcomingOrderContainsProduct:()=>Dc,upsellEligible:()=>Ys});var go=n((t,e)=>(t.inStock||{})[(e.product||{}).id],"inStock"),Hs=n((t,e)=>(t.autoshipEligible||{})[(e.product||{}).id]||!1,"eligible"),Ic=n((t,e)=>(t.autoshipByDefault||{})[(e.product||{}).id]||!1,"autoshipByDefault"),Gs=n((t,e)=>(t.offerId&&t.offerId!=="0"||!1)&&Hs(t,e)&&go(t,e),"subscriptionEligible"),Bs=n((t,e)=>(t.eligibilityGroups||{})[(e.product||{}).id]||null,"eligibilityGroups"),zs=n((t,e)=>{let r=Bs(t,e);return r===null||!!r.find(o=>o==="upsell"||o==="impulse_upsell")},"hasUpsellGroup"),Uc=n((t,e)=>Qt(e.product)(t),"subscribed"),qc=n((t,e)=>Kt(e.product)(t),"optedout"),Ws=n(t=>!!(t.nextUpcomingOrder&&t.nextUpcomingOrder.public_id),"hasUpcomingOrder"),Dc=n((t,e)=>(t.nextUpcomingOrder&&t.nextUpcomingOrder.products||[]).includes((e.product||{}).id),"upcomingOrderContainsProduct"),Ys=n((t,e)=>!e.offer.isCart&&t.offerId&&t.offerId!=="0"&&t.auth&&go(t,e)&&Ws(t)&&zs(t,e),"upsellEligible"),Fc=n((t,e)=>Gs(t,e)&&!Ys(t,e),"regularEligible");var Lc=n(t=>t.replace(/(\r\n|\n|\r|\s)+/gm,""),"removeWhitespace"),yo=class extends k(T){static get properties(){return{...super.properties,state:{type:Object,attribute:!1},test:{type:String}}}render(){return this.test&&Js.default.parse(Lc(this.test),r=>mr[r]&&mr[r](this.state,this))?p`
|
|
111
111
|
<slot></slot>
|
|
112
112
|
`:p``}shouldUpdate(e){return e.size&&this.product&&this.product.id in this.state.autoshipEligible&&this.product.id in this.state.inStock}};n(yo,"When");var jc=n(t=>({state:t}),"mapStateToProps"),Qs=g(jc)(yo);O();N();O();ne();var Ks={type:Object,converter:{toAttribute(t){return t==null?t:JSON.stringify(t)},fromAttribute(t){return t&&t.match(/[{[]/)?JSON.parse(t):{id:t}}}},pe={type:String,attribute:"default-frequency",converter:{fromAttribute(t){return t&&Ir(t)?t:null}}},gr={type:Boolean,attribute:!0,reflect:!0},Ve={type:Object,attribute:!1};O();var Mc=n(t=>class extends t{getOption(e,r=e){let o=Vr(e);if(this.hasAttribute(o)){let s=this.getAttribute(o);return s.toString().toLowerCase()==="true"?!0:s.toString().toLowerCase()==="false"?!1:s}if(this.template&&this.template.config&&typeof this.template.config[r]!="undefined")return this.template.config[r];if(this.config&&typeof this.config[r]!="undefined")return this.config[r]}applyTemplate(e){this.template=e;let r=typeof e.markup=="undefined"?this.constructor.initialTemplate:e.markup;r&&this._templateMarkup!==r&&(this._templateMarkup=r,this.innerHTML=r)}refreshTemplate(){if(this._templates&&this._templates.length){let e=this._templates.find(({selector:r})=>{try{return this.matches(r)}catch{return!1}});this.applyTemplate(e||{})}}set templates(e){this._templates=e,this.refreshTemplate()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.constructor.initialTemplate&&!this.innerHTML.trim()&&(this.innerHTML=this.constructor.initialTemplate)}},"withTemplate"),M=Mc(T);var G=class extends k(M){static get properties(){return{subscribed:gr,frequencyMatch:{type:Boolean,reflect:!0,attribute:"frequency-match"}}}static get styles(){return v`
|
|
113
113
|
:host {
|