@namiml/web-sdk 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.1 (August 12, 2024)
4
+
5
+ ### Bug Fixes
6
+ - `SHOW_PAYWALL` event action is being triggered as `UNKNOWN`
7
+
3
8
  ## 1.3.0 (August 12, 2024)
4
9
 
5
10
  ### New Features
@@ -13,11 +18,11 @@
13
18
  - **New components** - Video and collapsable components.
14
19
  - **Improved timeout and error handling**
15
20
 
16
- ## Bug Fixes
21
+ ### Bug Fixes
17
22
  - Provide consistent typing with other Nami SDKs.
18
23
  - Updated the JavaScript version to ECMAScript2021 for better backward compatability.
19
24
 
20
- ## Breaking changes
25
+ ### Breaking changes
21
26
  - `NamiConfiguration`'s `appPlatformId` is now `appPlatformID` for consistentcy with other Nami SDKs
22
27
  - `NamiPaywallManager.buySkuComplete` has a much simpler (but modified) interface.
23
28
 
package/dist/nami-web.cjs CHANGED
@@ -15,7 +15,7 @@
15
15
  :host p, :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
16
16
  overflow-wrap: break-word;
17
17
  }
18
- `;class Mi{constructor(e){this.host=e,this.state=mi.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),mi.subscribe(this.handleStateChange)}handleStateChange(){this.state=mi.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){mi.unsubscribe(this.handleStateChange)}}const Ti=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Ri=globalThis,Di=Ri.ShadowRoot&&(void 0===Ri.ShadyCSS||Ri.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fi=Symbol(),zi=new WeakMap;let Ui=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Fi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Di&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=zi.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&zi.set(t,e))}return e}toString(){return this.cssText}};const Bi=(e,t)=>{if(Di)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=Ri.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},ji=Di?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new Ui("string"==typeof e?e:e+"",void 0,Fi))(t)})(e):e,{is:Hi,defineProperty:Xi,getOwnPropertyDescriptor:Vi,getOwnPropertyNames:Gi,getOwnPropertySymbols:Wi,getPrototypeOf:Yi}=Object,qi=globalThis,Ki=qi.trustedTypes,Qi=Ki?Ki.emptyScript:"",Zi=qi.reactiveElementPolyfillSupport,Ji=(e,t)=>e,eo={toAttribute(e,t){switch(t){case Boolean:e=e?Qi:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},to=(e,t)=>!Hi(e,t),no={attribute:!0,type:String,converter:eo,reflect:!1,hasChanged:to};Symbol.metadata??=Symbol("metadata"),qi.litPropertyMetadata??=new WeakMap;class ro extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=no){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&Xi(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:s}=Vi(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const i=r?.call(this);s.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??no}static _$Ei(){if(this.hasOwnProperty(Ji("elementProperties")))return;const e=Yi(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ji("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ji("properties"))){const e=this.properties,t=[...Gi(e),...Wi(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(ji(e))}else void 0!==e&&t.push(ji(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Bi(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const s=(void 0!==n.converter?.toAttribute?n.converter:eo).toAttribute(t,n.type);this._$Em=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:eo;this._$Em=r,this[r]=s.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??to)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}ro.elementStyles=[],ro.shadowRootOptions={mode:"open"},ro[Ji("elementProperties")]=new Map,ro[Ji("finalized")]=new Map,Zi?.({ReactiveElement:ro}),(qi.reactiveElementVersions??=[]).push("2.0.4");const so={attribute:!0,type:String,converter:eo,reflect:!1,hasChanged:to},io=(e=so,t,n)=>{const{kind:r,metadata:s}=n;let i=globalThis.litPropertyMetadata.get(s);if(void 0===i&&globalThis.litPropertyMetadata.set(s,i=new Map),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const s=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,s,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const s=this[r];t.call(this,n),this.requestUpdate(r,s,e)}}throw Error("Unsupported decorator location: "+r)};function oo(e){return(t,n)=>"object"==typeof n?io(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class ao extends e.LitElement{constructor(){super(),this.contextConsumer=new Mi(this)}styles(){return e.css``}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return e.adoptStyles(t,[Li,this.styles()]),t}willUpdate(t){super.willUpdate(t),this.shadowRoot&&e.adoptStyles(this.shadowRoot,[Li,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}o([oo({type:Object})],ao.prototype,"contextConsumer",void 0);const co=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};var lo;exports.NamiPaywallAction=void 0,(lo=exports.NamiPaywallAction||(exports.NamiPaywallAction={})).BUY_SKU="BUY_SKU",lo.SELECT_SKU="SELECT_SKU",lo.RESTORE_PURCHASES="RESTORE_PURCHASES",lo.SIGN_IN="SIGN_IN",lo.CLOSE_PAYWALL="CLOSE_PAYWALL",lo.SHOW_PAYWALL="SHOW_PAYWALL",lo.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",lo.PURCHASE_SUCCESS="PURCHASE_SUCCESS",lo.PURCHASE_FAILED="PURCHASE_FAILED",lo.PURCHASE_CANCELLED="PURCHASE_CANCELLED",lo.PURCHASE_PENDING="PURCHASE_PENDING",lo.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",lo.PURCHASE_DEFERRED="PURCHASE_DEFERRED",lo.DEEPLINK="DEEPLINK",lo.TOGGLE_CHANGE="TOGGLE_CHANGE",lo.PAGE_CHANGE="PAGE_CHANGE",lo.SLIDE_CHANGE="SLIDE_CHANGE",lo.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",lo.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",lo.VIDEO_STARTED="VIDEO_STARTED",lo.VIDEO_PAUSED="VIDEO_PAUSED",lo.VIDEO_RESUMED="VIDEO_RESUMED",lo.VIDEO_ENDED="VIDEO_ENDED",lo.VIDEO_CHANGED="VIDEO_CHANGED",lo.VIDEO_MUTED="VIDEO_MUTED",lo.VIDEO_UNMUTED="VIDEO_UNMUTED",lo.UNKNOWN="UNKNOWN";let uo=class extends ao{constructor(e,t,n,r){super(),mi.setPaywall(e,r,n),this.formFactor=mi.getFormFactor(),this.paywall=e,this.paywallEvent=t,n&&(this.campaign=n)}setPaywallData(e,t){e.id===this.paywall?.id&&t.segment===this.campaign?.segment||this.postImpression(e,t),this.paywall=e,this.campaign=t,mi.setPaywall(e,void 0,t),this.requestUpdate()}firstUpdated(){mi.setTimeSpentOnPaywall(Date.now()),pi(this.paywall)||this.postImpression(this.paywall,this.campaign),is.getInstance().emit(ue,{action:exports.NamiPaywallAction.SHOW_PAYWALL,...this.paywallEvent})}postImpression(e,t){(async e=>{if(Sr.getAnonymousMode())return void be.info("Skipping paywall impression - anonymous mode");const t=Sr.getSessionId();t&&(e.session=t),e.app_env="production",be.info("Post paywall impression - segment ",e.segment);try{await Xr.instance.postImpression(e)}catch(e){be.error("Error posting impression",e)}})({segment:t.segment,call_to_action:e?.id})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template?.pages.find((t=>t.name===e))||{}}styles(){return e.css`
18
+ `;class Mi{constructor(e){this.host=e,this.state=mi.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),mi.subscribe(this.handleStateChange)}handleStateChange(){this.state=mi.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){mi.unsubscribe(this.handleStateChange)}}const Ti=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Ri=globalThis,Di=Ri.ShadowRoot&&(void 0===Ri.ShadyCSS||Ri.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fi=Symbol(),zi=new WeakMap;let Ui=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Fi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Di&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=zi.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&zi.set(t,e))}return e}toString(){return this.cssText}};const Bi=(e,t)=>{if(Di)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=Ri.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},ji=Di?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new Ui("string"==typeof e?e:e+"",void 0,Fi))(t)})(e):e,{is:Hi,defineProperty:Xi,getOwnPropertyDescriptor:Vi,getOwnPropertyNames:Gi,getOwnPropertySymbols:Wi,getPrototypeOf:Yi}=Object,qi=globalThis,Ki=qi.trustedTypes,Qi=Ki?Ki.emptyScript:"",Zi=qi.reactiveElementPolyfillSupport,Ji=(e,t)=>e,eo={toAttribute(e,t){switch(t){case Boolean:e=e?Qi:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},to=(e,t)=>!Hi(e,t),no={attribute:!0,type:String,converter:eo,reflect:!1,hasChanged:to};Symbol.metadata??=Symbol("metadata"),qi.litPropertyMetadata??=new WeakMap;class ro extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=no){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&Xi(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:s}=Vi(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const i=r?.call(this);s.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??no}static _$Ei(){if(this.hasOwnProperty(Ji("elementProperties")))return;const e=Yi(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ji("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ji("properties"))){const e=this.properties,t=[...Gi(e),...Wi(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(ji(e))}else void 0!==e&&t.push(ji(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Bi(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const s=(void 0!==n.converter?.toAttribute?n.converter:eo).toAttribute(t,n.type);this._$Em=e,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:eo;this._$Em=r,this[r]=s.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??to)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}ro.elementStyles=[],ro.shadowRootOptions={mode:"open"},ro[Ji("elementProperties")]=new Map,ro[Ji("finalized")]=new Map,Zi?.({ReactiveElement:ro}),(qi.reactiveElementVersions??=[]).push("2.0.4");const so={attribute:!0,type:String,converter:eo,reflect:!1,hasChanged:to},io=(e=so,t,n)=>{const{kind:r,metadata:s}=n;let i=globalThis.litPropertyMetadata.get(s);if(void 0===i&&globalThis.litPropertyMetadata.set(s,i=new Map),i.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const s=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,s,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const s=this[r];t.call(this,n),this.requestUpdate(r,s,e)}}throw Error("Unsupported decorator location: "+r)};function oo(e){return(t,n)=>"object"==typeof n?io(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class ao extends e.LitElement{constructor(){super(),this.contextConsumer=new Mi(this)}styles(){return e.css``}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return e.adoptStyles(t,[Li,this.styles()]),t}willUpdate(t){super.willUpdate(t),this.shadowRoot&&e.adoptStyles(this.shadowRoot,[Li,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}o([oo({type:Object})],ao.prototype,"contextConsumer",void 0);const co=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};var lo;exports.NamiPaywallAction=void 0,(lo=exports.NamiPaywallAction||(exports.NamiPaywallAction={})).BUY_SKU="BUY_SKU",lo.SELECT_SKU="SELECT_SKU",lo.RESTORE_PURCHASES="RESTORE_PURCHASES",lo.SIGN_IN="SIGN_IN",lo.CLOSE_PAYWALL="CLOSE_PAYWALL",lo.SHOW_PAYWALL="SHOW_PAYWALL",lo.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",lo.PURCHASE_SUCCESS="PURCHASE_SUCCESS",lo.PURCHASE_FAILED="PURCHASE_FAILED",lo.PURCHASE_CANCELLED="PURCHASE_CANCELLED",lo.PURCHASE_PENDING="PURCHASE_PENDING",lo.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",lo.PURCHASE_DEFERRED="PURCHASE_DEFERRED",lo.DEEPLINK="DEEPLINK",lo.TOGGLE_CHANGE="TOGGLE_CHANGE",lo.PAGE_CHANGE="PAGE_CHANGE",lo.SLIDE_CHANGE="SLIDE_CHANGE",lo.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",lo.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",lo.VIDEO_STARTED="VIDEO_STARTED",lo.VIDEO_PAUSED="VIDEO_PAUSED",lo.VIDEO_RESUMED="VIDEO_RESUMED",lo.VIDEO_ENDED="VIDEO_ENDED",lo.VIDEO_CHANGED="VIDEO_CHANGED",lo.VIDEO_MUTED="VIDEO_MUTED",lo.VIDEO_UNMUTED="VIDEO_UNMUTED",lo.UNKNOWN="UNKNOWN";let uo=class extends ao{constructor(e,t,n,r){super(),mi.setPaywall(e,r,n),this.formFactor=mi.getFormFactor(),this.paywall=e,this.paywallEvent=t,n&&(this.campaign=n)}setPaywallData(e,t){e.id===this.paywall?.id&&t.segment===this.campaign?.segment||this.postImpression(e,t),this.paywall=e,this.campaign=t,mi.setPaywall(e,void 0,t),this.requestUpdate()}firstUpdated(){mi.setTimeSpentOnPaywall(Date.now()),pi(this.paywall)||this.postImpression(this.paywall,this.campaign),is.getInstance().emit(ue,{...this.paywallEvent,action:exports.NamiPaywallAction.SHOW_PAYWALL})}postImpression(e,t){(async e=>{if(Sr.getAnonymousMode())return void be.info("Skipping paywall impression - anonymous mode");const t=Sr.getSessionId();t&&(e.session=t),e.app_env="production",be.info("Post paywall impression - segment ",e.segment);try{await Xr.instance.postImpression(e)}catch(e){be.error("Error posting impression",e)}})({segment:t.segment,call_to_action:e?.id})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template?.pages.find((t=>t.name===e))||{}}styles(){return e.css`
19
19
  :host {
20
20
  box-sizing: border-box;
21
21
  width: 100%;
package/dist/nami-web.js CHANGED
@@ -15,7 +15,7 @@ import{css as e,LitElement as t,adoptStyles as n,html as r,unsafeCSS as i,svg as
15
15
  :host p, :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
16
16
  overflow-wrap: break-word;
17
17
  }
18
- `;class zs{constructor(e){this.host=e,this.state=_s.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),_s.subscribe(this.handleStateChange)}handleStateChange(){this.state=_s.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){_s.unsubscribe(this.handleStateChange)}}const Us=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Bs=globalThis,js=Bs.ShadowRoot&&(void 0===Bs.ShadyCSS||Bs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hs=Symbol(),Xs=new WeakMap;let Vs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Hs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(js&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Xs.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Xs.set(t,e))}return e}toString(){return this.cssText}};const Gs=(e,t)=>{if(js)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=Bs.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},Ws=js?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new Vs("string"==typeof e?e:e+"",void 0,Hs))(t)})(e):e,{is:Ys,defineProperty:qs,getOwnPropertyDescriptor:Ks,getOwnPropertyNames:Qs,getOwnPropertySymbols:Zs,getPrototypeOf:Js}=Object,eo=globalThis,to=eo.trustedTypes,no=to?to.emptyScript:"",ro=eo.reactiveElementPolyfillSupport,io=(e,t)=>e,so={toAttribute(e,t){switch(t){case Boolean:e=e?no:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},oo=(e,t)=>!Ys(e,t),ao={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo};Symbol.metadata??=Symbol("metadata"),eo.litPropertyMetadata??=new WeakMap;class co extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ao){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&qs(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:i}=Ks(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const s=r?.call(this);i.call(this,t),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ao}static _$Ei(){if(this.hasOwnProperty(io("elementProperties")))return;const e=Js(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(io("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(io("properties"))){const e=this.properties,t=[...Qs(e),...Zs(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(Ws(e))}else void 0!==e&&t.push(Ws(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gs(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const i=(void 0!==n.converter?.toAttribute?n.converter:so).toAttribute(t,n.type);this._$Em=e,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:so;this._$Em=r,this[r]=i.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??oo)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}co.elementStyles=[],co.shadowRootOptions={mode:"open"},co[io("elementProperties")]=new Map,co[io("finalized")]=new Map,ro?.({ReactiveElement:co}),(eo.reactiveElementVersions??=[]).push("2.0.4");const lo={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo},uo=(e=lo,t,n)=>{const{kind:r,metadata:i}=n;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error("Unsupported decorator location: "+r)};function ho(e){return(t,n)=>"object"==typeof n?uo(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class po extends t{constructor(){super(),this.contextConsumer=new zs(this)}styles(){return e``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n(e,[Fs,this.styles()]),e}willUpdate(e){super.willUpdate(e),this.shadowRoot&&n(this.shadowRoot,[Fs,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}h([ho({type:Object})],po.prototype,"contextConsumer",void 0);const fo=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};var mo;!function(e){e.BUY_SKU="BUY_SKU",e.SELECT_SKU="SELECT_SKU",e.RESTORE_PURCHASES="RESTORE_PURCHASES",e.SIGN_IN="SIGN_IN",e.CLOSE_PAYWALL="CLOSE_PAYWALL",e.SHOW_PAYWALL="SHOW_PAYWALL",e.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",e.PURCHASE_SUCCESS="PURCHASE_SUCCESS",e.PURCHASE_FAILED="PURCHASE_FAILED",e.PURCHASE_CANCELLED="PURCHASE_CANCELLED",e.PURCHASE_PENDING="PURCHASE_PENDING",e.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",e.PURCHASE_DEFERRED="PURCHASE_DEFERRED",e.DEEPLINK="DEEPLINK",e.TOGGLE_CHANGE="TOGGLE_CHANGE",e.PAGE_CHANGE="PAGE_CHANGE",e.SLIDE_CHANGE="SLIDE_CHANGE",e.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",e.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",e.VIDEO_STARTED="VIDEO_STARTED",e.VIDEO_PAUSED="VIDEO_PAUSED",e.VIDEO_RESUMED="VIDEO_RESUMED",e.VIDEO_ENDED="VIDEO_ENDED",e.VIDEO_CHANGED="VIDEO_CHANGED",e.VIDEO_MUTED="VIDEO_MUTED",e.VIDEO_UNMUTED="VIDEO_UNMUTED",e.UNKNOWN="UNKNOWN"}(mo||(mo={}));let go=class extends po{constructor(e,t,n,r){super(),_s.setPaywall(e,r,n),this.formFactor=_s.getFormFactor(),this.paywall=e,this.paywallEvent=t,n&&(this.campaign=n)}setPaywallData(e,t){e.id===this.paywall?.id&&t.segment===this.campaign?.segment||this.postImpression(e,t),this.paywall=e,this.campaign=t,_s.setPaywall(e,void 0,t),this.requestUpdate()}firstUpdated(){_s.setTimeSpentOnPaywall(Date.now()),ys(this.paywall)||this.postImpression(this.paywall,this.campaign),ui.getInstance().emit(me,{action:mo.SHOW_PAYWALL,...this.paywallEvent})}postImpression(e,t){(async e=>{if(xr.getAnonymousMode())return void Ae.info("Skipping paywall impression - anonymous mode");const t=xr.getSessionId();t&&(e.session=t),e.app_env="production",Ae.info("Post paywall impression - segment ",e.segment);try{await qr.instance.postImpression(e)}catch(e){Ae.error("Error posting impression",e)}})({segment:t.segment,call_to_action:e?.id})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template?.pages.find((t=>t.name===e))||{}}styles(){return e`
18
+ `;class zs{constructor(e){this.host=e,this.state=_s.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),_s.subscribe(this.handleStateChange)}handleStateChange(){this.state=_s.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){_s.unsubscribe(this.handleStateChange)}}const Us=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Bs=globalThis,js=Bs.ShadowRoot&&(void 0===Bs.ShadyCSS||Bs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hs=Symbol(),Xs=new WeakMap;let Vs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Hs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(js&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Xs.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Xs.set(t,e))}return e}toString(){return this.cssText}};const Gs=(e,t)=>{if(js)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=Bs.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},Ws=js?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new Vs("string"==typeof e?e:e+"",void 0,Hs))(t)})(e):e,{is:Ys,defineProperty:qs,getOwnPropertyDescriptor:Ks,getOwnPropertyNames:Qs,getOwnPropertySymbols:Zs,getPrototypeOf:Js}=Object,eo=globalThis,to=eo.trustedTypes,no=to?to.emptyScript:"",ro=eo.reactiveElementPolyfillSupport,io=(e,t)=>e,so={toAttribute(e,t){switch(t){case Boolean:e=e?no:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},oo=(e,t)=>!Ys(e,t),ao={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo};Symbol.metadata??=Symbol("metadata"),eo.litPropertyMetadata??=new WeakMap;class co extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ao){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&qs(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:i}=Ks(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const s=r?.call(this);i.call(this,t),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ao}static _$Ei(){if(this.hasOwnProperty(io("elementProperties")))return;const e=Js(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(io("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(io("properties"))){const e=this.properties,t=[...Qs(e),...Zs(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(Ws(e))}else void 0!==e&&t.push(Ws(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gs(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const i=(void 0!==n.converter?.toAttribute?n.converter:so).toAttribute(t,n.type);this._$Em=e,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:so;this._$Em=r,this[r]=i.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??oo)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}co.elementStyles=[],co.shadowRootOptions={mode:"open"},co[io("elementProperties")]=new Map,co[io("finalized")]=new Map,ro?.({ReactiveElement:co}),(eo.reactiveElementVersions??=[]).push("2.0.4");const lo={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo},uo=(e=lo,t,n)=>{const{kind:r,metadata:i}=n;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error("Unsupported decorator location: "+r)};function ho(e){return(t,n)=>"object"==typeof n?uo(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class po extends t{constructor(){super(),this.contextConsumer=new zs(this)}styles(){return e``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n(e,[Fs,this.styles()]),e}willUpdate(e){super.willUpdate(e),this.shadowRoot&&n(this.shadowRoot,[Fs,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}h([ho({type:Object})],po.prototype,"contextConsumer",void 0);const fo=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};var mo;!function(e){e.BUY_SKU="BUY_SKU",e.SELECT_SKU="SELECT_SKU",e.RESTORE_PURCHASES="RESTORE_PURCHASES",e.SIGN_IN="SIGN_IN",e.CLOSE_PAYWALL="CLOSE_PAYWALL",e.SHOW_PAYWALL="SHOW_PAYWALL",e.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",e.PURCHASE_SUCCESS="PURCHASE_SUCCESS",e.PURCHASE_FAILED="PURCHASE_FAILED",e.PURCHASE_CANCELLED="PURCHASE_CANCELLED",e.PURCHASE_PENDING="PURCHASE_PENDING",e.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",e.PURCHASE_DEFERRED="PURCHASE_DEFERRED",e.DEEPLINK="DEEPLINK",e.TOGGLE_CHANGE="TOGGLE_CHANGE",e.PAGE_CHANGE="PAGE_CHANGE",e.SLIDE_CHANGE="SLIDE_CHANGE",e.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",e.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",e.VIDEO_STARTED="VIDEO_STARTED",e.VIDEO_PAUSED="VIDEO_PAUSED",e.VIDEO_RESUMED="VIDEO_RESUMED",e.VIDEO_ENDED="VIDEO_ENDED",e.VIDEO_CHANGED="VIDEO_CHANGED",e.VIDEO_MUTED="VIDEO_MUTED",e.VIDEO_UNMUTED="VIDEO_UNMUTED",e.UNKNOWN="UNKNOWN"}(mo||(mo={}));let go=class extends po{constructor(e,t,n,r){super(),_s.setPaywall(e,r,n),this.formFactor=_s.getFormFactor(),this.paywall=e,this.paywallEvent=t,n&&(this.campaign=n)}setPaywallData(e,t){e.id===this.paywall?.id&&t.segment===this.campaign?.segment||this.postImpression(e,t),this.paywall=e,this.campaign=t,_s.setPaywall(e,void 0,t),this.requestUpdate()}firstUpdated(){_s.setTimeSpentOnPaywall(Date.now()),ys(this.paywall)||this.postImpression(this.paywall,this.campaign),ui.getInstance().emit(me,{...this.paywallEvent,action:mo.SHOW_PAYWALL})}postImpression(e,t){(async e=>{if(xr.getAnonymousMode())return void Ae.info("Skipping paywall impression - anonymous mode");const t=xr.getSessionId();t&&(e.session=t),e.app_env="production",Ae.info("Post paywall impression - segment ",e.segment);try{await qr.instance.postImpression(e)}catch(e){Ae.error("Error posting impression",e)}})({segment:t.segment,call_to_action:e?.id})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template?.pages.find((t=>t.name===e))||{}}styles(){return e`
19
19
  :host {
20
20
  box-sizing: border-box;
21
21
  width: 100%;
package/dist/nami-web.mjs CHANGED
@@ -15,7 +15,7 @@ import{css as e,LitElement as t,adoptStyles as n,html as r,unsafeCSS as i,svg as
15
15
  :host p, :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
16
16
  overflow-wrap: break-word;
17
17
  }
18
- `;class zs{constructor(e){this.host=e,this.state=_s.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),_s.subscribe(this.handleStateChange)}handleStateChange(){this.state=_s.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){_s.unsubscribe(this.handleStateChange)}}const Us=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Bs=globalThis,js=Bs.ShadowRoot&&(void 0===Bs.ShadyCSS||Bs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hs=Symbol(),Xs=new WeakMap;let Vs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Hs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(js&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Xs.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Xs.set(t,e))}return e}toString(){return this.cssText}};const Gs=(e,t)=>{if(js)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=Bs.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},Ws=js?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new Vs("string"==typeof e?e:e+"",void 0,Hs))(t)})(e):e,{is:Ys,defineProperty:qs,getOwnPropertyDescriptor:Ks,getOwnPropertyNames:Qs,getOwnPropertySymbols:Zs,getPrototypeOf:Js}=Object,eo=globalThis,to=eo.trustedTypes,no=to?to.emptyScript:"",ro=eo.reactiveElementPolyfillSupport,io=(e,t)=>e,so={toAttribute(e,t){switch(t){case Boolean:e=e?no:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},oo=(e,t)=>!Ys(e,t),ao={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo};Symbol.metadata??=Symbol("metadata"),eo.litPropertyMetadata??=new WeakMap;class co extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ao){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&qs(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:i}=Ks(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const s=r?.call(this);i.call(this,t),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ao}static _$Ei(){if(this.hasOwnProperty(io("elementProperties")))return;const e=Js(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(io("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(io("properties"))){const e=this.properties,t=[...Qs(e),...Zs(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(Ws(e))}else void 0!==e&&t.push(Ws(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gs(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const i=(void 0!==n.converter?.toAttribute?n.converter:so).toAttribute(t,n.type);this._$Em=e,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:so;this._$Em=r,this[r]=i.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??oo)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}co.elementStyles=[],co.shadowRootOptions={mode:"open"},co[io("elementProperties")]=new Map,co[io("finalized")]=new Map,ro?.({ReactiveElement:co}),(eo.reactiveElementVersions??=[]).push("2.0.4");const lo={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo},uo=(e=lo,t,n)=>{const{kind:r,metadata:i}=n;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error("Unsupported decorator location: "+r)};function ho(e){return(t,n)=>"object"==typeof n?uo(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class po extends t{constructor(){super(),this.contextConsumer=new zs(this)}styles(){return e``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n(e,[Fs,this.styles()]),e}willUpdate(e){super.willUpdate(e),this.shadowRoot&&n(this.shadowRoot,[Fs,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}h([ho({type:Object})],po.prototype,"contextConsumer",void 0);const fo=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};var mo;!function(e){e.BUY_SKU="BUY_SKU",e.SELECT_SKU="SELECT_SKU",e.RESTORE_PURCHASES="RESTORE_PURCHASES",e.SIGN_IN="SIGN_IN",e.CLOSE_PAYWALL="CLOSE_PAYWALL",e.SHOW_PAYWALL="SHOW_PAYWALL",e.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",e.PURCHASE_SUCCESS="PURCHASE_SUCCESS",e.PURCHASE_FAILED="PURCHASE_FAILED",e.PURCHASE_CANCELLED="PURCHASE_CANCELLED",e.PURCHASE_PENDING="PURCHASE_PENDING",e.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",e.PURCHASE_DEFERRED="PURCHASE_DEFERRED",e.DEEPLINK="DEEPLINK",e.TOGGLE_CHANGE="TOGGLE_CHANGE",e.PAGE_CHANGE="PAGE_CHANGE",e.SLIDE_CHANGE="SLIDE_CHANGE",e.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",e.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",e.VIDEO_STARTED="VIDEO_STARTED",e.VIDEO_PAUSED="VIDEO_PAUSED",e.VIDEO_RESUMED="VIDEO_RESUMED",e.VIDEO_ENDED="VIDEO_ENDED",e.VIDEO_CHANGED="VIDEO_CHANGED",e.VIDEO_MUTED="VIDEO_MUTED",e.VIDEO_UNMUTED="VIDEO_UNMUTED",e.UNKNOWN="UNKNOWN"}(mo||(mo={}));let go=class extends po{constructor(e,t,n,r){super(),_s.setPaywall(e,r,n),this.formFactor=_s.getFormFactor(),this.paywall=e,this.paywallEvent=t,n&&(this.campaign=n)}setPaywallData(e,t){e.id===this.paywall?.id&&t.segment===this.campaign?.segment||this.postImpression(e,t),this.paywall=e,this.campaign=t,_s.setPaywall(e,void 0,t),this.requestUpdate()}firstUpdated(){_s.setTimeSpentOnPaywall(Date.now()),ys(this.paywall)||this.postImpression(this.paywall,this.campaign),ui.getInstance().emit(me,{action:mo.SHOW_PAYWALL,...this.paywallEvent})}postImpression(e,t){(async e=>{if(xr.getAnonymousMode())return void Ae.info("Skipping paywall impression - anonymous mode");const t=xr.getSessionId();t&&(e.session=t),e.app_env="production",Ae.info("Post paywall impression - segment ",e.segment);try{await qr.instance.postImpression(e)}catch(e){Ae.error("Error posting impression",e)}})({segment:t.segment,call_to_action:e?.id})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template?.pages.find((t=>t.name===e))||{}}styles(){return e`
18
+ `;class zs{constructor(e){this.host=e,this.state=_s.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),_s.subscribe(this.handleStateChange)}handleStateChange(){this.state=_s.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){_s.unsubscribe(this.handleStateChange)}}const Us=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Bs=globalThis,js=Bs.ShadowRoot&&(void 0===Bs.ShadyCSS||Bs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hs=Symbol(),Xs=new WeakMap;let Vs=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Hs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(js&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=Xs.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Xs.set(t,e))}return e}toString(){return this.cssText}};const Gs=(e,t)=>{if(js)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const n of t){const t=document.createElement("style"),r=Bs.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=n.cssText,e.appendChild(t)}},Ws=js?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new Vs("string"==typeof e?e:e+"",void 0,Hs))(t)})(e):e,{is:Ys,defineProperty:qs,getOwnPropertyDescriptor:Ks,getOwnPropertyNames:Qs,getOwnPropertySymbols:Zs,getPrototypeOf:Js}=Object,eo=globalThis,to=eo.trustedTypes,no=to?to.emptyScript:"",ro=eo.reactiveElementPolyfillSupport,io=(e,t)=>e,so={toAttribute(e,t){switch(t){case Boolean:e=e?no:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},oo=(e,t)=>!Ys(e,t),ao={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo};Symbol.metadata??=Symbol("metadata"),eo.litPropertyMetadata??=new WeakMap;class co extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ao){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&qs(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){const{get:r,set:i}=Ks(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return r?.call(this)},set(t){const s=r?.call(this);i.call(this,t),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ao}static _$Ei(){if(this.hasOwnProperty(io("elementProperties")))return;const e=Js(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(io("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(io("properties"))){const e=this.properties,t=[...Qs(e),...Zs(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(Ws(e))}else void 0!==e&&t.push(Ws(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gs(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){const i=(void 0!==n.converter?.toAttribute?n.converter:so).toAttribute(t,n.type);this._$Em=e,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){const n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){const e=n.getPropertyOptions(r),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:so;this._$Em=r,this[r]=i.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){if(n??=this.constructor.getPropertyOptions(e),!(n.hasChanged??oo)(this[e],t))return;this.P(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e)!0!==n.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],n)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}co.elementStyles=[],co.shadowRootOptions={mode:"open"},co[io("elementProperties")]=new Map,co[io("finalized")]=new Map,ro?.({ReactiveElement:co}),(eo.reactiveElementVersions??=[]).push("2.0.4");const lo={attribute:!0,type:String,converter:so,reflect:!1,hasChanged:oo},uo=(e=lo,t,n)=>{const{kind:r,metadata:i}=n;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error("Unsupported decorator location: "+r)};function ho(e){return(t,n)=>"object"==typeof n?uo(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class po extends t{constructor(){super(),this.contextConsumer=new zs(this)}styles(){return e``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n(e,[Fs,this.styles()]),e}willUpdate(e){super.willUpdate(e),this.shadowRoot&&n(this.shadowRoot,[Fs,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}h([ho({type:Object})],po.prototype,"contextConsumer",void 0);const fo=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};var mo;!function(e){e.BUY_SKU="BUY_SKU",e.SELECT_SKU="SELECT_SKU",e.RESTORE_PURCHASES="RESTORE_PURCHASES",e.SIGN_IN="SIGN_IN",e.CLOSE_PAYWALL="CLOSE_PAYWALL",e.SHOW_PAYWALL="SHOW_PAYWALL",e.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",e.PURCHASE_SUCCESS="PURCHASE_SUCCESS",e.PURCHASE_FAILED="PURCHASE_FAILED",e.PURCHASE_CANCELLED="PURCHASE_CANCELLED",e.PURCHASE_PENDING="PURCHASE_PENDING",e.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",e.PURCHASE_DEFERRED="PURCHASE_DEFERRED",e.DEEPLINK="DEEPLINK",e.TOGGLE_CHANGE="TOGGLE_CHANGE",e.PAGE_CHANGE="PAGE_CHANGE",e.SLIDE_CHANGE="SLIDE_CHANGE",e.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",e.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",e.VIDEO_STARTED="VIDEO_STARTED",e.VIDEO_PAUSED="VIDEO_PAUSED",e.VIDEO_RESUMED="VIDEO_RESUMED",e.VIDEO_ENDED="VIDEO_ENDED",e.VIDEO_CHANGED="VIDEO_CHANGED",e.VIDEO_MUTED="VIDEO_MUTED",e.VIDEO_UNMUTED="VIDEO_UNMUTED",e.UNKNOWN="UNKNOWN"}(mo||(mo={}));let go=class extends po{constructor(e,t,n,r){super(),_s.setPaywall(e,r,n),this.formFactor=_s.getFormFactor(),this.paywall=e,this.paywallEvent=t,n&&(this.campaign=n)}setPaywallData(e,t){e.id===this.paywall?.id&&t.segment===this.campaign?.segment||this.postImpression(e,t),this.paywall=e,this.campaign=t,_s.setPaywall(e,void 0,t),this.requestUpdate()}firstUpdated(){_s.setTimeSpentOnPaywall(Date.now()),ys(this.paywall)||this.postImpression(this.paywall,this.campaign),ui.getInstance().emit(me,{...this.paywallEvent,action:mo.SHOW_PAYWALL})}postImpression(e,t){(async e=>{if(xr.getAnonymousMode())return void Ae.info("Skipping paywall impression - anonymous mode");const t=xr.getSessionId();t&&(e.session=t),e.app_env="production",Ae.info("Post paywall impression - segment ",e.segment);try{await qr.instance.postImpression(e)}catch(e){Ae.error("Error posting impression",e)}})({segment:t.segment,call_to_action:e?.id})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template?.pages.find((t=>t.name===e))||{}}styles(){return e`
19
19
  :host {
20
20
  box-sizing: border-box;
21
21
  width: 100%;
@@ -15,7 +15,7 @@
15
15
  :host p, :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
16
16
  overflow-wrap: break-word;
17
17
  }
18
- `;class Xo{constructor(e){this.host=e,this.state=fs.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),fs.subscribe(this.handleStateChange)}handleStateChange(){this.state=fs.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){fs.unsubscribe(this.handleStateChange)}}const Vo=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Go={attribute:!0,type:String,converter:Js,reflect:!1,hasChanged:eo},Wo=(e=Go,t,n)=>{const{kind:r,metadata:i}=n;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error("Unsupported decorator location: "+r)};function Yo(e){return(t,n)=>"object"==typeof n?Wo(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class qo extends Bo{constructor(){super(),this.contextConsumer=new Xo(this)}styles(){return zs``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Us(e,[jo,this.styles()]),e}willUpdate(e){super.willUpdate(e),this.shadowRoot&&Us(this.shadowRoot,[jo,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}o([Yo({type:Object})],qo.prototype,"contextConsumer",void 0);const Ko=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};var Qo;e.NamiPaywallAction=void 0,(Qo=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",Qo.SELECT_SKU="SELECT_SKU",Qo.RESTORE_PURCHASES="RESTORE_PURCHASES",Qo.SIGN_IN="SIGN_IN",Qo.CLOSE_PAYWALL="CLOSE_PAYWALL",Qo.SHOW_PAYWALL="SHOW_PAYWALL",Qo.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",Qo.PURCHASE_SUCCESS="PURCHASE_SUCCESS",Qo.PURCHASE_FAILED="PURCHASE_FAILED",Qo.PURCHASE_CANCELLED="PURCHASE_CANCELLED",Qo.PURCHASE_PENDING="PURCHASE_PENDING",Qo.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",Qo.PURCHASE_DEFERRED="PURCHASE_DEFERRED",Qo.DEEPLINK="DEEPLINK",Qo.TOGGLE_CHANGE="TOGGLE_CHANGE",Qo.PAGE_CHANGE="PAGE_CHANGE",Qo.SLIDE_CHANGE="SLIDE_CHANGE",Qo.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",Qo.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",Qo.VIDEO_STARTED="VIDEO_STARTED",Qo.VIDEO_PAUSED="VIDEO_PAUSED",Qo.VIDEO_RESUMED="VIDEO_RESUMED",Qo.VIDEO_ENDED="VIDEO_ENDED",Qo.VIDEO_CHANGED="VIDEO_CHANGED",Qo.VIDEO_MUTED="VIDEO_MUTED",Qo.VIDEO_UNMUTED="VIDEO_UNMUTED",Qo.UNKNOWN="UNKNOWN";let Zo=class extends qo{constructor(e,t,n,r){super(),fs.setPaywall(e,r,n),this.formFactor=fs.getFormFactor(),this.paywall=e,this.paywallEvent=t,n&&(this.campaign=n)}setPaywallData(e,t){e.id===this.paywall?.id&&t.segment===this.campaign?.segment||this.postImpression(e,t),this.paywall=e,this.campaign=t,fs.setPaywall(e,void 0,t),this.requestUpdate()}firstUpdated(){fs.setTimeSpentOnPaywall(Date.now()),ds(this.paywall)||this.postImpression(this.paywall,this.campaign),si.getInstance().emit(ue,{action:e.NamiPaywallAction.SHOW_PAYWALL,...this.paywallEvent})}postImpression(e,t){(async e=>{if(Ar.getAnonymousMode())return void _e.info("Skipping paywall impression - anonymous mode");const t=Ar.getSessionId();t&&(e.session=t),e.app_env="production",_e.info("Post paywall impression - segment ",e.segment);try{await Xr.instance.postImpression(e)}catch(e){_e.error("Error posting impression",e)}})({segment:t.segment,call_to_action:e?.id})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template?.pages.find((t=>t.name===e))||{}}styles(){return zs`
18
+ `;class Xo{constructor(e){this.host=e,this.state=fs.state,e.addController(this),this.handleStateChange=this.handleStateChange.bind(this),fs.subscribe(this.handleStateChange)}handleStateChange(){this.state=fs.state,this.host.requestUpdate()}hostConnected(){}hostDisconnected(){fs.unsubscribe(this.handleStateChange)}}const Vo=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)},Go={attribute:!0,type:String,converter:Js,reflect:!1,hasChanged:eo},Wo=(e=Go,t,n)=>{const{kind:r,metadata:i}=n;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(n.name,e),"accessor"===r){const{name:r}=n;return{set(n){const i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return void 0!==t&&this.P(r,void 0,e),t}}}if("setter"===r){const{name:r}=n;return function(n){const i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error("Unsupported decorator location: "+r)};function Yo(e){return(t,n)=>"object"==typeof n?Wo(e,t,n):((e,t,n)=>{const r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?{...e,wrapped:!0}:e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}class qo extends Bo{constructor(){super(),this.contextConsumer=new Xo(this)}styles(){return zs``}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Us(e,[jo,this.styles()]),e}willUpdate(e){super.willUpdate(e),this.shadowRoot&&Us(this.shadowRoot,[jo,this.styles()])}disconnectedCallback(){super.disconnectedCallback(),this.contextConsumer.hostDisconnected()}}o([Yo({type:Object})],qo.prototype,"contextConsumer",void 0);const Ko=async e=>{const t=new Set(Array.from(document.fonts.values()).map((e=>e.family)));return e.forEach((e=>{const n=function(e){return t=`${e.family}-${e.style}`,t.replace(/ /g,"");var t}(e);if(t.has(n))return;const r=new FontFace(n,`url(${e.file})`);document.fonts.add(r)})),document.fonts.ready.then()};var Qo;e.NamiPaywallAction=void 0,(Qo=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",Qo.SELECT_SKU="SELECT_SKU",Qo.RESTORE_PURCHASES="RESTORE_PURCHASES",Qo.SIGN_IN="SIGN_IN",Qo.CLOSE_PAYWALL="CLOSE_PAYWALL",Qo.SHOW_PAYWALL="SHOW_PAYWALL",Qo.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",Qo.PURCHASE_SUCCESS="PURCHASE_SUCCESS",Qo.PURCHASE_FAILED="PURCHASE_FAILED",Qo.PURCHASE_CANCELLED="PURCHASE_CANCELLED",Qo.PURCHASE_PENDING="PURCHASE_PENDING",Qo.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",Qo.PURCHASE_DEFERRED="PURCHASE_DEFERRED",Qo.DEEPLINK="DEEPLINK",Qo.TOGGLE_CHANGE="TOGGLE_CHANGE",Qo.PAGE_CHANGE="PAGE_CHANGE",Qo.SLIDE_CHANGE="SLIDE_CHANGE",Qo.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",Qo.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",Qo.VIDEO_STARTED="VIDEO_STARTED",Qo.VIDEO_PAUSED="VIDEO_PAUSED",Qo.VIDEO_RESUMED="VIDEO_RESUMED",Qo.VIDEO_ENDED="VIDEO_ENDED",Qo.VIDEO_CHANGED="VIDEO_CHANGED",Qo.VIDEO_MUTED="VIDEO_MUTED",Qo.VIDEO_UNMUTED="VIDEO_UNMUTED",Qo.UNKNOWN="UNKNOWN";let Zo=class extends qo{constructor(e,t,n,r){super(),fs.setPaywall(e,r,n),this.formFactor=fs.getFormFactor(),this.paywall=e,this.paywallEvent=t,n&&(this.campaign=n)}setPaywallData(e,t){e.id===this.paywall?.id&&t.segment===this.campaign?.segment||this.postImpression(e,t),this.paywall=e,this.campaign=t,fs.setPaywall(e,void 0,t),this.requestUpdate()}firstUpdated(){fs.setTimeSpentOnPaywall(Date.now()),ds(this.paywall)||this.postImpression(this.paywall,this.campaign),si.getInstance().emit(ue,{...this.paywallEvent,action:e.NamiPaywallAction.SHOW_PAYWALL})}postImpression(e,t){(async e=>{if(Ar.getAnonymousMode())return void _e.info("Skipping paywall impression - anonymous mode");const t=Ar.getSessionId();t&&(e.session=t),e.app_env="production",_e.info("Post paywall impression - segment ",e.segment);try{await Xr.instance.postImpression(e)}catch(e){_e.error("Error posting impression",e)}})({segment:t.segment,call_to_action:e?.id})}getTemplate(){const{currentPage:e,selectedPaywall:t}=this.contextConsumer.state;return t?.template?.pages.find((t=>t.name===e))||{}}styles(){return zs`
19
19
  :host {
20
20
  box-sizing: border-box;
21
21
  width: 100%;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@namiml/web-sdk",
3
3
  "type": "module",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "source": "src/nami-web.ts",
6
6
  "description": "Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing",
7
7
  "scripts": {