@namiml/web-sdk 3.4.3-dev.202606120301 → 3.4.3-dev.202606121440
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.cjs +1 -1
- package/dist/nami-web.mjs +1 -1
- package/dist/nami-web.umd.js +2 -2
- 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,M(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 T(e,t,n,i){var a=f(v(e.prototype),t,n);return 2&i&&"function"==typeof a?function(e){return a.apply(n,e)}:a}function M(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function _(e){var t="function"==typeof Map?new Map:void 0;return _=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(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)},_(e)}var A,D,x,C,I,L,R,F,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),R.set(this,void 0),F.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,R,`${t}`,"f"),B(this,F,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,F,"f")}},{key:"currentTarget",get:function(){return z(this,F,"f")}},{key:"srcElement",get:function(){return z(this,F,"f")}},{key:"type",get:function(){return z(this,R,"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,F,"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,R=new WeakMap,F=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,X,Y,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!==(X=globalThis.CustomEvent)&&void 0!==X||(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,T=h(E);!(P=T()).done;){var M=P.value;r||o&&M!==o.__host||p(E.slice(0,E.indexOf(M)+1)),s=M,a=M===e.target?q.AT_TARGET:q.BUBBLING_PHASE;var _=M.__eventListeners.get(e.type);if(_)for(var A,D=h(_);!(A=D()).done;){var x=A.value;if(d(x[0],x[1],_),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!==(Y=globalThis.litServerRoot)&&void 0!==Y||(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;!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 Te,Me={},_e=Me.NAMI_SDK_VERSION,Ae=void 0===_e?"3.4.3":_e,De=Me.NAMI_SDK_PACKAGE_VERSION,xe=void 0===De?"3.4.3-dev.202606120301":De,Ce=Me.PLATFORM_ID_REQUIRED,Ie=void 0===Ce?"Platform ID is required":Ce,Le=Me.DEVICE_ID_REQUIRED,Re=void 0===Le?"Device ID is required":Le,Fe=Me.EXTERNAL_ID_REQUIRED,Oe=void 0===Fe?"External ID is required":Fe,$e=Me.SDK_NOT_INITIALIZED,Ne=void 0===$e?"SDK has not been initialized. Make sure to call Nami.configure() first!":$e,We=Me.CAMPAIGN_NOT_AVAILABLE,je=void 0===We?"Campaign is not available":We,Be=Me.FLOW_SCREENS_NOT_AVAILABLE,ze=void 0===Be?"Flow screens not available":Be,Ue=Me.UNABLE_TO_UPDATE_CDP_ID,He=void 0===Ue?"Unable to update CDP id in anonymous mode":Ue,Ge=Me.ANONYMOUS_MODE_ALREADY_ON,Ve=void 0===Ge?"Anonymous mode is already turned on.":Ge,Ke=Me.ANONYMOUS_MODE_ALREADY_OFF,Xe=void 0===Ke?"Anonymous mode is already turned off.":Ke,Ye=Me.DEVICE_ID_NOT_SET,qe=void 0===Ye?"Nami Device ID is not set":Ye,Je=Me.AUTH_DEVICE,Qe=void 0===Je?"nami_auth_device":Je,Ze=Me.NAMI_CONFIGURATION,et=void 0===Ze?"nami_configuration":Ze,tt=Me.NAMI_PROFILE,nt=void 0===tt?"nami_profile":tt,it=Me.API_CONFIG,at=void 0===it?"api_config":it,rt=Me.API_CAMPAIGN_RULES,ot=void 0===rt?"api_campaign_rules":rt,st=Me.API_PAYWALLS,ut=void 0===st?"api_paywalls":st,lt=Me.API_CAMPAIGN_SESSION_TIMESTAMP,dt=void 0===lt?"api_campaign_session_timestamp":lt,ct=Me.API_PRODUCTS,ht=void 0===ct?"api_products":ct,mt=Me.API_ACTIVE_ENTITLEMENTS,ft=void 0===mt?"api_active_entitlements":mt,vt=Me.SERVER_NAMI_ENTITLEMENTS,pt=void 0===vt?"server_active_entitlements":vt,gt=Me.INITIAL_APP_CONFIG,yt=void 0===gt?"initial_app_config":gt,bt=Me.INITIAL_CAMPAIGN_RULES,wt=void 0===bt?"initial_campaign_rules":bt,kt=Me.INITIAL_PAYWALLS,St=void 0===kt?"initial_paywalls":kt,Et=Me.INITIAL_PRODUCTS,Pt=void 0===Et?"initial_products":Et,Tt=Me.LOCAL_NAMI_ENTITLEMENTS,Mt=void 0===Tt?"local_active_entitlements":Tt,_t=Me.CUSTOMER_ATTRIBUTES_KEY_PREFIX,At=void 0===_t?"nami_cmr_attributes_":_t,Dt=Me.NAMI_CUSTOMER_JOURNEY_STATE,xt=void 0===Dt?"nami_customer_journey_state":Dt,Ct=Me.ANONYMOUS_MODE,It=void 0===Ct?"nami_anonymous_mode_v2":Ct,Lt=Me.ANONYMOUS_UUID,Rt=void 0===Lt?"nami_anonymous_uuid":Lt,Ft=Me.KEY_SESSION_COUNTER,Ot=void 0===Ft?"nami_session_counter":Ft,$t=Me.INITIAL_SESSION_COUNTER_VALUE,Nt=void 0===$t?1:$t,Wt=Me.NAMI_LAST_IMPRESSION_ID,jt=void 0===Wt?"nami_last_impression_id":Wt,Bt=Me.NAMI_PURCHASE_IMPRESSION_ID,zt=void 0===Bt?"nami_purchase_impression_id":Bt,Ut=Me.NAMI_LAUNCH_ID,Ht=void 0===Ut?"nami_launch_id":Ut,Gt=Me.NAMI_SESSION_ID,Vt=void 0===Gt?"nami_session_id":Gt,Kt=Me.NAMI_LANGUAGE_CODE,Xt=void 0===Kt?"nami_language_code":Kt,Yt=Me.NAMI_PURCHASE_CHANNEL,qt=void 0===Yt?"nami_purchase_channel":Yt,Jt=Me.API_VERSION,Qt=Me.BASE_URL_PATH,Zt=void 0===Qt?`sdk/${void 0===Jt?"v3":Jt}/platform`:Qt,en=Me.BASE_URL,tn=void 0===en?"https://app.namiml.com":en,nn=Me.BASE_STAGING_URL,an=void 0===nn?"https://app-staging.namiml.com":nn,rn=Me.CUSTOM_HOST_PREFIX,on=void 0===rn?"namiAPIHost=":rn,sn=Me.USE_STAGING_API,un=void 0===sn?"useStagingAPI":sn,ln=Me.EXTENDED_CLIENT_INFO_PREFIX,dn=void 0===ln?"extendedClientInfo":ln,cn=Me.EXTENDED_CLIENT_INFO_DELIMITER,hn=void 0===cn?":":cn,mn=Me.VALIDATE_PRODUCT_GROUPS,fn=void 0===mn?"validateProductGroups":mn,vn=Me.LOG_HTTP_REQUESTS,pn=void 0===vn?"logHTTPRequests":vn,gn=Me.LOG_HTTP_TRAFFIC,yn=void 0===gn?"logHTTPTraffic":gn,bn=Me.STARTUP_TELEMETRY,wn=void 0===bn?"startupTelemetry":bn,kn=Me.API_MAX_CALLS_LIMIT,Sn=void 0===kn?2:kn,En=Me.API_RETRY_DELAY_SEC,Pn=void 0===En?2:En,Tn=Me.API_TIMEOUT_LIMIT,Mn=void 0===Tn?2e4:Tn,_n=Me.DEVICE_API_TIMEOUT_LIMIT,An=void 0===_n?2e3:_n,Dn=Me.STATUS_BAD_REQUEST,xn=void 0===Dn?400:Dn,Cn=Me.STATUS_NOT_FOUND,In=void 0===Cn?404:Cn,Ln=Me.STATUS_CONFLICT,Rn=void 0===Ln?409:Ln,Fn=Me.STATUS_INTERNAL_SERVER_ERROR,On=void 0===Fn?500:Fn,$n=Me.INITIAL_SUCCESS,Nn=void 0===$n?"Initial success":$n,Wn=Me.RECONFIG_SUCCESS,jn=void 0===Wn?"Reconfig success":Wn,Bn=Me.ALREADY_CONFIGURED,zn=void 0===Bn?"Already configured":Bn,Un=Me.AVAILABLE_CAMPAIGNS_CHANGED,Hn=void 0===Un?"AvailableCampaignsChanged":Un,Gn=Me.PAYWALL_ACTION_EVENT,Vn=void 0===Gn?"PaywallActionEvent":Gn,Kn=Me.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,Xn=void 0===Kn?"AvailableActiveEntitlementsChanged":Kn,Yn=Me.CUSTOMER_JOURNEY_STATE_CHANGED,qn=void 0===Yn?"CustomerJourneyStateChanged":Yn,Jn=Me.SKU_TEXT_REGEX,Qn=void 0===Jn?/\$\{sku\.(\w+)(:\d+)?\}/g:Jn,Zn=Me.VAR_REGEX,ei=void 0===Zn?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:Zn,ti=Me.SMART_TEXT_PATTERN,ni=void 0===ti?"${":ti,ii=Me.LIQUID_VARIABLE_REGEX,ai=void 0===ii?/\${[A-Za-z0-9.]+}/g:ii,ri=[Qe,et,nt,at,ot,ut,dt,ht,ft,pt,yt,wt,St,Pt,Mt,xt,It,Rt,Ot,jt,zt,Ht,Vt,Xt,qt];e.LogLevel=void 0,(Te=e.LogLevel||(e.LogLevel={}))[Te.DEBUG=1]="DEBUG",Te[Te.INFO=2]="INFO",Te[Te.WARN=3]="WARN",Te[Te.ERROR=4]="ERROR";var oi={debug:e.LogLevel.DEBUG,info:e.LogLevel.INFO,warn:e.LogLevel.WARN,error:e.LogLevel.ERROR},si=function(){return c(function t(){o(this,t),this.currentLogLevel=e.LogLevel.DEBUG,this.setLogger=t=>{this.currentLogLevel=t?oi[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)}`}}])}(),ui=new si;function li(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 di(e,t){return e===t||e!=e&&t!=t}function ci(e,t){for(var n=e.length;n--;)if(di(e[n][0],t))return n;return-1}var hi=Array.prototype.splice;function mi(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])}}mi.prototype.clear=function(){this.__data__=[],this.size=0},mi.prototype.delete=function(e){var t=this.__data__,n=ci(t,e);return!(n<0)&&(n==t.length-1?t.pop():hi.call(t,n,1),--this.size,!0)},mi.prototype.get=function(e){var t=this.__data__,n=ci(t,e);return n<0?void 0:t[n][1]},mi.prototype.has=function(e){return ci(this.__data__,e)>-1},mi.prototype.set=function(e,t){var n=this.__data__,i=ci(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var fi="object"==typeof global&&global&&global.Object===Object&&global,vi="object"==typeof self&&self&&self.Object===Object&&self,pi=fi||vi||Function("return this")(),gi=pi.Symbol,yi=Object.prototype,bi=yi.hasOwnProperty,wi=yi.toString,ki=gi?gi.toStringTag:void 0;var Si=Object.prototype.toString;var Ei=gi?gi.toStringTag:void 0;function Pi(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ei&&Ei in Object(e)?function(e){var t=bi.call(e,ki),n=e[ki];try{e[ki]=void 0;var i=!0}catch(e){}var a=wi.call(e);return i&&(t?e[ki]=n:delete e[ki]),a}(e):function(e){return Si.call(e)}(e)}function Ti(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Mi(e){if(!Ti(e))return!1;var t=Pi(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var _i,Ai=pi["__core-js_shared__"],Di=(_i=/[^.]+$/.exec(Ai&&Ai.keys&&Ai.keys.IE_PROTO||""))?"Symbol(src)_1."+_i:"";var xi=Function.prototype.toString;function Ci(e){if(null!=e){try{return xi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Ii=/^\[object .+?Constructor\]$/,Li=Function.prototype,Ri=Object.prototype,Fi=Li.toString,Oi=Ri.hasOwnProperty,$i=RegExp("^"+Fi.call(Oi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ni(e){return!(!Ti(e)||(t=e,Di&&Di in t))&&(Mi(e)?$i:Ii).test(Ci(e));var t}function Wi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ni(n)?n:void 0}var ji=Wi(pi,"Map"),Bi=Wi(Object,"create");var zi=Object.prototype.hasOwnProperty;var Ui=Object.prototype.hasOwnProperty;function Hi(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 Gi(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 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])}}Hi.prototype.clear=function(){this.__data__=Bi?Bi(null):{},this.size=0},Hi.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hi.prototype.get=function(e){var t=this.__data__;if(Bi){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return zi.call(t,e)?t[e]:void 0},Hi.prototype.has=function(e){var t=this.__data__;return Bi?void 0!==t[e]:Ui.call(t,e)},Hi.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Bi&&void 0===t?"__lodash_hash_undefined__":t,this},Vi.prototype.clear=function(){this.size=0,this.__data__={hash:new Hi,map:new(ji||mi),string:new Hi}},Vi.prototype.delete=function(e){var t=Gi(this,e).delete(e);return this.size-=t?1:0,t},Vi.prototype.get=function(e){return Gi(this,e).get(e)},Vi.prototype.has=function(e){return Gi(this,e).has(e)},Vi.prototype.set=function(e,t){var n=Gi(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Ki(e){var t=this.__data__=new mi(e);this.size=t.size}Ki.prototype.clear=function(){this.__data__=new mi,this.size=0},Ki.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ki.prototype.get=function(e){return this.__data__.get(e)},Ki.prototype.has=function(e){return this.__data__.has(e)},Ki.prototype.set=function(e,t){var n=this.__data__;if(n instanceof mi){var i=n.__data__;if(!ji||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Vi(i)}return n.set(e,t),this.size=n.size,this};function Xi(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Vi;++t<n;)this.add(e[t])}function Yi(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 qi(e,t){return e.has(t)}Xi.prototype.add=Xi.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Xi.prototype.has=function(e){return this.__data__.has(e)};function Ji(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 Xi: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(!Yi(t,function(e,t){if(!qi(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 Qi=pi.Uint8Array;function Zi(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function ea(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var ta=gi?gi.prototype:void 0,na=ta?ta.valueOf:void 0;var ia=Array.isArray;var aa=Object.prototype.propertyIsEnumerable,ra=Object.getOwnPropertySymbols,oa=ra?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,i=null==e?0:e.length,a=0,r=[];++n<i;){var o=e[n];t(o,n,e)&&(r[a++]=o)}return r}(ra(e),function(t){return aa.call(e,t)}))}:function(){return[]};function sa(e){return null!=e&&"object"==typeof e}function ua(e){return sa(e)&&"[object Arguments]"==Pi(e)}var la=Object.prototype,da=la.hasOwnProperty,ca=la.propertyIsEnumerable,ha=ua(function(){return arguments}())?ua:function(e){return sa(e)&&da.call(e,"callee")&&!ca.call(e,"callee")};var ma="object"==typeof e&&e&&!e.nodeType&&e,fa=ma&&"object"==typeof module&&module&&!module.nodeType&&module,va=fa&&fa.exports===ma?pi.Buffer:void 0,pa=(va?va.isBuffer:void 0)||function(){return!1},ga=/^(?:0|[1-9]\d*)$/;function ya(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&ga.test(e))&&e>-1&&e%1==0&&e<t}function ba(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var wa={};function ka(e){return function(t){return e(t)}}wa["[object Float32Array]"]=wa["[object Float64Array]"]=wa["[object Int8Array]"]=wa["[object Int16Array]"]=wa["[object Int32Array]"]=wa["[object Uint8Array]"]=wa["[object Uint8ClampedArray]"]=wa["[object Uint16Array]"]=wa["[object Uint32Array]"]=!0,wa["[object Arguments]"]=wa["[object Array]"]=wa["[object ArrayBuffer]"]=wa["[object Boolean]"]=wa["[object DataView]"]=wa["[object Date]"]=wa["[object Error]"]=wa["[object Function]"]=wa["[object Map]"]=wa["[object Number]"]=wa["[object Object]"]=wa["[object RegExp]"]=wa["[object Set]"]=wa["[object String]"]=wa["[object WeakMap]"]=!1;var Sa="object"==typeof e&&e&&!e.nodeType&&e,Ea=Sa&&"object"==typeof module&&module&&!module.nodeType&&module,Pa=Ea&&Ea.exports===Sa&&fi.process,Ta=function(){try{var e=Ea&&Ea.require&&Ea.require("util").types;return e||Pa&&Pa.binding&&Pa.binding("util")}catch(e){}}(),Ma=Ta&&Ta.isTypedArray,_a=Ma?ka(Ma):function(e){return sa(e)&&ba(e.length)&&!!wa[Pi(e)]},Aa=Object.prototype.hasOwnProperty;function Da(e,t){var n=ia(e),i=!n&&ha(e),a=!n&&!i&&pa(e),r=!n&&!i&&!a&&_a(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)!Aa.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ya(l,u))||s.push(l);return s}var xa=Object.prototype;function Ca(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||xa)}function Ia(e,t){return function(n){return e(t(n))}}var La=Ia(Object.keys,Object),Ra=Object.prototype.hasOwnProperty;function Fa(e){return null!=(t=e)&&ba(t.length)&&!Mi(t)?Da(e):function(e){if(!Ca(e))return La(e);var t=[];for(var n in Object(e))Ra.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}function Oa(e){return function(e,t,n){var i=t(e);return ia(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,Fa,oa)}var $a=Object.prototype.hasOwnProperty;var Na=Wi(pi,"DataView"),Wa=Wi(pi,"Promise"),ja=Wi(pi,"Set"),Ba=Wi(pi,"WeakMap"),za="[object Map]",Ua="[object Promise]",Ha="[object Set]",Ga="[object WeakMap]",Va="[object DataView]",Ka=Ci(Na),Xa=Ci(ji),Ya=Ci(Wa),qa=Ci(ja),Ja=Ci(Ba),Qa=Pi;(Na&&Qa(new Na(new ArrayBuffer(1)))!=Va||ji&&Qa(new ji)!=za||Wa&&Qa(Wa.resolve())!=Ua||ja&&Qa(new ja)!=Ha||Ba&&Qa(new Ba)!=Ga)&&(Qa=function(e){var t=Pi(e),n="[object Object]"==t?e.constructor:void 0,i=n?Ci(n):"";if(i)switch(i){case Ka:return Va;case Xa:return za;case Ya:return Ua;case qa:return Ha;case Ja:return Ga}return t});var Za="[object Arguments]",er="[object Array]",tr="[object Object]",nr=Object.prototype.hasOwnProperty;function ir(e,t,n,i,a,r){var o=ia(e),s=ia(t),u=o?er:Qa(e),l=s?er:Qa(t),d=(u=u==Za?tr:u)==tr,c=(l=l==Za?tr:l)==tr,h=u==l;if(h&&pa(e)){if(!pa(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new Ki),o||_a(e)?Ji(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 Qi(e),new Qi(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return di(+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=Zi;case"[object Set]":var u=1&i;if(s||(s=ea),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=Ji(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(na)return na.call(e)==na.call(t)}return!1}(e,t,u,n,i,a,r);if(!(1&n)){var m=d&&nr.call(e,"__wrapped__"),f=c&&nr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new Ki),a(v,p,n,i,r)}}return!!h&&(r||(r=new Ki),function(e,t,n,i,a,r){var o=1&n,s=Oa(e),u=s.length;if(u!=Oa(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:$a.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 ar(e,t,n,i,a){return e===t||(null==e||null==t||!sa(e)&&!sa(t)?e!=e&&t!=t:ir(e,t,n,i,ar,a))}function rr(e){return e==e&&!Ti(e)}function or(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function sr(e){var t=function(e){for(var t=Fa(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,rr(a)]}return t}(e);return 1==t.length&&t[0][2]?or(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(!ar(l,u,3,i,new Ki))return!1}return!0}(n,0,t)}}function ur(e){return"symbol"==typeof e||sa(e)&&"[object Symbol]"==Pi(e)}var lr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dr=/^\w*$/;function cr(e,t){if(ia(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ur(e))||(dr.test(e)||!lr.test(e)||null!=t&&e in Object(t))}function hr(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(hr.Cache||Vi),n}hr.Cache=Vi;var mr,fr,vr,pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gr=/\\(\\)?/g,yr=(mr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(pr,function(e,n,i,a){t.push(i?a.replace(gr,"$1"):n||e)}),t},fr=hr(mr,function(e){return 500===vr.size&&vr.clear(),e}),vr=fr.cache,fr);var br=gi?gi.prototype:void 0,wr=br?br.toString:void 0;function kr(e){if("string"==typeof e)return e;if(ia(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,kr)+"";if(ur(e))return wr?wr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Sr(e,t){return ia(e)?e:cr(e,t)?[e]:yr(function(e){return null==e?"":kr(e)}(e))}function Er(e){if("string"==typeof e||ur(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Pr(e,t){for(var n=0,i=(t=Sr(t,e)).length;null!=e&&n<i;)e=e[Er(t[n++])];return n&&n==i?e:void 0}function Tr(e,t){return null!=e&&t in Object(e)}function Mr(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=Sr(t,e)).length,r=!1;++i<a;){var o=Er(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&ba(a)&&ya(o,a)&&(ia(e)||ha(e))}(e,t,Tr)}function _r(e,t){return cr(e)&&rr(t)?or(Er(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:Pr(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?Mr(n,e):ar(t,i,3)}}function Ar(e){return e}function Dr(e){return cr(e)?(t=Er(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Pr(t,e)}}(e);var t}function xr(e){return e!=e}function Cr(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,xr,n)}(e,t,0)>-1}var Ir=ja&&1/ea(new ja([,-0]))[1]==1/0?function(e){return new ja(e)}:function(){};function Lr(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Cr,r=e.length,o=!0,s=[],u=s;if(r>=200){var l=t?null:Ir(e);if(l)return ea(l);o=!1,a=qi,u=new Xi}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?Ar:"object"==typeof n?ia(n)?_r(n[0],n[1]):sr(n):Dr(n)):[];var n}var Rr=function(){return c(function e(){o(this,e),this.memoryStore={}},[{key:"storage",get:function(){return we().storage}},{key:"setDevice",value:function(e){this.setItem(Qe,e)}},{key:"getDevice",value:function(){return this.getItem(Qe)}},{key:"resetDevice",value:function(){this.resetItem(Qe)}},{key:"getAnonymousMode",value:function(){return this.getItem(It)||!1}},{key:"setAnonymousMode",value:function(e){this.setItem(It,e)}},{key:"clearAnonymousMode",value:function(){this.resetItem(It)}},{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(Xt,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(Xt)||"en"}},{key:"setCampaignRules",value:function(e,t){e!==wt?e!==ot||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[ot]=JSON.stringify(t):this.memoryStore[wt]=JSON.stringify(t)}},{key:"getCampaignRules",value:function(e){if(e===wt)return this.memoryStore[wt]?JSON.parse(this.memoryStore[wt]):null;if(e===ot){var t=this.memoryStore[ot];if(null!=t)return JSON.parse(t);var n=this.getItem(ot);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!==St?e!==ut||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[ut]=JSON.stringify(t):this.memoryStore[St]=JSON.stringify(t)}},{key:"getPaywalls",value:function(e){if(e===St)return this.memoryStore[St]?JSON.parse(this.memoryStore[St]):null;if(e===ut){var t=this.memoryStore[ut];if(null!=t)return JSON.parse(t);var n=this.getItem(ut);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:"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(ht))&&void 0!==e?e:[];return Lr(li([...null!==(t=this.getItem(Pt))&&void 0!==t?t:[],...n]),"sku_ref_id")}},{key:"setNamiConfig",value:function(e){this.setItem(et,e)}},{key:"getNamiConfig",value:function(){return this.getItem(et)}},{key:"setCustomerAttribute",value:function(e,t){this.setItem(At+e,t)}},{key:"getCustomerAttribute",value:function(e){return this.getItem(At+e)}},{key:"getAllCustomerAttributes",value:function(){return this.storage.getAllKeys().map(e=>[e,this.storage.getItem(e)]).filter(([e])=>e.includes(At)).map(([e,t])=>e.replace(At,"")+":"+t)}},{key:"getAllCustomerAttributesKeys",value:function(){return this.storage.getAllKeys().filter(e=>e.includes(At)).map(e=>e.replace(At,""))}},{key:"clearCustomerAttribute",value:function(e){var t=At+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}},{key:"clearAllCustomerAttributes",value:function(){this.storage.getAllKeys().filter(e=>e.includes(At)).map(e=>this.resetItem(e))}},{key:"setNamiProfile",value:function(e){this.setItem(nt,e)}},{key:"getNamiProfile",value:function(){return this.getItem(nt)}},{key:"removeNamiProfile",value:function(){this.resetItem(nt)}},{key:"setCustomerJourneyState",value:function(e){this.setItem(xt,e)}},{key:"getCustomerJourneyState",value:function(){return this.getItem(xt)}},{key:"setSessionCounter",value:function(){var e=this.getItem(Ot),t=e?parseInt(e):Nt||Nt;this.setItem(Ot,t+1)}},{key:"getSessionCounter",value:function(){var e=this.getItem(Ot);return e?parseInt(e):Nt}},{key:"setLastImpressionId",value:function(e){this.setItem(jt,e)}},{key:"getLastImpressionId",value:function(){var e;return null!==(e=this.getItem(jt))&&void 0!==e?e:""}},{key:"setPurchaseImpression",value:function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(zt,t)}},{key:"getPurchaseImpression",value:function(){var e;return null!==(e=this.getItem(zt))&&void 0!==e?e:""}},{key:"setSessionId",value:function(e){e&&this.setItem(Vt,e)}},{key:"getSessionId",value:function(){var e;return null!==(e=this.getItem(Vt))&&void 0!==e?e:""}},{key:"clearSessionId",value:function(){this.resetItem(Vt)}},{key:"setLaunchId",value:function(e){e&&this.setItem(Ht,e)}},{key:"getLaunchId",value:function(){var e;return null!==(e=this.getItem(Ht))&&void 0!==e?e:""}},{key:"clearLaunchId",value:function(){this.resetItem(Ht)}},{key:"setPurchaseChannel",value:function(e){e&&this.setItem(qt,e)}},{key:"getPurchaseChannel",value:function(){return this.getItem(qt)}},{key:"getAnonymousUUID",value:function(){return this.getItem(Rt)}},{key:"setAnonymousUUID",value:function(e){this.setItem(Rt,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(Rt)}},{key:"setApiCampaignSessionTimestamp",value:function(){this.setItem(dt,Date.now())}},{key:"getApiCampaignSessionTimestamp",value:function(){return this.getItem(dt)}},{key:"purgeApiCampaignCache",value:function(){this.resetItem(ut),this.resetItem(ot),this.resetItem(dt)}},{key:"getCampaignCacheTtl",value:function(){var e,t=this.getAppConfig(at)||this.getAppConfig(yt);return null!==(e=null==t?void 0:t.campaign_cache_ttl)&&void 0!==e?e: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 ui.error(`Serialization failed for ${e}`,t)}try{this.storage.setItem(e,n)}catch(t){ui.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){ui.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){ui.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clearAll",value:function(){ri.forEach(e=>this.resetItem(e)),this.clearAllCustomerAttributes(),this.memoryStore={}}},{key:"clear",value:function(){try{this.storage.clear()}catch(e){ui.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}(),Fr=new Rr,Or=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)}(_(Error)),$r=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(_(Error)),Nr=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)}($r),Wr=function(e){function t(){return o(this,t),r(this,t,[Ne])}return p(t,e),c(t)}(_(Error)),jr=function(e){function t(){return o(this,t),r(this,t,[Ie])}return p(t,e),c(t)}(_(Error)),Br=function(e){function t(){return o(this,t),r(this,t,[Re])}return p(t,e),c(t)}(_(Error)),zr=function(e){function t(){return o(this,t),r(this,t,[Oe])}return p(t,e),c(t)}(_(Error)),Ur=function(e){function t(){return o(this,t),r(this,t,[je])}return p(t,e),c(t)}(_(Error)),Hr=function(e){function t(){return o(this,t),r(this,t,[ze])}return p(t,e),c(t)}(_(Error)),Gr=function(e){function t(){return o(this,t),r(this,t,[Ve])}return p(t,e),c(t)}(_(Error)),Vr=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(_(Error)),Kr=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(_(Error)),Xr=function(e){function t(){return o(this,t),r(this,t,[He])}return p(t,e),c(t)}(_(Error)),Yr=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)}($r),qr=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)}($r),Jr=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)}($r),Qr=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)}($r),Zr=(e,t)=>{if(e==xn)throw new Yr(t);if(e==In)throw new qr(t);if(e==Rn)throw new Nr;if(e>xn&&e<On)throw new Jr(e,t);if(e>=On)throw new Qr(t)};function eo(e){for(var t=e.length;--t>=0;)e[t]=0}eo(new Array(576)),eo(new Array(60)),eo(new Array(512)),eo(new Array(256)),eo(new Array(29)),eo(new Array(30));var to=(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},no=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})()),io=(e,t,n,i)=>{var a=no,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^e},ao={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"},ro=0,oo=4,so=5,uo=6,lo=0,co=1,ho=2,mo=-2,fo=-3,vo=-4,po=-5,go=8,yo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),bo=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)yo(n,i)&&(e[i]=n[i])}}return e},wo=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},ko=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){ko=!1}for(var So=new Uint8Array(256),Eo=0;Eo<256;Eo++)So[Eo]=Eo>=252?6:Eo>=248?5:Eo>=240?4:Eo>=224?3:Eo>=192?2:1;So[254]=So[254]=1;var Po=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},To=(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=So[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&&ko)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)},Mo=(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+So[e[n]]>t?n:t};var _o=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},Ao=16209,Do=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,M=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,T=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=M.dmax,u=M.wsize,l=M.whave,d=M.wnext,c=M.window,h=M.hold,m=M.bits,f=M.lencode,v=M.distcode,p=(1<<M.lenbits)-1,g=(1<<M.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))T[a++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){M.mode=16191;break e}e.msg="invalid literal/length code",M.mode=Ao;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",M.mode=Ao;break e}if(h>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>l&&M.sane){e.msg="invalid distance too far back",M.mode=Ao;break e}if(S=0,E=c,0===d){if(S+=u-b,b<w){w-=b;do{T[a++]=c[S++]}while(--b);S=a-k,E=T}}else if(d<b){if(S+=u+d-b,(b-=d)<w){w-=b;do{T[a++]=c[S++]}while(--b);if(S=0,d<w){w-=b=d;do{T[a++]=c[S++]}while(--b);S=a-k,E=T}}}else if(S+=d-b,b<w){w-=b;do{T[a++]=c[S++]}while(--b);S=a-k,E=T}for(;w>2;)T[a++]=E[S++],T[a++]=E[S++],T[a++]=E[S++],w-=3;w&&(T[a++]=E[S++],w>1&&(T[a++]=E[S++]))}else{S=a-k;do{T[a++]=T[S++],T[a++]=T[S++],T[a++]=T[S++],w-=3}while(w>2);w&&(T[a++]=T[S++],w>1&&(T[a++]=T[S++]))}break}if(64&b){e.msg="invalid distance code",M.mode=Ao;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),M.hold=h,M.bits=m},xo=15,Co=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]),Io=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]),Lo=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]),Ro=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]),Fo=(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,T=0,M=0,_=0,A=null,D=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=xo;y++)D[y]=0;for(b=0;b<i;b++)D[t[n+b]]++;for(S=g,k=xo;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),T=1,y=1;y<=xo;y++)if(T<<=1,(T-=D[y])<0)return-1;if(T>0&&(0===e||1!==k))return-1;for(x[1]=0,y=1;y<xo;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=Co,C=Io,m=257):(A=Lo,C=Ro,m=0),_=0,b=0,y=w,h=r,E=S,P=0,d=-1,c=(M=1<<S)-1,1===e&&M>852||2===e&&M>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+(_>>P)+(l-=u)]=f<<24|v<<16|p}while(0!==l);for(u=1<<y-1;_&u;)u>>=1;if(0!==u?(_&=u-1,_+=u):_=0,b++,0===--D[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(_&c)!==d){for(0===P&&(P=S),h+=w,T=1<<(E=y-P);E+P<k&&!((T-=D[E+P])<=0);)E++,T<<=1;if(M+=1<<E,1===e&&M>852||2===e&&M>592)return 1;a[d=_&c]=S<<24|E<<16|h-r}}return 0!==_&&(a[h+_]=y-P<<24|64<<16),s.bits=S,0},Oo=oo,$o=so,No=uo,Wo=lo,jo=co,Bo=ho,zo=mo,Uo=fo,Ho=vo,Go=po,Vo=go,Ko=16180,Xo=16190,Yo=16191,qo=16192,Jo=16194,Qo=16199,Zo=16200,es=16206,ts=16209,ns=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function is(){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 as,rs,os=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<Ko||t.mode>16211?1:0},ss=e=>{if(os(e))return zo;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=Ko,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,Wo},us=e=>{if(os(e))return zo;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ss(e)},ls=(e,t)=>{var n;if(os(e))return zo;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?zo:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,us(e))},ds=(e,t)=>{if(!e)return zo;var n=new is;e.state=n,n.strm=e,n.window=null,n.mode=Ko;var i=ls(e,t);return i!==Wo&&(e.state=null),i},cs=!0,hs=e=>{if(cs){as=new Int32Array(512),rs=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(Fo(1,e.lens,0,288,as,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Fo(2,e.lens,0,32,rs,0,e.work,{bits:5}),cs=!1}e.lencode=as,e.lenbits=9,e.distcode=rs,e.distbits=5},ms=(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},fs=(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,M=0,_=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(os(e)||!e.output||!e.input&&0!==e.avail_in)return zo;(n=e.state).mode===Yo&&(n.mode=qo),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=Wo;e:for(;;)switch(n.mode){case Ko:if(0===n.wrap){n.mode=qo;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,_[0]=255&l,_[1]=l>>>8&255,n.check=io(n.check,_,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=ts;break}if((15&l)!==Vo){e.msg="unknown compression method",n.mode=ts;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=ts;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:Yo,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)!==Vo){e.msg="unknown compression method",n.mode=ts;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=ts;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,n.check=io(n.check,_,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&&(_[0]=255&l,_[1]=l>>>8&255,_[2]=l>>>16&255,_[3]=l>>>24&255,n.check=io(n.check,_,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&&(_[0]=255&l,_[1]=l>>>8&255,n.check=io(n.check,_,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&&(_[0]=255&l,_[1]=l>>>8&255,n.check=io(n.check,_,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=io(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=io(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=io(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=ts;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=Yo;break;case 16189:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}e.adler=n.check=ns(l),l=0,d=0,n.mode=Xo;case Xo: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,Bo;e.adler=n.check=1,n.mode=Yo;case Yo:if(t===$o||t===No)break e;case qo:if(n.last){l>>>=7&d,d-=7&d,n.mode=es;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(hs(n),n.mode=Qo,t===No){l>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=ts}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=ts;break}if(n.length=65535&l,l=0,d=0,n.mode=Jo,t===No)break e;case Jo: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=Yo;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=ts;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=Fo(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid code lengths set",n.mode=ts;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(M=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&M,!((p=M>>>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(T=p+2;d<T;){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=ts;break}S=n.lens[n.have-1],m=3+(3&l),l>>>=2,d-=2}else if(17===y){for(T=p+3;d<T;){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(T=p+7;d<T;){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=ts;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===ts)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=ts;break}if(n.lenbits=9,P={bits:n.lenbits},E=Fo(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=ts;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},E=Fo(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=ts;break}if(n.mode=Qo,t===No)break e;case Qo:n.mode=Zo;case Zo: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,Do(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===Yo&&(n.back=-1);break}for(n.back=0;g=(M=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&M,!((p=M>>>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=(M=n.lencode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&M,!(b+(p=M>>>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=Yo;break}if(64&g){e.msg="invalid literal/length code",n.mode=ts;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for(T=n.extra;d<T;){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=(M=n.distcode[l&(1<<n.distbits)-1])>>>16&255,y=65535&M,!((p=M>>>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=(M=n.distcode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&M,!(b+(p=M>>>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=ts;break}n.offset=y,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for(T=n.extra;d<T;){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=ts;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=ts;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=Zo);break;case 16205:if(0===u)break e;a[o++]=n.length,u--,n.mode=Zo;break;case es: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?io(n.check,a,h,o-h):to(n.check,a,h,o-h)),h=u,4&n.wrap&&(n.flags?l:ns(l))!==n.check){e.msg="incorrect data check",n.mode=ts;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=ts;break}l=0,d=0}n.mode=16208;case 16208:E=jo;break e;case ts:E=Uo;break e;case 16210:return Ho;default:return zo}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<ts&&(n.mode<es||t!==Oo))&&ms(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?io(n.check,a,h,e.next_out-h):to(n.check,a,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Yo?128:0)+(n.mode===Qo||n.mode===Jo?256:0),(0===c&&0===h||t===Oo)&&E===Wo&&(E=Go),E},vs={inflateReset:us,inflateReset2:ls,inflateResetKeep:ss,inflateInit:e=>ds(e,15),inflateInit2:ds,inflate:fs,inflateEnd:e=>{if(os(e))return zo;var t=e.state;return t.window&&(t.window=null),e.state=null,Wo},inflateGetHeader:(e,t)=>{if(os(e))return zo;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Wo):zo},inflateSetDictionary:(e,t)=>{var n,i=t.length;return os(e)||0!==(n=e.state).wrap&&n.mode!==Xo?zo:n.mode===Xo&&to(1,t,i,0)!==n.check?Uo:ms(e,t,i,i)?(n.mode=16210,Ho):(n.havedict=1,Wo)},inflateInfo:"pako inflate (from Nodeca project)"};var ps=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},gs=Object.prototype.toString,ys=ro,bs=oo,ws=lo,ks=co,Ss=ho,Es=mo,Ps=fo,Ts=vo;function Ms(e){this.options=bo({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 _o,this.strm.avail_out=0;var n=vs.inflateInit2(this.strm,t.windowBits);if(n!==ws)throw new Error(ao[n]);if(this.header=new ps,vs.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Po(t.dictionary):"[object ArrayBuffer]"===gs.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=vs.inflateSetDictionary(this.strm,t.dictionary))!==ws))throw new Error(ao[n])}Ms.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?bs:ys,"[object ArrayBuffer]"===gs.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=vs.inflate(r,i))===Ss&&s&&((n=vs.inflateSetDictionary(r,s))===ws?n=vs.inflate(r,i):n===Ps&&(n=Ss));r.avail_in>0&&n===ks&&r.state.wrap>0&&0!==e[r.next_in];)vs.inflateReset(r),n=vs.inflate(r,i);switch(n){case Es:case Ps:case Ss:case Ts:return this.onEnd(n),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||n===ks))if("string"===this.options.to){var u=Mo(r.output,r.next_out),l=r.next_out-u,d=To(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!==ws||0!==a){if(n===ks)return n=vs.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ms.prototype.onData=function(e){this.chunks.push(e)},Ms.prototype.onEnd=function(e){e===ws&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=wo(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var _s={ungzip:function(e,t){var n=new Ms(t);if(n.push(e),n.err)throw n.msg||ao[n.err];return n.result}}.ungzip,As=e=>{var t;if(null!=e&&e.includes(un))t=an;else{var n=null==e?void 0:e.find(e=>e.includes(on));t=n?n.split("=")[1]:tn}return(t=t.replace(/\/$/,""))+"/"+Zt},Ds=e=>{var t,n,i=Fr.getAppConfig(at)||Fr.getAppConfig(yt);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},xs=()=>{var e,t,n=(t=Fr.getAppConfig(at)||Fr.getAppConfig(yt),null!==(e=null==t?void 0:t.campaign_cache_ttl)&&void 0!==e?e:null);if(null!==n)if(0!==n){var i=Fr.getApiCampaignSessionTimestamp();if(null!==i)(Date.now()-i)/1e3>=n&&Fr.purgeApiCampaignCache()}else Fr.purgeApiCampaignCache()},Cs=e=>{var t=!Ds(Pe.THIRD_PARTY_TRANSACTIONS);return e&&!t&&ui.info(`[${e}] Your plan does not have purchase management features.`),t},Is=()=>{var e,t,n=null===(e=Fr.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(pn))&&void 0!==t&&t},Ls=()=>{var e,t,n=null===(e=Fr.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(yn))&&void 0!==t&&t};function Rs(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=_s(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}function Fs(e,t,n=Mn,i=Sn){var r,o,s,u,l,d,c;return k(function(h){for(;;)switch(h.n){case 0:return o=0,s=Is(),u=Ls(),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)&&ui.debug(`[HTTP] ${l} ${e}`),u&&null!=t&&t.body&&ui.debug(`[HTTP] Request body: ${t.body}`),f.n=1,a(Os(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,ui.debug(`[HTTP] Response ${r.status}: ${c}`);case 3:if(r.status!=Rn){f.n=4;break}throw new Nr;case 4:if(!(++o<=i)){f.n=6;break}return h=1e3*(o+Pn),f.n=5,a(new Promise(e=>setTimeout(e,h)));case 5:return f.a(2,d());case 6:throw new Or(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,ui.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 Os(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)}function $s(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new jr;return i.apply(this,e)},n}function Ns(e,t,n){var i=n.value;return n.value=function(...e){var t=Fr.getDevice();if(null==t||!t.id)throw new Br;return i.apply(this,e)},n}var Ws,js=function(){return c(function e(){o(this,e);var t=Fr.getNamiConfig();!this.platformID&&t&&this.configure(t)},[{key:"deviceID",get:function(){var e;return null===(e=Fr.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=As(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 zr;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,Fr.setSessionCounter(),n.id&&Fr.setSessionId(n.id);case 2:return i.a(2)}},null,this,null,Promise)}},{key:"postImpression",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/impression/`,i.n=1,a(this.requestBodyAPI(t,e,"POST",!0));case 1:(n=i.v).id&&Fr.setLastImpressionId(n.id);case 2:return i.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(Fs(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(Fs(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 Bs(e){return null!=(null==e?void 0:e.flow)}js.instance=new js,ke([Ns],js.prototype,"login",null),ke([Ns],js.prototype,"logout",null),ke([Ns],js.prototype,"startSession",null),ke([Ns],js.prototype,"postImpression",null),ke([Ns],js.prototype,"postConversion",null),ke([Ns],js.prototype,"purchaseValidation",null),ke([$s],js.prototype,"fetchAPI",null),ke([$s],js.prototype,"requestBodyAPI",null),e.NamiCampaignRuleType=void 0,(Ws=e.NamiCampaignRuleType||(e.NamiCampaignRuleType={})).DEFAULT="default",Ws.LABEL="label",Ws.UNKNOWN="unknown",Ws.URL="url";var zs=()=>{var e;return null!==(e=Fr.getPaywalls(St))&&void 0!==e?e:[]},Us=()=>{var e;return null!==(e=Fr.getPaywalls(ut))&&void 0!==e?e:[]},Hs=()=>Lr(li([...Us(),...zs()]),"id"),Gs=e=>Hs().find(t=>t.id===e),Vs=e=>{var t=Hs(),n=new Set(t.map(e=>e.id));return e.every(e=>n.has(e))},Ks="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{},Xs="function"==typeof Ks.BigInt,Ys=Xs?Ks.BigInt.bind(Ks):void 0,qs=Xs?Ys("0xffffffffffffffffffffffffffffffff"):null,Js=Xs?Ys("0x100000000000000000000000000000000"):null,Qs=Xs?Ys(0):null,Zs=Xs?Ys(1):null,eu=Xs?Ys(8):null,tu=Xs?Ys(1e4):null,nu=Ks.crypto,iu="function"==typeof(null==nu?void 0:nu.getRandomValues),au=1/16,ru=e=>we().device.getDeviceData(e),ou=()=>{var e=Fr.getNamiConfig();return e&&e.formFactor?e.formFactor:we().device.getDeviceFormFactor()};function su(){return we().device.generateUUID()}function uu(e){if(!Xs||!qs)return cu(e);try{var t=qs,n=function(e){if(!Ys)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return Ys("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw ui.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function lu(e){if(!Ys)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 du(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(!(Xs&&qs&&Ys&&tu))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=su(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var u=su(),l=cu(u);if(l>=n&&l<=i)return u;var d=hu(l,n,i);d<r&&(r=d,a=u)}return a}(n,i);var s=qs,u=Ys,l=tu,d=e=>s*u(e)/l,c=d(r),m=d(o);if(m<=c)return lu(c);var f=c+function(e){if(!Ys||null===Js||null===Zs||null===Qs||null===eu)throw new Error("BigInt is not supported in this environment");var t=Ys,n=Qs,i=Zs,a=eu,r=Js;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(iu)nu.getRandomValues(o);else{d||(d=!0,ui.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(iu)try{nu.getRandomValues(o);for(var p,g=n,y=h(o);!(p=y()).done;)g=g<<a|t(p.value);var b=g%s;return ui.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:l}),b}catch(e){throw ui.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 ui.warn("randomBigInt: reached max rejection attempts without crypto, using modulo fallback",{n:e.toString(),attempts:l}),k%s}(m-c);return lu(f)}function cu(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))*au}return n}(e);return 100*t}function hu(e,t,n){return e<t?t-e:e>n?e-n:0}var mu,fu=e=>{try{var t=new URL(e);return("http:"===t.protocol||"https:"===t.protocol)&&!!t.hostname}catch(e){return!1}},vu=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}},pu=(e,t,n)=>e?e.flatMap(e=>{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);return{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}}):[],gu=()=>{var e,t,n=null!==(e=Fr.getCampaignRules(ot))&&void 0!==e?e:[],i=null!==(t=Fr.getCampaignRules(wt))&&void 0!==t?t:[],a=ou(),r=li([...n,...i]).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===a)}),o=new Set;return r.filter(e=>{var t,n,i=`${null!==(t=e.type)&&void 0!==t?t:""}::${null!==(n=e.value)&&void 0!==n?n:""}`;return!o.has(i)&&(o.add(i),!0)})},yu=e=>{var t,n=null!==(t=Fr.getCampaignRules(e))&&void 0!==t?t:[],i=ou();return li(n).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===i)})},bu=()=>yu(wt),wu=()=>yu(ot),ku=(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=vu(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=vu(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}},Su=(e,t)=>{var n=ku(wu,Us,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=ku(bu,zs,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}},Eu="object"==typeof Reflect?Reflect:null,Pu=Eu&&"function"==typeof Eu.apply?Eu.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};mu=Eu&&"function"==typeof Eu.ownKeys?Eu.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Tu=Number.isNaN||function(e){return e!=e};function Mu(){Mu.init.call(this)}Mu.EventEmitter=Mu,Mu.prototype._events=void 0,Mu.prototype._eventsCount=0,Mu.prototype._maxListeners=void 0;var _u=10;function Au(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Du(e){return void 0===e._maxListeners?Mu.defaultMaxListeners:e._maxListeners}function xu(e,t,n,i){var a,r,o,s;if(Au(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=Du(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 Cu(){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 Iu(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=Cu.bind(i);return a.listener=n,i.wrapFn=a,a}function Lu(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):Fu(a,a.length)}function Ru(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 Fu(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(Mu,"defaultMaxListeners",{enumerable:!0,get:function(){return _u},set:function(e){if("number"!=typeof e||e<0||Tu(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");_u=e}}),Mu.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},Mu.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Tu(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},Mu.prototype.getMaxListeners=function(){return Du(this)},Mu.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)Pu(s,this,t);else for(var u=s.length,l=Fu(s,u),d=0;d<u;++d)Pu(l[d],this,t);return!0},Mu.prototype.addListener=function(e,t){return xu(this,e,t,!1)},Mu.prototype.on=Mu.prototype.addListener,Mu.prototype.prependListener=function(e,t){return xu(this,e,t,!0)},Mu.prototype.once=function(e,t){return Au(t),this.on(e,Iu(this,e,t)),this},Mu.prototype.prependOnceListener=function(e,t){return Au(t),this.prependListener(e,Iu(this,e,t)),this},Mu.prototype.removeListener=function(e,t){var n,i,a,r,o;if(Au(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},Mu.prototype.off=Mu.prototype.removeListener,Mu.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},Mu.prototype.listeners=function(e){return Lu(this,e,!0)},Mu.prototype.rawListeners=function(e){return Lu(this,e,!1)},Mu.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Ru.call(e,t)},Mu.prototype.listenerCount=Ru,Mu.prototype.eventNames=function(){return this._eventsCount>0?mu(this._events):[]};var Ou=function(){function e(){o(this,e),this.emitter=new Mu}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}}])}(),$u=function(){return c(function e(){o(this,e),this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1,this.currentFormFactor=ou()},[{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=ou(),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=Fr.getDevice(),!this.disableCampaignUpdates){o.n=1;break}return ui.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(e=>{var t;return e.paywall&&e.form_factors.some(e=>e.form_factor===this.currentFormFactor)||e.flow&&(null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===this.currentFormFactor))}),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}),Fr.setCampaignRules(ot,r),Fr.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),o.a(2,r)}},null,this,null,Promise)}},{key:"fetchCampaignRulesRaw",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(t=Fr.getDevice(),!this.disableCampaignUpdates){i.n=1;break}return ui.info("Campaign updates disabled by configuration. Skipping fetch."),i.a(2,[]);case 1:if(null!=t&&t.id){i.n=3;break}return i.n=2,a(this.getAnonymousCampaigns());case 2:n=i.v,i.n=5;break;case 3:return i.n=4,a(this.getCampaigns(t.id));case 4:n=i.v;case 5:return n=null===(e=n)||void 0===e?void 0:e.filter(e=>{var t;return e.paywall&&e.form_factors.some(e=>e.form_factor===this.currentFormFactor)||e.flow&&(null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===this.currentFormFactor))}),i.a(2,n)}},null,this,null,Promise)}},{key:"finalizeCampaignRules",value:function(e,t){var n=null==e?void 0:e.filter(e=>e.paywall?t.find(t=>t.id==e.paywall):!!e.flow);return Fr.setCampaignRules(ot,n),Fr.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),n}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=Ou.getInstance().listeners(Hn),t=gu();e.forEach(e=>e(t))}},{key:"getAnonymousCampaigns",value:function(e=Ae){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(js.instance.fetchAPI(t));case 2:return i=s.v,s.a(2,pu(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor));case 3:if(s.p=3,o=s.v,r=this.fallbackData()){s.n=4;break}throw ui.error(Zr(o.status,t)),o;case 4:return s.a(2,r.results)}},null,this,[[1,3]],Promise)}},{key:"getCampaigns",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`device/${e}/campaign_rules/`,o.p=1,o.n=2,a(js.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 ui.error(Zr(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:"fallbackData",value:function(){var e=Fr.getCampaignRules(ot)||Fr.getCampaignRules(wt);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 Nu(e,t){return ar(e,t)}$u.instance=new $u;var Wu=function(){return c(function e(){o(this,e)},[{key:"createOrUpdateDevice",value:function(e,t,n){var i=Fr.getDevice();if(null==i||!i.id){var a,r=m({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:su()});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}Fr.setDevice(n),r.n=3;break;case 2:return ui.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 Or)){r.n=5;break}return ui.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)&&Fr.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=Fr.getDevice())&&i.id){o.n=1;break}throw new Br;case 1:return o.n=2,a(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(r=o.v)&&Fr.setDevice(r),o.a(2,r)}},null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=An,r){var o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:return u.p=0,u.n=1,a(js.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 jr)){u.n=3;break}throw s;case 3:if(!("device/"===e&&s instanceof Or)){u.n=4;break}throw s;case 4:if(o=Fr.getDevice()){u.n=5;break}return ui.error(Zr(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 Nu(i,e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=Fr.getAnonymousUUID();return e||(e=su(),Fr.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=Fr.getAnonymousUUID();return e?(Fr.clearAnonymousUUID(),e):null}}])}();Wu.instance=new Wu;var ju=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(!Ds(Pe.THIRD_PARTY_TRANSACTIONS)){r.n=1;break}return r.a(2,[]);case 1:return r.p=1,r.n=2,a(js.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 ui.error(Zr(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&Fr.setProducts(ht,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=Fr.getProducts(ht)||Fr.getProducts(Pt);return e?{count:e.length,results:e}:null}}])}();ju.instance=new ju;var Bu=3,zu=200,Uu=2e3,Hu=5e3,Gu=2e4,Vu=new Set([408,425,429]),Ku=new Set(["ECONNRESET","ECONNREFUSED","ENOTFOUND","ETIMEDOUT"]),Xu=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)}(_(Error)),Yu=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)}(_(Error));function qu(e,t){if("number"==typeof t)return Vu.has(t)||t>=500;if(e&&"object"==typeof e){var n=e;if("AbortError"===n.name)return!0;if(n.code&&Ku.has(n.code))return!0;if(e instanceof TypeError)return!0}return!1}function Ju(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(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 Qu=e=>new Promise(t=>setTimeout(t,e));function Zu(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;return k(function(k){for(;;)switch(k.p=k.n){case 0:d=null!==(n=t.maxAttempts)&&void 0!==n?n:Bu,c=null!==(i=t.baseDelayMs)&&void 0!==i?i:zu,h=null!==(r=t.maxDelayMs)&&void 0!==r?r:Uu,m=null!==(o=t.budgetMs)&&void 0!==o?o:Gu,f=null!==(s=t.timeoutMs)&&void 0!==s?s:Hu,v=null!==(u=t.randomFn)&&void 0!==u?u:Math.random,p=null!==(l=t.sleepFn)&&void 0!==l?l:Qu,g=Is(),y=Ls(),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 T=Math.min(c*Math.pow(2,w-1),h),M=T*(v()-.5),_=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)&&ui.debug(`[HTTP] GET ${e} (cdn attempt ${w+1}/${d})`),k.n=5,a(Ju(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,ui.debug(`[HTTP] Response ${D.status}: ${x}`);case 7:if(S=D.status,!qu(void 0,D.status)){k.n=8;break}return w++,k.a(3,1);case 8:throw new Xu(D.status,e);case 9:if(!y){k.n=11;break}return k.n=10,a(D.clone().text());case 10:C=k.v,ui.debug(`[HTTP] Response ${D.status}: ${C}`);case 11:return k.n=12,a(D.json());case 12:return I=k.v,k.a(2,{data:I,retryCount:w});case 13:if(k.p=13,!((L=k.v)instanceof Xu)){k.n=14;break}throw L;case 14:if(!qu(L)){k.n=15;break}return E=L,w++,k.a(3,1);case 15:throw L;case 16:if(void 0!==S||void 0===E){k.n=17;break}throw E;case 17:throw new Yu(e,w,S);case 18:return k.a(2)}},null,null,[[4,13]],Promise)}var el=function(){return c(function e(){o(this,e)},[{key:"fetchPaywalls",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(null!=(e=Fr.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&&Fr.setPaywalls(ut,n),i.a(2,n);case 5:return i.a(2,t)}},null,this,null,Promise)}},{key:"getAnonymousPaywalls",value:function(e=Ae){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(js.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 ui.error(Zr(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(js.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 ui.error(Zr(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:"fetchPaywallByUrl",value:function(e){return k(function(t){for(;;)if(0===t.n)return t.a(2,Zu(e))},null,null,null,Promise)}},{key:"fetchPaywallsByUrls",value:function(e){var t,n,i,r,o,s,u,l;return k(function(d){for(;;)switch(d.n){case 0:return t=[...new Set(e)],d.n=1,a(Promise.allSettled(t.map(e=>this.fetchPaywallByUrl(e))));case 1:for(n=d.v,i=[],r=0,o=h(n);!(s=o()).done;)"fulfilled"===(u=s.value).status?(i.push(u.value.data),r+=u.value.retryCount):ui.error(`Failed to fetch individual paywall: ${u.reason}`);if(!(i.length>0)){d.n=2;break}return(l=this.validatePaywalls(i)).length>0&&Fr.setPaywalls(ut,l),d.a(2,{paywalls:l,retryCount:r});case 2:return d.a(2,{paywalls:i,retryCount:r})}},null,this,null,Promise)}},{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)||(ui.warn(`Dropping paywall "${e.id}" from cache: template.pages is missing or empty`),!1)})}},{key:"fallbackData",value:function(){var e=Fr.getPaywalls(ut)||Fr.getPaywalls(St);return e?{count:e.length,results:e}:null}}])}();el.instance=new el;var tl=function(){return c(function e(){o(this,e)},[{key:"fetchConfig",value:function(){var e,t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,n.n=1,a(js.instance.fetchAPI("config/"));case 1:e=n.v,n.n=3;break;case 2:if(n.p=2,t=n.v,e=Fr.getAppConfig(at)||Fr.getAppConfig(yt)){n.n=3;break}throw ui.error(Zr(t.status,"config/")),t;case 3:return e&&Fr.setAppConfig(at,e),n.a(2,e)}},null,null,[[0,2]],Promise)}}])}();tl.instance=new tl;var nl=null;function il(){nl&&nl.setInMemoryAnonymousMode(!1)}function al(){return!!Fr.getAnonymousMode()||!!nl&&nl.isInMemoryAnonymousMode()}var rl=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(!al()){t.n=1;break}return ui.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,a(js.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,ui.error("error on start session: ",e);case 4:return t.a(2)}},null,null,[[1,3]],Promise)}}])}();rl.instance=new rl;var ol=function(){return c(function e(){o(this,e)},null,[{key:"allPurchases",value:function(){return[]}}])}();ol.instance=new ol;var sl={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"}},ul="en";function ll(e){var t,n,i=function(e){if(!e)return ul;var t=e.trim();if(sl[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return sl[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":ul}(Fr.getLanguageCode()),a=null!==(t=sl[i])&&void 0!==t?t:sl[ul];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}function dl(e){if("subscription"===(null==e?void 0:e.product_type)){var t=hl(e);if(t.length>0)return t[0].billingPeriod}return null}function cl(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return ml(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function hl(e){return e?ml(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function ml(e,t){return e.map(e=>fl(e,t))}function fl(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:gl(m).format(h)}}function vl(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=ll(o),l=ll(s);return a||u!==o||(u=ll(`${r}_abbrev`)),a||l!==s||(l=ll(`${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 pl(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 gl(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 yl=(e,t,n)=>e&&t&&n?n.format(e-t):null,bl=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},wl=(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)}},kl=e=>El(e.priceAmountMicros)/Sl(e.billingPeriod),Sl=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},El=e=>e/1e6;function Pl(e){return parseFloat((Math.round(e)/100).toFixed(2))}var Tl=(e,t,n=[])=>({price:()=>_l(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>Al(e),durationSingular:()=>Al(e,!0),period:()=>Al(e,!1,!0),periodNumber:()=>Al(e,!1,!1,!0),freeTrialDuration:()=>Dl(e),freeTrialDurationSingular:()=>Dl(e,!0),freeTrialPeriod:()=>Dl(e,!1,!0),freeTrialPeriodNumber:()=>Dl(e,!1,!1,!0),pricePerMonth:()=>xl(e),pricePerMonthRounded:()=>xl(e,!0),periodInMonths:()=>Cl(e),durationInMonths:()=>Il(e),durationInMonthsSingular:()=>Il(e,!0),periodNumberInMonths:()=>Ll(e),percentagePriceDifferenceFromSku:()=>Rl(e,t,n),priceDifferenceFromSku:()=>Fl(e,t,n),promoEligible:()=>null===Ol(e)&&null!==$l(e,t),freeTrialEligible:()=>null!==Ol(e),promo:()=>{var n;return null===(n=$l(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=Nl(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Wl(e,t,!1,!0),promoPeriodNumber:()=>Wl(e,t,!1,!1,!0),promoDuration:()=>Wl(e,t),promoDurationSingular:()=>Wl(e,t,!0),introEligible:()=>!1,pricePerDay:()=>jl(e),pricePerWeek:()=>Bl(e),pricePerWeekRounded:()=>Bl(e,!0),introductoryPrice:()=>zl(e,t),introductoryPeriod:()=>Ul(e,t,!1,!0),introductoryPeriodNumber:()=>Ul(e,t,!1,!1,!0),introductoryDuration:()=>Ul(e,t),introductoryDurationSingular:()=>Ul(e,t,!0),introductoryPricePerMonth:()=>Hl(e,t),introductoryPricePerMonthRounded:()=>Hl(e,t,!0),durationAbbrev:()=>Al(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Dl(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>Ul(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Wl(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Wl(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>Il(e,!1,!1,!1,!0),durationSingularAbbrev:()=>Al(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Dl(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>Ul(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Wl(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Wl(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>Il(e,!0,!1,!1,!0),periodAbbrev:()=>Al(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Dl(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>Ul(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Wl(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Wl(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>Il(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?ll("nami_weekly"):2===u?ll("nami_biweekly"):null:s>0?ll(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?ll("nami_yearly"):null}(dl(e)),iso_subscription_duration:()=>Vl(e),invalid:()=>!1,unavailable:()=>!1}),Ml=(e,t,n,i=[])=>{if(!t)return null;var a=Tl(t,n,i);return a[e]?a[e]():null},_l=e=>{var t=hl(e);return t&&t.length?t[0].formattedPrice:null},Al=(e,t,n,i,a)=>vl(dl(e),t,n,i,a),Dl=(e,t,n,i,a)=>vl(cl(e),t,n,i,a),xl=(e,t)=>{var n=hl(e);if(!n||0===n.length)return null;var i=kl(n[0]);return i?gl(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},Cl=(e,t)=>{var n=hl(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return pl(i)?vl("P1Y"===i?"P12M":i,!1,!1,!1,t):null},Il=(e,t,n,i,a)=>{var r=hl(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return pl(o)?vl("P1Y"===o?"P12M":o,t,n,i,a):null},Ll=e=>{if(!e)return 0;var t=hl(e);return t&&t.length?Sl(t[0].billingPeriod):0},Rl=(e,t,n=[])=>{var i,a=hl(e);if(!a||0===a.length)return null;var r=null===(i=wl(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return bl(Pl(a[0].priceAmountMicros),Ll(e));var o=hl(r);return bl(Pl(a[0].priceAmountMicros),Ll(e),(null==o?void 0:o.length)>0?Pl(o[0].priceAmountMicros):0,Ll(r))},Fl=(e,t,n=[])=>{var i,a=hl(e);if(!a||0===a.length)return null;var r=null===(i=wl(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return yl(kl(a[0]));var o=hl(r);return yl(kl(a[0]),kl(o[0]),gl(o[0].priceCurrencyCode))},Ol=e=>cl(e),$l=(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},Nl=(e,t)=>e?fl($l(e,t),e.subscription_period):null,Wl=(e,t,n,i,a,r)=>{var o=Nl(e,t);return vl((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},jl=(e,t)=>{var n=hl(e);if(!n||0===n.length)return null;var i,a,r=El(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=Sl(i))?30.437*a:1);return r?gl(n[0].priceCurrencyCode).format(r):null},Bl=(e,t)=>{var n=hl(e);if(!n||0===n.length)return null;var i,a,r=El(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=Sl(i))?52*a/12:1);return r?gl(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},zl=(e,t)=>{var n=Gl(e,t);return(null==n?void 0:n.formattedPrice)||null},Ul=(e,t,n,i,a,r)=>{var o=Gl(e,t);return vl((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Hl=(e,t,n)=>{var i=Gl(e,t);if(i){var a=El(i.priceAmountMicros),r=Sl(i.billingPeriod),o=n?Math.round(a/r):a/r;return gl(i.priceCurrencyCode).format(o)}},Gl=(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],fl(n,e.subscription_period)):null;var n},Vl=e=>{var t=dl(e);return t?"P7D"===t?"P1W":t:null};function Kl(e,t,n,i){var a=n.flatMap(e=>e.products).find(e=>e.id===t.selectedProducts[t.currentGroupId]);return Yl(Ql(e,null==a?void 0:a.sku_ref_id),a,i)}function Xl(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=Ql(e,t.sku_ref_id||""),t.variables=Yl(t.product_details,t,r)}),r}function Yl(e,t,n){if(!t)return{};var i=t.variables;if(!i)return m({},t);Object.keys(i).forEach(t=>{if("string"==typeof(r=i[t])&&r.includes(ni)){var a=ql(i[t],e,n);i[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(a)}var r});var a={};return Object.keys(Tl({})).forEach(t=>{if(void 0===i[t]){var r=Ml(t,e,void 0,n);null!==r&&(a[t]=r)}}),m({},t,a,i)}var ql=(e,t,n)=>e.replace(Qn,(i,a)=>{var r,o,s,u,l=(null===(r=Qn.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 Ml(a,t,d,n)});function Jl(e,t){return t.flatMap(e=>e.products).some(t=>1==Ml("freeTrialEligible",Ql(e,t.sku_ref_id)))}function Ql(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var Zl=function(){try{var e=Wi(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ed=Object.prototype.hasOwnProperty;function td(e,t,n){var i=e[t];ed.call(e,t)&&di(i,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&Zl?Zl(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}var nd="object"==typeof e&&e&&!e.nodeType&&e,id=nd&&"object"==typeof module&&module&&!module.nodeType&&module,ad=id&&id.exports===nd?pi.Buffer:void 0;ad&&ad.allocUnsafe;var rd=Ia(Object.getPrototypeOf,Object),od=Object.prototype.hasOwnProperty;function sd(e){var t=new e.constructor(e.byteLength);return new Qi(t).set(new Qi(e)),t}var ud=/\w*$/;var ld=gi?gi.prototype:void 0,dd=ld?ld.valueOf:void 0;function cd(e,t,n){var i,a,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return sd(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return r=sd((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=sd(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,ud.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return i=e,dd?Object(dd.call(i)):{}}}var hd=Object.create,md=function(){function e(){}return function(t){if(!Ti(t))return{};if(hd)return hd(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var fd=Ta&&Ta.isMap,vd=fd?ka(fd):function(e){return sa(e)&&"[object Map]"==Qa(e)};var pd=Ta&&Ta.isSet,gd=pd?ka(pd):function(e){return sa(e)&&"[object Set]"==Qa(e)},yd="[object Arguments]",bd="[object Function]",wd="[object Object]",kd={};function Sd(e,t,n,i,a,r){var o;if(void 0!==o)return o;if(!Ti(e))return e;var s=ia(e);if(s)o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&od.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var u=Qa(e),l=u==bd||"[object GeneratorFunction]"==u;if(pa(e))return e.slice();if(u==wd||u==yd||l&&!a)o=l?{}:function(e){return"function"!=typeof e.constructor||Ca(e)?{}:md(rd(e))}(e);else{if(!kd[u])return a?e:{};o=cd(e,u)}}r||(r=new Ki);var d=r.get(e);if(d)return d;r.set(e,o),gd(e)?e.forEach(function(i){o.add(Sd(i,t,n,i,e,r))}):vd(e)&&e.forEach(function(i,a){o.set(a,Sd(i,t,n,a,e,r))});var c=s?void 0:Oa(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]),td(o,a,Sd(i,t,n,a,e,r))}),o}kd[yd]=kd["[object Array]"]=kd["[object ArrayBuffer]"]=kd["[object DataView]"]=kd["[object Boolean]"]=kd["[object Date]"]=kd["[object Float32Array]"]=kd["[object Float64Array]"]=kd["[object Int8Array]"]=kd["[object Int16Array]"]=kd["[object Int32Array]"]=kd["[object Map]"]=kd["[object Number]"]=kd[wd]=kd["[object RegExp]"]=kd["[object Set]"]=kd["[object String]"]=kd["[object Symbol]"]=kd["[object Uint8Array]"]=kd["[object Uint8ClampedArray]"]=kd["[object Uint16Array]"]=kd["[object Uint32Array]"]=!0,kd["[object Error]"]=kd[bd]=kd["[object WeakMap]"]=!1;var Ed=e=>"object"==typeof e&&null!==e&&"handleEvent"in e,Pd=(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){}}},Td=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;Pd(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;Pd(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):Ed(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 Pd(e,"currentTarget",null),!e.defaultPrevented}}])}(),Md=[];var _d={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,groups:[],selectedProducts:{},formStates:{},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},Ad=function(t){function n(e,t,i){var a;o(this,n),(a=r(this,n)).subscribers=new Set,a.productDetails=Md,a.filteredSkuMenus=[],a.state=Sd(_d,5);var s=Fr.getNamiProfile();return a.state.isLoggedIn=!(null==s||!s.externalId),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=Kl(this.productDetails,this.state,this.filteredSkuMenus,Xl(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:"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=Kl(this.productDetails,this.state,this.filteredSkuMenus,Xl(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(m({},this.state,{selectedProducts:e,sku:t}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,u=m({},this.state,{formFactor:ou(),selectedPaywall:e,selectedCampaign:n}),l=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=m({},u,null===(i=e.template)||void 0===i?void 0:i.initialState)).launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(a=e.sku_menus)&&void 0!==a?a:[],l.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter(e=>l.productGroups.includes(e.ref))),""!==l.currentGroup&&u.groups.length&&null!==(r=e.template)&&void 0!==r&&r.displaySingleGroup)&&(u.currentGroupId=null!==(o=null===(s=u.groups.find(e=>e.ref==l.currentGroup))||void 0===s?void 0:s.id)&&void 0!==o?o:"");if(""===u.currentGroupId&&1===this.filteredSkuMenus.length){var d,c=u.groups.find(e=>e.ref==this.filteredSkuMenus[0].ref);u.currentGroupId=null!==(d=null==c?void 0:c.id)&&void 0!==d?d:u.currentGroupId}var h=Xl(this.productDetails,this.filteredSkuMenus,u.currentGroupId);u.skuItems=h,u.launch=l,u.anySkuHasTrialOffer=Jl(this.productDetails,this.filteredSkuMenus),u.anySkuHasPromoOffer=function(e,t){return!Jl(e,t)&&t.flatMap(e=>e.products).some(t=>1==Ml("promoEligible",Ql(e,t.sku_ref_id)))}(this.productDetails,this.filteredSkuMenus),u.paywallId=e.id,u.sku=Kl(this.productDetails,u,this.filteredSkuMenus,h),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:"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,{userTags:m({},this.state.userTags,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){this.providers=this.providers.filter(t=>t!==e)}},{key:"reset",value:function(){this.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)}),Md=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}}])}(Td);Ad.providers=[];var Dd=c(function e(){o(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}});Dd.instance=new Dd;var xd=()=>Lr(li([...Fr.getNamiEntitlements(pt),...Fr.getNamiEntitlements(Mt)]),"referenceId"),Cd=()=>{Ou.getInstance().emit(Xn,xd())};function Id(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 Ld=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,al()||Ds(Pe.THIRD_PARTY_TRANSACTIONS)||!Ds(Pe.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=Fr.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)&&(Fr.setActiveEntitlements(ft,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:al()&&ui.debug("Skipping active entitlements update - anonymous mode"),Ds(Pe.THIRD_PARTY_TRANSACTIONS)&&ui.debug("Skipping active entitlements update - paywalls-only mode"),Ds(Pe.ENTITLEMENT_MANAGEMENT)||ui.debug("Skipping active entitlements update - no entitlement_management capability");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(js.instance.fetchAPI(t));case 2:n=r.v,r.n=4;break;case 3:throw r.p=3,i=r.v,ui.error(Zr(i.status,t)),i;case 4:return r.a(2,n)}},null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){Cs()&&(e=>{Fr.setNamiEntitlements(pt,e);var t=Fr.getNamiEntitlements(Mt),n=new Set(e.map(e=>e.referenceId)),i=t.filter(e=>{var t=n.has(e.referenceId);return t&&ui.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t});i.length!==t.length&&Fr.setNamiEntitlements(Mt,i),Cd()})(e.map(e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:Dd.instance.refIdToRelatedSKUs[t]||[],activePurchases:Dd.instance.refIdToActivePurchases[t]||[],purchasedSkus:Dd.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e)))}}])}();Ld.instance=new Ld;var Rd=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(!al()){r.n=1;break}return ui.debug("Skipping customer journey state update - anonymous mode"),r.a(2,null);case 1:if(null!=(e=Fr.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(js.instance.fetchAPI(t,void 0,0));case 4:n=r.v,r.n=6;break;case 5:throw r.p=5,i=r.v,ui.error(Zr(i.status,t)),i;case 6:if(!n){r.n=7;break}return Fr.setCustomerJourneyState(n.customer_journey_state),r.a(2,n.customer_journey_state);case 7:return r.a(2,null)}},null,null,[[3,5]],Promise)}}])}();Rd.instance=new Rd;var Fd="[NamiStartup]",Od=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(){var e,t,n;this.enabled=(n=null===(e=Fr.getNamiConfig())||void 0===e?void 0:e.namiCommands,null!==(t=null==n?void 0:n.includes(wn))&&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;ui.info(`${Fd} phase=${e} ms=${i} total_to_ready=${r}${a}`),ui.info(`${Fd} SUMMARY total_to_ready=${r} decode=${this.decodeDuration} process=${this.processDuration} placements=${this.placements}`)}else ui.info(`${Fd} 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 ui.info(`${Fd} 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,ui.info(`${Fd} phase=server_fetch ms=${i} campaigns=${n.length}`),r.a(2,n)}},null,this,null,Promise)}}])}(),$d=new Od,Nd=function(){return c(function e(){o(this,e),this.inMemoryAnonymousMode=!1,nl=this},[{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,ui.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 Fr.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"init",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return this.setInitialValues(e),tl.instance.fetchConfig(),t.n=1,a(this.initAndFetchRequiredData(e));case 1:rl.instance.startSession();case 2:return t.a(2)}},null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=m({},e);delete t.initialConfig,Fr.clearSessionId(),Fr.setNamiConfig(t),Fr.setLanguageCode(e.namiLanguageCode),Fr.setPurchaseChannel(e.purchaseChannel);var n=e.initialConfig;if(n.appConfig||n.platform_config){var i=(null==n?void 0:n.appConfig)||(null==n?void 0:n.platform_config);i&&Fr.setAppConfig(yt,i)}null!=n&&n.paywalls&&Fr.setPaywalls(St,n.paywalls),null!=n&&n.products&&Fr.setProducts(Pt,n.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:Wu.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=m({},ru(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)?du(i):void 0}}}(e.namiCommands),i=Wu.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:ou(),l=this.isAnonymousMode(),d=l?this.initAnonymousDevice():this.initIdentifiedDevice(e),c=d.deviceId,h=d.deviceTask,m=uu(c),s.campaign_rules&&(f=pu(s.campaign_rules,m,u),Fr.setCampaignRules(wt,f),$d.mark("initial_processed",{count:f.length})),!h){p.n=1;break}return p.n=1,a(h);case 1:if($u.instance.configure(u,m,e.namiCommands),xs(),v=Promise.all([ju.instance.fetchProducts(),Rd.instance.fetchCustomerJourneyState(),Ld.instance.fetchActiveEntitlements(),$d.serverFetch(()=>this.fetchCampaignsAndPaywalls())]).catch(i=>{var r;return k(function(o){for(;;)switch(o.n){case 0:if(!(i instanceof Nr)){o.n=3;break}if(Fr.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 ui.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)}),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;return k(function(v){for(;;)switch(v.n){case 0:return e=$u.instance,t=el.instance,n=Date.now(),i=Date.now(),v.n=1,a(e.fetchCampaignRulesRaw());case 1:return r=v.v,o=Date.now()-i,v.n=2,a(Promise.all(r.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(fetch(e.flow.url,{cache:"no-cache"}));case 1:if(!(t=i.v).ok){i.n=3;break}return i.n=2,a(t.json());case 2:e.flow.object=i.v,i.n=4;break;case 3:ui.warn(`Failed to fetch flow object from ${e.flow.url}: ${t.status}`);case 4:i.n=6;break;case 5:i.p=5,n=i.v,ui.warn(`Error fetching flow object from ${e.flow.url}: ${n}`);case 6:return i.a(2)}},null,null,[[0,5]],Promise)})));case 2:if(s=!e.useLegacyPaywallFetch&&$u.hasPaywallUrls(r),l=0,d=Date.now(),!s){v.n=4;break}return c=$u.extractPaywallUrls(r),v.n=3,a(t.fetchPaywallsByUrls(c));case 3:h=v.v,u=h.paywalls,l=h.retryCount,v.n=6;break;case 4:return v.n=5,a(t.fetchPaywalls());case 5:u=v.v;case 6:return m=Date.now()-d,f=Date.now()-n,ui.info(`Paywall fetch telemetry: strategy=${s?"individual":"bulk"}, count=${u.length}, total=${f}ms, campaigns=${o}ms, paywalls=${m}ms`+(s?`, retry_count=${l}`:"")),v.a(2,e.finalizeCampaignRules(r,u))}},null,null,null,Promise)}},{key:"reRenderPaywall",value:function(){we().ui.reRenderPaywall()}}])}();function Wd(e){return Array.isArray(e)?e.map(Wd):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=Wd(n)),e),{}):e}function jd(e,t){return Nu(Wd(e),Wd(t))}Nd.instance=new Nd;var Bd,zd=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?Fr.setNamiProfile({externalId:this.externalId}):Fr.removeNamiProfile(),this}},{key:"load",value:function(){var e=Fr.getNamiProfile();e&&(this.externalId=e.externalId),Ad.setIsLoggedIn(!!this.externalId)}},{key:"loginLocal",value:function(e){this.setExternalId(e).save(),Ad.setIsLoggedIn(!0)}},{key:"loginRemote",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return n.n=1,a(js.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(),Ad.setIsLoggedIn(!1)}},{key:"logoutRemote",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(js.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)}}])}();zd.instance=new zd;var Ud=function(){function e(){o(this,e),Bd.set(this,!1),this.maxLogging=!1}return c(e,[{key:"isInitialized",get:function(){return Se(this,Bd,"f")||null!=Fr.getNamiConfig()}},{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,Bd,"f")?Fr.getNamiConfig():null,ui.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,!jd(l,u)){f.n=1;break}return ui.warn("Nami SDK is already configured, ignoring this configure call."),f.a(2,{sdkInitialized:!0,configureState:zn});case 1:s=!0;case 2:d=As(t.namiCommands),c=As(u.namiCommands),t.appPlatformID==u.appPlatformID&&d==c||(o=!0),t.namiLanguageCode===u.namiLanguageCode&&t.logLevel==u.logLevel||(s=!0);case 3:return o&&(ui.info("SDK full reconfigure called"),Fr.resetDevice()),Ee(this,Bd,!0),js.configure(t),f.n=4,a(Nd.instance.init(t));case 4:return ui.info("SDK successfully initialized!"),h=s||o?jn:Nn,null===(i=(r=we().ui).postConfigure)||void 0===i||i.call(r),$d.mark("ready"),f.a(2,{sdkInitialized:!0,configureState:h})}},null,this,null,Promise)}}],[{key:"sdkVersion",value:function(){return Ae}},{key:"sdkPackageVersion",value:function(){return xe}},{key:"reset",value:function(){var t,n,i;return k(function(r){for(;;)switch(r.n){case 0:return Fr.clearAll(),il(),Ee(e.instance,Bd,!1),zd.instance.setExternalId(void 0),Ad.reset(),js.reset(),$u.instance.reset(),r.n=1,a(Promise.resolve().then(function(){return Bc}));case 1:i=r.v,i.NamiFlowManager.reset(),null===(t=(n=we().ui).onReset)||void 0===t||t.call(n);case 2:return r.a(2)}},null,null,null,Promise)}},{key:"configure",value:function(t){return k(function(n){for(;;)switch(n.n){case 0:if($d.start(),t.appPlatformID){n.n=1;break}throw new jr;case 1:return this.setInitialConfig(t),$d.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){ui.warn("[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 ui.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=Rs(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},ui.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();Bd=new WeakMap,Ud.instance=new Ud;var Hd,Gd,Vd,Kd=new Set(["fullscreen","sheet","compact_sheet","modal"]);e.NamiPaywallManagerEvents=void 0,(Hd=e.NamiPaywallManagerEvents||(e.NamiPaywallManagerEvents={})).BuySku="RegisterBuySKU",Hd.Close="PaywallCloseRequested",Hd.SignIn="PaywallSignInRequested",Hd.Restore="PaywallRestoreRequested",Hd.DeeplinkAction="PaywallDeeplinkAction",e.NamiPaywallAction=void 0,(Gd=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",Gd.SELECT_SKU="SELECT_SKU",Gd.RESTORE_PURCHASES="RESTORE_PURCHASES",Gd.SIGN_IN="SIGN_IN",Gd.CLOSE_PAYWALL="CLOSE_PAYWALL",Gd.SHOW_PAYWALL="SHOW_PAYWALL",Gd.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",Gd.PURCHASE_SUCCESS="PURCHASE_SUCCESS",Gd.PURCHASE_FAILED="PURCHASE_FAILED",Gd.PURCHASE_CANCELLED="PURCHASE_CANCELLED",Gd.PURCHASE_PENDING="PURCHASE_PENDING",Gd.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",Gd.PURCHASE_DEFERRED="PURCHASE_DEFERRED",Gd.DEEPLINK="DEEPLINK",Gd.TOGGLE_CHANGE="TOGGLE_CHANGE",Gd.PAGE_CHANGE="PAGE_CHANGE",Gd.SLIDE_CHANGE="SLIDE_CHANGE",Gd.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",Gd.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",Gd.VIDEO_STARTED="VIDEO_STARTED",Gd.VIDEO_PAUSED="VIDEO_PAUSED",Gd.VIDEO_RESUMED="VIDEO_RESUMED",Gd.VIDEO_ENDED="VIDEO_ENDED",Gd.VIDEO_CHANGED="VIDEO_CHANGED",Gd.VIDEO_MUTED="VIDEO_MUTED",Gd.VIDEO_UNMUTED="VIDEO_UNMUTED",Gd.COUNTDOWN_TIMER_COMPLETED="COUNTDOWN_TIMER_COMPLETED",Gd.UNKNOWN="UNKNOWN",e.LaunchCampaignError=void 0,(Vd=e.LaunchCampaignError||(e.LaunchCampaignError={})).DEFAULT_CAMPAIGN_NOT_FOUND="Default campaign not found",Vd.LABELED_CAMPAIGN_NOT_FOUND="Labeled campaign not found",Vd.CAMPAIGN_DATA_NOT_FOUND="Campaign data not found",Vd.PAYWALL_ALREADY_DISPLAYED="Paywall is already being displayed",Vd.SDK_NOT_INITIALIZED="SDK has not been initialized",Vd.PAYWALL_COULD_NOT_DISPLAY="Failed to display paywall",Vd.URL_CAMPAIGN_NOT_FOUND="URL campaign not found",Vd.PRODUCT_DATA_NOT_FOUND="Product data not found",Vd.PRODUCT_GROUPS_NOT_FOUND="Product groups not found",Vd.FLOW_SCREEN_DATA_UNAVILABLE="Flow unavailable due to missing screen data";var Xd,Yd="entry",qd="screen",Jd="branch",Qd="exit",Zd="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.PAUSE="flowPause",e.RESUME="flowResume"}(Xd||(Xd={}));var ec="__handoff_sequence__",tc="__buy_sku__",nc="__default__",ic="__appear__",ac="__disappear__",rc="__login_success__",oc="__login_failure__",sc="__logout_success__",uc="__logout_failure__",lc="__purchase_success__",dc="__remoteback__",cc="__tag_update__",hc="and",mc="or",fc="i_contains",vc="equals",pc="i_equals",gc="not_equals",yc="not_i_equals",bc="not_contains",wc="set",kc="notSet",Sc="greater_than",Ec="greater_than_or_equal_to",Pc="less_than",Tc="less_than_or_equal_to";function Mc(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}var _c=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=n.map(e=>this.evaluateFilter(e));switch(e.operator){case hc:return i.every(e=>e);case mc:return i.some(e=>e);default:return i.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;switch(e.operator){case hc:for(var i,a=h(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case mc:for(var o,s=h(n);!(o=s()).done;){var u=o.value;if(this.evaluateFilter(u))return!0}return!1;default:for(var l,d=h(n);!(l=d()).done;){var c=l.value;if(!this.evaluateFilter(c))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(Ud.instance.maxLogging&&ui.debug(`[NamiConditionEvaluator] resolve(${e.identifier}) → ${JSON.stringify(t)} (type: ${typeof t})`),e.operator===wc)return null!=t;if(e.operator===kc)return null==t;if(null==t)return Ud.instance.maxLogging&&ui.debug(`[NamiConditionEvaluator] ${e.identifier} resolved to null — registeredNamespaces: [${[...this.namespaceResolvers.keys()].join(", ")}]`),!![gc,yc,bc].includes(e.operator);switch(e.operator){case fc:return Array.isArray(t)?e.values.some(e=>{var n=String(e);return t.some(e=>0===e.localeCompare(n,void 0,{sensitivity:"accent"}))}):(this.log("Resolved value is not an array of strings for i_contains."),!1);case vc:return e.values.some(e=>{var n=String(e);if("string"==typeof t)return t===n;if("boolean"==typeof t){var i="true"===n.toLowerCase();return t===i}return this.log("Unsupported type for equals comparison: "+typeof t),!1});case pc:return e.values.some(e=>{var n=String(e);if("string"==typeof t)return 0===t.localeCompare(n,void 0,{sensitivity:"accent"});if("boolean"==typeof t){var i="true"===n.toLowerCase();return t===i}return this.log("Unsupported type for i_equals comparison: "+typeof t),!1});case gc:return e.values.every(e=>{var n=String(e);return"string"!=typeof t||t!==n});case yc:return e.values.every(e=>{var n=String(e);return"string"!=typeof t||0!==t.localeCompare(n,void 0,{sensitivity:"accent"})});case bc:return e.values.every(e=>{var n=String(e);return"string"!=typeof t||!t.includes(n)});case Sc:case Ec:case Pc:case Tc:var n=Mc(t);return null===n?(this.log(`Resolved value is not numerically comparable for ${e.operator}`),!1):e.values.some(t=>{var i=Mc(t);if(null===i)return!1;switch(e.operator){case Sc:return n>i;case Ec:return n>=i;case Pc:return n<i;default:return n<=i}});default:return this.log(`Unsupported operator: ${e.operator}`),!1}}},{key:"resolve",value:function(e){var t=this.resolveRaw(e);if(void 0!==t)return Ud.instance.maxLogging&&ui.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 Ud.instance.maxLogging&&ui.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 Ud.instance.maxLogging&&ui.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){ui.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),Ac=function(){return c(function e(){o(this,e)},[{key:"register",value:function(){_c.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}}])}(),Dc=function(e){function t(e){var n;return o(this,t),(n=r(this,t)).namespace="LaunchContext",n.context=e,n.register(),n}return p(t,e),c(t,[{key:"resolveValue",value:function(e){if(e.startsWith("customAttributes.")){var t=e.substring(17);return this.resolveKeyPath(t,this.context.customAttributes)}if(e.startsWith("customObject.")){var n=e.substring(13);return this.resolveKeyPath(n,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(Ac),xc=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=ru(),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)}}])}(Ac),Cc=[/(^|_)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],Ic=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=>Cc.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()}}])}();Ic._instance=null;var Lc,Rc=()=>Ic.instance.params,Fc=/\{\{\s*([^}]+?)\s*\}\}/g,Oc=function(){return c(function e(t){o(this,e),this.flowManager=t,this.urlParams=Rc()},[{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,c,h,m=this.flowManager.currentFlow,f=null==m?void 0:m.component;if(e.startsWith("launchContext.")){var v,p=null===(v=this.flowManager.currentFlow)||void 0===v?void 0:v.context;if(p){var g=e.substring(14),y=new Dc(p).resolveValue(g);return null==y?void 0:y.toString()}}else switch(e){case"campaignId":return null==f||null===(t=f.campaign)||void 0===t?void 0:t.rule;case"campaignName":return null==f||null===(n=f.campaign)||void 0===n?void 0:n.name;case"campaignLabel":case"campaignPlacement":return null!==(i=null==f||null===(a=f.campaign)||void 0===a?void 0:a.value)&&void 0!==i?i:void 0;case"campaignSegment":case"campaignSegmentId":return null==f||null===(r=f.campaign)||void 0===r?void 0:r.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(o=null==f||null===(s=f.campaign)||void 0===s?void 0:s.external_segment)&&void 0!==o?o:void 0;case"pageName":return null==f||null===(u=f.paywall)||void 0===u?void 0:u.name;case"pageId":return null==f||null===(l=f.paywall)||void 0===l?void 0:l.id;case"flowName":return null==m?void 0:m.name;case"flowId":return null==m?void 0:m.id;case"objectId":return null==f||null===(d=f.campaign)||void 0===d||null===(d=d.flow)||void 0===d?void 0:d.object_id;case"stepName":return null==m||null===(c=m.currentFlowStep)||void 0===c?void 0:c.name;case"buttonText":var b=null==m?void 0:m.currentButton;if(!b)return;var w=b.firstTextValue;if("function"!=typeof w)return;return w.call(b);case"slideNumber":var k=null==f?void 0:f.getSelectedSlideIndexForCurrentCarousel();return null!=k?`${k+1}`:void 0;case"productGroupId":return(null===(h=Ad.currentProvider)||void 0===h?void 0:h.state.currentGroupId)||void 0;case"productGroupName":var S,E,P,T=null===(S=Ad.currentProvider)||void 0===S?void 0:S.state;return null!==(E=null==T||null===(P=T.groups)||void 0===P||null===(P=P.find(e=>e.id===T.currentGroupId))||void 0===P?void 0:P.displayName)&&void 0!==E?E:void 0;case"productGroupRef":var M,_,A,D=null===(M=Ad.currentProvider)||void 0===M?void 0:M.state;return null!==(_=null==D||null===(A=D.groups)||void 0===A||null===(A=A.find(e=>e.id===D.currentGroupId))||void 0===A?void 0:A.ref)&&void 0!==_?_:void 0;default:return}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Fc,(e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""})}},{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}}])}(),$c=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="urlParams",e.context=Rc(),e.register(),e}return p(t,e),c(t,[{key:"resolveValue",value:function(e){return ui.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(Ac),Nc=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=Ad.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)}}}])}(Ac),Wc=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=Ad.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()}}}}])}(Ac);!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"}(Lc||(Lc={}));var jc=function(){function e(){o(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(e,t,n){var i=new Gc(e,t,this,n);return this.flowOpen=!0,this.currentFlow=i,i}},{key:"finishFlow",value:function(){Ud.instance.maxLogging&&ui.debug("[NamiFlowManager] finishFlow() — closing flow"),this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear()}},{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;if(!this.currentFlow.currentFlowStep)return 0;var t=this.currentFlow.steps.filter(e=>e.type===qd);if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter(e=>e.type===qd);if(0===n.length)return 0;var i=this.buildNavGraph(this.currentFlow),a=this.currentFlow.currentFlowStep,r=this.findBranchPoint(t,i),o=0;if(r)o=this.calculateBranchingProgress(n,t,a,r,i);else{var s=t.findIndex(e=>e.id===a.id);o=s>=0?(s+1)/t.length:0}return o=Math.max(0,Math.min(1,o)),e&&this.setLastAnimatedFlowProgress(e,o),o}},{key:"findBranchPoint",value:function(e,t){for(var n,i=h(e);!(n=i()).done;){var a=n.value;if(this.hasBranching(a,e,t))return a}return null}},{key:"calculateBranchingProgress",value:function(e,t,n,i,a){var r=e.length,o=t.findIndex(e=>e.id===i.id),s=e.findIndex(e=>e.id===i.id),u=t.findIndex(e=>e.id===n.id);if(-1===s||n.id===i.id)return(u+1)/(o+2);var l=this.countForwardScreens(n,t,a),d=r+l;return ui.debug(`Branching progress: visited=${r}, remaining=${l}, total=${d}, step=${n.id}`),r/d}},{key:"countForwardScreens",value:function(e,t,n){var i=t.findIndex(t=>t.id===e.id);if(-1===i)return 0;var a=new Set,r=0,o=(e,s)=>{if(!a.has(e)){a.add(e);var u=(n.get(e)||[]).filter(e=>{var n=t.findIndex(t=>t.id===e);return n>i});if(0!==u.length)for(var l,d=h(u);!(l=d()).done;){var c=l.value;o(c,s+1)}else r=Math.max(r,s)}};return o(e.id,0),r}},{key:"hasBranching",value:function(e,t,n){var i=t.findIndex(t=>t.id===e.id);if(-1===i)return!1;var a=(n.get(e.id)||[]).filter(e=>{var n=t.findIndex(t=>t.id===e);return n>i});return a.length>1}},{key:"buildNavGraph",value:function(e){var t=this.navGraphCache.get(e);if(t)return t;var n=new Map;e.steps.forEach(e=>{e.actions&&Object.values(e.actions).forEach(t=>{Array.isArray(t)&&t.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[ic];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===Xd.NAVIGATE||d.function===Xd.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}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e;var t=e;return()=>{this.instance.handoffStepHandler===t&&(this.instance.handoffStepHandler=void 0)}}},{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;Ud.instance.maxLogging&&ui.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"}`);if(r&&o&&o.currentFlowStep){if(o.activeHandoffSequence)return ui.debug(`Resuming flow at handoff sequence ${o.currentFlowStep.id}`),void o.resumeNextHandoff();ui.debug(`Resuming flow at step ${o.currentFlowStep.id}`),o.executeLifecycle(o.currentFlowStep,"__resume__")}else ui.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?(ui.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.finished()):ui.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():ui.warn("This flow cannot be paused"):ui.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:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}(),Bc=Object.freeze({__proto__:null,NamiFlowManager:jc}),zc=()=>{var e,t;return null!==(e=null===(t=Fr.getNamiConfig())||void 0===t||null===(t=t.namiCommands)||void 0===t?void 0:t.includes("disableAsyncLoginLogout"))&&void 0!==e&&e},Uc=function(){return c(function e(){o(this,e),this.emitter=Ou.getInstance(),_c.shared.registerNamespaceResolver("UserTags",t=>{var n=t.replace("UserTags.",""),i=e.getCustomerAttribute(n);if(null!=i){var a=i.toLowerCase();return"true"===a||"false"===a?"true"===a:isNaN(Number(i))?i:parseInt(i,10)}return null})},[{key:"isSDKInitialized",get:function(){return Ud.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return zd.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||ui.debug(Ne),zd.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 Wr,this.invokeStateHandler(Lc.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){c.n=2;break}throw n=new Kr,this.invokeStateHandler(Lc.LOGIN,!1,n),n;case 2:if(zc()){c.n=3;break}return zd.instance.loginLocal(e),this.invokeStateHandler(Lc.LOGIN,!0),jc.instance.flowOpen&&(i=jc.instance.currentFlow,(r=null==i?void 0:i.currentFlowStep)&&(Ud.instance.maxLogging&&ui.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${r.id}`),i.executeLifecycle(r,rc))),zd.instance.loginRemote(e).catch(e=>{ui.error("[NamiCustomerManager] async login API failed",e)}),Ld.instance.fetchActiveEntitlements().catch(e=>{ui.error("[NamiCustomerManager] async login entitlement refresh failed",e)}),c.a(2);case 3:return c.p=3,c.n=4,a(zd.instance.login(e));case 4:return c.n=5,a(Ld.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Lc.LOGIN,!0),jc.instance.flowOpen&&(o=jc.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&(Ud.instance.maxLogging&&ui.debug(`[NamiCustomerManager] login success — triggering __login_success__ on step ${s.id}`),o.executeLifecycle(s,rc))),c.n=7;break;case 6:throw c.p=6,d=c.v,this.invokeStateHandler(Lc.LOGIN,!1,d),jc.instance.flowOpen&&(u=jc.instance.currentFlow,(l=null==u?void 0:u.currentFlowStep)&&(Ud.instance.maxLogging&&ui.debug(`[NamiCustomerManager] login failure — triggering __login_failure__ on step ${l.id}`),u.executeLifecycle(l,oc))),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 Wr,this.invokeStateHandler(Lc.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){d.n=2;break}throw t=new Kr,this.invokeStateHandler(Lc.LOGOUT,!1,t),t;case 2:if(zc()){d.n=3;break}return zd.instance.logoutLocal(),this.invokeStateHandler(Lc.LOGOUT,!0),jc.instance.flowOpen&&(n=jc.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&(Ud.instance.maxLogging&&ui.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${i.id}`),n.executeLifecycle(i,sc))),zd.instance.logoutRemote().catch(e=>{ui.error("[NamiCustomerManager] async logout API failed",e)}),Ld.instance.fetchActiveEntitlements().catch(e=>{ui.error("[NamiCustomerManager] async logout entitlement refresh failed",e)}),d.a(2);case 3:return d.p=3,d.n=4,a(zd.instance.logout());case 4:return d.n=5,a(Ld.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Lc.LOGOUT,!0),jc.instance.flowOpen&&(r=jc.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,sc)),d.n=7;break;case 6:throw d.p=6,l=d.v,this.invokeStateHandler(Lc.LOGOUT,!1,l),jc.instance.flowOpen&&(s=jc.instance.currentFlow,(u=null==s?void 0:s.currentFlowStep)&&s.executeLifecycle(u,uc)),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?Lc.ANONYMOUS_MODE_ON:Lc.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new Wr,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return ui.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 Gr:new Vr,this.invokeStateHandler(t,!1,i),s.a(2);case 3:if(!e){s.n=4;break}Fr.setAnonymousMode(e),Fr.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Lc.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return Fr.clearAnonymousMode(),il(),o=null===(r=Fr.getNamiConfig())||void 0===r?void 0:r.namiCommands,s.n=5,a(Wu.instance.createOrUpdateDevice(ru(o)));case 5:Fr.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Lc.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}},null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&al()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new Wr;if(Fr.setCustomerAttribute(e,t),Ds(Pe.PAYWALL_PERSONALIZATION)?(Ad.setCustomerAttribute({[e]:t}),ui.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):ui.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.`),jc.instance.flowOpen){var n=jc.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,cc)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Wr;var t=Fr.getCustomerAttribute(e);return null!=t?Ds(Pe.PAYWALL_PERSONALIZATION)?ui.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):ui.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.`):ui.warn(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Wr;return Fr.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Wr;Fr.clearCustomerAttribute(e)?(Ad.removeCustomerAttribute(e),ui.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.`)):ui.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Wr;Fr.getAllCustomerAttributesKeys().forEach(e=>{Ad.removeCustomerAttribute(e)}),Fr.clearAllCustomerAttributes(),ui.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 Wr;return Fr.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Fr.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:qe}},{key:"registerJourneyStateHandler",value:function(e){if(Cs("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(qn,e),()=>{this.instance.emitter.removeListener(qn,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 Wr,this.invokeStateHandler(Lc.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(Wu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Lc.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,r=o.v,this.invokeStateHandler(Lc.CUSTOMER_DATA_PLATFORM_ID_SET,!1,r);case 5:o.n=7;break;case 6:return ui.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Fr.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new Xr,this.invokeStateHandler(Lc.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=Ds(Pe.ANONYMOUS_MODE_CAPABILITY),t=Ds(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([ju.instance.fetchProducts(),el.instance.fetchPaywalls().then(e=>$u.instance.fetchCampaignRules(e))]));case 1:return e.a(2)}},null,this,null,Promise)}}])}();Uc.instance=new Uc;var Hc=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&&Vs(this.screens)}}])}(),Gc=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.timerStates={},u.campaign=e,u.component=n,u.context=a,u.manager=i,u.branchcrumbs=[],u.stepcrumbs=[],u.registerResolvers(a);var l=u.findStepByType(Yd);return l&&u.forward(l.id),u}return p(t,e),c(t,[{key:"registerResolvers",value:function(e){e&&new Dc(e),new xc,new $c,new Nc,new Wc(this.campaign),_c.shared.registerNamespaceResolver("Flow",e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map(e=>e.id);case"Flow.branchcrumbs":return this.branchcrumbs;default:return}})}},{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){Ud.instance.maxLogging&&ui.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:"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, exiting flow"),void this.finished();this.backToPreviousScreenStep()}else ui.debug(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{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=Gs(n.screen);return r&&we().ui.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=Ad.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}ui.warn("No previous screen step found to return to")}else ui.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}`),t.type){case Yd:case Qd:return this.stepcrumbs.push(t),void this.executeLifecycle(t,nc);case Jd:return void this.handleBranchStep(t);case qd:return void this.handleScreenStep(t);case Zd:return}else this.flowLog(`forward(${e}) — step not active (branch_tags=${JSON.stringify(t.branch_tags)}, branchcrumbs=${JSON.stringify(this.branchcrumbs)})`);else ui.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?ui.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}`),ui.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}`),ui.info(`Flow resumed from step ${e}`),this.forward(e)}else ui.warn("No step to resume from");else ui.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){var i=e.actions[t];i?(this.flowLog(`executeLifecycle(${t}) — step=${e.id}, isPaused=${this.isPaused}, ${i.length} lifecycle(s)`),this.executeFullLifecycles(i,n)):this.flowLog(`executeLifecycle(${t}) — no actions on step ${e.id}`)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;ui.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"triggerActions",value:function(e,t,n){var i,a=this.lifecycles(e);a&&(this.flowLog(`triggerActions(${e}) — step=${null===(i=this.currentFlowStep)||void 0===i?void 0:i.id}, isPaused=${this.isPaused}`),this.currentButton=t,this.executeFullLifecycles(a,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){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=h(i);!(a=r()).done;){var o;null===(o=a.value.before)||void 0===o||o.forEach(e=>this.shouldRun(e)&&this.performAction(e,n))}}}},{key:"triggerAfterActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=h(i);!(a=r()).done;){var o;null===(o=a.value.after)||void 0===o||o.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=_c.shared.evaluate(e);if(Ud.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";ui.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,r,o,s,u,l,d;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case Xd.BACK:this.back();break;case Xd.NEXT:null!==(a=e.parameters)&&void 0!==a&&a.step?this.forward(e.parameters.step):this.next();break;case Xd.NAVIGATE:var c;if(null!==(r=e.parameters)&&void 0!==r&&r.step)(null===(c=this.previousFlowStep)||void 0===c?void 0:c.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Xd.FINISHED:case Xd.DISMISS:this.finished();break;case Xd.EXIT:var h=this.steps.find(e=>e.type===Qd);h&&this.forward(h.id);break;case Xd.PAUSE:this.pause();break;case Xd.RESUME:this.resumeFromPause();break;case Xd.HANDOFF:if(null!==(o=e.parameters)&&void 0!==o&&o.handoffTag)if(this.manager.handoffStepHandler)if(e.parameters.handoffData)ui.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(e.parameters.handoffData)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,e.parameters.handoffData);else if(t)ui.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(t)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,t);else if(e.parameters.handoffFormId){var m=this.getFormData();e.parameters.handoffTag===ec?this.flowHandoffFormSequence():this.manager.handoffStepHandler(e.parameters.handoffTag,m)}else ui.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} and no data`),this.manager.handoffStepHandler(e.parameters.handoffTag);else ui.debug("No handoffStepHandler found",e);break;case Xd.LOG:var f;if(null!==(s=e.parameters)&&void 0!==s&&s.eventName)ui.info(`logEvent → ${e.parameters.eventName}`);else ui.warn(`Missing 'eventName' in logEvent action ${null!==(f=e.id)&&void 0!==f?f:"unknown"}`);break;case Xd.TRACK:var v;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)ui.info(`trackEvent → ${e.parameters.eventName}`);else ui.warn(`Missing 'eventName' in logEvent action ${null!==(v=e.id)&&void 0!==v?v:"unknown"}`);break;case Xd.SET_VIDEO:null!==(l=e.parameters)&&void 0!==l&&l.name&&e.parameters.url?Ad.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):ui.warn("Missing name, url for setting video details");break;case Xd.BLOCK_BACK:var p,g=null===(p=e.parameters)||void 0===p?void 0:p.step,y=g?this.getStep(g):void 0;y?y.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:ui.warn("Missing step for blocking back");break;case Xd.FLOW_EVENT:var b,w=new Oc(this.manager),k=Object.fromEntries(Object.entries(null!==(b=e.parameters)&&void 0!==b?b:{}).map(([e,t])=>[e,w.interpolateDeep(t)]));this.manager.eventHandler?this.manager.eventHandler(k):ui.warn("Missing event handler",k);break;case Xd.FLOW_ENABLED:Ad.setUserInteractionEnabled(!0);break;case Xd.FLOW_DISABLED:Ad.setUserInteractionEnabled(!1);break;case Xd.SET_TAGS:e.parameters&&(Ad.setUserTags(e.parameters),Object.entries(e.parameters).forEach(([e,t])=>{Uc.setCustomerAttribute(e,t)}));break;default:ui.warn(`Missing action handler for ${e.function}`,e)}else this.flowLog(`performAction(${e.function}) — SKIPPED stale step ${n}, current=${null===(d=this.currentFlowStep)||void 0===d?void 0:d.id}`)};a?setTimeout(r.bind(this,this.currentFlowStep.id),a):r(this.currentFlowStep.id)}else ui.warn("No current flow step")}},{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}ui.debug(`No active next step found after ${e.id}`)}else ui.error(`Could not find next step for step ${e.id}`)}else ui.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Gs(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"})):ui.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 ui.warn(`No actions defined for branch tag ${a}`)}}ui.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return m({},null!==(e=null===(t=Ad.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{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).sort();if(0!==n.length){var i=n.filter(e=>!0===t[e]);if(0===i.length)return ui.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:m({},t),remainingKeys:[...i]},this.resumeNextHandoff()}else ui.warn("formStates is empty, no handoffs to perform")}else ui.warn("No formStates available for handoff sequence")}},{key:"resumeNextHandoff",value:function(){var e,t,n=this.activeHandoffSequence;if(!n)return ui.warn("No active handoff sequence to resume"),void this.manager.resume();if(0===n.remainingKeys.length)return ui.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var i=n.remainingKeys.shift(),a=n.formStates[i];ui.debug(`Starting handoff for ${i} → ${String(a)}`),this.activeHandoffSequence=n;var r=`${i}`;null===(e=(t=this.manager).handoffStepHandler)||void 0===e||e.call(t,r,void 0)}}])}(Hc),Vc=function(){return c(function e(){o(this,e),this.emitter=Ou.getInstance()},[{key:"sdkInitialized",get:function(){return Ud.instance.isInitialized}},{key:"campaignTypeAndLabel",value:function(t,n){var i,a="";return t&&!n&&fu(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 Wr;return gu()}},{key:"isCampaignAvailable",value:function(e){if(!this.instance.sdkInitialized)throw new Wr;var t=this.instance.campaignTypeAndLabel(e),n=t.type,i=t.value,a=Su(i,n),r=a.campaign,o=a.paywall;return null!=r&&r.flow?new Hc(r.flow.object).allScreensAvailable:Boolean(r&&o)}},{key:"isFlow",value:function(e,t){if(!this.instance.sdkInitialized)throw new Wr;var n=this.instance.campaignTypeAndLabel(e,t),i=n.type,a=n.value;return Bs(Su(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 Wr;case 1:return xs(),e.n=2,a(Nd.instance.fetchCampaignsAndPaywalls());case 2:return e.a(2,gu())}},null,this,null,Promise)}},{key:"registerAvailableCampaignsHandler",value:function(e){return this.instance.emitter.addListener(Hn,e),()=>{this.instance.emitter.removeListener(Hn,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 Wr;var k,S=$d.firstLaunchLookup(w,()=>Su(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=Fr.getPurchaseChannel();M&&(T=m({},T,{purchaseChannel:M}));var _,A,D,x=null===(h=i)||void 0===h?void 0:h.productGroups,C=null===(f=E)||void 0===f||null===(f=f.sku_menus)||void 0===f?void 0:f.map(e=>e.ref);if((D=null===(_=Fr.getNamiConfig())||void 0===_?void 0:_.namiCommands,null!==(A=null==D?void 0:D.includes(fn))&&void 0!==A&&A&&null!=x&&x.length&&null!=C)&&0==(null==C?void 0:C.filter(e=>null==x?void 0:x.some(t=>t===e))).length)throw a(!1,e.LaunchCampaignError.PRODUCT_GROUPS_NOT_FOUND),new Ur;if(null!=P&&P.flow&&!Vs(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 Hr;var I=we().ui.createPaywall(b,w,i),L=su();return Fr.setLaunchId(L),r&&this.instance.emitter.addListener(Vn,t=>{var n=t.action,i=y(t,ge);r(m({},T,i,{action:null!=n?n:e.NamiPaywallAction.UNKNOWN}))}),setTimeout(()=>a(!0),0),I}},{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=Su(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=Su(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=Su(o,r),u=Ad.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:[]}}])}();Vc.instance=new Vc;var Kc=Vc,Xc=Uc,Yc=function(){return c(function e(){o(this,e),this.emitter=Ou.getInstance()},[{key:"sdkInitialized",get:function(){return Ud.instance.isInitialized}}],[{key:"active",value:function(){return Cs(),xd()}},{key:"isEntitlementActive",value:function(e){return!!Cs("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 Wr;case 1:if(Cs("NamiEntitlementManager.refresh")){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,a(Ld.instance.fetchActiveEntitlements());case 3:return e.a(2,xd())}},null,this,null,Promise)}},{key:"registerActiveEntitlementsHandler",value:function(e){if(Cs("NamiEntitlementManager.registerActiveEntitlementsHandler"))return this.instance.emitter.addListener(Xn,e),()=>{this.instance.emitter.removeListener(Xn,e)}}},{key:"clearProvisionalEntitlementGrants",value:function(){var e=xd();e=e.filter(e=>e.expires&&e.expires>(new Date).valueOf()),Fr.setNamiEntitlements(Mt,e),this.instance.emitter.emit(Xn)}}])}();Yc.instance=new Yc;var qc=Yc,Jc=jc,Qc=e=>{var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:if(!al()){n.n=1;break}return ui.info("Skipping transaction post - anonymous mode"),n.a(2);case 1:return n.p=1,n.n=2,a(js.instance.postConversion(e));case 2:n.n=4;break;case 3:n.p=3,t=n.v,ui.error("Error posting conversion",t);case 4:return n.a(2)}},null,null,[[1,3]],Promise)},Zc=function(){return c(function e(){o(this,e),this.emitter=Ou.getInstance()},[{key:"sdkInitialized",get:function(){return Ud.instance.isInitialized}}],[{key:"allPaywalls",value:function(){if(!this.instance.sdkInitialized)throw new Wr;return Hs()}},{key:"setProductDetails",value:function(e){this.instance.productDetails=e,Ad.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 Cs()&&ui.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){var t,n,i,r,o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:if(Ad.setPurchaseInProgress(!1),jc.instance.flowOpen&&(t=jc.instance.currentFlow,n=null==t?void 0:t.currentFlowStep,t&&n&&t.executeLifecycle(n,lc)),!Uc.inAnonymousMode()){u.n=1;break}return ui.debug("Skipping purchase validation - anonymous mode"),u.a(2);case 1:if(i=Fr.getSessionId(),r=Fr.getPurchaseImpression()){u.n=2;break}return ui.debug("Not sending paywall conversion call complete due to unknown impression"),u.a(2);case 2:return u.p=2,u.n=3,a(Qc({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,ui.error("Error posting conversion",o);case 5:if(Ds(Pe.THIRD_PARTY_TRANSACTIONS)){u.n=9;break}return u.p=6,u.n=7,a(js.instance.purchaseValidation({app_env:"production",payload:"",sku:e.skuId}));case 7:u.n=9;break;case 8:u.p=8,s=u.v,ui.error("Error validating purchase",s);case 9:return u.a(2)}},null,null,[[6,8],[2,4]],Promise)}},{key:"buySkuCancel",value:function(){Ds(Pe.THIRD_PARTY_TRANSACTIONS)?Ad.setPurchase(!1):ui.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){fu(e)?(ui.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received valid url ${e}`),Ad.setAppSuppliedVideoDetails({url:e,name:t})):ui.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received invalid url ${e}`)}},{key:"allowUserInteraction",value:function(e){ui.debug(`NamiPaywallManager: allowUserInteraction called with ${e}`),Ad.setUserInteractionEnabled(e)}}])}();Zc.instance=new Zc,Zc.emitter=Ou.getInstance();var eh,th,nh=Zc,ih=ol,ah={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},rh={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},oh="wave",sh="pulse",uh="none";function lh(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 dh(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}(lh(Ae),e)>=0||ui.warn(`Component ${t} requires SDK version ${e.semver} or higher, but current SDK version is ${Ae}`))}function ch(e){return!e||"object"==typeof e&&0==Object.keys(e).length}!function(e){e.DEFAULT="default",e.LABEL="label",e.URL="url"}(eh||(eh={})),function(e){e.DEEPLINK="deeplink",e.IN_APP="in_app"}(th||(th={})),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"));var hh=Kc,mh=Xc,fh=nh,vh=qc,ph=Jc,gh=ih,yh=zd,bh=Object.freeze({__proto__:null,NamiCampaignManager:hh,NamiCustomerManager:mh,NamiEntitlementManager:vh,NamiFlowManager:ph,NamiPaywallManager:fh,NamiProfileManager:yh,NamiPurchaseManager:gh}),wh=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 kh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sh,Eh={exports:{}};var Ph=(Sh||(Sh=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}})}(Eh)),Eh.exports),Th=kh(Ph),Mh={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},_h={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4},Ah=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:Ae,language:"en"};var t=Th.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:Ae,language:window.navigator.language};if(n.type&&(i.form_factor=Mh[n.type]),n.model&&(i.device_model=n.model),e&&e.length>0){var a=(e=>{var t=e.find(e=>e.includes(dn)),n={platform:"",version:""};if(t){var i=t.split(hn);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=Th.getParser(window.navigator.userAgent).getPlatform();return e.type&&Mh[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=_h[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:"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 Dh(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 xh,Ch,Ih,Lh=globalThis,Rh=Lh.ShadowRoot&&(void 0===Lh.ShadyCSS||Lh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fh=Symbol(),Oh=new WeakMap,$h=function(){return c(function e(t,n,i){if(o(this,e),this._$cssResult$=!0,i!==Fh)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(Rh&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Oh.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Oh.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Nh=e=>new $h("string"==typeof e?e:e+"",void 0,Fh),Wh=(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 $h(n,e,Fh)},jh=Rh?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=h(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return Nh(n)})(e):e,Bh=Object.is,zh=Object.defineProperty,Uh=Object.getOwnPropertyDescriptor,Hh=Object.getOwnPropertyNames,Gh=Object.getOwnPropertySymbols,Vh=Object.getPrototypeOf,Kh=globalThis,Xh=Kh.trustedTypes,Yh=Xh?Xh.emptyScript:"",qh=Kh.reactiveElementPolyfillSupport,Jh=(e,t)=>e,Qh={toAttribute(e,t){switch(t){case Boolean:e=e?Yh: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}},Zh=(e,t)=>!Bh(e,t),em={attribute:!0,type:String,converter:Qh,reflect:!1,useDefault:!1,hasChanged:Zh};null!==(xh=Symbol.metadata)&&void 0!==xh||(Symbol.metadata=Symbol("metadata")),null!==(Ch=Kh.litPropertyMetadata)&&void 0!==Ch||(Kh.litPropertyMetadata=new WeakMap);var tm,nm=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(Rh)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=Lh.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:Qh).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:Qh;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:Zh)(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=em){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&&zh(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Uh(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:em}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Jh("elementProperties"))){var e=Vh(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Jh("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Jh("properties")))for(var e=this.properties,t=0,n=[...Hh(e),...Gh(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(jh(a))}else void 0!==e&&t.push(jh(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}}])}(_(HTMLElement));nm.elementStyles=[],nm.shadowRootOptions={mode:"open"},nm[Jh("elementProperties")]=new Map,nm[Jh("finalized")]=new Map,null!=qh&&qh({ReactiveElement:nm}),(null!==(Ih=Kh.reactiveElementVersions)&&void 0!==Ih?Ih:Kh.reactiveElementVersions=[]).push("2.1.2");var im=globalThis,am=e=>e,rm=im.trustedTypes,om=rm?rm.createPolicy("lit-html",{createHTML:e=>e}):void 0,sm="$lit$",um=`lit$${Math.random().toFixed(9).slice(2)}$`,lm="?"+um,dm=`<${lm}>`,cm=document,hm=()=>cm.createComment(""),mm=e=>null===e||"object"!=typeof e&&"function"!=typeof e,fm=Array.isArray,vm="[ \t\n\f\r]",pm=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gm=/-->/g,ym=/>/g,bm=RegExp(`>|${vm}(?:([^\\s"'>=/]+)(${vm}*=${vm}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),wm=/'/g,km=/"/g,Sm=/^(?:script|style|textarea|title)$/i,Em=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),Pm=Em(1),Tm=Em(2),Mm=Symbol.for("lit-noChange"),_m=Symbol.for("lit-nothing"),Am=new WeakMap,Dm=cm.createTreeWalker(cm,129);function xm(e,t){if(!fm(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==om?om.createHTML(t):t}var Cm=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=pm,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===pm?"!--"===d[1]?o=gm:void 0!==d[1]?o=ym:void 0!==d[2]?(Sm.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=bm):void 0!==d[3]&&(o=bm):o===bm?">"===d[0]?(o=null!=n?n:pm,c=-1):void 0===d[1]?c=-2:(c=o.lastIndex-d[2].length,l=d[1],o=void 0===d[3]?bm:'"'===d[3]?km:wm):o===km||o===wm?o=bm:o===gm||o===ym?o=pm:(o=bm,n=void 0);var m=o===bm&&e[s+1].startsWith("/>")?" ":"";r+=o===pm?u+dm:c>=0?(a.push(l),u.slice(0,c)+sm+u.slice(c)+um+m):u+um+(-2===c?s:m)}return[xm(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),Dm.currentNode=this.el.content,2===n||3===n){var f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;null!==(a=Dm.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(sm)){var y=m[s++],b=a.getAttribute(g).split(um),w=/([.?@])?(.*)/.exec(y);l.push({type:1,index:r,name:w[2],strings:b,ctor:"."===w[1]?Om:"?"===w[1]?$m:"@"===w[1]?Nm:Fm}),a.removeAttribute(g)}else g.startsWith(um)&&(l.push({type:6,index:r}),a.removeAttribute(g))}if(Sm.test(a.tagName)){var k=a.textContent.split(um),S=k.length-1;if(S>0){a.textContent=rm?rm.emptyScript:"";for(var E=0;E<S;E++)a.append(k[E],hm()),Dm.nextNode(),l.push({type:2,index:++r});a.append(k[S],hm())}}}else if(8===a.nodeType)if(a.data===lm)l.push({type:2,index:r});else for(var P=-1;-1!==(P=a.data.indexOf(um,P+1));)l.push({type:7,index:r}),P+=um.length-1;r++}},null,[{key:"createElement",value:function(e,t){var n=cm.createElement("template");return n.innerHTML=e,n}}])}();function Im(e,t,n=e,i){var a,r,o,s,u;if(t===Mm)return t;var l=void 0!==i?null===(a=n._$Co)||void 0===a?void 0:a[i]:n._$Cl,d=mm(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=Im(e,l._$AS(e,t.values),l,i)),t}var Lm=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:cm).importNode(i,!0);Dm.currentNode=r;for(var o=Dm.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 Rm(o,o.nextSibling,this,e):1===l.type?c=new l.ctor(o,l.name,l.strings,this,e):6===l.type&&(c=new Wm(o,this,e)),this._$AV.push(c),l=a[++u]}s!==(null===(d=l)||void 0===d?void 0:d.index)&&(o=Dm.nextNode(),s++)}return Dm.currentNode=cm,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++}}}])}(),Rm=function(){return c(function e(t,n,i,a){var r;o(this,e),this.type=2,this._$AH=_m,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=Im(this,e,t),mm(e)?e===_m||null==e||""===e?(this._$AH!==_m&&this._$AR(),this._$AH=_m):e!==this._$AH&&e!==Mm&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>fm(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!==_m&&mm(this._$AH)?this._$AA.nextSibling.data=e:this.T(cm.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=Cm.createElement(xm(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 Lm(a,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}},{key:"_$AC",value:function(e){var t=Am.get(e.strings);return void 0===t&&Am.set(e.strings,t=new Cm(e)),t}},{key:"k",value:function(e){fm(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(hm()),this.O(hm()),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=am(e).nextSibling;am(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))}}])}(),Fm=function(){return c(function e(t,n,i,a,r){o(this,e),this.type=1,this._$AH=_m,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=_m},[{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=Im(this,e,t,0),(r=!mm(e)||e!==this._$AH&&e!==Mm)&&(this._$AH=e);else{var o,s,u=e;for(e=a[0],o=0;o<a.length-1;o++)(s=Im(this,u[n+o],t,o))===Mm&&(s=this._$AH[o]),r||(r=!mm(s)||s!==this._$AH[o]),s===_m?e=_m:e!==_m&&(e+=(null!=s?s:"")+a[o+1]),this._$AH[o]=s}r&&!i&&this.j(e)}},{key:"j",value:function(e){e===_m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}])}(),Om=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===_m?void 0:e}}])}(Fm),$m=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!==_m)}}])}(Fm),Nm=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=Im(this,e,t,0))&&void 0!==n?n:_m)!==Mm){var i=this._$AH,a=e===_m&&i!==_m||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==_m&&(i===_m||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)}}])}(Fm),Wm=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){Im(this,e)}}])}(),jm={I:Rm},Bm=im.litHtmlPolyfillSupport;null!=Bm&&Bm(Cm,Rm),(null!==(tm=im.litHtmlVersions)&&void 0!==tm?tm:im.litHtmlVersions=[]).push("3.3.3");var zm,Um,Hm=globalThis,Gm=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(t,"createRenderRoot",this,3)([]);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(t,"update",this,3)([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 Rm(t.insertBefore(hm(),s),s,void 0,null!=n?n:{})}return r._$AI(e),r})(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;T(t,"connectedCallback",this,3)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;T(t,"disconnectedCallback",this,3)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Mm}}])}(nm);Gm._$litElement$=!0,Gm.finalized=!0,null===(zm=Hm.litElementHydrateSupport)||void 0===zm||zm.call(Hm,{LitElement:Gm});var Vm=Hm.litElementPolyfillSupport;null==Vm||Vm({LitElement:Gm}),(null!==(Um=Hm.litElementVersions)&&void 0!==Um?Um:Hm.litElementVersions=[]).push("4.2.2");var Km,Xm,Ym=Wh(Km||(Km=(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,M(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 T(e,t,n,i){var a=f(v(e.prototype),t,n);return 2&i&&"function"==typeof a?function(e){return a.apply(n,e)}:a}function M(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function _(e){var t="function"==typeof Map?new Map:void 0;return _=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(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)},_(e)}var A,D,x,C,I,L,R,F,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),R.set(this,void 0),F.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,R,`${t}`,"f"),B(this,F,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,F,"f")}},{key:"currentTarget",get:function(){return z(this,F,"f")}},{key:"srcElement",get:function(){return z(this,F,"f")}},{key:"type",get:function(){return z(this,R,"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,F,"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,R=new WeakMap,F=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,X,Y,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!==(X=globalThis.CustomEvent)&&void 0!==X||(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,T=h(E);!(P=T()).done;){var M=P.value;r||o&&M!==o.__host||p(E.slice(0,E.indexOf(M)+1)),s=M,a=M===e.target?q.AT_TARGET:q.BUBBLING_PHASE;var _=M.__eventListeners.get(e.type);if(_)for(var A,D=h(_);!(A=D()).done;){var x=A.value;if(d(x[0],x[1],_),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!==(Y=globalThis.litServerRoot)&&void 0!==Y||(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;!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 Te,Me={},_e=Me.NAMI_SDK_VERSION,Ae=void 0===_e?"3.4.3":_e,De=Me.NAMI_SDK_PACKAGE_VERSION,xe=void 0===De?"3.4.3-dev.202606121440":De,Ce=Me.PLATFORM_ID_REQUIRED,Ie=void 0===Ce?"Platform ID is required":Ce,Le=Me.DEVICE_ID_REQUIRED,Re=void 0===Le?"Device ID is required":Le,Fe=Me.EXTERNAL_ID_REQUIRED,Oe=void 0===Fe?"External ID is required":Fe,$e=Me.SDK_NOT_INITIALIZED,Ne=void 0===$e?"SDK has not been initialized. Make sure to call Nami.configure() first!":$e,We=Me.CAMPAIGN_NOT_AVAILABLE,je=void 0===We?"Campaign is not available":We,Be=Me.FLOW_SCREENS_NOT_AVAILABLE,ze=void 0===Be?"Flow screens not available":Be,Ue=Me.UNABLE_TO_UPDATE_CDP_ID,He=void 0===Ue?"Unable to update CDP id in anonymous mode":Ue,Ge=Me.ANONYMOUS_MODE_ALREADY_ON,Ve=void 0===Ge?"Anonymous mode is already turned on.":Ge,Ke=Me.ANONYMOUS_MODE_ALREADY_OFF,Xe=void 0===Ke?"Anonymous mode is already turned off.":Ke,Ye=Me.DEVICE_ID_NOT_SET,qe=void 0===Ye?"Nami Device ID is not set":Ye,Je=Me.AUTH_DEVICE,Qe=void 0===Je?"nami_auth_device":Je,Ze=Me.NAMI_CONFIGURATION,et=void 0===Ze?"nami_configuration":Ze,tt=Me.NAMI_PROFILE,nt=void 0===tt?"nami_profile":tt,it=Me.API_CONFIG,at=void 0===it?"api_config":it,rt=Me.API_CAMPAIGN_RULES,ot=void 0===rt?"api_campaign_rules":rt,st=Me.API_PAYWALLS,ut=void 0===st?"api_paywalls":st,lt=Me.API_CAMPAIGN_SESSION_TIMESTAMP,dt=void 0===lt?"api_campaign_session_timestamp":lt,ct=Me.API_PRODUCTS,ht=void 0===ct?"api_products":ct,mt=Me.API_ACTIVE_ENTITLEMENTS,ft=void 0===mt?"api_active_entitlements":mt,vt=Me.SERVER_NAMI_ENTITLEMENTS,pt=void 0===vt?"server_active_entitlements":vt,gt=Me.INITIAL_APP_CONFIG,yt=void 0===gt?"initial_app_config":gt,bt=Me.INITIAL_CAMPAIGN_RULES,wt=void 0===bt?"initial_campaign_rules":bt,kt=Me.INITIAL_PAYWALLS,St=void 0===kt?"initial_paywalls":kt,Et=Me.INITIAL_PRODUCTS,Pt=void 0===Et?"initial_products":Et,Tt=Me.LOCAL_NAMI_ENTITLEMENTS,Mt=void 0===Tt?"local_active_entitlements":Tt,_t=Me.CUSTOMER_ATTRIBUTES_KEY_PREFIX,At=void 0===_t?"nami_cmr_attributes_":_t,Dt=Me.NAMI_CUSTOMER_JOURNEY_STATE,xt=void 0===Dt?"nami_customer_journey_state":Dt,Ct=Me.ANONYMOUS_MODE,It=void 0===Ct?"nami_anonymous_mode_v2":Ct,Lt=Me.ANONYMOUS_UUID,Rt=void 0===Lt?"nami_anonymous_uuid":Lt,Ft=Me.KEY_SESSION_COUNTER,Ot=void 0===Ft?"nami_session_counter":Ft,$t=Me.INITIAL_SESSION_COUNTER_VALUE,Nt=void 0===$t?1:$t,Wt=Me.NAMI_LAST_IMPRESSION_ID,jt=void 0===Wt?"nami_last_impression_id":Wt,Bt=Me.NAMI_PURCHASE_IMPRESSION_ID,zt=void 0===Bt?"nami_purchase_impression_id":Bt,Ut=Me.NAMI_LAUNCH_ID,Ht=void 0===Ut?"nami_launch_id":Ut,Gt=Me.NAMI_SESSION_ID,Vt=void 0===Gt?"nami_session_id":Gt,Kt=Me.NAMI_LANGUAGE_CODE,Xt=void 0===Kt?"nami_language_code":Kt,Yt=Me.NAMI_PURCHASE_CHANNEL,qt=void 0===Yt?"nami_purchase_channel":Yt,Jt=Me.API_VERSION,Qt=Me.BASE_URL_PATH,Zt=void 0===Qt?`sdk/${void 0===Jt?"v3":Jt}/platform`:Qt,en=Me.BASE_URL,tn=void 0===en?"https://app.namiml.com":en,nn=Me.BASE_STAGING_URL,an=void 0===nn?"https://app-staging.namiml.com":nn,rn=Me.CUSTOM_HOST_PREFIX,on=void 0===rn?"namiAPIHost=":rn,sn=Me.USE_STAGING_API,un=void 0===sn?"useStagingAPI":sn,ln=Me.EXTENDED_CLIENT_INFO_PREFIX,dn=void 0===ln?"extendedClientInfo":ln,cn=Me.EXTENDED_CLIENT_INFO_DELIMITER,hn=void 0===cn?":":cn,mn=Me.VALIDATE_PRODUCT_GROUPS,fn=void 0===mn?"validateProductGroups":mn,vn=Me.LOG_HTTP_REQUESTS,pn=void 0===vn?"logHTTPRequests":vn,gn=Me.LOG_HTTP_TRAFFIC,yn=void 0===gn?"logHTTPTraffic":gn,bn=Me.STARTUP_TELEMETRY,wn=void 0===bn?"startupTelemetry":bn,kn=Me.API_MAX_CALLS_LIMIT,Sn=void 0===kn?2:kn,En=Me.API_RETRY_DELAY_SEC,Pn=void 0===En?2:En,Tn=Me.API_TIMEOUT_LIMIT,Mn=void 0===Tn?2e4:Tn,_n=Me.DEVICE_API_TIMEOUT_LIMIT,An=void 0===_n?2e3:_n,Dn=Me.STATUS_BAD_REQUEST,xn=void 0===Dn?400:Dn,Cn=Me.STATUS_NOT_FOUND,In=void 0===Cn?404:Cn,Ln=Me.STATUS_CONFLICT,Rn=void 0===Ln?409:Ln,Fn=Me.STATUS_INTERNAL_SERVER_ERROR,On=void 0===Fn?500:Fn,$n=Me.INITIAL_SUCCESS,Nn=void 0===$n?"Initial success":$n,Wn=Me.RECONFIG_SUCCESS,jn=void 0===Wn?"Reconfig success":Wn,Bn=Me.ALREADY_CONFIGURED,zn=void 0===Bn?"Already configured":Bn,Un=Me.AVAILABLE_CAMPAIGNS_CHANGED,Hn=void 0===Un?"AvailableCampaignsChanged":Un,Gn=Me.PAYWALL_ACTION_EVENT,Vn=void 0===Gn?"PaywallActionEvent":Gn,Kn=Me.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,Xn=void 0===Kn?"AvailableActiveEntitlementsChanged":Kn,Yn=Me.CUSTOMER_JOURNEY_STATE_CHANGED,qn=void 0===Yn?"CustomerJourneyStateChanged":Yn,Jn=Me.SKU_TEXT_REGEX,Qn=void 0===Jn?/\$\{sku\.(\w+)(:\d+)?\}/g:Jn,Zn=Me.VAR_REGEX,ei=void 0===Zn?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:Zn,ti=Me.SMART_TEXT_PATTERN,ni=void 0===ti?"${":ti,ii=Me.LIQUID_VARIABLE_REGEX,ai=void 0===ii?/\${[A-Za-z0-9.]+}/g:ii,ri=[Qe,et,nt,at,ot,ut,dt,ht,ft,pt,yt,wt,St,Pt,Mt,xt,It,Rt,Ot,jt,zt,Ht,Vt,Xt,qt];e.LogLevel=void 0,(Te=e.LogLevel||(e.LogLevel={}))[Te.DEBUG=1]="DEBUG",Te[Te.INFO=2]="INFO",Te[Te.WARN=3]="WARN",Te[Te.ERROR=4]="ERROR";var oi={debug:e.LogLevel.DEBUG,info:e.LogLevel.INFO,warn:e.LogLevel.WARN,error:e.LogLevel.ERROR},si=function(){return c(function t(){o(this,t),this.currentLogLevel=e.LogLevel.DEBUG,this.setLogger=t=>{this.currentLogLevel=t?oi[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)}`}}])}(),ui=new si;function li(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 di(e,t){return e===t||e!=e&&t!=t}function ci(e,t){for(var n=e.length;n--;)if(di(e[n][0],t))return n;return-1}var hi=Array.prototype.splice;function mi(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])}}mi.prototype.clear=function(){this.__data__=[],this.size=0},mi.prototype.delete=function(e){var t=this.__data__,n=ci(t,e);return!(n<0)&&(n==t.length-1?t.pop():hi.call(t,n,1),--this.size,!0)},mi.prototype.get=function(e){var t=this.__data__,n=ci(t,e);return n<0?void 0:t[n][1]},mi.prototype.has=function(e){return ci(this.__data__,e)>-1},mi.prototype.set=function(e,t){var n=this.__data__,i=ci(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var fi="object"==typeof global&&global&&global.Object===Object&&global,vi="object"==typeof self&&self&&self.Object===Object&&self,pi=fi||vi||Function("return this")(),gi=pi.Symbol,yi=Object.prototype,bi=yi.hasOwnProperty,wi=yi.toString,ki=gi?gi.toStringTag:void 0;var Si=Object.prototype.toString;var Ei=gi?gi.toStringTag:void 0;function Pi(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ei&&Ei in Object(e)?function(e){var t=bi.call(e,ki),n=e[ki];try{e[ki]=void 0;var i=!0}catch(e){}var a=wi.call(e);return i&&(t?e[ki]=n:delete e[ki]),a}(e):function(e){return Si.call(e)}(e)}function Ti(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Mi(e){if(!Ti(e))return!1;var t=Pi(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var _i,Ai=pi["__core-js_shared__"],Di=(_i=/[^.]+$/.exec(Ai&&Ai.keys&&Ai.keys.IE_PROTO||""))?"Symbol(src)_1."+_i:"";var xi=Function.prototype.toString;function Ci(e){if(null!=e){try{return xi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Ii=/^\[object .+?Constructor\]$/,Li=Function.prototype,Ri=Object.prototype,Fi=Li.toString,Oi=Ri.hasOwnProperty,$i=RegExp("^"+Fi.call(Oi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ni(e){return!(!Ti(e)||(t=e,Di&&Di in t))&&(Mi(e)?$i:Ii).test(Ci(e));var t}function Wi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ni(n)?n:void 0}var ji=Wi(pi,"Map"),Bi=Wi(Object,"create");var zi=Object.prototype.hasOwnProperty;var Ui=Object.prototype.hasOwnProperty;function Hi(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 Gi(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 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])}}Hi.prototype.clear=function(){this.__data__=Bi?Bi(null):{},this.size=0},Hi.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hi.prototype.get=function(e){var t=this.__data__;if(Bi){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return zi.call(t,e)?t[e]:void 0},Hi.prototype.has=function(e){var t=this.__data__;return Bi?void 0!==t[e]:Ui.call(t,e)},Hi.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Bi&&void 0===t?"__lodash_hash_undefined__":t,this},Vi.prototype.clear=function(){this.size=0,this.__data__={hash:new Hi,map:new(ji||mi),string:new Hi}},Vi.prototype.delete=function(e){var t=Gi(this,e).delete(e);return this.size-=t?1:0,t},Vi.prototype.get=function(e){return Gi(this,e).get(e)},Vi.prototype.has=function(e){return Gi(this,e).has(e)},Vi.prototype.set=function(e,t){var n=Gi(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Ki(e){var t=this.__data__=new mi(e);this.size=t.size}Ki.prototype.clear=function(){this.__data__=new mi,this.size=0},Ki.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ki.prototype.get=function(e){return this.__data__.get(e)},Ki.prototype.has=function(e){return this.__data__.has(e)},Ki.prototype.set=function(e,t){var n=this.__data__;if(n instanceof mi){var i=n.__data__;if(!ji||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Vi(i)}return n.set(e,t),this.size=n.size,this};function Xi(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Vi;++t<n;)this.add(e[t])}function Yi(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 qi(e,t){return e.has(t)}Xi.prototype.add=Xi.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Xi.prototype.has=function(e){return this.__data__.has(e)};function Ji(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 Xi: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(!Yi(t,function(e,t){if(!qi(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 Qi=pi.Uint8Array;function Zi(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function ea(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var ta=gi?gi.prototype:void 0,na=ta?ta.valueOf:void 0;var ia=Array.isArray;var aa=Object.prototype.propertyIsEnumerable,ra=Object.getOwnPropertySymbols,oa=ra?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,i=null==e?0:e.length,a=0,r=[];++n<i;){var o=e[n];t(o,n,e)&&(r[a++]=o)}return r}(ra(e),function(t){return aa.call(e,t)}))}:function(){return[]};function sa(e){return null!=e&&"object"==typeof e}function ua(e){return sa(e)&&"[object Arguments]"==Pi(e)}var la=Object.prototype,da=la.hasOwnProperty,ca=la.propertyIsEnumerable,ha=ua(function(){return arguments}())?ua:function(e){return sa(e)&&da.call(e,"callee")&&!ca.call(e,"callee")};var ma="object"==typeof e&&e&&!e.nodeType&&e,fa=ma&&"object"==typeof module&&module&&!module.nodeType&&module,va=fa&&fa.exports===ma?pi.Buffer:void 0,pa=(va?va.isBuffer:void 0)||function(){return!1},ga=/^(?:0|[1-9]\d*)$/;function ya(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&ga.test(e))&&e>-1&&e%1==0&&e<t}function ba(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var wa={};function ka(e){return function(t){return e(t)}}wa["[object Float32Array]"]=wa["[object Float64Array]"]=wa["[object Int8Array]"]=wa["[object Int16Array]"]=wa["[object Int32Array]"]=wa["[object Uint8Array]"]=wa["[object Uint8ClampedArray]"]=wa["[object Uint16Array]"]=wa["[object Uint32Array]"]=!0,wa["[object Arguments]"]=wa["[object Array]"]=wa["[object ArrayBuffer]"]=wa["[object Boolean]"]=wa["[object DataView]"]=wa["[object Date]"]=wa["[object Error]"]=wa["[object Function]"]=wa["[object Map]"]=wa["[object Number]"]=wa["[object Object]"]=wa["[object RegExp]"]=wa["[object Set]"]=wa["[object String]"]=wa["[object WeakMap]"]=!1;var Sa="object"==typeof e&&e&&!e.nodeType&&e,Ea=Sa&&"object"==typeof module&&module&&!module.nodeType&&module,Pa=Ea&&Ea.exports===Sa&&fi.process,Ta=function(){try{var e=Ea&&Ea.require&&Ea.require("util").types;return e||Pa&&Pa.binding&&Pa.binding("util")}catch(e){}}(),Ma=Ta&&Ta.isTypedArray,_a=Ma?ka(Ma):function(e){return sa(e)&&ba(e.length)&&!!wa[Pi(e)]},Aa=Object.prototype.hasOwnProperty;function Da(e,t){var n=ia(e),i=!n&&ha(e),a=!n&&!i&&pa(e),r=!n&&!i&&!a&&_a(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)!Aa.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ya(l,u))||s.push(l);return s}var xa=Object.prototype;function Ca(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||xa)}function Ia(e,t){return function(n){return e(t(n))}}var La=Ia(Object.keys,Object),Ra=Object.prototype.hasOwnProperty;function Fa(e){return null!=(t=e)&&ba(t.length)&&!Mi(t)?Da(e):function(e){if(!Ca(e))return La(e);var t=[];for(var n in Object(e))Ra.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}function Oa(e){return function(e,t,n){var i=t(e);return ia(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,Fa,oa)}var $a=Object.prototype.hasOwnProperty;var Na=Wi(pi,"DataView"),Wa=Wi(pi,"Promise"),ja=Wi(pi,"Set"),Ba=Wi(pi,"WeakMap"),za="[object Map]",Ua="[object Promise]",Ha="[object Set]",Ga="[object WeakMap]",Va="[object DataView]",Ka=Ci(Na),Xa=Ci(ji),Ya=Ci(Wa),qa=Ci(ja),Ja=Ci(Ba),Qa=Pi;(Na&&Qa(new Na(new ArrayBuffer(1)))!=Va||ji&&Qa(new ji)!=za||Wa&&Qa(Wa.resolve())!=Ua||ja&&Qa(new ja)!=Ha||Ba&&Qa(new Ba)!=Ga)&&(Qa=function(e){var t=Pi(e),n="[object Object]"==t?e.constructor:void 0,i=n?Ci(n):"";if(i)switch(i){case Ka:return Va;case Xa:return za;case Ya:return Ua;case qa:return Ha;case Ja:return Ga}return t});var Za="[object Arguments]",er="[object Array]",tr="[object Object]",nr=Object.prototype.hasOwnProperty;function ir(e,t,n,i,a,r){var o=ia(e),s=ia(t),u=o?er:Qa(e),l=s?er:Qa(t),d=(u=u==Za?tr:u)==tr,c=(l=l==Za?tr:l)==tr,h=u==l;if(h&&pa(e)){if(!pa(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new Ki),o||_a(e)?Ji(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 Qi(e),new Qi(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return di(+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=Zi;case"[object Set]":var u=1&i;if(s||(s=ea),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=Ji(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(na)return na.call(e)==na.call(t)}return!1}(e,t,u,n,i,a,r);if(!(1&n)){var m=d&&nr.call(e,"__wrapped__"),f=c&&nr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new Ki),a(v,p,n,i,r)}}return!!h&&(r||(r=new Ki),function(e,t,n,i,a,r){var o=1&n,s=Oa(e),u=s.length;if(u!=Oa(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:$a.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 ar(e,t,n,i,a){return e===t||(null==e||null==t||!sa(e)&&!sa(t)?e!=e&&t!=t:ir(e,t,n,i,ar,a))}function rr(e){return e==e&&!Ti(e)}function or(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function sr(e){var t=function(e){for(var t=Fa(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,rr(a)]}return t}(e);return 1==t.length&&t[0][2]?or(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(!ar(l,u,3,i,new Ki))return!1}return!0}(n,0,t)}}function ur(e){return"symbol"==typeof e||sa(e)&&"[object Symbol]"==Pi(e)}var lr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dr=/^\w*$/;function cr(e,t){if(ia(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ur(e))||(dr.test(e)||!lr.test(e)||null!=t&&e in Object(t))}function hr(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(hr.Cache||Vi),n}hr.Cache=Vi;var mr,fr,vr,pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gr=/\\(\\)?/g,yr=(mr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(pr,function(e,n,i,a){t.push(i?a.replace(gr,"$1"):n||e)}),t},fr=hr(mr,function(e){return 500===vr.size&&vr.clear(),e}),vr=fr.cache,fr);var br=gi?gi.prototype:void 0,wr=br?br.toString:void 0;function kr(e){if("string"==typeof e)return e;if(ia(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,kr)+"";if(ur(e))return wr?wr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Sr(e,t){return ia(e)?e:cr(e,t)?[e]:yr(function(e){return null==e?"":kr(e)}(e))}function Er(e){if("string"==typeof e||ur(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Pr(e,t){for(var n=0,i=(t=Sr(t,e)).length;null!=e&&n<i;)e=e[Er(t[n++])];return n&&n==i?e:void 0}function Tr(e,t){return null!=e&&t in Object(e)}function Mr(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=Sr(t,e)).length,r=!1;++i<a;){var o=Er(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&ba(a)&&ya(o,a)&&(ia(e)||ha(e))}(e,t,Tr)}function _r(e,t){return cr(e)&&rr(t)?or(Er(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:Pr(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?Mr(n,e):ar(t,i,3)}}function Ar(e){return e}function Dr(e){return cr(e)?(t=Er(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Pr(t,e)}}(e);var t}function xr(e){return e!=e}function Cr(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,xr,n)}(e,t,0)>-1}var Ir=ja&&1/ea(new ja([,-0]))[1]==1/0?function(e){return new ja(e)}:function(){};function Lr(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Cr,r=e.length,o=!0,s=[],u=s;if(r>=200){var l=t?null:Ir(e);if(l)return ea(l);o=!1,a=qi,u=new Xi}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?Ar:"object"==typeof n?ia(n)?_r(n[0],n[1]):sr(n):Dr(n)):[];var n}var Rr=function(){return c(function e(){o(this,e),this.memoryStore={}},[{key:"storage",get:function(){return we().storage}},{key:"setDevice",value:function(e){this.setItem(Qe,e)}},{key:"getDevice",value:function(){return this.getItem(Qe)}},{key:"resetDevice",value:function(){this.resetItem(Qe)}},{key:"getAnonymousMode",value:function(){return this.getItem(It)||!1}},{key:"setAnonymousMode",value:function(e){this.setItem(It,e)}},{key:"clearAnonymousMode",value:function(){this.resetItem(It)}},{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(Xt,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(Xt)||"en"}},{key:"setCampaignRules",value:function(e,t){e!==wt?e!==ot||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[ot]=JSON.stringify(t):this.memoryStore[wt]=JSON.stringify(t)}},{key:"getCampaignRules",value:function(e){if(e===wt)return this.memoryStore[wt]?JSON.parse(this.memoryStore[wt]):null;if(e===ot){var t=this.memoryStore[ot];if(null!=t)return JSON.parse(t);var n=this.getItem(ot);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!==St?e!==ut||0!==this.getCampaignCacheTtl()?this.setItem(e,t):this.memoryStore[ut]=JSON.stringify(t):this.memoryStore[St]=JSON.stringify(t)}},{key:"getPaywalls",value:function(e){if(e===St)return this.memoryStore[St]?JSON.parse(this.memoryStore[St]):null;if(e===ut){var t=this.memoryStore[ut];if(null!=t)return JSON.parse(t);var n=this.getItem(ut);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:"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(ht))&&void 0!==e?e:[];return Lr(li([...null!==(t=this.getItem(Pt))&&void 0!==t?t:[],...n]),"sku_ref_id")}},{key:"setNamiConfig",value:function(e){this.setItem(et,e)}},{key:"getNamiConfig",value:function(){return this.getItem(et)}},{key:"setCustomerAttribute",value:function(e,t){this.setItem(At+e,t)}},{key:"getCustomerAttribute",value:function(e){return this.getItem(At+e)}},{key:"getAllCustomerAttributes",value:function(){return this.storage.getAllKeys().map(e=>[e,this.storage.getItem(e)]).filter(([e])=>e.includes(At)).map(([e,t])=>e.replace(At,"")+":"+t)}},{key:"getAllCustomerAttributesKeys",value:function(){return this.storage.getAllKeys().filter(e=>e.includes(At)).map(e=>e.replace(At,""))}},{key:"clearCustomerAttribute",value:function(e){var t=At+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}},{key:"clearAllCustomerAttributes",value:function(){this.storage.getAllKeys().filter(e=>e.includes(At)).map(e=>this.resetItem(e))}},{key:"setNamiProfile",value:function(e){this.setItem(nt,e)}},{key:"getNamiProfile",value:function(){return this.getItem(nt)}},{key:"removeNamiProfile",value:function(){this.resetItem(nt)}},{key:"setCustomerJourneyState",value:function(e){this.setItem(xt,e)}},{key:"getCustomerJourneyState",value:function(){return this.getItem(xt)}},{key:"setSessionCounter",value:function(){var e=this.getItem(Ot),t=e?parseInt(e):Nt||Nt;this.setItem(Ot,t+1)}},{key:"getSessionCounter",value:function(){var e=this.getItem(Ot);return e?parseInt(e):Nt}},{key:"setLastImpressionId",value:function(e){this.setItem(jt,e)}},{key:"getLastImpressionId",value:function(){var e;return null!==(e=this.getItem(jt))&&void 0!==e?e:""}},{key:"setPurchaseImpression",value:function(){var e,t=null!==(e=this.getLastImpressionId())&&void 0!==e?e:"";this.setItem(zt,t)}},{key:"getPurchaseImpression",value:function(){var e;return null!==(e=this.getItem(zt))&&void 0!==e?e:""}},{key:"setSessionId",value:function(e){e&&this.setItem(Vt,e)}},{key:"getSessionId",value:function(){var e;return null!==(e=this.getItem(Vt))&&void 0!==e?e:""}},{key:"clearSessionId",value:function(){this.resetItem(Vt)}},{key:"setLaunchId",value:function(e){e&&this.setItem(Ht,e)}},{key:"getLaunchId",value:function(){var e;return null!==(e=this.getItem(Ht))&&void 0!==e?e:""}},{key:"clearLaunchId",value:function(){this.resetItem(Ht)}},{key:"setPurchaseChannel",value:function(e){e&&this.setItem(qt,e)}},{key:"getPurchaseChannel",value:function(){return this.getItem(qt)}},{key:"getAnonymousUUID",value:function(){return this.getItem(Rt)}},{key:"setAnonymousUUID",value:function(e){this.setItem(Rt,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(Rt)}},{key:"setApiCampaignSessionTimestamp",value:function(){this.setItem(dt,Date.now())}},{key:"getApiCampaignSessionTimestamp",value:function(){return this.getItem(dt)}},{key:"purgeApiCampaignCache",value:function(){this.resetItem(ut),this.resetItem(ot),this.resetItem(dt)}},{key:"getCampaignCacheTtl",value:function(){var e,t=this.getAppConfig(at)||this.getAppConfig(yt);return null!==(e=null==t?void 0:t.campaign_cache_ttl)&&void 0!==e?e: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 ui.error(`Serialization failed for ${e}`,t)}try{this.storage.setItem(e,n)}catch(t){ui.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){ui.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){ui.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clearAll",value:function(){ri.forEach(e=>this.resetItem(e)),this.clearAllCustomerAttributes(),this.memoryStore={}}},{key:"clear",value:function(){try{this.storage.clear()}catch(e){ui.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}(),Fr=new Rr,Or=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)}(_(Error)),$r=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(_(Error)),Nr=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)}($r),Wr=function(e){function t(){return o(this,t),r(this,t,[Ne])}return p(t,e),c(t)}(_(Error)),jr=function(e){function t(){return o(this,t),r(this,t,[Ie])}return p(t,e),c(t)}(_(Error)),Br=function(e){function t(){return o(this,t),r(this,t,[Re])}return p(t,e),c(t)}(_(Error)),zr=function(e){function t(){return o(this,t),r(this,t,[Oe])}return p(t,e),c(t)}(_(Error)),Ur=function(e){function t(){return o(this,t),r(this,t,[je])}return p(t,e),c(t)}(_(Error)),Hr=function(e){function t(){return o(this,t),r(this,t,[ze])}return p(t,e),c(t)}(_(Error)),Gr=function(e){function t(){return o(this,t),r(this,t,[Ve])}return p(t,e),c(t)}(_(Error)),Vr=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(_(Error)),Kr=function(e){function t(){return o(this,t),r(this,t,[Xe])}return p(t,e),c(t)}(_(Error)),Xr=function(e){function t(){return o(this,t),r(this,t,[He])}return p(t,e),c(t)}(_(Error)),Yr=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)}($r),qr=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)}($r),Jr=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)}($r),Qr=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)}($r),Zr=(e,t)=>{if(e==xn)throw new Yr(t);if(e==In)throw new qr(t);if(e==Rn)throw new Nr;if(e>xn&&e<On)throw new Jr(e,t);if(e>=On)throw new Qr(t)};function eo(e){for(var t=e.length;--t>=0;)e[t]=0}eo(new Array(576)),eo(new Array(60)),eo(new Array(512)),eo(new Array(256)),eo(new Array(29)),eo(new Array(30));var to=(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},no=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})()),io=(e,t,n,i)=>{var a=no,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^e},ao={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"},ro=0,oo=4,so=5,uo=6,lo=0,co=1,ho=2,mo=-2,fo=-3,vo=-4,po=-5,go=8,yo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),bo=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)yo(n,i)&&(e[i]=n[i])}}return e},wo=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},ko=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){ko=!1}for(var So=new Uint8Array(256),Eo=0;Eo<256;Eo++)So[Eo]=Eo>=252?6:Eo>=248?5:Eo>=240?4:Eo>=224?3:Eo>=192?2:1;So[254]=So[254]=1;var Po=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},To=(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=So[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&&ko)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)},Mo=(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+So[e[n]]>t?n:t};var _o=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},Ao=16209,Do=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,M=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,T=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=M.dmax,u=M.wsize,l=M.whave,d=M.wnext,c=M.window,h=M.hold,m=M.bits,f=M.lencode,v=M.distcode,p=(1<<M.lenbits)-1,g=(1<<M.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))T[a++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){M.mode=16191;break e}e.msg="invalid literal/length code",M.mode=Ao;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",M.mode=Ao;break e}if(h>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>l&&M.sane){e.msg="invalid distance too far back",M.mode=Ao;break e}if(S=0,E=c,0===d){if(S+=u-b,b<w){w-=b;do{T[a++]=c[S++]}while(--b);S=a-k,E=T}}else if(d<b){if(S+=u+d-b,(b-=d)<w){w-=b;do{T[a++]=c[S++]}while(--b);if(S=0,d<w){w-=b=d;do{T[a++]=c[S++]}while(--b);S=a-k,E=T}}}else if(S+=d-b,b<w){w-=b;do{T[a++]=c[S++]}while(--b);S=a-k,E=T}for(;w>2;)T[a++]=E[S++],T[a++]=E[S++],T[a++]=E[S++],w-=3;w&&(T[a++]=E[S++],w>1&&(T[a++]=E[S++]))}else{S=a-k;do{T[a++]=T[S++],T[a++]=T[S++],T[a++]=T[S++],w-=3}while(w>2);w&&(T[a++]=T[S++],w>1&&(T[a++]=T[S++]))}break}if(64&b){e.msg="invalid distance code",M.mode=Ao;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),M.hold=h,M.bits=m},xo=15,Co=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]),Io=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]),Lo=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]),Ro=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]),Fo=(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,T=0,M=0,_=0,A=null,D=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=xo;y++)D[y]=0;for(b=0;b<i;b++)D[t[n+b]]++;for(S=g,k=xo;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),T=1,y=1;y<=xo;y++)if(T<<=1,(T-=D[y])<0)return-1;if(T>0&&(0===e||1!==k))return-1;for(x[1]=0,y=1;y<xo;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=Co,C=Io,m=257):(A=Lo,C=Ro,m=0),_=0,b=0,y=w,h=r,E=S,P=0,d=-1,c=(M=1<<S)-1,1===e&&M>852||2===e&&M>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+(_>>P)+(l-=u)]=f<<24|v<<16|p}while(0!==l);for(u=1<<y-1;_&u;)u>>=1;if(0!==u?(_&=u-1,_+=u):_=0,b++,0===--D[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(_&c)!==d){for(0===P&&(P=S),h+=w,T=1<<(E=y-P);E+P<k&&!((T-=D[E+P])<=0);)E++,T<<=1;if(M+=1<<E,1===e&&M>852||2===e&&M>592)return 1;a[d=_&c]=S<<24|E<<16|h-r}}return 0!==_&&(a[h+_]=y-P<<24|64<<16),s.bits=S,0},Oo=oo,$o=so,No=uo,Wo=lo,jo=co,Bo=ho,zo=mo,Uo=fo,Ho=vo,Go=po,Vo=go,Ko=16180,Xo=16190,Yo=16191,qo=16192,Jo=16194,Qo=16199,Zo=16200,es=16206,ts=16209,ns=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function is(){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 as,rs,os=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<Ko||t.mode>16211?1:0},ss=e=>{if(os(e))return zo;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=Ko,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,Wo},us=e=>{if(os(e))return zo;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ss(e)},ls=(e,t)=>{var n;if(os(e))return zo;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?zo:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,us(e))},ds=(e,t)=>{if(!e)return zo;var n=new is;e.state=n,n.strm=e,n.window=null,n.mode=Ko;var i=ls(e,t);return i!==Wo&&(e.state=null),i},cs=!0,hs=e=>{if(cs){as=new Int32Array(512),rs=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(Fo(1,e.lens,0,288,as,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Fo(2,e.lens,0,32,rs,0,e.work,{bits:5}),cs=!1}e.lencode=as,e.lenbits=9,e.distcode=rs,e.distbits=5},ms=(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},fs=(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,M=0,_=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(os(e)||!e.output||!e.input&&0!==e.avail_in)return zo;(n=e.state).mode===Yo&&(n.mode=qo),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=Wo;e:for(;;)switch(n.mode){case Ko:if(0===n.wrap){n.mode=qo;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,_[0]=255&l,_[1]=l>>>8&255,n.check=io(n.check,_,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=ts;break}if((15&l)!==Vo){e.msg="unknown compression method",n.mode=ts;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=ts;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:Yo,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)!==Vo){e.msg="unknown compression method",n.mode=ts;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=ts;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(_[0]=255&l,_[1]=l>>>8&255,n.check=io(n.check,_,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&&(_[0]=255&l,_[1]=l>>>8&255,_[2]=l>>>16&255,_[3]=l>>>24&255,n.check=io(n.check,_,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&&(_[0]=255&l,_[1]=l>>>8&255,n.check=io(n.check,_,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&&(_[0]=255&l,_[1]=l>>>8&255,n.check=io(n.check,_,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=io(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=io(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=io(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=ts;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=Yo;break;case 16189:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}e.adler=n.check=ns(l),l=0,d=0,n.mode=Xo;case Xo: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,Bo;e.adler=n.check=1,n.mode=Yo;case Yo:if(t===$o||t===No)break e;case qo:if(n.last){l>>>=7&d,d-=7&d,n.mode=es;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(hs(n),n.mode=Qo,t===No){l>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=ts}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=ts;break}if(n.length=65535&l,l=0,d=0,n.mode=Jo,t===No)break e;case Jo: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=Yo;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=ts;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=Fo(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid code lengths set",n.mode=ts;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(M=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&M,!((p=M>>>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(T=p+2;d<T;){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=ts;break}S=n.lens[n.have-1],m=3+(3&l),l>>>=2,d-=2}else if(17===y){for(T=p+3;d<T;){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(T=p+7;d<T;){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=ts;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===ts)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=ts;break}if(n.lenbits=9,P={bits:n.lenbits},E=Fo(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=ts;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},E=Fo(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=ts;break}if(n.mode=Qo,t===No)break e;case Qo:n.mode=Zo;case Zo: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,Do(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===Yo&&(n.back=-1);break}for(n.back=0;g=(M=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&M,!((p=M>>>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=(M=n.lencode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&M,!(b+(p=M>>>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=Yo;break}if(64&g){e.msg="invalid literal/length code",n.mode=ts;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for(T=n.extra;d<T;){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=(M=n.distcode[l&(1<<n.distbits)-1])>>>16&255,y=65535&M,!((p=M>>>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=(M=n.distcode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&M,!(b+(p=M>>>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=ts;break}n.offset=y,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for(T=n.extra;d<T;){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=ts;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=ts;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=Zo);break;case 16205:if(0===u)break e;a[o++]=n.length,u--,n.mode=Zo;break;case es: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?io(n.check,a,h,o-h):to(n.check,a,h,o-h)),h=u,4&n.wrap&&(n.flags?l:ns(l))!==n.check){e.msg="incorrect data check",n.mode=ts;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=ts;break}l=0,d=0}n.mode=16208;case 16208:E=jo;break e;case ts:E=Uo;break e;case 16210:return Ho;default:return zo}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<ts&&(n.mode<es||t!==Oo))&&ms(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?io(n.check,a,h,e.next_out-h):to(n.check,a,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Yo?128:0)+(n.mode===Qo||n.mode===Jo?256:0),(0===c&&0===h||t===Oo)&&E===Wo&&(E=Go),E},vs={inflateReset:us,inflateReset2:ls,inflateResetKeep:ss,inflateInit:e=>ds(e,15),inflateInit2:ds,inflate:fs,inflateEnd:e=>{if(os(e))return zo;var t=e.state;return t.window&&(t.window=null),e.state=null,Wo},inflateGetHeader:(e,t)=>{if(os(e))return zo;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Wo):zo},inflateSetDictionary:(e,t)=>{var n,i=t.length;return os(e)||0!==(n=e.state).wrap&&n.mode!==Xo?zo:n.mode===Xo&&to(1,t,i,0)!==n.check?Uo:ms(e,t,i,i)?(n.mode=16210,Ho):(n.havedict=1,Wo)},inflateInfo:"pako inflate (from Nodeca project)"};var ps=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},gs=Object.prototype.toString,ys=ro,bs=oo,ws=lo,ks=co,Ss=ho,Es=mo,Ps=fo,Ts=vo;function Ms(e){this.options=bo({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 _o,this.strm.avail_out=0;var n=vs.inflateInit2(this.strm,t.windowBits);if(n!==ws)throw new Error(ao[n]);if(this.header=new ps,vs.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Po(t.dictionary):"[object ArrayBuffer]"===gs.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=vs.inflateSetDictionary(this.strm,t.dictionary))!==ws))throw new Error(ao[n])}Ms.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?bs:ys,"[object ArrayBuffer]"===gs.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=vs.inflate(r,i))===Ss&&s&&((n=vs.inflateSetDictionary(r,s))===ws?n=vs.inflate(r,i):n===Ps&&(n=Ss));r.avail_in>0&&n===ks&&r.state.wrap>0&&0!==e[r.next_in];)vs.inflateReset(r),n=vs.inflate(r,i);switch(n){case Es:case Ps:case Ss:case Ts:return this.onEnd(n),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||n===ks))if("string"===this.options.to){var u=Mo(r.output,r.next_out),l=r.next_out-u,d=To(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!==ws||0!==a){if(n===ks)return n=vs.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ms.prototype.onData=function(e){this.chunks.push(e)},Ms.prototype.onEnd=function(e){e===ws&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=wo(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var _s={ungzip:function(e,t){var n=new Ms(t);if(n.push(e),n.err)throw n.msg||ao[n.err];return n.result}}.ungzip,As=e=>{var t;if(null!=e&&e.includes(un))t=an;else{var n=null==e?void 0:e.find(e=>e.includes(on));t=n?n.split("=")[1]:tn}return(t=t.replace(/\/$/,""))+"/"+Zt},Ds=e=>{var t,n,i=Fr.getAppConfig(at)||Fr.getAppConfig(yt);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},xs=()=>{var e,t,n=(t=Fr.getAppConfig(at)||Fr.getAppConfig(yt),null!==(e=null==t?void 0:t.campaign_cache_ttl)&&void 0!==e?e:null);if(null!==n)if(0!==n){var i=Fr.getApiCampaignSessionTimestamp();if(null!==i)(Date.now()-i)/1e3>=n&&Fr.purgeApiCampaignCache()}else Fr.purgeApiCampaignCache()},Cs=e=>{var t=!Ds(Pe.THIRD_PARTY_TRANSACTIONS);return e&&!t&&ui.info(`[${e}] Your plan does not have purchase management features.`),t},Is=()=>{var e,t,n=null===(e=Fr.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(pn))&&void 0!==t&&t},Ls=()=>{var e,t,n=null===(e=Fr.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(yn))&&void 0!==t&&t};function Rs(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=_s(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}function Fs(e,t,n=Mn,i=Sn){var r,o,s,u,l,d,c;return k(function(h){for(;;)switch(h.n){case 0:return o=0,s=Is(),u=Ls(),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)&&ui.debug(`[HTTP] ${l} ${e}`),u&&null!=t&&t.body&&ui.debug(`[HTTP] Request body: ${t.body}`),f.n=1,a(Os(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,ui.debug(`[HTTP] Response ${r.status}: ${c}`);case 3:if(r.status!=Rn){f.n=4;break}throw new Nr;case 4:if(!(++o<=i)){f.n=6;break}return h=1e3*(o+Pn),f.n=5,a(new Promise(e=>setTimeout(e,h)));case 5:return f.a(2,d());case 6:throw new Or(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,ui.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 Os(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)}function $s(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new jr;return i.apply(this,e)},n}function Ns(e,t,n){var i=n.value;return n.value=function(...e){var t=Fr.getDevice();if(null==t||!t.id)throw new Br;return i.apply(this,e)},n}var Ws,js=function(){return c(function e(){o(this,e);var t=Fr.getNamiConfig();!this.platformID&&t&&this.configure(t)},[{key:"deviceID",get:function(){var e;return null===(e=Fr.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=As(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 zr;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,Fr.setSessionCounter(),n.id&&Fr.setSessionId(n.id);case 2:return i.a(2)}},null,this,null,Promise)}},{key:"postImpression",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:return t=`device/${this.deviceID}/impression/`,i.n=1,a(this.requestBodyAPI(t,e,"POST",!0));case 1:(n=i.v).id&&Fr.setLastImpressionId(n.id);case 2:return i.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(Fs(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(Fs(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 Bs(e){return null!=(null==e?void 0:e.flow)}js.instance=new js,ke([Ns],js.prototype,"login",null),ke([Ns],js.prototype,"logout",null),ke([Ns],js.prototype,"startSession",null),ke([Ns],js.prototype,"postImpression",null),ke([Ns],js.prototype,"postConversion",null),ke([Ns],js.prototype,"purchaseValidation",null),ke([$s],js.prototype,"fetchAPI",null),ke([$s],js.prototype,"requestBodyAPI",null),e.NamiCampaignRuleType=void 0,(Ws=e.NamiCampaignRuleType||(e.NamiCampaignRuleType={})).DEFAULT="default",Ws.LABEL="label",Ws.UNKNOWN="unknown",Ws.URL="url";var zs=()=>{var e;return null!==(e=Fr.getPaywalls(St))&&void 0!==e?e:[]},Us=()=>{var e;return null!==(e=Fr.getPaywalls(ut))&&void 0!==e?e:[]},Hs=()=>Lr(li([...Us(),...zs()]),"id"),Gs=e=>Hs().find(t=>t.id===e),Vs=e=>{var t=Hs(),n=new Set(t.map(e=>e.id));return e.every(e=>n.has(e))},Ks="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{},Xs="function"==typeof Ks.BigInt,Ys=Xs?Ks.BigInt.bind(Ks):void 0,qs=Xs?Ys("0xffffffffffffffffffffffffffffffff"):null,Js=Xs?Ys("0x100000000000000000000000000000000"):null,Qs=Xs?Ys(0):null,Zs=Xs?Ys(1):null,eu=Xs?Ys(8):null,tu=Xs?Ys(1e4):null,nu=Ks.crypto,iu="function"==typeof(null==nu?void 0:nu.getRandomValues),au=1/16,ru=e=>we().device.getDeviceData(e),ou=()=>{var e=Fr.getNamiConfig();return e&&e.formFactor?e.formFactor:we().device.getDeviceFormFactor()};function su(){return we().device.generateUUID()}function uu(e){if(!Xs||!qs)return cu(e);try{var t=qs,n=function(e){if(!Ys)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return Ys("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw ui.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function lu(e){if(!Ys)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 du(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(!(Xs&&qs&&Ys&&tu))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=su(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var u=su(),l=cu(u);if(l>=n&&l<=i)return u;var d=hu(l,n,i);d<r&&(r=d,a=u)}return a}(n,i);var s=qs,u=Ys,l=tu,d=e=>s*u(e)/l,c=d(r),m=d(o);if(m<=c)return lu(c);var f=c+function(e){if(!Ys||null===Js||null===Zs||null===Qs||null===eu)throw new Error("BigInt is not supported in this environment");var t=Ys,n=Qs,i=Zs,a=eu,r=Js;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(iu)nu.getRandomValues(o);else{d||(d=!0,ui.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(iu)try{nu.getRandomValues(o);for(var p,g=n,y=h(o);!(p=y()).done;)g=g<<a|t(p.value);var b=g%s;return ui.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:l}),b}catch(e){throw ui.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 ui.warn("randomBigInt: reached max rejection attempts without crypto, using modulo fallback",{n:e.toString(),attempts:l}),k%s}(m-c);return lu(f)}function cu(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))*au}return n}(e);return 100*t}function hu(e,t,n){return e<t?t-e:e>n?e-n:0}var mu,fu=e=>{try{var t=new URL(e);return("http:"===t.protocol||"https:"===t.protocol)&&!!t.hostname}catch(e){return!1}},vu=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}},pu=(e,t,n)=>e?e.flatMap(e=>{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);return{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}}):[],gu=()=>{var e,t,n=null!==(e=Fr.getCampaignRules(ot))&&void 0!==e?e:[],i=null!==(t=Fr.getCampaignRules(wt))&&void 0!==t?t:[],a=ou(),r=li([...n,...i]).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===a)}),o=new Set;return r.filter(e=>{var t,n,i=`${null!==(t=e.type)&&void 0!==t?t:""}::${null!==(n=e.value)&&void 0!==n?n:""}`;return!o.has(i)&&(o.add(i),!0)})},yu=e=>{var t,n=null!==(t=Fr.getCampaignRules(e))&&void 0!==t?t:[],i=ou();return li(n).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===i)})},bu=()=>yu(wt),wu=()=>yu(ot),ku=(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=vu(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=vu(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}},Su=(e,t)=>{var n=ku(wu,Us,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=ku(bu,zs,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}},Eu="object"==typeof Reflect?Reflect:null,Pu=Eu&&"function"==typeof Eu.apply?Eu.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};mu=Eu&&"function"==typeof Eu.ownKeys?Eu.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Tu=Number.isNaN||function(e){return e!=e};function Mu(){Mu.init.call(this)}Mu.EventEmitter=Mu,Mu.prototype._events=void 0,Mu.prototype._eventsCount=0,Mu.prototype._maxListeners=void 0;var _u=10;function Au(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Du(e){return void 0===e._maxListeners?Mu.defaultMaxListeners:e._maxListeners}function xu(e,t,n,i){var a,r,o,s;if(Au(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=Du(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 Cu(){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 Iu(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=Cu.bind(i);return a.listener=n,i.wrapFn=a,a}function Lu(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):Fu(a,a.length)}function Ru(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 Fu(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(Mu,"defaultMaxListeners",{enumerable:!0,get:function(){return _u},set:function(e){if("number"!=typeof e||e<0||Tu(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");_u=e}}),Mu.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},Mu.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Tu(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},Mu.prototype.getMaxListeners=function(){return Du(this)},Mu.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)Pu(s,this,t);else for(var u=s.length,l=Fu(s,u),d=0;d<u;++d)Pu(l[d],this,t);return!0},Mu.prototype.addListener=function(e,t){return xu(this,e,t,!1)},Mu.prototype.on=Mu.prototype.addListener,Mu.prototype.prependListener=function(e,t){return xu(this,e,t,!0)},Mu.prototype.once=function(e,t){return Au(t),this.on(e,Iu(this,e,t)),this},Mu.prototype.prependOnceListener=function(e,t){return Au(t),this.prependListener(e,Iu(this,e,t)),this},Mu.prototype.removeListener=function(e,t){var n,i,a,r,o;if(Au(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},Mu.prototype.off=Mu.prototype.removeListener,Mu.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},Mu.prototype.listeners=function(e){return Lu(this,e,!0)},Mu.prototype.rawListeners=function(e){return Lu(this,e,!1)},Mu.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Ru.call(e,t)},Mu.prototype.listenerCount=Ru,Mu.prototype.eventNames=function(){return this._eventsCount>0?mu(this._events):[]};var Ou=function(){function e(){o(this,e),this.emitter=new Mu}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}}])}(),$u=function(){return c(function e(){o(this,e),this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1,this.currentFormFactor=ou()},[{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=ou(),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=Fr.getDevice(),!this.disableCampaignUpdates){o.n=1;break}return ui.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(e=>{var t;return e.paywall&&e.form_factors.some(e=>e.form_factor===this.currentFormFactor)||e.flow&&(null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===this.currentFormFactor))}),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}),Fr.setCampaignRules(ot,r),Fr.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),o.a(2,r)}},null,this,null,Promise)}},{key:"fetchCampaignRulesRaw",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(t=Fr.getDevice(),!this.disableCampaignUpdates){i.n=1;break}return ui.info("Campaign updates disabled by configuration. Skipping fetch."),i.a(2,[]);case 1:if(null!=t&&t.id){i.n=3;break}return i.n=2,a(this.getAnonymousCampaigns());case 2:n=i.v,i.n=5;break;case 3:return i.n=4,a(this.getCampaigns(t.id));case 4:n=i.v;case 5:return n=null===(e=n)||void 0===e?void 0:e.filter(e=>{var t;return e.paywall&&e.form_factors.some(e=>e.form_factor===this.currentFormFactor)||e.flow&&(null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===this.currentFormFactor))}),i.a(2,n)}},null,this,null,Promise)}},{key:"finalizeCampaignRules",value:function(e,t){var n=null==e?void 0:e.filter(e=>e.paywall?t.find(t=>t.id==e.paywall):!!e.flow);return Fr.setCampaignRules(ot,n),Fr.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),n}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=Ou.getInstance().listeners(Hn),t=gu();e.forEach(e=>e(t))}},{key:"getAnonymousCampaigns",value:function(e=Ae){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(js.instance.fetchAPI(t));case 2:return i=s.v,s.a(2,pu(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor));case 3:if(s.p=3,o=s.v,r=this.fallbackData()){s.n=4;break}throw ui.error(Zr(o.status,t)),o;case 4:return s.a(2,r.results)}},null,this,[[1,3]],Promise)}},{key:"getCampaigns",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return n=`device/${e}/campaign_rules/`,o.p=1,o.n=2,a(js.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 ui.error(Zr(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:"fallbackData",value:function(){var e=Fr.getCampaignRules(ot)||Fr.getCampaignRules(wt);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 Nu(e,t){return ar(e,t)}$u.instance=new $u;var Wu=function(){return c(function e(){o(this,e)},[{key:"createOrUpdateDevice",value:function(e,t,n){var i=Fr.getDevice();if(null==i||!i.id){var a,r=m({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:su()});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}Fr.setDevice(n),r.n=3;break;case 2:return ui.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 Or)){r.n=5;break}return ui.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)&&Fr.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=Fr.getDevice())&&i.id){o.n=1;break}throw new Br;case 1:return o.n=2,a(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(r=o.v)&&Fr.setDevice(r),o.a(2,r)}},null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=An,r){var o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:return u.p=0,u.n=1,a(js.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 jr)){u.n=3;break}throw s;case 3:if(!("device/"===e&&s instanceof Or)){u.n=4;break}throw s;case 4:if(o=Fr.getDevice()){u.n=5;break}return ui.error(Zr(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 Nu(i,e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=Fr.getAnonymousUUID();return e||(e=su(),Fr.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=Fr.getAnonymousUUID();return e?(Fr.clearAnonymousUUID(),e):null}}])}();Wu.instance=new Wu;var ju=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(!Ds(Pe.THIRD_PARTY_TRANSACTIONS)){r.n=1;break}return r.a(2,[]);case 1:return r.p=1,r.n=2,a(js.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 ui.error(Zr(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&Fr.setProducts(ht,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=Fr.getProducts(ht)||Fr.getProducts(Pt);return e?{count:e.length,results:e}:null}}])}();ju.instance=new ju;var Bu=3,zu=200,Uu=2e3,Hu=5e3,Gu=2e4,Vu=new Set([408,425,429]),Ku=new Set(["ECONNRESET","ECONNREFUSED","ENOTFOUND","ETIMEDOUT"]),Xu=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)}(_(Error)),Yu=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)}(_(Error));function qu(e,t){if("number"==typeof t)return Vu.has(t)||t>=500;if(e&&"object"==typeof e){var n=e;if("AbortError"===n.name)return!0;if(n.code&&Ku.has(n.code))return!0;if(e instanceof TypeError)return!0}return!1}function Ju(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(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 Qu=e=>new Promise(t=>setTimeout(t,e));function Zu(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;return k(function(k){for(;;)switch(k.p=k.n){case 0:d=null!==(n=t.maxAttempts)&&void 0!==n?n:Bu,c=null!==(i=t.baseDelayMs)&&void 0!==i?i:zu,h=null!==(r=t.maxDelayMs)&&void 0!==r?r:Uu,m=null!==(o=t.budgetMs)&&void 0!==o?o:Gu,f=null!==(s=t.timeoutMs)&&void 0!==s?s:Hu,v=null!==(u=t.randomFn)&&void 0!==u?u:Math.random,p=null!==(l=t.sleepFn)&&void 0!==l?l:Qu,g=Is(),y=Ls(),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 T=Math.min(c*Math.pow(2,w-1),h),M=T*(v()-.5),_=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)&&ui.debug(`[HTTP] GET ${e} (cdn attempt ${w+1}/${d})`),k.n=5,a(Ju(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,ui.debug(`[HTTP] Response ${D.status}: ${x}`);case 7:if(S=D.status,!qu(void 0,D.status)){k.n=8;break}return w++,k.a(3,1);case 8:throw new Xu(D.status,e);case 9:if(!y){k.n=11;break}return k.n=10,a(D.clone().text());case 10:C=k.v,ui.debug(`[HTTP] Response ${D.status}: ${C}`);case 11:return k.n=12,a(D.json());case 12:return I=k.v,k.a(2,{data:I,retryCount:w});case 13:if(k.p=13,!((L=k.v)instanceof Xu)){k.n=14;break}throw L;case 14:if(!qu(L)){k.n=15;break}return E=L,w++,k.a(3,1);case 15:throw L;case 16:if(void 0!==S||void 0===E){k.n=17;break}throw E;case 17:throw new Yu(e,w,S);case 18:return k.a(2)}},null,null,[[4,13]],Promise)}var el=function(){return c(function e(){o(this,e)},[{key:"fetchPaywalls",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(null!=(e=Fr.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&&Fr.setPaywalls(ut,n),i.a(2,n);case 5:return i.a(2,t)}},null,this,null,Promise)}},{key:"getAnonymousPaywalls",value:function(e=Ae){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(js.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 ui.error(Zr(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(js.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 ui.error(Zr(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:"fetchPaywallByUrl",value:function(e){return k(function(t){for(;;)if(0===t.n)return t.a(2,Zu(e))},null,null,null,Promise)}},{key:"fetchPaywallsByUrls",value:function(e){var t,n,i,r,o,s,u,l;return k(function(d){for(;;)switch(d.n){case 0:return t=[...new Set(e)],d.n=1,a(Promise.allSettled(t.map(e=>this.fetchPaywallByUrl(e))));case 1:for(n=d.v,i=[],r=0,o=h(n);!(s=o()).done;)"fulfilled"===(u=s.value).status?(i.push(u.value.data),r+=u.value.retryCount):ui.error(`Failed to fetch individual paywall: ${u.reason}`);if(!(i.length>0)){d.n=2;break}return(l=this.validatePaywalls(i)).length>0&&Fr.setPaywalls(ut,l),d.a(2,{paywalls:l,retryCount:r});case 2:return d.a(2,{paywalls:i,retryCount:r})}},null,this,null,Promise)}},{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)||(ui.warn(`Dropping paywall "${e.id}" from cache: template.pages is missing or empty`),!1)})}},{key:"fallbackData",value:function(){var e=Fr.getPaywalls(ut)||Fr.getPaywalls(St);return e?{count:e.length,results:e}:null}}])}();el.instance=new el;var tl=function(){return c(function e(){o(this,e)},[{key:"fetchConfig",value:function(){var e,t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,n.n=1,a(js.instance.fetchAPI("config/"));case 1:e=n.v,n.n=3;break;case 2:if(n.p=2,t=n.v,e=Fr.getAppConfig(at)||Fr.getAppConfig(yt)){n.n=3;break}throw ui.error(Zr(t.status,"config/")),t;case 3:return e&&Fr.setAppConfig(at,e),n.a(2,e)}},null,null,[[0,2]],Promise)}}])}();tl.instance=new tl;var nl=null;function il(){nl&&nl.setInMemoryAnonymousMode(!1)}function al(){return!!Fr.getAnonymousMode()||!!nl&&nl.isInMemoryAnonymousMode()}var rl=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(!al()){t.n=1;break}return ui.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,a(js.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,ui.error("error on start session: ",e);case 4:return t.a(2)}},null,null,[[1,3]],Promise)}}])}();rl.instance=new rl;var ol=function(){return c(function e(){o(this,e)},null,[{key:"allPurchases",value:function(){return[]}}])}();ol.instance=new ol;var sl={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"}},ul="en";function ll(e){var t,n,i=function(e){if(!e)return ul;var t=e.trim();if(sl[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return sl[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":ul}(Fr.getLanguageCode()),a=null!==(t=sl[i])&&void 0!==t?t:sl[ul];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}function dl(e){if("subscription"===(null==e?void 0:e.product_type)){var t=hl(e);if(t.length>0)return t[0].billingPeriod}return null}function cl(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return ml(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function hl(e){return e?ml(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function ml(e,t){return e.map(e=>fl(e,t))}function fl(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:gl(m).format(h)}}function vl(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=ll(o),l=ll(s);return a||u!==o||(u=ll(`${r}_abbrev`)),a||l!==s||(l=ll(`${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 pl(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 gl(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 yl=(e,t,n)=>e&&t&&n?n.format(e-t):null,bl=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},wl=(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)}},kl=e=>El(e.priceAmountMicros)/Sl(e.billingPeriod),Sl=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},El=e=>e/1e6;function Pl(e){return parseFloat((Math.round(e)/100).toFixed(2))}var Tl=(e,t,n=[])=>({price:()=>_l(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>Al(e),durationSingular:()=>Al(e,!0),period:()=>Al(e,!1,!0),periodNumber:()=>Al(e,!1,!1,!0),freeTrialDuration:()=>Dl(e),freeTrialDurationSingular:()=>Dl(e,!0),freeTrialPeriod:()=>Dl(e,!1,!0),freeTrialPeriodNumber:()=>Dl(e,!1,!1,!0),pricePerMonth:()=>xl(e),pricePerMonthRounded:()=>xl(e,!0),periodInMonths:()=>Cl(e),durationInMonths:()=>Il(e),durationInMonthsSingular:()=>Il(e,!0),periodNumberInMonths:()=>Ll(e),percentagePriceDifferenceFromSku:()=>Rl(e,t,n),priceDifferenceFromSku:()=>Fl(e,t,n),promoEligible:()=>null===Ol(e)&&null!==$l(e,t),freeTrialEligible:()=>null!==Ol(e),promo:()=>{var n;return null===(n=$l(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=Nl(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Wl(e,t,!1,!0),promoPeriodNumber:()=>Wl(e,t,!1,!1,!0),promoDuration:()=>Wl(e,t),promoDurationSingular:()=>Wl(e,t,!0),introEligible:()=>!1,pricePerDay:()=>jl(e),pricePerWeek:()=>Bl(e),pricePerWeekRounded:()=>Bl(e,!0),introductoryPrice:()=>zl(e,t),introductoryPeriod:()=>Ul(e,t,!1,!0),introductoryPeriodNumber:()=>Ul(e,t,!1,!1,!0),introductoryDuration:()=>Ul(e,t),introductoryDurationSingular:()=>Ul(e,t,!0),introductoryPricePerMonth:()=>Hl(e,t),introductoryPricePerMonthRounded:()=>Hl(e,t,!0),durationAbbrev:()=>Al(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Dl(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>Ul(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Wl(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Wl(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>Il(e,!1,!1,!1,!0),durationSingularAbbrev:()=>Al(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Dl(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>Ul(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Wl(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Wl(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>Il(e,!0,!1,!1,!0),periodAbbrev:()=>Al(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Dl(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>Ul(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Wl(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Wl(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>Il(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?ll("nami_weekly"):2===u?ll("nami_biweekly"):null:s>0?ll(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?ll("nami_yearly"):null}(dl(e)),iso_subscription_duration:()=>Vl(e),invalid:()=>!1,unavailable:()=>!1}),Ml=(e,t,n,i=[])=>{if(!t)return null;var a=Tl(t,n,i);return a[e]?a[e]():null},_l=e=>{var t=hl(e);return t&&t.length?t[0].formattedPrice:null},Al=(e,t,n,i,a)=>vl(dl(e),t,n,i,a),Dl=(e,t,n,i,a)=>vl(cl(e),t,n,i,a),xl=(e,t)=>{var n=hl(e);if(!n||0===n.length)return null;var i=kl(n[0]);return i?gl(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},Cl=(e,t)=>{var n=hl(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return pl(i)?vl("P1Y"===i?"P12M":i,!1,!1,!1,t):null},Il=(e,t,n,i,a)=>{var r=hl(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return pl(o)?vl("P1Y"===o?"P12M":o,t,n,i,a):null},Ll=e=>{if(!e)return 0;var t=hl(e);return t&&t.length?Sl(t[0].billingPeriod):0},Rl=(e,t,n=[])=>{var i,a=hl(e);if(!a||0===a.length)return null;var r=null===(i=wl(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return bl(Pl(a[0].priceAmountMicros),Ll(e));var o=hl(r);return bl(Pl(a[0].priceAmountMicros),Ll(e),(null==o?void 0:o.length)>0?Pl(o[0].priceAmountMicros):0,Ll(r))},Fl=(e,t,n=[])=>{var i,a=hl(e);if(!a||0===a.length)return null;var r=null===(i=wl(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return yl(kl(a[0]));var o=hl(r);return yl(kl(a[0]),kl(o[0]),gl(o[0].priceCurrencyCode))},Ol=e=>cl(e),$l=(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},Nl=(e,t)=>e?fl($l(e,t),e.subscription_period):null,Wl=(e,t,n,i,a,r)=>{var o=Nl(e,t);return vl((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},jl=(e,t)=>{var n=hl(e);if(!n||0===n.length)return null;var i,a,r=El(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=Sl(i))?30.437*a:1);return r?gl(n[0].priceCurrencyCode).format(r):null},Bl=(e,t)=>{var n=hl(e);if(!n||0===n.length)return null;var i,a,r=El(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=Sl(i))?52*a/12:1);return r?gl(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},zl=(e,t)=>{var n=Gl(e,t);return(null==n?void 0:n.formattedPrice)||null},Ul=(e,t,n,i,a,r)=>{var o=Gl(e,t);return vl((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Hl=(e,t,n)=>{var i=Gl(e,t);if(i){var a=El(i.priceAmountMicros),r=Sl(i.billingPeriod),o=n?Math.round(a/r):a/r;return gl(i.priceCurrencyCode).format(o)}},Gl=(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],fl(n,e.subscription_period)):null;var n},Vl=e=>{var t=dl(e);return t?"P7D"===t?"P1W":t:null};function Kl(e,t,n,i){var a=n.flatMap(e=>e.products).find(e=>e.id===t.selectedProducts[t.currentGroupId]);return Yl(Ql(e,null==a?void 0:a.sku_ref_id),a,i)}function Xl(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=Ql(e,t.sku_ref_id||""),t.variables=Yl(t.product_details,t,r)}),r}function Yl(e,t,n){if(!t)return{};var i=t.variables;if(!i)return m({},t);Object.keys(i).forEach(t=>{if("string"==typeof(r=i[t])&&r.includes(ni)){var a=ql(i[t],e,n);i[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(a)}var r});var a={};return Object.keys(Tl({})).forEach(t=>{if(void 0===i[t]){var r=Ml(t,e,void 0,n);null!==r&&(a[t]=r)}}),m({},t,a,i)}var ql=(e,t,n)=>e.replace(Qn,(i,a)=>{var r,o,s,u,l=(null===(r=Qn.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 Ml(a,t,d,n)});function Jl(e,t){return t.flatMap(e=>e.products).some(t=>1==Ml("freeTrialEligible",Ql(e,t.sku_ref_id)))}function Ql(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var Zl=function(){try{var e=Wi(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ed=Object.prototype.hasOwnProperty;function td(e,t,n){var i=e[t];ed.call(e,t)&&di(i,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&Zl?Zl(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}var nd="object"==typeof e&&e&&!e.nodeType&&e,id=nd&&"object"==typeof module&&module&&!module.nodeType&&module,ad=id&&id.exports===nd?pi.Buffer:void 0;ad&&ad.allocUnsafe;var rd=Ia(Object.getPrototypeOf,Object),od=Object.prototype.hasOwnProperty;function sd(e){var t=new e.constructor(e.byteLength);return new Qi(t).set(new Qi(e)),t}var ud=/\w*$/;var ld=gi?gi.prototype:void 0,dd=ld?ld.valueOf:void 0;function cd(e,t,n){var i,a,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return sd(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return r=sd((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=sd(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,ud.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return i=e,dd?Object(dd.call(i)):{}}}var hd=Object.create,md=function(){function e(){}return function(t){if(!Ti(t))return{};if(hd)return hd(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var fd=Ta&&Ta.isMap,vd=fd?ka(fd):function(e){return sa(e)&&"[object Map]"==Qa(e)};var pd=Ta&&Ta.isSet,gd=pd?ka(pd):function(e){return sa(e)&&"[object Set]"==Qa(e)},yd="[object Arguments]",bd="[object Function]",wd="[object Object]",kd={};function Sd(e,t,n,i,a,r){var o;if(void 0!==o)return o;if(!Ti(e))return e;var s=ia(e);if(s)o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&od.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var u=Qa(e),l=u==bd||"[object GeneratorFunction]"==u;if(pa(e))return e.slice();if(u==wd||u==yd||l&&!a)o=l?{}:function(e){return"function"!=typeof e.constructor||Ca(e)?{}:md(rd(e))}(e);else{if(!kd[u])return a?e:{};o=cd(e,u)}}r||(r=new Ki);var d=r.get(e);if(d)return d;r.set(e,o),gd(e)?e.forEach(function(i){o.add(Sd(i,t,n,i,e,r))}):vd(e)&&e.forEach(function(i,a){o.set(a,Sd(i,t,n,a,e,r))});var c=s?void 0:Oa(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]),td(o,a,Sd(i,t,n,a,e,r))}),o}kd[yd]=kd["[object Array]"]=kd["[object ArrayBuffer]"]=kd["[object DataView]"]=kd["[object Boolean]"]=kd["[object Date]"]=kd["[object Float32Array]"]=kd["[object Float64Array]"]=kd["[object Int8Array]"]=kd["[object Int16Array]"]=kd["[object Int32Array]"]=kd["[object Map]"]=kd["[object Number]"]=kd[wd]=kd["[object RegExp]"]=kd["[object Set]"]=kd["[object String]"]=kd["[object Symbol]"]=kd["[object Uint8Array]"]=kd["[object Uint8ClampedArray]"]=kd["[object Uint16Array]"]=kd["[object Uint32Array]"]=!0,kd["[object Error]"]=kd[bd]=kd["[object WeakMap]"]=!1;var Ed=e=>"object"==typeof e&&null!==e&&"handleEvent"in e,Pd=(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){}}},Td=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;Pd(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;Pd(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):Ed(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 Pd(e,"currentTarget",null),!e.defaultPrevented}}])}(),Md=[];var _d={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,groups:[],selectedProducts:{},formStates:{},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},Ad=function(t){function n(e,t,i){var a;o(this,n),(a=r(this,n)).subscribers=new Set,a.productDetails=Md,a.filteredSkuMenus=[],a.state=Sd(_d,5);var s=Fr.getNamiProfile();return a.state.isLoggedIn=!(null==s||!s.externalId),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=Kl(this.productDetails,this.state,this.filteredSkuMenus,Xl(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:"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=Kl(this.productDetails,this.state,this.filteredSkuMenus,Xl(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(m({},this.state,{selectedProducts:e,sku:t}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,u=m({},this.state,{formFactor:ou(),selectedPaywall:e,selectedCampaign:n}),l=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=m({},u,null===(i=e.template)||void 0===i?void 0:i.initialState)).launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(a=e.sku_menus)&&void 0!==a?a:[],l.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter(e=>l.productGroups.includes(e.ref))),""!==l.currentGroup&&u.groups.length&&null!==(r=e.template)&&void 0!==r&&r.displaySingleGroup)&&(u.currentGroupId=null!==(o=null===(s=u.groups.find(e=>e.ref==l.currentGroup))||void 0===s?void 0:s.id)&&void 0!==o?o:"");if(""===u.currentGroupId&&1===this.filteredSkuMenus.length){var d,c=u.groups.find(e=>e.ref==this.filteredSkuMenus[0].ref);u.currentGroupId=null!==(d=null==c?void 0:c.id)&&void 0!==d?d:u.currentGroupId}var h=Xl(this.productDetails,this.filteredSkuMenus,u.currentGroupId);u.skuItems=h,u.launch=l,u.anySkuHasTrialOffer=Jl(this.productDetails,this.filteredSkuMenus),u.anySkuHasPromoOffer=function(e,t){return!Jl(e,t)&&t.flatMap(e=>e.products).some(t=>1==Ml("promoEligible",Ql(e,t.sku_ref_id)))}(this.productDetails,this.filteredSkuMenus),u.paywallId=e.id,u.sku=Kl(this.productDetails,u,this.filteredSkuMenus,h),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:"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,{userTags:m({},this.state.userTags,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){this.providers=this.providers.filter(t=>t!==e)}},{key:"reset",value:function(){this.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)}),Md=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}}])}(Td);Ad.providers=[];var Dd=c(function e(){o(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}});Dd.instance=new Dd;var xd=()=>Lr(li([...Fr.getNamiEntitlements(pt),...Fr.getNamiEntitlements(Mt)]),"referenceId"),Cd=()=>{Ou.getInstance().emit(Xn,xd())};function Id(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 Ld=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,al()||Ds(Pe.THIRD_PARTY_TRANSACTIONS)||!Ds(Pe.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=Fr.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)&&(Fr.setActiveEntitlements(ft,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:al()&&ui.debug("Skipping active entitlements update - anonymous mode"),Ds(Pe.THIRD_PARTY_TRANSACTIONS)&&ui.debug("Skipping active entitlements update - paywalls-only mode"),Ds(Pe.ENTITLEMENT_MANAGEMENT)||ui.debug("Skipping active entitlements update - no entitlement_management capability");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(js.instance.fetchAPI(t));case 2:n=r.v,r.n=4;break;case 3:throw r.p=3,i=r.v,ui.error(Zr(i.status,t)),i;case 4:return r.a(2,n)}},null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){Cs()&&(e=>{Fr.setNamiEntitlements(pt,e);var t=Fr.getNamiEntitlements(Mt),n=new Set(e.map(e=>e.referenceId)),i=t.filter(e=>{var t=n.has(e.referenceId);return t&&ui.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t});i.length!==t.length&&Fr.setNamiEntitlements(Mt,i),Cd()})(e.map(e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:Dd.instance.refIdToRelatedSKUs[t]||[],activePurchases:Dd.instance.refIdToActivePurchases[t]||[],purchasedSkus:Dd.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e)))}}])}();Ld.instance=new Ld;var Rd=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(!al()){r.n=1;break}return ui.debug("Skipping customer journey state update - anonymous mode"),r.a(2,null);case 1:if(null!=(e=Fr.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(js.instance.fetchAPI(t,void 0,0));case 4:n=r.v,r.n=6;break;case 5:throw r.p=5,i=r.v,ui.error(Zr(i.status,t)),i;case 6:if(!n){r.n=7;break}return Fr.setCustomerJourneyState(n.customer_journey_state),r.a(2,n.customer_journey_state);case 7:return r.a(2,null)}},null,null,[[3,5]],Promise)}}])}();Rd.instance=new Rd;var Fd="[NamiStartup]",Od=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(){var e,t,n;this.enabled=(n=null===(e=Fr.getNamiConfig())||void 0===e?void 0:e.namiCommands,null!==(t=null==n?void 0:n.includes(wn))&&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;ui.info(`${Fd} phase=${e} ms=${i} total_to_ready=${r}${a}`),ui.info(`${Fd} SUMMARY total_to_ready=${r} decode=${this.decodeDuration} process=${this.processDuration} placements=${this.placements}`)}else ui.info(`${Fd} 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 ui.info(`${Fd} 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,ui.info(`${Fd} phase=server_fetch ms=${i} campaigns=${n.length}`),r.a(2,n)}},null,this,null,Promise)}}])}(),$d=new Od,Nd=function(){return c(function e(){o(this,e),this.inMemoryAnonymousMode=!1,nl=this},[{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,ui.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 Fr.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"init",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return this.setInitialValues(e),tl.instance.fetchConfig(),t.n=1,a(this.initAndFetchRequiredData(e));case 1:rl.instance.startSession();case 2:return t.a(2)}},null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=m({},e);delete t.initialConfig,Fr.clearSessionId(),Fr.setNamiConfig(t),Fr.setLanguageCode(e.namiLanguageCode),Fr.setPurchaseChannel(e.purchaseChannel);var n=e.initialConfig;if(n.appConfig||n.platform_config){var i=(null==n?void 0:n.appConfig)||(null==n?void 0:n.platform_config);i&&Fr.setAppConfig(yt,i)}null!=n&&n.paywalls&&Fr.setPaywalls(St,n.paywalls),null!=n&&n.products&&Fr.setProducts(Pt,n.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:Wu.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=m({},ru(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)?du(i):void 0}}}(e.namiCommands),i=Wu.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:ou(),l=this.isAnonymousMode(),d=l?this.initAnonymousDevice():this.initIdentifiedDevice(e),c=d.deviceId,h=d.deviceTask,m=uu(c),s.campaign_rules&&(f=pu(s.campaign_rules,m,u),Fr.setCampaignRules(wt,f),$d.mark("initial_processed",{count:f.length})),!h){p.n=1;break}return p.n=1,a(h);case 1:if($u.instance.configure(u,m,e.namiCommands),xs(),v=Promise.all([ju.instance.fetchProducts(),Rd.instance.fetchCustomerJourneyState(),Ld.instance.fetchActiveEntitlements(),$d.serverFetch(()=>this.fetchCampaignsAndPaywalls())]).catch(i=>{var r;return k(function(o){for(;;)switch(o.n){case 0:if(!(i instanceof Nr)){o.n=3;break}if(Fr.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 ui.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)}),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;return k(function(v){for(;;)switch(v.n){case 0:return e=$u.instance,t=el.instance,n=Date.now(),i=Date.now(),v.n=1,a(e.fetchCampaignRulesRaw());case 1:return r=v.v,o=Date.now()-i,v.n=2,a(Promise.all(r.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(fetch(e.flow.url,{cache:"no-cache"}));case 1:if(!(t=i.v).ok){i.n=3;break}return i.n=2,a(t.json());case 2:e.flow.object=i.v,i.n=4;break;case 3:ui.warn(`Failed to fetch flow object from ${e.flow.url}: ${t.status}`);case 4:i.n=6;break;case 5:i.p=5,n=i.v,ui.warn(`Error fetching flow object from ${e.flow.url}: ${n}`);case 6:return i.a(2)}},null,null,[[0,5]],Promise)})));case 2:if(s=!e.useLegacyPaywallFetch&&$u.hasPaywallUrls(r),l=0,d=Date.now(),!s){v.n=4;break}return c=$u.extractPaywallUrls(r),v.n=3,a(t.fetchPaywallsByUrls(c));case 3:h=v.v,u=h.paywalls,l=h.retryCount,v.n=6;break;case 4:return v.n=5,a(t.fetchPaywalls());case 5:u=v.v;case 6:return m=Date.now()-d,f=Date.now()-n,ui.info(`Paywall fetch telemetry: strategy=${s?"individual":"bulk"}, count=${u.length}, total=${f}ms, campaigns=${o}ms, paywalls=${m}ms`+(s?`, retry_count=${l}`:"")),v.a(2,e.finalizeCampaignRules(r,u))}},null,null,null,Promise)}},{key:"reRenderPaywall",value:function(){we().ui.reRenderPaywall()}}])}();function Wd(e){return Array.isArray(e)?e.map(Wd):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=Wd(n)),e),{}):e}function jd(e,t){return Nu(Wd(e),Wd(t))}Nd.instance=new Nd;var Bd,zd=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?Fr.setNamiProfile({externalId:this.externalId}):Fr.removeNamiProfile(),this}},{key:"load",value:function(){var e=Fr.getNamiProfile();e&&(this.externalId=e.externalId),Ad.setIsLoggedIn(!!this.externalId)}},{key:"loginLocal",value:function(e){this.setExternalId(e).save(),Ad.setIsLoggedIn(!0)}},{key:"loginRemote",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return n.n=1,a(js.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(),Ad.setIsLoggedIn(!1)}},{key:"logoutRemote",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(js.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)}}])}();zd.instance=new zd;var Ud=function(){function e(){o(this,e),Bd.set(this,!1),this.maxLogging=!1}return c(e,[{key:"isInitialized",get:function(){return Se(this,Bd,"f")||null!=Fr.getNamiConfig()}},{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,Bd,"f")?Fr.getNamiConfig():null,ui.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,!jd(l,u)){f.n=1;break}return ui.warn("Nami SDK is already configured, ignoring this configure call."),f.a(2,{sdkInitialized:!0,configureState:zn});case 1:s=!0;case 2:d=As(t.namiCommands),c=As(u.namiCommands),t.appPlatformID==u.appPlatformID&&d==c||(o=!0),t.namiLanguageCode===u.namiLanguageCode&&t.logLevel==u.logLevel||(s=!0);case 3:return o&&(ui.info("SDK full reconfigure called"),Fr.resetDevice()),Ee(this,Bd,!0),js.configure(t),f.n=4,a(Nd.instance.init(t));case 4:return ui.info("SDK successfully initialized!"),h=s||o?jn:Nn,null===(i=(r=we().ui).postConfigure)||void 0===i||i.call(r),$d.mark("ready"),f.a(2,{sdkInitialized:!0,configureState:h})}},null,this,null,Promise)}}],[{key:"sdkVersion",value:function(){return Ae}},{key:"sdkPackageVersion",value:function(){return xe}},{key:"reset",value:function(){var t,n,i;return k(function(r){for(;;)switch(r.n){case 0:return Fr.clearAll(),il(),Ee(e.instance,Bd,!1),zd.instance.setExternalId(void 0),Ad.reset(),js.reset(),$u.instance.reset(),r.n=1,a(Promise.resolve().then(function(){return Bc}));case 1:i=r.v,i.NamiFlowManager.reset(),null===(t=(n=we().ui).onReset)||void 0===t||t.call(n);case 2:return r.a(2)}},null,null,null,Promise)}},{key:"configure",value:function(t){return k(function(n){for(;;)switch(n.n){case 0:if($d.start(),t.appPlatformID){n.n=1;break}throw new jr;case 1:return this.setInitialConfig(t),$d.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){ui.warn("[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 ui.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=Rs(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},ui.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();Bd=new WeakMap,Ud.instance=new Ud;var Hd,Gd,Vd,Kd=new Set(["fullscreen","sheet","compact_sheet","modal"]);e.NamiPaywallManagerEvents=void 0,(Hd=e.NamiPaywallManagerEvents||(e.NamiPaywallManagerEvents={})).BuySku="RegisterBuySKU",Hd.Close="PaywallCloseRequested",Hd.SignIn="PaywallSignInRequested",Hd.Restore="PaywallRestoreRequested",Hd.DeeplinkAction="PaywallDeeplinkAction",e.NamiPaywallAction=void 0,(Gd=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",Gd.SELECT_SKU="SELECT_SKU",Gd.RESTORE_PURCHASES="RESTORE_PURCHASES",Gd.SIGN_IN="SIGN_IN",Gd.CLOSE_PAYWALL="CLOSE_PAYWALL",Gd.SHOW_PAYWALL="SHOW_PAYWALL",Gd.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",Gd.PURCHASE_SUCCESS="PURCHASE_SUCCESS",Gd.PURCHASE_FAILED="PURCHASE_FAILED",Gd.PURCHASE_CANCELLED="PURCHASE_CANCELLED",Gd.PURCHASE_PENDING="PURCHASE_PENDING",Gd.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",Gd.PURCHASE_DEFERRED="PURCHASE_DEFERRED",Gd.DEEPLINK="DEEPLINK",Gd.TOGGLE_CHANGE="TOGGLE_CHANGE",Gd.PAGE_CHANGE="PAGE_CHANGE",Gd.SLIDE_CHANGE="SLIDE_CHANGE",Gd.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",Gd.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",Gd.VIDEO_STARTED="VIDEO_STARTED",Gd.VIDEO_PAUSED="VIDEO_PAUSED",Gd.VIDEO_RESUMED="VIDEO_RESUMED",Gd.VIDEO_ENDED="VIDEO_ENDED",Gd.VIDEO_CHANGED="VIDEO_CHANGED",Gd.VIDEO_MUTED="VIDEO_MUTED",Gd.VIDEO_UNMUTED="VIDEO_UNMUTED",Gd.COUNTDOWN_TIMER_COMPLETED="COUNTDOWN_TIMER_COMPLETED",Gd.UNKNOWN="UNKNOWN",e.LaunchCampaignError=void 0,(Vd=e.LaunchCampaignError||(e.LaunchCampaignError={})).DEFAULT_CAMPAIGN_NOT_FOUND="Default campaign not found",Vd.LABELED_CAMPAIGN_NOT_FOUND="Labeled campaign not found",Vd.CAMPAIGN_DATA_NOT_FOUND="Campaign data not found",Vd.PAYWALL_ALREADY_DISPLAYED="Paywall is already being displayed",Vd.SDK_NOT_INITIALIZED="SDK has not been initialized",Vd.PAYWALL_COULD_NOT_DISPLAY="Failed to display paywall",Vd.URL_CAMPAIGN_NOT_FOUND="URL campaign not found",Vd.PRODUCT_DATA_NOT_FOUND="Product data not found",Vd.PRODUCT_GROUPS_NOT_FOUND="Product groups not found",Vd.FLOW_SCREEN_DATA_UNAVILABLE="Flow unavailable due to missing screen data";var Xd,Yd="entry",qd="screen",Jd="branch",Qd="exit",Zd="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.PAUSE="flowPause",e.RESUME="flowResume",e.SET_LAUNCH_CONTEXT="setLaunchContext"}(Xd||(Xd={}));var ec="__handoff_sequence__",tc="__buy_sku__",nc="__default__",ic="__appear__",ac="__disappear__",rc="__login_success__",oc="__login_failure__",sc="__logout_success__",uc="__logout_failure__",lc="__purchase_success__",dc="__remoteback__",cc="__tag_update__",hc="and",mc="or",fc="i_contains",vc="equals",pc="i_equals",gc="not_equals",yc="not_i_equals",bc="not_contains",wc="set",kc="notSet",Sc="greater_than",Ec="greater_than_or_equal_to",Pc="less_than",Tc="less_than_or_equal_to";function Mc(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}var _c=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=n.map(e=>this.evaluateFilter(e));switch(e.operator){case hc:return i.every(e=>e);case mc:return i.some(e=>e);default:return i.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;switch(e.operator){case hc:for(var i,a=h(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case mc:for(var o,s=h(n);!(o=s()).done;){var u=o.value;if(this.evaluateFilter(u))return!0}return!1;default:for(var l,d=h(n);!(l=d()).done;){var c=l.value;if(!this.evaluateFilter(c))return!1}return!0}}},{key:"evaluateFilter",value:function(e){var t=this.resolve(e.identifier);if(Ud.instance.maxLogging&&ui.debug(`[NamiConditionEvaluator] resolve(${e.identifier}) → ${JSON.stringify(t)} (type: ${typeof t})`),e.operator===wc)return null!=t;if(e.operator===kc)return null==t;if(null==t)return Ud.instance.maxLogging&&ui.debug(`[NamiConditionEvaluator] ${e.identifier} resolved to null — registeredNamespaces: [${[...this.namespaceResolvers.keys()].join(", ")}]`),!![gc,yc,bc].includes(e.operator);switch(e.operator){case fc:return Array.isArray(t)?e.values.some(e=>"string"==typeof e&&t.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 vc:return e.values.some(e=>this.strictEquals(t,e,!1));case pc:return e.values.some(e=>this.strictEquals(t,e,!0));case gc:return e.values.every(e=>!this.strictEquals(t,e,!1));case yc:return e.values.every(e=>!this.strictEquals(t,e,!0));case bc:return e.values.every(e=>"string"!=typeof t||"string"!=typeof e||!t.includes(e));case Sc:case Ec:case Pc:case Tc:var n=Mc(t);return null===n?(this.log(`Resolved value is not numerically comparable for ${e.operator}`),!1):e.values.some(t=>{var i=Mc(t);if(null===i)return!1;switch(e.operator){case Sc:return n>i;case Ec:return n>=i;case Pc:return n<i;default:return n<=i}});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 Ud.instance.maxLogging&&ui.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 Ud.instance.maxLogging&&ui.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 Ud.instance.maxLogging&&ui.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){ui.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),Ac=function(){return c(function e(){o(this,e)},[{key:"register",value:function(){_c.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}}])}(),Dc=function(e){function t(e){var n;return o(this,t),(n=r(this,t)).namespace="LaunchContext",n.context=e,n.register(),n}return p(t,e),c(t,[{key:"resolveValue",value:function(e){if(e.startsWith("customAttributes.")){var t=e.substring(17);return this.resolveKeyPath(t,this.context.customAttributes)}if(e.startsWith("customObject.")){var n=e.substring(13);return this.resolveKeyPath(n,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(Ac),xc=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=ru(),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)}}])}(Ac),Cc=[/(^|_)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],Ic=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=>Cc.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()}}])}();Ic._instance=null;var Lc,Rc=()=>Ic.instance.params,Fc=/\{\{\s*([^}]+?)\s*\}\}/g,Oc=function(){return c(function e(t){o(this,e),this.flowManager=t,this.urlParams=Rc()},[{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,c,h,m=this.flowManager.currentFlow,f=null==m?void 0:m.component;if(e.startsWith("launchContext.")){var v,p=null===(v=this.flowManager.currentFlow)||void 0===v?void 0:v.context;if(p){var g=e.substring(14),y=new Dc(p).resolveValue(g);return null==y?void 0:y.toString()}}else switch(e){case"campaignId":return null==f||null===(t=f.campaign)||void 0===t?void 0:t.rule;case"campaignName":return null==f||null===(n=f.campaign)||void 0===n?void 0:n.name;case"campaignLabel":case"campaignPlacement":return null!==(i=null==f||null===(a=f.campaign)||void 0===a?void 0:a.value)&&void 0!==i?i:void 0;case"campaignSegment":case"campaignSegmentId":return null==f||null===(r=f.campaign)||void 0===r?void 0:r.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(o=null==f||null===(s=f.campaign)||void 0===s?void 0:s.external_segment)&&void 0!==o?o:void 0;case"pageName":return null==f||null===(u=f.paywall)||void 0===u?void 0:u.name;case"pageId":return null==f||null===(l=f.paywall)||void 0===l?void 0:l.id;case"flowName":return null==m?void 0:m.name;case"flowId":return null==m?void 0:m.id;case"objectId":return null==f||null===(d=f.campaign)||void 0===d||null===(d=d.flow)||void 0===d?void 0:d.object_id;case"stepName":return null==m||null===(c=m.currentFlowStep)||void 0===c?void 0:c.name;case"buttonText":var b=null==m?void 0:m.currentButton;if(!b)return;var w=b.firstTextValue;if("function"!=typeof w)return;return w.call(b);case"slideNumber":var k=null==f?void 0:f.getSelectedSlideIndexForCurrentCarousel();return null!=k?`${k+1}`:void 0;case"productGroupId":return(null===(h=Ad.currentProvider)||void 0===h?void 0:h.state.currentGroupId)||void 0;case"productGroupName":var S,E,P,T=null===(S=Ad.currentProvider)||void 0===S?void 0:S.state;return null!==(E=null==T||null===(P=T.groups)||void 0===P||null===(P=P.find(e=>e.id===T.currentGroupId))||void 0===P?void 0:P.displayName)&&void 0!==E?E:void 0;case"productGroupRef":var M,_,A,D=null===(M=Ad.currentProvider)||void 0===M?void 0:M.state;return null!==(_=null==D||null===(A=D.groups)||void 0===A||null===(A=A.find(e=>e.id===D.currentGroupId))||void 0===A?void 0:A.ref)&&void 0!==_?_:void 0;default:return}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Fc,(e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""})}},{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}}])}(),$c=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="urlParams",e.context=Rc(),e.register(),e}return p(t,e),c(t,[{key:"resolveValue",value:function(e){return ui.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(Ac),Nc=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=Ad.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)}}}])}(Ac),Wc=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=Ad.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()}}}}])}(Ac);!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"}(Lc||(Lc={}));var jc=function(){function e(){o(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(e,t,n){var i=new Gc(e,t,this,n);return this.flowOpen=!0,this.currentFlow=i,i}},{key:"finishFlow",value:function(){Ud.instance.maxLogging&&ui.debug("[NamiFlowManager] finishFlow() — closing flow"),this.flowOpen=!1,this.currentFlow=void 0,this.lastAnimatedFlowProgress.clear()}},{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;if(!this.currentFlow.currentFlowStep)return 0;var t=this.currentFlow.steps.filter(e=>e.type===qd);if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter(e=>e.type===qd);if(0===n.length)return 0;var i=this.buildNavGraph(this.currentFlow),a=this.currentFlow.currentFlowStep,r=this.findBranchPoint(t,i),o=0;if(r)o=this.calculateBranchingProgress(n,t,a,r,i);else{var s=t.findIndex(e=>e.id===a.id);o=s>=0?(s+1)/t.length:0}return o=Math.max(0,Math.min(1,o)),e&&this.setLastAnimatedFlowProgress(e,o),o}},{key:"findBranchPoint",value:function(e,t){for(var n,i=h(e);!(n=i()).done;){var a=n.value;if(this.hasBranching(a,e,t))return a}return null}},{key:"calculateBranchingProgress",value:function(e,t,n,i,a){var r=e.length,o=t.findIndex(e=>e.id===i.id),s=e.findIndex(e=>e.id===i.id),u=t.findIndex(e=>e.id===n.id);if(-1===s||n.id===i.id)return(u+1)/(o+2);var l=this.countForwardScreens(n,t,a),d=r+l;return ui.debug(`Branching progress: visited=${r}, remaining=${l}, total=${d}, step=${n.id}`),r/d}},{key:"countForwardScreens",value:function(e,t,n){var i=t.findIndex(t=>t.id===e.id);if(-1===i)return 0;var a=new Set,r=0,o=(e,s)=>{if(!a.has(e)){a.add(e);var u=(n.get(e)||[]).filter(e=>{var n=t.findIndex(t=>t.id===e);return n>i});if(0!==u.length)for(var l,d=h(u);!(l=d()).done;){var c=l.value;o(c,s+1)}else r=Math.max(r,s)}};return o(e.id,0),r}},{key:"hasBranching",value:function(e,t,n){var i=t.findIndex(t=>t.id===e.id);if(-1===i)return!1;var a=(n.get(e.id)||[]).filter(e=>{var n=t.findIndex(t=>t.id===e);return n>i});return a.length>1}},{key:"buildNavGraph",value:function(e){var t=this.navGraphCache.get(e);if(t)return t;var n=new Map;e.steps.forEach(e=>{e.actions&&Object.values(e.actions).forEach(t=>{Array.isArray(t)&&t.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[ic];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===Xd.NAVIGATE||d.function===Xd.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}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e;var t=e;return()=>{this.instance.handoffStepHandler===t&&(this.instance.handoffStepHandler=void 0)}}},{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;Ud.instance.maxLogging&&ui.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"}`);if(r&&o&&o.currentFlowStep){if(o.activeHandoffSequence)return ui.debug(`Resuming flow at handoff sequence ${o.currentFlowStep.id}`),void o.resumeNextHandoff();ui.debug(`Resuming flow at step ${o.currentFlowStep.id}`),o.executeLifecycle(o.currentFlowStep,"__resume__")}else ui.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?(ui.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.finished()):ui.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():ui.warn("This flow cannot be paused"):ui.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:"getCurrentFlowStepAutoAdvanceDelay",value:function(){return this.instance.getCurrentFlowStepAutoAdvanceDelay()}}])}(),Bc=Object.freeze({__proto__:null,NamiFlowManager:jc}),zc=()=>{var e,t;return null!==(e=null===(t=Fr.getNamiConfig())||void 0===t||null===(t=t.namiCommands)||void 0===t?void 0:t.includes("disableAsyncLoginLogout"))&&void 0!==e&&e},Uc=function(){return c(function e(){o(this,e),this.emitter=Ou.getInstance(),_c.shared.registerNamespaceResolver("UserTags",t=>{var n=t.replace("UserTags.",""),i=e.getCustomerAttribute(n);if(null!=i){var a=i.toLowerCase();return"true"===a||"false"===a?"true"===a:isNaN(Number(i))?i:parseInt(i,10)}return null})},[{key:"isSDKInitialized",get:function(){return Ud.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return zd.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||ui.debug(Ne),zd.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 Wr,this.invokeStateHandler(Lc.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){c.n=2;break}throw n=new Kr,this.invokeStateHandler(Lc.LOGIN,!1,n),n;case 2:if(zc()){c.n=3;break}return zd.instance.loginLocal(e),this.invokeStateHandler(Lc.LOGIN,!0),jc.instance.flowOpen&&(i=jc.instance.currentFlow,(r=null==i?void 0:i.currentFlowStep)&&(Ud.instance.maxLogging&&ui.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${r.id}`),i.executeLifecycle(r,rc))),zd.instance.loginRemote(e).catch(e=>{ui.error("[NamiCustomerManager] async login API failed",e)}),Ld.instance.fetchActiveEntitlements().catch(e=>{ui.error("[NamiCustomerManager] async login entitlement refresh failed",e)}),c.a(2);case 3:return c.p=3,c.n=4,a(zd.instance.login(e));case 4:return c.n=5,a(Ld.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Lc.LOGIN,!0),jc.instance.flowOpen&&(o=jc.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&(Ud.instance.maxLogging&&ui.debug(`[NamiCustomerManager] login success — triggering __login_success__ on step ${s.id}`),o.executeLifecycle(s,rc))),c.n=7;break;case 6:throw c.p=6,d=c.v,this.invokeStateHandler(Lc.LOGIN,!1,d),jc.instance.flowOpen&&(u=jc.instance.currentFlow,(l=null==u?void 0:u.currentFlowStep)&&(Ud.instance.maxLogging&&ui.debug(`[NamiCustomerManager] login failure — triggering __login_failure__ on step ${l.id}`),u.executeLifecycle(l,oc))),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 Wr,this.invokeStateHandler(Lc.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){d.n=2;break}throw t=new Kr,this.invokeStateHandler(Lc.LOGOUT,!1,t),t;case 2:if(zc()){d.n=3;break}return zd.instance.logoutLocal(),this.invokeStateHandler(Lc.LOGOUT,!0),jc.instance.flowOpen&&(n=jc.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&(Ud.instance.maxLogging&&ui.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${i.id}`),n.executeLifecycle(i,sc))),zd.instance.logoutRemote().catch(e=>{ui.error("[NamiCustomerManager] async logout API failed",e)}),Ld.instance.fetchActiveEntitlements().catch(e=>{ui.error("[NamiCustomerManager] async logout entitlement refresh failed",e)}),d.a(2);case 3:return d.p=3,d.n=4,a(zd.instance.logout());case 4:return d.n=5,a(Ld.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Lc.LOGOUT,!0),jc.instance.flowOpen&&(r=jc.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,sc)),d.n=7;break;case 6:throw d.p=6,l=d.v,this.invokeStateHandler(Lc.LOGOUT,!1,l),jc.instance.flowOpen&&(s=jc.instance.currentFlow,(u=null==s?void 0:s.currentFlowStep)&&s.executeLifecycle(u,uc)),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?Lc.ANONYMOUS_MODE_ON:Lc.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new Wr,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return ui.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 Gr:new Vr,this.invokeStateHandler(t,!1,i),s.a(2);case 3:if(!e){s.n=4;break}Fr.setAnonymousMode(e),Fr.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Lc.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return Fr.clearAnonymousMode(),il(),o=null===(r=Fr.getNamiConfig())||void 0===r?void 0:r.namiCommands,s.n=5,a(Wu.instance.createOrUpdateDevice(ru(o)));case 5:Fr.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Lc.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}},null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&al()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new Wr;if(Fr.setCustomerAttribute(e,t),Ds(Pe.PAYWALL_PERSONALIZATION)?(Ad.setCustomerAttribute({[e]:t}),ui.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):ui.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.`),jc.instance.flowOpen){var n=jc.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,cc)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Wr;var t=Fr.getCustomerAttribute(e);return null!=t?Ds(Pe.PAYWALL_PERSONALIZATION)?ui.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):ui.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.`):ui.warn(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Wr;return Fr.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new Wr;Fr.clearCustomerAttribute(e)?(Ad.removeCustomerAttribute(e),ui.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.`)):ui.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new Wr;Fr.getAllCustomerAttributesKeys().forEach(e=>{Ad.removeCustomerAttribute(e)}),Fr.clearAllCustomerAttributes(),ui.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 Wr;return Fr.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=Fr.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:qe}},{key:"registerJourneyStateHandler",value:function(e){if(Cs("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(qn,e),()=>{this.instance.emitter.removeListener(qn,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 Wr,this.invokeStateHandler(Lc.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(Wu.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Lc.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,r=o.v,this.invokeStateHandler(Lc.CUSTOMER_DATA_PLATFORM_ID_SET,!1,r);case 5:o.n=7;break;case 6:return ui.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=Fr.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new Xr,this.invokeStateHandler(Lc.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=Ds(Pe.ANONYMOUS_MODE_CAPABILITY),t=Ds(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([ju.instance.fetchProducts(),el.instance.fetchPaywalls().then(e=>$u.instance.fetchCampaignRules(e))]));case 1:return e.a(2)}},null,this,null,Promise)}}])}();Uc.instance=new Uc;var Hc=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&&Vs(this.screens)}}])}(),Gc=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.timerStates={},u.campaign=e,u.component=n,u.context=a,u.manager=i,u.branchcrumbs=[],u.stepcrumbs=[],u.registerResolvers(a);var l=u.findStepByType(Yd);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 Dc(this.context)),null!==(n=(t=this.context).customAttributes)&&void 0!==n||(t.customAttributes={}),Object.assign(this.context.customAttributes,e)}},{key:"registerResolvers",value:function(e){e&&new Dc(e),new xc,new $c,new Nc,new Wc(this.campaign),_c.shared.registerNamespaceResolver("Flow",e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map(e=>e.id);case"Flow.branchcrumbs":return this.branchcrumbs;default:return}})}},{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){Ud.instance.maxLogging&&ui.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:"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, exiting flow"),void this.finished();this.backToPreviousScreenStep()}else ui.debug(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{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=Gs(n.screen);return r&&we().ui.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=Ad.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}ui.warn("No previous screen step found to return to")}else ui.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}`),t.type){case Yd:case Qd:return this.stepcrumbs.push(t),void this.executeLifecycle(t,nc);case Jd:return void this.handleBranchStep(t);case qd:return void this.handleScreenStep(t);case Zd:return}else this.flowLog(`forward(${e}) — step not active (branch_tags=${JSON.stringify(t.branch_tags)}, branchcrumbs=${JSON.stringify(this.branchcrumbs)})`);else ui.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?ui.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}`),ui.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}`),ui.info(`Flow resumed from step ${e}`),this.forward(e)}else ui.warn("No step to resume from");else ui.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){var i=e.actions[t];i?(this.flowLog(`executeLifecycle(${t}) — step=${e.id}, isPaused=${this.isPaused}, ${i.length} lifecycle(s)`),this.executeFullLifecycles(i,n)):this.flowLog(`executeLifecycle(${t}) — no actions on step ${e.id}`)}},{key:"lifecycles",value:function(e){if(this.currentFlowStep){var t=this.currentFlowStep.actions[e];if(t)return t;ui.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"triggerActions",value:function(e,t,n){var i,a=this.lifecycles(e);a&&(this.flowLog(`triggerActions(${e}) — step=${null===(i=this.currentFlowStep)||void 0===i?void 0:i.id}, isPaused=${this.isPaused}`),this.currentButton=t,this.executeFullLifecycles(a,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){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=h(i);!(a=r()).done;){var o;null===(o=a.value.before)||void 0===o||o.forEach(e=>this.shouldRun(e)&&this.performAction(e,n))}}}},{key:"triggerAfterActions",value:function(e,t,n){var i=this.lifecycles(e);if(i){this.currentButton=t;for(var a,r=h(i);!(a=r()).done;){var o;null===(o=a.value.after)||void 0===o||o.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=_c.shared.evaluate(e);if(Ud.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";ui.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,r,o,s,u,l,d,c,h;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case Xd.BACK:this.back();break;case Xd.NEXT:null!==(a=e.parameters)&&void 0!==a&&a.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(r=e.parameters)&&void 0!==r&&r.step?this.forward(e.parameters.step):this.next();break;case Xd.NAVIGATE:var m;if(null!==(o=e.parameters)&&void 0!==o&&o.customAttributes&&this.applyLaunchContextAttributes(e.parameters.customAttributes),null!==(s=e.parameters)&&void 0!==s&&s.step)(null===(m=this.previousFlowStep)||void 0===m?void 0:m.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Xd.FINISHED:case Xd.DISMISS:this.finished();break;case Xd.EXIT:var f=this.steps.find(e=>e.type===Qd);f&&this.forward(f.id);break;case Xd.PAUSE:this.pause();break;case Xd.RESUME:this.resumeFromPause();break;case Xd.HANDOFF:if(null!==(u=e.parameters)&&void 0!==u&&u.handoffTag)if(this.manager.handoffStepHandler)if(e.parameters.handoffData)ui.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(e.parameters.handoffData)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,e.parameters.handoffData);else if(t)ui.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} ${JSON.stringify(t)}`),this.manager.handoffStepHandler(e.parameters.handoffTag,t);else if(e.parameters.handoffFormId){var v=this.getFormData();e.parameters.handoffTag===ec?this.flowHandoffFormSequence():this.manager.handoffStepHandler(e.parameters.handoffTag,v)}else ui.debug(`Invoking handoffStepHandler with ${e.parameters.handoffTag} and no data`),this.manager.handoffStepHandler(e.parameters.handoffTag);else ui.debug("No handoffStepHandler found",e);break;case Xd.LOG:var p;if(null!==(l=e.parameters)&&void 0!==l&&l.eventName)ui.info(`logEvent → ${e.parameters.eventName}`);else ui.warn(`Missing 'eventName' in logEvent action ${null!==(p=e.id)&&void 0!==p?p:"unknown"}`);break;case Xd.TRACK:var g;if(null!==(d=e.parameters)&&void 0!==d&&d.eventName)ui.info(`trackEvent → ${e.parameters.eventName}`);else ui.warn(`Missing 'eventName' in logEvent action ${null!==(g=e.id)&&void 0!==g?g:"unknown"}`);break;case Xd.SET_VIDEO:null!==(c=e.parameters)&&void 0!==c&&c.name&&e.parameters.url?Ad.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):ui.warn("Missing name, url for setting video details");break;case Xd.BLOCK_BACK:var y,b=null===(y=e.parameters)||void 0===y?void 0:y.step,w=b?this.getStep(b):void 0;w?w.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:ui.warn("Missing step for blocking back");break;case Xd.FLOW_EVENT:var k,S=new Oc(this.manager),E=Object.fromEntries(Object.entries(null!==(k=e.parameters)&&void 0!==k?k:{}).map(([e,t])=>[e,S.interpolateDeep(t)]));this.manager.eventHandler?this.manager.eventHandler(E):ui.warn("Missing event handler",E);break;case Xd.FLOW_ENABLED:Ad.setUserInteractionEnabled(!0);break;case Xd.FLOW_DISABLED:Ad.setUserInteractionEnabled(!1);break;case Xd.SET_TAGS:e.parameters&&(Ad.setUserTags(e.parameters),Object.entries(e.parameters).forEach(([e,t])=>{Uc.setCustomerAttribute(e,t)}));break;case Xd.SET_LAUNCH_CONTEXT:var P=e.parameters;null!=P&&P.customAttributes?this.applyLaunchContextAttributes(P.customAttributes):void 0!==(null==P?void 0:P.key)&&void 0!==(null==P?void 0:P.value)&&this.applyLaunchContextAttributes({[P.key]:P.value});break;default:ui.warn(`Missing action handler for ${e.function}`,e)}else this.flowLog(`performAction(${e.function}) — SKIPPED stale step ${n}, current=${null===(h=this.currentFlowStep)||void 0===h?void 0:h.id}`)};a?setTimeout(r.bind(this,this.currentFlowStep.id),a):r(this.currentFlowStep.id)}else ui.warn("No current flow step")}},{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}ui.debug(`No active next step found after ${e.id}`)}else ui.error(`Could not find next step for step ${e.id}`)}else ui.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Gs(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"})):ui.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 ui.warn(`No actions defined for branch tag ${a}`)}}ui.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return m({},null!==(e=null===(t=Ad.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{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).sort();if(0!==n.length){var i=n.filter(e=>!0===t[e]);if(0===i.length)return ui.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:m({},t),remainingKeys:[...i]},this.resumeNextHandoff()}else ui.warn("formStates is empty, no handoffs to perform")}else ui.warn("No formStates available for handoff sequence")}},{key:"resumeNextHandoff",value:function(){var e,t,n=this.activeHandoffSequence;if(!n)return ui.warn("No active handoff sequence to resume"),void this.manager.resume();if(0===n.remainingKeys.length)return ui.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var i=n.remainingKeys.shift(),a=n.formStates[i];ui.debug(`Starting handoff for ${i} → ${String(a)}`),this.activeHandoffSequence=n;var r=`${i}`;null===(e=(t=this.manager).handoffStepHandler)||void 0===e||e.call(t,r,void 0)}}])}(Hc),Vc=function(){return c(function e(){o(this,e),this.emitter=Ou.getInstance()},[{key:"sdkInitialized",get:function(){return Ud.instance.isInitialized}},{key:"campaignTypeAndLabel",value:function(t,n){var i,a="";return t&&!n&&fu(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 Wr;return gu()}},{key:"isCampaignAvailable",value:function(e){if(!this.instance.sdkInitialized)throw new Wr;var t=this.instance.campaignTypeAndLabel(e),n=t.type,i=t.value,a=Su(i,n),r=a.campaign,o=a.paywall;return null!=r&&r.flow?new Hc(r.flow.object).allScreensAvailable:Boolean(r&&o)}},{key:"isFlow",value:function(e,t){if(!this.instance.sdkInitialized)throw new Wr;var n=this.instance.campaignTypeAndLabel(e,t),i=n.type,a=n.value;return Bs(Su(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 Wr;case 1:return xs(),e.n=2,a(Nd.instance.fetchCampaignsAndPaywalls());case 2:return e.a(2,gu())}},null,this,null,Promise)}},{key:"registerAvailableCampaignsHandler",value:function(e){return this.instance.emitter.addListener(Hn,e),()=>{this.instance.emitter.removeListener(Hn,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 Wr;var k,S=$d.firstLaunchLookup(w,()=>Su(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=Fr.getPurchaseChannel();M&&(T=m({},T,{purchaseChannel:M}));var _,A,D,x=null===(h=i)||void 0===h?void 0:h.productGroups,C=null===(f=E)||void 0===f||null===(f=f.sku_menus)||void 0===f?void 0:f.map(e=>e.ref);if((D=null===(_=Fr.getNamiConfig())||void 0===_?void 0:_.namiCommands,null!==(A=null==D?void 0:D.includes(fn))&&void 0!==A&&A&&null!=x&&x.length&&null!=C)&&0==(null==C?void 0:C.filter(e=>null==x?void 0:x.some(t=>t===e))).length)throw a(!1,e.LaunchCampaignError.PRODUCT_GROUPS_NOT_FOUND),new Ur;if(null!=P&&P.flow&&!Vs(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 Hr;var I=we().ui.createPaywall(b,w,i),L=su();return Fr.setLaunchId(L),r&&this.instance.emitter.addListener(Vn,t=>{var n=t.action,i=y(t,ge);r(m({},T,i,{action:null!=n?n:e.NamiPaywallAction.UNKNOWN}))}),setTimeout(()=>a(!0),0),I}},{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=Su(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=Su(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=Su(o,r),u=Ad.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:[]}}])}();Vc.instance=new Vc;var Kc=Vc,Xc=Uc,Yc=function(){return c(function e(){o(this,e),this.emitter=Ou.getInstance()},[{key:"sdkInitialized",get:function(){return Ud.instance.isInitialized}}],[{key:"active",value:function(){return Cs(),xd()}},{key:"isEntitlementActive",value:function(e){return!!Cs("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 Wr;case 1:if(Cs("NamiEntitlementManager.refresh")){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,a(Ld.instance.fetchActiveEntitlements());case 3:return e.a(2,xd())}},null,this,null,Promise)}},{key:"registerActiveEntitlementsHandler",value:function(e){if(Cs("NamiEntitlementManager.registerActiveEntitlementsHandler"))return this.instance.emitter.addListener(Xn,e),()=>{this.instance.emitter.removeListener(Xn,e)}}},{key:"clearProvisionalEntitlementGrants",value:function(){var e=xd();e=e.filter(e=>e.expires&&e.expires>(new Date).valueOf()),Fr.setNamiEntitlements(Mt,e),this.instance.emitter.emit(Xn)}}])}();Yc.instance=new Yc;var qc=Yc,Jc=jc,Qc=e=>{var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:if(!al()){n.n=1;break}return ui.info("Skipping transaction post - anonymous mode"),n.a(2);case 1:return n.p=1,n.n=2,a(js.instance.postConversion(e));case 2:n.n=4;break;case 3:n.p=3,t=n.v,ui.error("Error posting conversion",t);case 4:return n.a(2)}},null,null,[[1,3]],Promise)},Zc=function(){return c(function e(){o(this,e),this.emitter=Ou.getInstance()},[{key:"sdkInitialized",get:function(){return Ud.instance.isInitialized}}],[{key:"allPaywalls",value:function(){if(!this.instance.sdkInitialized)throw new Wr;return Hs()}},{key:"setProductDetails",value:function(e){this.instance.productDetails=e,Ad.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 Cs()&&ui.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){var t,n,i,r,o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:if(Ad.setPurchaseInProgress(!1),jc.instance.flowOpen&&(t=jc.instance.currentFlow,n=null==t?void 0:t.currentFlowStep,t&&n&&t.executeLifecycle(n,lc)),!Uc.inAnonymousMode()){u.n=1;break}return ui.debug("Skipping purchase validation - anonymous mode"),u.a(2);case 1:if(i=Fr.getSessionId(),r=Fr.getPurchaseImpression()){u.n=2;break}return ui.debug("Not sending paywall conversion call complete due to unknown impression"),u.a(2);case 2:return u.p=2,u.n=3,a(Qc({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,ui.error("Error posting conversion",o);case 5:if(Ds(Pe.THIRD_PARTY_TRANSACTIONS)){u.n=9;break}return u.p=6,u.n=7,a(js.instance.purchaseValidation({app_env:"production",payload:"",sku:e.skuId}));case 7:u.n=9;break;case 8:u.p=8,s=u.v,ui.error("Error validating purchase",s);case 9:return u.a(2)}},null,null,[[6,8],[2,4]],Promise)}},{key:"buySkuCancel",value:function(){Ds(Pe.THIRD_PARTY_TRANSACTIONS)?Ad.setPurchase(!1):ui.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){fu(e)?(ui.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received valid url ${e}`),Ad.setAppSuppliedVideoDetails({url:e,name:t})):ui.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received invalid url ${e}`)}},{key:"allowUserInteraction",value:function(e){ui.debug(`NamiPaywallManager: allowUserInteraction called with ${e}`),Ad.setUserInteractionEnabled(e)}}])}();Zc.instance=new Zc,Zc.emitter=Ou.getInstance();var eh,th,nh=Zc,ih=ol,ah={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},rh={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},oh="wave",sh="pulse",uh="none";function lh(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 dh(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}(lh(Ae),e)>=0||ui.warn(`Component ${t} requires SDK version ${e.semver} or higher, but current SDK version is ${Ae}`))}function ch(e){return!e||"object"==typeof e&&0==Object.keys(e).length}!function(e){e.DEFAULT="default",e.LABEL="label",e.URL="url"}(eh||(eh={})),function(e){e.DEEPLINK="deeplink",e.IN_APP="in_app"}(th||(th={})),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"));var hh=Kc,mh=Xc,fh=nh,vh=qc,ph=Jc,gh=ih,yh=zd,bh=Object.freeze({__proto__:null,NamiCampaignManager:hh,NamiCustomerManager:mh,NamiEntitlementManager:vh,NamiFlowManager:ph,NamiPaywallManager:fh,NamiProfileManager:yh,NamiPurchaseManager:gh}),wh=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 kh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sh,Eh={exports:{}};var Ph=(Sh||(Sh=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}})}(Eh)),Eh.exports),Th=kh(Ph),Mh={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},_h={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4},Ah=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:Ae,language:"en"};var t=Th.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:Ae,language:window.navigator.language};if(n.type&&(i.form_factor=Mh[n.type]),n.model&&(i.device_model=n.model),e&&e.length>0){var a=(e=>{var t=e.find(e=>e.includes(dn)),n={platform:"",version:""};if(t){var i=t.split(hn);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=Th.getParser(window.navigator.userAgent).getPlatform();return e.type&&Mh[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=_h[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:"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 Dh(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 xh,Ch,Ih,Lh=globalThis,Rh=Lh.ShadowRoot&&(void 0===Lh.ShadyCSS||Lh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fh=Symbol(),Oh=new WeakMap,$h=function(){return c(function e(t,n,i){if(o(this,e),this._$cssResult$=!0,i!==Fh)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(Rh&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Oh.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Oh.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Nh=e=>new $h("string"==typeof e?e:e+"",void 0,Fh),Wh=(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 $h(n,e,Fh)},jh=Rh?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=h(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return Nh(n)})(e):e,Bh=Object.is,zh=Object.defineProperty,Uh=Object.getOwnPropertyDescriptor,Hh=Object.getOwnPropertyNames,Gh=Object.getOwnPropertySymbols,Vh=Object.getPrototypeOf,Kh=globalThis,Xh=Kh.trustedTypes,Yh=Xh?Xh.emptyScript:"",qh=Kh.reactiveElementPolyfillSupport,Jh=(e,t)=>e,Qh={toAttribute(e,t){switch(t){case Boolean:e=e?Yh: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}},Zh=(e,t)=>!Bh(e,t),em={attribute:!0,type:String,converter:Qh,reflect:!1,useDefault:!1,hasChanged:Zh};null!==(xh=Symbol.metadata)&&void 0!==xh||(Symbol.metadata=Symbol("metadata")),null!==(Ch=Kh.litPropertyMetadata)&&void 0!==Ch||(Kh.litPropertyMetadata=new WeakMap);var tm,nm=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(Rh)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=Lh.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:Qh).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:Qh;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:Zh)(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=em){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&&zh(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=Uh(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:em}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Jh("elementProperties"))){var e=Vh(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Jh("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Jh("properties")))for(var e=this.properties,t=0,n=[...Hh(e),...Gh(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(jh(a))}else void 0!==e&&t.push(jh(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}}])}(_(HTMLElement));nm.elementStyles=[],nm.shadowRootOptions={mode:"open"},nm[Jh("elementProperties")]=new Map,nm[Jh("finalized")]=new Map,null!=qh&&qh({ReactiveElement:nm}),(null!==(Ih=Kh.reactiveElementVersions)&&void 0!==Ih?Ih:Kh.reactiveElementVersions=[]).push("2.1.2");var im=globalThis,am=e=>e,rm=im.trustedTypes,om=rm?rm.createPolicy("lit-html",{createHTML:e=>e}):void 0,sm="$lit$",um=`lit$${Math.random().toFixed(9).slice(2)}$`,lm="?"+um,dm=`<${lm}>`,cm=document,hm=()=>cm.createComment(""),mm=e=>null===e||"object"!=typeof e&&"function"!=typeof e,fm=Array.isArray,vm="[ \t\n\f\r]",pm=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gm=/-->/g,ym=/>/g,bm=RegExp(`>|${vm}(?:([^\\s"'>=/]+)(${vm}*=${vm}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),wm=/'/g,km=/"/g,Sm=/^(?:script|style|textarea|title)$/i,Em=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),Pm=Em(1),Tm=Em(2),Mm=Symbol.for("lit-noChange"),_m=Symbol.for("lit-nothing"),Am=new WeakMap,Dm=cm.createTreeWalker(cm,129);function xm(e,t){if(!fm(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==om?om.createHTML(t):t}var Cm=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=pm,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===pm?"!--"===d[1]?o=gm:void 0!==d[1]?o=ym:void 0!==d[2]?(Sm.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=bm):void 0!==d[3]&&(o=bm):o===bm?">"===d[0]?(o=null!=n?n:pm,c=-1):void 0===d[1]?c=-2:(c=o.lastIndex-d[2].length,l=d[1],o=void 0===d[3]?bm:'"'===d[3]?km:wm):o===km||o===wm?o=bm:o===gm||o===ym?o=pm:(o=bm,n=void 0);var m=o===bm&&e[s+1].startsWith("/>")?" ":"";r+=o===pm?u+dm:c>=0?(a.push(l),u.slice(0,c)+sm+u.slice(c)+um+m):u+um+(-2===c?s:m)}return[xm(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),Dm.currentNode=this.el.content,2===n||3===n){var f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;null!==(a=Dm.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(sm)){var y=m[s++],b=a.getAttribute(g).split(um),w=/([.?@])?(.*)/.exec(y);l.push({type:1,index:r,name:w[2],strings:b,ctor:"."===w[1]?Om:"?"===w[1]?$m:"@"===w[1]?Nm:Fm}),a.removeAttribute(g)}else g.startsWith(um)&&(l.push({type:6,index:r}),a.removeAttribute(g))}if(Sm.test(a.tagName)){var k=a.textContent.split(um),S=k.length-1;if(S>0){a.textContent=rm?rm.emptyScript:"";for(var E=0;E<S;E++)a.append(k[E],hm()),Dm.nextNode(),l.push({type:2,index:++r});a.append(k[S],hm())}}}else if(8===a.nodeType)if(a.data===lm)l.push({type:2,index:r});else for(var P=-1;-1!==(P=a.data.indexOf(um,P+1));)l.push({type:7,index:r}),P+=um.length-1;r++}},null,[{key:"createElement",value:function(e,t){var n=cm.createElement("template");return n.innerHTML=e,n}}])}();function Im(e,t,n=e,i){var a,r,o,s,u;if(t===Mm)return t;var l=void 0!==i?null===(a=n._$Co)||void 0===a?void 0:a[i]:n._$Cl,d=mm(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=Im(e,l._$AS(e,t.values),l,i)),t}var Lm=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:cm).importNode(i,!0);Dm.currentNode=r;for(var o=Dm.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 Rm(o,o.nextSibling,this,e):1===l.type?c=new l.ctor(o,l.name,l.strings,this,e):6===l.type&&(c=new Wm(o,this,e)),this._$AV.push(c),l=a[++u]}s!==(null===(d=l)||void 0===d?void 0:d.index)&&(o=Dm.nextNode(),s++)}return Dm.currentNode=cm,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++}}}])}(),Rm=function(){return c(function e(t,n,i,a){var r;o(this,e),this.type=2,this._$AH=_m,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=Im(this,e,t),mm(e)?e===_m||null==e||""===e?(this._$AH!==_m&&this._$AR(),this._$AH=_m):e!==this._$AH&&e!==Mm&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>fm(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!==_m&&mm(this._$AH)?this._$AA.nextSibling.data=e:this.T(cm.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=Cm.createElement(xm(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 Lm(a,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}},{key:"_$AC",value:function(e){var t=Am.get(e.strings);return void 0===t&&Am.set(e.strings,t=new Cm(e)),t}},{key:"k",value:function(e){fm(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(hm()),this.O(hm()),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=am(e).nextSibling;am(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))}}])}(),Fm=function(){return c(function e(t,n,i,a,r){o(this,e),this.type=1,this._$AH=_m,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=_m},[{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=Im(this,e,t,0),(r=!mm(e)||e!==this._$AH&&e!==Mm)&&(this._$AH=e);else{var o,s,u=e;for(e=a[0],o=0;o<a.length-1;o++)(s=Im(this,u[n+o],t,o))===Mm&&(s=this._$AH[o]),r||(r=!mm(s)||s!==this._$AH[o]),s===_m?e=_m:e!==_m&&(e+=(null!=s?s:"")+a[o+1]),this._$AH[o]=s}r&&!i&&this.j(e)}},{key:"j",value:function(e){e===_m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}])}(),Om=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===_m?void 0:e}}])}(Fm),$m=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!==_m)}}])}(Fm),Nm=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=Im(this,e,t,0))&&void 0!==n?n:_m)!==Mm){var i=this._$AH,a=e===_m&&i!==_m||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==_m&&(i===_m||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)}}])}(Fm),Wm=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){Im(this,e)}}])}(),jm={I:Rm},Bm=im.litHtmlPolyfillSupport;null!=Bm&&Bm(Cm,Rm),(null!==(tm=im.litHtmlVersions)&&void 0!==tm?tm:im.litHtmlVersions=[]).push("3.3.3");var zm,Um,Hm=globalThis,Gm=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(t,"createRenderRoot",this,3)([]);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(t,"update",this,3)([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 Rm(t.insertBefore(hm(),s),s,void 0,null!=n?n:{})}return r._$AI(e),r})(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;T(t,"connectedCallback",this,3)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;T(t,"disconnectedCallback",this,3)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Mm}}])}(nm);Gm._$litElement$=!0,Gm.finalized=!0,null===(zm=Hm.litElementHydrateSupport)||void 0===zm||zm.call(Hm,{LitElement:Gm});var Vm=Hm.litElementPolyfillSupport;null==Vm||Vm({LitElement:Gm}),(null!==(Um=Hm.litElementVersions)&&void 0!==Um?Um:Hm.litElementVersions=[]).push("4.2.2");var Km,Xm,Ym=Wh(Km||(Km=(e=>e)`
|
|
2
2
|
/* ——— keyframes ——— */
|
|
3
3
|
@keyframes nami-slide-up {
|
|
4
4
|
from { transform: translateY(100%); }
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
.nami-modal-content nami-content-container {
|
|
252
252
|
overflow: visible;
|
|
253
253
|
}
|
|
254
|
-
`)),Jm=e=>(t,n)=>{void 0!==n?n.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},Qm={attribute:!0,type:String,converter:Qh,reflect:!1,hasChanged:Zh},Zm=(e=Qm,t,n)=>{var i=n.kind,a=n.metadata,r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),r.set(n.name,e),"accessor"===i){var o=n.name;return{set(n){var i=t.get.call(this);t.set.call(this,n),this.requestUpdate(o,i,e,!0,n)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===i){var s=n.name;return function(n){var i=this[s];t.call(this,n),this.requestUpdate(s,i,e,!0,n)}}throw Error("Unsupported decorator location: "+i)};function ef(e){return(t,n)=>"object"==typeof n?Zm(e,t,n):((e,t,n)=>{var i=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),i?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function tf(e){return ef(m({},e,{state:!0,attribute:!1}))}var nf=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t,[e,n,i])).host=null,a.defineDynamicStateProps(),a}return p(t,e),c(t,[{key:"hostConnected",value:function(){}},{key:"hostDisconnected",value:function(){this.subscribers.clear()}},{key:"onStateChanged",value:function(){this.defineDynamicStateProps(),this.host&&this.host.requestUpdate()}},{key:"defineDynamicStateProps",value:function(){Object.defineProperty(this.state,"tvQuality",{get:this.getTVQuality.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportWidth",{get:this.getViewportWidth.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportHeight",{get:this.getViewportHeight.bind(this),enumerable:!1,configurable:!0})}},{key:"getTVQuality",value:function(){var e,t;if("television"!==this.getFormFactor())return"";var n=window.devicePixelRatio||1,i=window.innerWidth||(null===(e=window.screen)||void 0===e?void 0:e.availWidth),a=window.innerHeight||(null===(t=window.screen)||void 0===t?void 0:t.availHeight);if(!i||!a)return"720p";var r=Math.max(i,a)*n,o=Math.min(i,a)*n;return r>=3840||o>=2160?"4K":r>=1920||o>=1080?"1080p":"720p"}},{key:"getViewportWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}},{key:"getViewportHeight",value:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}],[{key:"create",value:function(e,n,i){var a=new t(e,n,i);return this.providers.push(a),a}},{key:"remove",value:function(e){this.providers=this.providers.filter(t=>t!==e)}},{key:"currentProvider",get:function(){return this.providers[0]}}])}(Ad),af=2,rf=function(){return c(function e(t){o(this,e)},[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AT",value:function(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}},{key:"_$AS",value:function(e,t){return this.update(e,t)}},{key:"update",value:function(e,t){return this.render(...t)}}])}(),of=jm.I,sf=e=>e,uf=()=>document.createComment(""),lf=(e,t,n)=>{var i=e._$AA.parentNode,a=void 0===t?e._$AB:t._$AA;if(void 0===n){var r=i.insertBefore(uf(),a),o=i.insertBefore(uf(),a);n=new of(r,o,e,e.options)}else{var s,u,l,d=n._$AB.nextSibling,c=n._$AM,h=c!==e;if(h)null!==(s=(u=n)._$AQ)&&void 0!==s&&s.call(u,e),n._$AM=e,void 0!==n._$AP&&(l=e._$AU)!==c._$AU&&n._$AP(l);if(d!==a||h)for(var m=n._$AA;m!==d;){var f=sf(m).nextSibling;sf(i).insertBefore(m,a),m=f}}return n},df=(e,t,n=e)=>(e._$AI(t,n),e),cf={},hf=(e,t=cf)=>e._$AH=t,mf=e=>{e._$AR(),e._$AA.remove()},ff=(e,t,n)=>{for(var i=new Map,a=t;a<=n;a++)i.set(e[a],a);return i},vf=(e=>(...t)=>({_$litDirective$:e,values:t}))(function(e){function t(e){var n;if(o(this,t),n=r(this,t,[e]),e.type!==af)throw Error("repeat() can only be used in text expressions");return n}return p(t,e),c(t,[{key:"dt",value:function(e,t,n){var i;void 0===n?n=t:void 0!==t&&(i=t);for(var a,r=[],o=[],s=0,u=h(e);!(a=u()).done;){var l=a.value;r[s]=i?i(l,s):s,o[s]=n(l,s),s++}return{values:o,keys:r}}},{key:"render",value:function(e,t,n){return this.dt(e,t,n).values}},{key:"update",value:function(e,[t,n,i]){var a,r=(e=>e._$AH)(e),o=this.dt(t,n,i),s=o.values,u=o.keys;if(!Array.isArray(r))return this.ut=u,s;for(var l,d,c=null!==(a=this.ut)&&void 0!==a?a:this.ut=[],h=[],m=0,f=r.length-1,v=0,p=s.length-1;m<=f&&v<=p;)if(null===r[m])m++;else if(null===r[f])f--;else if(c[m]===u[v])h[v]=df(r[m],s[v]),m++,v++;else if(c[f]===u[p])h[p]=df(r[f],s[p]),f--,p--;else if(c[m]===u[p])h[p]=df(r[m],s[p]),lf(e,h[p+1],r[m]),m++,p--;else if(c[f]===u[v])h[v]=df(r[f],s[v]),lf(e,r[m],r[f]),f--,v++;else if(void 0===l&&(l=ff(u,v,p),d=ff(c,m,f)),l.has(c[m]))if(l.has(c[f])){var g=d.get(u[v]),y=void 0!==g?r[g]:null;if(null===y){var b=lf(e,r[m]);df(b,s[v]),h[v]=b}else h[v]=df(y,s[v]),lf(e,r[m],y),r[g]=null;v++}else mf(r[f]),f--;else mf(r[m]),m++;for(;v<=p;){var w=lf(e,h[p+1]);df(w,s[v]),h[v++]=w}for(;m<=f;){var k=r[m++];null!==k&&mf(k)}return this.ut=u,hf(e,h),Mm}}])}(rf));var pf=e=>{var t;return k(function(n){for(;;)if(0===n.n)return t=new Set(Array.from(document.fonts.values()).map(e=>e.family)),e.forEach(e=>{var n=gf(e);if(!t.has(n)){var i=new FontFace(n,`url(${e.file})`);document.fonts.add(i)}}),n.a(2,document.fonts.ready.then())},null,null,null,Promise)};function gf(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function yf(e,t,n){var i,a,r,o,s,u,l,d;if("undefined"==typeof window||!e||!t)return ui.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var c={minDistance:null!==(i=null==n?void 0:n.minDistance)&&void 0!==i?i:30,maxDuration:null!==(a=null==n?void 0:n.maxDuration)&&void 0!==a?a:600,lockAxis:null===(r=null==n?void 0:n.lockAxis)||void 0===r||r,preventScrollOnSwipe:null!==(o=null==n?void 0:n.preventScrollOnSwipe)&&void 0!==o&&o,pointerTypes:null!==(s=null==n?void 0:n.pointerTypes)&&void 0!==s?s:["touch"],passiveListeners:null===(u=null==n?void 0:n.passiveListeners)||void 0===u||u,axisHint:null!==(l=null==n?void 0:n.axisHint)&&void 0!==l?l:"y",edgeLeakThreshold:null!==(d=null==n?void 0:n.edgeLeakThreshold)&&void 0!==d?d:24},h=e.style.touchAction;c.preventScrollOnSwipe&&(e.style.touchAction="none");var m=null,f=0,v=0,p=0,g=0,y=0,b=null,w=null,k=!1,S=!1,E=!1,P=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var n=t.overflowY;if("auto"!==n&&"scroll"!==n)return!1;var i=e;return i.scrollHeight>i.clientHeight}catch(e){return!1}},T=e=>c.pointerTypes.includes(e.pointerType),M=t=>{var n=t.composedPath?t.composedPath()[0]:t.target;if(T(t)&&null===m){m=t.pointerId,f=p=t.clientX,v=g=t.clientY,y=performance.now(),b=null,E=!1,k=!1,S=!1,(w="y"===c.axisHint?((e,t)=>{for(var n=e;n&&n!==t&&n instanceof HTMLElement;){var i,a;if(P(n))return n;n=n.parentElement||(null!==(i=null===(a=n.parentNode)||void 0===a?void 0:a.host)&&void 0!==i?i:null)}return null})(n,e):null)||(S=!0);try{var i;null==e||null===(i=e.setPointerCapture)||void 0===i||i.call(e,t.pointerId)}catch(e){try{var a;null==n||null===(a=n.setPointerCapture)||void 0===a||a.call(n,t.pointerId)}catch(e){}}}},_=e=>{if(e.pointerId===m&&T(e)){if(p=e.clientX,g=e.clientY,c.lockAxis&&!b){var n=Math.abs(p-f),i=Math.abs(g-v);(n>2||i>2)&&(b=i>=n?"y":"x")}if("y"===c.axisHint&&("y"===b||!c.lockAxis)){var a=g-v,r=a<0?"up":"down",o=Math.abs(a),s=performance.now()-y,u=o/Math.max(s,1),l=o>=c.minDistance||u>.5;if(w)if(l)S=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(w,r)){if(!(("down"===r&&w.scrollTop<=50||"up"===r&&w.scrollTop+w.clientHeight>=w.scrollHeight-50)&&u>.3))return void(k=!0);S=!0}else S=!0;var d=!w||o>=c.edgeLeakThreshold;if(!E&&!k&&S&&d&&o>=c.minDistance){E=!0;var h=performance.now(),P={direction:"up"===r?"up":"down",distanceX:p-f,distanceY:a,absX:Math.abs(p-f),absY:o,duration:h-y,velocity:o/Math.max(h-y,1),startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:h,originalEvent:e};t(P)}}}},A=e=>{if(e.pointerId===m)if(T(e))if(w)D();else if(E||k)D();else{var n,i=performance.now(),a=i-y,r=p-f,o=g-v,s=Math.abs(r),u=Math.abs(o),l="x"===(n=c.lockAxis&&b?b:"x"===c.axisHint?"x":"y"===c.axisHint?"y":s>=u?"x":"y")?s:u,d=a<=c.maxDuration,h=c.minDistance;if(w&&"y"===n&&S&&(h+=c.edgeLeakThreshold),d&&l>=h){var P;P="x"===n?r>0?"right":"left":o>0?"down":"up";var M=l/Math.max(a,1);t({direction:P,distanceX:r,distanceY:o,absX:s,absY:u,duration:a,velocity:M,startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:i,originalEvent:e})}D()}else D()},D=()=>{m=null,b=null,y=0,w=null,S=!1,k=!1,E=!1},x=!!c.passiveListeners&&{passive:!0},C=c.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",M,C),e.addEventListener("pointermove",_,x),e.addEventListener("pointerup",A,x),e.addEventListener("pointercancel",A,x),e.addEventListener("lostpointercapture",A,x);return{destroy:()=>{e.removeEventListener("pointerdown",M,C),e.removeEventListener("pointermove",_,x),e.removeEventListener("pointerup",A,x),e.removeEventListener("pointercancel",A,x),e.removeEventListener("lostpointercapture",A,x),c.preventScrollOnSwipe&&(e.style.touchAction=h),D()},updateOptions:t=>{Object.assign(c,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=h)}}}var bf={},wf=bf.NAMI_CLOSE_PAYWALL,kf=void 0===wf?"namiClosePaywall":wf,Sf=bf.NAMI_RESTORE_PURCHASES,Ef=void 0===Sf?"namiRestorePurchases":Sf,Pf=bf.NAMI_SIGN_IN,Tf=void 0===Pf?"namiSignIn":Pf,Mf=bf.NAMI_BUY_SKU,_f=void 0===Mf?"namiBuySKU":Mf,Af=bf.SET_STATE,Df=void 0===Af?"setState":Af,xf=bf.NAMI_SELECT_SKU,Cf=void 0===xf?"namiSelectSKU":xf,If=bf.NAMI_PURCHASE_SELECTED_SKU,Lf=void 0===If?"namiPurchaseSelectedSKU":If,Rf=bf.NAMI_DEEP_LINK,Ff=void 0===Rf?"namiDeeplink":Rf,Of=bf.NAMI_NAVIGATE_TO_SCREEN,$f=void 0===Of?"namiNavigateToScreen":Of,Nf=bf.NAMI_RELOAD_PRODUCTS,Wf=void 0===Nf?"namiReloadProducts":Nf,jf=bf.NAMI_PLAY_VIDEO,Bf=void 0===jf?"namiPlayVideo":jf,zf=bf.NAMI_PAUSE_VIDEO,Uf=void 0===zf?"namiPauseVideo":zf,Hf=bf.NAMI_MUTE_VIDEO,Gf=void 0===Hf?"namiMuteVideo":Hf,Vf=bf.NAMI_UNMUTE_VIDEO,Kf=void 0===Vf?"namiUnmuteVideo":Vf,Xf=e=>"subscription"===e;function Yf(e){if(Xf(null==e?void 0:e.product_type)){var t=Jf(e);if(t.length>0)return t[0].billingPeriod}return null}function qf(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return Qf(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function Jf(e){return e?Qf(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function Qf(e,t){return e.map(e=>Zf(e,t))}function Zf(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:nv(m).format(h)}}function ev(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=ll(o),l=ll(s);return a||u!==o||(u=ll(`${r}_abbrev`)),a||l!==s||(l=ll(`${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 tv(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 nv(e){var t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,m({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(navigator.language,m({},t,{style:"currency",currency:"USD"}))}}var iv=(e,t,n)=>e&&t&&n?n.format(e-t):null,av=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},rv=(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)}},ov=e=>uv(e.priceAmountMicros)/sv(e.billingPeriod),sv=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},uv=e=>e/1e6;function lv(e){return parseFloat((Math.round(e)/100).toFixed(2))}var dv=(e,t,n=[])=>({price:()=>hv(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>mv(e),durationSingular:()=>mv(e,!0),period:()=>mv(e,!1,!0),periodNumber:()=>mv(e,!1,!1,!0),freeTrialDuration:()=>fv(e),freeTrialDurationSingular:()=>fv(e,!0),freeTrialPeriod:()=>fv(e,!1,!0),freeTrialPeriodNumber:()=>fv(e,!1,!1,!0),pricePerMonth:()=>vv(e),pricePerMonthRounded:()=>vv(e,!0),periodInMonths:()=>pv(e),durationInMonths:()=>gv(e),durationInMonthsSingular:()=>gv(e,!0),periodNumberInMonths:()=>yv(e),percentagePriceDifferenceFromSku:()=>bv(e,t,n),priceDifferenceFromSku:()=>wv(e,t,n),promoEligible:()=>null===kv(e)&&null!==Sv(e,t),freeTrialEligible:()=>null!==kv(e),promo:()=>{var n;return null===(n=Sv(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=Ev(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Pv(e,t,!1,!0),promoPeriodNumber:()=>Pv(e,t,!1,!1,!0),promoDuration:()=>Pv(e,t),promoDurationSingular:()=>Pv(e,t,!0),introEligible:()=>!1,pricePerDay:()=>Dv(e),pricePerWeek:()=>xv(e),pricePerWeekRounded:()=>xv(e,!0),introductoryPrice:()=>_v(e,t),introductoryPeriod:()=>Mv(e,t,!1,!0),introductoryPeriodNumber:()=>Mv(e,t,!1,!1,!0),introductoryDuration:()=>Mv(e,t),introductoryDurationSingular:()=>Mv(e,t,!0),introductoryPricePerMonth:()=>Av(e,t),introductoryPricePerMonthRounded:()=>Av(e,t,!0),durationAbbrev:()=>mv(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>fv(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>Mv(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Pv(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Pv(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>gv(e,!1,!1,!1,!0),durationSingularAbbrev:()=>mv(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>fv(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>Mv(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Pv(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Pv(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>gv(e,!0,!1,!1,!0),periodAbbrev:()=>mv(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>fv(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>Mv(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Pv(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Pv(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>gv(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?ll("nami_weekly"):2===u?ll("nami_biweekly"):null:s>0?ll(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?ll("nami_yearly"):null}(Yf(e)),iso_subscription_duration:()=>Cv(e),invalid:()=>!1,unavailable:()=>!1}),cv=(e,t,n,i=[])=>{if(!t)return null;var a=dv(t,n,i);return a[e]?a[e]():null},hv=e=>{var t=Jf(e);return t&&t.length?t[0].formattedPrice:null},mv=(e,t,n,i,a)=>ev(Yf(e),t,n,i,a),fv=(e,t,n,i,a)=>ev(qf(e),t,n,i,a),vv=(e,t)=>{var n=Jf(e);if(!n||0===n.length)return null;var i=ov(n[0]);return i?nv(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},pv=(e,t)=>{var n=Jf(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return tv(i)?ev("P1Y"===i?"P12M":i,!1,!1,!1,t):null},gv=(e,t,n,i,a)=>{var r=Jf(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return tv(o)?ev("P1Y"===o?"P12M":o,t,n,i,a):null},yv=e=>{if(!e)return 0;var t=Jf(e);return t&&t.length?sv(t[0].billingPeriod):0},bv=(e,t,n=[])=>{var i,a=Jf(e);if(!a||0===a.length)return null;var r=null===(i=rv(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return av(lv(a[0].priceAmountMicros),yv(e));var o=Jf(r);return av(lv(a[0].priceAmountMicros),yv(e),(null==o?void 0:o.length)>0?lv(o[0].priceAmountMicros):0,yv(r))},wv=(e,t,n=[])=>{var i,a=Jf(e);if(!a||0===a.length)return null;var r=null===(i=rv(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return iv(ov(a[0]));var o=Jf(r);return iv(ov(a[0]),ov(o[0]),nv(o[0].priceCurrencyCode))},kv=e=>qf(e),Sv=(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},Ev=(e,t)=>{if(!e)return null;var n=Sv(e,t);return n?Zf(n,e.subscription_period):null},Pv=(e,t,n,i,a,r)=>{var o=Ev(e,t);return ev((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Tv=(e,t)=>{if(!e)return null;var n=((e,t)=>{if(!e)return null;var n=e.offers.filter(e=>"intro"===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})(e,t);return n?Zf(n,e.subscription_period):null},Mv=(e,t,n,i,a,r)=>{var o=Tv(e,t);return ev((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},_v=(e,t)=>{var n=Tv(e,t);return n?n.formattedPrice:null},Av=(e,t,n)=>{var i=Tv(e,t);if(!i)return null;var a=ov(i);return a?nv(i.priceCurrencyCode).format(n?Math.round(a):a):null},Dv=e=>{var t=Jf(e);if(!t||0===t.length)return null;var n,i,a=uv(t[0].priceAmountMicros)/(n=t[0].billingPeriod,(i=sv(n))?30.437*i:1);return nv(t[0].priceCurrencyCode).format(a)},xv=(e,t)=>{var n=Jf(e);if(!n||0===n.length)return null;var i,a,r=uv(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=sv(i))?52*a/12:1);return nv(n[0].priceCurrencyCode).format(t?Math.round(r):r)},Cv=e=>{var t=Jf(e)[0];return t?t.billingPeriod:null},Iv="object"==typeof global&&global&&global.Object===Object&&global,Lv="object"==typeof self&&self&&self.Object===Object&&self,Rv=Iv||Lv||Function("return this")(),Fv=Rv.Symbol;var Ov=Array.isArray,$v=Object.prototype,Nv=$v.hasOwnProperty,Wv=$v.toString,jv=Fv?Fv.toStringTag:void 0;var Bv=Object.prototype.toString;var zv=Fv?Fv.toStringTag:void 0;function Uv(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":zv&&zv in Object(e)?function(e){var t=Nv.call(e,jv),n=e[jv];try{e[jv]=void 0;var i=!0}catch(e){}var a=Wv.call(e);return i&&(t?e[jv]=n:delete e[jv]),a}(e):function(e){return Bv.call(e)}(e)}function Hv(e){return null!=e&&"object"==typeof e}var Gv=Fv?Fv.prototype:void 0,Vv=Gv?Gv.toString:void 0;function Kv(e){if("string"==typeof e)return e;if(Ov(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,Kv)+"";if(function(e){return"symbol"==typeof e||Hv(e)&&"[object Symbol]"==Uv(e)}(e))return Vv?Vv.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xv(e){return null==e?"":Kv(e)}function Yv(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:function(e,t,n){var i=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(a);++i<a;)r[i]=e[i+t];return r}(e,t,n)}var qv=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Jv(e){return qv.test(e)}var Qv="\\ud800-\\udfff",Zv="["+Qv+"]",ep="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",tp="\\ud83c[\\udffb-\\udfff]",np="[^"+Qv+"]",ip="(?:\\ud83c[\\udde6-\\uddff]){2}",ap="[\\ud800-\\udbff][\\udc00-\\udfff]",rp="(?:"+ep+"|"+tp+")"+"?",op="[\\ufe0e\\ufe0f]?",sp=op+rp+("(?:\\u200d(?:"+[np,ip,ap].join("|")+")"+op+rp+")*"),up="(?:"+[np+ep+"?",ep,ip,ap,Zv].join("|")+")",lp=RegExp(tp+"(?="+tp+")|"+up+sp,"g");function dp(e){return Jv(e)?function(e){return e.match(lp)||[]}(e):function(e){return e.split("")}(e)}var cp,hp=(cp="toUpperCase",function(e){var t=Jv(e=Xv(e))?dp(e):void 0,n=t?t[0]:e.charAt(0),i=t?Yv(t,1).join(""):e.slice(1);return n[cp]()+i});var mp,fp=(mp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},function(e){return null==mp?void 0:mp[e]}),vp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pp=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var gp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var yp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var bp="\\ud800-\\udfff",wp="\\u2700-\\u27bf",kp="a-z\\xdf-\\xf6\\xf8-\\xff",Sp="A-Z\\xc0-\\xd6\\xd8-\\xde",Ep="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pp="["+Ep+"]",Tp="\\d+",Mp="["+wp+"]",_p="["+kp+"]",Ap="[^"+bp+Ep+Tp+wp+kp+Sp+"]",Dp="(?:\\ud83c[\\udde6-\\uddff]){2}",xp="[\\ud800-\\udbff][\\udc00-\\udfff]",Cp="["+Sp+"]",Ip="(?:"+_p+"|"+Ap+")",Lp="(?:"+Cp+"|"+Ap+")",Rp="(?:['’](?:d|ll|m|re|s|t|ve))?",Fp="(?:['’](?:D|LL|M|RE|S|T|VE))?",Op="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",$p="[\\ufe0e\\ufe0f]?",Np=$p+Op+("(?:\\u200d(?:"+["[^"+bp+"]",Dp,xp].join("|")+")"+$p+Op+")*"),Wp="(?:"+[Mp,Dp,xp].join("|")+")"+Np,jp=RegExp([Cp+"?"+_p+"+"+Rp+"(?="+[Pp,Cp,"$"].join("|")+")",Lp+"+"+Fp+"(?="+[Pp,Cp+Ip,"$"].join("|")+")",Cp+"?"+Ip+"+"+Rp,Cp+"+"+Fp,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tp,Wp].join("|"),"g");function Bp(e,t,n){return e=Xv(e),void 0===t?function(e){return yp.test(e)}(e)?function(e){return e.match(jp)||[]}(e):function(e){return e.match(gp)||[]}(e):e.match(t)||[]}var zp=RegExp("['’]","g");var Up,Hp=(Up=function(e,t,n){return t=t.toLowerCase(),e+(n?hp(Xv(t).toLowerCase()):t)},function(e){return function(e,t,n){for(var i=-1,a=null==e?0:e.length;++i<a;)n=t(n,e[i],i,e);return n}(Bp(function(e){return(e=Xv(e))&&e.replace(vp,fp).replace(pp,"")}(e).replace(zp,"")),Up,"")});function Gp(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=Yp(e,t.sku_ref_id||""),t.variables=function(e,t,n){if(!t)return{};var i=t.variables;if(!i)return m({},t);Object.keys(i).forEach(t=>{if(Vp(i[t])){var a=Xp(i[t],e,n);i[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(a)}});var a={};return(()=>Object.keys(dv({})))().forEach(t=>{if(void 0===i[t]){var r=cv(t,e,void 0,n);null!==r&&(a[t]=r)}}),m({},t,a,i)}(t.product_details,t,r)}),r}function Vp(e){return"string"==typeof e&&e.includes(ni)}function Kp(e,t,n){return t?(Object.keys(t).forEach(i=>{Vp(t[i])&&(t[i]=t[Hp(i)]=Xp(t[i],e,n))}),m({},t)):{}}var Xp=(e,t,n)=>e.replace(Qn,(i,a)=>{var r,o,s,u,l=(null===(r=Qn.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 cv(a,t,d,n)});function Yp(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var qp=["conditionAttributes"];function Jp(e,t){return Array.isArray(e)?e.reduce((e,n)=>{var i=Jp(n,t);return Array.isArray(i)?[...e,...i]:[...e,i]},[]):null==e?e:"object"==typeof e?Object.entries(e).reduce((e,[n,i])=>{var a="newRow"===n?i:Jp(i,t);return m({},e,{[n]:a})},{}):"string"==typeof e?rg(e,t):e}function Qp(e,t,n,i={}){var a=n.productBaseComponents||n.components||[],r=n.productFeaturedComponents||a;return t.map(t=>{var n,o,s,u=t.featured?r:a,l=t.entitlements.map(e=>e.entitlement_ref_id),d=Yp(e.productDetails,t.sku_ref_id),c={freeTrialEligible:1==cv("freeTrialEligible",d),introEligible:1==cv("introEligible",d),promoEligible:1==cv("promoEligible",d),invalid:cv("invalid",d),unavailable:cv("unavailable",d)},f=m({},t,t.variables,c,{id:t.id,entitlements:l});o=t,s=e=>{for(var t,n=h(e);!(t=n()).done;){var i=t.value;i.sku=Id(o),i.components&&s(i.components),i.collapseHeader&&i.collapseHeader.components&&s(i.collapseHeader.components)}},s(u);var v={sku:f,media:ag(i,{convertToUrl:!0})};return[null!==(n=t.featured)&&void 0!==n&&n,Jp(u,Jp(v,v))]},[])}function Zp(e,t){if(!t.loopSource)return[];var n="string"==typeof t.loopSource?JSON.parse(t.loopSource):t.loopSource,i=(null!=n?n:[]).filter(n=>{var i;return!(null!==(i=t.loopSourceConditions)&&void 0!==i&&i.length)||t.loopSourceConditions.every(t=>ig(e,t,n))}),a=t.groupBy,r=t.groupHeaderTemplate,o=e=>Jp(t.components,Jp({block:e},{block:e}));if(!a||!r)return[{key:"",header:null,items:i.map(o).filter(e=>null!=e)}];for(var s,u=[],l=new Map,d=h(i);!(s=d()).done;){var c=s.value,m=Jp(a,Jp({block:c},{block:c})),f=null==m?"":String(m);l.has(f)||(u.push(f),l.set(f,[])),l.get(f).push(c)}return u.map(e=>{var t={key:e};return{key:e,header:[Jp(r,Jp({group:t},{group:t}))],items:l.get(e).map(o)}})}function eg(e,t){return t.assertions?t.assertions.every(ig.bind(null,e)):!!t.orAssertions&&(!t.orAssertions.length||t.orAssertions.some(ig.bind(null,e)))}function tg(e,t){var n=t.conditionAttributes,i=y(t,qp);return n?n.reduce((t,n)=>eg(e,n)?(Object.entries(n.attributes).forEach(([t,i])=>{n.attributes[t]=ng(e,i)}),m({},t,n.attributes)):t,i):i}function ng(e,t,n,i=null){var a,r=null!==(a=null==e?void 0:e.flow)&&void 0!==a?a:{},o=r.manager,s=r.previousStepAvailable,u=r.nextStepAvailable,l=e.state,d={};return i&&(d={block:i}),d=m({},d,{state:l,urlParams:Rc(),flow:{isLaunched:!(null==o||!o.flowOpen),previousStepAvailable:!!s,nextStepAvailable:!!u},launch:l.launch,sku:l.sku,customer:l.customer}),"string"==typeof t&&t.includes(ni)&&(t=rg(t,d)),t}function ig(e,{value:t,expected:n,operator:i},a){if(t=ng(e,t,0,a),n=ng(e,n,0,a),"equals"===i)return t===n;if("notEquals"===i)return t!==n;if("contains"===i){var r;if(Array.isArray(t)||"string"==typeof t||t instanceof String||(t=t.toString()),"collapse"==n)n+="_"+(null===(r=e.getCurrentCollapsibleSku())||void 0===r?void 0:r.skuId);return t.includes(n)}return"notContains"===i?(Array.isArray(t)||"string"==typeof t||t instanceof String||(t=t.toString()),!t.includes(n)):"set"===i?"boolean"==typeof n?!!t&&!t.toString().match(ai)===n:!!t&&!t.toString().match(ai):"notSet"===i?!t||t.toString().match(ai):"gt"===i?t>n:"gte"===i?t>=n:"lt"===i?t<n:"lte"===i&&t<=n}function ag(e,{convertToUrl:t}={convertToUrl:!1}){return Object.entries(e).reduce((e,[n,{content:i}])=>(t&&"string"!=typeof i&&i&&(i=URL.createObjectURL(i)),m({},e,{[n]:i})),{})}function rg(e,t){var n=e;if("string"!=typeof e)return n;for(var i,a=new RegExp(ei.source,ei.flags),r=[];null!==(i=a.exec(e))&&(r.push(i),a.global);)i.index===a.lastIndex&&a.lastIndex++;for(var o=0,s=r;o<s.length;o++){var u=s[o],l=u[0],d=u[1],c=rg(d,t);if(l===e)return h(l,c);c!==d&&(n=n.replace(d,c)),n=n.replace(ei,h)}return n;function h(e,n){var i=String(n).split("."),a=i[0];if(!a)return e;var r=og(t,a);if(void 0===r)return e;if("object"==typeof r&&null!==r&&0===Object.keys(r).length)return"";var o=og(t,...i);return void 0===o?"":"string"!=typeof o?o:rg(o,t)}}function og(e,...t){for(var n=e,i=0,a=t;i<a.length;i++){var r=a[i];if(null==n)return;n=Array.isArray(n)?n[+r]:n[r]}return n}var sg=e=>{var t=e.state.timeSpentOnPaywall;if(t)return Date.now()-t},ug=e=>{if(!e)return null;if(e.includes("#"))return e;var t=e.match(/[\d.]+/g);if(!t||t.length<3)return null;var n=t.map(Number),i=n[0],a=n[1],r=n[2],o=n[3],s=e=>Math.round(e).toString(16).padStart(2,"0"),u=void 0!==o&&o<1?s(255*o):"";return`#${s(i)}${s(a)}${s(r)}${u}`},lg=(e,t)=>{if(!e||!t)return!0;var n=null!=e&&e.includes("rgb")?ug(e):e,i=null!=t&&t.includes("rgb")?ug(t):t;return(null==n?void 0:n.toLowerCase())===(null==i?void 0:i.toLowerCase())};function dg(e){var t,n,i,a,r,o,s,u,l,d,c,h,m;return{width:null!==(t=e.width)&&void 0!==t?t:20,railSpacing:null!==(n=e.railSpacing)&&void 0!==n?n:12,dotLineSpacing:null!==(i=e.dotLineSpacing)&&void 0!==i?i:10,lineTopOffset:null!==(a=e.lineTopOffset)&&void 0!==a?a:0,lineBottomOffset:null!==(r=e.lineBottomOffset)&&void 0!==r?r:0,lineWidth:null!==(o=e.lineWidth)&&void 0!==o?o:1,lineColor:null!==(s=e.lineColor)&&void 0!==s?s:"#C6CBD7",lineCornerRadius:null!==(u=e.lineCornerRadius)&&void 0!==u?u:0,dotSize:null!==(l=e.dotSize)&&void 0!==l?l:6,dotColor:null!==(d=e.dotColor)&&void 0!==d?d:"#C6CBD7",dotCornerRadius:null!==(c=e.dotCornerRadius)&&void 0!==c?c:3,dotBorderWidth:null!==(h=e.dotBorderWidth)&&void 0!==h?h:0,dotBorderColor:null!==(m=e.dotBorderColor)&&void 0!==m?m:"transparent",conditionAttributes:e.conditionAttributes}}function cg(e,t,n){for(var i,a=dg(t),r={key:n},o=Jp(t,Jp({group:r},{group:r})),s={dotSize:a.dotSize,dotColor:a.dotColor,dotCornerRadius:a.dotCornerRadius,dotBorderWidth:a.dotBorderWidth,dotBorderColor:a.dotBorderColor},u=h(null!==(l=o.conditionAttributes)&&void 0!==l?l:[]);!(i=u()).done;){var l,d,c=i.value;if(eg(e,c)){var m=null!==(d=c.attributes)&&void 0!==d?d:{};s={dotSize:"number"==typeof m.dotSize?m.dotSize:s.dotSize,dotColor:"string"==typeof m.dotColor?m.dotColor:s.dotColor,dotCornerRadius:"number"==typeof m.dotCornerRadius?m.dotCornerRadius:s.dotCornerRadius,dotBorderWidth:"number"==typeof m.dotBorderWidth?m.dotBorderWidth:s.dotBorderWidth,dotBorderColor:"string"==typeof m.dotBorderColor?m.dotBorderColor:s.dotBorderColor}}}return s.dotCornerRadius=Math.min(s.dotCornerRadius,s.dotSize/2),s}var hg=!0,mg=!1,fg=!1,vg=!1,pg=!1,gg=!1,yg=null,bg=null,wg=null,kg=null,Sg=!1,Eg="",Pg=!1,Tg=null,Mg=null,_g=null,Ag=null,Dg=null,xg=null,Cg=null,Ig=null,Lg=!1,Rg=null,Fg="",Og=0,$g=1,Ng=null,Wg=[],jg=new WeakMap,Bg=new WeakMap,zg=1;function Ug(e){var t=Bg.get(e);return t||(t=zg++,Bg.set(e,t)),String(t)}var Hg=null,Gg=null,Vg=null,Kg=null;function Xg(e){return!0===e||"true"===e||"1"===e||"yes"===e}function Yg(e,t){if(function(){if("undefined"==typeof window)return!1;try{var e,t;return!!Xg(window.NAMI_TTS_DEBUG)||Xg(null===(e=window.localStorage)||void 0===e?void 0:e.getItem("nami:tts:debug"))||Xg(null===(t=window.localStorage)||void 0===t?void 0:t.getItem("NAMI_TTS_DEBUG"))}catch(e){return!1}}())try{t?console.debug(`[Nami TTS] ${e}`,t):console.debug(`[Nami TTS] ${e}`)}catch(e){}}function qg(e="TTS is unavailable in this runtime."){mg||(mg=!0,Yg(e))}function Jg(e){if(!e)return"none";var t=e.id?`#${e.id}`:"",n=e.getAttribute("data-testid"),i=n?`[data-testid="${n}"]`:"";return`${e.tagName.toLowerCase()}${t}${i}`}function Qg(e){return function(e){return null==e?"":String(e).replace(/[^.!?\n]*\$\{[^}]*subscribeUrl[^}]*\}[^.!?\n]*[.!?]?/gi,"To subscribe, follow the on-screen instructions.").replace(/\$\{[^}]+\}/g," ").replace(/\s+([.,!?;:])/g,"$1").replace(/\s+/g," ").trim()}(e)}function Zg(e){return e.toLowerCase().replace(/[^a-z0-9$]+/g," ").replace(/\s+/g," ").trim()}function ey(e){return Qg(String(null!=e?e:"").replace(/<[^>]*>/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`#>~]/g," "))}function ty(e,t){var n=Qg(t);n&&e[e.length-1]!==n&&e.push(n)}function ny(e,t=[]){var n=[];return[...e,...t].forEach(e=>{var t=function(e){var t=Qg(e);if(!t)return[];for(var n=[],i=0,a=0;a<t.length;a+=1){var r=t.charAt(a),o=t.charAt(a+1);if(("."===r||"!"===r||"?"===r)&&(!o||/\s/.test(o))){var s=Qg(t.slice(i,a+1));for(s&&n.push(s);a+1<t.length&&/\s/.test(t.charAt(a+1));)a+=1;i=a+1}}var u=Qg(t.slice(i));u&&n.push(u);return n.length?n:[t]}(e);t.length||ty(n,e),t.forEach(e=>ty(n,e))}),n.slice(0,60)}function iy(e){return Qg(e.join(". ").replace(/\.\s*([.!?])/g,"$1"))}function ay(e){var t,n=Ng;n&&(e&&n.id===e||(n.status="cancelled",(null===(t=Ng)||void 0===t?void 0:t.id)===n.id&&(Ng=null)))}function ry(){if("undefined"==typeof document)return null;for(var e=document.activeElement;e&&null!==(t=e.shadowRoot)&&void 0!==t&&t.activeElement;){var t,n,i;e=null!==(n=null===(i=e.shadowRoot)||void 0===i?void 0:i.activeElement)&&void 0!==n?n:e}return e}function oy(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}function sy(e){for(var t=[],n=null!=e?e:null;n;){n instanceof Element&&-1===t.indexOf(n)&&t.push(n);var i=n.parentNode;n=oy(i)?i.host:i}return t}function uy(e,t){return!!t&&-1!==sy(t).indexOf(e)}function ly(e,t){if(!t)return!1;if(t===e)return!0;if(e.contains(t))return!0;var n=e.shadowRoot;return!!n&&(n.activeElement===t||n.contains(t))}function dy(e,t){t&&-1===e.indexOf(t)&&e.push(t)}function cy(e,t){var n=t.shadowRoot;n&&n.querySelectorAll('button,[role="button"],a,input,select,textarea,[tabindex]:not([tabindex="-1"])').forEach(t=>dy(e,t))}function hy(e,t){var n,i=("function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():null!==(n=null==t?void 0:t.composedPath)&&void 0!==n?n:[]).filter(e=>e instanceof Element);return i.length?i:sy(e)}function my(e,t=[],n={}){var i=[];if(n.focusedElementOnly)return dy(i,e),i;var a=(t.length?t:sy(e)).filter(e=>e.isConnected),r=function(e,t){var n,i=t.find(e=>e.matches("nami-product-container"));if(i)return i;var a=sy(e).find(e=>e.matches("nami-product-container"));if(a)return a;var r=kg&&"querySelectorAll"in kg?kg:"undefined"!=typeof document?document:null;return r&&null!==(n=Array.prototype.slice.call(r.querySelectorAll("nami-product-container")).find(t=>uy(t,e)))&&void 0!==n?n:null}(e,a);return dy(i,e),cy(i,e),a.forEach(t=>{var n=!!r&&(t===r||uy(r,t)),a=t!==e&&uy(t,e),o=t.matches('nami-product-container,nami-button,[role="button"],button,[tabindex]:not([tabindex="-1"])');(n||a||t===e)&&o&&(dy(i,t),cy(i,t))}),null!=r&&r.isConnected&&(dy(i,r),cy(i,r)),i}function fy(e){return jg.has(e)}function vy(e,t,n=[]){var i=Qg(t);if(!i)return!1;by(),py(void 0,"new-composite",!0);var a=my(e,n,Ry()||Ly()?{focusedElementOnly:!1}:{focusedElementOnly:!0});return a.forEach(e=>function(e,t){var n=Qg(t);return!!n&&(jg.has(e)||jg.set(e,{"aria-label":e.getAttribute("aria-label")}),e.setAttribute("aria-label",n),!0)}(e,i)),Wg=a,!0}function py(e,t="manual",n=!1){var i=e&&-1===Wg.indexOf(e)?my(e):Wg;i.length&&(!n&&Ng&&i.some(e=>jg.has(e))?Yg("composite restore skipped: transaction still active",{reason:t}):(by(),i.forEach(e=>{var t=jg.get(e);t&&(!function(e,t,n){null===n?e.removeAttribute(t):e.setAttribute(t,n)}(e,"aria-label",t["aria-label"]),jg.delete(e))}),e&&-1===Wg.indexOf(e)||(Wg=[])))}function gy(e,t){jg.has(e)&&(t instanceof Element&&ly(e,t)||(by(),_g=setTimeout(()=>{(_g=null,e.isConnected)?ly(e,ry())||py(e,"blur"):py(e,"blur-disconnected",!0)},50)))}function yy(e){Wg.length&&py(void 0,e,!0)}function by(){_g&&(clearTimeout(_g),_g=null)}function wy(){Ag&&(clearTimeout(Ag),Ag=null),Hg=null}function ky(){Dg&&(clearTimeout(Dg),Dg=null)}function Sy(){xg&&(clearTimeout(xg),xg=null)}function Ey(){Cg&&(clearTimeout(Cg),Cg=null)}function Py(){Ig&&(clearTimeout(Ig),Ig=null)}function Ty(e){Lg=!0,Py(),Ig=setTimeout(()=>{Ig=null,Lg=!1},_y(e)+500)}function My(){Py(),Lg=!1}function _y(e){var t=Qg(e),n=350*(t?t.split(/\s+/).filter(Boolean).length:0);return Math.min(3e4,Math.max(4e3,n))}function Ay(){return"undefined"==typeof window?null:window}function Dy(){var e,t=null===(e=Ay())||void 0===e||null===(e=e.webOS)||void 0===e||null===(e=e.service)||void 0===e?void 0:e.request;return"function"==typeof t?t:null}function xy(){return!!Dy()}function Cy(){var e;if("undefined"==typeof window)return null;var t=null===(e=window.VIZIO)||void 0===e?void 0:e.Chromevox;return t&&"function"==typeof t.play?t:null}function Iy(){return"undefined"!=typeof window&&void 0!==window.speechSynthesis&&"function"==typeof window.speechSynthesis.speak&&"function"==typeof window.SpeechSynthesisUtterance}function Ly(){var e;if("undefined"==typeof window)return!1;var t=window,n=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"";return!(!t.VIZIO&&-1===n.indexOf("vizio"))}function Ry(){var e,t;if("undefined"==typeof window)return!1;if(Ly())return!1;var n=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"",i=Ay();return!!(null!=i&&i.webOS||null!=i&&i.webOSDev||null!=i&&i.PalmSystem||null!=i&&null!==(t=i.webOS)&&void 0!==t&&null!==(t=t.platform)&&void 0!==t&&t.tv||-1!==n.indexOf("webos")||-1!==n.indexOf("netcast"))}function Fy(){var e;if("undefined"==typeof window)return!1;var t=window,n=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"";return!!(t.tizen||-1!==n.indexOf("tizen")||-1!==n.indexOf("samsung")&&(-1!==n.indexOf("smart-tv")||-1!==n.indexOf("smarttv"))||-1!==n.indexOf("samsungbrowser")&&-1!==n.indexOf("tv"))}function Oy(e){return"string"==typeof e&&-1!==e.toLowerCase().indexOf("xbox")}function $y(){var e,t,n;if("undefined"==typeof window)return!1;if(!0===Vg)return!0;var i=window.navigator;return[i.userAgent,i.platform,i.vendor,null===(e=i.userAgentData)||void 0===e?void 0:e.platform,...(null!==(t=null===(n=i.userAgentData)||void 0===n?void 0:n.brands)&&void 0!==t?t:[]).map(e=>e.brand)].some(Oy)}function Ny(){if("undefined"==typeof window)return!1;try{return"television"===ou()}catch(e){return!1}}function Wy(){if(pg)return!1;var e=Cy();if(!e)return!1;try{return"function"!=typeof e.isEnabled||e.isEnabled()}catch(e){return!1}}function jy(){return{televisionRuntime:Ny(),televisionTtsRuntime:By(),webos:Ry(),tizen:Fy(),vizio:Ly(),xbox:$y(),xboxClientHintsResult:Vg,hasWebOsServiceRequest:xy(),webOsRequestType:typeof Dy(),hasWebSpeechApi:Iy(),webSpeechUnavailableForSession:fg,webOsLunaUnavailableForSession:vg,vizioChromevoxUnavailableForSession:pg}}function By(){return Ny()||Ry()||Ly()||Fy()}function zy(){return By()&&!fg&&Iy()}function Uy(e){if(gg=e,Yg("set media playing",{playing:e,hasDeferredUtterance:!!yg}),!e&&yg){var t,n=yg;if(yg=null,n.options.transactionId&&(null===(t=Ng)||void 0===t?void 0:t.id)!==n.options.transactionId)return void Yg("drop stale deferred speech",{transactionId:n.options.transactionId,reason:n.options.reason});sb(n.text,n.options)}}function Hy(e){fg=!0,qg(Ry()?"Web Speech TTS unavailable in this webOS runtime":"Web Speech TTS unavailable in this runtime"),Yg("web speech unavailable",{error:e})}function Gy(e){vg=!0,Yg("webOS Luna unavailable",{error:e})}function Vy(e,t){yg={text:e,options:t}}var Ky={name:"webos-luna-tts",platform:"webos",isAvailable:function(){return By()&&!Ly()&&!vg&&xy()},speak:function(e,t){Yg("speakViaWebOsLuna:enter",{textPreview:e.slice(0,160),reason:t.reason,transactionId:t.transactionId,requestType:typeof Dy()});var n=Dy();if(!n)return Yg("speakViaWebOsLuna:no-request"),!1;var i="composite"===t.reason,a=!1,r=()=>{var r,o;if(xg=null,t.transactionId&&(null===(r=Ng)||void 0===r?void 0:r.id)!==t.transactionId)return Yg("speakViaWebOsLuna:drop-stale-delayed-speak",{transactionId:t.transactionId,activeTransaction:null===(o=Ng)||void 0===o?void 0:o.id,reason:t.reason}),!1;if(gg)return Yg("speakViaWebOsLuna:defer-delayed-speak-media-playing",{transactionId:t.transactionId,reason:t.reason}),Vy(e,t),!0;var s=!1;try{Yg("speakViaWebOsLuna:request",{uri:"luna://com.webos.service.tts",method:"speak",delayedComposite:i,textPreview:e.slice(0,160)}),n("luna://com.webos.service.tts",{method:"speak",parameters:{text:e,clear:!0,feedback:!0},onSuccess:e=>{var n;if(Yg("speakViaWebOsLuna:onSuccess",{response:e,transactionId:t.transactionId}),!t.transactionId||(null===(n=Ng)||void 0===n?void 0:n.id)===t.transactionId){var i,r=function(e){var t,n=Qg(null!==(t=null==e?void 0:e.msgStatus)&&void 0!==t?t:null==e?void 0:e.status).toLowerCase();return"done"===n||"stopped"===n||"canceled"===n||"cancelled"===n||"error"===n}(e),o=!(null==e||!e.returnValue||"msgStatus"in Object(null!=e?e:{}));if(!a&&(r||o))a=!0,t.transactionId&&(null===(i=Ng)||void 0===i?void 0:i.id)===t.transactionId&&(Ng.status="ended",Ng=null)}},onFailure:e=>{var n;s=!0,Yg("speakViaWebOsLuna:onFailure",{error:e,transactionId:t.transactionId});var i=!t.transactionId||(null===(n=Ng)||void 0===n?void 0:n.id)===t.transactionId;t.transactionId&&i&&Ng&&(Ng.status="cancelled",Ng=null),Gy(e)}})}catch(e){var u;return t.transactionId&&(null===(u=Ng)||void 0===u?void 0:u.id)===t.transactionId&&(Ng.status="cancelled",Ng=null),Gy(e),!1}return!s};if(i)return Sy(),Yg("speakViaWebOsLuna:delay-composite-until-focus-settles",{delayMs:250,transactionId:t.transactionId}),xg=setTimeout(r,250),!0;return r()},stop:qy},Xy={name:"web-speech",platform:"web",isAvailable:zy,speak:function(e,t){if(!zy())return!1;try{var n=new window.SpeechSynthesisUtterance(e);return n.onstart=()=>{var e;t.transactionId&&(null===(e=Ng)||void 0===e?void 0:e.id)===t.transactionId&&(Ng.status="started")},n.onend=()=>{var e=Ng,n=!t.transactionId||(null==e?void 0:e.id)===t.transactionId;t.transactionId&&n&&e&&(e.status="ended",Ng=null)},n.onerror=e=>{var n,i=e.error;t.transactionId&&(null===(n=Ng)||void 0===n?void 0:n.id)===t.transactionId&&(Ng.status="cancelled",Ng=null),"synthesis-failed"===i&&Hy(i)},window.speechSynthesis.speak(n),!0}catch(e){return Hy("exception"),!1}},stop:()=>{if(Iy())try{window.speechSynthesis.cancel()}catch(e){}}},Yy={name:"vizio-chromevox",platform:"vizio",isAvailable:Wy,speak:Qy,stop:Jy};function qy(){var e=Dy();if(e)try{e("luna://com.webos.service.tts",{method:"stop",parameters:{},onFailure:e=>Yg("webOS Luna stop failed",{error:e})})}catch(e){Yg("webOS Luna stop threw",{error:e})}}function Jy(e=!0){var t=!!Dg,n=Lg;ky();var i=Cy(),a=function(){var e;if("undefined"==typeof window)return null;var t=null===(e=window.chrome)||void 0===e||null===(e=e.tts)||void 0===e?void 0:e.stop;return"function"==typeof t?t:null}();if((i||a)&&(n||t||a)&&(n||!t||a))try{var r=!1;i&&"function"==typeof i.stop&&(i.stop(),r=!0),i&&"function"==typeof i.cancel&&i.cancel(),i&&"function"==typeof i.pause&&i.pause(),a&&(a(),r=!0),i&&e&&!r&&n&&i.play(""),My()}catch(e){My(),Yg("VIZIO stop threw",{error:e})}}function Qy(e,t){var n=Cy();if(!n)return!1;try{var i,a,r=!0===(null===(i=t.element)||void 0===i?void 0:i.isConnected),o="composite"===t.reason?1400:"focus"===t.reason?700:0;return o>0?(ky(),Dg=setTimeout(()=>{var i;if(Dg=null,!t.transactionId||!Ng||Ng.id===t.transactionId)if(t.element&&r&&!t.element.isConnected){var a;t.transactionId&&(null===(a=Ng)||void 0===a?void 0:a.id)===t.transactionId&&(Ng.status="cancelled",Ng=null)}else{if(gg)return wy(),Gg=null,void Vy(e,t);n.play(e),Ty(e),t.transactionId&&(null===(i=Ng)||void 0===i?void 0:i.id)===t.transactionId&&(Ng.status="ended",Ng=null)}},o),!0):(n.play(e),Ty(e),t.transactionId&&(null===(a=Ng)||void 0===a?void 0:a.id)===t.transactionId&&(Ng.status="ended",Ng=null),!0)}catch(e){return function(e){pg=!0,Yg("VIZIO Chromevox unavailable",{error:e})}(e),!1}}function Zy(e){return"high"===e?3:"normal"===e?2:1}function eb(){return Date.now()-Og<1500}function tb(e){return Zg(e)}function nb(e){if(!e)return"";var t=function(e){return e?[e.tagName.toLowerCase(),e.id||"",e.getAttribute("data-component-id")||"",e.getAttribute("data-nami-id")||"",e.getAttribute("data-testid")||"",`el-${Ug(e)}`].filter(Boolean).join("|"):""}(e);return Zg(t||hb(e))}function ib(e){var t=tb(e);return"clickable"===t||"button"===t||"focusable"===t||"selected"===t||"unselected"===t}function ab(e,t,n){var i;if(Gg={textKey:tb(e),reason:t.reason,timestamp:Date.now()},"high"===n){var a=_y(e),r=Date.now();Hg={transactionId:t.transactionId,pageKey:Eg,element:null!==(i=t.element)&&void 0!==i?i:null,elementKey:nb(t.element),textKey:tb(e),startedAt:r,suppressUntil:r+a},Ag&&clearTimeout(Ag),Ag=setTimeout(()=>{Ag=null,Hg=null},a)}}function rb(e,t=!0){var n,i,a,r=!(!e||(null===(n=Ng)||void 0===n?void 0:n.id)!==e||"pending"!==Ng.status);if(Yg("stopSpeech",{preserveTransactionId:e,allowVizioEmptyFallback:t,activeTransaction:null===(i=Ng)||void 0===i?void 0:i.id,reason:null===(a=Ng)||void 0===a?void 0:a.reason,preservingCurrentTransaction:r}),yg=null,r||(Ey(),Sy()),e||(wy(),by(),yy("stop")),ay(e),Mg&&(clearTimeout(Mg),Mg=null),!r){if(Iy())try{window.speechSynthesis.cancel()}catch(e){}Ry()&&qy(),Ly()&&Jy(t)}}function ob(){rb()}function sb(e,t={}){var n,i,a;Yg("speakText:enter",{textPreview:Qg(e).slice(0,160),reason:t.reason,transactionId:t.transactionId,element:Jg(t.element),runtime:jy()});var r=Qg(e);if(!r)return!1;if(!By())return Yg("skip speech: non-CTV runtime"),!1;var o={interrupt:!1!==t.interrupt,reason:null!==(n=t.reason)&&void 0!==n?n:"manual",transactionId:t.transactionId,element:t.element,focusPath:t.focusPath,priority:t.priority},s=function(e,t){return t.priority?t.priority:"composite"===t.reason?"high":ib(e)?"low":"normal"}(r,o);if(function(e,t,n){var i=tb(e),a=Date.now(),r=nb(t.element);if(ib(e))return!0;if(Gg&&Gg.reason===t.reason&&Gg.textKey===i&&a-Gg.timestamp<600)return Yg("suppress:duplicate-request",{reason:t.reason,textPreview:e.slice(0,120)}),!0;if(!Hg)return!1;if(Zy(n)>=Zy("high"))return!1;if("focus"===t.reason){var o=Hg.textKey;if(!eb()&&(i===o||i.includes(o)))return Yg("suppress:focus-text-is-active-composite",{textPreview:e.slice(0,120),transactionId:Hg.transactionId,element:Jg(t.element)}),!0}var s=function(e,t){return!!e&&!!t&&e===t}(t.element,Hg.element),u=!!r&&Hg.elementKey===r,l=!Hg.pageKey||Hg.pageKey===Eg,d=eb(),c=l&&!d&&a<Hg.startedAt+2500;return!(!s&&!u&&(l&&"focus"===t.reason&&t.element&&Hg.element!==t.element||"low"!==n&&!c)&&(wy(),1))}(r,o,s))return!1;if(o.interrupt&&rb(o.transactionId,!1),gg)return Vy(r,o),!0;var u=function(e){var t;return"manual"!==(null!==(t=e.reason)&&void 0!==t?t:"manual")&&e.element?Ry()||Ly()?"programmatic":"accessibility-label":"programmatic"}(o);Yg("speakText:owner",{owner:u,reason:o.reason,element:Jg(o.element)});var l,d,c="programmatic"===u?function(){if(!By())return null;var e=Ly(),t=Ry();return Yy.isAvailable()?(Yg("resolveTtsEngine:selected",{engine:"vizio-chromevox"}),Yy):e?null:Ky.isAvailable()?(Yg("resolveTtsEngine:selected",{engine:"webos-luna-tts"}),Ky):Xy.isAvailable()?(Yg("resolveTtsEngine:selected",{engine:"web-speech"}),Xy):(Yg("tts engine unavailable",{webos:t,vizio:e}),null)}():null;(Yg("speakText:engine",{engine:null!==(i=null==c?void 0:c.name)&&void 0!==i?i:null,owner:u}),"composite"===o.reason&&o.transactionId&&o.element&&function(e){return"accessibility-label"===e||Ry()}(u))&&vy(o.element,r,null!==(l=o.focusPath)&&void 0!==l?l:[]);if("accessibility-label"===u)return"focus"===o.reason&&o.element&&o.element.setAttribute("aria-label",r),o.transactionId&&(null===(d=Ng)||void 0===d?void 0:d.id)===o.transactionId&&(Ng.status="started"),ab(r,o,s),!0;if(!c)return function(e,t){if(!Ly()||pg)return!1;var n=Date.now(),i=()=>{var a;Cg=null,t.transactionId&&Ng&&Ng.id!==t.transactionId||(Wy()?Qy(e,t):Date.now()-n>=8e3?t.transactionId&&(null===(a=Ng)||void 0===a?void 0:a.id)===t.transactionId&&(Ng.status="cancelled",Ng=null):Cg=setTimeout(i,250))};return Ey(),Cg=setTimeout(i,250),!0}(r,o)?(ab(r,o,s),!0):(qg(),!1);var h=c.speak(r,o);if(Yg("speakText:engine-result",{engine:c.name,accepted:h,reason:o.reason,transactionId:o.transactionId}),h)return ab(r,o,s),h;if(!o.element)return h;var m=vy(o.element,r,null!==(a=o.focusPath)&&void 0!==a?a:[]);return Yg("speakText:aria-label-fallback",{engine:c.name,accepted:m,reason:o.reason}),m&&ab(r,o,s),m}function ub(e){var t=e.component;return e.hasAttribute("data-nami-primary-cta")||!0===(null==t?void 0:t.focused)||"productButton"===(null==t?void 0:t.namiComponentType)}function lb(e){var t,n=null===(t=e.getAttribute("role"))||void 0===t?void 0:t.toLowerCase();return"button"===e.tagName.toLowerCase()||"button"===n||e.matches("nami-button,nami-play-pause-button,nami-volume-button,nami-toggle-button")}function db(e){return Qg(e).replace(/(?:,\s*)?\bbutton\b\s*$/i,"").trim()||Qg(e)}function cb(e){return Qg(e.innerText||e.textContent||"")}function hb(e){if(!e)return"";if(fy(e)){var t=function(e){var t=jg.get(e);return t?Qg(t["aria-label"]||e.getAttribute("title")||""):""}(e);if(t)return t;var n=mb(e.component);if(n)return n}var i=e.getAttribute("data-tts-spoken-label");if(i)return Qg(i);var a=mb(e.component);if(a)return a;var r=e.getAttribute("aria-label")||e.getAttribute("title");return r?Qg(r):cb(e)}function mb(e){var t=vb(e,wg);if(!t)return"";var n=t,i=Qg(fb(n.speechLabel)||fb(n.speech_label)||fb(n.screenreaderText)||fb(n.title)||fb(n.alt)||fb(n.text)||(Array.isArray(n.texts)?n.texts.map(e=>fb(e)).join(", "):""));if(i)return i;for(var a,r=h(gb(n));!(a=r()).done;){var o=mb(a.value);if(o)return o}return""}function fb(e,t=wg){return t?ng(t,e):e}function vb(e,t){if(!e||e.hidden)return null;var n=e;if("condition"===n.component)return t&&eg(t,n)?e:null;if(n.conditionAttributes&&t){var i=tg(t,n);return i.hidden?null:i}return e}function pb(e,t){if(Yg("applySpeechAttributes:enter",{element:Jg(e),label:t,activeComposite:fy(e)}),!fy(e)){var n=Qg(t),i=function(e,t){var n=Qg(t);return n?lb(e)?db(n):n:""}(e,t);if(!i)return e.removeAttribute("data-tts-spoken-label"),void e.removeAttribute("aria-label");n?e.setAttribute("data-tts-spoken-label",n):e.removeAttribute("data-tts-spoken-label"),e.setAttribute("aria-label",function(e,t){return lb(e)?db(t):Qg(t)}(e,i))}}function gb(e){for(var t=[],n=0,i=["components","playingComponents","pausedComponents","mutedComponents","volumeComponents","productBaseComponents","productFeaturedComponents"];n<i.length;n++){var a=null==e?void 0:e[i[n]];Array.isArray(a)&&t.push(...a)}return null!=e&&e.collapseHeader&&(Array.isArray(e.collapseHeader)?t.push(...e.collapseHeader):t.push(e.collapseHeader)),t}function yb(e,t,n){var i=vb(e,wg);if(i&&!function(e){var t=vb(e,wg);if(!t)return!1;var n=t,i=String(n.component||n.namiComponentType||"").toLowerCase();return-1!==i.indexOf("button")||-1!==i.indexOf("toggle")||-1!==i.indexOf("checkbox")||-1!==i.indexOf("radio")||-1!==i.indexOf("select")||-1!==i.indexOf("input")||!!n.onTap||!!n.sku||!0===n.focused}(i)){var a=function(e){var t=vb(e,wg);if(!t)return"";var n=t;switch(t.component){case"text":case"countdownTimerText":return ey(fb(n.screenreaderText)||fb(n.text));case"text-list":return Array.isArray(n.texts)?ey(n.texts.map(e=>fb(e)).join(", ")):"";case"videoUrl":case"progressBar":return Qg(fb(n.screenreaderText));default:return""}}(i);ty(t,a),gb(i).forEach(e=>yb(e,t))}}function bb(e,t){var n=[];if(!e)return n;var i=e;return[i.header,i.contentContainer,i.footer,i.backgroundContainer,i.components].forEach(e=>{Array.isArray(e)?e.forEach(e=>yb(e,n)):yb(e,n)}),n}function wb(e,t){var n=bb(e),i=function(e){if(!e)return"";var t=mb(e.component),n=e.getAttribute("aria-label")||e.getAttribute("title")||cb(e),i=Qg(t||n);return i?lb(e)&&!/\bbutton\b\s*$/i.test(i)?Qg(`${i} button`):i:""}(t);return iy(ny(n,i?[i]:[]))}function kb(e){return e?Zg(`${Qg(e.id||e.name||"")}|${iy(ny(bb(e),[]))}`):""}function Sb(){return Pg}function Eb(e,t=null){!function(){if(null===Vg&&null===Kg){var e=navigator.userAgentData;"function"==typeof(null==e?void 0:e.getHighEntropyValues)?Kg=e.getHighEntropyValues(["platform","model"]).then(e=>{var t,n,i=(null!==(t=e.platform)&&void 0!==t?t:"").toLowerCase(),a=(null!==(n=e.model)&&void 0!==n?n:"").toLowerCase();Vg=i.includes("xbox")||a.includes("xbox"),Yg("xbox client hints resolved",{platform:i,model:a,result:Vg})}).catch(()=>{Vg=!1}).finally(()=>{Kg=null}):Vg=!1}}(),Yg("setActivePage:enter",{nextKey:kb(e),previousKey:Eg,activePageAnnounced:Sg,pageName:Qg((null==e?void 0:e.name)||(null==e?void 0:e.id)||"")});var n=Eg;bg=e,wg=t,function(e){var t=kb(e);if(t!==Eg){var n=!Eg&&!!Rg;Sg=!1,Eg=t,Pg=n,Rg=null,Fg=""}}(e),n!==Eg&&rb(void 0,!1)}function Pb(e,t){if(Yg("prepareInitialComposite:enter",{element:Jg(e),activePageKey:Eg,activePageAnnounced:Sg,blockedByNavigation:Sb(),label:hb(e),isPrimary:ub(e)}),!bg||Sg||!ub(e)||Sb())return Yg("prepareInitialComposite:skip",{hasActivePage:!!bg,activePageAnnounced:Sg,isPrimary:ub(e),blockedByNavigation:Sb()}),!1;var n=wb(bg,e);if(!n)return!1;var i=hy(e,t),a=function(e,t,n){var i={id:$g++,reason:e,element:n,text:t,page:bg,status:"pending"};return Ng=i,i}("composite",n,e);Sg=!0,Rg=e,Fg=nb(e);var r,o=sb(n,{reason:"composite",interrupt:!0,transactionId:a.id,element:e,focusPath:i,priority:"high"});o||(Sg=!1,(null===(r=Ng)||void 0===r?void 0:r.id)===a.id&&(Ng.status="cancelled",Ng=null));return o}function Tb(e,t){Yg("preparePrimaryCtaCompositeFocus:enter",{element:Jg(e),label:hb(e),activePageKey:Eg,activePageAnnounced:Sg});var n=Pb(e,t);return Yg("preparePrimaryCtaCompositeFocus:result",{result:n,activePageKey:Eg,activePageAnnounced:Sg}),n}function Mb(e){Yg("handleNativeFocusIn:enter",{target:e.target instanceof Element?Jg(e.target):String(e.target),activePageKey:Eg,activePageAnnounced:Sg});var t=function(e){for(var t,n=null,i=h("function"==typeof e.composedPath?e.composedPath():[]);!(t=i()).done;){var a=t.value;if(a instanceof Element&&hb(a)){if(a.tagName.toLowerCase().startsWith("nami-"))return a;n||(n=a)}}return null!=n?n:e.target instanceof Element?e.target:null}(e);t&&_b(t,e)}function _b(e,t){if(Yg("handleFocusedElementForSpeech:enter",{element:Jg(e),label:hb(e),ttsEnabled:hg,runtime:jy(),activePageKey:Eg,activePageAnnounced:Sg,lastFocused:Jg(Rg),lastFocusedElementIdentity:Fg}),!e)return Yg("handleFocusedElementForSpeech:skip-basic",{hasElement:!!e,ttsEnabled:hg}),!1;if(!By())return!1;var n=nb(e);if(Hg&&Hg.pageKey===Eg&&Date.now()<Hg.startedAt+2500){var i=Hg.element===e,a=!!n&&Hg.elementKey===n;if(!eb()&&(i||a))return Yg("handleFocusedElementForSpeech:skip-during-initial-composite-lock",{element:Jg(e),sameCompositeElement:i,sameCompositeElementKey:a}),!1;var r=hb(e),o=r?tb(r):"";if(!eb()&&o&&Hg.textKey.includes(o))return Yg("handleFocusedElementForSpeech:skip-composite-contained-label-during-initial-lock",{element:Jg(e),labelPreview:r.slice(0,120),transactionId:Hg.transactionId}),Rg=e,Fg=n,!1}if(Rg===e||n&&n===Fg&&!Sg)return Yg("handleFocusedElementForSpeech:skip-same-element",{element:Jg(e),activePageAnnounced:Sg,elementIdentity:n,lastFocusedElementIdentity:Fg}),!1;if(!Sg&&bg&&ub(e)&&!Rg&&!Sb())return Pb(e,t);var s=hb(e);if(!s)return!1;if(Hg){var u=tb(s),l=Hg.textKey;if(!eb()&&(u===l||u.includes(l)))return Yg("handleFocusedElementForSpeech:skip-active-composite-label",{element:Jg(e),labelPreview:s.slice(0,120),transactionId:Hg.transactionId}),Rg=e,Fg=n,!1}return Rg=e,Fg=n,Mg&&clearTimeout(Mg),Mg=setTimeout(()=>{Mg=null,Rg===e&&sb(s,{reason:"focus",interrupt:!0,element:e,focusPath:hy(e,t),priority:"normal"})},120),!0}function Ab(e=document){var t;if(Yg("attachFocusSpeechListeners:enter",{root:e instanceof Element?Jg(e):e instanceof DocumentFragment?"document-fragment":"document",runtime:jy()}),Db(),!By())return Yg("focus speech listeners not attached: non-CTV runtime"),Db;var n,i=e=>Mb(e),a=()=>(Yg("handleUserNavigationKey",{activePageKey:Eg,activePageAnnounced:Sg}),Og=Date.now(),void(Pg=!0));e.addEventListener("focusin",i,!0),e.addEventListener("keydown",a,!0);var r=window;if("undefined"!=typeof window&&null!==(t=r.TVJS)&&void 0!==t&&t.DirectionalNavigation){var o=r.TVJS.DirectionalNavigation;n=o.onfocuschanged,o.onfocuschanged=e=>{var t;null===(t=n)||void 0===t||t.call(o,e),function(e){var t,n=null===(t=e.detail)||void 0===t?void 0:t.nextFocusElement;n&&_b(n,e)}(e)}}return Tg={root:e,focusListener:i,keyListener:a,previousTvjsHandler:n},Db}function Db(){var e;if(Yg("detachFocusSpeechListeners:enter",{hasCleanup:!!Tg}),Tg){var t=Tg,n=t.root,i=t.focusListener,a=t.keyListener,r=t.previousTvjsHandler;n.removeEventListener("focusin",i,!0),a&&n.removeEventListener("keydown",a,!0);var o=window;null!==(e=o.TVJS)&&void 0!==e&&e.DirectionalNavigation&&r&&(o.TVJS.DirectionalNavigation.onfocuschanged=r),Tg=null}}function xb(){var e;Yg("resetScreenreaderState:enter",{activePageKey:Eg,activePageAnnounced:Sg,activeTransaction:null===(e=Ng)||void 0===e?void 0:e.id,lastFocused:Jg(Rg)}),Db(),yg=null,gg=!1,bg=null,wg=null,kg=null,Sg=!1,Eg="",Pg=!1,Rg=null,Fg="",Og=0,Gg=null,wy(),by(),ky(),Sy(),Ey(),My(),Mg&&(clearTimeout(Mg),Mg=null),yy("reset"),ay(),Ng=null}var Cb=function(){return c(function t(n,i,a="",r=""){var s;o(this,t),this.playing=!1,this.toggling=!1,this.handleVideoEvents=t=>{this.video.onended=()=>{Uy(!1),this.handlePlayerAnalytics(t,e.NamiPaywallAction.VIDEO_ENDED)},this.video.onpause=()=>{Uy(!1),this.toggling||this.handlePlayerAnalytics(t,e.NamiPaywallAction.VIDEO_PAUSED)},this.video.onplay=()=>{Uy(!this.video.muted),this.toggling||this.handlePlayerAnalytics(t,this.video.currentTime>.05?e.NamiPaywallAction.VIDEO_RESUMED:e.NamiPaywallAction.VIDEO_STARTED)},this.video.onvolumechange=()=>{this.toggling||(this.muted=this.video.muted,Uy(!this.video.paused&&!this.video.ended&&!this.muted),this.handlePlayerAnalytics(t,this.muted?e.NamiPaywallAction.VIDEO_MUTED:e.NamiPaywallAction.VIDEO_UNMUTED))}},this.removeVideoEvents=()=>{this.video&&(Uy(!1),this.video.onended=null,this.video.onpause=null,this.video.onplay=null,this.video.onvolumechange=null,this.toggling=!1)},this.video=null!=i?i:this.video,null!==(s=t.instance)&&void 0!==s&&s.videoSrc&&i.src!=t.instance.videoSrc&&this.handlePlayerAnalytics(n,e.NamiPaywallAction.VIDEO_CHANGED),this.videoSrc=i.src,this.video&&(this.muteByDefault=i.muted,this.loopVideo=i.loop,this.autoplayVideo=i.autoplay,this.muted=this.video.muted,this.videoComponentName=a,this.videoComponentId=r,this.playing=!(!(this.video.currentTime>0)||this.video.paused||this.video.ended),Uy(this.playing&&!this.video.muted),this.handleVideoEvents(n))},[{key:"togglePlayVideo",value:function(e){this.toggling=!0,this.playing?this.video.pause():this.video.play(),this.playing=!this.playing,this.handlePlayerAnalytics(e)}},{key:"toggleMuteVideo",value:function(t){this.toggling=!0,this.video.muted=!this.video.muted,this.muted=this.video.muted,this.handlePlayerAnalytics(t,this.muted?e.NamiPaywallAction.VIDEO_MUTED:e.NamiPaywallAction.VIDEO_UNMUTED)}},{key:"videoPlayingAction",value:function(){var t,n;return(null===(t=this.video)||void 0===t?void 0:t.currentTime)<=0?e.NamiPaywallAction.VIDEO_STARTED:this.video.paused?e.NamiPaywallAction.VIDEO_PAUSED:this.video.ended?e.NamiPaywallAction.VIDEO_ENDED:(null===(n=this.video)||void 0===n?void 0:n.currentTime)>.05?e.NamiPaywallAction.VIDEO_RESUMED:e.NamiPaywallAction.UNKNOWN}},{key:"handlePlayerAnalytics",value:function(e,t){if(this.video){var n={id:this.videoComponentId,name:this.videoComponentName,url:this.video.src,loopVideo:this.loopVideo,muteByDefault:this.muteByDefault,autoplayVideo:this.autoplayVideo,contentDuration:this.video.duration/1e3,contentTimecode:this.video.currentTime/1e3};Ou.getInstance().emit(Vn,{action:null!=t?t:this.videoPlayingAction(),videoMetaData:n,timeSpentOnPaywall:sg(e)})}}}])}();Cb.instance=null;var Ib=({onTap:t,sku:n,componentChange:i,contextProvider:a}={})=>{var r,o,s,u,l,d,c,h,f,v,p,g=e.NamiPaywallAction.UNKNOWN;switch(null==t?void 0:t.function){case kf:g=e.NamiPaywallAction.CLOSE_PAYWALL,p=sg(a),Lb(),null===(r=Cb.instance)||void 0===r||r.handlePlayerAnalytics(a,e.NamiPaywallAction.VIDEO_ENDED);break;case Ef:g=e.NamiPaywallAction.RESTORE_PURCHASES,Rb();break;case Tf:g=e.NamiPaywallAction.SIGN_IN,Fb();break;case Ff:Ob(null===(o=t.parameters)||void 0===o?void 0:o.url);break;case _f:n&&(g=e.NamiPaywallAction.BUY_SKU,n=$b(a,t,n));break;case $f:g=e.NamiPaywallAction.PAGE_CHANGE,i={name:null==t||null===(s=t.parameters)||void 0===s?void 0:s.screen},Nb(a,null==t||null===(u=t.parameters)||void 0===u?void 0:u.screen);break;case Df:g=e.NamiPaywallAction.TOGGLE_CHANGE,i=Wb(a,null==t||null===(l=t.parameters)||void 0===l?void 0:l.formId,null==t||null===(d=t.parameters)||void 0===d?void 0:d.value);break;case Cf:n&&(g=e.NamiPaywallAction.SELECT_SKU,jb(a,n));break;case Lf:n&&(g=e.NamiPaywallAction.PURCHASE_SELECTED_SKU,Bb(a,n));break;case Wf:break;case Bf:null===(c=Cb.instance)||void 0===c||c.togglePlayVideo(a);break;case Uf:null===(h=Cb.instance)||void 0===h||h.togglePlayVideo(a);break;case Gf:null===(f=Cb.instance)||void 0===f||f.toggleMuteVideo(a);break;case Kf:null===(v=Cb.instance)||void 0===v||v.toggleMuteVideo(a)}g!==e.NamiPaywallAction.UNKNOWN&&Ou.getInstance().emit(Vn,m({},a.getPaywallActionEventData(),{action:g,sku:n,timeSpentOnPaywall:p,componentChange:i,purchaseError:void 0,purchases:void 0}))},Lb=()=>{ob(),Fr.clearLaunchId(),zb(e.NamiPaywallManagerEvents.Close)||"undefined"==typeof window||window.history.back()},Rb=()=>{var t=Ds(Pe.THIRD_PARTY_TRANSACTIONS);zb(e.NamiPaywallManagerEvents.Restore)||t||ui.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior.")},Fb=()=>{zb(e.NamiPaywallManagerEvents.SignIn)},Ob=t=>{t?zb(e.NamiPaywallManagerEvents.DeeplinkAction,t)||"undefined"!=typeof window&&window.open(t,"_blank"):ui.debug("Paywall deep link action invoked, but no url present.")},$b=(t,n,i)=>{var a,r=null===(a=n.parameters)||void 0===a?void 0:a.promo,o=i;if(r)ui.debug(`promo id is not null ${null==i?void 0:i.id}`),o.promoId=r.toString();else{ui.debug(`promo id is null for ${i.id}, product details: ${JSON.stringify(i.productDetails)}`);var s=i.productDetails;if(Xf(null==s?void 0:s.product_type)){var u=function(e){return e.offers.find(e=>"promo"===e.offer_type&&0===e.price)}(s);if(u&&u.offer_ref_id)ui.debug(`Found a free trial offer ${u.offer_ref_id}`),o.promoId=u.offer_ref_id.toString();else{var l,d=s.offers[0];if(d)ui.debug(`Found an offer ${d.offer_ref_id}`),o.promoId=null===(l=d.offer_ref_id)||void 0===l?void 0:l.toString()}}}return function(t,n){if(Ds(Pe.THIRD_PARTY_TRANSACTIONS)){if(Fr.setPurchaseImpression(),Ou.getInstance().listenerCount(e.NamiPaywallManagerEvents.BuySku)<=0)return void ui.warn("In order for Nami to hand off the purchase so the transaction can be handled by, you must register a NamiBuySkuHandler callbackwith NamiPaywallManager.registerBuySkuHandler.");ui.info(`Handing off purchase for processing by developer skuId=${n.skuId} promoId=${n.promoId}`),zb(e.NamiPaywallManagerEvents.BuySku,n)}else{var i=function(e){if(Cs("NamiPurchaseManager.buySKU")){var t=Fr.getCachedProducts(),n=null==t?void 0:t.find(t=>t.sku_ref_id==e);return{success:!!n,billingResponseCode:n?0:-999}}}(n.skuId);if(i&&(ui.info(`Purchase flow completed, success=${i.success}, code=${i.billingResponseCode}, message=${i.message}`),i.success)){var a;Ou.getInstance().emit(Vn,{action:e.NamiPaywallAction.CLOSE_PAYWALL,sku:n,timeSpentOnPaywall:sg(t)}),null===(a=Cb.instance)||void 0===a||a.handlePlayerAnalytics(t,e.NamiPaywallAction.VIDEO_ENDED);var r=t.getSelectedCampaign();r&&r.conversion_event_type==th.IN_APP&&r.conversion_event_url?(Fr.clearLaunchId(),window.location.href=r.conversion_event_url):Lb()}}}(t,o),o},Nb=(e,t)=>{var n;t&&((null===(n=window.history.state)||void 0===n?void 0:n.prevUrl)==t?window.history.back():e.setCurrentPage(t))},Wb=(e,t,n)=>{if(t)return e.setCurrentFormId(t,n),{formId:t,value:n};var i=e.getCurrentGroupId(),a=e.getCurrentGroupName();return e.setCurrentGroupData(i,a),{id:i,name:a}},jb=(e,t)=>{var n=e.getCurrentGroupId(),i=e.selectedProducts();n&&t.id!=i[n]&&(i[n]=t.id,e.setSelectedProducts(i))},Bb=(e,t)=>{e.setPurchase(!0,t)};function zb(e,...t){var n=Ou.getInstance();return n.emit(e,...t),n.listenerCount(e)>0}var Ub,Hb,Gb,Vb,Kb,Xb,Yb,qb,Jb,Qb,Zb,ew=e=>e,tw=bh.NamiFlowManager,nw=250,iw=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t)).pages=[],a.currentOffset=0,a.presentationStyle="fullscreen",a._sheetEntranceActive=!0,a.formFactor=ou(),a.timeSpentOnPaywall=0,a.animation={transition:"none",direction:"forward"},a._originalBodyStyles={},a._originalDocumentStyles={},a._savedScrollY=0,a._sheetDragStartY=0,a._sheetIsDragging=!1,a._dismissThreshold=100,a._boundHandleKeyDownEvent=e=>a.handleKeyDownEvent(e),a._stylesAlreadySaved=!1,a.type=e,a.value=n,a.context=i,a.setPaywallData(),a.presentationStyle=a.getPresentationStyle(a.paywall),a.applyPresentationHostClasses(),b(a,a)}return p(t,e),c(t,[{key:"applyPresentationHostClasses",value:function(){this.classList.toggle("nami-half-sheet-mode",this.isOverlaySheet),this.classList.toggle("nami-modal-mode",this.isModal),this.classList.toggle("nami-modal-phone",this.isModal&&"phone"===this.formFactor),this.classList.toggle("nami-modal-wide",this.isModal&&"phone"!==this.formFactor)}},{key:"setPaywallData",value:function(){var e=Su(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"getPresentationStyle",value:function(e){var t,n,i,a,r=null!==(t=null==e||null===(n=e.template)||void 0===n||null===(n=n.initialState)||void 0===n?void 0:n.presentationStyle)&&void 0!==t?t:null==e||null===(i=e.template)||void 0===i||null===(i=i.initialState)||void 0===i?void 0:i.presentation_style;return(a=r)&&Kd.has(a)?a:"fullscreen"}},{key:"isHalfSheet",get:function(){return"compact_sheet"===this.presentationStyle}},{key:"isSheet",get:function(){return"sheet"===this.presentationStyle}},{key:"isOverlaySheet",get:function(){return this.isHalfSheet||this.isSheet}},{key:"isModal",get:function(){return"modal"===this.presentationStyle}},{key:"isOverlay",get:function(){return this.isOverlaySheet||this.isModal}},{key:"connectedCallback",value:function(){var e;T(t,"connectedCallback",this,3)([]),null!==(e=window.TVJS)&&void 0!==e&&e.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),this._detachFocusSpeechListeners=Ab(this),document.addEventListener("keydown",this._boundHandleKeyDownEvent),this._swipeHandler=yf(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var e,n,i;T(t,"disconnectedCallback",this,3)([]),ob(),null===(e=this._detachFocusSpeechListeners)||void 0===e||e.call(this),this._detachFocusSpeechListeners=void 0,xb(),Fr.clearLaunchId(),null!==(n=window.TVJS)&&void 0!==n&&n.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this._boundHandleKeyDownEvent),Ou.getInstance().removeAllListeners(Vn),this.restoreStyles(),null===(i=this._halfSheetAbortController)||void 0===i||i.abort(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){this._stylesAlreadySaved||(this._stylesAlreadySaved=!0,this._originalBodyStyles.background=document.body.style.background,this._originalBodyStyles.overflow=document.body.style.overflow||null,this._originalBodyStyles.position=document.body.style.position||null,this._originalBodyStyles.top=document.body.style.top||null,this._originalBodyStyles.width=document.body.style.width||null,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior||null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior||null)),"television"===this.formFactor&&(document.body.style.overflow="hidden"),"phone"===this.formFactor&&(document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none",this.isOverlay||(document.body.style.overflow="hidden")),this.isOverlay&&(this._savedScrollY=window.scrollY,document.body.style.position="fixed",document.body.style.top=`-${this._savedScrollY}px`,document.body.style.width="100%",document.body.style.overflow="hidden")}},{key:"restoreStyles",value:function(){Object.entries(this._originalBodyStyles).forEach(([e,t])=>{null!==t?document.body.style.setProperty(e,t):document.body.style.removeProperty(e)}),Object.entries(this._originalDocumentStyles).forEach(([e,t])=>{null!==t?document.documentElement.style.setProperty(e,t):document.documentElement.style.removeProperty(e)}),this._savedScrollY>0&&(window.scrollTo(0,this._savedScrollY),this._savedScrollY=0)}},{key:"handleKeyDownEvent",value:function(e){(10009===e.keyCode||27===e.keyCode||166===e.keyCode||196===e.keyCode||"Backspace"===e.key||"GoBack"===e.key||"BrowserBack"===e.key||"XF86Back"===e.key)&&(e.preventDefault(),ob(),this.flow?this.flow.triggerActions(dc):this.isModal&&this.animateSheetDismiss().then(()=>Lb()))}},{key:"handleBackdropClick",value:function(e){var t;(e.stopPropagation(),this.flow)?null!==(t=this.flow.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==t&&t?this.flow.triggerActions("__swipe_down__"):this.animateSheetDismiss().then(()=>{var e;null===(e=this.flow)||void 0===e||e.finished(),Lb()}):this.animateSheetDismiss().then(()=>Lb())}},{key:"animateSheetDismiss",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return n=this.shadowRoot,i=null!==(e=null==n?void 0:n.querySelector(".nami-half-sheet-container"))&&void 0!==e?e:null==n?void 0:n.querySelector(".nami-modal-container"),r=null!==(t=null==n?void 0:n.querySelector(".nami-half-sheet-backdrop"))&&void 0!==t?t:null==n?void 0:n.querySelector(".nami-modal-backdrop"),i&&i.classList.add("nami-dismissing"),r&&r.classList.add("nami-dismissing"),o.n=1,a(new Promise(e=>setTimeout(e,200)));case 1:return o.a(2)}},null,this,null,Promise)}},{key:"handleSwipeEvent",value:function({direction:e}){var t;if("down"===e)null===(t=this.flow)||void 0===t||t.triggerActions("__swipe_down__");else if("up"===e){var n;null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_up__")}}},{key:"setupHalfSheetDragTracking",value:function(){var e,t,n;null===(e=this._halfSheetAbortController)||void 0===e||e.abort(),this._halfSheetAbortController=new AbortController;var i=this._halfSheetAbortController.signal,a=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"),r=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-half-sheet-content");if(a&&r){a.addEventListener("touchstart",e=>{r.scrollTop>0||(this._sheetDragStartY=e.touches[0].clientY,this._sheetIsDragging=!0)},{passive:!0,signal:i}),a.addEventListener("touchmove",e=>{if(this._sheetIsDragging){var t=e.touches[0].clientY-this._sheetDragStartY;t>0&&(a.style.transform=`translateY(${t}px)`,a.style.transition="none",e.preventDefault())}},{passive:!1,signal:i}),a.addEventListener("touchend",()=>{if(this._sheetIsDragging){this._sheetIsDragging=!1;var e,t,n=a.style.transform.match(/translateY\((\d+(?:\.\d+)?)px\)/);if((n?parseFloat(n[1]):0)>this._dismissThreshold)if(null!==(e=null===(t=this.flow)||void 0===t?void 0:t.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==e&&e){var i;a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out",null===(i=this.flow)||void 0===i||i.triggerActions("__swipe_down__")}else{var r;a.style.transform="translateY(100%)",a.style.transition="transform 0.2s ease-in";var o=null===(r=this.shadowRoot)||void 0===r?void 0:r.querySelector(".nami-half-sheet-backdrop");o&&o.classList.add("nami-dismissing"),setTimeout(()=>{var e;null===(e=this.flow)||void 0===e||e.finished()},200)}else a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out"}},{signal:i})}}},{key:"setupHalfSheetFocusTrap",value:function(){var e,t,n,i,a=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"))&&void 0!==e?e:null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-modal-container");if(a){a.focus();var r=null===(i=this._halfSheetAbortController)||void 0===i?void 0:i.signal;a.addEventListener("keydown",e=>{if("Tab"===e.key){var t=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0!==t.length){var n,i,r=t[0],o=t[t.length-1];if(e.shiftKey)document.activeElement!==r&&(null===(n=this.shadowRoot)||void 0===n?void 0:n.activeElement)!==r||(e.preventDefault(),o.focus());else document.activeElement!==o&&(null===(i=this.shadowRoot)||void 0===i?void 0:i.activeElement)!==o||(e.preventDefault(),r.focus())}}},r?{signal:r}:void 0)}}},{key:"firstUpdated",value:function(){var e;this.timeSpentOnPaywall=Date.now(),null===(e=this._detachFocusSpeechListeners)||void 0===e||e.call(this),this._detachFocusSpeechListeners=Ab(this.renderRoot),Bs(this.campaign)&&(this.flow=tw.instance.presentFlow(this.campaign,this,this.context)),this.isOverlay&&this.updateComplete.then(()=>{this.isOverlaySheet&&this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()})}},{key:"updated",value:function(e){if(T(t,"updated",this,3)([e]),e.has("presentationStyle")){var n=e.get("presentationStyle");("compact_sheet"===n||"sheet"===n||"modal"===n)!==this.isOverlay&&(this.restoreStyles(),this._stylesAlreadySaved=!1,this.setOriginalStyles()),this.isOverlay&&(this.isOverlaySheet&&this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap())}}},{key:"getAnimationStyles",value:function(e){var t="backward"===this.animation.direction?-1:1;switch(this.animation.transition){case"verticalSlide":return`transform: translateY(${100*(e-this.currentOffset)*t}vh);`;case"slide":return`transform: translateX(${100*(e-this.currentOffset)*t}vw);`;case"fade":return`opacity: ${e===this.currentOffset?1:0};`;default:return""}}},{key:"updatePages",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){r.n=1;break}return this.pages=[e],r.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){r.n=2;break}return r.a(2);case 2:return n=null,this.isOverlaySheet&&(n=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(".nami-half-sheet-content"))&&(n.style.height=`${n.clientHeight}px`),this.pages=[t,e],this.currentOffset=0,r.n=3,a(this.updateComplete);case 3:requestAnimationFrame(()=>{this.currentOffset=1,setTimeout(()=>{this.pages=[e],this.currentOffset=0,this.paywall=e,n&&(n.style.height="")},nw)});case 4:return r.a(2)}},null,this,null,Promise)}},{key:"animateFullscreenEntry",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(new Promise(e=>requestAnimationFrame(()=>e())));case 1:return this.classList.remove("nami-fullscreen-entering"),this.classList.add("nami-fullscreen-entering-active"),e.n=2,a(new Promise(e=>setTimeout(e,nw)));case 2:this.classList.remove("nami-fullscreen-entering-active");case 3:return e.a(2)}},null,this,null,Promise)}},{key:"_captureExitOverlay",value:function(e){var t=this.shadowRoot;if(!t)return null;var n=t.querySelector(".nami-flow-container"),i=document.createElement("div");if(i.className="nami-fullscreen-exit-overlay",i.style.cssText=`\n position: fixed; inset: 0; z-index: 10000;\n pointer-events: none;\n background: ${e};\n overflow: hidden;\n `,n){var a=n.cloneNode(!0);a.style.transform="none",a.style.transition="none",i.appendChild(a)}return t.appendChild(i),i.offsetHeight,i}},{key:"_slideExitOverlayAway",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:if(e){n.n=1;break}return n.a(2);case 1:return t="undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,e.style.transition=t?"none":"transform 250ms ease-in",e.style.transform="translateY(100%)",n.n=2,a(new Promise(e=>setTimeout(e,t?0:nw)));case 2:e.remove();case 3:return n.a(2)}},null,null,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var n,i,r,o,s,u,l,d,c,h,m;return k(function(f){for(;;)switch(f.n){case 0:if(null!==(n=this.flow)&&void 0!==n&&n.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,ac),r=this.presentationStyle,o=this.getPresentationStyle(e),s=0===this.pages.length,u="backward"===t.direction,"compact_sheet"!==r&&"sheet"!==r||"fullscreen"!==o){f.n=3;break}return this.classList.add("nami-fullscreen-entering"),this.presentationStyle="fullscreen",this.applyPresentationHostClasses(),f.n=1,a(this.updateComplete);case 1:return f.n=2,a(this.animateFullscreenEntry());case 2:f.n=11;break;case 3:if("fullscreen"!==r||"compact_sheet"!==o&&"sheet"!==o){f.n=10;break}if(!s&&!u){f.n=8;break}if(!u){f.n=6;break}return l=document.body.style.background||getComputedStyle(this).backgroundColor||"#000",this._sheetEntranceActive=!1,d=this._captureExitOverlay(l),this.presentationStyle=o,this.applyPresentationHostClasses(),this.pages=[e],this.paywall=e,f.n=4,a(this.updateComplete);case 4:return f.n=5,a(this._slideExitOverlayAway(d));case 5:f.n=7;break;case 6:this.presentationStyle=o,this.applyPresentationHostClasses();case 7:f.n=9;break;case 8:console.warn(`Unsupported forward transition: fullscreen → ${o}. Presenting as fullscreen.`);case 9:f.n=11;break;case 10:this.presentationStyle=o,this.applyPresentationHostClasses();case 11:return c=("compact_sheet"===r||"sheet"===r)&&"fullscreen"===o,h="fullscreen"===r&&("compact_sheet"===o||"sheet"===o),m=!("compact_sheet"!==r&&"sheet"!==r||"compact_sheet"!==o&&"sheet"!==o||r===o)||c||h,this.animation=m?{transition:"fade",direction:t.direction}:t,f.n=12,a(this.updatePages(e));case 12:null!==(i=this.flow)&&void 0!==i&&i.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,ic);case 13:return f.a(2)}},null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return nf.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?Pm(Ub||(Ub=ew``)):this.isOverlaySheet?this.renderHalfSheet():this.isModal?this.renderModal(this.renderFlowContainer()):this.renderFlowContainer()}},{key:"renderFlowContainer",value:function(){return Pm(Hb||(Hb=ew`
|
|
254
|
+
`)),Jm=e=>(t,n)=>{void 0!==n?n.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},Qm={attribute:!0,type:String,converter:Qh,reflect:!1,hasChanged:Zh},Zm=(e=Qm,t,n)=>{var i=n.kind,a=n.metadata,r=globalThis.litPropertyMetadata.get(a);if(void 0===r&&globalThis.litPropertyMetadata.set(a,r=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),r.set(n.name,e),"accessor"===i){var o=n.name;return{set(n){var i=t.get.call(this);t.set.call(this,n),this.requestUpdate(o,i,e,!0,n)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===i){var s=n.name;return function(n){var i=this[s];t.call(this,n),this.requestUpdate(s,i,e,!0,n)}}throw Error("Unsupported decorator location: "+i)};function ef(e){return(t,n)=>"object"==typeof n?Zm(e,t,n):((e,t,n)=>{var i=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),i?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function tf(e){return ef(m({},e,{state:!0,attribute:!1}))}var nf=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t,[e,n,i])).host=null,a.defineDynamicStateProps(),a}return p(t,e),c(t,[{key:"hostConnected",value:function(){}},{key:"hostDisconnected",value:function(){this.subscribers.clear()}},{key:"onStateChanged",value:function(){this.defineDynamicStateProps(),this.host&&this.host.requestUpdate()}},{key:"defineDynamicStateProps",value:function(){Object.defineProperty(this.state,"tvQuality",{get:this.getTVQuality.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportWidth",{get:this.getViewportWidth.bind(this),enumerable:!1,configurable:!0}),Object.defineProperty(this.state,"viewportHeight",{get:this.getViewportHeight.bind(this),enumerable:!1,configurable:!0})}},{key:"getTVQuality",value:function(){var e,t;if("television"!==this.getFormFactor())return"";var n=window.devicePixelRatio||1,i=window.innerWidth||(null===(e=window.screen)||void 0===e?void 0:e.availWidth),a=window.innerHeight||(null===(t=window.screen)||void 0===t?void 0:t.availHeight);if(!i||!a)return"720p";var r=Math.max(i,a)*n,o=Math.min(i,a)*n;return r>=3840||o>=2160?"4K":r>=1920||o>=1080?"1080p":"720p"}},{key:"getViewportWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}},{key:"getViewportHeight",value:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}],[{key:"create",value:function(e,n,i){var a=new t(e,n,i);return this.providers.push(a),a}},{key:"remove",value:function(e){this.providers=this.providers.filter(t=>t!==e)}},{key:"currentProvider",get:function(){return this.providers[0]}}])}(Ad),af=2,rf=function(){return c(function e(t){o(this,e)},[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AT",value:function(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}},{key:"_$AS",value:function(e,t){return this.update(e,t)}},{key:"update",value:function(e,t){return this.render(...t)}}])}(),of=jm.I,sf=e=>e,uf=()=>document.createComment(""),lf=(e,t,n)=>{var i=e._$AA.parentNode,a=void 0===t?e._$AB:t._$AA;if(void 0===n){var r=i.insertBefore(uf(),a),o=i.insertBefore(uf(),a);n=new of(r,o,e,e.options)}else{var s,u,l,d=n._$AB.nextSibling,c=n._$AM,h=c!==e;if(h)null!==(s=(u=n)._$AQ)&&void 0!==s&&s.call(u,e),n._$AM=e,void 0!==n._$AP&&(l=e._$AU)!==c._$AU&&n._$AP(l);if(d!==a||h)for(var m=n._$AA;m!==d;){var f=sf(m).nextSibling;sf(i).insertBefore(m,a),m=f}}return n},df=(e,t,n=e)=>(e._$AI(t,n),e),cf={},hf=(e,t=cf)=>e._$AH=t,mf=e=>{e._$AR(),e._$AA.remove()},ff=(e,t,n)=>{for(var i=new Map,a=t;a<=n;a++)i.set(e[a],a);return i},vf=(e=>(...t)=>({_$litDirective$:e,values:t}))(function(e){function t(e){var n;if(o(this,t),n=r(this,t,[e]),e.type!==af)throw Error("repeat() can only be used in text expressions");return n}return p(t,e),c(t,[{key:"dt",value:function(e,t,n){var i;void 0===n?n=t:void 0!==t&&(i=t);for(var a,r=[],o=[],s=0,u=h(e);!(a=u()).done;){var l=a.value;r[s]=i?i(l,s):s,o[s]=n(l,s),s++}return{values:o,keys:r}}},{key:"render",value:function(e,t,n){return this.dt(e,t,n).values}},{key:"update",value:function(e,[t,n,i]){var a,r=(e=>e._$AH)(e),o=this.dt(t,n,i),s=o.values,u=o.keys;if(!Array.isArray(r))return this.ut=u,s;for(var l,d,c=null!==(a=this.ut)&&void 0!==a?a:this.ut=[],h=[],m=0,f=r.length-1,v=0,p=s.length-1;m<=f&&v<=p;)if(null===r[m])m++;else if(null===r[f])f--;else if(c[m]===u[v])h[v]=df(r[m],s[v]),m++,v++;else if(c[f]===u[p])h[p]=df(r[f],s[p]),f--,p--;else if(c[m]===u[p])h[p]=df(r[m],s[p]),lf(e,h[p+1],r[m]),m++,p--;else if(c[f]===u[v])h[v]=df(r[f],s[v]),lf(e,r[m],r[f]),f--,v++;else if(void 0===l&&(l=ff(u,v,p),d=ff(c,m,f)),l.has(c[m]))if(l.has(c[f])){var g=d.get(u[v]),y=void 0!==g?r[g]:null;if(null===y){var b=lf(e,r[m]);df(b,s[v]),h[v]=b}else h[v]=df(y,s[v]),lf(e,r[m],y),r[g]=null;v++}else mf(r[f]),f--;else mf(r[m]),m++;for(;v<=p;){var w=lf(e,h[p+1]);df(w,s[v]),h[v++]=w}for(;m<=f;){var k=r[m++];null!==k&&mf(k)}return this.ut=u,hf(e,h),Mm}}])}(rf));var pf=e=>{var t;return k(function(n){for(;;)if(0===n.n)return t=new Set(Array.from(document.fonts.values()).map(e=>e.family)),e.forEach(e=>{var n=gf(e);if(!t.has(n)){var i=new FontFace(n,`url(${e.file})`);document.fonts.add(i)}}),n.a(2,document.fonts.ready.then())},null,null,null,Promise)};function gf(e){return`${e.family}-${e.style}`.replace(/ /g,"")}function yf(e,t,n){var i,a,r,o,s,u,l,d;if("undefined"==typeof window||!e||!t)return ui.debug("Swipe detection is not supported in this environment."),{destroy(){},updateOptions(){}};var c={minDistance:null!==(i=null==n?void 0:n.minDistance)&&void 0!==i?i:30,maxDuration:null!==(a=null==n?void 0:n.maxDuration)&&void 0!==a?a:600,lockAxis:null===(r=null==n?void 0:n.lockAxis)||void 0===r||r,preventScrollOnSwipe:null!==(o=null==n?void 0:n.preventScrollOnSwipe)&&void 0!==o&&o,pointerTypes:null!==(s=null==n?void 0:n.pointerTypes)&&void 0!==s?s:["touch"],passiveListeners:null===(u=null==n?void 0:n.passiveListeners)||void 0===u||u,axisHint:null!==(l=null==n?void 0:n.axisHint)&&void 0!==l?l:"y",edgeLeakThreshold:null!==(d=null==n?void 0:n.edgeLeakThreshold)&&void 0!==d?d:24},h=e.style.touchAction;c.preventScrollOnSwipe&&(e.style.touchAction="none");var m=null,f=0,v=0,p=0,g=0,y=0,b=null,w=null,k=!1,S=!1,E=!1,P=e=>{try{var t=window.getComputedStyle(e);if(!t)return!1;var n=t.overflowY;if("auto"!==n&&"scroll"!==n)return!1;var i=e;return i.scrollHeight>i.clientHeight}catch(e){return!1}},T=e=>c.pointerTypes.includes(e.pointerType),M=t=>{var n=t.composedPath?t.composedPath()[0]:t.target;if(T(t)&&null===m){m=t.pointerId,f=p=t.clientX,v=g=t.clientY,y=performance.now(),b=null,E=!1,k=!1,S=!1,(w="y"===c.axisHint?((e,t)=>{for(var n=e;n&&n!==t&&n instanceof HTMLElement;){var i,a;if(P(n))return n;n=n.parentElement||(null!==(i=null===(a=n.parentNode)||void 0===a?void 0:a.host)&&void 0!==i?i:null)}return null})(n,e):null)||(S=!0);try{var i;null==e||null===(i=e.setPointerCapture)||void 0===i||i.call(e,t.pointerId)}catch(e){try{var a;null==n||null===(a=n.setPointerCapture)||void 0===a||a.call(n,t.pointerId)}catch(e){}}}},_=e=>{if(e.pointerId===m&&T(e)){if(p=e.clientX,g=e.clientY,c.lockAxis&&!b){var n=Math.abs(p-f),i=Math.abs(g-v);(n>2||i>2)&&(b=i>=n?"y":"x")}if("y"===c.axisHint&&("y"===b||!c.lockAxis)){var a=g-v,r=a<0?"up":"down",o=Math.abs(a),s=performance.now()-y,u=o/Math.max(s,1),l=o>=c.minDistance||u>.5;if(w)if(l)S=!0;else if(((e,t)=>!!e&&("down"===t?e.scrollTop>0:e.scrollTop+e.clientHeight<e.scrollHeight-1))(w,r)){if(!(("down"===r&&w.scrollTop<=50||"up"===r&&w.scrollTop+w.clientHeight>=w.scrollHeight-50)&&u>.3))return void(k=!0);S=!0}else S=!0;var d=!w||o>=c.edgeLeakThreshold;if(!E&&!k&&S&&d&&o>=c.minDistance){E=!0;var h=performance.now(),P={direction:"up"===r?"up":"down",distanceX:p-f,distanceY:a,absX:Math.abs(p-f),absY:o,duration:h-y,velocity:o/Math.max(h-y,1),startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:h,originalEvent:e};t(P)}}}},A=e=>{if(e.pointerId===m)if(T(e))if(w)D();else if(E||k)D();else{var n,i=performance.now(),a=i-y,r=p-f,o=g-v,s=Math.abs(r),u=Math.abs(o),l="x"===(n=c.lockAxis&&b?b:"x"===c.axisHint?"x":"y"===c.axisHint?"y":s>=u?"x":"y")?s:u,d=a<=c.maxDuration,h=c.minDistance;if(w&&"y"===n&&S&&(h+=c.edgeLeakThreshold),d&&l>=h){var P;P="x"===n?r>0?"right":"left":o>0?"down":"up";var M=l/Math.max(a,1);t({direction:P,distanceX:r,distanceY:o,absX:s,absY:u,duration:a,velocity:M,startX:f,startY:v,endX:p,endY:g,startedAt:y,endedAt:i,originalEvent:e})}D()}else D()},D=()=>{m=null,b=null,y=0,w=null,S=!1,k=!1,E=!1},x=!!c.passiveListeners&&{passive:!0},C=c.passiveListeners?{passive:!0,capture:!0}:{capture:!0};e.addEventListener("pointerdown",M,C),e.addEventListener("pointermove",_,x),e.addEventListener("pointerup",A,x),e.addEventListener("pointercancel",A,x),e.addEventListener("lostpointercapture",A,x);return{destroy:()=>{e.removeEventListener("pointerdown",M,C),e.removeEventListener("pointermove",_,x),e.removeEventListener("pointerup",A,x),e.removeEventListener("pointercancel",A,x),e.removeEventListener("lostpointercapture",A,x),c.preventScrollOnSwipe&&(e.style.touchAction=h),D()},updateOptions:t=>{Object.assign(c,t),"boolean"==typeof t.preventScrollOnSwipe&&(t.preventScrollOnSwipe?e.style.touchAction="none":e.style.touchAction=h)}}}var bf={},wf=bf.NAMI_CLOSE_PAYWALL,kf=void 0===wf?"namiClosePaywall":wf,Sf=bf.NAMI_RESTORE_PURCHASES,Ef=void 0===Sf?"namiRestorePurchases":Sf,Pf=bf.NAMI_SIGN_IN,Tf=void 0===Pf?"namiSignIn":Pf,Mf=bf.NAMI_BUY_SKU,_f=void 0===Mf?"namiBuySKU":Mf,Af=bf.SET_STATE,Df=void 0===Af?"setState":Af,xf=bf.NAMI_SELECT_SKU,Cf=void 0===xf?"namiSelectSKU":xf,If=bf.NAMI_PURCHASE_SELECTED_SKU,Lf=void 0===If?"namiPurchaseSelectedSKU":If,Rf=bf.NAMI_DEEP_LINK,Ff=void 0===Rf?"namiDeeplink":Rf,Of=bf.NAMI_NAVIGATE_TO_SCREEN,$f=void 0===Of?"namiNavigateToScreen":Of,Nf=bf.NAMI_RELOAD_PRODUCTS,Wf=void 0===Nf?"namiReloadProducts":Nf,jf=bf.NAMI_PLAY_VIDEO,Bf=void 0===jf?"namiPlayVideo":jf,zf=bf.NAMI_PAUSE_VIDEO,Uf=void 0===zf?"namiPauseVideo":zf,Hf=bf.NAMI_MUTE_VIDEO,Gf=void 0===Hf?"namiMuteVideo":Hf,Vf=bf.NAMI_UNMUTE_VIDEO,Kf=void 0===Vf?"namiUnmuteVideo":Vf,Xf=e=>"subscription"===e;function Yf(e){if(Xf(null==e?void 0:e.product_type)){var t=Jf(e);if(t.length>0)return t[0].billingPeriod}return null}function qf(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return Qf(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function Jf(e){return e?Qf(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function Qf(e,t){return e.map(e=>Zf(e,t))}function Zf(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:nv(m).format(h)}}function ev(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=ll(o),l=ll(s);return a||u!==o||(u=ll(`${r}_abbrev`)),a||l!==s||(l=ll(`${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 tv(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 nv(e){var t={maximumFractionDigits:2,minimumFractionDigits:0};try{return new Intl.NumberFormat(navigator.language,m({},t,{style:"currency",currency:e}))}catch(e){return new Intl.NumberFormat(navigator.language,m({},t,{style:"currency",currency:"USD"}))}}var iv=(e,t,n)=>e&&t&&n?n.format(e-t):null,av=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},rv=(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)}},ov=e=>uv(e.priceAmountMicros)/sv(e.billingPeriod),sv=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},uv=e=>e/1e6;function lv(e){return parseFloat((Math.round(e)/100).toFixed(2))}var dv=(e,t,n=[])=>({price:()=>hv(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>mv(e),durationSingular:()=>mv(e,!0),period:()=>mv(e,!1,!0),periodNumber:()=>mv(e,!1,!1,!0),freeTrialDuration:()=>fv(e),freeTrialDurationSingular:()=>fv(e,!0),freeTrialPeriod:()=>fv(e,!1,!0),freeTrialPeriodNumber:()=>fv(e,!1,!1,!0),pricePerMonth:()=>vv(e),pricePerMonthRounded:()=>vv(e,!0),periodInMonths:()=>pv(e),durationInMonths:()=>gv(e),durationInMonthsSingular:()=>gv(e,!0),periodNumberInMonths:()=>yv(e),percentagePriceDifferenceFromSku:()=>bv(e,t,n),priceDifferenceFromSku:()=>wv(e,t,n),promoEligible:()=>null===kv(e)&&null!==Sv(e,t),freeTrialEligible:()=>null!==kv(e),promo:()=>{var n;return null===(n=Sv(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=Ev(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>Pv(e,t,!1,!0),promoPeriodNumber:()=>Pv(e,t,!1,!1,!0),promoDuration:()=>Pv(e,t),promoDurationSingular:()=>Pv(e,t,!0),introEligible:()=>!1,pricePerDay:()=>Dv(e),pricePerWeek:()=>xv(e),pricePerWeekRounded:()=>xv(e,!0),introductoryPrice:()=>_v(e,t),introductoryPeriod:()=>Mv(e,t,!1,!0),introductoryPeriodNumber:()=>Mv(e,t,!1,!1,!0),introductoryDuration:()=>Mv(e,t),introductoryDurationSingular:()=>Mv(e,t,!0),introductoryPricePerMonth:()=>Av(e,t),introductoryPricePerMonthRounded:()=>Av(e,t,!0),durationAbbrev:()=>mv(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>fv(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>Mv(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>Pv(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>Pv(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>gv(e,!1,!1,!1,!0),durationSingularAbbrev:()=>mv(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>fv(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>Mv(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>Pv(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>Pv(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>gv(e,!0,!1,!1,!0),periodAbbrev:()=>mv(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>fv(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>Mv(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>Pv(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>Pv(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>gv(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?ll("nami_weekly"):2===u?ll("nami_biweekly"):null:s>0?ll(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?ll("nami_yearly"):null}(Yf(e)),iso_subscription_duration:()=>Cv(e),invalid:()=>!1,unavailable:()=>!1}),cv=(e,t,n,i=[])=>{if(!t)return null;var a=dv(t,n,i);return a[e]?a[e]():null},hv=e=>{var t=Jf(e);return t&&t.length?t[0].formattedPrice:null},mv=(e,t,n,i,a)=>ev(Yf(e),t,n,i,a),fv=(e,t,n,i,a)=>ev(qf(e),t,n,i,a),vv=(e,t)=>{var n=Jf(e);if(!n||0===n.length)return null;var i=ov(n[0]);return i?nv(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},pv=(e,t)=>{var n=Jf(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return tv(i)?ev("P1Y"===i?"P12M":i,!1,!1,!1,t):null},gv=(e,t,n,i,a)=>{var r=Jf(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return tv(o)?ev("P1Y"===o?"P12M":o,t,n,i,a):null},yv=e=>{if(!e)return 0;var t=Jf(e);return t&&t.length?sv(t[0].billingPeriod):0},bv=(e,t,n=[])=>{var i,a=Jf(e);if(!a||0===a.length)return null;var r=null===(i=rv(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return av(lv(a[0].priceAmountMicros),yv(e));var o=Jf(r);return av(lv(a[0].priceAmountMicros),yv(e),(null==o?void 0:o.length)>0?lv(o[0].priceAmountMicros):0,yv(r))},wv=(e,t,n=[])=>{var i,a=Jf(e);if(!a||0===a.length)return null;var r=null===(i=rv(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return iv(ov(a[0]));var o=Jf(r);return iv(ov(a[0]),ov(o[0]),nv(o[0].priceCurrencyCode))},kv=e=>qf(e),Sv=(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},Ev=(e,t)=>{if(!e)return null;var n=Sv(e,t);return n?Zf(n,e.subscription_period):null},Pv=(e,t,n,i,a,r)=>{var o=Ev(e,t);return ev((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},Tv=(e,t)=>{if(!e)return null;var n=((e,t)=>{if(!e)return null;var n=e.offers.filter(e=>"intro"===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})(e,t);return n?Zf(n,e.subscription_period):null},Mv=(e,t,n,i,a,r)=>{var o=Tv(e,t);return ev((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},_v=(e,t)=>{var n=Tv(e,t);return n?n.formattedPrice:null},Av=(e,t,n)=>{var i=Tv(e,t);if(!i)return null;var a=ov(i);return a?nv(i.priceCurrencyCode).format(n?Math.round(a):a):null},Dv=e=>{var t=Jf(e);if(!t||0===t.length)return null;var n,i,a=uv(t[0].priceAmountMicros)/(n=t[0].billingPeriod,(i=sv(n))?30.437*i:1);return nv(t[0].priceCurrencyCode).format(a)},xv=(e,t)=>{var n=Jf(e);if(!n||0===n.length)return null;var i,a,r=uv(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=sv(i))?52*a/12:1);return nv(n[0].priceCurrencyCode).format(t?Math.round(r):r)},Cv=e=>{var t=Jf(e)[0];return t?t.billingPeriod:null},Iv="object"==typeof global&&global&&global.Object===Object&&global,Lv="object"==typeof self&&self&&self.Object===Object&&self,Rv=Iv||Lv||Function("return this")(),Fv=Rv.Symbol;var Ov=Array.isArray,$v=Object.prototype,Nv=$v.hasOwnProperty,Wv=$v.toString,jv=Fv?Fv.toStringTag:void 0;var Bv=Object.prototype.toString;var zv=Fv?Fv.toStringTag:void 0;function Uv(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":zv&&zv in Object(e)?function(e){var t=Nv.call(e,jv),n=e[jv];try{e[jv]=void 0;var i=!0}catch(e){}var a=Wv.call(e);return i&&(t?e[jv]=n:delete e[jv]),a}(e):function(e){return Bv.call(e)}(e)}function Hv(e){return null!=e&&"object"==typeof e}var Gv=Fv?Fv.prototype:void 0,Vv=Gv?Gv.toString:void 0;function Kv(e){if("string"==typeof e)return e;if(Ov(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,Kv)+"";if(function(e){return"symbol"==typeof e||Hv(e)&&"[object Symbol]"==Uv(e)}(e))return Vv?Vv.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xv(e){return null==e?"":Kv(e)}function Yv(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:function(e,t,n){var i=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(a);++i<a;)r[i]=e[i+t];return r}(e,t,n)}var qv=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Jv(e){return qv.test(e)}var Qv="\\ud800-\\udfff",Zv="["+Qv+"]",ep="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",tp="\\ud83c[\\udffb-\\udfff]",np="[^"+Qv+"]",ip="(?:\\ud83c[\\udde6-\\uddff]){2}",ap="[\\ud800-\\udbff][\\udc00-\\udfff]",rp="(?:"+ep+"|"+tp+")"+"?",op="[\\ufe0e\\ufe0f]?",sp=op+rp+("(?:\\u200d(?:"+[np,ip,ap].join("|")+")"+op+rp+")*"),up="(?:"+[np+ep+"?",ep,ip,ap,Zv].join("|")+")",lp=RegExp(tp+"(?="+tp+")|"+up+sp,"g");function dp(e){return Jv(e)?function(e){return e.match(lp)||[]}(e):function(e){return e.split("")}(e)}var cp,hp=(cp="toUpperCase",function(e){var t=Jv(e=Xv(e))?dp(e):void 0,n=t?t[0]:e.charAt(0),i=t?Yv(t,1).join(""):e.slice(1);return n[cp]()+i});var mp,fp=(mp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},function(e){return null==mp?void 0:mp[e]}),vp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pp=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var gp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var yp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var bp="\\ud800-\\udfff",wp="\\u2700-\\u27bf",kp="a-z\\xdf-\\xf6\\xf8-\\xff",Sp="A-Z\\xc0-\\xd6\\xd8-\\xde",Ep="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pp="["+Ep+"]",Tp="\\d+",Mp="["+wp+"]",_p="["+kp+"]",Ap="[^"+bp+Ep+Tp+wp+kp+Sp+"]",Dp="(?:\\ud83c[\\udde6-\\uddff]){2}",xp="[\\ud800-\\udbff][\\udc00-\\udfff]",Cp="["+Sp+"]",Ip="(?:"+_p+"|"+Ap+")",Lp="(?:"+Cp+"|"+Ap+")",Rp="(?:['’](?:d|ll|m|re|s|t|ve))?",Fp="(?:['’](?:D|LL|M|RE|S|T|VE))?",Op="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",$p="[\\ufe0e\\ufe0f]?",Np=$p+Op+("(?:\\u200d(?:"+["[^"+bp+"]",Dp,xp].join("|")+")"+$p+Op+")*"),Wp="(?:"+[Mp,Dp,xp].join("|")+")"+Np,jp=RegExp([Cp+"?"+_p+"+"+Rp+"(?="+[Pp,Cp,"$"].join("|")+")",Lp+"+"+Fp+"(?="+[Pp,Cp+Ip,"$"].join("|")+")",Cp+"?"+Ip+"+"+Rp,Cp+"+"+Fp,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tp,Wp].join("|"),"g");function Bp(e,t,n){return e=Xv(e),void 0===t?function(e){return yp.test(e)}(e)?function(e){return e.match(jp)||[]}(e):function(e){return e.match(gp)||[]}(e):e.match(t)||[]}var zp=RegExp("['’]","g");var Up,Hp=(Up=function(e,t,n){return t=t.toLowerCase(),e+(n?hp(Xv(t).toLowerCase()):t)},function(e){return function(e,t,n){for(var i=-1,a=null==e?0:e.length;++i<a;)n=t(n,e[i],i,e);return n}(Bp(function(e){return(e=Xv(e))&&e.replace(vp,fp).replace(pp,"")}(e).replace(zp,"")),Up,"")});function Gp(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=Yp(e,t.sku_ref_id||""),t.variables=function(e,t,n){if(!t)return{};var i=t.variables;if(!i)return m({},t);Object.keys(i).forEach(t=>{if(Vp(i[t])){var a=Xp(i[t],e,n);i[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(a)}});var a={};return(()=>Object.keys(dv({})))().forEach(t=>{if(void 0===i[t]){var r=cv(t,e,void 0,n);null!==r&&(a[t]=r)}}),m({},t,a,i)}(t.product_details,t,r)}),r}function Vp(e){return"string"==typeof e&&e.includes(ni)}function Kp(e,t,n){return t?(Object.keys(t).forEach(i=>{Vp(t[i])&&(t[i]=t[Hp(i)]=Xp(t[i],e,n))}),m({},t)):{}}var Xp=(e,t,n)=>e.replace(Qn,(i,a)=>{var r,o,s,u,l=(null===(r=Qn.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 cv(a,t,d,n)});function Yp(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var qp=["conditionAttributes"];function Jp(e,t){return Array.isArray(e)?e.reduce((e,n)=>{var i=Jp(n,t);return Array.isArray(i)?[...e,...i]:[...e,i]},[]):null==e?e:"object"==typeof e?Object.entries(e).reduce((e,[n,i])=>{var a="newRow"===n?i:Jp(i,t);return m({},e,{[n]:a})},{}):"string"==typeof e?rg(e,t):e}function Qp(e,t,n,i={}){var a=n.productBaseComponents||n.components||[],r=n.productFeaturedComponents||a;return t.map(t=>{var n,o,s,u=t.featured?r:a,l=t.entitlements.map(e=>e.entitlement_ref_id),d=Yp(e.productDetails,t.sku_ref_id),c={freeTrialEligible:1==cv("freeTrialEligible",d),introEligible:1==cv("introEligible",d),promoEligible:1==cv("promoEligible",d),invalid:cv("invalid",d),unavailable:cv("unavailable",d)},f=m({},t,t.variables,c,{id:t.id,entitlements:l});o=t,s=e=>{for(var t,n=h(e);!(t=n()).done;){var i=t.value;i.sku=Id(o),i.components&&s(i.components),i.collapseHeader&&i.collapseHeader.components&&s(i.collapseHeader.components)}},s(u);var v={sku:f,media:ag(i,{convertToUrl:!0})};return[null!==(n=t.featured)&&void 0!==n&&n,Jp(u,Jp(v,v))]},[])}function Zp(e,t){if(!t.loopSource)return[];var n="string"==typeof t.loopSource?JSON.parse(t.loopSource):t.loopSource,i=(null!=n?n:[]).filter(n=>{var i;return!(null!==(i=t.loopSourceConditions)&&void 0!==i&&i.length)||t.loopSourceConditions.every(t=>ig(e,t,n))}),a=t.groupBy,r=t.groupHeaderTemplate,o=e=>Jp(t.components,Jp({block:e},{block:e}));if(!a||!r)return[{key:"",header:null,items:i.map(o).filter(e=>null!=e)}];for(var s,u=[],l=new Map,d=h(i);!(s=d()).done;){var c=s.value,m=Jp(a,Jp({block:c},{block:c})),f=null==m?"":String(m);l.has(f)||(u.push(f),l.set(f,[])),l.get(f).push(c)}return u.map(e=>{var t={key:e};return{key:e,header:[Jp(r,Jp({group:t},{group:t}))],items:l.get(e).map(o)}})}function eg(e,t){return t.assertions?t.assertions.every(ig.bind(null,e)):!!t.orAssertions&&(!t.orAssertions.length||t.orAssertions.some(ig.bind(null,e)))}function tg(e,t){var n=t.conditionAttributes,i=y(t,qp);return n?n.reduce((t,n)=>eg(e,n)?(Object.entries(n.attributes).forEach(([t,i])=>{n.attributes[t]=ng(e,i)}),m({},t,n.attributes)):t,i):i}function ng(e,t,n,i=null){var a,r=null!==(a=null==e?void 0:e.flow)&&void 0!==a?a:{},o=r.manager,s=r.previousStepAvailable,u=r.nextStepAvailable,l=e.state,d={};return i&&(d={block:i}),d=m({},d,{state:l,urlParams:Rc(),flow:{isLaunched:!(null==o||!o.flowOpen),previousStepAvailable:!!s,nextStepAvailable:!!u},launch:l.launch,sku:l.sku,customer:l.customer}),"string"==typeof t&&t.includes(ni)&&(t=rg(t,d)),t}function ig(e,{value:t,expected:n,operator:i},a){if(t=ng(e,t,0,a),n=ng(e,n,0,a),"equals"===i)return t===n;if("notEquals"===i)return t!==n;if("contains"===i){var r;if(Array.isArray(t)||"string"==typeof t||t instanceof String||(t=t.toString()),"collapse"==n)n+="_"+(null===(r=e.getCurrentCollapsibleSku())||void 0===r?void 0:r.skuId);return t.includes(n)}if("notContains"===i)return Array.isArray(t)||"string"==typeof t||t instanceof String||(t=t.toString()),!t.includes(n);if("set"===i){var o=null!=t&&""!==t&&!t.toString().match(ai);return"boolean"==typeof n?o===n:o}return"notSet"===i?null==t||""===t||!!t.toString().match(ai):"gt"===i?t>n:"gte"===i?t>=n:"lt"===i?t<n:"lte"===i&&t<=n}function ag(e,{convertToUrl:t}={convertToUrl:!1}){return Object.entries(e).reduce((e,[n,{content:i}])=>(t&&"string"!=typeof i&&i&&(i=URL.createObjectURL(i)),m({},e,{[n]:i})),{})}function rg(e,t){var n=e;if("string"!=typeof e)return n;for(var i,a=new RegExp(ei.source,ei.flags),r=[];null!==(i=a.exec(e))&&(r.push(i),a.global);)i.index===a.lastIndex&&a.lastIndex++;for(var o=0,s=r;o<s.length;o++){var u=s[o],l=u[0],d=u[1],c=rg(d,t);if(l===e)return h(l,c);c!==d&&(n=n.replace(d,c)),n=n.replace(ei,h)}return n;function h(e,n){var i=String(n).split("."),a=i[0];if(!a)return e;var r=og(t,a);if(void 0===r)return e;if("object"==typeof r&&null!==r&&0===Object.keys(r).length)return"";var o=og(t,...i);return void 0===o?"":"string"!=typeof o?o:rg(o,t)}}function og(e,...t){for(var n=e,i=0,a=t;i<a.length;i++){var r=a[i];if(null==n)return;n=Array.isArray(n)?n[+r]:n[r]}return n}var sg=e=>{var t=e.state.timeSpentOnPaywall;if(t)return Date.now()-t},ug=e=>{if(!e)return null;if(e.includes("#"))return e;var t=e.match(/[\d.]+/g);if(!t||t.length<3)return null;var n=t.map(Number),i=n[0],a=n[1],r=n[2],o=n[3],s=e=>Math.round(e).toString(16).padStart(2,"0"),u=void 0!==o&&o<1?s(255*o):"";return`#${s(i)}${s(a)}${s(r)}${u}`},lg=(e,t)=>{if(!e||!t)return!0;var n=null!=e&&e.includes("rgb")?ug(e):e,i=null!=t&&t.includes("rgb")?ug(t):t;return(null==n?void 0:n.toLowerCase())===(null==i?void 0:i.toLowerCase())};function dg(e){var t,n,i,a,r,o,s,u,l,d,c,h,m;return{width:null!==(t=e.width)&&void 0!==t?t:20,railSpacing:null!==(n=e.railSpacing)&&void 0!==n?n:12,dotLineSpacing:null!==(i=e.dotLineSpacing)&&void 0!==i?i:10,lineTopOffset:null!==(a=e.lineTopOffset)&&void 0!==a?a:0,lineBottomOffset:null!==(r=e.lineBottomOffset)&&void 0!==r?r:0,lineWidth:null!==(o=e.lineWidth)&&void 0!==o?o:1,lineColor:null!==(s=e.lineColor)&&void 0!==s?s:"#C6CBD7",lineCornerRadius:null!==(u=e.lineCornerRadius)&&void 0!==u?u:0,dotSize:null!==(l=e.dotSize)&&void 0!==l?l:6,dotColor:null!==(d=e.dotColor)&&void 0!==d?d:"#C6CBD7",dotCornerRadius:null!==(c=e.dotCornerRadius)&&void 0!==c?c:3,dotBorderWidth:null!==(h=e.dotBorderWidth)&&void 0!==h?h:0,dotBorderColor:null!==(m=e.dotBorderColor)&&void 0!==m?m:"transparent",conditionAttributes:e.conditionAttributes}}function cg(e,t,n){for(var i,a=dg(t),r={key:n},o=Jp(t,Jp({group:r},{group:r})),s={dotSize:a.dotSize,dotColor:a.dotColor,dotCornerRadius:a.dotCornerRadius,dotBorderWidth:a.dotBorderWidth,dotBorderColor:a.dotBorderColor},u=h(null!==(l=o.conditionAttributes)&&void 0!==l?l:[]);!(i=u()).done;){var l,d,c=i.value;if(eg(e,c)){var m=null!==(d=c.attributes)&&void 0!==d?d:{};s={dotSize:"number"==typeof m.dotSize?m.dotSize:s.dotSize,dotColor:"string"==typeof m.dotColor?m.dotColor:s.dotColor,dotCornerRadius:"number"==typeof m.dotCornerRadius?m.dotCornerRadius:s.dotCornerRadius,dotBorderWidth:"number"==typeof m.dotBorderWidth?m.dotBorderWidth:s.dotBorderWidth,dotBorderColor:"string"==typeof m.dotBorderColor?m.dotBorderColor:s.dotBorderColor}}}return s.dotCornerRadius=Math.min(s.dotCornerRadius,s.dotSize/2),s}var hg=!0,mg=!1,fg=!1,vg=!1,pg=!1,gg=!1,yg=null,bg=null,wg=null,kg=null,Sg=!1,Eg="",Pg=!1,Tg=null,Mg=null,_g=null,Ag=null,Dg=null,xg=null,Cg=null,Ig=null,Lg=!1,Rg=null,Fg="",Og=0,$g=1,Ng=null,Wg=[],jg=new WeakMap,Bg=new WeakMap,zg=1;function Ug(e){var t=Bg.get(e);return t||(t=zg++,Bg.set(e,t)),String(t)}var Hg=null,Gg=null,Vg=null,Kg=null;function Xg(e){return!0===e||"true"===e||"1"===e||"yes"===e}function Yg(e,t){if(function(){if("undefined"==typeof window)return!1;try{var e,t;return!!Xg(window.NAMI_TTS_DEBUG)||Xg(null===(e=window.localStorage)||void 0===e?void 0:e.getItem("nami:tts:debug"))||Xg(null===(t=window.localStorage)||void 0===t?void 0:t.getItem("NAMI_TTS_DEBUG"))}catch(e){return!1}}())try{t?console.debug(`[Nami TTS] ${e}`,t):console.debug(`[Nami TTS] ${e}`)}catch(e){}}function qg(e="TTS is unavailable in this runtime."){mg||(mg=!0,Yg(e))}function Jg(e){if(!e)return"none";var t=e.id?`#${e.id}`:"",n=e.getAttribute("data-testid"),i=n?`[data-testid="${n}"]`:"";return`${e.tagName.toLowerCase()}${t}${i}`}function Qg(e){return function(e){return null==e?"":String(e).replace(/[^.!?\n]*\$\{[^}]*subscribeUrl[^}]*\}[^.!?\n]*[.!?]?/gi,"To subscribe, follow the on-screen instructions.").replace(/\$\{[^}]+\}/g," ").replace(/\s+([.,!?;:])/g,"$1").replace(/\s+/g," ").trim()}(e)}function Zg(e){return e.toLowerCase().replace(/[^a-z0-9$]+/g," ").replace(/\s+/g," ").trim()}function ey(e){return Qg(String(null!=e?e:"").replace(/<[^>]*>/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`#>~]/g," "))}function ty(e,t){var n=Qg(t);n&&e[e.length-1]!==n&&e.push(n)}function ny(e,t=[]){var n=[];return[...e,...t].forEach(e=>{var t=function(e){var t=Qg(e);if(!t)return[];for(var n=[],i=0,a=0;a<t.length;a+=1){var r=t.charAt(a),o=t.charAt(a+1);if(("."===r||"!"===r||"?"===r)&&(!o||/\s/.test(o))){var s=Qg(t.slice(i,a+1));for(s&&n.push(s);a+1<t.length&&/\s/.test(t.charAt(a+1));)a+=1;i=a+1}}var u=Qg(t.slice(i));u&&n.push(u);return n.length?n:[t]}(e);t.length||ty(n,e),t.forEach(e=>ty(n,e))}),n.slice(0,60)}function iy(e){return Qg(e.join(". ").replace(/\.\s*([.!?])/g,"$1"))}function ay(e){var t,n=Ng;n&&(e&&n.id===e||(n.status="cancelled",(null===(t=Ng)||void 0===t?void 0:t.id)===n.id&&(Ng=null)))}function ry(){if("undefined"==typeof document)return null;for(var e=document.activeElement;e&&null!==(t=e.shadowRoot)&&void 0!==t&&t.activeElement;){var t,n,i;e=null!==(n=null===(i=e.shadowRoot)||void 0===i?void 0:i.activeElement)&&void 0!==n?n:e}return e}function oy(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}function sy(e){for(var t=[],n=null!=e?e:null;n;){n instanceof Element&&-1===t.indexOf(n)&&t.push(n);var i=n.parentNode;n=oy(i)?i.host:i}return t}function uy(e,t){return!!t&&-1!==sy(t).indexOf(e)}function ly(e,t){if(!t)return!1;if(t===e)return!0;if(e.contains(t))return!0;var n=e.shadowRoot;return!!n&&(n.activeElement===t||n.contains(t))}function dy(e,t){t&&-1===e.indexOf(t)&&e.push(t)}function cy(e,t){var n=t.shadowRoot;n&&n.querySelectorAll('button,[role="button"],a,input,select,textarea,[tabindex]:not([tabindex="-1"])').forEach(t=>dy(e,t))}function hy(e,t){var n,i=("function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():null!==(n=null==t?void 0:t.composedPath)&&void 0!==n?n:[]).filter(e=>e instanceof Element);return i.length?i:sy(e)}function my(e,t=[],n={}){var i=[];if(n.focusedElementOnly)return dy(i,e),i;var a=(t.length?t:sy(e)).filter(e=>e.isConnected),r=function(e,t){var n,i=t.find(e=>e.matches("nami-product-container"));if(i)return i;var a=sy(e).find(e=>e.matches("nami-product-container"));if(a)return a;var r=kg&&"querySelectorAll"in kg?kg:"undefined"!=typeof document?document:null;return r&&null!==(n=Array.prototype.slice.call(r.querySelectorAll("nami-product-container")).find(t=>uy(t,e)))&&void 0!==n?n:null}(e,a);return dy(i,e),cy(i,e),a.forEach(t=>{var n=!!r&&(t===r||uy(r,t)),a=t!==e&&uy(t,e),o=t.matches('nami-product-container,nami-button,[role="button"],button,[tabindex]:not([tabindex="-1"])');(n||a||t===e)&&o&&(dy(i,t),cy(i,t))}),null!=r&&r.isConnected&&(dy(i,r),cy(i,r)),i}function fy(e){return jg.has(e)}function vy(e,t,n=[]){var i=Qg(t);if(!i)return!1;by(),py(void 0,"new-composite",!0);var a=my(e,n,Ry()||Ly()?{focusedElementOnly:!1}:{focusedElementOnly:!0});return a.forEach(e=>function(e,t){var n=Qg(t);return!!n&&(jg.has(e)||jg.set(e,{"aria-label":e.getAttribute("aria-label")}),e.setAttribute("aria-label",n),!0)}(e,i)),Wg=a,!0}function py(e,t="manual",n=!1){var i=e&&-1===Wg.indexOf(e)?my(e):Wg;i.length&&(!n&&Ng&&i.some(e=>jg.has(e))?Yg("composite restore skipped: transaction still active",{reason:t}):(by(),i.forEach(e=>{var t=jg.get(e);t&&(!function(e,t,n){null===n?e.removeAttribute(t):e.setAttribute(t,n)}(e,"aria-label",t["aria-label"]),jg.delete(e))}),e&&-1===Wg.indexOf(e)||(Wg=[])))}function gy(e,t){jg.has(e)&&(t instanceof Element&&ly(e,t)||(by(),_g=setTimeout(()=>{(_g=null,e.isConnected)?ly(e,ry())||py(e,"blur"):py(e,"blur-disconnected",!0)},50)))}function yy(e){Wg.length&&py(void 0,e,!0)}function by(){_g&&(clearTimeout(_g),_g=null)}function wy(){Ag&&(clearTimeout(Ag),Ag=null),Hg=null}function ky(){Dg&&(clearTimeout(Dg),Dg=null)}function Sy(){xg&&(clearTimeout(xg),xg=null)}function Ey(){Cg&&(clearTimeout(Cg),Cg=null)}function Py(){Ig&&(clearTimeout(Ig),Ig=null)}function Ty(e){Lg=!0,Py(),Ig=setTimeout(()=>{Ig=null,Lg=!1},_y(e)+500)}function My(){Py(),Lg=!1}function _y(e){var t=Qg(e),n=350*(t?t.split(/\s+/).filter(Boolean).length:0);return Math.min(3e4,Math.max(4e3,n))}function Ay(){return"undefined"==typeof window?null:window}function Dy(){var e,t=null===(e=Ay())||void 0===e||null===(e=e.webOS)||void 0===e||null===(e=e.service)||void 0===e?void 0:e.request;return"function"==typeof t?t:null}function xy(){return!!Dy()}function Cy(){var e;if("undefined"==typeof window)return null;var t=null===(e=window.VIZIO)||void 0===e?void 0:e.Chromevox;return t&&"function"==typeof t.play?t:null}function Iy(){return"undefined"!=typeof window&&void 0!==window.speechSynthesis&&"function"==typeof window.speechSynthesis.speak&&"function"==typeof window.SpeechSynthesisUtterance}function Ly(){var e;if("undefined"==typeof window)return!1;var t=window,n=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"";return!(!t.VIZIO&&-1===n.indexOf("vizio"))}function Ry(){var e,t;if("undefined"==typeof window)return!1;if(Ly())return!1;var n=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"",i=Ay();return!!(null!=i&&i.webOS||null!=i&&i.webOSDev||null!=i&&i.PalmSystem||null!=i&&null!==(t=i.webOS)&&void 0!==t&&null!==(t=t.platform)&&void 0!==t&&t.tv||-1!==n.indexOf("webos")||-1!==n.indexOf("netcast"))}function Fy(){var e;if("undefined"==typeof window)return!1;var t=window,n=(null===(e=window.navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.toLowerCase())||"";return!!(t.tizen||-1!==n.indexOf("tizen")||-1!==n.indexOf("samsung")&&(-1!==n.indexOf("smart-tv")||-1!==n.indexOf("smarttv"))||-1!==n.indexOf("samsungbrowser")&&-1!==n.indexOf("tv"))}function Oy(e){return"string"==typeof e&&-1!==e.toLowerCase().indexOf("xbox")}function $y(){var e,t,n;if("undefined"==typeof window)return!1;if(!0===Vg)return!0;var i=window.navigator;return[i.userAgent,i.platform,i.vendor,null===(e=i.userAgentData)||void 0===e?void 0:e.platform,...(null!==(t=null===(n=i.userAgentData)||void 0===n?void 0:n.brands)&&void 0!==t?t:[]).map(e=>e.brand)].some(Oy)}function Ny(){if("undefined"==typeof window)return!1;try{return"television"===ou()}catch(e){return!1}}function Wy(){if(pg)return!1;var e=Cy();if(!e)return!1;try{return"function"!=typeof e.isEnabled||e.isEnabled()}catch(e){return!1}}function jy(){return{televisionRuntime:Ny(),televisionTtsRuntime:By(),webos:Ry(),tizen:Fy(),vizio:Ly(),xbox:$y(),xboxClientHintsResult:Vg,hasWebOsServiceRequest:xy(),webOsRequestType:typeof Dy(),hasWebSpeechApi:Iy(),webSpeechUnavailableForSession:fg,webOsLunaUnavailableForSession:vg,vizioChromevoxUnavailableForSession:pg}}function By(){return Ny()||Ry()||Ly()||Fy()}function zy(){return By()&&!fg&&Iy()}function Uy(e){if(gg=e,Yg("set media playing",{playing:e,hasDeferredUtterance:!!yg}),!e&&yg){var t,n=yg;if(yg=null,n.options.transactionId&&(null===(t=Ng)||void 0===t?void 0:t.id)!==n.options.transactionId)return void Yg("drop stale deferred speech",{transactionId:n.options.transactionId,reason:n.options.reason});sb(n.text,n.options)}}function Hy(e){fg=!0,qg(Ry()?"Web Speech TTS unavailable in this webOS runtime":"Web Speech TTS unavailable in this runtime"),Yg("web speech unavailable",{error:e})}function Gy(e){vg=!0,Yg("webOS Luna unavailable",{error:e})}function Vy(e,t){yg={text:e,options:t}}var Ky={name:"webos-luna-tts",platform:"webos",isAvailable:function(){return By()&&!Ly()&&!vg&&xy()},speak:function(e,t){Yg("speakViaWebOsLuna:enter",{textPreview:e.slice(0,160),reason:t.reason,transactionId:t.transactionId,requestType:typeof Dy()});var n=Dy();if(!n)return Yg("speakViaWebOsLuna:no-request"),!1;var i="composite"===t.reason,a=!1,r=()=>{var r,o;if(xg=null,t.transactionId&&(null===(r=Ng)||void 0===r?void 0:r.id)!==t.transactionId)return Yg("speakViaWebOsLuna:drop-stale-delayed-speak",{transactionId:t.transactionId,activeTransaction:null===(o=Ng)||void 0===o?void 0:o.id,reason:t.reason}),!1;if(gg)return Yg("speakViaWebOsLuna:defer-delayed-speak-media-playing",{transactionId:t.transactionId,reason:t.reason}),Vy(e,t),!0;var s=!1;try{Yg("speakViaWebOsLuna:request",{uri:"luna://com.webos.service.tts",method:"speak",delayedComposite:i,textPreview:e.slice(0,160)}),n("luna://com.webos.service.tts",{method:"speak",parameters:{text:e,clear:!0,feedback:!0},onSuccess:e=>{var n;if(Yg("speakViaWebOsLuna:onSuccess",{response:e,transactionId:t.transactionId}),!t.transactionId||(null===(n=Ng)||void 0===n?void 0:n.id)===t.transactionId){var i,r=function(e){var t,n=Qg(null!==(t=null==e?void 0:e.msgStatus)&&void 0!==t?t:null==e?void 0:e.status).toLowerCase();return"done"===n||"stopped"===n||"canceled"===n||"cancelled"===n||"error"===n}(e),o=!(null==e||!e.returnValue||"msgStatus"in Object(null!=e?e:{}));if(!a&&(r||o))a=!0,t.transactionId&&(null===(i=Ng)||void 0===i?void 0:i.id)===t.transactionId&&(Ng.status="ended",Ng=null)}},onFailure:e=>{var n;s=!0,Yg("speakViaWebOsLuna:onFailure",{error:e,transactionId:t.transactionId});var i=!t.transactionId||(null===(n=Ng)||void 0===n?void 0:n.id)===t.transactionId;t.transactionId&&i&&Ng&&(Ng.status="cancelled",Ng=null),Gy(e)}})}catch(e){var u;return t.transactionId&&(null===(u=Ng)||void 0===u?void 0:u.id)===t.transactionId&&(Ng.status="cancelled",Ng=null),Gy(e),!1}return!s};if(i)return Sy(),Yg("speakViaWebOsLuna:delay-composite-until-focus-settles",{delayMs:250,transactionId:t.transactionId}),xg=setTimeout(r,250),!0;return r()},stop:qy},Xy={name:"web-speech",platform:"web",isAvailable:zy,speak:function(e,t){if(!zy())return!1;try{var n=new window.SpeechSynthesisUtterance(e);return n.onstart=()=>{var e;t.transactionId&&(null===(e=Ng)||void 0===e?void 0:e.id)===t.transactionId&&(Ng.status="started")},n.onend=()=>{var e=Ng,n=!t.transactionId||(null==e?void 0:e.id)===t.transactionId;t.transactionId&&n&&e&&(e.status="ended",Ng=null)},n.onerror=e=>{var n,i=e.error;t.transactionId&&(null===(n=Ng)||void 0===n?void 0:n.id)===t.transactionId&&(Ng.status="cancelled",Ng=null),"synthesis-failed"===i&&Hy(i)},window.speechSynthesis.speak(n),!0}catch(e){return Hy("exception"),!1}},stop:()=>{if(Iy())try{window.speechSynthesis.cancel()}catch(e){}}},Yy={name:"vizio-chromevox",platform:"vizio",isAvailable:Wy,speak:Qy,stop:Jy};function qy(){var e=Dy();if(e)try{e("luna://com.webos.service.tts",{method:"stop",parameters:{},onFailure:e=>Yg("webOS Luna stop failed",{error:e})})}catch(e){Yg("webOS Luna stop threw",{error:e})}}function Jy(e=!0){var t=!!Dg,n=Lg;ky();var i=Cy(),a=function(){var e;if("undefined"==typeof window)return null;var t=null===(e=window.chrome)||void 0===e||null===(e=e.tts)||void 0===e?void 0:e.stop;return"function"==typeof t?t:null}();if((i||a)&&(n||t||a)&&(n||!t||a))try{var r=!1;i&&"function"==typeof i.stop&&(i.stop(),r=!0),i&&"function"==typeof i.cancel&&i.cancel(),i&&"function"==typeof i.pause&&i.pause(),a&&(a(),r=!0),i&&e&&!r&&n&&i.play(""),My()}catch(e){My(),Yg("VIZIO stop threw",{error:e})}}function Qy(e,t){var n=Cy();if(!n)return!1;try{var i,a,r=!0===(null===(i=t.element)||void 0===i?void 0:i.isConnected),o="composite"===t.reason?1400:"focus"===t.reason?700:0;return o>0?(ky(),Dg=setTimeout(()=>{var i;if(Dg=null,!t.transactionId||!Ng||Ng.id===t.transactionId)if(t.element&&r&&!t.element.isConnected){var a;t.transactionId&&(null===(a=Ng)||void 0===a?void 0:a.id)===t.transactionId&&(Ng.status="cancelled",Ng=null)}else{if(gg)return wy(),Gg=null,void Vy(e,t);n.play(e),Ty(e),t.transactionId&&(null===(i=Ng)||void 0===i?void 0:i.id)===t.transactionId&&(Ng.status="ended",Ng=null)}},o),!0):(n.play(e),Ty(e),t.transactionId&&(null===(a=Ng)||void 0===a?void 0:a.id)===t.transactionId&&(Ng.status="ended",Ng=null),!0)}catch(e){return function(e){pg=!0,Yg("VIZIO Chromevox unavailable",{error:e})}(e),!1}}function Zy(e){return"high"===e?3:"normal"===e?2:1}function eb(){return Date.now()-Og<1500}function tb(e){return Zg(e)}function nb(e){if(!e)return"";var t=function(e){return e?[e.tagName.toLowerCase(),e.id||"",e.getAttribute("data-component-id")||"",e.getAttribute("data-nami-id")||"",e.getAttribute("data-testid")||"",`el-${Ug(e)}`].filter(Boolean).join("|"):""}(e);return Zg(t||hb(e))}function ib(e){var t=tb(e);return"clickable"===t||"button"===t||"focusable"===t||"selected"===t||"unselected"===t}function ab(e,t,n){var i;if(Gg={textKey:tb(e),reason:t.reason,timestamp:Date.now()},"high"===n){var a=_y(e),r=Date.now();Hg={transactionId:t.transactionId,pageKey:Eg,element:null!==(i=t.element)&&void 0!==i?i:null,elementKey:nb(t.element),textKey:tb(e),startedAt:r,suppressUntil:r+a},Ag&&clearTimeout(Ag),Ag=setTimeout(()=>{Ag=null,Hg=null},a)}}function rb(e,t=!0){var n,i,a,r=!(!e||(null===(n=Ng)||void 0===n?void 0:n.id)!==e||"pending"!==Ng.status);if(Yg("stopSpeech",{preserveTransactionId:e,allowVizioEmptyFallback:t,activeTransaction:null===(i=Ng)||void 0===i?void 0:i.id,reason:null===(a=Ng)||void 0===a?void 0:a.reason,preservingCurrentTransaction:r}),yg=null,r||(Ey(),Sy()),e||(wy(),by(),yy("stop")),ay(e),Mg&&(clearTimeout(Mg),Mg=null),!r){if(Iy())try{window.speechSynthesis.cancel()}catch(e){}Ry()&&qy(),Ly()&&Jy(t)}}function ob(){rb()}function sb(e,t={}){var n,i,a;Yg("speakText:enter",{textPreview:Qg(e).slice(0,160),reason:t.reason,transactionId:t.transactionId,element:Jg(t.element),runtime:jy()});var r=Qg(e);if(!r)return!1;if(!By())return Yg("skip speech: non-CTV runtime"),!1;var o={interrupt:!1!==t.interrupt,reason:null!==(n=t.reason)&&void 0!==n?n:"manual",transactionId:t.transactionId,element:t.element,focusPath:t.focusPath,priority:t.priority},s=function(e,t){return t.priority?t.priority:"composite"===t.reason?"high":ib(e)?"low":"normal"}(r,o);if(function(e,t,n){var i=tb(e),a=Date.now(),r=nb(t.element);if(ib(e))return!0;if(Gg&&Gg.reason===t.reason&&Gg.textKey===i&&a-Gg.timestamp<600)return Yg("suppress:duplicate-request",{reason:t.reason,textPreview:e.slice(0,120)}),!0;if(!Hg)return!1;if(Zy(n)>=Zy("high"))return!1;if("focus"===t.reason){var o=Hg.textKey;if(!eb()&&(i===o||i.includes(o)))return Yg("suppress:focus-text-is-active-composite",{textPreview:e.slice(0,120),transactionId:Hg.transactionId,element:Jg(t.element)}),!0}var s=function(e,t){return!!e&&!!t&&e===t}(t.element,Hg.element),u=!!r&&Hg.elementKey===r,l=!Hg.pageKey||Hg.pageKey===Eg,d=eb(),c=l&&!d&&a<Hg.startedAt+2500;return!(!s&&!u&&(l&&"focus"===t.reason&&t.element&&Hg.element!==t.element||"low"!==n&&!c)&&(wy(),1))}(r,o,s))return!1;if(o.interrupt&&rb(o.transactionId,!1),gg)return Vy(r,o),!0;var u=function(e){var t;return"manual"!==(null!==(t=e.reason)&&void 0!==t?t:"manual")&&e.element?Ry()||Ly()?"programmatic":"accessibility-label":"programmatic"}(o);Yg("speakText:owner",{owner:u,reason:o.reason,element:Jg(o.element)});var l,d,c="programmatic"===u?function(){if(!By())return null;var e=Ly(),t=Ry();return Yy.isAvailable()?(Yg("resolveTtsEngine:selected",{engine:"vizio-chromevox"}),Yy):e?null:Ky.isAvailable()?(Yg("resolveTtsEngine:selected",{engine:"webos-luna-tts"}),Ky):Xy.isAvailable()?(Yg("resolveTtsEngine:selected",{engine:"web-speech"}),Xy):(Yg("tts engine unavailable",{webos:t,vizio:e}),null)}():null;(Yg("speakText:engine",{engine:null!==(i=null==c?void 0:c.name)&&void 0!==i?i:null,owner:u}),"composite"===o.reason&&o.transactionId&&o.element&&function(e){return"accessibility-label"===e||Ry()}(u))&&vy(o.element,r,null!==(l=o.focusPath)&&void 0!==l?l:[]);if("accessibility-label"===u)return"focus"===o.reason&&o.element&&o.element.setAttribute("aria-label",r),o.transactionId&&(null===(d=Ng)||void 0===d?void 0:d.id)===o.transactionId&&(Ng.status="started"),ab(r,o,s),!0;if(!c)return function(e,t){if(!Ly()||pg)return!1;var n=Date.now(),i=()=>{var a;Cg=null,t.transactionId&&Ng&&Ng.id!==t.transactionId||(Wy()?Qy(e,t):Date.now()-n>=8e3?t.transactionId&&(null===(a=Ng)||void 0===a?void 0:a.id)===t.transactionId&&(Ng.status="cancelled",Ng=null):Cg=setTimeout(i,250))};return Ey(),Cg=setTimeout(i,250),!0}(r,o)?(ab(r,o,s),!0):(qg(),!1);var h=c.speak(r,o);if(Yg("speakText:engine-result",{engine:c.name,accepted:h,reason:o.reason,transactionId:o.transactionId}),h)return ab(r,o,s),h;if(!o.element)return h;var m=vy(o.element,r,null!==(a=o.focusPath)&&void 0!==a?a:[]);return Yg("speakText:aria-label-fallback",{engine:c.name,accepted:m,reason:o.reason}),m&&ab(r,o,s),m}function ub(e){var t=e.component;return e.hasAttribute("data-nami-primary-cta")||!0===(null==t?void 0:t.focused)||"productButton"===(null==t?void 0:t.namiComponentType)}function lb(e){var t,n=null===(t=e.getAttribute("role"))||void 0===t?void 0:t.toLowerCase();return"button"===e.tagName.toLowerCase()||"button"===n||e.matches("nami-button,nami-play-pause-button,nami-volume-button,nami-toggle-button")}function db(e){return Qg(e).replace(/(?:,\s*)?\bbutton\b\s*$/i,"").trim()||Qg(e)}function cb(e){return Qg(e.innerText||e.textContent||"")}function hb(e){if(!e)return"";if(fy(e)){var t=function(e){var t=jg.get(e);return t?Qg(t["aria-label"]||e.getAttribute("title")||""):""}(e);if(t)return t;var n=mb(e.component);if(n)return n}var i=e.getAttribute("data-tts-spoken-label");if(i)return Qg(i);var a=mb(e.component);if(a)return a;var r=e.getAttribute("aria-label")||e.getAttribute("title");return r?Qg(r):cb(e)}function mb(e){var t=vb(e,wg);if(!t)return"";var n=t,i=Qg(fb(n.speechLabel)||fb(n.speech_label)||fb(n.screenreaderText)||fb(n.title)||fb(n.alt)||fb(n.text)||(Array.isArray(n.texts)?n.texts.map(e=>fb(e)).join(", "):""));if(i)return i;for(var a,r=h(gb(n));!(a=r()).done;){var o=mb(a.value);if(o)return o}return""}function fb(e,t=wg){return t?ng(t,e):e}function vb(e,t){if(!e||e.hidden)return null;var n=e;if("condition"===n.component)return t&&eg(t,n)?e:null;if(n.conditionAttributes&&t){var i=tg(t,n);return i.hidden?null:i}return e}function pb(e,t){if(Yg("applySpeechAttributes:enter",{element:Jg(e),label:t,activeComposite:fy(e)}),!fy(e)){var n=Qg(t),i=function(e,t){var n=Qg(t);return n?lb(e)?db(n):n:""}(e,t);if(!i)return e.removeAttribute("data-tts-spoken-label"),void e.removeAttribute("aria-label");n?e.setAttribute("data-tts-spoken-label",n):e.removeAttribute("data-tts-spoken-label"),e.setAttribute("aria-label",function(e,t){return lb(e)?db(t):Qg(t)}(e,i))}}function gb(e){for(var t=[],n=0,i=["components","playingComponents","pausedComponents","mutedComponents","volumeComponents","productBaseComponents","productFeaturedComponents"];n<i.length;n++){var a=null==e?void 0:e[i[n]];Array.isArray(a)&&t.push(...a)}return null!=e&&e.collapseHeader&&(Array.isArray(e.collapseHeader)?t.push(...e.collapseHeader):t.push(e.collapseHeader)),t}function yb(e,t,n){var i=vb(e,wg);if(i&&!function(e){var t=vb(e,wg);if(!t)return!1;var n=t,i=String(n.component||n.namiComponentType||"").toLowerCase();return-1!==i.indexOf("button")||-1!==i.indexOf("toggle")||-1!==i.indexOf("checkbox")||-1!==i.indexOf("radio")||-1!==i.indexOf("select")||-1!==i.indexOf("input")||!!n.onTap||!!n.sku||!0===n.focused}(i)){var a=function(e){var t=vb(e,wg);if(!t)return"";var n=t;switch(t.component){case"text":case"countdownTimerText":return ey(fb(n.screenreaderText)||fb(n.text));case"text-list":return Array.isArray(n.texts)?ey(n.texts.map(e=>fb(e)).join(", ")):"";case"videoUrl":case"progressBar":return Qg(fb(n.screenreaderText));default:return""}}(i);ty(t,a),gb(i).forEach(e=>yb(e,t))}}function bb(e,t){var n=[];if(!e)return n;var i=e;return[i.header,i.contentContainer,i.footer,i.backgroundContainer,i.components].forEach(e=>{Array.isArray(e)?e.forEach(e=>yb(e,n)):yb(e,n)}),n}function wb(e,t){var n=bb(e),i=function(e){if(!e)return"";var t=mb(e.component),n=e.getAttribute("aria-label")||e.getAttribute("title")||cb(e),i=Qg(t||n);return i?lb(e)&&!/\bbutton\b\s*$/i.test(i)?Qg(`${i} button`):i:""}(t);return iy(ny(n,i?[i]:[]))}function kb(e){return e?Zg(`${Qg(e.id||e.name||"")}|${iy(ny(bb(e),[]))}`):""}function Sb(){return Pg}function Eb(e,t=null){!function(){if(null===Vg&&null===Kg){var e=navigator.userAgentData;"function"==typeof(null==e?void 0:e.getHighEntropyValues)?Kg=e.getHighEntropyValues(["platform","model"]).then(e=>{var t,n,i=(null!==(t=e.platform)&&void 0!==t?t:"").toLowerCase(),a=(null!==(n=e.model)&&void 0!==n?n:"").toLowerCase();Vg=i.includes("xbox")||a.includes("xbox"),Yg("xbox client hints resolved",{platform:i,model:a,result:Vg})}).catch(()=>{Vg=!1}).finally(()=>{Kg=null}):Vg=!1}}(),Yg("setActivePage:enter",{nextKey:kb(e),previousKey:Eg,activePageAnnounced:Sg,pageName:Qg((null==e?void 0:e.name)||(null==e?void 0:e.id)||"")});var n=Eg;bg=e,wg=t,function(e){var t=kb(e);if(t!==Eg){var n=!Eg&&!!Rg;Sg=!1,Eg=t,Pg=n,Rg=null,Fg=""}}(e),n!==Eg&&rb(void 0,!1)}function Pb(e,t){if(Yg("prepareInitialComposite:enter",{element:Jg(e),activePageKey:Eg,activePageAnnounced:Sg,blockedByNavigation:Sb(),label:hb(e),isPrimary:ub(e)}),!bg||Sg||!ub(e)||Sb())return Yg("prepareInitialComposite:skip",{hasActivePage:!!bg,activePageAnnounced:Sg,isPrimary:ub(e),blockedByNavigation:Sb()}),!1;var n=wb(bg,e);if(!n)return!1;var i=hy(e,t),a=function(e,t,n){var i={id:$g++,reason:e,element:n,text:t,page:bg,status:"pending"};return Ng=i,i}("composite",n,e);Sg=!0,Rg=e,Fg=nb(e);var r,o=sb(n,{reason:"composite",interrupt:!0,transactionId:a.id,element:e,focusPath:i,priority:"high"});o||(Sg=!1,(null===(r=Ng)||void 0===r?void 0:r.id)===a.id&&(Ng.status="cancelled",Ng=null));return o}function Tb(e,t){Yg("preparePrimaryCtaCompositeFocus:enter",{element:Jg(e),label:hb(e),activePageKey:Eg,activePageAnnounced:Sg});var n=Pb(e,t);return Yg("preparePrimaryCtaCompositeFocus:result",{result:n,activePageKey:Eg,activePageAnnounced:Sg}),n}function Mb(e){Yg("handleNativeFocusIn:enter",{target:e.target instanceof Element?Jg(e.target):String(e.target),activePageKey:Eg,activePageAnnounced:Sg});var t=function(e){for(var t,n=null,i=h("function"==typeof e.composedPath?e.composedPath():[]);!(t=i()).done;){var a=t.value;if(a instanceof Element&&hb(a)){if(a.tagName.toLowerCase().startsWith("nami-"))return a;n||(n=a)}}return null!=n?n:e.target instanceof Element?e.target:null}(e);t&&_b(t,e)}function _b(e,t){if(Yg("handleFocusedElementForSpeech:enter",{element:Jg(e),label:hb(e),ttsEnabled:hg,runtime:jy(),activePageKey:Eg,activePageAnnounced:Sg,lastFocused:Jg(Rg),lastFocusedElementIdentity:Fg}),!e)return Yg("handleFocusedElementForSpeech:skip-basic",{hasElement:!!e,ttsEnabled:hg}),!1;if(!By())return!1;var n=nb(e);if(Hg&&Hg.pageKey===Eg&&Date.now()<Hg.startedAt+2500){var i=Hg.element===e,a=!!n&&Hg.elementKey===n;if(!eb()&&(i||a))return Yg("handleFocusedElementForSpeech:skip-during-initial-composite-lock",{element:Jg(e),sameCompositeElement:i,sameCompositeElementKey:a}),!1;var r=hb(e),o=r?tb(r):"";if(!eb()&&o&&Hg.textKey.includes(o))return Yg("handleFocusedElementForSpeech:skip-composite-contained-label-during-initial-lock",{element:Jg(e),labelPreview:r.slice(0,120),transactionId:Hg.transactionId}),Rg=e,Fg=n,!1}if(Rg===e||n&&n===Fg&&!Sg)return Yg("handleFocusedElementForSpeech:skip-same-element",{element:Jg(e),activePageAnnounced:Sg,elementIdentity:n,lastFocusedElementIdentity:Fg}),!1;if(!Sg&&bg&&ub(e)&&!Rg&&!Sb())return Pb(e,t);var s=hb(e);if(!s)return!1;if(Hg){var u=tb(s),l=Hg.textKey;if(!eb()&&(u===l||u.includes(l)))return Yg("handleFocusedElementForSpeech:skip-active-composite-label",{element:Jg(e),labelPreview:s.slice(0,120),transactionId:Hg.transactionId}),Rg=e,Fg=n,!1}return Rg=e,Fg=n,Mg&&clearTimeout(Mg),Mg=setTimeout(()=>{Mg=null,Rg===e&&sb(s,{reason:"focus",interrupt:!0,element:e,focusPath:hy(e,t),priority:"normal"})},120),!0}function Ab(e=document){var t;if(Yg("attachFocusSpeechListeners:enter",{root:e instanceof Element?Jg(e):e instanceof DocumentFragment?"document-fragment":"document",runtime:jy()}),Db(),!By())return Yg("focus speech listeners not attached: non-CTV runtime"),Db;var n,i=e=>Mb(e),a=()=>(Yg("handleUserNavigationKey",{activePageKey:Eg,activePageAnnounced:Sg}),Og=Date.now(),void(Pg=!0));e.addEventListener("focusin",i,!0),e.addEventListener("keydown",a,!0);var r=window;if("undefined"!=typeof window&&null!==(t=r.TVJS)&&void 0!==t&&t.DirectionalNavigation){var o=r.TVJS.DirectionalNavigation;n=o.onfocuschanged,o.onfocuschanged=e=>{var t;null===(t=n)||void 0===t||t.call(o,e),function(e){var t,n=null===(t=e.detail)||void 0===t?void 0:t.nextFocusElement;n&&_b(n,e)}(e)}}return Tg={root:e,focusListener:i,keyListener:a,previousTvjsHandler:n},Db}function Db(){var e;if(Yg("detachFocusSpeechListeners:enter",{hasCleanup:!!Tg}),Tg){var t=Tg,n=t.root,i=t.focusListener,a=t.keyListener,r=t.previousTvjsHandler;n.removeEventListener("focusin",i,!0),a&&n.removeEventListener("keydown",a,!0);var o=window;null!==(e=o.TVJS)&&void 0!==e&&e.DirectionalNavigation&&r&&(o.TVJS.DirectionalNavigation.onfocuschanged=r),Tg=null}}function xb(){var e;Yg("resetScreenreaderState:enter",{activePageKey:Eg,activePageAnnounced:Sg,activeTransaction:null===(e=Ng)||void 0===e?void 0:e.id,lastFocused:Jg(Rg)}),Db(),yg=null,gg=!1,bg=null,wg=null,kg=null,Sg=!1,Eg="",Pg=!1,Rg=null,Fg="",Og=0,Gg=null,wy(),by(),ky(),Sy(),Ey(),My(),Mg&&(clearTimeout(Mg),Mg=null),yy("reset"),ay(),Ng=null}var Cb=function(){return c(function t(n,i,a="",r=""){var s;o(this,t),this.playing=!1,this.toggling=!1,this.handleVideoEvents=t=>{this.video.onended=()=>{Uy(!1),this.handlePlayerAnalytics(t,e.NamiPaywallAction.VIDEO_ENDED)},this.video.onpause=()=>{Uy(!1),this.toggling||this.handlePlayerAnalytics(t,e.NamiPaywallAction.VIDEO_PAUSED)},this.video.onplay=()=>{Uy(!this.video.muted),this.toggling||this.handlePlayerAnalytics(t,this.video.currentTime>.05?e.NamiPaywallAction.VIDEO_RESUMED:e.NamiPaywallAction.VIDEO_STARTED)},this.video.onvolumechange=()=>{this.toggling||(this.muted=this.video.muted,Uy(!this.video.paused&&!this.video.ended&&!this.muted),this.handlePlayerAnalytics(t,this.muted?e.NamiPaywallAction.VIDEO_MUTED:e.NamiPaywallAction.VIDEO_UNMUTED))}},this.removeVideoEvents=()=>{this.video&&(Uy(!1),this.video.onended=null,this.video.onpause=null,this.video.onplay=null,this.video.onvolumechange=null,this.toggling=!1)},this.video=null!=i?i:this.video,null!==(s=t.instance)&&void 0!==s&&s.videoSrc&&i.src!=t.instance.videoSrc&&this.handlePlayerAnalytics(n,e.NamiPaywallAction.VIDEO_CHANGED),this.videoSrc=i.src,this.video&&(this.muteByDefault=i.muted,this.loopVideo=i.loop,this.autoplayVideo=i.autoplay,this.muted=this.video.muted,this.videoComponentName=a,this.videoComponentId=r,this.playing=!(!(this.video.currentTime>0)||this.video.paused||this.video.ended),Uy(this.playing&&!this.video.muted),this.handleVideoEvents(n))},[{key:"togglePlayVideo",value:function(e){this.toggling=!0,this.playing?this.video.pause():this.video.play(),this.playing=!this.playing,this.handlePlayerAnalytics(e)}},{key:"toggleMuteVideo",value:function(t){this.toggling=!0,this.video.muted=!this.video.muted,this.muted=this.video.muted,this.handlePlayerAnalytics(t,this.muted?e.NamiPaywallAction.VIDEO_MUTED:e.NamiPaywallAction.VIDEO_UNMUTED)}},{key:"videoPlayingAction",value:function(){var t,n;return(null===(t=this.video)||void 0===t?void 0:t.currentTime)<=0?e.NamiPaywallAction.VIDEO_STARTED:this.video.paused?e.NamiPaywallAction.VIDEO_PAUSED:this.video.ended?e.NamiPaywallAction.VIDEO_ENDED:(null===(n=this.video)||void 0===n?void 0:n.currentTime)>.05?e.NamiPaywallAction.VIDEO_RESUMED:e.NamiPaywallAction.UNKNOWN}},{key:"handlePlayerAnalytics",value:function(e,t){if(this.video){var n={id:this.videoComponentId,name:this.videoComponentName,url:this.video.src,loopVideo:this.loopVideo,muteByDefault:this.muteByDefault,autoplayVideo:this.autoplayVideo,contentDuration:this.video.duration/1e3,contentTimecode:this.video.currentTime/1e3};Ou.getInstance().emit(Vn,{action:null!=t?t:this.videoPlayingAction(),videoMetaData:n,timeSpentOnPaywall:sg(e)})}}}])}();Cb.instance=null;var Ib=({onTap:t,sku:n,componentChange:i,contextProvider:a}={})=>{var r,o,s,u,l,d,c,h,f,v,p,g=e.NamiPaywallAction.UNKNOWN;switch(null==t?void 0:t.function){case kf:g=e.NamiPaywallAction.CLOSE_PAYWALL,p=sg(a),Lb(),null===(r=Cb.instance)||void 0===r||r.handlePlayerAnalytics(a,e.NamiPaywallAction.VIDEO_ENDED);break;case Ef:g=e.NamiPaywallAction.RESTORE_PURCHASES,Rb();break;case Tf:g=e.NamiPaywallAction.SIGN_IN,Fb();break;case Ff:Ob(null===(o=t.parameters)||void 0===o?void 0:o.url);break;case _f:n&&(g=e.NamiPaywallAction.BUY_SKU,n=$b(a,t,n));break;case $f:g=e.NamiPaywallAction.PAGE_CHANGE,i={name:null==t||null===(s=t.parameters)||void 0===s?void 0:s.screen},Nb(a,null==t||null===(u=t.parameters)||void 0===u?void 0:u.screen);break;case Df:g=e.NamiPaywallAction.TOGGLE_CHANGE,i=Wb(a,null==t||null===(l=t.parameters)||void 0===l?void 0:l.formId,null==t||null===(d=t.parameters)||void 0===d?void 0:d.value);break;case Cf:n&&(g=e.NamiPaywallAction.SELECT_SKU,jb(a,n));break;case Lf:n&&(g=e.NamiPaywallAction.PURCHASE_SELECTED_SKU,Bb(a,n));break;case Wf:break;case Bf:null===(c=Cb.instance)||void 0===c||c.togglePlayVideo(a);break;case Uf:null===(h=Cb.instance)||void 0===h||h.togglePlayVideo(a);break;case Gf:null===(f=Cb.instance)||void 0===f||f.toggleMuteVideo(a);break;case Kf:null===(v=Cb.instance)||void 0===v||v.toggleMuteVideo(a)}g!==e.NamiPaywallAction.UNKNOWN&&Ou.getInstance().emit(Vn,m({},a.getPaywallActionEventData(),{action:g,sku:n,timeSpentOnPaywall:p,componentChange:i,purchaseError:void 0,purchases:void 0}))},Lb=()=>{ob(),Fr.clearLaunchId(),zb(e.NamiPaywallManagerEvents.Close)||"undefined"==typeof window||window.history.back()},Rb=()=>{var t=Ds(Pe.THIRD_PARTY_TRANSACTIONS);zb(e.NamiPaywallManagerEvents.Restore)||t||ui.warn("NamiPaywallManager.registerRestoreHandler is not registered, so restore option on the paywall will use default behavior.")},Fb=()=>{zb(e.NamiPaywallManagerEvents.SignIn)},Ob=t=>{t?zb(e.NamiPaywallManagerEvents.DeeplinkAction,t)||"undefined"!=typeof window&&window.open(t,"_blank"):ui.debug("Paywall deep link action invoked, but no url present.")},$b=(t,n,i)=>{var a,r=null===(a=n.parameters)||void 0===a?void 0:a.promo,o=i;if(r)ui.debug(`promo id is not null ${null==i?void 0:i.id}`),o.promoId=r.toString();else{ui.debug(`promo id is null for ${i.id}, product details: ${JSON.stringify(i.productDetails)}`);var s=i.productDetails;if(Xf(null==s?void 0:s.product_type)){var u=function(e){return e.offers.find(e=>"promo"===e.offer_type&&0===e.price)}(s);if(u&&u.offer_ref_id)ui.debug(`Found a free trial offer ${u.offer_ref_id}`),o.promoId=u.offer_ref_id.toString();else{var l,d=s.offers[0];if(d)ui.debug(`Found an offer ${d.offer_ref_id}`),o.promoId=null===(l=d.offer_ref_id)||void 0===l?void 0:l.toString()}}}return function(t,n){if(Ds(Pe.THIRD_PARTY_TRANSACTIONS)){if(Fr.setPurchaseImpression(),Ou.getInstance().listenerCount(e.NamiPaywallManagerEvents.BuySku)<=0)return void ui.warn("In order for Nami to hand off the purchase so the transaction can be handled by, you must register a NamiBuySkuHandler callbackwith NamiPaywallManager.registerBuySkuHandler.");ui.info(`Handing off purchase for processing by developer skuId=${n.skuId} promoId=${n.promoId}`),zb(e.NamiPaywallManagerEvents.BuySku,n)}else{var i=function(e){if(Cs("NamiPurchaseManager.buySKU")){var t=Fr.getCachedProducts(),n=null==t?void 0:t.find(t=>t.sku_ref_id==e);return{success:!!n,billingResponseCode:n?0:-999}}}(n.skuId);if(i&&(ui.info(`Purchase flow completed, success=${i.success}, code=${i.billingResponseCode}, message=${i.message}`),i.success)){var a;Ou.getInstance().emit(Vn,{action:e.NamiPaywallAction.CLOSE_PAYWALL,sku:n,timeSpentOnPaywall:sg(t)}),null===(a=Cb.instance)||void 0===a||a.handlePlayerAnalytics(t,e.NamiPaywallAction.VIDEO_ENDED);var r=t.getSelectedCampaign();r&&r.conversion_event_type==th.IN_APP&&r.conversion_event_url?(Fr.clearLaunchId(),window.location.href=r.conversion_event_url):Lb()}}}(t,o),o},Nb=(e,t)=>{var n;t&&((null===(n=window.history.state)||void 0===n?void 0:n.prevUrl)==t?window.history.back():e.setCurrentPage(t))},Wb=(e,t,n)=>{if(t)return e.setCurrentFormId(t,n),{formId:t,value:n};var i=e.getCurrentGroupId(),a=e.getCurrentGroupName();return e.setCurrentGroupData(i,a),{id:i,name:a}},jb=(e,t)=>{var n=e.getCurrentGroupId(),i=e.selectedProducts();n&&t.id!=i[n]&&(i[n]=t.id,e.setSelectedProducts(i))},Bb=(e,t)=>{e.setPurchase(!0,t)};function zb(e,...t){var n=Ou.getInstance();return n.emit(e,...t),n.listenerCount(e)>0}var Ub,Hb,Gb,Vb,Kb,Xb,Yb,qb,Jb,Qb,Zb,ew=e=>e,tw=bh.NamiFlowManager,nw=250,iw=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t)).pages=[],a.currentOffset=0,a.presentationStyle="fullscreen",a._sheetEntranceActive=!0,a.formFactor=ou(),a.timeSpentOnPaywall=0,a.animation={transition:"none",direction:"forward"},a._originalBodyStyles={},a._originalDocumentStyles={},a._savedScrollY=0,a._sheetDragStartY=0,a._sheetIsDragging=!1,a._dismissThreshold=100,a._boundHandleKeyDownEvent=e=>a.handleKeyDownEvent(e),a._stylesAlreadySaved=!1,a.type=e,a.value=n,a.context=i,a.setPaywallData(),a.presentationStyle=a.getPresentationStyle(a.paywall),a.applyPresentationHostClasses(),b(a,a)}return p(t,e),c(t,[{key:"applyPresentationHostClasses",value:function(){this.classList.toggle("nami-half-sheet-mode",this.isOverlaySheet),this.classList.toggle("nami-modal-mode",this.isModal),this.classList.toggle("nami-modal-phone",this.isModal&&"phone"===this.formFactor),this.classList.toggle("nami-modal-wide",this.isModal&&"phone"!==this.formFactor)}},{key:"setPaywallData",value:function(){var e=Su(this.value,this.type);this.paywall=e.paywall,this.campaign=e.campaign}},{key:"getPresentationStyle",value:function(e){var t,n,i,a,r=null!==(t=null==e||null===(n=e.template)||void 0===n||null===(n=n.initialState)||void 0===n?void 0:n.presentationStyle)&&void 0!==t?t:null==e||null===(i=e.template)||void 0===i||null===(i=i.initialState)||void 0===i?void 0:i.presentation_style;return(a=r)&&Kd.has(a)?a:"fullscreen"}},{key:"isHalfSheet",get:function(){return"compact_sheet"===this.presentationStyle}},{key:"isSheet",get:function(){return"sheet"===this.presentationStyle}},{key:"isOverlaySheet",get:function(){return this.isHalfSheet||this.isSheet}},{key:"isModal",get:function(){return"modal"===this.presentationStyle}},{key:"isOverlay",get:function(){return this.isOverlaySheet||this.isModal}},{key:"connectedCallback",value:function(){var e;T(t,"connectedCallback",this,3)([]),null!==(e=window.TVJS)&&void 0!==e&&e.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=this),this._detachFocusSpeechListeners=Ab(this),document.addEventListener("keydown",this._boundHandleKeyDownEvent),this._swipeHandler=yf(this,this.handleSwipeEvent.bind(this),{axisHint:"y",lockAxis:!0,minDistance:25,edgeLeakThreshold:15,preventScrollOnSwipe:!1,pointerTypes:["touch"]}),this.setOriginalStyles()}},{key:"disconnectedCallback",value:function(){var e,n,i;T(t,"disconnectedCallback",this,3)([]),ob(),null===(e=this._detachFocusSpeechListeners)||void 0===e||e.call(this),this._detachFocusSpeechListeners=void 0,xb(),Fr.clearLaunchId(),null!==(n=window.TVJS)&&void 0!==n&&n.DirectionalNavigation&&(window.TVJS.DirectionalNavigation.focusRoot=document.body),document.removeEventListener("keydown",this._boundHandleKeyDownEvent),Ou.getInstance().removeAllListeners(Vn),this.restoreStyles(),null===(i=this._halfSheetAbortController)||void 0===i||i.abort(),this._swipeHandler.destroy()}},{key:"setOriginalStyles",value:function(){this._stylesAlreadySaved||(this._stylesAlreadySaved=!0,this._originalBodyStyles.background=document.body.style.background,this._originalBodyStyles.overflow=document.body.style.overflow||null,this._originalBodyStyles.position=document.body.style.position||null,this._originalBodyStyles.top=document.body.style.top||null,this._originalBodyStyles.width=document.body.style.width||null,"phone"===this.formFactor&&(this._originalBodyStyles["overscroll-behavior"]=document.body.style.overscrollBehavior||null,this._originalDocumentStyles["overscroll-behavior"]=document.documentElement.style.overscrollBehavior||null)),"television"===this.formFactor&&(document.body.style.overflow="hidden"),"phone"===this.formFactor&&(document.body.style.overscrollBehavior="none",document.documentElement.style.overscrollBehavior="none",this.isOverlay||(document.body.style.overflow="hidden")),this.isOverlay&&(this._savedScrollY=window.scrollY,document.body.style.position="fixed",document.body.style.top=`-${this._savedScrollY}px`,document.body.style.width="100%",document.body.style.overflow="hidden")}},{key:"restoreStyles",value:function(){Object.entries(this._originalBodyStyles).forEach(([e,t])=>{null!==t?document.body.style.setProperty(e,t):document.body.style.removeProperty(e)}),Object.entries(this._originalDocumentStyles).forEach(([e,t])=>{null!==t?document.documentElement.style.setProperty(e,t):document.documentElement.style.removeProperty(e)}),this._savedScrollY>0&&(window.scrollTo(0,this._savedScrollY),this._savedScrollY=0)}},{key:"handleKeyDownEvent",value:function(e){(10009===e.keyCode||27===e.keyCode||166===e.keyCode||196===e.keyCode||"Backspace"===e.key||"GoBack"===e.key||"BrowserBack"===e.key||"XF86Back"===e.key)&&(e.preventDefault(),ob(),this.flow?this.flow.triggerActions(dc):this.isModal&&this.animateSheetDismiss().then(()=>Lb()))}},{key:"handleBackdropClick",value:function(e){var t;(e.stopPropagation(),this.flow)?null!==(t=this.flow.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==t&&t?this.flow.triggerActions("__swipe_down__"):this.animateSheetDismiss().then(()=>{var e;null===(e=this.flow)||void 0===e||e.finished(),Lb()}):this.animateSheetDismiss().then(()=>Lb())}},{key:"animateSheetDismiss",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return n=this.shadowRoot,i=null!==(e=null==n?void 0:n.querySelector(".nami-half-sheet-container"))&&void 0!==e?e:null==n?void 0:n.querySelector(".nami-modal-container"),r=null!==(t=null==n?void 0:n.querySelector(".nami-half-sheet-backdrop"))&&void 0!==t?t:null==n?void 0:n.querySelector(".nami-modal-backdrop"),i&&i.classList.add("nami-dismissing"),r&&r.classList.add("nami-dismissing"),o.n=1,a(new Promise(e=>setTimeout(e,200)));case 1:return o.a(2)}},null,this,null,Promise)}},{key:"handleSwipeEvent",value:function({direction:e}){var t;if("down"===e)null===(t=this.flow)||void 0===t||t.triggerActions("__swipe_down__");else if("up"===e){var n;null===(n=this.flow)||void 0===n||n.triggerActions("__swipe_up__")}}},{key:"setupHalfSheetDragTracking",value:function(){var e,t,n;null===(e=this._halfSheetAbortController)||void 0===e||e.abort(),this._halfSheetAbortController=new AbortController;var i=this._halfSheetAbortController.signal,a=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"),r=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-half-sheet-content");if(a&&r){a.addEventListener("touchstart",e=>{r.scrollTop>0||(this._sheetDragStartY=e.touches[0].clientY,this._sheetIsDragging=!0)},{passive:!0,signal:i}),a.addEventListener("touchmove",e=>{if(this._sheetIsDragging){var t=e.touches[0].clientY-this._sheetDragStartY;t>0&&(a.style.transform=`translateY(${t}px)`,a.style.transition="none",e.preventDefault())}},{passive:!1,signal:i}),a.addEventListener("touchend",()=>{if(this._sheetIsDragging){this._sheetIsDragging=!1;var e,t,n=a.style.transform.match(/translateY\((\d+(?:\.\d+)?)px\)/);if((n?parseFloat(n[1]):0)>this._dismissThreshold)if(null!==(e=null===(t=this.flow)||void 0===t?void 0:t.currentStepHasHoistedPrimaryActions("__swipe_down__"))&&void 0!==e&&e){var i;a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out",null===(i=this.flow)||void 0===i||i.triggerActions("__swipe_down__")}else{var r;a.style.transform="translateY(100%)",a.style.transition="transform 0.2s ease-in";var o=null===(r=this.shadowRoot)||void 0===r?void 0:r.querySelector(".nami-half-sheet-backdrop");o&&o.classList.add("nami-dismissing"),setTimeout(()=>{var e;null===(e=this.flow)||void 0===e||e.finished()},200)}else a.style.transform="translateY(0)",a.style.transition="transform 0.2s ease-out"}},{signal:i})}}},{key:"setupHalfSheetFocusTrap",value:function(){var e,t,n,i,a=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".nami-half-sheet-container"))&&void 0!==e?e:null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector(".nami-modal-container");if(a){a.focus();var r=null===(i=this._halfSheetAbortController)||void 0===i?void 0:i.signal;a.addEventListener("keydown",e=>{if("Tab"===e.key){var t=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0!==t.length){var n,i,r=t[0],o=t[t.length-1];if(e.shiftKey)document.activeElement!==r&&(null===(n=this.shadowRoot)||void 0===n?void 0:n.activeElement)!==r||(e.preventDefault(),o.focus());else document.activeElement!==o&&(null===(i=this.shadowRoot)||void 0===i?void 0:i.activeElement)!==o||(e.preventDefault(),r.focus())}}},r?{signal:r}:void 0)}}},{key:"firstUpdated",value:function(){var e;this.timeSpentOnPaywall=Date.now(),null===(e=this._detachFocusSpeechListeners)||void 0===e||e.call(this),this._detachFocusSpeechListeners=Ab(this.renderRoot),Bs(this.campaign)&&(this.flow=tw.instance.presentFlow(this.campaign,this,this.context)),this.isOverlay&&this.updateComplete.then(()=>{this.isOverlaySheet&&this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap()})}},{key:"updated",value:function(e){if(T(t,"updated",this,3)([e]),e.has("presentationStyle")){var n=e.get("presentationStyle");("compact_sheet"===n||"sheet"===n||"modal"===n)!==this.isOverlay&&(this.restoreStyles(),this._stylesAlreadySaved=!1,this.setOriginalStyles()),this.isOverlay&&(this.isOverlaySheet&&this.setupHalfSheetDragTracking(),this.setupHalfSheetFocusTrap())}}},{key:"getAnimationStyles",value:function(e){var t="backward"===this.animation.direction?-1:1;switch(this.animation.transition){case"verticalSlide":return`transform: translateY(${100*(e-this.currentOffset)*t}vh);`;case"slide":return`transform: translateX(${100*(e-this.currentOffset)*t}vw);`;case"fade":return`opacity: ${e===this.currentOffset?1:0};`;default:return""}}},{key:"updatePages",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.n){case 0:if(0!==this.pages.length&&"none"!==this.animation.transition){r.n=1;break}return this.pages=[e],r.a(2);case 1:if((null==(t=this.pages[this.pages.length-1])?void 0:t.id)!==e.id){r.n=2;break}return r.a(2);case 2:return n=null,this.isOverlaySheet&&(n=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(".nami-half-sheet-content"))&&(n.style.height=`${n.clientHeight}px`),this.pages=[t,e],this.currentOffset=0,r.n=3,a(this.updateComplete);case 3:requestAnimationFrame(()=>{this.currentOffset=1,setTimeout(()=>{this.pages=[e],this.currentOffset=0,this.paywall=e,n&&(n.style.height="")},nw)});case 4:return r.a(2)}},null,this,null,Promise)}},{key:"animateFullscreenEntry",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(new Promise(e=>requestAnimationFrame(()=>e())));case 1:return this.classList.remove("nami-fullscreen-entering"),this.classList.add("nami-fullscreen-entering-active"),e.n=2,a(new Promise(e=>setTimeout(e,nw)));case 2:this.classList.remove("nami-fullscreen-entering-active");case 3:return e.a(2)}},null,this,null,Promise)}},{key:"_captureExitOverlay",value:function(e){var t=this.shadowRoot;if(!t)return null;var n=t.querySelector(".nami-flow-container"),i=document.createElement("div");if(i.className="nami-fullscreen-exit-overlay",i.style.cssText=`\n position: fixed; inset: 0; z-index: 10000;\n pointer-events: none;\n background: ${e};\n overflow: hidden;\n `,n){var a=n.cloneNode(!0);a.style.transform="none",a.style.transition="none",i.appendChild(a)}return t.appendChild(i),i.offsetHeight,i}},{key:"_slideExitOverlayAway",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:if(e){n.n=1;break}return n.a(2);case 1:return t="undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,e.style.transition=t?"none":"transform 250ms ease-in",e.style.transform="translateY(100%)",n.n=2,a(new Promise(e=>setTimeout(e,t?0:nw)));case 2:e.remove();case 3:return n.a(2)}},null,null,null,Promise)}},{key:"flowNavigateToScreen",value:function(e,t){var n,i,r,o,s,u,l,d,c,h,m;return k(function(f){for(;;)switch(f.n){case 0:if(null!==(n=this.flow)&&void 0!==n&&n.previousFlowStep&&this.flow.executeLifecycle(this.flow.previousFlowStep,ac),r=this.presentationStyle,o=this.getPresentationStyle(e),s=0===this.pages.length,u="backward"===t.direction,"compact_sheet"!==r&&"sheet"!==r||"fullscreen"!==o){f.n=3;break}return this.classList.add("nami-fullscreen-entering"),this.presentationStyle="fullscreen",this.applyPresentationHostClasses(),f.n=1,a(this.updateComplete);case 1:return f.n=2,a(this.animateFullscreenEntry());case 2:f.n=11;break;case 3:if("fullscreen"!==r||"compact_sheet"!==o&&"sheet"!==o){f.n=10;break}if(!s&&!u){f.n=8;break}if(!u){f.n=6;break}return l=document.body.style.background||getComputedStyle(this).backgroundColor||"#000",this._sheetEntranceActive=!1,d=this._captureExitOverlay(l),this.presentationStyle=o,this.applyPresentationHostClasses(),this.pages=[e],this.paywall=e,f.n=4,a(this.updateComplete);case 4:return f.n=5,a(this._slideExitOverlayAway(d));case 5:f.n=7;break;case 6:this.presentationStyle=o,this.applyPresentationHostClasses();case 7:f.n=9;break;case 8:console.warn(`Unsupported forward transition: fullscreen → ${o}. Presenting as fullscreen.`);case 9:f.n=11;break;case 10:this.presentationStyle=o,this.applyPresentationHostClasses();case 11:return c=("compact_sheet"===r||"sheet"===r)&&"fullscreen"===o,h="fullscreen"===r&&("compact_sheet"===o||"sheet"===o),m=!("compact_sheet"!==r&&"sheet"!==r||"compact_sheet"!==o&&"sheet"!==o||r===o)||c||h,this.animation=m?{transition:"fade",direction:t.direction}:t,f.n=12,a(this.updatePages(e));case 12:null!==(i=this.flow)&&void 0!==i&&i.currentFlowStep&&this.flow.executeLifecycle(this.flow.currentFlowStep,ic);case 13:return f.a(2)}},null,this,null,Promise)}},{key:"getSelectedSlideIndexForCurrentCarousel",value:function(){return nf.getSelectedSlideIndex()}},{key:"renderFlow",value:function(){return"undefined"==typeof document?Pm(Ub||(Ub=ew``)):this.isOverlaySheet?this.renderHalfSheet():this.isModal?this.renderModal(this.renderFlowContainer()):this.renderFlowContainer()}},{key:"renderFlowContainer",value:function(){return Pm(Hb||(Hb=ew`
|
|
255
255
|
<div class="nami-flow-container">
|
|
256
256
|
${0}
|
|
257
257
|
</div>
|