PageSourceSearch

https://rentre.kr/_next/static/chunks/24hv4af21y76z.js

js rentre.kr collected 2026-10-07 19:26:05 UTC 283,844 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29178,(e,t,r)=>{"use strict";function n(e){return e.unshift("[Statsig]"),e}Object.defineProperty(r,"__esModule",{value:!0}),r.Log=r.LogLevel=void 0,r.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class i{static info(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];i.level>=r.LogLevel.Info&&console.info("  INFO ",...n(t))}static debug(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];i.level>=r.LogLevel.Debug&&console.debug(" DEBUG ",...n(t))}static warn(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];i.level>=r.LogLevel.Warn&&console.warn("  WARN ",...n(t))}static error(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];i.level>=r.LogLevel.Error&&console.error(" ERROR ",...n(t))}}r.Log=i,i.level=r.LogLevel.Warn},110977,(e,t,r)=>{"use strict";var n,i,a;Object.defineProperty(r,"__esModule",{value:!0}),r._getInstance=r._getStatsigGlobalFlag=r._getStatsigGlobal=void 0;let o=e.r(29178);r._getStatsigGlobal=()=>{try{return"u">typeof __STATSIG__?__STATSIG__:d}catch(e){return d}}
1,r._getStatsigGlobalFlag=e=>(0,r._getStatsigGlobal)()[e],r._getInstance=e=>{let t=(0,r._getStatsigGlobal)();return e?t.instances&&t.instances[e]:(t.instances&&Object.keys(t.instances).length>1&&o.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),t.firstInstance)};let s="__STATSIG__",l="u">typeof window?window:{},u=e.g,c="u">typeof globalThis?globalThis:{},d=null!=(a=null!=(i=null!=(n=l[s])?n:u[s])?i:c[s])?a:{instance:r._getInstance};l[s]=d,u[s]=d,c[s]=d},58055,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Diagnostics=void 0;let n=new Map,i="start";function a(e,t,r,n){return Object.assign({key:r,action:t,step:n,timestamp:Date.now()},e)}function o(e,t){var r;let i=null!=(r=n.get(e))?r:[];i.push(t),n.set(e,i)}function s(e,t){if(t in e)return e[t]}r.Diagnostics={_getMarkers:e=>n.get(e),_markInitOverallStart:e=>{o(e,a({},i,"overall"))},_markInitOverallEnd:(e,t,r)=>{o(e,a({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:r},"end","overall"))},_markInitNetworkReqStart:(e,t)=>{o(e,a(t,i,"initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{o(e,a(t,"end","initialize","network_request"))},_markInitProcessStart:e=>{o(e,a({},i,"initialize","process"))},_markInitProcessEnd:(e,t)=>{o(e,a(t,"end","initialize","process"))},_clearMarkers:e=>{n.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:s(e,"code"),name:s(e,"name"),message:s(e,"message")}},_getDiagnosticsData(e,t,n,i){var a;return{success:(null==e?void 0:e.ok)===!0,statusCode:null==e?void 0:e.status,sdkRegion:null==(a=null==e?void 0:e.headers)?void 0:a.get("x-statsig-region"),isDelta:!0===n.includes('"is_delta":true')||void 0,attempt:t,error:r.Diagnostics._formatError(i)}},_enqueueDiagnosticsEvent(e,t,n,i){let a=r.Diagnostics._getMarkers(n);if(null==a||a.length<=0)return -1;let o=a[a.length-1].timestamp-a[0].timestamp;r.Diagnostics._clearMarkers(n);let s={eventName:"statsig::diagnostics",user:e,value:null,metadata:{context:"initialize",markers:a.slice(),statsigOptions:i},time:Date.now()};return t.enqueue(s),o}}},914694,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.EventBatch=void 0,r.EventBatch=class{constructor(e){this.attempts=0,this.createdAt=Date.now(),this.events=e}incrementAttempts(){this.attempts++}}},645888,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.EventRetryConstants=void 0,r.EventRetryConstants={MAX_RETRY_ATTEMPTS:8,DEFAULT_BATCH_SIZE:100,MAX_PENDING_BATCHES:40,TICK_INTERVAL_MS:1e3,QUICK_FLUSH_WINDOW_MS:200,MAX_LOCAL_STORAGE:500,get MAX_QUEUED_EVENTS(){return this.DEFAULT_BATCH_SIZE*this.MAX_PENDING_BATCHES}}},431189,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BatchQueue=void 0;let n=e.r(914694),i=e.r(645888);r.BatchQueue=class{constructor(e=i.EventRetryConstants.DEFAULT_BATCH_SIZE){this._batches=[],this._batchSize=e}batchSize(){return this._batchSize}requeueBatch(e){return this._enqueueBatch(e)}hasFullBatch(){return this._batches.some(e=>e.events.length>=this._batchSize)}takeNextBatch(){return this._batches.shift()}takeAllBatches(){let e=this._batches;return this._batches=[],e}createBatches(e){let t=0,r=0;for(;t<e.length;){let i=e.slice(t,t+this._batchSize);r+=this._enqueueBatch(new n.EventBatch(i)),t+=this._batchSize}return r}_enqueueBatch(e){this._batches.push(e);let t=0;for(;this._batches.length>i.EventRetryConstants.MAX_PENDING_BATCHES;){let e=this._batches.shift();e&&(t+=e.events.length)}return t}}},352602,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._isTypeMatch=r._typeOf=void 0,r._typeOf=function(e){return Array.isArray(e)?"array":typeof e},r._isTypeMatch=function(e,t){let r=e=>Array.isArray(e)?"array":null===e?"null":typeof e;return r(e)===r(t)}},660042,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._getSortedObject=r._DJB2Object=r._DJB2=void 0;let n=e.r(352602);r._DJB2=e=>{let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return String(t>>>0)},r._DJB2Object=(e,t)=>
1(0,r._DJB2)(JSON.stringify((0,r._getSortedObject)(e,t))),r._getSortedObject=(e,t)=>{if(null==e)return null;let i=Object.keys(e).sort(),a={};return i.forEach(i=>{let o=e[i];if(0===t||"object"!==(0,n._typeOf)(o)){a[i]=o;return}a[i]=(0,r._getSortedObject)(o,null!=t?t-1:t)}),a}},932776,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._getStorageKey=r._getUserStorageKey=void 0;let n=e.r(660042);function i(e,t,r){var i;if(r)return r(e,t);let a=t&&t.customIDs?t.customIDs:{},o=[`uid:${null!=(i=null==t?void 0:t.userID)?i:""}`,`cids:${Object.keys(a).sort((e,t)=>e.localeCompare(t)).map(e=>`${e}-${a[e]}`).join(",")}`,`k:${e}`];return(0,n._DJB2)(o.join("|"))}r._getUserStorageKey=i,r._getStorageKey=function(e,t,r){return t?i(e,t,r):(0,n._DJB2)(`k:${e}`)}},621471,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.NetworkParam=r.NetworkDefault=r.Endpoint=void 0,r.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},r.NetworkDefault={[r.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[r.Endpoint._initialize]:"https://featureassets.org/v1",[r.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},r.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},392771,(e,t,r)=>{"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.SDKType=void 0;let i={};r.SDKType={_get:e=>{var t;return(null!=(t=i[e])?t:"js-mono")+(null!=n?n:"")},_setClientType(e,t){i[e]=t},_setBindingType(e){n&&"-react"!==n||(n="-"+e)}}},218843,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.StatsigMetadataProvider=r.SDK_VERSION=void 0,r.SDK_VERSION="3.33.0";let n={sdkVersion:r.SDK_VERSION,sdkType:"js-mono"};r.StatsigMetadataProvider={get:()=>n,add:e=>{n=Object.assign(Object.assign({},n),e)}}},272690,(e,t,r)=>{"use strict";var n=e.i(247167);Object.defineProperty(r,"__esModule",{value:!0}),r._cloneObject=r._getUnloadEvent=r._getCurrentPageUrlSafe=r._addDocumentEventListenerSafe=r._addWindowEventListenerSafe=r._isServerEnv=r._getDocumentSafe=r._getWindowSafe=void 0;let i=e.r(29178);r._getWindowSafe=()=>"u">typeof window?window:null,r._getDocumentSafe=()=>{var e;let t=(0,r._getWindowSafe)();return null!=(e=null==t?void 0:t.document)?e:null},r._isServerEnv=()=>{if(null!==(0,r._getDocumentSafe)())return!1;let e=void 0!==n.default&&null!=n.default.versions&&null!=n.default.versions.node;return"string"==typeof EdgeRuntime||e},r._addWindowEventListenerSafe=(e,t)=>{let n=(0,r._getWindowSafe)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(e,t)},r._addDocumentEventListenerSafe=(e,t)=>{let n=(0,r._getDocumentSafe)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(e,t)},r._getCurrentPageUrlSafe=()=>{var e;try{return null==(e=(0,r._getWindowSafe)())?void 0:e.location.href.split(/[?#]/)[0]}catch(e){return}},r._getUnloadEvent=()=>{let e=(0,r._getWindowSafe)();return e&&"onpagehide"in e?"pagehide":"beforeunload"},r._cloneObject=(e,t)=>{try{return JSON.parse(JSON.stringify(t))}catch(t){return i.Log.error(`Failed to clone object ${e}`),null}}},761789,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._notifyVisibilityChanged=r._subscribeToVisiblityChanged=r._isUnloading=r._isCurrentlyVisible=void 0;let n=e.r(272690),i="foreground",a="background",o=[],s=i,l=!1;r._isCurrentlyVisible=()=>s===i,r._isUnloading=()=>l,r._subscribeToVisiblityChanged=e=>{o.unshift(e)},r._notifyVisibilityChanged=e=>{e!==s&&(s=e,o.forEach(t=>t(e)))},(0,n._addWindowEventListenerSafe)("focus",()=>{l=!1,(0,r._notifyVisibilityChanged)(i)}),(0,n._addWindowEventListenerSafe)("blur",()=>(0,r._notifyVisibilityChanged)(a)),(0,n._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,r._notifyVisibilityChanged)("visible"===document.visibilityState?i:a)}),(0,n._addWindowEventListenerSafe)((0,n._getUnloadEvent)(),()=>{l=!0,(0,r._notifyVisibilityChanged)(a)})},387312,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};
1Object.defineProperty(r,"__esModule",{value:!0}),r.EventSender=void 0;let i=e.r(29178),a=e.r(621471),o=e.r(392771),s=e.r(218843),l=e.r(761789);r.EventSender=class{constructor(e,t,r,n,i){this._sdkKey=e,this._network=t,this._emitter=r,this._options=i,this._logEventUrlConfig=n}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}sendBatch(e){return n(this,void 0,void 0,function*(){var t,r,n;let a="event_sender_unexpected_exception",o={};try{let n=(0,l._isUnloading)()&&this._network.isBeaconSupported()&&(null==(r=null==(t=this._options)?void 0:t.networkConfig)?void 0:r.networkOverrideFunc)==null;a="event_sender_pre_logs_flushed_emitter_exception",this._emitter({name:"pre_logs_flushed",events:e.events}),a=n?"event_sender_unexpected_exception":"event_sender_post_exception";let i=n?this._sendEventsViaBeacon(e,o):yield this._sendEventsViaPost(e,o);if(i.success)return a="event_sender_logs_flushed_emitter_exception",this._emitter({name:"logs_flushed",events:e.events}),i;return Object.assign(Object.assign(Object.assign({success:!1,statusCode:i.statusCode,failurePath:i.failurePath},i.failureErrorMessage?{failureErrorMessage:i.failureErrorMessage}:{}),i.failureDiagnosticBucket?{failureDiagnosticBucket:i.failureDiagnosticBucket}:{}),i.failureDiagnosticMetadata?{failureDiagnosticMetadata:i.failureDiagnosticMetadata}:{})}catch(e){return i.Log.warn("Failed to send batch:",e),Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:null!=(n=o.path)?n:a},o.errorMessage?{failureErrorMessage:o.errorMessage}:{}),o.diagnosticBucket?{failureDiagnosticBucket:o.diagnosticBucket}:{}),o.diagnosticMetadata?{failureDiagnosticMetadata:o.diagnosticMetadata}:{})}})}_sendEventsViaPost(e,t){return n(this,void 0,void 0,function*(){var r,n;let i=yield this._network.post(this._getRequestData(e),t),a=null!=(r=null==i?void 0:i.code)?r:-1;return -1===a?Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:null!=(n=t.path)?n:void 0===i?"event_sender_post_returned_undefined":"event_sender_post_returned_null"},t.errorMessage?{failureErrorMessage:t.errorMessage}:{}),t.diagnosticBucket?{failureDiagnosticBucket:t.diagnosticBucket}:{}),t.diagnosticMetadata?{failureDiagnosticMetadata:t.diagnosticMetadata}:{}):{success:a>=200&&a<300,statusCode:a}})}_sendEventsViaBeacon(e,t){var r;let n=this._network.beacon(this._getRequestData(e),t);return Object.assign(Object.assign(Object.assign({success:n,statusCode:n?200:-1,failurePath:n?void 0:null!=(r=t.path)?r:"beacon_send_false"},!n&&t.errorMessage?{failureErrorMessage:t.errorMessage}:{}),!n&&t.diagnosticBucket?{failureDiagnosticBucket:t.diagnosticBucket}:{}),!n&&t.diagnosticMetadata?{failureDiagnosticMetadata:t.diagnosticMetadata}:{})}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e.events},urlConfig:this._logEventUrlConfig,retries:3,preserveFailedStatusCode:!0,isCompressable:!0,params:{[a.NetworkParam.EventCount]:String(e.events.length)},headers:{"statsig-event-count":String(e.events.length),"statsig-retry-count":String(e.attempts),"statsig-sdk-type":o.SDKType._get(this._sdkKey),"statsig-sdk-version":s.SDK_VERSION},credentials:"same-origin"}}}},963169,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.FlushInterval=void 0,r.FlushInterval=class{constructor(){this._currentIntervalMs=1e3,this._lastFlushAttemptTime=Date.now()}getCurrentIntervalMs(){return this._currentIntervalMs}markFlushAttempt(){this._lastFlushAttemptTime=Date.now()}getTimeSinceLastAttempt(){return Date.now()-this._lastFlushAttemptTime}hasReachedMaxInterval(){return this.getTimeSinceLastAttempt()>=6e4}getTimeTillMaxInterval(){return 6e4-this.getTimeSinceLastAttempt()}hasCompletelyRecoveredFromBackoff(){return this._currentIntervalMs<=1e3}adjustForSuccess(){let e=this._currentIntervalMs;1e3!==e&&(this._currentIntervalMs=Math.max(1e3,Math.floor(e/2)))}adjustForFailure(){let e=this._currentIntervalMs;this._currentIntervalMs=Math.min(6e4,2*e)}getTimeUntilNextFlush(){return this.getCurrentIntervalMs()-this.getTimeSinceLastAttempt()}}},289390,(e,t,r)=>{"use strict";var n,i;
1Object.defineProperty(r,"__esModule",{value:!0}),r.FlushType=void 0,(i=n||(r.FlushType=n={})).ScheduledMaxTime="scheduled:max_time",i.ScheduledFullBatch="scheduled:full_batch",i.Limit="limit",i.Manual="manual",i.Shutdown="shutdown"},458475,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0}),r._fetchTxtRecords=void 0;let i=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),a=["i","e","d"];r._fetchTxtRecords=function(e){return n(this,void 0,void 0,function*(){let t=yield e("https://cloudflare-dns.com/dns-query",{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:i});if(!t.ok){let e=Error("Failed to fetch TXT records from DNS");throw e.name="DnsTxtFetchError",e}return function(e){let t=e.findIndex((t,r)=>r<200&&"="===String.fromCharCode(t)&&a.includes(String.fromCharCode(e[r-1])));if(-1===t){let e=Error("Failed to parse TXT records from DNS");throw e.name="DnsTxtParseError",e}let r="";for(let n=t-1;n<e.length;n++)r+=String.fromCharCode(e[n]);return r.split(",")}(new Uint8Array((yield t.arrayBuffer())))})}},883649,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._setObjectInStorage=r._getObjectFromStorage=r.Storage=void 0;let n=e.r(29178),i=e.r(272690),a={},o={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>a[e]?a[e]:null,setItem:(e,t)=>{a[e]=t},removeItem:e=>{delete a[e]},getAllKeys:()=>Object.keys(a)},s=null;try{let e=(0,i._getWindowSafe)();e&&e.localStorage&&"function"==typeof e.localStorage.getItem&&(s={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>e.localStorage.getItem(t),setItem:(t,r)=>e.localStorage.setItem(t,r),removeItem:t=>e.localStorage.removeItem(t),getAllKeys:()=>Object.keys(e.localStorage)})}catch(e){n.Log.warn("Failed to setup localStorageProvider.")}let l=null!=s?s:o,u=l;function c(e){try{return e()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return r.Storage._setProvider(o),null;throw e}}r.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:e=>c(()=>u.getItem(e)),setItem:(e,t)=>c(()=>u.setItem(e,t)),removeItem:e=>u.removeItem(e),getAllKeys:()=>u.getAllKeys(),_setProvider:e=>{l=e,u=e},_setDisabled:e=>{u=e?o:l}},r._getObjectFromStorage=function(e){let t=r.Storage.getItem(e);try{return JSON.parse(null!=t?t:"null")}catch(t){return n.Log.error(`Failed to parse value for key "${e}"`),null}},r._setObjectInStorage=function(e,t){r.Storage.setItem(e,JSON.stringify(t))}},228872,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0}),r._isDomainFailure=r.NetworkFallbackResolver=void 0;let i=e.r(458475),a=e.r(660042),o=e.r(29178),s=e.r(883649);function l(e,t){var r;let n=null!=(r=null==e?void 0:e.toLowerCase())?r:"";return t||n.includes("uncaught exception")||n.includes("failed to fetch")||n.includes("networkerror when attempting to fetch resource")}function u(e){return`statsig.network_fallback.${(0,a._DJB2)(e)}`}function c(e,t){let r=u(e);t&&0!==Object.keys(t).length?s.Storage.setItem(r,JSON.stringify(t)):s.Storage.removeItem(r)}r.NetworkFallbackResolver=class{constructor(e){var t;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=null==(t=e.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){var r;let n=null==(r=this._fallbackInfo)?void 0:r[t.endpoint];n&&(n.expiryTime=Date.now()+6048e5,c(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:n})))}getActiveFallbackUrl(e,t){var r,n;if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let i=this._fallbackInfo;null==i&&(i=null!=(r=function(e){let t=u(e),r=s.Storage.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return o.Log.error("Failed to parse FallbackInfo"),null}}(e))?r:{},this._fallbackInfo=i);let a=i[t.endpoint];return!a||Date.now()>(null!=(n=a.expiryTime)?n:0)||t.getChecksum()!==a.urlConfigChecksum?(delete i[t.endpoint],this._fallbackInfo=i,c(e,this._fallbackInfo),null):a.url?a.url:null}tryFetchUpdatedFallbackInfo(e,t,r,i){return n(this,void 0,void 0,function*(){var n,a;try{if(!l(r,i))return!1;let a=null==t.customUrl&&null==t.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(t):t.fallbackUrls,o=this._pickNewFallbackUrl(null==(n=this._fallbackInfo)?void 0:n[t.endpoint],a);if(!o)return!1;return this._updateFallbackInfoWithNewUrl(e,t,o),!0}catch(e){return null==(a=this._errorBoundary)||a.logError("tryFetchUpdatedFallbackInfo",e),!1}})}_updateFallbackInfoWithNewUrl(e,t,r){var n,i,a;let o={urlConfigChecksum:t.getChecksum(),url:r,expiryTime:Date.now()+6048e5,previous:[]},s=t.endpoint,l=null==(n=this._fallbackInfo)?void 0:n[s];l&&o.previous.push(...l.previous),o.previous.length>10&&(o.previous=[]);let u=null==(a=null==(i=this._fallbackInfo)?void 0:i[s])?void 0:a.url;null!=u&&o.previous.push(u),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[s]:o}),c(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){return n(this,void 0,void 0,function*(){var t;let r=this._dnsQueryCooldowns[e.endpoint];if(r&&Date.now()<r)return null;this._dnsQueryCooldowns[e.endpoint]=Date.now()+144e5;let n=[],a=yield(0,i._fetchTxtRecords)(null!=(t=this._networkOverrideFunc)?t:fetch),o=function(e){try{return new URL(e).pathname}catch(e){return null}}(e.defaultUrl);for(let t of a){if(!t.startsWith(e.endpointDnsKey+"="))continue;let r=t.split("=");if(r.length>1){let e=r[1];e.endsWith("/")&&(e=e.slice(0,-1)),n.push(`https://${e}${o}
1`)}}return n})}_pickNewFallbackUrl(e,t){var r;if(null==t)return null;let n=new Set(null!=(r=null==e?void 0:e.previous)?r:[]),i=null==e?void 0:e.url,a=null;for(let e of t){let t=e.endsWith("/")?e.slice(0,-1):e;if(!n.has(e)&&t!==i){a=t;break}}return a}},r._isDomainFailure=l},967476,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SDKFlags=void 0;let n={};r.SDKFlags={setFlags:(e,t)=>{n[e]=t},get:(e,t)=>{var r,i;return null!=(i=null==(r=n[e])?void 0:r[t])&&i}}},245652,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getUUID=void 0,r.getUUID=function(){if("u">typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let e=new Date().getTime(),t="u">typeof performance&&performance.now&&1e3*performance.now()||0,r="89ab"[Math.floor(4*Math.random())];return`xxxxxxxx-xxxx-4xxx-${r}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,r=>{let n=16*Math.random();return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),("x"===r?n:7&n|8).toString(16)})}},398137,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.StatsigSession=r.SessionID=void 0;let n=e.r(932776),i=e.r(29178),a=e.r(883649),o=e.r(245652),s=e.r(761789),l={};function u(e){var t;let r=e.data,n=function(e){let{lastUpdate:t}=e;return Date.now()-t>18e5}(r)||function(e){let{startTime:t}=e;return Date.now()-t>144e5}(r);return n&&(e.data=h(),null==(t=null==__STATSIG__?void 0:__STATSIG__.instance(e.sdkKey))||t.$emt({name:"session_expired"})),n}function c(e){return`statsig.session_id.${(0,n._getStorageKey)(e)}`}function d(e){try{(0,a._setObjectInStorage)(e.storageKey,e.data),e.lastPersistedAt=Date.now()}catch(e){i.Log.warn("Failed to save SessionID")}}function h(){return{sessionID:(0,o.getUUID)(),startTime:Date.now(),lastUpdate:Date.now()}}(0,s._subscribeToVisiblityChanged)(e=>{"background"===e&&Object.values(l).forEach(e=>d(e))}),r.SessionID={get:e=>r.StatsigSession.get(e).data.sessionID},r.StatsigSession={get:function(e){var t,r,n;let i,o=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return null==l[e]&&(l[e]=function(e){let t=c(e),r=(0,a._getObjectFromStorage)(t);return r&&r.sessionID&&r.startTime&&r.lastUpdate?{data:r,sdkKey:e,lastPersistedAt:0,storageKey:t}:{data:h(),sdkKey:e,lastPersistedAt:0,storageKey:t}}(e)),t=l[e],r=o,i=Date.now(),u(t)?d(t):r&&(t.data.lastUpdate=i,n=t,Date.now()-n.lastPersistedAt>15e3&&d(n)),t},overrideInitialSessionID:(e,t)=>{let r=Date.now(),n={data:{sessionID:e,startTime:r,lastUpdate:r},sdkKey:t,lastPersistedAt:Date.now(),storageKey:c(t)};d(n),l[t]=n},checkForIdleSession:e=>{let t=l[e];!t||u(t)&&d(t)}}},636666,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getCookieName=r.StableID=void 0;let n=e.r(932776),i=e.r(29178),a=e.r(272690),o=e.r(883649),s=e.r(245652),l={},u={},c={};function d(e){return`statsig.stable_id.${(0,n._getStorageKey)(e)}`}function h(e,t){let r=d(t);try{(0,o._setObjectInStorage)(r,e)}catch(e){i.Log.warn("Failed to save StableID to storage")}}function f(e,t){if(!u[t]||null==(0,a._getDocumentSafe)())return;let r=new Date;r.setFullYear(r.getFullYear()+1),document.cookie=`${p(t)}=${encodeURIComponent(e)}; expires=${r.toUTCString()}; path=/`}function p(e){return`statsig.stable_id.${(0,n._getStorageKey)(e)}`}r.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{let t;if(c[e])return null;if(null!=l[e])return l[e];let r=null;return null!=(r=function(e){if(!u[e]||null==(0,a._getDocumentSafe)())return null;for(let t of document.cookie.split(";")){let[r,n]=t.trim().split("=");if(r===p(e))return decodeURIComponent(n)}return null}(e))?(l[e]=r,h(r,e)):(null==(t=d(e),r=(0,o._getObjectFromStorage)(t))&&(r=(0,s.getUUID)()),h(r,e),f(r,e),l[e]=r),r},setOverride:(e,t)=>{l[t]=e,h(e,t),f(e,t)},_setCookiesEnabled:(e,t)=>{u[e]=t},_setDisabled:(e,t)=>{c[e]=t}},r.getCookieName=p},38602,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorTag=void 0,r.ErrorTag={NetworkError:"NetworkError"}},558346,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.LoggingEnabledOption=r.LogEventCompressionMode=void 0,r.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},r.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},288590,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};
1Object.defineProperty(r,"__esModule",{value:!0}),r.NetworkCore=r.RETRYABLE_CODES=void 0,e.r(110977);let i=e.r(110977),a=e.r(58055),o=e.r(29178),s=e.r(621471),l=e.r(228872),u=e.r(967476),c=e.r(392771),d=e.r(272690),h=e.r(398137),f=e.r(636666),p=e.r(38602),_=e.r(218843),g=e.r(558346),v=e.r(761789);r.RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]),r.NetworkCore=class{constructor(e,t){this._emitter=t,this._errorBoundary=null,this._timeout=1e4,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new l.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return"u">typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){let e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e,t){if(!m(e))return t&&(t.path="beacon_invalid_sdk_key"),!1;let r=this._getInternalRequestArgs("POST",e),n=this._getPopulatedURL(r),i=navigator;try{let e=i.sendBeacon.bind(i)(n,r.body);return!e&&t&&(t.path="beacon_send_false"),e}catch(e){throw t&&(t.path="beacon_send_exception"),e}}post(e,t){return n(this,void 0,void 0,function*(){let r=this._getInternalRequestArgs("POST",e);return this._tryEncodeBody(r),yield this._tryToCompressBody(r),this._sendRequest(r,t)})}get(e){let t=this._getInternalRequestArgs("GET",e);return this._sendRequest(t)}_sendRequest(e,t){return n(this,void 0,void 0,function*(){var i,l,u,c,h,f,_,g,y,w,S,A,x,I,k,C,T,O,D;if(!m(e))return t&&(t.path="network_invalid_sdk_key"),null;if(this._netConfig.preventAllNetworkTraffic)return t&&(t.path="network_prevent_all_network_traffic"),null;let{method:P,body:j,retries:R,attempt:N}=e,L=e.urlConfig.endpoint;if(this._isRateLimited(L))return o.Log.warn(`Request to ${L} was blocked because you are making requests too frequently.`),t&&(t.path="network_rate_limited"),null;let M=null!=N?N:1,U=!1,F=this._getPopulatedURL(e),B=Date.now(),K=null,z=(0,v._isUnloading)();try{let t,r={method:P,body:j,headers:Object.assign({},e.headers),priority:e.priority,keepalive:z};h=e,f=M,h.urlConfig.endpoint===s.Endpoint._initialize&&a.Diagnostics._markInitNetworkReqStart(h.sdkKey,{attempt:f});let n=this._leakyBucket[L];n&&(n.lastRequestTime=Date.now(),this._leakyBucket[L]=n);let o=null!=(i=this._netConfig.networkOverrideFunc)?i:fetch;if(!(K=yield Promise.race([o(F,r).finally(()=>clearTimeout(t)),new Promise((e,r)=>{t=setTimeout(()=>{U=!0,r(Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})])).ok){let e=yield K.text().catch(()=>"No Text"),t=Error(`NetworkError: ${F} ${e}`);throw t.name="NetworkError",t}let l=yield K.text();return E(e,K,M,l),this._fallbackResolver.tryBumpExpiryTime(e.sdkKey,e.urlConfig),{body:l,code:K.status}}catch(s){let i="string"==typeof(_=s)?_:_ instanceof Error?`${_.name}: ${_.message}`:"Unknown Error",a=(g=null!=i?i:"",y=U,g.includes("Timeout")||y);if(E(e,K,M,"",s),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(e.sdkKey,e.urlConfig,i,a))&&(e.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(e.sdkKey,e.urlConfig)),!R||M>R||!r.RETRYABLE_CODES.has(null!=(l=null==K?void 0:K.status)?l:500)){null==(u=this._emitter)||u.call(this,{name:"error",error:s,tag:p.ErrorTag.NetworkError,requestArgs:e});let r=`A networking error occurred during ${P} request to ${F}.`;if(o.Log.error(r,i,s),null==(c=this._errorBoundary)||c.attachErrorIfNoneExists(r),e.preserveFailedStatusCode&&null!=K)return{body:null,code:K.status};if(null==K&&t){t.path=a?"network_request_timed_out_no_response":"network_request_exception_no_response",i&&(t.errorMessage=i);try{let r,n,i,o,s,l,u,c,h,f,p,_,g,m=(w=e,S=F,A=a,x=Date.now()-B,r=(0,d._getWindowSafe)(),n=null==r?void 0:r.document,i="u">typeof navigator?navigator:null,o=(0,v._isUnloading)(),s=i&&"boolean"==typeof i.onLine?String(i.onLine):"unknown",l=null!=(I=null==n?void 0:n.visibilityState)?I:"unknown",u=Object.keys(null!=(k=w.headers)?k:{}).length>0,c=(T=S,!(O=null==(C=null==r?void 0:r.location)?void 0:C.origin)||!T.startsWith(`${O}/`)&&!T.startsWith(`${O}?`)&&T!==O),h=null!=w.urlConfig.customUrl,f=null!=w.fallbackUrl,p=b(x,[250,1e3,5e3,1e4]),_=b((D=w.body,null==D?0:"string"==typeof D?D.length:D instanceof Uint8Array?D.byteLength:"u">typeof Blob&&D instanceof Blob?D.size:-1),[16384,65536,262144,1048576]),g="unknown_no_response",A?g="timeout":"false"===s?g="browser_offline":o?g="page_unloading":"hidden"===l?g="page_hidden":c&&u?g="cross_origin_custom_headers_preflight_risk":h||f?g="custom_url_no_response":x<250&&(g="immediate_network_rejection"),{bucket:g,metadata:{elapsedMsBucket:p,bodySizeBucket:_,online:s,visibilityState:l,isUnloading:String(o),crossOrigin:String(c),hasCustomUrl:String(h)}});t.diagnosticBucket=m.bucket,t.diagnosticMetadata=m.metadata}catch(e){}}return null}return yield function(e){return n(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(e*e*500,3e4)))})}(M),this._sendRequest(Object.assign(Object.assign({},e),{retries:R,attempt:M+1}),t)}})}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t||(null==e?void 0:e.disableCompression)!==!0||(t=g.LogEventCompressionMode.Disabled),t||(t=g.LogEventCompressionMode.Enabled),t}_isRateLimited(e){var t;let r=Date.now(),n=null!=(t=this._leakyBucket[e])?t:{count:0,lastRequestTime:r},i=Math.floor((r-n.lastRequestTime)*.05);return n.count=Math.max(0,n.count-i),n.count>=50||(n.count+=1,n.lastRequestTime=r,this._leakyBucket[e]=n,!1)}_getPopulatedURL(e){var t;let r=null!=(t=e.fallbackUrl)?t:e.urlConfig.getUrl();(e.urlConfig.endpoint===s.Endpoint._initialize||e.urlConfig.endpoint===s.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=r);let n=Object.assign({[s.NetworkParam.SdkKey]:e.sdkKey,[s.NetworkParam.SdkType]:c.SDKType._get(e.sdkKey),[s.NetworkParam.SdkVersion]:_.SDK_VERSION,[s.NetworkParam.Time]:String(Date.now()),[s.NetworkParam.SessionID]:h.SessionID.get(e.sdkKey)},e.params),i=Object.keys(n).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`).join("&");return`${r}${i?`?${i}`:""}`}_tryEncodeBody(e){var t;let r=(0,d._getWindowSafe)(),n=e.body;if(e.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof n&&null==(0,i._getStatsigGlobalFlag)("no-encode")&&(null==r?void 0:r.btoa))try{e.body=r.btoa(n).split("").reverse().join(""),e.params=Object.assign(Object.assign({},null!=(t=e.params)?t:{}),{[s.NetworkParam.StatsigEncoded]:"1"})}catch(t){o.Log.warn(`Request encoding failed for ${e.urlConfig.getUrl()}`,t)}}_tryToCompressBody(e){return n(this,void 0,void 0,function*(){var t;let r=e.body;if("string"==typeof r&&function(e,t){if(!e.isCompressable||null!=(0,i._getStatsigGlobalFlag)("no-compress")||"u"<typeof CompressionStream||"u"<typeof TextEncoder)return!1;let r=null!=e.urlConfig.customUrl||null!=e.urlConfig.fallbackUrls,n=!0===u.SDKFlags.get(e.sdkKey,"enable_log_event_compression");switch(t.logEventCompressionMode){case g.LogEventCompressionMode.Disabled:return!1;case g.LogEventCompressionMode.Enabled:if(r&&!n)return!1;return!0;case g.LogEventCompressionMode.Forced:return!0;default:return!1}}(e,this._options))try{let n,i=new TextEncoder().encode(r),a=new CompressionStream("gzip"),l=a.writable.getWriter();l.write(i).catch(o.Log.error),l.close().catch(o.Log.error);let u=a.readable.getReader(),c=[];for(;!(n=yield u.read()).done;)c.push(n.value);let d=c.reduce((e,t)=>
1e+t.length,0),h=new Uint8Array(d),f=0;for(let e of c)h.set(e,f),f+=e.length;e.body=h,e.params=Object.assign(Object.assign({},null!=(t=e.params)?t:{}),{[s.NetworkParam.IsGzipped]:"1"})}catch(t){o.Log.warn(`Request compression failed for ${e.urlConfig.getUrl()}`,t)}})}_getInternalRequestArgs(e,t){let r=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),n=Object.assign(Object.assign({},t),{method:e,fallbackUrl:r});return"data"in t&&y(n,t.data),n}};let m=e=>!!e.sdkKey||(o.Log.warn("Unable to make request without an SDK key"),!1),y=(e,t)=>{let{sdkKey:r,fallbackUrl:n}=e,i=f.StableID.get(r),a=h.SessionID.get(r),o=c.SDKType._get(r);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},_.StatsigMetadataProvider.get()),{stableID:i,sessionID:a,sdkType:o,fallbackUrl:n})}))};function b(e,t){if(e<0)return"unknown";for(let r of t)if(e<r)return`<${r}`;return`>=${t[t.length-1]}`}function E(e,t,r,n,i){e.urlConfig.endpoint===s.Endpoint._initialize&&a.Diagnostics._markInitNetworkReqEnd(e.sdkKey,a.Diagnostics._getDiagnosticsData(t,r,n,i))}},837204,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0}),r.FlushCoordinator=void 0;let i=e.r(645888),a=e.r(387312),o=e.r(963169),s=e.r(289390),l=e.r(660042),u=e.r(29178),c=e.r(288590),d=e.r(272690),h=e.r(398137),f=e.r(558346),p=e.r(883649),_=new Set(["network_request_timed_out_no_response","network_request_exception_no_response","event_sender_post_returned_null","event_sender_post_returned_undefined","event_sender_post_exception"]);r.FlushCoordinator=class{constructor(e,t,r,n,i,s,l,u,c,d){this._cooldownTimer=null,this._maxIntervalTimer=null,this._hasRunQuickFlush=!1,this._currentFlushPromise=null,this._creationTime=Date.now(),this._isShuttingDown=!1,this._storageKey=null,this._flushInterval=new o.FlushInterval,this._batchQueue=e,this._pendingEvents=t,this._onPrepareFlush=r,this._errorBoundary=d,this._sdkKey=n,this._loggingEnabled=c,this._eventSender=new a.EventSender(n,i,s,l,u)}setLoggingEnabled(e){this._loggingEnabled=e}setLogEventCompressionMode(e){this._eventSender.setLogEventCompressionMode(e)}startScheduledFlushCycle(){this._scheduleNextFlush()}stopScheduledFlushCycle(){this._clearAllTimers()}addEvent(e){this._pendingEvents.addToPendingEventsQueue(e),!this._currentFlushPromise&&this._pendingEvents.hasEventsForFullBatch()&&this.processLimitFlush()}processManualFlush(){return n(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(s.FlushType.Manual).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}),this._currentFlushPromise})}processShutdown(){return n(this,void 0,void 0,function*(){return this._isShuttingDown=!0,this._clearAllTimers(),this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(s.FlushType.Shutdown).catch(e=>{u.Log.error(`Error during shutdown flush: ${e}`)}).finally(()=>{this._currentFlushPromise=null}),this._currentFlushPromise})}_executeFlush(e){return n(this,void 0,void 0,function*(){this._clearAllTimers();try{this._prepareQueueForFlush(e);let t=this._batchQueue.takeAllBatches();if(0===t.length)return;yield Promise.all(t.map(t=>this._processOneBatch(t,e)))}finally{this._isShuttingDown||this._scheduleNextFlush()}})}checkQuickFlush(){this._hasRunQuickFlush||Date.now()-this._creationTime>i.EventRetryConstants.QUICK_FLUSH_WINDOW_MS||(this._hasRunQuickFlush=!0,setTimeout(()=>{this.processManualFlush().catch(e=>{u.Log.warn("Quick flush failed:",e)})},i.EventRetryConstants.QUICK_FLUSH_WINDOW_MS))}_attemptScheduledFlush(){let e;if(this._currentFlushPromise)return void this._scheduleNextFlush();let t=this.containsAtLeastOneFullBatch(),r=this._flushInterval.hasReachedMaxInterval();t||r?(this._flushInterval.markFlushAttempt(),e=t?s.FlushType.ScheduledFullBatch:s.FlushType.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(e).then(()=>{}).catch(e=>{u.Log.error("Error during scheduled flush:",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})):this._scheduleNoopPollTick()}processLimitFlush(){!this._flushInterval.hasCompletelyRecoveredFromBackoff()||this._currentFlushPromise||(this._currentFlushPromise=this._processLimitFlush
1Internal().catch(e=>{u.Log.error("Error during limit flush",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}))}_processLimitFlushInternal(){return n(this,void 0,void 0,function*(){if(yield this._processNextBatch(s.FlushType.Limit))for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch()&&(yield this._processNextBatch(s.FlushType.Limit)););})}_scheduleNextFlush(){if(this._clearAllTimers(),this._isShuttingDown)return;let e=Math.max(0,this._flushInterval.getTimeUntilNextFlush());this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,h.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e);let t=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,h.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},t)}_clearAllTimers(){null!==this._cooldownTimer&&(clearTimeout(this._cooldownTimer),this._cooldownTimer=null),null!==this._maxIntervalTimer&&(clearTimeout(this._maxIntervalTimer),this._maxIntervalTimer=null)}_scheduleNoopPollTick(){if(this._clearAllTimers(),this._isShuttingDown)return;this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,h.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},i.EventRetryConstants.TICK_INTERVAL_MS);let e=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,h.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e)}_processNextBatch(e){return n(this,void 0,void 0,function*(){this._prepareQueueForFlush(e);let t=this._batchQueue.takeNextBatch();return!!t&&this._processOneBatch(t,e)})}_processOneBatch(e,t){return n(this,void 0,void 0,function*(){if(this._loggingEnabled!==f.LoggingEnabledOption.always&&(0,d._isServerEnv)())return this._flushInterval.adjustForSuccess(),!0;let r=yield this._eventSender.sendBatch(e);return r.success?(this._flushInterval.adjustForSuccess(),!0):(this._flushInterval.adjustForFailure(),this._handleFailure(e,t,r.statusCode,r.failurePath,r.failureErrorMessage,r.failureDiagnosticBucket,r.failureDiagnosticMetadata),!1)})}_prepareQueueForFlush(e){this._onPrepareFlush();let t=this.convertPendingEventsToBatches();t>0&&(u.Log.warn(`Dropped ${t} events`),this._errorBoundary.logDroppedEvents(t,"Batch queue limit reached during batching",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:i.EventRetryConstants.MAX_PENDING_BATCHES,flushType:e,retries:"dropped before batching"}))}containsAtLeastOneFullBatch(){return this._pendingEvents.hasEventsForFullBatch()||this._batchQueue.hasFullBatch()}convertPendingEventsToBatches(){if(this._pendingEvents.isEmpty())return 0;let e=this._pendingEvents.takeAll();return this._batchQueue.createBatches(e)}_isRetryableBatch(e,t){return!!(c.RETRYABLE_CODES.has(e)||-1===e&&t&&_.has(t))}_handleFailure(e,t,r,n,a,o,l){if(t===s.FlushType.Shutdown){u.Log.warn(`${t} flush failed during shutdown. ${e.events.length} event(s) will be saved to storage for retry in next session.`),this._saveShutdownFailedEventsToStorage(e.events);return}if(!this._isRetryableBatch(r,n)){u.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped. Non-retryable error: ${r}`),this._errorBoundary.logEventRequestFailure(e.events.length,"non-retryable error",t,r,e.attempts,n,a,o,l);return}if(e.attempts>=i.EventRetryConstants.MAX_RETRY_ATTEMPTS){u.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped.`),this._errorBoundary.logEventRequestFailure(e.events.length,"max retry attempts exceeded",t,r,e.attempts,n,a,o,l);return}e.incrementAttempts();let c=this._batchQueue.requeueBatch(e);c>0&&(u.Log.warn(`Failed to requeue batch : dropped ${c} events due to full queue`),this._errorBoundary.logDroppedEvents(c,"Batch queue limit reached during requeue",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:i.EventRetryConstants.MAX_PENDING_BATCHES,flushType:t,retries:e.attempts}))}loadAndRetryShutdownFailedEvents(){return n(this,void 0,void 0,function*(){let e=this._getStorageKey();try{p.Storage.isReady()||(yield p.Storage.isReadyResolver());let t=this._getShutdownFailedEventsFromStorage(e);if(0===t.length)return;u.Log.debug(`Loading ${t.length} failed shutdown event(s) from storage for retry`),p.Storage.removeItem(e),t.forEach(e
1=>{this.addEvent(e)}),yield this.processManualFlush()}catch(e){u.Log.warn("Failed to load and retry failed shutdown events:",e)}})}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.failed_shutdown_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_saveShutdownFailedEventsToStorage(e){let t=this._getStorageKey();try{let r=[...this._getShutdownFailedEventsFromStorage(t),...e];r.length>i.EventRetryConstants.MAX_LOCAL_STORAGE&&(r=r.slice(-i.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,p._setObjectInStorage)(t,r),u.Log.debug(`Saved ${e.length} failed shutdown event(s) to storage (total stored: ${r.length})`)}catch(e){u.Log.warn("Unable to save failed shutdown events to storage:",e)}}_getShutdownFailedEventsFromStorage(e){try{let t=(0,p._getObjectFromStorage)(e);if(Array.isArray(t))return t;return[]}catch(e){return[]}}}},267625,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.PendingEvents=void 0;let n=e.r(29178);r.PendingEvents=class{constructor(e){this._pendingEvents=[],this._batchSize=e}addToPendingEventsQueue(e){this._pendingEvents.push(e),n.Log.debug("Enqueued Event:",e)}hasEventsForFullBatch(){return this._pendingEvents.length>=this._batchSize}takeAll(){let e=this._pendingEvents;return this._pendingEvents=[],e}isEmpty(){return 0===this._pendingEvents.length}}},551857,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._createLayerParameterExposure=r._createConfigExposure=r._mapExposures=r._createGateExposure=r._isExposureEvent=void 0;let n="statsig::config_exposure",i="statsig::gate_exposure",a="statsig::layer_exposure",o=(e,t,r,n,i)=>(r.bootstrapMetadata&&(n.bootstrapMetadata=r.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:l(r,n),secondaryExposures:i,time:Date.now()});function s(e,t){return e.map(e=>"string"==typeof e?(null!=t?t:{})[e]:e).filter(e=>null!=e)}r._isExposureEvent=e=>{let{eventName:t}=e;return t===i||t===n||t===a},r._createGateExposure=(e,t,r)=>{var n,a,l;let u={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return(null==(n=t.__evaluation)?void 0:n.version)!=null&&(u.configVersion=t.__evaluation.version),o(i,e,t.details,u,s(null!=(l=null==(a=t.__evaluation)?void 0:a.secondary_exposures)?l:[],r))},r._mapExposures=s,r._createConfigExposure=(e,t,r)=>{var i,a,l,u;let c={config:t.name,ruleID:t.ruleID};return(null==(i=t.__evaluation)?void 0:i.version)!=null&&(c.configVersion=t.__evaluation.version),(null==(a=t.__evaluation)?void 0:a.passed)!=null&&(c.rulePassed=String(t.__evaluation.passed)),o(n,e,t.details,c,s(null!=(u=null==(l=t.__evaluation)?void 0:l.secondary_exposures)?u:[],r))},r._createLayerParameterExposure=(e,t,r,n)=>{var i,l,u,c,d,h,f;let p=t.__evaluation,_=(null==(i=null==p?void 0:p.explicit_parameters)?void 0:i.includes(r))===!0,g="",v=null!=(l=null==p?void 0:p.undelegated_secondary_exposures)?l:[];_&&(g=null!=(u=p.allocated_experiment_name)?u:"",v=null!=(c=p.secondary_exposures)?c:[]);let m=null==(d=t.__evaluation)?void 0:d.parameter_rule_ids,y={config:t.name,parameterName:r,ruleID:null!=(h=null==m?void 0:m[r])?h:t.ruleID,allocatedExperiment:g,isExplicitParameter:String(_)};return(null==(f=t.__evaluation)?void 0:f.version)!=null&&(y.configVersion=t.__evaluation.version),o(a,e,t.details,y,s(v,n))};let l=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)},371712,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.UrlConfiguration=void 0;let n=e.r(660042),i=e.r(621471),a={[i.Endpoint._initialize]:"i",[i.Endpoint._rgstr]:"e",[i.Endpoint._download_config_specs]:"d"};r.UrlConfiguration=class{constructor(e,t,r,n){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=a[e],t&&(this.customUrl=t),!t&&r&&(this.customUrl=r.endsWith("/")?`${r}${e}`:`${r}/${e}`),n&&(this.fallbackUrls=n);const o=i.NetworkDefault[e];this.defaultUrl=`${o}/${e}`}getUrl(){var e;return null!=(e=this.customUrl)?e:this.defaultUrl}getChecksum(){var e;let t=(null!=(e=this.fallbackUrls)?e:[]).sort().join(",");return(0,n._DJB2)(this.customUrl+t)}}},95790,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};
1Object.defineProperty(r,"__esModule",{value:!0}),r.EventLogger=void 0;let i=e.r(431189),a=e.r(932776),o=e.r(645888),s=e.r(837204),l=e.r(660042),u=e.r(29178),c=e.r(621471),d=e.r(267625),h=e.r(272690),f=e.r(551857),p=e.r(558346),_=e.r(883649),g=e.r(371712),v=e.r(761789),m={};r.EventLogger=class e{static _safeFlushAndForget(e){var t;null==(t=m[e])||t.flush().catch(()=>{})}constructor(e,t,r,n,i){var a;this._sdkKey=e,this._emitter=t,this._network=r,this._options=n,this._errorBoundary=i,this._pendingEvents=null,this._batchQueue=null,this._flushCoordinator=null,this._lastExposureTimeMap={},this._nonExposedChecks={},this._isShuttingDown=!1,this._storageKey=null,this._pendingCompressionMode=null,this._loggingEnabled=null!=(a=null==n?void 0:n.loggingEnabled)?a:(null==n?void 0:n.disableLogging)===!0?p.LoggingEnabledOption.disabled:p.LoggingEnabledOption.browserOnly,(null==n?void 0:n.loggingEnabled)&&void 0!==n.disableLogging&&u.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging.");const o=null==n?void 0:n.networkConfig;this._logEventUrlConfig=new g.UrlConfiguration(c.Endpoint._rgstr,null==o?void 0:o.logEventUrl,null==o?void 0:o.api,null==o?void 0:o.logEventFallbackUrls)}setLogEventCompressionMode(e){this._flushCoordinator?this._flushCoordinator.setLogEventCompressionMode(e):this._pendingCompressionMode=e}setLoggingEnabled(e){let t="disabled"===this._loggingEnabled,r="disabled"!==e;if(this._loggingEnabled=e,this._flushCoordinator&&this._flushCoordinator.setLoggingEnabled(e),t&&r){let e=this._loadStoredEvents();u.Log.debug(`Loaded ${e.length} stored event(s) from storage`),e.length>0&&(e.forEach(e=>{this._initFlushCoordinator().addEvent(e)}),this.flush().catch(e=>{u.Log.warn("Failed to flush events after enabling logging:",e)}))}}enqueue(e){var t;if(!this._shouldLogEvent(e))return;let r=this._normalizeEvent(e);"disabled"===this._loggingEnabled?this._storeEventToStorage(r):(this._initFlushCoordinator().addEvent(r),null==(t=this._flushCoordinator)||t.checkQuickFlush())}incrementNonExposureCount(e){var t;let r=null!=(t=this._nonExposedChecks[e])?t:0;this._nonExposedChecks[e]=r+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var t;let r=(0,h._isServerEnv)();if(r&&(null==(t=this._options)?void 0:t.loggingEnabled)!=="always")return;let n=this._initFlushCoordinator();m[this._sdkKey]=this,r||(0,v._subscribeToVisiblityChanged)(t=>{"background"===t?e._safeFlushAndForget(this._sdkKey):"foreground"===t&&n.startScheduledFlushCycle()}),n.loadAndRetryShutdownFailedEvents().catch(e=>{u.Log.warn("Failed to load failed shutdown events:",e)}),n.startScheduledFlushCycle()}stop(){return n(this,void 0,void 0,function*(){this._isShuttingDown=!0,this._flushCoordinator&&(yield this._flushCoordinator.processShutdown()),delete m[this._sdkKey],this._flushCoordinator=null,this._pendingEvents=null,this._batchQueue=null})}flush(){return n(this,void 0,void 0,function*(){if(this._flushCoordinator)return this._flushCoordinator.processManualFlush()})}appendAndResetNonExposedChecks(){if(0===Object.keys(this._nonExposedChecks).length)return;let e=Object.assign({},this._nonExposedChecks);this._nonExposedChecks={};let t=this._normalizeEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:e}});this._flushCoordinator&&this._flushCoordinator.addEvent(t)}_shouldLogEvent(e){var t;if((null==(t=this._options)?void 0:t.loggingEnabled)!=="always"&&(0,h._isServerEnv)())return!1;if(!(0,f._isExposureEvent)(e))return!0;let r=e.user?e.user:{statsigEnvironment:void 0},n=(0,a._getUserStorageKey)(this._sdkKey,r),i=e.metadata?e.metadata:{},o=[e.eventName,n,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join("|"),s=this._lastExposureTimeMap[o],l=Date.now();return(!s||!(l-s<6e5))&&(Object.keys(this._lastExposureTimeMap).length>1e3&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[o]=l,!0)}_getCurrentPageUrl(){var e;if((null==(e=this._options)?void 0:e.includeCurrentPageUrlWithEvents)!==!1)return(0,h._getCurrentPageUrlSafe)()}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.pending_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_initFlushCoordinator(){var e,t;if(this._flushCoordinator)return this._flushCoordinator;let r=null!=(t=null==(e=this._options)?void 0:e.loggingBufferMaxSize)?t:o.EventRetryConstants.DEFAULT_BATCH_SIZE;return this._pendingEvents=new d.PendingEvents(r),this._batchQueue=new i.BatchQueue(r),this._flushCoordinator=new s.FlushCoordinator(this._batchQueue,this._pendingEvents,()=>this.appendAndResetNonExposedChecks(),this._sdkKey,this._network,this._emitter,this._logEventUrlConfig,this._options,this._loggingEnabled,this._errorBoundary),this._pendingCompressionMode&&(this._flushCoordinator.setLogEventCompressionMode(this._pe
1ndingCompressionMode),this._pendingCompressionMode=null),this._flushCoordinator}_storeEventToStorage(e){let t=this._getStorageKey();try{let r=this._getEventsFromStorage(t);r.push(e),r.length>o.EventRetryConstants.MAX_LOCAL_STORAGE&&(r=r.slice(-o.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,_._setObjectInStorage)(t,r)}catch(e){u.Log.warn("Unable to save events to storage")}}_getEventsFromStorage(e){try{let t=(0,_._getObjectFromStorage)(e);if(Array.isArray(t))return t;return[]}catch(e){return[]}}_loadStoredEvents(){let e=this._getStorageKey(),t=this._getEventsFromStorage(e);return t.length>0&&_.Storage.removeItem(e),t}_normalizeEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);let t={},r=this._getCurrentPageUrl();return r&&(t.statsigMetadata={currentPage:r}),Object.assign(Object.assign({},e),t)}}},317607,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.PrecomputedEvaluationsContextHandle=void 0;let n=e.r(29178),i=e.r(272690),a=e.r(398137),o=e.r(636666);r.PrecomputedEvaluationsContextHandle=class{constructor(e,t,r,n,i,a){this._sdkKey=e,this._getOptions=t,this._getErrorBoundary=r,this._getValues=n,this._getUser=i,this._getSdkInstanceID=a}get sdkKey(){return this._sdkKey}get options(){return this._getOptions()}get errorBoundary(){return this._getErrorBoundary()}get values(){return this._getValues()}get user(){let e=(0,i._cloneObject)("StatsigUser",this._getUser());return null==e&&(n.Log.error("Failed to clone user"),e={}),e}getSession(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return a.StatsigSession.get(this._sdkKey,e)}get stableID(){return o.StableID.get(this._sdkKey)}get sdkInstanceID(){return this._getSdkInstanceID()}toContext(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return{sdkKey:this.sdkKey,options:this.options,values:this.values,user:this.user,errorBoundary:this.errorBoundary,session:this.getSession(e),stableID:this.stableID,sdkInstanceID:this.sdkInstanceID}}}},281925,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._getUnitIDFromUser=r._getFullUserHash=r._normalizeUser=void 0;let n=e.r(660042),i=e.r(29178),a=e.r(272690);r._normalizeUser=function(e,t,r){let n=(0,a._cloneObject)("StatsigUser",e);return null==n?(i.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(null!=t&&null!=t.environment?n.statsigEnvironment=t.environment:null!=r&&(n.statsigEnvironment={tier:r}),n)},r._getFullUserHash=function(e){return e?(0,n._DJB2Object)(e):null},r._getUnitIDFromUser=function(e,t){var r,n,i;if("string"!=typeof t)return e.userID;let a=t.toLowerCase();return"userid"!==a?null!=(n=null==(r=e.customIDs)?void 0:r[t])?n:null==(i=e.customIDs)?void 0:i[a]:e.userID}},706007,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._typedJsonParse=void 0;let n=e.r(29178);r._typedJsonParse=function(e,t,r){try{let r=JSON.parse(e);if(r&&"object"==typeof r&&t in r)return r}catch(e){}return n.Log.error(`Failed to parse ${r}`),null}},517825,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0}),r._makeDataAdapterResult=r.DataAdapterCore=void 0;let i=e.r(29178),a=e.r(636666),o=e.r(281925),s=e.r(883649),l=e.r(706007);function u(e,t,r,n){return{source:e,data:t,receivedAt:Date.now(),stableID:r,fullUserHash:(0,o._getFullUserHash)(n)}}r.DataAdapterCore=class{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._cacheLimit=10,this._lastModifiedStoreKey=`statsig.last_modified_time.${t}`,this._inMemoryCache=new c}attach(e,t,r){this._sdkKey=e,this._options=t}getDataSync(e){let t=e&&(0,o._normalizeUser)(e,this._options),r=this._getCacheKey(t),n=this._inMemoryCache.get(r,t);if(n&&this._getIsCacheValueValid(n))return n;let i=this._loadFromCache(r);return i&&this._getIsCacheValueValid(i)?(this._inMemoryCache.add(r,i,this._cacheLimit),this._inMemoryCache.get(r,t)):null}setData(e,t){let r=t&&(0,o._normalizeUser)(t,this._options),n=this._getCacheKey(r);this._inMemoryCache.add(n,u("Bootstrap",e,null,r),this._cacheLimit)}_getIsCacheValueValid(e){return null==e.stableID||e.stableID===a.StableID.get(this._getSdkKey())}_getDataAsyncImpl(e,t,r){return n(this,void 0,void 0,function*(){s.Storage.isReady()||(yield s.Storage.isReadyResolver());let n=null!=e?e:this.getDataSync(t),a=[this._fetchAndPrepFromNetwork(n,t,r)];return(null==r?void 0:r.timeoutMs)&&a.push(new Promise(e=>setTimeout(e,r.timeoutMs)).then(()=>(i.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(a)})}_prefetchDataImpl(e,t){return n(this,void 0,void 0,function*(){let r=e&&(0,o._normalizeUser)(e,this._options),n=this._getCacheKey(r),i=yield this._getDataAsyncImpl(null,r,t);i&&this._inMemoryCache.add(n,Object.assign(Object.assign({},i),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(e,t,r){return n(this,void 0,void 0,function*(){var n;
1let o=null!=(n=null==e?void 0:e.data)?n:null,s=null!=e&&this._isCachedResultValidFor204(e,t),c=yield this._fetchFromNetwork(o,t,r,s);if(!c)return i.Log.debug("No response returned for latest value"),null;let d=(0,l._typedJsonParse)(c,"has_updates","Response"),h=this._getSdkKey(),f=a.StableID.get(h),p=null;if((null==d?void 0:d.has_updates)===!0)p=u("Network",c,f,t);else{if(!o||(null==d?void 0:d.has_updates)!==!1)return null;p=u("NetworkNotModified",o,f,t)}let _=this._getCacheKey(t);return this._inMemoryCache.add(_,p,this._cacheLimit),this._writeToCache(_,p),p})}_getSdkKey(){return null!=this._sdkKey?this._sdkKey:(i.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(e){var t;let r=null==(t=s.Storage.getItem)?void 0:t.call(s.Storage,e);if(null==r)return null;let n=(0,l._typedJsonParse)(r,"source","Cached Result");return n?Object.assign(Object.assign({},n),{source:"Cache"}):null}_writeToCache(e,t){let r=JSON.stringify(t);for(let t=0;t<8;t++)try{s.Storage.setItem(e,r);break}catch(t){if(!(t instanceof Error)||!(t.toString().includes("QuotaExceededError")||t.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw t;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(e,this._cacheLimit-1)}this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._cacheLimit,n=null!=(t=(0,s._getObjectFromStorage)(this._lastModifiedStoreKey))?t:{};for(let t of(n[e]=Date.now(),d(n,r)))delete n[t],s.Storage.removeItem(t);(0,s._setObjectInStorage)(this._lastModifiedStoreKey,n)}},r._makeDataAdapterResult=u;class c{constructor(){this._data={}}get(e,t){var r;let n=this._data[e],a=null==n?void 0:n.stableID,o=null==(r=null==t?void 0:t.customIDs)?void 0:r.stableID;return o&&a&&o!==a?(i.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):n}add(e,t,r){for(let e of d(this._data,r-1))delete this._data[e];this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function d(e,t){let r=Object.keys(e);return r.length<=t?[]:0===t?r:r.sort((t,r)=>{let n=e[t],i=e[r];return"object"==typeof n&&"object"==typeof i?n.receivedAt-i.receivedAt:n-i}).slice(0,r.length-t)}},611715,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},863868,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorBoundary=r.EXCEPTION_ENDPOINT=void 0;let i=e.r(29178),a=e.r(392771),o=e.r(218843);r.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";let s="[Statsig] UnknownError";function l(e){return e instanceof Error?e:"string"==typeof e?Error(e):Error("An unknown error occurred.")}r.ErrorBoundary=class{constructor(e,t,r,n){this._sdkKey=e,this._options=t,this._emitter=r,this._lastSeenError=n,this._seen=new Set}wrap(e,t){try{(function(e){let t=new Set,r=Object.getPrototypeOf(e);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).filter(e=>"function"==typeof(null==r?void 0:r[e])).forEach(e=>t.add(e)),r=Object.getPrototypeOf(r);return Array.from(t)})(e).forEach(r=>{var n=this;let i=e[r];"$EB"in i||(e[r]=function(){for(var a=arguments.length,o=Array(a),s=0;s<a;s++)o[s]=arguments[s];return n._capture(t?`${t}:${r}`:r,()=>i.apply(e,o))},e[r].$EB=!0)})}catch(e){this._onError("eb:wrap",e)}}logError(e,t){this._onError(e,t)}logDroppedEvents(e,t,r){let n={eventCount:String(e),reason:t};r&&Object.keys(r).forEach(e=>{n[e]=String(r[e])}),this._onError("statsig::log_event_dropped_event_count",Error(t),!0,n)}logEventRequestFailure(e,t,r,n,i,a,o,s,l){let u={eventCount:String(e),flushType:r,statusCode:String(n),reason:t,retries:String(i)};a&&(u.failurePath=a),"string"==typeof o&&o.length>0&&(u.failureErrorMessage=o),"string"==typeof s&&s.length>
10&&(u.failureDiagnosticBucket=s),l&&Object.keys(l).forEach(e=>{let t=l[e];t.length>0&&(u[`failureDiagnostic_${e}`]=t)}),this._onError("statsig::log_event_failed",Error(t),!0,u)}getLastSeenErrorAndReset(){let e=this._lastSeenError;return this._lastSeenError=void 0,null!=e?e:null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=l(e))}_capture(e,t){try{let r=t();if(r&&r instanceof Promise)return r.catch(t=>this._onError(e,t));return r}catch(t){return this._onError(e,t),null}}_onError(e,t){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3?arguments[3]:void 0;try{i.Log.warn(`Caught error in ${e}`,{error:t}),n(this,void 0,void 0,function*(){var n,i,d,h,f,p,_;let g=t||Error(s),v=g instanceof Error,m=v?g.name:"No Name",y=l(g);if(this._lastSeenError=y,!u&&this._seen.has(m))return;if(this._seen.add(m),null==(i=null==(n=this._options)?void 0:n.networkConfig)?void 0:i.preventAllNetworkTraffic){null==(d=this._emitter)||d.call(this,{name:"error",error:t,tag:e});return}let b=a.SDKType._get(this._sdkKey),E=o.StatsigMetadataProvider.get(),w=v?g.stack:function(e){try{return JSON.stringify(e)}catch(e){return s}}(g),S=Object.assign(Object.assign({tag:e,exception:m,info:w,statsigOptions:function(e){if(!e)return{};let t={};return Object.keys(e).forEach(r=>{let n=e[r];switch(typeof n){case"number":case"bigint":case"boolean":t[String(r)]=n;break;case"string":n.length<50?t[String(r)]=n:t[String(r)]="set";break;case"object":"environment"===r?t.environment=n:"networkConfig"===r?t.networkConfig=n:t[String(r)]=null!=n?"set":"unset"}}),t}(this._options)},Object.assign(Object.assign({},E),{sdkType:b})),null!=c?c:{}),A=null==(h=this._options)?void 0:h.networkConfig,x=null!=(f=null==A?void 0:A.networkOverrideFunc)?f:fetch;yield x(null!=(p=null==A?void 0:A.sdkExceptionUrl)?p:r.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(b),"STATSIG-SDK-VERSION":String(E.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(S)}),null==(_=this._emitter)||_.call(this,{name:"error",error:t,tag:e})}).then(()=>{}).catch(()=>{})}catch(e){}}}},234532,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},849839,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},60072,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},838502,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.createMemoKey=r.MemoPrefix=void 0,r.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};let n=new Set([]),i=new Set(["userPersistedValues"]);r.createMemoKey=function(e,t,r){let a=`${e}|${t}`;if(!r)return a;for(let e of Object.keys(r)){if(i.has(e))return;n.has(e)?a+=`|${e}=true`:a+=`|${e}=${r[e]}`}return a}},682396,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},883290,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},556887,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._fastApproxSizeOf=void 0,r._fastApproxSizeOf=(e,t)=>{let n=0,i=Object.keys(e);for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(n+=o.length,"object"==typeof s&&null!==s?n+=(0,r._fastApproxSizeOf)(s,t)+2:n+=String(s).length+1,n>=t)break}return n}},411797,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0}),r.StatsigClientBase=void 0,e.r(110977);let i=e.r(110977),a=e.r(863868),o=e.r(95790),s=e.r(29178),l=e.r(838502),u=e.r(272690),c=e.r(398137),d=e.r(636666),h=e.r(558346),f=e.r(883649);r.StatsigClientBase=class{constructor(e,t,r,n){var l,h,p,_;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const g=this.$emt.bind(this);(null==n?void 0:n.logLevel)!=null&&(s.Log.level=n.logLevel),(null==n?void 0:n.disableStorage)&&f.Storage._setDisabled(!0),(null==n?void 0:n.initialSessionID)&&c.StatsigSession.overrideInitialSessionID(n.initialSessionID,e),(null==n?void 0:n.storageProvider)&&f.Storage._setProvider(n.storageProvider),(null==n?void 0:n.enableCookies)&&d.StableID._setCo
1okiesEnabled(e,n.enableCookies),(null==n?void 0:n.disableStableID)&&d.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=null!=n?n:{},this._memoCache={},this.overrideAdapter=null!=(l=null==n?void 0:n.overrideAdapter)?l:null,this._errorBoundary=new a.ErrorBoundary(e,n,g),this._logger=new o.EventLogger(e,g,r,n,this._errorBoundary),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),r.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,n,r),this.storageProvider=f.Storage,null==(_=null==(p=null==(h=this.overrideAdapter)?void 0:h.loadFromStorage)?void 0:p.call(h))||_.catch(e=>this._errorBoundary.logError("OA::loadFromStorage",e)),this._primeReadyRipcord(),function(e,t){var r;if((0,u._isServerEnv)())return;let n=(0,i._getStatsigGlobal)(),a=null!=(r=n.instances)?r:{};null!=a[e]&&s.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),a[e]=t,n.firstInstance||(n.firstInstance=t),n.instances=a,__STATSIG__=n}(e,this)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):null!=e.disableLogging&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),null!=e.disableStorage&&(this._options.disableStorage=e.disableStorage,f.Storage._setDisabled(e.disableStorage)),null!=e.enableCookies&&(this._options.enableCookies=e.enableCookies,d.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(h.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){if(this._listeners[e]){let r=this._listeners[e].indexOf(t);-1!==r&&this._listeners[e].splice(r,1)}}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(e){var t;let r=t=>{try{t(e)}catch(r){if(!0===t.__isInternal)return void this._errorBoundary.logError(`__emit:${e.name}`,r);s.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};this._listeners[e.name]&&this._listeners[e.name].forEach(e=>r(e)),null==(t=this._listeners["*"])||t.forEach(r)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,r){(null==r?void 0:r.disableExposureLog)===!0?this._logger.incrementNonExposureCount(e):this._logger.enqueue(t)}_memoize(e,t){return(r,n)=>{if(this._options.disableEvaluationMemoization)return t(r,n);let i=(0,l.createMemoKey)(e,r,n);return i?(i in this._memoCache||(Object.keys(this._memoCache).length>=3e3&&(this._memoCache={}),this._memoCache[i]=t(r,n)),this._memoCache[i]):t(r,n)}}}},332805,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.DataAdapterCachePrefix=void 0,r.DataAdapterCachePrefix="statsig.cached"},995602,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},937768,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._makeTypedGet=r._mergeOverride=r._makeLayer=r._makeExperiment=r._makeDynamicConfig=r._makeFeatureGate=void 0;let n=e.r(29178),i=e.r(352602);function a(e,t,r,n){var i;return{name:e,details:t,ruleID:null!=(i=null==r?void 0:r.rule_id)?i:"",__evaluation:r,value:n}}function o(e,t,r){var n,i;let o=null!=(n=null==r?void 0:r.value)?n:{};return Object.assign(Object.assign({},a(e,t,r,o)),{idType:null!=(i=null==r?void 0:r.id_type)?i:null,get:s(e,null==r?void 0:r.value)})}function s(e,t,r){return(a,o)=>{var s;let l=null!=(s=null==t?void 0:t[a])?s:null;return null==l?null!=o?o:null:null==o||(0,i._isTypeMatch)(l,o)?(null==r||r(a),l):(n.Log.warn(`Parameter type mismatch. '${e}.${a}' was found to be type '${typeof l}' but fallback/return type is '${typeof o}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=o?o:null)}}r._makeFeatureGate=function(e,t,r){var n;return Object.assign(Object.assign({},a(e,t,r,(null==r?void 0:r.value)===!0)),{idType:null!=(n=null==r?void 0:r.id_type)?n:null})},r._makeDynamicConfig=o,r._makeExperiment=function(e,t,r){var n;return Object.assign(Object.assign({},o(e,t,r)),{groupName:null!=(n=null==r?void 0:r.group_name)?n:null})},r._makeLayer=function(e,t,r,n){var i,o;return Object.assign(Object.assign({},a(e,t,r,void 0)),{get:s(e,null==r?void 0:r.value,n),groupName:null!=(i=null==r?void 0:r.group_name)?i:null,__value:null!=(o=null==r?void 0:r.value)?o:{}})},r._mergeOverride=function(e,t,r,n){return Object.assign(Object.assign(Object.assign({},e),t),{get:s(e.name,r,n)})},r._makeTypedGet=s},790943,(e,t,r)=>{"use strict";
1Object.defineProperty(r,"__esModule",{value:!0})},764981,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.UPDATE_DETAIL_ERROR_MESSAGES=r.createUpdateDetails=void 0,r.createUpdateDetails=(e,t,r,n,i,a)=>({duration:r,source:t,success:e,error:n,sourceUrl:i,warnings:a}),r.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},99535,(e,t,r)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.Storage=r.Log=r.EventLogger=r.Diagnostics=void 0,e.r(110977);let a=e.r(110977),o=e.r(58055);Object.defineProperty(r,"Diagnostics",{enumerable:!0,get:function(){return o.Diagnostics}});let s=e.r(95790);Object.defineProperty(r,"EventLogger",{enumerable:!0,get:function(){return s.EventLogger}});let l=e.r(29178);Object.defineProperty(r,"Log",{enumerable:!0,get:function(){return l.Log}});let u=e.r(218843),c=e.r(883649);Object.defineProperty(r,"Storage",{enumerable:!0,get:function(){return c.Storage}}),i(e.r(110977),r),i(e.r(932776),r),i(e.r(317607),r),i(e.r(517825),r),i(e.r(58055),r),i(e.r(611715),r),i(e.r(863868),r),i(e.r(234532),r),i(e.r(849839),r),i(e.r(660042),r),i(e.r(60072),r),i(e.r(29178),r),i(e.r(838502),r),i(e.r(621471),r),i(e.r(288590),r),i(e.r(682396),r),i(e.r(883290),r),i(e.r(272690),r),i(e.r(392771),r),i(e.r(398137),r),i(e.r(556887),r),i(e.r(636666),r),i(e.r(411797),r),i(e.r(38602),r),i(e.r(332805),r),i(e.r(551857),r),i(e.r(218843),r),i(e.r(558346),r),i(e.r(995602),r),i(e.r(937768),r),i(e.r(790943),r),i(e.r(281925),r),i(e.r(883649),r),i(e.r(706007),r),i(e.r(352602),r),i(e.r(371712),r),i(e.r(245652),r),i(e.r(761789),r),i(e.r(764981),r),i(e.r(967476),r),Object.assign((0,a._getStatsigGlobal)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},94214,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.V1InitializeContainer=void 0;let n=e.r(99535);r.V1InitializeContainer=class{constructor(e){this._values=e}getGate(e){return this._getResultFromLookup(this._values.feature_gates,e)}getConfig(e){return this._getResultFromLookup(this._values.dynamic_configs,e)}getLayer(e){return this._getResultFromLookup(this._values.layer_configs,e)}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var r,i;return e&&null!=(i=null!=(r=e[t])?r:e[(0,n._DJB2)(t)])?i:null}}},261817,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.V2InitializeContainer=void 0;let n=e.r(99535);r.V2InitializeContainer=class{constructor(e){this._values=e}getGate(e){var t,r,n;let i=this._getResultFromLookup(this._values.feature_gates,e);return i?{name:e,value:!0===i.v,rule_id:null!=(t=i.r)?t:"default",secondary_exposures:null!=(r=i.s)?r:[],id_type:null!=(n=i.i)?n:""}:null}getConfig(e){var t,r,n,i;let a=this._getResultFromLookup(this._values.dynamic_configs,e);return a?{name:e,value:null!=(t=this._values.values[a.v])?t:{},rule_id:a.r,secondary_exposures:null!=(r=a.s)?r:[],id_type:null!=(n=a.i)?n:"",is_user_in_experiment:!0===a.ue,passed:!0===a.p,group_name:null!=(i=a.gn)?i:void 0,is_experiment_active:!0===a.ea,group:a.r,is_device_based:"stableID"===a.i}:null}getLayer(e){var t,r,n,i,a,o;let s=this._getResultFromLookup(this._values.layer_configs,e);return s?{name:e,value:null!=(t=this._values.values[s.v])?t:{},rule_id:s.r,secondary_exposures:null!=(r=s.s)?r:[],is_user_in_experiment:!0===s.ue,group_name:null!=(n=s.gn)?n:void 0,is_experiment_active:!0===s.ea,group:s.r,is_device_based:"stableID"===s.i,allocated_experiment_name:null!=(i=s.ae)?i:"",explicit_parameters:null!=(a=s.ep)?a:[],undelegated_secondary_exposures:null!=(o=s.us)?o:[],parameter_rule_ids:s.pr}:null}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var r,i;return e&&null!=(i=null!=(r=e[t])?r:e[(0,n._DJB2)(t)])?i:null}}},855665,(e,t,r)=>{"use strict";
1Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(99535),i=e.r(94214),a=e.r(261817);r.default=class{constructor(e,t){this._sdkKey=e,this._options=t,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(e,t){var r,o;if(!e)return!1;let s=(0,n._typedJsonParse)(e.data,"has_updates","EvaluationResponse");return null!=s&&(this._source=e.source,(null==s?void 0:s.has_updates)!==!0||(null!=(r=s.time)?r:0)<this._lcut||(this._valuesForExternalUse=(0,n._typedJsonParse)(e.data,"has_updates","EvaluationResponse"),this._lcut=s.time,this._receivedAt=e.receivedAt,"init-v2"===s.response_format?this._values=new a.V2InitializeContainer(s):this._values=new i.V1InitializeContainer(s),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,s),e.source&&s.user&&this._setWarningState(t,s),n.SDKFlags.setFlags(this._sdkKey,null!=(o=s.sdk_flags)?o:{}),!0))}getWarnings(){if(0!==this._warnings.size)return Array.from(this._warnings)}getGate(e){let t=this._values?this._values.getGate(e):null;return this._getDetailedStoreResult(t)}getConfig(e){let t=this._values?this._values.getConfig(e):null;return this._getDetailedStoreResult(t)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(e){let t=this._values?this._values.getLayer(e):null;return this._getDetailedStoreResult(t)}getParamStore(e){let t=this._values?this._values.getParamStore(e):null;return this._getDetailedStoreResult(t)}getSource(){return this._source}getExposureMapping(){var e;return null==(e=this._values)?void 0:e.getExposureMapping()}_extractBootstrapMetadata(e,t){if("Bootstrap"!==e)return null;let r={};return t.user&&(r.user=t.user),t.sdkInfo&&(r.generatorSDKInfo=t.sdkInfo),r.lcut=t.time,r}_getDetailedStoreResult(e){return{result:e,details:this._getDetails(null==e)}}_setWarningState(e,t){var r,i,a;let o=n.StableID.get(this._sdkKey);if((null==(r=e.customIDs)?void 0:r.stableID)!==o&&((null==(i=e.customIDs)?void 0:i.stableID)||o))return void this._warnings.add("StableIDMismatch");if("user"in t){let r=t.user,i=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(null==(a=this._options)?void 0:a.disableStableID)&&(i=Object.assign(Object.assign({},i),{customIDs:Object.assign(Object.assign({},i.customIDs),{stableID:void 0})}),r=Object.assign(Object.assign({},r),{customIDs:Object.assign(Object.assign({},r.customIDs),{stableID:void 0})})),(0,n._getFullUserHash)(i)!==(0,n._getFullUserHash)(r)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if("Uninitialized"===this._source||"NoValues"===this._source)return{reason:this._source};let e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(e.warnings=Array.from(this._warnings)),e}_getDetails(e){var t,r;let n=this.getCurrentSourceDetails(),i=n.reason,a=null!=(t=n.warnings)?t:[];"Bootstrap"===this._source&&a.length>0&&(i+=a[0]),"Uninitialized"!==i&&"NoValues"!==i&&(i=`${i}:${e?"Unrecognized":"Recognized"}`);let o="Bootstrap"===this._source&&null!=(r=this._bootstrapMetadata)?r:void 0;return o&&(n.bootstrapMetadata=o),Object.assign(Object.assign({},n),{reason:i})}}},866642,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._resolveDeltasResponse=void 0;let n=e.r(99535);function i(e,t){null==e||e.forEach(e=>{delete t[e]})}r._resolveDeltasResponse=function(e,t){var r,a,o;let s=(0,n._typedJsonParse)(t,"checksum","DeltasEvaluationResponse");if(!s)return{hadBadDeltaChecksum:!0};let l=(i((o=(r=e,a=s,Object.assign(Object.assign(Object.assign({},r),a),{feature_gates:Object.assign(Object.assign({},r.feature_gates),a.feature_gates),layer_configs:Object.assign(Object.assign({},r.layer_configs),a.layer_configs),dynamic_configs:Object.assign(Object.assign({},r.dynamic_configs),a.dynamic_configs)}))).deleted_gates,o.feature_gates),delete o.deleted_gates,i(o.deleted_configs,o.dynamic_configs),delete o.deleted_configs,i(o.deleted_layers,o.layer_configs),delete o.deleted_layers,o),u=(0,n._DJB2Object)({feature_gates:l.feature_gates,dynamic_configs:l.dynamic_configs,layer_configs:l.layer_
1configs},2);return u!==s.checksumV2?{hadBadDeltaChecksum:!0,badChecksum:u,badMergedConfigs:l,badFullResponse:s.deltas_full_response}:JSON.stringify(l)}},450754,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(99535),a=e.r(866642);class o extends i.NetworkCore{constructor(e,t){super(e,t);const r=null==e?void 0:e.networkConfig;this._option=e,this._initializeUrlConfig=new i.UrlConfiguration(i.Endpoint._initialize,null==r?void 0:r.initializeUrl,null==r?void 0:r.api,null==r?void 0:r.initializeFallbackUrls)}fetchEvaluations(e,t,r,a,o){return n(this,void 0,void 0,function*(){var n,s,l,u,c,d;let h=t?(0,i._typedJsonParse)(t,"has_updates","InitializeResponse"):null,f={user:a,hash:null!=(l=null==(s=null==(n=this._option)?void 0:n.networkConfig)?void 0:s.initializeHashAlgorithm)?l:"djb2",deltasResponseRequested:!1,full_checksum:null};if(null==h?void 0:h.has_updates){let e=(null==h?void 0:h.hash_used)!==(null!=(d=null==(c=null==(u=this._option)?void 0:u.networkConfig)?void 0:c.initializeHashAlgorithm)?d:"djb2");f=Object.assign(Object.assign({},f),{sinceTime:o&&!e?h.time:0,previousDerivedFields:"derived_fields"in h&&o?h.derived_fields:{},deltasResponseRequested:!0,full_checksum:h.full_checksum,partialUserMatchSinceTime:e?0:h.time})}return this._fetchEvaluations(e,h,f,r)})}_fetchEvaluations(e,t,r,i){return n(this,void 0,void 0,function*(){var n,o;let s=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:r,retries:2,isStatsigEncodable:!0,priority:i});if((null==s?void 0:s.code)===204)return'{"has_updates": false}';if((null==s?void 0:s.code)!==200)return null!=(n=null==s?void 0:s.body)?n:null;if((null==t?void 0:t.has_updates)!==!0||(null==(o=s.body)?void 0:o.includes('"is_delta":true'))!==!0||!0!==r.deltasResponseRequested)return s.body;let l=(0,a._resolveDeltasResponse)(t,s.body);return"string"==typeof l?l:this._fetchEvaluations(e,t,Object.assign(Object.assign(Object.assign({},r),l),{deltasResponseRequested:!1}),i)})}}r.default=o},848615,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._makeParamStoreGetter=void 0;let n=e.r(99535),i={disableExposureLog:!0};function a(e){return null==e||!1===e.disableExposureLog}function o(e,t){return null!=t&&!(0,n._isTypeMatch)(e,t)}r._makeParamStoreGetter=function(e,t,r){return(s,l)=>{if(null==t)return l;let u=t[s];if(null==u||null!=l&&(0,n._typeOf)(l)!==u.param_type)return l;switch(u.ref_type){case"static":return u.value;case"gate":return e.getFeatureGate(u.gate_name,a(r)?void 0:i).value?u.pass_value:u.fail_value;case"dynamic_config":let c;return o(c=e.getDynamicConfig(u.config_name,a(r)?void 0:i).get(u.param_name),l)?l:c;case"experiment":let d;return o(d=e.getExperiment(u.experiment_name,a(r)?void 0:i).get(u.param_name),l)?l:d;case"layer":let h;return o(h=e.getLayer(u.layer_name,a(r)?void 0:i).get(u.param_name),l)?l:h;default:return l}}}},598671,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0}),r.StatsigEvaluationsDataAdapter=void 0;let i=e.r(99535),a=e.r(450754);class o extends i.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,t,r){super.attach(e,t,r),null!==r&&r instanceof a.default?this._network=r:this._network=new a.default(null!=t?t:{})}getDataAsync(e,t,r){return this._getDataAsyncImpl(e,(0,i._normalizeUser)(t,this._options),r)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){let t=(0,i._typedJsonParse)(e,"has_updates","data");t&&"user"in t?super.setData(e,t.user):i.Log.error("StatsigUser not found. You may be using an older server SDK ver
1sion. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(e,t,r,i){return n(this,void 0,void 0,function*(){var n;let a=yield null==(n=this._network)?void 0:n.fetchEvaluations(this._getSdkKey(),e,null==r?void 0:r.priority,t,i);return null!=a?a:null})}_getCacheKey(e){var t;let r=(0,i._getStorageKey)(this._getSdkKey(),e,null==(t=this._options)?void 0:t.customUserCacheKeyFunc);return`${i.DataAdapterCachePrefix}.${this._cacheSuffix}.${r}`}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,i._getFullUserHash)(t)}}r.StatsigEvaluationsDataAdapter=o},302084,(e,t,r)=>{"use strict";var n=e.e&&e.e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(r,"__esModule",{value:!0});let i=e.r(99535),a=e.r(855665),o=e.r(450754),s=e.r(848615),l=e.r(598671);class u extends i.StatsigClientBase{static instance(e){let t=(0,i._getStatsigGlobal)().instance(e);return t instanceof u?t:(i.Log.warn((0,i._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new u(null!=e?e:"",{}))}constructor(e,t,r=null){var n,s;i.SDKType._setClientType(e,"javascript-client");const u=new o.default(r,e=>{this.$emt(e)});for(const o of(super(e,null!=(n=null==r?void 0:r.dataAdapter)?n:new l.StatsigEvaluationsDataAdapter,u,r),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(i.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(i.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(i.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(i.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(i.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(i.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new a.default(e,null!=r?r:null),this._network=u,this._user=this._configureUser(t,r),this._sdkInstanceID=(0,i.getUUID)(),this._contextHandle=new i.PrecomputedEvaluationsContextHandle(e,()=>this._options,()=>this._errorBoundary,()=>this._store.getValues(),()=>this._user,()=>this._sdkInstanceID),null!=(s=null==r?void 0:r.plugins)?s:[]))o.bind(this)}initializeSync(e){var t;return"Uninitialized"!==this.loadingStatus?(0,i.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...null!=(t=this._store.getWarnings())?t:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return n(this,void 0,void 0,function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise})}updateUserSync(e,t){let r=performance.now();try{return this._updateUserSyncImpl(e,t,r)}catch(t){let e=t instanceof Error?t:Error(String(t));return this._createErrorUpdateDetails(e,r)}}_updateUserSyncImpl(e,t,r){var n;let a=[...null!=(n=this._store.getWarnings())?n:[]];this._resetForUser(e);let o=this.dataAdapter.getDataSync(this._user);null==o&&a.push("NoCachedValues"),this._store.setValues(o,this._user),this._finalizeUpdate(o);let s=null==t?void 0:t.disableBackgroundCacheRefresh;return!0===s||null==s&&(null==o?void 0:o.source)==="Bootstrap"||this._runPostUpdate(null!=o?o:null,this._user),(0,i.createUpdateDetails)(!0,this._store.getSource(),performance.now()-r,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),a)}updateUserAsync(e,t){return n(this,void 0,void 0,function*(){let r=performance.now();try{return yield this._updateUserAsyncImpl(e,t)}catch(t){let e=t instanceof Error?t:Error(String(t));return this._createErrorUpdateDetails(e,r)}})}_updateUserAsyncImpl(e,t){return n(this,void 0,void 0,function*(){this._resetForUser(e);let r=this._user;i.Diagnostics._markInitOverallStart(this._sdkKey);let n=this.dataAdapter.getDataSync(r);if(this._store.setValues(n,this._user),this._setStatus("Loading",n),n=yield this.dataAdapter.getDataAsync(n,r,t),r!==this._user)return(0,i.createUpdateDetails)(!1,this._store.getSource(),-1,Error("User changed during update"),this._network.getLastUsedInitUrlAndReset()
1);let a=!1;null!=n&&(i.Diagnostics._markInitProcessStart(this._sdkKey),a=this._store.setValues(n,this._user),i.Diagnostics._markInitProcessEnd(this._sdkKey,{success:a})),this._finalizeUpdate(n),a||(this._errorBoundary.attachErrorIfNoneExists(i.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),i.Diagnostics._markInitOverallEnd(this._sdkKey,a,this._store.getCurrentSourceDetails());let o=i.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,i.createUpdateDetails)(a,this._store.getSource(),o,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let e=(0,i._cloneObject)("StatsigUser",this._user);return null==e&&(i.Log.error("Failed to clone user"),e={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:e,errorBoundary:this._errorBoundary,session:i.StatsigSession.get(this._sdkKey),stableID:i.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}getContextHandle(){return this._contextHandle}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,r){let n="string"==typeof e?{eventName:e,value:t,metadata:r}:e;this.$emt({name:"log_event_called",event:n}),this._logger.enqueue(Object.assign(Object.assign({},n),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return n(this,void 0,void 0,function*(){return i.Storage.isReady()||(yield i.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,t){var r;return(0,i.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...null!=(r=this._store.getWarnings())?r:[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:"low"}).catch(e=>{i.Log.error("An error occurred after update.",e)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,t){var r,n,a;let o=(0,i._normalizeUser)(e,t),s=null==(r=o.customIDs)?void 0:r.stableID;if(s){let e=null==(a=(n=this.storageProvider).isReadyResolver)?void 0:a.call(n);e?e.then(()=>i.StableID.setOverride(s,this._sdkKey),()=>i.StableID.setOverride(s,this._sdkKey)):i.StableID.setOverride(s,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(o.analyticsOnlyMetadata=Object.assign(Object.assign({},o.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),o}_getFeatureGateImpl(e,t){var r,n;let{result:a,details:o}=this._store.getGate(e);this._checkUserHasIdForEvaluation(null==a?void 0:a.id_type,e,"Gate"),this._checkInitializationStatus(o.reason);let s=(0,i._makeFeatureGate)(e,o,a),l=null==(n=null==(r=this.overrideAdapter)?void 0:r.getGateOverride)?void 0:n.call(r,s,this._user,t),u=null!=l?l:s;return this._enqueueExposure(e,(0,i._createGateExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:u}),u}_getDynamicConfigImpl(e,t){var r,n;let{result:a,details:o}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(null==a?void 0:a.id_type,e,"Dynamic config"),this._checkInitializationStatus(o.reason);let s=(0,i._makeDynamicConfig)(e,o,a),l=null==(n=null==(r=this.overrideAdapter)?void 0:r.getDynamicConfigOverride)?void 0:n.call(r,s,this._user,t),u=null!=l?l:s;return this._enqueueExposure(e,(0,i._createConfigExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:u}),u}_getExperimentImpl(e,t){var r,n,a,o;let{result:s,details:l}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(null==s?void 0:s.id_type,e,"Experiment"),this._checkInitializationStatus(l.reason);let u=(0,i._makeExperiment)(e,l,s);null!=u.__evaluation&&(u.__evaluation.secondary_exposures=(0,i._mapExposures)(null!=(n=null==(r=u.__evaluation)?void 0:r.secondary_exposures)?n:[],this._store.getExposureMapping()));let c=null==(o=null==(a=this.overrideAdapter)?void 0:a.getExperimentOverride)?void 0:o.call(a,u,this._user,t),d=null!=c?c:u;return this._enqueueExposure(e,(0,i._createConfigExposure)(this._user,d,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:d}),d}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(e,t){var r,n,a;let{result:o,details:s}=this._store.getLayer(e),l=(0,i._makeLayer)(e,s,o),u=null==(n=null==(r=this.overrideAdapter)?void 0:r.getLayerOverride)?void 0:n.call(r,l,this._user,t);(null==t?void 0:t.disableExposureLog)&&this._logger.incrementNonExposureCount(e);let c=(0,i._mergeOverride)(l,u,null!=(a=null==u?void 0:u.__value)?a:l.__value,r=>{null!=t&&t.disableExposureLog||this._enqueueExposure(e,(0,i._createLayerParameterExposure)(this._user,c,r,this._store.getExposureMapping()),t)}
1);return this.$emt({name:"layer_evaluation",layer:c}),c}_getParameterStoreImpl(e,t){var r,n;let{result:i,details:a}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);let o={name:e,details:a,__configuration:i,get:(0,s._makeParamStoreGetter)(this,i,t)},l=null==(n=null==(r=this.overrideAdapter)?void 0:r.getParamStoreOverride)?void 0:n.call(r,o,t);return null!=l&&(o.__configuration=l.config,o.details=l.details,o.get=(0,s._makeParamStoreGetter)(this,l.config,t)),o}_checkUserHasIdForEvaluation(e,t,r){e&&((0,i._getUnitIDFromUser)(this._user,e)||i.Log.warn(`The user does not have the required id_type "${e}" for ${r} "${t}"`))}_checkInitializationStatus(e){("Uninitialized"===e||e.startsWith("Loading"))&&i.Log.warn(`SDK initialization has not completed. Reason: ${e}`)}}r.default=u},780484,(e,t,r)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.StatsigClient=void 0;let a=e.r(99535),o=e.r(302084);r.StatsigClient=o.default,i(e.r(99535),r),r.default=Object.assign((0,a._getStatsigGlobal)(),{StatsigClient:o.default})},665742,(e,t,r)=>{t.exports=function(){this.__data__=[],this.size=0}},25172,(e,t,r)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}},134314,(e,t,r)=>{var n=e.r(25172);t.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return -1}},419206,(e,t,r)=>{var n=e.r(134314),i=Array.prototype.splice;t.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},467763,(e,t,r)=>{var n=e.r(134314);t.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},523407,(e,t,r)=>{var n=e.r(134314);t.exports=function(e){return n(this.__data__,e)>-1}},553833,(e,t,r)=>{var n=e.r(134314);t.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},729039,(e,t,r)=>{var n=e.r(665742),i=e.r(419206),a=e.r(467763),o=e.r(523407),s=e.r(553833);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=o,l.prototype.set=s,t.exports=l},405400,(e,t,r)=>{var n=e.r(729039);t.exports=function(){this.__data__=new n,this.size=0}},986238,(e,t,r)=>{t.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},957831,(e,t,r)=>{t.exports=function(e){return this.__data__.get(e)}},977802,(e,t,r)=>{t.exports=function(e){return this.__data__.has(e)}},100236,(e,t,r)=>{t.exports=e.g&&e.g.Object===Object&&e.g},139088,(e,t,r)=>{var n=e.r(100236),i="object"==typeof self&&self&&self.Object===Object&&self;t.exports=n||i||Function("return this")()},630353,(e,t,r)=>{t.exports=e.r(139088).Symbol},243436,(e,t,r)=>{var n=e.r(630353),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n?n.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[s]=r:delete e[s]),i}},223243,(e,t,r)=>{var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}},377684,(e,t,r)=>{var n=e.r(630353),i=e.r(243436),a=e.r(223243),o=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},12447,(e,t,r)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},771223,(e,t,r)=>{var n=e.r(377684),i=e.r(12447);t.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},853789,(e,t,r)=>{t.exports=e.r(139088)["__core-js_shared__"]},269553,(e,t,r)=>{var n,i=e.r(853789),a=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(sr
1c)_1."+n:"";t.exports=function(e){return!!a&&a in e}},776366,(e,t,r)=>{var n=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},54368,(e,t,r)=>{var n=e.r(771223),i=e.r(269553),a=e.r(12447),o=e.r(776366),s=/^\[object .+?Constructor\]$/,l=Object.prototype,u=Function.prototype.toString,c=l.hasOwnProperty,d=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!a(e)||i(e))&&(n(e)?d:s).test(o(e))}},263958,(e,t,r)=>{t.exports=function(e,t){return null==e?void 0:e[t]}},841920,(e,t,r)=>{var n=e.r(54368),i=e.r(263958);t.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},687362,(e,t,r)=>{t.exports=e.r(841920)(e.r(139088),"Map")},932760,(e,t,r)=>{t.exports=e.r(841920)(Object,"create")},150514,(e,t,r)=>{var n=e.r(932760);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},197617,(e,t,r)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}},757412,(e,t,r)=>{var n=e.r(932760),i=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},221343,(e,t,r)=>{var n=e.r(932760),i=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},239004,(e,t,r)=>{var n=e.r(932760);t.exports=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},734421,(e,t,r)=>{var n=e.r(150514),i=e.r(197617),a=e.r(757412),o=e.r(221343),s=e.r(239004);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=o,l.prototype.set=s,t.exports=l},848994,(e,t,r)=>{var n=e.r(734421),i=e.r(729039),a=e.r(687362);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},224053,(e,t,r)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},487994,(e,t,r)=>{var n=e.r(224053);t.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},996768,(e,t,r)=>{var n=e.r(487994);t.exports=function(e){var t=n(this,e).delete(e);return this.size-=!!t,t}},929932,(e,t,r)=>{var n=e.r(487994);t.exports=function(e){return n(this,e).get(e)}},892647,(e,t,r)=>{var n=e.r(487994);t.exports=function(e){return n(this,e).has(e)}},446644,(e,t,r)=>{var n=e.r(487994);t.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=+(r.size!=i),this}},587547,(e,t,r)=>{var n=e.r(848994),i=e.r(996768),a=e.r(929932),o=e.r(892647),s=e.r(446644);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=o,l.prototype.set=s,t.exports=l},320517,(e,t,r)=>{var n=e.r(729039),i=e.r(687362),a=e.r(587547);t.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},901551,(e,t,r)=>{var n=e.r(729039),i=e.r(405400),a=e.r(986238),o=e.r(957831),s=e.r(977802),l=e.r(320517);function u(e){var t=this.__data__=new n(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=a,u.prototype.get=o,u.prototype.has=s,u.prototype.set=l,t.exports=u},212895,(e,t,r)=>{t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},524251,(e,t,r)=>{var n=e.r(841920);t.exports=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},674548,(e,t,r)=>{var n=e.r(524251);t.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},4300,(e,t,r)=>{var n=e.r(674548),i=e.r(25172),a=Object.prototype.hasOwnProperty;t.exports=function(e,t,r){var o=e[t];a.call(e,t)&&i(o,r)&&(void 0!==r||t in e)||n(e,t,r)}},372351,(e,t,r)=>{var n=e.r(4300),i=e.r(674548);t.exports=function(e,t,r,a){var o=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var u=t[s],c=a?a(r[u],e[u],u,r,e):void 0;void 0===c&&(c=e[u]),o?i(r,u,c):n(r,u,c)}return r}},855803,(e,t,r)=>{t.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},877289,(e,t,r)=>{t.exports=function(e){return null!=e&&"object"==typeof e}},566645,(e,t,r)=>{var n=e.r(377684),i=e.r(877289);t.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},473250,(e,t,r)=>{var n=e.r(566645),i=e.r(877289),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")}},45350,(e,t,r)=>{t.exports=Array.isArray},24013,(e,t,r)=>{t.exports=function(){return!1}},356956,(e,t,r)=>{var n=e.r(139088),i=e.r(24013),a=r&&!r.nodeType&&r,o=a&&t&&!t.nodeType&&t,s=o&&o.exports===a?n.Buffer:void 0;t.exports=(s?s.isBuffer:void 0)||i},66397,(e,t,r)=>{var n=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},98376,(e,t,r)=>{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},476602,(e,t,r)=>{var n=e.r(377684),i=e.r(98376),a=e.r(877289),o={};
1o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,t.exports=function(e){return a(e)&&i(e.length)&&!!o[n(e)]}},233999,(e,t,r)=>{t.exports=function(e){return function(t){return e(t)}}},180156,(e,t,r)=>{var n=e.r(100236),i=r&&!r.nodeType&&r,a=i&&t&&!t.nodeType&&t,o=a&&a.exports===i&&n.process;t.exports=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(e){}}()},3023,(e,t,r)=>{var n=e.r(476602),i=e.r(233999),a=e.r(180156),o=a&&a.isTypedArray;t.exports=o?i(o):n},458877,(e,t,r)=>{var n=e.r(855803),i=e.r(473250),a=e.r(45350),o=e.r(356956),s=e.r(66397),l=e.r(3023),u=Object.prototype.hasOwnProperty;t.exports=function(e,t){var r=a(e),c=!r&&i(e),d=!r&&!c&&o(e),h=!r&&!c&&!d&&l(e),f=r||c||d||h,p=f?n(e.length,String):[],_=p.length;for(var g in e)(t||u.call(e,g))&&!(f&&("length"==g||d&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,_)))&&p.push(g);return p}},763996,(e,t,r)=>{var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},825717,(e,t,r)=>{t.exports=function(e,t){return function(r){return e(t(r))}}},942369,(e,t,r)=>{t.exports=e.r(825717)(Object.keys,Object)},848477,(e,t,r)=>{var n=e.r(763996),i=e.r(942369),a=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},351095,(e,t,r)=>{var n=e.r(771223),i=e.r(98376);t.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},33679,(e,t,r)=>{var n=e.r(458877),i=e.r(848477),a=e.r(351095);t.exports=function(e){return a(e)?n(e):i(e)}},860196,(e,t,r)=>{var n=e.r(372351),i=e.r(33679);t.exports=function(e,t){return e&&n(t,i(t),e)}},513730,(e,t,r)=>{t.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},686222,(e,t,r)=>{var n=e.r(12447),i=e.r(763996),a=e.r(513730),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return a(e);var t=i(e),r=[];for(var s in e)"constructor"==s&&(t||!o.call(e,s))||r.push(s);return r}},689695,(e,t,r)=>{var n=e.r(458877),i=e.r(686222),a=e.r(351095);t.exports=function(e){return a(e)?n(e,!0):i(e)}},52624,(e,t,r)=>{var n=e.r(372351),i=e.r(689695);t.exports=function(e,t){return e&&n(t,i(t),e)}},622781,(e,t,r)=>{var n=e.r(139088),i=r&&!r.nodeType&&r,a=i&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;t.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},776736,(e,t,r)=>{t.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},536100,(e,t,r)=>{t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}},45159,(e,t,r)=>{t.exports=function(){return[]}},717332,(e,t,r)=>{var n=e.r(536100),i=e.r(45159),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols;t.exports=o?function(e){return null==e?[]:n(o(e=Object(e)),function(t){return a.call(e,t)})}:i},174071,(e,t,r)=>{var n=e.r(372351),i=e.r(717332);t.exports=function(e,t){return n(e,i(e),t)}},169102,(e,t,r)=>{t.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},962413,(e,t,r)=>{t.exports=e.r(825717)(Object.getPrototypeOf,Object)},233648,(e,t,r)=>{var n=e.r(169102),i=e.r(962413),a=e.r(717332),o=e.r(45159);t.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,a(e)),e=i(e);return t}:o},345001,(e,t,r)=>{var n=e.r(372351),i=e.r(233648);t.exports=function(e,t){return n(e,i(e),t)}},823403,(e,t,r)=>{var n=e.r(169102),i=e.r(45350);t.exports=function(e,t,r){var a=t(e);return i(e)?a:n(a,r(e))}},413370,(e,t,r)=>{var n=e.r(823403),i=e.r(717332),a=e.r(33679);t.exports=function(e){return n(e,a,i)}},807889,(e,t,r)=>{var n=e.r(823403),i=e.r(233648),a=e.r(689695);t.exports=function(e){return n(e,a,i)}},801419,(e,t,r)=>{t.exports=e.r(841920)(e.r(139088),"DataView")},717074,(e,t,r)=>{t.exports=e.r(841920)(e.r(139088),"Promise")},106966,(e,t,r)=>{t.exports=e.r(841920)(e.r(139088),"Set")},573895,(e,t,r)=>{t.exports=e.r(841920)(e.r(139088),"WeakMap")},367426,(e,t,r)=>{var n=e.r(801419),i=e.r(687362),a=e.r(717074),o=e.r(106966),s=e.r(573895),l=e.r(377684),u=e.r(776366),c="[object Map]",d="[object Promise]",h="[object Set]",f="[object WeakMap]",p="[object DataView]",_=u(n),g=u(i),v=u(a),m=u(o),y=u(s),b=l;
1(n&&b(new n(new ArrayBuffer(1)))!=p||i&&b(new i)!=c||a&&b(a.resolve())!=d||o&&b(new o)!=h||s&&b(new s)!=f)&&(b=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case _:return p;case g:return c;case v:return d;case m:return h;case y:return f}return t}),t.exports=b},153265,(e,t,r)=>{var n=Object.prototype.hasOwnProperty;t.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},263750,(e,t,r)=>{t.exports=e.r(139088).Uint8Array},425393,(e,t,r)=>{var n=e.r(263750);t.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},664146,(e,t,r)=>{var n=e.r(425393);t.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},984046,(e,t,r)=>{var n=/\w*$/;t.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},298430,(e,t,r)=>{var n=e.r(630353),i=n?n.prototype:void 0,a=i?i.valueOf:void 0;t.exports=function(e){return a?Object(a.call(e)):{}}},514712,(e,t,r)=>{var n=e.r(425393);t.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},749769,(e,t,r)=>{var n=e.r(425393),i=e.r(664146),a=e.r(984046),o=e.r(298430),s=e.r(514712);t.exports=function(e,t,r){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,r);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 s(e,r);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return a(e);case"[object Symbol]":return o(e)}}},646352,(e,t,r)=>{var n=e.r(12447),i=Object.create;t.exports=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}()},992433,(e,t,r)=>{var n=e.r(646352),i=e.r(962413),a=e.r(763996);t.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:n(i(e))}},181198,(e,t,r)=>{var n=e.r(367426),i=e.r(877289);t.exports=function(e){return i(e)&&"[object Map]"==n(e)}},954284,(e,t,r)=>{var n=e.r(181198),i=e.r(233999),a=e.r(180156),o=a&&a.isMap;t.exports=o?i(o):n},936206,(e,t,r)=>{var n=e.r(367426),i=e.r(877289);t.exports=function(e){return i(e)&&"[object Set]"==n(e)}},240158,(e,t,r)=>{var n=e.r(936206),i=e.r(233999),a=e.r(180156),o=a&&a.isSet;t.exports=o?i(o):n},64324,(e,t,r)=>{var n=e.r(901551),i=e.r(212895),a=e.r(4300),o=e.r(860196),s=e.r(52624),l=e.r(622781),u=e.r(776736),c=e.r(174071),d=e.r(345001),h=e.r(413370),f=e.r(807889),p=e.r(367426),_=e.r(153265),g=e.r(749769),v=e.r(992433),m=e.r(45350),y=e.r(356956),b=e.r(954284),E=e.r(12447),w=e.r(240158),S=e.r(33679),A=e.r(689695),x="[object Arguments]",I="[object Function]",k="[object Object]",C={};C[x]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[k]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[I]=C["[object WeakMap]"]=!1,t.exports=function e(t,r,T,O,D,P){var j,R=1&r,N=2&r,L=4&r;if(T&&(j=D?T(t,O,D,P):T(t)),void 0!==j)return j;if(!E(t))return t;var M=m(t);if(M){if(j=_(t),!R)return u(t,j)}else{var U=p(t),F=U==I||"[object GeneratorFunction]"==U;if(y(t))return l(t,R);if(U==k||U==x||F&&!D){if(j=N||F?{}:v(t),!R)return N?d(t,s(j,t)):c(t,o(j,t))}else{if(!C[U])return D?t:{};j=g(t,U,R)}}P||(P=new n);var B=P.get(t);if(B)return B;P.set(t,j),w(t)?t.forEach(function(n){j.add(e(n,r,T,n,t,P))}):b(t)&&t.forEach(function(n,i){j.set(i,e(n,r,T,i,t,P))});var K=L?N?f:h:N?A:S,z=M?void 0:K(t);return i(z||t,function(n,i){z&&(n=t[i=n]),a(j,i,e(n,r,T,i,t,P))}),j}},271944,(e,t,r)=>{var n=e.r(64324);t.exports=function(e){return n(e,5)}},221274,(e,t,r)=>{t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},439805,(e,t,r)=>{t.exports=function(e){return this.__data__.has(e)}},27493,(e,t,r)=>{var n=e.r(587547),i=e.r(221274),a=e.r(439805);function o(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}o.prototype.add=o.prototype.push=i,o.prototype.has=a,t.exports=o},851477,(e,t,r)=>{t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},315262,(e,t,r)=>{t.exports=function(e,t){return e.has(t)}},206856,(e,t,r)=>{var n=e.r(27493),i=e.r(851477),a=e.r(315262);t.exports=function(e,t,r,o,s,l){var u=1&r,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),f=l.get(t);if(h&&f)return h==t&&f==e;var p=-1,_=!0,g=2&r?new n:void 0;for(l.set(e,t),l.set(t,e);++p<c;){var v=e[p],m=t[p];if(o)var y=u?o(m,v,p,t,e,l):o(v,m,p,e,t,l);if(void 0!==y){if(y)continue;_=!1;break}if(g){if(!i(t,function(e,t){if(!a(g,t)&&(v===e||s(v,e,r,o,l)))return g.push(t)})){_=!1;break}}else if(!(v===m||s(v,m,r,o,l))){_=!1;break}}return l.delete(e),l.delete(t),_}},75331,(e,t,r)=>{t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},899850,(e,t,r)=>{t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}},678012,(e,t,r)=>{var n=e.r(630353),i=e.r(263750),a=e.r(25172),o=e.r(206856),s=e.r(75331),l=e.r(899850),u=n?n.prototype:void 0,c=u?u.valueOf:void 0;t.exports=function(e,t,r,n,u,d,h){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new i(e),new i(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+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 f=s;case"[object Set]":var p=1&n;if(f||(f=l),e.size!=t.size&&!p)break;var _=h.get(e);if(_)return _==t;n|=2,h.set(e,t);var g=o(f(e),f(t),n,u,d,h);return h.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},330698,(e,t,r)=>{var n=e.r(413370),i=Object.prototype.hasOwnProperty;t.exports=function(e,t,r,a,o,s){var l=1&r,u=n(e),c=u.length;if(c!=n(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var _=!0;s.set(e,t),s.set(t,e);for(var g=l;++d<c;){var v=e[h=u[d]],m=t[h];if(a)var y=l?a(m,v,h,t,e,s):a(v,m,h,e,t,s);if(!(void 0===y?v===m||o(v,m,r,a,s):y)){_=!1;break}
1g||(g="constructor"==h)}if(_&&!g){var b=e.constructor,E=t.constructor;b!=E&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof E&&E instanceof E)&&(_=!1)}return s.delete(e),s.delete(t),_}},178353,(e,t,r)=>{var n=e.r(901551),i=e.r(206856),a=e.r(678012),o=e.r(330698),s=e.r(367426),l=e.r(45350),u=e.r(356956),c=e.r(3023),d="[object Arguments]",h="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(e,t,r,_,g,v){var m=l(e),y=l(t),b=m?h:s(e),E=y?h:s(t);b=b==d?f:b,E=E==d?f:E;var w=b==f,S=E==f,A=b==E;if(A&&u(e)){if(!u(t))return!1;m=!0,w=!1}if(A&&!w)return v||(v=new n),m||c(e)?i(e,t,r,_,g,v):a(e,t,b,r,_,g,v);if(!(1&r)){var x=w&&p.call(e,"__wrapped__"),I=S&&p.call(t,"__wrapped__");if(x||I){var k=x?e.value():e,C=I?t.value():t;return v||(v=new n),g(k,C,r,_,v)}}return!!A&&(v||(v=new n),o(e,t,r,_,g,v))}},14943,(e,t,r)=>{var n=e.r(178353),i=e.r(877289);t.exports=function e(t,r,a,o,s){return t===r||(null!=t&&null!=r&&(i(t)||i(r))?n(t,r,a,o,e,s):t!=t&&r!=r)}},898892,(e,t,r)=>{var n=e.r(14943);t.exports=function(e,t){return n(e,t)}},946217,(e,t,r)=>{var n=e.r(848477),i=e.r(367426),a=e.r(473250),o=e.r(45350),s=e.r(351095),l=e.r(356956),u=e.r(763996),c=e.r(3023),d=Object.prototype.hasOwnProperty;t.exports=function(e){if(null==e)return!0;if(s(e)&&(o(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||a(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!n(e).length;for(var r in e)if(d.call(e,r))return!1;return!0}},808341,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={cancelIdleCallback:function(){return o},requestIdleCallback:function(){return a}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a="u">typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},o="u">typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},519083,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ESCAPE_REGEX:function(){return o},htmlEscapeAttributeString:function(){return c},htmlEscapeJsonString:function(){return u}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},o=/[&><\u2028\u2029]/g,s={"&":"&amp;",'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;"},l=/[&"'<>]/g;function u(e){return e.replace(o,e=>a[e])}function c(e){return e.replace(l,e=>s[e])}},479520,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},handleClientScriptLoad:function(){return v},initScriptLoader:function(){return m}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let a=e.r(555682),o=e.r(190809),s=e.r(843476),l=a._(e.r(174080)),u=o._(e.r(271645)),c=e.r(742732),d=e.r(922737),h=e.r(808341),f=e.r(519083),p=new Map,_=new Set,g=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:i=null,dangerouslySetInnerHTML:a,children:o="",strategy:s="afterInteractive",onError:u,stylesheets:c}=e,h=r||t;if(h&&_.has(h))return;if(p.has(t)){_.add(h),p.get(t).then(n,u);return}let f=()=>{i&&i(),_.add(h)},g=document.createElement("script"),v=new Promise((e,t)=>{g.addEventListener("load",function(t){e(),n&&n.call(this,t),f()}),g.addEventListener("error",function(e){t(e)})}).catch(function(e){u&&u(e)});a?(g.innerHTML=a.__html||"",f()):o?(g.textContent="string"==typeof o?o:Array.isArray(o)?o.join(""):"",f()):t&&(g.src=t,p.set(t,v)),(0,d.setAttributesFromProps)(g,e),"worker"===s&&g.setAttribute("type","text/partytown"),g.setAttribute("data-nscript",s),c&&(e=>{if(l.default.preinit)return e.forEach(e=>{l.default.preinit(e,{as:"style"})});if("u">typeof window){let t=document.head;
1e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}})(c),document.body.appendChild(g)};function v(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,h.requestIdleCallback)(()=>g(e))}):g(e)}function m(e){e.forEach(v),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");_.add(t)})}function y(e){let{id:t,src:r="",onLoad:n=()=>{},onReady:i=null,strategy:a="afterInteractive",onError:o,stylesheets:d,...p}=e,{updateScripts:v,scripts:m,getIsSsr:y,appDir:b,nonce:E}=(0,u.useContext)(c.HeadManagerContext);E=p.nonce||E;let w=(0,u.useRef)(!1);(0,u.useEffect)(()=>{let e=t||r;w.current||(i&&e&&_.has(e)&&i(),w.current=!0)},[i,t,r]);let S=(0,u.useRef)(!1);if((0,u.useEffect)(()=>{if(!S.current){if("afterInteractive"===a)g(e);else"lazyOnload"===a&&("complete"===document.readyState?(0,h.requestIdleCallback)(()=>g(e)):window.addEventListener("load",()=>{(0,h.requestIdleCallback)(()=>g(e))}));S.current=!0}},[e,a]),("beforeInteractive"===a||"worker"===a)&&(v?(m[a]=(m[a]||[]).concat([{id:t,src:r,onLoad:n,onReady:i,onError:o,...p,nonce:E}]),v(m)):y&&y()?_.add(t||r):y&&!y()&&g({...e,nonce:E})),b){if(d&&d.forEach(e=>{l.default.preinit(e,{as:"style"})}),"beforeInteractive"===a)if(!r)return p.dangerouslySetInnerHTML&&(p.children=p.dangerouslySetInnerHTML.__html,delete p.dangerouslySetInnerHTML),(0,s.jsx)("script",{nonce:E,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,f.htmlEscapeJsonString)(JSON.stringify([0,{...p,id:t}]))})`}});else return l.default.preload(r,p.integrity?{as:"script",integrity:p.integrity,nonce:E,crossOrigin:p.crossOrigin}:{as:"script",nonce:E,crossOrigin:p.crossOrigin}),(0,s.jsx)("script",{nonce:E,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${(0,f.htmlEscapeJsonString)(JSON.stringify([r,{...p,id:t}]))})`}});"afterInteractive"===a&&r&&l.default.preload(r,p.integrity?{as:"script",integrity:p.integrity,nonce:E,crossOrigin:p.crossOrigin}:{as:"script",nonce:E,crossOrigin:p.crossOrigin})}return null}Object.defineProperty(y,"__nextScript",{value:!0});let b=y;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},3303,(e,t,r)=>{t.exports=e.r(479520)},987736,e=>{"use strict";var t,r,n,i,a,o,s,l,u,c,d,h,f,p,_,g,v,m,y,b,E=e.i(247167),w=e.i(843476),S=e.i(618566),A=e.i(3303),x=e.i(271645),I=e.i(672464),k=e.i(146407);let C="__exp_override__",T="expUser",O="exp.",D="true"===E.default.env.NEXT_PUBLIC_ENABLE_EXPERIMENT_OVERRIDE;var P=e.i(309680);let j=/^[a-zA-Z0-9_-]+$/,R=/^[a-zA-Z0-9_-]+$/;function N(e){return e.length>0&&e.length<=64&&j.test(e)}function L(e){return e.length>0&&e.length<=128&&R.test(e)}function M(){let e=window.location.hostname;if("localhost"===e||/^\d+\.\d+\.\d+\.\d+$/.test(e))return;let t=e.split(".");if(!(t.length<2))return"."+t.slice(-2).join(".")}function U(){let e=(0,P.getCookie)({name:C});if(!e||"object"!=typeof e)return{};let t={};return Object.entries(e).forEach(e=>{let[r,n]=e;"string"==typeof n&&L(r)&&N(n)&&(t[r]=n)}),t}function F(){(0,P.delCookie)(C,{path:"/",domain:M()})}var B=e.i(70397),K=e.i(639682);let z=()=>{let e,{data:t}=(0,I.useAtomValue)(k.viewerModel.viewerStatusAtom),[r,n]=(0,x.useState)(!1),i=(0,I.useSetAtom)(K.setExperimentReadyAtom);return e=(0,S.useSearchParams)(),(0,x.useEffect)(()=>{let t,r;if(!D||"u"<typeof document||!e)return;let{set:n,cleared:i}=(t={},r=new Set,e.forEach((e,n)=>{if(!n.startsWith(O))return;let i=n.slice(O.length).trim();if(L(i)){if("__clear__"===e)return void r.add(i);N(e)&&(t[i]=e)}}),e.get(T),{set:t,cleared:r});if(0===Object.keys(n).length&&0===i.size)return;let a={...U(),...n};(i.forEach(e=>{delete a[e]}),0===Object.keys(a).length)?F():(0,P.setCookie)(C,a,{path:"/",maxAge:1209600,sameSite:"lax",domain:M()})},[e]),(0,x.useEffect)(()=>
1{if(!r)try{(0,B.initializeExperiment)("35f709a1fbb57bb9ef50b70f6bf536f9"),n(!0)}catch(e){}},[r]),(0,x.useEffect)(()=>{if(!r)return;let e=t?.userUuid?{name:t?.name,email:t?.email,phone:t?.phone,gender:t?.gender,guessedAge:t?.guessedAge}:void 0,n=function(e){var t,r;let n,i,{experimentKey:a,realUserId:o,realDeviceId:s,realUserProperties:l}=e,u={user_id:o,device_id:s,user_properties:l};if(!D)return u;let c=U(),d=Object.entries(c);if(0===d.length)return u;if(a){let e=c[a];if(!e)return u;n=a,i=e}else{let[e,t]=d[0];n=e,i=t,d.length}return{user_id:(t=n,r=i,`dev-exp-${t}-${r.replace(/([A-Z])/g,"-$1").toLowerCase()}`),device_id:`dev-device-${n}-${i}`,user_properties:{...l,__dev_experiment_override__:!0,__dev_experiment_override_key__:n,__dev_experiment_override_variant__:i},__isOverridden:!0}}({realUserId:t?.userUuid,realUserProperties:e}),a=!0===n.__isOverridden,o=a?{user_id:n.user_id,device_id:n.device_id,user_properties:n.user_properties}:t?.userUuid?{user_id:t.userUuid,user_properties:e}:void 0;(0,B.fetchExperiments)(o).then(()=>{a||t?.userUuid,i()}).catch(e=>{i()})},[r,t,i]),null};var W=e.i(748815),V=e.i(422233),G=e.i(224541),q=e.i(186085),$=e.i(938605);let H=(e,t)=>{Object.entries({$phone_number:t?.phone,$email:t?.email,name:t?.name,guessedAge:t?.guessedAge,gender:t?.gender,acceptMsgYn:t?.acceptMsgYn,kakaoPlusRelationYn:t?.kakaoPlusRelationYn}).forEach(t=>{let[r,n]=t;null!=n&&e.set(r,n)});let r=(0,G.isApp)();e.set("user_agent",navigator.userAgent),e.setOnce(r?"useApp":"useWeb",!0),e.set("platform",r?"App":"Web")},J=()=>{let{data:e}=(0,I.useAtomValue)(k.viewerModel.viewerStatusAtom),{postMessage:t}=(0,q.useRNBridge)();return(0,x.useEffect)(()=>{if(!$.ampli.isLoaded){let e,r,n=(r=(e=(0,P.getCookie)({name:"amp-deviceId"}))||(0,V.v4)(),e||(0,P.setCookie)("amp-deviceId",r,{path:"/",maxAge:31536e3,domain:".rentre.kr"}),r);(e=>{let{deviceId:t}=e;$.ampli.load({client:{apiKey:"35f709a1fbb57bb9ef50b70f6bf536f9",configuration:{deviceId:t,defaultTracking:{attribution:{excludeReferrers:[/(\.|^)rentre\.kr$/,"kauth.kakao.com","accounts.kakao.com","nid.naver.com","logins.daum.net","appleid.apple.com"]},pageViews:!0,sessions:!0,fileDownloads:!1,formInteractions:!1},trackingOptions:{platform:!0}}}})})({deviceId:n});let i=new W.Identify;H(i,void 0),$.ampli.client?.identify(i),t("AMPLITUDE_DEVICEID",n)}},[t]),(0,x.useEffect)(()=>{if(e?.userUuid&&$.ampli.isLoaded){$.ampli.client?.setUserId(e.userUuid);let t=new W.Identify;H(t,e),$.ampli.client?.identify(t)}},[e]),null};var Q=e.i(51812),X=e.i(919205);let Y=["/landing/tps/internet","/affiliate/homecheck/","/affiliate/daiclo/"];function Z(){let e,t,r=(0,S.usePathname)(),n=(0,I.useSetAtom)(Q.chatReferrerAtom),i=Y.some(e=>r.includes(e))||(e=r.startsWith("/product-review/")&&!r.includes("/submit/"),t=r.startsWith("/seller-review/")&&!r.includes("/submit/"),e||t);return(0,x.useEffect)(()=>{if(i){let e=function(e){if(e.includes("/landing/tps/internet"))return"광고-랜딩-바로상담-테스트";if(e.includes("/affiliate/homecheck/"))return"홈체크";if(e.includes("/affiliate/daiclo/"))return"다이클로";let t=e.split("/");return t.length>3?decodeURI(t[3]):""}(r);n({referrerUrl:`${X.SITE_URL}${r}`,referrerTitle:e})}},[r,i,n]),null}var ee=e.i(68817);function et(){let{data:e}=(0,I.useAtomValue)(k.viewerModel.viewerStatusAtom);return ee.default.initialize("G-L70RM99LZM",{gtagUrl:"https://www.googletagmanager.com/gtag/js?id=G-L70RM99LZM"}),(0,x.useEffect)(()=>{e?.userUuid&&ee.default.set({userId:e.userUuid,email:e.email,first_name:e.name,phone_number:e.phone})},[e]),(0,w.jsx)(w.Fragment,{})}function er(){let e=(0,S.usePathname)();return(0,x.useEffect)(()=>{if(!e)return;let t=!1,r=null,n=()=>{let n=document.querySelector("iframe#--notifly-web-message-iframe");n&&n.src.includes("cdn.notifly.tech")&&!t&&(t=!0,$.ampli.viewedNotiflyPopup({type:n.src,path:e}),r&&(r.disconnect(),r=null))};return n(),(r=new MutationObserver(()=>{n()})).observe(document.body,{childList:!0,subtree:!0}),()=>{r&&(r.disconnect(),r=null)}},[e]),null}var en=e.i(464904);function ei(e){let{}=e;return(0,x.useEffect)(()=>{(0,en.updateABTests)("/groups.json")},[]),null}var ea=e.i(912598),eo=e.i(171372),es=e.i(800378),el=e.i(196523),eu=e.i(263456),ec=e.i(471215),ed=e.i(585179),eh=e.i(902365);function ef(e){let{}=e,t=(0,S.usePathname)(),r=(0,ea.useQueryClient)(),n=async()=>
1{let e=(0,el.getMarketingAgreeModalFlag)(),n=await ec.viewerService.getViewerStatus(),i=await (0,ed.getClientSession)(),a=(0,eo.match)("/product/:prodOptionUsid(\\d+)/:prodName*")(t);if(a){let{prodOptionUsid:e}=a.params,t=r.getQueryData(eu.productQueryKeys.productDetail({prodOptionUsid:+e}).queryKey);if(t?.prodCatg==="INTERNET")return void(0,eh.releaseModalGate)()}let o=["/signup/success(.*)","/proposal/request(.*)","/product/tps/detail(.*)","/tps(.*)","/login(.*)","/login-success(.*)","/event(.*)","/error(.*)"].some(e=>(0,eo.match)(e)(t));i&&!n.acceptMsgYn&&!o&&e&&await (0,es.openMarketingAgreeModal)({}),(0,eh.releaseModalGate)()};return(0,x.useEffect)(()=>{(0,el.getMarketingAgreeModalFlag)()&&(0,eh.holdModalGate)(),n()},[t]),(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(es.MarketingAgreeModalMountPoint,{})})}let ep={init(e){!function(e){try{var t,r,n,i,a;t=window,r=document,n="clarity",r.getElementById("clarity-script")||(t[n]=t[n]||function(){(t[n].q=t[n].q||[]).push(arguments)},(i=r.createElement("script")).async=1,i.src="https://www.clarity.ms/tag/"+e+"?ref=npm",i.id="clarity-script",(a=r.getElementsByTagName("script")[0]).parentNode.insertBefore(i,a))}catch(e){return}}(e)},setTag(e,t){window.clarity("set",e,t)},identify(e,t,r,n){window.clarity("identify",e,t,r,n)},consent(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];window.clarity("consent",e)},consentV2(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ad_Storage:"granted",analytics_Storage:"granted"};window.clarity("consentv2",e)},upgrade(e){window.clarity("upgrade",e)},event(e){window.clarity("event",e)}},e_=["/landing"],eg=["/tps","/internet"],ev="clarity_should_record";function em(){let e,t=(0,S.usePathname)(),{data:r}=(0,I.useAtomValue)(k.viewerModel.viewerStatusAtom),n=(0,x.useRef)(!1);return e="sy8pf96zok",(0,x.useEffect)(()=>{e&&!n.current&&function(e){let t=e_.some(t=>e.startsWith(t))?1:eg.some(t=>e.startsWith(t))?.1:.01,r=null;try{r=sessionStorage.getItem(ev)}catch{}if("1"===r)return!0;if("0"===r&&t<1)return!1;let n=Math.random()<t;try{sessionStorage.setItem(ev,n?"1":"0")}catch{}return n}(t)&&(ep.init(e),n.current=!0)},[e]),(0,x.useEffect)(()=>{r?.userUuid&&n.current&&(ep.identify(r.userUuid,void 0,void 0,void 0),ep.setTag("user_id",r.userUuid))},[r]),(0,w.jsx)(w.Fragment,{})}var ey=e.i(165704),eb=e.i(663110);let eE=function(e){let t;if(!(0,eb.default)(e))throw TypeError("Invalid UUID");let r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/0x10000000000&255,r[11]=t/0x100000000&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function ew(e,t){return e<<t|e>>>32-t}let eS=function(e){function t(t,r,n,i){var a;if("string"==typeof t&&(t=function(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(t)),"string"==typeof r&&(r=eE(r)),(null==(a=r)?void 0:a.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let o=new Uint8Array(16+t.length);if(o.set(r),o.set(t,r.length),(o=e(o))[6]=15&o[6]|80,o[8]=63&o[8]|128,n){i=i||0;for(let e=0;e<16;++e)n[i+e]=o[e];return n}return(0,ey.unsafeStringify)(o)}try{t.name="v5"}catch(e){}return t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t}(function(e){let t=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof e){let t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=Math.ceil((e.length/4+2)/16),i=Array(n);for(let t=0;t<n;++t){let r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];i[t]=r}i[n-1][14]=(e.length-1)*8/0x100000000,i[n-1][14]=Math.floor(i[n-1][14]),i[n-1][15]=(e.length-1)*8|0;for(let e=0;e<n;++e){let n=new Uint32Array(80);for(let t=0;t<16;++t)n[t]=i[e][t];for(let e=16;e<80;++e)n[e]=ew(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let a=r[0],o=r[1],s=r[2],l=r[3],u=r[4];for(let e=0;e<80;++e){let r=Math.floor(e/20),i=ew(a,5)+function(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}(r,o,s,l)+u+t[r]+n[e]>>>0;u=l,l=s,s=ew(o,30)>>>0,o=a,a=i}r[0]=r[0]+a>>>0,r[1]=r[1]+o>>>0,r[2]=r[2]+s>>>0,r[3]=r[3]+l>>>0,r[4]=r[4]+u>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]});(t=d||(d={})).EVENTID="830b5f7b-e392-43db-a17b-d835f0bcab2b",t.REGISTERED_USERID="ce7c62f9-e8ae-4009-8fd6-468e9581fa21",t.UNREGISTERED_USERID="a6446dcf-c0
157-4de7-a360-56af8659d52f",t.DEVICEID="830848b3-2444-467d-9cd8-3430d2738c57",(r=h||(h={})).PHONE_NUMBER="$phone_number",r.EMAIL="$email",r.TIMEZONE="$timezone";var eA=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}};function ex(e,t,r){return t?eS("".concat(e).concat(t),d.REGISTERED_USERID).replace(/-/g,""):eS("".concat(e).concat(r),d.UNREGISTERED_USERID).replace(/-/g,"")}function eI(){if("u"<typeof navigator)return console.warn("[Notifly] Not running in a client-side environment. Cannot determine platform."),"unknown";var e=navigator.userAgent;return/iPad|iPhone|iPod/.test(e)?"ios":/Android/.test(e)?"android":"web"}(n=f||(f={}))[n.NOT_INITIALIZED=0]="NOT_INITIALIZED",n[n.READY=1]="READY",n[n.REFRESHING=2]="REFRESHING",n[n.FAILED=3]="FAILED",n[n.TERMINATED=4]="TERMINATED",(i=p||(p={})).JS="js",i.JS_CAFE24="js-cafe24",i.JS_FLUTTER="js-flutter";var ek=function(){function e(){}return e.registerObserver=function(e){this._observers.push(e)},Object.defineProperty(e,"state",{get:function(){return this._state},set:function(e){if(this._state!==e){var t=this._state;if(this._state=e,e===f.TERMINATED)return void this._observers.forEach(function(e){var t;return null==(t=e.onTerminated)?void 0:t.call(e)});switch([t,e].join(",")){case[f.NOT_INITIALIZED,f.READY].join(","):this._observers.forEach(function(e){var t;return null==(t=e.onInitialized)?void 0:t.call(e)});break;case[f.READY,f.REFRESHING].join(","):this._observers.forEach(function(e){var t;return null==(t=e.onRefreshStarted)?void 0:t.call(e)});break;case[f.REFRESHING,f.READY].join(","):this._observers.forEach(function(e){var t;return null==(t=e.onRefreshCompleted)?void 0:t.call(e)})}}},enumerable:!1,configurable:!0}),Object.defineProperty(e,"halted",{get:function(){return this._state===f.FAILED||this._state===f.TERMINATED},enumerable:!1,configurable:!0}),e.setSdkType=function(e){this.type=e},e.setSdkVersion=function(e){this.version=e},e.getSdkVersion=function(){return this.version},e.setSource=function(e){this.source=e},Object.defineProperty(e,"allowUserSuppliedLogEvent",{get:function(){return this._allowUserSuppliedLogEvent},enumerable:!1,configurable:!0}),e.setAllowUserSuppliedLogEvent=function(e){this._allowUserSuppliedLogEvent=null!=e&&e},e._state=f.NOT_INITIALIZED,e._observers=[],e.type=p.JS,e.version="2.18.0",e.source=null,e._allowUserSuppliedLogEvent=!1,e}(),eC=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},eT=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},eO=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},eD=function(){function e(e,t){this._db=null,this._activeTransactions=[],this._dbName=e,this._storeName=t,ek.registerObserver(this)}return e.prototype.onTerminated=function(){this._onWindowUnload.call(this)},e.prototype.ready=function(){return eC(this,void 0,void 0,function(){return eT(this,function(e){switch(e.label){case 0:return[4,this._open()];case 1:return e.sent(),[2]}})})},e.prototype.getItem=function(e){return eC(this,void 0,void 0,function(){var t=this;return eT(this,function(r){switch(r.label){case 0:return[4,this.ready()];case 1:return r.sent(),[2,new Promise(function(r,n){var i=t._getTransaction("readonly");t._activeTransactions.push(i);var a=i.objectStore(t._storeName).get(e);i.oncomplete=function(){t._removeTransaction(i)},i.onerror=function(){t._removeTransaction(i)},i.onabort=function(){n("Transaction aborted"),t._removeTransaction(i)},a.onsuccess=function(){r(a.result)},a.onerror=function(e){n(e.target.error)}})]}})})},e.prototype.setItem=function(e,t){return eC(this,void 0,void 0,function(){var r=this;return eT(this,function(n){switch(n.label){case 0:return[4,this.ready()];case 1:return n.sent(),[2,new Promise(function(n,i){var a=r._getTransaction("readwrite");a.objectStore(r._storeName).put(t,e),r._activeTransactions.push(a),a.oncomplete=function(){r._removeTransaction(a),n()},a.onerror=function(e){r._removeTransaction(a),i(e.target.error)},a.onabort=function(){i("Transaction aborted"),r._removeTransaction(a)}})]}})})},e.prototype.setItems=function(e){return eC(this,void 0,void 0,function(){var t=this;return eT(this,function(r){switch(r.label){case 0:return[4,this.ready()];case 1:return r.sent(),[2,new Promise(function(r,n){var i=t._getTransaction("readwrite"),a=i.objectStore(t._storeName);e.forEach(function(e){var t=eO(e,2),r=t[0],n=t[1];a.put(n,r)}),t._activeTransactions.push(i),i.oncomplete=function(){t._removeTransaction(i),r()},i.onerror=function(e){t._removeTransaction(i),n(e.target.error)},i.onabort=function(){n("Transaction aborted"),t._removeTransaction(i)}})]}})})},e.prototype.removeItem=function(e){return eC(this,void 0,void 0,function(){var t=this;return eT(this,function(r){switch(r.label){case 0:return[4,this.ready()];case 1:return r.sent(),[2,new Promise(function(r,n){var i=t._getTransaction("readwrite");i.objectStore(t._storeName).delete(e),t._activeTransactions.push(i),i.oncomplete=function(){t._removeTransaction(i),r()},i.onerror=function(e){t._removeTransaction(i),n(e.target.error)},i.onabort=function(){n("Transaction aborted"),t._removeTransaction(i)}})]}})})},e.prototype.removeItems=function(e){return eC(this,void 0,void 0,function(){var t=this;return eT(this,function(r){switch(r.label){case 0:return[4,this.ready()];case 1:return r.sent(),[2,new Promise(function(r,n){var i=t._getTransaction("readwrite"),a=i.objectStore(t._storeName);e.forEach(function(e){a.delete(e)}),t._activeTransactions.push(i),i.oncomplete=function(){r()},i.onerror=function(e){n(e.target.error)},i.onabort=function(){n("Transaction aborted"),t._removeTransaction(i)}})]}})})},e.prototype._open=function(){return eC(this,void 0,void 0,function(){var e=this;return eT(this,function(t){return this._db?[2,this._db]:[2,new Promise(function(t,r){var n=indexedDB.open(e._dbName);n.onerror=function(e){r(e.target.error)},n.onsuccess=function(r){e._db=r.target.result,t(e._db)},n.onupgradeneeded=function(t){e._db=t.target.result,e._db.onversionchange=function(){var t;null==(t=e._db)||t.close(),console.warn("[NotiflyIndexedDBStore] Database version changed. Closing the connection.")},e._db.objectStoreNames.contains(e._storeName)||e._db.createObjectStore(e._storeName)}})]})})},e.prototype._abortActiveTransactions=function(){this._activeTransactions.forEach(function(e){try{e.abort()}catch(e){}})},e.prototype._getTransaction=function(e){try{return this._db.transaction([this._storeName],e)}catch(e){throw Error("[Notifly] Transaction interrupted unexpectedly. This is mostly due to the database being closed by the sudden browser shutdown.")}},e.prototype._removeTransaction=function(e){var t=this._activeTransactions.indexOf(e);t>=0&&this._activeTransactions.splice(t,1)},e.prototype._onWindowUnload=function(){if(this._db)try{this._abortActiveTransactions(),this._db.close()}catch(e){}},e}(),eP=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},ej=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},eR=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o};(a=_||(_={})).PROJECT_ID="__notiflyProjectID",a.USERNAME="__notiflyUserName",a.PASSWORD="__notiflyPassword",a.COGNITO_ID_TOKEN="__notiflyCognitoIDToken",a.EXTERNAL_USER_ID="__notiflyExternalUserID",a.NOTIFLY_DEVICE_ID="__notiflyDeviceID",a.NOTIFLY_STATE="__notiflyState",a.LAST_SESSION_TIME="__notiflyLastSessionTime",a.NOTIFLY_NOTIFICATION_PERMISSION="__notiflyNotificationPermission",a.SW_VERSION="__notiflySWVersion";var eN=function(){function e(){}return e.ensureInitialized=function(){return eP(this,void 0,void 0,function(){return ej(this,function(e){return this.storage||(this.storage=new eD("notifly","notiflyconfig")),[2,this._withTimeout(this.storage.ready())]})})},e.getNotiflyUserId=function(){return eP(this,void 0,void 0,function(){var e,t,r,n;return ej(this,function(i){switch(i.label){case 0:return[4,this.getItems([_.PROJECT_ID,_.EXTERNAL_USER_ID,_.NOTIFLY_DEVICE_ID])];case 1:if(t=(e=eR.apply(void 0,[i.sent(),3]))[0],r=e[1],n=e[2],!t||!n)throw Error("Notifly storage is not initialized");return[2,ex(t,r,n)]}})})},e.getItems=function(e){return eP(this,void 0,void 0,function(){var t=this;return ej(this,function(r){switch(r.label){case 0:return[4,this.ensureInitialized()];case 1:return r.sent(),[2,this._withTimeout(Promise.all(e.map(function(e){return t.getItem(e)})))]}})})},e.getItem=function(e){return eP(this,void 0,void 0,function(){var t;return ej(this,function(r){switch(r.label){case 0:return[4,this.ensureInitialized()];case 1:return r.sent(),[4,this._withTimeout(this.storage.getItem(e))];case 2:return[2,null!=(t=r.sent())?t:null]}})})},e.setItems=function(e){return eP(this,void 0,void 0,function(){return ej(this,function(t){switch(t.label){case 0:return[4,this.ensureInitialized()];case 1:return t.sent(),[2,this._withTimeout(this.storage.setItems(Object.entries(e)))]}})})},e.setItem=function(e,t){return eP(this,void 0,void 0,function(){return ej(this,function(r){switch(r.label){case 0:return[4,this.ensureInitialized()];case 1:return r.sent(),[2,this._withTimeout(this.storage.setItem(e,t))]}})})},e.removeItems=function(e){return eP(this,void 0,void 0,function(){return ej(this,function(t){switch(t.label){case 0:return[4,this.ensureInitialized()];case 1:return t.sent(),[2,this._withTimeout(this.storage.removeItems(e))]}})})},e.removeItem=function(e){return eP(this,void 0,void 0,function(){return ej(this,function(t){switch(t.label){case 0:return[4,this.ensureInitialized()];case 1:return t.sent(),[2,this._withTimeout(this.storage.removeItem(e))]}})})},e._withTimeout=function(e){return eP(this,arguments,void 0,function(e,t){return void 0===t&&(t=this.TRANSACTION_TIMEOUT),ej(this,function(r){return[2,new Promise(function(r,n){
1setTimeout(function(){return n(Error("Working with storage is not finished in a reasonable time"))},t),e.then(r).catch(n)})]})})},e.TRANSACTION_TIMEOUT=1e3,e.storage=null,e}(),eL=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},eM=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}};function eU(e,t){return eL(this,void 0,void 0,function(){var r;return eM(this,function(n){switch(n.label){case 0:return[4,function(e,t){return eL(this,void 0,void 0,function(){var r,n;return eM(this,function(i){switch(i.label){case 0:if(!e||!t)return console.error("[Notifly]: Username or password not provided."),[2,null];r={method:"POST",body:JSON.stringify({userName:e,password:t}),headers:{"X-Notifly-SDK-Version":"notifly/js/".concat(ek.getSdkVersion())}},i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch("https://api.notifly.tech/authorize",r)];case 2:return[4,i.sent().json()];case 3:if((n=i.sent()).error)throw Error(n.error);return[2,n.data||null];case 4:return console.warn("[Notifly]: ",i.sent()),[2,null];case 5:return[2]}})})}(e,t)];case 1:if(!(r=n.sent()))return[2,null];return[4,eN.setItem(_.COGNITO_ID_TOKEN,r)];case 2:return n.sent(),[2,r]}})})}var eF=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},eB=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},eK=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},ez=function(){function e(){}return e.initialize=function(){return eF(this,void 0,void 0,function(){var e,t,r;return eB(this,function(n){switch(n.label){case 0:return[4,eN.getItems([_.USERNAME,_.PASSWORD])];case 1:if(r=eK.apply(void 0,[n.sent(),2]),this._username=r[0],this._password=r[1],!this._username||!this._password)throw Error("Username or password not found. Call Notifly.initialize() first.");return e=this,[4,eN.getItem(_.COGNITO_ID_TOKEN)];case 2:if(e._cognitoIdToken=n.sent(),this._cognitoIdToken)return[3,4];return t=this,[4,eU(this._username,this._password)];case 3:if(t._cognitoIdToken=n.sent(),!this._cognitoIdToken)throw Error("Failed to get authentication token.");n.label=4;case 4:return[2]}})})},e.call=function(e,t,r,n){return eF(this,void 0,void 0,function(){return eB(this,function(i){switch(i.label){case 0:return[4,this._call(e,t,r,n)];case 1:return[2,i.sent()]}})})},e._call=function(e,t,r,n){return eF(this,arguments,void 0,function(e,t,r,n,i){var a,o,s;return void 0===i&&(i=0),eB(this,function(l){switch(l.label){case 0:return this._username&&this._password||console.warn("[Notifly]: APIManager has not been initialized. API may not work as expected."),a={method:t,headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(this._cognitoIdToken),"X-Notifly-SDK-Version":"notifly/js/".concat(ek.getSdkVersion())},keepalive:!0},r&&(a.body=JSON.stringify(r)),n&&(a.redirect=n),[4,fetch(e,a)];case 1:if(!(o=l.sent()).ok)return[3,3];return[4,o.json()];case 2:return[2,l.sent()];case 3:if(!(i<this.MAX_RETRY_COUNT_ON_TOKEN_EXPIRED))return[3,7];if(401!==o.status)return[3,5];if(!this._username||!this._password)throw Error("Username or password required when token has expired. Please retry initialization.");return s=this,[4,eU(this._username,this._password)];
1case 4:if(s._cognitoIdToken=l.sent(),!this._cognitoIdToken)throw Error("Failed to get authentication token.");l.label=5;case 5:return[4,this._call(e,t,r,n,i+1)];case 6:return[2,l.sent()];case 7:throw Error(o.statusText)}})})},e.MAX_RETRY_COUNT_ON_TOKEN_EXPIRED=3,e._username=null,e._password=null,e._cognitoIdToken=null,e}();(o=g||(g={}))[o.DRAFT=0]="DRAFT",o[o.ACTIVE=1]="ACTIVE",o[o.INACTIVE=2]="INACTIVE",o[o.TERMINATED=3]="TERMINATED";var eW=e.i(271944),eV=e.i(898892),eG=function(){return(eG=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},eq=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function e$(e){return!!e&&!!Array.isArray(e)&&e.every(function(e){var t;return!!((t=e)&&t.dt&&"string"==typeof t.dt&&/^\d{4}-\d{2}-\d{2}$/.test(t.dt))&&!!t.name&&"string"==typeof t.name&&!!t.count&&"number"==typeof t.count&&!!t.event_params&&"object"==typeof t.event_params||!1})}function eH(e){return e&&Array.isArray(e)}function eJ(e){if("number"==typeof e)return e;if("string"==typeof e){var t=parseInt(e,10);return isNaN(t)?0:t}return 0}var eQ={h:3600,d:86400,w:604800,m:2592e3},eX=function(){return(eX=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},eY=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},eZ=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},e0=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},e1=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};(s=v||(v={}))[s.OVERWRITE=0]="OVERWRITE",s[s.MERGE=1]="MERGE";var e2=function(){function e(){}return Object.defineProperty(e,"state",{get:function(){return{eventIntermediateCounts:this.eventIntermediateCounts,inWebMessageCampaigns:this.inWebMessageCampaigns,userData:this.userData}},enumerable:!1,configurable:!0}),e.saveState=function(){return eY(this,void 0,void 0,function(){return eZ(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,eN.setItem(_.NOTIFLY_STATE,JSON.stringify(this.state))];case 1:return e.sent(),[3,3];case 2:return console.warn("[Notifly] Failed to save state to IndexedDB. This is mostly due to the sudden browser shutdown.",e.sent()),[3,3];case 3:return[2]}})})},e.sync=function(e){return eY(this,void 0,void 0,function(){return eZ(this,function(t){switch(t.label){case 0:return[4,this._syncState(e)];case 1:return t.sent(),[2]}})})},e.refresh=function(){return eY(this,arguments,void 0,function(e){return void 0===e&&(e=v.OVERWRITE),eZ(this,function(t){return[2,this._syncState({policy:e,useStorageIfAvailable:!1})]})})}
1,e.updateExternalUserId=function(){return eY(this,void 0,void 0,function(){var e;return eZ(this,function(t){switch(t.label){case 0:return e=this.userData,[4,eN.getItem(_.EXTERNAL_USER_ID)];case 1:return e.external_user_id=t.sent(),[2]}})})},e.updateAndGetCampaignHiddenUntilDataAccordingToReEligibleCondition=function(e,t){this.userData.campaign_hidden_until||(this.userData.campaign_hidden_until={});var r,n=this.getMessageLogs(e),i=Math.floor(Date.now()/1e3),a=e1(e1([],e0(null!=n?n:[]),!1),[i],!1),o={};if(a.length>=(null!=(r=t.max_count)?r:1)){var s=eQ[t.unit]*t.value;o["".concat(e)]=i+s}return o["".concat(e,"_message_logs")]=e1(e1([],e0(null!=n?n:[]),!1),[i],!1),this.updateCampaignHiddenUntilData(o),o},e.updateEventCounts=function(e,t,r){var n,i,a=(void 0===n&&(n=0),(i=new Date(Date.now()+324e5)).setDate(i.getDate()+n),i.toISOString().split("T")[0]),o=r?r[0]:null,s=o&&t[o]||null,l=this.eventIntermediateCounts.find(function(t){return o&&s?t.dt===a&&t.name===e&&t.event_params[o]===s:t.dt===a&&t.name===e});l?l.count+=1:this.eventIntermediateCounts.push({dt:a,name:e,count:1,event_params:t||{}}),this.saveState()},e._clearEventCounts=function(){this.eventIntermediateCounts=[]},e.updateUserProperties=function(e){var t=this;this.userData.user_properties||(this.userData.user_properties={}),Object.keys(e).forEach(function(r){t.userData.user_properties&&(t.userData.user_properties[r]=e[r])}),this.saveState()},e._clearUserProperties=function(){this.userData.user_properties={}},e.updateCampaignHiddenUntilData=function(e){this.userData.campaign_hidden_until||(this.userData.campaign_hidden_until={}),this.userData.campaign_hidden_until=eX(eX({},this.userData.campaign_hidden_until),e),this.saveState()},e._clearCampaignHiddenUntilData=function(){this.userData.campaign_hidden_until={}},e.clearAll=function(){this._clearEventCounts(),this._clearUserProperties(),this._clearCampaignHiddenUntilData(),this.saveState()},e._syncState=function(e){return eY(this,void 0,void 0,function(){var t,r,n,i,a,o,s,l,u,c,d,h,f,p;return eZ(this,function(g){switch(g.label){case 0:return[4,this.updateExternalUserId()];case 1:if(g.sent(),t=null==(f=e.useStorageIfAvailable)||f,r=null!=(p=e.policy)?p:v.OVERWRITE,!t)return[3,7];return[4,eN.getItem(_.NOTIFLY_STATE)];case 2:n=g.sent(),g.label=3;case 3:var m;if(g.trys.push([3,6,,7]),!((i=n?JSON.parse(n):null)&&i&&eH(i.inWebMessageCampaigns)&&(m=i.userData)&&"object"==typeof m&&e$(i.eventIntermediateCounts)))return[3,5];return a=i,this.eventIntermediateCounts=a.eventIntermediateCounts,this.inWebMessageCampaigns=a.inWebMessageCampaigns,this._overwriteUserData(a.userData),[4,this.saveState()];case 4:case 13:case 15:return g.sent(),[2];case 5:return console.warn("[Notifly] State from storage might have been corrupted. Ignoring state from storage."),[3,7];case 6:return g.sent(),console.warn("[Notifly] State from storage might have been corrupted. Ignoring state from storage."),[3,7];case 7:return[4,eN.getItems([_.PROJECT_ID,_.NOTIFLY_DEVICE_ID])];case 8:return s=(o=e0.apply(void 0,[g.sent(),2]))[0],l=o[1],[4,eN.getNotiflyUserId()];case 9:if(u=g.sent(),!s||!l||!u)throw Error("Project ID, device ID, Notifly User ID should be set before logging an event.");return[4,ez.call("https://api.notifly.tech/user-state/".concat(s,"/").concat(u,"?").concat(l?"deviceId=".concat(l):""),"GET")];case 10:if(c=g.sent(),!e.handleExternalUserIdMismatch)return[3,14];return d=(c.userData||{}).device_external_user_id,[4,eN.getItem(_.EXTERNAL_USER_ID)];case 11:if(h=g.sent(),!this.shouldHandleExternalUserIdMismatch(h,d))return[3,14];return[4,eN.setItem(_.EXTERNAL_USER_ID,d)];case 12:return g.sent(),[4,this._syncState(eX(eX({},e),{policy:v.OVERWRITE,handleExternalUserIdMismatch:!1}))];case 14:return this._updateStatesBasedOnPolicy(c,r),[4,this.saveState()]}})})},e.shouldHandleExternalUserIdMismatch=function(e,t){return null!=e&&null!=t&&e!==t},e._updateStatesBasedOnPolicy=function(e,t){var r=eH(e.campaignData)?e.campaignData.filter(function(e){return"in-web-message"===e.channel}):[],n=e$(e.eventIntermediateCountsData)?e.eventIntermediateCountsData:[];switch(t){case v.OVERWRITE:this.inWebMessageCampaigns=r,this.eventIntermediateCounts=n,this._overwriteUserData(e.userData||{});break;case v.MERGE:this.inWebMessageCampaigns=r,this.eventIntermediateCounts=function(e,t){var r,n,i=(0,eW.default)(e),a=function(e){var t=i.findIndex(function(t){var r,n;return r=t,n=e,r.dt===n.dt&&r.name===n.name&&(0,eV.default)(r.event_params,n.event_params)});-1===t?i.push(e):i[t].count+=e.count};try{for(var o=eq(t),s=o.next();!s.done;s=o.next()){var l=s.value;a(l)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}(this.eventIntermediateCounts,n),this._mergeUserData(e.userData||{});break;default:throw Error("Invalid policy: ".concat(t))}},e._overwriteUserData=function(e){this.userData.user_properties=e.user_properties||{},this.userData.campaign_hidden_until=e.campaign_hidden_until,this.userData.random_bucket_number=eJ(e.random_bucket_number),this.userData.updated_at=e.updated_at||new Date().toISOString()},e._mergeUserData=function(e){var t,r,n,i;this.userData.user_properties=(t=this.userData.user_properties||{},r=e.user_properties||{},eG(eG({},t),r)),this.userData.campaign_hidden_until=(n=this.userData.campaign_hidden_until||{},i=e.campaign_hidden_until||{},eG(eG({}
1,n),i)),this.userData.random_bucket_number=eJ(e.random_bucket_number),this.userData.updated_at=e.updated_at||new Date().toISOString()},e.getMessageLogs=function(t){var r;return null==(r=e.userData.campaign_hidden_until)?void 0:r["".concat(t,"_message_logs")]},e.eventIntermediateCounts=[],e.inWebMessageCampaigns=[],e.userData={platform:eI(),sdk_version:ek.getSdkVersion(),sdk_type:ek.type},e}(),e3=e.i(290571),e4=Object.freeze({FADE:"fade",SLIDE_TO_TOP:"slide-to-top",SLIDE_TO_BOTTOM:"slide-to-bottom",SLIDE_TO_LEFT:"slide-to-left",SLIDE_TO_RIGHT:"slide-to-right",ROTATE:"rotate"});function e5(e,t){return(void 0===t&&(t="auto"),"number"==typeof e)?"".concat(e,"px"):"string"==typeof e?e:t}function e6(e,t){return"".concat("--notifly-").concat(e,"-").concat(t)}function e7(e){var t;if("object"!=typeof(t=e)||null===t)throw Error("Invalid modal props: object is expected")}var e9=function(){function e(){}return Object.defineProperty(e,"iframe",{get:function(){return this._iframe},enumerable:!1,configurable:!0}),e.render=function(e,t,r){void 0===r&&(r={}),this._callbacks=r,this._renderWrapper(document.body,e,t)},e.close=function(){var e;return(0,e3.__awaiter)(this,void 0,void 0,function(){var t,r=this;return(0,e3.__generator)(this,function(n){return"uninitialized"===this._state||"idle"===this._state||"closing"===this._state?[2]:(this._clearAutoDismissTimer(),this._state="closing",t=this._maybeAttachLeaveAnimationStyleToIframeAndReturnWaitMs(null==(e=this._props)?void 0:e.animation))?[2,new Promise(function(e){r._closingTimer=setTimeout(function(){r.dispose(),r._closingTimer=null,e()},t)})]:(this.dispose(),[2])})})},e.dispose=function(){if("uninitialized"!==this._state&&"idle"!==this._state&&null!==this._scope){this._clearAutoDismissTimer();try{switch(this._iframeContainer.removeChild(this._iframe),this._renderType){case"normal":this._scope.removeChild(this._iframeContainer);break;case"withBackgroundLayer":this._backgroundLayer.removeChild(this._iframeContainer),this._scope.removeChild(this._backgroundLayer)}this._removeResizeEventListeners()}catch(e){console.error("[Notifly Web Message Renderer] Error while disposing renderer:",e)}this._state="idle"}},e._renderWrapper=function(e,t,r){return(0,e3.__awaiter)(this,void 0,void 0,function(){var n,i,a;return(0,e3.__generator)(this,function(o){return i=(n=this._callbacks).onRenderCompleted,a=n.onRenderFailed,this._render(e,t,r).then(function(){return null==i?void 0:i()}).catch(function(e){return null==a?void 0:a(e)}),[2]})})},e._render=function(e,t,r){return(0,e3.__awaiter)(this,void 0,void 0,function(){var n,i,a,o,s,l;return(0,e3.__generator)(this,function(u){switch(u.label){case 0:try{if(function(e){var t=e.version;if("number"!=typeof t)throw Error("Invalid template: version must be a number");if(t<2)throw Error("Invalid template: version ".concat(t," is deprecated"));if(t>3)throw Error("Invalid template: version ".concat(t," is not supported in this SDK version."))}(t),!t.modal_props_narrow||!t.modal_props_wide)throw Error("Invalid template: modal_props_narrow and modal_props_wide are required");var c=t.animation;if(void 0!==c){var d=c.enter,h=c.leave;if(d){if(!Object.values(e4).includes(d.type))throw Error("Invalid entry animation type: ".concat(d.type));if(!d.duration)throw Error("Invalid entry animation: duration is required")}if(h){if(!Object.values(e4).includes(h.type))throw Error("Invalid exit animation type: ".concat(h.type));if(!h.duration)throw Error("Invalid exit animation: duration is required")}}e7(t.modal_props_narrow),e7(t.modal_props_wide)}catch(e){throw this.dispose(),e}if(this._injectKeyframes(),this._closingTimer&&(clearTimeout(this._closingTimer),this._closingTimer=null),"closing"===this._state&&this.dispose(),"uninitialized"===this._state&&(this._scope=e||document.body,this._backgroundLayer=this._createBackgroundLayer(),this._iframeContainer=this._createIframeContainer(),this._iframe=this._createIframe(),this._state="idle"),"processing"===this._state)return console.warn("[Notifly Web Message Renderer] Cannot render while processing the previous render request. Ignoring this request..."),[2];if(t.auto_dismiss_after_seconds&&this._setAutoDismissTimer(t.auto_dismiss_after_seconds),n="idle"===this._state,i=this._source!==r,this._props=t,this._isNarrow=window.innerWidth<640,!(a=this._isNarrow?t.modal_props_narrow:t.modal_props_wide))throw this._state="idle",Error("Unexpected error: cannot get modal props to apply. Aborting...");if(o=!!a.background,s=this._renderType,this._renderType=o?"withBackgroun
1dLayer":"normal",e8.style(this._backgroundLayer,a),te.style(this._iframeContainer,a),i&&this._hideWebMessage(),this._maybeAttachEnterAnimationStyleToIframe(t.animation),this._scope=e||document.body,n)switch(this._iframeContainer.appendChild(this._iframe),this._renderType){case"normal":this._insert(this._scope,this._iframeContainer);break;case"withBackgroundLayer":this._backgroundLayer.appendChild(this._iframeContainer),this._insert(this._scope,this._backgroundLayer)}else if(s!==this._renderType)switch(s){case"normal":document.body.removeChild(this._iframeContainer),this._backgroundLayer.appendChild(this._iframeContainer),this._insert(this._scope,this._backgroundLayer);break;case"withBackgroundLayer":this._backgroundLayer.removeChild(this._iframeContainer),document.body.removeChild(this._backgroundLayer),this._insert(this._scope,this._iframeContainer)}if(!i)return[3,5];this._state="processing",u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._switchIframeContent(r)];case 2:return u.sent(),[3,4];case 3:throw l=u.sent(),n||this.dispose(),l;case 4:this._showWebMessage(),this._source=r,u.label=5;case 5:return n&&this._attachResizeEventListeners(),this._state="completed",[2]}})})},e._handleWindowResize=function(){window.innerWidth<640!==this._isNarrow&&this._source&&this._props&&"completed"===this._state&&this.render(this._props,this._source)},e._insert=function(e,t){var r=e.firstChild;r?e.insertBefore(t,r):e.appendChild(t)},e._createBackgroundLayer=function(){var e=document.createElement("div");return e.id="--notifly-web-message-background-layer",e},e._createIframeContainer=function(){var e=document.createElement("div");return e.id="--notifly-web-message-iframe-container",e},e._createIframe=function(){var e=document.createElement("iframe");return e.style.border="none",e.style.overflow="hidden",e.style.margin="0",e.style.padding="0",e.style.display="block",e.style.colorScheme="none",e.style.width="100%",e.style.height="100%",e.id="--notifly-web-message-iframe",e},e._injectKeyframes=function(){if(!this._areKeyframesInjected){var e="\n    @keyframes ".concat(e6(e4.FADE,"enter")," {\n        from {\n            opacity: 0;\n        }\n        to {\n            opacity: 1;\n        }\n    }\n    \n    @keyframes ").concat(e6(e4.SLIDE_TO_TOP,"enter")," {\n        from {\n            opacity: 0;\n            transform: translateY(50px);\n        }\n        to {\n            opacity: 1;\n            transform: translateY(0);\n        }\n    }\n    @keyframes ").concat(e6(e4.SLIDE_TO_BOTTOM,"enter")," {\n        from {\n            opacity: 0;\n            transform: translateY(-50px);\n        }\n        to {\n            opacity: 1;\n            transform: translateY(0);\n        }\n    }\n    @keyframes ").concat(e6(e4.SLIDE_TO_LEFT,"enter")," {\n        from {\n            opacity: 0;\n            transform: translateX(50px);\n        }\n        to {\n            opacity: 1;\n            transform: translateX(0);\n        }\n    }\n    @keyframes ").concat(e6(e4.SLIDE_TO_RIGHT,"enter")," {\n        from {\n            opacity: 0;\n            transform: translateX(-50px);\n        }\n        to {\n            opacity: 1;\n            transform: translateX(0);\n        }\n    }\n\n    @keyframes ").concat(e6(e4.ROTATE,"enter")," {\n        from {\n            opacity: 0;\n            transform: rotate(100deg);\n        }\n        to {\n            opacity: 1;\n            transform: rotate(0);\n        }\n    }\n\n    @keyframes ").concat(e6(e4.FADE,"leave")," {\n        from {\n            opacity: 1;\n        }\n        to {\n            opacity: 0;\n        }\n    }\n    \n    @keyframes ").concat(e6(e4.SLIDE_TO_TOP,"leave")," {\n        from {\n            opacity: 1;\n            transform: translateY(0);\n        }\n        to {\n            opacity: 0;\n            transform: translateY(-50px);\n        }\n    }\n    @keyframes ").concat(e6(e4.SLIDE_TO_BOTTOM,"leave")," {\n        from {\n            opacity: 1;\n            transform: translateY(0);\n        }\n        to {\n            opacity: 0;\n            transform: translateY(50px);\n        }\n    }\n    @keyframes ").concat(e6(e4.SLIDE_TO_LEFT,"leave")," {\n        from {\n            opacity: 1;\n            transform: translateX(0);\n        }\n        to {\n            opacity: 0;\n            transform: translateX(-50px);\n        }\n    }\n    @keyframes ").concat(e6(e4.SLIDE_TO_RIGHT,"leave")," {\n        from {\n            opacity: 1;\n            transform: translateX(0);\n        }\n        to {\n            opacity: 0;\n            transform: translateX(50px);\n        }\n    }\n\n    @keyframes ").concat(e6(e4.ROTATE,"leave")," {\n        from {\n            opacity: 1;\n            transform: rotate(0);\n        }\n        to {\n            opacity: 0;\n            transform: rotate(100deg);\n        }\n    }\n    "),t=document.createElement("style");t.innerHTML=e,document.head.appendChild(t)}},e._switchIframeContent=function(e,t){return void 0===t&&(t=3e3),(0,e3.__awaiter)(this,void 0,void 0,function(){var r=this;return(0,e3.__generator)(this,function(n){return this._iframe.src&&this._iframe.removeAttribute("src"),this._iframe.srcdoc&&this._iframe.removeAttribute("srcdoc"),[2,new Promise(function(n,i){var a=setTimeout(function(){window.removeEventListener("message",o),i(Error("[Notifly Web Message Renderer] Timeout while waiting for content to be loaded."))},t),o=function(e){"__notifly_web_message_loaded"===e.data.type&&(clearTimeout(a),window.removeEventListener("message",o),n())};window.addEventListener("message",o);var s=function(e){var t=e.trim();if(t.startsWith("<"))return"html";if(t.startsWith("http"))return"url";throw Error("Invalid source: ".concat(e))}(e);
1"html"===s?r._iframe.srcdoc=e:"url"===s&&(r._iframe.src=e)})]})})},e._hideWebMessage=function(){switch(this._renderType){case"normal":this._iframeContainer.style.display="none";break;case"withBackgroundLayer":this._backgroundLayer.style.display="none"}},e._showWebMessage=function(){switch(this._renderType){case"normal":this._iframeContainer.style.display="block";break;case"withBackgroundLayer":this._backgroundLayer.style.display="block"}},e._setAutoDismissTimer=function(e){var t=this;this._autoDismissTimer&&this._clearAutoDismissTimer(),e&&(this._autoDismissTimer=setTimeout(function(){var e,r;t.close(),null==(r=(e=t._callbacks).onAutoDismissed)||r.call(e),t._autoDismissTimer=null},1e3*e))},e._clearAutoDismissTimer=function(){this._autoDismissTimer&&(clearTimeout(this._autoDismissTimer),this._autoDismissTimer=null)},e._attachResizeEventListeners=function(){this._areResizeEventListenersAttached||(window.addEventListener("resize",this._handleWindowResize.bind(this)),window.addEventListener("orientationchange",this._handleWindowResize.bind(this)),this._areResizeEventListenersAttached=!0)},e._removeResizeEventListeners=function(){this._areResizeEventListenersAttached&&(window.removeEventListener("resize",this._handleWindowResize.bind(this)),window.removeEventListener("orientationchange",this._handleWindowResize.bind(this)),this._areResizeEventListenersAttached=!1)},e._maybeAttachEnterAnimationStyleToIframe=function(e){if(this._iframe){if(this._iframe.style.opacity="1",!(null==e?void 0:e.enter))return void this._clearIframeAnimation();var t=e.enter,r=t.duration,n=t.type,i=t.timing_function,a=e6(n,"enter"),o="".concat(a," ").concat(r,"s ").concat(i||"ease-in-out");this._iframe.style.animation=o}},e._maybeAttachLeaveAnimationStyleToIframeAndReturnWaitMs=function(e){if(!this._iframe)return 0;if(!(null==e?void 0:e.leave))return this._clearIframeAnimation(),0;var t=e.leave,r=t.duration,n=t.type,i=t.timing_function,a=e6(n,"leave"),o="".concat(a," ").concat(r,"s ").concat(i||"ease-out");return this._iframe.style.opacity="0",this._iframe.style.animation=o,1e3*r},e._clearIframeAnimation=function(){this._iframe&&(this._iframe.style.animation="")},e._state="uninitialized",e._renderType="normal",e._source=null,e._callbacks={},e._props=null,e._isNarrow=!1,e._areKeyframesInjected=!1,e._areResizeEventListenersAttached=!1,e._autoDismissTimer=null,e._closingTimer=null,e}(),e8=function(){function e(){}return e.style=function(e,t){if(!e||!t)throw Error("Invalid arguments");
1t.background&&(this._initializeBackgroundLayerStyle(e),e.style.background="rgba(0,0,0,".concat(t.background_opacity||.2,")"))},e._initializeBackgroundLayerStyle=function(e){e.style.zIndex="9998",e.style.border="none",e.style.overflow="hidden",e.style.position="fixed",e.style.margin="0",e.style.padding="0",e.style.display="block",e.style.top="0px",e.style.left="0px",e.style.width="100vw",e.style.height="100vh"},e}(),te=function(){function e(){}return e.style=function(e,t){if(!e||!t)throw Error("Invalid arguments");this._initializeContainerStyle(e),e.style.background="transparent",e.style.width=e5(t.width,this.DEFAULT_PROPS.width),e.style.height=e5(t.height,this.DEFAULT_PROPS.height),t.padding&&(e.style.padding=e5(t.padding,"0px")),e.style.position="fixed"===t.position||"absolute"===t.position?t.position:this.DEFAULT_PROPS.position,t.center?(e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)"):(void 0!==t.left?e.style.left=e5(t.left,this.DEFAULT_PROPS.left):void 0!==t.right?e.style.right=e5(t.right,this.DEFAULT_PROPS.right):e.style.left="0px",void 0!==t.bottom?e.style.bottom=e5(t.bottom,this.DEFAULT_PROPS.bottom):void 0!==t.top?e.style.top=e5(t.top,this.DEFAULT_PROPS.top):e.style.top="0px"),t.box_shadow&&this.BOX_SHADOW_MAPPINGS[t.box_shadow]&&(e.style.boxShadow=this.BOX_SHADOW_MAPPINGS[t.box_shadow]),void 0!==e.style.borderRadius&&(e.style.borderRadius=this._convertBorderRadiusToCSSValue(t.border_radius))},e._initializeContainerStyle=function(e){e.style.zIndex="9999",e.style.border="none",e.style.overflow="visible",e.style.margin="0",e.style.padding="0",e.style.display="block",e.style.top="auto",e.style.left="auto",e.style.right="auto",e.style.bottom="auto",e.style.transform="none",e.style.boxShadow="none",e.style.borderRadius="0px"},e._convertBorderRadiusToCSSValue=function(e){if(!e)return"0px";if("string"==typeof e)return e;if("number"==typeof e)return"".concat(e,"px");var t=e.top_left,r=e.top_right,n=e.bottom_right,i=e.bottom_left;return"".concat(t||"0px"," ").concat(r||"0px"," ").concat(n||"0px"," ").concat(i||"0px")},e.DEFAULT_PROPS={width:"100vw",height:"100vh",position:"fixed",padding:"0px",right:"0px",bottom:"0px",left:"0px",top:"0px"},e.BOX_SHADOW_MAPPINGS={sm:" 0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},e}();function tt(){return(0,e3.__awaiter)(this,void 0,void 0,function(){return(0,e3.__generator)(this,function(e){return[2,e9.close()]})})}var tr=e.i(946217),tn=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},ti=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},ta=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},to=function(){function e(){}return e.setUserId=function(e,t){return tn(this,void 0,void 0,function(){var r,n;return ti(this,function(i){switch(i.label){case 0:if(e2.userData.external_user_id=null==e?void 0:e.trim(),!(null!=(n=null==t?void 0:t.onlyIfChanged)?n:this.DEFAULT_SET_USER_ID_OPTIONS.onlyIfChanged))return[3,2];return[4,this.getUserId()];case 1:if(r=i.sent(),this._areUserIdsIdentical(e,r))return[2];i.label=2;case 2:if(null==e?void 0:e.trim())return[3,4];return[4,this.removeUserId()];case 3:return i.sent(),[3,6];case 4:return[4,this.setUserProperties({external_user_id:e})];case 5:i.sent(),i.label=6;case 6:return[2]}})})},e.getUserId=function(){return tn(this,void 0,void 0,function(){return ti(this,function(e){return[2,eN.getItem(_.EXTERNAL_USER_ID)]})})},e.getUserProperties=function(){return tn(this,void 0,void 0,function(){return ti(this,function(e){return[2,e2.state.userData.user_properties||null]})})},e.setUserProperties=function(e){return tn(this,void 0,void 0,function(){var t,r,n,i,a,o,s;return ti(this,function(l){switch(l.label){case 0:if(!(t=null==(s=e.external_user_id
1)?void 0:s.toString()))return[3,7];return[4,eN.getItem(_.PROJECT_ID)];case 1:if(!l.sent())throw Error("[Notifly] Project ID should be set before setting user properties.");return[4,Promise.all([eN.getItem(_.EXTERNAL_USER_ID),eN.getNotiflyUserId()])];case 2:if(n=(r=ta.apply(void 0,[l.sent(),2]))[0],e.previous_notifly_user_id=r[1],e.previous_external_user_id=n,this._areUserIdsIdentical(t,n))return[3,6];return[4,eN.setItem(_.EXTERNAL_USER_ID,t)];case 3:return l.sent(),[4,tA.logEvent(m.SET_USER_PROPERTIES,e,null,!0)];case 4:return l.sent(),i=n?v.OVERWRITE:v.MERGE,[4,e2.refresh(i)];case 5:l.sent(),l.label=6;case 6:return[3,13];case 7:if(ek.type!==p.JS_CAFE24)return[3,11];return a={},[4,this.getUserProperties()];case 8:if(o=l.sent()||{},Object.keys(e).forEach(function(t){(0,eV.default)(o[t],e[t])||(a[t]=e[t])}),(0,tr.default)(a))return[3,10];return e2.updateUserProperties(a),[4,tA.logEvent(m.SET_USER_PROPERTIES,a,null,!0)];case 9:l.sent(),l.label=10;case 10:return[3,13];case 11:return e2.updateUserProperties(e),[4,tA.logEvent(m.SET_USER_PROPERTIES,e,null,!0)];case 12:l.sent(),l.label=13;case 13:return[2]}})})},e.removeUserId=function(){return tn(this,void 0,void 0,function(){return ti(this,function(e){switch(e.label){case 0:return[4,eN.getItem(_.EXTERNAL_USER_ID)];case 1:if(!e.sent())return[3,4];return[4,this._cleanUserIdInLocalStorage()];case 2:return e.sent(),[4,e2.refresh()];case 3:e.sent(),e.label=4;case 4:return[4,tA.logEvent(m.REMOVE_EXTERNAL_USER_ID,{},null,!0)];case 5:return e.sent(),e2.clearAll(),[2]}})})},e._cleanUserIdInLocalStorage=function(){return tn(this,void 0,void 0,function(){return ti(this,function(e){switch(e.label){case 0:return[4,eN.removeItem(_.EXTERNAL_USER_ID)];case 1:return e.sent(),[2]}})})},e._areUserIdsIdentical=function(e,t){return!e&&!t||e===t},e.DEFAULT_SET_USER_ID_OPTIONS={onlyIfChanged:!1},e}(),ts=function(){return(ts=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},tl=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},tu=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},tc=function(){function e(){}return e.prototype.onRefreshStarted=function(){td.descheduleInWebMessage()},e}(),td=function(){function e(){}return e.initialize=function(){ek.registerObserver(new tc)},e._showInWebMessage=function(e){var t,r,n=this;if(this._isWebMessageOpen)return void console.warn("[Notifly] Web message is already open. Ignoring this message from campaign ".concat(e.id,"..."));this._isWebMessageOpen=!0;var i=e.re_eligible_condition?e2.updateAndGetCampaignHiddenUntilDataAccordingToReEligibleCondition(e.id,e.re_eligible_condition):null,a=e.message,o=a.modal_properties,s=o.template_name;t=e.message.modal_properties,r=a.html_url,e9.render(t,r,{onRenderCompleted:function(){tA.logEvent(m.IN_WEB_MESSAGE_SHOW,ts({type:"message_event",channel:"in-web-message",campaign_id:e.id,template_name:s},i?{hide_until_data:i}:{}),null,!0);var t=(function(r){var i,a,l;return i=void 0,a=void 0,l=function(){var n,i,a,l,u,c,d,h;return tl(this,function(f){switch(f.label){case 0:if(f.trys.push([0,9,,10]),r.source!==e9.iframe.contentWindow)return[3,8];if((n=r.data).link&&(null==o?void 0:o.link_open_mode)==="blank"&&(i=document.createElement("a"),document.body.appendChild(i),i.setAttribute("style","display: none"),i.href=n.link,i.target="_blank",i.rel="noopener noreferrer",i.click(),document.body.removeChild(i)),"close"!==n.type)return[3,4];this._isWebMessageOpen=!1;try{tt()}catch(e){}finally{window.removeEventListener("message",t)}if(!(a=n.extraData)||!(l=a.data)||!l.hideUntil)return[3,2];return[4,to.setUserProperties(((h={})["".concat(m.HIDE_IN_WEB_MESSAGE,"_").concat(s)]=l.hideUntil,h))];case 1:f.sent(),f.label=2;case 2:return[4,tA.logEvent(m.CLOSE_BUTTON_CLICK,{type:"message_event",channel:"in-web-message",button_name:n.buttonName,campaign_id:e.id},null,!0)];case 3:case 5:return f.sent(),[3,7];case 4:if("main_button"!==n.type)return[3,6];this._isWebMessageOpen=!1;try{tt()}catch(e){}finally{window.removeEventListener("message",t)}return[4,tA.logEvent(m.MAIN_BUTTON_CLICK,{type:"message_event",channel:"in-web-message",button_name:n.buttonName,campaign_id:e.id},null,!0)];case 6:ek.allowUserSuppliedLogEvent&&n.type&&(u=n.type,c=tu(n,["type"]),d=Object.values(m).includes(u),tA.logEvent(u,c,null,d)),f.label=7;case 7:n.link&&(null==o?void 0:o.link_open_mode)!=="blank"&&(i=document.createElement("a"),document.body.appendChild(i),i.setAttribute("style","display: none"),i.href=n.link,i.click(),document.body.removeChild(i)),f.label=8;case 8:return[3,10];case 9:return console.error("[Notifly] Error handling message from iframe: ",f.sent()),[3,10];case 10:return[2]}})},new(a||(a=Promise))(function(e,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof a?n:new a(function(e){e(n)})).then(r,o)}s((l=l.apply(n,i||[])).next())})}).bind(n);window.addEventListener("message",t)},onRenderFailed:function(){n._isWebMessageOpen=!1,console.error("[Notifly] Error creating in web message. Web message content is either invalid or not found")},onAutoDismissed:function(){n._isWebMessageOpen=!1}})},e.scheduleInWebMessage=function(e){var t,r=this,n=null!=(t=e.delay)?t:0;if(n<=0)this._showInWebMessage(e);else{var i=setTimeout(function(){try{r._showInWebMessage(e)}catch(e){console.error("[Notifly] Error showing web message: ",e)}finally{var t=r._scheduledWebMessages.findIndex(function(e){return e.timerId===i});-1!==t&&r._scheduledWebMessages.splice(t,1)}},1e3*n);this._scheduledWebMessages.push({timerId:i,campaignId:e.id})}},e.getScheduledCampaignIds=function(){return this._scheduledWebMessages.map(function(e){return e.campaignId})},e.descheduleInWebMessage=function(e){if(void 0===e&&(e=null),e){var t=this._scheduledWebMessages.findIndex(function(t){return t.campaignId===e});-1!==t&&(clearTimeout(this._scheduledWebMessages[t].timerId),this._scheduledWebMessages.splice(t,1)
1)}else this._scheduledWebMessages.forEach(function(e){return clearTimeout(e.timerId)}),this._scheduledWebMessages=[]},e._isWebMessageOpen=!1,e._scheduledWebMessages=[],e}(),th=function(){function e(){}return e._castOrThrow=function(e,t){switch(t){case"TEXT":if("string"!=typeof e){if("number"==typeof e)return e.toString();if("boolean"==typeof e)return e?"true":"false";throw Error("Unrecoverable type mismatch: expected ".concat(t,", got ").concat(typeof e))}return e;case"INT":if("number"!=typeof e){if("string"==typeof e){var r=parseInt(e,10);if(!isNaN(r))return r;throw Error("Value is not a number")}throw Error("Unrecoverable type mismatch: expected ".concat(t,", got ").concat(typeof e))}return e;case"BOOL":if("boolean"!=typeof e){if("string"==typeof e){if("true"===e)return!0;else if("false"===e)return!1}throw Error("Unrecoverable type mismatch: expected ".concat(t,", got ").concat(typeof e))}return e;case"ARRAY":if(!Array.isArray(e))throw Error("Unrecoverable type mismatch: expected ".concat(t,", got ").concat(typeof e));return e;default:throw Error("Unrecoverable type mismatch: invalid type ".concat(t))}},e._castOrNull=function(e,t){try{return this._castOrThrow(e,t)}catch(e){return console.warn("[Notifly] ".concat(e.message)),null}},e.IsEqual=function(e,t,r){try{return this._castOrThrow(e,r)===this._castOrThrow(t,r)}catch(e){return console.warn("[Notifly] ".concat(e.message)),!1}},e.IsNotEqual=function(e,t,r){try{return this._castOrThrow(e,r)!==this._castOrThrow(t,r)}catch(e){return console.warn("[Notifly] ".concat(e.message)),!1}},e.IsGreaterThan=function(e,t,r){try{return this._castOrThrow(e,r)>this._castOrThrow(t,r)}catch(e){return console.warn("[Notifly] ".concat(e.message)),!1}},e.IsGreaterThanOrEqual=function(e,t,r){try{return this._castOrThrow(e,r)>=this._castOrThrow(t,r)}catch(e){return console.warn("[Notifly] ".concat(e.message)),!1}},e.IsLessThan=function(e,t,r){try{return this._castOrThrow(e,r)<this._castOrThrow(t,r)}catch(e){return console.warn("[Notifly] ".concat(e.message)),!1}},e.IsLessThanOrEqual=function(e,t,r){try{return this._castOrThrow(e,r)<=this._castOrThrow(t,r)}catch(e){return console.warn("[Notifly] ".concat(e.message)),!1}},e.HasElement=function(e,t,r){var n=this;try{var i=this._castOrThrow(e,"ARRAY"),a=this._castOrThrow(t,r);return i.some((function(e){return!!n.IsEqual(e,a,r)}).bind(this))}catch(e){return console.warn("[Notifly] ".concat(e.message)),!1}},e.DoesNotHaveElement=function(e,t,r){var n=this;try{var i=this._castOrThrow(e,"ARRAY"),a=this._castOrThrow(t,r);return!i.some((function(e){return!!n.IsEqual(e,a,r)}).bind(this))}catch(e){return console.warn("[Notifly] ".concat(e.message)),!1}},e.StartsWith=function(e,t){var r=this._castOrNull(e,"TEXT"),n=this._castOrNull(t,"TEXT");return null!==n&&!!(null==r?void 0:r.startsWith(n))},e.DoesNotStartWith=function(e,t){var r=this._castOrNull(e,"TEXT"),n=this._castOrNull(t,"TEXT");return null!==n&&!(null==r?void 0:r.startsWith(n))},e.EndsWith=function(e,t){var r=this._castOrNull(e,"TEXT"),n=this._castOrNull(t,"TEXT");return null!==n&&!!(null==r?void 0:r.endsWith(n))},e.DoesNotEndWith=function(e,t){var r=this._castOrNull(e,"TEXT"),n=this._castOrNull(t,"TEXT");return null!==n&&!(null==r?void 0:r.endsWith(n))},e.Contains=function(e,t){var r=this._castOrNull(e,"TEXT"),n=this._castOrNull(t,"TEXT");return null!==n&&!!(null==r?void 0:r.includes(n))},e.DoesNotContain=function(e,t){var r=this._castOrNull(e,"TEXT"),n=this._castOrNull(t,"TEXT");return null!==n&&!(null==r?void 0:r.includes(n))},e.MatchesRegex=function(e,t){var r=this._castOrNull(e,"TEXT"),n=this._castOrNull(t,"TEXT");return null!==n&&!!tf(null!=r?r:"",n)},e.DoesNotMatchRegex=function(e,t){var r=this._castOrNull(e,"TEXT"),n=this._castOrNull(t,"TEXT");return null!==n&&!tf(null!=r?r:"",n)},e}();function tf(e,t){try{return new RegExp(t).test(e)}catch(e){return console.warn("[Notifly] ".concat(e.message)),!1}}function tp(e){void 0===e&&(e=0);var t=new Date(Date.now()+324e5);return t.setDate(t.getDate()+e),t.toISOString().split("T")[0]}function t_(e){return null==e}var tg=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},tv=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tm=function(){function e(){}return e.initialize=function(){var e,t,r,n;return e=this,t=arguments,r=void 0,n=function(e){return void 0===e&&(e=!1),tg(this,function(t){switch(t.label){case 0:return[4,e2.sync({useStorageIfAvailable:!e,handleExternalUserIdMismatch:!0})];case 1:return t.sent(),td.initialize(),[2]}})},new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},e.maybeTriggerWebMessagesAndUpdateEventCounts=function(e,t,r,n){this._checkCancellationConditions(e,t),this._triggerWebMessages(e,t,r),e2.updateEventCounts(e,t,n)},e._triggerWebMessages=function(e,t,r){var n=this,i=function(){return n._getCampaignsToSchedule(e2.inWebMessageCampaigns,e,t,r).forEach(td.scheduleInWebMessage.bind(td))};if("loading"===document.readyState){var a=function(){i(),window.removeEventListener("DOMContentLoaded",a)};window.addEventListener("DOMContentLoaded",a)}else i()},e._getCampaignsToSchedule=function(e,t,r,n){var i=this,a=e.filter(function(e){return i._isCampaignActive(e)&&i._isEventApplicableForCampaign(e,t,r)&&i._isEntityOfSegment(e,r,n)});return this._compactCampaigns(a)},e._compareCampaigns=function(e,t){var r=e.delay||0,n=t.delay||0;return r<n?-1:r>n?1:e.updated_at>t.updated_at?-1:1},e._compactCampaigns=function(e){if(e.length<=1)return e;for(var t=e.sort(this._compareCampaigns),r=[t[0]],n=t[0].delay||0,i=1;i<t.length;i++){var a=t[i],o=a.delay||0;o!==n&&(r.push(a),n=o)}return r},e._checkCancellationConditions=function(e,t){var r,n,i=td.getScheduledCampaignIds();if(0!==i.length){var a=e2.inWebMessageCampaigns,o=function(r){var n=a.find(function(e){return e.id===r});if(!(null==n?void 0:n.cancellation_conditions)||!s._matchTriggeringConditions(n.cancellation_conditions,e)||n.cancellation_event_filters&&!s._matchTriggeringEventFilters(n.cancellation_event_filters,t))return"continue";td.descheduleInWebMessage(r)},s=this;try{for(var l=tv(i),u=l.next();!u.done;u=l.next()){var c=u.value;o(c)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}},e._isCampaignActive=function(e){var t;return!!(null==(t=e.starts)?void 0:t[0])&&e.status===g.ACTIVE&&e.starts[0]<=Math.floor(Date.now()/1e3)&&(!e.end||e.end>Math.floor(Date.now()/1e3))},e._isEventApplicableForCampaign=function(e,t,r){if(!e.triggering_conditions)return console.error("[Notifly] Campaign does not have triggering conditions"),!1;if(!this._matchTriggeringConditions(e.triggering_conditions,t))return!1;var n=e.triggering_event_filters;return!n||!!this._matchTriggeringEventFilters(n,r)},e._matchTriggeringConditions=function(e,t){var r=this;return e.some(function(e){return e.every(function(e){return r._matchTriggeringConditionUnit(e,t)})})},e._matchTriggeringConditionUnit=function(e,t){var r=e.operator,n=e.operand;switch(r){case"=":return t===n;case"!=":return t!==n;case"starts_with":return t.startsWith(n);case"does_not_start_with":return!t.startsWith(n);case"ends_with":return t.endsWith(n);case"does_not_end_with":return!t.endsWith(n);case"contains":return t.includes(n);case"does_not_contain":return!t.includes(n);case"matches_regex":return tf(t,n);case"does_not_match_regex":return!tf(t,n);default:return console.error("[Notifly] Encountered unexpected error while parsing triggering conditions: invalid operator ".concat(r)),!1}},e._matchTriggeringEventFilters=function(e,t){var r,n,i=this;try{for(var a=tv(e),o=a.next();!o.done;o=a.next())if(o.value.every(function(e){return i._matchTriggeringEventFilterUnit(e,t)}))return!0}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!1},e._matchTriggeringEventFilterUnit=function(e,t){var r=e.key,n=e.operator,i=e.value,a=e.value_type;if(!r)return!1;var o=t[r],s=t_(o);if("IS_NULL"===n)return s;if("IS_NOT_NULL"===n)return!s;if(!a)return!1;if(s)switch(n){case"<>":case"does_not_start_with":case"does_not_end_with":case"does_not_contain":case"does_not_match_regex":return!0;default:return!1}switch(n){case"=":return th.IsEqual(o,i,a);case"<>":return th.IsNotEqual(o,i,a);case">":return th.IsGreaterThan(o,i,a);case">=":return th.IsGreaterThanOrEqual(o,i,a);case"<":return th.IsLessThan(o,i,a);case"<=":return th.IsLessThanOrEqual(o,i,a);case"@>":return th.HasElement(o,i,a);case"NOT_INCLUDE":return th.DoesNotHaveElement(o,i,a);case"starts_with":return th.StartsWith(o,i);case"does_not_start_with":return th.DoesNotStartWith(o,i);case"ends_with":return th.EndsWith(o,i);case"does_not_end_with":return th.DoesNotEndWith(o,i);case"contains":return th.Contains(o,i);case"does_not_contain":return th.DoesNotContain(o,i);case"matches_regex":return th.MatchesRegex(o,i);case"does_not_match_regex":return th.DoesNotMatchRegex(o,i);default:return console.warn("[Notifly] Invalid operator - ".concat(n)),!1}},e._isEntityOfSegment=function(e,t,r){var n,i,a,o,s=this;if("condition"!==e.segment_type||e.testing&&(!r||!e.whitelist||!e.whitelist.includes(r)))return!1;if(e.re_eligible_condition){var l=null==(a=e2.userData.campaign_hidden_until)?void 0:a["".concat(e.id)],u=Math.floor(Date.now()/1e3);if(l&&u<=l)return!1}var c=e.message.modal_properties.template_name;if(e2.userData&&e2.userData.user_properties){var u=Math.floor(Date.now()/1e3);if(u<=e2.userData.user_properties["".concat(m.HIDE_IN_WEB_MESSAGE,"_").concat(c)])return!1}var d=null==(o=e.segment_info)?void 0:o.groups;if(!d||!d.length)return!0;try{for(var h=tv(d),f=h.next();!f.done;f=h.next()){var p=f.value.conditions;if(!p||0===p.length)return console.error("[Notifly] No condition present in group"),!1;if(p.every(function(e){return s._matchCondition(e,t)}))return!0}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return!1},e._matchCondition=function(e,t){switch(e.unit){case"event":return this._matchEventBasedCondition(e);case"user_metadata":case"user":case"device":return this._matchUserPropertyBasedCondition(e,t)}},e._matchEventBasedCondition=function(e){var t,r=e.event,n=e.event_c
1ondition_type,i=e.operator,a=e.secondary_value,o=e.value;if("number"!=typeof o||o<0)return!1;if("count X"===n)t=e2.eventIntermediateCounts.reduce(function(e,t){return t.name===r?e+t.count:e},0);else{if("count X in Y days"!==n)return!1;t=e2.eventIntermediateCounts.filter(function(e){return e.name===r}).filter(function(e){var t=tp(-a),r=tp();return e.dt>=t&&e.dt<=r}).map(function(e){return e.count}).reduce(function(e,t){return e+t},0)}var s=t;switch(i){case"=":return s===o;case">":return s>o;case">=":return s>=o;case"<":return s<o;case"<=":return s<=o;default:return!1}},e._matchUserPropertyBasedCondition=function(e,t){var r,n=e.unit,i=e.attribute,a=e.operator,o=e.useEventParamsAsConditionValue,s=e.comparison_parameter,l=e.valueType,u=this._extractUserAttribute(n,e2.userData,i);if("IS_NULL"===a)return t_(u);if("IS_NOT_NULL"===a)return!t_(u);if(!l||t_(r=o?t[s]:e.value))return!1;if(t_(u))if("<>"===a)return!0;else return!1;switch(a){case"=":return th.IsEqual(u,r,l);case"<>":return th.IsNotEqual(u,r,l);case">":return th.IsGreaterThan(u,r,l);case">=":return th.IsGreaterThanOrEqual(u,r,l);case"<":return th.IsLessThan(u,r,l);case"<=":return th.IsLessThanOrEqual(u,r,l);case"@>":return th.HasElement(u,r,l);case"NOT_INCLUDE":return th.DoesNotHaveElement(u,r,l);default:return console.warn("[Notifly] Invalid operator - ".concat(a)),!1}},e._extractUserAttribute=function(e,t,r){var n,i;switch(e){case"user":return null!=(i=null==(n=t.user_properties)?void 0:n[r])?i:null;case"user_metadata":case"device":return t[r];default:return null}},e.isEntityOfSegment=e._isEntityOfSegment,e.isEventApplicableForCampaign=e._isEventApplicableForCampaign,e.getCampaignsToSchedule=e._getCampaignsToSchedule,e}(),ty=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/La_Rioja","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Ciudad_Juarez","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/Ne
1w_York","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Katmandu","Asia/Khandyga","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis"];function tb(e){return ty.includes(e)}var tE=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},tw=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},tS=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o};(l=m||(m={})).SESSION_START="session_start",l.SET_USER_PROPERTIES="set_user_properties",l.REMOVE_
1EXTERNAL_USER_ID="remove_external_user_id",l.IN_WEB_MESSAGE_SHOW="in_web_message_show",l.MAIN_BUTTON_CLICK="main_button_click",l.CLOSE_BUTTON_CLICK="close_button_click",l.HIDE_IN_WEB_MESSAGE="hide_in_web_message";var tA=function(){function e(){}return e.logEvent=function(e,t){return tE(this,arguments,void 0,function(e,t,r,n){return void 0===r&&(r=null),void 0===n&&(n=!1),tw(this,function(i){switch(i.label){case 0:return[4,this._logEvent(e,t,r,n)];case 1:return i.sent(),[2]}})})},e.sessionStart=function(){return tE(this,void 0,void 0,function(){var t;return tw(this,function(r){switch(r.label){case 0:var n;return t="u"<typeof Notification?-1:"denied"===(n=Notification.permission)?0:"granted"===n?1:-1,[4,e.logEvent(m.SESSION_START,{notif_auth_status:t,timezone:"u"<typeof Intl||void 0===Intl.DateTimeFormat?null:Intl.DateTimeFormat().resolvedOptions().timeZone},null,!0)];case 1:return[2,r.sent()]}})})},e._logEvent=function(e,t){return tE(this,arguments,void 0,function(e,t,r,n){var i,a,o,s,l,u;return void 0===r&&(r=null),void 0===n&&(n=!1),tw(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),[4,eN.getItems([_.PROJECT_ID,_.NOTIFLY_DEVICE_ID,_.EXTERNAL_USER_ID])];case 1:if(a=(i=tS.apply(void 0,[c.sent(),3]))[0],o=i[1],s=i[2],!a||!o)throw Error("Notifly storage is not initialized");if(l=ex(a,s,o),!a)throw Error("Project ID should be set before logging an event.");return u={id:(0,V.v4)().replace(/-/g,""),project_id:a,name:e,event_params:t,is_internal_event:n,segmentation_event_param_keys:r,sdk_version:ek.version,sdk_type:ek.type,time:window.performance&&"now"in window.performance&&"timeOrigin"in window.performance?Math.floor((window.performance.now()+window.performance.timeOrigin)*1e3):1e3*Date.now(),platform:eI()},l&&(u.notifly_user_id=l),o&&(u.notifly_device_id=o),s&&(u.external_user_id=s),ek.source&&(u.source=ek.source),this._assertEventValidity(u),[4,ez.call("https://e.notifly.tech/records","POST",{records:[{data:JSON.stringify(u),partitionKey:l}]},"follow")];case 2:return c.sent(),tm.maybeTriggerWebMessagesAndUpdateEventCounts(n?"notifly__".concat(e):e,t,s,r),[3,4];case 3:return console.error("[Notifly] Error logging event",c.sent()),[3,4];case 4:return[2]}})})},e._assertEventValidity=function(e){var t=e.name,r=e.is_internal_event,n=e.project_id,i=e.notifly_user_id,a=e.notifly_device_id,o=e.external_user_id;if(r&&t===m.REMOVE_EXTERNAL_USER_ID&&o)throw Error('external user ID must be removed before "remove_external_user_id" event.');if(i!==ex(n,o,a))throw Error("Notifly user ID is not synchronized with external user ID.")},e}(),tx=Object.freeze({KO:"ko",EN:"en",JA:"ja",ZH:"zh"}),tI=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},tk=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},tC=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};(y||(y={})).NAVIGATE_TO_URL="__notifly_navigate_to_url";var tT={color:"#1f2937",text:{ko:"푸시 알림 받기",en:"Receive Push Notifications",ja:"プッシュ通知を受け取る",zh:"接收推送通知"}},tO={color:"#374151",text:{ko:"푸시 알림을 허용하고 중요한 정보를 실시간으로 받아보세요! ",en:"Allow push notifications and receive important information in real-time!",ja:"プッシュ通知を許可し、リアルタイムで重要な情報を受け取りましょう!",zh:"允许推送通知并实时接收重要信息!"}},tD={backgroundColor:"#2563eb",backgroundHoverColor:"#1d4ed8",color:"#ffffff",text:{ko:"알림 받기",en:"Receive Notifications",ja:"通知を受け取る",zh:"接收通知"}},tP={backgroundColor:"#27272a",backgroundHoverColor:"#334155",color:"#ffffff",text:{ko:"다음에",en:"Not Now",ja:"今は結構です",zh:"暂不"}},tj="http://www.w3.org/2000/svg",tR=function(){function e(){}return e.initialize=function(e){return tI(this,arguments,void 0,function(e,t,r,n,i,a){var o,s;return void 0===t&&(t=!0),void 0===r&&(r="/notifly-service-worker.js"),void 0===n&&(n=5e3),void 0===i&&(i=tx.EN),tk(this,function(l){switch(l.label){case 0:if(l.trys.push([0,4,,5]),this._isInitialized||!this._isWebPushSupported())return[2];return[4,navigator.serviceWorker.register(r)];case 1:if("pushManager"in(o=l.sent())==!1)return console.warn("[Notifly] Push notification is not supported in this browser."),[2];return this._serviceWorkerRegistration=o,this._vapidPublicKey=e,this._askPermission=t,n<0?console.warn("[Notifly] Invalid prompt delay. Defaulting to 5000 milliseconds."):this._promptDelayMillis=n,0>Object.values(tx).indexOf(i)?console.warn("[Notifly] Invalid default language. Defaulting to English."):this._promptDefaultLanguage=i,this._promptDesignParams=a,s=this,[4,eN.getItem(_.NOTIFLY_NOTIFICATION_PERMISSION)];case 2:return s._notiflyNotificationPermission=l.sent(),this._setupServiceWorkerEventListener(),[4,this._maybeLogSubscription()];case 3:return l.sent(),this._maybeScheduleRequestPermissionPrompt(),this._isInitialized=!0,[3,5];case 4:return console.error("[Notifly] Failed to initialize PushManager: ",l.sent()),[3,5];case 5:return[2]}})})},e.requestPermission=function(e){this._isInitialized?this._canManuallyShowPermissionRequestPrompt()&&this._showRequestPermissionPrompt(e):console.error("[Notifly] PushManager is not initialized.")},e._isWebPushSupported=function(){return"u"<typeof Notification?(console.warn("[Notifly] Notification is not supported in this browser."),!1):"u"<typeof navigator||"serviceWorker"in navigator==!1?(console.warn("[Notifly] Service worker is not supported in this browser."),!1):"function"==typeof navigator.serviceWorker.register||(console.warn("[Notifly] Service worker registration is not supported in this browser."),!1)},e._setupServiceWorkerEventListener=function(){navigator.serviceWorker.addEventListener("message",function(e){e.data.action===y.NAVIGATE_TO_URL&&e.data.url&&(window.location.href=e.data.url)})},e._maybeLogSubscription=function(){return tI(this,void 0,void 0,function(){var e;return tk(this,function(t){switch(t.label){case 0:if("granted"!==Notification.permission)return[3,3];return[4,this._getSubscription()];case 1:return e=t.sent(),[4,this._logSubscription(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},e._canAutomaticallyShowPermissionRequestPrompt=function(){return this._askPermission&&"default"===Notification.permission&&"denied"!==this._notiflyNotificationPermission},e._canManuallyShowPermissionRequestPrompt=function(){return this._askPermission?(console.warn("[Notifly] Can't manually show permission request prompt when askPermission is true."),!1):"default"===Notification.permission&&"denied"!==this._notiflyNotificationPermission},e._getSubscription=function(){return tI(this,void 0,void 0,function(){var e,t,r;return tk(this,function(n){switch(n.label){case 0:if(!this._serviceWorkerRegistration||null==this._vapidPublicKey)throw Error("[Notifly] _get
1Subscription() was called before initialization.");return[4,(e=this._serviceWorkerRegistration).pushManager.getSubscription()];case 1:if(t=n.sent())return[2,t];return r=this._urlBase64ToUint8Array(this._vapidPublicKey),[2,e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:r})]}})})},e._logSubscription=function(e){return tI(this,void 0,void 0,function(){return tk(this,function(t){switch(t.label){case 0:return[4,tA.logEvent("set_device_properties",{device_token:JSON.stringify(e)},null,!0)];case 1:return[2,t.sent()]}})})},e._urlBase64ToUint8Array=function(e){for(var t="=".repeat((4-e.length%4)%4),r=(e+t).replace(/-/g,"+").replace(/_/g,"/"),n=window.atob(r),i=new Uint8Array(n.length),a=0;a<n.length;++a)i[a]=n.charCodeAt(a);return i},e._maybeScheduleRequestPermissionPrompt=function(){var e=this;this._canAutomaticallyShowPermissionRequestPrompt()&&setTimeout(function(){if("loading"===document.readyState){var t=function(){e._showRequestPermissionPrompt(),window.removeEventListener("DOMContentLoaded",t)};window.addEventListener("DOMContentLoaded",t)}else e._showRequestPermissionPrompt()},this._promptDelayMillis)},e._generateElementId=function(e){return"".concat("__notifly_push_prompt_").concat(e)},e._createOverlay=function(){var e=document.createElement("div");return e.id=this._generateElementId("overlay"),e.style.position="fixed",e.style.top="10px",e.style.right="10px",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.zIndex="9999",e.style.width="350px",e.style.maxWidth="50%",e},e._createPopup=function(e,t){var r=document.createElement("div");return r.id=this._generateElementId("popup"),r.style.position="relative",r.style.paddingTop="10px",r.style.paddingRight="18px",r.style.paddingBottom="18px",r.style.paddingLeft="20px",r.style.backgroundColor=e||"#ffffff",r.style.border="1px solid ".concat(t||"#d3d3d3"),r.style.borderRadius="8px",r.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",r},e._createBellIcon=function(e){var t=document.createElementNS(tj,"svg"),r="--notifly-bell-icon",n=document.createElement("style"),i="--notifly-bell-icon-animation";return n.innerHTML="\n        @keyframes ".concat(i," {\n            0% { transform: rotateZ(0deg); }\n            12.5% { transform: rotateZ(-5deg); }\n            25% { transform: rotateZ(-7deg); }\n            37.5% { transform: rotateZ(-5deg); }\n            50% { transform: rotateZ(0deg); }\n            62.5% { transform: rotateZ(5deg); }\n            75% { transform: rotateZ(7deg); }\n            87.5% { transform: rotateZ(5deg); }\n            100% { transform: rotateZ(0deg); }\n        }\n        "),document.head.appendChild(n),t.setAttribute("xmlns",tj),t.setAttribute("viewBox","0 0 48 48"),t.style.width="21px",t.style.height="21px",t.innerHTML="\n        <defs>\n          <style>.".concat(r,"{fill:").concat(e||"#eab308",';}</style>\n        </defs>\n        <path class="').concat(r,'" d="M24,44a6,6,0,0,0,5.67-4H18.33A6,6,0,0,0,24,44Z"/>\n        <path class="').concat(r,'" d="M39.38,35.26,38,31.81V22A14,14,0,0,0,26.71,8.27a3,3,0,1,0-5.42,0A14,14,0,0,0,10,22v9.81L8.62,35.26A2,2,0,0,0,10.48,38h27a2,2,0,0,0,1.86-2.74Z"/>\n          '),t.style.animation="".concat(i," 0.6s ease-in-out infinite"),t.style.transformOrigin="top center",{bellIcon:t,keyframes:n}},e._createCloseButton=function(e){var t=document.createElementNS(tj,"svg");return t.style.position="absolute",t.style.right="8px",t.style.top="8px",t.style.cursor="pointer",t.setAttribute("xmlns",tj),t.setAttribute("viewBox","0 0 24 24"),t.style.width="18px",t.style.height="18px",t.innerHTML='\n        <path d="M17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289Z" fill="'.concat(e,'"/>\n        '),t},e._createButton=function(e){var t=e.params,r=e.languageToForce,n=e.defaultParams,i=document.createElement("button");return i.style.padding="5px 15px",i.style.margin="0px",i.style.border="none",i.style.backgroundColor=(null==t?void 0:t.backgroundColor)||n.backgroundColor,i.style.color=(null==t?void 0:t.color)||n.color,i.style.fontWeight="500",i.style.cursor="pointer",i.style.borderRadius="5px",i.addEventListener("mouseover",function(){i.style.backgroundColor=(null==t?void 0:t.backgroundHoverColor)||n.backgroundHoverColor}),i.addEventListener("mouseout",function(){i.style.backgroundColor=(null==t?void 0:t.backgroundColor)||n.backgroundColor}),i.style.fontSize="13.5px",i.style.letterSpacing="-0.3px",i.textContent=this._optTextByPreferredLanguage({textContent:null==t?void 0:t.text,languageToForce:r,defaultTextContent:n.text}),i},e._createHeader=function(e){var t=e.params,r=e.languageToForce,n=e.defaultParams,i=document.createElement("h2");return i.style.fontSize="17px",i.style.color=(null==t?void 0:t.color)||n.color,i.style.letterSpacing="-0.5px",i.style.fontWeight="800",i.style.marginLeft="6px",
1i.style.marginTop="0px",i.style.marginBottom="0px",i.textContent=this._optTextByPreferredLanguage({textContent:null==t?void 0:t.text,languageToForce:r,defaultTextContent:n.text}),i},e._createMessage=function(e){var t=e.params,r=e.languageToForce,n=e.defaultParams,i=document.createElement("p");return i.style.padding="0px",i.style.marginTop="8px",i.style.marginBottom="16px",i.style.marginLeft="0px",i.style.marginRight="0px",i.style.fontSize="15px",i.style.fontWeight="400",i.style.color=(null==t?void 0:t.color)||n.color,i.style.lineHeight="1.3",i.style.letterSpacing="-0.3px",i.textContent=this._optTextByPreferredLanguage({textContent:null==t?void 0:t.text,languageToForce:r,defaultTextContent:n.text}),i},e._showRequestPermissionPrompt=function(e){var t,r,n,i,a,o,s,l,u=this;if(this._isInitialized&&!this._isRequestPermissionPromptBeingShown){this._isRequestPermissionPromptBeingShown=!0;var c=this._createOverlay(),d=this._createPopup(null==(t=this._promptDesignParams)?void 0:t.backgroundColor,null==(r=this._promptDesignParams)?void 0:r.borderColor),h=document.createElement("div");h.style.display="flex",h.style.justifyContent="start",h.style.alignItems="center",h.style.marginTop="10px",h.style.marginBottom="5px",h.style.marginLeft="0px",h.style.marginRight="0px";var f=document.createElement("div");f.style.display="flex",f.style.justifyContent="flex-end",f.style.gap="6px";var p=this._createBellIcon(null==(n=this._promptDesignParams)?void 0:n.bellIconColor),g=p.bellIcon,v=p.keyframes,m=this._createCloseButton(null==(i=this._promptDesignParams)?void 0:i.closeButtonColor),y=this._createHeader({params:null==(a=this._promptDesignParams)?void 0:a.headerDesign,languageToForce:e,defaultParams:tT}),b=this._createMessage({params:null==(o=this._promptDesignParams)?void 0:o.messageDesign,languageToForce:e,defaultParams:tO}),E=this._createButton({params:null==(s=this._promptDesignParams)?void 0:s.grantButtonDesign,languageToForce:e,defaultParams:tD}),w=this._createButton({params:null==(l=this._promptDesignParams)?void 0:l.denyButtonDesign,languageToForce:e,defaultParams:tP}),S=function(){u._isRequestPermissionPromptBeingShown=!0,document.body.removeChild(c);try{document.head.removeChild(v)}catch(e){}},A=function(){console.info("[Notifly] Notification permission was not granted."),eN.setItem(_.NOTIFLY_NOTIFICATION_PERMISSION,"denied").catch(function(e){return console.error("[Notifly] Failed to set notification permission to denied: ",e)}).finally(S)};E.onclick=(function(){S(),Notification.requestPermission().then(function(e){"granted"!==e?console.info("[Notifly] Notification permission was not granted."):u._getSubscription().then(function(e){return u._logSubscription(e)}).catch(function(e){return console.error("[Notifly] Failed to subscribe push notification: ",e)})})}).bind(this),w.onclick=A,m.onclick=A,[y,b,E,w].forEach(function(e){e.style.setProperty("font-family","'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif","important")}),c.appendChild(d),h.appendChild(g),h.appendChild(y),d.appendChild(h),d.appendChild(b),f.appendChild(E),f.appendChild(w),d.appendChild(m),d.appendChild(f),document.body.appendChild(c)}},e._optTextByPreferredLanguage=function(e){var t,r,n=e.textContent,i=e.languageToForce,a=e.defaultTextContent;if(i)return(null==n?void 0:n[i])||a[i];var o=(null==navigator?void 0:navigator.language)||null,s=(null==n?void 0:n[this._promptDefaultLanguage])||a[this._promptDefaultLanguage];if(!o)return s;try{for(var l=tC(Object.values(tx)),u=l.next();!u.done;u=l.next()){var c=u.value;if(o.startsWith(c))return(null==n?void 0:n[c])||a[c]}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return s},e._isInitialized=!1,e._isRequestPermissionPromptBeingShown=!1,e._notiflyNotificationPermission=null,e._serviceWorkerRegistration=null,e._vapidPublicKey=null,e._askPermission=!0,e._promptDelayMillis=5e3,e._promptDefaultLanguage=tx.EN,e}();(u=b||(b={}))[u.SET_USER_ID=0]="SET_USER_ID",u[u.SET_USER_PROPERTIES=1]="SET_USER_PROPERTIES",u[u.TRACK_EVENT=2]="TRACK_EVENT",u[u.REQUEST_PERMISSON=3]="REQUEST_PERMISSON",u[u.GET_USER_ID=4]="GET_USER_ID",u[u.GET_USER_PROPERTIES=5]="GET_USER_PROPERTIES";var tN=function(){function e(e){this.type=b.SET_USER_ID,this.unrecoverable=!0,this._params=e}return e.prototype.execute=function(){var e=this._params,t=e.userId,r=e.options;return to.setUserId.call(to,t,r)},e}(),tL=function(){function e(e){this.type=b.SET_USER_ID,this.unrecoverable=!0,this._params=e}return e.prototype.execute=function(){var e=this._params.options;return to.setUserId.call(to,null,e)},e}(),tM=function(){function e(e){this.type=b.SET_USER_PROPERTIES,this.unrecoverable=!1,this._params=e}return e.prototype.execute=function(){var e=this._params.params;return to.setUserProperties.call(to,e)},e}(),tU=function(){function e(e){this.type=b.TRACK_EVENT,this.unrecoverable=!1,this._params=e}return e.prototype.execute=function(){var e=this._params,t=e.eventName,r=e.eventParam
1s,n=e.segmentationEventParamKeys;return tA.logEvent.call(tA,t,r,n)},e}(),tF=function(){function e(e){this.type=b.REQUEST_PERMISSON,this.unrecoverable=!1,this._languageToForce=e}return e.prototype.execute=function(){return Promise.resolve(tR.requestPermission.call(tR,this._languageToForce))},e}(),tB=function(){function e(){this.type=b.GET_USER_ID,this.unrecoverable=!1}return e.prototype.execute=function(){return to.getUserId.call(to)},e}(),tK=function(){function e(){this.type=b.GET_USER_PROPERTIES,this.unrecoverable=!1}return e.prototype.execute=function(){return to.getUserProperties.call(to)},e}(),tz=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},tW=function(){function e(){this.heap=[]}return e.prototype.size=function(){return this.heap.length},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.enqueue=function(e){this.heap.push(e),this.bubbleUp(this.size()-1)},e.prototype.dequeue=function(){if(this.isEmpty())return null;if(1===this.size())return this.heap.pop();var e=this.heap[0];return this.heap[0]=this.heap.pop(),this.sinkDown(0),e},e.prototype.peek=function(){return this.isEmpty()?void 0:this.heap[0]},e.prototype.clear=function(){this.heap=[]},e.prototype.bubbleUp=function(e){var t=Math.floor((e-1)/2);t>=0&&0>this.compare(e,t)&&(this.swap(e,t),this.bubbleUp(t))},e.prototype.sinkDown=function(e){var t=2*e+1,r=2*e+2,n=e;t<this.size()&&0>this.compare(t,n)&&(n=t),r<this.size()&&0>this.compare(r,n)&&(n=r),n!==e&&(this.swap(e,n),this.sinkDown(n))},e.prototype.compare=function(e,t){return this.heap[e].compareTo(this.heap[t])},e.prototype.swap=function(e,t){var r;r=tz([this.heap[t],this.heap[e]],2),this.heap[e]=r[0],this.heap[t]=r[1]},e}(),tV=(c=function(e,t){return(c=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),tG=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},tq=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},t$=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tH=function(){function e(e,t,r){this.command=e,this.resolver=t,this.rejecter=r}return e.prototype.abort=function(){this.rejecter("Command aborted.")},e}(),tJ=function(e){function t(t,r,n,i){var a=e.call(this,t,r,n)||this;return a._priority=i,a}return tV(t,e),t.prototype.compareTo=function(e){return this._priority-e._priority},t}(tH),tQ=function(){function e(){this._activeCommands=[],this._pendingCommandsQueue=new tW,this._currentPriority=0,this._isFlushing=!1,ek.registerObserver(this)}return e.getInstance=function(){return e._instance||(e._instance=new e),e._instance},e.prototype.onInitialized=function(){this._flush()},e.prototype.onRefreshCompleted=function(){this._flush()},e.prototype.onTerminated=function(){this._abortAll()},e.prototype.dispatch=function(e){return tG(this,void 0,void 0,function(){return tq(this,function(t){if(this._isFlushing)return[2,this._getPendingCommandPromise(e)];switch(ek.state){case f.TERMINATED:throw Error("[Notifly] Notifly SDK is terminated. Ingnoring command.");case f.FAILED:throw Error("[Notifly] Notifly SDK has failed to operate. Cannot execute command ".concat(e.type));case f.NOT_INITIALIZED:console.info("[Notifly] Notifly SDK is not initialized. Requested command will be executed as soon as the SDK is initialized.");case f.REFRESHING:return[2,this._getPendingCommandPromise(e)];case f.READY:return[2,this._getInstantCommandPromise(e)]}return[2]})})},e.prototype._flush=function(){return tG(this,void 0,void 0,function(){var e,t,r;return tq(this,function(n){switch(n.label){case 0:this._isFlushing=!0,n.label=1;
1case 1:if(this._pendingCommandsQueue.isEmpty())return[3,8];if(ek.state!==f.READY)return console.error("[Notifly] Unexpected SDK state ".concat(ek.state,". Cannot flush command queue.")),this._isFlushing=!1,[2];if(!(e=this._pendingCommandsQueue.dequeue()))return[3,7];e.command.type===b.SET_USER_ID&&(ek.state=f.REFRESHING),n.label=2;case 2:return n.trys.push([2,4,5,6]),[4,e.command.execute()];case 3:return t=n.sent(),e.resolver(t),[3,6];case 4:return r=n.sent(),this._handleCommandError(e,r)&&(this._isFlushing=!1),[2];case 5:return this._removeCommand(e),[7];case 6:if(e.command.type===b.SET_USER_ID)return ek.state=f.READY,[2];n.label=7;case 7:return[3,1];case 8:if(this._pendingCommandsQueue.isEmpty())return[3,10];return[4,this._flush()];case 9:n.sent(),n.label=10;case 10:return this._isFlushing=!1,[2]}})})},e.prototype._getInstantCommandPromise=function(e){return tG(this,void 0,void 0,function(){var t=this;return tq(this,function(r){return[2,new Promise(function(r,n){var i=new tH(e,r,n);t._activeCommands.push(i);var a=e.type===b.SET_USER_ID;a&&(ek.state=f.REFRESHING),e.execute().then(function(e){a&&(ek.state=f.READY),r(e)}).catch(function(e){t._handleCommandError(i,e)}).finally(function(){t._removeCommand(i)})})]})})},e.prototype._getPendingCommandPromise=function(e){return tG(this,void 0,void 0,function(){var t=this;return tq(this,function(r){return[2,new Promise(function(r,n){var i=new tJ(e,r,n,t._currentPriority++);t._activeCommands.push(i),t._pendingCommandsQueue.enqueue(i)})]})})},e.prototype._removeCommand=function(e){return tG(this,void 0,void 0,function(){var t;return tq(this,function(r){return -1!==(t=this._activeCommands.indexOf(e))&&this._activeCommands.splice(t,1),[2]})})},e.prototype._abortAll=function(){return tG(this,void 0,void 0,function(){var e,t,r,n;return tq(this,function(i){try{for(t=(e=t$(this._activeCommands)).next();!t.done;t=e.next())t.value.abort()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return this._activeCommands=[],this._pendingCommandsQueue.clear(),[2]})})},e.prototype._handleCommandError=function(e,t){return ek.state===f.TERMINATED||(e.command.unrecoverable&&(ek.state=f.FAILED),e.rejecter(t),e.command.unrecoverable)},e}(),tX=function(){return(tX=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},tY=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},tZ=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},t0=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},t1=function(){function e(){}return e.initialize=function(){return tZ(this,void 0,void 0,function(){var e,t,r;return t0(this,function(n){switch(n.label){case 0:return t=parseInt,[4,eN.getItem(_.LAST_SESSION_TIME)];case 1:return!(e=t.apply(void 0,[n.sent()||"0",10]))||isNaN(e)?this._lastSessionTime=null:this._lastSessionTime=e,r=this,[4,function(){var e,t,r,n;return e=this,t=void 0,r=void 0,n=function(){var e,t,r,n,i,a,o,s,l,u,c,d,h,f;return tY(this,function(p){switch(p.label){case 0:return[4,eN.getItem(_.PROJECT_ID)];case 1:if(!(e=p.sent()))throw Error("Project ID not found. Did you forget to call Notifly.initialize()?");return[4,fetch("https://api.notifly.tech/sdk-configurations?project_id=".concat(e,"&type=website"),{method:"GET",headers:{"X-Notifly-SDK-Version":"notifly/js/".concat(ek.getSdkVersion())}})];case 2:if(!(t=p.sent()).ok)throw Error("Failed to get SDK configuration.");return[4,t.json()];case 3:if(n=(r=p.sent()).data,i=r.error)throw Error(i);if(!(a={sessionDuration:n.session_duration||1800,useWebPush:!!n.use_web_push}).useWebPush)return[2,a];if(!n.web_push_options)throw Error("Invalid configuration: web push options should be set when use_web_push is true");if(s=(o=n.web_push_options).vapid_public_key,l=o.ask_permission,u=o.service_worker_path,c=o.prompt_delay_millis,d=o.prompt_default_language,h=o.prompt_design_params,!s)throw Error("Invalid configuration: vapid_public_key is required");return f={vapidPublicKey:s,askPermission:!!l,serviceWorkerPath:u||"/notifly-service-worker.js",promptDelayMillis:c,promptDefaultLanguage:d,promptDesignParams:h},[2,tX(tX({},a),{webPushOptions:f})]}})},new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})}()];case 2:return r._sdkConfiguration=n.sent(),[4,tm.initialize(this._isSessionExpired())];case 3:return n.sent(),[4,this._initializePushManager()];case 4:return n.sent(),[4,this._maybeStartSession()];case 5:return n.sent(),[4,this._initializeInternal()];case 6:return n.sent(),[2]}})})},e.saveLastSessionTime=function(){return tZ(this,void 0,void 0,function(){var e;return t0(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=Math.floor(Date.now()/1e3),this._lastSessionTime=e,[4,eN.setItem(_.LAST_SESSION_TIME,e.toString())];case 1:case 2:return t.sent(),[3,3];case 3:return[2]}})})},e.onWindowFocus=function(){this._storageSaverIntervalId&&(clearInterval(this._storageSaverIntervalId),this._storageSaverIntervalId=null),this._storageSaverIntervalId=setInterval(this.saveLastSessionTime.bind(this),5e3),this._maybeRefreshSession().catch(function(e){console.error("[Notifly] Failed to refresh session",e)})},e.onWindowUnfocus=function(){this._storageSaverIntervalId&&(clearInterval(this._storageSaverIntervalId),this._storageSaverIntervalId=null)},e._isSessionExpired=function(){return!this._lastSessionTime||!this._sdkConfiguration||Math.floor(Date.now()/1e3)>this._lastSessionTime+this._sdkConfiguration.sessionDuration},e._maybeStartSession=function(){return tZ(this,void 0,void 0,function(){return t0(this,function(e){switch(e.label){case 0:if(!this._isSessionExpired())return[3,2];return[4,tA.sessionStart()];case 1:e.sent(),e.label=2;case 2:return[2]}})})},e._maybeRefreshSession=function(){return tZ(this,void 0,void 0,function(){return t0(this,function(e){switch(e.label){case 0:if(!this._isSessionExpired())return[3,4];return[4,this.saveLastSessionTime()];case 1:return e.sent(),[4,tA.sessionStart()];case 2:return e.sent(),[4,e2.refresh()];case 3:e.sent(),e.label=4;case 4:return[2]}})})},e._initializePushManager=function(){return tZ(this,void 0,void 0,function(){var e,t,r,n,i,a,o;return t0(this,function(s){switch(s.label){case 0:if(!this._sdkConfiguration||!this._sdkConfiguration.useWebPush||!this._sdkConfiguration.webPushOptions)return[2];return t=(e=this._sdkConfiguration.webPushOptions).vapidPublicKey,r=e.askPermission,n=e.serviceWorkerPath,i=e.promptDelayMillis,a=e.promptDefaultLanguage,o=e.promptDesignParams,[4,tR.initialize(t,r,n,i,a,o)];case 1:return s.sent(),[2]}})})},e._initializeInternal=function(){return tZ(this,void 0,void 0,function(){var e=this;return t0(this,function(t){switch(t.label){case 0:return[4,this.saveLastSessionTime()];case 1:return t.sent(),document.hasFocus()&&(this._storageSaverIntervalId=setInterval(this.saveLastSessionTime.bind(this),5e3)),window.addEventListener("focus",this.onWindowFocus.bind(this)),window.addEventListener("blur",this.onWindowUnfocus.bind(this)),window.addEventListener("beforeunload",this.onWindowUnfocus.bind(this)),window.addEventListener("pagehide",function(t){t.persisted&&e.onWindowUnfocus.call(e)}),[2]}})})},e._lastSessionTime=null,e._storageSaverIntervalId=null,e}(),t2=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})},t3=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},t4=!1;function t5(e){return t2(this,void 0,void 0,function(){var t,r;return t3(this,function(n){switch(n.label){case 0:if(ek.halted)return console.warn("[Notifly] SDK has been stopped due to the unrecoverable error or termination. Ignoring..."),[2];if(0===Object.keys(e).length)return console.warn("[Notifly] No user properties provided. Ignoring..."),[2];if((t=e[h.TIMEZONE])&&!tb(t)){var i;return console.warn("[Notifly] Invalid timezone identifier. Ignoring timezone property."),[2,t5((i=[h.TIMEZONE],Object.keys(e).reduce(function(t,r){return i.includes(r)||(t[r]=e[r]),t},{})))]}n.label=1;case 1:return n.trys.push([1,3,,4]),[4,tQ.getInstance().dispatch(new tM({params:e}))];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),(ek.halted?console.warn:console.error)("[Notifly] Error setting user properties: ",r),[3,4];case 4:return[2]}})})}let t6={initialize:function(e){return t2(this,void 0,void 0,function(){var t,r,n,i,a,o;return t3(this,function(s){switch(s.label){case 0:var l;if(t4)return console.warn("[Notifly] Notifly SDK is being initialized more than once. Ignoring this call."),[2,!1];if(ek.state!==f.NOT_INITIALIZED)if(ek.state===f.READY||ek.state===f.REFRESHING)return console.warn("[Notifly] Notifly SDK is already initialized. Ignoring this call."),[2,!0];else return console.error("[Notifly] Encountered unexpected SDK state: ".concat(ek.state)),[2,!1];if(t4=!0,t=function(){return t4=!1,ek.state=f.FAILED,!1},r=function(){return t4=!1,ek.state=f.READY,!0},"u"<typeof window)return console.error("[Notifly] The SDK requires a browser environment to function properly. Please ensure that you are using the SDK within a supported browser environment."),[2,t()];if(n=e.projectId,i=e.username,a=e.password,o=e.allowUserSuppliedLogEvent,l=n,!/^(?:[0-9a-fA-F]{32})$/.test(l))return console.error("[Notifly] Invalid project ID. Please provide a valid project ID."),[2,t()];if(!i||!a)return console.error("[Notifly] username and password must not be empty"),[2,t()];ek.setAllowUserSuppliedLogEvent(o),window.addEventListener("beforeunload",function(){ek.state=f.TERMINATED}),window.addEventListener("pagehide",function(e){e.persisted&&(ek.state=f.TERMINATED)}),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,function(e,t,r){var n,i,a,o;return n=this,i=void 0,a=void 0,o=function(){var n,i;return eA(this,function(a){switch(a.label){case 0:return[4,eN.ensureInitialized()];case 1:return a.sent(),(i={})[_.PROJECT_ID]=e,i[_.USERNAME]=t,i[_.PASSWORD]=r,n=i,[4,eN.getItem(_.NOTIFLY_DEVICE_ID)];case 2:return a.sent()||(n[_.NOTIFLY_DEVICE_ID]=(0,V.v4)()),[4,eN.setItems(n)];case 3:return a.sent(),[2]}})},new(a||(a=Promise))(function(e,t){function r(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof a?n:new a(function(e){e(n)})).then(r,s)}l((o=o.apply(n,i||[])).next())})}(n,i,a)];case 2:return s.sent(),[4,ez.initialize()];case 3:return s.sent(),[4,t1.initialize()];case 4:return s.sent(),[2,r()];case 5:return console.error("[Notifly] Error initializing SDK: ",s.sent()),[2,t()];case 6:return[2]}})})},trackEvent:function(e){return t2(this,arguments,void 0,function(e,t,r){var n;return void 0===t&&(t={}),void 0===r&&(r=null),t3(this,function(i){switch(i.label){case 0:if(ek.halted)return console.warn("[Notifly] SDK has been stopped due to the unrecoverable error or termination. Ignoring..."),[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,tQ.getInstance().dispatch(new tU({eventName:e,eventParam
1s:t,segmentationEventParamKeys:r}))];case 2:return i.sent(),[3,4];case 3:return n=i.sent(),(ek.halted?console.warn:console.error)("[Notifly] Error tracking event: ",n),[3,4];case 4:return[2]}})})},setUserId:function(e,t){return t2(this,void 0,void 0,function(){var r;return t3(this,function(n){switch(n.label){case 0:if(ek.halted)return console.warn("[Notifly] SDK has been stopped due to the unrecoverable error or termination. Ignoring..."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,tQ.getInstance().dispatch(new tN({userId:e,options:t}))];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),(ek.halted?console.warn:console.error)("[Notifly] Error setting user ID: ",r),[3,4];case 4:return[2]}})})},removeUserId:function(e){return t2(this,void 0,void 0,function(){var t;return t3(this,function(r){switch(r.label){case 0:if(ek.halted)return console.warn("[Notifly] SDK has been stopped due to the unrecoverable error or termination. Ignoring..."),[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,tQ.getInstance().dispatch(new tL({options:e}))];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),(ek.halted?console.warn:console.error)("[Notifly] Error removing user ID: ",t),[3,4];case 4:return[2]}})})},setUserProperties:t5,setEmail:function(e){return t2(this,void 0,void 0,function(){var t;return t3(this,function(r){return(null==e?void 0:e.trim())&&"string"==typeof e?t5(((t={})[h.EMAIL]=e.trim(),t)):console.error("[Notifly] Email must be a non-empty string"),[2]})})},setPhoneNumber:function(e){return t2(this,void 0,void 0,function(){var t;return t3(this,function(r){return(null==e?void 0:e.trim())&&"string"==typeof e?t5(((t={})[h.PHONE_NUMBER]=e.trim(),t)):console.error("[Notifly] Phone number must be a non-empty string"),[2]})})},setTimezone:function(e){return t2(this,void 0,void 0,function(){var t,r;return t3(this,function(n){return(null==e?void 0:e.trim())&&"string"==typeof e?tb(t=e.trim())?t5(((r={})[h.TIMEZONE]=t,r)):console.error("[Notifly] Invalid timezone identifier. Please provide a valid timezone identifier."):console.error("[Notifly] Timezone identifier must be a non-empty string"),[2]})})},getUserId:function(){return t2(this,void 0,void 0,function(){return t3(this,function(e){switch(e.label){case 0:if(ek.halted)throw Error("[Notifly] SDK has been stopped due to the unrecoverable error or termination.");return[4,tQ.getInstance().dispatch(new tB)];case 1:return[2,e.sent()]}})})},getUserProperties:function(){return t2(this,void 0,void 0,function(){return t3(this,function(e){switch(e.label){case 0:if(ek.halted)throw Error("[Notifly] SDK has been stopped due to the unrecoverable error or termination.");return[4,tQ.getInstance().dispatch(new tK)];case 1:return[2,e.sent()]}})})},requestPermission:function(e){return t2(this,void 0,void 0,function(){var t,r;return t3(this,function(n){switch(n.label){case 0:if(ek.halted)return console.warn("[Notifly] SDK has been stopped due to the unrecoverable error or termination. Ignoring..."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),t=e,void 0===e||Object.values(tx).includes(e)||(console.error("[Notifly] Invalid language provided. Requesting permission with browser preferred language."),t=void 0),[4,tQ.getInstance().dispatch(new tF(t))];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),(ek.halted?console.warn:console.error)("[Notifly] Failed to request permission",r),[3,4];case 4:return[2]}})})},setSdkType:function(e){ek.setSdkType(e)},setSdkVersion:function(e){ek.setSdkVersion(e)},setSource:function(e){ek.setSource(e)},getSdkVersion:function(){return ek.getSdkVersion()}},t7=()=>{let{data:e}=(0,I.useAtomValue)(k.viewerModel.viewerStatusAtom),t=e?.userUuid,r=(0,S.usePathname)(),n=(0,S.useSearchParams)(),i=(0,x.useRef)(null);return(0,x.useEffect)(()=>{t6.initialize({projectId:"08de250975905bf3bbc2ac98925a6faa",username:"rentre",password:"b89437c857b44d779cbfef74568810fb@A"})},[]),(0,x.useEffect)(()=>{t&&t6.setUserId(t)},[t]),(0,x.useEffect)(()=>{let e=window.location.href;i.current!==e&&(t6.trackEvent("pageview",{path:r,url:e}),i.current=e)},[r,n.toString()]),null};var t9=e.i(167605),t8=e.i(311111);let re=async(e,t)=>{let r=await (0,ed.getClientSession)();return(0,t8.axios)("api/user/deviceToken",{method:"patch",isNeedToken:!0,headers:{"Refresh-Token":`Bearer ${r?.token?.refreshToken}`},data:{deviceToken:e,platformType:t}}).then(e=>e)},rt=()=>{let[{data:e}]=(0,I.useAtom)(k.viewerModel.viewerStatusAtom),{onMessage:t,postMessage:r}=(0,q.useRNBridge)();return(0,x.useEffect)(()=>{"ios"==(0,t9.getPlatform)()&&r("REQ_APP_TRACKING_TRANSPARENCY"),r("REQ_CAMERA_PERMISSION"),r("REQ_NOTI_PERMISSION"),r("READY",!0);let e=t("REGISTER_DEVICE_TOKEN",async e=>{let t=await (0,ed.getClientSession)();e.deviceToken&&t&&((0,P.setCookie)("dt-uuid",e.deviceToken),re(e.deviceToken,(0,t9.getPlatform)()))}),n=e=>{if("string"!=typeof e||!e)return null;try{return new URL(e,window.location.origin)}catch{return null}},i=e=>e.href===window.location.href,a=t("ROUTE",e=>{let t=n(e);!t||i(t)||(window.location.href=t.href)}),o=t("REDIRECT",e=>{let t=n(e);!t||i(t)||(window.location.href=t.href)});return()=>{e(),o(),a()}},[]),(0,x.useEffect)(()=>
1{e?.userRoleString!="[ANONYMOUS]"&&r("REQ_DEVICE_TOKEN"),window.ReactNativeWebView&&r("BOOT_CHANNEL_TALK",e)},[e?.userUuid]),null};var rr=e.i(780484),rn=e.i(363633);let ri=()=>{let{data:e}=(0,I.useAtomValue)(k.viewerModel.viewerStatusAtom),[t,r]=(0,I.useAtom)(rn.statsigClientAtom),[n,i]=(0,I.useAtom)(rn.isStatsigReadyAtom);(0,I.useSetAtom)(rn.clearExperimentsCacheAtom);let a="production",o="client-S97wPFrBxrg8LzXjhDlRzkxSP16lRrE780BK50xkv2K",s=async()=>{if(!$.ampli.client||t)return;let e={userID:$.ampli.client?.getUserId()||void 0};try{let t=new rr.StatsigClient(o,e,{environment:{tier:a}});await t.initializeAsync(),r(t),i(!0)}catch(e){}};return(0,x.useEffect)(()=>{$.ampli.isLoaded&&$.ampli.client&&!t&&s()},[$.ampli.isLoaded,t]),(0,x.useEffect)(()=>{if(t&&n&&$.ampli.client){let e={userID:$.ampli.client?.getUserId()};t.updateUserSync(e)}},[e]),(0,x.useEffect)(()=>{if(n&&o&&1){if(document.getElementById("statsig-sidecar-script"))return;window.statsigOptions={environment:{tier:a}},window.statsigUser={userID:e?.userUuid||null};let t=document.createElement("script");t.id="statsig-sidecar-script",t.src=`https://cdn.jsdelivr.net/npm/statsig-sidecar/dist/index.min.js?apikey=${o}`,t.async=!0,document.head.appendChild(t)}},[n,o,a,e?.userUuid]),null};function ra(){let e=(0,S.usePathname)(),t=(0,S.useSearchParams)();return(0,x.useEffect)(()=>{if(!e)return;let r=Date.now(),n=`${e}${t.toString()?`?${t.toString()}`:""}`,i=(0,P.getCookie)({name:"current_url"}),a=(0,P.getCookie)({name:"entered_at"});(0,P.getCookie)({name:"referrer_url"});let o={path:"/",maxAge:31536e3,domain:".rentre.kr"};(0,P.setCookie)("referrer_url",i||"",o),(0,P.setCookie)("current_url",n,o),(0,P.setCookie)("entered_at",String(r),o)},[e,t]),null}var ro=e.i(3903),rs=e.i(128676),rl=e.i(581949);let ru=async e=>(0,rl.default)("api/tid/expire",{method:"PATCH",data:e}).then(e=>e.data),rc=async()=>(0,t8.axios)("api/tid/myTid",{isNeedToken:!0}).then(e=>e.data),rd=async e=>(0,t8.axios)("api/tid",{method:"POST",data:e,isNeedToken:!0}).then(e=>e.data);function rh(){let e,{onMessage:t}=(0,q.useRNBridge)(),{data:r}=(0,I.useAtomValue)(k.viewerModel.viewerStatusAtom),n=r?.userRoleString!="[ANONYMOUS]",i={},a=(0,S.useSearchParams)();a?.forEach((e,t)=>{i[`${t}`]||(i[`${t}`]=e)});let o=(e={},(0,rs.toPairs)(i).map(t=>{let[r,n]=t;Array.isArray(n)?e[`${r}`]=n[0]:e[`${r}`]=n}),e),s=async()=>{let e=await rc();(0,ro.setCookie)("tid",e.tid,{maxAge:31536e3,domain:X.DOMAIN,path:"/"})},l=async()=>{if(!(0,ro.getCookie)("tid"))if(i.tid)(0,ro.setCookie)("tid",i.tid,{maxAge:31536e3,domain:X.DOMAIN,path:"/"});else{let e=(0,t9.getDevice)(),t=window.sessionStorage.getItem("initialReferer")||"",r=await rd({...o,referrer:t,device:e});r.tid&&a&&(0,ro.setCookie)("tid",r.tid,{maxAge:31536e3,domain:X.DOMAIN,path:"/"})}},u=async()=>{n?s():l()};return(0,x.useEffect)(()=>{window.sessionStorage.getItem("initialReferer")||window.sessionStorage.setItem("initialReferer",document.referrer),r&&u()},[r]),(0,x.useEffect)(()=>{t("AS-IS-TID",e=>{e&&(ru({tid:(0,ro.getCookie)("tid"),originTid:e}),(0,ro.setCookie)("tid",e,{maxAge:31536e3,domain:X.DOMAIN,path:"/"}))})},[]),null}let rf=()=>{let e=(()=>{let e=(0,S.useSearchParams)(),[t,r]=(0,x.useState)({});return(0,x.useEffect)(()=>{D&&r(U())},[e]),t})();if(!D)return null;let t=Object.entries(e);return 0===t.length?null:(0,w.jsxs)("div",{className:"fixed bottom-2 right-2 z-[9999] max-w-[320px] select-none rounded-md bg-red-600/90 px-[10px] py-[6px] font-mono text-[11px] leading-[1.4] text-white shadow-md",children:[(0,w.jsx)("div",{className:"mb-1 font-bold",children:"EXP OVERRIDE"}),t.map(e=>{let[t,r]=e;return(0,w.jsxs)("div",{children:[t," = ",r]},t)}),(0,w.jsx)("button",{type:"button",onClick:()=>{let e,t;F(),window.location.replace((e=new URL(window.location.href),t=[],e.searchParams.forEach((e,r)=>{(r.startsWith(O)||r===T)&&t.push(r)}),t.forEach(t=>e.searchParams.delete(t)),e.toString()))},className:"mt-[6px] cursor-pointer rounded border border-white/30 bg-white/15 px-[6px] py-[2px] text-[10px] text-white",children:"clear all"})]})};var rp=e.i(382400),r_=e.i(91005),rg=e.i(954989);let rv=()=>{let t=(0,rg.useSessionWithoutProvider)(),r=$.ampli.isLoaded?$.ampli.client?.getDeviceId():void 0,{data:n}=(0,I.useAtomValue)(k.viewerModel.viewerStatusAtom),i=n?.userUuid,a=(0,I.useSetAtom)(r_.isAirBridgeReadyAtom),o=async()=>{let n=(await e.A(355321)).default,o=t?.session?.token?.userUuid,s=t?.session?.token?.email;"success"==t.status&&null==t.session?(n.init({app:"rentre",webToken:"1dbcb79fb1664b0bb3bbe5d5c8991314",utmParsing:!0,user:{alias:{amplitude_device_id:r,amplitude_user_id:i}},isTrackingEnabled:!1},()=>a(!0)),n.startTracking()):"success"==t.status&&i&&(n.init({app:"rentre",webToken:"1dbcb79fb1664b0bb3bbe5d5c8991314",utmParsing:!0,user:{externalUserID:o,...s?{externalUserEmail:s}:{},alias:{amplitude_device_id:r,amplitude_user_id:i}},isTrackingEnabled:!1},()=>a(!0)),n.startTracking())};return(0,x.useEffect)(()=>{"success"==t.status&&$.ampli.isLoaded&&r&&o()},[t,r,$.ampli.isLoaded]),(0,w.jsx)(w.Fragment,{})};var rm=e.i(350348);function ry(e){let{}=e;return(0,x.useEffect)(()=>{(0,rm.getDeviceToken)()},[]),null}let rb=()=>{let e=(0,S.usePathname)(),t=(0,x.useRef)(null);return(0,x.useEffect)(()=>{t.current===e&&t.current||((0,t8.axios)({url:"api/etc/pv",isNeedToken:!0}).then(e=>e.data),t.current=e)},[e]),null};var rE=e.i(237606),rw=e.i(323437);let rS=!1,rA="1140449263364686",rx=null;var rI=e.i(539400);let rk="1729668468149800001",rC="https://karrot-pixel.business.daangn.com/0.4/karrot-pixel.umd.js",rT=null,rO="__rentreCookieGuarded",rD=()=>
1{if(!window.karrotPixel)return;let e=window.karrotPixel;if(e[rO])return;let t=e.track.bind(e);e.track=(e,r)=>{(()=>{if(null!==rT)return rT;if("u"<typeof document)return rT=!1,!1;try{let e="__krt_cookie_probe__";document.cookie=`${e}=1; path=/; SameSite=Lax`;let t=document.cookie.includes(`${e}=1`);return document.cookie=`${e}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`,rT=t,t}catch{return rT=!1,!1}})()?t(e,r):rw.pixelLogger.log("[KarrotPixel] 쿠키 차단 환경 — track 스킵:",e)},e[rO]=!0};var rP=e.i(913416),rj=e.i(340809);let rR={facebook:{hasPixelId:()=>!!rA,loadScript:async()=>{if("u">typeof document&&rA)try{(()=>{if(rS)return;rS=!0;let e=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){try{if("string"==typeof this.action&&this.action.includes("facebook.com/tr")){let e=new URLSearchParams;Array.from(this.elements).forEach(t=>{t.name&&e.append(t.name,t.value)}),new Image().src=`${this.action}?${e.toString()}`;return}}catch{}e.call(this)}})(),rx||(rx=(await e.A(592149)).default),rx?.init(rA),rw.pixelLogger.log("[FacebookPixel] SDK 초기화 완료")}catch(e){rw.pixelLogger.error("[FacebookPixel] SDK 로드 실패:",e)}},trackPageView:e=>{"u">typeof document&&rA&&(rx?.pageView(),rw.pixelLogger.log("[FacebookPixel] Page view:",e))}},kakao:rI.kakaoPixelProvider,karrot:{hasPixelId:()=>!!rk,loadScript:()=>new Promise(e=>{if("u"<typeof document)return void e();if(window.karrotPixel){rD(),e();return}if(document.querySelector(`script[src="${rC}"]`)){let t=setInterval(()=>{window.karrotPixel&&(clearInterval(t),rD(),e())},50);setTimeout(()=>{clearInterval(t),e()},5e3);return}let t=document.createElement("script");t.src=rC,t.onload=()=>{rw.pixelLogger.log("[KarrotPixel] 스크립트 로드 완료"),window.karrotPixel&&(rD(),window.karrotPixel.init(rk)),e()},t.onerror=()=>{rw.pixelLogger.error("[KarrotPixel] 스크립트 로드 실패"),e()},document.head.appendChild(t)}),trackPageView:e=>
1{window.karrotPixel&&(rD(),window.karrotPixel.init(rk),window.karrotPixel.track("ViewPage"),rw.pixelLogger.log("[KarrotPixel] Page view:",e))}},tiktok:rj.tiktokPixelProvider,naver:rP.naverPixelProvider,criteo:rE.criteoPixelProvider};function rN(e){let{providers:t,debug:r=!1}=e,n=(0,S.usePathname)(),i=(0,x.useRef)(null),a=(0,x.useRef)(!1),o=(0,x.useRef)(null),s=(0,x.useMemo)(()=>t.map(e=>({name:e,handler:rR[e]})).filter(e=>{let{handler:t}=e;return t.hasPixelId()}),[t]),l=(0,x.useCallback)(e=>{s.forEach(t=>{let n=t.handler;if(n&&n.hasPixelId())try{n.trackPageView(e)}catch(e){r&&rw.pixelLogger.error(`[PixelTracker] ${t.name} 페이지 뷰 추적 실패:`,e)}})},[s,r]);return(0,x.useEffect)(()=>{(async()=>{let e=s.map(async e=>{let t=e.handler;if(t&&t.hasPixelId())try{await t.loadScript()}catch(t){r&&rw.pixelLogger.error(`[PixelTracker] ${e.name} 스크립트 로드 실패:`,t)}});await Promise.all(e),a.current=!0,o.current&&(l(o.current),i.current=o.current,o.current=null)})()},[s,r,l]),(0,x.useEffect)(()=>{if(i.current!==n){if(!a.current){o.current=n;return}l(n),i.current=n}},[n,l]),null}var rL=e.i(331378),rM=e.i(241984),rU=e.i(79963);let rF=["/curation/"];function rB(){let e=(0,S.usePathname)(),t=(0,rU.useSessionV2)(),r=(0,x.useRef)(!1),n=(0,rL.useIsFetching)(),i=(0,x.useRef)(!1),a=(0,x.useRef)(!1),o=(0,x.useRef)(!1),s=(0,x.useRef)(!1),l=(0,rM.useCheckScroll)(),u=!!rF.find(t=>e.startsWith(t));return(0,x.useEffect)(()=>{u&&(null===l||r.current||(r.current=!0))},[l,u]),(0,x.useEffect)(()=>{if(!u)return;let r=()=>{if(n>0)return;let r=((window.scrollY||document.documentElement.scrollTop)+window.innerHeight)/document.documentElement.scrollHeight;r>=.25&&!i.current&&null!==l&&($.ampli.scrolledPage({path:e,is_logged_in:!!t.session,percentage:25}),i.current=!0),r>=.5&&!a.current&&null!==l&&($.ampli.scrolledPage({path:e,is_logged_in:!!t.session,percentage:50}),a.current=!0),r>=.75&&!o.current&&null!==l&&($.ampli.scrolledPage({path:e,is_logged_in:!!t.session,percentage:75}),o.current=!0),1!==r||s.current||null===l||($.ampli.scrolledPage({path:e,is_logged_in:!!t.session,percentage:100}),s.current=!0)};return window.addEventListener("scroll",r),()=>window.removeEventListener("scroll",r)},[l,u,n]),null}var rK=e.i(705766);function rz(e){let{toastOptions:t,containerStyle:r}=e;return(0,w.jsx)(rK.Toaster,{toastOptions:{className:"!bg-[rgba(0,0,0,0.70)]",...t},containerStyle:{bottom:"100px",...r},children:e=>(0,w.jsx)(rK.ToastBar,{toast:e,children:e=>{let{icon:t,message:r}=e;return(0,w.jsxs)("div",{className:"flex items-center gap-6 text-14 font-medium leading-normal text-white",children:[t,r]})}})})}e.s(["Utils",0,()=>{let e=(0,S.usePathname)();return(0,rp.isCmsPreviewPath)(e)?(0,w.jsx)(x.Fragment,{}):(0,w.jsxs)(x.Fragment,{children:[(0,w.jsx)(rt,{}),(0,w.jsx)(x.Suspense,{fallback:null,children:(0,w.jsx)(rh,{})}),(0,w.jsx)(J,{}),(0,w.jsxs)(x.Suspense,{fallback:null,children:[(0,w.jsx)(z,{}),(0,w.jsx)(rf,{})]}),(0,w.jsx)(rv,{}),(0,w.jsx)(et,{}),(0,w.jsx)(em,{}),(0,w.jsxs)(x.Suspense,{fallback:null,children:[(0,w.jsx)(t7,{}),(0,w.jsx)(ra,{})]}),(0,w.jsx)(er,{}),(0,w.jsx)(rb,{}),(0,w.jsx)(ry,{}),(0,w.jsx)(ei,{}),(0,w.jsx)(ef,{}),(0,w.jsx)(rz,{}),(0,w.jsx)(Z,{}),(0,w.jsx)(rB,{}),(0,w.jsx)(ri,{}),(0,w.jsx)(A.default,{type:"text/javascript",src:"https://cdn.amplitude.com/script/35f709a1fbb57bb9ef50b70f6bf536f9.experiment.js"}),(0,w.jsx)(rN,{providers:["facebook","kakao","karrot","tiktok","naver","criteo"]})]})}],987736)},797932,e=>{"use strict";var t=e.i(843476),r=e.i(662537),n=e.i(271645);let i=(0,n.createContext)(null),a={didCatch:!1,error:null};class o extends n.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=a}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];null==(t=(r=this.props).onReset)||t.call(r,{args:i,reason:"imperative-api"}),this.setState(a)}}componentDidCatch(e,t){var r,n;null==(r=(n=this.props).onError)||r.call(n,e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:n}=this.props;if(r&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,n)){var i,o;null==(i=(o=this.props).onReset)||i.call(o,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(a)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:a}=this.props,{didCatch:o,error:s}=this.state,l=e;if(o){let e={error:s,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)l=t(e);else if(r)l=(0,n.createElement)(r,e);else if(void 0!==a)l=a;else throw s}return(0,n.createElement)(i.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},l)}}var s=e.i(70051),l=e.i(649437),u=e.i(348326),c=e.i(87833);e.s(["ErrorBoundary",0,function(e){let{children:n}=e;return(0,t.jsx)(o,{onError:e=>{let t=e.redirectUrl;t?window.location.replace(t):(0,s.isDeploySkewError)(e)&&(0,l.reloadForDeploySkew)()||((0,u.logErrorToSlack)(e),r.captureException(e))},fallbackRender:e=>{let{resetErrorBoundary:r,error:n}=e;return(0,s.isDeploySkewError)(n)&&(0,l.canReloadForDeploySkew)()?null:(0,t.jsx)(c.DefaultErrorView,{message:n.message,onReset:()=>{r()}})},children:n})}],797932)},679490,e=>{"use strict";let t;var r=e.i(843476),n=e.i(912598),i=e.i(175555),a=function(){return null},o=e.i(672464),s=e.i(271645),l=e.i(309909),u=e.i(750214),c=e.i(317751),d=e.i(619273),h=e.i(77176);function f(e){return new c.QueryClient({defaultOptions:{queries:{staleTime:6e4,...e?.queries},mutations:{...e?.mutations}}})}e.s(["QueryClientProvider",0,function(e){let{children:c}=e,p=d.isServer?f():(t||(t=f({queries:{throwOnError:!0,staleTime:6e4,retry:1,refetchOnMount:!0,refetchOnWindowFocus:!1,gcTime:3e5},mutations:{throwOnError:!1,onError:e=>{(0,h.openAlert)({message:e.message||e.msg||"알수 없는 오류"})}}})),t);return s.default.useEffect(()=>{i.focusManager.setEventListener(e=>(window.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",e,!1),()=>{window.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e)}))},[]),(0,r.jsx)(n.QueryClientProvider,{client:p,children:(0,r.jsx)(o.Provider,{children:(0,r.jsxs)(e=>{let{children:t}=e;return(0,u.useHydrateAtoms)([[l.queryClientAtom,p]]),t},{children:[c,(0,r.jsx)(a,{initialIsOpen:!1})]})})})}],679490)},137414,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(188345);e.s(["ReactNativeBridgeProvider",0,function(e){let i=(0,r.useRef)(new Map);function a(e,t){let r,n=i?.current;if(n){let i=n.get(e);return i?r=i.push(t)-1:(n.set(e,[t]),r=0),function(){n.get(e)?.splice(r,1)}}throw Error("subscribers is undefiend")}return(0,r.useEffect)(()=>{let e=e=>{if(function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(e.data)){let t,{data:r,type:n}=JSON.parse(e.data);
1(t=i?.current?.get(n))&&t?.forEach(e=>{e(r)})}};window.ReactNativeWebView&&(document.addEventListener("message",e),window.addEventListener("message",e))},[]),(0,t.jsx)(n.ReactNativeBridgeContext.Provider,{value:{onMessage:a,postMessage:(e,t)=>{window.ReactNativeWebView&&"function"==typeof window.ReactNativeWebView?.postMessage&&window.ReactNativeWebView.postMessage(JSON.stringify({type:e,data:t}))},asyncPostMessage:(e,t)=>new Promise(r=>{if(window.ReactNativeWebView){let n=a(e,e=>{n(),r(e)});"function"==typeof window.ReactNativeWebView?.postMessage&&window.ReactNativeWebView.postMessage(JSON.stringify({type:e,data:t,isSync:!0}))}else r(Error("앱 환경이 아닙니다."))})},children:e.children})}])},130938,e=>{"use strict";var t=e.i(843476),r=e.i(496770);e.s(["SlugMapHydrate",0,function(e){let{categorySlugMap:n,brandSlugMap:i,children:a}=e;return(0,t.jsx)(r.SlugMapContextProvider,{value:{category:n,brand:i},children:a})}])},390495,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(618566),i=e.i(171372),a=e.i(743784);let o=function(e,t){var n=(0,r.useState)(void 0!==t?t:!!a.isBrowser&&window.matchMedia(e).matches),i=n[0],o=n[1];return(0,r.useEffect)(function(){var t=!0,r=window.matchMedia(e),n=function(){t&&o(!!r.matches)};return r.addEventListener("change",n),o(r.matches),function(){t=!1,r.removeEventListener("change",n)}},[e]),i},s=[(0,i.match)("/story/:slug"),(0,i.match)("/story/:title/:slug")];var l=e.i(657688),u=e.i(522016);let c={src:e.i(542178).default,width:280,height:280,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAy0lEQVR42lWPMQuCcBDF/SJBNlQWLg4O4gcQV0EQBzdXP0NObgmiCJKEW7hFQ4uQbimNITQm7UGjxIu/hdVwx4P73d171GCwaGjaxWwWYjoNMBwu+yIzighRTKHrR6hqjvHY/4Mosi0IGxjGCbK8B8MEYNkQNP0BSCMQx62haTt43gVxfIOibDuoAxjGh+OUKMsH6vqJogBs+4zRyH0DPL9Clt1RVS3yvEUUXSFJ6ffFZOLBsg5IkgammXUeepMkChHk3HwedH5+Y74AOMyMALdaaYMAAAAASUVORK5CYII="},d={src:e.i(103218).default,width:280,height:280,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAA1UlEQVR42k2PvwsBcRjG7x9RTliUgdkkk8Hf4B/AbJPdjysL2Ri4TV0plMGolO7KdZ1O3HSbpAx8fL9dF8P71vs+z/u8z6PEYq1rPN4lmeyTTmskEj3kLEtiSiql0WismExO6PqZen2N3EUkJZMZYBgXggB8H/b7B5p2pFyehQQpWattsO0PjgPb7V0o7gRBDwmyVasGnvfmcHjRbrs0mybF4gJV7f0ULOspPNzEtUmn41KpbIThPoqqdsnlhpRKU/L5EYXCXIBLstlx+CKK+V9SOor5BTRdlwGWTV9xAAAAAElFTkSuQmCC"},h={src:e.i(611851).default,width:280,height:280,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAxUlEQVR42l2PvQqCABSFfZGgiKBw0Zdxc3LSQURwCyWEcDM1zN4iIpe0IIeGEJWGXIO2WhpqaDqpYUbDhftzON89RKs1urTbJurqdJq+vBH1QFEeeH4Nw0jAsiv0ena1rwQ0PYfjHBAEJ6TpFXH8BMP4jUCSNrDtZeEwhKaZyPM7dP1Y4CYgul0LlpXANBcQxTFU1YXvnwtM+HEon5LlbWH9QpY9EEU3CMIe/f6sQQwGU3BcCNfNoSg7kKT3TUL8xixx/zHfuOiRrBg6u3sAAAAASUVORK5CYII="},f={src:e.i(326464).default,width:168,height:168,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAtUlEQVR42jWPSQqFQAxEc0SvIA7oSgRFUcERxQkXgoLQvW36lPVJ4C9CQvKSqlAQBCiKAlprOI4D13UxzzPquobv+6A8z9E0DaqqwnEcWNcV+76j6zpZpDRN4XmeQEmSSDAYx7FkMsbI1nVdeN8Xbdui73uReZ4H9H0flmWRprVWwPM8cd83hmEA/RsMsLFxHKVmg1xTWZaYpklOhmGIbdsks1QURSAmsyyDUkq8sDke8FX+5AeVKJ8ohs49tQAAAABJRU5ErkJggg=="},p={src:e.i(178308).default,width:168,height:168,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAvElEQVR42h1PtwqFAAzMjz5FsC02FBVdbFjBxbIIDoqrix94j2QIIcmVHOm6jjAMpb7vg23bWJYFcRyDb5SmKcqylEXXdTBNE23boq5rIVHf98jzHL7vw3EcDMOAbdtwXReSJAFVVYUoisBKv98PruvKvO87xnEEKYoCz/OwrquAWOE4DjzPg/d9QaqqYpomnOcpVszi0jQNWZaB2KcoCvAvDGyaRiyCIADbE0dh6fu+Mc+zJOFuGAYsy8IfXtSe2kbuaT8AAAAASUVORK5CYII="};var _=e.i(294595),g=e.i(953640),v=e.i(938605);let m=(e,t)=>`clamp(${e}px, ${e}px + (${t} - ${e}) * ((100vw - 1280px) / 86), ${t}px)`,y=()=>{let e,i=(0,n.usePathname)(),a=(e=(0,g.useBuildCategoryUrl)(),[{id:"internet",subtitle:"인터넷 설치 고민이라면",title:"숨은 조건까지 모두 확인하기",href:"/internet",src:c,alt:"인터넷 아이콘"},{id:"purifier",subtitle:"전고객 12개월 반값할인",title:"정수기 한눈에 비교하기",href:`${e(_.CATEGORY_WATER_PURIFIER)}?affiliateCard=on#filterCuration=%7B"prodSearchCategory"%3A"WATER_PURIFIER_HALF_PRICE"%2C"prodSearchCategoryKorean"%3A"반값할인"%2C"checkToken"%3Afalse%2C"findAtRec"%3Afalse%7D`,src:h,alt:"정수기 아이콘"},{id:"popular",subtitle:"선택이 어렵다면",title:"인기제품 먼저 구경하기",href:"/product/popular",src:d,alt:"인기제품 아이콘"}]),o=async e=>{try{v.ampli.clickedPcComponent({navigateTo:e}),await v.ampli.flush().promise}catch(e){}};return(0,r.useEffect)(()=>{v.ampli.viewedPcComponent({path:i})},[i]),(0,t.jsxs)("nav",{className:"min-w-280 max-w-320 flex w-full flex-col",style:{gap:m(14,16)},"aria-label":"데스크탑 주요 네비게이션",children:[(0,t.jsxs)("header",{className:"flex flex-col",style:{gap:m(10.5,12)},children:[(0,t.jsx)("div",{className:"h-16 w-70","aria-label":"렌트리",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"68",height:"16",viewBox:"0 0 68 16",fill:"none",children:[(0,t.jsx)("path",{d:"M6.02229 6.29116C5.52716 6.2852 5.03596 6.37862 4.57859 6.56573C4.12122 6.75283 3.70723 7.
102971 3.36179 7.37952C3.00369 7.7251 2.72061 8.13889 2.52977 8.59571C2.33893 9.05254 2.24432 9.54286 2.25168 10.0369V15.9996H0V10.0431C-7.779e-06 8.46241 0.635539 6.94621 1.76735 5.82676C2.89916 4.70732 4.43491 4.07595 6.03802 4.07102L6.02229 6.29116Z",fill:"#444444"}),(0,t.jsx)("path",{d:"M54.3859 6.29116C53.8908 6.2852 53.3996 6.37862 52.9422 6.56573C52.4849 6.75283 52.0709 7.02971 51.7254 7.37952C51.3673 7.7251 51.0842 8.13889 50.8934 8.59571C50.7026 9.05254 50.608 9.54286 50.6153 10.0369V15.9996H48.3636V10.0431C48.3636 8.46241 48.9992 6.94621 50.131 5.82676C51.2628 4.70732 52.7985 4.07595 54.4017 4.07102L54.3859 6.29116Z",fill:"#444444"}),(0,t.jsx)("path",{d:"M9.57359 11.1531C9.81584 11.9035 10.287 12.5618 10.9227 13.0384C11.5747 13.5257 12.372 13.7863 13.1901 13.7795C13.8877 13.7738 14.5756 13.6183 15.2059 13.3237C15.8253 13.0758 16.3623 12.6623 16.7563 12.1299L18.618 13.3702C18.0286 14.2024 17.2195 14.8597 16.2783 15.271C15.3188 15.7428 14.2623 15.991 13.1901 15.9965C11.9935 15.9977 10.8234 15.6489 9.82796 14.9942C8.8325 14.3395 8.0564 13.4083 7.5979 12.3185C7.13941 11.2287 7.01912 10.0293 7.25226 8.87203C7.4854 7.71479 8.0615 6.65175 8.90763 5.81747C9.75376 4.98319 10.8319 4.41518 12.0056 4.1853C13.1792 3.95542 14.3957 4.07402 15.501 4.52609C16.6063 4.97817 17.5507 5.74339 18.2147 6.72491C18.8787 7.70643 19.2325 8.86013 19.2313 10.04C19.2311 10.4071 19.1974 10.7734 19.1306 11.1345L9.57359 11.1531ZM13.1901 6.29116C12.372 6.28433 11.5747 6.54493 10.9227 7.03224C10.2843 7.5129 9.81295 8.17702 9.57359 8.93301H16.7909C16.5539 8.1767 16.0834 7.51221 15.4449 7.03224C14.7967 6.54691 14.004 6.28637 13.1901 6.29116Z",fill:"#444444"}),(0,t.jsx)("path",{d:"M57.9372 11.1531C58.1795 11.9035 58.6506 12.5618 59.2863 13.0384C59.9383 13.5257 60.7357 13.7863 61.5537 13.7795C62.2513 13.7738 62.9392 13.6183 63.5696 13.3237C64.189 13.0758 64.7259 12.6623 65.1199 12.1299L66.9817 13.3702C66.3923 14.2024 65.5831 14.8597 64.6419 15.271C63.6825 15.7428 62.6259 15.991 61.5537 15.9965C60.3571 15.9977 59.1871 15.6489 58.1916 14.9942C57.1961 14.3395 56.42 13.4083 55.9615 12.3185C55.503 11.2287 55.3828 10.0293 55.6159 8.87203C55.849 7.71479 56.4251 6.65175 57.2713 5.81747C58.1174 4.98319 59.1955 4.41518 60.3692 4.1853C61.5429 3.95542 62.7593 4.07402 63.8646 4.52609C64.9699 4.97817 65.9143 5.74339 66.5783 6.72491C67.2424 7.70643 67.5962 8.86013 67.5949 10.04C67.5948 10.4071 67.5611 10.7734 67.4943 11.1345L57.9372 11.1531ZM61.5537 6.29116C60.7357 6.28433 59.9383 6.54493 59.2863 7.03224C58.648 7.5129 58.1766 8.17702 57.9372 8.93301H65.1545C64.9175 8.1767 64.447 7.51221 63.8086 7.03224C63.1604 6.54691 62.3677 6.28637 61.5537 6.29116Z",fill:"#444444"}),(0,t.jsx)("path",{d:"M21.7619 15.9998V10.0433C21.7435 9.24859 21.8864 8.45828 22.1821 7.7188C22.4778 6.97933 22.9205 6.30558 23.484 5.73713C24.0475 5.16869 24.7206 4.71701 25.4636 4.40864C26.2067 4.10027 27.0047 3.94141 27.8109 3.94141C28.6171 3.94141 29.4151 4.10027 30.1582 4.40864C30.9012 4.71701 31.5743 5.16869 32.1378 5.73713C32.7013 6.30558 33.144 6.97933 33.4397 7.7188C33.7354 8.45828 33.8783 9.24859 33.8599 10.0433V15.9998H31.6082V10.0433C31.6229 9.54252 31.5355 9.04395 31.3512 8.5771C31.1669 8.11024 30.8896 7.68456 30.5355 7.32527C30.1814 6.96597 29.7579 6.68035 29.2899 6.48532C28.8219 6.29028 28.319 6.18979 27.8109 6.18979C27.3028 6.18979 26.7999 6.29028 26.3319 6.48532C25.8639 6.68035 25.4403 6.96597 25.0863 7.32527C24.7322 7.68456 24.4549 8.11024 24.2706 8.5771C24.0863 9.04395 23.9989 9.54252 24.0135 10.0433V15.9998H21.7619Z",fill:"#444444"}),(0,t.jsx)("path",{d:"M44.0063 13.7798V15.9999H40.3426C39.8709 16.0036 39.4032 15.9147 38.9667 15.7383C38.5302 15.562 38.1337 15.3017 37.8003 14.9727C37.4669 14.6436 37.2033 14.2525 37.0248 13.8219C36.8463 13.3914 36.7565 12.9301 36.7607 12.465L36.7418 0H38.9935V4.07129H42.9874V6.29143H38.9935V12.465C38.9911 12.6383 39.0247 12.8103 39.0923 12.9703C39.1599 13.1303 39.2601 13.2749 39.3866 13.3953C39.5093 13.5191 39.6561 13.6173 39.8182 13.6839C39.9804 13.7505 40.1544 13.7842 40.3301 13.7829L44.0063 13.7798Z",fill:"#444444"}),(0,t.jsx)("path",{d:"M49.0889 1.61238C49.0889 1.29335 48.993 0.981482 48.8131 0.716259C48.6333 0.451035 48.3777 0.24438 48.0787 0.122433C47.7797 0.000486634 47.4508 -0.031254 47.1335 0.0312122C46.8162 0.0936785 46.5248 0.247542 46.2962 0.47335C46.0676 0.699157 45.9121 0.986755 45.8494 1.29973C45.7867 1.61271 45.8195 1.937 45.9437 2.23157C46.068 2.52614 46.2781 2.77774 46.5474 2.95454C46.8168 3.13134 47.1332 3.22539 47.4568 3.22478C47.7412 3.22321 48.0201 3.14723 48.265 3.00462L49.0889 3.47283V1.61238Z",fill:"#5D7CF9"})]})}),(0,t.jsx)("strong",{className:"text-gray-950 title-20",children:"전국 렌탈 견적을 한눈에, 렌트리"})]}),(0,t.jsx)("div",{className:"flex flex-col bg-white",style:{borderRadius:m(10.5,12)},children:a.map((e,r)=>{let n=0===r,i=r===a.length-1;return(0,t.jsx)("div",{className:`flex flex-col ${n?"rounded-t-12":""} ${i?"rounded-b-12 border-b-0":""}`,style:{gap:m(17.5,20),paddingTop:n?m(14,16):m(7,8),paddingRight:m(14,16),paddingBottom:n?m(7,8):i?m(14,16):m(7,8),paddingLeft:m(14,16)},children:(0,t.jsx)(u.default,{href:e.href,className:"flex cursor-pointer",style:{gap:m(7,8)},onClick:()=>o(e.href),"aria-label":`${e.subtitle} - ${e.title}`,children:(0,t.jsxs)("div",{className:"flex flex-1 items-center",style:{gap:m(10.5,12)},children:[(0,t.jsx)("div",{className:"relative flex-shrink-0",style:{width:m(61.25,70),height:m(61.25,70),borderRadius:m(7,8)},children:(0,t.jsx)(l.default,{src:e.src,alt:e.alt,fill:!0,className:"object-contain"})}),(0,t.jsxs)("div",{className:"flex flex-1 items-center",style:{gap:m(14,16)},children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-gray-950 body-16",children:e.subt
1itle}),(0,t.jsx)("strong",{className:"text-gray-950 title-16",children:e.title})]}),(0,t.jsx)("div",{className:"flex h-12 w-12 flex-shrink-0 items-center justify-center",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"7",height:"12",viewBox:"0 0 7 12",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M0.799805 0.800049L5.72909 5.72934C5.76815 5.76839 5.76815 5.83171 5.72909 5.87076L0.799805 10.8",stroke:"#D9D9D7",strokeWidth:"1.6",strokeLinecap:"round"})})})]})]})})},e.id)})}),(0,t.jsxs)("section",{className:"flex flex-col bg-white",style:{gap:m(8.75,10),borderRadius:m(10.5,12),paddingTop:m(14,16),paddingRight:m(14,16),paddingBottom:m(14,16),paddingLeft:m(14,16)},"aria-label":"렌트리 앱 다운로드",children:[(0,t.jsx)("p",{className:"text-gray-600 body-16",children:"가전 렌탈 · 인터넷 앱 서비스 고객 평가 1위"}),(0,t.jsxs)("div",{className:"flex",style:{gap:m(7,8)},children:[(0,t.jsx)("div",{className:"flex flex-1 items-center bg-gray-100",style:{gap:m(7,8),borderRadius:m(7,8),paddingTop:m(8.75,10),paddingRight:m(7,8),paddingBottom:m(8.75,10),paddingLeft:m(7,8)},children:(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsx)("div",{className:"relative flex-shrink-0 overflow-hidden bg-gray-300",style:{width:m(36.75,42),height:m(36.75,42)},children:(0,t.jsx)(l.default,{src:p,alt:"구글플레이스토어 QR 코드",fill:!0,className:"object-contain"})}),(0,t.jsxs)("div",{className:"flex items-center gap-spacing-2",children:[(0,t.jsx)("div",{className:"h-12 w-12",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"12",viewBox:"0 0 11 12",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{opacity:"0.4",d:"M5.18523 5.86227L0.0449219 11.0029L0.0456683 11.006C0.198 11.5785 0.720872 12 1.34144 12C1.58951 12 1.82242 11.9329 2.02215 11.8152L2.03801 11.8059L7.62925 8.57959L5.18523 5.86227Z",fill:"#8A8985"}),(0,t.jsx)("path",{d:"M10.0381 4.83295L10.0333 4.82968L7.61942 3.43035L5.18262 5.86229L7.62889 8.57886L10.03 7.19343C10.451 6.96617 10.7368 6.52238 10.7368 6.01062C10.7368 5.50255 10.4548 5.06095 10.0381 4.83295Z",fill:"#8A8985"}),(0,t.jsx)("path",{opacity:"0.6",d:"M0.0455549 0.996799C0.0156951 1.10691 0 1.22224 0 1.342V10.658C0 10.7775 0.0155084 10.8932 0.0457414 11.0029L5.1839 5.86575L0.0455549 0.996799Z",fill:"#8A8985"}),(0,t.jsx)("path",{opacity:"0.8",d:"M5.18523 5.86523L7.61996 3.42976L2.03507 0.191786C1.83207 0.0702019 1.59516 3.29018e-05 1.34163 3.29018e-05C0.721058 3.29018e-05 0.197486 0.42231 0.0451084 0.995471L0.0449219 0.996918L5.18523 5.86523Z",fill:"#8A8985"})]})}),(0,t.jsx)("span",{className:"text-gray-500 body-14",children:"구글플레이"})]})]})}),(0,t.jsx)("div",{className:"flex flex-1 items-center bg-gray-100",style:{gap:m(7,8),borderRadius:m(7,8),paddingTop:m(8.75,10),paddingRight:m(7,8),paddingBottom:m(8.75,10),paddingLeft:m(7,8)},children:(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsx)("div",{className:"relative flex-shrink-0",style:{width:m(36.75,42),height:m(36.75,42)},children:(0,t.jsx)(l.default,{src:f,alt:"앱스토어 QR 코드",fill:!0,className:"object-contain"})}),(0,t.jsxs)("div",{className:"flex items-center gap-spacing-2",children:[(0,t.jsx)("div",{className:"h-12 w-12",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"12",viewBox:"0 0 10 12",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8.15432 6.38156C8.16625 5.45521 8.66374 4.57869 9.45294 4.09349C8.95507 3.38244 8.12115 2.93161 7.25354 2.90447C6.32817 2.80734 5.43106 3.4582 4.9595 3.4582C4.47883 3.4582 3.75279 2.91411 2.97098 2.9302C1.95191 2.96312 1.00189 3.5425 0.506096 4.43344C-0.559668 6.27864 0.235296 8.99047 1.25621 10.482C1.76699 11.2124 2.36395 12.0282 3.14507 11.9993C3.90943 11.9675 4.1949 11.5118 5.11756 11.5118C6.03165 11.5118 6.29948 11.9993 7.09644 11.9809C7.91664 11.9675 8.4334 11.2473 8.92627 10.51C9.29326 9.98958 9.57567 9.41441 9.76302 8.8058C8.79913 8.39812 8.15544 7.42811 8.15432 6.38156Z",fill:"#8A8985"}),(0,t.jsx)("path",{d:"M6.64899 1.92357C7.09619 1.38671 7.31651 0.696677 7.26316 0C6.57993 0.0717603 5.94882 0.3983 5.49557 0.914557C5.05236 1.41897 4.8217 2.09686 4.86531 2.76691C5.54879 2.77395 6.2207 2.45626 6.64899 1.92357Z",fill:"#8A8985"})]})}),(0,t.jsx)("span",{className:"text-gray-500 body-14",children:"앱스토어"})]})]})})]})]})]})};function b(){return(()=>{let e=(0,n.usePathname)();return!!o("(min-width: 1280px)",!1)&&s.some(t=>!1!==t(e))})()?(0,t.jsx)("div",{className:"fixed top-1/2 z-40 hidden -translate-y-1/2 xl:block",style:{left:"clamp(calc(50% - 662px), calc(50% - 622px - (100vw - 1280px) * 40 / 86), calc(50% - 622px))"},children:(0,t.jsx)(y,{})}):null}e.s(["DesktopLayoutWrapper",0,function(e){let{children:n}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(b,{})}),n]})}],390495)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.