@namiml/web-sdk 3.5.0-dev.202611052201 → 3.5.0-dev.202611121626
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nami-web.d.ts +1 -1
- package/dist/nami-web.umd.js +1 -1
- package/package.json +2 -2
package/dist/nami-web.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).NamiWebSdk={})}(this,function(e){"use strict";function t(e,t){this.v=e,this.k=t}function n(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 i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){return new t(e,0)}function r(e,t,n){return t=v(t),b(e,g()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u=0;function l(e){return"__private_"+u+++"_"+e}function d(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,T(i.key),i)}}function c(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e))||t){i&&(e=i);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}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 m(){return m=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},m.apply(null,arguments)}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=v(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}},f.apply(null,arguments)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function p(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&&P(e,t)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function y(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 b(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 i(e)}function w(){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 E(l,"_invoke",function(n,i,a){var r,s,u,l=0,d=a||[],c=!1,h={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return r=t,s=0,u=e,h.n=n,o}};function m(n,i){for(s=n,u=i,t=0;!c&&l&&!a&&t<d.length;t++){var a,r=d[t],m=h.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,h.v=i,h.n=r[1]):m<f&&(a=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,h.n=f,s=0))}if(a||n>1)return o;throw c=!0,i}return function(a,d,f){if(l>1)throw TypeError("Generator is already running");for(c&&1===d&&m(d,f),s=d,u=f;(t=s<2?e:u)||!c;){r||(s?s<3?(s>1&&(h.n=-1),m(s,u)):h.n=u:h.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=(c=h.n<0)?u:n.call(i,h))!==o)break}catch(t){r=e,s=1,u=t}finally{l=1}}return{value:t,done:c}}}(n,a,r),!0),l}var o={};function s(){}function u(){}function l(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(E(t={},i,function(){return this}),t),c=l.prototype=s.prototype=Object.create(d);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,E(e,a,"GeneratorFunction")),e.prototype=Object.create(c),e}return u.prototype=l,E(c,"constructor",l),E(l,"constructor",u),u.displayName="GeneratorFunction",E(l,a,"GeneratorFunction"),E(c),E(c,a,"Generator"),E(c,i,function(){return this}),E(c,"toString",function(){return"[object Generator]"}),(w=function(){return{w:r,m:h}})()}function k(e,t,n,i,a){var r=function(e,t,n,i,a){return new S(w().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 S(e,n){function i(a,r,o,s){try{var u=e[a](r),l=u.value;return l instanceof t?n.resolve(l.v).then(function(e){i("next",e,o,s)},function(e){i("throw",e,o,s)}):n.resolve(l).then(function(e){u.value=e,o(u)},function(e){return i("throw",e,o,s)})}catch(e){s(e)}}var a;this.next||(E(S.prototype),E(S.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),E(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return a=a?a.then(o,o):o()},!0)}function E(e,t,n,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}E=function(e,t,n,i){function r(t,n){E(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))},E(e,t,n,i)}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}function _(e,t,n,i){var a=f(v(e.prototype),t,n);return"function"==typeof a?function(e){return a.apply(n,e)}:a}function T(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 M(e){var t="function"==typeof Map?new Map:void 0;return M=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(g())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var a=new(e.bind.apply(e,i));return n&&P(a,n.prototype),a}(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),P(n,e)},M(e)}var A,D,x,C,I,L,F,R,O,$,N,W,j=function(){return c(function e(t){o(this,e),this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",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(){}}])}(),B=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},z=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)},U={__proto__:null,enumerable:!0};Object.freeze(U);var H=($=function(){return c(function e(t,n={}){if(o(this,e),A.set(this,!1),D.set(this,!1),x.set(this,!1),C.set(this,!1),I.set(this,Date.now()),L.set(this,!1),F.set(this,void 0),R.set(this,void 0),O.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;B(this,A,!!a,"f"),B(this,D,!!i,"f"),B(this,x,!!r,"f"),B(this,F,`${t}`,"f"),B(this,R,null,"f"),B(this,O,!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(){B(this,C,!0,"f")}},{key:"target",get:function(){return z(this,R,"f")}},{key:"currentTarget",get:function(){return z(this,R,"f")}},{key:"srcElement",get:function(){return z(this,R,"f")}},{key:"type",get:function(){return z(this,F,"f")}},{key:"cancelable",get:function(){return z(this,A,"f")}},{key:"defaultPrevented",get:function(){return z(this,A,"f")&&z(this,C,"f")}},{key:"timeStamp",get:function(){return z(this,I,"f")}},{key:"composedPath",value:function(){return z(this,O,"f")?[z(this,R,"f")]:[]}},{key:"returnValue",get:function(){return!z(this,A,"f")||!z(this,C,"f")}},{key:"bubbles",get:function(){return z(this,D,"f")}},{key:"composed",get:function(){return z(this,x,"f")}},{key:"eventPhase",get:function(){return z(this,O,"f")?$.AT_TARGET:$.NONE}},{key:"cancelBubble",get:function(){return z(this,L,"f")},set:function(e){e&&B(this,L,!0,"f")}},{key:"stopPropagation",value:function(){B(this,L,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),A=new WeakMap,D=new WeakMap,x=new WeakMap,C=new WeakMap,I=new WeakMap,L=new WeakMap,F=new WeakMap,R=new WeakMap,O=new WeakMap,$.NONE=0,$.CAPTURING_PHASE=1,$.AT_TARGET=2,$.BUBBLING_PHASE=3,$);Object.defineProperties(H.prototype,{initEvent:U,stopImmediatePropagation:U,preventDefault:U,target:U,currentTarget:U,srcElement:U,type:U,cancelable:U,defaultPrevented:U,timeStamp:U,composedPath:U,returnValue:U,bubbles:U,composed:U,eventPhase:U,cancelBubble:U,stopPropagation:U,isTrusted:U});var G=(W=function(e){function t(e,n={}){var i,a;return o(this,t),a=r(this,t,[e,n]),N.set(a,void 0),B(a,N,null!==(i=null==n?void 0:n.detail)&&void 0!==i?i:null,"f"),a}return p(t,e),c(t,[{key:"initCustomEvent",value:function(e,t,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function(){return z(this,N,"f")}}])}(H),N=new WeakMap,W);Object.defineProperties(G.prototype,{detail:U});var V,K,Y,X,q=H,J=G;(V=function(){return c(function e(){o(this,e),this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""},[{key:"parentRule",get:function(){return null}},{key:"parentStyleSheet",get:function(){return this.__parentStyleSheet}},{key:"type",get:function(){return 0}}])}()).STYLE_RULE=1,V.CHARSET_RULE=2,V.IMPORT_RULE=3,V.MEDIA_RULE=4,V.FONT_FACE_RULE=5,V.PAGE_RULE=6,V.NAMESPACE_RULE=10,V.KEYFRAMES_RULE=7,V.KEYFRAME_RULE=8,V.SUPPORTS_RULE=12,V.COUNTER_STYLE_RULE=11,V.FONT_FEATURE_VALUES_RULE=14,V.MARGIN_RULE=9,null!==(K=globalThis.Event)&&void 0!==K||(globalThis.Event=q),null!==(Y=globalThis.CustomEvent)&&void 0!==Y||(globalThis.CustomEvent=J);var Q=Symbol(),Z=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},ee={__proto__:null,enumerable:!0};Object.freeze(ee);var te=function(){return c(function e(){o(this,e),this.__eventListeners=new Map,this.__captureEventListeners=new Map},[{key:"addEventListener",value:function(e,t,n){var i;if(null!=t){var a=Z(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=Z(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.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));var n=!1,i=!1,a=q.NONE,r=null,o=null,s=null,u=e.stopPropagation,l=e.stopImmediatePropagation;Object.defineProperties(e,{target:m({get:()=>null!=r?r:o},ee),srcElement:m({get:()=>e.target},ee),currentTarget:m({get:()=>s},ee),eventPhase:m({get:()=>a},ee),composedPath:m({value:()=>t},ee),stopPropagation:m({value:()=>{n=!0,u.call(e)}},ee),stopImmediatePropagation:m({value:()=>{i=!0,l.call(e)}},ee)});var d=(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=()=>(s=null,a=q.NONE,!e.defaultPrevented),f=t.slice().reverse();r=this.__host&&e.composed?null:this;for(var v,p=e=>{for(o=this;o.__host&&e.includes(o.__host);)o=o.__host},g=h(f);!(v=g()).done;){var y=v.value;r||o&&o!==y.__host||p(f.slice(f.indexOf(y))),s=y,a=y===e.target?q.AT_TARGET:q.CAPTURING_PHASE;var b=y.__captureEventListeners.get(e.type);if(b)for(var w,k=h(b);!(w=k()).done;){var S=w.value;if(d(S[0],S[1],b),i)return c()}if(n)return c()}var E=e.bubbles?t:[this];o=null;for(var P,_=h(E);!(P=_()).done;){var T=P.value;r||o&&T!==o.__host||p(E.slice(0,E.indexOf(T)+1)),s=T,a=T===e.target?q.AT_TARGET:q.BUBBLING_PHASE;var M=T.__eventListeners.get(e.type);if(M)for(var A,D=h(M);!(A=D()).done;){var x=A.value;if(d(x[0],x[1],M),i)return c()}if(n)return c()}return c()}},{key:"__resolveFullEventPath",value:function(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,oe,pe]}}])}(),ne=new WeakMap,ie=e=>{var t=ne.get(e);return void 0===t&&ne.set(e,t=new Map),t},ae=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"getRootNode",value:function(e){var t;if(null!=e&&e.composed)return se;var n=this.__host;return null!==(t=null==n?void 0:n.__shadowRoot)&&void 0!==t?t:se}}])}(te),re=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"adoptedStyleSheets",get:function(){return[]}},{key:"createTreeWalker",value:function(){return{}}},{key:"createTextNode",value:function(){return{}}},{key:"createElement",value:function(){return{}}}])}(ae),oe=new re,se=oe,ue=function(e){function t(e){var n;if(o(this,t),n=r(this,t),e!==Q)throw new TypeError("Illegal constructor");return Object.assign(n,globalThis,{CustomElementRegistry:fe,customElements:ve,document:se,Document:re,Element:le,EventTarget:te,HTMLElement:de,Node:ae,ShadowRoot:he,window:n,Window:ue}),n}return p(t,e),c(t)}(ae),le=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).__shadowRootMode=null,e.__shadowRoot=null,e.__internals=null,e}return p(t,e),c(t,[{key:"attributes",get:function(){return Array.from(ie(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){ie(this).set(e,String(t))}},{key:"removeAttribute",value:function(e){ie(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 ie(this).has(e)}},{key:"attachShadow",value:function(e){this.__shadowRootMode=e.mode;var t=new he(Q,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=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 j(this);return this.__internals=e,e}},{key:"getAttribute",value:function(e){var t=ie(this).get(e);return null!=t?t:null}}])}(ae),de=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(le),ce=de,he=function(e){function t(e,n){var i;if(o(this,t),i=r(this,t),e!=e)throw new TypeError("Illegal constructor");return i.mode=n.mode,i}return p(t,e),c(t,[{key:"host",get:function(){return this.__host}}])}(ae);function me(){var e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}null!==(X=globalThis.litServerRoot)&&void 0!==X||(globalThis.litServerRoot=Object.defineProperty(new ce,"localName",{get:()=>"lit-server-root"}));var fe=function(){return c(function e(){o(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:"initialize",value:function(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}},{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 k(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=me(),this.__pendingWhenDefineds.set(e,n)),i.a(2,n.promise)}},null,this,null,Promise)}}])}(),ve=new fe,pe=new ue(Q);"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ce);var ge=["action"],ye=null;var be={storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},getAllKeys:()=>[]},device:{getDeviceData:()=>({os_version:"",os_name:"",browser_name:"",browser_version:"",sdk_client:"",sdk_version:"",language:"en"}),getDeviceFormFactor:()=>"desktop",getDeviceScaleFactor:()=>1,generateUUID:()=>{throw new Error("No platform adapter registered — call registerPlatformAdapters() before Nami.configure()")},getScreenInfo:()=>({width:0,height:0,scale:1}),getLanguage:()=>"en"},ui:{createPaywall:()=>null,reRenderPaywall:()=>{},flowNavigateToScreen:()=>{}}};function we(){return null!=ye?ye:be}function ke(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 Se(e,t,n,i){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 Ee(e,t,n,i,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;var Pe,_e=2,Te=4,Me=1800,Ae=1800,De=!0;!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"}(Pe||(Pe={}));var xe,Ce={},Ie=Ce.NAMI_SDK_VERSION,Le=void 0===Ie?"3.5.0":Ie,Fe=Ce.NAMI_SDK_PACKAGE_VERSION,Re=void 0===Fe?"3.5.0-dev.202611052201":Fe,Oe=Ce.PLATFORM_ID_REQUIRED,$e=void 0===Oe?"Platform ID is required":Oe,Ne=Ce.DEVICE_ID_REQUIRED,We=void 0===Ne?"Device ID is required":Ne,je=Ce.EXTERNAL_ID_REQUIRED,Be=void 0===je?"External ID is required":je,ze=Ce.SDK_NOT_INITIALIZED,Ue=void 0===ze?"SDK has not been initialized. Make sure to call Nami.configure() first!":ze,He=Ce.CAMPAIGN_NOT_AVAILABLE,Ge=void 0===He?"Campaign is not available":He,Ve=Ce.FLOW_SCREENS_NOT_AVAILABLE,Ke=void 0===Ve?"Flow screens not available":Ve,Ye=Ce.UNABLE_TO_UPDATE_CDP_ID,Xe=void 0===Ye?"Unable to update CDP id in anonymous mode":Ye,qe=Ce.ANONYMOUS_MODE_ALREADY_ON,Je=void 0===qe?"Anonymous mode is already turned on.":qe,Qe=Ce.ANONYMOUS_MODE_ALREADY_OFF,Ze=void 0===Qe?"Anonymous mode is already turned off.":Qe,et=Ce.DEVICE_ID_NOT_SET,tt=void 0===et?"Nami Device ID is not set":et,nt=Ce.AUTH_DEVICE,it=void 0===nt?"nami_auth_device":nt,at=Ce.NAMI_CONFIGURATION,rt=void 0===at?"nami_configuration":at,ot=Ce.NAMI_PROFILE,st=void 0===ot?"nami_profile":ot,ut=Ce.API_CONFIG,lt=void 0===ut?"api_config":ut,dt=Ce.API_CAMPAIGN_RULES,ct=void 0===dt?"api_campaign_rules":dt,ht=Ce.API_PAYWALLS,mt=void 0===ht?"api_paywalls":ht,ft=Ce.API_CAMPAIGN_SESSION_TIMESTAMP,vt=void 0===ft?"api_campaign_session_timestamp":ft,pt=Ce.API_PRODUCTS,gt=void 0===pt?"api_products":pt,yt=Ce.API_ACTIVE_ENTITLEMENTS,bt=void 0===yt?"api_active_entitlements":yt,wt=Ce.SERVER_NAMI_ENTITLEMENTS,kt=void 0===wt?"server_active_entitlements":wt,St=Ce.INITIAL_APP_CONFIG,Et=void 0===St?"initial_app_config":St,Pt=Ce.INITIAL_CAMPAIGN_RULES,_t=void 0===Pt?"initial_campaign_rules":Pt,Tt=Ce.INITIAL_PAYWALLS,Mt=void 0===Tt?"initial_paywalls":Tt,At=Ce.INITIAL_PRODUCTS,Dt=void 0===At?"initial_products":At,xt=Ce.LOCAL_NAMI_ENTITLEMENTS,Ct=void 0===xt?"local_active_entitlements":xt,It=Ce.CUSTOMER_ATTRIBUTES_KEY_PREFIX,Lt=void 0===It?"nami_cmr_attributes_":It,Ft=Ce.NAMI_CUSTOMER_JOURNEY_STATE,Rt=void 0===Ft?"nami_customer_journey_state":Ft,Ot=Ce.NAMI_JOURNEY_RULE_STATE,$t=void 0===Ot?"nami_journey_rule_state":Ot,Nt=Ce.NAMI_JOURNEY_INSTALL_EVALUATED,Wt=void 0===Nt?"nami_journey_install_evaluated":Nt,jt=Ce.ANONYMOUS_MODE,Bt=void 0===jt?"nami_anonymous_mode_v2":jt,zt=Ce.ANONYMOUS_UUID,Ut=void 0===zt?"nami_anonymous_uuid":zt,Ht=Ce.KEY_SESSION_COUNTER,Gt=void 0===Ht?"nami_session_counter":Ht,Vt=Ce.INITIAL_SESSION_COUNTER_VALUE,Kt=void 0===Vt?1:Vt,Yt=Ce.NAMI_LAST_IMPRESSION_ID,Xt=void 0===Yt?"nami_last_impression_id":Yt,qt=Ce.NAMI_PURCHASE_IMPRESSION_ID,Jt=void 0===qt?"nami_purchase_impression_id":qt,Qt=Ce.NAMI_LAUNCH_ID,Zt=void 0===Qt?"nami_launch_id":Qt,en=Ce.NAMI_SESSION_ID,tn=void 0===en?"nami_session_id":en,nn=Ce.NAMI_LANGUAGE_CODE,an=void 0===nn?"nami_language_code":nn,rn=Ce.NAMI_PURCHASE_CHANNEL,on=void 0===rn?"nami_purchase_channel":rn,sn=Ce.API_VERSION,un=Ce.BASE_URL_PATH,ln=void 0===un?`sdk/${void 0===sn?"v3":sn}/platform`:un,dn=Ce.BASE_URL,cn=void 0===dn?"https://app.namiml.com":dn,hn=Ce.BASE_STAGING_URL,mn=void 0===hn?"https://app-staging.namiml.com":hn,fn=Ce.CUSTOM_HOST_PREFIX,vn=void 0===fn?"namiAPIHost=":fn,pn=Ce.USE_STAGING_API,gn=void 0===pn?"useStagingAPI":pn,yn=Ce.EXTENDED_CLIENT_INFO_PREFIX,bn=void 0===yn?"extendedClientInfo":yn,wn=Ce.EXTENDED_CLIENT_INFO_DELIMITER,kn=void 0===wn?":":wn,Sn=Ce.VALIDATE_PRODUCT_GROUPS,En=void 0===Sn?"validateProductGroups":Sn,Pn=Ce.LOG_HTTP_REQUESTS,_n=void 0===Pn?"logHTTPRequests":Pn,Tn=Ce.LOG_HTTP_TRAFFIC,Mn=void 0===Tn?"logHTTPTraffic":Tn,An=Ce.API_TRAFFIC_OBSERVER,Dn=void 0===An?"apiTrafficObserver":An,xn=Ce.STARTUP_TELEMETRY,Cn=void 0===xn?"startupTelemetry":xn,In=Ce.SIMULATE_CONFIG_FETCH_FAILURE,Ln=void 0===In?"simulateConfigFetchFailure":In,Fn=Ce.DISABLE_JOURNEY_DELIVERY,Rn=void 0===Fn?"disableJourneyDelivery":Fn,On=Ce.SIMULATE_PAYWALL_FETCH_FAILURE,$n=void 0===On?"simulatePaywallFetchFailure":On,Nn=Ce.CAMPAIGN_CACHE_TTL_PREFIX,Wn=void 0===Nn?"campaignCacheTTL=":Nn,jn=Ce.TIME_OVERRIDE_PREFIX,Bn=void 0===jn?"timeOverride=":jn,zn=Ce.SYSTEM_TIME_TOKEN_PREFIX,Un=void 0===zn?"${system.time.":zn,Hn=Ce.SYSTEM_TIME_FILTER_PREFIX,Gn=void 0===Hn?"System.time.":Hn,Vn=Ce.API_MAX_CALLS_LIMIT,Kn=void 0===Vn?2:Vn,Yn=Ce.API_RETRY_DELAY_SEC,Xn=void 0===Yn?2:Yn,qn=Ce.API_TIMEOUT_LIMIT,Jn=void 0===qn?2e4:qn,Qn=Ce.DEVICE_API_TIMEOUT_LIMIT,Zn=void 0===Qn?2e3:Qn,ei=Ce.CONFIG_MAX_ATTEMPTS,ti=void 0===ei?3:ei,ni=Ce.CONFIG_API_TIMEOUT_LIMIT,ii=void 0===ni?1e4:ni,ai=Ce.RESUME_THROTTLE_MS,ri=void 0===ai?3e4:ai,oi=Ce.SESSION_GAP_MS,si=void 0===oi?3e4:oi,ui=Ce.STATUS_BAD_REQUEST,li=void 0===ui?400:ui,di=Ce.STATUS_NOT_FOUND,ci=void 0===di?404:di,hi=Ce.STATUS_CONFLICT,mi=void 0===hi?409:hi,fi=Ce.STATUS_INTERNAL_SERVER_ERROR,vi=void 0===fi?500:fi,pi=Ce.INITIAL_SUCCESS,gi=void 0===pi?"Initial success":pi,yi=Ce.RECONFIG_SUCCESS,bi=void 0===yi?"Reconfig success":yi,wi=Ce.ALREADY_CONFIGURED,ki=void 0===wi?"Already configured":wi,Si=Ce.AVAILABLE_CAMPAIGNS_CHANGED,Ei=void 0===Si?"AvailableCampaignsChanged":Si,Pi=Ce.PAYWALL_ACTION_EVENT,_i=void 0===Pi?"PaywallActionEvent":Pi,Ti=Ce.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,Mi=void 0===Ti?"AvailableActiveEntitlementsChanged":Ti,Ai=Ce.CUSTOMER_JOURNEY_STATE_CHANGED,Di=void 0===Ai?"CustomerJourneyStateChanged":Ai,xi=Ce.SKU_TEXT_REGEX,Ci=void 0===xi?/\$\{sku\.(\w+)(:\d+)?\}/g:xi,Ii=Ce.VAR_REGEX,Li=void 0===Ii?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:Ii,Fi=Ce.SMART_TEXT_PATTERN,Ri=void 0===Fi?"${":Fi,Oi=Ce.LIQUID_VARIABLE_REGEX,$i=void 0===Oi?/\${[A-Za-z0-9.]+}/g:Oi,Ni=[it,rt,st,lt,ct,mt,vt,gt,bt,kt,Et,_t,Mt,Dt,Ct,Rt,$t,Wt,Bt,Ut,Gt,Xt,Jt,Zt,tn,an,on];e.LogLevel=void 0,(xe=e.LogLevel||(e.LogLevel={}))[xe.DEBUG=1]="DEBUG",xe[xe.INFO=2]="INFO",xe[xe.WARN=3]="WARN",xe[xe.ERROR=4]="ERROR";var Wi={debug:e.LogLevel.DEBUG,info:e.LogLevel.INFO,warn:e.LogLevel.WARN,error:e.LogLevel.ERROR},ji=function(){return c(function t(){o(this,t),this.currentLogLevel=e.LogLevel.DEBUG,this.setLogger=t=>{this.currentLogLevel=t?Wi[t]:e.LogLevel.WARN}},[{key:"debug",value:function(t,...n){this.shouldLog(e.LogLevel.DEBUG)&&console.debug(this.formatMessage(e.LogLevel.DEBUG,t,...n))}},{key:"info",value:function(t,...n){this.shouldLog(e.LogLevel.INFO)&&console.info(this.formatMessage(e.LogLevel.INFO,t,...n))}},{key:"warn",value:function(t,...n){this.shouldLog(e.LogLevel.WARN)&&console.warn(this.formatMessage(e.LogLevel.WARN,t,...n))}},{key:"error",value:function(t,...n){this.shouldLog(e.LogLevel.ERROR)&&console.error(this.formatMessage(e.LogLevel.ERROR,t,...n))}},{key:"shouldLog",value:function(e){return e>=this.currentLogLevel}},{key:"formatMessage",value:function(t,n,...i){var a=e.LogLevel[t];return`[${(new Date).toISOString()}] [${a}] ${n} ${i=i.map(e=>"object"==typeof e?JSON.stringify(e):e)}`}}])}(),Bi=new ji;function zi(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 Ui(e,t){return e===t||e!=e&&t!=t}function Hi(e,t){for(var n=e.length;n--;)if(Ui(e[n][0],t))return n;return-1}var Gi=Array.prototype.splice;function Vi(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])}}Vi.prototype.clear=function(){this.__data__=[],this.size=0},Vi.prototype.delete=function(e){var t=this.__data__,n=Hi(t,e);return!(n<0)&&(n==t.length-1?t.pop():Gi.call(t,n,1),--this.size,!0)},Vi.prototype.get=function(e){var t=this.__data__,n=Hi(t,e);return n<0?void 0:t[n][1]},Vi.prototype.has=function(e){return Hi(this.__data__,e)>-1},Vi.prototype.set=function(e,t){var n=this.__data__,i=Hi(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Ki="object"==typeof global&&global&&global.Object===Object&&global,Yi="object"==typeof self&&self&&self.Object===Object&&self,Xi=Ki||Yi||Function("return this")(),qi=Xi.Symbol,Ji=Object.prototype,Qi=Ji.hasOwnProperty,Zi=Ji.toString,ea=qi?qi.toStringTag:void 0;var ta=Object.prototype.toString;var na=qi?qi.toStringTag:void 0;function ia(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":na&&na in Object(e)?function(e){var t=Qi.call(e,ea),n=e[ea];try{e[ea]=void 0;var i=!0}catch(e){}var a=Zi.call(e);return i&&(t?e[ea]=n:delete e[ea]),a}(e):function(e){return ta.call(e)}(e)}function aa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){if(!aa(e))return!1;var t=ia(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var oa,sa=Xi["__core-js_shared__"],ua=(oa=/[^.]+$/.exec(sa&&sa.keys&&sa.keys.IE_PROTO||""))?"Symbol(src)_1."+oa:"";var la=Function.prototype.toString;function da(e){if(null!=e){try{return la.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var ca=/^\[object .+?Constructor\]$/,ha=Function.prototype,ma=Object.prototype,fa=ha.toString,va=ma.hasOwnProperty,pa=RegExp("^"+fa.call(va).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ga(e){return!(!aa(e)||(t=e,ua&&ua in t))&&(ra(e)?pa:ca).test(da(e));var t}function ya(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ga(n)?n:void 0}var ba=ya(Xi,"Map"),wa=ya(Object,"create");var ka=Object.prototype.hasOwnProperty;var Sa=Object.prototype.hasOwnProperty;function Ea(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 Pa(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 _a(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])}}Ea.prototype.clear=function(){this.__data__=wa?wa(null):{},this.size=0},Ea.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ea.prototype.get=function(e){var t=this.__data__;if(wa){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ka.call(t,e)?t[e]:void 0},Ea.prototype.has=function(e){var t=this.__data__;return wa?void 0!==t[e]:Sa.call(t,e)},Ea.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wa&&void 0===t?"__lodash_hash_undefined__":t,this},_a.prototype.clear=function(){this.size=0,this.__data__={hash:new Ea,map:new(ba||Vi),string:new Ea}},_a.prototype.delete=function(e){var t=Pa(this,e).delete(e);return this.size-=t?1:0,t},_a.prototype.get=function(e){return Pa(this,e).get(e)},_a.prototype.has=function(e){return Pa(this,e).has(e)},_a.prototype.set=function(e,t){var n=Pa(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Ta(e){var t=this.__data__=new Vi(e);this.size=t.size}Ta.prototype.clear=function(){this.__data__=new Vi,this.size=0},Ta.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ta.prototype.get=function(e){return this.__data__.get(e)},Ta.prototype.has=function(e){return this.__data__.has(e)},Ta.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Vi){var i=n.__data__;if(!ba||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new _a(i)}return n.set(e,t),this.size=n.size,this};function Ma(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new _a;++t<n;)this.add(e[t])}function Aa(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 Da(e,t){return e.has(t)}Ma.prototype.add=Ma.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ma.prototype.has=function(e){return this.__data__.has(e)};function xa(e,t,n,i,a,r){var o=1&n,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 c=-1,h=!0,m=2&n?new Ma:void 0;for(r.set(e,t),r.set(t,e);++c<s;){var f=e[c],v=t[c];if(i)var p=o?i(v,f,c,t,e,r):i(f,v,c,e,t,r);if(void 0!==p){if(p)continue;h=!1;break}if(m){if(!Aa(t,function(e,t){if(!Da(m,t)&&(f===e||a(f,e,n,i,r)))return m.push(t)})){h=!1;break}}else if(f!==v&&!a(f,v,n,i,r)){h=!1;break}}return r.delete(e),r.delete(t),h}var Ca=Xi.Uint8Array;function Ia(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function La(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Fa=qi?qi.prototype:void 0,Ra=Fa?Fa.valueOf:void 0;var Oa=Array.isArray;var $a=Object.prototype.propertyIsEnumerable,Na=Object.getOwnPropertySymbols,Wa=Na?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}(Na(e),function(t){return $a.call(e,t)}))}:function(){return[]};function ja(e){return null!=e&&"object"==typeof e}function Ba(e){return ja(e)&&"[object Arguments]"==ia(e)}var za=Object.prototype,Ua=za.hasOwnProperty,Ha=za.propertyIsEnumerable,Ga=Ba(function(){return arguments}())?Ba:function(e){return ja(e)&&Ua.call(e,"callee")&&!Ha.call(e,"callee")};var Va="object"==typeof e&&e&&!e.nodeType&&e,Ka=Va&&"object"==typeof module&&module&&!module.nodeType&&module,Ya=Ka&&Ka.exports===Va?Xi.Buffer:void 0,Xa=(Ya?Ya.isBuffer:void 0)||function(){return!1},qa=/^(?:0|[1-9]\d*)$/;function Ja(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&qa.test(e))&&e>-1&&e%1==0&&e<t}function Qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Za={};function er(e){return function(t){return e(t)}}Za["[object Float32Array]"]=Za["[object Float64Array]"]=Za["[object Int8Array]"]=Za["[object Int16Array]"]=Za["[object Int32Array]"]=Za["[object Uint8Array]"]=Za["[object Uint8ClampedArray]"]=Za["[object Uint16Array]"]=Za["[object Uint32Array]"]=!0,Za["[object Arguments]"]=Za["[object Array]"]=Za["[object ArrayBuffer]"]=Za["[object Boolean]"]=Za["[object DataView]"]=Za["[object Date]"]=Za["[object Error]"]=Za["[object Function]"]=Za["[object Map]"]=Za["[object Number]"]=Za["[object Object]"]=Za["[object RegExp]"]=Za["[object Set]"]=Za["[object String]"]=Za["[object WeakMap]"]=!1;var tr="object"==typeof e&&e&&!e.nodeType&&e,nr=tr&&"object"==typeof module&&module&&!module.nodeType&&module,ir=nr&&nr.exports===tr&&Ki.process,ar=function(){try{var e=nr&&nr.require&&nr.require("util").types;return e||ir&&ir.binding&&ir.binding("util")}catch(e){}}(),rr=ar&&ar.isTypedArray,or=rr?er(rr):function(e){return ja(e)&&Qa(e.length)&&!!Za[ia(e)]},sr=Object.prototype.hasOwnProperty;function ur(e,t){var n=Oa(e),i=!n&&Ga(e),a=!n&&!i&&Xa(e),r=!n&&!i&&!a&&or(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)!sr.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ja(l,u))||s.push(l);return s}var lr=Object.prototype;function dr(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||lr)}function cr(e,t){return function(n){return e(t(n))}}var hr=cr(Object.keys,Object),mr=Object.prototype.hasOwnProperty;function fr(e){return null!=(t=e)&&Qa(t.length)&&!ra(t)?ur(e):function(e){if(!dr(e))return hr(e);var t=[];for(var n in Object(e))mr.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}function vr(e){return function(e,t,n){var i=t(e);return Oa(e)?i:function(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}(i,n(e))}(e,fr,Wa)}var pr=Object.prototype.hasOwnProperty;var gr=ya(Xi,"DataView"),yr=ya(Xi,"Promise"),br=ya(Xi,"Set"),wr=ya(Xi,"WeakMap"),kr="[object Map]",Sr="[object Promise]",Er="[object Set]",Pr="[object WeakMap]",_r="[object DataView]",Tr=da(gr),Mr=da(ba),Ar=da(yr),Dr=da(br),xr=da(wr),Cr=ia;(gr&&Cr(new gr(new ArrayBuffer(1)))!=_r||ba&&Cr(new ba)!=kr||yr&&Cr(yr.resolve())!=Sr||br&&Cr(new br)!=Er||wr&&Cr(new wr)!=Pr)&&(Cr=function(e){var t=ia(e),n="[object Object]"==t?e.constructor:void 0,i=n?da(n):"";if(i)switch(i){case Tr:return _r;case Mr:return kr;case Ar:return Sr;case Dr:return Er;case xr:return Pr}return t});var Ir="[object Arguments]",Lr="[object Array]",Fr="[object Object]",Rr=Object.prototype.hasOwnProperty;function Or(e,t,n,i,a,r){var o=Oa(e),s=Oa(t),u=o?Lr:Cr(e),l=s?Lr:Cr(t),d=(u=u==Ir?Fr:u)==Fr,c=(l=l==Ir?Fr:l)==Fr,h=u==l;if(h&&Xa(e)){if(!Xa(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new Ta),o||or(e)?xa(e,t,n,i,a,r):function(e,t,n,i,a,r,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new Ca(e),new Ca(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ui(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Ia;case"[object Set]":var u=1&i;if(s||(s=La),e.size!=t.size&&!u)return!1;var l=o.get(e);if(l)return l==t;i|=2,o.set(e,t);var d=xa(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(Ra)return Ra.call(e)==Ra.call(t)}return!1}(e,t,u,n,i,a,r);if(!(1&n)){var m=d&&Rr.call(e,"__wrapped__"),f=c&&Rr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new Ta),a(v,p,n,i,r)}}return!!h&&(r||(r=new Ta),function(e,t,n,i,a,r){var o=1&n,s=vr(e),u=s.length;if(u!=vr(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:pr.call(t,d)))return!1}var c=r.get(e),h=r.get(t);if(c&&h)return c==t&&h==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 $r(e,t,n,i,a){return e===t||(null==e||null==t||!ja(e)&&!ja(t)?e!=e&&t!=t:Or(e,t,n,i,$r,a))}function Nr(e){return e==e&&!aa(e)}function Wr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function jr(e){var t=function(e){for(var t=fr(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,Nr(a)]}return t}(e);return 1==t.length&&t[0][2]?Wr(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 if(!$r(l,u,3,i,new Ta))return!1}return!0}(n,0,t)}}function Br(e){return"symbol"==typeof e||ja(e)&&"[object Symbol]"==ia(e)}var zr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ur=/^\w*$/;function Hr(e,t){if(Oa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Br(e))||(Ur.test(e)||!zr.test(e)||null!=t&&e in Object(t))}function Gr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(Gr.Cache||_a),n}Gr.Cache=_a;var Vr,Kr,Yr,Xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qr=/\\(\\)?/g,Jr=(Vr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Xr,function(e,n,i,a){t.push(i?a.replace(qr,"$1"):n||e)}),t},Kr=Gr(Vr,function(e){return 500===Yr.size&&Yr.clear(),e}),Yr=Kr.cache,Kr);var Qr=qi?qi.prototype:void 0,Zr=Qr?Qr.toString:void 0;function eo(e){if("string"==typeof e)return e;if(Oa(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,eo)+"";if(Br(e))return Zr?Zr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function to(e,t){return Oa(e)?e:Hr(e,t)?[e]:Jr(function(e){return null==e?"":eo(e)}(e))}function no(e){if("string"==typeof e||Br(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function io(e,t){for(var n=0,i=(t=to(t,e)).length;null!=e&&n<i;)e=e[no(t[n++])];return n&&n==i?e:void 0}function ao(e,t){return null!=e&&t in Object(e)}function ro(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=to(t,e)).length,r=!1;++i<a;){var o=no(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&Qa(a)&&Ja(o,a)&&(Oa(e)||Ga(e))}(e,t,ao)}function oo(e,t){return Hr(e)&&Nr(t)?Wr(no(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:io(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?ro(n,e):$r(t,i,3)}}function so(e){return e}function uo(e){return Hr(e)?(t=no(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return io(t,e)}}(e);var t}function lo(e){return e!=e}function co(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,lo,n)}(e,t,0)>-1}var ho=br&&1/La(new br([,-0]))[1]==1/0?function(e){return new br(e)}:function(){};function mo(e,t){return e&&e.length?function(e,t,n){var i=-1,a=co,r=e.length,o=!0,s=[],u=s;if(r>=200){var l=t?null:ho(e);if(l)return La(l);o=!1,a=Da,u=new Ma}else u=t?[]:s;e:for(;++i<r;){var d=e[i],c=t?t(d):d;if(d=0!==d?d:0,o&&c==c){for(var h=u.length;h--;)if(u[h]===c)continue e;t&&u.push(c),s.push(d)}else a(u,c,n)||(u!==s&&u.push(c),s.push(d))}return s}(e,"function"==typeof(n=t)?n:null==n?so:"object"==typeof n?Oa(n)?oo(n[0],n[1]):jr(n):uo(n)):[];var n}var fo="api_paywall_body:",vo="api_paywall_body_meta:",po=function(){return c(function e(t=()=>we().storage,n=500){o(this,e),this.storage=t,this.maxEntries=n,this.memory=null,this.index=null},[{key:"count",get:function(){return this.memory?this.memory.size:this.loadIndex().size}},{key:"evaluateTtl",value:function(e,t=Date.now()){if(0===e){if(this.memory)return;return this.dropPersisted([...this.loadIndex().keys()]),void(this.memory=new Map)}if(this.memory=null,null!==e){var n=[...this.loadIndex().values()].filter(n=>go(n,e,t));if(0!==n.length){this.dropPersisted(n.map(e=>e.url));var i=yo(Math.min(...n.map(e=>e.savedAt)),t);Bi.debug(`Paywall body cache: evicted ${n.length} expired entries (campaign_cache_ttl=${e}s, oldest_age=${i}s)`)}}}},{key:"validEntry",value:function(e,t,n=Date.now()){var i;if(this.memory)return null!==(i=this.memory.get(e))&&void 0!==i?i:null;var a=this.loadIndex().get(e);if(!a)return null;if(null!==t&&t>0&&go(a,t,n))return this.dropPersisted([e]),Bi.debug(`Paywall body cache: evicted expired entry on read (campaign_cache_ttl=${t}s, age=${yo(a.savedAt,n)}s): ${e}`),null;var r=this.read(fo+e);return null===r?(this.dropPersisted([e]),null):{meta:a,body:r}}},{key:"bodyFor",value:function(e){var t,n;return this.memory?null!==(t=null===(n=this.memory.get(e))||void 0===n?void 0:n.body)&&void 0!==t?t:null:this.read(fo+e)}},{key:"store",value:function(e,t,n,i=Date.now()){var a=m({url:e,savedAt:i},t?{contentHash:t}:{});if(this.memory)return this.memory.set(e,{meta:a,body:n}),!0;var r=this.loadIndex(),o=JSON.stringify(a);return this.write(fo+e,n)&&this.write(vo+e,o)?(r.set(e,a),!0):(Bi.warn(`Paywall body cache: could not store ${e}; it will be fetched next time`),this.dropPersisted([e]),!1)}},{key:"seedIfAbsent",value:function(e,t,n,i=Date.now()){return!(this.memory?this.memory.has(e):this.loadIndex().has(e))&&this.store(e,t,n,i)}},{key:"renew",value:function(e,t,n=Date.now()){if(null===t||t<=0||this.memory)return 0;for(var i,a=this.loadIndex(),r=0,o=h(e);!(i=o()).done;){var s=i.value,u=a.get(s);if(u){var l=m({},u,{savedAt:n});this.write(vo+s,JSON.stringify(l))&&(a.set(s,l),r+=1)}}return r}},{key:"remove",value:function(e){this.memory?this.memory.delete(e):this.dropPersisted([e])}},{key:"reconcile",value:function(e){var t=this.memory?[...this.memory.values()].map(e=>e.meta):[...this.loadIndex().values()],n=t.filter(t=>!e.has(t.url)).map(e=>e.url),i=t.filter(t=>e.has(t.url)).sort((e,t)=>e.savedAt-t.savedAt),a=i.slice(0,Math.max(0,i.length-this.maxEntries)).map(e=>e.url);0===n.length&&0===a.length||([...n,...a].forEach(e=>this.remove(e)),Bi.debug(`Paywall body cache: evicted ${n.length} entries no longer named by campaign_rules, ${a.length} over the ${this.maxEntries}-entry cap`))}},{key:"purgeAll",value:function(){var e;this.dropPersisted([...this.loadIndex().keys()]),null===(e=this.memory)||void 0===e||e.clear()}},{key:"loadIndex",value:function(){if(this.index)return this.index;var e;this.index=new Map;try{e=this.storage().getAllKeys()}catch(e){return Bi.warn(`Paywall body cache: storage unavailable, caching nothing (${e})`),this.index}for(var t,n=new Set(e.filter(e=>e.startsWith(fo)).map(e=>e.slice(17))),i=[],a=h(e);!(t=a()).done;){var r=t.value;if(r.startsWith(vo)){var o=r.slice(22),s=bo(this.read(r));(null==s?void 0:s.url)===o&&n.has(o)?this.index.set(o,s):i.push(o),n.delete(o)}}return this.dropPersisted([...i,...n]),this.index}},{key:"dropPersisted",value:function(e){for(var t,n=h(e);!(t=n()).done;){var i,a=t.value;null===(i=this.index)||void 0===i||i.delete(a),this.removeKey(vo+a),this.removeKey(fo+a)}}},{key:"read",value:function(e){try{return this.storage().getItem(e)}catch(e){return null}}},{key:"write",value:function(e,t){try{this.storage().setItem(e,t)}catch(e){return!1}return this.read(e)===t}},{key:"removeKey",value:function(e){try{this.storage().removeItem(e)}catch(e){}}}])}();function go(e,t,n){return(n-e.savedAt)/1e3>=t}function yo(e,t){return Math.floor((t-e)/1e3)}function bo(e){if(null===e)return null;try{var t=JSON.parse(e);return"string"==typeof(null==t?void 0:t.url)&&"number"==typeof(null==t?void 0:t.savedAt)?t:null}catch(e){return null}}var wo=new po,ko=function(){return c(function e(){o(this,e),this.memoryStore={}},[{key:"storage",get:function(){return we().storage}},{key:"setDevice",value:function(e){this.setItem(it,e)}},{key:"getDevice",value:function(){return this.getItem(it)}},{key:"resetDevice",value:function(){this.resetItem(it)}},{key:"getAnonymousMode",value:function(){return this.getItem(Bt)||!1}},{key:"setAnonymousMode",value:function(e){this.setItem(Bt,e)}},{key:"clearAnonymousMode",value:function(){this.resetItem(Bt)}},{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(an,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(an)||"en"}},{key:"setCampaignRules",value:function(e,t){e!==_t?e!==ct||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[ct]=JSON.stringify(t):this.memoryStore[_t]=JSON.stringify(t)}},{key:"getCampaignRules",value:function(e){if(e===_t)return this.memoryStore[_t]?JSON.parse(this.memoryStore[_t]):null;if(e===ct){var t=this.memoryStore[ct];if(null!=t)return JSON.parse(t);var n=this.getItem(ct);if(null===n)return null;if("string"==typeof n)try{n=JSON.parse(n)}catch(e){return n}return this.isLegacyTimestampedCache(n)?n.data:n}return this.getItem(e)}},{key:"setPaywalls",value:function(e,t){e!==Mt?e!==mt||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[mt]=JSON.stringify(t):this.memoryStore[Mt]=JSON.stringify(t)}},{key:"setApiPaywallsFromBodyCache",value:function(e){var t={bodyCacheUrls:e};0!==this.getCampaignCacheTtl()?this.setItem(mt,t):this.memoryStore[mt]=JSON.stringify(t)}},{key:"getPaywalls",value:function(e){if(e===Mt)return this.memoryStore[Mt]?JSON.parse(this.memoryStore[Mt]):null;if(e===mt){var t=this.memoryStore[mt];if(null!=t){var n=JSON.parse(t);return So(n)?Eo(n.bodyCacheUrls):n}var i=this.getItem(mt);if(null===i)return null;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){return i}return So(i)?Eo(i.bodyCacheUrls):this.isLegacyTimestampedCache(i)?i.data:i}return 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(gt))&&void 0!==e?e:[];return mo(zi([...null!==(t=this.getItem(Dt))&&void 0!==t?t:[],...n]),"sku_ref_id")}},{key:"setNamiConfig",value:function(e){this.setItem(rt,e)}},{key:"getNamiConfig",value:function(){return this.getItem(rt)}},{key:"setCustomerAttribute",value:function(e,t){this.setItem(Lt+e,t)}},{key:"getCustomerAttribute",value:function(e){return this.getItem(Lt+e)}},{key:"getAllCustomerAttributes",value:function(){return this.storage.getAllKeys().map(e=>[e,this.storage.getItem(e)]).filter(([e])=>e.includes(Lt)).map(([e,t])=>e.replace(Lt,"")+":"+t)}},{key:"getAllCustomerAttributesKeys",value:function(){return this.storage.getAllKeys().filter(e=>e.includes(Lt)).map(e=>e.replace(Lt,""))}},{key:"getAllCustomerAttributesMap",value:function(){var e={};return this.getAllCustomerAttributesKeys().forEach(t=>{var n=this.getCustomerAttribute(t);null!=n&&(e[t]=String(n))}),e}},{key:"clearCustomerAttribute",value:function(e){var t=Lt+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}},{key:"clearAllCustomerAttributes",value:function(){this.storage.getAllKeys().filter(e=>e.includes(Lt)).map(e=>this.resetItem(e))}},{key:"setNamiProfile",value:function(e){this.setItem(st,e)}},{key:"getNamiProfile",value:function(){return this.getItem(st)}},{key:"removeNamiProfile",value:function(){this.resetItem(st)}},{key:"setCustomerJourneyState",value:function(e){this.setItem(Rt,e)}},{key:"getCustomerJourneyState",value:function(){return this.getItem(Rt)}},{key:"getJourneyRuleState",value:function(){return this.getItem($t)}},{key:"setJourneyRuleState",value:function(e){this.setItem($t,e)}},{key:"removeJourneyRuleState",value:function(){this.resetItem($t)}},{key:"getJourneyInstallEvaluated",value:function(){return!0===this.getItem(Wt)}},{key:"setJourneyInstallEvaluated",value:function(){this.setItem(Wt,!0)}},{key:"setSessionCounter",value:function(){var e=this.getItem(Gt),t=e?parseInt(e):Kt||Kt;this.setItem(Gt,t+1)}},{key:"getSessionCounter",value:function(){var e=this.getItem(Gt);return e?parseInt(e):Kt}},{key:"setLastImpressionId",value:function(e){this.setItem(Xt,e)}},{key:"getLastImpressionId",value:function(){var e;return null!==(e=this.getItem(Xt))&&void 0!==e?e:""}},{key:"setPurchaseImpression",value:function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(Jt,t)}},{key:"getPurchaseImpression",value:function(){var e;return null!==(e=this.getItem(Jt))&&void 0!==e?e:""}},{key:"setSessionId",value:function(e){e&&this.setItem(tn,e)}},{key:"getSessionId",value:function(){var e;return null!==(e=this.getItem(tn))&&void 0!==e?e:""}},{key:"clearSessionId",value:function(){this.resetItem(tn)}},{key:"setLaunchId",value:function(e){e&&this.setItem(Zt,e)}},{key:"getLaunchId",value:function(){var e;return null!==(e=this.getItem(Zt))&&void 0!==e?e:""}},{key:"clearLaunchId",value:function(){this.resetItem(Zt)}},{key:"setPurchaseChannel",value:function(e){e&&this.setItem(on,e)}},{key:"getPurchaseChannel",value:function(){return this.getItem(on)}},{key:"getAnonymousUUID",value:function(){return this.getItem(Ut)}},{key:"setAnonymousUUID",value:function(e){this.setItem(Ut,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(Ut)}},{key:"setApiCampaignSessionTimestamp",value:function(){this.setItem(vt,Date.now())}},{key:"getApiCampaignSessionTimestamp",value:function(){return this.getItem(vt)}},{key:"purgeApiCampaignCache",value:function(){this.resetItem(mt),this.resetItem(ct),this.resetItem(vt)}},{key:"getCampaignCacheTtl",value:function(){var e,t,n=null===(e=this.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.filter(e=>e.startsWith(Wn)).map(e=>e.slice(Wn.length)).find(e=>/^\d+$/.test(e));if(void 0!==n)return parseInt(n,10);var i=this.getAppConfig(lt)||this.getAppConfig(Et);return null!==(t=null==i?void 0:i.campaign_cache_ttl)&&void 0!==t?t:null}},{key:"isLegacyTimestampedCache",value:function(e){return"object"==typeof e&&null!==e&&"cachedAt"in e&&"data"in e}},{key:"setItem",value:function(e,t){var n;try{n=JSON.stringify(t)}catch(t){return void Bi.error(`Serialization failed for ${e}`,t)}try{this.storage.setItem(e,n)}catch(t){Bi.error("Error setting item in localStorage:",t),this.resetItem(e),this.memoryStore[e]=n}}},{key:"getItem",value:function(e){try{var t=this.storage.getItem(e);if(null!==t)return JSON.parse(t)}catch(t){Bi.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{this.storage.removeItem(e)}catch(t){Bi.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clearAll",value:function(){Ni.forEach(e=>this.resetItem(e)),this.clearAllCustomerAttributes(),this.memoryStore={}}},{key:"clear",value:function(){try{this.storage.clear()}catch(e){Bi.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}();function So(e){return"object"==typeof e&&null!==e&&Array.isArray(e.bodyCacheUrls)}function Eo(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a=t.value,r=wo.bodyFor(a);if(null!==r)try{n.push(JSON.parse(r))}catch(e){wo.remove(a)}}return n}var Po=new ko,_o=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.status=e,i.message=`RetryLimitExceededError: ${i.message}`,i}return p(t,e),c(t)}(M(Error)),To=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(M(Error)),Mo=function(e){function t(){var e;return o(this,t),(e=r(this,t)).status=409,e.name="ConflictError",e.message="ConflictError: Server responded with conflict",e}return p(t,e),c(t)}(To),Ao=function(e){function t(){return o(this,t),r(this,t,[Ue])}return p(t,e),c(t)}(M(Error)),Do=function(e){function t(){return o(this,t),r(this,t,[$e])}return p(t,e),c(t)}(M(Error)),xo=function(e){function t(){return o(this,t),r(this,t,[We])}return p(t,e),c(t)}(M(Error)),Co=function(e){function t(){return o(this,t),r(this,t,[Be])}return p(t,e),c(t)}(M(Error)),Io=function(e){function t(){return o(this,t),r(this,t,[Ge])}return p(t,e),c(t)}(M(Error)),Lo=function(e){function t(){return o(this,t),r(this,t,[Ke])}return p(t,e),c(t)}(M(Error)),Fo=function(e){function t(){return o(this,t),r(this,t,[Je])}return p(t,e),c(t)}(M(Error)),Ro=function(e){function t(){return o(this,t),r(this,t,[Ze])}return p(t,e),c(t)}(M(Error)),Oo=function(e){function t(){return o(this,t),r(this,t,[Ze])}return p(t,e),c(t)}(M(Error)),$o=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(M(Error)),No=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`BadRequestError: ${n.message}`,n}return p(t,e),c(t)}(To),Wo=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`NotFoundError: ${n.message}`,n}return p(t,e),c(t)}(To),jo=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.message=`ClientError: ${i.message}`,i}return p(t,e),c(t)}(To),Bo=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`ServerError: ${n.message}`,n}return p(t,e),c(t)}(To),zo=(e,t)=>{if(e==li)throw new No(t);if(e==ci)throw new Wo(t);if(e==mi)throw new Mo;if(e>li&&e<vi)throw new jo(e,t);if(e>=vi)throw new Bo(t)};function Uo(e){for(var t=e.length;--t>=0;)e[t]=0}Uo(new Array(576)),Uo(new Array(60)),Uo(new Array(512)),Uo(new Array(256)),Uo(new Array(29)),Uo(new Array(30));var Ho=(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},Go=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})()),Vo=(e,t,n,i)=>{var a=Go,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^e},Ko={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"},Yo=0,Xo=4,qo=5,Jo=6,Qo=0,Zo=1,es=2,ts=-2,ns=-3,is=-4,as=-5,rs=8,os=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ss=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)os(n,i)&&(e[i]=n[i])}}return e},us=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},ls=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){ls=!1}for(var ds=new Uint8Array(256),cs=0;cs<256;cs++)ds[cs]=cs>=252?6:cs>=248?5:cs>=240?4:cs>=224?3:cs>=192?2:1;ds[254]=ds[254]=1;var hs=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+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),r=0,a=0;r<s;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++),n<128?t[r++]=n:n<2048?(t[r++]=192|n>>>6,t[r++]=128|63&n):n<65536?(t[r++]=224|n>>>12,t[r++]=128|n>>>6&63,t[r++]=128|63&n):(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63,t[r++]=128|n>>>6&63,t[r++]=128|63&n);return t},ms=(e,t)=>{var n,i,a=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var r=new Array(2*a);for(i=0,n=0;n<a;){var o=e[n++];if(o<128)r[i++]=o;else{var s=ds[o];if(s>4)r[i++]=65533,n+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&n<a;)o=o<<6|63&e[n++],s--;s>1?r[i++]=65533:o<65536?r[i++]=o:(o-=65536,r[i++]=55296|o>>10&1023,r[i++]=56320|1023&o)}}}return((e,t)=>{if(t<65534&&e.subarray&&ls)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var n="",i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n})(r,i)},fs=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);for(var n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+ds[e[n]]>t?n:t};var vs=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ps=16209,gs=function(e,t){var n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,_,T=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,_=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=T.dmax,u=T.wsize,l=T.whave,d=T.wnext,c=T.window,h=T.hold,m=T.bits,f=T.lencode,v=T.distcode,p=(1<<T.lenbits)-1,g=(1<<T.distbits)-1;e:do{m<15&&(h+=P[n++]<<m,m+=8,h+=P[n++]<<m,m+=8),y=f[h&p];t:for(;;){if(h>>>=b=y>>>24,m-=b,0===(b=y>>>16&255))_[a++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){T.mode=16191;break e}e.msg="invalid literal/length code",T.mode=ps;break e}y=f[(65535&y)+(h&(1<<b)-1)];continue t}for(w=65535&y,(b&=15)&&(m<b&&(h+=P[n++]<<m,m+=8),w+=h&(1<<b)-1,h>>>=b,m-=b),m<15&&(h+=P[n++]<<m,m+=8,h+=P[n++]<<m,m+=8),y=v[h&g];;){if(h>>>=b=y>>>24,m-=b,16&(b=y>>>16&255)){if(k=65535&y,m<(b&=15)&&(h+=P[n++]<<m,(m+=8)<b&&(h+=P[n++]<<m,m+=8)),(k+=h&(1<<b)-1)>s){e.msg="invalid distance too far back",T.mode=ps;break e}if(h>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>l&&T.sane){e.msg="invalid distance too far back",T.mode=ps;break e}if(S=0,E=c,0===d){if(S+=u-b,b<w){w-=b;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}}else if(d<b){if(S+=u+d-b,(b-=d)<w){w-=b;do{_[a++]=c[S++]}while(--b);if(S=0,d<w){w-=b=d;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}}}else if(S+=d-b,b<w){w-=b;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}for(;w>2;)_[a++]=E[S++],_[a++]=E[S++],_[a++]=E[S++],w-=3;w&&(_[a++]=E[S++],w>1&&(_[a++]=E[S++]))}else{S=a-k;do{_[a++]=_[S++],_[a++]=_[S++],_[a++]=_[S++],w-=3}while(w>2);w&&(_[a++]=_[S++],w>1&&(_[a++]=_[S++]))}break}if(64&b){e.msg="invalid distance code",T.mode=ps;break e}y=v[(65535&y)+(h&(1<<b)-1)]}}break}}while(n<i&&a<o);n-=w=m>>3,h&=(1<<(m-=w<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<o?o-a+257:257-(a-o),T.hold=h,T.bits=m},ys=15,bs=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ws=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ks=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Ss=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Es=(e,t,n,i,a,r,o,s)=>{var u,l,d,c,h,m,f,v,p,g=s.bits,y=0,b=0,w=0,k=0,S=0,E=0,P=0,_=0,T=0,M=0,A=null,D=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=ys;y++)D[y]=0;for(b=0;b<i;b++)D[t[n+b]]++;for(S=g,k=ys;k>=1&&0===D[k];k--);if(S>k&&(S=k),0===k)return a[r++]=20971520,a[r++]=20971520,s.bits=1,0;for(w=1;w<k&&0===D[w];w++);for(S<w&&(S=w),_=1,y=1;y<=ys;y++)if(_<<=1,(_-=D[y])<0)return-1;if(_>0&&(0===e||1!==k))return-1;for(x[1]=0,y=1;y<ys;y++)x[y+1]=x[y]+D[y];for(b=0;b<i;b++)0!==t[n+b]&&(o[x[t[n+b]]++]=b);if(0===e?(A=C=o,m=20):1===e?(A=bs,C=ws,m=257):(A=ks,C=Ss,m=0),M=0,b=0,y=w,h=r,E=S,P=0,d=-1,c=(T=1<<S)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){f=y-P,o[b]+1<m?(v=0,p=o[b]):o[b]>=m?(v=C[o[b]-m],p=A[o[b]-m]):(v=96,p=0),u=1<<y-P,w=l=1<<E;do{a[h+(M>>P)+(l-=u)]=f<<24|v<<16|p}while(0!==l);for(u=1<<y-1;M&u;)u>>=1;if(0!==u?(M&=u-1,M+=u):M=0,b++,0===--D[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(M&c)!==d){for(0===P&&(P=S),h+=w,_=1<<(E=y-P);E+P<k&&!((_-=D[E+P])<=0);)E++,_<<=1;if(T+=1<<E,1===e&&T>852||2===e&&T>592)return 1;a[d=M&c]=S<<24|E<<16|h-r}}return 0!==M&&(a[h+M]=y-P<<24|64<<16),s.bits=S,0},Ps=Xo,_s=qo,Ts=Jo,Ms=Qo,As=Zo,Ds=es,xs=ts,Cs=ns,Is=is,Ls=as,Fs=rs,Rs=16180,Os=16190,$s=16191,Ns=16192,Ws=16194,js=16199,Bs=16200,zs=16206,Us=16209,Hs=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Gs(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Vs,Ks,Ys=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<Rs||t.mode>16211?1:0},Xs=e=>{if(Ys(e))return xs;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Rs,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Ms},qs=e=>{if(Ys(e))return xs;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Xs(e)},Js=(e,t)=>{var n;if(Ys(e))return xs;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?xs:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,qs(e))},Qs=(e,t)=>{if(!e)return xs;var n=new Gs;e.state=n,n.strm=e,n.window=null,n.mode=Rs;var i=Js(e,t);return i!==Ms&&(e.state=null),i},Zs=!0,eu=e=>{if(Zs){Vs=new Int32Array(512),Ks=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Es(1,e.lens,0,288,Vs,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Es(2,e.lens,0,32,Ks,0,e.work,{bits:5}),Zs=!1}e.lencode=Vs,e.lenbits=9,e.distcode=Ks,e.distbits=5},tu=(e,t,n,i)=>{var a,r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),i>=r.wsize?(r.window.set(t.subarray(n-r.wsize,n),0),r.wnext=0,r.whave=r.wsize):((a=r.wsize-r.wnext)>i&&(a=i),r.window.set(t.subarray(n-i,n-i+a),r.wnext),(i-=a)?(r.window.set(t.subarray(n-i,n),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=a))),0},nu=(e,t)=>{var n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,_,T=0,M=new Uint8Array(4),A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ys(e)||!e.output||!e.input&&0!==e.avail_in)return xs;(n=e.state).mode===$s&&(n.mode=Ns),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,l=n.hold,d=n.bits,c=s,h=u,E=Ms;e:for(;;)switch(n.mode){case Rs:if(0===n.wrap){n.mode=Ns;break}for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,M[0]=255&l,M[1]=l>>>8&255,n.check=Vo(n.check,M,2,0),l=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Us;break}if((15&l)!==Fs){e.msg="unknown compression method",n.mode=Us;break}if(d-=4,S=8+(15&(l>>>=4)),0===n.wbits&&(n.wbits=S),S>15||S>n.wbits){e.msg="invalid window size",n.mode=Us;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:$s,l=0,d=0;break;case 16181:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(n.flags=l,(255&n.flags)!==Fs){e.msg="unknown compression method",n.mode=Us;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Us;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=Vo(n.check,M,2,0)),l=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,M[2]=l>>>16&255,M[3]=l>>>24&255,n.check=Vo(n.check,M,4,0)),l=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=Vo(n.check,M,2,0)),l=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=Vo(n.check,M,2,0)),l=0,d=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((m=n.length)>s&&(m=s),m&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(r,r+m),S)),512&n.flags&&4&n.wrap&&(n.check=Vo(n.check,i,m,r)),s-=m,r+=m,n.length-=m),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;m=0;do{S=i[r+m++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&m<s);if(512&n.flags&&4&n.wrap&&(n.check=Vo(n.check,i,m,r)),s-=m,r+=m,S)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;m=0;do{S=i[r+m++],n.head&&S&&n.length<65536&&(n.head.comment+=String.fromCharCode(S))}while(S&&m<s);if(512&n.flags&&4&n.wrap&&(n.check=Vo(n.check,i,m,r)),s-=m,r+=m,S)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Us;break}l=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=$s;break;case 16189:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}e.adler=n.check=Hs(l),l=0,d=0,n.mode=Os;case Os:if(0===n.havedict)return e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,Ds;e.adler=n.check=1,n.mode=$s;case $s:if(t===_s||t===Ts)break e;case Ns:if(n.last){l>>>=7&d,d-=7&d,n.mode=zs;break}for(;d<3;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}switch(n.last=1&l,d-=1,3&(l>>>=1)){case 0:n.mode=16193;break;case 1:if(eu(n),n.mode=js,t===Ts){l>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Us}l>>>=2,d-=2;break;case 16193:for(l>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Us;break}if(n.length=65535&l,l=0,d=0,n.mode=Ws,t===Ts)break e;case Ws:n.mode=16195;case 16195:if(m=n.length){if(m>s&&(m=s),m>u&&(m=u),0===m)break e;a.set(i.subarray(r,r+m),o),s-=m,r+=m,u-=m,o+=m,n.length-=m;break}n.mode=$s;break;case 16196:for(;d<14;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(n.nlen=257+(31&l),l>>>=5,d-=5,n.ndist=1+(31&l),l>>>=5,d-=5,n.ncode=4+(15&l),l>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Us;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;d<3;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.lens[A[n.have++]]=7&l,l>>>=3,d-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},E=Es(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid code lengths set",n.mode=Us;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(y<16)l>>>=p,d-=p,n.lens[n.have++]=y;else{if(16===y){for(_=p+2;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(l>>>=p,d-=p,0===n.have){e.msg="invalid bit length repeat",n.mode=Us;break}S=n.lens[n.have-1],m=3+(3&l),l>>>=2,d-=2}else if(17===y){for(_=p+3;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}d-=p,S=0,m=3+(7&(l>>>=p)),l>>>=3,d-=3}else{for(_=p+7;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}d-=p,S=0,m=11+(127&(l>>>=p)),l>>>=7,d-=7}if(n.have+m>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Us;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===Us)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Us;break}if(n.lenbits=9,P={bits:n.lenbits},E=Es(1,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid literal/lengths set",n.mode=Us;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},E=Es(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,E){e.msg="invalid distances set",n.mode=Us;break}if(n.mode=js,t===Ts)break e;case js:n.mode=Bs;case Bs:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,gs(e,h),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,l=n.hold,d=n.bits,n.mode===$s&&(n.back=-1);break}for(n.back=0;g=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(g&&!(240&g)){for(b=p,w=g,k=y;g=(T=n.lencode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}l>>>=b,d-=b,n.back+=b}if(l>>>=p,d-=p,n.back+=p,n.length=y,0===g){n.mode=16205;break}if(32&g){n.back=-1,n.mode=$s;break}if(64&g){e.msg="invalid literal/length code",n.mode=Us;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for(_=n.extra;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;g=(T=n.distcode[l&(1<<n.distbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(!(240&g)){for(b=p,w=g,k=y;g=(T=n.distcode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}l>>>=b,d-=b,n.back+=b}if(l>>>=p,d-=p,n.back+=p,64&g){e.msg="invalid distance code",n.mode=Us;break}n.offset=y,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for(_=n.extra;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Us;break}n.mode=16204;case 16204:if(0===u)break e;if(m=h-u,n.offset>m){if((m=n.offset-m)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Us;break}m>n.wnext?(m-=n.wnext,f=n.wsize-m):f=n.wnext-m,m>n.length&&(m=n.length),v=n.window}else v=a,f=o-n.offset,m=n.length;m>u&&(m=u),u-=m,n.length-=m;do{a[o++]=v[f++]}while(--m);0===n.length&&(n.mode=Bs);break;case 16205:if(0===u)break e;a[o++]=n.length,u--,n.mode=Bs;break;case zs:if(n.wrap){for(;d<32;){if(0===s)break e;s--,l|=i[r++]<<d,d+=8}if(h-=u,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?Vo(n.check,a,h,o-h):Ho(n.check,a,h,o-h)),h=u,4&n.wrap&&(n.flags?l:Hs(l))!==n.check){e.msg="incorrect data check",n.mode=Us;break}l=0,d=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Us;break}l=0,d=0}n.mode=16208;case 16208:E=As;break e;case Us:E=Cs;break e;case 16210:return Is;default:return xs}return e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,(n.wsize||h!==e.avail_out&&n.mode<Us&&(n.mode<zs||t!==Ps))&&tu(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?Vo(n.check,a,h,e.next_out-h):Ho(n.check,a,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===$s?128:0)+(n.mode===js||n.mode===Ws?256:0),(0===c&&0===h||t===Ps)&&E===Ms&&(E=Ls),E},iu={inflateReset:qs,inflateReset2:Js,inflateResetKeep:Xs,inflateInit:e=>Qs(e,15),inflateInit2:Qs,inflate:nu,inflateEnd:e=>{if(Ys(e))return xs;var t=e.state;return t.window&&(t.window=null),e.state=null,Ms},inflateGetHeader:(e,t)=>{if(Ys(e))return xs;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Ms):xs},inflateSetDictionary:(e,t)=>{var n,i=t.length;return Ys(e)||0!==(n=e.state).wrap&&n.mode!==Os?xs:n.mode===Os&&Ho(1,t,i,0)!==n.check?Cs:tu(e,t,i,i)?(n.mode=16210,Is):(n.havedict=1,Ms)},inflateInfo:"pako inflate (from Nodeca project)"};var au=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},ru=Object.prototype.toString,ou=Yo,su=Xo,uu=Qo,lu=Zo,du=es,cu=ts,hu=ns,mu=is;function fu(e){this.options=ss({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vs,this.strm.avail_out=0;var n=iu.inflateInit2(this.strm,t.windowBits);if(n!==uu)throw new Error(Ko[n]);if(this.header=new au,iu.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=hs(t.dictionary):"[object ArrayBuffer]"===ru.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=iu.inflateSetDictionary(this.strm,t.dictionary))!==uu))throw new Error(Ko[n])}fu.prototype.push=function(e,t){var n,i,a,r=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(i=t===~~t?t:!0===t?su:ou,"[object ArrayBuffer]"===ru.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(o),r.next_out=0,r.avail_out=o),(n=iu.inflate(r,i))===du&&s&&((n=iu.inflateSetDictionary(r,s))===uu?n=iu.inflate(r,i):n===hu&&(n=du));r.avail_in>0&&n===lu&&r.state.wrap>0&&0!==e[r.next_in];)iu.inflateReset(r),n=iu.inflate(r,i);switch(n){case cu:case hu:case du:case mu:return this.onEnd(n),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||n===lu))if("string"===this.options.to){var u=fs(r.output,r.next_out),l=r.next_out-u,d=ms(r.output,u);r.next_out=l,r.avail_out=o-l,l&&r.output.set(r.output.subarray(u,u+l),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(n!==uu||0!==a){if(n===lu)return n=iu.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},fu.prototype.onData=function(e){this.chunks.push(e)},fu.prototype.onEnd=function(e){e===uu&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=us(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var vu={ungzip:function(e,t){var n=new fu(t);if(n.push(e),n.err)throw n.msg||Ko[n.err];return n.result}}.ungzip,pu=e=>{var t;if(null!=e&&e.includes(gn))t=mn;else{var n=null==e?void 0:e.find(e=>e.includes(vn));t=n?n.split("=")[1]:cn}return(t=t.replace(/\/$/,""))+"/"+ln},gu=e=>{var t,n,i=Po.getAppConfig(lt)||Po.getAppConfig(Et);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},yu=()=>Po.getCampaignCacheTtl(),bu=()=>{var e=yu();if(null!==e)if(0!==e){var t=Po.getApiCampaignSessionTimestamp();if(null!==t)(Date.now()-t)/1e3>=e&&Po.purgeApiCampaignCache()}else Po.purgeApiCampaignCache()},wu=e=>{var t=!gu(Pe.THIRD_PARTY_TRANSACTIONS);return e&&!t&&Bi.info(`[${e}] Your plan does not have purchase management features.`),t},ku=()=>{var e,t,n=null===(e=Po.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(_n))&&void 0!==t&&t},Su=()=>{var e,t,n=null===(e=Po.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(Mn))&&void 0!==t&&t};function Eu(e){try{var t=function(e){if("undefined"!=typeof Buffer)return new Uint8Array(Buffer.from(e,"base64"));for(var t=atob(e),n=t.length,i=new Uint8Array(n),a=0;a<n;a++)i[a]=t.charCodeAt(a);return i}(e.trim()),n=vu(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}var Pu=null;function _u(){return null!==Pu&&(n=null===(e=Po.getNamiConfig())||void 0===e?void 0:e.namiCommands,null!==(t=null==n?void 0:n.includes(Dn))&&void 0!==t&&t);var e,t,n}function Tu(e){if(e)return e.length>4096?e.slice(0,4096):e}function Mu(e){try{return new URL(e).pathname}catch(t){return e}}function Au(e){var t=null==e?void 0:e.body;return"string"==typeof t?Tu(t):void 0}function Du(e){try{var t;null===(t=Pu)||void 0===t||t(e)}catch(e){}}function xu(e,t,n,i){var r,o,s,u,l,d,c,h;return k(function(m){for(;;)switch(m.p=m.n){case 0:if(_u()){m.n=1;break}return m.a(2,i());case 1:return o=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",s=Date.now(),m.p=2,m.n=3,a(i());case 3:u=m.v,m.n=5;break;case 4:throw m.p=4,c=m.v,Du({method:o,url:e,path:Mu(e),statusCode:0,durationMs:Date.now()-s,timestamp:new Date,requestBody:Au(t),errorDescription:Cu(c),kind:n}),c;case 5:return l=Date.now()-s,m.p=6,h=Tu,m.n=7,a(u.clone().text());case 7:d=h(m.v),m.n=9;break;case 8:m.p=8,m.v;case 9:return Du({method:o,url:e,path:Mu(e),statusCode:u.status,durationMs:l,timestamp:new Date,requestBody:Au(t),responseBody:d,kind:n}),m.a(2,u)}},null,null,[[6,8],[2,4]],Promise)}function Cu(e){return e instanceof Error?e.name?`${e.name}: ${e.message}`:e.message:String(e)}function Iu(e,t,n=Jn,i=Kn){var r,o,s,u,l,d,c;return k(function(h){for(;;)switch(h.n){case 0:return o=0,s=ku(),u=Su(),l=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",d=()=>{var r,c,h,m;return k(function(f){for(;;)switch(f.n){case 0:return(s||u)&&Bi.debug(`[HTTP] ${l} ${e}`),u&&null!=t&&t.body&&Bi.debug(`[HTTP] Request body: ${t.body}`),f.n=1,a(xu(e,t,"api",()=>Lu(e,t,n)));case 1:if((r=f.v).ok){f.n=7;break}if(!u){f.n=3;break}return f.n=2,a(r.clone().text());case 2:c=f.v,Bi.debug(`[HTTP] Response ${r.status}: ${c}`);case 3:if(r.status!=mi){f.n=4;break}throw new Mo;case 4:if(!(++o<=i)){f.n=6;break}return h=1e3*(o+Xn),f.n=5,a(new Promise(e=>setTimeout(e,h)));case 5:return f.a(2,d());case 6:throw new _o(r.status,`Request failed after ${i} retries`);case 7:if(!u){f.n=9;break}return f.n=8,a(r.clone().text());case 8:m=f.v,Bi.debug(`[HTTP] Response ${r.status}: ${m}`);case 9:return f.a(2,r)}},null,null,null,Promise)},h.n=1,a(d());case 1:return c=h.v,h.a(2,c.json())}},null,null,null,Promise)}function Lu(e,t={},n){var i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return i=new AbortController,r=setTimeout(()=>i.abort(),n),t.signal=i.signal,s.n=1,a(fetch(e,t));case 1:return o=s.v,clearTimeout(r),s.a(2,o)}},null,null,null,Promise)}var Fu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{},Ru="function"==typeof Fu.BigInt,Ou=Ru?Fu.BigInt.bind(Fu):void 0,$u=Ru?Ou("0xffffffffffffffffffffffffffffffff"):null,Nu=Ru?Ou("0x100000000000000000000000000000000"):null,Wu=Ru?Ou(0):null,ju=Ru?Ou(1):null,Bu=Ru?Ou(8):null,zu=Ru?Ou(1e4):null,Uu=Fu.crypto,Hu="function"==typeof(null==Uu?void 0:Uu.getRandomValues),Gu=1/16,Vu=e=>we().device.getDeviceData(e),Ku=()=>{var e=Po.getNamiConfig();return e&&e.formFactor?e.formFactor:we().device.getDeviceFormFactor()};function Yu(){return we().device.generateUUID()}function Xu(e){if(!Ru||!$u)return Qu(e);try{var t=$u,n=function(e){if(!Ou)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return Ou("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw Bi.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function qu(e){if(!Ou)throw new Error("BigInt is not supported in this environment");var t=e.toString(16).padStart(32,"0");t=t.substring(0,12)+"4"+t.substring(13);var n=3&parseInt(t[16],16)|8;return(t=t.substring(0,16)+n.toString(16)+t.substring(17)).slice(0,8)+"-"+t.slice(8,12)+"-"+t.slice(12,16)+"-"+t.slice(16,20)+"-"+t.slice(20)}function Ju(e,t=.5){if(!Number.isFinite(e))throw new Error("Invalid target");if(!Number.isFinite(t))throw new Error("Invalid tolerance");var n=Math.max(0,Math.min(100,e)),i=Math.max(0,Math.min(50,t)),a=e=>Math.round(100*e),r=Math.max(0,a(n-i)),o=Math.min(1e4,a(n+i));if(!(Ru&&$u&&Ou&&zu))return function(e,t){for(var n=Math.max(0,Math.min(100,e-t)),i=Math.min(100,Math.max(0,e+t)),a=Yu(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var u=Yu(),l=Qu(u);if(l>=n&&l<=i)return u;var d=Zu(l,n,i);d<r&&(r=d,a=u)}return a}(n,i);var s=$u,u=Ou,l=zu,d=e=>s*u(e)/l,c=d(r),m=d(o);if(m<=c)return qu(c);var f=c+function(e){if(!Ou||null===Nu||null===ju||null===Wu||null===Bu)throw new Error("BigInt is not supported in this environment");var t=Ou,n=Wu,i=ju,a=Bu,r=Nu;if(e<n)throw new Error("n must be non-negative");if(e===n)return n;for(var o=new Uint8Array(16),s=e+i,u=r/s*s-i,l=0,d=!1;l<10;){if(Hu)Uu.getRandomValues(o);else{d||(d=!0,Bi.warn("randomBigInt: crypto.getRandomValues unavailable, using Math.random fallback"));for(var c=0;c<o.length;c++)o[c]=Math.floor(256*Math.random())}for(var m,f=n,v=h(o);!(m=v()).done;)f=f<<a|t(m.value);if(f<=u)return f%s;l++}if(Hu)try{Uu.getRandomValues(o);for(var p,g=n,y=h(o);!(p=y()).done;)g=g<<a|t(p.value);var b=g%s;return Bi.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:l}),b}catch(e){throw Bi.error("randomBigInt: failed to generate random values",e),new Error("randomBigInt: unable to generate random value")}for(var w,k=n,S=h(o);!(w=S()).done;)k=k<<a|t(w.value);return Bi.warn("randomBigInt: reached max rejection attempts without crypto, using modulo fallback",{n:e.toString(),attempts:l}),k%s}(m-c);return qu(f)}function Qu(e){var t=function(e){var t=e.replace(/-/g,"").toLowerCase();if(!/^[0-9a-f]{32}$/.test(t))throw new Error(`Invalid UUID format: ${e}`);for(var n=0,i=t.length-1;i>=0;i--){n=(n+parseInt(t[i],16))*Gu}return n}(e);return 100*t}function Zu(e,t,n){return e<t?t-e:e>n?e-n:0}function el(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new Do;return i.apply(this,e)},n}function tl(e,t,n){var i=n.value;return n.value=function(...e){var t=Po.getDevice();if(null==t||!t.id)throw new xo;return i.apply(this,e)},n}var nl,il=function(){function e(){o(this,e);var t=Po.getNamiConfig();!this.platformID&&t&&this.configure(t)}return c(e,[{key:"deviceID",get:function(){var e;return null===(e=Po.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=pu(e.namiCommands),this.platformID=e.appPlatformID}},{key:"reset",value:function(){this.baseURL=void 0,this.platformID=void 0}},{key:"login",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:if(e){i.n=1;break}throw new Co;case 1:return t=`device/${this.deviceID}/login/`,n={external_id:e},i.n=2,a(this.requestBodyAPI(t,n,"PUT"));case 2:return i.a(2,i.v)}},null,this,null,Promise)}},{key:"logout",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return e=`device/${this.deviceID}/logout/`,t.n=1,a(this.requestBodyAPI(e,{},"PUT"));case 1:return t.a(2,t.v)}},null,this,null,Promise)}},{key:"startSession",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/session/`,i.n=1,a(this.requestBodyAPI(t,{start_time:e,app_env:"production"}));case 1:n=i.v,Po.setSessionCounter(),n.id&&Po.setSessionId(n.id);case 2:return i.a(2)}},null,this,null,Promise)}},{key:"postImpression",value:function(t){var n,i,r,o,s,u;return k(function(l){for(;;)switch(l.n){case 0:return o=`device/${this.deviceID}/impression/`,s=null!==(n=t.id)&&void 0!==n?n:Yu(),u=m({},t,{id:s,impression_date:null!==(i=t.impression_date)&&void 0!==i?i:(new Date).toISOString()}),Po.setLastImpressionId(s),null===(r=e.impressionListener)||void 0===r||r.call(e,s,t.call_to_action),l.n=1,a(this.requestBodyAPI(o,u,"POST",!0));case 1:return l.a(2)}},null,this,null,Promise)}},{key:"patchImpressionCompletion",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`device/${this.deviceID}/impression/${e}/`,r.n=1,a(this.requestBodyAPI(i,{completion_result:t,completion_result_date:n},"PATCH",!0));case 1:return r.a(2)}},null,this,null,Promise)}},{key:"postConversion",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/transaction/`,n.n=1,a(this.requestBodyAPI(t,e,"POST",!0));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"purchaseValidation",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/purchase_event/`,n.n=1,a(this.requestBodyAPI(t,e,"PUT"));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"fetchAPI",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`${this.baseURL}/${this.platformID}/`+e,r.n=1,a(Iu(i,void 0,t,n));case 1:return r.a(2,r.v)}},null,this,null,Promise)}},{key:"requestBodyAPI",value:function(e,t,n="POST",i=!1,r,o){var s,u;return k(function(l){for(;;)switch(l.n){case 0:return s=`${this.baseURL}/${this.platformID}/`+e,u={method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:i},l.n=1,a(Iu(s,u,r,o));case 1:return l.a(2,l.v)}},null,this,null,Promise)}}],[{key:"configure",value:function(e){this.instance.configure(e)}},{key:"reset",value:function(){this.instance.reset()}}])}();function al(e){return null!=(null==e?void 0:e.flow)}il.instance=new il,ke([tl],il.prototype,"login",null),ke([tl],il.prototype,"logout",null),ke([tl],il.prototype,"startSession",null),ke([tl],il.prototype,"postImpression",null),ke([tl],il.prototype,"patchImpressionCompletion",null),ke([tl],il.prototype,"postConversion",null),ke([tl],il.prototype,"purchaseValidation",null),ke([el],il.prototype,"fetchAPI",null),ke([el],il.prototype,"requestBodyAPI",null),e.NamiCampaignRuleType=void 0,(nl=e.NamiCampaignRuleType||(e.NamiCampaignRuleType={})).DEFAULT="default",nl.JOURNEY="journey",nl.LABEL="label",nl.UNKNOWN="unknown",nl.URL="url";var rl=()=>{var e;return null!==(e=Po.getPaywalls(Mt))&&void 0!==e?e:[]},ol=()=>{var e;return null!==(e=Po.getPaywalls(mt))&&void 0!==e?e:[]},sl=()=>mo(zi([...ol(),...rl()]),"id"),ul=e=>sl().find(t=>t.id===e),ll=e=>{var t=sl(),n=new Set(t.map(e=>e.id));return e.every(e=>n.has(e))};function dl(e){return(t={})=>{var n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function cl(e){return(t,n)=>{var i;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,r=null!=n&&n.width?String(n.width):a;i=e.formattingValues[r]||e.formattingValues[a]}else{var o=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function hl(e){return(t,n={})=>{var i=n.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],r=t.match(a);if(!r)return null;var o,s=r[0],u=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(u,e=>e.test(s)):function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(u,e=>e.test(s));return o=e.valueCallback?e.valueCallback(l):l,{value:o=n.valueCallback?n.valueCallback(o):o,rest:t.slice(s.length)}}}function ml(e){var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}var fl={};function vl(){return fl}function pl(e,t){var n,i,a,r,o,s,u=vl(),l=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.weekStartsOn)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.weekStartsOn)&&void 0!==a?a:u.weekStartsOn)&&void 0!==i?i:null===(s=u.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==n?n:0,d=ml(e),c=d.getDay(),h=(c<l?7:0)+c-l;return d.setDate(d.getDate()-h),d.setHours(0,0,0,0),d}var gl,yl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},bl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wl={ordinalNumber:(e,t)=>{var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:cl({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:cl({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:cl({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:cl({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:cl({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},kl={ordinalNumber:(gl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{var n=e.match(gl.matchPattern);if(!n)return null;var i=n[0],a=e.match(gl.parsePattern);if(!a)return null;var r=gl.valueCallback?gl.valueCallback(a[0]):a[0];return{value:r=t.valueCallback?t.valueCallback(r):r,rest:e.slice(i.length)}}),era:hl({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:hl({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:hl({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:hl({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:hl({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},Sl={code:"en-US",formatDistance:(e,t,n)=>{var i,a=yl[e];return i="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:{date:dl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:dl({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:dl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:(e,t,n,i)=>bl[e],localize:wl,match:kl,options:{weekStartsOn:0,firstWeekContainsDate:1}},El=6048e5;function Pl(e){var t=ml(e);return t.setHours(0,0,0,0),t}function _l(e){var t=ml(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Tl(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Ml(e){var t,n,i,a,r,o,s=ml(e),u=(t=s,n=function(e){var t=ml(e),n=Tl(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(s),i=Pl(t),a=Pl(n),r=+i-_l(i),o=+a-_l(a),Math.round((r-o)/864e5));return u+1}function Al(e){return pl(e,{weekStartsOn:1})}function Dl(e){var t=ml(e),n=t.getFullYear(),i=Tl(e,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);var a=Al(i),r=Tl(e,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);var o=Al(r);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function xl(e){var t=ml(e),n=+Al(t)-+function(e){var t=Dl(e),n=Tl(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Al(n)}(t);return Math.round(n/El)+1}function Cl(e,t){var n,i,a,r,o,s,u=ml(e),l=u.getFullYear(),d=vl(),c=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.firstWeekContainsDate)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==a?a:d.firstWeekContainsDate)&&void 0!==i?i:null===(s=d.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1,h=Tl(e,0);h.setFullYear(l+1,0,c),h.setHours(0,0,0,0);var m=pl(h,t),f=Tl(e,0);f.setFullYear(l,0,c),f.setHours(0,0,0,0);var v=pl(f,t);return u.getTime()>=m.getTime()?l+1:u.getTime()>=v.getTime()?l:l-1}function Il(e,t){var n=ml(e),i=+pl(n,t)-+function(e,t){var n,i,a,r,o,s,u=vl(),l=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.firstWeekContainsDate)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==a?a:u.firstWeekContainsDate)&&void 0!==i?i:null===(s=u.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1,d=Cl(e,t),c=Tl(e,0);return c.setFullYear(d,0,l),c.setHours(0,0,0,0),pl(c,t)}(n,t);return Math.round(i/El)+1}function Ll(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}var Fl={y(e,t){var n=e.getFullYear(),i=n>0?n:1-n;return Ll("yy"===t?i%100:i,t.length)},M(e,t){var n=e.getMonth();return"M"===t?String(n+1):Ll(n+1,2)},d:(e,t)=>Ll(e.getDate(),t.length),a(e,t){var n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Ll(e.getHours()%12||12,t.length),H:(e,t)=>Ll(e.getHours(),t.length),m:(e,t)=>Ll(e.getMinutes(),t.length),s:(e,t)=>Ll(e.getSeconds(),t.length),S(e,t){var n=t.length,i=e.getMilliseconds();return Ll(Math.trunc(i*Math.pow(10,n-3)),t.length)}},Rl="midnight",Ol="noon",$l="morning",Nl="afternoon",Wl="evening",jl="night",Bl={G:function(e,t,n){var i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var i=e.getFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Fl.y(e,t)},Y:function(e,t,n,i){var a=Cl(e,i),r=a>0?a:1-a;return"YY"===t?Ll(r%100,2):"Yo"===t?n.ordinalNumber(r,{unit:"year"}):Ll(r,t.length)},R:function(e,t){return Ll(Dl(e),t.length)},u:function(e,t){return Ll(e.getFullYear(),t.length)},Q:function(e,t,n){var i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ll(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ll(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getMonth();switch(t){case"M":case"MM":return Fl.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Ll(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var a=Il(e,i);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):Ll(a,t.length)},I:function(e,t,n){var i=xl(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):Ll(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Fl.d(e,t)},D:function(e,t,n){var i=Ml(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):Ll(i,t.length)},E:function(e,t,n){var i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Ll(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Ll(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getDay(),a=0===i?7:i;switch(t){case"i":return String(a);case"ii":return Ll(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i,a=e.getHours();switch(i=12===a?Ol:0===a?Rl:a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i,a=e.getHours();switch(i=a>=17?Wl:a>=12?Nl:a>=4?$l:jl,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var i=e.getHours()%12;return 0===i&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Fl.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Fl.H(e,t)},K:function(e,t,n){var i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):Ll(i,t.length)},k:function(e,t,n){var i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):Ll(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fl.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Fl.s(e,t)},S:function(e,t){return Fl.S(e,t)},X:function(e,t,n){var i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Ul(i);case"XXXX":case"XX":return Hl(i);default:return Hl(i,":")}},x:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"x":return Ul(i);case"xxxx":case"xx":return Hl(i);default:return Hl(i,":")}},O:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zl(i,":");default:return"GMT"+Hl(i,":")}},z:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zl(i,":");default:return"GMT"+Hl(i,":")}},t:function(e,t,n){return Ll(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return Ll(e.getTime(),t.length)}};function zl(e,t=""){var n=e>0?"-":"+",i=Math.abs(e),a=Math.trunc(i/60),r=i%60;return 0===r?n+String(a):n+String(a)+t+Ll(r,2)}function Ul(e,t){return e%60==0?(e>0?"-":"+")+Ll(Math.abs(e)/60,2):Hl(e,t)}function Hl(e,t=""){var n=e>0?"-":"+",i=Math.abs(e);return n+Ll(Math.trunc(i/60),2)+t+Ll(i%60,2)}var Gl=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Vl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Kl={p:Vl,P:(e,t)=>{var n,i=e.match(/(P+)(p+)?/)||[],a=i[1],r=i[2];if(!r)return Gl(e,t);switch(a){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Gl(a,t)).replace("{{time}}",Vl(r,t))}},Yl=/^D+$/,Xl=/^Y+$/,ql=["D","DD","YY","YYYY"];function Jl(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t,n=ml(e);return!isNaN(Number(n))}var Ql=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Zl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ed=/^'([^]*?)'?$/,td=/''/g,nd=/[a-zA-Z]/;function id(e,t,n){var i,a,r,o,s,u,l,d,c,h,m,f,v,p,g=vl(),y=null!==(i=null!==(a=null==n?void 0:n.locale)&&void 0!==a?a:g.locale)&&void 0!==i?i:Sl,b=null!==(r=null!==(o=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(l=n.locale)||void 0===l||null===(l=l.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==s?s:g.firstWeekContainsDate)&&void 0!==o?o:null===(d=g.locale)||void 0===d||null===(d=d.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==r?r:1,w=null!==(c=null!==(h=null!==(m=null!==(f=null==n?void 0:n.weekStartsOn)&&void 0!==f?f:null==n||null===(v=n.locale)||void 0===v||null===(v=v.options)||void 0===v?void 0:v.weekStartsOn)&&void 0!==m?m:g.weekStartsOn)&&void 0!==h?h:null===(p=g.locale)||void 0===p||null===(p=p.options)||void 0===p?void 0:p.weekStartsOn)&&void 0!==c?c:0,k=ml(e);if(!Jl(k))throw new RangeError("Invalid time value");var S=t.match(Zl).map(e=>{var t=e[0];return"p"===t||"P"===t?(0,Kl[t])(e,y.formatLong):e}).join("").match(Ql).map(e=>{if("''"===e)return{isToken:!1,value:"'"};var t=e[0];if("'"===t)return{isToken:!1,value:ad(e)};if(Bl[t])return{isToken:!0,value:e};if(t.match(nd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});y.localize.preprocessor&&(S=y.localize.preprocessor(k,S));var E={firstWeekContainsDate:b,weekStartsOn:w,locale:y};return S.map(i=>{if(!i.isToken)return i.value;var a=i.value;return(null!=n&&n.useAdditionalWeekYearTokens||!function(e){return Xl.test(e)}(a))&&(null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return Yl.test(e)}(a))||function(e,t,n){var i=function(e,t,n){var i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),ql.includes(e))throw new RangeError(i)}(a,t,String(e)),(0,Bl[a[0]])(k,a,y.localize,E)}).join("")}function ad(e){var t=e.match(ed);return t?t[1].replace(td,"'"):e}function rd(e,t,n){var i,a=Object.assign({},vl()),r=function(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,null!==(i=n.locale)&&void 0!==i?i:a.locale);return"formatToParts"in r?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value;return}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(r,t)}function od(e,t){var n=function(e){ud[e]||(ud[e]=dd?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}));return ud[e]}(t);return"formatToParts"in n?function(e,t){try{for(var n=e.formatToParts(t),i=[],a=0;a<n.length;a++){var r=sd[n[a].type];void 0!==r&&(i[r]=parseInt(n[a].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}(n,e)}var sd={year:0,month:1,day:2,hour:3,minute:4,second:5};var ud={},ld=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),dd="06/25/2014, 00:00:00"===ld||"06/25/2014 00:00:00"===ld;function cd(e,t,n,i,a,r,o){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,a,r,o),s}var hd=36e5,md={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function fd(e,t,n){if(!e)return 0;var i,a,r=md.timezoneZ.exec(e);if(r)return 0;if(r=md.timezoneHH.exec(e))return pd(i=parseInt(r[1],10))?-i*hd:NaN;if(r=md.timezoneHHMM.exec(e)){i=parseInt(r[2],10);var o=parseInt(r[3],10);return pd(i,o)?(a=Math.abs(i)*hd+6e4*o,"+"===r[1]?-a:a):NaN}if(function(e){if(gd[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),gd[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return cd(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),u=vd(s,e),l=n?u:function(e,t,n){var i=e.getTime(),a=i-t,r=vd(new Date(a),n);if(t===r)return t;a-=r-t;var o=vd(new Date(a),n);if(r===o)return r;return Math.max(r,o)}(t,u,e);return-l}return NaN}function vd(e,t){var n=od(e,t),i=cd(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),a=e.getTime(),r=a%1e3;return i-(a-=r>=0?r:1e3+r)}function pd(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var gd={};var yd={X:function(e,t,n){var i=bd(n.timeZone,e);if(0===i)return"Z";switch(t){case"X":return Sd(i);case"XXXX":case"XX":return kd(i);default:return kd(i,":")}},x:function(e,t,n){var i=bd(n.timeZone,e);switch(t){case"x":return Sd(i);case"xxxx":case"xx":return kd(i);default:return kd(i,":")}},O:function(e,t,n){var i=bd(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t=""){var n=e>0?"-":"+",i=Math.abs(e),a=Math.floor(i/60),r=i%60;if(0===r)return n+String(a);return n+String(a)+t+wd(r,2)}(i,":");default:return"GMT"+kd(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return rd("short",e,n);default:return rd("long",e,n)}}};function bd(e,t){var n,i=e?fd(e,t,!0)/6e4:null!==(n=null==t?void 0:t.getTimezoneOffset())&&void 0!==n?n:0;if(Number.isNaN(i))throw new RangeError("Invalid time zone specified: "+e);return i}function wd(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function kd(e,t=""){var n=e>0?"-":"+",i=Math.abs(e);return n+wd(Math.floor(i/60),2)+t+wd(Math.floor(i%60),2)}function Sd(e,t){return e%60==0?(e>0?"-":"+")+wd(Math.abs(e)/60,2):kd(e,t)}function Ed(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}var Pd=36e5,_d=6e4,Td={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function Md(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var i=function(e){var t,n={},i=Td.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=Td.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var a=Td.timeZone.exec(t);a?(n.time=t.replace(a[1],""),n.timeZone=a[1].trim()):n.time=t}return n}(e),a=function(e,t){if(e){var n=Td.YYY[t],i=Td.YYYYY[t],a=Td.YYYY.exec(e)||i.exec(e);if(a){var r=a[1];return{year:parseInt(r,10),restDateString:e.slice(r.length)}}if(a=Td.YY.exec(e)||n.exec(e)){var o=a[1];return{year:100*parseInt(o,10),restDateString:e.slice(o.length)}}}return{year:null}}(i.date,n),r=a.year,o=function(e,t){if(null===t)return null;var n,i,a;if(!e||!e.length)return(n=new Date(0)).setUTCFullYear(t),n;var r=Td.MM.exec(e);if(r)return n=new Date(0),Id(t,i=parseInt(r[1],10)-1)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(r=Td.DDD.exec(e)){n=new Date(0);var o=parseInt(r[1],10);return function(e,t){if(t<1)return!1;var n=Cd(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,o)?(n.setUTCFullYear(t,0,o),n):new Date(NaN)}if(r=Td.MMDD.exec(e)){n=new Date(0),i=parseInt(r[1],10)-1;var s=parseInt(r[2],10);return Id(t,i,s)?(n.setUTCFullYear(t,i,s),n):new Date(NaN)}if(r=Td.Www.exec(e))return Ld(a=parseInt(r[1],10)-1)?Ad(t,a):new Date(NaN);if(r=Td.WwwD.exec(e)){a=parseInt(r[1],10)-1;var u=parseInt(r[2],10)-1;return Ld(a,u)?Ad(t,a,u):new Date(NaN)}return null}(a.restDateString,r);if(null===o||isNaN(o.getTime()))return new Date(NaN);if(o){var s,u=o.getTime(),l=0;if(i.time&&(null===(l=function(e){var t,n,i=Td.HH.exec(e);if(i)return Fd(t=parseFloat(i[1].replace(",",".")))?t%24*Pd:NaN;if(i=Td.HHMM.exec(e))return Fd(t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")))?t%24*Pd+n*_d:NaN;if(i=Td.HHMMSS.exec(e)){t=parseInt(i[1],10),n=parseInt(i[2],10);var a=parseFloat(i[3].replace(",","."));return Fd(t,n,a)?t%24*Pd+n*_d+1e3*a:NaN}return null}(i.time))||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(s=fd(i.timeZone||t.timeZone,new Date(u+l)),isNaN(s))return new Date(NaN)}else s=Ed(new Date(u+l)),s=Ed(new Date(u+l+s));return new Date(u+l+s)}return new Date(NaN)}function Ad(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var a=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+a),i}var Dd=[31,28,31,30,31,30,31,31,30,31,30,31],xd=[31,29,31,30,31,30,31,31,30,31,30,31];function Cd(e){return e%400==0||e%4==0&&e%100!=0}function Id(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=Cd(e);if(i&&n>xd[t])return!1;if(!i&&n>Dd[t])return!1}return!0}function Ld(e,t){return!(e<0||e>52)&&(null==t||!(t<0||t>6))}function Fd(e,t,n){return!(e<0||e>=25)&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var Rd=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Od(e,t,n,i){return function(e,t,n={}){var i=(t=String(t)).match(Rd);if(i){var a=Md(n.originalDate||e,n);t=i.reduce(function(e,t){if("'"===t[0])return e;var i=e.indexOf(t),r="'"===e[i-1],o=e.replace(t,"'"+yd[t[0]](a,t,n)+"'");return r?o.substring(0,i-1)+o.substring(i+1):o},t)}return id(e,t,n)}(function(e,t,n){var i=fd(t,e=Md(e,n),!0),a=new Date(e.getTime()-i),r=new Date(0);return r.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),r.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),r}(e,t,{timeZone:(i=m({},i,{timeZone:t,originalDate:e})).timeZone}),n,i)}var $d=e=>{try{return!isNaN(new Date(e).getTime())}catch(e){return!1}},Nd=(e,t,n=new Date)=>{var i=n.getTime(),a=!e||!$d(e)||new Date(e).getTime()<i,r=!t||!$d(t)||new Date(t).getTime()>i;return a&&r},Wd=["app_install","session_start"],jd=["flow_completed","user_context_set"],Bd=["high","medium","low"],zd=(e,t)=>e.includes(t)?t:null,Ud=e=>"number"==typeof e?e:null;function Hd(e){var t,n,i,a,r,o;if(!e)return null;var s="object"in e?null!==(t=e.object)&&void 0!==t?t:{}:e,u=s.goal,l=s.delivery;return{journey_id:"string"==typeof e.journey_id?e.journey_id:"",category:null!==(n=s.category)&&void 0!==n?n:null,priority:null!==(i=zd(Bd,s.priority))&&void 0!==i?i:"medium",trigger:{event_type:zd(Wd,null===(a=s.trigger)||void 0===a?void 0:a.event_type)},goal:u?{type:zd(jd,u.type),context_key:null!==(r=u.context_key)&&void 0!==r?r:null,timeout_days:Ud(u.timeout_days),re_eligibility_days:Ud(u.re_eligibility_days),re_entry_after_goal:!0===u.re_entry_after_goal}:null,delivery:{show_once:!0===(null==l?void 0:l.show_once),max_impressions_total:Ud(null==l?void 0:l.max_impressions_total),max_per_session:Ud(null==l?void 0:l.max_per_session),max_per_day:Ud(null==l?void 0:l.max_per_day),delay_seconds:null!==(o=Ud(null==l?void 0:l.delay_seconds))&&void 0!==o?o:0}}}function Gd(e){var t;return!(!e||!e.journey_id.trim())&&(!(!e.trigger.event_type||null===(t=e.goal)||void 0===t||!t.type)&&("user_context_set"!==e.goal.type||!!e.goal.context_key))}var Vd=t=>t.type===e.NamiCampaignRuleType.JOURNEY,Kd=e=>Vd(e)?Hd(e.journey):null;function Yd(e){return!Vd(e)||null!=e.flow&&Gd(Hd(e.journey))}var Xd,qd=e=>{try{var t=new URL(e);return("http:"===t.protocol||"https:"===t.protocol)&&!!t.hostname}catch(e){return!1}},Jd=e=>{try{var t=new URL(e),n=t.origin+t.pathname,i=new Set;return t.searchParams.forEach((e,t)=>{i.add(`${t}=${e}`)}),{basePath:n,params:i}}catch(e){return}},Qd=(e,t,n)=>{if(!e)return[];var i=e.filter(e=>!Array.isArray(e.segments)).length;return i>0&&Bi.warn(`Skipping ${i} of ${e.length} campaign rules with no segments array`),e.flatMap(e=>{if(!Array.isArray(e.segments))return[];var i;if(i="string"==typeof n?e.segments.filter(e=>e.form_factors.some(e=>e.form_factor===n)):e.segments,0===i.length)return[];var a=((e,t)=>{for(var n,i=[...e].sort((e,t)=>e.split-t.split),a=h(i);!(n=a()).done;){var r=n.value;if(t<=r.split)return r}return i[i.length-1]})(i,t),r={form_factors:a.form_factors,paywall:a.paywall,paywall_url:a.paywall_url,page_urls:a.page_urls,flow:a.flow,segment:a.segment,split:a.split,conversion_event_type:a.conversion_event_type,conversion_event_url:a.conversion_event_url,rule:e.rule,name:e.name,type:e.type,value:e.value,external_segment:e.external_segment,not_before:e.not_before,expires_at:e.expires_at,journey:e.journey};return Yd(r)?r:(Bi.debug(`Skipping unsupported journey rule ${e.rule}`),[])})},Zd=e=>{var t=Ku();return zi(e).filter(e=>{var n;return null===(n=e.form_factors)||void 0===n?void 0:n.some(e=>e.form_factor===t)}).filter(e=>Nd(e.not_before,e.expires_at))},ec=(e,t)=>{var n=new Set;return e.filter(e=>{var i=t(e);return!n.has(i)&&(n.add(i),!0)})},tc=()=>{var e,t;return[...null!==(e=Po.getCampaignRules(ct))&&void 0!==e?e:[],...null!==(t=Po.getCampaignRules(_t))&&void 0!==t?t:[]]},nc=()=>ec(Zd(tc()).filter(e=>!Vd(e)),e=>{var t,n;return`${null!==(t=e.type)&&void 0!==t?t:""}::${null!==(n=e.value)&&void 0!==n?n:""}`}),ic=()=>ec(Zd(tc()).filter(Vd),e=>e.rule),ac=e=>{var t;return Zd(null!==(t=Po.getCampaignRules(e))&&void 0!==t?t:[]).filter(e=>!Vd(e))},rc=()=>ac(_t),oc=()=>ac(ct),sc=(t,n,i,a)=>{var r=(()=>{if(!a)return t().find(t=>t.type==e.NamiCampaignRuleType.DEFAULT);if(a===e.NamiCampaignRuleType.URL){var n=t().filter(t=>t.type==e.NamiCampaignRuleType.URL);return((e,t)=>{var n,i,a,r=Jd(e);if(r){for(var o,s,u,l=h(t);!(u=l()).done;){var d=u.value,c=d.value;if(c){var m=Jd(c);if(m&&m.basePath===r.basePath){var f=m.params.size;if(0!==f){for(var v,p=0,g=h(m.params);!(v=g()).done;){var y=v.value;r.params.has(y)&&p++}p===f?(!o||f>o.totalParams)&&(o={campaign:d,totalParams:f}):o||(!s||p>s.score||p===s.score&&f>s.totalParams)&&(s={campaign:d,score:p,totalParams:f})}else o||s||(s={campaign:d,score:0,totalParams:0})}}}return null!==(n=null===(i=o)||void 0===i?void 0:i.campaign)&&void 0!==n?n:null===(a=s)||void 0===a?void 0:a.campaign}})(i,n)}return t().find(e=>e.type==a&&e.value==i)})();if(!r)return{};var o=n().find(e=>(null==r?void 0:r.paywall)===e.id);return{campaign:r,paywall:o}},uc=(e,t)=>{var n=sc(oc,ol,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=sc(rc,rl,e,t);return i.campaign&&i.paywall?{campaign:i.campaign,paywall:i.paywall}:n.campaign||n.paywall?{campaign:n.campaign,paywall:n.paywall}:{campaign:i.campaign,paywall:i.paywall}},lc="object"==typeof Reflect?Reflect:null,dc=lc&&"function"==typeof lc.apply?lc.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Xd=lc&&"function"==typeof lc.ownKeys?lc.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var cc=Number.isNaN||function(e){return e!=e};function hc(){hc.init.call(this)}hc.EventEmitter=hc,hc.prototype._events=void 0,hc.prototype._eventsCount=0,hc.prototype._maxListeners=void 0;var mc=10;function fc(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function vc(e){return void 0===e._maxListeners?hc.defaultMaxListeners:e._maxListeners}function pc(e,t,n,i){var a,r,o,s;if(fc(n),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),r=e._events),o=r[t]),void 0===o)o=r[t]=n,++e._eventsCount;else if("function"==typeof o?o=r[t]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(a=vc(e))>0&&o.length>a&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function gc(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function yc(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=gc.bind(i);return a.listener=n,i.wrapFn=a,a}function bc(e,t,n){var i=e._events;if(void 0===i)return[];var a=i[t];return void 0===a?[]:"function"==typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(a):kc(a,a.length)}function wc(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function kc(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(hc,"defaultMaxListeners",{enumerable:!0,get:function(){return mc},set:function(e){if("number"!=typeof e||e<0||cc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");mc=e}}),hc.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},hc.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||cc(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},hc.prototype.getMaxListeners=function(){return vc(this)},hc.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var r;if(t.length>0&&(r=t[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var s=a[e];if(void 0===s)return!1;if("function"==typeof s)dc(s,this,t);else for(var u=s.length,l=kc(s,u),d=0;d<u;++d)dc(l[d],this,t);return!0},hc.prototype.addListener=function(e,t){return pc(this,e,t,!1)},hc.prototype.on=hc.prototype.addListener,hc.prototype.prependListener=function(e,t){return pc(this,e,t,!0)},hc.prototype.once=function(e,t){return fc(t),this.on(e,yc(this,e,t)),this},hc.prototype.prependOnceListener=function(e,t){return fc(t),this.prependListener(e,yc(this,e,t)),this},hc.prototype.removeListener=function(e,t){var n,i,a,r,o;if(fc(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(a=-1,r=n.length-1;r>=0;r--)if(n[r]===t||n[r].listener===t){o=n[r].listener,a=r;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,a),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},hc.prototype.off=hc.prototype.removeListener,hc.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var a,r=Object.keys(n);for(i=0;i<r.length;++i)"removeListener"!==(a=r[i])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},hc.prototype.listeners=function(e){return bc(this,e,!0)},hc.prototype.rawListeners=function(e){return bc(this,e,!1)},hc.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):wc.call(e,t)},hc.prototype.listenerCount=wc,hc.prototype.eventNames=function(){return this._eventsCount>0?Xd(this._events):[]};var Sc=function(){function e(){o(this,e),this.emitter=new hc}return c(e,[{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"emit",value:function(e,...t){this.emitter.emit(e,...t)}},{key:"addListener",value:function(e,t){this.emitter.addListener(e,t)}},{key:"removeListener",value:function(e,t){this.emitter.removeListener(e,t)}},{key:"removeAllListeners",value:function(e){e?this.emitter.removeAllListeners(e):this.emitter.removeAllListeners()}},{key:"listeners",value:function(e){return this.emitter.listeners(e)}},{key:"listenerCount",value:function(e){return this.emitter.listenerCount(e)}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}])}(),Ec=function(){return c(function e(){o(this,e),this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1,this.isUsableOnDevice=e=>{var t;return!(!e.paywall&&!e.flow)&&(!(null===(t=e.form_factors)||void 0===t||!t.some(e=>e.form_factor===this.currentFormFactor))&&(!!Yd(e)||(Bi.debug(`Skipping unsupported journey rule ${e.rule}`),!1)))},this.currentFormFactor=Ku()},[{key:"configure",value:function(e,t,n=[]){this.currentFormFactor=e,this.splitPosition=t,this.disableCampaignUpdates=n.includes("disableCampaignUpdates"),this.useLegacyPaywallFetch=n.includes("useLegacyPaywallFetch")}},{key:"reset",value:function(){this.currentFormFactor=Ku(),this.splitPosition=void 0,this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1}},{key:"fetchCampaignRules",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(i=Po.getDevice(),!this.disableCampaignUpdates){o.n=1;break}return Bi.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,[]);case 1:if(null!=i&&i.id){o.n=3;break}return o.n=2,a(this.getAnonymousCampaigns());case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.getCampaigns(i.id));case 4:r=o.v;case 5:return r=null===(t=r)||void 0===t?void 0:t.filter(this.isUsableOnDevice),r=null===(n=r)||void 0===n?void 0:n.filter(t=>{if(t.paywall){var n=e.find(e=>e.id==t.paywall);if(n)return t}else if(t.flow)return t}),Po.setCampaignRules(ct,r),Po.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),o.a(2,r)}},null,this,null,Promise)}},{key:"fetchCampaignRulesRaw",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(!this.disableCampaignUpdates){o.n=1;break}return Bi.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,{campaigns:[],fromNetwork:!1});case 1:if(null==(t=Po.getDevice())||!t.id){o.n=3;break}return o.n=2,a(this.fetchCampaigns(t.id));case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.fetchAnonymousCampaigns());case 4:r=o.v;case 5:return i=null===(e=(n=r).campaigns)||void 0===e?void 0:e.filter(this.isUsableOnDevice),o.a(2,{campaigns:i,fromNetwork:n.fromNetwork})}},null,this,null,Promise)}},{key:"finalizeCampaignRules",value:function(e,t){var n=new Set([...t.map(e=>e.id),...rl().map(e=>e.id)]),i=null==e?void 0:e.filter(e=>{return e.paywall?t.find(t=>t.id==e.paywall):!!e.flow&&(!!e.flow.object&&(null!==(i=e.flow.object.screens)&&void 0!==i?i:[]).every(e=>n.has(e)));var i});return Po.setCampaignRules(ct,i),Po.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),i}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=Sc.getInstance().listeners(Ei),t=nc();e.forEach(e=>e(t))}},{key:"getAnonymousCampaigns",value:function(e=Le){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchAnonymousCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"getCampaigns",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"fetchAnonymousCampaigns",value:function(e=Le){var t,n,i,r,o;return k(function(s){for(;;)switch(s.p=s.n){case 0:return t=`campaign_rules/?sdk_version=${e}`,s.p=1,s.n=2,a(il.instance.fetchAPI(t));case 2:return i=s.v,s.a(2,{campaigns:Qd(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor),fromNetwork:!0});case 3:if(s.p=3,o=s.v,r=this.fallbackData()){s.n=4;break}throw Bi.error(zo(o.status,t)),o;case 4:return s.a(2,{campaigns:r.results,fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fetchCampaigns",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return t=`device/${e}/campaign_rules/`,o.p=1,o.n=2,a(il.instance.fetchAPI(t));case 2:return n=o.v,o.a(2,{campaigns:(null==n?void 0:n.results)||[],fromNetwork:!0});case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Bi.error(zo(r.status,t)),r;case 4:return o.a(2,{campaigns:i.results||[],fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Po.getCampaignRules(ct)||Po.getCampaignRules(_t);return e?{count:e.length,results:e}:null}}],[{key:"extractPaywallUrls",value:function(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a,r=t.value;r.paywall_url&&n.push(r.paywall_url),r.page_urls&&n.push(...Object.values(r.page_urls)),null!==(a=r.flow)&&void 0!==a&&a.page_urls&&n.push(...Object.values(r.flow.page_urls))}return n}},{key:"hasPaywallUrls",value:function(e){return e.some(e=>{var t;return e.paywall_url||e.page_urls||(null===(t=e.flow)||void 0===t?void 0:t.page_urls)})}}])}();function Pc(e,t){return $r(e,t)}Ec.instance=new Ec;var _c=function(){return c(function e(){o(this,e)},[{key:"createOrUpdateDevice",value:function(e,t,n){var i=Po.getDevice();if(null==i||!i.id){var a,r=m({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:Yu()});return{id:r.id,device:this.createDevice(r,n)}}return this.isEqualDevices(i,e)?{id:i.id,device:Promise.resolve(i)}:(this.updateDevice(i.id,e),{id:i.id,device:null})}},{key:"createDevice",value:function(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,a(this.requestAPIData("device/",e,void 0,void 0,0));case 1:if(!(n=r.v)){r.n=2;break}Po.setDevice(n),r.n=3;break;case 2:return Bi.info("Device creation returned null, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),r.a(2,null);case 3:return r.a(2,n);case 4:if(r.p=4,i=r.v,console.error("Error creating device:",i),!(i instanceof _o)){r.n=5;break}return Bi.info("Retry limit exceeded, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),r.a(2,null);case 5:throw i;case 6:return r.a(2)}},null,this,[[0,4]],Promise)}},{key:"updateDevice",value:function(e,t){var n;return k(function(i){for(;;)switch(i.n){case 0:return i.n=1,a(this.requestAPIData(`device/${e}/`,t,"PUT"));case 1:return(n=i.v)&&Po.setDevice(n),i.a(2,n)}},null,this,null,Promise)}},{key:"updateDeviceField",value:function(e,t){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(n={[e]:t},null!=(i=Po.getDevice())&&i.id){o.n=1;break}throw new xo;case 1:return o.n=2,a(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(r=o.v)&&Po.setDevice(r),o.a(2,r)}},null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=Zn,r){var o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:return u.p=0,u.n=1,a(il.instance.requestBodyAPI(e,t,n,!1,i,r));case 1:o=u.v,u.n=5;break;case 2:if(u.p=2,!((s=u.v)instanceof Do)){u.n=3;break}throw s;case 3:if(!("device/"===e&&s instanceof _o)){u.n=4;break}throw s;case 4:if(o=Po.getDevice()){u.n=5;break}return Bi.error(zo(s.status,e)),u.a(2,null);case 5:return u.a(2,o)}},null,null,[[0,2]],Promise)}},{key:"isEqualDevices",value:function(e,t){var n=m({},e,t),i=Object.keys(e).reduce((e,t)=>(e[t]=n[t],e),{});return Pc(i,e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=Po.getAnonymousUUID();return e||(e=Yu(),Po.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=Po.getAnonymousUUID();return e?(Po.clearAnonymousUUID(),e):null}}])}();_c.instance=new _c;var Tc=function(){return c(function e(){o(this,e)},[{key:"fetchProducts",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(!gu(Pe.THIRD_PARTY_TRANSACTIONS)){r.n=1;break}return r.a(2,[]);case 1:return r.p=1,r.n=2,a(il.instance.fetchAPI("products/"));case 2:n=r.v,r.n=4;break;case 3:if(r.p=3,i=r.v,n=this.fallbackData()){r.n=4;break}throw Bi.error(zo(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&Po.setProducts(gt,n.results),r.a(2,(null===(t=n)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Po.getProducts(gt)||Po.getProducts(Dt);return e?{count:e.length,results:e}:null}}])}();Tc.instance=new Tc;var Mc=3,Ac=200,Dc=2e3,xc=5e3,Cc=2e4,Ic=new Set([408,425,429]),Lc=new Set(["ECONNRESET","ECONNREFUSED","ENOTFOUND","ETIMEDOUT"]),Fc=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[`CDN fetch failed with non-retryable status ${e} for ${n}`])).name="NonRetryableHttpError",i.status=e,i.url=n,i}return p(t,e),c(t)}(M(Error)),Rc=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t,[`CDN fetch exhausted ${n} attempts for ${e}${void 0!==i?` (last status ${i})`:""}`])).name="RetryExhaustedError",a.url=e,a.attempts=n,a.lastStatus=i,a}return p(t,e),c(t)}(M(Error));function Oc(e,t){if("number"==typeof t)return Ic.has(t)||t>=500;if(e&&"object"==typeof e){var n=e;if("AbortError"===n.name)return!0;if(n.code&&Lc.has(n.code))return!0;if(e instanceof TypeError)return!0}return!1}function $c(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return n=new AbortController,i=setTimeout(()=>n.abort(),t),r.p=1,r.n=2,a(xu(e,{method:"GET"},"cdn",()=>fetch(e,{signal:n.signal})));case 2:return r.a(2,r.v);case 3:return r.p=3,clearTimeout(i),r.f(3);case 4:return r.a(2)}},null,null,[[1,,3,4]],Promise)}var Nc=e=>new Promise(t=>setTimeout(t,e));function Wc(e,t={}){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return o.n=1,a(jc(e,t));case 1:return n=o.v,i=n.data,r=n.retryCount,o.a(2,{data:JSON.parse(i),retryCount:r})}},null,null,null,Promise)}function jc(e,t={}){var n,i,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,S,E,P,_,T,M,A,D,x,C,I,L,F;return k(function(k){for(;;)switch(k.p=k.n){case 0:d=null!==(n=t.maxAttempts)&&void 0!==n?n:Mc,c=null!==(i=t.baseDelayMs)&&void 0!==i?i:Ac,h=null!==(r=t.maxDelayMs)&&void 0!==r?r:Dc,m=null!==(o=t.budgetMs)&&void 0!==o?o:Cc,f=null!==(s=t.timeoutMs)&&void 0!==s?s:xc,v=null!==(u=t.randomFn)&&void 0!==u?u:Math.random,p=null!==(l=t.sleepFn)&&void 0!==l?l:Nc,g=ku(),y=Su(),b=Date.now(),w=0;case 1:if(!(w<d)){k.n=16;break}if(!(w>0)){k.n=4;break}if(!((P=Date.now()-b)>=m)){k.n=2;break}return k.a(3,16);case 2:return _=Math.min(c*Math.pow(2,w-1),h),T=_*(v()-.5),M=Math.max(0,m-P),A=Math.min(Math.max(0,_+T),M),k.n=3,a(p(A));case 3:if(!(Date.now()-b>=m)){k.n=4;break}return k.a(3,16);case 4:return k.p=4,(g||y)&&Bi.debug(`[HTTP] GET ${e} (cdn attempt ${w+1}/${d})`),k.n=5,a($c(e,f));case 5:if((D=k.v).ok){k.n=9;break}if(!y){k.n=7;break}return k.n=6,a(D.clone().text());case 6:x=k.v,Bi.debug(`[HTTP] Response ${D.status}: ${x}`);case 7:if(S=D.status,!Oc(void 0,D.status)){k.n=8;break}return w++,k.a(3,1);case 8:throw new Fc(D.status,e);case 9:if(!y){k.n=11;break}return k.n=10,a(D.clone().text());case 10:C=k.v,Bi.debug(`[HTTP] Response ${D.status}: ${C}`);case 11:return k.n=12,a(D.text());case 12:return I=k.v,L=w,k.a(2,{data:I,retryCount:L});case 13:if(k.p=13,!((F=k.v)instanceof Fc)){k.n=14;break}throw F;case 14:if(!Oc(F)){k.n=15;break}return E=F,w++,k.a(3,1);case 15:throw F;case 16:if(void 0!==S||void 0===E){k.n=17;break}throw E;case 17:throw new Rc(e,w,S);case 18:return k.a(2)}},null,null,[[4,13]],Promise)}function Bc(e){var t=e.split("#")[0].split("?")[1];if(t)for(var n,i=h(t.split("&"));!(n=i()).done;){var a=n.value,r=a.indexOf("=");if("content_hash"===(-1===r?a:a.slice(0,r)))return(-1===r?"":a.slice(r+1))||void 0}}function zc(e){var t=e.split(/[?#]/)[0],n=/\/paywall\/([^/]+)/.exec(t);return n?n[1]:void 0}var Uc=function(){return c(function e(t=wo){o(this,e),this.bodyCache=t},[{key:"fetchPaywalls",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(null!=(e=Po.getDevice())&&e.id){i.n=2;break}return i.n=1,a(this.getAnonymousPaywalls());case 1:t=i.v,i.n=4;break;case 2:return i.n=3,a(this.getPaywalls(e.id));case 3:t=i.v;case 4:if(!t){i.n=5;break}return(n=this.validatePaywalls(t)).length>0&&Po.setPaywalls(mt,n),i.a(2,n);case 5:return i.a(2,t)}},null,this,null,Promise)}},{key:"getAnonymousPaywalls",value:function(e=Le){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`paywalls/?sdk_version=${e}`,i=null,o.p=1,o.n=2,a(il.instance.fetchAPI(n));case 2:i=o.v,o.n=4;break;case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Bi.error(zo(r.status,n)),r;case 4:return o.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"getPaywalls",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`device/${e}/paywalls/`,o.p=1,o.n=2,a(il.instance.fetchAPI(n));case 2:i=o.v,o.n=4;break;case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Bi.error(zo(r.status,n)),r;case 4:return o.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"resolvePaywallsByUrls",value:function(e){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return t=[...new Set(e)],n=yu(),this.bodyCache.evaluateTtl(n),s.n=1,a(Promise.all(t.map(e=>this.resolvePaywall(e,n))));case 1:return i=s.v,r={paywalls:[],urls:t.length,hashed:t.filter(e=>void 0!==Bc(e)).length,cacheHits:0,fetched:0,cacheAfterFetchFailure:0,failed:0,retryCount:0,renewableUrls:[]},o=new Map,i.forEach((e,n)=>{r.retryCount+=e.retryCount,e.paywall?(o.set(e.paywall,t[n]),"cacheHit"===e.paywall.fetchSource?(r.cacheHits+=1,Bc(t[n])&&r.renewableUrls.push(t[n])):"cacheAfterFetchFailure"===e.paywall.fetchSource?r.cacheAfterFetchFailure+=1:r.fetched+=1):r.failed+=1}),r.paywalls=this.validatePaywalls([...o.keys()]),r.paywalls.length>0&&Po.setApiPaywallsFromBodyCache(r.paywalls.map(e=>o.get(e))),s.a(2,r)}},null,this,null,Promise)}},{key:"renewCacheHits",value:function(e){this.bodyCache.renew(e.renewableUrls,yu())}},{key:"seedFromInitialConfig",value:function(e,t){var n=new Map(t.map(e=>[e.id,e]));this.bodyCache.evaluateTtl(yu());for(var i,a=0,r=0,o=h(new Set(function(e){for(var t,n=[],i=h(e);!(t=i()).done;)for(var a,r=h(null!==(o=t.value.segments)&&void 0!==o?o:[]);!(a=r()).done;){var o,s,u=a.value;u.paywall_url&&n.push(u.paywall_url),u.page_urls&&n.push(...Object.values(u.page_urls)),null!==(s=u.flow)&&void 0!==s&&s.page_urls&&n.push(...Object.values(u.flow.page_urls))}return n}(e)));!(i=o()).done;){var s=i.value,u=Bc(s),l=zc(s),d=l?n.get(l):void 0;u&&d&&(a+=1,this.bodyCache.seedIfAbsent(s,u,JSON.stringify(d))&&(r+=1))}Bi.info(`Paywall body cache seeded from initial config: seeded=${r}, candidates=${a}`)}},{key:"resolvePaywall",value:function(e,t){var n,i,r,o,s,u,l;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(!(n=Bc(e))){d.n=1;break}if(!(i=this.decodeCached(e,t))){d.n=1;break}return d.a(2,{paywall:Gc(i,"cacheHit",n),retryCount:0});case 1:return r=0,d.p=2,d.n=3,a(this.fetchPaywallText(e));case 3:if(o=d.v,r=o.retryCount,!(s=Hc(o.data))){d.n=4;break}return this.bodyCache.store(e,n,o.data),d.a(2,{paywall:Gc(s,"fetched",n),retryCount:r});case 4:Bi.error(`Paywall body from ${e} is not a decodable paywall`),d.n=6;break;case 5:d.p=5,l=d.v,Bi.error(`Failed to fetch individual paywall: ${l}`);case 6:if(!(u=this.decodeCached(e,t))){d.n=7;break}return Bi.warn(`Serving the cached body for ${e} after fetch failure (within campaign_cache_ttl)`),d.a(2,{paywall:Gc(u,"cacheAfterFetchFailure",n),retryCount:r});case 7:return d.a(2,{retryCount:r})}},null,this,[[2,5]],Promise)}},{key:"decodeCached",value:function(e,t){var n=this.bodyCache.validEntry(e,t);if(n){var i=Hc(n.body);return i||(Bi.warn(`Deleting an undecodable cached paywall body for ${e}`),this.bodyCache.remove(e)),i}}},{key:"fetchPaywallText",value:function(e){var t;return null!==(t=Po.getNamiConfig())&&void 0!==t&&null!==(t=t.namiCommands)&&void 0!==t&&t.includes($n)?(Bi.warn(`${$n}: failing the fetch for ${e} before the network`),Promise.reject(new Rc(e,0))):jc(e)}},{key:"validatePaywalls",value:function(e){return e.filter(e=>{var t,n=null===(t=e.template)||void 0===t?void 0:t.pages;return!(!Array.isArray(n)||0===n.length)||(Bi.warn(`Dropping paywall "${e.id}" from cache: template.pages is missing or empty`),!1)})}},{key:"fallbackData",value:function(){var e=Po.getPaywalls(mt)||Po.getPaywalls(Mt);return e?{count:e.length,results:e}:null}}])}();function Hc(e){try{var t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:void 0}catch(e){return}}function Gc(e,t,n){return m({},e,{fetchSource:t},n?{contentHash:n}:{})}Uc.instance=new Uc;var Vc=function(){return c(function e(){o(this,e)},[{key:"fetchConfig",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(null===(e=Po.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e||!e.includes(Ln)){o.n=1;break}throw new _o(vi,Ln);case 1:return i=null===(t=Po.getNamiConfig())||void 0===t?void 0:t.appPlatformID,o.n=2,a(il.instance.fetchAPI("config/",ii,0));case 2:return r=o.v,(null===(n=Po.getNamiConfig())||void 0===n?void 0:n.appPlatformID)===i?Po.setAppConfig(lt,r):Bi.debug("Discarding an app config response for a platform that is no longer configured"),o.a(2,r)}},null,null,null,Promise)}},{key:"fetchConfigForStartup",value:function(e){var t,n,i,r,o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:if(!e){u.n=1;break}return u.a(2,this.startupOnInitialConfig());case 1:t=ti,i=1;case 2:if(!(i<=t)){u.n=7;break}return i>1&&Bi.debug(`Retrying app config fetch (attempt ${i} of ${t})`),u.p=3,o=Kc,u.n=4,a(this.fetchConfig());case 4:return u.a(2,o(u.v));case 5:u.p=5,s=u.v,n=s;case 6:i++,u.n=2;break;case 7:if(!(r=Po.getAppConfig(lt))){u.n=9;break}if(Yc(r)){u.n=8;break}return u.a(2,{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"});case 8:return Bi.info(`App config fetch failed after ${t} attempts - continuing on the cached config`),u.a(2,{usable:!0});case 9:return u.a(2,{usable:!1,reason:`app config fetch failed after ${t} attempts (${Xc(n)}) and no initial or cached config is available`})}},null,this,[[3,5]],Promise)}},{key:"startupOnInitialConfig",value:function(){var e=Po.getAppConfig(lt);return this.fetchConfig().then(e=>{Yc(e)||Bi.warn("App config does not grant the 'sdk' capability - it takes effect from the next launch")},e=>{Bi.info(`App config fetch failed (${Xc(e)}). Initial config is available. Skipping retry.`)}),e&&!Yc(e)?{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"}:{usable:!0}}}])}();function Kc(e){return Yc(e)?{usable:!0}:{usable:!1,reason:"app config does not grant the 'sdk' capability"}}function Yc(e){var t,n;return null!==(t=null===(n=e.capabilities)||void 0===n?void 0:n.includes(Pe.SDK))&&void 0!==t&&t}function Xc(e){var t=null==e?void 0:e.status;return"number"==typeof t?`HTTP ${t}`:e instanceof Error?e.message:String(e)}Vc.instance=new Vc;var qc=null;function Jc(){qc&&qc.setInMemoryAnonymousMode(!1)}function Qc(){return!!Po.getAnonymousMode()||!!qc&&qc.isInMemoryAnonymousMode()}var Zc=function(){return c(function e(){o(this,e)},[{key:"startSession",value:function(){var e;return k(function(t){for(;;)switch(t.p=t.n){case 0:if(!Qc()){t.n=1;break}return Bi.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,a(il.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,Bi.error("error on start session: ",e);case 4:return t.a(2)}},null,null,[[1,3]],Promise)}}])}();Zc.instance=new Zc;var eh=function(){return c(function e(){o(this,e)},null,[{key:"allPurchases",value:function(){return[]}}])}();eh.instance=new eh;var th={en:{nami_day:"day",nami_day_plural:"days",nami_week:"week",nami_week_plural:"weeks",nami_month:"month",nami_month_plural:"months",nami_year:"year",nami_year_plural:"years",nami_day_abbrev:"day",nami_day_abbrev_plural:"days",nami_week_abbrev:"wk",nami_week_abbrev_plural:"wks",nami_month_abbrev:"mo",nami_month_abbrev_plural:"mos",nami_year_abbrev:"yr",nami_year_abbrev_plural:"yrs",nami_daily:"daily",nami_weekly:"weekly",nami_biweekly:"bi-weekly",nami_monthly:"monthly",nami_bimonthly:"bi-monthly",nami_quarterly:"quarterly",nami_biannually:"bi-annually",nami_yearly:"yearly"},af:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dae",nami_week_abbrev:"week",nami_week_abbrev_plural:"weke",nami_month_abbrev:"ma",nami_month_abbrev_plural:"maande",nami_year_abbrev:"jr",nami_year_abbrev_plural:"jare",nami_daily:"daagliks",nami_weekly:"weekliks",nami_biweekly:"tweeweekliks",nami_monthly:"maandeliks",nami_bimonthly:"tweemaandeliks",nami_quarterly:"kwartaalliks",nami_biannually:"tweejaarliks",nami_yearly:"jaarliks"},am:{nami_day_abbrev:"ቀን",nami_day_abbrev_plural:"ቀናት",nami_week_abbrev:"ሳምንት",nami_week_abbrev_plural:"ሳምንታት",nami_month_abbrev:"ወር",nami_month_abbrev_plural:"ሞስ",nami_year_abbrev:"ዓመት",nami_year_abbrev_plural:"ዓመታት",nami_daily:"በየቀኑ",nami_weekly:"ሳምንታዊ",nami_biweekly:"በየሁለት ሳምንቱ",nami_monthly:"ወርሃዊ",nami_bimonthly:"በየሁለት ወሩ",nami_quarterly:"በየሩብ ዓመቱ",nami_biannually:"በየሁለት ዓመቱ",nami_yearly:"ዓመታዊ"},ar:{nami_day_abbrev:"يوم",nami_day_abbrev_plural:"أيام",nami_week_abbrev:"أسبوع",nami_week_abbrev_plural:"أسابيع",nami_month_abbrev:"شهر",nami_month_abbrev_plural:"موس",nami_year_abbrev:"سنة",nami_year_abbrev_plural:"سنوات",nami_daily:"يوميًا",nami_weekly:"أسبوعي",nami_biweekly:"كل أسبوعين",nami_monthly:"شهريا",nami_bimonthly:"كل شهرين",nami_quarterly:"ربع سنوي",nami_biannually:"مرتين في السنة",nami_yearly:"سنوي"},bg:{nami_day_abbrev:"ден",nami_day_abbrev_plural:"дни",nami_week_abbrev:"седмица",nami_week_abbrev_plural:"седмици",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год.",nami_year_abbrev_plural:"години",nami_daily:"ежедневно",nami_weekly:"седмично",nami_biweekly:"двуседмичен",nami_monthly:"месечно",nami_bimonthly:"двумесечно",nami_quarterly:"тримесечно",nami_biannually:"два пъти годишно",nami_yearly:"годишно"},ca:{nami_day_abbrev:"dia",nami_day_abbrev_plural:"dies",nami_week_abbrev:"setmana",nami_week_abbrev_plural:"setmanes",nami_month_abbrev:"mes",nami_month_abbrev_plural:"mesos",nami_year_abbrev:"any",nami_year_abbrev_plural:"anys",nami_daily:"diàriament",nami_weekly:"setmanal",nami_biweekly:"quinzenal",nami_monthly:"mensual",nami_bimonthly:"bimensual",nami_quarterly:"trimestral",nami_biannually:"bianualment",nami_yearly:"anual"},cs:{nami_day_abbrev:"den",nami_day_abbrev_plural:"dny",nami_week_abbrev:"týden",nami_week_abbrev_plural:"týdny",nami_month_abbrev:"měsíc",nami_month_abbrev_plural:"měsíce",nami_year_abbrev:"rok",nami_year_abbrev_plural:"roky",nami_daily:"denní",nami_weekly:"týdně",nami_biweekly:"dvoutýdenní",nami_monthly:"měsíční",nami_bimonthly:"dvouměsíčník",nami_quarterly:"čtvrtletní",nami_biannually:"pololetně",nami_yearly:"roční"},de:{nami_day_abbrev:"Tag",nami_day_abbrev_plural:"Tage",nami_week_abbrev:"Woche",nami_week_abbrev_plural:"Wochen",nami_month_abbrev:"Monat",nami_month_abbrev_plural:"Monate",nami_year_abbrev:"Jahr",nami_year_abbrev_plural:"Jahre",nami_daily:"täglich",nami_weekly:"wöchentlich",nami_biweekly:"zweiwöchentlich",nami_monthly:"monatlich",nami_bimonthly:"zweimonatlich",nami_quarterly:"vierteljährlich",nami_biannually:"halbjährlich",nami_yearly:"jährlich"},el:{nami_day_abbrev:"ημέρα",nami_day_abbrev_plural:"ημέρες",nami_week_abbrev:"εβδομάδα",nami_week_abbrev_plural:"εβδομάδες",nami_month_abbrev:"μήνα",nami_month_abbrev_plural:"μην",nami_year_abbrev:"έτος",nami_year_abbrev_plural:"χρόνια",nami_daily:"καθημερινά",nami_weekly:"εβδομαδιαίος",nami_biweekly:"ανά δύο εβδομάδες",nami_monthly:"μηνιαίος",nami_bimonthly:"διμηνιαίος",nami_quarterly:"τριμηνιαίος",nami_biannually:"ανά εξάμηνο",nami_yearly:"ετήσια"},es:{nami_day_abbrev:"día",nami_day_abbrev_plural:"días",nami_week_abbrev:"semana",nami_week_abbrev_plural:"semanas",nami_month_abbrev:"mes",nami_month_abbrev_plural:"meses",nami_year_abbrev:"año",nami_year_abbrev_plural:"años",nami_daily:"diario",nami_weekly:"semanal",nami_biweekly:"quincenal",nami_monthly:"mensual",nami_bimonthly:"bimensual",nami_quarterly:"trimestral",nami_biannually:"semestral",nami_yearly:"anual"},et:{nami_day_abbrev:"päev",nami_day_abbrev_plural:"päevad",nami_week_abbrev:"nädal",nami_week_abbrev_plural:"nädalat",nami_month_abbrev:"kuu",nami_month_abbrev_plural:"kuud",nami_year_abbrev:"aasta",nami_year_abbrev_plural:"aastat",nami_daily:"iga päev",nami_weekly:"iganädalane",nami_biweekly:"iga kahe nädala tagant",nami_monthly:"igakuine",nami_bimonthly:"kaks korda kuus",nami_quarterly:"kvartali",nami_biannually:"kaks korda aastas",nami_yearly:"iga-aastane"},fa:{nami_day_abbrev:"روز",nami_day_abbrev_plural:"روزها",nami_week_abbrev:"هفته",nami_week_abbrev_plural:"هفتهها",nami_month_abbrev:"مو",nami_month_abbrev_plural:"موش",nami_year_abbrev:"سال",nami_year_abbrev_plural:"سال",nami_daily:"روزانه",nami_weekly:"هفتگی",nami_biweekly:"دو هفتهای",nami_monthly:"ماهانه",nami_bimonthly:"دوماهه",nami_quarterly:"سه ماهه",nami_biannually:"دوسالانه",nami_yearly:"سالانه"},fi:{nami_day_abbrev:"päivä",nami_day_abbrev_plural:"päivää",nami_week_abbrev:"viikko",nami_week_abbrev_plural:"viikkoa",nami_month_abbrev:"kuukausi",nami_month_abbrev_plural:"kuukaudet",nami_year_abbrev:"vuosi",nami_year_abbrev_plural:"vuotta",nami_daily:"päivittäin",nami_weekly:"viikoittain",nami_biweekly:"joka toinen viikko",nami_monthly:"kuukausittain",nami_bimonthly:"kahdesti kuussa",nami_quarterly:"neljännesvuosittain",nami_biannually:"puolivuosittain",nami_yearly:"vuosittain"},fr:{nami_day_abbrev:"jour",nami_day_abbrev_plural:"jours",nami_week_abbrev:"semaine",nami_week_abbrev_plural:"semaines",nami_month_abbrev:"mois",nami_month_abbrev_plural:"mois",nami_year_abbrev:"année",nami_year_abbrev_plural:"ans",nami_daily:"tous les jours",nami_weekly:"hebdomadaire",nami_biweekly:"bihebdomadaire",nami_monthly:"mensuel",nami_bimonthly:"bimensuel",nami_quarterly:"trimestriel",nami_biannually:"bisannuel",nami_yearly:"annuel"},hi:{nami_day_abbrev:"दिन",nami_day_abbrev_plural:"दिन",nami_week_abbrev:"सप्त",nami_week_abbrev_plural:"सप्त",nami_month_abbrev:"महीना",nami_month_abbrev_plural:"महीने",nami_year_abbrev:"साल",nami_year_abbrev_plural:"वर्षीय",nami_daily:"दैनिक",nami_weekly:"साप्ताहिक",nami_biweekly:"द्वि-साप्ताहिक",nami_monthly:"महीने के",nami_bimonthly:"द्विमासिक",nami_quarterly:"त्रैमासिक",nami_biannually:"द्वि-वार्षिक रूप",nami_yearly:"वार्षिक"},hr:{nami_day_abbrev:"dan",nami_day_abbrev_plural:"dana",nami_week_abbrev:"tjedan",nami_week_abbrev_plural:"tjedni",nami_month_abbrev:"mjesec",nami_month_abbrev_plural:"mjeseca",nami_year_abbrev:"god.",nami_year_abbrev_plural:"godina",nami_daily:"dnevno",nami_weekly:"tjedno",nami_biweekly:"dvotjedno",nami_monthly:"mjesečno",nami_bimonthly:"dvomjesečno",nami_quarterly:"tromjesečno",nami_biannually:"dvogodišnje",nami_yearly:"godišnje"},hu:{nami_day_abbrev:"nap",nami_day_abbrev_plural:"napok",nami_week_abbrev:"hét",nami_week_abbrev_plural:"hetek",nami_month_abbrev:"hónap",nami_month_abbrev_plural:"hónap",nami_year_abbrev:"év",nami_year_abbrev_plural:"év",nami_daily:"napi",nami_weekly:"heti",nami_biweekly:"kéthetente",nami_monthly:"havi",nami_bimonthly:"kéthavonta",nami_quarterly:"negyedévenként",nami_biannually:"félévente",nami_yearly:"évi"},id:{nami_day_abbrev:"hari",nami_day_abbrev_plural:"hari",nami_week_abbrev:"minggu",nami_week_abbrev_plural:"minggu",nami_month_abbrev:"bulan",nami_month_abbrev_plural:"bulan",nami_year_abbrev:"tahun",nami_year_abbrev_plural:"tahun",nami_daily:"sehari-hari",nami_weekly:"mingguan",nami_biweekly:"dua kali seminggu",nami_monthly:"bulanan",nami_bimonthly:"dua bulanan",nami_quarterly:"triwulanan",nami_biannually:"dua tahunan",nami_yearly:"tahunan"},it:{nami_day_abbrev:"giorno",nami_day_abbrev_plural:"giorni",nami_week_abbrev:"settimana",nami_week_abbrev_plural:"settimane",nami_month_abbrev:"mese",nami_month_abbrev_plural:"mesi",nami_year_abbrev:"anno",nami_year_abbrev_plural:"anni",nami_daily:"quotidiano",nami_weekly:"settimanale",nami_biweekly:"bisettimanale",nami_monthly:"mensile",nami_bimonthly:"bimestrale",nami_quarterly:"trimestrale",nami_biannually:"semestralmente",nami_yearly:"annuale"},he:{nami_day_abbrev:"יְוֹם",nami_day_abbrev_plural:"ימים",nami_week_abbrev:"שבוע",nami_week_abbrev_plural:"שבועות",nami_month_abbrev:"מו",nami_month_abbrev_plural:"מוֹס",nami_year_abbrev:"שנה",nami_year_abbrev_plural:"שנים",nami_daily:"יוֹמִי",nami_weekly:"שְׁבוּעִי",nami_biweekly:"דו-שבועי",nami_monthly:"יַרחוֹן",nami_bimonthly:"דו-חודשי",nami_quarterly:"רִבעוֹן",nami_biannually:"דו-שנתי",nami_yearly:"שְׁנָתִי"},ja:{nami_day_abbrev:"日",nami_day_abbrev_plural:"日",nami_week_abbrev:"週",nami_week_abbrev_plural:"週",nami_month_abbrev:"モ",nami_month_abbrev_plural:"モス",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"毎日",nami_weekly:"毎週",nami_biweekly:"隔週",nami_monthly:"毎月",nami_bimonthly:"隔月",nami_quarterly:"四半期ごと",nami_biannually:"半年ごと",nami_yearly:"毎年"},ko:{nami_day_abbrev:"낮",nami_day_abbrev_plural:"날",nami_week_abbrev:"주",nami_week_abbrev_plural:"주",nami_month_abbrev:"모",nami_month_abbrev_plural:"모스",nami_year_abbrev:"년",nami_year_abbrev_plural:"년",nami_daily:"일일",nami_weekly:"주간",nami_biweekly:"격주 간행물",nami_monthly:"월간 간행물",nami_bimonthly:"격월",nami_quarterly:"계간지",nami_biannually:"반년마다",nami_yearly:"매년"},lt:{nami_day_abbrev:"diena",nami_day_abbrev_plural:"dienos",nami_week_abbrev:"savaitė",nami_week_abbrev_plural:"savaitės",nami_month_abbrev:"mėn.",nami_month_abbrev_plural:"mėn.",nami_year_abbrev:"metai",nami_year_abbrev_plural:"metų",nami_daily:"kasdien",nami_weekly:"kas savaitę",nami_biweekly:"kas dvi savaites",nami_monthly:"mėnesinis",nami_bimonthly:"kas du mėnesius",nami_quarterly:"ketvirtinis",nami_biannually:"kas du kartus per metus",nami_yearly:"kasmet"},lv:{nami_day_abbrev:"diena",nami_day_abbrev_plural:"dienas",nami_week_abbrev:"nedēļa",nami_week_abbrev_plural:"nedēļas",nami_month_abbrev:"mēn.",nami_month_abbrev_plural:"mēn.",nami_year_abbrev:"gads",nami_year_abbrev_plural:"gadi",nami_daily:"ikdienas",nami_weekly:"iknedēļas",nami_biweekly:"divreiz nedēļā",nami_monthly:"ikmēneša",nami_bimonthly:"divreiz mēnesī",nami_quarterly:"ceturksnī",nami_biannually:"divreiz gadā",nami_yearly:"katru gadu"},ms:{nami_day_abbrev:"hari",nami_day_abbrev_plural:"hari",nami_week_abbrev:"minggu",nami_week_abbrev_plural:"minggu",nami_month_abbrev:"bulan",nami_month_abbrev_plural:"bulan",nami_year_abbrev:"tahun",nami_year_abbrev_plural:"tahun",nami_daily:"setiap hari",nami_weekly:"mingguan",nami_biweekly:"dua minggu sekali",nami_monthly:"bulanan",nami_bimonthly:"dua kali sebulan",nami_quarterly:"suku tahunan",nami_biannually:"dua kali setahun",nami_yearly:"tahunan"},nl:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dagen",nami_week_abbrev:"week",nami_week_abbrev_plural:"weken",nami_month_abbrev:"maand",nami_month_abbrev_plural:"maanden",nami_year_abbrev:"jaar",nami_year_abbrev_plural:"jaren",nami_daily:"dagelijks",nami_weekly:"wekelijks",nami_biweekly:"tweewekelijks",nami_monthly:"maandelijks",nami_bimonthly:"tweemaandelijks",nami_quarterly:"kwartaal",nami_biannually:"halfjaarlijks",nami_yearly:"jaarlijks"},no:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dager",nami_week_abbrev:"uke",nami_week_abbrev_plural:"uker",nami_month_abbrev:"måned",nami_month_abbrev_plural:"måned",nami_year_abbrev:"år",nami_year_abbrev_plural:"år",nami_daily:"daglig",nami_weekly:"ukentlig",nami_biweekly:"annenhver uke",nami_monthly:"månedlig",nami_bimonthly:"annenhver måned",nami_quarterly:"kvartalsvis",nami_biannually:"to ganger i året",nami_yearly:"årlig"},pl:{nami_day_abbrev:"dzień",nami_day_abbrev_plural:"dni",nami_week_abbrev:"tydzień",nami_week_abbrev_plural:"tygodni",nami_month_abbrev:"miesiąc",nami_month_abbrev_plural:"miesiące",nami_year_abbrev:"rok",nami_year_abbrev_plural:"lat",nami_daily:"codziennie",nami_weekly:"tygodnik",nami_biweekly:"dwutygodniowy",nami_monthly:"miesięczny",nami_bimonthly:"dwumiesięczny",nami_quarterly:"kwartalny",nami_biannually:"dwa razy w roku",nami_yearly:"rocznie"},pt:{nami_day_abbrev:"dia",nami_day_abbrev_plural:"dias",nami_week_abbrev:"semana",nami_week_abbrev_plural:"semanas",nami_month_abbrev:"mês",nami_month_abbrev_plural:"meses",nami_year_abbrev:"ano",nami_year_abbrev_plural:"anos",nami_daily:"diário",nami_weekly:"semanalmente",nami_biweekly:"quinzenal",nami_monthly:"mensal",nami_bimonthly:"bimestral",nami_quarterly:"trimestral",nami_biannually:"bianualmente",nami_yearly:"anual"},ro:{nami_day_abbrev:"zi",nami_day_abbrev_plural:"zile",nami_week_abbrev:"săptămână",nami_week_abbrev_plural:"săptămâni",nami_month_abbrev:"lună",nami_month_abbrev_plural:"luni",nami_year_abbrev:"an",nami_year_abbrev_plural:"ani",nami_daily:"zilnic",nami_weekly:"săptămânal",nami_biweekly:"la două săptămâni",nami_monthly:"lunar",nami_bimonthly:"bilunar",nami_quarterly:"trimestrial",nami_biannually:"bianual",nami_yearly:"anual"},ru:{nami_day_abbrev:"день",nami_day_abbrev_plural:"дни",nami_week_abbrev:"нед",nami_week_abbrev_plural:"недели",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год",nami_year_abbrev_plural:"лет",nami_daily:"ежедневно",nami_weekly:"еженедельный",nami_biweekly:"раз в две недели",nami_monthly:"ежемесячно",nami_bimonthly:"раз в два месяца",nami_quarterly:"ежеквартальный",nami_biannually:"раз в два года",nami_yearly:"ежегодно"},sk:{nami_day_abbrev:"deň",nami_day_abbrev_plural:"dni",nami_week_abbrev:"týždeň",nami_week_abbrev_plural:"týždne",nami_month_abbrev:"mesiac",nami_month_abbrev_plural:"mesiacov",nami_year_abbrev:"rok",nami_year_abbrev_plural:"rokov",nami_daily:"denne",nami_weekly:"týždenne",nami_biweekly:"dvojtýždenne",nami_monthly:"mesačne",nami_bimonthly:"dvojmesačne",nami_quarterly:"štvrťročne",nami_biannually:"polročne",nami_yearly:"ročne"},sl:{nami_day_abbrev:"dan",nami_day_abbrev_plural:"dni",nami_week_abbrev:"teden",nami_week_abbrev_plural:"tedni",nami_month_abbrev:"mesec",nami_month_abbrev_plural:"mesecev",nami_year_abbrev:"leto",nami_year_abbrev_plural:"let",nami_daily:"dnevno",nami_weekly:"tedensko",nami_biweekly:"dvotedensko",nami_monthly:"mesečno",nami_bimonthly:"dvomesečno",nami_quarterly:"četrtletno",nami_biannually:"polletno",nami_yearly:"letno"},sr:{nami_day_abbrev:"дан",nami_day_abbrev_plural:"дана",nami_week_abbrev:"недеља",nami_week_abbrev_plural:"недеље",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год.",nami_year_abbrev_plural:"године",nami_daily:"свакодневно",nami_weekly:"недељно",nami_biweekly:"двонедељно",nami_monthly:"месечно",nami_bimonthly:"двомесечно",nami_quarterly:"квартално",nami_biannually:"два пута годишње",nami_yearly:"годишње"},sv:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dagar",nami_week_abbrev:"vecka",nami_week_abbrev_plural:"veckor",nami_month_abbrev:"mån",nami_month_abbrev_plural:"månader",nami_year_abbrev:"år",nami_year_abbrev_plural:"år",nami_daily:"dagligen",nami_weekly:"varje vecka",nami_biweekly:"som utkommer varannan vecka",nami_monthly:"månatlig",nami_bimonthly:"varannan månad",nami_quarterly:"kvartalsvis",nami_biannually:"vartannat år",nami_yearly:"årlig"},sw:{nami_day_abbrev:"siku",nami_day_abbrev_plural:"siku",nami_week_abbrev:"wiki",nami_week_abbrev_plural:"wiki",nami_month_abbrev:"mwezi",nami_month_abbrev_plural:"miezi",nami_year_abbrev:"mwaka",nami_year_abbrev_plural:"miaka",nami_daily:"kila siku",nami_weekly:"kila wiki",nami_biweekly:"kila wiki mbili",nami_monthly:"kila mwezi",nami_bimonthly:"kila baada ya miezi miwili",nami_quarterly:"robo mwaka",nami_biannually:"kila baada ya miaka miwili",nami_yearly:"kila mwaka"},th:{nami_day_abbrev:"วัน",nami_day_abbrev_plural:"วัน",nami_week_abbrev:"สัปดาห์",nami_week_abbrev_plural:"สัปดาห์",nami_month_abbrev:"โม",nami_month_abbrev_plural:"มอส",nami_year_abbrev:"ปี",nami_year_abbrev_plural:"ปี",nami_daily:"รายวัน",nami_weekly:"รายสัปดาห์",nami_biweekly:"สองสัปดาห์ครั้ง",nami_monthly:"รายเดือน",nami_bimonthly:"สองเดือนครั้ง",nami_quarterly:"ไตรมาส",nami_biannually:"ทุกสองปี",nami_yearly:"ทุกปี"},tr:{nami_day_abbrev:"gün",nami_day_abbrev_plural:"günler",nami_week_abbrev:"hafta",nami_week_abbrev_plural:"haftalar",nami_month_abbrev:"ay",nami_month_abbrev_plural:"aylar",nami_year_abbrev:"yıl",nami_year_abbrev_plural:"yıllar",nami_daily:"günlük",nami_weekly:"haftalık",nami_biweekly:"iki haftada bir",nami_monthly:"aylık",nami_bimonthly:"iki ayda bir",nami_quarterly:"üç aylık",nami_biannually:"iki yılda bir",nami_yearly:"yıllık"},uk:{nami_day_abbrev:"день",nami_day_abbrev_plural:"дні",nami_week_abbrev:"тиждень",nami_week_abbrev_plural:"тижні",nami_month_abbrev:"місяць",nami_month_abbrev_plural:"мос",nami_year_abbrev:"рік",nami_year_abbrev_plural:"років",nami_daily:"щоденно",nami_weekly:"щотижня",nami_biweekly:"раз на два тижні",nami_monthly:"щомісяця",nami_bimonthly:"раз на два місяці",nami_quarterly:"щоквартально",nami_biannually:"раз на півроку",nami_yearly:"щорічно"},vi:{nami_day_abbrev:"ngày",nami_day_abbrev_plural:"ngày",nami_week_abbrev:"tuần",nami_week_abbrev_plural:"tuần",nami_month_abbrev:"tháng",nami_month_abbrev_plural:"tháng",nami_year_abbrev:"năm",nami_year_abbrev_plural:"năm",nami_daily:"hằng ngày",nami_weekly:"hàng tuần",nami_biweekly:"hai tuần một lần",nami_monthly:"hàng tháng",nami_bimonthly:"hai tháng một lần",nami_quarterly:"hàng quý",nami_biannually:"hai năm một lần",nami_yearly:"hàng năm"},"zh-CN":{nami_day_abbrev:"天",nami_day_abbrev_plural:"天",nami_week_abbrev:"周",nami_week_abbrev_plural:"周",nami_month_abbrev:"莫",nami_month_abbrev_plural:"莫斯",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"日常的",nami_weekly:"每周",nami_biweekly:"每两周一次",nami_monthly:"月度",nami_bimonthly:"双月刊",nami_quarterly:"季刊",nami_biannually:"每半年",nami_yearly:"每年"},"zh-TW":{nami_day_abbrev:"天",nami_day_abbrev_plural:"天",nami_week_abbrev:"週",nami_week_abbrev_plural:"週",nami_month_abbrev:"莫",nami_month_abbrev_plural:"莫斯",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"日常的",nami_weekly:"每週",nami_biweekly:"每兩週一次",nami_monthly:"每月",nami_bimonthly:"雙月刊",nami_quarterly:"季刊",nami_biannually:"每半年",nami_yearly:"每年"},zu:{nami_day_abbrev:"usuku",nami_day_abbrev_plural:"izinsuku",nami_week_abbrev:"isonto",nami_week_abbrev_plural:"amasonto",nami_month_abbrev:"inyanga",nami_month_abbrev_plural:"i-mos",nami_year_abbrev:"unyaka",nami_year_abbrev_plural:"iminyaka",nami_daily:"nsuku zonke",nami_weekly:"masonto onke",nami_biweekly:"kabili ngesonto",nami_monthly:"nyanga zonke",nami_bimonthly:"kabili ngenyanga",nami_quarterly:"njalo ngekota",nami_biannually:"kabili ngonyaka",nami_yearly:"minyaka yonke"}},nh="en";function ih(e){var t,n,i=function(e){if(!e)return nh;var t=e.trim();if(th[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return th[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":nh}(Po.getLanguageCode()),a=null!==(t=th[i])&&void 0!==t?t:th[nh];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}function ah(e){if("subscription"===(null==e?void 0:e.product_type)){var t=oh(e);if(t.length>0)return t[0].billingPeriod}return null}function rh(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return sh(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function oh(e){return e?sh(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function sh(e,t){return e.map(e=>uh(e,t))}function uh(e,t){var n,i,a,r,o,s,u,l;if(!e)return{};var d=null!==(n=null===(i=e.promo_period)||void 0===i?void 0:i.count)&&void 0!==n?n:null==t?void 0:t.count,c=null!==(a=null===(r=e.promo_period)||void 0===r?void 0:r.type)&&void 0!==a?a:null==t?void 0:t.type,h=null!==(o=null===(s=e.promo_price)||void 0===s?void 0:s.price)&&void 0!==o?o:e.price,m=null!==(u=null===(l=e.promo_price)||void 0===l?void 0:l.currency)&&void 0!==u?u:e.currency;return{priceAmountMicros:1e6*h,priceCurrencyCode:m,billingPeriod:c?`P${d}${c[0].toUpperCase()}`:"",formattedPrice:ch(m).format(h)}}function lh(e,t=!1,n=!1,i=!1,a=!1){if(!e)return null;var r=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!r)return null;var o=r.slice(1).map(e=>parseInt(e)),s=o[0],u=o[1],l=o[2],d=o[3],c=(e,t,n,i,r)=>{var o=(e=>a?`${e}_abbrev`:e)(r),s=(e=>a?`${e}_abbrev_plural`:`${e}_plural`)(r),u=ih(o),l=ih(s);return a||u!==o||(u=ih(`${r}_abbrev`)),a||l!==s||(l=ih(`${r}_abbrev_plural`)),i?e.toString():n?1===e||t?u:l:1===e||t?`${e} ${u}`:`${e} ${l}`};switch(e.at(-1)){case"D":return c(d,t,n,i,"nami_day");case"W":return c(l,t,n,i,"nami_week");case"M":return c(u,t,n,i,"nami_month");case"Y":return c(s,t,n,i,"nami_year")}return null}function dh(e){var t;if(!e||e.length<2)return!1;var n=null===(t=e.at(-1))||void 0===t?void 0:t.toUpperCase();return"M"===n||"Y"===n}function ch(e){var t={maximumFractionDigits:2,minimumFractionDigits:0},n=we().device.getLanguage();try{return new Intl.NumberFormat(n,m({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(n,m({},t,{style:"currency",currency:"USD"}))}}var hh=(e,t,n)=>e&&t&&n?n.format(e-t):null,mh=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},fh=(e,t)=>{if(""!=t){var n=parseInt(t)-1;return n>=0&&n<(null==e?void 0:e.length)?e[n]:null==e?void 0:e.find(e=>e.sku_ref_id===t)}},vh=e=>gh(e.priceAmountMicros)/ph(e.billingPeriod),ph=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},gh=e=>e/1e6;function yh(e){return parseFloat((Math.round(e)/100).toFixed(2))}var bh=(e,t,n=[])=>({price:()=>kh(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>Sh(e),durationSingular:()=>Sh(e,!0),period:()=>Sh(e,!1,!0),periodNumber:()=>Sh(e,!1,!1,!0),freeTrialDuration:()=>Eh(e),freeTrialDurationSingular:()=>Eh(e,!0),freeTrialPeriod:()=>Eh(e,!1,!0),freeTrialPeriodNumber:()=>Eh(e,!1,!1,!0),pricePerMonth:()=>Ph(e),pricePerMonthRounded:()=>Ph(e,!0),periodInMonths:()=>_h(e),durationInMonths:()=>Th(e),durationInMonthsSingular:()=>Th(e,!0),periodNumberInMonths:()=>Mh(e),percentagePriceDifferenceFromSku:()=>Ah(e,t,n),priceDifferenceFromSku:()=>Dh(e,t,n),promoEligible:()=>null===xh(e)&&null!==Ch(e,t),freeTrialEligible:()=>null!==xh(e),promo:()=>{var n;return null===(n=Ch(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=Ih(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Lh(e,t,!1,!0),promoPeriodNumber:()=>Lh(e,t,!1,!1,!0),promoDuration:()=>Lh(e,t),promoDurationSingular:()=>Lh(e,t,!0),introEligible:()=>!1,pricePerDay:()=>Fh(e),pricePerWeek:()=>Rh(e),pricePerWeekRounded:()=>Rh(e,!0),introductoryPrice:()=>Oh(e,t),introductoryPeriod:()=>$h(e,t,!1,!0),introductoryPeriodNumber:()=>$h(e,t,!1,!1,!0),introductoryDuration:()=>$h(e,t),introductoryDurationSingular:()=>$h(e,t,!0),introductoryPricePerMonth:()=>Nh(e,t),introductoryPricePerMonthRounded:()=>Nh(e,t,!0),durationAbbrev:()=>Sh(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Eh(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>$h(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Lh(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Lh(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>Th(e,!1,!1,!1,!0),durationSingularAbbrev:()=>Sh(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Eh(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>$h(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Lh(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Lh(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>Th(e,!0,!1,!1,!0),periodAbbrev:()=>Sh(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Eh(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>$h(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Lh(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Lh(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>Th(e,!1,!0,!1,!0),periodly:()=>function(e){if(!e)return null;var t=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!t)return null;var n=t[1],i=t[2],a=t[3],r=t[4],o=void 0!==n?parseInt(n,10):0,s=void 0!==i?parseInt(i,10):0,u=void 0!==a?parseInt(a,10):0;return(void 0!==r?parseInt(r,10):0)>0?null:u>0?1===u?ih("nami_weekly"):2===u?ih("nami_biweekly"):null:s>0?ih(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?ih("nami_yearly"):null}(ah(e)),iso_subscription_duration:()=>zh(e),bill_term:()=>Bh(e),invalid:()=>!1,unavailable:()=>!1}),wh=(e,t,n,i=[])=>{if(!t)return null;var a=bh(t,n,i);return a[e]?a[e]():null},kh=e=>{var t=oh(e);return t&&t.length?t[0].formattedPrice:null},Sh=(e,t,n,i,a)=>lh(ah(e),t,n,i,a),Eh=(e,t,n,i,a)=>lh(rh(e),t,n,i,a),Ph=(e,t)=>{var n=oh(e);if(!n||0===n.length)return null;var i=vh(n[0]);return i?ch(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},_h=(e,t)=>{var n=oh(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return dh(i)?lh("P1Y"===i?"P12M":i,!1,!1,!1,t):null},Th=(e,t,n,i,a)=>{var r=oh(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return dh(o)?lh("P1Y"===o?"P12M":o,t,n,i,a):null},Mh=e=>{if(!e)return 0;var t=oh(e);return t&&t.length?ph(t[0].billingPeriod):0},Ah=(e,t,n=[])=>{var i,a=oh(e);if(!a||0===a.length)return null;var r=null===(i=fh(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return mh(yh(a[0].priceAmountMicros),Mh(e));var o=oh(r);return mh(yh(a[0].priceAmountMicros),Mh(e),(null==o?void 0:o.length)>0?yh(o[0].priceAmountMicros):0,Mh(r))},Dh=(e,t,n=[])=>{var i,a=oh(e);if(!a||0===a.length)return null;var r=null===(i=fh(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return hh(vh(a[0]));var o=oh(r);return hh(vh(a[0]),vh(o[0]),ch(o[0].priceCurrencyCode))},xh=e=>rh(e),Ch=(e,t)=>{if(!e)return null;var n=e.offers.filter(e=>"promo"===e.offer_type);if(!t)return n[0]||null;var i=n[parseInt(t)];return i?i||null:n.find(e=>e.offer_ref_id===t)||null},Ih=(e,t)=>e?uh(Ch(e,t),e.subscription_period):null,Lh=(e,t,n,i,a,r)=>{var o=Ih(e,t);return lh((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Fh=(e,t)=>{var n=oh(e);if(!n||0===n.length)return null;var i,a,r=gh(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=ph(i))?30.437*a:1);return r?ch(n[0].priceCurrencyCode).format(r):null},Rh=(e,t)=>{var n=oh(e);if(!n||0===n.length)return null;var i,a,r=gh(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=ph(i))?52*a/12:1);return r?ch(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Oh=(e,t)=>{var n=Wh(e,t);return(null==n?void 0:n.formattedPrice)||null},$h=(e,t,n,i,a,r)=>{var o=Wh(e,t);return lh((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Nh=(e,t,n)=>{var i=Wh(e,t);if(i){var a=gh(i.priceAmountMicros),r=ph(i.billingPeriod),o=n?Math.round(a/r):a/r;return ch(i.priceCurrencyCode).format(o)}},Wh=(e,t)=>{return e?(t?(n=e.offers[parseInt(t)])||(n=e.offers.find(e=>e.offer_ref_id===t)||null):n=e.offers[0],uh(n,e.subscription_period)):null;var n},jh={P1D:"daily",P1W:"weekly",P1M:"monthly",P3M:"quarterly",P6M:"semiannual",P1Y:"annual"},Bh=e=>{var t=zh(e);return t&&jh[t]||null},zh=e=>{var t=ah(e);return t?"P7D"===t?"P1W":t:null};function Uh(e,t,n,i){var a=n.flatMap(e=>e.products).find(e=>e.id===t.selectedProducts[t.currentGroupId]);return Gh(Yh(e,null==a?void 0:a.sku_ref_id),a,i)}function Hh(e,t,n){var i,a,r=null!==(i=null===(a=t.find(e=>e.id===n))||void 0===a?void 0:a.products)&&void 0!==i?i:[];return r.forEach(t=>{t.product_details=Yh(e,t.sku_ref_id||""),t.variables=Gh(t.product_details,t,r)}),r}function Gh(e,t,n){if(!t)return{};var i=function(e){if(!Array.isArray(e))return e;var t=e.filter(e=>e&&"object"==typeof e&&"entitlement_ref_id"in e).map(e=>e.entitlement_ref_id);return t.length?t:e}(t.entitlements),a=t.variables;if(!a)return m({},t,{entitlements:i});Object.keys(a).forEach(t=>{if("string"==typeof(r=a[t])&&r.includes(Ri)){var i=Vh(a[t],e,n);a[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(i)}var r});var r={};return Object.keys(bh({})).forEach(t=>{if(void 0===a[t]){var i=wh(t,e,void 0,n);null!==i&&(r[t]=i)}}),m({},t,r,a,{entitlements:i})}var Vh=(e,t,n)=>e.replace(Ci,(i,a)=>{var r,o,s,u,l=(null===(r=Ci.exec(e))||void 0===r?void 0:r.slice(1))||[];a=null!==(o=l[0])&&void 0!==o?o:a;var d=null!==(s=null===(u=l[1])||void 0===u?void 0:u.replace(":",""))&&void 0!==s?s:"";return wh(a,t,d,n)});function Kh(e,t){return t.flatMap(e=>e.products).some(t=>1==wh("freeTrialEligible",Yh(e,t.sku_ref_id)))}function Yh(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var Xh=function(){try{var e=ya(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var qh=Object.prototype.hasOwnProperty;function Jh(e,t,n){var i=e[t];qh.call(e,t)&&Ui(i,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&Xh?Xh(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}var Qh="object"==typeof e&&e&&!e.nodeType&&e,Zh=Qh&&"object"==typeof module&&module&&!module.nodeType&&module,em=Zh&&Zh.exports===Qh?Xi.Buffer:void 0;em&&em.allocUnsafe;var tm=cr(Object.getPrototypeOf,Object),nm=Object.prototype.hasOwnProperty;function im(e){var t=new e.constructor(e.byteLength);return new Ca(t).set(new Ca(e)),t}var am=/\w*$/;var rm=qi?qi.prototype:void 0,om=rm?rm.valueOf:void 0;function sm(e,t,n){var i,a,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return im(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return r=im((a=e).buffer),new a.constructor(r,a.byteOffset,a.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=im(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,am.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return i=e,om?Object(om.call(i)):{}}}var um=Object.create,lm=function(){function e(){}return function(t){if(!aa(t))return{};if(um)return um(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var dm=ar&&ar.isMap,cm=dm?er(dm):function(e){return ja(e)&&"[object Map]"==Cr(e)};var hm=ar&&ar.isSet,mm=hm?er(hm):function(e){return ja(e)&&"[object Set]"==Cr(e)},fm="[object Arguments]",vm="[object Function]",pm="[object Object]",gm={};function ym(e,t,n,i,a,r){var o;if(void 0!==o)return o;if(!aa(e))return e;var s=Oa(e);if(s)o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&nm.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var u=Cr(e),l=u==vm||"[object GeneratorFunction]"==u;if(Xa(e))return e.slice();if(u==pm||u==fm||l&&!a)o=l?{}:function(e){return"function"!=typeof e.constructor||dr(e)?{}:lm(tm(e))}(e);else{if(!gm[u])return a?e:{};o=sm(e,u)}}r||(r=new Ta);var d=r.get(e);if(d)return d;r.set(e,o),mm(e)?e.forEach(function(i){o.add(ym(i,t,n,i,e,r))}):cm(e)&&e.forEach(function(i,a){o.set(a,ym(i,t,n,a,e,r))});var c=s?void 0:vr(e);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););}(c||e,function(i,a){c&&(i=e[a=i]),Jh(o,a,ym(i,t,n,a,e,r))}),o}gm[fm]=gm["[object Array]"]=gm["[object ArrayBuffer]"]=gm["[object DataView]"]=gm["[object Boolean]"]=gm["[object Date]"]=gm["[object Float32Array]"]=gm["[object Float64Array]"]=gm["[object Int8Array]"]=gm["[object Int16Array]"]=gm["[object Int32Array]"]=gm["[object Map]"]=gm["[object Number]"]=gm[pm]=gm["[object RegExp]"]=gm["[object Set]"]=gm["[object String]"]=gm["[object Symbol]"]=gm["[object Uint8Array]"]=gm["[object Uint8ClampedArray]"]=gm["[object Uint16Array]"]=gm["[object Uint32Array]"]=!0,gm["[object Error]"]=gm[vm]=gm["[object WeakMap]"]=!1;var bm=e=>"object"==typeof e&&null!==e&&"handleEvent"in e,wm=(e,t,n)=>{var i=Object.getOwnPropertyDescriptor(e,t);if(!i||i.configurable)try{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n,writable:!1})}catch(i){try{e[t]=n}catch(e){}}},km=function(){return c(function e(){o(this,e),this.listeners=new Map},[{key:"addEventListener",value:function(e,t,n){var i;if(t){var a=(e=>"boolean"==typeof e?{capture:e}:null!=e?e:{})(n),r=null!==(i=this.listeners.get(e))&&void 0!==i?i:[];if(!r.some(e=>e.listener===t)){var o={listener:t,once:Boolean(a.once)};if(a.signal){if(a.signal.aborted)return;o.signal=a.signal,o.abortHandler=()=>this.removeEventListener(e,t),a.signal.addEventListener("abort",o.abortHandler,{once:!0})}r.push(o),this.listeners.set(e,r)}}}},{key:"removeEventListener",value:function(e,t){if(t){var n=this.listeners.get(e);if(n&&0!==n.length){for(var i=n.length-1;i>=0;i-=1){var a=n[i];a.listener===t&&(a.signal&&a.abortHandler&&a.signal.removeEventListener("abort",a.abortHandler),n.splice(i,1))}0===n.length&&this.listeners.delete(e)}}}},{key:"dispatchEvent",value:function(e){var t,n;if(!e||"string"!=typeof e.type)throw new TypeError('Failed to execute "dispatchEvent": event type must be a string.');var i=this.listeners.get(e.type);if(!i||0===i.length)return!0;wm(e,"target",this);var a=!1,r=null===(t=e.stopImmediatePropagation)||void 0===t?void 0:t.bind(e),o=null===(n=e.stopPropagation)||void 0===n?void 0:n.bind(e),s=()=>{a=!0,null==r||r()},u=()=>{e.cancelBubble=!0,null==o||o()};e.stopImmediatePropagation=s,e.stopPropagation=u;for(var l,d=h(i.slice());!(l=d()).done;){var c=l.value;if(a)break;wm(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):bm(c.listener)&&c.listener.handleEvent.call(c.listener,e),c.once&&this.removeEventListener(e.type,c.listener)}if(r)e.stopImmediatePropagation=r;else try{delete e.stopImmediatePropagation}catch(t){e.stopImmediatePropagation=s}if(o)e.stopPropagation=o;else try{delete e.stopPropagation}catch(t){e.stopPropagation=u}return wm(e,"currentTarget",null),!e.defaultPrevented}}])}(),Sm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Em=/^([01]?\d|2[0-3]):([0-5]\d)$/,Pm=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/,_m={equals:(e,t)=>e===t,gt:(e,t)=>e>t,gte:(e,t)=>e>=t,lt:(e,t)=>e<t,lte:(e,t)=>e<=t},Tm=e=>Object.prototype.hasOwnProperty.call(_m,e),Mm=e=>"string"==typeof e.value&&e.value.startsWith(Un)&&e.value.endsWith("}"),Am=e=>{if("string"!=typeof e||!Pm.test(e))return null;var t=e.slice(0,10).split("-").map(Number),n=t[0],i=t[1];if(t[2]>new Date(Date.UTC(n,i,0)).getUTCDate())return null;var a=new Date(e);return Number.isNaN(a.getTime())?null:a},Dm=e=>{if("string"!=typeof e)return null;var t=e.split("@");return 2===t.length&&t[0]&&(e=>{if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch(e){return!1}})(t[1])?{value:t[0],zone:t[1]}:null},xm=(e,t)=>{try{var n=Od(e,t,"EEEE|HH:mm",{locale:Sl}).split("|"),i=n[0],a=n[1].split(":").map(Number);return{dayOfWeek:i,minutes:60*a[0]+a[1]}}catch(e){return null}},Cm=e=>{var t=Dm(e);return t&&Sm.includes(t.value)?{day:t.value,zone:t.zone}:null},Im=e=>{var t=Dm(e),n=t&&Em.exec(t.value);return t&&n?{minutes:60*Number(n[1])+Number(n[2]),zone:t.zone}:null},Lm=(e,t)=>{if(!Array.isArray(e)||0===e.length)return null;for(var n,i=[],a=h(e);!(n=a()).done;){var r=n.value,o="string"==typeof r?t(r):null;if(null===o)return null;i.push(o)}return i},Fm=(e,t)=>{if(!Mm(e))return null;if(Number.isNaN(t.getTime()))return!1;switch(e.value.slice(Un.length,-1)){case"dayOfWeek":return((e,t,n)=>{if("in"===e){var i=Lm(t,Cm);return null!==i&&i.some(({day:e,zone:t})=>{var i;return(null===(i=xm(n,t))||void 0===i?void 0:i.dayOfWeek)===e})}if("equals"!==e&&"notEquals"!==e)return!1;var a=Cm(t);if(!a)return!1;var r=xm(n,a.zone);return!!r&&("equals"===e?r.dayOfWeek===a.day:r.dayOfWeek!==a.day)})(e.operator,e.expected,t);case"timeOfDay":return((e,t,n)=>{if(!Tm(e))return!1;var i=Im(t),a=i&&xm(n,i.zone);return!(!i||!a)&&_m[e](a.minutes,i.minutes)})(e.operator,e.expected,t);case"now":return((e,t,n)=>{if(!Tm(e))return!1;var i=Am(t);return null!==i&&_m[e](n.getTime(),i.getTime())})(e.operator,e.expected,t);default:return!1}},Rm={equals:_m.equals,greater_than:_m.gt,greater_than_or_equal_to:_m.gte,less_than:_m.lt,less_than_or_equal_to:_m.lte},Om=e=>Object.prototype.hasOwnProperty.call(Rm,e)?Rm[e]:null,$m=e=>"string"==typeof e&&e.startsWith(Gn),Nm=()=>{var e,t=null===(e=Po.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.find(e=>e.startsWith(Bn));if(void 0===t)return new Date;var n=(e=>e.startsWith(Bn)?Am(e.slice(Bn.length)):null)(t);return null===n?(Bi.warn(`Ignoring invalid ${t}: expected ISO-8601 with an offset, e.g. ${Bn}2026-09-13T13:00:00-04:00`),new Date):n},Wm=[];var jm={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,safeAreaBottom:0,safeAreaLeft:0,safeAreaRight:0,groups:[],selectedProducts:{},formStates:{},formFieldErrors:{},formFieldValidators:{},timerStates:{},currentPage:"page1",pageHistory:["page1"],currentGroupId:"",currentGroupName:"",fullScreenPresentation:!1,launch:{productGroups:[],customAttributes:{},customObject:{},currentGroup:""},sku:{},orientation:"portrait",focusedState:!1,platformId:"",mediaList:{},skuItems:[],customer:{},hasNotch:!1,purchaseInProgress:!1,formFactor:"desktop",slides:{},userInteractionEnabled:!0,currentSlideIndex:void 0},Bm=function(t){function n(e,t,i){var a;o(this,n),(a=r(this,n)).subscribers=new Set,a.productDetails=Wm,a.filteredSkuMenus=[],a.state=ym(jm,5);var s=Po.getNamiProfile();return a.state.isLoggedIn=!(null==s||!s.externalId),a.state.customer=m({},a.state.customer,Po.getAllCustomerAttributesMap()),a.setPaywall(e,t,i),a.subscribers=new Set,a}return p(n,t),c(n,[{key:"onStateChanged",value:function(){}},{key:"subscribe",value:function(e){return this.subscribers.add(e),()=>this.unsubscribe(e)}},{key:"unsubscribe",value:function(e){this.subscribers.delete(e)}},{key:"emitEvent",value:function(e,t){this.dispatchEvent(function(e,t){if("function"==typeof Event){var n=new Event(e);return Object.defineProperty(n,"detail",{configurable:!0,enumerable:!1,value:t,writable:!1}),n}return{type:e,detail:t,bubbles:!1,cancelBubble:!1,cancelable:!1,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!1,returnValue:!0,srcElement:null,target:null,timeStamp:Date.now(),NONE:0,CAPTURING_PHASE:1,AT_TARGET:2,BUBBLING_PHASE:3,composedPath:()=>[],initEvent:()=>{},preventDefault:()=>{},stopImmediatePropagation:()=>{},stopPropagation:()=>{}}}(e,t))}},{key:"onEvent",value:function(e,t){var n=e=>t(e.detail);return this.addEventListener(e,n),()=>this.removeEventListener(e,n)}},{key:"setState",value:function(e){this.state=e,this.subscribers.forEach(e=>e()),this.onStateChanged()}},{key:"setProductDetails",value:function(e){this.productDetails=e}},{key:"getProductDetails",value:function(){return this.productDetails}},{key:"setCurrentGroupData",value:function(e,t){var n=Uh(this.productDetails,this.state,this.filteredSkuMenus,Hh(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(m({},this.state,{currentGroupId:e,currentGroupName:t,sku:n}))}},{key:"setFormState",value:function(e,t){this.setState(m({},this.state,{formStates:m({},this.state.formStates,{[e]:t})}))}},{key:"registerFormFieldValidator",value:function(e,t){this.setState(m({},this.state,{formFieldValidators:m({},this.state.formFieldValidators,{[e]:t})}))}},{key:"getFormFieldValidators",value:function(){return this.state.formFieldValidators}},{key:"setFormFieldErrors",value:function(e){this.setState(m({},this.state,{formFieldErrors:m({},e)}))}},{key:"setFormFieldError",value:function(e,t){this.setState(m({},this.state,{formFieldErrors:m({},this.state.formFieldErrors,{[e]:t})}))}},{key:"clearFormFieldError",value:function(e){var t=m({},this.state.formFieldErrors);delete t[e],this.setState(m({},this.state,{formFieldErrors:t}))}},{key:"getFormFieldErrors",value:function(){return this.state.formFieldErrors}},{key:"setTimerState",value:function(e,t,n,i){this.setState(m({},this.state,{timerStates:m({},this.state.timerStates,{[e]:{remainingSeconds:t,savedAt:n,hasEmittedCompletion:i}})}))}},{key:"getTimerState",value:function(e){return this.state.timerStates[e]}},{key:"getCurrentGroupId",value:function(){return this.state.currentGroupId}},{key:"getCurrentGroupName",value:function(){return this.state.currentGroupName}},{key:"setCurrentFormId",value:function(e,t){var n=this.state.formStates||{},i=m({},n,{[e]:t||!n[e]});this.setState(m({},this.state,{formStates:i}))}},{key:"getCurrentFormId",value:function(e){return this.state.formStates[e]}},{key:"setSelectedProducts",value:function(e){var t=m({},this.state,{selectedProducts:e}),n=Uh(this.productDetails,t,this.filteredSkuMenus,Hh(this.productDetails,this.filteredSkuMenus,t.currentGroupId));this.setState(m({},t,{sku:n}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"clearSelectedProduct",value:function(e){var t=this.state.selectedProducts||{};if(e&&null!=t[e]){var n=m({},t);delete n[e],this.setSelectedProducts(n)}}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,u=m({},this.state,{formFactor:Ku(),selectedPaywall:e,selectedCampaign:n});(u=m({},u,null===(i=e.template)||void 0===i?void 0:i.initialState)).platformId=null!==(a=null===(r=Po.getNamiConfig())||void 0===r?void 0:r.appPlatformID)&&void 0!==a?a:"",u.systemTimeSnapshot=Nm().getTime();var l,d,c=function(e,t,n=[]){var i,a,r=null!==(i=t.productGroups)&&void 0!==i&&i.length?t.productGroups:n.map(e=>e.ref);return{customAttributes:t.customAttributes,productGroups:r,customObject:m({},e.customObject,t.customObject),currentGroup:null!==(a=t.currentGroup)&&void 0!==a?a:""}}(u.launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(o=e.sku_menus)&&void 0!==o?o:[],c.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter(e=>c.productGroups.includes(e.ref))),""!==c.currentGroup&&u.groups.length&&null!==(s=e.template)&&void 0!==s&&s.displaySingleGroup)&&(u.currentGroupId=null!==(l=null===(d=u.groups.find(e=>e.ref==c.currentGroup))||void 0===d?void 0:d.id)&&void 0!==l?l:"");if(""===u.currentGroupId&&1===this.filteredSkuMenus.length){var h,f=u.groups.find(e=>e.ref==this.filteredSkuMenus[0].ref);u.currentGroupId=null!==(h=null==f?void 0:f.id)&&void 0!==h?h:u.currentGroupId}var v=Hh(this.productDetails,this.filteredSkuMenus,u.currentGroupId);u.skuItems=v,u.launch=c,u.anySkuHasTrialOffer=Kh(this.productDetails,this.filteredSkuMenus),u.anySkuHasPromoOffer=function(e,t){return!Kh(e,t)&&t.flatMap(e=>e.products).some(t=>1==wh("promoEligible",Yh(e,t.sku_ref_id)))}(this.productDetails,this.filteredSkuMenus),u.paywallId=e.id,u.sku=Uh(this.productDetails,u,this.filteredSkuMenus,v),u.pageHistory=[u.currentPage],this.setState(u)}},{key:"getSelectedPaywall",value:function(){return this.state.selectedPaywall}},{key:"getSelectedCampaign",value:function(){return this.state.selectedCampaign}},{key:"getCurrentPlacementLabel",value:function(){var e,t;return null!==(e=this.state.selectedCampaign)&&void 0!==e&&e.value?this.state.selectedCampaign.value:null!==(t=this.flow)&&void 0!==t&&null!==(t=t.campaign)&&void 0!==t&&t.value?this.flow.campaign.value:void 0}},{key:"getPaywallActionEventData",value:function(){var t,n,i,a,r,o,s,u,l,d=this.state.selectedCampaign,c=this.state.selectedPaywall;return{paywallId:null!==(t=null==c?void 0:c.id)&&void 0!==t?t:"",paywallName:null!==(n=null==c?void 0:c.name)&&void 0!==n?n:"",campaignId:null!==(i=null==d?void 0:d.rule)&&void 0!==i?i:"",campaignName:null!==(a=null==d?void 0:d.name)&&void 0!==a?a:"",campaignType:null!==(r=null==d?void 0:d.type)&&void 0!==r?r:"",campaignLabel:null!==(o=null==d?void 0:d.value)&&void 0!==o?o:"",campaignUrl:(null==d?void 0:d.type)===e.NamiCampaignRuleType.URL&&null!==(s=null==d?void 0:d.value)&&void 0!==s?s:"",segmentId:null!==(u=null==d?void 0:d.segment)&&void 0!==u?u:"",externalSegmentId:null!==(l=null==d?void 0:d.external_segment)&&void 0!==l?l:""}}},{key:"paywallId",value:function(){return this.state.paywallId}},{key:"setCurrentPage",value:function(e){if(e&&e!==this.state.currentPage){var t=this.state.pageHistory&&this.state.pageHistory.length?this.state.pageHistory:[this.state.currentPage];this.setState(m({},this.state,{currentPage:e,pageHistory:[...t,e]}))}}},{key:"canGoBackPage",value:function(){var e,t;return(null!==(e=null===(t=this.state.pageHistory)||void 0===t?void 0:t.length)&&void 0!==e?e:0)>1}},{key:"goBackPage",value:function(){var e=this.state.pageHistory&&this.state.pageHistory.length?[...this.state.pageHistory]:[this.state.currentPage];if(e.length<=1)return!1;e.pop();var t=e[e.length-1];return!!t&&(this.setState(m({},this.state,{currentPage:t,pageHistory:e})),!0)}},{key:"setCustomerAttribute",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"removeCustomerAttribute",value:function(e){var t=m({},this.state.customer);delete t[e],this.setState(m({},this.state,{customer:t}))}},{key:"setIsLoggedIn",value:function(e){this.setState(m({},this.state,{isLoggedIn:e}))}},{key:"setMediaList",value:function(e){this.setState(m({},this.state,{mediaList:e.reduce((e,t)=>m({},e,{[t.name]:t}))}))}},{key:"setSafeAreaTop",value:function(e){this.setState(m({},this.state,{safeAreaTop:e}))}},{key:"setSafeAreaBottom",value:function(e){this.setState(m({},this.state,{safeAreaBottom:e}))}},{key:"setSafeAreaLeft",value:function(e){this.setState(m({},this.state,{safeAreaLeft:e}))}},{key:"setSafeAreaRight",value:function(e){this.setState(m({},this.state,{safeAreaRight:e}))}},{key:"setFullScreenPresentation",value:function(e){this.setState(m({},this.state,{fullScreenPresentation:e}))}},{key:"setFormFactor",value:function(e){this.setState(m({},this.state,{formFactor:e}))}},{key:"getFormFactor",value:function(){return this.state.formFactor}},{key:"setPurchaseInProgress",value:function(e){this.setState(m({},this.state,{purchaseInProgress:e}))}},{key:"setPurchase",value:function(e,t){this.setState(m({},this.state,{purchaseInProgress:e,productBeingPurchased:t}))}},{key:"setTimeSpentOnPaywall",value:function(e){this.setState(m({},this.state,{timeSpentOnPaywall:e}))}},{key:"setAppSuppliedVideoDetails",value:function({url:e,name:t}){this.setState(m({},this.state,{appSuppliedVideoUrl:e,appSuppliedVideoName:t}))}},{key:"resetAppSuppliedVideoDetails",value:function(){var e=m({},this.state);delete e.appSuppliedVideoUrl,delete e.appSuppliedVideoName,this.setState(e)}},{key:"setLaunchDetails",value:function(e,t){this.setState(m({},this.state,{launchValue:e,launchType:t}))}},{key:"setOpenHeaderIds",value:function(e,t){e=null!=t&&t.skuId?`${e}_${t.skuId}`:e;var n=[...this.state.openHeaderIds],i=n.indexOf(e);-1!==i?n.splice(i,1):n.push(e),this.setState(m({},this.state,{openHeaderIds:n,currentCollapsibleSku:null!=t?t:null}))}},{key:"getCurrentCollapsibleSku",value:function(){return this.state.currentCollapsibleSku}},{key:"setFlow",value:function(e){this.flow=e}},{key:"setUserInteractionEnabled",value:function(e){this.setState(m({},this.state,{userInteractionEnabled:e})),this.emitEvent("user-interaction-changed",{enabled:e})}},{key:"setUserTags",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"setCurrentSlideIndex",value:function(e){this.setState(m({},this.state,{currentSlideIndex:e}))}}],[{key:"create",value:function(e,t,i){var a=new n(e,t,i);return this.providers.push(a),a}},{key:"remove",value:function(e){n.providers=n.providers.filter(t=>t!==e)}},{key:"reset",value:function(){n.providers=[]}},{key:"currentProvider",get:function(){return n.providers[0]}},{key:"setCustomerAttribute",value:function(e){this.providers.forEach(t=>{t.setCustomerAttribute(e)})}},{key:"removeCustomerAttribute",value:function(e){this.providers.forEach(t=>{t.removeCustomerAttribute(e)})}},{key:"setAppSuppliedVideoDetails",value:function(e){this.providers.forEach(t=>{t.setAppSuppliedVideoDetails(e)})}},{key:"getSelectedPaywall",value:function(){var e;return null===(e=this.providers[0])||void 0===e?void 0:e.getSelectedPaywall()}},{key:"setUserInteractionEnabled",value:function(e){this.providers.forEach(t=>{t.setUserInteractionEnabled(e)})}},{key:"setUserTags",value:function(e){this.providers.forEach(t=>{t.setUserTags(e)})}},{key:"setProductDetails",value:function(e){this.providers.forEach(t=>{t.setProductDetails(e)}),Wm=e}},{key:"setPurchaseInProgress",value:function(e){this.providers.forEach(t=>{t.setPurchaseInProgress(e)})}},{key:"setIsLoggedIn",value:function(e){this.providers.forEach(t=>{t.setIsLoggedIn(e)})}},{key:"setPurchase",value:function(e,t){this.providers.forEach(n=>{n.setPurchase(e,t)})}},{key:"getSelectedSlideIndex",value:function(){var e;return null===(e=this.providers[0])||void 0===e?void 0:e.state.currentSlideIndex}}])}(km);Bm.providers=[];var zm=c(function e(){o(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}});zm.instance=new zm;var Um=()=>mo(zi([...Po.getNamiEntitlements(kt),...Po.getNamiEntitlements(Ct)]),"referenceId"),Hm=()=>{Sc.getInstance().emit(Mi,Um())};function Gm(e){return{id:e.id,skuId:e.sku_ref_id,name:e.name,type:e.sku_type||"unknown",entitlements:e.entitlements,productDetails:"product_details"in e?e.product_details:null}}var Vm=function(){return c(function e(){o(this,e)},[{key:"fetchActiveEntitlements",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(e=null,Qc()||gu(Pe.THIRD_PARTY_TRANSACTIONS)||!gu(Pe.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=Po.getDevice())||!t.id){i.n=2;break}return i.n=1,a(this.getAPIEntitlements(t.id));case 1:n=i.v,(e=null==n?void 0:n.results)&&(Po.setActiveEntitlements(bt,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:Qc()&&Bi.debug("Skipping active entitlements update - anonymous mode");case 4:return i.a(2,e)}},null,this,null,Promise)}},{key:"getAPIEntitlements",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return t=`device/${e}/active_entitlements/`,n={},r.p=1,r.n=2,a(il.instance.fetchAPI(t));case 2:n=r.v,r.n=4;break;case 3:throw r.p=3,i=r.v,Bi.error(zo(i.status,t)),i;case 4:return r.a(2,n)}},null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){wu()&&(e=>{Po.setNamiEntitlements(kt,e);var t=Po.getNamiEntitlements(Ct),n=new Set(e.map(e=>e.referenceId)),i=t.filter(e=>{var t=n.has(e.referenceId);return t&&Bi.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t});i.length!==t.length&&Po.setNamiEntitlements(Ct,i),Hm()})(e.map(e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:zm.instance.refIdToRelatedSKUs[t]||[],activePurchases:zm.instance.refIdToActivePurchases[t]||[],purchasedSkus:zm.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e)))}}])}();Vm.instance=new Vm;var Km=function(){return c(function e(){o(this,e)},[{key:"fetchCustomerJourneyState",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(!Qc()){r.n=1;break}return Bi.debug("Skipping customer journey state update - anonymous mode"),r.a(2,null);case 1:if(null!=(e=Po.getDevice())&&e.id){r.n=2;break}return r.a(2,null);case 2:return t=`device/${e.id}/profile/`,n=null,r.p=3,r.n=4,a(il.instance.fetchAPI(t,void 0,0));case 4:n=r.v,r.n=6;break;case 5:throw r.p=5,i=r.v,Bi.error(zo(i.status,t)),i;case 6:if(!n){r.n=7;break}return Po.setCustomerJourneyState(n.customer_journey_state),r.a(2,n.customer_journey_state);case 7:return r.a(2,null)}},null,null,[[3,5]],Promise)}}])}();Km.instance=new Km;var Ym="[NamiStartup]",Xm=function(){return c(function e(){o(this,e),this.enabled=!1,this.t0=0,this.lastMark=0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1},[{key:"start",value:function(e){var t;this.enabled=null!==(t=null==e?void 0:e.includes(Cn))&&void 0!==t&&t,this.enabled&&(this.t0=Date.now(),this.lastMark=this.t0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1)}},{key:"mark",value:function(e,t){if(this.enabled){var n=Date.now(),i=n-this.lastMark;this.lastMark=n,"initial_config_decoded"===e?this.decodeDuration=i:"initial_processed"===e&&(this.processDuration=i,void 0!==(null==t?void 0:t.count)&&(this.placements=t.count));var a=t?" "+Object.entries(t).map(([e,t])=>`${e}=${t}`).join(" "):"";if("ready"===e){var r=n-this.t0;Bi.info(`${Ym} phase=${e} ms=${i} total_to_ready=${r}${a}`),Bi.info(`${Ym} SUMMARY total_to_ready=${r} decode=${this.decodeDuration} process=${this.processDuration} placements=${this.placements}`)}else Bi.info(`${Ym} phase=${e} ms=${i}${a}`)}}},{key:"firstLaunchLookup",value:function(e,t){if(!this.enabled||this.firstLaunchLogged)return t();this.firstLaunchLogged=!0;var n=Date.now(),i=t(),a=Date.now()-n;return Bi.info(`${Ym} phase=first_launch_lookup ms=${a} label=${e}`),i}},{key:"serverFetch",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.n){case 0:if(this.enabled){r.n=1;break}return r.a(2,e());case 1:return t=Date.now(),r.n=2,a(e());case 2:return n=r.v,i=Date.now()-t,Bi.info(`${Ym} phase=server_fetch ms=${i} campaigns=${n.length}`),r.a(2,n)}},null,this,null,Promise)}}])}(),qm=new Xm,Jm=function(){return c(function e(t){o(this,e),this.now=t,this.handle=null,this.fire=null,this.deadline=0,this.remaining=null},[{key:"isPending",get:function(){return null!==this.fire}},{key:"isPaused",get:function(){return null!==this.fire&&null===this.handle}},{key:"start",value:function(e,t){this.cancel(),this.fire=t,this.arm(e)}},{key:"startPaused",value:function(e,t){this.cancel(),this.fire=t,this.remaining=Math.max(0,e)}},{key:"pause",value:function(){null!==this.handle&&(this.remaining=Math.max(0,this.deadline-this.now()),this.disarm())}},{key:"resume",value:function(){if(null!==this.fire&&null===this.handle&&null!==this.remaining){var e=this.remaining;this.remaining=null,this.arm(e)}}},{key:"cancel",value:function(){this.disarm(),this.fire=null,this.remaining=null}},{key:"arm",value:function(e){var t=Math.max(0,e);this.deadline=this.now()+t,this.handle=setTimeout(()=>{var e=this.fire;this.handle=null,this.fire=null,this.remaining=null,null==e||e()},t)}},{key:"disarm",value:function(){null!==this.handle&&clearTimeout(this.handle),this.handle=null}}])}(),Qm=864e5,Zm={high:0,medium:1,low:2},ef=(e,t,n)=>e===n?t:0,tf=function(){return c(function e(t={}){o(this,e),this.options=t},[{key:"dayKey",value:function(e){var t,n,i=null===(t=(n=this.options).timeZone)||void 0===t?void 0:t.call(n);if(!i)return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;var a=new Intl.DateTimeFormat("en-US",{timeZone:i,calendar:"gregory",numberingSystem:"latn",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),r=e=>{var t,n;return null!==(t=null===(n=a.find(t=>t.type===e))||void 0===n?void 0:n.value)&&void 0!==t?t:""};return`${r("year").padStart(4,"0")}-${r("month")}-${r("day")}`}},{key:"select",value:function({event:e,journeys:t,snapshot:n,settings:i,isContentActive:a,now:r}){for(var o,s=this.dayKey(r),u={},l=[],d=new Set,c=h(t);!(o=c()).done;){var m=o.value,f=Hd(m.journey);if(f&&!d.has(f.journey_id)){d.add(f.journey_id);var v=this.perJourneyRejection(m,f,e,n,i,s,r);v?u[f.journey_id]=v:l.push({rule:m,journey:f})}}var p=this.globalRejection(n.global,i,a,s,r);if(p){for(var g,y=h(l);!(g=y()).done;){u[g.value.journey.journey_id]=p}return{winner:null,rejections:u}}for(var b=null,w=0,k=l;w<k.length;w++){var S=k[w];(!b||Zm[S.journey.priority]<Zm[b.journey.priority])&&(b=S)}for(var E=0,P=l;E<P.length;E++){var _=P[E];_!==b&&(u[_.journey.journey_id]="outranked")}return{winner:b,rejections:u}}},{key:"perJourneyRejection",value:function(e,t,n,i,a,r,o){var s;if(!Gd(t)||t.trigger.event_type!==n)return"triggerMismatch";if(!Nd(e.not_before,e.expires_at,o))return"outsideWindow";var u=null!==(s=i.journeys[t.journey_id])&&void 0!==s?s:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null},l=t.delivery,d=t.goal,c=o.getTime();if(l.show_once){if(u.impressionsTotal>=1)return"shownOnce"}else{var h,m;if(null!=l.max_impressions_total&&u.impressionsTotal>=l.max_impressions_total)return"totalCap";var f=Math.min(null!==(h=l.max_per_session)&&void 0!==h?h:a.max_per_session,a.max_per_session),v=Math.min(null!==(m=l.max_per_day)&&void 0!==m?m:a.max_per_day,a.max_per_day);if(ef(u.sessionKey,u.sessionCount,i.global.sessionOrdinal)>=f)return"sessionCap";if(ef(u.dayKey,u.dayCount,r)>=v)return"dayCap";var p=null==d?void 0:d.re_eligibility_days;if(null!=p&&null!=u.lastDismissedAt&&c<u.lastDismissedAt+p*Qm)return"reEligibility"}if(null!=u.goalAchievedAt&&(l.show_once||!0!==(null==d?void 0:d.re_entry_after_goal)))return"goalAchieved";var g=null==d?void 0:d.timeout_days;return null!=g&&null!=u.enteredAt&&c>=u.enteredAt+g*Qm?"timedOut":null}},{key:"globalRejection",value:function(e,t,n,i,a){return ef(e.sessionKey,e.sessionCount,e.sessionOrdinal)>=t.max_per_session?"globalSessionCap":ef(e.dayKey,e.dayCount,i)>=t.max_per_day?"globalDayCap":null!=e.lastAnyImpressionAt&&a.getTime()<e.lastAnyImpressionAt+1e3*t.cooldown_seconds?"cooldown":t.suppress_when_active&&n?"suppressed":null}},{key:"recordImpression",value:function(e,t,n){var i,a,r=this.dayKey(n),o=e.global.sessionOrdinal,s=null!==(i=e.journeys[t])&&void 0!==i?i:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null},u=this.recordExternalImpression(e,n);return this.withRecord(u,t,m({},s,{impressionsTotal:s.impressionsTotal+1,sessionKey:o,sessionCount:ef(s.sessionKey,s.sessionCount,o)+1,dayKey:r,dayCount:ef(s.dayKey,s.dayCount,r)+1,enteredAt:null!==(a=s.enteredAt)&&void 0!==a?a:n.getTime()}))}},{key:"recordExternalImpression",value:function(e,t){var n=this.dayKey(t),i=e.global;return m({},e,{global:m({},i,{sessionKey:i.sessionOrdinal,sessionCount:ef(i.sessionKey,i.sessionCount,i.sessionOrdinal)+1,dayKey:n,dayCount:ef(i.dayKey,i.dayCount,n)+1,lastAnyImpressionAt:t.getTime()})})}},{key:"recordDismiss",value:function(e,t,n){var i;return this.withRecord(e,t,m({},null!==(i=e.journeys[t])&&void 0!==i?i:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null},{lastDismissedAt:n.getTime()}))}},{key:"isGoalOpen",value:function(e,t,n){var i;if(null==(null==e?void 0:e.enteredAt))return!1;var a=null===(i=t.goal)||void 0===i?void 0:i.timeout_days;return null==a||n.getTime()<e.enteredAt+a*Qm}},{key:"recordGoal",value:function(e,t,n){var i;return this.withRecord(e,t,m({},null!==(i=e.journeys[t])&&void 0!==i?i:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null},{goalAchievedAt:n.getTime(),enteredAt:null}))}},{key:"withRecord",value:function(e,t,n){return m({},e,{journeys:m({},e.journeys,{[t]:n})})}}])}(),nf=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),af=e=>"number"==typeof e&&Number.isFinite(e)?e:null,rf=e=>"string"==typeof e?e:null;function of(e){var t,n,i;return nf(e)?{impressionsTotal:null!==(t=af(e.impressionsTotal))&&void 0!==t?t:0,sessionKey:af(e.sessionKey),sessionCount:null!==(n=af(e.sessionCount))&&void 0!==n?n:0,dayKey:rf(e.dayKey),dayCount:null!==(i=af(e.dayCount))&&void 0!==i?i:0,lastDismissedAt:af(e.lastDismissedAt),goalAchievedAt:af(e.goalAchievedAt),enteredAt:af(e.enteredAt)}:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null}}function sf(e){var t,n,i;return nf(e)?{sessionOrdinal:null!==(t=af(e.sessionOrdinal))&&void 0!==t?t:0,sessionKey:af(e.sessionKey),sessionCount:null!==(n=af(e.sessionCount))&&void 0!==n?n:0,dayKey:rf(e.dayKey),dayCount:null!==(i=af(e.dayCount))&&void 0!==i?i:0,lastAnyImpressionAt:af(e.lastAnyImpressionAt)}:{sessionOrdinal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastAnyImpressionAt:null}}var uf={snapshot:()=>function(e){if(!nf(e)||!nf(e.journeys))return{journeys:{},global:{sessionOrdinal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastAnyImpressionAt:null}};for(var t={},n=0,i=Object.entries(e.journeys);n<i.length;n++){var a=i[n],r=a[0],o=a[1];t[r]=of(o)}return{journeys:t,global:sf(e.global)}}(Po.getJourneyRuleState()),update(e){var t=e(this.snapshot());return Po.setJourneyRuleState(t),t},startSession(){this.update(e=>m({},e,{global:m({},e.global,{sessionOrdinal:e.global.sessionOrdinal+1})}))},clear(){Po.removeJourneyRuleState()}},lf=function(){function e(){o(this,e)}return c(e,[{key:"previous",get:function(){return this._previous}},{key:"record",value:function(e){this._previous=this._current,this._current=e}},{key:"reset",value:function(){this._current=void 0,this._previous=void 0}}],[{key:"shared",get:function(){return this._shared||(this._shared=new e),this._shared}}])}(),df=()=>!1,cf=()=>Bm.providers.length>0||df(),hf=()=>{var e,t,n;return null===(e=null===(t=(n=we().device).isAppVisible)||void 0===t?void 0:t.call(n))||void 0===e||e};var mf=null,ff={now:()=>new Date,monotonicNow:()=>"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now(),journeys:ic,settings:()=>{var e,t,n,i,a,r=Po.getAppConfig(lt)||Po.getAppConfig(Et),o=null==r?void 0:r.journey_settings;return{max_per_session:null!==(e=null==o?void 0:o.max_per_session)&&void 0!==e?e:_e,max_per_day:null!==(t=null==o?void 0:o.max_per_day)&&void 0!==t?t:Te,cooldown_seconds:null!==(n=null==o?void 0:o.cooldown_seconds)&&void 0!==n?n:Me,refresh_interval_seconds:null!==(i=null==o?void 0:o.refresh_interval_seconds)&&void 0!==i?i:Ae,suppress_when_active:null!==(a=null==o?void 0:o.suppress_when_active)&&void 0!==a?a:De}},contentActive:cf,isAppVisible:hf,present:function(e,t){var n,i,a=we().ui,r=t=>(Bi.debug(`Journey raise skipped for rule ${e.rule}: ${t}`),!1);if(!t())return r("Nami.reset() ran after it fired");if(cf())return r("a paywall or flow is already open");if(!hf())return r("the app is not visible");if(!a.presentCampaign)return r("this platform cannot present a journey");if(e.flow){if(!e.flow.object||!ll(null!==(i=e.flow.object.screens)&&void 0!==i?i:[]))return r("its flow screens are not available")}else if(!e.paywall||!ul(e.paywall))return r("its paywall is not available");return lf.shared.record({placementLabel:"",tags:null!==(n=e.placement_tags)&&void 0!==n?n:[],customAttributes:{}}),Po.setLaunchId(Yu()),a.presentCampaign(e,{customAttributes:{}})},deliveryDisabled:()=>{var e,t,n=null===(e=Po.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(Rn))&&void 0!==t&&t},installMarker:{get:()=>Po.getJourneyInstallEvaluated(),set:()=>Po.setJourneyInstallEvaluated()},refresh:()=>{var e,t;return null!==(e=null===(t=mf)||void 0===t?void 0:t.fetchCampaignsAndPaywalls())&&void 0!==e?e:Promise.resolve()},refreshAllowed:()=>{var e,t;return!(null!==(e=null===(t=mf)||void 0===t?void 0:t.isStartupInFlight())&&void 0!==e&&e)},refreshEnabled:()=>{var e,t;return null!==(e=null===(t=mf)||void 0===t?void 0:t.canRefreshJourneys())&&void 0!==e&&e&&ic().length>0}},vf=function(){return c(function e(t){o(this,e),this.env=t,this.engine=new tf,this.resetGeneration=0,this.backgroundedAt=null,this.refreshInFlight=!1,this.refreshPending=!1,this.refreshDeferred=!1,this.refreshTimer=null,this.delay=new Jm(t.monotonicNow)},[{key:"generation",get:function(){return this.resetGeneration}},{key:"isDelayPaused",get:function(){return this.delay.isPaused}},{key:"sessionStarted",value:function(e,t){void 0===t||t===this.resetGeneration?(uf.startSession(),this.evaluate(e),this.startRefreshTimer()):Bi.debug("Journey session start dropped: Nami.reset() ran during the startup pass")}},{key:"appDidEnterBackground",value:function(){var e;this.delay.pause(),this.stopRefreshTimer(),null!==(e=this.backgroundedAt)&&void 0!==e||(this.backgroundedAt=this.env.monotonicNow())}},{key:"appWillEnterForeground",value:function(){var e=this.backgroundedAt;return this.backgroundedAt=null,this.delay.resume(),this.startRefreshTimer(),null!==e&&this.env.monotonicNow()-e>=si}},{key:"placementWillRaise",value:function(){this.delay.cancel()}},{key:"reset",value:function(){this.delay.cancel(),this.stopRefreshTimer(),this.backgroundedAt=null,this.resetGeneration+=1,this.refreshInFlight=!1,this.refreshPending=!1,this.refreshDeferred=!1}},{key:"externalImpressionRegistered",value:function(){uf.update(e=>this.engine.recordExternalImpression(e,this.env.now()))}},{key:"flowCompletionSignaled",value:function(e){var t,n=e?Kd(e):null;return!("flow_completed"!==(null==n||null===(t=n.goal)||void 0===t?void 0:t.type)||!this.goalReached(n))&&(this.requestRefresh(),!0)}},{key:"customerAttributeSet",value:function(e,t){for(var n,i=!1,a=h(this.env.journeys());!(n=a()).done;){var r,o=n.value,s=Kd(o);"user_context_set"===(null==s||null===(r=s.goal)||void 0===r?void 0:r.type)&&s.goal.context_key===e&&(i=this.goalReached(s)||i)}(t||i)&&this.requestRefresh()}},{key:"goalReached",value:function(e){var t=e.journey_id,n=this.env.now();return this.engine.isGoalOpen(uf.snapshot().journeys[t],e,n)?(uf.update(e=>this.engine.recordGoal(e,t,n)),Bi.debug(`Journey ${t} goal achieved`),!0):(Bi.debug(`Journey ${t} goal ignored: not entered, already achieved or timed out`),!1)}},{key:"requestRefresh",value:function(e=!1){this.env.refreshEnabled()&&(this.refreshInFlight?this.refreshPending=!0:this.env.refreshAllowed()?this.startRefresh():e&&(this.refreshDeferred=!0))}},{key:"startupPassFinished",value:function(){this.refreshDeferred&&(this.refreshDeferred=!1,this.env.refreshEnabled()&&(this.refreshInFlight?this.refreshPending=!0:this.startRefresh()))}},{key:"startRefresh",value:function(){this.refreshInFlight=!0;var e,t=this.resetGeneration,n=()=>{this.resetGeneration===t&&(this.refreshInFlight=!1,this.refreshPending&&(this.refreshPending=!1,this.requestRefresh(!0)))};try{e=this.env.refresh()}catch(t){e=Promise.reject(t)}e.then(n,e=>{Bi.warn(`Journey refresh failed: ${e}`),n()})}},{key:"startRefreshTimer",value:function(){var e;if(null===this.refreshTimer&&this.env.isAppVisible()){var t=1e3*this.env.settings().refresh_interval_seconds;if(t>0){var n=setInterval(()=>this.requestRefresh(),t);null===(e=n.unref)||void 0===e||e.call(n),this.refreshTimer=n}}}},{key:"stopRefreshTimer",value:function(){null!==this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null)}},{key:"evaluate",value:function(e){var t=null;if(e&&!this.env.installMarker.get()){var n=this.select("app_install");n&&(t={event:"app_install",winner:n})}if(e&&this.env.installMarker.set(),!t){var i=this.select("session_start");i&&(t={event:"session_start",winner:i})}if(t){var a=t,r=a.event,o=a.winner,s=o.journey.journey_id;if(this.delay.isPending)Bi.debug(`Journey ${s} dropped: another journey is waiting for its delay`);else{var u=Math.max(0,1e3*o.journey.delivery.delay_seconds),l=()=>this.fire(r,s);this.env.isAppVisible()?this.delay.start(u,l):(Bi.debug(`Journey ${s} held: the app is not visible, its delay starts paused`),this.delay.startPaused(u,l))}}}},{key:"decide",value:function(e,t){return this.engine.select({event:e,journeys:t,snapshot:uf.snapshot(),settings:this.env.settings(),isContentActive:this.env.contentActive(),now:this.env.now()})}},{key:"select",value:function(e){var t=this.decide(e,this.env.journeys()),n=t.winner,i=t.rejections;return!n&&Object.keys(i).length>0&&Bi.debug(`No ${e} journey selected: ${JSON.stringify(i)}`),n}},{key:"fire",value:function(e,t){if(this.env.isAppVisible()){var n=this.env.journeys().find(e=>(e=>{var t;return null===(t=Kd(e))||void 0===t?void 0:t.journey_id})(e)===t);if(n){var i=this.decide(e,[n]),a=i.winner,r=i.rejections;if(a)if(this.env.deliveryDisabled())Bi.debug(`Journey ${t} not delivered: disableJourneyDelivery is set`);else{var o=this.resetGeneration,s=()=>this.resetGeneration===o;this.env.present(a.rule,s)&&s()&&uf.update(e=>this.engine.recordImpression(e,t,this.env.now()))}else Bi.debug(`Journey ${t} dropped at fire time: ${r[t]}`)}else Bi.debug(`Journey ${t} dropped at fire time: no longer in the journey rules`)}else this.delay.startPaused(0,()=>this.fire(e,t))}}])}();vf.shared=new vf(ff);var pf=function(){return c(function e(){o(this,e),this.inMemoryAnonymousMode=!1,this.isFirstSession=!1,this.startupDisabled=!1,this.hasInitialConfig=!1,this.lastConfig=null,this.lastStartupRunAt=0,this.startupInFlight=!1,this.startupFetch=Promise.resolve(),qc=this,mf=this},[{key:"isStartupInFlight",value:function(){return this.startupInFlight}},{key:"canRefreshJourneys",value:function(){var e;return!(null===(e=this.lastConfig)||void 0===e||null===(e=e.appPlatformID)||void 0===e||!e.trim()||this.startupDisabled)}},{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,Bi.info(`In-memory anonymous mode ${e?"enabled":"disabled"} due to failed device registration`)}},{key:"isInMemoryAnonymousMode",value:function(){return this.inMemoryAnonymousMode}},{key:"isAnonymousMode",value:function(){return Po.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"getIsFirstSession",value:function(){return this.isFirstSession}},{key:"isStartupDisabled",value:function(){return this.startupDisabled}},{key:"init",value:function(e){var t,n;return k(function(i){for(;;)switch(i.p=i.n){case 0:return this.isFirstSession=this.hasNoDevice(),n=vf.shared.generation,this.startupDisabled=!1,this.hasInitialConfig=Object.keys(null!==(t=e.initialConfig)&&void 0!==t?t:{}).length>0,this.setInitialValues(e),this.lastConfig=e,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,i.p=1,i.n=2,a(this.fetchPlatformConfig());case 2:if(i.v){i.n=3;break}return i.a(2);case 3:return i.p=3,i.n=4,a(this.runStartupAfterConfig(e));case 4:return i.p=4,this.startJourneySession(this.isFirstSession,n),i.f(4);case 5:return i.p=5,this.startupInFlight=!1,vf.shared.startupPassFinished(),i.f(5);case 6:return i.a(2)}},null,this,[[3,,4,5],[1,,5,6]],Promise)}},{key:"foreground",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return e=vf.shared,t=e.appWillEnterForeground(),n=t&&null!==this.lastConfig&&!this.startupInFlight,i=e.generation,r=this.hasNoDevice(),o.n=1,a(this.resume());case 1:n&&!this.startupDisabled&&this.startJourneySession(r,i);case 2:return o.a(2)}},null,this,null,Promise)}},{key:"hasNoDevice",value:function(){return null===Po.getDevice()&&!Po.getAnonymousMode()}},{key:"startJourneySession",value:function(e,t){this.startupFetch.then(()=>vf.shared.sessionStarted(e,t))}},{key:"resume",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(this.lastConfig&&!this.startupInFlight){r.n=1;break}return r.a(2);case 1:if(!(Date.now()-this.lastStartupRunAt<ri)){r.n=2;break}return Bi.debug("Resuming too quickly to call the service."),r.a(2);case 2:return e=this.lastConfig,t=this.startupDisabled,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,this.startupDisabled=!1,r.p=3,r.n=4,a(this.fetchPlatformConfig());case 4:if(n=!r.v){r.n=5;break}n=!t;case 5:if(!n){r.n=6;break}return r.a(2);case 6:return Bi.info("Usable app config on resume - completing the startup that stopped at launch"),r.n=7,a(this.runStartupAfterConfig(e));case 7:r.n=9;break;case 8:r.p=8,i=r.v,Bi.warn(`Resume refresh failed: ${i}`);case 9:return r.p=9,this.startupInFlight=!1,vf.shared.startupPassFinished(),r.f(9);case 10:return r.a(2)}},null,this,[[3,8,9,10]],Promise)}},{key:"runStartupAfterConfig",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.initAndFetchRequiredData(e));case 1:Zc.instance.startSession();case 2:return t.a(2)}},null,this,null,Promise)}},{key:"clearResumeState",value:function(){this.lastConfig=null,this.lastStartupRunAt=0,this.startupDisabled=!1}},{key:"fetchPlatformConfig",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(Vc.instance.fetchConfigForStartup(this.hasInitialConfig));case 1:if((e=t.v).usable){t.n=2;break}return this.startupDisabled=!0,Bi.error(`Nami startup stopped: ${e.reason}`),t.a(2,!1);case 2:return t.a(2,!0)}},null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=m({},e);delete t.initialConfig,Po.clearSessionId(),Po.setNamiConfig(t),Po.setLanguageCode(e.namiLanguageCode),Po.setPurchaseChannel(e.purchaseChannel);var n,i=e.initialConfig;if(i.appConfig||i.platform_config){var a=(null==i?void 0:i.appConfig)||(null==i?void 0:i.platform_config);a&&Po.setAppConfig(Et,a)}null!=i&&i.paywalls&&(Po.setPaywalls(Mt,i.paywalls.map(e=>m({},e,{fetchSource:"initialConfig"}))),null!==(n=i.campaign_rules)&&void 0!==n&&n.length&&Uc.instance.seedFromInitialConfig(i.campaign_rules,i.paywalls));null!=i&&i.products&&Po.setProducts(Dt,i.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:_c.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=m({},Vu(e.namiCommands),e.formFactor?{form_factor:e.formFactor}:{}),n=function(e){if(e){var t=e.find(e=>e.startsWith("splitPosition="));if(t){var n=t.split("=")[1],i=Number(n);return n&&!isNaN(i)?Ju(i):void 0}}}(e.namiCommands),i=_c.instance.createOrUpdateDevice(t,n,this);return{deviceId:i.id,deviceTask:i.device}}},{key:"initAndFetchRequiredData",value:function(e,t=0,n=1){var i,r,o,s,u,l,d,c,h,m,f,v;return k(function(p){for(;;)switch(p.n){case 0:if(s=e.initialConfig,u=null!==(i=e.formFactor)&&void 0!==i?i:Ku(),l=this.isAnonymousMode(),d=l?this.initAnonymousDevice():this.initIdentifiedDevice(e),c=d.deviceId,h=d.deviceTask,m=Xu(c),s.campaign_rules&&(f=Qd(s.campaign_rules,m,u),Po.setCampaignRules(_t,f),qm.mark("initial_processed",{count:f.length})),!h){p.n=1;break}return p.n=1,a(h);case 1:if(Ec.instance.configure(u,m,e.namiCommands),bu(),v=Promise.all([Tc.instance.fetchProducts(),Km.instance.fetchCustomerJourneyState(),Vm.instance.fetchActiveEntitlements(),qm.serverFetch(()=>this.fetchCampaignsAndPaywalls())]).catch(i=>{var r;return k(function(o){for(;;)switch(o.n){case 0:if(!(i instanceof Mo)){o.n=3;break}if(Po.resetDevice(),!(t<n)){o.n=2;break}return r=100*Math.pow(2,t),o.n=1,a(new Promise(e=>setTimeout(e,r)));case 1:return o.a(2,this.initAndFetchRequiredData(e,t+1,n));case 2:if(l){o.n=3;break}return Bi.warn(`Max retries reached for ConflictError. ${i.message}`),this.setInMemoryAnonymousMode(!0),o.a(2,this.initAndFetchRequiredData(e,0,n));case 3:throw i;case 4:return o.a(2)}},null,this,null,Promise)}),this.startupFetch=v.then(()=>{},()=>{}),null!==(r=s.campaign_rules)&&void 0!==r&&r.length&&null!==(o=s.paywalls)&&void 0!==o&&o.length){p.n=2;break}return p.n=2,a(v);case 2:v.then(()=>this.reRenderPaywall());case 3:return p.a(2)}},null,this,null,Promise)}},{key:"fetchCampaignsAndPaywalls",value:function(){var e,t,n,i,r,o,s,u,l,d,c,h,m,f,v,p;return k(function(g){for(;;)switch(g.n){case 0:return e=Ec.instance,t=Uc.instance,n=Date.now(),i=Date.now(),g.n=1,a(e.fetchCampaignRulesRaw());case 1:return r=g.v,o=r.campaigns,s=r.fromNetwork,u=Date.now()-i,g.n=2,a(Promise.all(o.filter(e=>{var t;return(null===(t=e.flow)||void 0===t?void 0:t.url)&&!e.flow.object}).map(e=>{var t,n;return k(function(i){for(;;)switch(i.p=i.n){case 0:return i.p=0,i.n=1,a(Wc(e.flow.url));case 1:t=i.v,e.flow.object=t.data,i.n=3;break;case 2:i.p=2,n=i.v,Bi.warn(`Error fetching flow object from ${e.flow.url}: ${n}`);case 3:return i.a(2)}},null,null,[[0,2]],Promise)})));case 2:if(l=!e.useLegacyPaywallFetch&&Ec.hasPaywallUrls(o),c=null,h=Date.now(),!l||s){g.n=3;break}Bi.info("Paywall resolution skipped: campaign_rules were served from the stored copy"),d=ol(),g.n=7;break;case 3:if(!l){g.n=5;break}return m=Ec.extractPaywallUrls(o),g.n=4,a(t.resolvePaywallsByUrls(m));case 4:c=g.v,d=c.paywalls,wo.reconcile(new Set(m)),g.n=7;break;case 5:return g.n=6,a(t.fetchPaywalls());case 6:d=g.v;case 7:return f=Date.now()-h,v=Date.now()-n,l&&!c||(p=c?`, urls=${c.urls}, hashed=${c.hashed}, cache_hits=${c.cacheHits}, fetched=${c.fetched}, cache_after_fetch_failure=${c.cacheAfterFetchFailure}, failed=${c.failed}`:"",Bi.debug(`Paywall fetch telemetry: strategy=${l?"individual":"bulk"}, count=${d.length}${p}, total=${v}ms, campaigns=${u}ms, paywalls=${f}ms`+(c?`, retry_count=${c.retryCount}`:""))),c&&t.renewCacheHits(c),g.a(2,e.finalizeCampaignRules(o,d))}},null,null,null,Promise)}},{key:"reRenderPaywall",value:function(){we().ui.reRenderPaywall()}}])}();function gf(e){return Array.isArray(e)?e.map(gf):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=gf(n)),e),{}):e}function yf(e,t){return Pc(gf(e),gf(t))}pf.instance=new pf;var bf,wf,kf,Sf=function(){return c(function e(){o(this,e),this.load()},[{key:"setExternalId",value:function(e){return this.externalId=e,this}},{key:"getExternalId",value:function(){return this.externalId}},{key:"isLoggedIn",value:function(){return!!this.externalId}},{key:"save",value:function(){return this.externalId?Po.setNamiProfile({externalId:this.externalId}):Po.removeNamiProfile(),this}},{key:"load",value:function(){var e=Po.getNamiProfile();e&&(this.externalId=e.externalId),Bm.setIsLoggedIn(!!this.externalId)}},{key:"loginLocal",value:function(e){this.setExternalId(e).save(),Bm.setIsLoggedIn(!0)}},{key:"loginRemote",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return n.n=1,a(il.instance.login(e));case 1:(t=n.v).external_id&&t.external_id!==this.externalId&&this.setExternalId(t.external_id).save();case 2:return n.a(2)}},null,this,null,Promise)}},{key:"logoutLocal",value:function(){this.setExternalId(void 0).save(),Bm.setIsLoggedIn(!1)}},{key:"logoutRemote",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(il.instance.logout());case 1:return e.a(2)}},null,null,null,Promise)}},{key:"login",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return this.loginLocal(e),t.n=1,a(this.loginRemote(e));case 1:return t.a(2)}},null,this,null,Promise)}},{key:"logout",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return this.logoutLocal(),e.n=1,a(this.logoutRemote());case 1:return e.a(2)}},null,this,null,Promise)}}])}();Sf.instance=new Sf;var Ef=function(){function e(){o(this,e),bf.set(this,!1),wf.set(this,null),kf.set(this,null),this.maxLogging=!1}return c(e,[{key:"isInitialized",get:function(){return Se(this,bf,"f")||null!=Po.getNamiConfig()}},{key:"listenForAppForeground",value:function(){var e,t,n,i,a=we().device;Se(this,wf,"f")||Ee(this,wf,null!==(e=null===(t=a.onAppForeground)||void 0===t?void 0:t.call(a,()=>{pf.instance.foreground()}))&&void 0!==e?e:null);Se(this,kf,"f")||Ee(this,kf,null!==(n=null===(i=a.onAppBackground)||void 0===i?void 0:i.call(a,()=>vf.shared.appDidEnterBackground()))&&void 0!==n?n:null)}},{key:"initializeSDK",value:function(t){var n,i,r,o,s,u,l,d,c,h;return k(function(f){for(;;)switch(f.n){case 0:if(o=!1,s=!1,u=Se(this,bf,"f")?Po.getNamiConfig():null,Bi.setLogger(t.logLevel),e.instance.maxLogging=null!==(n=t.maxLogging)&&void 0!==n&&n,null===u){f.n=3;break}if(delete(l=m({},t)).initialConfig,!yf(l,u)){f.n=1;break}return Bi.warn("Nami SDK is already configured, ignoring this configure call."),f.a(2,{sdkInitialized:!0,configureState:ki});case 1:s=!0;case 2:d=pu(t.namiCommands),c=pu(u.namiCommands),t.appPlatformID==u.appPlatformID&&d==c||(o=!0),t.namiLanguageCode===u.namiLanguageCode&&t.logLevel==u.logLevel||(s=!0);case 3:return o&&(Bi.info("SDK full reconfigure called"),Po.resetDevice()),Ee(this,bf,!0),il.configure(t),this.listenForAppForeground(),f.n=4,a(pf.instance.init(t));case 4:return Bi.info("SDK successfully initialized!"),h=s||o?bi:gi,null===(i=(r=we().ui).postConfigure)||void 0===i||i.call(r),qm.mark("ready"),f.a(2,{sdkInitialized:!0,configureState:h})}},null,this,null,Promise)}}],[{key:"sdkVersion",value:function(){return Le}},{key:"sdkPackageVersion",value:function(){return Re}},{key:"reset",value:function(){var t,n,i,r,o,s,u;return k(function(l){for(;;)switch(l.n){case 0:return vf.shared.reset(),Po.clearAll(),wo.purgeAll(),Jc(),Ee(e.instance,bf,!1),null===(t=Se(o=e.instance,wf,"f"))||void 0===t||t.call(o),Ee(e.instance,wf,null),null===(n=Se(s=e.instance,kf,"f"))||void 0===n||n.call(s),Ee(e.instance,kf,null),pf.instance.clearResumeState(),Sf.instance.setExternalId(void 0),Bm.reset(),il.reset(),Ec.instance.reset(),lf.shared.reset(),l.n=1,a(Promise.resolve().then(function(){return Lv}));case 1:u=l.v,u.NamiFlowManager.reset(),null===(i=(r=we().ui).onReset)||void 0===i||i.call(r);case 2:return l.a(2)}},null,null,null,Promise)}},{key:"registerExternalImpression",value:function(){e.instance.isInitialized?vf.shared.externalImpressionRegistered():Bi.warn("Nami.registerExternalImpression() ignored: call Nami.configure() first")}},{key:"configure",value:function(t){return k(function(n){for(;;)switch(n.n){case 0:if(qm.start(t.namiCommands),t.appPlatformID){n.n=1;break}throw new Do;case 1:return this.setInitialConfig(t),qm.mark("initial_config_decoded"),n.n=2,a(e.instance.initializeSDK(t));case 2:return n.a(2,n.v)}},null,this,null,Promise)}},{key:"setInitialConfig",value:function(e){if(null!=e.initialConfig){if("string"==typeof e.initialConfig){Bi.debug("[DEPRECATED] NamiConfiguration.initialConfig should be an object");var t=function(e){var t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(t)}catch(e){return}}(e.initialConfig);if(!t)return Bi.error("Failed to parse NamiConfiguration.initialConfig"),void(e.initialConfig={});e.initialConfig=t}if("object"!=typeof e.initialConfig)e.initialConfig={};else if((e=>"object"==typeof e&&"initial_config"in e)(e.initialConfig)){var n=Eu(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},Bi.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();bf=new WeakMap,wf=new WeakMap,kf=new WeakMap,Ef.instance=new Ef;var Pf,_f,Tf,Mf=new Set(["fullscreen","sheet","compact_sheet","modal"]);e.NamiPaywallManagerEvents=void 0,(Pf=e.NamiPaywallManagerEvents||(e.NamiPaywallManagerEvents={})).BuySku="RegisterBuySKU",Pf.Close="PaywallCloseRequested",Pf.SignIn="PaywallSignInRequested",Pf.Restore="PaywallRestoreRequested",Pf.DeeplinkAction="PaywallDeeplinkAction",e.NamiPaywallAction=void 0,(_f=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",_f.SELECT_SKU="SELECT_SKU",_f.RESTORE_PURCHASES="RESTORE_PURCHASES",_f.SIGN_IN="SIGN_IN",_f.CLOSE_PAYWALL="CLOSE_PAYWALL",_f.SHOW_PAYWALL="SHOW_PAYWALL",_f.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",_f.PURCHASE_SUCCESS="PURCHASE_SUCCESS",_f.PURCHASE_FAILED="PURCHASE_FAILED",_f.PURCHASE_CANCELLED="PURCHASE_CANCELLED",_f.PURCHASE_PENDING="PURCHASE_PENDING",_f.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",_f.PURCHASE_DEFERRED="PURCHASE_DEFERRED",_f.DEEPLINK="DEEPLINK",_f.TOGGLE_CHANGE="TOGGLE_CHANGE",_f.PAGE_CHANGE="PAGE_CHANGE",_f.SLIDE_CHANGE="SLIDE_CHANGE",_f.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",_f.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",_f.VIDEO_STARTED="VIDEO_STARTED",_f.VIDEO_PAUSED="VIDEO_PAUSED",_f.VIDEO_RESUMED="VIDEO_RESUMED",_f.VIDEO_ENDED="VIDEO_ENDED",_f.VIDEO_CHANGED="VIDEO_CHANGED",_f.VIDEO_MUTED="VIDEO_MUTED",_f.VIDEO_UNMUTED="VIDEO_UNMUTED",_f.COUNTDOWN_TIMER_COMPLETED="COUNTDOWN_TIMER_COMPLETED",_f.UNKNOWN="UNKNOWN",e.LaunchCampaignError=void 0,(Tf=e.LaunchCampaignError||(e.LaunchCampaignError={})).DEFAULT_CAMPAIGN_NOT_FOUND="Default campaign not found",Tf.LABELED_CAMPAIGN_NOT_FOUND="Labeled campaign not found",Tf.CAMPAIGN_DATA_NOT_FOUND="Campaign data not found",Tf.PAYWALL_ALREADY_DISPLAYED="Paywall is already being displayed",Tf.SDK_NOT_INITIALIZED="SDK has not been initialized",Tf.PAYWALL_COULD_NOT_DISPLAY="Failed to display paywall",Tf.URL_CAMPAIGN_NOT_FOUND="URL campaign not found",Tf.PRODUCT_DATA_NOT_FOUND="Product data not found",Tf.PRODUCT_GROUPS_NOT_FOUND="Product groups not found",Tf.FLOW_SCREEN_DATA_UNAVILABLE="Flow unavailable due to missing screen data";var Af,Df="entry",xf="screen",Cf="branch",If="exit",Lf="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.SET_TAGS_FROM_FORM="setTagsFromForm",e.PAUSE="flowPause",e.RESUME="flowResume",e.SET_LAUNCH_CONTEXT="setLaunchContext",e.SET_FLOW_PATH="setFlowPath"}(Af||(Af={}));var Ff="__handoff_sequence__",Rf={Push:"push",Location:"location",Tracking:"att",Deeplink:"deeplink",Complete:"complete",SignIn:"signin",Restore:"restore",SignInMvpd:"signin_mvpd",BuySku:"buysku",UserData:"userdata"};var Of={Push:"push",Location:"location",Tracking:"tracking",Camera:"camera",Microphone:"microphone",Photos:"photos",Contacts:"contacts",Bluetooth:"bluetooth",Calendar:"calendar",Biometrics:"biometrics",Health:"health",Motion:"motion",Speech:"speech",LocalNetwork:"localNetwork"},$f={[Of.Push]:"push_authorized",[Of.Location]:"location_authorized",[Of.Tracking]:"tracking_authorized"},Nf="__buy_sku__",Wf="__default__",jf="__appear__",Bf="__disappear__",zf="__login_success__",Uf="__login_failure__",Hf="__logout_success__",Gf="__logout_failure__",Vf="__purchase_success__",Kf="__purchase_failure__",Yf="__remoteback__",Xf="__tag_update__",qf="__permission_granted__",Jf="and",Qf="or",Zf="i_contains",ev="equals",tv="i_equals",nv="not_equals",iv="not_i_equals",av="not_contains",rv="contains",ov="set",sv="not_set",uv="greater_than",lv="greater_than_or_equal_to",dv="less_than",cv="less_than_or_equal_to";function hv(e){if("boolean"==typeof e)return null;if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){var t=e.trim();if(""===t)return null;var n=Number(t);return Number.isFinite(n)?n:null}return null}function mv(){var e;return()=>null!=e?e:e=Nm()}var fv=function(){function e(){o(this,e),this.resolvers=new Map,this.namespaceResolvers=new Map}return c(e,[{key:"registerNamespaceResolver",value:function(e,t){this.namespaceResolvers.set(e,t)}},{key:"resetResolvers",value:function(){this.resolvers.clear()}},{key:"evaluate",value:function(e){var t,n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;var i=mv(),a=n.map(e=>this.evaluateFilter(e,i));switch(e.operator){case Jf:return a.every(e=>e);case Qf:return a.some(e=>e);default:return a.every(e=>e)}}},{key:"evaluateOrdered",value:function(e){var t;if(!e)return!0;var n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;var i=mv();switch(e.operator){case Jf:for(var a,r=h(n);!(a=r()).done;){var o=a.value;if(!this.evaluateFilter(o,i))return!1}return!0;case Qf:for(var s,u=h(n);!(s=u()).done;){var l=s.value;if(this.evaluateFilter(l,i))return!0}return!1;default:for(var d,c=h(n);!(d=c()).done;){var m=d.value;if(!this.evaluateFilter(m,i))return!1}return!0}}},{key:"evaluateFilter",value:function(e,t=mv()){if($m(e.identifier))return((e,t)=>{if(!$m(e.identifier)||Number.isNaN(t.getTime()))return!1;switch(e.identifier.slice(Gn.length)){case"dayOfWeek":if("equals"!==e.operator&&"not_equals"!==e.operator)return!1;var n=Lm(e.values,Cm);if(!n)return!1;var i=n.map(({zone:e})=>xm(t,e));if(i.some(e=>null===e))return!1;var a=n.some(({day:e},t)=>i[t].dayOfWeek===e);return"equals"===e.operator?a:!a;case"timeOfDay":var r=Om(e.operator),o=r?Lm(e.values,Im):null;if(!r||!o)return!1;var s=o.map(({zone:e})=>xm(t,e));return!s.some(e=>null===e)&&o.some(({minutes:e},t)=>r(s[t].minutes,e));case"now":var u=Om(e.operator),l=u?Lm(e.values,Am):null;return!(!u||!l)&&l.some(e=>u(t.getTime(),e.getTime()));default:return!1}})(e,t());var n=this.resolve(e.identifier);if(Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] resolve(${e.identifier}) → ${JSON.stringify(n)} (type: ${typeof n})`),e.operator===ov)return null!=n;if(e.operator===sv)return null==n;if(null==n)return Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] ${e.identifier} resolved to null — registeredNamespaces: [${[...this.namespaceResolvers.keys()].join(", ")}]`),!![nv,iv,av].includes(e.operator);switch(e.operator){case Zf:return Array.isArray(n)?e.values.some(e=>"string"==typeof e&&n.some(t=>0===t.localeCompare(e,void 0,{sensitivity:"accent"}))):(this.log("Resolved value is not an array of strings for i_contains."),!1);case ev:return e.values.some(e=>this.strictEquals(n,e,!1));case tv:return e.values.some(e=>this.strictEquals(n,e,!0));case nv:return e.values.every(e=>!this.strictEquals(n,e,!1));case iv:return e.values.every(e=>!this.strictEquals(n,e,!0));case rv:return!(!Array.isArray(n)&&"string"!=typeof n)&&e.values.some(e=>"string"==typeof e&&n.includes(e));case av:return Array.isArray(n)?e.values.every(e=>!("string"==typeof e&&n.includes(e))):e.values.every(e=>"string"!=typeof n||"string"!=typeof e||!n.includes(e));case uv:case lv:case dv:case cv:var i=hv(n);return null===i?(this.log(`Resolved value is not numerically comparable for ${e.operator}`),!1):e.values.some(t=>{var n=hv(t);if(null===n)return!1;switch(e.operator){case uv:return i>n;case lv:return i>=n;case dv:return i<n;default:return i<=n}});default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"strictEquals",value:function(e,t,n){return"string"==typeof e&&"string"==typeof t?n?0===e.localeCompare(t,void 0,{sensitivity:"accent"}):e===t:("boolean"==typeof e&&"boolean"==typeof t||"number"==typeof e&&"number"==typeof t)&&e===t}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] resolve(${e}) — exact hit: ${JSON.stringify(t)}`),t;var n=e.lastIndexOf(".");if(-1===n);else{var i=e.slice(0,n),a=e.slice(n+1),r=this.resolveRaw(i);if(void 0!==r){var o=this.extractProperty(a,r);return Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] resolve(${e}) — fallback: base=${i} → ${typeof r}, extract(.${a}) → ${JSON.stringify(o)}`),o}this.log(`Could not resolve base identifier: ${i}`)}}},{key:"resolveRaw",value:function(e){for(var t,n=[...this.namespaceResolvers.keys()].sort((e,t)=>t.length-e.length),i=h(n);!(t=i()).done;){var a=t.value;if(e.startsWith(a)){var r=this.namespaceResolvers.get(a);if(r){var o=r(e);return Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] resolveRaw(${e}) — ns=${a} → ${JSON.stringify(o)}`),o}}}}},{key:"extractProperty",value:function(e,t){switch(e){case"last":if(Array.isArray(t))return t[t.length-1];break;case"first":if(Array.isArray(t))return t[0];break;case"count":if(Array.isArray(t))return t.length;if(t&&"object"==typeof t)return Object.keys(t).length;break;default:return}this.log(`Could not extract .${e} from type ${typeof t}`)}},{key:"log",value:function(e){Bi.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),vv=function(){return c(function e(){o(this,e)},[{key:"register",value:function(){fv.shared.registerNamespaceResolver(this.namespace,e=>{var t=e.replace(new RegExp(`^${this.namespace}\\.`),"");return this.resolveValue(t)})}},{key:"resolveKeyPath",value:function(e,t){for(var n,i=t,a=h(e.replace(/\[(\w+)\]/g,".$1").split(".").filter(Boolean));!(n=a()).done;){var r=n.value;if(null==i||"object"!=typeof i)return;i=i[r]}return i}}])}(),pv=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t)).namespace="LaunchContext",i.context=e,i.campaign=n,i.register(),i}return p(t,e),c(t,[{key:"resolveValue",value:function(e){var t,n,i,a;if("placement"===e)return null!==(t=null===(n=this.campaign)||void 0===n?void 0:n.value)&&void 0!==t?t:void 0;if("tags"===e)return null!==(i=null===(a=this.campaign)||void 0===a?void 0:a.placement_tags)&&void 0!==i?i:void 0;if(e.startsWith("customAttributes.")){var r=e.substring(17);return this.resolveKeyPath(r,this.context.customAttributes)}if(e.startsWith("customObject.")){var o=e.substring(13);return this.resolveKeyPath(o,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(vv),gv=function(e){function t(){var e,n,i,a;o(this,t),(a=r(this,t)).namespace="Device";var s=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",u=Intl.DateTimeFormat().resolvedOptions().timeZone,l=Vu(),d=we().device.getScreenInfo();return a.context={osName:l.os_name,osVersion:l.os_version,appVersion:l.extended_platform_version,sdkVersion:l.sdk_version,deviceModel:l.device_model,screenWidth:Math.round(d.width),screenHeight:Math.round(d.height),formFactor:l.form_factor,tvQuality:a.tvQuality(null!==(e=l.form_factor)&&void 0!==e?e:"desktop",d),tvResolution:a.tvResolution(null!==(n=l.form_factor)&&void 0!==n?n:"desktop",d),screenSize:a.screenSizeTier(null!==(i=l.form_factor)&&void 0!==i?i:"desktop",d),language:l.language,country:s,timezone:u},a.register(),a}return p(t,e),c(t,[{key:"screenSizeTier",value:function(e,t){var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i);switch(e){case"phone":return a<1136?"tiny":a<1334?"small":a<1920?"medium":a<2560?"large":"huge";case"tablet":return a<2048?"medium":a<2732?"large":"huge";case"television":return a<1920?"medium":a<3840?"large":"huge";case"desktop":return a<1440?"small":a<2560?"medium":a<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e,t){if("television"!==e)return"";var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i),r=Math.min(n,i);return a>=3840||r>=2160?"4K":a>=1920||r>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e,t){if("television"!==e)return"";var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i),r=Math.min(n,i);return r<720&&a<1280?"SD":r>=720&&r<1080&&a>=1280&&a<1920?"720p":r>=1080&&r<1440&&a>=1920&&a<2560?"1080p":r>=1440&&r<2160&&a>=2560&&a<3840?"1440p":r>=2160&&r<3e3&&a>=3840&&a<5e3?"4K":r>=3e3&&a>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(vv),yv=[/(^|_)api(_|$)?key/i,/^key$/i,/^token$/i,/id[_-]?token/i,/access[_-]?token/i,/^auth/i,/password/i,/secret/i,/signature/i,/hmac/i,/^jwt$/i,/^code$/i,/redirect[_-]?uri/i,/return[_-]?url/i,/^state$/i,/^session$/i,/^sid$/i,/^sso$/i,/assertion/i],bv=function(){function e(){o(this,e),this.params={},"undefined"!=typeof window&&this.setSearchParams()}return c(e,[{key:"setSearchParams",value:function(){this.params=this.extractSafeParams()}},{key:"safeValue",value:function(e){if(!e)return null;try{var t=decodeURIComponent(e).trim();return!t||/^null|undefined$/i.test(t)||((e=>e.includes("://")||/^\/.*\?/.test(e))(t)||(e=>/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/.test(e))(t)||(e=>/^[A-Za-z0-9_-]{40,}$/.test(e)||/^[A-Fa-f0-9]{40,}$/.test(e)||/^ya29\./.test(e)||/^sk_/.test(e)||/^ghp_/.test(e))(t))?null:((e,t=128)=>e.length>t?e.slice(0,t):e)(t)}catch(e){return null}}},{key:"extractSafeParams",value:function(){var e=window.location,t={},n=new Set;try{for(var i,a=new URLSearchParams(e.search),r=(e,i)=>{var a=(e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[-\s]/g,"_").toLowerCase())(e);if(!(n.size>=10||(e=>yv.some(t=>t.test(e)))(a))){var r=this.safeValue(i);r&&(t[a]=r,n.add(a))}},o=h(a.entries());!(i=o()).done;){var s=i.value;r(s[0],s[1])}}catch(e){}return t}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"refresh",value:function(){"undefined"!=typeof window&&this.instance.setSearchParams()}}])}();bv._instance=null;var wv=()=>bv.instance.params;function kv(e){if(null!=e&&""!==e){if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e){if(!Number.isFinite(e))return;return String(e)}return String(e)}}var Sv,Ev=/\{\{\s*([^}]+?)\s*\}\}/g,Pv=/\$\{[^}]+\}/g,_v=function(){return c(function e(t){o(this,e),this.flowManager=t,this.urlParams=wv()},[{key:"currentScreenPaywall",value:function(){var e,t,n=null===(e=this.flowManager.currentFlow)||void 0===e||null===(e=e.currentFlowStep)||void 0===e?void 0:e.screen;if(n)return(null===(t=this.screenPaywallLookup)||void 0===t?void 0:t.screenId)!==n&&(this.screenPaywallLookup={screenId:n,paywall:ul(n)}),this.screenPaywallLookup.paywall}},{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k;if("now"===e||"now.ms"===e||"now.iso"===e)return null!==(k=this.nowMs)&&void 0!==k||(this.nowMs=Nm().getTime()),((e,t)=>{switch(e){case"now":return String(Math.floor(t/1e3));case"now.ms":return String(t);case"now.iso":return new Date(t).toISOString();default:return}})(e,this.nowMs);var S=this.flowManager.currentFlow,E=null==S?void 0:S.component;if(e.startsWith("launchContext.")){var P=null==S?void 0:S.context;if(P){var _=e.substring(14),T=new pv(P,null==S?void 0:S.campaign).resolveValue(_);return Array.isArray(T)?T.join(","):null==T?void 0:T.toString()}}else{if(e.startsWith("form.")){var M,A=e.substring(5);return kv(null===(M=Bm.currentProvider)||void 0===M?void 0:M.state.formStates[A])}if(e.startsWith("sku.")){var D=null==S?void 0:S.purchasedSku;if(!D)return;var x=e.substring(4);switch(x){case"sku_ref_id":return D.skuRefId;case"name":return D.name;case"entitlement_ref_id":return null!==(t=null===(n=D.entitlements[0])||void 0===n?void 0:n.entitlement_ref_id)&&void 0!==t?t:"";case"entitlement_name":return null!==(i=null===(a=D.entitlements[0])||void 0===a?void 0:a.name)&&void 0!==i?i:"";default:var C=wh(x,D.productDetails);return null!=C?String(C):void 0}}switch(e){case"campaignId":return null==E||null===(r=E.campaign)||void 0===r?void 0:r.rule;case"campaignName":return null==E||null===(o=E.campaign)||void 0===o?void 0:o.name;case"campaignLabel":case"campaignPlacement":return null!==(s=null==E||null===(u=E.campaign)||void 0===u?void 0:u.value)&&void 0!==s?s:void 0;case"campaignSegment":case"campaignSegmentId":return null==E||null===(l=E.campaign)||void 0===l?void 0:l.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(d=null==E||null===(c=E.campaign)||void 0===c?void 0:c.external_segment)&&void 0!==d?d:void 0;case"pageName":return null!==(h=null===(m=this.currentScreenPaywall())||void 0===m?void 0:m.name)&&void 0!==h?h:null==E||null===(f=E.paywall)||void 0===f?void 0:f.name;case"pageId":return null!==(v=null==S||null===(p=S.currentFlowStep)||void 0===p?void 0:p.screen)&&void 0!==v?v:null==E||null===(g=E.paywall)||void 0===g?void 0:g.id;case"flowName":return null==S?void 0:S.name;case"flowId":return null==S?void 0:S.id;case"objectId":return null==E||null===(y=E.campaign)||void 0===y||null===(y=y.flow)||void 0===y?void 0:y.object_id;case"stepName":return null==S||null===(b=S.currentFlowStep)||void 0===b?void 0:b.name;case"buttonText":var I=null==S?void 0:S.currentButton;if(!I)return;var L=I.firstTextValue;if("function"!=typeof L)return;return L.call(I);case"slideNumber":var F=null==E?void 0:E.getSelectedSlideIndexForCurrentCarousel();return null!=F?`${F+1}`:void 0;case"productGroupId":return(null===(w=Bm.currentProvider)||void 0===w?void 0:w.state.currentGroupId)||void 0;case"productGroupName":var R,O,$,N=null===(R=Bm.currentProvider)||void 0===R?void 0:R.state;return null!==(O=null==N||null===($=N.groups)||void 0===$||null===($=$.find(e=>e.id===N.currentGroupId))||void 0===$?void 0:$.displayName)&&void 0!==O?O:void 0;case"productGroupRef":var W,j,B,z=null===(W=Bm.currentProvider)||void 0===W?void 0:W.state;return null!==(j=null==z||null===(B=z.groups)||void 0===B||null===(B=B.find(e=>e.id===z.currentGroupId))||void 0===B?void 0:B.ref)&&void 0!==j?j:void 0;case"flowPath":return null==S?void 0:S.flowPath;default:return}}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Ev,(e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}).replace(Pv,"")}},{key:"interpolateDeep",value:function(e){return"string"==typeof e?this.interpolateLiquidVariables(e):Array.isArray(e)?e.map(e=>this.interpolateDeep(e)):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>m({},e,{[t]:this.interpolateDeep(n)}),{}):e}}])}(),Tv=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="urlParams",e.context=wv(),e.register(),e}return p(t,e),c(t,[{key:"resolveValue",value:function(e){return Bi.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(vv),Mv=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="state",e.register(),e}return p(t,e),c(t,[{key:"getContextProvider",value:function(){var e=Bm.providers;if(0!==e.length){var t=e.find(e=>e.flow);return t||e[e.length-1]}}},{key:"resolveValue",value:function(e){var t=this.getContextProvider();if(t){if(e.startsWith("formStates.")){var n=e.substring(11);return t.getCurrentFormId(n)}return this.resolveKeyPath(e,t.state)}}}])}(vv),Av=function(e){function t(e){var n;return o(this,t),(n=r(this,t)).namespace="Placement",n.campaign=e,n.register(),n}return p(t,e),c(t,[{key:"resolveValue",value:function(e){var t;if("label"===e){if(this.campaign&&void 0!==this.campaign.value&&null!==this.campaign.value)return this.campaign.value;var n=Bm.providers;if(0!==n.length){var i=n.find(e=>e.flow);return i?i.getCurrentPlacementLabel():null===(t=n[n.length-1])||void 0===t?void 0:t.getCurrentPlacementLabel()}}}}])}(vv),Dv=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).namespace="LastLaunchContext",e}return p(t,e),c(t,[{key:"register",value:function(){_(t,"register",this)([])}},{key:"resolveValue",value:function(e){var t=lf.shared.previous;if(t){if("placement"===e)return t.placementLabel;if("tags"===e)return t.tags;if(e.startsWith("customAttributes.")){var n=e.substring(17);return this.resolveKeyPath(n,t.customAttributes)}}}}])}(vv);!function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(Sv||(Sv={}));var xv=e=>{var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:if(!Qc()){n.n=1;break}return Bi.info("Skipping transaction post - anonymous mode"),n.a(2);case 1:return n.p=1,n.n=2,a(il.instance.postConversion(e));case 2:n.n=4;break;case 3:n.p=3,t=n.v,Bi.error("Error posting conversion",t);case 4:return n.a(2)}},null,null,[[1,3]],Promise)},Cv=function(){return c(function e(){o(this,e),this.emitter=Sc.getInstance()},[{key:"sdkInitialized",get:function(){return Ef.instance.isInitialized}}],[{key:"allPaywalls",value:function(){if(!this.instance.sdkInitialized)throw new Ao;return sl()}},{key:"setProductDetails",value:function(e){this.instance.productDetails=e,Bm.setProductDetails(e)}},{key:"registerSignInHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.SignIn,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.SignIn,t)}}},{key:"registerCloseHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.Close,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.Close,t)}}},{key:"registerDeeplinkActionHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.DeeplinkAction,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.DeeplinkAction,t)}}},{key:"registerBuySkuHandler",value:function(t){return wu()&&Bi.debug("This handler will not be invoked because this account's plan includes built-in purchase management. Contact support@namiml.com for details."),this.instance.emitter.addListener(e.NamiPaywallManagerEvents.BuySku,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.BuySku,t)}}},{key:"registerRestoreHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.Restore,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.Restore,t)}}},{key:"buySkuComplete",value:function(e){return k(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,a(this.reportPurchaseComplete(e));case 1:return t.p=1,vf.shared.requestRefresh(!0),t.f(1);case 2:return t.a(2)}},null,this,[[0,,1,2]],Promise)}},{key:"reportPurchaseComplete",value:function(e){var t,n,i,r,o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:if(Bm.setPurchaseInProgress(!1),Iv.instance.flowOpen&&(t=Iv.instance.currentFlow,n=null==t?void 0:t.currentFlowStep,t&&n&&t.executeLifecycle(n,Vf)),!Rv.inAnonymousMode()){u.n=1;break}return Bi.debug("Skipping purchase validation - anonymous mode"),u.a(2);case 1:if(i=Po.getSessionId(),r=Po.getPurchaseImpression()){u.n=2;break}return Bi.debug("Not sending paywall conversion call complete due to unknown impression"),u.a(2);case 2:return u.p=2,u.n=3,a(xv({purchase_env:"production",app_env:"production",impression:r,session:i,amount:e.amount,currency:e.currency,transaction_id:e.transactionId,sku:e.skuId}));case 3:u.n=5;break;case 4:u.p=4,o=u.v,Bi.error("Error posting conversion",o);case 5:if(gu(Pe.THIRD_PARTY_TRANSACTIONS)){u.n=9;break}return u.p=6,u.n=7,a(il.instance.purchaseValidation({app_env:"production",payload:"",sku:e.skuId}));case 7:u.n=9;break;case 8:u.p=8,s=u.v,Bi.error("Error validating purchase",s);case 9:return u.a(2)}},null,null,[[6,8],[2,4]],Promise)}},{key:"buySkuCancel",value:function(){gu(Pe.THIRD_PARTY_TRANSACTIONS)?Bm.setPurchase(!1):Bi.warn("Call this method is not needed for this app because Nami is responsible for purchase management. Contact support@nami.ml for details.")}},{key:"setAppSuppliedVideoDetails",value:function(e,t){qd(e)?(Bi.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received valid url ${e}`),Bm.setAppSuppliedVideoDetails({url:e,name:t})):Bi.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received invalid url ${e}`)}},{key:"allowUserInteraction",value:function(e){Bi.debug(`NamiPaywallManager: allowUserInteraction called with ${e}`),Bm.setUserInteractionEnabled(e)}}])}();Cv.instance=new Cv,Cv.emitter=Sc.getInstance();var Iv=function(){function e(){o(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"hasHandoffHandler",get:function(){return!!this.handoffStepHandler}},{key:"deliverHandoff",value:function(t,n){var i,a=this.handoffStepHandler;if(a){var r={tag:t,completed:!1};this.pendingHandoff=r,null===(i=this.currentFlow)||void 0===i||i.noteHandoff();a(t,n,n=>{if(r.completed)Bi.warn(`[NamiFlowManager] complete() called more than once for handoff '${t}' — ignored`);else{var i=e.instance.pendingHandoff;i&&i!==r?Bi.warn(`[NamiFlowManager] stale complete() for handoff '${t}' — a newer handoff ('${i.tag}') is pending; ignored`):(r.completed=!0,this.pendingHandoff===r&&(this.pendingHandoff=void 0),e.routeHandoffOutcome(null!=n?n:{kind:"done"}),e.resume())}})}}},{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(t,n,i){var a=new Uv(t,n,this,i);return this.flowOpen=!0,this.currentFlow=a,il.impressionListener=(t,n)=>{var i;null===(i=e.instance.currentFlow)||void 0===i||i.bindImpression(t,n)},a}},{key:"finishFlow",value:function(){var e,t;Ef.instance.maxLogging&&Bi.debug("[NamiFlowManager] finishFlow() — closing flow"),this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear(),null===(e=(t=we().ui).onFlowFinished)||void 0===e||e.call(t)}},{key:"getLastAnimatedFlowProgress",value:function(e){var t;return null!==(t=this.lastAnimatedFlowProgress.get(e))&&void 0!==t?t:0}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.currentFlow&&this.lastAnimatedFlowProgress.set(e,t)}},{key:"getCurrentFlowProgress",value:function(e){if(!this.currentFlow)return 1;var t=this.getCurrentFlowStepPosition();if(!t)return 0;var n=t.index/t.total;return n=Math.max(0,Math.min(1,n)),e&&this.setLastAnimatedFlowProgress(e,n),n}},{key:"getCurrentFlowStepIndex",value:function(){var e=this.getCurrentFlowStepPosition();return e?Math.max(0,Math.min(e.total,e.index)):0}},{key:"getTotalFlowSteps",value:function(){var e,t;return null!==(e=null===(t=this.getCurrentFlowStepPosition())||void 0===t?void 0:t.total)&&void 0!==e?e:0}},{key:"getCurrentFlowStepPosition",value:function(){var e=this.currentFlow;if(!e)return null;var t=e.currentFlowStep;if(!t)return null;var n=e.steps.filter(e=>e.type===xf);if(0===n.length)return null;var i=new Map;n.forEach((e,t)=>i.set(e.id,t));var a=this.buildNavGraph(e),r=n[0];return this.detectBranching(r,i,a)?this.computeBranchingPosition(e,t,r,i,a,n):this.computeLinearPosition(t,i,n)}},{key:"detectBranching",value:function(e,t,n){var i,a=t.get(e.id);return void 0!==a&&new Set((null!==(i=n.get(e.id))&&void 0!==i?i:[]).filter(e=>{var n;return(null!==(n=t.get(e))&&void 0!==n?n:-1)>a})).size>1}},{key:"computeLinearPosition",value:function(e,t,n){var i=t.get(e.id);return void 0===i?{index:0,total:n.length}:{index:i+1,total:n.length}}},{key:"computeBranchingPosition",value:function(e,t,n,i,a,r){if(t.id===n.id)return{index:1,total:2};var o=this.detectBranchRoot(e,n.id,i,t.id),s=[n.id,...this.buildBranchSegment(o,i,a)],u=s.indexOf(t.id);return-1===u?this.computeLinearPosition(t,i,r):{index:u+1,total:s.length}}},{key:"detectBranchRoot",value:function(e,t,n,i){var a=e.stepcrumbs.filter(e=>e.type===xf).map(e=>e.id).find(e=>e!==t&&n.has(e));return void 0!==a?a:n.has(i)?i:(Bi.debug(`detectBranchRoot: fallbackCurrentId (${i}) not found in screens, falling back to page1Id (${t})`),t)}},{key:"buildBranchSegment",value:function(e,t,n){if(!t.has(e))return[];for(var i=[e],a=new Set([e]),r=e,o=function(){var e,o,s=null!==(e=t.get(r))&&void 0!==e?e:-1,u=(null!==(o=n.get(r))&&void 0!==o?o:[]).find(e=>{var n;return(null!==(n=t.get(e))&&void 0!==n?n:-1)>s});if(void 0===u||a.has(u))return 1;a.add(u),i.push(u),r=u};!o(););return i}},{key:"buildNavGraph",value:function(e){var t=this.navGraphCache.get(e);if(t)return t;var n=new Map;e.steps.forEach(e=>{if(e.actions){var t=e.actions;Object.keys(t).sort().forEach(i=>{var a=t[i];Array.isArray(a)&&a.forEach(t=>{t.action&&t.action.forEach(t=>{if("flowNav"===t.function){var i,a=null===(i=t.parameters)||void 0===i?void 0:i.step;a&&(n.has(e.id)||n.set(e.id,new Set),n.get(e.id).add(a))}})})})}});var i=new Map;return n.forEach((e,t)=>{i.set(t,Array.from(e))}),this.navGraphCache.set(e,i),i}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){var e,t,n=null===(e=this.currentFlow)||void 0===e?void 0:e.currentFlowStep;if(!n)return null;var i=null===(t=n.actions)||void 0===t?void 0:t[jf];if(!i)return null;for(var a,r=h(i);!(a=r()).done;)for(var o,s,u=h(null!==(o=a.value.action)&&void 0!==o?o:[]);!(s=u()).done;){var l,d=s.value;if((d.function===Af.NAVIGATE||d.function===Af.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var c=d.parameters.delay,m=Number(c);if(!isNaN(m)&&m>0)return m/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"reset",value:function(){var t=e.instance;t.currentFlow=void 0,t.flowOpen=!1,t.lastAnimatedFlowProgress=new Map,t.navGraphCache=new WeakMap,t.pendingHandoff=void 0}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e;var t=e;return()=>{this.instance.handoffStepHandler===t&&(this.instance.handoffStepHandler=void 0)}}},{key:"routeHandoffOutcome",value:function(t){var n=e.instance.currentFlow,i=null==n?void 0:n.currentFlowStep;switch(t.kind){case"done":return;case"permission":if(!n)return;if(n.handoffState.permissions[t.permission]=t.granted,!t.granted)return;i&&n.executeLifecycle(i,qf);var a=$f[t.permission];return void(a?n.completionSignal(a):Bi.debug(`[NamiFlowManager] permission '${t.permission}' granted — no completion_result mapping yet (state/lifecycle only)`));case"purchase":return void("success"===t.result?Cv.buySkuComplete(t.details):(Bm.setPurchase(!1),n&&i&&n.executeLifecycle(i,Kf)));case"login":if("success"===t.result){var r,o,s=t.details;if(n)n.handoffState.login=m({},null!==(o=s.attributes)&&void 0!==o?o:{});Rv.loggedInId()===s.loginId?n&&i&&n.executeLifecycle(i,zf):Promise.resolve(Rv.login(s.loginId)).catch(e=>{Bi.error("[NamiFlowManager] login from handoff outcome failed",e)});var u=null===(r=Po.getDevice())||void 0===r?void 0:r.customer_data_platform_id;s.cdpId&&s.cdpId!==u&&Promise.resolve(Rv.setCustomerDataPlatformId(s.cdpId)).catch(e=>{Bi.error("[NamiFlowManager] CDP id write-through from handoff outcome failed",e)})}else n&&i&&n.executeLifecycle(i,Uf);return}}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e;var t=e;return()=>{this.instance.eventHandler===t&&(this.instance.eventHandler=void 0)}}},{key:"resume",value:function(){var t,n,i,a=e.instance,r=a.flowOpen,o=a.currentFlow;Ef.instance.maxLogging&&Bi.debug(`[NamiFlowManager] resume() — flowOpen=${r}, hasFlow=${!!o}, currentStep=${null!==(t=null==o||null===(n=o.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"none"}, isPaused=${null!==(i=null==o?void 0:o.isPaused)&&void 0!==i?i:"N/A"}`);var s=e.instance.pendingHandoff,u=!!s&&!s.completed;if(s&&!s.completed&&(s.completed=!0,e.instance.pendingHandoff=void 0,Bi.warn(`[NamiFlowManager] resume() called during handoff '${s.tag}' with a v2 handler registered — treated as complete({kind:'done'}); prefer complete(outcome)`)),r&&o&&o.currentFlowStep){var l=o.consumeResumeSatisfiedByTypedNavigation();return o.activeHandoffSequence?(Bi.debug(`Resuming flow at handoff sequence ${o.currentFlowStep.id}`),void o.resumeNextHandoff()):o.isPaused&&o.pausedStepID?(Bi.debug(`Resuming paused flow at step ${o.currentFlowStep.id}`),void o.executeLifecycle(o.currentFlowStep,"__resume__")):void(!l||u?(Bi.debug(`Resuming flow at step ${o.currentFlowStep.id}`),o.executeLifecycle(o.currentFlowStep,"__resume__")):Bi.warn(`[NamiFlowManager] dropping redundant resume — a typed lifecycle already navigated away from the step it fired on (now ${o.currentFlowStep.id})`))}Bi.warn("Cannot resume: no active flow or current step")}},{key:"finish",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?(Bi.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.dismiss()):Bi.debug("Cannot finish: no active flow or current step")}},{key:"pause",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?!0===i.resumeFromBookmark?i.pause():Bi.warn("This flow cannot be paused"):Bi.warn("Cannot pause: no active flow or current step")}},{key:"isFlowOpen",value:function(){return e.instance.flowOpen}},{key:"getLastAnimatedFlowProgress",value:function(e){return this.instance.getLastAnimatedFlowProgress(e)}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.instance.setLastAnimatedFlowProgress(e,t)}},{key:"getCurrentFlowProgress",value:function(e){return this.instance.getCurrentFlowProgress(e)}},{key:"getCurrentFlowStepIndex",value:function(){return this.instance.getCurrentFlowStepIndex()}},{key:"getTotalFlowSteps",value:function(){return this.instance.getTotalFlowSteps()}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}();df=()=>Iv.isFlowOpen();var Lv=Object.freeze({__proto__:null,NamiFlowManager:Iv}),Fv=()=>{var e,t;return null!==(e=null===(t=Po.getNamiConfig())||void 0===t||null===(t=t.namiCommands)||void 0===t?void 0:t.includes("disableAsyncLoginLogout"))&&void 0!==e&&e},Rv=function(){return c(function e(){o(this,e),this.emitter=Sc.getInstance(),fv.shared.registerNamespaceResolver("UserTags",t=>{var n,i=t.replace("UserTags.","");return null!==(n=e.getCustomerAttribute(i))&&void 0!==n?n:null})},[{key:"isSDKInitialized",get:function(){return Ef.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return Sf.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||Bi.debug(Ue),Sf.instance.getExternalId()}},{key:"login",value:function(e){var t,n,i,r,o,s,u,l,d;return k(function(c){for(;;)switch(c.p=c.n){case 0:if(this.instance.isSDKInitialized){c.n=1;break}throw t=new Ao,this.invokeStateHandler(Sv.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){c.n=2;break}throw n=new Oo,this.invokeStateHandler(Sv.LOGIN,!1,n),n;case 2:if(Fv()){c.n=3;break}return Sf.instance.loginLocal(e),this.invokeStateHandler(Sv.LOGIN,!0),Iv.instance.flowOpen&&(i=Iv.instance.currentFlow,(r=null==i?void 0:i.currentFlowStep)&&(Ef.instance.maxLogging&&Bi.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${r.id}`),i.executeLifecycle(r,zf))),Sf.instance.loginRemote(e).catch(e=>{Bi.error("[NamiCustomerManager] async login API failed",e)}),Vm.instance.fetchActiveEntitlements().catch(e=>{Bi.error("[NamiCustomerManager] async login entitlement refresh failed",e)}),c.a(2);case 3:return c.p=3,c.n=4,a(Sf.instance.login(e));case 4:return c.n=5,a(Vm.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Sv.LOGIN,!0),Iv.instance.flowOpen&&(o=Iv.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&(Ef.instance.maxLogging&&Bi.debug(`[NamiCustomerManager] login success — triggering __login_success__ on step ${s.id}`),o.executeLifecycle(s,zf))),c.n=7;break;case 6:throw c.p=6,d=c.v,this.invokeStateHandler(Sv.LOGIN,!1,d),Iv.instance.flowOpen&&(u=Iv.instance.currentFlow,(l=null==u?void 0:u.currentFlowStep)&&(Ef.instance.maxLogging&&Bi.debug(`[NamiCustomerManager] login failure — triggering __login_failure__ on step ${l.id}`),u.executeLifecycle(l,Uf))),d;case 7:return c.a(2)}},null,this,[[3,6]],Promise)}},{key:"logout",value:function(){var e,t,n,i,r,o,s,u,l;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(this.instance.isSDKInitialized){d.n=1;break}throw e=new Ao,this.invokeStateHandler(Sv.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){d.n=2;break}throw t=new Oo,this.invokeStateHandler(Sv.LOGOUT,!1,t),t;case 2:if(Fv()){d.n=3;break}return Sf.instance.logoutLocal(),this.invokeStateHandler(Sv.LOGOUT,!0),Iv.instance.flowOpen&&(n=Iv.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&(Ef.instance.maxLogging&&Bi.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${i.id}`),n.executeLifecycle(i,Hf))),Sf.instance.logoutRemote().catch(e=>{Bi.error("[NamiCustomerManager] async logout API failed",e)}),Vm.instance.fetchActiveEntitlements().catch(e=>{Bi.error("[NamiCustomerManager] async logout entitlement refresh failed",e)}),d.a(2);case 3:return d.p=3,d.n=4,a(Sf.instance.logout());case 4:return d.n=5,a(Vm.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Sv.LOGOUT,!0),Iv.instance.flowOpen&&(r=Iv.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,Hf)),d.n=7;break;case 6:throw d.p=6,l=d.v,this.invokeStateHandler(Sv.LOGOUT,!1,l),Iv.instance.flowOpen&&(s=Iv.instance.currentFlow,(u=null==s?void 0:s.currentFlowStep)&&s.executeLifecycle(u,Gf)),l;case 7:return d.a(2)}},null,this,[[3,6]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}},null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(this.updateCustomerDataPlatformId(null));case 1:return e.a(2)}},null,this,null,Promise)}},{key:"registerAccountStateHandler",value:function(e){return this.instance.emitter.on("accountStateChange",e),()=>{this.instance.emitter.off("accountStateChange",e)}}},{key:"setAnonymousMode",value:function(e){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:if(t=e?Sv.ANONYMOUS_MODE_ON:Sv.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new Ao,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return Bi.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details."),s.a(2);case 2:if(this.inAnonymousMode()!==e){s.n=3;break}return i=e?new Fo:new Ro,this.invokeStateHandler(t,!1,i),s.a(2);case 3:if(!e){s.n=4;break}Po.setAnonymousMode(e),Po.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Sv.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return Po.clearAnonymousMode(),Jc(),o=null===(r=Po.getNamiConfig())||void 0===r?void 0:r.namiCommands,s.n=5,a(_c.instance.createOrUpdateDevice(Vu(o)));case 5:Po.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Sv.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}},null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Qc()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new Ao;var n=Po.getCustomerAttribute(e)!==t;if(Po.setCustomerAttribute(e,t),gu(Pe.PAYWALL_PERSONALIZATION)?(Bm.setCustomerAttribute({[e]:t}),Bi.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):Bi.warn(`The customer attribute ${e} is not available for using on a paywall, because your account's plan does not include paywall personalization. Contact support@nami.ml for details.`),Iv.instance.flowOpen){var i=Iv.instance.currentFlow;if(i){var a,r=i.campaign?null===(a=Kd(i.campaign))||void 0===a?void 0:a.goal:null;"user_context_set"===(null==r?void 0:r.type)&&r.context_key===e&&i.completionSignal("context_set");var o=i.currentFlowStep;o&&i.executeLifecycle(o,Xf)}}vf.shared.customerAttributeSet(e,n)}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Ao;var t=Po.getCustomerAttribute(e);return null!=t?gu(Pe.PAYWALL_PERSONALIZATION)?Bi.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):Bi.warn(`Found customer attribute. ${e} is not available for use on a paywall because paywall personalization is not included in your account's plan. Contact support@nami.ml for details.`):Bi.debug(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Ao;return Po.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Ao;Po.clearCustomerAttribute(e)?(Bm.removeCustomerAttribute(e),Bi.warn(`This customer attribute has been cleared. ${e} is no longer available for paywall personalization on this device. A default value will be used if set in the Nami Control Center.`)):Bi.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Ao;Po.getAllCustomerAttributesKeys().forEach(e=>{Bm.removeCustomerAttribute(e)}),Po.clearAllCustomerAttributes(),Bi.warn("All customer attribute have been cleared. customer's smart text will no longer be personalized for this device. A default value will be used if set in the Nami Control Center.")}},{key:"journeyState",value:function(){if(!this.instance.isSDKInitialized)throw new Ao;return Po.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Po.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:tt}},{key:"registerJourneyStateHandler",value:function(e){if(wu("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(Di,e),()=>{this.instance.emitter.removeListener(Di,e)}}},{key:"invokeStateHandler",value:function(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}},{key:"updateCustomerDataPlatformId",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:if(this.instance.isSDKInitialized){o.n=1;break}throw t=new Ao,this.invokeStateHandler(Sv.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){o.n=6;break}return o.p=2,o.n=3,a(_c.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Sv.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,r=o.v,this.invokeStateHandler(Sv.CUSTOMER_DATA_PLATFORM_ID_SET,!1,r);case 5:o.n=7;break;case 6:return Bi.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Po.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new $o,this.invokeStateHandler(Sv.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i),o.a(2);case 7:return o.a(2)}},null,this,[[2,4]],Promise)}},{key:"anonymousModeCapability",value:function(){if(!this.instance.isSDKInitialized)return!1;var e=gu(Pe.ANONYMOUS_MODE_CAPABILITY),t=gu(Pe.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,a(Promise.all([Tc.instance.fetchProducts(),Uc.instance.fetchPaywalls().then(e=>Ec.instance.fetchCampaignRules(e))]));case 1:return e.a(2)}},null,this,null,Promise)}}])}();Rv.instance=new Rv;var Ov="This field is required",$v="Please enter a valid email address",Nv="Please enter at least 2 characters",Wv=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function jv(e,t,n){var i=("string"==typeof n?n:null==n?"":String(n)).trim();return t&&0===i.length?Ov:0!==i.length?"email"!==e||Wv.test(i)?"name"===e&&i.length<2?Nv:void 0:$v:void 0}var Bv=/^([^:]+)::(.+)$/;var zv=function(){return c(function e(t={}){var n,i,a,r,s;o(this,e),this.id=null!==(n=t.id)&&void 0!==n?n:"",this.name=null!==(i=t.name)&&void 0!==i?i:"",this.steps=null!==(a=t.steps)&&void 0!==a?a:[],this.screens=null!==(r=t.screens)&&void 0!==r?r:[],this.resumeFromBookmark=Boolean(t.resume_from_bookmark),this.transition=null!==(s=t.transition)&&void 0!==s?s:"none"},[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&ll(this.screens)}}])}(),Uv=function(e){function t(e,n,i,a){var s,u;o(this,t),(u=r(this,t,[null!==(s=e.flow.object)&&void 0!==s?s:{}])).stepcrumbs=[],u.branchcrumbs=[],u.activeHandoffSequence=null,u.currentScreenState=null,u.isPaused=!1,u.resumeSatisfiedByTypedNavigation=!1,u.navigationRequestCount=0,u.handoffDeliveryCount=0,u.flowPath="",u.timerStates={},u.handoffState={permissions:{}},u.campaign=e,u.component=n,u.context=a,u.manager=i,u.branchcrumbs=[],u.stepcrumbs=[],u.registerResolvers(a);var l=u.findStepByType(Df);return l&&u.forward(l.id),u}return p(t,e),c(t,[{key:"applyLaunchContextAttributes",value:function(e){var t,n;this.context||(this.context={customAttributes:{}},new pv(this.context,this.campaign)),null!==(n=(t=this.context).customAttributes)&&void 0!==n||(t.customAttributes={}),Object.assign(this.context.customAttributes,e)}},{key:"registerResolvers",value:function(e){e&&new pv(e,this.campaign),new gv,new Tv,new Mv,new Av(this.campaign),(new Dv).register(),fv.shared.registerNamespaceResolver("Flow",e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map(e=>e.id);case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}),fv.shared.registerNamespaceResolver("login",e=>{var t,n=e.replace(/^login\./,"");return null===(t=this.handoffState.login)||void 0===t?void 0:t[n]}),fv.shared.registerNamespaceResolver("permissions",e=>{var t=e.replace(/^permissions\./,"");return this.handoffState.permissions[t]}),fv.shared.registerNamespaceResolver("__first_session__",()=>pf.instance.getIsFirstSession())}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),i=this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type);return t&&n&&i}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find(t=>t.id===e)}},{key:"findStepByType",value:function(e){return this.steps.find(t=>t.type===e)}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some(e=>this.branchcrumbs.includes(e))}},{key:"flowLog",value:function(e,...t){Ef.instance.maxLogging&&Bi.debug(`[NamiFlow] ${e}`,...t)}},{key:"finished",value:function(){var e;this.flowLog(`finished() — closing flow, isPaused=${this.isPaused}, step=${null===(e=this.currentFlowStep)||void 0===e?void 0:e.id}`),this.manager.finishFlow()}},{key:"dismiss",value:function(){this.signalNonCompletion("dismiss_page"),this.finished()}},{key:"back",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){if(!this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type))return this.flowLog("back() — no previous screen step, dismissing flow"),void this.dismiss();this.backToPreviousScreenStep()}else Bi.debug(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"bindImpression",value:function(e,t){var n=this.currentFlowStep;if(n){if(t&&n.screen&&t!==n.screen)return this.flowLog(`bindImpression(${e}) — ignored, fired by page ${t} but the flow is on ${n.screen} (step ${n.id})`),void Bi.debug(`[NamiFlow] not binding impression ${e} from page ${t} to step ${n.id}`);var i=this.completionContext;i&&i.stepId===n.id&&!i.impressionId?i.impressionId=e:this.completionContext={stepId:n.id,impressionId:e,resultSent:!1,pending:[]};var a=n.completion_step;null!=a&&a.enabled&&"page_view"===a.condition&&this.completionSignal("page_view");var r=this.completionContext.pending;this.completionContext.pending=[],r.forEach(e=>this.completionSignal(e))}}},{key:"completionSignal",value:function(e){var t=this.currentFlowStep,n=null==t?void 0:t.completion_step;if(t&&null!=n&&n.enabled&&n.condition===e){var i=this.completionContext;i&&i.stepId===t.id||(i=this.completionContext={stepId:t.id,resultSent:!1,pending:[]}),i.resultSent||(vf.shared.flowCompletionSignaled(this.campaign),i.impressionId?(i.resultSent=!0,this.patchCompletion(i.impressionId,e)):i.pending.includes(e)||i.pending.push(e))}}},{key:"signalNonCompletion",value:function(e){var t=this.completionContext;t&&t.impressionId&&!t.resultSent&&(t.resultSent=!0,this.patchCompletion(t.impressionId,e))}},{key:"patchCompletion",value:function(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return this.flowLog(`patchCompletion(${t}) — impression=${e}, step=${null===(n=this.currentFlowStep)||void 0===n?void 0:n.id}`),r.p=1,r.n=2,a(il.instance.patchImpressionCompletion(e,t,(new Date).toISOString()));case 2:r.n=4;break;case 3:r.p=3,i=r.v,Bi.error(`[NamiFlow] completion PATCH failed for '${t}'`,i);case 4:return r.a(2)}},null,this,[[1,3]],Promise)}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var i,a,r=ul(n.screen);return r&&we().ui.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=Bm.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}Bi.warn("No previous screen step found to return to")}else Bi.warn(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"forward",value:function(e){var t=this.getStep(e);if(t)if(this.isStepActive(t))switch(this.flowLog(`forward(${e}) — type=${t.type}, name=${t.name}, isPaused=${this.isPaused}`),this.navigationRequestCount+=1,t.type){case Df:case If:return this.stepcrumbs.push(t),void this.executeLifecycle(t,Wf);case Cf:return void this.handleBranchStep(t);case xf:return void this.handleScreenStep(t);case Lf:return}else this.flowLog(`forward(${e}) — step not active (branch_tags=${JSON.stringify(t.branch_tags)}, branchcrumbs=${JSON.stringify(this.branchcrumbs)})`);else Bi.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.resumeSatisfiedByTypedNavigation=!1,this.isPaused?Bi.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,this.flowLog(`pause() — pausedStepID=${this.pausedStepID}`),Bi.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,this.flowLog(`resumeFromPause() — resuming from step ${e}`),Bi.info(`Flow resumed from step ${e}`),this.forward(e)}else Bi.warn("No step to resume from");else Bi.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){t===Vf?this.completionSignal("purchase_success"):t===zf&&this.completionSignal("login_success");var i=e.actions[t];if(i){this.flowLog(`executeLifecycle(${t}) — step=${e.id}, isPaused=${this.isPaused}, ${i.length} lifecycle(s)`);var a=this.navigationRequestCount,r=this.handoffDeliveryCount;this.executeFullLifecycles(i,n),(e=>e===zf||e===Vf||e===Uf)(t)&&this.manager.flowOpen&&this.navigationRequestCount!==a&&this.handoffDeliveryCount===r&&(this.resumeSatisfiedByTypedNavigation=!0,this.flowLog(`${t} navigated from step ${e.id}; the next resume() is already satisfied`))}else this.flowLog(`executeLifecycle(${t}) — no actions on step ${e.id}`)}},{key:"consumeResumeSatisfiedByTypedNavigation",value:function(){return!!this.resumeSatisfiedByTypedNavigation&&(this.resumeSatisfiedByTypedNavigation=!1,!0)}},{key:"disarmResumeDrop",value:function(){this.resumeSatisfiedByTypedNavigation=!1}},{key:"noteHandoff",value:function(){this.handoffDeliveryCount+=1,this.resumeSatisfiedByTypedNavigation=!1}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;Bi.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"isFormSubmitLifecycle",value:function(e){var t=[Af.SET_TAGS_FROM_FORM,Af.NEXT,Af.NAVIGATE];return e.some(e=>[e.before,e.action,e.after].some(e=>null==e?void 0:e.some(e=>t.includes(e.function))))}},{key:"captureBuySkuData",value:function(e,t){var n,i,a;e===Nf&&null!=t&&t.sku&&(this.purchasedSku="sku_ref_id"in(n=t.sku)?{skuRefId:n.sku_ref_id,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(a=n.product_details)&&void 0!==a?a:null}:{skuRefId:n.skuId,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(i=n.productDetails)&&void 0!==i?i:null})}},{key:"isStaleTap",value:function(e,t){var n,i=null===(n=this.currentFlowStep)||void 0===n?void 0:n.screen;return!(!t||!i||t===i)&&(this.flowLog(`dropping stale tap ${e} from screen ${t} — the flow is on ${i} (NAM-4395)`),Bi.info(`Ignoring "${e}" from a screen the flow has already left (${t} -> ${i})`),!0)}},{key:"triggerActions",value:function(e,t,n,i){var a,r,o;if(this.captureBuySkuData(e,n),!this.isStaleTap(e,i)){this.resumeSatisfiedByTypedNavigation=!1;var s=this.lifecycles(e);if(s){this.flowLog(`triggerActions(${e}) — step=${null===(a=this.currentFlowStep)||void 0===a?void 0:a.id}, isPaused=${this.isPaused}`),this.currentButton=t;var u=null!==(r=null===(o=Bm.currentProvider)||void 0===o?void 0:o.state.formFieldValidators)&&void 0!==r?r:{};if(this.isFormSubmitLifecycle(s)&&Object.keys(u).length){var l,d=function(e,t){for(var n={},i=0,a=Object.entries(e);i<a.length;i++){var r,o=a[i],s=o[0],u=o[1],l=jv(u.type,u.required,t[s]);void 0!==l&&(n[s]=null!==(r=u.message)&&void 0!==r?r:l)}return n}(u,this.getFormData());if(null===(l=Bm.currentProvider)||void 0===l||l.setFormFieldErrors(d),Object.keys(d).length)return void this.flowLog(`triggerActions(${e}) — HALTED by form validation: ${JSON.stringify(d)}`)}this.executeFullLifecycles(s,n)}}}},{key:"executeFullLifecycles",value:function(e,t){for(var n,i=this,a=function(){var e=n.value,a=["before","action","after"];[e.before,e.action,e.after].forEach((e,n)=>null==e?void 0:e.forEach(e=>{var r=i.shouldRun(e);i.flowLog(` ${a[n]}: ${e.function}${e.id?` (${e.id})`:""} — shouldRun=${r}`),r&&i.performAction(e,t)}))},r=h(e);!(n=r()).done;)a()}},{key:"triggerBeforeActions",value:function(e,t,n,i){if(this.captureBuySkuData(e,n),!this.isStaleTap(e,i)){this.resumeSatisfiedByTypedNavigation=!1;var a=this.lifecycles(e);if(a){this.currentButton=t;for(var r,o=h(a);!(r=o()).done;){var s;null===(s=r.value.before)||void 0===s||s.forEach(e=>this.shouldRun(e)&&this.performAction(e,n))}}}}},{key:"triggerAfterActions",value:function(e,t,n,i){if(this.captureBuySkuData(e,n),!this.isStaleTap(e,i)){this.resumeSatisfiedByTypedNavigation=!1;var a=this.lifecycles(e);if(a){this.currentButton=t;for(var r,o=h(a);!(r=o()).done;){var s;null===(s=r.value.after)||void 0===s||s.forEach(e=>this.shouldRun(e)&&this.performAction(e,n))}}}}},{key:"currentStepHasHoistedPrimaryActions",value:function(e){var t=this.lifecycles(e);return!!t&&t.some(e=>{var t;return null===(t=e.action)||void 0===t?void 0:t.length})}},{key:"shouldRun",value:function(e){if(!e.conditions)return!0;var t=e.conditions.every(e=>{var t=fv.shared.evaluate(e);if(Ef.instance.maxLogging){var n,i,a,r=null!==(n=null===(i=e.filter)||void 0===i?void 0:i.map(e=>`${e.identifier} ${e.operator} ${JSON.stringify(e.values)}`).join(", "))&&void 0!==n?n:"none";Bi.debug(`[NamiFlow] condition: [${r}] op=${null!==(a=e.operator)&&void 0!==a?a:"default"} → ${t}`)}return t});return t}},{key:"performAction",value:function(e,t){var n,i;if(this.currentFlowStep){var a=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0;this.flowLog(`performAction(${e.function}) — step=${this.currentFlowStep.id}, delay=${a}, params=${JSON.stringify(null!==(i=e.parameters)&&void 0!==i?i:{})}`);var r=n=>{var i,a;(null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n?this.runAction(e,t):this.flowLog(`performAction(${e.function}) — SKIPPED stale step ${n}, current=${null===(a=this.currentFlowStep)||void 0===a?void 0:a.id}`)};a?setTimeout(r.bind(this,this.currentFlowStep.id),a):r(this.currentFlowStep.id)}else Bi.warn("No current flow step")}},{key:"runAction",value:function(e,t){var n,i,a,r,o,s,u;switch(e.function){case Af.BACK:this.back();break;case Af.NEXT:null!==(n=e.parameters)&&void 0!==n&&n.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(i=e.parameters)&&void 0!==i&&i.step?this.forward(e.parameters.step):this.next();break;case Af.NAVIGATE:var l;if(null!==(a=e.parameters)&&void 0!==a&&a.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(r=e.parameters)&&void 0!==r&&r.step)(null===(l=this.previousFlowStep)||void 0===l?void 0:l.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Af.FINISHED:this.finished();break;case Af.DISMISS:this.dismiss();break;case Af.EXIT:this.signalNonCompletion("skip_page");var d=this.steps.find(e=>e.type===If);d&&this.forward(d.id);break;case Af.PAUSE:this.pause();break;case Af.RESUME:this.resumeFromPause();break;case Af.HANDOFF:var c,h,m,f,v,p,g=null===(c=e.parameters)||void 0===c?void 0:c.handoffTag;if(!g)break;if(this.noteHandoff(),null!==(h=e.parameters)&&void 0!==h&&h.handoffFormId&&this.completionSignal("form_submitted"),g.startsWith("__")){var y;g===Ff&&null!==(y=e.parameters)&&void 0!==y&&y.handoffFormId?this.flowHandoffFormSequence():(Bi.warn(`Ignoring reserved handoff tag '${g}' — resuming flow`),this.manager.resume());break}if(!this.manager.hasHandoffHandler){Bi.debug("No handoffStepHandler found",e);break}if(g===Rf.UserData&&null!==(m=e.parameters)&&void 0!==m&&m.handoffFormId){this.manager.deliverHandoff(g,this.buildUserDataEnvelope(e.parameters.handoffFormId));break}null!==(f=e.parameters)&&void 0!==f&&f.handoffData?p=new _v(this.manager).interpolateDeep(e.parameters.handoffData):t?p=t:null!==(v=e.parameters)&&void 0!==v&&v.handoffFormId&&(p=this.getFormData()),Bi.debug(`Invoking handoff handler with ${g}${p?` ${JSON.stringify(p)}`:" and no data"}`),this.manager.deliverHandoff(g,p);break;case Af.LOG:var b;if(null!==(o=e.parameters)&&void 0!==o&&o.eventName)Bi.info(`logEvent → ${e.parameters.eventName}`);else Bi.warn(`Missing 'eventName' in logEvent action ${null!==(b=e.id)&&void 0!==b?b:"unknown"}`);break;case Af.TRACK:var w;if(null!==(s=e.parameters)&&void 0!==s&&s.eventName)Bi.info(`trackEvent → ${e.parameters.eventName}`);else Bi.warn(`Missing 'eventName' in logEvent action ${null!==(w=e.id)&&void 0!==w?w:"unknown"}`);break;case Af.SET_VIDEO:null!==(u=e.parameters)&&void 0!==u&&u.name&&e.parameters.url?Bm.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):Bi.warn("Missing name, url for setting video details");break;case Af.BLOCK_BACK:var k,S=null===(k=e.parameters)||void 0===k?void 0:k.step,E=S?this.getStep(S):void 0;E?E.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:Bi.warn("Missing step for blocking back");break;case Af.FLOW_EVENT:var P,_=new _v(this.manager),T=Object.fromEntries(Object.entries(null!==(P=e.parameters)&&void 0!==P?P:{}).map(([e,t])=>[e,_.interpolateDeep(t)]));this.manager.eventHandler?this.manager.eventHandler(T):Bi.warn("Missing event handler",T);break;case Af.FLOW_ENABLED:Bm.setUserInteractionEnabled(!0);break;case Af.FLOW_DISABLED:Bm.setUserInteractionEnabled(!1);break;case Af.SET_TAGS:if(e.parameters){var M=new _v(this.manager).interpolateDeep(e.parameters);Bm.setUserTags(M),Object.entries(M).forEach(([e,t])=>{Rv.setCustomerAttribute(e,t)})}break;case Af.SET_TAGS_FROM_FORM:var A,D=null===(A=e.parameters)||void 0===A?void 0:A.include,x=Array.isArray(D)?new Set(D):void 0,C=this.getFormData(),I={};Object.entries(C).forEach(([e,t])=>{if(!x||x.has(e)){var n=kv(t);void 0!==n&&(I[e]=n,Rv.setCustomerAttribute(e,n))}}),Object.keys(I).length&&Bm.setUserTags(I);break;case Af.SET_LAUNCH_CONTEXT:var L=e.parameters;null!=L&&L.customAttributes?this.applyLaunchContextAttributes(L.customAttributes):void 0!==(null==L?void 0:L.key)&&void 0!==(null==L?void 0:L.value)&&this.applyLaunchContextAttributes({[L.key]:L.value});break;case Af.SET_FLOW_PATH:var F,R=null===(F=e.parameters)||void 0===F?void 0:F.flowPath;"string"==typeof R&&(this.flowPath=R);break;default:Bi.warn(`Missing action handler for ${e.function}`,e)}}},{key:"nextStep",value:function(e){if(e){var t=this.steps.findIndex(t=>t.id===e.id);if(-1!==t){for(var n,i=h(this.steps.slice(t+1));!(n=i()).done;){var a=n.value;if(this.isStepActive(a))return a}Bi.debug(`No active next step found after ${e.id}`)}else Bi.error(`Could not find next step for step ${e.id}`)}else Bi.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=ul(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),we().ui.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):Bi.error("No paywall or campaign found for next step")}},{key:"handleBranchStep",value:function(e){this.stepcrumbs.push(e);for(var t=0,n=Object.entries(e.actions);t<n.length;t++){var i=n[t],a=i[0],r=i[1];if(r)for(var o,s=h(r);!(o=s()).done;){var u=o.value;if(u.action)for(var l,d=h(u.action);!(l=d()).done;){var c,m,f=l.value;if(this.shouldRun(f))return this.branchcrumbs.push(a),null===(c=u.before)||void 0===c||c.forEach(e=>{this.performAction(e)}),u.action.forEach(e=>{this.shouldRun(e)&&this.performAction(e)}),void(null===(m=u.after)||void 0===m||m.forEach(e=>{this.performAction(e)}))}else Bi.warn(`No actions defined for branch tag ${a}`)}}Bi.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return m({},null!==(e=null===(t=Bm.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"buildUserDataEnvelope",value:function(e){var t,n;return{form_id:e,step_id:null!==(t=null===(n=this.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"",collected_at:(new Date).toISOString(),fields:this.getFormData()}}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t);if(0!==n.length){if(n.some(e=>Bv.test(e))){var i=this.buildHandoffGroups(t);return 0===i.length?(Bi.info("No handoff groups after grouping"),this.disarmResumeDrop(),void this.manager.resume()):(this.activeHandoffSequence={groups:i},void this.resumeNextHandoff())}var a=n.sort().filter(e=>!0===t[e]);if(0===a.length)return Bi.info("No eligible handoff keys after filtering"),this.disarmResumeDrop(),void this.manager.resume();this.activeHandoffSequence={formStates:m({},t),remainingKeys:[...a]},this.resumeNextHandoff()}else Bi.warn("formStates is empty, no handoffs to perform")}else Bi.warn("No formStates available for handoff sequence")}},{key:"buildHandoffGroups",value:function(e){for(var t=new Map,n=0,i=Object.keys(e);n<i.length;n++){var a=i[n],r=a.match(Bv);if(r){var o=r[1],s=r[2];o.startsWith("__")?Bi.warn(`Ignoring reserved handoff group tag '${o}'`):(t.has(o)||t.set(o,{}),t.get(o)[s]=e[a])}}return Array.from(t,([e,t])=>({tag:e,data:t})).filter(e=>Object.values(e.data).some(e=>!0===e)).sort((e,t)=>e.tag.localeCompare(t.tag))}},{key:"resumeNextHandoff",value:function(){var e=this.activeHandoffSequence;if(!e)return Bi.warn("No active handoff sequence to resume"),void this.manager.resume();if("groups"in e){if(0===e.groups.length)return Bi.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,this.disarmResumeDrop(),void this.manager.resume();var t=e.groups.shift();return function(e){return Object.values(Rf).includes(e)}(t.tag)||Bi.warn(`handoff group tag '${t.tag}' is outside the NamiHandoffTag vocabulary — passing through`),this.activeHandoffSequence=e,Bi.debug(`Starting grouped handoff for '${t.tag}' → ${JSON.stringify(t.data)}`),void this.manager.deliverHandoff(t.tag,t.data)}if(0===e.remainingKeys.length)return Bi.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,this.disarmResumeDrop(),void this.manager.resume();var n=e.remainingKeys.shift(),i=e.formStates[n];Bi.debug(`Starting handoff for ${n} → ${String(i)}`),this.activeHandoffSequence=e,this.manager.deliverHandoff(`${n}`,void 0)}}])}(zv),Hv=function(){return c(function e(){o(this,e),this.emitter=Sc.getInstance()},[{key:"sdkInitialized",get:function(){return Ef.instance.isInitialized}},{key:"campaignTypeAndLabel",value:function(t,n){var i,a="";return t&&!n&&qd(t)?(a=t,i=e.NamiCampaignRuleType.URL):t?(a=t,i=e.NamiCampaignRuleType.LABEL):n&&(a=n,i=e.NamiCampaignRuleType.URL),{type:i,value:a}}}],[{key:"allCampaigns",value:function(){if(!this.instance.sdkInitialized)throw new Ao;return nc()}},{key:"isCampaignAvailable",value:function(e){if(!this.instance.sdkInitialized)throw new Ao;var t=this.instance.campaignTypeAndLabel(e),n=t.type,i=t.value,a=uc(i,n),r=a.campaign,o=a.paywall;return null!=r&&r.flow?new zv(r.flow.object).allScreensAvailable:Boolean(r&&o)}},{key:"isFlow",value:function(e,t){if(!this.instance.sdkInitialized)throw new Ao;var n=this.instance.campaignTypeAndLabel(e,t),i=n.type,a=n.value;return al(uc(a,i).campaign)}},{key:"refresh",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(this.instance.sdkInitialized){e.n=1;break}throw new Ao;case 1:return bu(),e.n=2,a(pf.instance.fetchCampaignsAndPaywalls());case 2:return e.a(2,nc())}},null,this,null,Promise)}},{key:"registerAvailableCampaignsHandler",value:function(e){return this.instance.emitter.addListener(Ei,e),()=>{this.instance.emitter.removeListener(Ei,e)}}},{key:"launch",value:function(t,n,i,a,r){var o,s,u,l,d,c,h,f,v,p;a=null!=a?a:()=>{},i=null!=i?i:{customAttributes:{}};var g=this.instance.campaignTypeAndLabel(t,n),b=g.type,w=g.value;if(!this.instance.sdkInitialized)throw a(!1,e.LaunchCampaignError.SDK_NOT_INITIALIZED),new Ao;var k,S=qm.firstLaunchLookup(w,()=>uc(w,b)),E=S.paywall,P=S.campaign,_=!P||!E&&!P.flow;_&&(k=t||n?t?e.LaunchCampaignError.LABELED_CAMPAIGN_NOT_FOUND:n?e.LaunchCampaignError.URL_CAMPAIGN_NOT_FOUND:e.LaunchCampaignError.CAMPAIGN_DATA_NOT_FOUND:e.LaunchCampaignError.DEFAULT_CAMPAIGN_NOT_FOUND,a(!1,k),E={});var T={campaignId:null!==(o=null==P?void 0:P.rule)&&void 0!==o?o:"",campaignName:null!==(s=null==P?void 0:P.name)&&void 0!==s?s:"",campaignType:null!==(u=null==P?void 0:P.type)&&void 0!==u?u:"",campaignLabel:t?w:"",campaignUrl:n?w:"",paywallId:null!=P&&P.flow?void 0:(null===(l=E)||void 0===l?void 0:l.id)||"",paywallName:null!=P&&P.flow?void 0:(null===(d=E)||void 0===d?void 0:d.name)||"",segmentId:null==P?void 0:P.segment,externalSegmentId:null!==(c=null==P?void 0:P.external_segment)&&void 0!==c?c:null,action:e.NamiPaywallAction.UNKNOWN},M=Po.getPurchaseChannel();M&&(T=m({},T,{purchaseChannel:M}));var A,D,x,C,I,L,F,R,O=null===(h=i)||void 0===h?void 0:h.productGroups,$=null===(f=E)||void 0===f||null===(f=f.sku_menus)||void 0===f?void 0:f.map(e=>e.ref);if((x=null===(A=Po.getNamiConfig())||void 0===A?void 0:A.namiCommands,null!==(D=null==x?void 0:x.includes(En))&&void 0!==D&&D&&null!=O&&O.length&&null!=$)&&0==(null==$?void 0:$.filter(e=>null==O?void 0:O.some(t=>t===e))).length)throw a(!1,e.LaunchCampaignError.PRODUCT_GROUPS_NOT_FOUND),new Io;if(null!=P&&P.flow&&!ll(null!==(v=null===(p=P.flow.object)||void 0===p?void 0:p.screens)&&void 0!==v?v:[]))throw a(!1,e.LaunchCampaignError.FLOW_SCREEN_DATA_UNAVILABLE),new Lo;_||lf.shared.record({placementLabel:null!==(C=null!==(I=null==P?void 0:P.value)&&void 0!==I?I:w)&&void 0!==C?C:"",tags:null!==(L=null==P?void 0:P.placement_tags)&&void 0!==L?L:[],customAttributes:null!==(F=null===(R=i)||void 0===R?void 0:R.customAttributes)&&void 0!==F?F:{}});_||vf.shared.placementWillRaise();var N=we().ui.createPaywall(b,w,i),W=Yu();return Po.setLaunchId(W),r&&this.instance.emitter.addListener(_i,t=>{var n=t.action,i=y(t,ge);r(m({},T,i,{action:null!=n?n:e.NamiPaywallAction.UNKNOWN}))}),setTimeout(()=>a(!0),0),N}},{key:"getProductGroups",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=uc(o,r).paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.map(e=>e.ref))&&void 0!==n?n:[]}},{key:"getAllProducts",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=uc(o,r).paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.flatMap(e=>{var t,n;return null!==(t=null===(n=e.products)||void 0===n?void 0:n.map(e=>e.sku_ref_id))&&void 0!==t?t:[]}))&&void 0!==n?n:[]}},{key:"getCurrentProducts",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value,s=uc(o,r),u=Bm.currentProvider,l=null==u?void 0:u.getCurrentGroupId();return l&&null!==(n=null===(i=s.paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.filter(e=>e.id===l).flatMap(e=>{var t,n;return null!==(t=null===(n=e.products)||void 0===n?void 0:n.map(e=>e.sku_ref_id))&&void 0!==t?t:[]}))&&void 0!==n?n:[]}}])}();Hv.instance=new Hv;var Gv=Hv,Vv=Rv,Kv=function(){return c(function e(){o(this,e),this.emitter=Sc.getInstance()},[{key:"sdkInitialized",get:function(){return Ef.instance.isInitialized}}],[{key:"active",value:function(){return wu(),Um()}},{key:"isEntitlementActive",value:function(e){return!!wu("NamiEntitlementManager.isEntitlementActive")&&this.active().some(t=>t.referenceId==e)}},{key:"refresh",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(this.instance.sdkInitialized){e.n=1;break}throw new Ao;case 1:if(wu("NamiEntitlementManager.refresh")){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,a(Vm.instance.fetchActiveEntitlements());case 3:return e.a(2,Um())}},null,this,null,Promise)}},{key:"registerActiveEntitlementsHandler",value:function(e){if(wu("NamiEntitlementManager.registerActiveEntitlementsHandler"))return this.instance.emitter.addListener(Mi,e),()=>{this.instance.emitter.removeListener(Mi,e)}}},{key:"clearProvisionalEntitlementGrants",value:function(){var e=Um();e=e.filter(e=>e.expires&&e.expires>(new Date).valueOf()),Po.setNamiEntitlements(Ct,e),this.instance.emitter.emit(Mi)}}])}();Kv.instance=new Kv;var Yv,Xv,qv=Kv,Jv=Iv,Qv=Cv,Zv=eh,ep={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},tp={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},np="wave",ip="pulse",ap="none";function rp(e){var t,n=null!==(t=e.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/))&&void 0!==t?t:[],i=n[0],a=n[1],r=n[2],o=n[3],s=n[4],u=n[5];return{semver:i,major:Number.parseInt(a)||3,minor:Number.parseInt(r)||0,patch:Number.parseInt(o)||0,prerelease:s,buildmetadata:u}}function op(e,t){e&&(function(e,t){return e.major!==t.major?e.major>t.major?1:-1:e.minor!==t.minor?e.minor>t.minor?1:-1:e.patch!==t.patch?e.patch>t.patch?1:-1:0}(rp(Le),e)>=0||Bi.warn(`Component ${t} requires SDK version ${e.semver} or higher, but current SDK version is ${Le}`))}function sp(e){return!e||"object"==typeof e&&0==Object.keys(e).length}!function(e){e.DEFAULT="default",e.JOURNEY="journey",e.LABEL="label",e.URL="url"}(Yv||(Yv={})),function(e){e.DEEPLINK="deeplink",e.IN_APP="in_app"}(Xv||(Xv={}));function up(e){if("number"==typeof e)return Number.isFinite(e)?e:NaN;if("string"==typeof e){var t=e.trim();if(""===t)return NaN;var n=Number(t);return Number.isFinite(n)?n:NaN}return NaN}function lp(e){return"steps"===e.style}function dp(e){return"fixed"===e?"fixed":"even"}function cp(...e){for(var t=0,n=e;t<n.length;t++){var i=n[t];if(null!=i&&("string"!=typeof i||""!==i.trim()))return i}}var hp=Gv,mp=Vv,fp=Qv,vp=qv,pp=Jv,gp=Zv,yp=Sf,bp=Object.freeze({__proto__:null,NamiCampaignManager:hp,NamiCustomerManager:mp,NamiEntitlementManager:vp,NamiFlowManager:pp,NamiPaywallManager:fp,NamiProfileManager:yp,NamiPurchaseManager:gp}),wp=function(){return c(function e(){o(this,e)},[{key:"getItem",value:function(e){try{return localStorage.getItem(e)}catch(e){return null}}},{key:"setItem",value:function(e,t){try{localStorage.setItem(e,t)}catch(e){}}},{key:"removeItem",value:function(e){try{localStorage.removeItem(e)}catch(e){}}},{key:"clear",value:function(){try{localStorage.clear()}catch(e){}}},{key:"getAllKeys",value:function(){try{return Object.keys(localStorage)}catch(e){return[]}}}])}();function kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sp,Ep={exports:{}};var Pp=(Sp||(Sp=1,function(e){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var i=n(18),a=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});t.push(0);var n=t[0],i=t[1];if(10===n)switch(i){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(n){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,i){void 0===i&&(i=!1);var a=e.getVersionPrecision(t),r=e.getVersionPrecision(n),o=Math.max(a,r),s=0,u=e.map([t,n],function(t){var n=o-e.getVersionPrecision(t),i=t+new Array(n+1).join(".0");return e.map(i.split("."),function(e){return new Array(20-e.length).join("0")+e}).reverse()});for(i&&(s=o-Math.min(a,r)),o-=1;o>=s;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===s)return 0;o-=1}else if(u[0][o]<u[1][o])return-1}},e.map=function(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)i.push(t(e[n]));return i},e.find=function(e,t){var n,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,i=e.length;n<i;n+=1){var a=e[n];if(t(a,n))return a}},e.assign=function(e){for(var t,n,i=e,a=arguments.length,r=new Array(a>1?a-1:0),o=1;o<a;o++)r[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(r));var s=function(){var e=r[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach(function(t){i[t]=e[t]})};for(t=0,n=r.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return i.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return i.BROWSER_MAP[e]||""},e}();t.default=a,e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",Brave:"brave",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",DuckDuckGo:"duckduckgo",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Linespider:"linespider",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SlackBot:"slackbot",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},t.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",brave:"Brave",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",duckduckgo:"DuckDuckGo",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",linespider:"Linespider",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",slackbot:"SlackBot",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},t.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},t.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},t.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(91))&&i.__esModule?i:{default:i},r=n(18);function o(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.key,i)}}var s=function(){function e(){}var t,n,i;return e.getParser=function(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=null),"string"!=typeof e)throw new Error("UserAgent should be a string");return new a.default(e,t,n)},e.parse=function(e,t){return void 0===t&&(t=null),new a.default(e,t).getResult()},t=e,i=[{key:"BROWSER_MAP",get:function(){return r.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return r.ENGINE_MAP}},{key:"OS_MAP",get:function(){return r.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return r.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),i&&o(t,i),e}();t.default=s,e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var i=u(n(92)),a=u(n(93)),r=u(n(94)),o=u(n(95)),s=u(n(17));function u(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=null),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e;var i=!1;"boolean"==typeof t?(i=t,this._hints=n):this._hints=null!=t&&"object"==typeof t?t:null,this.parsedResult={},!0!==i&&this.parse()}var t=e.prototype;return t.getHints=function(){return this._hints},t.hasBrand=function(e){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var t=e.toLowerCase();return this._hints.brands.some(function(e){return e.brand&&e.brand.toLowerCase()===t})},t.getBrandVersion=function(e){if(this._hints&&Array.isArray(this._hints.brands)){var t=e.toLowerCase(),n=this._hints.brands.find(function(e){return e.brand&&e.brand.toLowerCase()===t});return n?n.version:void 0}},t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(i.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA(),this)),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(a.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(r.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},i=0,a={},r=0;if(Object.keys(e).forEach(function(t){var o=e[t];"string"==typeof o?(a[t]=o,r+=1):"object"==typeof o&&(n[t]=o,i+=1)}),i>0){var o=Object.keys(n),u=s.default.find(o,function(e){return t.isOS(e)});if(u){var l=this.satisfies(n[u]);if(void 0!==l)return l}var d=s.default.find(o,function(e){return t.isPlatform(e)});if(d){var c=this.satisfies(n[d]);if(void 0!==c)return c}}if(r>0){var h=Object.keys(a),m=s.default.find(h,function(e){return t.isBrowser(e,!0)});if(void 0!==m)return this.compareVersion(a[m])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),a=s.default.getBrowserTypeByAlias(i);return t&&a&&(i=a.toLowerCase()),i===n},t.compareVersion=function(e){var t=[0],n=e,i=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(i=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(i=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(a,n,i))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some(function(e){return t.is(e)})},e}();t.default=l,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/gptbot/i],describe:function(e){var t={name:"GPTBot"},n=a.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:"ChatGPT-User"},n=a.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:"OAI-SearchBot"},n=a.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:"ClaudeBot"},n=a.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:"Omgilibot"},n=a.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/diffbot/i],describe:function(e){var t={name:"Diffbot"},n=a.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:"PerplexityBot"},n=a.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:"Perplexity-User"},n=a.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/youbot/i],describe:function(e){var t={name:"YouBot"},n=a.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:"Meta-WebIndexer"},n=a.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:"Meta-ExternalAds"},n=a.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:"Meta-ExternalAgent"},n=a.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:"Meta-ExternalFetcher"},n=a.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/linespider/i],describe:function(e){var t={name:"Linespider"},n=a.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/amazonbot/i],describe:function(e){var t={name:"AmazonBot"},n=a.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/bingbot/i],describe:function(e){var t={name:"BingCrawler"},n=a.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/baiduspider/i],describe:function(e){var t={name:"BaiduSpider"},n=a.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:"DuckDuckBot"},n=a.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:"InternetArchiveCrawler"},n=a.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(e){var t={name:"SlackBot"},n=a.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/librewolf/i],describe:function(e){var t={name:"LibreWolf"},n=a.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:"Sogou Browser"},n=a.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),i=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),r=a.default.getFirstMatch(/se ([\d.]+)x/i,e),o=n||i||r;return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return!!e.hasBrand("DuckDuckGo")||e.test(/\sDdg\/[\d.]+$/i)},describe:function(e,t){var n={name:"DuckDuckGo"};if(t){var i=t.getBrandVersion("DuckDuckGo");if(i)return n.version=i,n}var r=a.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,e);return r&&(n.version=r),n}},{test:function(e){return e.hasBrand("Brave")},describe:function(e,t){var n={name:"Brave"};if(t){var i=t.getBrandVersion("Brave");if(i)return n.version=i,n}return n}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(t,e),version:a.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:r.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=a.default.getWindowsVersionName(t);return{name:r.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:r.OS_MAP.iOS},n=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=a.default.getMacOSVersionName(t),i={name:r.OS_MAP.MacOS,version:t};return n&&(i.versionName=n),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:r.OS_MAP.iOS,version:t}}},{test:[/OpenHarmony/i],describe:function(e){var t=a.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.HarmonyOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=a.default.getAndroidVersionName(t),i={name:r.OS_MAP.Android,version:t};return n&&(i.versionName=n),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:r.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||a.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:r.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:r.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:r.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(e){var t=a.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:r.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=a.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:r.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=a.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:r.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{test:[/[^-]mobi/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:[/smart-?tv|smarttv/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:r.ENGINE_MAP.Blink};var t=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:r.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:r.ENGINE_MAP.Trident},n=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:r.ENGINE_MAP.Presto},n=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:r.ENGINE_MAP.Gecko},n=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:r.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:r.ENGINE_MAP.WebKit},n=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})}(Ep)),Ep.exports),_p=kp(Pp),Tp={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},Mp={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4},Ap=function(){return c(function e(){o(this,e)},[{key:"getDeviceData",value:function(e){if("undefined"==typeof window)return{os_version:"X.X.X",os_name:"Server",browser_name:"Unknown",browser_version:"X.X.X",sdk_client:"web",sdk_version:Le,language:"en"};var t=_p.getParser(window.navigator.userAgent),n=t.getPlatform(),i={os_version:t.getOSVersion(),os_name:t.getOSName(),browser_name:t.getBrowserName(),browser_version:t.getBrowserVersion(),sdk_client:"web",sdk_version:Le,language:window.navigator.language};if(n.type&&(i.form_factor=Tp[n.type]),n.model&&(i.device_model=n.model),e&&e.length>0){var a=(e=>{var t=e.find(e=>e.includes(bn)),n={platform:"",version:""};if(t){var i=t.split(kn);n.platform=i[1],n.version=i[2]}return n})(e);i.extended_platform=a.platform,i.extended_platform_version=a.version}return i}},{key:"getDeviceFormFactor",value:function(){if("undefined"==typeof window)return"desktop";var e=_p.getParser(window.navigator.userAgent).getPlatform();return e.type&&Tp[e.type]||"desktop"}},{key:"getDeviceScaleFactor",value:function(e){var t;if(e||(e=this.getDeviceFormFactor()),"television"!==e)return 1;var n=window,i=n.innerWidth,a=n.innerHeight,r=i.toString()+"x"+a.toString();return null!==(t=Mp[r])&&void 0!==t?t:Math.min(i/1920,a/1080)||1}},{key:"getScreenInfo",value:function(){var e,t,n,i;return"undefined"==typeof window?{width:1920,height:1080,scale:1}:{width:null!==(e=null===(t=window.screen)||void 0===t?void 0:t.width)&&void 0!==e?e:window.innerWidth,height:null!==(n=null===(i=window.screen)||void 0===i?void 0:i.height)&&void 0!==n?n:window.innerHeight,scale:window.devicePixelRatio||1}}},{key:"getLanguage",value:function(){return"undefined"==typeof window?"en":window.navigator.language||"en"}},{key:"onAppForeground",value:function(e){if("undefined"==typeof document)return()=>{};var t=()=>{"visible"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},{key:"onAppBackground",value:function(e){if("undefined"==typeof document)return()=>{};var t=()=>{"hidden"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},{key:"isAppVisible",value:function(){return"undefined"==typeof document||"hidden"!==document.visibilityState}},{key:"generateUUID",value:function(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}])}();function Dp(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"==typeof SuppressedError&&SuppressedError;var xp,Cp,Ip,Lp=globalThis,Fp=Lp.ShadowRoot&&(void 0===Lp.ShadyCSS||Lp.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rp=Symbol(),Op=new WeakMap,$p=function(){return c(function e(t,n,i){if(o(this,e),this._$cssResult$=!0,i!==Rp)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n},[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(Fp&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Op.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Op.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Np=e=>new $p("string"==typeof e?e:e+"",void 0,Rp),Wp=(e,...t)=>{var n=1===e.length?e[0]:t.reduce((t,n,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[i+1],e[0]);return new $p(n,e,Rp)},jp=Fp?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=h(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return Np(n)})(e):e,Bp=Object.is,zp=Object.defineProperty,Up=Object.getOwnPropertyDescriptor,Hp=Object.getOwnPropertyNames,Gp=Object.getOwnPropertySymbols,Vp=Object.getPrototypeOf,Kp=globalThis,Yp=Kp.trustedTypes,Xp=Yp?Yp.emptyScript:"",qp=Kp.reactiveElementPolyfillSupport,Jp=(e,t)=>e,Qp={toAttribute(e,t){switch(t){case Boolean:e=e?Xp:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var 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}},Zp=(e,t)=>!Bp(e,t),eg={attribute:!0,type:String,converter:Qp,reflect:!1,useDefault:!1,hasChanged:Zp};null!==(xp=Symbol.metadata)&&void 0!==xp||(Symbol.metadata=Symbol("metadata")),null!==(Cp=Kp.litPropertyMetadata)&&void 0!==Cp||(Kp.litPropertyMetadata=new WeakMap);var tg,ng=function(e){function t(){var e;return o(this,t),(e=r(this,t))._$Ep=void 0,e.isUpdatePending=!1,e.hasUpdated=!1,e._$Em=null,e._$Ev(),e}return p(t,e),c(t,[{key:"_$Ev",value:function(){var e;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach(e=>e(this))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$EO)||void 0===t||t.delete(e)}},{key:"_$E_",value:function(){for(var e,t=new Map,n=h(this.constructor.elementProperties.keys());!(e=n()).done;){var i=e.value;this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i])}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(Fp)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(var n,i=h(t);!(n=i()).done;){var a=n.value,r=document.createElement("style"),o=Lp.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}})(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e,t;null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$EO)||void 0===t||t.forEach(e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)})}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$EO)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)})}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$ET",value:function(e,t){var n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){var a,r=(void 0!==(null===(a=n.converter)||void 0===a?void 0:a.toAttribute)?n.converter:Qp).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var n=this.constructor,i=n._$Eh.get(e);if(void 0!==i&&this._$Em!==i){var a,r,o,s=n.getPropertyOptions(i),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:Qp;this._$Em=i;var l=u.fromAttribute(t,s.type);this[i]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(i))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n,i=!1,a){if(void 0!==e){var r,o,s=this.constructor;if(!1===i&&(a=this[e]),null!=n||(n=s.getPropertyOptions(e)),!((null!==(r=n.hasChanged)&&void 0!==r?r:Zp)(a,t)||n.useDefault&&n.reflect&&a===(null===(o=this._$Ej)||void 0===o?void 0:o.get(e))&&!this.hasAttribute(s._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:n,reflect:i,wrapped:a},r){var o,s,u;n&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(null!==(u=this._$Eq)&&void 0!==u?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,a(this._$ES);case 2:n.n=4;break;case 3:n.p=3,t=n.v,Promise.reject(t);case 4:if(e=this.scheduleUpdate(),!(null!=e)){n.n=5;break}return n.n=5,a(e);case 5:return n.a(2,!this.isUpdatePending)}},null,this,[[1,3]],Promise)}},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var e;if(null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(var t,n=h(this._$Ep);!(t=n()).done;){var i=t.value,a=i[0],r=i[1];this[a]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=h(o);!(s=u()).done;){var l=s.value,d=l[0],c=l[1],m=c.wrapped,f=this[d];!0!==m||this._$AL.has(d)||void 0===f||this.C(d,void 0,c,f)}}var v=!1,p=this._$AL;try{var g;(v=this.shouldUpdate(p))?(this.willUpdate(p),null!==(g=this._$EO)&&void 0!==g&&g.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(p)):this._$EM()}catch(p){throw v=!1,this._$EM(),p}v&&this._$AE(p)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null!==(t=this._$EO)&&void 0!==t&&t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;this._$Ei(),(null!==(t=this.l)&&void 0!==t?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}},{key:"createProperty",value:function(e,t=eg){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&zp(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Up(this.prototype,e))&&void 0!==i?i:{get(){return this[t]},set(e){this[t]=e}},r=a.get,o=a.set;return{get:r,set(t){var i=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:eg}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Jp("elementProperties"))){var e=Vp(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Jp("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Jp("properties")))for(var e=this.properties,t=0,n=[...Hp(e),...Gp(e)];t<n.length;t++){var i=n[t];this.createProperty(i,e[i])}var a=this[Symbol.metadata];if(null!==a){var r=litPropertyMetadata.get(a);if(void 0!==r)for(var o,s=h(r);!(o=s()).done;){var u=o.value,l=u[0],d=u[1];this.elementProperties.set(l,d)}}this._$Eh=new Map;for(var c,m=h(this.elementProperties);!(c=m()).done;){var f=c.value,v=f[0],p=f[1],g=this._$Eu(v,p);void 0!==g&&this._$Eh.set(g,v)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var n,i=h(new Set(e.flat(1/0).reverse()));!(n=i()).done;){var a=n.value;t.unshift(jp(a))}else void 0!==e&&t.push(jp(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}(M(HTMLElement));ng.elementStyles=[],ng.shadowRootOptions={mode:"open"},ng[Jp("elementProperties")]=new Map,ng[Jp("finalized")]=new Map,null!=qp&&qp({ReactiveElement:ng}),(null!==(Ip=Kp.reactiveElementVersions)&&void 0!==Ip?Ip:Kp.reactiveElementVersions=[]).push("2.1.2");var ig=globalThis,ag=e=>e,rg=ig.trustedTypes,og=rg?rg.createPolicy("lit-html",{createHTML:e=>e}):void 0,sg="$lit$",ug=`lit$${Math.random().toFixed(9).slice(2)}$`,lg="?"+ug,dg=`<${lg}>`,cg=document,hg=()=>cg.createComment(""),mg=e=>null===e||"object"!=typeof e&&"function"!=typeof e,fg=Array.isArray,vg="[ \t\n\f\r]",pg=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gg=/-->/g,yg=/>/g,bg=RegExp(`>|${vg}(?:([^\\s"'>=/]+)(${vg}*=${vg}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),wg=/'/g,kg=/"/g,Sg=/^(?:script|style|textarea|title)$/i,Eg=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),Pg=Eg(1),_g=Eg(2),Tg=Symbol.for("lit-noChange"),Mg=Symbol.for("lit-nothing"),Ag=new WeakMap,Dg=cg.createTreeWalker(cg,129);function xg(e,t){if(!fg(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==og?og.createHTML(t):t}var Cg=function(){return c(function e({strings:t,_$litType$:n},i){var a;o(this,e),this.parts=[];var r=0,s=0,u=t.length-1,l=this.parts,d=((e,t)=>{for(var n,i=e.length-1,a=[],r=2===t?"<svg>":3===t?"<math>":"",o=pg,s=0;s<i;s++){for(var u=e[s],l=void 0,d=void 0,c=-1,h=0;h<u.length&&(o.lastIndex=h,null!==(d=o.exec(u)));)h=o.lastIndex,o===pg?"!--"===d[1]?o=gg:void 0!==d[1]?o=yg:void 0!==d[2]?(Sg.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=bg):void 0!==d[3]&&(o=bg):o===bg?">"===d[0]?(o=null!=n?n:pg,c=-1):void 0===d[1]?c=-2:(c=o.lastIndex-d[2].length,l=d[1],o=void 0===d[3]?bg:'"'===d[3]?kg:wg):o===kg||o===wg?o=bg:o===gg||o===yg?o=pg:(o=bg,n=void 0);var m=o===bg&&e[s+1].startsWith("/>")?" ":"";r+=o===pg?u+dg:c>=0?(a.push(l),u.slice(0,c)+sg+u.slice(c)+ug+m):u+ug+(-2===c?s:m)}return[xg(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),a]})(t,n),c=d[0],m=d[1];if(this.el=e.createElement(c,i),Dg.currentNode=this.el.content,2===n||3===n){var f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;null!==(a=Dg.nextNode())&&l.length<u;){if(1===a.nodeType){if(a.hasAttributes())for(var v,p=h(a.getAttributeNames());!(v=p()).done;){var g=v.value;if(g.endsWith(sg)){var y=m[s++],b=a.getAttribute(g).split(ug),w=/([.?@])?(.*)/.exec(y);l.push({type:1,index:r,name:w[2],strings:b,ctor:"."===w[1]?Og:"?"===w[1]?$g:"@"===w[1]?Ng:Rg}),a.removeAttribute(g)}else g.startsWith(ug)&&(l.push({type:6,index:r}),a.removeAttribute(g))}if(Sg.test(a.tagName)){var k=a.textContent.split(ug),S=k.length-1;if(S>0){a.textContent=rg?rg.emptyScript:"";for(var E=0;E<S;E++)a.append(k[E],hg()),Dg.nextNode(),l.push({type:2,index:++r});a.append(k[S],hg())}}}else if(8===a.nodeType)if(a.data===lg)l.push({type:2,index:r});else for(var P=-1;-1!==(P=a.data.indexOf(ug,P+1));)l.push({type:7,index:r}),P+=ug.length-1;r++}},null,[{key:"createElement",value:function(e,t){var n=cg.createElement("template");return n.innerHTML=e,n}}])}();function Ig(e,t,n=e,i){var a,r,o,s,u;if(t===Tg)return t;var l=void 0!==i?null===(a=n._$Co)||void 0===a?void 0:a[i]:n._$Cl,d=mg(t)?void 0:t._$litDirective$;return(null===(r=l)||void 0===r?void 0:r.constructor)!==d&&(null!==(o=l)&&void 0!==o&&null!==(s=o._$AO)&&void 0!==s&&s.call(o,!1),void 0===d?l=void 0:(l=new d(e))._$AT(e,n,i),void 0!==i?(null!==(u=n._$Co)&&void 0!==u?u:n._$Co=[])[i]=l:n._$Cl=l),void 0!==l&&(t=Ig(e,l._$AS(e,t.values),l,i)),t}var Lg=function(){return c(function e(t,n){o(this,e),this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n},[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"u",value:function(e){var t,n=this._$AD,i=n.el.content,a=n.parts,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:cg).importNode(i,!0);Dg.currentNode=r;for(var o=Dg.nextNode(),s=0,u=0,l=a[0];void 0!==l;){var d;if(s===l.index){var c=void 0;2===l.type?c=new Fg(o,o.nextSibling,this,e):1===l.type?c=new l.ctor(o,l.name,l.strings,this,e):6===l.type&&(c=new Wg(o,this,e)),this._$AV.push(c),l=a[++u]}s!==(null===(d=l)||void 0===d?void 0:d.index)&&(o=Dg.nextNode(),s++)}return Dg.currentNode=cg,r}},{key:"p",value:function(e){for(var t,n=0,i=h(this._$AV);!(t=i()).done;){var a=t.value;void 0!==a&&(void 0!==a.strings?(a._$AI(e,a,n),n+=a.strings.length-2):a._$AI(e[n])),n++}}}])}(),Fg=function(){return c(function e(t,n,i,a){var r;o(this,e),this.type=2,this._$AH=Mg,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=a,this._$Cv=null===(r=null==a?void 0:a.isConnected)||void 0===r||r},[{key:"_$AU",get:function(){var e,t;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cv}},{key:"parentNode",get:function(){var e,t=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===(null===(e=t)||void 0===e?void 0:e.nodeType)&&(t=n.parentNode),t}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(e,t=this){e=Ig(this,e,t),mg(e)?e===Mg||null==e||""===e?(this._$AH!==Mg&&this._$AR(),this._$AH=Mg):e!==this._$AH&&e!==Tg&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>fg(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this._(e)}},{key:"O",value:function(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}},{key:"T",value:function(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}},{key:"_",value:function(e){this._$AH!==Mg&&mg(this._$AH)?this._$AA.nextSibling.data=e:this.T(cg.createTextNode(e)),this._$AH=e}},{key:"$",value:function(e){var t,n=e.values,i=e._$litType$,a="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Cg.createElement(xg(i.h,i.h[0]),this.options)),i);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===a)this._$AH.p(n);else{var r=new Lg(a,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}},{key:"_$AC",value:function(e){var t=Ag.get(e.strings);return void 0===t&&Ag.set(e.strings,t=new Cg(e)),t}},{key:"k",value:function(e){fg(this._$AH)||(this._$AH=[],this._$AR());for(var t,n,i=this._$AH,a=0,r=h(e);!(n=r()).done;){var o=n.value;a===i.length?i.push(t=new _k(this.O(hg()),this.O(hg()),this,this.options)):t=i[a],t._$AI(o),a++}a<i.length&&(this._$AR(t&&t._$AB.nextSibling,a),i.length=a)}},{key:"_$AR",value:function(e=this._$AA.nextSibling,t){for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,t);e!==this._$AB;){var n,i=ag(e).nextSibling;ag(e).remove(),e=i}}},{key:"setConnected",value:function(e){var t;void 0===this._$AM&&(this._$Cv=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}])}(),Rg=function(){return c(function e(t,n,i,a,r){o(this,e),this.type=1,this._$AH=Mg,this._$AN=void 0,this.element=t,this.name=n,this._$AM=a,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Mg},[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e,t=this,n,i){var a=this.strings,r=!1;if(void 0===a)e=Ig(this,e,t,0),(r=!mg(e)||e!==this._$AH&&e!==Tg)&&(this._$AH=e);else{var o,s,u=e;for(e=a[0],o=0;o<a.length-1;o++)(s=Ig(this,u[n+o],t,o))===Tg&&(s=this._$AH[o]),r||(r=!mg(s)||s!==this._$AH[o]),s===Mg?e=Mg:e!==Mg&&(e+=(null!=s?s:"")+a[o+1]),this._$AH[o]=s}r&&!i&&this.j(e)}},{key:"j",value:function(e){e===Mg?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}])}(),Og=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).type=3,e}return p(t,e),c(t,[{key:"j",value:function(e){this.element[this.name]=e===Mg?void 0:e}}])}(Rg),$g=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).type=4,e}return p(t,e),c(t,[{key:"j",value:function(e){this.element.toggleAttribute(this.name,!!e&&e!==Mg)}}])}(Rg),Ng=function(e){function t(e,n,i,a,s){var u;return o(this,t),(u=r(this,t,[e,n,i,a,s])).type=5,u}return p(t,e),c(t,[{key:"_$AI",value:function(e,t=this){var n;if((e=null!==(n=Ig(this,e,t,0))&&void 0!==n?n:Mg)!==Tg){var i=this._$AH,a=e===Mg&&i!==Mg||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==Mg&&(i===Mg||a);a&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}}},{key:"handleEvent",value:function(e){var t,n;"function"==typeof this._$AH?this._$AH.call(null!==(t=null===(n=this.options)||void 0===n?void 0:n.host)&&void 0!==t?t:this.element,e):this._$AH.handleEvent(e)}}])}(Rg),Wg=function(){return c(function e(t,n,i){o(this,e),this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i},[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){Ig(this,e)}}])}(),jg={I:Fg},Bg=ig.litHtmlPolyfillSupport;null!=Bg&&Bg(Cg,Fg),(null!==(tg=ig.litHtmlVersions)&&void 0!==tg?tg:ig.litHtmlVersions=[]).push("3.3.3");var zg,Ug,Hg=globalThis,Gg=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).renderOptions={host:i(e)},e._$Do=void 0,e}return p(t,e),c(t,[{key:"createRenderRoot",value:function(){var e,n,i=_(t,"createRenderRoot",this)([]);return null!==(n=(e=this.renderOptions).renderBefore)&&void 0!==n||(e.renderBefore=i.firstChild),i}},{key:"update",value:function(e){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),_(t,"update",this)([e]),this._$Do=((e,t,n)=>{var i,a=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t,r=a._$litPart$;if(void 0===r){var o,s=null!==(o=null==n?void 0:n.renderBefore)&&void 0!==o?o:null;a._$litPart$=r=new Fg(t.insertBefore(hg(),s),s,void 0,null!=n?n:{})}return r._$AI(e),r})(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;_(t,"connectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;_(t,"disconnectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Tg}}])}(ng);Gg._$litElement$=!0,Gg.finalized=!0,null===(zg=Hg.litElementHydrateSupport)||void 0===zg||zg.call(Hg,{LitElement:Gg});var Vg=Hg.litElementPolyfillSupport;null==Vg||Vg({LitElement:Gg}),(null!==(Ug=Hg.litElementVersions)&&void 0!==Ug?Ug:Hg.litElementVersions=[]).push("4.2.2");var Kg,Yg,Xg=Wp(Kg||(Kg=(e=>e)`
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).NamiWebSdk={})}(this,function(e){"use strict";function t(e,t){this.v=e,this.k=t}function n(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 i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){return new t(e,0)}function r(e,t,n){return t=v(t),b(e,g()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u=0;function l(e){return"__private_"+u+++"_"+e}function d(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,T(i.key),i)}}function c(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e))||t){i&&(e=i);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}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 m(){return m=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},m.apply(null,arguments)}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=v(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}},f.apply(null,arguments)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function p(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&&P(e,t)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function y(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 b(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 i(e)}function w(){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 E(l,"_invoke",function(n,i,a){var r,s,u,l=0,d=a||[],c=!1,h={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return r=t,s=0,u=e,h.n=n,o}};function m(n,i){for(s=n,u=i,t=0;!c&&l&&!a&&t<d.length;t++){var a,r=d[t],m=h.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,h.v=i,h.n=r[1]):m<f&&(a=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,h.n=f,s=0))}if(a||n>1)return o;throw c=!0,i}return function(a,d,f){if(l>1)throw TypeError("Generator is already running");for(c&&1===d&&m(d,f),s=d,u=f;(t=s<2?e:u)||!c;){r||(s?s<3?(s>1&&(h.n=-1),m(s,u)):h.n=u:h.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=(c=h.n<0)?u:n.call(i,h))!==o)break}catch(t){r=e,s=1,u=t}finally{l=1}}return{value:t,done:c}}}(n,a,r),!0),l}var o={};function s(){}function u(){}function l(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(E(t={},i,function(){return this}),t),c=l.prototype=s.prototype=Object.create(d);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,E(e,a,"GeneratorFunction")),e.prototype=Object.create(c),e}return u.prototype=l,E(c,"constructor",l),E(l,"constructor",u),u.displayName="GeneratorFunction",E(l,a,"GeneratorFunction"),E(c),E(c,a,"Generator"),E(c,i,function(){return this}),E(c,"toString",function(){return"[object Generator]"}),(w=function(){return{w:r,m:h}})()}function k(e,t,n,i,a){var r=function(e,t,n,i,a){return new S(w().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 S(e,n){function i(a,r,o,s){try{var u=e[a](r),l=u.value;return l instanceof t?n.resolve(l.v).then(function(e){i("next",e,o,s)},function(e){i("throw",e,o,s)}):n.resolve(l).then(function(e){u.value=e,o(u)},function(e){return i("throw",e,o,s)})}catch(e){s(e)}}var a;this.next||(E(S.prototype),E(S.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),E(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return a=a?a.then(o,o):o()},!0)}function E(e,t,n,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}E=function(e,t,n,i){function r(t,n){E(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))},E(e,t,n,i)}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}function _(e,t,n,i){var a=f(v(e.prototype),t,n);return"function"==typeof a?function(e){return a.apply(n,e)}:a}function T(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 M(e){var t="function"==typeof Map?new Map:void 0;return M=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(g())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var a=new(e.bind.apply(e,i));return n&&P(a,n.prototype),a}(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),P(n,e)},M(e)}var A,D,x,C,I,L,F,R,O,$,N,W,j=function(){return c(function e(t){o(this,e),this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",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(){}}])}(),B=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},z=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)},U={__proto__:null,enumerable:!0};Object.freeze(U);var H=($=function(){return c(function e(t,n={}){if(o(this,e),A.set(this,!1),D.set(this,!1),x.set(this,!1),C.set(this,!1),I.set(this,Date.now()),L.set(this,!1),F.set(this,void 0),R.set(this,void 0),O.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;B(this,A,!!a,"f"),B(this,D,!!i,"f"),B(this,x,!!r,"f"),B(this,F,`${t}`,"f"),B(this,R,null,"f"),B(this,O,!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(){B(this,C,!0,"f")}},{key:"target",get:function(){return z(this,R,"f")}},{key:"currentTarget",get:function(){return z(this,R,"f")}},{key:"srcElement",get:function(){return z(this,R,"f")}},{key:"type",get:function(){return z(this,F,"f")}},{key:"cancelable",get:function(){return z(this,A,"f")}},{key:"defaultPrevented",get:function(){return z(this,A,"f")&&z(this,C,"f")}},{key:"timeStamp",get:function(){return z(this,I,"f")}},{key:"composedPath",value:function(){return z(this,O,"f")?[z(this,R,"f")]:[]}},{key:"returnValue",get:function(){return!z(this,A,"f")||!z(this,C,"f")}},{key:"bubbles",get:function(){return z(this,D,"f")}},{key:"composed",get:function(){return z(this,x,"f")}},{key:"eventPhase",get:function(){return z(this,O,"f")?$.AT_TARGET:$.NONE}},{key:"cancelBubble",get:function(){return z(this,L,"f")},set:function(e){e&&B(this,L,!0,"f")}},{key:"stopPropagation",value:function(){B(this,L,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),A=new WeakMap,D=new WeakMap,x=new WeakMap,C=new WeakMap,I=new WeakMap,L=new WeakMap,F=new WeakMap,R=new WeakMap,O=new WeakMap,$.NONE=0,$.CAPTURING_PHASE=1,$.AT_TARGET=2,$.BUBBLING_PHASE=3,$);Object.defineProperties(H.prototype,{initEvent:U,stopImmediatePropagation:U,preventDefault:U,target:U,currentTarget:U,srcElement:U,type:U,cancelable:U,defaultPrevented:U,timeStamp:U,composedPath:U,returnValue:U,bubbles:U,composed:U,eventPhase:U,cancelBubble:U,stopPropagation:U,isTrusted:U});var G=(W=function(e){function t(e,n={}){var i,a;return o(this,t),a=r(this,t,[e,n]),N.set(a,void 0),B(a,N,null!==(i=null==n?void 0:n.detail)&&void 0!==i?i:null,"f"),a}return p(t,e),c(t,[{key:"initCustomEvent",value:function(e,t,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function(){return z(this,N,"f")}}])}(H),N=new WeakMap,W);Object.defineProperties(G.prototype,{detail:U});var V,K,Y,X,q=H,J=G;(V=function(){return c(function e(){o(this,e),this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""},[{key:"parentRule",get:function(){return null}},{key:"parentStyleSheet",get:function(){return this.__parentStyleSheet}},{key:"type",get:function(){return 0}}])}()).STYLE_RULE=1,V.CHARSET_RULE=2,V.IMPORT_RULE=3,V.MEDIA_RULE=4,V.FONT_FACE_RULE=5,V.PAGE_RULE=6,V.NAMESPACE_RULE=10,V.KEYFRAMES_RULE=7,V.KEYFRAME_RULE=8,V.SUPPORTS_RULE=12,V.COUNTER_STYLE_RULE=11,V.FONT_FEATURE_VALUES_RULE=14,V.MARGIN_RULE=9,null!==(K=globalThis.Event)&&void 0!==K||(globalThis.Event=q),null!==(Y=globalThis.CustomEvent)&&void 0!==Y||(globalThis.CustomEvent=J);var Q=Symbol(),Z=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},ee={__proto__:null,enumerable:!0};Object.freeze(ee);var te=function(){return c(function e(){o(this,e),this.__eventListeners=new Map,this.__captureEventListeners=new Map},[{key:"addEventListener",value:function(e,t,n){var i;if(null!=t){var a=Z(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=Z(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.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));var n=!1,i=!1,a=q.NONE,r=null,o=null,s=null,u=e.stopPropagation,l=e.stopImmediatePropagation;Object.defineProperties(e,{target:m({get:()=>null!=r?r:o},ee),srcElement:m({get:()=>e.target},ee),currentTarget:m({get:()=>s},ee),eventPhase:m({get:()=>a},ee),composedPath:m({value:()=>t},ee),stopPropagation:m({value:()=>{n=!0,u.call(e)}},ee),stopImmediatePropagation:m({value:()=>{i=!0,l.call(e)}},ee)});var d=(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=()=>(s=null,a=q.NONE,!e.defaultPrevented),f=t.slice().reverse();r=this.__host&&e.composed?null:this;for(var v,p=e=>{for(o=this;o.__host&&e.includes(o.__host);)o=o.__host},g=h(f);!(v=g()).done;){var y=v.value;r||o&&o!==y.__host||p(f.slice(f.indexOf(y))),s=y,a=y===e.target?q.AT_TARGET:q.CAPTURING_PHASE;var b=y.__captureEventListeners.get(e.type);if(b)for(var w,k=h(b);!(w=k()).done;){var S=w.value;if(d(S[0],S[1],b),i)return c()}if(n)return c()}var E=e.bubbles?t:[this];o=null;for(var P,_=h(E);!(P=_()).done;){var T=P.value;r||o&&T!==o.__host||p(E.slice(0,E.indexOf(T)+1)),s=T,a=T===e.target?q.AT_TARGET:q.BUBBLING_PHASE;var M=T.__eventListeners.get(e.type);if(M)for(var A,D=h(M);!(A=D()).done;){var x=A.value;if(d(x[0],x[1],M),i)return c()}if(n)return c()}return c()}},{key:"__resolveFullEventPath",value:function(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,oe,pe]}}])}(),ne=new WeakMap,ie=e=>{var t=ne.get(e);return void 0===t&&ne.set(e,t=new Map),t},ae=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"getRootNode",value:function(e){var t;if(null!=e&&e.composed)return se;var n=this.__host;return null!==(t=null==n?void 0:n.__shadowRoot)&&void 0!==t?t:se}}])}(te),re=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"adoptedStyleSheets",get:function(){return[]}},{key:"createTreeWalker",value:function(){return{}}},{key:"createTextNode",value:function(){return{}}},{key:"createElement",value:function(){return{}}}])}(ae),oe=new re,se=oe,ue=function(e){function t(e){var n;if(o(this,t),n=r(this,t),e!==Q)throw new TypeError("Illegal constructor");return Object.assign(n,globalThis,{CustomElementRegistry:fe,customElements:ve,document:se,Document:re,Element:le,EventTarget:te,HTMLElement:de,Node:ae,ShadowRoot:he,window:n,Window:ue}),n}return p(t,e),c(t)}(ae),le=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).__shadowRootMode=null,e.__shadowRoot=null,e.__internals=null,e}return p(t,e),c(t,[{key:"attributes",get:function(){return Array.from(ie(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){ie(this).set(e,String(t))}},{key:"removeAttribute",value:function(e){ie(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 ie(this).has(e)}},{key:"attachShadow",value:function(e){this.__shadowRootMode=e.mode;var t=new he(Q,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=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 j(this);return this.__internals=e,e}},{key:"getAttribute",value:function(e){var t=ie(this).get(e);return null!=t?t:null}}])}(ae),de=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(le),ce=de,he=function(e){function t(e,n){var i;if(o(this,t),i=r(this,t),e!=e)throw new TypeError("Illegal constructor");return i.mode=n.mode,i}return p(t,e),c(t,[{key:"host",get:function(){return this.__host}}])}(ae);function me(){var e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}null!==(X=globalThis.litServerRoot)&&void 0!==X||(globalThis.litServerRoot=Object.defineProperty(new ce,"localName",{get:()=>"lit-server-root"}));var fe=function(){return c(function e(){o(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:"initialize",value:function(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}},{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 k(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=me(),this.__pendingWhenDefineds.set(e,n)),i.a(2,n.promise)}},null,this,null,Promise)}}])}(),ve=new fe,pe=new ue(Q);"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ce);var ge=["action"],ye=null;var be={storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},getAllKeys:()=>[]},device:{getDeviceData:()=>({os_version:"",os_name:"",browser_name:"",browser_version:"",sdk_client:"",sdk_version:"",language:"en"}),getDeviceFormFactor:()=>"desktop",getDeviceScaleFactor:()=>1,generateUUID:()=>{throw new Error("No platform adapter registered — call registerPlatformAdapters() before Nami.configure()")},getScreenInfo:()=>({width:0,height:0,scale:1}),getLanguage:()=>"en"},ui:{createPaywall:()=>null,reRenderPaywall:()=>{},flowNavigateToScreen:()=>{}}};function we(){return null!=ye?ye:be}function ke(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 Se(e,t,n,i){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 Ee(e,t,n,i,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;var Pe,_e=2,Te=4,Me=1800,Ae=1800,De=!0;!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"}(Pe||(Pe={}));var xe,Ce={},Ie=Ce.NAMI_SDK_VERSION,Le=void 0===Ie?"3.5.0":Ie,Fe=Ce.NAMI_SDK_PACKAGE_VERSION,Re=void 0===Fe?"3.5.0-dev.202611121626":Fe,Oe=Ce.PLATFORM_ID_REQUIRED,$e=void 0===Oe?"Platform ID is required":Oe,Ne=Ce.DEVICE_ID_REQUIRED,We=void 0===Ne?"Device ID is required":Ne,je=Ce.EXTERNAL_ID_REQUIRED,Be=void 0===je?"External ID is required":je,ze=Ce.SDK_NOT_INITIALIZED,Ue=void 0===ze?"SDK has not been initialized. Make sure to call Nami.configure() first!":ze,He=Ce.CAMPAIGN_NOT_AVAILABLE,Ge=void 0===He?"Campaign is not available":He,Ve=Ce.FLOW_SCREENS_NOT_AVAILABLE,Ke=void 0===Ve?"Flow screens not available":Ve,Ye=Ce.UNABLE_TO_UPDATE_CDP_ID,Xe=void 0===Ye?"Unable to update CDP id in anonymous mode":Ye,qe=Ce.ANONYMOUS_MODE_ALREADY_ON,Je=void 0===qe?"Anonymous mode is already turned on.":qe,Qe=Ce.ANONYMOUS_MODE_ALREADY_OFF,Ze=void 0===Qe?"Anonymous mode is already turned off.":Qe,et=Ce.DEVICE_ID_NOT_SET,tt=void 0===et?"Nami Device ID is not set":et,nt=Ce.AUTH_DEVICE,it=void 0===nt?"nami_auth_device":nt,at=Ce.NAMI_CONFIGURATION,rt=void 0===at?"nami_configuration":at,ot=Ce.NAMI_PROFILE,st=void 0===ot?"nami_profile":ot,ut=Ce.API_CONFIG,lt=void 0===ut?"api_config":ut,dt=Ce.API_CAMPAIGN_RULES,ct=void 0===dt?"api_campaign_rules":dt,ht=Ce.API_PAYWALLS,mt=void 0===ht?"api_paywalls":ht,ft=Ce.API_CAMPAIGN_SESSION_TIMESTAMP,vt=void 0===ft?"api_campaign_session_timestamp":ft,pt=Ce.API_PRODUCTS,gt=void 0===pt?"api_products":pt,yt=Ce.API_ACTIVE_ENTITLEMENTS,bt=void 0===yt?"api_active_entitlements":yt,wt=Ce.SERVER_NAMI_ENTITLEMENTS,kt=void 0===wt?"server_active_entitlements":wt,St=Ce.INITIAL_APP_CONFIG,Et=void 0===St?"initial_app_config":St,Pt=Ce.INITIAL_CAMPAIGN_RULES,_t=void 0===Pt?"initial_campaign_rules":Pt,Tt=Ce.INITIAL_PAYWALLS,Mt=void 0===Tt?"initial_paywalls":Tt,At=Ce.INITIAL_PRODUCTS,Dt=void 0===At?"initial_products":At,xt=Ce.LOCAL_NAMI_ENTITLEMENTS,Ct=void 0===xt?"local_active_entitlements":xt,It=Ce.CUSTOMER_ATTRIBUTES_KEY_PREFIX,Lt=void 0===It?"nami_cmr_attributes_":It,Ft=Ce.NAMI_CUSTOMER_JOURNEY_STATE,Rt=void 0===Ft?"nami_customer_journey_state":Ft,Ot=Ce.NAMI_JOURNEY_RULE_STATE,$t=void 0===Ot?"nami_journey_rule_state":Ot,Nt=Ce.NAMI_JOURNEY_INSTALL_EVALUATED,Wt=void 0===Nt?"nami_journey_install_evaluated":Nt,jt=Ce.ANONYMOUS_MODE,Bt=void 0===jt?"nami_anonymous_mode_v2":jt,zt=Ce.ANONYMOUS_UUID,Ut=void 0===zt?"nami_anonymous_uuid":zt,Ht=Ce.KEY_SESSION_COUNTER,Gt=void 0===Ht?"nami_session_counter":Ht,Vt=Ce.INITIAL_SESSION_COUNTER_VALUE,Kt=void 0===Vt?1:Vt,Yt=Ce.NAMI_LAST_IMPRESSION_ID,Xt=void 0===Yt?"nami_last_impression_id":Yt,qt=Ce.NAMI_PURCHASE_IMPRESSION_ID,Jt=void 0===qt?"nami_purchase_impression_id":qt,Qt=Ce.NAMI_LAUNCH_ID,Zt=void 0===Qt?"nami_launch_id":Qt,en=Ce.NAMI_SESSION_ID,tn=void 0===en?"nami_session_id":en,nn=Ce.NAMI_LANGUAGE_CODE,an=void 0===nn?"nami_language_code":nn,rn=Ce.NAMI_PURCHASE_CHANNEL,on=void 0===rn?"nami_purchase_channel":rn,sn=Ce.API_VERSION,un=Ce.BASE_URL_PATH,ln=void 0===un?`sdk/${void 0===sn?"v3":sn}/platform`:un,dn=Ce.BASE_URL,cn=void 0===dn?"https://app.namiml.com":dn,hn=Ce.BASE_STAGING_URL,mn=void 0===hn?"https://app-staging.namiml.com":hn,fn=Ce.CUSTOM_HOST_PREFIX,vn=void 0===fn?"namiAPIHost=":fn,pn=Ce.USE_STAGING_API,gn=void 0===pn?"useStagingAPI":pn,yn=Ce.EXTENDED_CLIENT_INFO_PREFIX,bn=void 0===yn?"extendedClientInfo":yn,wn=Ce.EXTENDED_CLIENT_INFO_DELIMITER,kn=void 0===wn?":":wn,Sn=Ce.VALIDATE_PRODUCT_GROUPS,En=void 0===Sn?"validateProductGroups":Sn,Pn=Ce.LOG_HTTP_REQUESTS,_n=void 0===Pn?"logHTTPRequests":Pn,Tn=Ce.LOG_HTTP_TRAFFIC,Mn=void 0===Tn?"logHTTPTraffic":Tn,An=Ce.API_TRAFFIC_OBSERVER,Dn=void 0===An?"apiTrafficObserver":An,xn=Ce.STARTUP_TELEMETRY,Cn=void 0===xn?"startupTelemetry":xn,In=Ce.SIMULATE_CONFIG_FETCH_FAILURE,Ln=void 0===In?"simulateConfigFetchFailure":In,Fn=Ce.DISABLE_JOURNEY_DELIVERY,Rn=void 0===Fn?"disableJourneyDelivery":Fn,On=Ce.SIMULATE_PAYWALL_FETCH_FAILURE,$n=void 0===On?"simulatePaywallFetchFailure":On,Nn=Ce.CAMPAIGN_CACHE_TTL_PREFIX,Wn=void 0===Nn?"campaignCacheTTL=":Nn,jn=Ce.TIME_OVERRIDE_PREFIX,Bn=void 0===jn?"timeOverride=":jn,zn=Ce.SYSTEM_TIME_TOKEN_PREFIX,Un=void 0===zn?"${system.time.":zn,Hn=Ce.SYSTEM_TIME_FILTER_PREFIX,Gn=void 0===Hn?"System.time.":Hn,Vn=Ce.API_MAX_CALLS_LIMIT,Kn=void 0===Vn?2:Vn,Yn=Ce.API_RETRY_DELAY_SEC,Xn=void 0===Yn?2:Yn,qn=Ce.API_TIMEOUT_LIMIT,Jn=void 0===qn?2e4:qn,Qn=Ce.DEVICE_API_TIMEOUT_LIMIT,Zn=void 0===Qn?2e3:Qn,ei=Ce.CONFIG_MAX_ATTEMPTS,ti=void 0===ei?3:ei,ni=Ce.CONFIG_API_TIMEOUT_LIMIT,ii=void 0===ni?1e4:ni,ai=Ce.RESUME_THROTTLE_MS,ri=void 0===ai?3e4:ai,oi=Ce.SESSION_GAP_MS,si=void 0===oi?3e4:oi,ui=Ce.STATUS_BAD_REQUEST,li=void 0===ui?400:ui,di=Ce.STATUS_NOT_FOUND,ci=void 0===di?404:di,hi=Ce.STATUS_CONFLICT,mi=void 0===hi?409:hi,fi=Ce.STATUS_INTERNAL_SERVER_ERROR,vi=void 0===fi?500:fi,pi=Ce.INITIAL_SUCCESS,gi=void 0===pi?"Initial success":pi,yi=Ce.RECONFIG_SUCCESS,bi=void 0===yi?"Reconfig success":yi,wi=Ce.ALREADY_CONFIGURED,ki=void 0===wi?"Already configured":wi,Si=Ce.AVAILABLE_CAMPAIGNS_CHANGED,Ei=void 0===Si?"AvailableCampaignsChanged":Si,Pi=Ce.PAYWALL_ACTION_EVENT,_i=void 0===Pi?"PaywallActionEvent":Pi,Ti=Ce.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,Mi=void 0===Ti?"AvailableActiveEntitlementsChanged":Ti,Ai=Ce.CUSTOMER_JOURNEY_STATE_CHANGED,Di=void 0===Ai?"CustomerJourneyStateChanged":Ai,xi=Ce.SKU_TEXT_REGEX,Ci=void 0===xi?/\$\{sku\.(\w+)(:\d+)?\}/g:xi,Ii=Ce.VAR_REGEX,Li=void 0===Ii?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:Ii,Fi=Ce.SMART_TEXT_PATTERN,Ri=void 0===Fi?"${":Fi,Oi=Ce.LIQUID_VARIABLE_REGEX,$i=void 0===Oi?/\${[A-Za-z0-9.]+}/g:Oi,Ni=[it,rt,st,lt,ct,mt,vt,gt,bt,kt,Et,_t,Mt,Dt,Ct,Rt,$t,Wt,Bt,Ut,Gt,Xt,Jt,Zt,tn,an,on];e.LogLevel=void 0,(xe=e.LogLevel||(e.LogLevel={}))[xe.DEBUG=1]="DEBUG",xe[xe.INFO=2]="INFO",xe[xe.WARN=3]="WARN",xe[xe.ERROR=4]="ERROR";var Wi={debug:e.LogLevel.DEBUG,info:e.LogLevel.INFO,warn:e.LogLevel.WARN,error:e.LogLevel.ERROR},ji=function(){return c(function t(){o(this,t),this.currentLogLevel=e.LogLevel.DEBUG,this.setLogger=t=>{this.currentLogLevel=t?Wi[t]:e.LogLevel.WARN}},[{key:"debug",value:function(t,...n){this.shouldLog(e.LogLevel.DEBUG)&&console.debug(this.formatMessage(e.LogLevel.DEBUG,t,...n))}},{key:"info",value:function(t,...n){this.shouldLog(e.LogLevel.INFO)&&console.info(this.formatMessage(e.LogLevel.INFO,t,...n))}},{key:"warn",value:function(t,...n){this.shouldLog(e.LogLevel.WARN)&&console.warn(this.formatMessage(e.LogLevel.WARN,t,...n))}},{key:"error",value:function(t,...n){this.shouldLog(e.LogLevel.ERROR)&&console.error(this.formatMessage(e.LogLevel.ERROR,t,...n))}},{key:"shouldLog",value:function(e){return e>=this.currentLogLevel}},{key:"formatMessage",value:function(t,n,...i){var a=e.LogLevel[t];return`[${(new Date).toISOString()}] [${a}] ${n} ${i=i.map(e=>"object"==typeof e?JSON.stringify(e):e)}`}}])}(),Bi=new ji;function zi(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 Ui(e,t){return e===t||e!=e&&t!=t}function Hi(e,t){for(var n=e.length;n--;)if(Ui(e[n][0],t))return n;return-1}var Gi=Array.prototype.splice;function Vi(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])}}Vi.prototype.clear=function(){this.__data__=[],this.size=0},Vi.prototype.delete=function(e){var t=this.__data__,n=Hi(t,e);return!(n<0)&&(n==t.length-1?t.pop():Gi.call(t,n,1),--this.size,!0)},Vi.prototype.get=function(e){var t=this.__data__,n=Hi(t,e);return n<0?void 0:t[n][1]},Vi.prototype.has=function(e){return Hi(this.__data__,e)>-1},Vi.prototype.set=function(e,t){var n=this.__data__,i=Hi(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Ki="object"==typeof global&&global&&global.Object===Object&&global,Yi="object"==typeof self&&self&&self.Object===Object&&self,Xi=Ki||Yi||Function("return this")(),qi=Xi.Symbol,Ji=Object.prototype,Qi=Ji.hasOwnProperty,Zi=Ji.toString,ea=qi?qi.toStringTag:void 0;var ta=Object.prototype.toString;var na=qi?qi.toStringTag:void 0;function ia(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":na&&na in Object(e)?function(e){var t=Qi.call(e,ea),n=e[ea];try{e[ea]=void 0;var i=!0}catch(e){}var a=Zi.call(e);return i&&(t?e[ea]=n:delete e[ea]),a}(e):function(e){return ta.call(e)}(e)}function aa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){if(!aa(e))return!1;var t=ia(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var oa,sa=Xi["__core-js_shared__"],ua=(oa=/[^.]+$/.exec(sa&&sa.keys&&sa.keys.IE_PROTO||""))?"Symbol(src)_1."+oa:"";var la=Function.prototype.toString;function da(e){if(null!=e){try{return la.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var ca=/^\[object .+?Constructor\]$/,ha=Function.prototype,ma=Object.prototype,fa=ha.toString,va=ma.hasOwnProperty,pa=RegExp("^"+fa.call(va).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ga(e){return!(!aa(e)||(t=e,ua&&ua in t))&&(ra(e)?pa:ca).test(da(e));var t}function ya(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ga(n)?n:void 0}var ba=ya(Xi,"Map"),wa=ya(Object,"create");var ka=Object.prototype.hasOwnProperty;var Sa=Object.prototype.hasOwnProperty;function Ea(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 Pa(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 _a(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])}}Ea.prototype.clear=function(){this.__data__=wa?wa(null):{},this.size=0},Ea.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ea.prototype.get=function(e){var t=this.__data__;if(wa){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ka.call(t,e)?t[e]:void 0},Ea.prototype.has=function(e){var t=this.__data__;return wa?void 0!==t[e]:Sa.call(t,e)},Ea.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wa&&void 0===t?"__lodash_hash_undefined__":t,this},_a.prototype.clear=function(){this.size=0,this.__data__={hash:new Ea,map:new(ba||Vi),string:new Ea}},_a.prototype.delete=function(e){var t=Pa(this,e).delete(e);return this.size-=t?1:0,t},_a.prototype.get=function(e){return Pa(this,e).get(e)},_a.prototype.has=function(e){return Pa(this,e).has(e)},_a.prototype.set=function(e,t){var n=Pa(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Ta(e){var t=this.__data__=new Vi(e);this.size=t.size}Ta.prototype.clear=function(){this.__data__=new Vi,this.size=0},Ta.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ta.prototype.get=function(e){return this.__data__.get(e)},Ta.prototype.has=function(e){return this.__data__.has(e)},Ta.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Vi){var i=n.__data__;if(!ba||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new _a(i)}return n.set(e,t),this.size=n.size,this};function Ma(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new _a;++t<n;)this.add(e[t])}function Aa(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 Da(e,t){return e.has(t)}Ma.prototype.add=Ma.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ma.prototype.has=function(e){return this.__data__.has(e)};function xa(e,t,n,i,a,r){var o=1&n,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 c=-1,h=!0,m=2&n?new Ma:void 0;for(r.set(e,t),r.set(t,e);++c<s;){var f=e[c],v=t[c];if(i)var p=o?i(v,f,c,t,e,r):i(f,v,c,e,t,r);if(void 0!==p){if(p)continue;h=!1;break}if(m){if(!Aa(t,function(e,t){if(!Da(m,t)&&(f===e||a(f,e,n,i,r)))return m.push(t)})){h=!1;break}}else if(f!==v&&!a(f,v,n,i,r)){h=!1;break}}return r.delete(e),r.delete(t),h}var Ca=Xi.Uint8Array;function Ia(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function La(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Fa=qi?qi.prototype:void 0,Ra=Fa?Fa.valueOf:void 0;var Oa=Array.isArray;var $a=Object.prototype.propertyIsEnumerable,Na=Object.getOwnPropertySymbols,Wa=Na?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}(Na(e),function(t){return $a.call(e,t)}))}:function(){return[]};function ja(e){return null!=e&&"object"==typeof e}function Ba(e){return ja(e)&&"[object Arguments]"==ia(e)}var za=Object.prototype,Ua=za.hasOwnProperty,Ha=za.propertyIsEnumerable,Ga=Ba(function(){return arguments}())?Ba:function(e){return ja(e)&&Ua.call(e,"callee")&&!Ha.call(e,"callee")};var Va="object"==typeof e&&e&&!e.nodeType&&e,Ka=Va&&"object"==typeof module&&module&&!module.nodeType&&module,Ya=Ka&&Ka.exports===Va?Xi.Buffer:void 0,Xa=(Ya?Ya.isBuffer:void 0)||function(){return!1},qa=/^(?:0|[1-9]\d*)$/;function Ja(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&qa.test(e))&&e>-1&&e%1==0&&e<t}function Qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Za={};function er(e){return function(t){return e(t)}}Za["[object Float32Array]"]=Za["[object Float64Array]"]=Za["[object Int8Array]"]=Za["[object Int16Array]"]=Za["[object Int32Array]"]=Za["[object Uint8Array]"]=Za["[object Uint8ClampedArray]"]=Za["[object Uint16Array]"]=Za["[object Uint32Array]"]=!0,Za["[object Arguments]"]=Za["[object Array]"]=Za["[object ArrayBuffer]"]=Za["[object Boolean]"]=Za["[object DataView]"]=Za["[object Date]"]=Za["[object Error]"]=Za["[object Function]"]=Za["[object Map]"]=Za["[object Number]"]=Za["[object Object]"]=Za["[object RegExp]"]=Za["[object Set]"]=Za["[object String]"]=Za["[object WeakMap]"]=!1;var tr="object"==typeof e&&e&&!e.nodeType&&e,nr=tr&&"object"==typeof module&&module&&!module.nodeType&&module,ir=nr&&nr.exports===tr&&Ki.process,ar=function(){try{var e=nr&&nr.require&&nr.require("util").types;return e||ir&&ir.binding&&ir.binding("util")}catch(e){}}(),rr=ar&&ar.isTypedArray,or=rr?er(rr):function(e){return ja(e)&&Qa(e.length)&&!!Za[ia(e)]},sr=Object.prototype.hasOwnProperty;function ur(e,t){var n=Oa(e),i=!n&&Ga(e),a=!n&&!i&&Xa(e),r=!n&&!i&&!a&&or(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)!sr.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ja(l,u))||s.push(l);return s}var lr=Object.prototype;function dr(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||lr)}function cr(e,t){return function(n){return e(t(n))}}var hr=cr(Object.keys,Object),mr=Object.prototype.hasOwnProperty;function fr(e){return null!=(t=e)&&Qa(t.length)&&!ra(t)?ur(e):function(e){if(!dr(e))return hr(e);var t=[];for(var n in Object(e))mr.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}function vr(e){return function(e,t,n){var i=t(e);return Oa(e)?i:function(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}(i,n(e))}(e,fr,Wa)}var pr=Object.prototype.hasOwnProperty;var gr=ya(Xi,"DataView"),yr=ya(Xi,"Promise"),br=ya(Xi,"Set"),wr=ya(Xi,"WeakMap"),kr="[object Map]",Sr="[object Promise]",Er="[object Set]",Pr="[object WeakMap]",_r="[object DataView]",Tr=da(gr),Mr=da(ba),Ar=da(yr),Dr=da(br),xr=da(wr),Cr=ia;(gr&&Cr(new gr(new ArrayBuffer(1)))!=_r||ba&&Cr(new ba)!=kr||yr&&Cr(yr.resolve())!=Sr||br&&Cr(new br)!=Er||wr&&Cr(new wr)!=Pr)&&(Cr=function(e){var t=ia(e),n="[object Object]"==t?e.constructor:void 0,i=n?da(n):"";if(i)switch(i){case Tr:return _r;case Mr:return kr;case Ar:return Sr;case Dr:return Er;case xr:return Pr}return t});var Ir="[object Arguments]",Lr="[object Array]",Fr="[object Object]",Rr=Object.prototype.hasOwnProperty;function Or(e,t,n,i,a,r){var o=Oa(e),s=Oa(t),u=o?Lr:Cr(e),l=s?Lr:Cr(t),d=(u=u==Ir?Fr:u)==Fr,c=(l=l==Ir?Fr:l)==Fr,h=u==l;if(h&&Xa(e)){if(!Xa(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new Ta),o||or(e)?xa(e,t,n,i,a,r):function(e,t,n,i,a,r,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new Ca(e),new Ca(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ui(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Ia;case"[object Set]":var u=1&i;if(s||(s=La),e.size!=t.size&&!u)return!1;var l=o.get(e);if(l)return l==t;i|=2,o.set(e,t);var d=xa(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(Ra)return Ra.call(e)==Ra.call(t)}return!1}(e,t,u,n,i,a,r);if(!(1&n)){var m=d&&Rr.call(e,"__wrapped__"),f=c&&Rr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new Ta),a(v,p,n,i,r)}}return!!h&&(r||(r=new Ta),function(e,t,n,i,a,r){var o=1&n,s=vr(e),u=s.length;if(u!=vr(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:pr.call(t,d)))return!1}var c=r.get(e),h=r.get(t);if(c&&h)return c==t&&h==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 $r(e,t,n,i,a){return e===t||(null==e||null==t||!ja(e)&&!ja(t)?e!=e&&t!=t:Or(e,t,n,i,$r,a))}function Nr(e){return e==e&&!aa(e)}function Wr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function jr(e){var t=function(e){for(var t=fr(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,Nr(a)]}return t}(e);return 1==t.length&&t[0][2]?Wr(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 if(!$r(l,u,3,i,new Ta))return!1}return!0}(n,0,t)}}function Br(e){return"symbol"==typeof e||ja(e)&&"[object Symbol]"==ia(e)}var zr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ur=/^\w*$/;function Hr(e,t){if(Oa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Br(e))||(Ur.test(e)||!zr.test(e)||null!=t&&e in Object(t))}function Gr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(Gr.Cache||_a),n}Gr.Cache=_a;var Vr,Kr,Yr,Xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qr=/\\(\\)?/g,Jr=(Vr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Xr,function(e,n,i,a){t.push(i?a.replace(qr,"$1"):n||e)}),t},Kr=Gr(Vr,function(e){return 500===Yr.size&&Yr.clear(),e}),Yr=Kr.cache,Kr);var Qr=qi?qi.prototype:void 0,Zr=Qr?Qr.toString:void 0;function eo(e){if("string"==typeof e)return e;if(Oa(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,eo)+"";if(Br(e))return Zr?Zr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function to(e,t){return Oa(e)?e:Hr(e,t)?[e]:Jr(function(e){return null==e?"":eo(e)}(e))}function no(e){if("string"==typeof e||Br(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function io(e,t){for(var n=0,i=(t=to(t,e)).length;null!=e&&n<i;)e=e[no(t[n++])];return n&&n==i?e:void 0}function ao(e,t){return null!=e&&t in Object(e)}function ro(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=to(t,e)).length,r=!1;++i<a;){var o=no(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&Qa(a)&&Ja(o,a)&&(Oa(e)||Ga(e))}(e,t,ao)}function oo(e,t){return Hr(e)&&Nr(t)?Wr(no(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:io(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?ro(n,e):$r(t,i,3)}}function so(e){return e}function uo(e){return Hr(e)?(t=no(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return io(t,e)}}(e);var t}function lo(e){return e!=e}function co(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,lo,n)}(e,t,0)>-1}var ho=br&&1/La(new br([,-0]))[1]==1/0?function(e){return new br(e)}:function(){};function mo(e,t){return e&&e.length?function(e,t,n){var i=-1,a=co,r=e.length,o=!0,s=[],u=s;if(r>=200){var l=t?null:ho(e);if(l)return La(l);o=!1,a=Da,u=new Ma}else u=t?[]:s;e:for(;++i<r;){var d=e[i],c=t?t(d):d;if(d=0!==d?d:0,o&&c==c){for(var h=u.length;h--;)if(u[h]===c)continue e;t&&u.push(c),s.push(d)}else a(u,c,n)||(u!==s&&u.push(c),s.push(d))}return s}(e,"function"==typeof(n=t)?n:null==n?so:"object"==typeof n?Oa(n)?oo(n[0],n[1]):jr(n):uo(n)):[];var n}var fo="api_paywall_body:",vo="api_paywall_body_meta:",po=function(){return c(function e(t=()=>we().storage,n=500){o(this,e),this.storage=t,this.maxEntries=n,this.memory=null,this.index=null},[{key:"count",get:function(){return this.memory?this.memory.size:this.loadIndex().size}},{key:"evaluateTtl",value:function(e,t=Date.now()){if(0===e){if(this.memory)return;return this.dropPersisted([...this.loadIndex().keys()]),void(this.memory=new Map)}if(this.memory=null,null!==e){var n=[...this.loadIndex().values()].filter(n=>go(n,e,t));if(0!==n.length){this.dropPersisted(n.map(e=>e.url));var i=yo(Math.min(...n.map(e=>e.savedAt)),t);Bi.debug(`Paywall body cache: evicted ${n.length} expired entries (campaign_cache_ttl=${e}s, oldest_age=${i}s)`)}}}},{key:"validEntry",value:function(e,t,n=Date.now()){var i;if(this.memory)return null!==(i=this.memory.get(e))&&void 0!==i?i:null;var a=this.loadIndex().get(e);if(!a)return null;if(null!==t&&t>0&&go(a,t,n))return this.dropPersisted([e]),Bi.debug(`Paywall body cache: evicted expired entry on read (campaign_cache_ttl=${t}s, age=${yo(a.savedAt,n)}s): ${e}`),null;var r=this.read(fo+e);return null===r?(this.dropPersisted([e]),null):{meta:a,body:r}}},{key:"bodyFor",value:function(e){var t,n;return this.memory?null!==(t=null===(n=this.memory.get(e))||void 0===n?void 0:n.body)&&void 0!==t?t:null:this.read(fo+e)}},{key:"store",value:function(e,t,n,i=Date.now()){var a=m({url:e,savedAt:i},t?{contentHash:t}:{});if(this.memory)return this.memory.set(e,{meta:a,body:n}),!0;var r=this.loadIndex(),o=JSON.stringify(a);return this.write(fo+e,n)&&this.write(vo+e,o)?(r.set(e,a),!0):(Bi.warn(`Paywall body cache: could not store ${e}; it will be fetched next time`),this.dropPersisted([e]),!1)}},{key:"seedIfAbsent",value:function(e,t,n,i=Date.now()){return!(this.memory?this.memory.has(e):this.loadIndex().has(e))&&this.store(e,t,n,i)}},{key:"renew",value:function(e,t,n=Date.now()){if(null===t||t<=0||this.memory)return 0;for(var i,a=this.loadIndex(),r=0,o=h(e);!(i=o()).done;){var s=i.value,u=a.get(s);if(u){var l=m({},u,{savedAt:n});this.write(vo+s,JSON.stringify(l))&&(a.set(s,l),r+=1)}}return r}},{key:"remove",value:function(e){this.memory?this.memory.delete(e):this.dropPersisted([e])}},{key:"reconcile",value:function(e){var t=this.memory?[...this.memory.values()].map(e=>e.meta):[...this.loadIndex().values()],n=t.filter(t=>!e.has(t.url)).map(e=>e.url),i=t.filter(t=>e.has(t.url)).sort((e,t)=>e.savedAt-t.savedAt),a=i.slice(0,Math.max(0,i.length-this.maxEntries)).map(e=>e.url);0===n.length&&0===a.length||([...n,...a].forEach(e=>this.remove(e)),Bi.debug(`Paywall body cache: evicted ${n.length} entries no longer named by campaign_rules, ${a.length} over the ${this.maxEntries}-entry cap`))}},{key:"purgeAll",value:function(){var e;this.dropPersisted([...this.loadIndex().keys()]),null===(e=this.memory)||void 0===e||e.clear()}},{key:"loadIndex",value:function(){if(this.index)return this.index;var e;this.index=new Map;try{e=this.storage().getAllKeys()}catch(e){return Bi.warn(`Paywall body cache: storage unavailable, caching nothing (${e})`),this.index}for(var t,n=new Set(e.filter(e=>e.startsWith(fo)).map(e=>e.slice(17))),i=[],a=h(e);!(t=a()).done;){var r=t.value;if(r.startsWith(vo)){var o=r.slice(22),s=bo(this.read(r));(null==s?void 0:s.url)===o&&n.has(o)?this.index.set(o,s):i.push(o),n.delete(o)}}return this.dropPersisted([...i,...n]),this.index}},{key:"dropPersisted",value:function(e){for(var t,n=h(e);!(t=n()).done;){var i,a=t.value;null===(i=this.index)||void 0===i||i.delete(a),this.removeKey(vo+a),this.removeKey(fo+a)}}},{key:"read",value:function(e){try{return this.storage().getItem(e)}catch(e){return null}}},{key:"write",value:function(e,t){try{this.storage().setItem(e,t)}catch(e){return!1}return this.read(e)===t}},{key:"removeKey",value:function(e){try{this.storage().removeItem(e)}catch(e){}}}])}();function go(e,t,n){return(n-e.savedAt)/1e3>=t}function yo(e,t){return Math.floor((t-e)/1e3)}function bo(e){if(null===e)return null;try{var t=JSON.parse(e);return"string"==typeof(null==t?void 0:t.url)&&"number"==typeof(null==t?void 0:t.savedAt)?t:null}catch(e){return null}}var wo=new po,ko=function(){return c(function e(){o(this,e),this.memoryStore={}},[{key:"storage",get:function(){return we().storage}},{key:"setDevice",value:function(e){this.setItem(it,e)}},{key:"getDevice",value:function(){return this.getItem(it)}},{key:"resetDevice",value:function(){this.resetItem(it)}},{key:"getAnonymousMode",value:function(){return this.getItem(Bt)||!1}},{key:"setAnonymousMode",value:function(e){this.setItem(Bt,e)}},{key:"clearAnonymousMode",value:function(){this.resetItem(Bt)}},{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(an,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(an)||"en"}},{key:"setCampaignRules",value:function(e,t){e!==_t?e!==ct||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[ct]=JSON.stringify(t):this.memoryStore[_t]=JSON.stringify(t)}},{key:"getCampaignRules",value:function(e){if(e===_t)return this.memoryStore[_t]?JSON.parse(this.memoryStore[_t]):null;if(e===ct){var t=this.memoryStore[ct];if(null!=t)return JSON.parse(t);var n=this.getItem(ct);if(null===n)return null;if("string"==typeof n)try{n=JSON.parse(n)}catch(e){return n}return this.isLegacyTimestampedCache(n)?n.data:n}return this.getItem(e)}},{key:"setPaywalls",value:function(e,t){e!==Mt?e!==mt||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[mt]=JSON.stringify(t):this.memoryStore[Mt]=JSON.stringify(t)}},{key:"setApiPaywallsFromBodyCache",value:function(e){var t={bodyCacheUrls:e};0!==this.getCampaignCacheTtl()?this.setItem(mt,t):this.memoryStore[mt]=JSON.stringify(t)}},{key:"getPaywalls",value:function(e){if(e===Mt)return this.memoryStore[Mt]?JSON.parse(this.memoryStore[Mt]):null;if(e===mt){var t=this.memoryStore[mt];if(null!=t){var n=JSON.parse(t);return So(n)?Eo(n.bodyCacheUrls):n}var i=this.getItem(mt);if(null===i)return null;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){return i}return So(i)?Eo(i.bodyCacheUrls):this.isLegacyTimestampedCache(i)?i.data:i}return 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(gt))&&void 0!==e?e:[];return mo(zi([...null!==(t=this.getItem(Dt))&&void 0!==t?t:[],...n]),"sku_ref_id")}},{key:"setNamiConfig",value:function(e){this.setItem(rt,e)}},{key:"getNamiConfig",value:function(){return this.getItem(rt)}},{key:"setCustomerAttribute",value:function(e,t){this.setItem(Lt+e,t)}},{key:"getCustomerAttribute",value:function(e){return this.getItem(Lt+e)}},{key:"getAllCustomerAttributes",value:function(){return this.storage.getAllKeys().map(e=>[e,this.storage.getItem(e)]).filter(([e])=>e.includes(Lt)).map(([e,t])=>e.replace(Lt,"")+":"+t)}},{key:"getAllCustomerAttributesKeys",value:function(){return this.storage.getAllKeys().filter(e=>e.includes(Lt)).map(e=>e.replace(Lt,""))}},{key:"getAllCustomerAttributesMap",value:function(){var e={};return this.getAllCustomerAttributesKeys().forEach(t=>{var n=this.getCustomerAttribute(t);null!=n&&(e[t]=String(n))}),e}},{key:"clearCustomerAttribute",value:function(e){var t=Lt+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}},{key:"clearAllCustomerAttributes",value:function(){this.storage.getAllKeys().filter(e=>e.includes(Lt)).map(e=>this.resetItem(e))}},{key:"setNamiProfile",value:function(e){this.setItem(st,e)}},{key:"getNamiProfile",value:function(){return this.getItem(st)}},{key:"removeNamiProfile",value:function(){this.resetItem(st)}},{key:"setCustomerJourneyState",value:function(e){this.setItem(Rt,e)}},{key:"getCustomerJourneyState",value:function(){return this.getItem(Rt)}},{key:"getJourneyRuleState",value:function(){return this.getItem($t)}},{key:"setJourneyRuleState",value:function(e){this.setItem($t,e)}},{key:"removeJourneyRuleState",value:function(){this.resetItem($t)}},{key:"getJourneyInstallEvaluated",value:function(){return!0===this.getItem(Wt)}},{key:"setJourneyInstallEvaluated",value:function(){this.setItem(Wt,!0)}},{key:"setSessionCounter",value:function(){var e=this.getItem(Gt),t=e?parseInt(e):Kt||Kt;this.setItem(Gt,t+1)}},{key:"getSessionCounter",value:function(){var e=this.getItem(Gt);return e?parseInt(e):Kt}},{key:"setLastImpressionId",value:function(e){this.setItem(Xt,e)}},{key:"getLastImpressionId",value:function(){var e;return null!==(e=this.getItem(Xt))&&void 0!==e?e:""}},{key:"setPurchaseImpression",value:function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(Jt,t)}},{key:"getPurchaseImpression",value:function(){var e;return null!==(e=this.getItem(Jt))&&void 0!==e?e:""}},{key:"setSessionId",value:function(e){e&&this.setItem(tn,e)}},{key:"getSessionId",value:function(){var e;return null!==(e=this.getItem(tn))&&void 0!==e?e:""}},{key:"clearSessionId",value:function(){this.resetItem(tn)}},{key:"setLaunchId",value:function(e){e&&this.setItem(Zt,e)}},{key:"getLaunchId",value:function(){var e;return null!==(e=this.getItem(Zt))&&void 0!==e?e:""}},{key:"clearLaunchId",value:function(){this.resetItem(Zt)}},{key:"setPurchaseChannel",value:function(e){e&&this.setItem(on,e)}},{key:"getPurchaseChannel",value:function(){return this.getItem(on)}},{key:"getAnonymousUUID",value:function(){return this.getItem(Ut)}},{key:"setAnonymousUUID",value:function(e){this.setItem(Ut,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(Ut)}},{key:"setApiCampaignSessionTimestamp",value:function(){this.setItem(vt,Date.now())}},{key:"getApiCampaignSessionTimestamp",value:function(){return this.getItem(vt)}},{key:"purgeApiCampaignCache",value:function(){this.resetItem(mt),this.resetItem(ct),this.resetItem(vt)}},{key:"getCampaignCacheTtl",value:function(){var e,t,n=null===(e=this.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.filter(e=>e.startsWith(Wn)).map(e=>e.slice(Wn.length)).find(e=>/^\d+$/.test(e));if(void 0!==n)return parseInt(n,10);var i=this.getAppConfig(lt)||this.getAppConfig(Et);return null!==(t=null==i?void 0:i.campaign_cache_ttl)&&void 0!==t?t:null}},{key:"isLegacyTimestampedCache",value:function(e){return"object"==typeof e&&null!==e&&"cachedAt"in e&&"data"in e}},{key:"setItem",value:function(e,t){var n;try{n=JSON.stringify(t)}catch(t){return void Bi.error(`Serialization failed for ${e}`,t)}try{this.storage.setItem(e,n)}catch(t){Bi.error("Error setting item in localStorage:",t),this.resetItem(e),this.memoryStore[e]=n}}},{key:"getItem",value:function(e){try{var t=this.storage.getItem(e);if(null!==t)return JSON.parse(t)}catch(t){Bi.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{this.storage.removeItem(e)}catch(t){Bi.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clearAll",value:function(){Ni.forEach(e=>this.resetItem(e)),this.clearAllCustomerAttributes(),this.memoryStore={}}},{key:"clear",value:function(){try{this.storage.clear()}catch(e){Bi.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}();function So(e){return"object"==typeof e&&null!==e&&Array.isArray(e.bodyCacheUrls)}function Eo(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a=t.value,r=wo.bodyFor(a);if(null!==r)try{n.push(JSON.parse(r))}catch(e){wo.remove(a)}}return n}var Po=new ko,_o=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.status=e,i.message=`RetryLimitExceededError: ${i.message}`,i}return p(t,e),c(t)}(M(Error)),To=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(M(Error)),Mo=function(e){function t(){var e;return o(this,t),(e=r(this,t)).status=409,e.name="ConflictError",e.message="ConflictError: Server responded with conflict",e}return p(t,e),c(t)}(To),Ao=function(e){function t(){return o(this,t),r(this,t,[Ue])}return p(t,e),c(t)}(M(Error)),Do=function(e){function t(){return o(this,t),r(this,t,[$e])}return p(t,e),c(t)}(M(Error)),xo=function(e){function t(){return o(this,t),r(this,t,[We])}return p(t,e),c(t)}(M(Error)),Co=function(e){function t(){return o(this,t),r(this,t,[Be])}return p(t,e),c(t)}(M(Error)),Io=function(e){function t(){return o(this,t),r(this,t,[Ge])}return p(t,e),c(t)}(M(Error)),Lo=function(e){function t(){return o(this,t),r(this,t,[Ke])}return p(t,e),c(t)}(M(Error)),Fo=function(e){function t(){return o(this,t),r(this,t,[Je])}return p(t,e),c(t)}(M(Error)),Ro=function(e){function t(){return o(this,t),r(this,t,[Ze])}return p(t,e),c(t)}(M(Error)),Oo=function(e){function t(){return o(this,t),r(this,t,[Ze])}return p(t,e),c(t)}(M(Error)),$o=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(M(Error)),No=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`BadRequestError: ${n.message}`,n}return p(t,e),c(t)}(To),Wo=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`NotFoundError: ${n.message}`,n}return p(t,e),c(t)}(To),jo=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.message=`ClientError: ${i.message}`,i}return p(t,e),c(t)}(To),Bo=function(e){function t(e){var n;return o(this,t),(n=r(this,t,[e])).message=`ServerError: ${n.message}`,n}return p(t,e),c(t)}(To),zo=(e,t)=>{if(e==li)throw new No(t);if(e==ci)throw new Wo(t);if(e==mi)throw new Mo;if(e>li&&e<vi)throw new jo(e,t);if(e>=vi)throw new Bo(t)};function Uo(e){for(var t=e.length;--t>=0;)e[t]=0}Uo(new Array(576)),Uo(new Array(60)),Uo(new Array(512)),Uo(new Array(256)),Uo(new Array(29)),Uo(new Array(30));var Ho=(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},Go=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})()),Vo=(e,t,n,i)=>{var a=Go,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^e},Ko={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"},Yo=0,Xo=4,qo=5,Jo=6,Qo=0,Zo=1,es=2,ts=-2,ns=-3,is=-4,as=-5,rs=8,os=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ss=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)os(n,i)&&(e[i]=n[i])}}return e},us=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},ls=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){ls=!1}for(var ds=new Uint8Array(256),cs=0;cs<256;cs++)ds[cs]=cs>=252?6:cs>=248?5:cs>=240?4:cs>=224?3:cs>=192?2:1;ds[254]=ds[254]=1;var hs=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+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),r=0,a=0;r<s;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++),n<128?t[r++]=n:n<2048?(t[r++]=192|n>>>6,t[r++]=128|63&n):n<65536?(t[r++]=224|n>>>12,t[r++]=128|n>>>6&63,t[r++]=128|63&n):(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63,t[r++]=128|n>>>6&63,t[r++]=128|63&n);return t},ms=(e,t)=>{var n,i,a=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var r=new Array(2*a);for(i=0,n=0;n<a;){var o=e[n++];if(o<128)r[i++]=o;else{var s=ds[o];if(s>4)r[i++]=65533,n+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&n<a;)o=o<<6|63&e[n++],s--;s>1?r[i++]=65533:o<65536?r[i++]=o:(o-=65536,r[i++]=55296|o>>10&1023,r[i++]=56320|1023&o)}}}return((e,t)=>{if(t<65534&&e.subarray&&ls)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var n="",i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n})(r,i)},fs=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);for(var n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+ds[e[n]]>t?n:t};var vs=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ps=16209,gs=function(e,t){var n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,_,T=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,_=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=T.dmax,u=T.wsize,l=T.whave,d=T.wnext,c=T.window,h=T.hold,m=T.bits,f=T.lencode,v=T.distcode,p=(1<<T.lenbits)-1,g=(1<<T.distbits)-1;e:do{m<15&&(h+=P[n++]<<m,m+=8,h+=P[n++]<<m,m+=8),y=f[h&p];t:for(;;){if(h>>>=b=y>>>24,m-=b,0===(b=y>>>16&255))_[a++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){T.mode=16191;break e}e.msg="invalid literal/length code",T.mode=ps;break e}y=f[(65535&y)+(h&(1<<b)-1)];continue t}for(w=65535&y,(b&=15)&&(m<b&&(h+=P[n++]<<m,m+=8),w+=h&(1<<b)-1,h>>>=b,m-=b),m<15&&(h+=P[n++]<<m,m+=8,h+=P[n++]<<m,m+=8),y=v[h&g];;){if(h>>>=b=y>>>24,m-=b,16&(b=y>>>16&255)){if(k=65535&y,m<(b&=15)&&(h+=P[n++]<<m,(m+=8)<b&&(h+=P[n++]<<m,m+=8)),(k+=h&(1<<b)-1)>s){e.msg="invalid distance too far back",T.mode=ps;break e}if(h>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>l&&T.sane){e.msg="invalid distance too far back",T.mode=ps;break e}if(S=0,E=c,0===d){if(S+=u-b,b<w){w-=b;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}}else if(d<b){if(S+=u+d-b,(b-=d)<w){w-=b;do{_[a++]=c[S++]}while(--b);if(S=0,d<w){w-=b=d;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}}}else if(S+=d-b,b<w){w-=b;do{_[a++]=c[S++]}while(--b);S=a-k,E=_}for(;w>2;)_[a++]=E[S++],_[a++]=E[S++],_[a++]=E[S++],w-=3;w&&(_[a++]=E[S++],w>1&&(_[a++]=E[S++]))}else{S=a-k;do{_[a++]=_[S++],_[a++]=_[S++],_[a++]=_[S++],w-=3}while(w>2);w&&(_[a++]=_[S++],w>1&&(_[a++]=_[S++]))}break}if(64&b){e.msg="invalid distance code",T.mode=ps;break e}y=v[(65535&y)+(h&(1<<b)-1)]}}break}}while(n<i&&a<o);n-=w=m>>3,h&=(1<<(m-=w<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<o?o-a+257:257-(a-o),T.hold=h,T.bits=m},ys=15,bs=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ws=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ks=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Ss=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Es=(e,t,n,i,a,r,o,s)=>{var u,l,d,c,h,m,f,v,p,g=s.bits,y=0,b=0,w=0,k=0,S=0,E=0,P=0,_=0,T=0,M=0,A=null,D=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=ys;y++)D[y]=0;for(b=0;b<i;b++)D[t[n+b]]++;for(S=g,k=ys;k>=1&&0===D[k];k--);if(S>k&&(S=k),0===k)return a[r++]=20971520,a[r++]=20971520,s.bits=1,0;for(w=1;w<k&&0===D[w];w++);for(S<w&&(S=w),_=1,y=1;y<=ys;y++)if(_<<=1,(_-=D[y])<0)return-1;if(_>0&&(0===e||1!==k))return-1;for(x[1]=0,y=1;y<ys;y++)x[y+1]=x[y]+D[y];for(b=0;b<i;b++)0!==t[n+b]&&(o[x[t[n+b]]++]=b);if(0===e?(A=C=o,m=20):1===e?(A=bs,C=ws,m=257):(A=ks,C=Ss,m=0),M=0,b=0,y=w,h=r,E=S,P=0,d=-1,c=(T=1<<S)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){f=y-P,o[b]+1<m?(v=0,p=o[b]):o[b]>=m?(v=C[o[b]-m],p=A[o[b]-m]):(v=96,p=0),u=1<<y-P,w=l=1<<E;do{a[h+(M>>P)+(l-=u)]=f<<24|v<<16|p}while(0!==l);for(u=1<<y-1;M&u;)u>>=1;if(0!==u?(M&=u-1,M+=u):M=0,b++,0===--D[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(M&c)!==d){for(0===P&&(P=S),h+=w,_=1<<(E=y-P);E+P<k&&!((_-=D[E+P])<=0);)E++,_<<=1;if(T+=1<<E,1===e&&T>852||2===e&&T>592)return 1;a[d=M&c]=S<<24|E<<16|h-r}}return 0!==M&&(a[h+M]=y-P<<24|64<<16),s.bits=S,0},Ps=Xo,_s=qo,Ts=Jo,Ms=Qo,As=Zo,Ds=es,xs=ts,Cs=ns,Is=is,Ls=as,Fs=rs,Rs=16180,Os=16190,$s=16191,Ns=16192,Ws=16194,js=16199,Bs=16200,zs=16206,Us=16209,Hs=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Gs(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Vs,Ks,Ys=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<Rs||t.mode>16211?1:0},Xs=e=>{if(Ys(e))return xs;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Rs,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Ms},qs=e=>{if(Ys(e))return xs;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Xs(e)},Js=(e,t)=>{var n;if(Ys(e))return xs;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?xs:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,qs(e))},Qs=(e,t)=>{if(!e)return xs;var n=new Gs;e.state=n,n.strm=e,n.window=null,n.mode=Rs;var i=Js(e,t);return i!==Ms&&(e.state=null),i},Zs=!0,eu=e=>{if(Zs){Vs=new Int32Array(512),Ks=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Es(1,e.lens,0,288,Vs,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Es(2,e.lens,0,32,Ks,0,e.work,{bits:5}),Zs=!1}e.lencode=Vs,e.lenbits=9,e.distcode=Ks,e.distbits=5},tu=(e,t,n,i)=>{var a,r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),i>=r.wsize?(r.window.set(t.subarray(n-r.wsize,n),0),r.wnext=0,r.whave=r.wsize):((a=r.wsize-r.wnext)>i&&(a=i),r.window.set(t.subarray(n-i,n-i+a),r.wnext),(i-=a)?(r.window.set(t.subarray(n-i,n),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=a))),0},nu=(e,t)=>{var n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,_,T=0,M=new Uint8Array(4),A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ys(e)||!e.output||!e.input&&0!==e.avail_in)return xs;(n=e.state).mode===$s&&(n.mode=Ns),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,l=n.hold,d=n.bits,c=s,h=u,E=Ms;e:for(;;)switch(n.mode){case Rs:if(0===n.wrap){n.mode=Ns;break}for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,M[0]=255&l,M[1]=l>>>8&255,n.check=Vo(n.check,M,2,0),l=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Us;break}if((15&l)!==Fs){e.msg="unknown compression method",n.mode=Us;break}if(d-=4,S=8+(15&(l>>>=4)),0===n.wbits&&(n.wbits=S),S>15||S>n.wbits){e.msg="invalid window size",n.mode=Us;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:$s,l=0,d=0;break;case 16181:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(n.flags=l,(255&n.flags)!==Fs){e.msg="unknown compression method",n.mode=Us;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Us;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=Vo(n.check,M,2,0)),l=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,M[2]=l>>>16&255,M[3]=l>>>24&255,n.check=Vo(n.check,M,4,0)),l=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=Vo(n.check,M,2,0)),l=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=Vo(n.check,M,2,0)),l=0,d=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((m=n.length)>s&&(m=s),m&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(r,r+m),S)),512&n.flags&&4&n.wrap&&(n.check=Vo(n.check,i,m,r)),s-=m,r+=m,n.length-=m),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;m=0;do{S=i[r+m++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&m<s);if(512&n.flags&&4&n.wrap&&(n.check=Vo(n.check,i,m,r)),s-=m,r+=m,S)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;m=0;do{S=i[r+m++],n.head&&S&&n.length<65536&&(n.head.comment+=String.fromCharCode(S))}while(S&&m<s);if(512&n.flags&&4&n.wrap&&(n.check=Vo(n.check,i,m,r)),s-=m,r+=m,S)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Us;break}l=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=$s;break;case 16189:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}e.adler=n.check=Hs(l),l=0,d=0,n.mode=Os;case Os:if(0===n.havedict)return e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,Ds;e.adler=n.check=1,n.mode=$s;case $s:if(t===_s||t===Ts)break e;case Ns:if(n.last){l>>>=7&d,d-=7&d,n.mode=zs;break}for(;d<3;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}switch(n.last=1&l,d-=1,3&(l>>>=1)){case 0:n.mode=16193;break;case 1:if(eu(n),n.mode=js,t===Ts){l>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Us}l>>>=2,d-=2;break;case 16193:for(l>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Us;break}if(n.length=65535&l,l=0,d=0,n.mode=Ws,t===Ts)break e;case Ws:n.mode=16195;case 16195:if(m=n.length){if(m>s&&(m=s),m>u&&(m=u),0===m)break e;a.set(i.subarray(r,r+m),o),s-=m,r+=m,u-=m,o+=m,n.length-=m;break}n.mode=$s;break;case 16196:for(;d<14;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(n.nlen=257+(31&l),l>>>=5,d-=5,n.ndist=1+(31&l),l>>>=5,d-=5,n.ncode=4+(15&l),l>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Us;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;d<3;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.lens[A[n.have++]]=7&l,l>>>=3,d-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},E=Es(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid code lengths set",n.mode=Us;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(y<16)l>>>=p,d-=p,n.lens[n.have++]=y;else{if(16===y){for(_=p+2;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(l>>>=p,d-=p,0===n.have){e.msg="invalid bit length repeat",n.mode=Us;break}S=n.lens[n.have-1],m=3+(3&l),l>>>=2,d-=2}else if(17===y){for(_=p+3;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}d-=p,S=0,m=3+(7&(l>>>=p)),l>>>=3,d-=3}else{for(_=p+7;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}d-=p,S=0,m=11+(127&(l>>>=p)),l>>>=7,d-=7}if(n.have+m>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Us;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===Us)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Us;break}if(n.lenbits=9,P={bits:n.lenbits},E=Es(1,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid literal/lengths set",n.mode=Us;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},E=Es(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,E){e.msg="invalid distances set",n.mode=Us;break}if(n.mode=js,t===Ts)break e;case js:n.mode=Bs;case Bs:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,gs(e,h),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,s=e.avail_in,l=n.hold,d=n.bits,n.mode===$s&&(n.back=-1);break}for(n.back=0;g=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(g&&!(240&g)){for(b=p,w=g,k=y;g=(T=n.lencode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}l>>>=b,d-=b,n.back+=b}if(l>>>=p,d-=p,n.back+=p,n.length=y,0===g){n.mode=16205;break}if(32&g){n.back=-1,n.mode=$s;break}if(64&g){e.msg="invalid literal/length code",n.mode=Us;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for(_=n.extra;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;g=(T=n.distcode[l&(1<<n.distbits)-1])>>>16&255,y=65535&T,!((p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(!(240&g)){for(b=p,w=g,k=y;g=(T=n.distcode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&T,!(b+(p=T>>>24)<=d);){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}l>>>=b,d-=b,n.back+=b}if(l>>>=p,d-=p,n.back+=p,64&g){e.msg="invalid distance code",n.mode=Us;break}n.offset=y,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for(_=n.extra;d<_;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Us;break}n.mode=16204;case 16204:if(0===u)break e;if(m=h-u,n.offset>m){if((m=n.offset-m)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Us;break}m>n.wnext?(m-=n.wnext,f=n.wsize-m):f=n.wnext-m,m>n.length&&(m=n.length),v=n.window}else v=a,f=o-n.offset,m=n.length;m>u&&(m=u),u-=m,n.length-=m;do{a[o++]=v[f++]}while(--m);0===n.length&&(n.mode=Bs);break;case 16205:if(0===u)break e;a[o++]=n.length,u--,n.mode=Bs;break;case zs:if(n.wrap){for(;d<32;){if(0===s)break e;s--,l|=i[r++]<<d,d+=8}if(h-=u,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?Vo(n.check,a,h,o-h):Ho(n.check,a,h,o-h)),h=u,4&n.wrap&&(n.flags?l:Hs(l))!==n.check){e.msg="incorrect data check",n.mode=Us;break}l=0,d=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Us;break}l=0,d=0}n.mode=16208;case 16208:E=As;break e;case Us:E=Cs;break e;case 16210:return Is;default:return xs}return e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=s,n.hold=l,n.bits=d,(n.wsize||h!==e.avail_out&&n.mode<Us&&(n.mode<zs||t!==Ps))&&tu(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?Vo(n.check,a,h,e.next_out-h):Ho(n.check,a,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===$s?128:0)+(n.mode===js||n.mode===Ws?256:0),(0===c&&0===h||t===Ps)&&E===Ms&&(E=Ls),E},iu={inflateReset:qs,inflateReset2:Js,inflateResetKeep:Xs,inflateInit:e=>Qs(e,15),inflateInit2:Qs,inflate:nu,inflateEnd:e=>{if(Ys(e))return xs;var t=e.state;return t.window&&(t.window=null),e.state=null,Ms},inflateGetHeader:(e,t)=>{if(Ys(e))return xs;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Ms):xs},inflateSetDictionary:(e,t)=>{var n,i=t.length;return Ys(e)||0!==(n=e.state).wrap&&n.mode!==Os?xs:n.mode===Os&&Ho(1,t,i,0)!==n.check?Cs:tu(e,t,i,i)?(n.mode=16210,Is):(n.havedict=1,Ms)},inflateInfo:"pako inflate (from Nodeca project)"};var au=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},ru=Object.prototype.toString,ou=Yo,su=Xo,uu=Qo,lu=Zo,du=es,cu=ts,hu=ns,mu=is;function fu(e){this.options=ss({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vs,this.strm.avail_out=0;var n=iu.inflateInit2(this.strm,t.windowBits);if(n!==uu)throw new Error(Ko[n]);if(this.header=new au,iu.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=hs(t.dictionary):"[object ArrayBuffer]"===ru.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=iu.inflateSetDictionary(this.strm,t.dictionary))!==uu))throw new Error(Ko[n])}fu.prototype.push=function(e,t){var n,i,a,r=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(i=t===~~t?t:!0===t?su:ou,"[object ArrayBuffer]"===ru.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(o),r.next_out=0,r.avail_out=o),(n=iu.inflate(r,i))===du&&s&&((n=iu.inflateSetDictionary(r,s))===uu?n=iu.inflate(r,i):n===hu&&(n=du));r.avail_in>0&&n===lu&&r.state.wrap>0&&0!==e[r.next_in];)iu.inflateReset(r),n=iu.inflate(r,i);switch(n){case cu:case hu:case du:case mu:return this.onEnd(n),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||n===lu))if("string"===this.options.to){var u=fs(r.output,r.next_out),l=r.next_out-u,d=ms(r.output,u);r.next_out=l,r.avail_out=o-l,l&&r.output.set(r.output.subarray(u,u+l),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(n!==uu||0!==a){if(n===lu)return n=iu.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},fu.prototype.onData=function(e){this.chunks.push(e)},fu.prototype.onEnd=function(e){e===uu&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=us(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var vu={ungzip:function(e,t){var n=new fu(t);if(n.push(e),n.err)throw n.msg||Ko[n.err];return n.result}}.ungzip,pu=e=>{var t;if(null!=e&&e.includes(gn))t=mn;else{var n=null==e?void 0:e.find(e=>e.includes(vn));t=n?n.split("=")[1]:cn}return(t=t.replace(/\/$/,""))+"/"+ln},gu=e=>{var t,n,i=Po.getAppConfig(lt)||Po.getAppConfig(Et);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},yu=()=>Po.getCampaignCacheTtl(),bu=()=>{var e=yu();if(null!==e)if(0!==e){var t=Po.getApiCampaignSessionTimestamp();if(null!==t)(Date.now()-t)/1e3>=e&&Po.purgeApiCampaignCache()}else Po.purgeApiCampaignCache()},wu=e=>{var t=!gu(Pe.THIRD_PARTY_TRANSACTIONS);return e&&!t&&Bi.info(`[${e}] Your plan does not have purchase management features.`),t},ku=()=>{var e,t,n=null===(e=Po.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(_n))&&void 0!==t&&t},Su=()=>{var e,t,n=null===(e=Po.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(Mn))&&void 0!==t&&t};function Eu(e){try{var t=function(e){if("undefined"!=typeof Buffer)return new Uint8Array(Buffer.from(e,"base64"));for(var t=atob(e),n=t.length,i=new Uint8Array(n),a=0;a<n;a++)i[a]=t.charCodeAt(a);return i}(e.trim()),n=vu(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}var Pu=null;function _u(){return null!==Pu&&(n=null===(e=Po.getNamiConfig())||void 0===e?void 0:e.namiCommands,null!==(t=null==n?void 0:n.includes(Dn))&&void 0!==t&&t);var e,t,n}function Tu(e){if(e)return e.length>4096?e.slice(0,4096):e}function Mu(e){try{return new URL(e).pathname}catch(t){return e}}function Au(e){var t=null==e?void 0:e.body;return"string"==typeof t?Tu(t):void 0}function Du(e){try{var t;null===(t=Pu)||void 0===t||t(e)}catch(e){}}function xu(e,t,n,i){var r,o,s,u,l,d,c,h;return k(function(m){for(;;)switch(m.p=m.n){case 0:if(_u()){m.n=1;break}return m.a(2,i());case 1:return o=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",s=Date.now(),m.p=2,m.n=3,a(i());case 3:u=m.v,m.n=5;break;case 4:throw m.p=4,c=m.v,Du({method:o,url:e,path:Mu(e),statusCode:0,durationMs:Date.now()-s,timestamp:new Date,requestBody:Au(t),errorDescription:Cu(c),kind:n}),c;case 5:return l=Date.now()-s,m.p=6,h=Tu,m.n=7,a(u.clone().text());case 7:d=h(m.v),m.n=9;break;case 8:m.p=8,m.v;case 9:return Du({method:o,url:e,path:Mu(e),statusCode:u.status,durationMs:l,timestamp:new Date,requestBody:Au(t),responseBody:d,kind:n}),m.a(2,u)}},null,null,[[6,8],[2,4]],Promise)}function Cu(e){return e instanceof Error?e.name?`${e.name}: ${e.message}`:e.message:String(e)}function Iu(e,t,n=Jn,i=Kn){var r,o,s,u,l,d,c;return k(function(h){for(;;)switch(h.n){case 0:return o=0,s=ku(),u=Su(),l=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",d=()=>{var r,c,h,m;return k(function(f){for(;;)switch(f.n){case 0:return(s||u)&&Bi.debug(`[HTTP] ${l} ${e}`),u&&null!=t&&t.body&&Bi.debug(`[HTTP] Request body: ${t.body}`),f.n=1,a(xu(e,t,"api",()=>Lu(e,t,n)));case 1:if((r=f.v).ok){f.n=7;break}if(!u){f.n=3;break}return f.n=2,a(r.clone().text());case 2:c=f.v,Bi.debug(`[HTTP] Response ${r.status}: ${c}`);case 3:if(r.status!=mi){f.n=4;break}throw new Mo;case 4:if(!(++o<=i)){f.n=6;break}return h=1e3*(o+Xn),f.n=5,a(new Promise(e=>setTimeout(e,h)));case 5:return f.a(2,d());case 6:throw new _o(r.status,`Request failed after ${i} retries`);case 7:if(!u){f.n=9;break}return f.n=8,a(r.clone().text());case 8:m=f.v,Bi.debug(`[HTTP] Response ${r.status}: ${m}`);case 9:return f.a(2,r)}},null,null,null,Promise)},h.n=1,a(d());case 1:return c=h.v,h.a(2,c.json())}},null,null,null,Promise)}function Lu(e,t={},n){var i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return i=new AbortController,r=setTimeout(()=>i.abort(),n),t.signal=i.signal,s.n=1,a(fetch(e,t));case 1:return o=s.v,clearTimeout(r),s.a(2,o)}},null,null,null,Promise)}var Fu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{},Ru="function"==typeof Fu.BigInt,Ou=Ru?Fu.BigInt.bind(Fu):void 0,$u=Ru?Ou("0xffffffffffffffffffffffffffffffff"):null,Nu=Ru?Ou("0x100000000000000000000000000000000"):null,Wu=Ru?Ou(0):null,ju=Ru?Ou(1):null,Bu=Ru?Ou(8):null,zu=Ru?Ou(1e4):null,Uu=Fu.crypto,Hu="function"==typeof(null==Uu?void 0:Uu.getRandomValues),Gu=1/16,Vu=e=>we().device.getDeviceData(e),Ku=()=>{var e=Po.getNamiConfig();return e&&e.formFactor?e.formFactor:we().device.getDeviceFormFactor()};function Yu(){return we().device.generateUUID()}function Xu(e){if(!Ru||!$u)return Qu(e);try{var t=$u,n=function(e){if(!Ou)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return Ou("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw Bi.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function qu(e){if(!Ou)throw new Error("BigInt is not supported in this environment");var t=e.toString(16).padStart(32,"0");t=t.substring(0,12)+"4"+t.substring(13);var n=3&parseInt(t[16],16)|8;return(t=t.substring(0,16)+n.toString(16)+t.substring(17)).slice(0,8)+"-"+t.slice(8,12)+"-"+t.slice(12,16)+"-"+t.slice(16,20)+"-"+t.slice(20)}function Ju(e,t=.5){if(!Number.isFinite(e))throw new Error("Invalid target");if(!Number.isFinite(t))throw new Error("Invalid tolerance");var n=Math.max(0,Math.min(100,e)),i=Math.max(0,Math.min(50,t)),a=e=>Math.round(100*e),r=Math.max(0,a(n-i)),o=Math.min(1e4,a(n+i));if(!(Ru&&$u&&Ou&&zu))return function(e,t){for(var n=Math.max(0,Math.min(100,e-t)),i=Math.min(100,Math.max(0,e+t)),a=Yu(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var u=Yu(),l=Qu(u);if(l>=n&&l<=i)return u;var d=Zu(l,n,i);d<r&&(r=d,a=u)}return a}(n,i);var s=$u,u=Ou,l=zu,d=e=>s*u(e)/l,c=d(r),m=d(o);if(m<=c)return qu(c);var f=c+function(e){if(!Ou||null===Nu||null===ju||null===Wu||null===Bu)throw new Error("BigInt is not supported in this environment");var t=Ou,n=Wu,i=ju,a=Bu,r=Nu;if(e<n)throw new Error("n must be non-negative");if(e===n)return n;for(var o=new Uint8Array(16),s=e+i,u=r/s*s-i,l=0,d=!1;l<10;){if(Hu)Uu.getRandomValues(o);else{d||(d=!0,Bi.warn("randomBigInt: crypto.getRandomValues unavailable, using Math.random fallback"));for(var c=0;c<o.length;c++)o[c]=Math.floor(256*Math.random())}for(var m,f=n,v=h(o);!(m=v()).done;)f=f<<a|t(m.value);if(f<=u)return f%s;l++}if(Hu)try{Uu.getRandomValues(o);for(var p,g=n,y=h(o);!(p=y()).done;)g=g<<a|t(p.value);var b=g%s;return Bi.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:l}),b}catch(e){throw Bi.error("randomBigInt: failed to generate random values",e),new Error("randomBigInt: unable to generate random value")}for(var w,k=n,S=h(o);!(w=S()).done;)k=k<<a|t(w.value);return Bi.warn("randomBigInt: reached max rejection attempts without crypto, using modulo fallback",{n:e.toString(),attempts:l}),k%s}(m-c);return qu(f)}function Qu(e){var t=function(e){var t=e.replace(/-/g,"").toLowerCase();if(!/^[0-9a-f]{32}$/.test(t))throw new Error(`Invalid UUID format: ${e}`);for(var n=0,i=t.length-1;i>=0;i--){n=(n+parseInt(t[i],16))*Gu}return n}(e);return 100*t}function Zu(e,t,n){return e<t?t-e:e>n?e-n:0}function el(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new Do;return i.apply(this,e)},n}function tl(e,t,n){var i=n.value;return n.value=function(...e){var t=Po.getDevice();if(null==t||!t.id)throw new xo;return i.apply(this,e)},n}var nl,il=function(){function e(){o(this,e);var t=Po.getNamiConfig();!this.platformID&&t&&this.configure(t)}return c(e,[{key:"deviceID",get:function(){var e;return null===(e=Po.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=pu(e.namiCommands),this.platformID=e.appPlatformID}},{key:"reset",value:function(){this.baseURL=void 0,this.platformID=void 0}},{key:"login",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:if(e){i.n=1;break}throw new Co;case 1:return t=`device/${this.deviceID}/login/`,n={external_id:e},i.n=2,a(this.requestBodyAPI(t,n,"PUT"));case 2:return i.a(2,i.v)}},null,this,null,Promise)}},{key:"logout",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return e=`device/${this.deviceID}/logout/`,t.n=1,a(this.requestBodyAPI(e,{},"PUT"));case 1:return t.a(2,t.v)}},null,this,null,Promise)}},{key:"startSession",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/session/`,i.n=1,a(this.requestBodyAPI(t,{start_time:e,app_env:"production"}));case 1:n=i.v,Po.setSessionCounter(),n.id&&Po.setSessionId(n.id);case 2:return i.a(2)}},null,this,null,Promise)}},{key:"postImpression",value:function(t){var n,i,r,o,s,u;return k(function(l){for(;;)switch(l.n){case 0:return o=`device/${this.deviceID}/impression/`,s=null!==(n=t.id)&&void 0!==n?n:Yu(),u=m({},t,{id:s,impression_date:null!==(i=t.impression_date)&&void 0!==i?i:(new Date).toISOString()}),Po.setLastImpressionId(s),null===(r=e.impressionListener)||void 0===r||r.call(e,s,t.call_to_action),l.n=1,a(this.requestBodyAPI(o,u,"POST",!0));case 1:return l.a(2)}},null,this,null,Promise)}},{key:"patchImpressionCompletion",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`device/${this.deviceID}/impression/${e}/`,r.n=1,a(this.requestBodyAPI(i,{completion_result:t,completion_result_date:n},"PATCH",!0));case 1:return r.a(2)}},null,this,null,Promise)}},{key:"postConversion",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/transaction/`,n.n=1,a(this.requestBodyAPI(t,e,"POST",!0));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"purchaseValidation",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/purchase_event/`,n.n=1,a(this.requestBodyAPI(t,e,"PUT"));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"fetchAPI",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`${this.baseURL}/${this.platformID}/`+e,r.n=1,a(Iu(i,void 0,t,n));case 1:return r.a(2,r.v)}},null,this,null,Promise)}},{key:"requestBodyAPI",value:function(e,t,n="POST",i=!1,r,o){var s,u;return k(function(l){for(;;)switch(l.n){case 0:return s=`${this.baseURL}/${this.platformID}/`+e,u={method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:i},l.n=1,a(Iu(s,u,r,o));case 1:return l.a(2,l.v)}},null,this,null,Promise)}}],[{key:"configure",value:function(e){this.instance.configure(e)}},{key:"reset",value:function(){this.instance.reset()}}])}();function al(e){return null!=(null==e?void 0:e.flow)}il.instance=new il,ke([tl],il.prototype,"login",null),ke([tl],il.prototype,"logout",null),ke([tl],il.prototype,"startSession",null),ke([tl],il.prototype,"postImpression",null),ke([tl],il.prototype,"patchImpressionCompletion",null),ke([tl],il.prototype,"postConversion",null),ke([tl],il.prototype,"purchaseValidation",null),ke([el],il.prototype,"fetchAPI",null),ke([el],il.prototype,"requestBodyAPI",null),e.NamiCampaignRuleType=void 0,(nl=e.NamiCampaignRuleType||(e.NamiCampaignRuleType={})).DEFAULT="default",nl.JOURNEY="journey",nl.LABEL="label",nl.UNKNOWN="unknown",nl.URL="url";var rl=()=>{var e;return null!==(e=Po.getPaywalls(Mt))&&void 0!==e?e:[]},ol=()=>{var e;return null!==(e=Po.getPaywalls(mt))&&void 0!==e?e:[]},sl=()=>mo(zi([...ol(),...rl()]),"id"),ul=e=>sl().find(t=>t.id===e),ll=e=>{var t=sl(),n=new Set(t.map(e=>e.id));return e.every(e=>n.has(e))};function dl(e){return(t={})=>{var n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function cl(e){return(t,n)=>{var i;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,r=null!=n&&n.width?String(n.width):a;i=e.formattingValues[r]||e.formattingValues[a]}else{var o=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function hl(e){return(t,n={})=>{var i=n.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],r=t.match(a);if(!r)return null;var o,s=r[0],u=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(u,e=>e.test(s)):function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(u,e=>e.test(s));return o=e.valueCallback?e.valueCallback(l):l,{value:o=n.valueCallback?n.valueCallback(o):o,rest:t.slice(s.length)}}}function ml(e){var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}var fl={};function vl(){return fl}function pl(e,t){var n,i,a,r,o,s,u=vl(),l=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.weekStartsOn)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.weekStartsOn)&&void 0!==a?a:u.weekStartsOn)&&void 0!==i?i:null===(s=u.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==n?n:0,d=ml(e),c=d.getDay(),h=(c<l?7:0)+c-l;return d.setDate(d.getDate()-h),d.setHours(0,0,0,0),d}var gl,yl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},bl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wl={ordinalNumber:(e,t)=>{var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:cl({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:cl({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:cl({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:cl({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:cl({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},kl={ordinalNumber:(gl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{var n=e.match(gl.matchPattern);if(!n)return null;var i=n[0],a=e.match(gl.parsePattern);if(!a)return null;var r=gl.valueCallback?gl.valueCallback(a[0]):a[0];return{value:r=t.valueCallback?t.valueCallback(r):r,rest:e.slice(i.length)}}),era:hl({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:hl({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:hl({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:hl({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:hl({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},Sl={code:"en-US",formatDistance:(e,t,n)=>{var i,a=yl[e];return i="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:{date:dl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:dl({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:dl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:(e,t,n,i)=>bl[e],localize:wl,match:kl,options:{weekStartsOn:0,firstWeekContainsDate:1}},El=6048e5;function Pl(e){var t=ml(e);return t.setHours(0,0,0,0),t}function _l(e){var t=ml(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Tl(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Ml(e){var t,n,i,a,r,o,s=ml(e),u=(t=s,n=function(e){var t=ml(e),n=Tl(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(s),i=Pl(t),a=Pl(n),r=+i-_l(i),o=+a-_l(a),Math.round((r-o)/864e5));return u+1}function Al(e){return pl(e,{weekStartsOn:1})}function Dl(e){var t=ml(e),n=t.getFullYear(),i=Tl(e,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);var a=Al(i),r=Tl(e,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);var o=Al(r);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function xl(e){var t=ml(e),n=+Al(t)-+function(e){var t=Dl(e),n=Tl(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Al(n)}(t);return Math.round(n/El)+1}function Cl(e,t){var n,i,a,r,o,s,u=ml(e),l=u.getFullYear(),d=vl(),c=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.firstWeekContainsDate)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==a?a:d.firstWeekContainsDate)&&void 0!==i?i:null===(s=d.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1,h=Tl(e,0);h.setFullYear(l+1,0,c),h.setHours(0,0,0,0);var m=pl(h,t),f=Tl(e,0);f.setFullYear(l,0,c),f.setHours(0,0,0,0);var v=pl(f,t);return u.getTime()>=m.getTime()?l+1:u.getTime()>=v.getTime()?l:l-1}function Il(e,t){var n=ml(e),i=+pl(n,t)-+function(e,t){var n,i,a,r,o,s,u=vl(),l=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.firstWeekContainsDate)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==a?a:u.firstWeekContainsDate)&&void 0!==i?i:null===(s=u.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1,d=Cl(e,t),c=Tl(e,0);return c.setFullYear(d,0,l),c.setHours(0,0,0,0),pl(c,t)}(n,t);return Math.round(i/El)+1}function Ll(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}var Fl={y(e,t){var n=e.getFullYear(),i=n>0?n:1-n;return Ll("yy"===t?i%100:i,t.length)},M(e,t){var n=e.getMonth();return"M"===t?String(n+1):Ll(n+1,2)},d:(e,t)=>Ll(e.getDate(),t.length),a(e,t){var n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Ll(e.getHours()%12||12,t.length),H:(e,t)=>Ll(e.getHours(),t.length),m:(e,t)=>Ll(e.getMinutes(),t.length),s:(e,t)=>Ll(e.getSeconds(),t.length),S(e,t){var n=t.length,i=e.getMilliseconds();return Ll(Math.trunc(i*Math.pow(10,n-3)),t.length)}},Rl="midnight",Ol="noon",$l="morning",Nl="afternoon",Wl="evening",jl="night",Bl={G:function(e,t,n){var i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var i=e.getFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return Fl.y(e,t)},Y:function(e,t,n,i){var a=Cl(e,i),r=a>0?a:1-a;return"YY"===t?Ll(r%100,2):"Yo"===t?n.ordinalNumber(r,{unit:"year"}):Ll(r,t.length)},R:function(e,t){return Ll(Dl(e),t.length)},u:function(e,t){return Ll(e.getFullYear(),t.length)},Q:function(e,t,n){var i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ll(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ll(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getMonth();switch(t){case"M":case"MM":return Fl.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Ll(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var a=Il(e,i);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):Ll(a,t.length)},I:function(e,t,n){var i=xl(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):Ll(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Fl.d(e,t)},D:function(e,t,n){var i=Ml(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):Ll(i,t.length)},E:function(e,t,n){var i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Ll(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Ll(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getDay(),a=0===i?7:i;switch(t){case"i":return String(a);case"ii":return Ll(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i,a=e.getHours();switch(i=12===a?Ol:0===a?Rl:a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i,a=e.getHours();switch(i=a>=17?Wl:a>=12?Nl:a>=4?$l:jl,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var i=e.getHours()%12;return 0===i&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Fl.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Fl.H(e,t)},K:function(e,t,n){var i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):Ll(i,t.length)},k:function(e,t,n){var i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):Ll(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fl.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Fl.s(e,t)},S:function(e,t){return Fl.S(e,t)},X:function(e,t,n){var i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Ul(i);case"XXXX":case"XX":return Hl(i);default:return Hl(i,":")}},x:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"x":return Ul(i);case"xxxx":case"xx":return Hl(i);default:return Hl(i,":")}},O:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zl(i,":");default:return"GMT"+Hl(i,":")}},z:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zl(i,":");default:return"GMT"+Hl(i,":")}},t:function(e,t,n){return Ll(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return Ll(e.getTime(),t.length)}};function zl(e,t=""){var n=e>0?"-":"+",i=Math.abs(e),a=Math.trunc(i/60),r=i%60;return 0===r?n+String(a):n+String(a)+t+Ll(r,2)}function Ul(e,t){return e%60==0?(e>0?"-":"+")+Ll(Math.abs(e)/60,2):Hl(e,t)}function Hl(e,t=""){var n=e>0?"-":"+",i=Math.abs(e);return n+Ll(Math.trunc(i/60),2)+t+Ll(i%60,2)}var Gl=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Vl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Kl={p:Vl,P:(e,t)=>{var n,i=e.match(/(P+)(p+)?/)||[],a=i[1],r=i[2];if(!r)return Gl(e,t);switch(a){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Gl(a,t)).replace("{{time}}",Vl(r,t))}},Yl=/^D+$/,Xl=/^Y+$/,ql=["D","DD","YY","YYYY"];function Jl(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t,n=ml(e);return!isNaN(Number(n))}var Ql=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Zl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ed=/^'([^]*?)'?$/,td=/''/g,nd=/[a-zA-Z]/;function id(e,t,n){var i,a,r,o,s,u,l,d,c,h,m,f,v,p,g=vl(),y=null!==(i=null!==(a=null==n?void 0:n.locale)&&void 0!==a?a:g.locale)&&void 0!==i?i:Sl,b=null!==(r=null!==(o=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(l=n.locale)||void 0===l||null===(l=l.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==s?s:g.firstWeekContainsDate)&&void 0!==o?o:null===(d=g.locale)||void 0===d||null===(d=d.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==r?r:1,w=null!==(c=null!==(h=null!==(m=null!==(f=null==n?void 0:n.weekStartsOn)&&void 0!==f?f:null==n||null===(v=n.locale)||void 0===v||null===(v=v.options)||void 0===v?void 0:v.weekStartsOn)&&void 0!==m?m:g.weekStartsOn)&&void 0!==h?h:null===(p=g.locale)||void 0===p||null===(p=p.options)||void 0===p?void 0:p.weekStartsOn)&&void 0!==c?c:0,k=ml(e);if(!Jl(k))throw new RangeError("Invalid time value");var S=t.match(Zl).map(e=>{var t=e[0];return"p"===t||"P"===t?(0,Kl[t])(e,y.formatLong):e}).join("").match(Ql).map(e=>{if("''"===e)return{isToken:!1,value:"'"};var t=e[0];if("'"===t)return{isToken:!1,value:ad(e)};if(Bl[t])return{isToken:!0,value:e};if(t.match(nd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});y.localize.preprocessor&&(S=y.localize.preprocessor(k,S));var E={firstWeekContainsDate:b,weekStartsOn:w,locale:y};return S.map(i=>{if(!i.isToken)return i.value;var a=i.value;return(null!=n&&n.useAdditionalWeekYearTokens||!function(e){return Xl.test(e)}(a))&&(null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return Yl.test(e)}(a))||function(e,t,n){var i=function(e,t,n){var i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),ql.includes(e))throw new RangeError(i)}(a,t,String(e)),(0,Bl[a[0]])(k,a,y.localize,E)}).join("")}function ad(e){var t=e.match(ed);return t?t[1].replace(td,"'"):e}function rd(e,t,n){var i,a=Object.assign({},vl()),r=function(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,null!==(i=n.locale)&&void 0!==i?i:a.locale);return"formatToParts"in r?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value;return}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(r,t)}function od(e,t){var n=function(e){ud[e]||(ud[e]=dd?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}));return ud[e]}(t);return"formatToParts"in n?function(e,t){try{for(var n=e.formatToParts(t),i=[],a=0;a<n.length;a++){var r=sd[n[a].type];void 0!==r&&(i[r]=parseInt(n[a].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}(n,e)}var sd={year:0,month:1,day:2,hour:3,minute:4,second:5};var ud={},ld=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),dd="06/25/2014, 00:00:00"===ld||"06/25/2014 00:00:00"===ld;function cd(e,t,n,i,a,r,o){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,a,r,o),s}var hd=36e5,md={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function fd(e,t,n){if(!e)return 0;var i,a,r=md.timezoneZ.exec(e);if(r)return 0;if(r=md.timezoneHH.exec(e))return pd(i=parseInt(r[1],10))?-i*hd:NaN;if(r=md.timezoneHHMM.exec(e)){i=parseInt(r[2],10);var o=parseInt(r[3],10);return pd(i,o)?(a=Math.abs(i)*hd+6e4*o,"+"===r[1]?-a:a):NaN}if(function(e){if(gd[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),gd[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return cd(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),u=vd(s,e),l=n?u:function(e,t,n){var i=e.getTime(),a=i-t,r=vd(new Date(a),n);if(t===r)return t;a-=r-t;var o=vd(new Date(a),n);if(r===o)return r;return Math.max(r,o)}(t,u,e);return-l}return NaN}function vd(e,t){var n=od(e,t),i=cd(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),a=e.getTime(),r=a%1e3;return i-(a-=r>=0?r:1e3+r)}function pd(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var gd={};var yd={X:function(e,t,n){var i=bd(n.timeZone,e);if(0===i)return"Z";switch(t){case"X":return Sd(i);case"XXXX":case"XX":return kd(i);default:return kd(i,":")}},x:function(e,t,n){var i=bd(n.timeZone,e);switch(t){case"x":return Sd(i);case"xxxx":case"xx":return kd(i);default:return kd(i,":")}},O:function(e,t,n){var i=bd(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t=""){var n=e>0?"-":"+",i=Math.abs(e),a=Math.floor(i/60),r=i%60;if(0===r)return n+String(a);return n+String(a)+t+wd(r,2)}(i,":");default:return"GMT"+kd(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return rd("short",e,n);default:return rd("long",e,n)}}};function bd(e,t){var n,i=e?fd(e,t,!0)/6e4:null!==(n=null==t?void 0:t.getTimezoneOffset())&&void 0!==n?n:0;if(Number.isNaN(i))throw new RangeError("Invalid time zone specified: "+e);return i}function wd(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function kd(e,t=""){var n=e>0?"-":"+",i=Math.abs(e);return n+wd(Math.floor(i/60),2)+t+wd(Math.floor(i%60),2)}function Sd(e,t){return e%60==0?(e>0?"-":"+")+wd(Math.abs(e)/60,2):kd(e,t)}function Ed(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}var Pd=36e5,_d=6e4,Td={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function Md(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var i=function(e){var t,n={},i=Td.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=Td.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var a=Td.timeZone.exec(t);a?(n.time=t.replace(a[1],""),n.timeZone=a[1].trim()):n.time=t}return n}(e),a=function(e,t){if(e){var n=Td.YYY[t],i=Td.YYYYY[t],a=Td.YYYY.exec(e)||i.exec(e);if(a){var r=a[1];return{year:parseInt(r,10),restDateString:e.slice(r.length)}}if(a=Td.YY.exec(e)||n.exec(e)){var o=a[1];return{year:100*parseInt(o,10),restDateString:e.slice(o.length)}}}return{year:null}}(i.date,n),r=a.year,o=function(e,t){if(null===t)return null;var n,i,a;if(!e||!e.length)return(n=new Date(0)).setUTCFullYear(t),n;var r=Td.MM.exec(e);if(r)return n=new Date(0),Id(t,i=parseInt(r[1],10)-1)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(r=Td.DDD.exec(e)){n=new Date(0);var o=parseInt(r[1],10);return function(e,t){if(t<1)return!1;var n=Cd(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,o)?(n.setUTCFullYear(t,0,o),n):new Date(NaN)}if(r=Td.MMDD.exec(e)){n=new Date(0),i=parseInt(r[1],10)-1;var s=parseInt(r[2],10);return Id(t,i,s)?(n.setUTCFullYear(t,i,s),n):new Date(NaN)}if(r=Td.Www.exec(e))return Ld(a=parseInt(r[1],10)-1)?Ad(t,a):new Date(NaN);if(r=Td.WwwD.exec(e)){a=parseInt(r[1],10)-1;var u=parseInt(r[2],10)-1;return Ld(a,u)?Ad(t,a,u):new Date(NaN)}return null}(a.restDateString,r);if(null===o||isNaN(o.getTime()))return new Date(NaN);if(o){var s,u=o.getTime(),l=0;if(i.time&&(null===(l=function(e){var t,n,i=Td.HH.exec(e);if(i)return Fd(t=parseFloat(i[1].replace(",",".")))?t%24*Pd:NaN;if(i=Td.HHMM.exec(e))return Fd(t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")))?t%24*Pd+n*_d:NaN;if(i=Td.HHMMSS.exec(e)){t=parseInt(i[1],10),n=parseInt(i[2],10);var a=parseFloat(i[3].replace(",","."));return Fd(t,n,a)?t%24*Pd+n*_d+1e3*a:NaN}return null}(i.time))||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(s=fd(i.timeZone||t.timeZone,new Date(u+l)),isNaN(s))return new Date(NaN)}else s=Ed(new Date(u+l)),s=Ed(new Date(u+l+s));return new Date(u+l+s)}return new Date(NaN)}function Ad(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var a=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+a),i}var Dd=[31,28,31,30,31,30,31,31,30,31,30,31],xd=[31,29,31,30,31,30,31,31,30,31,30,31];function Cd(e){return e%400==0||e%4==0&&e%100!=0}function Id(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=Cd(e);if(i&&n>xd[t])return!1;if(!i&&n>Dd[t])return!1}return!0}function Ld(e,t){return!(e<0||e>52)&&(null==t||!(t<0||t>6))}function Fd(e,t,n){return!(e<0||e>=25)&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var Rd=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Od(e,t,n,i){return function(e,t,n={}){var i=(t=String(t)).match(Rd);if(i){var a=Md(n.originalDate||e,n);t=i.reduce(function(e,t){if("'"===t[0])return e;var i=e.indexOf(t),r="'"===e[i-1],o=e.replace(t,"'"+yd[t[0]](a,t,n)+"'");return r?o.substring(0,i-1)+o.substring(i+1):o},t)}return id(e,t,n)}(function(e,t,n){var i=fd(t,e=Md(e,n),!0),a=new Date(e.getTime()-i),r=new Date(0);return r.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),r.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),r}(e,t,{timeZone:(i=m({},i,{timeZone:t,originalDate:e})).timeZone}),n,i)}var $d=e=>{try{return!isNaN(new Date(e).getTime())}catch(e){return!1}},Nd=(e,t,n=new Date)=>{var i=n.getTime(),a=!e||!$d(e)||new Date(e).getTime()<i,r=!t||!$d(t)||new Date(t).getTime()>i;return a&&r},Wd=["app_install","session_start"],jd=["flow_completed","user_context_set"],Bd=["high","medium","low"],zd=(e,t)=>e.includes(t)?t:null,Ud=e=>"number"==typeof e?e:null;function Hd(e){var t,n,i,a,r,o;if(!e)return null;var s="object"in e?null!==(t=e.object)&&void 0!==t?t:{}:e,u=s.goal,l=s.delivery;return{journey_id:"string"==typeof e.journey_id?e.journey_id:"",category:null!==(n=s.category)&&void 0!==n?n:null,priority:null!==(i=zd(Bd,s.priority))&&void 0!==i?i:"medium",trigger:{event_type:zd(Wd,null===(a=s.trigger)||void 0===a?void 0:a.event_type)},goal:u?{type:zd(jd,u.type),context_key:null!==(r=u.context_key)&&void 0!==r?r:null,timeout_days:Ud(u.timeout_days),re_eligibility_days:Ud(u.re_eligibility_days),re_entry_after_goal:!0===u.re_entry_after_goal}:null,delivery:{show_once:!0===(null==l?void 0:l.show_once),max_impressions_total:Ud(null==l?void 0:l.max_impressions_total),max_per_session:Ud(null==l?void 0:l.max_per_session),max_per_day:Ud(null==l?void 0:l.max_per_day),delay_seconds:null!==(o=Ud(null==l?void 0:l.delay_seconds))&&void 0!==o?o:0}}}function Gd(e){var t;return!(!e||!e.journey_id.trim())&&(!(!e.trigger.event_type||null===(t=e.goal)||void 0===t||!t.type)&&("user_context_set"!==e.goal.type||!!e.goal.context_key))}var Vd=t=>t.type===e.NamiCampaignRuleType.JOURNEY,Kd=e=>Vd(e)?Hd(e.journey):null;function Yd(e){return!Vd(e)||null!=e.flow&&Gd(Hd(e.journey))}var Xd,qd=e=>{try{var t=new URL(e);return("http:"===t.protocol||"https:"===t.protocol)&&!!t.hostname}catch(e){return!1}},Jd=e=>{try{var t=new URL(e),n=t.origin+t.pathname,i=new Set;return t.searchParams.forEach((e,t)=>{i.add(`${t}=${e}`)}),{basePath:n,params:i}}catch(e){return}},Qd=(e,t,n)=>{if(!e)return[];var i=e.filter(e=>!Array.isArray(e.segments)).length;return i>0&&Bi.warn(`Skipping ${i} of ${e.length} campaign rules with no segments array`),e.flatMap(e=>{if(!Array.isArray(e.segments))return[];var i;if(i="string"==typeof n?e.segments.filter(e=>e.form_factors.some(e=>e.form_factor===n)):e.segments,0===i.length)return[];var a=((e,t)=>{for(var n,i=[...e].sort((e,t)=>e.split-t.split),a=h(i);!(n=a()).done;){var r=n.value;if(t<=r.split)return r}return i[i.length-1]})(i,t),r={form_factors:a.form_factors,paywall:a.paywall,paywall_url:a.paywall_url,page_urls:a.page_urls,flow:a.flow,segment:a.segment,split:a.split,conversion_event_type:a.conversion_event_type,conversion_event_url:a.conversion_event_url,rule:e.rule,name:e.name,type:e.type,value:e.value,external_segment:e.external_segment,not_before:e.not_before,expires_at:e.expires_at,journey:e.journey};return Yd(r)?r:(Bi.debug(`Skipping unsupported journey rule ${e.rule}`),[])})},Zd=e=>{var t=Ku();return zi(e).filter(e=>{var n;return null===(n=e.form_factors)||void 0===n?void 0:n.some(e=>e.form_factor===t)}).filter(e=>Nd(e.not_before,e.expires_at))},ec=(e,t)=>{var n=new Set;return e.filter(e=>{var i=t(e);return!n.has(i)&&(n.add(i),!0)})},tc=()=>{var e,t;return[...null!==(e=Po.getCampaignRules(ct))&&void 0!==e?e:[],...null!==(t=Po.getCampaignRules(_t))&&void 0!==t?t:[]]},nc=()=>ec(Zd(tc()).filter(e=>!Vd(e)),e=>{var t,n;return`${null!==(t=e.type)&&void 0!==t?t:""}::${null!==(n=e.value)&&void 0!==n?n:""}`}),ic=()=>ec(Zd(tc()).filter(Vd),e=>e.rule),ac=e=>{var t;return Zd(null!==(t=Po.getCampaignRules(e))&&void 0!==t?t:[]).filter(e=>!Vd(e))},rc=()=>ac(_t),oc=()=>ac(ct),sc=(t,n,i,a)=>{var r=(()=>{if(!a)return t().find(t=>t.type==e.NamiCampaignRuleType.DEFAULT);if(a===e.NamiCampaignRuleType.URL){var n=t().filter(t=>t.type==e.NamiCampaignRuleType.URL);return((e,t)=>{var n,i,a,r=Jd(e);if(r){for(var o,s,u,l=h(t);!(u=l()).done;){var d=u.value,c=d.value;if(c){var m=Jd(c);if(m&&m.basePath===r.basePath){var f=m.params.size;if(0!==f){for(var v,p=0,g=h(m.params);!(v=g()).done;){var y=v.value;r.params.has(y)&&p++}p===f?(!o||f>o.totalParams)&&(o={campaign:d,totalParams:f}):o||(!s||p>s.score||p===s.score&&f>s.totalParams)&&(s={campaign:d,score:p,totalParams:f})}else o||s||(s={campaign:d,score:0,totalParams:0})}}}return null!==(n=null===(i=o)||void 0===i?void 0:i.campaign)&&void 0!==n?n:null===(a=s)||void 0===a?void 0:a.campaign}})(i,n)}return t().find(e=>e.type==a&&e.value==i)})();if(!r)return{};var o=n().find(e=>(null==r?void 0:r.paywall)===e.id);return{campaign:r,paywall:o}},uc=(e,t)=>{var n=sc(oc,ol,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=sc(rc,rl,e,t);return i.campaign&&i.paywall?{campaign:i.campaign,paywall:i.paywall}:n.campaign||n.paywall?{campaign:n.campaign,paywall:n.paywall}:{campaign:i.campaign,paywall:i.paywall}},lc="object"==typeof Reflect?Reflect:null,dc=lc&&"function"==typeof lc.apply?lc.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Xd=lc&&"function"==typeof lc.ownKeys?lc.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var cc=Number.isNaN||function(e){return e!=e};function hc(){hc.init.call(this)}hc.EventEmitter=hc,hc.prototype._events=void 0,hc.prototype._eventsCount=0,hc.prototype._maxListeners=void 0;var mc=10;function fc(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function vc(e){return void 0===e._maxListeners?hc.defaultMaxListeners:e._maxListeners}function pc(e,t,n,i){var a,r,o,s;if(fc(n),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),r=e._events),o=r[t]),void 0===o)o=r[t]=n,++e._eventsCount;else if("function"==typeof o?o=r[t]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(a=vc(e))>0&&o.length>a&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function gc(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function yc(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=gc.bind(i);return a.listener=n,i.wrapFn=a,a}function bc(e,t,n){var i=e._events;if(void 0===i)return[];var a=i[t];return void 0===a?[]:"function"==typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(a):kc(a,a.length)}function wc(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function kc(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(hc,"defaultMaxListeners",{enumerable:!0,get:function(){return mc},set:function(e){if("number"!=typeof e||e<0||cc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");mc=e}}),hc.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},hc.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||cc(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},hc.prototype.getMaxListeners=function(){return vc(this)},hc.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var r;if(t.length>0&&(r=t[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var s=a[e];if(void 0===s)return!1;if("function"==typeof s)dc(s,this,t);else for(var u=s.length,l=kc(s,u),d=0;d<u;++d)dc(l[d],this,t);return!0},hc.prototype.addListener=function(e,t){return pc(this,e,t,!1)},hc.prototype.on=hc.prototype.addListener,hc.prototype.prependListener=function(e,t){return pc(this,e,t,!0)},hc.prototype.once=function(e,t){return fc(t),this.on(e,yc(this,e,t)),this},hc.prototype.prependOnceListener=function(e,t){return fc(t),this.prependListener(e,yc(this,e,t)),this},hc.prototype.removeListener=function(e,t){var n,i,a,r,o;if(fc(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(a=-1,r=n.length-1;r>=0;r--)if(n[r]===t||n[r].listener===t){o=n[r].listener,a=r;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,a),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},hc.prototype.off=hc.prototype.removeListener,hc.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var a,r=Object.keys(n);for(i=0;i<r.length;++i)"removeListener"!==(a=r[i])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},hc.prototype.listeners=function(e){return bc(this,e,!0)},hc.prototype.rawListeners=function(e){return bc(this,e,!1)},hc.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):wc.call(e,t)},hc.prototype.listenerCount=wc,hc.prototype.eventNames=function(){return this._eventsCount>0?Xd(this._events):[]};var Sc=function(){function e(){o(this,e),this.emitter=new hc}return c(e,[{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"emit",value:function(e,...t){this.emitter.emit(e,...t)}},{key:"addListener",value:function(e,t){this.emitter.addListener(e,t)}},{key:"removeListener",value:function(e,t){this.emitter.removeListener(e,t)}},{key:"removeAllListeners",value:function(e){e?this.emitter.removeAllListeners(e):this.emitter.removeAllListeners()}},{key:"listeners",value:function(e){return this.emitter.listeners(e)}},{key:"listenerCount",value:function(e){return this.emitter.listenerCount(e)}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}])}(),Ec=function(){return c(function e(){o(this,e),this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1,this.isUsableOnDevice=e=>{var t;return!(!e.paywall&&!e.flow)&&(!(null===(t=e.form_factors)||void 0===t||!t.some(e=>e.form_factor===this.currentFormFactor))&&(!!Yd(e)||(Bi.debug(`Skipping unsupported journey rule ${e.rule}`),!1)))},this.currentFormFactor=Ku()},[{key:"configure",value:function(e,t,n=[]){this.currentFormFactor=e,this.splitPosition=t,this.disableCampaignUpdates=n.includes("disableCampaignUpdates"),this.useLegacyPaywallFetch=n.includes("useLegacyPaywallFetch")}},{key:"reset",value:function(){this.currentFormFactor=Ku(),this.splitPosition=void 0,this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1}},{key:"fetchCampaignRules",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(i=Po.getDevice(),!this.disableCampaignUpdates){o.n=1;break}return Bi.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,[]);case 1:if(null!=i&&i.id){o.n=3;break}return o.n=2,a(this.getAnonymousCampaigns());case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.getCampaigns(i.id));case 4:r=o.v;case 5:return r=null===(t=r)||void 0===t?void 0:t.filter(this.isUsableOnDevice),r=null===(n=r)||void 0===n?void 0:n.filter(t=>{if(t.paywall){var n=e.find(e=>e.id==t.paywall);if(n)return t}else if(t.flow)return t}),Po.setCampaignRules(ct,r),Po.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),o.a(2,r)}},null,this,null,Promise)}},{key:"fetchCampaignRulesRaw",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(!this.disableCampaignUpdates){o.n=1;break}return Bi.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,{campaigns:[],fromNetwork:!1});case 1:if(null==(t=Po.getDevice())||!t.id){o.n=3;break}return o.n=2,a(this.fetchCampaigns(t.id));case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.fetchAnonymousCampaigns());case 4:r=o.v;case 5:return i=null===(e=(n=r).campaigns)||void 0===e?void 0:e.filter(this.isUsableOnDevice),o.a(2,{campaigns:i,fromNetwork:n.fromNetwork})}},null,this,null,Promise)}},{key:"finalizeCampaignRules",value:function(e,t){var n=new Set([...t.map(e=>e.id),...rl().map(e=>e.id)]),i=null==e?void 0:e.filter(e=>{return e.paywall?t.find(t=>t.id==e.paywall):!!e.flow&&(!!e.flow.object&&(null!==(i=e.flow.object.screens)&&void 0!==i?i:[]).every(e=>n.has(e)));var i});return Po.setCampaignRules(ct,i),Po.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),i}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=Sc.getInstance().listeners(Ei),t=nc();e.forEach(e=>e(t))}},{key:"getAnonymousCampaigns",value:function(e=Le){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchAnonymousCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"getCampaigns",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"fetchAnonymousCampaigns",value:function(e=Le){var t,n,i,r,o;return k(function(s){for(;;)switch(s.p=s.n){case 0:return t=`campaign_rules/?sdk_version=${e}`,s.p=1,s.n=2,a(il.instance.fetchAPI(t));case 2:return i=s.v,s.a(2,{campaigns:Qd(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor),fromNetwork:!0});case 3:if(s.p=3,o=s.v,r=this.fallbackData()){s.n=4;break}throw Bi.error(zo(o.status,t)),o;case 4:return s.a(2,{campaigns:r.results,fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fetchCampaigns",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return t=`device/${e}/campaign_rules/`,o.p=1,o.n=2,a(il.instance.fetchAPI(t));case 2:return n=o.v,o.a(2,{campaigns:(null==n?void 0:n.results)||[],fromNetwork:!0});case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Bi.error(zo(r.status,t)),r;case 4:return o.a(2,{campaigns:i.results||[],fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Po.getCampaignRules(ct)||Po.getCampaignRules(_t);return e?{count:e.length,results:e}:null}}],[{key:"extractPaywallUrls",value:function(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a,r=t.value;r.paywall_url&&n.push(r.paywall_url),r.page_urls&&n.push(...Object.values(r.page_urls)),null!==(a=r.flow)&&void 0!==a&&a.page_urls&&n.push(...Object.values(r.flow.page_urls))}return n}},{key:"hasPaywallUrls",value:function(e){return e.some(e=>{var t;return e.paywall_url||e.page_urls||(null===(t=e.flow)||void 0===t?void 0:t.page_urls)})}}])}();function Pc(e,t){return $r(e,t)}Ec.instance=new Ec;var _c=function(){return c(function e(){o(this,e)},[{key:"createOrUpdateDevice",value:function(e,t,n){var i=Po.getDevice();if(null==i||!i.id){var a,r=m({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:Yu()});return{id:r.id,device:this.createDevice(r,n)}}return this.isEqualDevices(i,e)?{id:i.id,device:Promise.resolve(i)}:{id:i.id,device:this.boundedUpdate(i.id,e)}}},{key:"boundedUpdate",value:function(e,t){var n,i=this.updateDevice(e,t).catch(e=>{var t;return Bi.warn(`Device update failed: ${null!==(t=null==e?void 0:e.message)&&void 0!==t?t:e}`),null}),a=new Promise(e=>{n=setTimeout(()=>e(null),Zn)});return Promise.race([i,a]).then(e=>(clearTimeout(n),e))}},{key:"createDevice",value:function(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,a(this.requestAPIData("device/",e,void 0,void 0,0));case 1:if(!(n=r.v)){r.n=2;break}Po.setDevice(n),r.n=3;break;case 2:return Bi.info("Device creation returned null, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),r.a(2,null);case 3:return r.a(2,n);case 4:if(r.p=4,i=r.v,console.error("Error creating device:",i),!(i instanceof _o)){r.n=5;break}return Bi.info("Retry limit exceeded, switching to anon mode for this session"),null==t||t.setInMemoryAnonymousMode(!0),r.a(2,null);case 5:throw i;case 6:return r.a(2)}},null,this,[[0,4]],Promise)}},{key:"updateDevice",value:function(e,t){var n;return k(function(i){for(;;)switch(i.n){case 0:return i.n=1,a(this.requestAPIData(`device/${e}/`,t,"PUT"));case 1:return(n=i.v)&&Po.setDevice(n),i.a(2,n)}},null,this,null,Promise)}},{key:"updateDeviceField",value:function(e,t){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(n={[e]:t},null!=(i=Po.getDevice())&&i.id){o.n=1;break}throw new xo;case 1:return o.n=2,a(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(r=o.v)&&Po.setDevice(r),o.a(2,r)}},null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=Zn,r){var o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:return u.p=0,u.n=1,a(il.instance.requestBodyAPI(e,t,n,!0,i,r));case 1:o=u.v,u.n=5;break;case 2:if(u.p=2,!((s=u.v)instanceof Do)){u.n=3;break}throw s;case 3:if(!("device/"===e&&s instanceof _o)){u.n=4;break}throw s;case 4:if(o=Po.getDevice()){u.n=5;break}return Bi.error(zo(s.status,e)),u.a(2,null);case 5:return u.a(2,o)}},null,null,[[0,2]],Promise)}},{key:"isEqualDevices",value:function(e,t){var n=m({},e,t),i=Object.keys(e).reduce((e,t)=>(e[t]=n[t],e),{});return Pc(i,e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=Po.getAnonymousUUID();return e||(e=Yu(),Po.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=Po.getAnonymousUUID();return e?(Po.clearAnonymousUUID(),e):null}}])}();_c.instance=new _c;var Tc=function(){return c(function e(){o(this,e)},[{key:"fetchProducts",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(!gu(Pe.THIRD_PARTY_TRANSACTIONS)){r.n=1;break}return r.a(2,[]);case 1:return r.p=1,r.n=2,a(il.instance.fetchAPI("products/"));case 2:n=r.v,r.n=4;break;case 3:if(r.p=3,i=r.v,n=this.fallbackData()){r.n=4;break}throw Bi.error(zo(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&Po.setProducts(gt,n.results),r.a(2,(null===(t=n)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=Po.getProducts(gt)||Po.getProducts(Dt);return e?{count:e.length,results:e}:null}}])}();Tc.instance=new Tc;var Mc=3,Ac=200,Dc=2e3,xc=5e3,Cc=2e4,Ic=new Set([408,425,429]),Lc=new Set(["ECONNRESET","ECONNREFUSED","ENOTFOUND","ETIMEDOUT"]),Fc=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[`CDN fetch failed with non-retryable status ${e} for ${n}`])).name="NonRetryableHttpError",i.status=e,i.url=n,i}return p(t,e),c(t)}(M(Error)),Rc=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t,[`CDN fetch exhausted ${n} attempts for ${e}${void 0!==i?` (last status ${i})`:""}`])).name="RetryExhaustedError",a.url=e,a.attempts=n,a.lastStatus=i,a}return p(t,e),c(t)}(M(Error));function Oc(e,t){if("number"==typeof t)return Ic.has(t)||t>=500;if(e&&"object"==typeof e){var n=e;if("AbortError"===n.name)return!0;if(n.code&&Lc.has(n.code))return!0;if(e instanceof TypeError)return!0}return!1}function $c(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return n=new AbortController,i=setTimeout(()=>n.abort(),t),r.p=1,r.n=2,a(xu(e,{method:"GET"},"cdn",()=>fetch(e,{signal:n.signal})));case 2:return r.a(2,r.v);case 3:return r.p=3,clearTimeout(i),r.f(3);case 4:return r.a(2)}},null,null,[[1,,3,4]],Promise)}var Nc=e=>new Promise(t=>setTimeout(t,e));function Wc(e,t={}){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return o.n=1,a(jc(e,t));case 1:return n=o.v,i=n.data,r=n.retryCount,o.a(2,{data:JSON.parse(i),retryCount:r})}},null,null,null,Promise)}function jc(e,t={}){var n,i,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,S,E,P,_,T,M,A,D,x,C,I,L,F;return k(function(k){for(;;)switch(k.p=k.n){case 0:d=null!==(n=t.maxAttempts)&&void 0!==n?n:Mc,c=null!==(i=t.baseDelayMs)&&void 0!==i?i:Ac,h=null!==(r=t.maxDelayMs)&&void 0!==r?r:Dc,m=null!==(o=t.budgetMs)&&void 0!==o?o:Cc,f=null!==(s=t.timeoutMs)&&void 0!==s?s:xc,v=null!==(u=t.randomFn)&&void 0!==u?u:Math.random,p=null!==(l=t.sleepFn)&&void 0!==l?l:Nc,g=ku(),y=Su(),b=Date.now(),w=0;case 1:if(!(w<d)){k.n=16;break}if(!(w>0)){k.n=4;break}if(!((P=Date.now()-b)>=m)){k.n=2;break}return k.a(3,16);case 2:return _=Math.min(c*Math.pow(2,w-1),h),T=_*(v()-.5),M=Math.max(0,m-P),A=Math.min(Math.max(0,_+T),M),k.n=3,a(p(A));case 3:if(!(Date.now()-b>=m)){k.n=4;break}return k.a(3,16);case 4:return k.p=4,(g||y)&&Bi.debug(`[HTTP] GET ${e} (cdn attempt ${w+1}/${d})`),k.n=5,a($c(e,f));case 5:if((D=k.v).ok){k.n=9;break}if(!y){k.n=7;break}return k.n=6,a(D.clone().text());case 6:x=k.v,Bi.debug(`[HTTP] Response ${D.status}: ${x}`);case 7:if(S=D.status,!Oc(void 0,D.status)){k.n=8;break}return w++,k.a(3,1);case 8:throw new Fc(D.status,e);case 9:if(!y){k.n=11;break}return k.n=10,a(D.clone().text());case 10:C=k.v,Bi.debug(`[HTTP] Response ${D.status}: ${C}`);case 11:return k.n=12,a(D.text());case 12:return I=k.v,L=w,k.a(2,{data:I,retryCount:L});case 13:if(k.p=13,!((F=k.v)instanceof Fc)){k.n=14;break}throw F;case 14:if(!Oc(F)){k.n=15;break}return E=F,w++,k.a(3,1);case 15:throw F;case 16:if(void 0!==S||void 0===E){k.n=17;break}throw E;case 17:throw new Rc(e,w,S);case 18:return k.a(2)}},null,null,[[4,13]],Promise)}function Bc(e){var t=e.split("#")[0].split("?")[1];if(t)for(var n,i=h(t.split("&"));!(n=i()).done;){var a=n.value,r=a.indexOf("=");if("content_hash"===(-1===r?a:a.slice(0,r)))return(-1===r?"":a.slice(r+1))||void 0}}function zc(e){var t=e.split(/[?#]/)[0],n=/\/paywall\/([^/]+)/.exec(t);return n?n[1]:void 0}var Uc=function(){return c(function e(t=wo){o(this,e),this.bodyCache=t},[{key:"fetchPaywalls",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(null!=(e=Po.getDevice())&&e.id){i.n=2;break}return i.n=1,a(this.getAnonymousPaywalls());case 1:t=i.v,i.n=4;break;case 2:return i.n=3,a(this.getPaywalls(e.id));case 3:t=i.v;case 4:if(!t){i.n=5;break}return(n=this.validatePaywalls(t)).length>0&&Po.setPaywalls(mt,n),i.a(2,n);case 5:return i.a(2,t)}},null,this,null,Promise)}},{key:"getAnonymousPaywalls",value:function(e=Le){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`paywalls/?sdk_version=${e}`,i=null,o.p=1,o.n=2,a(il.instance.fetchAPI(n));case 2:i=o.v,o.n=4;break;case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Bi.error(zo(r.status,n)),r;case 4:return o.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"getPaywalls",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`device/${e}/paywalls/`,o.p=1,o.n=2,a(il.instance.fetchAPI(n));case 2:i=o.v,o.n=4;break;case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw Bi.error(zo(r.status,n)),r;case 4:return o.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"resolvePaywallsByUrls",value:function(e){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return t=[...new Set(e)],n=yu(),this.bodyCache.evaluateTtl(n),s.n=1,a(Promise.all(t.map(e=>this.resolvePaywall(e,n))));case 1:return i=s.v,r={paywalls:[],urls:t.length,hashed:t.filter(e=>void 0!==Bc(e)).length,cacheHits:0,fetched:0,cacheAfterFetchFailure:0,failed:0,retryCount:0,renewableUrls:[]},o=new Map,i.forEach((e,n)=>{r.retryCount+=e.retryCount,e.paywall?(o.set(e.paywall,t[n]),"cacheHit"===e.paywall.fetchSource?(r.cacheHits+=1,Bc(t[n])&&r.renewableUrls.push(t[n])):"cacheAfterFetchFailure"===e.paywall.fetchSource?r.cacheAfterFetchFailure+=1:r.fetched+=1):r.failed+=1}),r.paywalls=this.validatePaywalls([...o.keys()]),r.paywalls.length>0&&Po.setApiPaywallsFromBodyCache(r.paywalls.map(e=>o.get(e))),s.a(2,r)}},null,this,null,Promise)}},{key:"renewCacheHits",value:function(e){this.bodyCache.renew(e.renewableUrls,yu())}},{key:"seedFromInitialConfig",value:function(e,t){var n=new Map(t.map(e=>[e.id,e]));this.bodyCache.evaluateTtl(yu());for(var i,a=0,r=0,o=h(new Set(function(e){for(var t,n=[],i=h(e);!(t=i()).done;)for(var a,r=h(null!==(o=t.value.segments)&&void 0!==o?o:[]);!(a=r()).done;){var o,s,u=a.value;u.paywall_url&&n.push(u.paywall_url),u.page_urls&&n.push(...Object.values(u.page_urls)),null!==(s=u.flow)&&void 0!==s&&s.page_urls&&n.push(...Object.values(u.flow.page_urls))}return n}(e)));!(i=o()).done;){var s=i.value,u=Bc(s),l=zc(s),d=l?n.get(l):void 0;u&&d&&(a+=1,this.bodyCache.seedIfAbsent(s,u,JSON.stringify(d))&&(r+=1))}Bi.info(`Paywall body cache seeded from initial config: seeded=${r}, candidates=${a}`)}},{key:"resolvePaywall",value:function(e,t){var n,i,r,o,s,u,l;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(!(n=Bc(e))){d.n=1;break}if(!(i=this.decodeCached(e,t))){d.n=1;break}return d.a(2,{paywall:Gc(i,"cacheHit",n),retryCount:0});case 1:return r=0,d.p=2,d.n=3,a(this.fetchPaywallText(e));case 3:if(o=d.v,r=o.retryCount,!(s=Hc(o.data))){d.n=4;break}return this.bodyCache.store(e,n,o.data),d.a(2,{paywall:Gc(s,"fetched",n),retryCount:r});case 4:Bi.error(`Paywall body from ${e} is not a decodable paywall`),d.n=6;break;case 5:d.p=5,l=d.v,Bi.error(`Failed to fetch individual paywall: ${l}`);case 6:if(!(u=this.decodeCached(e,t))){d.n=7;break}return Bi.warn(`Serving the cached body for ${e} after fetch failure (within campaign_cache_ttl)`),d.a(2,{paywall:Gc(u,"cacheAfterFetchFailure",n),retryCount:r});case 7:return d.a(2,{retryCount:r})}},null,this,[[2,5]],Promise)}},{key:"decodeCached",value:function(e,t){var n=this.bodyCache.validEntry(e,t);if(n){var i=Hc(n.body);return i||(Bi.warn(`Deleting an undecodable cached paywall body for ${e}`),this.bodyCache.remove(e)),i}}},{key:"fetchPaywallText",value:function(e){var t;return null!==(t=Po.getNamiConfig())&&void 0!==t&&null!==(t=t.namiCommands)&&void 0!==t&&t.includes($n)?(Bi.warn(`${$n}: failing the fetch for ${e} before the network`),Promise.reject(new Rc(e,0))):jc(e)}},{key:"validatePaywalls",value:function(e){return e.filter(e=>{var t,n=null===(t=e.template)||void 0===t?void 0:t.pages;return!(!Array.isArray(n)||0===n.length)||(Bi.warn(`Dropping paywall "${e.id}" from cache: template.pages is missing or empty`),!1)})}},{key:"fallbackData",value:function(){var e=Po.getPaywalls(mt)||Po.getPaywalls(Mt);return e?{count:e.length,results:e}:null}}])}();function Hc(e){try{var t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:void 0}catch(e){return}}function Gc(e,t,n){return m({},e,{fetchSource:t},n?{contentHash:n}:{})}Uc.instance=new Uc;var Vc=function(){return c(function e(){o(this,e)},[{key:"fetchConfig",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(null===(e=Po.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e||!e.includes(Ln)){o.n=1;break}throw new _o(vi,Ln);case 1:return i=null===(t=Po.getNamiConfig())||void 0===t?void 0:t.appPlatformID,o.n=2,a(il.instance.fetchAPI("config/",ii,0));case 2:return r=o.v,(null===(n=Po.getNamiConfig())||void 0===n?void 0:n.appPlatformID)===i?Po.setAppConfig(lt,r):Bi.debug("Discarding an app config response for a platform that is no longer configured"),o.a(2,r)}},null,null,null,Promise)}},{key:"fetchConfigForStartup",value:function(e){var t,n,i,r,o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:if(!e){u.n=1;break}return u.a(2,this.startupOnInitialConfig());case 1:t=ti,i=1;case 2:if(!(i<=t)){u.n=7;break}return i>1&&Bi.debug(`Retrying app config fetch (attempt ${i} of ${t})`),u.p=3,o=Kc,u.n=4,a(this.fetchConfig());case 4:return u.a(2,o(u.v));case 5:u.p=5,s=u.v,n=s;case 6:i++,u.n=2;break;case 7:if(!(r=Po.getAppConfig(lt))){u.n=9;break}if(Yc(r)){u.n=8;break}return u.a(2,{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"});case 8:return Bi.info(`App config fetch failed after ${t} attempts - continuing on the cached config`),u.a(2,{usable:!0});case 9:return u.a(2,{usable:!1,reason:`app config fetch failed after ${t} attempts (${Xc(n)}) and no initial or cached config is available`})}},null,this,[[3,5]],Promise)}},{key:"startupOnInitialConfig",value:function(){var e=Po.getAppConfig(lt);return this.fetchConfig().then(e=>{Yc(e)||Bi.warn("App config does not grant the 'sdk' capability - it takes effect from the next launch")},e=>{Bi.info(`App config fetch failed (${Xc(e)}). Initial config is available. Skipping retry.`)}),e&&!Yc(e)?{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"}:{usable:!0}}}])}();function Kc(e){return Yc(e)?{usable:!0}:{usable:!1,reason:"app config does not grant the 'sdk' capability"}}function Yc(e){var t,n;return null!==(t=null===(n=e.capabilities)||void 0===n?void 0:n.includes(Pe.SDK))&&void 0!==t&&t}function Xc(e){var t=null==e?void 0:e.status;return"number"==typeof t?`HTTP ${t}`:e instanceof Error?e.message:String(e)}Vc.instance=new Vc;var qc=null;function Jc(){qc&&qc.setInMemoryAnonymousMode(!1)}function Qc(){return!!Po.getAnonymousMode()||!!qc&&qc.isInMemoryAnonymousMode()}var Zc=function(){return c(function e(){o(this,e)},[{key:"startSession",value:function(){var e;return k(function(t){for(;;)switch(t.p=t.n){case 0:if(!Qc()){t.n=1;break}return Bi.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,a(il.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,Bi.error("error on start session: ",e);case 4:return t.a(2)}},null,null,[[1,3]],Promise)}}])}();Zc.instance=new Zc;var eh=function(){return c(function e(){o(this,e)},null,[{key:"allPurchases",value:function(){return[]}}])}();eh.instance=new eh;var th={en:{nami_day:"day",nami_day_plural:"days",nami_week:"week",nami_week_plural:"weeks",nami_month:"month",nami_month_plural:"months",nami_year:"year",nami_year_plural:"years",nami_day_abbrev:"day",nami_day_abbrev_plural:"days",nami_week_abbrev:"wk",nami_week_abbrev_plural:"wks",nami_month_abbrev:"mo",nami_month_abbrev_plural:"mos",nami_year_abbrev:"yr",nami_year_abbrev_plural:"yrs",nami_daily:"daily",nami_weekly:"weekly",nami_biweekly:"bi-weekly",nami_monthly:"monthly",nami_bimonthly:"bi-monthly",nami_quarterly:"quarterly",nami_biannually:"bi-annually",nami_yearly:"yearly"},af:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dae",nami_week_abbrev:"week",nami_week_abbrev_plural:"weke",nami_month_abbrev:"ma",nami_month_abbrev_plural:"maande",nami_year_abbrev:"jr",nami_year_abbrev_plural:"jare",nami_daily:"daagliks",nami_weekly:"weekliks",nami_biweekly:"tweeweekliks",nami_monthly:"maandeliks",nami_bimonthly:"tweemaandeliks",nami_quarterly:"kwartaalliks",nami_biannually:"tweejaarliks",nami_yearly:"jaarliks"},am:{nami_day_abbrev:"ቀን",nami_day_abbrev_plural:"ቀናት",nami_week_abbrev:"ሳምንት",nami_week_abbrev_plural:"ሳምንታት",nami_month_abbrev:"ወር",nami_month_abbrev_plural:"ሞስ",nami_year_abbrev:"ዓመት",nami_year_abbrev_plural:"ዓመታት",nami_daily:"በየቀኑ",nami_weekly:"ሳምንታዊ",nami_biweekly:"በየሁለት ሳምንቱ",nami_monthly:"ወርሃዊ",nami_bimonthly:"በየሁለት ወሩ",nami_quarterly:"በየሩብ ዓመቱ",nami_biannually:"በየሁለት ዓመቱ",nami_yearly:"ዓመታዊ"},ar:{nami_day_abbrev:"يوم",nami_day_abbrev_plural:"أيام",nami_week_abbrev:"أسبوع",nami_week_abbrev_plural:"أسابيع",nami_month_abbrev:"شهر",nami_month_abbrev_plural:"موس",nami_year_abbrev:"سنة",nami_year_abbrev_plural:"سنوات",nami_daily:"يوميًا",nami_weekly:"أسبوعي",nami_biweekly:"كل أسبوعين",nami_monthly:"شهريا",nami_bimonthly:"كل شهرين",nami_quarterly:"ربع سنوي",nami_biannually:"مرتين في السنة",nami_yearly:"سنوي"},bg:{nami_day_abbrev:"ден",nami_day_abbrev_plural:"дни",nami_week_abbrev:"седмица",nami_week_abbrev_plural:"седмици",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год.",nami_year_abbrev_plural:"години",nami_daily:"ежедневно",nami_weekly:"седмично",nami_biweekly:"двуседмичен",nami_monthly:"месечно",nami_bimonthly:"двумесечно",nami_quarterly:"тримесечно",nami_biannually:"два пъти годишно",nami_yearly:"годишно"},ca:{nami_day_abbrev:"dia",nami_day_abbrev_plural:"dies",nami_week_abbrev:"setmana",nami_week_abbrev_plural:"setmanes",nami_month_abbrev:"mes",nami_month_abbrev_plural:"mesos",nami_year_abbrev:"any",nami_year_abbrev_plural:"anys",nami_daily:"diàriament",nami_weekly:"setmanal",nami_biweekly:"quinzenal",nami_monthly:"mensual",nami_bimonthly:"bimensual",nami_quarterly:"trimestral",nami_biannually:"bianualment",nami_yearly:"anual"},cs:{nami_day_abbrev:"den",nami_day_abbrev_plural:"dny",nami_week_abbrev:"týden",nami_week_abbrev_plural:"týdny",nami_month_abbrev:"měsíc",nami_month_abbrev_plural:"měsíce",nami_year_abbrev:"rok",nami_year_abbrev_plural:"roky",nami_daily:"denní",nami_weekly:"týdně",nami_biweekly:"dvoutýdenní",nami_monthly:"měsíční",nami_bimonthly:"dvouměsíčník",nami_quarterly:"čtvrtletní",nami_biannually:"pololetně",nami_yearly:"roční"},de:{nami_day_abbrev:"Tag",nami_day_abbrev_plural:"Tage",nami_week_abbrev:"Woche",nami_week_abbrev_plural:"Wochen",nami_month_abbrev:"Monat",nami_month_abbrev_plural:"Monate",nami_year_abbrev:"Jahr",nami_year_abbrev_plural:"Jahre",nami_daily:"täglich",nami_weekly:"wöchentlich",nami_biweekly:"zweiwöchentlich",nami_monthly:"monatlich",nami_bimonthly:"zweimonatlich",nami_quarterly:"vierteljährlich",nami_biannually:"halbjährlich",nami_yearly:"jährlich"},el:{nami_day_abbrev:"ημέρα",nami_day_abbrev_plural:"ημέρες",nami_week_abbrev:"εβδομάδα",nami_week_abbrev_plural:"εβδομάδες",nami_month_abbrev:"μήνα",nami_month_abbrev_plural:"μην",nami_year_abbrev:"έτος",nami_year_abbrev_plural:"χρόνια",nami_daily:"καθημερινά",nami_weekly:"εβδομαδιαίος",nami_biweekly:"ανά δύο εβδομάδες",nami_monthly:"μηνιαίος",nami_bimonthly:"διμηνιαίος",nami_quarterly:"τριμηνιαίος",nami_biannually:"ανά εξάμηνο",nami_yearly:"ετήσια"},es:{nami_day_abbrev:"día",nami_day_abbrev_plural:"días",nami_week_abbrev:"semana",nami_week_abbrev_plural:"semanas",nami_month_abbrev:"mes",nami_month_abbrev_plural:"meses",nami_year_abbrev:"año",nami_year_abbrev_plural:"años",nami_daily:"diario",nami_weekly:"semanal",nami_biweekly:"quincenal",nami_monthly:"mensual",nami_bimonthly:"bimensual",nami_quarterly:"trimestral",nami_biannually:"semestral",nami_yearly:"anual"},et:{nami_day_abbrev:"päev",nami_day_abbrev_plural:"päevad",nami_week_abbrev:"nädal",nami_week_abbrev_plural:"nädalat",nami_month_abbrev:"kuu",nami_month_abbrev_plural:"kuud",nami_year_abbrev:"aasta",nami_year_abbrev_plural:"aastat",nami_daily:"iga päev",nami_weekly:"iganädalane",nami_biweekly:"iga kahe nädala tagant",nami_monthly:"igakuine",nami_bimonthly:"kaks korda kuus",nami_quarterly:"kvartali",nami_biannually:"kaks korda aastas",nami_yearly:"iga-aastane"},fa:{nami_day_abbrev:"روز",nami_day_abbrev_plural:"روزها",nami_week_abbrev:"هفته",nami_week_abbrev_plural:"هفتهها",nami_month_abbrev:"مو",nami_month_abbrev_plural:"موش",nami_year_abbrev:"سال",nami_year_abbrev_plural:"سال",nami_daily:"روزانه",nami_weekly:"هفتگی",nami_biweekly:"دو هفتهای",nami_monthly:"ماهانه",nami_bimonthly:"دوماهه",nami_quarterly:"سه ماهه",nami_biannually:"دوسالانه",nami_yearly:"سالانه"},fi:{nami_day_abbrev:"päivä",nami_day_abbrev_plural:"päivää",nami_week_abbrev:"viikko",nami_week_abbrev_plural:"viikkoa",nami_month_abbrev:"kuukausi",nami_month_abbrev_plural:"kuukaudet",nami_year_abbrev:"vuosi",nami_year_abbrev_plural:"vuotta",nami_daily:"päivittäin",nami_weekly:"viikoittain",nami_biweekly:"joka toinen viikko",nami_monthly:"kuukausittain",nami_bimonthly:"kahdesti kuussa",nami_quarterly:"neljännesvuosittain",nami_biannually:"puolivuosittain",nami_yearly:"vuosittain"},fr:{nami_day_abbrev:"jour",nami_day_abbrev_plural:"jours",nami_week_abbrev:"semaine",nami_week_abbrev_plural:"semaines",nami_month_abbrev:"mois",nami_month_abbrev_plural:"mois",nami_year_abbrev:"année",nami_year_abbrev_plural:"ans",nami_daily:"tous les jours",nami_weekly:"hebdomadaire",nami_biweekly:"bihebdomadaire",nami_monthly:"mensuel",nami_bimonthly:"bimensuel",nami_quarterly:"trimestriel",nami_biannually:"bisannuel",nami_yearly:"annuel"},hi:{nami_day_abbrev:"दिन",nami_day_abbrev_plural:"दिन",nami_week_abbrev:"सप्त",nami_week_abbrev_plural:"सप्त",nami_month_abbrev:"महीना",nami_month_abbrev_plural:"महीने",nami_year_abbrev:"साल",nami_year_abbrev_plural:"वर्षीय",nami_daily:"दैनिक",nami_weekly:"साप्ताहिक",nami_biweekly:"द्वि-साप्ताहिक",nami_monthly:"महीने के",nami_bimonthly:"द्विमासिक",nami_quarterly:"त्रैमासिक",nami_biannually:"द्वि-वार्षिक रूप",nami_yearly:"वार्षिक"},hr:{nami_day_abbrev:"dan",nami_day_abbrev_plural:"dana",nami_week_abbrev:"tjedan",nami_week_abbrev_plural:"tjedni",nami_month_abbrev:"mjesec",nami_month_abbrev_plural:"mjeseca",nami_year_abbrev:"god.",nami_year_abbrev_plural:"godina",nami_daily:"dnevno",nami_weekly:"tjedno",nami_biweekly:"dvotjedno",nami_monthly:"mjesečno",nami_bimonthly:"dvomjesečno",nami_quarterly:"tromjesečno",nami_biannually:"dvogodišnje",nami_yearly:"godišnje"},hu:{nami_day_abbrev:"nap",nami_day_abbrev_plural:"napok",nami_week_abbrev:"hét",nami_week_abbrev_plural:"hetek",nami_month_abbrev:"hónap",nami_month_abbrev_plural:"hónap",nami_year_abbrev:"év",nami_year_abbrev_plural:"év",nami_daily:"napi",nami_weekly:"heti",nami_biweekly:"kéthetente",nami_monthly:"havi",nami_bimonthly:"kéthavonta",nami_quarterly:"negyedévenként",nami_biannually:"félévente",nami_yearly:"évi"},id:{nami_day_abbrev:"hari",nami_day_abbrev_plural:"hari",nami_week_abbrev:"minggu",nami_week_abbrev_plural:"minggu",nami_month_abbrev:"bulan",nami_month_abbrev_plural:"bulan",nami_year_abbrev:"tahun",nami_year_abbrev_plural:"tahun",nami_daily:"sehari-hari",nami_weekly:"mingguan",nami_biweekly:"dua kali seminggu",nami_monthly:"bulanan",nami_bimonthly:"dua bulanan",nami_quarterly:"triwulanan",nami_biannually:"dua tahunan",nami_yearly:"tahunan"},it:{nami_day_abbrev:"giorno",nami_day_abbrev_plural:"giorni",nami_week_abbrev:"settimana",nami_week_abbrev_plural:"settimane",nami_month_abbrev:"mese",nami_month_abbrev_plural:"mesi",nami_year_abbrev:"anno",nami_year_abbrev_plural:"anni",nami_daily:"quotidiano",nami_weekly:"settimanale",nami_biweekly:"bisettimanale",nami_monthly:"mensile",nami_bimonthly:"bimestrale",nami_quarterly:"trimestrale",nami_biannually:"semestralmente",nami_yearly:"annuale"},he:{nami_day_abbrev:"יְוֹם",nami_day_abbrev_plural:"ימים",nami_week_abbrev:"שבוע",nami_week_abbrev_plural:"שבועות",nami_month_abbrev:"מו",nami_month_abbrev_plural:"מוֹס",nami_year_abbrev:"שנה",nami_year_abbrev_plural:"שנים",nami_daily:"יוֹמִי",nami_weekly:"שְׁבוּעִי",nami_biweekly:"דו-שבועי",nami_monthly:"יַרחוֹן",nami_bimonthly:"דו-חודשי",nami_quarterly:"רִבעוֹן",nami_biannually:"דו-שנתי",nami_yearly:"שְׁנָתִי"},ja:{nami_day_abbrev:"日",nami_day_abbrev_plural:"日",nami_week_abbrev:"週",nami_week_abbrev_plural:"週",nami_month_abbrev:"モ",nami_month_abbrev_plural:"モス",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"毎日",nami_weekly:"毎週",nami_biweekly:"隔週",nami_monthly:"毎月",nami_bimonthly:"隔月",nami_quarterly:"四半期ごと",nami_biannually:"半年ごと",nami_yearly:"毎年"},ko:{nami_day_abbrev:"낮",nami_day_abbrev_plural:"날",nami_week_abbrev:"주",nami_week_abbrev_plural:"주",nami_month_abbrev:"모",nami_month_abbrev_plural:"모스",nami_year_abbrev:"년",nami_year_abbrev_plural:"년",nami_daily:"일일",nami_weekly:"주간",nami_biweekly:"격주 간행물",nami_monthly:"월간 간행물",nami_bimonthly:"격월",nami_quarterly:"계간지",nami_biannually:"반년마다",nami_yearly:"매년"},lt:{nami_day_abbrev:"diena",nami_day_abbrev_plural:"dienos",nami_week_abbrev:"savaitė",nami_week_abbrev_plural:"savaitės",nami_month_abbrev:"mėn.",nami_month_abbrev_plural:"mėn.",nami_year_abbrev:"metai",nami_year_abbrev_plural:"metų",nami_daily:"kasdien",nami_weekly:"kas savaitę",nami_biweekly:"kas dvi savaites",nami_monthly:"mėnesinis",nami_bimonthly:"kas du mėnesius",nami_quarterly:"ketvirtinis",nami_biannually:"kas du kartus per metus",nami_yearly:"kasmet"},lv:{nami_day_abbrev:"diena",nami_day_abbrev_plural:"dienas",nami_week_abbrev:"nedēļa",nami_week_abbrev_plural:"nedēļas",nami_month_abbrev:"mēn.",nami_month_abbrev_plural:"mēn.",nami_year_abbrev:"gads",nami_year_abbrev_plural:"gadi",nami_daily:"ikdienas",nami_weekly:"iknedēļas",nami_biweekly:"divreiz nedēļā",nami_monthly:"ikmēneša",nami_bimonthly:"divreiz mēnesī",nami_quarterly:"ceturksnī",nami_biannually:"divreiz gadā",nami_yearly:"katru gadu"},ms:{nami_day_abbrev:"hari",nami_day_abbrev_plural:"hari",nami_week_abbrev:"minggu",nami_week_abbrev_plural:"minggu",nami_month_abbrev:"bulan",nami_month_abbrev_plural:"bulan",nami_year_abbrev:"tahun",nami_year_abbrev_plural:"tahun",nami_daily:"setiap hari",nami_weekly:"mingguan",nami_biweekly:"dua minggu sekali",nami_monthly:"bulanan",nami_bimonthly:"dua kali sebulan",nami_quarterly:"suku tahunan",nami_biannually:"dua kali setahun",nami_yearly:"tahunan"},nl:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dagen",nami_week_abbrev:"week",nami_week_abbrev_plural:"weken",nami_month_abbrev:"maand",nami_month_abbrev_plural:"maanden",nami_year_abbrev:"jaar",nami_year_abbrev_plural:"jaren",nami_daily:"dagelijks",nami_weekly:"wekelijks",nami_biweekly:"tweewekelijks",nami_monthly:"maandelijks",nami_bimonthly:"tweemaandelijks",nami_quarterly:"kwartaal",nami_biannually:"halfjaarlijks",nami_yearly:"jaarlijks"},no:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dager",nami_week_abbrev:"uke",nami_week_abbrev_plural:"uker",nami_month_abbrev:"måned",nami_month_abbrev_plural:"måned",nami_year_abbrev:"år",nami_year_abbrev_plural:"år",nami_daily:"daglig",nami_weekly:"ukentlig",nami_biweekly:"annenhver uke",nami_monthly:"månedlig",nami_bimonthly:"annenhver måned",nami_quarterly:"kvartalsvis",nami_biannually:"to ganger i året",nami_yearly:"årlig"},pl:{nami_day_abbrev:"dzień",nami_day_abbrev_plural:"dni",nami_week_abbrev:"tydzień",nami_week_abbrev_plural:"tygodni",nami_month_abbrev:"miesiąc",nami_month_abbrev_plural:"miesiące",nami_year_abbrev:"rok",nami_year_abbrev_plural:"lat",nami_daily:"codziennie",nami_weekly:"tygodnik",nami_biweekly:"dwutygodniowy",nami_monthly:"miesięczny",nami_bimonthly:"dwumiesięczny",nami_quarterly:"kwartalny",nami_biannually:"dwa razy w roku",nami_yearly:"rocznie"},pt:{nami_day_abbrev:"dia",nami_day_abbrev_plural:"dias",nami_week_abbrev:"semana",nami_week_abbrev_plural:"semanas",nami_month_abbrev:"mês",nami_month_abbrev_plural:"meses",nami_year_abbrev:"ano",nami_year_abbrev_plural:"anos",nami_daily:"diário",nami_weekly:"semanalmente",nami_biweekly:"quinzenal",nami_monthly:"mensal",nami_bimonthly:"bimestral",nami_quarterly:"trimestral",nami_biannually:"bianualmente",nami_yearly:"anual"},ro:{nami_day_abbrev:"zi",nami_day_abbrev_plural:"zile",nami_week_abbrev:"săptămână",nami_week_abbrev_plural:"săptămâni",nami_month_abbrev:"lună",nami_month_abbrev_plural:"luni",nami_year_abbrev:"an",nami_year_abbrev_plural:"ani",nami_daily:"zilnic",nami_weekly:"săptămânal",nami_biweekly:"la două săptămâni",nami_monthly:"lunar",nami_bimonthly:"bilunar",nami_quarterly:"trimestrial",nami_biannually:"bianual",nami_yearly:"anual"},ru:{nami_day_abbrev:"день",nami_day_abbrev_plural:"дни",nami_week_abbrev:"нед",nami_week_abbrev_plural:"недели",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год",nami_year_abbrev_plural:"лет",nami_daily:"ежедневно",nami_weekly:"еженедельный",nami_biweekly:"раз в две недели",nami_monthly:"ежемесячно",nami_bimonthly:"раз в два месяца",nami_quarterly:"ежеквартальный",nami_biannually:"раз в два года",nami_yearly:"ежегодно"},sk:{nami_day_abbrev:"deň",nami_day_abbrev_plural:"dni",nami_week_abbrev:"týždeň",nami_week_abbrev_plural:"týždne",nami_month_abbrev:"mesiac",nami_month_abbrev_plural:"mesiacov",nami_year_abbrev:"rok",nami_year_abbrev_plural:"rokov",nami_daily:"denne",nami_weekly:"týždenne",nami_biweekly:"dvojtýždenne",nami_monthly:"mesačne",nami_bimonthly:"dvojmesačne",nami_quarterly:"štvrťročne",nami_biannually:"polročne",nami_yearly:"ročne"},sl:{nami_day_abbrev:"dan",nami_day_abbrev_plural:"dni",nami_week_abbrev:"teden",nami_week_abbrev_plural:"tedni",nami_month_abbrev:"mesec",nami_month_abbrev_plural:"mesecev",nami_year_abbrev:"leto",nami_year_abbrev_plural:"let",nami_daily:"dnevno",nami_weekly:"tedensko",nami_biweekly:"dvotedensko",nami_monthly:"mesečno",nami_bimonthly:"dvomesečno",nami_quarterly:"četrtletno",nami_biannually:"polletno",nami_yearly:"letno"},sr:{nami_day_abbrev:"дан",nami_day_abbrev_plural:"дана",nami_week_abbrev:"недеља",nami_week_abbrev_plural:"недеље",nami_month_abbrev:"мо",nami_month_abbrev_plural:"мос",nami_year_abbrev:"год.",nami_year_abbrev_plural:"године",nami_daily:"свакодневно",nami_weekly:"недељно",nami_biweekly:"двонедељно",nami_monthly:"месечно",nami_bimonthly:"двомесечно",nami_quarterly:"квартално",nami_biannually:"два пута годишње",nami_yearly:"годишње"},sv:{nami_day_abbrev:"dag",nami_day_abbrev_plural:"dagar",nami_week_abbrev:"vecka",nami_week_abbrev_plural:"veckor",nami_month_abbrev:"mån",nami_month_abbrev_plural:"månader",nami_year_abbrev:"år",nami_year_abbrev_plural:"år",nami_daily:"dagligen",nami_weekly:"varje vecka",nami_biweekly:"som utkommer varannan vecka",nami_monthly:"månatlig",nami_bimonthly:"varannan månad",nami_quarterly:"kvartalsvis",nami_biannually:"vartannat år",nami_yearly:"årlig"},sw:{nami_day_abbrev:"siku",nami_day_abbrev_plural:"siku",nami_week_abbrev:"wiki",nami_week_abbrev_plural:"wiki",nami_month_abbrev:"mwezi",nami_month_abbrev_plural:"miezi",nami_year_abbrev:"mwaka",nami_year_abbrev_plural:"miaka",nami_daily:"kila siku",nami_weekly:"kila wiki",nami_biweekly:"kila wiki mbili",nami_monthly:"kila mwezi",nami_bimonthly:"kila baada ya miezi miwili",nami_quarterly:"robo mwaka",nami_biannually:"kila baada ya miaka miwili",nami_yearly:"kila mwaka"},th:{nami_day_abbrev:"วัน",nami_day_abbrev_plural:"วัน",nami_week_abbrev:"สัปดาห์",nami_week_abbrev_plural:"สัปดาห์",nami_month_abbrev:"โม",nami_month_abbrev_plural:"มอส",nami_year_abbrev:"ปี",nami_year_abbrev_plural:"ปี",nami_daily:"รายวัน",nami_weekly:"รายสัปดาห์",nami_biweekly:"สองสัปดาห์ครั้ง",nami_monthly:"รายเดือน",nami_bimonthly:"สองเดือนครั้ง",nami_quarterly:"ไตรมาส",nami_biannually:"ทุกสองปี",nami_yearly:"ทุกปี"},tr:{nami_day_abbrev:"gün",nami_day_abbrev_plural:"günler",nami_week_abbrev:"hafta",nami_week_abbrev_plural:"haftalar",nami_month_abbrev:"ay",nami_month_abbrev_plural:"aylar",nami_year_abbrev:"yıl",nami_year_abbrev_plural:"yıllar",nami_daily:"günlük",nami_weekly:"haftalık",nami_biweekly:"iki haftada bir",nami_monthly:"aylık",nami_bimonthly:"iki ayda bir",nami_quarterly:"üç aylık",nami_biannually:"iki yılda bir",nami_yearly:"yıllık"},uk:{nami_day_abbrev:"день",nami_day_abbrev_plural:"дні",nami_week_abbrev:"тиждень",nami_week_abbrev_plural:"тижні",nami_month_abbrev:"місяць",nami_month_abbrev_plural:"мос",nami_year_abbrev:"рік",nami_year_abbrev_plural:"років",nami_daily:"щоденно",nami_weekly:"щотижня",nami_biweekly:"раз на два тижні",nami_monthly:"щомісяця",nami_bimonthly:"раз на два місяці",nami_quarterly:"щоквартально",nami_biannually:"раз на півроку",nami_yearly:"щорічно"},vi:{nami_day_abbrev:"ngày",nami_day_abbrev_plural:"ngày",nami_week_abbrev:"tuần",nami_week_abbrev_plural:"tuần",nami_month_abbrev:"tháng",nami_month_abbrev_plural:"tháng",nami_year_abbrev:"năm",nami_year_abbrev_plural:"năm",nami_daily:"hằng ngày",nami_weekly:"hàng tuần",nami_biweekly:"hai tuần một lần",nami_monthly:"hàng tháng",nami_bimonthly:"hai tháng một lần",nami_quarterly:"hàng quý",nami_biannually:"hai năm một lần",nami_yearly:"hàng năm"},"zh-CN":{nami_day_abbrev:"天",nami_day_abbrev_plural:"天",nami_week_abbrev:"周",nami_week_abbrev_plural:"周",nami_month_abbrev:"莫",nami_month_abbrev_plural:"莫斯",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"日常的",nami_weekly:"每周",nami_biweekly:"每两周一次",nami_monthly:"月度",nami_bimonthly:"双月刊",nami_quarterly:"季刊",nami_biannually:"每半年",nami_yearly:"每年"},"zh-TW":{nami_day_abbrev:"天",nami_day_abbrev_plural:"天",nami_week_abbrev:"週",nami_week_abbrev_plural:"週",nami_month_abbrev:"莫",nami_month_abbrev_plural:"莫斯",nami_year_abbrev:"年",nami_year_abbrev_plural:"年",nami_daily:"日常的",nami_weekly:"每週",nami_biweekly:"每兩週一次",nami_monthly:"每月",nami_bimonthly:"雙月刊",nami_quarterly:"季刊",nami_biannually:"每半年",nami_yearly:"每年"},zu:{nami_day_abbrev:"usuku",nami_day_abbrev_plural:"izinsuku",nami_week_abbrev:"isonto",nami_week_abbrev_plural:"amasonto",nami_month_abbrev:"inyanga",nami_month_abbrev_plural:"i-mos",nami_year_abbrev:"unyaka",nami_year_abbrev_plural:"iminyaka",nami_daily:"nsuku zonke",nami_weekly:"masonto onke",nami_biweekly:"kabili ngesonto",nami_monthly:"nyanga zonke",nami_bimonthly:"kabili ngenyanga",nami_quarterly:"njalo ngekota",nami_biannually:"kabili ngonyaka",nami_yearly:"minyaka yonke"}},nh="en";function ih(e){var t,n,i=function(e){if(!e)return nh;var t=e.trim();if(th[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return th[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":nh}(Po.getLanguageCode()),a=null!==(t=th[i])&&void 0!==t?t:th[nh];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}function ah(e){if("subscription"===(null==e?void 0:e.product_type)){var t=oh(e);if(t.length>0)return t[0].billingPeriod}return null}function rh(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return sh(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function oh(e){return e?sh(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function sh(e,t){return e.map(e=>uh(e,t))}function uh(e,t){var n,i,a,r,o,s,u,l;if(!e)return{};var d=null!==(n=null===(i=e.promo_period)||void 0===i?void 0:i.count)&&void 0!==n?n:null==t?void 0:t.count,c=null!==(a=null===(r=e.promo_period)||void 0===r?void 0:r.type)&&void 0!==a?a:null==t?void 0:t.type,h=null!==(o=null===(s=e.promo_price)||void 0===s?void 0:s.price)&&void 0!==o?o:e.price,m=null!==(u=null===(l=e.promo_price)||void 0===l?void 0:l.currency)&&void 0!==u?u:e.currency;return{priceAmountMicros:1e6*h,priceCurrencyCode:m,billingPeriod:c?`P${d}${c[0].toUpperCase()}`:"",formattedPrice:ch(m).format(h)}}function lh(e,t=!1,n=!1,i=!1,a=!1){if(!e)return null;var r=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!r)return null;var o=r.slice(1).map(e=>parseInt(e)),s=o[0],u=o[1],l=o[2],d=o[3],c=(e,t,n,i,r)=>{var o=(e=>a?`${e}_abbrev`:e)(r),s=(e=>a?`${e}_abbrev_plural`:`${e}_plural`)(r),u=ih(o),l=ih(s);return a||u!==o||(u=ih(`${r}_abbrev`)),a||l!==s||(l=ih(`${r}_abbrev_plural`)),i?e.toString():n?1===e||t?u:l:1===e||t?`${e} ${u}`:`${e} ${l}`};switch(e.at(-1)){case"D":return c(d,t,n,i,"nami_day");case"W":return c(l,t,n,i,"nami_week");case"M":return c(u,t,n,i,"nami_month");case"Y":return c(s,t,n,i,"nami_year")}return null}function dh(e){var t;if(!e||e.length<2)return!1;var n=null===(t=e.at(-1))||void 0===t?void 0:t.toUpperCase();return"M"===n||"Y"===n}function ch(e){var t={maximumFractionDigits:2,minimumFractionDigits:0},n=we().device.getLanguage();try{return new Intl.NumberFormat(n,m({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(n,m({},t,{style:"currency",currency:"USD"}))}}var hh=(e,t,n)=>e&&t&&n?n.format(e-t):null,mh=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},fh=(e,t)=>{if(""!=t){var n=parseInt(t)-1;return n>=0&&n<(null==e?void 0:e.length)?e[n]:null==e?void 0:e.find(e=>e.sku_ref_id===t)}},vh=e=>gh(e.priceAmountMicros)/ph(e.billingPeriod),ph=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},gh=e=>e/1e6;function yh(e){return parseFloat((Math.round(e)/100).toFixed(2))}var bh=(e,t,n=[])=>({price:()=>kh(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>Sh(e),durationSingular:()=>Sh(e,!0),period:()=>Sh(e,!1,!0),periodNumber:()=>Sh(e,!1,!1,!0),freeTrialDuration:()=>Eh(e),freeTrialDurationSingular:()=>Eh(e,!0),freeTrialPeriod:()=>Eh(e,!1,!0),freeTrialPeriodNumber:()=>Eh(e,!1,!1,!0),pricePerMonth:()=>Ph(e),pricePerMonthRounded:()=>Ph(e,!0),periodInMonths:()=>_h(e),durationInMonths:()=>Th(e),durationInMonthsSingular:()=>Th(e,!0),periodNumberInMonths:()=>Mh(e),percentagePriceDifferenceFromSku:()=>Ah(e,t,n),priceDifferenceFromSku:()=>Dh(e,t,n),promoEligible:()=>null===xh(e)&&null!==Ch(e,t),freeTrialEligible:()=>null!==xh(e),promo:()=>{var n;return null===(n=Ch(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=Ih(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Lh(e,t,!1,!0),promoPeriodNumber:()=>Lh(e,t,!1,!1,!0),promoDuration:()=>Lh(e,t),promoDurationSingular:()=>Lh(e,t,!0),introEligible:()=>!1,pricePerDay:()=>Fh(e),pricePerWeek:()=>Rh(e),pricePerWeekRounded:()=>Rh(e,!0),introductoryPrice:()=>Oh(e,t),introductoryPeriod:()=>$h(e,t,!1,!0),introductoryPeriodNumber:()=>$h(e,t,!1,!1,!0),introductoryDuration:()=>$h(e,t),introductoryDurationSingular:()=>$h(e,t,!0),introductoryPricePerMonth:()=>Nh(e,t),introductoryPricePerMonthRounded:()=>Nh(e,t,!0),durationAbbrev:()=>Sh(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Eh(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>$h(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Lh(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Lh(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>Th(e,!1,!1,!1,!0),durationSingularAbbrev:()=>Sh(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Eh(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>$h(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Lh(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Lh(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>Th(e,!0,!1,!1,!0),periodAbbrev:()=>Sh(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Eh(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>$h(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Lh(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Lh(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>Th(e,!1,!0,!1,!0),periodly:()=>function(e){if(!e)return null;var t=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!t)return null;var n=t[1],i=t[2],a=t[3],r=t[4],o=void 0!==n?parseInt(n,10):0,s=void 0!==i?parseInt(i,10):0,u=void 0!==a?parseInt(a,10):0;return(void 0!==r?parseInt(r,10):0)>0?null:u>0?1===u?ih("nami_weekly"):2===u?ih("nami_biweekly"):null:s>0?ih(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?ih("nami_yearly"):null}(ah(e)),iso_subscription_duration:()=>zh(e),bill_term:()=>Bh(e),invalid:()=>!1,unavailable:()=>!1}),wh=(e,t,n,i=[])=>{if(!t)return null;var a=bh(t,n,i);return a[e]?a[e]():null},kh=e=>{var t=oh(e);return t&&t.length?t[0].formattedPrice:null},Sh=(e,t,n,i,a)=>lh(ah(e),t,n,i,a),Eh=(e,t,n,i,a)=>lh(rh(e),t,n,i,a),Ph=(e,t)=>{var n=oh(e);if(!n||0===n.length)return null;var i=vh(n[0]);return i?ch(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},_h=(e,t)=>{var n=oh(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return dh(i)?lh("P1Y"===i?"P12M":i,!1,!1,!1,t):null},Th=(e,t,n,i,a)=>{var r=oh(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return dh(o)?lh("P1Y"===o?"P12M":o,t,n,i,a):null},Mh=e=>{if(!e)return 0;var t=oh(e);return t&&t.length?ph(t[0].billingPeriod):0},Ah=(e,t,n=[])=>{var i,a=oh(e);if(!a||0===a.length)return null;var r=null===(i=fh(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return mh(yh(a[0].priceAmountMicros),Mh(e));var o=oh(r);return mh(yh(a[0].priceAmountMicros),Mh(e),(null==o?void 0:o.length)>0?yh(o[0].priceAmountMicros):0,Mh(r))},Dh=(e,t,n=[])=>{var i,a=oh(e);if(!a||0===a.length)return null;var r=null===(i=fh(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return hh(vh(a[0]));var o=oh(r);return hh(vh(a[0]),vh(o[0]),ch(o[0].priceCurrencyCode))},xh=e=>rh(e),Ch=(e,t)=>{if(!e)return null;var n=e.offers.filter(e=>"promo"===e.offer_type);if(!t)return n[0]||null;var i=n[parseInt(t)];return i?i||null:n.find(e=>e.offer_ref_id===t)||null},Ih=(e,t)=>e?uh(Ch(e,t),e.subscription_period):null,Lh=(e,t,n,i,a,r)=>{var o=Ih(e,t);return lh((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Fh=(e,t)=>{var n=oh(e);if(!n||0===n.length)return null;var i,a,r=gh(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=ph(i))?30.437*a:1);return r?ch(n[0].priceCurrencyCode).format(r):null},Rh=(e,t)=>{var n=oh(e);if(!n||0===n.length)return null;var i,a,r=gh(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=ph(i))?52*a/12:1);return r?ch(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},Oh=(e,t)=>{var n=Wh(e,t);return(null==n?void 0:n.formattedPrice)||null},$h=(e,t,n,i,a,r)=>{var o=Wh(e,t);return lh((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Nh=(e,t,n)=>{var i=Wh(e,t);if(i){var a=gh(i.priceAmountMicros),r=ph(i.billingPeriod),o=n?Math.round(a/r):a/r;return ch(i.priceCurrencyCode).format(o)}},Wh=(e,t)=>{return e?(t?(n=e.offers[parseInt(t)])||(n=e.offers.find(e=>e.offer_ref_id===t)||null):n=e.offers[0],uh(n,e.subscription_period)):null;var n},jh={P1D:"daily",P1W:"weekly",P1M:"monthly",P3M:"quarterly",P6M:"semiannual",P1Y:"annual"},Bh=e=>{var t=zh(e);return t&&jh[t]||null},zh=e=>{var t=ah(e);return t?"P7D"===t?"P1W":t:null};function Uh(e,t,n,i){var a=n.flatMap(e=>e.products).find(e=>e.id===t.selectedProducts[t.currentGroupId]);return Gh(Yh(e,null==a?void 0:a.sku_ref_id),a,i)}function Hh(e,t,n){var i,a,r=null!==(i=null===(a=t.find(e=>e.id===n))||void 0===a?void 0:a.products)&&void 0!==i?i:[];return r.forEach(t=>{t.product_details=Yh(e,t.sku_ref_id||""),t.variables=Gh(t.product_details,t,r)}),r}function Gh(e,t,n){if(!t)return{};var i=function(e){if(!Array.isArray(e))return e;var t=e.filter(e=>e&&"object"==typeof e&&"entitlement_ref_id"in e).map(e=>e.entitlement_ref_id);return t.length?t:e}(t.entitlements),a=t.variables;if(!a)return m({},t,{entitlements:i});Object.keys(a).forEach(t=>{if("string"==typeof(r=a[t])&&r.includes(Ri)){var i=Vh(a[t],e,n);a[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(i)}var r});var r={};return Object.keys(bh({})).forEach(t=>{if(void 0===a[t]){var i=wh(t,e,void 0,n);null!==i&&(r[t]=i)}}),m({},t,r,a,{entitlements:i})}var Vh=(e,t,n)=>e.replace(Ci,(i,a)=>{var r,o,s,u,l=(null===(r=Ci.exec(e))||void 0===r?void 0:r.slice(1))||[];a=null!==(o=l[0])&&void 0!==o?o:a;var d=null!==(s=null===(u=l[1])||void 0===u?void 0:u.replace(":",""))&&void 0!==s?s:"";return wh(a,t,d,n)});function Kh(e,t){return t.flatMap(e=>e.products).some(t=>1==wh("freeTrialEligible",Yh(e,t.sku_ref_id)))}function Yh(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var Xh=function(){try{var e=ya(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var qh=Object.prototype.hasOwnProperty;function Jh(e,t,n){var i=e[t];qh.call(e,t)&&Ui(i,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&Xh?Xh(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}var Qh="object"==typeof e&&e&&!e.nodeType&&e,Zh=Qh&&"object"==typeof module&&module&&!module.nodeType&&module,em=Zh&&Zh.exports===Qh?Xi.Buffer:void 0;em&&em.allocUnsafe;var tm=cr(Object.getPrototypeOf,Object),nm=Object.prototype.hasOwnProperty;function im(e){var t=new e.constructor(e.byteLength);return new Ca(t).set(new Ca(e)),t}var am=/\w*$/;var rm=qi?qi.prototype:void 0,om=rm?rm.valueOf:void 0;function sm(e,t,n){var i,a,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return im(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return r=im((a=e).buffer),new a.constructor(r,a.byteOffset,a.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=im(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,am.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return i=e,om?Object(om.call(i)):{}}}var um=Object.create,lm=function(){function e(){}return function(t){if(!aa(t))return{};if(um)return um(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var dm=ar&&ar.isMap,cm=dm?er(dm):function(e){return ja(e)&&"[object Map]"==Cr(e)};var hm=ar&&ar.isSet,mm=hm?er(hm):function(e){return ja(e)&&"[object Set]"==Cr(e)},fm="[object Arguments]",vm="[object Function]",pm="[object Object]",gm={};function ym(e,t,n,i,a,r){var o;if(void 0!==o)return o;if(!aa(e))return e;var s=Oa(e);if(s)o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&nm.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var u=Cr(e),l=u==vm||"[object GeneratorFunction]"==u;if(Xa(e))return e.slice();if(u==pm||u==fm||l&&!a)o=l?{}:function(e){return"function"!=typeof e.constructor||dr(e)?{}:lm(tm(e))}(e);else{if(!gm[u])return a?e:{};o=sm(e,u)}}r||(r=new Ta);var d=r.get(e);if(d)return d;r.set(e,o),mm(e)?e.forEach(function(i){o.add(ym(i,t,n,i,e,r))}):cm(e)&&e.forEach(function(i,a){o.set(a,ym(i,t,n,a,e,r))});var c=s?void 0:vr(e);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););}(c||e,function(i,a){c&&(i=e[a=i]),Jh(o,a,ym(i,t,n,a,e,r))}),o}gm[fm]=gm["[object Array]"]=gm["[object ArrayBuffer]"]=gm["[object DataView]"]=gm["[object Boolean]"]=gm["[object Date]"]=gm["[object Float32Array]"]=gm["[object Float64Array]"]=gm["[object Int8Array]"]=gm["[object Int16Array]"]=gm["[object Int32Array]"]=gm["[object Map]"]=gm["[object Number]"]=gm[pm]=gm["[object RegExp]"]=gm["[object Set]"]=gm["[object String]"]=gm["[object Symbol]"]=gm["[object Uint8Array]"]=gm["[object Uint8ClampedArray]"]=gm["[object Uint16Array]"]=gm["[object Uint32Array]"]=!0,gm["[object Error]"]=gm[vm]=gm["[object WeakMap]"]=!1;var bm=e=>"object"==typeof e&&null!==e&&"handleEvent"in e,wm=(e,t,n)=>{var i=Object.getOwnPropertyDescriptor(e,t);if(!i||i.configurable)try{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n,writable:!1})}catch(i){try{e[t]=n}catch(e){}}},km=function(){return c(function e(){o(this,e),this.listeners=new Map},[{key:"addEventListener",value:function(e,t,n){var i;if(t){var a=(e=>"boolean"==typeof e?{capture:e}:null!=e?e:{})(n),r=null!==(i=this.listeners.get(e))&&void 0!==i?i:[];if(!r.some(e=>e.listener===t)){var o={listener:t,once:Boolean(a.once)};if(a.signal){if(a.signal.aborted)return;o.signal=a.signal,o.abortHandler=()=>this.removeEventListener(e,t),a.signal.addEventListener("abort",o.abortHandler,{once:!0})}r.push(o),this.listeners.set(e,r)}}}},{key:"removeEventListener",value:function(e,t){if(t){var n=this.listeners.get(e);if(n&&0!==n.length){for(var i=n.length-1;i>=0;i-=1){var a=n[i];a.listener===t&&(a.signal&&a.abortHandler&&a.signal.removeEventListener("abort",a.abortHandler),n.splice(i,1))}0===n.length&&this.listeners.delete(e)}}}},{key:"dispatchEvent",value:function(e){var t,n;if(!e||"string"!=typeof e.type)throw new TypeError('Failed to execute "dispatchEvent": event type must be a string.');var i=this.listeners.get(e.type);if(!i||0===i.length)return!0;wm(e,"target",this);var a=!1,r=null===(t=e.stopImmediatePropagation)||void 0===t?void 0:t.bind(e),o=null===(n=e.stopPropagation)||void 0===n?void 0:n.bind(e),s=()=>{a=!0,null==r||r()},u=()=>{e.cancelBubble=!0,null==o||o()};e.stopImmediatePropagation=s,e.stopPropagation=u;for(var l,d=h(i.slice());!(l=d()).done;){var c=l.value;if(a)break;wm(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):bm(c.listener)&&c.listener.handleEvent.call(c.listener,e),c.once&&this.removeEventListener(e.type,c.listener)}if(r)e.stopImmediatePropagation=r;else try{delete e.stopImmediatePropagation}catch(t){e.stopImmediatePropagation=s}if(o)e.stopPropagation=o;else try{delete e.stopPropagation}catch(t){e.stopPropagation=u}return wm(e,"currentTarget",null),!e.defaultPrevented}}])}(),Sm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Em=/^([01]?\d|2[0-3]):([0-5]\d)$/,Pm=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/,_m={equals:(e,t)=>e===t,gt:(e,t)=>e>t,gte:(e,t)=>e>=t,lt:(e,t)=>e<t,lte:(e,t)=>e<=t},Tm=e=>Object.prototype.hasOwnProperty.call(_m,e),Mm=e=>"string"==typeof e.value&&e.value.startsWith(Un)&&e.value.endsWith("}"),Am=e=>{if("string"!=typeof e||!Pm.test(e))return null;var t=e.slice(0,10).split("-").map(Number),n=t[0],i=t[1];if(t[2]>new Date(Date.UTC(n,i,0)).getUTCDate())return null;var a=new Date(e);return Number.isNaN(a.getTime())?null:a},Dm=e=>{if("string"!=typeof e)return null;var t=e.split("@");return 2===t.length&&t[0]&&(e=>{if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch(e){return!1}})(t[1])?{value:t[0],zone:t[1]}:null},xm=(e,t)=>{try{var n=Od(e,t,"EEEE|HH:mm",{locale:Sl}).split("|"),i=n[0],a=n[1].split(":").map(Number);return{dayOfWeek:i,minutes:60*a[0]+a[1]}}catch(e){return null}},Cm=e=>{var t=Dm(e);return t&&Sm.includes(t.value)?{day:t.value,zone:t.zone}:null},Im=e=>{var t=Dm(e),n=t&&Em.exec(t.value);return t&&n?{minutes:60*Number(n[1])+Number(n[2]),zone:t.zone}:null},Lm=(e,t)=>{if(!Array.isArray(e)||0===e.length)return null;for(var n,i=[],a=h(e);!(n=a()).done;){var r=n.value,o="string"==typeof r?t(r):null;if(null===o)return null;i.push(o)}return i},Fm=(e,t)=>{if(!Mm(e))return null;if(Number.isNaN(t.getTime()))return!1;switch(e.value.slice(Un.length,-1)){case"dayOfWeek":return((e,t,n)=>{if("in"===e){var i=Lm(t,Cm);return null!==i&&i.some(({day:e,zone:t})=>{var i;return(null===(i=xm(n,t))||void 0===i?void 0:i.dayOfWeek)===e})}if("equals"!==e&&"notEquals"!==e)return!1;var a=Cm(t);if(!a)return!1;var r=xm(n,a.zone);return!!r&&("equals"===e?r.dayOfWeek===a.day:r.dayOfWeek!==a.day)})(e.operator,e.expected,t);case"timeOfDay":return((e,t,n)=>{if(!Tm(e))return!1;var i=Im(t),a=i&&xm(n,i.zone);return!(!i||!a)&&_m[e](a.minutes,i.minutes)})(e.operator,e.expected,t);case"now":return((e,t,n)=>{if(!Tm(e))return!1;var i=Am(t);return null!==i&&_m[e](n.getTime(),i.getTime())})(e.operator,e.expected,t);default:return!1}},Rm={equals:_m.equals,greater_than:_m.gt,greater_than_or_equal_to:_m.gte,less_than:_m.lt,less_than_or_equal_to:_m.lte},Om=e=>Object.prototype.hasOwnProperty.call(Rm,e)?Rm[e]:null,$m=e=>"string"==typeof e&&e.startsWith(Gn),Nm=()=>{var e,t=null===(e=Po.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.find(e=>e.startsWith(Bn));if(void 0===t)return new Date;var n=(e=>e.startsWith(Bn)?Am(e.slice(Bn.length)):null)(t);return null===n?(Bi.warn(`Ignoring invalid ${t}: expected ISO-8601 with an offset, e.g. ${Bn}2026-09-13T13:00:00-04:00`),new Date):n},Wm=[];var jm={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,safeAreaBottom:0,safeAreaLeft:0,safeAreaRight:0,groups:[],selectedProducts:{},formStates:{},formFieldErrors:{},formFieldValidators:{},timerStates:{},currentPage:"page1",pageHistory:["page1"],currentGroupId:"",currentGroupName:"",fullScreenPresentation:!1,launch:{productGroups:[],customAttributes:{},customObject:{},currentGroup:""},sku:{},orientation:"portrait",focusedState:!1,platformId:"",mediaList:{},skuItems:[],customer:{},hasNotch:!1,purchaseInProgress:!1,formFactor:"desktop",slides:{},userInteractionEnabled:!0,currentSlideIndex:void 0},Bm=function(t){function n(e,t,i){var a;o(this,n),(a=r(this,n)).subscribers=new Set,a.productDetails=Wm,a.filteredSkuMenus=[],a.state=ym(jm,5);var s=Po.getNamiProfile();return a.state.isLoggedIn=!(null==s||!s.externalId),a.state.customer=m({},a.state.customer,Po.getAllCustomerAttributesMap()),a.setPaywall(e,t,i),a.subscribers=new Set,a}return p(n,t),c(n,[{key:"onStateChanged",value:function(){}},{key:"subscribe",value:function(e){return this.subscribers.add(e),()=>this.unsubscribe(e)}},{key:"unsubscribe",value:function(e){this.subscribers.delete(e)}},{key:"emitEvent",value:function(e,t){this.dispatchEvent(function(e,t){if("function"==typeof Event){var n=new Event(e);return Object.defineProperty(n,"detail",{configurable:!0,enumerable:!1,value:t,writable:!1}),n}return{type:e,detail:t,bubbles:!1,cancelBubble:!1,cancelable:!1,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!1,returnValue:!0,srcElement:null,target:null,timeStamp:Date.now(),NONE:0,CAPTURING_PHASE:1,AT_TARGET:2,BUBBLING_PHASE:3,composedPath:()=>[],initEvent:()=>{},preventDefault:()=>{},stopImmediatePropagation:()=>{},stopPropagation:()=>{}}}(e,t))}},{key:"onEvent",value:function(e,t){var n=e=>t(e.detail);return this.addEventListener(e,n),()=>this.removeEventListener(e,n)}},{key:"setState",value:function(e){this.state=e,this.subscribers.forEach(e=>e()),this.onStateChanged()}},{key:"setProductDetails",value:function(e){this.productDetails=e}},{key:"getProductDetails",value:function(){return this.productDetails}},{key:"setCurrentGroupData",value:function(e,t){var n=Uh(this.productDetails,this.state,this.filteredSkuMenus,Hh(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(m({},this.state,{currentGroupId:e,currentGroupName:t,sku:n}))}},{key:"setFormState",value:function(e,t){this.setState(m({},this.state,{formStates:m({},this.state.formStates,{[e]:t})}))}},{key:"registerFormFieldValidator",value:function(e,t){this.setState(m({},this.state,{formFieldValidators:m({},this.state.formFieldValidators,{[e]:t})}))}},{key:"getFormFieldValidators",value:function(){return this.state.formFieldValidators}},{key:"setFormFieldErrors",value:function(e){this.setState(m({},this.state,{formFieldErrors:m({},e)}))}},{key:"setFormFieldError",value:function(e,t){this.setState(m({},this.state,{formFieldErrors:m({},this.state.formFieldErrors,{[e]:t})}))}},{key:"clearFormFieldError",value:function(e){var t=m({},this.state.formFieldErrors);delete t[e],this.setState(m({},this.state,{formFieldErrors:t}))}},{key:"getFormFieldErrors",value:function(){return this.state.formFieldErrors}},{key:"setTimerState",value:function(e,t,n,i){this.setState(m({},this.state,{timerStates:m({},this.state.timerStates,{[e]:{remainingSeconds:t,savedAt:n,hasEmittedCompletion:i}})}))}},{key:"getTimerState",value:function(e){return this.state.timerStates[e]}},{key:"getCurrentGroupId",value:function(){return this.state.currentGroupId}},{key:"getCurrentGroupName",value:function(){return this.state.currentGroupName}},{key:"setCurrentFormId",value:function(e,t){var n=this.state.formStates||{},i=m({},n,{[e]:t||!n[e]});this.setState(m({},this.state,{formStates:i}))}},{key:"getCurrentFormId",value:function(e){return this.state.formStates[e]}},{key:"setSelectedProducts",value:function(e){var t=m({},this.state,{selectedProducts:e}),n=Uh(this.productDetails,t,this.filteredSkuMenus,Hh(this.productDetails,this.filteredSkuMenus,t.currentGroupId));this.setState(m({},t,{sku:n}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"clearSelectedProduct",value:function(e){var t=this.state.selectedProducts||{};if(e&&null!=t[e]){var n=m({},t);delete n[e],this.setSelectedProducts(n)}}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,u=m({},this.state,{formFactor:Ku(),selectedPaywall:e,selectedCampaign:n});(u=m({},u,null===(i=e.template)||void 0===i?void 0:i.initialState)).platformId=null!==(a=null===(r=Po.getNamiConfig())||void 0===r?void 0:r.appPlatformID)&&void 0!==a?a:"",u.systemTimeSnapshot=Nm().getTime();var l,d,c=function(e,t,n=[]){var i,a,r=null!==(i=t.productGroups)&&void 0!==i&&i.length?t.productGroups:n.map(e=>e.ref);return{customAttributes:t.customAttributes,productGroups:r,customObject:m({},e.customObject,t.customObject),currentGroup:null!==(a=t.currentGroup)&&void 0!==a?a:""}}(u.launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(o=e.sku_menus)&&void 0!==o?o:[],c.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter(e=>c.productGroups.includes(e.ref))),""!==c.currentGroup&&u.groups.length&&null!==(s=e.template)&&void 0!==s&&s.displaySingleGroup)&&(u.currentGroupId=null!==(l=null===(d=u.groups.find(e=>e.ref==c.currentGroup))||void 0===d?void 0:d.id)&&void 0!==l?l:"");if(""===u.currentGroupId&&1===this.filteredSkuMenus.length){var h,f=u.groups.find(e=>e.ref==this.filteredSkuMenus[0].ref);u.currentGroupId=null!==(h=null==f?void 0:f.id)&&void 0!==h?h:u.currentGroupId}var v=Hh(this.productDetails,this.filteredSkuMenus,u.currentGroupId);u.skuItems=v,u.launch=c,u.anySkuHasTrialOffer=Kh(this.productDetails,this.filteredSkuMenus),u.anySkuHasPromoOffer=function(e,t){return!Kh(e,t)&&t.flatMap(e=>e.products).some(t=>1==wh("promoEligible",Yh(e,t.sku_ref_id)))}(this.productDetails,this.filteredSkuMenus),u.paywallId=e.id,u.sku=Uh(this.productDetails,u,this.filteredSkuMenus,v),u.pageHistory=[u.currentPage],this.setState(u)}},{key:"getSelectedPaywall",value:function(){return this.state.selectedPaywall}},{key:"getSelectedCampaign",value:function(){return this.state.selectedCampaign}},{key:"getCurrentPlacementLabel",value:function(){var e,t;return null!==(e=this.state.selectedCampaign)&&void 0!==e&&e.value?this.state.selectedCampaign.value:null!==(t=this.flow)&&void 0!==t&&null!==(t=t.campaign)&&void 0!==t&&t.value?this.flow.campaign.value:void 0}},{key:"getPaywallActionEventData",value:function(){var t,n,i,a,r,o,s,u,l,d=this.state.selectedCampaign,c=this.state.selectedPaywall;return{paywallId:null!==(t=null==c?void 0:c.id)&&void 0!==t?t:"",paywallName:null!==(n=null==c?void 0:c.name)&&void 0!==n?n:"",campaignId:null!==(i=null==d?void 0:d.rule)&&void 0!==i?i:"",campaignName:null!==(a=null==d?void 0:d.name)&&void 0!==a?a:"",campaignType:null!==(r=null==d?void 0:d.type)&&void 0!==r?r:"",campaignLabel:null!==(o=null==d?void 0:d.value)&&void 0!==o?o:"",campaignUrl:(null==d?void 0:d.type)===e.NamiCampaignRuleType.URL&&null!==(s=null==d?void 0:d.value)&&void 0!==s?s:"",segmentId:null!==(u=null==d?void 0:d.segment)&&void 0!==u?u:"",externalSegmentId:null!==(l=null==d?void 0:d.external_segment)&&void 0!==l?l:""}}},{key:"paywallId",value:function(){return this.state.paywallId}},{key:"setCurrentPage",value:function(e){if(e&&e!==this.state.currentPage){var t=this.state.pageHistory&&this.state.pageHistory.length?this.state.pageHistory:[this.state.currentPage];this.setState(m({},this.state,{currentPage:e,pageHistory:[...t,e]}))}}},{key:"canGoBackPage",value:function(){var e,t;return(null!==(e=null===(t=this.state.pageHistory)||void 0===t?void 0:t.length)&&void 0!==e?e:0)>1}},{key:"goBackPage",value:function(){var e=this.state.pageHistory&&this.state.pageHistory.length?[...this.state.pageHistory]:[this.state.currentPage];if(e.length<=1)return!1;e.pop();var t=e[e.length-1];return!!t&&(this.setState(m({},this.state,{currentPage:t,pageHistory:e})),!0)}},{key:"setCustomerAttribute",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"removeCustomerAttribute",value:function(e){var t=m({},this.state.customer);delete t[e],this.setState(m({},this.state,{customer:t}))}},{key:"setIsLoggedIn",value:function(e){this.setState(m({},this.state,{isLoggedIn:e}))}},{key:"setMediaList",value:function(e){this.setState(m({},this.state,{mediaList:e.reduce((e,t)=>m({},e,{[t.name]:t}))}))}},{key:"setSafeAreaTop",value:function(e){this.setState(m({},this.state,{safeAreaTop:e}))}},{key:"setSafeAreaBottom",value:function(e){this.setState(m({},this.state,{safeAreaBottom:e}))}},{key:"setSafeAreaLeft",value:function(e){this.setState(m({},this.state,{safeAreaLeft:e}))}},{key:"setSafeAreaRight",value:function(e){this.setState(m({},this.state,{safeAreaRight:e}))}},{key:"setFullScreenPresentation",value:function(e){this.setState(m({},this.state,{fullScreenPresentation:e}))}},{key:"setFormFactor",value:function(e){this.setState(m({},this.state,{formFactor:e}))}},{key:"getFormFactor",value:function(){return this.state.formFactor}},{key:"setPurchaseInProgress",value:function(e){this.setState(m({},this.state,{purchaseInProgress:e}))}},{key:"setPurchase",value:function(e,t){this.setState(m({},this.state,{purchaseInProgress:e,productBeingPurchased:t}))}},{key:"setTimeSpentOnPaywall",value:function(e){this.setState(m({},this.state,{timeSpentOnPaywall:e}))}},{key:"setAppSuppliedVideoDetails",value:function({url:e,name:t}){this.setState(m({},this.state,{appSuppliedVideoUrl:e,appSuppliedVideoName:t}))}},{key:"resetAppSuppliedVideoDetails",value:function(){var e=m({},this.state);delete e.appSuppliedVideoUrl,delete e.appSuppliedVideoName,this.setState(e)}},{key:"setLaunchDetails",value:function(e,t){this.setState(m({},this.state,{launchValue:e,launchType:t}))}},{key:"setOpenHeaderIds",value:function(e,t){e=null!=t&&t.skuId?`${e}_${t.skuId}`:e;var n=[...this.state.openHeaderIds],i=n.indexOf(e);-1!==i?n.splice(i,1):n.push(e),this.setState(m({},this.state,{openHeaderIds:n,currentCollapsibleSku:null!=t?t:null}))}},{key:"getCurrentCollapsibleSku",value:function(){return this.state.currentCollapsibleSku}},{key:"setFlow",value:function(e){this.flow=e}},{key:"setUserInteractionEnabled",value:function(e){this.setState(m({},this.state,{userInteractionEnabled:e})),this.emitEvent("user-interaction-changed",{enabled:e})}},{key:"setUserTags",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"setCurrentSlideIndex",value:function(e){this.setState(m({},this.state,{currentSlideIndex:e}))}}],[{key:"create",value:function(e,t,i){var a=new n(e,t,i);return this.providers.push(a),a}},{key:"remove",value:function(e){n.providers=n.providers.filter(t=>t!==e)}},{key:"reset",value:function(){n.providers=[]}},{key:"currentProvider",get:function(){return n.providers[0]}},{key:"setCustomerAttribute",value:function(e){this.providers.forEach(t=>{t.setCustomerAttribute(e)})}},{key:"removeCustomerAttribute",value:function(e){this.providers.forEach(t=>{t.removeCustomerAttribute(e)})}},{key:"setAppSuppliedVideoDetails",value:function(e){this.providers.forEach(t=>{t.setAppSuppliedVideoDetails(e)})}},{key:"getSelectedPaywall",value:function(){var e;return null===(e=this.providers[0])||void 0===e?void 0:e.getSelectedPaywall()}},{key:"setUserInteractionEnabled",value:function(e){this.providers.forEach(t=>{t.setUserInteractionEnabled(e)})}},{key:"setUserTags",value:function(e){this.providers.forEach(t=>{t.setUserTags(e)})}},{key:"setProductDetails",value:function(e){this.providers.forEach(t=>{t.setProductDetails(e)}),Wm=e}},{key:"setPurchaseInProgress",value:function(e){this.providers.forEach(t=>{t.setPurchaseInProgress(e)})}},{key:"setIsLoggedIn",value:function(e){this.providers.forEach(t=>{t.setIsLoggedIn(e)})}},{key:"setPurchase",value:function(e,t){this.providers.forEach(n=>{n.setPurchase(e,t)})}},{key:"getSelectedSlideIndex",value:function(){var e;return null===(e=this.providers[0])||void 0===e?void 0:e.state.currentSlideIndex}}])}(km);Bm.providers=[];var zm=c(function e(){o(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}});zm.instance=new zm;var Um=()=>mo(zi([...Po.getNamiEntitlements(kt),...Po.getNamiEntitlements(Ct)]),"referenceId"),Hm=()=>{Sc.getInstance().emit(Mi,Um())};function Gm(e){return{id:e.id,skuId:e.sku_ref_id,name:e.name,type:e.sku_type||"unknown",entitlements:e.entitlements,productDetails:"product_details"in e?e.product_details:null}}var Vm=function(){return c(function e(){o(this,e)},[{key:"fetchActiveEntitlements",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(e=null,Qc()||gu(Pe.THIRD_PARTY_TRANSACTIONS)||!gu(Pe.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=Po.getDevice())||!t.id){i.n=2;break}return i.n=1,a(this.getAPIEntitlements(t.id));case 1:n=i.v,(e=null==n?void 0:n.results)&&(Po.setActiveEntitlements(bt,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:Qc()&&Bi.debug("Skipping active entitlements update - anonymous mode");case 4:return i.a(2,e)}},null,this,null,Promise)}},{key:"getAPIEntitlements",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return t=`device/${e}/active_entitlements/`,n={},r.p=1,r.n=2,a(il.instance.fetchAPI(t));case 2:n=r.v,r.n=4;break;case 3:throw r.p=3,i=r.v,Bi.error(zo(i.status,t)),i;case 4:return r.a(2,n)}},null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){wu()&&(e=>{Po.setNamiEntitlements(kt,e);var t=Po.getNamiEntitlements(Ct),n=new Set(e.map(e=>e.referenceId)),i=t.filter(e=>{var t=n.has(e.referenceId);return t&&Bi.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t});i.length!==t.length&&Po.setNamiEntitlements(Ct,i),Hm()})(e.map(e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:zm.instance.refIdToRelatedSKUs[t]||[],activePurchases:zm.instance.refIdToActivePurchases[t]||[],purchasedSkus:zm.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e)))}}])}();Vm.instance=new Vm;var Km=function(){return c(function e(){o(this,e)},[{key:"fetchCustomerJourneyState",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(!Qc()){r.n=1;break}return Bi.debug("Skipping customer journey state update - anonymous mode"),r.a(2,null);case 1:if(null!=(e=Po.getDevice())&&e.id){r.n=2;break}return r.a(2,null);case 2:return t=`device/${e.id}/profile/`,n=null,r.p=3,r.n=4,a(il.instance.fetchAPI(t,void 0,0));case 4:n=r.v,r.n=6;break;case 5:throw r.p=5,i=r.v,Bi.error(zo(i.status,t)),i;case 6:if(!n){r.n=7;break}return Po.setCustomerJourneyState(n.customer_journey_state),r.a(2,n.customer_journey_state);case 7:return r.a(2,null)}},null,null,[[3,5]],Promise)}}])}();Km.instance=new Km;var Ym="[NamiStartup]",Xm=function(){return c(function e(){o(this,e),this.enabled=!1,this.t0=0,this.lastMark=0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1},[{key:"start",value:function(e){var t;this.enabled=null!==(t=null==e?void 0:e.includes(Cn))&&void 0!==t&&t,this.enabled&&(this.t0=Date.now(),this.lastMark=this.t0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1)}},{key:"mark",value:function(e,t){if(this.enabled){var n=Date.now(),i=n-this.lastMark;this.lastMark=n,"initial_config_decoded"===e?this.decodeDuration=i:"initial_processed"===e&&(this.processDuration=i,void 0!==(null==t?void 0:t.count)&&(this.placements=t.count));var a=t?" "+Object.entries(t).map(([e,t])=>`${e}=${t}`).join(" "):"";if("ready"===e){var r=n-this.t0;Bi.info(`${Ym} phase=${e} ms=${i} total_to_ready=${r}${a}`),Bi.info(`${Ym} SUMMARY total_to_ready=${r} decode=${this.decodeDuration} process=${this.processDuration} placements=${this.placements}`)}else Bi.info(`${Ym} phase=${e} ms=${i}${a}`)}}},{key:"firstLaunchLookup",value:function(e,t){if(!this.enabled||this.firstLaunchLogged)return t();this.firstLaunchLogged=!0;var n=Date.now(),i=t(),a=Date.now()-n;return Bi.info(`${Ym} phase=first_launch_lookup ms=${a} label=${e}`),i}},{key:"serverFetch",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.n){case 0:if(this.enabled){r.n=1;break}return r.a(2,e());case 1:return t=Date.now(),r.n=2,a(e());case 2:return n=r.v,i=Date.now()-t,Bi.info(`${Ym} phase=server_fetch ms=${i} campaigns=${n.length}`),r.a(2,n)}},null,this,null,Promise)}}])}(),qm=new Xm,Jm=function(){return c(function e(t){o(this,e),this.now=t,this.handle=null,this.fire=null,this.deadline=0,this.remaining=null},[{key:"isPending",get:function(){return null!==this.fire}},{key:"isPaused",get:function(){return null!==this.fire&&null===this.handle}},{key:"start",value:function(e,t){this.cancel(),this.fire=t,this.arm(e)}},{key:"startPaused",value:function(e,t){this.cancel(),this.fire=t,this.remaining=Math.max(0,e)}},{key:"pause",value:function(){null!==this.handle&&(this.remaining=Math.max(0,this.deadline-this.now()),this.disarm())}},{key:"resume",value:function(){if(null!==this.fire&&null===this.handle&&null!==this.remaining){var e=this.remaining;this.remaining=null,this.arm(e)}}},{key:"cancel",value:function(){this.disarm(),this.fire=null,this.remaining=null}},{key:"arm",value:function(e){var t=Math.max(0,e);this.deadline=this.now()+t,this.handle=setTimeout(()=>{var e=this.fire;this.handle=null,this.fire=null,this.remaining=null,null==e||e()},t)}},{key:"disarm",value:function(){null!==this.handle&&clearTimeout(this.handle),this.handle=null}}])}(),Qm=864e5,Zm={high:0,medium:1,low:2},ef=(e,t,n)=>e===n?t:0,tf=function(){return c(function e(t={}){o(this,e),this.options=t},[{key:"dayKey",value:function(e){var t,n,i=null===(t=(n=this.options).timeZone)||void 0===t?void 0:t.call(n);if(!i)return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;var a=new Intl.DateTimeFormat("en-US",{timeZone:i,calendar:"gregory",numberingSystem:"latn",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),r=e=>{var t,n;return null!==(t=null===(n=a.find(t=>t.type===e))||void 0===n?void 0:n.value)&&void 0!==t?t:""};return`${r("year").padStart(4,"0")}-${r("month")}-${r("day")}`}},{key:"select",value:function({event:e,journeys:t,snapshot:n,settings:i,isContentActive:a,now:r}){for(var o,s=this.dayKey(r),u={},l=[],d=new Set,c=h(t);!(o=c()).done;){var m=o.value,f=Hd(m.journey);if(f&&!d.has(f.journey_id)){d.add(f.journey_id);var v=this.perJourneyRejection(m,f,e,n,i,s,r);v?u[f.journey_id]=v:l.push({rule:m,journey:f})}}var p=this.globalRejection(n.global,i,a,s,r);if(p){for(var g,y=h(l);!(g=y()).done;){u[g.value.journey.journey_id]=p}return{winner:null,rejections:u}}for(var b=null,w=0,k=l;w<k.length;w++){var S=k[w];(!b||Zm[S.journey.priority]<Zm[b.journey.priority])&&(b=S)}for(var E=0,P=l;E<P.length;E++){var _=P[E];_!==b&&(u[_.journey.journey_id]="outranked")}return{winner:b,rejections:u}}},{key:"perJourneyRejection",value:function(e,t,n,i,a,r,o){var s;if(!Gd(t)||t.trigger.event_type!==n)return"triggerMismatch";if(!Nd(e.not_before,e.expires_at,o))return"outsideWindow";var u=null!==(s=i.journeys[t.journey_id])&&void 0!==s?s:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null},l=t.delivery,d=t.goal,c=o.getTime();if(l.show_once){if(u.impressionsTotal>=1)return"shownOnce"}else{var h,m;if(null!=l.max_impressions_total&&u.impressionsTotal>=l.max_impressions_total)return"totalCap";var f=Math.min(null!==(h=l.max_per_session)&&void 0!==h?h:a.max_per_session,a.max_per_session),v=Math.min(null!==(m=l.max_per_day)&&void 0!==m?m:a.max_per_day,a.max_per_day);if(ef(u.sessionKey,u.sessionCount,i.global.sessionOrdinal)>=f)return"sessionCap";if(ef(u.dayKey,u.dayCount,r)>=v)return"dayCap";var p=null==d?void 0:d.re_eligibility_days;if(null!=p&&null!=u.lastDismissedAt&&c<u.lastDismissedAt+p*Qm)return"reEligibility"}if(null!=u.goalAchievedAt&&(l.show_once||!0!==(null==d?void 0:d.re_entry_after_goal)))return"goalAchieved";var g=null==d?void 0:d.timeout_days;return null!=g&&null!=u.enteredAt&&c>=u.enteredAt+g*Qm?"timedOut":null}},{key:"globalRejection",value:function(e,t,n,i,a){return ef(e.sessionKey,e.sessionCount,e.sessionOrdinal)>=t.max_per_session?"globalSessionCap":ef(e.dayKey,e.dayCount,i)>=t.max_per_day?"globalDayCap":null!=e.lastAnyImpressionAt&&a.getTime()<e.lastAnyImpressionAt+1e3*t.cooldown_seconds?"cooldown":t.suppress_when_active&&n?"suppressed":null}},{key:"recordImpression",value:function(e,t,n){var i,a,r=this.dayKey(n),o=e.global.sessionOrdinal,s=null!==(i=e.journeys[t])&&void 0!==i?i:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null},u=this.recordExternalImpression(e,n);return this.withRecord(u,t,m({},s,{impressionsTotal:s.impressionsTotal+1,sessionKey:o,sessionCount:ef(s.sessionKey,s.sessionCount,o)+1,dayKey:r,dayCount:ef(s.dayKey,s.dayCount,r)+1,enteredAt:null!==(a=s.enteredAt)&&void 0!==a?a:n.getTime()}))}},{key:"recordExternalImpression",value:function(e,t){var n=this.dayKey(t),i=e.global;return m({},e,{global:m({},i,{sessionKey:i.sessionOrdinal,sessionCount:ef(i.sessionKey,i.sessionCount,i.sessionOrdinal)+1,dayKey:n,dayCount:ef(i.dayKey,i.dayCount,n)+1,lastAnyImpressionAt:t.getTime()})})}},{key:"recordDismiss",value:function(e,t,n){var i;return this.withRecord(e,t,m({},null!==(i=e.journeys[t])&&void 0!==i?i:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null},{lastDismissedAt:n.getTime()}))}},{key:"isGoalOpen",value:function(e,t,n){var i;if(null==(null==e?void 0:e.enteredAt))return!1;var a=null===(i=t.goal)||void 0===i?void 0:i.timeout_days;return null==a||n.getTime()<e.enteredAt+a*Qm}},{key:"recordGoal",value:function(e,t,n){var i;return this.withRecord(e,t,m({},null!==(i=e.journeys[t])&&void 0!==i?i:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null},{goalAchievedAt:n.getTime(),enteredAt:null}))}},{key:"withRecord",value:function(e,t,n){return m({},e,{journeys:m({},e.journeys,{[t]:n})})}}])}(),nf=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),af=e=>"number"==typeof e&&Number.isFinite(e)?e:null,rf=e=>"string"==typeof e?e:null;function of(e){var t,n,i;return nf(e)?{impressionsTotal:null!==(t=af(e.impressionsTotal))&&void 0!==t?t:0,sessionKey:af(e.sessionKey),sessionCount:null!==(n=af(e.sessionCount))&&void 0!==n?n:0,dayKey:rf(e.dayKey),dayCount:null!==(i=af(e.dayCount))&&void 0!==i?i:0,lastDismissedAt:af(e.lastDismissedAt),goalAchievedAt:af(e.goalAchievedAt),enteredAt:af(e.enteredAt)}:{impressionsTotal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastDismissedAt:null,goalAchievedAt:null,enteredAt:null}}function sf(e){var t,n,i;return nf(e)?{sessionOrdinal:null!==(t=af(e.sessionOrdinal))&&void 0!==t?t:0,sessionKey:af(e.sessionKey),sessionCount:null!==(n=af(e.sessionCount))&&void 0!==n?n:0,dayKey:rf(e.dayKey),dayCount:null!==(i=af(e.dayCount))&&void 0!==i?i:0,lastAnyImpressionAt:af(e.lastAnyImpressionAt)}:{sessionOrdinal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastAnyImpressionAt:null}}var uf={snapshot:()=>function(e){if(!nf(e)||!nf(e.journeys))return{journeys:{},global:{sessionOrdinal:0,sessionKey:null,sessionCount:0,dayKey:null,dayCount:0,lastAnyImpressionAt:null}};for(var t={},n=0,i=Object.entries(e.journeys);n<i.length;n++){var a=i[n],r=a[0],o=a[1];t[r]=of(o)}return{journeys:t,global:sf(e.global)}}(Po.getJourneyRuleState()),update(e){var t=e(this.snapshot());return Po.setJourneyRuleState(t),t},startSession(){this.update(e=>m({},e,{global:m({},e.global,{sessionOrdinal:e.global.sessionOrdinal+1})}))},clear(){Po.removeJourneyRuleState()}},lf=function(){function e(){o(this,e)}return c(e,[{key:"previous",get:function(){return this._previous}},{key:"record",value:function(e){this._previous=this._current,this._current=e}},{key:"reset",value:function(){this._current=void 0,this._previous=void 0}}],[{key:"shared",get:function(){return this._shared||(this._shared=new e),this._shared}}])}(),df=()=>!1,cf=()=>Bm.providers.length>0||df(),hf=()=>{var e,t,n;return null===(e=null===(t=(n=we().device).isAppVisible)||void 0===t?void 0:t.call(n))||void 0===e||e};var mf=null,ff={now:()=>new Date,monotonicNow:()=>"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now(),journeys:ic,settings:()=>{var e,t,n,i,a,r=Po.getAppConfig(lt)||Po.getAppConfig(Et),o=null==r?void 0:r.journey_settings;return{max_per_session:null!==(e=null==o?void 0:o.max_per_session)&&void 0!==e?e:_e,max_per_day:null!==(t=null==o?void 0:o.max_per_day)&&void 0!==t?t:Te,cooldown_seconds:null!==(n=null==o?void 0:o.cooldown_seconds)&&void 0!==n?n:Me,refresh_interval_seconds:null!==(i=null==o?void 0:o.refresh_interval_seconds)&&void 0!==i?i:Ae,suppress_when_active:null!==(a=null==o?void 0:o.suppress_when_active)&&void 0!==a?a:De}},contentActive:cf,isAppVisible:hf,present:function(e,t){var n,i,a=we().ui,r=t=>(Bi.debug(`Journey raise skipped for rule ${e.rule}: ${t}`),!1);if(!t())return r("Nami.reset() ran after it fired");if(cf())return r("a paywall or flow is already open");if(!hf())return r("the app is not visible");if(!a.presentCampaign)return r("this platform cannot present a journey");if(e.flow){if(!e.flow.object||!ll(null!==(i=e.flow.object.screens)&&void 0!==i?i:[]))return r("its flow screens are not available")}else if(!e.paywall||!ul(e.paywall))return r("its paywall is not available");return lf.shared.record({placementLabel:"",tags:null!==(n=e.placement_tags)&&void 0!==n?n:[],customAttributes:{}}),Po.setLaunchId(Yu()),a.presentCampaign(e,{customAttributes:{}})},deliveryDisabled:()=>{var e,t,n=null===(e=Po.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(Rn))&&void 0!==t&&t},installMarker:{get:()=>Po.getJourneyInstallEvaluated(),set:()=>Po.setJourneyInstallEvaluated()},refresh:()=>{var e,t;return null!==(e=null===(t=mf)||void 0===t?void 0:t.fetchCampaignsAndPaywalls())&&void 0!==e?e:Promise.resolve()},refreshAllowed:()=>{var e,t;return!(null!==(e=null===(t=mf)||void 0===t?void 0:t.isStartupInFlight())&&void 0!==e&&e)},refreshEnabled:()=>{var e,t;return null!==(e=null===(t=mf)||void 0===t?void 0:t.canRefreshJourneys())&&void 0!==e&&e&&ic().length>0}},vf=function(){return c(function e(t){o(this,e),this.env=t,this.engine=new tf,this.resetGeneration=0,this.backgroundedAt=null,this.refreshInFlight=!1,this.refreshPending=!1,this.refreshDeferred=!1,this.refreshTimer=null,this.delay=new Jm(t.monotonicNow)},[{key:"generation",get:function(){return this.resetGeneration}},{key:"isDelayPaused",get:function(){return this.delay.isPaused}},{key:"sessionStarted",value:function(e,t){void 0===t||t===this.resetGeneration?(uf.startSession(),this.evaluate(e),this.startRefreshTimer()):Bi.debug("Journey session start dropped: Nami.reset() ran during the startup pass")}},{key:"appDidEnterBackground",value:function(){var e;this.delay.pause(),this.stopRefreshTimer(),null!==(e=this.backgroundedAt)&&void 0!==e||(this.backgroundedAt=this.env.monotonicNow())}},{key:"appWillEnterForeground",value:function(){var e=this.backgroundedAt;return this.backgroundedAt=null,this.delay.resume(),this.startRefreshTimer(),null!==e&&this.env.monotonicNow()-e>=si}},{key:"placementWillRaise",value:function(){this.delay.cancel()}},{key:"reset",value:function(){this.delay.cancel(),this.stopRefreshTimer(),this.backgroundedAt=null,this.resetGeneration+=1,this.refreshInFlight=!1,this.refreshPending=!1,this.refreshDeferred=!1}},{key:"externalImpressionRegistered",value:function(){uf.update(e=>this.engine.recordExternalImpression(e,this.env.now()))}},{key:"flowCompletionSignaled",value:function(e){var t,n=e?Kd(e):null;return!("flow_completed"!==(null==n||null===(t=n.goal)||void 0===t?void 0:t.type)||!this.goalReached(n))&&(this.requestRefresh(),!0)}},{key:"customerAttributeSet",value:function(e,t){for(var n,i=!1,a=h(this.env.journeys());!(n=a()).done;){var r,o=n.value,s=Kd(o);"user_context_set"===(null==s||null===(r=s.goal)||void 0===r?void 0:r.type)&&s.goal.context_key===e&&(i=this.goalReached(s)||i)}(t||i)&&this.requestRefresh()}},{key:"goalReached",value:function(e){var t=e.journey_id,n=this.env.now();return this.engine.isGoalOpen(uf.snapshot().journeys[t],e,n)?(uf.update(e=>this.engine.recordGoal(e,t,n)),Bi.debug(`Journey ${t} goal achieved`),!0):(Bi.debug(`Journey ${t} goal ignored: not entered, already achieved or timed out`),!1)}},{key:"requestRefresh",value:function(e=!1){this.env.refreshEnabled()&&(this.refreshInFlight?this.refreshPending=!0:this.env.refreshAllowed()?this.startRefresh():e&&(this.refreshDeferred=!0))}},{key:"startupPassFinished",value:function(){this.refreshDeferred&&(this.refreshDeferred=!1,this.env.refreshEnabled()&&(this.refreshInFlight?this.refreshPending=!0:this.startRefresh()))}},{key:"startRefresh",value:function(){this.refreshInFlight=!0;var e,t=this.resetGeneration,n=()=>{this.resetGeneration===t&&(this.refreshInFlight=!1,this.refreshPending&&(this.refreshPending=!1,this.requestRefresh(!0)))};try{e=this.env.refresh()}catch(t){e=Promise.reject(t)}e.then(n,e=>{Bi.warn(`Journey refresh failed: ${e}`),n()})}},{key:"startRefreshTimer",value:function(){var e;if(null===this.refreshTimer&&this.env.isAppVisible()){var t=1e3*this.env.settings().refresh_interval_seconds;if(t>0){var n=setInterval(()=>this.requestRefresh(),t);null===(e=n.unref)||void 0===e||e.call(n),this.refreshTimer=n}}}},{key:"stopRefreshTimer",value:function(){null!==this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null)}},{key:"evaluate",value:function(e){var t=null;if(e&&!this.env.installMarker.get()){var n=this.select("app_install");n&&(t={event:"app_install",winner:n})}if(e&&this.env.installMarker.set(),!t){var i=this.select("session_start");i&&(t={event:"session_start",winner:i})}if(t){var a=t,r=a.event,o=a.winner,s=o.journey.journey_id;if(this.delay.isPending)Bi.debug(`Journey ${s} dropped: another journey is waiting for its delay`);else{var u=Math.max(0,1e3*o.journey.delivery.delay_seconds),l=()=>this.fire(r,s);this.env.isAppVisible()?this.delay.start(u,l):(Bi.debug(`Journey ${s} held: the app is not visible, its delay starts paused`),this.delay.startPaused(u,l))}}}},{key:"decide",value:function(e,t){return this.engine.select({event:e,journeys:t,snapshot:uf.snapshot(),settings:this.env.settings(),isContentActive:this.env.contentActive(),now:this.env.now()})}},{key:"select",value:function(e){var t=this.decide(e,this.env.journeys()),n=t.winner,i=t.rejections;return!n&&Object.keys(i).length>0&&Bi.debug(`No ${e} journey selected: ${JSON.stringify(i)}`),n}},{key:"fire",value:function(e,t){if(this.env.isAppVisible()){var n=this.env.journeys().find(e=>(e=>{var t;return null===(t=Kd(e))||void 0===t?void 0:t.journey_id})(e)===t);if(n){var i=this.decide(e,[n]),a=i.winner,r=i.rejections;if(a)if(this.env.deliveryDisabled())Bi.debug(`Journey ${t} not delivered: disableJourneyDelivery is set`);else{var o=this.resetGeneration,s=()=>this.resetGeneration===o;this.env.present(a.rule,s)&&s()&&uf.update(e=>this.engine.recordImpression(e,t,this.env.now()))}else Bi.debug(`Journey ${t} dropped at fire time: ${r[t]}`)}else Bi.debug(`Journey ${t} dropped at fire time: no longer in the journey rules`)}else this.delay.startPaused(0,()=>this.fire(e,t))}}])}();vf.shared=new vf(ff);var pf=function(){return c(function e(){o(this,e),this.inMemoryAnonymousMode=!1,this.isFirstSession=!1,this.startupDisabled=!1,this.hasInitialConfig=!1,this.lastConfig=null,this.lastStartupRunAt=0,this.startupInFlight=!1,this.startupFetch=Promise.resolve(),qc=this,mf=this},[{key:"isStartupInFlight",value:function(){return this.startupInFlight}},{key:"canRefreshJourneys",value:function(){var e;return!(null===(e=this.lastConfig)||void 0===e||null===(e=e.appPlatformID)||void 0===e||!e.trim()||this.startupDisabled)}},{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,Bi.info(`In-memory anonymous mode ${e?"enabled":"disabled"} due to failed device registration`)}},{key:"isInMemoryAnonymousMode",value:function(){return this.inMemoryAnonymousMode}},{key:"isAnonymousMode",value:function(){return Po.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"getIsFirstSession",value:function(){return this.isFirstSession}},{key:"isStartupDisabled",value:function(){return this.startupDisabled}},{key:"init",value:function(e){var t,n;return k(function(i){for(;;)switch(i.p=i.n){case 0:return this.isFirstSession=this.hasNoDevice(),n=vf.shared.generation,this.startupDisabled=!1,this.hasInitialConfig=Object.keys(null!==(t=e.initialConfig)&&void 0!==t?t:{}).length>0,this.setInitialValues(e),this.lastConfig=e,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,i.p=1,i.n=2,a(this.fetchPlatformConfig());case 2:if(i.v){i.n=3;break}return i.a(2);case 3:return i.p=3,i.n=4,a(this.runStartupAfterConfig(e));case 4:return i.p=4,this.startJourneySession(this.isFirstSession,n),i.f(4);case 5:return i.p=5,this.startupInFlight=!1,vf.shared.startupPassFinished(),i.f(5);case 6:return i.a(2)}},null,this,[[3,,4,5],[1,,5,6]],Promise)}},{key:"foreground",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return e=vf.shared,t=e.appWillEnterForeground(),n=t&&null!==this.lastConfig&&!this.startupInFlight,i=e.generation,r=this.hasNoDevice(),o.n=1,a(this.resume());case 1:n&&!this.startupDisabled&&this.startJourneySession(r,i);case 2:return o.a(2)}},null,this,null,Promise)}},{key:"hasNoDevice",value:function(){return null===Po.getDevice()&&!Po.getAnonymousMode()}},{key:"startJourneySession",value:function(e,t){this.startupFetch.then(()=>vf.shared.sessionStarted(e,t))}},{key:"resume",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(this.lastConfig&&!this.startupInFlight){r.n=1;break}return r.a(2);case 1:if(!(Date.now()-this.lastStartupRunAt<ri)){r.n=2;break}return Bi.debug("Resuming too quickly to call the service."),r.a(2);case 2:return e=this.lastConfig,t=this.startupDisabled,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,this.startupDisabled=!1,r.p=3,r.n=4,a(this.fetchPlatformConfig());case 4:if(n=!r.v){r.n=5;break}n=!t;case 5:if(!n){r.n=6;break}return r.a(2);case 6:return Bi.info("Usable app config on resume - completing the startup that stopped at launch"),r.n=7,a(this.runStartupAfterConfig(e));case 7:r.n=9;break;case 8:r.p=8,i=r.v,Bi.warn(`Resume refresh failed: ${i}`);case 9:return r.p=9,this.startupInFlight=!1,vf.shared.startupPassFinished(),r.f(9);case 10:return r.a(2)}},null,this,[[3,8,9,10]],Promise)}},{key:"runStartupAfterConfig",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.initAndFetchRequiredData(e));case 1:Zc.instance.startSession();case 2:return t.a(2)}},null,this,null,Promise)}},{key:"clearResumeState",value:function(){this.lastConfig=null,this.lastStartupRunAt=0,this.startupDisabled=!1}},{key:"fetchPlatformConfig",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(Vc.instance.fetchConfigForStartup(this.hasInitialConfig));case 1:if((e=t.v).usable){t.n=2;break}return this.startupDisabled=!0,Bi.error(`Nami startup stopped: ${e.reason}`),t.a(2,!1);case 2:return t.a(2,!0)}},null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=m({},e);delete t.initialConfig,Po.clearSessionId(),Po.setNamiConfig(t),Po.setLanguageCode(e.namiLanguageCode),Po.setPurchaseChannel(e.purchaseChannel);var n,i=e.initialConfig;if(i.appConfig||i.platform_config){var a=(null==i?void 0:i.appConfig)||(null==i?void 0:i.platform_config);a&&Po.setAppConfig(Et,a)}null!=i&&i.paywalls&&(Po.setPaywalls(Mt,i.paywalls.map(e=>m({},e,{fetchSource:"initialConfig"}))),null!==(n=i.campaign_rules)&&void 0!==n&&n.length&&Uc.instance.seedFromInitialConfig(i.campaign_rules,i.paywalls));null!=i&&i.products&&Po.setProducts(Dt,i.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:_c.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=m({},Vu(e.namiCommands),e.formFactor?{form_factor:e.formFactor}:{}),n=function(e){if(e){var t=e.find(e=>e.startsWith("splitPosition="));if(t){var n=t.split("=")[1],i=Number(n);return n&&!isNaN(i)?Ju(i):void 0}}}(e.namiCommands),i=_c.instance.createOrUpdateDevice(t,n,this);return{deviceId:i.id,deviceTask:i.device}}},{key:"initAndFetchRequiredData",value:function(e,t=0,n=1){var i,r,o,s,u,l,d,c,h,m,f,v;return k(function(p){for(;;)switch(p.n){case 0:if(s=e.initialConfig,u=null!==(i=e.formFactor)&&void 0!==i?i:Ku(),l=this.isAnonymousMode(),d=l?this.initAnonymousDevice():this.initIdentifiedDevice(e),c=d.deviceId,h=d.deviceTask,m=Xu(c),s.campaign_rules&&(f=Qd(s.campaign_rules,m,u),Po.setCampaignRules(_t,f),qm.mark("initial_processed",{count:f.length})),!h){p.n=1;break}return p.n=1,a(h);case 1:if(Ec.instance.configure(u,m,e.namiCommands),bu(),v=Promise.all([Tc.instance.fetchProducts(),Km.instance.fetchCustomerJourneyState(),Vm.instance.fetchActiveEntitlements(),qm.serverFetch(()=>this.fetchCampaignsAndPaywalls())]).catch(i=>{var r;return k(function(o){for(;;)switch(o.n){case 0:if(!(i instanceof Mo)){o.n=3;break}if(Po.resetDevice(),!(t<n)){o.n=2;break}return r=100*Math.pow(2,t),o.n=1,a(new Promise(e=>setTimeout(e,r)));case 1:return o.a(2,this.initAndFetchRequiredData(e,t+1,n));case 2:if(l){o.n=3;break}return Bi.warn(`Max retries reached for ConflictError. ${i.message}`),this.setInMemoryAnonymousMode(!0),o.a(2,this.initAndFetchRequiredData(e,0,n));case 3:throw i;case 4:return o.a(2)}},null,this,null,Promise)}),this.startupFetch=v.then(()=>{},()=>{}),null!==(r=s.campaign_rules)&&void 0!==r&&r.length&&null!==(o=s.paywalls)&&void 0!==o&&o.length){p.n=2;break}return p.n=2,a(v);case 2:v.then(()=>this.reRenderPaywall());case 3:return p.a(2)}},null,this,null,Promise)}},{key:"fetchCampaignsAndPaywalls",value:function(){var e,t,n,i,r,o,s,u,l,d,c,h,m,f,v,p;return k(function(g){for(;;)switch(g.n){case 0:return e=Ec.instance,t=Uc.instance,n=Date.now(),i=Date.now(),g.n=1,a(e.fetchCampaignRulesRaw());case 1:return r=g.v,o=r.campaigns,s=r.fromNetwork,u=Date.now()-i,g.n=2,a(Promise.all(o.filter(e=>{var t;return(null===(t=e.flow)||void 0===t?void 0:t.url)&&!e.flow.object}).map(e=>{var t,n;return k(function(i){for(;;)switch(i.p=i.n){case 0:return i.p=0,i.n=1,a(Wc(e.flow.url));case 1:t=i.v,e.flow.object=t.data,i.n=3;break;case 2:i.p=2,n=i.v,Bi.warn(`Error fetching flow object from ${e.flow.url}: ${n}`);case 3:return i.a(2)}},null,null,[[0,2]],Promise)})));case 2:if(l=!e.useLegacyPaywallFetch&&Ec.hasPaywallUrls(o),c=null,h=Date.now(),!l||s){g.n=3;break}Bi.info("Paywall resolution skipped: campaign_rules were served from the stored copy"),d=ol(),g.n=7;break;case 3:if(!l){g.n=5;break}return m=Ec.extractPaywallUrls(o),g.n=4,a(t.resolvePaywallsByUrls(m));case 4:c=g.v,d=c.paywalls,wo.reconcile(new Set(m)),g.n=7;break;case 5:return g.n=6,a(t.fetchPaywalls());case 6:d=g.v;case 7:return f=Date.now()-h,v=Date.now()-n,l&&!c||(p=c?`, urls=${c.urls}, hashed=${c.hashed}, cache_hits=${c.cacheHits}, fetched=${c.fetched}, cache_after_fetch_failure=${c.cacheAfterFetchFailure}, failed=${c.failed}`:"",Bi.debug(`Paywall fetch telemetry: strategy=${l?"individual":"bulk"}, count=${d.length}${p}, total=${v}ms, campaigns=${u}ms, paywalls=${f}ms`+(c?`, retry_count=${c.retryCount}`:""))),c&&t.renewCacheHits(c),g.a(2,e.finalizeCampaignRules(o,d))}},null,null,null,Promise)}},{key:"reRenderPaywall",value:function(){we().ui.reRenderPaywall()}}])}();function gf(e){return Array.isArray(e)?e.map(gf):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=gf(n)),e),{}):e}function yf(e,t){return Pc(gf(e),gf(t))}pf.instance=new pf;var bf,wf,kf,Sf=function(){return c(function e(){o(this,e),this.load()},[{key:"setExternalId",value:function(e){return this.externalId=e,this}},{key:"getExternalId",value:function(){return this.externalId}},{key:"isLoggedIn",value:function(){return!!this.externalId}},{key:"save",value:function(){return this.externalId?Po.setNamiProfile({externalId:this.externalId}):Po.removeNamiProfile(),this}},{key:"load",value:function(){var e=Po.getNamiProfile();e&&(this.externalId=e.externalId),Bm.setIsLoggedIn(!!this.externalId)}},{key:"loginLocal",value:function(e){this.setExternalId(e).save(),Bm.setIsLoggedIn(!0)}},{key:"loginRemote",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return n.n=1,a(il.instance.login(e));case 1:(t=n.v).external_id&&t.external_id!==this.externalId&&this.setExternalId(t.external_id).save();case 2:return n.a(2)}},null,this,null,Promise)}},{key:"logoutLocal",value:function(){this.setExternalId(void 0).save(),Bm.setIsLoggedIn(!1)}},{key:"logoutRemote",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(il.instance.logout());case 1:return e.a(2)}},null,null,null,Promise)}},{key:"login",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return this.loginLocal(e),t.n=1,a(this.loginRemote(e));case 1:return t.a(2)}},null,this,null,Promise)}},{key:"logout",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return this.logoutLocal(),e.n=1,a(this.logoutRemote());case 1:return e.a(2)}},null,this,null,Promise)}}])}();Sf.instance=new Sf;var Ef=function(){function e(){o(this,e),bf.set(this,!1),wf.set(this,null),kf.set(this,null),this.maxLogging=!1}return c(e,[{key:"isInitialized",get:function(){return Se(this,bf,"f")||null!=Po.getNamiConfig()}},{key:"listenForAppForeground",value:function(){var e,t,n,i,a=we().device;Se(this,wf,"f")||Ee(this,wf,null!==(e=null===(t=a.onAppForeground)||void 0===t?void 0:t.call(a,()=>{pf.instance.foreground()}))&&void 0!==e?e:null);Se(this,kf,"f")||Ee(this,kf,null!==(n=null===(i=a.onAppBackground)||void 0===i?void 0:i.call(a,()=>vf.shared.appDidEnterBackground()))&&void 0!==n?n:null)}},{key:"initializeSDK",value:function(t){var n,i,r,o,s,u,l,d,c,h;return k(function(f){for(;;)switch(f.n){case 0:if(o=!1,s=!1,u=Se(this,bf,"f")?Po.getNamiConfig():null,Bi.setLogger(t.logLevel),e.instance.maxLogging=null!==(n=t.maxLogging)&&void 0!==n&&n,null===u){f.n=3;break}if(delete(l=m({},t)).initialConfig,!yf(l,u)){f.n=1;break}return Bi.warn("Nami SDK is already configured, ignoring this configure call."),f.a(2,{sdkInitialized:!0,configureState:ki});case 1:s=!0;case 2:d=pu(t.namiCommands),c=pu(u.namiCommands),t.appPlatformID==u.appPlatformID&&d==c||(o=!0),t.namiLanguageCode===u.namiLanguageCode&&t.logLevel==u.logLevel||(s=!0);case 3:return o&&(Bi.info("SDK full reconfigure called"),Po.resetDevice()),Ee(this,bf,!0),il.configure(t),this.listenForAppForeground(),f.n=4,a(pf.instance.init(t));case 4:return Bi.info("SDK successfully initialized!"),h=s||o?bi:gi,null===(i=(r=we().ui).postConfigure)||void 0===i||i.call(r),qm.mark("ready"),f.a(2,{sdkInitialized:!0,configureState:h})}},null,this,null,Promise)}}],[{key:"sdkVersion",value:function(){return Le}},{key:"sdkPackageVersion",value:function(){return Re}},{key:"reset",value:function(){var t,n,i,r,o,s,u;return k(function(l){for(;;)switch(l.n){case 0:return vf.shared.reset(),Po.clearAll(),wo.purgeAll(),Jc(),Ee(e.instance,bf,!1),null===(t=Se(o=e.instance,wf,"f"))||void 0===t||t.call(o),Ee(e.instance,wf,null),null===(n=Se(s=e.instance,kf,"f"))||void 0===n||n.call(s),Ee(e.instance,kf,null),pf.instance.clearResumeState(),Sf.instance.setExternalId(void 0),Bm.reset(),il.reset(),Ec.instance.reset(),lf.shared.reset(),l.n=1,a(Promise.resolve().then(function(){return Lv}));case 1:u=l.v,u.NamiFlowManager.reset(),null===(i=(r=we().ui).onReset)||void 0===i||i.call(r);case 2:return l.a(2)}},null,null,null,Promise)}},{key:"registerExternalImpression",value:function(){e.instance.isInitialized?vf.shared.externalImpressionRegistered():Bi.warn("Nami.registerExternalImpression() ignored: call Nami.configure() first")}},{key:"configure",value:function(t){return k(function(n){for(;;)switch(n.n){case 0:if(qm.start(t.namiCommands),t.appPlatformID){n.n=1;break}throw new Do;case 1:return this.setInitialConfig(t),qm.mark("initial_config_decoded"),n.n=2,a(e.instance.initializeSDK(t));case 2:return n.a(2,n.v)}},null,this,null,Promise)}},{key:"setInitialConfig",value:function(e){if(null!=e.initialConfig){if("string"==typeof e.initialConfig){Bi.debug("[DEPRECATED] NamiConfiguration.initialConfig should be an object");var t=function(e){var t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(t)}catch(e){return}}(e.initialConfig);if(!t)return Bi.error("Failed to parse NamiConfiguration.initialConfig"),void(e.initialConfig={});e.initialConfig=t}if("object"!=typeof e.initialConfig)e.initialConfig={};else if((e=>"object"==typeof e&&"initial_config"in e)(e.initialConfig)){var n=Eu(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},Bi.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();bf=new WeakMap,wf=new WeakMap,kf=new WeakMap,Ef.instance=new Ef;var Pf,_f,Tf,Mf=new Set(["fullscreen","sheet","compact_sheet","modal"]);e.NamiPaywallManagerEvents=void 0,(Pf=e.NamiPaywallManagerEvents||(e.NamiPaywallManagerEvents={})).BuySku="RegisterBuySKU",Pf.Close="PaywallCloseRequested",Pf.SignIn="PaywallSignInRequested",Pf.Restore="PaywallRestoreRequested",Pf.DeeplinkAction="PaywallDeeplinkAction",e.NamiPaywallAction=void 0,(_f=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",_f.SELECT_SKU="SELECT_SKU",_f.RESTORE_PURCHASES="RESTORE_PURCHASES",_f.SIGN_IN="SIGN_IN",_f.CLOSE_PAYWALL="CLOSE_PAYWALL",_f.SHOW_PAYWALL="SHOW_PAYWALL",_f.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",_f.PURCHASE_SUCCESS="PURCHASE_SUCCESS",_f.PURCHASE_FAILED="PURCHASE_FAILED",_f.PURCHASE_CANCELLED="PURCHASE_CANCELLED",_f.PURCHASE_PENDING="PURCHASE_PENDING",_f.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",_f.PURCHASE_DEFERRED="PURCHASE_DEFERRED",_f.DEEPLINK="DEEPLINK",_f.TOGGLE_CHANGE="TOGGLE_CHANGE",_f.PAGE_CHANGE="PAGE_CHANGE",_f.SLIDE_CHANGE="SLIDE_CHANGE",_f.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",_f.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",_f.VIDEO_STARTED="VIDEO_STARTED",_f.VIDEO_PAUSED="VIDEO_PAUSED",_f.VIDEO_RESUMED="VIDEO_RESUMED",_f.VIDEO_ENDED="VIDEO_ENDED",_f.VIDEO_CHANGED="VIDEO_CHANGED",_f.VIDEO_MUTED="VIDEO_MUTED",_f.VIDEO_UNMUTED="VIDEO_UNMUTED",_f.COUNTDOWN_TIMER_COMPLETED="COUNTDOWN_TIMER_COMPLETED",_f.UNKNOWN="UNKNOWN",e.LaunchCampaignError=void 0,(Tf=e.LaunchCampaignError||(e.LaunchCampaignError={})).DEFAULT_CAMPAIGN_NOT_FOUND="Default campaign not found",Tf.LABELED_CAMPAIGN_NOT_FOUND="Labeled campaign not found",Tf.CAMPAIGN_DATA_NOT_FOUND="Campaign data not found",Tf.PAYWALL_ALREADY_DISPLAYED="Paywall is already being displayed",Tf.SDK_NOT_INITIALIZED="SDK has not been initialized",Tf.PAYWALL_COULD_NOT_DISPLAY="Failed to display paywall",Tf.URL_CAMPAIGN_NOT_FOUND="URL campaign not found",Tf.PRODUCT_DATA_NOT_FOUND="Product data not found",Tf.PRODUCT_GROUPS_NOT_FOUND="Product groups not found",Tf.FLOW_SCREEN_DATA_UNAVILABLE="Flow unavailable due to missing screen data";var Af,Df="entry",xf="screen",Cf="branch",If="exit",Lf="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.SET_TAGS_FROM_FORM="setTagsFromForm",e.PAUSE="flowPause",e.RESUME="flowResume",e.SET_LAUNCH_CONTEXT="setLaunchContext",e.SET_FLOW_PATH="setFlowPath"}(Af||(Af={}));var Ff="__handoff_sequence__",Rf={Push:"push",Location:"location",Tracking:"att",Deeplink:"deeplink",Complete:"complete",SignIn:"signin",Restore:"restore",SignInMvpd:"signin_mvpd",BuySku:"buysku",UserData:"userdata"};var Of={Push:"push",Location:"location",Tracking:"tracking",Camera:"camera",Microphone:"microphone",Photos:"photos",Contacts:"contacts",Bluetooth:"bluetooth",Calendar:"calendar",Biometrics:"biometrics",Health:"health",Motion:"motion",Speech:"speech",LocalNetwork:"localNetwork"},$f={[Of.Push]:"push_authorized",[Of.Location]:"location_authorized",[Of.Tracking]:"tracking_authorized"},Nf="__buy_sku__",Wf="__default__",jf="__appear__",Bf="__disappear__",zf="__login_success__",Uf="__login_failure__",Hf="__logout_success__",Gf="__logout_failure__",Vf="__purchase_success__",Kf="__purchase_failure__",Yf="__remoteback__",Xf="__tag_update__",qf="__permission_granted__",Jf="and",Qf="or",Zf="i_contains",ev="equals",tv="i_equals",nv="not_equals",iv="not_i_equals",av="not_contains",rv="contains",ov="set",sv="not_set",uv="greater_than",lv="greater_than_or_equal_to",dv="less_than",cv="less_than_or_equal_to";function hv(e){if("boolean"==typeof e)return null;if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){var t=e.trim();if(""===t)return null;var n=Number(t);return Number.isFinite(n)?n:null}return null}function mv(){var e;return()=>null!=e?e:e=Nm()}var fv=function(){function e(){o(this,e),this.resolvers=new Map,this.namespaceResolvers=new Map}return c(e,[{key:"registerNamespaceResolver",value:function(e,t){this.namespaceResolvers.set(e,t)}},{key:"resetResolvers",value:function(){this.resolvers.clear()}},{key:"evaluate",value:function(e){var t,n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;var i=mv(),a=n.map(e=>this.evaluateFilter(e,i));switch(e.operator){case Jf:return a.every(e=>e);case Qf:return a.some(e=>e);default:return a.every(e=>e)}}},{key:"evaluateOrdered",value:function(e){var t;if(!e)return!0;var n=null!==(t=e.filter)&&void 0!==t?t:[];if(0===n.length)return!0;var i=mv();switch(e.operator){case Jf:for(var a,r=h(n);!(a=r()).done;){var o=a.value;if(!this.evaluateFilter(o,i))return!1}return!0;case Qf:for(var s,u=h(n);!(s=u()).done;){var l=s.value;if(this.evaluateFilter(l,i))return!0}return!1;default:for(var d,c=h(n);!(d=c()).done;){var m=d.value;if(!this.evaluateFilter(m,i))return!1}return!0}}},{key:"evaluateFilter",value:function(e,t=mv()){if($m(e.identifier))return((e,t)=>{if(!$m(e.identifier)||Number.isNaN(t.getTime()))return!1;switch(e.identifier.slice(Gn.length)){case"dayOfWeek":if("equals"!==e.operator&&"not_equals"!==e.operator)return!1;var n=Lm(e.values,Cm);if(!n)return!1;var i=n.map(({zone:e})=>xm(t,e));if(i.some(e=>null===e))return!1;var a=n.some(({day:e},t)=>i[t].dayOfWeek===e);return"equals"===e.operator?a:!a;case"timeOfDay":var r=Om(e.operator),o=r?Lm(e.values,Im):null;if(!r||!o)return!1;var s=o.map(({zone:e})=>xm(t,e));return!s.some(e=>null===e)&&o.some(({minutes:e},t)=>r(s[t].minutes,e));case"now":var u=Om(e.operator),l=u?Lm(e.values,Am):null;return!(!u||!l)&&l.some(e=>u(t.getTime(),e.getTime()));default:return!1}})(e,t());var n=this.resolve(e.identifier);if(Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] resolve(${e.identifier}) → ${JSON.stringify(n)} (type: ${typeof n})`),e.operator===ov)return null!=n;if(e.operator===sv)return null==n;if(null==n)return Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] ${e.identifier} resolved to null — registeredNamespaces: [${[...this.namespaceResolvers.keys()].join(", ")}]`),!![nv,iv,av].includes(e.operator);switch(e.operator){case Zf:return Array.isArray(n)?e.values.some(e=>"string"==typeof e&&n.some(t=>0===t.localeCompare(e,void 0,{sensitivity:"accent"}))):(this.log("Resolved value is not an array of strings for i_contains."),!1);case ev:return e.values.some(e=>this.strictEquals(n,e,!1));case tv:return e.values.some(e=>this.strictEquals(n,e,!0));case nv:return e.values.every(e=>!this.strictEquals(n,e,!1));case iv:return e.values.every(e=>!this.strictEquals(n,e,!0));case rv:return!(!Array.isArray(n)&&"string"!=typeof n)&&e.values.some(e=>"string"==typeof e&&n.includes(e));case av:return Array.isArray(n)?e.values.every(e=>!("string"==typeof e&&n.includes(e))):e.values.every(e=>"string"!=typeof n||"string"!=typeof e||!n.includes(e));case uv:case lv:case dv:case cv:var i=hv(n);return null===i?(this.log(`Resolved value is not numerically comparable for ${e.operator}`),!1):e.values.some(t=>{var n=hv(t);if(null===n)return!1;switch(e.operator){case uv:return i>n;case lv:return i>=n;case dv:return i<n;default:return i<=n}});default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"strictEquals",value:function(e,t,n){return"string"==typeof e&&"string"==typeof t?n?0===e.localeCompare(t,void 0,{sensitivity:"accent"}):e===t:("boolean"==typeof e&&"boolean"==typeof t||"number"==typeof e&&"number"==typeof t)&&e===t}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] resolve(${e}) — exact hit: ${JSON.stringify(t)}`),t;var n=e.lastIndexOf(".");if(-1===n);else{var i=e.slice(0,n),a=e.slice(n+1),r=this.resolveRaw(i);if(void 0!==r){var o=this.extractProperty(a,r);return Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] resolve(${e}) — fallback: base=${i} → ${typeof r}, extract(.${a}) → ${JSON.stringify(o)}`),o}this.log(`Could not resolve base identifier: ${i}`)}}},{key:"resolveRaw",value:function(e){for(var t,n=[...this.namespaceResolvers.keys()].sort((e,t)=>t.length-e.length),i=h(n);!(t=i()).done;){var a=t.value;if(e.startsWith(a)){var r=this.namespaceResolvers.get(a);if(r){var o=r(e);return Ef.instance.maxLogging&&Bi.debug(`[NamiConditionEvaluator] resolveRaw(${e}) — ns=${a} → ${JSON.stringify(o)}`),o}}}}},{key:"extractProperty",value:function(e,t){switch(e){case"last":if(Array.isArray(t))return t[t.length-1];break;case"first":if(Array.isArray(t))return t[0];break;case"count":if(Array.isArray(t))return t.length;if(t&&"object"==typeof t)return Object.keys(t).length;break;default:return}this.log(`Could not extract .${e} from type ${typeof t}`)}},{key:"log",value:function(e){Bi.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),vv=function(){return c(function e(){o(this,e)},[{key:"register",value:function(){fv.shared.registerNamespaceResolver(this.namespace,e=>{var t=e.replace(new RegExp(`^${this.namespace}\\.`),"");return this.resolveValue(t)})}},{key:"resolveKeyPath",value:function(e,t){for(var n,i=t,a=h(e.replace(/\[(\w+)\]/g,".$1").split(".").filter(Boolean));!(n=a()).done;){var r=n.value;if(null==i||"object"!=typeof i)return;i=i[r]}return i}}])}(),pv=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t)).namespace="LaunchContext",i.context=e,i.campaign=n,i.register(),i}return p(t,e),c(t,[{key:"resolveValue",value:function(e){var t,n,i,a;if("placement"===e)return null!==(t=null===(n=this.campaign)||void 0===n?void 0:n.value)&&void 0!==t?t:void 0;if("tags"===e)return null!==(i=null===(a=this.campaign)||void 0===a?void 0:a.placement_tags)&&void 0!==i?i:void 0;if(e.startsWith("customAttributes.")){var r=e.substring(17);return this.resolveKeyPath(r,this.context.customAttributes)}if(e.startsWith("customObject.")){var o=e.substring(13);return this.resolveKeyPath(o,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(vv),gv=function(e){function t(){var e,n,i,a;o(this,t),(a=r(this,t)).namespace="Device";var s=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[1]||"",u=Intl.DateTimeFormat().resolvedOptions().timeZone,l=Vu(),d=we().device.getScreenInfo();return a.context={osName:l.os_name,osVersion:l.os_version,appVersion:l.extended_platform_version,sdkVersion:l.sdk_version,deviceModel:l.device_model,screenWidth:Math.round(d.width),screenHeight:Math.round(d.height),formFactor:l.form_factor,tvQuality:a.tvQuality(null!==(e=l.form_factor)&&void 0!==e?e:"desktop",d),tvResolution:a.tvResolution(null!==(n=l.form_factor)&&void 0!==n?n:"desktop",d),screenSize:a.screenSizeTier(null!==(i=l.form_factor)&&void 0!==i?i:"desktop",d),language:l.language,country:s,timezone:u},a.register(),a}return p(t,e),c(t,[{key:"screenSizeTier",value:function(e,t){var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i);switch(e){case"phone":return a<1136?"tiny":a<1334?"small":a<1920?"medium":a<2560?"large":"huge";case"tablet":return a<2048?"medium":a<2732?"large":"huge";case"television":return a<1920?"medium":a<3840?"large":"huge";case"desktop":return a<1440?"small":a<2560?"medium":a<3840?"large":"huge";default:return"medium"}}},{key:"tvQuality",value:function(e,t){if("television"!==e)return"";var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i),r=Math.min(n,i);return a>=3840||r>=2160?"4K":a>=1920||r>=1080?"1080p":"720p"}},{key:"tvResolution",value:function(e,t){if("television"!==e)return"";var n=Math.round(t.width*t.scale),i=Math.round(t.height*t.scale),a=Math.max(n,i),r=Math.min(n,i);return r<720&&a<1280?"SD":r>=720&&r<1080&&a>=1280&&a<1920?"720p":r>=1080&&r<1440&&a>=1920&&a<2560?"1080p":r>=1440&&r<2160&&a>=2560&&a<3840?"1440p":r>=2160&&r<3e3&&a>=3840&&a<5e3?"4K":r>=3e3&&a>=5e3?"8K":"Unknown"}},{key:"resolveValue",value:function(e){return this.resolveKeyPath(e,this.context)}}])}(vv),yv=[/(^|_)api(_|$)?key/i,/^key$/i,/^token$/i,/id[_-]?token/i,/access[_-]?token/i,/^auth/i,/password/i,/secret/i,/signature/i,/hmac/i,/^jwt$/i,/^code$/i,/redirect[_-]?uri/i,/return[_-]?url/i,/^state$/i,/^session$/i,/^sid$/i,/^sso$/i,/assertion/i],bv=function(){function e(){o(this,e),this.params={},"undefined"!=typeof window&&this.setSearchParams()}return c(e,[{key:"setSearchParams",value:function(){this.params=this.extractSafeParams()}},{key:"safeValue",value:function(e){if(!e)return null;try{var t=decodeURIComponent(e).trim();return!t||/^null|undefined$/i.test(t)||((e=>e.includes("://")||/^\/.*\?/.test(e))(t)||(e=>/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/.test(e))(t)||(e=>/^[A-Za-z0-9_-]{40,}$/.test(e)||/^[A-Fa-f0-9]{40,}$/.test(e)||/^ya29\./.test(e)||/^sk_/.test(e)||/^ghp_/.test(e))(t))?null:((e,t=128)=>e.length>t?e.slice(0,t):e)(t)}catch(e){return null}}},{key:"extractSafeParams",value:function(){var e=window.location,t={},n=new Set;try{for(var i,a=new URLSearchParams(e.search),r=(e,i)=>{var a=(e=>e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[-\s]/g,"_").toLowerCase())(e);if(!(n.size>=10||(e=>yv.some(t=>t.test(e)))(a))){var r=this.safeValue(i);r&&(t[a]=r,n.add(a))}},o=h(a.entries());!(i=o()).done;){var s=i.value;r(s[0],s[1])}}catch(e){}return t}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"refresh",value:function(){"undefined"!=typeof window&&this.instance.setSearchParams()}}])}();bv._instance=null;var wv=()=>bv.instance.params;function kv(e){if(null!=e&&""!==e){if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e){if(!Number.isFinite(e))return;return String(e)}return String(e)}}var Sv,Ev=/\{\{\s*([^}]+?)\s*\}\}/g,Pv=/\$\{[^}]+\}/g,_v=function(){return c(function e(t){o(this,e),this.flowManager=t,this.urlParams=wv()},[{key:"currentScreenPaywall",value:function(){var e,t,n=null===(e=this.flowManager.currentFlow)||void 0===e||null===(e=e.currentFlowStep)||void 0===e?void 0:e.screen;if(n)return(null===(t=this.screenPaywallLookup)||void 0===t?void 0:t.screenId)!==n&&(this.screenPaywallLookup={screenId:n,paywall:ul(n)}),this.screenPaywallLookup.paywall}},{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k;if("now"===e||"now.ms"===e||"now.iso"===e)return null!==(k=this.nowMs)&&void 0!==k||(this.nowMs=Nm().getTime()),((e,t)=>{switch(e){case"now":return String(Math.floor(t/1e3));case"now.ms":return String(t);case"now.iso":return new Date(t).toISOString();default:return}})(e,this.nowMs);var S=this.flowManager.currentFlow,E=null==S?void 0:S.component;if(e.startsWith("launchContext.")){var P=null==S?void 0:S.context;if(P){var _=e.substring(14),T=new pv(P,null==S?void 0:S.campaign).resolveValue(_);return Array.isArray(T)?T.join(","):null==T?void 0:T.toString()}}else{if(e.startsWith("form.")){var M,A=e.substring(5);return kv(null===(M=Bm.currentProvider)||void 0===M?void 0:M.state.formStates[A])}if(e.startsWith("sku.")){var D=null==S?void 0:S.purchasedSku;if(!D)return;var x=e.substring(4);switch(x){case"sku_ref_id":return D.skuRefId;case"name":return D.name;case"entitlement_ref_id":return null!==(t=null===(n=D.entitlements[0])||void 0===n?void 0:n.entitlement_ref_id)&&void 0!==t?t:"";case"entitlement_name":return null!==(i=null===(a=D.entitlements[0])||void 0===a?void 0:a.name)&&void 0!==i?i:"";default:var C=wh(x,D.productDetails);return null!=C?String(C):void 0}}switch(e){case"campaignId":return null==E||null===(r=E.campaign)||void 0===r?void 0:r.rule;case"campaignName":return null==E||null===(o=E.campaign)||void 0===o?void 0:o.name;case"campaignLabel":case"campaignPlacement":return null!==(s=null==E||null===(u=E.campaign)||void 0===u?void 0:u.value)&&void 0!==s?s:void 0;case"campaignSegment":case"campaignSegmentId":return null==E||null===(l=E.campaign)||void 0===l?void 0:l.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(d=null==E||null===(c=E.campaign)||void 0===c?void 0:c.external_segment)&&void 0!==d?d:void 0;case"pageName":return null!==(h=null===(m=this.currentScreenPaywall())||void 0===m?void 0:m.name)&&void 0!==h?h:null==E||null===(f=E.paywall)||void 0===f?void 0:f.name;case"pageId":return null!==(v=null==S||null===(p=S.currentFlowStep)||void 0===p?void 0:p.screen)&&void 0!==v?v:null==E||null===(g=E.paywall)||void 0===g?void 0:g.id;case"flowName":return null==S?void 0:S.name;case"flowId":return null==S?void 0:S.id;case"objectId":return null==E||null===(y=E.campaign)||void 0===y||null===(y=y.flow)||void 0===y?void 0:y.object_id;case"stepName":return null==S||null===(b=S.currentFlowStep)||void 0===b?void 0:b.name;case"buttonText":var I=null==S?void 0:S.currentButton;if(!I)return;var L=I.firstTextValue;if("function"!=typeof L)return;return L.call(I);case"slideNumber":var F=null==E?void 0:E.getSelectedSlideIndexForCurrentCarousel();return null!=F?`${F+1}`:void 0;case"productGroupId":return(null===(w=Bm.currentProvider)||void 0===w?void 0:w.state.currentGroupId)||void 0;case"productGroupName":var R,O,$,N=null===(R=Bm.currentProvider)||void 0===R?void 0:R.state;return null!==(O=null==N||null===($=N.groups)||void 0===$||null===($=$.find(e=>e.id===N.currentGroupId))||void 0===$?void 0:$.displayName)&&void 0!==O?O:void 0;case"productGroupRef":var W,j,B,z=null===(W=Bm.currentProvider)||void 0===W?void 0:W.state;return null!==(j=null==z||null===(B=z.groups)||void 0===B||null===(B=B.find(e=>e.id===z.currentGroupId))||void 0===B?void 0:B.ref)&&void 0!==j?j:void 0;case"flowPath":return null==S?void 0:S.flowPath;default:return}}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Ev,(e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}).replace(Pv,"")}},{key:"interpolateDeep",value:function(e){return"string"==typeof e?this.interpolateLiquidVariables(e):Array.isArray(e)?e.map(e=>this.interpolateDeep(e)):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>m({},e,{[t]:this.interpolateDeep(n)}),{}):e}}])}(),Tv=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="urlParams",e.context=wv(),e.register(),e}return p(t,e),c(t,[{key:"resolveValue",value:function(e){return Bi.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(vv),Mv=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="state",e.register(),e}return p(t,e),c(t,[{key:"getContextProvider",value:function(){var e=Bm.providers;if(0!==e.length){var t=e.find(e=>e.flow);return t||e[e.length-1]}}},{key:"resolveValue",value:function(e){var t=this.getContextProvider();if(t){if(e.startsWith("formStates.")){var n=e.substring(11);return t.getCurrentFormId(n)}return this.resolveKeyPath(e,t.state)}}}])}(vv),Av=function(e){function t(e){var n;return o(this,t),(n=r(this,t)).namespace="Placement",n.campaign=e,n.register(),n}return p(t,e),c(t,[{key:"resolveValue",value:function(e){var t;if("label"===e){if(this.campaign&&void 0!==this.campaign.value&&null!==this.campaign.value)return this.campaign.value;var n=Bm.providers;if(0!==n.length){var i=n.find(e=>e.flow);return i?i.getCurrentPlacementLabel():null===(t=n[n.length-1])||void 0===t?void 0:t.getCurrentPlacementLabel()}}}}])}(vv),Dv=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).namespace="LastLaunchContext",e}return p(t,e),c(t,[{key:"register",value:function(){_(t,"register",this)([])}},{key:"resolveValue",value:function(e){var t=lf.shared.previous;if(t){if("placement"===e)return t.placementLabel;if("tags"===e)return t.tags;if(e.startsWith("customAttributes.")){var n=e.substring(17);return this.resolveKeyPath(n,t.customAttributes)}}}}])}(vv);!function(e){e.LOGIN="login",e.LOGOUT="logout",e.ADVERTISING_ID_SET="advertising_id_set",e.ADVERTISING_ID_CLEARED="advertising_id_cleared",e.VENDOR_ID_SET="vendor_id_set",e.VENDOR_ID_CLEARED="vendor_id_cleared",e.CUSTOMER_DATA_PLATFORM_ID_SET="customer_data_platform_id_set",e.CUSTOMER_DATA_PLATFORM_ID_CLEARED="customer_data_platform_id_cleared",e.ANONYMOUS_MODE_ON="anonymous_mode_on",e.ANONYMOUS_MODE_OFF="anonymous_mode_off",e.NAMI_DEVICE_ID_SET="nami_device_id_set",e.NAMI_DEVICE_ID_CLEARED="nami_device_id_cleared"}(Sv||(Sv={}));var xv=e=>{var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:if(!Qc()){n.n=1;break}return Bi.info("Skipping transaction post - anonymous mode"),n.a(2);case 1:return n.p=1,n.n=2,a(il.instance.postConversion(e));case 2:n.n=4;break;case 3:n.p=3,t=n.v,Bi.error("Error posting conversion",t);case 4:return n.a(2)}},null,null,[[1,3]],Promise)},Cv=function(){return c(function e(){o(this,e),this.emitter=Sc.getInstance()},[{key:"sdkInitialized",get:function(){return Ef.instance.isInitialized}}],[{key:"allPaywalls",value:function(){if(!this.instance.sdkInitialized)throw new Ao;return sl()}},{key:"setProductDetails",value:function(e){this.instance.productDetails=e,Bm.setProductDetails(e)}},{key:"registerSignInHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.SignIn,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.SignIn,t)}}},{key:"registerCloseHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.Close,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.Close,t)}}},{key:"registerDeeplinkActionHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.DeeplinkAction,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.DeeplinkAction,t)}}},{key:"registerBuySkuHandler",value:function(t){return wu()&&Bi.debug("This handler will not be invoked because this account's plan includes built-in purchase management. Contact support@namiml.com for details."),this.instance.emitter.addListener(e.NamiPaywallManagerEvents.BuySku,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.BuySku,t)}}},{key:"registerRestoreHandler",value:function(t){return this.instance.emitter.addListener(e.NamiPaywallManagerEvents.Restore,t),()=>{this.instance.emitter.removeListener(e.NamiPaywallManagerEvents.Restore,t)}}},{key:"buySkuComplete",value:function(e){return k(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,a(this.reportPurchaseComplete(e));case 1:return t.p=1,vf.shared.requestRefresh(!0),t.f(1);case 2:return t.a(2)}},null,this,[[0,,1,2]],Promise)}},{key:"reportPurchaseComplete",value:function(e){var t,n,i,r,o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:if(Bm.setPurchaseInProgress(!1),Iv.instance.flowOpen&&(t=Iv.instance.currentFlow,n=null==t?void 0:t.currentFlowStep,t&&n&&t.executeLifecycle(n,Vf)),!Rv.inAnonymousMode()){u.n=1;break}return Bi.debug("Skipping purchase validation - anonymous mode"),u.a(2);case 1:if(i=Po.getSessionId(),r=Po.getPurchaseImpression()){u.n=2;break}return Bi.debug("Not sending paywall conversion call complete due to unknown impression"),u.a(2);case 2:return u.p=2,u.n=3,a(xv({purchase_env:"production",app_env:"production",impression:r,session:i,amount:e.amount,currency:e.currency,transaction_id:e.transactionId,sku:e.skuId}));case 3:u.n=5;break;case 4:u.p=4,o=u.v,Bi.error("Error posting conversion",o);case 5:if(gu(Pe.THIRD_PARTY_TRANSACTIONS)){u.n=9;break}return u.p=6,u.n=7,a(il.instance.purchaseValidation({app_env:"production",payload:"",sku:e.skuId}));case 7:u.n=9;break;case 8:u.p=8,s=u.v,Bi.error("Error validating purchase",s);case 9:return u.a(2)}},null,null,[[6,8],[2,4]],Promise)}},{key:"buySkuCancel",value:function(){gu(Pe.THIRD_PARTY_TRANSACTIONS)?Bm.setPurchase(!1):Bi.warn("Call this method is not needed for this app because Nami is responsible for purchase management. Contact support@nami.ml for details.")}},{key:"setAppSuppliedVideoDetails",value:function(e,t){qd(e)?(Bi.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received valid url ${e}`),Bm.setAppSuppliedVideoDetails({url:e,name:t})):Bi.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received invalid url ${e}`)}},{key:"allowUserInteraction",value:function(e){Bi.debug(`NamiPaywallManager: allowUserInteraction called with ${e}`),Bm.setUserInteractionEnabled(e)}}])}();Cv.instance=new Cv,Cv.emitter=Sc.getInstance();var Iv=function(){function e(){o(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"hasHandoffHandler",get:function(){return!!this.handoffStepHandler}},{key:"deliverHandoff",value:function(t,n){var i,a=this.handoffStepHandler;if(a){var r={tag:t,completed:!1};this.pendingHandoff=r,null===(i=this.currentFlow)||void 0===i||i.noteHandoff();a(t,n,n=>{if(r.completed)Bi.warn(`[NamiFlowManager] complete() called more than once for handoff '${t}' — ignored`);else{var i=e.instance.pendingHandoff;i&&i!==r?Bi.warn(`[NamiFlowManager] stale complete() for handoff '${t}' — a newer handoff ('${i.tag}') is pending; ignored`):(r.completed=!0,this.pendingHandoff===r&&(this.pendingHandoff=void 0),e.routeHandoffOutcome(null!=n?n:{kind:"done"}),e.resume())}})}}},{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(t,n,i){var a=new Uv(t,n,this,i);return this.flowOpen=!0,this.currentFlow=a,il.impressionListener=(t,n)=>{var i;null===(i=e.instance.currentFlow)||void 0===i||i.bindImpression(t,n)},a}},{key:"finishFlow",value:function(){var e,t;Ef.instance.maxLogging&&Bi.debug("[NamiFlowManager] finishFlow() — closing flow"),this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear(),null===(e=(t=we().ui).onFlowFinished)||void 0===e||e.call(t)}},{key:"getLastAnimatedFlowProgress",value:function(e){var t;return null!==(t=this.lastAnimatedFlowProgress.get(e))&&void 0!==t?t:0}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.currentFlow&&this.lastAnimatedFlowProgress.set(e,t)}},{key:"getCurrentFlowProgress",value:function(e){if(!this.currentFlow)return 1;var t=this.getCurrentFlowStepPosition();if(!t)return 0;var n=t.index/t.total;return n=Math.max(0,Math.min(1,n)),e&&this.setLastAnimatedFlowProgress(e,n),n}},{key:"getCurrentFlowStepIndex",value:function(){var e=this.getCurrentFlowStepPosition();return e?Math.max(0,Math.min(e.total,e.index)):0}},{key:"getTotalFlowSteps",value:function(){var e,t;return null!==(e=null===(t=this.getCurrentFlowStepPosition())||void 0===t?void 0:t.total)&&void 0!==e?e:0}},{key:"getCurrentFlowStepPosition",value:function(){var e=this.currentFlow;if(!e)return null;var t=e.currentFlowStep;if(!t)return null;var n=e.steps.filter(e=>e.type===xf);if(0===n.length)return null;var i=new Map;n.forEach((e,t)=>i.set(e.id,t));var a=this.buildNavGraph(e),r=n[0];return this.detectBranching(r,i,a)?this.computeBranchingPosition(e,t,r,i,a,n):this.computeLinearPosition(t,i,n)}},{key:"detectBranching",value:function(e,t,n){var i,a=t.get(e.id);return void 0!==a&&new Set((null!==(i=n.get(e.id))&&void 0!==i?i:[]).filter(e=>{var n;return(null!==(n=t.get(e))&&void 0!==n?n:-1)>a})).size>1}},{key:"computeLinearPosition",value:function(e,t,n){var i=t.get(e.id);return void 0===i?{index:0,total:n.length}:{index:i+1,total:n.length}}},{key:"computeBranchingPosition",value:function(e,t,n,i,a,r){if(t.id===n.id)return{index:1,total:2};var o=this.detectBranchRoot(e,n.id,i,t.id),s=[n.id,...this.buildBranchSegment(o,i,a)],u=s.indexOf(t.id);return-1===u?this.computeLinearPosition(t,i,r):{index:u+1,total:s.length}}},{key:"detectBranchRoot",value:function(e,t,n,i){var a=e.stepcrumbs.filter(e=>e.type===xf).map(e=>e.id).find(e=>e!==t&&n.has(e));return void 0!==a?a:n.has(i)?i:(Bi.debug(`detectBranchRoot: fallbackCurrentId (${i}) not found in screens, falling back to page1Id (${t})`),t)}},{key:"buildBranchSegment",value:function(e,t,n){if(!t.has(e))return[];for(var i=[e],a=new Set([e]),r=e,o=function(){var e,o,s=null!==(e=t.get(r))&&void 0!==e?e:-1,u=(null!==(o=n.get(r))&&void 0!==o?o:[]).find(e=>{var n;return(null!==(n=t.get(e))&&void 0!==n?n:-1)>s});if(void 0===u||a.has(u))return 1;a.add(u),i.push(u),r=u};!o(););return i}},{key:"buildNavGraph",value:function(e){var t=this.navGraphCache.get(e);if(t)return t;var n=new Map;e.steps.forEach(e=>{if(e.actions){var t=e.actions;Object.keys(t).sort().forEach(i=>{var a=t[i];Array.isArray(a)&&a.forEach(t=>{t.action&&t.action.forEach(t=>{if("flowNav"===t.function){var i,a=null===(i=t.parameters)||void 0===i?void 0:i.step;a&&(n.has(e.id)||n.set(e.id,new Set),n.get(e.id).add(a))}})})})}});var i=new Map;return n.forEach((e,t)=>{i.set(t,Array.from(e))}),this.navGraphCache.set(e,i),i}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){var e,t,n=null===(e=this.currentFlow)||void 0===e?void 0:e.currentFlowStep;if(!n)return null;var i=null===(t=n.actions)||void 0===t?void 0:t[jf];if(!i)return null;for(var a,r=h(i);!(a=r()).done;)for(var o,s,u=h(null!==(o=a.value.action)&&void 0!==o?o:[]);!(s=u()).done;){var l,d=s.value;if((d.function===Af.NAVIGATE||d.function===Af.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var c=d.parameters.delay,m=Number(c);if(!isNaN(m)&&m>0)return m/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"reset",value:function(){var t=e.instance;t.currentFlow=void 0,t.flowOpen=!1,t.lastAnimatedFlowProgress=new Map,t.navGraphCache=new WeakMap,t.pendingHandoff=void 0}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e;var t=e;return()=>{this.instance.handoffStepHandler===t&&(this.instance.handoffStepHandler=void 0)}}},{key:"routeHandoffOutcome",value:function(t){var n=e.instance.currentFlow,i=null==n?void 0:n.currentFlowStep;switch(t.kind){case"done":return;case"permission":if(!n)return;if(n.handoffState.permissions[t.permission]=t.granted,!t.granted)return;i&&n.executeLifecycle(i,qf);var a=$f[t.permission];return void(a?n.completionSignal(a):Bi.debug(`[NamiFlowManager] permission '${t.permission}' granted — no completion_result mapping yet (state/lifecycle only)`));case"purchase":return void("success"===t.result?Cv.buySkuComplete(t.details):(Bm.setPurchase(!1),n&&i&&n.executeLifecycle(i,Kf)));case"login":if("success"===t.result){var r,o,s=t.details;if(n)n.handoffState.login=m({},null!==(o=s.attributes)&&void 0!==o?o:{});Rv.loggedInId()===s.loginId?n&&i&&n.executeLifecycle(i,zf):Promise.resolve(Rv.login(s.loginId)).catch(e=>{Bi.error("[NamiFlowManager] login from handoff outcome failed",e)});var u=null===(r=Po.getDevice())||void 0===r?void 0:r.customer_data_platform_id;s.cdpId&&s.cdpId!==u&&Promise.resolve(Rv.setCustomerDataPlatformId(s.cdpId)).catch(e=>{Bi.error("[NamiFlowManager] CDP id write-through from handoff outcome failed",e)})}else n&&i&&n.executeLifecycle(i,Uf);return}}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e;var t=e;return()=>{this.instance.eventHandler===t&&(this.instance.eventHandler=void 0)}}},{key:"resume",value:function(){var t,n,i,a=e.instance,r=a.flowOpen,o=a.currentFlow;Ef.instance.maxLogging&&Bi.debug(`[NamiFlowManager] resume() — flowOpen=${r}, hasFlow=${!!o}, currentStep=${null!==(t=null==o||null===(n=o.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"none"}, isPaused=${null!==(i=null==o?void 0:o.isPaused)&&void 0!==i?i:"N/A"}`);var s=e.instance.pendingHandoff,u=!!s&&!s.completed;if(s&&!s.completed&&(s.completed=!0,e.instance.pendingHandoff=void 0,Bi.warn(`[NamiFlowManager] resume() called during handoff '${s.tag}' with a v2 handler registered — treated as complete({kind:'done'}); prefer complete(outcome)`)),r&&o&&o.currentFlowStep){var l=o.consumeResumeSatisfiedByTypedNavigation();return o.activeHandoffSequence?(Bi.debug(`Resuming flow at handoff sequence ${o.currentFlowStep.id}`),void o.resumeNextHandoff()):o.isPaused&&o.pausedStepID?(Bi.debug(`Resuming paused flow at step ${o.currentFlowStep.id}`),void o.executeLifecycle(o.currentFlowStep,"__resume__")):void(!l||u?(Bi.debug(`Resuming flow at step ${o.currentFlowStep.id}`),o.executeLifecycle(o.currentFlowStep,"__resume__")):Bi.warn(`[NamiFlowManager] dropping redundant resume — a typed lifecycle already navigated away from the step it fired on (now ${o.currentFlowStep.id})`))}Bi.warn("Cannot resume: no active flow or current step")}},{key:"finish",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?(Bi.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.dismiss()):Bi.debug("Cannot finish: no active flow or current step")}},{key:"pause",value:function(){var t=e.instance,n=t.flowOpen,i=t.currentFlow;n&&i&&i.currentFlowStep?!0===i.resumeFromBookmark?i.pause():Bi.warn("This flow cannot be paused"):Bi.warn("Cannot pause: no active flow or current step")}},{key:"isFlowOpen",value:function(){return e.instance.flowOpen}},{key:"getLastAnimatedFlowProgress",value:function(e){return this.instance.getLastAnimatedFlowProgress(e)}},{key:"setLastAnimatedFlowProgress",value:function(e,t){this.instance.setLastAnimatedFlowProgress(e,t)}},{key:"getCurrentFlowProgress",value:function(e){return this.instance.getCurrentFlowProgress(e)}},{key:"getCurrentFlowStepIndex",value:function(){return this.instance.getCurrentFlowStepIndex()}},{key:"getTotalFlowSteps",value:function(){return this.instance.getTotalFlowSteps()}},{key:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}();df=()=>Iv.isFlowOpen();var Lv=Object.freeze({__proto__:null,NamiFlowManager:Iv}),Fv=()=>{var e,t;return null!==(e=null===(t=Po.getNamiConfig())||void 0===t||null===(t=t.namiCommands)||void 0===t?void 0:t.includes("disableAsyncLoginLogout"))&&void 0!==e&&e},Rv=function(){return c(function e(){o(this,e),this.emitter=Sc.getInstance(),fv.shared.registerNamespaceResolver("UserTags",t=>{var n,i=t.replace("UserTags.","");return null!==(n=e.getCustomerAttribute(i))&&void 0!==n?n:null})},[{key:"isSDKInitialized",get:function(){return Ef.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return Sf.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||Bi.debug(Ue),Sf.instance.getExternalId()}},{key:"login",value:function(e){var t,n,i,r,o,s,u,l,d;return k(function(c){for(;;)switch(c.p=c.n){case 0:if(this.instance.isSDKInitialized){c.n=1;break}throw t=new Ao,this.invokeStateHandler(Sv.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){c.n=2;break}throw n=new Oo,this.invokeStateHandler(Sv.LOGIN,!1,n),n;case 2:if(Fv()){c.n=3;break}return Sf.instance.loginLocal(e),this.invokeStateHandler(Sv.LOGIN,!0),Iv.instance.flowOpen&&(i=Iv.instance.currentFlow,(r=null==i?void 0:i.currentFlowStep)&&(Ef.instance.maxLogging&&Bi.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${r.id}`),i.executeLifecycle(r,zf))),Sf.instance.loginRemote(e).catch(e=>{Bi.error("[NamiCustomerManager] async login API failed",e)}),Vm.instance.fetchActiveEntitlements().catch(e=>{Bi.error("[NamiCustomerManager] async login entitlement refresh failed",e)}),c.a(2);case 3:return c.p=3,c.n=4,a(Sf.instance.login(e));case 4:return c.n=5,a(Vm.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Sv.LOGIN,!0),Iv.instance.flowOpen&&(o=Iv.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&(Ef.instance.maxLogging&&Bi.debug(`[NamiCustomerManager] login success — triggering __login_success__ on step ${s.id}`),o.executeLifecycle(s,zf))),c.n=7;break;case 6:throw c.p=6,d=c.v,this.invokeStateHandler(Sv.LOGIN,!1,d),Iv.instance.flowOpen&&(u=Iv.instance.currentFlow,(l=null==u?void 0:u.currentFlowStep)&&(Ef.instance.maxLogging&&Bi.debug(`[NamiCustomerManager] login failure — triggering __login_failure__ on step ${l.id}`),u.executeLifecycle(l,Uf))),d;case 7:return c.a(2)}},null,this,[[3,6]],Promise)}},{key:"logout",value:function(){var e,t,n,i,r,o,s,u,l;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(this.instance.isSDKInitialized){d.n=1;break}throw e=new Ao,this.invokeStateHandler(Sv.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){d.n=2;break}throw t=new Oo,this.invokeStateHandler(Sv.LOGOUT,!1,t),t;case 2:if(Fv()){d.n=3;break}return Sf.instance.logoutLocal(),this.invokeStateHandler(Sv.LOGOUT,!0),Iv.instance.flowOpen&&(n=Iv.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&(Ef.instance.maxLogging&&Bi.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${i.id}`),n.executeLifecycle(i,Hf))),Sf.instance.logoutRemote().catch(e=>{Bi.error("[NamiCustomerManager] async logout API failed",e)}),Vm.instance.fetchActiveEntitlements().catch(e=>{Bi.error("[NamiCustomerManager] async logout entitlement refresh failed",e)}),d.a(2);case 3:return d.p=3,d.n=4,a(Sf.instance.logout());case 4:return d.n=5,a(Vm.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Sv.LOGOUT,!0),Iv.instance.flowOpen&&(r=Iv.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,Hf)),d.n=7;break;case 6:throw d.p=6,l=d.v,this.invokeStateHandler(Sv.LOGOUT,!1,l),Iv.instance.flowOpen&&(s=Iv.instance.currentFlow,(u=null==s?void 0:s.currentFlowStep)&&s.executeLifecycle(u,Gf)),l;case 7:return d.a(2)}},null,this,[[3,6]],Promise)}},{key:"setCustomerDataPlatformId",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.updateCustomerDataPlatformId(e));case 1:return t.a(2)}},null,this,null,Promise)}},{key:"clearCustomerDataPlatformId",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(this.updateCustomerDataPlatformId(null));case 1:return e.a(2)}},null,this,null,Promise)}},{key:"registerAccountStateHandler",value:function(e){return this.instance.emitter.on("accountStateChange",e),()=>{this.instance.emitter.off("accountStateChange",e)}}},{key:"setAnonymousMode",value:function(e){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:if(t=e?Sv.ANONYMOUS_MODE_ON:Sv.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new Ao,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return Bi.warn("Anonymous mode feature is not enabled for your Nami account. Contact support@nami.ml for details."),s.a(2);case 2:if(this.inAnonymousMode()!==e){s.n=3;break}return i=e?new Fo:new Ro,this.invokeStateHandler(t,!1,i),s.a(2);case 3:if(!e){s.n=4;break}Po.setAnonymousMode(e),Po.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Sv.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return Po.clearAnonymousMode(),Jc(),o=null===(r=Po.getNamiConfig())||void 0===r?void 0:r.namiCommands,s.n=5,a(_c.instance.createOrUpdateDevice(Vu(o)));case 5:Po.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Sv.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}},null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Qc()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new Ao;var n=Po.getCustomerAttribute(e)!==t;if(Po.setCustomerAttribute(e,t),gu(Pe.PAYWALL_PERSONALIZATION)?(Bm.setCustomerAttribute({[e]:t}),Bi.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):Bi.warn(`The customer attribute ${e} is not available for using on a paywall, because your account's plan does not include paywall personalization. Contact support@nami.ml for details.`),Iv.instance.flowOpen){var i=Iv.instance.currentFlow;if(i){var a,r=i.campaign?null===(a=Kd(i.campaign))||void 0===a?void 0:a.goal:null;"user_context_set"===(null==r?void 0:r.type)&&r.context_key===e&&i.completionSignal("context_set");var o=i.currentFlowStep;o&&i.executeLifecycle(o,Xf)}}vf.shared.customerAttributeSet(e,n)}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Ao;var t=Po.getCustomerAttribute(e);return null!=t?gu(Pe.PAYWALL_PERSONALIZATION)?Bi.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):Bi.warn(`Found customer attribute. ${e} is not available for use on a paywall because paywall personalization is not included in your account's plan. Contact support@nami.ml for details.`):Bi.debug(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Ao;return Po.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Ao;Po.clearCustomerAttribute(e)?(Bm.removeCustomerAttribute(e),Bi.warn(`This customer attribute has been cleared. ${e} is no longer available for paywall personalization on this device. A default value will be used if set in the Nami Control Center.`)):Bi.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Ao;Po.getAllCustomerAttributesKeys().forEach(e=>{Bm.removeCustomerAttribute(e)}),Po.clearAllCustomerAttributes(),Bi.warn("All customer attribute have been cleared. customer's smart text will no longer be personalized for this device. A default value will be used if set in the Nami Control Center.")}},{key:"journeyState",value:function(){if(!this.instance.isSDKInitialized)throw new Ao;return Po.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Po.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:tt}},{key:"registerJourneyStateHandler",value:function(e){if(wu("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(Di,e),()=>{this.instance.emitter.removeListener(Di,e)}}},{key:"invokeStateHandler",value:function(e,t,n){this.instance.emitter.emit("accountStateChange",e,t,n)}},{key:"updateCustomerDataPlatformId",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:if(this.instance.isSDKInitialized){o.n=1;break}throw t=new Ao,this.invokeStateHandler(Sv.CUSTOMER_DATA_PLATFORM_ID_SET,!1,t),t;case 1:if(this.inAnonymousMode()){o.n=6;break}return o.p=2,o.n=3,a(_c.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Sv.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,r=o.v,this.invokeStateHandler(Sv.CUSTOMER_DATA_PLATFORM_ID_SET,!1,r);case 5:o.n=7;break;case 6:return Bi.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Po.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new $o,this.invokeStateHandler(Sv.CUSTOMER_DATA_PLATFORM_ID_SET,!1,i),o.a(2);case 7:return o.a(2)}},null,this,[[2,4]],Promise)}},{key:"anonymousModeCapability",value:function(){if(!this.instance.isSDKInitialized)return!1;var e=gu(Pe.ANONYMOUS_MODE_CAPABILITY),t=gu(Pe.THIRD_PARTY_TRANSACTIONS);return e&&t}},{key:"refetchConfig",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(!this.instance.isSDKInitialized){e.n=1;break}return e.n=1,a(Promise.all([Tc.instance.fetchProducts(),Uc.instance.fetchPaywalls().then(e=>Ec.instance.fetchCampaignRules(e))]));case 1:return e.a(2)}},null,this,null,Promise)}}])}();Rv.instance=new Rv;var Ov="This field is required",$v="Please enter a valid email address",Nv="Please enter at least 2 characters",Wv=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function jv(e,t,n){var i=("string"==typeof n?n:null==n?"":String(n)).trim();return t&&0===i.length?Ov:0!==i.length?"email"!==e||Wv.test(i)?"name"===e&&i.length<2?Nv:void 0:$v:void 0}var Bv=/^([^:]+)::(.+)$/;var zv=function(){return c(function e(t={}){var n,i,a,r,s;o(this,e),this.id=null!==(n=t.id)&&void 0!==n?n:"",this.name=null!==(i=t.name)&&void 0!==i?i:"",this.steps=null!==(a=t.steps)&&void 0!==a?a:[],this.screens=null!==(r=t.screens)&&void 0!==r?r:[],this.resumeFromBookmark=Boolean(t.resume_from_bookmark),this.transition=null!==(s=t.transition)&&void 0!==s?s:"none"},[{key:"allScreensAvailable",get:function(){return this.screens.length>0&&ll(this.screens)}}])}(),Uv=function(e){function t(e,n,i,a){var s,u;o(this,t),(u=r(this,t,[null!==(s=e.flow.object)&&void 0!==s?s:{}])).stepcrumbs=[],u.branchcrumbs=[],u.activeHandoffSequence=null,u.currentScreenState=null,u.isPaused=!1,u.resumeSatisfiedByTypedNavigation=!1,u.navigationRequestCount=0,u.handoffDeliveryCount=0,u.flowPath="",u.timerStates={},u.handoffState={permissions:{}},u.campaign=e,u.component=n,u.context=a,u.manager=i,u.branchcrumbs=[],u.stepcrumbs=[],u.registerResolvers(a);var l=u.findStepByType(Df);return l&&u.forward(l.id),u}return p(t,e),c(t,[{key:"applyLaunchContextAttributes",value:function(e){var t,n;this.context||(this.context={customAttributes:{}},new pv(this.context,this.campaign)),null!==(n=(t=this.context).customAttributes)&&void 0!==n||(t.customAttributes={}),Object.assign(this.context.customAttributes,e)}},{key:"registerResolvers",value:function(e){e&&new pv(e,this.campaign),new gv,new Tv,new Mv,new Av(this.campaign),(new Dv).register(),fv.shared.registerNamespaceResolver("Flow",e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map(e=>e.id);case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}),fv.shared.registerNamespaceResolver("login",e=>{var t,n=e.replace(/^login\./,"");return null===(t=this.handoffState.login)||void 0===t?void 0:t[n]}),fv.shared.registerNamespaceResolver("permissions",e=>{var t=e.replace(/^permissions\./,"");return this.handoffState.permissions[t]}),fv.shared.registerNamespaceResolver("__first_session__",()=>pf.instance.getIsFirstSession())}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),i=this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type);return t&&n&&i}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find(t=>t.id===e)}},{key:"findStepByType",value:function(e){return this.steps.find(t=>t.type===e)}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some(e=>this.branchcrumbs.includes(e))}},{key:"flowLog",value:function(e,...t){Ef.instance.maxLogging&&Bi.debug(`[NamiFlow] ${e}`,...t)}},{key:"finished",value:function(){var e;this.flowLog(`finished() — closing flow, isPaused=${this.isPaused}, step=${null===(e=this.currentFlowStep)||void 0===e?void 0:e.id}`),this.manager.finishFlow()}},{key:"dismiss",value:function(){this.signalNonCompletion("dismiss_page"),this.finished()}},{key:"back",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){if(!this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type))return this.flowLog("back() — no previous screen step, dismissing flow"),void this.dismiss();this.backToPreviousScreenStep()}else Bi.debug(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"bindImpression",value:function(e,t){var n=this.currentFlowStep;if(n){if(t&&n.screen&&t!==n.screen)return this.flowLog(`bindImpression(${e}) — ignored, fired by page ${t} but the flow is on ${n.screen} (step ${n.id})`),void Bi.debug(`[NamiFlow] not binding impression ${e} from page ${t} to step ${n.id}`);var i=this.completionContext;i&&i.stepId===n.id&&!i.impressionId?i.impressionId=e:this.completionContext={stepId:n.id,impressionId:e,resultSent:!1,pending:[]};var a=n.completion_step;null!=a&&a.enabled&&"page_view"===a.condition&&this.completionSignal("page_view");var r=this.completionContext.pending;this.completionContext.pending=[],r.forEach(e=>this.completionSignal(e))}}},{key:"completionSignal",value:function(e){var t=this.currentFlowStep,n=null==t?void 0:t.completion_step;if(t&&null!=n&&n.enabled&&n.condition===e){var i=this.completionContext;i&&i.stepId===t.id||(i=this.completionContext={stepId:t.id,resultSent:!1,pending:[]}),i.resultSent||(vf.shared.flowCompletionSignaled(this.campaign),i.impressionId?(i.resultSent=!0,this.patchCompletion(i.impressionId,e)):i.pending.includes(e)||i.pending.push(e))}}},{key:"signalNonCompletion",value:function(e){var t=this.completionContext;t&&t.impressionId&&!t.resultSent&&(t.resultSent=!0,this.patchCompletion(t.impressionId,e))}},{key:"patchCompletion",value:function(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return this.flowLog(`patchCompletion(${t}) — impression=${e}, step=${null===(n=this.currentFlowStep)||void 0===n?void 0:n.id}`),r.p=1,r.n=2,a(il.instance.patchImpressionCompletion(e,t,(new Date).toISOString()));case 2:r.n=4;break;case 3:r.p=3,i=r.v,Bi.error(`[NamiFlow] completion PATCH failed for '${t}'`,i);case 4:return r.a(2)}},null,this,[[1,3]],Promise)}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var i,a,r=ul(n.screen);return r&&we().ui.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=Bm.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}Bi.warn("No previous screen step found to return to")}else Bi.warn(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"forward",value:function(e){var t=this.getStep(e);if(t)if(this.isStepActive(t))switch(this.flowLog(`forward(${e}) — type=${t.type}, name=${t.name}, isPaused=${this.isPaused}`),this.navigationRequestCount+=1,t.type){case Df:case If:return this.stepcrumbs.push(t),void this.executeLifecycle(t,Wf);case Cf:return void this.handleBranchStep(t);case xf:return void this.handleScreenStep(t);case Lf:return}else this.flowLog(`forward(${e}) — step not active (branch_tags=${JSON.stringify(t.branch_tags)}, branchcrumbs=${JSON.stringify(this.branchcrumbs)})`);else Bi.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.resumeSatisfiedByTypedNavigation=!1,this.isPaused?Bi.info("Flow is already paused"):(this.isPaused=!0,this.pausedStepID=null===(e=this.currentFlowStep)||void 0===e?void 0:e.id,this.flowLog(`pause() — pausedStepID=${this.pausedStepID}`),Bi.info("Flow paused"))}},{key:"resumeFromPause",value:function(){if(this.isPaused)if(this.isPaused=!1,this.pausedStepID){var e=this.pausedStepID;this.pausedStepID=void 0,this.flowLog(`resumeFromPause() — resuming from step ${e}`),Bi.info(`Flow resumed from step ${e}`),this.forward(e)}else Bi.warn("No step to resume from");else Bi.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){t===Vf?this.completionSignal("purchase_success"):t===zf&&this.completionSignal("login_success");var i=e.actions[t];if(i){this.flowLog(`executeLifecycle(${t}) — step=${e.id}, isPaused=${this.isPaused}, ${i.length} lifecycle(s)`);var a=this.navigationRequestCount,r=this.handoffDeliveryCount;this.executeFullLifecycles(i,n),(e=>e===zf||e===Vf||e===Uf)(t)&&this.manager.flowOpen&&this.navigationRequestCount!==a&&this.handoffDeliveryCount===r&&(this.resumeSatisfiedByTypedNavigation=!0,this.flowLog(`${t} navigated from step ${e.id}; the next resume() is already satisfied`))}else this.flowLog(`executeLifecycle(${t}) — no actions on step ${e.id}`)}},{key:"consumeResumeSatisfiedByTypedNavigation",value:function(){return!!this.resumeSatisfiedByTypedNavigation&&(this.resumeSatisfiedByTypedNavigation=!1,!0)}},{key:"disarmResumeDrop",value:function(){this.resumeSatisfiedByTypedNavigation=!1}},{key:"noteHandoff",value:function(){this.handoffDeliveryCount+=1,this.resumeSatisfiedByTypedNavigation=!1}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;Bi.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"isFormSubmitLifecycle",value:function(e){var t=[Af.SET_TAGS_FROM_FORM,Af.NEXT,Af.NAVIGATE];return e.some(e=>[e.before,e.action,e.after].some(e=>null==e?void 0:e.some(e=>t.includes(e.function))))}},{key:"captureBuySkuData",value:function(e,t){var n,i,a;e===Nf&&null!=t&&t.sku&&(this.purchasedSku="sku_ref_id"in(n=t.sku)?{skuRefId:n.sku_ref_id,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(a=n.product_details)&&void 0!==a?a:null}:{skuRefId:n.skuId,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(i=n.productDetails)&&void 0!==i?i:null})}},{key:"isStaleTap",value:function(e,t){var n,i=null===(n=this.currentFlowStep)||void 0===n?void 0:n.screen;return!(!t||!i||t===i)&&(this.flowLog(`dropping stale tap ${e} from screen ${t} — the flow is on ${i} (NAM-4395)`),Bi.info(`Ignoring "${e}" from a screen the flow has already left (${t} -> ${i})`),!0)}},{key:"triggerActions",value:function(e,t,n,i){var a,r,o;if(this.captureBuySkuData(e,n),!this.isStaleTap(e,i)){this.resumeSatisfiedByTypedNavigation=!1;var s=this.lifecycles(e);if(s){this.flowLog(`triggerActions(${e}) — step=${null===(a=this.currentFlowStep)||void 0===a?void 0:a.id}, isPaused=${this.isPaused}`),this.currentButton=t;var u=null!==(r=null===(o=Bm.currentProvider)||void 0===o?void 0:o.state.formFieldValidators)&&void 0!==r?r:{};if(this.isFormSubmitLifecycle(s)&&Object.keys(u).length){var l,d=function(e,t){for(var n={},i=0,a=Object.entries(e);i<a.length;i++){var r,o=a[i],s=o[0],u=o[1],l=jv(u.type,u.required,t[s]);void 0!==l&&(n[s]=null!==(r=u.message)&&void 0!==r?r:l)}return n}(u,this.getFormData());if(null===(l=Bm.currentProvider)||void 0===l||l.setFormFieldErrors(d),Object.keys(d).length)return void this.flowLog(`triggerActions(${e}) — HALTED by form validation: ${JSON.stringify(d)}`)}this.executeFullLifecycles(s,n)}}}},{key:"executeFullLifecycles",value:function(e,t){for(var n,i=this,a=function(){var e=n.value,a=["before","action","after"];[e.before,e.action,e.after].forEach((e,n)=>null==e?void 0:e.forEach(e=>{var r=i.shouldRun(e);i.flowLog(` ${a[n]}: ${e.function}${e.id?` (${e.id})`:""} — shouldRun=${r}`),r&&i.performAction(e,t)}))},r=h(e);!(n=r()).done;)a()}},{key:"triggerBeforeActions",value:function(e,t,n,i){if(this.captureBuySkuData(e,n),!this.isStaleTap(e,i)){this.resumeSatisfiedByTypedNavigation=!1;var a=this.lifecycles(e);if(a){this.currentButton=t;for(var r,o=h(a);!(r=o()).done;){var s;null===(s=r.value.before)||void 0===s||s.forEach(e=>this.shouldRun(e)&&this.performAction(e,n))}}}}},{key:"triggerAfterActions",value:function(e,t,n,i){if(this.captureBuySkuData(e,n),!this.isStaleTap(e,i)){this.resumeSatisfiedByTypedNavigation=!1;var a=this.lifecycles(e);if(a){this.currentButton=t;for(var r,o=h(a);!(r=o()).done;){var s;null===(s=r.value.after)||void 0===s||s.forEach(e=>this.shouldRun(e)&&this.performAction(e,n))}}}}},{key:"currentStepHasHoistedPrimaryActions",value:function(e){var t=this.lifecycles(e);return!!t&&t.some(e=>{var t;return null===(t=e.action)||void 0===t?void 0:t.length})}},{key:"shouldRun",value:function(e){if(!e.conditions)return!0;var t=e.conditions.every(e=>{var t=fv.shared.evaluate(e);if(Ef.instance.maxLogging){var n,i,a,r=null!==(n=null===(i=e.filter)||void 0===i?void 0:i.map(e=>`${e.identifier} ${e.operator} ${JSON.stringify(e.values)}`).join(", "))&&void 0!==n?n:"none";Bi.debug(`[NamiFlow] condition: [${r}] op=${null!==(a=e.operator)&&void 0!==a?a:"default"} → ${t}`)}return t});return t}},{key:"performAction",value:function(e,t){var n,i;if(this.currentFlowStep){var a=(null!==(n=e.parameters)&&void 0!==n&&n.delay?+e.parameters.delay:0)||0;this.flowLog(`performAction(${e.function}) — step=${this.currentFlowStep.id}, delay=${a}, params=${JSON.stringify(null!==(i=e.parameters)&&void 0!==i?i:{})}`);var r=n=>{var i,a;(null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n?this.runAction(e,t):this.flowLog(`performAction(${e.function}) — SKIPPED stale step ${n}, current=${null===(a=this.currentFlowStep)||void 0===a?void 0:a.id}`)};a?setTimeout(r.bind(this,this.currentFlowStep.id),a):r(this.currentFlowStep.id)}else Bi.warn("No current flow step")}},{key:"runAction",value:function(e,t){var n,i,a,r,o,s,u;switch(e.function){case Af.BACK:this.back();break;case Af.NEXT:null!==(n=e.parameters)&&void 0!==n&&n.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(i=e.parameters)&&void 0!==i&&i.step?this.forward(e.parameters.step):this.next();break;case Af.NAVIGATE:var l;if(null!==(a=e.parameters)&&void 0!==a&&a.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(r=e.parameters)&&void 0!==r&&r.step)(null===(l=this.previousFlowStep)||void 0===l?void 0:l.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Af.FINISHED:this.finished();break;case Af.DISMISS:this.dismiss();break;case Af.EXIT:this.signalNonCompletion("skip_page");var d=this.steps.find(e=>e.type===If);d&&this.forward(d.id);break;case Af.PAUSE:this.pause();break;case Af.RESUME:this.resumeFromPause();break;case Af.HANDOFF:var c,h,m,f,v,p,g=null===(c=e.parameters)||void 0===c?void 0:c.handoffTag;if(!g)break;if(this.noteHandoff(),null!==(h=e.parameters)&&void 0!==h&&h.handoffFormId&&this.completionSignal("form_submitted"),g.startsWith("__")){var y;g===Ff&&null!==(y=e.parameters)&&void 0!==y&&y.handoffFormId?this.flowHandoffFormSequence():(Bi.warn(`Ignoring reserved handoff tag '${g}' — resuming flow`),this.manager.resume());break}if(!this.manager.hasHandoffHandler){Bi.debug("No handoffStepHandler found",e);break}if(g===Rf.UserData&&null!==(m=e.parameters)&&void 0!==m&&m.handoffFormId){this.manager.deliverHandoff(g,this.buildUserDataEnvelope(e.parameters.handoffFormId));break}null!==(f=e.parameters)&&void 0!==f&&f.handoffData?p=new _v(this.manager).interpolateDeep(e.parameters.handoffData):t?p=t:null!==(v=e.parameters)&&void 0!==v&&v.handoffFormId&&(p=this.getFormData()),Bi.debug(`Invoking handoff handler with ${g}${p?` ${JSON.stringify(p)}`:" and no data"}`),this.manager.deliverHandoff(g,p);break;case Af.LOG:var b;if(null!==(o=e.parameters)&&void 0!==o&&o.eventName)Bi.info(`logEvent → ${e.parameters.eventName}`);else Bi.warn(`Missing 'eventName' in logEvent action ${null!==(b=e.id)&&void 0!==b?b:"unknown"}`);break;case Af.TRACK:var w;if(null!==(s=e.parameters)&&void 0!==s&&s.eventName)Bi.info(`trackEvent → ${e.parameters.eventName}`);else Bi.warn(`Missing 'eventName' in logEvent action ${null!==(w=e.id)&&void 0!==w?w:"unknown"}`);break;case Af.SET_VIDEO:null!==(u=e.parameters)&&void 0!==u&&u.name&&e.parameters.url?Bm.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):Bi.warn("Missing name, url for setting video details");break;case Af.BLOCK_BACK:var k,S=null===(k=e.parameters)||void 0===k?void 0:k.step,E=S?this.getStep(S):void 0;E?E.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:Bi.warn("Missing step for blocking back");break;case Af.FLOW_EVENT:var P,_=new _v(this.manager),T=Object.fromEntries(Object.entries(null!==(P=e.parameters)&&void 0!==P?P:{}).map(([e,t])=>[e,_.interpolateDeep(t)]));this.manager.eventHandler?this.manager.eventHandler(T):Bi.warn("Missing event handler",T);break;case Af.FLOW_ENABLED:Bm.setUserInteractionEnabled(!0);break;case Af.FLOW_DISABLED:Bm.setUserInteractionEnabled(!1);break;case Af.SET_TAGS:if(e.parameters){var M=new _v(this.manager).interpolateDeep(e.parameters);Bm.setUserTags(M),Object.entries(M).forEach(([e,t])=>{Rv.setCustomerAttribute(e,t)})}break;case Af.SET_TAGS_FROM_FORM:var A,D=null===(A=e.parameters)||void 0===A?void 0:A.include,x=Array.isArray(D)?new Set(D):void 0,C=this.getFormData(),I={};Object.entries(C).forEach(([e,t])=>{if(!x||x.has(e)){var n=kv(t);void 0!==n&&(I[e]=n,Rv.setCustomerAttribute(e,n))}}),Object.keys(I).length&&Bm.setUserTags(I);break;case Af.SET_LAUNCH_CONTEXT:var L=e.parameters;null!=L&&L.customAttributes?this.applyLaunchContextAttributes(L.customAttributes):void 0!==(null==L?void 0:L.key)&&void 0!==(null==L?void 0:L.value)&&this.applyLaunchContextAttributes({[L.key]:L.value});break;case Af.SET_FLOW_PATH:var F,R=null===(F=e.parameters)||void 0===F?void 0:F.flowPath;"string"==typeof R&&(this.flowPath=R);break;default:Bi.warn(`Missing action handler for ${e.function}`,e)}}},{key:"nextStep",value:function(e){if(e){var t=this.steps.findIndex(t=>t.id===e.id);if(-1!==t){for(var n,i=h(this.steps.slice(t+1));!(n=i()).done;){var a=n.value;if(this.isStepActive(a))return a}Bi.debug(`No active next step found after ${e.id}`)}else Bi.error(`Could not find next step for step ${e.id}`)}else Bi.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=ul(null!==(t=e.screen)&&void 0!==t?t:"");e.screen&&n&&this.campaign?(this.stepcrumbs.push(e),we().ui.flowNavigateToScreen(n,{transition:this.transition,direction:"forward"})):Bi.error("No paywall or campaign found for next step")}},{key:"handleBranchStep",value:function(e){this.stepcrumbs.push(e);for(var t=0,n=Object.entries(e.actions);t<n.length;t++){var i=n[t],a=i[0],r=i[1];if(r)for(var o,s=h(r);!(o=s()).done;){var u=o.value;if(u.action)for(var l,d=h(u.action);!(l=d()).done;){var c,m,f=l.value;if(this.shouldRun(f))return this.branchcrumbs.push(a),null===(c=u.before)||void 0===c||c.forEach(e=>{this.performAction(e)}),u.action.forEach(e=>{this.shouldRun(e)&&this.performAction(e)}),void(null===(m=u.after)||void 0===m||m.forEach(e=>{this.performAction(e)}))}else Bi.warn(`No actions defined for branch tag ${a}`)}}Bi.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return m({},null!==(e=null===(t=Bm.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"buildUserDataEnvelope",value:function(e){var t,n;return{form_id:e,step_id:null!==(t=null===(n=this.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"",collected_at:(new Date).toISOString(),fields:this.getFormData()}}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t);if(0!==n.length){if(n.some(e=>Bv.test(e))){var i=this.buildHandoffGroups(t);return 0===i.length?(Bi.info("No handoff groups after grouping"),this.disarmResumeDrop(),void this.manager.resume()):(this.activeHandoffSequence={groups:i},void this.resumeNextHandoff())}var a=n.sort().filter(e=>!0===t[e]);if(0===a.length)return Bi.info("No eligible handoff keys after filtering"),this.disarmResumeDrop(),void this.manager.resume();this.activeHandoffSequence={formStates:m({},t),remainingKeys:[...a]},this.resumeNextHandoff()}else Bi.warn("formStates is empty, no handoffs to perform")}else Bi.warn("No formStates available for handoff sequence")}},{key:"buildHandoffGroups",value:function(e){for(var t=new Map,n=0,i=Object.keys(e);n<i.length;n++){var a=i[n],r=a.match(Bv);if(r){var o=r[1],s=r[2];o.startsWith("__")?Bi.warn(`Ignoring reserved handoff group tag '${o}'`):(t.has(o)||t.set(o,{}),t.get(o)[s]=e[a])}}return Array.from(t,([e,t])=>({tag:e,data:t})).filter(e=>Object.values(e.data).some(e=>!0===e)).sort((e,t)=>e.tag.localeCompare(t.tag))}},{key:"resumeNextHandoff",value:function(){var e=this.activeHandoffSequence;if(!e)return Bi.warn("No active handoff sequence to resume"),void this.manager.resume();if("groups"in e){if(0===e.groups.length)return Bi.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,this.disarmResumeDrop(),void this.manager.resume();var t=e.groups.shift();return function(e){return Object.values(Rf).includes(e)}(t.tag)||Bi.warn(`handoff group tag '${t.tag}' is outside the NamiHandoffTag vocabulary — passing through`),this.activeHandoffSequence=e,Bi.debug(`Starting grouped handoff for '${t.tag}' → ${JSON.stringify(t.data)}`),void this.manager.deliverHandoff(t.tag,t.data)}if(0===e.remainingKeys.length)return Bi.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,this.disarmResumeDrop(),void this.manager.resume();var n=e.remainingKeys.shift(),i=e.formStates[n];Bi.debug(`Starting handoff for ${n} → ${String(i)}`),this.activeHandoffSequence=e,this.manager.deliverHandoff(`${n}`,void 0)}}])}(zv),Hv=function(){return c(function e(){o(this,e),this.emitter=Sc.getInstance()},[{key:"sdkInitialized",get:function(){return Ef.instance.isInitialized}},{key:"campaignTypeAndLabel",value:function(t,n){var i,a="";return t&&!n&&qd(t)?(a=t,i=e.NamiCampaignRuleType.URL):t?(a=t,i=e.NamiCampaignRuleType.LABEL):n&&(a=n,i=e.NamiCampaignRuleType.URL),{type:i,value:a}}}],[{key:"allCampaigns",value:function(){if(!this.instance.sdkInitialized)throw new Ao;return nc()}},{key:"isCampaignAvailable",value:function(e){if(!this.instance.sdkInitialized)throw new Ao;var t=this.instance.campaignTypeAndLabel(e),n=t.type,i=t.value,a=uc(i,n),r=a.campaign,o=a.paywall;return null!=r&&r.flow?new zv(r.flow.object).allScreensAvailable:Boolean(r&&o)}},{key:"isFlow",value:function(e,t){if(!this.instance.sdkInitialized)throw new Ao;var n=this.instance.campaignTypeAndLabel(e,t),i=n.type,a=n.value;return al(uc(a,i).campaign)}},{key:"refresh",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(this.instance.sdkInitialized){e.n=1;break}throw new Ao;case 1:return bu(),e.n=2,a(pf.instance.fetchCampaignsAndPaywalls());case 2:return e.a(2,nc())}},null,this,null,Promise)}},{key:"registerAvailableCampaignsHandler",value:function(e){return this.instance.emitter.addListener(Ei,e),()=>{this.instance.emitter.removeListener(Ei,e)}}},{key:"launch",value:function(t,n,i,a,r){var o,s,u,l,d,c,h,f,v,p;a=null!=a?a:()=>{},i=null!=i?i:{customAttributes:{}};var g=this.instance.campaignTypeAndLabel(t,n),b=g.type,w=g.value;if(!this.instance.sdkInitialized)throw a(!1,e.LaunchCampaignError.SDK_NOT_INITIALIZED),new Ao;var k,S=qm.firstLaunchLookup(w,()=>uc(w,b)),E=S.paywall,P=S.campaign,_=!P||!E&&!P.flow;_&&(k=t||n?t?e.LaunchCampaignError.LABELED_CAMPAIGN_NOT_FOUND:n?e.LaunchCampaignError.URL_CAMPAIGN_NOT_FOUND:e.LaunchCampaignError.CAMPAIGN_DATA_NOT_FOUND:e.LaunchCampaignError.DEFAULT_CAMPAIGN_NOT_FOUND,a(!1,k),E={});var T={campaignId:null!==(o=null==P?void 0:P.rule)&&void 0!==o?o:"",campaignName:null!==(s=null==P?void 0:P.name)&&void 0!==s?s:"",campaignType:null!==(u=null==P?void 0:P.type)&&void 0!==u?u:"",campaignLabel:t?w:"",campaignUrl:n?w:"",paywallId:null!=P&&P.flow?void 0:(null===(l=E)||void 0===l?void 0:l.id)||"",paywallName:null!=P&&P.flow?void 0:(null===(d=E)||void 0===d?void 0:d.name)||"",segmentId:null==P?void 0:P.segment,externalSegmentId:null!==(c=null==P?void 0:P.external_segment)&&void 0!==c?c:null,action:e.NamiPaywallAction.UNKNOWN},M=Po.getPurchaseChannel();M&&(T=m({},T,{purchaseChannel:M}));var A,D,x,C,I,L,F,R,O=null===(h=i)||void 0===h?void 0:h.productGroups,$=null===(f=E)||void 0===f||null===(f=f.sku_menus)||void 0===f?void 0:f.map(e=>e.ref);if((x=null===(A=Po.getNamiConfig())||void 0===A?void 0:A.namiCommands,null!==(D=null==x?void 0:x.includes(En))&&void 0!==D&&D&&null!=O&&O.length&&null!=$)&&0==(null==$?void 0:$.filter(e=>null==O?void 0:O.some(t=>t===e))).length)throw a(!1,e.LaunchCampaignError.PRODUCT_GROUPS_NOT_FOUND),new Io;if(null!=P&&P.flow&&!ll(null!==(v=null===(p=P.flow.object)||void 0===p?void 0:p.screens)&&void 0!==v?v:[]))throw a(!1,e.LaunchCampaignError.FLOW_SCREEN_DATA_UNAVILABLE),new Lo;_||lf.shared.record({placementLabel:null!==(C=null!==(I=null==P?void 0:P.value)&&void 0!==I?I:w)&&void 0!==C?C:"",tags:null!==(L=null==P?void 0:P.placement_tags)&&void 0!==L?L:[],customAttributes:null!==(F=null===(R=i)||void 0===R?void 0:R.customAttributes)&&void 0!==F?F:{}});_||vf.shared.placementWillRaise();var N=we().ui.createPaywall(b,w,i),W=Yu();return Po.setLaunchId(W),r&&this.instance.emitter.addListener(_i,t=>{var n=t.action,i=y(t,ge);r(m({},T,i,{action:null!=n?n:e.NamiPaywallAction.UNKNOWN}))}),setTimeout(()=>a(!0),0),N}},{key:"getProductGroups",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=uc(o,r).paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.map(e=>e.ref))&&void 0!==n?n:[]}},{key:"getAllProducts",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=uc(o,r).paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.flatMap(e=>{var t,n;return null!==(t=null===(n=e.products)||void 0===n?void 0:n.map(e=>e.sku_ref_id))&&void 0!==t?t:[]}))&&void 0!==n?n:[]}},{key:"getCurrentProducts",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value,s=uc(o,r),u=Bm.currentProvider,l=null==u?void 0:u.getCurrentGroupId();return l&&null!==(n=null===(i=s.paywall)||void 0===i||null===(i=i.sku_menus)||void 0===i?void 0:i.filter(e=>e.id===l).flatMap(e=>{var t,n;return null!==(t=null===(n=e.products)||void 0===n?void 0:n.map(e=>e.sku_ref_id))&&void 0!==t?t:[]}))&&void 0!==n?n:[]}}])}();Hv.instance=new Hv;var Gv=Hv,Vv=Rv,Kv=function(){return c(function e(){o(this,e),this.emitter=Sc.getInstance()},[{key:"sdkInitialized",get:function(){return Ef.instance.isInitialized}}],[{key:"active",value:function(){return wu(),Um()}},{key:"isEntitlementActive",value:function(e){return!!wu("NamiEntitlementManager.isEntitlementActive")&&this.active().some(t=>t.referenceId==e)}},{key:"refresh",value:function(){return k(function(e){for(;;)switch(e.n){case 0:if(this.instance.sdkInitialized){e.n=1;break}throw new Ao;case 1:if(wu("NamiEntitlementManager.refresh")){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,a(Vm.instance.fetchActiveEntitlements());case 3:return e.a(2,Um())}},null,this,null,Promise)}},{key:"registerActiveEntitlementsHandler",value:function(e){if(wu("NamiEntitlementManager.registerActiveEntitlementsHandler"))return this.instance.emitter.addListener(Mi,e),()=>{this.instance.emitter.removeListener(Mi,e)}}},{key:"clearProvisionalEntitlementGrants",value:function(){var e=Um();e=e.filter(e=>e.expires&&e.expires>(new Date).valueOf()),Po.setNamiEntitlements(Ct,e),this.instance.emitter.emit(Mi)}}])}();Kv.instance=new Kv;var Yv,Xv,qv=Kv,Jv=Iv,Qv=Cv,Zv=eh,ep={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},tp={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},np="wave",ip="pulse",ap="none";function rp(e){var t,n=null!==(t=e.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/))&&void 0!==t?t:[],i=n[0],a=n[1],r=n[2],o=n[3],s=n[4],u=n[5];return{semver:i,major:Number.parseInt(a)||3,minor:Number.parseInt(r)||0,patch:Number.parseInt(o)||0,prerelease:s,buildmetadata:u}}function op(e,t){e&&(function(e,t){return e.major!==t.major?e.major>t.major?1:-1:e.minor!==t.minor?e.minor>t.minor?1:-1:e.patch!==t.patch?e.patch>t.patch?1:-1:0}(rp(Le),e)>=0||Bi.warn(`Component ${t} requires SDK version ${e.semver} or higher, but current SDK version is ${Le}`))}function sp(e){return!e||"object"==typeof e&&0==Object.keys(e).length}!function(e){e.DEFAULT="default",e.JOURNEY="journey",e.LABEL="label",e.URL="url"}(Yv||(Yv={})),function(e){e.DEEPLINK="deeplink",e.IN_APP="in_app"}(Xv||(Xv={}));function up(e){if("number"==typeof e)return Number.isFinite(e)?e:NaN;if("string"==typeof e){var t=e.trim();if(""===t)return NaN;var n=Number(t);return Number.isFinite(n)?n:NaN}return NaN}function lp(e){return"steps"===e.style}function dp(e){return"fixed"===e?"fixed":"even"}function cp(...e){for(var t=0,n=e;t<n.length;t++){var i=n[t];if(null!=i&&("string"!=typeof i||""!==i.trim()))return i}}var hp=Gv,mp=Vv,fp=Qv,vp=qv,pp=Jv,gp=Zv,yp=Sf,bp=Object.freeze({__proto__:null,NamiCampaignManager:hp,NamiCustomerManager:mp,NamiEntitlementManager:vp,NamiFlowManager:pp,NamiPaywallManager:fp,NamiProfileManager:yp,NamiPurchaseManager:gp}),wp=function(){return c(function e(){o(this,e)},[{key:"getItem",value:function(e){try{return localStorage.getItem(e)}catch(e){return null}}},{key:"setItem",value:function(e,t){try{localStorage.setItem(e,t)}catch(e){}}},{key:"removeItem",value:function(e){try{localStorage.removeItem(e)}catch(e){}}},{key:"clear",value:function(){try{localStorage.clear()}catch(e){}}},{key:"getAllKeys",value:function(){try{return Object.keys(localStorage)}catch(e){return[]}}}])}();function kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sp,Ep={exports:{}};var Pp=(Sp||(Sp=1,function(e){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var i=n(18),a=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});t.push(0);var n=t[0],i=t[1];if(10===n)switch(i){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(n){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map(function(e){return parseInt(e,10)||0});if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,i){void 0===i&&(i=!1);var a=e.getVersionPrecision(t),r=e.getVersionPrecision(n),o=Math.max(a,r),s=0,u=e.map([t,n],function(t){var n=o-e.getVersionPrecision(t),i=t+new Array(n+1).join(".0");return e.map(i.split("."),function(e){return new Array(20-e.length).join("0")+e}).reverse()});for(i&&(s=o-Math.min(a,r)),o-=1;o>=s;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===s)return 0;o-=1}else if(u[0][o]<u[1][o])return-1}},e.map=function(e,t){var n,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)i.push(t(e[n]));return i},e.find=function(e,t){var n,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,i=e.length;n<i;n+=1){var a=e[n];if(t(a,n))return a}},e.assign=function(e){for(var t,n,i=e,a=arguments.length,r=new Array(a>1?a-1:0),o=1;o<a;o++)r[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(r));var s=function(){var e=r[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach(function(t){i[t]=e[t]})};for(t=0,n=r.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return i.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return i.BROWSER_MAP[e]||""},e}();t.default=a,e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",Brave:"brave",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",DuckDuckGo:"duckduckgo",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Linespider:"linespider",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SlackBot:"slackbot",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},t.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",brave:"Brave",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",duckduckgo:"DuckDuckGo",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",linespider:"Linespider",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",slackbot:"SlackBot",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},t.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},t.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},t.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(91))&&i.__esModule?i:{default:i},r=n(18);function o(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.key,i)}}var s=function(){function e(){}var t,n,i;return e.getParser=function(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=null),"string"!=typeof e)throw new Error("UserAgent should be a string");return new a.default(e,t,n)},e.parse=function(e,t){return void 0===t&&(t=null),new a.default(e,t).getResult()},t=e,i=[{key:"BROWSER_MAP",get:function(){return r.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return r.ENGINE_MAP}},{key:"OS_MAP",get:function(){return r.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return r.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),i&&o(t,i),e}();t.default=s,e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var i=u(n(92)),a=u(n(93)),r=u(n(94)),o=u(n(95)),s=u(n(17));function u(e){return e&&e.__esModule?e:{default:e}}var l=function(){function e(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=null),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e;var i=!1;"boolean"==typeof t?(i=t,this._hints=n):this._hints=null!=t&&"object"==typeof t?t:null,this.parsedResult={},!0!==i&&this.parse()}var t=e.prototype;return t.getHints=function(){return this._hints},t.hasBrand=function(e){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var t=e.toLowerCase();return this._hints.brands.some(function(e){return e.brand&&e.brand.toLowerCase()===t})},t.getBrandVersion=function(e){if(this._hints&&Array.isArray(this._hints.brands)){var t=e.toLowerCase(),n=this._hints.brands.find(function(e){return e.brand&&e.brand.toLowerCase()===t});return n?n.version:void 0}},t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(i.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA(),this)),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(a.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(r.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some(function(t){return e.test(t)});throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},i=0,a={},r=0;if(Object.keys(e).forEach(function(t){var o=e[t];"string"==typeof o?(a[t]=o,r+=1):"object"==typeof o&&(n[t]=o,i+=1)}),i>0){var o=Object.keys(n),u=s.default.find(o,function(e){return t.isOS(e)});if(u){var l=this.satisfies(n[u]);if(void 0!==l)return l}var d=s.default.find(o,function(e){return t.isPlatform(e)});if(d){var c=this.satisfies(n[d]);if(void 0!==c)return c}}if(r>0){var h=Object.keys(a),m=s.default.find(h,function(e){return t.isBrowser(e,!0)});if(void 0!==m)return this.compareVersion(a[m])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),a=s.default.getBrowserTypeByAlias(i);return t&&a&&(i=a.toLowerCase()),i===n},t.compareVersion=function(e){var t=[0],n=e,i=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(i=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(i=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(a,n,i))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some(function(e){return t.is(e)})},e}();t.default=l,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/gptbot/i],describe:function(e){var t={name:"GPTBot"},n=a.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:"ChatGPT-User"},n=a.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:"OAI-SearchBot"},n=a.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:"ClaudeBot"},n=a.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:"Omgilibot"},n=a.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/diffbot/i],describe:function(e){var t={name:"Diffbot"},n=a.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:"PerplexityBot"},n=a.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:"Perplexity-User"},n=a.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/youbot/i],describe:function(e){var t={name:"YouBot"},n=a.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:"Meta-WebIndexer"},n=a.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:"Meta-ExternalAds"},n=a.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:"Meta-ExternalAgent"},n=a.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:"Meta-ExternalFetcher"},n=a.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/linespider/i],describe:function(e){var t={name:"Linespider"},n=a.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/amazonbot/i],describe:function(e){var t={name:"AmazonBot"},n=a.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/bingbot/i],describe:function(e){var t={name:"BingCrawler"},n=a.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/baiduspider/i],describe:function(e){var t={name:"BaiduSpider"},n=a.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:"DuckDuckBot"},n=a.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:"InternetArchiveCrawler"},n=a.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(e){var t={name:"SlackBot"},n=a.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=a.default.getFirstMatch(r,e)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/librewolf/i],describe:function(e){var t={name:"LibreWolf"},n=a.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:"Sogou Browser"},n=a.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),i=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),r=a.default.getFirstMatch(/se ([\d.]+)x/i,e),o=n||i||r;return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return!!e.hasBrand("DuckDuckGo")||e.test(/\sDdg\/[\d.]+$/i)},describe:function(e,t){var n={name:"DuckDuckGo"};if(t){var i=t.getBrandVersion("DuckDuckGo");if(i)return n.version=i,n}var r=a.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,e);return r&&(n.version=r),n}},{test:function(e){return e.hasBrand("Brave")},describe:function(e,t){var n={name:"Brave"};if(t){var i=t.getBrandVersion("Brave");if(i)return n.version=i,n}return n}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=a.default.getFirstMatch(r,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(t,e),version:a.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:r.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=a.default.getWindowsVersionName(t);return{name:r.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:r.OS_MAP.iOS},n=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=a.default.getMacOSVersionName(t),i={name:r.OS_MAP.MacOS,version:t};return n&&(i.versionName=n),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:r.OS_MAP.iOS,version:t}}},{test:[/OpenHarmony/i],describe:function(e){var t=a.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.HarmonyOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=a.default.getAndroidVersionName(t),i={name:r.OS_MAP.Android,version:t};return n&&(i.versionName=n),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:r.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||a.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:r.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:r.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:r.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:r.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:r.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(e){var t=a.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:r.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=a.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:r.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=a.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:r.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{test:[/[^-]mobi/i],describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:r.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:r.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.mobile}}},{test:[/smart-?tv|smarttv/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:r.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var i,a=(i=n(17))&&i.__esModule?i:{default:i},r=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:r.ENGINE_MAP.Blink};var t=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:r.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:r.ENGINE_MAP.Trident},n=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:r.ENGINE_MAP.Presto},n=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:r.ENGINE_MAP.Gecko},n=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:r.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:r.ENGINE_MAP.WebKit},n=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})}(Ep)),Ep.exports),_p=kp(Pp),Tp={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},Mp={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4},Ap=function(){return c(function e(){o(this,e)},[{key:"getDeviceData",value:function(e){if("undefined"==typeof window)return{os_version:"X.X.X",os_name:"Server",browser_name:"Unknown",browser_version:"X.X.X",sdk_client:"web",sdk_version:Le,language:"en"};var t=_p.getParser(window.navigator.userAgent),n=t.getPlatform(),i={os_version:t.getOSVersion(),os_name:t.getOSName(),browser_name:t.getBrowserName(),browser_version:t.getBrowserVersion(),sdk_client:"web",sdk_version:Le,language:window.navigator.language};if(n.type&&(i.form_factor=Tp[n.type]),n.model&&(i.device_model=n.model),e&&e.length>0){var a=(e=>{var t=e.find(e=>e.includes(bn)),n={platform:"",version:""};if(t){var i=t.split(kn);n.platform=i[1],n.version=i[2]}return n})(e);i.extended_platform=a.platform,i.extended_platform_version=a.version}return i}},{key:"getDeviceFormFactor",value:function(){if("undefined"==typeof window)return"desktop";var e=_p.getParser(window.navigator.userAgent).getPlatform();return e.type&&Tp[e.type]||"desktop"}},{key:"getDeviceScaleFactor",value:function(e){var t;if(e||(e=this.getDeviceFormFactor()),"television"!==e)return 1;var n=window,i=n.innerWidth,a=n.innerHeight,r=i.toString()+"x"+a.toString();return null!==(t=Mp[r])&&void 0!==t?t:Math.min(i/1920,a/1080)||1}},{key:"getScreenInfo",value:function(){var e,t,n,i;return"undefined"==typeof window?{width:1920,height:1080,scale:1}:{width:null!==(e=null===(t=window.screen)||void 0===t?void 0:t.width)&&void 0!==e?e:window.innerWidth,height:null!==(n=null===(i=window.screen)||void 0===i?void 0:i.height)&&void 0!==n?n:window.innerHeight,scale:window.devicePixelRatio||1}}},{key:"getLanguage",value:function(){return"undefined"==typeof window?"en":window.navigator.language||"en"}},{key:"onAppForeground",value:function(e){if("undefined"==typeof document)return()=>{};var t=()=>{"visible"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},{key:"onAppBackground",value:function(e){if("undefined"==typeof document)return()=>{};var t=()=>{"hidden"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},{key:"isAppVisible",value:function(){return"undefined"==typeof document||"hidden"!==document.visibilityState}},{key:"generateUUID",value:function(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}])}();function Dp(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"==typeof SuppressedError&&SuppressedError;var xp,Cp,Ip,Lp=globalThis,Fp=Lp.ShadowRoot&&(void 0===Lp.ShadyCSS||Lp.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rp=Symbol(),Op=new WeakMap,$p=function(){return c(function e(t,n,i){if(o(this,e),this._$cssResult$=!0,i!==Rp)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n},[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(Fp&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Op.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Op.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Np=e=>new $p("string"==typeof e?e:e+"",void 0,Rp),Wp=(e,...t)=>{var n=1===e.length?e[0]:t.reduce((t,n,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[i+1],e[0]);return new $p(n,e,Rp)},jp=Fp?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=h(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return Np(n)})(e):e,Bp=Object.is,zp=Object.defineProperty,Up=Object.getOwnPropertyDescriptor,Hp=Object.getOwnPropertyNames,Gp=Object.getOwnPropertySymbols,Vp=Object.getPrototypeOf,Kp=globalThis,Yp=Kp.trustedTypes,Xp=Yp?Yp.emptyScript:"",qp=Kp.reactiveElementPolyfillSupport,Jp=(e,t)=>e,Qp={toAttribute(e,t){switch(t){case Boolean:e=e?Xp:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){var 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}},Zp=(e,t)=>!Bp(e,t),eg={attribute:!0,type:String,converter:Qp,reflect:!1,useDefault:!1,hasChanged:Zp};null!==(xp=Symbol.metadata)&&void 0!==xp||(Symbol.metadata=Symbol("metadata")),null!==(Cp=Kp.litPropertyMetadata)&&void 0!==Cp||(Kp.litPropertyMetadata=new WeakMap);var tg,ng=function(e){function t(){var e;return o(this,t),(e=r(this,t))._$Ep=void 0,e.isUpdatePending=!1,e.hasUpdated=!1,e._$Em=null,e._$Ev(),e}return p(t,e),c(t,[{key:"_$Ev",value:function(){var e;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach(e=>e(this))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$EO)&&void 0!==t?t:this._$EO=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$EO)||void 0===t||t.delete(e)}},{key:"_$E_",value:function(){for(var e,t=new Map,n=h(this.constructor.elementProperties.keys());!(e=n()).done;){var i=e.value;this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i])}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(Fp)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(var n,i=h(t);!(n=i()).done;){var a=n.value,r=document.createElement("style"),o=Lp.litNonce;void 0!==o&&r.setAttribute("nonce",o),r.textContent=a.cssText,e.appendChild(r)}})(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e,t;null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$EO)||void 0===t||t.forEach(e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)})}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$EO)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)})}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$ET",value:function(e,t){var n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){var a,r=(void 0!==(null===(a=n.converter)||void 0===a?void 0:a.toAttribute)?n.converter:Qp).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}},{key:"_$AK",value:function(e,t){var n=this.constructor,i=n._$Eh.get(e);if(void 0!==i&&this._$Em!==i){var a,r,o,s=n.getPropertyOptions(i),u="function"==typeof s.converter?{fromAttribute:s.converter}:void 0!==(null===(a=s.converter)||void 0===a?void 0:a.fromAttribute)?s.converter:Qp;this._$Em=i;var l=u.fromAttribute(t,s.type);this[i]=null!==(r=null!=l?l:null===(o=this._$Ej)||void 0===o?void 0:o.get(i))&&void 0!==r?r:l,this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n,i=!1,a){if(void 0!==e){var r,o,s=this.constructor;if(!1===i&&(a=this[e]),null!=n||(n=s.getPropertyOptions(e)),!((null!==(r=n.hasChanged)&&void 0!==r?r:Zp)(a,t)||n.useDefault&&n.reflect&&a===(null===(o=this._$Ej)||void 0===o?void 0:o.get(e))&&!this.hasAttribute(s._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(e,t,{useDefault:n,reflect:i,wrapped:a},r){var o,s,u;n&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,null!==(s=null!=r?r:t)&&void 0!==s?s:this[e]),!0!==a||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(null!==(u=this._$Eq)&&void 0!==u?u:this._$Eq=new Set).add(e))}},{key:"_$EP",value:function(){var e,t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return this.isUpdatePending=!0,n.p=1,n.n=2,a(this._$ES);case 2:n.n=4;break;case 3:n.p=3,t=n.v,Promise.reject(t);case 4:if(e=this.scheduleUpdate(),!(null!=e)){n.n=5;break}return n.n=5,a(e);case 5:return n.a(2,!this.isUpdatePending)}},null,this,[[1,3]],Promise)}},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var e;if(null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(var t,n=h(this._$Ep);!(t=n()).done;){var i=t.value,a=i[0],r=i[1];this[a]=r}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0)for(var s,u=h(o);!(s=u()).done;){var l=s.value,d=l[0],c=l[1],m=c.wrapped,f=this[d];!0!==m||this._$AL.has(d)||void 0===f||this.C(d,void 0,c,f)}}var v=!1,p=this._$AL;try{var g;(v=this.shouldUpdate(p))?(this.willUpdate(p),null!==(g=this._$EO)&&void 0!==g&&g.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(p)):this._$EM()}catch(p){throw v=!1,this._$EM(),p}v&&this._$AE(p)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null!==(t=this._$EO)&&void 0!==t&&t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;this._$Ei(),(null!==(t=this.l)&&void 0!==t?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}},{key:"createProperty",value:function(e,t=eg){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&zp(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Up(this.prototype,e))&&void 0!==i?i:{get(){return this[t]},set(e){this[t]=e}},r=a.get,o=a.set;return{get:r,set(t){var i=null==r?void 0:r.call(this);null!=o&&o.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:eg}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Jp("elementProperties"))){var e=Vp(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Jp("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Jp("properties")))for(var e=this.properties,t=0,n=[...Hp(e),...Gp(e)];t<n.length;t++){var i=n[t];this.createProperty(i,e[i])}var a=this[Symbol.metadata];if(null!==a){var r=litPropertyMetadata.get(a);if(void 0!==r)for(var o,s=h(r);!(o=s()).done;){var u=o.value,l=u[0],d=u[1];this.elementProperties.set(l,d)}}this._$Eh=new Map;for(var c,m=h(this.elementProperties);!(c=m()).done;){var f=c.value,v=f[0],p=f[1],g=this._$Eu(v,p);void 0!==g&&this._$Eh.set(g,v)}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e))for(var n,i=h(new Set(e.flat(1/0).reverse()));!(n=i()).done;){var a=n.value;t.unshift(jp(a))}else void 0!==e&&t.push(jp(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}(M(HTMLElement));ng.elementStyles=[],ng.shadowRootOptions={mode:"open"},ng[Jp("elementProperties")]=new Map,ng[Jp("finalized")]=new Map,null!=qp&&qp({ReactiveElement:ng}),(null!==(Ip=Kp.reactiveElementVersions)&&void 0!==Ip?Ip:Kp.reactiveElementVersions=[]).push("2.1.2");var ig=globalThis,ag=e=>e,rg=ig.trustedTypes,og=rg?rg.createPolicy("lit-html",{createHTML:e=>e}):void 0,sg="$lit$",ug=`lit$${Math.random().toFixed(9).slice(2)}$`,lg="?"+ug,dg=`<${lg}>`,cg=document,hg=()=>cg.createComment(""),mg=e=>null===e||"object"!=typeof e&&"function"!=typeof e,fg=Array.isArray,vg="[ \t\n\f\r]",pg=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gg=/-->/g,yg=/>/g,bg=RegExp(`>|${vg}(?:([^\\s"'>=/]+)(${vg}*=${vg}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),wg=/'/g,kg=/"/g,Sg=/^(?:script|style|textarea|title)$/i,Eg=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),Pg=Eg(1),_g=Eg(2),Tg=Symbol.for("lit-noChange"),Mg=Symbol.for("lit-nothing"),Ag=new WeakMap,Dg=cg.createTreeWalker(cg,129);function xg(e,t){if(!fg(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==og?og.createHTML(t):t}var Cg=function(){return c(function e({strings:t,_$litType$:n},i){var a;o(this,e),this.parts=[];var r=0,s=0,u=t.length-1,l=this.parts,d=((e,t)=>{for(var n,i=e.length-1,a=[],r=2===t?"<svg>":3===t?"<math>":"",o=pg,s=0;s<i;s++){for(var u=e[s],l=void 0,d=void 0,c=-1,h=0;h<u.length&&(o.lastIndex=h,null!==(d=o.exec(u)));)h=o.lastIndex,o===pg?"!--"===d[1]?o=gg:void 0!==d[1]?o=yg:void 0!==d[2]?(Sg.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=bg):void 0!==d[3]&&(o=bg):o===bg?">"===d[0]?(o=null!=n?n:pg,c=-1):void 0===d[1]?c=-2:(c=o.lastIndex-d[2].length,l=d[1],o=void 0===d[3]?bg:'"'===d[3]?kg:wg):o===kg||o===wg?o=bg:o===gg||o===yg?o=pg:(o=bg,n=void 0);var m=o===bg&&e[s+1].startsWith("/>")?" ":"";r+=o===pg?u+dg:c>=0?(a.push(l),u.slice(0,c)+sg+u.slice(c)+ug+m):u+ug+(-2===c?s:m)}return[xg(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),a]})(t,n),c=d[0],m=d[1];if(this.el=e.createElement(c,i),Dg.currentNode=this.el.content,2===n||3===n){var f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;null!==(a=Dg.nextNode())&&l.length<u;){if(1===a.nodeType){if(a.hasAttributes())for(var v,p=h(a.getAttributeNames());!(v=p()).done;){var g=v.value;if(g.endsWith(sg)){var y=m[s++],b=a.getAttribute(g).split(ug),w=/([.?@])?(.*)/.exec(y);l.push({type:1,index:r,name:w[2],strings:b,ctor:"."===w[1]?Og:"?"===w[1]?$g:"@"===w[1]?Ng:Rg}),a.removeAttribute(g)}else g.startsWith(ug)&&(l.push({type:6,index:r}),a.removeAttribute(g))}if(Sg.test(a.tagName)){var k=a.textContent.split(ug),S=k.length-1;if(S>0){a.textContent=rg?rg.emptyScript:"";for(var E=0;E<S;E++)a.append(k[E],hg()),Dg.nextNode(),l.push({type:2,index:++r});a.append(k[S],hg())}}}else if(8===a.nodeType)if(a.data===lg)l.push({type:2,index:r});else for(var P=-1;-1!==(P=a.data.indexOf(ug,P+1));)l.push({type:7,index:r}),P+=ug.length-1;r++}},null,[{key:"createElement",value:function(e,t){var n=cg.createElement("template");return n.innerHTML=e,n}}])}();function Ig(e,t,n=e,i){var a,r,o,s,u;if(t===Tg)return t;var l=void 0!==i?null===(a=n._$Co)||void 0===a?void 0:a[i]:n._$Cl,d=mg(t)?void 0:t._$litDirective$;return(null===(r=l)||void 0===r?void 0:r.constructor)!==d&&(null!==(o=l)&&void 0!==o&&null!==(s=o._$AO)&&void 0!==s&&s.call(o,!1),void 0===d?l=void 0:(l=new d(e))._$AT(e,n,i),void 0!==i?(null!==(u=n._$Co)&&void 0!==u?u:n._$Co=[])[i]=l:n._$Cl=l),void 0!==l&&(t=Ig(e,l._$AS(e,t.values),l,i)),t}var Lg=function(){return c(function e(t,n){o(this,e),this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n},[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"u",value:function(e){var t,n=this._$AD,i=n.el.content,a=n.parts,r=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:cg).importNode(i,!0);Dg.currentNode=r;for(var o=Dg.nextNode(),s=0,u=0,l=a[0];void 0!==l;){var d;if(s===l.index){var c=void 0;2===l.type?c=new Fg(o,o.nextSibling,this,e):1===l.type?c=new l.ctor(o,l.name,l.strings,this,e):6===l.type&&(c=new Wg(o,this,e)),this._$AV.push(c),l=a[++u]}s!==(null===(d=l)||void 0===d?void 0:d.index)&&(o=Dg.nextNode(),s++)}return Dg.currentNode=cg,r}},{key:"p",value:function(e){for(var t,n=0,i=h(this._$AV);!(t=i()).done;){var a=t.value;void 0!==a&&(void 0!==a.strings?(a._$AI(e,a,n),n+=a.strings.length-2):a._$AI(e[n])),n++}}}])}(),Fg=function(){return c(function e(t,n,i,a){var r;o(this,e),this.type=2,this._$AH=Mg,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=a,this._$Cv=null===(r=null==a?void 0:a.isConnected)||void 0===r||r},[{key:"_$AU",get:function(){var e,t;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cv}},{key:"parentNode",get:function(){var e,t=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===(null===(e=t)||void 0===e?void 0:e.nodeType)&&(t=n.parentNode),t}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(e,t=this){e=Ig(this,e,t),mg(e)?e===Mg||null==e||""===e?(this._$AH!==Mg&&this._$AR(),this._$AH=Mg):e!==this._$AH&&e!==Tg&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>fg(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this._(e)}},{key:"O",value:function(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}},{key:"T",value:function(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}},{key:"_",value:function(e){this._$AH!==Mg&&mg(this._$AH)?this._$AA.nextSibling.data=e:this.T(cg.createTextNode(e)),this._$AH=e}},{key:"$",value:function(e){var t,n=e.values,i=e._$litType$,a="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Cg.createElement(xg(i.h,i.h[0]),this.options)),i);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===a)this._$AH.p(n);else{var r=new Lg(a,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}},{key:"_$AC",value:function(e){var t=Ag.get(e.strings);return void 0===t&&Ag.set(e.strings,t=new Cg(e)),t}},{key:"k",value:function(e){fg(this._$AH)||(this._$AH=[],this._$AR());for(var t,n,i=this._$AH,a=0,r=h(e);!(n=r()).done;){var o=n.value;a===i.length?i.push(t=new _k(this.O(hg()),this.O(hg()),this,this.options)):t=i[a],t._$AI(o),a++}a<i.length&&(this._$AR(t&&t._$AB.nextSibling,a),i.length=a)}},{key:"_$AR",value:function(e=this._$AA.nextSibling,t){for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,t);e!==this._$AB;){var n,i=ag(e).nextSibling;ag(e).remove(),e=i}}},{key:"setConnected",value:function(e){var t;void 0===this._$AM&&(this._$Cv=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}])}(),Rg=function(){return c(function e(t,n,i,a,r){o(this,e),this.type=1,this._$AH=Mg,this._$AN=void 0,this.element=t,this.name=n,this._$AM=a,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Mg},[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e,t=this,n,i){var a=this.strings,r=!1;if(void 0===a)e=Ig(this,e,t,0),(r=!mg(e)||e!==this._$AH&&e!==Tg)&&(this._$AH=e);else{var o,s,u=e;for(e=a[0],o=0;o<a.length-1;o++)(s=Ig(this,u[n+o],t,o))===Tg&&(s=this._$AH[o]),r||(r=!mg(s)||s!==this._$AH[o]),s===Mg?e=Mg:e!==Mg&&(e+=(null!=s?s:"")+a[o+1]),this._$AH[o]=s}r&&!i&&this.j(e)}},{key:"j",value:function(e){e===Mg?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}])}(),Og=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).type=3,e}return p(t,e),c(t,[{key:"j",value:function(e){this.element[this.name]=e===Mg?void 0:e}}])}(Rg),$g=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).type=4,e}return p(t,e),c(t,[{key:"j",value:function(e){this.element.toggleAttribute(this.name,!!e&&e!==Mg)}}])}(Rg),Ng=function(e){function t(e,n,i,a,s){var u;return o(this,t),(u=r(this,t,[e,n,i,a,s])).type=5,u}return p(t,e),c(t,[{key:"_$AI",value:function(e,t=this){var n;if((e=null!==(n=Ig(this,e,t,0))&&void 0!==n?n:Mg)!==Tg){var i=this._$AH,a=e===Mg&&i!==Mg||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==Mg&&(i===Mg||a);a&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}}},{key:"handleEvent",value:function(e){var t,n;"function"==typeof this._$AH?this._$AH.call(null!==(t=null===(n=this.options)||void 0===n?void 0:n.host)&&void 0!==t?t:this.element,e):this._$AH.handleEvent(e)}}])}(Rg),Wg=function(){return c(function e(t,n,i){o(this,e),this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i},[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){Ig(this,e)}}])}(),jg={I:Fg},Bg=ig.litHtmlPolyfillSupport;null!=Bg&&Bg(Cg,Fg),(null!==(tg=ig.litHtmlVersions)&&void 0!==tg?tg:ig.litHtmlVersions=[]).push("3.3.3");var zg,Ug,Hg=globalThis,Gg=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).renderOptions={host:i(e)},e._$Do=void 0,e}return p(t,e),c(t,[{key:"createRenderRoot",value:function(){var e,n,i=_(t,"createRenderRoot",this)([]);return null!==(n=(e=this.renderOptions).renderBefore)&&void 0!==n||(e.renderBefore=i.firstChild),i}},{key:"update",value:function(e){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),_(t,"update",this)([e]),this._$Do=((e,t,n)=>{var i,a=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t,r=a._$litPart$;if(void 0===r){var o,s=null!==(o=null==n?void 0:n.renderBefore)&&void 0!==o?o:null;a._$litPart$=r=new Fg(t.insertBefore(hg(),s),s,void 0,null!=n?n:{})}return r._$AI(e),r})(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;_(t,"connectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;_(t,"disconnectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Tg}}])}(ng);Gg._$litElement$=!0,Gg.finalized=!0,null===(zg=Hg.litElementHydrateSupport)||void 0===zg||zg.call(Hg,{LitElement:Gg});var Vg=Hg.litElementPolyfillSupport;null==Vg||Vg({LitElement:Gg}),(null!==(Ug=Hg.litElementVersions)&&void 0!==Ug?Ug:Hg.litElementVersions=[]).push("4.2.2");var Kg,Yg,Xg=Wp(Kg||(Kg=(e=>e)`
|
|
2
2
|
/* ——— keyframes ——— */
|
|
3
3
|
@keyframes nami-slide-up {
|
|
4
4
|
from { transform: translateY(100%); }
|