@namiml/web-sdk 3.4.12-dev.202609302217 → 3.4.12-dev.202610060208

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.
@@ -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,_(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"function"==typeof a?function(e){return a.apply(n,e)}:a}function _(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function M(e){var t="function"==typeof Map?new Map:void 0;return M=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(g())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var a=new(e.bind.apply(e,i));return n&&P(a,n.prototype),a}(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),P(n,e)},M(e)}var A,D,x,C,I,L,F,R,O,$,N,W,j=function(){return c(function e(t){o(this,e),this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t},[{key:"shadowRoot",get:function(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function(){return!0}},{key:"setFormValue",value:function(){}},{key:"setValidity",value:function(){}}])}(),B=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},z=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},U={__proto__:null,enumerable:!0};Object.freeze(U);var H=($=function(){return c(function e(t,n={}){if(o(this,e),A.set(this,!1),D.set(this,!1),x.set(this,!1),C.set(this,!1),I.set(this,Date.now()),L.set(this,!1),F.set(this,void 0),R.set(this,void 0),O.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,0===arguments.length)throw new Error("The type argument must be specified");if("object"!=typeof n||!n)throw new Error('The "options" argument must be an object');var i=n.bubbles,a=n.cancelable,r=n.composed;B(this,A,!!a,"f"),B(this,D,!!i,"f"),B(this,x,!!r,"f"),B(this,F,`${t}`,"f"),B(this,R,null,"f"),B(this,O,!1,"f")},[{key:"initEvent",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function(){this.stopPropagation()}},{key:"preventDefault",value:function(){B(this,C,!0,"f")}},{key:"target",get:function(){return z(this,R,"f")}},{key:"currentTarget",get:function(){return z(this,R,"f")}},{key:"srcElement",get:function(){return z(this,R,"f")}},{key:"type",get:function(){return z(this,F,"f")}},{key:"cancelable",get:function(){return z(this,A,"f")}},{key:"defaultPrevented",get:function(){return z(this,A,"f")&&z(this,C,"f")}},{key:"timeStamp",get:function(){return z(this,I,"f")}},{key:"composedPath",value:function(){return z(this,O,"f")?[z(this,R,"f")]:[]}},{key:"returnValue",get:function(){return!z(this,A,"f")||!z(this,C,"f")}},{key:"bubbles",get:function(){return z(this,D,"f")}},{key:"composed",get:function(){return z(this,x,"f")}},{key:"eventPhase",get:function(){return z(this,O,"f")?$.AT_TARGET:$.NONE}},{key:"cancelBubble",get:function(){return z(this,L,"f")},set:function(e){e&&B(this,L,!0,"f")}},{key:"stopPropagation",value:function(){B(this,L,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),A=new WeakMap,D=new WeakMap,x=new WeakMap,C=new WeakMap,I=new WeakMap,L=new WeakMap,F=new WeakMap,R=new WeakMap,O=new WeakMap,$.NONE=0,$.CAPTURING_PHASE=1,$.AT_TARGET=2,$.BUBBLING_PHASE=3,$);Object.defineProperties(H.prototype,{initEvent:U,stopImmediatePropagation:U,preventDefault:U,target:U,currentTarget:U,srcElement:U,type:U,cancelable:U,defaultPrevented:U,timeStamp:U,composedPath:U,returnValue:U,bubbles:U,composed:U,eventPhase:U,cancelBubble:U,stopPropagation:U,isTrusted:U});var G=(W=function(e){function t(e,n={}){var i,a;return o(this,t),a=r(this,t,[e,n]),N.set(a,void 0),B(a,N,null!==(i=null==n?void 0:n.detail)&&void 0!==i?i:null,"f"),a}return p(t,e),c(t,[{key:"initCustomEvent",value:function(e,t,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function(){return z(this,N,"f")}}])}(H),N=new WeakMap,W);Object.defineProperties(G.prototype,{detail:U});var V,K,Y,X,q=H,J=G;(V=function(){return c(function e(){o(this,e),this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""},[{key:"parentRule",get:function(){return null}},{key:"parentStyleSheet",get:function(){return this.__parentStyleSheet}},{key:"type",get:function(){return 0}}])}()).STYLE_RULE=1,V.CHARSET_RULE=2,V.IMPORT_RULE=3,V.MEDIA_RULE=4,V.FONT_FACE_RULE=5,V.PAGE_RULE=6,V.NAMESPACE_RULE=10,V.KEYFRAMES_RULE=7,V.KEYFRAME_RULE=8,V.SUPPORTS_RULE=12,V.COUNTER_STYLE_RULE=11,V.FONT_FEATURE_VALUES_RULE=14,V.MARGIN_RULE=9,null!==(K=globalThis.Event)&&void 0!==K||(globalThis.Event=q),null!==(Y=globalThis.CustomEvent)&&void 0!==Y||(globalThis.CustomEvent=J);var Q=Symbol(),Z=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},ee={__proto__:null,enumerable:!0};Object.freeze(ee);var te=function(){return c(function e(){o(this,e),this.__eventListeners=new Map,this.__captureEventListeners=new Map},[{key:"addEventListener",value:function(e,t,n){var i;if(null!=t){var a=Z(n)?this.__captureEventListeners:this.__eventListeners,r=a.get(e);if(void 0===r)r=new Map,a.set(e,r);else if(r.has(t))return;var o="object"==typeof n&&n?n:{};null===(i=o.signal)||void 0===i||i.addEventListener("abort",()=>this.removeEventListener(e,t,n)),r.set(t,null!=o?o:{})}}},{key:"removeEventListener",value:function(e,t,n){if(null!=t){var i=Z(n)?this.__captureEventListeners:this.__eventListeners,a=i.get(e);void 0!==a&&(a.delete(t),a.size||i.delete(e))}}},{key:"dispatchEvent",value:function(e){var t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));var n=!1,i=!1,a=q.NONE,r=null,o=null,s=null,u=e.stopPropagation,l=e.stopImmediatePropagation;Object.defineProperties(e,{target:m({get:()=>null!=r?r:o},ee),srcElement:m({get:()=>e.target},ee),currentTarget:m({get:()=>s},ee),eventPhase:m({get:()=>a},ee),composedPath:m({value:()=>t},ee),stopPropagation:m({value:()=>{n=!0,u.call(e)}},ee),stopImmediatePropagation:m({value:()=>{i=!0,l.call(e)}},ee)});var d=(t,n,i)=>{"function"==typeof t?t(e):"function"==typeof(null==t?void 0:t.handleEvent)&&t.handleEvent(e),n.once&&i.delete(t)},c=()=>(s=null,a=q.NONE,!e.defaultPrevented),f=t.slice().reverse();r=this.__host&&e.composed?null:this;for(var v,p=e=>{for(o=this;o.__host&&e.includes(o.__host);)o=o.__host},g=h(f);!(v=g()).done;){var y=v.value;r||o&&o!==y.__host||p(f.slice(f.indexOf(y))),s=y,a=y===e.target?q.AT_TARGET:q.CAPTURING_PHASE;var b=y.__captureEventListeners.get(e.type);if(b)for(var w,k=h(b);!(w=k()).done;){var S=w.value;if(d(S[0],S[1],b),i)return c()}if(n)return c()}var E=e.bubbles?t:[this];o=null;for(var P,T=h(E);!(P=T()).done;){var _=P.value;r||o&&_!==o.__host||p(E.slice(0,E.indexOf(_)+1)),s=_,a=_===e.target?q.AT_TARGET:q.BUBBLING_PHASE;var M=_.__eventListeners.get(e.type);if(M)for(var A,D=h(M);!(A=D()).done;){var x=A.value;if(d(x[0],x[1],M),i)return c()}if(n)return c()}return c()}},{key:"__resolveFullEventPath",value:function(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,oe,pe]}}])}(),ne=new WeakMap,ie=e=>{var t=ne.get(e);return void 0===t&&ne.set(e,t=new Map),t},ae=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"getRootNode",value:function(e){var t;if(null!=e&&e.composed)return se;var n=this.__host;return null!==(t=null==n?void 0:n.__shadowRoot)&&void 0!==t?t:se}}])}(te),re=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"adoptedStyleSheets",get:function(){return[]}},{key:"createTreeWalker",value:function(){return{}}},{key:"createTextNode",value:function(){return{}}},{key:"createElement",value:function(){return{}}}])}(ae),oe=new re,se=oe,ue=function(e){function t(e){var n;if(o(this,t),n=r(this,t),e!==Q)throw new TypeError("Illegal constructor");return Object.assign(n,globalThis,{CustomElementRegistry:fe,customElements:ve,document:se,Document:re,Element:le,EventTarget:te,HTMLElement:de,Node:ae,ShadowRoot:he,window:n,Window:ue}),n}return p(t,e),c(t)}(ae),le=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).__shadowRootMode=null,e.__shadowRoot=null,e.__internals=null,e}return p(t,e),c(t,[{key:"attributes",get:function(){return Array.from(ie(this)).map(([e,t])=>({name:e,value:t}))}},{key:"shadowRoot",get:function(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}},{key:"localName",get:function(){return this.constructor.__localName}},{key:"tagName",get:function(){var e;return null===(e=this.localName)||void 0===e?void 0:e.toUpperCase()}},{key:"setAttribute",value:function(e,t){ie(this).set(e,String(t))}},{key:"removeAttribute",value:function(e){ie(this).delete(e)}},{key:"toggleAttribute",value:function(e,t){return this.hasAttribute(e)?!(void 0===t||!t)||(this.removeAttribute(e),!1):!(void 0!==t&&!t)&&(this.setAttribute(e,""),!0)}},{key:"hasAttribute",value:function(e){return ie(this).has(e)}},{key:"attachShadow",value:function(e){this.__shadowRootMode=e.mode;var t=new he(Q,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}},{key:"attachInternals",value:function(){if(null!==this.__internals)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var e=new j(this);return this.__internals=e,e}},{key:"getAttribute",value:function(e){var t=ie(this).get(e);return null!=t?t:null}}])}(ae),de=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(le),ce=de,he=function(e){function t(e,n){var i;if(o(this,t),i=r(this,t),e!=e)throw new TypeError("Illegal constructor");return i.mode=n.mode,i}return p(t,e),c(t,[{key:"host",get:function(){return this.__host}}])}(ae);function me(){var e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}null!==(X=globalThis.litServerRoot)&&void 0!==X||(globalThis.litServerRoot=Object.defineProperty(new ce,"localName",{get:()=>"lit-server-root"}));var fe=function(){return c(function e(){o(this,e),this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map},[{key:"define",value:function(e,t){var n,i;if(this.__definitions.has(e)){if("development"!==process.env.NODE_ENV)throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.`)}if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:null!==(n=t.observedAttributes)&&void 0!==n?n:[]}),this.__reverseDefinitions.set(t,e),null===(i=this.__pendingWhenDefineds.get(e))||void 0===i||i.resolve(t),this.__pendingWhenDefineds.delete(e)}},{key:"get",value:function(e){var t=this.__definitions.get(e);return null==t?void 0:t.ctor}},{key:"getName",value:function(e){var t;return null!==(t=this.__reverseDefinitions.get(e))&&void 0!==t?t:null}},{key:"initialize",value:function(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}},{key:"upgrade",value:function(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}},{key:"whenDefined",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:if(!(t=this.__definitions.get(e))){i.n=1;break}return i.a(2,t.ctor);case 1:return(n=this.__pendingWhenDefineds.get(e))||(n=me(),this.__pendingWhenDefineds.set(e,n)),i.a(2,n.promise)}},null,this,null,Promise)}}])}(),ve=new fe,pe=new ue(Q);"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ce);var ge=["action"],ye=null;var be={storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},getAllKeys:()=>[]},device:{getDeviceData:()=>({os_version:"",os_name:"",browser_name:"",browser_version:"",sdk_client:"",sdk_version:"",language:"en"}),getDeviceFormFactor:()=>"desktop",getDeviceScaleFactor:()=>1,generateUUID:()=>{throw new Error("No platform adapter registered — call registerPlatformAdapters() before Nami.configure()")},getScreenInfo:()=>({width:0,height:0,scale:1}),getLanguage:()=>"en"},ui:{createPaywall:()=>null,reRenderPaywall:()=>{},flowNavigateToScreen:()=>{}}};function we(){return null!=ye?ye:be}function ke(e,t,n,i){var a,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function Se(e,t,n,i){if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function Ee(e,t,n,i,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;var Pe;!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,_e={},Me=_e.NAMI_SDK_VERSION,Ae=void 0===Me?"3.4.12":Me,De=_e.NAMI_SDK_PACKAGE_VERSION,xe=void 0===De?"3.4.12-dev.202609302217":De,Ce=_e.PLATFORM_ID_REQUIRED,Ie=void 0===Ce?"Platform ID is required":Ce,Le=_e.DEVICE_ID_REQUIRED,Fe=void 0===Le?"Device ID is required":Le,Re=_e.EXTERNAL_ID_REQUIRED,Oe=void 0===Re?"External ID is required":Re,$e=_e.SDK_NOT_INITIALIZED,Ne=void 0===$e?"SDK has not been initialized. Make sure to call Nami.configure() first!":$e,We=_e.CAMPAIGN_NOT_AVAILABLE,je=void 0===We?"Campaign is not available":We,Be=_e.FLOW_SCREENS_NOT_AVAILABLE,ze=void 0===Be?"Flow screens not available":Be,Ue=_e.UNABLE_TO_UPDATE_CDP_ID,He=void 0===Ue?"Unable to update CDP id in anonymous mode":Ue,Ge=_e.ANONYMOUS_MODE_ALREADY_ON,Ve=void 0===Ge?"Anonymous mode is already turned on.":Ge,Ke=_e.ANONYMOUS_MODE_ALREADY_OFF,Ye=void 0===Ke?"Anonymous mode is already turned off.":Ke,Xe=_e.DEVICE_ID_NOT_SET,qe=void 0===Xe?"Nami Device ID is not set":Xe,Je=_e.AUTH_DEVICE,Qe=void 0===Je?"nami_auth_device":Je,Ze=_e.NAMI_CONFIGURATION,et=void 0===Ze?"nami_configuration":Ze,tt=_e.NAMI_PROFILE,nt=void 0===tt?"nami_profile":tt,it=_e.API_CONFIG,at=void 0===it?"api_config":it,rt=_e.API_CAMPAIGN_RULES,ot=void 0===rt?"api_campaign_rules":rt,st=_e.API_PAYWALLS,ut=void 0===st?"api_paywalls":st,lt=_e.API_CAMPAIGN_SESSION_TIMESTAMP,dt=void 0===lt?"api_campaign_session_timestamp":lt,ct=_e.API_PRODUCTS,ht=void 0===ct?"api_products":ct,mt=_e.API_ACTIVE_ENTITLEMENTS,ft=void 0===mt?"api_active_entitlements":mt,vt=_e.SERVER_NAMI_ENTITLEMENTS,pt=void 0===vt?"server_active_entitlements":vt,gt=_e.INITIAL_APP_CONFIG,yt=void 0===gt?"initial_app_config":gt,bt=_e.INITIAL_CAMPAIGN_RULES,wt=void 0===bt?"initial_campaign_rules":bt,kt=_e.INITIAL_PAYWALLS,St=void 0===kt?"initial_paywalls":kt,Et=_e.INITIAL_PRODUCTS,Pt=void 0===Et?"initial_products":Et,Tt=_e.LOCAL_NAMI_ENTITLEMENTS,_t=void 0===Tt?"local_active_entitlements":Tt,Mt=_e.CUSTOMER_ATTRIBUTES_KEY_PREFIX,At=void 0===Mt?"nami_cmr_attributes_":Mt,Dt=_e.NAMI_CUSTOMER_JOURNEY_STATE,xt=void 0===Dt?"nami_customer_journey_state":Dt,Ct=_e.ANONYMOUS_MODE,It=void 0===Ct?"nami_anonymous_mode_v2":Ct,Lt=_e.ANONYMOUS_UUID,Ft=void 0===Lt?"nami_anonymous_uuid":Lt,Rt=_e.KEY_SESSION_COUNTER,Ot=void 0===Rt?"nami_session_counter":Rt,$t=_e.INITIAL_SESSION_COUNTER_VALUE,Nt=void 0===$t?1:$t,Wt=_e.NAMI_LAST_IMPRESSION_ID,jt=void 0===Wt?"nami_last_impression_id":Wt,Bt=_e.NAMI_PURCHASE_IMPRESSION_ID,zt=void 0===Bt?"nami_purchase_impression_id":Bt,Ut=_e.NAMI_LAUNCH_ID,Ht=void 0===Ut?"nami_launch_id":Ut,Gt=_e.NAMI_SESSION_ID,Vt=void 0===Gt?"nami_session_id":Gt,Kt=_e.NAMI_LANGUAGE_CODE,Yt=void 0===Kt?"nami_language_code":Kt,Xt=_e.NAMI_PURCHASE_CHANNEL,qt=void 0===Xt?"nami_purchase_channel":Xt,Jt=_e.API_VERSION,Qt=_e.BASE_URL_PATH,Zt=void 0===Qt?`sdk/${void 0===Jt?"v3":Jt}/platform`:Qt,en=_e.BASE_URL,tn=void 0===en?"https://app.namiml.com":en,nn=_e.BASE_STAGING_URL,an=void 0===nn?"https://app-staging.namiml.com":nn,rn=_e.CUSTOM_HOST_PREFIX,on=void 0===rn?"namiAPIHost=":rn,sn=_e.USE_STAGING_API,un=void 0===sn?"useStagingAPI":sn,ln=_e.EXTENDED_CLIENT_INFO_PREFIX,dn=void 0===ln?"extendedClientInfo":ln,cn=_e.EXTENDED_CLIENT_INFO_DELIMITER,hn=void 0===cn?":":cn,mn=_e.VALIDATE_PRODUCT_GROUPS,fn=void 0===mn?"validateProductGroups":mn,vn=_e.LOG_HTTP_REQUESTS,pn=void 0===vn?"logHTTPRequests":vn,gn=_e.LOG_HTTP_TRAFFIC,yn=void 0===gn?"logHTTPTraffic":gn,bn=_e.API_TRAFFIC_OBSERVER,wn=void 0===bn?"apiTrafficObserver":bn,kn=_e.STARTUP_TELEMETRY,Sn=void 0===kn?"startupTelemetry":kn,En=_e.SIMULATE_CONFIG_FETCH_FAILURE,Pn=void 0===En?"simulateConfigFetchFailure":En,Tn=_e.SIMULATE_PAYWALL_FETCH_FAILURE,_n=void 0===Tn?"simulatePaywallFetchFailure":Tn,Mn=_e.CAMPAIGN_CACHE_TTL_PREFIX,An=void 0===Mn?"campaignCacheTTL=":Mn,Dn=_e.TIME_OVERRIDE_PREFIX,xn=void 0===Dn?"timeOverride=":Dn,Cn=_e.SYSTEM_TIME_TOKEN_PREFIX,In=void 0===Cn?"${system.time.":Cn,Ln=_e.API_MAX_CALLS_LIMIT,Fn=void 0===Ln?2:Ln,Rn=_e.API_RETRY_DELAY_SEC,On=void 0===Rn?2:Rn,$n=_e.API_TIMEOUT_LIMIT,Nn=void 0===$n?2e4:$n,Wn=_e.DEVICE_API_TIMEOUT_LIMIT,jn=void 0===Wn?2e3:Wn,Bn=_e.CONFIG_MAX_ATTEMPTS,zn=void 0===Bn?3:Bn,Un=_e.CONFIG_API_TIMEOUT_LIMIT,Hn=void 0===Un?1e4:Un,Gn=_e.RESUME_THROTTLE_MS,Vn=void 0===Gn?3e4:Gn,Kn=_e.STATUS_BAD_REQUEST,Yn=void 0===Kn?400:Kn,Xn=_e.STATUS_NOT_FOUND,qn=void 0===Xn?404:Xn,Jn=_e.STATUS_CONFLICT,Qn=void 0===Jn?409:Jn,Zn=_e.STATUS_INTERNAL_SERVER_ERROR,ei=void 0===Zn?500:Zn,ti=_e.INITIAL_SUCCESS,ni=void 0===ti?"Initial success":ti,ii=_e.RECONFIG_SUCCESS,ai=void 0===ii?"Reconfig success":ii,ri=_e.ALREADY_CONFIGURED,oi=void 0===ri?"Already configured":ri,si=_e.AVAILABLE_CAMPAIGNS_CHANGED,ui=void 0===si?"AvailableCampaignsChanged":si,li=_e.PAYWALL_ACTION_EVENT,di=void 0===li?"PaywallActionEvent":li,ci=_e.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,hi=void 0===ci?"AvailableActiveEntitlementsChanged":ci,mi=_e.CUSTOMER_JOURNEY_STATE_CHANGED,fi=void 0===mi?"CustomerJourneyStateChanged":mi,vi=_e.SKU_TEXT_REGEX,pi=void 0===vi?/\$\{sku\.(\w+)(:\d+)?\}/g:vi,gi=_e.VAR_REGEX,yi=void 0===gi?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:gi,bi=_e.SMART_TEXT_PATTERN,wi=void 0===bi?"${":bi,ki=_e.LIQUID_VARIABLE_REGEX,Si=void 0===ki?/\${[A-Za-z0-9.]+}/g:ki,Ei=[Qe,et,nt,at,ot,ut,dt,ht,ft,pt,yt,wt,St,Pt,_t,xt,It,Ft,Ot,jt,zt,Ht,Vt,Yt,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 Pi={debug:e.LogLevel.DEBUG,info:e.LogLevel.INFO,warn:e.LogLevel.WARN,error:e.LogLevel.ERROR},Ti=function(){return c(function t(){o(this,t),this.currentLogLevel=e.LogLevel.DEBUG,this.setLogger=t=>{this.currentLogLevel=t?Pi[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)}`}}])}(),_i=new Ti;function Mi(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 Ai(e,t){return e===t||e!=e&&t!=t}function Di(e,t){for(var n=e.length;n--;)if(Ai(e[n][0],t))return n;return-1}var xi=Array.prototype.splice;function Ci(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])}}Ci.prototype.clear=function(){this.__data__=[],this.size=0},Ci.prototype.delete=function(e){var t=this.__data__,n=Di(t,e);return!(n<0)&&(n==t.length-1?t.pop():xi.call(t,n,1),--this.size,!0)},Ci.prototype.get=function(e){var t=this.__data__,n=Di(t,e);return n<0?void 0:t[n][1]},Ci.prototype.has=function(e){return Di(this.__data__,e)>-1},Ci.prototype.set=function(e,t){var n=this.__data__,i=Di(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Ii="object"==typeof global&&global&&global.Object===Object&&global,Li="object"==typeof self&&self&&self.Object===Object&&self,Fi=Ii||Li||Function("return this")(),Ri=Fi.Symbol,Oi=Object.prototype,$i=Oi.hasOwnProperty,Ni=Oi.toString,Wi=Ri?Ri.toStringTag:void 0;var ji=Object.prototype.toString;var Bi=Ri?Ri.toStringTag:void 0;function zi(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Bi&&Bi in Object(e)?function(e){var t=$i.call(e,Wi),n=e[Wi];try{e[Wi]=void 0;var i=!0}catch(e){}var a=Ni.call(e);return i&&(t?e[Wi]=n:delete e[Wi]),a}(e):function(e){return ji.call(e)}(e)}function Ui(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Hi(e){if(!Ui(e))return!1;var t=zi(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Gi,Vi=Fi["__core-js_shared__"],Ki=(Gi=/[^.]+$/.exec(Vi&&Vi.keys&&Vi.keys.IE_PROTO||""))?"Symbol(src)_1."+Gi:"";var Yi=Function.prototype.toString;function Xi(e){if(null!=e){try{return Yi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var qi=/^\[object .+?Constructor\]$/,Ji=Function.prototype,Qi=Object.prototype,Zi=Ji.toString,ea=Qi.hasOwnProperty,ta=RegExp("^"+Zi.call(ea).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function na(e){return!(!Ui(e)||(t=e,Ki&&Ki in t))&&(Hi(e)?ta:qi).test(Xi(e));var t}function ia(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return na(n)?n:void 0}var aa=ia(Fi,"Map"),ra=ia(Object,"create");var oa=Object.prototype.hasOwnProperty;var sa=Object.prototype.hasOwnProperty;function ua(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 la(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 da(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])}}ua.prototype.clear=function(){this.__data__=ra?ra(null):{},this.size=0},ua.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ua.prototype.get=function(e){var t=this.__data__;if(ra){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return oa.call(t,e)?t[e]:void 0},ua.prototype.has=function(e){var t=this.__data__;return ra?void 0!==t[e]:sa.call(t,e)},ua.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ra&&void 0===t?"__lodash_hash_undefined__":t,this},da.prototype.clear=function(){this.size=0,this.__data__={hash:new ua,map:new(aa||Ci),string:new ua}},da.prototype.delete=function(e){var t=la(this,e).delete(e);return this.size-=t?1:0,t},da.prototype.get=function(e){return la(this,e).get(e)},da.prototype.has=function(e){return la(this,e).has(e)},da.prototype.set=function(e,t){var n=la(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function ca(e){var t=this.__data__=new Ci(e);this.size=t.size}ca.prototype.clear=function(){this.__data__=new Ci,this.size=0},ca.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ca.prototype.get=function(e){return this.__data__.get(e)},ca.prototype.has=function(e){return this.__data__.has(e)},ca.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ci){var i=n.__data__;if(!aa||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new da(i)}return n.set(e,t),this.size=n.size,this};function ha(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new da;++t<n;)this.add(e[t])}function ma(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 fa(e,t){return e.has(t)}ha.prototype.add=ha.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ha.prototype.has=function(e){return this.__data__.has(e)};function va(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 ha: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(!ma(t,function(e,t){if(!fa(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 pa=Fi.Uint8Array;function ga(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function ya(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var ba=Ri?Ri.prototype:void 0,wa=ba?ba.valueOf:void 0;var ka=Array.isArray;var Sa=Object.prototype.propertyIsEnumerable,Ea=Object.getOwnPropertySymbols,Pa=Ea?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}(Ea(e),function(t){return Sa.call(e,t)}))}:function(){return[]};function Ta(e){return null!=e&&"object"==typeof e}function _a(e){return Ta(e)&&"[object Arguments]"==zi(e)}var Ma=Object.prototype,Aa=Ma.hasOwnProperty,Da=Ma.propertyIsEnumerable,xa=_a(function(){return arguments}())?_a:function(e){return Ta(e)&&Aa.call(e,"callee")&&!Da.call(e,"callee")};var Ca="object"==typeof e&&e&&!e.nodeType&&e,Ia=Ca&&"object"==typeof module&&module&&!module.nodeType&&module,La=Ia&&Ia.exports===Ca?Fi.Buffer:void 0,Fa=(La?La.isBuffer:void 0)||function(){return!1},Ra=/^(?:0|[1-9]\d*)$/;function Oa(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&Ra.test(e))&&e>-1&&e%1==0&&e<t}function $a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Na={};function Wa(e){return function(t){return e(t)}}Na["[object Float32Array]"]=Na["[object Float64Array]"]=Na["[object Int8Array]"]=Na["[object Int16Array]"]=Na["[object Int32Array]"]=Na["[object Uint8Array]"]=Na["[object Uint8ClampedArray]"]=Na["[object Uint16Array]"]=Na["[object Uint32Array]"]=!0,Na["[object Arguments]"]=Na["[object Array]"]=Na["[object ArrayBuffer]"]=Na["[object Boolean]"]=Na["[object DataView]"]=Na["[object Date]"]=Na["[object Error]"]=Na["[object Function]"]=Na["[object Map]"]=Na["[object Number]"]=Na["[object Object]"]=Na["[object RegExp]"]=Na["[object Set]"]=Na["[object String]"]=Na["[object WeakMap]"]=!1;var ja="object"==typeof e&&e&&!e.nodeType&&e,Ba=ja&&"object"==typeof module&&module&&!module.nodeType&&module,za=Ba&&Ba.exports===ja&&Ii.process,Ua=function(){try{var e=Ba&&Ba.require&&Ba.require("util").types;return e||za&&za.binding&&za.binding("util")}catch(e){}}(),Ha=Ua&&Ua.isTypedArray,Ga=Ha?Wa(Ha):function(e){return Ta(e)&&$a(e.length)&&!!Na[zi(e)]},Va=Object.prototype.hasOwnProperty;function Ka(e,t){var n=ka(e),i=!n&&xa(e),a=!n&&!i&&Fa(e),r=!n&&!i&&!a&&Ga(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)!Va.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Oa(l,u))||s.push(l);return s}var Ya=Object.prototype;function Xa(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ya)}function qa(e,t){return function(n){return e(t(n))}}var Ja=qa(Object.keys,Object),Qa=Object.prototype.hasOwnProperty;function Za(e){return null!=(t=e)&&$a(t.length)&&!Hi(t)?Ka(e):function(e){if(!Xa(e))return Ja(e);var t=[];for(var n in Object(e))Qa.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}function er(e){return function(e,t,n){var i=t(e);return ka(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,Za,Pa)}var tr=Object.prototype.hasOwnProperty;var nr=ia(Fi,"DataView"),ir=ia(Fi,"Promise"),ar=ia(Fi,"Set"),rr=ia(Fi,"WeakMap"),or="[object Map]",sr="[object Promise]",ur="[object Set]",lr="[object WeakMap]",dr="[object DataView]",cr=Xi(nr),hr=Xi(aa),mr=Xi(ir),fr=Xi(ar),vr=Xi(rr),pr=zi;(nr&&pr(new nr(new ArrayBuffer(1)))!=dr||aa&&pr(new aa)!=or||ir&&pr(ir.resolve())!=sr||ar&&pr(new ar)!=ur||rr&&pr(new rr)!=lr)&&(pr=function(e){var t=zi(e),n="[object Object]"==t?e.constructor:void 0,i=n?Xi(n):"";if(i)switch(i){case cr:return dr;case hr:return or;case mr:return sr;case fr:return ur;case vr:return lr}return t});var gr="[object Arguments]",yr="[object Array]",br="[object Object]",wr=Object.prototype.hasOwnProperty;function kr(e,t,n,i,a,r){var o=ka(e),s=ka(t),u=o?yr:pr(e),l=s?yr:pr(t),d=(u=u==gr?br:u)==br,c=(l=l==gr?br:l)==br,h=u==l;if(h&&Fa(e)){if(!Fa(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new ca),o||Ga(e)?va(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 pa(e),new pa(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ai(+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=ga;case"[object Set]":var u=1&i;if(s||(s=ya),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=va(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(wa)return wa.call(e)==wa.call(t)}return!1}(e,t,u,n,i,a,r);if(!(1&n)){var m=d&&wr.call(e,"__wrapped__"),f=c&&wr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new ca),a(v,p,n,i,r)}}return!!h&&(r||(r=new ca),function(e,t,n,i,a,r){var o=1&n,s=er(e),u=s.length;if(u!=er(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:tr.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 Sr(e,t,n,i,a){return e===t||(null==e||null==t||!Ta(e)&&!Ta(t)?e!=e&&t!=t:kr(e,t,n,i,Sr,a))}function Er(e){return e==e&&!Ui(e)}function Pr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Tr(e){var t=function(e){for(var t=Za(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,Er(a)]}return t}(e);return 1==t.length&&t[0][2]?Pr(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(!Sr(l,u,3,i,new ca))return!1}return!0}(n,0,t)}}function _r(e){return"symbol"==typeof e||Ta(e)&&"[object Symbol]"==zi(e)}var Mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ar=/^\w*$/;function Dr(e,t){if(ka(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!_r(e))||(Ar.test(e)||!Mr.test(e)||null!=t&&e in Object(t))}function xr(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(xr.Cache||da),n}xr.Cache=da;var Cr,Ir,Lr,Fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rr=/\\(\\)?/g,Or=(Cr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Fr,function(e,n,i,a){t.push(i?a.replace(Rr,"$1"):n||e)}),t},Ir=xr(Cr,function(e){return 500===Lr.size&&Lr.clear(),e}),Lr=Ir.cache,Ir);var $r=Ri?Ri.prototype:void 0,Nr=$r?$r.toString:void 0;function Wr(e){if("string"==typeof e)return e;if(ka(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,Wr)+"";if(_r(e))return Nr?Nr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jr(e,t){return ka(e)?e:Dr(e,t)?[e]:Or(function(e){return null==e?"":Wr(e)}(e))}function Br(e){if("string"==typeof e||_r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function zr(e,t){for(var n=0,i=(t=jr(t,e)).length;null!=e&&n<i;)e=e[Br(t[n++])];return n&&n==i?e:void 0}function Ur(e,t){return null!=e&&t in Object(e)}function Hr(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=jr(t,e)).length,r=!1;++i<a;){var o=Br(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&$a(a)&&Oa(o,a)&&(ka(e)||xa(e))}(e,t,Ur)}function Gr(e,t){return Dr(e)&&Er(t)?Pr(Br(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:zr(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?Hr(n,e):Sr(t,i,3)}}function Vr(e){return e}function Kr(e){return Dr(e)?(t=Br(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return zr(t,e)}}(e);var t}function Yr(e){return e!=e}function Xr(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,Yr,n)}(e,t,0)>-1}var qr=ar&&1/ya(new ar([,-0]))[1]==1/0?function(e){return new ar(e)}:function(){};function Jr(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Xr,r=e.length,o=!0,s=[],u=s;if(r>=200){var l=t?null:qr(e);if(l)return ya(l);o=!1,a=fa,u=new ha}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?Vr:"object"==typeof n?ka(n)?Gr(n[0],n[1]):Tr(n):Kr(n)):[];var n}var Qr="api_paywall_body:",Zr="api_paywall_body_meta:",eo=function(){return c(function e(t=()=>we().storage,n=500){o(this,e),this.storage=t,this.maxEntries=n,this.memory=null,this.index=null},[{key:"count",get:function(){return this.memory?this.memory.size:this.loadIndex().size}},{key:"evaluateTtl",value:function(e,t=Date.now()){if(0===e){if(this.memory)return;return this.dropPersisted([...this.loadIndex().keys()]),void(this.memory=new Map)}if(this.memory=null,null!==e){var n=[...this.loadIndex().values()].filter(n=>to(n,e,t));this.dropPersisted(n.map(e=>e.url))}}},{key:"validEntry",value:function(e,t,n=Date.now()){var i;if(this.memory)return null!==(i=this.memory.get(e))&&void 0!==i?i:null;var a=this.loadIndex().get(e);if(!a)return null;if(null!==t&&t>0&&to(a,t,n))return this.dropPersisted([e]),null;var r=this.read(Qr+e);return null===r?(this.dropPersisted([e]),null):{meta:a,body:r}}},{key:"bodyFor",value:function(e){var t,n;return this.memory?null!==(t=null===(n=this.memory.get(e))||void 0===n?void 0:n.body)&&void 0!==t?t:null:this.read(Qr+e)}},{key:"store",value:function(e,t,n,i=Date.now()){var a=m({url:e,savedAt:i},t?{contentHash:t}:{});if(this.memory)return this.memory.set(e,{meta:a,body:n}),!0;var r=this.loadIndex(),o=JSON.stringify(a);return this.write(Qr+e,n)&&this.write(Zr+e,o)?(r.set(e,a),!0):(_i.warn(`Paywall body cache: could not store ${e}; it will be fetched next time`),this.dropPersisted([e]),!1)}},{key:"seedIfAbsent",value:function(e,t,n,i=Date.now()){return!(this.memory?this.memory.has(e):this.loadIndex().has(e))&&this.store(e,t,n,i)}},{key:"remove",value:function(e){this.memory?this.memory.delete(e):this.dropPersisted([e])}},{key:"reconcile",value:function(e){var t=this.memory?[...this.memory.values()].map(e=>e.meta):[...this.loadIndex().values()],n=t.filter(t=>!e.has(t.url)).map(e=>e.url),i=t.filter(t=>e.has(t.url)).sort((e,t)=>e.savedAt-t.savedAt);[...n,...i.slice(0,Math.max(0,i.length-this.maxEntries)).map(e=>e.url)].forEach(e=>this.remove(e))}},{key:"purgeAll",value:function(){var e;this.dropPersisted([...this.loadIndex().keys()]),null===(e=this.memory)||void 0===e||e.clear()}},{key:"loadIndex",value:function(){if(this.index)return this.index;var e;this.index=new Map;try{e=this.storage().getAllKeys()}catch(e){return _i.warn(`Paywall body cache: storage unavailable, caching nothing (${e})`),this.index}for(var t,n=new Set(e.filter(e=>e.startsWith(Qr)).map(e=>e.slice(17))),i=[],a=h(e);!(t=a()).done;){var r=t.value;if(r.startsWith(Zr)){var o=r.slice(22),s=no(this.read(r));(null==s?void 0:s.url)===o&&n.has(o)?this.index.set(o,s):i.push(o),n.delete(o)}}return this.dropPersisted([...i,...n]),this.index}},{key:"dropPersisted",value:function(e){for(var t,n=h(e);!(t=n()).done;){var i,a=t.value;null===(i=this.index)||void 0===i||i.delete(a),this.removeKey(Zr+a),this.removeKey(Qr+a)}}},{key:"read",value:function(e){try{return this.storage().getItem(e)}catch(e){return null}}},{key:"write",value:function(e,t){try{this.storage().setItem(e,t)}catch(e){return!1}return this.read(e)===t}},{key:"removeKey",value:function(e){try{this.storage().removeItem(e)}catch(e){}}}])}();function to(e,t,n){return(n-e.savedAt)/1e3>=t}function no(e){if(null===e)return null;try{var t=JSON.parse(e);return"string"==typeof(null==t?void 0:t.url)&&"number"==typeof(null==t?void 0:t.savedAt)?t:null}catch(e){return null}}var io=new eo,ao=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(Yt,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(Yt)||"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:"setApiPaywallsFromBodyCache",value:function(e){var t={bodyCacheUrls:e};0!==this.getCampaignCacheTtl()?this.setItem(ut,t):this.memoryStore[ut]=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){var n=JSON.parse(t);return ro(n)?oo(n.bodyCacheUrls):n}var i=this.getItem(ut);if(null===i)return null;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){return i}return ro(i)?oo(i.bodyCacheUrls):this.isLegacyTimestampedCache(i)?i.data:i}return this.getItem(e)}},{key:"setActiveEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getActiveEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setNamiEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getNamiEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setProducts",value:function(e,t){this.setItem(e,t)}},{key:"getProducts",value:function(e){return this.getItem(e)}},{key:"getCachedProducts",value:function(){var e,t,n=null!==(e=this.getItem(ht))&&void 0!==e?e:[];return Jr(Mi([...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:"getAllCustomerAttributesMap",value:function(){var e={};return this.getAllCustomerAttributesKeys().forEach(t=>{var n=this.getCustomerAttribute(t);null!=n&&(e[t]=String(n))}),e}},{key:"clearCustomerAttribute",value:function(e){var t=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(Ft)}},{key:"setAnonymousUUID",value:function(e){this.setItem(Ft,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(Ft)}},{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,n=null===(e=this.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.filter(e=>e.startsWith(An)).map(e=>e.slice(An.length)).find(e=>/^\d+$/.test(e));if(void 0!==n)return parseInt(n,10);var i=this.getAppConfig(at)||this.getAppConfig(yt);return null!==(t=null==i?void 0:i.campaign_cache_ttl)&&void 0!==t?t:null}},{key:"isLegacyTimestampedCache",value:function(e){return"object"==typeof e&&null!==e&&"cachedAt"in e&&"data"in e}},{key:"setItem",value:function(e,t){var n;try{n=JSON.stringify(t)}catch(t){return void _i.error(`Serialization failed for ${e}`,t)}try{this.storage.setItem(e,n)}catch(t){_i.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){_i.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){_i.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clearAll",value:function(){Ei.forEach(e=>this.resetItem(e)),this.clearAllCustomerAttributes(),this.memoryStore={}}},{key:"clear",value:function(){try{this.storage.clear()}catch(e){_i.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}();function ro(e){return"object"==typeof e&&null!==e&&Array.isArray(e.bodyCacheUrls)}function oo(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a=t.value,r=io.bodyFor(a);if(null!==r)try{n.push(JSON.parse(r))}catch(e){io.remove(a)}}return n}var so=new ao,uo=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.status=e,i.message=`RetryLimitExceededError: ${i.message}`,i}return p(t,e),c(t)}(M(Error)),lo=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(M(Error)),co=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)}(lo),ho=function(e){function t(){return o(this,t),r(this,t,[Ne])}return p(t,e),c(t)}(M(Error)),mo=function(e){function t(){return o(this,t),r(this,t,[Ie])}return p(t,e),c(t)}(M(Error)),fo=function(e){function t(){return o(this,t),r(this,t,[Fe])}return p(t,e),c(t)}(M(Error)),vo=function(e){function t(){return o(this,t),r(this,t,[Oe])}return p(t,e),c(t)}(M(Error)),po=function(e){function t(){return o(this,t),r(this,t,[je])}return p(t,e),c(t)}(M(Error)),go=function(e){function t(){return o(this,t),r(this,t,[ze])}return p(t,e),c(t)}(M(Error)),yo=function(e){function t(){return o(this,t),r(this,t,[Ve])}return p(t,e),c(t)}(M(Error)),bo=function(e){function t(){return o(this,t),r(this,t,[Ye])}return p(t,e),c(t)}(M(Error)),wo=function(e){function t(){return o(this,t),r(this,t,[Ye])}return p(t,e),c(t)}(M(Error)),ko=function(e){function t(){return o(this,t),r(this,t,[He])}return p(t,e),c(t)}(M(Error)),So=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)}(lo),Eo=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)}(lo),Po=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)}(lo),To=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)}(lo),_o=(e,t)=>{if(e==Yn)throw new So(t);if(e==qn)throw new Eo(t);if(e==Qn)throw new co;if(e>Yn&&e<ei)throw new Po(e,t);if(e>=ei)throw new To(t)};function Mo(e){for(var t=e.length;--t>=0;)e[t]=0}Mo(new Array(576)),Mo(new Array(60)),Mo(new Array(512)),Mo(new Array(256)),Mo(new Array(29)),Mo(new Array(30));var Ao=(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},Do=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})()),xo=(e,t,n,i)=>{var a=Do,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^e},Co={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"},Io=0,Lo=4,Fo=5,Ro=6,Oo=0,$o=1,No=2,Wo=-2,jo=-3,Bo=-4,zo=-5,Uo=8,Ho=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Go=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)Ho(n,i)&&(e[i]=n[i])}}return e},Vo=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 Yo=new Uint8Array(256),Xo=0;Xo<256;Xo++)Yo[Xo]=Xo>=252?6:Xo>=248?5:Xo>=240?4:Xo>=224?3:Xo>=192?2:1;Yo[254]=Yo[254]=1;var qo=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},Jo=(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=Yo[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)},Qo=(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+Yo[e[n]]>t?n:t};var Zo=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},es=16209,ts=function(e,t){var n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,T,_=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,T=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=_.dmax,u=_.wsize,l=_.whave,d=_.wnext,c=_.window,h=_.hold,m=_.bits,f=_.lencode,v=_.distcode,p=(1<<_.lenbits)-1,g=(1<<_.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){_.mode=16191;break e}e.msg="invalid literal/length code",_.mode=es;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",_.mode=es;break e}if(h>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>l&&_.sane){e.msg="invalid distance too far back",_.mode=es;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",_.mode=es;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),_.hold=h,_.bits=m},ns=15,is=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]),as=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]),rs=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]),os=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]),ss=(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,_=0,M=0,A=null,D=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=ns;y++)D[y]=0;for(b=0;b<i;b++)D[t[n+b]]++;for(S=g,k=ns;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<=ns;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<ns;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=is,C=as,m=257):(A=rs,C=os,m=0),M=0,b=0,y=w,h=r,E=S,P=0,d=-1,c=(_=1<<S)-1,1===e&&_>852||2===e&&_>592)return 1;for(;;){f=y-P,o[b]+1<m?(v=0,p=o[b]):o[b]>=m?(v=C[o[b]-m],p=A[o[b]-m]):(v=96,p=0),u=1<<y-P,w=l=1<<E;do{a[h+(M>>P)+(l-=u)]=f<<24|v<<16|p}while(0!==l);for(u=1<<y-1;M&u;)u>>=1;if(0!==u?(M&=u-1,M+=u):M=0,b++,0===--D[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(M&c)!==d){for(0===P&&(P=S),h+=w,T=1<<(E=y-P);E+P<k&&!((T-=D[E+P])<=0);)E++,T<<=1;if(_+=1<<E,1===e&&_>852||2===e&&_>592)return 1;a[d=M&c]=S<<24|E<<16|h-r}}return 0!==M&&(a[h+M]=y-P<<24|64<<16),s.bits=S,0},us=Lo,ls=Fo,ds=Ro,cs=Oo,hs=$o,ms=No,fs=Wo,vs=jo,ps=Bo,gs=zo,ys=Uo,bs=16180,ws=16190,ks=16191,Ss=16192,Es=16194,Ps=16199,Ts=16200,_s=16206,Ms=16209,As=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Ds(){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 xs,Cs,Is=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<bs||t.mode>16211?1:0},Ls=e=>{if(Is(e))return fs;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=bs,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,cs},Fs=e=>{if(Is(e))return fs;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ls(e)},Rs=(e,t)=>{var n;if(Is(e))return fs;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?fs:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,Fs(e))},Os=(e,t)=>{if(!e)return fs;var n=new Ds;e.state=n,n.strm=e,n.window=null,n.mode=bs;var i=Rs(e,t);return i!==cs&&(e.state=null),i},$s=!0,Ns=e=>{if($s){xs=new Int32Array(512),Cs=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(ss(1,e.lens,0,288,xs,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ss(2,e.lens,0,32,Cs,0,e.work,{bits:5}),$s=!1}e.lencode=xs,e.lenbits=9,e.distcode=Cs,e.distbits=5},Ws=(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},js=(e,t)=>{var n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,T,_=0,M=new Uint8Array(4),A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Is(e)||!e.output||!e.input&&0!==e.avail_in)return fs;(n=e.state).mode===ks&&(n.mode=Ss),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=cs;e:for(;;)switch(n.mode){case bs:if(0===n.wrap){n.mode=Ss;break}for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,M[0]=255&l,M[1]=l>>>8&255,n.check=xo(n.check,M,2,0),l=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Ms;break}if((15&l)!==ys){e.msg="unknown compression method",n.mode=Ms;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=Ms;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:ks,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)!==ys){e.msg="unknown compression method",n.mode=Ms;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Ms;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=xo(n.check,M,2,0)),l=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,M[2]=l>>>16&255,M[3]=l>>>24&255,n.check=xo(n.check,M,4,0)),l=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=xo(n.check,M,2,0)),l=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=xo(n.check,M,2,0)),l=0,d=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((m=n.length)>s&&(m=s),m&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(r,r+m),S)),512&n.flags&&4&n.wrap&&(n.check=xo(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=xo(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=xo(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=Ms;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=ks;break;case 16189:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}e.adler=n.check=As(l),l=0,d=0,n.mode=ws;case ws: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,ms;e.adler=n.check=1,n.mode=ks;case ks:if(t===ls||t===ds)break e;case Ss:if(n.last){l>>>=7&d,d-=7&d,n.mode=_s;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(Ns(n),n.mode=Ps,t===ds){l>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Ms}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=Ms;break}if(n.length=65535&l,l=0,d=0,n.mode=Es,t===ds)break e;case Es: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=ks;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=Ms;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=ss(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid code lengths set",n.mode=Ms;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(_=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&_,!((p=_>>>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=Ms;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=Ms;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===Ms)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Ms;break}if(n.lenbits=9,P={bits:n.lenbits},E=ss(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=Ms;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},E=ss(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=Ms;break}if(n.mode=Ps,t===ds)break e;case Ps:n.mode=Ts;case Ts: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,ts(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===ks&&(n.back=-1);break}for(n.back=0;g=(_=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&_,!((p=_>>>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=(_=n.lencode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&_,!(b+(p=_>>>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=ks;break}if(64&g){e.msg="invalid literal/length code",n.mode=Ms;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=(_=n.distcode[l&(1<<n.distbits)-1])>>>16&255,y=65535&_,!((p=_>>>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=(_=n.distcode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&_,!(b+(p=_>>>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=Ms;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=Ms;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=Ms;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=Ts);break;case 16205:if(0===u)break e;a[o++]=n.length,u--,n.mode=Ts;break;case _s: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?xo(n.check,a,h,o-h):Ao(n.check,a,h,o-h)),h=u,4&n.wrap&&(n.flags?l:As(l))!==n.check){e.msg="incorrect data check",n.mode=Ms;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=Ms;break}l=0,d=0}n.mode=16208;case 16208:E=hs;break e;case Ms:E=vs;break e;case 16210:return ps;default:return fs}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<Ms&&(n.mode<_s||t!==us))&&Ws(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?xo(n.check,a,h,e.next_out-h):Ao(n.check,a,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ks?128:0)+(n.mode===Ps||n.mode===Es?256:0),(0===c&&0===h||t===us)&&E===cs&&(E=gs),E},Bs={inflateReset:Fs,inflateReset2:Rs,inflateResetKeep:Ls,inflateInit:e=>Os(e,15),inflateInit2:Os,inflate:js,inflateEnd:e=>{if(Is(e))return fs;var t=e.state;return t.window&&(t.window=null),e.state=null,cs},inflateGetHeader:(e,t)=>{if(Is(e))return fs;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,cs):fs},inflateSetDictionary:(e,t)=>{var n,i=t.length;return Is(e)||0!==(n=e.state).wrap&&n.mode!==ws?fs:n.mode===ws&&Ao(1,t,i,0)!==n.check?vs:Ws(e,t,i,i)?(n.mode=16210,ps):(n.havedict=1,cs)},inflateInfo:"pako inflate (from Nodeca project)"};var zs=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},Us=Object.prototype.toString,Hs=Io,Gs=Lo,Vs=Oo,Ks=$o,Ys=No,Xs=Wo,qs=jo,Js=Bo;function Qs(e){this.options=Go({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 Zo,this.strm.avail_out=0;var n=Bs.inflateInit2(this.strm,t.windowBits);if(n!==Vs)throw new Error(Co[n]);if(this.header=new zs,Bs.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=qo(t.dictionary):"[object ArrayBuffer]"===Us.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Bs.inflateSetDictionary(this.strm,t.dictionary))!==Vs))throw new Error(Co[n])}Qs.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?Gs:Hs,"[object ArrayBuffer]"===Us.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=Bs.inflate(r,i))===Ys&&s&&((n=Bs.inflateSetDictionary(r,s))===Vs?n=Bs.inflate(r,i):n===qs&&(n=Ys));r.avail_in>0&&n===Ks&&r.state.wrap>0&&0!==e[r.next_in];)Bs.inflateReset(r),n=Bs.inflate(r,i);switch(n){case Xs:case qs:case Ys:case Js: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=Qo(r.output,r.next_out),l=r.next_out-u,d=Jo(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!==Vs||0!==a){if(n===Ks)return n=Bs.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Qs.prototype.onData=function(e){this.chunks.push(e)},Qs.prototype.onEnd=function(e){e===Vs&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Vo(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Zs={ungzip:function(e,t){var n=new Qs(t);if(n.push(e),n.err)throw n.msg||Co[n.err];return n.result}}.ungzip,eu=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},tu=e=>{var t,n,i=so.getAppConfig(at)||so.getAppConfig(yt);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},nu=()=>so.getCampaignCacheTtl(),iu=()=>{var e=nu();if(null!==e)if(0!==e){var t=so.getApiCampaignSessionTimestamp();if(null!==t)(Date.now()-t)/1e3>=e&&so.purgeApiCampaignCache()}else so.purgeApiCampaignCache()},au=e=>{var t=!tu(Pe.THIRD_PARTY_TRANSACTIONS);return e&&!t&&_i.info(`[${e}] Your plan does not have purchase management features.`),t},ru=()=>{var e,t,n=null===(e=so.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(pn))&&void 0!==t&&t},ou=()=>{var e,t,n=null===(e=so.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(yn))&&void 0!==t&&t};function su(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=Zs(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}var uu=null;function lu(){return null!==uu&&(n=null===(e=so.getNamiConfig())||void 0===e?void 0:e.namiCommands,null!==(t=null==n?void 0:n.includes(wn))&&void 0!==t&&t);var e,t,n}function du(e){if(e)return e.length>4096?e.slice(0,4096):e}function cu(e){try{return new URL(e).pathname}catch(t){return e}}function hu(e){var t=null==e?void 0:e.body;return"string"==typeof t?du(t):void 0}function mu(e){try{var t;null===(t=uu)||void 0===t||t(e)}catch(e){}}function fu(e,t,n,i){var r,o,s,u,l,d,c,h;return k(function(m){for(;;)switch(m.p=m.n){case 0:if(lu()){m.n=1;break}return m.a(2,i());case 1:return o=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",s=Date.now(),m.p=2,m.n=3,a(i());case 3:u=m.v,m.n=5;break;case 4:throw m.p=4,c=m.v,mu({method:o,url:e,path:cu(e),statusCode:0,durationMs:Date.now()-s,timestamp:new Date,requestBody:hu(t),errorDescription:vu(c),kind:n}),c;case 5:return l=Date.now()-s,m.p=6,h=du,m.n=7,a(u.clone().text());case 7:d=h(m.v),m.n=9;break;case 8:m.p=8,m.v;case 9:return mu({method:o,url:e,path:cu(e),statusCode:u.status,durationMs:l,timestamp:new Date,requestBody:hu(t),responseBody:d,kind:n}),m.a(2,u)}},null,null,[[6,8],[2,4]],Promise)}function vu(e){return e instanceof Error?e.name?`${e.name}: ${e.message}`:e.message:String(e)}function pu(e,t,n=Nn,i=Fn){var r,o,s,u,l,d,c;return k(function(h){for(;;)switch(h.n){case 0:return o=0,s=ru(),u=ou(),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)&&_i.debug(`[HTTP] ${l} ${e}`),u&&null!=t&&t.body&&_i.debug(`[HTTP] Request body: ${t.body}`),f.n=1,a(fu(e,t,"api",()=>gu(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,_i.debug(`[HTTP] Response ${r.status}: ${c}`);case 3:if(r.status!=Qn){f.n=4;break}throw new co;case 4:if(!(++o<=i)){f.n=6;break}return h=1e3*(o+On),f.n=5,a(new Promise(e=>setTimeout(e,h)));case 5:return f.a(2,d());case 6:throw new uo(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,_i.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 gu(e,t={},n){var i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return i=new AbortController,r=setTimeout(()=>i.abort(),n),t.signal=i.signal,s.n=1,a(fetch(e,t));case 1:return o=s.v,clearTimeout(r),s.a(2,o)}},null,null,null,Promise)}var yu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{},bu="function"==typeof yu.BigInt,wu=bu?yu.BigInt.bind(yu):void 0,ku=bu?wu("0xffffffffffffffffffffffffffffffff"):null,Su=bu?wu("0x100000000000000000000000000000000"):null,Eu=bu?wu(0):null,Pu=bu?wu(1):null,Tu=bu?wu(8):null,_u=bu?wu(1e4):null,Mu=yu.crypto,Au="function"==typeof(null==Mu?void 0:Mu.getRandomValues),Du=1/16,xu=e=>we().device.getDeviceData(e),Cu=()=>{var e=so.getNamiConfig();return e&&e.formFactor?e.formFactor:we().device.getDeviceFormFactor()};function Iu(){return we().device.generateUUID()}function Lu(e){if(!bu||!ku)return Ou(e);try{var t=ku,n=function(e){if(!wu)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return wu("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw _i.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function Fu(e){if(!wu)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 Ru(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(!(bu&&ku&&wu&&_u))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=Iu(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var u=Iu(),l=Ou(u);if(l>=n&&l<=i)return u;var d=$u(l,n,i);d<r&&(r=d,a=u)}return a}(n,i);var s=ku,u=wu,l=_u,d=e=>s*u(e)/l,c=d(r),m=d(o);if(m<=c)return Fu(c);var f=c+function(e){if(!wu||null===Su||null===Pu||null===Eu||null===Tu)throw new Error("BigInt is not supported in this environment");var t=wu,n=Eu,i=Pu,a=Tu,r=Su;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(Au)Mu.getRandomValues(o);else{d||(d=!0,_i.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(Au)try{Mu.getRandomValues(o);for(var p,g=n,y=h(o);!(p=y()).done;)g=g<<a|t(p.value);var b=g%s;return _i.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:l}),b}catch(e){throw _i.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 _i.warn("randomBigInt: reached max rejection attempts without crypto, using modulo fallback",{n:e.toString(),attempts:l}),k%s}(m-c);return Fu(f)}function Ou(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))*Du}return n}(e);return 100*t}function $u(e,t,n){return e<t?t-e:e>n?e-n:0}function Nu(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new mo;return i.apply(this,e)},n}function Wu(e,t,n){var i=n.value;return n.value=function(...e){var t=so.getDevice();if(null==t||!t.id)throw new fo;return i.apply(this,e)},n}var ju,Bu=function(){function e(){o(this,e);var t=so.getNamiConfig();!this.platformID&&t&&this.configure(t)}return c(e,[{key:"deviceID",get:function(){var e;return null===(e=so.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=eu(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 vo;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,so.setSessionCounter(),n.id&&so.setSessionId(n.id);case 2:return i.a(2)}},null,this,null,Promise)}},{key:"postImpression",value:function(t){var n,i,r,o,s,u;return k(function(l){for(;;)switch(l.n){case 0:return o=`device/${this.deviceID}/impression/`,s=null!==(n=t.id)&&void 0!==n?n:Iu(),u=m({},t,{id:s,impression_date:null!==(i=t.impression_date)&&void 0!==i?i:(new Date).toISOString()}),so.setLastImpressionId(s),null===(r=e.impressionListener)||void 0===r||r.call(e,s),l.n=1,a(this.requestBodyAPI(o,u,"POST",!0));case 1:return l.a(2)}},null,this,null,Promise)}},{key:"patchImpressionCompletion",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`device/${this.deviceID}/impression/${e}/`,r.n=1,a(this.requestBodyAPI(i,{completion_result:t,completion_result_date:n},"PATCH",!0));case 1:return r.a(2)}},null,this,null,Promise)}},{key:"postConversion",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/transaction/`,n.n=1,a(this.requestBodyAPI(t,e,"POST",!0));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"purchaseValidation",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/purchase_event/`,n.n=1,a(this.requestBodyAPI(t,e,"PUT"));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"fetchAPI",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`${this.baseURL}/${this.platformID}/`+e,r.n=1,a(pu(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(pu(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 zu(e){return null!=(null==e?void 0:e.flow)}Bu.instance=new Bu,ke([Wu],Bu.prototype,"login",null),ke([Wu],Bu.prototype,"logout",null),ke([Wu],Bu.prototype,"startSession",null),ke([Wu],Bu.prototype,"postImpression",null),ke([Wu],Bu.prototype,"patchImpressionCompletion",null),ke([Wu],Bu.prototype,"postConversion",null),ke([Wu],Bu.prototype,"purchaseValidation",null),ke([Nu],Bu.prototype,"fetchAPI",null),ke([Nu],Bu.prototype,"requestBodyAPI",null),e.NamiCampaignRuleType=void 0,(ju=e.NamiCampaignRuleType||(e.NamiCampaignRuleType={})).DEFAULT="default",ju.LABEL="label",ju.UNKNOWN="unknown",ju.URL="url";var Uu=()=>{var e;return null!==(e=so.getPaywalls(St))&&void 0!==e?e:[]},Hu=()=>{var e;return null!==(e=so.getPaywalls(ut))&&void 0!==e?e:[]},Gu=()=>Jr(Mi([...Hu(),...Uu()]),"id"),Vu=e=>Gu().find(t=>t.id===e),Ku=e=>{var t=Gu(),n=new Set(t.map(e=>e.id));return e.every(e=>n.has(e))};function Yu(e){return(t={})=>{var n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Xu(e){return(t,n)=>{var i;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,r=null!=n&&n.width?String(n.width):a;i=e.formattingValues[r]||e.formattingValues[a]}else{var o=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function qu(e){return(t,n={})=>{var i=n.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],r=t.match(a);if(!r)return null;var o,s=r[0],u=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(u,e=>e.test(s)):function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(u,e=>e.test(s));return o=e.valueCallback?e.valueCallback(l):l,{value:o=n.valueCallback?n.valueCallback(o):o,rest:t.slice(s.length)}}}function Ju(e){var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}var Qu={};function Zu(){return Qu}function el(e,t){var n,i,a,r,o,s,u=Zu(),l=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.weekStartsOn)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.weekStartsOn)&&void 0!==a?a:u.weekStartsOn)&&void 0!==i?i:null===(s=u.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==n?n:0,d=Ju(e),c=d.getDay(),h=(c<l?7:0)+c-l;return d.setDate(d.getDate()-h),d.setHours(0,0,0,0),d}var tl,nl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},il={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},al={ordinalNumber:(e,t)=>{var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Xu({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Xu({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xu({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Xu({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Xu({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},rl={ordinalNumber:(tl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{var n=e.match(tl.matchPattern);if(!n)return null;var i=n[0],a=e.match(tl.parsePattern);if(!a)return null;var r=tl.valueCallback?tl.valueCallback(a[0]):a[0];return{value:r=t.valueCallback?t.valueCallback(r):r,rest:e.slice(i.length)}}),era:qu({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:qu({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:qu({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:qu({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:qu({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},ol={code:"en-US",formatDistance:(e,t,n)=>{var i,a=nl[e];return i="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:{date:Yu({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Yu({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Yu({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:(e,t,n,i)=>il[e],localize:al,match:rl,options:{weekStartsOn:0,firstWeekContainsDate:1}},sl=6048e5;function ul(e){var t=Ju(e);return t.setHours(0,0,0,0),t}function ll(e){var t=Ju(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function dl(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function cl(e){var t,n,i,a,r,o,s=Ju(e),u=(t=s,n=function(e){var t=Ju(e),n=dl(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(s),i=ul(t),a=ul(n),r=+i-ll(i),o=+a-ll(a),Math.round((r-o)/864e5));return u+1}function hl(e){return el(e,{weekStartsOn:1})}function ml(e){var t=Ju(e),n=t.getFullYear(),i=dl(e,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);var a=hl(i),r=dl(e,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);var o=hl(r);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function fl(e){var t=Ju(e),n=+hl(t)-+function(e){var t=ml(e),n=dl(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),hl(n)}(t);return Math.round(n/sl)+1}function vl(e,t){var n,i,a,r,o,s,u=Ju(e),l=u.getFullYear(),d=Zu(),c=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.firstWeekContainsDate)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==a?a:d.firstWeekContainsDate)&&void 0!==i?i:null===(s=d.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1,h=dl(e,0);h.setFullYear(l+1,0,c),h.setHours(0,0,0,0);var m=el(h,t),f=dl(e,0);f.setFullYear(l,0,c),f.setHours(0,0,0,0);var v=el(f,t);return u.getTime()>=m.getTime()?l+1:u.getTime()>=v.getTime()?l:l-1}function pl(e,t){var n=Ju(e),i=+el(n,t)-+function(e,t){var n,i,a,r,o,s,u=Zu(),l=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.firstWeekContainsDate)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==a?a:u.firstWeekContainsDate)&&void 0!==i?i:null===(s=u.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1,d=vl(e,t),c=dl(e,0);return c.setFullYear(d,0,l),c.setHours(0,0,0,0),el(c,t)}(n,t);return Math.round(i/sl)+1}function gl(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}var yl={y(e,t){var n=e.getFullYear(),i=n>0?n:1-n;return gl("yy"===t?i%100:i,t.length)},M(e,t){var n=e.getMonth();return"M"===t?String(n+1):gl(n+1,2)},d:(e,t)=>gl(e.getDate(),t.length),a(e,t){var n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>gl(e.getHours()%12||12,t.length),H:(e,t)=>gl(e.getHours(),t.length),m:(e,t)=>gl(e.getMinutes(),t.length),s:(e,t)=>gl(e.getSeconds(),t.length),S(e,t){var n=t.length,i=e.getMilliseconds();return gl(Math.trunc(i*Math.pow(10,n-3)),t.length)}},bl="midnight",wl="noon",kl="morning",Sl="afternoon",El="evening",Pl="night",Tl={G:function(e,t,n){var i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var i=e.getFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return yl.y(e,t)},Y:function(e,t,n,i){var a=vl(e,i),r=a>0?a:1-a;return"YY"===t?gl(r%100,2):"Yo"===t?n.ordinalNumber(r,{unit:"year"}):gl(r,t.length)},R:function(e,t){return gl(ml(e),t.length)},u:function(e,t){return gl(e.getFullYear(),t.length)},Q:function(e,t,n){var i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return gl(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return gl(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getMonth();switch(t){case"M":case"MM":return yl.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return gl(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var a=pl(e,i);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):gl(a,t.length)},I:function(e,t,n){var i=fl(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):gl(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):yl.d(e,t)},D:function(e,t,n){var i=cl(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):gl(i,t.length)},E:function(e,t,n){var i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return gl(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return gl(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getDay(),a=0===i?7:i;switch(t){case"i":return String(a);case"ii":return gl(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i,a=e.getHours();switch(i=12===a?wl:0===a?bl:a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i,a=e.getHours();switch(i=a>=17?El:a>=12?Sl:a>=4?kl:Pl,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var i=e.getHours()%12;return 0===i&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return yl.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):yl.H(e,t)},K:function(e,t,n){var i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):gl(i,t.length)},k:function(e,t,n){var i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):gl(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):yl.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):yl.s(e,t)},S:function(e,t){return yl.S(e,t)},X:function(e,t,n){var i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Ml(i);case"XXXX":case"XX":return Al(i);default:return Al(i,":")}},x:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"x":return Ml(i);case"xxxx":case"xx":return Al(i);default:return Al(i,":")}},O:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_l(i,":");default:return"GMT"+Al(i,":")}},z:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_l(i,":");default:return"GMT"+Al(i,":")}},t:function(e,t,n){return gl(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return gl(e.getTime(),t.length)}};function _l(e,t=""){var n=e>0?"-":"+",i=Math.abs(e),a=Math.trunc(i/60),r=i%60;return 0===r?n+String(a):n+String(a)+t+gl(r,2)}function Ml(e,t){return e%60==0?(e>0?"-":"+")+gl(Math.abs(e)/60,2):Al(e,t)}function Al(e,t=""){var n=e>0?"-":"+",i=Math.abs(e);return n+gl(Math.trunc(i/60),2)+t+gl(i%60,2)}var Dl=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},xl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Cl={p:xl,P:(e,t)=>{var n,i=e.match(/(P+)(p+)?/)||[],a=i[1],r=i[2];if(!r)return Dl(e,t);switch(a){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Dl(a,t)).replace("{{time}}",xl(r,t))}},Il=/^D+$/,Ll=/^Y+$/,Fl=["D","DD","YY","YYYY"];function Rl(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t,n=Ju(e);return!isNaN(Number(n))}var Ol=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$l=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Nl=/^'([^]*?)'?$/,Wl=/''/g,jl=/[a-zA-Z]/;function Bl(e,t,n){var i,a,r,o,s,u,l,d,c,h,m,f,v,p,g=Zu(),y=null!==(i=null!==(a=null==n?void 0:n.locale)&&void 0!==a?a:g.locale)&&void 0!==i?i:ol,b=null!==(r=null!==(o=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(l=n.locale)||void 0===l||null===(l=l.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==s?s:g.firstWeekContainsDate)&&void 0!==o?o:null===(d=g.locale)||void 0===d||null===(d=d.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==r?r:1,w=null!==(c=null!==(h=null!==(m=null!==(f=null==n?void 0:n.weekStartsOn)&&void 0!==f?f:null==n||null===(v=n.locale)||void 0===v||null===(v=v.options)||void 0===v?void 0:v.weekStartsOn)&&void 0!==m?m:g.weekStartsOn)&&void 0!==h?h:null===(p=g.locale)||void 0===p||null===(p=p.options)||void 0===p?void 0:p.weekStartsOn)&&void 0!==c?c:0,k=Ju(e);if(!Rl(k))throw new RangeError("Invalid time value");var S=t.match($l).map(e=>{var t=e[0];return"p"===t||"P"===t?(0,Cl[t])(e,y.formatLong):e}).join("").match(Ol).map(e=>{if("''"===e)return{isToken:!1,value:"'"};var t=e[0];if("'"===t)return{isToken:!1,value:zl(e)};if(Tl[t])return{isToken:!0,value:e};if(t.match(jl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});y.localize.preprocessor&&(S=y.localize.preprocessor(k,S));var E={firstWeekContainsDate:b,weekStartsOn:w,locale:y};return S.map(i=>{if(!i.isToken)return i.value;var a=i.value;return(null!=n&&n.useAdditionalWeekYearTokens||!function(e){return Ll.test(e)}(a))&&(null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return Il.test(e)}(a))||function(e,t,n){var i=function(e,t,n){var i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),Fl.includes(e))throw new RangeError(i)}(a,t,String(e)),(0,Tl[a[0]])(k,a,y.localize,E)}).join("")}function zl(e){var t=e.match(Nl);return t?t[1].replace(Wl,"'"):e}function Ul(e,t,n){var i,a=Object.assign({},Zu()),r=function(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,null!==(i=n.locale)&&void 0!==i?i:a.locale);return"formatToParts"in r?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value;return}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(r,t)}function Hl(e,t){var n=function(e){Vl[e]||(Vl[e]=Yl?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}));return Vl[e]}(t);return"formatToParts"in n?function(e,t){try{for(var n=e.formatToParts(t),i=[],a=0;a<n.length;a++){var r=Gl[n[a].type];void 0!==r&&(i[r]=parseInt(n[a].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}(n,e)}var Gl={year:0,month:1,day:2,hour:3,minute:4,second:5};var Vl={},Kl=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")),Yl="06/25/2014, 00:00:00"===Kl||"‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00"===Kl;function Xl(e,t,n,i,a,r,o){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,a,r,o),s}var ql=36e5,Jl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ql(e,t,n){if(!e)return 0;var i,a,r=Jl.timezoneZ.exec(e);if(r)return 0;if(r=Jl.timezoneHH.exec(e))return ed(i=parseInt(r[1],10))?-i*ql:NaN;if(r=Jl.timezoneHHMM.exec(e)){i=parseInt(r[2],10);var o=parseInt(r[3],10);return ed(i,o)?(a=Math.abs(i)*ql+6e4*o,"+"===r[1]?-a:a):NaN}if(function(e){if(td[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),td[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return Xl(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),u=Zl(s,e),l=n?u:function(e,t,n){var i=e.getTime(),a=i-t,r=Zl(new Date(a),n);if(t===r)return t;a-=r-t;var o=Zl(new Date(a),n);if(r===o)return r;return Math.max(r,o)}(t,u,e);return-l}return NaN}function Zl(e,t){var n=Hl(e,t),i=Xl(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),a=e.getTime(),r=a%1e3;return i-(a-=r>=0?r:1e3+r)}function ed(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var td={};var nd={X:function(e,t,n){var i=id(n.timeZone,e);if(0===i)return"Z";switch(t){case"X":return od(i);case"XXXX":case"XX":return rd(i);default:return rd(i,":")}},x:function(e,t,n){var i=id(n.timeZone,e);switch(t){case"x":return od(i);case"xxxx":case"xx":return rd(i);default:return rd(i,":")}},O:function(e,t,n){var i=id(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t=""){var n=e>0?"-":"+",i=Math.abs(e),a=Math.floor(i/60),r=i%60;if(0===r)return n+String(a);return n+String(a)+t+ad(r,2)}(i,":");default:return"GMT"+rd(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Ul("short",e,n);default:return Ul("long",e,n)}}};function id(e,t){var n,i=e?Ql(e,t,!0)/6e4:null!==(n=null==t?void 0:t.getTimezoneOffset())&&void 0!==n?n:0;if(Number.isNaN(i))throw new RangeError("Invalid time zone specified: "+e);return i}function ad(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function rd(e,t=""){var n=e>0?"-":"+",i=Math.abs(e);return n+ad(Math.floor(i/60),2)+t+ad(Math.floor(i%60),2)}function od(e,t){return e%60==0?(e>0?"-":"+")+ad(Math.abs(e)/60,2):rd(e,t)}function sd(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}var ud=36e5,ld=6e4,dd={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function cd(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var i=function(e){var t,n={},i=dd.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=dd.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var a=dd.timeZone.exec(t);a?(n.time=t.replace(a[1],""),n.timeZone=a[1].trim()):n.time=t}return n}(e),a=function(e,t){if(e){var n=dd.YYY[t],i=dd.YYYYY[t],a=dd.YYYY.exec(e)||i.exec(e);if(a){var r=a[1];return{year:parseInt(r,10),restDateString:e.slice(r.length)}}if(a=dd.YY.exec(e)||n.exec(e)){var o=a[1];return{year:100*parseInt(o,10),restDateString:e.slice(o.length)}}}return{year:null}}(i.date,n),r=a.year,o=function(e,t){if(null===t)return null;var n,i,a;if(!e||!e.length)return(n=new Date(0)).setUTCFullYear(t),n;var r=dd.MM.exec(e);if(r)return n=new Date(0),pd(t,i=parseInt(r[1],10)-1)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(r=dd.DDD.exec(e)){n=new Date(0);var o=parseInt(r[1],10);return function(e,t){if(t<1)return!1;var n=vd(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,o)?(n.setUTCFullYear(t,0,o),n):new Date(NaN)}if(r=dd.MMDD.exec(e)){n=new Date(0),i=parseInt(r[1],10)-1;var s=parseInt(r[2],10);return pd(t,i,s)?(n.setUTCFullYear(t,i,s),n):new Date(NaN)}if(r=dd.Www.exec(e))return gd(a=parseInt(r[1],10)-1)?hd(t,a):new Date(NaN);if(r=dd.WwwD.exec(e)){a=parseInt(r[1],10)-1;var u=parseInt(r[2],10)-1;return gd(a,u)?hd(t,a,u):new Date(NaN)}return null}(a.restDateString,r);if(null===o||isNaN(o.getTime()))return new Date(NaN);if(o){var s,u=o.getTime(),l=0;if(i.time&&(null===(l=function(e){var t,n,i=dd.HH.exec(e);if(i)return yd(t=parseFloat(i[1].replace(",",".")))?t%24*ud:NaN;if(i=dd.HHMM.exec(e))return yd(t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")))?t%24*ud+n*ld:NaN;if(i=dd.HHMMSS.exec(e)){t=parseInt(i[1],10),n=parseInt(i[2],10);var a=parseFloat(i[3].replace(",","."));return yd(t,n,a)?t%24*ud+n*ld+1e3*a:NaN}return null}(i.time))||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(s=Ql(i.timeZone||t.timeZone,new Date(u+l)),isNaN(s))return new Date(NaN)}else s=sd(new Date(u+l)),s=sd(new Date(u+l+s));return new Date(u+l+s)}return new Date(NaN)}function hd(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var a=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+a),i}var md=[31,28,31,30,31,30,31,31,30,31,30,31],fd=[31,29,31,30,31,30,31,31,30,31,30,31];function vd(e){return e%400==0||e%4==0&&e%100!=0}function pd(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=vd(e);if(i&&n>fd[t])return!1;if(!i&&n>md[t])return!1}return!0}function gd(e,t){return!(e<0||e>52)&&(null==t||!(t<0||t>6))}function yd(e,t,n){return!(e<0||e>=25)&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var bd=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function wd(e,t,n,i){return function(e,t,n={}){var i=(t=String(t)).match(bd);if(i){var a=cd(n.originalDate||e,n);t=i.reduce(function(e,t){if("'"===t[0])return e;var i=e.indexOf(t),r="'"===e[i-1],o=e.replace(t,"'"+nd[t[0]](a,t,n)+"'");return r?o.substring(0,i-1)+o.substring(i+1):o},t)}return Bl(e,t,n)}(function(e,t,n){var i=Ql(t,e=cd(e,n),!0),a=new Date(e.getTime()-i),r=new Date(0);return r.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),r.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),r}(e,t,{timeZone:(i=m({},i,{timeZone:t,originalDate:e})).timeZone}),n,i)}var kd,Sd=e=>{try{return!isNaN(new Date(e).getTime())}catch(e){return!1}},Ed=(e,t,n=new Date)=>{var i=n.getTime(),a=!e||!Sd(e)||new Date(e).getTime()<i,r=!t||!Sd(t)||new Date(t).getTime()>i;return a&&r},Pd=e=>{try{var t=new URL(e);return("http:"===t.protocol||"https:"===t.protocol)&&!!t.hostname}catch(e){return!1}},Td=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}},_d=(e,t,n)=>{if(!e)return[];var i=e.filter(e=>!Array.isArray(e.segments)).length;return i>0&&_i.warn(`Skipping ${i} of ${e.length} campaign rules with no segments array`),e.flatMap(e=>{if(!Array.isArray(e.segments))return[];var i;if(i="string"==typeof n?e.segments.filter(e=>e.form_factors.some(e=>e.form_factor===n)):e.segments,0===i.length)return[];var a=((e,t)=>{for(var n,i=[...e].sort((e,t)=>e.split-t.split),a=h(i);!(n=a()).done;){var r=n.value;if(t<=r.split)return r}return i[i.length-1]})(i,t);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}})},Md=()=>{var e,t,n=null!==(e=so.getCampaignRules(ot))&&void 0!==e?e:[],i=null!==(t=so.getCampaignRules(wt))&&void 0!==t?t:[],a=Cu(),r=Mi([...n,...i]).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===a)}).filter(e=>Ed(e.not_before,e.expires_at)),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)})},Ad=e=>{var t,n=null!==(t=so.getCampaignRules(e))&&void 0!==t?t:[],i=Cu();return Mi(n).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===i)}).filter(e=>Ed(e.not_before,e.expires_at))},Dd=()=>Ad(wt),xd=()=>Ad(ot),Cd=(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=Td(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=Td(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}},Id=(e,t)=>{var n=Cd(xd,Hu,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=Cd(Dd,Uu,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}},Ld="object"==typeof Reflect?Reflect:null,Fd=Ld&&"function"==typeof Ld.apply?Ld.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};kd=Ld&&"function"==typeof Ld.ownKeys?Ld.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Rd=Number.isNaN||function(e){return e!=e};function Od(){Od.init.call(this)}Od.EventEmitter=Od,Od.prototype._events=void 0,Od.prototype._eventsCount=0,Od.prototype._maxListeners=void 0;var $d=10;function Nd(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Wd(e){return void 0===e._maxListeners?Od.defaultMaxListeners:e._maxListeners}function jd(e,t,n,i){var a,r,o,s;if(Nd(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=Wd(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 Bd(){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 zd(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=Bd.bind(i);return a.listener=n,i.wrapFn=a,a}function Ud(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):Gd(a,a.length)}function Hd(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 Gd(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(Od,"defaultMaxListeners",{enumerable:!0,get:function(){return $d},set:function(e){if("number"!=typeof e||e<0||Rd(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");$d=e}}),Od.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},Od.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Rd(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},Od.prototype.getMaxListeners=function(){return Wd(this)},Od.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)Fd(s,this,t);else for(var u=s.length,l=Gd(s,u),d=0;d<u;++d)Fd(l[d],this,t);return!0},Od.prototype.addListener=function(e,t){return jd(this,e,t,!1)},Od.prototype.on=Od.prototype.addListener,Od.prototype.prependListener=function(e,t){return jd(this,e,t,!0)},Od.prototype.once=function(e,t){return Nd(t),this.on(e,zd(this,e,t)),this},Od.prototype.prependOnceListener=function(e,t){return Nd(t),this.prependListener(e,zd(this,e,t)),this},Od.prototype.removeListener=function(e,t){var n,i,a,r,o;if(Nd(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},Od.prototype.off=Od.prototype.removeListener,Od.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},Od.prototype.listeners=function(e){return Ud(this,e,!0)},Od.prototype.rawListeners=function(e){return Ud(this,e,!1)},Od.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Hd.call(e,t)},Od.prototype.listenerCount=Hd,Od.prototype.eventNames=function(){return this._eventsCount>0?kd(this._events):[]};var Vd=function(){function e(){o(this,e),this.emitter=new Od}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}}])}(),Kd=function(){return c(function e(){o(this,e),this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1,this.currentFormFactor=Cu()},[{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=Cu(),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=so.getDevice(),!this.disableCampaignUpdates){o.n=1;break}return _i.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}),so.setCampaignRules(ot,r),so.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),o.a(2,r)}},null,this,null,Promise)}},{key:"fetchCampaignRulesRaw",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(!this.disableCampaignUpdates){o.n=1;break}return _i.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,{campaigns:[],fromNetwork:!1});case 1:if(null==(t=so.getDevice())||!t.id){o.n=3;break}return o.n=2,a(this.fetchCampaigns(t.id));case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.fetchAnonymousCampaigns());case 4:r=o.v;case 5:return i=null===(e=(n=r).campaigns)||void 0===e?void 0:e.filter(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))}),o.a(2,{campaigns:i,fromNetwork:n.fromNetwork})}},null,this,null,Promise)}},{key:"finalizeCampaignRules",value:function(e,t){var n=new Set([...t.map(e=>e.id),...Uu().map(e=>e.id)]),i=null==e?void 0:e.filter(e=>{return e.paywall?t.find(t=>t.id==e.paywall):!!e.flow&&(!!e.flow.object&&(null!==(i=e.flow.object.screens)&&void 0!==i?i:[]).every(e=>n.has(e)));var i});return so.setCampaignRules(ot,i),so.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),i}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=Vd.getInstance().listeners(ui),t=Md();e.forEach(e=>e(t))}},{key:"getAnonymousCampaigns",value:function(e=Ae){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchAnonymousCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"getCampaigns",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"fetchAnonymousCampaigns",value:function(e=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(Bu.instance.fetchAPI(t));case 2:return i=s.v,s.a(2,{campaigns:_d(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor),fromNetwork:!0});case 3:if(s.p=3,o=s.v,r=this.fallbackData()){s.n=4;break}throw _i.error(_o(o.status,t)),o;case 4:return s.a(2,{campaigns:r.results,fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fetchCampaigns",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return t=`device/${e}/campaign_rules/`,o.p=1,o.n=2,a(Bu.instance.fetchAPI(t));case 2:return n=o.v,o.a(2,{campaigns:(null==n?void 0:n.results)||[],fromNetwork:!0});case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw _i.error(_o(r.status,t)),r;case 4:return o.a(2,{campaigns:i.results||[],fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=so.getCampaignRules(ot)||so.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 Yd(e,t){return Sr(e,t)}Kd.instance=new Kd;var Xd=function(){return c(function e(){o(this,e)},[{key:"createOrUpdateDevice",value:function(e,t,n){var i=so.getDevice();if(null==i||!i.id){var a,r=m({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:Iu()});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}so.setDevice(n),r.n=3;break;case 2:return _i.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 uo)){r.n=5;break}return _i.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)&&so.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=so.getDevice())&&i.id){o.n=1;break}throw new fo;case 1:return o.n=2,a(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(r=o.v)&&so.setDevice(r),o.a(2,r)}},null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=jn,r){var o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:return u.p=0,u.n=1,a(Bu.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 mo)){u.n=3;break}throw s;case 3:if(!("device/"===e&&s instanceof uo)){u.n=4;break}throw s;case 4:if(o=so.getDevice()){u.n=5;break}return _i.error(_o(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 Yd(i,e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=so.getAnonymousUUID();return e||(e=Iu(),so.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=so.getAnonymousUUID();return e?(so.clearAnonymousUUID(),e):null}}])}();Xd.instance=new Xd;var qd=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(!tu(Pe.THIRD_PARTY_TRANSACTIONS)){r.n=1;break}return r.a(2,[]);case 1:return r.p=1,r.n=2,a(Bu.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 _i.error(_o(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&so.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=so.getProducts(ht)||so.getProducts(Pt);return e?{count:e.length,results:e}:null}}])}();qd.instance=new qd;var Jd=3,Qd=200,Zd=2e3,ec=5e3,tc=2e4,nc=new Set([408,425,429]),ic=new Set(["ECONNRESET","ECONNREFUSED","ENOTFOUND","ETIMEDOUT"]),ac=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[`CDN fetch failed with non-retryable status ${e} for ${n}`])).name="NonRetryableHttpError",i.status=e,i.url=n,i}return p(t,e),c(t)}(M(Error)),rc=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t,[`CDN fetch exhausted ${n} attempts for ${e}${void 0!==i?` (last status ${i})`:""}`])).name="RetryExhaustedError",a.url=e,a.attempts=n,a.lastStatus=i,a}return p(t,e),c(t)}(M(Error));function oc(e,t){if("number"==typeof t)return nc.has(t)||t>=500;if(e&&"object"==typeof e){var n=e;if("AbortError"===n.name)return!0;if(n.code&&ic.has(n.code))return!0;if(e instanceof TypeError)return!0}return!1}function sc(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(fu(e,{method:"GET"},"cdn",()=>fetch(e,{signal:n.signal})));case 2:return r.a(2,r.v);case 3:return r.p=3,clearTimeout(i),r.f(3);case 4:return r.a(2)}},null,null,[[1,,3,4]],Promise)}var uc=e=>new Promise(t=>setTimeout(t,e));function lc(e,t={}){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return o.n=1,a(dc(e,t));case 1:return n=o.v,i=n.data,r=n.retryCount,o.a(2,{data:JSON.parse(i),retryCount:r})}},null,null,null,Promise)}function dc(e,t={}){var n,i,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,S,E,P,T,_,M,A,D,x,C,I,L,F;return k(function(k){for(;;)switch(k.p=k.n){case 0:d=null!==(n=t.maxAttempts)&&void 0!==n?n:Jd,c=null!==(i=t.baseDelayMs)&&void 0!==i?i:Qd,h=null!==(r=t.maxDelayMs)&&void 0!==r?r:Zd,m=null!==(o=t.budgetMs)&&void 0!==o?o:tc,f=null!==(s=t.timeoutMs)&&void 0!==s?s:ec,v=null!==(u=t.randomFn)&&void 0!==u?u:Math.random,p=null!==(l=t.sleepFn)&&void 0!==l?l:uc,g=ru(),y=ou(),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),_=T*(v()-.5),M=Math.max(0,m-P),A=Math.min(Math.max(0,T+_),M),k.n=3,a(p(A));case 3:if(!(Date.now()-b>=m)){k.n=4;break}return k.a(3,16);case 4:return k.p=4,(g||y)&&_i.debug(`[HTTP] GET ${e} (cdn attempt ${w+1}/${d})`),k.n=5,a(sc(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,_i.debug(`[HTTP] Response ${D.status}: ${x}`);case 7:if(S=D.status,!oc(void 0,D.status)){k.n=8;break}return w++,k.a(3,1);case 8:throw new ac(D.status,e);case 9:if(!y){k.n=11;break}return k.n=10,a(D.clone().text());case 10:C=k.v,_i.debug(`[HTTP] Response ${D.status}: ${C}`);case 11:return k.n=12,a(D.text());case 12:return I=k.v,L=w,k.a(2,{data:I,retryCount:L});case 13:if(k.p=13,!((F=k.v)instanceof ac)){k.n=14;break}throw F;case 14:if(!oc(F)){k.n=15;break}return E=F,w++,k.a(3,1);case 15:throw F;case 16:if(void 0!==S||void 0===E){k.n=17;break}throw E;case 17:throw new rc(e,w,S);case 18:return k.a(2)}},null,null,[[4,13]],Promise)}function cc(e){var t=e.split("#")[0].split("?")[1];if(t)for(var n,i=h(t.split("&"));!(n=i()).done;){var a=n.value,r=a.indexOf("=");if("content_hash"===(-1===r?a:a.slice(0,r)))return(-1===r?"":a.slice(r+1))||void 0}}function hc(e){var t=e.split(/[?#]/)[0],n=/\/paywall\/([^/]+)/.exec(t);return n?n[1]:void 0}var mc=function(){return c(function e(t=io){o(this,e),this.bodyCache=t},[{key:"fetchPaywalls",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(null!=(e=so.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&&so.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(Bu.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 _i.error(_o(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(Bu.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 _i.error(_o(r.status,n)),r;case 4:return o.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"resolvePaywallsByUrls",value:function(e){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return t=[...new Set(e)],n=nu(),this.bodyCache.evaluateTtl(n),s.n=1,a(Promise.all(t.map(e=>this.resolvePaywall(e,n))));case 1:return i=s.v,r={paywalls:[],urls:t.length,hashed:t.filter(e=>void 0!==cc(e)).length,cacheHits:0,fetched:0,cacheAfterFetchFailure:0,failed:0,retryCount:0},o=new Map,i.forEach((e,n)=>{r.retryCount+=e.retryCount,e.paywall?(o.set(e.paywall,t[n]),"cacheHit"===e.paywall.fetchSource?r.cacheHits+=1:"cacheAfterFetchFailure"===e.paywall.fetchSource?r.cacheAfterFetchFailure+=1:r.fetched+=1):r.failed+=1}),r.paywalls=this.validatePaywalls([...o.keys()]),r.paywalls.length>0&&so.setApiPaywallsFromBodyCache(r.paywalls.map(e=>o.get(e))),s.a(2,r)}},null,this,null,Promise)}},{key:"seedFromInitialConfig",value:function(e,t){var n=new Map(t.map(e=>[e.id,e]));this.bodyCache.evaluateTtl(nu());for(var i,a=0,r=0,o=h(new Set(function(e){for(var t,n=[],i=h(e);!(t=i()).done;)for(var a,r=h(null!==(o=t.value.segments)&&void 0!==o?o:[]);!(a=r()).done;){var o,s,u=a.value;u.paywall_url&&n.push(u.paywall_url),u.page_urls&&n.push(...Object.values(u.page_urls)),null!==(s=u.flow)&&void 0!==s&&s.page_urls&&n.push(...Object.values(u.flow.page_urls))}return n}(e)));!(i=o()).done;){var s=i.value,u=cc(s),l=hc(s),d=l?n.get(l):void 0;u&&d&&(a+=1,this.bodyCache.seedIfAbsent(s,u,JSON.stringify(d))&&(r+=1))}_i.info(`Paywall body cache seeded from initial config: seeded=${r}, candidates=${a}`)}},{key:"resolvePaywall",value:function(e,t){var n,i,r,o,s,u,l;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(!(n=cc(e))){d.n=1;break}if(!(i=this.decodeCached(e,t))){d.n=1;break}return d.a(2,{paywall:vc(i,"cacheHit",n),retryCount:0});case 1:return r=0,d.p=2,d.n=3,a(this.fetchPaywallText(e));case 3:if(o=d.v,r=o.retryCount,!(s=fc(o.data))){d.n=4;break}return this.bodyCache.store(e,n,o.data),d.a(2,{paywall:vc(s,"fetched",n),retryCount:r});case 4:_i.error(`Paywall body from ${e} is not a decodable paywall`),d.n=6;break;case 5:d.p=5,l=d.v,_i.error(`Failed to fetch individual paywall: ${l}`);case 6:if(!(u=this.decodeCached(e,t))){d.n=7;break}return _i.warn(`Serving the cached body for ${e} after fetch failure (within campaign_cache_ttl)`),d.a(2,{paywall:vc(u,"cacheAfterFetchFailure",n),retryCount:r});case 7:return d.a(2,{retryCount:r})}},null,this,[[2,5]],Promise)}},{key:"decodeCached",value:function(e,t){var n=this.bodyCache.validEntry(e,t);if(n){var i=fc(n.body);return i||(_i.warn(`Deleting an undecodable cached paywall body for ${e}`),this.bodyCache.remove(e)),i}}},{key:"fetchPaywallText",value:function(e){var t;return null!==(t=so.getNamiConfig())&&void 0!==t&&null!==(t=t.namiCommands)&&void 0!==t&&t.includes(_n)?(_i.warn(`${_n}: failing the fetch for ${e} before the network`),Promise.reject(new rc(e,0))):dc(e)}},{key:"validatePaywalls",value:function(e){return e.filter(e=>{var t,n=null===(t=e.template)||void 0===t?void 0:t.pages;return!(!Array.isArray(n)||0===n.length)||(_i.warn(`Dropping paywall "${e.id}" from cache: template.pages is missing or empty`),!1)})}},{key:"fallbackData",value:function(){var e=so.getPaywalls(ut)||so.getPaywalls(St);return e?{count:e.length,results:e}:null}}])}();function fc(e){try{var t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:void 0}catch(e){return}}function vc(e,t,n){return m({},e,{fetchSource:t},n?{contentHash:n}:{})}mc.instance=new mc;var pc=function(){return c(function e(){o(this,e)},[{key:"fetchConfig",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(null===(e=so.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e||!e.includes(Pn)){o.n=1;break}throw new uo(ei,Pn);case 1:return i=null===(t=so.getNamiConfig())||void 0===t?void 0:t.appPlatformID,o.n=2,a(Bu.instance.fetchAPI("config/",Hn,0));case 2:return r=o.v,(null===(n=so.getNamiConfig())||void 0===n?void 0:n.appPlatformID)===i?so.setAppConfig(at,r):_i.debug("Discarding an app config response for a platform that is no longer configured"),o.a(2,r)}},null,null,null,Promise)}},{key:"fetchConfigForStartup",value:function(e){var t,n,i,r,o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:if(!e){u.n=1;break}return u.a(2,this.startupOnInitialConfig());case 1:t=zn,i=1;case 2:if(!(i<=t)){u.n=7;break}return i>1&&_i.debug(`Retrying app config fetch (attempt ${i} of ${t})`),u.p=3,o=gc,u.n=4,a(this.fetchConfig());case 4:return u.a(2,o(u.v));case 5:u.p=5,s=u.v,n=s;case 6:i++,u.n=2;break;case 7:if(!(r=so.getAppConfig(at))){u.n=9;break}if(yc(r)){u.n=8;break}return u.a(2,{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"});case 8:return _i.info(`App config fetch failed after ${t} attempts - continuing on the cached config`),u.a(2,{usable:!0});case 9:return u.a(2,{usable:!1,reason:`app config fetch failed after ${t} attempts (${bc(n)}) and no initial or cached config is available`})}},null,this,[[3,5]],Promise)}},{key:"startupOnInitialConfig",value:function(){var e=so.getAppConfig(at);return this.fetchConfig().then(e=>{yc(e)||_i.warn("App config does not grant the 'sdk' capability - it takes effect from the next launch")},e=>{_i.info(`App config fetch failed (${bc(e)}). Initial config is available. Skipping retry.`)}),e&&!yc(e)?{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"}:{usable:!0}}}])}();function gc(e){return yc(e)?{usable:!0}:{usable:!1,reason:"app config does not grant the 'sdk' capability"}}function yc(e){var t,n;return null!==(t=null===(n=e.capabilities)||void 0===n?void 0:n.includes(Pe.SDK))&&void 0!==t&&t}function bc(e){var t=null==e?void 0:e.status;return"number"==typeof t?`HTTP ${t}`:e instanceof Error?e.message:String(e)}pc.instance=new pc;var wc=null;function kc(){wc&&wc.setInMemoryAnonymousMode(!1)}function Sc(){return!!so.getAnonymousMode()||!!wc&&wc.isInMemoryAnonymousMode()}var Ec=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(!Sc()){t.n=1;break}return _i.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,a(Bu.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,_i.error("error on start session: ",e);case 4:return t.a(2)}},null,null,[[1,3]],Promise)}}])}();Ec.instance=new Ec;var Pc=function(){return c(function e(){o(this,e)},null,[{key:"allPurchases",value:function(){return[]}}])}();Pc.instance=new Pc;var Tc={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"}},_c="en";function Mc(e){var t,n,i=function(e){if(!e)return _c;var t=e.trim();if(Tc[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return Tc[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":_c}(so.getLanguageCode()),a=null!==(t=Tc[i])&&void 0!==t?t:Tc[_c];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}function Ac(e){if("subscription"===(null==e?void 0:e.product_type)){var t=xc(e);if(t.length>0)return t[0].billingPeriod}return null}function Dc(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return Cc(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function xc(e){return e?Cc(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function Cc(e,t){return e.map(e=>Ic(e,t))}function Ic(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:Rc(m).format(h)}}function Lc(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=Mc(o),l=Mc(s);return a||u!==o||(u=Mc(`${r}_abbrev`)),a||l!==s||(l=Mc(`${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 Fc(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 Rc(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 Oc=(e,t,n)=>e&&t&&n?n.format(e-t):null,$c=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},Nc=(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)}},Wc=e=>Bc(e.priceAmountMicros)/jc(e.billingPeriod),jc=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},Bc=e=>e/1e6;function zc(e){return parseFloat((Math.round(e)/100).toFixed(2))}var Uc=(e,t,n=[])=>({price:()=>Gc(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>Vc(e),durationSingular:()=>Vc(e,!0),period:()=>Vc(e,!1,!0),periodNumber:()=>Vc(e,!1,!1,!0),freeTrialDuration:()=>Kc(e),freeTrialDurationSingular:()=>Kc(e,!0),freeTrialPeriod:()=>Kc(e,!1,!0),freeTrialPeriodNumber:()=>Kc(e,!1,!1,!0),pricePerMonth:()=>Yc(e),pricePerMonthRounded:()=>Yc(e,!0),periodInMonths:()=>Xc(e),durationInMonths:()=>qc(e),durationInMonthsSingular:()=>qc(e,!0),periodNumberInMonths:()=>Jc(e),percentagePriceDifferenceFromSku:()=>Qc(e,t,n),priceDifferenceFromSku:()=>Zc(e,t,n),promoEligible:()=>null===eh(e)&&null!==th(e,t),freeTrialEligible:()=>null!==eh(e),promo:()=>{var n;return null===(n=th(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=nh(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>ih(e,t,!1,!0),promoPeriodNumber:()=>ih(e,t,!1,!1,!0),promoDuration:()=>ih(e,t),promoDurationSingular:()=>ih(e,t,!0),introEligible:()=>!1,pricePerDay:()=>ah(e),pricePerWeek:()=>rh(e),pricePerWeekRounded:()=>rh(e,!0),introductoryPrice:()=>oh(e,t),introductoryPeriod:()=>sh(e,t,!1,!0),introductoryPeriodNumber:()=>sh(e,t,!1,!1,!0),introductoryDuration:()=>sh(e,t),introductoryDurationSingular:()=>sh(e,t,!0),introductoryPricePerMonth:()=>uh(e,t),introductoryPricePerMonthRounded:()=>uh(e,t,!0),durationAbbrev:()=>Vc(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Kc(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>sh(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>ih(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>ih(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>qc(e,!1,!1,!1,!0),durationSingularAbbrev:()=>Vc(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Kc(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>sh(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>ih(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>ih(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>qc(e,!0,!1,!1,!0),periodAbbrev:()=>Vc(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Kc(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>sh(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>ih(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>ih(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>qc(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?Mc("nami_weekly"):2===u?Mc("nami_biweekly"):null:s>0?Mc(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?Mc("nami_yearly"):null}(Ac(e)),iso_subscription_duration:()=>hh(e),bill_term:()=>ch(e),invalid:()=>!1,unavailable:()=>!1}),Hc=(e,t,n,i=[])=>{if(!t)return null;var a=Uc(t,n,i);return a[e]?a[e]():null},Gc=e=>{var t=xc(e);return t&&t.length?t[0].formattedPrice:null},Vc=(e,t,n,i,a)=>Lc(Ac(e),t,n,i,a),Kc=(e,t,n,i,a)=>Lc(Dc(e),t,n,i,a),Yc=(e,t)=>{var n=xc(e);if(!n||0===n.length)return null;var i=Wc(n[0]);return i?Rc(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},Xc=(e,t)=>{var n=xc(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return Fc(i)?Lc("P1Y"===i?"P12M":i,!1,!1,!1,t):null},qc=(e,t,n,i,a)=>{var r=xc(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return Fc(o)?Lc("P1Y"===o?"P12M":o,t,n,i,a):null},Jc=e=>{if(!e)return 0;var t=xc(e);return t&&t.length?jc(t[0].billingPeriod):0},Qc=(e,t,n=[])=>{var i,a=xc(e);if(!a||0===a.length)return null;var r=null===(i=Nc(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return $c(zc(a[0].priceAmountMicros),Jc(e));var o=xc(r);return $c(zc(a[0].priceAmountMicros),Jc(e),(null==o?void 0:o.length)>0?zc(o[0].priceAmountMicros):0,Jc(r))},Zc=(e,t,n=[])=>{var i,a=xc(e);if(!a||0===a.length)return null;var r=null===(i=Nc(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return Oc(Wc(a[0]));var o=xc(r);return Oc(Wc(a[0]),Wc(o[0]),Rc(o[0].priceCurrencyCode))},eh=e=>Dc(e),th=(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},nh=(e,t)=>e?Ic(th(e,t),e.subscription_period):null,ih=(e,t,n,i,a,r)=>{var o=nh(e,t);return Lc((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},ah=(e,t)=>{var n=xc(e);if(!n||0===n.length)return null;var i,a,r=Bc(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=jc(i))?30.437*a:1);return r?Rc(n[0].priceCurrencyCode).format(r):null},rh=(e,t)=>{var n=xc(e);if(!n||0===n.length)return null;var i,a,r=Bc(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=jc(i))?52*a/12:1);return r?Rc(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},oh=(e,t)=>{var n=lh(e,t);return(null==n?void 0:n.formattedPrice)||null},sh=(e,t,n,i,a,r)=>{var o=lh(e,t);return Lc((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},uh=(e,t,n)=>{var i=lh(e,t);if(i){var a=Bc(i.priceAmountMicros),r=jc(i.billingPeriod),o=n?Math.round(a/r):a/r;return Rc(i.priceCurrencyCode).format(o)}},lh=(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],Ic(n,e.subscription_period)):null;var n},dh={P1D:"daily",P1W:"weekly",P1M:"monthly",P3M:"quarterly",P6M:"semiannual",P1Y:"annual"},ch=e=>{var t=hh(e);return t&&dh[t]||null},hh=e=>{var t=Ac(e);return t?"P7D"===t?"P1W":t:null};function mh(e,t,n,i){var a=n.flatMap(e=>e.products).find(e=>e.id===t.selectedProducts[t.currentGroupId]);return vh(yh(e,null==a?void 0:a.sku_ref_id),a,i)}function fh(e,t,n){var i,a,r=null!==(i=null===(a=t.find(e=>e.id===n))||void 0===a?void 0:a.products)&&void 0!==i?i:[];return r.forEach(t=>{t.product_details=yh(e,t.sku_ref_id||""),t.variables=vh(t.product_details,t,r)}),r}function vh(e,t,n){if(!t)return{};var i=function(e){if(!Array.isArray(e))return e;var t=e.filter(e=>e&&"object"==typeof e&&"entitlement_ref_id"in e).map(e=>e.entitlement_ref_id);return t.length?t:e}(t.entitlements),a=t.variables;if(!a)return m({},t,{entitlements:i});Object.keys(a).forEach(t=>{if("string"==typeof(r=a[t])&&r.includes(wi)){var i=ph(a[t],e,n);a[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(i)}var r});var r={};return Object.keys(Uc({})).forEach(t=>{if(void 0===a[t]){var i=Hc(t,e,void 0,n);null!==i&&(r[t]=i)}}),m({},t,r,a,{entitlements:i})}var ph=(e,t,n)=>e.replace(pi,(i,a)=>{var r,o,s,u,l=(null===(r=pi.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 Hc(a,t,d,n)});function gh(e,t){return t.flatMap(e=>e.products).some(t=>1==Hc("freeTrialEligible",yh(e,t.sku_ref_id)))}function yh(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var bh=function(){try{var e=ia(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var wh=Object.prototype.hasOwnProperty;function kh(e,t,n){var i=e[t];wh.call(e,t)&&Ai(i,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&bh?bh(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}var Sh="object"==typeof e&&e&&!e.nodeType&&e,Eh=Sh&&"object"==typeof module&&module&&!module.nodeType&&module,Ph=Eh&&Eh.exports===Sh?Fi.Buffer:void 0;Ph&&Ph.allocUnsafe;var Th=qa(Object.getPrototypeOf,Object),_h=Object.prototype.hasOwnProperty;function Mh(e){var t=new e.constructor(e.byteLength);return new pa(t).set(new pa(e)),t}var Ah=/\w*$/;var Dh=Ri?Ri.prototype:void 0,xh=Dh?Dh.valueOf:void 0;function Ch(e,t,n){var i,a,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return Mh(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return r=Mh((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=Mh(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,Ah.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return i=e,xh?Object(xh.call(i)):{}}}var Ih=Object.create,Lh=function(){function e(){}return function(t){if(!Ui(t))return{};if(Ih)return Ih(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Fh=Ua&&Ua.isMap,Rh=Fh?Wa(Fh):function(e){return Ta(e)&&"[object Map]"==pr(e)};var Oh=Ua&&Ua.isSet,$h=Oh?Wa(Oh):function(e){return Ta(e)&&"[object Set]"==pr(e)},Nh="[object Arguments]",Wh="[object Function]",jh="[object Object]",Bh={};function zh(e,t,n,i,a,r){var o;if(void 0!==o)return o;if(!Ui(e))return e;var s=ka(e);if(s)o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_h.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var u=pr(e),l=u==Wh||"[object GeneratorFunction]"==u;if(Fa(e))return e.slice();if(u==jh||u==Nh||l&&!a)o=l?{}:function(e){return"function"!=typeof e.constructor||Xa(e)?{}:Lh(Th(e))}(e);else{if(!Bh[u])return a?e:{};o=Ch(e,u)}}r||(r=new ca);var d=r.get(e);if(d)return d;r.set(e,o),$h(e)?e.forEach(function(i){o.add(zh(i,t,n,i,e,r))}):Rh(e)&&e.forEach(function(i,a){o.set(a,zh(i,t,n,a,e,r))});var c=s?void 0:er(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]),kh(o,a,zh(i,t,n,a,e,r))}),o}Bh[Nh]=Bh["[object Array]"]=Bh["[object ArrayBuffer]"]=Bh["[object DataView]"]=Bh["[object Boolean]"]=Bh["[object Date]"]=Bh["[object Float32Array]"]=Bh["[object Float64Array]"]=Bh["[object Int8Array]"]=Bh["[object Int16Array]"]=Bh["[object Int32Array]"]=Bh["[object Map]"]=Bh["[object Number]"]=Bh[jh]=Bh["[object RegExp]"]=Bh["[object Set]"]=Bh["[object String]"]=Bh["[object Symbol]"]=Bh["[object Uint8Array]"]=Bh["[object Uint8ClampedArray]"]=Bh["[object Uint16Array]"]=Bh["[object Uint32Array]"]=!0,Bh["[object Error]"]=Bh[Wh]=Bh["[object WeakMap]"]=!1;var Uh=e=>"object"==typeof e&&null!==e&&"handleEvent"in e,Hh=(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){}}},Gh=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;Hh(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;Hh(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):Uh(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 Hh(e,"currentTarget",null),!e.defaultPrevented}}])}(),Vh=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Kh=/^([01]?\d|2[0-3]):([0-5]\d)$/,Yh=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/,Xh={equals:(e,t)=>e===t,gt:(e,t)=>e>t,gte:(e,t)=>e>=t,lt:(e,t)=>e<t,lte:(e,t)=>e<=t},qh=e=>Object.prototype.hasOwnProperty.call(Xh,e),Jh=e=>"string"==typeof e.value&&e.value.startsWith(In)&&e.value.endsWith("}"),Qh=e=>{if("string"!=typeof e||!Yh.test(e))return null;var t=new Date(e);return Number.isNaN(t.getTime())?null:t},Zh=e=>{if("string"!=typeof e)return null;var t=e.split("@");return 2===t.length&&t[0]&&(e=>{if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch(e){return!1}})(t[1])?{value:t[0],zone:t[1]}:null},em=(e,t)=>{try{var n=wd(e,t,"EEEE|HH:mm",{locale:ol}).split("|"),i=n[0],a=n[1].split(":").map(Number);return{dayOfWeek:i,minutes:60*a[0]+a[1]}}catch(e){return null}},tm=e=>{var t=Zh(e);return t&&Vh.includes(t.value)?{day:t.value,zone:t.zone}:null},nm=(e,t,n)=>{if("in"===e){if(!Array.isArray(t)||0===t.length)return!1;var i=t.map(tm);return!i.some(e=>null===e)&&i.some(e=>(({day:e,zone:t})=>{var i;return(null===(i=em(n,t))||void 0===i?void 0:i.dayOfWeek)===e})(e))}if("equals"!==e&&"notEquals"!==e)return!1;var a=tm(t);if(!a)return!1;var r=em(n,a.zone);return!!r&&("equals"===e?r.dayOfWeek===a.day:r.dayOfWeek!==a.day)},im=(e,t)=>{if(!Jh(e))return null;if(Number.isNaN(t.getTime()))return!1;switch(e.value.slice(In.length,-1)){case"dayOfWeek":return nm(e.operator,e.expected,t);case"timeOfDay":return((e,t,n)=>{if(!qh(e))return!1;var i=Zh(t),a=i&&Kh.exec(i.value);if(!i||!a)return!1;var r=em(n,i.zone);return!!r&&Xh[e](r.minutes,60*Number(a[1])+Number(a[2]))})(e.operator,e.expected,t);case"now":return((e,t,n)=>{if(!qh(e))return!1;var i=Qh(t);return null!==i&&Xh[e](n.getTime(),i.getTime())})(e.operator,e.expected,t);default:return!1}},am=()=>{var e,t=null===(e=so.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.find(e=>e.startsWith(xn));if(void 0===t)return new Date;var n=(e=>e.startsWith(xn)?Qh(e.slice(xn.length)):null)(t);return null===n?(_i.warn(`Ignoring invalid ${t}: expected ISO-8601 with an offset, e.g. ${xn}2026-09-13T13:00:00-04:00`),new Date):n},rm=[];var om={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,safeAreaBottom:0,groups:[],selectedProducts:{},formStates:{},formFieldErrors:{},formFieldValidators:{},timerStates:{},currentPage:"page1",pageHistory:["page1"],currentGroupId:"",currentGroupName:"",fullScreenPresentation:!1,launch:{productGroups:[],customAttributes:{},customObject:{},currentGroup:""},sku:{},orientation:"portrait",focusedState:!1,platformId:"",mediaList:{},skuItems:[],customer:{},hasNotch:!1,purchaseInProgress:!1,formFactor:"desktop",slides:{},userInteractionEnabled:!0,currentSlideIndex:void 0},sm=function(t){function n(e,t,i){var a;o(this,n),(a=r(this,n)).subscribers=new Set,a.productDetails=rm,a.filteredSkuMenus=[],a.state=zh(om,5);var s=so.getNamiProfile();return a.state.isLoggedIn=!(null==s||!s.externalId),a.state.customer=m({},a.state.customer,so.getAllCustomerAttributesMap()),a.setPaywall(e,t,i),a.subscribers=new Set,a}return p(n,t),c(n,[{key:"onStateChanged",value:function(){}},{key:"subscribe",value:function(e){return this.subscribers.add(e),()=>this.unsubscribe(e)}},{key:"unsubscribe",value:function(e){this.subscribers.delete(e)}},{key:"emitEvent",value:function(e,t){this.dispatchEvent(function(e,t){if("function"==typeof Event){var n=new Event(e);return Object.defineProperty(n,"detail",{configurable:!0,enumerable:!1,value:t,writable:!1}),n}return{type:e,detail:t,bubbles:!1,cancelBubble:!1,cancelable:!1,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!1,returnValue:!0,srcElement:null,target:null,timeStamp:Date.now(),NONE:0,CAPTURING_PHASE:1,AT_TARGET:2,BUBBLING_PHASE:3,composedPath:()=>[],initEvent:()=>{},preventDefault:()=>{},stopImmediatePropagation:()=>{},stopPropagation:()=>{}}}(e,t))}},{key:"onEvent",value:function(e,t){var n=e=>t(e.detail);return this.addEventListener(e,n),()=>this.removeEventListener(e,n)}},{key:"setState",value:function(e){this.state=e,this.subscribers.forEach(e=>e()),this.onStateChanged()}},{key:"setProductDetails",value:function(e){this.productDetails=e}},{key:"getProductDetails",value:function(){return this.productDetails}},{key:"setCurrentGroupData",value:function(e,t){var n=mh(this.productDetails,this.state,this.filteredSkuMenus,fh(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(m({},this.state,{currentGroupId:e,currentGroupName:t,sku:n}))}},{key:"setFormState",value:function(e,t){this.setState(m({},this.state,{formStates:m({},this.state.formStates,{[e]:t})}))}},{key:"registerFormFieldValidator",value:function(e,t){this.setState(m({},this.state,{formFieldValidators:m({},this.state.formFieldValidators,{[e]:t})}))}},{key:"getFormFieldValidators",value:function(){return this.state.formFieldValidators}},{key:"setFormFieldErrors",value:function(e){this.setState(m({},this.state,{formFieldErrors:m({},e)}))}},{key:"setFormFieldError",value:function(e,t){this.setState(m({},this.state,{formFieldErrors:m({},this.state.formFieldErrors,{[e]:t})}))}},{key:"clearFormFieldError",value:function(e){var t=m({},this.state.formFieldErrors);delete t[e],this.setState(m({},this.state,{formFieldErrors:t}))}},{key:"getFormFieldErrors",value:function(){return this.state.formFieldErrors}},{key:"setTimerState",value:function(e,t,n,i){this.setState(m({},this.state,{timerStates:m({},this.state.timerStates,{[e]:{remainingSeconds:t,savedAt:n,hasEmittedCompletion:i}})}))}},{key:"getTimerState",value:function(e){return this.state.timerStates[e]}},{key:"getCurrentGroupId",value:function(){return this.state.currentGroupId}},{key:"getCurrentGroupName",value:function(){return this.state.currentGroupName}},{key:"setCurrentFormId",value:function(e,t){var n=this.state.formStates||{},i=m({},n,{[e]:t||!n[e]});this.setState(m({},this.state,{formStates:i}))}},{key:"getCurrentFormId",value:function(e){return this.state.formStates[e]}},{key:"setSelectedProducts",value:function(e){var t=m({},this.state,{selectedProducts:e}),n=mh(this.productDetails,t,this.filteredSkuMenus,fh(this.productDetails,this.filteredSkuMenus,t.currentGroupId));this.setState(m({},t,{sku:n}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"clearSelectedProduct",value:function(e){var t=this.state.selectedProducts||{};if(e&&null!=t[e]){var n=m({},t);delete n[e],this.setSelectedProducts(n)}}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,u=m({},this.state,{formFactor:Cu(),selectedPaywall:e,selectedCampaign:n});(u=m({},u,null===(i=e.template)||void 0===i?void 0:i.initialState)).platformId=null!==(a=null===(r=so.getNamiConfig())||void 0===r?void 0:r.appPlatformID)&&void 0!==a?a:"",u.systemTimeSnapshot=am().getTime();var l,d,c=function(e,t,n=[]){var i,a,r=null!==(i=t.productGroups)&&void 0!==i&&i.length?t.productGroups:n.map(e=>e.ref);return{customAttributes:t.customAttributes,productGroups:r,customObject:m({},e.customObject,t.customObject),currentGroup:null!==(a=t.currentGroup)&&void 0!==a?a:""}}(u.launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(o=e.sku_menus)&&void 0!==o?o:[],c.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter(e=>c.productGroups.includes(e.ref))),""!==c.currentGroup&&u.groups.length&&null!==(s=e.template)&&void 0!==s&&s.displaySingleGroup)&&(u.currentGroupId=null!==(l=null===(d=u.groups.find(e=>e.ref==c.currentGroup))||void 0===d?void 0:d.id)&&void 0!==l?l:"");if(""===u.currentGroupId&&1===this.filteredSkuMenus.length){var h,f=u.groups.find(e=>e.ref==this.filteredSkuMenus[0].ref);u.currentGroupId=null!==(h=null==f?void 0:f.id)&&void 0!==h?h:u.currentGroupId}var v=fh(this.productDetails,this.filteredSkuMenus,u.currentGroupId);u.skuItems=v,u.launch=c,u.anySkuHasTrialOffer=gh(this.productDetails,this.filteredSkuMenus),u.anySkuHasPromoOffer=function(e,t){return!gh(e,t)&&t.flatMap(e=>e.products).some(t=>1==Hc("promoEligible",yh(e,t.sku_ref_id)))}(this.productDetails,this.filteredSkuMenus),u.paywallId=e.id,u.sku=mh(this.productDetails,u,this.filteredSkuMenus,v),u.pageHistory=[u.currentPage],this.setState(u)}},{key:"getSelectedPaywall",value:function(){return this.state.selectedPaywall}},{key:"getSelectedCampaign",value:function(){return this.state.selectedCampaign}},{key:"getCurrentPlacementLabel",value:function(){var e,t;return null!==(e=this.state.selectedCampaign)&&void 0!==e&&e.value?this.state.selectedCampaign.value:null!==(t=this.flow)&&void 0!==t&&null!==(t=t.campaign)&&void 0!==t&&t.value?this.flow.campaign.value:void 0}},{key:"getPaywallActionEventData",value:function(){var t,n,i,a,r,o,s,u,l,d=this.state.selectedCampaign,c=this.state.selectedPaywall;return{paywallId:null!==(t=null==c?void 0:c.id)&&void 0!==t?t:"",paywallName:null!==(n=null==c?void 0:c.name)&&void 0!==n?n:"",campaignId:null!==(i=null==d?void 0:d.rule)&&void 0!==i?i:"",campaignName:null!==(a=null==d?void 0:d.name)&&void 0!==a?a:"",campaignType:null!==(r=null==d?void 0:d.type)&&void 0!==r?r:"",campaignLabel:null!==(o=null==d?void 0:d.value)&&void 0!==o?o:"",campaignUrl:(null==d?void 0:d.type)===e.NamiCampaignRuleType.URL&&null!==(s=null==d?void 0:d.value)&&void 0!==s?s:"",segmentId:null!==(u=null==d?void 0:d.segment)&&void 0!==u?u:"",externalSegmentId:null!==(l=null==d?void 0:d.external_segment)&&void 0!==l?l:""}}},{key:"paywallId",value:function(){return this.state.paywallId}},{key:"setCurrentPage",value:function(e){if(e&&e!==this.state.currentPage){var t=this.state.pageHistory&&this.state.pageHistory.length?this.state.pageHistory:[this.state.currentPage];this.setState(m({},this.state,{currentPage:e,pageHistory:[...t,e]}))}}},{key:"canGoBackPage",value:function(){var e,t;return(null!==(e=null===(t=this.state.pageHistory)||void 0===t?void 0:t.length)&&void 0!==e?e:0)>1}},{key:"goBackPage",value:function(){var e=this.state.pageHistory&&this.state.pageHistory.length?[...this.state.pageHistory]:[this.state.currentPage];if(e.length<=1)return!1;e.pop();var t=e[e.length-1];return!!t&&(this.setState(m({},this.state,{currentPage:t,pageHistory:e})),!0)}},{key:"setCustomerAttribute",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"removeCustomerAttribute",value:function(e){var t=m({},this.state.customer);delete t[e],this.setState(m({},this.state,{customer:t}))}},{key:"setIsLoggedIn",value:function(e){this.setState(m({},this.state,{isLoggedIn:e}))}},{key:"setMediaList",value:function(e){this.setState(m({},this.state,{mediaList:e.reduce((e,t)=>m({},e,{[t.name]:t}))}))}},{key:"setSafeAreaTop",value:function(e){this.setState(m({},this.state,{safeAreaTop:e}))}},{key:"setSafeAreaBottom",value:function(e){this.setState(m({},this.state,{safeAreaBottom:e}))}},{key:"setFullScreenPresentation",value:function(e){this.setState(m({},this.state,{fullScreenPresentation:e}))}},{key:"setFormFactor",value:function(e){this.setState(m({},this.state,{formFactor:e}))}},{key:"getFormFactor",value:function(){return this.state.formFactor}},{key:"setPurchaseInProgress",value:function(e){this.setState(m({},this.state,{purchaseInProgress:e}))}},{key:"setPurchase",value:function(e,t){this.setState(m({},this.state,{purchaseInProgress:e,productBeingPurchased:t}))}},{key:"setTimeSpentOnPaywall",value:function(e){this.setState(m({},this.state,{timeSpentOnPaywall:e}))}},{key:"setAppSuppliedVideoDetails",value:function({url:e,name:t}){this.setState(m({},this.state,{appSuppliedVideoUrl:e,appSuppliedVideoName:t}))}},{key:"resetAppSuppliedVideoDetails",value:function(){var e=m({},this.state);delete e.appSuppliedVideoUrl,delete e.appSuppliedVideoName,this.setState(e)}},{key:"setLaunchDetails",value:function(e,t){this.setState(m({},this.state,{launchValue:e,launchType:t}))}},{key:"setOpenHeaderIds",value:function(e,t){e=null!=t&&t.skuId?`${e}_${t.skuId}`:e;var n=[...this.state.openHeaderIds],i=n.indexOf(e);-1!==i?n.splice(i,1):n.push(e),this.setState(m({},this.state,{openHeaderIds:n,currentCollapsibleSku:null!=t?t:null}))}},{key:"getCurrentCollapsibleSku",value:function(){return this.state.currentCollapsibleSku}},{key:"setFlow",value:function(e){this.flow=e}},{key:"setUserInteractionEnabled",value:function(e){this.setState(m({},this.state,{userInteractionEnabled:e})),this.emitEvent("user-interaction-changed",{enabled:e})}},{key:"setUserTags",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"setCurrentSlideIndex",value:function(e){this.setState(m({},this.state,{currentSlideIndex:e}))}}],[{key:"create",value:function(e,t,i){var a=new n(e,t,i);return this.providers.push(a),a}},{key:"remove",value:function(e){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)}),rm=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}}])}(Gh);sm.providers=[];var um=c(function e(){o(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}});um.instance=new um;var lm=()=>Jr(Mi([...so.getNamiEntitlements(pt),...so.getNamiEntitlements(_t)]),"referenceId"),dm=()=>{Vd.getInstance().emit(hi,lm())};function cm(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 hm=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,Sc()||tu(Pe.THIRD_PARTY_TRANSACTIONS)||!tu(Pe.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=so.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)&&(so.setActiveEntitlements(ft,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:Sc()&&_i.debug("Skipping active entitlements update - anonymous mode");case 4:return i.a(2,e)}},null,this,null,Promise)}},{key:"getAPIEntitlements",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return t=`device/${e}/active_entitlements/`,n={},r.p=1,r.n=2,a(Bu.instance.fetchAPI(t));case 2:n=r.v,r.n=4;break;case 3:throw r.p=3,i=r.v,_i.error(_o(i.status,t)),i;case 4:return r.a(2,n)}},null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){au()&&(e=>{so.setNamiEntitlements(pt,e);var t=so.getNamiEntitlements(_t),n=new Set(e.map(e=>e.referenceId)),i=t.filter(e=>{var t=n.has(e.referenceId);return t&&_i.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t});i.length!==t.length&&so.setNamiEntitlements(_t,i),dm()})(e.map(e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:um.instance.refIdToRelatedSKUs[t]||[],activePurchases:um.instance.refIdToActivePurchases[t]||[],purchasedSkus:um.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e)))}}])}();hm.instance=new hm;var mm=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(!Sc()){r.n=1;break}return _i.debug("Skipping customer journey state update - anonymous mode"),r.a(2,null);case 1:if(null!=(e=so.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(Bu.instance.fetchAPI(t,void 0,0));case 4:n=r.v,r.n=6;break;case 5:throw r.p=5,i=r.v,_i.error(_o(i.status,t)),i;case 6:if(!n){r.n=7;break}return so.setCustomerJourneyState(n.customer_journey_state),r.a(2,n.customer_journey_state);case 7:return r.a(2,null)}},null,null,[[3,5]],Promise)}}])}();mm.instance=new mm;var fm="[NamiStartup]",vm=function(){return c(function e(){o(this,e),this.enabled=!1,this.t0=0,this.lastMark=0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1},[{key:"start",value:function(e){var t;this.enabled=null!==(t=null==e?void 0:e.includes(Sn))&&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;_i.info(`${fm} phase=${e} ms=${i} total_to_ready=${r}${a}`),_i.info(`${fm} SUMMARY total_to_ready=${r} decode=${this.decodeDuration} process=${this.processDuration} placements=${this.placements}`)}else _i.info(`${fm} 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 _i.info(`${fm} 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,_i.info(`${fm} phase=server_fetch ms=${i} campaigns=${n.length}`),r.a(2,n)}},null,this,null,Promise)}}])}(),pm=new vm,gm=function(){return c(function e(){o(this,e),this.inMemoryAnonymousMode=!1,this.isFirstSession=!1,this.startupDisabled=!1,this.hasInitialConfig=!1,this.lastConfig=null,this.lastStartupRunAt=0,this.startupInFlight=!1,wc=this},[{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,_i.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 so.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"getIsFirstSession",value:function(){return this.isFirstSession}},{key:"isStartupDisabled",value:function(){return this.startupDisabled}},{key:"init",value:function(e){var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return this.isFirstSession=null===so.getDevice()&&!so.getAnonymousMode(),this.startupDisabled=!1,this.hasInitialConfig=Object.keys(null!==(t=e.initialConfig)&&void 0!==t?t:{}).length>0,this.setInitialValues(e),this.lastConfig=e,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,n.p=1,n.n=2,a(this.fetchPlatformConfig());case 2:if(n.v){n.n=3;break}return n.a(2);case 3:return n.n=4,a(this.runStartupAfterConfig(e));case 4:return n.p=4,this.startupInFlight=!1,n.f(4);case 5:return n.a(2)}},null,this,[[1,,4,5]],Promise)}},{key:"resume",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(this.lastConfig&&!this.startupInFlight){r.n=1;break}return r.a(2);case 1:if(!(Date.now()-this.lastStartupRunAt<Vn)){r.n=2;break}return _i.debug("Resuming too quickly to call the service."),r.a(2);case 2:return e=this.lastConfig,t=this.startupDisabled,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,this.startupDisabled=!1,r.p=3,r.n=4,a(this.fetchPlatformConfig());case 4:if(n=!r.v){r.n=5;break}n=!t;case 5:if(!n){r.n=6;break}return r.a(2);case 6:return _i.info("Usable app config on resume - completing the startup that stopped at launch"),r.n=7,a(this.runStartupAfterConfig(e));case 7:r.n=9;break;case 8:r.p=8,i=r.v,_i.warn(`Resume refresh failed: ${i}`);case 9:return r.p=9,this.startupInFlight=!1,r.f(9);case 10:return r.a(2)}},null,this,[[3,8,9,10]],Promise)}},{key:"runStartupAfterConfig",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.initAndFetchRequiredData(e));case 1:Ec.instance.startSession();case 2:return t.a(2)}},null,this,null,Promise)}},{key:"clearResumeState",value:function(){this.lastConfig=null,this.lastStartupRunAt=0,this.startupDisabled=!1}},{key:"fetchPlatformConfig",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(pc.instance.fetchConfigForStartup(this.hasInitialConfig));case 1:if((e=t.v).usable){t.n=2;break}return this.startupDisabled=!0,_i.error(`Nami startup stopped: ${e.reason}`),t.a(2,!1);case 2:return t.a(2,!0)}},null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=m({},e);delete t.initialConfig,so.clearSessionId(),so.setNamiConfig(t),so.setLanguageCode(e.namiLanguageCode),so.setPurchaseChannel(e.purchaseChannel);var n,i=e.initialConfig;if(i.appConfig||i.platform_config){var a=(null==i?void 0:i.appConfig)||(null==i?void 0:i.platform_config);a&&so.setAppConfig(yt,a)}null!=i&&i.paywalls&&(so.setPaywalls(St,i.paywalls.map(e=>m({},e,{fetchSource:"initialConfig"}))),null!==(n=i.campaign_rules)&&void 0!==n&&n.length&&mc.instance.seedFromInitialConfig(i.campaign_rules,i.paywalls));null!=i&&i.products&&so.setProducts(Pt,i.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:Xd.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=m({},xu(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)?Ru(i):void 0}}}(e.namiCommands),i=Xd.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:Cu(),l=this.isAnonymousMode(),d=l?this.initAnonymousDevice():this.initIdentifiedDevice(e),c=d.deviceId,h=d.deviceTask,m=Lu(c),s.campaign_rules&&(f=_d(s.campaign_rules,m,u),so.setCampaignRules(wt,f),pm.mark("initial_processed",{count:f.length})),!h){p.n=1;break}return p.n=1,a(h);case 1:if(Kd.instance.configure(u,m,e.namiCommands),iu(),v=Promise.all([qd.instance.fetchProducts(),mm.instance.fetchCustomerJourneyState(),hm.instance.fetchActiveEntitlements(),pm.serverFetch(()=>this.fetchCampaignsAndPaywalls())]).catch(i=>{var r;return k(function(o){for(;;)switch(o.n){case 0:if(!(i instanceof co)){o.n=3;break}if(so.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 _i.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,v,p;return k(function(g){for(;;)switch(g.n){case 0:return e=Kd.instance,t=mc.instance,n=Date.now(),i=Date.now(),g.n=1,a(e.fetchCampaignRulesRaw());case 1:return r=g.v,o=r.campaigns,s=r.fromNetwork,u=Date.now()-i,g.n=2,a(Promise.all(o.filter(e=>{var t;return(null===(t=e.flow)||void 0===t?void 0:t.url)&&!e.flow.object}).map(e=>{var t,n;return k(function(i){for(;;)switch(i.p=i.n){case 0:return i.p=0,i.n=1,a(lc(e.flow.url));case 1:t=i.v,e.flow.object=t.data,i.n=3;break;case 2:i.p=2,n=i.v,_i.warn(`Error fetching flow object from ${e.flow.url}: ${n}`);case 3:return i.a(2)}},null,null,[[0,2]],Promise)})));case 2:if(l=!e.useLegacyPaywallFetch&&Kd.hasPaywallUrls(o),c=null,h=Date.now(),!l||s){g.n=3;break}_i.info("Paywall resolution skipped: campaign_rules were served from the stored copy"),d=Hu(),g.n=7;break;case 3:if(!l){g.n=5;break}return m=Kd.extractPaywallUrls(o),g.n=4,a(t.resolvePaywallsByUrls(m));case 4:c=g.v,d=c.paywalls,io.reconcile(new Set(m)),g.n=7;break;case 5:return g.n=6,a(t.fetchPaywalls());case 6:d=g.v;case 7:return f=Date.now()-h,v=Date.now()-n,l&&!c||(p=c?`, urls=${c.urls}, hashed=${c.hashed}, cache_hits=${c.cacheHits}, fetched=${c.fetched}, cache_after_fetch_failure=${c.cacheAfterFetchFailure}, failed=${c.failed}`:"",_i.debug(`Paywall fetch telemetry: strategy=${l?"individual":"bulk"}, count=${d.length}${p}, total=${v}ms, campaigns=${u}ms, paywalls=${f}ms`+(c?`, retry_count=${c.retryCount}`:""))),g.a(2,e.finalizeCampaignRules(o,d))}},null,null,null,Promise)}},{key:"reRenderPaywall",value:function(){we().ui.reRenderPaywall()}}])}();function ym(e){return Array.isArray(e)?e.map(ym):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=ym(n)),e),{}):e}function bm(e,t){return Yd(ym(e),ym(t))}gm.instance=new gm;var wm=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?so.setNamiProfile({externalId:this.externalId}):so.removeNamiProfile(),this}},{key:"load",value:function(){var e=so.getNamiProfile();e&&(this.externalId=e.externalId),sm.setIsLoggedIn(!!this.externalId)}},{key:"loginLocal",value:function(e){this.setExternalId(e).save(),sm.setIsLoggedIn(!0)}},{key:"loginRemote",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return n.n=1,a(Bu.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(),sm.setIsLoggedIn(!1)}},{key:"logoutRemote",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(Bu.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)}}])}();wm.instance=new wm;var km,Sm,Em=function(){function e(){o(this,e)}return c(e,[{key:"previous",get:function(){return this._previous}},{key:"record",value:function(e){this._previous=this._current,this._current=e}},{key:"reset",value:function(){this._current=void 0,this._previous=void 0}}],[{key:"shared",get:function(){return this._shared||(this._shared=new e),this._shared}}])}(),Pm=function(){function e(){o(this,e),km.set(this,!1),Sm.set(this,null),this.maxLogging=!1}return c(e,[{key:"isInitialized",get:function(){return Se(this,km,"f")||null!=so.getNamiConfig()}},{key:"listenForAppForeground",value:function(){var e,t,n;Se(this,Sm,"f")||Ee(this,Sm,null!==(e=null===(t=(n=we().device).onAppForeground)||void 0===t?void 0:t.call(n,()=>{gm.instance.resume()}))&&void 0!==e?e:null)}},{key:"initializeSDK",value:function(t){var n,i,r,o,s,u,l,d,c,h;return k(function(f){for(;;)switch(f.n){case 0:if(o=!1,s=!1,u=Se(this,km,"f")?so.getNamiConfig():null,_i.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,!bm(l,u)){f.n=1;break}return _i.warn("Nami SDK is already configured, ignoring this configure call."),f.a(2,{sdkInitialized:!0,configureState:oi});case 1:s=!0;case 2:d=eu(t.namiCommands),c=eu(u.namiCommands),t.appPlatformID==u.appPlatformID&&d==c||(o=!0),t.namiLanguageCode===u.namiLanguageCode&&t.logLevel==u.logLevel||(s=!0);case 3:return o&&(_i.info("SDK full reconfigure called"),so.resetDevice()),Ee(this,km,!0),Bu.configure(t),this.listenForAppForeground(),f.n=4,a(gm.instance.init(t));case 4:return _i.info("SDK successfully initialized!"),h=s||o?ai:ni,null===(i=(r=we().ui).postConfigure)||void 0===i||i.call(r),pm.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,r,o;return k(function(s){for(;;)switch(s.n){case 0:return so.clearAll(),io.purgeAll(),kc(),Ee(e.instance,km,!1),null===(t=Se(r=e.instance,Sm,"f"))||void 0===t||t.call(r),Ee(e.instance,Sm,null),gm.instance.clearResumeState(),wm.instance.setExternalId(void 0),sm.reset(),Bu.reset(),Kd.instance.reset(),Em.shared.reset(),s.n=1,a(Promise.resolve().then(function(){return Ff}));case 1:o=s.v,o.NamiFlowManager.reset(),null===(n=(i=we().ui).onReset)||void 0===n||n.call(i);case 2:return s.a(2)}},null,null,null,Promise)}},{key:"configure",value:function(t){return k(function(n){for(;;)switch(n.n){case 0:if(pm.start(t.namiCommands),t.appPlatformID){n.n=1;break}throw new mo;case 1:return this.setInitialConfig(t),pm.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){_i.debug("[DEPRECATED] NamiConfiguration.initialConfig should be an object");var t=function(e){var t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(t)}catch(e){return}}(e.initialConfig);if(!t)return _i.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=su(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},_i.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();km=new WeakMap,Sm=new WeakMap,Pm.instance=new Pm;var Tm,_m,Mm,Am=new Set(["fullscreen","sheet","compact_sheet","modal"]);e.NamiPaywallManagerEvents=void 0,(Tm=e.NamiPaywallManagerEvents||(e.NamiPaywallManagerEvents={})).BuySku="RegisterBuySKU",Tm.Close="PaywallCloseRequested",Tm.SignIn="PaywallSignInRequested",Tm.Restore="PaywallRestoreRequested",Tm.DeeplinkAction="PaywallDeeplinkAction",e.NamiPaywallAction=void 0,(_m=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",_m.SELECT_SKU="SELECT_SKU",_m.RESTORE_PURCHASES="RESTORE_PURCHASES",_m.SIGN_IN="SIGN_IN",_m.CLOSE_PAYWALL="CLOSE_PAYWALL",_m.SHOW_PAYWALL="SHOW_PAYWALL",_m.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",_m.PURCHASE_SUCCESS="PURCHASE_SUCCESS",_m.PURCHASE_FAILED="PURCHASE_FAILED",_m.PURCHASE_CANCELLED="PURCHASE_CANCELLED",_m.PURCHASE_PENDING="PURCHASE_PENDING",_m.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",_m.PURCHASE_DEFERRED="PURCHASE_DEFERRED",_m.DEEPLINK="DEEPLINK",_m.TOGGLE_CHANGE="TOGGLE_CHANGE",_m.PAGE_CHANGE="PAGE_CHANGE",_m.SLIDE_CHANGE="SLIDE_CHANGE",_m.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",_m.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",_m.VIDEO_STARTED="VIDEO_STARTED",_m.VIDEO_PAUSED="VIDEO_PAUSED",_m.VIDEO_RESUMED="VIDEO_RESUMED",_m.VIDEO_ENDED="VIDEO_ENDED",_m.VIDEO_CHANGED="VIDEO_CHANGED",_m.VIDEO_MUTED="VIDEO_MUTED",_m.VIDEO_UNMUTED="VIDEO_UNMUTED",_m.COUNTDOWN_TIMER_COMPLETED="COUNTDOWN_TIMER_COMPLETED",_m.UNKNOWN="UNKNOWN",e.LaunchCampaignError=void 0,(Mm=e.LaunchCampaignError||(e.LaunchCampaignError={})).DEFAULT_CAMPAIGN_NOT_FOUND="Default campaign not found",Mm.LABELED_CAMPAIGN_NOT_FOUND="Labeled campaign not found",Mm.CAMPAIGN_DATA_NOT_FOUND="Campaign data not found",Mm.PAYWALL_ALREADY_DISPLAYED="Paywall is already being displayed",Mm.SDK_NOT_INITIALIZED="SDK has not been initialized",Mm.PAYWALL_COULD_NOT_DISPLAY="Failed to display paywall",Mm.URL_CAMPAIGN_NOT_FOUND="URL campaign not found",Mm.PRODUCT_DATA_NOT_FOUND="Product data not found",Mm.PRODUCT_GROUPS_NOT_FOUND="Product groups not found",Mm.FLOW_SCREEN_DATA_UNAVILABLE="Flow unavailable due to missing screen data";var Dm,xm="entry",Cm="screen",Im="branch",Lm="exit",Fm="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.SET_TAGS_FROM_FORM="setTagsFromForm",e.PAUSE="flowPause",e.RESUME="flowResume",e.SET_LAUNCH_CONTEXT="setLaunchContext",e.SET_FLOW_PATH="setFlowPath"}(Dm||(Dm={}));var Rm="__handoff_sequence__",Om={Push:"push",Location:"location",Tracking:"att",Deeplink:"deeplink",Complete:"complete",SignIn:"signin",Restore:"restore",SignInMvpd:"signin_mvpd",BuySku:"buysku",UserData:"userdata"};var $m={Push:"push",Location:"location",Tracking:"tracking",Camera:"camera",Microphone:"microphone",Photos:"photos",Contacts:"contacts",Bluetooth:"bluetooth",Calendar:"calendar",Biometrics:"biometrics",Health:"health",Motion:"motion",Speech:"speech",LocalNetwork:"localNetwork"},Nm={[$m.Push]:"push_authorized",[$m.Location]:"location_authorized",[$m.Tracking]:"tracking_authorized"},Wm="__buy_sku__",jm="__default__",Bm="__appear__",zm="__disappear__",Um="__login_success__",Hm="__login_failure__",Gm="__logout_success__",Vm="__logout_failure__",Km="__purchase_success__",Ym="__purchase_failure__",Xm="__remoteback__",qm="__tag_update__",Jm="__permission_granted__",Qm="and",Zm="or",ef="i_contains",tf="equals",nf="i_equals",af="not_equals",rf="not_i_equals",of="not_contains",sf="contains",uf="set",lf="not_set",df="greater_than",cf="greater_than_or_equal_to",hf="less_than",mf="less_than_or_equal_to";function ff(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 vf=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 Qm:return i.every(e=>e);case Zm: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 Qm:for(var i,a=h(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case Zm: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(Pm.instance.maxLogging&&_i.debug(`[NamiConditionEvaluator] resolve(${e.identifier}) → ${JSON.stringify(t)} (type: ${typeof t})`),e.operator===uf)return null!=t;if(e.operator===lf)return null==t;if(null==t)return Pm.instance.maxLogging&&_i.debug(`[NamiConditionEvaluator] ${e.identifier} resolved to null — registeredNamespaces: [${[...this.namespaceResolvers.keys()].join(", ")}]`),!![af,rf,of].includes(e.operator);switch(e.operator){case ef: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 tf:return e.values.some(e=>this.strictEquals(t,e,!1));case nf:return e.values.some(e=>this.strictEquals(t,e,!0));case af:return e.values.every(e=>!this.strictEquals(t,e,!1));case rf:return e.values.every(e=>!this.strictEquals(t,e,!0));case sf:return!(!Array.isArray(t)&&"string"!=typeof t)&&e.values.some(e=>"string"==typeof e&&t.includes(e));case of:return Array.isArray(t)?e.values.every(e=>!("string"==typeof e&&t.includes(e))):e.values.every(e=>"string"!=typeof t||"string"!=typeof e||!t.includes(e));case df:case cf:case hf:case mf:var n=ff(t);return null===n?(this.log(`Resolved value is not numerically comparable for ${e.operator}`),!1):e.values.some(t=>{var i=ff(t);if(null===i)return!1;switch(e.operator){case df:return n>i;case cf:return n>=i;case hf: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 Pm.instance.maxLogging&&_i.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 Pm.instance.maxLogging&&_i.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 Pm.instance.maxLogging&&_i.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){_i.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),pf=function(){return c(function e(){o(this,e)},[{key:"register",value:function(){vf.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}}])}(),gf=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t)).namespace="LaunchContext",i.context=e,i.campaign=n,i.register(),i}return p(t,e),c(t,[{key:"resolveValue",value:function(e){var t,n,i,a;if("placement"===e)return null!==(t=null===(n=this.campaign)||void 0===n?void 0:n.value)&&void 0!==t?t:void 0;if("tags"===e)return null!==(i=null===(a=this.campaign)||void 0===a?void 0:a.placement_tags)&&void 0!==i?i:void 0;if(e.startsWith("customAttributes.")){var r=e.substring(17);return this.resolveKeyPath(r,this.context.customAttributes)}if(e.startsWith("customObject.")){var o=e.substring(13);return this.resolveKeyPath(o,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(pf),yf=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=xu(),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)}}])}(pf),bf=[/(^|_)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],wf=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=>bf.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()}}])}();wf._instance=null;var kf=()=>wf.instance.params;function Sf(e){if(null!=e&&""!==e){if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e){if(!Number.isFinite(e))return;return String(e)}return String(e)}}var Ef,Pf=/\{\{\s*([^}]+?)\s*\}\}/g,Tf=/\$\{[^}]+\}/g,_f=function(){return c(function e(t){o(this,e),this.flowManager=t,this.urlParams=kf()},[{key:"currentScreenPaywall",value:function(){var e,t,n=null===(e=this.flowManager.currentFlow)||void 0===e||null===(e=e.currentFlowStep)||void 0===e?void 0:e.screen;if(n)return(null===(t=this.screenPaywallLookup)||void 0===t?void 0:t.screenId)!==n&&(this.screenPaywallLookup={screenId:n,paywall:Vu(n)}),this.screenPaywallLookup.paywall}},{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k=this.flowManager.currentFlow,S=null==k?void 0:k.component;if(e.startsWith("launchContext.")){var E=null==k?void 0:k.context;if(E){var P=e.substring(14),T=new gf(E,null==k?void 0:k.campaign).resolveValue(P);return Array.isArray(T)?T.join(","):null==T?void 0:T.toString()}}else{if(e.startsWith("form.")){var _,M=e.substring(5);return Sf(null===(_=sm.currentProvider)||void 0===_?void 0:_.state.formStates[M])}if(e.startsWith("sku.")){var A=null==k?void 0:k.purchasedSku;if(!A)return;var D=e.substring(4);switch(D){case"sku_ref_id":return A.skuRefId;case"name":return A.name;case"entitlement_ref_id":return null!==(t=null===(n=A.entitlements[0])||void 0===n?void 0:n.entitlement_ref_id)&&void 0!==t?t:"";case"entitlement_name":return null!==(i=null===(a=A.entitlements[0])||void 0===a?void 0:a.name)&&void 0!==i?i:"";default:var x=Hc(D,A.productDetails);return null!=x?String(x):void 0}}switch(e){case"campaignId":return null==S||null===(r=S.campaign)||void 0===r?void 0:r.rule;case"campaignName":return null==S||null===(o=S.campaign)||void 0===o?void 0:o.name;case"campaignLabel":case"campaignPlacement":return null!==(s=null==S||null===(u=S.campaign)||void 0===u?void 0:u.value)&&void 0!==s?s:void 0;case"campaignSegment":case"campaignSegmentId":return null==S||null===(l=S.campaign)||void 0===l?void 0:l.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(d=null==S||null===(c=S.campaign)||void 0===c?void 0:c.external_segment)&&void 0!==d?d:void 0;case"pageName":return null!==(h=null===(m=this.currentScreenPaywall())||void 0===m?void 0:m.name)&&void 0!==h?h:null==S||null===(f=S.paywall)||void 0===f?void 0:f.name;case"pageId":return null!==(v=null==k||null===(p=k.currentFlowStep)||void 0===p?void 0:p.screen)&&void 0!==v?v:null==S||null===(g=S.paywall)||void 0===g?void 0:g.id;case"flowName":return null==k?void 0:k.name;case"flowId":return null==k?void 0:k.id;case"objectId":return null==S||null===(y=S.campaign)||void 0===y||null===(y=y.flow)||void 0===y?void 0:y.object_id;case"stepName":return null==k||null===(b=k.currentFlowStep)||void 0===b?void 0:b.name;case"buttonText":var C=null==k?void 0:k.currentButton;if(!C)return;var I=C.firstTextValue;if("function"!=typeof I)return;return I.call(C);case"slideNumber":var L=null==S?void 0:S.getSelectedSlideIndexForCurrentCarousel();return null!=L?`${L+1}`:void 0;case"productGroupId":return(null===(w=sm.currentProvider)||void 0===w?void 0:w.state.currentGroupId)||void 0;case"productGroupName":var F,R,O,$=null===(F=sm.currentProvider)||void 0===F?void 0:F.state;return null!==(R=null==$||null===(O=$.groups)||void 0===O||null===(O=O.find(e=>e.id===$.currentGroupId))||void 0===O?void 0:O.displayName)&&void 0!==R?R:void 0;case"productGroupRef":var N,W,j,B=null===(N=sm.currentProvider)||void 0===N?void 0:N.state;return null!==(W=null==B||null===(j=B.groups)||void 0===j||null===(j=j.find(e=>e.id===B.currentGroupId))||void 0===j?void 0:j.ref)&&void 0!==W?W:void 0;case"flowPath":return null==k?void 0:k.flowPath;default:return}}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Pf,(e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}).replace(Tf,"")}},{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}}])}(),Mf=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="urlParams",e.context=kf(),e.register(),e}return p(t,e),c(t,[{key:"resolveValue",value:function(e){return _i.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(pf),Af=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=sm.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)}}}])}(pf),Df=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=sm.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()}}}}])}(pf),xf=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).namespace="LastLaunchContext",e}return p(t,e),c(t,[{key:"register",value:function(){T(t,"register",this)([])}},{key:"resolveValue",value:function(e){var t=Em.shared.previous;if(t){if("placement"===e)return t.placementLabel;if("tags"===e)return t.tags;if(e.startsWith("customAttributes.")){var n=e.substring(17);return this.resolveKeyPath(n,t.customAttributes)}}}}])}(pf);!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"}(Ef||(Ef={}));var Cf=e=>{var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:if(!Sc()){n.n=1;break}return _i.info("Skipping transaction post - anonymous mode"),n.a(2);case 1:return n.p=1,n.n=2,a(Bu.instance.postConversion(e));case 2:n.n=4;break;case 3:n.p=3,t=n.v,_i.error("Error posting conversion",t);case 4:return n.a(2)}},null,null,[[1,3]],Promise)},If=function(){return c(function e(){o(this,e),this.emitter=Vd.getInstance()},[{key:"sdkInitialized",get:function(){return Pm.instance.isInitialized}}],[{key:"allPaywalls",value:function(){if(!this.instance.sdkInitialized)throw new ho;return Gu()}},{key:"setProductDetails",value:function(e){this.instance.productDetails=e,sm.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 au()&&_i.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(sm.setPurchaseInProgress(!1),Lf.instance.flowOpen&&(t=Lf.instance.currentFlow,n=null==t?void 0:t.currentFlowStep,t&&n&&t.executeLifecycle(n,Km)),!Of.inAnonymousMode()){u.n=1;break}return _i.debug("Skipping purchase validation - anonymous mode"),u.a(2);case 1:if(i=so.getSessionId(),r=so.getPurchaseImpression()){u.n=2;break}return _i.debug("Not sending paywall conversion call complete due to unknown impression"),u.a(2);case 2:return u.p=2,u.n=3,a(Cf({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,_i.error("Error posting conversion",o);case 5:if(tu(Pe.THIRD_PARTY_TRANSACTIONS)){u.n=9;break}return u.p=6,u.n=7,a(Bu.instance.purchaseValidation({app_env:"production",payload:"",sku:e.skuId}));case 7:u.n=9;break;case 8:u.p=8,s=u.v,_i.error("Error validating purchase",s);case 9:return u.a(2)}},null,null,[[6,8],[2,4]],Promise)}},{key:"buySkuCancel",value:function(){tu(Pe.THIRD_PARTY_TRANSACTIONS)?sm.setPurchase(!1):_i.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){Pd(e)?(_i.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received valid url ${e}`),sm.setAppSuppliedVideoDetails({url:e,name:t})):_i.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received invalid url ${e}`)}},{key:"allowUserInteraction",value:function(e){_i.debug(`NamiPaywallManager: allowUserInteraction called with ${e}`),sm.setUserInteractionEnabled(e)}}])}();If.instance=new If,If.emitter=Vd.getInstance();var Lf=function(){function e(){o(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"hasHandoffHandler",get:function(){return!!this.handoffStepHandler}},{key:"deliverHandoff",value:function(t,n){var i=this.handoffStepHandler;if(i){var a={tag:t,completed:!1};this.pendingHandoff=a;i(t,n,n=>{if(a.completed)_i.warn(`[NamiFlowManager] complete() called more than once for handoff '${t}' — ignored`);else{var i=e.instance.pendingHandoff;i&&i!==a?_i.warn(`[NamiFlowManager] stale complete() for handoff '${t}' — a newer handoff ('${i.tag}') is pending; ignored`):(a.completed=!0,this.pendingHandoff===a&&(this.pendingHandoff=void 0),e.routeHandoffOutcome(null!=n?n:{kind:"done"}),e.resume())}})}}},{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(t,n,i){var a=new Hf(t,n,this,i);return this.flowOpen=!0,this.currentFlow=a,Bu.impressionListener=t=>{var n;null===(n=e.instance.currentFlow)||void 0===n||n.bindImpression(t)},a}},{key:"finishFlow",value:function(){Pm.instance.maxLogging&&_i.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===Cm);if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter(e=>e.type===Cm);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 _i.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[Bm];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===Dm.NAVIGATE||d.function===Dm.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var c=d.parameters.delay,m=Number(c);if(!isNaN(m)&&m>0)return m/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"reset",value:function(){var t=e.instance;t.currentFlow=void 0,t.flowOpen=!1,t.lastAnimatedFlowProgress=new Map,t.navGraphCache=new WeakMap,t.pendingHandoff=void 0}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e;var t=e;return()=>{this.instance.handoffStepHandler===t&&(this.instance.handoffStepHandler=void 0)}}},{key:"routeHandoffOutcome",value:function(t){var n=e.instance.currentFlow,i=null==n?void 0:n.currentFlowStep;switch(t.kind){case"done":return;case"permission":if(!n)return;if(n.handoffState.permissions[t.permission]=t.granted,!t.granted)return;i&&n.executeLifecycle(i,Jm);var a=Nm[t.permission];return void(a?n.completionSignal(a):_i.debug(`[NamiFlowManager] permission '${t.permission}' granted — no completion_result mapping yet (state/lifecycle only)`));case"purchase":return void("success"===t.result?If.buySkuComplete(t.details):(sm.setPurchase(!1),n&&i&&n.executeLifecycle(i,Ym)));case"login":if("success"===t.result){var r,o,s=t.details;if(n)n.handoffState.login=m({},null!==(o=s.attributes)&&void 0!==o?o:{});Of.loggedInId()===s.loginId?n&&i&&n.executeLifecycle(i,Um):Promise.resolve(Of.login(s.loginId)).catch(e=>{_i.error("[NamiFlowManager] login from handoff outcome failed",e)});var u=null===(r=so.getDevice())||void 0===r?void 0:r.customer_data_platform_id;s.cdpId&&s.cdpId!==u&&Promise.resolve(Of.setCustomerDataPlatformId(s.cdpId)).catch(e=>{_i.error("[NamiFlowManager] CDP id write-through from handoff outcome failed",e)})}else n&&i&&n.executeLifecycle(i,Hm);return}}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e;var t=e;return()=>{this.instance.eventHandler===t&&(this.instance.eventHandler=void 0)}}},{key:"resume",value:function(){var t,n,i,a=e.instance,r=a.flowOpen,o=a.currentFlow;Pm.instance.maxLogging&&_i.debug(`[NamiFlowManager] resume() — flowOpen=${r}, hasFlow=${!!o}, currentStep=${null!==(t=null==o||null===(n=o.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"none"}, isPaused=${null!==(i=null==o?void 0:o.isPaused)&&void 0!==i?i:"N/A"}`);var s=e.instance.pendingHandoff;if(s&&!s.completed&&(s.completed=!0,e.instance.pendingHandoff=void 0,_i.warn(`[NamiFlowManager] resume() called during handoff '${s.tag}' with a v2 handler registered — treated as complete({kind:'done'}); prefer complete(outcome)`)),r&&o&&o.currentFlowStep){if(o.activeHandoffSequence)return _i.debug(`Resuming flow at handoff sequence ${o.currentFlowStep.id}`),void o.resumeNextHandoff();_i.debug(`Resuming flow at step ${o.currentFlowStep.id}`),o.executeLifecycle(o.currentFlowStep,"__resume__")}else _i.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?(_i.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.dismiss()):_i.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():_i.warn("This flow cannot be paused"):_i.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()}}])}(),Ff=Object.freeze({__proto__:null,NamiFlowManager:Lf}),Rf=()=>{var e,t;return null!==(e=null===(t=so.getNamiConfig())||void 0===t||null===(t=t.namiCommands)||void 0===t?void 0:t.includes("disableAsyncLoginLogout"))&&void 0!==e&&e},Of=function(){return c(function e(){o(this,e),this.emitter=Vd.getInstance(),vf.shared.registerNamespaceResolver("UserTags",t=>{var n,i=t.replace("UserTags.","");return null!==(n=e.getCustomerAttribute(i))&&void 0!==n?n:null})},[{key:"isSDKInitialized",get:function(){return Pm.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return wm.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||_i.debug(Ne),wm.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 ho,this.invokeStateHandler(Ef.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){c.n=2;break}throw n=new wo,this.invokeStateHandler(Ef.LOGIN,!1,n),n;case 2:if(Rf()){c.n=3;break}return wm.instance.loginLocal(e),this.invokeStateHandler(Ef.LOGIN,!0),Lf.instance.flowOpen&&(i=Lf.instance.currentFlow,(r=null==i?void 0:i.currentFlowStep)&&(Pm.instance.maxLogging&&_i.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${r.id}`),i.executeLifecycle(r,Um))),wm.instance.loginRemote(e).catch(e=>{_i.error("[NamiCustomerManager] async login API failed",e)}),hm.instance.fetchActiveEntitlements().catch(e=>{_i.error("[NamiCustomerManager] async login entitlement refresh failed",e)}),c.a(2);case 3:return c.p=3,c.n=4,a(wm.instance.login(e));case 4:return c.n=5,a(hm.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Ef.LOGIN,!0),Lf.instance.flowOpen&&(o=Lf.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&(Pm.instance.maxLogging&&_i.debug(`[NamiCustomerManager] login success — triggering __login_success__ on step ${s.id}`),o.executeLifecycle(s,Um))),c.n=7;break;case 6:throw c.p=6,d=c.v,this.invokeStateHandler(Ef.LOGIN,!1,d),Lf.instance.flowOpen&&(u=Lf.instance.currentFlow,(l=null==u?void 0:u.currentFlowStep)&&(Pm.instance.maxLogging&&_i.debug(`[NamiCustomerManager] login failure — triggering __login_failure__ on step ${l.id}`),u.executeLifecycle(l,Hm))),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 ho,this.invokeStateHandler(Ef.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){d.n=2;break}throw t=new wo,this.invokeStateHandler(Ef.LOGOUT,!1,t),t;case 2:if(Rf()){d.n=3;break}return wm.instance.logoutLocal(),this.invokeStateHandler(Ef.LOGOUT,!0),Lf.instance.flowOpen&&(n=Lf.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&(Pm.instance.maxLogging&&_i.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${i.id}`),n.executeLifecycle(i,Gm))),wm.instance.logoutRemote().catch(e=>{_i.error("[NamiCustomerManager] async logout API failed",e)}),hm.instance.fetchActiveEntitlements().catch(e=>{_i.error("[NamiCustomerManager] async logout entitlement refresh failed",e)}),d.a(2);case 3:return d.p=3,d.n=4,a(wm.instance.logout());case 4:return d.n=5,a(hm.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Ef.LOGOUT,!0),Lf.instance.flowOpen&&(r=Lf.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,Gm)),d.n=7;break;case 6:throw d.p=6,l=d.v,this.invokeStateHandler(Ef.LOGOUT,!1,l),Lf.instance.flowOpen&&(s=Lf.instance.currentFlow,(u=null==s?void 0:s.currentFlowStep)&&s.executeLifecycle(u,Vm)),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?Ef.ANONYMOUS_MODE_ON:Ef.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new ho,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return _i.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 yo:new bo,this.invokeStateHandler(t,!1,i),s.a(2);case 3:if(!e){s.n=4;break}so.setAnonymousMode(e),so.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Ef.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return so.clearAnonymousMode(),kc(),o=null===(r=so.getNamiConfig())||void 0===r?void 0:r.namiCommands,s.n=5,a(Xd.instance.createOrUpdateDevice(xu(o)));case 5:so.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Ef.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}},null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Sc()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new ho;if(so.setCustomerAttribute(e,t),tu(Pe.PAYWALL_PERSONALIZATION)?(sm.setCustomerAttribute({[e]:t}),_i.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):_i.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.`),Lf.instance.flowOpen){var n=Lf.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,qm)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new ho;var t=so.getCustomerAttribute(e);return null!=t?tu(Pe.PAYWALL_PERSONALIZATION)?_i.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):_i.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.`):_i.debug(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new ho;return so.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new ho;so.clearCustomerAttribute(e)?(sm.removeCustomerAttribute(e),_i.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.`)):_i.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new ho;so.getAllCustomerAttributesKeys().forEach(e=>{sm.removeCustomerAttribute(e)}),so.clearAllCustomerAttributes(),_i.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 ho;return so.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=so.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:qe}},{key:"registerJourneyStateHandler",value:function(e){if(au("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(fi,e),()=>{this.instance.emitter.removeListener(fi,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 ho,this.invokeStateHandler(Ef.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(Xd.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Ef.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,r=o.v,this.invokeStateHandler(Ef.CUSTOMER_DATA_PLATFORM_ID_SET,!1,r);case 5:o.n=7;break;case 6:return _i.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=so.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new ko,this.invokeStateHandler(Ef.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=tu(Pe.ANONYMOUS_MODE_CAPABILITY),t=tu(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([qd.instance.fetchProducts(),mc.instance.fetchPaywalls().then(e=>Kd.instance.fetchCampaignRules(e))]));case 1:return e.a(2)}},null,this,null,Promise)}}])}();Of.instance=new Of;var $f="This field is required",Nf="Please enter a valid email address",Wf="Please enter at least 2 characters",jf=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Bf(e,t,n){var i=("string"==typeof n?n:null==n?"":String(n)).trim();return t&&0===i.length?$f:0!==i.length?"email"!==e||jf.test(i)?"name"===e&&i.length<2?Wf:void 0:Nf:void 0}var zf=/^([^:]+)::(.+)$/;var Uf=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&&Ku(this.screens)}}])}(),Hf=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.flowPath="",u.timerStates={},u.handoffState={permissions:{}},u.campaign=e,u.component=n,u.context=a,u.manager=i,u.branchcrumbs=[],u.stepcrumbs=[],u.registerResolvers(a);var l=u.findStepByType(xm);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 gf(this.context,this.campaign)),null!==(n=(t=this.context).customAttributes)&&void 0!==n||(t.customAttributes={}),Object.assign(this.context.customAttributes,e)}},{key:"registerResolvers",value:function(e){e&&new gf(e,this.campaign),new yf,new Mf,new Af,new Df(this.campaign),(new xf).register(),vf.shared.registerNamespaceResolver("Flow",e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map(e=>e.id);case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}),vf.shared.registerNamespaceResolver("login",e=>{var t,n=e.replace(/^login\./,"");return null===(t=this.handoffState.login)||void 0===t?void 0:t[n]}),vf.shared.registerNamespaceResolver("permissions",e=>{var t=e.replace(/^permissions\./,"");return this.handoffState.permissions[t]}),vf.shared.registerNamespaceResolver("__first_session__",()=>gm.instance.getIsFirstSession())}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),i=this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type);return t&&n&&i}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find(t=>t.id===e)}},{key:"findStepByType",value:function(e){return this.steps.find(t=>t.type===e)}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some(e=>this.branchcrumbs.includes(e))}},{key:"flowLog",value:function(e,...t){Pm.instance.maxLogging&&_i.debug(`[NamiFlow] ${e}`,...t)}},{key:"finished",value:function(){var e;this.flowLog(`finished() — closing flow, isPaused=${this.isPaused}, step=${null===(e=this.currentFlowStep)||void 0===e?void 0:e.id}`),this.manager.finishFlow()}},{key:"dismiss",value:function(){this.signalNonCompletion("dismiss_page"),this.finished()}},{key:"back",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){if(!this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type))return this.flowLog("back() — no previous screen step, dismissing flow"),void this.dismiss();this.backToPreviousScreenStep()}else _i.debug(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"bindImpression",value:function(e){var t=this.currentFlowStep;if(t){var n=this.completionContext;n&&n.stepId===t.id&&!n.impressionId?n.impressionId=e:this.completionContext={stepId:t.id,impressionId:e,resultSent:!1,pending:[]};var i=t.completion_step;null!=i&&i.enabled&&"page_view"===i.condition&&this.completionSignal("page_view");var a=this.completionContext.pending;this.completionContext.pending=[],a.forEach(e=>this.completionSignal(e))}}},{key:"completionSignal",value:function(e){var t=this.currentFlowStep,n=null==t?void 0:t.completion_step;if(t&&null!=n&&n.enabled&&n.condition===e){var i=this.completionContext;i&&i.stepId===t.id||(i=this.completionContext={stepId:t.id,resultSent:!1,pending:[]}),i.resultSent||(i.impressionId?(i.resultSent=!0,this.patchCompletion(i.impressionId,e)):i.pending.includes(e)||i.pending.push(e))}}},{key:"signalNonCompletion",value:function(e){var t=this.completionContext;t&&t.impressionId&&!t.resultSent&&(t.resultSent=!0,this.patchCompletion(t.impressionId,e))}},{key:"patchCompletion",value:function(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return this.flowLog(`patchCompletion(${t}) — impression=${e}, step=${null===(n=this.currentFlowStep)||void 0===n?void 0:n.id}`),r.p=1,r.n=2,a(Bu.instance.patchImpressionCompletion(e,t,(new Date).toISOString()));case 2:r.n=4;break;case 3:r.p=3,i=r.v,_i.error(`[NamiFlow] completion PATCH failed for '${t}'`,i);case 4:return r.a(2)}},null,this,[[1,3]],Promise)}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var i,a,r=Vu(n.screen);return r&&we().ui.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=sm.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}_i.warn("No previous screen step found to return to")}else _i.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 xm:case Lm:return this.stepcrumbs.push(t),void this.executeLifecycle(t,jm);case Im:return void this.handleBranchStep(t);case Cm:return void this.handleScreenStep(t);case Fm:return}else this.flowLog(`forward(${e}) — step not active (branch_tags=${JSON.stringify(t.branch_tags)}, branchcrumbs=${JSON.stringify(this.branchcrumbs)})`);else _i.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?_i.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}`),_i.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}`),_i.info(`Flow resumed from step ${e}`),this.forward(e)}else _i.warn("No step to resume from");else _i.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){t===Km?this.completionSignal("purchase_success"):t===Um&&this.completionSignal("login_success");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;_i.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"isFormSubmitLifecycle",value:function(e){var t=[Dm.SET_TAGS_FROM_FORM,Dm.NEXT,Dm.NAVIGATE];return e.some(e=>[e.before,e.action,e.after].some(e=>null==e?void 0:e.some(e=>t.includes(e.function))))}},{key:"captureBuySkuData",value:function(e,t){var n,i,a;e===Wm&&null!=t&&t.sku&&(this.purchasedSku="sku_ref_id"in(n=t.sku)?{skuRefId:n.sku_ref_id,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(a=n.product_details)&&void 0!==a?a:null}:{skuRefId:n.skuId,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(i=n.productDetails)&&void 0!==i?i:null})}},{key:"triggerActions",value:function(e,t,n){var i,a,r;this.captureBuySkuData(e,n);var o=this.lifecycles(e);if(o){this.flowLog(`triggerActions(${e}) — step=${null===(i=this.currentFlowStep)||void 0===i?void 0:i.id}, isPaused=${this.isPaused}`),this.currentButton=t;var s=null!==(a=null===(r=sm.currentProvider)||void 0===r?void 0:r.state.formFieldValidators)&&void 0!==a?a:{};if(this.isFormSubmitLifecycle(o)&&Object.keys(s).length){var u,l=function(e,t){for(var n={},i=0,a=Object.entries(e);i<a.length;i++){var r,o=a[i],s=o[0],u=o[1],l=Bf(u.type,u.required,t[s]);void 0!==l&&(n[s]=null!==(r=u.message)&&void 0!==r?r:l)}return n}(s,this.getFormData());if(null===(u=sm.currentProvider)||void 0===u||u.setFormFieldErrors(l),Object.keys(l).length)return void this.flowLog(`triggerActions(${e}) — HALTED by form validation: ${JSON.stringify(l)}`)}this.executeFullLifecycles(o,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){this.captureBuySkuData(e,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){this.captureBuySkuData(e,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=vf.shared.evaluate(e);if(Pm.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";_i.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;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case Dm.BACK:this.back();break;case Dm.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 Dm.NAVIGATE:var h;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===(h=this.previousFlowStep)||void 0===h?void 0:h.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Dm.FINISHED:this.finished();break;case Dm.DISMISS:this.dismiss();break;case Dm.EXIT:this.signalNonCompletion("skip_page");var m=this.steps.find(e=>e.type===Lm);m&&this.forward(m.id);break;case Dm.PAUSE:this.pause();break;case Dm.RESUME:this.resumeFromPause();break;case Dm.HANDOFF:var f,v,p,g,y,b,w=null===(f=e.parameters)||void 0===f?void 0:f.handoffTag;if(!w)break;if(null!==(v=e.parameters)&&void 0!==v&&v.handoffFormId&&this.completionSignal("form_submitted"),w.startsWith("__")){var k;w===Rm&&null!==(k=e.parameters)&&void 0!==k&&k.handoffFormId?this.flowHandoffFormSequence():(_i.warn(`Ignoring reserved handoff tag '${w}' — resuming flow`),this.manager.resume());break}if(!this.manager.hasHandoffHandler){_i.debug("No handoffStepHandler found",e);break}if(w===Om.UserData&&null!==(p=e.parameters)&&void 0!==p&&p.handoffFormId){this.manager.deliverHandoff(w,this.buildUserDataEnvelope(e.parameters.handoffFormId));break}null!==(g=e.parameters)&&void 0!==g&&g.handoffData?b=e.parameters.handoffData:t?b=t:null!==(y=e.parameters)&&void 0!==y&&y.handoffFormId&&(b=this.getFormData()),_i.debug(`Invoking handoff handler with ${w}${b?` ${JSON.stringify(b)}`:" and no data"}`),this.manager.deliverHandoff(w,b);break;case Dm.LOG:var S;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)_i.info(`logEvent → ${e.parameters.eventName}`);else _i.warn(`Missing 'eventName' in logEvent action ${null!==(S=e.id)&&void 0!==S?S:"unknown"}`);break;case Dm.TRACK:var E;if(null!==(l=e.parameters)&&void 0!==l&&l.eventName)_i.info(`trackEvent → ${e.parameters.eventName}`);else _i.warn(`Missing 'eventName' in logEvent action ${null!==(E=e.id)&&void 0!==E?E:"unknown"}`);break;case Dm.SET_VIDEO:null!==(d=e.parameters)&&void 0!==d&&d.name&&e.parameters.url?sm.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):_i.warn("Missing name, url for setting video details");break;case Dm.BLOCK_BACK:var P,T=null===(P=e.parameters)||void 0===P?void 0:P.step,_=T?this.getStep(T):void 0;_?_.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:_i.warn("Missing step for blocking back");break;case Dm.FLOW_EVENT:var M,A=new _f(this.manager),D=Object.fromEntries(Object.entries(null!==(M=e.parameters)&&void 0!==M?M:{}).map(([e,t])=>[e,A.interpolateDeep(t)]));this.manager.eventHandler?this.manager.eventHandler(D):_i.warn("Missing event handler",D);break;case Dm.FLOW_ENABLED:sm.setUserInteractionEnabled(!0);break;case Dm.FLOW_DISABLED:sm.setUserInteractionEnabled(!1);break;case Dm.SET_TAGS:e.parameters&&(sm.setUserTags(e.parameters),Object.entries(e.parameters).forEach(([e,t])=>{Of.setCustomerAttribute(e,t)}));break;case Dm.SET_TAGS_FROM_FORM:var x,C=null===(x=e.parameters)||void 0===x?void 0:x.include,I=Array.isArray(C)?new Set(C):void 0,L=this.getFormData(),F={};Object.entries(L).forEach(([e,t])=>{if(!I||I.has(e)){var n=Sf(t);void 0!==n&&(F[e]=n,Of.setCustomerAttribute(e,n))}}),Object.keys(F).length&&sm.setUserTags(F);break;case Dm.SET_LAUNCH_CONTEXT:var R=e.parameters;null!=R&&R.customAttributes?this.applyLaunchContextAttributes(R.customAttributes):void 0!==(null==R?void 0:R.key)&&void 0!==(null==R?void 0:R.value)&&this.applyLaunchContextAttributes({[R.key]:R.value});break;case Dm.SET_FLOW_PATH:var O,$=null===(O=e.parameters)||void 0===O?void 0:O.flowPath;"string"==typeof $&&(this.flowPath=$);break;default:_i.warn(`Missing action handler for ${e.function}`,e)}else this.flowLog(`performAction(${e.function}) — SKIPPED stale step ${n}, current=${null===(c=this.currentFlowStep)||void 0===c?void 0:c.id}`)};a?setTimeout(r.bind(this,this.currentFlowStep.id),a):r(this.currentFlowStep.id)}else _i.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}_i.debug(`No active next step found after ${e.id}`)}else _i.error(`Could not find next step for step ${e.id}`)}else _i.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Vu(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"})):_i.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 _i.warn(`No actions defined for branch tag ${a}`)}}_i.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return m({},null!==(e=null===(t=sm.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"buildUserDataEnvelope",value:function(e){var t,n;return{form_id:e,step_id:null!==(t=null===(n=this.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"",collected_at:(new Date).toISOString(),fields:this.getFormData()}}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t);if(0!==n.length){if(n.some(e=>zf.test(e))){var i=this.buildHandoffGroups(t);return 0===i.length?(_i.info("No handoff groups after grouping"),void this.manager.resume()):(this.activeHandoffSequence={groups:i},void this.resumeNextHandoff())}var a=n.sort().filter(e=>!0===t[e]);if(0===a.length)return _i.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:m({},t),remainingKeys:[...a]},this.resumeNextHandoff()}else _i.warn("formStates is empty, no handoffs to perform")}else _i.warn("No formStates available for handoff sequence")}},{key:"buildHandoffGroups",value:function(e){for(var t=new Map,n=0,i=Object.keys(e);n<i.length;n++){var a=i[n],r=a.match(zf);if(r){var o=r[1],s=r[2];o.startsWith("__")?_i.warn(`Ignoring reserved handoff group tag '${o}'`):(t.has(o)||t.set(o,{}),t.get(o)[s]=e[a])}}return Array.from(t,([e,t])=>({tag:e,data:t})).filter(e=>Object.values(e.data).some(e=>!0===e)).sort((e,t)=>e.tag.localeCompare(t.tag))}},{key:"resumeNextHandoff",value:function(){var e=this.activeHandoffSequence;if(!e)return _i.warn("No active handoff sequence to resume"),void this.manager.resume();if("groups"in e){if(0===e.groups.length)return _i.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var t=e.groups.shift();return function(e){return Object.values(Om).includes(e)}(t.tag)||_i.warn(`handoff group tag '${t.tag}' is outside the NamiHandoffTag vocabulary — passing through`),this.activeHandoffSequence=e,_i.debug(`Starting grouped handoff for '${t.tag}' → ${JSON.stringify(t.data)}`),void this.manager.deliverHandoff(t.tag,t.data)}if(0===e.remainingKeys.length)return _i.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var n=e.remainingKeys.shift(),i=e.formStates[n];_i.debug(`Starting handoff for ${n} → ${String(i)}`),this.activeHandoffSequence=e,this.manager.deliverHandoff(`${n}`,void 0)}}])}(Uf),Gf=function(){return c(function e(){o(this,e),this.emitter=Vd.getInstance()},[{key:"sdkInitialized",get:function(){return Pm.instance.isInitialized}},{key:"campaignTypeAndLabel",value:function(t,n){var i,a="";return t&&!n&&Pd(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 ho;return Md()}},{key:"isCampaignAvailable",value:function(e){if(!this.instance.sdkInitialized)throw new ho;var t=this.instance.campaignTypeAndLabel(e),n=t.type,i=t.value,a=Id(i,n),r=a.campaign,o=a.paywall;return null!=r&&r.flow?new Uf(r.flow.object).allScreensAvailable:Boolean(r&&o)}},{key:"isFlow",value:function(e,t){if(!this.instance.sdkInitialized)throw new ho;var n=this.instance.campaignTypeAndLabel(e,t),i=n.type,a=n.value;return zu(Id(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 ho;case 1:return iu(),e.n=2,a(gm.instance.fetchCampaignsAndPaywalls());case 2:return e.a(2,Md())}},null,this,null,Promise)}},{key:"registerAvailableCampaignsHandler",value:function(e){return this.instance.emitter.addListener(ui,e),()=>{this.instance.emitter.removeListener(ui,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 ho;var k,S=pm.firstLaunchLookup(w,()=>Id(w,b)),E=S.paywall,P=S.campaign,T=!P||!E&&!P.flow;T&&(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 _={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=so.getPurchaseChannel();M&&(_=m({},_,{purchaseChannel:M}));var A,D,x,C,I,L,F,R,O=null===(h=i)||void 0===h?void 0:h.productGroups,$=null===(f=E)||void 0===f||null===(f=f.sku_menus)||void 0===f?void 0:f.map(e=>e.ref);if((x=null===(A=so.getNamiConfig())||void 0===A?void 0:A.namiCommands,null!==(D=null==x?void 0:x.includes(fn))&&void 0!==D&&D&&null!=O&&O.length&&null!=$)&&0==(null==$?void 0:$.filter(e=>null==O?void 0:O.some(t=>t===e))).length)throw a(!1,e.LaunchCampaignError.PRODUCT_GROUPS_NOT_FOUND),new po;if(null!=P&&P.flow&&!Ku(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 go;T||Em.shared.record({placementLabel:null!==(C=null!==(I=null==P?void 0:P.value)&&void 0!==I?I:w)&&void 0!==C?C:"",tags:null!==(L=null==P?void 0:P.placement_tags)&&void 0!==L?L:[],customAttributes:null!==(F=null===(R=i)||void 0===R?void 0:R.customAttributes)&&void 0!==F?F:{}});var N=we().ui.createPaywall(b,w,i),W=Iu();return so.setLaunchId(W),r&&this.instance.emitter.addListener(di,t=>{var n=t.action,i=y(t,ge);r(m({},_,i,{action:null!=n?n:e.NamiPaywallAction.UNKNOWN}))}),setTimeout(()=>a(!0),0),N}},{key:"getProductGroups",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=Id(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=Id(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=Id(o,r),u=sm.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:[]}}])}();Gf.instance=new Gf;var Vf=Gf,Kf=Of,Yf=function(){return c(function e(){o(this,e),this.emitter=Vd.getInstance()},[{key:"sdkInitialized",get:function(){return Pm.instance.isInitialized}}],[{key:"active",value:function(){return au(),lm()}},{key:"isEntitlementActive",value:function(e){return!!au("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 ho;case 1:if(au("NamiEntitlementManager.refresh")){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,a(hm.instance.fetchActiveEntitlements());case 3:return e.a(2,lm())}},null,this,null,Promise)}},{key:"registerActiveEntitlementsHandler",value:function(e){if(au("NamiEntitlementManager.registerActiveEntitlementsHandler"))return this.instance.emitter.addListener(hi,e),()=>{this.instance.emitter.removeListener(hi,e)}}},{key:"clearProvisionalEntitlementGrants",value:function(){var e=lm();e=e.filter(e=>e.expires&&e.expires>(new Date).valueOf()),so.setNamiEntitlements(_t,e),this.instance.emitter.emit(hi)}}])}();Yf.instance=new Yf;var Xf,qf,Jf=Yf,Qf=Lf,Zf=If,ev=Pc,tv={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},nv={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},iv="wave",av="pulse",rv="none";function ov(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 sv(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}(ov(Ae),e)>=0||_i.warn(`Component ${t} requires SDK version ${e.semver} or higher, but current SDK version is ${Ae}`))}function uv(e){return!e||"object"==typeof e&&0==Object.keys(e).length}!function(e){e.DEFAULT="default",e.LABEL="label",e.URL="url"}(Xf||(Xf={})),function(e){e.DEEPLINK="deeplink",e.IN_APP="in_app"}(qf||(qf={}));var lv=Vf,dv=Kf,cv=Zf,hv=Jf,mv=Qf,fv=ev,vv=wm,pv=Object.freeze({__proto__:null,NamiCampaignManager:lv,NamiCustomerManager:dv,NamiEntitlementManager:hv,NamiFlowManager:mv,NamiPaywallManager:cv,NamiProfileManager:vv,NamiPurchaseManager:fv}),gv=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 yv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bv,wv={exports:{}};var kv=(bv||(bv=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}})}(wv)),wv.exports),Sv=yv(kv),Ev={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},Pv={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4},Tv=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=Sv.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=Ev[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=Sv.getParser(window.navigator.userAgent).getPlatform();return e.type&&Ev[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=Pv[r])&&void 0!==t?t:Math.min(i/1920,a/1080)||1}},{key:"getScreenInfo",value:function(){var e,t,n,i;return"undefined"==typeof window?{width:1920,height:1080,scale:1}:{width:null!==(e=null===(t=window.screen)||void 0===t?void 0:t.width)&&void 0!==e?e:window.innerWidth,height:null!==(n=null===(i=window.screen)||void 0===i?void 0:i.height)&&void 0!==n?n:window.innerHeight,scale:window.devicePixelRatio||1}}},{key:"getLanguage",value:function(){return"undefined"==typeof window?"en":window.navigator.language||"en"}},{key:"onAppForeground",value:function(e){if("undefined"==typeof document)return()=>{};var t=()=>{"visible"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},{key:"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 _v(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 Mv,Av,Dv,xv=globalThis,Cv=xv.ShadowRoot&&(void 0===xv.ShadyCSS||xv.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Iv=Symbol(),Lv=new WeakMap,Fv=function(){return c(function e(t,n,i){if(o(this,e),this._$cssResult$=!0,i!==Iv)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(Cv&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Lv.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Lv.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Rv=e=>new Fv("string"==typeof e?e:e+"",void 0,Iv),Ov=(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 Fv(n,e,Iv)},$v=Cv?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=h(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return Rv(n)})(e):e,Nv=Object.is,Wv=Object.defineProperty,jv=Object.getOwnPropertyDescriptor,Bv=Object.getOwnPropertyNames,zv=Object.getOwnPropertySymbols,Uv=Object.getPrototypeOf,Hv=globalThis,Gv=Hv.trustedTypes,Vv=Gv?Gv.emptyScript:"",Kv=Hv.reactiveElementPolyfillSupport,Yv=(e,t)=>e,Xv={toAttribute(e,t){switch(t){case Boolean:e=e?Vv: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}},qv=(e,t)=>!Nv(e,t),Jv={attribute:!0,type:String,converter:Xv,reflect:!1,useDefault:!1,hasChanged:qv};null!==(Mv=Symbol.metadata)&&void 0!==Mv||(Symbol.metadata=Symbol("metadata")),null!==(Av=Hv.litPropertyMetadata)&&void 0!==Av||(Hv.litPropertyMetadata=new WeakMap);var Qv,Zv=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(Cv)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=xv.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:Xv).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:Xv;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:qv)(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=Jv){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&&Wv(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=jv(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:Jv}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Yv("elementProperties"))){var e=Uv(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Yv("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Yv("properties")))for(var e=this.properties,t=0,n=[...Bv(e),...zv(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($v(a))}else void 0!==e&&t.push($v(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}(M(HTMLElement));Zv.elementStyles=[],Zv.shadowRootOptions={mode:"open"},Zv[Yv("elementProperties")]=new Map,Zv[Yv("finalized")]=new Map,null!=Kv&&Kv({ReactiveElement:Zv}),(null!==(Dv=Hv.reactiveElementVersions)&&void 0!==Dv?Dv:Hv.reactiveElementVersions=[]).push("2.1.2");var ep=globalThis,tp=e=>e,np=ep.trustedTypes,ip=np?np.createPolicy("lit-html",{createHTML:e=>e}):void 0,ap="$lit$",rp=`lit$${Math.random().toFixed(9).slice(2)}$`,op="?"+rp,sp=`<${op}>`,up=document,lp=()=>up.createComment(""),dp=e=>null===e||"object"!=typeof e&&"function"!=typeof e,cp=Array.isArray,hp="[ \t\n\f\r]",mp=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,fp=/-->/g,vp=/>/g,pp=RegExp(`>|${hp}(?:([^\\s"'>=/]+)(${hp}*=${hp}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),gp=/'/g,yp=/"/g,bp=/^(?:script|style|textarea|title)$/i,wp=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),kp=wp(1),Sp=wp(2),Ep=Symbol.for("lit-noChange"),Pp=Symbol.for("lit-nothing"),Tp=new WeakMap,_p=up.createTreeWalker(up,129);function Mp(e,t){if(!cp(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ip?ip.createHTML(t):t}var Ap=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=mp,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===mp?"!--"===d[1]?o=fp:void 0!==d[1]?o=vp:void 0!==d[2]?(bp.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=pp):void 0!==d[3]&&(o=pp):o===pp?">"===d[0]?(o=null!=n?n:mp,c=-1):void 0===d[1]?c=-2:(c=o.lastIndex-d[2].length,l=d[1],o=void 0===d[3]?pp:'"'===d[3]?yp:gp):o===yp||o===gp?o=pp:o===fp||o===vp?o=mp:(o=pp,n=void 0);var m=o===pp&&e[s+1].startsWith("/>")?" ":"";r+=o===mp?u+sp:c>=0?(a.push(l),u.slice(0,c)+ap+u.slice(c)+rp+m):u+rp+(-2===c?s:m)}return[Mp(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),_p.currentNode=this.el.content,2===n||3===n){var f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;null!==(a=_p.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(ap)){var y=m[s++],b=a.getAttribute(g).split(rp),w=/([.?@])?(.*)/.exec(y);l.push({type:1,index:r,name:w[2],strings:b,ctor:"."===w[1]?Lp:"?"===w[1]?Fp:"@"===w[1]?Rp:Ip}),a.removeAttribute(g)}else g.startsWith(rp)&&(l.push({type:6,index:r}),a.removeAttribute(g))}if(bp.test(a.tagName)){var k=a.textContent.split(rp),S=k.length-1;if(S>0){a.textContent=np?np.emptyScript:"";for(var E=0;E<S;E++)a.append(k[E],lp()),_p.nextNode(),l.push({type:2,index:++r});a.append(k[S],lp())}}}else if(8===a.nodeType)if(a.data===op)l.push({type:2,index:r});else for(var P=-1;-1!==(P=a.data.indexOf(rp,P+1));)l.push({type:7,index:r}),P+=rp.length-1;r++}},null,[{key:"createElement",value:function(e,t){var n=up.createElement("template");return n.innerHTML=e,n}}])}();function Dp(e,t,n=e,i){var a,r,o,s,u;if(t===Ep)return t;var l=void 0!==i?null===(a=n._$Co)||void 0===a?void 0:a[i]:n._$Cl,d=dp(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=Dp(e,l._$AS(e,t.values),l,i)),t}var xp=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:up).importNode(i,!0);_p.currentNode=r;for(var o=_p.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 Cp(o,o.nextSibling,this,e):1===l.type?c=new l.ctor(o,l.name,l.strings,this,e):6===l.type&&(c=new Op(o,this,e)),this._$AV.push(c),l=a[++u]}s!==(null===(d=l)||void 0===d?void 0:d.index)&&(o=_p.nextNode(),s++)}return _p.currentNode=up,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++}}}])}(),Cp=function(){return c(function e(t,n,i,a){var r;o(this,e),this.type=2,this._$AH=Pp,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=Dp(this,e,t),dp(e)?e===Pp||null==e||""===e?(this._$AH!==Pp&&this._$AR(),this._$AH=Pp):e!==this._$AH&&e!==Ep&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>cp(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!==Pp&&dp(this._$AH)?this._$AA.nextSibling.data=e:this.T(up.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=Ap.createElement(Mp(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 xp(a,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}},{key:"_$AC",value:function(e){var t=Tp.get(e.strings);return void 0===t&&Tp.set(e.strings,t=new Ap(e)),t}},{key:"k",value:function(e){cp(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(lp()),this.O(lp()),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=tp(e).nextSibling;tp(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))}}])}(),Ip=function(){return c(function e(t,n,i,a,r){o(this,e),this.type=1,this._$AH=Pp,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=Pp},[{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=Dp(this,e,t,0),(r=!dp(e)||e!==this._$AH&&e!==Ep)&&(this._$AH=e);else{var o,s,u=e;for(e=a[0],o=0;o<a.length-1;o++)(s=Dp(this,u[n+o],t,o))===Ep&&(s=this._$AH[o]),r||(r=!dp(s)||s!==this._$AH[o]),s===Pp?e=Pp:e!==Pp&&(e+=(null!=s?s:"")+a[o+1]),this._$AH[o]=s}r&&!i&&this.j(e)}},{key:"j",value:function(e){e===Pp?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}])}(),Lp=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===Pp?void 0:e}}])}(Ip),Fp=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!==Pp)}}])}(Ip),Rp=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=Dp(this,e,t,0))&&void 0!==n?n:Pp)!==Ep){var i=this._$AH,a=e===Pp&&i!==Pp||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==Pp&&(i===Pp||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)}}])}(Ip),Op=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){Dp(this,e)}}])}(),$p={I:Cp},Np=ep.litHtmlPolyfillSupport;null!=Np&&Np(Ap,Cp),(null!==(Qv=ep.litHtmlVersions)&&void 0!==Qv?Qv:ep.litHtmlVersions=[]).push("3.3.3");var Wp,jp,Bp=globalThis,zp=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)([]);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)([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 Cp(t.insertBefore(lp(),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)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;T(t,"disconnectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Ep}}])}(Zv);zp._$litElement$=!0,zp.finalized=!0,null===(Wp=Bp.litElementHydrateSupport)||void 0===Wp||Wp.call(Bp,{LitElement:zp});var Up=Bp.litElementPolyfillSupport;null==Up||Up({LitElement:zp}),(null!==(jp=Bp.litElementVersions)&&void 0!==jp?jp:Bp.litElementVersions=[]).push("4.2.2");var Hp,Gp,Vp=Ov(Hp||(Hp=(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,_(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"function"==typeof a?function(e){return a.apply(n,e)}:a}function _(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function M(e){var t="function"==typeof Map?new Map:void 0;return M=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(g())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var a=new(e.bind.apply(e,i));return n&&P(a,n.prototype),a}(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),P(n,e)},M(e)}var A,D,x,C,I,L,F,R,O,$,N,W,j=function(){return c(function e(t){o(this,e),this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t},[{key:"shadowRoot",get:function(){return this.__host.__shadowRoot}},{key:"checkValidity",value:function(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}},{key:"reportValidity",value:function(){return!0}},{key:"setFormValue",value:function(){}},{key:"setValidity",value:function(){}}])}(),B=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},z=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},U={__proto__:null,enumerable:!0};Object.freeze(U);var H=($=function(){return c(function e(t,n={}){if(o(this,e),A.set(this,!1),D.set(this,!1),x.set(this,!1),C.set(this,!1),I.set(this,Date.now()),L.set(this,!1),F.set(this,void 0),R.set(this,void 0),O.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,0===arguments.length)throw new Error("The type argument must be specified");if("object"!=typeof n||!n)throw new Error('The "options" argument must be an object');var i=n.bubbles,a=n.cancelable,r=n.composed;B(this,A,!!a,"f"),B(this,D,!!i,"f"),B(this,x,!!r,"f"),B(this,F,`${t}`,"f"),B(this,R,null,"f"),B(this,O,!1,"f")},[{key:"initEvent",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"stopImmediatePropagation",value:function(){this.stopPropagation()}},{key:"preventDefault",value:function(){B(this,C,!0,"f")}},{key:"target",get:function(){return z(this,R,"f")}},{key:"currentTarget",get:function(){return z(this,R,"f")}},{key:"srcElement",get:function(){return z(this,R,"f")}},{key:"type",get:function(){return z(this,F,"f")}},{key:"cancelable",get:function(){return z(this,A,"f")}},{key:"defaultPrevented",get:function(){return z(this,A,"f")&&z(this,C,"f")}},{key:"timeStamp",get:function(){return z(this,I,"f")}},{key:"composedPath",value:function(){return z(this,O,"f")?[z(this,R,"f")]:[]}},{key:"returnValue",get:function(){return!z(this,A,"f")||!z(this,C,"f")}},{key:"bubbles",get:function(){return z(this,D,"f")}},{key:"composed",get:function(){return z(this,x,"f")}},{key:"eventPhase",get:function(){return z(this,O,"f")?$.AT_TARGET:$.NONE}},{key:"cancelBubble",get:function(){return z(this,L,"f")},set:function(e){e&&B(this,L,!0,"f")}},{key:"stopPropagation",value:function(){B(this,L,!0,"f")}},{key:"isTrusted",get:function(){return!1}}])}(),A=new WeakMap,D=new WeakMap,x=new WeakMap,C=new WeakMap,I=new WeakMap,L=new WeakMap,F=new WeakMap,R=new WeakMap,O=new WeakMap,$.NONE=0,$.CAPTURING_PHASE=1,$.AT_TARGET=2,$.BUBBLING_PHASE=3,$);Object.defineProperties(H.prototype,{initEvent:U,stopImmediatePropagation:U,preventDefault:U,target:U,currentTarget:U,srcElement:U,type:U,cancelable:U,defaultPrevented:U,timeStamp:U,composedPath:U,returnValue:U,bubbles:U,composed:U,eventPhase:U,cancelBubble:U,stopPropagation:U,isTrusted:U});var G=(W=function(e){function t(e,n={}){var i,a;return o(this,t),a=r(this,t,[e,n]),N.set(a,void 0),B(a,N,null!==(i=null==n?void 0:n.detail)&&void 0!==i?i:null,"f"),a}return p(t,e),c(t,[{key:"initCustomEvent",value:function(e,t,n,i){throw new Error("Method not implemented.")}},{key:"detail",get:function(){return z(this,N,"f")}}])}(H),N=new WeakMap,W);Object.defineProperties(G.prototype,{detail:U});var V,K,Y,X,q=H,J=G;(V=function(){return c(function e(){o(this,e),this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""},[{key:"parentRule",get:function(){return null}},{key:"parentStyleSheet",get:function(){return this.__parentStyleSheet}},{key:"type",get:function(){return 0}}])}()).STYLE_RULE=1,V.CHARSET_RULE=2,V.IMPORT_RULE=3,V.MEDIA_RULE=4,V.FONT_FACE_RULE=5,V.PAGE_RULE=6,V.NAMESPACE_RULE=10,V.KEYFRAMES_RULE=7,V.KEYFRAME_RULE=8,V.SUPPORTS_RULE=12,V.COUNTER_STYLE_RULE=11,V.FONT_FEATURE_VALUES_RULE=14,V.MARGIN_RULE=9,null!==(K=globalThis.Event)&&void 0!==K||(globalThis.Event=q),null!==(Y=globalThis.CustomEvent)&&void 0!==Y||(globalThis.CustomEvent=J);var Q=Symbol(),Z=e=>{var t;return"boolean"==typeof e?e:null!==(t=null==e?void 0:e.capture)&&void 0!==t&&t},ee={__proto__:null,enumerable:!0};Object.freeze(ee);var te=function(){return c(function e(){o(this,e),this.__eventListeners=new Map,this.__captureEventListeners=new Map},[{key:"addEventListener",value:function(e,t,n){var i;if(null!=t){var a=Z(n)?this.__captureEventListeners:this.__eventListeners,r=a.get(e);if(void 0===r)r=new Map,a.set(e,r);else if(r.has(t))return;var o="object"==typeof n&&n?n:{};null===(i=o.signal)||void 0===i||i.addEventListener("abort",()=>this.removeEventListener(e,t,n)),r.set(t,null!=o?o:{})}}},{key:"removeEventListener",value:function(e,t,n){if(null!=t){var i=Z(n)?this.__captureEventListeners:this.__eventListeners,a=i.get(e);void 0!==a&&(a.delete(t),a.size||i.delete(e))}}},{key:"dispatchEvent",value:function(e){var t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));var n=!1,i=!1,a=q.NONE,r=null,o=null,s=null,u=e.stopPropagation,l=e.stopImmediatePropagation;Object.defineProperties(e,{target:m({get:()=>null!=r?r:o},ee),srcElement:m({get:()=>e.target},ee),currentTarget:m({get:()=>s},ee),eventPhase:m({get:()=>a},ee),composedPath:m({value:()=>t},ee),stopPropagation:m({value:()=>{n=!0,u.call(e)}},ee),stopImmediatePropagation:m({value:()=>{i=!0,l.call(e)}},ee)});var d=(t,n,i)=>{"function"==typeof t?t(e):"function"==typeof(null==t?void 0:t.handleEvent)&&t.handleEvent(e),n.once&&i.delete(t)},c=()=>(s=null,a=q.NONE,!e.defaultPrevented),f=t.slice().reverse();r=this.__host&&e.composed?null:this;for(var v,p=e=>{for(o=this;o.__host&&e.includes(o.__host);)o=o.__host},g=h(f);!(v=g()).done;){var y=v.value;r||o&&o!==y.__host||p(f.slice(f.indexOf(y))),s=y,a=y===e.target?q.AT_TARGET:q.CAPTURING_PHASE;var b=y.__captureEventListeners.get(e.type);if(b)for(var w,k=h(b);!(w=k()).done;){var S=w.value;if(d(S[0],S[1],b),i)return c()}if(n)return c()}var E=e.bubbles?t:[this];o=null;for(var P,T=h(E);!(P=T()).done;){var _=P.value;r||o&&_!==o.__host||p(E.slice(0,E.indexOf(_)+1)),s=_,a=_===e.target?q.AT_TARGET:q.BUBBLING_PHASE;var M=_.__eventListeners.get(e.type);if(M)for(var A,D=h(M);!(A=D()).done;){var x=A.value;if(d(x[0],x[1],M),i)return c()}if(n)return c()}return c()}},{key:"__resolveFullEventPath",value:function(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,oe,pe]}}])}(),ne=new WeakMap,ie=e=>{var t=ne.get(e);return void 0===t&&ne.set(e,t=new Map),t},ae=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"getRootNode",value:function(e){var t;if(null!=e&&e.composed)return se;var n=this.__host;return null!==(t=null==n?void 0:n.__shadowRoot)&&void 0!==t?t:se}}])}(te),re=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t,[{key:"adoptedStyleSheets",get:function(){return[]}},{key:"createTreeWalker",value:function(){return{}}},{key:"createTextNode",value:function(){return{}}},{key:"createElement",value:function(){return{}}}])}(ae),oe=new re,se=oe,ue=function(e){function t(e){var n;if(o(this,t),n=r(this,t),e!==Q)throw new TypeError("Illegal constructor");return Object.assign(n,globalThis,{CustomElementRegistry:fe,customElements:ve,document:se,Document:re,Element:le,EventTarget:te,HTMLElement:de,Node:ae,ShadowRoot:he,window:n,Window:ue}),n}return p(t,e),c(t)}(ae),le=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).__shadowRootMode=null,e.__shadowRoot=null,e.__internals=null,e}return p(t,e),c(t,[{key:"attributes",get:function(){return Array.from(ie(this)).map(([e,t])=>({name:e,value:t}))}},{key:"shadowRoot",get:function(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}},{key:"localName",get:function(){return this.constructor.__localName}},{key:"tagName",get:function(){var e;return null===(e=this.localName)||void 0===e?void 0:e.toUpperCase()}},{key:"setAttribute",value:function(e,t){ie(this).set(e,String(t))}},{key:"removeAttribute",value:function(e){ie(this).delete(e)}},{key:"toggleAttribute",value:function(e,t){return this.hasAttribute(e)?!(void 0===t||!t)||(this.removeAttribute(e),!1):!(void 0!==t&&!t)&&(this.setAttribute(e,""),!0)}},{key:"hasAttribute",value:function(e){return ie(this).has(e)}},{key:"attachShadow",value:function(e){this.__shadowRootMode=e.mode;var t=new he(Q,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}},{key:"attachInternals",value:function(){if(null!==this.__internals)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");var e=new j(this);return this.__internals=e,e}},{key:"getAttribute",value:function(e){var t=ie(this).get(e);return null!=t?t:null}}])}(ae),de=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(le),ce=de,he=function(e){function t(e,n){var i;if(o(this,t),i=r(this,t),e!=e)throw new TypeError("Illegal constructor");return i.mode=n.mode,i}return p(t,e),c(t,[{key:"host",get:function(){return this.__host}}])}(ae);function me(){var e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}null!==(X=globalThis.litServerRoot)&&void 0!==X||(globalThis.litServerRoot=Object.defineProperty(new ce,"localName",{get:()=>"lit-server-root"}));var fe=function(){return c(function e(){o(this,e),this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map},[{key:"define",value:function(e,t){var n,i;if(this.__definitions.has(e)){if("development"!==process.env.NODE_ENV)throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.`)}if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:null!==(n=t.observedAttributes)&&void 0!==n?n:[]}),this.__reverseDefinitions.set(t,e),null===(i=this.__pendingWhenDefineds.get(e))||void 0===i||i.resolve(t),this.__pendingWhenDefineds.delete(e)}},{key:"get",value:function(e){var t=this.__definitions.get(e);return null==t?void 0:t.ctor}},{key:"getName",value:function(e){var t;return null!==(t=this.__reverseDefinitions.get(e))&&void 0!==t?t:null}},{key:"initialize",value:function(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}},{key:"upgrade",value:function(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}},{key:"whenDefined",value:function(e){var t,n;return k(function(i){for(;;)switch(i.n){case 0:if(!(t=this.__definitions.get(e))){i.n=1;break}return i.a(2,t.ctor);case 1:return(n=this.__pendingWhenDefineds.get(e))||(n=me(),this.__pendingWhenDefineds.set(e,n)),i.a(2,n.promise)}},null,this,null,Promise)}}])}(),ve=new fe,pe=new ue(Q);"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=ce);var ge=["action"],ye=null;var be={storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},getAllKeys:()=>[]},device:{getDeviceData:()=>({os_version:"",os_name:"",browser_name:"",browser_version:"",sdk_client:"",sdk_version:"",language:"en"}),getDeviceFormFactor:()=>"desktop",getDeviceScaleFactor:()=>1,generateUUID:()=>{throw new Error("No platform adapter registered — call registerPlatformAdapters() before Nami.configure()")},getScreenInfo:()=>({width:0,height:0,scale:1}),getLanguage:()=>"en"},ui:{createPaywall:()=>null,reRenderPaywall:()=>{},flowNavigateToScreen:()=>{}}};function we(){return null!=ye?ye:be}function ke(e,t,n,i){var a,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function Se(e,t,n,i){if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function Ee(e,t,n,i,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;var Pe;!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,_e={},Me=_e.NAMI_SDK_VERSION,Ae=void 0===Me?"3.4.12":Me,De=_e.NAMI_SDK_PACKAGE_VERSION,xe=void 0===De?"3.4.12-dev.202610060208":De,Ce=_e.PLATFORM_ID_REQUIRED,Ie=void 0===Ce?"Platform ID is required":Ce,Le=_e.DEVICE_ID_REQUIRED,Fe=void 0===Le?"Device ID is required":Le,Re=_e.EXTERNAL_ID_REQUIRED,Oe=void 0===Re?"External ID is required":Re,$e=_e.SDK_NOT_INITIALIZED,Ne=void 0===$e?"SDK has not been initialized. Make sure to call Nami.configure() first!":$e,We=_e.CAMPAIGN_NOT_AVAILABLE,je=void 0===We?"Campaign is not available":We,Be=_e.FLOW_SCREENS_NOT_AVAILABLE,ze=void 0===Be?"Flow screens not available":Be,Ue=_e.UNABLE_TO_UPDATE_CDP_ID,He=void 0===Ue?"Unable to update CDP id in anonymous mode":Ue,Ge=_e.ANONYMOUS_MODE_ALREADY_ON,Ve=void 0===Ge?"Anonymous mode is already turned on.":Ge,Ke=_e.ANONYMOUS_MODE_ALREADY_OFF,Ye=void 0===Ke?"Anonymous mode is already turned off.":Ke,Xe=_e.DEVICE_ID_NOT_SET,qe=void 0===Xe?"Nami Device ID is not set":Xe,Je=_e.AUTH_DEVICE,Qe=void 0===Je?"nami_auth_device":Je,Ze=_e.NAMI_CONFIGURATION,et=void 0===Ze?"nami_configuration":Ze,tt=_e.NAMI_PROFILE,nt=void 0===tt?"nami_profile":tt,it=_e.API_CONFIG,at=void 0===it?"api_config":it,rt=_e.API_CAMPAIGN_RULES,ot=void 0===rt?"api_campaign_rules":rt,st=_e.API_PAYWALLS,ut=void 0===st?"api_paywalls":st,lt=_e.API_CAMPAIGN_SESSION_TIMESTAMP,dt=void 0===lt?"api_campaign_session_timestamp":lt,ct=_e.API_PRODUCTS,ht=void 0===ct?"api_products":ct,mt=_e.API_ACTIVE_ENTITLEMENTS,ft=void 0===mt?"api_active_entitlements":mt,vt=_e.SERVER_NAMI_ENTITLEMENTS,pt=void 0===vt?"server_active_entitlements":vt,gt=_e.INITIAL_APP_CONFIG,yt=void 0===gt?"initial_app_config":gt,bt=_e.INITIAL_CAMPAIGN_RULES,wt=void 0===bt?"initial_campaign_rules":bt,kt=_e.INITIAL_PAYWALLS,St=void 0===kt?"initial_paywalls":kt,Et=_e.INITIAL_PRODUCTS,Pt=void 0===Et?"initial_products":Et,Tt=_e.LOCAL_NAMI_ENTITLEMENTS,_t=void 0===Tt?"local_active_entitlements":Tt,Mt=_e.CUSTOMER_ATTRIBUTES_KEY_PREFIX,At=void 0===Mt?"nami_cmr_attributes_":Mt,Dt=_e.NAMI_CUSTOMER_JOURNEY_STATE,xt=void 0===Dt?"nami_customer_journey_state":Dt,Ct=_e.ANONYMOUS_MODE,It=void 0===Ct?"nami_anonymous_mode_v2":Ct,Lt=_e.ANONYMOUS_UUID,Ft=void 0===Lt?"nami_anonymous_uuid":Lt,Rt=_e.KEY_SESSION_COUNTER,Ot=void 0===Rt?"nami_session_counter":Rt,$t=_e.INITIAL_SESSION_COUNTER_VALUE,Nt=void 0===$t?1:$t,Wt=_e.NAMI_LAST_IMPRESSION_ID,jt=void 0===Wt?"nami_last_impression_id":Wt,Bt=_e.NAMI_PURCHASE_IMPRESSION_ID,zt=void 0===Bt?"nami_purchase_impression_id":Bt,Ut=_e.NAMI_LAUNCH_ID,Ht=void 0===Ut?"nami_launch_id":Ut,Gt=_e.NAMI_SESSION_ID,Vt=void 0===Gt?"nami_session_id":Gt,Kt=_e.NAMI_LANGUAGE_CODE,Yt=void 0===Kt?"nami_language_code":Kt,Xt=_e.NAMI_PURCHASE_CHANNEL,qt=void 0===Xt?"nami_purchase_channel":Xt,Jt=_e.API_VERSION,Qt=_e.BASE_URL_PATH,Zt=void 0===Qt?`sdk/${void 0===Jt?"v3":Jt}/platform`:Qt,en=_e.BASE_URL,tn=void 0===en?"https://app.namiml.com":en,nn=_e.BASE_STAGING_URL,an=void 0===nn?"https://app-staging.namiml.com":nn,rn=_e.CUSTOM_HOST_PREFIX,on=void 0===rn?"namiAPIHost=":rn,sn=_e.USE_STAGING_API,un=void 0===sn?"useStagingAPI":sn,ln=_e.EXTENDED_CLIENT_INFO_PREFIX,dn=void 0===ln?"extendedClientInfo":ln,cn=_e.EXTENDED_CLIENT_INFO_DELIMITER,hn=void 0===cn?":":cn,mn=_e.VALIDATE_PRODUCT_GROUPS,fn=void 0===mn?"validateProductGroups":mn,vn=_e.LOG_HTTP_REQUESTS,pn=void 0===vn?"logHTTPRequests":vn,gn=_e.LOG_HTTP_TRAFFIC,yn=void 0===gn?"logHTTPTraffic":gn,bn=_e.API_TRAFFIC_OBSERVER,wn=void 0===bn?"apiTrafficObserver":bn,kn=_e.STARTUP_TELEMETRY,Sn=void 0===kn?"startupTelemetry":kn,En=_e.SIMULATE_CONFIG_FETCH_FAILURE,Pn=void 0===En?"simulateConfigFetchFailure":En,Tn=_e.SIMULATE_PAYWALL_FETCH_FAILURE,_n=void 0===Tn?"simulatePaywallFetchFailure":Tn,Mn=_e.CAMPAIGN_CACHE_TTL_PREFIX,An=void 0===Mn?"campaignCacheTTL=":Mn,Dn=_e.TIME_OVERRIDE_PREFIX,xn=void 0===Dn?"timeOverride=":Dn,Cn=_e.SYSTEM_TIME_TOKEN_PREFIX,In=void 0===Cn?"${system.time.":Cn,Ln=_e.API_MAX_CALLS_LIMIT,Fn=void 0===Ln?2:Ln,Rn=_e.API_RETRY_DELAY_SEC,On=void 0===Rn?2:Rn,$n=_e.API_TIMEOUT_LIMIT,Nn=void 0===$n?2e4:$n,Wn=_e.DEVICE_API_TIMEOUT_LIMIT,jn=void 0===Wn?2e3:Wn,Bn=_e.CONFIG_MAX_ATTEMPTS,zn=void 0===Bn?3:Bn,Un=_e.CONFIG_API_TIMEOUT_LIMIT,Hn=void 0===Un?1e4:Un,Gn=_e.RESUME_THROTTLE_MS,Vn=void 0===Gn?3e4:Gn,Kn=_e.STATUS_BAD_REQUEST,Yn=void 0===Kn?400:Kn,Xn=_e.STATUS_NOT_FOUND,qn=void 0===Xn?404:Xn,Jn=_e.STATUS_CONFLICT,Qn=void 0===Jn?409:Jn,Zn=_e.STATUS_INTERNAL_SERVER_ERROR,ei=void 0===Zn?500:Zn,ti=_e.INITIAL_SUCCESS,ni=void 0===ti?"Initial success":ti,ii=_e.RECONFIG_SUCCESS,ai=void 0===ii?"Reconfig success":ii,ri=_e.ALREADY_CONFIGURED,oi=void 0===ri?"Already configured":ri,si=_e.AVAILABLE_CAMPAIGNS_CHANGED,ui=void 0===si?"AvailableCampaignsChanged":si,li=_e.PAYWALL_ACTION_EVENT,di=void 0===li?"PaywallActionEvent":li,ci=_e.AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED,hi=void 0===ci?"AvailableActiveEntitlementsChanged":ci,mi=_e.CUSTOMER_JOURNEY_STATE_CHANGED,fi=void 0===mi?"CustomerJourneyStateChanged":mi,vi=_e.SKU_TEXT_REGEX,pi=void 0===vi?/\$\{sku\.(\w+)(:\d+)?\}/g:vi,gi=_e.VAR_REGEX,yi=void 0===gi?/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g:gi,bi=_e.SMART_TEXT_PATTERN,wi=void 0===bi?"${":bi,ki=_e.LIQUID_VARIABLE_REGEX,Si=void 0===ki?/\${[A-Za-z0-9.]+}/g:ki,Ei=[Qe,et,nt,at,ot,ut,dt,ht,ft,pt,yt,wt,St,Pt,_t,xt,It,Ft,Ot,jt,zt,Ht,Vt,Yt,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 Pi={debug:e.LogLevel.DEBUG,info:e.LogLevel.INFO,warn:e.LogLevel.WARN,error:e.LogLevel.ERROR},Ti=function(){return c(function t(){o(this,t),this.currentLogLevel=e.LogLevel.DEBUG,this.setLogger=t=>{this.currentLogLevel=t?Pi[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)}`}}])}(),_i=new Ti;function Mi(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 Ai(e,t){return e===t||e!=e&&t!=t}function Di(e,t){for(var n=e.length;n--;)if(Ai(e[n][0],t))return n;return-1}var xi=Array.prototype.splice;function Ci(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])}}Ci.prototype.clear=function(){this.__data__=[],this.size=0},Ci.prototype.delete=function(e){var t=this.__data__,n=Di(t,e);return!(n<0)&&(n==t.length-1?t.pop():xi.call(t,n,1),--this.size,!0)},Ci.prototype.get=function(e){var t=this.__data__,n=Di(t,e);return n<0?void 0:t[n][1]},Ci.prototype.has=function(e){return Di(this.__data__,e)>-1},Ci.prototype.set=function(e,t){var n=this.__data__,i=Di(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Ii="object"==typeof global&&global&&global.Object===Object&&global,Li="object"==typeof self&&self&&self.Object===Object&&self,Fi=Ii||Li||Function("return this")(),Ri=Fi.Symbol,Oi=Object.prototype,$i=Oi.hasOwnProperty,Ni=Oi.toString,Wi=Ri?Ri.toStringTag:void 0;var ji=Object.prototype.toString;var Bi=Ri?Ri.toStringTag:void 0;function zi(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Bi&&Bi in Object(e)?function(e){var t=$i.call(e,Wi),n=e[Wi];try{e[Wi]=void 0;var i=!0}catch(e){}var a=Ni.call(e);return i&&(t?e[Wi]=n:delete e[Wi]),a}(e):function(e){return ji.call(e)}(e)}function Ui(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Hi(e){if(!Ui(e))return!1;var t=zi(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Gi,Vi=Fi["__core-js_shared__"],Ki=(Gi=/[^.]+$/.exec(Vi&&Vi.keys&&Vi.keys.IE_PROTO||""))?"Symbol(src)_1."+Gi:"";var Yi=Function.prototype.toString;function Xi(e){if(null!=e){try{return Yi.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var qi=/^\[object .+?Constructor\]$/,Ji=Function.prototype,Qi=Object.prototype,Zi=Ji.toString,ea=Qi.hasOwnProperty,ta=RegExp("^"+Zi.call(ea).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function na(e){return!(!Ui(e)||(t=e,Ki&&Ki in t))&&(Hi(e)?ta:qi).test(Xi(e));var t}function ia(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return na(n)?n:void 0}var aa=ia(Fi,"Map"),ra=ia(Object,"create");var oa=Object.prototype.hasOwnProperty;var sa=Object.prototype.hasOwnProperty;function ua(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 la(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 da(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])}}ua.prototype.clear=function(){this.__data__=ra?ra(null):{},this.size=0},ua.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ua.prototype.get=function(e){var t=this.__data__;if(ra){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return oa.call(t,e)?t[e]:void 0},ua.prototype.has=function(e){var t=this.__data__;return ra?void 0!==t[e]:sa.call(t,e)},ua.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ra&&void 0===t?"__lodash_hash_undefined__":t,this},da.prototype.clear=function(){this.size=0,this.__data__={hash:new ua,map:new(aa||Ci),string:new ua}},da.prototype.delete=function(e){var t=la(this,e).delete(e);return this.size-=t?1:0,t},da.prototype.get=function(e){return la(this,e).get(e)},da.prototype.has=function(e){return la(this,e).has(e)},da.prototype.set=function(e,t){var n=la(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function ca(e){var t=this.__data__=new Ci(e);this.size=t.size}ca.prototype.clear=function(){this.__data__=new Ci,this.size=0},ca.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ca.prototype.get=function(e){return this.__data__.get(e)},ca.prototype.has=function(e){return this.__data__.has(e)},ca.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ci){var i=n.__data__;if(!aa||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new da(i)}return n.set(e,t),this.size=n.size,this};function ha(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new da;++t<n;)this.add(e[t])}function ma(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 fa(e,t){return e.has(t)}ha.prototype.add=ha.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ha.prototype.has=function(e){return this.__data__.has(e)};function va(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 ha: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(!ma(t,function(e,t){if(!fa(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 pa=Fi.Uint8Array;function ga(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function ya(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var ba=Ri?Ri.prototype:void 0,wa=ba?ba.valueOf:void 0;var ka=Array.isArray;var Sa=Object.prototype.propertyIsEnumerable,Ea=Object.getOwnPropertySymbols,Pa=Ea?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}(Ea(e),function(t){return Sa.call(e,t)}))}:function(){return[]};function Ta(e){return null!=e&&"object"==typeof e}function _a(e){return Ta(e)&&"[object Arguments]"==zi(e)}var Ma=Object.prototype,Aa=Ma.hasOwnProperty,Da=Ma.propertyIsEnumerable,xa=_a(function(){return arguments}())?_a:function(e){return Ta(e)&&Aa.call(e,"callee")&&!Da.call(e,"callee")};var Ca="object"==typeof e&&e&&!e.nodeType&&e,Ia=Ca&&"object"==typeof module&&module&&!module.nodeType&&module,La=Ia&&Ia.exports===Ca?Fi.Buffer:void 0,Fa=(La?La.isBuffer:void 0)||function(){return!1},Ra=/^(?:0|[1-9]\d*)$/;function Oa(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&Ra.test(e))&&e>-1&&e%1==0&&e<t}function $a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Na={};function Wa(e){return function(t){return e(t)}}Na["[object Float32Array]"]=Na["[object Float64Array]"]=Na["[object Int8Array]"]=Na["[object Int16Array]"]=Na["[object Int32Array]"]=Na["[object Uint8Array]"]=Na["[object Uint8ClampedArray]"]=Na["[object Uint16Array]"]=Na["[object Uint32Array]"]=!0,Na["[object Arguments]"]=Na["[object Array]"]=Na["[object ArrayBuffer]"]=Na["[object Boolean]"]=Na["[object DataView]"]=Na["[object Date]"]=Na["[object Error]"]=Na["[object Function]"]=Na["[object Map]"]=Na["[object Number]"]=Na["[object Object]"]=Na["[object RegExp]"]=Na["[object Set]"]=Na["[object String]"]=Na["[object WeakMap]"]=!1;var ja="object"==typeof e&&e&&!e.nodeType&&e,Ba=ja&&"object"==typeof module&&module&&!module.nodeType&&module,za=Ba&&Ba.exports===ja&&Ii.process,Ua=function(){try{var e=Ba&&Ba.require&&Ba.require("util").types;return e||za&&za.binding&&za.binding("util")}catch(e){}}(),Ha=Ua&&Ua.isTypedArray,Ga=Ha?Wa(Ha):function(e){return Ta(e)&&$a(e.length)&&!!Na[zi(e)]},Va=Object.prototype.hasOwnProperty;function Ka(e,t){var n=ka(e),i=!n&&xa(e),a=!n&&!i&&Fa(e),r=!n&&!i&&!a&&Ga(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)!Va.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Oa(l,u))||s.push(l);return s}var Ya=Object.prototype;function Xa(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ya)}function qa(e,t){return function(n){return e(t(n))}}var Ja=qa(Object.keys,Object),Qa=Object.prototype.hasOwnProperty;function Za(e){return null!=(t=e)&&$a(t.length)&&!Hi(t)?Ka(e):function(e){if(!Xa(e))return Ja(e);var t=[];for(var n in Object(e))Qa.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e);var t}function er(e){return function(e,t,n){var i=t(e);return ka(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,Za,Pa)}var tr=Object.prototype.hasOwnProperty;var nr=ia(Fi,"DataView"),ir=ia(Fi,"Promise"),ar=ia(Fi,"Set"),rr=ia(Fi,"WeakMap"),or="[object Map]",sr="[object Promise]",ur="[object Set]",lr="[object WeakMap]",dr="[object DataView]",cr=Xi(nr),hr=Xi(aa),mr=Xi(ir),fr=Xi(ar),vr=Xi(rr),pr=zi;(nr&&pr(new nr(new ArrayBuffer(1)))!=dr||aa&&pr(new aa)!=or||ir&&pr(ir.resolve())!=sr||ar&&pr(new ar)!=ur||rr&&pr(new rr)!=lr)&&(pr=function(e){var t=zi(e),n="[object Object]"==t?e.constructor:void 0,i=n?Xi(n):"";if(i)switch(i){case cr:return dr;case hr:return or;case mr:return sr;case fr:return ur;case vr:return lr}return t});var gr="[object Arguments]",yr="[object Array]",br="[object Object]",wr=Object.prototype.hasOwnProperty;function kr(e,t,n,i,a,r){var o=ka(e),s=ka(t),u=o?yr:pr(e),l=s?yr:pr(t),d=(u=u==gr?br:u)==br,c=(l=l==gr?br:l)==br,h=u==l;if(h&&Fa(e)){if(!Fa(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new ca),o||Ga(e)?va(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 pa(e),new pa(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ai(+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=ga;case"[object Set]":var u=1&i;if(s||(s=ya),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=va(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(wa)return wa.call(e)==wa.call(t)}return!1}(e,t,u,n,i,a,r);if(!(1&n)){var m=d&&wr.call(e,"__wrapped__"),f=c&&wr.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new ca),a(v,p,n,i,r)}}return!!h&&(r||(r=new ca),function(e,t,n,i,a,r){var o=1&n,s=er(e),u=s.length;if(u!=er(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:tr.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 Sr(e,t,n,i,a){return e===t||(null==e||null==t||!Ta(e)&&!Ta(t)?e!=e&&t!=t:kr(e,t,n,i,Sr,a))}function Er(e){return e==e&&!Ui(e)}function Pr(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Tr(e){var t=function(e){for(var t=Za(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,Er(a)]}return t}(e);return 1==t.length&&t[0][2]?Pr(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(!Sr(l,u,3,i,new ca))return!1}return!0}(n,0,t)}}function _r(e){return"symbol"==typeof e||Ta(e)&&"[object Symbol]"==zi(e)}var Mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ar=/^\w*$/;function Dr(e,t){if(ka(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!_r(e))||(Ar.test(e)||!Mr.test(e)||null!=t&&e in Object(t))}function xr(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(xr.Cache||da),n}xr.Cache=da;var Cr,Ir,Lr,Fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rr=/\\(\\)?/g,Or=(Cr=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Fr,function(e,n,i,a){t.push(i?a.replace(Rr,"$1"):n||e)}),t},Ir=xr(Cr,function(e){return 500===Lr.size&&Lr.clear(),e}),Lr=Ir.cache,Ir);var $r=Ri?Ri.prototype:void 0,Nr=$r?$r.toString:void 0;function Wr(e){if("string"==typeof e)return e;if(ka(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,Wr)+"";if(_r(e))return Nr?Nr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jr(e,t){return ka(e)?e:Dr(e,t)?[e]:Or(function(e){return null==e?"":Wr(e)}(e))}function Br(e){if("string"==typeof e||_r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function zr(e,t){for(var n=0,i=(t=jr(t,e)).length;null!=e&&n<i;)e=e[Br(t[n++])];return n&&n==i?e:void 0}function Ur(e,t){return null!=e&&t in Object(e)}function Hr(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=jr(t,e)).length,r=!1;++i<a;){var o=Br(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&$a(a)&&Oa(o,a)&&(ka(e)||xa(e))}(e,t,Ur)}function Gr(e,t){return Dr(e)&&Er(t)?Pr(Br(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:zr(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?Hr(n,e):Sr(t,i,3)}}function Vr(e){return e}function Kr(e){return Dr(e)?(t=Br(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return zr(t,e)}}(e);var t}function Yr(e){return e!=e}function Xr(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,Yr,n)}(e,t,0)>-1}var qr=ar&&1/ya(new ar([,-0]))[1]==1/0?function(e){return new ar(e)}:function(){};function Jr(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Xr,r=e.length,o=!0,s=[],u=s;if(r>=200){var l=t?null:qr(e);if(l)return ya(l);o=!1,a=fa,u=new ha}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?Vr:"object"==typeof n?ka(n)?Gr(n[0],n[1]):Tr(n):Kr(n)):[];var n}var Qr="api_paywall_body:",Zr="api_paywall_body_meta:",eo=function(){return c(function e(t=()=>we().storage,n=500){o(this,e),this.storage=t,this.maxEntries=n,this.memory=null,this.index=null},[{key:"count",get:function(){return this.memory?this.memory.size:this.loadIndex().size}},{key:"evaluateTtl",value:function(e,t=Date.now()){if(0===e){if(this.memory)return;return this.dropPersisted([...this.loadIndex().keys()]),void(this.memory=new Map)}if(this.memory=null,null!==e){var n=[...this.loadIndex().values()].filter(n=>to(n,e,t));this.dropPersisted(n.map(e=>e.url))}}},{key:"validEntry",value:function(e,t,n=Date.now()){var i;if(this.memory)return null!==(i=this.memory.get(e))&&void 0!==i?i:null;var a=this.loadIndex().get(e);if(!a)return null;if(null!==t&&t>0&&to(a,t,n))return this.dropPersisted([e]),null;var r=this.read(Qr+e);return null===r?(this.dropPersisted([e]),null):{meta:a,body:r}}},{key:"bodyFor",value:function(e){var t,n;return this.memory?null!==(t=null===(n=this.memory.get(e))||void 0===n?void 0:n.body)&&void 0!==t?t:null:this.read(Qr+e)}},{key:"store",value:function(e,t,n,i=Date.now()){var a=m({url:e,savedAt:i},t?{contentHash:t}:{});if(this.memory)return this.memory.set(e,{meta:a,body:n}),!0;var r=this.loadIndex(),o=JSON.stringify(a);return this.write(Qr+e,n)&&this.write(Zr+e,o)?(r.set(e,a),!0):(_i.warn(`Paywall body cache: could not store ${e}; it will be fetched next time`),this.dropPersisted([e]),!1)}},{key:"seedIfAbsent",value:function(e,t,n,i=Date.now()){return!(this.memory?this.memory.has(e):this.loadIndex().has(e))&&this.store(e,t,n,i)}},{key:"remove",value:function(e){this.memory?this.memory.delete(e):this.dropPersisted([e])}},{key:"reconcile",value:function(e){var t=this.memory?[...this.memory.values()].map(e=>e.meta):[...this.loadIndex().values()],n=t.filter(t=>!e.has(t.url)).map(e=>e.url),i=t.filter(t=>e.has(t.url)).sort((e,t)=>e.savedAt-t.savedAt);[...n,...i.slice(0,Math.max(0,i.length-this.maxEntries)).map(e=>e.url)].forEach(e=>this.remove(e))}},{key:"purgeAll",value:function(){var e;this.dropPersisted([...this.loadIndex().keys()]),null===(e=this.memory)||void 0===e||e.clear()}},{key:"loadIndex",value:function(){if(this.index)return this.index;var e;this.index=new Map;try{e=this.storage().getAllKeys()}catch(e){return _i.warn(`Paywall body cache: storage unavailable, caching nothing (${e})`),this.index}for(var t,n=new Set(e.filter(e=>e.startsWith(Qr)).map(e=>e.slice(17))),i=[],a=h(e);!(t=a()).done;){var r=t.value;if(r.startsWith(Zr)){var o=r.slice(22),s=no(this.read(r));(null==s?void 0:s.url)===o&&n.has(o)?this.index.set(o,s):i.push(o),n.delete(o)}}return this.dropPersisted([...i,...n]),this.index}},{key:"dropPersisted",value:function(e){for(var t,n=h(e);!(t=n()).done;){var i,a=t.value;null===(i=this.index)||void 0===i||i.delete(a),this.removeKey(Zr+a),this.removeKey(Qr+a)}}},{key:"read",value:function(e){try{return this.storage().getItem(e)}catch(e){return null}}},{key:"write",value:function(e,t){try{this.storage().setItem(e,t)}catch(e){return!1}return this.read(e)===t}},{key:"removeKey",value:function(e){try{this.storage().removeItem(e)}catch(e){}}}])}();function to(e,t,n){return(n-e.savedAt)/1e3>=t}function no(e){if(null===e)return null;try{var t=JSON.parse(e);return"string"==typeof(null==t?void 0:t.url)&&"number"==typeof(null==t?void 0:t.savedAt)?t:null}catch(e){return null}}var io=new eo,ao=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(Yt,e||"en")}},{key:"getLanguageCode",value:function(){return this.getItem(Yt)||"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:"setApiPaywallsFromBodyCache",value:function(e){var t={bodyCacheUrls:e};0!==this.getCampaignCacheTtl()?this.setItem(ut,t):this.memoryStore[ut]=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){var n=JSON.parse(t);return ro(n)?oo(n.bodyCacheUrls):n}var i=this.getItem(ut);if(null===i)return null;if("string"==typeof i)try{i=JSON.parse(i)}catch(e){return i}return ro(i)?oo(i.bodyCacheUrls):this.isLegacyTimestampedCache(i)?i.data:i}return this.getItem(e)}},{key:"setActiveEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getActiveEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setNamiEntitlements",value:function(e,t){this.setItem(e,t)}},{key:"getNamiEntitlements",value:function(e){return this.getItem(e)||[]}},{key:"setProducts",value:function(e,t){this.setItem(e,t)}},{key:"getProducts",value:function(e){return this.getItem(e)}},{key:"getCachedProducts",value:function(){var e,t,n=null!==(e=this.getItem(ht))&&void 0!==e?e:[];return Jr(Mi([...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:"getAllCustomerAttributesMap",value:function(){var e={};return this.getAllCustomerAttributesKeys().forEach(t=>{var n=this.getCustomerAttribute(t);null!=n&&(e[t]=String(n))}),e}},{key:"clearCustomerAttribute",value:function(e){var t=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(Ft)}},{key:"setAnonymousUUID",value:function(e){this.setItem(Ft,e)}},{key:"clearAnonymousUUID",value:function(){this.resetItem(Ft)}},{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,n=null===(e=this.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.filter(e=>e.startsWith(An)).map(e=>e.slice(An.length)).find(e=>/^\d+$/.test(e));if(void 0!==n)return parseInt(n,10);var i=this.getAppConfig(at)||this.getAppConfig(yt);return null!==(t=null==i?void 0:i.campaign_cache_ttl)&&void 0!==t?t:null}},{key:"isLegacyTimestampedCache",value:function(e){return"object"==typeof e&&null!==e&&"cachedAt"in e&&"data"in e}},{key:"setItem",value:function(e,t){var n;try{n=JSON.stringify(t)}catch(t){return void _i.error(`Serialization failed for ${e}`,t)}try{this.storage.setItem(e,n)}catch(t){_i.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){_i.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){_i.error("Error removing item from localStorage:",e,": ",t)}delete this.memoryStore[e]}},{key:"clearAll",value:function(){Ei.forEach(e=>this.resetItem(e)),this.clearAllCustomerAttributes(),this.memoryStore={}}},{key:"clear",value:function(){try{this.storage.clear()}catch(e){_i.error("Error clearing localStorage:",e)}this.memoryStore={}}}])}();function ro(e){return"object"==typeof e&&null!==e&&Array.isArray(e.bodyCacheUrls)}function oo(e){for(var t,n=[],i=h(e);!(t=i()).done;){var a=t.value,r=io.bodyFor(a);if(null!==r)try{n.push(JSON.parse(r))}catch(e){io.remove(a)}}return n}var so=new ao,uo=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[n])).statusCode=e,i.status=e,i.message=`RetryLimitExceededError: ${i.message}`,i}return p(t,e),c(t)}(M(Error)),lo=function(e){function t(){return o(this,t),r(this,t,arguments)}return p(t,e),c(t)}(M(Error)),co=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)}(lo),ho=function(e){function t(){return o(this,t),r(this,t,[Ne])}return p(t,e),c(t)}(M(Error)),mo=function(e){function t(){return o(this,t),r(this,t,[Ie])}return p(t,e),c(t)}(M(Error)),fo=function(e){function t(){return o(this,t),r(this,t,[Fe])}return p(t,e),c(t)}(M(Error)),vo=function(e){function t(){return o(this,t),r(this,t,[Oe])}return p(t,e),c(t)}(M(Error)),po=function(e){function t(){return o(this,t),r(this,t,[je])}return p(t,e),c(t)}(M(Error)),go=function(e){function t(){return o(this,t),r(this,t,[ze])}return p(t,e),c(t)}(M(Error)),yo=function(e){function t(){return o(this,t),r(this,t,[Ve])}return p(t,e),c(t)}(M(Error)),bo=function(e){function t(){return o(this,t),r(this,t,[Ye])}return p(t,e),c(t)}(M(Error)),wo=function(e){function t(){return o(this,t),r(this,t,[Ye])}return p(t,e),c(t)}(M(Error)),ko=function(e){function t(){return o(this,t),r(this,t,[He])}return p(t,e),c(t)}(M(Error)),So=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)}(lo),Eo=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)}(lo),Po=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)}(lo),To=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)}(lo),_o=(e,t)=>{if(e==Yn)throw new So(t);if(e==qn)throw new Eo(t);if(e==Qn)throw new co;if(e>Yn&&e<ei)throw new Po(e,t);if(e>=ei)throw new To(t)};function Mo(e){for(var t=e.length;--t>=0;)e[t]=0}Mo(new Array(576)),Mo(new Array(60)),Mo(new Array(512)),Mo(new Array(256)),Mo(new Array(29)),Mo(new Array(30));var Ao=(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},Do=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})()),xo=(e,t,n,i)=>{var a=Do,r=i+n;e^=-1;for(var o=i;o<r;o++)e=e>>>8^a[255&(e^t[o])];return-1^e},Co={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"},Io=0,Lo=4,Fo=5,Ro=6,Oo=0,$o=1,No=2,Wo=-2,jo=-3,Bo=-4,zo=-5,Uo=8,Ho=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Go=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)Ho(n,i)&&(e[i]=n[i])}}return e},Vo=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 Yo=new Uint8Array(256),Xo=0;Xo<256;Xo++)Yo[Xo]=Xo>=252?6:Xo>=248?5:Xo>=240?4:Xo>=224?3:Xo>=192?2:1;Yo[254]=Yo[254]=1;var qo=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},Jo=(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=Yo[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)},Qo=(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+Yo[e[n]]>t?n:t};var Zo=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},es=16209,ts=function(e,t){var n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,T,_=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,T=e.output,r=a-(t-e.avail_out),o=a+(e.avail_out-257),s=_.dmax,u=_.wsize,l=_.whave,d=_.wnext,c=_.window,h=_.hold,m=_.bits,f=_.lencode,v=_.distcode,p=(1<<_.lenbits)-1,g=(1<<_.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){_.mode=16191;break e}e.msg="invalid literal/length code",_.mode=es;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",_.mode=es;break e}if(h>>>=b,m-=b,k>(b=a-r)){if((b=k-b)>l&&_.sane){e.msg="invalid distance too far back",_.mode=es;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",_.mode=es;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),_.hold=h,_.bits=m},ns=15,is=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]),as=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]),rs=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]),os=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]),ss=(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,_=0,M=0,A=null,D=new Uint16Array(16),x=new Uint16Array(16),C=null;for(y=0;y<=ns;y++)D[y]=0;for(b=0;b<i;b++)D[t[n+b]]++;for(S=g,k=ns;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<=ns;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<ns;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=is,C=as,m=257):(A=rs,C=os,m=0),M=0,b=0,y=w,h=r,E=S,P=0,d=-1,c=(_=1<<S)-1,1===e&&_>852||2===e&&_>592)return 1;for(;;){f=y-P,o[b]+1<m?(v=0,p=o[b]):o[b]>=m?(v=C[o[b]-m],p=A[o[b]-m]):(v=96,p=0),u=1<<y-P,w=l=1<<E;do{a[h+(M>>P)+(l-=u)]=f<<24|v<<16|p}while(0!==l);for(u=1<<y-1;M&u;)u>>=1;if(0!==u?(M&=u-1,M+=u):M=0,b++,0===--D[y]){if(y===k)break;y=t[n+o[b]]}if(y>S&&(M&c)!==d){for(0===P&&(P=S),h+=w,T=1<<(E=y-P);E+P<k&&!((T-=D[E+P])<=0);)E++,T<<=1;if(_+=1<<E,1===e&&_>852||2===e&&_>592)return 1;a[d=M&c]=S<<24|E<<16|h-r}}return 0!==M&&(a[h+M]=y-P<<24|64<<16),s.bits=S,0},us=Lo,ls=Fo,ds=Ro,cs=Oo,hs=$o,ms=No,fs=Wo,vs=jo,ps=Bo,gs=zo,ys=Uo,bs=16180,ws=16190,ks=16191,Ss=16192,Es=16194,Ps=16199,Ts=16200,_s=16206,Ms=16209,As=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Ds(){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 xs,Cs,Is=e=>{if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<bs||t.mode>16211?1:0},Ls=e=>{if(Is(e))return fs;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=bs,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,cs},Fs=e=>{if(Is(e))return fs;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ls(e)},Rs=(e,t)=>{var n;if(Is(e))return fs;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?fs:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,Fs(e))},Os=(e,t)=>{if(!e)return fs;var n=new Ds;e.state=n,n.strm=e,n.window=null,n.mode=bs;var i=Rs(e,t);return i!==cs&&(e.state=null),i},$s=!0,Ns=e=>{if($s){xs=new Int32Array(512),Cs=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(ss(1,e.lens,0,288,xs,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ss(2,e.lens,0,32,Cs,0,e.work,{bits:5}),$s=!1}e.lencode=xs,e.lenbits=9,e.distcode=Cs,e.distbits=5},Ws=(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},js=(e,t)=>{var n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k,S,E,P,T,_=0,M=new Uint8Array(4),A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Is(e)||!e.output||!e.input&&0!==e.avail_in)return fs;(n=e.state).mode===ks&&(n.mode=Ss),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=cs;e:for(;;)switch(n.mode){case bs:if(0===n.wrap){n.mode=Ss;break}for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,M[0]=255&l,M[1]=l>>>8&255,n.check=xo(n.check,M,2,0),l=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Ms;break}if((15&l)!==ys){e.msg="unknown compression method",n.mode=Ms;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=Ms;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:ks,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)!==ys){e.msg="unknown compression method",n.mode=Ms;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Ms;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=xo(n.check,M,2,0)),l=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,M[2]=l>>>16&255,M[3]=l>>>24&255,n.check=xo(n.check,M,4,0)),l=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=xo(n.check,M,2,0)),l=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(M[0]=255&l,M[1]=l>>>8&255,n.check=xo(n.check,M,2,0)),l=0,d=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((m=n.length)>s&&(m=s),m&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(r,r+m),S)),512&n.flags&&4&n.wrap&&(n.check=xo(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=xo(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=xo(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=Ms;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=ks;break;case 16189:for(;d<32;){if(0===s)break e;s--,l+=i[r++]<<d,d+=8}e.adler=n.check=As(l),l=0,d=0,n.mode=ws;case ws: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,ms;e.adler=n.check=1,n.mode=ks;case ks:if(t===ls||t===ds)break e;case Ss:if(n.last){l>>>=7&d,d-=7&d,n.mode=_s;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(Ns(n),n.mode=Ps,t===ds){l>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Ms}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=Ms;break}if(n.length=65535&l,l=0,d=0,n.mode=Es,t===ds)break e;case Es: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=ks;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=Ms;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=ss(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,E){e.msg="invalid code lengths set",n.mode=Ms;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;g=(_=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&_,!((p=_>>>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=Ms;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=Ms;break}for(;m--;)n.lens[n.have++]=S}}if(n.mode===Ms)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Ms;break}if(n.lenbits=9,P={bits:n.lenbits},E=ss(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=Ms;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},E=ss(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=Ms;break}if(n.mode=Ps,t===ds)break e;case Ps:n.mode=Ts;case Ts: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,ts(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===ks&&(n.back=-1);break}for(n.back=0;g=(_=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,y=65535&_,!((p=_>>>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=(_=n.lencode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&_,!(b+(p=_>>>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=ks;break}if(64&g){e.msg="invalid literal/length code",n.mode=Ms;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=(_=n.distcode[l&(1<<n.distbits)-1])>>>16&255,y=65535&_,!((p=_>>>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=(_=n.distcode[k+((l&(1<<b+w)-1)>>b)])>>>16&255,y=65535&_,!(b+(p=_>>>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=Ms;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=Ms;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=Ms;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=Ts);break;case 16205:if(0===u)break e;a[o++]=n.length,u--,n.mode=Ts;break;case _s: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?xo(n.check,a,h,o-h):Ao(n.check,a,h,o-h)),h=u,4&n.wrap&&(n.flags?l:As(l))!==n.check){e.msg="incorrect data check",n.mode=Ms;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=Ms;break}l=0,d=0}n.mode=16208;case 16208:E=hs;break e;case Ms:E=vs;break e;case 16210:return ps;default:return fs}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<Ms&&(n.mode<_s||t!==us))&&Ws(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?xo(n.check,a,h,e.next_out-h):Ao(n.check,a,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ks?128:0)+(n.mode===Ps||n.mode===Es?256:0),(0===c&&0===h||t===us)&&E===cs&&(E=gs),E},Bs={inflateReset:Fs,inflateReset2:Rs,inflateResetKeep:Ls,inflateInit:e=>Os(e,15),inflateInit2:Os,inflate:js,inflateEnd:e=>{if(Is(e))return fs;var t=e.state;return t.window&&(t.window=null),e.state=null,cs},inflateGetHeader:(e,t)=>{if(Is(e))return fs;var n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,cs):fs},inflateSetDictionary:(e,t)=>{var n,i=t.length;return Is(e)||0!==(n=e.state).wrap&&n.mode!==ws?fs:n.mode===ws&&Ao(1,t,i,0)!==n.check?vs:Ws(e,t,i,i)?(n.mode=16210,ps):(n.havedict=1,cs)},inflateInfo:"pako inflate (from Nodeca project)"};var zs=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},Us=Object.prototype.toString,Hs=Io,Gs=Lo,Vs=Oo,Ks=$o,Ys=No,Xs=Wo,qs=jo,Js=Bo;function Qs(e){this.options=Go({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 Zo,this.strm.avail_out=0;var n=Bs.inflateInit2(this.strm,t.windowBits);if(n!==Vs)throw new Error(Co[n]);if(this.header=new zs,Bs.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=qo(t.dictionary):"[object ArrayBuffer]"===Us.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Bs.inflateSetDictionary(this.strm,t.dictionary))!==Vs))throw new Error(Co[n])}Qs.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?Gs:Hs,"[object ArrayBuffer]"===Us.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=Bs.inflate(r,i))===Ys&&s&&((n=Bs.inflateSetDictionary(r,s))===Vs?n=Bs.inflate(r,i):n===qs&&(n=Ys));r.avail_in>0&&n===Ks&&r.state.wrap>0&&0!==e[r.next_in];)Bs.inflateReset(r),n=Bs.inflate(r,i);switch(n){case Xs:case qs:case Ys:case Js: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=Qo(r.output,r.next_out),l=r.next_out-u,d=Jo(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!==Vs||0!==a){if(n===Ks)return n=Bs.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Qs.prototype.onData=function(e){this.chunks.push(e)},Qs.prototype.onEnd=function(e){e===Vs&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Vo(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Zs={ungzip:function(e,t){var n=new Qs(t);if(n.push(e),n.err)throw n.msg||Co[n.err];return n.result}}.ungzip,eu=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},tu=e=>{var t,n,i=so.getAppConfig(at)||so.getAppConfig(yt);return null!==(t=null==i||null===(n=i.capabilities)||void 0===n?void 0:n.includes(e))&&void 0!==t&&t},nu=()=>so.getCampaignCacheTtl(),iu=()=>{var e=nu();if(null!==e)if(0!==e){var t=so.getApiCampaignSessionTimestamp();if(null!==t)(Date.now()-t)/1e3>=e&&so.purgeApiCampaignCache()}else so.purgeApiCampaignCache()},au=e=>{var t=!tu(Pe.THIRD_PARTY_TRANSACTIONS);return e&&!t&&_i.info(`[${e}] Your plan does not have purchase management features.`),t},ru=()=>{var e,t,n=null===(e=so.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(pn))&&void 0!==t&&t},ou=()=>{var e,t,n=null===(e=so.getNamiConfig())||void 0===e?void 0:e.namiCommands;return null!==(t=null==n?void 0:n.includes(yn))&&void 0!==t&&t};function su(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=Zs(t),i=(new TextDecoder).decode(n);return JSON.parse(i)}catch(e){return}}var uu=null;function lu(){return null!==uu&&(n=null===(e=so.getNamiConfig())||void 0===e?void 0:e.namiCommands,null!==(t=null==n?void 0:n.includes(wn))&&void 0!==t&&t);var e,t,n}function du(e){if(e)return e.length>4096?e.slice(0,4096):e}function cu(e){try{return new URL(e).pathname}catch(t){return e}}function hu(e){var t=null==e?void 0:e.body;return"string"==typeof t?du(t):void 0}function mu(e){try{var t;null===(t=uu)||void 0===t||t(e)}catch(e){}}function fu(e,t,n,i){var r,o,s,u,l,d,c,h;return k(function(m){for(;;)switch(m.p=m.n){case 0:if(lu()){m.n=1;break}return m.a(2,i());case 1:return o=null!==(r=null==t?void 0:t.method)&&void 0!==r?r:"GET",s=Date.now(),m.p=2,m.n=3,a(i());case 3:u=m.v,m.n=5;break;case 4:throw m.p=4,c=m.v,mu({method:o,url:e,path:cu(e),statusCode:0,durationMs:Date.now()-s,timestamp:new Date,requestBody:hu(t),errorDescription:vu(c),kind:n}),c;case 5:return l=Date.now()-s,m.p=6,h=du,m.n=7,a(u.clone().text());case 7:d=h(m.v),m.n=9;break;case 8:m.p=8,m.v;case 9:return mu({method:o,url:e,path:cu(e),statusCode:u.status,durationMs:l,timestamp:new Date,requestBody:hu(t),responseBody:d,kind:n}),m.a(2,u)}},null,null,[[6,8],[2,4]],Promise)}function vu(e){return e instanceof Error?e.name?`${e.name}: ${e.message}`:e.message:String(e)}function pu(e,t,n=Nn,i=Fn){var r,o,s,u,l,d,c;return k(function(h){for(;;)switch(h.n){case 0:return o=0,s=ru(),u=ou(),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)&&_i.debug(`[HTTP] ${l} ${e}`),u&&null!=t&&t.body&&_i.debug(`[HTTP] Request body: ${t.body}`),f.n=1,a(fu(e,t,"api",()=>gu(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,_i.debug(`[HTTP] Response ${r.status}: ${c}`);case 3:if(r.status!=Qn){f.n=4;break}throw new co;case 4:if(!(++o<=i)){f.n=6;break}return h=1e3*(o+On),f.n=5,a(new Promise(e=>setTimeout(e,h)));case 5:return f.a(2,d());case 6:throw new uo(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,_i.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 gu(e,t={},n){var i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return i=new AbortController,r=setTimeout(()=>i.abort(),n),t.signal=i.signal,s.n=1,a(fetch(e,t));case 1:return o=s.v,clearTimeout(r),s.a(2,o)}},null,null,null,Promise)}var yu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{},bu="function"==typeof yu.BigInt,wu=bu?yu.BigInt.bind(yu):void 0,ku=bu?wu("0xffffffffffffffffffffffffffffffff"):null,Su=bu?wu("0x100000000000000000000000000000000"):null,Eu=bu?wu(0):null,Pu=bu?wu(1):null,Tu=bu?wu(8):null,_u=bu?wu(1e4):null,Mu=yu.crypto,Au="function"==typeof(null==Mu?void 0:Mu.getRandomValues),Du=1/16,xu=e=>we().device.getDeviceData(e),Cu=()=>{var e=so.getNamiConfig();return e&&e.formFactor?e.formFactor:we().device.getDeviceFormFactor()};function Iu(){return we().device.generateUUID()}function Lu(e){if(!bu||!ku)return Ou(e);try{var t=ku,n=function(e){if(!wu)throw new Error("BigInt is not supported in this environment");var t=e.replace(/-/g,"");return wu("0x"+t)}(e);return Number(n)/Number(t)*100}catch(t){throw _i.error(`Error calculating audience split position for UUID ${e}`,t),new Error(`Invalid UUID format: ${e}`)}}function Fu(e){if(!wu)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 Ru(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(!(bu&&ku&&wu&&_u))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=Iu(),r=Number.POSITIVE_INFINITY,o=50,s=0;s<o;s++){var u=Iu(),l=Ou(u);if(l>=n&&l<=i)return u;var d=$u(l,n,i);d<r&&(r=d,a=u)}return a}(n,i);var s=ku,u=wu,l=_u,d=e=>s*u(e)/l,c=d(r),m=d(o);if(m<=c)return Fu(c);var f=c+function(e){if(!wu||null===Su||null===Pu||null===Eu||null===Tu)throw new Error("BigInt is not supported in this environment");var t=wu,n=Eu,i=Pu,a=Tu,r=Su;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(Au)Mu.getRandomValues(o);else{d||(d=!0,_i.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(Au)try{Mu.getRandomValues(o);for(var p,g=n,y=h(o);!(p=y()).done;)g=g<<a|t(p.value);var b=g%s;return _i.warn("randomBigInt: reached max rejection attempts, using modulo fallback",{n:e.toString(),attempts:l}),b}catch(e){throw _i.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 _i.warn("randomBigInt: reached max rejection attempts without crypto, using modulo fallback",{n:e.toString(),attempts:l}),k%s}(m-c);return Fu(f)}function Ou(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))*Du}return n}(e);return 100*t}function $u(e,t,n){return e<t?t-e:e>n?e-n:0}function Nu(e,t,n){var i=n.value;return n.value=function(...e){if(!this.platformID)throw new mo;return i.apply(this,e)},n}function Wu(e,t,n){var i=n.value;return n.value=function(...e){var t=so.getDevice();if(null==t||!t.id)throw new fo;return i.apply(this,e)},n}var ju,Bu=function(){function e(){o(this,e);var t=so.getNamiConfig();!this.platformID&&t&&this.configure(t)}return c(e,[{key:"deviceID",get:function(){var e;return null===(e=so.getDevice())||void 0===e?void 0:e.id}},{key:"configure",value:function(e){this.baseURL=eu(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 vo;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,so.setSessionCounter(),n.id&&so.setSessionId(n.id);case 2:return i.a(2)}},null,this,null,Promise)}},{key:"postImpression",value:function(t){var n,i,r,o,s,u;return k(function(l){for(;;)switch(l.n){case 0:return o=`device/${this.deviceID}/impression/`,s=null!==(n=t.id)&&void 0!==n?n:Iu(),u=m({},t,{id:s,impression_date:null!==(i=t.impression_date)&&void 0!==i?i:(new Date).toISOString()}),so.setLastImpressionId(s),null===(r=e.impressionListener)||void 0===r||r.call(e,s),l.n=1,a(this.requestBodyAPI(o,u,"POST",!0));case 1:return l.a(2)}},null,this,null,Promise)}},{key:"patchImpressionCompletion",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`device/${this.deviceID}/impression/${e}/`,r.n=1,a(this.requestBodyAPI(i,{completion_result:t,completion_result_date:n},"PATCH",!0));case 1:return r.a(2)}},null,this,null,Promise)}},{key:"postConversion",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/transaction/`,n.n=1,a(this.requestBodyAPI(t,e,"POST",!0));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"purchaseValidation",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return t=`device/${this.deviceID}/purchase_event/`,n.n=1,a(this.requestBodyAPI(t,e,"PUT"));case 1:return n.a(2)}},null,this,null,Promise)}},{key:"fetchAPI",value:function(e,t,n){var i;return k(function(r){for(;;)switch(r.n){case 0:return i=`${this.baseURL}/${this.platformID}/`+e,r.n=1,a(pu(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(pu(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 zu(e){return null!=(null==e?void 0:e.flow)}Bu.instance=new Bu,ke([Wu],Bu.prototype,"login",null),ke([Wu],Bu.prototype,"logout",null),ke([Wu],Bu.prototype,"startSession",null),ke([Wu],Bu.prototype,"postImpression",null),ke([Wu],Bu.prototype,"patchImpressionCompletion",null),ke([Wu],Bu.prototype,"postConversion",null),ke([Wu],Bu.prototype,"purchaseValidation",null),ke([Nu],Bu.prototype,"fetchAPI",null),ke([Nu],Bu.prototype,"requestBodyAPI",null),e.NamiCampaignRuleType=void 0,(ju=e.NamiCampaignRuleType||(e.NamiCampaignRuleType={})).DEFAULT="default",ju.LABEL="label",ju.UNKNOWN="unknown",ju.URL="url";var Uu=()=>{var e;return null!==(e=so.getPaywalls(St))&&void 0!==e?e:[]},Hu=()=>{var e;return null!==(e=so.getPaywalls(ut))&&void 0!==e?e:[]},Gu=()=>Jr(Mi([...Hu(),...Uu()]),"id"),Vu=e=>Gu().find(t=>t.id===e),Ku=e=>{var t=Gu(),n=new Set(t.map(e=>e.id));return e.every(e=>n.has(e))};function Yu(e){return(t={})=>{var n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Xu(e){return(t,n)=>{var i;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,r=null!=n&&n.width?String(n.width):a;i=e.formattingValues[r]||e.formattingValues[a]}else{var o=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function qu(e){return(t,n={})=>{var i=n.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],r=t.match(a);if(!r)return null;var o,s=r[0],u=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(u,e=>e.test(s)):function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(u,e=>e.test(s));return o=e.valueCallback?e.valueCallback(l):l,{value:o=n.valueCallback?n.valueCallback(o):o,rest:t.slice(s.length)}}}function Ju(e){var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}var Qu={};function Zu(){return Qu}function el(e,t){var n,i,a,r,o,s,u=Zu(),l=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.weekStartsOn)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.weekStartsOn)&&void 0!==a?a:u.weekStartsOn)&&void 0!==i?i:null===(s=u.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==n?n:0,d=Ju(e),c=d.getDay(),h=(c<l?7:0)+c-l;return d.setDate(d.getDate()-h),d.setHours(0,0,0,0),d}var tl,nl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},il={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},al={ordinalNumber:(e,t)=>{var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Xu({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Xu({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xu({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Xu({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Xu({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},rl={ordinalNumber:(tl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{var n=e.match(tl.matchPattern);if(!n)return null;var i=n[0],a=e.match(tl.parsePattern);if(!a)return null;var r=tl.valueCallback?tl.valueCallback(a[0]):a[0];return{value:r=t.valueCallback?t.valueCallback(r):r,rest:e.slice(i.length)}}),era:qu({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:qu({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:qu({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:qu({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:qu({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},ol={code:"en-US",formatDistance:(e,t,n)=>{var i,a=nl[e];return i="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:{date:Yu({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Yu({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Yu({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:(e,t,n,i)=>il[e],localize:al,match:rl,options:{weekStartsOn:0,firstWeekContainsDate:1}},sl=6048e5;function ul(e){var t=Ju(e);return t.setHours(0,0,0,0),t}function ll(e){var t=Ju(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function dl(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function cl(e){var t,n,i,a,r,o,s=Ju(e),u=(t=s,n=function(e){var t=Ju(e),n=dl(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(s),i=ul(t),a=ul(n),r=+i-ll(i),o=+a-ll(a),Math.round((r-o)/864e5));return u+1}function hl(e){return el(e,{weekStartsOn:1})}function ml(e){var t=Ju(e),n=t.getFullYear(),i=dl(e,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);var a=hl(i),r=dl(e,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);var o=hl(r);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function fl(e){var t=Ju(e),n=+hl(t)-+function(e){var t=ml(e),n=dl(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),hl(n)}(t);return Math.round(n/sl)+1}function vl(e,t){var n,i,a,r,o,s,u=Ju(e),l=u.getFullYear(),d=Zu(),c=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.firstWeekContainsDate)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==a?a:d.firstWeekContainsDate)&&void 0!==i?i:null===(s=d.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1,h=dl(e,0);h.setFullYear(l+1,0,c),h.setHours(0,0,0,0);var m=el(h,t),f=dl(e,0);f.setFullYear(l,0,c),f.setHours(0,0,0,0);var v=el(f,t);return u.getTime()>=m.getTime()?l+1:u.getTime()>=v.getTime()?l:l-1}function pl(e,t){var n=Ju(e),i=+el(n,t)-+function(e,t){var n,i,a,r,o,s,u=Zu(),l=null!==(n=null!==(i=null!==(a=null!==(r=null==t?void 0:t.firstWeekContainsDate)&&void 0!==r?r:null==t||null===(o=t.locale)||void 0===o||null===(o=o.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==a?a:u.firstWeekContainsDate)&&void 0!==i?i:null===(s=u.locale)||void 0===s||null===(s=s.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==n?n:1,d=vl(e,t),c=dl(e,0);return c.setFullYear(d,0,l),c.setHours(0,0,0,0),el(c,t)}(n,t);return Math.round(i/sl)+1}function gl(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}var yl={y(e,t){var n=e.getFullYear(),i=n>0?n:1-n;return gl("yy"===t?i%100:i,t.length)},M(e,t){var n=e.getMonth();return"M"===t?String(n+1):gl(n+1,2)},d:(e,t)=>gl(e.getDate(),t.length),a(e,t){var n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>gl(e.getHours()%12||12,t.length),H:(e,t)=>gl(e.getHours(),t.length),m:(e,t)=>gl(e.getMinutes(),t.length),s:(e,t)=>gl(e.getSeconds(),t.length),S(e,t){var n=t.length,i=e.getMilliseconds();return gl(Math.trunc(i*Math.pow(10,n-3)),t.length)}},bl="midnight",wl="noon",kl="morning",Sl="afternoon",El="evening",Pl="night",Tl={G:function(e,t,n){var i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var i=e.getFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return yl.y(e,t)},Y:function(e,t,n,i){var a=vl(e,i),r=a>0?a:1-a;return"YY"===t?gl(r%100,2):"Yo"===t?n.ordinalNumber(r,{unit:"year"}):gl(r,t.length)},R:function(e,t){return gl(ml(e),t.length)},u:function(e,t){return gl(e.getFullYear(),t.length)},Q:function(e,t,n){var i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return gl(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return gl(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getMonth();switch(t){case"M":case"MM":return yl.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return gl(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var a=pl(e,i);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):gl(a,t.length)},I:function(e,t,n){var i=fl(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):gl(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):yl.d(e,t)},D:function(e,t,n){var i=cl(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):gl(i,t.length)},E:function(e,t,n){var i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return gl(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var a=e.getDay(),r=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return gl(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getDay(),a=0===i?7:i;switch(t){case"i":return String(a);case"ii":return gl(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i,a=e.getHours();switch(i=12===a?wl:0===a?bl:a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i,a=e.getHours();switch(i=a>=17?El:a>=12?Sl:a>=4?kl:Pl,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var i=e.getHours()%12;return 0===i&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return yl.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):yl.H(e,t)},K:function(e,t,n){var i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):gl(i,t.length)},k:function(e,t,n){var i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):gl(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):yl.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):yl.s(e,t)},S:function(e,t){return yl.S(e,t)},X:function(e,t,n){var i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Ml(i);case"XXXX":case"XX":return Al(i);default:return Al(i,":")}},x:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"x":return Ml(i);case"xxxx":case"xx":return Al(i);default:return Al(i,":")}},O:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_l(i,":");default:return"GMT"+Al(i,":")}},z:function(e,t,n){var i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_l(i,":");default:return"GMT"+Al(i,":")}},t:function(e,t,n){return gl(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return gl(e.getTime(),t.length)}};function _l(e,t=""){var n=e>0?"-":"+",i=Math.abs(e),a=Math.trunc(i/60),r=i%60;return 0===r?n+String(a):n+String(a)+t+gl(r,2)}function Ml(e,t){return e%60==0?(e>0?"-":"+")+gl(Math.abs(e)/60,2):Al(e,t)}function Al(e,t=""){var n=e>0?"-":"+",i=Math.abs(e);return n+gl(Math.trunc(i/60),2)+t+gl(i%60,2)}var Dl=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},xl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Cl={p:xl,P:(e,t)=>{var n,i=e.match(/(P+)(p+)?/)||[],a=i[1],r=i[2];if(!r)return Dl(e,t);switch(a){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Dl(a,t)).replace("{{time}}",xl(r,t))}},Il=/^D+$/,Ll=/^Y+$/,Fl=["D","DD","YY","YYYY"];function Rl(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t,n=Ju(e);return!isNaN(Number(n))}var Ol=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$l=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Nl=/^'([^]*?)'?$/,Wl=/''/g,jl=/[a-zA-Z]/;function Bl(e,t,n){var i,a,r,o,s,u,l,d,c,h,m,f,v,p,g=Zu(),y=null!==(i=null!==(a=null==n?void 0:n.locale)&&void 0!==a?a:g.locale)&&void 0!==i?i:ol,b=null!==(r=null!==(o=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(l=n.locale)||void 0===l||null===(l=l.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==s?s:g.firstWeekContainsDate)&&void 0!==o?o:null===(d=g.locale)||void 0===d||null===(d=d.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==r?r:1,w=null!==(c=null!==(h=null!==(m=null!==(f=null==n?void 0:n.weekStartsOn)&&void 0!==f?f:null==n||null===(v=n.locale)||void 0===v||null===(v=v.options)||void 0===v?void 0:v.weekStartsOn)&&void 0!==m?m:g.weekStartsOn)&&void 0!==h?h:null===(p=g.locale)||void 0===p||null===(p=p.options)||void 0===p?void 0:p.weekStartsOn)&&void 0!==c?c:0,k=Ju(e);if(!Rl(k))throw new RangeError("Invalid time value");var S=t.match($l).map(e=>{var t=e[0];return"p"===t||"P"===t?(0,Cl[t])(e,y.formatLong):e}).join("").match(Ol).map(e=>{if("''"===e)return{isToken:!1,value:"'"};var t=e[0];if("'"===t)return{isToken:!1,value:zl(e)};if(Tl[t])return{isToken:!0,value:e};if(t.match(jl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});y.localize.preprocessor&&(S=y.localize.preprocessor(k,S));var E={firstWeekContainsDate:b,weekStartsOn:w,locale:y};return S.map(i=>{if(!i.isToken)return i.value;var a=i.value;return(null!=n&&n.useAdditionalWeekYearTokens||!function(e){return Ll.test(e)}(a))&&(null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return Il.test(e)}(a))||function(e,t,n){var i=function(e,t,n){var i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),Fl.includes(e))throw new RangeError(i)}(a,t,String(e)),(0,Tl[a[0]])(k,a,y.localize,E)}).join("")}function zl(e){var t=e.match(Nl);return t?t[1].replace(Wl,"'"):e}function Ul(e,t,n){var i,a=Object.assign({},Zu()),r=function(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,null!==(i=n.locale)&&void 0!==i?i:a.locale);return"formatToParts"in r?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value;return}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(r,t)}function Hl(e,t){var n=function(e){Vl[e]||(Vl[e]=Yl?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}));return Vl[e]}(t);return"formatToParts"in n?function(e,t){try{for(var n=e.formatToParts(t),i=[],a=0;a<n.length;a++){var r=Gl[n[a].type];void 0!==r&&(i[r]=parseInt(n[a].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}(n,e)}var Gl={year:0,month:1,day:2,hour:3,minute:4,second:5};var Vl={},Kl=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")),Yl="06/25/2014, 00:00:00"===Kl||"‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00"===Kl;function Xl(e,t,n,i,a,r,o){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,a,r,o),s}var ql=36e5,Jl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ql(e,t,n){if(!e)return 0;var i,a,r=Jl.timezoneZ.exec(e);if(r)return 0;if(r=Jl.timezoneHH.exec(e))return ed(i=parseInt(r[1],10))?-i*ql:NaN;if(r=Jl.timezoneHHMM.exec(e)){i=parseInt(r[2],10);var o=parseInt(r[3],10);return ed(i,o)?(a=Math.abs(i)*ql+6e4*o,"+"===r[1]?-a:a):NaN}if(function(e){if(td[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),td[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return Xl(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),u=Zl(s,e),l=n?u:function(e,t,n){var i=e.getTime(),a=i-t,r=Zl(new Date(a),n);if(t===r)return t;a-=r-t;var o=Zl(new Date(a),n);if(r===o)return r;return Math.max(r,o)}(t,u,e);return-l}return NaN}function Zl(e,t){var n=Hl(e,t),i=Xl(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),a=e.getTime(),r=a%1e3;return i-(a-=r>=0?r:1e3+r)}function ed(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var td={};var nd={X:function(e,t,n){var i=id(n.timeZone,e);if(0===i)return"Z";switch(t){case"X":return od(i);case"XXXX":case"XX":return rd(i);default:return rd(i,":")}},x:function(e,t,n){var i=id(n.timeZone,e);switch(t){case"x":return od(i);case"xxxx":case"xx":return rd(i);default:return rd(i,":")}},O:function(e,t,n){var i=id(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t=""){var n=e>0?"-":"+",i=Math.abs(e),a=Math.floor(i/60),r=i%60;if(0===r)return n+String(a);return n+String(a)+t+ad(r,2)}(i,":");default:return"GMT"+rd(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Ul("short",e,n);default:return Ul("long",e,n)}}};function id(e,t){var n,i=e?Ql(e,t,!0)/6e4:null!==(n=null==t?void 0:t.getTimezoneOffset())&&void 0!==n?n:0;if(Number.isNaN(i))throw new RangeError("Invalid time zone specified: "+e);return i}function ad(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function rd(e,t=""){var n=e>0?"-":"+",i=Math.abs(e);return n+ad(Math.floor(i/60),2)+t+ad(Math.floor(i%60),2)}function od(e,t){return e%60==0?(e>0?"-":"+")+ad(Math.abs(e)/60,2):rd(e,t)}function sd(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}var ud=36e5,ld=6e4,dd={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function cd(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var i=function(e){var t,n={},i=dd.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=dd.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var a=dd.timeZone.exec(t);a?(n.time=t.replace(a[1],""),n.timeZone=a[1].trim()):n.time=t}return n}(e),a=function(e,t){if(e){var n=dd.YYY[t],i=dd.YYYYY[t],a=dd.YYYY.exec(e)||i.exec(e);if(a){var r=a[1];return{year:parseInt(r,10),restDateString:e.slice(r.length)}}if(a=dd.YY.exec(e)||n.exec(e)){var o=a[1];return{year:100*parseInt(o,10),restDateString:e.slice(o.length)}}}return{year:null}}(i.date,n),r=a.year,o=function(e,t){if(null===t)return null;var n,i,a;if(!e||!e.length)return(n=new Date(0)).setUTCFullYear(t),n;var r=dd.MM.exec(e);if(r)return n=new Date(0),pd(t,i=parseInt(r[1],10)-1)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(r=dd.DDD.exec(e)){n=new Date(0);var o=parseInt(r[1],10);return function(e,t){if(t<1)return!1;var n=vd(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,o)?(n.setUTCFullYear(t,0,o),n):new Date(NaN)}if(r=dd.MMDD.exec(e)){n=new Date(0),i=parseInt(r[1],10)-1;var s=parseInt(r[2],10);return pd(t,i,s)?(n.setUTCFullYear(t,i,s),n):new Date(NaN)}if(r=dd.Www.exec(e))return gd(a=parseInt(r[1],10)-1)?hd(t,a):new Date(NaN);if(r=dd.WwwD.exec(e)){a=parseInt(r[1],10)-1;var u=parseInt(r[2],10)-1;return gd(a,u)?hd(t,a,u):new Date(NaN)}return null}(a.restDateString,r);if(null===o||isNaN(o.getTime()))return new Date(NaN);if(o){var s,u=o.getTime(),l=0;if(i.time&&(null===(l=function(e){var t,n,i=dd.HH.exec(e);if(i)return yd(t=parseFloat(i[1].replace(",",".")))?t%24*ud:NaN;if(i=dd.HHMM.exec(e))return yd(t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")))?t%24*ud+n*ld:NaN;if(i=dd.HHMMSS.exec(e)){t=parseInt(i[1],10),n=parseInt(i[2],10);var a=parseFloat(i[3].replace(",","."));return yd(t,n,a)?t%24*ud+n*ld+1e3*a:NaN}return null}(i.time))||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(s=Ql(i.timeZone||t.timeZone,new Date(u+l)),isNaN(s))return new Date(NaN)}else s=sd(new Date(u+l)),s=sd(new Date(u+l+s));return new Date(u+l+s)}return new Date(NaN)}function hd(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var a=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+a),i}var md=[31,28,31,30,31,30,31,31,30,31,30,31],fd=[31,29,31,30,31,30,31,31,30,31,30,31];function vd(e){return e%400==0||e%4==0&&e%100!=0}function pd(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=vd(e);if(i&&n>fd[t])return!1;if(!i&&n>md[t])return!1}return!0}function gd(e,t){return!(e<0||e>52)&&(null==t||!(t<0||t>6))}function yd(e,t,n){return!(e<0||e>=25)&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var bd=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function wd(e,t,n,i){return function(e,t,n={}){var i=(t=String(t)).match(bd);if(i){var a=cd(n.originalDate||e,n);t=i.reduce(function(e,t){if("'"===t[0])return e;var i=e.indexOf(t),r="'"===e[i-1],o=e.replace(t,"'"+nd[t[0]](a,t,n)+"'");return r?o.substring(0,i-1)+o.substring(i+1):o},t)}return Bl(e,t,n)}(function(e,t,n){var i=Ql(t,e=cd(e,n),!0),a=new Date(e.getTime()-i),r=new Date(0);return r.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),r.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),r}(e,t,{timeZone:(i=m({},i,{timeZone:t,originalDate:e})).timeZone}),n,i)}var kd,Sd=e=>{try{return!isNaN(new Date(e).getTime())}catch(e){return!1}},Ed=(e,t,n=new Date)=>{var i=n.getTime(),a=!e||!Sd(e)||new Date(e).getTime()<i,r=!t||!Sd(t)||new Date(t).getTime()>i;return a&&r},Pd=e=>{try{var t=new URL(e);return("http:"===t.protocol||"https:"===t.protocol)&&!!t.hostname}catch(e){return!1}},Td=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}},_d=(e,t,n)=>{if(!e)return[];var i=e.filter(e=>!Array.isArray(e.segments)).length;return i>0&&_i.warn(`Skipping ${i} of ${e.length} campaign rules with no segments array`),e.flatMap(e=>{if(!Array.isArray(e.segments))return[];var i;if(i="string"==typeof n?e.segments.filter(e=>e.form_factors.some(e=>e.form_factor===n)):e.segments,0===i.length)return[];var a=((e,t)=>{for(var n,i=[...e].sort((e,t)=>e.split-t.split),a=h(i);!(n=a()).done;){var r=n.value;if(t<=r.split)return r}return i[i.length-1]})(i,t);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}})},Md=()=>{var e,t,n=null!==(e=so.getCampaignRules(ot))&&void 0!==e?e:[],i=null!==(t=so.getCampaignRules(wt))&&void 0!==t?t:[],a=Cu(),r=Mi([...n,...i]).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===a)}).filter(e=>Ed(e.not_before,e.expires_at)),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)})},Ad=e=>{var t,n=null!==(t=so.getCampaignRules(e))&&void 0!==t?t:[],i=Cu();return Mi(n).filter(e=>{var t;return null===(t=e.form_factors)||void 0===t?void 0:t.some(e=>e.form_factor===i)}).filter(e=>Ed(e.not_before,e.expires_at))},Dd=()=>Ad(wt),xd=()=>Ad(ot),Cd=(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=Td(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=Td(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}},Id=(e,t)=>{var n=Cd(xd,Hu,e,t);if(n.campaign&&n.paywall)return{campaign:n.campaign,paywall:n.paywall};var i=Cd(Dd,Uu,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}},Ld="object"==typeof Reflect?Reflect:null,Fd=Ld&&"function"==typeof Ld.apply?Ld.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};kd=Ld&&"function"==typeof Ld.ownKeys?Ld.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Rd=Number.isNaN||function(e){return e!=e};function Od(){Od.init.call(this)}Od.EventEmitter=Od,Od.prototype._events=void 0,Od.prototype._eventsCount=0,Od.prototype._maxListeners=void 0;var $d=10;function Nd(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Wd(e){return void 0===e._maxListeners?Od.defaultMaxListeners:e._maxListeners}function jd(e,t,n,i){var a,r,o,s;if(Nd(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=Wd(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 Bd(){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 zd(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=Bd.bind(i);return a.listener=n,i.wrapFn=a,a}function Ud(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):Gd(a,a.length)}function Hd(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 Gd(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}Object.defineProperty(Od,"defaultMaxListeners",{enumerable:!0,get:function(){return $d},set:function(e){if("number"!=typeof e||e<0||Rd(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");$d=e}}),Od.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},Od.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Rd(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},Od.prototype.getMaxListeners=function(){return Wd(this)},Od.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)Fd(s,this,t);else for(var u=s.length,l=Gd(s,u),d=0;d<u;++d)Fd(l[d],this,t);return!0},Od.prototype.addListener=function(e,t){return jd(this,e,t,!1)},Od.prototype.on=Od.prototype.addListener,Od.prototype.prependListener=function(e,t){return jd(this,e,t,!0)},Od.prototype.once=function(e,t){return Nd(t),this.on(e,zd(this,e,t)),this},Od.prototype.prependOnceListener=function(e,t){return Nd(t),this.prependListener(e,zd(this,e,t)),this},Od.prototype.removeListener=function(e,t){var n,i,a,r,o;if(Nd(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},Od.prototype.off=Od.prototype.removeListener,Od.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},Od.prototype.listeners=function(e){return Ud(this,e,!0)},Od.prototype.rawListeners=function(e){return Ud(this,e,!1)},Od.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Hd.call(e,t)},Od.prototype.listenerCount=Hd,Od.prototype.eventNames=function(){return this._eventsCount>0?kd(this._events):[]};var Vd=function(){function e(){o(this,e),this.emitter=new Od}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}}])}(),Kd=function(){return c(function e(){o(this,e),this.disableCampaignUpdates=!1,this.useLegacyPaywallFetch=!1,this.currentFormFactor=Cu()},[{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=Cu(),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=so.getDevice(),!this.disableCampaignUpdates){o.n=1;break}return _i.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}),so.setCampaignRules(ot,r),so.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),o.a(2,r)}},null,this,null,Promise)}},{key:"fetchCampaignRulesRaw",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(!this.disableCampaignUpdates){o.n=1;break}return _i.info("Campaign updates disabled by configuration. Skipping fetch."),o.a(2,{campaigns:[],fromNetwork:!1});case 1:if(null==(t=so.getDevice())||!t.id){o.n=3;break}return o.n=2,a(this.fetchCampaigns(t.id));case 2:r=o.v,o.n=5;break;case 3:return o.n=4,a(this.fetchAnonymousCampaigns());case 4:r=o.v;case 5:return i=null===(e=(n=r).campaigns)||void 0===e?void 0:e.filter(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))}),o.a(2,{campaigns:i,fromNetwork:n.fromNetwork})}},null,this,null,Promise)}},{key:"finalizeCampaignRules",value:function(e,t){var n=new Set([...t.map(e=>e.id),...Uu().map(e=>e.id)]),i=null==e?void 0:e.filter(e=>{return e.paywall?t.find(t=>t.id==e.paywall):!!e.flow&&(!!e.flow.object&&(null!==(i=e.flow.object.screens)&&void 0!==i?i:[]).every(e=>n.has(e)));var i});return so.setCampaignRules(ot,i),so.setApiCampaignSessionTimestamp(),this.invokeAvailableCampaignsResponseHandler(),i}},{key:"invokeAvailableCampaignsResponseHandler",value:function(){var e=Vd.getInstance().listeners(ui),t=Md();e.forEach(e=>e(t))}},{key:"getAnonymousCampaigns",value:function(e=Ae){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchAnonymousCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"getCampaigns",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.fetchCampaigns(e));case 1:return t.a(2,t.v.campaigns)}},null,this,null,Promise)}},{key:"fetchAnonymousCampaigns",value:function(e=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(Bu.instance.fetchAPI(t));case 2:return i=s.v,s.a(2,{campaigns:_d(null!==(n=i.results)&&void 0!==n?n:[],this.splitPosition,this.currentFormFactor),fromNetwork:!0});case 3:if(s.p=3,o=s.v,r=this.fallbackData()){s.n=4;break}throw _i.error(_o(o.status,t)),o;case 4:return s.a(2,{campaigns:r.results,fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fetchCampaigns",value:function(e){var t,n,i,r;return k(function(o){for(;;)switch(o.p=o.n){case 0:return t=`device/${e}/campaign_rules/`,o.p=1,o.n=2,a(Bu.instance.fetchAPI(t));case 2:return n=o.v,o.a(2,{campaigns:(null==n?void 0:n.results)||[],fromNetwork:!0});case 3:if(o.p=3,r=o.v,i=this.fallbackData()){o.n=4;break}throw _i.error(_o(r.status,t)),r;case 4:return o.a(2,{campaigns:i.results||[],fromNetwork:!1})}},null,this,[[1,3]],Promise)}},{key:"fallbackData",value:function(){var e=so.getCampaignRules(ot)||so.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 Yd(e,t){return Sr(e,t)}Kd.instance=new Kd;var Xd=function(){return c(function e(){o(this,e)},[{key:"createOrUpdateDevice",value:function(e,t,n){var i=so.getDevice();if(null==i||!i.id){var a,r=m({},e,{id:null!==(a=null!=t?t:this.getAnonymousUUID())&&void 0!==a?a:Iu()});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}so.setDevice(n),r.n=3;break;case 2:return _i.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 uo)){r.n=5;break}return _i.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)&&so.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=so.getDevice())&&i.id){o.n=1;break}throw new fo;case 1:return o.n=2,a(this.requestAPIData(`device/${i.id}/`,n,"PATCH"));case 2:return(r=o.v)&&so.setDevice(r),o.a(2,r)}},null,this,null,Promise)}},{key:"requestAPIData",value:function(e,t,n="POST",i=jn,r){var o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:return u.p=0,u.n=1,a(Bu.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 mo)){u.n=3;break}throw s;case 3:if(!("device/"===e&&s instanceof uo)){u.n=4;break}throw s;case 4:if(o=so.getDevice()){u.n=5;break}return _i.error(_o(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 Yd(i,e)}},{key:"getOrCreateAnonymousUUID",value:function(){var e=so.getAnonymousUUID();return e||(e=Iu(),so.setAnonymousUUID(e)),e}},{key:"getAnonymousUUID",value:function(){var e=so.getAnonymousUUID();return e?(so.clearAnonymousUUID(),e):null}}])}();Xd.instance=new Xd;var qd=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(!tu(Pe.THIRD_PARTY_TRANSACTIONS)){r.n=1;break}return r.a(2,[]);case 1:return r.p=1,r.n=2,a(Bu.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 _i.error(_o(i.status,"products/")),i;case 4:return null!==(e=n)&&void 0!==e&&e.results&&so.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=so.getProducts(ht)||so.getProducts(Pt);return e?{count:e.length,results:e}:null}}])}();qd.instance=new qd;var Jd=3,Qd=200,Zd=2e3,ec=5e3,tc=2e4,nc=new Set([408,425,429]),ic=new Set(["ECONNRESET","ECONNREFUSED","ENOTFOUND","ETIMEDOUT"]),ac=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t,[`CDN fetch failed with non-retryable status ${e} for ${n}`])).name="NonRetryableHttpError",i.status=e,i.url=n,i}return p(t,e),c(t)}(M(Error)),rc=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t,[`CDN fetch exhausted ${n} attempts for ${e}${void 0!==i?` (last status ${i})`:""}`])).name="RetryExhaustedError",a.url=e,a.attempts=n,a.lastStatus=i,a}return p(t,e),c(t)}(M(Error));function oc(e,t){if("number"==typeof t)return nc.has(t)||t>=500;if(e&&"object"==typeof e){var n=e;if("AbortError"===n.name)return!0;if(n.code&&ic.has(n.code))return!0;if(e instanceof TypeError)return!0}return!1}function sc(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(fu(e,{method:"GET"},"cdn",()=>fetch(e,{signal:n.signal})));case 2:return r.a(2,r.v);case 3:return r.p=3,clearTimeout(i),r.f(3);case 4:return r.a(2)}},null,null,[[1,,3,4]],Promise)}var uc=e=>new Promise(t=>setTimeout(t,e));function lc(e,t={}){var n,i,r;return k(function(o){for(;;)switch(o.n){case 0:return o.n=1,a(dc(e,t));case 1:return n=o.v,i=n.data,r=n.retryCount,o.a(2,{data:JSON.parse(i),retryCount:r})}},null,null,null,Promise)}function dc(e,t={}){var n,i,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,S,E,P,T,_,M,A,D,x,C,I,L,F;return k(function(k){for(;;)switch(k.p=k.n){case 0:d=null!==(n=t.maxAttempts)&&void 0!==n?n:Jd,c=null!==(i=t.baseDelayMs)&&void 0!==i?i:Qd,h=null!==(r=t.maxDelayMs)&&void 0!==r?r:Zd,m=null!==(o=t.budgetMs)&&void 0!==o?o:tc,f=null!==(s=t.timeoutMs)&&void 0!==s?s:ec,v=null!==(u=t.randomFn)&&void 0!==u?u:Math.random,p=null!==(l=t.sleepFn)&&void 0!==l?l:uc,g=ru(),y=ou(),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),_=T*(v()-.5),M=Math.max(0,m-P),A=Math.min(Math.max(0,T+_),M),k.n=3,a(p(A));case 3:if(!(Date.now()-b>=m)){k.n=4;break}return k.a(3,16);case 4:return k.p=4,(g||y)&&_i.debug(`[HTTP] GET ${e} (cdn attempt ${w+1}/${d})`),k.n=5,a(sc(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,_i.debug(`[HTTP] Response ${D.status}: ${x}`);case 7:if(S=D.status,!oc(void 0,D.status)){k.n=8;break}return w++,k.a(3,1);case 8:throw new ac(D.status,e);case 9:if(!y){k.n=11;break}return k.n=10,a(D.clone().text());case 10:C=k.v,_i.debug(`[HTTP] Response ${D.status}: ${C}`);case 11:return k.n=12,a(D.text());case 12:return I=k.v,L=w,k.a(2,{data:I,retryCount:L});case 13:if(k.p=13,!((F=k.v)instanceof ac)){k.n=14;break}throw F;case 14:if(!oc(F)){k.n=15;break}return E=F,w++,k.a(3,1);case 15:throw F;case 16:if(void 0!==S||void 0===E){k.n=17;break}throw E;case 17:throw new rc(e,w,S);case 18:return k.a(2)}},null,null,[[4,13]],Promise)}function cc(e){var t=e.split("#")[0].split("?")[1];if(t)for(var n,i=h(t.split("&"));!(n=i()).done;){var a=n.value,r=a.indexOf("=");if("content_hash"===(-1===r?a:a.slice(0,r)))return(-1===r?"":a.slice(r+1))||void 0}}function hc(e){var t=e.split(/[?#]/)[0],n=/\/paywall\/([^/]+)/.exec(t);return n?n[1]:void 0}var mc=function(){return c(function e(t=io){o(this,e),this.bodyCache=t},[{key:"fetchPaywalls",value:function(){var e,t,n;return k(function(i){for(;;)switch(i.n){case 0:if(null!=(e=so.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&&so.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(Bu.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 _i.error(_o(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(Bu.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 _i.error(_o(r.status,n)),r;case 4:return o.a(2,(null===(t=i)||void 0===t?void 0:t.results)||[])}},null,this,[[1,3]],Promise)}},{key:"resolvePaywallsByUrls",value:function(e){var t,n,i,r,o;return k(function(s){for(;;)switch(s.n){case 0:return t=[...new Set(e)],n=nu(),this.bodyCache.evaluateTtl(n),s.n=1,a(Promise.all(t.map(e=>this.resolvePaywall(e,n))));case 1:return i=s.v,r={paywalls:[],urls:t.length,hashed:t.filter(e=>void 0!==cc(e)).length,cacheHits:0,fetched:0,cacheAfterFetchFailure:0,failed:0,retryCount:0},o=new Map,i.forEach((e,n)=>{r.retryCount+=e.retryCount,e.paywall?(o.set(e.paywall,t[n]),"cacheHit"===e.paywall.fetchSource?r.cacheHits+=1:"cacheAfterFetchFailure"===e.paywall.fetchSource?r.cacheAfterFetchFailure+=1:r.fetched+=1):r.failed+=1}),r.paywalls=this.validatePaywalls([...o.keys()]),r.paywalls.length>0&&so.setApiPaywallsFromBodyCache(r.paywalls.map(e=>o.get(e))),s.a(2,r)}},null,this,null,Promise)}},{key:"seedFromInitialConfig",value:function(e,t){var n=new Map(t.map(e=>[e.id,e]));this.bodyCache.evaluateTtl(nu());for(var i,a=0,r=0,o=h(new Set(function(e){for(var t,n=[],i=h(e);!(t=i()).done;)for(var a,r=h(null!==(o=t.value.segments)&&void 0!==o?o:[]);!(a=r()).done;){var o,s,u=a.value;u.paywall_url&&n.push(u.paywall_url),u.page_urls&&n.push(...Object.values(u.page_urls)),null!==(s=u.flow)&&void 0!==s&&s.page_urls&&n.push(...Object.values(u.flow.page_urls))}return n}(e)));!(i=o()).done;){var s=i.value,u=cc(s),l=hc(s),d=l?n.get(l):void 0;u&&d&&(a+=1,this.bodyCache.seedIfAbsent(s,u,JSON.stringify(d))&&(r+=1))}_i.info(`Paywall body cache seeded from initial config: seeded=${r}, candidates=${a}`)}},{key:"resolvePaywall",value:function(e,t){var n,i,r,o,s,u,l;return k(function(d){for(;;)switch(d.p=d.n){case 0:if(!(n=cc(e))){d.n=1;break}if(!(i=this.decodeCached(e,t))){d.n=1;break}return d.a(2,{paywall:vc(i,"cacheHit",n),retryCount:0});case 1:return r=0,d.p=2,d.n=3,a(this.fetchPaywallText(e));case 3:if(o=d.v,r=o.retryCount,!(s=fc(o.data))){d.n=4;break}return this.bodyCache.store(e,n,o.data),d.a(2,{paywall:vc(s,"fetched",n),retryCount:r});case 4:_i.error(`Paywall body from ${e} is not a decodable paywall`),d.n=6;break;case 5:d.p=5,l=d.v,_i.error(`Failed to fetch individual paywall: ${l}`);case 6:if(!(u=this.decodeCached(e,t))){d.n=7;break}return _i.warn(`Serving the cached body for ${e} after fetch failure (within campaign_cache_ttl)`),d.a(2,{paywall:vc(u,"cacheAfterFetchFailure",n),retryCount:r});case 7:return d.a(2,{retryCount:r})}},null,this,[[2,5]],Promise)}},{key:"decodeCached",value:function(e,t){var n=this.bodyCache.validEntry(e,t);if(n){var i=fc(n.body);return i||(_i.warn(`Deleting an undecodable cached paywall body for ${e}`),this.bodyCache.remove(e)),i}}},{key:"fetchPaywallText",value:function(e){var t;return null!==(t=so.getNamiConfig())&&void 0!==t&&null!==(t=t.namiCommands)&&void 0!==t&&t.includes(_n)?(_i.warn(`${_n}: failing the fetch for ${e} before the network`),Promise.reject(new rc(e,0))):dc(e)}},{key:"validatePaywalls",value:function(e){return e.filter(e=>{var t,n=null===(t=e.template)||void 0===t?void 0:t.pages;return!(!Array.isArray(n)||0===n.length)||(_i.warn(`Dropping paywall "${e.id}" from cache: template.pages is missing or empty`),!1)})}},{key:"fallbackData",value:function(){var e=so.getPaywalls(ut)||so.getPaywalls(St);return e?{count:e.length,results:e}:null}}])}();function fc(e){try{var t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:void 0}catch(e){return}}function vc(e,t,n){return m({},e,{fetchSource:t},n?{contentHash:n}:{})}mc.instance=new mc;var pc=function(){return c(function e(){o(this,e)},[{key:"fetchConfig",value:function(){var e,t,n,i,r;return k(function(o){for(;;)switch(o.n){case 0:if(null===(e=so.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e||!e.includes(Pn)){o.n=1;break}throw new uo(ei,Pn);case 1:return i=null===(t=so.getNamiConfig())||void 0===t?void 0:t.appPlatformID,o.n=2,a(Bu.instance.fetchAPI("config/",Hn,0));case 2:return r=o.v,(null===(n=so.getNamiConfig())||void 0===n?void 0:n.appPlatformID)===i?so.setAppConfig(at,r):_i.debug("Discarding an app config response for a platform that is no longer configured"),o.a(2,r)}},null,null,null,Promise)}},{key:"fetchConfigForStartup",value:function(e){var t,n,i,r,o,s;return k(function(u){for(;;)switch(u.p=u.n){case 0:if(!e){u.n=1;break}return u.a(2,this.startupOnInitialConfig());case 1:t=zn,i=1;case 2:if(!(i<=t)){u.n=7;break}return i>1&&_i.debug(`Retrying app config fetch (attempt ${i} of ${t})`),u.p=3,o=gc,u.n=4,a(this.fetchConfig());case 4:return u.a(2,o(u.v));case 5:u.p=5,s=u.v,n=s;case 6:i++,u.n=2;break;case 7:if(!(r=so.getAppConfig(at))){u.n=9;break}if(yc(r)){u.n=8;break}return u.a(2,{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"});case 8:return _i.info(`App config fetch failed after ${t} attempts - continuing on the cached config`),u.a(2,{usable:!0});case 9:return u.a(2,{usable:!1,reason:`app config fetch failed after ${t} attempts (${bc(n)}) and no initial or cached config is available`})}},null,this,[[3,5]],Promise)}},{key:"startupOnInitialConfig",value:function(){var e=so.getAppConfig(at);return this.fetchConfig().then(e=>{yc(e)||_i.warn("App config does not grant the 'sdk' capability - it takes effect from the next launch")},e=>{_i.info(`App config fetch failed (${bc(e)}). Initial config is available. Skipping retry.`)}),e&&!yc(e)?{usable:!1,reason:"the cached app config does not grant the 'sdk' capability"}:{usable:!0}}}])}();function gc(e){return yc(e)?{usable:!0}:{usable:!1,reason:"app config does not grant the 'sdk' capability"}}function yc(e){var t,n;return null!==(t=null===(n=e.capabilities)||void 0===n?void 0:n.includes(Pe.SDK))&&void 0!==t&&t}function bc(e){var t=null==e?void 0:e.status;return"number"==typeof t?`HTTP ${t}`:e instanceof Error?e.message:String(e)}pc.instance=new pc;var wc=null;function kc(){wc&&wc.setInMemoryAnonymousMode(!1)}function Sc(){return!!so.getAnonymousMode()||!!wc&&wc.isInMemoryAnonymousMode()}var Ec=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(!Sc()){t.n=1;break}return _i.debug("Skipping session start call - anonymous mode"),t.a(2);case 1:return t.p=1,t.n=2,a(Bu.instance.startSession(new Date));case 2:t.n=4;break;case 3:t.p=3,e=t.v,_i.error("error on start session: ",e);case 4:return t.a(2)}},null,null,[[1,3]],Promise)}}])}();Ec.instance=new Ec;var Pc=function(){return c(function e(){o(this,e)},null,[{key:"allPurchases",value:function(){return[]}}])}();Pc.instance=new Pc;var Tc={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"}},_c="en";function Mc(e){var t,n,i=function(e){if(!e)return _c;var t=e.trim();if(Tc[t])return t;var n=t.toLowerCase(),i=n.split("-")[0];return Tc[i]?i:"zh"===i?n.includes("tw")||n.includes("hk")?"zh-TW":"zh-CN":_c}(so.getLanguageCode()),a=null!==(t=Tc[i])&&void 0!==t?t:Tc[_c];return null!==(n=null==a?void 0:a[e])&&void 0!==n?n:e}function Ac(e){if("subscription"===(null==e?void 0:e.product_type)){var t=xc(e);if(t.length>0)return t[0].billingPeriod}return null}function Dc(e){var t=function(e){if(!e)return[];var t=e.offers.filter(e=>"promo"===e.offer_type);return Cc(t,e.subscription_period)}(e).find(e=>0===e.priceAmountMicros);return(null==t?void 0:t.billingPeriod)||null}function xc(e){return e?Cc(e.offers.filter(e=>"default"===e.offer_type),e.subscription_period):[]}function Cc(e,t){return e.map(e=>Ic(e,t))}function Ic(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:Rc(m).format(h)}}function Lc(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=Mc(o),l=Mc(s);return a||u!==o||(u=Mc(`${r}_abbrev`)),a||l!==s||(l=Mc(`${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 Fc(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 Rc(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 Oc=(e,t,n)=>e&&t&&n?n.format(e-t):null,$c=(e,t,n,i)=>{if(e&&t&&n&&i){var a=100*(1-e/(n/i*t));return`${Math.round(a)}%`}return null},Nc=(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)}},Wc=e=>Bc(e.priceAmountMicros)/jc(e.billingPeriod),jc=e=>{var t=parseInt(e[1]);return e.includes("Y")&&(t*=12),t},Bc=e=>e/1e6;function zc(e){return parseFloat((Math.round(e)/100).toFixed(2))}var Uc=(e,t,n=[])=>({price:()=>Gc(e),name:()=>null==e?void 0:e.name,title:()=>null==e?void 0:e.name,description:()=>null==e?void 0:e.description,duration:()=>Vc(e),durationSingular:()=>Vc(e,!0),period:()=>Vc(e,!1,!0),periodNumber:()=>Vc(e,!1,!1,!0),freeTrialDuration:()=>Kc(e),freeTrialDurationSingular:()=>Kc(e,!0),freeTrialPeriod:()=>Kc(e,!1,!0),freeTrialPeriodNumber:()=>Kc(e,!1,!1,!0),pricePerMonth:()=>Yc(e),pricePerMonthRounded:()=>Yc(e,!0),periodInMonths:()=>Xc(e),durationInMonths:()=>qc(e),durationInMonthsSingular:()=>qc(e,!0),periodNumberInMonths:()=>Jc(e),percentagePriceDifferenceFromSku:()=>Qc(e,t,n),priceDifferenceFromSku:()=>Zc(e,t,n),promoEligible:()=>null===eh(e)&&null!==th(e,t),freeTrialEligible:()=>null!==eh(e),promo:()=>{var n;return null===(n=th(e,t))||void 0===n?void 0:n.offer_ref_id},promoCode:()=>"XXXXX",promoPrice:()=>{var n;return null===(n=nh(e,t))||void 0===n?void 0:n.formattedPrice},promoPeriod:()=>ih(e,t,!1,!0),promoPeriodNumber:()=>ih(e,t,!1,!1,!0),promoDuration:()=>ih(e,t),promoDurationSingular:()=>ih(e,t,!0),introEligible:()=>!1,pricePerDay:()=>ah(e),pricePerWeek:()=>rh(e),pricePerWeekRounded:()=>rh(e,!0),introductoryPrice:()=>oh(e,t),introductoryPeriod:()=>sh(e,t,!1,!0),introductoryPeriodNumber:()=>sh(e,t,!1,!1,!0),introductoryDuration:()=>sh(e,t),introductoryDurationSingular:()=>sh(e,t,!0),introductoryPricePerMonth:()=>uh(e,t),introductoryPricePerMonthRounded:()=>uh(e,t,!0),durationAbbrev:()=>Vc(e,!1,!1,!1,!0),freeTrialDurationAbbrev:()=>Kc(e,!1,!1,!1,!0),introductoryDurationAbbrev:()=>sh(e,t,!1,!1,!1,!0),promoDurationAbbrev:()=>ih(e,t,!1,!1,!1,!0),promoDurationPhase2Abbrev:()=>ih(e,t,!0,!0,!1,!0),durationInMonthsAbbrev:()=>qc(e,!1,!1,!1,!0),durationSingularAbbrev:()=>Vc(e,!0,!1,!1,!0),freeTrialDurationSingularAbbrev:()=>Kc(e,!0,!1,!1,!0),introductoryDurationSingularAbbrev:()=>sh(e,t,!0,!1,!1,!0),promoDurationSingularAbbrev:()=>ih(e,t,!0,!1,!1,!0),promoDurationSingularPhase2Abbrev:()=>ih(e,t,!0,!0,!1,!0),durationInMonthsSingularAbbrev:()=>qc(e,!0,!1,!1,!0),periodAbbrev:()=>Vc(e,!1,!0,!1,!0),freeTrialPeriodAbbrev:()=>Kc(e,!1,!0,!1,!0),introductoryPeriodAbbrev:()=>sh(e,t,!1,!0,!1,!0),promoPeriodAbbrev:()=>ih(e,t,!1,!0,!1,!0),promoPeriodPhase2Abbrev:()=>ih(e,t,!1,!0,!0,!0),periodInMonthsAbbrev:()=>qc(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?Mc("nami_weekly"):2===u?Mc("nami_biweekly"):null:s>0?Mc(1===s?"nami_monthly":2===s?"nami_bimonthly":3===s?"nami_quarterly":6===s?"nami_biannually":12===s?"nami_yearly":"nami_monthly"):o>0?Mc("nami_yearly"):null}(Ac(e)),iso_subscription_duration:()=>hh(e),bill_term:()=>ch(e),invalid:()=>!1,unavailable:()=>!1}),Hc=(e,t,n,i=[])=>{if(!t)return null;var a=Uc(t,n,i);return a[e]?a[e]():null},Gc=e=>{var t=xc(e);return t&&t.length?t[0].formattedPrice:null},Vc=(e,t,n,i,a)=>Lc(Ac(e),t,n,i,a),Kc=(e,t,n,i,a)=>Lc(Dc(e),t,n,i,a),Yc=(e,t)=>{var n=xc(e);if(!n||0===n.length)return null;var i=Wc(n[0]);return i?Rc(n[0].priceCurrencyCode).format(t?Math.round(i):i):null},Xc=(e,t)=>{var n=xc(e);if(!n||0===n.length)return null;var i=n[0].billingPeriod;return Fc(i)?Lc("P1Y"===i?"P12M":i,!1,!1,!1,t):null},qc=(e,t,n,i,a)=>{var r=xc(e);if(!r||0===r.length)return null;var o=r[0].billingPeriod;return Fc(o)?Lc("P1Y"===o?"P12M":o,t,n,i,a):null},Jc=e=>{if(!e)return 0;var t=xc(e);return t&&t.length?jc(t[0].billingPeriod):0},Qc=(e,t,n=[])=>{var i,a=xc(e);if(!a||0===a.length)return null;var r=null===(i=Nc(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return $c(zc(a[0].priceAmountMicros),Jc(e));var o=xc(r);return $c(zc(a[0].priceAmountMicros),Jc(e),(null==o?void 0:o.length)>0?zc(o[0].priceAmountMicros):0,Jc(r))},Zc=(e,t,n=[])=>{var i,a=xc(e);if(!a||0===a.length)return null;var r=null===(i=Nc(n,null!=t?t:""))||void 0===i?void 0:i.product_details;if(!t||!r)return Oc(Wc(a[0]));var o=xc(r);return Oc(Wc(a[0]),Wc(o[0]),Rc(o[0].priceCurrencyCode))},eh=e=>Dc(e),th=(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},nh=(e,t)=>e?Ic(th(e,t),e.subscription_period):null,ih=(e,t,n,i,a,r)=>{var o=nh(e,t);return Lc((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},ah=(e,t)=>{var n=xc(e);if(!n||0===n.length)return null;var i,a,r=Bc(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=jc(i))?30.437*a:1);return r?Rc(n[0].priceCurrencyCode).format(r):null},rh=(e,t)=>{var n=xc(e);if(!n||0===n.length)return null;var i,a,r=Bc(n[0].priceAmountMicros)/(i=n[0].billingPeriod,(a=jc(i))?52*a/12:1);return r?Rc(n[0].priceCurrencyCode).format(t?Math.round(r):r):null},oh=(e,t)=>{var n=lh(e,t);return(null==n?void 0:n.formattedPrice)||null},sh=(e,t,n,i,a,r)=>{var o=lh(e,t);return Lc((null==o?void 0:o.billingPeriod)||null,n,i,a,r)},uh=(e,t,n)=>{var i=lh(e,t);if(i){var a=Bc(i.priceAmountMicros),r=jc(i.billingPeriod),o=n?Math.round(a/r):a/r;return Rc(i.priceCurrencyCode).format(o)}},lh=(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],Ic(n,e.subscription_period)):null;var n},dh={P1D:"daily",P1W:"weekly",P1M:"monthly",P3M:"quarterly",P6M:"semiannual",P1Y:"annual"},ch=e=>{var t=hh(e);return t&&dh[t]||null},hh=e=>{var t=Ac(e);return t?"P7D"===t?"P1W":t:null};function mh(e,t,n,i){var a=n.flatMap(e=>e.products).find(e=>e.id===t.selectedProducts[t.currentGroupId]);return vh(yh(e,null==a?void 0:a.sku_ref_id),a,i)}function fh(e,t,n){var i,a,r=null!==(i=null===(a=t.find(e=>e.id===n))||void 0===a?void 0:a.products)&&void 0!==i?i:[];return r.forEach(t=>{t.product_details=yh(e,t.sku_ref_id||""),t.variables=vh(t.product_details,t,r)}),r}function vh(e,t,n){if(!t)return{};var i=function(e){if(!Array.isArray(e))return e;var t=e.filter(e=>e&&"object"==typeof e&&"entitlement_ref_id"in e).map(e=>e.entitlement_ref_id);return t.length?t:e}(t.entitlements),a=t.variables;if(!a)return m({},t,{entitlements:i});Object.keys(a).forEach(t=>{if("string"==typeof(r=a[t])&&r.includes(wi)){var i=ph(a[t],e,n);a[t]=function(e){if(!e||e.includes("null")||e.includes("undefined"))return"";if(/\$\{\s*(launch\.customAttributes\.|sku\.)\w+\s*}/.test(e))return"";return e}(i)}var r});var r={};return Object.keys(Uc({})).forEach(t=>{if(void 0===a[t]){var i=Hc(t,e,void 0,n);null!==i&&(r[t]=i)}}),m({},t,r,a,{entitlements:i})}var ph=(e,t,n)=>e.replace(pi,(i,a)=>{var r,o,s,u,l=(null===(r=pi.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 Hc(a,t,d,n)});function gh(e,t){return t.flatMap(e=>e.products).some(t=>1==Hc("freeTrialEligible",yh(e,t.sku_ref_id)))}function yh(e=[],t=""){return e.find(e=>e.product_ref_id===t)||null}var bh=function(){try{var e=ia(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var wh=Object.prototype.hasOwnProperty;function kh(e,t,n){var i=e[t];wh.call(e,t)&&Ai(i,n)&&(void 0!==n||t in e)||function(e,t,n){"__proto__"==t&&bh?bh(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}(e,t,n)}var Sh="object"==typeof e&&e&&!e.nodeType&&e,Eh=Sh&&"object"==typeof module&&module&&!module.nodeType&&module,Ph=Eh&&Eh.exports===Sh?Fi.Buffer:void 0;Ph&&Ph.allocUnsafe;var Th=qa(Object.getPrototypeOf,Object),_h=Object.prototype.hasOwnProperty;function Mh(e){var t=new e.constructor(e.byteLength);return new pa(t).set(new pa(e)),t}var Ah=/\w*$/;var Dh=Ri?Ri.prototype:void 0,xh=Dh?Dh.valueOf:void 0;function Ch(e,t,n){var i,a,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return Mh(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return r=Mh((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=Mh(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,Ah.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return i=e,xh?Object(xh.call(i)):{}}}var Ih=Object.create,Lh=function(){function e(){}return function(t){if(!Ui(t))return{};if(Ih)return Ih(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Fh=Ua&&Ua.isMap,Rh=Fh?Wa(Fh):function(e){return Ta(e)&&"[object Map]"==pr(e)};var Oh=Ua&&Ua.isSet,$h=Oh?Wa(Oh):function(e){return Ta(e)&&"[object Set]"==pr(e)},Nh="[object Arguments]",Wh="[object Function]",jh="[object Object]",Bh={};function zh(e,t,n,i,a,r){var o;if(void 0!==o)return o;if(!Ui(e))return e;var s=ka(e);if(s)o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_h.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var u=pr(e),l=u==Wh||"[object GeneratorFunction]"==u;if(Fa(e))return e.slice();if(u==jh||u==Nh||l&&!a)o=l?{}:function(e){return"function"!=typeof e.constructor||Xa(e)?{}:Lh(Th(e))}(e);else{if(!Bh[u])return a?e:{};o=Ch(e,u)}}r||(r=new ca);var d=r.get(e);if(d)return d;r.set(e,o),$h(e)?e.forEach(function(i){o.add(zh(i,t,n,i,e,r))}):Rh(e)&&e.forEach(function(i,a){o.set(a,zh(i,t,n,a,e,r))});var c=s?void 0:er(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]),kh(o,a,zh(i,t,n,a,e,r))}),o}Bh[Nh]=Bh["[object Array]"]=Bh["[object ArrayBuffer]"]=Bh["[object DataView]"]=Bh["[object Boolean]"]=Bh["[object Date]"]=Bh["[object Float32Array]"]=Bh["[object Float64Array]"]=Bh["[object Int8Array]"]=Bh["[object Int16Array]"]=Bh["[object Int32Array]"]=Bh["[object Map]"]=Bh["[object Number]"]=Bh[jh]=Bh["[object RegExp]"]=Bh["[object Set]"]=Bh["[object String]"]=Bh["[object Symbol]"]=Bh["[object Uint8Array]"]=Bh["[object Uint8ClampedArray]"]=Bh["[object Uint16Array]"]=Bh["[object Uint32Array]"]=!0,Bh["[object Error]"]=Bh[Wh]=Bh["[object WeakMap]"]=!1;var Uh=e=>"object"==typeof e&&null!==e&&"handleEvent"in e,Hh=(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){}}},Gh=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;Hh(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;Hh(e,"currentTarget",this),"function"==typeof c.listener?c.listener.call(this,e):Uh(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 Hh(e,"currentTarget",null),!e.defaultPrevented}}])}(),Vh=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Kh=/^([01]?\d|2[0-3]):([0-5]\d)$/,Yh=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/,Xh={equals:(e,t)=>e===t,gt:(e,t)=>e>t,gte:(e,t)=>e>=t,lt:(e,t)=>e<t,lte:(e,t)=>e<=t},qh=e=>Object.prototype.hasOwnProperty.call(Xh,e),Jh=e=>"string"==typeof e.value&&e.value.startsWith(In)&&e.value.endsWith("}"),Qh=e=>{if("string"!=typeof e||!Yh.test(e))return null;var t=new Date(e);return Number.isNaN(t.getTime())?null:t},Zh=e=>{if("string"!=typeof e)return null;var t=e.split("@");return 2===t.length&&t[0]&&(e=>{if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch(e){return!1}})(t[1])?{value:t[0],zone:t[1]}:null},em=(e,t)=>{try{var n=wd(e,t,"EEEE|HH:mm",{locale:ol}).split("|"),i=n[0],a=n[1].split(":").map(Number);return{dayOfWeek:i,minutes:60*a[0]+a[1]}}catch(e){return null}},tm=e=>{var t=Zh(e);return t&&Vh.includes(t.value)?{day:t.value,zone:t.zone}:null},nm=(e,t,n)=>{if("in"===e){if(!Array.isArray(t)||0===t.length)return!1;var i=t.map(tm);return!i.some(e=>null===e)&&i.some(e=>(({day:e,zone:t})=>{var i;return(null===(i=em(n,t))||void 0===i?void 0:i.dayOfWeek)===e})(e))}if("equals"!==e&&"notEquals"!==e)return!1;var a=tm(t);if(!a)return!1;var r=em(n,a.zone);return!!r&&("equals"===e?r.dayOfWeek===a.day:r.dayOfWeek!==a.day)},im=(e,t)=>{if(!Jh(e))return null;if(Number.isNaN(t.getTime()))return!1;switch(e.value.slice(In.length,-1)){case"dayOfWeek":return nm(e.operator,e.expected,t);case"timeOfDay":return((e,t,n)=>{if(!qh(e))return!1;var i=Zh(t),a=i&&Kh.exec(i.value);if(!i||!a)return!1;var r=em(n,i.zone);return!!r&&Xh[e](r.minutes,60*Number(a[1])+Number(a[2]))})(e.operator,e.expected,t);case"now":return((e,t,n)=>{if(!qh(e))return!1;var i=Qh(t);return null!==i&&Xh[e](n.getTime(),i.getTime())})(e.operator,e.expected,t);default:return!1}},am=()=>{var e,t=null===(e=so.getNamiConfig())||void 0===e||null===(e=e.namiCommands)||void 0===e?void 0:e.find(e=>e.startsWith(xn));if(void 0===t)return new Date;var n=(e=>e.startsWith(xn)?Qh(e.slice(xn.length)):null)(t);return null===n?(_i.warn(`Ignoring invalid ${t}: expected ISO-8601 with an offset, e.g. ${xn}2026-09-13T13:00:00-04:00`),new Date):n},rm=[];var om={paywallId:"",livePaywalls:[],selectedPaywall:void 0,selectedCampaign:void 0,campaignRules:[],anySkuHasTrialOffer:!1,anySkuHasIntroOffer:!1,anySkuHasPromoOffer:!1,isLoggedIn:!1,darkMode:!1,safeAreaTop:0,safeAreaBottom:0,safeAreaLeft:0,safeAreaRight:0,groups:[],selectedProducts:{},formStates:{},formFieldErrors:{},formFieldValidators:{},timerStates:{},currentPage:"page1",pageHistory:["page1"],currentGroupId:"",currentGroupName:"",fullScreenPresentation:!1,launch:{productGroups:[],customAttributes:{},customObject:{},currentGroup:""},sku:{},orientation:"portrait",focusedState:!1,platformId:"",mediaList:{},skuItems:[],customer:{},hasNotch:!1,purchaseInProgress:!1,formFactor:"desktop",slides:{},userInteractionEnabled:!0,currentSlideIndex:void 0},sm=function(t){function n(e,t,i){var a;o(this,n),(a=r(this,n)).subscribers=new Set,a.productDetails=rm,a.filteredSkuMenus=[],a.state=zh(om,5);var s=so.getNamiProfile();return a.state.isLoggedIn=!(null==s||!s.externalId),a.state.customer=m({},a.state.customer,so.getAllCustomerAttributesMap()),a.setPaywall(e,t,i),a.subscribers=new Set,a}return p(n,t),c(n,[{key:"onStateChanged",value:function(){}},{key:"subscribe",value:function(e){return this.subscribers.add(e),()=>this.unsubscribe(e)}},{key:"unsubscribe",value:function(e){this.subscribers.delete(e)}},{key:"emitEvent",value:function(e,t){this.dispatchEvent(function(e,t){if("function"==typeof Event){var n=new Event(e);return Object.defineProperty(n,"detail",{configurable:!0,enumerable:!1,value:t,writable:!1}),n}return{type:e,detail:t,bubbles:!1,cancelBubble:!1,cancelable:!1,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!1,returnValue:!0,srcElement:null,target:null,timeStamp:Date.now(),NONE:0,CAPTURING_PHASE:1,AT_TARGET:2,BUBBLING_PHASE:3,composedPath:()=>[],initEvent:()=>{},preventDefault:()=>{},stopImmediatePropagation:()=>{},stopPropagation:()=>{}}}(e,t))}},{key:"onEvent",value:function(e,t){var n=e=>t(e.detail);return this.addEventListener(e,n),()=>this.removeEventListener(e,n)}},{key:"setState",value:function(e){this.state=e,this.subscribers.forEach(e=>e()),this.onStateChanged()}},{key:"setProductDetails",value:function(e){this.productDetails=e}},{key:"getProductDetails",value:function(){return this.productDetails}},{key:"setCurrentGroupData",value:function(e,t){var n=mh(this.productDetails,this.state,this.filteredSkuMenus,fh(this.productDetails,this.filteredSkuMenus,this.state.currentGroupId));this.setState(m({},this.state,{currentGroupId:e,currentGroupName:t,sku:n}))}},{key:"setFormState",value:function(e,t){this.setState(m({},this.state,{formStates:m({},this.state.formStates,{[e]:t})}))}},{key:"registerFormFieldValidator",value:function(e,t){this.setState(m({},this.state,{formFieldValidators:m({},this.state.formFieldValidators,{[e]:t})}))}},{key:"getFormFieldValidators",value:function(){return this.state.formFieldValidators}},{key:"setFormFieldErrors",value:function(e){this.setState(m({},this.state,{formFieldErrors:m({},e)}))}},{key:"setFormFieldError",value:function(e,t){this.setState(m({},this.state,{formFieldErrors:m({},this.state.formFieldErrors,{[e]:t})}))}},{key:"clearFormFieldError",value:function(e){var t=m({},this.state.formFieldErrors);delete t[e],this.setState(m({},this.state,{formFieldErrors:t}))}},{key:"getFormFieldErrors",value:function(){return this.state.formFieldErrors}},{key:"setTimerState",value:function(e,t,n,i){this.setState(m({},this.state,{timerStates:m({},this.state.timerStates,{[e]:{remainingSeconds:t,savedAt:n,hasEmittedCompletion:i}})}))}},{key:"getTimerState",value:function(e){return this.state.timerStates[e]}},{key:"getCurrentGroupId",value:function(){return this.state.currentGroupId}},{key:"getCurrentGroupName",value:function(){return this.state.currentGroupName}},{key:"setCurrentFormId",value:function(e,t){var n=this.state.formStates||{},i=m({},n,{[e]:t||!n[e]});this.setState(m({},this.state,{formStates:i}))}},{key:"getCurrentFormId",value:function(e){return this.state.formStates[e]}},{key:"setSelectedProducts",value:function(e){var t=m({},this.state,{selectedProducts:e}),n=mh(this.productDetails,t,this.filteredSkuMenus,fh(this.productDetails,this.filteredSkuMenus,t.currentGroupId));this.setState(m({},t,{sku:n}))}},{key:"selectedProducts",value:function(){return this.state.selectedProducts}},{key:"clearSelectedProduct",value:function(e){var t=this.state.selectedProducts||{};if(e&&null!=t[e]){var n=m({},t);delete n[e],this.setSelectedProducts(n)}}},{key:"setPaywall",value:function(e,t,n){var i,a,r,o,s,u=m({},this.state,{formFactor:Cu(),selectedPaywall:e,selectedCampaign:n});(u=m({},u,null===(i=e.template)||void 0===i?void 0:i.initialState)).platformId=null!==(a=null===(r=so.getNamiConfig())||void 0===r?void 0:r.appPlatformID)&&void 0!==a?a:"",u.systemTimeSnapshot=am().getTime();var l,d,c=function(e,t,n=[]){var i,a,r=null!==(i=t.productGroups)&&void 0!==i&&i.length?t.productGroups:n.map(e=>e.ref);return{customAttributes:t.customAttributes,productGroups:r,customObject:m({},e.customObject,t.customObject),currentGroup:null!==(a=t.currentGroup)&&void 0!==a?a:""}}(u.launch,t,e.sku_menus);(this.filteredSkuMenus=null!==(o=e.sku_menus)&&void 0!==o?o:[],c.productGroups.length&&(this.filteredSkuMenus=this.filteredSkuMenus.filter(e=>c.productGroups.includes(e.ref))),""!==c.currentGroup&&u.groups.length&&null!==(s=e.template)&&void 0!==s&&s.displaySingleGroup)&&(u.currentGroupId=null!==(l=null===(d=u.groups.find(e=>e.ref==c.currentGroup))||void 0===d?void 0:d.id)&&void 0!==l?l:"");if(""===u.currentGroupId&&1===this.filteredSkuMenus.length){var h,f=u.groups.find(e=>e.ref==this.filteredSkuMenus[0].ref);u.currentGroupId=null!==(h=null==f?void 0:f.id)&&void 0!==h?h:u.currentGroupId}var v=fh(this.productDetails,this.filteredSkuMenus,u.currentGroupId);u.skuItems=v,u.launch=c,u.anySkuHasTrialOffer=gh(this.productDetails,this.filteredSkuMenus),u.anySkuHasPromoOffer=function(e,t){return!gh(e,t)&&t.flatMap(e=>e.products).some(t=>1==Hc("promoEligible",yh(e,t.sku_ref_id)))}(this.productDetails,this.filteredSkuMenus),u.paywallId=e.id,u.sku=mh(this.productDetails,u,this.filteredSkuMenus,v),u.pageHistory=[u.currentPage],this.setState(u)}},{key:"getSelectedPaywall",value:function(){return this.state.selectedPaywall}},{key:"getSelectedCampaign",value:function(){return this.state.selectedCampaign}},{key:"getCurrentPlacementLabel",value:function(){var e,t;return null!==(e=this.state.selectedCampaign)&&void 0!==e&&e.value?this.state.selectedCampaign.value:null!==(t=this.flow)&&void 0!==t&&null!==(t=t.campaign)&&void 0!==t&&t.value?this.flow.campaign.value:void 0}},{key:"getPaywallActionEventData",value:function(){var t,n,i,a,r,o,s,u,l,d=this.state.selectedCampaign,c=this.state.selectedPaywall;return{paywallId:null!==(t=null==c?void 0:c.id)&&void 0!==t?t:"",paywallName:null!==(n=null==c?void 0:c.name)&&void 0!==n?n:"",campaignId:null!==(i=null==d?void 0:d.rule)&&void 0!==i?i:"",campaignName:null!==(a=null==d?void 0:d.name)&&void 0!==a?a:"",campaignType:null!==(r=null==d?void 0:d.type)&&void 0!==r?r:"",campaignLabel:null!==(o=null==d?void 0:d.value)&&void 0!==o?o:"",campaignUrl:(null==d?void 0:d.type)===e.NamiCampaignRuleType.URL&&null!==(s=null==d?void 0:d.value)&&void 0!==s?s:"",segmentId:null!==(u=null==d?void 0:d.segment)&&void 0!==u?u:"",externalSegmentId:null!==(l=null==d?void 0:d.external_segment)&&void 0!==l?l:""}}},{key:"paywallId",value:function(){return this.state.paywallId}},{key:"setCurrentPage",value:function(e){if(e&&e!==this.state.currentPage){var t=this.state.pageHistory&&this.state.pageHistory.length?this.state.pageHistory:[this.state.currentPage];this.setState(m({},this.state,{currentPage:e,pageHistory:[...t,e]}))}}},{key:"canGoBackPage",value:function(){var e,t;return(null!==(e=null===(t=this.state.pageHistory)||void 0===t?void 0:t.length)&&void 0!==e?e:0)>1}},{key:"goBackPage",value:function(){var e=this.state.pageHistory&&this.state.pageHistory.length?[...this.state.pageHistory]:[this.state.currentPage];if(e.length<=1)return!1;e.pop();var t=e[e.length-1];return!!t&&(this.setState(m({},this.state,{currentPage:t,pageHistory:e})),!0)}},{key:"setCustomerAttribute",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"removeCustomerAttribute",value:function(e){var t=m({},this.state.customer);delete t[e],this.setState(m({},this.state,{customer:t}))}},{key:"setIsLoggedIn",value:function(e){this.setState(m({},this.state,{isLoggedIn:e}))}},{key:"setMediaList",value:function(e){this.setState(m({},this.state,{mediaList:e.reduce((e,t)=>m({},e,{[t.name]:t}))}))}},{key:"setSafeAreaTop",value:function(e){this.setState(m({},this.state,{safeAreaTop:e}))}},{key:"setSafeAreaBottom",value:function(e){this.setState(m({},this.state,{safeAreaBottom:e}))}},{key:"setSafeAreaLeft",value:function(e){this.setState(m({},this.state,{safeAreaLeft:e}))}},{key:"setSafeAreaRight",value:function(e){this.setState(m({},this.state,{safeAreaRight:e}))}},{key:"setFullScreenPresentation",value:function(e){this.setState(m({},this.state,{fullScreenPresentation:e}))}},{key:"setFormFactor",value:function(e){this.setState(m({},this.state,{formFactor:e}))}},{key:"getFormFactor",value:function(){return this.state.formFactor}},{key:"setPurchaseInProgress",value:function(e){this.setState(m({},this.state,{purchaseInProgress:e}))}},{key:"setPurchase",value:function(e,t){this.setState(m({},this.state,{purchaseInProgress:e,productBeingPurchased:t}))}},{key:"setTimeSpentOnPaywall",value:function(e){this.setState(m({},this.state,{timeSpentOnPaywall:e}))}},{key:"setAppSuppliedVideoDetails",value:function({url:e,name:t}){this.setState(m({},this.state,{appSuppliedVideoUrl:e,appSuppliedVideoName:t}))}},{key:"resetAppSuppliedVideoDetails",value:function(){var e=m({},this.state);delete e.appSuppliedVideoUrl,delete e.appSuppliedVideoName,this.setState(e)}},{key:"setLaunchDetails",value:function(e,t){this.setState(m({},this.state,{launchValue:e,launchType:t}))}},{key:"setOpenHeaderIds",value:function(e,t){e=null!=t&&t.skuId?`${e}_${t.skuId}`:e;var n=[...this.state.openHeaderIds],i=n.indexOf(e);-1!==i?n.splice(i,1):n.push(e),this.setState(m({},this.state,{openHeaderIds:n,currentCollapsibleSku:null!=t?t:null}))}},{key:"getCurrentCollapsibleSku",value:function(){return this.state.currentCollapsibleSku}},{key:"setFlow",value:function(e){this.flow=e}},{key:"setUserInteractionEnabled",value:function(e){this.setState(m({},this.state,{userInteractionEnabled:e})),this.emitEvent("user-interaction-changed",{enabled:e})}},{key:"setUserTags",value:function(e){this.setState(m({},this.state,{customer:m({},this.state.customer,e)}))}},{key:"setCurrentSlideIndex",value:function(e){this.setState(m({},this.state,{currentSlideIndex:e}))}}],[{key:"create",value:function(e,t,i){var a=new n(e,t,i);return this.providers.push(a),a}},{key:"remove",value:function(e){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)}),rm=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}}])}(Gh);sm.providers=[];var um=c(function e(){o(this,e),this.refIdToPurchasedSKUs={},this.refIdToRelatedSKUs={},this.refIdToActivePurchases={}});um.instance=new um;var lm=()=>Jr(Mi([...so.getNamiEntitlements(pt),...so.getNamiEntitlements(_t)]),"referenceId"),dm=()=>{Vd.getInstance().emit(hi,lm())};function cm(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 hm=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,Sc()||tu(Pe.THIRD_PARTY_TRANSACTIONS)||!tu(Pe.ENTITLEMENT_MANAGEMENT)){i.n=3;break}if(null==(t=so.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)&&(so.setActiveEntitlements(ft,e),this.invokeActiveEntitlementsHandler(e));case 2:i.n=4;break;case 3:Sc()&&_i.debug("Skipping active entitlements update - anonymous mode");case 4:return i.a(2,e)}},null,this,null,Promise)}},{key:"getAPIEntitlements",value:function(e){var t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return t=`device/${e}/active_entitlements/`,n={},r.p=1,r.n=2,a(Bu.instance.fetchAPI(t));case 2:n=r.v,r.n=4;break;case 3:throw r.p=3,i=r.v,_i.error(_o(i.status,t)),i;case 4:return r.a(2,n)}},null,null,[[1,3]],Promise)}},{key:"invokeActiveEntitlementsHandler",value:function(e){au()&&(e=>{so.setNamiEntitlements(pt,e);var t=so.getNamiEntitlements(_t),n=new Set(e.map(e=>e.referenceId)),i=t.filter(e=>{var t=n.has(e.referenceId);return t&&_i.debug(`Server granted verified entitlement for ${e.referenceId}, so replacing provisional entitlement grant.`),!t});i.length!==t.length&&so.setNamiEntitlements(_t,i),dm()})(e.map(e=>(e=>{var t=e.entitlement_ref_id;return{name:e.name||"",desc:e.description||"",namiId:"",referenceId:t,relatedSkus:um.instance.refIdToRelatedSKUs[t]||[],activePurchases:um.instance.refIdToActivePurchases[t]||[],purchasedSkus:um.instance.refIdToPurchasedSKUs[t]||[],expires:e.expires?new Date(e.expires).valueOf():0}})(e)))}}])}();hm.instance=new hm;var mm=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(!Sc()){r.n=1;break}return _i.debug("Skipping customer journey state update - anonymous mode"),r.a(2,null);case 1:if(null!=(e=so.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(Bu.instance.fetchAPI(t,void 0,0));case 4:n=r.v,r.n=6;break;case 5:throw r.p=5,i=r.v,_i.error(_o(i.status,t)),i;case 6:if(!n){r.n=7;break}return so.setCustomerJourneyState(n.customer_journey_state),r.a(2,n.customer_journey_state);case 7:return r.a(2,null)}},null,null,[[3,5]],Promise)}}])}();mm.instance=new mm;var fm="[NamiStartup]",vm=function(){return c(function e(){o(this,e),this.enabled=!1,this.t0=0,this.lastMark=0,this.decodeDuration=0,this.processDuration=0,this.placements=0,this.firstLaunchLogged=!1},[{key:"start",value:function(e){var t;this.enabled=null!==(t=null==e?void 0:e.includes(Sn))&&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;_i.info(`${fm} phase=${e} ms=${i} total_to_ready=${r}${a}`),_i.info(`${fm} SUMMARY total_to_ready=${r} decode=${this.decodeDuration} process=${this.processDuration} placements=${this.placements}`)}else _i.info(`${fm} 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 _i.info(`${fm} 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,_i.info(`${fm} phase=server_fetch ms=${i} campaigns=${n.length}`),r.a(2,n)}},null,this,null,Promise)}}])}(),pm=new vm,gm=function(){return c(function e(){o(this,e),this.inMemoryAnonymousMode=!1,this.isFirstSession=!1,this.startupDisabled=!1,this.hasInitialConfig=!1,this.lastConfig=null,this.lastStartupRunAt=0,this.startupInFlight=!1,wc=this},[{key:"setInMemoryAnonymousMode",value:function(e){this.inMemoryAnonymousMode=e,_i.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 so.getAnonymousMode()||this.inMemoryAnonymousMode}},{key:"getIsFirstSession",value:function(){return this.isFirstSession}},{key:"isStartupDisabled",value:function(){return this.startupDisabled}},{key:"init",value:function(e){var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:return this.isFirstSession=null===so.getDevice()&&!so.getAnonymousMode(),this.startupDisabled=!1,this.hasInitialConfig=Object.keys(null!==(t=e.initialConfig)&&void 0!==t?t:{}).length>0,this.setInitialValues(e),this.lastConfig=e,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,n.p=1,n.n=2,a(this.fetchPlatformConfig());case 2:if(n.v){n.n=3;break}return n.a(2);case 3:return n.n=4,a(this.runStartupAfterConfig(e));case 4:return n.p=4,this.startupInFlight=!1,n.f(4);case 5:return n.a(2)}},null,this,[[1,,4,5]],Promise)}},{key:"resume",value:function(){var e,t,n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:if(this.lastConfig&&!this.startupInFlight){r.n=1;break}return r.a(2);case 1:if(!(Date.now()-this.lastStartupRunAt<Vn)){r.n=2;break}return _i.debug("Resuming too quickly to call the service."),r.a(2);case 2:return e=this.lastConfig,t=this.startupDisabled,this.lastStartupRunAt=Date.now(),this.startupInFlight=!0,this.startupDisabled=!1,r.p=3,r.n=4,a(this.fetchPlatformConfig());case 4:if(n=!r.v){r.n=5;break}n=!t;case 5:if(!n){r.n=6;break}return r.a(2);case 6:return _i.info("Usable app config on resume - completing the startup that stopped at launch"),r.n=7,a(this.runStartupAfterConfig(e));case 7:r.n=9;break;case 8:r.p=8,i=r.v,_i.warn(`Resume refresh failed: ${i}`);case 9:return r.p=9,this.startupInFlight=!1,r.f(9);case 10:return r.a(2)}},null,this,[[3,8,9,10]],Promise)}},{key:"runStartupAfterConfig",value:function(e){return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(this.initAndFetchRequiredData(e));case 1:Ec.instance.startSession();case 2:return t.a(2)}},null,this,null,Promise)}},{key:"clearResumeState",value:function(){this.lastConfig=null,this.lastStartupRunAt=0,this.startupDisabled=!1}},{key:"fetchPlatformConfig",value:function(){var e;return k(function(t){for(;;)switch(t.n){case 0:return t.n=1,a(pc.instance.fetchConfigForStartup(this.hasInitialConfig));case 1:if((e=t.v).usable){t.n=2;break}return this.startupDisabled=!0,_i.error(`Nami startup stopped: ${e.reason}`),t.a(2,!1);case 2:return t.a(2,!0)}},null,this,null,Promise)}},{key:"setInitialValues",value:function(e){var t=m({},e);delete t.initialConfig,so.clearSessionId(),so.setNamiConfig(t),so.setLanguageCode(e.namiLanguageCode),so.setPurchaseChannel(e.purchaseChannel);var n,i=e.initialConfig;if(i.appConfig||i.platform_config){var a=(null==i?void 0:i.appConfig)||(null==i?void 0:i.platform_config);a&&so.setAppConfig(yt,a)}null!=i&&i.paywalls&&(so.setPaywalls(St,i.paywalls.map(e=>m({},e,{fetchSource:"initialConfig"}))),null!==(n=i.campaign_rules)&&void 0!==n&&n.length&&mc.instance.seedFromInitialConfig(i.campaign_rules,i.paywalls));null!=i&&i.products&&so.setProducts(Pt,i.products)}},{key:"initAnonymousDevice",value:function(){return{deviceId:Xd.instance.getOrCreateAnonymousUUID(),deviceTask:null}}},{key:"initIdentifiedDevice",value:function(e){var t=m({},xu(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)?Ru(i):void 0}}}(e.namiCommands),i=Xd.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:Cu(),l=this.isAnonymousMode(),d=l?this.initAnonymousDevice():this.initIdentifiedDevice(e),c=d.deviceId,h=d.deviceTask,m=Lu(c),s.campaign_rules&&(f=_d(s.campaign_rules,m,u),so.setCampaignRules(wt,f),pm.mark("initial_processed",{count:f.length})),!h){p.n=1;break}return p.n=1,a(h);case 1:if(Kd.instance.configure(u,m,e.namiCommands),iu(),v=Promise.all([qd.instance.fetchProducts(),mm.instance.fetchCustomerJourneyState(),hm.instance.fetchActiveEntitlements(),pm.serverFetch(()=>this.fetchCampaignsAndPaywalls())]).catch(i=>{var r;return k(function(o){for(;;)switch(o.n){case 0:if(!(i instanceof co)){o.n=3;break}if(so.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 _i.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,v,p;return k(function(g){for(;;)switch(g.n){case 0:return e=Kd.instance,t=mc.instance,n=Date.now(),i=Date.now(),g.n=1,a(e.fetchCampaignRulesRaw());case 1:return r=g.v,o=r.campaigns,s=r.fromNetwork,u=Date.now()-i,g.n=2,a(Promise.all(o.filter(e=>{var t;return(null===(t=e.flow)||void 0===t?void 0:t.url)&&!e.flow.object}).map(e=>{var t,n;return k(function(i){for(;;)switch(i.p=i.n){case 0:return i.p=0,i.n=1,a(lc(e.flow.url));case 1:t=i.v,e.flow.object=t.data,i.n=3;break;case 2:i.p=2,n=i.v,_i.warn(`Error fetching flow object from ${e.flow.url}: ${n}`);case 3:return i.a(2)}},null,null,[[0,2]],Promise)})));case 2:if(l=!e.useLegacyPaywallFetch&&Kd.hasPaywallUrls(o),c=null,h=Date.now(),!l||s){g.n=3;break}_i.info("Paywall resolution skipped: campaign_rules were served from the stored copy"),d=Hu(),g.n=7;break;case 3:if(!l){g.n=5;break}return m=Kd.extractPaywallUrls(o),g.n=4,a(t.resolvePaywallsByUrls(m));case 4:c=g.v,d=c.paywalls,io.reconcile(new Set(m)),g.n=7;break;case 5:return g.n=6,a(t.fetchPaywalls());case 6:d=g.v;case 7:return f=Date.now()-h,v=Date.now()-n,l&&!c||(p=c?`, urls=${c.urls}, hashed=${c.hashed}, cache_hits=${c.cacheHits}, fetched=${c.fetched}, cache_after_fetch_failure=${c.cacheAfterFetchFailure}, failed=${c.failed}`:"",_i.debug(`Paywall fetch telemetry: strategy=${l?"individual":"bulk"}, count=${d.length}${p}, total=${v}ms, campaigns=${u}ms, paywalls=${f}ms`+(c?`, retry_count=${c.retryCount}`:""))),g.a(2,e.finalizeCampaignRules(o,d))}},null,null,null,Promise)}},{key:"reRenderPaywall",value:function(){we().ui.reRenderPaywall()}}])}();function ym(e){return Array.isArray(e)?e.map(ym):e&&"object"==typeof e?Object.entries(e).reduce((e,[t,n])=>(void 0!==n&&(e[t]=ym(n)),e),{}):e}function bm(e,t){return Yd(ym(e),ym(t))}gm.instance=new gm;var wm=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?so.setNamiProfile({externalId:this.externalId}):so.removeNamiProfile(),this}},{key:"load",value:function(){var e=so.getNamiProfile();e&&(this.externalId=e.externalId),sm.setIsLoggedIn(!!this.externalId)}},{key:"loginLocal",value:function(e){this.setExternalId(e).save(),sm.setIsLoggedIn(!0)}},{key:"loginRemote",value:function(e){var t;return k(function(n){for(;;)switch(n.n){case 0:return n.n=1,a(Bu.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(),sm.setIsLoggedIn(!1)}},{key:"logoutRemote",value:function(){return k(function(e){for(;;)switch(e.n){case 0:return e.n=1,a(Bu.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)}}])}();wm.instance=new wm;var km,Sm,Em=function(){function e(){o(this,e)}return c(e,[{key:"previous",get:function(){return this._previous}},{key:"record",value:function(e){this._previous=this._current,this._current=e}},{key:"reset",value:function(){this._current=void 0,this._previous=void 0}}],[{key:"shared",get:function(){return this._shared||(this._shared=new e),this._shared}}])}(),Pm=function(){function e(){o(this,e),km.set(this,!1),Sm.set(this,null),this.maxLogging=!1}return c(e,[{key:"isInitialized",get:function(){return Se(this,km,"f")||null!=so.getNamiConfig()}},{key:"listenForAppForeground",value:function(){var e,t,n;Se(this,Sm,"f")||Ee(this,Sm,null!==(e=null===(t=(n=we().device).onAppForeground)||void 0===t?void 0:t.call(n,()=>{gm.instance.resume()}))&&void 0!==e?e:null)}},{key:"initializeSDK",value:function(t){var n,i,r,o,s,u,l,d,c,h;return k(function(f){for(;;)switch(f.n){case 0:if(o=!1,s=!1,u=Se(this,km,"f")?so.getNamiConfig():null,_i.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,!bm(l,u)){f.n=1;break}return _i.warn("Nami SDK is already configured, ignoring this configure call."),f.a(2,{sdkInitialized:!0,configureState:oi});case 1:s=!0;case 2:d=eu(t.namiCommands),c=eu(u.namiCommands),t.appPlatformID==u.appPlatformID&&d==c||(o=!0),t.namiLanguageCode===u.namiLanguageCode&&t.logLevel==u.logLevel||(s=!0);case 3:return o&&(_i.info("SDK full reconfigure called"),so.resetDevice()),Ee(this,km,!0),Bu.configure(t),this.listenForAppForeground(),f.n=4,a(gm.instance.init(t));case 4:return _i.info("SDK successfully initialized!"),h=s||o?ai:ni,null===(i=(r=we().ui).postConfigure)||void 0===i||i.call(r),pm.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,r,o;return k(function(s){for(;;)switch(s.n){case 0:return so.clearAll(),io.purgeAll(),kc(),Ee(e.instance,km,!1),null===(t=Se(r=e.instance,Sm,"f"))||void 0===t||t.call(r),Ee(e.instance,Sm,null),gm.instance.clearResumeState(),wm.instance.setExternalId(void 0),sm.reset(),Bu.reset(),Kd.instance.reset(),Em.shared.reset(),s.n=1,a(Promise.resolve().then(function(){return Ff}));case 1:o=s.v,o.NamiFlowManager.reset(),null===(n=(i=we().ui).onReset)||void 0===n||n.call(i);case 2:return s.a(2)}},null,null,null,Promise)}},{key:"configure",value:function(t){return k(function(n){for(;;)switch(n.n){case 0:if(pm.start(t.namiCommands),t.appPlatformID){n.n=1;break}throw new mo;case 1:return this.setInitialConfig(t),pm.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){_i.debug("[DEPRECATED] NamiConfiguration.initialConfig should be an object");var t=function(e){var t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(t)}catch(e){return}}(e.initialConfig);if(!t)return _i.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=su(e.initialConfig.initial_config);n?e.initialConfig=n:(e.initialConfig={},_i.error("Failed to parse NamiConfiguration.initialConfig as base64-gzipped JSON"))}}else e.initialConfig={}}}])}();km=new WeakMap,Sm=new WeakMap,Pm.instance=new Pm;var Tm,_m,Mm,Am=new Set(["fullscreen","sheet","compact_sheet","modal"]);e.NamiPaywallManagerEvents=void 0,(Tm=e.NamiPaywallManagerEvents||(e.NamiPaywallManagerEvents={})).BuySku="RegisterBuySKU",Tm.Close="PaywallCloseRequested",Tm.SignIn="PaywallSignInRequested",Tm.Restore="PaywallRestoreRequested",Tm.DeeplinkAction="PaywallDeeplinkAction",e.NamiPaywallAction=void 0,(_m=e.NamiPaywallAction||(e.NamiPaywallAction={})).BUY_SKU="BUY_SKU",_m.SELECT_SKU="SELECT_SKU",_m.RESTORE_PURCHASES="RESTORE_PURCHASES",_m.SIGN_IN="SIGN_IN",_m.CLOSE_PAYWALL="CLOSE_PAYWALL",_m.SHOW_PAYWALL="SHOW_PAYWALL",_m.PURCHASE_SELECTED_SKU="PURCHASE_SELECTED_SKU",_m.PURCHASE_SUCCESS="PURCHASE_SUCCESS",_m.PURCHASE_FAILED="PURCHASE_FAILED",_m.PURCHASE_CANCELLED="PURCHASE_CANCELLED",_m.PURCHASE_PENDING="PURCHASE_PENDING",_m.PURCHASE_UNKNOWN="PURCHASE_UNKNOWN",_m.PURCHASE_DEFERRED="PURCHASE_DEFERRED",_m.DEEPLINK="DEEPLINK",_m.TOGGLE_CHANGE="TOGGLE_CHANGE",_m.PAGE_CHANGE="PAGE_CHANGE",_m.SLIDE_CHANGE="SLIDE_CHANGE",_m.COLLAPSIBLE_DRAWER_OPEN="COLLAPSIBLE_DRAWER_OPEN",_m.COLLAPSIBLE_DRAWER_CLOSE="COLLAPSIBLE_DRAWER_CLOSE",_m.VIDEO_STARTED="VIDEO_STARTED",_m.VIDEO_PAUSED="VIDEO_PAUSED",_m.VIDEO_RESUMED="VIDEO_RESUMED",_m.VIDEO_ENDED="VIDEO_ENDED",_m.VIDEO_CHANGED="VIDEO_CHANGED",_m.VIDEO_MUTED="VIDEO_MUTED",_m.VIDEO_UNMUTED="VIDEO_UNMUTED",_m.COUNTDOWN_TIMER_COMPLETED="COUNTDOWN_TIMER_COMPLETED",_m.UNKNOWN="UNKNOWN",e.LaunchCampaignError=void 0,(Mm=e.LaunchCampaignError||(e.LaunchCampaignError={})).DEFAULT_CAMPAIGN_NOT_FOUND="Default campaign not found",Mm.LABELED_CAMPAIGN_NOT_FOUND="Labeled campaign not found",Mm.CAMPAIGN_DATA_NOT_FOUND="Campaign data not found",Mm.PAYWALL_ALREADY_DISPLAYED="Paywall is already being displayed",Mm.SDK_NOT_INITIALIZED="SDK has not been initialized",Mm.PAYWALL_COULD_NOT_DISPLAY="Failed to display paywall",Mm.URL_CAMPAIGN_NOT_FOUND="URL campaign not found",Mm.PRODUCT_DATA_NOT_FOUND="Product data not found",Mm.PRODUCT_GROUPS_NOT_FOUND="Product groups not found",Mm.FLOW_SCREEN_DATA_UNAVILABLE="Flow unavailable due to missing screen data";var Dm,xm="entry",Cm="screen",Im="branch",Lm="exit",Fm="unknown";!function(e){e.NAVIGATE="flowNav",e.BACK="flowPrev",e.NEXT="flowNext",e.FINISHED="flowDone",e.DISMISS="flowDismiss",e.EXIT="flowExit",e.HANDOFF="flowHandoff",e.TRACK="trackEvent",e.LOG="logEvent",e.SET_VIDEO="setVideo",e.FLOW_EVENT="flowEvent",e.BLOCK_BACK="blockBackToStep",e.FLOW_ENABLED="flowInteractionEnabled",e.FLOW_DISABLED="flowInteractionDisabled",e.SET_TAGS="setTags",e.SET_TAGS_FROM_FORM="setTagsFromForm",e.PAUSE="flowPause",e.RESUME="flowResume",e.SET_LAUNCH_CONTEXT="setLaunchContext",e.SET_FLOW_PATH="setFlowPath"}(Dm||(Dm={}));var Rm="__handoff_sequence__",Om={Push:"push",Location:"location",Tracking:"att",Deeplink:"deeplink",Complete:"complete",SignIn:"signin",Restore:"restore",SignInMvpd:"signin_mvpd",BuySku:"buysku",UserData:"userdata"};var $m={Push:"push",Location:"location",Tracking:"tracking",Camera:"camera",Microphone:"microphone",Photos:"photos",Contacts:"contacts",Bluetooth:"bluetooth",Calendar:"calendar",Biometrics:"biometrics",Health:"health",Motion:"motion",Speech:"speech",LocalNetwork:"localNetwork"},Nm={[$m.Push]:"push_authorized",[$m.Location]:"location_authorized",[$m.Tracking]:"tracking_authorized"},Wm="__buy_sku__",jm="__default__",Bm="__appear__",zm="__disappear__",Um="__login_success__",Hm="__login_failure__",Gm="__logout_success__",Vm="__logout_failure__",Km="__purchase_success__",Ym="__purchase_failure__",Xm="__remoteback__",qm="__tag_update__",Jm="__permission_granted__",Qm="and",Zm="or",ef="i_contains",tf="equals",nf="i_equals",af="not_equals",rf="not_i_equals",of="not_contains",sf="contains",uf="set",lf="not_set",df="greater_than",cf="greater_than_or_equal_to",hf="less_than",mf="less_than_or_equal_to";function ff(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 vf=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 Qm:return i.every(e=>e);case Zm: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 Qm:for(var i,a=h(n);!(i=a()).done;){var r=i.value;if(!this.evaluateFilter(r))return!1}return!0;case Zm: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(Pm.instance.maxLogging&&_i.debug(`[NamiConditionEvaluator] resolve(${e.identifier}) → ${JSON.stringify(t)} (type: ${typeof t})`),e.operator===uf)return null!=t;if(e.operator===lf)return null==t;if(null==t)return Pm.instance.maxLogging&&_i.debug(`[NamiConditionEvaluator] ${e.identifier} resolved to null — registeredNamespaces: [${[...this.namespaceResolvers.keys()].join(", ")}]`),!![af,rf,of].includes(e.operator);switch(e.operator){case ef: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 tf:return e.values.some(e=>this.strictEquals(t,e,!1));case nf:return e.values.some(e=>this.strictEquals(t,e,!0));case af:return e.values.every(e=>!this.strictEquals(t,e,!1));case rf:return e.values.every(e=>!this.strictEquals(t,e,!0));case sf:return!(!Array.isArray(t)&&"string"!=typeof t)&&e.values.some(e=>"string"==typeof e&&t.includes(e));case of:return Array.isArray(t)?e.values.every(e=>!("string"==typeof e&&t.includes(e))):e.values.every(e=>"string"!=typeof t||"string"!=typeof e||!t.includes(e));case df:case cf:case hf:case mf:var n=ff(t);return null===n?(this.log(`Resolved value is not numerically comparable for ${e.operator}`),!1):e.values.some(t=>{var i=ff(t);if(null===i)return!1;switch(e.operator){case df:return n>i;case cf:return n>=i;case hf: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 Pm.instance.maxLogging&&_i.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 Pm.instance.maxLogging&&_i.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 Pm.instance.maxLogging&&_i.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){_i.debug(`[NamiConditionEvaluator] ${e}`)}}],[{key:"shared",get:function(){return e.instance||(e.instance=new e),e.instance}}])}(),pf=function(){return c(function e(){o(this,e)},[{key:"register",value:function(){vf.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}}])}(),gf=function(e){function t(e,n){var i;return o(this,t),(i=r(this,t)).namespace="LaunchContext",i.context=e,i.campaign=n,i.register(),i}return p(t,e),c(t,[{key:"resolveValue",value:function(e){var t,n,i,a;if("placement"===e)return null!==(t=null===(n=this.campaign)||void 0===n?void 0:n.value)&&void 0!==t?t:void 0;if("tags"===e)return null!==(i=null===(a=this.campaign)||void 0===a?void 0:a.placement_tags)&&void 0!==i?i:void 0;if(e.startsWith("customAttributes.")){var r=e.substring(17);return this.resolveKeyPath(r,this.context.customAttributes)}if(e.startsWith("customObject.")){var o=e.substring(13);return this.resolveKeyPath(o,this.context.customObject)}return this.resolveKeyPath(e,{customAttributes:this.context.customAttributes,customObject:this.context.customObject,productGroups:this.context.productGroups})}}])}(pf),yf=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=xu(),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)}}])}(pf),bf=[/(^|_)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],wf=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=>bf.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()}}])}();wf._instance=null;var kf=()=>wf.instance.params;function Sf(e){if(null!=e&&""!==e){if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e){if(!Number.isFinite(e))return;return String(e)}return String(e)}}var Ef,Pf=/\{\{\s*([^}]+?)\s*\}\}/g,Tf=/\$\{[^}]+\}/g,_f=function(){return c(function e(t){o(this,e),this.flowManager=t,this.urlParams=kf()},[{key:"currentScreenPaywall",value:function(){var e,t,n=null===(e=this.flowManager.currentFlow)||void 0===e||null===(e=e.currentFlowStep)||void 0===e?void 0:e.screen;if(n)return(null===(t=this.screenPaywallLookup)||void 0===t?void 0:t.screenId)!==n&&(this.screenPaywallLookup={screenId:n,paywall:Vu(n)}),this.screenPaywallLookup.paywall}},{key:"resolve",value:function(e){var t,n,i,a,r,o,s,u,l,d,c,h,m,f,v,p,g,y,b,w,k=this.flowManager.currentFlow,S=null==k?void 0:k.component;if(e.startsWith("launchContext.")){var E=null==k?void 0:k.context;if(E){var P=e.substring(14),T=new gf(E,null==k?void 0:k.campaign).resolveValue(P);return Array.isArray(T)?T.join(","):null==T?void 0:T.toString()}}else{if(e.startsWith("form.")){var _,M=e.substring(5);return Sf(null===(_=sm.currentProvider)||void 0===_?void 0:_.state.formStates[M])}if(e.startsWith("sku.")){var A=null==k?void 0:k.purchasedSku;if(!A)return;var D=e.substring(4);switch(D){case"sku_ref_id":return A.skuRefId;case"name":return A.name;case"entitlement_ref_id":return null!==(t=null===(n=A.entitlements[0])||void 0===n?void 0:n.entitlement_ref_id)&&void 0!==t?t:"";case"entitlement_name":return null!==(i=null===(a=A.entitlements[0])||void 0===a?void 0:a.name)&&void 0!==i?i:"";default:var x=Hc(D,A.productDetails);return null!=x?String(x):void 0}}switch(e){case"campaignId":return null==S||null===(r=S.campaign)||void 0===r?void 0:r.rule;case"campaignName":return null==S||null===(o=S.campaign)||void 0===o?void 0:o.name;case"campaignLabel":case"campaignPlacement":return null!==(s=null==S||null===(u=S.campaign)||void 0===u?void 0:u.value)&&void 0!==s?s:void 0;case"campaignSegment":case"campaignSegmentId":return null==S||null===(l=S.campaign)||void 0===l?void 0:l.segment;case"campaignExternalSegment":case"campaignExternalSegmentId":return null!==(d=null==S||null===(c=S.campaign)||void 0===c?void 0:c.external_segment)&&void 0!==d?d:void 0;case"pageName":return null!==(h=null===(m=this.currentScreenPaywall())||void 0===m?void 0:m.name)&&void 0!==h?h:null==S||null===(f=S.paywall)||void 0===f?void 0:f.name;case"pageId":return null!==(v=null==k||null===(p=k.currentFlowStep)||void 0===p?void 0:p.screen)&&void 0!==v?v:null==S||null===(g=S.paywall)||void 0===g?void 0:g.id;case"flowName":return null==k?void 0:k.name;case"flowId":return null==k?void 0:k.id;case"objectId":return null==S||null===(y=S.campaign)||void 0===y||null===(y=y.flow)||void 0===y?void 0:y.object_id;case"stepName":return null==k||null===(b=k.currentFlowStep)||void 0===b?void 0:b.name;case"buttonText":var C=null==k?void 0:k.currentButton;if(!C)return;var I=C.firstTextValue;if("function"!=typeof I)return;return I.call(C);case"slideNumber":var L=null==S?void 0:S.getSelectedSlideIndexForCurrentCarousel();return null!=L?`${L+1}`:void 0;case"productGroupId":return(null===(w=sm.currentProvider)||void 0===w?void 0:w.state.currentGroupId)||void 0;case"productGroupName":var F,R,O,$=null===(F=sm.currentProvider)||void 0===F?void 0:F.state;return null!==(R=null==$||null===(O=$.groups)||void 0===O||null===(O=O.find(e=>e.id===$.currentGroupId))||void 0===O?void 0:O.displayName)&&void 0!==R?R:void 0;case"productGroupRef":var N,W,j,B=null===(N=sm.currentProvider)||void 0===N?void 0:N.state;return null!==(W=null==B||null===(j=B.groups)||void 0===j||null===(j=j.find(e=>e.id===B.currentGroupId))||void 0===j?void 0:j.ref)&&void 0!==W?W:void 0;case"flowPath":return null==k?void 0:k.flowPath;default:return}}}},{key:"interpolateLiquidVariables",value:function(e){return e.replace(Pf,(e,t)=>{var n,i=null!==(n=this.resolve(t))&&void 0!==n?n:this.urlParams[t];return null!=i?i:""}).replace(Tf,"")}},{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}}])}(),Mf=function(e){function t(){var e;return o(this,t),(e=r(this,t)).namespace="urlParams",e.context=kf(),e.register(),e}return p(t,e),c(t,[{key:"resolveValue",value:function(e){return _i.debug("[URLParamsResolver]","Resolving keyPath",e),this.resolveKeyPath(e,this.context)}}])}(pf),Af=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=sm.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)}}}])}(pf),Df=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=sm.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()}}}}])}(pf),xf=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).namespace="LastLaunchContext",e}return p(t,e),c(t,[{key:"register",value:function(){T(t,"register",this)([])}},{key:"resolveValue",value:function(e){var t=Em.shared.previous;if(t){if("placement"===e)return t.placementLabel;if("tags"===e)return t.tags;if(e.startsWith("customAttributes.")){var n=e.substring(17);return this.resolveKeyPath(n,t.customAttributes)}}}}])}(pf);!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"}(Ef||(Ef={}));var Cf=e=>{var t;return k(function(n){for(;;)switch(n.p=n.n){case 0:if(!Sc()){n.n=1;break}return _i.info("Skipping transaction post - anonymous mode"),n.a(2);case 1:return n.p=1,n.n=2,a(Bu.instance.postConversion(e));case 2:n.n=4;break;case 3:n.p=3,t=n.v,_i.error("Error posting conversion",t);case 4:return n.a(2)}},null,null,[[1,3]],Promise)},If=function(){return c(function e(){o(this,e),this.emitter=Vd.getInstance()},[{key:"sdkInitialized",get:function(){return Pm.instance.isInitialized}}],[{key:"allPaywalls",value:function(){if(!this.instance.sdkInitialized)throw new ho;return Gu()}},{key:"setProductDetails",value:function(e){this.instance.productDetails=e,sm.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 au()&&_i.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(sm.setPurchaseInProgress(!1),Lf.instance.flowOpen&&(t=Lf.instance.currentFlow,n=null==t?void 0:t.currentFlowStep,t&&n&&t.executeLifecycle(n,Km)),!Of.inAnonymousMode()){u.n=1;break}return _i.debug("Skipping purchase validation - anonymous mode"),u.a(2);case 1:if(i=so.getSessionId(),r=so.getPurchaseImpression()){u.n=2;break}return _i.debug("Not sending paywall conversion call complete due to unknown impression"),u.a(2);case 2:return u.p=2,u.n=3,a(Cf({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,_i.error("Error posting conversion",o);case 5:if(tu(Pe.THIRD_PARTY_TRANSACTIONS)){u.n=9;break}return u.p=6,u.n=7,a(Bu.instance.purchaseValidation({app_env:"production",payload:"",sku:e.skuId}));case 7:u.n=9;break;case 8:u.p=8,s=u.v,_i.error("Error validating purchase",s);case 9:return u.a(2)}},null,null,[[6,8],[2,4]],Promise)}},{key:"buySkuCancel",value:function(){tu(Pe.THIRD_PARTY_TRANSACTIONS)?sm.setPurchase(!1):_i.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){Pd(e)?(_i.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received valid url ${e}`),sm.setAppSuppliedVideoDetails({url:e,name:t})):_i.debug(`NamiPaywallManager: setAppSuppliedVideoDetails received invalid url ${e}`)}},{key:"allowUserInteraction",value:function(e){_i.debug(`NamiPaywallManager: allowUserInteraction called with ${e}`),sm.setUserInteractionEnabled(e)}}])}();If.instance=new If,If.emitter=Vd.getInstance();var Lf=function(){function e(){o(this,e),this.flowOpen=!1,this.lastAnimatedFlowProgress=new Map,this.navGraphCache=new WeakMap}return c(e,[{key:"hasHandoffHandler",get:function(){return!!this.handoffStepHandler}},{key:"deliverHandoff",value:function(t,n){var i=this.handoffStepHandler;if(i){var a={tag:t,completed:!1};this.pendingHandoff=a;i(t,n,n=>{if(a.completed)_i.warn(`[NamiFlowManager] complete() called more than once for handoff '${t}' — ignored`);else{var i=e.instance.pendingHandoff;i&&i!==a?_i.warn(`[NamiFlowManager] stale complete() for handoff '${t}' — a newer handoff ('${i.tag}') is pending; ignored`):(a.completed=!0,this.pendingHandoff===a&&(this.pendingHandoff=void 0),e.routeHandoffOutcome(null!=n?n:{kind:"done"}),e.resume())}})}}},{key:"resume",value:function(){e.resume()}},{key:"presentFlow",value:function(t,n,i){var a=new Hf(t,n,this,i);return this.flowOpen=!0,this.currentFlow=a,Bu.impressionListener=t=>{var n;null===(n=e.instance.currentFlow)||void 0===n||n.bindImpression(t)},a}},{key:"finishFlow",value:function(){Pm.instance.maxLogging&&_i.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===Cm);if(0===t.length)return 0;var n=this.currentFlow.stepcrumbs.filter(e=>e.type===Cm);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 _i.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[Bm];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===Dm.NAVIGATE||d.function===Dm.NEXT)&&null!=(null===(l=d.parameters)||void 0===l?void 0:l.delay)){var c=d.parameters.delay,m=Number(c);if(!isNaN(m)&&m>0)return m/1e3}}return null}}],[{key:"instance",get:function(){return e._instance||(e._instance=new e),e._instance}},{key:"reset",value:function(){var t=e.instance;t.currentFlow=void 0,t.flowOpen=!1,t.lastAnimatedFlowProgress=new Map,t.navGraphCache=new WeakMap,t.pendingHandoff=void 0}},{key:"registerStepHandoff",value:function(e){this.instance.handoffStepHandler=e;var t=e;return()=>{this.instance.handoffStepHandler===t&&(this.instance.handoffStepHandler=void 0)}}},{key:"routeHandoffOutcome",value:function(t){var n=e.instance.currentFlow,i=null==n?void 0:n.currentFlowStep;switch(t.kind){case"done":return;case"permission":if(!n)return;if(n.handoffState.permissions[t.permission]=t.granted,!t.granted)return;i&&n.executeLifecycle(i,Jm);var a=Nm[t.permission];return void(a?n.completionSignal(a):_i.debug(`[NamiFlowManager] permission '${t.permission}' granted — no completion_result mapping yet (state/lifecycle only)`));case"purchase":return void("success"===t.result?If.buySkuComplete(t.details):(sm.setPurchase(!1),n&&i&&n.executeLifecycle(i,Ym)));case"login":if("success"===t.result){var r,o,s=t.details;if(n)n.handoffState.login=m({},null!==(o=s.attributes)&&void 0!==o?o:{});Of.loggedInId()===s.loginId?n&&i&&n.executeLifecycle(i,Um):Promise.resolve(Of.login(s.loginId)).catch(e=>{_i.error("[NamiFlowManager] login from handoff outcome failed",e)});var u=null===(r=so.getDevice())||void 0===r?void 0:r.customer_data_platform_id;s.cdpId&&s.cdpId!==u&&Promise.resolve(Of.setCustomerDataPlatformId(s.cdpId)).catch(e=>{_i.error("[NamiFlowManager] CDP id write-through from handoff outcome failed",e)})}else n&&i&&n.executeLifecycle(i,Hm);return}}},{key:"registerEventHandler",value:function(e){this.instance.eventHandler=e;var t=e;return()=>{this.instance.eventHandler===t&&(this.instance.eventHandler=void 0)}}},{key:"resume",value:function(){var t,n,i,a=e.instance,r=a.flowOpen,o=a.currentFlow;Pm.instance.maxLogging&&_i.debug(`[NamiFlowManager] resume() — flowOpen=${r}, hasFlow=${!!o}, currentStep=${null!==(t=null==o||null===(n=o.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"none"}, isPaused=${null!==(i=null==o?void 0:o.isPaused)&&void 0!==i?i:"N/A"}`);var s=e.instance.pendingHandoff;if(s&&!s.completed&&(s.completed=!0,e.instance.pendingHandoff=void 0,_i.warn(`[NamiFlowManager] resume() called during handoff '${s.tag}' with a v2 handler registered — treated as complete({kind:'done'}); prefer complete(outcome)`)),r&&o&&o.currentFlowStep){if(o.activeHandoffSequence)return _i.debug(`Resuming flow at handoff sequence ${o.currentFlowStep.id}`),void o.resumeNextHandoff();_i.debug(`Resuming flow at step ${o.currentFlowStep.id}`),o.executeLifecycle(o.currentFlowStep,"__resume__")}else _i.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?(_i.debug(`Finishing flow programmatically at step ${i.currentFlowStep.id}`),i.dismiss()):_i.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():_i.warn("This flow cannot be paused"):_i.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()}}])}(),Ff=Object.freeze({__proto__:null,NamiFlowManager:Lf}),Rf=()=>{var e,t;return null!==(e=null===(t=so.getNamiConfig())||void 0===t||null===(t=t.namiCommands)||void 0===t?void 0:t.includes("disableAsyncLoginLogout"))&&void 0!==e&&e},Of=function(){return c(function e(){o(this,e),this.emitter=Vd.getInstance(),vf.shared.registerNamespaceResolver("UserTags",t=>{var n,i=t.replace("UserTags.","");return null!==(n=e.getCustomerAttribute(i))&&void 0!==n?n:null})},[{key:"isSDKInitialized",get:function(){return Pm.instance.isInitialized}}],[{key:"isLoggedIn",value:function(){return wm.instance.isLoggedIn()}},{key:"loggedInId",value:function(){return this.instance.isSDKInitialized||_i.debug(Ne),wm.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 ho,this.invokeStateHandler(Ef.LOGIN,!1,t),t;case 1:if(!this.inAnonymousMode()){c.n=2;break}throw n=new wo,this.invokeStateHandler(Ef.LOGIN,!1,n),n;case 2:if(Rf()){c.n=3;break}return wm.instance.loginLocal(e),this.invokeStateHandler(Ef.LOGIN,!0),Lf.instance.flowOpen&&(i=Lf.instance.currentFlow,(r=null==i?void 0:i.currentFlowStep)&&(Pm.instance.maxLogging&&_i.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${r.id}`),i.executeLifecycle(r,Um))),wm.instance.loginRemote(e).catch(e=>{_i.error("[NamiCustomerManager] async login API failed",e)}),hm.instance.fetchActiveEntitlements().catch(e=>{_i.error("[NamiCustomerManager] async login entitlement refresh failed",e)}),c.a(2);case 3:return c.p=3,c.n=4,a(wm.instance.login(e));case 4:return c.n=5,a(hm.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Ef.LOGIN,!0),Lf.instance.flowOpen&&(o=Lf.instance.currentFlow,(s=null==o?void 0:o.currentFlowStep)&&(Pm.instance.maxLogging&&_i.debug(`[NamiCustomerManager] login success — triggering __login_success__ on step ${s.id}`),o.executeLifecycle(s,Um))),c.n=7;break;case 6:throw c.p=6,d=c.v,this.invokeStateHandler(Ef.LOGIN,!1,d),Lf.instance.flowOpen&&(u=Lf.instance.currentFlow,(l=null==u?void 0:u.currentFlowStep)&&(Pm.instance.maxLogging&&_i.debug(`[NamiCustomerManager] login failure — triggering __login_failure__ on step ${l.id}`),u.executeLifecycle(l,Hm))),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 ho,this.invokeStateHandler(Ef.LOGOUT,!1,e),e;case 1:if(!this.inAnonymousMode()){d.n=2;break}throw t=new wo,this.invokeStateHandler(Ef.LOGOUT,!1,t),t;case 2:if(Rf()){d.n=3;break}return wm.instance.logoutLocal(),this.invokeStateHandler(Ef.LOGOUT,!0),Lf.instance.flowOpen&&(n=Lf.instance.currentFlow,(i=null==n?void 0:n.currentFlowStep)&&(Pm.instance.maxLogging&&_i.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${i.id}`),n.executeLifecycle(i,Gm))),wm.instance.logoutRemote().catch(e=>{_i.error("[NamiCustomerManager] async logout API failed",e)}),hm.instance.fetchActiveEntitlements().catch(e=>{_i.error("[NamiCustomerManager] async logout entitlement refresh failed",e)}),d.a(2);case 3:return d.p=3,d.n=4,a(wm.instance.logout());case 4:return d.n=5,a(hm.instance.fetchActiveEntitlements());case 5:this.invokeStateHandler(Ef.LOGOUT,!0),Lf.instance.flowOpen&&(r=Lf.instance.currentFlow,(o=null==r?void 0:r.currentFlowStep)&&r.executeLifecycle(o,Gm)),d.n=7;break;case 6:throw d.p=6,l=d.v,this.invokeStateHandler(Ef.LOGOUT,!1,l),Lf.instance.flowOpen&&(s=Lf.instance.currentFlow,(u=null==s?void 0:s.currentFlowStep)&&s.executeLifecycle(u,Vm)),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?Ef.ANONYMOUS_MODE_ON:Ef.ANONYMOUS_MODE_OFF,this.instance.isSDKInitialized){s.n=1;break}throw n=new ho,this.invokeStateHandler(t,!1,n),n;case 1:if(this.anonymousModeCapability()){s.n=2;break}return _i.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 yo:new bo,this.invokeStateHandler(t,!1,i),s.a(2);case 3:if(!e){s.n=4;break}so.setAnonymousMode(e),so.resetDevice(),this.refetchConfig(),this.invokeStateHandler(Ef.ANONYMOUS_MODE_ON,!0),s.n=6;break;case 4:return so.clearAnonymousMode(),kc(),o=null===(r=so.getNamiConfig())||void 0===r?void 0:r.namiCommands,s.n=5,a(Xd.instance.createOrUpdateDevice(xu(o)));case 5:so.clearAnonymousUUID(),this.refetchConfig(),this.invokeStateHandler(Ef.ANONYMOUS_MODE_OFF,!0);case 6:return s.a(2)}},null,this,null,Promise)}},{key:"inAnonymousMode",value:function(){return!!this.instance.isSDKInitialized&&Sc()}},{key:"setCustomerAttribute",value:function(e,t){if(!this.instance.isSDKInitialized)throw new ho;if(so.setCustomerAttribute(e,t),tu(Pe.PAYWALL_PERSONALIZATION)?(sm.setCustomerAttribute({[e]:t}),_i.debug(`This customer attribute you set is now available for paywall personalization using the smart text variable: ${e}`)):_i.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.`),Lf.instance.flowOpen){var n=Lf.instance.currentFlow;if(n){var i=n.currentFlowStep;i&&n.executeLifecycle(i,qm)}}}},{key:"getCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new ho;var t=so.getCustomerAttribute(e);return null!=t?tu(Pe.PAYWALL_PERSONALIZATION)?_i.debug(`Found customer attribute. ${e} is available for paywall personalization on this device.`):_i.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.`):_i.debug(`No ${e} customer attribute found.`),t}},{key:"getAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new ho;return so.getAllCustomerAttributes()}},{key:"clearCustomerAttribute",value:function(e){if(!this.instance.isSDKInitialized)throw new ho;so.clearCustomerAttribute(e)?(sm.removeCustomerAttribute(e),_i.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.`)):_i.warn(`No value to clear for attribute ${e}.`)}},{key:"clearAllCustomerAttributes",value:function(){if(!this.instance.isSDKInitialized)throw new ho;so.getAllCustomerAttributesKeys().forEach(e=>{sm.removeCustomerAttribute(e)}),so.clearAllCustomerAttributes(),_i.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 ho;return so.getCustomerJourneyState()}},{key:"deviceId",value:function(){var e,t;return this.instance.isSDKInitialized&&null!==(e=null===(t=so.getDevice())||void 0===t?void 0:t.id)&&void 0!==e?e:qe}},{key:"registerJourneyStateHandler",value:function(e){if(au("NamiCustomerManager.registerJourneyStateHandler"))return this.instance.emitter.addListener(fi,e),()=>{this.instance.emitter.removeListener(fi,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 ho,this.invokeStateHandler(Ef.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(Xd.instance.updateDeviceField("customer_data_platform_id",e));case 3:this.invokeStateHandler(Ef.CUSTOMER_DATA_PLATFORM_ID_SET,!0),o.n=5;break;case 4:o.p=4,r=o.v,this.invokeStateHandler(Ef.CUSTOMER_DATA_PLATFORM_ID_SET,!1,r);case 5:o.n=7;break;case 6:return _i.info("Unable to set CDP ID in anonymous mode",{deviceId:null===(n=so.getDevice())||void 0===n?void 0:n.id,anonymousMode:!0}),i=new ko,this.invokeStateHandler(Ef.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=tu(Pe.ANONYMOUS_MODE_CAPABILITY),t=tu(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([qd.instance.fetchProducts(),mc.instance.fetchPaywalls().then(e=>Kd.instance.fetchCampaignRules(e))]));case 1:return e.a(2)}},null,this,null,Promise)}}])}();Of.instance=new Of;var $f="This field is required",Nf="Please enter a valid email address",Wf="Please enter at least 2 characters",jf=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Bf(e,t,n){var i=("string"==typeof n?n:null==n?"":String(n)).trim();return t&&0===i.length?$f:0!==i.length?"email"!==e||jf.test(i)?"name"===e&&i.length<2?Wf:void 0:Nf:void 0}var zf=/^([^:]+)::(.+)$/;var Uf=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&&Ku(this.screens)}}])}(),Hf=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.flowPath="",u.timerStates={},u.handoffState={permissions:{}},u.campaign=e,u.component=n,u.context=a,u.manager=i,u.branchcrumbs=[],u.stepcrumbs=[],u.registerResolvers(a);var l=u.findStepByType(xm);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 gf(this.context,this.campaign)),null!==(n=(t=this.context).customAttributes)&&void 0!==n||(t.customAttributes={}),Object.assign(this.context.customAttributes,e)}},{key:"registerResolvers",value:function(e){e&&new gf(e,this.campaign),new yf,new Mf,new Af,new Df(this.campaign),(new xf).register(),vf.shared.registerNamespaceResolver("Flow",e=>{switch(e){case"Flow.stepcrumbs":return this.stepcrumbs.map(e=>e.id);case"Flow.branchcrumbs":return this.branchcrumbs;default:return}}),vf.shared.registerNamespaceResolver("login",e=>{var t,n=e.replace(/^login\./,"");return null===(t=this.handoffState.login)||void 0===t?void 0:t[n]}),vf.shared.registerNamespaceResolver("permissions",e=>{var t=e.replace(/^permissions\./,"");return this.handoffState.permissions[t]}),vf.shared.registerNamespaceResolver("__first_session__",()=>gm.instance.getIsFirstSession())}},{key:"currentFlowStep",get:function(){return this.stepcrumbs.at(-1)}},{key:"nextStepAvailable",get:function(){return void 0!==this.nextFlowStep}},{key:"previousStepAvailable",get:function(){var e,t=!!this.previousFlowStep,n=!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to),i=this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type);return t&&n&&i}},{key:"previousFlowStep",get:function(){var e=this.stepcrumbs.length-2;return e>=0?this.stepcrumbs[e]:void 0}},{key:"nextFlowStep",get:function(){return this.nextStep(this.currentFlowStep)}},{key:"getStep",value:function(e){return this.steps.find(t=>t.id===e)}},{key:"findStepByType",value:function(e){return this.steps.find(t=>t.type===e)}},{key:"isStepActive",value:function(e){return!e.branch_tags||!e.branch_tags.length||e.branch_tags.some(e=>this.branchcrumbs.includes(e))}},{key:"flowLog",value:function(e,...t){Pm.instance.maxLogging&&_i.debug(`[NamiFlow] ${e}`,...t)}},{key:"finished",value:function(){var e;this.flowLog(`finished() — closing flow, isPaused=${this.isPaused}, step=${null===(e=this.currentFlowStep)||void 0===e?void 0:e.id}`),this.manager.finishFlow()}},{key:"dismiss",value:function(){this.signalNonCompletion("dismiss_page"),this.finished()}},{key:"back",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){if(!this.stepcrumbs.slice(0,-1).some(e=>"screen"===e.type))return this.flowLog("back() — no previous screen step, dismissing flow"),void this.dismiss();this.backToPreviousScreenStep()}else _i.debug(`Not allowed to go back to ${this.previousFlowStep.id}`)}},{key:"bindImpression",value:function(e){var t=this.currentFlowStep;if(t){var n=this.completionContext;n&&n.stepId===t.id&&!n.impressionId?n.impressionId=e:this.completionContext={stepId:t.id,impressionId:e,resultSent:!1,pending:[]};var i=t.completion_step;null!=i&&i.enabled&&"page_view"===i.condition&&this.completionSignal("page_view");var a=this.completionContext.pending;this.completionContext.pending=[],a.forEach(e=>this.completionSignal(e))}}},{key:"completionSignal",value:function(e){var t=this.currentFlowStep,n=null==t?void 0:t.completion_step;if(t&&null!=n&&n.enabled&&n.condition===e){var i=this.completionContext;i&&i.stepId===t.id||(i=this.completionContext={stepId:t.id,resultSent:!1,pending:[]}),i.resultSent||(i.impressionId?(i.resultSent=!0,this.patchCompletion(i.impressionId,e)):i.pending.includes(e)||i.pending.push(e))}}},{key:"signalNonCompletion",value:function(e){var t=this.completionContext;t&&t.impressionId&&!t.resultSent&&(t.resultSent=!0,this.patchCompletion(t.impressionId,e))}},{key:"patchCompletion",value:function(e,t){var n,i;return k(function(r){for(;;)switch(r.p=r.n){case 0:return this.flowLog(`patchCompletion(${t}) — impression=${e}, step=${null===(n=this.currentFlowStep)||void 0===n?void 0:n.id}`),r.p=1,r.n=2,a(Bu.instance.patchImpressionCompletion(e,t,(new Date).toISOString()));case 2:r.n=4;break;case 3:r.p=3,i=r.v,_i.error(`[NamiFlow] completion PATCH failed for '${t}'`,i);case 4:return r.a(2)}},null,this,[[1,3]],Promise)}},{key:"next",value:function(){var e=this.nextFlowStep;e&&this.forward(e.id)}},{key:"backToPreviousScreenStep",value:function(){var e;if(!1!==(null===(e=this.previousFlowStep)||void 0===e?void 0:e.allow_back_to)){for(var t=this.stepcrumbs.length-2;t>=0;t--){var n=this.stepcrumbs[t];if(this.stepcrumbs.pop(),"branch"===n.type&&this.branchcrumbs.length>0&&this.branchcrumbs.pop(),"screen"===n.type&&n.screen){var i,a,r=Vu(n.screen);return r&&we().ui.flowNavigateToScreen(r,{transition:this.transition,direction:"backward"}),void(this.currentScreenState=null!==(i=null===(a=sm.currentProvider)||void 0===a?void 0:a.state)&&void 0!==i?i:null)}}_i.warn("No previous screen step found to return to")}else _i.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 xm:case Lm:return this.stepcrumbs.push(t),void this.executeLifecycle(t,jm);case Im:return void this.handleBranchStep(t);case Cm:return void this.handleScreenStep(t);case Fm:return}else this.flowLog(`forward(${e}) — step not active (branch_tags=${JSON.stringify(t.branch_tags)}, branchcrumbs=${JSON.stringify(this.branchcrumbs)})`);else _i.error(`No step found with id: ${e}`)}},{key:"pause",value:function(){var e;this.isPaused?_i.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}`),_i.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}`),_i.info(`Flow resumed from step ${e}`),this.forward(e)}else _i.warn("No step to resume from");else _i.info("Flow is not paused")}},{key:"executeLifecycle",value:function(e,t,n){t===Km?this.completionSignal("purchase_success"):t===Um&&this.completionSignal("login_success");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;_i.info(`No actions found for button ${e} on step ${this.currentFlowStep.id}`)}}},{key:"isFormSubmitLifecycle",value:function(e){var t=[Dm.SET_TAGS_FROM_FORM,Dm.NEXT,Dm.NAVIGATE];return e.some(e=>[e.before,e.action,e.after].some(e=>null==e?void 0:e.some(e=>t.includes(e.function))))}},{key:"captureBuySkuData",value:function(e,t){var n,i,a;e===Wm&&null!=t&&t.sku&&(this.purchasedSku="sku_ref_id"in(n=t.sku)?{skuRefId:n.sku_ref_id,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(a=n.product_details)&&void 0!==a?a:null}:{skuRefId:n.skuId,name:n.name,entitlements:Array.isArray(n.entitlements)?n.entitlements:[],productDetails:null!==(i=n.productDetails)&&void 0!==i?i:null})}},{key:"triggerActions",value:function(e,t,n){var i,a,r;this.captureBuySkuData(e,n);var o=this.lifecycles(e);if(o){this.flowLog(`triggerActions(${e}) — step=${null===(i=this.currentFlowStep)||void 0===i?void 0:i.id}, isPaused=${this.isPaused}`),this.currentButton=t;var s=null!==(a=null===(r=sm.currentProvider)||void 0===r?void 0:r.state.formFieldValidators)&&void 0!==a?a:{};if(this.isFormSubmitLifecycle(o)&&Object.keys(s).length){var u,l=function(e,t){for(var n={},i=0,a=Object.entries(e);i<a.length;i++){var r,o=a[i],s=o[0],u=o[1],l=Bf(u.type,u.required,t[s]);void 0!==l&&(n[s]=null!==(r=u.message)&&void 0!==r?r:l)}return n}(s,this.getFormData());if(null===(u=sm.currentProvider)||void 0===u||u.setFormFieldErrors(l),Object.keys(l).length)return void this.flowLog(`triggerActions(${e}) — HALTED by form validation: ${JSON.stringify(l)}`)}this.executeFullLifecycles(o,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){this.captureBuySkuData(e,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){this.captureBuySkuData(e,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=vf.shared.evaluate(e);if(Pm.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";_i.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;if((null===(i=this.currentFlowStep)||void 0===i?void 0:i.id)===n)switch(e.function){case Dm.BACK:this.back();break;case Dm.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 Dm.NAVIGATE:var h;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===(h=this.previousFlowStep)||void 0===h?void 0:h.id)===e.parameters.step?this.back():this.forward(e.parameters.step);else this.next();break;case Dm.FINISHED:this.finished();break;case Dm.DISMISS:this.dismiss();break;case Dm.EXIT:this.signalNonCompletion("skip_page");var m=this.steps.find(e=>e.type===Lm);m&&this.forward(m.id);break;case Dm.PAUSE:this.pause();break;case Dm.RESUME:this.resumeFromPause();break;case Dm.HANDOFF:var f,v,p,g,y,b,w=null===(f=e.parameters)||void 0===f?void 0:f.handoffTag;if(!w)break;if(null!==(v=e.parameters)&&void 0!==v&&v.handoffFormId&&this.completionSignal("form_submitted"),w.startsWith("__")){var k;w===Rm&&null!==(k=e.parameters)&&void 0!==k&&k.handoffFormId?this.flowHandoffFormSequence():(_i.warn(`Ignoring reserved handoff tag '${w}' — resuming flow`),this.manager.resume());break}if(!this.manager.hasHandoffHandler){_i.debug("No handoffStepHandler found",e);break}if(w===Om.UserData&&null!==(p=e.parameters)&&void 0!==p&&p.handoffFormId){this.manager.deliverHandoff(w,this.buildUserDataEnvelope(e.parameters.handoffFormId));break}null!==(g=e.parameters)&&void 0!==g&&g.handoffData?b=e.parameters.handoffData:t?b=t:null!==(y=e.parameters)&&void 0!==y&&y.handoffFormId&&(b=this.getFormData()),_i.debug(`Invoking handoff handler with ${w}${b?` ${JSON.stringify(b)}`:" and no data"}`),this.manager.deliverHandoff(w,b);break;case Dm.LOG:var S;if(null!==(u=e.parameters)&&void 0!==u&&u.eventName)_i.info(`logEvent → ${e.parameters.eventName}`);else _i.warn(`Missing 'eventName' in logEvent action ${null!==(S=e.id)&&void 0!==S?S:"unknown"}`);break;case Dm.TRACK:var E;if(null!==(l=e.parameters)&&void 0!==l&&l.eventName)_i.info(`trackEvent → ${e.parameters.eventName}`);else _i.warn(`Missing 'eventName' in logEvent action ${null!==(E=e.id)&&void 0!==E?E:"unknown"}`);break;case Dm.SET_VIDEO:null!==(d=e.parameters)&&void 0!==d&&d.name&&e.parameters.url?sm.setAppSuppliedVideoDetails({name:e.parameters.name,url:e.parameters.url}):_i.warn("Missing name, url for setting video details");break;case Dm.BLOCK_BACK:var P,T=null===(P=e.parameters)||void 0===P?void 0:P.step,_=T?this.getStep(T):void 0;_?_.allow_back_to=!1:this.currentFlowStep?this.currentFlowStep.allow_back_to=!1:_i.warn("Missing step for blocking back");break;case Dm.FLOW_EVENT:var M,A=new _f(this.manager),D=Object.fromEntries(Object.entries(null!==(M=e.parameters)&&void 0!==M?M:{}).map(([e,t])=>[e,A.interpolateDeep(t)]));this.manager.eventHandler?this.manager.eventHandler(D):_i.warn("Missing event handler",D);break;case Dm.FLOW_ENABLED:sm.setUserInteractionEnabled(!0);break;case Dm.FLOW_DISABLED:sm.setUserInteractionEnabled(!1);break;case Dm.SET_TAGS:e.parameters&&(sm.setUserTags(e.parameters),Object.entries(e.parameters).forEach(([e,t])=>{Of.setCustomerAttribute(e,t)}));break;case Dm.SET_TAGS_FROM_FORM:var x,C=null===(x=e.parameters)||void 0===x?void 0:x.include,I=Array.isArray(C)?new Set(C):void 0,L=this.getFormData(),F={};Object.entries(L).forEach(([e,t])=>{if(!I||I.has(e)){var n=Sf(t);void 0!==n&&(F[e]=n,Of.setCustomerAttribute(e,n))}}),Object.keys(F).length&&sm.setUserTags(F);break;case Dm.SET_LAUNCH_CONTEXT:var R=e.parameters;null!=R&&R.customAttributes?this.applyLaunchContextAttributes(R.customAttributes):void 0!==(null==R?void 0:R.key)&&void 0!==(null==R?void 0:R.value)&&this.applyLaunchContextAttributes({[R.key]:R.value});break;case Dm.SET_FLOW_PATH:var O,$=null===(O=e.parameters)||void 0===O?void 0:O.flowPath;"string"==typeof $&&(this.flowPath=$);break;default:_i.warn(`Missing action handler for ${e.function}`,e)}else this.flowLog(`performAction(${e.function}) — SKIPPED stale step ${n}, current=${null===(c=this.currentFlowStep)||void 0===c?void 0:c.id}`)};a?setTimeout(r.bind(this,this.currentFlowStep.id),a):r(this.currentFlowStep.id)}else _i.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}_i.debug(`No active next step found after ${e.id}`)}else _i.error(`Could not find next step for step ${e.id}`)}else _i.error("Next step not found")}},{key:"handleScreenStep",value:function(e){var t,n=Vu(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"})):_i.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 _i.warn(`No actions defined for branch tag ${a}`)}}_i.warn(`No matching branch condition matched for step ${e.id}`)}},{key:"getFormData",value:function(){var e,t;return m({},null!==(e=null===(t=sm.currentProvider)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.formStates)&&void 0!==e?e:{})}},{key:"buildUserDataEnvelope",value:function(e){var t,n;return{form_id:e,step_id:null!==(t=null===(n=this.currentFlowStep)||void 0===n?void 0:n.id)&&void 0!==t?t:"",collected_at:(new Date).toISOString(),fields:this.getFormData()}}},{key:"flowHandoffFormSequence",value:function(){var e,t=null===(e=this.currentScreenState)||void 0===e?void 0:e.formStates;if(t){var n=Object.keys(t);if(0!==n.length){if(n.some(e=>zf.test(e))){var i=this.buildHandoffGroups(t);return 0===i.length?(_i.info("No handoff groups after grouping"),void this.manager.resume()):(this.activeHandoffSequence={groups:i},void this.resumeNextHandoff())}var a=n.sort().filter(e=>!0===t[e]);if(0===a.length)return _i.info("No eligible handoff keys after filtering"),void this.manager.resume();this.activeHandoffSequence={formStates:m({},t),remainingKeys:[...a]},this.resumeNextHandoff()}else _i.warn("formStates is empty, no handoffs to perform")}else _i.warn("No formStates available for handoff sequence")}},{key:"buildHandoffGroups",value:function(e){for(var t=new Map,n=0,i=Object.keys(e);n<i.length;n++){var a=i[n],r=a.match(zf);if(r){var o=r[1],s=r[2];o.startsWith("__")?_i.warn(`Ignoring reserved handoff group tag '${o}'`):(t.has(o)||t.set(o,{}),t.get(o)[s]=e[a])}}return Array.from(t,([e,t])=>({tag:e,data:t})).filter(e=>Object.values(e.data).some(e=>!0===e)).sort((e,t)=>e.tag.localeCompare(t.tag))}},{key:"resumeNextHandoff",value:function(){var e=this.activeHandoffSequence;if(!e)return _i.warn("No active handoff sequence to resume"),void this.manager.resume();if("groups"in e){if(0===e.groups.length)return _i.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var t=e.groups.shift();return function(e){return Object.values(Om).includes(e)}(t.tag)||_i.warn(`handoff group tag '${t.tag}' is outside the NamiHandoffTag vocabulary — passing through`),this.activeHandoffSequence=e,_i.debug(`Starting grouped handoff for '${t.tag}' → ${JSON.stringify(t.data)}`),void this.manager.deliverHandoff(t.tag,t.data)}if(0===e.remainingKeys.length)return _i.info("All handoffs in the sequence are complete"),this.activeHandoffSequence=null,void this.manager.resume();var n=e.remainingKeys.shift(),i=e.formStates[n];_i.debug(`Starting handoff for ${n} → ${String(i)}`),this.activeHandoffSequence=e,this.manager.deliverHandoff(`${n}`,void 0)}}])}(Uf),Gf=function(){return c(function e(){o(this,e),this.emitter=Vd.getInstance()},[{key:"sdkInitialized",get:function(){return Pm.instance.isInitialized}},{key:"campaignTypeAndLabel",value:function(t,n){var i,a="";return t&&!n&&Pd(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 ho;return Md()}},{key:"isCampaignAvailable",value:function(e){if(!this.instance.sdkInitialized)throw new ho;var t=this.instance.campaignTypeAndLabel(e),n=t.type,i=t.value,a=Id(i,n),r=a.campaign,o=a.paywall;return null!=r&&r.flow?new Uf(r.flow.object).allScreensAvailable:Boolean(r&&o)}},{key:"isFlow",value:function(e,t){if(!this.instance.sdkInitialized)throw new ho;var n=this.instance.campaignTypeAndLabel(e,t),i=n.type,a=n.value;return zu(Id(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 ho;case 1:return iu(),e.n=2,a(gm.instance.fetchCampaignsAndPaywalls());case 2:return e.a(2,Md())}},null,this,null,Promise)}},{key:"registerAvailableCampaignsHandler",value:function(e){return this.instance.emitter.addListener(ui,e),()=>{this.instance.emitter.removeListener(ui,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 ho;var k,S=pm.firstLaunchLookup(w,()=>Id(w,b)),E=S.paywall,P=S.campaign,T=!P||!E&&!P.flow;T&&(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 _={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=so.getPurchaseChannel();M&&(_=m({},_,{purchaseChannel:M}));var A,D,x,C,I,L,F,R,O=null===(h=i)||void 0===h?void 0:h.productGroups,$=null===(f=E)||void 0===f||null===(f=f.sku_menus)||void 0===f?void 0:f.map(e=>e.ref);if((x=null===(A=so.getNamiConfig())||void 0===A?void 0:A.namiCommands,null!==(D=null==x?void 0:x.includes(fn))&&void 0!==D&&D&&null!=O&&O.length&&null!=$)&&0==(null==$?void 0:$.filter(e=>null==O?void 0:O.some(t=>t===e))).length)throw a(!1,e.LaunchCampaignError.PRODUCT_GROUPS_NOT_FOUND),new po;if(null!=P&&P.flow&&!Ku(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 go;T||Em.shared.record({placementLabel:null!==(C=null!==(I=null==P?void 0:P.value)&&void 0!==I?I:w)&&void 0!==C?C:"",tags:null!==(L=null==P?void 0:P.placement_tags)&&void 0!==L?L:[],customAttributes:null!==(F=null===(R=i)||void 0===R?void 0:R.customAttributes)&&void 0!==F?F:{}});var N=we().ui.createPaywall(b,w,i),W=Iu();return so.setLaunchId(W),r&&this.instance.emitter.addListener(di,t=>{var n=t.action,i=y(t,ge);r(m({},_,i,{action:null!=n?n:e.NamiPaywallAction.UNKNOWN}))}),setTimeout(()=>a(!0),0),N}},{key:"getProductGroups",value:function(e,t){var n,i,a=this.instance.campaignTypeAndLabel(e,t),r=a.type,o=a.value;return null!==(n=null===(i=Id(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=Id(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=Id(o,r),u=sm.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:[]}}])}();Gf.instance=new Gf;var Vf=Gf,Kf=Of,Yf=function(){return c(function e(){o(this,e),this.emitter=Vd.getInstance()},[{key:"sdkInitialized",get:function(){return Pm.instance.isInitialized}}],[{key:"active",value:function(){return au(),lm()}},{key:"isEntitlementActive",value:function(e){return!!au("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 ho;case 1:if(au("NamiEntitlementManager.refresh")){e.n=2;break}return e.a(2,[]);case 2:return e.n=3,a(hm.instance.fetchActiveEntitlements());case 3:return e.a(2,lm())}},null,this,null,Promise)}},{key:"registerActiveEntitlementsHandler",value:function(e){if(au("NamiEntitlementManager.registerActiveEntitlementsHandler"))return this.instance.emitter.addListener(hi,e),()=>{this.instance.emitter.removeListener(hi,e)}}},{key:"clearProvisionalEntitlementGrants",value:function(){var e=lm();e=e.filter(e=>e.expires&&e.expires>(new Date).valueOf()),so.setNamiEntitlements(_t,e),this.instance.emitter.emit(hi)}}])}();Yf.instance=new Yf;var Xf,qf,Jf=Yf,Qf=Lf,Zf=If,ev=Pc,tv={upperLeft:"border-top-left-radius",upperRight:"border-top-right-radius",lowerLeft:"border-bottom-left-radius",lowerRight:"border-bottom-right-radius"},nv={left:"border-left-style",right:"border-right-style",top:"border-top-style",bottom:"border-bottom-style"},iv="wave",av="pulse",rv="none";function ov(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 sv(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}(ov(Ae),e)>=0||_i.warn(`Component ${t} requires SDK version ${e.semver} or higher, but current SDK version is ${Ae}`))}function uv(e){return!e||"object"==typeof e&&0==Object.keys(e).length}!function(e){e.DEFAULT="default",e.LABEL="label",e.URL="url"}(Xf||(Xf={})),function(e){e.DEEPLINK="deeplink",e.IN_APP="in_app"}(qf||(qf={}));var lv=Vf,dv=Kf,cv=Zf,hv=Jf,mv=Qf,fv=ev,vv=wm,pv=Object.freeze({__proto__:null,NamiCampaignManager:lv,NamiCustomerManager:dv,NamiEntitlementManager:hv,NamiFlowManager:mv,NamiPaywallManager:cv,NamiProfileManager:vv,NamiPurchaseManager:fv}),gv=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 yv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bv,wv={exports:{}};var kv=(bv||(bv=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}})}(wv)),wv.exports),Sv=yv(kv),Ev={tablet:"tablet",mobile:"phone",tv:"television",desktop:"desktop"},Pv={"1280x720":.67,"1920x1080":1,"3840x2160":2,"7680x4320":4},Tv=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=Sv.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=Ev[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=Sv.getParser(window.navigator.userAgent).getPlatform();return e.type&&Ev[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=Pv[r])&&void 0!==t?t:Math.min(i/1920,a/1080)||1}},{key:"getScreenInfo",value:function(){var e,t,n,i;return"undefined"==typeof window?{width:1920,height:1080,scale:1}:{width:null!==(e=null===(t=window.screen)||void 0===t?void 0:t.width)&&void 0!==e?e:window.innerWidth,height:null!==(n=null===(i=window.screen)||void 0===i?void 0:i.height)&&void 0!==n?n:window.innerHeight,scale:window.devicePixelRatio||1}}},{key:"getLanguage",value:function(){return"undefined"==typeof window?"en":window.navigator.language||"en"}},{key:"onAppForeground",value:function(e){if("undefined"==typeof document)return()=>{};var t=()=>{"visible"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}},{key:"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 _v(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 Mv,Av,Dv,xv=globalThis,Cv=xv.ShadowRoot&&(void 0===xv.ShadyCSS||xv.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Iv=Symbol(),Lv=new WeakMap,Fv=function(){return c(function e(t,n,i){if(o(this,e),this._$cssResult$=!0,i!==Iv)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(Cv&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=Lv.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Lv.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}])}(),Rv=e=>new Fv("string"==typeof e?e:e+"",void 0,Iv),Ov=(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 Fv(n,e,Iv)},$v=Cv?e=>e:e=>e instanceof CSSStyleSheet?(e=>{for(var t,n="",i=h(e.cssRules);!(t=i()).done;){n+=t.value.cssText}return Rv(n)})(e):e,Nv=Object.is,Wv=Object.defineProperty,jv=Object.getOwnPropertyDescriptor,Bv=Object.getOwnPropertyNames,zv=Object.getOwnPropertySymbols,Uv=Object.getPrototypeOf,Hv=globalThis,Gv=Hv.trustedTypes,Vv=Gv?Gv.emptyScript:"",Kv=Hv.reactiveElementPolyfillSupport,Yv=(e,t)=>e,Xv={toAttribute(e,t){switch(t){case Boolean:e=e?Vv: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}},qv=(e,t)=>!Nv(e,t),Jv={attribute:!0,type:String,converter:Xv,reflect:!1,useDefault:!1,hasChanged:qv};null!==(Mv=Symbol.metadata)&&void 0!==Mv||(Symbol.metadata=Symbol("metadata")),null!==(Av=Hv.litPropertyMetadata)&&void 0!==Av||(Hv.litPropertyMetadata=new WeakMap);var Qv,Zv=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(Cv)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=xv.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:Xv).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:Xv;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:qv)(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=Jv){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&&Wv(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var i,a=null!==(i=jv(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:Jv}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Yv("elementProperties"))){var e=Uv(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Yv("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Yv("properties")))for(var e=this.properties,t=0,n=[...Bv(e),...zv(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($v(a))}else void 0!==e&&t.push($v(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}])}(M(HTMLElement));Zv.elementStyles=[],Zv.shadowRootOptions={mode:"open"},Zv[Yv("elementProperties")]=new Map,Zv[Yv("finalized")]=new Map,null!=Kv&&Kv({ReactiveElement:Zv}),(null!==(Dv=Hv.reactiveElementVersions)&&void 0!==Dv?Dv:Hv.reactiveElementVersions=[]).push("2.1.2");var ep=globalThis,tp=e=>e,np=ep.trustedTypes,ip=np?np.createPolicy("lit-html",{createHTML:e=>e}):void 0,ap="$lit$",rp=`lit$${Math.random().toFixed(9).slice(2)}$`,op="?"+rp,sp=`<${op}>`,up=document,lp=()=>up.createComment(""),dp=e=>null===e||"object"!=typeof e&&"function"!=typeof e,cp=Array.isArray,hp="[ \t\n\f\r]",mp=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,fp=/-->/g,vp=/>/g,pp=RegExp(`>|${hp}(?:([^\\s"'>=/]+)(${hp}*=${hp}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),gp=/'/g,yp=/"/g,bp=/^(?:script|style|textarea|title)$/i,wp=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),kp=wp(1),Sp=wp(2),Ep=Symbol.for("lit-noChange"),Pp=Symbol.for("lit-nothing"),Tp=new WeakMap,_p=up.createTreeWalker(up,129);function Mp(e,t){if(!cp(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ip?ip.createHTML(t):t}var Ap=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=mp,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===mp?"!--"===d[1]?o=fp:void 0!==d[1]?o=vp:void 0!==d[2]?(bp.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=pp):void 0!==d[3]&&(o=pp):o===pp?">"===d[0]?(o=null!=n?n:mp,c=-1):void 0===d[1]?c=-2:(c=o.lastIndex-d[2].length,l=d[1],o=void 0===d[3]?pp:'"'===d[3]?yp:gp):o===yp||o===gp?o=pp:o===fp||o===vp?o=mp:(o=pp,n=void 0);var m=o===pp&&e[s+1].startsWith("/>")?" ":"";r+=o===mp?u+sp:c>=0?(a.push(l),u.slice(0,c)+ap+u.slice(c)+rp+m):u+rp+(-2===c?s:m)}return[Mp(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),_p.currentNode=this.el.content,2===n||3===n){var f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;null!==(a=_p.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(ap)){var y=m[s++],b=a.getAttribute(g).split(rp),w=/([.?@])?(.*)/.exec(y);l.push({type:1,index:r,name:w[2],strings:b,ctor:"."===w[1]?Lp:"?"===w[1]?Fp:"@"===w[1]?Rp:Ip}),a.removeAttribute(g)}else g.startsWith(rp)&&(l.push({type:6,index:r}),a.removeAttribute(g))}if(bp.test(a.tagName)){var k=a.textContent.split(rp),S=k.length-1;if(S>0){a.textContent=np?np.emptyScript:"";for(var E=0;E<S;E++)a.append(k[E],lp()),_p.nextNode(),l.push({type:2,index:++r});a.append(k[S],lp())}}}else if(8===a.nodeType)if(a.data===op)l.push({type:2,index:r});else for(var P=-1;-1!==(P=a.data.indexOf(rp,P+1));)l.push({type:7,index:r}),P+=rp.length-1;r++}},null,[{key:"createElement",value:function(e,t){var n=up.createElement("template");return n.innerHTML=e,n}}])}();function Dp(e,t,n=e,i){var a,r,o,s,u;if(t===Ep)return t;var l=void 0!==i?null===(a=n._$Co)||void 0===a?void 0:a[i]:n._$Cl,d=dp(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=Dp(e,l._$AS(e,t.values),l,i)),t}var xp=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:up).importNode(i,!0);_p.currentNode=r;for(var o=_p.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 Cp(o,o.nextSibling,this,e):1===l.type?c=new l.ctor(o,l.name,l.strings,this,e):6===l.type&&(c=new Op(o,this,e)),this._$AV.push(c),l=a[++u]}s!==(null===(d=l)||void 0===d?void 0:d.index)&&(o=_p.nextNode(),s++)}return _p.currentNode=up,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++}}}])}(),Cp=function(){return c(function e(t,n,i,a){var r;o(this,e),this.type=2,this._$AH=Pp,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=Dp(this,e,t),dp(e)?e===Pp||null==e||""===e?(this._$AH!==Pp&&this._$AR(),this._$AH=Pp):e!==this._$AH&&e!==Ep&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>cp(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!==Pp&&dp(this._$AH)?this._$AA.nextSibling.data=e:this.T(up.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=Ap.createElement(Mp(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 xp(a,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}},{key:"_$AC",value:function(e){var t=Tp.get(e.strings);return void 0===t&&Tp.set(e.strings,t=new Ap(e)),t}},{key:"k",value:function(e){cp(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(lp()),this.O(lp()),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=tp(e).nextSibling;tp(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))}}])}(),Ip=function(){return c(function e(t,n,i,a,r){o(this,e),this.type=1,this._$AH=Pp,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=Pp},[{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=Dp(this,e,t,0),(r=!dp(e)||e!==this._$AH&&e!==Ep)&&(this._$AH=e);else{var o,s,u=e;for(e=a[0],o=0;o<a.length-1;o++)(s=Dp(this,u[n+o],t,o))===Ep&&(s=this._$AH[o]),r||(r=!dp(s)||s!==this._$AH[o]),s===Pp?e=Pp:e!==Pp&&(e+=(null!=s?s:"")+a[o+1]),this._$AH[o]=s}r&&!i&&this.j(e)}},{key:"j",value:function(e){e===Pp?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}])}(),Lp=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===Pp?void 0:e}}])}(Ip),Fp=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!==Pp)}}])}(Ip),Rp=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=Dp(this,e,t,0))&&void 0!==n?n:Pp)!==Ep){var i=this._$AH,a=e===Pp&&i!==Pp||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==Pp&&(i===Pp||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)}}])}(Ip),Op=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){Dp(this,e)}}])}(),$p={I:Cp},Np=ep.litHtmlPolyfillSupport;null!=Np&&Np(Ap,Cp),(null!==(Qv=ep.litHtmlVersions)&&void 0!==Qv?Qv:ep.litHtmlVersions=[]).push("3.3.3");var Wp,jp,Bp=globalThis,zp=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)([]);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)([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 Cp(t.insertBefore(lp(),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)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;T(t,"disconnectedCallback",this)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Ep}}])}(Zv);zp._$litElement$=!0,zp.finalized=!0,null===(Wp=Bp.litElementHydrateSupport)||void 0===Wp||Wp.call(Bp,{LitElement:zp});var Up=Bp.litElementPolyfillSupport;null==Up||Up({LitElement:zp}),(null!==(jp=Bp.litElementVersions)&&void 0!==jp?jp:Bp.litElementVersions=[]).push("4.2.2");var Hp,Gp,Vp=Ov(Hp||(Hp=(e=>e)`
2
2
  /* ——— keyframes ——— */
3
3
  @keyframes nami-slide-up {
4
4
  from { transform: translateY(100%); }
@@ -459,7 +459,7 @@
459
459
  `),e,e,e,function(e){return oM[e]||oM.CheckCircleOutlined}(e))}},{key:"render",value:function(){return this.renderSvgIcon(this.shouldRenderCurrentIcon()?this.component.name:this.previousSymbolName)}}])}(_E);_v([Jp({type:Object})],X$.prototype,"component",void 0),_v([Jp({type:Boolean})],X$.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],X$.prototype,"scaleFactor",void 0),X$=_v([Yp("nami-symbol")],X$);var q$=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return p(t,e),c(t,[{key:"styles",value:function(){var e=this.component,t=this.scaleFactor,n=this.inFocusedState,i=e.hidden,a=e.fontSize,r=e.alignment,o=e.strikethrough,s=e.spacing;return Rv(`\n :host {\n ${H$(e,t)}\n display: ${i?"none":"grid"};\n overflow-wrap: anywhere;\n width: fit-content;\n ${BE(e,n)}\n ${V$(e,n)}\n font-size: ${(null!=a?a:z$)*t}px;\n text-align: ${r||"center"};\n ${ZE("string"!=typeof o&&o)}\n ${eP(e.fontName)}\n ${iP(e,t,n)}\n ${B$(e)}\n ${UE(e)}\n ${function({alignment:e,horizontalAlignment:t}){return DE("justify-content",t&&ME[t]?ME[t]:e&&ME[e]?ME[e]:"center")}(e)}\n }\n :host > :not(:first-child) {\n margin-top: ${s||0}px;\n }\n .anticon {\n text-rendering: optimizelegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: inherit;\n display: inline-block;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -.125em;\n }\n .anticon svg {\n display: inline-block;\n line-height: 1;\n }\n\n :host .bullet-text-wrapper {\n ${H$(e,t)}\n display: inline;\n overflow-wrap: anywhere;\n width: fit-content;\n ${BE(e,n)}\n ${V$(e,n)}\n font-size: ${(null!=a?a:z$)*t}px;\n text-align: ${r||"center"};\n ${ZE("string"!=typeof o&&o)}\n ${eP(e.fontName)}\n }\n ${B$(e,":host .bullet-text-wrapper")}\n :host .bullet-text-wrapper p {\n margin: 0;\n /* NAM-1409: re-applied here (not only on the wrapper) so the p's own\n computed default doesn't shadow the inherited value — see NAM-2875. */\n ${H$(e,t)}\n }\n \n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n \n `)}},{key:"render",value:function(){var e=this.component,t=e.fontColor,n=e.fontSize,i=e.activeFontColor,a=e.bulletComponent,r=e.texts,o=e.spacing,s=a?m({fontColor:t,fontSize:n,activeFontColor:i,spacing:o},a):null;if(!Array.isArray(r))return kp(F$||(F$=j$``));var u=G$(this.component),l=r.map(e=>e?kp(R$||(R$=j$`<nami-text-list-item-wrapper aria-hidden="${0}" .component=${0} .scaleFactor=${0}>
460
460
  ${0}
461
461
  <div class="bullet-text-wrapper" .innerHTML="${0}"></div>
462
- </nami-text-list-item-wrapper>`),u?"true":Pp,this.component,this.scaleFactor,s&&kp(O$||(O$=j$`<nami-symbol .component=${0} .scaleFactor=${0}></nami-symbol>`),s,this.scaleFactor),a_(e)):null);return kp($$||($$=j$`${0}${0}`),l,u?kp(N$||(N$=j$`<span class="sr-only">${0}</span>`),u):Pp)}}])}(_E);_v([Jp({type:Object})],q$.prototype,"component",void 0),_v([Jp({type:Boolean})],q$.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],q$.prototype,"scaleFactor",void 0),q$=_v([Yp("nami-text-list")],q$);(()=>{var e,t=!0;try{new RegExp("􏿿","u"),new RegExp("😀","u"),new RegExp("\\p{P}","u")}catch(e){t=!1}if(!t){var n=null===(e=a_.Lexer)||void 0===e?void 0:e.rules,i=null==n?void 0:n.inline;i&&Object.values(i).forEach(e=>{e&&Object.keys(e).forEach(t=>{e[t]=(e=>{if(!(e instanceof RegExp))return e;if(!/\\p\{/.test(e.source))return e;var t="!\"#$%&'()*+,\\-./:;<=>?@[\\\\]^_`{|}~",n=e.source.replace(/\\p\{P\}\\p\{S\}/g,t).replace(/\\p\{P\}/g,t).replace(/\\p\{S\}/g,t),i=e.flags.replace(/u/g,"");return new RegExp(n,i)})(e[t])})})}})();var J$=function(e){function t(){var e;return o(this,t),(e=r(this,t)).inFocusedState=!1,e.scaleFactor=1,e.focusWithin=!1,e.handleFocusIn=()=>e.setFocusState(!0),e.handleFocusOut=t=>{var n,i,a=null!==(n=t.relatedTarget)&&void 0!==n?n:null;if(!a)return e.setFocusState(!1);a===e||null!==(i=e.shadowRoot)&&void 0!==i&&i.contains(a)||e.setFocusState(!1)},e.handleFocusChanged=t=>{var n=t.detail;e.setFocusState(!0===(null==n?void 0:n.inFocusedState))},e.addEventListener("focusin",e.handleFocusIn),e.addEventListener("focusout",e.handleFocusOut),e.addEventListener("focus-changed",e.handleFocusChanged),e}return p(t,e),c(t,[{key:"disconnectedCallback",value:function(){T(t,"disconnectedCallback",this)([]),this.removeEventListener("focusin",this.handleFocusIn),this.removeEventListener("focusout",this.handleFocusOut),this.removeEventListener("focus-changed",this.handleFocusChanged)}},{key:"styles",value:function(){var e=this.component,t=this.scaleFactor,n=this.minSDKVersion,i=e.backgroundBlur,a="vertical"===e.direction,r=a?"width":"height",o=a?"margin-top":"margin-left",s=Rv(zE(e)),u=Boolean(e.fillColor||e.fillImage),l=e.roundBorders,d=Array.isArray(l)&&l.length>0&&l.length<4,c=u&&d?"overflow: hidden;":"";return Rv(`\n :host {\n box-sizing: border-box;\n display: ${e.hidden?"none":"flex"};\n ${i?`backdrop-filter: blur(${i}px);`:""}\n ${s};\n ${c}\n ${rP(e.position)}\n ${UE(e)}\n ${iP(e,t,!1)}\n }\n :host(:focus),\n :host(.nami-focus-within){\n ${BE(e,!0)}\n ${iP(e,t,!0)}\n }\n :host(:focus-visible){\n ${lP(e)}\n }\n :host > * {\n ${GE(n,r)}\n }\n :host > *:not(:first-child) {\n ${o}: ${e.spacing?e.spacing*t:0}px;\n }\n `)}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map(e=>BP(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))}},{key:"setFocusState",value:function(e){this.focusWithin!==e&&(this.focusWithin=e,this.classList.toggle("nami-focus-within",e),this.toggleAttribute("data-nami-focused",e))}}])}(_E);function Q$(e,t){return e===t||e!=e&&t!=t}function Z$(e,t){for(var n=e.length;n--;)if(Q$(e[n][0],t))return n;return-1}_v([Jp({type:Object})],J$.prototype,"component",void 0),_v([Jp({type:Boolean})],J$.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],J$.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],J$.prototype,"minSDKVersion",void 0),J$=_v([Yp("nami-container")],J$);var eN=Array.prototype.splice;function tN(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 nN(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}tN.prototype.clear=function(){this.__data__=[],this.size=0},tN.prototype.delete=function(e){var t=this.__data__,n=Z$(t,e);return!(n<0)&&(n==t.length-1?t.pop():eN.call(t,n,1),--this.size,!0)},tN.prototype.get=function(e){var t=this.__data__,n=Z$(t,e);return n<0?void 0:t[n][1]},tN.prototype.has=function(e){return Z$(this.__data__,e)>-1},tN.prototype.set=function(e,t){var n=this.__data__,i=Z$(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function iN(e){if(!nN(e))return!1;var t=Wy(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var aN=xy["__core-js_shared__"],rN=function(){var e=/[^.]+$/.exec(aN&&aN.keys&&aN.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var oN=Function.prototype.toString;function sN(e){if(null!=e){try{return oN.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var uN=/^\[object .+?Constructor\]$/,lN=Function.prototype,dN=Object.prototype,cN=lN.toString,hN=dN.hasOwnProperty,mN=RegExp("^"+cN.call(hN).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fN(e){return!(!nN(e)||function(e){return!!rN&&rN in e}(e))&&(iN(e)?mN:uN).test(sN(e))}function vN(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return fN(n)?n:void 0}var pN=vN(xy,"Map"),gN=vN(Object,"create");var yN=Object.prototype.hasOwnProperty;var bN=Object.prototype.hasOwnProperty;function wN(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 kN(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 SN(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])}}wN.prototype.clear=function(){this.__data__=gN?gN(null):{},this.size=0},wN.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wN.prototype.get=function(e){var t=this.__data__;if(gN){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return yN.call(t,e)?t[e]:void 0},wN.prototype.has=function(e){var t=this.__data__;return gN?void 0!==t[e]:bN.call(t,e)},wN.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gN&&void 0===t?"__lodash_hash_undefined__":t,this},SN.prototype.clear=function(){this.size=0,this.__data__={hash:new wN,map:new(pN||tN),string:new wN}},SN.prototype.delete=function(e){var t=kN(this,e).delete(e);return this.size-=t?1:0,t},SN.prototype.get=function(e){return kN(this,e).get(e)},SN.prototype.has=function(e){return kN(this,e).has(e)},SN.prototype.set=function(e,t){var n=kN(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function EN(e){var t=this.__data__=new tN(e);this.size=t.size}EN.prototype.clear=function(){this.__data__=new tN,this.size=0},EN.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},EN.prototype.get=function(e){return this.__data__.get(e)},EN.prototype.has=function(e){return this.__data__.has(e)},EN.prototype.set=function(e,t){var n=this.__data__;if(n instanceof tN){var i=n.__data__;if(!pN||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new SN(i)}return n.set(e,t),this.size=n.size,this};function PN(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new SN;++t<n;)this.add(e[t])}function TN(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 _N(e,t){return e.has(t)}PN.prototype.add=PN.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},PN.prototype.has=function(e){return this.__data__.has(e)};function MN(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 PN: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(!TN(t,function(e,t){if(!_N(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 AN=xy.Uint8Array;function DN(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function xN(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var CN=Cy?Cy.prototype:void 0,IN=CN?CN.valueOf:void 0;var LN=Object.prototype.propertyIsEnumerable,FN=Object.getOwnPropertySymbols,RN=FN?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}(FN(e),function(t){return LN.call(e,t)}))}:function(){return[]};function ON(e){return jy(e)&&"[object Arguments]"==Wy(e)}var $N=Object.prototype,NN=$N.hasOwnProperty,WN=$N.propertyIsEnumerable,jN=ON(function(){return arguments}())?ON:function(e){return jy(e)&&NN.call(e,"callee")&&!WN.call(e,"callee")};var BN="object"==typeof e&&e&&!e.nodeType&&e,zN=BN&&"object"==typeof module&&module&&!module.nodeType&&module,UN=zN&&zN.exports===BN?xy.Buffer:void 0,HN=(UN?UN.isBuffer:void 0)||function(){return!1},GN=/^(?:0|[1-9]\d*)$/;function VN(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&GN.test(e))&&e>-1&&e%1==0&&e<t}function KN(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var YN={};YN["[object Float32Array]"]=YN["[object Float64Array]"]=YN["[object Int8Array]"]=YN["[object Int16Array]"]=YN["[object Int32Array]"]=YN["[object Uint8Array]"]=YN["[object Uint8ClampedArray]"]=YN["[object Uint16Array]"]=YN["[object Uint32Array]"]=!0,YN["[object Arguments]"]=YN["[object Array]"]=YN["[object ArrayBuffer]"]=YN["[object Boolean]"]=YN["[object DataView]"]=YN["[object Date]"]=YN["[object Error]"]=YN["[object Function]"]=YN["[object Map]"]=YN["[object Number]"]=YN["[object Object]"]=YN["[object RegExp]"]=YN["[object Set]"]=YN["[object String]"]=YN["[object WeakMap]"]=!1;var XN="object"==typeof e&&e&&!e.nodeType&&e,qN=XN&&"object"==typeof module&&module&&!module.nodeType&&module,JN=qN&&qN.exports===XN&&Ay.process,QN=function(){try{var e=qN&&qN.require&&qN.require("util").types;return e||JN&&JN.binding&&JN.binding("util")}catch(e){}}(),ZN=QN&&QN.isTypedArray,eW=ZN?function(e){return function(t){return e(t)}}(ZN):function(e){return jy(e)&&KN(e.length)&&!!YN[Wy(e)]},tW=Object.prototype.hasOwnProperty;function nW(e,t){var n=Iy(e),i=!n&&jN(e),a=!n&&!i&&HN(e),r=!n&&!i&&!a&&eW(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)!tW.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||VN(l,u))||s.push(l);return s}var iW=Object.prototype;var aW=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),rW=Object.prototype.hasOwnProperty;function oW(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||iW))return aW(e);var t,n,i=[];for(var a in Object(e))rW.call(e,a)&&"constructor"!=a&&i.push(a);return i}function sW(e){return null!=(t=e)&&KN(t.length)&&!iN(t)?nW(e):oW(e);var t}function uW(e){return function(e,t,n){var i=t(e);return Iy(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,sW,RN)}var lW=Object.prototype.hasOwnProperty;var dW=vN(xy,"DataView"),cW=vN(xy,"Promise"),hW=vN(xy,"Set"),mW=vN(xy,"WeakMap"),fW="[object Map]",vW="[object Promise]",pW="[object Set]",gW="[object WeakMap]",yW="[object DataView]",bW=sN(dW),wW=sN(pN),kW=sN(cW),SW=sN(hW),EW=sN(mW),PW=Wy;(dW&&PW(new dW(new ArrayBuffer(1)))!=yW||pN&&PW(new pN)!=fW||cW&&PW(cW.resolve())!=vW||hW&&PW(new hW)!=pW||mW&&PW(new mW)!=gW)&&(PW=function(e){var t=Wy(e),n="[object Object]"==t?e.constructor:void 0,i=n?sN(n):"";if(i)switch(i){case bW:return yW;case wW:return fW;case kW:return vW;case SW:return pW;case EW:return gW}return t});var TW="[object Arguments]",_W="[object Array]",MW="[object Object]",AW=Object.prototype.hasOwnProperty;function DW(e,t,n,i,a,r){var o=Iy(e),s=Iy(t),u=o?_W:PW(e),l=s?_W:PW(t),d=(u=u==TW?MW:u)==MW,c=(l=l==TW?MW:l)==MW,h=u==l;if(h&&HN(e)){if(!HN(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new EN),o||eW(e)?MN(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 AN(e),new AN(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Q$(+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=DN;case"[object Set]":var u=1&i;if(s||(s=xN),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=MN(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(IN)return IN.call(e)==IN.call(t)}return!1}(e,t,u,n,i,a,r);if(!(1&n)){var m=d&&AW.call(e,"__wrapped__"),f=c&&AW.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new EN),a(v,p,n,i,r)}}return!!h&&(r||(r=new EN),function(e,t,n,i,a,r){var o=1&n,s=uW(e),u=s.length;if(u!=uW(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:lW.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 xW(e,t,n,i,a){return e===t||(null==e||null==t||!jy(e)&&!jy(t)?e!=e&&t!=t:DW(e,t,n,i,xW,a))}function CW(e,t){return xW(e,t)}var IW=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return p(t,e),c(t,[{key:"styles",value:function(){var e=this.component.backgroundBlur,t="vertical"===this.component.direction,n=t?"width":"height",i=t?"margin-top":"margin-left",a=Rv(zE(this.component));return Rv(`\n :host {\n opacity: 0;\n display: ${this.component.hidden?"none":"flex"};\n ${a};\n ${e?`backdrop-filter: blur(${e}px);`:""}\n ${rP(this.component.position)}\n ${UE(this.component)}\n ${iP(this.component,this.scaleFactor,!1)}\n transition: transform .5s ease-in;\n }\n :host > *:not(:first-child) {\n ${i}: ${this.component.spacing?this.component.spacing*this.scaleFactor:0}px;\n }\n :host(:focus){\n ${BE(this.component,!0)}\n ${iP(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${lP(this.component)}\n }\n :host > * {\n ${n}: 100%;\n }\n :host(.fade-in){\n opacity: 1;\n animation: fadeIn 0.5s ease-in\n }\n @keyframes fadeIn {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n `)}},{key:"updated",value:function(){var e=this.contextProvider.state.currentGroupId;CW(e,this.currentGroupId)||(this.classList.remove("fade-in"),setTimeout(()=>this.classList.add("fade-in"),100),this.currentGroupId=e)}},{key:"render",value:function(){var e,t,n,i=this.contextProvider.state,a=i.mediaList,r=i.currentGroupId,o=i.selectedPaywall,s=i.formFactor,u="all"===(null===(e=this.component)||void 0===e?void 0:e.products)?r:(null===(t=this.component)||void 0===t?void 0:t.subsetGroup)||r,l=Bb(this.contextProvider.productDetails,null!==(n=null==o?void 0:o.sku_menus)&&void 0!==n?n:[],u);return qb(this.contextProvider,l,this.component,a).map(([e,t])=>(this.inFocusedState="television"==s?e:this.inFocusedState,t.map(e=>BP(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))}}])}(_E);_v([Jp({type:Object})],IW.prototype,"component",void 0),_v([Jp({type:Boolean})],IW.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],IW.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],IW.prototype,"minSDKVersion",void 0),IW=_v([Yp("nami-product-container")],IW);var LW,FW,RW=e=>e;function OW(e){if("number"==typeof e)return 0!==e;if("string"==typeof e){var t=parseFloat(e);return!isNaN(t)&&0!==t}return!1}var $W=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return p(t,e),c(t,[{key:"styles",value:function(){var e,t=this.component,n=t.imageCropping,i=t.alignment,a=t.height,r=t.width,o=t.rightMargin,s=t.spacing,u=t.hidden,l=t.blur,d="fit"===n,c=this.contextConsumer.state.formFactor,h=$E(null!=a?a:"100%",this.scaleFactor),m=$E(null!==(e="fitContent"==r?a:r)&&void 0!==e?e:"100%",this.scaleFactor),f="string"==typeof a&&a.includes("%")||void 0===a,v="phone"===c&&f?"max-height":"height",p=OW(this.component.moveX)||OW(this.component.moveY);return Rv(`\n :host {\n display: ${"television"===c?"flex":"inline-block"};\n ${u?"display:none;":""}\n position: relative;\n ${p?YE(this.component,this.scaleFactor):""}\n ${v}: ${h};\n width: ${m};\n }\n :host img {\n transition: all 0.3s;\n /* Don't ride the host's text baseline: a strut taller than a small image\n (dots, inline logos) pushes it below the host box. Keep the inline line\n box itself, though — percent-height hosts on phone size from it. */\n vertical-align: top;\n object-fit: ${d?"contain":"cover"};\n object-position: ${i} center;\n ${v}: ${h};\n width: ${m};\n margin-right: ${o||s||0}px;\n ${l?`filter: blur(${l}px);`:""}\n flex-shrink: ${"number"==typeof r?0:1};\n }\n `)}},{key:"render",value:function(){var e,t=this.component,n=t.url,i=t.alt,a=t.title,r=t.focusedBorderColor,o=t.focusedFillColor,s=t.fillColor;return n?(!r&&uw(s,o)||(this.tabIndex=0),this.ariaLabel=null!==(e=null!=i?i:a)&&void 0!==e?e:"",kp(LW||(LW=RW`<img src="${0}" alt="${0}" />`),n,this.ariaLabel)):(this.tabIndex=-1,this.ariaLabel=null,kp(FW||(FW=RW``)))}}])}(_E);_v([Jp({type:Object})],$W.prototype,"component",void 0),_v([Jp({type:Boolean})],$W.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],$W.prototype,"scaleFactor",void 0),$W=_v([Yp("nami-image")],$W);var NW=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).fullscreen=!1,e.inFocusedState=!1,e.scaleFactor=1,e}return p(t,e),c(t,[{key:"connectedCallback",value:function(){T(t,"connectedCallback",this)([]),!!document.querySelector("nami-paywall.nami-half-sheet-mode, nami-paywall.nami-modal-mode")||(document.body.style.background=this.component.fillColor||"transparent")}},{key:"styles",value:function(){var e;if(!this.contextConsumer||!this.component)return Rv("");var t=this.component,n=this.scaleFactor,i=this.contextConsumer.state.formFactor,a=t.backgroundBlur,r="vertical"===t.direction?"margin-top":"margin-left";return Rv(`\n :host {\n max-height: ${"television"===i?"100vh":""};\n display: ${t.hidden?"none":"flex"};\n flex-direction: column;\n overflow: hidden;\n ${HE(t)}\n position: var(--nami-bg-position, fixed);\n width: 100%;\n bottom: 0px;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n z-index: ${null!==(e=t.zIndex)&&void 0!==e?e:1};\n top: 0px;\n ${a?`backdrop-filter: blur(${a}px);`:""}\n ${BE(t,!1)}\n transition: all 0.3s;\n ${KE(t,n)}\n }\n :host(:focus){\n ${BE(t,!0)}\n }\n :host > *:not(:first-child) {\n ${r}: ${t.spacing?t.spacing*n:0}px;\n }\n `)}},{key:"updated",value:function(){}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map(e=>BP(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion))}}])}(_E);_v([Jp({type:Object})],NW.prototype,"component",void 0),_v([Jp({type:Boolean})],NW.prototype,"fullscreen",void 0),_v([Jp({type:Boolean})],NW.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],NW.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],NW.prototype,"minSDKVersion",void 0),NW=_v([Yp("nami-background-container")],NW);var WW,jW=e=>e,BW=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).zIndex=2,e.inFocusedState=!1,e.scaleFactor=1,e}return p(t,e),c(t,[{key:"styles",value:function(){var e,t,n=this.contextConsumer,i=this.component,a=this.zIndex,r=this.scaleFactor;if(!n)return Ov(WW||(WW=jW``));var o=n.state.formFactor,s=i.backgroundBlur,u="phone"!==o?"width: 100%;":"",l=null!==(e=i.width)&&void 0!==e?e:i.fixedWidth,d=null!==(t=i.height)&&void 0!==t?t:i.fixedHeight,c="phone"===o?`max-width:100%;\n ${void 0!==l?`width: ${$E(l,r)};`:""}\n ${void 0!==d?`height: ${$E(d,r)};`:""}`:qE(i,r),h="vertical"===i.direction?"margin-top":"margin-left";return Rv(`\n :host {\n box-sizing: border-box;\n display: ${i.hidden?"none":"flex"};\n position: relative;\n flex: 1;\n min-height: 0;\n ${UE(i)}\n ${c}\n ${u}\n ${function(e){var t,n,i=e.verticalAlignment,a=e.horizontalAlignment,r=e.direction,o=i?ME[i]:void 0,s=a?ME[a]:void 0;return"vertical"===r?(t=null!=s?s:"center",n=null!=o?o:"start"):(t=null!=o?o:"center",n=null!=s?s:"start"),`${DE("align-items",t)}${DE("justify-content",n)}`}(i)}\n ${s?`backdrop-filter: blur(${s}px);`:""}\n z-index: ${a};\n transition: all 0.3s;\n overflow-y: ${"television"===o?"hidden":"scroll"};\n overflow-x: hidden;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n ${KE(i,r)}\n /* The footer is position:absolute over this container; inset the\n scroll end by its measured height (--nami-footer-height, set by\n the paywall screen) so bottom content is not hidden behind it. */\n padding-bottom: calc(${OE(r,i.bottomPadding)}px + var(--nami-footer-height, 0px));\n ${BE(i,!1)}\n }\n :host::-webkit-scrollbar {\n display: none;\n }\n :host(:focus){\n ${BE(i,!0)}\n }\n :host > * {\n width: 100%;\n }\n :host > *:not(:first-child) {\n ${h}: ${i.spacing?i.spacing*r:0}px;\n }\n `)}},{key:"firstUpdated",value:function(){var e=new CustomEvent("child-spacing",{detail:{spacing:this.component.spacing},bubbles:!0,composed:!0});this.dispatchEvent(e)}},{key:"render",value:function(){var e;return(null===(e=this.component.components)||void 0===e?void 0:e.map(e=>BP(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion)))||[]}}])}(_E);_v([Jp({type:Object})],BW.prototype,"component",void 0),_v([Jp({type:Number})],BW.prototype,"zIndex",void 0),_v([Jp({type:Boolean})],BW.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],BW.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],BW.prototype,"minSDKVersion",void 0),BW=_v([Yp("nami-content-container")],BW);var zW,UW=e=>e,HW=function(e){function t(){var e;return o(this,t),(e=r(this,t)).inFocusedState=!1,e.scaleFactor=1,e._anyItemFocused=!1,e._handleClick=t=>{t.preventDefault(),LS({contextProvider:e.contextProvider,onTap:e.component.onTap})},e._handleFocusIn=t=>{var n,i,a=t.target;if("nami-segment-picker-item"===(null===(n=a.tagName)||void 0===n?void 0:n.toLowerCase())){if(e._isTv&&(e._anyItemFocused=!0,!e._cameFromInside(t.relatedTarget))){var r,o=null===(r=e.shadowRoot)||void 0===r?void 0:r.querySelector("nami-segment-picker-item.active");if(o&&o!==a)return void o.focus()}"television"===(null===(i=e.contextProvider)||void 0===i||null===(i=i.state)||void 0===i?void 0:i.formFactor)&&e.contextProvider.clearSelectedProduct(e.contextProvider.getCurrentGroupId())}},e._handleFocusOut=t=>{e._isTv&&(e._cameFromInside(t.relatedTarget)||(e._anyItemFocused=!1))},e.addEventListener("click",e._handleClick),e}return p(t,e),c(t,[{key:"_isTv",get:function(){return"television"===Cu()}},{key:"firstUpdated",value:function(e){var n,i;T(t,"firstUpdated",this)([e]),null===(n=this.shadowRoot)||void 0===n||n.addEventListener("focusin",this._handleFocusIn),null===(i=this.shadowRoot)||void 0===i||i.addEventListener("focusout",this._handleFocusOut)}},{key:"disconnectedCallback",value:function(){var e,n;T(t,"disconnectedCallback",this)([]),null===(e=this.shadowRoot)||void 0===e||e.removeEventListener("focusin",this._handleFocusIn),null===(n=this.shadowRoot)||void 0===n||n.removeEventListener("focusout",this._handleFocusOut)}},{key:"_cameFromInside",value:function(e){var t,n;return!!e&&("nami-segment-picker-item"===(null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase())||!(null===(n=this.shadowRoot)||void 0===n||!n.contains(e)))}},{key:"styles",value:function(){var e,t,n,i=oP("active",this.component.components[0]),a=oP("inactive",this.component.components[0]),r=(null===(e=this.component.components[0])||void 0===e?void 0:e.focusedFillColor)||i.fillColor,o=this._anyItemFocused;return Rv(`\n :host {\n box-sizing: border-box;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n display: flex;\n flex: 0 0 auto;\n position: relative;\n ${UE(this.component)}\n /* Keep the container's base fill even when an item is focused. Repainting\n the whole container to the (often light) focused fill washes out the\n inactive item's text — the focused item's own pill is the indicator.\n The focused border still reacts via applyStyles(containerFocused). */\n ${BE(this.component,!1)}\n ${iP(this.component,this.scaleFactor,o)}\n ${this.component.hidden?"display:none;":""}\n }\n :host(:focus){\n ${BE(this.component,!0)}\n ${iP(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${lP(this.component)}\n }\n .toggle{\n ${t=this.component,n=this.scaleFactor,`\n position: absolute;\n top: ${OE(n,t.topPadding)}px;\n bottom: ${OE(n,t.bottomPadding)}px;\n width: calc(50% - ${OE(n,t.leftPadding)/2}px) !important;\n `}\n transition: transform .5s cubic-bezier(.77, 0, .175, 1);\n ${sP(a,this.scaleFactor,!1)}\n }\n\n :host(:focus) .toggle{\n ${sP(i,this.scaleFactor,!0)}\n }\n\n nami-segment-picker-item:nth-of-type(1).active~.toggle {\n transform: translateX(0%);\n left: ${this.component.leftPadding?Number(this.component.leftPadding)*this.scaleFactor:0}px;\n ${BE(i,!0)}\n ${uP(i,this.scaleFactor)}\n }\n\n nami-segment-picker-item:nth-of-type(2).active~.toggle {\n transform: translateX(100%);\n right: ${this.component.rightPadding?Number(this.component.rightPadding)*this.scaleFactor:0}px;\n ${BE(i,!0)}\n ${uP(i,this.scaleFactor)}\n }\n\n nami-segment-picker-item:nth-of-type(1).focused~.toggle {\n transform: translateX(0%);\n left: ${this.component.leftPadding?Number(this.component.leftPadding)*this.scaleFactor:0}px;\n ${r?`background-color: ${r} !important;`:""}\n }\n\n nami-segment-picker-item:nth-of-type(2).focused~.toggle {\n transform: translateX(100%);\n right: ${this.component.rightPadding?Number(this.component.rightPadding)*this.scaleFactor:0}px;\n ${r?`background-color: ${r} !important;`:""}\n }\n `)}},{key:"render",value:function(){this.role="tablist";var e=this.component.components.map(e=>BP(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion));return kp(zW||(zW=UW`${0}<div class="toggle"></div>`),e)}}])}(_E);_v([Jp({type:Object})],HW.prototype,"component",void 0),_v([Jp({type:Boolean})],HW.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],HW.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],HW.prototype,"minSDKVersion",void 0),_v([Qp()],HW.prototype,"_anyItemFocused",void 0),HW=_v([Yp("nami-segment-picker")],HW);var GW,VW=e=>e,KW=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e._isFocused=!1,e._handleFocus=()=>{e.inFocusedState=!0,e._isTv&&(e._isFocused=!0,e.classList.add("focused"))},e._handleBlur=()=>{e.inFocusedState=!1,e._isTv&&(e._isFocused=!1,e.classList.remove("focused"))},e._handleKeyDown=t=>{"Enter"===t.key||" "===t.key||142===t.keyCode||195===t.keyCode?e._handleClick():!e._isTv||"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e._moveFocusToSibling("ArrowRight"===t.key?1:-1),t.preventDefault())},e._handleClick=()=>{e._updateFormState(),e.requestUpdate("component")},e._handleHover=()=>{e.inFocusedState=!0},e}return p(t,e),c(t,[{key:"_isTv",get:function(){return"television"===Cu()}},{key:"connectedCallback",value:function(){T(t,"connectedCallback",this)([]),this._isActive=!!this.component.checked,this.classList.toggle("active",this._isActive),this.component.formId&&this._updateFormState(),this.addEventListener("click",this._handleClick),this.addEventListener("mouseover",this._handleHover),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("focus",this._handleFocus),this.addEventListener("blur",this._handleBlur)}},{key:"disconnectedCallback",value:function(){T(t,"disconnectedCallback",this)([]),this.removeEventListener("click",this._handleClick),this.removeEventListener("mouseover",this._handleHover),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("focus",this._handleFocus),this.removeEventListener("blur",this._handleBlur)}},{key:"_moveFocusToSibling",value:function(e){var t=this.getRootNode();if(t instanceof ShadowRoot){var n=Array.from(t.querySelectorAll("nami-segment-picker-item")),i=n.indexOf(this);if(!(i<0)){var a=i+e;a>=0&&a<n.length&&n[a].focus()}}}},{key:"_getParentPicker",value:function(){var e=this.getRootNode();return e instanceof ShadowRoot?e.host:null}},{key:"_getParentFormId",value:function(){var e;return null===(e=this._getParentPicker())||void 0===e?void 0:e.component.formId}},{key:"_updateFormState",value:function(){if(this.contextProvider)if(this.component.formId){var e=this._getParentFormId();e&&this.contextProvider.setFormState(e,this.component.formId)}else this.component.id&&this.contextProvider.setCurrentGroupData(this.component.id,this.component.text||"")}},{key:"updated",value:function(e){var t;if(e.has("component")&&this.contextProvider){var n=null!==(t=e.get("component"))&&void 0!==t?t:this.component;if(n.formId){var i=this._getParentFormId();i&&this.contextProvider.state.formStates[i]&&(this._isActive=this.contextProvider.state.formStates[i]===n.formId)}else this._isActive=CW(n.id,this.contextProvider.state.currentGroupId);if(this.classList.toggle("active",this._isActive),this._isActive){var a=this.getRootNode();if(a instanceof ShadowRoot)a.querySelectorAll("nami-segment-picker-item").forEach(e=>{e!==this&&e.requestUpdate("component",e)})}}}},{key:"styles",value:function(){var e,t,n=oP("active",this.component),i=oP("inactive",this.component),a=this.component.focusedFontColor||n.fontColor||i.fontColor||"";return Rv(`\n :host {\n box-sizing: border-box;\n display: ${this.component.hidden?"none":"inline-flex"};\n position: relative;\n /* On television the sliding .toggle pill is the sole active/focus\n indicator, so the item's own background must stay inactive — otherwise\n it double-renders the focus fill and the previously-focused item stays\n lit. On other form factors there is no .focused pill, so the item\n background carries the hover/focus indication. */\n ${sP(m({},i,this.component),this.scaleFactor,!this._isTv&&this.inFocusedState)}\n ${QE(null!==(e=this.component.inactiveDropShadow)&&void 0!==e?e:this.component.dropShadow)}\n }\n\n :host > * {\n cursor: pointer;\n }\n\n :host(.active) {\n z-index: 1 !important;\n ${uP(m({},n,this.component),this.scaleFactor)}\n ${QE(null!==(t=this.component.activeDropShadow)&&void 0!==t?t:this.component.dropShadow)}\n }\n\n :host(.focused) {\n z-index: 2 !important;\n outline: none !important;\n ${a?jE(a):""}\n }\n\n :host(:focus-visible) {\n outline: none !important;\n }\n\n input {\n visibility: hidden;\n position: absolute;\n top: 0;\n }\n `)}},{key:"render",value:function(){return this.tabIndex=0,this.role="tab",this.ariaSelected=`${this._isActive}`,this.ariaLabel=this.component.text||"",kp(GW||(GW=VW`<input type="radio"
462
+ </nami-text-list-item-wrapper>`),u?"true":Pp,this.component,this.scaleFactor,s&&kp(O$||(O$=j$`<nami-symbol .component=${0} .scaleFactor=${0}></nami-symbol>`),s,this.scaleFactor),a_(e)):null);return kp($$||($$=j$`${0}${0}`),l,u?kp(N$||(N$=j$`<span class="sr-only">${0}</span>`),u):Pp)}}])}(_E);_v([Jp({type:Object})],q$.prototype,"component",void 0),_v([Jp({type:Boolean})],q$.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],q$.prototype,"scaleFactor",void 0),q$=_v([Yp("nami-text-list")],q$);(()=>{var e,t=!0;try{new RegExp("􏿿","u"),new RegExp("😀","u"),new RegExp("\\p{P}","u")}catch(e){t=!1}if(!t){var n=null===(e=a_.Lexer)||void 0===e?void 0:e.rules,i=null==n?void 0:n.inline;i&&Object.values(i).forEach(e=>{e&&Object.keys(e).forEach(t=>{e[t]=(e=>{if(!(e instanceof RegExp))return e;if(!/\\p\{/.test(e.source))return e;var t="!\"#$%&'()*+,\\-./:;<=>?@[\\\\]^_`{|}~",n=e.source.replace(/\\p\{P\}\\p\{S\}/g,t).replace(/\\p\{P\}/g,t).replace(/\\p\{S\}/g,t),i=e.flags.replace(/u/g,"");return new RegExp(n,i)})(e[t])})})}})();var J$=function(e){function t(){var e;return o(this,t),(e=r(this,t)).inFocusedState=!1,e.scaleFactor=1,e.focusWithin=!1,e.handleFocusIn=()=>e.setFocusState(!0),e.handleFocusOut=t=>{var n,i,a=null!==(n=t.relatedTarget)&&void 0!==n?n:null;if(!a)return e.setFocusState(!1);a===e||null!==(i=e.shadowRoot)&&void 0!==i&&i.contains(a)||e.setFocusState(!1)},e.handleFocusChanged=t=>{var n=t.detail;e.setFocusState(!0===(null==n?void 0:n.inFocusedState))},e.addEventListener("focusin",e.handleFocusIn),e.addEventListener("focusout",e.handleFocusOut),e.addEventListener("focus-changed",e.handleFocusChanged),e}return p(t,e),c(t,[{key:"disconnectedCallback",value:function(){T(t,"disconnectedCallback",this)([]),this.removeEventListener("focusin",this.handleFocusIn),this.removeEventListener("focusout",this.handleFocusOut),this.removeEventListener("focus-changed",this.handleFocusChanged)}},{key:"styles",value:function(){var e=this.component,t=this.scaleFactor,n=this.minSDKVersion,i=e.backgroundBlur,a="vertical"===e.direction,r=a?"width":"height",o=a?"margin-top":"margin-left",s=Rv(zE(e)),u=Boolean(e.fillColor||e.fillImage),l=e.roundBorders,d=Array.isArray(l)&&l.length>0&&l.length<4,c=u&&d?"overflow: hidden;":"";return Rv(`\n :host {\n box-sizing: border-box;\n display: ${e.hidden?"none":"flex"};\n ${i?`backdrop-filter: blur(${i}px);`:""}\n ${s};\n ${c}\n ${rP(e.position)}\n ${UE(e)}\n ${iP(e,t,!1)}\n }\n :host(:focus),\n :host(.nami-focus-within){\n ${BE(e,!0)}\n ${iP(e,t,!0)}\n }\n :host(:focus-visible){\n ${lP(e)}\n }\n :host > * {\n ${GE(n,r)}\n }\n :host > *:not(:first-child) {\n ${o}: ${e.spacing?e.spacing*t:0}px;\n }\n `)}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map(e=>BP(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))}},{key:"setFocusState",value:function(e){this.focusWithin!==e&&(this.focusWithin=e,this.classList.toggle("nami-focus-within",e),this.toggleAttribute("data-nami-focused",e))}}])}(_E);function Q$(e,t){return e===t||e!=e&&t!=t}function Z$(e,t){for(var n=e.length;n--;)if(Q$(e[n][0],t))return n;return-1}_v([Jp({type:Object})],J$.prototype,"component",void 0),_v([Jp({type:Boolean})],J$.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],J$.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],J$.prototype,"minSDKVersion",void 0),J$=_v([Yp("nami-container")],J$);var eN=Array.prototype.splice;function tN(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 nN(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}tN.prototype.clear=function(){this.__data__=[],this.size=0},tN.prototype.delete=function(e){var t=this.__data__,n=Z$(t,e);return!(n<0)&&(n==t.length-1?t.pop():eN.call(t,n,1),--this.size,!0)},tN.prototype.get=function(e){var t=this.__data__,n=Z$(t,e);return n<0?void 0:t[n][1]},tN.prototype.has=function(e){return Z$(this.__data__,e)>-1},tN.prototype.set=function(e,t){var n=this.__data__,i=Z$(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function iN(e){if(!nN(e))return!1;var t=Wy(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var aN=xy["__core-js_shared__"],rN=function(){var e=/[^.]+$/.exec(aN&&aN.keys&&aN.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var oN=Function.prototype.toString;function sN(e){if(null!=e){try{return oN.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var uN=/^\[object .+?Constructor\]$/,lN=Function.prototype,dN=Object.prototype,cN=lN.toString,hN=dN.hasOwnProperty,mN=RegExp("^"+cN.call(hN).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fN(e){return!(!nN(e)||function(e){return!!rN&&rN in e}(e))&&(iN(e)?mN:uN).test(sN(e))}function vN(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return fN(n)?n:void 0}var pN=vN(xy,"Map"),gN=vN(Object,"create");var yN=Object.prototype.hasOwnProperty;var bN=Object.prototype.hasOwnProperty;function wN(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 kN(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 SN(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])}}wN.prototype.clear=function(){this.__data__=gN?gN(null):{},this.size=0},wN.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wN.prototype.get=function(e){var t=this.__data__;if(gN){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return yN.call(t,e)?t[e]:void 0},wN.prototype.has=function(e){var t=this.__data__;return gN?void 0!==t[e]:bN.call(t,e)},wN.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gN&&void 0===t?"__lodash_hash_undefined__":t,this},SN.prototype.clear=function(){this.size=0,this.__data__={hash:new wN,map:new(pN||tN),string:new wN}},SN.prototype.delete=function(e){var t=kN(this,e).delete(e);return this.size-=t?1:0,t},SN.prototype.get=function(e){return kN(this,e).get(e)},SN.prototype.has=function(e){return kN(this,e).has(e)},SN.prototype.set=function(e,t){var n=kN(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function EN(e){var t=this.__data__=new tN(e);this.size=t.size}EN.prototype.clear=function(){this.__data__=new tN,this.size=0},EN.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},EN.prototype.get=function(e){return this.__data__.get(e)},EN.prototype.has=function(e){return this.__data__.has(e)},EN.prototype.set=function(e,t){var n=this.__data__;if(n instanceof tN){var i=n.__data__;if(!pN||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new SN(i)}return n.set(e,t),this.size=n.size,this};function PN(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new SN;++t<n;)this.add(e[t])}function TN(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 _N(e,t){return e.has(t)}PN.prototype.add=PN.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},PN.prototype.has=function(e){return this.__data__.has(e)};function MN(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 PN: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(!TN(t,function(e,t){if(!_N(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 AN=xy.Uint8Array;function DN(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function xN(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var CN=Cy?Cy.prototype:void 0,IN=CN?CN.valueOf:void 0;var LN=Object.prototype.propertyIsEnumerable,FN=Object.getOwnPropertySymbols,RN=FN?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}(FN(e),function(t){return LN.call(e,t)}))}:function(){return[]};function ON(e){return jy(e)&&"[object Arguments]"==Wy(e)}var $N=Object.prototype,NN=$N.hasOwnProperty,WN=$N.propertyIsEnumerable,jN=ON(function(){return arguments}())?ON:function(e){return jy(e)&&NN.call(e,"callee")&&!WN.call(e,"callee")};var BN="object"==typeof e&&e&&!e.nodeType&&e,zN=BN&&"object"==typeof module&&module&&!module.nodeType&&module,UN=zN&&zN.exports===BN?xy.Buffer:void 0,HN=(UN?UN.isBuffer:void 0)||function(){return!1},GN=/^(?:0|[1-9]\d*)$/;function VN(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&("number"==n||"symbol"!=n&&GN.test(e))&&e>-1&&e%1==0&&e<t}function KN(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var YN={};YN["[object Float32Array]"]=YN["[object Float64Array]"]=YN["[object Int8Array]"]=YN["[object Int16Array]"]=YN["[object Int32Array]"]=YN["[object Uint8Array]"]=YN["[object Uint8ClampedArray]"]=YN["[object Uint16Array]"]=YN["[object Uint32Array]"]=!0,YN["[object Arguments]"]=YN["[object Array]"]=YN["[object ArrayBuffer]"]=YN["[object Boolean]"]=YN["[object DataView]"]=YN["[object Date]"]=YN["[object Error]"]=YN["[object Function]"]=YN["[object Map]"]=YN["[object Number]"]=YN["[object Object]"]=YN["[object RegExp]"]=YN["[object Set]"]=YN["[object String]"]=YN["[object WeakMap]"]=!1;var XN="object"==typeof e&&e&&!e.nodeType&&e,qN=XN&&"object"==typeof module&&module&&!module.nodeType&&module,JN=qN&&qN.exports===XN&&Ay.process,QN=function(){try{var e=qN&&qN.require&&qN.require("util").types;return e||JN&&JN.binding&&JN.binding("util")}catch(e){}}(),ZN=QN&&QN.isTypedArray,eW=ZN?function(e){return function(t){return e(t)}}(ZN):function(e){return jy(e)&&KN(e.length)&&!!YN[Wy(e)]},tW=Object.prototype.hasOwnProperty;function nW(e,t){var n=Iy(e),i=!n&&jN(e),a=!n&&!i&&HN(e),r=!n&&!i&&!a&&eW(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)!tW.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||VN(l,u))||s.push(l);return s}var iW=Object.prototype;var aW=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),rW=Object.prototype.hasOwnProperty;function oW(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||iW))return aW(e);var t,n,i=[];for(var a in Object(e))rW.call(e,a)&&"constructor"!=a&&i.push(a);return i}function sW(e){return null!=(t=e)&&KN(t.length)&&!iN(t)?nW(e):oW(e);var t}function uW(e){return function(e,t,n){var i=t(e);return Iy(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,sW,RN)}var lW=Object.prototype.hasOwnProperty;var dW=vN(xy,"DataView"),cW=vN(xy,"Promise"),hW=vN(xy,"Set"),mW=vN(xy,"WeakMap"),fW="[object Map]",vW="[object Promise]",pW="[object Set]",gW="[object WeakMap]",yW="[object DataView]",bW=sN(dW),wW=sN(pN),kW=sN(cW),SW=sN(hW),EW=sN(mW),PW=Wy;(dW&&PW(new dW(new ArrayBuffer(1)))!=yW||pN&&PW(new pN)!=fW||cW&&PW(cW.resolve())!=vW||hW&&PW(new hW)!=pW||mW&&PW(new mW)!=gW)&&(PW=function(e){var t=Wy(e),n="[object Object]"==t?e.constructor:void 0,i=n?sN(n):"";if(i)switch(i){case bW:return yW;case wW:return fW;case kW:return vW;case SW:return pW;case EW:return gW}return t});var TW="[object Arguments]",_W="[object Array]",MW="[object Object]",AW=Object.prototype.hasOwnProperty;function DW(e,t,n,i,a,r){var o=Iy(e),s=Iy(t),u=o?_W:PW(e),l=s?_W:PW(t),d=(u=u==TW?MW:u)==MW,c=(l=l==TW?MW:l)==MW,h=u==l;if(h&&HN(e)){if(!HN(t))return!1;o=!0,d=!1}if(h&&!d)return r||(r=new EN),o||eW(e)?MN(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 AN(e),new AN(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Q$(+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=DN;case"[object Set]":var u=1&i;if(s||(s=xN),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=MN(s(e),s(t),i,a,r,o);return o.delete(e),d;case"[object Symbol]":if(IN)return IN.call(e)==IN.call(t)}return!1}(e,t,u,n,i,a,r);if(!(1&n)){var m=d&&AW.call(e,"__wrapped__"),f=c&&AW.call(t,"__wrapped__");if(m||f){var v=m?e.value():e,p=f?t.value():t;return r||(r=new EN),a(v,p,n,i,r)}}return!!h&&(r||(r=new EN),function(e,t,n,i,a,r){var o=1&n,s=uW(e),u=s.length;if(u!=uW(t).length&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:lW.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 xW(e,t,n,i,a){return e===t||(null==e||null==t||!jy(e)&&!jy(t)?e!=e&&t!=t:DW(e,t,n,i,xW,a))}function CW(e,t){return xW(e,t)}var IW=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return p(t,e),c(t,[{key:"styles",value:function(){var e=this.component.backgroundBlur,t="vertical"===this.component.direction,n=t?"width":"height",i=t?"margin-top":"margin-left",a=Rv(zE(this.component));return Rv(`\n :host {\n opacity: 0;\n display: ${this.component.hidden?"none":"flex"};\n ${a};\n ${e?`backdrop-filter: blur(${e}px);`:""}\n ${rP(this.component.position)}\n ${UE(this.component)}\n ${iP(this.component,this.scaleFactor,!1)}\n transition: transform .5s ease-in;\n }\n :host > *:not(:first-child) {\n ${i}: ${this.component.spacing?this.component.spacing*this.scaleFactor:0}px;\n }\n :host(:focus){\n ${BE(this.component,!0)}\n ${iP(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${lP(this.component)}\n }\n :host > * {\n ${n}: 100%;\n }\n :host(.fade-in){\n opacity: 1;\n animation: fadeIn 0.5s ease-in\n }\n @keyframes fadeIn {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n `)}},{key:"updated",value:function(){var e=this.contextProvider.state.currentGroupId;CW(e,this.currentGroupId)||(this.classList.remove("fade-in"),setTimeout(()=>this.classList.add("fade-in"),100),this.currentGroupId=e)}},{key:"render",value:function(){var e,t,n,i=this.contextProvider.state,a=i.mediaList,r=i.currentGroupId,o=i.selectedPaywall,s=i.formFactor,u="all"===(null===(e=this.component)||void 0===e?void 0:e.products)?r:(null===(t=this.component)||void 0===t?void 0:t.subsetGroup)||r,l=Bb(this.contextProvider.productDetails,null!==(n=null==o?void 0:o.sku_menus)&&void 0!==n?n:[],u);return qb(this.contextProvider,l,this.component,a).map(([e,t])=>(this.inFocusedState="television"==s?e:this.inFocusedState,t.map(e=>BP(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion))))}}])}(_E);_v([Jp({type:Object})],IW.prototype,"component",void 0),_v([Jp({type:Boolean})],IW.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],IW.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],IW.prototype,"minSDKVersion",void 0),IW=_v([Yp("nami-product-container")],IW);var LW,FW,RW=e=>e;function OW(e){if("number"==typeof e)return 0!==e;if("string"==typeof e){var t=parseFloat(e);return!isNaN(t)&&0!==t}return!1}var $W=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e}return p(t,e),c(t,[{key:"styles",value:function(){var e,t=this.component,n=t.imageCropping,i=t.alignment,a=t.height,r=t.width,o=t.rightMargin,s=t.spacing,u=t.hidden,l=t.blur,d="fit"===n,c=this.contextConsumer.state.formFactor,h=$E(null!=a?a:"100%",this.scaleFactor),m=$E(null!==(e="fitContent"==r?a:r)&&void 0!==e?e:"100%",this.scaleFactor),f="string"==typeof a&&a.includes("%")||void 0===a,v="phone"===c&&f?"max-height":"height",p=OW(this.component.moveX)||OW(this.component.moveY);return Rv(`\n :host {\n display: ${"television"===c?"flex":"inline-block"};\n ${u?"display:none;":""}\n position: relative;\n ${p?YE(this.component,this.scaleFactor):""}\n ${v}: ${h};\n width: ${m};\n }\n :host img {\n transition: all 0.3s;\n /* Don't ride the host's text baseline: a strut taller than a small image\n (dots, inline logos) pushes it below the host box. Keep the inline line\n box itself, though — percent-height hosts on phone size from it. */\n vertical-align: top;\n object-fit: ${d?"contain":"cover"};\n object-position: ${i} center;\n ${v}: ${h};\n width: ${m};\n margin-right: ${o||s||0}px;\n ${l?`filter: blur(${l}px);`:""}\n flex-shrink: ${"number"==typeof r?0:1};\n }\n `)}},{key:"render",value:function(){var e,t=this.component,n=t.url,i=t.alt,a=t.title,r=t.focusedBorderColor,o=t.focusedFillColor,s=t.fillColor;return n?(!r&&uw(s,o)||(this.tabIndex=0),this.ariaLabel=null!==(e=null!=i?i:a)&&void 0!==e?e:"",kp(LW||(LW=RW`<img src="${0}" alt="${0}" />`),n,this.ariaLabel)):(this.tabIndex=-1,this.ariaLabel=null,kp(FW||(FW=RW``)))}}])}(_E);_v([Jp({type:Object})],$W.prototype,"component",void 0),_v([Jp({type:Boolean})],$W.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],$W.prototype,"scaleFactor",void 0),$W=_v([Yp("nami-image")],$W);var NW=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).fullscreen=!1,e.inFocusedState=!1,e.scaleFactor=1,e}return p(t,e),c(t,[{key:"connectedCallback",value:function(){T(t,"connectedCallback",this)([]),!!document.querySelector("nami-paywall.nami-half-sheet-mode, nami-paywall.nami-modal-mode")||(document.body.style.background=this.component.fillColor||"transparent")}},{key:"styles",value:function(){var e;if(!this.contextConsumer||!this.component)return Rv("");var t=this.component,n=this.scaleFactor,i=this.contextConsumer.state.formFactor,a=t.backgroundBlur,r="vertical"===t.direction?"margin-top":"margin-left";return Rv(`\n :host {\n max-height: ${"television"===i?"100vh":""};\n display: ${t.hidden?"none":"flex"};\n flex-direction: column;\n overflow: hidden;\n ${HE(t)}\n position: var(--nami-bg-position, fixed);\n width: 100%;\n bottom: 0px;\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n z-index: ${null!==(e=t.zIndex)&&void 0!==e?e:1};\n top: 0px;\n ${a?`backdrop-filter: blur(${a}px);`:""}\n ${BE(t,!1)}\n transition: all 0.3s;\n ${KE(t,n)}\n }\n :host(:focus){\n ${BE(t,!0)}\n }\n :host > *:not(:first-child) {\n ${r}: ${t.spacing?t.spacing*n:0}px;\n }\n ${this.overlayCss()}\n `)}},{key:"overlayCss",value:function(){var e=this.component,t=this.contextProvider;if(!e.overlayColor&&!e.conditionAttributes)return"";var n=tw(t,(e.conditionAttributes?Zb(t,e):e).overlayColor);return"string"==typeof n&&n.trim()?`:host::after {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n ${NE(n)}\n }`:""}},{key:"updated",value:function(){}},{key:"render",value:function(){var e;return(null!==(e=this.component.components)&&void 0!==e?e:[]).map(e=>BP(this.contextProvider,e,this.scaleFactor,void 0,this.minSDKVersion))}}])}(_E);_v([Jp({type:Object})],NW.prototype,"component",void 0),_v([Jp({type:Boolean})],NW.prototype,"fullscreen",void 0),_v([Jp({type:Boolean})],NW.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],NW.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],NW.prototype,"minSDKVersion",void 0),NW=_v([Yp("nami-background-container")],NW);var WW,jW=e=>e,BW=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).zIndex=2,e.inFocusedState=!1,e.scaleFactor=1,e}return p(t,e),c(t,[{key:"styles",value:function(){var e,t,n=this.contextConsumer,i=this.component,a=this.zIndex,r=this.scaleFactor;if(!n)return Ov(WW||(WW=jW``));var o=n.state.formFactor,s=i.backgroundBlur,u="phone"!==o?"width: 100%;":"",l=null!==(e=i.width)&&void 0!==e?e:i.fixedWidth,d=null!==(t=i.height)&&void 0!==t?t:i.fixedHeight,c="phone"===o?`max-width:100%;\n ${void 0!==l?`width: ${$E(l,r)};`:""}\n ${void 0!==d?`height: ${$E(d,r)};`:""}`:qE(i,r),h="vertical"===i.direction?"margin-top":"margin-left";return Rv(`\n :host {\n box-sizing: border-box;\n display: ${i.hidden?"none":"flex"};\n position: relative;\n flex: 1;\n min-height: 0;\n ${UE(i)}\n ${c}\n ${u}\n ${function(e){var t,n,i=e.verticalAlignment,a=e.horizontalAlignment,r=e.direction,o=i?ME[i]:void 0,s=a?ME[a]:void 0;return"vertical"===r?(t=null!=s?s:"center",n=null!=o?o:"start"):(t=null!=o?o:"center",n=null!=s?s:"start"),`${DE("align-items",t)}${DE("justify-content",n)}`}(i)}\n ${s?`backdrop-filter: blur(${s}px);`:""}\n z-index: ${a};\n transition: all 0.3s;\n overflow-y: ${"television"===o?"hidden":"scroll"};\n overflow-x: hidden;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n ${KE(i,r)}\n /* The footer is position:absolute over this container; inset the\n scroll end by its measured height (--nami-footer-height, set by\n the paywall screen) so bottom content is not hidden behind it. */\n padding-bottom: calc(${OE(r,i.bottomPadding)}px + var(--nami-footer-height, 0px));\n ${BE(i,!1)}\n }\n :host::-webkit-scrollbar {\n display: none;\n }\n :host(:focus){\n ${BE(i,!0)}\n }\n :host > * {\n width: 100%;\n }\n :host > *:not(:first-child) {\n ${h}: ${i.spacing?i.spacing*r:0}px;\n }\n `)}},{key:"firstUpdated",value:function(){var e=new CustomEvent("child-spacing",{detail:{spacing:this.component.spacing},bubbles:!0,composed:!0});this.dispatchEvent(e)}},{key:"render",value:function(){var e;return(null===(e=this.component.components)||void 0===e?void 0:e.map(e=>BP(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion)))||[]}}])}(_E);_v([Jp({type:Object})],BW.prototype,"component",void 0),_v([Jp({type:Number})],BW.prototype,"zIndex",void 0),_v([Jp({type:Boolean})],BW.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],BW.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],BW.prototype,"minSDKVersion",void 0),BW=_v([Yp("nami-content-container")],BW);var zW,UW=e=>e,HW=function(e){function t(){var e;return o(this,t),(e=r(this,t)).inFocusedState=!1,e.scaleFactor=1,e._anyItemFocused=!1,e._handleClick=t=>{t.preventDefault(),LS({contextProvider:e.contextProvider,onTap:e.component.onTap})},e._handleFocusIn=t=>{var n,i,a=t.target;if("nami-segment-picker-item"===(null===(n=a.tagName)||void 0===n?void 0:n.toLowerCase())){if(e._isTv&&(e._anyItemFocused=!0,!e._cameFromInside(t.relatedTarget))){var r,o=null===(r=e.shadowRoot)||void 0===r?void 0:r.querySelector("nami-segment-picker-item.active");if(o&&o!==a)return void o.focus()}"television"===(null===(i=e.contextProvider)||void 0===i||null===(i=i.state)||void 0===i?void 0:i.formFactor)&&e.contextProvider.clearSelectedProduct(e.contextProvider.getCurrentGroupId())}},e._handleFocusOut=t=>{e._isTv&&(e._cameFromInside(t.relatedTarget)||(e._anyItemFocused=!1))},e.addEventListener("click",e._handleClick),e}return p(t,e),c(t,[{key:"_isTv",get:function(){return"television"===Cu()}},{key:"firstUpdated",value:function(e){var n,i;T(t,"firstUpdated",this)([e]),null===(n=this.shadowRoot)||void 0===n||n.addEventListener("focusin",this._handleFocusIn),null===(i=this.shadowRoot)||void 0===i||i.addEventListener("focusout",this._handleFocusOut)}},{key:"disconnectedCallback",value:function(){var e,n;T(t,"disconnectedCallback",this)([]),null===(e=this.shadowRoot)||void 0===e||e.removeEventListener("focusin",this._handleFocusIn),null===(n=this.shadowRoot)||void 0===n||n.removeEventListener("focusout",this._handleFocusOut)}},{key:"_cameFromInside",value:function(e){var t,n;return!!e&&("nami-segment-picker-item"===(null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase())||!(null===(n=this.shadowRoot)||void 0===n||!n.contains(e)))}},{key:"styles",value:function(){var e,t,n,i=oP("active",this.component.components[0]),a=oP("inactive",this.component.components[0]),r=(null===(e=this.component.components[0])||void 0===e?void 0:e.focusedFillColor)||i.fillColor,o=this._anyItemFocused;return Rv(`\n :host {\n box-sizing: border-box;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n display: flex;\n flex: 0 0 auto;\n position: relative;\n ${UE(this.component)}\n /* Keep the container's base fill even when an item is focused. Repainting\n the whole container to the (often light) focused fill washes out the\n inactive item's text — the focused item's own pill is the indicator.\n The focused border still reacts via applyStyles(containerFocused). */\n ${BE(this.component,!1)}\n ${iP(this.component,this.scaleFactor,o)}\n ${this.component.hidden?"display:none;":""}\n }\n :host(:focus){\n ${BE(this.component,!0)}\n ${iP(this.component,this.scaleFactor,!0)}\n }\n :host(:focus-visible){\n ${lP(this.component)}\n }\n .toggle{\n ${t=this.component,n=this.scaleFactor,`\n position: absolute;\n top: ${OE(n,t.topPadding)}px;\n bottom: ${OE(n,t.bottomPadding)}px;\n width: calc(50% - ${OE(n,t.leftPadding)/2}px) !important;\n `}\n transition: transform .5s cubic-bezier(.77, 0, .175, 1);\n ${sP(a,this.scaleFactor,!1)}\n }\n\n :host(:focus) .toggle{\n ${sP(i,this.scaleFactor,!0)}\n }\n\n nami-segment-picker-item:nth-of-type(1).active~.toggle {\n transform: translateX(0%);\n left: ${this.component.leftPadding?Number(this.component.leftPadding)*this.scaleFactor:0}px;\n ${BE(i,!0)}\n ${uP(i,this.scaleFactor)}\n }\n\n nami-segment-picker-item:nth-of-type(2).active~.toggle {\n transform: translateX(100%);\n right: ${this.component.rightPadding?Number(this.component.rightPadding)*this.scaleFactor:0}px;\n ${BE(i,!0)}\n ${uP(i,this.scaleFactor)}\n }\n\n nami-segment-picker-item:nth-of-type(1).focused~.toggle {\n transform: translateX(0%);\n left: ${this.component.leftPadding?Number(this.component.leftPadding)*this.scaleFactor:0}px;\n ${r?`background-color: ${r} !important;`:""}\n }\n\n nami-segment-picker-item:nth-of-type(2).focused~.toggle {\n transform: translateX(100%);\n right: ${this.component.rightPadding?Number(this.component.rightPadding)*this.scaleFactor:0}px;\n ${r?`background-color: ${r} !important;`:""}\n }\n `)}},{key:"render",value:function(){this.role="tablist";var e=this.component.components.map(e=>BP(this.contextProvider,e,this.scaleFactor,this.inFocusedState,this.minSDKVersion));return kp(zW||(zW=UW`${0}<div class="toggle"></div>`),e)}}])}(_E);_v([Jp({type:Object})],HW.prototype,"component",void 0),_v([Jp({type:Boolean})],HW.prototype,"inFocusedState",void 0),_v([Jp({type:Number})],HW.prototype,"scaleFactor",void 0),_v([Jp({type:Object})],HW.prototype,"minSDKVersion",void 0),_v([Qp()],HW.prototype,"_anyItemFocused",void 0),HW=_v([Yp("nami-segment-picker")],HW);var GW,VW=e=>e,KW=function(e){function t(){var e;return o(this,t),(e=r(this,t,arguments)).inFocusedState=!1,e.scaleFactor=1,e._isFocused=!1,e._handleFocus=()=>{e.inFocusedState=!0,e._isTv&&(e._isFocused=!0,e.classList.add("focused"))},e._handleBlur=()=>{e.inFocusedState=!1,e._isTv&&(e._isFocused=!1,e.classList.remove("focused"))},e._handleKeyDown=t=>{"Enter"===t.key||" "===t.key||142===t.keyCode||195===t.keyCode?e._handleClick():!e._isTv||"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e._moveFocusToSibling("ArrowRight"===t.key?1:-1),t.preventDefault())},e._handleClick=()=>{e._updateFormState(),e.requestUpdate("component")},e._handleHover=()=>{e.inFocusedState=!0},e}return p(t,e),c(t,[{key:"_isTv",get:function(){return"television"===Cu()}},{key:"connectedCallback",value:function(){T(t,"connectedCallback",this)([]),this._isActive=!!this.component.checked,this.classList.toggle("active",this._isActive),this.component.formId&&this._updateFormState(),this.addEventListener("click",this._handleClick),this.addEventListener("mouseover",this._handleHover),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("focus",this._handleFocus),this.addEventListener("blur",this._handleBlur)}},{key:"disconnectedCallback",value:function(){T(t,"disconnectedCallback",this)([]),this.removeEventListener("click",this._handleClick),this.removeEventListener("mouseover",this._handleHover),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("focus",this._handleFocus),this.removeEventListener("blur",this._handleBlur)}},{key:"_moveFocusToSibling",value:function(e){var t=this.getRootNode();if(t instanceof ShadowRoot){var n=Array.from(t.querySelectorAll("nami-segment-picker-item")),i=n.indexOf(this);if(!(i<0)){var a=i+e;a>=0&&a<n.length&&n[a].focus()}}}},{key:"_getParentPicker",value:function(){var e=this.getRootNode();return e instanceof ShadowRoot?e.host:null}},{key:"_getParentFormId",value:function(){var e;return null===(e=this._getParentPicker())||void 0===e?void 0:e.component.formId}},{key:"_updateFormState",value:function(){if(this.contextProvider)if(this.component.formId){var e=this._getParentFormId();e&&this.contextProvider.setFormState(e,this.component.formId)}else this.component.id&&this.contextProvider.setCurrentGroupData(this.component.id,this.component.text||"")}},{key:"updated",value:function(e){var t;if(e.has("component")&&this.contextProvider){var n=null!==(t=e.get("component"))&&void 0!==t?t:this.component;if(n.formId){var i=this._getParentFormId();i&&this.contextProvider.state.formStates[i]&&(this._isActive=this.contextProvider.state.formStates[i]===n.formId)}else this._isActive=CW(n.id,this.contextProvider.state.currentGroupId);if(this.classList.toggle("active",this._isActive),this._isActive){var a=this.getRootNode();if(a instanceof ShadowRoot)a.querySelectorAll("nami-segment-picker-item").forEach(e=>{e!==this&&e.requestUpdate("component",e)})}}}},{key:"styles",value:function(){var e,t,n=oP("active",this.component),i=oP("inactive",this.component),a=this.component.focusedFontColor||n.fontColor||i.fontColor||"";return Rv(`\n :host {\n box-sizing: border-box;\n display: ${this.component.hidden?"none":"inline-flex"};\n position: relative;\n /* On television the sliding .toggle pill is the sole active/focus\n indicator, so the item's own background must stay inactive — otherwise\n it double-renders the focus fill and the previously-focused item stays\n lit. On other form factors there is no .focused pill, so the item\n background carries the hover/focus indication. */\n ${sP(m({},i,this.component),this.scaleFactor,!this._isTv&&this.inFocusedState)}\n ${QE(null!==(e=this.component.inactiveDropShadow)&&void 0!==e?e:this.component.dropShadow)}\n }\n\n :host > * {\n cursor: pointer;\n }\n\n :host(.active) {\n z-index: 1 !important;\n ${uP(m({},n,this.component),this.scaleFactor)}\n ${QE(null!==(t=this.component.activeDropShadow)&&void 0!==t?t:this.component.dropShadow)}\n }\n\n :host(.focused) {\n z-index: 2 !important;\n outline: none !important;\n ${a?jE(a):""}\n }\n\n :host(:focus-visible) {\n outline: none !important;\n }\n\n input {\n visibility: hidden;\n position: absolute;\n top: 0;\n }\n `)}},{key:"render",value:function(){return this.tabIndex=0,this.role="tab",this.ariaSelected=`${this._isActive}`,this.ariaLabel=this.component.text||"",kp(GW||(GW=VW`<input type="radio"
463
463
  autocomplete="off"
464
464
  id="${0}"
465
465
  name="${0}"