UNPKG

@namiml/web-sdk

Version:

Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing

1 lines 1.56 MB
import{css as e,html as t,LitElement as n,unsafeCSS as i,svg as a}from"lit";import{repeat as r}from"lit/directives/repeat.js";function o(e,t){this.v=e,this.k=t}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){return new o(e,0)}function d(e,t,n){return t=w(t),M(e,S()?Reflect.construct(t,n||[],w(e).constructor):t.apply(e,n))}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(()=>{if("undefined"==typeof globalThis){var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:Function("return this")();Object.defineProperty(e,"globalThis",{value:e,writable:!0,enumerable:!1,configurable:!0})}})(),"undefined"!=typeof Element&&"function"!=typeof Element.prototype.getAttributeNames&&(Element.prototype.getAttributeNames=function(){for(var e=this.attributes,t=new Array(e.length),n=0;n<e.length;n+=1)t[n]=e[n].name;return t});var m=0;function f(e){return"__private_"+m+++"_"+e}function v(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,I(i.key),i)}}function p(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y.apply(null,arguments)}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=w(e)););return e}(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},b.apply(null,arguments)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}function E(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function M(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function P(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function r(n,i,a,r){var u=i&&i.prototype instanceof s?i:s,l=Object.create(u.prototype);return A(l,"_invoke",function(n,i,a){var r,s,u,l=0,d=a||[],h=!1,c={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return r=t,s=0,u=e,c.n=n,o}};function m(n,i){for(s=n,u=i,t=0;!h&&l&&!a&&t<d.length;t++){var a,r=d[t],m=c.p,f=r[2];n>3?(a=f===i)&&(u=r[(s=r[4])?5:(s=3,3)],r[4]=r[5]=e):r[0]<=m&&((a=n<2&&m<r[1])?(s=0,c.v=i,c.n=r[1]):m<f&&(a=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,c.n=f,s=0))}if(a||n>1)return o;throw h=!0,i}return function(a,d,f){if(l>1)throw TypeError("Generator is already running");for(h&&1===d&&m(d,f),s=d,u=f;(t=s<2?e:u)||!h;){r||(s?s<3?(s>1&&(c.n=-1),m(s,u)):c.n=u:c.v=u);try{if(l=2,r){if(s||(a="next"),t=r[a]){if(!(t=t.call(r,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=r.return)&&t.call(r),s<2&&(u=TypeError("The iterator does not provide a '"+a+"' method"),s=1);r=e}else if((t=(h=c.n<0)?u:n.call(i,c))!==o)break}catch(t){r=e,s=1,u=t}finally{l=1}}return{value:t,done:h}}}(n,a,r),!0),l}var o={};function s(){}function u(){}function l(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(A(t={},i,(function(){return this})),t),h=l.prototype=s.prototype=Object.create(d);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,A(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=l,A(h,"constructor",l),A(l,"constructor",u),u.displayName="GeneratorFunction",A(l,a,"GeneratorFunction"),A(h),A(h,a,"Generator"),A(h,i,(function(){return this})),A(h,"toString",(function(){return"[object Generator]"})),(P=function(){return{w:r,m:c}})()}function T(e,t,n,i,a){var r=function(e,t,n,i,a){return new D(P().w(e,t,n,i),a||Promise)}(e,t,n,i,a);return r.next().then((function(e){return e.done?e.value:r.next()}))}function D(e,t){function n(i,a,r,s){try{var u=e[i](a),l=u.value;return l instanceof o?t.resolve(l.v).then((function(e){n("next",e,r,s)}),(function(e){n("throw",e,r,s)})):t.resolve(l).then((function(e){u.value=e,r(u)}),(function(e){return n("throw",e,r,s)}))}catch(e){s(e)}}var i;this.next||(A(D.prototype),A(D.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),A(this,"_invoke",(function(e,a,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}),!0)}function A(e,t,n,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}A=function(e,t,n,i){function r(t,n){A(e,t,(function(e){return this._invoke(t,n,e)}))}t?a?a(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(r("next",0),r("throw",1),r("return",2))},A(e,t,n,i)}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function C(e,t,n,i){var a=b(w(e.prototype),t,n);return"function"==typeof a?function(e){return a.apply(n,e)}:a}function I(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function _(e){var t="function"==typeof Map?new Map:void 0;return _=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(S())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var a=new(e.bind.apply(e,i));return n&&x(a,n.prototype),a}(e,arguments,w(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),x(n,e)},_(e)}var L,F,R,W,O,N,j,$,z,B,H,U,G=function(){return p((function e(t){h(this,e),this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}),[{key:"shadowRoot",get:function(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function(){return!0}},{key:"setFormValue",value:function(){}},{key:"setValidity",value:function(){}}])}(),V=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},X=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},K=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},Y=function(){return p((function e(){h(this,e),this.__eventListeners=new Map,this.__captureEventListeners=new Map}),[{key:"addEventListener",value:function(e,t,n){var i;if(null!=t){var a=K(n)?this.__captureEventListeners:this.__eventListeners,r=a.get(e);if(void 0===r)r=new Map,a.set(e,r);else if(r.has(t))return;var o="object"==typeof n&&n?n:{};null===(i=o.signal)||void 0===i||i.addEventListener("abort",(()=>this.removeEventListener(e,t,n))),r.set(t,null!=o?o:{})}}},{key:"removeEventListener",value:function(e,t,n){if(null!=t){var i=K(n)?this.__captureEventListeners:this.__eventListeners,a=i.get(e);void 0!==a&&(a.delete(t),a.size||i.delete(e))}}},{key:"dispatchEvent",value:function(e){var t=[this],n=this.__eventTargetParent;if(e.composed)for(;n;)t.push(n),n=n.__eventTargetParent;else for(;n&&n!==this.__host;)t.push(n),n=n.__eventTargetParent;var i=!1,a=!1,r=0,o=null,s=null,u=null,l=e.stopPropagation,d=e.stopImmediatePropagation;Object.defineProperties(e,{target:y({get:()=>null!=o?o:s},J),srcElement:y({get:()=>e.target},J),currentTarget:y({get:()=>u},J),eventPhase:y({get:()=>r},J),composedPath:y({value:()=>t},J),stopPropagation:y({value:()=>{i=!0,l.call(e)}},J),stopImmediatePropagation:y({value:()=>{a=!0,d.call(e)}},J)});var h=(t,n,i)=>{"function"==typeof t?t(e):"function"==typeof(null==t?void 0:t.handleEvent)&&t.handleEvent(e),n.once&&i.delete(t)},c=()=>(u=null,r=0,!e.defaultPrevented),m=t.slice().reverse();o=this.__host&&e.composed?null:this;for(var f,v=e=>{for(s=this;s.__host&&e.includes(s.__host);)s=s.__host},p=g(m);!(f=p()).done;){var b=f.value;o||s&&s!==b.__host||v(m.slice(m.indexOf(b))),u=b,r=b===e.target?2:1;var w=b.__captureEventListeners.get(e.type);if(w)for(var k,S=g(w);!(k=S()).done;){var E=k.value;if(h(E[0],E[1],w),a)return c()}if(i)return c()}var M=e.bubbles?t:[this];s=null;for(var P,T=g(M);!(P=T()).done;){var D=P.value;o||s&&D!==s.__host||v(M.slice(0,M.indexOf(D)+1)),u=D,r=D===e.target?2:3;var A=D.__eventListeners.get(e.type);if(A)for(var x,C=g(A);!(x=C()).done;){var I=x.value;if(h(I[0],I[1],A),a)return c()}if(i)return c()}return c()}}])}(),q=Y,J={__proto__:null,enumerable:!0};Object.freeze(J);var Q=(B=function(){return p((function e(t,n={}){if(h(this,e),L.set(this,!1),F.set(this,!1),R.set(this,!1),W.set(this,!1),O.set(this,Date.now()),N.set(this,!1),j.set(this,void 0),$.set(this,void 0),z.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,0===arguments.length)throw new Error("The type argument must be specified");if("object"!=typeof n||!n)throw new Error('The "options" argument must be an object');var i=n.bubbles,a=n.cancelable,r=n.composed;V(this,L,!!a,"f"),V(this,F,!!i,"f"),V(this,R,!!r,"f"),V(this,j,`${t}`,"f"),V(this,$,null,"f"),V(this,z,!1,"f")}),[{key:"initEvent",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function(){this.stopPropagation()}},{key:"preventDefault",value:function(){V(this,W,!0,"f")}},{key:"target",get:function(){return X(this,$,"f")}},{key:"currentTarget",get:function(){return X(this,$,"f")}},{key:"srcElement",get:function(){return X(this,$,"f")}},{key:"type",get:function(){return X(this,j,"f")}},{key:"cancelable",get:function(){return X(this,L,"f")}},{key:"defaultPrevented",get:function(){return X(this,L,"f")&&X(this,W,"f")}},{key:"timeStamp",get:function(){return X(this,O,"f")}},{key:"composedPath",value:function(){return X(this,z,"f")?[X(this,$,"f")]:[]}},{key:"returnValue",get:function(){return!X(this,L,"f")||!X(this,W,"f")}},{key:"bubbles",get:function(){return X(this,F,"f")}},{key:"composed",get:function(){return X(this,R,"f")}},{key:"eventPhase",get:function(){return X(this,z,"f")?B.AT_TARGET:B.NONE}},{key:"cancelBubble",get:function(){return X(this,N,"f")},set:function(e){e&&V(this,N,!0,"f")}},{key:"stopPropagation",value:function(){V(this,N,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),L=new WeakMap,F=new WeakMap,R=new WeakMap,W=new WeakMap,O=new WeakMap,N=new WeakMap,j=new WeakMap,$=new WeakMap,z=new WeakMap,B.NONE=0,B.CAPTURING_PHASE=1,B.AT_TARGET=2,B.BUBBLING_PHASE=3,B);Object.defineProperties(Q.prototype,{initEvent:J,stopImmediatePropagation:J,preventDefault:J,target:J,currentTarget:J,srcElement:J,type:J,cancelable:J,defaultPrevented:J,timeStamp:J,composedPath:J,returnValue:J,bubbles:J,composed:J,eventPhase:J,cancelBubble:J,stopPropagation:J,isTrusted:J});var Z=(U=function(){function e(t,n={}){var i,a;return h(this,e),a=d(this,e,[t,n]),H.set(a,void 0),V(a,H,null!==(i=null==n?void 0:n.detail)&&void 0!==i?i:null,"f"),a}return k(e,Q),p(e,[{key:"initCustomEvent",value:function(e,t,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function(){return X(this,H,"f")}}])}(),H=new WeakMap,U);Object.defineProperties(Z.prototype,{detail:J});var ee,te,ne,ie=Q,ae=Z;null!==(ee=globalThis.Event)&&void 0!==ee||(globalThis.Event=ie),null!==(te=globalThis.CustomEvent)&&void 0!==te||(globalThis.CustomEvent=ae);var re=new WeakMap,oe=e=>{var t=re.get(e);return void 0===t&&re.set(e,t=new Map),t},se=function(){function e(){var t;return h(this,e),(t=d(this,e,arguments)).__shadowRootMode=null,t.__shadowRoot=null,t.__internals=null,t}return k(e,q),p(e,[{key:"attributes",get:function(){return Array.from(oe(this)).map((([e,t])=>({name:e,value:t})))}},{key:"shadowRoot",get:function(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}},{key:"localName",get:function(){return this.constructor.__localName}},{key:"tagName",get:function(){var e;return null===(e=this.localName)||void 0===e?void 0:e.toUpperCase()}},{key:"setAttribute",value:function(e,t){oe(this).set(e,String(t))}},{key:"removeAttribute",value:function(e){oe(this).delete(e)}},{key:"toggleAttribute",value:function(e,t){return this.hasAttribute(e)?!(void 0===t||!t)||(this.removeAttribute(e),!1):!(void 0!==t&&!t)&&(this.setAttribute(e,""),!0)}},{key:"hasAttribute",value:function(e){return oe(this).has(e)}},{key:"attachShadow",value:function(e){var t={host:this};return this.__shadowRootMode=e.mode,e&&"open"===e.mode&&(this.__shadowRoot=t),t}},{key:"attachInternals",value:function(){if(null!==this.__internals)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var e=new G(this);return this.__internals=e,e}},{key:"getAttribute",value:function(e){var t=oe(this).get(e);return null!=t?t:null}}])}(),ue=function(){function e(){return h(this,e),d(this,e,arguments)}return k(e,se),p(e)}();function le(){var e,t;return{promise:new Promise(((n,i)=>{e=n,t=i})),resolve:e,reject:t}}function de(e,t,n,i){var a,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function he(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function ce(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n}null!==(ne=globalThis.litServerRoot)&&void 0!==ne||(globalThis.litServerRoot=Object.defineProperty(new ue,"localName",{get:()=>"lit-server-root"})),new(function(){return p((function e(){h(this,e),this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}),[{key:"define",value:function(e,t){var n,i;if(this.__definitions.has(e)){if("development"!==process.env.NODE_ENV)throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.`)}if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:null!==(n=t.observedAttributes)&&void 0!==n?n:[]}),this.__reverseDefinitions.set(t,e),null===(i=this.__pendingWhenDefineds.get(e))||void 0===i||i.resolve(t),this.__pendingWhenDefineds.delete(e)}},{key:"get",value:function(e){var t=this.__definitions.get(e);return null==t?void 0:t.ctor}},{key:"getName",value:function(e){var t;return null!==(t=this.__reverseDefinitions.get(e))&&void 0!==t?t:null}},{key:"upgrade",value:function(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}},{key:"whenDefined",value:function(e){var t,n;return T((function(i){for(;;)switch(i.n){case 0:if(!(t=this.__definitions.get(e))){i.n=1;break}return i.a(2,t.ctor);case 1:return(n=this.__pendingWhenDefineds.get(e))||(n=le(),this.__pendingWhenDefineds.set(e,n)),i.a(2,n.promise)}}),null,this,null,Promise)}}])}()),"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ue),"function"==typeof SuppressedError&&SuppressedError;var me;!function(e){e.SDK="sdk",e.ML="ml",e.THIRD_PARTY_ANALYTICS="third_party_analytics",e.THIRD_PARTY_TRANSACTIONS="third_party_transactions",e.PAYWALL_PERSONALIZATION="paywall_personalization",e.ANONYMOUS_MODE_CAPABILITY="anonymous_allowed",e.LANGUAGE_MANAGEMENT="language_management",e.ENTITLEMENT_MANAGEMENT="entitlement_management"}(me||(me={}));var fe,ve={},pe=ve.NAMI_SDK_VERSION,ge=void 0===pe?"3.3.4":pe,ye=ve.PLATFORM_ID_REQUIRED,be=void 0===ye?"Platform ID is required":ye,we=ve.DEVICE_ID_REQUIRED,ke=void 0===we?"Device ID is required":we,Se=ve.EXTERNAL_ID_REQUIRED,Ee=void 0===Se?"External ID is required":Se,Me=ve.SDK_NOT_INITIALIZED,Pe=void 0===Me?"SDK has not been initialized. Make sure to call Nami.configure() first!":Me,Te=ve.CAMPAIGN_NOT_AVAILABLE,De=void 0===Te?"Campaign is not available":Te,Ae=ve.FLOW_SCREENS_NOT_AVAILABLE,xe=void 0===Ae?"Flow screens not available":Ae,Ce=ve.UNABLE_TO_UPDATE_CDP_ID,Ie=void 0===Ce?"Unable to update CDP id in anonymous mode":Ce,_e=ve.ANONYMOUS_MODE_ALREADY_ON,Le=void 0===_e?"Anonymous mode is already turned on.":_e,Fe=ve.ANONYMOUS_MODE_ALREADY_OFF,Re=void 0===Fe?"Anonymous mode is already turned off.":Fe,We=ve.DEVICE_ID_NOT_SET,Oe=void 0===We?"Nami Device ID is not set":We,Ne=ve.AUTH_DEVICE,je=void 0===Ne?"nami_auth_device":Ne,$e=ve.NAMI_CONFIGURATION,ze=void 0===$e?"nami_configuration":$e,Be=ve.NAMI_PROFILE,He=void 0===Be?"nami_profile":Be,Ue=ve.API_CONFIG,Ge=void 0===Ue?"api_config":Ue,Ve=ve.API_CAMPAIGN_RULES,Xe=void 0===Ve?"api_campaign_rules":Ve,Ke=ve.API_PAYWALLS,Ye=void 0===Ke?"api_paywalls":Ke,qe=ve.API_PRODUCTS,Je=void 0===qe?"api_products":qe,Qe=ve.API_ACTIVE_ENTITLEMENTS,Ze=void 0===Qe?"api_active_entitlements":Qe,et=ve.SERVER_NAMI_ENTITLEMENTS,tt=void 0===et?"server_active_entitlements":et,nt=ve.INITIAL_APP_CONFIG,it=void 0===nt?"initial_app_config":nt,at=ve.INITIAL_CAMPAIGN_RULES,rt=void 0===at?"initial_campaign_rules":at,ot=ve.INITIAL_PAYWALLS,st=void 0===ot?"initial_paywalls":ot,ut=ve.INITIAL_PRODUCTS,lt=void 0===ut?"initial_products":ut,dt=ve.LOCAL_NAMI_ENTITLEMENTS,ht=void 0===dt?"local_active_entitlements":dt,ct=ve.CUSTOMER_ATTRIBUTES_KEY_PREFIX,mt=void 0===ct?"nami_cmr_attributes_":ct,ft=ve.NAMI_CUSTOMER_JOURNEY_STATE,vt=void 0===ft?"nami_customer_journey_state":ft,pt=ve.ANONYMOUS_MODE,gt=void 0===pt?"nami_anonymous_mode_v2":pt,yt=ve.ANONYMOUS_UUID,bt=void 0===yt?"nami_anonymous_uuid":yt,wt=ve.KEY_SESSION_COUNTER,kt=void 0===wt?"nami_session_counter":wt,St=ve.INITIAL_SESSION_COUNTER_VALUE,Et=void 0===St?1:St,Mt=ve.NAMI_LAST_IMPRESSION_ID,Pt=void 0===Mt?"nami_last_impression_id":Mt,Tt=ve.NAMI_PURCHASE_IMPRESSION_ID,Dt=void 0===Tt?"nami_purchase_impression_id":Tt,At=ve.NAMI_LAUNCH_ID,xt=void 0===At?"nami_launch_id":At,Ct=ve.NAMI_SESSION_ID,It=void 0===Ct?"nami_session_id":Ct,_t=ve.NAMI_LANGUAGE_CODE,Lt=void 0===_t?"nami_language_code":_t,Ft=ve.NAMI_PURCHASE_CHANNEL,Rt=void 0===Ft?"nami_purchase_channel":Ft,Wt=ve.API_VERSION,Ot=ve.BASE_URL_PATH,Nt=void 0===Ot?`sdk/${void 0===Wt?"v3":Wt}/platform`:Ot,jt=ve.BASE_URL,$t=void 0===jt?"https://app.namiml.com":jt,zt=ve.BASE_STAGING_URL,Bt=void 0===zt?"https://app-staging.namiml.com":zt,Ht=ve.CUSTOM_HOST_PREFIX,Ut=void 0===Ht?"namiAPIHost=":Ht,Gt=ve.USE_STAGING_API,Vt=void 0===Gt?"useStagingAPI":Gt,Xt=ve.EXTENDED_CLIENT_INFO_PREFIX,Kt=void 0===Xt?"extendedClientInfo":Xt,Yt=ve.EXTENDED_CLIENT_INFO_DELIMITER,qt=void 0===Yt?":":Yt,Jt=ve.VALIDATE_PRODUCT_GROUPS,Qt=void 0===Jt?"validateProductGroups":Jt,Zt=ve.API_MAX_CALLS_LIMIT,en=void 0===Zt?2:Zt,tn=ve.API_RETRY_DELAY_SEC,nn=void 0===tn?2:tn,an=ve.API_TIMEOUT_LIMIT,rn=void 0===an?2e4:an,on=ve.DEVICE_API_TIMEOUT_LIMIT,sn=void 0===on?3e3:on,un=ve.STATUS_BAD_REQUEST,ln=void 0===un?400:un,dn=ve.STATUS_NOT_FOUND,hn=void 0===dn?404:dn,cn=ve.STATUS_CONFLICT,mn=void 0===cn?409:cn,fn=ve.STATUS_INTERNAL_SERVER_ERROR,vn=void 0===fn?500:fn,pn=ve.INITIAL_SUCCESS,gn=void 0===pn?"Initial success":pn,yn=ve.RECONFIG_SUCCESS,bn=void 0===yn?"Reconfig success":yn,wn=ve.ALREADY_CONFIGURED,kn=void 0===wn?"Already configured":wn,Sn=ve.AVAILABLE_CAMPAIGNS_CHANGED,En=void 0===Sn?"AvailableCampaignsChanged":Sn,Mn=ve.PAYWALL_ACTION_EVENT,Pn=void 0===Mn?"PaywallActionEvent":Mn,Tn=ve.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,Dn=void 0===Tn?"AvailableActiveEntitlementsChanged":Tn,An=ve.CUSTOMER_JOURNEY_STATE_CHANGED,xn=void 0===An?"CustomerJourneyStateChanged":An,Cn=ve.SKU_TEXT_REGEX,In=void 0===Cn?/\$\{sku\.(\w+)(:\d+)?\}/g:Cn,_n=ve.VAR_REGEX,Ln=void 0===_n?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:_n,Fn=ve.SMART_TEXT_PATTERN,Rn=void 0===Fn?"${":Fn;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR"}(fe||(fe={}));var Wn={debug:fe.DEBUG,info:fe.INFO,warn:fe.WARN,error:fe.ERROR},On=function(){return p((function e(){h(this,e),this.currentLogLevel=fe.DEBUG,this.setLogger=e=>{this.currentLogLevel=e?Wn[e]:fe.WARN}}),[{key:"debug",value:function(e,...t){this.shouldLog(fe.DEBUG)&&console.debug(this.formatMessage(fe.DEBUG,e,...t))}},{key:"info",value:function(e,...t){this.shouldLog(fe.INFO)&&console.info(this.formatMessage(fe.INFO,e,...t))}},{key:"warn",value:function(e,...t){this.shouldLog(fe.WARN)&&console.warn(this.formatMessage(fe.WARN,e,...t))}},{key:"error",value:function(e,...t){this.shouldLog(fe.ERROR)&&console.error(this.formatMessage(fe.ERROR,e,...t))}},{key:"shouldLog",value:function(e){return e>=this.currentLogLevel}},{key:"formatMessage",value:function(e,t,...n){var i=fe[e];return`[${(new Date).toISOString()}] [${i}] ${t} ${n=n.map((e=>"object"==typeof e?JSON.stringify(e):e))}`}}])}(),Nn=new On;function jn(e){for(var t=-1,n=null==e?0:e.length,i=0,a=[];++t<n;){var r=e[t];r&&(a[i++]=r)}return a}function $n(e,t){return e===t||e!=e&&t!=t}function zn(e,t){for(var n=e.length;n--;)if($n(e[n][0],t))return n;return-1}var Bn=Array.prototype.splice;function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0)&&(n==t.length-1?t.pop():Bn.call(t,n,1),--this.size,!0)},Hn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Hn.prototype.has=function(e){return zn(this.__data__,e)>-1},Hn.prototype.set=function(e,t){var n=this.__data__,i=zn(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Un="object"==typeof global&&global&&global.Object===Object&&global,Gn="object"==typeof self&&self&&self.Object===Object&&self,Vn=Un||Gn||Function("return this")(),Xn=Vn.Symbol,Kn=Object.prototype,Yn=Kn.hasOwnProperty,qn=Kn.toString,Jn=Xn?Xn.toStringTag:void 0;var Qn=Object.prototype.toString;var Zn="[object Null]",ei="[object Undefined]",ti=Xn?Xn.toStringTag:void 0;function ni(e){return null==e?void 0===e?ei:Zn:ti&&ti in Object(e)?function(e){var t=Yn.call(e,Jn),n=e[Jn];try{e[Jn]=void 0;var i=!0}catch(e){}var a=qn.call(e);return i&&(t?e[Jn]=n:delete e[Jn]),a}(e):function(e){return Qn.call(e)}(e)}function ii(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var ai="[object AsyncFunction]",ri="[object Function]",oi="[object GeneratorFunction]",si="[object Proxy]";function ui(e){if(!ii(e))return!1;var t=ni(e);return t==ri||t==oi||t==ai||t==si}var li,di=Vn["__core-js_shared__"],hi=(li=/[^.]+$/.exec(di&&di.keys&&di.keys.IE_PROTO||""))?"Symbol(src)_1."+li:"";var ci=Function.prototype.toString;function mi(e){if(null!=e){try{return ci.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var fi=/^\[object .+?Constructor\]$/,vi=Function.prototype,pi=Object.prototype,gi=vi.toString,yi=pi.hasOwnProperty,bi=RegExp("^"+gi.call(yi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wi(e){return!(!ii(e)||(t=e,hi&&hi in t))&&(ui(e)?bi:fi).test(mi(e));var t}function ki(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return wi(n)?n:void 0}var Si=ki(Vn,"Map"),Ei=ki(Object,"create");var Mi=Object.prototype.hasOwnProperty;var Pi=Object.prototype.hasOwnProperty;function Ti(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Di(e,t){var n,i,a=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function Ai(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Ti.prototype.clear=function(){this.__data__=Ei?Ei(null):{},this.size=0},Ti.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ti.prototype.get=function(e){var t=this.__data__;if(Ei){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Mi.call(t,e)?t[e]:void 0},Ti.prototype.has=function(e){var t=this.__data__;return Ei?void 0!==t[e]:Pi.call(t,e)},Ti.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ei&&void 0===t?"__lodash_hash_undefined__":t,this},Ai.prototype.clear=function(){this.size=0,this.__data__={hash:new Ti,map:new(Si||Hn),string:new Ti}},Ai.prototype.delete=function(e){var t=Di(this,e).delete(e);return this.size-=t?1:0,t},Ai.prototype.get=function(e){return Di(this,e).get(e)},Ai.prototype.has=function(e){return Di(this,e).has(e)},Ai.prototype.set=function(e,t){var n=Di(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function xi(e){var t=this.__data__=new Hn(e);this.size=t.size}xi.prototype.clear=function(){this.__data__=new Hn,this.size=0},xi.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},xi.prototype.get=function(e){return this.__data__.get(e)},xi.prototype.has=function(e){return this.__data__.has(e)},xi.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var i=n.__data__;if(!Si||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ai(i)}return n.set(e,t),this.size=n.size,this};function Ci(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ai;++t<n;)this.add(e[t])}function Ii(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function _i(e,t){return e.has(t)}Ci.prototype.add=Ci.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ci.prototype.has=function(e){return this.__data__.has(e)};var Li=1,Fi=2;function Ri(e,t,n,i,a,r){var o=n&Li,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var l=r.get(e),d=r.get(t);if(l&&d)return l==t&&d==e;var h=-1,c=!0,m=n&Fi?new Ci:void 0;for(r.set(e,t),r.set(t,e);++h<s;){var f=e[h],v=t[h];if(i)var p=o?i(v,f,h,t,e,r):i(f,v,h,e,t,r);if(void 0!==p){if(p)continue;c=!1;break}if(m){if(!Ii(t,(function(e,t){if(!_i(m,t)&&(f===e||a(f,e,n,i,r)))return m.push(t)}))){c=!1;break}}else if(f!==v&&!a(f,v,n,i,r)){c=!1;break}}return r.delete(e),r.delete(t),c}var Wi=Vn.Uint8Array;function Oi(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function Ni(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var ji=1,$i=2,zi="[object Boolean]",Bi="[object Date]",Hi="[object Error]",Ui="[object Map]",Gi="[object Number]",Vi="[object RegExp]",Xi="[object Set]",Ki="[object String]",Yi="[object Symbol]",qi="[object ArrayBuffer]",Ji="[object DataView]",Qi=Xn?Xn.prototype:void 0,Zi=Qi?Qi.valueOf:void 0;function ea(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}var ta=Array.isArray;function na(e,t,n){var i=t(e);return ta(e)?i:ea(i,n(e))}function ia(){return[]}var aa=Object.prototype.propertyIsEnumerable,ra=Object.getOwnPropertySymbols,oa=ra?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,i=null==e?0:e.length,a=0,r=[];++n<i;){var o=e[n];t(o,n,e)&&(r[a++]=o)}return r}(ra(e),(function(t){return aa.call(e,t)})))}:ia;function sa(e){return null!=e&&"object"==typeof e}function ua(e){return sa(e)&&"[object Arguments]"==ni(e)}var la=Object.prototype,da=la.hasOwnProperty,ha=la.propertyIsEnumerable,ca=ua(function(){return arguments}())?ua:function(e){return sa(e)&&da.call(e,"callee")&&!ha.call(e,"callee")};var ma="object"==typeof exports&&exports&&!exports.nodeType&&exports,fa=ma&&"object"==typeof module&&module&&!module.nodeType&&module,va=fa&&fa.exports===ma?Vn.Buffer:void 0,pa=(va?va.isBuffer:void 0)||function(){return!1},ga=9007199254740991,ya=/^(?:0|[1-9]\d*)$/;function ba(e,t){var n=typeof e;return!!(t=null==t?ga:t)&&("number"==n||"symbol"!=n&&ya.test(e))&&e>-1&&e%1==0&&e<t}var wa=9007199254740991;function ka(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=wa}var Sa={};function Ea(e){return function(t){return e(t)}}Sa["[object Float32Array]"]=Sa["[object Float64Array]"]=Sa["[object Int8Array]"]=Sa["[object Int16Array]"]=Sa["[object Int32Array]"]=Sa["[object Uint8Array]"]=Sa["[object Uint8ClampedArray]"]=Sa["[object Uint16Array]"]=Sa["[object Uint32Array]"]=!0,Sa["[object Arguments]"]=Sa["[object Array]"]=Sa["[object ArrayBuffer]"]=Sa["[object Boolean]"]=Sa["[object DataView]"]=Sa["[object Date]"]=Sa["[object Error]"]=Sa["[object Function]"]=Sa["[object Map]"]=Sa["[object Number]"]=Sa["[object Object]"]=Sa["[object RegExp]"]=Sa["[object Set]"]=Sa["[object String]"]=Sa["[object WeakMap]"]=!1;var Ma="object"==typeof exports&&exports&&!exports.nodeType&&exports,Pa=Ma&&"object"==typeof module&&module&&!module.nodeType&&module,Ta=Pa&&Pa.exports===Ma&&Un.process,Da=function(){try{var e=Pa&&Pa.require&&Pa.require("util").types;return e||Ta&&Ta.binding&&Ta.binding("util")}catch(e){}}(),Aa=Da&&Da.isTypedArray,xa=Aa?Ea(Aa):function(e){return sa(e)&&ka(e.length)&&!!Sa[ni(e)]},Ca=Object.prototype.hasOwnProperty;function Ia(e,t){var n=ta(e),i=!n&&ca(e),a=!n&&!i&&pa(e),r=!n&&!i&&!a&&xa(e),o=n||i||a||r,s=o?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],u=s.length;for(var l in e)!t&&!Ca.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ba(l,u))||s.push(l);return s}var _a=Object.prototype;function La(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_a)}function Fa(e,t){return function(n){return e(t(n))}}var Ra=Fa(Object.keys,Object),Wa=Object.prototype.hasOwnProperty;function Oa(e){return null!=e&&ka(e.length)&&!ui(e)}function Na(e){return Oa(e)?Ia(e):function(e){if(!La(e))return Ra(e);var t=[];for(var n in Object(e))Wa.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}function ja(e){return na(e,Na,oa)}var $a=1,za=Object.prototype.hasOwnProperty;var Ba=ki(Vn,"DataView"),Ha=ki(Vn,"Promise"),Ua=ki(Vn,"Set"),Ga=ki(Vn,"WeakMap"),Va="[object Map]",Xa="[object Promise]",Ka="[object Set]",Ya="[object WeakMap]",qa="[object DataView]",Ja=mi(Ba),Qa=mi(Si),Za=mi(Ha),er=mi(Ua),tr=mi(Ga),nr=ni;(Ba&&nr(new Ba(new ArrayBuffer(1)))!=qa||Si&&nr(new Si)!=Va||Ha&&nr(Ha.resolve())!=Xa||Ua&&nr(new Ua)!=Ka||Ga&&nr(new Ga)!=Ya)&&(nr=function(e){var t=ni(e),n="[object Object]"==t?e.constructor:void 0,i=n?mi(n):"";if(i)switch(i){case Ja:return qa;case Qa:return Va;case Za:return Xa;case er:return Ka;case tr:return Ya}return t});var ir=1,ar="[object Arguments]",rr="[object Array]",or="[object Object]",sr=Object.prototype.hasOwnProperty;function ur(e,t,n,i,a,r){var o=ta(e),s=ta(t),u=o?rr:nr(e),l=s?rr:nr(t),d=(u=u==ar?or:u)==or,h=(l=l==ar?or:l)==or,c=u==l;if(c&&pa(e)){if(!pa(t))return!1;o=!0,d=!1}if(c&&!d)return r||(r=new xi),o||xa(e)?Ri(e,t,n,i,a,r):function(e,t,n,i,a,r,o){switch(n){case Ji:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case qi:return!(e.byteLength!=t.byteLength||!r(new Wi(e),new Wi(t)));case zi:case Bi:case Gi:return $n(+e,+t);case Hi:return e.name==t.name&&e.message==t.message;case Vi:case Ki:return e==t+"";case Ui:var s=Oi;case Xi:var u=i&ji;if(s||(s=Ni),e.size!=t.size&&!u)return!1;var l=o.get(e);if(l)return l==t;i|=$i,o.set(e,t);var d=Ri(s(e),s(t),i,a,r,o);return o.delete(e),d;case Yi:if(Zi)return Zi.call(e)==Zi.call(t)}return!1}(e,t,u,n,i,a,r);if(!(n&ir)){var m=d&&sr.call(e,"__wrapped__"),f=h&&sr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new xi),a(v,p,n,i,r)}}return!!c&&(r||(r=new xi),function(e,t,n,i,a,r){var o=n&$a,s=ja(e),u=s.length;if(u!=ja(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:za.call(t,d)))return!1}var h=r.get(e),c=r.get(t);if(h&&c)return h==t&&c==e;var m=!0;r.set(e,t),r.set(t,e);for(var f=o;++l<u;){var v=e[d=s[l]],p=t[d];if(i)var g=o?i(p,v,d,t,e,r):i(v,p,d,e,t,r);if(!(void 0===g?v===p||a(v,p,n,i,r):g)){m=!1;break}f||(f="constructor"==d)}if(m&&!f){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(m=!1)}return r.delete(e),r.delete(t),m}(e,t,n,i,a,r))}function lr(e,t,n,i,a){return e===t||(null==e||null==t||!sa(e)&&!sa(t)?e!=e&&t!=t:ur(e,t,n,i,lr,a))}var dr=1,hr=2;function cr(e){return e==e&&!ii(e)}function mr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function fr(e){var t=function(e){for(var t=Na(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,cr(a)]}return t}(e);return 1==t.length&&t[0][2]?mr(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,i){var a=n.length,r=a;if(null==e)return!r;for(e=Object(e);a--;){var o=n[a];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++a<r;){var s=(o=n[a])[0],u=e[s],l=o[1];if(o[2]){if(void 0===u&&!(s in e))return!1}else{var d=new xi;if(!lr(l,u,dr|hr,i,d))return!1}}return!0}(n,0,t)}}var vr="[object Symbol]";function pr(e){return"symbol"==typeof e||sa(e)&&ni(e)==vr}var gr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yr=/^\w*$/;function br(e,t){if(ta(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!pr(e))||(yr.test(e)||!gr.test(e)||null!=t&&e in Object(t))}var wr="Expected a function";function kr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(wr);var n=function(){var i=arguments,a=t?t.apply(this,i):i[0],r=n.cache;if(r.has(a))return r.get(a);var o=e.apply(this,i);return n.cache=r.set(a,o)||r,o};return n.cache=new(kr.Cache||Ai),n}kr.Cache=Ai;var Sr,Er,Mr,Pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tr=/\\(\\)?/g,Dr=(Sr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Pr,(function(e,n,i,a){t.push(i?a.replace(Tr,"$1"):n||e)})),t},Er=kr(Sr,(function(e){return 500===Mr.size&&Mr.clear(),e})),Mr=Er.cache,Er);var Ar=1/0,xr=Xn?Xn.prototype:void 0,Cr=xr?xr.toString:void 0;function Ir(e){if("string"==typeof e)return e;if(ta(e))return function(e,t){for(var n=-1,i=null==e?0:e.length,a=Array(i);++n<i;)a[n]=t(e[n],n,e);return a}(e,Ir)+"";if(pr(e))return Cr?Cr.call(e):"";var t=e+"";return"0"==t&&1/e==-Ar?"-0":t}function _r(e){return null==e?"":Ir(e)}function Lr(e,t){return ta(e)?e:br(e,t)?[e]:Dr(_r(e))}var Fr=1/0;function Rr(e){if("string"==typeof e||pr(e))return e;var t=e+"";return"0"==t&&1/e==-Fr?"-0":t}function Wr(e,t){for(var n=0,i=(t=Lr(t,e)).length;null!=e&&n<i;)e=e[Rr(t[n++])];return n&&n==i?e:void 0}function Or(e,t){return null!=e&&t in Object(e)}function Nr(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=Lr(t,e)).length,r=!1;++i<a;){var o=Rr(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&ka(a)&&ba(o,a)&&(ta(e)||ca(e))}(e,t,Or)}var jr=1,$r=2;function zr(e,t){return br(e)&&cr(t)?mr(Rr(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:Wr(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?Nr(n,e):lr(t,i,jr|$r)}}function Br(e){return e}function Hr(e){return br(e)?(t=Rr(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Wr(t,e)}}(e);var t}function Ur(e){return e!=e}function Gr(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var i=n-1,a=e.length;++i<a;)if(e[i]===t)return i;return-1}(e,t,n):function(e,t,n){for(var i=e.length,a=n+-1;++a<i;)if(t(e[a],a,e))return a;return-1}(e,Ur,n)}(e,t,0)>-1}var Vr=Ua&&1/Ni(new Ua([,-0]))[1]==1/0?function(e){return new Ua(e)}:function(){},Xr=200;function Kr(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Gr,r=e.length,o=!0,s=[],u=s;if(r>=Xr){var l=t?null:Vr(e);if(l)return Ni(l);o=!1,a=_i,u=new Ci}else u=t?[]:s;e:for(;++i<r;){var d=e[i],h=t?t(d):d;if(d=0!==d?d:0,o&&h==h){for(var c=u.length;c--;)if(u[c]===h)continue e;t&&u.push(h),s.push(d)}else a(u,h,n)||(u!==s&&u.push(h),s.push(d))}return s}(e,"function"==typeof(n=t)?n:null==n?Br:"object"==typeof n?ta(n)?zr(n[0],n[1]):fr(n):Hr(n)):[];var n}var Yr=function(){return p((function e(){h(this,e),this.memoryStore={}}),[{key:"setDevice",value:function(e){this.setItem(je,e)}},{key:"getDevice",value:function(){return this.getItem(je)}},{key:"resetDevice",value:function(){this.resetItem(je)}},{key:"getAnonymousMode",value:function(){return this.getItem(gt)||!1}},{key:"setAnonymousMode",value:function(e){this.setItem(gt,e)}},{key:"clearAnonymousMode",value:function(){this.resetItem(gt)}},{key:"setAppConfig",value:function(e,t){this.setItem(e,t)}},{key:"getAppConfig",value:function(e){return this.getItem(e)}},{key:"setLanguageCode",value:function(e){this.setItem(Lt,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(Lt)||"en"}},{key:"setCampaignRules",value:function(e,t){e!==rt?this.setItem(e,t):this.memoryStore[rt]=JSON.stringify(t)}},{key:"getCampaignRules",value:function(e){return e===rt?this.memoryStore[rt]?JSON.parse(this.memoryStore[rt]):null:this.getItem(e)}},{key:"setPaywalls",value:function(e,t){e!==st?this.setItem(e,t):this.memoryStore[st]=JSON.stringify(t)}},{key:"getPaywalls",value:function(e){return e===st?this.memoryStore[st]?JSON.parse(this.memoryStore[st]):null:this.getItem(e)}},{key:"setActiveEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getActiveEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setNamiEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getNamiEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setProducts",value:function(e,t){this.setItem(e,t)}},{key:"getProducts",value:function(e){return this.getItem(e)}},{key:"getCachedProducts",value:function(){var e,t,n=null!==(e=this.getItem(Je))&&void 0!==e?e:[];return Kr(jn([...null!==(t=this.getItem(lt))&&void 0!==t?t:[],...n]),"sku_ref_id")}},{key:"setNamiConfig",value:function(e){this.setItem(ze,e)}},{key:"getNamiConfig",value:function(){return this.getItem(ze)}},{key:"setCustomerAttribute",value:function(e,t){this.setItem(mt+e,t)}},{key:"getCustomerAttribute",value:function(e){return this.getItem(mt+e)}},{key:"getAllCustomerAttributes",value:function(){return Object.entries(localStorage).filter((([e])=>e.includes(mt))).map((([e,t])=>e.replace(mt,"")+":"+t))}},{key:"getAllCustomerAttributesKeys",value:function(){return Object.keys(localStorage).filter((e=>e.includes(mt))).map((e=>e.replace(mt,"")))}},{key:"clearCustomerAttribute",value:function(e){var t=mt+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}},{key:"clearAllCustomerAttributes",value:function(){Object.keys(localStorage).filter((e=>e.includes(mt))).map((e=>this.resetItem(e)))}},{key:"setNamiProfile",value:function(e){this.setItem(He,e)}},{key:"getNamiProfile",value:function(){return this.getItem(He)}},{key:"removeNamiProfile",value:function(){this.resetItem(He)}},{key:"setCustomerJourneyState",value:function(e){this.setItem(vt,e)}},{key:"getCustomerJourneyState",value:function(){return this.getItem(vt)}},{key:"setSessionCounter",value:function(){var e=this.getItem(kt),t=e?parseInt(e):Et||Et;this.setItem(kt,t+1)}},{key:"getSessionCounter",value:function(){var e=this.getItem(kt);return e?parseInt(e):Et}},{key:"setLastImpressionId",value:function(e){this.setItem(Pt,e)}},{key:"getLastImpressionId",value:function(){var e;return null!==(e=this.getItem(Pt))&&void 0!==e?e:""}},{key:"setPurchaseImpression",value:function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(Dt,t)}},{key:"getPurchaseImpression",value:function(){var e;return null!==(e=this.getItem(Dt))&&void 0!==e?e:""}},{key:"setSessionId",value:function(e){e&&this.setItem(It,e)}},{key:"getSessionId",value:function(){var e;return null!==(e=this.getItem(It))&&void 0!==e?e:""}},{key:"clearSessionId",value:function(){this.resetItem(It)}},{key:"setLaunchId",value:function(e){e&&this.setItem(xt,e)}},{key:"getLaunchId",value:function(){var e;return null!==(e=this.getItem(xt))&&void 0!==e?e:""}},{key:"clearLaunchId",value:function(){this.resetItem(xt)}},{key:"setPurchaseChannel",value:function(e){e&&this.setItem(Rt,e)}},{key:"getPurchaseChannel",value:function(){return this.getItem(Rt)}},{key:"getAnonymousUUID",value:function(){return this.getItem(bt)}},{key:"setAnonymousUUID",value:function(e){this.setItem(bt,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(bt)}},{key:"setItem",value:function(e,t){var n;try{n=JSON.stringify(t)}catch(t){return void Nn.error(`Serialization failed for ${e}`,t)}try{localStorage.setItem(e,n)}catch(t){Nn.error("Error setting item in localStorage:",t),this.resetItem(e),this.memoryStore[e]=n}}},{key:"getItem",value:function(e){try{var t=localStorage.getItem(e);if(null!==t)return JSON.parse(t)}catch(t){"undefined"!=typeof window&&Nn.error("Error getting item from localStorage:",e,": ",t)}var n=this.memoryStore[e];return null!=n?JSON.parse(n):null}},{key:"resetItem",value:function(e){try{localStorage.removeItem(e)}catch(t){"undefined"!=typeof window&&Nn.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clear",value:function(){try{localStorage.clear()}catch(e){Nn.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}(),qr=new Yr,Jr=function(){function e(t,n){var i;return h(this,e),(i=d(this,e,[n])).statusCode=t,i.status=t,i.message=`RetryLimitExceededError: ${i.message}`,i}return k(e,_(Error)),p(e)}(),Qr=function(){function e(){return h(this,e),d(this,e,arguments)}return k(e,_(Error)),p(e)}(),Zr=function(){function e(){var t;return h(this,e),(t=d(this,e)).status=409,t.name="ConflictError",t.message="ConflictError: Server responded with conflict",t}return k(e,Qr),p(e)}(),eo=function(){function e(){return h(this,e),d(this,e,[Pe])}return k(e,_(Error)),p(e)}(),to=function(){function e(){return h(this,e),d(this,e,[be])}return k(e,_(Error)),p(e)}(),no=function(){function e(){return h(this,e),d(this,e,[ke])}return k(e,_(Error)),p(e)}(),io=function(){function e(){return h(this,e),d(this,e,[Ee])}return k(e,_(Error)),p(e)}(),ao=function(){function e(){return h(this,e),d(this,e,[De])}return k(e,_(Error)),p(e)}(),ro=function(){function e(){return h(this,e),d(this,e,[xe])}return k(e,_(Error)),p(e)}(),oo=function(){function e(){return h(this,e),d(this,e,[Le])}return k(e,_(Error)),p(e)}(),so=function(){function e(){return h(this,e),d(this,e,[Re])}return k(e,_(Error)),p(e)}(),uo=function(){function e(){return h(this,e),d(this,e,[Re])}return k(e,_(Error)),p(e)}(),lo=function(){function e(){return h(this,e),d(this,e,[Ie])}return k(e,_(Error)),p(e)}(),ho=function(){function e(t){var n;return h(this,e),(n=d(this,e,[t])).message=`BadRequestError: ${n.message}`,n}return k(e,Qr),p(e)}(),co=function(){function e(t){var n;return h(this,e),(n=d(this,e,[t])).message=`NotFoundError: ${n.message}`,n}return k(e,Qr),p(e)}(),mo=function(){function e(t,n){var i;return h(this,e),(i=d(this,e,[n])).statusCode=t,i.message=`ClientError: ${i.message}`,i}return k(e,Qr),p(e)}(),fo=function(){function e(t){var n;return h(this,e),(n=d(this,e,[t])).message=`ServerError: ${n.message}`,n}return k(e,Qr),p(e)}(),vo=(e,t)=>{if(e==ln)throw new ho(t);if(e==hn)throw new co(t);if(e==mn)throw new Zr;if(e>ln&&e<vn)throw new mo(e,t);if(e>=vn)throw new fo(t)};function po(e,t,n=rn,i=en){var a,r,o;return T((function(s){for(;;)switch(s.n){case 0:return a=0,r=()=>{var o,s;return T((function(u){for(;;)switch(u.n){case 0:return u.n=1,l(go(e,t,n));case 1:if((o=u.v).ok){u.n=5;break}if(o.status!=mn){u.n=2;break}throw new Zr;case 2:if(!(++a<=i)){u.n=4;break}return s=1e3*(a+nn),u.n=3,l(new Promise((e=>setTimeout(e,s))));case 3:return u.a(2,r());case 4:throw new Jr(o.status,`Request failed after ${i} retries`);case 5:return u.a(2,o)}}),null,null,null,Promise)},s.n=1,l(r());case 1:return o=s.v,s.a(2,o.json())}}),null,null,null,Promise)}function go(e,t={},n){var i,a,r;return T((function(o){for(;;)switch(o.n){case 0:return i=new AbortController,a=setTimeout((()=>i.abort()),n),t.signal=i.signal,o.n=1,l(fetch(e,t));case 1:return r=o.v,clearTimeout(a),o.a(2,r)}}),null,null,null,Promise)}function yo(e){for(var t=e.length;--t>=0;)e[t]=0}yo(new Array(576)),yo(new Array(60)),yo(new Array(512)),yo(new Array(256)),yo(new Array(29)),yo(new Array(30));var bo=(e,t,n,i)=>{for(var a=65535&e,r=e>>>16&65535,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{r=r+(a=a+t[i++]|0)|0}while(--o);a%=65521,r%=65521}return a|r<<16},wo=new Uint32Array((()=>{for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),ko=(e,t,n,i)=>{var a=wo,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return~e},So={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Eo={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Mo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Po={assign:function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)Mo(n,i)&&(e[i]=n[i])}}return e},flattenChunks:e=>{for(var t=0,n=0,i=e.length;n<i;n++)t+=e[n].length;for(var a=new Uint8Array(t),r=0,o=0,s=e.length;r<s;r++){var u=e[r];a.set(u,o),o+=u.length}return a}},To=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){To=!1}for(var Do=new Uint8Array(256),Ao=0;Ao<256;Ao++)Do[Ao]=Ao>=252?6:Ao>=248?5:Ao>=240?4:Ao>=224?3:Ao>=192?2:1;Do[254]=Do[254]=1;var xo={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,n,i,a,r,o=e.length,s=0;for(a=0;a<o;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),s+=