@namiml/web-sdk
Version:
Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing
1 lines • 1.43 MB
JavaScript
"use strict";var e=require("lit");const t=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}},n=new WeakMap,i=e=>{let t=n.get(e);return void 0===t&&n.set(e,t=new Map),t},a=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(i(this)).map((([e,t])=>({name:e,value:t})))}get shadowRoot(){return"closed"===this.__shadowRootMode?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){i(this).set(e,String(t))}removeAttribute(e){i(this).delete(e)}toggleAttribute(e,t){return this.hasAttribute(e)?!(void 0===t||!t)||(this.removeAttribute(e),!1):!(void 0!==t&&!t)&&(this.setAttribute(e,""),!0)}hasAttribute(e){return i(this).has(e)}attachShadow(e){const t={host:this};return this.__shadowRootMode=e.mode,e&&"open"===e.mode&&(this.__shadowRoot=t),t}attachInternals(){if(null!==this.__internals)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");const e=new t(this);return this.__internals=e,e}getAttribute(e){return i(this).get(e)??null}},r=class extends a{};function o(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 s(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)}"undefined"==typeof HTMLElement&&(globalThis.HTMLElement=r),"function"==typeof SuppressedError&&SuppressedError;var l;!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"}(l||(l={}));const{NAMI_SDK_VERSION:d="3.3.1",PRODUCTION:u="production",DEVELOPMENT:c="development",PLATFORM_ID_REQUIRED:h="Platform ID is required",DEVICE_ID_REQUIRED:m="Device ID is required",EXTERNAL_ID_REQUIRED:f="External ID is required",SDK_NOT_INITIALIZED:p="SDK has not been initialized. Make sure to call Nami.configure() first!",CAMPAIGN_NOT_AVAILABLE:g="Campaign is not available",FLOW_SCREENS_NOT_AVAILABLE:v="Flow screens not available",UNABLE_TO_UPDATE_CDP_ID:y="Unable to update CDP id in anonymous mode",ANONYMOUS_MODE_ALREADY_ON:w="Anonymous mode is already turned on.",ANONYMOUS_MODE_ALREADY_OFF:b="Anonymous mode is already turned off.",ANONYMOUS_MODE_LOGIN_NOT_ALLOWED:k="Login/logout are not available in anonymous mode",SESSION_REQUIRED:S="Session is required",DEVICE_ID_NOT_SET:M="Nami Device ID is not set",AUTH_DEVICE:E="nami_auth_device",NAMI_CONFIGURATION:T="nami_configuration",NAMI_PROFILE:P="nami_profile",API_CONFIG:A="api_config",API_CAMPAIGN_RULES:x="api_campaign_rules",API_PAYWALLS:_="api_paywalls",API_PRODUCTS:C="api_products",API_ACTIVE_ENTITLEMENTS:L="api_active_entitlements",SERVER_NAMI_ENTITLEMENTS:I="server_active_entitlements",INITIAL_APP_CONFIG:D="initial_app_config",INITIAL_CAMPAIGN_RULES:R="initial_campaign_rules",INITIAL_PAYWALLS:W="initial_paywalls",INITIAL_PRODUCTS:N="initial_products",LOCAL_NAMI_ENTITLEMENTS:O="local_active_entitlements",CUSTOMER_ATTRIBUTES_KEY_PREFIX:F="nami_cmr_attributes_",NAMI_CUSTOMER_JOURNEY_STATE:j="nami_customer_journey_state",ANONYMOUS_MODE:z="nami_anonymous_mode",ANONYMOUS_UUID:$="nami_anonymous_uuid",KEY_SESSION_COUNTER:U="nami_session_counter",INITIAL_SESSION_COUNTER_VALUE:H=1,NAMI_LAST_IMPRESSION_ID:B="nami_last_impression_id",NAMI_PURCHASE_IMPRESSION_ID:G="nami_purchase_impression_id",NAMI_SESSION_ID:X="nami_session_id",NAMI_LANGUAGE_CODE:Y="nami_language_code",NAMI_PURCHASE_CHANNEL:K="nami_purchase_channel",API_VERSION:V="v3",BASE_URL_PATH:q=`sdk/${V}/platform`,BASE_URL:J="https://app.namiml.com",BASE_STAGING_URL:Q="https://app-staging.namiml.com",CUSTOM_HOST_PREFIX:Z="namiAPIHost=",USE_STAGING_API:ee="useStagingAPI",EXTENDED_CLIENT_INFO_PREFIX:te="extendedClientInfo",EXTENDED_CLIENT_INFO_DELIMITER:ne=":",VALIDATE_PRODUCT_GROUPS:ie="validateProductGroups",EXTENDED_PLATFORM:ae="extended-platform",EXTENDED_PLATFORM_VERSION:re="extended-platform-version",API_MAX_CALLS_LIMIT:oe=2,API_RETRY_DELAY_SEC:se=2,API_TIMEOUT_LIMIT:le=2e4,DEVICE_API_TIMEOUT_LIMIT:de=3e3,STATUS_SUCCESS:ue=200,STATUS_BAD_REQUEST:ce=400,STATUS_NOT_FOUND:he=404,STATUS_CONFLICT:me=409,STATUS_INTERNAL_SERVER_ERROR:fe=500,INITIAL_SUCCESS:pe="Initial success",RECONFIG_SUCCESS:ge="Reconfig success",ALREADY_CONFIGURED:ve="Already configured",AVAILABLE_CAMPAIGNS_CHANGED:ye="AvailableCampaignsChanged",PAYWALL_ACTION_EVENT:we="PaywallActionEvent",AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED:be="AvailableActiveEntitlementsChanged",CUSTOMER_JOURNEY_STATE_CHANGED:ke="CustomerJourneyStateChanged",SKU_TEXT_REGEX:Se=/\$\{sku\.(\w+)(:\d+)?\}/g,VAR_REGEX:Me=/\$\{\s*(\w+(\.[a-zA-Z\d_:${}-]{0,99})*?)\s*}/g,HTML_REGEX:Ee=/<\/?[a-z][\s\S]*>/i,SMART_TEXT_PATTERN:Te="${",CORS_PROXY_URL:Pe="https://hosted-content-staging.namiml.com",CORS_PROXY_URL_LOCAL:Ae="http://localhost:8001"}={};var xe;exports.LogLevel=void 0,(xe=exports.LogLevel||(exports.LogLevel={}))[xe.DEBUG=1]="DEBUG",xe[xe.INFO=2]="INFO",xe[xe.WARN=3]="WARN",xe[xe.ERROR=4]="ERROR";const _e={debug:exports.LogLevel.DEBUG,info:exports.LogLevel.INFO,warn:exports.LogLevel.WARN,error:exports.LogLevel.ERROR};const Ce=new class{constructor(){this.currentLogLevel=exports.LogLevel.DEBUG,this.setLogger=e=>{this.currentLogLevel=e?_e[e]:exports.LogLevel.WARN}}debug(e,...t){this.shouldLog(exports.LogLevel.DEBUG)&&console.debug(this.formatMessage(exports.LogLevel.DEBUG,e,...t))}info(e,...t){this.shouldLog(exports.LogLevel.INFO)&&console.info(this.formatMessage(exports.LogLevel.INFO,e,...t))}warn(e,...t){this.shouldLog(exports.LogLevel.WARN)&&console.warn(this.formatMessage(exports.LogLevel.WARN,e,...t))}error(e,...t){this.shouldLog(exports.LogLevel.ERROR)&&console.error(this.formatMessage(exports.LogLevel.ERROR,e,...t))}shouldLog(e){return e>=this.currentLogLevel}formatMessage(e,t,...n){const i=exports.LogLevel[e];return`[${(new Date).toISOString()}] [${i}] ${t} ${n=n.map((e=>"object"==typeof e?JSON.stringify(e):e))}`}};function Le(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 Ie(e,t){return e===t||e!=e&&t!=t}function De(e,t){for(var n=e.length;n--;)if(Ie(e[n][0],t))return n;return-1}var Re=Array.prototype.splice;function We(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])}}We.prototype.clear=function(){this.__data__=[],this.size=0},We.prototype.delete=function(e){var t=this.__data__,n=De(t,e);return!(n<0)&&(n==t.length-1?t.pop():Re.call(t,n,1),--this.size,!0)},We.prototype.get=function(e){var t=this.__data__,n=De(t,e);return n<0?void 0:t[n][1]},We.prototype.has=function(e){return De(this.__data__,e)>-1},We.prototype.set=function(e,t){var n=this.__data__,i=De(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var Ne="object"==typeof global&&global&&global.Object===Object&&global,Oe="object"==typeof self&&self&&self.Object===Object&&self,Fe=Ne||Oe||Function("return this")(),je=Fe.Symbol,ze=Object.prototype,$e=ze.hasOwnProperty,Ue=ze.toString,He=je?je.toStringTag:void 0;var Be=Object.prototype.toString;var Ge="[object Null]",Xe="[object Undefined]",Ye=je?je.toStringTag:void 0;function Ke(e){return null==e?void 0===e?Xe:Ge:Ye&&Ye in Object(e)?function(e){var t=$e.call(e,He),n=e[He];try{e[He]=void 0;var i=!0}catch(e){}var a=Ue.call(e);return i&&(t?e[He]=n:delete e[He]),a}(e):function(e){return Be.call(e)}(e)}function Ve(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var qe="[object AsyncFunction]",Je="[object Function]",Qe="[object GeneratorFunction]",Ze="[object Proxy]";function et(e){if(!Ve(e))return!1;var t=Ke(e);return t==Je||t==Qe||t==qe||t==Ze}var tt,nt=Fe["__core-js_shared__"],it=(tt=/[^.]+$/.exec(nt&&nt.keys&&nt.keys.IE_PROTO||""))?"Symbol(src)_1."+tt:"";var at=Function.prototype.toString;function rt(e){if(null!=e){try{return at.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var ot=/^\[object .+?Constructor\]$/,st=Function.prototype,lt=Object.prototype,dt=st.toString,ut=lt.hasOwnProperty,ct=RegExp("^"+dt.call(ut).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ht(e){return!(!Ve(e)||(t=e,it&&it in t))&&(et(e)?ct:ot).test(rt(e));var t}function mt(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ht(n)?n:void 0}var ft=mt(Fe,"Map"),pt=mt(Object,"create");var gt=Object.prototype.hasOwnProperty;var vt=Object.prototype.hasOwnProperty;function yt(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 wt(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 bt(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])}}yt.prototype.clear=function(){this.__data__=pt?pt(null):{},this.size=0},yt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},yt.prototype.get=function(e){var t=this.__data__;if(pt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return gt.call(t,e)?t[e]:void 0},yt.prototype.has=function(e){var t=this.__data__;return pt?void 0!==t[e]:vt.call(t,e)},yt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=pt&&void 0===t?"__lodash_hash_undefined__":t,this},bt.prototype.clear=function(){this.size=0,this.__data__={hash:new yt,map:new(ft||We),string:new yt}},bt.prototype.delete=function(e){var t=wt(this,e).delete(e);return this.size-=t?1:0,t},bt.prototype.get=function(e){return wt(this,e).get(e)},bt.prototype.has=function(e){return wt(this,e).has(e)},bt.prototype.set=function(e,t){var n=wt(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function kt(e){var t=this.__data__=new We(e);this.size=t.size}kt.prototype.clear=function(){this.__data__=new We,this.size=0},kt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},kt.prototype.get=function(e){return this.__data__.get(e)},kt.prototype.has=function(e){return this.__data__.has(e)},kt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof We){var i=n.__data__;if(!ft||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new bt(i)}return n.set(e,t),this.size=n.size,this};function St(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new bt;++t<n;)this.add(e[t])}function Mt(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 Et(e,t){return e.has(t)}St.prototype.add=St.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},St.prototype.has=function(e){return this.__data__.has(e)};var Tt=1,Pt=2;function At(e,t,n,i,a,r){var o=n&Tt,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var d=r.get(e),u=r.get(t);if(d&&u)return d==t&&u==e;var c=-1,h=!0,m=n&Pt?new St:void 0;for(r.set(e,t),r.set(t,e);++c<s;){var f=e[c],p=t[c];if(i)var g=o?i(p,f,c,t,e,r):i(f,p,c,e,t,r);if(void 0!==g){if(g)continue;h=!1;break}if(m){if(!Mt(t,(function(e,t){if(!Et(m,t)&&(f===e||a(f,e,n,i,r)))return m.push(t)}))){h=!1;break}}else if(f!==p&&!a(f,p,n,i,r)){h=!1;break}}return r.delete(e),r.delete(t),h}var xt=Fe.Uint8Array;function _t(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function Ct(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Lt=1,It=2,Dt="[object Boolean]",Rt="[object Date]",Wt="[object Error]",Nt="[object Map]",Ot="[object Number]",Ft="[object RegExp]",jt="[object Set]",zt="[object String]",$t="[object Symbol]",Ut="[object ArrayBuffer]",Ht="[object DataView]",Bt=je?je.prototype:void 0,Gt=Bt?Bt.valueOf:void 0;var Xt=Array.isArray;var Yt=Object.prototype.propertyIsEnumerable,Kt=Object.getOwnPropertySymbols,Vt=Kt?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}(Kt(e),(function(t){return Yt.call(e,t)})))}:function(){return[]};function qt(e){return null!=e&&"object"==typeof e}function Jt(e){return qt(e)&&"[object Arguments]"==Ke(e)}var Qt=Object.prototype,Zt=Qt.hasOwnProperty,en=Qt.propertyIsEnumerable,tn=Jt(function(){return arguments}())?Jt:function(e){return qt(e)&&Zt.call(e,"callee")&&!en.call(e,"callee")};var nn="object"==typeof exports&&exports&&!exports.nodeType&&exports,an=nn&&"object"==typeof module&&module&&!module.nodeType&&module,rn=an&&an.exports===nn?Fe.Buffer:void 0,on=(rn?rn.isBuffer:void 0)||function(){return!1},sn=9007199254740991,ln=/^(?:0|[1-9]\d*)$/;function dn(e,t){var n=typeof e;return!!(t=null==t?sn:t)&&("number"==n||"symbol"!=n&&ln.test(e))&&e>-1&&e%1==0&&e<t}var un=9007199254740991;function cn(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=un}var hn={};hn["[object Float32Array]"]=hn["[object Float64Array]"]=hn["[object Int8Array]"]=hn["[object Int16Array]"]=hn["[object Int32Array]"]=hn["[object Uint8Array]"]=hn["[object Uint8ClampedArray]"]=hn["[object Uint16Array]"]=hn["[object Uint32Array]"]=!0,hn["[object Arguments]"]=hn["[object Array]"]=hn["[object ArrayBuffer]"]=hn["[object Boolean]"]=hn["[object DataView]"]=hn["[object Date]"]=hn["[object Error]"]=hn["[object Function]"]=hn["[object Map]"]=hn["[object Number]"]=hn["[object Object]"]=hn["[object RegExp]"]=hn["[object Set]"]=hn["[object String]"]=hn["[object WeakMap]"]=!1;var mn,fn="object"==typeof exports&&exports&&!exports.nodeType&&exports,pn=fn&&"object"==typeof module&&module&&!module.nodeType&&module,gn=pn&&pn.exports===fn&&Ne.process,vn=function(){try{var e=pn&&pn.require&&pn.require("util").types;return e||gn&&gn.binding&&gn.binding("util")}catch(e){}}(),yn=vn&&vn.isTypedArray,wn=yn?(mn=yn,function(e){return mn(e)}):function(e){return qt(e)&&cn(e.length)&&!!hn[Ke(e)]},bn=Object.prototype.hasOwnProperty;function kn(e,t){var n=Xt(e),i=!n&&tn(e),a=!n&&!i&&on(e),r=!n&&!i&&!a&&wn(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):[],l=s.length;for(var d in e)!bn.call(e,d)||o&&("length"==d||a&&("offset"==d||"parent"==d)||r&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||dn(d,l))||s.push(d);return s}var Sn=Object.prototype;var Mn=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),En=Object.prototype.hasOwnProperty;function Tn(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Sn))return Mn(e);var t,n,i=[];for(var a in Object(e))En.call(e,a)&&"constructor"!=a&&i.push(a);return i}function Pn(e){return null!=(t=e)&&cn(t.length)&&!et(t)?kn(e):Tn(e);var t}function An(e){return function(e,t,n){var i=t(e);return Xt(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,Pn,Vt)}var xn=1,_n=Object.prototype.hasOwnProperty;var Cn=mt(Fe,"DataView"),Ln=mt(Fe,"Promise"),In=mt(Fe,"Set"),Dn=mt(Fe,"WeakMap"),Rn="[object Map]",Wn="[object Promise]",Nn="[object Set]",On="[object WeakMap]",Fn="[object DataView]",jn=rt(Cn),zn=rt(ft),$n=rt(Ln),Un=rt(In),Hn=rt(Dn),Bn=Ke;(Cn&&Bn(new Cn(new ArrayBuffer(1)))!=Fn||ft&&Bn(new ft)!=Rn||Ln&&Bn(Ln.resolve())!=Wn||In&&Bn(new In)!=Nn||Dn&&Bn(new Dn)!=On)&&(Bn=function(e){var t=Ke(e),n="[object Object]"==t?e.constructor:void 0,i=n?rt(n):"";if(i)switch(i){case jn:return Fn;case zn:return Rn;case $n:return Wn;case Un:return Nn;case Hn:return On}return t});var Gn=1,Xn="[object Arguments]",Yn="[object Array]",Kn="[object Object]",Vn=Object.prototype.hasOwnProperty;function qn(e,t,n,i,a,r){var o=Xt(e),s=Xt(t),l=o?Yn:Bn(e),d=s?Yn:Bn(t),u=(l=l==Xn?Kn:l)==Kn,c=(d=d==Xn?Kn:d)==Kn,h=l==d;if(h&&on(e)){if(!on(t))return!1;o=!0,u=!1}if(h&&!u)return r||(r=new kt),o||wn(e)?At(e,t,n,i,a,r):function(e,t,n,i,a,r,o){switch(n){case Ht:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ut:return!(e.byteLength!=t.byteLength||!r(new xt(e),new xt(t)));case Dt:case Rt:case Ot:return Ie(+e,+t);case Wt:return e.name==t.name&&e.message==t.message;case Ft:case zt:return e==t+"";case Nt:var s=_t;case jt:var l=i≪if(s||(s=Ct),e.size!=t.size&&!l)return!1;var d=o.get(e);if(d)return d==t;i|=It,o.set(e,t);var u=At(s(e),s(t),i,a,r,o);return o.delete(e),u;case $t:if(Gt)return Gt.call(e)==Gt.call(t)}return!1}(e,t,l,n,i,a,r);if(!(n&Gn)){var m=u&&Vn.call(e,"__wrapped__"),f=c&&Vn.call(t,"__wrapped__");if(m||f){var p=m?e.value():e,g=f?t.value():t;return r||(r=new kt),a(p,g,n,i,r)}}return!!h&&(r||(r=new kt),function(e,t,n,i,a,r){var o=n&xn,s=An(e),l=s.length;if(l!=An(t).length&&!o)return!1;for(var d=l;d--;){var u=s[d];if(!(o?u in t:_n.call(t,u)))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;++d<l;){var p=e[u=s[d]],g=t[u];if(i)var v=o?i(g,p,u,t,e,r):i(p,g,u,e,t,r);if(!(void 0===v?p===g||a(p,g,n,i,r):v)){m=!1;break}f||(f="constructor"==u)}if(m&&!f){var y=e.constructor,w=t.constructor;y==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w||(m=!1)}return r.delete(e),r.delete(t),m}(e,t,n,i,a,r))}function Jn(e,t,n,i,a){return e===t||(null==e||null==t||!qt(e)&&!qt(t)?e!=e&&t!=t:qn(e,t,n,i,Jn,a))}var Qn=1,Zn=2;function ei(e){return e==e&&!Ve(e)}function ti(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function ni(e){var t=function(e){for(var t=Pn(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,ei(a)]}return t}(e);return 1==t.length&&t[0][2]?ti(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],l=e[s],d=o[1];if(o[2]){if(void 0===l&&!(s in e))return!1}else{var u=new kt;if(!Jn(d,l,Qn|Zn,i,u))return!1}}return!0}(n,0,t)}}var ii="[object Symbol]";function ai(e){return"symbol"==typeof e||qt(e)&&Ke(e)==ii}var ri=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oi=/^\w*$/;function si(e,t){if(Xt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ai(e))||(oi.test(e)||!ri.test(e)||null!=t&&e in Object(t))}var li="Expected a function";function di(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(li);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(di.Cache||bt),n}di.Cache=bt;var ui=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ci=/\\(\\)?/g,hi=function(e){var t=di(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ui,(function(e,n,i,a){t.push(i?a.replace(ci,"$1"):n||e)})),t}));var mi=1/0,fi=je?je.prototype:void 0,pi=fi?fi.toString:void 0;function gi(e){if("string"==typeof e)return e;if(Xt(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,gi)+"";if(ai(e))return pi?pi.call(e):"";var t=e+"";return"0"==t&&1/e==-mi?"-0":t}function vi(e){return null==e?"":gi(e)}function yi(e,t){return Xt(e)?e:si(e,t)?[e]:hi(vi(e))}var wi=1/0;function bi(e){if("string"==typeof e||ai(e))return e;var t=e+"";return"0"==t&&1/e==-wi?"-0":t}function ki(e,t){for(var n=0,i=(t=yi(t,e)).length;null!=e&&n<i;)e=e[bi(t[n++])];return n&&n==i?e:void 0}function Si(e,t){return null!=e&&t in Object(e)}function Mi(e,t){return null!=e&&function(e,t,n){for(var i=-1,a=(t=yi(t,e)).length,r=!1;++i<a;){var o=bi(t[i]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++i!=a?r:!!(a=null==e?0:e.length)&&cn(a)&&dn(o,a)&&(Xt(e)||tn(e))}(e,t,Si)}var Ei=1,Ti=2;function Pi(e,t){return si(e)&&ei(t)?ti(bi(e),t):function(n){var i=function(e,t,n){var i=null==e?void 0:ki(e,t);return void 0===i?n:i}(n,e);return void 0===i&&i===t?Mi(n,e):Jn(t,i,Ei|Ti)}}function Ai(e){return e}function xi(e){return si(e)?(t=bi(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return ki(t,e)}}(e);var t}function _i(e){return e!=e}function Ci(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,_i,n)}(e,t,0)>-1}var Li=In&&1/Ct(new In([,-0]))[1]==1/0?function(e){return new In(e)}:function(){},Ii=200;function Di(e,t){return e&&e.length?function(e,t,n){var i=-1,a=Ci,r=e.length,o=!0,s=[],l=s;if(r>=Ii){var d=t?null:Li(e);if(d)return Ct(d);o=!1,a=Et,l=new St}else l=t?[]:s;e:for(;++i<r;){var u=e[i],c=t?t(u):u;if(u=0!==u?u:0,o&&c==c){for(var h=l.length;h--;)if(l[h]===c)continue e;t&&l.push(c),s.push(u)}else a(l,c,n)||(l!==s&&l.push(c),s.push(u))}return s}(e,"function"==typeof(n=t)?n:null==n?Ai:"object"==typeof n?Xt(n)?Pi(n[0],n[1]):ni(n):xi(n)):[];var n}const Ri=new class{constructor(){this.memoryStore={}}setDevice(e){this.setItem(E,e)}getDevice(){return this.getItem(E)}resetDevice(){this.resetItem(E)}getAnonymousMode(){return this.getItem(z)||!1}setAnonymousMode(e){this.setItem(z,e)}clearAnonymousMode(){this.resetItem(z)}setAppConfig(e,t){this.setItem(e,t)}getAppConfig(e){return this.getItem(e)}setLanguageCode(e){this.setItem(Y,e||"en")}getLanguageCode(){return this.getItem(Y)||"en"}setCampaignRules(e,t){this.setItem(e,t)}getCampaignRules(e){return this.getItem(e)}setPaywalls(e,t){this.setItem(e,t)}getPaywalls(e){return this.getItem(e)}setActiveEntitlements(e,t){this.setItem(e,t)}getActiveEntitlements(e){return this.getItem(e)||[]}setNamiEntitlements(e,t){this.setItem(e,t)}getNamiEntitlements(e){return this.getItem(e)||[]}setProducts(e,t){this.setItem(e,t)}getProducts(e){return this.getItem(e)}getCachedProducts(){const e=this.getItem(C)??[];return Di(Le([...this.getItem(N)??[],...e]),"sku_ref_id")}setNamiConfig(e){this.setItem(T,e)}getNamiConfig(){return this.getItem(T)}setCustomerAttribute(e,t){this.setItem(F+e,t)}getCustomerAttribute(e){return this.getItem(F+e)}getAllCustomerAttributes(){return Object.entries(localStorage).filter((([e])=>e.includes(F))).map((([e,t])=>e.replace(F,"")+":"+t))}getAllCustomerAttributesKeys(){return Object.keys(localStorage).filter((e=>e.includes(F))).map((e=>e.replace(F,"")))}clearCustomerAttribute(e){const t=F+e,n=this.getItem(t);return n&&this.resetItem(t),!!n}clearAllCustomerAttributes(){Object.keys(localStorage).filter((e=>e.includes(F))).map((e=>this.resetItem(e)))}setNamiProfile(e){this.setItem(P,e)}getNamiProfile(){return this.getItem(P)}removeNamiProfile(){this.resetItem(P)}setCustomerJourneyState(e){this.setItem(j,e)}getCustomerJourneyState(){return this.getItem(j)}setSessionCounter(){const e=this.getItem(U),t=e?parseInt(e):H||H;this.setItem(U,t+1)}getSessionCounter(){const e=this.getItem(U);return e?parseInt(e):H}setLastImpressionId(e){this.setItem(B,e)}getLastImpressionId(){return this.getItem(B)??""}setPurchaseImpression(){const e=this.getLastImpressionId()??"";this.setItem(G,e)}getPurchaseImpression(){return this.getItem(G)??""}setSessionId(e){e&&this.setItem(X,e)}getSessionId(){return this.getItem(X)??""}clearSessionId(){this.resetItem(X)}setPurchaseChannel(e){e&&this.setItem(K,e)}getPurchaseChannel(){return this.getItem(K)}getAnonymousUUID(){return this.getItem($)}setAnonymousUUID(e){this.setItem($,e)}clearAnonymousUUID(){this.resetItem($)}setItem(e,t){let n;try{n=JSON.stringify(t)}catch(t){return void Ce.error(`Serialization failed for ${e}`,t)}try{localStorage.setItem(e,n)}catch(t){Ce.error("Error setting item in localStorage:",t),this.resetItem(e),this.memoryStore[e]=n}}getItem(e){try{const t=localStorage.getItem(e);if(null!==t)return JSON.parse(t)}catch(t){Ce.error("Error getting item from localStorage:",e,": ",t)}const t=this.memoryStore[e];return null!=t?JSON.parse(t):null}resetItem(e){try{localStorage.removeItem(e)}catch(e){Ce.error("Error removing item from localStorage:",e)}delete this.memoryStore[e]}clear(){try{localStorage.clear()}catch(e){Ce.error("Error clearing localStorage:",e)}this.memoryStore={}}};class Wi extends Error{constructor(e,t){super(t),this.statusCode=e,this.status=e,this.message=`RetryLimitExceededError: ${this.message}`}}class Ni extends Error{}class Oi extends Ni{constructor(){super(),this.status=409,this.name="ConflictError",this.message="ConflictError: Server responded with conflict"}}class Fi extends Error{constructor(){super(p)}}class ji extends Error{constructor(){super(h)}}class zi extends Error{constructor(){super(m)}}class $i extends Error{constructor(){super(f)}}class Ui extends Error{constructor(){super(g)}}class Hi extends Error{constructor(){super(v)}}class Bi extends Error{constructor(){super(w)}}class Gi extends Error{constructor(){super(b)}}class Xi extends Error{constructor(){super(b)}}class Yi extends Error{constructor(){super(y)}}class Ki extends Ni{constructor(e){super(e),this.message=`BadRequestError: ${this.message}`}}class Vi extends Ni{constructor(e){super(e),this.message=`NotFoundError: ${this.message}`}}class qi extends Ni{constructor(e,t){super(t),this.statusCode=e,this.message=`ClientError: ${this.message}`}}class Ji extends Ni{constructor(e){super(e),this.message=`ServerError: ${this.message}`}}const Qi=(e,t)=>{if(e==ce)throw new Ki(t);if(e==he)throw new Vi(t);if(e==me)throw new Oi;if(e>ce&&e<fe)throw new qi(e,t);if(e>=fe)throw new Ji(t)};async function Zi(e,t,n=le,i=oe){let a=0;const r=async()=>{const o=await async function(e,t={},n){const i=new AbortController,a=setTimeout((()=>i.abort()),n);t.signal=i.signal;const r=await fetch(e,t);return clearTimeout(a),r}(e,t,n);if(!o.ok){if(o.status==me)throw new Oi;if(a++,a<=i){const e=1e3*(a+se);return await new Promise((t=>setTimeout(t,e))),r()}throw new Wi(o.status,`Request failed after ${i} retries`)}return o};return(await r()).json()}function ea(e){let t=e.length;for(;--t>=0;)e[t]=0}const ta=256,na=286,ia=30,aa=15,ra=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),oa=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),sa=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),la=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),da=new Array(576);ea(da);const ua=new Array(60);ea(ua);const ca=new Array(512);ea(ca);const ha=new Array(256);ea(ha);const ma=new Array(29);ea(ma);const fa=new Array(ia);function pa(e,t,n,i,a){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=a,this.has_stree=e&&e.length}let ga,va,ya;function wa(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}ea(fa);const ba=e=>e<256?ca[e]:ca[256+(e>>>7)],ka=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Sa=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,ka(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Ma=(e,t,n)=>{Sa(e,n[2*t],n[2*t+1])},Ea=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},Ta=(e,t,n)=>{const i=new Array(16);let a,r,o=0;for(a=1;a<=aa;a++)o=o+n[a-1]<<1,i[a]=o;for(r=0;r<=t;r++){let t=e[2*r+1];0!==t&&(e[2*r]=Ea(i[t]++,t))}},Pa=e=>{let t;for(t=0;t<na;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ia;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Aa=e=>{e.bi_valid>8?ka(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},xa=(e,t,n,i)=>{const a=2*t,r=2*n;return e[a]<e[r]||e[a]===e[r]&&i[t]<=i[n]},_a=(e,t,n)=>{const i=e.heap[n];let a=n<<1;for(;a<=e.heap_len&&(a<e.heap_len&&xa(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!xa(t,i,e.heap[a],e.depth));)e.heap[n]=e.heap[a],n=a,a<<=1;e.heap[n]=i},Ca=(e,t,n)=>{let i,a,r,o,s=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+s++],i+=(255&e.pending_buf[e.sym_buf+s++])<<8,a=e.pending_buf[e.sym_buf+s++],0===i?Ma(e,a,t):(r=ha[a],Ma(e,r+ta+1,t),o=ra[r],0!==o&&(a-=ma[r],Sa(e,a,o)),i--,r=ba(i),Ma(e,r,n),o=oa[r],0!==o&&(i-=fa[r],Sa(e,i,o)))}while(s<e.sym_next);Ma(e,256,t)},La=(e,t)=>{const n=t.dyn_tree,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,r=t.stat_desc.elems;let o,s,l,d=-1;for(e.heap_len=0,e.heap_max=573,o=0;o<r;o++)0!==n[2*o]?(e.heap[++e.heap_len]=d=o,e.depth[o]=0):n[2*o+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=d<2?++d:0,n[2*l]=1,e.depth[l]=0,e.opt_len--,a&&(e.static_len-=i[2*l+1]);for(t.max_code=d,o=e.heap_len>>1;o>=1;o--)_a(e,n,o);l=r;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],_a(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[2*l]=n[2*o]+n[2*s],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[2*o+1]=n[2*s+1]=l,e.heap[1]=l++,_a(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,i=t.max_code,a=t.stat_desc.static_tree,r=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length;let d,u,c,h,m,f,p=0;for(h=0;h<=aa;h++)e.bl_count[h]=0;for(n[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)u=e.heap[d],h=n[2*n[2*u+1]+1]+1,h>l&&(h=l,p++),n[2*u+1]=h,u>i||(e.bl_count[h]++,m=0,u>=s&&(m=o[u-s]),f=n[2*u],e.opt_len+=f*(h+m),r&&(e.static_len+=f*(a[2*u+1]+m)));if(0!==p){do{for(h=l-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[l]--,p-=2}while(p>0);for(h=l;0!==h;h--)for(u=e.bl_count[h];0!==u;)c=e.heap[--d],c>i||(n[2*c+1]!==h&&(e.opt_len+=(h-n[2*c+1])*n[2*c],n[2*c+1]=h),u--)}})(e,t),Ta(n,d,e.bl_count)},Ia=(e,t,n)=>{let i,a,r=-1,o=t[1],s=0,l=7,d=4;for(0===o&&(l=138,d=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)a=o,o=t[2*(i+1)+1],++s<l&&a===o||(s<d?e.bl_tree[2*a]+=s:0!==a?(a!==r&&e.bl_tree[2*a]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,r=a,0===o?(l=138,d=3):a===o?(l=6,d=3):(l=7,d=4))},Da=(e,t,n)=>{let i,a,r=-1,o=t[1],s=0,l=7,d=4;for(0===o&&(l=138,d=3),i=0;i<=n;i++)if(a=o,o=t[2*(i+1)+1],!(++s<l&&a===o)){if(s<d)do{Ma(e,a,e.bl_tree)}while(0!=--s);else 0!==a?(a!==r&&(Ma(e,a,e.bl_tree),s--),Ma(e,16,e.bl_tree),Sa(e,s-3,2)):s<=10?(Ma(e,17,e.bl_tree),Sa(e,s-3,3)):(Ma(e,18,e.bl_tree),Sa(e,s-11,7));s=0,r=a,0===o?(l=138,d=3):a===o?(l=6,d=3):(l=7,d=4)}};let Ra=!1;const Wa=(e,t,n,i)=>{Sa(e,0+(i?1:0),3),Aa(e),ka(e,n),ka(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var Na=e=>{Ra||((()=>{let e,t,n,i,a;const r=new Array(16);for(n=0,i=0;i<28;i++)for(ma[i]=n,e=0;e<1<<ra[i];e++)ha[n++]=i;for(ha[n-1]=i,a=0,i=0;i<16;i++)for(fa[i]=a,e=0;e<1<<oa[i];e++)ca[a++]=i;for(a>>=7;i<ia;i++)for(fa[i]=a<<7,e=0;e<1<<oa[i]-7;e++)ca[256+a++]=i;for(t=0;t<=aa;t++)r[t]=0;for(e=0;e<=143;)da[2*e+1]=8,e++,r[8]++;for(;e<=255;)da[2*e+1]=9,e++,r[9]++;for(;e<=279;)da[2*e+1]=7,e++,r[7]++;for(;e<=287;)da[2*e+1]=8,e++,r[8]++;for(Ta(da,287,r),e=0;e<ia;e++)ua[2*e+1]=5,ua[2*e]=Ea(e,5);ga=new pa(da,ra,257,na,aa),va=new pa(ua,oa,0,ia,aa),ya=new pa(new Array(0),sa,0,19,7)})(),Ra=!0),e.l_desc=new wa(e.dyn_ltree,ga),e.d_desc=new wa(e.dyn_dtree,va),e.bl_desc=new wa(e.bl_tree,ya),e.bi_buf=0,e.bi_valid=0,Pa(e)},Oa=(e,t,n,i)=>{let a,r,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<ta;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),La(e,e.l_desc),La(e,e.d_desc),o=(e=>{let t;for(Ia(e,e.dyn_ltree,e.l_desc.max_code),Ia(e,e.dyn_dtree,e.d_desc.max_code),La(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*la[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),a=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=a&&(a=r)):a=r=n+5,n+4<=a&&-1!==t?Wa(e,t,n,i):4===e.strategy||r===a?(Sa(e,2+(i?1:0),3),Ca(e,da,ua)):(Sa(e,4+(i?1:0),3),((e,t,n,i)=>{let a;for(Sa(e,t-257,5),Sa(e,n-1,5),Sa(e,i-4,4),a=0;a<i;a++)Sa(e,e.bl_tree[2*la[a]+1],3);Da(e,e.dyn_ltree,t-1),Da(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Ca(e,e.dyn_ltree,e.dyn_dtree)),Pa(e),i&&Aa(e)},Fa=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(ha[n]+ta+1)]++,e.dyn_dtree[2*ba(t)]++),e.sym_next===e.sym_end),ja=e=>{Sa(e,2,3),Ma(e,256,da),(e=>{16===e.bi_valid?(ka(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)},za={_tr_init:Na,_tr_stored_block:Wa,_tr_flush_block:Oa,_tr_tally:Fa,_tr_align:ja};var $a=(e,t,n,i)=>{let a=65535&e,r=e>>>16&65535,o=0;for(;0!==n;){o=n>2e3?2e3:n,n-=o;do{a=a+t[i++]|0,r=r+a|0}while(--o);a%=65521,r%=65521}return a|r<<16};const Ua=new Uint32Array((()=>{let e,t=[];for(var 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})());var Ha=(e,t,n,i)=>{const a=Ua,r=i+n;e^=-1;for(let n=i;n<r;n++)e=e>>>8^a[255&(e^t[n])];return~e},Ba={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"},Ga={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Xa,_tr_stored_block:Ya,_tr_flush_block:Ka,_tr_tally:Va,_tr_align:qa}=za,{Z_NO_FLUSH:Ja,Z_PARTIAL_FLUSH:Qa,Z_FULL_FLUSH:Za,Z_FINISH:er,Z_BLOCK:tr,Z_OK:nr,Z_STREAM_END:ir,Z_STREAM_ERROR:ar,Z_DATA_ERROR:rr,Z_BUF_ERROR:or,Z_DEFAULT_COMPRESSION:sr,Z_FILTERED:lr,Z_HUFFMAN_ONLY:dr,Z_RLE:ur,Z_FIXED:cr,Z_DEFAULT_STRATEGY:hr,Z_UNKNOWN:mr,Z_DEFLATED:fr}=Ga,pr=258,gr=262,vr=42,yr=113,wr=666,br=(e,t)=>(e.msg=Ba[t],t),kr=e=>2*e-(e>4?9:0),Sr=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Mr=e=>{let t,n,i,a=e.w_size;t=e.hash_size,i=t;do{n=e.head[--i],e.head[i]=n>=a?n-a:0}while(--t);t=a,i=t;do{n=e.prev[--i],e.prev[i]=n>=a?n-a:0}while(--t)};let Er=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const Tr=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},Pr=(e,t)=>{Ka(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Tr(e.strm)},Ar=(e,t)=>{e.pending_buf[e.pending++]=t},xr=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},_r=(e,t,n,i)=>{let a=e.avail_in;return a>i&&(a=i),0===a?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),n),1===e.state.wrap?e.adler=$a(e.adler,t,a,n):2===e.state.wrap&&(e.adler=Ha(e.adler,t,a,n)),e.next_in+=a,e.total_in+=a,a)},Cr=(e,t)=>{let n,i,a=e.max_chain_length,r=e.strstart,o=e.prev_length,s=e.nice_match;const l=e.strstart>e.w_size-gr?e.strstart-(e.w_size-gr):0,d=e.window,u=e.w_mask,c=e.prev,h=e.strstart+pr;let m=d[r+o-1],f=d[r+o];e.prev_length>=e.good_match&&(a>>=2),s>e.lookahead&&(s=e.lookahead);do{if(n=t,d[n+o]===f&&d[n+o-1]===m&&d[n]===d[r]&&d[++n]===d[r+1]){r+=2,n++;do{}while(d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&d[++r]===d[++n]&&r<h);if(i=pr-(h-r),r=h-pr,i>o){if(e.match_start=t,o=i,i>=s)break;m=d[r+o-1],f=d[r+o]}}}while((t=c[t&u])>l&&0!=--a);return o<=e.lookahead?o:e.lookahead},Lr=e=>{const t=e.w_size;let n,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-gr)&&(e.window.set(e.window.subarray(t,t+t-i),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Mr(e),i+=t),0===e.strm.avail_in)break;if(n=_r(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=n,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=Er(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=Er(e,e.ins_h,e.window[a+3-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<gr&&0!==e.strm.avail_in)},Ir=(e,t)=>{let n,i,a,r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,s=e.strm.avail_in;do{if(n=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a)break;if(a=e.strm.avail_out-a,i=e.strstart-e.block_start,n>i+e.strm.avail_in&&(n=i+e.strm.avail_in),n>a&&(n=a),n<r&&(0===n&&t!==er||t===Ja||n!==i+e.strm.avail_in))break;o=t===er&&n===i+e.strm.avail_in?1:0,Ya(e,0,0,o),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Tr(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(_r(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===o);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?4:t!==Ja&&t!==er&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(_r(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,r=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=r||(i||t===er)&&t!==Ja&&0===e.strm.avail_in&&i<=a)&&(n=i>a?a:i,o=t===er&&0===e.strm.avail_in&&n===i?1:0,Ya(e,e.block_start,n,o),e.block_start+=n,Tr(e.strm)),o?3:1)},Dr=(e,t)=>{let n,i;for(;;){if(e.lookahead<gr){if(Lr(e),e.lookahead<gr&&t===Ja)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Er(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-gr&&(e.match_length=Cr(e,n)),e.match_length>=3)if(i=Va(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Er(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Er(e,e.ins_h,e.window[e.strstart+1]);else i=Va(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(Pr(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===er?(Pr(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Pr(e,!1),0===e.strm.avail_out)?1:2},Rr=(e,t)=>{let n,i,a;for(;;){if(e.lookahead<gr){if(Lr(e),e.lookahead<gr&&t===Ja)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Er(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-gr&&(e.match_length=Cr(e,n),e.match_length<=5&&(e.strategy===lr||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-3,i=Va(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=a&&(e.ins_h=Er(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(Pr(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(i=Va(e,0,e.window[e.strstart-1]),i&&Pr(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=Va(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===er?(Pr(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Pr(e,!1),0===e.strm.avail_out)?1:2};function Wr(e,t,n,i,a){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=i,this.func=a}const Nr=[new Wr(0,0,0,0,Ir),new Wr(4,4,8,4,Dr),new Wr(4,5,16,8,Dr),new Wr(4,6,32,32,Dr),new Wr(4,4,16,16,Rr),new Wr(8,16,32,32,Rr),new Wr(8,16,128,128,Rr),new Wr(8,32,128,256,Rr),new Wr(32,128,258,1024,Rr),new Wr(32,258,258,4096,Rr)];function Or(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=fr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Sr(this.dyn_ltree),Sr(this.dyn_dtree),Sr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Sr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Sr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Fr=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==vr&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==yr&&t.status!==wr?1:0},jr=e=>{if(Fr(e))return br(e,ar);e.total_in=e.total_out=0,e.data_type=mr;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?vr:yr,e.adler=2===t.wrap?0:1,t.last_flush=-2,Xa(t),nr},zr=e=>{const t=jr(e);return t===nr&&(e=>{e.window_size=2*e.w_size,Sr(e.head),e.max_lazy_match=Nr[e.level].max_lazy,e.good_match=Nr[e.level].good_length,e.nice_match=Nr[e.level].nice_length,e.max_chain_length=Nr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},$r=(e,t,n,i,a,r)=>{if(!e)return ar;let o=1;if(t===sr&&(t=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),a<1||a>9||n!==fr||i<8||i>15||t<0||t>9||r<0||r>cr||8===i&&1!==o)return br(e,ar);8===i&&(i=9);const s=new Or;return e.state=s,s.strm=e,s.status=vr,s.wrap=o,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=a+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<a+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=r,s.method=n,zr(e)};var Ur=(e,t)=>{if(Fr(e)||t>tr||t<0)return e?br(e,ar):ar;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===wr&&t!==er)return br(e,0===e.avail_out?or:ar);const i=n.last_flush;if(n.last_flush=t,0!==n.pending){if(Tr(e),0===e.avail_out)return n.last_flush=-1,nr}else if(0===e.avail_in&&kr(t)<=kr(i)&&t!==er)return br(e,or);if(n.status===wr&&0!==e.avail_in)return br(e,or);if(n.status===vr&&0===n.wrap&&(n.status=yr),n.status===vr){let t=fr+(n.w_bits-8<<4)<<8,i=-1;if(i=n.strategy>=dr||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=i<<6,0!==n.strstart&&(t|=32),t+=31-t%31,xr(n,t),0!==n.strstart&&(xr(n,e.adler>>>16),xr(n,65535&e.adler)),e.adler=1,n.status=yr,Tr(e),0!==n.pending)return n.last_flush=-1,nr}if(57===n.status)if(e.adler=0,Ar(n,31),Ar(n,139),Ar(n,8),n.gzhead)Ar(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ar(n,255&n.gzhead.time),Ar(n,n.gzhead.time>>8&255),Ar(n,n.gzhead.time>>16&255),Ar(n,n.gzhead.time>>24&255),Ar(n,9===n.level?2:n.strategy>=dr||n.level<2?4:0),Ar(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ar(n,255&n.gzhead.extra.length),Ar(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ha(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(Ar(n,0),Ar(n,0),Ar(n,0),Ar(n,0),Ar(n,0),Ar(n,9===n.level?2:n.strategy>=dr||n.level<2?4:0),Ar(n,3),n.status=yr,Tr(e),0!==n.pending)return n.last_flush=-1,nr;if(69===n.status){if(n.gzhead.extra){let t=n.pending,i=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+i>n.pending_buf_size;){let a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=Ha(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=a,Tr(e),0!==n.pending)return n.last_flush=-1,nr;t=0,i-=a}let a=new Uint8Array(n.gzhead.extra);n.pending_buf.set(a.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending+=i,n.gzhead.hcrc&&n.pending>t&&(e.adler=Ha(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ha(e.adler,n.pending_buf,n.pending-i,i)),Tr(e),0!==n.pending)return n.last_flush=-1,nr;i=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Ar(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ha(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ha(e.adler,n.pending_buf,n.pending-i,i)),Tr(e),0!==n.pending)return n.last_flush=-1,nr;i=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Ar(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ha(e.adler,n.pending_buf,n.pending-i,i))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Tr(e),0!==n.pending))return n.last_flush=-1,nr;Ar(n,255&e.adler),Ar(n,e.adler>>8&255),e.adler=0}if(n.status=yr,Tr(e),0!==n.pending)return n.last_flush=-1,nr}if(0!==e.avail_in||0!==n.lookahead||t!==Ja&&n.status!==wr){let i=0===n.level?Ir(n,t):n.strategy===dr?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(Lr(e),0===e.lookahead)){if(t===Ja)return 1;break}if(e.match_length=0,n=Va(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Pr(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===er?(Pr(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Pr(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===ur?((e,t)=>{let n,i,a,r;const o=e.window;for(;;){if(e.lookahead<=pr){if(Lr(e),e.lookahead<=pr&&t===Ja)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(a=e.strstart-1,i=o[a],i===o[++a]&&i===o[++a]&&i===o[++a])){r=e.strstart+pr;do{}while(i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&a<r);e.match_length=pr-(r-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=Va(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Va(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Pr(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===er?(Pr(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Pr(e,!1),0===e.strm.avail_out)?1:2})(n,t):Nr[n.level].func(n,t);if(3!==i&&4!==i||(n.status=wr),1===i||3===i)return 0===e.avail_out&&(n.last_flush=-1),nr;if(2===i&&(t===Qa?q