PageSourceSearch

https://www.rappi.cl/mf-header/static/js/594.286d52e4.chunk.js

js rappi.cl collected 2026-09-29 03:47:53 UTC 122,810 bytes, 2 lines download raw bytes

1/*! For license information please see 594.286d52e4.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkrappi_microfront=self.webpackChunkrappi_microfront||[]).push([[594],{9376:function(e,t,n){n.d(t,{q:function(){return Gi}});var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var a=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,a,u=o(e),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))i.call(n,l)&&(u[l]=n[l]);if(r){a=r(n);for(var f=0;f<a.length;f++)s.call(n,a[f])&&(u[a[f]]=n[a[f]])}}return u},u=115,c=223,l=315,f=318,h=319,p="settings",d="Factory instantiation",g="sync:featureflag-changes: ",m="Global fetch API is not available.";var v="control",y={treatment:v,config:null},S="IMPRESSION",b="EVENT",T="DEBUG",E="OPTIMIZED",k="NONE",_="localhost",w="standalone",C="producer",R="consumer",A="consumer_partial",N="MEMORY",O="LOCALSTORAGE",I="GRANTED",L="DECLINED",D="UNKNOWN",M="te",K={headers:{"Cache-Control":"no-cache"}};function F(e){return"users="+encodeURIComponent(e)}function x(e,t,n){var r=e.urls,i=e.sync.__splitFiltersValidation&&e.sync.__splitFiltersValidation.queryString,s=e.sync.impressionsMode,o=function(e,t,n){var r=e.log,i=e.core.authorizationKey,s=e.version,o=e.runtime,u=o.ip,c=o.hostname,l=n&&n(),f=t&&t();f||r.error(303,[m]);var h={Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+i,SplitSDKVersion:s};return u&&(h.SplitSDKMachineIP=u),c&&(h.SplitSDKMachineName=c),function(e,t,n,i){void 0===t&&(t={}),void 0===n&&(n=function(){}),void 0===i&&(i=!1);var s=a({headers:t.headers?a({},h,t.headers):h,method:t.method||"GET",body:t.body},l);return f?f(e,s).then((function(e){return e.ok?(n(),e):e.text().then((function(t){return Promise.reject({response:e,message:t})}))})).catch((function(t){var s=t&&t.response,o="";o=s?404===s.status?"Invalid SDK key or resource not found.":t.message:t.message||"Network Error",s&&403===s.status||r[i?"info":"error"](322,[s?s.status:"NO_STATUS",e,o]);var a=new Error(o);throw a.statusCode=s&&s.status,n(a),a})):Promise.reject(new Error(m))}}(e,t.getFetch,t.getOptions);return{getSdkAPIHealthCheck:function(){var e=r.sdk+"/version";return o(e).then((function(){return!0})).catch((function(){return!1}))},getEventsAPIHealthCheck:function(){var e=r.events+"/version";return o(e).then((function(){return!0})).catch((function(){return!1}))},fetchAuth:function(e){var t=r.auth+"/v2/auth";if(e){var i=e.map(F).join("&");i&&(t+="?"+i)}return o(t,void 0,n.trackHttp("to"))},fetchSplitChanges:function(e,t,s){var a=r.sdk+"/splitChanges?since="+e+(s?"&till="+s:"")+(i||"");return o(a,t?K:void 0,n.trackHttp("sp"))},fetchSegmentChanges:function(e,t,i,s){var a=r.sdk+"/segmentChanges/"+t+"?since="+e+(s?"&till="+s:"");return o(a,i?K:void 0,n.trackHttp("se"))},fetchMySegments:function(e,t){var i=r.sdk+"/mySegments/"+encodeURIComponent(e);return o(i,t?K:void 0,n.trackHttp("ms"))},postEventsBulk:function(e,t){var i=r.events+"/events/bulk";return o(i,{method:"POST",body:e,headers:t},n.trackHttp("ev"))},postTestImpressionsBulk:function(e,t){var i=r.events+"/testImpressions/bulk";return o(i,{method:"POST",body:e,headers:a({SplitSDKImpressionsMode:s},t)},n.trackHttp("im"))},postTestImpressionsCount:function(e,t){var i=r.events+"/testImpressions/count";return o(i,{method:"POST",body:e,headers:t},n.trackHttp("ic"))},postUniqueKeysBulkCs:function(e,t){var i=r.telemetry+"/v1/keys/cs";return o(i,{method:"POST",body:e,headers:t},n.trackHttp(M))},postUniqueKeysBulkSs:function(e,t){var i=r.telemetry+"/v1/keys/ss";return o(i,{method:"POST",body:e,headers:t},n.trackHttp(M))},postMetricsConfig:function(e,t){var i=r.telemetry+"/v1/metrics/config";return o(i,{method:"POST",body:e,headers:t},n.trackHttp(M),!0)},postMetricsUsage:function(e,t){var i=r.telemetry+"/v1/metrics/usage";return o(i,{method:"POST",body:e,headers:t},n.trackHttp(M),!0)}}}function P(e,t,n,r){void 0===r&&(r="task");
2var i,s,o,a=0,u=!1,c=0;function l(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];return a++,e.debug(37,[r]),i=(i?i.then((function(){return t.apply(void 0,n)})):t.apply(void 0,n)).then((function(e){return a--,e}))}function f(e){return l.apply(void 0,s).then((function(t){return u&&e===c&&(o=setTimeout(f,n,e)),t}))}return{execute:l,isExecuting:function(){return a>0},start:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(!u)return u=!0,c++,s=t,e.debug(36,[r,n]),f(c)},stop:function(){u=!1,o&&(e.debug(38,[r]),clearTimeout(o),o=void 0)},isRunning:function(){return u}}}function U(e,t,n,r,i,s,o,a){void 0===o&&(o=0);var u,c=0;return P(e,(function(){if(n.isEmpty()&&!u)return Promise.resolve();var r="number"===typeof(u=n.pop(u)).length?u.length+" "+i:i;e[a?"debug":"info"](116,[r]);var l=JSON.stringify(s?s(u):u);return o||(u=void 0),t(l).then((function(){c=0,u=void 0})).catch((function(t){o?c===o?(c=0,u=void 0,e[a?"debug":"warn"](209,[r,t])):(c++,e[a?"debug":"warn"](210,[r,t])):e[a?"debug":"warn"](209,[r,t])}))}),r,i+" submitter")}function j(e,t){var n,r=!1,i=e.start;e.start=function(){r=!0,n=setTimeout(i,t)};var s=e.stop;return e.stop=function(){r=!1,clearTimeout(n),s()},e.isRunning=function(){return r},e}var q="events";function B(e){var t=e.settings,n=t.log,r=t.scheduler.eventsPushRate,i=t.startup.eventsFirstPushWindow,s=e.splitApi.postEventsBulk,o=e.storage.events,a=U(n,s,o,r,q);return i>0&&(a=j(a,i)),o.setOnFullQueueCb((function(){a.isRunning()&&(n.info(u,[q]),a.execute())})),a}var z=n(5330);function G(e,t){var n;if(Z(e))for(var r=Object.keys(e),i=0;i<r.length&&!n;i++){var s=r[i];t(e[s],s,e)&&(n=e[s])}else if(Array.isArray(e))for(i=0;i<e.length&&!n;i++){t(e[i],i,e)&&(n=e[i])}return n}function H(e,t){if(Array.isArray(e)&&"function"===typeof t)for(var n=0;n<e.length;n++)if(!0===t(e[n],n,e))return n;return-1}function W(e,t){return Object.keys(e).forEach((function(n){return t(e[n],n,e)})),e}function Q(e,t,n){var r=n;try{var i=t.split("."),s=e;i.forEach((function(e){return s=s[e]})),"undefined"!==typeof s&&(r=s)}catch(o){}return r}function V(e){return!0===e||!1===e}function Y(e){return e instanceof Number&&(e=e.valueOf()),"number"===typeof e&&(Number.isFinite?Number.isFinite(e):isFinite(e))}function J(e){return e instanceof Number&&(e=e.valueOf()),e!==e}function Z(e){return null!==e&&"object"===typeof e&&(e.constructor===Object||null!=e.constructor&&"Object"===e.constructor.name)}function $(e){return"string"===typeof e||e instanceof String}function X(e){return $(e)?e.toUpperCase():e}function ee(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=e;if(Z(t)&&Object.keys(t).forEach((function(e){var n=t[e];Z(n)&&(n=i[e]&&Z(i[e])?ee({},i[e],n):ee({},n)),void 0!==n&&(i[e]=n)})),n&&n.length){var s=n.splice(0,1)[0];i=ee.apply(void 0,(0,z.ev)([i,s],n,!1))}return i}function te(e,t){return!(!$(e)||!$(t))&&e.slice(0,t.length)===t}function ne(e){if("number"===typeof e)return e;if(Z(e)&&"function"===typeof e.valueOf){var t=e.valueOf();e=Z(t)?t+"":t}return"string"!==typeof e?0===e?e:+e:+(e=e.replace(/^\s+|\s+$/g,""))}function re(e){if(null==e)return"";if("string"===typeof e)return e;if(Array.isArray(e))return e.map((function(e){return $(e)?e:""}))+"";var t=e+"";return"0"===t&&1/e===Number.NEGATIVE_INFINITY?"-0":t}function ie(e){var t={};return e.filter((function(e){return!Object.prototype.hasOwnProperty.call(t,e)&&(t[e]=!0)}))}var se="impressions";function oe(e,t){var n=function(e,t){var n={};if(Array.isArray(e)&&$(t))for(var r=0;r<e.length;r++){var i=e[r][t];$(i)&&(n[i]||(n[i]=[]),n[i].push(e[r]))}return n}(t,"feature"),r=[];return W(n,(function(t,n){r.push({f:n,i:t.map((function(t){return{k:t.keyName,t:t.treatment,m:t.time,c:t.changeNumber,r:e?t.label:void 0,b:t.bucketingKey?t.bucketingKey:void 0,pt:t.pt?t.pt:void 0}}))})})),r}function ae(e){var t=e.settings,n=t.log,r=t.scheduler.impressionsRefreshRate,i=t.core.labelsEnabled,s=e.splitApi.postTestImpressionsBulk,o=e.storage.impressions,a=U(n,s,o,r,se,oe.bind(void 0,i),1);return o.setOnFullQueueCb((function(){a.isRunning()&&(n.info(u,[se]),a.execute())}
2)),a}function ue(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++){var i=n[r].split("::");if(2===i.length){var s=i[0],o=i[1],a={f:s,m:Number(o),rc:e[n[r]]};t.push(a)}}return{pf:t}}var ce="state::splits-arrived",le="state::splits-cache-loaded",fe="state::segments-arrived",he="init::timeout",pe="init::ready",de="init::cache-ready",ge="state::update";var me=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/;function ve(e,t,n,r){if(void 0===r&&(r="feature flag name"),void 0==t)e.error(l,[n,r]);else if($(t)){if(me.test(t)&&(e.warn(214,[n,r,t]),t=t.trim()),t.length>0)return t;e.error(h,[n,r])}else e.error(f,[n,r]);return!1}function ye(e,t,n,r,i){if(void 0===r&&(r="feature flag names"),void 0===i&&(i="feature flag name"),Array.isArray(t)&&t.length>0){var s=[];if(t.forEach((function(t){var r=ve(e,t,n,i);r&&s.push(r)})),s.length)return ie(s)}return e.error(320,[n,r]),!1}var Se=[{type:"byName",maxLength:400,queryParam:"names="},{type:"byPrefix",maxLength:50,queryParam:"prefixes="}];function be(e,t,n){var r={validFilters:[],queryString:null,groupedFilters:{byName:[],byPrefix:[]}};return t?n!==w?(e.warn(219,[w]),r):Array.isArray(t)&&0!==t.length?(r.validFilters=t.filter((function(t,n){return t&&(i=t.type,Se.some((function(e){return e.type===i})))&&Array.isArray(t.values)?(r.groupedFilters[t.type]=r.groupedFilters[t.type].concat(t.values),!0):(e.warn(220,[n]),!1);var i})),Se.forEach((function(t){var n=t.type,i=t.maxLength;r.groupedFilters[n].length>0&&(r.groupedFilters[n]=function(e,t,n,r){var i=ye(e,n,p,t+" filter",t+" filter value");if(i){if(i.length>r)throw new Error(r+" unique values can be specified at most for '"+t+"' filter. You passed "+i.length+". Please consider reducing the amount or using other filter.");i.sort()}return i||[]}(e,n,r.groupedFilters[n],i))})),r.queryString=function(e){var t=[];return Se.forEach((function(n){var r=n.type,i=n.queryParam,s=e[r];s.length>0&&t.push(i+s.map((function(e){return encodeURIComponent(e)})).join(","))})),t.length>0?"&"+t.join("&"):null}(r.groupedFilters),e.debug(39,[r.queryString]),r):(e.warn(221),r):r}function Te(e,t,n,r){if(void 0==t)return e.error(l,[n,r]),!1;if(Y(t))return e.warn(213,[n,r,t]),re(t);if($(t)){if((t=t.trim()).length>0&&t.length<=250)return t;0===t.length?e.error(h,[n,r]):t.length>250&&e.error(316,[n,r])}else e.error(f,[n,r]);return!1}function Ee(e,t,n){if(Z(t)){var r=Te(e,t.matchingKey,n,"matchingKey"),i=Te(e,t.bucketingKey,n,"bucketingKey");return r&&i?{matchingKey:r,bucketingKey:i}:(e.error(317,[n]),!1)}return Te(e,t,n,"key")}var ke=/[A-Z]/,_e="traffic_type";function we(e,t,n){if(void 0==t)e.error(l,[n,_e]);else if($(t)){if(0!==t.length)return ke.test(t)&&(e.warn(216,[n]),t=t.toLowerCase()),t;e.error(h,[n,_e])}else e.error(f,[n,_e]);return!1}var Ce={mode:w,core:{authorizationKey:void 0,key:void 0,trafficType:void 0,labelsEnabled:!0,IPAddressesEnabled:void 0},scheduler:{featuresRefreshRate:60,segmentsRefreshRate:60,telemetryRefreshRate:3600,impressionsRefreshRate:300,offlineRefreshRate:15,eventsPushRate:60,eventsQueueSize:500,impressionsQueueSize:3e4,pushRetryBackoffBase:1},urls:{sdk:"https://sdk.split.io/api",events:"https://events.split.io/api",auth:"https://auth.split.io/api",streaming:"https://streaming.split.io",telemetry:"https://telemetry.split.io/api"},storage:void 0,debug:void 0,impressionListener:void 0,version:void 0,integrations:void 0,streamingEnabled:!0,sync:{splitFilters:void 0,impressionsMode:E,localhostMode:void 0,enabled:!0},log:void 0};function Re(e){return Math.round(1e3*e)}function Ae(e,t){var n=t.defaults,r=t.runtime,i=t.storage,s=t.integrations,o=t.logger,a=t.localhost,u=t.consent,c=ee({},Ce,n,e),l=o(c);c.log=l,c.sync.impressionsMode=function(e,t){return t=X(t),[T,E,k].indexOf(t)>-1?t:(e.error(321,["impressionsMode",[T,E,k],E]),E)}(l,c.sync.impressionsMode);var f,h,p,d=c.scheduler,g=c.startup;d.featuresRefreshRate=Re(d.featuresRefreshRate),d.segmentsRefreshRate=Re(d.segmentsRefreshRate),d.offlineRefreshRate=Re(d.offlineRefreshRate),d.eventsPushRate=Re(d.eventsPushRate),d.telemetryRefreshRate=Re((f="telemetryRefreshRate",(h=d.telemetryRefreshRate)>=(p=60)?h:(l.error(326,[f,p]),p))),void 0===Q(e,"scheduler.impressionsRefreshRate")&&c.sync.impressionsMode===T&&(d.impressionsRefreshRate=60),d.impressionsRefreshRate=Re(d.impressionsRefreshRate),d.metricsRefreshRate&&l.warn("`metricsRefreshRate` will be deprecated soon. For configuring telemetry rates, update `telemetryRefreshRate` value in configs"),g.requestTimeoutBeforeReady=Re(g.requestTimeoutBeforeReady),g.readyTimeout=Re(g.readyTimeout),g.eventsFirstPushWindow=Re(g.eventsFirstPushWindow),c.mode=function(e,t){if("localhost"===e)return _;if(-1===[w,C,R,A].indexOf(t))throw Error("Invalid mode provided");return t}(c.core.authorizationKey,c.mode),i&&(c.storage=i(c));var m=c.core.key;if(t.acceptKey){if(c.mode===_&&void 0===m?c.core.key="localhost_key":c.core.key=Ee(l,m,"Client instantiation"),t.acceptTT){var v=c.core.trafficType;void 0!==v&&(c.core.trafficType=we(l,v,"Client instantiation"))}}else void 0!==m&&l.warn("Provided `key` is ignored in server-side SDK."),c.core.key=void 0;c.runtime=r(c),s&&(c.integrations=s(c)),a&&(c.sync.localhostMode=
2a(c)),!1!==c.streamingEnabled&&(c.streamingEnabled=!0,d.pushRetryBackoffBase=Re(d.pushRetryBackoffBase)),!1!==c.sync.enabled&&(c.sync.enabled=!0);var y=be(l,c.sync.splitFilters,c.mode);return c.sync.splitFilters=y.validFilters,c.sync.__splitFiltersValidation=y,c.userConsent=u(c),c}var Ne="sdk_key";var Oe,Ie,Le,De={};function Me(e,t){var n=function(e,t){var n=!1;return void 0==t?e.error(l,[d,Ne]):$(t)?t.length>0?n=t:e.error(h,[d,Ne]):e.error(f,[d,Ne]),n}(e,t);return n&&(De[n]?(e.warn(222,[De[n]+" factory/ies with this SDK Key"]),De[n]++):(De[n]=1,Object.keys(De).length>1&&e.warn(222,["an instance of the Split factory"]))),n}function Ke(e){var t=e();return function(){return Math.round(e()-t)}}var Fe=((Oe={})[w]=0,Oe[R]=1,Oe[A]=2,Oe),xe=((Ie={})[E]=0,Ie[T]=1,Ie[k]=2,Ie),Pe=((Le={}).UNKNOWN=1,Le.GRANTED=2,Le.DECLINED=3,Le);function Ue(e,t){return{isEmpty:function(){return!1},clear:function(){},pop:function(){var n=t.urls,r=t.scheduler,i=void 0!==t.core.key;return a(function(e,t){return{oM:Fe[e],st:t.toLowerCase(),aF:Object.keys(De).length,rF:Object.keys(De).reduce((function(e,t){return e+De[t]-1}),0)}}(t.mode,t.storage.type),{sE:t.streamingEnabled,rR:{sp:r.featuresRefreshRate/1e3,se:i?void 0:r.segmentsRefreshRate/1e3,ms:i?r.segmentsRefreshRate/1e3:void 0,im:r.impressionsRefreshRate/1e3,ev:r.eventsPushRate/1e3,te:r.telemetryRefreshRate/1e3},uO:{s:n.sdk!==Ce.urls.sdk,e:n.events!==Ce.urls.events,a:n.auth!==Ce.urls.auth,st:n.streaming!==Ce.urls.streaming,t:n.telemetry!==Ce.urls.telemetry},iQ:r.impressionsQueueSize,eQ:r.eventsQueueSize,iM:xe[t.sync.impressionsMode],iL:!!t.impressionListener,hP:!1,tR:e.getTimeUntilReady(),tC:e.getTimeUntilReadyFromCache(),nR:e.getNonReadyUsage(),t:e.popTags(),i:t.integrations&&t.integrations.map((function(e){return e.type})),uC:t.userConsent?Pe[t.userConsent]:0})}}}var je="unique keys";function qe(e){var t=[ae(e),B(e)],n=function(e){var t=e.settings.log,n=e.splitApi.postTestImpressionsCount,r=e.storage.impressionCounts;if(r)return U(t,n,r,18e5,"impression counts",ue,1)}(e);n&&t.push(n);var r=function(e){var t=e.storage.telemetry,n=e.platform.now;if(t&&n){var r=e.settings,i=e.settings,s=i.log,o=i.scheduler.telemetryRefreshRate,a=e.splitApi,u=e.readiness,c=e.sdkReadinessManager,l=Ke(n),f=j(U(s,a.postMetricsUsage,t,o,"telemetry stats",void 0,0,!0),o);return u.gate.once(de,(function(){t.recordTimeUntilReadyFromCache(l())})),c.incInternalReadyCbCount(),u.gate.once(pe,(function(){t.recordTimeUntilReady(l()),f.isRunning()&&U(s,a.postMetricsConfig,Ue(t,r),0,"telemetry config",void 0,0,!0).execute()})),f}}(e);return e.storage.uniqueKeys&&t.push(function(e){var t=e.settings,n=t.log,r=t.core.key,i=e.splitApi,s=i.postUniqueKeysBulkCs,o=i.postUniqueKeysBulkSs,a=e.storage.uniqueKeys,c=U(n,void 0!==r?s:o,a,9e5,je);return a.setOnFullQueueCb((function(){c.isRunning()&&(n.info(u,[je]),c.execute())})),c}(e)),{start:function(e){e||t.forEach((function(e){return e.start()})),r&&r.start()},stop:function(e){t.forEach((function(e){return e.stop()})),!e&&r&&r.stop()},isRunning:function(){return t.some((function(e){return e.isRunning()}))},execute:function(e){var n=e?[]:t.map((function(e){return e.execute()}));return r&&n.push(r.execute()),Promise.all(n)},isExecuting:function(){return t.some((function(e){return e.isExecuting()}))}}}var Be,ze="PUSH_NONRETRYABLE_ERROR",Ge="PUSH_RETRYABLE_ERROR",He="PUSH_SUBSYSTEM_UP",We="PUSH_SUBSYSTEM_DOWN",Qe="MY_SEGMENTS_UPDATE",Ve="MY_SEGMENTS_UPDATE_V2",Ye="SEGMENT_UPDATE",Je="SPLIT_KILL",Ze="SPLIT_UPDATE",$e="CONTROL",Xe="OCCUPANCY";function et(e){var t=e.userConsent;return!t||t===I}!function(e){e.STREAMING_DISABLED="STREAMING_DISABLED",e.STREAMING_PAUSED="STREAMING_PAUSED",e.STREAMING_RESUMED="STREAMING_RESUMED",e.STREAMING_RESET="STREAMING_RESET"}(Be||(Be={}));var tt=function(){function e(t,n,r){this.baseMillis=e.__TEST__BASE_MILLIS||n||e.DEFAULT_BASE_MILLIS,this.maxMillis=e.__TEST__MAX_MILLIS||r||e.DEFAULT_MAX_MILLIS,this.attempts=0,this.cb=t}return e.prototype.scheduleCall=function(){var e=this,t=Math.min(this.baseMillis*Math.pow(2,this.attempts),this.maxMillis);return this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout((function(){e.timeoutID=void 0,e.cb()}),t),this.attempts++,t},e.prototype.reset=function(){this.attempts=0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=void 0)},e.DEFAULT_BASE_MILLIS=1e3,e.DEFAULT_MAX_MILLIS=18e5,e}();var nt=[/control_pri$/,/control_sec$/],rt=[10,20];function it(e,t,n){var r=function(e,t){var n=nt.map((function(e){return{regex:e,hasPublishers:!0,oTime:-1,cTime:-1}})),r=!0,i=!0;return{handleOpen:function(){t.streamingEvent(0),e.emit(He)},isStreamingUp:function(){return i&&r},handleOccupancyEvent:function(s,o,a){for(var u=0;u<n.length;u++){var c=n[u];if(c.regex.test(o)){if(t.streamingEvent(rt[u],s),a>c.oTime){c.oTime=a,c.hasPublishers=0!==s;var l=n.some((function(e){return e.hasPublishers}));i&&(!l&&r?e.emit(We):l&&!r&&e.emit(He)),r=l}return}}},handleControlEvent:function(s,o,a){if(s!==Be.STREAMING_RESET)for(var u=0;u<n.length;u++){var c=n[u];if(c.regex.test(o))return void(a>
2c.cTime&&(c.cTime=a,s===Be.STREAMING_DISABLED?(t.streamingEvent(30,0),e.emit(ze)):r&&(s===Be.STREAMING_PAUSED&&i?(t.streamingEvent(30,2),e.emit(We)):s!==Be.STREAMING_RESUMED||i||(t.streamingEvent(30,1),e.emit(He))),i=s===Be.STREAMING_RESUMED))}else e.emit(s)}}}(t,n);return{handleOpen:function(){r.handleOpen()},handleError:function(r){var i=r;try{i=function(e){return $(e.data)&&(e.parsedData=JSON.parse(e.data)),e}(r)}catch(o){e.warn(206,[o])}var s=i.parsedData&&i.parsedData.message||i.message;e.error(305,[s]),!function(e){if(e.parsedData&&e.parsedData.code){var t=e.parsedData.code;if(n.streamingEvent(60,t),40140<=t&&t<=40149)return!0;if(4e4<=t&&t<=49999)return!1}else n.streamingEvent(40,1);return!0}(i)?t.emit(ze):t.emit(Ge)},handleMessage:function(n){var i;try{if(i=function(e){if(e.data){var t=JSON.parse(e.data);return t.parsedData=JSON.parse(t.data),t.name&&"[meta]occupancy"===t.name&&(t.parsedData.type=Xe),t}}(n),!i)return}catch(c){return void e.warn(207,[c])}var s=i.parsedData,o=i.data,a=i.channel,u=i.timestamp;if(e.debug(35,[o]),r.isStreamingUp()||-1!==[Xe,$e].indexOf(s.type))switch(s.type){case Ze:case Ye:case Ve:case Je:t.emit(s.type,s);break;case Qe:t.emit(s.type,s,a);break;case Xe:r.handleOccupancyEvent(s.metrics.publishers,a,u);break;case $e:r.handleControlEvent(s.controlType,a,u)}}}}function st(e,t){var n,r,i=0,s=-1,o=!1,a=new tt(u);function u(){if(n=!0,i>s){o=!1;var c=i;e.execute(r,!0).then((function(e){n&&(!1!==e&&(r&&t.trackUpdatesFromSSE("ms"),s=Math.max(s,c)),o?u():a.scheduleCall())}))}else n=!1}return{put:function(e,t){e<=s||e<=i||(i=e,o=!0,r=t,!a.timeoutID&&n||u(),a.reset())},stop:function(){n=!1,a.reset()}}}function ot(e,t,n){var r={};return{put:function(i){var s=i.changeNumber,o=i.segmentName;r[o]||(r[o]=function(r){var i,s,o=0,a=!1,u=new tt(c,1e4,6e4);function c(){i=!0,o>n.getChangeNumber(r)?(a=!1,t.execute(!1,r,!0,s?o:void 0).then((function(){if(i)if(a)c();else{var t=u.attempts+1;if(o<=n.getChangeNumber(r))return e.debug("Refresh completed"+(s?" bypassing the CDN":"")+" in "+t+" attempts."),void(i=!1);if(t<10)return void u.scheduleCall();s?(e.debug("No changes fetched after "+t+" attempts with CDN bypassed."),i=!1):(u.reset(),s=!0,c())}}))):i=!1}return{put:function(e){e<=n.getChangeNumber(r)||e<=o||(o=e,a=!0,s=!1,!u.timeoutID&&i||c(),u.reset())},stop:function(){i=!1,u.reset()}}}(o)),r[o].put(s)},stop:function(){Object.keys(r).forEach((function(e){return r[e].stop()}))}}}var at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function ut(e){var t=String(e).replace(/[=]+$/,"");if(t.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var n="",r=0,i=void 0,s=void 0,o=0;s=t.charAt(o++);~s&&(i=r%4?64*i+s:s,r++%4)?n+=String.fromCharCode(255&i>>(-2*r&6)):0)s=at.indexOf(s);return n}var ct=String.fromCharCode;function lt(e){var t,n,r;return n=function(e){if("string"!==typeof e)throw TypeError("Illegal argument: "+typeof e);var t=0;return function(){return t>=e.length?null:e.charCodeAt(t++)}}(e),r=t=function(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+ct.apply(String,e);e.length+arguments.length>1024&&(t.push(ct.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}(),function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)}(n,(function(e){!function(e,t){var n=null;for("number"===typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(n>>6&31|192),t(63&n|128)):n<65536?(t(n>>12&15|224),t(n>>6&63|128),t(63&n|128)):(t(n>>18&7|240),t(n>>12&63|128),t(n>>6&63|128),t(63&n|128)),n=null}(e,r)})),t()}function ft(e,t){return(65535&e)*t+(((e>>>16)*t&65535)<<16)}function ht(e,t){return e<<t|e>>>32-t}function pt(e,t){t=t||0;for(var n,r=(e=e||"").length%4,i=e.length-r,s=t,o=0,a=3432918353,u=461845907,c=0;c<i;c+=4)o=ft(o=255&e.charCodeAt(c)|(255&e.charCodeAt(c+1))<<8|(255&e.charCodeAt(c+2))<<16|(255&e.charCodeAt(c+3))<<24,a),o=ft(o=ht(o,15),u),s=ft(s=ht(s^=o,13),5)+3864292196;switch(o=0,r){case 3:o^=(255&e.charCodeAt(c+2))<<16;case 2:o^=(255&e.charCodeAt(c+1))<<8;case 1:o=ft(o^=255&e.charCodeAt(c),a),s^=o=ft(o=ht(o,15),u)}return s^=e.length,n=s,n=ft(n^=n>>>16,2246822507),(s=(n=ft(n^=n>>>13,3266489909))^n>>>16)>>>0}function dt(e,t){return pt(lt(e),t>>>0)}function gt(e,t){return Math.abs(dt(e,t)%100)+1}function mt(e){return function(t){return e(t).then((function(e){return e.json()})).then((function(e){if(e.token){var t=function(e){var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(ut(t).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(n)}(e.token);if("number"!==typeof t.iat||"number"!==typeof t.exp)throw new Error('token properties "issuedAt" (iat) or "expiration" (exp) are missing or invalid');var n=JSON.parse(t["x-ably-capability"]);return a({decodedToken:t,channels:n},e)}return e}))}}function vt(e){return function(e){for(var t=String(e),n="",r=void 0,i=void 0,s=0,o=at;t.charAt(0|s)||(o="=",s%1);n+=o.charAt(63&r>>8-s%1*8)){if((i=t.charCodeAt(s+=3/4))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|i}return n}(dt(e,0).toString())}var yt=/^control_/;var St,bt,Tt=function(){function e(e,t,n){if(this.eventSource=n&&n(),!this.eventSource)throw new Error("EventSource API is not available. ");this.streamingUrl=e.urls.streaming+"/sse",this.useHeaders=t,this.headers=function(e){var t={SplitSDKClientKey:$(e.core.authorizationKey)?e.core.authorizationKey.slice(-4):"",SplitSDKVersion:e.version},n=e.runtime,r=n.ip,i=n.hostname;return r&&(t.SplitSDKMachineIP=r),i&&(t.SplitSDKMachineName=i),t}(e)}return e.prototype.setEventHandler=function(e){this.handler=e},e.prototype.open=function(e){this.close();var t=Object.keys(e.channels).map((function(e){var t=yt.test(e)?"[?occupancy=metrics.publishers]":"";return encodeURIComponent(t+e)}
2)).join(","),n=this.streamingUrl+"?channels="+t+"&accessToken="+e.token+"&v=1.1&heartbeats=true";this.connection=new this.eventSource(this.useHeaders?n:n+"&SplitSDKVersion="+this.headers.SplitSDKVersion+"&SplitSDKClientKey="+this.headers.SplitSDKClientKey,this.useHeaders?{headers:this.headers}:void 0),this.handler&&(this.connection.addEventListener("open",this.handler.handleOpen),this.connection.addEventListener("message",this.handler.handleMessage),this.connection.addEventListener("error",this.handler.handleError))},e.prototype.close=function(){this.connection&&this.connection.close()},e}();function Et(e){return Z(e)?e.matchingKey:e}function kt(e){return Z(e)?{matchingKey:e.matchingKey,bucketingKey:e.bucketingKey}:{matchingKey:e,bucketingKey:e}}!function(e){e[e.None=0]="None",e[e.Gzip=1]="Gzip",e[e.Zlib=2]="Zlib"}(St||(St={})),function(e){e[e.UnboundedFetchRequest=0]="UnboundedFetchRequest",e[e.BoundedFetchRequest=1]="BoundedFetchRequest",e[e.KeyList=2]="KeyList",e[e.SegmentRemoval=3]="SegmentRemoval"}(bt||(bt={}));var _t=function(){if([typeof Uint8Array,typeof Uint16Array,typeof Uint32Array].some((function(e){return"function"!=e})))return"global Uint8Array object is not available for gzip/zlib decompression";var e=Uint8Array,t=Uint16Array,n=Uint32Array,r=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(e,r){for(var i=new t(31),s=0;s<31;++s)i[s]=r+=1<<e[s-1];var o=new n(i[30]);for(s=1;s<30;++s)for(var a=i[s];a<i[s+1];++a)o[a]=a-i[s]<<5|s;return[i,o]},a=o(r,2),u=a[0],c=a[1];u[28]=258,c[258]=28;for(var l=o(i,0)[0],f=new t(32768),h=0;h<32768;++h){var p=(43690&h)>>>1|(21845&h)<<1;p=(61680&(p=(52428&p)>>>2|(13107&p)<<2))>>>4|(3855&p)<<4,f[h]=((65280&p)>>>8|(255&p)<<8)>>>1}var d=function(e,n,r){for(var i=e.length,s=0,o=new t(n);s<i;++s)++o[e[s]-1];var a,u=new t(n);for(s=0;s<n;++s)u[s]=u[s-1]+o[s-1]<<1;if(r){a=new t(1<<n);var c=15-n;for(s=0;s<i;++s)if(e[s])for(var l=s<<4|e[s],h=n-e[s],p=u[e[s]-1]++<<h,d=p|(1<<h)-1;p<=d;++p)a[f[p]>>>c]=l}else for(a=new t(i),s=0;s<i;++s)e[s]&&(a[s]=f[u[e[s]-1]++]>>>15-e[s]);return a},g=new e(288);for(h=0;h<144;++h)g[h]=8;for(h=144;h<256;++h)g[h]=9;for(h=256;h<280;++h)g[h]=7;for(h=280;h<288;++h)g[h]=8;var m=new e(32);for(h=0;h<32;++h)m[h]=5;var v=d(g,9,1),y=d(m,5,1),S=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},b=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},T=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)}
2,E=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],k=function e(t,n,r){var i=new Error(n||E[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,e),!r)throw i;return i},_=function(o,a,c){var f=o.length;if(!f||c&&c.f&&!c.l)return a||new e(0);var h=!a||c,p=!c||c.i;c||(c={}),a||(a=new e(3*f));var g=function(t){var n=a.length;if(t>n){var r=new e(Math.max(2*n,t));r.set(a),a=r}},m=c.f||0,E=c.p||0,_=c.b||0,w=c.l,C=c.d,R=c.m,A=c.n,N=8*f;do{if(!w){m=b(o,E,1);var O=b(o,E+1,3);if(E+=3,!O){var I=o[(B=4+((E+7)/8|0))-4]|o[B-3]<<8,L=B+I;if(L>f){p&&k(0);break}h&&g(_+I),a.set(o.subarray(B,L),_),c.b=_+=I,c.p=E=8*L,c.f=m;continue}if(1==O)w=v,C=y,R=9,A=5;else if(2==O){var D=b(o,E,31)+257,M=b(o,E+10,15)+4,K=D+b(o,E+5,31)+1;E+=14;for(var F=new e(K),x=new e(19),P=0;P<M;++P)x[s[P]]=b(o,E+3*P,7);E+=3*M;var U=S(x),j=(1<<U)-1,q=d(x,U,1);for(P=0;P<K;){var B,z=q[b(o,E,j)];if(E+=15&z,(B=z>>>4)<16)F[P++]=B;else{var G=0,H=0;for(16==B?(H=3+b(o,E,3),E+=2,G=F[P-1]):17==B?(H=3+b(o,E,7),E+=3):18==B&&(H=11+b(o,E,127),E+=7);H--;)F[P++]=G}}var W=F.subarray(0,D),Q=F.subarray(D);R=S(W),A=S(Q),w=d(W,R,1),C=d(Q,A,1)}else k(1);if(E>N){p&&k(0);break}}h&&g(_+131072);for(var V=(1<<R)-1,Y=(1<<A)-1,J=E;;J=E){var Z=(G=w[T(o,E)&V])>>>4;if((E+=15&G)>N){p&&k(0);break}if(G||k(2),Z<256)a[_++]=Z;else{if(256==Z){J=E,w=null;break}var $=Z-254;if(Z>264){var X=r[P=Z-257];$=b(o,E,(1<<X)-1)+u[P],E+=X}var ee=C[T(o,E)&Y],te=ee>>>4;ee||k(3),E+=15&ee;Q=l[te];if(te>3){X=i[te];Q+=T(o,E)&(1<<X)-1,E+=X}if(E>N){p&&k(0);break}h&&g(_+131072);for(var ne=_+$;_<ne;_+=4)a[_]=a[_-Q],a[_+1]=a[_+1-Q],a[_+2]=a[_+2-Q],a[_+3]=a[_+3-Q];_=ne}}c.l=w,c.p=J,c.b=_,c.f=m,w&&(m=1,c.m=R,c.d=C,c.n=A)}while(!m);return _==a.length?a:function(r,i,s){(null==i||i<0)&&(i=0),(null==s||s>r.length)&&(s=r.length);var o=new(r instanceof t?t:r instanceof n?n:e)(s-i);return o.set(r.subarray(i,s)),o}(a,0,_)};return{gunzipSync:function(t,n){return _(t.subarray(function(e){31==e[0]&&139==e[1]&&8==e[2]||k(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)}(t),-8),n||new e(function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}(t)))},unzlibSync:function(e,t){return _(((8!=(15&(n=e)[0])||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&k(6,"invalid zlib data"),32&n[1]&&k(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),t);var n}}}();function wt(e,t){var n=function(e){var t=e.split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}(ut(e));if("string"===typeof _t)throw new Error(_t);if(1===t)return _t.gunzipSync(n);if(2===t)return _t.unzlibSync(n);throw new Error("Invalid compression algorithm #"+t)}function Ct(e,t,n){void 0===n&&(n=!0);var r,i=wt(e,t),s=(r=i,String.fromCharCode.apply(null,r));return n&&(s=s.replace(/\d+/g,'"$&"')),JSON.parse(s)}var Rt=function(){function e(e){var t=this;this.__setData__=[],Array.isArray(e)&&e.forEach((function(e){t.add(e)}))}return e.prototype.clear=function(){this.__setData__.length&&(this.__setData__.length=0)},e.prototype.add=function(e){return this.has(e)||this.__setData__.push(e),this},e.prototype.delete=function(e){var t=this.__setData__.indexOf(e);return-1!==t&&(this.__setData__.splice(t,1),!0)},e.prototype.has=function(e){return-1!==this.__setData__.indexOf(e)},e.prototype.forEach=function(e,t){if("function"!==typeof e)throw new TypeError(e+" is not a function");for(var n=0;n<this.__setData__.length;n++){var r=this.__setData__[n];e.call(t,r,r,this)}},Object.defineProperty(e.prototype,"size",{get:function(){return this.__setData__.length},enumerable:!1,configurable:!0}),e}();function At(e){return e instanceof Rt?e.__setData__.slice():Array.from(e)}var Nt="function"===typeof Array.from&&"function"===typeof Set&&Set.prototype&&Set.prototype.values?Set:Rt;function Ot(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function It(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function Lt(e,t){return 32===(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}
2function Dt(e,t){return 0===(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function Mt(e,t){return[e[0]^t[0],e[1]^t[1]]}function Kt(e){return e=Mt(e,[0,e[0]>>>1]),e=Mt(e=It(e,[4283543511,3981806797]),[0,e[0]>>>1]),e=Mt(e=It(e,[3301882366,444984403]),[0,e[0]>>>1])}function Ft(e,t){return function(e,t){t=t||0;for(var n=(e=e||"").length%16,r=e.length-n,i=[0,t],s=[0,t],o=[0,0],a=[0,0],u=[2277735313,289559509],c=[1291169091,658871167],l=0;l<r;l+=16)o=[255&e.charCodeAt(l+4)|(255&e.charCodeAt(l+5))<<8|(255&e.charCodeAt(l+6))<<16|(255&e.charCodeAt(l+7))<<24,255&e.charCodeAt(l)|(255&e.charCodeAt(l+1))<<8|(255&e.charCodeAt(l+2))<<16|(255&e.charCodeAt(l+3))<<24],a=[255&e.charCodeAt(l+12)|(255&e.charCodeAt(l+13))<<8|(255&e.charCodeAt(l+14))<<16|(255&e.charCodeAt(l+15))<<24,255&e.charCodeAt(l+8)|(255&e.charCodeAt(l+9))<<8|(255&e.charCodeAt(l+10))<<16|(255&e.charCodeAt(l+11))<<24],o=Lt(o=It(o,u),31),i=Ot(i=Lt(i=Mt(i,o=It(o,c)),27),s),i=Ot(It(i,[0,5]),[0,1390208809]),a=Lt(a=It(a,c),33),s=Ot(s=Lt(s=Mt(s,a=It(a,u)),31),i),s=Ot(It(s,[0,5]),[0,944331445]);switch(o=[0,0],a=[0,0],n){case 15:a=Mt(a,Dt([0,e.charCodeAt(l+14)],48));case 14:a=Mt(a,Dt([0,e.charCodeAt(l+13)],40));case 13:a=Mt(a,Dt([0,e.charCodeAt(l+12)],32));case 12:a=Mt(a,Dt([0,e.charCodeAt(l+11)],24));case 11:a=Mt(a,Dt([0,e.charCodeAt(l+10)],16));case 10:a=Mt(a,Dt([0,e.charCodeAt(l+9)],8));case 9:a=It(a=Mt(a,[0,e.charCodeAt(l+8)]),c),s=Mt(s,a=It(a=Lt(a,33),u));case 8:o=Mt(o,Dt([0,e.charCodeAt(l+7)],56));case 7:o=Mt(o,Dt([0,e.charCodeAt(l+6)],48));case 6:o=Mt(o,Dt([0,e.charCodeAt(l+5)],40));case 5:o=Mt(o,Dt([0,e.charCodeAt(l+4)],32));case 4:o=Mt(o,Dt([0,e.charCodeAt(l+3)],24));case 3:o=Mt(o,Dt([0,e.charCodeAt(l+2)],16));case 2:o=Mt(o,Dt([0,e.charCodeAt(l+1)],8));case 1:o=It(o=Mt(o,[0,e.charCodeAt(l)]),u),i=Mt(i,o=It(o=Lt(o,31),c))}return i=Ot(i=Mt(i,[0,e.length]),s=Mt(s,[0,e.length])),s=Ot(s,i),i=Ot(i=Kt(i),s=Kt(s)),s=Ot(s,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}(lt(e),t>>>0)}function xt(e){var t,n,r,i=[0];for(t=0;t<e.length;t+=1){for(r=parseInt(e.charAt(t),16),n=i.length-1;n>=0;n-=1)i[n]=16*i[n]+r,r=i[n]/10|0,i[n]%=10;for(;r>0;)i.unshift(r%10),r=r/10|0}return i.join("")}function Pt(e){var t=Ft(e).slice(0,16);return{hex:t,dec:xt(t)}}function Ut(e,t){return e<1?t:new Promise((function(n,r){var i=setTimeout((function(){r(new Error("Operation timed out because it exceeded the configured time limit of "+e+" ms."))}),e);t.then((function(e){clearTimeout(i),n(e)}),(function(e){clearTimeout(i),r(e)}))}))}function jt(e,t,n,r,i,s,o,a){var u=!0,c=!0;function l(e){return c&&(e=Ut(s,e)),e}function f(e){var t;if(Array.isArray(e))t=r.resetSegments(e);else{var s=e.name,o=e.add;r.isInSegment(s)!==o?(t=!0,o?r.addToSegment(s):r.removeFromSegment(s)):t=!1}n.usesSegments()&&(t||u)&&(u=!1,i.emit(fe))}function h(n,r,i){return(r?new Promise((function(e){f(r),e(!0)})):t(a,i,l).then((function(e){return c=!1,f(e),!0}))).catch((function(t){return c&&o>n?(n+=1,e.warn(204,[n,t]),h(n)):(c=!1,!1)}))}return function(e,t){return h(0,e,t)}}function qt(e){var t=new Nt,n=e.reduce((function(e,n){return"ACTIVE"===n.status?(e.added.push([n.name,n]),function(e){for(var t=e.conditions,n=new Nt,r=0;r<t.length;r++)t[r].matcherGroup.matchers.forEach((function(e){"IN_SEGMENT"===e.matcherType&&n.add(e.userDefinedSegmentMatcherData.segmentName)}));return n}(n).forEach((function(e){t.add(e)}))):e.removed.push(n.name),e}),{added:[],removed:[],segments:[]});return n.segments=At(t),n}function Bt(e,t,n,r,i,s,o,a){void 0===s&&(s=0),void 0===o&&(o=0);var u=!0;function c(e){return u&&s&&(e=Ut(s,e)),e}return function(s,l,f){return Promise.resolve(n.getChangeNumber()).then((function h(p,d){void 0===d&&(d=0),e.debug(31,[p]);var g=Promise.resolve(f?{splits:[f.payload],till:f.changeNumber}:t(p,s,l,c)).then((function(t){u=!1;var s=qt(t.splits);return e.debug(32,[s.added.length]),e.debug(33,[s.removed.length]),e.debug(34,[s.segments.length]),Promise.all([n.setChangeNumber(t.till),n.addSplits(s.added),n.removeSplits(s.removed),r.registerSegments(s.segments)]).then((function(){return!i||Promise.resolve(!i.splitsArrived||p!==t.till&&(a||function(e){return Promise.resolve(e.getRegisteredSegments()).then((function(t){return Promise.all(t.map((function(t){return e.getChangeNumber(t)}))).then((function(e){return e.every((function(e){return-1!==e}))}))}))}(r))).catch((function(){return!1})).then((function(e){return e&&i.emit(ce),!0}))}))})).catch((function(t){return e.warn(205,[t]),u&&o>d?(d+=1,e.info(109,[d,t]),h(p,d)):(u=!1,!1)}));return i&&u&&Promise.resolve(n.checkCache()).then((function(e){e&&i.emit(le)})),g}))}}var zt=function(){function e(e){void 0===e&&(e=0),this.maxQueue=e,this.queue=[]}return e.prototype.setOnFullQueueCb=function(e){this.onFullQueue=e},e.prototype.track=function(e){var t;(t=this.queue).push.apply(t,e),this.maxQueue>0&&this.queue.length>=this.maxQueue&&this.onFullQueue&&this.onFullQueue()},e.prototype.clear=function(){this.queue=[]},e.prototype.pop=function(e){var t=this.queue;return this.clear(),e?e.concat(t):t},e.prototype.isEmpty=function(){return 0===this.queue.length},e}();function Gt(e){return e-e%36e5}var Ht=function(){function e(e){void 0===e&&(e=3e4),this.cache={},this.cacheSize=0,this.maxStorage=e}return e.prototype._makeKey=function(e,t){return e+"::"+Gt(t)},e.prototype.track=function(e,t,n){var r=this._makeKey(e,t),i=this.cache[r];this.cache[r]=i?i+n:n,this.onFullQueue&&(this.cacheSize=this.cacheSize+n,this.cacheSize>=this.maxStorage&&this.onFullQueue())},e.prototype.pop=function(e){var t=this.cache;return this.clear(),e?(Object.keys(t).forEach((function(n){e[n]?e[n]+=t[n]:e[n]=t[n]})),e):t},e.prototype.clear=function(){this.cache={},this.cacheSize=0},e.prototype.isEmpty=function(){return 0===Object.keys(this.cache).length},e}(),Wt=function(){function e(e){void 0===e&&(e=0),this.maxQueue=e,this.queue=[],this.queueByteSize=0}return e.prototype.setOnFullQueueCb=function(e){this.onFullQueue=e},e.prototype.track=function(e,t){return void 0===t&&(t=0),this.queueByteSize+=t,this.queue.push(e),this._checkForFlush(),!0},e.prototype.clear=function(){this.queue=[],this.queueByteSize=0},e.prototype.pop=function(e){var t=this.queue;return this.clear(),e?e.concat(t):t},e.prototype.isEmpty=function(){return 0===this.queue.length},e.prototype._checkForFlush=function(){(this.queueByteSize>5242880||this.maxQueue>0&&this.queue.length>=this.maxQueue)&&this.onFullQueue&&this.onFullQueue()},e}(),Qt=/[^.]+$/;var Vt=function(e){function t(t,n){var r=e.call(this,t)||this;return r.matchingKey=n,r.regexSplitsCacheKey=new RegExp("^"+t+"\\.(splits?|trafficType)\\."),r}return(0,z.ZT)(t,e),t.prototype.buildSegmentNameKey=function(e){return this.prefix+"."+this.matchingKey+".segment."+e},t.prototype.extractSegmentName=function(e){var t=this.prefix+"."+this.matchingKey+".segment.";if(te(e,t))return e.substr(t.length)},t.prototype.buildOldSegmentNameKey=function(e){return this.matchingKey+"."+this.prefix+".segment."+e},t.prototype.extractOldSegmentKey=function(e){var t=this.matchingKey+"."+this.prefix+".segment.";if(te(e,t))return e.substr(t.length)},t.prototype.buildLastUpdatedKey=function(){return this.prefix+".splits.lastUpdated"},t.prototype.isSplitsCacheKey=function(e){return this.regexSplitsCacheKey.test(e)},t.prototype.buildSplitsFilterQueryKey=function(){return this.prefix+".splits.filterQuery"},t}(function(){function e(e){void 0===e&&(e="SPLITIO"),this.prefix=e}return e.prototype.buildTrafficTypeKey=function(e){return this.prefix+".trafficType."+e},e.prototype.buildSplitKey=function(e){return this.prefix+".split."+e},e.prototype.buildSplitsTillKey=function(){return this.prefix+".splits.till"},e.prototype.isSplitKey=function(e){return te(e,this.prefix+".split.")},e.prototype.buildSplitKeyPrefix=function(){return this.prefix+".split."},e.prototype.buildSplitsWithSegmentCountKey=function(){return this.prefix+".splits.usingSegments"},e.prototype.buildSegmentNameKey=function(e){return this.prefix+".segment."+e},e.prototype.buildSegmentTillKey=function(e){return this.prefix+".segment."+e+".till"},e.prototype.extractKey=function(e){var t=e.match(Qt);if(t&&t.length)return t[0];throw new Error("Invalid latency key provided")},e}());function Yt(){var e="__SPLITSOFTWARE__";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){return!1}}var Jt=function(){function e(){}return e.prototype.addSplits=function(e){var t=this;return e.map((function(e){return t.addSplit(e[0],e[1])}))},e.prototype.removeSplits=function(e){var t=this;return e.map((function(e){return t.removeSplit(e)}))},e.prototype.getSplits=function(e){var t=this,n={};return e.forEach((function(e){n[e]=t.getSplit(e)})),n},e.prototype.getAll=function(){var e=this;
2return this.getSplitNames().map((function(t){return e.getSplit(t)}))},e.prototype.checkCache=function(){return!1},e.prototype.killLocally=function(e,t,n){var r=this.getSplit(e);if(r&&(!r.changeNumber||r.changeNumber<n)){var i=a({},r);return i.killed=!0,i.defaultTreatment=t,i.changeNumber=n,this.addSplit(e,i)}return!1},e}();function Zt(e){for(var t=e.conditions||[],n=0;n<t.length;n++)for(var r=t[n].matcherGroup.matchers,i=0;i<r.length;i++)if("IN_SEGMENT"===r[i].matcherType)return!0;return!1}var $t="storage:localstorage: ",Xt=function(e){function t(t,n,r,i){void 0===i&&(i={queryString:null,groupedFilters:{byName:[],byPrefix:[]},validFilters:[]});var s=e.call(this)||this;return s.log=t,s.cacheReadyButNeedsToFlush=!1,s.keys=n,s.splitFiltersValidation=i,s._checkExpiration(r),s._checkFilterQuery(),s}return(0,z.ZT)(t,e),t.prototype._decrementCount=function(e){var t=ne(localStorage.getItem(e))-1;t>0?localStorage.setItem(e,t):localStorage.removeItem(e)},t.prototype._decrementCounts=function(e){try{if(e){var t=this.keys.buildTrafficTypeKey(e.trafficTypeName);if(this._decrementCount(t),Zt(e)){var n=this.keys.buildSplitsWithSegmentCountKey();this._decrementCount(n)}}}catch(r){this.log.error($t+r)}},t.prototype._incrementCounts=function(e){try{if(e){var t=this.keys.buildTrafficTypeKey(e.trafficTypeName);if(localStorage.setItem(t,ne(localStorage.getItem(t))+1),Zt(e)){var n=this.keys.buildSplitsWithSegmentCountKey();localStorage.setItem(n,ne(localStorage.getItem(n))+1)}}}catch(r){this.log.error($t+r)}},t.prototype.clear=function(){this.log.info($t+"Flushing Splits data from localStorage");for(var e=localStorage.length,t=[],n=0;n<e;n++){var r=localStorage.key(n);null!=r&&this.keys.isSplitsCacheKey(r)&&t.push(r)}t.forEach((function(e){localStorage.removeItem(e)})),this.hasSync=!1},t.prototype.addSplit=function(e,t){try{var n=this.keys.buildSplitKey(e),r=localStorage.getItem(n),i=r?JSON.parse(r):null;return localStorage.setItem(n,JSON.stringify(t)),this._incrementCounts(t),this._decrementCounts(i),!0}catch(s){return this.log.error($t+s),!1}},t.prototype.removeSplit=function(e){try{var t=this.getSplit(e);return localStorage.removeItem(this.keys.buildSplitKey(e)),this._decrementCounts(t),!0}catch(n){return this.log.error($t+n),!1}},t.prototype.getSplit=function(e){var t=localStorage.getItem(this.keys.buildSplitKey(e));return t&&JSON.parse(t)},t.prototype.setChangeNumber=function(e){if(this.cacheReadyButNeedsToFlush&&(this.clear(),this.cacheReadyButNeedsToFlush=!1),this.updateNewFilter){this.log.info($t+"Split filter query was modified. Updating cache.");var t=this.keys.buildSplitsFilterQueryKey(),n=this.splitFiltersValidation.queryString;try{n?localStorage.setItem(t,n):localStorage.removeItem(t)}catch(r){this.log.error($t+r)}this.updateNewFilter=!1}try{return localStorage.setItem(this.keys.buildSplitsTillKey(),e+""),localStorage.setItem(this.keys.buildLastUpdatedKey(),Date.now()+""),this.hasSync=!0,!0}catch(r){return this.log.error($t+r),!1}},t.prototype.getChangeNumber=function(){var e=localStorage.getItem(this.keys.buildSplitsTillKey());return null!==e?J(e=parseInt(e,10))?-1:e:-1},t.prototype.getSplitNames=function(){for(var e=localStorage.length,t=[],n=0;n<e;){var r=localStorage.key(n);null!=r&&this.keys.isSplitKey(r)&&t.push(this.keys.extractKey(r)),n++}return t},t.prototype.trafficTypeExists=function(e){var t=ne(localStorage.getItem(this.keys.buildTrafficTypeKey(e)));return Y(t)&&t>0},t.prototype.usesSegments=function(){if(!this.hasSync)return!0;var e=localStorage.getItem(this.keys.buildSplitsWithSegmentCountKey()),t=null===e?0:ne(e);return!Y(t)||t>0},t.prototype.checkCache=function(){return this.getChangeNumber()>-1||this.cacheReadyButNeedsToFlush},t.prototype._checkExpiration=function(e){var t=localStorage.getItem(this.keys.buildLastUpdatedKey());null!==t&&!J(t=parseInt(t,10))&&e&&t<e&&this.clear()},t.prototype._checkFilterQuery=function(){var e=this,t=this.splitFiltersValidation,n=t.queryString,r=t.groupedFilters,i=this.keys.buildSplitsFilterQueryKey();if(localStorage.getItem(i)!==n)try{this.updateNewFilter=!0,this.checkCache()&&(localStorage.setItem(this.keys.buildSplitsTillKey(),"-1"),this.get
2SplitNames().forEach((function(t){n&&(r.byName.indexOf(t)>-1||r.byPrefix.some((function(e){return t.startsWith(e+"__")})))?e.cacheReadyButNeedsToFlush=!0:e.removeSplit(t)})))}catch(s){this.log.error($t+s)}},t}(Jt),en=function(){function e(){}return e.prototype.registerSegments=function(e){return!1},e.prototype.setChangeNumber=function(e,t){return!0},e.prototype.getChangeNumber=function(e){return-1},e.prototype.resetSegments=function(e){return!0},e}(),tn=function(e){function t(t,n){var r=e.call(this)||this;return r.log=t,r.keys=n,r}return(0,z.ZT)(t,e),t.prototype.clear=function(){this.log.info($t+"Flushing MySegments data from localStorage"),this.resetSegments([])},t.prototype.addToSegment=function(e){var t=this.keys.buildSegmentNameKey(e);try{return localStorage.setItem(t,"1"),!0}catch(n){return this.log.error($t+n),!1}},t.prototype.removeFromSegment=function(e){var t=this.keys.buildSegmentNameKey(e);try{return localStorage.removeItem(t),!0}catch(n){return this.log.error($t+n),!1}},t.prototype.isInSegment=function(e){return"1"===localStorage.getItem(this.keys.buildSegmentNameKey(e))},t.prototype.resetSegments=function(e){var t,n=this,r=!1,i=Object.keys(localStorage).reduce((function(t,r){var i=n.keys.extractSegmentName(r);if(i)t.push(i);else if(i=n.keys.extractOldSegmentKey(r)){var s=n.keys.buildSegmentNameKey(i);try{!localStorage.getItem(s)&&e.indexOf(i)>-1&&(localStorage.setItem(s,"1"),t.push(i)),localStorage.removeItem(r)}catch(o){n.log.error(o)}}return t}),[]);if(0===e.length&&i.length===e.length)return r;if(i.length!==e.length)r=!0,i.forEach((function(e){return n.removeFromSegment(e)})),e.forEach((function(e){return n.addToSegment(e)}));else{for(t=0;t<e.length&&-1!==i.indexOf(e[t]);t++);t<e.length&&(r=!0,i.forEach((function(e){return n.removeFromSegment(e)})),e.forEach((function(e){return n.addToSegment(e)})))}return r},t.prototype.getRegisteredSegments=function(){var e=this;return Object.keys(localStorage).reduce((function(t,n){var r=e.keys.extractSegmentName(n);return r&&t.push(r),t}),[])},t.prototype.getKeysCount=function(){return 1},t}(en),nn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.segmentCache={},t}return(0,z.ZT)(t,e),t.prototype.clear=function(){this.segmentCache={}},t.prototype.addToSegment=function(e){return this.segmentCache[e]=!0,!0},t.prototype.removeFromSegment=function(e){return delete this.segmentCache[e],!0},t.prototype.isInSegment=function(e){return!0===this.segmentCache[e]},t.prototype.resetSegments=function(e){var t,n=this,r=!1,i=Object.keys(this.segmentCache);
2if(0===e.length&&i.length===e.length)return r;if(i.length!==e.length)r=!0,this.segmentCache={},e.forEach((function(e){n.addToSegment(e)}));else{for(t=0;t<e.length&&this.isInSegment(e[t]);t++);t<e.length&&(r=!0,this.segmentCache={},e.forEach((function(e){n.addToSegment(e)})))}return r},t.prototype.getRegisteredSegments=function(){return Object.keys(this.segmentCache)},t.prototype.getKeysCount=function(){return 1},t}(en),rn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.splitsCache={},t.ttCache={},t.changeNumber=-1,t.splitsWithSegmentsCount=0,t}return(0,z.ZT)(t,e),t.prototype.clear=function(){this.splitsCache={},this.ttCache={},this.changeNumber=-1,this.splitsWithSegmentsCount=0},t.prototype.addSplit=function(e,t){var n=this.getSplit(e);if(n){var r=n.trafficTypeName;this.ttCache[r]--,this.ttCache[r]||delete this.ttCache[r],Zt(n)&&this.splitsWithSegmentsCount--}if(t){this.splitsCache[e]=t;var i=t.trafficTypeName;return this.ttCache[i]=(this.ttCache[i]||0)+1,Zt(t)&&this.splitsWithSegmentsCount++,!0}return!1},t.prototype.removeSplit=function(e){var t=this.getSplit(e);if(t){delete this.splitsCache[e];var n=t.trafficTypeName;return this.ttCache[n]--,this.ttCache[n]||delete this.ttCache[n],Zt(t)&&this.splitsWithSegmentsCount--,!0}return!1},t.prototype.getSplit=function(e){return this.splitsCache[e]||null},t.prototype.setChangeNumber=function(e){return this.changeNumber=e,!0},t.prototype.getChangeNumber=function(){return this.changeNumber},t.prototype.getSplitNames=function(){return Object.keys(this.splitsCache)},t.prototype.trafficTypeExists=function(e){return Y(this.ttCache[e])&&this.ttCache[e]>0},t.prototype.usesSegments=function(){return-1===this.getChangeNumber()||this.splitsWithSegmentsCount>0},t}(Jt),sn="GOOGLE_ANALYTICS_TO_SPLIT",on="SPLIT_TO_GOOGLE_ANALYTICS";function an(e){var t=Math.min(22,Math.max(0,Math.ceil(Math.log(e)/Math.log(1.5))));return J(t)?0:t}function un(e){var t=e.settings;return t.mode!==_&&(void 0===t.core.key||Math.random()<=.001)}var cn=function(){function e(e,t){this.splits=e,this.segments=t,this.e=!0,this.notReadyUsage=0,this.impressionStats=[0,0,0],this.eventStats=[0,0],this.lastSync={},this.httpErrors={},this.httpLatencies={},this.authRejections=0,this.tokenRefreshes=0,this.streamingEvents=[],this.tags=[],this.exceptions={},this.latencies={},this.updatesFromSSE={sp:0,ms:0}}return e.prototype.isEmpty=function(){return this.e},e.prototype.clear=function(){},e.prototype.pop=function(){return this.e=!0,{lS:this.getLastSynchronization(),mL:this.popLatencies(),mE:this.popExceptions(),hE:this.popHttpErrors(),hL:this.popHttpLatencies(),tR:this.popTokenRefreshes(),aR:this.popAuthRejections(),iQ:this.getImpressionStats(0),iDe:this.getImpressionStats(2),iDr:this.getImpressionStats(1),spC:this.splits&&this.splits.getSplitNames().length,seC:this.segments&&this.segments.getRegisteredSegments().length,skC:this.segments&&this.segments.getKeysCount(),sL:this.getSessionLength(),eQ:this.getEventStats(0),eD:this.getEventStats(1),sE:this.popStreamingEvents(),t:this.popTags(),ufs:this.popUpdatesFromSSE()}},e.prototype.getTimeUntilReady=function(){return this.timeUntilReady},e.prototype.recordTimeUntilReady=function(e){this.timeUntilReady=e},e.prototype.getTimeUntilReadyFromCache=function(){return this.timeUntilReadyFromCache},e.prototype.recordTimeUntilReadyFromCache=function(e){this.timeUntilReadyFromCache=e},e.prototype.getNonReadyUsage=function(){return this.notReadyUsage},e.prototype.recordNonReadyUsage=function(){this.notReadyUsage++},e.prototype.getImpressionStats=function(e){return this.impressionStats[e]},e.prototype.recordImpressionStats=function(e,t){this.impressionStats[e]+=t,this.e=!1},e.prototype.getEventStats=function(e){return this.eventStats[e]},e.prototype.recordEventStats=function(e,t){this.eventStats[e]+=t,this.e=!1},e.prototype.getLastSynchronization=function(){return this.lastSync},e.prototype.recordSuccessfulSync=function(e,t){this.lastSync[e]=t,this.e=!1},e.prototype.popHttpErrors=function(){var e=this.httpErrors;return this.httpErrors={},e},e.prototype.recordHttpError=function(e,t){var n=this.httpErrors[e]=this.httpErrors[e]||{};n[t]=(n[t]||0)+1,this.e=!1},e.prototype.popHttpLatencies=function(){var e=this.httpLatencies;return this.httpLatencies={},e},e.prototype.recordHttpLatency=function(e,t){(this.httpLatencies[e]=this.httpLatencies[e]||[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])[an(t)]++,this.e=!1},e.prototype.popAuthRejections=function(){var e=this.authRejections;return this.authRejections=0,e},e.prototype.recordAuthRejections=function(){this.authRejections++,this.e=!1},e.prototype.popTokenRefreshes=function(){var e=this.tokenRefreshes;return this.tokenRefreshes=0,e},e.prototype.recordTokenRefreshes=function(){this.tokenRefreshes++,this.e=!1},e.prototype.popStreamingEvents=function(){return this.streamingEvents.splice(0)},e.prototype.recordStreamingEvents=function(e){this.streamingEvents.length<20&&this.streamingEvents.push(e),this.e=!1},e.prototype.popTags=function(){return this.tags.splice(0)},e.prototype.addTag=function(e){this.tags.length<10&&this.tags.push(e),this.e=!1},e.prototype.getSessionLength=function(){return this.sessionLength},e.prototype.recordSessionLength=function(e){this.sessionLength=e,this.e=!1},e.prototype.popExceptions=function(){var e=this.exceptions;return this.exceptions={},e},e.prototype.recordException=function(e){this.exceptions[e]=(this.exceptions[e]||0)+1,this.e=!1},e.prototype.popLatencies=function(){var e=this.latencies;return this.latencies={},e},e.prototype.recordLatency=function(e,t){(this.latencies[e]=this.latencies[e]||[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])[an(t)]++,this.e=!1},e.prototype.popUpdatesFromSSE=function(){var e=this.updatesFromSSE;return this.updatesFromSSE={sp:0,ms:0},e},e.prototype.recordUpdatesFromSSE=function(e){this.updatesFromSSE[e]++,this.e=!1},e}(),ln=function(){function e(e){void 0===e&&(e=3e4),this.uniqueTrackerSize=0,this.uniqueKeysTracker={},this.maxStorage=e}return e.prototype.setOnFullQueueCb=function(e){this.onFullQueue=e},e.prototype.track=function(e,t){this.uniqueKeysTracker[e]||(this.uniqueKeysTracker[e]=new Nt);var n=this.uniqueKeysTracker[e];n.has(t)||(n.add(t),this.uniqueTrackerSize++),this.uniqueTrackerSize>=this.maxStorage&&this.onFullQueue&&this.onFullQueue()},e.prototype.clear=function(){this.uniqueTrackerSize=0,this.uniqueKeysTracker={}},e.prototype.pop=function(){var e=this.uniqueKeysTracker;return this.clear(),this.fromUniqueKeysCollector(e)},e.prototype.isEmpty=function(){return 0===Object.keys(this.uniqueKeysTracker).length},e.prototype.fromUniqueKeysCollector=function(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],s={k:i,fs:At(e[i])};t.push(s)}return{keys:t}},e}();function fn(e){var t=e.settings,n=t.scheduler,r=n.impressionsQueueSize,i=n.eventsQueueSize,s=t.sync.impressionsMode,o=new rn,a=new nn,u={splits:o,segments:a,impressions:new zt(r),impressionCounts:s!==T?new Ht:void 0,events:new Wt(i),telemetry:un(e)?new cn(o,a):void 0,uniqueKeys:s===k?new ln:void 0,destroy:function(){this.splits.clear(),this.segments.clear(),this.impressions.clear(),this.impressionCounts&&this.impressionCounts.clear(),this.events.clear(),this.uniqueKeys&&this.uniqueKeys.clear()},shared:function(){return{splits:this.splits,segments:new nn,impressions:this.impressions,impressionCounts:this.impressionCounts,events:this.events,telemetry:this.telemetry,destroy:function(){this.splits=new rn,this.segments.clear()}}}};if(e.settings.mode===_){var c=function(){return!0};u.impressions.track=c,u.events.track=c,u.impressionCounts&&(u.impressionCounts.track=c),u.uniqueKeys&&(u.uniqueKeys.track=c)}return u}function hn(e){return void 0!==e&&null!==e&&"function"===typeof e.then}function pn(e,t,n){return!t.isDestroyed()||(e.error(314,[n]),!1)}
2function dn(e,t,n){return!(!t.isReady()&&!t.isReadyFromCache())||(e.warn(203,[n]),!1)}fn.type=N;var gn="definition not found",mn="not ready",vn="exception";function yn(e,t,n,r,i){return!t.isReady()||r!==gn&&null!=r||(e.warn(215,[i,n]),!1)}var Sn="split",bn="splits",Tn="names";function En(e){var t=e.conditions,n=G(t,(function(e){return"ROLLOUT"===e.conditionType}));return n||(n=t[0]),n?n.partitions.map((function(e){return e.treatment})):[]}function kn(e){return e?{name:e.name,trafficType:e.trafficTypeName,killed:e.killed,changeNumber:e.changeNumber||0,treatments:En(e),configs:e.configurations||{}}:null}function _n(e){var t=[];return e.forEach((function(e){var n=kn(e);n&&t.push(n)})),t}function wn(e,t,n){var r=n.readinessManager,i=n.sdkStatus;return a(Object.create(i),{split:function(n){var i=ve(e,n,Sn);if(!pn(e,r,Sn)||!dn(e,r,Sn)||!i)return null;var s=t.getSplit(i);return hn(s)?s.catch((function(){return null})).then((function(t){return yn(e,r,i,t,Sn),kn(t)})):(yn(e,r,i,s,Sn),kn(s))},splits:function(){if(!pn(e,r,bn)||!dn(e,r,bn))return[];var n=t.getAll();return hn(n)?n.catch((function(){return[]})).then(_n):_n(n)},names:function(){if(!pn(e,r,Tn)||!dn(e,r,Tn))return[];var n=t.getSplitNames();return hn(n)?n.catch((function(){return[]})):n}})}var Cn=function(){function e(){this.attributesCache={}}return e.prototype.setAttribute=function(e,t){return this.attributesCache[e]=t,!0},e.prototype.getAttribute=function(e){return this.attributesCache[e]},e.prototype.setAttributes=function(e){return this.attributesCache=a(this.attributesCache,e),!0},e.prototype.getAll=function(){return this.attributesCache},e.prototype.removeAttribute=function(e){return Object.keys(this.attributesCache).indexOf(e)>=0&&(delete this.attributesCache[e],!0)},e.prototype.clear=function(){return this.attributesCache={},!0},e}();function Rn(e,t,n){return void 0==t||Z(t)?t:(e.error(311,[n,"attributes"]),!1)}function An(e,t,n){if(!Rn(e,t,n))return!1;var r=!0;return Object.keys(t).forEach((function(i){(function(e,t,n,r){if(!$(t)||0===t.length)return e.warn(r+": you passed an invalid attribute name, attribute name must be a non-empty string."),!1;var i=$(n),s=Y(n),o=V(n),a=Array.isArray(n);return!!(i||s||o||a)||(e.warn(r+": you passed an invalid attribute value for "+t+". Acceptable types are: string, number, boolean and array of strings."),!1)})(e,i,t[i],n)||(r=!1)})),r}function Nn(e,t,n,r){var i=function(e,t){var n=new Cn,r=t.getTreatment,i=t.getTreatmentWithConfig,s=t.getTreatments,o=t.getTreatmentsWithConfig,u=t.track;function c(e){var t=n.getAll();return Object.keys(t).length>0?a({},t,e):e}return a(t,{getTreatment:function(e,t,n){return r(e,t,c(n))},getTreatmentWithConfig:function(e,t,n){return i(e,t,c(n))},getTreatments:function(e,t,n){return s(e,t,c(n))},getTreatmentsWithConfig:function(e,t,n){return o(e,t,c(n))},track:function(e,t,n,r,i){return u(e,t,n,r,i)},setAttribute:function(t,r){var i={};return i[t]=r,!!An(e,i,"setAttribute")&&(e.debug("stored "+r+" for attribute "+t),n.setAttribute(t,r))},getAttribute:function(t){return e.debug("retrieved attribute "+t),n.getAttribute(t+"")},setAttributes:function(t){return!!An(e,t,"setAttributes")&&n.setAttributes(t)},getAttributes:function(){return n.getAll()},removeAttribute:function(t){return e.debug("removed attribute "+t),n.removeAttribute(t+"")},clearAttributes:function(){return n.clear()}})}(e,t);return a(i,{getTreatment:i.getTreatment.bind(i,n),getTreatmentWithConfig:i.getTreatmentWithConfig.bind(i,n),getTreatments:i.getTreatments.bind(i,n),getTreatmentsWithConfig:i.getTreatmentsWithConfig.bind(i,n),track:r?i.track.bind(i,n,r):i.track.bind(i,n),isClientSide:!0})}var On={UNDEFINED:0,ALL_KEYS:1,IN_SEGMENT:2,WHITELIST:3,EQUAL_TO:4,GREATER_THAN_OR_EQUAL_TO:5,LESS_THAN_OR_EQUAL_TO:6,BETWEEN:7,EQUAL_TO_SET:8,CONTAINS_ANY_OF_SET:9,CONTAINS_ALL_OF_SET:10,PART_OF_SET:11,ENDS_WITH:12,STARTS_WITH:13,CONTAINS_STRING:14,IN_SPLIT_TREATMENT:15,EQUAL_TO_BOOLEAN:16,MATCHES_STRING:17},In="BOOLEAN",Ln="STRING",Dn="NUMBER",Mn="SET",Kn="DATETIME",Fn="NOT_SPECIFIED";function xn(e){return e.whitelist}function Pn(e){return e.value}function Un(e){return new Date(e).setUTCHours(0,0,0,0)}function jn(e){return new Date(e).setUTCSeconds(0,0)}function qn(e){var t=e.map((function(e){var t,n=e.matcherType,r=e.negate,i=e.keySelector,s=e.userDefinedSegmentMatcherData,o=e.whitelistMatcherData,a=e.unaryNumericMatcherData,u=e.betweenMatcherData,c=e.dependencyMatcherData,l=e.booleanMatcherData,f=e.stringMatcherData,h=i&&i.attribute,p=function(e){return On[e]||On.UNDEFINED}(n),d=Ln,g=void 0;return p===On.IN_SEGMENT?g=(t=s)?t.segmentName:void 0:p===On.WHITELIST?g=function(e){return new Nt(e.whitelist)}(o):p===On.EQUAL_TO?(g=Pn(a),d=Dn,"DATETIME"===a.dataType&&(g=Un(g),d=Kn)):p===On.GREATER_THAN_OR_EQUAL_TO||p===On.LESS_THAN_OR_EQUAL_TO?(g=Pn(a),d=Dn,"DATETIME"===a.dataType&&(g=jn(g),d=Kn)):p===On.BETWEEN?(d=Dn,"DATETIME"===(g=u).dataType&&(g.start=jn(g.start),g.end=jn(g.end),d=Kn)):p===On.EQUAL_TO_SET||p===On.CONTAINS_ANY_OF_SET||p===On.CONTAINS_ALL_OF_SET||p===On.PART_OF_SET?(g=xn(o),d=Mn):p===On.STARTS_WITH||p===On.ENDS_WITH||p===On.CONTAINS_STRING?g=xn(o):p===On.IN_SPLIT_TREATMENT?(g=c,d=Fn):p===On.EQUAL_TO_BOOLEAN?(d=In,g=l):p===On.MATCHES_STRING&&(g=f),{attribute:h,negate:r,type:p,value:g,dataType:d}}));return-1===H(t,(function(e){return e.type===On.UNDEFINED}))?t:[]}var Bn=function(){function e(e,t){if(100!==e[e.length-1])throw new RangeError("Provided invali
2d dataset as input");this._ranges=e,this._treatments=t}return e.parse=function(t){var n=t.reduce((function(e,t){var n=t.size,r=t.treatment;return e.ranges.push(e.inc+=n),e.treatments.push(r),e}),{inc:0,ranges:[],treatments:[]});return new e(n.ranges,n.treatments)},e.prototype.getTreatmentFor=function(e){if(e<0||e>100)throw new RangeError("Please provide a value between 0 and 100");var t=H(this._ranges,(function(t){return e<=t}));return this._treatments[t]},e}();var zn=[void 0,function(e){return function(t){return e.debug(4),null!=t}},function(e,t,n){return function(r){var i=n.segments.isInSegment(t,r);return hn(i)?i.then((function(n){return e.debug(18,[t,r,i]),n})):e.debug(18,[t,r,i]),i}},function(e,t){return function(n){var r=t.has(n);return e.debug(22,[n,At(t).join(","),r]),r}},function(e,t){return function(n){var r=n===t;return e.debug(12,[n,t,r]),r}},function(e,t){return function(n){var r=n>=t;return e.debug(15,[n,t,r]),r}},function(e,t){return function(n){var r=n<=t;return e.debug(16,[n,t,r]),r}},function(e,t){return function(n){var r=n>=t.start&&n<=t.end;return e.debug(5,[n,t.start,t.end,r]),r}},function(e,t){return function(n){for(var r=n.length===t.length,i=function(e){H(t,(function(t){return t===n[e]}))<0&&(r=!1)},s=0;s<n.length&&r;s++)i(s);return e.debug(13,[n,t,r]),r}},function(e,t){return function(n){for(var r=!1,i=function(e){H(n,
2(function(n){return n===t[e]}))>=0&&(r=!0)},s=0;s<t.length&&!r;s++)i(s);return e.debug(8,[n,t,r]),r}},function(e,t){return function(n){var r=!0;if(n.length<t.length)r=!1;else for(var i=function(e){H(n,(function(n){return n===t[e]}))<0&&(r=!1)},s=0;s<t.length&&r;s++)i(s);return e.debug(7,[n,t,r]),r}},function(e,t){return function(n){for(var r=n.length<=t.length,i=function(e){H(t,(function(t){return t===n[e]}))<0&&(r=!1)},s=0;s<n.length&&r;s++)i(s);return e.debug(17,[n,t,r]),r}},function(e,t){return function(n){var r=t.some((function(e){return r=e,void 0===i&&(i=!1),!(!$(t=n)||!$(r))&&(i&&(t=t.toLowerCase(),r=r.toLowerCase()),t.slice(t.length-r.length)===r);var t,r,i}));return e.debug(14,[n,t,r]),r}},function(e,t){return function(n){var r=t.some((function(e){return te(n,e)}));return e.debug(21,[n,t,r]),r}},function(e,t){return function(n){var r=t.some((function(e){return $(n)&&n.indexOf(e)>-1}));return e.debug(9,[n,t,r]),r}},function(e,t,n){var r=t.split,i=t.treatments;function s(t,n,r){var i=!1;return Array.isArray(n)&&(i=-1!==n.indexOf(t.treatment)),e.debug(10,[r,t.treatment,t.label,r,n,i]),i}return function(t,o){var a=t.key,u=t.attributes;e.debug(11,[r,JSON.stringify(a),u?"\n attributes: "+JSON.stringify(u):""]);var c=o(e,a,r,u,n);return hn(c)?c.then((function(e){return s(e,i,r)})):s(c,i,r)}},function(e,t){return function(n){var r=t===n;return e.debug(6,[t,n]),r}},function(e,t){return function(n){var r;try{r=new RegExp(t)}catch(s){return e.debug(20,[t]),!1}var i=r.test(n);return e.debug(19,[n,t,i?"yes":"no"]),i}}];function Gn(e,t,n){var r,i=t.type,s=t.value;return zn[i]&&(r=zn[i](e,s,n)),r}function Hn(e,t){return{key:e,attributes:t}}function Wn(e,t,n,r,i){var s,o=function(e,t){switch(e){case On.EQUAL_TO:return"DATETIME"===t?Un:void 0;case On.GREATER_THAN_OR_EQUAL_TO:case On.LESS_THAN_OR_EQUAL_TO:case On.BETWEEN:return"DATETIME"===t?jn:void 0;case On.IN_SPLIT_TREATMENT:return Hn;default:return}}(t,r);switch(r){case Dn:case Kn:s=function(e){var t=ne(e);return isNaN(t)?void 0:t}(n);break;case Ln:s=function(e){var t=e;return Z(e)&&(t=e.matchingKey?e.matchingKey:void 0),re(t)||void 0}(n);break;case Mn:s=function(e){var t=Array.isArray(e)?ie(e.map((function(e){return e+""}))):[];return t.length?t:void 0}(n);break;case In:s=function(e){if(!0===e||!1===e)return e;if("string"===typeof e){var t=e.toLocaleLowerCase();if("true"===t)return!0;if("false"===t)return!1}}(n);break;case Fn:s=n;break;default:s=void 0}return o&&(s=o(s,i)),e.debug(24,[n,r,s instanceof Object?JSON.stringify(s):s]),s}function Qn(e,t,n,r){var i=n.attribute,s=function(e,t,n,r){var i=void 0;return n?r?(i=r[n],e.debug(23,[n,i])):e.warn(201,[n]):i=t,i}(e,t,i,r),o=Wn(e,n.type,s,n.dataType,r);return void 0!==o?o:void e.warn(200,[s+(i?" for attribute "+i:"")])}function Vn(e,t,n,r,i,s){if(t){var o=function(e,t,n,r){var i=gt(t,n),s=r.getTreatmentFor(i);return e.debug(3,[i,t,n,s]),s}(e,n,r,i);return{treatment:o,label:s}}}function Yn(e,t,n,r,i){return function(s,o,a,u,c,l){if("ROLLOUT"===i&&!function(e,t,n){return!(e<100&&gt(t,n)>e)}(a,s.bucketingKey,u))return{treatment:void 0,label:"not in split"};var f=t(s,c,l);return hn(f)?f.then((function(t){return Vn(e,t,s.bucketingKey,o,n,r)})):Vn(e,f,s.bucketingKey,o,n,r)}}function Jn(e,t){function n(t){var n=t.every((function(e){return e}));return e.debug(0,[n]),n}return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=t.map((function(t){return t.apply(void 0,e)}));return-1!==H(i,hn)?Promise.all(i).then(n):n(i)}}function Zn(e,t,n){for(var r=[],i=0;i<t.length;i++){var s=t[i],o=s.matcherGroup,a=s.partitions,u=s.label,c=s.conditionType,l=qn(o.matchers).map((function(t){var r=Gn(e,t,n);return function(n,i,s){var o=Qn(e,n,t,i),a=!(void 0===o||!r)&&r(o,s);return hn(a)?a.then((function(e){return Boolean(e^t.negate)})):Boolean(a^t.negate)}}));if(0===l.length){r=[];break}r.push(Yn(e,Jn(e,l),Bn.parse(a),u,c))}return function(e,t){function n(t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(void 0!==i)return e.debug(1,[i.treatment]),i}e.debug(2)}return!Array.isArray(t)||Array.isArray(t)&&0===t.length?function(){return e.error(300),{treatment:v,label:vn}}:function(e,r,i,s,o,a){var u=t.map((function(t){return t(e,r,i,s,o,a)}));return-1!==H(u,hn)?Promise.all(u).then((function(e){return n(e)})):n(u)}}(e,r)}function $n(e,t){return{treatment:Q(e,"treatment",t),label:Q(e,"label","default rule")}}var Xn=function(){function e(e,t){this.baseInfo=e,this.evaluator=t,"string"!==typeof this.baseInfo.defaultTreatment&&(this.baseInfo.defaultTreatment=v)}return e.parse=function(t,n,r){return new e(n,Zn(t,n.conditions,r))},e.prototype.getKey=function(){return this.baseInfo.name},e.prototype.getTreatment=function(e,t,n){var r,i,s,o=this.baseInfo,a=o.killed,u=o.seed,c=o.defaultTreatment,l=o.trafficAllocation,f=o.trafficAllocationSeed;try{r=kt(e)}catch(p){return{treatment:v,label:vn}}
2if(this.isGarbage())i=v,s="archived";else{if(!a){var h=this.evaluator(r,u,l,f,t,n);return hn(h)?h.then((function(e){return $n(e,c)})):$n(h,c)}i=c,s="killed"}return{treatment:i,label:s}},e.prototype.isGarbage=function(){return"ARCHIVED"===this.baseInfo.status},e.prototype.getChangeNumber=function(){return this.baseInfo.changeNumber},e}(),er={treatment:v,label:vn,config:null};function tr(e){var t={};return e.forEach((function(e){t[e]=er})),t}function nr(e,t,n,r,i){var s;try{s=i.splits.getSplit(n)}catch(o){return er}return hn(s)?s.then((function(n){return rr(e,n,t,r,i)})).catch((function(){return er})):rr(e,s,t,r,i)}function rr(e,t,n,r,i){var s={treatment:v,label:gn,config:null};if(t){var o=Xn.parse(e,t,i);if(hn(s=o.getTreatment(n,r,nr)))return s.then((function(e){return e.changeNumber=o.getChangeNumber(),e.config=t.configurations&&t.configurations[e.treatment]||null,e}));s.changeNumber=o.getChangeNumber(),s.config=t.configurations&&t.configurations[s.treatment]||null}return s}function ir(e,t,n,r,i,s){var o={},a=[];return t.forEach((function(t){var u=rr(e,n[t],r,i,s);hn(u)?a.push(u.then((function(e){o[t]=e}))):o[t]=u})),a.length>0?Promise.all(a).then((function(){return o})):o}function sr(e,t,n){e.warn(217,[n,t])}function or(e){return-1===[R,A].indexOf(e.mode)}var ar={treatment:v,label:mn};function ur(e){var t={};return e.forEach((function(e){t[e]=ar})),t}function cr(e){var t=e.sdkReadinessManager.readinessManager,n=e.storage,r=e.settings,i=e.impressionsTracker,s=e.eventTracker,o=e.telemetryTracker,a=r.log,u=r.mode;function c(e,s,u,c){void 0===c&&(c=!1);var l=o.trackEval(c?"tc":"t"),h=function(t){var n=[],r=f(t,s,e,u,c,"getTreatment"+(c?"withConfig":""),n);return i.track(n,u),l(n[0]&&n[0].label),r},p=t.isReady()||t.isReadyFromCache()?nr(a,e,s,u,n):or(r)?ar:Promise.resolve(ar);return hn(p)?p.then((function(e){return h(e)})):h(p)}function l(e,s,u,c){void 0===c&&(c=!1);var l=o.trackEval(c?"tcs":"ts"),h=function(t){var n=[],r={};return Object.keys(t).forEach((function(i){r[i]=f(t[i],i,e,u,c,"getTreatments"+(c?"withConfig":""),n)})),i.track(n,u),l(n[0]&&n[0].label),r},p=t.isReady()||t.isReadyFromCache()?function(e,t,n,r,i){var s;try{s=i.splits.getSplits(n)}catch(o){return tr(n)}return hn(s)?s.then((function(s){return ir(e,n,s,t,r,i)})).catch((function(){return tr(n)})):ir(e,n,s,t,r,i)}(a,e,s,u,n):or(r)?ur(s):Promise.resolve(ur(s));return hn(p)?p.then((function(e){return h(e)})):h(p)}function f(e,n,r,i,s,o,u){var c=Et(r),l=function(e){return Z(e)?e.bucketingKey:void 0}(r),f=e.treatment,h=e.label,p=e.changeNumber,d=e.config,g=void 0===d?null:d;return a.info(102,[n,c,f,h]),yn(a,t,n,h,o)&&(a.info(103),u.push({feature:n,keyName:c,treatment:f,time:Date.now(),bucketingKey:l,label:h,changeNumber:p})),s?{treatment:f,config:g}:f}return{getTreatment:c,getTreatmentWithConfig:function(e,t,n){return c(e,t,n,!0)},getTreatments:l,getTreatmentsWithConfig:function(e,t,n){return l(e,t,n,!0)},track:function(e,r,i,c,l,f){void 0===f&&(f=1024);var h=o.trackEval("tr"),p=Et(e),d={eventTypeId:i,trafficTypeName:r,value:c,timestamp:Date.now(),key:p,properties:l};!function(e,t,n,r,i,s){if(!t.isReady()||r===_)return!0;var o=n.trafficTypeExists(i);hn(o)?o.then((function(t){return t||sr(e,i,s),t})):o||sr(e,i,s)}(a,t,n.splits,u,r,"track");var g=s.track(d,f);return hn(g)?g.then((function(e){return h(),e})):(h(),g)},isClientSide:!1}}var lr=/^[a-zA-Z0-9][-_.:a-zA-Z0-9]{0,79}$/,fr="event_type";function hr(e,t,n){if(void 0==t)e.error(l,[n,fr]);else if($(t))if(0===t.length)e.error(h,[n,fr]);else{if(lr.test(t))return t;e.error(310,[n,t])}else e.error(f,[n,fr]);return!1}function pr(e,t,n){return Y(t)||void 0==t?t:(e.error(313,[n]),!1)}var dr=0,gr=2,mr=4,vr=8,yr=1024;function Sr(e,t,n){if(void 0==t)return{properties:null,size:yr};if(!Z(t))return e.error(311,[n,"properties"]),{properties:!1,size:yr};var r=Object.keys(t),i=a({},t),s={properties:i,size:yr};r.length>300&&e.warn(212,[n]);for(var o=0;o<r.length;o++){s.size+=r[o].length*gr;var u=i[r[o]],c=$(u),l=Y(u),f=V(u),h=null===u;if(c||l||f||h||(i[r[o]]=null,u=null,h=!0,e.warn(211,[n,r[o]])),h?s.size+=dr:l?s.size+=vr:f?s.size+=mr:c&&(s.size+=u.length*gr),s.size>32768){e.error(312,[n]),s.properties=!1;break}}return s}function br(e,t){var n=e.sdkReadinessManager,r=e.syncManager,i=e.storage,s=e.signalListener,o=e.settings,u=e.telemetryTracker,c=e.uniqueKeysTracker,l=0;function f(){return r?r.flush():Promise.resolve()}return a(Object.create(n.sdkStatus),function(e,t,n){var r=e.log,i=or(e);function s(e,t,i,s){var o=te(s,"getTreatments"),a=Ee(r,e,s),u=o?ye(r,t,s):ve(r,t,s),c=Rn(r,i,s),l=pn(r,n,s);return dn(r,n,s),{valid:l&&a&&u&&!1!==c,key:a,splitOrSplits:u,attributes:c}}function o(e){return i?e:Promise.resolve(e)}return{getTreatment:function(e,n,r){var i=s(e,n,r,"getTreatment");return i.valid?t.getTreatment(i.key,i.splitOrSplits,i.attributes):o(v)},getTreatmentWithConfig:function(e,n,r){var i=s(e,n,r,"getTreatmentWithConfig");return i.valid?t.getTreatmentWithConfig(i.key,i.splitOrSplits,i.attributes):o(a({},y))},getTreatments:function(e,n,r){var i=s(e,n,r,"getTreatments");if(i.valid)return t.getTreatments(i.key,i.splitOrSplits,i.attributes);var a={};
2return i.splitOrSplits&&i.splitOrSplits.forEach((function(e){return a[e]=v})),o(a)},getTreatmentsWithConfig:function(e,n,r){var i=s(e,n,r,"getTreatmentsWithConfig");if(i.valid)return t.getTreatmentsWithConfig(i.key,i.splitOrSplits,i.attributes);var u={};return i.splitOrSplits&&i.splitOrSplits.forEach((function(e){return u[e]=a({},y)})),o(u)},track:function(e,s,o,a,u){var c=Ee(r,e,"track"),l=we(r,s,"track"),f=hr(r,o,"track"),h=pr(r,a,"track"),p=Sr(r,u,"track"),d=p.properties,g=p.size;return pn(r,n,"track")&&c&&l&&f&&!1!==h&&!1!==d?t.track(c,l,f,h,d,g):!i&&Promise.resolve(!1)}}}(o,cr(e),n.readinessManager),{flush:function(){return function(e,t){var n=Date.now(),r=n-l;return r<t?(o.log.warn("Flush cooldown, remaining time "+(t-r)/1e3+" seconds"),Promise.resolve()):(l=n,e())}(f,1e3)},destroy:function(){return n.readinessManager.destroy(),t||u.sessionLength(),r&&r.stop(),f().then((function(){var e;return s&&s.stop(),t||(e=o.core.authorizationKey,De[e]&&De[e]--,0===De[e]&&delete De[e]),c&&c.stop(),i.destroy()}))}})}function Tr(e,t){return(e.matchingKey?e.matchingKey:e)+"-"+(e.bucketingKey?e.bucketingKey:e)+"-"+(void 0!==t?t:"")}var Er="Client instantiation";function kr(e){var t=e.storage,n=e.syncManager,r=e.sdkReadinessManager,i=e.settings,s=i.core,o=s.key,u=s.trafficType,c=i.startup.readyTimeout,l=i.log,f=Nn(l,br(e),o,u),h=Tr(kt(o),u),p={};return p[h]=f,function(i,s){if(void 0===i)return l.debug(27),f;var o,u=Ee(l,i,"Shared "+Er);if(!1===u)throw new Error("Shared Client needs a valid key.");if(void 0!==s&&!1===(o=we(l,s,"Shared "+Er)))throw new Error("Shared Client needs a valid traffic type or no traffic type at all.");var h=Tr(u,o);if(p[h])l.debug(28);else{var d=Et(u),g=r.shared(c),m=t.shared&&t.shared(d,(function(e){e?g.readinessManager.timeout():g.readinessManager.segments.emit(fe)})),v=n&&m&&n.shared(d,g.readinessManager,m);p[h]=Nn(l,br(a({},e,{sdkReadinessManager:g,storage:m||t,syncManager:v,signalListener:void 0}),!0),u,o),v&&v.start(),l.info(104)}return p[h]}}var _r=function(){function e(e){var t=this;this.__mapKeysData__=[],this.__mapValuesData__=[],Array.isArray(e)&&e.forEach((function(e){t.set(e[0],e[1])}))}return e.prototype.clear=function(){this.__mapKeysData__.length&&(this.__mapKeysData__.length=0,this.__mapValuesData__.length=0)},e.prototype.delete=function(e){var t=this.__mapKeysData__.indexOf(e);return-1!==t&&(this.__mapKeysData__.splice(t,1),this.__mapValuesData__.splice(t,1),!0)},e.prototype.forEach=function(e,t){for(var n=0;n<this.__mapKeysData__.length;n++)e.call(t,this.__mapValuesData__[n],this.__mapKeysData__[n],this)},e.prototype.get=function(e){var t=this.__mapKeysData__.indexOf(e);if(-1!==t)return this.__mapValuesData__[t]},e.prototype.has=function(e){return-1!==this.__mapKeysData__.indexOf(e)},e.prototype.set=function(e,t){var n=this.__mapKeysData__.indexOf(e);return-1===n&&(n=this.__mapKeysData__.push(e)-1),this.__mapValuesData__[n]=t,this},Object.defineProperty(e.prototype,"size",{get:function(){return this.__mapKeysData__.length},enumerable:!1,configurable:!0}),e}();var wr="function"===typeof Array.from&&"function"===typeof Map&&Map.prototype&&Map.prototype.values?Map:_r,Cr=function(e,t,n,r){this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null},Rr=function(){function e(){this.tail=null,this.head=null,this.length=0}return e.prototype.removeNode=function(e){if(e&&e instanceof Cr){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t}},e.prototype.unshiftNode=function(e){if(e&&e instanceof Cr&&e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)this.head=new Cr(arguments[e],null,this.head,this),this.tail||(this.tail=this.head),this.length++;return this.length},e}(),Ar=function(){function e(e){this.maxLen=e||1,this.items=new wr,this.lru=new Rr}return e.prototype.get=function(e){var t=this.items.get(e);if(t&&t instanceof Cr)return this.lru.unshiftNode(t),t.value.value},e.prototype.set=function(e,t){var n=this.items.get(e);if(n){if(!(n instanceof Cr))return!1;this.lru.unshiftNode(n),this.lru.head.value.value=t}else{if(this.lru.length===this.maxLen){var r=this.lru.tail;if(!r)return!1;this.items.delete(r.value.key),this.lru.removeNode(this.lru.tail)}this.lru.unshift({key:e,value:t}),this.items.set(e,this.lru.head)}return!0},e}(),Nr=function(){function e(e,t){this.cache=new Ar(e),this.hasher=t}return e.prototype.testAndSet=function(e){var t=this.hasher(e),n=this.cache.get(t);return this.cache.set(t,e.time),n},e}();function Or(e){return dt(function(e){return e.keyName+":"+e.feature+":"+e.treatment+":"+e.label+":"+e.changeNumber}(e))}function Ir(){return new Nr(500,Or)}var Lr="ga-to-split: ",Dr="ga-to-split:mapper";var Mr,Kr=(Mr={eventTypeId:{event:"eventAction",social:"socialAction"},eventValue:{event:"eventValue",timing:"timingValue"},eventProperties:{pageview:["page"],screenview:["screenName"],event:["eventCategory","eventLabel"],social:["socialNetwork","socialTarget"],timing:["timingCategory","timingVar","timingLabel"],exception:["exDescription","exFatal"]}},function(e){var t=e.get("hitType"),n=e.get(Mr.eventTypeId[t]||"hitType"),r=e.get(Mr.eventValue[t]),i={},s=Mr.eventProperties[t];
2if(s)for(var o=0;o<s.length;o++){var a=e.get(s[o]);void 0!==a&&(i[s[o]]=a)}return{eventTypeId:n,value:r,properties:i,timestamp:Date.now()}});function Fr(e){if(!Array.isArray(e))return[];var t=function(e,t){void 0===t&&(t=JSON.stringify);var n={};return e.filter((function(e){var r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return t.filter((function(e){if(!e)return!1;var t=e.key,n=e.trafficType;return!(!$(t)&&!Y(t))&&!!$(n)}))}var xr=/^[^a-zA-Z0-9]+/,Pr=/[^-_.:a-zA-Z0-9]+/g;function Ur(e,t){var n=t.storage,r=t.settings,i=r.core,s=r.log,o=t.telemetryTracker,u={prefix:"ga",identities:i.key&&i.trafficType?[{key:i.key,trafficType:i.trafficType}]:void 0};!function(e,t,n,r,i,s){var o=e.GoogleAnalyticsObject||"ga";e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o]("provide",t,n);var a=e[o].q&&e[o].q.push!==[].push;i&&!a&&r.error(Lr+"integration is configured to autorequire the splitTracker plugin, but the necessary script does not seem to have run. Please check the docs."),s&&a&&s.addTag("integration:ga-autorequire")}(window,"splitTracker",(function(t,r){var i=a({},u,e,r);this.tracker=t;var o=Fr(i.identities);if(0!==o.length){var c=o.length-i.identities.length;c&&s.warn(Lr+(c+" identities were discarded because they are invalid or duplicated. Identities must be an array of objects with key and trafficType.")),i.identities=o,$(i.prefix)||(s.warn(Lr+"The provided `prefix` was ignored since it is invalid. Please check that you are passing a string object as `prefix`."),i.prefix=void 0);var l=t.get("sendHitTask");t.set("sendHitTask",(function(e){if(l(e),!1!==i.hits&&!e.get("splitHit")){try{if(i.filter&&!i.filter(e))return}catch(r){return void s.warn(Lr+"custom filter threw: "+r)}var t=Kr(e);if(i.mapper){try{t=i.mapper(e,t)}catch(r){return void s.warn(Lr+"custom mapper threw: "+r)}if(!t)return}i.prefix&&(t.eventTypeId=i.prefix+"."+t.eventTypeId),t.eventTypeId=function(e,t){if(!$(t)||0===t.length)return t;var n=t.replace(xr,"").replace(Pr,"_"),r=n.slice(0,80);return r.length<n.length&&e.warn(Lr+"EventTypeId was truncated because it cannot be more than 80 characters long."),r}(s,t.eventTypeId),function(e,t){return!!hr(e,t.eventTypeId,Dr)&&!1!==pr(e,t.value,Dr)&&!1!==Sr(e,t.properties,Dr).properties&&!(t.timestamp&&!Y(t.timestamp))&&(!t.key||!1!==Ee(e,t.key,Dr))&&(!t.trafficTypeName||!1!==we(e,t.trafficTypeName,Dr))}(s,t)&&(t.key&&t.trafficTypeName?n.events.track(t):i.identities.forEach((function(e){var r=a({key:e.key,trafficTypeName:e.trafficType},t);n.events.track(r)})))}})),s.info(Lr+"integration started")}else s.warn(Lr+"No valid identities were provided. Please check that you are passing a valid list of identities or providing a traffic type at the SDK configuration.")}),s,!0===e.autoRequire,o)}var jr="split-to-ga: ",qr="`ga` command queue not found.",Br="No hit was sent.",zr=function(){function e(t,n){this.trackerNames=e.defaultTrackerNames,this.log=t,n&&("function"===typeof n.filter&&(this.filter=n.filter),"function"===typeof n.mapper&&(this.mapper=n.mapper),Array.isArray(n.trackerNames)&&(this.trackerNames=ie(n.trackerNames)),this.impressions=n.impressions,this.events=n.events),t.info("split-to-ga: integration started"),"function"!==typeof e.getGa()&&t.warn(jr+(qr+" No hits will be sent until it is available."))}return e.defaultMapper=function(e){var t=e.type,n=e.payload;switch(t){case S:return{hitType:"event",eventCategory:"split-impression",eventAction:"Evaluate "+n.impression.feature,eventLabel:"Treatment: "+n.impression.treatment+". Targeting rule: "+n.impression.label+".",nonInteraction:!0};case b:return{hitType:"event",eventCategory:"split-event",eventAction:n.eventTypeId,eventValue:n.value,nonInteraction:!0}}},e.getGa=function(){return"undefined"!==typeof window?window[window.GoogleAnalyticsObject||"ga"]:void 0},e.validateFieldsObject=function(e,t){return!(!t||!t.hitType)||(e.warn("split-to-ga: your custom mapper returned an invalid FieldsObject instance. It must be an object with at least a `hitType` field."),!1)},e.prototype.queue=function(t){var n=e.getGa();if(n){if(!1===this.impressions&&t.type===S)return;if(!1===this.events&&t.type===b)return;var r;try{if(this.filter&&!this.filter(t))return;if(r=e.defaultMapper(t),this.mapper&&(!(r=this.mapper(t,r))||!e.validateFieldsObject(this.log,r)))return}catch(i){return void this.log.warn("split-to-ga: queue method threw: "+i+". "+Br)}
2this.trackerNames.forEach((function(e){var t=e?e+".send":"send";r.splitHit=!0,n(t,r)}))}else this.log.warn(jr+(qr+" ")+Br)},e.defaultTrackerNames=[""],e}();function Gr(e,t){var n=e.map((function(e){switch(e.type){case sn:return function(e){function t(t){return Ur(e,t)}return void 0===e&&(e={}),t.type="GOOGLE_ANALYTICS_TO_SPLIT",t}(e);case on:return function(e){function t(t){return new zr(t.settings.log,e)}return void 0===e&&(e={}),t.type="SPLIT_TO_GOOGLE_ANALYTICS",t}(e)}})).filter((function(e){return e&&"function"===typeof e}));return function(e,t){var n=[];if(e.forEach((function(e){var r=e(t);r&&r.queue&&n.push(r)})),0!==n.length)return{handleImpression:function(e){n.forEach((function(t){return t.queue({type:S,payload:e})}))},handleEvent:function(e){n.forEach((function(t){return t.queue({type:b,payload:e})}))}}}(n,t)}function Hr(e){var t=fn(e);return t.splits.checkCache=function(){return!0},t}function Wr(e,t){var n=!1,r=!1;var i=function e(i){var s=new Promise((function(e,n){return i.then(e,(function(e){r?n(e):t(e)}))})),o=s.then;return Object.defineProperty(s,"then",{value:function(t,i){var a=o.call(s,t,i);return"function"===typeof t&&(n=!0),"function"===typeof i?(r=!0,a):e(a)}}),s}(e);return i.hasOnFulfilled=function(){return n},i}function Qr(e,t,n){void 0===t&&(t=0),void 0===n&&(n=function(e){var t=a(new e,{splitsArrived:!1,splitsCacheLoaded:!1});return t.on(ce,(function(e){e||(t.splitsArrived=!0)})),t.once(le,(function(){t.splitsCacheLoaded=!0})),t}(e));var r=function(e){var t=a(new e,{segmentsArrived:!1});return t.once(fe,(function(){t.segmentsArrived=!0}
2)),t}(e),i=new e,s=!1;n.splitsCacheLoaded?s=!0:n.once(le,(function(){if(s=!0,!l)try{i.emit(de)}catch(e){setTimeout((function(){throw e}),0)}}));var o,u=!1;function c(){u||(u=!0,i.emit(he,"Split SDK emitted SDK_READY_TIMED_OUT event."))}t>0&&(o=setTimeout(c,t));var l=!1;n.on(ce,h),r.on(fe,h);var f=!1;function h(e){if(l)try{i.emit(ge,e)}catch(t){setTimeout((function(){throw t}),0)}else if(n.splitsArrived&&r.segmentsArrived){clearTimeout(o),l=!0;try{i.emit(pe)}catch(t){setTimeout((function(){throw t}),0)}}}var p=1;return{splits:n,segments:r,gate:i,shared:function(t){return void 0===t&&(t=0),p++,Qr(e,t,n)},timeout:c,destroy:function(){f=!0,r.removeAllListeners(),i.removeAllListeners(),clearTimeout(o),p>0&&p--,0===p&&n.removeAllListeners()},isReady:function(){return l},hasTimedout:function(){return u},isReadyFromCache:function(){return s},isDestroyed:function(){return f},isOperational:function(){return(l||s)&&!f}}}Hr.type=N;function Vr(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=Qr(t,n));var i=0,s=0;r.gate.on("removeListener",(function(e){e===pe&&s--})),r.gate.on("newListener",(function(t){t!==pe&&t!==he||(r.isReady()?e.error(302,[t===pe?"SDK_READY":"SDK_READY_TIMED_OUT"]):t===pe&&s++)}));var o=function(){var t=Wr(new Promise((function(n,o){r.gate.once(pe,(function(){e.info(101),s!==i||t.hasOnFulfilled()||e.warn(202),n()})),r.gate.once(he,(function(e){o(new Error(e))}))})),u);return t}();function u(t){e.error(t&&t.message)}return r.gate.once(de,(function(){e.info(100)})),{readinessManager:r,shared:function(n){return void 0===n&&(n=0),Vr(e,t,n,r.shared(n))},incInternalReadyCbCount:function(){i++},sdkStatus:a(Object.create(r.gate),{Event:{SDK_READY:pe,SDK_READY_FROM_CACHE:de,SDK_UPDATE:ge,SDK_READY_TIMED_OUT:he},ready:function(){return r.hasTimedout()?r.isReady()?Promise.resolve():Wr(Promise.reject(new Error("Split SDK has emitted SDK_READY_TIMED_OUT event.")),u):o},__getStatus:function(){return{isReady:r.isReady(),isReadyFromCache:r.isReadyFromCache(),isOperational:r.isOperational(),hasTimedout:r.hasTimedout(),isDestroyed:r.isDestroyed()}}})}}var Yr={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR",NONE:"NONE"},Jr={DEBUG:1,INFO:2,WARN:3,ERROR:4,NONE:5};function Zr(e){return!!G(Yr,(function(t){return e===t}))}function $r(e,t){void 0===e&&(e=""),void 0===t&&(t=[]);var n=0;return e.replace(/%s/g,(function(){return t[n++]}))}var Xr={prefix:"splitio",logLevel:Yr.NONE,showLevel:!0},ei=function(){function e(e,t){this.options=a({},Xr,e),this.codes=t||new wr,this.logLevel=Jr[this.options.logLevel]}return e.prototype.setLogLevel=function(e){this.options.logLevel=e,this.logLevel=Jr[e]},e.prototype.debug=function(e,t){this._shouldLog(Jr.DEBUG)&&this._log(Yr.DEBUG,e,t)},e.prototype.info=function(e,t){this._shouldLog(Jr.INFO)&&this._log(Yr.INFO,e,t)},e.prototype.warn=function(e,t){this._shouldLog(Jr.WARN)&&this._log(Yr.WARN,e,t)},e.prototype.error=function(e,t){this._shouldLog(Jr.ERROR)&&this._log(Yr.ERROR,e,t)},e.prototype._log=function(e,t,n){if("number"===typeof t){var r=this.codes.get(t);t=r?$r(r,n):"Message code "+t+(n?", with args: "+n.toString():"")}else n&&(t=$r(t,n));var i=this._generateLogMessage(e,t);console.log(i)},e.prototype._generateLogMessage=function(e,t){var n="";return this.options.showLevel&&(n+="["+e+"]"+(e===Yr.INFO||e===Yr.WARN?" ":"")+" "),this.options.prefix&&(n+=this.options.prefix+" => "),n+t},e.prototype._shouldLog=function(e){return e>=this.logLevel},e}();function ti(e){function t(t){Zr(t)?e.setLogLevel(t):e.error(301)}return{enable:function(){t(Yr.DEBUG)},setLogLevel:t,disable:function(){t(Yr.NONE)},LogLevel:Yr}}var ni={add:function(){return!0},contains:function(){return!0},clear:function(){}};function ri(e){var t=e.settings,n=e.platform,r=e.storageFactory,i=e.splitApiFactory,s=e.extraProps,o=e.syncManagerFactory,u=e.SignalListener,c=e.impressionsObserverFactory,l=e.integrationsManagerFactory,f=e.sdkManagerFactory,h=e.sdkClientMethodFactory,p=e.filterAdapterFactory,d=t.log,g=t.sync.impressionsMode;Me(d,t.core.authorizationKey);var m,v,y,S=Vr(d,n.EventEmitter,t.startup.readyTimeout),b=S.readinessManager,T=r({settings:t,onReadyCb:function(e){e?b.timeout():(b.splits.emit(ce),b.segments.emit(fe))}}),_=function(e,t){if(e&&t){var n=Ke(t);return{trackEval:function(n){var r=Ke(t);return function(t){switch(t){case vn:return void e.recordException(n);
2case mn:e.recordNonReadyUsage&&e.recordNonReadyUsage()}e.recordLatency(n,r())}},trackHttp:function(n){var r=Ke(t);return function(t){e.recordHttpLatency(n,r()),t&&t.statusCode?e.recordHttpError(n,t.statusCode):e.recordSuccessfulSync(n,Date.now())}},sessionLength:function(){e.recordSessionLength&&e.recordSessionLength(n())},streamingEvent:function(t,n){80===t?e.recordAuthRejections():(e.recordStreamingEvents({e:t,d:n,t:Date.now()}),50===t&&e.recordTokenRefreshes())},addTag:function(t){e.addTag&&e.addTag(t)},trackUpdatesFromSSE:function(t){e.recordUpdatesFromSSE(t)}}}var r=function(){return function(){}};return{trackEval:r,trackHttp:r,sessionLength:function(){},streamingEvent:function(){},addTag:function(){},trackUpdatesFromSSE:function(){}}}(T.telemetry,n.now),w=l&&l({settings:t,storage:T,telemetryTracker:_}),C=c(),R=g===k?function(e,t,n){var r;return void 0===n&&(n=ni),n.refreshRate&&(r=setInterval(n.clear,n.refreshRate)),{track:function(r,i){n.add(r,i)?t.track(r,i):e.debug("unique-keys-tracker: The feature "+i+" and key "+r+" exist in the filter")},stop:function(){clearInterval(r)}}}(d,T.uniqueKeys,p&&p()):void 0;switch(g){case E:v=C,y=T.impressionCounts,m={process:function(e){var t=[];return e.forEach((function(e){e.pt=v.testAndSet(e);var n=Date.now();e.pt&&y.track(e.feature,n,1),(!e.pt||e.pt<Gt(n))&&t.push(e)})),{impressionsToStore:t,impressionsToListener:e,deduped:e.length-t.length}}};break;case k:m=function(e,t){return{process:function(n){return n.forEach((function(n){var r=Date.now();e.track(n.feature,r,1),t.track(n.keyName,n.feature)})),{impressionsToStore:[],impressionsToListener:n,deduped:0}}}}(T.impressionCounts,R);break;default:m=function(e){return{process:function(t){return t.forEach((function(t){t.pt=e.testAndSet(t)})),{impressionsToStore:t,impressionsToListener:t,deduped:0}}}}(C)}var A=function(e,t,n,r,i){var s=e.log,o=e.impressionListener,u=e.runtime,c=u.ip,l=u.hostname,f=e.version;return{track:function(u,h){if(e.userConsent!==L){var p=u.length,d=n.process(u),g=d.impressionsToStore,m=d.impressionsToListener,v=d.deduped,y=m.length;if(g.length>0){var S=t.track(g);hn(S)?S.then((function(){s.info(121,[p])})).catch((function(e){s.error(307,[p,e])})):i&&(i.recordImpressionStats(0,g.length),i.recordImpressionStats(2,v))}if(o||r)for(var b=function(e){var t={impression:a({},m[e]),attributes:h,ip:c,hostname:l,sdkLanguageVersion:f};setTimeout((function(){r&&r.handleImpression(t);try{o&&o.logImpression(t)}catch(e){s.error(308,[e])}}),0)},T=0;T<y;T++)b(T)}}}}(t,T.impressions,m,w,T.telemetry),N=function(e,t,n,r){var i=e.log,s=or(e);function o(e,t){var r=e.eventTypeId,s=e.trafficTypeName,o=e.key,u=e.value,c=e.timestamp,l=e.properties,f='event of type "'+r+'" for traffic type "'+s+'". Key: '+o+". Value: "+u+". Timestamp: "+c+". "+(l?"With properties.":"With no properties.");return t?(i.info(120,[f]),n&&setTimeout((function(){var t=a({},e);l&&(t.properties=a({},l)),n.handleEvent(t)}),0)):i.error(309,[f]),t}return{track:function(n,i){if(e.userConsent===L)return!s&&Promise.resolve(!1);var a=t.track(n,i);return hn(a)?a.then(o.bind(null,n)):(r&&r.recordEventStats(a?0:1,1),o(n,a))}}}(t,T.events,w,T.telemetry),O=i&&i(t,n,_),I={splitApi:O,eventTracker:N,impressionsTracker:A,telemetryTracker:_,uniqueKeysTracker:R,sdkReadinessManager:S,readiness:b,settings:t,storage:T,platform:n},D=o&&o(I);I.syncManager=D;var M=u&&new u(D,t,T,O);I.signalListener=M;var K=h(I),F=f(d,T.splits,S);return D&&D.start(),M&&M.start(),d.info(105),a({client:K,manager:function(){return d.debug(29),F},Logger:ti(d),settings:t},s&&s(I))}var ii={GRANTED:I,DECLINED:L,UNKNOWN:D};function si(e){var t=e.settings,n=e.settings.log,r=e.syncManager,i=e.storage,s=i.events,o=i.impressions,a=i.impressionCounts;return et(t)||n.info(124,[t.userConsent]),{setStatus:function(e){var i,u;if(!V(e))return n.warn(325,["UserConsent.setStatus"]),!1;var c=e?I:L;return t.userConsent!==c?(n.info(122,[t.userConsent,c]),t.userConsent=c,e?null===(i=null===r||void 0===r?void 0:r.submitterManager)||void 0===i||i.start():(null===(u=null===r||void 0===r?void 0:r.submitterManager)||void 0===u||u.stop(!0),s.clear&&s.clear(),o.clear&&o.clear(),a&&a.clear&&a.clear())):n.info(123,[c]),!0},getStatus:function(){return t.userConsent},Status:ii}}var oi=!("undefined"===typeof process||"undefined"===typeof process.version||!process.version),ai="Split SDK is ready",ui=[[300,"engine:combiner: Invalid feature flag, no valid rules found"],[301,"logger: Invalid Log Level - No changes to the logs will be applied."],[303,"The SDK will not get ready. Reason: %s"],[307,"impressions-tracker: Could not store impressions bulk with %s 
2impression(s). Error: %s"],[308,"impressions-tracker: Impression listener logImpression method threw: %s."],[309,"events-tracker: Failed to queue %s"],[304,"sync:offline: There was an issue loading the mock feature flags data. No changes will be applied to the current cache. %s"],[305,"sync:streaming: Failed to connect or error on streaming connection, with error message: %s"],[306,"sync:streaming: Failed to authenticate for streaming. Error: %s."],[322,"Response status is not OK. Status: %s. URL: %s. Message: %s"],[302,"A listener was added for %s on the SDK, which has already fired and won't be emitted again. The callback won't be executed."],[314,"%s: Client has already been destroyed - no calls possible."],[310,'%s: you passed "%s", event_type must adhere to the regular expression /^[a-zA-Z0-9][-_.:a-zA-Z0-9]{0,79}$/g. This means an event_type must be alphanumeric, cannot be more than 80 characters long, and can only include a dash, underscore, period, or colon as separators of alphanumeric characters.'],[311,"%s: %s must be a plain object."],[312,"%s: the maximum size allowed for the properties is 32768 bytes, which was exceeded. Event not queued."],[313,"%s: value must be a finite number."],[l,"%s: you passed a null or undefined %s. It must be a non-empty string."],[316,"%s: %s too long. It must have 250 characters or less."],[317,"%s: Key must be an object with bucketingKey and matchingKey with valid string properties."],[f,"%s: you passed an invalid %s. It must be a non-empty string."],[h,"%s: you passed an empty %s. It must be a non-empty string."],[320,"%s: %s must be a non-empty array."],[325,"%s: provided param must be a boolean value."],[321,'settings: you passed an invalid "%s" config param. It should be one of the following values: %s. Defaulting to "%s".'],[323,'settings: an invalid value was received for "sync.localhostMode" config. A valid entity should be provided for localhost mode.'],[324,"settings: the provided storage is invalid.%s Falling back into default MEMORY storage"],[326,'settings: the provided "%s" config param is lower than allowed. Setting to the minimum value %s seconds']].concat([[200,"engine:value: Value %s doesn't match with expected type."],[201,"engine:value: Defined attribute [%s], no attributes received."],[204,"sync:my-segments: Retrying download of segments #%s. Reason: %s"],[205,g+"Error while doing fetch of feature flags. %s"],[206,"sync:streaming: Error parsing SSE error notification: %s"],[207,"sync:streaming: Error parsing SSE message notification: %s"],[208,"sync:streaming: Falling back to polling mode. Reason: %s"],[209,"sync:submitter: Dropping %s after retry. Reason: %s."],[210,"sync:submitter: Failed to push %s, keeping data to retry on next iteration. Reason: %s."],[203,"%s: the SDK is not ready, results may be incorrect. Make sure to wait for SDK readiness before using this method."],[202,"No listeners for SDK Readiness detected. Incorrect control treatments could have been logged if you called getTreatment/s while the SDK was not yet ready."],[211,'%s: Property "%s" is of invalid type. Setting value to null.'],[212,"%s: Event has more than 300 properties. Some of them will be trimmed when processed."],[213,'%s: %s "%s" is not of type string, converting.'],[214,'%s: %s "%s" has extra whitespace, trimming.'],[215,'%s: feature flag "%s" does not exist in this environment. Please double check what feature flags exist in the Split user interface.'],[216,"%s: traffic_type_name should be all lowercase - convert
2ing string to lowercase."],[217,'%s: traffic type "%s" does not have any corresponding feature flag in this environment, make sure you\'re tracking your events to a valid traffic type defined in the Split user interface.'],[218,"settings: %s integration item(s) at settings is invalid. %s"],[219,'settings: feature flag filters have been configured but will have no effect if mode is not "%s", since synchronization is being deferred to an external tool.'],[220,'settings: feature flag filter at position %s is invalid. It must be an object with a valid filter type ("byName" or "byPrefix") and a list of "values".'],[221,"settings: feature flag filter configuration must be a non-empty array of filter objects."],[222,"settings: You already have %s. We recommend keeping only one instance of the factory at all times (Singleton pattern) and reusing it throughout your application"],[c,"sync:streaming: Fetching MySegments due to an error processing %s notification: %s"],[224,"sync:streaming: Fetching SplitChanges due to an error processing SPLIT_UPDATE notification: %s"]]).concat([[100,ai+" from cache"],[101,ai],[102,"impressions-tracker: Feature flag: %s. Key: %s. Evaluation: %s. Label: %s"],[103,"impressions-tracker: Queueing corresponding impression."],[104,"New shared client instance created."],[105,"New Split SDK instance created."],[120,"events-tracker: Successfully queued %s"],[121,"impressions-tracker: Successfully stored %s impression(s)."],[122,"UserConsent: consent status changed from %s to %s."],[123,"UserConsent: call had no effect because it was the current consent status (%s)."],[124,"Starting the SDK with %s user consent. No data will be sent."],[106,"sync:polling-manager: Turning segments data polling %s."],[107,"sync:polling-manager: Starting polling"],[108,"sync:polling-manager: Stopping polling"],[109,g+"Retrying download of feature flags #%s. Reason: %s"],[u,"sync:submitter: Flushing full %s queue and reseting timer."],[116,"sync:submitter: Pushing %s."],[110,"sync:streaming: Refreshing streaming token in %s seconds, and connecting streaming in %s seconds."],[111,"sync:streaming: Attempting to reconnect streaming in %s seconds."],[112,"sync:streaming: Connecting streaming."],[113,"sync:streaming: Streaming is disabled for given SDK key. Switching to polling mode."],[114,"sync:streaming: Disconnecting streaming."],[117,"sync:sync-manager: Streaming not available. Starting polling."],[118,"sync:sync-manager: Streaming couldn't connect. Continue polling."],[119,"sync:sync-manager: Streaming connected. Syncing and stopping polling."]]).concat([[0,"engine:combiner: [andCombiner] evaluates to %s"],[1,"engine:combiner: Treatment found: %s"],[2,"engine:combiner: All predicates evaluated, no treatment found."],[3,'engine: using algo "murmur" bucket %s for key %s using seed %s - treatment %s'],[4,"engine:matcher: [allMatcher] is always true"],[5,"engine:matcher: [betweenMatcher] is %s between %s and %s? %s"],[6,"engine:matcher: [booleanMatcher] %s === %s"],[7,"engine:matcher: [containsAllMatcher] %s contains all elements of %s? %s"],[8,"engine:matcher: [containsAnyMatcher] %s contains at least an element of %s? %s"],[9,"engine:matcher: [containsStringMatcher] %s contains %s? %s"],[10,'engine:matcher: [dependencyMatcher] parent feature flag "%s" evaluated to "%s" with label "%s". %s evaluated treatment is part of [%s] ? %s.'],[11,'engine:matcher: [dependencyMatcher] will evaluate parent feature flag: "%s" with key: %s %s'],[12,"engine:matcher: [equalToMatcher] is %s equal to %s? %s"],[13,"engine:matcher: [equalToSetMatcher] is %s equal to set %s? %s"],[14,"engine:matcher: [endsWithMatcher] %s ends with %s? %s"],[15,"engine:matcher: [greaterThanEqualMatcher] is %s greater than %s? %s"],[16,"engine:matcher: [lessThanEqualMatcher] is %s less than %s? %s"],[17,"engine:matcher: [partOfMatcher] %s is part of %s? %s"],[18,"engine:matcher: [segmentMatcher] evaluated %s / %s => %s"],[19,"engine:matcher: [stringMatcher] does %s matches with %s? %s"],[20,"engine:matcher: [stringMatcher] %s is an invalid regex"],[21,"engine:matcher: [startsWithMatcher] %s starts with %s? %s"],[22,"engine:matcher: [whitelistMatcher] evaluated %s in [%s] => %s"],[23,"engine:value: Extracted attribute [%s], [%s] will be used for matching."],[24,"engine:sanitize: Attempted to sanitize [%s] which should be of type [%s]. Sanitized and processed value => [%s]"],[25,"cleanup: Registering cleanup handler %s"],[26,"cleanup: Deregistering cleanup handler %s"],[27,"Retrieving default SDK client."],[28,"Retrieving existing SDK client."],[29,"Retrieving manager instance."],[3
20,"sync:offline: Feature flags data: \n%s"],[31,g+"Spin up feature flags update using since = %s"],[32,g+"New feature flags %s"],[33,g+"Removed feature flags %s"],[34,g+"Segment names collected %s"],[35,"sync:streaming: New SSE message received, with data: %s."],[36,"sync: Starting %s. Running each %s millis"],[37,"sync: Running %s"],[38,"sync: Stopping %s"],[39,'settings: feature flags filtering criteria is "%s".']]);var ci=new wr(ui),li=String(oi?{NODE_ENV:"production",PUBLIC_URL:"/mf-header",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SPLITIO_DEBUG:Yt()?localStorage.getItem("splitio_debug"):""),fi=Yr.NONE;function hi(e){var t=e.treatment;return e.keys?{conditionType:"WHITELIST",matcherGroup:{combiner:"AND",matchers:[{keySelector:null,matcherType:"WHITELIST",negate:!1,whitelistMatcherData:{whitelist:$(e.keys)?[e.keys]:e.keys}}]},partitions:[{treatment:t,size:100}],label:"whitelisted "+t}:{conditionType:"ROLLOUT",matcherGroup:{combiner:"AND",matchers:[{keySelector:null,matcherType:"ALL_KEYS",negate:!1}]},partitions:[{treatment:t,size:100}],label:"default rule"}}function pi(e,t,n,r){return P(r.log,function(e,t,n,r){var i=r.log,s=t.splits,o=!0;return function(){var t=[],a=null,u={};try{u=e(r)}catch(c){a=c,i.error(304,[c])}return!a&&u?(i.debug(30,[JSON.stringify(u)]),W(u,(function(e,n){t.push([n,{name:n,status:"ACTIVE",killed:!1,trafficAllocation:100,defaultTreatment:v,conditions:e.conditions||[],configurations:e.configurations,trafficTypeName:e.trafficTypeName}])}
2)),Promise.all([s.clear(),s.addSplits(t)]).then((function(){return n.splits.emit(ce),o&&(o=!1,Promise.resolve(s.checkCache()).then((function(e){e&&n.splits.emit(le),n.segments.emit(fe)}))),!0}))):Promise.resolve(!0)}}(e,t,n,r),r.scheduler.offlineRefreshRate,"offlineUpdater")}function di(){return Promise.resolve()}/^(enabled?|on)/i.test(li)?fi=Yr.DEBUG:Zr(li)&&(fi=li);var gi,mi=(gi=function(){var e={emptyMock:"1"};return function(t){var n=t.features||{};if(!function(t){var n=Object.keys(t);return n.length!==Object.keys(e).length?(e=t,!0):n.some((function(n){var r,i,s=!e[n],o=typeof(r=e[n])!==typeof(i=t[n])||("string"===typeof r?r!==i:r.treatment!==i.treatment||r.config!==i.config),a=s||o;return a&&(e=t),a}))}(n))return!1;var r={};return W(n,(function(e,t){var n=e,i=null;Z(e)&&(n=e.treatment,i=e.config||i);var s={};null!==i&&(s[n]=i),r[t]={trafficTypeName:"localhost",conditions:[hi({treatment:n})],configurations:s}})),r}},function(e){var t=e.settings,n=e.readiness,r=e.storage;return a(pi(gi(),r,n,t),{flush:di,shared:function(e,t){return{start:function(){setTimeout((function(){t.segments.emit(fe)}),0)},stop:function(){},isRunning:function(){return!0},flush:di}}})});mi.type="LocalhostFromObject";var vi=[L,I,D];var yi="LOCALSTORAGE";function Si(e,t){return void 0===t&&(t=[]),function(e,t,n){var r=e.integrations,i=e.log;if(!Array.isArray(r)||0===r.length)return[];var s=r.filter(t),o=r.length-s.length;return o&&i.warn(218,[o,n||""]),s}(e,(function(e){return e&&$(e.type)&&t.indexOf(e.type)>-1}),'Integration items must have a valid "type" value')}var bi={defaults:{startup:{requestTimeoutBeforeReady:5,retriesOnFailureBeforeReady:1,readyTimeout:10,eventsFirstPushWindow:10},userConsent:I,version:"javascript-10.23.1"},acceptKey:!0,acceptTT:!0,runtime:function(){return{ip:!1,hostname:!1}},storage:function(e){var t,n=e.log,r=e.mode,i=e.storage,s=void 0===i?{type:N}:i,o=s.type,a=s.options,u=void 0===a?{}:a,c=s.prefix,l=function(){t=o,o=N};return r===_&&o===yi&&l(),(o!==N&&o!==yi||o===yi&&!Yt())&&(l(),n.error("Invalid or unavailable storage. Fallbacking into MEMORY storage")),{type:o,options:u,prefix:c,__originalType:t}},integrations:function(e){return Si(e,[sn,on])},logger:function(e){var t,n=e.debug,r=void 0!==n?"boolean"===typeof(t=n)?t?Yr.DEBUG:Yr.NONE:"string"===typeof t&&Zr(t)?t:void 0:fi,i=new ei({logLevel:r||fi},ci);return r||i._log(Yr.ERROR,"Invalid Log Level - No changes to the logs will be applied."),i},localhost:function(){return mi},consent:function(e){var t=e.userConsent,n=e.log;return t=X(t),vi.indexOf(t)>-1?t:(n.error(321,["userConsent",vi,I]),I)}};var Ti,Ei="object"===typeof Reflect?Reflect:null,ki=Ei&&"function"===typeof Ei.apply?Ei.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Ti=Ei&&"function"===typeof Ei.ownKeys?Ei.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var _i=Number.isNaN||function(e){return e!==e};function wi(){wi.init.call(this)}wi.prototype._events=void 0,wi.prototype._eventsCount=0,wi.prototype._maxListeners=void 0;var Ci=10;function Ri(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Ai(e){return void 0===e._maxListeners?wi.defaultMaxListeners:e._maxListeners}function Ni(e,t,n,r){var i,s,o,a;if(Ri(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"===typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=Ai(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,a=u,console&&console.warn&&console.warn(a)}return e}function Oi(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Ii(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=Oi.bind(r);return i.listener=n,r.wrapFn=i,i}function Li(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):Mi(i,i.length)}function Di(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"===typeof n)return 1;if(void 0!==n)return n.length}return 0}function Mi(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function Ki(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest,s=[],o=[],a={},u=function e(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:e,headers:{keys:function(){return s},entries:function(){return o},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var c in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){s.push(t=t.toLowerCase()),o.push([t,n]),a[t]=a[t]?a[t]+","+n:n})),n(u())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)}))}Object.defineProperty(wi,"defaultMaxListeners",{enumerable:!0,get:function(){return Ci},set:function(e){if("number"!==typeof e||e<0||_i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Ci=e}}),wi.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},wi.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||_i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},wi.prototype.getMaxListeners=function(){return Ai(this)},wi.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=i[e];if(void 0===a)return!1;if("function"===typeof a)ki(a,this,t);else{var u=a.length,c=Mi(a,u);for(n=0;n<u;++n)ki(c[n],this,t)}return!0},wi.prototype.addListener=function(e,t){return Ni(this,e,t,!1)},wi.prototype.on=wi.prototype.addListener,wi.prototype.prependListener=function(e,t){return Ni(this,e,t,!0)},wi.prototype.once=function(e,t){return Ri(t),this.on(e,Ii(this,e,t)),this},wi.prototype.prependOnceListener=function(e,t){return Ri(t),this.prependListener(e,Ii(this,e,t)),this},wi.prototype.removeListener=function(e,t){var n,r,i,s,o;if(Ri(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit
2("removeListener",e,n.listener||t));else if("function"!==typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},wi.prototype.off=wi.prototype.removeListener,wi.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},wi.prototype.listeners=function(e){return Li(this,e,!0)},wi.prototype.rawListeners=function(e){return Li(this,e,!1)},wi.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):Di.call(e,t)},wi.prototype.listenerCount=Di,wi.prototype.eventNames=function(){return this._eventsCount>0?Ti(this._events):[]};var Fi="visibilitychange",xi="pagehide",Pi="for visibilitychange and pagehide events.",Ui=function(){function e(e,t,n,r){this.syncManager=e,this.settings=t,this.storage=n,this.serviceApi=r,this.flushData=this.flushData.bind(this),this.flushDataIfHidden=this.flushDataIfHidden.bind(this),this.fromImpressionsCollector=oe.bind(void 0,t.core.labelsEnabled)}return e.prototype.start=function(){this.settings.log.debug(25,[Pi]),"undefined"!==typeof document&&document.addEventListener&&document.addEventListener(Fi,this.flushDataIfHidden),"undefined"!==typeof window&&window.addEventListener&&window.addEventListener(xi,this.flushData)},e.prototype.stop=function(){this.settings.log.debug(26,[Pi]),"undefined"!==typeof document&&document.removeEventListener&&document.removeEventListener(Fi,this.flushDataIfHidden),"undefined"!==typeof window&&window.removeEventListener&&window.removeEventListener(xi,this.flushData)},e.prototype.flushData=function(){if(this.syncManager){var e=this.settings.urls,t=e.events,n=e.telemetry;if(et(this.settings)){var r=this.settings.sync.impressionsMode,i={sim:r===E?E:r===T?T:k};this._flushData(t+"/testImpressions/beacon",this.storage.impressions,this.serviceApi.postTestImpressionsBulk,this.fromImpressionsCollector,i),this._flushData(t+"/events/beacon",this.storage.events,this.serviceApi.postEventsBulk),this.storage.impressionCounts&&this._flushData(t+"/testImpressions/count/beacon",this.storage.impressionCounts,this.serviceApi.postTestImpressionsCount,ue),this.storage.uniqueKeys&&this._flushData(n+"/v1/keys/cs/beacon",this.storage.uniqueKeys,this.serviceApi.postUniqueKeysBulkCs)}this.storage.telemetry&&this._flushData(n+"/v1/metrics/usage/beacon",this.storage.telemetry,this.serviceApi.postMetricsUsage)}},e.prototype.flushDataIfHidden=function(){"hidden"===document.visibilityState&&this.flushData()},e.prototype._flushData=function(e,t,n,r,i){if(!t.isEmpty()){var s=r?r(t.pop()):t.pop();this._sendBeacon(e,s,i)||n(JSON.stringify(s)).catch((function(){}))}},e.prototype._sendBeacon=function(e,t,n){if("undefined"!==typeof navigator&&navigator.sendBeacon){var r={entries:t,token:this.settings.core.authorizationKey,sdk:this.settings.version};n&&a(r,n);var i=JSON.stringify(r);try{return navigator.sendBeacon(e,i)}catch(s){return!1}}return!1},e}();var ji={getFetch:function(){return"function"===typeof fetch?fetch:Ki},getEventSource:function(){return"function"===typeof EventSource?EventSource:void 0},EventEmitter:wi,now:"object"===typeof performance&&"function"===typeof performance.now?performance.now.bind(performance):Date.now},qi=Ui,Bi=function(e,t){return function(n){var r=n.settings,i=n.settings,s=i.log,o=i.streamingEnabled,a=i.sync.enabled,u=n.telemetryTracker,c=e&&e(n),l=a&&o&&c&&t?t(n,c):void 0,f=qe(n);l&&(l.on(He,(function(){s.info(119),c.isRunning()&&(c.stop(),u.streamingEvent(70,0)),c.syncAll()})),l.on(We,(function(){c.isRunning()?s.info(118):(s.info(117),c.start(),u.streamingEvent(70,1))})));var h=!1,p=!0;return{pollingManager:c,pushManager:l,submitterManager:f,start:function(){h=!0,c&&(a?l?(p&&(c.syncAll(),p=!1),l.start()):c.start():p&&(c.syncAll(),p=!1)),f.start(!et(r))},stop:function(){h=!1,l&&l.stop(),c&&c.isRunning()&&c.stop(),f.stop()},isRunning:function(){return h},flush:function(){return f.execute(!et(r))},shared:function(e,t,n){if(c){var r=c.add(e,t,n);return{isRunning:r.isRunning,start:function(){a?l?(c.isRunning()?n.splits.usesSegments()&&r.start():r.execute(),l.add(e,r)):n.splits.usesSegments()&&r.start():t.isReady()||r.execute()},stop:function(){var t=c.get(e);t&&(l&&l.remove(e),t.isRunning()&&t.stop(),c.remove(e))},flush:function(){return Promise.resolve()}}}}}}}((function(e){var t=e.splitApi,n=e.storage,r=e.readiness,i=e.settings,s=i.log,o=function(e,t,n,r,i){return P(r.log,Bt(r.log,function(e){return function(t,n,r,i){var s=e(t,n,r);return i&&(s=i(s)),s.then((function(e){return e.json()}))}}(e),t.splits,t.segments,n.splits,r.startup.requestTimeoutBeforeReady,r.startup.retriesOnFailureBeforeReady,i),r.scheduler.featuresRefreshRate,"splitChangesUpdater")}(t.fetchSplitChanges,n,r,i,!0),a={},u=f(Et(i.core.key),r,n);function c(){W(a,(function(e){e.start()}))}function l(){W(a,(function(e){e.isRunning()&&e.stop()}))}function f(e,n,r){var s=function(e,t,n,r,i){return P(r.log,jt(r.log,function(e){return function(t,n,r){var i=e(t,n);return r&&(i=r(i)),i.then((function(e){return e.json()})).then((function(e){return e.mySegments.map((function(e){return e.name}))}))}}(e),t.splits,t.segments,n.segments,r.startup.requestTimeoutBeforeReady,r.startup.retriesOnFailureBeforeReady,i),r.scheduler.segmentsRefreshRate,"mySegmentsUpdater")}(t.fetchMySegments,r,n,i,e);function o(){n.isReady()||r.splits.usesSegments()||n.segments.emit(fe)}return r.splits.usesSegments()?n.splits.once(ce,o):setTimeout(o,0),a[e]=s,s}return r.splits.on(ce,(function(){if(o.isRunning()){var e=n.splits.usesSegments();e!==u.isRunning()&&(s.info(106,[e?"ON":"OFF"]),e?c():l())}})),{splitsSyncTask:o,segmentsSyncTask:u,start:function(){s.info(107),o.start(),n.splits.usesSegments()&&c()},stop:function(){s.info(108),o.isRunning()&&o.stop(),l()},isRunning:o.isRunning,syncAll:function(){var e=[o.execute()];return W(a,(function(t){e.push(t.execute())}
2)),Promise.all(e)},add:f,remove:function(e){delete a[e]},get:function(e){return a[e]}}}),(function(e,t){var n,r=e.settings,i=e.storage,s=e.splitApi,o=e.readiness,u=e.platform,l=e.telemetryTracker,f=r.core.key?Et(r.core.key):void 0,h=r.log;try{n=new Tt(r,!f,u.getEventSource)}catch(N){return void h.warn(208,[N])}var p=mt(s.fetchAuth),d=new u.EventEmitter,g=it(h,d,l);n.setEventHandler(g);var m,v,y,S,b=f?void 0:ot(h,t.segmentsSyncTask,i.segments),T=function(e,t,n,r,i,s){var o,a,u,c=0,l=!1,f=new tt(h,1e4,6e4);function h(){if(o=!0,c>t.getChangeNumber()){l=!1;var r=u?{payload:u,changeNumber:c}:void 0;n.execute(!0,a?c:void 0,r).then((function(){if(o)if(l)h();else{r&&i.trackUpdatesFromSSE("sp"),s&&s.execute(!0);var n=f.attempts+1;if(c<=t.getChangeNumber())return e.debug("Refresh completed"+(a?" bypassing the CDN":"")+" in "+n+" attempts."),void(o=!1);if(n<10)return void f.scheduleCall();a?(e.debug("No changes fetched after "+n+" attempts with CDN bypassed."),o=!1):(f.reset(),a=!0,h())}}))}else o=!1}function p(e,n){var r=e.changeNumber,i=e.pcn,s=t.getChangeNumber();r<=s||r<=c||(c=r,l=!0,a=!1,u=void 0,n&&s===i&&(u=n),!f.timeoutID&&o||h(),f.reset())}return{put:p,killSplit:function(e){var n=e.changeNumber,i=e.splitName,s=e.defaultTreatment;t.killLocally(i,s,n)&&r.emit(ce,!0),p({changeNumber:n})},stop:function(){o=!1,f.reset()}}}(h,i.splits,t.splitsSyncTask,o.splits,l,f?void 0:t.segmentsSyncTask),E={},k={},_=!1,w=new tt(C,r.scheduler.pushRetryBackoffBase);function C(){if(!m){h.info(112),m=!1;var e=f?Object.keys(k):void 0;p(e).then((function(t){if(!m)return t.pushEnabled?void(e&&e.length<Object.keys(k).length||function(e){y&&clearTimeout(y),S&&clearTimeout(S);var t=e.decodedToken,r=t.exp-t.iat-600,i="number"===typeof e.connDelay&&e.connDelay>=0?e.connDelay:60;h.info(110,[r,i]),y=setTimeout(C,1e3*r),S=setTimeout((function(){m||n.open(e)}),1e3*i),l.streamingEvent(50,t.exp)}(t)):(h.info(113),void d.emit(ze))})).catch((function(e){if(!m){if(h.error(306,[e.message]),e.statusCode>=400&&e.statusCode<500)return l.streamingEvent(80),void d.emit(ze);d.emit(Ge)}}))}}function R(){m||(m=!0,n.close(),h.info(114),y&&clearTimeout(y),S&&clearTimeout(S),w.reset(),A())}function A(){T.stop(),f?W(k,(function(e){return e.worker.stop()})):b.stop()}return d.on(We,A),d.on(He,(function(){w.reset()})),d.on(ze,(function(){v=!0,R(),d.emit(We)})),d.on(Ge,(function(){n.close();var e=w.scheduleCall();h.info(111,[e/1e3]),d.emit(We)})),d.on(Be.STREAMING_RESET,(function(){m||(y&&clearTimeout(y),C())})),d.on(Je,T.killSplit),d.on(Ze,(function(e){if(e.d&&void 0!==e.c)try{var t=(n=e.c,r=e.d,n>0?Ct(r,n,!1):JSON.parse(ut(r)));if(t)return void T.put(e,t)}catch(N){h.warn(224,[N])}var n,r;T.put(e)})),f?(d.on(Qe,(function(e,t){var n=t.split("_")[2],r=E[n];r&&k[r]&&k[r].worker.put(e.changeNumber,e.includesPayload?e.segmentList?e.segmentList:[]:void 0)})),d.on(Ve,(function(e){switch(e.u){case bt.BoundedFetchRequest:var t;try{s=e.d,o=e.c,t=wt(s,o)}catch(N){h.warn(c,["BoundedFetchRequest",N]);break}return void W(k,(function(n){var r=n.hash64,i=n.worker;(function(e,t){var n=parseInt(t.slice(8),16)%(8*e.length),r=n%8;return(e[Math.floor(n/8)]&1<<r)>0})(t,r.hex)&&i.put(e.changeNumber)}));case bt.KeyList:var n,r,i=void 0;try{i=Ct(e.d,e.c),n=new Nt(i.a),r=new Nt(i.r)}catch(N){h.warn(c,["KeyList",N]);break}return void W(k,(function(t){var i=t.hash64,s=t.worker,o=!!n.has(i.dec)||!r.has(i.dec)&&void 0;void 0!==o&&s.put(e.changeNumber,{name:e.segmentName,add:o})}));case bt.SegmentRemoval:if(!e.segmentName){h.warn(c,["SegmentRemoval","No segment name was provided"]);break}return void W(k,(function(t){return t.worker.put(e.changeNumber,{name:e.segmentName,add:!1})}))}var s,o;W(k,(function(t){t.worker.put(e.changeNumber)}))}))):d.on(Ye,b.put),a(Object.create(d),{stop:function(){R(),f&&this.remove(f)},start:function(){v||!1===m||(m=!1,f?this.add(f,t.segmentsSyncTask):setTimeout(C))},isRunning:function(){return!1===m},add:function(e,t){var n=vt(e);E[n]||(E[n]=e,k[e]={hash64:Pt(e),worker:st(t,l)},_=!0,setTimeout((function(){_&&(_=!1,C())}),0))},remove:function(e){var t=vt(e);delete E[t],delete k[e]}})}));function zi(e){return e.storage.type===O?function(e){void 0===e&&(e={});var t=function(e){return e?e+".SPLITIO":"SPLITIO"}(e.prefix);function n(e){if(!Yt())return e.settings.log.warn($t+"LocalStorage API is unavailable. Falling back to default MEMORY storage"),fn(e);var n=e.settings,r=e.settings,i=r.log,s=r.scheduler,o=s.impressionsQueueSize,a=s.eventsQueueSize,u=r.sync,c=u.impressionsMode,l=u.__splitFiltersValidation,f=Et(n.core.key),h=new Vt(t,f),p=Date.now()-864e6,d=new Xt(i,h,p,l),g=new tn(i,h);
2return{splits:d,segments:g,impressions:new zt(o),impressionCounts:c!==T?new Ht:void 0,events:new Wt(a),telemetry:un(e)?new cn(d,g):void 0,uniqueKeys:c===k?new ln:void 0,destroy:function(){var e;this.splits=new rn,this.segments=new nn,this.impressions.clear(),this.impressionCounts&&this.impressionCounts.clear(),this.events.clear(),null===(e=this.uniqueKeys)||void 0===e||e.clear()},shared:function(e){var n=new Vt(t,e);return{splits:this.splits,segments:new tn(i,n),impressions:this.impressions,impressionCounts:this.impressionCounts,events:this.events,telemetry:this.telemetry,destroy:function(){this.splits=new rn,this.segments=new nn}}}}}return n.type=O,n}(e.storage):e.storage.__originalType===O?Hr:fn}function Gi(e,t){var n=function(e){return Ae(e,bi)}(e),r=function(e){var t={settings:e,platform:ji,storageFactory:zi(e),splitApiFactory:x,syncManagerFactory:Bi,sdkManagerFactory:wn,sdkClientMethodFactory:kr,SignalListener:qi,integrationsManagerFactory:e.integrations&&e.integrations.length>0?Gr.bind(null,e.integrations):void 0,impressionsObserverFactory:Ir,extraProps:function(e){return{UserConsent:si(e)}}};e.mode===_&&(t.splitApiFactory=void 0,t.syncManagerFactory=e.sync.localhostMode,t.SignalListener=void 0);return t}(n);return t&&t(r),ri(r)}}}]);

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.