@hackler/react-sdk 3.3.3 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/config.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const SDK_NAME_HEADER = "react-sdk";
2
- export declare const SDK_VERSION_HEADER = "3.3.3";
2
+ export declare const SDK_VERSION_HEADER = "3.4.0";
3
3
  //# sourceMappingURL=config.d.ts.map
package/lib/index.es.js CHANGED
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import React__default, { createContext, useState, useEffect, useContext, useCallback } from 'react';
5
5
  import { Logger, Decision, DecisionReason, FeatureFlagDecision } from '@hackler/sdk-core';
6
6
 
7
- /*! *****************************************************************************
7
+ /******************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
9
9
 
10
10
  Permission to use, copy, modify, and/or distribute this software for any
@@ -48,7 +48,7 @@ function __read(o, n) {
48
48
  }
49
49
 
50
50
  var SDK_NAME_HEADER = "react-sdk";
51
- var SDK_VERSION_HEADER = "3.3.3";
51
+ var SDK_VERSION_HEADER = "3.4.0";
52
52
 
53
53
  var HackleReactSDKClient = /** @class */ (function () {
54
54
  function HackleReactSDKClient(sdkKey, config) {
package/lib/index.js CHANGED
@@ -30,7 +30,7 @@ var Hackle__namespace = /*#__PURE__*/_interopNamespace(Hackle);
30
30
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
31
31
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
32
32
 
33
- /*! *****************************************************************************
33
+ /******************************************************************************
34
34
  Copyright (c) Microsoft Corporation.
35
35
 
36
36
  Permission to use, copy, modify, and/or distribute this software for any
@@ -74,7 +74,7 @@ function __read(o, n) {
74
74
  }
75
75
 
76
76
  var SDK_NAME_HEADER = "react-sdk";
77
- var SDK_VERSION_HEADER = "3.3.3";
77
+ var SDK_VERSION_HEADER = "3.4.0";
78
78
 
79
79
  var HackleReactSDKClient = /** @class */ (function () {
80
80
  function HackleReactSDKClient(sdkKey, config) {
package/lib/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hackler/js-client-sdk")):"function"==typeof define&&define.amd?define(["exports","@hackler/js-client-sdk"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={},e.Hackle)}(this,function(t,r){"use strict";function e(r){if(r&&r.__esModule)return r;var n=Object.create(null);return r&&Object.keys(r).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(r,e),Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:function(){return r[e]}}))}),n.default=r,Object.freeze(n)}var n=e(r),c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}var o=(i.prototype.variation=function(e,t,r){return this.client.variation(e,t,r)},i.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t,r)},i.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t)},i.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t)},i.prototype.track=function(e,t){this.client.track(e,t)},i.prototype.trackPageView=function(e){this.client.trackPageView(e)},i.prototype.onReady=function(e,t){this.client.onReady(e,t)},i.prototype.onInitialized=function(e){return this.client.onInitialized(e)},i);function i(e,t){this.client=n.createInstance(e,c(c({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"3.3.3"}))}var f={exports:{}},u={},s=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var Ce=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))p.call(r,i)&&(n[i]=r[i]);if(s)for(var u=s(r),a=0;a<u.length;a++)h.call(r,u[a])&&(n[u[a]]=r[u[a]])}return n},y=Ce,a="function"==typeof Symbol&&Symbol.for,d=a?Symbol.for("react.element"):60103,m=a?Symbol.for("react.portal"):60106,v=a?Symbol.for("react.fragment"):60107,E=a?Symbol.for("react.strict_mode"):60108,T=a?Symbol.for("react.profiler"):60114,g=a?Symbol.for("react.provider"):60109,_=a?Symbol.for("react.context"):60110,b=a?Symbol.for("react.forward_ref"):60112,R=a?Symbol.for("react.suspense"):60113,w=a?Symbol.for("react.memo"):60115,O=a?Symbol.for("react.lazy"):60116,N="function"==typeof Symbol&&Symbol.iterator;function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C={};function k(e,t,r){this.props=e,this.context=t,this.refs=C,this.updater=r||I}function S(){}function P(e,t,r){this.props=e,this.context=t,this.refs=C,this.updater=r||I}k.prototype.isReactComponent={},k.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(A(85));this.updater.enqueueSetState(this,e,t,"setState")},k.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},S.prototype=k.prototype;a=P.prototype=new S;a.constructor=P,y(a,k.prototype),a.isPureReactComponent=!0;var x={current:null},M=Object.prototype.hasOwnProperty,D={key:!0,ref:!0,__self:!0,__source:!0};function F(e,t,r){var n,o={},i=null,u=null;if(null!=t)for(n in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(i=""+t.key),t)M.call(t,n)&&!D.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:d,type:e,key:i,ref:u,props:o,_owner:x.current}}function U(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var j=/\/+/g,L=[];function V(e,t,r,n){if(L.length){var o=L.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function H(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,L.length<10&&L.push(e)}function $(e,t,r){return null==e?0:function e(t,r,n,o){var i=!1;if(null===(t="undefined"==(a=typeof t)||"boolean"===a?null:t))i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case d:case m:i=!0}}if(i)return n(o,t,""===r?"."+G(t,0):r),1;if(i=0,r=""===r?".":r+":",Array.isArray(t))for(var u=0;u<t.length;u++){var a,s=r+G(a=t[u],u);i+=e(a,s,n,o)}else if("function"==typeof(s=null!==t&&"object"==typeof t&&"function"==typeof(s=N&&t[N]||t["@@iterator"])?s:null))for(t=s.call(t),u=0;!(a=t.next()).done;)i+=e(a=a.value,s=r+G(a,u++),n,o);else if("object"===a)throw n=""+t,Error(A(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return i}(e,"",t,r)}function G(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function B(e,t){e.func.call(e.context,t,e.count++)}function K(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?Y(e,n,r,function(e){return e}):null!=e&&(U(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":(""+e.key).replace(j,"$&/")+"/")+r,e={$$typeof:d,type:o.type,key:r,ref:o.ref,props:o.props,_owner:o._owner}),n.push(e))}function Y(e,t,r,n,o){var i="";$(e,K,t=V(t,i=null!=r?(""+r).replace(j,"$&/")+"/":i,n,o)),H(t)}var z={current:null};function q(){var e=z.current;if(null===e)throw Error(A(321));return e}a={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:x,IsSomeRendererActing:{current:!1},assign:y};u.Children={map:function(e,t,r){if(null==e)return e;var n=[];return Y(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;$(e,B,t=V(null,null,t,r)),H(t)},count:function(e){return $(e,function(){return null},null)},toArray:function(e){var t=[];return Y(e,t,null,function(e){return e}),t},only:function(e){if(!U(e))throw Error(A(143));return e}},u.Component=k,u.Fragment=v,u.Profiler=T,u.PureComponent=P,u.StrictMode=E,u.Suspense=R,u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a,u.cloneElement=function(e,t,r){if(null==e)throw Error(A(267,e));var n=y({},e.props),o=e.key,i=e.ref,u=e._owner;if(null!=t)for(a in void 0!==t.ref&&(i=t.ref,u=x.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)M.call(t,a)&&!D.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==s?s:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];n.children=s}return{$$typeof:d,type:e.type,key:o,ref:i,props:n,_owner:u}},u.createContext=function(e,t){return(e={$$typeof:_,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:g,_context:e},e.Consumer=e},u.createElement=F,u.createFactory=function(e){var t=F.bind(null,e);return t.type=e,t},u.createRef=function(){return{current:null}},u.forwardRef=function(e){return{$$typeof:b,render:e}},u.isValidElement=U,u.lazy=function(e){return{$$typeof:O,_ctor:e,_status:-1,_result:null}},u.memo=function(e,t){return{$$typeof:w,type:e,compare:void 0===t?null:t}},u.useCallback=function(e,t){return q().useCallback(e,t)},u.useContext=function(e,t){return q().useContext(e,t)},u.useDebugValue=function(){},u.useEffect=function(e,t){return q().useEffect(e,t)},u.useImperativeHandle=function(e,t,r){return q().useImperativeHandle(e,t,r)},u.useLayoutEffect=function(e,t){return q().useLayoutEffect(e,t)},u.useMemo=function(e,t){return q().useMemo(e,t)},u.useReducer=function(e,t,r){return q().useReducer(e,t,r)},u.useRef=function(e){return q().useRef(e)},u.useState=function(e){return q().useState(e)},u.version="16.14.0";var W,X,Z,ke={},Q=function(){};function J(e,t,r,n,o){if("production"!==production)for(var i in e)if(Z(e,i)){var u;try{if("function"!=typeof e[i]){var a=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.");throw a.name="Invariant Violation",a}u=e[i](t,i,n,r,null,W)}catch(e){u=e}!u||u instanceof Error||Q((n||"React class")+": type specification of "+r+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in X)&&(X[u.message]=!0,i=o?o():"",Q("Failed "+r+" type: "+u.message+(null!=i?i:"")))}}"production"!==production&&(W="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",X={},Z=Function.call.bind(Object.prototype.hasOwnProperty),Q=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),J.resetWarningCache=function(){"production"!==production&&(X={})};var Se=J;"production"!==production&&function(){var y=Ce,o=Se,e="function"==typeof Symbol&&Symbol.for,d=e?Symbol.for("react.element"):60103,m=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,t=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,r=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,T=e?Symbol.for("react.scope"):60119,g="function"==typeof Symbol&&Symbol.iterator,_="@@iterator";function b(e){if(null===e||"object"!=typeof e)return null;e=g&&e[g]||e[_];return"function"==typeof e?e:null}var R={current:null},w={current:null},O=/^(.*)[\\\/]/;var N=1;function A(e){if(null==e)return null;if("number"==typeof e.tag&&x("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case m:return"Portal";case i:return"Profiler";case n:return"StrictMode";case l:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return"Context.Consumer";case u:return"Context.Provider";case c:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case p:return A(e.type);case v:return A(e.render);case h:r=(r=e)._status===N?r._result:null;if(r)return A(r)}var t,r;return null}var I={},C=null;function k(e){C=e}I.getCurrentStack=null,I.getStackAddendum=function(){var e,t,r,n,o,i="";C&&(n=A(C.type),o=C._owner,i+=(e=n,t=C._source,r=o&&A(o.type),u="",t?(o=(n=t.fileName).replace(O,""),/^index\./.test(o)&&(!(n=n.match(O))||(n=n[1])&&(o=n.replace(O,"")+"/"+o)),u=" (at "+o+":"+t.lineNumber+")"):r&&(u=" (created by "+r+")"),"\n in "+(e||"Unknown")+u));var u=I.getCurrentStack;return u&&(i+=u()||""),i};var S={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:y};function P(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];M("warn",e,r)}function x(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];M("error",e,r)}function M(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=S.ReactDebugCurrentFrame.getStackAddendum())&&(t+="%s",r=r.concat([n]));var n=r.map(function(e){return""+e});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n);try{var o=0,i="Warning: "+t.replace(/%s/g,function(){return r[o++]});throw new Error(i)}catch(e){}}y(S,{ReactDebugCurrentFrame:I,ReactComponentTreeHook:{}});var D={};function F(e,t){var r=e.constructor,e=r&&(r.displayName||r.name)||"ReactClass",r=e+"."+t;D[r]||(x("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),D[r]=!0)}var U={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){F(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){F(e,"replaceState")},enqueueSetState:function(e,t,r,n){F(e,"setState")}},j={};function L(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||U}Object.freeze(j),L.prototype.isReactComponent={},L.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},L.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var V,H={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(V in H)H.hasOwnProperty(V)&&function(e,t){Object.defineProperty(L.prototype,e,{get:function(){P("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(V,H[V]);function $(){}function G(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||U}$.prototype=L.prototype;e=G.prototype=new $;e.constructor=G,y(e,L.prototype),e.isPureReactComponent=!0;var B,K,Y=Object.prototype.hasOwnProperty,z={key:!0,ref:!0,__self:!0,__source:!0};function q(e){if(Y.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function W(e){if(Y.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var X={},Z=function(e,t,r,n,o,i,u){i={$$typeof:d,type:e,key:t,ref:r,props:u,_owner:i,_store:{}};return Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function Q(e,t,r){var n,o,i,u={},a=null,s=null,c=null,l=null;if(null!=t)for(n in q(t)&&(s=t.ref,"string"==typeof(o=t).ref&&w.current&&o.__self&&w.current.stateNode!==o.__self&&(i=A(w.current.type),X[i]||(x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',A(w.current.type),o.ref),X[i]=!0))),W(t)&&(a=""+t.key),c=void 0===t.__self?null:t.__self,l=void 0===t.__source?null:t.__source,t)Y.call(t,n)&&!z.hasOwnProperty(n)&&(u[n]=t[n]);var f,p,h,y=arguments.length-2;if(1==y)u.children=r;else if(1<y){for(var d=Array(y),m=0;m<y;m++)d[m]=arguments[m+2];Object.freeze&&Object.freeze(d),u.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(n in v)void 0===u[n]&&(u[n]=v[n])}function E(){K||(K=!0,x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",f))}function T(){B||(B=!0,x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",h))}return(a||s)&&(r="function"==typeof e?e.displayName||e.name||"Unknown":e,a&&(p=u,h=r,T.isReactWarning=!0,Object.defineProperty(p,"key",{get:T,configurable:!0})),s&&(p=u,f=r,E.isReactWarning=!0,Object.defineProperty(p,"ref",{get:E,configurable:!0}))),Z(e,a,s,c,l,w.current,u)}function J(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var ee=".",te=":";var re=!1,ne=/\/+/g;function oe(e){return(""+e).replace(ne,"$&/")}var ie=10,ue=[];function ae(e,t,r,n){if(ue.length){var o=ue.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function se(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,ue.length<ie&&ue.push(e)}function ce(e,t,r){return null==e?0:function e(t,r,n,o){var i,u=typeof t,a=!1;if(null===(t="undefined"==u||"boolean"==u?null:t))a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case d:case m:a=!0}}if(a)return n(o,t,""===r?ee+le(t,0):r),1;var s=0,c=""===r?ee:r+te;if(Array.isArray(t))for(var l=0;l<t.length;l++)s+=e(i=t[l],c+le(i,l),n,o);else if("function"==typeof(r=b(t))){r===t.entries&&(re||P("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead."),re=!0);for(var f,p=r.call(t),h=0;!(f=p.next()).done;)s+=e(i=f.value,c+le(i,h++),n,o)}else if("object"==u)throw r=" If you meant to render a collection of children, use an array instead."+I.getStackAddendum(),u=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==u?"object with keys {"+Object.keys(t).join(", ")+"}":u)+")."+r);return s}(e,"",t,r)}function le(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function fe(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function pe(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,u=e.context,e=i.call(u,t,e.count++);Array.isArray(e)?he(e,n,r,function(e){return e}):null!=e&&(J(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":oe(e.key)+"/")+r,e=Z(o.type,r,o.ref,o._self,o._source,o._owner,o.props)),n.push(e))}function he(e,t,r,n,o){var i="",o=ae(t,i=null!=r?oe(r)+"/":i,n,o);ce(e,pe,o),se(o)}function ye(e){return"string"==typeof e||"function"==typeof e||e===a||e===t||e===i||e===n||e===l||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===u||e.$$typeof===s||e.$$typeof===c||e.$$typeof===r||e.$$typeof===E||e.$$typeof===T||e.$$typeof===v)}function de(){var e=R.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");return e}function me(){if(w.current){var e=A(w.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var ve=!1,Ee={};function Te(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,r=t,(t=me())||(r="string"==typeof r?r:r.displayName||r.name)&&(t="\n\nCheck the top-level render call using <"+r+">."),Ee[r=t]||(Ee[r]=!0,t="",e&&e._owner&&e._owner!==w.current&&(t=" It was passed a child from "+A(e._owner.type)+"."),k(e),x('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,t),k(null)))}function ge(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];J(n)&&Te(n,t)}else if(J(e))e._store&&(e._store.validated=!0);else if(e){var o=b(e);if("function"==typeof o&&o!==e.entries)for(var i,u=o.call(e);!(i=u.next()).done;)J(i.value)&&Te(i.value,t)}}function _e(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=A(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==c&&t.$$typeof!==p)return;r=t.propTypes}r?(k(e),o(r,e.props,"prop",n,I.getStackAddendum),k(null)):void 0===t.PropTypes||ve||(ve=!0,x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function be(e,t,r){var n,o=ye(e);o||(i="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),i+=(null==(t=t)||void 0===(t=t.__source)?"":"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".")||me(),null===e?n="null":Array.isArray(e)?n="array":void 0!==e&&e.$$typeof===d?(n="<"+(A(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,x("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,i));var i=Q.apply(this,arguments);if(null==i)return i;if(o)for(var u=2;u<arguments.length;u++)ge(arguments[u],e);return(e===a?function(e){k(e);for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n);break}}null!==e.ref&&x("Invalid attribute `ref` supplied to `React.Fragment`."),k(null)}:_e)(i),i}var Re=!1;try{var we=Object.freeze({}),Oe=new Map([[we,null]]),Ne=new Set([we]);Oe.set(0,0),Ne.add(0)}catch(e){}function Ae(e,t,r){for(var n=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,o,i=y({},e.props),u=e.key,a=e.ref,s=e._self,c=e._source,l=e._owner;if(null!=t)for(n in q(t)&&(a=t.ref,l=w.current),W(t)&&(u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)Y.call(t,n)&&!z.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?i[n]=o[n]:i[n]=t[n]);var f=arguments.length-2;if(1==f)i.children=r;else if(1<f){for(var p=Array(f),h=0;h<f;h++)p[h]=arguments[h+2];i.children=p}return Z(e.type,u,a,s,c,l,i)}.apply(this,arguments),o=2;o<arguments.length;o++)ge(arguments[o],n.type);return _e(n),n}function Ie(e){var t=be.bind(null,e);return t.type=e,Re||(Re=!0,P("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return P("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}Ne=be;ke.Children={map:function(e,t,r){if(null==e)return e;var n=[];return he(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;r=ae(null,null,t,r),ce(e,fe,r),se(r)},count:function(e){return ce(e,function(){return null},null)},toArray:function(e){var t=[];return he(e,t,null,function(e){return e}),t},only:function(e){if(!J(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},ke.Component=L,ke.Fragment=a,ke.Profiler=i,ke.PureComponent=G,ke.StrictMode=n,ke.Suspense=l,ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S,ke.cloneElement=Ae,ke.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&x("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:u,_context:r}),o=!1,e={$$typeof:s,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(e,{Provider:{get:function(){return o||(o=!0,x("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,x("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}}}),r.Consumer=e,r._currentRenderer=null,r._currentRenderer2=null,r},ke.createElement=Ne,ke.createFactory=Ie,ke.createRef=function(){var e={current:null};return Object.seal(e),e},ke.forwardRef=function(e){return null!=e&&e.$$typeof===p?x("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?x("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&x("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||x("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")),{$$typeof:c,render:e}},ke.isValidElement=J,ke.lazy=function(e){var t,r,n={$$typeof:h,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){x("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){x("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},ke.memo=function(e,t){return ye(e)||x("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:p,type:e,compare:void 0===t?null:t}},ke.useCallback=function(e,t){return de().useCallback(e,t)},ke.useContext=function(e,t){var r,n=de();return void 0!==t&&x("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context&&((r=e._context).Consumer===e?x("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&x("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},ke.useDebugValue=function(e,t){return de().useDebugValue(e,t)},ke.useEffect=function(e,t){return de().useEffect(e,t)},ke.useImperativeHandle=function(e,t,r){return de().useImperativeHandle(e,t,r)},ke.useLayoutEffect=function(e,t){return de().useLayoutEffect(e,t)},ke.useMemo=function(e,t){return de().useMemo(e,t)},ke.useReducer=function(e,t,r){return de().useReducer(e,t,r)},ke.useRef=function(e){return de().useRef(e)},ke.useState=function(e){return de().useState(e)},ke.version="16.14.0"}(),"production"===production?f.exports=u:f.exports=ke;var ee=f.exports,te=f.exports.createContext({hackle:void 0,user:void 0}),v=te.Consumer,re=te.Provider;var ne,oe,ie,ue,ae,se,ce,le,fe,pe,he,ye,de,me,ve,Ee,Te,ge,_e,be,Re,we,Oe,Ne,Ae,Ie,Pe,xe,Me,De,Fe,Ue,je,Le,Ve,He,$e,Ge,Be,Ke,Ye,ze,qe,We,Xe,Ze,Qe,Je,et,tt,rt,nt,ot,it,ut,at,st,ct,lt,ft,pt,ht,yt,dt,mt,vt,Et,Tt,gt,_t,bt,Rt,wt,Ot,Nt,At={exports:{}};function It(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function Ct(e,t){return e.timestamp==t.timestamp&&e.user.id==t.user.id&&e.user.properties==t.user.properties}T=At.exports,E=T,ne={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},R=function(){function t(){}return t.setLogLevel=function(e){this.logLevel=e=void 0===e?ne.INFO:e},t._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}try{console.log("%c[".concat(e,"] Hackle: ").concat(t),"color: ".concat(r))}catch(e){}},t.logLevel=ne.INFO,t.log={error:function(e){ne.ERROR<=t.logLevel&&t._log("ERROR",e)},warn:function(e){ne.WARN<=t.logLevel&&t._log("WARN",e)},info:function(e){ne.INFO<=t.logLevel&&t._log("INFO",e)},debug:function(e){ne.DEBUG<=t.logLevel&&t._log("DEBUG",e)}},t}(),oe=function(e,t){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},ie=function(){return(ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ue=function(){function r(e,t){this.variation=e,this.reason=t}return r.of=function(e,t){return new r(e,t)},r}(),ae=function(){function t(e,t){this.isOn=e,this.reason=t}return t.on=function(e){return new t(!0,e)},t.off=function(e){return new t(!1,e)},t}(),se=function(){function e(){}return e.SDK_NOT_READY="SDK_NOT_READY",e.EXCEPTION="EXCEPTION",e.INVALID_INPUT="INVALID_INPUT",e.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",e.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",e.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",e.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",e.OVERRIDDEN="OVERRIDDEN",e.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",e.VARIATION_DROPPED="VARIATION_DROPPED",e.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",e.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",e.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",e.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",e.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",e.TARGET_RULE_MATCH="TARGET_RULE_MATCH",e.DEFAULT_RULE="DEFAULT_RULE",e}(),ce=function(){function e(e,t,r,n,o,i,u,a,s,c,l){this.id=e,this.key=t,this.type=r,this.status=n,this.variations=o,this.userOverrides=i,this.segmentOverrides=u,this.targetAudiences=a,this.targetRules=s,this.defaultRule=c,this._winnerVariationId=l}return e.prototype._winnerVariationOrNull=function(){if(this._winnerVariationId)return this._getVariationByIdOrNull(this._winnerVariationId)},e.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},e.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},e}(),le=function(e,t,r){this.id=e,this.key=t,this.isDropped=r},fe=function(e,t,r){this.seed=e,this.slotSize=t,this.slots=r},pe=function(){function e(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}return e.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive},e}(),he=function(e,t){this.id=e,this.key=t},ye=function(e){this.conditions=e},de=function(e,t){this.key=e,this.match=t},me=function(e,t){this.type=e,this.name=t},ve=function(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n},Ee=function(e,t,r){this.type=e,this.variationId=t,this.bucketId=r},Te=function(e,t){this.target=e,this.action=t},ge=function(e,t,r,n){this.id=e,this.key=t,this.type=r,this.targets=n},_e=function(){function i(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}return i.tryParse=function(e){var u=i.regExp.exec(e);if(u){var t=function(e){var t="function"==typeof Symbol&&u[Symbol.iterator];if(!t)return u;var r,n,o=t.call(u),i=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)i.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(n)throw n.error}}return i}(6);t[0];var r=t[1],n=t[2],o=void 0===n?"0":n,e=t[3],n=void 0===e?"0":e,e=t[4],t=t[5];return new i(new be(parseInt(r,10),parseInt(o,10),parseInt(n,10)),Re.parse(e),Re.parse(t))}},i.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},i.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},i.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},i.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},i.prototype.isLessThan=function(e){return this.compareTo(e)<0},i.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},i.regExp=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,i}(),be=function(){function e(e,t,r){this.major=e,this.minor=t,this.patch=r}return e.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch},e}(),Re=function(){function o(e){this.identifiers=e}return o.parse=function(e){return e?new o(e.split(".")):o.EMPTY},o.prototype.isEmpty=function(){return 0===this.identifiers.length},o.prototype.isNotEmpty=function(){return!this.isEmpty()},o.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},o.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=o.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},o.compareIdentifiers=function(e,t){return o.numericIdentifierRegExp.test(e)&&o.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},o.EMPTY=new o([]),o.numericIdentifierRegExp=/^(0|[1-9]\d*)$/,o}(),we=["MATCH","NOT_MATCH"],Oe=["STRING","NUMBER","BOOLEAN","VERSION"],Ne=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],Ae=["VARIATION","BUCKET"],Ie=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT"],Pe=["USER_ID","USER_PROPERTY"],xe=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.supportedKeyTypes=e}return e.prototype.supports=function(e){return this.supportedKeyTypes.includes(e)},e.IDENTIFIER=new e("SEGMENT"),e.PROPERTY=new e("SEGMENT","USER_PROPERTY","HACKLE_PROPERTY"),e.SEGMENT=new e("USER_ID","USER_PROPERTY","HACKLE_PROPERTY"),e}(),Me=function(){function e(){}return e.validate=function(e){if(e){if("object"!=typeof e)return!1;for(var t in e)if(!this.validProperty(t,e[t]))return!1}return!0},e.filteredProperties=function(r){var n=this;return Object.keys(r).filter(function(e){return n.validProperty(e,r[e])}).reduce(function(e,t){return ie(ie({},e),((e={})[t]=n.filteredPropertiesValue(r[t]),e))},{})},e.filteredPropertiesValue=function(e){return"string"==typeof e&&1024<e.length?e.slice(0,1024):e},e.validProperty=function(e,t){return!!e&&"string"==typeof e&&!(128<e.length)&&("string"==typeof t||"boolean"==typeof t||"number"==typeof t&&!isNaN(t)&&isFinite(t))},e}(),De=function(){function e(e,t,r){this.timestamp=e,this.user=t,this.hackleProperties=r}return e.exposure=function(e,t,r,n){return void 0===n&&(n={}),new Fe((new Date).getTime(),t,e,r.variationId,r.variationKey,r.reason,n)},e.track=function(e,t,r,n){return void 0===n&&(n={}),new Ue((new Date).getTime(),r,e,t,n)},e.isExposure=function(e){return void 0!==e.experiment},e.isTrack=function(e){return void 0!==e.eventType},e}(),Fe=function(a){function e(e,t,r,n,o,i,u){u=a.call(this,e,t,u)||this;return u.experiment=r,u.variationId=n,u.variationKey=o,u.decisionReason=i,u}return It(e,a),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Me.filteredProperties(this.user.properties||{}),experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString(),hackleProperties:Me.filteredProperties(this.hackleProperties||{})}},e}(De),Ue=function(i){function e(e,t,r,n,o){o=i.call(this,e,t,o)||this;return o.eventType=r,o.event=n,o}return It(e,i),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Me.filteredProperties(this.user.properties||{}),eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:Me.filteredProperties(this.event.properties||{}),hackleProperties:Me.filteredProperties(this.hackleProperties||{})}},e}(De),je=function(){function n(e,t,r){this.variationId=e,this.variationKey=t,this.reason=r}return n.withVariation=function(e,t){return new n(e.id,e.key,t)},n.withKey=function(e,t){return new n(void 0,e,t)},n.of=function(e,t,r){e=e._getVariationByKeyOrNull(t);return e?n.withVariation(e,r):n.withKey(t,r)},n}(),Le=function(){function e(e){this.evaluationFlowFactory=e}return e.prototype.evaluate=function(e,t,r,n,o){return this.evaluationFlowFactory.getFlow(t.type).evaluate(e,t,r,n,o)},e}(),Ve=function(){function e(e){this.conditionMatcherFactory=e}return e.prototype.matches=function(e,t,r,n){var o=this;return e.conditions.every(function(e){return o._matches(e,t,r,n)})},e.prototype._matches=function(e,t,r,n){return this.conditionMatcherFactory.getMatcher(e.key.type).matches(e,t,r,n)},e}(),He=function(){function e(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}return e.prototype.matches=function(t,e){var r=this.valueMatcherFactory.getMatcher(e.valueType),n=this.operatorMatcherFactory.getMatcher(e.operator),o=e.values.some(function(e){return r.matches(n,t,e)});return this._matches(e.type,o)},e.prototype._matches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}},e}(),$e=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return e===t},e.prototype.numberMatches=function(e,t){return e===t},e.prototype.stringMatches=function(e,t){return e===t},e.prototype.versionMatches=function(e,t){return e.isEqualTo(t)},e}(),Ge=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.includes(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Be=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.startsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Ke=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.endsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Ye=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThan(t)},e}(),ze=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<=e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThanOrEqualTo(t)},e}(),qe=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThan(t)},e}(),We=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<=t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThanOrEqualTo(t)},e}(),Xe=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"IN":return t.IN_MATCHER;case"CONTAINS":return t.CONTAINS_MATCHER;case"STARTS_WITH":return t.STARTS_WITH_MATCHER;case"ENDS_WITH":return t.ENDS_WITH_MATCHER;case"GT":return t.GT_MATCHER;case"GTE":return t.GTE_MATCHER;case"LT":return t.LT_MATCHER;case"LTE":return t.LTE_MATCHER}},t.IN_MATCHER=new $e,t.CONTAINS_MATCHER=new Ge,t.STARTS_WITH_MATCHER=new Be,t.ENDS_WITH_MATCHER=new Ke,t.GT_MATCHER=new Ye,t.GTE_MATCHER=new ze,t.LT_MATCHER=new qe,t.LTE_MATCHER=new We,t}(),Ze=function(){function e(){}return e.prototype.matches=function(e,t,r){return"string"==typeof t&&"string"==typeof r&&e.stringMatches(t,r)},e}(),Qe=function(){function e(){}return e.prototype.matches=function(e,t,r){return"number"==typeof t&&"number"==typeof r&&e.numberMatches(t,r)},e}(),Je=function(){function e(){}return e.prototype.matches=function(e,t,r){return"boolean"==typeof t&&"boolean"==typeof r&&e.booleanMatches(t,r)},e}(),et=function(){function e(){}return e.prototype.matches=function(e,t,r){t=_e.tryParse(t),r=_e.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)},e}(),tt=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"STRING":return t.STRING_MATCHER;case"NUMBER":return t.NUMBER_MATCHER;case"BOOLEAN":return t.BOOLEAN_MATCHER;case"VERSION":return t.VERSION_MATCHER}},t.STRING_MATCHER=new Ze,t.NUMBER_MATCHER=new Qe,t.BOOLEAN_MATCHER=new Je,t.VERSION_MATCHER=new et,t}(),rt=function(){function e(e,t){this.userValueResolver=e,this.valueOperatorMatcher=t}return e.prototype.matches=function(e,t,r,n){n=this.userValueResolver.resolveOrNull(r,n,e.key);return!!n&&this.valueOperatorMatcher.matches(n,e.match)},e}(),nt=function(){function e(){}return e.prototype.resolveOrNull=function(e,t,r){switch(r.type){case"USER_ID":return e.id;case"USER_PROPERTY":return e.properties&&e.properties[r.name];case"HACKLE_PROPERTY":return t[r.name];case"SEGMENT":throw new Error("Unsupported TargetKeyType [".concat(r.type,"]"))}},e}(),ot=function(){function e(e){this.segmentMatcher=e}return e.prototype.matches=function(e,t,r,n){var o=this;if("SEGMENT"!=e.key.type)throw new Error("Unsupported TargetKeyType [".concat(e.key.type,"]"));var i=e.match.values.some(function(e){return o._matches(e,t,r,n)});switch(e.match.type){case"MATCH":return i;case"NOT_MATCH":return!i}},e.prototype._matches=function(e,t,r,n){if("string"!=typeof e)throw new Error("SegmentKey[".concat(e,"]"));var o=t.getSegmentOrNull(e);if(!o)throw new Error("Segment[".concat(e,"]"));return this.segmentMatcher.matches(o,t,r,n)},e}(),it=function(){function e(e){this.userConditionMatcher=e}return e.prototype.matches=function(e,t,r,n){var o=this;return e.targets.some(function(e){return o._matches(e,t,r,n)})},e.prototype._matches=function(e,t,r,n){var o=this;return e.conditions.every(function(e){return o.userConditionMatcher.matches(e,t,r,n)})},e}(),ut=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":return t.USER_CONDITION_MATCHER;case"SEGMENT":return t.SEGMENT_CONDITION_MATCHER}},t.USER_CONDITION_MATCHER=new rt(new nt,new He(new tt,new Xe)),t.SEGMENT_CONDITION_MATCHER=new ot(new it(t.USER_CONDITION_MATCHER)),t}(),at=function(){function e(e){this.bucketer=e}return e.prototype.resolveOrNull=function(e,t,r,n){switch(e.type){case"VARIATION":return this._resolveVariation(e,r);case"BUCKET":return this._resolveBucket(e,t,r,n)}},e.prototype._resolveVariation=function(e,t){return t._getVariationByIdOrNull(e.variationId)},e.prototype._resolveBucket=function(e,t,r,n){e=t.getBucketOrNull(e.bucketId),n=this.bucketer.bucketing(e,n);if(n)return r._getVariationByIdOrNull(n.variationId)},e}(),st={murmurhash3_x86_32:function(e,t,r,n){for(var o,i=3432918353,u=461845907,a=-4&(n=void 0===n?e.length:n),s=t,c=0;c<a;c+=4)o=255&e.charCodeAt(c)|(255&e.charCodeAt(c+1))<<8|(255&e.charCodeAt(c+2))<<16|(255&e.charCodeAt(c+3))<<24,o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s=5*((524287&(s^=o=this.mul32(o,u)))<<13|s>>>19)+3864292196|0;switch(o=0,n%4){case 3:o=(255&e.charCodeAt(2+a))<<16;case 2:o|=(255&e.charCodeAt(1+a))<<8;case 1:o|=255&e.charCodeAt(a),o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s^=o=this.mul32(o,u)}return s^=n,s=this.mul32(s^=s>>>16,2246822507),(s=this.mul32(s^=s>>>13,3266489909))^s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},ct=function(){function e(){}return e.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t.id);return e.slots.find(function(e){return e.contains(r)})},e.prototype.calculateSlotNumber=function(e,t,r){e=st.murmurhash3_x86_32(r,e);return Math.abs(e)%Math.abs(t)},e}(),lt=function(){function a(e,t){void 0===t&&(t=void 0),this.flowEvaluator=e=void 0===e?void 0:e,this.nextFlow=t}return a.prototype.evaluate=function(e,t,r,n,o){return this.flowEvaluator&&this.nextFlow?this.flowEvaluator.evaluate(e,t,r,n,o,this.nextFlow):je.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},a.of=function(){for(var t,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=new a;try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(r.reverse()),u=i.next();!u.done;u=i.next())o=new a(u.value,o)}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return o},a}(),ft=function(){function e(e){this.overrideResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){var u=this.overrideResolver.resolveOrNull(e,t,r,n);if(!u)return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return je.withVariation(u,se.OVERRIDDEN);case"FEATURE_FLAG":return je.withVariation(u,se.INDIVIDUAL_TARGET_MATCH)}},e}(),pt=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){return"DRAFT"===t.status?je.of(t,o,se.EXPERIMENT_DRAFT):i.evaluate(e,t,r,n,o)},e}(),ht=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){if("PAUSED"!==t.status)return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return je.of(t,o,se.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return je.of(t,o,se.FEATURE_FLAG_INACTIVE)}},e}(),yt=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){if("COMPLETED"!==t.status)return i.evaluate(e,t,r,n,o);o=t._winnerVariationOrNull();if(!o)throw new Error("winner variation [".concat(t.id,"]"));return je.withVariation(o,se.EXPERIMENT_COMPLETED)},e}(),dt=function(){function e(e){this.experimentTargetDeterminer=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t,r,n)?i.evaluate(e,t,r,n,o):je.of(t,o,se.NOT_IN_EXPERIMENT_TARGET)},e}(),mt=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);return r?r.isDropped?je.of(t,o,se.VARIATION_DROPPED):je.withVariation(r,se.TRAFFIC_ALLOCATED):je.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},e}(),vt=function(){function e(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}return e.prototype.evaluate=function(e,t,r,n,o,i){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));var u=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t,r,n);if(!u)return i.evaluate(e,t,r,n,o);r=this.actionResolver.resolveOrNull(u.action,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return je.withVariation(r,se.TARGET_RULE_MATCH)},e}(),Et=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return je.withVariation(r,se.DEFAULT_RULE)},e}(),Tt=function(){function e(e){this.targetMatcher=e}return e.prototype.isUserInExperimentTarget=function(t,e,r,n){var o=this;return 0===e.targetAudiences.length||e.targetAudiences.some(function(e){return o.targetMatcher.matches(e,t,r,n)})},e}(),gt=function(){function e(e){this.targetMatcher=e}return e.prototype.determineTargetRuleOrNull=function(t,e,r,n){var o=this;return e.targetRules.find(function(e){return o.targetMatcher.matches(e.target,t,r,n)})},e}(),_t=function(){function e(e,t){this.targetMatcher=e,this.actionResolver=t}return e.prototype.resolveOrNull=function(t,e,r,n){var o=this,i=e.userOverrides.get(r.id);if(i)return e._getVariationByIdOrNull(i);i=e.segmentOverrides.find(function(e){return o.targetMatcher.matches(e.target,t,r,n)});return i?this.actionResolver.resolveOrNull(i.action,t,e,r):void 0},e}(),bt=function(){function e(){var e=new Ve(new ut),t=new at(new ct),r=new _t(e,t);this.abTestFlow=lt.of(new ft(r),new dt(new Tt(e)),new pt,new ht,new yt,new mt(t)),this.featureFlagFlow=lt.of(new pt,new ht,new yt,new ft(r),new vt(new gt(e),t),new Et(t))}return e.prototype.getFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},e}(),Rt=R.log,a=function(){function e(e,t,r){this.evaluator=new Le(new bt),this.workspaceFetcher=e,this.eventProcessor=t,this.eventEmitter=r,this.workspaceFetcher.start(),this.eventProcessor.start(),this.readyPromise=this.workspaceFetcher.onReady().then(function(){return{success:!0}},function(){return{success:!1}})}return e.prototype._experiment=function(e,t,r,n){if(!e)return Rt.error("experimentKey must not be empty"),ue.of(n,se.INVALID_INPUT);if(!t)return Rt.error("user must not be null."),ue.of(n,se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return Rt.error("user.id must not be null and must be string type"),ue.of(n,se.INVALID_INPUT);var o=this.workspaceFetcher.get();if(!o)return Rt.warn("SDK not ready."),ue.of(n,se.SDK_NOT_READY);e=o.getExperimentOrNull(e);if(!e)return Rt.warn("Experiment does not exist."),ue.of(n,se.EXPERIMENT_NOT_FOUND);n=this.evaluator.evaluate(o,e,t,r,n);return this.eventProcessor.process(De.exposure(e,t,n,r)),ue.of(n.variationKey,n.reason)},e.prototype._featureFlag=function(e,t,r){if(!e)return Rt.error("featureKey must not be empty"),ae.off(se.INVALID_INPUT);if(!t)return Rt.error("user must not be null."),ae.off(se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return Rt.error("user.id must not be null and must be string type"),ae.off(se.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return Rt.warn("SDK not ready."),ae.off(se.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return Rt.warn("FeatureFlag does not exist."),ae.off(se.FEATURE_FLAG_NOT_FOUND);n=this.evaluator.evaluate(n,e,t,r,"A");return this.eventProcessor.process(De.exposure(e,t,n,r)),"A"===n.variationKey?ae.off(n.reason):ae.on(n.reason)},e.prototype._track=function(e,t,r){var n;e?"object"==typeof e?"object"!=typeof e||e.key&&"string"==typeof e.key?t?t.id&&"string"==typeof t.id?(n=this.workspaceFetcher.get())?(n=n.getEventTypeOrNull(e.key),this.eventProcessor.process(De.track(n,e,t,r))):Rt.warn("SDK not ready"):Rt.error("Id must not be null. or Id must be string type"):Rt.error("User must not be null."):Rt.warn("Event key must be not null. or event key must be string type."):Rt.warn("Event must be event type."):Rt.warn("event must not be null.")},e.prototype._onReady=function(e,t){this._onInitialized({timeout:t=void 0===t?3e3:t}).then(function(){return e()})},e.prototype._onInitialized=function(e){var t,r=e.timeout,e=void 0===r?3e3:r;Rt.debug("Start HackleClient initializing");var r=new Promise(function(e){t=e}),n=setTimeout(function(){t({success:!1})},e);return this.readyPromise.then(function(){clearTimeout(n),t({success:!0})}),Promise.race([this.readyPromise,r]).then(function(e){return Rt.debug("HackleClient onInitialized"),Promise.resolve({success:e.success})})},e.prototype._close=function(){this.workspaceFetcher.close(),this.eventProcessor.close()},e}(),wt=function(){function e(e){var t=e.timeout,e=e.callback;this.timeout=Math.max(t,0),this.callback=e}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),Ot=function(){function e(e,t,r,n){void 0===r&&(r=1e3),void 0===n&&(n=1e4),this.buffer=[],this.sink=e,this.maxQueueSize=r,this.batchComparator=t,this.timer=new wt({callback:this.flush.bind(this),timeout:n}),this.started=!1}return e.prototype.start=function(){this.started=!0},e.prototype.stop=function(){this.started=!1;var e=this.sink(this.buffer,!0);return this.buffer=[],this.timer.stop(),e},e.prototype.enqueue=function(e){this.started&&(0===this.buffer.length&&this.timer.refresh(),this.buffer.push(e),this.buffer.length>=this.maxQueueSize&&this.flush())},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e.prototype.close=function(){this.stop()},e}(),u=function(){function n(e,t,r){void 0===t&&(t=1e3),void 0===r&&(r=n.DEFAULT_FLUSH_INTERVAL),this.flushInterval=n.DEFAULT_FLUSH_INTERVAL,this.eventDispatcher=e,this.flushInterval=r,this.queue=new Ot(this.drainQueue.bind(this),Ct,t,r)}return n.prototype.drainQueue=function(t,r){var n=this;return new Promise(function(e){0!==t.length?r?n.eventDispatcher.dispatchXhrOrBeacon(t,function(){e()}):n.eventDispatcher.dispatch(t,function(){e()}):e()})},n.prototype.process=function(e){this.queue.enqueue(e)},n.prototype.start=function(){return e=this,s=function(){return r=this,n=function(e){return this.queue.start(),[2]},a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!((u=0<(u=a.trys).length&&u[u.length-1])||6!==t[0]&&2!==t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}var r,n,o,i,u,t,a},new(a=(a=u=void 0)||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())});var e,u,a,s},n.prototype.stop=function(){try{this.queue.close()}catch(e){}return Promise.resolve()},n.prototype.close=function(){this.stop()},n.DEFAULT_FLUSH_INTERVAL=1e4,n}(),Nt=R.log,T=function(){function l(e,t,r,n,o){this.experiments=e,this.featureFlags=t,this.buckets=r,this.eventTypes=n,this.segments=o}return l.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},l.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},l.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},l.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)||new he(0,e)},l.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},l.from=function(e){var t=this,r=l.associate(e.buckets,function(e){return[e.id,t.toBucket(e)]}),n=l.associateBy(l.mapNotUndefined(e.experiments,function(e){return t.toExperimentOrNull("AB_TEST",e)}),function(e){return e.key}),o=l.associateBy(l.mapNotUndefined(e.featureFlags,function(e){return t.toExperimentOrNull("FEATURE_FLAG",e)}),function(e){return e.key}),i=l.associate(e.events,function(e){return[e.key,new he(e.id,e.key)]}),e=l.associateBy(l.mapNotUndefined(e.segments,function(e){return t.toSegmentOrNull(e)}),function(e){return e.key});return new l(n,o,r,i,e)},l.toBucket=function(e){return new fe(e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new pe(t,r,e)}))},l.toExperimentOrNull=function(e,t){var r=this,n=this.experimentStatusOrNull(t.execution.status),o=t.variations.map(function(e){return new le(e.id,e.key,"DROPPED"===e.status)}),i=l.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),u=l.mapNotUndefined(t.execution.segmentOverrides,function(e){return r.toTargetRuleOrNull(e,xe.IDENTIFIER)}),a=l.mapNotUndefined(t.execution.targetAudiences,function(e){return r.toTargetOrNull(e,xe.PROPERTY)}),s=l.mapNotUndefined(t.execution.targetRules,function(e){return r.toTargetRuleOrNull(e,xe.PROPERTY)}),c=this.toTargetActionOrNull(t.execution.defaultRule);return n&&c&&new ce(t.id,t.key,e,n,o,i,u,a,s,c,t.winnerVariationId)},l.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void Nt.debug("Unsupported status [".concat(e,"]"))}},l.toTargetRuleOrNull=function(e,t){t=this.toTargetOrNull(e.target,t),e=this.toTargetActionOrNull(e.action);return t&&e&&new Te(t,e)},l.toTargetActionOrNull=function(e){var t=this.parseOrNull(Ae,e.type);return t&&new Ee(t,e.variationId,e.bucketId)},l.toTargetOrNull=function(e,t){var r=this,e=l.mapNotUndefined(e.conditions,function(e){return r.toConditionOrNull(e,t)});return new ye(e)},l.toConditionOrNull=function(e,t){var r=this.toTargetKeyOrNull(e.key);if(r&&t.supports(r.type)){e=this.toTargetMatchOrNull(e.match);return e&&new de(r,e)}},l.toTargetKeyOrNull=function(e){var t=this.parseOrNull(Ie,e.type);return t&&new me(t,e.name)},l.toTargetMatchOrNull=function(e){var t=this.parseOrNull(we,e.type),r=this.parseOrNull(Ne,e.operator),n=this.parseOrNull(Oe,e.valueType);return t&&r&&n&&new ve(t,r,n,e.values)},l.toSegmentOrNull=function(e){var t=this,r=this.parseOrNull(Pe,e.type);return r&&new ge(e.id,e.key,r,this.mapNotUndefined(e.targets,function(e){return t.toTargetOrNull(e,xe.SEGMENT)}))},l.parseOrNull=function(e,t){e=e.find(function(e){return e===t});return e||Nt.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e},l.mapNotUndefined=function(e,r){return e.reduce(function(e,t){t=r(t);return t&&e.push(t),e},Array())},l.associateTo=function(e,t,r){return e.reduce(function(e,t){t=r(t);return e.set(t[0],t[1]),e},t)},l.associate=function(e,t){return l.associateTo(e,new Map,t)},l.associateBy=function(e,t){return this.associateTo(e,new Map,function(e){return[t(e),e]})},l}(),E.Bucket=fe,E.CoreVersion=be,E.DEFAULT_ON_READY_TIMEOUT=3e3,E.Decision=ue,E.DecisionReason=se,E.DefaultEventQueue=Ot,E.Event=De,E.EventProcessor=u,E.EventType=he,E.Experiment=ce,E.Exposure=Fe,E.FeatureFlagDecision=ae,E.HackleInternalClient=a,E.Logger=R,E.MATCH_OPERATORS=Ne,E.MATCH_TYPES=we,E.MATCH_VALUE_TYPES=Oe,E.MetaVersion=Re,E.SEGMENT_TYPES=Pe,E.Segment=ge,E.Slot=pe,E.TARGET_ACTION_TYPES=Ae,E.TARGET_KEY_TYPES=Ie,E.Target=ye,E.TargetAction=Ee,E.TargetCondition=de,E.TargetKey=me,E.TargetMatch=ve,E.TargetRule=Te,E.TargetingType=xe,E.Track=Ue,E.Variation=le,E.Version=_e,E.Workspace=T,E.logLevels=ne,E.toPayload=function(e){var t=new Array,r=new Array;return e.forEach(function(e){De.isExposure(e)?t.push(e.toDto()):De.isTrack(e)&&r.push(e.toDto())}),{exposureEvents:t,trackEvents:r}},Object.defineProperty(E,"__esModule",{value:!0});var kt=At.exports.Logger.log;function St(e,t){void 0===t&&(t="A");var r=f.exports.useContext(te),n=r.hackle,o=r.user,i=f.exports.useCallback(function(){return(null==n?void 0:n.variation(e,o))||t},[t,e,o,n]),u=l(f.exports.useState(function(){return n?i():("undefined"!=typeof window&&kt.error("HackleClient is not existed"),t)}),2),a=u[0],s=u[1],c={key:e,user:o},r=l(f.exports.useState(c),2),u=r[0],r=r[1];return Pt(u,c)||(r(c),s(i())),a}function Pt(e,t){var r,n,o;return e.key===t.key&&(null===(r=e.user)||void 0===r?void 0:r.id)===(null===(r=t.user)||void 0===r?void 0:r.id)&&(e=null===(e=e.user)||void 0===e?void 0:e.properties,t=null===(t=t.user)||void 0===t?void 0:t.properties,n=xt(e),o=xt(t),e=Object.keys(n),t=Object.keys(o),e.length===t.length&&e.every(function(e){return e in o&&n[e]===o[e]}))}function xt(e){return"object"==typeof e&&null!==e?e:{}}function Mt(e){var t,r=e.experimentKey,e=e.children,n=St(r);return e&&"function"==typeof e?e(n):(f.exports.Children.forEach(e,function(e){f.exports.isValidElement(e)&&(e.props.variation?n===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?f.exports.cloneElement(t,{variation:n}):null)}function Dt(e){return e.variation,e=e.children,f.exports.createElement(f.exports.Fragment,null,e)}t.HackleContext=te,t.HackleContextConsumer=v,t.HackleContextProvider=re,t.HackleExperiment=Mt,t.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=e.timeout,o=void 0===n?3e3:n,i=e.children,u={hackle:t,user:r},e=(n=l(f.exports.useState(!1),2))[0],a=n[1],u=(n=l(f.exports.useState(u),2))[0],s=n[1];return f.exports.useEffect(function(){s(function(e){return c(c({},e),{user:r})})},[r]),t.onInitialized({timeout:o}).then(function(){a(!0)}),e?ee.createElement(re,{value:u},i):null},t.HackleVariation=Dt,t.createInstance=function(e,t){return new o(e,t)},t.useFeature=function(e){var t=(s=f.exports.useContext(te)).hackle,r=s.user,n=f.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e,r))||!1},[e,r,t]),o=(a=l(f.exports.useState(function(){return t?n():("undefined"!=typeof window&&kt.error("HackleClient is not existed"),!1)}),2))[0],i=a[1],u={key:e,user:r},a=(s=l(f.exports.useState(u),2))[0],s=s[1];return Pt(a,u)||(s(u),i(n())),o},t.useFeatureFlagDetail=function(e){var t=(s=f.exports.useContext(te)).hackle,r=s.user,n=f.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e,r))||At.exports.FeatureFlagDecision.off(At.exports.DecisionReason.EXCEPTION)},[e,r,t]),o=(a=l(f.exports.useState(function(){return t?n():("undefined"!=typeof window&&kt.error("HackleClient is not existed"),At.exports.FeatureFlagDecision.off(At.exports.DecisionReason.EXCEPTION))}),2))[0],i=a[1],u={key:e,user:r},a=(s=l(f.exports.useState(u),2))[0],s=s[1];return Pt(a,u)||(s(u),i(n())),o},t.useTrack=function(){var e=f.exports.useContext(te),t=e.hackle,r=e.user;return t?function(e){return null==t?void 0:t.track(e,r)}:("undefined"!=typeof window&&kt.error("HackleClient is not existed"),function(){})},t.useVariation=St,t.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(c=f.exports.useContext(te)).hackle,n=c.user,o=f.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e,n))||At.exports.Decision.of(t,At.exports.DecisionReason.EXCEPTION)},[t,e,n,r]),i=(s=l(f.exports.useState(function(){return r?o():("undefined"!=typeof window&&kt.error("HackleClient is not existed"),At.exports.Decision.of(t,At.exports.DecisionReason.EXCEPTION))}),2))[0],u=s[1],a={key:e,user:n},s=(c=l(f.exports.useState(a),2))[0],c=c[1];return Pt(s,a)||(c(a),u(o())),i},Object.keys(r).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}),Object.defineProperty(t,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hackler/js-client-sdk")):"function"==typeof define&&define.amd?define(["exports","@hackler/js-client-sdk"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={},e.Hackle)}(this,function(t,F){"use strict";function U(r){if(r&&r.__esModule)return r;var n=Object.create(null);return r&&Object.keys(r).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(r,e),Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:function(){return r[e]}}))}),n.default=r,Object.freeze(n)}var j=U(F),c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}e.prototype.variation=function(e,t,r){return this.client.variation(e,t,r)},e.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t,r)},e.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t)},e.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t)},e.prototype.track=function(e,t){this.client.track(e,t)},e.prototype.trackPageView=function(e){this.client.trackPageView(e)},e.prototype.onReady=function(e,t){this.client.onReady(e,t)},e.prototype.onInitialized=function(e){return this.client.onInitialized(e)};var L=e;function e(e,t){this.client=j.createInstance(e,c(c({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"3.4.0"}))}var l={exports:{}},r={},V=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var G=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))H.call(r,i)&&(n[i]=r[i]);if(V)for(var u=V(r),a=0;a<u.length;a++)$.call(r,u[a])&&(n[u[a]]=r[u[a]])}return n},B=G,n="function"==typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,K=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,Y=n?Symbol.for("react.provider"):60109,z=n?Symbol.for("react.context"):60110,q=n?Symbol.for("react.forward_ref"):60112,W=n?Symbol.for("react.suspense"):60113,X=n?Symbol.for("react.memo"):60115,Z=n?Symbol.for("react.lazy"):60116,Q="function"==typeof Symbol&&Symbol.iterator;function h(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var J={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ee={};function a(e,t,r){this.props=e,this.context=t,this.refs=ee,this.updater=r||J}function te(){}function re(e,t,r){this.props=e,this.context=t,this.refs=ee,this.updater=r||J}a.prototype.isReactComponent={},a.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(h(85));this.updater.enqueueSetState(this,e,t,"setState")},a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},te.prototype=a.prototype;var n=re.prototype=new te,ne=(n.constructor=re,B(n,a.prototype),n.isPureReactComponent=!0,{current:null}),oe=Object.prototype.hasOwnProperty,ie={key:!0,ref:!0,__self:!0,__source:!0};function ue(e,t,r){var n,o={},i=null,u=null;if(null!=t)for(n in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(i=""+t.key),t)oe.call(t,n)&&!ie.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:p,type:e,key:i,ref:u,props:o,_owner:ne.current}}function ae(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var se=/\/+/g,ce=[];function fe(e,t,r,n){var o;return ce.length?((o=ce.pop()).result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o):{result:e,keyPrefix:t,func:r,context:n,count:0}}function le(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,ce.length<10&&ce.push(e)}function pe(e,t,r){return null==e?0:function e(t,r,n,o){var i=!1;if(null===(t="undefined"!=(a=typeof t)&&"boolean"!==a?t:null))i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case p:case K:i=!0}}if(i)return n(o,t,""===r?"."+he(t,0):r),1;if(i=0,r=""===r?".":r+":",Array.isArray(t))for(var u=0;u<t.length;u++){var a,s=r+he(a=t[u],u);i+=e(a,s,n,o)}else if("function"==typeof(s=null!==t&&"object"==typeof t&&"function"==typeof(s=Q&&t[Q]||t["@@iterator"])?s:null))for(t=s.call(t),u=0;!(a=t.next()).done;)i+=e(a=a.value,s=r+he(a,u++),n,o);else if("object"===a)throw n=""+t,Error(h(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return i}(e,"",t,r)}function he(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function ye(e,t){e.func.call(e.context,t,e.count++)}function de(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?me(e,n,r,function(e){return e}):null!=e&&(ae(e)&&(t=o+(!(o=e).key||t&&t.key===e.key?"":(""+e.key).replace(se,"$&/")+"/")+r,e={$$typeof:p,type:o.type,key:t,ref:o.ref,props:o.props,_owner:o._owner}),n.push(e))}function me(e,t,r,n,o){var i="";pe(e,de,t=fe(t,i=null!=r?(""+r).replace(se,"$&/")+"/":i,n,o)),le(t)}var ve={current:null};function s(){var e=ve.current;if(null===e)throw Error(h(321));return e}var Ee,Te,ge,n={ReactCurrentDispatcher:ve,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:ne,IsSomeRendererActing:{current:!1},assign:B},o=(r.Children={map:function(e,t,r){if(null==e)return e;var n=[];return me(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;pe(e,ye,t=fe(null,null,t,r)),le(t)},count:function(e){return pe(e,function(){return null},null)},toArray:function(e){var t=[];return me(e,t,null,function(e){return e}),t},only:function(e){if(ae(e))return e;throw Error(h(143))}},r.Component=a,r.Fragment=o,r.Profiler=u,r.PureComponent=re,r.StrictMode=i,r.Suspense=W,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n,r.cloneElement=function(e,t,r){if(null==e)throw Error(h(267,e));var n=B({},e.props),o=e.key,i=e.ref,u=e._owner;if(null!=t)for(a in void 0!==t.ref&&(i=t.ref,u=ne.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)oe.call(t,a)&&!ie.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==s?s:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];n.children=s}return{$$typeof:p,type:e.type,key:o,ref:i,props:n,_owner:u}},r.createContext=function(e,t){return(e={$$typeof:z,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:Y,_context:e},e.Consumer=e},r.createElement=ue,r.createFactory=function(e){var t=ue.bind(null,e);return t.type=e,t},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:q,render:e}},r.isValidElement=ae,r.lazy=function(e){return{$$typeof:Z,_ctor:e,_status:-1,_result:null}},r.memo=function(e,t){return{$$typeof:X,type:e,compare:void 0===t?null:t}},r.useCallback=function(e,t){return s().useCallback(e,t)},r.useContext=function(e,t){return s().useContext(e,t)},r.useDebugValue=function(){},r.useEffect=function(e,t){return s().useEffect(e,t)},r.useImperativeHandle=function(e,t,r){return s().useImperativeHandle(e,t,r)},r.useLayoutEffect=function(e,t){return s().useLayoutEffect(e,t)},r.useMemo=function(e,t){return s().useMemo(e,t)},r.useReducer=function(e,t,r){return s().useReducer(e,t,r)},r.useRef=function(e){return s().useRef(e)},r.useState=function(e){return s().useState(e)},r.version="16.14.0",{}),u=Function.call.bind(Object.prototype.hasOwnProperty),_e=function(){};function be(e,t,r,n,o){if("production"!==production)for(var i in e)if(ge(e,i)){var u,a;try{if("function"!=typeof e[i])throw(a=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.")).name="Invariant Violation",a;u=e[i](t,i,n,r,null,Ee)}catch(e){u=e}!u||u instanceof Error||_e((n||"React class")+": type specification of "+r+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in Te)&&(Te[u.message]=!0,i=o?o():"",_e("Failed "+r+" type: "+u.message+(null!=i?i:"")))}}if("production"!==production&&(Ee="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Te={},ge=u,_e=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),be.resetWarningCache=function(){"production"!==production&&(Te={})},"production"!==production){var Re=G,we=be,i="function"==typeof Symbol&&Symbol.for,Oe=i?Symbol.for("react.element"):60103,Ne=i?Symbol.for("react.portal"):60106,Ae=i?Symbol.for("react.fragment"):60107,Ie=i?Symbol.for("react.strict_mode"):60108,Ce=i?Symbol.for("react.profiler"):60114,ke=i?Symbol.for("react.provider"):60109,Se=i?Symbol.for("react.context"):60110,Pe=i?Symbol.for("react.concurrent_mode"):60111,xe=i?Symbol.for("react.forward_ref"):60112,Me=i?Symbol.for("react.suspense"):60113,De=i?Symbol.for("react.suspense_list"):60120,y=i?Symbol.for("react.memo"):60115,Fe=i?Symbol.for("react.lazy"):60116,Ue=i?Symbol.for("react.block"):60121,je=i?Symbol.for("react.fundamental"):60117,Le=i?Symbol.for("react.responder"):60118,Ve=i?Symbol.for("react.scope"):60119,He="function"==typeof Symbol&&Symbol.iterator,$e="@@iterator";function Ge(e){if(null===e||"object"!=typeof e)return null;e=He&&e[He]||e[$e];return"function"==typeof e?e:null}var Be={current:null},T={current:null},Ke=/^(.*)[\\\/]/,Ye=1;function g(e){if(null==e)return null;if("number"==typeof e.tag&&_("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case Ae:return"Fragment";case Ne:return"Portal";case Ce:return"Profiler";case Ie:return"StrictMode";case Me:return"Suspense";case De:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case Se:return"Context.Consumer";case ke:return"Context.Provider";case xe:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case y:return g(e.type);case Ue:return g(e.render);case Fe:r=(t=e)._status===Ye?t._result:null;if(r)return g(r)}var t,r;return null}var d={},m=null;function v(e){m=e}d.getCurrentStack=null,d.getStackAddendum=function(){var e,t,r,n,o,i="",u=(m&&(e=g(m.type),r=m._owner,i+=(e=e,t=m._source,r=r&&g(r.type),o="",t?(n=(u=t.fileName).replace(Ke,""),o=" (at "+(n=/^index\./.test(n)&&(u=u.match(Ke))&&(u=u[1])?u.replace(Ke,"")+"/"+n:n)+":"+t.lineNumber+")"):r&&(o=" (created by "+r+")"),"\n in "+(e||"Unknown")+o)),d.getCurrentStack);return u&&(i+=u()||""),i};var ze={ReactCurrentDispatcher:Be,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:T,IsSomeRendererActing:{current:!1},assign:Re};function qe(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];We("warn",e,r)}function _(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];We("error",e,r)}function We(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=ze.ReactDebugCurrentFrame.getStackAddendum())&&(t+="%s",r=r.concat([n]));var n=r.map(function(e){return""+e});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n);try{var o=0,i="Warning: "+t.replace(/%s/g,function(){return r[o++]});throw new Error(i)}catch(e){}}Re(ze,{ReactDebugCurrentFrame:d,ReactComponentTreeHook:{}});var Xe={};function Ze(e,t){var e=e.constructor,e=e&&(e.displayName||e.name)||"ReactClass",r=e+"."+t;Xe[r]||(_("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),Xe[r]=!0)}var Qe={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){Ze(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){Ze(e,"replaceState")},enqueueSetState:function(e,t,r,n){Ze(e,"setState")}},Je={};function E(e,t,r){this.props=e,this.context=t,this.refs=Je,this.updater=r||Qe}Object.freeze(Je),E.prototype.isReactComponent={},E.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},E.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var et,tt={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(et in tt)tt.hasOwnProperty(et)&&!function(e,t){Object.defineProperty(E.prototype,e,{get:function(){qe("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(et,tt[et]);function rt(){}function nt(e,t,r){this.props=e,this.context=t,this.refs=Je,this.updater=r||Qe}rt.prototype=E.prototype,(i=nt.prototype=new rt).constructor=nt,Re(i,E.prototype),i.isPureReactComponent=!0;var ot,it,ut=Object.prototype.hasOwnProperty,at={key:!0,ref:!0,__self:!0,__source:!0};function st(e){if(ut.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function ct(e){if(ut.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var ft={},lt=function(e,t,r,n,o,i,u){e={$$typeof:Oe,type:e,key:t,ref:r,props:u,_owner:i,_store:{}};return Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(e,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(e,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e};function pt(e,t,r){var n,o={},i=null,u=null,a=null,s=null;if(null!=t)for(n in st(t)&&(u=t.ref,"string"==typeof(c=t).ref&&T.current&&c.__self&&T.current.stateNode!==c.__self&&(l=g(T.current.type),ft[l]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',g(T.current.type),c.ref),ft[l]=!0))),ct(t)&&(i=""+t.key),a=void 0===t.__self?null:t.__self,s=void 0===t.__source?null:t.__source,t)ut.call(t,n)&&!at.hasOwnProperty(n)&&(o[n]=t[n]);var c,f,l,p,h=arguments.length-2;if(1==h)o.children=r;else if(1<h){for(var y=Array(h),d=0;d<h;d++)y[d]=arguments[d+2];Object.freeze&&Object.freeze(y),o.children=y}if(e&&e.defaultProps){var m=e.defaultProps;for(n in m)void 0===o[n]&&(o[n]=m[n])}function v(){it||(it=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",f))}function E(){ot||(ot=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",p))}return(i||u)&&(c="function"==typeof e?e.displayName||e.name||"Unknown":e,i&&(l=o,p=c,E.isReactWarning=!0,Object.defineProperty(l,"key",{get:E,configurable:!0})),u&&(r=o,f=c,v.isReactWarning=!0,Object.defineProperty(r,"ref",{get:v,configurable:!0}))),lt(e,i,u,a,s,T.current,o)}function b(e){return"object"==typeof e&&null!==e&&e.$$typeof===Oe}var ht=".",yt=":",dt=!1,mt=/\/+/g;function vt(e){return(""+e).replace(mt,"$&/")}var Et=10,Tt=[];function gt(e,t,r,n){var o;return Tt.length?((o=Tt.pop()).result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o):{result:e,keyPrefix:t,func:r,context:n,count:0}}function _t(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,Tt.length<Et&&Tt.push(e)}function bt(e,t,r){return null==e?0:function e(t,r,n,o){var i,u=typeof t,a=!1;if(null===(t="undefined"!=u&&"boolean"!=u?t:null))a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Oe:case Ne:a=!0}}if(a)return n(o,t,""===r?ht+Rt(t,0):r),1;var s=0,c=""===r?ht:r+yt;if(Array.isArray(t))for(var f=0;f<t.length;f++)s+=e(i=t[f],c+Rt(i,f),n,o);else if("function"==typeof(r=Ge(t))){r===t.entries&&(dt||qe("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead."),dt=!0);for(var l,p=r.call(t),h=0;!(l=p.next()).done;)s+=e(i=l.value,c+Rt(i,h++),n,o)}else if("object"==u)throw r="",r=" If you meant to render a collection of children, use an array instead."+d.getStackAddendum(),u=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==u?"object with keys {"+Object.keys(t).join(", ")+"}":u)+")."+r);return s}(e,"",t,r)}function Rt(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function wt(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function Ot(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,u=e.context,i=i.call(u,t,e.count++);Array.isArray(i)?Nt(i,n,r,function(e){return e}):null!=i&&(b(i)&&(e=o+(!(u=i).key||t&&t.key===i.key?"":vt(i.key)+"/")+r,i=lt(u.type,e,u.ref,u._self,u._source,u._owner,u.props)),n.push(i))}function Nt(e,t,r,n,o){var i="",t=gt(t,i=null!=r?vt(r)+"/":i,n,o);bt(e,Ot,t),_t(t)}function At(e){return"string"==typeof e||"function"==typeof e||e===Ae||e===Pe||e===Ce||e===Ie||e===Me||e===De||"object"==typeof e&&null!==e&&(e.$$typeof===Fe||e.$$typeof===y||e.$$typeof===ke||e.$$typeof===Se||e.$$typeof===xe||e.$$typeof===je||e.$$typeof===Le||e.$$typeof===Ve||e.$$typeof===Ue)}function R(){var e=Be.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");return e}function It(){if(T.current){var e=g(T.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var Ct=!1,kt={};function St(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,t=t,(r=It())||(t="string"==typeof t?t:t.displayName||t.name)&&(r="\n\nCheck the top-level render call using <"+t+">."),kt[t=r]||(kt[t]=!0,r="",e&&e._owner&&e._owner!==T.current&&(r=" It was passed a child from "+g(e._owner.type)+"."),v(e),_('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',t,r),v(null)))}function Pt(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];b(n)&&St(n,t)}else if(b(e))e._store&&(e._store.validated=!0);else if(e){var o=Ge(e);if("function"==typeof o&&o!==e.entries)for(var i,u=o.call(e);!(i=u.next()).done;)b(i.value)&&St(i.value,t)}}function xt(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=g(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==xe&&t.$$typeof!==y)return;r=t.propTypes}r?(v(e),we(r,e.props,"prop",n,d.getStackAddendum),v(null)):void 0===t.PropTypes||Ct||(Ct=!0,_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Mt(e,t,r){var n,o=At(e),t=(o||(n="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(n+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),n+=(null!=(t=t)&&void 0!==(t=t.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"")||It(),null===e?u="null":Array.isArray(e)?u="array":void 0!==e&&e.$$typeof===Oe?(u="<"+(g(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,_("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,n)),pt.apply(this,arguments));if(null==t)return t;if(o)for(var i=2;i<arguments.length;i++)Pt(arguments[i],e);if(e===Ae){var u=t;v(u);for(var a=Object.keys(u.props),s=0;s<a.length;s++){var c=a[s];if("children"!==c&&"key"!==c){_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c);break}}null!==u.ref&&_("Invalid attribute `ref` supplied to `React.Fragment`."),v(null)}else xt(t);return t}var Dt=!1;try{var Ft=Object.freeze({}),Ut=new Map([[Ft,null]]),jt=new Set([Ft]);Ut.set(0,0),jt.add(0)}catch(e){}function Lt(e,t,r){for(var n=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,o,i=Re({},e.props),u=e.key,a=e.ref,s=e._self,c=e._source,f=e._owner;if(null!=t)for(n in st(t)&&(a=t.ref,f=T.current),ct(t)&&(u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)ut.call(t,n)&&!at.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?i[n]=o[n]:i[n]=t[n]);var l=arguments.length-2;if(1==l)i.children=r;else if(1<l){for(var p=Array(l),h=0;h<l;h++)p[h]=arguments[h+2];i.children=p}return lt(e.type,u,a,s,c,f,i)}.apply(this,arguments),o=2;o<arguments.length;o++)Pt(arguments[o],n.type);return xt(n),n}function Vt(e){var t=Mt.bind(null,e);return t.type=e,Dt||(Dt=!0,qe("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return qe("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}i=Mt,o.Children={map:function(e,t,r){if(null==e)return e;var n=[];return Nt(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=gt(null,null,t,r),bt(e,wt,t),_t(t)},count:function(e){return bt(e,function(){return null},null)},toArray:function(e){var t=[];return Nt(e,t,null,function(e){return e}),t},only:function(e){if(b(e))return e;throw Error("React.Children.only expected to receive a single React element child.")}},o.Component=E,o.Fragment=Ae,o.Profiler=Ce,o.PureComponent=nt,o.StrictMode=Ie,o.Suspense=Me,o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ze,o.cloneElement=Lt,o.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&_("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:Se,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:ke,_context:r}),o=!1,t={$$typeof:Se,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(t,{Provider:{get:function(){return o||(o=!0,_("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,_("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}}}),r.Consumer=t,r._currentRenderer=null,r._currentRenderer2=null,r},o.createElement=i,o.createFactory=Vt,o.createRef=function(){var e={current:null};return Object.seal(e),e},o.forwardRef=function(e){return null!=e&&e.$$typeof===y?_("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?_("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&_("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null==e||null==e.defaultProps&&null==e.propTypes||_("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:xe,render:e}},o.isValidElement=b,o.lazy=function(e){var t,r,n={$$typeof:Fe,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){_("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){_("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},o.memo=function(e,t){return At(e)||_("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:y,type:e,compare:void 0===t?null:t}},o.useCallback=function(e,t){return R().useCallback(e,t)},o.useContext=function(e,t){var r,n=R();return void 0!==t&&_("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context&&((r=e._context).Consumer===e?_("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&_("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},o.useDebugValue=function(e,t){return R().useDebugValue(e,t)},o.useEffect=function(e,t){return R().useEffect(e,t)},o.useImperativeHandle=function(e,t,r){return R().useImperativeHandle(e,t,r)},o.useLayoutEffect=function(e,t){return R().useLayoutEffect(e,t)},o.useMemo=function(e,t){return R().useMemo(e,t)},o.useReducer=function(e,t,r){return R().useReducer(e,t,r)},o.useRef=function(e){return R().useRef(e)},o.useState=function(e){return R().useState(e)},o.version="16.14.0"}"production"===production?l.exports=r:l.exports=o;var Ht=l.exports,w=l.exports.createContext({hackle:void 0,user:void 0}),W=w.Consumer,$t=w.Provider;var O,Gt,Bt,Kt,N,A,I,Yt,zt,qt,Wt,Xt,Zt,Qt,Jt,er,tr,rr,nr,or,ir,ur,ar,sr,cr,fr,lr,pr,hr,C,k,S,yr,dr,P,mr,vr,Er,Tr,gr,_r,br,Rr,wr,Or,Nr,Ar,Ir,Cr,kr,Sr,Pr,xr,Mr,Dr,Fr,Ur,jr,Lr,Vr,Hr,$r,Gr,Br,Kr,Yr,zr,qr,Wr,Xr,Zr,Qr,Jr,x,en,tn,rn,M={exports:{}};function nn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function on(e,t){return e.timestamp==t.timestamp&&e.user.identifiers==t.user.identifiers&&e.user.properties==t.user.properties}n=n=M.exports,O={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},u=function(){function t(){}return t.setLogLevel=function(e){this.logLevel=e=void 0===e?O.INFO:e},t._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}try{console.log("%c[".concat(e,"] Hackle: ").concat(t),"color: ".concat(r))}catch(e){}},t.logLevel=O.INFO,t.log={error:function(e){O.ERROR<=t.logLevel&&t._log("ERROR",e)},warn:function(e){O.WARN<=t.logLevel&&t._log("WARN",e)},info:function(e){O.INFO<=t.logLevel&&t._log("INFO",e)},debug:function(e){O.DEBUG<=t.logLevel&&t._log("DEBUG",e)}},t}(),Gt=function(e,t){return(Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},Bt=function(){return(Bt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Kt=u.log,N=function(){function r(e,t){this.variation=e,this.reason=t}return r.of=function(e,t){return new r(e,t)},r}(),A=function(){function t(e,t){this.isOn=e,this.reason=t}return t.on=function(e){return new t(!0,e)},t.off=function(e){return new t(!1,e)},t}(),I=function(){function e(){}return e.SDK_NOT_READY="SDK_NOT_READY",e.EXCEPTION="EXCEPTION",e.INVALID_INPUT="INVALID_INPUT",e.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",e.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",e.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",e.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",e.OVERRIDDEN="OVERRIDDEN",e.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",e.VARIATION_DROPPED="VARIATION_DROPPED",e.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",e.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",e.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",e.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",e.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",e.TARGET_RULE_MATCH="TARGET_RULE_MATCH",e.DEFAULT_RULE="DEFAULT_RULE",e}(),Yt=function(){function e(e,t,r,n,o,i,u,a,s,c,f,l,p){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.status=o,this.version=i,this.variations=u,this.userOverrides=a,this.segmentOverrides=s,this.targetAudiences=c,this.targetRules=f,this.defaultRule=l,this._winnerVariationId=p}return e.prototype._winnerVariationOrNull=function(){if(this._winnerVariationId)return this._getVariationByIdOrNull(this._winnerVariationId)},e.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},e.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},e}(),zt=function(e,t,r){this.id=e,this.key=t,this.isDropped=r},qt=function(e,t,r){this.seed=e,this.slotSize=t,this.slots=r},Wt=function(){function e(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}return e.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive},e}(),Xt=function(e,t){this.id=e,this.key=t},Zt=function(){function e(){}return e.ID="$id",e.USER="$userId",e.DEVICE="$deviceId",e}(),G=function(){function e(){this.identifiers={}}return e.prototype.addIdentifiers=function(e){for(var t in e)this.add(t,e[t]);return this},e.prototype.add=function(e,t){return t&&this._isValid(e,t)?this.identifiers[e]=t:Kt.warn("Invalid user identifier [type=".concat(e,", value=").concat(t,"]")),this},e.prototype._isValid=function(e,t){return!(!e||"string"!=typeof e||128<e.length||!t||"string"!=typeof t||512<t.length)},e.prototype.build=function(){return this.identifiers},e}(),Qt=function(e){this.conditions=e},Jt=function(e,t){this.key=e,this.match=t},er=function(e,t){this.type=e,this.name=t},tr=function(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n},rr=function(e,t,r){this.type=e,this.variationId=t,this.bucketId=r},nr=function(e,t){this.target=e,this.action=t},or=function(e,t,r,n){this.id=e,this.key=t,this.type=r,this.targets=n},ir=function(){function i(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}return i.tryParse=function(e){var t,r,n,o,u=i.regExp.exec(e);if(u)return(e=function(e){var t="function"==typeof Symbol&&u[Symbol.iterator];if(!t)return u;var r,n,o=t.call(u),i=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)i.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(n)throw n.error}}return i}(6))[0],t=e[1],r=void 0===(r=e[2])?"0":r,n=void 0===(n=e[3])?"0":n,o=e[4],e=e[5],new i(new ur(parseInt(t,10),parseInt(r,10),parseInt(n,10)),ar.parse(o),ar.parse(e))},i.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},i.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},i.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},i.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},i.prototype.isLessThan=function(e){return this.compareTo(e)<0},i.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},i.regExp=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,i}(),ur=function(){function e(e,t,r){this.major=e,this.minor=t,this.patch=r}return e.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch},e}(),ar=function(){function o(e){this.identifiers=e}return o.parse=function(e){return e?new o(e.split(".")):o.EMPTY},o.prototype.isEmpty=function(){return 0===this.identifiers.length},o.prototype.isNotEmpty=function(){return!this.isEmpty()},o.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},o.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=o.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},o.compareIdentifiers=function(e,t){return o.numericIdentifierRegExp.test(e)&&o.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},o.EMPTY=new o([]),o.numericIdentifierRegExp=/^(0|[1-9]\d*)$/,o}(),sr=["MATCH","NOT_MATCH"],cr=["STRING","NUMBER","BOOLEAN","VERSION"],fr=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],lr=["VARIATION","BUCKET"],pr=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT"],hr=["USER_ID","USER_PROPERTY"],C=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.supportedKeyTypes=e}return e.prototype.supports=function(e){return this.supportedKeyTypes.includes(e)},e.IDENTIFIER=new e("SEGMENT"),e.PROPERTY=new e("SEGMENT","USER_PROPERTY","HACKLE_PROPERTY"),e.SEGMENT=new e("USER_ID","USER_PROPERTY","HACKLE_PROPERTY"),e}(),k=function(){function e(){}return e.validate=function(e){if(e){if("object"!=typeof e)return!1;for(var t in e)if(!this.validProperty(t,e[t]))return!1}return!0},e.filteredProperties=function(r){var n=this;return Object.keys(r).filter(function(e){return n.validProperty(e,r[e])}).reduce(function(e,t){return Bt(Bt({},e),((e={})[t]=n.filteredPropertiesValue(r[t]),e))},{})},e.filteredPropertiesValue=function(e){return"string"==typeof e&&1024<e.length?e.slice(0,1024):e},e.validProperty=function(e,t){return!!e&&"string"==typeof e&&!(128<e.length)&&("string"==typeof t||"boolean"==typeof t||"number"==typeof t&&!isNaN(t)&&isFinite(t))},e}(),S=function(){function e(e,t){this.timestamp=e,this.user=t}return e.exposure=function(e,t,r){return new yr((new Date).getTime(),t,e,r.variationId,r.variationKey,r.reason)},e.track=function(e,t,r){return new dr((new Date).getTime(),r,e,t)},e.isExposure=function(e){return void 0!==e.experiment},e.isTrack=function(e){return void 0!==e.eventType},e}(),yr=function(u){function e(e,t,r,n,o,i){e=u.call(this,e,t)||this;return e.experiment=r,e.variationId=n,e.variationKey=o,e.decisionReason=i,e}return nn(e,u),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.identifiers[Zt.ID],identifiers:this.user.identifiers,userProperties:k.filteredProperties(this.user.properties||{}),hackleProperties:k.filteredProperties(this.user.hackleProperties||{}),experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,experimentVersion:this.experiment.version,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString()}},e}(S),dr=function(o){function e(e,t,r,n){e=o.call(this,e,t)||this;return e.eventType=r,e.event=n,e}return nn(e,o),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.identifiers[Zt.ID],identifiers:this.user.identifiers,userProperties:k.filteredProperties(this.user.properties||{}),hackleProperties:k.filteredProperties(this.user.hackleProperties||{}),eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:k.filteredProperties(this.event.properties||{})}},e}(S),P=function(){function n(e,t,r){this.variationId=e,this.variationKey=t,this.reason=r}return n.withVariation=function(e,t){return new n(e.id,e.key,t)},n.withKey=function(e,t){return new n(void 0,e,t)},n.of=function(e,t,r){e=e._getVariationByKeyOrNull(t);return e?n.withVariation(e,r):n.withKey(t,r)},n}(),mr=function(){function e(e){this.evaluationFlowFactory=e}return e.prototype.evaluate=function(e,t,r,n){return this.evaluationFlowFactory.getFlow(t.type).evaluate(e,t,r,n)},e}(),vr=function(){function e(e){this.conditionMatcherFactory=e}return e.prototype.matches=function(e,t,r){var n=this;return e.conditions.every(function(e){return n._matches(e,t,r)})},e.prototype._matches=function(e,t,r){return this.conditionMatcherFactory.getMatcher(e.key.type).matches(e,t,r)},e}(),Er=function(){function e(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}return e.prototype.matches=function(t,e){var r=this.valueMatcherFactory.getMatcher(e.valueType),n=this.operatorMatcherFactory.getMatcher(e.operator),o=e.values.some(function(e){return r.matches(n,t,e)});return this._matches(e.type,o)},e.prototype._matches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}},e}(),Tr=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return e===t},e.prototype.numberMatches=function(e,t){return e===t},e.prototype.stringMatches=function(e,t){return e===t},e.prototype.versionMatches=function(e,t){return e.isEqualTo(t)},e}(),gr=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.includes(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),_r=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.startsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),br=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.endsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Rr=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThan(t)},e}(),wr=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<=e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThanOrEqualTo(t)},e}(),Or=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThan(t)},e}(),Nr=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<=t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThanOrEqualTo(t)},e}(),Ar=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"IN":return t.IN_MATCHER;case"CONTAINS":return t.CONTAINS_MATCHER;case"STARTS_WITH":return t.STARTS_WITH_MATCHER;case"ENDS_WITH":return t.ENDS_WITH_MATCHER;case"GT":return t.GT_MATCHER;case"GTE":return t.GTE_MATCHER;case"LT":return t.LT_MATCHER;case"LTE":return t.LTE_MATCHER}},t.IN_MATCHER=new Tr,t.CONTAINS_MATCHER=new gr,t.STARTS_WITH_MATCHER=new _r,t.ENDS_WITH_MATCHER=new br,t.GT_MATCHER=new Rr,t.GTE_MATCHER=new wr,t.LT_MATCHER=new Or,t.LTE_MATCHER=new Nr,t}(),Ir=function(){function e(){}return e.prototype.matches=function(e,t,r){return"string"==typeof t&&"string"==typeof r&&e.stringMatches(t,r)},e}(),Cr=function(){function e(){}return e.prototype.matches=function(e,t,r){return"number"==typeof t&&"number"==typeof r&&e.numberMatches(t,r)},e}(),kr=function(){function e(){}return e.prototype.matches=function(e,t,r){return"boolean"==typeof t&&"boolean"==typeof r&&e.booleanMatches(t,r)},e}(),Sr=function(){function e(){}return e.prototype.matches=function(e,t,r){t=ir.tryParse(t),r=ir.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)},e}(),Pr=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"STRING":return t.STRING_MATCHER;case"NUMBER":return t.NUMBER_MATCHER;case"BOOLEAN":return t.BOOLEAN_MATCHER;case"VERSION":return t.VERSION_MATCHER}},t.STRING_MATCHER=new Ir,t.NUMBER_MATCHER=new Cr,t.BOOLEAN_MATCHER=new kr,t.VERSION_MATCHER=new Sr,t}(),xr=function(){function e(e,t){this.userValueResolver=e,this.valueOperatorMatcher=t}return e.prototype.matches=function(e,t,r){r=this.userValueResolver.resolveOrNull(r,e.key);return!!r&&this.valueOperatorMatcher.matches(r,e.match)},e}(),Mr=function(){function e(){}return e.prototype.resolveOrNull=function(e,t){switch(t.type){case"USER_ID":return e.identifiers[t.name];case"USER_PROPERTY":return e.properties[t.name];case"HACKLE_PROPERTY":return e.hackleProperties[t.name];case"SEGMENT":throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}},e}(),Dr=function(){function e(e){this.segmentMatcher=e}return e.prototype.matches=function(e,t,r){var n=this;if("SEGMENT"!=e.key.type)throw new Error("Unsupported TargetKeyType [".concat(e.key.type,"]"));var o=e.match.values.some(function(e){return n._matches(e,t,r)});switch(e.match.type){case"MATCH":return o;case"NOT_MATCH":return!o}},e.prototype._matches=function(e,t,r){if("string"!=typeof e)throw new Error("SegmentKey[".concat(e,"]"));var n=t.getSegmentOrNull(e);if(n)return this.segmentMatcher.matches(n,t,r);throw new Error("Segment[".concat(e,"]"))},e}(),Fr=function(){function e(e){this.userConditionMatcher=e}return e.prototype.matches=function(e,t,r){var n=this;return e.targets.some(function(e){return n._matches(e,t,r)})},e.prototype._matches=function(e,t,r){var n=this;return e.conditions.every(function(e){return n.userConditionMatcher.matches(e,t,r)})},e}(),Ur=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":return t.USER_CONDITION_MATCHER;case"SEGMENT":return t.SEGMENT_CONDITION_MATCHER}},t.USER_CONDITION_MATCHER=new xr(new Mr,new Er(new Pr,new Ar)),t.SEGMENT_CONDITION_MATCHER=new Dr(new Fr(t.USER_CONDITION_MATCHER)),t}(),jr=function(){function e(e){this.bucketer=e}return e.prototype.resolveOrNull=function(e,t,r,n){switch(e.type){case"VARIATION":return this._resolveVariation(e,r);case"BUCKET":return this._resolveBucket(e,t,r,n)}},e.prototype._resolveVariation=function(e,t){return t._getVariationByIdOrNull(e.variationId)},e.prototype._resolveBucket=function(e,t,r,n){t=t.getBucketOrNull(e.bucketId),e=n.identifiers[r.identifierType];if(e){n=this.bucketer.bucketing(t,e);if(n)return r._getVariationByIdOrNull(n.variationId)}},e}(),Lr={murmurhash3_x86_32:function(e,t,r,n){for(var o,i=3432918353,u=461845907,a=-4&(n=void 0===n?e.length:n),s=t,c=0;c<a;c+=4)o=255&e.charCodeAt(c)|(255&e.charCodeAt(c+1))<<8|(255&e.charCodeAt(c+2))<<16|(255&e.charCodeAt(c+3))<<24,o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s=5*((524287&(s^=o=this.mul32(o,u)))<<13|s>>>19)+3864292196|0;switch(o=0,n%4){case 3:o=(255&e.charCodeAt(2+a))<<16;case 2:o|=(255&e.charCodeAt(1+a))<<8;case 1:o|=255&e.charCodeAt(a),o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s^=o=this.mul32(o,u)}return s=this.mul32(s=(s^=n)^s>>>16,2246822507),(s=this.mul32(s^=s>>>13,3266489909))^s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},Vr=function(){function e(){}return e.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t);return e.slots.find(function(e){return e.contains(r)})},e.prototype.calculateSlotNumber=function(e,t,r){r=Lr.murmurhash3_x86_32(r,e);return Math.abs(r)%Math.abs(t)},e}(),Hr=function(){function a(e,t){void 0===t&&(t=void 0),this.flowEvaluator=e=void 0===e?void 0:e,this.nextFlow=t}return a.prototype.evaluate=function(e,t,r,n){return this.flowEvaluator&&this.nextFlow?this.flowEvaluator.evaluate(e,t,r,n,this.nextFlow):P.of(t,n,I.TRAFFIC_NOT_ALLOCATED)},a.of=function(){for(var t,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=new a;try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(r.reverse()),u=i.next();!u.done;u=i.next())o=new a(u.value,o)}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return o},a}(),$r=function(){function e(e){this.overrideResolver=e}return e.prototype.evaluate=function(e,t,r,n,o){var i=this.overrideResolver.resolveOrNull(e,t,r);if(!i)return o.evaluate(e,t,r,n);switch(t.type){case"AB_TEST":return P.withVariation(i,I.OVERRIDDEN);case"FEATURE_FLAG":return P.withVariation(i,I.INDIVIDUAL_TARGET_MATCH)}},e}(),Gr=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o){return"DRAFT"===t.status?P.of(t,n,I.EXPERIMENT_DRAFT):o.evaluate(e,t,r,n)},e}(),Br=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o){if("PAUSED"!==t.status)return o.evaluate(e,t,r,n);switch(t.type){case"AB_TEST":return P.of(t,n,I.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return P.of(t,n,I.FEATURE_FLAG_INACTIVE)}},e}(),Kr=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o){if("COMPLETED"!==t.status)return o.evaluate(e,t,r,n);o=t._winnerVariationOrNull();if(o)return P.withVariation(o,I.EXPERIMENT_COMPLETED);throw new Error("winner variation [".concat(t.id,"]"))},e}(),Yr=function(){function e(e){this.experimentTargetDeterminer=e}return e.prototype.evaluate=function(e,t,r,n,o){if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t,r)?o.evaluate(e,t,r,n):P.of(t,n,I.NOT_IN_EXPERIMENT_TARGET)},e}(),zr=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));e=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);return e?e.isDropped?P.of(t,n,I.VARIATION_DROPPED):P.withVariation(e,I.TRAFFIC_ALLOCATED):P.of(t,n,I.TRAFFIC_NOT_ALLOCATED)},e}(),qr=function(){function e(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}return e.prototype.evaluate=function(e,t,r,n,o){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));var i=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t,r);if(!i)return o.evaluate(e,t,r,n);o=this.actionResolver.resolveOrNull(i.action,e,t,r);if(o)return P.withVariation(o,I.TARGET_RULE_MATCH);throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"))},e}(),Wr=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));e=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);if(e)return P.withVariation(e,I.DEFAULT_RULE);throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"))},e}(),Xr=function(){function e(e){this.targetMatcher=e}return e.prototype.isUserInExperimentTarget=function(t,e,r){var n=this;return 0===e.targetAudiences.length||e.targetAudiences.some(function(e){return n.targetMatcher.matches(e,t,r)})},e}(),Zr=function(){function e(e){this.targetMatcher=e}return e.prototype.determineTargetRuleOrNull=function(t,e,r){var n=this;return e.targetRules.find(function(e){return n.targetMatcher.matches(e.target,t,r)})},e}(),Qr=function(){function e(e,t){this.targetMatcher=e,this.actionResolver=t}return e.prototype.resolveOrNull=function(e,t,r){return this._resolveUserOverride(t,r)||this._resolveSegmentOverride(e,t,r)},e.prototype._resolveUserOverride=function(e,t){t=t.identifiers[e.identifierType];if(t){t=e.userOverrides.get(t);if(t)return e._getVariationByIdOrNull(t)}},e.prototype._resolveSegmentOverride=function(t,e,r){var n=this,o=e.segmentOverrides.find(function(e){return n.targetMatcher.matches(e.target,t,r)});if(o)return this.actionResolver.resolveOrNull(o.action,t,e,r)},e}(),Jr=function(){function e(){var e=new vr(new Ur),t=new jr(new Vr),r=new Qr(e,t);this.abTestFlow=Hr.of(new $r(r),new Yr(new Xr(e)),new Gr,new Br,new Kr,new zr(t)),this.featureFlagFlow=Hr.of(new Gr,new Br,new Kr,new $r(r),new qr(new Zr(e),t),new Wr(t))}return e.prototype.getFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},e}(),x=u.log,Ft=function(){function e(e,t,r){this.evaluator=new mr(new Jr),this.workspaceFetcher=e,this.eventProcessor=t,this.eventEmitter=r,this.workspaceFetcher.start(),this.eventProcessor.start(),this.readyPromise=this.workspaceFetcher.onReady().then(function(){return{success:!0}},function(){return{success:!1}})}return e.prototype._experiment=function(e,t,r){if(!e)return x.error("experimentKey must not be empty"),N.of(r,I.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return x.warn("SDK not ready."),N.of(r,I.SDK_NOT_READY);e=n.getExperimentOrNull(e);if(!e)return x.warn("Experiment does not exist."),N.of(r,I.EXPERIMENT_NOT_FOUND);n=this.evaluator.evaluate(n,e,t,r);return this.eventProcessor.process(S.exposure(e,t,n)),N.of(n.variationKey,n.reason)},e.prototype._featureFlag=function(e,t){if(!e)return x.error("featureKey must not be empty"),A.off(I.INVALID_INPUT);var r=this.workspaceFetcher.get();if(!r)return x.warn("SDK not ready."),A.off(I.SDK_NOT_READY);e=r.getFeatureFlagOrNull(e);if(!e)return x.warn("FeatureFlag does not exist."),A.off(I.FEATURE_FLAG_NOT_FOUND);r=this.evaluator.evaluate(r,e,t,"A");return this.eventProcessor.process(S.exposure(e,t,r)),"A"===r.variationKey?A.off(r.reason):A.on(r.reason)},e.prototype._track=function(e,t){var r;e?"object"==typeof e?"object"!=typeof e||e.key&&"string"==typeof e.key?(r=(null==(r=this.workspaceFetcher.get())?void 0:r.getEventTypeOrNull(e.key))||new Xt(0,e.key),this.eventProcessor.process(S.track(r,e,t))):x.warn("Event key must be not null. or event key must be string type."):x.warn("Event must be event type."):x.warn("event must not be null.")},e.prototype._onReady=function(e,t){this._onInitialized({timeout:t=void 0===t?3e3:t}).then(function(){return e()})},e.prototype._onInitialized=function(e){var t,e=e.timeout,e=void 0===e?3e3:e,r=(x.debug("Start HackleClient initializing"),new Promise(function(e){t=e})),n=setTimeout(function(){t({success:!1})},e);return this.readyPromise.then(function(){clearTimeout(n),t({success:!0})}),Promise.race([this.readyPromise,r]).then(function(e){return x.debug("HackleClient onInitialized"),Promise.resolve({success:e.success})})},e.prototype._close=function(){this.workspaceFetcher.close(),this.eventProcessor.close()},e}(),en=function(){function e(e){var t=e.timeout,e=e.callback;this.timeout=Math.max(t,0),this.callback=e}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),tn=function(){function e(e,t,r,n){void 0===r&&(r=1e3),void 0===n&&(n=1e4),this.buffer=[],this.sink=e,this.maxQueueSize=r,this.batchComparator=t,this.timer=new en({callback:this.flush.bind(this),timeout:n}),this.started=!1}return e.prototype.start=function(){this.started=!0},e.prototype.stop=function(){this.started=!1;var e=this.sink(this.buffer,!0);return this.buffer=[],this.timer.stop(),e},e.prototype.enqueue=function(e){this.started&&(0===this.buffer.length&&this.timer.refresh(),this.buffer.push(e),this.buffer.length>=this.maxQueueSize&&this.flush())},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e.prototype.close=function(){this.stop()},e}(),Ut=function(){function n(e,t,r){void 0===t&&(t=1e3),void 0===r&&(r=n.DEFAULT_FLUSH_INTERVAL),this.flushInterval=n.DEFAULT_FLUSH_INTERVAL,this.eventDispatcher=e,this.flushInterval=r,this.queue=new tn(this.drainQueue.bind(this),on,t,r)}return n.prototype.drainQueue=function(t,r){var n=this;return new Promise(function(e){0!==t.length?r?n.eventDispatcher.dispatchXhrOrBeacon(t,function(){e()}):n.eventDispatcher.dispatch(t,function(){e()}):e()})},n.prototype.process=function(e){this.queue.enqueue(e)},n.prototype.start=function(){return e=this,s=function(){return n=this,o=function(e){return this.queue.start(),[2]},s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!((a=0<(a=s.trys).length&&a[a.length-1])||6!==t[0]&&2!==t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}var n,o,i,u,a,t,s},new(a=(a=u=void 0)||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())});var e,u,a,s},n.prototype.stop=function(){try{this.queue.close()}catch(e){}return Promise.resolve()},n.prototype.close=function(){this.stop()},n.DEFAULT_FLUSH_INTERVAL=1e4,n}(),rn=u.log,jt=function(){function f(e,t,r,n,o){this.experiments=e,this.featureFlags=t,this.buckets=r,this.eventTypes=n,this.segments=o}return f.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},f.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},f.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},f.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)},f.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},f.from=function(e){var t=this,r=f.associate(e.buckets,function(e){return[e.id,t.toBucket(e)]}),n=f.associateBy(f.mapNotUndefined(e.experiments,function(e){return t.toExperimentOrNull("AB_TEST",e)}),function(e){return e.key}),o=f.associateBy(f.mapNotUndefined(e.featureFlags,function(e){return t.toExperimentOrNull("FEATURE_FLAG",e)}),function(e){return e.key}),i=f.associate(e.events,function(e){return[e.key,new Xt(e.id,e.key)]}),e=f.associateBy(f.mapNotUndefined(e.segments,function(e){return t.toSegmentOrNull(e)}),function(e){return e.key});return new f(n,o,r,i,e)},f.toBucket=function(e){return new qt(e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new Wt(t,r,e)}))},f.toExperimentOrNull=function(e,t){var r=this,n=this.experimentStatusOrNull(t.execution.status),o=t.variations.map(function(e){return new zt(e.id,e.key,"DROPPED"===e.status)}),i=f.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),u=f.mapNotUndefined(t.execution.segmentOverrides,function(e){return r.toTargetRuleOrNull(e,C.IDENTIFIER)}),a=f.mapNotUndefined(t.execution.targetAudiences,function(e){return r.toTargetOrNull(e,C.PROPERTY)}),s=f.mapNotUndefined(t.execution.targetRules,function(e){return r.toTargetRuleOrNull(e,C.PROPERTY)}),c=this.toTargetActionOrNull(t.execution.defaultRule);return n&&c&&new Yt(t.id,t.key,e,t.identifierType,n,t.version,o,i,u,a,s,c,t.winnerVariationId)},f.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void rn.debug("Unsupported status [".concat(e,"]"))}},f.toTargetRuleOrNull=function(e,t){t=this.toTargetOrNull(e.target,t),e=this.toTargetActionOrNull(e.action);return t&&e&&new nr(t,e)},f.toTargetActionOrNull=function(e){var t=this.parseOrNull(lr,e.type);return t&&new rr(t,e.variationId,e.bucketId)},f.toTargetOrNull=function(e,t){var r=this,e=f.mapNotUndefined(e.conditions,function(e){return r.toConditionOrNull(e,t)});return new Qt(e)},f.toConditionOrNull=function(e,t){var r=this.toTargetKeyOrNull(e.key);if(r&&t.supports(r.type))return(t=this.toTargetMatchOrNull(e.match))&&new Jt(r,t)},f.toTargetKeyOrNull=function(e){var t=this.parseOrNull(pr,e.type);return t&&new er(t,e.name)},f.toTargetMatchOrNull=function(e){var t=this.parseOrNull(sr,e.type),r=this.parseOrNull(fr,e.operator),n=this.parseOrNull(cr,e.valueType);return t&&r&&n&&new tr(t,r,n,e.values)},f.toSegmentOrNull=function(e){var t=this,r=this.parseOrNull(hr,e.type);return r&&new or(e.id,e.key,r,this.mapNotUndefined(e.targets,function(e){return t.toTargetOrNull(e,C.SEGMENT)}))},f.parseOrNull=function(e,t){e=e.find(function(e){return e===t});return e||rn.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e},f.mapNotUndefined=function(e,r){return e.reduce(function(e,t){t=r(t);return t&&e.push(t),e},Array())},f.associateTo=function(e,t,r){return e.reduce(function(e,t){t=r(t);return e.set(t[0],t[1]),e},t)},f.associate=function(e,t){return f.associateTo(e,new Map,t)},f.associateBy=function(e,t){return this.associateTo(e,new Map,function(e){return[t(e),e]})},f}(),n.Bucket=qt,n.CoreVersion=ur,n.DEFAULT_ON_READY_TIMEOUT=3e3,n.Decision=N,n.DecisionReason=I,n.DefaultEventQueue=tn,n.Event=S,n.EventProcessor=Ut,n.EventType=Xt,n.Experiment=Yt,n.Exposure=yr,n.FeatureFlagDecision=A,n.HackleInternalClient=Ft,n.IdentifierType=Zt,n.IdentifiersBuilder=G,n.Logger=u,n.MATCH_OPERATORS=fr,n.MATCH_TYPES=sr,n.MATCH_VALUE_TYPES=cr,n.MetaVersion=ar,n.SEGMENT_TYPES=hr,n.Segment=or,n.Slot=Wt,n.TARGET_ACTION_TYPES=lr,n.TARGET_KEY_TYPES=pr,n.Target=Qt,n.TargetAction=rr,n.TargetCondition=Jt,n.TargetKey=er,n.TargetMatch=tr,n.TargetRule=nr,n.TargetingType=C,n.Track=dr,n.Variation=zt,n.Version=ir,n.Workspace=jt,n.logLevels=O,n.toPayload=function(e){var t=new Array,r=new Array;return e.forEach(function(e){S.isExposure(e)?t.push(e.toDto()):S.isTrack(e)&&r.push(e.toDto())}),{exposureEvents:t,trackEvents:r}},Object.defineProperty(n,"__esModule",{value:!0});var D=M.exports.Logger.log;function un(e,t){void 0===t&&(t="A");var r=l.exports.useContext(w),n=r.hackle,o=r.user,i=l.exports.useCallback(function(){return(null==n?void 0:n.variation(e,o))||t},[t,e,o,n]),r=f(l.exports.useState(function(){return n?i():("undefined"!=typeof window&&D.error("HackleClient is not existed"),t)}),2),u=r[0],r=r[1],a={key:e,user:o},s=f(l.exports.useState(a),2),c=s[0],s=s[1];return an(c,a)||(s(a),r(i())),u}function an(e,t){var r,n,o;return e.key===t.key&&(null==(r=e.user)?void 0:r.id)===(null==(r=t.user)?void 0:r.id)&&(e=null==(r=e.user)?void 0:r.properties,t=null==(r=t.user)?void 0:r.properties,n=sn(e),o=sn(t),e=Object.keys(n),t=Object.keys(o),e.length===t.length&&e.every(function(e){return e in o&&n[e]===o[e]}))}function sn(e){return"object"==typeof e&&null!==e?e:{}}function cn(e){var t,r=e.experimentKey,e=e.children,n=un(r);return e&&"function"==typeof e?e(n):(l.exports.Children.forEach(e,function(e){l.exports.isValidElement(e)&&(e.props.variation?n===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?l.exports.cloneElement(t,{variation:n}):null)}function fn(e){return e.variation,e=e.children,l.exports.createElement(l.exports.Fragment,null,e)}t.HackleContext=w,t.HackleContextConsumer=W,t.HackleContextProvider=$t,t.HackleExperiment=cn,t.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=void 0===(n=e.timeout)?3e3:n,e=e.children,o={hackle:t,user:r},i=f(l.exports.useState(!1),2),u=i[0],a=i[1],o=(i=f(l.exports.useState(o),2))[0],s=i[1];return l.exports.useEffect(function(){s(function(e){return c(c({},e),{user:r})})},[r]),t.onInitialized({timeout:n}).then(function(){a(!0)}),u?Ht.createElement($t,{value:o},e):null},t.HackleVariation=fn,t.createInstance=function(e,t){return new L(e,t)},t.useFeature=function(e){var t=(i=l.exports.useContext(w)).hackle,r=i.user,n=l.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e,r))||!1},[e,r,t]),o=(i=f(l.exports.useState(function(){return t?n():("undefined"!=typeof window&&D.error("HackleClient is not existed"),!1)}),2))[0],i=i[1],u={key:e,user:r},a=(s=f(l.exports.useState(u),2))[0],s=s[1];return an(a,u)||(s(u),i(n())),o},t.useFeatureFlagDetail=function(e){var t=(i=l.exports.useContext(w)).hackle,r=i.user,n=l.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e,r))||M.exports.FeatureFlagDecision.off(M.exports.DecisionReason.EXCEPTION)},[e,r,t]),o=(i=f(l.exports.useState(function(){return t?n():("undefined"!=typeof window&&D.error("HackleClient is not existed"),M.exports.FeatureFlagDecision.off(M.exports.DecisionReason.EXCEPTION))}),2))[0],i=i[1],u={key:e,user:r},a=(s=f(l.exports.useState(u),2))[0],s=s[1];return an(a,u)||(s(u),i(n())),o},t.useTrack=function(){var e=l.exports.useContext(w),t=e.hackle,r=e.user;return t?function(e){return null==t?void 0:t.track(e,r)}:("undefined"!=typeof window&&D.error("HackleClient is not existed"),function(){})},t.useVariation=un,t.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(u=l.exports.useContext(w)).hackle,n=u.user,o=l.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e,n))||M.exports.Decision.of(t,M.exports.DecisionReason.EXCEPTION)},[t,e,n,r]),i=(u=f(l.exports.useState(function(){return r?o():("undefined"!=typeof window&&D.error("HackleClient is not existed"),M.exports.Decision.of(t,M.exports.DecisionReason.EXCEPTION))}),2))[0],u=u[1],a={key:e,user:n},s=(c=f(l.exports.useState(a),2))[0],c=c[1];return an(s,a)||(c(a),u(o())),i},Object.keys(F).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return F[e]}})}),Object.defineProperty(t,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackler/react-sdk",
3
- "version": "3.3.3",
3
+ "version": "3.4.0",
4
4
  "description": "React SDK for Hackle",
5
5
  "author": {
6
6
  "name": "Hackle",
@@ -39,8 +39,8 @@
39
39
  "url": "https://github.com/hackle-io/hackle-javascript-sdk/issues"
40
40
  },
41
41
  "dependencies": {
42
- "@hackler/sdk-core": "3.3.3",
43
- "@hackler/js-client-sdk": "3.3.3"
42
+ "@hackler/sdk-core": "3.4.0",
43
+ "@hackler/js-client-sdk": "3.4.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=16.8.0"