@hackler/react-sdk 11.52.0 → 11.54.0-canary.26
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/client.d.ts +2 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/index.es.js +5 -1
- package/lib/index.js +5 -1
- package/lib/index.umd.js +1 -1
- package/package.json +2 -2
package/lib/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={})}(this,function(n){"use strict";var D,L=new Uint8Array(16);var F=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var V=[],j=0;j<256;++j)V.push((j+256).toString(16).substr(1));function B(e,t){var t=1<arguments.length&&void 0!==t?t:0,e=(V[e[t+0]]+V[e[t+1]]+V[e[t+2]]+V[e[t+3]]+"-"+V[e[t+4]]+V[e[t+5]]+"-"+V[e[t+6]]+V[e[t+7]]+"-"+V[e[t+8]]+V[e[t+9]]+"-"+V[e[t+10]]+V[e[t+11]]+V[e[t+12]]+V[e[t+13]]+V[e[t+14]]+V[e[t+15]]).toLowerCase();if("string"==typeof(t=e)&&F.test(t))return e;throw TypeError("Stringified UUID is invalid")}function K(e,t,r){var n=(e=e||{}).random||(e.rng||function(){if(D=D||"undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto))return D(L);throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return B(n)}var e="3.7.5",t="function"==typeof atob,r="function"==typeof btoa,G="function"==typeof Buffer;const H="function"==typeof TextDecoder?new TextDecoder:void 0,z="function"==typeof TextEncoder?new TextEncoder:void 0;const Y=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),J=(e=>{let r={};return e.forEach((e,t)=>r[e]=t),r})(Y),q=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,W=String.fromCharCode.bind(String),$="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),X=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),Z=e=>e.replace(/[^A-Za-z0-9\+\/]/g,"");var Q=t=>{let r,n,i,o,s="";var e=t.length%3;for(let e=0;e<t.length;){if(255<(n=t.charCodeAt(e++))||255<(i=t.charCodeAt(e++))||255<(o=t.charCodeAt(e++)))throw new TypeError("invalid character found");r=n<<16|i<<8|o,s+=Y[r>>18&63]+Y[r>>12&63]+Y[r>>6&63]+Y[63&r]}return e?s.slice(0,e-3)+"===".substring(e):s};const ee=r?e=>btoa(e):G?e=>Buffer.from(e,"binary").toString("base64"):Q,te=G?e=>Buffer.from(e).toString("base64"):r=>{let n=[];for(let e=0,t=r.length;e<t;e+=4096)n.push(W.apply(null,r.subarray(e,e+4096)));return ee(n.join(""))},re=(e,t=!1)=>t?X(te(e)):te(e),ne=e=>{var t;return e.length<2?(t=e.charCodeAt(0))<128?e:t<2048?W(192|t>>>6)+W(128|63&t):W(224|t>>>12&15)+W(128|t>>>6&63)+W(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),W(240|t>>>18&7)+W(128|t>>>12&63)+W(128|t>>>6&63)+W(128|63&t))},ie=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,oe=e=>e.replace(ie,ne),se=G?e=>Buffer.from(e,"utf8").toString("base64"):z?e=>te(z.encode(e)):e=>ee(oe(e)),ae=(e,t=!1)=>t?X(se(e)):se(e);r=e=>ae(e,!0);const ue=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ce=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return W(55296+(t>>>10))+W(56320+(1023&t));case 3:return W((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return W((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},pe=e=>e.replace(ue,ce);var i=t=>{if(t=t.replace(/\s+/g,""),!q.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let r,n="",i,o;for(let e=0;e<t.length;)r=J[t.charAt(e++)]<<18|J[t.charAt(e++)]<<12|(i=J[t.charAt(e++)])<<6|(o=J[t.charAt(e++)]),n+=64===i?W(r>>16&255):64===o?W(r>>16&255,r>>8&255):W(r>>16&255,r>>8&255,255&r);return n};const le=t?e=>atob(Z(e)):G?e=>Buffer.from(e,"base64").toString("binary"):i,fe=G?e=>$(Buffer.from(e,"base64")):e=>$(le(e).split("").map(e=>e.charCodeAt(0))),he=e=>fe(ye(e)),de=G?e=>Buffer.from(e,"base64").toString("utf8"):H?e=>H.decode(fe(e)):e=>pe(le(e)),ye=e=>Z(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),ve=e=>de(ye(e));function ge(){var e=(e,t)=>Object.defineProperty(String.prototype,e,Ee(t));e("fromBase64",function(){return ve(this)}),e("toBase64",function(e){return ae(this,e)}),e("toBase64URI",function(){return ae(this,!0)}),e("toBase64URL",function(){return ae(this,!0)}),e("toUint8Array",function(){return he(this)})}function me(){var e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Ee(t));e("toBase64",function(e){return re(this,e)}),e("toBase64URI",function(){return re(this,!0)}),e("toBase64URL",function(){return re(this,!0)})}const Ee=e=>({value:e,enumerable:!1,writable:!0,configurable:!0});const we={version:e,VERSION:"3.7.5",atob:le,atobPolyfill:i,btoa:ee,btoaPolyfill:Q,fromBase64:ve,toBase64:ae,encode:ae,encodeURI:r,encodeURL:r,utob:oe,btou:pe,decode:ve,isValid:e=>{if("string"!=typeof e)return!1;e=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:re,toUint8Array:he,extendString:ge,extendUint8Array:me,extendBuiltins:()=>{ge(),me()}};var be=function(e,t){return(be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function o(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}be(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,s,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}o((u=u.apply(e,s||[])).next())})}function u(n,i){var o,s,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(n,u)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function Te(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||((n=n||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}_e.isNotNullOrUndefined=function(e){return null!=e},_e.isNullOrUndefined=function(e){return null==e},_e.requiredNotNullOrUndefined=function(e,t){if(void 0===t&&(t=function(){return"Required value is null or undefined"}),this.isNullOrUndefined(e))throw new Error(t());return e},_e.fromMap=function(e){var r={};return e.forEach(function(e,t){r[t]=e}),r};var p=_e;function _e(){}Ie.mapNotNullOrUndefined=function(e,t){for(var r=Array(),n=0,i=e;n<i.length;n++){var o=t(i[n]);p.isNotNullOrUndefined(o)&&r.push(o)}return r},Ie.mapOrUndefined=function(e,t){for(var r=Array(),n=0,i=e;n<i.length;n++){var o=t(i[n]);if(p.isNullOrUndefined(o))return;r.push(o)}return r},Ie.associateTo=function(e,t,r){for(var n=0,i=e;n<i.length;n++){var o=r(i[n]);t.set(o[0],o[1])}return t},Ie.associate=function(e,t){return this.associateTo(e,new Map,t)},Ie.associateBy=function(e,t){return this.associate(e,function(e){return[t(e),e]})},Ie.associateRecord=function(e,t){for(var r={},n=0,i=e;n<i.length;n++){var o=t(i[n]),s=o[0],o=o[1];r[s]=o}return r},Ie.chunked=function(e,t){for(var r=[],n=e.slice();n.length;)r.push(n.splice(0,t));return r},Ie.sum=function(e,r){return e.reduce(function(e,t){return e+r(t)},0)};var f=Ie;function Ie(){}var Ae={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},l=(Ne.setLogLevel=function(e){this.logLevel=e=void 0===e?Ae.INFO:e},Ne.initCounter=function(t){this.counters=f.associate(Object.keys(Ae),function(e){return[e,t(e)]})},Ne._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}if(t instanceof Error)Oe.log(e,r,t.message,t);else try{Oe.log(e,r,t)}catch(e){}},Ne.increment=function(e){var t;null!=(t=null==(t=Ne.counters)?void 0:t.get(e))&&t.increment()},Ne.logLevel=Ae.INFO,Ne.log={error:function(e){Ae.ERROR<=Ne.logLevel&&(Ne._log("ERROR",e),Ne.increment("ERROR"))},warn:function(e){Ae.WARN<=Ne.logLevel&&(Ne._log("WARN",e),Ne.increment("WARN"))},info:function(e){Ae.INFO<=Ne.logLevel&&(Ne._log("INFO",e),Ne.increment("INFO"))},debug:function(e){Ae.DEBUG<=Ne.logLevel&&(Ne._log("DEBUG",e),Ne.increment("DEBUG"))}},Ne);function Ne(){}Pe.log=function(e,t,r,n){try{console.log("%c[".concat(e,"] Hackle: ").concat(r),"color: ".concat(t))}catch(e){}};var Oe=Pe;function Pe(){}var Se=l.log,Me=(Re.isEqual=function(e,t){return e.type===t.type&&e.value===t.value},Re.isEquals=function(t,r){if(null==r)return!1;var e=Object.keys(t);return e.length===Object.keys(r).length&&e.every(function(e){return t[e]===r[e]})},Re.sanitize=function(e){var t={};if(p.isNullOrUndefined(e))return t;for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],o=i[0],i=i[1];this.isValidType(o)?(i=this.sanitizeValue(i),p.isNullOrUndefined(i)?Se.debug("Invalid identifier value. The identifier type value be a string of 512 characters or less. [".concat(o,"]")):t[o]=i):Se.debug("Invalid identifier type. The identifier type must be a string of 128 characters or less. [".concat(o,"]"))}return t},Re.isValidType=function(e){return!p.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length&&e.length<=this.MAX_IDENTIFIER_TYPE_LENGTH)},Re.sanitizeValue=function(e){return"string"==typeof e&&0<e.length&&e.length<=this.MAX_IDENTIFIER_VALUE_LENGTH?e:"number"==typeof e?e.toString():null},Re.MAX_IDENTIFIER_TYPE_LENGTH=128,Re.MAX_IDENTIFIER_VALUE_LENGTH=512,Re);function Re(){}var Ce=l.log,xe=(Ue.sanitize=function(e){var t={};if(p.isNullOrUndefined(e))return t;for(var r=0,n=Object.entries(e);r<n.length;r++){var i,o=n[r],s=o[0],o=o[1];if(Object.keys(t).length>=this.MAX_PROPERTIES_COUNT){Ce.debug("The number of properties cannot exceed 128. Drops excess properties. [".concat(s,", ").concat(o,"]"));break}this.isValidKey(s)?(i=this.sanitizeValue(s,o),p.isNullOrUndefined(i)?Ce.debug("Invalid property value. The property value mus be 'string(..1024)', 'number', 'boolean', or 'array' type. [".concat(o,"]")):t[s]=i):Ce.debug("Invalid property key. The property key must be a string of 128 characters or less. [".concat(s,"]"))}return t},Ue.isValidProperty=function(e,t){return this.isValidKey(e)&&this.isValidValue(t)},Ue.isValidKey=function(e){return p.isNotNullOrUndefined(e)&&"string"==typeof e&&0<e.length&&e.length<=this.MAX_PROPERTY_KEY_LENGTH},Ue.sanitizeValue=function(e,t){var r=this;return"string"==typeof e&&e.startsWith(this.SYSTEM_PROPERTY_KEY_PREFIX)?t:this.isValidValue(t)?Array.isArray(t)?t.filter(function(e){return r.isValidElement(e)}):t:null},Ue.isValidValue=function(e){return!p.isNullOrUndefined(e)&&("string"==typeof e?e.length<=this.MAX_PROPERTY_VALUE_LENGTH:"number"==typeof e?!isNaN(e)&&isFinite(e):"boolean"==typeof e||Array.isArray(e))},Ue.isValidElement=function(e){return!p.isNullOrUndefined(e)&&("string"==typeof e?0<e.length&&e.length<=this.MAX_PROPERTY_VALUE_LENGTH:"number"==typeof e)},Ue.truncateStringValue=function(e){return"string"==typeof e&&e.length>this.MAX_PROPERTY_VALUE_LENGTH?e.slice(0,this.MAX_PROPERTY_VALUE_LENGTH):e},Ue.SYSTEM_PROPERTY_KEY_PREFIX="$",Ue.MAX_PROPERTIES_COUNT=128,Ue.MAX_PROPERTY_KEY_LENGTH=128,Ue.MAX_PROPERTY_VALUE_LENGTH=1024,Ue);function Ue(){}var ke=["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"],De=["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"],Le=(s.nanosToUnit=function(e,t){switch(t){case"nanoseconds":return e;case"microseconds":return e/(s.C1/s.C0);case"milliseconds":return e/(s.C2/s.C0);case"seconds":return e/(s.C3/s.C0);case"minutes":return e/(s.C4/s.C0);case"hours":return e/(s.C5/s.C0);case"days":return e/(s.C6/s.C0)}},s.microsToUnit=function(e,t){switch(t){case"nanoseconds":return e*(s.C1/s.C0);case"milliseconds":return e/(s.C2/s.C1);case"microseconds":return e;case"seconds":return e/(s.C3/s.C1);case"minutes":return e/(s.C4/s.C1);case"hours":return e/(s.C5/s.C1);case"days":return e/(s.C6/s.C1)}},s.millisToUnit=function(e,t){switch(t){case"nanoseconds":return e*(s.C2/s.C0);case"microseconds":return e*(s.C2/s.C1);case"milliseconds":return e;case"seconds":return e/(s.C3/s.C2);case"minutes":return e/(s.C4/s.C2);case"hours":return e/(s.C5/s.C2);case"days":return e/(s.C6/s.C2)}},s.secondsToUnit=function(e,t){switch(t){case"nanoseconds":return e*(s.C3/s.C0);case"microseconds":return e*(s.C3/s.C1);case"milliseconds":return e*(s.C3/s.C2);case"seconds":return e;case"minutes":return e/(s.C4/s.C3);case"hours":return e/(s.C5/s.C3);case"days":return e/(s.C6/s.C3)}},s.minutesToUnit=function(e,t){switch(t){case"nanoseconds":return e*(s.C4/s.C0);case"microseconds":return e*(s.C4/s.C1);case"milliseconds":return e*(s.C4/s.C2);case"seconds":return e*(s.C4/s.C3);case"minutes":return e;case"hours":return e/(s.C5/s.C4);case"days":return e/(s.C6/s.C4)}},s.hoursToUnit=function(e,t){switch(t){case"nanoseconds":return e*(s.C5/s.C0);case"microseconds":return e*(s.C5/s.C1);case"milliseconds":return e*(s.C5/s.C2);case"seconds":return e*(s.C5/s.C3);case"minutes":return e*(s.C5/s.C4);case"hours":return e;case"days":return e/(s.C6/s.C5)}},s.daysToUnit=function(e,t){switch(t){case"nanoseconds":return e*(s.C6/s.C0);case"microseconds":return e*(s.C6/s.C1);case"milliseconds":return e*(s.C6/s.C2);case"seconds":return e*(s.C6/s.C3);case"minutes":return e*(s.C6/s.C4);case"hours":return e*(s.C6/s.C5);case"days":return e}},s.dayOfWeek=function(e){e=new Date(e).getUTCDay();return De[(e+6)%7]},s.midnight=function(e){e=new Date(e);return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())},s.C6=24*(s.C5=60*(s.C4=60*(s.C3=1e3*(s.C2=1e3*(s.C1=1e3*(s.C0=1)))))),s.converter={nanoseconds:s.nanosToUnit,microseconds:s.microsToUnit,milliseconds:s.millisToUnit,seconds:s.secondsToUnit,minutes:s.minutesToUnit,hours:s.hoursToUnit,days:s.daysToUnit},s);function s(){}Ve.prototype.tick=function(){return 1e3*Date.now()},Ve.prototype.currentMillis=function(){return Date.now()},Ve.instance=new Ve;var Fe=Ve;function Ve(){}Be.prototype.get=function(e,t){return t};var je=Be;function Be(){this.parameters={}}Ge.prototype.get=function(e,t){e=this.parameters[e];return!p.isNullOrUndefined(e)&&(p.isNullOrUndefined(t)||typeof e==typeof t)?e:t};var Ke=Ge;function Ge(e){this.parameters=e}var He="X-HACKLE-SDK-KEY",ze="X-HACKLE-SDK-NAME",Ye="X-HACKLE-SDK-VERSION",Je="X-HACKLE-SDK-TIME",qe=100,We=6e4,$e=500,Xe=3650,Ze="_hackle_hid",Qe="_hackle_id",et="hackle-repository-storage",tt="_hackle_session_id",rt="_hackle_last_event_ts",nt="_hackle_uid",it="_hackle_did",ot="_hackle_mkt",st="hackle-manual-override_ab",at="hackle-manual-override_ff",ut="hackle-iam-hide",ct="hackle-iam-impression",pt="hackle-split-url-redirected",lt=1/86400*3,ft="hackle-workspace-config",ht=6e4,dt=1e3,yt="hackle-campaign-delay",vt=l.log;function gt(e,t){e=e.find(function(e){return e===t||e.toLowerCase()===t.toLowerCase()});return e||vt.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e}function mt(e,t){if(!p.isNullOrUndefined(t)){for(var r=new Array,n=0,i=t;n<i.length;n++){var o=gt(e,i[n]);if(p.isNullOrUndefined(o))return;r.push(o)}return r}}wt.of=function(e,t){return new wt(e,t)};var Et=wt;function wt(e,t){this.value=e,this.reason=t}Tt.of=function(e,t,r,n){return new Tt(e,t,r=void 0===r?new je:r,n=void 0===n?void 0:n)},Object.defineProperty(Tt.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),Tt.prototype.get=function(e,t){return this.config.get(e,t)};var bt=Tt;function Tt(e,t,r,n){this.variation=e,this.reason=t,this.config=r,this.experiment=n}It.on=function(e,t,r){return new It(!0,e,t=void 0===t?new je:t,r=void 0===r?void 0:r)},It.off=function(e,t,r){return new It(!1,e,t=void 0===t?new je:t,r=void 0===r?void 0:r)},Object.defineProperty(It.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),It.prototype.get=function(e,t){return this.config.get(e,t)};var _t=It;function It(e,t,r,n){this.isOn=e,this.reason=t,this.config=r,this.experiment=n}Nt.prototype.get=function(e,t){return t};var At=Nt;function Nt(){}Object.defineProperty(Pt.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),Pt.fromJson=function(e){return new Pt(e.id,new Ke(f.associateRecord(e.parameters,function(e){return[e.key,e.value]})))},Pt.prototype.get=function(e,t){switch(typeof t){case"string":case"number":case"boolean":return this.config.get(e,t);default:return t}};var Ot=Pt;function Pt(e,t){this.id=e,this.config=t}d.SDK_NOT_READY="SDK_NOT_READY",d.EXCEPTION="EXCEPTION",d.INVALID_INPUT="INVALID_INPUT",d.UNSUPPORTED_PLATFORM="UNSUPPORTED_PLATFORM",d.TYPE_MISMATCH="TYPE_MISMATCH",d.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",d.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",d.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",d.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",d.OVERRIDDEN="OVERRIDDEN",d.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",d.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT="NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT",d.IDENTIFIER_NOT_FOUND="IDENTIFIER_NOT_FOUND",d.VARIATION_DROPPED="VARIATION_DROPPED",d.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",d.TRAFFIC_ALLOCATED_BY_TARGETING="TRAFFIC_ALLOCATED_BY_TARGETING",d.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",d.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",d.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",d.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",d.TARGET_RULE_MATCH="TARGET_RULE_MATCH",d.DEFAULT_RULE="DEFAULT_RULE",d.REMOTE_CONFIG_PARAMETER_NOT_FOUND="REMOTE_CONFIG_PARAMETER_NOT_FOUND",d.IN_APP_MESSAGE_NOT_FOUND="IN_APP_MESSAGE_NOT_FOUND",d.IN_APP_MESSAGE_DRAFT="IN_APP_MESSAGE_DRAFT",d.IN_APP_MESSAGE_PAUSED="IN_APP_MESSAGE_PAUSED",d.IN_APP_MESSAGE_HIDDEN="IN_APP_MESSAGE_HIDDEN",d.IN_APP_MESSAGE_TARGET="IN_APP_MESSAGE_TARGET",d.NOT_IN_IN_APP_MESSAGE_PERIOD="NOT_IN_IN_APP_MESSAGE_PERIOD",d.NOT_IN_IN_APP_MESSAGE_TIMETABLE="NOT_IN_IN_APP_MESSAGE_TIMETABLE",d.NOT_IN_IN_APP_MESSAGE_TARGET="NOT_IN_IN_APP_MESSAGE_TARGET",d.IN_APP_MESSAGE_FREQUENCY_CAPPED="IN_APP_MESSAGE_FREQUENCY_CAPPED",d.EXPERIMENT_CONTROL_GROUP="EXPERIMENT_CONTROL_GROUP";var h=d;function d(){}var St=["DEFAULT","SPLIT_URL","IN_APP_MESSAGE"],Mt=(Rt.fromJson=function(e,t,r){var n=Rt.experimentStatusOrNull(t.execution.status),i=t.variations.map(function(t){return new Ct(t.id,t.key,"DROPPED"===t.status,r.find(function(e){return e.id===t.parameterConfigurationId}))}),o=f.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),s=f.mapNotNullOrUndefined(t.execution.segmentOverrides,function(e){return rr.fromJson(e,Pr.IDENTIFIER)}),a=f.mapNotNullOrUndefined(t.execution.targetAudiences,function(e){return Yt.fromJson(e,Pr.PROPERTY)}),u=ei.fromJson(t.execution.targetUrls),c=gt(St,t.implementationType),p=f.mapNotNullOrUndefined(t.execution.targetRules,function(e){return rr.fromJson(e,Pr.PROPERTY)}),l=er.fromJson(t.execution.defaultRule);return n&&c&&l&&new Rt(t.id,t.key,e,t.identifierType,n,t.version,t.execution.version,i,o,s,a,u,p,l,t.containerId,c,t.winnerVariationId)},Rt.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void vt.debug("Unsupported status [".concat(e,"]"))}},Rt.prototype._winnerVariationOrNull=function(){if(this.winnerVariationId)return this._getVariationByIdOrNull(this.winnerVariationId)},Rt.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},Rt.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},Rt);function Rt(e,t,r,n,i,o,s,a,u,c,p,l,f,h,d,y,v){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.status=i,this.version=o,this.executionVersion=s,this.variations=a,this.userOverrides=u,this.segmentOverrides=c,this.targetAudiences=p,this.splitUrlTargets=l,this.targetRules=f,this.defaultRule=h,this.containerId=d,this.implementationType=y,this.winnerVariationId=v}Object.defineProperty(xt.prototype,"parameters",{get:function(){var e;return null!=(e=null==(e=this.config)?void 0:e.parameters)?e:{}},enumerable:!1,configurable:!0});var Ct=xt;function xt(e,t,r,n){this.id=e,this.key=t,this.isDropped=r,this.config=n}kt.fromJson=function(e){return new kt(e.id,e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new Dt(t,r,e)}))};var Ut=kt;function kt(e,t,r,n){this.id=e,this.seed=t,this.slotSize=r,this.slots=n}Lt.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive};var Dt=Lt;function Lt(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}Vt.fromJson=function(e){return new Vt(e.id,e.key)};var Ft=Vt;function Vt(e,t){this.id=e,this.key=t}Bt.ID="$id",Bt.USER="$userId",Bt.DEVICE="$deviceId",Bt.SESSION="$sessionId",Bt.HACKLE_DEVICE="$hackleDeviceId";var jt=Bt;function Bt(){}function Kt(e){var t=new Gt;return t.addIdentifiers(e.identifiers||{}),t.add(jt.ID,e.id),t.add(jt.DEVICE,e.deviceId),p.isNotNullOrUndefined(e.userId)&&t.add(jt.USER,e.userId),t.build()}Ht.prototype.addIdentifiers=function(e){for(var t in e)this.add(t,e[t]);return this},Ht.prototype.add=function(e,t){var r=Me.sanitizeValue(t);return Me.isValidType(e)&&r?this.identifiers[e]=t:vt.warn("Invalid user identifier [type=".concat(e,", value=").concat(t,"]")),this},Ht.prototype.build=function(){return this.identifiers};var Gt=Ht;function Ht(){this.identifiers={}}function zt(e){var t,r={};return r.id=null!=(t=Me.sanitizeValue(e.id))?t:void 0,r.userId=null!=(t=Me.sanitizeValue(e.userId))?t:void 0,r.deviceId=null!=(t=Me.sanitizeValue(e.deviceId))?t:void 0,"object"==typeof e.properties&&(r.properties=xe.sanitize(e.properties)),"object"==typeof e.identifiers&&(r.identifiers=Me.sanitize(e.identifiers)),t=r,Boolean(t.id||t.userId||t.deviceId||t.identifiers&&0<Object.keys(t.identifiers).length)?r:null}Jt.fromJson=function(e,t){return new Jt(f.mapNotNullOrUndefined(e.conditions,function(e){return qt.fromJson(e,t)}))},Jt.prototype.toJson=function(){return{conditions:this.conditions.map(function(e){return e.toJson()})}};var Yt=Jt;function Jt(e){this.conditions=e}Wt.fromJson=function(e,t){var r=$t.fromJson(e.key);if(r&&t.supports(r.type))return(t=Zt.fromJson(e.match))&&new Wt(r,t)},Wt.prototype.toJson=function(){return{key:this.key.toJson(),match:this.match.toJson()}};var qt=Wt;function Wt(e,t){this.key=e,this.match=t}Xt.fromJson=function(e){var t=gt(Nr,e.type);return t&&new Xt(t,e.name)},Xt.prototype.toJson=function(){return{type:this.type,name:this.name}};var $t=Xt;function Xt(e,t){this.type=e,this.name=t}Qt.fromJson=function(e){var t=gt(Tr,e.type),r=gt(Ir,e.operator),n=gt(_r,e.valueType);return t&&r&&n&&new Qt(t,r,n,e.values)},Qt.prototype.toJson=function(){return{operator:this.operator,type:this.type,valueType:this.valueType,values:this.values}};var Zt=Qt;function Qt(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n}tr.fromJson=function(e){var t=gt(Ar,e.type);return t&&new tr(t,e.variationId,e.bucketId)};var er=tr;function tr(e,t,r){this.type=e,this.variationId=t,this.bucketId=r}nr.fromJson=function(e,t){t=Yt.fromJson(e.target,t),e=er.fromJson(e.action);return t&&e&&new nr(t,e)};var rr=nr;function nr(e,t){this.target=e,this.action=t}or.fromJson=function(e){var t=gt(Or,e.type);return t&&new or(e.id,e.key,t,f.mapNotNullOrUndefined(e.targets,function(e){return Yt.fromJson(e,Pr.SEGMENT)}))};var ir=or;function or(e,t,r,n){this.id=e,this.key=t,this.type=r,this.targets=n}ar.fromJson=function(e){return new ar(e.id,e.bucketId,e.groups.map(function(e){return ur.fromJson(e)}))},ar.prototype.getGroupOrNull=function(t){return this.groups.find(function(e){return e.id===t})};var sr=ar;function ar(e,t,r){this.id=e,this.bucketId=t,this.groups=r}cr.fromJson=function(e){return new cr(e.id,e.experiments)};var ur=cr;function cr(e,t){this.id=e,this.experiments=t}lr.fromJson=function(e){var t=gt(_r,e.type),r=f.mapNotNullOrUndefined(e.targetRules,function(e){return fr.fromJson(e,Pr.PROPERTY)}),n=dr.fromJson(e.defaultValue);return t&&new lr(e.id,e.key,t,e.identifierType,r,n)};var pr=lr;function lr(e,t,r,n,i,o){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.targetRules=i,this.defaultValue=o}hr.fromJson=function(e,t){t=Yt.fromJson(e.target,t);return t&&new hr(e.key,e.name,t,e.bucketId,dr.fromJson(e.value))};var fr=hr;function hr(e,t,r,n,i){this.key=e,this.name=t,this.target=r,this.bucketId=n,this.value=i}yr.fromJson=function(e){return new yr(e.id,e.value)};var dr=yr;function yr(e,t){this.id=e,this.rawValue=t}gr.tryParse=function(e){if(e instanceof gr)return e;var t,r,n,i,e=gr.regExp.exec(e);if(e)return e[0],t=e[1],r=e[2],r=void 0===r?"0":r,n=e[3],n=void 0===n?"0":n,i=e[4],e=e[5],new gr(new mr(parseInt(t,10),parseInt(r,10),parseInt(n,10)),wr.parse(i),wr.parse(e))},gr.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},gr.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},gr.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},gr.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},gr.prototype.isLessThan=function(e){return this.compareTo(e)<0},gr.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},gr.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-]+)*))?$/;var vr=gr;function gr(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}Er.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch};var mr=Er;function Er(e,t,r){this.major=e,this.minor=t,this.patch=r}br.parse=function(e){return e?new br(e.split(".")):br.EMPTY},br.prototype.isEmpty=function(){return 0===this.identifiers.length},br.prototype.isNotEmpty=function(){return!this.isEmpty()},br.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},br.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=br.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},br.compareIdentifiers=function(e,t){return br.numericIdentifierRegExp.test(e)&&br.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},br.EMPTY=new br([]),br.numericIdentifierRegExp=/^(0|[1-9]\d*)$/;var wr=br;function br(e){this.identifiers=e}var Tr=["MATCH","NOT_MATCH"],_r=["STRING","NUMBER","BOOLEAN","VERSION","JSON","URL","NULL","UNKNOWN"],Ir=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE","EXISTS"],Ar=["VARIATION","BUCKET"],Nr=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT","AB_TEST","FEATURE_FLAG","EVENT_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"],Or=["USER_ID","USER_PROPERTY"],Pr=(Sr.prototype.supports=function(e){return this.supportedKeyTypes.includes(e)},Sr.IDENTIFIER=new Sr("SEGMENT"),Sr.PROPERTY=new Sr("SEGMENT","USER_PROPERTY","HACKLE_PROPERTY","AB_TEST","FEATURE_FLAG","EVENT_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"),Sr.SEGMENT=new Sr("USER_ID","USER_PROPERTY","HACKLE_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"),Sr);function Sr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.supportedKeyTypes=e}var Mr=["ACTIVE","DRAFT","PAUSE"],Rr=["WEB","ANDROID","IOS"],Cr=["IMMEDIATE","CUSTOM"],xr=["MODAL","BANNER","BOTTOM_SHEET","NONE"],Ur=["IMAGE_TEXT","IMAGE_ONLY","TEXT_ONLY","IMAGE","NONE"],kr=["VERTICAL","HORIZONTAL"],Dr=["CLICK"],Lr=["CLOSE","WEB_LINK","HIDDEN","LINK_AND_CLOSE","LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE"],Fr=["TOP","MIDDLE","BOTTOM"],Vr=["LEFT","CENTER","RIGHT"],jr=["ALL","CUSTOM"],Br=(Kr.fromJson=function(e){var t,r=gt(Mr,e.status);if(!p.isNullOrUndefined(r)){switch(gt(Cr,e.timeUnit)){case"IMMEDIATE":t=new Gr;break;case"CUSTOM":if(p.isNullOrUndefined(e.startEpochTimeMillis))return;if(p.isNullOrUndefined(e.endEpochTimeMillis))return;t=new zr(e.startEpochTimeMillis,e.endEpochTimeMillis);break;default:return}var n,i,o,s,a=null!=(a=e.timetable&&Jr.fromJson(e.timetable))?a:new $r,u=gn.fromJson(e.messageContext);if(!p.isNullOrUndefined(u))return n=e.eventTriggerRules.map(on.fromJson),i=an.fromJson(e.eventFrequencyCap),o=null!=(o=e.eventTriggerDelay&&Jn.fromJson(e.eventTriggerDelay))?o:Jn.immediate(),s=Gn.fromJson(null!=(s=e.evaluateContext)?s:{atDeliverTime:!1}),new Kr(e.id,e.key,r,t,a,new nn(n,i,o),hn.fromJson(e.targetContext),u,s)}},Kr.prototype.supports=function(e){return this.messageContext.platformTypes.includes(e)},Kr.prototype.toString=function(){return"InAppMessage(id=".concat(this.id,", key=").concat(this.key,", status=").concat(this.status,")")},Kr);function Kr(e,t,r,n,i,o,s,a,u){this.id=e,this.key=t,this.status=r,this.period=n,this.timetable=i,this.eventTrigger=o,this.targetContext=s,this.messageContext=a,this.evaluateContext=u}Hr.prototype.within=function(e){return!0};var Gr=Hr;function Hr(){this.type="IMMEDIATE"}Yr.prototype.within=function(e){return this.startMillisInclusive<=e&&e<this.endMillisExclusive};var zr=Yr;function Yr(e,t){this.startMillisInclusive=e,this.endMillisExclusive=t,this.type="CUSTOM"}qr.fromJson=function(e){switch(gt(jr,e.type)){case"ALL":return new $r;case"CUSTOM":return new Qr(f.mapNotNullOrUndefined(e.slots,function(e){return tn.fromJson(e)}));default:return}};var Jr=qr;function qr(){}o(Xr,Wr=Jr),Xr.prototype.within=function(e){return!0};var Wr,$r=Xr;function Xr(){var e=null!==Wr&&Wr.apply(this,arguments)||this;return e.type="ALL",e}o(en,Zr=Jr),en.prototype.within=function(t){return this.slots.some(function(e){return e.within(t)})};var Zr,Qr=en;function en(e){var t=Zr.call(this)||this;return t.slots=e,t.type="CUSTOM",t}rn.prototype.within=function(e){var t=Le.dayOfWeek(e);if(this.dayOfWeek!==t)return!1;var t=Le.midnight(e),r=t+this.startMillisInclusive,t=t+this.endMillisExclusive;return r<=e&&e<t},rn.fromJson=function(e){var t=gt(De,e.dayOfWeek);return t&&new rn(t,e.startMillisInclusive,e.endMillisExclusive)};var tn=rn;function rn(e,t,r){this.dayOfWeek=e,this.startMillisInclusive=t,this.endMillisExclusive=r}var nn=function(e,t,r){this.rules=e,this.frequencyCap=t,this.delay=r},on=(sn.fromJson=function(e){return new sn(e.eventKey,f.mapNotNullOrUndefined(e.targets,function(e){return Yt.fromJson(e,Pr.PROPERTY)}))},sn);function sn(e,t){this.eventKey=e,this.targets=t}un.fromJson=function(e){return e?new un(e.identifiers.map(cn.fromJson),ln.fromJson(e.duration)):null};var an=un;function un(e,t){this.identifierCaps=e,this.durationCap=t}pn.fromJson=function(e){return new pn(e.identifierType,e.countPerIdentifier)};var cn=pn;function pn(e,t){this.identifierType=e,this.count=t}fn.fromJson=function(e){if(!e)return null;var t=gt(ke,e.durationUnit.timeUnit);return t?new fn(Le.converter[t](e.durationUnit.amount,"milliseconds"),e.countPerDuration):null};var ln=fn;function fn(e,t){this.durationMillis=e,this.count=t}dn.fromJson=function(e){return new dn(e.overrides.map(yn.fromJson),f.mapNotNullOrUndefined(e.targets,function(e){return Yt.fromJson(e,Pr.PROPERTY)}))};var hn=dn;function dn(e,t){this.overrides=e,this.targets=t}vn.fromJson=function(e){return new vn(e.identifierType,e.identifiers)};var yn=vn;function vn(e,t){this.identifierType=e,this.identifiers=t}mn.fromJson=function(e){var t=null,r=("AB_TEST"===e.exposure.type&&null!==e.exposure.key&&(t=new En(e.exposure.key)),mt(Rr,e.platformTypes));if(!p.isNullOrUndefined(r)){var n=mt(kr,e.orientations);if(!p.isNullOrUndefined(n)){var i=f.mapOrUndefined(e.messages,wn.fromJson);if(!p.isNullOrUndefined(i))return new mn(e.defaultLang,t,r,n,i)}}};var gn=mn;function mn(e,t,r,n,i){this.defaultLang=e,this.experimentContext=t,this.platformTypes=r,this.orientations=n,this.messages=i}var En=function(e){this.key=e},wn=(bn.fromJson=function(e){var t=Tn.fromJson(e.layout);if(!p.isNullOrUndefined(t)){var r=f.mapOrUndefined(e.images,Nn.fromJson);if(!p.isNullOrUndefined(r)){var n=void 0;if(!p.isNotNullOrUndefined(e.imageAutoScroll)||(n=Pn.fromJson(e.imageAutoScroll),!p.isNullOrUndefined(n))){var i=f.mapOrUndefined(e.buttons,kn.fromJson);if(!p.isNullOrUndefined(i)){var o=void 0;if(!p.isNotNullOrUndefined(e.closeButton)||(o=kn.fromJson2(e.closeButton),!p.isNullOrUndefined(o))){var s=f.mapOrUndefined(e.outerButtons,Ln.fromJson),a=f.mapOrUndefined(e.innerButtons,Ln.fromJson);if(!p.isNullOrUndefined(s)&&!p.isNullOrUndefined(a))return new bn(e.variationKey,e.lang,t,r,n,e.text?Mn.fromJson(e.text):void 0,i,o,new jn(e.background.color),e.action?Bn.fromJson(e.action):void 0,s,a)}}}}}},bn.prototype.toJson=function(){var e;return{variationKey:this.variationKey,lang:this.lang,layout:{layoutType:this.layout.layoutType,alignment:null!=(e=null==(e=this.layout.alignment)?void 0:e.toJson())?e:null,displayType:this.layout.displayType},images:this.images.map(function(e){return e.toJson()}),imageAutoScroll:null!=(e=null==(e=this.imageAutoScroll)?void 0:e.toJson())?e:null,text:null!=(e=null==(e=this.text)?void 0:e.toJson())?e:null,closeButton:null!=(e=null==(e=this.closeButton)?void 0:e.toCloseButtonJson())?e:null,buttons:this.buttons.map(function(e){return e.toJson()}),background:{color:this.background.color},action:null!=(e=null==(e=this.action)?void 0:e.toJson())?e:null,outerButtons:this.outerButtons.map(function(e){return e.toJson()}),innerButtons:this.innerButtons.map(function(e){return e.toJson()})}},bn);function bn(e,t,r,n,i,o,s,a,u,c,p,l){this.variationKey=e,this.lang=t,this.layout=r,this.images=n,this.imageAutoScroll=i,this.text=o,this.buttons=s,this.closeButton=a,this.background=u,this.action=c,this.outerButtons=p,this.innerButtons=l}_n.fromJson=function(e){var t=gt(Ur,e.layoutType),r=gt(xr,e.displayType);if(!p.isNullOrUndefined(r)&&!p.isNullOrUndefined(t))return new _n(r,t,e.alignment?In.fromJson(e.alignment):void 0)};var Tn=_n;function _n(e,t,r){this.displayType=e,this.layoutType=t,this.alignment=r}An.fromJson=function(e){var t=gt(Vr,e.horizontal);if(!p.isNullOrUndefined(t)){e=gt(Fr,e.vertical);if(!p.isNullOrUndefined(e))return new An(t,e)}},An.prototype.toJson=function(){return{horizontal:this.horizontal,vertical:this.vertical}};var In=An;function An(e,t){this.horizontal=e,this.vertical=t}On.fromJson=function(e){var t=gt(kr,e.orientation);if(!p.isNullOrUndefined(t)){var r=void 0;if(!p.isNotNullOrUndefined(e.action)||(r=Bn.fromJson(e.action),!p.isNullOrUndefined(r)))return new On(t,e.imagePath,r)}},On.prototype.toJson=function(){var e;return{orientation:this.orientation,imagePath:this.imagePath,action:null!=(e=null==(e=this.action)?void 0:e.toJson())?e:null}};var Nn=On;function On(e,t,r){this.orientation=e,this.imagePath=t,this.action=r}Sn.fromJson=function(e){var t=gt(ke,e.interval.timeUnit);if(t)return new Sn(Le.converter[t](e.interval.amount,"milliseconds"))},Sn.prototype.toJson=function(){return{interval:{timeUnit:"milliseconds",amount:this.intervalMillis}}};var Pn=Sn;function Sn(e){this.intervalMillis=e}Rn.fromJson=function(e){return new Rn(Cn.fromJson(e.title),Cn.fromJson(e.body))},Rn.prototype.toJson=function(){return{title:{text:this.title.text,style:{textColor:this.title.style.color}},body:{text:this.body.text,style:{textColor:this.body.style.color}}}};var Mn=Rn;function Rn(e,t){this.title=e,this.body=t}xn.fromJson=function(e){return new xn(e.text,new Un(e.style.textColor))};var Cn=xn;function xn(e,t){this.text=e,this.style=t}var Un=function(e){this.color=e},kn=(Dn.fromJson=function(e){var t=Bn.fromJson(e.action);if(!p.isNullOrUndefined(t))return new Dn(e.text,new Vn(e.style.textColor,e.style.bgColor,e.style.borderColor),t)},Dn.fromJson2=function(e){var t=Bn.fromJson(e.action);if(!p.isNullOrUndefined(t))return new Dn("✕",new Vn(e.style.color,"#FFFFFF","#FFFFFF"),t)},Dn.prototype.toJson=function(){return{text:this.text,action:this.action.toJson(),style:{textColor:this.style.textColor,bgColor:this.style.backgroundColor,borderColor:this.style.borderColor}}},Dn.prototype.toCloseButtonJson=function(){return{action:this.action.toJson(),style:{color:this.style.textColor}}},Dn);function Dn(e,t,r){this.text=e,this.style=t,this.action=r}Fn.fromJson=function(e){var t=kn.fromJson(e.button);if(!p.isNullOrUndefined(t)){e=In.fromJson(e.alignment);if(!p.isNullOrUndefined(e))return new Fn(t,e)}},Fn.prototype.toJson=function(){return{button:this.button.toJson(),alignment:this.alignment.toJson()}};var Ln=Fn;function Fn(e,t){this.button=e,this.alignment=t}var Vn=function(e,t,r){this.textColor=e,this.backgroundColor=t,this.borderColor=r},jn=function(e){this.color=e},Bn=(Kn.fromJson=function(e){var t=gt(Dr,e.behavior);if(!p.isNullOrUndefined(t)){var r=gt(Lr,e.type);if(!p.isNullOrUndefined(r))return new Kn(t,r,null!=(t=e.value)?t:void 0)}},Kn.prototype.toJson=function(){var e;return{behavior:this.behavior,type:this.type,value:null!=(e=this.value)?e:null}},Kn);function Kn(e,t,r){this.behavior=e,this.type=t,this.value=r}Hn.fromJson=function(e){return new Hn(e.atDeliverTime)};var Gn=Hn;function Hn(e){this.atDeliverTime=e}Yn.fromJson=function(e){var t=gt(ke,e.duration.timeUnit);return p.isNullOrUndefined(t)?null:new Yn(Le.converter[t](e.duration.amount,"milliseconds"))};var zn=Yn;function Yn(e){this.durationMillis=e}qn.fromJson=function(e){var t=e.afterCondition&&zn.fromJson(e.afterCondition);return new qn(e.type,t)},qn.immediate=function(){return new qn("IMMEDIATE",null)},qn.prototype.deliverAt=function(e){var t=this.type;switch(t){case"IMMEDIATE":return e;case"AFTER":if(null===this.afterCondition)throw new Error("AfterCondition is required for AFTER delay type");return e+this.afterCondition.durationMillis;default:throw new Error("Unsupported delay type: ".concat(t))}};var Jn=qn;function qn(e,t){this.type=e,this.afterCondition=t}$n.fromJson=function(e){var t=e.type,e=e.value,r=this.linkActionTypes.some(function(e){return e===t}),n=this.closeActionTypes.some(function(e){return e===t}),i=this.tabTargetActionsTypes.some(function(e){return e===t}),o=this.windowTargetActionsTypes.some(function(e){return e===t});return new $n(r?"LINK":"CLOSE",n?{hideDurationMillis:"HIDDEN"===t?864e5:null}:void 0,r?{url:null!=e?e:"",target:o?"NEW_WINDOW":i?"NEW_TAB":"CURRENT",shouldCloseAfterLink:n}:void 0)},$n.fromInteraction=function(e){return"CLOSE"===e.type?new $n(e.type,{hideDurationMillis:null}):$n.fromJson(e.action)},$n.fromAction=function(e){return $n.fromJson(e.toJson())},$n.linkActionTypes=["LINK_AND_CLOSE","LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE","WEB_LINK"],$n.closeActionTypes=["CLOSE","HIDDEN","LINK_AND_CLOSE","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW_AND_CLOSE"],$n.tabTargetActionsTypes=["LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE"],$n.windowTargetActionsTypes=["LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE"];var Wn=$n;function $n(e,t,r){this.type=e,this.close=t,this.link=r}var Xn=function(e){this.id=e},Zn=(n.SplitUrlRedirectType=void 0,(n.SplitUrlRedirectType||(n.SplitUrlRedirectType={})).MANUAL="MANUAL",Qn.fromDto=function(e){var t,r=e.needRedirect;return t=e.properties.type,new Qn(r,Object.values(n.SplitUrlRedirectType).includes(t)?e.properties.type:null,e.properties.value)},Qn);function Qn(e,t,r){this.needRedirect=e,this.redirectType=t,this.redirectUrl=r}ti.fromJson=function(e){if(null!==e)return new ti(f.mapNotNullOrUndefined(e.match,function(e){return Yt.fromJson(e,Pr.PROPERTY)}),f.mapNotNullOrUndefined(e.notMatch,function(e){return Yt.fromJson(e,Pr.PROPERTY)}))};var ei=ti;function ti(e,t){this.includeTargets=e,this.excludeTargets=t}ni.fromJson=function(e){return new ni(e.eventKey,e.property,e.stats)},ni.prototype.countWithinDays=function(t){return f.sum(this.stats.filter(function(e){return e.date>=t}),function(e){return e.count})};var ri=ni;function ni(e,t,r){this.eventKey=e,this.property=t,this.stats=r}oi.prototype.tags=function(e){var r=this;return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r._tags[t]=e}),this},oi.prototype.tag=function(e,t){return this._tags[e]=t,this},oi.prototype.register=function(e){return e.registerTimer({name:this.name,tags:this._tags,type:"TIMER"})};var ii=oi;function oi(e){this.name=e,this._tags={},this.name=e}ai.start=function(e){return new ai(e=void 0===e?ai.defaultClock:e)},ai.prototype.stop=function(e){var t=this._clock.tick()-this.startTime;e.record(t,"microseconds")},ai.defaultClock=new Fe;var si=ai;function ai(e){this._clock=e,this.startTime=this._clock.tick()}ci.prototype.tags=function(e){var r=this;return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r._tags[t]=e}),this},ci.prototype.tag=function(e,t){return this._tags[e]=t,this},ci.prototype.register=function(e){return e.registerCounter({name:this.name,tags:this._tags,type:"COUNTER"})};var ui=ci;function ci(e){this.name=e,this._tags={}}li.prototype.values=function(){return Array.from(this.data.values())},li.prototype.keys=function(){return Array.from(this.data.keys())},li.prototype.get=function(t){var r=this,e=this.keys().find(function(e){return r.compareFn(e,t)});return e?this.data.get(e):void 0},li.prototype.has=function(e){return void 0!==this.get(e)},li.prototype.add=function(e,t){t=(t=t)||e;return this.data.set(e,t),this},li.prototype.delete=function(e){var t;if(this.has(e))return t=this.get(e),this.data.delete(e),t},li.prototype.forEach=function(e){this.data.forEach(e)},li.prototype.filter=function(e){for(var t=new li(this.compareFn),r=0,n=this.entries();r<n.length;r++){var i=n[r];e(i[0],i[1])&&t.add(i[0],i[1])}return t},li.prototype.entries=function(){return Array.from(this.data.entries())};var pi=li;function li(e){this.compareFn=e,this.data=new Map,this.compareFn=e,this.data=new Map}Object.defineProperty(hi.prototype,"value",{get:function(){return this.valueSupplier()},enumerable:!1,configurable:!0});var fi=hi;function hi(e,t){this.valueSupplier=t,this.field=e}function di(e,t){return e.name===t.name&&Me.isEquals(e.tags,t.tags)}Object.defineProperty(yi.prototype,"metrics",{get:function(){return Array.from(this._metrics.values())},enumerable:!1,configurable:!0}),yi.prototype.registerCounter=function(e){return this.registerMetricIfNecessary(e,this.createCounter.bind(this))},yi.prototype.registerTimer=function(e){return this.registerMetricIfNecessary(e,this.createTimer.bind(this))},yi.prototype.counter=function(e,t){return void 0===t&&(t={}),new ui(e).tags(t).register(this)},yi.prototype.timer=function(e,t){return void 0===t&&(t={}),new ii(e).tags(t).register(this)},yi.prototype.registerMetricIfNecessary=function(e,t){return this.getOrCreateMetric(e,t)},yi.prototype.getOrCreateMetric=function(e,t){var r,n=this._metrics.get(e);return n?r=n:(r=t(e),this._metrics.add(e,r)),r},yi.prototype.close=function(){};t=yi;function yi(){this.id=K(),this.name="MetricRegistry",this._metrics=new pi(di)}o(gi,vi=t),gi.prototype.start=function(){var e=this;null===this.publishingJob&&(this.publishingJob=this.scheduler.schedulePeriodically(this.pushIntervalMillis,this.pushIntervalMillis,function(){return e.publish(!1)}),l.log.debug("PushMetricRegistry started. Publish metrics every ".concat(this.pushIntervalMillis,"ms.")))},gi.prototype.stop=function(){var e;null!=(e=this.publishingJob)&&e.cancel(),this.publishingJob=null,this.publish(!0),l.log.debug("PushMetricRegistry stopped.")},gi.prototype.close=function(){this.stop()};var vi,G=gi;function gi(e,t){var r=vi.call(this)||this;return r.scheduler=e,r.pushIntervalMillis=t,r.publishingJob=null,r}Ei.prototype.count=function(){return this.counterValue},Ei.prototype.increment=function(e){this.counterValue+=null!=e?e:1},Ei.prototype.measure=function(){return[new fi("count",this.count.bind(this))]};var mi=Ei;function Ei(e){this.counterValue=0,this.id=e}bi.prototype.flush=function(){var e=this.currentCounter;return this.currentCounter=new mi(this.id),e},bi.prototype.count=function(){return this.currentCounter.count()},bi.prototype.increment=function(e){this.currentCounter.increment(e)},bi.prototype.measure=function(){return[new fi("count",this.count.bind(this))]};var wi=bi;function bi(e){this.id=e,this.currentCounter=new mi(e)}_i.prototype.count=function(){return this._count},_i.prototype.totalTime=function(e){return Le.nanosToUnit(this._total,e)},_i.prototype.max=function(e){return Le.nanosToUnit(this._max,e)},_i.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},_i.prototype.record=function(e,t){e<0||(t=Le.converter[t](e,"nanoseconds"),this._count=this.count()+1,this._total+=t,this._max=Math.max(t,this._max))},_i.prototype.measure=function(){var e=this;return[new fi("count",this.count.bind(this)),new fi("total",function(){return e.totalTime("milliseconds")}),new fi("max",function(){return e.max("milliseconds")}),new fi("mean",function(){return e.mean("milliseconds")})]};var Ti=_i;function _i(e){this._count=0,this._total=0,this._max=0,this.id=e}Ai.prototype.flush=function(){var e=this.currentTimer;return this.currentTimer=new Ti(this.id),e},Ai.prototype.count=function(){return this.currentTimer.count()},Ai.prototype.totalTime=function(e){return this.currentTimer.totalTime(e)},Ai.prototype.max=function(e){return this.currentTimer.max(e)},Ai.prototype.record=function(e,t){this.currentTimer.record(e,t)},Ai.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},Ai.prototype.measure=function(){var e=this;return[new fi("count",this.count.bind(this)),new fi("total",function(){return e.totalTime("milliseconds")}),new fi("max",function(){return e.max("milliseconds")}),new fi("mean",function(){return e.mean("milliseconds")})]};var Ii=Ai;function Ai(e){this.id=e,this.currentTimer=new Ti(e)}o(Oi,Ni=G),Oi.prototype.createCounter=function(e){return new wi(e)},Oi.prototype.createTimer=function(e){return new Ii(e)},Oi.prototype.publish=function(e){void 0===e&&(e=!1);var t=this.metrics.reduce(function(e,t){return void 0===(r=t).flush||"function"!=typeof r.flush?e:e.concat(t.flush());var r},[]);this.flushMetrics(t,e)};var Ni,e=Oi;function Oi(e,t){return Ni.call(this,e,t)||this}Si.prototype.count=function(){return 0},Si.prototype.increment=function(e){},Si.prototype.measure=function(){return[new fi("count",this.count.bind(this))]};var Pi=Si;function Si(e){this.id=e}Object.defineProperty(Ri.prototype,"counters",{get:function(){return Array.from(this._counters.values())},enumerable:!1,configurable:!0}),Ri.prototype.add=function(e){this._counters.add(e,e.registerCounter(this.id))},Ri.prototype.count=function(){return(this.counters[0]||this.noopCounter).count()},Ri.prototype.increment=function(t){this.counters.forEach(function(e){e.increment(t)})},Ri.prototype.measure=function(){return[new fi("count",this.count.bind(this))]};var Mi=Ri;function Ri(e){this._counters=new pi(function(e,t){return e.id===t.id}),this.id=e,this.noopCounter=new Pi(e)}xi.prototype.measure=function(){var e=this;return[new fi("count",this.count.bind(this)),new fi("total",function(){return e.totalTime("milliseconds")}),new fi("max",function(){return e.max("milliseconds")}),new fi("mean",function(){return e.mean("milliseconds")})]},xi.prototype.count=function(){return 0},xi.prototype.totalTime=function(e){return 0},xi.prototype.max=function(e){return 0},xi.prototype.mean=function(e){return 0},xi.prototype.record=function(e,t){};var Ci=xi;function xi(e){this.id=e}Object.defineProperty(ki.prototype,"firstTimer",{get:function(){return this.timers[0]||this.noopTimer},enumerable:!1,configurable:!0}),ki.prototype.totalTime=function(e){return this.firstTimer.totalTime(e)},ki.prototype.max=function(e){return this.firstTimer.max(e)},ki.prototype.mean=function(e){return this.firstTimer.mean(e)},ki.prototype.record=function(t,r){this.timers.forEach(function(e){e.record(t,r)})},Object.defineProperty(ki.prototype,"timers",{get:function(){return Array.from(this._timers.values())},enumerable:!1,configurable:!0}),ki.prototype.add=function(e){this._timers.add(e,e.registerTimer(this.id))},ki.prototype.count=function(){return this.firstTimer.count()},ki.prototype.measure=function(){var e=this;return[new fi("count",this.count.bind(this)),new fi("total",function(){return e.totalTime("milliseconds")}),new fi("max",function(){return e.max("milliseconds")}),new fi("mean",function(){return e.mean("milliseconds")})]};var Ui=ki;function ki(e){this._timers=new pi(function(e,t){return e.id===t.id}),this.id=e,this.noopTimer=new Ci(e)}o(Li,Di=t),Li.prototype.createCounter=function(e){e=new Mi(e);return this.addRegistry(e),e},Li.prototype.createTimer=function(e){e=new Ui(e);return this.addRegistry(e),e},Li.prototype.addRegistry=function(t){this.registries.forEach(function(e){return t.add(e)})},Li.prototype.add=function(r){r instanceof Li||this.registries.has(r)||(this.registries.add(r),this.metrics.forEach(function(e){var t;void 0!==(t=e).add&&"function"==typeof t.add&&e.add(r)}))},Li.prototype.close=function(){this.registries.forEach(function(e){e.close()})};var Di,i=Li;function Li(){var e=null!==Di&&Di.apply(this,arguments)||this;return e.registries=new pi(function(e,t){return e.id===t.id}),e}Vi.counter=function(e,t){return Vi.globalRegistry.counter(e,t)},Vi.timer=function(e,t){return Vi.globalRegistry.timer(e,t)},Vi.addRegistry=function(e){Vi.globalRegistry.add(e),l.log.debug("MetricRegistry added ".concat(e.name))},Vi.globalRegistry=new i;var Fi=Vi;function Vi(){}Bi.equalsIgnoreCase=function(e,t){return e.toLowerCase()===t.toLowerCase()},Bi.isNotEmptyString=function(e){return!p.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length)};var ji=Bi;function Bi(){}Gi.builder=function(){return new Hi},Gi.get=function(e){return Gi.builder().url(e).build()},Gi.prototype.toBuilder=function(){return new Hi(this)};var Ki=Gi;function Gi(e,t,r,n,i){this.url=e,this.method=t,this.body=r,this.headers=n,this.options=i}zi.prototype.url=function(e){return this._url=e,this},zi.prototype.method=function(e){return this._method=e,this},zi.prototype.body=function(e){return this._body=e,this},zi.prototype.addHeader=function(e,t){return this._headers.add(e,t),this},zi.prototype.timeoutMillis=function(e){return this._timeoutMillis=e,this},zi.prototype.build=function(){if(null===this._url)throw new Error("url is null");var e={timeoutMillis:this._timeoutMillis};return new Ki(this._url,this._method,this._body,this._headers.build(),e)};var Hi=zi;function zi(e){var t;this._url=null!=(t=null==e?void 0:e.url)?t:null,this._method=null!=(t=null==e?void 0:e.method)?t:"GET",this._body=null!=(t=null==e?void 0:e.body)?t:null,this._headers=null!=(t=null==(t=null==e?void 0:e.headers)?void 0:t.toBuilder())?t:qi.builder(),this._timeoutMillis=null!=(e=null==(t=null==e?void 0:e.options)?void 0:t.timeoutMillis)?e:null}Ji.ok=function(e,t){return Ji.of(200,e,t)},Ji.of=function(e,t,r){return new Ji(e,null!=t?t:null,null!=r?r:qi.empty())},Ji.prototype.isSuccessful=function(){return 200<=this.statusCode&&this.statusCode<300},Ji.prototype.isClientError=function(){return 400<=this.statusCode&&this.statusCode<500},Ji.prototype.isNotModified=function(){return 304===this.statusCode};var Yi=Ji;function Ji(e,t,r){this.statusCode=e,this.body=t,this.headers=r}Wi.empty=function(){return new Wi(new Map)},Wi.builder=function(){return new $i(new Map)},Wi.prototype.get=function(e){for(var t=0,r=Array.from(this.headers.entries());t<r.length;t++){var n=r[t],i=n[0],n=n[1];if(ji.equalsIgnoreCase(i,e))return n}return null},Wi.prototype.getOrDefault=function(e,t){return null!=(e=this.get(e))?e:t},Wi.prototype.raw=function(){return Array.from(this.headers.entries()).reduce(function(e,t){var r=t[0],t=t[1];return e[r]=t,e},{})},Wi.prototype.toBuilder=function(){return new $i(this.headers)},Wi.IF_MODIFIED_SINCE="If-Modified-Since",Wi.LAST_MODIFIED="Last-Modified",Wi.ACCEPT_ENCODING="Accept-Encoding";var qi=Wi;function Wi(e){this.headers=e}Xi.prototype.add=function(e,t){return this.headers.set(e,t),this},Xi.prototype.build=function(){return new qi(this.headers)};var $i=Xi;function Xi(e){this.headers=e}o(eo,Zi=e),eo.prototype.flushMetrics=function(e,t){var r=this;f.chunked(e.filter(this.isDispatchTarget.bind(this)),qe).forEach(function(e){r.dispatch(e,t)})},eo.prototype.isDispatchTarget=function(e){return("COUNTER"===e.id.type||"TIMER"===e.id.type)&&0<e.count()},eo.prototype.dispatch=function(e,t){e=this.createRequest(e);this.execute(e,t).catch(function(e){return l.log.debug("Failed to flushing metrics: ".concat(e))})},eo.prototype.createRequest=function(e){return Ki.builder().url(this.url).method("POST").body(JSON.stringify(this.batch(e))).addHeader("Content-Type","application/json").build()},eo.prototype.execute=function(e,t){return(t?this.synchronousTransport:this.transport).send(e)},eo.prototype.batch=function(e){return{metrics:e.map(function(e){return{name:e.id.name,type:e.id.type,tags:e.id.tags,measurements:p.fromMap(f.associate(e.measure(),function(e){return[e.field,e.value]}))}})}},eo.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.publish(!0);case"visible":case"pageshow":case"blur":case"locationChange":case"focus":return}};var Zi,Qi=eo;function eo(e,t,r,n,i){n=Zi.call(this,n,i)||this;return n.url=e,n.transport=t,n.synchronousTransport=r,n.start(),n}ro.experiment=function(e,t,r){t=Fi.timer("experiment.decision",{key:String(t),variation:r.variation,reason:String(r.reason)});e.stop(t)},ro.featureFlag=function(e,t,r){t=Fi.timer("feature.flag.decision",{key:String(t),on:String(r.isOn),reason:String(r.reason)});e.stop(t)},ro.remoteConfig=function(e,t,r){t=Fi.timer("remote.config.decision",{key:String(t),reason:String(r.reason)});e.stop(t)};var to=ro;function ro(){}io.record=function(e,t,r){e=Fi.timer("api.call",{operation:e,success:io.success(r)});t.stop(e)},io.success=function(e){return null===e?"false":String(e.isSuccessful()||e.isNotModified())};var no=io;function io(){}so.decide=function(e,t,r,n){if(p.isNullOrUndefined(r))return this.decision(e,t,"NULL",r,n);switch(typeof r){case"string":return this.decision(e,t,"STRING",r,n);case"number":return this.decision(e,t,"NUMBER",r,n);case"boolean":return this.decision(e,t,"BOOLEAN",r,n);default:return this.decision(e,t,"UNKNOWN",r,n)}},so.decision=function(e,t,r,n,i){return p.isNullOrUndefined(t)?Et.of(n,h.INVALID_INPUT):e.remoteConfig(t,i,r,n)};var oo=so;function so(){}var ao=l.log,uo=(co.prototype.get=function(t,r){var n,e=si.start();try{n=this.decide(t,r)}catch(e){ao.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),n=Et.of(r,h.EXCEPTION)}return to.remoteConfig(e,t,n),n.value},co.prototype.decide=function(e,t){var r=this.userManager.resolve(this.user);return oo.decide(this.core,e,t,r)},co);function co(e,t,r){this.core=e,this.userManager=t,this.user=r}fo.prototype.contains=function(e){return this._properties.has(e)},fo.prototype.remove=function(e){var r=this;return e instanceof Map&&e.forEach(function(e,t){r.remove(t)}),"string"==typeof e&&this._properties.delete(e),this},fo.prototype.compute=function(e,t){var r=this._properties.get(e),t=t(r);null!==t?this.add(e,t):null===r&&!this.contains(e)||this.remove(e)},fo.prototype.add=function(e,t,r){if((r=void 0===r?!1:r)&&this.contains(e))return this;if(this._properties.size>=this.MAX_PROPERTIES_COUNT)return this;if("string"==typeof e&&e.length>this.MAX_PROPERTY_KEY_LENGTH)return this;r=xe.sanitizeValue(e,t);return p.isNullOrUndefined(r)||this._properties.set(e,r),this},fo.prototype.addProperties=function(e,r){var n=this;return void 0===r&&(r=!1),e.forEach(function(e,t){n.add(t,e,r)}),this},fo.prototype.build=function(){return this._properties};var po,lo=fo;function fo(){this._properties=new Map,this.MAX_PROPERTIES_COUNT=128,this.MAX_PROPERTY_KEY_LENGTH=128}(Q=po=po||{}).SET="$set",Q.SET_ONCE="$setOnce",Q.UNSET="$unset",Q.INCREMENT="$increment",Q.APPEND="$append",Q.APPEND_ONCE="$appendOnce",Q.PREPEND="$prepend",Q.PREPEND_ONCE="$prependOnce",Q.REMOVE="$remove",Q.CLEAR_ALL="$clearAll";yo.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new lo).addProperties(e).addProperties(t).build()};var ho=yo;function yo(){}go.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new lo).addProperties(e).addProperties(t,!0).build()};var vo=go;function go(){}Eo.prototype.operate=function(e,t){return 0===e.size?new Map:0===t.size?e:(new lo).addProperties(e).remove(t).build()};var mo=Eo;function Eo(){}bo.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new lo;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.increment(e,t)})}),n.build()},bo.prototype.increment=function(e,t){return"number"!=typeof t?e:"number"!=typeof e?null==e?t:e:e+t};var wo=bo;function bo(){}To.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new lo;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.compute(e,t)})}),n.build()},To.prototype.compute=function(e,t){e=this.toArray(e),t=this.toArray(t);return this.operateArray(e,t)},To.prototype.toArray=function(e){return null==e?[]:Array.isArray(e)?e:[e]},To.prototype.contains=function(e,t){return e.includes(t)},To.prototype.prepend=function(e,t,r){return(r=void 0===r?!1:r)&&this.contains(t,e)?t:Te([e],t,!0)},To.prototype.append=function(e,t,r){return(r=void 0===r?!1:r)&&this.contains(e,t)?e:Te(Te([],e,!0),[t],!1)};r=To;function To(){}o(Ao,_o=r),Ao.prototype.operateArray=function(e,t){var r=this;return t.reduce(function(e,t){return r.append.bind(r)(e,t)},e)};var _o,Io=Ao;function Ao(){return null!==_o&&_o.apply(this,arguments)||this}o(Po,No=r),Po.prototype.operateArray=function(e,t){return t.reduce(this.appendOnce.bind(this),e)},Po.prototype.appendOnce=function(e,t){return this.append(e,t,!0)};var No,Oo=Po;function Po(){return null!==No&&No.apply(this,arguments)||this}o(Ro,So=r),Ro.prototype.operateArray=function(e,t){var r=this;return t.reduceRight(function(e,t){return r.prepend.bind(r)(t,e)},e)};var So,Mo=Ro;function Ro(){return null!==So&&So.apply(this,arguments)||this}o(Uo,Co=r),Uo.prototype.operateArray=function(e,t){var r=this;return t.reduce(this.appendOnce.bind(this),[]).reduceRight(function(e,t){return r.prependOnce.bind(r)(t,e)},e)},Uo.prototype.appendOnce=function(e,t){return this.append(e,t,!0)},Uo.prototype.prependOnce=function(e,t){return this.prepend(e,t,!0)};var Co,xo=Uo;function Uo(){return null!==Co&&Co.apply(this,arguments)||this}o(Lo,ko=r),Lo.prototype.operateArray=function(e,t){return t.reduce(this.remove.bind(this),e)},Lo.prototype.remove=function(e,t){return e.filter(function(e){return e!==t})};var ko,Do=Lo;function Lo(){return null!==ko&&ko.apply(this,arguments)||this}Vo.prototype.operate=function(e,t){return new Map};var Fo=Vo;function Vo(){}Bo.get=function(e){switch(e){case po.SET:return new ho;case po.SET_ONCE:return new vo;case po.UNSET:return new mo;case po.INCREMENT:return new wo;case po.APPEND:return new Io;case po.APPEND_ONCE:return new Oo;case po.PREPEND:return new Mo;case po.PREPEND_ONCE:return new xo;case po.CLEAR_ALL:return new Fo;case po.REMOVE:return new Do}};var jo=Bo;function Bo(){}Go.prototype.set=function(e,t){return this.add(po.SET,e,t)},Go.prototype.setOnce=function(e,t){return this.add(po.SET_ONCE,e,t)},Go.prototype.unset=function(e){return this.add(po.UNSET,e,"-")},Go.prototype.increment=function(e,t){return this.add(po.INCREMENT,e,t)},Go.prototype.append=function(e,t){return this.add(po.APPEND,e,t)},Go.prototype.appendOnce=function(e,t){return this.add(po.APPEND_ONCE,e,t)},Go.prototype.prepend=function(e,t){return this.add(po.PREPEND,e,t)},Go.prototype.prependOnce=function(e,t){return this.add(po.PREPEND_ONCE,e,t)},Go.prototype.remove=function(e,t){return this.add(po.REMOVE,e,t)},Go.prototype.clearAll=function(){return this.add(po.CLEAR_ALL,"clearAll","-")},Go.prototype.build=function(){var e=Array.from(this.operations.entries()).map(function(e){return[e[0],e[1].build()]});return new Ho(new Map(e))},Go.prototype.containsKey=function(t){return Array.from(this.operations.entries()).some(function(e){return e[0],e[1].contains(t)})},Go.prototype.add=function(e,t,r){if(this.containsKey(t))return this;this.operations.has(e)||this.operations.set(e,new lo);e=this.operations.get(e);return null!=e&&e.add(t,r),this};var Ko=Go;function Go(){this.operations=new Map}zo.prototype.operate=function(e){var r=e;return this.operations.forEach(function(e,t){r=jo.get(t).operate(r,e)}),r},zo.prototype.toEvent=function(){var i={key:"$properties"};return this.operations.forEach(function(e,t){var r,n;i.properties=c(c({},i.properties),((r={})[t]=c(c({},null==(n=i.properties)?void 0:n[t]),xe.sanitize(p.fromMap(e))),r))}),i},zo.prototype.toSecuredEvent=function(){var i={key:"$secured_properties"};return this.operations.forEach(function(e,t){var r,n;i.properties=c(c({},i.properties),((r={})[t]=c(c({},null==(n=i.properties)?void 0:n[t]),xe.sanitize(p.fromMap(e))),r))}),i},zo.prototype.toRecord=function(){var n={};return this.operations.forEach(function(e,t){var r={};e.forEach(function(e,t){r[t]=e}),n[t]=r}),n};var Ho=zo;function zo(e){this.operations=null!=e?e:new Map}Jo.timeout=function(r,n){return new Promise(function(e,t){setTimeout(function(){return t(new Error("timeout (".concat(n,"ms)")))},n),r.then(e,t)})};var Yo=Jo;function Jo(){}Wo.prototype.isEquals=function(e){return this.url===e.url},Object.defineProperty(Wo.prototype,"pageTitle",{get:function(){return"undefined"==typeof window||"undefined"==typeof document?"":window.document.title},enumerable:!1,configurable:!0}),Wo.createWithCurrentPage=function(){return"undefined"==typeof window||"undefined"==typeof document?new Wo:new Wo(window.location.pathname,window.location.host,window.location.hostname,window.location.href,window.document.referrer,window.location.search,window.location.protocol)},Wo.prototype.toProperties=function(){return{pagePath:this.pagePath,pageTitle:this.pageTitle,host:this.host,url:this.url,referrer:this.referrer,queryParameter:this.queryParameter,protocol:this.protocol.replace(":","")}};var qo=Wo;function Wo(e,t,r,n,i,o,s){void 0===t&&(t=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=""),void 0===o&&(o=""),void 0===s&&(s=""),this.pagePath=e=void 0===e?"":e,this.host=t,this.hostname=r,this.url=n,this.referrer=i,this.queryParameter=o,this.protocol=s}Xo.create=function(e){return new Xo(e)},Xo.prototype.getValue=function(){return this.value};var $o=Xo;function Xo(e){this.value=e}Qo.toPublic=function(e){return{key:e.key}};var Zo=Qo;function Qo(){}ts.toPublic=function(e){return{close:e.close.bind(e),inAppMessage:Zo.toPublic(e.context.inAppMessage)}};var es=ts;function ts(){}var rs=l.log,ns=(y.prototype.initialize=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),rs.debug("HackleClient initializing"),[4,this.synchronizer.sync()];case 1:return e.sent(),rs.debug("HackleClient initialized"),[3,4];case 2:throw t=e.sent(),rs.error("HackleClient initialize failed: ".concat(t)),t;case 3:return this.initialized=!0,[7];case 4:return[2]}})})},y.prototype.getSessionId=function(){return this.sessionManager.sessionId},y.prototype.getUser=function(){return this.userManager.currentUser},y.prototype.setUser=function(e){try{var t=zt(e);if(!t)return rs.warn("invalid user"),Promise.resolve();var r=this.userManager.setUser(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return rs.error("Unexpected exception while set user: ".concat(e)),Promise.resolve()}},y.prototype.setUserId=function(e){try{var t=void 0;if(p.isNullOrUndefined(e))t=this.userManager.setUserId(void 0);else{var r=Me.sanitizeValue(e);if(!r)return rs.warn("Invalid userId. [userId=".concat(e,"]")),Promise.resolve();t=this.userManager.setUserId(r)}return this.userManager.syncIfNeeded(t).catch(function(){})}catch(e){return rs.error("Unexpected exception while set userId: ".concat(e)),Promise.resolve()}},y.prototype.setDeviceId=function(e){try{var t=Me.sanitizeValue(e);if(!t)return rs.warn("Invalid deviceId. [deviceId=".concat(e,"]")),Promise.resolve();var r=this.userManager.setDeviceId(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return rs.error("Unexpected exception while set deviceId: ".concat(e)),Promise.resolve()}},y.prototype.setUserProperty=function(e,t){e=(new Ko).set(e,t).build();return this.updateUserProperties(e)},y.prototype.setUserProperties=function(e){try{var t=xe.sanitize(e),r=new Ko;return Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){return rs.error("Unexpected exception while set userProperties: ".concat(e)),Promise.resolve()}},y.prototype.updateUserProperties=function(e){try{var t=e.toEvent();return this.track(t),this.userManager.updateUserProperties(e),this.core.flush(!1),Promise.resolve()}catch(e){return rs.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},y.prototype.updatePushSubscriptions=function(e){try{var t=e.toEvent("$push_subscriptions");return this.track(t),this.core.flush(!1),Promise.resolve()}catch(e){return rs.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},y.prototype.updateSmsSubscriptions=function(e){try{var t=e.toEvent("$sms_subscriptions");return this.track(t),this.core.flush(!1),Promise.resolve()}catch(e){return rs.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},y.prototype.updateKakaoSubscriptions=function(e){try{var t=e.toEvent("$kakao_subscriptions");return this.track(t),this.core.flush(!1),Promise.resolve()}catch(e){return rs.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},y.prototype.resetUser=function(){try{var e=this.userManager.resetUser(),t=(new Ko).clearAll().build();return this.track(t.toEvent()),this.userManager.syncIfNeeded(e).catch(function(){})}catch(e){return rs.error("Unexpected exception while reset user: ".concat(e)),Promise.resolve()}},y.prototype.setPhoneNumber=function(e){try{if("string"!=typeof e)return rs.error("Invalid value ".concat(e,": phoneNumber value type must be string.")),Promise.resolve();var t=$o.create(e),r=Fe.instance.currentMillis();return this.piiEventManager.setPhoneNumber(t,r),this.core.flush(!1),Promise.resolve()}catch(e){return rs.error("Unexpected exception occurred while setting phone number: ".concat(e)),Promise.resolve()}},y.prototype.unsetPhoneNumber=function(){try{var e=Fe.instance.currentMillis();return this.piiEventManager.unsetPhoneNumber(e),this.core.flush(!1),Promise.resolve()}catch(e){return rs.error("Unexpected exception occurred while unsetting phone number: ".concat(e)),Promise.resolve()}},y.prototype.variation=function(e,t,r){return this.variationDetail(e,t,r).variation},y.prototype.variationDetail=function(r,n,e){var i=e||"A",e=si.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.experiment(r,t,i)}catch(e){return rs.error("Unexpected exception while deciding variation for experiment[".concat(r,"]. Returning default variation[").concat(i,"] : ").concat(e)),bt.of(i,h.EXCEPTION)}}(this);return to.experiment(e,r,t),t},y.prototype.isFeatureOn=function(e,t){return this.featureFlagDetail(e,t).isOn},y.prototype.featureFlagDetail=function(r,n){var e=si.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.featureFlag(r,t)}catch(e){return rs.error("Unexpected exception while deciding feature flag[".concat(r,"]. Returning default value[false] : ").concat(e)),_t.off(h.EXCEPTION)}}(this);return to.featureFlag(e,r,t),t},y.prototype.track=function(e,t){try{rs.debug("track event : ".concat(JSON.stringify(e)));var r=this._convertEvent(e),n=this.userManager.resolve(t);this.core.track(r,n)}catch(e){rs.error("Unexpected exception while tracking event: ".concat(e))}},y.prototype.trackPageView=function(e){var t=qo.createWithCurrentPage();this.pageEventTracker.track(t)},y.prototype.remoteConfig=function(e){return new uo(this.core,this.userManager,e)},y.prototype.onReady=function(e,t){this.onInitialized({timeout:t=void 0===t?3e3:t}).finally(function(){return e()})},y.prototype.getExperiment=function(t){try{return this.core.getExperiment(t)}catch(e){return void rs.error('"Unexpected exception while get experiment['.concat(t,"]"))}},y.prototype.onInitialized=function(r){var n;return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:if(this.initialized)return[2,{success:!0}];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Yo.timeout(this.initialization,null!=(n=null==r?void 0:r.timeout)?n:3e3)];case 2:return e.sent(),[2,{success:!0}];case 3:return t=e.sent(),rs.error("Failed to onInitialized: ".concat(t)),[2,{success:!1}];case 4:return[2]}})})},y.prototype._convertEvent=function(e){return"string"==typeof e?{key:e}:e},y.prototype.showUserExplorer=function(){var e;null!=(e=this.devTools)&&e.userExplorer?(rs.debug("UserExplorer opened."),Fi.counter("user.explorer.show",{}).increment(),this.devTools.manager.userExplorer(this.devTools.userExplorer)):rs.error("UserExplorer is not provided")},y.prototype.hideUserExplorer=function(){this.devTools?this.devTools.manager.close():rs.warn("There is no active HackleDevtools.")},y.prototype.fetch=function(){var e=this;return this.fetchThrottler.execute(function(){return e.synchronizer.sync()},function(){return Promise.resolve()})},y.prototype.setInAppMessageListener=function(e){this.inAppMessageUi.setListener(e)},y.prototype.getDisplayedInAppMessageView=function(){return this.inAppMessageUi.currentMessageView?es.toPublic(this.inAppMessageUi.currentMessageView):null},y.prototype.close=function(){rs.debug("HackleClient closing"),this.core.close(),this.synchronizer.close()},y);function y(e,t,r,n,i,o,s,a,u){this.core=e,this.synchronizer=t,this.sessionManager=r,this.userManager=n,this.piiEventManager=i,this.fetchThrottler=o,this.pageEventTracker=s,this.inAppMessageUi=a,this.devTools=u,this.initialized=!1,this.initialize=this.initialize.bind(this),this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.updatePushSubscriptions=this.updatePushSubscriptions.bind(this),this.updateSmsSubscriptions=this.updateSmsSubscriptions.bind(this),this.updateKakaoSubscriptions=this.updateKakaoSubscriptions.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.getDisplayedInAppMessageView=this.getDisplayedInAppMessageView.bind(this),this.initialization=this.initialize()}var is=l.log,os=(ss.prototype.get=function(t,r){var e=typeof r;try{var n={command:"remoteConfig",parameters:{defaultValue:r,key:t,valueType:e,user:this.user},browserProperties:this.browserPropertyProvider.getBrowserProperties()},i=this.invocationProcessor.process(n);if(!i)throw new Error("invoke result data not exists");switch(e){case"number":return Number(i);case"boolean":return Boolean(i);default:return i}}catch(e){return is.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),r}},ss);function ss(e,t,r){this.invocationProcessor=e,this.user=t,this.browserPropertyProvider=r}us.tryParse=function(e){try{return new URL(e)}catch(e){return}},us.removePathnameTrailingSlash=function(e){var t=e instanceof URL?e:us.tryParse(e);return t?(t.pathname.endsWith("/")&&(t.pathname=t.pathname.replace(/\/+$/,"")),t.href):String(e)},us.tryDecodeURI=function(e){try{return decodeURI(e)}catch(e){return}},us.tryDecodeURIComponent=function(e){try{return decodeURIComponent(e)}catch(e){return}},us.decodeURIOrOriginal=function(t){try{return decodeURI(t)}catch(e){return t}},us.decodeURIComponentOrOriginal=function(t){try{return decodeURIComponent(t)}catch(e){return t}};var as=us;function us(){}ps.extractDomain=function(e){var t=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,r=e.split("."),r=r[r.length-1],r=((4<r.length||"com"===r||"org"===r)&&(t=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i),e.match(t));return r?r[0]:""},ps.prototype.getItem=function(e){for(var t,r=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return null!=(t=as.tryDecodeURIComponent(o.substring(r.length,o.length)))?t:null}return null},ps.prototype.getAllItem=function(e){var t=document.cookie.split("; ").map(function(e){return e.split("=")}),r=null==e?void 0:e.keyPrefix;return r?t.filter(function(e){var t=e[0];return e[1],t.startsWith(r)}):t},ps.prototype.setItem=function(e,t,r){var r=c(c({},this.options),r),n="",i="",o="",s="",a=(r.isCrossSubdomain&&(n=(a=ps.extractDomain(document.location.hostname))?"; domain=."+a:""),r.days&&((a=new Date).setTime(a.getTime()+24*r.days*60*60*1e3),i="; expires="+a.toUTCString()),r.sameSite&&(s="; SameSite=".concat(r.sameSite)),r.isSecure&&(o+="; secure"),e+"="+encodeURIComponent(t)+i+"; path=/"+n+s+o);return document.cookie=a},ps.prototype.removeItem=function(e,t){this.setItem(e,"",c(c({},t),{days:-1}))},ps.prototype.getOptions=function(){return this.options},ps.getInstance=function(e){return void 0===e&&(e={days:Xe,isCrossSubdomain:!0}),ps.storage=ps.storage?ps.storage:new ps(e)};var cs=ps;function ps(e){this.options=e=void 0===e?{days:0,isCrossSubdomain:!1,isSecure:!1}:e}fs.prototype.initialize=function(){cs.getInstance().getItem(Ze)||ys()},fs.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return ds();case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var ls=fs;function fs(){}function hs(){var e=cs.getInstance(),t=e.getItem(Qe);if(t)return t;t=e.getItem(Ze);return t||ys()}function ds(){cs.getInstance().removeItem(Qe)}function ys(){var e=K();return cs.getInstance().setItem(Ze,e),e}var vs,gs=l.log;(G=vs=vs||{}).native="native",G.web_view_wrapper="web_view_wrapper";v.prototype.getSessionId=function(){try{var e={command:"getSessionId",browserProperties:this.browserPropertyProvider.getBrowserProperties()},t=this.invocationProcessor.process(e);return null!=t?t:hs()}catch(e){return gs.error("Unexpected exception while get sessionId: ".concat(e)),hs()}},v.prototype.getUser=function(){var e;try{var t={command:"getUser",browserProperties:this.browserPropertyProvider.getBrowserProperties()},r=this.invocationProcessor.process(t);return null!=(e=zt(r))?e:this.defaultUser()}catch(e){return gs.error("Unexpected exception while get user: ".concat(e)),this.defaultUser()}},v.prototype.setUser=function(n){return a(this,void 0,void 0,function(){var t,r;return u(this,function(e){try{if(!(t=zt(n)))return gs.warn("invalid user"),[2];r={command:"setUser",parameters:{user:t},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(r)}catch(e){gs.error("Unexpected exception while set user: ".concat(e))}return[2]})})},v.prototype.setUserId=function(n){return a(this,void 0,void 0,function(){var t,r;return u(this,function(e){try{if(t=void 0,p.isNullOrUndefined(n))t=null;else if(!(t=Me.sanitizeValue(n)))return gs.warn("Invalid userId. [userId=".concat(n,"]")),[2];r={command:"setUserId",parameters:{userId:t},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(r)}catch(e){gs.error("Unexpected exception while set userId: ".concat(e))}return[2]})})},v.prototype.setDeviceId=function(n){return a(this,void 0,void 0,function(){var t,r;return u(this,function(e){try{if(!(t=Me.sanitizeValue(n)))return gs.warn("Invalid deviceId. [deviceId=".concat(n,"]")),[2];r={command:"setDeviceId",parameters:{deviceId:t},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(r)}catch(e){gs.error("Unexpected exception while set deviceId: ".concat(e))}return[2]})})},v.prototype.setUserProperty=function(r,n){return a(this,void 0,void 0,function(){var t;return u(this,function(e){try{t={command:"setUserProperty",parameters:{key:r,value:n},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){gs.error("Unexpected exception while set userProperty: ".concat(e))}return[2]})})},v.prototype.setUserProperties=function(n){return a(this,void 0,void 0,function(){var t,r;return u(this,function(e){try{t=xe.sanitize(n),r=new Ko,Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){gs.error("Unexpected exception while set userProperties: ".concat(e))}return[2]})})},v.prototype.updateUserProperties=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){try{t={command:"updateUserProperties",parameters:{operations:r.toRecord()},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){gs.error("Unexpected exception while update userProperties: ".concat(e))}return[2]})})},v.prototype.updatePushSubscriptions=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){try{t={command:"updatePushSubscriptions",parameters:{operations:r.toRecord()},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){gs.error("Unexpected exception while update push subscriptions: ".concat(e))}return[2]})})},v.prototype.updateSmsSubscriptions=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){try{t={command:"updateSmsSubscriptions",parameters:{operations:r.toRecord()},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){gs.error("Unexpected exception while update sms subscriptions: ".concat(e))}return[2]})})},v.prototype.updateKakaoSubscriptions=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){try{t={command:"updateKakaoSubscriptions",parameters:{operations:r.toRecord()},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){gs.error("Unexpected exception while update Kakao subscriptions: ".concat(e))}return[2]})})},v.prototype.resetUser=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){try{t={command:"resetUser",browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){gs.error("Unexpected exception while reset user: ".concat(e))}return[2]})})},v.prototype.setPhoneNumber=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){try{if("string"!=typeof r)return gs.error("Invalid type ".concat(r,": phoneNumber value must be string.")),[2,Promise.resolve()];t={command:"setPhoneNumber",parameters:{phoneNumber:r},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){gs.error("Unexpected exception occurred while setting phone number: ".concat(e))}return[2]})})},v.prototype.unsetPhoneNumber=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){try{t={command:"unsetPhoneNumber",browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){gs.error("Unexpected exception occurred while unsetting phone number: ".concat(e))}return[2]})})},v.prototype.variation=function(t,e,r){void 0===r&&(r="A");try{var n={command:"variation",parameters:{experimentKey:t,defaultVariation:r,user:this.convertUser(e)},browserProperties:this.browserPropertyProvider.getBrowserProperties()},i=this.invocationProcessor.process(n);if(i)return i;throw new Error("invoke result data not exists")}catch(e){return gs.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),r}},v.prototype.variationDetail=function(t,e,r){var n;void 0===r&&(r="A");try{var i={command:"variationDetail",parameters:{experimentKey:t,defaultVariation:r,user:this.convertUser(e)},browserProperties:this.browserPropertyProvider.getBrowserProperties()},o=this.invocationProcessor.process(i);if(null===o)throw new Error("invoke result data not exists");return bt.of(o.variation,o.reason,new Ke(null!=(n=o.config.parameters)?n:{}))}catch(e){return gs.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),bt.of(r,h.EXCEPTION)}},v.prototype.isFeatureOn=function(t,e){try{var r={command:"isFeatureOn",parameters:{featureKey:t,user:this.convertUser(e)},browserProperties:this.browserPropertyProvider.getBrowserProperties()},n=this.invocationProcessor.process(r);if(null===n)throw new Error("invoke result data not exists");return Boolean(n)}catch(e){return gs.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),!1}},v.prototype.featureFlagDetail=function(t,e){var r;try{var n={command:"featureFlagDetail",parameters:{featureKey:t,user:this.convertUser(e)},browserProperties:this.browserPropertyProvider.getBrowserProperties()},i=this.invocationProcessor.process(n);if(null===i)throw new Error("invoke result data not exists");return new _t(i.isOn,i.reason,new Ke(null!=(r=i.config.parameters)?r:{}),void 0)}catch(e){return gs.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),_t.off(h.EXCEPTION)}},v.prototype.track=function(e,t){try{var r={command:"track",parameters:{event:this.convertEvent(e),user:this.convertUser(t)},browserProperties:this.browserPropertyProvider.getBrowserProperties()};this.invocationProcessor.process(r)}catch(e){gs.error("Unexpected exception while tracking event: ".concat(e))}},v.prototype.trackPageView=function(e){gs.info("Web to app integration feature is not support 'trackPageView' method")},v.prototype.remoteConfig=function(e){return new os(this.invocationProcessor,this.convertUser(e),this.browserPropertyProvider)},v.prototype.onReady=function(e,t){e()},v.prototype.showUserExplorer=function(){try{var e={command:"showUserExplorer",browserProperties:this.browserPropertyProvider.getBrowserProperties()};this.invocationProcessor.process(e)}catch(e){gs.error("Unexpected exception while show userExplorer: ".concat(e))}},v.prototype.hideUserExplorer=function(){try{var e={command:"hideUserExplorer",browserProperties:this.browserPropertyProvider.getBrowserProperties()};this.invocationProcessor.process(e)}catch(e){gs.error("Unexpected exception while hide userExplorer: ".concat(e))}},v.prototype.setInAppMessageListener=function(e){gs.info("Web to app integration feature is not support 'setInAppMessageListener' method")},v.prototype.fetch=function(){return Promise.resolve()},v.prototype.onInitialized=function(e){return Promise.resolve({success:!0})},v.prototype.close=function(){gs.info("Web to app integration feature is not support 'close' method")},v.prototype.getExperiment=function(e){gs.info("Web to app integration feature is not support 'getExperiment' method")},v.prototype.convertEvent=function(e){return"string"==typeof e?{key:e}:e},v.prototype.convertUser=function(e){return"string"==typeof e||e&&null!=(e=zt(e))?e:void 0},v.prototype.defaultUser=function(){return{deviceId:hs()}},v.prototype.getDisplayedInAppMessageView=function(){return gs.info("Web to app integration feature is not support 'getDisplayedInAppMessageView' method"),null};var ms=v;function v(e,t){this.invocationProcessor=e,this.browserPropertyProvider=t,this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.updatePushSubscriptions=this.updatePushSubscriptions.bind(this),this.updateSmsSubscriptions=this.updateSmsSubscriptions.bind(this),this.updateKakaoSubscriptions=this.updateKakaoSubscriptions.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.getDisplayedInAppMessageView=this.getDisplayedInAppMessageView.bind(this)}g.prototype.getSessionId=function(){return this.browser.getSessionId()},g.prototype.getUser=function(){return this.browser.getUser()},g.prototype.syncUser=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return t=this.browser.getUser(),[4,this.app.setUser(t)];case 1:return e.sent(),[2]}})})},g.prototype.setUser=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.setUser(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},g.prototype.setUserId=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserId(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},g.prototype.setDeviceId=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.setDeviceId(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},g.prototype.setUserProperty=function(t,r){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserProperty(t,r)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},g.prototype.setUserProperties=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserProperties(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},g.prototype.updateUserProperties=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.updateUserProperties(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},g.prototype.updatePushSubscriptions=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.updatePushSubscriptions(t)];case 1:return e.sent(),[2]}})})},g.prototype.updateSmsSubscriptions=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.updateSmsSubscriptions(t)];case 1:return e.sent(),[2]}})})},g.prototype.updateKakaoSubscriptions=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.updateKakaoSubscriptions(t)];case 1:return e.sent(),[2]}})})},g.prototype.resetUser=function(){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.resetUser()];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},g.prototype.setPhoneNumber=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.setPhoneNumber(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},g.prototype.unsetPhoneNumber=function(){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.browser.unsetPhoneNumber()];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},g.prototype.variation=function(e,t,r){return this.browser.variation(e,t,r=void 0===r?"A":r)},g.prototype.variationDetail=function(e,t,r){return this.browser.variationDetail(e,t,r=void 0===r?"A":r)},g.prototype.isFeatureOn=function(e,t){return this.browser.isFeatureOn(e,t)},g.prototype.featureFlagDetail=function(e,t){return this.browser.featureFlagDetail(e,t)},g.prototype.track=function(e,t){return this.browser.track(e,t)},g.prototype.trackPageView=function(e){return this.browser.trackPageView(e)},g.prototype.remoteConfig=function(e){return this.browser.remoteConfig(e)},g.prototype.onReady=function(e,t){this.browser.onReady(e,t)},g.prototype.showUserExplorer=function(){this.browser.showUserExplorer()},g.prototype.hideUserExplorer=function(){this.browser.hideUserExplorer()},g.prototype.fetch=function(){return this.browser.fetch()},g.prototype.onInitialized=function(e){return this.browser.onInitialized(e)},g.prototype.close=function(){this.browser.close()},g.prototype.setInAppMessageListener=function(e){this.browser.setInAppMessageListener(e)},g.prototype.getExperiment=function(e){return this.browser.getExperiment(e)},g.prototype.getDisplayedInAppMessageView=function(){return this.browser.getDisplayedInAppMessageView()};var Es=g;function g(e,t){this.browser=e,this.app=t,this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.updatePushSubscriptions=this.updatePushSubscriptions.bind(this),this.updateSmsSubscriptions=this.updateSmsSubscriptions.bind(this),this.updateKakaoSubscriptions=this.updateKakaoSubscriptions.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.getDisplayedInAppMessageView=this.getDisplayedInAppMessageView.bind(this)}function ws(e){return e&&e.Math==Math&&e}function bs(e){try{return!!e()}catch(e){return!0}}function Ts(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function _s(e){return ua(aa(e),8,-1)}function Is(e){if(null==e)throw fa("Can't call method on "+e);return e}function As(e){return ha(da(e))}function Ns(e){return"function"==typeof e}function Os(e){return"object"==typeof e?null!==e:ya(e)}function Ps(e,t){return arguments.length<2?(r=va[e],ga(r)?r:void 0):va[e]&&va[e][t];var r}function Ss(e){try{return Oa(e)}catch(e){return"Object"}}function Ms(e){if(Pa(e))return e;throw Ma(Sa(e)+" is not a function")}function Rs(e,t){return null==(e=e[t])?void 0:Ra(e)}function Cs(t,r){try{La(Da,t,{value:r,configurable:!0,writable:!0})}catch(e){Da[t]=r}return r}function xs(e){return Ka(Ba(e))}function Us(e){return"Symbol("+(void 0===e?"":e)+")_"+qa(++Ya+Ja,36)}function ks(e){var t;return $a(eu,e)&&(Za||"string"==typeof eu[e])||(t="Symbol."+e,Za&&$a(tu,e)?eu[e]=tu[e]:eu[e]=(Qa&&ru?ru:nu)(t)),eu[e]}function Ds(e){return e=lu(e,"string"),fu(e)?e:e+""}function Ls(e){return du?hu.createElement(e):{}}function Fs(e){if(Iu(e))return e;throw Nu(Au(e)+" is not an object")}function Vs(e){return Bu[e]||(Bu[e]=ju(e))}function js(e,t,r,n){var i=(n=n||{}).enumerable,o=void 0!==n.name?n.name:t;if(sc(r)&&uc(r,o,n),n.global)i?e[t]=r:cc(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:ac.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}function Bs(e){return(e=+e)!=e||0==e?0:fc(e)}function Ks(e,t){return(e=hc(e))<0?dc(e+t,0):yc(e,t)}function Gs(e){return mc(e.length)}function Hs(a){return function(e,t,r){var n,i=Ec(e),o=bc(i),s=wc(r,o);if(a&&t!=t){for(;s<o;)if((n=i[s++])!=n)return!0}else for(;s<o;s++)if((a||s in i)&&i[s]===t)return a||s||0;return!a&&-1}}function zs(e,t){var r,n=_c(e),i=0,o=[];for(r in n)!Tc(Ac,r)&&Tc(n,r)&&Nc(o,r);for(;t.length>i;)!Tc(n,r=t[i++])||~Ic(o,r)||Nc(o,r);return o}function Ys(e,t,r){for(var n=Uc(t),i=Dc.f,o=kc.f,s=0;s<n.length;s++){var a=n[s];xc(e,a)||r&&xc(r,a)||i(e,a,o(t,a))}}function Js(e,t){return(e=Bc[jc(e)])==Gc||e!=Kc&&(Fc(t)?Lc(t):!!t)}function m(e,t){var r,n,i,o=e.target,s=e.global,a=e.stat,u=s?Hc:a?Hc[o]||qc(o,{}):(Hc[o]||{}).prototype;if(u)for(r in t){if(n=t[r],i=e.dontCallGetSet?(i=zc(u,r))&&i.value:u[r],!$c(s?r:o+(a?".":"#")+r,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;Wc(n,i)}(e.sham||i&&i.sham)&&Yc(n,"sham",!0),Jc(u,r,n,e)}}var qs,Ws,$s,Xs,Zs,Qs,ea,ta,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=ws("object"==typeof globalThis&&globalThis)||ws("object"==typeof window&&window)||ws("object"==typeof self&&self)||ws("object"==typeof t&&t)||function(){return this}()||Function("return this")(),e={},Q=!bs(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),r=!bs(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),ra=Function.prototype.call,G=r?ra.bind(ra):function(){return ra.apply(ra,arguments)},t={},E={}.propertyIsEnumerable,na=Object.getOwnPropertyDescriptor,w=na&&!E.call({1:2},1),w=(t.f=w?function(e){e=na(this,e);return!!e&&e.enumerable}:E,r),E=Function.prototype,ia=E.bind,oa=E.call,sa=w&&ia.bind(oa,oa),E=w?function(e){return e&&sa(e)}:function(e){return e&&function(){return oa.apply(e,arguments)}},ia=E,aa=ia({}.toString),ua=ia("".slice),w=bs,ca=_s,pa=Object,la=E("".split),ia=w(function(){return!pa("z").propertyIsEnumerable(0)})?function(e){return"String"==ca(e)?la(e,""):pa(e)}:pa,fa=TypeError,ha=ia,da=Is,ya=Ns,va=i,ga=Ns,w=E({}.isPrototypeOf),ma=Ps("navigator","userAgent")||"",Ea=ma,wa=i.process,ba=i.Deno,wa=wa&&wa.versions||ba&&ba.version,ba=wa&&wa.v8,wa=T=!(T=ba?0<(b=ba.split("."))[0]&&b[0]<4?1:+(b[0]+b[1]):T)&&Ea&&(!(b=Ea.match(/Edge\/(\d+)/))||74<=b[1])&&(b=Ea.match(/Chrome\/(\d+)/))?+b[1]:T,Ta=wa,ba=bs,Ea=!!Object.getOwnPropertySymbols&&!ba(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ta&&Ta<41}),b=Ea&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,_a=Ps,Ia=Ns,Aa=w,Na=Object,T=b?function(e){return"symbol"==typeof e}:function(e){var t=_a("Symbol");return Ia(t)&&Aa(t.prototype,Na(e))},Oa=String,Pa=Ns,Sa=Ss,Ma=TypeError,Ra=Ms,Ca=G,xa=Ns,Ua=Os,ka=TypeError,ba={exports:{}},Da=i,La=Object.defineProperty,Fa=Cs,Va="__core-js_shared__",Fa=i[Va]||Fa(Va,{}),ja=Fa,Ba=((ba.exports=function(e,t){return ja[e]||(ja[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"}),Is),Ka=Object,Ga=xs,Ha=E({}.hasOwnProperty),Va=Object.hasOwn||function(e,t){return Ha(Ga(e),t)},za=E,Ya=0,Ja=Math.random(),qa=za(1..toString),za=i,Wa=ba.exports,$a=Va,Xa=Us,Za=Ea,Qa=b,eu=Wa("wks"),tu=za.Symbol,ru=tu&&tu.for,nu=Qa?tu:tu&&tu.withoutSetter||Xa,iu=G,ou=Os,su=T,au=Rs,uu=function(e,t){var r,n;if("string"===t&&xa(r=e.toString)&&!Ua(n=Ca(r,e)))return n;if(xa(r=e.valueOf)&&!Ua(n=Ca(r,e)))return n;if("string"!==t&&xa(r=e.toString)&&!Ua(n=Ca(r,e)))return n;throw ka("Can't convert object to primitive value")},cu=TypeError,pu=ks("toPrimitive"),lu=function(e,t){if(!ou(e)||su(e))return e;var r=au(e,pu);if(r){if(r=iu(r,e,t=void 0===t?"default":t),!ou(r)||su(r))return r;throw cu("Can't convert object to primitive value")}return uu(e,t=void 0===t?"number":t)},fu=T,Ea=Os,hu=i.document,du=Ea(hu)&&Ea(hu.createElement),yu=Ls,b=!Q&&!bs(function(){return 7!=Object.defineProperty(yu("div"),"a",{get:function(){return 7}}).a}),vu=G,gu=t,mu=Ts,Eu=As,wu=Ds,bu=Va,Tu=b,_u=Object.getOwnPropertyDescriptor,Wa=(e.f=Q?_u:function(e,t){if(e=Eu(e),t=wu(t),Tu)try{return _u(e,t)}catch(e){}if(bu(e,t))return mu(!vu(gu.f,e,t),e[t])},{}),za=Q&&bs(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),Iu=Os,Au=String,Nu=TypeError,Ou=b,Pu=Fs,Su=Ds,Mu=TypeError,Ru=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,xu="enumerable",Uu="configurable",ku="writable",Xa=(Wa.f=Q?za?function(e,t,r){var n;return Pu(e),t=Su(t),Pu(r),"function"==typeof e&&"prototype"===t&&"value"in r&&ku in r&&!r[ku]&&((n=Cu(e,t))&&n[ku]&&(e[t]=r.value,r={configurable:(Uu in r?r:n)[Uu],enumerable:(xu in r?r:n)[xu],writable:!1})),Ru(e,t,r)}:Ru:function(e,t,r){if(Pu(e),t=Su(t),Pu(r),Ou)try{return Ru(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Mu("Accessors not supported");return"value"in r&&(e[t]=r.value),e},Q),Du=Wa,Lu=Ts,T=Xa?function(e,t,r){return Du.f(e,t,Lu(1,r))}:function(e,t,r){return e[t]=r,e},Ea={exports:{}},t=Q,b=Va,Xa=Function.prototype,_=t&&Object.getOwnPropertyDescriptor,b=b(Xa,"name"),b={EXISTS:b,PROPER:b&&"something"===function(){}.name,CONFIGURABLE:b&&(!t||_(Xa,"name").configurable)},t=Ns,_=Fa,Fu=E(Function.toString),Xa=(t(_.inspectSource)||(_.inspectSource=function(e){return Fu(e)}),_.inspectSource),t=Ns,_=Xa,Vu=i.WeakMap,t=t(Vu)&&/native code/.test(_(Vu)),_=ba.exports,ju=Us,Bu=_("keys"),Vu={},ba=E,Ku=Os,Gu=T,Hu=Va,_=Fa,zu=Vs,Yu=Vu,Ju="Object already initialized",qu=i.TypeError,Wu=i.WeakMap,t=(ea=t||_.state?(qs=_.state||(_.state=new Wu),Ws=ba(qs.get),$s=ba(qs.has),Xs=ba(qs.set),Zs=function(e,t){if($s(qs,e))throw new qu(Ju);return t.facade=e,Xs(qs,e,t),t},Qs=function(e){return Ws(qs,e)||{}},function(e){return $s(qs,e)}):(Yu[ta=zu("state")]=!0,Zs=function(e,t){if(Hu(e,ta))throw new qu(Ju);return t.facade=e,Gu(e,ta,t),t},Qs=function(e){return Hu(e,ta)?e[ta]:{}},function(e){return Hu(e,ta)}),{set:Zs,get:Qs,has:ea,enforce:function(e){return ea(e)?Qs(e):Zs(e,{})},getterFor:function(t){return function(e){if(Ku(e)&&(e=Qs(e)).type===t)return e;throw qu("Incompatible receiver, "+t+" required")}}}),_=bs,$u=Ns,Xu=Va,Zu=Q,Qu=b.CONFIGURABLE,ec=Xa,tc=t.enforce,rc=t.get,nc=Object.defineProperty,ic=Zu&&!_(function(){return 8!==nc(function(){},"length",{value:8}).length}),oc=String(String).split("String"),Wu=Ea.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Xu(e,"name")||Qu&&e.name!==t)&&(Zu?nc(e,"name",{value:t,configurable:!0}):e.name=t),ic&&r&&Xu(r,"arity")&&e.length!==r.arity&&nc(e,"length",{value:r.arity});try{r&&Xu(r,"constructor")&&r.constructor?Zu&&nc(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}r=tc(e);return Xu(r,"source")||(r.source=oc.join("string"==typeof t?t:"")),e},sc=(Function.prototype.toString=Wu(function(){return $u(this)&&rc(this).source||ec(this)},"toString"),Ns),ac=Wa,uc=Ea.exports,cc=Cs,ba={},pc=Math.ceil,lc=Math.floor,fc=Math.trunc||function(e){e=+e;return(0<e?lc:pc)(e)},hc=Bs,dc=Math.max,yc=Math.min,vc=Bs,gc=Math.min,mc=function(e){return 0<e?gc(vc(e),9007199254740991):0},Ec=As,wc=Ks,bc=Gs,Yu={includes:Hs(!0),indexOf:Hs(!1)},zu=E,Tc=Va,_c=As,Ic=Yu.indexOf,Ac=Vu,Nc=zu([].push),_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Oc=zs,Pc=_.concat("length","prototype"),Wu=(ba.f=Object.getOwnPropertyNames||function(e){return Oc(e,Pc)},{}),zu=(Wu.f=Object.getOwnPropertySymbols,Ps),Sc=ba,Mc=Wu,Rc=Fs,Cc=E([].concat),Wu=zu("Reflect","ownKeys")||function(e){var t=Sc.f(Rc(e)),r=Mc.f;return r?Cc(t,r(e)):t},xc=Va,Uc=Wu,kc=e,Dc=Wa,Lc=bs,Fc=Ns,Vc=/#|\.prototype\./,jc=Js.normalize=function(e){return String(e).replace(Vc,".").toLowerCase()},Bc=Js.data={},Kc=Js.NATIVE="N",Gc=Js.POLYFILL="P",zu=Js,Hc=i,zc=e.f,Yc=T,Jc=js,qc=Cs,Wc=Ys,$c=zu,Wu=!bs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Xc=Va,Zc=Ns,Qc=xs,ep=Vs("IE_PROTO"),tp=Object,rp=tp.prototype,Wu=Wu?tp.getPrototypeOf:function(e){e=Qc(e);if(Xc(e,ep))return e[ep];var t=e.constructor;return Zc(t)&&e instanceof t?t.prototype:e instanceof tp?rp:null},np=Ns,ip=String,op=TypeError,sp=E,ap=Fs,up=function(e){if("object"==typeof e||np(e))return e;throw op("Can't set "+ip(e)+" as a prototype")},cp=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=sp(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return ap(e),up(t),n?r(e,t):e.__proto__=t,e}}():void 0),pp={},lp=zs,fp=_,I=Object.keys||function(e){return lp(e,fp)},hp=Wa,dp=Fs,yp=As,vp=I;pp.f=Q&&!za?Object.defineProperties:function(e,t){dp(e);for(var r,n=yp(t),i=vp(t),o=i.length,s=0;s<o;)hp.f(e,r=i[s++],n[r]);return e};function gp(){}function mp(e){e.write(Vp("")),e.close();var t=e.parentWindow.Object;return e=null,t}function Ep(e,t){return Jp(e),void 0===t?e:qp?Wp(e,t):function(){return e.apply(t,arguments)}}function wp(e){return void 0!==e&&($p.Array===e||Zp[Xp]===e)}function bp(e){if(null!=e)return ol(e,al)||ol(e,"@@iterator")||sl[il(e)]}function Tp(e,t){if(t=arguments.length<2?fl(e):t,cl(t))return pl(ul(t,e));throw hl(ll(e)+" is not iterable")}function _p(e,t,r){var n,i;yl(e);try{if(!(n=vl(e,"return"))){if("throw"===t)throw r;return r}n=dl(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return yl(n),r}function Ip(e,t){this.stopped=e,this.result=t}function Ap(e,t,r){function n(e){return o&&Nl(o,"normal",e),new Ip(!0,e)}function i(e){return f?(El(e),y?v(e[0],e[1],n):v(e[0],e[1])):y?v(e,n):v(e)}var o,s,a,u,c,p,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),y=!(!r||!r.INTERRUPTED),v=gl(t,l);if(h)o=e.iterator;else if(d)o=e;else{if(!(r=Al(e)))throw Ol(wl(e)+" is not iterable");if(bl(r)){for(s=0,a=Tl(e);s<a;s++)if((u=i(e[s]))&&_l(Pl,u))return u;return new Ip(!1)}o=Il(e,r)}for(c=(h?e:o).next;!(p=ml(c,o)).done;){try{u=i(p.value)}catch(e){Nl(o,"throw",e)}if("object"==typeof u&&u&&_l(Pl,u))return u}return new Ip(!1)}function Np(e){if("Symbol"===Sl(e))throw TypeError("Cannot convert a Symbol value to a string");return Ml(e)}function Op(e,t){var r,n=2<arguments.length?arguments[2]:void 0,i=xl(ql,this);return kl?r=kl(new Yl,i?Ul(this):ql):(r=i?this:Ll(ql),Fl(r,zl,"Error")),void 0!==t&&Fl(r,"message",Gl(t)),Hl&&Fl(r,"stack",jl(r.stack,1)),Bl(r,n),Kl(e,Jl,{that:i=[]}),Fl(r,"errors",i),r}function Pp(e){$l[Wl][e]=!0}var Sp,Mp,I=Ps("document","documentElement"),Rp=Fs,Cp=pp,xp=_,za=Vu,Up=I,kp=Ls,Dp="prototype",Lp="script",Fp=Vs("IE_PROTO"),Vp=function(e){return"<"+Lp+">"+e+"</"+Lp+">"},jp=function(){try{Sp=new ActiveXObject("htmlfile")}catch(e){}jp="undefined"==typeof document||document.domain&&Sp?mp(Sp):(e=kp("iframe"),t="java"+Lp+":",e.style.display="none",Up.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(Vp("document.F=Object")),t.close(),t.F);for(var e,t,r=xp.length;r--;)delete jp[Dp][xp[r]];return jp()},pp=(za[Fp]=!0,Object.create||function(e,t){var r;return null!==e?(gp[Dp]=Rp(e),r=new gp,gp[Dp]=null,r[Fp]=e):r=jp(),void 0===t?r:Cp.f(r,t)}),Bp=Error,Kp=E("".replace),_=String(Bp("zxcasd").stack),Gp=/\n\s*at [^:]*:[^\n]*/,Hp=Gp.test(_),zp=Os,Yp=T,Jp=Ms,qp=r,Wp=E(E.bind),za={},$p=za,Xp=ks("iterator"),Zp=Array.prototype,_={},_=(_[ks("toStringTag")]="z","[object z]"===String(_)),A=_,Qp=Ns,el=_s,tl=ks("toStringTag"),rl=Object,nl="Arguments"==el(function(){return arguments}()),A=A?el:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=rl(e),tl))?t:nl?el(e):"Object"==(t=el(e))&&Qp(e.callee)?"Arguments":t},il=A,ol=Rs,sl=za,al=ks("iterator"),ul=G,cl=Ms,pl=Fs,ll=Ss,fl=bp,hl=TypeError,dl=G,yl=Fs,vl=Rs,gl=Ep,ml=G,El=Fs,wl=Ss,bl=wp,Tl=Gs,_l=w,Il=Tp,Al=bp,Nl=_p,Ol=TypeError,Pl=Ip.prototype,Sl=A,Ml=String,Rl=Np,Cl=Ts,N=!bs(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",Cl(1,7)),7!==e.stack)}),O=m,xl=w,Ul=Wu,kl=cp,Dl=Ys,Ll=pp,Fl=T,Vl=Ts,jl=function(e,t){if(Hp&&"string"==typeof e&&!Bp.prepareStackTrace)for(;t--;)e=Kp(e,Gp,"");return e},Bl=function(e,t){zp(t)&&"cause"in t&&Yp(e,"cause",t.cause)},Kl=Ap,Gl=function(e,t){return void 0===e?arguments.length<2?"":t:Rl(e)},Hl=N,zl=ks("toStringTag"),Yl=Error,Jl=[].push,ql=(kl?kl(Op,Yl):Dl(Op,Yl,{name:!0}),Op.prototype=Ll(Yl.prototype,{constructor:Vl(1,Op),message:Vl(1,""),name:Vl(1,"AggregateError")})),N=(O({global:!0,constructor:!0,arity:2},{AggregateError:Op}),ks),Dl=pp,Vl=Wa.f,Wl=N("unscopables"),$l=Array.prototype,O=(null==$l[Wl]&&Vl($l,Wl,{configurable:!0,value:Dl(null)}),bs),N=Ns,Vl=Wu,Dl=js,Xl=ks("iterator"),Zl=!1;[].keys&&("next"in(P=[].keys())?(Vl=Vl(Vl(P)))!==Object.prototype&&(Mp=Vl):Zl=!0);function Ql(e,t,r){(e=e&&!r?e.prototype:e)&&!of(e,sf)&&nf(e,sf,{configurable:!0,value:t})}function ef(){return this}function tf(){return this}function rf(e,t,r,n,i,o,s){function a(e){if(e===i&&h)return h;if(!Af&&e in l)return l[e];switch(e){case"keys":case Of:case Pf:return function(){return new r(this,e)}}return function(){return new r(this)}}yf(r,t,n);var u,c,n=t+" Iterator",p=!1,l=e.prototype,f=l[Nf]||l["@@iterator"]||i&&l[i],h=!Af&&f||a(i),d="Array"==t&&l.entries||f;if(d&&(d=vf(d.call(new e)))!==Object.prototype&&d.next&&(vf(d)!==If&&(gf?gf(d,If):df(d[Nf])||wf(d,Nf,tf)),mf(d,n,!0)),Tf&&i==Of&&f&&f.name!==Of&&(_f?Ef(l,"name",Of):(p=!0,h=function(){return hf(f,this)})),i)if(u={values:a(Of),keys:o?h:a("keys"),entries:a(Pf)},s)for(c in u)!Af&&!p&&c in l||wf(l,c,u[c]);else ff({target:t,proto:!0,forced:Af||p},u);return l[Nf]!==h&&wf(l,Nf,h,{name:i}),bf[t]=h,u}N((Mp=null==Mp||O(function(){var e={};return Mp[Xl].call(e)!==e})?{}:Mp)[Xl])||Dl(Mp,Xl,function(){return this});var P={IteratorPrototype:Mp,BUGGY_SAFARI_ITERATORS:Zl},nf=Wa.f,of=Va,sf=ks("toStringTag"),af=P.IteratorPrototype,uf=pp,cf=Ts,pf=Ql,lf=za,ff=m,hf=G,df=Ns,yf=function(e,t,r,n){t+=" Iterator";return e.prototype=uf(af,{next:cf(+!n,r)}),pf(e,t,!1),lf[t]=ef,e},vf=Wu,gf=cp,mf=Ql,Ef=T,wf=js,Vl=ks,bf=za,Tf=b.PROPER,_f=b.CONFIGURABLE,If=P.IteratorPrototype,Af=P.BUGGY_SAFARI_ITERATORS,Nf=Vl("iterator"),Of="values",Pf="entries",Sf=As,N=Pp,O=za,Dl=t,Zl=Wa.f,b=rf,P=Q,Mf="Array Iterator",Rf=Dl.set,Cf=Dl.getterFor(Mf),Vl=b(Array,"Array",function(e,t){Rf(this,{type:Mf,target:Sf(e),index:0,kind:t})},function(){var e=Cf(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),za=O.Arguments=O.Array;if(N("keys"),N("values"),N("entries"),P&&"values"!==za.name)try{Zl(za,"name",{value:"values"})}catch(e){}var xf=A;_||js(Object.prototype,"toString",_?{}.toString:function(){return"[object "+xf(this)+"]"},{unsafe:!0});function Uf(e){var e=Kf(e),t=Gf.f;Hf&&e&&!e[zf]&&t(e,zf,{configurable:!0,get:function(){return this}})}function kf(e,t){if(Yf(t,e))return e;throw Jf("Incorrect invocation")}function Df(){}function Lf(e){if(!qf(e))return!1;try{return Zf(Df,Xf,e),!0}catch(e){return!1}}function Ff(e){if(!qf(e))return!1;switch(Wf(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return th||!!eh(Qf,$f(e))}catch(e){return!0}}function Vf(e,t){return void 0===(e=oh(e).constructor)||null==(e=oh(e)[ah])?t:sh(e)}var jf,Bf,Dl="process"==_s(i.process),Kf=Ps,Gf=Wa,Hf=Q,zf=ks("species"),Yf=w,Jf=TypeError,b=E,O=bs,qf=Ns,Wf=A,$f=Xa,Xf=[],Zf=Ps("Reflect","construct"),Qf=/^\s*(?:class|function)\b/,eh=b(Qf.exec),th=!Qf.exec(Df),N=(Ff.sham=!0,!Zf||O(function(){var e;return Lf(Lf.call)||!Lf(Object)||!Lf(function(){e=!0})||e})?Ff:Lf),rh=N,nh=Ss,ih=TypeError,oh=Fs,sh=function(e){if(rh(e))return e;throw ih(nh(e)+" is not a constructor")},ah=ks("species"),P=Function.prototype,uh=P.apply,ch=P.call,Zl="object"==typeof Reflect&&Reflect.apply||(r?ch.bind(uh):function(){return ch.apply(uh,arguments)}),za=E([].slice),ph=TypeError,_=/(?:ipad|iphone|ipod).*applewebkit/i.test(ma),lh=i,fh=Zl,w=Ep,hh=Ns,dh=Va,A=bs,yh=I,vh=za,gh=Ls,mh=function(e,t){if(e<t)throw ph("Not enough arguments");return e},b=_,O=Dl,P=lh.setImmediate,r=lh.clearImmediate,Eh=lh.process,wh=lh.Dispatch,bh=lh.Function,I=lh.MessageChannel,Th=lh.String,_h=0,Ih={},Ah="onreadystatechange";try{jf=lh.location}catch(e){}function Nh(e){return function(){Gh(e)}}function Oh(e){Gh(e.data)}function Ph(e){lh.postMessage(Th(e),jf.protocol+"//"+jf.host)}function Sh(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}function Mh(){this.head=null,this.tail=null}function Rh(e){var r,n;this.promise=new e(function(e,t){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=e,n=t}),this.resolve=rd(r),this.reject=rd(n)}function Ch(e,t){var r,n,i,o,s=t.value,a=t.state==Md,u=a?e.ok:e.fail,c=e.resolve,p=e.reject,l=e.domain;try{u?(a||(t.rejection===xd&&(o=t,od(ld,id,function(){var e=o.facade;nd?Id.emit("rejectionHandled",e):Dd(Sd,e,o.value)})),t.rejection=Cd),!0===u?r=s:(l&&l.enter(),r=u(s),l&&(l.exit(),i=!0)),r===e.promise?p(Td("Promise-chain cycle")):(n=Ud(r))?od(n,r,c,p):c(r)):p(s)}catch(e){l&&!i&&l.exit(),p(e)}}var xh,Uh,kh,Dh,Lh,Fh,Vh,jh,Bh,Kh,Gh=function(e){var t;dh(Ih,e)&&(t=Ih[e],delete Ih[e],t())},I=(P&&r||(P=function(e){mh(arguments.length,1);var t=hh(e)?e:bh(e),r=vh(arguments,1);return Ih[++_h]=function(){fh(t,void 0,r)},Bf(_h),_h},r=function(e){delete Ih[e]},O?Bf=function(e){Eh.nextTick(Nh(e))}:wh&&wh.now?Bf=function(e){wh.now(Nh(e))}:I&&!b?(b=(O=new I).port2,O.port1.onmessage=Oh,Bf=w(b.postMessage,b)):lh.addEventListener&&hh(lh.postMessage)&&!lh.importScripts&&jf&&"file:"!==jf.protocol&&!A(Ph)?(Bf=Ph,lh.addEventListener("message",Oh,!1)):Bf=Ah in gh("script")?function(e){yh.appendChild(gh("script"))[Ah]=function(){yh.removeChild(this),Gh(e)}}:function(e){setTimeout(Nh(e),0)}),{set:P,clear:r}),O=i,w=/ipad|iphone|ipod/i.test(ma)&&void 0!==O.Pebble,b=/web0s(?!.*chrome)/i.test(ma),A=i,P=Ep,r=e.f,Hh=I.set,O=_,e=w,_=b,zh=Dl,w=A.MutationObserver||A.WebKitMutationObserver,b=A.document,Yh=A.process,S=A.Promise,r=r(A,"queueMicrotask"),r=r&&r.value,_=(r||(xh=function(){var e,t;for(zh&&(e=Yh.domain)&&e.exit();Uh;){t=Uh.fn,Uh=Uh.next;try{t()}catch(e){throw Uh?Dh():kh=void 0,e}}kh=void 0,e&&e.enter()},Dh=O||zh||_||!w||!b?!e&&S&&S.resolve?((O=S.resolve(void 0)).constructor=S,Vh=P(O.then,O),function(){Vh(xh)}):zh?function(){Yh.nextTick(xh)}:(Hh=P(Hh,A),function(){Hh(xh)}):(Lh=!0,Fh=b.createTextNode(""),new w(xh).observe(Fh,{characterData:!0}),function(){Fh.data=Lh=!Lh})),r||function(e){e={fn:e,next:void 0};kh&&(kh.next=e),Uh||(Uh=e,Dh()),kh=e}),Jh=i,e=(Mh.prototype={add:function(e){e={item:e,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},Mh),S=i.Promise,O="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,P=!O&&!Dl&&"object"==typeof window&&"object"==typeof document,A=i,qh=S,b=Ns,w=zu,Wh=Xa,r=ks,$h=P,Xh=O,Zh=wa,Qh=(qh&&qh.prototype,r("species")),ed=!1,td=b(A.PromiseRejectionEvent),Xa={CONSTRUCTOR:w("Promise",function(){var e=Wh(qh),t=e!==String(qh);if(!t&&66===Zh)return!0;if(!Zh||Zh<51||!/native code/.test(e)){var e=new qh(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((e.constructor={})[Qh]=r,!(ed=e.then(function(){})instanceof r))return!0}return!t&&($h||Xh)&&!td}),REJECTION_EVENT:td,SUBCLASSING:ed},P={},rd=Ms,O=(P.f=function(e){return new Rh(e)},m),nd=Dl,id=i,od=G,r=js,b=cp,A=Ql,w=Uf,sd=Ms,ad=Ns,ud=Os,cd=kf,pd=Vf,ld=I.set,fd=_,hd=function(e,t){var r=Jh.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},dd=Sh,yd=e,I=t,_=S,e=P,vd="Promise",M=Xa.CONSTRUCTOR,gd=Xa.REJECTION_EVENT,R=Xa.SUBCLASSING,md=I.getterFor(vd),Ed=I.set,I=_&&_.prototype,wd=_,bd=I,Td=id.TypeError,_d=id.document,Id=id.process,Ad=e.f,Nd=Ad,Od=!!(_d&&_d.createEvent&&id.dispatchEvent),Pd="unhandledrejection",Sd="rejectionhandled",Md=1,Rd=2,Cd=1,xd=2,Ud=function(e){var t;return!(!ud(e)||!ad(t=e.then))&&t},kd=function(r,i){r.notified||(r.notified=!0,fd(function(){for(var e,n,t=r.reactions;e=t.get();)Ch(e,r);r.notified=!1,i&&!r.rejection&&(n=r,od(ld,id,function(){var e=n.facade,t=n.value,r=Ld(n);if(r&&(r=dd(function(){nd?Id.emit("unhandledRejection",t,e):Dd(Pd,e,t)}),n.rejection=nd||Ld(n)?xd:Cd,r.error))throw r.value}))}))},Dd=function(e,t,r){var n;Od?((n=_d.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),id.dispatchEvent(n)):n={promise:t,reason:r},!gd&&(t=id["on"+e])?t(n):e===Pd&&hd("Unhandled promise rejection",r)},Ld=function(e){return e.rejection!==Cd&&!e.parent},Fd=function(t,r,n){return function(e){t(r,e,n)}},Vd=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=Rd,kd(e,!0))},jd=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw Td("Promise can't be resolved itself");var n=Ud(e);n?fd(function(){var t={done:!1};try{od(n,e,Fd(jd,t,r),Fd(Vd,t,r))}catch(e){Vd(t,e,r)}}):(r.value=e,r.state=Md,kd(r,!1))}catch(e){Vd({done:!1},e,r)}}};if(M&&(bd=(wd=function(e){cd(this,bd),sd(e),od(jh,this);var t=md(this);try{e(Fd(jd,t),Fd(Vd,t))}catch(e){Vd(t,e)}}).prototype,(jh=function(e){Ed(this,{type:vd,done:!1,notified:!1,parent:!1,reactions:new yd,rejection:!1,state:0,value:void 0})}).prototype=r(bd,"then",function(e,t){var r=md(this),n=Ad(pd(this,wd));return r.parent=!0,n.ok=!ad(e)||e,n.fail=ad(t)&&t,n.domain=nd?Id.domain:void 0,0==r.state?r.reactions.add(n):fd(function(){Ch(n,r)}),n.promise}),Bh=function(){var e=new jh,t=md(e);this.promise=e,this.resolve=Fd(jd,t),this.reject=Fd(Vd,t)},e.f=Ad=function(e){return e===wd||void 0===e?new Bh:Nd(e)},ad(_)&&I!==Object.prototype)){Kh=I.then,R||r(I,"then",function(e,t){var r=this;return new wd(function(e,t){od(Kh,r,e,t)}).then(e,t)},{unsafe:!0});try{delete I.constructor}catch(e){}b&&b(I,bd)}O({global:!0,constructor:!0,wrap:!0,forced:M},{Promise:wd}),A(wd,vd,!1),w(vd);var Bd=ks("iterator"),Kd=!1;try{var Gd=0,C={next:function(){return{done:!!Gd++}},return:function(){Kd=!0}};C[Bd]=function(){return this},Array.from(C,function(){throw 2})}catch(e){}function Hd(e,t){if(!t&&!Kd)return!1;var r=!1;try{var n={};n[Bd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}var zd=S,e=Hd,_=Xa.CONSTRUCTOR||!e(function(e){zd.all(e).then(void 0,function(){})}),Yd=G,Jd=Ms,qd=P,Wd=Sh,$d=Ap,R=(m({target:"Promise",stat:!0,forced:_},{all:function(e){var a=this,t=qd.f(a),u=t.resolve,c=t.reject,r=Wd(function(){var n=Jd(a.resolve),i=[],o=0,s=1;$d(e,function(e){var t=o++,r=!1;s++,Yd(n,a,e).then(function(e){r||(r=!0,i[t]=e,--s||u(i))},c)}),--s||u(i)});return r.error&&c(r.value),t.promise}}),m),r=S,b=Ps,I=Ns,O=js,M=r&&r.prototype;R({target:"Promise",proto:!0,forced:Xa.CONSTRUCTOR,real:!0},{catch:function(e){return this.then(void 0,e)}}),I(r)&&(A=b("Promise").prototype.catch,M.catch!==A&&O(M,"catch",A,{unsafe:!0}));var Xd=G,Zd=Ms,Qd=P,ey=Sh,ty=Ap;m({target:"Promise",stat:!0,forced:_},{race:function(e){var r=this,n=Qd.f(r),i=n.reject,t=ey(function(){var t=Zd(r.resolve);ty(e,function(e){Xd(t,r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}});function ry(e,t){return oy(e),sy(t)&&t.constructor===e?t:((0,(e=ay.f(e)).resolve)(t),e.promise)}var ny=G,iy=P,oy=(m({target:"Promise",stat:!0,forced:Xa.CONSTRUCTOR},{reject:function(e){var t=iy.f(this);return ny(t.reject,void 0,e),t.promise}}),Fs),sy=Os,ay=P,w=m,C=Ps,e=Xa.CONSTRUCTOR,uy=ry;C("Promise"),w({target:"Promise",stat:!0,forced:e},{resolve:function(e){return uy(this,e)}});var cy=G,py=Ms,ly=P,fy=Sh,hy=Ap;m({target:"Promise",stat:!0},{allSettled:function(e){var a=this,t=ly.f(a),u=t.resolve,r=t.reject,n=fy(function(){var n=py(a.resolve),i=[],o=0,s=1;hy(e,function(e){var t=o++,r=!1;s++,cy(n,a,e).then(function(e){r||(r=!0,i[t]={status:"fulfilled",value:e},--s||u(i))},function(e){r||(r=!0,i[t]={status:"rejected",reason:e},--s||u(i))})}),--s||u(i)});return n.error&&r(n.value),t.promise}});function dy(i){return function(e,t){var r,e=Py(Sy(e)),t=Oy(t),n=e.length;return t<0||n<=t?i?"":void 0:(r=Ry(e,t))<55296||56319<r||t+1===n||(n=Ry(e,t+1))<56320||57343<n?i?My(e,t):r:i?Cy(e,t,t+2):n-56320+(r-55296<<10)+65536}}var yy=G,vy=Ms,gy=Ps,my=P,Ey=Sh,wy=Ap,by="No one promise resolved",R=(m({target:"Promise",stat:!0},{any:function(e){var u=this,c=gy("AggregateError"),t=my.f(u),p=t.resolve,l=t.reject,r=Ey(function(){var n=vy(u.resolve),i=[],o=0,s=1,a=!1;wy(e,function(e){var t=o++,r=!1;s++,yy(n,u,e).then(function(e){r||a||(a=!0,p(e))},function(e){r||a||(r=!0,i[t]=e,--s||l(new c(i,by)))})}),--s||l(new c(i,by))});return r.error&&l(r.value),t.promise}}),m),I=S,r=bs,Ty=Ps,_y=Ns,Iy=Vf,Ay=ry,b=js,Ny=I&&I.prototype,M=(R({target:"Promise",proto:!0,real:!0,forced:!!I&&r(function(){Ny.finally.call({then:function(){}},function(){})})},{finally:function(t){var r=Iy(this,Ty("Promise")),e=_y(t);return this.then(e?function(e){return Ay(r,t()).then(function(){return e})}:t,e?function(e){return Ay(r,t()).then(function(){throw e})}:t)}}),_y(I)&&(O=Ty("Promise").prototype.finally,Ny.finally!==O&&b(Ny,"finally",O,{unsafe:!0})),E),Oy=Bs,Py=Np,Sy=Is,My=M("".charAt),Ry=M("".charCodeAt),Cy=M("".slice),xy={codeAt:dy(!1),charAt:dy(!0)}.charAt,Uy=Np,A=t,_=rf,ky="String Iterator",Dy=A.set,Ly=A.getterFor(ky);_(String,"String",function(e){Dy(this,{type:ky,string:Uy(e),index:0})},function(){var e=Ly(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=xy(t,r),e.index+=t.length,{value:t,done:!1})});function Fy(t,e){if(t){if(t[Hy]!==Yy)try{Gy(t,Hy,Yy)}catch(e){t[Hy]=Yy}if(t[zy]||Gy(t,zy,e),By[e])for(var r in Ky)if(t[r]!==Ky[r])try{Gy(t,r,Ky[r])}catch(e){t[r]=Ky[r]}}}var Vy,Xa=i,C=Xa.Promise,w=Ls("span").classList,e=w&&w.constructor&&w.constructor.prototype,S=e===Object.prototype?void 0:e,jy=i,By={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},R=S,Ky=Vl,Gy=T,r=ks,Hy=r("iterator"),zy=r("toStringTag"),Yy=Ky.values;for(Vy in By)Fy(jy[Vy]&&jy[Vy].prototype,Vy);Fy(R,"DOMTokenList");var I,b,O=b=I=C,M,Jy=P,qy=Sh,Wy=((M=m)({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=Jy.f(this),e=qy(e);return(e.error?t.reject:t.resolve)(e.value),t.promise}}),Fs),$y=_p,Xy=Ds,Zy=Wa,Qy=Ts,A,ev=Ep,tv=G,rv=xs,nv=function(t,e,r,n){try{return n?e(Wy(r)[0],r[1]):e(r)}catch(e){$y(t,"throw",e)}},iv=wp,ov=N,sv=Gs,av=A=function(e,t,r){t=Xy(t);t in e?Zy.f(e,t,Qy(0,r)):e[t]=r},uv=Tp,cv=bp,pv=Array,_=m,w=function(e){var t,r,n,i,o,s,a=rv(e),e=ov(this),u=arguments.length,c=1<u?arguments[1]:void 0,p=void 0!==c,u=(p&&(c=ev(c,2<u?arguments[2]:void 0)),cv(a)),l=0;if(!u||this===pv&&iv(u))for(t=sv(a),r=e?new this(t):pv(t);l<t;l++)s=p?c(a[l],l):a[l],av(r,l,s);else for(o=(i=uv(a,u)).next,r=e?new this:[];!(n=tv(o,i)).done;l++)s=p?nv(i,c,[n.value,l],!0):n.value,av(r,l,s);return r.length=l,r},e,S=!(e=Hd)(function(e){Array.from(e)}),lv=(_({target:"Array",stat:!0,forced:S},{from:w}),_s),Vl=Array.isArray||function(e){return"Array"==lv(e)},T,r,R=((T=m)({target:"Array",stat:!0},{isArray:r=Vl}),m),C=bs,fv=N,hv=A,dv=Array,I=C(function(){function e(){}return!(dv.of.call(e)instanceof e)}),yv=(R({target:"Array",stat:!0,forced:I},{of:function(){for(var e=0,t=arguments.length,r=new(fv(this)?this:dv)(t);e<t;)hv(r,e,arguments[e++]);return r.length=t,r}}),xs),vv=Gs,gv=Bs,b=Pp,mv=(m({target:"Array",proto:!0},{at:function(e){var t=yv(this),r=vv(t),e=gv(e),e=0<=e?e:r+e;return e<0||r<=e?void 0:t[e]}}),b("at"),TypeError),O=function(e){if(9007199254740991<e)throw mv("Maximum allowed index exceeded");return e},Ev=Vl,wv=N,bv=Os,Tv=ks("species"),_v=Array,Iv=function(e){var t;return Ev(e)&&(t=e.constructor,(wv(t)&&(t===_v||Ev(t.prototype))||bv(t)&&null===(t=t[Tv]))&&(t=void 0)),void 0===t?_v:t},P=function(e,t){return new(Iv(e))(0===t?0:t)},Av=bs,Nv=wa,Ov=ks("species"),M,e=m,_=bs,Pv=Vl,Sv=Os,Mv=xs,Rv=Gs,Cv=O,xv=A,Uv=P,S=M=function(t){return 51<=Nv||!Av(function(){var e=[];return(e.constructor={})[Ov]=function(){return{foo:1}},1!==e[t](Boolean).foo})},w=wa,kv=ks("isConcatSpreadable"),T=51<=w||!_(function(){var e=[];return e[kv]=!1,e.concat()[0]!==e}),r=S("concat"),Dv=(e({target:"Array",proto:!0,arity:1,forced:!T||!r},{concat:function(e){for(var t,r,n,i=Mv(this),o=Uv(i,0),s=0,a=-1,u=arguments.length;a<u;a++)if(function(e){if(!Sv(e))return!1;var t=e[kv];return void 0!==t?!!t:Pv(e)}(n=-1===a?i:arguments[a]))for(r=Rv(n),Cv(s+r),t=0;t<r;t++,s++)t in n&&xv(o,s,n[t]);else Cv(s+1),xv(o,s++,n);return o.length=s,o}}),Ss),Lv=TypeError,C,Fv=xs,Vv=Ks,jv=Gs,Bv=C=function(e,t){if(!delete e[t])throw Lv("Cannot delete property "+Dv(t)+" of "+Dv(e))},Kv=Math.min,R=Pp,Gv=(m({target:"Array",proto:!0},{copyWithin:[].copyWithin||function(e,t){var r=Fv(this),n=jv(r),i=Vv(e,n),o=Vv(t,n),e=2<arguments.length?arguments[2]:void 0,s=Kv((void 0===e?n:Vv(e,n))-o,n-i),a=1;for(o<i&&i<o+s&&(a=-1,o+=s-1,i+=s-1);0<s--;)o in r?r[i]=r[o]:Bv(r,i),i+=a,o+=a;return r}}),R("copyWithin"),Ep),Hv=ia,zv=xs,Yv=Gs,Jv=P,qv=E([].push),I,b={forEach:(I=function(f){var h=1==f,d=2==f,y=3==f,v=4==f,g=6==f,m=7==f,E=5==f||g;return function(e,t,r,n){for(var i,o,s=zv(e),a=Hv(s),u=Gv(t,r),c=Yv(a),p=0,t=n||Jv,l=h?t(e,c):d||m?t(e,0):void 0;p<c;p++)if((E||p in a)&&(o=u(i=a[p],p,s),f))if(h)l[p]=o;else if(o)switch(f){case 3:return!0;case 5:return i;case 6:return p;case 2:qv(l,i)}else switch(f){case 4:return!1;case 7:qv(l,i)}return g?-1:y||v?v:l}})(0),map:I(1),filter:I(2),some:I(3),every:I(4),find:I(5),findIndex:I(6),filterReject:I(7)},Wv=bs,w=function(e,t){var r=[][e];return!!r&&Wv(function(){r.call(null,t||function(){return 1},1)})},_=m,$v=b.every,Xv=(_({target:"Array",proto:!0,forced:!w("every")},{every:function(e){return $v(this,e,1<arguments.length?arguments[1]:void 0)}}),xs),Zv=Ks,Qv=Gs,S=Pp,e=(m({target:"Array",proto:!0},{fill:function(e){for(var t=Xv(this),r=Qv(t),n=arguments.length,i=Zv(1<n?arguments[1]:void 0,r),n=2<n?arguments[2]:void 0,o=void 0===n?r:Zv(n,r);i<o;)t[i++]=e;return t}}),S("fill"),m),eg=b.filter,T=(e({target:"Array",proto:!0,forced:!M("filter")},{filter:function(e){return eg(this,e,1<arguments.length?arguments[1]:void 0)}}),m),tg=b.find,r=Pp,R,rg=!0,I=((R="find")in[]&&Array(1)[R](function(){rg=!1}),T({target:"Array",proto:!0,forced:rg},{find:function(e){return tg(this,e,1<arguments.length?arguments[1]:void 0)}}),r(R),m),ng=b.findIndex,_=Pp,S,ig=!0,og=((S="findIndex")in[]&&Array(1)[S](function(){ig=!1}),I({target:"Array",proto:!0,forced:ig},{findIndex:function(e){return ng(this,e,1<arguments.length?arguments[1]:void 0)}}),_(S),Ep),sg=ia,ag=xs,ug=Gs,e,T={findLast:(e=function(u){var c=1==u;return function(e,t,r){for(var n,i=ag(e),o=sg(i),s=og(t,r),a=ug(o);0<a--;)if(s(n=o[a],a,i))switch(u){case 0:return n;case 1:return a}return c?-1:void 0}})(0),findLastIndex:e(1)},r=m,cg=T.findLast,R=Pp,I=(r({target:"Array",proto:!0},{findLast:function(e){return cg(this,e,1<arguments.length?arguments[1]:void 0)}}),R("findLast"),m),pg=T.findLastIndex,_=Pp,lg=(I({target:"Array",proto:!0},{findLastIndex:function(e){return pg(this,e,1<arguments.length?arguments[1]:void 0)}}),_("findLastIndex"),Vl),fg=Gs,hg=O,dg=Ep,yg=function(e,t,r,n,i,o,s,a){for(var u,c,p=i,l=0,f=!!s&&dg(s,a);l<n;)l in r&&(u=f?f(r[l],l,t):r[l],0<o&&lg(u)?(c=fg(u),p=yg(e,t,u,c,p,o-1)-1):(hg(p+1),e[p]=u),p++),l++;return p},S,vg=S=yg,gg=xs,mg=Gs,Eg=Bs,wg=P;m({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=gg(this),r=mg(t),n=wg(t,0);return n.length=vg(n,t,t,r,0,void 0===e?1:Eg(e)),n}});function bg(c){return function(e,t,r,n){Jg(t);var i=qg(e),o=Wg(i),s=$g(i),a=c?s-1:0,u=c?-1:1;if(r<2)for(;;){if(a in o){n=o[a],a+=u;break}if(a+=u,c?a<0:s<=a)throw Xg("Reduce of empty array with no initial value")}for(;c?0<=a:a<s;a+=u)a in o&&(n=t(n,o[a],a,i));return n}}function Tg(e,t,r){for(var n=ym(e),i=dm(t,n),o=dm(void 0===r?n:r,n),s=gm(mm(o-i,0)),a=0;i<o;i++,a++)vm(s,a,e[i]);return s.length=a,s}function _g(e,t){var r=e.length,n=wm(r/2);if(r<8){for(var i,o,s=e,a=t,u=s.length,c=1;c<u;){for(i=s[o=c];o&&0<a(s[o-1],i);)s[o]=s[--o];o!==c++&&(s[o]=i)}return s}for(var p=e,l=_g(Em(e,0,n),t),f=_g(Em(e,n),t),h=t,d=l.length,y=f.length,v=0,g=0;v<d||g<y;)p[v+g]=v<d&&g<y?h(l[v],f[g])<=0?l[v++]:f[g++]:v<d?l[v++]:f[g++];return p}var Ig=S,Ag=Ms,Ng=xs,Og=Gs,Pg=P,Sg=(m({target:"Array",proto:!0},{flatMap:function(e){var t,r=Ng(this),n=Og(r);return Ag(e),(t=Pg(r,0)).length=Ig(t,r,r,n,0,1,e,1<arguments.length?arguments[1]:void 0),t}}),b.forEach),e=w("forEach")?[].forEach:function(e){return Sg(this,e,1<arguments.length?arguments[1]:void 0)},r=(m({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e}),m),Mg=Yu.includes,R=Pp,T=(r({target:"Array",proto:!0,forced:bs(function(){return!Array(1).includes()})},{includes:function(e){return Mg(this,e,1<arguments.length?arguments[1]:void 0)}}),R("includes"),m),I=E,Rg=Yu.indexOf,_=w,Cg=I([].indexOf),xg=!!Cg&&1/Cg([1],1,-0)<0,S=_("indexOf"),e=(T({target:"Array",proto:!0,forced:xg||!S},{indexOf:function(e){var t=1<arguments.length?arguments[1]:void 0;return xg?Cg(this,e,t)||0:Rg(this,e,t)}}),m),r=ia,Ug=As,R=w,kg=E([].join),Yu=r!=Object,I=R("join",","),Dg=(e({target:"Array",proto:!0,forced:Yu||!I},{join:function(e){return kg(Ug(this),void 0===e?",":e)}}),Zl),Lg=As,Fg=Bs,Vg=Gs,_=w,jg=Math.min,Bg=[].lastIndexOf,Kg=!!Bg&&1/[1].lastIndexOf(1,-0)<0,T=_("lastIndexOf"),S=Kg||!T?function(e){if(Kg)return Dg(Bg,this,arguments)||0;var t=Lg(this),r=Vg(t),n=r-1;for((n=1<arguments.length?jg(n,Fg(arguments[1])):n)<0&&(n=r+n);0<=n;n--)if(n in t&&t[n]===e)return n||0;return-1}:Bg,r=(m({target:"Array",proto:!0,forced:S!==[].lastIndexOf},{lastIndexOf:S}),m),Gg=b.map,R=(r({target:"Array",proto:!0,forced:!M("map")},{map:function(e){return Gg(this,e,1<arguments.length?arguments[1]:void 0)}}),m),Hg=xs,zg=Gs,Yg=O,e=bs(function(){return 4294967297!==[].push.call({length:4294967296},1)}),Yu=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}(),Jg=(R({target:"Array",proto:!0,arity:1,forced:e||Yu},{push:function(e){var t=Hg(this),r=zg(t),n=arguments.length;Yg(r+n);for(var i=0;i<n;i++)t[r]=arguments[i],r++;return t.length=r}}),Ms),qg=xs,Wg=ia,$g=Gs,Xg=TypeError,I={left:bg(!1),right:bg(!0)},Zl=m,Zg=I.left,_=wa,T=Dl,S=(Zl({target:"Array",proto:!0,forced:!w("reduce")||!T&&79<_&&_<83},{reduce:function(e){var t=arguments.length;return Zg(this,e,t,1<t?arguments[1]:void 0)}}),m),Qg=I.right,r=wa,R=Dl,e=(S({target:"Array",proto:!0,forced:!w("reduceRight")||!R&&79<r&&r<83},{reduceRight:function(e){return Qg(this,e,arguments.length,1<arguments.length?arguments[1]:void 0)}}),m),em=Vl,tm=E([].reverse),Yu=[1,2],Zl=(e({target:"Array",proto:!0,forced:String(Yu)===String(Yu.reverse())},{reverse:function(){return em(this)&&(this.length=this.length),tm(this)}}),m),rm=Vl,nm=N,im=Os,om=Ks,sm=Gs,am=As,um=A,T=ks,cm=za,_=M("slice"),pm=T("species"),lm=Array,fm=Math.max,I=(Zl({target:"Array",proto:!0,forced:!_},{slice:function(e,t){var r,n,i,o=am(this),s=sm(o),a=om(e,s),u=om(void 0===t?s:t,s);if(rm(o)&&(r=o.constructor,(r=nm(r)&&(r===lm||rm(r.prototype))||im(r)&&null===(r=r[pm])?void 0:r)===lm||void 0===r))return cm(o,a,u);for(n=new(void 0===r?lm:r)(fm(u-a,0)),i=0;a<u;a++,i++)a in o&&um(n,i,o[a]);return n.length=i,n}}),m),hm=b.some,dm=(I({target:"Array",proto:!0,forced:!w("some")},{some:function(e){return hm(this,e,1<arguments.length?arguments[1]:void 0)}}),Ks),ym=Gs,vm=A,gm=Array,mm=Math.max,Em=Tg,wm=Math.floor,Dl=_g,S=ma.match(/firefox\/(\d+)/i),R=!!S&&+S[1],r=/MSIE|Trident/.test(ma),e=ma.match(/AppleWebKit\/(\d+)\./),Yu=!!e&&+e[1],za=m,T=E,bm=Ms,Tm=xs,_m=Gs,Im=C,Am=Np,Zl=bs,Nm=Dl,_=w,Om=R,Pm=r,Sm=wa,Mm=Yu,Rm=[],Cm=T(Rm.sort),xm=T(Rm.push),I=Zl(function(){Rm.sort(void 0)}),S=Zl(function(){Rm.sort(null)}),ma=_("sort"),Um=!Zl(function(){if(Sm)return Sm<70;if(!(Om&&3<Om)){if(Pm)return!0;if(Mm)return Mm<603;for(var e,t,r,n="",i=65;i<76;i++){switch(e=String.fromCharCode(i),i){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(r=0;r<47;r++)Rm.push({k:e+r,v:t})}for(Rm.sort(function(e,t){return t.v-e.v}),r=0;r<Rm.length;r++)e=Rm[r].k.charAt(0),n.charAt(n.length-1)!==e&&(n+=e);return"DGBEFHACIJK"!==n}});za({target:"Array",proto:!0,forced:I||!S||!ma||!Um},{sort:function(e){void 0!==e&&bm(e);var t=Tm(this);if(Um)return void 0===e?Cm(t):Cm(t,e);for(var r,n,i=[],o=_m(t),s=0;s<o;s++)s in t&&xm(i,t[s]);for(Nm(i,(n=e,function(e,t){return void 0===t?-1:void 0===e?1:void 0!==n?+n(e,t)||0:Am(e)>Am(t)?1:-1})),r=i.length,s=0;s<r;)t[s]=i[s++];for(;s<o;)Im(t,s++);return t}});Uf("Array");var e=m,km=xs,Dm=Ks,Lm=Bs,Fm=Gs,Vm=O,jm=P,Bm=A,Km=C,Dl=M("splice"),Gm=Math.max,Hm=Math.min;e({target:"Array",proto:!0,forced:!Dl},{splice:function(e,t){var r,n,i,o,s,a,u=km(this),c=Fm(u),p=Dm(e,c),e=arguments.length;for(0===e?r=n=0:n=1===e?(r=0,c-p):(r=e-2,Hm(Gm(Lm(t),0),c-p)),Vm(c+r-n),i=jm(u,n),o=0;o<n;o++)(s=p+o)in u&&Bm(i,o,u[s]);if(r<(i.length=n)){for(o=p;o<c-n;o++)a=o+r,(s=o+n)in u?u[a]=u[s]:Km(u,a);for(o=c;c-n+r<o;o--)Km(u,o-1)}else if(n<r)for(o=c-n;p<o;o--)a=o+r-1,(s=o+n-1)in u?u[a]=u[s]:Km(u,a);for(o=0;o<r;o++)u[o+p]=arguments[o+2];return u.length=c-n+r,i}}),Pp("flat");Pp("flatMap");var R=m,zm=xs,Ym=Gs,Jm=C,qm=O,r=1!==[].unshift(0),wa=!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}();R({target:"Array",proto:!0,arity:1,forced:r||wa},{unshift:function(e){var t=zm(this),r=Ym(t),n=arguments.length;if(n){qm(r+n);for(var i=r;i--;){var o=i+n;i in t?t[o]=t[i]:Jm(t,o)}for(var s=0;s<n;s++)t[s]=arguments[s]}return t.length=r+n}});Xa.Array;var Yu={exports:{}},T={},Wm=_s,$m=As,Xm=ba.f,Zm=Tg,Qm="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];T.f=function(e){if(!Qm||"Window"!=Wm(e))return Xm($m(e));try{return Xm(e)}catch(e){return Zm(Qm)}};function eE(e){fE(e,mE,{value:{objectID:"O"+EE++,weakData:{}}})}function tE(e,t,r){for(var n in t)FE(e,n,t[n],r);return e}function rE(e,t){for(var r=0,n=XE(t),i=new e(n);r<n;)i[r]=t[r++];return i}function nE(e,t,r,n){for(var i,o,s,a=ew(e),u=QE(a),c=ZE(t,r),p=nw(null),l=rw(u),f=0;f<l;f++)s=u[f],(o=tw(c(s,f,a)))in p?sw(p[o],s):p[o]=[s];if(n&&(i=n(a))!==ow)for(o in p)p[o]=iw(i,p[o]);return p}var _=bs(function(){var e;"function"==typeof ArrayBuffer&&(e=new ArrayBuffer(8),Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8}))}),Zl=bs,iE=Os,oE=_s,sE=_,aE=Object.isExtensible,za=Zl(function(){aE(1)})||sE?function(e){return!!iE(e)&&((!sE||"ArrayBuffer"!=oE(e))&&(!aE||aE(e)))}:aE,I=!bs(function(){return Object.isExtensible(Object.preventExtensions({}))}),uE=m,cE=E,S=Vu,pE=Os,lE=Va,fE=Wa.f,hE=ba,dE=T,yE=za,vE=I,gE=!1,mE=Us("meta"),EE=0,wE=Yu.exports={enable:function(){wE.enable=function(){},gE=!0;var i=hE.f,o=cE([].splice),e={};e[mE]=1,i(e).length&&(hE.f=function(e){for(var t=i(e),r=0,n=t.length;r<n;r++)if(t[r]===mE){o(t,r,1);break}return t},uE({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:dE.f}))},fastKey:function(e,t){if(!pE(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!lE(e,mE)){if(!yE(e))return"F";if(!t)return"E";eE(e)}return e[mE].objectID},getWeakData:function(e,t){if(!lE(e,mE)){if(!yE(e))return!0;if(!t)return!1;eE(e)}return e[mE].weakData},onFreeze:function(e){return vE&&gE&&yE(e)&&!lE(e,mE)&&eE(e),e}},bE=(S[mE]=!0,Ns),TE=Os,_E=cp,IE=m,AE=i,NE=E,OE=zu,PE=js,SE=Yu.exports,ME=Ap,RE=kf,CE=Ns,xE=Os,UE=bs,kE=Hd,DE=Ql,LE=function(e,t,r){return _E&&bE(t=t.constructor)&&t!==r&&TE(t=t.prototype)&&t!==r.prototype&&_E(e,t),e},FE=js,VE=Wa.f,jE=pp,BE=tE,KE=Ep,GE=kf,HE=Ap,zE=rf,YE=Uf,JE=Q,qE=Yu.exports.fastKey,WE=t.set,$E=t.getterFor,XE=(function(e,t,r){function n(e){var r=NE(h[e]);PE(h,e,"add"==e?function(e){return r(this,0===e?0:e),this}:"delete"==e?function(e){return!(p&&!xE(e))&&r(this,0===e?0:e)}:"get"==e?function(e){return p&&!xE(e)?void 0:r(this,0===e?0:e)}:"has"==e?function(e){return!(p&&!xE(e))&&r(this,0===e?0:e)}:function(e,t){return r(this,0===e?0:e,t),this})}var i,o,s,a,u,c=-1!==e.indexOf("Map"),p=-1!==e.indexOf("Weak"),l=c?"set":"add",f=AE[e],h=f&&f.prototype,d=f,y={};return OE(e,!CE(f)||!(p||h.forEach&&!UE(function(){(new f).entries().next()})))?(d=r.getConstructor(t,e,c,l),SE.enable()):OE(e,!0)&&(o=(i=new d)[l](p?{}:-0,1)!=i,s=UE(function(){i.has(1)}),a=kE(function(e){new f(e)}),u=!p&&UE(function(){for(var e=new f,t=5;t--;)e[l](t,t);return!e.has(-0)}),a||(((d=t(function(e,t){RE(e,h);e=LE(new f,e,d);return null!=t&&ME(t,e[l],{that:e,AS_ENTRIES:c}),e})).prototype=h).constructor=d),(s||u)&&(n("delete"),n("has"),c&&n("get")),(u||o)&&n(l),p&&h.clear&&delete h.clear),y[e]=d,IE({global:!0,constructor:!0,forced:d!=f},y),DE(d,e),p||r.setStrong(d,e,c),d}("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},{getConstructor:function(e,r,n,i){function o(e,t,r){var n,i=u(e),o=s(e,t);return o?o.value=r:(i.last=o={index:n=qE(t,!0),key:t,value:r,previous:t=i.last,next:void 0,removed:!1},i.first||(i.first=o),t&&(t.next=o),JE?i.size++:e.size++,"F"!==n&&(i.index[n]=o)),e}function s(e,t){var r,e=u(e),n=qE(t);if("F"!==n)return e.index[n];for(r=e.first;r;r=r.next)if(r.key==t)return r}var e=e(function(e,t){GE(e,a),WE(e,{type:r,index:jE(null),first:void 0,last:void 0,size:0}),JE||(e.size=0),null!=t&&HE(t,e[i],{that:e,AS_ENTRIES:n})}),a=e.prototype,u=$E(r);return BE(a,{clear:function(){for(var e=u(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,JE?e.size=0:this.size=0},delete:function(e){var t,r,n=u(this),e=s(this,e);return e&&(t=e.next,r=e.previous,delete n.index[e.index],e.removed=!0,r&&(r.next=t),t&&(t.previous=r),n.first==e&&(n.first=t),n.last==e&&(n.last=r),JE?n.size--:this.size--),!!e},forEach:function(e){for(var t,r=u(this),n=KE(e,1<arguments.length?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),BE(a,n?{get:function(e){e=s(this,e);return e&&e.value},set:function(e,t){return o(this,0===e?0:e,t)}}:{add:function(e){return o(this,e=0===e?0:e,e)}}),JE&&VE(a,"size",{get:function(){return u(this).size}}),e},setStrong:function(e,t,r){var n=t+" Iterator",i=$E(t),o=$E(n);zE(e,t,function(e,t){WE(this,{type:n,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:{value:e.target=void 0,done:!0}},r?"entries":"values",!r,!0),YE(t)}}),Gs),ZE=Ep,QE=ia,ew=xs,tw=Ds,rw=Gs,nw=pp,iw=rE,ow=Array,sw=E([].push),aw=nE,ma=Pp;m({target:"Array",proto:!0},{group:function(e){return aw(this,e,1<arguments.length?arguments[1]:void 0)}}),ma("group");var uw=nE,A=Pp;m({target:"Array",proto:!0,forced:!w("groupBy")},{groupBy:function(e){return uw(this,e,1<arguments.length?arguments[1]:void 0)}}),A("groupBy");function cw(e){for(var t,r,n=fw(this),i=lw(n),o=pw(e,1<arguments.length?arguments[1]:void 0),s=new dw,a=hw(i),u=0;u<a;u++)t=o(r=i[u],u,n),vw(s,t)?mw(yw(s,t),r):gw(s,t,[r]);return s}var pw=Ep,M=E,lw=ia,fw=xs,hw=Gs,dw=Ps("Map"),e=dw.prototype,yw=M(e.get),vw=M(e.has),gw=M(e.set),mw=M([].push),Dl=Pp,C=cw;m({target:"Array",proto:!0,name:"groupToMap",forced:!w("groupByToMap")},{groupByToMap:C}),Dl("groupByToMap");function Ew(e){return Iw[e].prototype}var R=Pp,ww=(m({target:"Array",proto:!0},{groupToMap:cw}),R("groupToMap"),Gs),bw=function(e,t){for(var r=ww(e),n=new t(r),i=0;i<r;i++)n[i]=e[r-i-1];return n},Tw=As,r=Pp,_w=Array,Iw=(m({target:"Array",proto:!0},{toReversed:function(){return bw(Tw(this),_w)}}),r("toReversed"),i),wa=m,Aw=Ms,Nw=As,Ow=rE,Xa=Pp,Pw=Array,Sw=E(Ew("Array").sort),_=(wa({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&Aw(e);var t=Nw(this),t=Ow(Pw,t);return Sw(t,e)}}),Xa("toSorted"),m),Zl=Pp,Mw=O,Rw=Gs,Cw=Ks,xw=As,Uw=Bs,kw=Array,Dw=Math.max,Lw=Math.min,Fw=(_({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,o,s=xw(this),a=Rw(s),u=Cw(e,a),e=arguments.length,c=0;for(0===e?r=n=0:n=1===e?(r=0,a-u):(r=e-2,Lw(Dw(Uw(t),0),a-u)),i=Mw(a+r-n),o=kw(i);c<u;c++)o[c]=s[c];for(;c<u+r;c++)o[c]=arguments[c-u+2];for(;c<i;c++)o[c]=s[c+n-r];return o}}),Zl("toSpliced"),Gs),Vw=Bs,jw=RangeError,Bw=function(e,t,r,n){var i=Fw(e),r=Vw(r),o=r<0?i+r:r;if(i<=o||o<0)throw jw("Incorrect index");for(var s=new t(i),a=0;a<i;a++)s[a]=a===o?n:e[a];return s},Kw=As,Gw=Array;m({target:"Array",proto:!0},{with:function(e,t){return Bw(Kw(this),Gw,e,t)}});Vu=i,Va=Fa,ba=Ns,T=Wu,za=js,I="USE_FUNCTION_CONSTRUCTOR",S=ks("asyncIterator"),cp=Vu.AsyncIterator,zu=Va.AsyncIteratorPrototype;if(zu)YT=zu;else if(ba(cp))YT=cp.prototype;else if(Va[I]||Vu[I])try{LT=T(T(T(Function("return async function*(){}()")()))),T(LT)===Object.prototype&&(YT=LT)}catch(e){}ba((YT=YT||{})[S])||za(YT,S,function(){return this});function Hw(e,t,r){var n=e.done;Zw.resolve(e.value).then(function(e){t({done:n,value:e})},r)}function zw(e){eb(this,{type:Qw,iterator:$w(e),next:e.next})}function Yw(e){var f=0==e,h=1==e,d=2==e,y=3==e;return function(e,s,a){var e=mb(e),u=gb("Promise"),c=e.iterator,t=e.next,p=0,l=void 0!==s;return!l&&f||db(s),new u(function(r,n){var i=function(e){Eb(c,n,e,n)},o=function(){try{if(f&&l)try{vb(p)}catch(e){i(e)}u.resolve(yb(hb(t,c))).then(function(e){try{if(yb(e).done)f?(a.length=p,r(a)):r(!y&&(d||void 0));else{var t=e.value;try{l?u.resolve(f?s(t,p):s(t)).then(function(e){if(h)o();else if(d)e?o():Eb(c,r,!1,n);else if(f)try{a[p++]=e,o()}catch(e){i(e)}else e?Eb(c,r,y||t,n):o()},i):(a[p++]=t,o())}catch(e){i(e)}}}catch(e){n(e)}},n)}catch(e){n(e)}};o()})}}function Jw(e,t){if(!kb||!Ub(e)||!kb(e))return!1;for(var r,n=0,i=e.length;n<i;)if(!("string"==typeof(r=e[n++])||t&&void 0===r))return!1;return 0!==i}function qw(e,t,r){return r.get&&Db(r.get,t,{getter:!0}),r.set&&Db(r.set,t,{setter:!0}),Lb.f(e,t,r)}var Ww=G,$w=Fs,Yu=pp,Xw=Rs,ma=tE,A=t,ia=YT,Zw=Ps("Promise"),Qw="AsyncFromSyncIterator",eb=A.set,tb=A.getterFor(Qw),e=(zw.prototype=ma(Yu(ia),{next:function(){var n=tb(this);return new Zw(function(e,t){var r=$w(Ww(n.next,n.iterator));Hw(r,e,t)})},return:function(){var n=tb(this).iterator;return new Zw(function(e,t){var r=Xw(n,"return");if(void 0===r)return e({done:!0,value:void 0});r=$w(Ww(r,n));Hw(r,e,t)})}}),zw),rb=G,nb=e,ib=Fs,ob=Tp,sb=Rs,ab=ks("asyncIterator"),ub=Ms,cb=Fs,pb=G,lb=Ps,fb=Rs,hb=G,db=Ms,yb=Fs,vb=O,gb=Ps,mb=function(e){return{iterator:e,next:ub(cb(e).next)}},Eb=function(e,t,r,n){try{var i=fb(e,"return");if(i)return lb("Promise").resolve(pb(i,e)).then(function(){t(r)},function(e){n(e)})}catch(e){return n(e)}t(r)},M={toArray:Yw(0),forEach:Yw(1),every:Yw(2),some:Yw(3),find:Yw(4)},wb=Ep,bb=xs,Tb=N,_b=function(e,t){t=arguments.length<2?sb(e,ab):t;return t?ib(rb(t,e)):new nb(ob(e))},Ib=Tp,Ab=bp,Nb=Rs,w=Ew,Ob=Ps,C=ks,Pb=e,Sb=M.toArray,Mb=C("asyncIterator"),Rb=w("Array").values,Dl=(m({target:"Array",stat:!0,forced:!0},{fromAsync:function(o){var s=this,e=arguments.length,a=1<e?arguments[1]:void 0,u=2<e?arguments[2]:void 0;return new(Ob("Promise"))(function(e){var t=bb(o),r=(void 0!==a&&(a=wb(a,u)),Nb(t,Mb)),n=r?void 0:Ab(t)||Rb,i=Tb(s)?new s:[],r=r?_b(t,r):new Pb(Ib(t,n));e(Sb(r,a,i))})}}),m),Cb=b.filterReject,R=Pp,r=(Dl({target:"Array",proto:!0,forced:!0},{filterOut:function(e){return Cb(this,e,1<arguments.length?arguments[1]:void 0)}}),R("filterOut"),m),xb=b.filterReject,wa=Pp,Xa=(r({target:"Array",proto:!0,forced:!0},{filterReject:function(e){return xb(this,e,1<arguments.length?arguments[1]:void 0)}}),wa("filterReject"),m),Ub=Vl,kb=Object.isFrozen,Db=(Xa({target:"Array",stat:!0,sham:!0,forced:!0},{isTemplateObject:function(e){if(!Jw(e,!0))return!1;var t=e.raw;return t.length===e.length&&Jw(t,!1)}}),Ea.exports),Lb=Wa,_=Pp,Fb=xs,Vb=Gs;Q&&(qw(Array.prototype,"lastItem",{configurable:!0,get:function(){var e=Fb(this),t=Vb(e);return 0==t?void 0:e[t-1]},set:function(e){var t=Fb(this),r=Vb(t);return t[0==r?0:r-1]=e}}),_("lastItem"));var Zl=Pp,jb=xs,Bb=Gs;Q&&(qw(Array.prototype,"lastIndex",{configurable:!0,get:function(){var e=jb(this),e=Bb(e);return 0==e?0:e-1}}),Zl("lastIndex"));var i=E,Kb=Ms,Gb=Gs,Hb=xs,zb=P,Yb=Ps("Map"),Fa=Yb.prototype,Jb=i(Fa.forEach),qb=i(Fa.has),Wb=i(Fa.set),$b=i([].push),Wu=Pp;m({target:"Array",proto:!0,forced:!0},{uniqueBy:function(e){for(var t,r,n=Hb(this),i=Gb(n),o=zb(n,0),s=new Yb,a=null!=e?Kb(e):function(e){return e},u=0;u<i;u++)r=a(t=n[u]),qb(s,r)||Wb(s,r,t);return Jb(s,function(e){$b(o,e)}),o}}),Wu("uniqueBy");Zb.exposure=function(e,t,r,n){return new e0(n,e,t.experiment,t.variationId,t.variationKey,t.reason,r)},Zb.track=function(e,t,r,n){return new n0(n,r,e,t)},Zb.remoteConfig=function(e,t,r,n){return new s0(n,e,t.parameter,t.valueId,t.reason,r)},Zb.isExposureEvent=function(e){return void 0!==e.experiment},Zb.isTrackEvent=function(e){return void 0!==e.eventType},Zb.isRemoteConfigEvent=function(e){return void 0!==e.parameter},Zb.isExposureEventDto=function(e){return"experimentId"in e&&void 0!==e.experimentId},Zb.isTrackEventDto=function(e){return"eventTypeId"in e&&void 0!==e.eventTypeId},Zb.isRemoteConfigEventDto=function(e){return"parameterId"in e&&void 0!==e.parameterId},Zb.prototype.toDto=function(){return{insertId:this.insertId,timestamp:this.timestamp,userId:this.user.identifiers[jt.ID],identifiers:this.user.identifiers,userProperties:xe.sanitize(this.user.properties),hackleProperties:xe.sanitize(this.user.hackleProperties)}};var Xb=Zb;function Zb(e,t,r){void 0===r&&(r=K()),this.timestamp=e,this.user=t,this.insertId=r}o(t0,Qb=Xb),t0.prototype.copyWithUser=function(e){return new t0(this.timestamp,e,this.experiment,this.variationId,this.variationKey,this.decisionReason,this.properties,this.insertId)},t0.prototype.toDto=function(){return c(c({},Qb.prototype.toDto.call(this)),{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(),properties:this.properties})};var Qb,e0=t0;function t0(e,t,r,n,i,o,s,a){e=Qb.call(this,e,t,a)||this;return e.experiment=r,e.variationId=n,e.variationKey=i,e.decisionReason=o,e.properties=s,e}o(i0,r0=Xb),i0.prototype.copyWithUser=function(e){return new i0(this.timestamp,e,this.eventType,this.event,this.insertId)},i0.prototype.toDto=function(){return c(c({},r0.prototype.toDto.call(this)),{eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:xe.sanitize(this.event.properties)})};var r0,n0=i0;function i0(e,t,r,n,i){e=r0.call(this,e,t,i)||this;return e.eventType=r,e.event=n,e}o(a0,o0=Xb),a0.prototype.copyWithUser=function(e){return new a0(this.timestamp,e,this.parameter,this.valueId,this.decisionReason,this.properties,this.insertId)},a0.prototype.toDto=function(){return c(c({},o0.prototype.toDto.call(this)),{parameterId:this.parameter.id,parameterKey:this.parameter.key,parameterType:this.parameter.type,valueId:this.valueId,decisionReason:this.decisionReason.toString(),properties:xe.sanitize(this.properties)})};var o0,s0=a0;function a0(e,t,r,n,i,o,s){e=o0.call(this,e,t,s)||this;return e.parameter=r,e.valueId=n,e.decisionReason=i,e.properties=o,e}c0.isSessionEvent=function(e){return!!Xb.isTrackEvent(e)&&(e.event.key===c0.SESSION_START_EVENT_NAME||e.event.key===c0.SESSION_END_EVENT_NAME)},c0.prototype.onSessionStarted=function(e,t,r){this.track(c0.SESSION_START_EVENT_NAME,e,t,r)},c0.prototype.onSessionEnded=function(e,t,r){this.track(c0.SESSION_END_EVENT_NAME,e,t,r)},c0.prototype.track=function(e,t,r,n){e={key:e},r=this.userManager.toHackleUser(r),r=this.decorateSession(r,t);this.core.track(e,r,n)},c0.prototype.decorateSession=function(e,t){t=(new Gt).add(jt.SESSION,t).addIdentifiers(e.identifiers).build();return c(c({},e),{identifiers:t})},c0.SESSION_START_EVENT_NAME="$session_start",c0.SESSION_END_EVENT_NAME="$session_end";var u0=c0;function c0(e,t){this.userManager=e,this.core=t}l0.prototype.addDecorator=function(e){this.decorators.push(e)},l0.prototype.process=function(e){u0.isSessionEvent(e)||this.sessionManager.startNewSessionIfNeeded(this.userManager.currentUser,e.timestamp),this.eventDedupDeterminer.isDedupTarget(e)||(e=this.decorators.reduce(function(e,t){return t.decorate(e)},e),this.delegate.process(e))},l0.prototype.flush=function(e){this.delegate.flush(e)},l0.prototype.close=function(){this.delegate.close()},l0.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.flush(!0);case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var p0=l0;function l0(e,t,r,n){this.delegate=e,this.eventDedupDeterminer=t,this.sessionManager=r,this.userManager=n,this.decorators=[]}h0.toEvent=function(e){var t;return{key:h0.EVENT_KEY,properties:{level:h0.LEVEL_ERROR,type:e.name,message:null!=(t=e.message)?t:"",$stacktrace:h0._stacktrace(e)}}},h0._stacktrace=function(e){return p.isNullOrUndefined(e.stack)?"":e.stack.split("\n").slice(0,h0.STACK_TRACK_LIMIT).join("\n")},h0.EVENT_KEY="$trace",h0.LEVEL_ERROR="error",h0.STACK_TRACK_LIMIT=30;var f0=h0;function h0(){}d0.prototype.evaluate=function(e,t){if(!this.supports(e))throw new Error("Unsupported EvaluatorRequest ".concat(e.toString()));var r;if(t.contains(e))throw r=t.stack.map(function(e){return e.toString()}).join(" - "),new Error("Circular evaluation has occurred [".concat(r," - ").concat(e.toString(),"]"));t.addRequest(e);try{return this.evaluateInternal(e,t)}finally{t.removeRequest(e)}};zu=d0;function d0(){}v0.prototype.with=function(e){return new v0(e,this.targetEvaluations,this.experiment,this.variationId,this.variationKey,this.config)},v0.of=function(e,t,r,n){return new v0(n,t.targetEvaluations,e.experiment,r.id,r.key,r.config)},v0.ofDefault=function(e,t,r){var n=e.experiment._getVariationByKeyOrNull(e.defaultVariationKey);return p.isNotNullOrUndefined(n)?this.of(e,t,n,r):new v0(r,t.targetEvaluations,e.experiment,void 0,e.defaultVariationKey,void 0)};var y0=v0;function v0(e,t,r,n,i,o){this.reason=e,this.targetEvaluations=t,this.experiment=r,this.variationId=n,this.variationKey=i,this.config=o}o(E0,g0=zu),E0.prototype.supports=function(e){return void 0!==e.experiment},E0.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.experimentFlowFactory.getExperimentFlow(e.experiment.type).evaluate(e,t))?r:y0.ofDefault(e,t,h.TRAFFIC_NOT_ALLOCATED)};var g0,m0=E0;function E0(e){var t=g0.call(this)||this;return t.experimentFlowFactory=e,t}b0.of=function(e,t,r,n,i,o){return o.returnValue=xe.truncateStringValue(n),new b0(i,t.targetEvaluations,e.parameter,r,n,o)},b0.ofDefault=function(e,t,r,n){return this.of(e,t,void 0,e.defaultValue,r,n)};var w0=b0;function b0(e,t,r,n,i,o){this.reason=e,this.targetEvaluations=t,this.parameter=r,this.valueId=n,this.value=i,this.properties=o}o(I0,T0=zu),I0.prototype.supports=function(e){return void 0!==e.parameter},I0.prototype.evaluateInternal=function(e,t){var r={};if(r.requestValueType=e.requiredType,r.requestDefaultValue=xe.truncateStringValue(e.defaultValue),p.isNullOrUndefined(e.user.identifiers[e.parameter.identifierType]))return w0.ofDefault(e,t,h.IDENTIFIER_NOT_FOUND,r);var n=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t);return p.isNotNullOrUndefined(n)?(r.targetRuleKey=n.key,r.targetRuleName=n.name,this.evaluation(e,t,n.value,h.TARGET_RULE_MATCH,r)):this.evaluation(e,t,e.parameter.defaultValue,h.DEFAULT_RULE,r)},I0.prototype.evaluation=function(e,t,r,n,i){return"UNKNOWN"===e.requiredType||"NULL"!==e.requiredType&&typeof e.defaultValue!=typeof r.rawValue?w0.ofDefault(e,t,h.TYPE_MISMATCH,i):w0.of(e,t,r.id,r.rawValue,n,i)};var T0,_0=I0;function I0(e){var t=T0.call(this)||this;return t.targetRuleDeterminer=e,t}N0.prototype.isEquals=function(e){return this.type===e.type&&this.id===e.id};var A0=N0;function N0(e,t){this.type=e,this.id=t}P0.create=function(){return new P0},Object.defineProperty(P0.prototype,"stack",{get:function(){return Array.from(this._stack)},enumerable:!1,configurable:!0}),Object.defineProperty(P0.prototype,"targetEvaluations",{get:function(){return Array.from(this._targetEvaluations)},enumerable:!1,configurable:!0}),Object.defineProperty(P0.prototype,"properties",{get:function(){return xe.sanitize(this._properties)},enumerable:!1,configurable:!0}),P0.prototype.contains=function(t){return this._stack.some(function(e){return e.key.isEquals(t.key)})},P0.prototype.addRequest=function(e){this._stack.push(e)},P0.prototype.removeRequest=function(e){e=this._stack.indexOf(e,0);-1<e&&this._stack.splice(e,1)},P0.prototype.getEvaluation=function(t){return this._targetEvaluations.find(function(e){return e instanceof y0&&e.experiment.id===t.id})},P0.prototype.addEvaluation=function(e){this._targetEvaluations.push(e)},P0.prototype.setProperty=function(e,t){this._properties[e]=t},P0.prototype.get=function(e){var t=this.map.get(e);if(!t)return null;if(t instanceof e)return t;throw new Error("Context does not contain a value of type ".concat(e.name))},P0.prototype.set=function(e,t){this.map.set(e,t)};var O0=P0;function P0(){this._stack=[],this._targetEvaluations=[],this._properties={},this.map=new WeakMap}M0.of=function(e,t,r,n){return new M0(e,t,r,n)},M0.by=function(e,t){return new M0(e.workspace,e.user,t,"A")},M0.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.experiment.type,", key=").concat(this.experiment.key,")")};var S0=M0;function M0(e,t,r,n){this.key=new A0("EXPERIMENT",r.id),this.workspace=e,this.user=t,this.experiment=r,this.defaultVariationKey=n}C0.of=function(e,t,r,n,i){return new C0(e,t,r,n,i)},C0.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.parameter.key,")")};var R0=C0;function C0(e,t,r,n,i){this.key=new A0("REMOTE_CONFIG",r.id),this.workspace=e,this.user=t,this.parameter=r,this.requiredType=n,this.defaultValue=i}x0.asString=function(e){switch(typeof e){case"string":return e;case"number":return e.toString();case"boolean":return e?"true":"false";default:return}},x0.asNumber=function(e){switch(typeof e){case"number":return this.asActualNumber(e);case"string":return this.asActualNumber(Number(e));default:return}},x0.asBoolean=function(e){switch(typeof e){case"boolean":return e;case"string":switch(e){case"true":return!0;case"false":return!1;default:return}default:return}},x0.asActualNumber=function(e){if(!isNaN(e)&&isFinite(e))return e};var x=x0;function x0(){}k0.prototype.getVariation=function(e,t){if(0!==this.storages.length)for(var r=0,n=this.storages;r<n.length;r++){var i=n[r].getVariation(e,t);if(void 0!==i)return i}};var U0=k0;function k0(e){this.storages=e}L0.prototype.getVariation=function(e,t){var r=this.get(e);if(r)return e._getVariationByIdOrNull(r)},L0.prototype.get=function(e){e=this.listStorage.getItem(e.id.toString());return x.asNumber(e)},L0.prototype.getAll=function(){var r=new Map;return this.listStorage.entries().forEach(function(e){var t=e[0],e=e[1],t=x.asNumber(t),e=x.asNumber(e);p.isNullOrUndefined(t)||t<0||p.isNullOrUndefined(e)||t<0||r.set(t,e)}),r},L0.prototype.set=function(e,t){this.listStorage.setItem(e.id.toString(),t.toString())},L0.prototype.remove=function(e){this.listStorage.removeItem(e.id.toString())},L0.prototype.clear=function(){this.listStorage.clear()};var D0=L0;function L0(e){this.listStorage=e}V0.prototype.add=function(e){this.evaluators.push(e)},V0.prototype.evaluate=function(t,e){var r=this.evaluators.find(function(e){return e.supports(t)});if(p.isNullOrUndefined(r))throw new Error("Unsupported EvaluatorRequest [".concat(t.toString(),"]"));return r.evaluate(t,e)};var F0=V0;function V0(){this.evaluators=new Array}B0.get=function(e){return p.requiredNotNullOrUndefined(this.getOrNull(e),function(){return"Instance not registered [".concat(e,"]")})},B0.getOrNull=function(e){return B0.instances.get(e)},B0.register=function(e,t){return B0.instances.set(e,t),t},B0.instances=new Map;var j0=B0;function B0(){}G0.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.parameter.targetRules.find(function(e){return n.matches(t,r,e)})},G0.prototype.matches=function(e,t,r){if(!this.targetMatcher.matches(e,t,r.target))return!1;t=e.user.identifiers[e.parameter.identifierType];if(p.isNullOrUndefined(t))return!1;e=e.workspace.getBucketOrNull(r.bucketId);if(p.isNullOrUndefined(e))throw new Error("bucket[".concat(r.bucketId,"]"));return p.isNotNullOrUndefined(this.bucketer.bucketing(e,t))};var K0=G0;function G0(e,t){this.targetMatcher=e,this.bucketer=t}z0.prototype.resolveOrNull=function(e,t,r){switch(r.type){case"VARIATION":return this.resolveVariation(e,r);case"BUCKET":return this.resolveBucket(e,r)}},z0.prototype.resolveVariation=function(e,t){return e.experiment._getVariationByIdOrNull(t.variationId)},z0.prototype.resolveBucket=function(e,t){var t=e.workspace.getBucketOrNull(t.bucketId),r=e.user.identifiers[e.experiment.identifierType];if(r){t=this.bucketer.bucketing(t,r);if(t)return e.experiment._getVariationByIdOrNull(t.variationId)}};var H0=z0;function z0(e){this.bucketer=e}J0.prototype.evaluate=function(e,t){if(this.flowEvaluator&&this.nextFlow)return this.flowEvaluator.evaluate(e,t,this.nextFlow)},J0.end=function(){return new J0(void 0,void 0)},J0.decision=function(e,t){return new J0(e,t)},J0.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=this.end(),n=0,i=e.reverse();n<i.length;n++)var o=i[n],r=this.decision(o,r);return r};var Y0=J0;function J0(e,t){this.flowEvaluator=e,this.nextFlow=t}W0.prototype.evaluate=function(e,t,r){var n=this.overrideResolver.resolveOrNull(e,t);if(!n)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return y0.of(e,t,n,h.OVERRIDDEN);case"FEATURE_FLAG":return y0.of(e,t,n,h.INDIVIDUAL_TARGET_MATCH)}};var q0=W0;function W0(e){this.overrideResolver=e}X0.prototype.evaluate=function(e,t,r){return"DRAFT"===e.experiment.status?y0.ofDefault(e,t,h.EXPERIMENT_DRAFT):r.evaluate(e,t)};var $0=X0;function X0(){}Q0.prototype.evaluate=function(e,t,r){if("PAUSED"!==e.experiment.status)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return y0.ofDefault(e,t,h.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return y0.ofDefault(e,t,h.FEATURE_FLAG_INACTIVE)}};var Z0=Q0;function Q0(){}tT.prototype.evaluate=function(e,t,r){if("COMPLETED"!==e.experiment.status)return r.evaluate(e,t);r=e.experiment._winnerVariationOrNull();if(r)return y0.of(e,t,r,h.EXPERIMENT_COMPLETED);throw new Error("winner variation [".concat(e.experiment.id,"]"))};var eT=tT;function tT(){}nT.prototype.evaluate=function(e,t,r){if("AB_TEST"!==e.experiment.type)throw new Error("experiment type must be AB_TEST [".concat(e.experiment.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t)?r.evaluate(e,t):y0.ofDefault(e,t,h.NOT_IN_EXPERIMENT_TARGET)};var rT=nT;function nT(e){this.experimentTargetDeterminer=e}oT.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("AB_TEST"!==e.experiment.type)throw new Error("experiment type must be AB_TEST [".concat(e.experiment.id,"]"));var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);return n?n.isDropped?y0.ofDefault(e,t,h.VARIATION_DROPPED):y0.of(e,t,n,h.TRAFFIC_ALLOCATED):y0.ofDefault(e,t,h.TRAFFIC_NOT_ALLOCATED)};var iT=oT;function oT(e){this.actionResolver=e}aT.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("FEATURE_FLAG"!==e.experiment.type)throw new Error("experiment type must be FEATURE_FLAG [".concat(e.experiment.id,"]"));if(!e.user.identifiers[e.experiment.identifierType])return r.evaluate(e,t);var n=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t);if(!n)return r.evaluate(e,t);r=this.actionResolver.resolveOrNull(e,t,n.action);if(r)return y0.of(e,t,r,h.TARGET_RULE_MATCH);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var sT=aT;function aT(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}cT.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("FEATURE_FLAG"!==e.experiment.type)throw new Error("experiment type must be FEATURE_FLAG [".concat(e.experiment.id,"]"));if(!e.user.identifiers[e.experiment.identifierType])return y0.ofDefault(e,t,h.DEFAULT_RULE);var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);if(n)return y0.of(e,t,n,h.DEFAULT_RULE);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var uT=cT;function cT(e){this.actionResolver=e}lT.prototype.evaluate=function(e,t,r){var n=e.experiment.containerId;if(!n)return r.evaluate(e,t);var i=e.workspace.getContainerOrNull(n);if(i)return this.containerResolver.isUserInContainerGroup(e,t,i)?r.evaluate(e,t):y0.ofDefault(e,t,h.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT);throw new Error("container[".concat(n,"]"))};var pT=lT;function lT(e){this.containerResolver=e}hT.prototype.evaluate=function(e,t,r){return e.user.identifiers[e.experiment.identifierType]?r.evaluate(e,t):y0.ofDefault(e,t,h.IDENTIFIER_NOT_FOUND)};var fT=hT;function hT(){}yT.prototype.isUserInExperimentTarget=function(t,r){var n=this;return 0===t.experiment.targetAudiences.length||t.experiment.targetAudiences.some(function(e){return n.targetMatcher.matches(t,r,e)})};var dT=yT;function yT(e){this.targetMatcher=e}gT.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.experiment.targetRules.find(function(e){return n.targetMatcher.matches(t,r,e.target)})};var vT=gT;function gT(e){this.targetMatcher=e}ET.prototype.resolveOrNull=function(e,t){var r;return null!=(r=null!=(r=this.resolveManualOverride(e))?r:this._resolveUserOverride(e))?r:this._resolveSegmentOverride(e,t)},ET.prototype.resolveManualOverride=function(e){return this.manualOverrideStorage.getVariation(e.experiment,e.user)},ET.prototype._resolveUserOverride=function(e){var t=e.experiment,e=e.user.identifiers[t.identifierType];if(e){e=t.userOverrides.get(e);if(e)return t._getVariationByIdOrNull(e)}},ET.prototype._resolveSegmentOverride=function(t,r){var n=this,e=t.experiment.segmentOverrides.find(function(e){return n.targetMatcher.matches(t,r,e.target)});if(e)return this.actionResolver.resolveOrNull(t,r,e.action)};var mT=ET;function ET(e,t,r){this.manualOverrideStorage=e,this.targetMatcher=t,this.actionResolver=r}bT.prototype.isUserInContainerGroup=function(e,t,r){var n=e.user.identifiers[e.experiment.identifierType];if(p.isNullOrUndefined(n))return!1;var i=e.workspace.getBucketOrNull(r.bucketId);if(p.isNullOrUndefined(i))throw new Error("Bucket[".concat(r.bucketId,"]"));i=this.bucketer.bucketing(i,n);if(p.isNullOrUndefined(i))return!1;n=r.getGroupOrNull(i.variationId);if(p.isNullOrUndefined(n))throw new Error("ContainerGroup[".concat(i.variationId,"]"));return n.experiments.includes(e.experiment.id)};var wT=bT;function bT(e){this.bucketer=e}_T.prototype.getExperimentFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}};var TT=_T;function _T(e,t,r){var n=new H0(t),e=new mT(e,r,n),t=new wT(t);this.abTestFlow=Y0.of(new q0(e),new fT,new pT(t),new rT(new dT(r)),new $0,new Z0,new eT,new iT(n)),this.featureFlagFlow=Y0.of(new $0,new Z0,new eT,new q0(e),new fT,new sT(new vT(r),n),new uT(n))}AT.prototype.matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n._matches(t,r,e)})},AT.prototype.anyMatches=function(t,r,e){var n=this;return!e.length||e.some(function(e){return n.matches(t,r,e)})},AT.prototype._matches=function(e,t,r){return this.conditionMatcherFactory.getMatcher(r.key.type).matches(e,t,r)};var IT=AT;function AT(e){this.conditionMatcherFactory=e}OT.prototype.decorate=function(e){return e};var NT=OT;function OT(){}ST.prototype.decorate=function(e){return"string"==typeof e?as.decodeURIOrOriginal(e):e};var PT=ST;function ST(){}RT.prototype.matches=function(e,t,r){void 0===r&&(r=new NT);var n=this.valueMatcherFactory.getMatcher(t.valueType),i=this.operatorMatcherFactory.getMatcher(t.operator),e=this.userValueMatches(e,t,n,i,r);return this.typeMatches(t.type,e)},RT.prototype.userValueMatches=function(e,t,r,n,i){return Array.isArray(e)?this.arrayMatches(e,t,r,n,i):this.singleMatches(e,t,r,n,i)},RT.prototype.singleMatches=function(e,t,r,n,i){e=i.decorate(e),t=t.values.map(i.decorate);return n.matches(r,e,t)},RT.prototype.arrayMatches=function(e,t,r,n,i){var o=this;return e.some(function(e){return o.singleMatches(e,t,r,n,i)})},RT.prototype.typeMatches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}};var MT=RT;function RT(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}CT.prototype.matches=function(t,r,e){return!p.isNullOrUndefined(r)&&e.some(function(e){return t.inMatches(r,e)})};cp=CT;function CT(){}xT.prototype.matches=function(t,r,e){return!p.isNullOrUndefined(r)&&e.some(function(e){return t.containsMatches(r,e)})};Va=xT;function xT(){}UT.prototype.matches=function(t,r,e){return!p.isNullOrUndefined(r)&&e.some(function(e){return t.startsWithMatches(r,e)})};Vu=UT;function UT(){}kT.prototype.matches=function(t,r,e){return!p.isNullOrUndefined(r)&&e.some(function(e){return t.endsWithMatches(r,e)})};I=kT;function kT(){}DT.prototype.matches=function(t,r,e){return!p.isNullOrUndefined(r)&&e.some(function(e){return t.greaterThanMatches(r,e)})};T=DT;function DT(){}FT.prototype.matches=function(t,r,e){return!p.isNullOrUndefined(r)&&e.some(function(e){return t.greaterThanOrEqualMatches(r,e)})};var LT=FT;function FT(){}VT.prototype.matches=function(t,r,e){return!p.isNullOrUndefined(r)&&e.some(function(e){return t.lessThanMatches(r,e)})};ba=VT;function VT(){}jT.prototype.matches=function(t,r,e){return!p.isNullOrUndefined(r)&&e.some(function(e){return t.lessThanOrEqualMatches(r,e)})};za=jT;function jT(){}BT.prototype.matches=function(e,t,r){return!p.isNullOrUndefined(t)};S=BT;function BT(){}GT.prototype.getMatcher=function(e){switch(e){case"IN":return GT.IN_MATCHER;case"CONTAINS":return GT.CONTAINS_MATCHER;case"STARTS_WITH":return GT.STARTS_WITH_MATCHER;case"ENDS_WITH":return GT.ENDS_WITH_MATCHER;case"GT":return GT.GT_MATCHER;case"GTE":return GT.GTE_MATCHER;case"LT":return GT.LT_MATCHER;case"LTE":return GT.LTE_MATCHER;case"EXISTS":return GT.EXISTS_MATCHER}},GT.IN_MATCHER=new cp,GT.CONTAINS_MATCHER=new Va,GT.STARTS_WITH_MATCHER=new Vu,GT.ENDS_WITH_MATCHER=new I,GT.GT_MATCHER=new T,GT.GTE_MATCHER=new LT,GT.LT_MATCHER=new ba,GT.LTE_MATCHER=new za,GT.EXISTS_MATCHER=new S;var KT=GT;function GT(){}HT.prototype.inMatches=function(e,t){e=x.asString(e),t=x.asString(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e===t},HT.prototype.containsMatches=function(e,t){e=x.asString(e),t=x.asString(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e.includes(t)},HT.prototype.startsWithMatches=function(e,t){e=x.asString(e),t=x.asString(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e.startsWith(t)},HT.prototype.endsWithMatches=function(e,t){e=x.asString(e),t=x.asString(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e.endsWith(t)},HT.prototype.greaterThanMatches=function(e,t){e=x.asString(e),t=x.asString(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&t<e},HT.prototype.greaterThanOrEqualMatches=function(e,t){e=x.asString(e),t=x.asString(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&t<=e},HT.prototype.lessThanMatches=function(e,t){e=x.asString(e),t=x.asString(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e<t},HT.prototype.lessThanOrEqualMatches=function(e,t){e=x.asString(e),t=x.asString(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e<=t};pp=HT;function HT(){}zT.prototype.inMatches=function(e,t){e=x.asNumber(e),t=x.asNumber(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e===t},zT.prototype.containsMatches=function(e,t){return!1},zT.prototype.startsWithMatches=function(e,t){return!1},zT.prototype.endsWithMatches=function(e,t){return!1},zT.prototype.greaterThanMatches=function(e,t){e=x.asNumber(e),t=x.asNumber(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&t<e},zT.prototype.greaterThanOrEqualMatches=function(e,t){e=x.asNumber(e),t=x.asNumber(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&t<=e},zT.prototype.lessThanMatches=function(e,t){e=x.asNumber(e),t=x.asNumber(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e<t},zT.prototype.lessThanOrEqualMatches=function(e,t){e=x.asNumber(e),t=x.asNumber(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e<=t};t=zT;function zT(){}JT.prototype.inMatches=function(e,t){e=x.asBoolean(e),t=x.asBoolean(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e===t},JT.prototype.containsMatches=function(e,t){return!1},JT.prototype.startsWithMatches=function(e,t){return!1},JT.prototype.endsWithMatches=function(e,t){return!1},JT.prototype.greaterThanMatches=function(e,t){return!1},JT.prototype.greaterThanOrEqualMatches=function(e,t){return!1},JT.prototype.lessThanMatches=function(e,t){return!1},JT.prototype.lessThanOrEqualMatches=function(e,t){return!1};var YT=JT;function JT(){}qT.prototype.inMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e.isEqualTo(t)},qT.prototype.containsMatches=function(e,t){return!1},qT.prototype.startsWithMatches=function(e,t){return!1},qT.prototype.endsWithMatches=function(e,t){return!1},qT.prototype.greaterThanMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e.isGreaterThan(t)},qT.prototype.greaterThanOrEqualMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e.isGreaterThanOrEqualTo(t)},qT.prototype.lessThanMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e.isLessThan(t)},qT.prototype.lessThanOrEqualMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&e.isLessThanOrEqualTo(t)};A=qT;function qT(){}WT.prototype.inMatches=function(e,t){e=as.tryParse(e),t=x.asString(t);return!p.isNullOrUndefined(e)&&!p.isNullOrUndefined(t)&&as.decodeURIOrOriginal(as.removePathnameTrailingSlash(e))===as.decodeURIOrOriginal(as.removePathnameTrailingSlash(t))},WT.prototype.containsMatches=function(e,t){e=as.tryParse(e),t=x.asString(t);if(p.isNullOrUndefined(e)||p.isNullOrUndefined(t))return!1;e=as.decodeURIOrOriginal(e.href);return e.includes(t)||e.includes(encodeURI(t))},WT.prototype.startsWithMatches=function(e,t){e=as.tryParse(e),t=x.asString(t);if(p.isNullOrUndefined(e)||p.isNullOrUndefined(t))return!1;e=as.decodeURIOrOriginal(e.href);return e.startsWith(t)||e.startsWith(encodeURI(t))},WT.prototype.endsWithMatches=function(e,t){return!1},WT.prototype.greaterThanMatches=function(e,t){return!1},WT.prototype.greaterThanOrEqualMatches=function(e,t){return!1},WT.prototype.lessThanMatches=function(e,t){return!1},WT.prototype.lessThanOrEqualMatches=function(e,t){return!1};ma=WT;function WT(){}$T.prototype.inMatches=function(e,t){return!1},$T.prototype.containsMatches=function(e,t){return!1},$T.prototype.startsWithMatches=function(e,t){return!1},$T.prototype.endsWithMatches=function(e,t){return!1},$T.prototype.greaterThanMatches=function(e,t){return!1},$T.prototype.greaterThanOrEqualMatches=function(e,t){return!1},$T.prototype.lessThanMatches=function(e,t){return!1},$T.prototype.lessThanOrEqualMatches=function(e,t){return!1};Yu=$T;function $T(){}ZT.prototype.getMatcher=function(e){switch(e){case"STRING":case"JSON":return ZT.STRING_MATCHER;case"NUMBER":return ZT.NUMBER_MATCHER;case"BOOLEAN":return ZT.BOOLEAN_MATCHER;case"VERSION":return ZT.VERSION_MATCHER;case"URL":return ZT.URL_MATCHER;case"NULL":case"UNKNOWN":return ZT.NULL_MATCHER}},ZT.STRING_MATCHER=new pp,ZT.NUMBER_MATCHER=new t,ZT.BOOLEAN_MATCHER=new YT,ZT.VERSION_MATCHER=new A,ZT.URL_MATCHER=new ma,ZT.NULL_MATCHER=new Yu;var XT=ZT;function ZT(){}e_.prototype.matches=function(e,t,r){var e=this.userValueResolver.resolveOrNull(e.user,r.key),n=this.valueDecorator(r.key);return this.valueOperatorMatcher.matches(e,r.match,n)},e_.prototype.valueDecorator=function(e){return new("HACKLE_PROPERTY"===e.type&&this.URL_HACKLE_PROPERTY_KEY_NAMES.includes(e.name)?PT:NT)};var QT=e_;function e_(e,t){this.URL_HACKLE_PROPERTY_KEY_NAMES=["pagePath","host","url","queryParameter"],this.userValueResolver=e,this.valueOperatorMatcher=t}r_.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];default:throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}};var t_=r_;function r_(){}i_.prototype.matches=function(t,r,e){var n=this;if("SEGMENT"!=e.key.type)throw new Error("Unsupported TargetKeyType [".concat(e.key.type,"]"));var i=e.match.values.some(function(e){return n._matches(t,r,e)});switch(e.match.type){case"MATCH":return i;case"NOT_MATCH":return!i}},i_.prototype._matches=function(e,t,r){if("string"!=typeof r)throw new Error("SegmentKey[".concat(r,"]"));var n=e.workspace.getSegmentOrNull(r);if(n)return this.segmentMatcher.matches(e,t,n);throw new Error("Segment[".concat(r,"]"))};var n_=i_;function i_(e){this.segmentMatcher=e}s_.prototype.matches=function(t,r,e){var n=this;return e.targets.some(function(e){return n._matches(t,r,e)})},s_.prototype._matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n.userConditionMatcher.matches(t,r,e)})};var o_=s_;function s_(e){this.userConditionMatcher=e}a_.prototype.evaluateInternal=function(e,t,r){r=S0.by(e,r),r=this.evaluator.evaluate(r,t);if(!(r instanceof y0))throw new Error("Unexpected evaluation [expected=ExperimentEvaluation, actual=".concat(r.constructor.name,"]"));e=this.resolve(e,t,r);return t.addEvaluation(e),e},a_.prototype.evaluate=function(e,t,r){var n;return null!=(n=t.getEvaluation(r))?n:this.evaluateInternal(e,t,r)};ia=a_;function a_(e){this.evaluator=e}c_.prototype.matches=function(e,t,r){switch(r.key.type){case"AB_TEST":return this.abTestMatcher.matches(e,t,r);case"FEATURE_FLAG":return this.featureFlagMatcher.matches(e,t,r);default:throw new Error("Unsupported TargetKeyType [".concat(r.key.type,"]"))}};var u_=c_;function c_(e,t){this.abTestMatcher=e,this.featureFlagMatcher=t}o(l_,p_=ia),l_.prototype.matches=function(e,t,r){var n=p.requiredNotNullOrUndefined(x.asNumber(r.key.name),function(){return"Invalid key [".concat(r.key.type,", ").concat(r.key.name,"]")}),n=this.experiment(e,n);if(p.isNullOrUndefined(n))return!1;e=this.evaluate(e,t,n);return this.evaluationMatches(e,r)};var p_,G=l_;function l_(e,t){e=p_.call(this,e)||this;return e.valueOperatorMatcher=t,e}o(d_,f_=G),d_.prototype.experiment=function(e,t){return e.workspace.getExperimentOrNull(t)},d_.prototype.resolve=function(e,t,r){return r.reason===h.TRAFFIC_ALLOCATED?r.with(h.TRAFFIC_ALLOCATED_BY_TARGETING):r},d_.prototype.evaluationMatches=function(e,t){return!!d_.AB_TEST_MATCHED_REASONS.includes(e.reason)&&this.valueOperatorMatcher.matches(e.variationKey,t.match)},d_.AB_TEST_MATCHED_REASONS=[h.OVERRIDDEN,h.TRAFFIC_ALLOCATED,h.EXPERIMENT_COMPLETED,h.TRAFFIC_ALLOCATED_BY_TARGETING];var f_,h_=d_;function d_(e,t){return f_.call(this,e,t)||this}o(g_,y_=G),g_.prototype.experiment=function(e,t){return e.workspace.getFeatureFlagOrNull(t)},g_.prototype.resolve=function(e,t,r){return r},g_.prototype.evaluationMatches=function(e,t){e="A"!==e.variationKey;return this.valueOperatorMatcher.matches(e,t.match)};var y_,v_=g_;function g_(e,t){return y_.call(this,e,t)||this}E_.prototype.matches=function(e,t,r){if(!this.isEventEvaluatorRequest(e))return!1;e=this.eventValueResolver.resolveOrNull(e.event,r.key);return this.valueOperatorMatcher.matches(e,r.match)},E_.prototype.isEventEvaluatorRequest=function(e){return void 0!==e.event};var m_=E_;function E_(e,t){this.eventValueResolver=e,this.valueOperatorMatcher=t}b_.prototype.resolveOrNull=function(e,t){var r;switch(t.type){case"EVENT_PROPERTY":return null==(r=this.properties(e))?void 0:r[t.name];case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":case"SEGMENT":case"AB_TEST":case"FEATURE_FLAG":case"COHORT":throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}},b_.prototype.properties=function(e){return Xb.isTrackEvent(e)?e.event.properties:Xb.isExposureEvent(e)||Xb.isRemoteConfigEvent(e)?e.properties:void 0};var w_=b_;function b_(){}__.prototype.matches=function(e,t,r){if("COHORT"!==r.key.type)throw new Error("Unsupported TargetKeyType [".concat(r.key.type,"]"));e=null!=(e=null==(e=e.user.cohorts)?void 0:e.map(function(e){return e.id}))?e:[];return this.valueOperatorMatcher.matches(e,r.match)};var T_=__;function __(e){this.valueOperatorMatcher=e}A_.prototype.supports=function(e){return"NUMBER_OF_EVENTS_IN_DAYS"===e||"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"===e},A_.prototype.matches=function(e,t,r){var n,i=r.key.type;if(!this.supports(i))throw new Error("Unsupported TargetKeyType [".concat(i,"]"));var o=null!=(n=e.user.targetEvents)?n:[];switch(i){case"NUMBER_OF_EVENTS_IN_DAYS":return new P_(this.valueOperatorMatcher,this.clock).matches(e,o,r);case"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS":return new R_(this.valueOperatorMatcher,this.clock).matches(e,o,r);default:return i}};var I_=A_;function A_(e,t){this.valueOperatorMatcher=e,this.clock=t}function N_(){}o(S_,O_=N_),S_.prototype.matches=function(e,t,r){var n=this,i=this.convertTargetConditionToExpression(r),o=this.clock.currentMillis()-Le.daysToUnit(i.days,"milliseconds"),t=t.filter(function(e){return n.expressionMatch(e,i)}),t=f.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},S_.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&null===e.property},S_.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var O_,P_=S_;function S_(e,t){var r=O_.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}o(C_,M_=N_),C_.prototype.matches=function(e,t,r){var n=this,i=this.convertTargetConditionToExpression(r),o=this.clock.currentMillis()-Le.daysToUnit(i.days,"milliseconds"),t=t.filter(function(e){return n.expressionMatch(e,i)}),t=f.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},C_.prototype.propertyMatch=function(e,t){return(null==e?void 0:e.type)===t.key.type&&e.key===t.key.name&&this.valueOperatorMatcher.matches(e.value,t.match)},C_.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&this.propertyMatch(e.property,t.propertyFilter)},C_.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var M_,R_=C_;function C_(e,t){var r=M_.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}U_.prototype.getMatcher=function(e){switch(e){case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":return this.userConditionMatcher;case"EVENT_PROPERTY":return this.eventConditionMatcher;case"SEGMENT":return this.segmentConditionMatcher;case"AB_TEST":case"FEATURE_FLAG":return this.experimentConditionMatcher;case"COHORT":return this.cohortConditionMatcher;case"NUMBER_OF_EVENTS_IN_DAYS":case"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS":return this.userTargetConditionMatcher;default:return e}};var x_=U_;function U_(e,t){var r=new MT(new XT,new KT);this.userConditionMatcher=new QT(new t_,r),this.eventConditionMatcher=new m_(new w_,r),this.segmentConditionMatcher=new n_(new o_(this.userConditionMatcher)),this.experimentConditionMatcher=new u_(new h_(e,r),new v_(e,r)),this.cohortConditionMatcher=new T_(r),this.userTargetConditionMatcher=new I_(r,t)}var k_={murmurhash3_x86_32:function(e,t,r,n){for(var i,o=-4&(n=void 0===n?e.length:n),s=t,a=0;a<o;a+=4)i=255&e.charCodeAt(a)|(255&e.charCodeAt(a+1))<<8|(255&e.charCodeAt(a+2))<<16|(255&e.charCodeAt(a+3))<<24,i=this.mul32(i,3432918353),s=5*(s=(524287&(s^=i=this.mul32(i=(131071&i)<<15|i>>>17,461845907)))<<13|s>>>19)+3864292196|0;switch(i=0,n%4){case 3:i=(255&e.charCodeAt(2+o))<<16;case 2:i|=(255&e.charCodeAt(1+o))<<8;case 1:i|=255&e.charCodeAt(o),i=this.mul32(i,3432918353),s^=i=this.mul32(i=(131071&i)<<15|i>>>17,461845907)}return s=this.mul32(s=(s^=n)^s>>>16,2246822507),s=this.mul32(s^=s>>>13,3266489909),s^=s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},D_=(L_.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t);return e.slots.find(function(e){return e.contains(r)})},L_.prototype.calculateSlotNumber=function(e,t,r){r=k_.murmurhash3_x86_32(r,e);return Math.abs(r)%Math.abs(t)},L_);function L_(){}var F_=l.log,V_=(j_.create=function(e,t,r,n){var i=Fe.instance,o=j0.register("delegatingEvaluator",new F0),s=new D_,i=j0.register("targetMatcher",new IT(new x_(o,i))),n=new U0(n),i=new K0(i,s),n=new TT(n,s,j0.get("targetMatcher")),s=new m0(n),n=new _0(i);return o.add(s),o.add(n),new j_(s,n,e,t,r,new B_)},j_.prototype.getExperiment=function(e){if(e){var t=this.workspaceFetcher.get();if(t)return t.getExperimentOrNull(e)}else F_.error("experimentKey must not be empty")},j_.prototype.experiment=function(e,t,r){var n=this;if(!e)return F_.error("experimentKey must not be empty"),bt.of(r,h.INVALID_INPUT);var i=this.workspaceFetcher.get();if(!i)return F_.warn("SDK not ready."),bt.of(r,h.SDK_NOT_READY);e=i.getExperimentOrNull(e);if(!e)return F_.warn("Experiment does not exist."),bt.of(r,h.EXPERIMENT_NOT_FOUND);i=S0.of(i,t,e,r),t=this.experimentInternal(i),e=t[0],r=t[1];return this.eventFactory.create(i,e).forEach(function(e){return n.eventProcessor.process(e)}),r},j_.prototype.experiments=function(r){var n=this,i=new pi(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getExperiments().forEach(function(e){var t=S0.of(o,r,e,"A"),t=n.experimentInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},j_.prototype.experimentInternal=function(e){var e=this.experimentEvaluator.evaluate(e,O0.create()),t=null!=(t=e.config)?t:new je;return[e,bt.of(e.variationKey,e.reason,t,e.experiment)]},j_.prototype.featureFlag=function(e,t){var r=this;if(!e)return F_.error("featureKey must not be empty"),_t.off(h.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return F_.warn("SDK not ready."),_t.off(h.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return F_.warn("FeatureFlag does not exist."),_t.off(h.FEATURE_FLAG_NOT_FOUND);n=S0.of(n,t,e,"A"),t=this.featureFlagInternal(n),e=t[0],t=t[1];return this.eventFactory.create(n,e).forEach(function(e){return r.eventProcessor.process(e)}),t},j_.prototype.featureFlags=function(r){var n=this,i=new pi(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getFeatureFlags().forEach(function(e){var t=S0.of(o,r,e,"A"),t=n.featureFlagInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},j_.prototype.featureFlagInternal=function(e){var e=this.experimentEvaluator.evaluate(e,O0.create()),t=null!=(t=e.config)?t:new je;return[e,"A"===e.variationKey?_t.off(e.reason,t,e.experiment):_t.on(e.reason,t,e.experiment)]},j_.prototype.inAppMessage=function(e,t,r){t=r.evaluate(e,t);return r.record(e,t),t},j_.prototype.track=function(e,t,r){var n;void 0===r&&(r=(new Date).getTime()),e?"object"!=typeof e?F_.warn("Event must be event type."):"object"!=typeof e||e.key&&"string"==typeof e.key?(n=(null==(n=this.workspaceFetcher.get())?void 0:n.getEventTypeOrNull(e.key))||new Ft(0,e.key),this.eventProcessor.process(Xb.track(n,e,t,r))):F_.warn("Event key must be not null. or event key must be string type."):F_.warn("event must not be null.")},j_.prototype.trackException=function(e,t){this.errorDedupDeterminer.isDedupTarget(e)||(e=f0.toEvent(e),this.flush(),this.track(e,t),this.flush())},j_.prototype.flush=function(e){this.eventProcessor.flush(e=void 0===e?!1:e)},j_.prototype.remoteConfig=function(e,t,r,n){var i=this,o=this.workspaceFetcher.get();if(p.isNullOrUndefined(o))return F_.warn("SDK not ready."),Et.of(n,h.SDK_NOT_READY);e=o.getRemoteConfigParameterOrNull(e);if(p.isNullOrUndefined(e))return F_.warn("Remote config parameter does not exist."),Et.of(n,h.REMOTE_CONFIG_PARAMETER_NOT_FOUND);o=R0.of(o,t,e,r,n),t=this.remoteConfigEvaluator.evaluate(o,O0.create());return this.eventFactory.create(o,t).forEach(function(e){return i.eventProcessor.process(e)}),Et.of(t.value,t.reason)},j_.prototype.close=function(){this.eventProcessor.close()},j_);function j_(e,t,r,n,i,o){this.experimentEvaluator=e,this.remoteConfigEvaluator=t,this.workspaceFetcher=r,this.eventFactory=n,this.eventProcessor=i,this.errorDedupDeterminer=o}K_.prototype.isDedupTarget=function(e){return!!this._isSameError(e,this.previous)||(this.previous=e,!1)},K_.prototype._isSameError=function(e,t){return!p.isNullOrUndefined(t)&&(e.name===t.name&&e.message===t.message&&e.stack===t.stack)};var B_=K_;function K_(){}H_.prototype.install=function(e,t){this._install("onerror",e,t),this._install("onunhandledrejection",e,t)},H_.prototype._install=function(e,t,r){e in this._installed||((0,this._installations[e])(t,r),this._installed.push(e))};var G_=H_;function H_(){this._installed=[],this._installations={onerror:J_,onunhandledrejection:q_}}var z_,Y_=null;function J_(o,s){Y_=window.onerror,window.onerror=function(e,t,r,n,i){p.isNotNullOrUndefined(i)&&o.trackException(i,s.resolve()),Y_&&Y_.apply(this,arguments)}}function q_(r,n){z_=window.onunhandledrejection,window.onunhandledrejection=function(e){var t;try{"reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason)}catch(e){}t instanceof Error&&r.trackException(t,n.resolve()),z_&&z_.apply(this,arguments)}}$_.prototype.read=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){return(t=this.storage.getItem(this.storageKey))?[2,JSON.parse(t)]:[2,[]]})})},$_.prototype.save=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){return 0===r.length?[2,this.clear()]:(t=JSON.stringify(r.slice(-this.maxSize)),this.storage.setItem(this.storageKey,t),[2])})})},$_.prototype.add=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return[4,this.read()];case 1:return t=e.sent(),[4,this.save(t.concat(r).slice(-this.maxSize))];case 2:return e.sent(),[2]}})})},$_.prototype.delete=function(n){return a(this,void 0,void 0,function(){var t,r=this;return u(this,function(e){switch(e.label){case 0:return[4,this.read()];case 1:return t=e.sent(),t=t.filter(function(e){return!r.isDeleteTarget(e,n)}),[4,this.save(t)];case 2:return e.sent(),[2]}})})},$_.prototype.isDeleteTarget=function(t,e){return e.some(function(e){return e.insertId===t.insertId})},$_.prototype.clear=function(){return a(this,void 0,void 0,function(){return u(this,function(e){return this.storage.removeItem(this.storageKey),[2]})})};var W_=$_;function $_(e,t,r){this.storage=e,this.storageKey=t,this.maxSize=r}function X_(e,t){return null!==e&&(e.userId===t.userId&&e.deviceId===t.deviceId)}Q_.builder=function(){return new eI},Q_.empty=function(){return Q_.builder().build()},Q_.from=function(e){return new Q_(e)},Q_.fromDto=function(e){for(var t=Q_.builder(),r=0,n=e.cohorts;r<n.length;r++){var i=n[r];t.put({identifier:i.identifier,cohorts:i.cohorts.map(function(e){return new Xn(e)})})}return t.build()},Object.defineProperty(Q_.prototype,"rawCohorts",{get:function(){return this.cohorts.values().flatMap(function(e){return e.cohorts})},enumerable:!1,configurable:!0}),Q_.prototype.get=function(e){return this.cohorts.get(e)},Q_.prototype.filterBy=function(e){var r=Kt(e),e=this.asComparable().filter(function(e,t){return r[e.type]===e.value});return Q_.from(e)},Q_.prototype.asArray=function(){return this.cohorts.values()},Q_.prototype.asComparable=function(){return this.cohorts},Q_.prototype.toBuilder=function(){return new eI(this)};var Z_=Q_;function Q_(e){this.cohorts=e}tI.prototype.put=function(e){return this.cohorts.add(e.identifier,e),this},tI.prototype.putAll=function(e){var t=this;return e.asArray().forEach(function(e){return t.put(e)}),this},tI.prototype.build=function(){return new Z_(this.cohorts)};var eI=tI;function tI(e){this.cohorts=new pi(Me.isEqual),e&&this.putAll(e)}var O="model",N="name",e="type",M="vendor",C="version",w="architecture",Dl="console",R="mobile",b="tablet",r="smarttv",wa="wearable",rI=(U.parse=function(e){return{browser:U.getBrowser(e),cpu:U.getCPU(e),device:U.getDevice(e),engine:U.getEngine(e),os:U.getOS(e)}},U.getBrowser=function(e){var t={name:void 0,version:void 0,major:void 0};return U.mapper.rgx.call(t,e,U.regexes.browser),t.major=U.util.major(t.version),t},U.getCPU=function(e){var t={architecture:void 0};return U.mapper.rgx.call(t,e,U.regexes.cpu),t},U.getDevice=function(e){var t={model:void 0,type:void 0,vendor:void 0};return U.mapper.rgx.call(t,e,U.regexes.device),t},U.getEngine=function(e){var t={name:void 0,version:void 0};return U.mapper.rgx.call(t,e,U.regexes.os),t},U.getOS=function(e){var t={name:void 0,version:void 0};return U.mapper.rgx.call(t,e,U.regexes.os),t},U.util={extend:function(e,t){var r,n={};for(r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},U.regexes={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[N,C],[/(opios)[\/\s]+([\w\.]+)/i],[[N,"Opera Mini"],C],[/\s(opr)\/([\w\.]+)/i],[[N,"Opera"],C],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[N,C],[/(konqueror)\/([\w\.]+)/i],[[N,"Konqueror"],C],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[N,"IE"],C],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[N,"Edge"],C],[/(yabrowser)\/([\w\.]+)/i],[[N,"Yandex"],C],[/(Avast)\/([\w\.]+)/i],[[N,"Avast Secure Browser"],C],[/(AVG)\/([\w\.]+)/i],[[N,"AVG Secure Browser"],C],[/(puffin)\/([\w\.]+)/i],[[N,"Puffin"],C],[/(focus)\/([\w\.]+)/i],[[N,"Firefox Focus"],C],[/(opt)\/([\w\.]+)/i],[[N,"Opera Touch"],C],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[N,"UCBrowser"],C],[/(comodo_dragon)\/([\w\.]+)/i],[[N,/_/g," "],C],[/(windowswechat qbcore)\/([\w\.]+)/i],[[N,"WeChat(Win) Desktop"],C],[/(micromessenger)\/([\w\.]+)/i],[[N,"WeChat"],C],[/(brave)\/([\w\.]+)/i],[[N,"Brave"],C],[/(whale)\/([\w\.]+)/i],[[N,"Whale"],C],[/(qqbrowserlite)\/([\w\.]+)/i],[N,C],[/(QQ)\/([\d\.]+)/i],[N,C],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[N,C],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[N,C],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[N,C],[/(MetaSr)[\/\s]?([\w\.]+)/i],[N],[/(LBBROWSER)/i],[N],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[C,[N,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[C,[N,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[N,C],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[C,[N,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[N,/(.+)/,"$1 WebView"],C],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[N,/(.+(?:g|us))(.+)/,"$1 $2"],C],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[N,"Chrome Mobile"],C],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[C,[N,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[N,"Sailfish Browser"],C],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[N,C],[/(dolfin)\/([\w\.]+)/i],[[N,"Dolphin"],C],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[N,"360 Browser"]],[/(coast)\/([\w\.]+)/i],[[N,"Opera Coast"],C],[/fxios\/([\w\.-]+)/i],[C,[N,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[C,[N,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[C,N],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[N,"GSA"],C],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[N,[C,(U.mapper={rgx:function(e,t){for(var r,n,i,o,s,a=0;a<t.length&&!o;){for(var u=t[a],c=t[a+1],p=r=0;p<u.length&&!o;)if(o=u[p++].exec(e))for(n=0;n<c.length;n++)s=o[++r],"object"==typeof(i=c[n])&&0<i.length?2==i.length?"function"==typeof i[1]?this[i[0]]=i[1].call(this,s):this[i[0]]=i[1]:3==i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?this[i[0]]=s?s.replace(i[1],i[2]):void 0:this[i[0]]=s?i[1].call(this,s,i[2]):void 0:4==i.length&&(this[i[0]]=s?i[3].call(this,s.replace(i[1],i[2])):void 0):this[i]=s||void 0;a+=2}},str:function(e,t){for(var r in t)if("object"==typeof t[r]&&0<t[r].length){for(var n=0;n<t[r].length;n++)if(U.util.has(t[r][n],e))return"?"===r?void 0:r}else if(U.util.has(t[r],e))return"?"===r?void 0:r;return e}}).str,(U.maps={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}}).browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[N,C],[/(navigator|netscape)\/([\w\.-]+)/i],[[N,"Netscape"],C],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[N,C]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[w,"amd64"]],[/(ia32(?=;))/i],[[w,U.util.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[w,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[w,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[w,/ower/,"",U.util.lowerize]],[/(sun4\w)[;\)]/i],[[w,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[w,U.util.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[O,M,[e,b]],[/applecoremedia\/[\w\.]+ \((ipad)/],[O,[M,"Apple"],[e,b]],[/(apple\s{0,1}tv)/i],[[O,"Apple TV"],[M,"Apple"],[e,r]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[M,O,[e,b]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[O,[M,"Amazon"],[e,b]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[O,U.mapper.str,U.maps.device.amazon.model],[M,"Amazon"],[e,R]],[/android.+aft([bms])\sbuild/i],[O,[M,"Amazon"],[e,r]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[O,M,[e,R]],[/\((ip[honed|\s\w*]+);/i],[O,[M,"Apple"],[e,R]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[M,O,[e,R]],[/\(bb10;\s(\w+)/i],[O,[M,"BlackBerry"],[e,R]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[O,[M,"Asus"],[e,b]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[M,"Sony"],[O,"Xperia Tablet"],[e,b]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[O,[M,"Sony"],[e,R]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[M,O,[e,Dl]],[/android.+;\s(shield)\sbuild/i],[O,[M,"Nvidia"],[e,Dl]],[/(playstation\s[34portablevi]+)/i],[O,[M,"Sony"],[e,Dl]],[/(sprint\s(\w+))/i],[[M,U.mapper.str,U.maps.device.sprint.vendor],[O,U.mapper.str,U.maps.device.sprint.model],[e,R]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[M,[O,/_/g," "],[e,R]],[/(nexus\s9)/i],[O,[M,"HTC"],[e,b]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i],[O,[M,"Huawei"],[e,R]],[/android.+(bah2?-a?[lw]\d{2})/i],[O,[M,"Huawei"],[e,b]],[/(microsoft);\s(lumia[\s\w]+)/i],[M,O,[e,R]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[O,[M,"Microsoft"],[e,Dl]],[/(kin\.[onetw]{3})/i],[[O,/\./g," "],[M,"Microsoft"],[e,R]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[O,[M,"Motorola"],[e,R]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[O,[M,"Motorola"],[e,b]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[M,U.util.trim],[O,U.util.trim],[e,r]],[/hbbtv.+maple;(\d+)/i],[[O,/^/,"SmartTV"],[M,"Samsung"],[e,r]],[/\(dtv[\);].+(aquos)/i],[O,[M,"Sharp"],[e,r]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[M,"Samsung"],O,[e,b]],[/smart-tv.+(samsung)/i],[M,[e,r],O],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[M,"Samsung"],O,[e,R]],[/sie-(\w*)/i],[O,[M,"Siemens"],[e,R]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[M,"Nokia"],O,[e,R]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[O,[M,"Acer"],[e,b]],[/android.+([vl]k\-?\d{3})\s+build/i],[O,[M,"LG"],[e,b]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[M,"LG"],O,[e,b]],[/(lg) netcast\.tv/i],[M,O,[e,r]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[O,[M,"LG"],[e,R]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[M,O,[e,b]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[O,[M,"Lenovo"],[e,b]],[/(lenovo)[_\s-]?([\w-]+)/i],[M,O,[e,R]],[/linux;.+((jolla));/i],[M,O,[e,R]],[/((pebble))app\/[\d\.]+\s/i],[M,O,[e,wa]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[M,O,[e,R]],[/crkey/i],[[O,"Chromecast"],[M,"Google"],[e,r]],[/android.+;\s(glass)\s\d/i],[O,[M,"Google"],[e,wa]],[/android.+;\s(pixel c)[\s)]/i],[O,[M,"Google"],[e,b]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[O,[M,"Google"],[e,R]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[O,/_/g," "],[M,"Xiaomi"],[e,R]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[O,/_/g," "],[M,"Xiaomi"],[e,b]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[O,[M,"Meizu"],[e,R]],[/(mz)-([\w-]{2,})/i],[[M,"Meizu"],O,[e,R]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[O,[M,"OnePlus"],[e,R]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[O,[M,"RCA"],[e,b]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[O,[M,"Dell"],[e,b]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[O,[M,"Verizon"],[e,b]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[M,"Barnes & Noble"],O,[e,b]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[O,[M,"NuVision"],[e,b]],[/android.+;\s(k88)\sbuild/i],[O,[M,"ZTE"],[e,b]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[O,[M,"Swiss"],[e,R]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[O,[M,"Swiss"],[e,b]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[O,[M,"Zeki"],[e,b]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[M,"Dragon Touch"],O,[e,b]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[O,[M,"Insignia"],[e,b]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[O,[M,"NextBook"],[e,b]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[M,"Voice"],O,[e,R]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[M,"LvTel"],O,[e,R]],[/android.+;\s(PH-1)\s/i],[O,[M,"Essential"],[e,R]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[O,[M,"Envizen"],[e,b]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[M,O,[e,b]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[O,[M,"MachSpeed"],[e,b]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[M,O,[e,b]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[O,[M,"Rotor"],[e,b]],[/android.+(KS(.+))\s+build/i],[O,[M,"Amazon"],[e,b]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[M,O,[e,b]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[e,U.util.lowerize],M,O],[/[\s\/\(](smart-?tv)[;\)]/i],[[e,r]],[/(android[\w\.\s\-]{0,9});.+build/i],[O,[M,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[C,[N,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[N,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[N,C],[/rv\:([\w\.]{1,9}).+(gecko)/i],[C,N]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[N,C],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[N,U.mapper.str,U.maps.os.windows],[C,U.mapper.str,U.maps.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[N,"Windows"],[C,U.mapper.str,U.maps.os.windows.version]],[/\((bb)(10);/i],[[N,"BlackBerry"],C],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[N,C],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[N,"Symbian"],C],[/\((series40);/i],[N],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[N,"Firefox OS"],C],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[[N,"Linux"],C],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[N,"Chromium OS"],C],[/(sunos)\s?([\w\.\d]*)/i],[[N,"Solaris"],C],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[[N,"Linux"],C],[/(iphone)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[N,"iOS"],[C,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[N,"iOS"],[C,/_/g,"."]],[/(haiku)\s(\w+)/i],[N,C],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[C,/_/g,"."],[N,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[N,"Mac"],[C,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[N,C]]},U);function U(){}iI.generate=function(e,t){var r,n,e=void 0===e?{navigator:{userAgent:"",vendor:"",languages:[]},screen:{width:"",height:""}}:e,i=rI.parse(e.navigator.userAgent).browser,o="";try{o=null!=(n=null==(r=screen.orientation.type.match(/\b(landscape|portrait)\b/))?void 0:r[0])?n:""}catch(e){}return c({browserName:i.name||"",browserMajorVersion:i.major||"",browserVersion:i.version||"",orientation:o,userAgent:e.navigator.userAgent||""},t.toProperties())};var nI=iI;function iI(){}sI.generate=function(e){var t,r,n,i,e=void 0===e?{navigator:{userAgent:"",vendor:"",languages:[]},screen:{width:"",height:""}}:e,o=rI.parse(e.navigator.userAgent),s=o.os,o=o.device,a=e.screen,e=(null==(e=e.navigator.languages)?void 0:e[0])||"",u=e.split("-")[0],c=(null!=(c=o.type)?c:"pc").replace(/\b(mobile|smarttv)\b/g,function(e,t){return"mobile"===t?"phone":"smarttv"===t?"tv":e}),p=s.name||"",l="";try{p=null!=(r=null==(t=p.match(/\b(Mac|Windows|Linux|Android|iOS)\b/))?void 0:t[0])?r:p,orientation=null!=(i=null==(n=a.orientation.type.match(/\b(landscape|portrait)\b/))?void 0:n[0])?i:"",l=Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){}return{osName:p,osVersion:s.version||"",deviceModel:o.model||"",deviceType:c,deviceVendor:o.vendor||"",deviceBrand:o.vendor||"",screenWidth:a.width||"",screenHeight:a.height||"",locale:e,language:u,timeZone:l}};var oI=sI;function sI(){}uI.generate=function(e,t){t=null!=t?t:qo.createWithCurrentPage();return c(c({platform:"Web"},nI.generate(e,t)),oI.generate(e))};var aI=uI;function uI(){}pI.prototype.map=function(e){return new pI(e(this.previous),e(this.current))};var cI=pI;function pI(e,t){this.previous=e,this.current=t}fI.empty=function(){return this.from([])},fI.from=function(e){return new fI(e)},fI.fromDto=function(e){return this.from(e.events.map(function(e){return ri.fromJson(e)}))},Object.defineProperty(fI.prototype,"rawEvents",{get:function(){return this.events},enumerable:!1,configurable:!0});var lI=fI;function fI(e){this.events=e}dI.prototype.initContext=function(e,t){e=null!=(t=null!=t?t:e)?t:this.defaultUser;return gI.of(EI(e,this.hackleDeviceId),Z_.empty(),lI.empty())},dI.prototype.addListener=function(e){this.userListeners.push(e)},Object.defineProperty(dI.prototype,"currentUser",{get:function(){return this.context.user},enumerable:!1,configurable:!0}),dI.prototype.resolve=function(e){e=this.resolveContext(e);return this.hackleUser(e)},dI.prototype.resolveContext=function(e){return void 0===e?this.context:("string"==typeof e?this.updateUser({id:e}):this.updateUser(e)).current},dI.prototype.toHackleUser=function(e){e=this.context.with(e);return this.hackleUser(e)},dI.prototype.hackleUser=function(e){var t=(new Gt).addIdentifiers(e.user.identifiers||{}).add(jt.ID,e.user.id||this.hackleDeviceId).add(jt.DEVICE,e.user.deviceId||this.hackleDeviceId).add(jt.HACKLE_DEVICE,this.hackleDeviceId),t=(p.isNotNullOrUndefined(e.user.userId)&&t.add(jt.USER,e.user.userId),t.build()),r=this.campaignParser.parse();return{identifiers:t,properties:c(c({},r),e.user.properties),hackleProperties:this.hackleProperties(),cohorts:e.cohorts.rawCohorts,targetEvents:e.targetEvents.rawEvents}},dI.prototype.hackleProperties=function(){return"undefined"!=typeof window?aI.generate(window,this.pageManager.currentPage):{}},dI.prototype.setUser=function(e){return this.updateUser(e).map(function(e){return e.user})},dI.prototype.setUserId=function(e){e=c(c({},this.context.user),{userId:e});return this.setUser(e)},dI.prototype.setDeviceId=function(e){e=c(c({},this.context.user),{deviceId:e});return this.setUser(e)},dI.prototype.updateUserProperties=function(e){return this.operateProperties(e).map(function(e){return e.user})},dI.prototype.resetUser=function(){var e=this;return this.updateContext(function(){return e.defaultUser}).map(function(e){return e.user})},dI.prototype.changeUser=function(t,r,n){this.userListeners.forEach(function(e){e.onUserUpdated(t,r,n)})},dI.prototype.saveUser=function(e){this.storage.saveUser(e)},dI.prototype.updateContext=function(e){var t=this.context,r=t.user,e=e(r),n=this.context.with(e);return this.context=n,X_(r,e)||(this.changeUser(r,e,this.clock.currentMillis()),this.saveUser(e)),new cI(t,n)},dI.prototype.updateUser=function(r){var n=this;return this.updateContext(function(e){return e=e,t=EI(r,n.hackleDeviceId),X_(e,t)?c(c({},t),{properties:c(c({},e.properties),t.properties)}):t;var t})},dI.prototype.operateProperties=function(r){return this.updateContext(function(e){var t=null!=(t=e.properties)?t:{},t=r.operate(new Map(Object.entries(t)));return c(c({},e),{properties:p.fromMap(t)})})},dI.prototype.sync=function(){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.syncCohort(),this.syncUserTarget()])];case 1:return e.sent(),[2]}})})},dI.prototype.syncIfNeeded=function(t){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return this.hasNewIdentifiers(t.previous,t.current)?[4,this.syncCohort()]:[3,2];case 1:e.sent(),e.label=2;case 2:return X_(t.previous,t.current)?[3,4]:[4,this.syncUserTarget()];case 3:e.sent(),e.label=4;case 4:return[2]}})})},dI.prototype.syncCohort=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.userCohortFetcher.fetch(this.currentUser)];case 1:return t=e.sent(),this.context=this.context.update(t,this.context.targetEvents),[3,3];case 2:return t=e.sent(),l.log.error("Failed to sync cohorts: ".concat(t)),[3,3];case 3:return[2]}})})},dI.prototype.syncUserTarget=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.userTargetFetcher.fetch(this.currentUser)];case 1:return t=e.sent(),this.context=this.context.update(this.context.cohorts,t),[3,3];case 2:return t=e.sent(),l.log.error("Failed to sync userTargets: ".concat(t)),[3,3];case 3:return[2]}})})},dI.prototype.hasNewIdentifiers=function(e,t){var r=Kt(e),e=Kt(t);return Object.entries(e).some(function(e){var t=e[0],e=e[1];return r[t]!==e})},dI.prototype.close=function(){return a(this,void 0,void 0,function(){return u(this,function(e){return[2]})})};var hI=dI;function dI(e,t,r,n,i,o,s,a,u){this.hackleDeviceId=e,this.storage=t,this.userTargetFetcher=r,this.userCohortFetcher=n,this.campaignParser=i,this.pageManager=o,this.clock=s,this.userListeners=[],this.defaultUser={id:this.hackleDeviceId,deviceId:this.hackleDeviceId},this.context=this.initContext(a,u),this.storage.saveUser(this.context.user)}vI.prototype.getUser=function(){var e=this.deviceId||void 0,t=this.userId||void 0;return void 0!==e||void 0!==t?{deviceId:e,userId:t}:null},vI.prototype.saveUser=function(e){this.setDeviceId(e.deviceId||null),this.setUserId(e.userId||null)},Object.defineProperty(vI.prototype,"deviceId",{get:function(){return this.storage.getItem(it)},enumerable:!1,configurable:!0}),Object.defineProperty(vI.prototype,"userId",{get:function(){return this.storage.getItem(nt)},enumerable:!1,configurable:!0}),vI.prototype.setDeviceId=function(e){this.setId(it,e)},vI.prototype.setUserId=function(e){this.setId(nt,e)},vI.prototype.setId=function(e,t){p.isNotNullOrUndefined(t)?this.storage.setItem(e,t):this.storage.removeItem(e)};var yI=vI;function vI(e){this.storage=e}mI.of=function(e,t,r){return new mI(e,t.filterBy(e),r)},mI.prototype.with=function(e){return mI.of(e,this.cohorts.filterBy(e),this.targetEvents)},mI.prototype.update=function(e,t){e=e.filterBy(this.user),e=this.cohorts.toBuilder().putAll(e).build();return mI.of(this.user,e,t)};var gI=mI;function mI(e,t,r){this.user=e,this.cohorts=t,this.targetEvents=r}var EI=function(e,t){return c(c({},e),{id:e.id||t,deviceId:e.deviceId||t})},wI=(Object.defineProperty(bI.prototype,"currentSessionId",{get:function(){return this._currentSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(bI.prototype,"sessionId",{get:function(){var e;return null!=(e=this._currentSessionId)?e:bI.EMPTY_SESSION_ID},enumerable:!1,configurable:!0}),Object.defineProperty(bI.prototype,"lastEventTime",{get:function(){return this._lastEventTime},enumerable:!1,configurable:!0}),bI.prototype.addListener=function(e){this.sessionListeners.push(e)},bI.prototype.startNewSession=function(e,t,r){return e&&this.endSession(e),this.newSession(t,r)},bI.prototype.startNewSessionIfNeeded=function(e,t){var r=this._lastEventTime;return null!==r&&null!==this._currentSessionId&&t-r<this.sessionTimeoutMillis?(this.updateLastEventTime(t),this._currentSessionId):this.startNewSession(e,e,t)},bI.prototype.updateLastEventTime=function(e){this._lastEventTime=e,this.storage.setItem(rt,"".concat(e))},bI.prototype.endSession=function(t){var r=this._currentSessionId,n=this._lastEventTime;null!==r&&null!==n&&this.sessionListeners.forEach(function(e){return e.onSessionEnded(r,t,n)})},bI.prototype.newSession=function(t,r){var n="".concat(r,".").concat(K().slice(0,8));return this.saveSession(n),this.updateLastEventTime(r),this.sessionListeners.forEach(function(e){e.onSessionStarted(n,t,r)}),n},bI.prototype.saveSession=function(e){this._currentSessionId=e,this.storage.setItem(tt,e)},bI.prototype.loadSession=function(){this._currentSessionId=this.storage.getItem(tt)},bI.prototype.loadLastEventTime=function(){var e=this.storage.getItem(rt);null!==e&&0<(e=Number.parseFloat(e))&&(this._lastEventTime=e)},bI.prototype.onUserUpdated=function(e,t,r){this.endSession(e),this.newSession(t,r)},bI.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.updateLastEventTime(t);case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}},bI.EMPTY_SESSION_ID="0.ffffffff",bI);function bI(e,t){this.sessionTimeoutMillis=e,this.storage=t,this.sessionListeners=[],this._currentSessionId=null,this._lastEventTime=null,this.loadSession(),this.loadLastEventTime()}_I.prototype.getItem=function(e){var t;return null!=(t=null==(t=this.storage)?void 0:t.getItem(e))?t:null},_I.prototype.removeItem=function(e){var t;null!=(t=this.storage)&&t.removeItem(e)},_I.prototype.setItem=function(e,t){var r;null!=(r=this.storage)&&r.setItem(e,t)},_I.prototype.clear=function(){var e;null!=(e=this.storage)&&e.clear()};var TI=_I;function _I(){this.storage=window.localStorage}AI.postfix=function(e,t){return new AI(e,function(e){return"".concat(e).concat(t)})},AI.prefix=function(e,t){return new AI(e,function(e){return"".concat(t).concat(e)})},AI.prototype.getItem=function(e){return this.delegate.getItem(this.transform(e))},AI.prototype.removeItem=function(e){this.delegate.removeItem(this.transform(e))},AI.prototype.setItem=function(e,t){this.delegate.setItem(this.transform(e),t)};var II=AI;function AI(e,t){this.delegate=e,this.transform=t}OI.prototype.isEqualItem=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},OI.prototype.getRemainListSize=function(){try{return this.maxLength-JSON.stringify(this.getList()).length}catch(e){return 0}},OI.prototype.isAddableItem=function(e){try{return this.getRemainListSize()>JSON.stringify(e).length}catch(e){return!1}},OI.prototype.getVictimIndex=function(e){var t=this.getRemainListSize();try{var r=JSON.stringify(e),n=this.getList(),i=0;return n.findIndex(function(e){return(i+=JSON.stringify(e).length)+t>=r.length})}catch(e){return-1}},OI.prototype.getList=function(){try{var e=this.delegate.getItem(this.listKey);if(!e)return[];var t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return[]}},OI.prototype.entries=function(){return this.getList().flatMap(Object.entries)},OI.prototype.setItem=function(e,t){var r;try{this.removeItem(e);var n=this.getList(),i=((r={})[e]=t,r);if(!this.isAddableItem(i)){var o=this.getVictimIndex(i);if(o<0)return;n=n.slice(o+1)}var s=JSON.stringify(n.concat(i));this.delegate.setItem(this.listKey,s)}catch(e){}},OI.prototype.getItem=function(t){var r=this,e=this.getList().find(function(e){return r.isEqualItem(e,t)});if(e&&e[t])return e[t]},OI.prototype.removeItem=function(t){var r=this,e=this.getList();try{var n=e.filter(function(e){return!r.isEqualItem(e,t)}),i=JSON.stringify(n);this.delegate.setItem(this.listKey,i)}catch(e){}},OI.prototype.clear=function(){this.delegate.removeItem(this.listKey)};var NI=OI;function OI(e,t,r){void 0===r&&(r=4096);var n=this;this.delegate=e,this.listKey=t,this.encodedListCharLen=6,this.resolveMaxLength=function(e){e-=n.encodedListCharLen;return e<0?0:e},this.maxLength=this.resolveMaxLength(r)}SI.prototype.currentUser=function(){return this.userManager.resolve()},SI.prototype.getAbTestDecisions=function(){return this.core.experiments(this.currentUser()).entries()},SI.prototype.getAbTestOverrides=function(){return this.abOverrideStorage.getAll()},SI.prototype.setAbTestOverride=function(e,t){this.abOverrideStorage.set(e,t),this.increment("AB_TEST","set")},SI.prototype.resetAbTestOverride=function(e){this.abOverrideStorage.remove(e),this.increment("AB_TEST","reset")},SI.prototype.resetAllAbTestOverride=function(){this.abOverrideStorage.clear(),this.increment("AB_TEST","reset.all")},SI.prototype.getFeatureFlagDecisions=function(){return this.core.featureFlags(this.currentUser()).entries()},SI.prototype.getFeatureFlagOverrides=function(){return this.ffOverrideStorage.getAll()},SI.prototype.setFeatureFlagOverride=function(e,t){this.ffOverrideStorage.set(e,t),this.increment("FEATURE_FLAG","set")},SI.prototype.resetFeatureFlagOverride=function(e){this.ffOverrideStorage.remove(e),this.increment("FEATURE_FLAG","reset")},SI.prototype.resetAllFeatureFlagOverride=function(){this.ffOverrideStorage.clear(),this.increment("FEATURE_FLAG","reset.all")},SI.prototype.increment=function(e,t){Fi.counter("experiment.manual.override",{"experiment.type":e,operation:t}).increment()};var PI=SI;function SI(e,t,r,n){this.core=e,this.userManager=t,this.abOverrideStorage=r,this.ffOverrideStorage=n}RI.serverFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},RI.clientFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},RI.userCohorts=function(e){return"".concat(e,"/api/v1/cohorts")},RI.serverDispatch=function(e){return"".concat(e,"/api/v2/events")},RI.clientDispatch=function(e){return"".concat(e,"/api/v2/w/events")},RI.beaconDispatch=function(e,t){return"".concat(e,"/api/v2/w/").concat(t,"/events")},RI.inAppMessageRenderer=function(e,t){return"".concat(e,"/sdk/iam-renderer/").concat(t,"/iam-renderer.js")},RI.monitoring=function(e){return"".concat(e,"/metrics")},RI.userTargets=function(e){return"".concat(e,"/api/v1/user-targets")};var MI=RI;function RI(){}xI.prototype.exist=function(e,t){var e=this.key(e),r=this.storage.getItem(e);if(p.isNullOrUndefined(r))return!1;r=Number.parseInt(r,10);return!Number.isNaN(r)&&t<=r||(this.storage.removeItem(e),!1)},xI.prototype.put=function(e,t){this.storage.setItem(this.key(e),"".concat(t))},xI.prototype.key=function(e){return"".concat(e.key)};var CI=xI;function xI(e){this.storage=e}kI.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var UI=kI;function kI(e){this.handlers=e}LI.prototype.handle=function(e,t){e.close()},LI.prototype.supports=function(e){return"CLOSE"===e.type};var DI=LI;function LI(){}VI.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){l.log.error("Invalid url: ".concat(t.value))}},VI.prototype.supports=function(e){return"WEB_LINK"===e.type};var FI=VI;function VI(e){this.urlHandler=e}BI.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){l.log.error("Invalid url: ".concat(t.value))}},BI.prototype.supports=function(e){return"LINK_AND_CLOSE"===e.type};var jI=BI;function BI(e){this.urlHandler=e}GI.prototype.handle=function(e,t){var r;e.context.decisionReason!==h.OVERRIDDEN&&(r=this.clock.currentMillis()+864e5,this.storage.put(e.context.inAppMessage,r)),e.close()},GI.prototype.supports=function(e){return"HIDDEN"===e.type};var KI=GI;function GI(e,t){this.storage=e,this.clock=t}zI.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){l.log.error("Invalid url: ".concat(t.value))}},zI.prototype.supports=function(e){return"LINK_NEW_WINDOW"===e.type};var HI=zI;function zI(e){this.urlHandler=e}JI.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){l.log.error("Invalid url: ".concat(t.value))}},JI.prototype.supports=function(e){return"LINK_NEW_WINDOW_AND_CLOSE"===e.type};var YI=JI;function JI(e){this.urlHandler=e}WI.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){l.log.error("Invalid url: ".concat(t.value))}},WI.prototype.supports=function(e){return"LINK_NEW_TAB"===e.type};var qI=WI;function WI(e){this.urlHandler=e}XI.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){l.log.error("Invalid url: ".concat(t.value))}},XI.prototype.supports=function(e){return"LINK_NEW_TAB_AND_CLOSE"===e.type};var $I=XI;function XI(e){this.urlHandler=e}QI.prototype.track=function(e,t,r){t=this.createTrackEvent(t,e);this.core.track(t,e.user,r)},QI.prototype.commonProperties=function(e){return c(c({},e.properties),{in_app_message_id:e.inAppMessage.id,in_app_message_key:e.inAppMessage.key,in_app_message_display_type:e.message.layout.displayType,decision_reason:String(e.decisionReason)})},QI.prototype.createTrackEvent=function(e,t){switch(e.type){case"IMPRESSION":return{key:"$in_app_impression",properties:c(c({},this.commonProperties(t)),{title_text:null==(r=null==(r=t.message.text)?void 0:r.title)?void 0:r.text,body_text:null==(r=null==(r=t.message.text)?void 0:r.body)?void 0:r.text,button_text:t.message.buttons.map(function(e){return e.text}),image_url:t.message.images.map(function(e){return e.imagePath})})};case"CLOSE":return{key:"$in_app_close",properties:this.commonProperties(t)};case"ACTION":var r=e;return{key:"$in_app_action",properties:c(c({},this.commonProperties(t)),{action_type:r.action.type,action_area:r.area,action_value:r.action.value,button_text:r.buttonText,image_url:r.imageUrl,image_order:r.imageOrder})};case"IMAGE_IMPRESSION":r=e;return{key:"$in_app_image_impression",properties:c(c({},this.commonProperties(t)),{image_url:r.imageUrl,image_order:r.imageOrder})}}};var ZI=QI;function QI(e){this.core=e}tA.prototype.setListener=function(e){this.inAppMessageListener=e},tA.prototype.present=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:if(this.currentMessageView)return[2];if(this.opening)return[2];this.opening=!0,t=null,e.label=1;case 1:return(e.trys.push([1,3,4,5]),null===(t=this.messageViewFactory.create(r,this)))?[2]:[4,(this.currentMessageView=t).open()];case 2:return e.sent(),[3,5];case 3:return e.sent(),null!=t&&t.close(),[3,5];case 4:return this.opening=!1,[7];case 5:return[2]}})})};var eA=tA;function tA(e,t,r,n){void 0===n&&(n=null),this.messageViewFactory=e,this.eventHandler=t,this.interactionHandlerFactory=r,this.inAppMessageListener=n,this.currentMessageView=null,this.opening=!1}nA.prototype.open=function(){var o,s;return a(this,void 0,void 0,function(){var r,t,n,i=this;return u(this,function(e){switch(e.label){case 0:if(!this.status.canOpen())return l.log.debug("InAppMessage is already opened. (key=".concat(this.context.inAppMessage.key,")")),[2];r=Zo.toPublic(this.context.inAppMessage),e.label=1;case 1:return e.trys.push([1,4,,5]),null!=(s=null==(o=this.ui.inAppMessageListener)?void 0:o.beforeInAppMessageOpen)&&s.call(o,r),this.status.current="OPENING",window.addEventListener(nA.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.addEventListener(nA.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE,this.resolveLifecycleEnd),[4,this.scriptLoader.load()];case 2:return e.sent(),(t=this.addContainer()).style.display="none",t.classList.add("".concat(nA.CONTAINER_CLASS_NAME,"--loading")),n=window.HackleInAppMessageRenderer,this.renderer=new n.HackleInAppMessageRenderer(t),n=this.renderTypeResolver.resolve(this.context),[4,this.renderer.render({messageId:this.context.inAppMessage.id,message:this.context.message.toJson(),renderType:n})];case 3:return e.sent(),t.classList.remove("".concat(nA.CONTAINER_CLASS_NAME,"--loading")),t.style.display="block",this.handleInAppMessageLifecycle("OPEN",function(){var e,t;i.handleEvent({type:"IMPRESSION"}),i.status.current="OPENED",null!=(t=null==(e=i.ui.inAppMessageListener)?void 0:e.afterInAppMessageOpen)&&t.call(e,r)},function(){l.log.warn("Failed to open inAppMessage with [Timeout expired.]"),i.destroy()}),[3,5];case 4:return e.sent(),this.destroy(),[3,5];case 5:return[2]}})})},nA.prototype.close=function(){var e,t,r,n=this;this.status.canClose()?(r=Zo.toPublic(this.context.inAppMessage),null!=(t=null==(e=this.ui.inAppMessageListener)?void 0:e.beforeInAppMessageClose)&&t.call(e,r),this.status.current="CLOSING",this.handleInAppMessageLifecycle("CLOSE",function(){var e,t;n.handleEvent({type:"CLOSE"}),n.destroy(),null!=(t=null==(e=n.ui.inAppMessageListener)?void 0:e.afterInAppMessageClose)&&t.call(e,r)},function(){var e,t;l.log.warn("Failed to close inAppMessage with [Timeout expired.]"),n.destroy(),null!=(t=null==(e=n.ui.inAppMessageListener)?void 0:e.afterInAppMessageClose)&&t.call(e,r)})):l.log.debug("InAppMessage is already closed. (key=".concat(this.context.inAppMessage.key,")"))},nA.prototype.handleInAppMessageLifecycle=function(e,t,r){var n=this,i=this.lifecycleRegistry.register(e,t);window.dispatchEvent(new CustomEvent(nA.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE,{detail:{type:e,id:i}})),setTimeout(function(){void 0!==n.lifecycleRegistry.getAndRemove(e,i)&&r()},nA.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT)},nA.prototype.destroy=function(){var e;window.removeEventListener(nA.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.removeEventListener(nA.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE,this.resolveLifecycleEnd),null!=(e=this.renderer)&&e.destroy(),this.renderer=null,this.removeContainer(),this.ui.currentMessageView=null,this.status.current="CLOSED"},nA.prototype.addContainer=function(){var e;return this.container||((e=document.createElement("div")).classList.add(nA.CONTAINER_CLASS_NAME),this.container=e),this.container.parentNode||document.body.appendChild(this.container),this.container},nA.prototype.removeContainer=function(){var e;this.container&&(null!=(e=this.container.parentNode)&&e.removeChild(this.container),this.container=null)},nA.prototype.handleInteraction=function(e){var t=this.ui.interactionHandlerFactory.get(e);t&&t.handle(this,e)},nA.prototype.handleEvent=function(e){this.ui.eventHandler.handle(this,e)},nA.HACKLE_IAM_INTERACTION_EVENT_TYPE="hackle-iam-interaction",nA.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE="hackle-iam-lifecycle-start",nA.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE="hackle-iam-lifecycle-end",nA.CONTAINER_CLASS_NAME="hackle-iam",nA.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT=5e3;var rA=nA;function nA(e,t,r,n,i,o){var s=this;this.scriptLoader=e,this.context=t,this.ui=r,this.renderTypeResolver=n,this.status=i,this.lifecycleRegistry=o,this.container=null,this.renderer=null,this.resolveLifecycleEnd=function(e){var t;e instanceof CustomEvent&&("string"==typeof(t=e).detail.id&&["OPEN","CLOSE"].includes(t.detail.type))&&(e=(t=e.detail).id,t=t.type,null!=(t=s.lifecycleRegistry.getAndRemove(t,e))&&t())},this.handleInAppMessageInteraction=function(e){e instanceof CustomEvent&&e.type===nA.HACKLE_IAM_INTERACTION_EVENT_TYPE&&(e=e.detail,s.handleInteraction(e))}}oA.prototype.isMobileOS=function(e){e=e.user.hackleProperties.osName;return"string"==typeof e&&Boolean(e.match(this.mobileOSRegex))},oA.prototype.isMobileDeviceType=function(e){e=e.user.hackleProperties.deviceType;return"string"==typeof e&&Boolean(e.match(this.mobileDeviceRegex))},oA.prototype.resolve=function(e){return this.isMobileOS(e)||this.isMobileDeviceType(e)?"mobile":"pc"};var iA=oA;function oA(){this.mobileOSRegex=/(iOS|Android|iPad|iPhone)/g,this.mobileDeviceRegex=/(mobile|phone|tablet)/g}aA.prototype.canOpen=function(){return"OPENED"!==this.current&&"OPENING"!==this.current},aA.prototype.canClose=function(){return"CLOSED"!==this.current&&"CLOSING"!==this.current};var sA=aA;function aA(e){this.current=e=void 0===e?"CLOSED":e}cA.prototype.resolveKey=function(e,t){return"".concat(e,"_").concat(t)},cA.prototype.register=function(e,t){var r=K(),e=this.resolveKey(e,r);return this.record[e]=t,r},cA.prototype.getAndRemove=function(e,t){var e=this.resolveKey(e,t),t=this.record,r=t[e],t=function(e,t){var r={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}(t,["symbol"==typeof e?e:e+""]);return this.record=t,r};var uA=cA;function cA(){this.record={}}lA.create=function(e){return new lA(e)},lA.prototype.create=function(e,t){var r=new iA,n=new sA,i=new uA;switch(e.message.layout.displayType){case"MODAL":case"BANNER":case"BOTTOM_SHEET":return new rA(this.scriptLoader,e,t,r,n,i);case"NONE":return null}};var pA=lA;function lA(e){this.scriptLoader=e}hA.prototype.load=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return window.HackleInAppMessageRenderer?[2]:(t=this.createScript(),document.head.appendChild(t),[4,this.waitForLoad(t)]);case 1:return[2,e.sent()]}})})},hA.prototype.createScript=function(){var e=document.createElement("script");return e.type="text/javascript",e.async=!0,e.src=this.scriptUrl,e},hA.prototype.waitForLoad=function(o){return new Promise(function(e,t){function r(){o.removeEventListener("error",i),o.removeEventListener("load",n)}var n=function(){r(),e(o)},i=function(e){r(),t(e.message)};o.addEventListener("load",n),o.addEventListener("error",i)})};var fA=hA;function hA(e){this.scriptUrl=e}yA.prototype.matches=function(t,r,n){var i=this;return r.eventTrigger.rules.some(function(e){return i.ruleMatches(t,n,r,e)})},yA.prototype.ruleMatches=function(e,t,r,n){if(t.event.key!==n.eventKey)return!1;e=vA.of(e,t,r);return this.targetMatcher.anyMatches(e,O0.create(),n.targets)};var dA=yA;function yA(e){this.targetMatcher=e}gA.of=function(e,t,r){return new gA(new A0("IN_APP_MESSAGE",r.id),e,t.user,t)};var vA=gA;function gA(e,t,r,n){this.key=e,this.workspace=t,this.user=r,this.event=n}EA.prototype.get=function(e){e=this.storage.getItem(e.id.toString());return p.isNullOrUndefined(e)?[]:JSON.parse(e)},EA.prototype.set=function(e,t){this.storage.setItem(e.id.toString(),JSON.stringify(t))};var mA=EA;function EA(e){this.storage=e}bA.prototype.get=function(t){return this.processors.find(function(e){return e.supports(t)})};var wA=bA;function bA(e){this.processors=e}_A.prototype.process=function(e,t,r){},_A.prototype.supports=function(e){return"IMPRESSION"===e.type};var TA=_A;function _A(){}AA.prototype.process=function(e,t,r){},AA.prototype.supports=function(e){return"CLOSE"===e.type};var IA=AA;function AA(){}OA.prototype.process=function(e,t,r){var n,i,o=this.actionHandlerFactory.get(t.action);!(null==(i=null==(n=e.ui.inAppMessageListener)?void 0:n.onInAppMessageClick)?void 0:i.call(n,Zo.toPublic(e.context.inAppMessage),es.toPublic(e),Wn.fromAction(t.action)))&&e.status.canClose()&&null!=o&&o.handle(e,t.action)},OA.prototype.supports=function(e){return"ACTION"===e.type};var NA=OA;function OA(e){this.actionHandlerFactory=e}SA.prototype.handle=function(e,t){var r=this.clock.currentMillis(),n=(this.eventTracker.track(e.context,t,r),this.eventProcessorFactory.get(t));n&&n.process(e,t,r)};var PA=SA;function SA(e,t,r){this.clock=e,this.eventTracker=t,this.eventProcessorFactory=r}RA.prototype.matches=function(e,t,r){return this.ruleMatcher.matches(e,t,r)};var MA=RA;function RA(e){this.ruleMatcher=e}xA.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var CA=xA;function xA(e){this.handlers=e}kA.prototype.handle=function(e,t){e.close()},kA.prototype.supports=function(e){return"CLOSE"===e.type};var UA=kA;function kA(){}LA.prototype.handle=function(e,t){t=this.eventOrNull(t);t&&this.eventHandler.handle(e,t)},LA.prototype.eventOrNull=function(e){var t=Bn.fromJson(e.action);return t?{type:"ACTION",action:t,area:e.area,buttonText:e.buttonText,imageUrl:e.imageUrl,imageOrder:e.imageOrder}:null},LA.prototype.supports=function(e){return"ACTION"===e.type};var DA=LA;function LA(e){this.eventHandler=e}VA.prototype.handle=function(e,t){t={type:"IMAGE_IMPRESSION",imageUrl:t.imageUrl,imageOrder:t.imageOrder};this.eventHandler.handle(e,t)},VA.prototype.supports=function(e){return"IMAGE_IMPRESSION"===e.type};var FA=VA;function VA(e){this.eventHandler=e}BA.prototype.open=function(e){window.location.href=e.href};var jA=BA;function BA(){}GA.prototype.open=function(e){window.open(e.href,"Hackle","resizable:true")};var KA=GA;function GA(){}zA.prototype.open=function(e){window.open(e.href)};var HA=zA;function zA(){}JA.prototype.open=function(e){window.location.replace(e)};var YA=JA;function JA(){}function qA(e,t,r){return null===e||(!XA(t,WA)||r.current!==r.referrer)&&!XA(e,t)}var WA={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,gclid:void 0,fbclid:void 0},$A={current:void 0,referrer:void 0},XA=function(t,r){return Object.keys(WA).every(function(e){return t[e]===r[e]})},ZA=(QA.prototype.startNewCampaign=function(e,t,r){for(var t=c(c({},WA),t),n=new Ko,i=0,o=Object.entries(t);i<o.length;i++){var s=o[i],a=s[0],s=s[1];s?n.set(a,s):n.unset(a)}var t=n.build(),u=t.toEvent(),e=this.userManager.toHackleUser(e);this.core.track(u,e,r),this.userManager.updateUserProperties(t)},QA.prototype.startNewCampaignIfNeeded=function(e,t){var r=this.storage.get(),n=this.parser.parse(),i=this.parser.parseDomain();qA(r,n,i)&&(this.storage.set(n),this.startNewCampaign(e,n,t))},QA.prototype.onSessionEnded=function(e,t,r){},QA.prototype.onSessionStarted=function(e,t,r){this.startNewCampaignIfNeeded(t,r)},QA);function QA(e,t,r,n){this.storage=e,this.parser=t,this.core=r,this.userManager=n}tN.prototype.get=function(){var e=this.storage.getItem(ot);return e?JSON.parse(e):null},tN.prototype.set=function(e){this.storage.setItem(ot,JSON.stringify(e))};var eN=tN;function tN(e){this.storage=e}nN.prototype.getQueryParam=function(e){return this.getQueryParams(function(){return!0})[e]||""},nN.prototype.getQueryParams=function(e){for(var t={},r=0,n=this.search.substring(1).split("&");r<n.length;r++){var i=n[r].split("="),o=i[0],i=i[1];e&&!e(o,i)||(i=as.tryDecodeURIComponent(i))&&(t[o]=i)}return t};var rN=nN;function nN(e){this.search=e}oN.extractDomain=function(e){var t=this.DOMAIN_MATCH_REGEX,r=e.split("."),r=r[r.length-1],r=((4<r.length||"com"===r||"org"===r)&&(t=this.SIMPLE_DOMAIN_MATCH_REGEX),e.match(t));return r?r[0]:e},oN.DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,oN.SIMPLE_DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i;var iN=oN;function oN(){}aN.prototype.parse=function(e){e=this.params(e);return this.resolve(e)},aN.prototype.params=function(e){e=p.isNotNullOrUndefined(e)?e:this.pageManager.currentPage.queryParameter;return new rN(e).getQueryParams(aN.CAMPAIGN_QUERY_CONDITION)},aN.prototype.resolve=function(e){return{utm_campaign:e[uN],utm_content:e[cN],utm_id:e[pN],utm_medium:e[lN],utm_source:e[fN],utm_term:e[hN],gclid:e[dN],fbclid:e[yN]}},aN.prototype.parseDomain=function(){var t=this;if("undefined"==typeof window)return $A;return{current:iN.extractDomain(this.pageManager.currentPage.hostname),referrer:function(){var e=t.pageManager.currentPage.referrer;if(e)return e=new URL(e).hostname,iN.extractDomain(e)}()}},aN.CAMPAIGN_QUERY_CONDITION=function(e,t){return ji.isNotEmptyString(t)};var sN=aN;function aN(e){this.pageManager=e}var uN="utm_campaign",cN="utm_content",pN="utm_id",lN="utm_medium",fN="utm_source",hN="utm_term",dN="gclid",yN="fbclid",vN=(gN.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},gN.prototype.send=function(e){var t=e.experiment.key,r=e.variationKey,t="HACKLE-EXPERIMENT_".concat(t,"_V").concat(e.experiment.version,"-").concat(r);try{window.gtag("event","experience_impression",{exp_variant_string:t})}catch(e){l.log.error("Unexpected exception while sending an event to Google Analytics with gtag: ".concat(e))}},gN);function gN(e,t){var r=this;this.userEventEmitter=e,this.determiner=t,this.onEvent=function(e){e=r.determiner.determineTargetExposureOrNull(e);e&&r.send(e)},this.initialize()}EN.prototype.determineTargetExposureOrNull=function(e){var t=this.workspaceFetcher.get();return!t||!t.getAttributes().integration_ga_experiment||!Xb.isExposureEvent(e)||"RUNNING"!==e.experiment.status||e.decisionReason!==h.TRAFFIC_ALLOCATED?null:e};var mN=EN;function EN(e){this.workspaceFetcher=e}var wN={user:void 0,debug:!1,log_disabled:!1,automaticPageTracking:!0,pollingIntervalMillis:-1,exposureEventDedupIntervalMillis:6e4,sessionTimeoutMillis:18e5,autoOpenDevTool:!1,sdkUrl:"https://sdk-api.hackle.io",eventUrl:"https://event-api.hackle.io",monitoringUrl:"https://monitoring.hackle.io",cdnUrl:"https://static.hackle.io",sameSiteCookie:"LAX",secureCookie:!1,SDK_NAME_HEADER:"javascript-sdk_browser",SDK_VERSION_HEADER:"11.52.0",IAM_RENDERER_VERSION_HEADER:"0.0.12"},bN=(TN.config=function(e){return c(c(c({},wN),e),{automaticPageTracking:TN.resolveAutomaticPageTracking(e)})},TN.resolveAutomaticPageTracking=function(e){return"boolean"!=typeof(null==e?void 0:e.automaticPageTracking)&&"boolean"!=typeof(null==e?void 0:e.auto_track_page_view)?wN.automaticPageTracking:!!e.automaticPageTracking||!!e.auto_track_page_view},TN.logging=function(e){l.initCounter(function(e){return Fi.counter("log",{level:e})}),l.setLogLevel(Ae.INFO),e.log_disabled?l.setLogLevel(Ae.DISABLE):e.debug&&l.setLogLevel(Ae.DEBUG)},TN.sdk=function(e,t){return l.log.debug("SDK key: ".concat(e)),e||l.log.error("invalid sdk key: '".concat(e,"' (expected: not null, not undefined and not empty string)")),{key:e,name:t.SDK_NAME_HEADER,version:t.SDK_VERSION_HEADER}},TN.isBeaconSupported=function(){var e=!1;return"undefined"!=typeof window&&(e=window&&window.navigator&&!!window.navigator.sendBeacon&&!0)&&l.log.debug("support sendBeacon API"),e},TN.pollingIntervalMillis=function(e){return void 0===e.pollingIntervalMillis||"number"!=typeof e.pollingIntervalMillis||e.pollingIntervalMillis<=0?-1:Math.max(e.pollingIntervalMillis,6e4)},TN.dedupIntervalMillis=function(e){return void 0===e.exposureEventDedupIntervalMillis||"number"!=typeof e.exposureEventDedupIntervalMillis?6e4:e.exposureEventDedupIntervalMillis<1e3||36e5<e.exposureEventDedupIntervalMillis?(l.log.warn("Exposure event dedup interval is outside allowed range[1_000ms..3_600_000ms]. Setting to default value[1m]."),6e4):e.exposureEventDedupIntervalMillis},TN);function TN(){}IN.prototype.add=function(e){this.synchronizers.push(e)},IN.prototype.sync=function(){return a(this,void 0,void 0,function(){var t=this;return u(this,function(e){switch(e.label){case 0:return[4,Promise.all(this.synchronizers.map(function(e){return t.safe(e.sync())}))];case 1:return e.sent(),[2]}})})},IN.prototype.close=function(){return a(this,void 0,void 0,function(){var t=this;return u(this,function(e){switch(e.label){case 0:return[4,Promise.all(this.synchronizers.map(function(e){return t.safe(e.close())}))];case 1:return e.sent(),[2]}})})},IN.prototype.safe=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,r];case 1:return e.sent(),[3,3];case 2:return t=e.sent(),l.log.error("Failed to sync: ".concat(t)),[3,3];case 3:return[2]}})})};var _N=IN;function IN(){this.synchronizers=[]}NN.prototype.sync=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.delegate.sync()];case 1:return e.sent(),[3,3];case 2:return t=e.sent(),l.log.error("Failed to sync: ".concat(t)),[3,3];case 3:return[2]}})})},NN.prototype.start=function(){var e=this;-1!==this.intervalMillis&&null===this.pollingJob&&(this.pollingJob=this.scheduler.schedulePeriodically(this.intervalMillis,this.intervalMillis,function(){return e.sync()}))},NN.prototype.stop=function(){var e;-1!==this.intervalMillis&&(null!=(e=this.pollingJob)&&e.cancel(),this.pollingJob=null)},NN.prototype.close=function(){return a(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return this.stop(),[4,this.delegate.close()];case 1:return e.sent(),[2]}})})};var AN=NN;function NN(e,t,r){this.delegate=e,this.scheduler=t,this.intervalMillis=r,this.pollingJob=null}PN.prototype.schedule=function(e,t){e=new SN(e,t);return e.start(),e},PN.prototype.schedulePeriodically=function(e,t,r){var n;switch(this.scheduleType){case"setTimeout":n=new RN(e,t,r);break;case"setInterval":n=new xN(e,t,r)}return n.start(),n};var ON=PN;function PN(e){this.scheduleType=e}MN.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){try{e.task()}catch(e){l.log.error("Failed to run task: ".concat(e))}finally{e.timeout=null}},this.delayMillis)},MN.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var SN=MN;function MN(e,t){this.delayMillis=e,this.task=t,this.timeout=null}CN.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.run()},this.delayMillis)},CN.prototype.run=function(){var e=this;try{this.task()}catch(e){l.log.error("Failed to run task: ".concat(e))}this.timeout=setTimeout(function(){return e.run()},this.intervalMillis)},CN.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var RN=CN;function CN(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null}UN.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){e.run(),e.interval=setInterval(function(){return e.run()},e.intervalMillis)},this.delayMillis)},UN.prototype.run=function(){try{this.task()}catch(e){l.log.error("Failed to run task: ".concat(e))}},UN.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.interval&&(clearInterval(this.interval),this.interval=null)};var xN=UN;function UN(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null,this.interval=null}DN.prototype.fetchIfModified=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},DN.prototype.createRequest=function(e){var t=Ki.builder().url(this.url).method("GET");return null!==e&&t.addHeader(qi.IF_MODIFIED_SINCE,e),t.build()},DN.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return u(this,function(e){switch(e.label){case 0:t=si.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),no.record("get.workspace",t,r),[2,r];case 3:throw r=e.sent(),no.record("get.workspace",t,null),r;case 4:return[2]}})})},DN.prototype.handleResponse=function(e){if(e.isNotModified())return null;if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is empty");return{config:JSON.parse(e.body),lastModified:e.headers.get(qi.LAST_MODIFIED)}};var kN=DN;function DN(e,t){this.url=e,this.transport=t}FN.prototype.fetch=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},FN.prototype.createRequest=function(e){e={identifiers:Kt(e)},e=we.encodeURL(JSON.stringify(e));return Ki.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},FN.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return u(this,function(e){switch(e.label){case 0:t=si.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),no.record("get.cohorts",t,r),[2,r];case 3:throw r=e.sent(),no.record("get.cohorts",t,null),r;case 4:return[2]}})})},FN.prototype.handleResponse=function(e){if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is null");e=JSON.parse(e.body);return Z_.fromDto(e)};var LN=FN;function FN(e,t){this.url=e,this.transport=t}jN.prototype.fetch=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},jN.prototype.createRequest=function(e){e={identifiers:Kt(e)},e=we.encodeURL(JSON.stringify(e));return Ki.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},jN.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return u(this,function(e){switch(e.label){case 0:t=si.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),no.record("get.user-targets",t,r),[2,r];case 3:throw r=e.sent(),no.record("get.user-targets",t,null),r;case 4:return[2]}})})},jN.prototype.handleResponse=function(e){if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is null");e=JSON.parse(e.body);return lI.fromDto(e)};var VN=jN;function jN(e,t){this.url=e,this.transport=t}KN.prototype.getExperiments=function(){return Array.from(this.experiments.values())},KN.prototype.getSplitUrlExperiments=function(){return Array.from(this.splitUrlExperiments.values())},KN.prototype.getFeatureFlags=function(){return Array.from(this.featureFlags.values())},KN.prototype.getInAppMessages=function(){return Array.from(this.inAppMessages.values())},KN.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},KN.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},KN.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},KN.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)},KN.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},KN.prototype.getContainerOrNull=function(e){return this.containers.get(e)},KN.prototype.getParameterConfigurationOrNull=function(e){return this.parameterConfigurations.get(e)},KN.prototype.getRemoteConfigParameterOrNull=function(e){return this.remoteConfigParameters.get(e)},KN.prototype.getInAppMessageOrNull=function(e){return this.inAppMessages.get(e)},KN.prototype.getAttributes=function(){return this.attributes},KN.from=function(e){var t=e.parameterConfigurations.map(Ot.fromJson),r=f.mapNotNullOrUndefined(e.experiments,function(e){return Mt.fromJson("AB_TEST",e,t)}),n=f.mapNotNullOrUndefined(e.experiments,function(e){return Mt.fromJson("AB_TEST",e,t)}).filter(function(e){return"SPLIT_URL"===e.implementationType}),i=f.mapNotNullOrUndefined(e.featureFlags,function(e){return Mt.fromJson("FEATURE_FLAG",e,t)}),o=e.buckets.map(Ut.fromJson),s=e.events.map(Ft.fromJson),a=f.mapNotNullOrUndefined(e.segments,ir.fromJson),u=e.containers.map(sr.fromJson),c=f.mapNotNullOrUndefined(e.remoteConfigParameters,pr.fromJson),p=f.mapNotNullOrUndefined(e.inAppMessages,Br.fromJson),e=e.workspace.attributes;return new KN(r,n,i,o,s,a,u,t,c,p,e)};var BN=KN;function KN(e,t,r,n,i,o,s,a,u,c,p){this.experiments=f.associateBy(e,function(e){return e.key}),this.splitUrlExperiments=f.associateBy(t,function(e){return e.key}),this.featureFlags=f.associateBy(r,function(e){return e.key}),this.buckets=f.associateBy(n,function(e){return e.id}),this.eventTypes=f.associateBy(i,function(e){return e.key}),this.segments=f.associateBy(o,function(e){return e.key}),this.containers=f.associateBy(s,function(e){return e.id}),this.parameterConfigurations=f.associateBy(a,function(e){return e.id}),this.remoteConfigParameters=f.associateBy(u,function(e){return e.key}),this.inAppMessages=f.associateBy(c,function(e){return e.key}),this.attributes=p}HN.prototype.setConfig=function(e){this.setWorkspace(e),this.lastModified=e.lastModified},HN.prototype.setWorkspace=function(e){try{this.workspace=BN.from(e.config)}catch(e){l.log.error("Failed to set workspace: ".concat(e))}},HN.prototype.get=function(){return this.workspace},HN.prototype.sync=function(){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.workspaceFetcher.fetchIfModified(this.lastModified)];case 1:return(t=e.sent())&&(this.setConfig(t),this.workspaceConfigStorage.set(t)),[3,3];case 2:return t=e.sent(),l.log.error("Failed to sync workspace: ".concat(t)),[3,3];case 3:return[2]}})})},HN.prototype.close=function(){return a(this,void 0,void 0,function(){return u(this,function(e){return[2]})})};var GN=HN;function HN(e,t){this.workspaceConfigStorage=e,this.workspaceFetcher=t,this.workspace=null,this.lastModified=null;e=this.workspaceConfigStorage.get();e&&this.setConfig(e)}YN.prototype.dispatch=function(e,t){e=e.map(function(e){return e.toDto()});return t?this.dispatchEventsSynchronously(e):this.dispatchEvents(e)},YN.prototype.dispatchEventsSynchronously=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return[4,this.retryManager.add(r)];case 1:return e.sent(),[4,this.synchronousTransport.send(r)];case 2:return(t=e.sent()).isSuccessful()||t.isClientError()?[4,this.retryManager.delete(r)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}})})},YN.prototype.dispatchEvents=function(r){return a(this,void 0,void 0,function(){var t;return u(this,function(e){switch(e.label){case 0:return[4,this.transport.send(r)];case 1:return(t=e.sent()).isSuccessful()||t.isClientError()?[2]:[4,this.retryManager.add(r)];case 2:return e.sent(),[2]}})})};var zN=YN;function YN(e,t,r){this.transport=e,this.synchronousTransport=t,this.retryManager=r}qN.prototype.send=function(e){e=this.createRequest(e);return this.execute(e)},qN.prototype.createRequest=function(e){e=e,t=new Array,r=new Array,n=new Array,e.forEach(function(e){e instanceof Xb?Xb.isExposureEvent(e)?t.push(e.toDto()):Xb.isTrackEvent(e)?r.push(e.toDto()):Xb.isRemoteConfigEvent(e)&&n.push(e.toDto()):Xb.isExposureEventDto(e)?t.push(e):Xb.isTrackEventDto(e)?r.push(e):Xb.isRemoteConfigEventDto(e)&&n.push(e)});var t,r,n,e={exposureEvents:t,trackEvents:r,remoteConfigEvents:n};return Ki.builder().url(this.url).method("POST").addHeader("Content-Type","application/json").body(JSON.stringify(e)).build()},qN.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return u(this,function(e){switch(e.label){case 0:t=si.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),no.record("post.events",t,r),[2,r];case 3:throw r=e.sent(),no.record("post.events",t,null),r;case 4:return[2]}})})};var JN=qN;function qN(e,t){this.url=e,this.transport=t}$N.prototype.add=function(e){return this.repository.add(e)},$N.prototype.delete=function(e){return this.repository.delete(e)},$N.prototype.flush=function(){return a(this,void 0,void 0,function(){var t,r;return u(this,function(e){switch(e.label){case 0:return[4,this.repository.read()];case 1:return 0===(t=e.sent()).length?[2]:[4,this.transport.send(t)];case 2:return(r=e.sent()).isSuccessful()||r.isClientError()?[4,this.delete(t)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}})})},$N.prototype.onLifecycleChanged=function(e,t){switch(e){case"visible":case"pageshow":return void this.flush().catch(function(e){return l.log.warn("Failed to flush retry events: ".concat(e))});case"blur":case"focus":case"hidden":case"locationChange":case"pagehide":return}};var WN=$N;function $N(e,t){this.repository=e,this.transport=t}function XN(){this.listeners={}}XN.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},XN.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},XN.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};o(QN,ZN=XN);var ZN,Vl=QN;function QN(){return null!==ZN&&ZN.apply(this,arguments)||this}o(rO,eO=Vl),rO.prototype.process=function(e){this.enqueue(e),this.emit("event",e)},rO.prototype.enqueue=function(e){0===this.queue.length&&this.scheduleFlush(),this.queue.push(e),this.queue.length>=this.eventDispatchMaxSize&&this.flush()},rO.prototype.scheduleFlush=function(){var e,t=this;null!=(e=this.flushingJob)&&e.cancel(),this.flushingJob=this.flushScheduler.schedule(this.flushIntervalMillis,function(){return t.flush()})},rO.prototype.flush=function(e){var t;void 0===e&&(e=!1),null!=(t=this.flushingJob)&&t.cancel(),0!==this.queue.length&&(this.eventDispatcher.dispatch(this.queue,e).catch(function(e){return l.log.warn("Failed to dispatch events: ".concat(e))}),this.queue=[])},rO.prototype.close=function(){this.flush(!0)};var eO,tO=rO;function rO(e,t,r,n){var i=eO.call(this)||this;return i.eventDispatcher=e,i.eventDispatchMaxSize=t,i.flushScheduler=r,i.flushIntervalMillis=n,i.queue=[],i.flushingJob=null,i}iO.prototype.send=function(e){e=e.toBuilder().addHeader(He,this.sdk.key).addHeader(ze,this.sdk.name).addHeader(Ye,this.sdk.version).addHeader(Je,this.clock.currentMillis().toString()).build();return this.delegate.send(e)};var nO=iO;function iO(e,t,r){this.sdk=e,this.clock=t,this.delegate=r}sO.intercept=function(e,t){return t instanceof nO?t:new nO(e,Fe.instance,t)};var oO=sO;function sO(){}uO.create=function(){return new uO},uO.prototype.send=function(s){return new Promise(function(t,r){var e,n=new XMLHttpRequest,i=(s.options.timeoutMillis&&(n.timeout=s.options.timeoutMillis),n.open(s.method,s.url),n.onreadystatechange=function(){var e;n.readyState===n.DONE&&(0===n.status?r(new Error("Request Error")):(e=new Yi(n.status,n.responseText,function(e){var t=qi.builder(),e=e.getAllResponseHeaders();if(!e)return t.build();for(var r=0,n=e.split("\r\n");r<n.length;r++){var i,o=n[r],s=o.indexOf(": ");0<s&&(i=o.slice(0,s),o=o.slice(s+2),t.add(i,o))}return t.build()}(n)),t(e)))},n),o=s.headers.raw();for(e in o)o.hasOwnProperty(e)&&i.setRequestHeader(e,o[e]);n.send(s.body)})};var aO=uO;function uO(){}pO.create=function(){return new pO},pO.prototype.send=function(n){var i=this;return new Promise(function(e,t){var r=!1;if(!(r="undefined"!=typeof window?window&&window.navigator&&!!window.navigator.sendBeacon&&!0:r))throw new Error("BeaconTransport not supported.");r=i.createBody(n);if(!window.navigator.sendBeacon(n.url,r))throw Error("Failed to sendBeacon");e(Yi.ok())})},pO.prototype.createBody=function(e){var t=new URLSearchParams,r=e.headers.get(He),r=(r&&t.append("sdkKey",r),t.append("sdkName",e.headers.getOrDefault(ze,"unknown")),t.append("sdkVersion",e.headers.getOrDefault(Ye,"unknown")),e.headers.get(Je));return r&&t.append("sdkTime",r),e.body&&t.append("data",e.body),t};var cO=pO;function pO(){}fO.prototype.invoke=function(e){e=window.prompt(JSON.stringify(e));return this.invocationResponseResolver.resolve(e)};var lO=fO;function fO(e){this.invocationResponseResolver=e}yO.prototype.invoke=function(e){if(null==(t=window._hackleApp)||!t.invoke)throw new Error("window._hackleApp.invoke is not implemented");var t=window._hackleApp.invoke(JSON.stringify(e));return this.invocationResponseResolver.resolve(t)};var hO,dO=yO;function yO(e){this.invocationResponseResolver=e}(Xa=hO=hO||{}).prompt="prompt",Xa.function="function";gO.prototype.getInvocator=function(e,t){return e===hO.prompt?new lO(t):e===hO.function?new dO(t):null};var vO=gO;function gO(){}EO.prototype.onPageStarted=function(e,t){var r=this.userManager.resolve(),r=this.determiner.determineOrNull(r);r&&(this.core.flush(!0),this.redirector.redirect(r))},EO.prototype.onPageEnded=function(e,t){};var mO=EO;function EO(e,t,r,n){this.determiner=e,this.redirector=t,this.userManager=r,this.core=n}var wO=function(e,t,r,n){this.workspace=e,this.experiment=t,this.decision=r,this.user=n},bO=(TO.prototype.determineOrNull=function(e){if(this.splitUrlRedirectedCookieStorage.alreadyRedirected())return this.splitUrlRedirectedCookieStorage.clear(),null;var t=this.workspaceFetcher.get();if(!t)return null;for(var r=0,n=t.getSplitUrlExperiments();r<n.length;r++){var i,o=n[r];if(this.splitUrlMatcher.matches(t,o,e))return i=this.core.experiment(o.key,e,"A"),new wO(t,o,i,e)}return null},TO);function TO(e,t,r,n){this.workspaceFetcher=e,this.splitUrlMatcher=t,this.splitUrlRedirectedCookieStorage=r,this.core=n}IO.prototype.matches=function(e,t,r){if("SPLIT_URL"!==t.implementationType)return!1;if(!t.splitUrlTargets)return!1;t=t.splitUrlTargets,e=AO.of(e,r);return!(0<t.excludeTargets.length&&this.targetMatcher.anyMatches(e,O0.create(),t.excludeTargets))&&(0<t.includeTargets.length&&this.targetMatcher.anyMatches(e,O0.create(),t.includeTargets))};var _O=IO;function IO(e){this.targetMatcher=e}NO.of=function(e,t){return new NO(new A0("SPLIT_URL",K()),t,e)};var AO=NO;function NO(e,t,r){this.key=e,this.user=t,this.workspace=r}PO.prototype.redirect=function(e){e=this.urlResolver.resolveOrNull(e);e&&(this.initializeEventDispatcher.setNeedDispatch(!1),this.splitUrlRedirectedCookieStorage.setRedirected(!0),this.urlHandler.open(e))};var OO=PO;function PO(e,t,r,n){this.urlResolver=e,this.urlHandler=t,this.splitUrlRedirectedCookieStorage=r,this.initializeEventDispatcher=n}MO.prototype.resolveOrNull=function(e){try{var t=JSON.parse(e.decision.get(MO.SPLIT_URL_CONFIG_KEY,"")),r=Zn.fromDto(t);return r.needRedirect?this.resolveByRedirectType(r.redirectType,r.redirectUrl,e):null}catch(e){return null}},MO.prototype.resolveByRedirectType=function(e,t,r){return!t||e!==n.SplitUrlRedirectType.MANUAL?null:this.resolveManualRedirectUrl(t,r)},MO.prototype.resolveManualRedirectUrl=function(e,t){e=as.tryParse(e);return e?this.decorateCampaign(e,t):null},MO.prototype.decorateCampaign=function(e,t){t=t.user.hackleProperties.queryParameter;if(ji.isNotEmptyString(t)){for(var t=this.campaignParser.parse(t),r=e,n=0,i=Object.entries(t);n<i.length;n++){var o=i[n],s=o[0],o=o[1];ji.isNotEmptyString(o)&&r.searchParams.set(s,o)}return r}return e},MO.SPLIT_URL_CONFIG_KEY="redirectUrl";var SO=MO;function MO(e){this.campaignParser=e}CO.prototype.alreadyRedirected=function(){try{var e=this.storage.getItem(this.cookieKey);return p.isNullOrUndefined(e)?!1:Boolean(JSON.parse(e))}catch(e){return!1}},CO.prototype.clear=function(){this.storage.removeItem(this.cookieKey)},CO.prototype.setRedirected=function(e){this.storage.setItem(this.cookieKey,String(e),this.cookieStorageOptions)};var RO=CO;function CO(e,t,r){this.storage=e,this.cookieKey=t,this.cookieStorageOptions=r}UO.prototype.setNeedDispatch=function(e){this.needDispatch=e},UO.prototype.dispatchDoneEventIfNeeded=function(){this.needDispatch&&window.dispatchEvent(new CustomEvent(UO.HACKLE_INITIALIZE_DONE_EVENT_TYPE))},UO.HACKLE_INITIALIZE_DONE_EVENT_TYPE="hackle-initialize-done";var xO=UO;function UO(){this.needDispatch=!0}DO.prototype.get=function(){var e=this.storage.getItem(ft);if(p.isNullOrUndefined(e))return null;try{var t=JSON.parse(e);return this.sdk.version!==t.version?(this.clear(),null):t}catch(e){return this.clear(),null}},DO.prototype.set=function(e){e=c(c({},e),{version:this.sdk.version});this.storage.setItem(ft,JSON.stringify(e))},DO.prototype.clear=function(){this.storage.removeItem(ft)};var kO=DO;function DO(e,t){this.sdk=e,this.storage=t}var LO=l.log,FO=(VO.prototype.install=function(e){void 0===e&&(e=null);try{var t=this.changeLifecycle.bind(this);window.addEventListener("pageshow",function(){return t("pageshow")}),window.addEventListener("pagehide",function(){return t("pagehide")}),document.addEventListener("visibilitychange",function(){return t(document.visibilityState)}),window.addEventListener("blur",function(){return t("blur")}),window.addEventListener("focus",function(){return t("focus")}),VO.isSafariBrowser(e)&&window.addEventListener("beforeunload",function(){return t("hidden")}),history.pushState=(n=history.pushState,function(){try{var e=n.apply(history,arguments);return t("locationChange"),e}catch(e){(e instanceof Error||"string"==typeof e)&&LO.error(e)}}),history.replaceState=(r=history.replaceState,function(){try{var e=r.apply(history,arguments);return t("locationChange"),e}catch(e){(e instanceof Error||"string"==typeof e)&&LO.error(e)}}),window.addEventListener("popstate",function(){try{t("locationChange")}catch(e){(e instanceof Error||"string"==typeof e)&&LO.error(e)}})}catch(e){(e instanceof Error||"string"==typeof e)&&LO.error(e)}var r,n},VO.prototype.addListener=function(e){this.listeners.push(e)},VO.prototype.initialize=function(){this._initialized=!0,this.changeLifecycle("pageshow")},VO.prototype.changeLifecycle=function(e){this._initialized&&this.publish(e)},VO.prototype.publish=function(t){var r=this.clock.currentMillis();this.listeners.forEach(function(e){e.onLifecycleChanged(t,r)})},VO.isSafariBrowser=function(e){return!p.isNullOrUndefined(e)&&e.toLowerCase().includes("safari")},VO);function VO(e){void 0===e&&(e=Fe.instance),this.clock=e,this.listeners=[],this._initialized=!1}BO.create=function(e,t,r){return void 0===r&&(r=Fe.instance),new BO(new KO(r,e,t))},BO.prototype.execute=function(e,t){return(this.limiter.tryAcquire()?e:t)()};var jO=BO;function BO(e){this.limiter=e}GO.prototype.tryAcquire=function(){var e=this.clock.currentMillis();return this.refreshScopeIfNeeded(e).tryAcquire()},GO.prototype.refreshScopeIfNeeded=function(e){return null!=this.currentScope&&!this.currentScope.isExpired(e)||(this.currentScope=new HO(e+this.intervalMillis,this.limit)),this.currentScope};var KO=GO;function GO(e,t,r){this.clock=e,this.intervalMillis=t,this.limit=r,this.currentScope=null}zO.prototype.isExpired=function(e){return this.expirationTime<e},zO.prototype.tryAcquire=function(){return 0<this.token&&(--this.token,!0)};var HO=zO;function zO(e,t){this.expirationTime=e,this.token=t}JO.prototype.isDedupTarget=function(t){var e=this.determiners.find(function(e){return e.supports(t)});return!!e&&e.isDedupTarget(t)};var YO=JO;function JO(e){this.determiners=e}qO.prototype.isDedupTarget=function(e){if(-1===this.dedupIntervalMillis)return!1;Me.isEquals(e.user.identifiers,null==(t=this.currentUser)?void 0:t.identifiers)||(this.currentUser=e.user,this.cache={});var t=this.cacheKey(e),e=this.clock.currentMillis(),r=this.cache[t];return void 0!==r&&e-r<=this.dedupIntervalMillis||(this.cache[t]=e,!1)};Ea=qO;function qO(e,t){this.dedupIntervalMillis=e,this.clock=t,this.cache={},this.currentUser=null}o(XO,WO=Ea),XO.prototype.supports=function(e){return Xb.isRemoteConfigEvent(e)},XO.prototype.cacheKey=function(e){return[e.parameter.id,e.valueId,e.decisionReason].join("-")};var WO,$O=XO;function XO(e,t){return void 0===t&&(t=Fe.instance),WO.call(this,e,t)||this}o(eP,ZO=Ea),eP.prototype.supports=function(e){return Xb.isExposureEvent(e)},eP.prototype.cacheKey=function(e){return[e.experiment.id,e.variationId,e.variationKey,e.decisionReason].join("-")};var ZO,QO=eP;function eP(e,t){return void 0===t&&(t=Fe.instance),ZO.call(this,e,t)||this}rP.prototype.isInvocatorResponse=function(e){return"object"==typeof e&&null!==e&&"success"in e&&"boolean"==typeof e.success&&"message"in e&&"string"==typeof e.message},rP.prototype.resolve=function(e){e=JSON.parse(null!=e?e:"");if(!this.isInvocatorResponse(e))throw new Error("invalid invocator response data");if(e.success)return{message:e.message,success:e.success,data:e.data};throw new Error("failed response")};var tP=rP;function rP(){}iP.prototype.createInvocationRequestDto=function(e){return{_hackle:{command:e.command,parameters:e.parameters,browserProperties:e.browserProperties}}},iP.prototype.process=function(e){var e=this.createInvocationRequestDto(e);return null!=(e=this.invocator.invoke(e).data)?e:null};var nP=iP;function iP(e){this.invocator=e}var oP=l.log,sP=(aP.prototype.onPageStarted=function(e,t){this.track(e,t)},aP.prototype.onPageEnded=function(e,t){},aP.prototype.track=function(e,t){oP.debug("tracking page view");var r,e={key:aP.PAGE_VIEW_EVENT_KEY,properties:((r={})[aP.PAGE_NAME_PROPERTY_KEY]=e.pageTitle,r)};this.core.track(e,this.userManager.resolve(),t)},aP.PAGE_VIEW_EVENT_KEY="$page_view",aP.PAGE_NAME_PROPERTY_KEY="$page_name",aP);function aP(e,t){this.core=e,this.userManager=t}Object.defineProperty(cP.prototype,"currentPage",{get:function(){var e;return null!=(e=this._currentPage)?e:qo.createWithCurrentPage()},enumerable:!1,configurable:!0}),cP.prototype.updatePage=function(e,t){var r=this._currentPage;r&&e.isEquals(r)||(r&&this.publishEnd(r,t),this._currentPage=e,this.publishStart(e,t))},cP.prototype.publishStart=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageStarted(e,t)},cP.prototype.publishEnd=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageEnded(e,t)},cP.prototype.onLifecycleChanged=function(e,t){switch(e){case"pageshow":case"locationChange":var r=qo.createWithCurrentPage();return this.updatePage(r,t);case"visible":case"pagehide":case"blur":case"focus":case"hidden":return}},cP.prototype.addListener=function(e){this.listeners.push(e)};var uP=cP;function cP(){this.listeners=[],this._currentPage=null}var pP=l.log,lP=(Object.defineProperty(fP.prototype,"lastEngagementTime",{get:function(){return this._lastEngagementTime},enumerable:!1,configurable:!0}),fP.prototype.startEngagement=function(e){pP.debug("startEngagement timestamp:".concat(e,", page:").concat(this.pageManager.currentPage.url)),this._lastEngagementTime=e},fP.prototype.endEngagement=function(e,t){var r;p.isNullOrUndefined(this._lastEngagementTime)||(r=this._lastEngagementTime,(r=(this._lastEngagementTime=t)-r)<this.minimumEngagementDurationMillis||this.publish({page:e,durationMillis:r},t))},fP.prototype.publish=function(e,t){pP.debug("onEngagement timestamp:".concat(t,", page:").concat(this.pageManager.currentPage.url));for(var r=0,n=this.listeners;r<n.length;r++)n[r].onEngagement(e,t)},fP.prototype.onPageStarted=function(e,t){this.startEngagement(t)},fP.prototype.onPageEnded=function(e,t){this.endEngagement(e,t)},fP.prototype.onLifecycleChanged=function(e,t){switch(e){case"visible":case"focus":return this.startEngagement(t);case"pagehide":case"hidden":case"blur":return this.endEngagement(this.pageManager.currentPage,t);case"pageshow":case"locationChange":return}},fP.prototype.addListener=function(e){this.listeners.push(e)},fP);function fP(e,t){this.pageManager=e,this.minimumEngagementDurationMillis=t,this.listeners=[],this._lastEngagementTime=null}dP.prototype.onEngagement=function(e,t){var r,e={key:dP.ENGAGEMENT_EVENT_KEY,properties:((r={})[sP.PAGE_NAME_PROPERTY_KEY]=e.page.pageTitle,r[dP.ENGAGEMENT_TIME_PROPERTY_KEY]=e.durationMillis,r)};this.core.track(e,this.userManager.resolve(),t)},dP.ENGAGEMENT_EVENT_KEY="$engagement",dP.ENGAGEMENT_TIME_PROPERTY_KEY="$engagement_time_ms";var hP=dP;function dP(e,t){this.core=e,this.userManager=t}vP.prototype.setPhoneNumber=function(e,t){e=(new Ko).set(vP.PHONE_NUMBER_PROPERTY_KEY,e.getValue()).build().toSecuredEvent();this.track(e,t)},vP.prototype.unsetPhoneNumber=function(e){var t=(new Ko).unset(vP.PHONE_NUMBER_PROPERTY_KEY).build().toSecuredEvent();this.track(t,e)},vP.prototype.track=function(e,t){var r=this.userManager.resolve();this.core.track(e,r,t)},vP.PHONE_NUMBER_PROPERTY_KEY="$phone_number";var yP=vP;function vP(e,t){this.core=e,this.userManager=t}mP.prototype.getBrowserProperties=function(e){return nI.generate(window,null!=e?e:qo.createWithCurrentPage())};var gP=mP;function mP(){}Object.defineProperty(wP.prototype,"delayMillis",{get:function(){return this.schedule.time.deliverAt-this.requestedAt},enumerable:!1,configurable:!0}),wP.prototype.toString=function(){return"InAppMessageScheduleRequest(scheduleType=".concat(this.scheduleType,", requestedAt=").concat(this.requestedAt,")")};var EP=wP;function wP(e,t,r){this.schedule=e,this.scheduleType=t,this.requestedAt=r}TP.prototype.toRequest=function(e,t){return new EP(this,e,t)},TP.create=function(e){return new TP(K(),e.inAppMessage.key,e.event.user.identifiers,_P.of(e.inAppMessage,e.event.timestamp),e.reason,new AP(e.event.insertId,e.event.event))},TP.fromDelayStorageEntity=function(e,t){return new TP(e.schedule.dispatchId,e.schedule.inAppMessageKey,e.schedule.identifiers,new _P(t,e.schedule.time.deliverAt),e.schedule.reason,e.schedule.eventBasedContext)};var bP=TP;function TP(e,t,r,n,i,o){this.dispatchId=e,this.inAppMessageKey=t,this.identifiers=r,this.time=n,this.reason=i,this.eventBasedContext=o}IP.prototype.delayMillis=function(e){return this.deliverAt-e},IP.of=function(e,t){return new IP(t,e.eventTrigger.delay.deliverAt(t))};var _P=IP;function IP(e,t){this.startedAt=e,this.deliverAt=t}var AP=function(e,t){this.insertId=e,this.event=t},NP=(OP.prototype.initialize=function(){var t=this;this.userEventEmitter.on("event",function(e){t.onEvent(e)})},OP.prototype.destroy=function(){var t=this;this.userEventEmitter.off("event",function(e){t.onEvent(e)})},OP.prototype.onEvent=function(e){this.triggerProcessor.process(e)},OP.prototype.onUserUpdated=function(e,t,r){e=Kt(e),t=Kt(t);this.resetProcessor.process({identifiers:e},{identifiers:t})},OP.prototype.loadDelaySchedule=function(){var r=this;this.delayStorage.values().forEach(function(e){var t=r.clock.currentMillis(),e=bP.fromDelayStorageEntity(e,t).toRequest("STORED",t);r.scheduleProcessor.process(e)})},OP);function OP(e,t,r,n,i,o){this.scheduleProcessor=e,this.delayStorage=t,this.triggerProcessor=r,this.resetProcessor=n,this.userEventEmitter=i,this.clock=o,this.initialize()}o(MP,PP=ia),MP.prototype.resolve=function(e,t,r){return t.setProperty("experiment_id",r.experiment.id),t.setProperty("experiment_key",r.experiment.key),t.setProperty("variation_id",r.variationId),t.setProperty("variation_key",r.variationKey),t.setProperty("experiment_decision_reason",r.reason),r};var PP,SP=MP;function MP(e){return PP.call(this,e)||this}o(CP,RP=zu);var RP,Wa=CP;function CP(){return null!==RP&&RP.apply(this,arguments)||this}Object.defineProperty(UP.prototype,"inAppMessage",{get:function(){return this.request.inAppMessage},enumerable:!1,configurable:!0}),UP.of=function(e,t,r){return new UP(e,h.IN_APP_MESSAGE_TARGET,t.targetEvaluations,r,t.properties)};var xP=UP;function UP(e,t,r,n,i){this.request=e,this.reason=t,this.targetEvaluations=r,this.message=n,this.properties=i}Object.defineProperty(kP.prototype,"key",{get:function(){return new A0("IN_APP_MESSAGE",this.inAppMessage.id)},enumerable:!1,configurable:!0});_=kP;function kP(){}o(FP,DP=_),FP.of=function(e){return e instanceof FP?e:new FP(e.workspace,e.user,e.inAppMessage)},FP.prototype.toString=function(){return"InAppMessageLayoutRequest(type=".concat(this.key.type,", key=").concat(this.inAppMessage.key,")")};var DP,LP=FP;function FP(e,t,r){var n=DP.call(this)||this;return n.workspace=e,n.user=t,n.inAppMessage=r,n}o(BP,VP=Wa),BP.prototype.supports=function(e){return e instanceof LP},BP.prototype.evaluateInternal=function(e,t){var r=e.inAppMessage.messageContext.experimentContext,r=null!==r?this.evaluateExperiment(e,t,r):this.evaluateDefault(e,t);return xP.of(e,t,r)},BP.prototype.evaluateDefault=function(e,t){var r=KP(e.inAppMessage.messageContext.defaultLang);return this.selector.select(e.inAppMessage,r)},BP.prototype.evaluateExperiment=function(e,t,r){var n,i=p.requiredNotNullOrUndefined(e.workspace.getExperimentOrNull(r.key),function(){return"Experiment[key=".concat(r.key,"]")}),t=this.experimentEvaluator.evaluate(e,t,i),o=KP(e.inAppMessage.messageContext.defaultLang),s=(n=t.variationKey,function(e){return n===e.variationKey});return this.selector.select(e.inAppMessage,function(e){return o(e)&&s(e)})},BP.prototype.record=function(e,t){this.eventRecorder.record(e,t)};var VP,jP=BP;function BP(e,t,r){var n=VP.call(this)||this;return n.experimentEvaluator=e,n.selector=t,n.eventRecorder=r,n}function KP(t){return function(e){return t===e.lang}}HP.prototype.select=function(e,t){t=e.messageContext.messages.find(t);return p.requiredNotNullOrUndefined(t,function(){return"InAppMessage must be decided [".concat(e.id,"]")})};var GP=HP;function HP(){}YP.prototype.record=function(e,t){if(e.reason!==h.OVERRIDDEN)try{this.doRecord(e)}catch(e){l.log.error("Failed to record InAppMessageImpression: ".concat(e))}},YP.prototype.doRecord=function(e){var t=this.storage.get(e.inAppMessage),r={identifiers:e.user.identifiers,timestamp:e.requestedAt},t=Te(Te([],t,!0),[r],!1),r=t.length>this.STORE_MAX_SIZE?t.length-this.STORE_MAX_SIZE:0,t=t.slice(r);this.storage.set(e.inAppMessage,t)};var zP=YP;function YP(e){this.storage=e,this.STORE_MAX_SIZE=100}qP.prototype.toString=function(){return"InAppMessagePresentResponse(dispatchId=".concat(this.dispatchId,", inAppMessage=").concat(this.context.inAppMessage,", displayType=").concat(this.context.message.layout.displayType,", layoutType=").concat(this.context.message.layout.layoutType,")")},qP.of=function(e,t){return new qP(e.dispatchId,t)};var JP=qP;function qP(e,t){this.dispatchId=e,this.context=t}$P.prototype.toString=function(){return"InAppMessagePresentationContext(dispatchId=".concat(this.dispatchId,", inAppMessage=").concat(this.inAppMessage,", message=").concat(this.message,")")},$P.of=function(e){return new $P(e.dispatchId,e.inAppMessage,e.message,e.user,e.reason,e.properties)};var WP=$P;function $P(e,t,r,n,i,o){this.dispatchId=e,this.inAppMessage=t,this.message=r,this.user=n,this.decisionReason=i,this.properties=o}ZP.prototype.process=function(e){l.log.debug("InAppMessage Present Request: ".concat(e));var t=this.present(e);return this.recorder.record(e,t),l.log.debug("InAppMessage Present Response: ".concat(t)),t},ZP.prototype.present=function(e){var t=WP.of(e);return this.presenter.present(t),JP.of(e,t)};var XP=ZP;function ZP(e,t){this.presenter=e,this.recorder=t}eS.prototype.isIdentifierChanged=function(e,t){var r=e[jt.USER],n=t[jt.USER];if(void 0!==r&&void 0!==n)return r!==n;r=e[jt.DEVICE],n=t[jt.DEVICE];return void 0!==r&&void 0!==n&&r!==n};var QP=eS;function eS(){}Object.defineProperty(rS.prototype,"listener",{get:function(){return this._listener},set:function(e){this._listener=e},enumerable:!1,configurable:!0}),rS.prototype.schedule=function(e){var t=this,r=this.scheduler.schedule(e.delayMillis,function(){return t.delayCommand(e)});return new nS(e,r)},rS.prototype.delayCommand=function(e){var t=this.clock.currentMillis(),e=e.schedule.toRequest("DELAYED",t);null!=(t=this.listener)&&t.onSchedule(e)};var tS=rS;function rS(e,t){this.clock=e,this.scheduler=t}iS.prototype.cancel=function(){this.job.cancel(),l.log.debug("InAppMessageDelay cancelled: ".concat(this.delay))};var nS=iS;function iS(e,t){this.delay=e,this.job=t}Object.defineProperty(sS.prototype,"delayMillis",{get:function(){return this.schedule.time.delayMillis(this.requestedAt)},enumerable:!1,configurable:!0}),sS.from=function(e){return new sS(e.schedule,e.requestedAt)},sS.prototype.toString=function(){return"InAppMessageDelay(dispatchId=".concat(this.schedule.dispatchId,", requestedAt=").concat(this.requestedAt,")")};var oS=sS;function sS(e,t){this.schedule=e,this.requestedAt=t}uS.prototype.registerAndDelay=function(e){return this.storage.set(e.schedule.inAppMessageKey,e.schedule.dispatchId,oS.from(e)),this.delay(e)},uS.prototype.delay=function(e){var t=oS.from(e),r=this.scheduler.schedule(t);return this.tasks.set(t.schedule.dispatchId,r),l.log.debug("InAppMessage Delay started: dispatchId=".concat(e.schedule.dispatchId)),t},uS.prototype.delete=function(e){var t=null!=(t=null==(t=this.tasks.get(e.schedule.dispatchId))?void 0:t.delay)?t:null;return t&&l.log.debug("InAppMessage Delay deleted: dispatchId=".concat(e.schedule.dispatchId)),this.tasks.delete(e.schedule.dispatchId),this.storage.remove(e.schedule.inAppMessageKey,e.schedule.dispatchId),t},uS.prototype.cancelAll=function(){var e=Array.from(this.tasks.values());return e.forEach(function(e){return e.cancel()}),this.tasks.clear(),this.storage.clear(),l.log.debug("InAppMessage Delay clear."),e.map(function(e){return e.delay})};var aS=uS;function uS(e,t,r){this.scheduler=e,this.tasks=t,this.storage=r}pS.prototype.toString=function(){return"InAppMessageDeliverResponse(dispatchId=".concat(this.dispatchId,", inAppMessageKey=").concat(this.inAppMessageKey,", code=").concat(this.code,")")},pS.of=function(e,t,r){return new pS(e.dispatchId,e.inAppMessageKey,t,r=void 0===r?null:r)};var cS=pS;function pS(e,t,r,n){this.dispatchId=e,this.inAppMessageKey=t,this.code=r,this.presentResponse=n}fS.prototype.toString=function(){return"InAppMessagePresentRequest(dispatchId=".concat(this.dispatchId,", inAppMessage=").concat(this.inAppMessage,", user=").concat(this.user.identifiers,", requestedAt=").concat(this.requestedAt,", reason=").concat(this.reason,", properties=").concat(this.properties,")")},fS.of=function(e,t,r,n,i){return new fS(e.dispatchId,t,i.message,r,e.requestedAt,n.reason,c(c({},e.properties),i.properties))};var lS=fS;function fS(e,t,r,n,i,o,s){this.dispatchId=e,this.inAppMessage=t,this.message=r,this.user=n,this.requestedAt=i,this.reason=o,this.properties=s}o(yS,hS=_),yS.prototype.toString=function(){return"InAppMessageEligibilityRequest(type=".concat(this.key.type,", key=").concat(this.inAppMessage.key,")")};var hS,dS=yS;function yS(e,t,r,n){var i=hS.call(this)||this;return i.workspace=e,i.user=t,i.inAppMessage=r,i.timestamp=n,i}gS.prototype.response=function(t){try{return this.deliver(t)}catch(e){return l.log.error("Failed to process InAppMessageDeliver: ".concat(e)),cS.of(t,"EXCEPTION")}},gS.prototype.process=function(e){l.log.debug("InAppMessage Deliver Request: ".concat(e));e=this.response(e);return l.log.debug("InAppMessage Deliver Response: ".concat(e)),e},gS.prototype.deliver=function(e){var t=this.workspaceFetcher.get();if(!t)return cS.of(e,"WORKSPACE_NOT_FOUND");var r=t.getInAppMessageOrNull(e.inAppMessageKey);if(!r)return cS.of(e,"IN_APP_MESSAGE_NOT_FOUND");var n=this.userDecorator.decorate(this.userManager.resolve());if(this.identifierChecker.isIdentifierChanged(e.identifiers,n.identifiers))return cS.of(e,"IDENTIFIER_CHANGED");var i=this.layoutResolver.resolve(t,r,n),t=new dS(t,n,r,e.requestedAt),t=this.evaluateProcessor.process("DELIVER",t);if(!t.isEligible)return cS.of(e,"INELIGIBLE");r=lS.of(e,r,n,t,i),n=this.presentProcessor.process(r);return cS.of(e,"PRESENT",n)};var vS=gS;function gS(e,t,r,n,i,o,s){this.workspaceFetcher=e,this.userManager=t,this.identifierChecker=r,this.layoutResolver=n,this.evaluateProcessor=i,this.presentProcessor=o,this.userDecorator=s}ES.prototype.get=function(t){return p.requiredNotNullOrUndefined(this.schedulers.find(function(e){return e.supports(t)}),function(){return"Unsupported InAppMessageScheduleType[".concat(t,"]")})};var mS=ES;function ES(e){this.schedulers=e}bS.prototype.toString=function(){return"InAppMessageScheduleResponse(dispatchId=".concat(this.dispatchId,", inAppMessageKey=").concat(this.inAppMessageKey,", code=").concat(this.code,")")},bS.of=function(e,t,r,n){return new bS(e.schedule.dispatchId,e.schedule.inAppMessageKey,t,r=void 0===r?null:r,n=void 0===n?null:n)};var wS=bS;function bS(e,t,r,n,i){this.dispatchId=e,this.inAppMessageKey=t,this.code=r,this.deliverResponse=n,this.delay=i}_S.of=function(e){var t=(new lo).add("$trigger_event_insert_id",e.schedule.eventBasedContext.insertId).build();return new _S(e.schedule.dispatchId,e.schedule.inAppMessageKey,e.schedule.identifiers,e.requestedAt,e.schedule.reason,p.fromMap(t))},_S.prototype.toString=function(){return"InAppMessageDeliverRequest(dispatchId=".concat(this.dispatchId,", inAppMessageKey=").concat(this.inAppMessageKey,", identifiers=").concat(this.identifiers,", requestedAt=").concat(this.requestedAt,", reason=").concat(this.reason)};var TS=_S;function _S(e,t,r,n,i,o){this.dispatchId=e,this.inAppMessageKey=t,this.identifiers=r,this.requestedAt=n,this.reason=i,this.properties=o}IS.prototype.schedule=function(e,t){switch(e){case"DELIVER":return this.deliver(t);case"DELAY":return this.delay(t);case"IGNORE":return this.ignore(t)}};Q=IS;function IS(){}o(OS,AS=Q),OS.prototype.supports=function(e){return"DELAYED"===e},OS.prototype.deliver=function(e){var t=this.delayManager.delete(e),t=(p.requiredNotNullOrUndefined(t,function(){return"InAppMessageDelay not found (inAppMessageKey=".concat(e.schedule.inAppMessageKey,")")}),TS.of(e)),t=this.deliverProcessor.process(t);return wS.of(e,"DELIVER",t)},OS.prototype.delay=function(e){var t=this.delayManager.delay(e);return wS.of(e,"DELAY",null,t)},OS.prototype.ignore=function(e){var t=this.delayManager.delete(e);return wS.of(e,"IGNORE",null,t)};var AS,NS=OS;function OS(e,t){var r=AS.call(this)||this;return r.deliverProcessor=e,r.delayManager=t,r}o(MS,PS=Q),MS.prototype.supports=function(e){return"TRIGGERED"===e},MS.prototype.deliver=function(e){var t=TS.of(e),t=this.deliverProcessor.process(t);return wS.of(e,"DELIVER",t)},MS.prototype.delay=function(e){var t=this.delayManager.registerAndDelay(e);return wS.of(e,"DELAY",null,t)},MS.prototype.ignore=function(e){return wS.of(e,"IGNORE")};var PS,SS=MS;function MS(e,t){var r=PS.call(this)||this;return r.deliverProcessor=e,r.delayManager=t,r}CS.prototype.process=function(e){l.log.debug("InAppMessage Schedule Request: ".concat(e));e=this.schedule(e);return l.log.debug("InAppMessage Schedule Response: ".concat(e)),e},CS.prototype.schedule=function(t){try{var e=this.actionDeterminer.determine(t);return this.schedulerFactory.get(t.scheduleType).schedule(e,t)}catch(e){return l.log.error("Failed to process InAppMessageSchedule: ".concat(e)),wS.of(t,"EXCEPTION")}},CS.prototype.onSchedule=function(e){this.process(e)};var RS=CS;function CS(e,t){this.actionDeterminer=e,this.schedulerFactory=t}US.prototype.shouldIgnoreRequest=function(e){return"STORED"===e.scheduleType&&e.delayMillis<0},US.prototype.determineAction=function(e){var t=e.delayMillis;if(0<t)return"DELAY";if(t>=this.DELIVER_DURATION_THRESHOLD_MILLIS)return"DELIVER";if(t<this.DELIVER_DURATION_THRESHOLD_MILLIS)return"IGNORE";throw new Error("InAppMessageScheduleAction cannot be determined (key=".concat(e.schedule.inAppMessageKey,")"))},US.prototype.determine=function(e){if(this.shouldIgnoreRequest(e))return"IGNORE";var t=this.determineAction(e);return l.log.debug("InAppMessage ScheduleAction determined: action=".concat(t,", dispatchId=").concat(e.schedule.dispatchId)),t};var xS=US;function US(){this.DELIVER_DURATION_THRESHOLD_MILLIS=-1e4}DS.prototype.toString=function(){return"InAppMessageTrigger(inAppMessage=".concat(this.inAppMessage.toString(),", reason=").concat(this.reason,", insertId=").concat(this.event.insertId,", timestamp=").concat(this.event.timestamp,", event=").concat(this.event.event.key,")")};var kS=DS;function DS(e,t,r){this.inAppMessage=e,this.reason=t,this.event=r}FS.prototype.determine=function(e){var t=Xb.isTrackEvent(e)?e:null;if(!t)return null;var r=this.workspaceFetcher.get();if(!r)return null;for(var n=0,i=r.getInAppMessages();n<i.length;n++){var o=i[n];if(this.eventMatcher.matches(r,o,t)){var s=this.evaluate(r,o,t);if(s.isEligible)return new kS(o,s.reason,t)}}return null},FS.prototype.evaluate=function(e,t,r){e=new dS(e,r.user,t,r.timestamp);return this.evaluateProcessor.process("TRIGGER",e)};var LS=FS;function FS(e,t,r){this.workspaceFetcher=e,this.eventMatcher=t,this.evaluateProcessor=r}jS.prototype.handle=function(e){e=bP.create(e).toRequest("TRIGGERED",e.event.timestamp);this.scheduleProcessor.process(e)};var VS=jS;function jS(e){this.scheduleProcessor=e}KS.prototype.process=function(e){try{var t=this.determiner.determine(e);if(!t)return;l.log.debug("InAppMessage triggered: ".concat(t)),this.handler.handle(t)}catch(e){l.log.error("Failed to process InAppMessage event trigger: ".concat(e))}};var BS=KS;function KS(e,t){this.determiner=e,this.handler=t}HS.prototype.process=function(e,t){try{this.identifierChecker.isIdentifierChanged(Kt(e),Kt(t))&&this.delayManager.cancelAll()}catch(e){l.log.error("Failed to reset InAppMessage: ".concat(e))}};var GS=HS;function HS(e,t){this.identifierChecker=e,this.delayManager=t}YS.prototype.getDelayStorageItem=function(){var e=this.storage.getItem(this.storageKey);if(p.isNullOrUndefined(e))return null;try{return JSON.parse(e)}catch(e){return l.log.warn("Failed to get delay storage item: ".concat(e)),null}},YS.prototype.get=function(e,t){var r=this.getDelayStorageItem();return!p.isNullOrUndefined(r)&&null!=(e=null==(r=r[e])?void 0:r.find(function(e){return e.schedule.dispatchId===t}))?e:null},YS.prototype.set=function(e,t,r){var n=this.getDelayStorageItem();if(p.isNullOrUndefined(n))return l.log.debug("No delay storage item found. create new item"),void this.storage.setItem(this.storageKey,JSON.stringify(((i={})[e]=[r],i)));var i=null!=(i=n[e])?i:[];i.push(r),n[e]=i,this.storage.setItem(this.storageKey,JSON.stringify(n))},YS.prototype.remove=function(e,t){var r=this.getDelayStorageItem(),n=null==r?void 0:r[e];p.isNullOrUndefined(r)||p.isNullOrUndefined(n)?l.log.debug("No delay storage item found for ".concat(e,". do nothing")):(r[e]=n.filter(function(e){return e.schedule.dispatchId!==t}),0===r[e].length&&delete r[e],this.storage.setItem(this.storageKey,JSON.stringify(r)))},YS.prototype.values=function(){var e=this.getDelayStorageItem();return p.isNullOrUndefined(e)?(l.log.debug("No delay storage item found. do nothing"),[]):Object.values(e).flat()},YS.prototype.clear=function(){this.storage.removeItem(this.storageKey)};var zS=YS;function YS(e){this.storage=e,this.storageKey="iam-delay"}qS.prototype.create=function(r,e){var n=this,i=this.clock.currentMillis(),o=new Array,t=this.createEvent(r,e,i,{});return t&&o.push(t),e.targetEvaluations.forEach(function(e){var t;(t={})[qS.ROOT_TYPE]=r.key.type,t[qS.ROOT_ID]=r.key.id;e=n.createEvent(r,e,i,t);e&&o.push(e)}),o},qS.prototype.createEvent=function(e,t,r,n){var i;return t instanceof y0?(n[qS.CONFIG_ID_PROPERTY_KEY]=null==(i=t.config)?void 0:i.id,n[qS.EXPERIMENT_VERSION_KEY]=t.experiment.version,n[qS.EXECUTION_VERSION_KEY]=t.experiment.executionVersion,Xb.exposure(e.user,t,n,r)):t instanceof w0?Xb.remoteConfig(e.user,t,c(c({},n),t.properties),r):null},qS.ROOT_TYPE="$targetingRootType",qS.ROOT_ID="$targetingRootId",qS.CONFIG_ID_PROPERTY_KEY="$parameterConfigurationId",qS.EXPERIMENT_VERSION_KEY="$experiment_version",qS.EXECUTION_VERSION_KEY="$execution_version";var JS=qS;function qS(e){this.clock=e}$S.prototype.record=function(e,t){var r=this;this.eventFactory.create(e,t).forEach(function(e){r.eventProcessor.process(e)})};var WS=$S;function $S(e,t){this.eventFactory=e,this.eventProcessor=t}ZS.eligible=function(e,t,r){return ZS.of(e,t,r,!0)},ZS.ineligible=function(e,t,r){return ZS.of(e,t,r,!1)},ZS.of=function(e,t,r,n){return new ZS(String(r),t.targetEvaluations,e.inAppMessage,n,t.get(xP))};var XS=ZS;function ZS(e,t,r,n,i){this.reason=e,this.targetEvaluations=t,this.inAppMessage=r,this.isEligible=n,this.layoutEvaluation=i}eM.prototype.evaluate=function(e,t,r){return e.inAppMessage.supports("WEB")?r.evaluate(e,t):XS.ineligible(e,t,h.UNSUPPORTED_PLATFORM)};var QS=eM;function eM(){}rM.prototype.evaluate=function(e,t,r){return this.userOverrideMatcher.matches(e,t)?XS.eligible(e,t,h.OVERRIDDEN):r.evaluate(e,t)};var tM=rM;function rM(e){this.userOverrideMatcher=e}iM.prototype.evaluate=function(e,t,r){return"DRAFT"===e.inAppMessage.status?XS.ineligible(e,t,h.IN_APP_MESSAGE_DRAFT):r.evaluate(e,t)};var nM=iM;function iM(){}sM.prototype.evaluate=function(e,t,r){return"PAUSE"===e.inAppMessage.status?XS.ineligible(e,t,h.IN_APP_MESSAGE_PAUSED):r.evaluate(e,t)};var oM=sM;function sM(){}uM.prototype.evaluate=function(e,t,r){return e.inAppMessage.period.within(e.timestamp)?r.evaluate(e,t):XS.ineligible(e,t,h.NOT_IN_IN_APP_MESSAGE_PERIOD)};var aM=uM;function uM(){}pM.prototype.evaluate=function(e,t,r){return e.inAppMessage.timetable.within(e.timestamp)?r.evaluate(e,t):XS.ineligible(e,t,h.NOT_IN_IN_APP_MESSAGE_TIMETABLE)};var cM=pM;function pM(){}fM.prototype.evaluate=function(e,t,r){return this.hiddenMatcher.matches(e,t)?XS.ineligible(e,t,h.IN_APP_MESSAGE_HIDDEN):r.evaluate(e,t)};var lM=fM;function fM(e){this.hiddenMatcher=e}dM.prototype.evaluate=function(e,t,r){return this.targetMatcher.matches(e,t)?r.evaluate(e,t):XS.ineligible(e,t,h.NOT_IN_IN_APP_MESSAGE_TARGET)};var hM=dM;function dM(e){this.targetMatcher=e}vM.prototype.evaluate=function(e,t,r){return this.frequencyCapMatcher.matches(e,t)?XS.ineligible(e,t,h.IN_APP_MESSAGE_FREQUENCY_CAPPED):r.evaluate(e,t)};var yM=vM;function vM(e){this.frequencyCapMatcher=e}mM.prototype.evaluate=function(e,t,r){return XS.eligible(e,t,h.IN_APP_MESSAGE_TARGET)};var gM=mM;function mM(){}wM.prototype.evaluate=function(e,t,r){var n=LP.of(e),n=this.layoutEvaluator.evaluate(n,O0.create());return t.set(xP,n),r.evaluate(e,t)};var EM=wM;function wM(e){this.layoutEvaluator=e}TM.prototype.matches=function(t,e){var r=this;return t.inAppMessage.targetContext.overrides.some(function(e){return r.isUserOverridden(t,e)})},TM.prototype.isUserOverridden=function(e,t){e=e.user.identifiers[t.identifierType];return!p.isNullOrUndefined(e)&&t.identifiers.includes(e)};var bM=TM;function TM(){}IM.prototype.matches=function(t,r){var n=this,e=t.inAppMessage.targetContext.targets;return 0===e.length||e.some(function(e){return n.targetMatcher.matches(t,r,e)})};var _M=IM;function IM(e){this.targetMatcher=e}NM.prototype.matches=function(e,t){return this.storage.exist(e.inAppMessage,e.timestamp)};var AM=NM;function NM(e){this.storage=e}PM.prototype.matches=function(e,t){var r=e.inAppMessage,n=e.user,e=e.timestamp;return this.isFrequencyCapped(r,n,e)},PM.prototype.isFrequencyCapped=function(e,t,r){if(!e.eventTrigger.frequencyCap)return!1;var n=this.createMatchContexts(e.eventTrigger.frequencyCap);if(0===n.length)return!1;for(var i=0,o=this.storage.get(e);i<o.length;i++)for(var s=o[i],a=0,u=n;a<u.length;a++)if(u[a].matches(t,r,s))return!0;return!1},PM.prototype.createMatchContexts=function(e){for(var t=[],r=0,n=e.identifierCaps;r<n.length;r++){var i=n[r];t.push(new SM(new RM(i)))}return e.durationCap&&t.push(new SM(new xM(e.durationCap))),t};var OM=PM;function PM(e){this.storage=e}MM.prototype.matches=function(e,t,r){return this.predicate.matches(e,t,r)&&(this.matchCount+=1),this.matchCount>=this.predicate.thresholdCount};var SM=MM;function MM(e){this.matchCount=0,this.predicate=e}Object.defineProperty(CM.prototype,"thresholdCount",{get:function(){return this.identifierCap.count},enumerable:!1,configurable:!0}),CM.prototype.matches=function(e,t,r){e=e.identifiers[this.identifierCap.identifierType];if(p.isNullOrUndefined(e))return!1;r=r.identifiers[this.identifierCap.identifierType];return!p.isNullOrUndefined(r)&&e===r};var RM=CM;function CM(e){this.identifierCap=e}Object.defineProperty(UM.prototype,"thresholdCount",{get:function(){return this.durationCap.count},enumerable:!1,configurable:!0}),UM.prototype.matches=function(e,t,r){return t-r.timestamp<=this.durationCap.durationMillis};var xM=UM;function UM(e){this.durationCap=e}DM.prototype.getTriggerFlow=function(){return this.triggerFlow},DM.prototype.getDeliverFlow=function(e){return e?this.deliverReEvaluateFlow:this.deliverFlow};var kM=DM;function DM(e,t,r){this.layoutEvaluator=r;var r=j0.get("targetMatcher"),r=[new QS,new tM(new bM),new nM,new oM,new aM,new cM,new hM(new _M(r))],n=[new EM(this.layoutEvaluator)],t=[new yM(new OM(t)),new lM(new AM(e))],e=[new gM];this.triggerFlow=Y0.of.apply(Y0,Te(Te(Te(Te([],r,!1),n,!1),t,!1),e,!1)),this.deliverFlow=Y0.of.apply(Y0,Te(Te([],t,!1),e,!1)),this.deliverReEvaluateFlow=Y0.of.apply(Y0,Te(Te(Te([],r,!1),t,!1),e,!1))}o(VM,LM=Wa),VM.prototype.supports=function(e){return void 0!==e.inAppMessage},VM.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlow.evaluate(e,t))?r:XS.ineligible(e,t,h.NOT_IN_IN_APP_MESSAGE_TARGET)},VM.prototype.record=function(e,t){this.eventRecorder.record(e,t),t.isEligible||null===t.layoutEvaluation||this.eventRecorder.record(t.layoutEvaluation.request,t.layoutEvaluation)};var LM,FM=VM;function VM(e,t){var r=LM.call(this)||this;return r.evaluationFlow=e,r.eventRecorder=t,r}BM.prototype.process=function(e,t){e=this.resolveFlow(e,t),e=new FM(e,this.eventRecorder);return this.core.inAppMessage(t,O0.create(),e)},BM.prototype.resolveFlow=function(e,t){return"TRIGGER"===e?this.flowFactory.getTriggerFlow():this.flowFactory.getDeliverFlow(null!=(t=null==(e=t.inAppMessage.evaluateContext)?void 0:e.atDeliverTime)&&t)};var jM=BM;function BM(e,t,r){this.core=e,this.flowFactory=t,this.eventRecorder=r}GM.prototype.resolve=function(e,t,r){e=new LP(e,r,t);return this.core.inAppMessage(e,O0.create(),this.layoutEvaluator)};var KM=GM;function GM(e,t){this.core=e,this.layoutEvaluator=t}o(YM,HM=Q),YM.prototype.supports=function(e){return"STORED"===e},YM.prototype.deliver=function(e){var t=this.delayManager.delete(e),r=(p.requiredNotNullOrUndefined(t,function(){return"InAppMessageDelay not found (inAppMessageKey=".concat(e.schedule.inAppMessageKey,")")}),TS.of(e)),r=this.deliverProcessor.process(r);return wS.of(e,"DELIVER",r,t)},YM.prototype.delay=function(e){var t=this.delayManager.delay(e);return l.log.debug("StoredDelay is scheduled (inAppMessageKey=".concat(e.schedule.inAppMessageKey,", delayMillis=").concat(e.delayMillis.toLocaleString(),")")),wS.of(e,"DELAY",null,t)},YM.prototype.ignore=function(e){var t=this.delayManager.delete(e);return wS.of(e,"IGNORE",null,t)};var HM,zM=YM;function YM(e,t){var r=HM.call(this)||this;return r.deliverProcessor=e,r.delayManager=t,r}qM.prototype.decorate=function(e){if(e.identifiers[jt.SESSION])return e;var t=this.sessionManager.currentSessionId;if(p.isNullOrUndefined(t))return e;t=(new Gt).addIdentifiers(e.identifiers).add(jt.SESSION,t).build();return c(c({},e),{identifiers:t})};var JM=qM;function qM(e){this.sessionManager=e}$M.prototype.decorate=function(e){var t=this.sessionUserDecorator.decorate(e.user);return e.copyWithUser(t)};var WM=$M;function $M(e){this.sessionUserDecorator=e}ZM.prototype.onPageStarted=function(e,t){this.track(e,t)},ZM.prototype.onPageEnded=function(e,t){},ZM.prototype.track=function(e,t){var r={command:"track",parameters:{event:{key:sP.PAGE_VIEW_EVENT_KEY,properties:((r={})[sP.PAGE_NAME_PROPERTY_KEY]=e.pageTitle,r)},user:void 0},browserProperties:this.browserPropertyProvider.getBrowserProperties(e)};this.invocationProcessor.process(r)};var XM=ZM;function ZM(e,t){this.invocationProcessor=e,this.browserPropertyProvider=t}function QM(e,t,r,n,i){this.sdkKey=e,this.config=t,this.invocationProcessor=r,this.browserPropertyProvider=n,this.lifecycleCompositeManager=i}var eR={automaticScreenTracking:!1,automaticEngagementTracking:!1},tR=l.log,rR=(nR.prototype.config=function(){var e=this.configResolver.resolve();return c(c({},eR),e)},nR);function nR(e){this.configResolver=e}oR.prototype.supports=function(e){return"getWebViewConfig"in e&&p.isNotNullOrUndefined(e.getWebViewConfig)},oR.prototype.resolveAutomaticEngagementTracking=function(e){return("boolean"!=typeof e.automaticEngagementTracking?eR:e).automaticEngagementTracking},oR.prototype.resolveAutomaticScreenTracking=function(e){return("boolean"!=typeof e.automaticScreenTracking?eR:e).automaticScreenTracking},oR.prototype.resolve=function(){try{if(!this.supports(this.hackleApp))return eR;var e=this.hackleApp.getWebViewConfig(),t=JSON.parse(e);return{automaticEngagementTracking:this.resolveAutomaticEngagementTracking(t),automaticScreenTracking:this.resolveAutomaticScreenTracking(t)}}catch(e){return tR.warn("Failed to resolve web view config: ".concat(e)),eR}};var iR=oR;function oR(e){this.hackleApp=e}aR.prototype.onEngagement=function(e,t){this.track(e,t)},aR.prototype.track=function(e,t){var r={command:"track",parameters:{event:{key:aR.ENGAGEMENT_EVENT_KEY,properties:((r={})[sP.PAGE_NAME_PROPERTY_KEY]=e.page.pageTitle,r[aR.ENGAGEMENT_TIME_PROPERTY_KEY]=e.durationMillis,r)},user:void 0},browserProperties:this.browserPropertyProvider.getBrowserProperties(e.page)};this.invocationProcessor.process(r)},aR.ENGAGEMENT_EVENT_KEY="$engagement",aR.ENGAGEMENT_TIME_PROPERTY_KEY="$engagement_time_ms";var sR=aR;function aR(e,t){this.invocationProcessor=e,this.browserPropertyProvider=t}cR.prototype.addPageListener=function(e){this.pageManager.addListener(e)},cR.prototype.addEngagementListener=function(e){this.engagementManager.addListener(e)},cR.prototype.addLifecycleListener=function(e){this.lifecycleManager.addListener(e)},cR.prototype.initialize=function(){this.lifecycleManager.initialize()},cR.prototype.install=function(e){this.pageManager.addListener(this.engagementManager),this.lifecycleManager.addListener(this.pageManager),this.lifecycleManager.addListener(this.engagementManager),this.lifecycleManager.install(e)};var uR=cR;function cR(e,t,r,n){this.lifecycleManager=e,this.pageManager=t,this.engagementManager=r,this.lifecycleManager=e,this.pageManager=t,this.engagementManager=r,this.install("string"==typeof n?n:null)}pR.prototype.marketing=function(e){return this.operations.set("$marketing",e),this},pR.prototype.information=function(e){return this.operations.set("$information",e),this},pR.prototype.custom=function(e,t){return this.operations.set(e,t),this},pR.prototype.build=function(){return new lR(this.operations)};Zl=pR;function pR(){this.operations=new Map}fR.prototype.toEvent=function(e){var r=new Ko;return this.operations.forEach(function(e,t){r.set(t,e)}),{key:e,properties:p.fromMap(this.operations)}},fR.prototype.toRecord=function(){var r={};return this.operations.forEach(function(e,t){r[t]=e}),r};var lR=fR;function fR(e){this.operations=e}n.HackleSubscriptionStatus=void 0,(E=n.HackleSubscriptionStatus||(n.HackleSubscriptionStatus={})).SUBSCRIBED="SUBSCRIBED",E.UNSUBSCRIBED="UNSUBSCRIBED",E.UNKNOWN="UNKNOWN";hR.prototype.addPageListener=function(e){this.compositeManager.addPageListener(e)},hR.prototype.addEngagementListener=function(e){this.compositeManager.addEngagementListener(e)},hR.prototype.addLifecycleListener=function(e){this.compositeManager.addLifecycleListener(e)},hR.prototype.initialize=function(){this.compositeManager.initialize()};P=hR;function hR(e,t){void 0===t&&(t=dt);var r=new FO,n=new uP,t=new lP(n,t);this.compositeManager=new uR(r,n,t,e)}var dR,yR=l.log,vR=null,gR=(o(mR,dR=QM),mR.prototype.create=function(e){var t=new ms(this.invocationProcessor,this.browserPropertyProvider);return this.initialize(e),t},mR.prototype.initialize=function(e){e.automaticScreenTracking&&this.lifecycleCompositeManager.addPageListener(new XM(this.invocationProcessor,this.browserPropertyProvider)),e.automaticEngagementTracking&&this.lifecycleCompositeManager.addEngagementListener(new sR(this.invocationProcessor,this.browserPropertyProvider)),this.lifecycleCompositeManager.initialize()},mR);function mR(e,t,r,n,i){return dR.call(this,e,t,r,n,i)||this}o(bR,ER=QM),bR.prototype.create=function(e){var t=AR(this.sdkKey,this.config,this.lifecycleCompositeManager),r=new ms(this.invocationProcessor,this.browserPropertyProvider),t=new Es(t,r);return this.initialize(t),t},bR.prototype.initialize=function(e){e.syncUser()};var ER,wR=bR;function bR(e,t,r,n,i){return ER.call(this,e,t,r,n,i)||this}_R.prototype.create=function(e,t){var r=this.factories[e];if(r)return r.create(t);throw new Error("Unsupported HackleAppMode: ".concat(e))};var TR=_R;function _R(e,t,r,n,i){this.sdkKey=e,this.config=t,this.invocationProcessor=r,this.browserPropertyProvider=n,this.lifecycleCompositeManager=i,this.factories=((e={})[vs.native]=new gR(this.sdkKey,this.config,this.invocationProcessor,this.browserPropertyProvider,this.lifecycleCompositeManager),e[vs.web_view_wrapper]=new wR(this.sdkKey,this.config,this.invocationProcessor,this.browserPropertyProvider,this.lifecycleCompositeManager),e)}function IR(e,t){var r,t=bN.config(t),n=(bN.logging(t),new gP),i=n.getBrowserProperties().browserName,o=new uP,s=new FO,a=new lP(o,dt),s=new uR(s,o,a,"string"==typeof i?i:null);try{if((r=window)&&"_hackleApp"in r&&null!==r._hackleApp&&"object"==typeof r._hackleApp&&("getAppSdkKey"in r._hackleApp&&"function"==typeof r._hackleApp.getAppSdkKey&&("getInvocationType"in r._hackleApp&&"function"==typeof r._hackleApp.getInvocationType))&&e===window._hackleApp.getAppSdkKey()){var u=e,c=t,p=window._hackleApp,l=s,f=n;if(null===(h=(new vO).getInvocator(p.getInvocationType(),new tP)))throw new Error("Failed to get invocator with invocationType:".concat(p.getInvocationType()));var h=new nP(h),u=new TR(u,c,h,f,l),c=new rR(new iR(p)),h=null!=(l=null==(f=null==(h=p.getAppMode)?void 0:h.call(p))?void 0:f.toLowerCase())?l:vs.native,p=c.config();return u.create(h,p)}}catch(e){yR.error("Unexpected exception while check WebApp client: ".concat(e))}return AR(e,t,s)}function AR(e,t,r){var n=bN.sdk(e,t);if(vR)return yR.debug("use already exists hackleClient"),vR;var i=new ls,o=(i.initialize(),new TI),s=cs.getInstance({days:Xe,isCrossSubdomain:!0,sameSite:t.sameSiteCookie,isSecure:t.secureCookie}),a=bN.isBeaconSupported(),u=oO.intercept(n,aO.create()),c=oO.intercept(n,cO.create()),p=u,l=(a&&(p=c),new _N),f=new AN(l,new ON("setTimeout"),bN.pollingIntervalMillis(t)),h=new kO(n,II.postfix(o,"_".concat(e.slice(0,8)))),d=new kN(MI.clientFetch(t.sdkUrl,n.key),u),h=new GN(h,d),d=(l.add(h),new VN(MI.userTargets(t.sdkUrl),u)),y=new LN(MI.userCohorts(t.sdkUrl),u),v=new sN(r.pageManager),g=new yI(II.postfix(s,"_".concat(e))),m=g.getUser(),E=t.user||null,g=new hI(hs(),g,d,y,v,r.pageManager,Fe.instance,m,E),d=(l.add(g),new wI(t.sessionTimeoutMillis,II.postfix(s,"_".concat(e.slice(8))))),y=(g.addListener(d),new W_(o,"".concat(et,"_").concat(e),qe)),E=new JN(MI.clientDispatch(t.eventUrl),u),l=E,a=(a&&(l=new JN(MI.beaconDispatch(t.eventUrl,n.key),c)),new WN(y,E)),n=new zN(E,l,a),c=new YO([new $O(bN.dedupIntervalMillis(t)),new QO(bN.dedupIntervalMillis(t))]),y=new tO(n,qe,new ON("setTimeout"),$e),E=new p0(y,c,d,g),l=new JM(d),n=new WM(l),w=(E.addDecorator(n),new xO),c=new D0(new NI(s,"".concat(st,"_").concat(e.slice(0,8)))),n=new D0(new NI(s,"".concat(at,"_").concat(e.slice(0,8)))),b=new CI(II.prefix(o,"".concat(ut,"_").concat(e.slice(0,8),"_"))),T=new mA(II.prefix(o,"".concat(ct,"_").concat(e.slice(0,8),"_"))),_=new JS(Fe.instance),I=new WS(_,E),_=V_.create(h,_,E,[c,n]),A=new yP(_,g),N=new ZA(new eN(II.postfix(s,"_".concat(e.slice(0,8)))),v,_,g),O=new u0(g,_),O=(d.addListener(N),d.addListener(O),new ZI(_)),P=new UI([new DI,new FI(new jA),new jI(new jA),new KI(b,Fe.instance),new HI(new KA),new YI(new KA),new qI(new HA),new $I(new HA)]),P=new wA([new TA,new NA(P),new IA]),O=new PA(Fe.instance,O,P),P=new CA([new UA,new DA(O),new FA(O)]),S=new fA(MI.inAppMessageRenderer(t.cdnUrl,t.IAM_RENDERER_VERSION_HEADER)),S=new eA(pA.create(S),O,P),O=j0.get("delegatingEvaluator"),P=new jP(new SP(O),new GP,I),O=new zP(T),O=new XP(S,O),M=new QP,b=new kM(b,T,P),T=new KM(_,P),P=new tS(Fe.instance,new ON("setTimeout")),o=new zS(II.prefix(o,"".concat(yt,"_").concat(e.slice(0,8),"_"))),e=new aS(P,new Map,o),b=new jM(_,b,I),I=new vS(h,g,M,T,b,O,l),T=[new NS(I,e),new SS(I,e),new zM(I,e)],O=new RS(new xS,new mS(T)),l=(P.listener=O,new MA(new dA(j0.get("targetMatcher")))),I=new LS(h,l,b),T=new VS(O),P=new BS(I,T),l=new GS(M,e),R=new NP(O,o,P,l,y,Fe.instance),b=(g.addListener(R),new mN(h)),I=(new vN(y,b),new hP(_,g)),T=(r.addEngagementListener(I),new sP(_,g)),M=(t.automaticPageTracking&&r.addPageListener(T),new _O(j0.get("targetMatcher"))),e=new RO(s,pt,{days:lt}),O=new bO(h,M,e,_),o=new OO(new SO(v),new YA,e,w),P=new mO(O,o,g,_),l=(r.addPageListener(P),new PI(_,g,c,n)),I=(null==(y=t.devTool)?void 0:y.userExplorer)&&"function"==typeof(null==(b=t.devTool)?void 0:b.userExplorer),s=t.devTool&&I?{manager:t.devTool,userExplorer:l}:void 0,h=new Qi(MI.monitoring(t.monitoringUrl),u,p,new ON("setTimeout"),We),M=(Fi.addRegistry(h),r.addLifecycleListener(d),r.addLifecycleListener(i),r.addLifecycleListener(a),r.addLifecycleListener(E),r.addLifecycleListener(h),f.start(),jO.create(ht,1)),C=new ns(_,f,d,g,A,M,T,S,s);vR=C;return(new G_).install(_,g),v=Date.now(),e=g.currentUser,O=d.currentSessionId,(X_(m,e)?d.startNewSessionIfNeeded(e,v):d.startNewSession(m,e,v))===O&&N.startNewCampaignIfNeeded(e,v),C.onReady(function(){t.autoOpenDevTool&&(t.devTool?C.showUserExplorer():yR.error("DevTool is not provided")),r.initialize(),w.dispatchDoneEventIfNeeded(),R.loadDelaySchedule()}),C}var NR=function(e,t){return(NR=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)};var OR=function(){return(OR=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function PR(e,s,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}o((u=u.apply(e,s||[])).next())})}function SR(n,i){var o,s,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(n,u)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function MR(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}RR.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},RR.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},RR.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};Fa=RR;function RR(){this.listeners={}}xR.arePropertiesEqual=function(e,t){var r=xR.coerceUnknownToProperties(e),n=xR.coerceUnknownToProperties(t),e=Object.keys(r),t=Object.keys(n);return e.length===t.length&&e.every(function(e){return e in n&&r[e]===n[e]})},xR.coerceUnknownToProperties=function(e){return"object"==typeof e&&null!==e?e:{}};var CR=xR;function xR(){}kR.isUserEqual=function(e,t){return(null==e?void 0:e.id)===(null==t?void 0:t.id)&&(null==e?void 0:e.deviceId)===(null==t?void 0:t.deviceId)&&(null==e?void 0:e.userId)===(null==t?void 0:t.userId)&&CR.arePropertiesEqual(null==e?void 0:e.properties,null==t?void 0:t.properties)&&CR.arePropertiesEqual(null==e?void 0:e.identifiers,null==t?void 0:t.identifiers)};var UR=kR;function kR(){}var DR=function(n){var e=i,t=n;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}function i(e,t){var r=n.call(this)||this;return r._currentUser=null,r.client=IR(e,OR(OR({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"11.52.0"})),r.getSessionId=r.getSessionId.bind(r),r.getUser=r.getUser.bind(r),r.setUser=r.setUser.bind(r),r.setUserId=r.setUserId.bind(r),r.setDeviceId=r.setDeviceId.bind(r),r.setUserProperty=r.setUserProperty.bind(r),r.setUserProperties=r.setUserProperties.bind(r),r.updateUserProperties=r.updateUserProperties.bind(r),r.updatePushSubscriptions=r.updatePushSubscriptions.bind(r),r.updateSmsSubscriptions=r.updateSmsSubscriptions.bind(r),r.updateKakaoSubscriptions=r.updateKakaoSubscriptions.bind(r),r.resetUser=r.resetUser.bind(r),r.variation=r.variation.bind(r),r.variationDetail=r.variationDetail.bind(r),r.isFeatureOn=r.isFeatureOn.bind(r),r.featureFlagDetail=r.featureFlagDetail.bind(r),r.track=r.track.bind(r),r.trackPageView=r.trackPageView.bind(r),r.remoteConfig=r.remoteConfig.bind(r),r.onReady=r.onReady.bind(r),r.onInitialized=r.onInitialized.bind(r),r.showUserExplorer=r.showUserExplorer.bind(r),r.hideUserExplorer=r.hideUserExplorer.bind(r),r.fetch=r.fetch.bind(r),r.close=r.close.bind(r),r.setInAppMessageListener=r.setInAppMessageListener.bind(r),r.getExperiment=r.getExperiment.bind(r),r.setPhoneNumber=r.setPhoneNumber.bind(r),r.unsetPhoneNumber=r.unsetPhoneNumber.bind(r),r.emitUpdatedUser=r.emitUpdatedUser.bind(r),r.getDisplayedInAppMessageView=r.getDisplayedInAppMessageView.bind(r),null!=t&&t.devTool&&null!=t&&t.autoOpenDevTool&&"undefined"!=typeof window&&r.showUserExplorer(),r}return NR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r),i.prototype.getSessionId=function(){return this.client.getSessionId()},i.prototype.getUser=function(){return this.client.getUser()},i.prototype.setUser=function(t){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.setUser(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setUserId=function(t){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.setUserId(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setDeviceId=function(t){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.setDeviceId(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setUserProperty=function(t,r){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.setUserProperty(t,r),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setUserProperties=function(t){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.setUserProperties(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.updateUserProperties=function(t){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.updateUserProperties(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.updatePushSubscriptions=function(t){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.updatePushSubscriptions(t),[2]})})},i.prototype.updateSmsSubscriptions=function(t){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.updateSmsSubscriptions(t),[2]})})},i.prototype.updateKakaoSubscriptions=function(t){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.updateKakaoSubscriptions(t),[2]})})},i.prototype.resetUser=function(){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.resetUser(),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.variation=function(e,t,r){return this.client.variation(e,t||void 0,r)},i.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t||void 0,r)},i.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t||void 0)},i.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t||void 0)},i.prototype.track=function(e,t){this.client.track(e,t||void 0)},i.prototype.trackPageView=function(e){this.client.trackPageView(OR(OR({},e),{user:(null==e?void 0:e.user)||void 0}))},i.prototype.remoteConfig=function(e){return this.client.remoteConfig(e||void 0)},i.prototype.onReady=function(e,t){this.client.onReady(e,t)},i.prototype.getExperiment=function(e){return this.client.getExperiment(e)},i.prototype.onInitialized=function(e){return this.client.onInitialized(e)},i.prototype.emitUpdatedUser=function(e){UR.isUserEqual(this._currentUser,e)||this.emit("user-updated",e),this._currentUser=e},i.prototype.showUserExplorer=function(){this.client.showUserExplorer()},i.prototype.hideUserExplorer=function(){this.client.hideUserExplorer()},i.prototype.fetch=function(){return this.client.fetch()},i.prototype.setInAppMessageListener=function(e){this.client.setInAppMessageListener(e)},i.prototype.close=function(){this.client.close()},i.prototype.setPhoneNumber=function(t){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.setPhoneNumber(t),[2]})})},i.prototype.unsetPhoneNumber=function(){return PR(this,void 0,void 0,function(){return SR(this,function(e){return this.client.unsetPhoneNumber(),[2]})})},i.prototype.getDisplayedInAppMessageView=function(){return this.client.getDisplayedInAppMessageView()},i}(Fa);var k={exports:{}},i={},LR=Object.getOwnPropertySymbols,FR=Object.prototype.hasOwnProperty,VR=Object.prototype.propertyIsEnumerable;var Wu=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),i=1;i<arguments.length;i++){for(var o in r=Object(arguments[i]))FR.call(r,o)&&(n[o]=r[o]);if(LR)for(var s=LR(r),a=0;a<s.length;a++)VR.call(r,s[a])&&(n[s[a]]=r[s[a]])}return n},jR=Wu,cp="function"==typeof Symbol&&Symbol.for,BR=cp?Symbol.for("react.element"):60103,KR=cp?Symbol.for("react.portal"):60106,Va=cp?Symbol.for("react.fragment"):60107,Vu=cp?Symbol.for("react.strict_mode"):60108,I=cp?Symbol.for("react.profiler"):60114,GR=cp?Symbol.for("react.provider"):60109,HR=cp?Symbol.for("react.context"):60110,zR=cp?Symbol.for("react.forward_ref"):60112,T=cp?Symbol.for("react.suspense"):60113,YR=cp?Symbol.for("react.memo"):60115,JR=cp?Symbol.for("react.lazy"):60116,qR="function"==typeof Symbol&&Symbol.iterator;function WR(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 $R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},XR={};function ZR(e,t,r){this.props=e,this.context=t,this.refs=XR,this.updater=r||$R}function QR(){}function eC(e,t,r){this.props=e,this.context=t,this.refs=XR,this.updater=r||$R}ZR.prototype.isReactComponent={},ZR.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(WR(85));this.updater.enqueueSetState(this,e,t,"setState")},ZR.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},QR.prototype=ZR.prototype;var ba=eC.prototype=new QR,tC=(ba.constructor=eC,jR(ba,ZR.prototype),ba.isPureReactComponent=!0,{current:null}),rC=Object.prototype.hasOwnProperty,nC={key:!0,ref:!0,__self:!0,__source:!0};function iC(e,t,r){var n,i={},o=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)rC.call(t,n)&&!nC.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(1===a)i.children=r;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===i[n]&&(i[n]=a[n]);return{$$typeof:BR,type:e,key:o,ref:s,props:i,_owner:tC.current}}function oC(e){return"object"==typeof e&&null!==e&&e.$$typeof===BR}var sC=/\/+/g,aC=[];function uC(e,t,r,n){var i;return aC.length?((i=aC.pop()).result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i):{result:e,keyPrefix:t,func:r,context:n,count:0}}function cC(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,aC.length<10&&aC.push(e)}function pC(e,t,r){return null==e?0:function e(t,r,n,i){var o=!1;if(null===(t="undefined"!=(a=typeof t)&&"boolean"!==a?t:null))o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case BR:case KR:o=!0}}if(o)return n(i,t,""===r?"."+lC(t,0):r),1;if(o=0,r=""===r?".":r+":",Array.isArray(t))for(var s=0;s<t.length;s++){var a,u=r+lC(a=t[s],s);o+=e(a,u,n,i)}else if("function"==typeof(u=null!==t&&"object"==typeof t&&"function"==typeof(u=qR&&t[qR]||t["@@iterator"])?u:null))for(t=u.call(t),s=0;!(a=t.next()).done;)o+=e(a=a.value,u=r+lC(a,s++),n,i);else if("object"===a)throw n=""+t,Error(WR(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return o}(e,"",t,r)}function lC(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 fC(e,t){e.func.call(e.context,t,e.count++)}function hC(e,t,r){var n=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?dC(e,n,r,function(e){return e}):null!=e&&(oC(e)&&(t=i+(!(i=e).key||t&&t.key===e.key?"":(""+e.key).replace(sC,"$&/")+"/")+r,e={$$typeof:BR,type:i.type,key:t,ref:i.ref,props:i.props,_owner:i._owner}),n.push(e))}function dC(e,t,r,n,i){var o="";pC(e,hC,t=uC(t,o=null!=r?(""+r).replace(sC,"$&/")+"/":o,n,i)),cC(t)}var yC={current:null};function vC(){var e=yC.current;if(null===e)throw Error(WR(321));return e}var gC,mC,EC,za={ReactCurrentDispatcher:yC,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:tC,IsSomeRendererActing:{current:!1},assign:jR},S=(i.Children={map:function(e,t,r){if(null==e)return e;var n=[];return dC(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;pC(e,fC,t=uC(null,null,t,r)),cC(t)},count:function(e){return pC(e,function(){return null},null)},toArray:function(e){var t=[];return dC(e,t,null,function(e){return e}),t},only:function(e){if(oC(e))return e;throw Error(WR(143))}},i.Component=ZR,i.Fragment=Va,i.Profiler=I,i.PureComponent=eC,i.StrictMode=Vu,i.Suspense=T,i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=za,i.cloneElement=function(e,t,r){if(null==e)throw Error(WR(267,e));var n=jR({},e.props),i=e.key,o=e.ref,s=e._owner;if(null!=t)for(a in void 0!==t.ref&&(o=t.ref,s=tC.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)rC.call(t,a)&&!nC.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==u?u:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];n.children=u}return{$$typeof:BR,type:e.type,key:i,ref:o,props:n,_owner:s}},i.createContext=function(e,t){return(e={$$typeof:HR,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:GR,_context:e},e.Consumer=e},i.createElement=iC,i.createFactory=function(e){var t=iC.bind(null,e);return t.type=e,t},i.createRef=function(){return{current:null}},i.forwardRef=function(e){return{$$typeof:zR,render:e}},i.isValidElement=oC,i.lazy=function(e){return{$$typeof:JR,_ctor:e,_status:-1,_result:null}},i.memo=function(e,t){return{$$typeof:YR,type:e,compare:void 0===t?null:t}},i.useCallback=function(e,t){return vC().useCallback(e,t)},i.useContext=function(e,t){return vC().useContext(e,t)},i.useDebugValue=function(){},i.useEffect=function(e,t){return vC().useEffect(e,t)},i.useImperativeHandle=function(e,t,r){return vC().useImperativeHandle(e,t,r)},i.useLayoutEffect=function(e,t){return vC().useLayoutEffect(e,t)},i.useMemo=function(e,t){return vC().useMemo(e,t)},i.useReducer=function(e,t,r){return vC().useReducer(e,t,r)},i.useRef=function(e){return vC().useRef(e)},i.useState=function(e){return vC().useState(e)},i.version="16.14.0",{}),pp=Function.call.bind(Object.prototype.hasOwnProperty),wC=function(){};function bC(e,t,r,n,i){if("production"!==production)for(var o in e)if(EC(e,o)){var s,a;try{if("function"!=typeof e[o])throw(a=Error((n||"React class")+": "+r+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.")).name="Invariant Violation",a;s=e[o](t,o,n,r,null,gC)}catch(e){s=e}!s||s instanceof Error||wC((n||"React class")+": type specification of "+r+" `"+o+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in mC)&&(mC[s.message]=!0,o=i?i():"",wC("Failed "+r+" type: "+s.message+(null!=o?o:"")))}}if("production"!==production&&(gC="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",mC={},EC=pp,wC=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),bC.resetWarningCache=function(){"production"!==production&&(mC={})},"production"!==production){var TC=Wu,_C=bC,t="function"==typeof Symbol&&Symbol.for,IC=t?Symbol.for("react.element"):60103,AC=t?Symbol.for("react.portal"):60106,NC=t?Symbol.for("react.fragment"):60107,OC=t?Symbol.for("react.strict_mode"):60108,PC=t?Symbol.for("react.profiler"):60114,SC=t?Symbol.for("react.provider"):60109,MC=t?Symbol.for("react.context"):60110,RC=t?Symbol.for("react.concurrent_mode"):60111,CC=t?Symbol.for("react.forward_ref"):60112,xC=t?Symbol.for("react.suspense"):60113,UC=t?Symbol.for("react.suspense_list"):60120,kC=t?Symbol.for("react.memo"):60115,DC=t?Symbol.for("react.lazy"):60116,LC=t?Symbol.for("react.block"):60121,FC=t?Symbol.for("react.fundamental"):60117,VC=t?Symbol.for("react.responder"):60118,jC=t?Symbol.for("react.scope"):60119,BC="function"==typeof Symbol&&Symbol.iterator,KC="@@iterator";function GC(e){if(null===e||"object"!=typeof e)return null;e=BC&&e[BC]||e[KC];return"function"==typeof e?e:null}var HC={current:null},zC={current:null},YC=/^(.*)[\\\/]/,JC=1;function qC(e){if(null==e)return null;if("number"==typeof e.tag&&ex("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 NC:return"Fragment";case AC:return"Portal";case PC:return"Profiler";case OC:return"StrictMode";case xC:return"Suspense";case UC:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case MC:return"Context.Consumer";case SC:return"Context.Provider";case CC:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case kC:return qC(e.type);case LC:return qC(e.render);case DC:r=(t=e)._status===JC?t._result:null;if(r)return qC(r)}var t,r;return null}var WC={},$C=null;function XC(e){$C=e}WC.getCurrentStack=null,WC.getStackAddendum=function(){var e,t,r,n,i,o="",s=($C&&(e=qC($C.type),r=$C._owner,o+=(e=e,t=$C._source,r=r&&qC(r.type),i="",t?(n=(s=t.fileName).replace(YC,""),i=" (at "+(n=/^index\./.test(n)&&(s=s.match(YC))&&(s=s[1])?s.replace(YC,"")+"/"+n:n)+":"+t.lineNumber+")"):r&&(i=" (created by "+r+")"),"\n in "+(e||"Unknown")+i)),WC.getCurrentStack);return s&&(o+=s()||""),o};var ZC={ReactCurrentDispatcher:HC,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:zC,IsSomeRendererActing:{current:!1},assign:TC};function QC(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];tx("warn",e,r)}function ex(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];tx("error",e,r)}function tx(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=ZC.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 i=0,o="Warning: "+t.replace(/%s/g,function(){return r[i++]});throw new Error(o)}catch(e){}}TC(ZC,{ReactDebugCurrentFrame:WC,ReactComponentTreeHook:{}});var rx={};function nx(e,t){var e=e.constructor,e=e&&(e.displayName||e.name)||"ReactClass",r=e+"."+t;rx[r]||(ex("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),rx[r]=!0)}var ix={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){nx(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){nx(e,"replaceState")},enqueueSetState:function(e,t,r,n){nx(e,"setState")}},ox={};function sx(e,t,r){this.props=e,this.context=t,this.refs=ox,this.updater=r||ix}Object.freeze(ox),sx.prototype.isReactComponent={},sx.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")},sx.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var ax,ux={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(ax in ux)ux.hasOwnProperty(ax)&&!function(e,t){Object.defineProperty(sx.prototype,e,{get:function(){QC("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(ax,ux[ax]);function cx(){}function px(e,t,r){this.props=e,this.context=t,this.refs=ox,this.updater=r||ix}cx.prototype=sx.prototype,(t=px.prototype=new cx).constructor=px,TC(t,sx.prototype),t.isPureReactComponent=!0;var lx,fx,hx=Object.prototype.hasOwnProperty,dx={key:!0,ref:!0,__self:!0,__source:!0};function yx(e){if(hx.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function vx(e){if(hx.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var gx={},mx=function(e,t,r,n,i,o,s){e={$$typeof:IC,type:e,key:t,ref:r,props:s,_owner:o,_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:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e};function Ex(e,t,r){var n,i={},o=null,s=null,a=null,u=null;if(null!=t)for(n in yx(t)&&(s=t.ref,"string"==typeof(c=t).ref&&zC.current&&c.__self&&zC.current.stateNode!==c.__self&&(l=qC(zC.current.type),gx[l]||(ex('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',qC(zC.current.type),c.ref),gx[l]=!0))),vx(t)&&(o=""+t.key),a=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source,t)hx.call(t,n)&&!dx.hasOwnProperty(n)&&(i[n]=t[n]);var c,p,l,f,h=arguments.length-2;if(1==h)i.children=r;else if(1<h){for(var d=Array(h),y=0;y<h;y++)d[y]=arguments[y+2];Object.freeze&&Object.freeze(d),i.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(n in v)void 0===i[n]&&(i[n]=v[n])}function g(){fx||(fx=!0,ex("%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)",p))}function m(){lx||(lx=!0,ex("%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)",f))}return(o||s)&&(c="function"==typeof e?e.displayName||e.name||"Unknown":e,o&&(l=i,f=c,m.isReactWarning=!0,Object.defineProperty(l,"key",{get:m,configurable:!0})),s&&(r=i,p=c,g.isReactWarning=!0,Object.defineProperty(r,"ref",{get:g,configurable:!0}))),mx(e,o,s,a,u,zC.current,i)}function wx(e){return"object"==typeof e&&null!==e&&e.$$typeof===IC}var bx=".",Tx=":",_x=!1,Ix=/\/+/g;function Ax(e){return(""+e).replace(Ix,"$&/")}var Nx=10,Ox=[];function Px(e,t,r,n){var i;return Ox.length?((i=Ox.pop()).result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i):{result:e,keyPrefix:t,func:r,context:n,count:0}}function Sx(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,Ox.length<Nx&&Ox.push(e)}function Mx(e,t,r){return null==e?0:function e(t,r,n,i){var o,s=typeof t,a=!1;if(null===(t="undefined"!=s&&"boolean"!=s?t:null))a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case IC:case AC:a=!0}}if(a)return n(i,t,""===r?bx+Rx(t,0):r),1;var u=0,c=""===r?bx:r+Tx;if(Array.isArray(t))for(var p=0;p<t.length;p++)u+=e(o=t[p],c+Rx(o,p),n,i);else if("function"==typeof(r=GC(t))){r===t.entries&&(_x||QC("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."),_x=!0);for(var l,f=r.call(t),h=0;!(l=f.next()).done;)u+=e(o=l.value,c+Rx(o,h++),n,i)}else if("object"==s)throw r="",r=" If you meant to render a collection of children, use an array instead."+WC.getStackAddendum(),s=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==s?"object with keys {"+Object.keys(t).join(", ")+"}":s)+")."+r);return u}(e,"",t,r)}function Rx(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 Cx(e,t,r){var n=e.func,i=e.context;n.call(i,t,e.count++)}function xx(e,t,r){var n=e.result,i=e.keyPrefix,o=e.func,s=e.context,o=o.call(s,t,e.count++);Array.isArray(o)?Ux(o,n,r,function(e){return e}):null!=o&&(wx(o)&&(e=i+(!(s=o).key||t&&t.key===o.key?"":Ax(o.key)+"/")+r,o=mx(s.type,e,s.ref,s._self,s._source,s._owner,s.props)),n.push(o))}function Ux(e,t,r,n,i){var o="",t=Px(t,o=null!=r?Ax(r)+"/":o,n,i);Mx(e,xx,t),Sx(t)}function kx(e){return"string"==typeof e||"function"==typeof e||e===NC||e===RC||e===PC||e===OC||e===xC||e===UC||"object"==typeof e&&null!==e&&(e.$$typeof===DC||e.$$typeof===kC||e.$$typeof===SC||e.$$typeof===MC||e.$$typeof===CC||e.$$typeof===FC||e.$$typeof===VC||e.$$typeof===jC||e.$$typeof===LC)}function Dx(){var e=HC.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 Lx(){if(zC.current){var e=qC(zC.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var Fx=!1,Vx={};function jx(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,t=t,(r=Lx())||(t="string"==typeof t?t:t.displayName||t.name)&&(r="\n\nCheck the top-level render call using <"+t+">."),Vx[t=r]||(Vx[t]=!0,r="",e&&e._owner&&e._owner!==zC.current&&(r=" It was passed a child from "+qC(e._owner.type)+"."),XC(e),ex('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),XC(null)))}function Bx(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];wx(n)&&jx(n,t)}else if(wx(e))e._store&&(e._store.validated=!0);else if(e){var i=GC(e);if("function"==typeof i&&i!==e.entries)for(var o,s=i.call(e);!(o=s.next()).done;)wx(o.value)&&jx(o.value,t)}}function Kx(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=qC(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==CC&&t.$$typeof!==kC)return;r=t.propTypes}r?(XC(e),_C(r,e.props,"prop",n,WC.getStackAddendum),XC(null)):void 0===t.PropTypes||Fx||(Fx=!0,ex("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||ex("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Gx(e,t,r){var n,i=kx(e),t=(i||(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+".":"")||Lx(),null===e?s="null":Array.isArray(e)?s="array":void 0!==e&&e.$$typeof===IC?(s="<"+(qC(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,ex("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,n)),Ex.apply(this,arguments));if(null==t)return t;if(i)for(var o=2;o<arguments.length;o++)Bx(arguments[o],e);if(e===NC){var s=t;XC(s);for(var a=Object.keys(s.props),u=0;u<a.length;u++){var c=a[u];if("children"!==c&&"key"!==c){ex("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c);break}}null!==s.ref&&ex("Invalid attribute `ref` supplied to `React.Fragment`."),XC(null)}else Kx(t);return t}var Hx=!1;try{var zx=Object.freeze({}),Yx=new Map([[zx,null]]),Jx=new Set([zx]);Yx.set(0,0),Jx.add(0)}catch(e){}function qx(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,i,o=TC({},e.props),s=e.key,a=e.ref,u=e._self,c=e._source,p=e._owner;if(null!=t)for(n in yx(t)&&(a=t.ref,p=zC.current),vx(t)&&(s=""+t.key),e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)hx.call(t,n)&&!dx.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==i?o[n]=i[n]:o[n]=t[n]);var l=arguments.length-2;if(1==l)o.children=r;else if(1<l){for(var f=Array(l),h=0;h<l;h++)f[h]=arguments[h+2];o.children=f}return mx(e.type,s,a,u,c,p,o)}.apply(this,arguments),i=2;i<arguments.length;i++)Bx(arguments[i],n.type);return Kx(n),n}function Wx(e){var t=Gx.bind(null,e);return t.type=e,Hx||(Hx=!0,QC("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 QC("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}t=Gx,S.Children={map:function(e,t,r){if(null==e)return e;var n=[];return Ux(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=Px(null,null,t,r),Mx(e,Cx,t),Sx(t)},count:function(e){return Mx(e,function(){return null},null)},toArray:function(e){var t=[];return Ux(e,t,null,function(e){return e}),t},only:function(e){if(wx(e))return e;throw Error("React.Children.only expected to receive a single React element child.")}},S.Component=sx,S.Fragment=NC,S.Profiler=PC,S.PureComponent=px,S.StrictMode=OC,S.Suspense=xC,S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZC,S.cloneElement=qx,S.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&ex("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:MC,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:SC,_context:r}),i=!1,t={$$typeof:MC,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(t,{Provider:{get:function(){return i||(i=!0,ex("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,ex("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},S.createElement=t,S.createFactory=Wx,S.createRef=function(){var e={current:null};return Object.seal(e),e},S.forwardRef=function(e){return null!=e&&e.$$typeof===kC?ex("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?ex("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&ex("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||ex("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:CC,render:e}},S.isValidElement=wx,S.lazy=function(e){var t,r,n={$$typeof:DC,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){ex("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){ex("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},S.memo=function(e,t){return kx(e)||ex("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:kC,type:e,compare:void 0===t?null:t}},S.useCallback=function(e,t){return Dx().useCallback(e,t)},S.useContext=function(e,t){var r,n=Dx();return void 0!==t&&ex("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?ex("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&&ex("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},S.useDebugValue=function(e,t){return Dx().useDebugValue(e,t)},S.useEffect=function(e,t){return Dx().useEffect(e,t)},S.useImperativeHandle=function(e,t,r){return Dx().useImperativeHandle(e,t,r)},S.useLayoutEffect=function(e,t){return Dx().useLayoutEffect(e,t)},S.useMemo=function(e,t){return Dx().useMemo(e,t)},S.useReducer=function(e,t,r){return Dx().useReducer(e,t,r)},S.useRef=function(e){return Dx().useRef(e)},S.useState=function(e){return Dx().useState(e)},S.version="16.14.0"}"production"===production?k.exports=i:k.exports=S;var $x=k.exports,Xx=k.exports.createContext({hackle:void 0,userVersion:0,initialized:!1}),A=Xx.Consumer,Zx=Xx.Provider;var Qx=l.log;function eU(e,t){e=tU(e,t=void 0===t?"A":t);return{isLoading:e.isLoading,variation:e.decision.variation}}function tU(e,t){void 0===t&&(t="A");var r=k.exports.useContext(Xx),n=r.hackle,i=r.userVersion,o=r.initialized,s=k.exports.useCallback(function(){return o?(null==n?void 0:n.variationDetail(e))||bt.of(t,h.EXCEPTION):bt.of(t,h.SDK_NOT_READY)},[t,e,n,o]),r=MR(k.exports.useState(function(){return n?s():(Qx.error("HackleClient is not existed"),bt.of(t,h.EXCEPTION))}),2),a=r[0],r=r[1],i={key:e,userVersion:i,initialized:o},u=MR(k.exports.useState(i),2),c=u[0],u=u[1];return iU(c,i)||(u(i),r(s())),{isLoading:!o,decision:a}}function rU(e){e=nU(e);return{isLoading:e.isLoading,isOn:e.decision.isOn}}function nU(e){var t=k.exports.useContext(Xx),r=t.hackle,n=t.userVersion,i=t.initialized,o=k.exports.useCallback(function(){return i?(null==r?void 0:r.featureFlagDetail(e))||_t.off(h.EXCEPTION):_t.off(h.SDK_NOT_READY)},[e,r,i]),t=MR(k.exports.useState(function(){return r?o():(Qx.error("HackleClient is not existed"),_t.off(h.EXCEPTION))}),2),s=t[0],t=t[1],n={key:e,userVersion:n,initialized:i},a=MR(k.exports.useState(n),2),u=a[0],a=a[1];return iU(u,n)||(a(n),t(o())),{isLoading:!i,decision:s}}function iU(e,t){return e.initialized===t.initialized&&e.key===t.key&&e.userVersion===t.userVersion}function oU(e){var t,r=e.experimentKey,e=e.children,n=(r=eU(r)).isLoading,i=r.variation;return n?null:e&&"function"==typeof e?e(i):(k.exports.Children.forEach(e,function(e){k.exports.isValidElement(e)&&(e.props.variation?i===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?k.exports.cloneElement(t,{variation:i}):null)}function sU(e){return e.variation,e=e.children,k.exports.createElement(k.exports.Fragment,null,e)}function aU(e){var t=(r=rU(e.featureKey)).isLoading,r=r.isOn;return t?null:$x.createElement($x.Fragment,null,e.children(r))}n.Bucket=Ut,n.Cohort=Xn,n.Container=sr,n.ContainerGroup=ur,n.CoreVersion=mr,n.Decision=bt,n.DecisionReason=h,n.DefaultBrowserPropertyProvider=gP,n.Delay=Jn,n.EXPERIMENT_IMPLEMENTATION_TYPE=St,n.EmptyHackleRemoteConfig=At,n.EmptyParameterConfig=je,n.EventType=Ft,n.Experiment=Mt,n.FeatureFlagDecision=_t,n.HackleContext=Xx,n.HackleContextConsumer=A,n.HackleContextProvider=Zx,n.HackleExperiment=oU,n.HackleFeature=aU,n.HackleInAppMessageActionImpl=Wn,n.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=void 0===(i=e.timeout)?3e3:i,i=void 0!==(i=e.supportSSR)&&i,e=e.children,o=MR(k.exports.useState({hackle:t,initialized:!1,userVersion:0}),2),s=o[0],a=o[1];return k.exports.useEffect(function(){null!=r&&t.setUser(r)},[r]),k.exports.useEffect(function(){function e(){a(function(e){return OR(OR({},e),{userVersion:e.userVersion+1})})}return t.on("user-updated",e),function(){t.off("user-updated",e)}},[t]),k.exports.useEffect(function(){t.onInitialized({timeout:n}).then(function(){a(function(e){return OR(OR({},e),{initialized:!0})})},function(){a(function(e){return OR(OR({},e),{initialized:!0})})}).catch(function(){a(function(e){return OR(OR({},e),{initialized:!0})})})},[t]),i||s.initialized?$x.createElement(Zx,{value:s},e):null},n.HackleSubscriptionOperations=lR,n.HackleSubscriptionOperationsBuilder=Zl,n.HackleVariation=sU,n.IAM_ACTION_AREA=["BUTTON","IMAGE","MESSAGE","X_BUTTON"],n.IAM_ACTION_TYPE=Lr,n.IAM_BEHAVIOR=Dr,n.IAM_DISPLAY_TYPE=xr,n.IAM_HORIZONTAL_ALIGNMENT=Vr,n.IAM_LAYOUT_TYPE=Ur,n.IAM_ORIENTATION=kr,n.IAM_PLATFORM_TYPE=Rr,n.IAM_STATUS=Mr,n.IAM_TIMETABLE_TYPE=jr,n.IAM_TIMEUNIT=Cr,n.IAM_VERTICAL_ALIGNMENT=Fr,n.IdentifierType=jt,n.IdentifiersBuilder=Gt,n.InAppMessage=Br,n.InAppMessageAction=Bn,n.InAppMessageAfterCondition=zn,n.InAppMessageAlignment=In,n.InAppMessageBackground=jn,n.InAppMessageButton=kn,n.InAppMessageButtonStyle=Vn,n.InAppMessageContext=gn,n.InAppMessageContextLayout=Tn,n.InAppMessageContextMessage=wn,n.InAppMessageDurationCap=ln,n.InAppMessageEvaluateContext=Gn,n.InAppMessageEventFrequencyCap=an,n.InAppMessageEventTrigger=nn,n.InAppMessageEventTriggerRule=on,n.InAppMessageExperimentContext=En,n.InAppMessageIdentifierCap=cn,n.InAppMessageImage=Nn,n.InAppMessageImageAutoScroll=Pn,n.InAppMessagePeriodAlways=Gr,n.InAppMessagePeriodCustom=zr,n.InAppMessagePositionalButton=Ln,n.InAppMessageTargetContext=hn,n.InAppMessageText=Mn,n.InAppMessageTextAttribute=Cn,n.InAppMessageTextStyle=Un,n.InAppMessageTimetable=Jr,n.InAppMessageTimetableAll=$r,n.InAppMessageTimetableCustom=Qr,n.InAppMessageTimetableSlot=tn,n.InAppMessageUserOverride=yn,n.Logger=l,n.MATCH_OPERATORS=Ir,n.MATCH_TYPES=Tr,n.MATCH_VALUE_TYPES=_r,n.MetaVersion=wr,n.ParameterConfiguration=Ot,n.PropertyOperations=Ho,n.PropertyOperationsBuilder=Ko,n.RemoteConfigDecision=Et,n.RemoteConfigParameter=pr,n.RemoteConfigParameterValue=dr,n.RemoteConfigTargetRule=fr,n.SEGMENT_TYPES=Or,n.Segment=ir,n.Slot=Dt,n.SplitUrlConfig=Zn,n.SplitUrlTargets=ei,n.TARGET_ACTION_TYPES=Ar,n.TARGET_KEY_TYPES=Nr,n.Target=Yt,n.TargetAction=er,n.TargetCondition=qt,n.TargetKey=$t,n.TargetMatch=Zt,n.TargetRule=rr,n.TargetingType=Pr,n.UserTargetEvent=ri,n.Variation=Ct,n.Version=vr,n.WebViewLifecycleCompositeManager=P,n.createInstance=function(e,t){return new DR(e,t)},n.getUserId=hs,n.removeUserId=ds,n.resolveIdentifiers=Kt,n.sanitizeUser=zt,n.setUserId=function(e){cs.getInstance().setItem(Qe,e)},n.useFeature=function(e){var t=(n=k.exports.useContext(Xx)).hackle,r=n.userVersion,n=n.initialized,i=k.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e))||!1},[e,t,n]),o=(s=MR(k.exports.useState(function(){return t?i():("undefined"!=typeof window&&Qx.error("HackleClient is not existed"),!1)}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=MR(k.exports.useState(r),2))[0],n=n[1];return iU(a,r)||(n(r),s(i())),o},n.useFeatureFlagDetail=function(e){var t=(n=k.exports.useContext(Xx)).hackle,r=n.userVersion,n=n.initialized,i=k.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e))||_t.off(h.EXCEPTION)},[e,t,n]),o=(s=MR(k.exports.useState(function(){return t?i():("undefined"!=typeof window&&Qx.error("HackleClient is not existed"),_t.off(h.EXCEPTION))}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=MR(k.exports.useState(r),2))[0],n=n[1];return iU(a,r)||(n(r),s(i())),o},n.useLoadableFeature=rU,n.useLoadableFeatureDetail=nU,n.useLoadableRemoteConfig=function(){var e=(o=k.exports.useContext(Xx)).hackle,t=o.userVersion,r=o.initialized,n=k.exports.useCallback(function(){return r&&(null==e?void 0:e.remoteConfig())||new At},[e,r]),i=(o=MR(k.exports.useState(function(){return e||Qx.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(a=MR(k.exports.useState(t),2))[0],a=a[1];return iU(s,t)||(a(t),o(n())),{isLoading:!r,remoteConfig:i}},n.useLoadableVariation=eU,n.useLoadableVariationDetail=tU,n.useRemoteConfig=function(){var e=(r=k.exports.useContext(Xx)).hackle,t=r.userVersion,r=r.initialized,n=k.exports.useCallback(function(){return(null==e?void 0:e.remoteConfig())||new At},[e,r]),i=(o=MR(k.exports.useState(function(){return e||Qx.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(r=MR(k.exports.useState(t),2))[0],r=r[1];return iU(s,t)||(r(t),o(n())),i},n.useTrack=function(){var t=k.exports.useContext(Xx).hackle;return t?function(e){return null==t?void 0:t.track(e)}:(Qx.error("HackleClient is not existed"),function(){})},n.useVariation=function(e,t){void 0===t&&(t="A");var r=(a=k.exports.useContext(Xx)).hackle,n=a.userVersion,i=a.initialized,o=k.exports.useCallback(function(){return i&&(null==r?void 0:r.variation(e))||t},[t,e,r,i]),s=(a=MR(k.exports.useState(function(){return r?o():("undefined"!=typeof window&&Qx.error("HackleClient is not existed"),t)}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(c=MR(k.exports.useState(n),2))[0],c=c[1];return iU(u,n)||(c(n),a(o())),s},n.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(i=k.exports.useContext(Xx)).hackle,n=i.userVersion,i=i.initialized,o=k.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e))||bt.of(t,h.EXCEPTION)},[t,e,r,i]),s=(a=MR(k.exports.useState(function(){return r?o():("undefined"!=typeof window&&Qx.error("HackleClient is not existed"),bt.of(t,h.EXCEPTION))}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(i=MR(k.exports.useState(n),2))[0],i=i[1];return iU(u,n)||(i(n),a(o())),s},Object.defineProperty(n,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={})}(this,function(n){"use strict";var D,L=new Uint8Array(16);var F=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var V=[],B=0;B<256;++B)V.push((B+256).toString(16).substr(1));function K(e,t){var t=1<arguments.length&&void 0!==t?t:0,e=(V[e[t+0]]+V[e[t+1]]+V[e[t+2]]+V[e[t+3]]+"-"+V[e[t+4]]+V[e[t+5]]+"-"+V[e[t+6]]+V[e[t+7]]+"-"+V[e[t+8]]+V[e[t+9]]+"-"+V[e[t+10]]+V[e[t+11]]+V[e[t+12]]+V[e[t+13]]+V[e[t+14]]+V[e[t+15]]).toLowerCase();if("string"==typeof(t=e)&&F.test(t))return e;throw TypeError("Stringified UUID is invalid")}function H(e,t,r){var n=(e=e||{}).random||(e.rng||function(){if(D=D||"undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto))return D(L);throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return K(n)}var e="3.7.5",j="function"==typeof atob,t="function"==typeof btoa,G="function"==typeof Buffer;const z="function"==typeof TextDecoder?new TextDecoder:void 0,Y="function"==typeof TextEncoder?new TextEncoder:void 0;const J=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),q=(e=>{let r={};return e.forEach((e,t)=>r[e]=t),r})(J),W=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,$=String.fromCharCode.bind(String),X="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Z=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),Q=e=>e.replace(/[^A-Za-z0-9\+\/]/g,"");var ee=t=>{let r,n,i,o,s="";var e=t.length%3;for(let e=0;e<t.length;){if(255<(n=t.charCodeAt(e++))||255<(i=t.charCodeAt(e++))||255<(o=t.charCodeAt(e++)))throw new TypeError("invalid character found");r=n<<16|i<<8|o,s+=J[r>>18&63]+J[r>>12&63]+J[r>>6&63]+J[63&r]}return e?s.slice(0,e-3)+"===".substring(e):s};const te=t?e=>btoa(e):G?e=>Buffer.from(e,"binary").toString("base64"):ee,re=G?e=>Buffer.from(e).toString("base64"):r=>{let n=[];for(let e=0,t=r.length;e<t;e+=4096)n.push($.apply(null,r.subarray(e,e+4096)));return te(n.join(""))},ne=(e,t=!1)=>t?Z(re(e)):re(e),ie=e=>{var t;return e.length<2?(t=e.charCodeAt(0))<128?e:t<2048?$(192|t>>>6)+$(128|63&t):$(224|t>>>12&15)+$(128|t>>>6&63)+$(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),$(240|t>>>18&7)+$(128|t>>>12&63)+$(128|t>>>6&63)+$(128|63&t))},oe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,se=e=>e.replace(oe,ie),ae=G?e=>Buffer.from(e,"utf8").toString("base64"):Y?e=>re(Y.encode(e)):e=>te(se(e)),ue=(e,t=!1)=>t?Z(ae(e)):ae(e);t=e=>ue(e,!0);const ce=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,pe=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return $(55296+(t>>>10))+$(56320+(1023&t));case 3:return $((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return $((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},le=e=>e.replace(ce,pe);var r=t=>{if(t=t.replace(/\s+/g,""),!W.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let r,n="",i,o;for(let e=0;e<t.length;)r=q[t.charAt(e++)]<<18|q[t.charAt(e++)]<<12|(i=q[t.charAt(e++)])<<6|(o=q[t.charAt(e++)]),n+=64===i?$(r>>16&255):64===o?$(r>>16&255,r>>8&255):$(r>>16&255,r>>8&255,255&r);return n};const fe=j?e=>atob(Q(e)):G?e=>Buffer.from(e,"base64").toString("binary"):r,he=G?e=>X(Buffer.from(e,"base64")):e=>X(fe(e).split("").map(e=>e.charCodeAt(0))),de=e=>he(ve(e)),ye=G?e=>Buffer.from(e,"base64").toString("utf8"):z?e=>z.decode(he(e)):e=>le(fe(e)),ve=e=>Q(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),ge=e=>ye(ve(e));function me(){var e=(e,t)=>Object.defineProperty(String.prototype,e,we(t));e("fromBase64",function(){return ge(this)}),e("toBase64",function(e){return ue(this,e)}),e("toBase64URI",function(){return ue(this,!0)}),e("toBase64URL",function(){return ue(this,!0)}),e("toUint8Array",function(){return de(this)})}function Ee(){var e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,we(t));e("toBase64",function(e){return ne(this,e)}),e("toBase64URI",function(){return ne(this,!0)}),e("toBase64URL",function(){return ne(this,!0)})}const we=e=>({value:e,enumerable:!1,writable:!0,configurable:!0});const be={version:e,VERSION:"3.7.5",atob:fe,atobPolyfill:r,btoa:te,btoaPolyfill:ee,fromBase64:ge,toBase64:ue,encode:ue,encodeURI:t,encodeURL:t,utob:se,btou:le,decode:ge,isValid:e=>{if("string"!=typeof e)return!1;e=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:ne,toUint8Array:de,extendString:me,extendUint8Array:Ee,extendBuiltins:()=>{me(),Ee()}};Ae.isNotNullOrUndefined=function(e){return null!=e},Ae.isNullOrUndefined=function(e){return null==e},Ae.requiredNotNullOrUndefined=function(e,t){if(void 0===t&&(t=function(){return"Required value is null or undefined"}),this.isNullOrUndefined(e))throw new Error(t());return e},Ae.fromMap=function(e){var r={};return e.forEach(function(e,t){r[t]=e}),r};var c=Ae;function Ae(){}Ie.mapNotNullOrUndefined=function(e,t){for(var r=Array(),n=0,i=e;n<i.length;n++){var o=t(i[n]);c.isNotNullOrUndefined(o)&&r.push(o)}return r},Ie.mapOrUndefined=function(e,t){for(var r=Array(),n=0,i=e;n<i.length;n++){var o=t(i[n]);if(c.isNullOrUndefined(o))return;r.push(o)}return r},Ie.associateTo=function(e,t,r){for(var n=0,i=e;n<i.length;n++){var o=r(i[n]);t.set(o[0],o[1])}return t},Ie.associate=function(e,t){return this.associateTo(e,new Map,t)},Ie.associateBy=function(e,t){return this.associate(e,function(e){return[t(e),e]})},Ie.associateRecord=function(e,t){for(var r={},n=0,i=e;n<i.length;n++){var o=t(i[n]),s=o[0],o=o[1];r[s]=o}return r},Ie.chunked=function(e,t){for(var r=[],n=e.slice();n.length;)r.push(n.splice(0,t));return r},Ie.sum=function(e,r){return e.reduce(function(e,t){return e+r(t)},0)};var f=Ie;function Ie(){}var Te={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},s=(_e.setLogLevel=function(e){this.logLevel=e=void 0===e?Te.INFO:e},_e.initCounter=function(t){this.counters=f.associate(Object.keys(Te),function(e){return[e,t(e)]})},_e._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}if(t instanceof Error)Ne.log(e,r,t.message,t);else try{Ne.log(e,r,t)}catch(e){}},_e.increment=function(e){var t;null!=(t=null==(t=_e.counters)?void 0:t.get(e))&&t.increment()},_e.logLevel=Te.INFO,_e.log={error:function(e){Te.ERROR<=_e.logLevel&&(_e._log("ERROR",e),_e.increment("ERROR"))},warn:function(e){Te.WARN<=_e.logLevel&&(_e._log("WARN",e),_e.increment("WARN"))},info:function(e){Te.INFO<=_e.logLevel&&(_e._log("INFO",e),_e.increment("INFO"))},debug:function(e){Te.DEBUG<=_e.logLevel&&(_e._log("DEBUG",e),_e.increment("DEBUG"))}},_e);function _e(){}Pe.log=function(e,t,r,n){try{console.log("%c[".concat(e,"] Hackle: ").concat(r),"color: ".concat(t))}catch(e){}};var Ne=Pe;function Pe(){}var 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)};function i(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)}var p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,s,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}o((u=u.apply(e,s||[])).next())})}function a(n,i){var o,s,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(n,u)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function Me(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||((n=n||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var Se=s.log,Ce=(Re.isEqual=function(e,t){return e.type===t.type&&e.value===t.value},Re.isEquals=function(t,r){if(null==r)return!1;var e=Object.keys(t);return e.length===Object.keys(r).length&&e.every(function(e){return t[e]===r[e]})},Re.sanitize=function(e){var t={};if(c.isNullOrUndefined(e))return t;for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],o=i[0],i=i[1];this.isValidType(o)?(i=this.sanitizeValue(i),c.isNullOrUndefined(i)?Se.debug("Invalid identifier value. The identifier type value be a string of 512 characters or less. [".concat(o,"]")):t[o]=i):Se.debug("Invalid identifier type. The identifier type must be a string of 128 characters or less. [".concat(o,"]"))}return t},Re.isValidType=function(e){return!c.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length&&e.length<=this.MAX_IDENTIFIER_TYPE_LENGTH)},Re.sanitizeValue=function(e){return"string"==typeof e&&0<e.length&&e.length<=this.MAX_IDENTIFIER_VALUE_LENGTH?e:"number"==typeof e?e.toString():null},Re.MAX_IDENTIFIER_TYPE_LENGTH=128,Re.MAX_IDENTIFIER_VALUE_LENGTH=512,Re);function Re(){}var Ue=s.log,ke=(xe.sanitize=function(e){var t={};if(c.isNullOrUndefined(e))return t;for(var r=0,n=Object.entries(e);r<n.length;r++){var i,o=n[r],s=o[0],o=o[1];if(Object.keys(t).length>=this.MAX_PROPERTIES_COUNT){Ue.debug("The number of properties cannot exceed 128. Drops excess properties. [".concat(s,", ").concat(o,"]"));break}this.isValidKey(s)?(i=this.sanitizeValue(s,o),c.isNullOrUndefined(i)?Ue.debug("Invalid property value. The property value mus be 'string(..1024)', 'number', 'boolean', or 'array' type. [".concat(o,"]")):t[s]=i):Ue.debug("Invalid property key. The property key must be a string of 128 characters or less. [".concat(s,"]"))}return t},xe.isValidProperty=function(e,t){return this.isValidKey(e)&&this.isValidValue(t)},xe.isValidKey=function(e){return c.isNotNullOrUndefined(e)&&"string"==typeof e&&0<e.length&&e.length<=this.MAX_PROPERTY_KEY_LENGTH},xe.sanitizeValue=function(e,t){var r=this;return"string"==typeof e&&e.startsWith(this.SYSTEM_PROPERTY_KEY_PREFIX)?t:this.isValidValue(t)?Array.isArray(t)?t.filter(function(e){return r.isValidElement(e)}):t:null},xe.isValidValue=function(e){return!c.isNullOrUndefined(e)&&("string"==typeof e?e.length<=this.MAX_PROPERTY_VALUE_LENGTH:"number"==typeof e?!isNaN(e)&&isFinite(e):"boolean"==typeof e||Array.isArray(e))},xe.isValidElement=function(e){return!c.isNullOrUndefined(e)&&("string"==typeof e?0<e.length&&e.length<=this.MAX_PROPERTY_VALUE_LENGTH:"number"==typeof e)},xe.truncateStringValue=function(e){return"string"==typeof e&&e.length>this.MAX_PROPERTY_VALUE_LENGTH?e.slice(0,this.MAX_PROPERTY_VALUE_LENGTH):e},xe.SYSTEM_PROPERTY_KEY_PREFIX="$",xe.MAX_PROPERTIES_COUNT=128,xe.MAX_PROPERTY_KEY_LENGTH=128,xe.MAX_PROPERTY_VALUE_LENGTH=1024,xe);function xe(){}var De=["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"],Le=["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"],Fe=(u.nanosToUnit=function(e,t){switch(t){case"nanoseconds":return e;case"microseconds":return e/(u.C1/u.C0);case"milliseconds":return e/(u.C2/u.C0);case"seconds":return e/(u.C3/u.C0);case"minutes":return e/(u.C4/u.C0);case"hours":return e/(u.C5/u.C0);case"days":return e/(u.C6/u.C0)}},u.microsToUnit=function(e,t){switch(t){case"nanoseconds":return e*(u.C1/u.C0);case"milliseconds":return e/(u.C2/u.C1);case"microseconds":return e;case"seconds":return e/(u.C3/u.C1);case"minutes":return e/(u.C4/u.C1);case"hours":return e/(u.C5/u.C1);case"days":return e/(u.C6/u.C1)}},u.millisToUnit=function(e,t){switch(t){case"nanoseconds":return e*(u.C2/u.C0);case"microseconds":return e*(u.C2/u.C1);case"milliseconds":return e;case"seconds":return e/(u.C3/u.C2);case"minutes":return e/(u.C4/u.C2);case"hours":return e/(u.C5/u.C2);case"days":return e/(u.C6/u.C2)}},u.secondsToUnit=function(e,t){switch(t){case"nanoseconds":return e*(u.C3/u.C0);case"microseconds":return e*(u.C3/u.C1);case"milliseconds":return e*(u.C3/u.C2);case"seconds":return e;case"minutes":return e/(u.C4/u.C3);case"hours":return e/(u.C5/u.C3);case"days":return e/(u.C6/u.C3)}},u.minutesToUnit=function(e,t){switch(t){case"nanoseconds":return e*(u.C4/u.C0);case"microseconds":return e*(u.C4/u.C1);case"milliseconds":return e*(u.C4/u.C2);case"seconds":return e*(u.C4/u.C3);case"minutes":return e;case"hours":return e/(u.C5/u.C4);case"days":return e/(u.C6/u.C4)}},u.hoursToUnit=function(e,t){switch(t){case"nanoseconds":return e*(u.C5/u.C0);case"microseconds":return e*(u.C5/u.C1);case"milliseconds":return e*(u.C5/u.C2);case"seconds":return e*(u.C5/u.C3);case"minutes":return e*(u.C5/u.C4);case"hours":return e;case"days":return e/(u.C6/u.C5)}},u.daysToUnit=function(e,t){switch(t){case"nanoseconds":return e*(u.C6/u.C0);case"microseconds":return e*(u.C6/u.C1);case"milliseconds":return e*(u.C6/u.C2);case"seconds":return e*(u.C6/u.C3);case"minutes":return e*(u.C6/u.C4);case"hours":return e*(u.C6/u.C5);case"days":return e}},u.dayOfWeek=function(e){e=new Date(e).getUTCDay();return Le[(e+6)%7]},u.midnight=function(e){e=new Date(e);return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())},u.C6=24*(u.C5=60*(u.C4=60*(u.C3=1e3*(u.C2=1e3*(u.C1=1e3*(u.C0=1)))))),u.converter={nanoseconds:u.nanosToUnit,microseconds:u.microsToUnit,milliseconds:u.millisToUnit,seconds:u.secondsToUnit,minutes:u.minutesToUnit,hours:u.hoursToUnit,days:u.daysToUnit},u);function u(){}Be.prototype.tick=function(){return 1e3*Date.now()},Be.prototype.currentMillis=function(){return Date.now()},Be.instance=new Be;var Ve=Be;function Be(){}He.prototype.get=function(e,t){return t};var Ke=He;function He(){this.parameters={}}Ge.prototype.get=function(e,t){e=this.parameters[e];return!c.isNullOrUndefined(e)&&(c.isNullOrUndefined(t)||typeof e==typeof t)?e:t};var je=Ge;function Ge(e){this.parameters=e}var ze="X-HACKLE-SDK-KEY",Ye="X-HACKLE-SDK-NAME",Je="X-HACKLE-SDK-VERSION",qe="X-HACKLE-SDK-TIME",We=100,$e=6e4,Xe=500,Ze=3650,Qe="_hackle_hid",et="_hackle_id",tt="hackle-repository-storage",rt="_hackle_session_id",nt="_hackle_last_event_ts",it="_hackle_uid",ot="_hackle_did",st="_hackle_mkt",at="hackle-manual-override_ab",ut="hackle-manual-override_ff",ct="hackle-iam-hide",pt="hackle-iam-impression",lt="hackle-split-url-redirected",ft=1/86400*3,ht="hackle-workspace-config",dt=6e4,yt=1e3,vt="hackle-campaign-delay",gt=s.log;function mt(e,t){e=e.find(function(e){return e===t||e.toLowerCase()===t.toLowerCase()});return e||gt.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e}function Et(e,t){if(!c.isNullOrUndefined(t)){for(var r=new Array,n=0,i=t;n<i.length;n++){var o=mt(e,i[n]);if(c.isNullOrUndefined(o))return;r.push(o)}return r}}bt.of=function(e,t){return new bt(e,t)};var wt=bt;function bt(e,t){this.value=e,this.reason=t}It.of=function(e,t,r,n){return new It(e,t,r=void 0===r?new Ke:r,n=void 0===n?void 0:n)},Object.defineProperty(It.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),It.prototype.get=function(e,t){return this.config.get(e,t)};var At=It;function It(e,t,r,n){this.variation=e,this.reason=t,this.config=r,this.experiment=n}_t.on=function(e,t,r){return new _t(!0,e,t=void 0===t?new Ke:t,r=void 0===r?void 0:r)},_t.off=function(e,t,r){return new _t(!1,e,t=void 0===t?new Ke:t,r=void 0===r?void 0:r)},Object.defineProperty(_t.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),_t.prototype.get=function(e,t){return this.config.get(e,t)};var Tt=_t;function _t(e,t,r,n){this.isOn=e,this.reason=t,this.config=r,this.experiment=n}Pt.prototype.get=function(e,t){return t};var Nt=Pt;function Pt(){}Object.defineProperty(Mt.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),Mt.fromJson=function(e){return new Mt(e.id,new je(f.associateRecord(e.parameters,function(e){return[e.key,e.value]})))},Mt.prototype.get=function(e,t){switch(typeof t){case"string":case"number":case"boolean":return this.config.get(e,t);default:return t}};var Ot=Mt;function Mt(e,t){this.id=e,this.config=t}h.SDK_NOT_READY="SDK_NOT_READY",h.EXCEPTION="EXCEPTION",h.INVALID_INPUT="INVALID_INPUT",h.UNSUPPORTED_PLATFORM="UNSUPPORTED_PLATFORM",h.TYPE_MISMATCH="TYPE_MISMATCH",h.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",h.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",h.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",h.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",h.OVERRIDDEN="OVERRIDDEN",h.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",h.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT="NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT",h.IDENTIFIER_NOT_FOUND="IDENTIFIER_NOT_FOUND",h.VARIATION_DROPPED="VARIATION_DROPPED",h.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",h.TRAFFIC_ALLOCATED_BY_TARGETING="TRAFFIC_ALLOCATED_BY_TARGETING",h.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",h.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",h.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",h.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",h.TARGET_RULE_MATCH="TARGET_RULE_MATCH",h.DEFAULT_RULE="DEFAULT_RULE",h.REMOTE_CONFIG_PARAMETER_NOT_FOUND="REMOTE_CONFIG_PARAMETER_NOT_FOUND",h.IN_APP_MESSAGE_NOT_FOUND="IN_APP_MESSAGE_NOT_FOUND",h.IN_APP_MESSAGE_DRAFT="IN_APP_MESSAGE_DRAFT",h.IN_APP_MESSAGE_PAUSED="IN_APP_MESSAGE_PAUSED",h.IN_APP_MESSAGE_HIDDEN="IN_APP_MESSAGE_HIDDEN",h.IN_APP_MESSAGE_TARGET="IN_APP_MESSAGE_TARGET",h.NOT_IN_IN_APP_MESSAGE_PERIOD="NOT_IN_IN_APP_MESSAGE_PERIOD",h.NOT_IN_IN_APP_MESSAGE_TIMETABLE="NOT_IN_IN_APP_MESSAGE_TIMETABLE",h.NOT_IN_IN_APP_MESSAGE_TARGET="NOT_IN_IN_APP_MESSAGE_TARGET",h.IN_APP_MESSAGE_FREQUENCY_CAPPED="IN_APP_MESSAGE_FREQUENCY_CAPPED",h.EXPERIMENT_CONTROL_GROUP="EXPERIMENT_CONTROL_GROUP";var l=h;function h(){}var St=["DEFAULT","SPLIT_URL","IN_APP_MESSAGE"],Ct=(Rt.fromJson=function(e,t,r){var n=Rt.experimentStatusOrNull(t.execution.status),i=t.variations.map(function(t){return new Ut(t.id,t.key,"DROPPED"===t.status,r.find(function(e){return e.id===t.parameterConfigurationId}))}),o=f.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),s=f.mapNotNullOrUndefined(t.execution.segmentOverrides,function(e){return nr.fromJson(e,Mr.IDENTIFIER)}),a=f.mapNotNullOrUndefined(t.execution.targetAudiences,function(e){return Jt.fromJson(e,Mr.PROPERTY)}),u=ai.fromJson(t.execution.targetUrls),c=mt(St,t.implementationType),p=f.mapNotNullOrUndefined(t.execution.targetRules,function(e){return nr.fromJson(e,Mr.PROPERTY)}),l=tr.fromJson(t.execution.defaultRule);return n&&c&&l&&new Rt(t.id,t.key,e,t.identifierType,n,t.version,t.execution.version,i,o,s,a,u,p,l,t.containerId,c,t.winnerVariationId)},Rt.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void gt.debug("Unsupported status [".concat(e,"]"))}},Rt.prototype._winnerVariationOrNull=function(){if(this.winnerVariationId)return this._getVariationByIdOrNull(this.winnerVariationId)},Rt.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},Rt.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},Rt);function Rt(e,t,r,n,i,o,s,a,u,c,p,l,f,h,d,y,v){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.status=i,this.version=o,this.executionVersion=s,this.variations=a,this.userOverrides=u,this.segmentOverrides=c,this.targetAudiences=p,this.splitUrlTargets=l,this.targetRules=f,this.defaultRule=h,this.containerId=d,this.implementationType=y,this.winnerVariationId=v}Object.defineProperty(kt.prototype,"parameters",{get:function(){var e;return null!=(e=null==(e=this.config)?void 0:e.parameters)?e:{}},enumerable:!1,configurable:!0});var Ut=kt;function kt(e,t,r,n){this.id=e,this.key=t,this.isDropped=r,this.config=n}Dt.fromJson=function(e){return new Dt(e.id,e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new Lt(t,r,e)}))};var xt=Dt;function Dt(e,t,r,n){this.id=e,this.seed=t,this.slotSize=r,this.slots=n}Ft.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive};var Lt=Ft;function Ft(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}Bt.fromJson=function(e){return new Bt(e.id,e.key)};var Vt=Bt;function Bt(e,t){this.id=e,this.key=t}Ht.ID="$id",Ht.USER="$userId",Ht.DEVICE="$deviceId",Ht.SESSION="$sessionId",Ht.HACKLE_DEVICE="$hackleDeviceId";var Kt=Ht;function Ht(){}function jt(e){var t=new Gt;return t.addIdentifiers(e.identifiers||{}),t.add(Kt.ID,e.id),t.add(Kt.DEVICE,e.deviceId),c.isNotNullOrUndefined(e.userId)&&t.add(Kt.USER,e.userId),t.build()}zt.prototype.addIdentifiers=function(e){for(var t in e)this.add(t,e[t]);return this},zt.prototype.add=function(e,t){var r=Ce.sanitizeValue(t);return Ce.isValidType(e)&&r?this.identifiers[e]=t:gt.warn("Invalid user identifier [type=".concat(e,", value=").concat(t,"]")),this},zt.prototype.build=function(){return this.identifiers};var Gt=zt;function zt(){this.identifiers={}}function Yt(e){var t,r={};return r.id=null!=(t=Ce.sanitizeValue(e.id))?t:void 0,r.userId=null!=(t=Ce.sanitizeValue(e.userId))?t:void 0,r.deviceId=null!=(t=Ce.sanitizeValue(e.deviceId))?t:void 0,"object"==typeof e.properties&&(r.properties=ke.sanitize(e.properties)),"object"==typeof e.identifiers&&(r.identifiers=Ce.sanitize(e.identifiers)),t=r,Boolean(t.id||t.userId||t.deviceId||t.identifiers&&0<Object.keys(t.identifiers).length)?r:null}qt.fromJson=function(e,t){return new qt(f.mapNotNullOrUndefined(e.conditions,function(e){return Wt.fromJson(e,t)}))},qt.prototype.toJson=function(){return{conditions:this.conditions.map(function(e){return e.toJson()})}};var Jt=qt;function qt(e){this.conditions=e}$t.fromJson=function(e,t){var r=Xt.fromJson(e.key);if(r&&t.supports(r.type))return(t=Qt.fromJson(e.match))&&new $t(r,t)},$t.prototype.toJson=function(){return{key:this.key.toJson(),match:this.match.toJson()}};var Wt=$t;function $t(e,t){this.key=e,this.match=t}Zt.fromJson=function(e){var t=mt(Pr,e.type);return t&&new Zt(t,e.name)},Zt.prototype.toJson=function(){return{type:this.type,name:this.name}};var Xt=Zt;function Zt(e,t){this.type=e,this.name=t}er.fromJson=function(e){var t=mt(Ir,e.type),r=mt(_r,e.operator),n=mt(Tr,e.valueType);return t&&r&&n&&new er(t,r,n,e.values)},er.prototype.toJson=function(){return{operator:this.operator,type:this.type,valueType:this.valueType,values:this.values}};var Qt=er;function er(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n}rr.fromJson=function(e){var t=mt(Nr,e.type);return t&&new rr(t,e.variationId,e.bucketId)};var tr=rr;function rr(e,t,r){this.type=e,this.variationId=t,this.bucketId=r}ir.fromJson=function(e,t){t=Jt.fromJson(e.target,t),e=tr.fromJson(e.action);return t&&e&&new ir(t,e)};var nr=ir;function ir(e,t){this.target=e,this.action=t}sr.fromJson=function(e){var t=mt(Or,e.type);return t&&new sr(e.id,e.key,t,f.mapNotNullOrUndefined(e.targets,function(e){return Jt.fromJson(e,Mr.SEGMENT)}))};var or=sr;function sr(e,t,r,n){this.id=e,this.key=t,this.type=r,this.targets=n}ur.fromJson=function(e){return new ur(e.id,e.bucketId,e.groups.map(function(e){return cr.fromJson(e)}))},ur.prototype.getGroupOrNull=function(t){return this.groups.find(function(e){return e.id===t})};var ar=ur;function ur(e,t,r){this.id=e,this.bucketId=t,this.groups=r}pr.fromJson=function(e){return new pr(e.id,e.experiments)};var cr=pr;function pr(e,t){this.id=e,this.experiments=t}fr.fromJson=function(e){var t=mt(Tr,e.type),r=f.mapNotNullOrUndefined(e.targetRules,function(e){return hr.fromJson(e,Mr.PROPERTY)}),n=yr.fromJson(e.defaultValue);return t&&new fr(e.id,e.key,t,e.identifierType,r,n)};var lr=fr;function fr(e,t,r,n,i,o){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.targetRules=i,this.defaultValue=o}dr.fromJson=function(e,t){t=Jt.fromJson(e.target,t);return t&&new dr(e.key,e.name,t,e.bucketId,yr.fromJson(e.value))};var hr=dr;function dr(e,t,r,n,i){this.key=e,this.name=t,this.target=r,this.bucketId=n,this.value=i}vr.fromJson=function(e){return new vr(e.id,e.value)};var yr=vr;function vr(e,t){this.id=e,this.rawValue=t}mr.tryParse=function(e){if(e instanceof mr)return e;var t,r,n,i,e=mr.regExp.exec(e);if(e)return e[0],t=e[1],r=e[2],r=void 0===r?"0":r,n=e[3],n=void 0===n?"0":n,i=e[4],e=e[5],new mr(new Er(parseInt(t,10),parseInt(r,10),parseInt(n,10)),br.parse(i),br.parse(e))},mr.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},mr.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},mr.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},mr.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},mr.prototype.isLessThan=function(e){return this.compareTo(e)<0},mr.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},mr.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-]+)*))?$/;var gr=mr;function mr(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}wr.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch};var Er=wr;function wr(e,t,r){this.major=e,this.minor=t,this.patch=r}Ar.parse=function(e){return e?new Ar(e.split(".")):Ar.EMPTY},Ar.prototype.isEmpty=function(){return 0===this.identifiers.length},Ar.prototype.isNotEmpty=function(){return!this.isEmpty()},Ar.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},Ar.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=Ar.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},Ar.compareIdentifiers=function(e,t){return Ar.numericIdentifierRegExp.test(e)&&Ar.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},Ar.EMPTY=new Ar([]),Ar.numericIdentifierRegExp=/^(0|[1-9]\d*)$/;var br=Ar;function Ar(e){this.identifiers=e}var Ir=["MATCH","NOT_MATCH"],Tr=["STRING","NUMBER","BOOLEAN","VERSION","JSON","URL","NULL","UNKNOWN"],_r=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE","EXISTS"],Nr=["VARIATION","BUCKET"],Pr=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT","AB_TEST","FEATURE_FLAG","EVENT_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"],Or=["USER_ID","USER_PROPERTY"],Mr=(Sr.prototype.supports=function(e){return this.supportedKeyTypes.includes(e)},Sr.IDENTIFIER=new Sr("SEGMENT"),Sr.PROPERTY=new Sr("SEGMENT","USER_PROPERTY","HACKLE_PROPERTY","AB_TEST","FEATURE_FLAG","EVENT_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"),Sr.SEGMENT=new Sr("USER_ID","USER_PROPERTY","HACKLE_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"),Sr);function Sr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.supportedKeyTypes=e}var Cr=["ACTIVE","DRAFT","PAUSE"],Rr=["WEB","ANDROID","IOS"],Ur=["IMMEDIATE","CUSTOM"],kr=["HTML","MODAL","BANNER","BOTTOM_SHEET","NONE"],xr=["IMAGE_TEXT","IMAGE_ONLY","TEXT_ONLY","IMAGE","NONE"],Dr=["VERTICAL","HORIZONTAL"],Lr=["CLICK"],Fr=["CLOSE","WEB_LINK","HIDDEN","LINK_AND_CLOSE","LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE"],Vr=["TOP","MIDDLE","BOTTOM"],Br=["LEFT","CENTER","RIGHT"],Kr=["ALL","CUSTOM"],Hr=(jr.fromJson=function(e){var t,r=mt(Cr,e.status);if(!c.isNullOrUndefined(r)){switch(mt(Ur,e.timeUnit)){case"IMMEDIATE":t=new Gr;break;case"CUSTOM":if(c.isNullOrUndefined(e.startEpochTimeMillis))return;if(c.isNullOrUndefined(e.endEpochTimeMillis))return;t=new Yr(e.startEpochTimeMillis,e.endEpochTimeMillis);break;default:return}var n,i,o,s,a=null!=(a=e.timetable&&qr.fromJson(e.timetable))?a:new Xr,u=mn.fromJson(e.messageContext);if(!c.isNullOrUndefined(u))return n=e.eventTriggerRules.map(sn.fromJson),i=un.fromJson(e.eventFrequencyCap),o=null!=(o=e.eventTriggerDelay&&qn.fromJson(e.eventTriggerDelay))?o:qn.immediate(),s=Gn.fromJson(null!=(s=e.evaluateContext)?s:{atDeliverTime:!1}),new jr(e.id,e.key,r,t,a,new on(n,i,o),dn.fromJson(e.targetContext),u,s)}},jr.prototype.supports=function(e){return this.messageContext.platformTypes.includes(e)},jr.prototype.toString=function(){return"InAppMessage(id=".concat(this.id,", key=").concat(this.key,", status=").concat(this.status,")")},jr);function jr(e,t,r,n,i,o,s,a,u){this.id=e,this.key=t,this.status=r,this.period=n,this.timetable=i,this.eventTrigger=o,this.targetContext=s,this.messageContext=a,this.evaluateContext=u}zr.prototype.within=function(e){return!0};var Gr=zr;function zr(){this.type="IMMEDIATE"}Jr.prototype.within=function(e){return this.startMillisInclusive<=e&&e<this.endMillisExclusive};var Yr=Jr;function Jr(e,t){this.startMillisInclusive=e,this.endMillisExclusive=t,this.type="CUSTOM"}Wr.fromJson=function(e){switch(mt(Kr,e.type)){case"ALL":return new Xr;case"CUSTOM":return new en(f.mapNotNullOrUndefined(e.slots,function(e){return rn.fromJson(e)}));default:return}};var qr=Wr;function Wr(){}i(Zr,$r=qr),Zr.prototype.within=function(e){return!0};var $r,Xr=Zr;function Zr(){var e=null!==$r&&$r.apply(this,arguments)||this;return e.type="ALL",e}i(tn,Qr=qr),tn.prototype.within=function(t){return this.slots.some(function(e){return e.within(t)})};var Qr,en=tn;function tn(e){var t=Qr.call(this)||this;return t.slots=e,t.type="CUSTOM",t}nn.prototype.within=function(e){var t=Fe.dayOfWeek(e);if(this.dayOfWeek!==t)return!1;var t=Fe.midnight(e),r=t+this.startMillisInclusive,t=t+this.endMillisExclusive;return r<=e&&e<t},nn.fromJson=function(e){var t=mt(Le,e.dayOfWeek);return t&&new nn(t,e.startMillisInclusive,e.endMillisExclusive)};var rn=nn;function nn(e,t,r){this.dayOfWeek=e,this.startMillisInclusive=t,this.endMillisExclusive=r}var on=function(e,t,r){this.rules=e,this.frequencyCap=t,this.delay=r},sn=(an.fromJson=function(e){return new an(e.eventKey,f.mapNotNullOrUndefined(e.targets,function(e){return Jt.fromJson(e,Mr.PROPERTY)}))},an);function an(e,t){this.eventKey=e,this.targets=t}cn.fromJson=function(e){return e?new cn(e.identifiers.map(pn.fromJson),fn.fromJson(e.duration)):null};var un=cn;function cn(e,t){this.identifierCaps=e,this.durationCap=t}ln.fromJson=function(e){return new ln(e.identifierType,e.countPerIdentifier)};var pn=ln;function ln(e,t){this.identifierType=e,this.count=t}hn.fromJson=function(e){if(!e)return null;var t=mt(De,e.durationUnit.timeUnit);return t?new hn(Fe.converter[t](e.durationUnit.amount,"milliseconds"),e.countPerDuration):null};var fn=hn;function hn(e,t){this.durationMillis=e,this.count=t}yn.fromJson=function(e){return new yn(e.overrides.map(vn.fromJson),f.mapNotNullOrUndefined(e.targets,function(e){return Jt.fromJson(e,Mr.PROPERTY)}))};var dn=yn;function yn(e,t){this.overrides=e,this.targets=t}gn.fromJson=function(e){return new gn(e.identifierType,e.identifiers)};var vn=gn;function gn(e,t){this.identifierType=e,this.identifiers=t}En.fromJson=function(e){var t=null,r=("AB_TEST"===e.exposure.type&&null!==e.exposure.key&&(t=new wn(e.exposure.key)),Et(Rr,e.platformTypes));if(!c.isNullOrUndefined(r)){var n=Et(Dr,e.orientations);if(!c.isNullOrUndefined(n)){var i=f.mapOrUndefined(e.messages,bn.fromJson);if(!c.isNullOrUndefined(i))return new En(e.defaultLang,t,r,n,i)}}};var mn=En;function En(e,t,r,n,i){this.defaultLang=e,this.experimentContext=t,this.platformTypes=r,this.orientations=n,this.messages=i}var wn=function(e){this.key=e},bn=(An.fromJson=function(e){var t=In.fromJson(e.layout);if(!c.isNullOrUndefined(t)){var r=f.mapOrUndefined(e.images,Pn.fromJson);if(!c.isNullOrUndefined(r)){var n=void 0;if(!c.isNotNullOrUndefined(e.imageAutoScroll)||(n=Mn.fromJson(e.imageAutoScroll),!c.isNullOrUndefined(n))){var i=f.mapOrUndefined(e.buttons,Dn.fromJson);if(!c.isNullOrUndefined(i)){var o=void 0;if(!c.isNotNullOrUndefined(e.closeButton)||(o=Dn.fromJson2(e.closeButton),!c.isNullOrUndefined(o))){var s=f.mapOrUndefined(e.outerButtons,Fn.fromJson),a=f.mapOrUndefined(e.innerButtons,Fn.fromJson);if(!c.isNullOrUndefined(s)&&!c.isNullOrUndefined(a))return new An(e.variationKey,e.lang,t,r,n,e.text?Cn.fromJson(e.text):void 0,i,o,new Kn(e.background.color),e.action?Hn.fromJson(e.action):void 0,s,a,e.html?ri.fromDto(e.html):void 0)}}}}}},An.prototype.toJson=function(){var e;return{variationKey:this.variationKey,lang:this.lang,layout:{layoutType:this.layout.layoutType,alignment:null!=(e=null==(e=this.layout.alignment)?void 0:e.toJson())?e:null,displayType:this.layout.displayType},images:this.images.map(function(e){return e.toJson()}),imageAutoScroll:null!=(e=null==(e=this.imageAutoScroll)?void 0:e.toJson())?e:null,text:null!=(e=null==(e=this.text)?void 0:e.toJson())?e:null,closeButton:null!=(e=null==(e=this.closeButton)?void 0:e.toCloseButtonJson())?e:null,buttons:this.buttons.map(function(e){return e.toJson()}),background:{color:this.background.color},action:null!=(e=null==(e=this.action)?void 0:e.toJson())?e:null,outerButtons:this.outerButtons.map(function(e){return e.toJson()}),innerButtons:this.innerButtons.map(function(e){return e.toJson()}),html:null!=(e=null==(e=this.html)?void 0:e.toJson())?e:null}},An);function An(e,t,r,n,i,o,s,a,u,c,p,l,f){this.variationKey=e,this.lang=t,this.layout=r,this.images=n,this.imageAutoScroll=i,this.text=o,this.buttons=s,this.closeButton=a,this.background=u,this.action=c,this.outerButtons=p,this.innerButtons=l,this.html=f}Tn.fromJson=function(e){var t=mt(xr,e.layoutType),r=mt(kr,e.displayType);if(!c.isNullOrUndefined(r)&&!c.isNullOrUndefined(t))return new Tn(r,t,e.alignment?_n.fromJson(e.alignment):void 0)};var In=Tn;function Tn(e,t,r){this.displayType=e,this.layoutType=t,this.alignment=r}Nn.fromJson=function(e){var t=mt(Br,e.horizontal);if(!c.isNullOrUndefined(t)){e=mt(Vr,e.vertical);if(!c.isNullOrUndefined(e))return new Nn(t,e)}},Nn.prototype.toJson=function(){return{horizontal:this.horizontal,vertical:this.vertical}};var _n=Nn;function Nn(e,t){this.horizontal=e,this.vertical=t}On.fromJson=function(e){var t=mt(Dr,e.orientation);if(!c.isNullOrUndefined(t)){var r=void 0;if(!c.isNotNullOrUndefined(e.action)||(r=Hn.fromJson(e.action),!c.isNullOrUndefined(r)))return new On(t,e.imagePath,r)}},On.prototype.toJson=function(){var e;return{orientation:this.orientation,imagePath:this.imagePath,action:null!=(e=null==(e=this.action)?void 0:e.toJson())?e:null}};var Pn=On;function On(e,t,r){this.orientation=e,this.imagePath=t,this.action=r}Sn.fromJson=function(e){var t=mt(De,e.interval.timeUnit);if(t)return new Sn(Fe.converter[t](e.interval.amount,"milliseconds"))},Sn.prototype.toJson=function(){return{interval:{timeUnit:"milliseconds",amount:this.intervalMillis}}};var Mn=Sn;function Sn(e){this.intervalMillis=e}Rn.fromJson=function(e){return new Rn(Un.fromJson(e.title),Un.fromJson(e.body))},Rn.prototype.toJson=function(){return{title:{text:this.title.text,style:{textColor:this.title.style.color}},body:{text:this.body.text,style:{textColor:this.body.style.color}}}};var Cn=Rn;function Rn(e,t){this.title=e,this.body=t}kn.fromJson=function(e){return new kn(e.text,new xn(e.style.textColor))};var Un=kn;function kn(e,t){this.text=e,this.style=t}var xn=function(e){this.color=e},Dn=(Ln.fromJson=function(e){var t=Hn.fromJson(e.action);if(!c.isNullOrUndefined(t))return new Ln(e.text,new Bn(e.style.textColor,e.style.bgColor,e.style.borderColor),t)},Ln.fromJson2=function(e){var t=Hn.fromJson(e.action);if(!c.isNullOrUndefined(t))return new Ln("✕",new Bn(e.style.color,"#FFFFFF","#FFFFFF"),t)},Ln.prototype.toJson=function(){return{text:this.text,action:this.action.toJson(),style:{textColor:this.style.textColor,bgColor:this.style.backgroundColor,borderColor:this.style.borderColor}}},Ln.prototype.toCloseButtonJson=function(){return{action:this.action.toJson(),style:{color:this.style.textColor}}},Ln);function Ln(e,t,r){this.text=e,this.style=t,this.action=r}Vn.fromJson=function(e){var t=Dn.fromJson(e.button);if(!c.isNullOrUndefined(t)){e=_n.fromJson(e.alignment);if(!c.isNullOrUndefined(e))return new Vn(t,e)}},Vn.prototype.toJson=function(){return{button:this.button.toJson(),alignment:this.alignment.toJson()}};var Fn=Vn;function Vn(e,t){this.button=e,this.alignment=t}var Bn=function(e,t,r){this.textColor=e,this.backgroundColor=t,this.borderColor=r},Kn=function(e){this.color=e},Hn=(jn.fromJson=function(e){var t=mt(Lr,e.behavior);if(!c.isNullOrUndefined(t)){var r=mt(Fr,e.type);if(!c.isNullOrUndefined(r))return new jn(t,r,null!=(t=e.value)?t:void 0)}},jn.prototype.toJson=function(){var e;return{behavior:this.behavior,type:this.type,value:null!=(e=this.value)?e:null}},jn);function jn(e,t,r){this.behavior=e,this.type=t,this.value=r}zn.fromJson=function(e){return new zn(e.atDeliverTime)};var Gn=zn;function zn(e){this.atDeliverTime=e}Jn.fromJson=function(e){var t=mt(De,e.duration.timeUnit);return c.isNullOrUndefined(t)?null:new Jn(Fe.converter[t](e.duration.amount,"milliseconds"))};var Yn=Jn;function Jn(e){this.durationMillis=e}Wn.fromJson=function(e){var t=e.afterCondition&&Yn.fromJson(e.afterCondition);return new Wn(e.type,t)},Wn.immediate=function(){return new Wn("IMMEDIATE",null)},Wn.prototype.deliverAt=function(e){var t=this.type;switch(t){case"IMMEDIATE":return e;case"AFTER":if(null===this.afterCondition)throw new Error("AfterCondition is required for AFTER delay type");return e+this.afterCondition.durationMillis;default:throw new Error("Unsupported delay type: ".concat(t))}};var qn=Wn;function Wn(e,t){this.type=e,this.afterCondition=t}Xn.fromJson=function(e){var t=e.type,e=e.value,r=this.linkActionTypes.some(function(e){return e===t}),n=this.closeActionTypes.some(function(e){return e===t}),i=this.tabTargetActionsTypes.some(function(e){return e===t}),o=this.windowTargetActionsTypes.some(function(e){return e===t});return new Xn(r?"LINK":"CLOSE",n?{hideDurationMillis:"HIDDEN"===t?864e5:null}:void 0,r?{url:null!=e?e:"",target:o?"NEW_WINDOW":i?"NEW_TAB":"CURRENT",shouldCloseAfterLink:n}:void 0)},Xn.fromInteraction=function(e){return"CLOSE"===e.type?new Xn(e.type,{hideDurationMillis:null}):Xn.fromJson(e.action)},Xn.fromAction=function(e){return Xn.fromJson(e.toJson())},Xn.linkActionTypes=["LINK_AND_CLOSE","LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE","WEB_LINK"],Xn.closeActionTypes=["CLOSE","HIDDEN","LINK_AND_CLOSE","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW_AND_CLOSE"],Xn.tabTargetActionsTypes=["LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE"],Xn.windowTargetActionsTypes=["LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE"];var $n=Xn;function Xn(e,t,r){this.type=e,this.close=t,this.link=r}Qn.prototype.toJson=function(){return{resourceType:"TEXT",text:this.text,path:null}};var Zn=Qn;function Qn(e){this.text=e,this.resourceType="TEXT",this.path=null}ti.prototype.toJson=function(){return{resourceType:"PATH",text:null,path:this.path}};var ei=ti;function ti(e){this.path=e,this.resourceType="PATH",this.text=null}ni.fromDto=function(e){if("TEXT"===e.resourceType){if(null==e.text)throw new Error("InAppMessageHtmlDto: text is required when resourceType is TEXT");return new Zn(e.text)}if(null==e.path)throw new Error("InAppMessageHtmlDto: path is required when resourceType is PATH");return new ei(e.path)};var ri=ni;function ni(){}var ii=function(e){this.id=e},oi=(n.SplitUrlRedirectType=void 0,(n.SplitUrlRedirectType||(n.SplitUrlRedirectType={})).MANUAL="MANUAL",si.fromDto=function(e){var t,r=e.needRedirect;return t=e.properties.type,new si(r,Object.values(n.SplitUrlRedirectType).includes(t)?e.properties.type:null,e.properties.value)},si);function si(e,t,r){this.needRedirect=e,this.redirectType=t,this.redirectUrl=r}ui.fromJson=function(e){if(null!==e)return new ui(f.mapNotNullOrUndefined(e.match,function(e){return Jt.fromJson(e,Mr.PROPERTY)}),f.mapNotNullOrUndefined(e.notMatch,function(e){return Jt.fromJson(e,Mr.PROPERTY)}))};var ai=ui;function ui(e,t){this.includeTargets=e,this.excludeTargets=t}pi.fromJson=function(e){return new pi(e.eventKey,e.property,e.stats)},pi.prototype.countWithinDays=function(t){return f.sum(this.stats.filter(function(e){return e.date>=t}),function(e){return e.count})};var ci=pi;function pi(e,t,r){this.eventKey=e,this.property=t,this.stats=r}fi.prototype.tags=function(e){var r=this;return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r._tags[t]=e}),this},fi.prototype.tag=function(e,t){return this._tags[e]=t,this},fi.prototype.register=function(e){return e.registerTimer({name:this.name,tags:this._tags,type:"TIMER"})};var li=fi;function fi(e){this.name=e,this._tags={},this.name=e}di.start=function(e){return new di(e=void 0===e?di.defaultClock:e)},di.prototype.stop=function(e){var t=this._clock.tick()-this.startTime;e.record(t,"microseconds")},di.defaultClock=new Ve;var hi=di;function di(e){this._clock=e,this.startTime=this._clock.tick()}vi.prototype.tags=function(e){var r=this;return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r._tags[t]=e}),this},vi.prototype.tag=function(e,t){return this._tags[e]=t,this},vi.prototype.register=function(e){return e.registerCounter({name:this.name,tags:this._tags,type:"COUNTER"})};var yi=vi;function vi(e){this.name=e,this._tags={}}mi.prototype.values=function(){return Array.from(this.data.values())},mi.prototype.keys=function(){return Array.from(this.data.keys())},mi.prototype.get=function(t){var r=this,e=this.keys().find(function(e){return r.compareFn(e,t)});return e?this.data.get(e):void 0},mi.prototype.has=function(e){return void 0!==this.get(e)},mi.prototype.add=function(e,t){t=(t=t)||e;return this.data.set(e,t),this},mi.prototype.delete=function(e){var t;if(this.has(e))return t=this.get(e),this.data.delete(e),t},mi.prototype.forEach=function(e){this.data.forEach(e)},mi.prototype.filter=function(e){for(var t=new mi(this.compareFn),r=0,n=this.entries();r<n.length;r++){var i=n[r];e(i[0],i[1])&&t.add(i[0],i[1])}return t},mi.prototype.entries=function(){return Array.from(this.data.entries())};var gi=mi;function mi(e){this.compareFn=e,this.data=new Map,this.compareFn=e,this.data=new Map}Object.defineProperty(wi.prototype,"value",{get:function(){return this.valueSupplier()},enumerable:!1,configurable:!0});var Ei=wi;function wi(e,t){this.valueSupplier=t,this.field=e}function bi(e,t){return e.name===t.name&&Ce.isEquals(e.tags,t.tags)}Object.defineProperty(Ai.prototype,"metrics",{get:function(){return Array.from(this._metrics.values())},enumerable:!1,configurable:!0}),Ai.prototype.registerCounter=function(e){return this.registerMetricIfNecessary(e,this.createCounter.bind(this))},Ai.prototype.registerTimer=function(e){return this.registerMetricIfNecessary(e,this.createTimer.bind(this))},Ai.prototype.counter=function(e,t){return void 0===t&&(t={}),new yi(e).tags(t).register(this)},Ai.prototype.timer=function(e,t){return void 0===t&&(t={}),new li(e).tags(t).register(this)},Ai.prototype.registerMetricIfNecessary=function(e,t){return this.getOrCreateMetric(e,t)},Ai.prototype.getOrCreateMetric=function(e,t){var r,n=this._metrics.get(e);return n?r=n:(r=t(e),this._metrics.add(e,r)),r},Ai.prototype.close=function(){};j=Ai;function Ai(){this.id=H(),this.name="MetricRegistry",this._metrics=new gi(bi)}i(Ti,Ii=j),Ti.prototype.start=function(){var e=this;null===this.publishingJob&&(this.publishingJob=this.scheduler.schedulePeriodically(this.pushIntervalMillis,this.pushIntervalMillis,function(){return e.publish(!1)}),s.log.debug("PushMetricRegistry started. Publish metrics every ".concat(this.pushIntervalMillis,"ms.")))},Ti.prototype.stop=function(){var e;null!=(e=this.publishingJob)&&e.cancel(),this.publishingJob=null,this.publish(!0),s.log.debug("PushMetricRegistry stopped.")},Ti.prototype.close=function(){this.stop()};var Ii,G=Ti;function Ti(e,t){var r=Ii.call(this)||this;return r.scheduler=e,r.pushIntervalMillis=t,r.publishingJob=null,r}Ni.prototype.count=function(){return this.counterValue},Ni.prototype.increment=function(e){this.counterValue+=null!=e?e:1},Ni.prototype.measure=function(){return[new Ei("count",this.count.bind(this))]};var _i=Ni;function Ni(e){this.counterValue=0,this.id=e}Oi.prototype.flush=function(){var e=this.currentCounter;return this.currentCounter=new _i(this.id),e},Oi.prototype.count=function(){return this.currentCounter.count()},Oi.prototype.increment=function(e){this.currentCounter.increment(e)},Oi.prototype.measure=function(){return[new Ei("count",this.count.bind(this))]};var Pi=Oi;function Oi(e){this.id=e,this.currentCounter=new _i(e)}Si.prototype.count=function(){return this._count},Si.prototype.totalTime=function(e){return Fe.nanosToUnit(this._total,e)},Si.prototype.max=function(e){return Fe.nanosToUnit(this._max,e)},Si.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},Si.prototype.record=function(e,t){e<0||(t=Fe.converter[t](e,"nanoseconds"),this._count=this.count()+1,this._total+=t,this._max=Math.max(t,this._max))},Si.prototype.measure=function(){var e=this;return[new Ei("count",this.count.bind(this)),new Ei("total",function(){return e.totalTime("milliseconds")}),new Ei("max",function(){return e.max("milliseconds")}),new Ei("mean",function(){return e.mean("milliseconds")})]};var Mi=Si;function Si(e){this._count=0,this._total=0,this._max=0,this.id=e}Ri.prototype.flush=function(){var e=this.currentTimer;return this.currentTimer=new Mi(this.id),e},Ri.prototype.count=function(){return this.currentTimer.count()},Ri.prototype.totalTime=function(e){return this.currentTimer.totalTime(e)},Ri.prototype.max=function(e){return this.currentTimer.max(e)},Ri.prototype.record=function(e,t){this.currentTimer.record(e,t)},Ri.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},Ri.prototype.measure=function(){var e=this;return[new Ei("count",this.count.bind(this)),new Ei("total",function(){return e.totalTime("milliseconds")}),new Ei("max",function(){return e.max("milliseconds")}),new Ei("mean",function(){return e.mean("milliseconds")})]};var Ci=Ri;function Ri(e){this.id=e,this.currentTimer=new Mi(e)}i(ki,Ui=G),ki.prototype.createCounter=function(e){return new Pi(e)},ki.prototype.createTimer=function(e){return new Ci(e)},ki.prototype.publish=function(e){void 0===e&&(e=!1);var t=this.metrics.reduce(function(e,t){return void 0===(r=t).flush||"function"!=typeof r.flush?e:e.concat(t.flush());var r},[]);this.flushMetrics(t,e)};var Ui,e=ki;function ki(e,t){return Ui.call(this,e,t)||this}Di.prototype.count=function(){return 0},Di.prototype.increment=function(e){},Di.prototype.measure=function(){return[new Ei("count",this.count.bind(this))]};var xi=Di;function Di(e){this.id=e}Object.defineProperty(Fi.prototype,"counters",{get:function(){return Array.from(this._counters.values())},enumerable:!1,configurable:!0}),Fi.prototype.add=function(e){this._counters.add(e,e.registerCounter(this.id))},Fi.prototype.count=function(){return(this.counters[0]||this.noopCounter).count()},Fi.prototype.increment=function(t){this.counters.forEach(function(e){e.increment(t)})},Fi.prototype.measure=function(){return[new Ei("count",this.count.bind(this))]};var Li=Fi;function Fi(e){this._counters=new gi(function(e,t){return e.id===t.id}),this.id=e,this.noopCounter=new xi(e)}Bi.prototype.measure=function(){var e=this;return[new Ei("count",this.count.bind(this)),new Ei("total",function(){return e.totalTime("milliseconds")}),new Ei("max",function(){return e.max("milliseconds")}),new Ei("mean",function(){return e.mean("milliseconds")})]},Bi.prototype.count=function(){return 0},Bi.prototype.totalTime=function(e){return 0},Bi.prototype.max=function(e){return 0},Bi.prototype.mean=function(e){return 0},Bi.prototype.record=function(e,t){};var Vi=Bi;function Bi(e){this.id=e}Object.defineProperty(Hi.prototype,"firstTimer",{get:function(){return this.timers[0]||this.noopTimer},enumerable:!1,configurable:!0}),Hi.prototype.totalTime=function(e){return this.firstTimer.totalTime(e)},Hi.prototype.max=function(e){return this.firstTimer.max(e)},Hi.prototype.mean=function(e){return this.firstTimer.mean(e)},Hi.prototype.record=function(t,r){this.timers.forEach(function(e){e.record(t,r)})},Object.defineProperty(Hi.prototype,"timers",{get:function(){return Array.from(this._timers.values())},enumerable:!1,configurable:!0}),Hi.prototype.add=function(e){this._timers.add(e,e.registerTimer(this.id))},Hi.prototype.count=function(){return this.firstTimer.count()},Hi.prototype.measure=function(){var e=this;return[new Ei("count",this.count.bind(this)),new Ei("total",function(){return e.totalTime("milliseconds")}),new Ei("max",function(){return e.max("milliseconds")}),new Ei("mean",function(){return e.mean("milliseconds")})]};var Ki=Hi;function Hi(e){this._timers=new gi(function(e,t){return e.id===t.id}),this.id=e,this.noopTimer=new Vi(e)}i(Gi,ji=j),Gi.prototype.createCounter=function(e){e=new Li(e);return this.addRegistry(e),e},Gi.prototype.createTimer=function(e){e=new Ki(e);return this.addRegistry(e),e},Gi.prototype.addRegistry=function(t){this.registries.forEach(function(e){return t.add(e)})},Gi.prototype.add=function(r){r instanceof Gi||this.registries.has(r)||(this.registries.add(r),this.metrics.forEach(function(e){var t;void 0!==(t=e).add&&"function"==typeof t.add&&e.add(r)}))},Gi.prototype.close=function(){this.registries.forEach(function(e){e.close()})};var ji,r=Gi;function Gi(){var e=null!==ji&&ji.apply(this,arguments)||this;return e.registries=new gi(function(e,t){return e.id===t.id}),e}Yi.counter=function(e,t){return Yi.globalRegistry.counter(e,t)},Yi.timer=function(e,t){return Yi.globalRegistry.timer(e,t)},Yi.addRegistry=function(e){Yi.globalRegistry.add(e),s.log.debug("MetricRegistry added ".concat(e.name))},Yi.globalRegistry=new r;var zi=Yi;function Yi(){}qi.equalsIgnoreCase=function(e,t){return e.toLowerCase()===t.toLowerCase()},qi.isNotEmptyString=function(e){return!c.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length)};var Ji=qi;function qi(){}$i.builder=function(){return new Xi},$i.get=function(e){return $i.builder().url(e).build()},$i.prototype.toBuilder=function(){return new Xi(this)};var Wi=$i;function $i(e,t,r,n,i){this.url=e,this.method=t,this.body=r,this.headers=n,this.options=i}Zi.prototype.url=function(e){return this._url=e,this},Zi.prototype.method=function(e){return this._method=e,this},Zi.prototype.body=function(e){return this._body=e,this},Zi.prototype.addHeader=function(e,t){return this._headers.add(e,t),this},Zi.prototype.timeoutMillis=function(e){return this._timeoutMillis=e,this},Zi.prototype.build=function(){if(null===this._url)throw new Error("url is null");var e={timeoutMillis:this._timeoutMillis};return new Wi(this._url,this._method,this._body,this._headers.build(),e)};var Xi=Zi;function Zi(e){var t;this._url=null!=(t=null==e?void 0:e.url)?t:null,this._method=null!=(t=null==e?void 0:e.method)?t:"GET",this._body=null!=(t=null==e?void 0:e.body)?t:null,this._headers=null!=(t=null==(t=null==e?void 0:e.headers)?void 0:t.toBuilder())?t:to.builder(),this._timeoutMillis=null!=(e=null==(t=null==e?void 0:e.options)?void 0:t.timeoutMillis)?e:null}eo.ok=function(e,t){return eo.of(200,e,t)},eo.of=function(e,t,r){return new eo(e,null!=t?t:null,null!=r?r:to.empty())},eo.prototype.isSuccessful=function(){return 200<=this.statusCode&&this.statusCode<300},eo.prototype.isClientError=function(){return 400<=this.statusCode&&this.statusCode<500},eo.prototype.isNotModified=function(){return 304===this.statusCode};var Qi=eo;function eo(e,t,r){this.statusCode=e,this.body=t,this.headers=r}ro.empty=function(){return new ro(new Map)},ro.builder=function(){return new no(new Map)},ro.prototype.get=function(e){for(var t=0,r=Array.from(this.headers.entries());t<r.length;t++){var n=r[t],i=n[0],n=n[1];if(Ji.equalsIgnoreCase(i,e))return n}return null},ro.prototype.getOrDefault=function(e,t){return null!=(e=this.get(e))?e:t},ro.prototype.raw=function(){return Array.from(this.headers.entries()).reduce(function(e,t){var r=t[0],t=t[1];return e[r]=t,e},{})},ro.prototype.toBuilder=function(){return new no(this.headers)},ro.IF_MODIFIED_SINCE="If-Modified-Since",ro.LAST_MODIFIED="Last-Modified",ro.ACCEPT_ENCODING="Accept-Encoding";var to=ro;function ro(e){this.headers=e}io.prototype.add=function(e,t){return this.headers.set(e,t),this},io.prototype.build=function(){return new to(this.headers)};var no=io;function io(e){this.headers=e}i(ao,oo=e),ao.prototype.flushMetrics=function(e,t){var r=this;f.chunked(e.filter(this.isDispatchTarget.bind(this)),We).forEach(function(e){r.dispatch(e,t)})},ao.prototype.isDispatchTarget=function(e){return("COUNTER"===e.id.type||"TIMER"===e.id.type)&&0<e.count()},ao.prototype.dispatch=function(e,t){e=this.createRequest(e);this.execute(e,t).catch(function(e){return s.log.debug("Failed to flushing metrics: ".concat(e))})},ao.prototype.createRequest=function(e){return Wi.builder().url(this.url).method("POST").body(JSON.stringify(this.batch(e))).addHeader("Content-Type","application/json").build()},ao.prototype.execute=function(e,t){return(t?this.synchronousTransport:this.transport).send(e)},ao.prototype.batch=function(e){return{metrics:e.map(function(e){return{name:e.id.name,type:e.id.type,tags:e.id.tags,measurements:c.fromMap(f.associate(e.measure(),function(e){return[e.field,e.value]}))}})}},ao.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.publish(!0);case"visible":case"pageshow":case"blur":case"locationChange":case"focus":return}};var oo,so=ao;function ao(e,t,r,n,i){n=oo.call(this,n,i)||this;return n.url=e,n.transport=t,n.synchronousTransport=r,n.start(),n}co.experiment=function(e,t,r){t=zi.timer("experiment.decision",{key:String(t),variation:r.variation,reason:String(r.reason)});e.stop(t)},co.featureFlag=function(e,t,r){t=zi.timer("feature.flag.decision",{key:String(t),on:String(r.isOn),reason:String(r.reason)});e.stop(t)},co.remoteConfig=function(e,t,r){t=zi.timer("remote.config.decision",{key:String(t),reason:String(r.reason)});e.stop(t)};var uo=co;function co(){}lo.record=function(e,t,r){e=zi.timer("api.call",{operation:e,success:lo.success(r)});t.stop(e)},lo.success=function(e){return null===e?"false":String(e.isSuccessful()||e.isNotModified())};var po=lo;function lo(){}ho.decide=function(e,t,r,n){if(c.isNullOrUndefined(r))return this.decision(e,t,"NULL",r,n);switch(typeof r){case"string":return this.decision(e,t,"STRING",r,n);case"number":return this.decision(e,t,"NUMBER",r,n);case"boolean":return this.decision(e,t,"BOOLEAN",r,n);default:return this.decision(e,t,"UNKNOWN",r,n)}},ho.decision=function(e,t,r,n,i){return c.isNullOrUndefined(t)?wt.of(n,l.INVALID_INPUT):e.remoteConfig(t,i,r,n)};var fo=ho;function ho(){}var yo=s.log,vo=(go.prototype.get=function(t,r){var n,e=hi.start();try{n=this.decide(t,r)}catch(e){yo.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),n=wt.of(r,l.EXCEPTION)}return uo.remoteConfig(e,t,n),n.value},go.prototype.decide=function(e,t){var r=this.userManager.resolve(this.user);return fo.decide(this.core,e,t,r)},go);function go(e,t,r){this.core=e,this.userManager=t,this.user=r}wo.prototype.contains=function(e){return this._properties.has(e)},wo.prototype.remove=function(e){var r=this;return e instanceof Map&&e.forEach(function(e,t){r.remove(t)}),"string"==typeof e&&this._properties.delete(e),this},wo.prototype.compute=function(e,t){var r=this._properties.get(e),t=t(r);null!==t?this.add(e,t):null===r&&!this.contains(e)||this.remove(e)},wo.prototype.add=function(e,t,r){if((r=void 0===r?!1:r)&&this.contains(e))return this;if(this._properties.size>=this.MAX_PROPERTIES_COUNT)return this;if("string"==typeof e&&e.length>this.MAX_PROPERTY_KEY_LENGTH)return this;r=ke.sanitizeValue(e,t);return c.isNullOrUndefined(r)||this._properties.set(e,r),this},wo.prototype.addProperties=function(e,r){var n=this;return void 0===r&&(r=!1),e.forEach(function(e,t){n.add(t,e,r)}),this},wo.prototype.build=function(){return this._properties};var mo,Eo=wo;function wo(){this._properties=new Map,this.MAX_PROPERTIES_COUNT=128,this.MAX_PROPERTY_KEY_LENGTH=128}(ee=mo=mo||{}).SET="$set",ee.SET_ONCE="$setOnce",ee.UNSET="$unset",ee.INCREMENT="$increment",ee.APPEND="$append",ee.APPEND_ONCE="$appendOnce",ee.PREPEND="$prepend",ee.PREPEND_ONCE="$prependOnce",ee.REMOVE="$remove",ee.CLEAR_ALL="$clearAll";Ao.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new Eo).addProperties(e).addProperties(t).build()};var bo=Ao;function Ao(){}To.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new Eo).addProperties(e).addProperties(t,!0).build()};var Io=To;function To(){}No.prototype.operate=function(e,t){return 0===e.size?new Map:0===t.size?e:(new Eo).addProperties(e).remove(t).build()};var _o=No;function No(){}Oo.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new Eo;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.increment(e,t)})}),n.build()},Oo.prototype.increment=function(e,t){return"number"!=typeof t?e:"number"!=typeof e?null==e?t:e:e+t};var Po=Oo;function Oo(){}Mo.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new Eo;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.compute(e,t)})}),n.build()},Mo.prototype.compute=function(e,t){e=this.toArray(e),t=this.toArray(t);return this.operateArray(e,t)},Mo.prototype.toArray=function(e){return null==e?[]:Array.isArray(e)?e:[e]},Mo.prototype.contains=function(e,t){return e.includes(t)},Mo.prototype.prepend=function(e,t,r){return(r=void 0===r?!1:r)&&this.contains(t,e)?t:Me([e],t,!0)},Mo.prototype.append=function(e,t,r){return(r=void 0===r?!1:r)&&this.contains(e,t)?e:Me(Me([],e,!0),[t],!1)};t=Mo;function Mo(){}i(Ro,So=t),Ro.prototype.operateArray=function(e,t){var r=this;return t.reduce(function(e,t){return r.append.bind(r)(e,t)},e)};var So,Co=Ro;function Ro(){return null!==So&&So.apply(this,arguments)||this}i(xo,Uo=t),xo.prototype.operateArray=function(e,t){return t.reduce(this.appendOnce.bind(this),e)},xo.prototype.appendOnce=function(e,t){return this.append(e,t,!0)};var Uo,ko=xo;function xo(){return null!==Uo&&Uo.apply(this,arguments)||this}i(Fo,Do=t),Fo.prototype.operateArray=function(e,t){var r=this;return t.reduceRight(function(e,t){return r.prepend.bind(r)(t,e)},e)};var Do,Lo=Fo;function Fo(){return null!==Do&&Do.apply(this,arguments)||this}i(Ko,Vo=t),Ko.prototype.operateArray=function(e,t){var r=this;return t.reduce(this.appendOnce.bind(this),[]).reduceRight(function(e,t){return r.prependOnce.bind(r)(t,e)},e)},Ko.prototype.appendOnce=function(e,t){return this.append(e,t,!0)},Ko.prototype.prependOnce=function(e,t){return this.prepend(e,t,!0)};var Vo,Bo=Ko;function Ko(){return null!==Vo&&Vo.apply(this,arguments)||this}i(Go,Ho=t),Go.prototype.operateArray=function(e,t){return t.reduce(this.remove.bind(this),e)},Go.prototype.remove=function(e,t){return e.filter(function(e){return e!==t})};var Ho,jo=Go;function Go(){return null!==Ho&&Ho.apply(this,arguments)||this}Yo.prototype.operate=function(e,t){return new Map};var zo=Yo;function Yo(){}qo.get=function(e){switch(e){case mo.SET:return new bo;case mo.SET_ONCE:return new Io;case mo.UNSET:return new _o;case mo.INCREMENT:return new Po;case mo.APPEND:return new Co;case mo.APPEND_ONCE:return new ko;case mo.PREPEND:return new Lo;case mo.PREPEND_ONCE:return new Bo;case mo.CLEAR_ALL:return new zo;case mo.REMOVE:return new jo}};var Jo=qo;function qo(){}$o.prototype.set=function(e,t){return this.add(mo.SET,e,t)},$o.prototype.setOnce=function(e,t){return this.add(mo.SET_ONCE,e,t)},$o.prototype.unset=function(e){return this.add(mo.UNSET,e,"-")},$o.prototype.increment=function(e,t){return this.add(mo.INCREMENT,e,t)},$o.prototype.append=function(e,t){return this.add(mo.APPEND,e,t)},$o.prototype.appendOnce=function(e,t){return this.add(mo.APPEND_ONCE,e,t)},$o.prototype.prepend=function(e,t){return this.add(mo.PREPEND,e,t)},$o.prototype.prependOnce=function(e,t){return this.add(mo.PREPEND_ONCE,e,t)},$o.prototype.remove=function(e,t){return this.add(mo.REMOVE,e,t)},$o.prototype.clearAll=function(){return this.add(mo.CLEAR_ALL,"clearAll","-")},$o.prototype.build=function(){var e=Array.from(this.operations.entries()).map(function(e){return[e[0],e[1].build()]});return new Xo(new Map(e))},$o.prototype.containsKey=function(t){return Array.from(this.operations.entries()).some(function(e){return e[0],e[1].contains(t)})},$o.prototype.add=function(e,t,r){if(this.containsKey(t))return this;this.operations.has(e)||this.operations.set(e,new Eo);e=this.operations.get(e);return null!=e&&e.add(t,r),this};var Wo=$o;function $o(){this.operations=new Map}Zo.prototype.operate=function(e){var r=e;return this.operations.forEach(function(e,t){r=Jo.get(t).operate(r,e)}),r},Zo.prototype.toEvent=function(){var i={key:"$properties"};return this.operations.forEach(function(e,t){var r,n;i.properties=p(p({},i.properties),((r={})[t]=p(p({},null==(n=i.properties)?void 0:n[t]),ke.sanitize(c.fromMap(e))),r))}),i},Zo.prototype.toSecuredEvent=function(){var i={key:"$secured_properties"};return this.operations.forEach(function(e,t){var r,n;i.properties=p(p({},i.properties),((r={})[t]=p(p({},null==(n=i.properties)?void 0:n[t]),ke.sanitize(c.fromMap(e))),r))}),i},Zo.prototype.toRecord=function(){var n={};return this.operations.forEach(function(e,t){var r={};e.forEach(function(e,t){r[t]=e}),n[t]=r}),n};var Xo=Zo;function Zo(e){this.operations=null!=e?e:new Map}es.timeout=function(r,n){return new Promise(function(e,t){setTimeout(function(){return t(new Error("timeout (".concat(n,"ms)")))},n),r.then(e,t)})};var Qo=es;function es(){}rs.prototype.isEquals=function(e){return this.url===e.url},rs.createWithCurrentPage=function(e,t){return"undefined"==typeof window||"undefined"==typeof document?new rs:new rs(window.location.pathname,window.location.host,window.location.hostname,window.location.href,window.document.referrer,window.location.search,window.location.protocol,null!=e?e:window.document.title,null!=t?t:{})};var ts=rs;function rs(e,t,r,n,i,o,s,a,u){void 0===t&&(t=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=""),void 0===o&&(o=""),void 0===s&&(s=""),void 0===a&&(a=""),void 0===u&&(u={}),this.pagePath=e=void 0===e?"":e,this.host=t,this.hostname=r,this.url=n,this.referrer=i,this.queryParameter=o,this.protocol=s,this.pageName=a,this.properties=u}is.create=function(e){return new is(e)},is.prototype.getValue=function(){return this.value};var ns=is;function is(e){this.value=e}ss.toPublic=function(e){return{key:e.key}};var os=ss;function ss(){}us.toPublic=function(e){return{close:e.close.bind(e),inAppMessage:os.toPublic(e.context.inAppMessage)}};var as=us;function us(){}var cs=s.log,ps=(d.prototype.initialize=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),cs.debug("HackleClient initializing"),[4,this.synchronizer.sync()];case 1:return e.sent(),cs.debug("HackleClient initialized"),[3,4];case 2:throw t=e.sent(),cs.error("HackleClient initialize failed: ".concat(t)),t;case 3:return this.initialized=!0,[7];case 4:return[2]}})})},d.prototype.getSessionId=function(){return this.sessionManager.sessionId},d.prototype.getUser=function(){return this.userManager.currentUser},d.prototype.setUser=function(e){try{var t=Yt(e);if(!t)return cs.warn("invalid user"),Promise.resolve();var r=this.userManager.setUser(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return cs.error("Unexpected exception while set user: ".concat(e)),Promise.resolve()}},d.prototype.setUserId=function(e){try{var t=void 0;if(c.isNullOrUndefined(e))t=this.userManager.setUserId(void 0);else{var r=Ce.sanitizeValue(e);if(!r)return cs.warn("Invalid userId. [userId=".concat(e,"]")),Promise.resolve();t=this.userManager.setUserId(r)}return this.userManager.syncIfNeeded(t).catch(function(){})}catch(e){return cs.error("Unexpected exception while set userId: ".concat(e)),Promise.resolve()}},d.prototype.setDeviceId=function(e){try{var t=Ce.sanitizeValue(e);if(!t)return cs.warn("Invalid deviceId. [deviceId=".concat(e,"]")),Promise.resolve();var r=this.userManager.setDeviceId(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return cs.error("Unexpected exception while set deviceId: ".concat(e)),Promise.resolve()}},d.prototype.setUserProperty=function(e,t){e=(new Wo).set(e,t).build();return this.updateUserProperties(e)},d.prototype.setUserProperties=function(e){try{var t=ke.sanitize(e),r=new Wo;return Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){return cs.error("Unexpected exception while set userProperties: ".concat(e)),Promise.resolve()}},d.prototype.updateUserProperties=function(e){try{var t=e.toEvent();return this.track(t),this.userManager.updateUserProperties(e),this.core.flush(!1),Promise.resolve()}catch(e){return cs.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},d.prototype.updatePushSubscriptions=function(e){try{var t=e.toEvent("$push_subscriptions");return this.track(t),this.core.flush(!1),Promise.resolve()}catch(e){return cs.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},d.prototype.updateSmsSubscriptions=function(e){try{var t=e.toEvent("$sms_subscriptions");return this.track(t),this.core.flush(!1),Promise.resolve()}catch(e){return cs.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},d.prototype.updateKakaoSubscriptions=function(e){try{var t=e.toEvent("$kakao_subscriptions");return this.track(t),this.core.flush(!1),Promise.resolve()}catch(e){return cs.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},d.prototype.resetUser=function(){try{var e=this.userManager.resetUser(),t=(new Wo).clearAll().build();return this.track(t.toEvent()),this.userManager.syncIfNeeded(e).catch(function(){})}catch(e){return cs.error("Unexpected exception while reset user: ".concat(e)),Promise.resolve()}},d.prototype.setPhoneNumber=function(e){try{if("string"!=typeof e)return cs.error("Invalid value ".concat(e,": phoneNumber value type must be string.")),Promise.resolve();var t=ns.create(e),r=Ve.instance.currentMillis();return this.piiEventManager.setPhoneNumber(t,r),this.core.flush(!1),Promise.resolve()}catch(e){return cs.error("Unexpected exception occurred while setting phone number: ".concat(e)),Promise.resolve()}},d.prototype.unsetPhoneNumber=function(){try{var e=Ve.instance.currentMillis();return this.piiEventManager.unsetPhoneNumber(e),this.core.flush(!1),Promise.resolve()}catch(e){return cs.error("Unexpected exception occurred while unsetting phone number: ".concat(e)),Promise.resolve()}},d.prototype.variation=function(e,t,r){return this.variationDetail(e,t,r).variation},d.prototype.variationDetail=function(r,n,e){var i=e||"A",e=hi.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.experiment(r,t,i)}catch(e){return cs.error("Unexpected exception while deciding variation for experiment[".concat(r,"]. Returning default variation[").concat(i,"] : ").concat(e)),At.of(i,l.EXCEPTION)}}(this);return uo.experiment(e,r,t),t},d.prototype.isFeatureOn=function(e,t){return this.featureFlagDetail(e,t).isOn},d.prototype.featureFlagDetail=function(r,n){var e=hi.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.featureFlag(r,t)}catch(e){return cs.error("Unexpected exception while deciding feature flag[".concat(r,"]. Returning default value[false] : ").concat(e)),Tt.off(l.EXCEPTION)}}(this);return uo.featureFlag(e,r,t),t},d.prototype.track=function(e,t){try{cs.debug("track event : ".concat(JSON.stringify(e)));var r=this._convertEvent(e),n=this.userManager.resolve(t);this.core.track(r,n)}catch(e){cs.error("Unexpected exception while tracking event: ".concat(e))}},d.prototype.trackPageView=function(e){cs.warn("trackPageView is deprecated and do nothing.")},d.prototype.setCurrentPage=function(e){e=ts.createWithCurrentPage(e.pageName,e.properties);this.pageManager.setCurrentPage(e)},d.prototype.remoteConfig=function(e){return new vo(this.core,this.userManager,e)},d.prototype.onReady=function(e,t){this.onInitialized({timeout:t=void 0===t?3e3:t}).finally(function(){return e()})},d.prototype.getExperiment=function(t){try{return this.core.getExperiment(t)}catch(e){return void cs.error('"Unexpected exception while get experiment['.concat(t,"]"))}},d.prototype.onInitialized=function(r){var n;return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:if(this.initialized)return[2,{success:!0}];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Qo.timeout(this.initialization,null!=(n=null==r?void 0:r.timeout)?n:3e3)];case 2:return e.sent(),[2,{success:!0}];case 3:return t=e.sent(),cs.error("Failed to onInitialized: ".concat(t)),[2,{success:!1}];case 4:return[2]}})})},d.prototype._convertEvent=function(e){return"string"==typeof e?{key:e}:e},d.prototype.showUserExplorer=function(){var e;null!=(e=this.devTools)&&e.userExplorer?(cs.debug("UserExplorer opened."),zi.counter("user.explorer.show",{}).increment(),this.devTools.manager.userExplorer(this.devTools.userExplorer)):cs.error("UserExplorer is not provided")},d.prototype.hideUserExplorer=function(){this.devTools?this.devTools.manager.close():cs.warn("There is no active HackleDevtools.")},d.prototype.fetch=function(){var e=this;return this.fetchThrottler.execute(function(){return e.synchronizer.sync()},function(){return Promise.resolve()})},d.prototype.setInAppMessageListener=function(e){this.inAppMessageUi.setListener(e)},d.prototype.getDisplayedInAppMessageView=function(){return this.inAppMessageUi.currentMessageView?as.toPublic(this.inAppMessageUi.currentMessageView):null},d.prototype.close=function(){cs.debug("HackleClient closing"),this.core.close(),this.synchronizer.close()},d);function d(e,t,r,n,i,o,s,a,u){this.core=e,this.synchronizer=t,this.sessionManager=r,this.userManager=n,this.piiEventManager=i,this.fetchThrottler=o,this.pageManager=s,this.inAppMessageUi=a,this.devTools=u,this.initialized=!1,this.initialize=this.initialize.bind(this),this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.updatePushSubscriptions=this.updatePushSubscriptions.bind(this),this.updateSmsSubscriptions=this.updateSmsSubscriptions.bind(this),this.updateKakaoSubscriptions=this.updateKakaoSubscriptions.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.setCurrentPage=this.setCurrentPage.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.getDisplayedInAppMessageView=this.getDisplayedInAppMessageView.bind(this),this.initialization=this.initialize()}var ls=s.log,fs=(hs.prototype.get=function(t,r){var e=typeof r;try{var n={command:"remoteConfig",parameters:{defaultValue:r,key:t,valueType:e,user:this.user},browserProperties:this.browserPropertyProvider.getBrowserProperties()},i=this.invocationProcessor.process(n);if(!i)throw new Error("invoke result data not exists");switch(e){case"number":return Number(i);case"boolean":return Boolean(i);default:return i}}catch(e){return ls.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),r}},hs);function hs(e,t,r){this.invocationProcessor=e,this.user=t,this.browserPropertyProvider=r}ys.tryParse=function(e){try{return new URL(e)}catch(e){return}},ys.removePathnameTrailingSlash=function(e){var t=e instanceof URL?e:ys.tryParse(e);return t?(t.pathname.endsWith("/")&&(t.pathname=t.pathname.replace(/\/+$/,"")),t.href):String(e)},ys.tryDecodeURI=function(e){try{return decodeURI(e)}catch(e){return}},ys.tryDecodeURIComponent=function(e){try{return decodeURIComponent(e)}catch(e){return}},ys.decodeURIOrOriginal=function(t){try{return decodeURI(t)}catch(e){return t}},ys.decodeURIComponentOrOriginal=function(t){try{return decodeURIComponent(t)}catch(e){return t}};var ds=ys;function ys(){}gs.extractDomain=function(e){var t=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,r=e.split("."),r=r[r.length-1],r=((4<r.length||"com"===r||"org"===r)&&(t=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i),e.match(t));return r?r[0]:""},gs.prototype.getItem=function(e){for(var t,r=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return null!=(t=ds.tryDecodeURIComponent(o.substring(r.length,o.length)))?t:null}return null},gs.prototype.getAllItem=function(e){var t=document.cookie.split("; ").map(function(e){return e.split("=")}),r=null==e?void 0:e.keyPrefix;return r?t.filter(function(e){var t=e[0];return e[1],t.startsWith(r)}):t},gs.prototype.setItem=function(e,t,r){var r=p(p({},this.options),r),n="",i="",o="",s="",a=(r.isCrossSubdomain&&(n=(a=gs.extractDomain(document.location.hostname))?"; domain=."+a:""),r.days&&((a=new Date).setTime(a.getTime()+24*r.days*60*60*1e3),i="; expires="+a.toUTCString()),r.sameSite&&(s="; SameSite=".concat(r.sameSite)),r.isSecure&&(o+="; secure"),e+"="+encodeURIComponent(t)+i+"; path=/"+n+s+o);return document.cookie=a},gs.prototype.removeItem=function(e,t){this.setItem(e,"",p(p({},t),{days:-1}))},gs.prototype.getOptions=function(){return this.options},gs.getInstance=function(e){return void 0===e&&(e={days:Ze,isCrossSubdomain:!0}),gs.storage=gs.storage?gs.storage:new gs(e)};var vs=gs;function gs(e){this.options=e=void 0===e?{days:0,isCrossSubdomain:!1,isSecure:!1}:e}Es.prototype.initialize=function(){vs.getInstance().getItem(Qe)||As()},Es.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return bs();case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var ms=Es;function Es(){}function ws(){var e=vs.getInstance(),t=e.getItem(et);if(t)return t;t=e.getItem(Qe);return t||As()}function bs(){vs.getInstance().removeItem(et)}function As(){var e=H();return vs.getInstance().setItem(Qe,e),e}Ts.prototype.close=function(){var e={command:"closeInAppMessageView",parameters:{viewId:this.id},browserProperties:this.browserPropertyProvider.getBrowserProperties()};this.invocationProcessor.process(e)};var Is=Ts;function Ts(e,t,r,n){this.id=e,this.inAppMessage=t,this.invocationProcessor=r,this.browserPropertyProvider=n}var _s,Ns=s.log;function Ps(e){return e&&"_hackleApp"in e&&null!==e._hackleApp&&"object"==typeof e._hackleApp&&("getAppSdkKey"in e._hackleApp&&"function"==typeof e._hackleApp.getAppSdkKey&&("getInvocationType"in e._hackleApp&&"function"==typeof e._hackleApp.getInvocationType))}(G=_s=_s||{}).native="native",G.web_view_wrapper="web_view_wrapper";y.prototype.getSessionId=function(){try{var e={command:"getSessionId",browserProperties:this.browserPropertyProvider.getBrowserProperties()},t=this.invocationProcessor.process(e);return null!=t?t:ws()}catch(e){return Ns.error("Unexpected exception while get sessionId: ".concat(e)),ws()}},y.prototype.getUser=function(){var e;try{var t={command:"getUser",browserProperties:this.browserPropertyProvider.getBrowserProperties()},r=this.invocationProcessor.process(t);return null!=(e=Yt(r))?e:this.defaultUser()}catch(e){return Ns.error("Unexpected exception while get user: ".concat(e)),this.defaultUser()}},y.prototype.setUser=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){try{if(!(t=Yt(n)))return Ns.warn("invalid user"),[2];r={command:"setUser",parameters:{user:t},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(r)}catch(e){Ns.error("Unexpected exception while set user: ".concat(e))}return[2]})})},y.prototype.setUserId=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){try{if(t=void 0,c.isNullOrUndefined(n))t=null;else if(!(t=Ce.sanitizeValue(n)))return Ns.warn("Invalid userId. [userId=".concat(n,"]")),[2];r={command:"setUserId",parameters:{userId:t},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(r)}catch(e){Ns.error("Unexpected exception while set userId: ".concat(e))}return[2]})})},y.prototype.setDeviceId=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){try{if(!(t=Ce.sanitizeValue(n)))return Ns.warn("Invalid deviceId. [deviceId=".concat(n,"]")),[2];r={command:"setDeviceId",parameters:{deviceId:t},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(r)}catch(e){Ns.error("Unexpected exception while set deviceId: ".concat(e))}return[2]})})},y.prototype.setUserProperty=function(r,n){return o(this,void 0,void 0,function(){var t;return a(this,function(e){try{t={command:"setUserProperty",parameters:{key:r,value:n},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){Ns.error("Unexpected exception while set userProperty: ".concat(e))}return[2]})})},y.prototype.setUserProperties=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){try{t=ke.sanitize(n),r=new Wo,Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){Ns.error("Unexpected exception while set userProperties: ".concat(e))}return[2]})})},y.prototype.updateUserProperties=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){try{t={command:"updateUserProperties",parameters:{operations:r.toRecord()},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){Ns.error("Unexpected exception while update userProperties: ".concat(e))}return[2]})})},y.prototype.updatePushSubscriptions=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){try{t={command:"updatePushSubscriptions",parameters:{operations:r.toRecord()},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){Ns.error("Unexpected exception while update push subscriptions: ".concat(e))}return[2]})})},y.prototype.updateSmsSubscriptions=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){try{t={command:"updateSmsSubscriptions",parameters:{operations:r.toRecord()},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){Ns.error("Unexpected exception while update sms subscriptions: ".concat(e))}return[2]})})},y.prototype.updateKakaoSubscriptions=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){try{t={command:"updateKakaoSubscriptions",parameters:{operations:r.toRecord()},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){Ns.error("Unexpected exception while update Kakao subscriptions: ".concat(e))}return[2]})})},y.prototype.resetUser=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){try{t={command:"resetUser",browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){Ns.error("Unexpected exception while reset user: ".concat(e))}return[2]})})},y.prototype.setPhoneNumber=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){try{if("string"!=typeof r)return Ns.error("Invalid type ".concat(r,": phoneNumber value must be string.")),[2,Promise.resolve()];t={command:"setPhoneNumber",parameters:{phoneNumber:r},browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){Ns.error("Unexpected exception occurred while setting phone number: ".concat(e))}return[2]})})},y.prototype.unsetPhoneNumber=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){try{t={command:"unsetPhoneNumber",browserProperties:this.browserPropertyProvider.getBrowserProperties()},this.invocationProcessor.process(t)}catch(e){Ns.error("Unexpected exception occurred while unsetting phone number: ".concat(e))}return[2]})})},y.prototype.variation=function(t,e,r){void 0===r&&(r="A");try{var n={command:"variation",parameters:{experimentKey:t,defaultVariation:r,user:this.convertUser(e)},browserProperties:this.browserPropertyProvider.getBrowserProperties()},i=this.invocationProcessor.process(n);if(i)return i;throw new Error("invoke result data not exists")}catch(e){return Ns.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),r}},y.prototype.variationDetail=function(t,e,r){var n;void 0===r&&(r="A");try{var i={command:"variationDetail",parameters:{experimentKey:t,defaultVariation:r,user:this.convertUser(e)},browserProperties:this.browserPropertyProvider.getBrowserProperties()},o=this.invocationProcessor.process(i);if(null===o)throw new Error("invoke result data not exists");return At.of(o.variation,o.reason,new je(null!=(n=o.config.parameters)?n:{}))}catch(e){return Ns.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),At.of(r,l.EXCEPTION)}},y.prototype.isFeatureOn=function(t,e){try{var r={command:"isFeatureOn",parameters:{featureKey:t,user:this.convertUser(e)},browserProperties:this.browserPropertyProvider.getBrowserProperties()},n=this.invocationProcessor.process(r);if(null===n)throw new Error("invoke result data not exists");return Boolean(n)}catch(e){return Ns.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),!1}},y.prototype.featureFlagDetail=function(t,e){var r;try{var n={command:"featureFlagDetail",parameters:{featureKey:t,user:this.convertUser(e)},browserProperties:this.browserPropertyProvider.getBrowserProperties()},i=this.invocationProcessor.process(n);if(null===i)throw new Error("invoke result data not exists");return new Tt(i.isOn,i.reason,new je(null!=(r=i.config.parameters)?r:{}),void 0)}catch(e){return Ns.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),Tt.off(l.EXCEPTION)}},y.prototype.track=function(e,t){try{var r={command:"track",parameters:{event:this.convertEvent(e),user:this.convertUser(t)},browserProperties:this.browserPropertyProvider.getBrowserProperties()};this.invocationProcessor.process(r)}catch(e){Ns.error("Unexpected exception while tracking event: ".concat(e))}},y.prototype.trackPageView=function(e){Ns.warn("Web to app integration feature is not support 'trackPageView' method")},y.prototype.setCurrentPage=function(e){e=ts.createWithCurrentPage(e.pageName,e.properties);this.pageManager.setCurrentPage(e)},y.prototype.remoteConfig=function(e){return new fs(this.invocationProcessor,this.convertUser(e),this.browserPropertyProvider)},y.prototype.onReady=function(e,t){e()},y.prototype.showUserExplorer=function(){try{var e={command:"showUserExplorer",browserProperties:this.browserPropertyProvider.getBrowserProperties()};this.invocationProcessor.process(e)}catch(e){Ns.error("Unexpected exception while show userExplorer: ".concat(e))}},y.prototype.hideUserExplorer=function(){try{var e={command:"hideUserExplorer",browserProperties:this.browserPropertyProvider.getBrowserProperties()};this.invocationProcessor.process(e)}catch(e){Ns.error("Unexpected exception while hide userExplorer: ".concat(e))}},y.prototype.setInAppMessageListener=function(e){Ns.info("Web to app integration feature is not support 'setInAppMessageListener' method")},y.prototype.fetch=function(){return Promise.resolve()},y.prototype.onInitialized=function(e){return Promise.resolve({success:!0})},y.prototype.close=function(){Ns.info("Web to app integration feature is not support 'close' method")},y.prototype.getExperiment=function(e){Ns.info("Web to app integration feature is not support 'getExperiment' method")},y.prototype.convertEvent=function(e){return"string"==typeof e?{key:e}:e},y.prototype.convertUser=function(e){return"string"==typeof e||e&&null!=(e=Yt(e))?e:void 0},y.prototype.defaultUser=function(){return{deviceId:ws()}},y.prototype.getCurrentInAppMessageView=function(){var e={command:"getCurrentInAppMessageView",browserProperties:this.browserPropertyProvider.getBrowserProperties()};return this.invocationProcessor.process(e)},y.prototype.getDisplayedInAppMessageView=function(){var e=this.getCurrentInAppMessageView();return e?new Is(e.id,e.inAppMessage,this.invocationProcessor,this.browserPropertyProvider):null};var Os=y;function y(e,t,r){this.invocationProcessor=e,this.browserPropertyProvider=t,this.pageManager=r,this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.updatePushSubscriptions=this.updatePushSubscriptions.bind(this),this.updateSmsSubscriptions=this.updateSmsSubscriptions.bind(this),this.updateKakaoSubscriptions=this.updateKakaoSubscriptions.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.setCurrentPage=this.setCurrentPage.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.getDisplayedInAppMessageView=this.getDisplayedInAppMessageView.bind(this)}v.prototype.getSessionId=function(){return this.browser.getSessionId()},v.prototype.getUser=function(){return this.browser.getUser()},v.prototype.syncUser=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return t=this.browser.getUser(),[4,this.app.setUser(t)];case 1:return e.sent(),[2]}})})},v.prototype.setUser=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.setUser(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},v.prototype.setUserId=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserId(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},v.prototype.setDeviceId=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.setDeviceId(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},v.prototype.setUserProperty=function(t,r){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserProperty(t,r)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},v.prototype.setUserProperties=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserProperties(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},v.prototype.updateUserProperties=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.updateUserProperties(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},v.prototype.updatePushSubscriptions=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.updatePushSubscriptions(t)];case 1:return e.sent(),[2]}})})},v.prototype.updateSmsSubscriptions=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.updateSmsSubscriptions(t)];case 1:return e.sent(),[2]}})})},v.prototype.updateKakaoSubscriptions=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.updateKakaoSubscriptions(t)];case 1:return e.sent(),[2]}})})},v.prototype.resetUser=function(){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.resetUser()];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},v.prototype.setPhoneNumber=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.setPhoneNumber(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},v.prototype.unsetPhoneNumber=function(){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.browser.unsetPhoneNumber()];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},v.prototype.variation=function(e,t,r){return this.browser.variation(e,t,r=void 0===r?"A":r)},v.prototype.variationDetail=function(e,t,r){return this.browser.variationDetail(e,t,r=void 0===r?"A":r)},v.prototype.isFeatureOn=function(e,t){return this.browser.isFeatureOn(e,t)},v.prototype.featureFlagDetail=function(e,t){return this.browser.featureFlagDetail(e,t)},v.prototype.track=function(e,t){return this.browser.track(e,t)},v.prototype.trackPageView=function(e){return this.browser.trackPageView(e)},v.prototype.setCurrentPage=function(e){return this.browser.setCurrentPage(e)},v.prototype.remoteConfig=function(e){return this.browser.remoteConfig(e)},v.prototype.onReady=function(e,t){this.browser.onReady(e,t)},v.prototype.showUserExplorer=function(){this.browser.showUserExplorer()},v.prototype.hideUserExplorer=function(){this.browser.hideUserExplorer()},v.prototype.fetch=function(){return this.browser.fetch()},v.prototype.onInitialized=function(e){return this.browser.onInitialized(e)},v.prototype.close=function(){this.browser.close()},v.prototype.setInAppMessageListener=function(e){this.browser.setInAppMessageListener(e)},v.prototype.getExperiment=function(e){return this.browser.getExperiment(e)},v.prototype.getDisplayedInAppMessageView=function(){return this.browser.getDisplayedInAppMessageView()};var Ms=v;function v(e,t){this.browser=e,this.app=t,this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.updatePushSubscriptions=this.updatePushSubscriptions.bind(this),this.updateSmsSubscriptions=this.updateSmsSubscriptions.bind(this),this.updateKakaoSubscriptions=this.updateKakaoSubscriptions.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.setCurrentPage=this.setCurrentPage.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.getDisplayedInAppMessageView=this.getDisplayedInAppMessageView.bind(this)}function Ss(e){return e&&e.Math==Math&&e}function Cs(e){try{return!!e()}catch(e){return!0}}function Rs(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function Us(e){return Ea(ma(e),8,-1)}function ks(e){if(null==e)throw Ia("Can't call method on "+e);return e}function xs(e){return Ta(_a(e))}function Ds(e){return"function"==typeof e}function Ls(e){return"object"==typeof e?null!==e:Na(e)}function Fs(e,t){return arguments.length<2?(r=Pa[e],Oa(r)?r:void 0):Pa[e]&&Pa[e][t];var r}function Vs(e){try{return Va(e)}catch(e){return"Object"}}function Bs(e){if(Ba(e))return e;throw Ha(Ka(e)+" is not a function")}function Ks(e,t){return null==(e=e[t])?void 0:ja(e)}function Hs(t,r){try{Wa(qa,t,{value:r,configurable:!0,writable:!0})}catch(e){qa[t]=r}return r}function js(e){return eu(Qa(e))}function Gs(e){return"Symbol("+(void 0===e?"":e)+")_"+su(++iu+ou,36)}function zs(e){var t;return uu(fu,e)&&(pu||"string"==typeof fu[e])||(t="Symbol."+e,pu&&uu(hu,e)?fu[e]=hu[e]:fu[e]=(lu&&du?du:yu)(t)),fu[e]}function Ys(e){return e=Iu(e,"string"),Tu(e)?e:e+""}function Js(e){return Nu?_u.createElement(e):{}}function qs(e){if(Du(e))return e;throw Fu(Lu(e)+" is not an object")}function Ws(e){return Qu[e]||(Qu[e]=Zu(e))}function $s(e,t,r,n){var i=(n=n||{}).enumerable,o=void 0!==n.name?n.name:t;if(gc(r)&&Ec(r,o,n),n.global)i?e[t]=r:wc(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:mc.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}function Xs(e){return(e=+e)!=e||0==e?0:Ic(e)}function Zs(e,t){return(e=Tc(e))<0?_c(e+t,0):Nc(e,t)}function Qs(e){return Mc(e.length)}function ea(a){return function(e,t,r){var n,i=Sc(e),o=Rc(i),s=Cc(r,o);if(a&&t!=t){for(;s<o;)if((n=i[s++])!=n)return!0}else for(;s<o;s++)if((a||s in i)&&i[s]===t)return a||s||0;return!a&&-1}}function ta(e,t){var r,n=kc(e),i=0,o=[];for(r in n)!Uc(Dc,r)&&Uc(n,r)&&Lc(o,r);for(;t.length>i;)!Uc(n,r=t[i++])||~xc(o,r)||Lc(o,r);return o}function ra(e,t,r){for(var n=zc(t),i=Jc.f,o=Yc.f,s=0;s<n.length;s++){var a=n[s];Gc(e,a)||r&&Gc(r,a)||i(e,a,o(t,a))}}function na(e,t){return(e=Zc[Xc(e)])==ep||e!=Qc&&(Wc(t)?qc(t):!!t)}function g(e,t){var r,n,i,o=e.target,s=e.global,a=e.stat,u=s?tp:a?tp[o]||op(o,{}):(tp[o]||{}).prototype;if(u)for(r in t){if(n=t[r],i=e.dontCallGetSet?(i=rp(u,r))&&i.value:u[r],!ap(s?r:o+(a?".":"#")+r,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;sp(n,i)}(e.sham||i&&i.sham)&&np(n,"sham",!0),ip(u,r,n,e)}}var ia,oa,sa,aa,ua,ca,pa,la,j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=Ss("object"==typeof globalThis&&globalThis)||Ss("object"==typeof window&&window)||Ss("object"==typeof self&&self)||Ss("object"==typeof j&&j)||function(){return this}()||Function("return this")(),e={},ee=!Cs(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),t=!Cs(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),fa=Function.prototype.call,G=t?fa.bind(fa):function(){return fa.apply(fa,arguments)},j={},ha={}.propertyIsEnumerable,da=Object.getOwnPropertyDescriptor,m=da&&!ha.call({1:2},1),m=(j.f=m?function(e){e=da(this,e);return!!e&&e.enumerable}:ha,t),ha=Function.prototype,ya=ha.bind,va=ha.call,ga=m&&ya.bind(va,va),ha=m?function(e){return e&&ga(e)}:function(e){return e&&function(){return va.apply(e,arguments)}},ya=ha,ma=ya({}.toString),Ea=ya("".slice),m=Cs,wa=Us,ba=Object,Aa=ha("".split),ya=m(function(){return!ba("z").propertyIsEnumerable(0)})?function(e){return"String"==wa(e)?Aa(e,""):ba(e)}:ba,Ia=TypeError,Ta=ya,_a=ks,Na=Ds,Pa=r,Oa=Ds,m=ha({}.isPrototypeOf),Ma=Fs("navigator","userAgent")||"",Sa=Ma,Ca=r.process,Ra=r.Deno,Ca=Ca&&Ca.versions||Ra&&Ra.version,Ra=Ca&&Ca.v8,Ca=Fa=!(Fa=Ra?0<(E=Ra.split("."))[0]&&E[0]<4?1:+(E[0]+E[1]):Fa)&&Sa&&(!(E=Sa.match(/Edge\/(\d+)/))||74<=E[1])&&(E=Sa.match(/Chrome\/(\d+)/))?+E[1]:Fa,Ua=Ca,Ra=Cs,Sa=!!Object.getOwnPropertySymbols&&!Ra(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ua&&Ua<41}),E=Sa&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ka=Fs,xa=Ds,Da=m,La=Object,Fa=E?function(e){return"symbol"==typeof e}:function(e){var t=ka("Symbol");return xa(t)&&Da(t.prototype,La(e))},Va=String,Ba=Ds,Ka=Vs,Ha=TypeError,ja=Bs,Ga=G,za=Ds,Ya=Ls,Ja=TypeError,Ra={exports:{}},qa=r,Wa=Object.defineProperty,$a=Hs,Xa="__core-js_shared__",$a=r[Xa]||$a(Xa,{}),Za=$a,Qa=((Ra.exports=function(e,t){return Za[e]||(Za[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"}),ks),eu=Object,tu=js,ru=ha({}.hasOwnProperty),Xa=Object.hasOwn||function(e,t){return ru(tu(e),t)},nu=ha,iu=0,ou=Math.random(),su=nu(1..toString),nu=r,au=Ra.exports,uu=Xa,cu=Gs,pu=Sa,lu=E,fu=au("wks"),hu=nu.Symbol,du=hu&&hu.for,yu=lu?hu:hu&&hu.withoutSetter||cu,vu=G,gu=Ls,mu=Fa,Eu=Ks,wu=function(e,t){var r,n;if("string"===t&&za(r=e.toString)&&!Ya(n=Ga(r,e)))return n;if(za(r=e.valueOf)&&!Ya(n=Ga(r,e)))return n;if("string"!==t&&za(r=e.toString)&&!Ya(n=Ga(r,e)))return n;throw Ja("Can't convert object to primitive value")},bu=TypeError,Au=zs("toPrimitive"),Iu=function(e,t){if(!gu(e)||mu(e))return e;var r=Eu(e,Au);if(r){if(r=vu(r,e,t=void 0===t?"default":t),!gu(r)||mu(r))return r;throw bu("Can't convert object to primitive value")}return wu(e,t=void 0===t?"number":t)},Tu=Fa,Sa=Ls,_u=r.document,Nu=Sa(_u)&&Sa(_u.createElement),Pu=Js,E=!ee&&!Cs(function(){return 7!=Object.defineProperty(Pu("div"),"a",{get:function(){return 7}}).a}),Ou=G,Mu=j,Su=Rs,Cu=xs,Ru=Ys,Uu=Xa,ku=E,xu=Object.getOwnPropertyDescriptor,au=(e.f=ee?xu:function(e,t){if(e=Cu(e),t=Ru(t),ku)try{return xu(e,t)}catch(e){}if(Uu(e,t))return Su(!Ou(Mu.f,e,t),e[t])},{}),nu=ee&&Cs(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),Du=Ls,Lu=String,Fu=TypeError,Vu=E,Bu=qs,Ku=Ys,Hu=TypeError,ju=Object.defineProperty,Gu=Object.getOwnPropertyDescriptor,zu="enumerable",Yu="configurable",Ju="writable",cu=(au.f=ee?nu?function(e,t,r){var n;return Bu(e),t=Ku(t),Bu(r),"function"==typeof e&&"prototype"===t&&"value"in r&&Ju in r&&!r[Ju]&&((n=Gu(e,t))&&n[Ju]&&(e[t]=r.value,r={configurable:(Yu in r?r:n)[Yu],enumerable:(zu in r?r:n)[zu],writable:!1})),ju(e,t,r)}:ju:function(e,t,r){if(Bu(e),t=Ku(t),Bu(r),Vu)try{return ju(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Hu("Accessors not supported");return"value"in r&&(e[t]=r.value),e},ee),qu=au,Wu=Rs,Fa=cu?function(e,t,r){return qu.f(e,t,Wu(1,r))}:function(e,t,r){return e[t]=r,e},Sa={exports:{}},j=ee,E=Xa,cu=Function.prototype,w=j&&Object.getOwnPropertyDescriptor,E=E(cu,"name"),E={EXISTS:E,PROPER:E&&"something"===function(){}.name,CONFIGURABLE:E&&(!j||w(cu,"name").configurable)},j=Ds,w=$a,$u=ha(Function.toString),cu=(j(w.inspectSource)||(w.inspectSource=function(e){return $u(e)}),w.inspectSource),j=Ds,w=cu,Xu=r.WeakMap,j=j(Xu)&&/native code/.test(w(Xu)),w=Ra.exports,Zu=Gs,Qu=w("keys"),Xu={},Ra=ha,ec=Ls,tc=Fa,rc=Xa,w=$a,nc=Ws,ic=Xu,oc="Object already initialized",sc=r.TypeError,b=r.WeakMap,j=(pa=j||w.state?(ia=w.state||(w.state=new b),oa=Ra(ia.get),sa=Ra(ia.has),aa=Ra(ia.set),ua=function(e,t){if(sa(ia,e))throw new sc(oc);return t.facade=e,aa(ia,e,t),t},ca=function(e){return oa(ia,e)||{}},function(e){return sa(ia,e)}):(ic[la=nc("state")]=!0,ua=function(e,t){if(rc(e,la))throw new sc(oc);return t.facade=e,tc(e,la,t),t},ca=function(e){return rc(e,la)?e[la]:{}},function(e){return rc(e,la)}),{set:ua,get:ca,has:pa,enforce:function(e){return pa(e)?ca(e):ua(e,{})},getterFor:function(t){return function(e){if(ec(e)&&(e=ca(e)).type===t)return e;throw sc("Incompatible receiver, "+t+" required")}}}),w=Cs,ac=Ds,uc=Xa,cc=ee,pc=E.CONFIGURABLE,lc=cu,fc=j.enforce,hc=j.get,dc=Object.defineProperty,yc=cc&&!w(function(){return 8!==dc(function(){},"length",{value:8}).length}),vc=String(String).split("String"),b=Sa.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!uc(e,"name")||pc&&e.name!==t)&&(cc?dc(e,"name",{value:t,configurable:!0}):e.name=t),yc&&r&&uc(r,"arity")&&e.length!==r.arity&&dc(e,"length",{value:r.arity});try{r&&uc(r,"constructor")&&r.constructor?cc&&dc(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}r=fc(e);return uc(r,"source")||(r.source=vc.join("string"==typeof t?t:"")),e},gc=(Function.prototype.toString=b(function(){return ac(this)&&hc(this).source||lc(this)},"toString"),Ds),mc=au,Ec=Sa.exports,wc=Hs,Ra={},bc=Math.ceil,Ac=Math.floor,Ic=Math.trunc||function(e){e=+e;return(0<e?Ac:bc)(e)},Tc=Xs,_c=Math.max,Nc=Math.min,Pc=Xs,Oc=Math.min,Mc=function(e){return 0<e?Oc(Pc(e),9007199254740991):0},Sc=xs,Cc=Zs,Rc=Qs,ic={includes:ea(!0),indexOf:ea(!1)},nc=ha,Uc=Xa,kc=xs,xc=ic.indexOf,Dc=Xu,Lc=nc([].push),w=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Fc=ta,Vc=w.concat("length","prototype"),b=(Ra.f=Object.getOwnPropertyNames||function(e){return Fc(e,Vc)},{}),nc=(b.f=Object.getOwnPropertySymbols,Fs),Bc=Ra,Kc=b,Hc=qs,jc=ha([].concat),b=nc("Reflect","ownKeys")||function(e){var t=Bc.f(Hc(e)),r=Kc.f;return r?jc(t,r(e)):t},Gc=Xa,zc=b,Yc=e,Jc=au,qc=Cs,Wc=Ds,$c=/#|\.prototype\./,Xc=na.normalize=function(e){return String(e).replace($c,".").toLowerCase()},Zc=na.data={},Qc=na.NATIVE="N",ep=na.POLYFILL="P",nc=na,tp=r,rp=e.f,np=Fa,ip=$s,op=Hs,sp=ra,ap=nc,b=!Cs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),up=Xa,cp=Ds,pp=js,lp=Ws("IE_PROTO"),fp=Object,hp=fp.prototype,b=b?fp.getPrototypeOf:function(e){e=pp(e);if(up(e,lp))return e[lp];var t=e.constructor;return cp(t)&&e instanceof t?t.prototype:e instanceof fp?hp:null},dp=Ds,yp=String,vp=TypeError,gp=ha,mp=qs,Ep=function(e){if("object"==typeof e||dp(e))return e;throw vp("Can't set "+yp(e)+" as a prototype")},wp=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=gp(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return mp(e),Ep(t),n?r(e,t):e.__proto__=t,e}}():void 0),A={},bp=ta,Ap=w,I=Object.keys||function(e){return bp(e,Ap)},Ip=au,Tp=qs,_p=xs,Np=I;A.f=ee&&!nu?Object.defineProperties:function(e,t){Tp(e);for(var r,n=_p(t),i=Np(t),o=i.length,s=0;s<o;)Ip.f(e,r=i[s++],n[r]);return e};function Pp(){}function Op(e){e.write(Wp("")),e.close();var t=e.parentWindow.Object;return e=null,t}function Mp(e,t){return nl(e),void 0===t?e:il?ol(e,t):function(){return e.apply(t,arguments)}}function Sp(e){return void 0!==e&&(sl.Array===e||ul[al]===e)}function Cp(e){if(null!=e)return yl(e,gl)||yl(e,"@@iterator")||vl[dl(e)]}function Rp(e,t){if(t=arguments.length<2?Al(e):t,El(t))return wl(ml(t,e));throw Il(bl(e)+" is not iterable")}function Up(e,t,r){var n,i;_l(e);try{if(!(n=Nl(e,"return"))){if("throw"===t)throw r;return r}n=Tl(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return _l(n),r}function kp(e,t){this.stopped=e,this.result=t}function xp(e,t,r){function n(e){return o&&Dl(o,"normal",e),new kp(!0,e)}function i(e){return f?(Ml(e),y?v(e[0],e[1],n):v(e[0],e[1])):y?v(e,n):v(e)}var o,s,a,u,c,p,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),y=!(!r||!r.INTERRUPTED),v=Pl(t,l);if(h)o=e.iterator;else if(d)o=e;else{if(!(r=xl(e)))throw Ll(Sl(e)+" is not iterable");if(Cl(r)){for(s=0,a=Rl(e);s<a;s++)if((u=i(e[s]))&&Ul(Fl,u))return u;return new kp(!1)}o=kl(e,r)}for(c=(h?e:o).next;!(p=Ol(c,o)).done;){try{u=i(p.value)}catch(e){Dl(o,"throw",e)}if("object"==typeof u&&u&&Ul(Fl,u))return u}return new kp(!1)}function Dp(e){if("Symbol"===Vl(e))throw TypeError("Cannot convert a Symbol value to a string");return Bl(e)}function Lp(e,t){var r,n=2<arguments.length?arguments[2]:void 0,i=jl(of,this);return zl?r=zl(new rf,i?Gl(this):of):(r=i?this:Jl(of),ql(r,tf,"Error")),void 0!==t&&ql(r,"message",Ql(t)),ef&&ql(r,"stack",$l(r.stack,1)),Xl(r,n),Zl(e,nf,{that:i=[]}),ql(r,"errors",i),r}function Fp(e){af[sf][e]=!0}var Vp,Bp,I=Fs("document","documentElement"),Kp=qs,Hp=A,jp=w,nu=Xu,Gp=I,zp=Js,Yp="prototype",Jp="script",qp=Ws("IE_PROTO"),Wp=function(e){return"<"+Jp+">"+e+"</"+Jp+">"},$p=function(){try{Vp=new ActiveXObject("htmlfile")}catch(e){}$p="undefined"==typeof document||document.domain&&Vp?Op(Vp):(e=zp("iframe"),t="java"+Jp+":",e.style.display="none",Gp.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(Wp("document.F=Object")),t.close(),t.F);for(var e,t,r=jp.length;r--;)delete $p[Yp][jp[r]];return $p()},A=(nu[qp]=!0,Object.create||function(e,t){var r;return null!==e?(Pp[Yp]=Kp(e),r=new Pp,Pp[Yp]=null,r[qp]=e):r=$p(),void 0===t?r:Hp.f(r,t)}),Xp=Error,Zp=ha("".replace),w=String(Xp("zxcasd").stack),Qp=/\n\s*at [^:]*:[^\n]*/,el=Qp.test(w),tl=Ls,rl=Fa,nl=Bs,il=t,ol=ha(ha.bind),nu={},sl=nu,al=zs("iterator"),ul=Array.prototype,w={},w=(w[zs("toStringTag")]="z","[object z]"===String(w)),T=w,cl=Ds,pl=Us,ll=zs("toStringTag"),fl=Object,hl="Arguments"==pl(function(){return arguments}()),T=T?pl:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=fl(e),ll))?t:hl?pl(e):"Object"==(t=pl(e))&&cl(e.callee)?"Arguments":t},dl=T,yl=Ks,vl=nu,gl=zs("iterator"),ml=G,El=Bs,wl=qs,bl=Vs,Al=Cp,Il=TypeError,Tl=G,_l=qs,Nl=Ks,Pl=Mp,Ol=G,Ml=qs,Sl=Vs,Cl=Sp,Rl=Qs,Ul=m,kl=Rp,xl=Cp,Dl=Up,Ll=TypeError,Fl=kp.prototype,Vl=T,Bl=String,Kl=Dp,Hl=Rs,_=!Cs(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",Hl(1,7)),7!==e.stack)}),N=g,jl=m,Gl=b,zl=wp,Yl=ra,Jl=A,ql=Fa,Wl=Rs,$l=function(e,t){if(el&&"string"==typeof e&&!Xp.prepareStackTrace)for(;t--;)e=Zp(e,Qp,"");return e},Xl=function(e,t){tl(t)&&"cause"in t&&rl(e,"cause",t.cause)},Zl=xp,Ql=function(e,t){return void 0===e?arguments.length<2?"":t:Kl(e)},ef=_,tf=zs("toStringTag"),rf=Error,nf=[].push,of=(zl?zl(Lp,rf):Yl(Lp,rf,{name:!0}),Lp.prototype=Jl(rf.prototype,{constructor:Wl(1,Lp),message:Wl(1,""),name:Wl(1,"AggregateError")})),_=(N({global:!0,constructor:!0,arity:2},{AggregateError:Lp}),zs),Yl=A,Wl=au.f,sf=_("unscopables"),af=Array.prototype,N=(null==af[sf]&&Wl(af,sf,{configurable:!0,value:Yl(null)}),Cs),_=Ds,Wl=b,Yl=$s,uf=zs("iterator"),cf=!1;[].keys&&("next"in(df=[].keys())?(Wl=Wl(Wl(df)))!==Object.prototype&&(Bp=Wl):cf=!0);function pf(e,t,r){(e=e&&!r?e.prototype:e)&&!vf(e,gf)&&yf(e,gf,{configurable:!0,value:t})}function lf(){return this}function ff(){return this}function hf(e,t,r,n,i,o,s){function a(e){if(e===i&&h)return h;if(!Df&&e in l)return l[e];switch(e){case"keys":case Ff:case Vf:return function(){return new r(this,e)}}return function(){return new r(this)}}Nf(r,t,n);var u,c,n=t+" Iterator",p=!1,l=e.prototype,f=l[Lf]||l["@@iterator"]||i&&l[i],h=!Df&&f||a(i),d="Array"==t&&l.entries||f;if(d&&(d=Pf(d.call(new e)))!==Object.prototype&&d.next&&(Pf(d)!==xf&&(Of?Of(d,xf):_f(d[Lf])||Cf(d,Lf,ff)),Mf(d,n,!0)),Uf&&i==Ff&&f&&f.name!==Ff&&(kf?Sf(l,"name",Ff):(p=!0,h=function(){return Tf(f,this)})),i)if(u={values:a(Ff),keys:o?h:a("keys"),entries:a(Vf)},s)for(c in u)!Df&&!p&&c in l||Cf(l,c,u[c]);else If({target:t,proto:!0,forced:Df||p},u);return l[Lf]!==h&&Cf(l,Lf,h,{name:i}),Rf[t]=h,u}_((Bp=null==Bp||N(function(){var e={};return Bp[uf].call(e)!==e})?{}:Bp)[uf])||Yl(Bp,uf,function(){return this});var df={IteratorPrototype:Bp,BUGGY_SAFARI_ITERATORS:cf},yf=au.f,vf=Xa,gf=zs("toStringTag"),mf=df.IteratorPrototype,Ef=A,wf=Rs,bf=pf,Af=nu,If=g,Tf=G,_f=Ds,Nf=function(e,t,r,n){t+=" Iterator";return e.prototype=Ef(mf,{next:wf(+!n,r)}),bf(e,t,!1),Af[t]=lf,e},Pf=b,Of=wp,Mf=pf,Sf=Fa,Cf=$s,Wl=zs,Rf=nu,Uf=E.PROPER,kf=E.CONFIGURABLE,xf=df.IteratorPrototype,Df=df.BUGGY_SAFARI_ITERATORS,Lf=Wl("iterator"),Ff="values",Vf="entries",Bf=xs,_=Fp,N=nu,Yl=j,cf=au.f,E=hf,df=ee,Kf="Array Iterator",Hf=Yl.set,jf=Yl.getterFor(Kf),Wl=E(Array,"Array",function(e,t){Hf(this,{type:Kf,target:Bf(e),index:0,kind:t})},function(){var e=jf(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),nu=N.Arguments=N.Array;if(_("keys"),_("values"),_("entries"),df&&"values"!==nu.name)try{cf(nu,"name",{value:"values"})}catch(e){}var Gf=T;w||$s(Object.prototype,"toString",w?{}.toString:function(){return"[object "+Gf(this)+"]"},{unsafe:!0});function zf(e){var e=Qf(e),t=eh.f;th&&e&&!e[rh]&&t(e,rh,{configurable:!0,get:function(){return this}})}function Yf(e,t){if(nh(t,e))return e;throw ih("Incorrect invocation")}function Jf(){}function qf(e){if(!oh(e))return!1;try{return ch(Jf,uh,e),!0}catch(e){return!1}}function Wf(e){if(!oh(e))return!1;switch(sh(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return fh||!!lh(ph,ah(e))}catch(e){return!0}}function $f(e,t){return void 0===(e=vh(e).constructor)||null==(e=vh(e)[mh])?t:gh(e)}var Xf,Zf,Yl="process"==Us(r.process),Qf=Fs,eh=au,th=ee,rh=zs("species"),nh=m,ih=TypeError,E=ha,N=Cs,oh=Ds,sh=T,ah=cu,uh=[],ch=Fs("Reflect","construct"),ph=/^\s*(?:class|function)\b/,lh=E(ph.exec),fh=!ph.exec(Jf),_=(Wf.sham=!0,!ch||N(function(){var e;return qf(qf.call)||!qf(Object)||!qf(function(){e=!0})||e})?Wf:qf),hh=_,dh=Vs,yh=TypeError,vh=qs,gh=function(e){if(hh(e))return e;throw yh(dh(e)+" is not a constructor")},mh=zs("species"),df=Function.prototype,Eh=df.apply,wh=df.call,cf="object"==typeof Reflect&&Reflect.apply||(t?wh.bind(Eh):function(){return wh.apply(Eh,arguments)}),nu=ha([].slice),bh=TypeError,w=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ma),Ah=r,Ih=cf,m=Mp,Th=Ds,_h=Xa,T=Cs,Nh=I,Ph=nu,Oh=Js,Mh=function(e,t){if(e<t)throw bh("Not enough arguments");return e},E=w,N=Yl,df=Ah.setImmediate,t=Ah.clearImmediate,Sh=Ah.process,Ch=Ah.Dispatch,Rh=Ah.Function,I=Ah.MessageChannel,Uh=Ah.String,kh=0,xh={},Dh="onreadystatechange";try{Xf=Ah.location}catch(e){}function Lh(e){return function(){ed(e)}}function Fh(e){ed(e.data)}function Vh(e){Ah.postMessage(Uh(e),Xf.protocol+"//"+Xf.host)}function Bh(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}function Kh(){this.head=null,this.tail=null}function Hh(e){var r,n;this.promise=new e(function(e,t){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=e,n=t}),this.resolve=dd(r),this.reject=dd(n)}function jh(e,t){var r,n,i,o,s=t.value,a=t.state==Hd,u=a?e.ok:e.fail,c=e.resolve,p=e.reject,l=e.domain;try{u?(a||(t.rejection===zd&&(o=t,gd(Id,vd,function(){var e=o.facade;yd?Dd.emit("rejectionHandled",e):qd(Kd,e,o.value)})),t.rejection=Gd),!0===u?r=s:(l&&l.enter(),r=u(s),l&&(l.exit(),i=!0)),r===e.promise?p(kd("Promise-chain cycle")):(n=Yd(r))?gd(n,r,c,p):c(r)):p(s)}catch(e){l&&!i&&l.exit(),p(e)}}var Gh,zh,Yh,Jh,qh,Wh,$h,Xh,Zh,Qh,ed=function(e){var t;_h(xh,e)&&(t=xh[e],delete xh[e],t())},I=(df&&t||(df=function(e){Mh(arguments.length,1);var t=Th(e)?e:Rh(e),r=Ph(arguments,1);return xh[++kh]=function(){Ih(t,void 0,r)},Zf(kh),kh},t=function(e){delete xh[e]},N?Zf=function(e){Sh.nextTick(Lh(e))}:Ch&&Ch.now?Zf=function(e){Ch.now(Lh(e))}:I&&!E?(E=(N=new I).port2,N.port1.onmessage=Fh,Zf=m(E.postMessage,E)):Ah.addEventListener&&Th(Ah.postMessage)&&!Ah.importScripts&&Xf&&"file:"!==Xf.protocol&&!T(Vh)?(Zf=Vh,Ah.addEventListener("message",Fh,!1)):Zf=Dh in Oh("script")?function(e){Nh.appendChild(Oh("script"))[Dh]=function(){Nh.removeChild(this),ed(e)}}:function(e){setTimeout(Lh(e),0)}),{set:df,clear:t}),N=r,m=/ipad|iphone|ipod/i.test(Ma)&&void 0!==N.Pebble,E=/web0s(?!.*chrome)/i.test(Ma),T=r,df=Mp,t=e.f,td=I.set,N=w,e=m,w=E,rd=Yl,m=T.MutationObserver||T.WebKitMutationObserver,E=T.document,nd=T.process,id=T.Promise,t=t(T,"queueMicrotask"),t=t&&t.value,w=(t||(Gh=function(){var e,t;for(rd&&(e=nd.domain)&&e.exit();zh;){t=zh.fn,zh=zh.next;try{t()}catch(e){throw zh?Jh():Yh=void 0,e}}Yh=void 0,e&&e.enter()},Jh=N||rd||w||!m||!E?!e&&id&&id.resolve?((N=id.resolve(void 0)).constructor=id,$h=df(N.then,N),function(){$h(Gh)}):rd?function(){nd.nextTick(Gh)}:(td=df(td,T),function(){td(Gh)}):(qh=!0,Wh=E.createTextNode(""),new m(Gh).observe(Wh,{characterData:!0}),function(){Wh.data=qh=!qh})),t||function(e){e={fn:e,next:void 0};Yh&&(Yh.next=e),zh||(zh=e,Jh()),Yh=e}),od=r,e=(Kh.prototype={add:function(e){e={item:e,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},Kh),id=r.Promise,N="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,df=!N&&!Yl&&"object"==typeof window&&"object"==typeof document,T=r,sd=id,E=Ds,m=nc,ad=cu,t=zs,ud=df,cd=N,pd=Ca,ld=(sd&&sd.prototype,t("species")),fd=!1,hd=E(T.PromiseRejectionEvent),cu={CONSTRUCTOR:m("Promise",function(){var e=ad(sd),t=e!==String(sd);if(!t&&66===pd)return!0;if(!pd||pd<51||!/native code/.test(e)){var e=new sd(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((e.constructor={})[ld]=r,!(fd=e.then(function(){})instanceof r))return!0}return!t&&(ud||cd)&&!hd}),REJECTION_EVENT:hd,SUBCLASSING:fd},df={},dd=Bs,N=(df.f=function(e){return new Hh(e)},g),yd=Yl,vd=r,gd=G,t=$s,E=wp,T=pf,m=zf,md=Bs,Ed=Ds,wd=Ls,bd=Yf,Ad=$f,Id=I.set,Td=w,_d=function(e,t){var r=od.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},Nd=Bh,Pd=e,I=j,w=id,e=df,Od="Promise",P=cu.CONSTRUCTOR,Md=cu.REJECTION_EVENT,O=cu.SUBCLASSING,Sd=I.getterFor(Od),Cd=I.set,I=w&&w.prototype,Rd=w,Ud=I,kd=vd.TypeError,xd=vd.document,Dd=vd.process,Ld=e.f,Fd=Ld,Vd=!!(xd&&xd.createEvent&&vd.dispatchEvent),Bd="unhandledrejection",Kd="rejectionhandled",Hd=1,jd=2,Gd=1,zd=2,Yd=function(e){var t;return!(!wd(e)||!Ed(t=e.then))&&t},Jd=function(r,i){r.notified||(r.notified=!0,Td(function(){for(var e,n,t=r.reactions;e=t.get();)jh(e,r);r.notified=!1,i&&!r.rejection&&(n=r,gd(Id,vd,function(){var e=n.facade,t=n.value,r=Wd(n);if(r&&(r=Nd(function(){yd?Dd.emit("unhandledRejection",t,e):qd(Bd,e,t)}),n.rejection=yd||Wd(n)?zd:Gd,r.error))throw r.value}))}))},qd=function(e,t,r){var n;Vd?((n=xd.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),vd.dispatchEvent(n)):n={promise:t,reason:r},!Md&&(t=vd["on"+e])?t(n):e===Bd&&_d("Unhandled promise rejection",r)},Wd=function(e){return e.rejection!==Gd&&!e.parent},$d=function(t,r,n){return function(e){t(r,e,n)}},Xd=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=jd,Jd(e,!0))},Zd=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw kd("Promise can't be resolved itself");var n=Yd(e);n?Td(function(){var t={done:!1};try{gd(n,e,$d(Zd,t,r),$d(Xd,t,r))}catch(e){Xd(t,e,r)}}):(r.value=e,r.state=Hd,Jd(r,!1))}catch(e){Xd({done:!1},e,r)}}};if(P&&(Ud=(Rd=function(e){bd(this,Ud),md(e),gd(Xh,this);var t=Sd(this);try{e($d(Zd,t),$d(Xd,t))}catch(e){Xd(t,e)}}).prototype,(Xh=function(e){Cd(this,{type:Od,done:!1,notified:!1,parent:!1,reactions:new Pd,rejection:!1,state:0,value:void 0})}).prototype=t(Ud,"then",function(e,t){var r=Sd(this),n=Ld(Ad(this,Rd));return r.parent=!0,n.ok=!Ed(e)||e,n.fail=Ed(t)&&t,n.domain=yd?Dd.domain:void 0,0==r.state?r.reactions.add(n):Td(function(){jh(n,r)}),n.promise}),Zh=function(){var e=new Xh,t=Sd(e);this.promise=e,this.resolve=$d(Zd,t),this.reject=$d(Xd,t)},e.f=Ld=function(e){return e===Rd||void 0===e?new Zh:Fd(e)},Ed(w)&&I!==Object.prototype)){Qh=I.then,O||t(I,"then",function(e,t){var r=this;return new Rd(function(e,t){gd(Qh,r,e,t)}).then(e,t)},{unsafe:!0});try{delete I.constructor}catch(e){}E&&E(I,Ud)}N({global:!0,constructor:!0,wrap:!0,forced:P},{Promise:Rd}),T(Rd,Od,!1),m(Od);var Qd=zs("iterator"),ey=!1;try{var ty=0,M={next:function(){return{done:!!ty++}},return:function(){ey=!0}};M[Qd]=function(){return this},Array.from(M,function(){throw 2})}catch(e){}function ry(e,t){if(!t&&!ey)return!1;var r=!1;try{var n={};n[Qd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}var ny=id,e=ry,w=cu.CONSTRUCTOR||!e(function(e){ny.all(e).then(void 0,function(){})}),iy=G,oy=Bs,sy=df,ay=Bh,uy=xp,O=(g({target:"Promise",stat:!0,forced:w},{all:function(e){var a=this,t=sy.f(a),u=t.resolve,c=t.reject,r=ay(function(){var n=oy(a.resolve),i=[],o=0,s=1;uy(e,function(e){var t=o++,r=!1;s++,iy(n,a,e).then(function(e){r||(r=!0,i[t]=e,--s||u(i))},c)}),--s||u(i)});return r.error&&c(r.value),t.promise}}),g),t=id,E=Fs,I=Ds,N=$s,P=t&&t.prototype;O({target:"Promise",proto:!0,forced:cu.CONSTRUCTOR,real:!0},{catch:function(e){return this.then(void 0,e)}}),I(t)&&(T=E("Promise").prototype.catch,P.catch!==T&&N(P,"catch",T,{unsafe:!0}));var cy=G,py=Bs,ly=df,fy=Bh,hy=xp;g({target:"Promise",stat:!0,forced:w},{race:function(e){var r=this,n=ly.f(r),i=n.reject,t=fy(function(){var t=py(r.resolve);hy(e,function(e){cy(t,r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}});function dy(e,t){return gy(e),my(t)&&t.constructor===e?t:((0,(e=Ey.f(e)).resolve)(t),e.promise)}var yy=G,vy=df,gy=(g({target:"Promise",stat:!0,forced:cu.CONSTRUCTOR},{reject:function(e){var t=vy.f(this);return yy(t.reject,void 0,e),t.promise}}),qs),my=Ls,Ey=df,m=g,M=Fs,e=cu.CONSTRUCTOR,wy=dy;M("Promise"),m({target:"Promise",stat:!0,forced:e},{resolve:function(e){return wy(this,e)}});var by=G,Ay=Bs,Iy=df,Ty=Bh,_y=xp;g({target:"Promise",stat:!0},{allSettled:function(e){var a=this,t=Iy.f(a),u=t.resolve,r=t.reject,n=Ty(function(){var n=Ay(a.resolve),i=[],o=0,s=1;_y(e,function(e){var t=o++,r=!1;s++,by(n,a,e).then(function(e){r||(r=!0,i[t]={status:"fulfilled",value:e},--s||u(i))},function(e){r||(r=!0,i[t]={status:"rejected",reason:e},--s||u(i))})}),--s||u(i)});return n.error&&r(n.value),t.promise}});function Ny(i){return function(e,t){var r,e=By(Ky(e)),t=Vy(t),n=e.length;return t<0||n<=t?i?"":void 0:(r=jy(e,t))<55296||56319<r||t+1===n||(n=jy(e,t+1))<56320||57343<n?i?Hy(e,t):r:i?Gy(e,t,t+2):n-56320+(r-55296<<10)+65536}}var Py=G,Oy=Bs,My=Fs,Sy=df,Cy=Bh,Ry=xp,Uy="No one promise resolved",O=(g({target:"Promise",stat:!0},{any:function(e){var u=this,c=My("AggregateError"),t=Sy.f(u),p=t.resolve,l=t.reject,r=Cy(function(){var n=Oy(u.resolve),i=[],o=0,s=1,a=!1;Ry(e,function(e){var t=o++,r=!1;s++,Py(n,u,e).then(function(e){r||a||(a=!0,p(e))},function(e){r||a||(r=!0,i[t]=e,--s||l(new c(i,Uy)))})}),--s||l(new c(i,Uy))});return r.error&&l(r.value),t.promise}}),g),I=id,t=Cs,ky=Fs,xy=Ds,Dy=$f,Ly=dy,E=$s,Fy=I&&I.prototype,P=(O({target:"Promise",proto:!0,real:!0,forced:!!I&&t(function(){Fy.finally.call({then:function(){}},function(){})})},{finally:function(t){var r=Dy(this,ky("Promise")),e=xy(t);return this.then(e?function(e){return Ly(r,t()).then(function(){return e})}:t,e?function(e){return Ly(r,t()).then(function(){throw e})}:t)}}),xy(I)&&(N=ky("Promise").prototype.finally,Fy.finally!==N&&E(Fy,"finally",N,{unsafe:!0})),ha),Vy=Xs,By=Dp,Ky=ks,Hy=P("".charAt),jy=P("".charCodeAt),Gy=P("".slice),zy={codeAt:Ny(!1),charAt:Ny(!0)}.charAt,Yy=Dp,T=j,w=hf,Jy="String Iterator",qy=T.set,Wy=T.getterFor(Jy);w(String,"String",function(e){qy(this,{type:Jy,string:Yy(e),index:0})},function(){var e=Wy(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=zy(t,r),e.index+=t.length,{value:t,done:!1})});function $y(t,e){if(t){if(t[rv]!==iv)try{tv(t,rv,iv)}catch(e){t[rv]=iv}if(t[nv]||tv(t,nv,e),Qy[e])for(var r in ev)if(t[r]!==ev[r])try{tv(t,r,ev[r])}catch(e){t[r]=ev[r]}}}var Xy,cu=r,M=cu.Promise,m=Js("span").classList,e=m&&m.constructor&&m.constructor.prototype,id=e===Object.prototype?void 0:e,Zy=r,Qy={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},O=id,ev=Wl,tv=Fa,t=zs,rv=t("iterator"),nv=t("toStringTag"),iv=ev.values;for(Xy in Qy)$y(Zy[Xy]&&Zy[Xy].prototype,Xy);$y(O,"DOMTokenList");var I,E,N=E=I=M,P,ov=df,sv=Bh,av=((P=g)({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=ov.f(this),e=sv(e);return(e.error?t.reject:t.resolve)(e.value),t.promise}}),qs),uv=Up,cv=Ys,pv=au,lv=Rs,T,fv=Mp,hv=G,dv=js,yv=function(t,e,r,n){try{return n?e(av(r)[0],r[1]):e(r)}catch(e){uv(t,"throw",e)}},vv=Sp,gv=_,mv=Qs,Ev=T=function(e,t,r){t=cv(t);t in e?pv.f(e,t,lv(0,r)):e[t]=r},wv=Rp,bv=Cp,Av=Array,w=g,m=function(e){var t,r,n,i,o,s,a=dv(e),e=gv(this),u=arguments.length,c=1<u?arguments[1]:void 0,p=void 0!==c,u=(p&&(c=fv(c,2<u?arguments[2]:void 0)),bv(a)),l=0;if(!u||this===Av&&vv(u))for(t=mv(a),r=e?new this(t):Av(t);l<t;l++)s=p?c(a[l],l):a[l],Ev(r,l,s);else for(o=(i=wv(a,u)).next,r=e?new this:[];!(n=hv(o,i)).done;l++)s=p?yv(i,c,[n.value,l],!0):n.value,Ev(r,l,s);return r.length=l,r},e,id=!(e=ry)(function(e){Array.from(e)}),Iv=(w({target:"Array",stat:!0,forced:id},{from:m}),Us),Wl=Array.isArray||function(e){return"Array"==Iv(e)},Fa,t,O=((Fa=g)({target:"Array",stat:!0},{isArray:t=Wl}),g),M=Cs,Tv=_,_v=T,Nv=Array,I=M(function(){function e(){}return!(Nv.of.call(e)instanceof e)}),Pv=(O({target:"Array",stat:!0,forced:I},{of:function(){for(var e=0,t=arguments.length,r=new(Tv(this)?this:Nv)(t);e<t;)_v(r,e,arguments[e++]);return r.length=t,r}}),js),Ov=Qs,Mv=Xs,E=Fp,Sv=(g({target:"Array",proto:!0},{at:function(e){var t=Pv(this),r=Ov(t),e=Mv(e),e=0<=e?e:r+e;return e<0||r<=e?void 0:t[e]}}),E("at"),TypeError),N=function(e){if(9007199254740991<e)throw Sv("Maximum allowed index exceeded");return e},Cv=Wl,Rv=_,Uv=Ls,kv=zs("species"),xv=Array,Dv=function(e){var t;return Cv(e)&&(t=e.constructor,(Rv(t)&&(t===xv||Cv(t.prototype))||Uv(t)&&null===(t=t[kv]))&&(t=void 0)),void 0===t?xv:t},df=function(e,t){return new(Dv(e))(0===t?0:t)},Lv=Cs,Fv=Ca,Vv=zs("species"),P,e=g,w=Cs,Bv=Wl,Kv=Ls,Hv=js,jv=Qs,Gv=N,zv=T,Yv=df,id=P=function(t){return 51<=Fv||!Lv(function(){var e=[];return(e.constructor={})[Vv]=function(){return{foo:1}},1!==e[t](Boolean).foo})},m=Ca,Jv=zs("isConcatSpreadable"),Fa=51<=m||!w(function(){var e=[];return e[Jv]=!1,e.concat()[0]!==e}),t=id("concat"),qv=(e({target:"Array",proto:!0,arity:1,forced:!Fa||!t},{concat:function(e){for(var t,r,n,i=Hv(this),o=Yv(i,0),s=0,a=-1,u=arguments.length;a<u;a++)if(function(e){if(!Kv(e))return!1;var t=e[Jv];return void 0!==t?!!t:Bv(e)}(n=-1===a?i:arguments[a]))for(r=jv(n),Gv(s+r),t=0;t<r;t++,s++)t in n&&zv(o,s,n[t]);else Gv(s+1),zv(o,s++,n);return o.length=s,o}}),Vs),Wv=TypeError,M,$v=js,Xv=Zs,Zv=Qs,Qv=M=function(e,t){if(!delete e[t])throw Wv("Cannot delete property "+qv(t)+" of "+qv(e))},eg=Math.min,O=Fp,tg=(g({target:"Array",proto:!0},{copyWithin:[].copyWithin||function(e,t){var r=$v(this),n=Zv(r),i=Xv(e,n),o=Xv(t,n),e=2<arguments.length?arguments[2]:void 0,s=eg((void 0===e?n:Xv(e,n))-o,n-i),a=1;for(o<i&&i<o+s&&(a=-1,o+=s-1,i+=s-1);0<s--;)o in r?r[i]=r[o]:Qv(r,i),i+=a,o+=a;return r}}),O("copyWithin"),Mp),rg=ya,ng=js,ig=Qs,og=df,sg=ha([].push),I,E={forEach:(I=function(f){var h=1==f,d=2==f,y=3==f,v=4==f,g=6==f,m=7==f,E=5==f||g;return function(e,t,r,n){for(var i,o,s=ng(e),a=rg(s),u=tg(t,r),c=ig(a),p=0,t=n||og,l=h?t(e,c):d||m?t(e,0):void 0;p<c;p++)if((E||p in a)&&(o=u(i=a[p],p,s),f))if(h)l[p]=o;else if(o)switch(f){case 3:return!0;case 5:return i;case 6:return p;case 2:sg(l,i)}else switch(f){case 4:return!1;case 7:sg(l,i)}return g?-1:y||v?v:l}})(0),map:I(1),filter:I(2),some:I(3),every:I(4),find:I(5),findIndex:I(6),filterReject:I(7)},ag=Cs,m=function(e,t){var r=[][e];return!!r&&ag(function(){r.call(null,t||function(){return 1},1)})},w=g,ug=E.every,cg=(w({target:"Array",proto:!0,forced:!m("every")},{every:function(e){return ug(this,e,1<arguments.length?arguments[1]:void 0)}}),js),pg=Zs,lg=Qs,id=Fp,e=(g({target:"Array",proto:!0},{fill:function(e){for(var t=cg(this),r=lg(t),n=arguments.length,i=pg(1<n?arguments[1]:void 0,r),n=2<n?arguments[2]:void 0,o=void 0===n?r:pg(n,r);i<o;)t[i++]=e;return t}}),id("fill"),g),fg=E.filter,Fa=(e({target:"Array",proto:!0,forced:!P("filter")},{filter:function(e){return fg(this,e,1<arguments.length?arguments[1]:void 0)}}),g),hg=E.find,t=Fp,O,dg=!0,I=((O="find")in[]&&Array(1)[O](function(){dg=!1}),Fa({target:"Array",proto:!0,forced:dg},{find:function(e){return hg(this,e,1<arguments.length?arguments[1]:void 0)}}),t(O),g),yg=E.findIndex,w=Fp,id,vg=!0,gg=((id="findIndex")in[]&&Array(1)[id](function(){vg=!1}),I({target:"Array",proto:!0,forced:vg},{findIndex:function(e){return yg(this,e,1<arguments.length?arguments[1]:void 0)}}),w(id),Mp),mg=ya,Eg=js,wg=Qs,e,Fa={findLast:(e=function(u){var c=1==u;return function(e,t,r){for(var n,i=Eg(e),o=mg(i),s=gg(t,r),a=wg(o);0<a--;)if(s(n=o[a],a,i))switch(u){case 0:return n;case 1:return a}return c?-1:void 0}})(0),findLastIndex:e(1)},t=g,bg=Fa.findLast,O=Fp,I=(t({target:"Array",proto:!0},{findLast:function(e){return bg(this,e,1<arguments.length?arguments[1]:void 0)}}),O("findLast"),g),Ag=Fa.findLastIndex,w=Fp,Ig=(I({target:"Array",proto:!0},{findLastIndex:function(e){return Ag(this,e,1<arguments.length?arguments[1]:void 0)}}),w("findLastIndex"),Wl),Tg=Qs,_g=N,Ng=Mp,Pg=function(e,t,r,n,i,o,s,a){for(var u,c,p=i,l=0,f=!!s&&Ng(s,a);l<n;)l in r&&(u=f?f(r[l],l,t):r[l],0<o&&Ig(u)?(c=Tg(u),p=Pg(e,t,u,c,p,o-1)-1):(_g(p+1),e[p]=u),p++),l++;return p},id,Og=id=Pg,Mg=js,Sg=Qs,Cg=Xs,Rg=df;g({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=Mg(this),r=Sg(t),n=Rg(t,0);return n.length=Og(n,t,t,r,0,void 0===e?1:Cg(e)),n}});function Ug(c){return function(e,t,r,n){om(t);var i=sm(e),o=am(i),s=um(i),a=c?s-1:0,u=c?-1:1;if(r<2)for(;;){if(a in o){n=o[a],a+=u;break}if(a+=u,c?a<0:s<=a)throw cm("Reduce of empty array with no initial value")}for(;c?0<=a:a<s;a+=u)a in o&&(n=t(n,o[a],a,i));return n}}function kg(e,t,r){for(var n=Pm(e),i=Nm(t,n),o=Nm(void 0===r?n:r,n),s=Mm(Sm(o-i,0)),a=0;i<o;i++,a++)Om(s,a,e[i]);return s.length=a,s}function xg(e,t){var r=e.length,n=Rm(r/2);if(r<8){for(var i,o,s=e,a=t,u=s.length,c=1;c<u;){for(i=s[o=c];o&&0<a(s[o-1],i);)s[o]=s[--o];o!==c++&&(s[o]=i)}return s}for(var p=e,l=xg(Cm(e,0,n),t),f=xg(Cm(e,n),t),h=t,d=l.length,y=f.length,v=0,g=0;v<d||g<y;)p[v+g]=v<d&&g<y?h(l[v],f[g])<=0?l[v++]:f[g++]:v<d?l[v++]:f[g++];return p}var Dg=id,Lg=Bs,Fg=js,Vg=Qs,Bg=df,Kg=(g({target:"Array",proto:!0},{flatMap:function(e){var t,r=Fg(this),n=Vg(r);return Lg(e),(t=Bg(r,0)).length=Dg(t,r,r,n,0,1,e,1<arguments.length?arguments[1]:void 0),t}}),E.forEach),e=m("forEach")?[].forEach:function(e){return Kg(this,e,1<arguments.length?arguments[1]:void 0)},t=(g({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e}),g),Hg=ic.includes,O=Fp,Fa=(t({target:"Array",proto:!0,forced:Cs(function(){return!Array(1).includes()})},{includes:function(e){return Hg(this,e,1<arguments.length?arguments[1]:void 0)}}),O("includes"),g),I=ha,jg=ic.indexOf,w=m,Gg=I([].indexOf),zg=!!Gg&&1/Gg([1],1,-0)<0,id=w("indexOf"),e=(Fa({target:"Array",proto:!0,forced:zg||!id},{indexOf:function(e){var t=1<arguments.length?arguments[1]:void 0;return zg?Gg(this,e,t)||0:jg(this,e,t)}}),g),t=ya,Yg=xs,O=m,Jg=ha([].join),ic=t!=Object,I=O("join",","),qg=(e({target:"Array",proto:!0,forced:ic||!I},{join:function(e){return Jg(Yg(this),void 0===e?",":e)}}),cf),Wg=xs,$g=Xs,Xg=Qs,w=m,Zg=Math.min,Qg=[].lastIndexOf,em=!!Qg&&1/[1].lastIndexOf(1,-0)<0,Fa=w("lastIndexOf"),id=em||!Fa?function(e){if(em)return qg(Qg,this,arguments)||0;var t=Wg(this),r=Xg(t),n=r-1;for((n=1<arguments.length?Zg(n,$g(arguments[1])):n)<0&&(n=r+n);0<=n;n--)if(n in t&&t[n]===e)return n||0;return-1}:Qg,t=(g({target:"Array",proto:!0,forced:id!==[].lastIndexOf},{lastIndexOf:id}),g),tm=E.map,O=(t({target:"Array",proto:!0,forced:!P("map")},{map:function(e){return tm(this,e,1<arguments.length?arguments[1]:void 0)}}),g),rm=js,nm=Qs,im=N,e=Cs(function(){return 4294967297!==[].push.call({length:4294967296},1)}),ic=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}(),om=(O({target:"Array",proto:!0,arity:1,forced:e||ic},{push:function(e){var t=rm(this),r=nm(t),n=arguments.length;im(r+n);for(var i=0;i<n;i++)t[r]=arguments[i],r++;return t.length=r}}),Bs),sm=js,am=ya,um=Qs,cm=TypeError,I={left:Ug(!1),right:Ug(!0)},cf=g,pm=I.left,w=Ca,Fa=Yl,id=(cf({target:"Array",proto:!0,forced:!m("reduce")||!Fa&&79<w&&w<83},{reduce:function(e){var t=arguments.length;return pm(this,e,t,1<t?arguments[1]:void 0)}}),g),lm=I.right,t=Ca,O=Yl,e=(id({target:"Array",proto:!0,forced:!m("reduceRight")||!O&&79<t&&t<83},{reduceRight:function(e){return lm(this,e,arguments.length,1<arguments.length?arguments[1]:void 0)}}),g),fm=Wl,hm=ha([].reverse),ic=[1,2],cf=(e({target:"Array",proto:!0,forced:String(ic)===String(ic.reverse())},{reverse:function(){return fm(this)&&(this.length=this.length),hm(this)}}),g),dm=Wl,ym=_,vm=Ls,gm=Zs,mm=Qs,Em=xs,wm=T,Fa=zs,bm=nu,w=P("slice"),Am=Fa("species"),Im=Array,Tm=Math.max,I=(cf({target:"Array",proto:!0,forced:!w},{slice:function(e,t){var r,n,i,o=Em(this),s=mm(o),a=gm(e,s),u=gm(void 0===t?s:t,s);if(dm(o)&&(r=o.constructor,(r=ym(r)&&(r===Im||dm(r.prototype))||vm(r)&&null===(r=r[Am])?void 0:r)===Im||void 0===r))return bm(o,a,u);for(n=new(void 0===r?Im:r)(Tm(u-a,0)),i=0;a<u;a++,i++)a in o&&wm(n,i,o[a]);return n.length=i,n}}),g),_m=E.some,Nm=(I({target:"Array",proto:!0,forced:!m("some")},{some:function(e){return _m(this,e,1<arguments.length?arguments[1]:void 0)}}),Zs),Pm=Qs,Om=T,Mm=Array,Sm=Math.max,Cm=kg,Rm=Math.floor,Yl=xg,id=Ma.match(/firefox\/(\d+)/i),O=!!id&&+id[1],t=/MSIE|Trident/.test(Ma),e=Ma.match(/AppleWebKit\/(\d+)\./),ic=!!e&&+e[1],nu=g,Fa=ha,Um=Bs,km=js,xm=Qs,Dm=M,Lm=Dp,cf=Cs,Fm=Yl,w=m,Vm=O,Bm=t,Km=Ca,Hm=ic,jm=[],Gm=Fa(jm.sort),zm=Fa(jm.push),I=cf(function(){jm.sort(void 0)}),id=cf(function(){jm.sort(null)}),Ma=w("sort"),Ym=!cf(function(){if(Km)return Km<70;if(!(Vm&&3<Vm)){if(Bm)return!0;if(Hm)return Hm<603;for(var e,t,r,n="",i=65;i<76;i++){switch(e=String.fromCharCode(i),i){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(r=0;r<47;r++)jm.push({k:e+r,v:t})}for(jm.sort(function(e,t){return t.v-e.v}),r=0;r<jm.length;r++)e=jm[r].k.charAt(0),n.charAt(n.length-1)!==e&&(n+=e);return"DGBEFHACIJK"!==n}});nu({target:"Array",proto:!0,forced:I||!id||!Ma||!Ym},{sort:function(e){void 0!==e&&Um(e);var t=km(this);if(Ym)return void 0===e?Gm(t):Gm(t,e);for(var r,n,i=[],o=xm(t),s=0;s<o;s++)s in t&&zm(i,t[s]);for(Fm(i,(n=e,function(e,t){return void 0===t?-1:void 0===e?1:void 0!==n?+n(e,t)||0:Lm(e)>Lm(t)?1:-1})),r=i.length,s=0;s<r;)t[s]=i[s++];for(;s<o;)Dm(t,s++);return t}});zf("Array");var e=g,Jm=js,qm=Zs,Wm=Xs,$m=Qs,Xm=N,Zm=df,Qm=T,eE=M,Yl=P("splice"),tE=Math.max,rE=Math.min;e({target:"Array",proto:!0,forced:!Yl},{splice:function(e,t){var r,n,i,o,s,a,u=Jm(this),c=$m(u),p=qm(e,c),e=arguments.length;for(0===e?r=n=0:n=1===e?(r=0,c-p):(r=e-2,rE(tE(Wm(t),0),c-p)),Xm(c+r-n),i=Zm(u,n),o=0;o<n;o++)(s=p+o)in u&&Qm(i,o,u[s]);if(r<(i.length=n)){for(o=p;o<c-n;o++)a=o+r,(s=o+n)in u?u[a]=u[s]:eE(u,a);for(o=c;c-n+r<o;o--)eE(u,o-1)}else if(n<r)for(o=c-n;p<o;o--)a=o+r-1,(s=o+n-1)in u?u[a]=u[s]:eE(u,a);for(o=0;o<r;o++)u[o+p]=arguments[o+2];return u.length=c-n+r,i}}),Fp("flat");Fp("flatMap");var O=g,nE=js,iE=Qs,oE=M,sE=N,t=1!==[].unshift(0),Ca=!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}();O({target:"Array",proto:!0,arity:1,forced:t||Ca},{unshift:function(e){var t=nE(this),r=iE(t),n=arguments.length;if(n){sE(r+n);for(var i=r;i--;){var o=i+n;i in t?t[o]=t[i]:oE(t,o)}for(var s=0;s<n;s++)t[s]=arguments[s]}return t.length=r+n}});cu.Array;var ic={exports:{}},Fa={},aE=Us,uE=xs,cE=Ra.f,pE=kg,lE="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Fa.f=function(e){if(!lE||"Window"!=aE(e))return cE(uE(e));try{return cE(e)}catch(e){return pE(lE)}};function fE(e){TE(e,SE,{value:{objectID:"O"+CE++,weakData:{}}})}function hE(e,t,r){for(var n in t)$E(e,n,t[n],r);return e}function dE(e,t){for(var r=0,n=cw(t),i=new e(n);r<n;)i[r]=t[r++];return i}function yE(e,t,r,n){for(var i,o,s,a=fw(e),u=lw(a),c=pw(t,r),p=yw(null),l=dw(u),f=0;f<l;f++)s=u[f],(o=hw(c(s,f,a)))in p?mw(p[o],s):p[o]=[s];if(n&&(i=n(a))!==gw)for(o in p)p[o]=vw(i,p[o]);return p}var w=Cs(function(){var e;"function"==typeof ArrayBuffer&&(e=new ArrayBuffer(8),Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8}))}),cf=Cs,vE=Ls,gE=Us,mE=w,EE=Object.isExtensible,nu=cf(function(){EE(1)})||mE?function(e){return!!vE(e)&&((!mE||"ArrayBuffer"!=gE(e))&&(!EE||EE(e)))}:EE,I=!Cs(function(){return Object.isExtensible(Object.preventExtensions({}))}),wE=g,bE=ha,id=Xu,AE=Ls,IE=Xa,TE=au.f,_E=Ra,NE=Fa,PE=nu,OE=I,ME=!1,SE=Gs("meta"),CE=0,RE=ic.exports={enable:function(){RE.enable=function(){},ME=!0;var i=_E.f,o=bE([].splice),e={};e[SE]=1,i(e).length&&(_E.f=function(e){for(var t=i(e),r=0,n=t.length;r<n;r++)if(t[r]===SE){o(t,r,1);break}return t},wE({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:NE.f}))},fastKey:function(e,t){if(!AE(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!IE(e,SE)){if(!PE(e))return"F";if(!t)return"E";fE(e)}return e[SE].objectID},getWeakData:function(e,t){if(!IE(e,SE)){if(!PE(e))return!0;if(!t)return!1;fE(e)}return e[SE].weakData},onFreeze:function(e){return OE&&ME&&PE(e)&&!IE(e,SE)&&fE(e),e}},UE=(id[SE]=!0,Ds),kE=Ls,xE=wp,DE=g,LE=r,FE=ha,VE=nc,BE=$s,KE=ic.exports,HE=xp,jE=Yf,GE=Ds,zE=Ls,YE=Cs,JE=ry,qE=pf,WE=function(e,t,r){return xE&&UE(t=t.constructor)&&t!==r&&kE(t=t.prototype)&&t!==r.prototype&&xE(e,t),e},$E=$s,XE=au.f,ZE=A,QE=hE,ew=Mp,tw=Yf,rw=xp,nw=hf,iw=zf,ow=ee,sw=ic.exports.fastKey,aw=j.set,uw=j.getterFor,cw=(function(e,t,r){function n(e){var r=FE(h[e]);BE(h,e,"add"==e?function(e){return r(this,0===e?0:e),this}:"delete"==e?function(e){return!(p&&!zE(e))&&r(this,0===e?0:e)}:"get"==e?function(e){return p&&!zE(e)?void 0:r(this,0===e?0:e)}:"has"==e?function(e){return!(p&&!zE(e))&&r(this,0===e?0:e)}:function(e,t){return r(this,0===e?0:e,t),this})}var i,o,s,a,u,c=-1!==e.indexOf("Map"),p=-1!==e.indexOf("Weak"),l=c?"set":"add",f=LE[e],h=f&&f.prototype,d=f,y={};return VE(e,!GE(f)||!(p||h.forEach&&!YE(function(){(new f).entries().next()})))?(d=r.getConstructor(t,e,c,l),KE.enable()):VE(e,!0)&&(o=(i=new d)[l](p?{}:-0,1)!=i,s=YE(function(){i.has(1)}),a=JE(function(e){new f(e)}),u=!p&&YE(function(){for(var e=new f,t=5;t--;)e[l](t,t);return!e.has(-0)}),a||(((d=t(function(e,t){jE(e,h);e=WE(new f,e,d);return null!=t&&HE(t,e[l],{that:e,AS_ENTRIES:c}),e})).prototype=h).constructor=d),(s||u)&&(n("delete"),n("has"),c&&n("get")),(u||o)&&n(l),p&&h.clear&&delete h.clear),y[e]=d,DE({global:!0,constructor:!0,forced:d!=f},y),qE(d,e),p||r.setStrong(d,e,c),d}("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},{getConstructor:function(e,r,n,i){function o(e,t,r){var n,i=u(e),o=s(e,t);return o?o.value=r:(i.last=o={index:n=sw(t,!0),key:t,value:r,previous:t=i.last,next:void 0,removed:!1},i.first||(i.first=o),t&&(t.next=o),ow?i.size++:e.size++,"F"!==n&&(i.index[n]=o)),e}function s(e,t){var r,e=u(e),n=sw(t);if("F"!==n)return e.index[n];for(r=e.first;r;r=r.next)if(r.key==t)return r}var e=e(function(e,t){tw(e,a),aw(e,{type:r,index:ZE(null),first:void 0,last:void 0,size:0}),ow||(e.size=0),null!=t&&rw(t,e[i],{that:e,AS_ENTRIES:n})}),a=e.prototype,u=uw(r);return QE(a,{clear:function(){for(var e=u(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,ow?e.size=0:this.size=0},delete:function(e){var t,r,n=u(this),e=s(this,e);return e&&(t=e.next,r=e.previous,delete n.index[e.index],e.removed=!0,r&&(r.next=t),t&&(t.previous=r),n.first==e&&(n.first=t),n.last==e&&(n.last=r),ow?n.size--:this.size--),!!e},forEach:function(e){for(var t,r=u(this),n=ew(e,1<arguments.length?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),QE(a,n?{get:function(e){e=s(this,e);return e&&e.value},set:function(e,t){return o(this,0===e?0:e,t)}}:{add:function(e){return o(this,e=0===e?0:e,e)}}),ow&&XE(a,"size",{get:function(){return u(this).size}}),e},setStrong:function(e,t,r){var n=t+" Iterator",i=uw(t),o=uw(n);nw(e,t,function(e,t){aw(this,{type:n,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:{value:e.target=void 0,done:!0}},r?"entries":"values",!r,!0),iw(t)}}),Qs),pw=Mp,lw=ya,fw=js,hw=Ys,dw=Qs,yw=A,vw=dE,gw=Array,mw=ha([].push),Ew=yE,Ma=Fp;g({target:"Array",proto:!0},{group:function(e){return Ew(this,e,1<arguments.length?arguments[1]:void 0)}}),Ma("group");var ww=yE,T=Fp;g({target:"Array",proto:!0,forced:!m("groupBy")},{groupBy:function(e){return ww(this,e,1<arguments.length?arguments[1]:void 0)}}),T("groupBy");function bw(e){for(var t,r,n=Tw(this),i=Iw(n),o=Aw(e,1<arguments.length?arguments[1]:void 0),s=new Nw,a=_w(i),u=0;u<a;u++)t=o(r=i[u],u,n),Ow(s,t)?Sw(Pw(s,t),r):Mw(s,t,[r]);return s}var Aw=Mp,P=ha,Iw=ya,Tw=js,_w=Qs,Nw=Fs("Map"),e=Nw.prototype,Pw=P(e.get),Ow=P(e.has),Mw=P(e.set),Sw=P([].push),Yl=Fp,M=bw;g({target:"Array",proto:!0,name:"groupToMap",forced:!m("groupByToMap")},{groupByToMap:M}),Yl("groupByToMap");function Cw(e){return Dw[e].prototype}var O=Fp,Rw=(g({target:"Array",proto:!0},{groupToMap:bw}),O("groupToMap"),Qs),Uw=function(e,t){for(var r=Rw(e),n=new t(r),i=0;i<r;i++)n[i]=e[r-i-1];return n},kw=xs,t=Fp,xw=Array,Dw=(g({target:"Array",proto:!0},{toReversed:function(){return Uw(kw(this),xw)}}),t("toReversed"),r),Ca=g,Lw=Bs,Fw=xs,Vw=dE,cu=Fp,Bw=Array,Kw=ha(Cw("Array").sort),w=(Ca({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&Lw(e);var t=Fw(this),t=Vw(Bw,t);return Kw(t,e)}}),cu("toSorted"),g),cf=Fp,Hw=N,jw=Qs,Gw=Zs,zw=xs,Yw=Xs,Jw=Array,qw=Math.max,Ww=Math.min,$w=(w({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,o,s=zw(this),a=jw(s),u=Gw(e,a),e=arguments.length,c=0;for(0===e?r=n=0:n=1===e?(r=0,a-u):(r=e-2,Ww(qw(Yw(t),0),a-u)),i=Hw(a+r-n),o=Jw(i);c<u;c++)o[c]=s[c];for(;c<u+r;c++)o[c]=arguments[c-u+2];for(;c<i;c++)o[c]=s[c+n-r];return o}}),cf("toSpliced"),Qs),Xw=Xs,Zw=RangeError,Qw=function(e,t,r,n){var i=$w(e),r=Xw(r),o=r<0?i+r:r;if(i<=o||o<0)throw Zw("Incorrect index");for(var s=new t(i),a=0;a<i;a++)s[a]=a===o?n:e[a];return s},eb=xs,tb=Array;g({target:"Array",proto:!0},{with:function(e,t){return Qw(eb(this),tb,e,t)}});Xu=r,Xa=$a,Ra=Ds,Fa=b,nu=$s,I="USE_FUNCTION_CONSTRUCTOR",id=zs("asyncIterator"),wp=Xu.AsyncIterator,nc=Xa.AsyncIteratorPrototype;if(nc)iI=nc;else if(Ra(wp))iI=wp.prototype;else if(Xa[I]||Xu[I])try{WA=Fa(Fa(Fa(Function("return async function*(){}()")()))),Fa(WA)===Object.prototype&&(iI=WA)}catch(e){}Ra((iI=iI||{})[id])||nu(iI,id,function(){return this});function rb(e,t,r){var n=e.done;pb.resolve(e.value).then(function(e){t({done:n,value:e})},r)}function nb(e){fb(this,{type:lb,iterator:ub(e),next:e.next})}function ib(e){var f=0==e,h=1==e,d=2==e,y=3==e;return function(e,s,a){var e=Sb(e),u=Mb("Promise"),c=e.iterator,t=e.next,p=0,l=void 0!==s;return!l&&f||Nb(s),new u(function(r,n){var i=function(e){Cb(c,n,e,n)},o=function(){try{if(f&&l)try{Ob(p)}catch(e){i(e)}u.resolve(Pb(_b(t,c))).then(function(e){try{if(Pb(e).done)f?(a.length=p,r(a)):r(!y&&(d||void 0));else{var t=e.value;try{l?u.resolve(f?s(t,p):s(t)).then(function(e){if(h)o();else if(d)e?o():Cb(c,r,!1,n);else if(f)try{a[p++]=e,o()}catch(e){i(e)}else e?Cb(c,r,y||t,n):o()},i):(a[p++]=t,o())}catch(e){i(e)}}}catch(e){n(e)}},n)}catch(e){n(e)}};o()})}}function ob(e,t){if(!Jb||!Yb(e)||!Jb(e))return!1;for(var r,n=0,i=e.length;n<i;)if(!("string"==typeof(r=e[n++])||t&&void 0===r))return!1;return 0!==i}function sb(e,t,r){return r.get&&qb(r.get,t,{getter:!0}),r.set&&qb(r.set,t,{setter:!0}),Wb.f(e,t,r)}var ab=G,ub=qs,ic=A,cb=Ks,Ma=hE,T=j,ya=iI,pb=Fs("Promise"),lb="AsyncFromSyncIterator",fb=T.set,hb=T.getterFor(lb),e=(nb.prototype=Ma(ic(ya),{next:function(){var n=hb(this);return new pb(function(e,t){var r=ub(ab(n.next,n.iterator));rb(r,e,t)})},return:function(){var n=hb(this).iterator;return new pb(function(e,t){var r=cb(n,"return");if(void 0===r)return e({done:!0,value:void 0});r=ub(ab(r,n));rb(r,e,t)})}}),nb),db=G,yb=e,vb=qs,gb=Rp,mb=Ks,Eb=zs("asyncIterator"),wb=Bs,bb=qs,Ab=G,Ib=Fs,Tb=Ks,_b=G,Nb=Bs,Pb=qs,Ob=N,Mb=Fs,Sb=function(e){return{iterator:e,next:wb(bb(e).next)}},Cb=function(e,t,r,n){try{var i=Tb(e,"return");if(i)return Ib("Promise").resolve(Ab(i,e)).then(function(){t(r)},function(e){n(e)})}catch(e){return n(e)}t(r)},P={toArray:ib(0),forEach:ib(1),every:ib(2),some:ib(3),find:ib(4)},Rb=Mp,Ub=js,kb=_,xb=function(e,t){t=arguments.length<2?mb(e,Eb):t;return t?vb(db(t,e)):new yb(gb(e))},Db=Rp,Lb=Cp,Fb=Ks,m=Cw,Vb=Fs,M=zs,Bb=e,Kb=P.toArray,Hb=M("asyncIterator"),jb=m("Array").values,Yl=(g({target:"Array",stat:!0,forced:!0},{fromAsync:function(o){var s=this,e=arguments.length,a=1<e?arguments[1]:void 0,u=2<e?arguments[2]:void 0;return new(Vb("Promise"))(function(e){var t=Ub(o),r=(void 0!==a&&(a=Rb(a,u)),Fb(t,Hb)),n=r?void 0:Lb(t)||jb,i=kb(s)?new s:[],r=r?xb(t,r):new Bb(Db(t,n));e(Kb(r,a,i))})}}),g),Gb=E.filterReject,O=Fp,t=(Yl({target:"Array",proto:!0,forced:!0},{filterOut:function(e){return Gb(this,e,1<arguments.length?arguments[1]:void 0)}}),O("filterOut"),g),zb=E.filterReject,Ca=Fp,cu=(t({target:"Array",proto:!0,forced:!0},{filterReject:function(e){return zb(this,e,1<arguments.length?arguments[1]:void 0)}}),Ca("filterReject"),g),Yb=Wl,Jb=Object.isFrozen,qb=(cu({target:"Array",stat:!0,sham:!0,forced:!0},{isTemplateObject:function(e){if(!ob(e,!0))return!1;var t=e.raw;return t.length===e.length&&ob(t,!1)}}),Sa.exports),Wb=au,w=Fp,$b=js,Xb=Qs;ee&&(sb(Array.prototype,"lastItem",{configurable:!0,get:function(){var e=$b(this),t=Xb(e);return 0==t?void 0:e[t-1]},set:function(e){var t=$b(this),r=Xb(t);return t[0==r?0:r-1]=e}}),w("lastItem"));var cf=Fp,Zb=js,Qb=Qs;ee&&(sb(Array.prototype,"lastIndex",{configurable:!0,get:function(){var e=Zb(this),e=Qb(e);return 0==e?0:e-1}}),cf("lastIndex"));var r=ha,e0=Bs,t0=Qs,r0=js,n0=df,i0=Fs("Map"),$a=i0.prototype,o0=r($a.forEach),s0=r($a.has),a0=r($a.set),u0=r([].push),b=Fp;g({target:"Array",proto:!0,forced:!0},{uniqueBy:function(e){for(var t,r,n=r0(this),i=t0(n),o=n0(n,0),s=new i0,a=null!=e?e0(e):function(e){return e},u=0;u<i;u++)r=a(t=n[u]),s0(s,r)||a0(s,r,t);return o0(s,function(e){u0(o,e)}),o}}),b("uniqueBy");p0.exposure=function(e,t,r,n){return new f0(n,e,t.experiment,t.variationId,t.variationKey,t.reason,r)},p0.track=function(e,t,r,n){return new y0(n,r,e,t)},p0.remoteConfig=function(e,t,r,n){return new m0(n,e,t.parameter,t.valueId,t.reason,r)},p0.isExposureEvent=function(e){return void 0!==e.experiment},p0.isTrackEvent=function(e){return void 0!==e.eventType},p0.isRemoteConfigEvent=function(e){return void 0!==e.parameter},p0.isExposureEventDto=function(e){return"experimentId"in e&&void 0!==e.experimentId},p0.isTrackEventDto=function(e){return"eventTypeId"in e&&void 0!==e.eventTypeId},p0.isRemoteConfigEventDto=function(e){return"parameterId"in e&&void 0!==e.parameterId},p0.prototype.toDto=function(){return{insertId:this.insertId,timestamp:this.timestamp,userId:this.user.identifiers[Kt.ID],identifiers:this.user.identifiers,userProperties:ke.sanitize(this.user.properties),hackleProperties:ke.sanitize(this.user.hackleProperties)}};var c0=p0;function p0(e,t,r){void 0===r&&(r=H()),this.timestamp=e,this.user=t,this.insertId=r}i(h0,l0=c0),h0.prototype.copyWithUser=function(e){return new h0(this.timestamp,e,this.experiment,this.variationId,this.variationKey,this.decisionReason,this.properties,this.insertId)},h0.prototype.toDto=function(){return p(p({},l0.prototype.toDto.call(this)),{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(),properties:this.properties})};var l0,f0=h0;function h0(e,t,r,n,i,o,s,a){e=l0.call(this,e,t,a)||this;return e.experiment=r,e.variationId=n,e.variationKey=i,e.decisionReason=o,e.properties=s,e}i(v0,d0=c0),v0.prototype.copyWithUser=function(e){return new v0(this.timestamp,e,this.eventType,this.event,this.insertId)},v0.prototype.toDto=function(){return p(p({},d0.prototype.toDto.call(this)),{eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:ke.sanitize(this.event.properties)})};var d0,y0=v0;function v0(e,t,r,n,i){e=d0.call(this,e,t,i)||this;return e.eventType=r,e.event=n,e}i(E0,g0=c0),E0.prototype.copyWithUser=function(e){return new E0(this.timestamp,e,this.parameter,this.valueId,this.decisionReason,this.properties,this.insertId)},E0.prototype.toDto=function(){return p(p({},g0.prototype.toDto.call(this)),{parameterId:this.parameter.id,parameterKey:this.parameter.key,parameterType:this.parameter.type,valueId:this.valueId,decisionReason:this.decisionReason.toString(),properties:ke.sanitize(this.properties)})};var g0,m0=E0;function E0(e,t,r,n,i,o,s){e=g0.call(this,e,t,s)||this;return e.parameter=r,e.valueId=n,e.decisionReason=i,e.properties=o,e}b0.isSessionEvent=function(e){return!!c0.isTrackEvent(e)&&(e.event.key===b0.SESSION_START_EVENT_NAME||e.event.key===b0.SESSION_END_EVENT_NAME)},b0.prototype.onSessionStarted=function(e,t,r){this.track(b0.SESSION_START_EVENT_NAME,e,t,r)},b0.prototype.onSessionEnded=function(e,t,r){this.track(b0.SESSION_END_EVENT_NAME,e,t,r)},b0.prototype.track=function(e,t,r,n){e={key:e},r=this.userManager.toHackleUser(r),r=this.decorateSession(r,t);this.core.track(e,r,n)},b0.prototype.decorateSession=function(e,t){t=(new Gt).add(Kt.SESSION,t).addIdentifiers(e.identifiers).build();return p(p({},e),{identifiers:t})},b0.SESSION_START_EVENT_NAME="$session_start",b0.SESSION_END_EVENT_NAME="$session_end";var w0=b0;function b0(e,t){this.userManager=e,this.core=t}I0.prototype.addDecorator=function(e){this.decorators.push(e)},I0.prototype.process=function(e){w0.isSessionEvent(e)||this.sessionManager.startNewSessionIfNeeded(this.userManager.currentUser,e.timestamp),this.eventDedupDeterminer.isDedupTarget(e)||(e=this.decorators.reduce(function(e,t){return t.decorate(e)},e),this.delegate.process(e))},I0.prototype.flush=function(e){this.delegate.flush(e)},I0.prototype.close=function(){this.delegate.close()},I0.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.flush(!0);case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var A0=I0;function I0(e,t,r,n){this.delegate=e,this.eventDedupDeterminer=t,this.sessionManager=r,this.userManager=n,this.decorators=[]}_0.toEvent=function(e){var t;return{key:_0.EVENT_KEY,properties:{level:_0.LEVEL_ERROR,type:e.name,message:null!=(t=e.message)?t:"",$stacktrace:_0._stacktrace(e)}}},_0._stacktrace=function(e){return c.isNullOrUndefined(e.stack)?"":e.stack.split("\n").slice(0,_0.STACK_TRACK_LIMIT).join("\n")},_0.EVENT_KEY="$trace",_0.LEVEL_ERROR="error",_0.STACK_TRACK_LIMIT=30;var T0=_0;function _0(){}N0.prototype.evaluate=function(e,t){if(!this.supports(e))throw new Error("Unsupported EvaluatorRequest ".concat(e.toString()));var r;if(t.contains(e))throw r=t.stack.map(function(e){return e.toString()}).join(" - "),new Error("Circular evaluation has occurred [".concat(r," - ").concat(e.toString(),"]"));t.addRequest(e);try{return this.evaluateInternal(e,t)}finally{t.removeRequest(e)}};nc=N0;function N0(){}O0.prototype.with=function(e){return new O0(e,this.targetEvaluations,this.experiment,this.variationId,this.variationKey,this.config)},O0.of=function(e,t,r,n){return new O0(n,t.targetEvaluations,e.experiment,r.id,r.key,r.config)},O0.ofDefault=function(e,t,r){var n=e.experiment._getVariationByKeyOrNull(e.defaultVariationKey);return c.isNotNullOrUndefined(n)?this.of(e,t,n,r):new O0(r,t.targetEvaluations,e.experiment,void 0,e.defaultVariationKey,void 0)};var P0=O0;function O0(e,t,r,n,i,o){this.reason=e,this.targetEvaluations=t,this.experiment=r,this.variationId=n,this.variationKey=i,this.config=o}i(C0,M0=nc),C0.prototype.supports=function(e){return void 0!==e.experiment},C0.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.experimentFlowFactory.getExperimentFlow(e.experiment.type).evaluate(e,t))?r:P0.ofDefault(e,t,l.TRAFFIC_NOT_ALLOCATED)};var M0,S0=C0;function C0(e){var t=M0.call(this)||this;return t.experimentFlowFactory=e,t}U0.of=function(e,t,r,n,i,o){return o.returnValue=ke.truncateStringValue(n),new U0(i,t.targetEvaluations,e.parameter,r,n,o)},U0.ofDefault=function(e,t,r,n){return this.of(e,t,void 0,e.defaultValue,r,n)};var R0=U0;function U0(e,t,r,n,i,o){this.reason=e,this.targetEvaluations=t,this.parameter=r,this.valueId=n,this.value=i,this.properties=o}i(D0,k0=nc),D0.prototype.supports=function(e){return void 0!==e.parameter},D0.prototype.evaluateInternal=function(e,t){var r={};if(r.requestValueType=e.requiredType,r.requestDefaultValue=ke.truncateStringValue(e.defaultValue),c.isNullOrUndefined(e.user.identifiers[e.parameter.identifierType]))return R0.ofDefault(e,t,l.IDENTIFIER_NOT_FOUND,r);var n=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t);return c.isNotNullOrUndefined(n)?(r.targetRuleKey=n.key,r.targetRuleName=n.name,this.evaluation(e,t,n.value,l.TARGET_RULE_MATCH,r)):this.evaluation(e,t,e.parameter.defaultValue,l.DEFAULT_RULE,r)},D0.prototype.evaluation=function(e,t,r,n,i){return"UNKNOWN"===e.requiredType||"NULL"!==e.requiredType&&typeof e.defaultValue!=typeof r.rawValue?R0.ofDefault(e,t,l.TYPE_MISMATCH,i):R0.of(e,t,r.id,r.rawValue,n,i)};var k0,x0=D0;function D0(e){var t=k0.call(this)||this;return t.targetRuleDeterminer=e,t}F0.prototype.isEquals=function(e){return this.type===e.type&&this.id===e.id};var L0=F0;function F0(e,t){this.type=e,this.id=t}B0.create=function(){return new B0},Object.defineProperty(B0.prototype,"stack",{get:function(){return Array.from(this._stack)},enumerable:!1,configurable:!0}),Object.defineProperty(B0.prototype,"targetEvaluations",{get:function(){return Array.from(this._targetEvaluations)},enumerable:!1,configurable:!0}),Object.defineProperty(B0.prototype,"properties",{get:function(){return ke.sanitize(this._properties)},enumerable:!1,configurable:!0}),B0.prototype.contains=function(t){return this._stack.some(function(e){return e.key.isEquals(t.key)})},B0.prototype.addRequest=function(e){this._stack.push(e)},B0.prototype.removeRequest=function(e){e=this._stack.indexOf(e,0);-1<e&&this._stack.splice(e,1)},B0.prototype.getEvaluation=function(t){return this._targetEvaluations.find(function(e){return e instanceof P0&&e.experiment.id===t.id})},B0.prototype.addEvaluation=function(e){this._targetEvaluations.push(e)},B0.prototype.setProperty=function(e,t){this._properties[e]=t},B0.prototype.get=function(e){var t=this.map.get(e);if(!t)return null;if(t instanceof e)return t;throw new Error("Context does not contain a value of type ".concat(e.name))},B0.prototype.set=function(e,t){this.map.set(e,t)};var V0=B0;function B0(){this._stack=[],this._targetEvaluations=[],this._properties={},this.map=new WeakMap}H0.of=function(e,t,r,n){return new H0(e,t,r,n)},H0.by=function(e,t){return new H0(e.workspace,e.user,t,"A")},H0.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.experiment.type,", key=").concat(this.experiment.key,")")};var K0=H0;function H0(e,t,r,n){this.key=new L0("EXPERIMENT",r.id),this.workspace=e,this.user=t,this.experiment=r,this.defaultVariationKey=n}G0.of=function(e,t,r,n,i){return new G0(e,t,r,n,i)},G0.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.parameter.key,")")};var j0=G0;function G0(e,t,r,n,i){this.key=new L0("REMOTE_CONFIG",r.id),this.workspace=e,this.user=t,this.parameter=r,this.requiredType=n,this.defaultValue=i}z0.asString=function(e){switch(typeof e){case"string":return e;case"number":return e.toString();case"boolean":return e?"true":"false";default:return}},z0.asNumber=function(e){switch(typeof e){case"number":return this.asActualNumber(e);case"string":return this.asActualNumber(Number(e));default:return}},z0.asBoolean=function(e){switch(typeof e){case"boolean":return e;case"string":switch(e){case"true":return!0;case"false":return!1;default:return}default:return}},z0.asActualNumber=function(e){if(!isNaN(e)&&isFinite(e))return e};var S=z0;function z0(){}J0.prototype.getVariation=function(e,t){if(0!==this.storages.length)for(var r=0,n=this.storages;r<n.length;r++){var i=n[r].getVariation(e,t);if(void 0!==i)return i}};var Y0=J0;function J0(e){this.storages=e}W0.prototype.getVariation=function(e,t){var r=this.get(e);if(r)return e._getVariationByIdOrNull(r)},W0.prototype.get=function(e){e=this.listStorage.getItem(e.id.toString());return S.asNumber(e)},W0.prototype.getAll=function(){var r=new Map;return this.listStorage.entries().forEach(function(e){var t=e[0],e=e[1],t=S.asNumber(t),e=S.asNumber(e);c.isNullOrUndefined(t)||t<0||c.isNullOrUndefined(e)||t<0||r.set(t,e)}),r},W0.prototype.set=function(e,t){this.listStorage.setItem(e.id.toString(),t.toString())},W0.prototype.remove=function(e){this.listStorage.removeItem(e.id.toString())},W0.prototype.clear=function(){this.listStorage.clear()};var q0=W0;function W0(e){this.listStorage=e}X0.prototype.add=function(e){this.evaluators.push(e)},X0.prototype.evaluate=function(t,e){var r=this.evaluators.find(function(e){return e.supports(t)});if(c.isNullOrUndefined(r))throw new Error("Unsupported EvaluatorRequest [".concat(t.toString(),"]"));return r.evaluate(t,e)};var $0=X0;function X0(){this.evaluators=new Array}Q0.get=function(e){return c.requiredNotNullOrUndefined(this.getOrNull(e),function(){return"Instance not registered [".concat(e,"]")})},Q0.getOrNull=function(e){return Q0.instances.get(e)},Q0.register=function(e,t){return Q0.instances.set(e,t),t},Q0.instances=new Map;var Z0=Q0;function Q0(){}tA.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.parameter.targetRules.find(function(e){return n.matches(t,r,e)})},tA.prototype.matches=function(e,t,r){if(!this.targetMatcher.matches(e,t,r.target))return!1;t=e.user.identifiers[e.parameter.identifierType];if(c.isNullOrUndefined(t))return!1;e=e.workspace.getBucketOrNull(r.bucketId);if(c.isNullOrUndefined(e))throw new Error("bucket[".concat(r.bucketId,"]"));return c.isNotNullOrUndefined(this.bucketer.bucketing(e,t))};var eA=tA;function tA(e,t){this.targetMatcher=e,this.bucketer=t}nA.prototype.resolveOrNull=function(e,t,r){switch(r.type){case"VARIATION":return this.resolveVariation(e,r);case"BUCKET":return this.resolveBucket(e,r)}},nA.prototype.resolveVariation=function(e,t){return e.experiment._getVariationByIdOrNull(t.variationId)},nA.prototype.resolveBucket=function(e,t){var t=e.workspace.getBucketOrNull(t.bucketId),r=e.user.identifiers[e.experiment.identifierType];if(r){t=this.bucketer.bucketing(t,r);if(t)return e.experiment._getVariationByIdOrNull(t.variationId)}};var rA=nA;function nA(e){this.bucketer=e}oA.prototype.evaluate=function(e,t){if(this.flowEvaluator&&this.nextFlow)return this.flowEvaluator.evaluate(e,t,this.nextFlow)},oA.end=function(){return new oA(void 0,void 0)},oA.decision=function(e,t){return new oA(e,t)},oA.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=this.end(),n=0,i=e.reverse();n<i.length;n++)var o=i[n],r=this.decision(o,r);return r};var iA=oA;function oA(e,t){this.flowEvaluator=e,this.nextFlow=t}aA.prototype.evaluate=function(e,t,r){var n=this.overrideResolver.resolveOrNull(e,t);if(!n)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return P0.of(e,t,n,l.OVERRIDDEN);case"FEATURE_FLAG":return P0.of(e,t,n,l.INDIVIDUAL_TARGET_MATCH)}};var sA=aA;function aA(e){this.overrideResolver=e}cA.prototype.evaluate=function(e,t,r){return"DRAFT"===e.experiment.status?P0.ofDefault(e,t,l.EXPERIMENT_DRAFT):r.evaluate(e,t)};var uA=cA;function cA(){}lA.prototype.evaluate=function(e,t,r){if("PAUSED"!==e.experiment.status)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return P0.ofDefault(e,t,l.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return P0.ofDefault(e,t,l.FEATURE_FLAG_INACTIVE)}};var pA=lA;function lA(){}hA.prototype.evaluate=function(e,t,r){if("COMPLETED"!==e.experiment.status)return r.evaluate(e,t);r=e.experiment._winnerVariationOrNull();if(r)return P0.of(e,t,r,l.EXPERIMENT_COMPLETED);throw new Error("winner variation [".concat(e.experiment.id,"]"))};var fA=hA;function hA(){}yA.prototype.evaluate=function(e,t,r){if("AB_TEST"!==e.experiment.type)throw new Error("experiment type must be AB_TEST [".concat(e.experiment.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t)?r.evaluate(e,t):P0.ofDefault(e,t,l.NOT_IN_EXPERIMENT_TARGET)};var dA=yA;function yA(e){this.experimentTargetDeterminer=e}gA.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("AB_TEST"!==e.experiment.type)throw new Error("experiment type must be AB_TEST [".concat(e.experiment.id,"]"));var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);return n?n.isDropped?P0.ofDefault(e,t,l.VARIATION_DROPPED):P0.of(e,t,n,l.TRAFFIC_ALLOCATED):P0.ofDefault(e,t,l.TRAFFIC_NOT_ALLOCATED)};var vA=gA;function gA(e){this.actionResolver=e}EA.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("FEATURE_FLAG"!==e.experiment.type)throw new Error("experiment type must be FEATURE_FLAG [".concat(e.experiment.id,"]"));if(!e.user.identifiers[e.experiment.identifierType])return r.evaluate(e,t);var n=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t);if(!n)return r.evaluate(e,t);r=this.actionResolver.resolveOrNull(e,t,n.action);if(r)return P0.of(e,t,r,l.TARGET_RULE_MATCH);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var mA=EA;function EA(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}bA.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("FEATURE_FLAG"!==e.experiment.type)throw new Error("experiment type must be FEATURE_FLAG [".concat(e.experiment.id,"]"));if(!e.user.identifiers[e.experiment.identifierType])return P0.ofDefault(e,t,l.DEFAULT_RULE);var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);if(n)return P0.of(e,t,n,l.DEFAULT_RULE);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var wA=bA;function bA(e){this.actionResolver=e}IA.prototype.evaluate=function(e,t,r){var n=e.experiment.containerId;if(!n)return r.evaluate(e,t);var i=e.workspace.getContainerOrNull(n);if(i)return this.containerResolver.isUserInContainerGroup(e,t,i)?r.evaluate(e,t):P0.ofDefault(e,t,l.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT);throw new Error("container[".concat(n,"]"))};var AA=IA;function IA(e){this.containerResolver=e}_A.prototype.evaluate=function(e,t,r){return e.user.identifiers[e.experiment.identifierType]?r.evaluate(e,t):P0.ofDefault(e,t,l.IDENTIFIER_NOT_FOUND)};var TA=_A;function _A(){}PA.prototype.isUserInExperimentTarget=function(t,r){var n=this;return 0===t.experiment.targetAudiences.length||t.experiment.targetAudiences.some(function(e){return n.targetMatcher.matches(t,r,e)})};var NA=PA;function PA(e){this.targetMatcher=e}MA.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.experiment.targetRules.find(function(e){return n.targetMatcher.matches(t,r,e.target)})};var OA=MA;function MA(e){this.targetMatcher=e}CA.prototype.resolveOrNull=function(e,t){var r;return null!=(r=null!=(r=this.resolveManualOverride(e))?r:this._resolveUserOverride(e))?r:this._resolveSegmentOverride(e,t)},CA.prototype.resolveManualOverride=function(e){return this.manualOverrideStorage.getVariation(e.experiment,e.user)},CA.prototype._resolveUserOverride=function(e){var t=e.experiment,e=e.user.identifiers[t.identifierType];if(e){e=t.userOverrides.get(e);if(e)return t._getVariationByIdOrNull(e)}},CA.prototype._resolveSegmentOverride=function(t,r){var n=this,e=t.experiment.segmentOverrides.find(function(e){return n.targetMatcher.matches(t,r,e.target)});if(e)return this.actionResolver.resolveOrNull(t,r,e.action)};var SA=CA;function CA(e,t,r){this.manualOverrideStorage=e,this.targetMatcher=t,this.actionResolver=r}UA.prototype.isUserInContainerGroup=function(e,t,r){var n=e.user.identifiers[e.experiment.identifierType];if(c.isNullOrUndefined(n))return!1;var i=e.workspace.getBucketOrNull(r.bucketId);if(c.isNullOrUndefined(i))throw new Error("Bucket[".concat(r.bucketId,"]"));i=this.bucketer.bucketing(i,n);if(c.isNullOrUndefined(i))return!1;n=r.getGroupOrNull(i.variationId);if(c.isNullOrUndefined(n))throw new Error("ContainerGroup[".concat(i.variationId,"]"));return n.experiments.includes(e.experiment.id)};var RA=UA;function UA(e){this.bucketer=e}xA.prototype.getExperimentFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}};var kA=xA;function xA(e,t,r){var n=new rA(t),e=new SA(e,r,n),t=new RA(t);this.abTestFlow=iA.of(new sA(e),new TA,new AA(t),new dA(new NA(r)),new uA,new pA,new fA,new vA(n)),this.featureFlagFlow=iA.of(new uA,new pA,new fA,new sA(e),new TA,new mA(new OA(r),n),new wA(n))}LA.prototype.matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n._matches(t,r,e)})},LA.prototype.anyMatches=function(t,r,e){var n=this;return!e.length||e.some(function(e){return n.matches(t,r,e)})},LA.prototype._matches=function(e,t,r){return this.conditionMatcherFactory.getMatcher(r.key.type).matches(e,t,r)};var DA=LA;function LA(e){this.conditionMatcherFactory=e}VA.prototype.decorate=function(e){return e};var FA=VA;function VA(){}KA.prototype.decorate=function(e){return"string"==typeof e?ds.decodeURIOrOriginal(e):e};var BA=KA;function KA(){}jA.prototype.matches=function(e,t,r){void 0===r&&(r=new FA);var n=this.valueMatcherFactory.getMatcher(t.valueType),i=this.operatorMatcherFactory.getMatcher(t.operator),e=this.userValueMatches(e,t,n,i,r);return this.typeMatches(t.type,e)},jA.prototype.userValueMatches=function(e,t,r,n,i){return Array.isArray(e)?this.arrayMatches(e,t,r,n,i):this.singleMatches(e,t,r,n,i)},jA.prototype.singleMatches=function(e,t,r,n,i){e=i.decorate(e),t=t.values.map(i.decorate);return n.matches(r,e,t)},jA.prototype.arrayMatches=function(e,t,r,n,i){var o=this;return e.some(function(e){return o.singleMatches(e,t,r,n,i)})},jA.prototype.typeMatches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}};var HA=jA;function jA(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}GA.prototype.matches=function(t,r,e){return!c.isNullOrUndefined(r)&&e.some(function(e){return t.inMatches(r,e)})};wp=GA;function GA(){}zA.prototype.matches=function(t,r,e){return!c.isNullOrUndefined(r)&&e.some(function(e){return t.containsMatches(r,e)})};Xa=zA;function zA(){}YA.prototype.matches=function(t,r,e){return!c.isNullOrUndefined(r)&&e.some(function(e){return t.startsWithMatches(r,e)})};Xu=YA;function YA(){}JA.prototype.matches=function(t,r,e){return!c.isNullOrUndefined(r)&&e.some(function(e){return t.endsWithMatches(r,e)})};I=JA;function JA(){}qA.prototype.matches=function(t,r,e){return!c.isNullOrUndefined(r)&&e.some(function(e){return t.greaterThanMatches(r,e)})};Fa=qA;function qA(){}$A.prototype.matches=function(t,r,e){return!c.isNullOrUndefined(r)&&e.some(function(e){return t.greaterThanOrEqualMatches(r,e)})};var WA=$A;function $A(){}XA.prototype.matches=function(t,r,e){return!c.isNullOrUndefined(r)&&e.some(function(e){return t.lessThanMatches(r,e)})};Ra=XA;function XA(){}ZA.prototype.matches=function(t,r,e){return!c.isNullOrUndefined(r)&&e.some(function(e){return t.lessThanOrEqualMatches(r,e)})};nu=ZA;function ZA(){}QA.prototype.matches=function(e,t,r){return!c.isNullOrUndefined(t)};id=QA;function QA(){}tI.prototype.getMatcher=function(e){switch(e){case"IN":return tI.IN_MATCHER;case"CONTAINS":return tI.CONTAINS_MATCHER;case"STARTS_WITH":return tI.STARTS_WITH_MATCHER;case"ENDS_WITH":return tI.ENDS_WITH_MATCHER;case"GT":return tI.GT_MATCHER;case"GTE":return tI.GTE_MATCHER;case"LT":return tI.LT_MATCHER;case"LTE":return tI.LTE_MATCHER;case"EXISTS":return tI.EXISTS_MATCHER}},tI.IN_MATCHER=new wp,tI.CONTAINS_MATCHER=new Xa,tI.STARTS_WITH_MATCHER=new Xu,tI.ENDS_WITH_MATCHER=new I,tI.GT_MATCHER=new Fa,tI.GTE_MATCHER=new WA,tI.LT_MATCHER=new Ra,tI.LTE_MATCHER=new nu,tI.EXISTS_MATCHER=new id;var eI=tI;function tI(){}rI.prototype.inMatches=function(e,t){e=S.asString(e),t=S.asString(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e===t},rI.prototype.containsMatches=function(e,t){e=S.asString(e),t=S.asString(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e.includes(t)},rI.prototype.startsWithMatches=function(e,t){e=S.asString(e),t=S.asString(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e.startsWith(t)},rI.prototype.endsWithMatches=function(e,t){e=S.asString(e),t=S.asString(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e.endsWith(t)},rI.prototype.greaterThanMatches=function(e,t){e=S.asString(e),t=S.asString(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&t<e},rI.prototype.greaterThanOrEqualMatches=function(e,t){e=S.asString(e),t=S.asString(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&t<=e},rI.prototype.lessThanMatches=function(e,t){e=S.asString(e),t=S.asString(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e<t},rI.prototype.lessThanOrEqualMatches=function(e,t){e=S.asString(e),t=S.asString(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e<=t};A=rI;function rI(){}nI.prototype.inMatches=function(e,t){e=S.asNumber(e),t=S.asNumber(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e===t},nI.prototype.containsMatches=function(e,t){return!1},nI.prototype.startsWithMatches=function(e,t){return!1},nI.prototype.endsWithMatches=function(e,t){return!1},nI.prototype.greaterThanMatches=function(e,t){e=S.asNumber(e),t=S.asNumber(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&t<e},nI.prototype.greaterThanOrEqualMatches=function(e,t){e=S.asNumber(e),t=S.asNumber(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&t<=e},nI.prototype.lessThanMatches=function(e,t){e=S.asNumber(e),t=S.asNumber(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e<t},nI.prototype.lessThanOrEqualMatches=function(e,t){e=S.asNumber(e),t=S.asNumber(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e<=t};j=nI;function nI(){}oI.prototype.inMatches=function(e,t){e=S.asBoolean(e),t=S.asBoolean(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e===t},oI.prototype.containsMatches=function(e,t){return!1},oI.prototype.startsWithMatches=function(e,t){return!1},oI.prototype.endsWithMatches=function(e,t){return!1},oI.prototype.greaterThanMatches=function(e,t){return!1},oI.prototype.greaterThanOrEqualMatches=function(e,t){return!1},oI.prototype.lessThanMatches=function(e,t){return!1},oI.prototype.lessThanOrEqualMatches=function(e,t){return!1};var iI=oI;function oI(){}sI.prototype.inMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e.isEqualTo(t)},sI.prototype.containsMatches=function(e,t){return!1},sI.prototype.startsWithMatches=function(e,t){return!1},sI.prototype.endsWithMatches=function(e,t){return!1},sI.prototype.greaterThanMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e.isGreaterThan(t)},sI.prototype.greaterThanOrEqualMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e.isGreaterThanOrEqualTo(t)},sI.prototype.lessThanMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e.isLessThan(t)},sI.prototype.lessThanOrEqualMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&e.isLessThanOrEqualTo(t)};T=sI;function sI(){}aI.prototype.inMatches=function(e,t){e=ds.tryParse(e),t=S.asString(t);return!c.isNullOrUndefined(e)&&!c.isNullOrUndefined(t)&&ds.decodeURIOrOriginal(ds.removePathnameTrailingSlash(e))===ds.decodeURIOrOriginal(ds.removePathnameTrailingSlash(t))},aI.prototype.containsMatches=function(e,t){e=ds.tryParse(e),t=S.asString(t);if(c.isNullOrUndefined(e)||c.isNullOrUndefined(t))return!1;e=ds.decodeURIOrOriginal(e.href);return e.includes(t)||e.includes(encodeURI(t))},aI.prototype.startsWithMatches=function(e,t){e=ds.tryParse(e),t=S.asString(t);if(c.isNullOrUndefined(e)||c.isNullOrUndefined(t))return!1;e=ds.decodeURIOrOriginal(e.href);return e.startsWith(t)||e.startsWith(encodeURI(t))},aI.prototype.endsWithMatches=function(e,t){return!1},aI.prototype.greaterThanMatches=function(e,t){return!1},aI.prototype.greaterThanOrEqualMatches=function(e,t){return!1},aI.prototype.lessThanMatches=function(e,t){return!1},aI.prototype.lessThanOrEqualMatches=function(e,t){return!1};Ma=aI;function aI(){}uI.prototype.inMatches=function(e,t){return!1},uI.prototype.containsMatches=function(e,t){return!1},uI.prototype.startsWithMatches=function(e,t){return!1},uI.prototype.endsWithMatches=function(e,t){return!1},uI.prototype.greaterThanMatches=function(e,t){return!1},uI.prototype.greaterThanOrEqualMatches=function(e,t){return!1},uI.prototype.lessThanMatches=function(e,t){return!1},uI.prototype.lessThanOrEqualMatches=function(e,t){return!1};ic=uI;function uI(){}pI.prototype.getMatcher=function(e){switch(e){case"STRING":case"JSON":return pI.STRING_MATCHER;case"NUMBER":return pI.NUMBER_MATCHER;case"BOOLEAN":return pI.BOOLEAN_MATCHER;case"VERSION":return pI.VERSION_MATCHER;case"URL":return pI.URL_MATCHER;case"NULL":case"UNKNOWN":return pI.NULL_MATCHER}},pI.STRING_MATCHER=new A,pI.NUMBER_MATCHER=new j,pI.BOOLEAN_MATCHER=new iI,pI.VERSION_MATCHER=new T,pI.URL_MATCHER=new Ma,pI.NULL_MATCHER=new ic;var cI=pI;function pI(){}fI.prototype.matches=function(e,t,r){var e=this.userValueResolver.resolveOrNull(e.user,r.key),n=this.valueDecorator(r.key);return this.valueOperatorMatcher.matches(e,r.match,n)},fI.prototype.valueDecorator=function(e){return new("HACKLE_PROPERTY"===e.type&&this.URL_HACKLE_PROPERTY_KEY_NAMES.includes(e.name)?BA:FA)};var lI=fI;function fI(e,t){this.URL_HACKLE_PROPERTY_KEY_NAMES=["pagePath","host","url","queryParameter"],this.userValueResolver=e,this.valueOperatorMatcher=t}dI.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];default:throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}};var hI=dI;function dI(){}vI.prototype.matches=function(t,r,e){var n=this;if("SEGMENT"!=e.key.type)throw new Error("Unsupported TargetKeyType [".concat(e.key.type,"]"));var i=e.match.values.some(function(e){return n._matches(t,r,e)});switch(e.match.type){case"MATCH":return i;case"NOT_MATCH":return!i}},vI.prototype._matches=function(e,t,r){if("string"!=typeof r)throw new Error("SegmentKey[".concat(r,"]"));var n=e.workspace.getSegmentOrNull(r);if(n)return this.segmentMatcher.matches(e,t,n);throw new Error("Segment[".concat(r,"]"))};var yI=vI;function vI(e){this.segmentMatcher=e}mI.prototype.matches=function(t,r,e){var n=this;return e.targets.some(function(e){return n._matches(t,r,e)})},mI.prototype._matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n.userConditionMatcher.matches(t,r,e)})};var gI=mI;function mI(e){this.userConditionMatcher=e}EI.prototype.evaluateInternal=function(e,t,r){r=K0.by(e,r),r=this.evaluator.evaluate(r,t);if(!(r instanceof P0))throw new Error("Unexpected evaluation [expected=ExperimentEvaluation, actual=".concat(r.constructor.name,"]"));e=this.resolve(e,t,r);return t.addEvaluation(e),e},EI.prototype.evaluate=function(e,t,r){var n;return null!=(n=t.getEvaluation(r))?n:this.evaluateInternal(e,t,r)};ya=EI;function EI(e){this.evaluator=e}bI.prototype.matches=function(e,t,r){switch(r.key.type){case"AB_TEST":return this.abTestMatcher.matches(e,t,r);case"FEATURE_FLAG":return this.featureFlagMatcher.matches(e,t,r);default:throw new Error("Unsupported TargetKeyType [".concat(r.key.type,"]"))}};var wI=bI;function bI(e,t){this.abTestMatcher=e,this.featureFlagMatcher=t}i(II,AI=ya),II.prototype.matches=function(e,t,r){var n=c.requiredNotNullOrUndefined(S.asNumber(r.key.name),function(){return"Invalid key [".concat(r.key.type,", ").concat(r.key.name,"]")}),n=this.experiment(e,n);if(c.isNullOrUndefined(n))return!1;e=this.evaluate(e,t,n);return this.evaluationMatches(e,r)};var AI,G=II;function II(e,t){e=AI.call(this,e)||this;return e.valueOperatorMatcher=t,e}i(NI,TI=G),NI.prototype.experiment=function(e,t){return e.workspace.getExperimentOrNull(t)},NI.prototype.resolve=function(e,t,r){return r.reason===l.TRAFFIC_ALLOCATED?r.with(l.TRAFFIC_ALLOCATED_BY_TARGETING):r},NI.prototype.evaluationMatches=function(e,t){return!!NI.AB_TEST_MATCHED_REASONS.includes(e.reason)&&this.valueOperatorMatcher.matches(e.variationKey,t.match)},NI.AB_TEST_MATCHED_REASONS=[l.OVERRIDDEN,l.TRAFFIC_ALLOCATED,l.EXPERIMENT_COMPLETED,l.TRAFFIC_ALLOCATED_BY_TARGETING];var TI,_I=NI;function NI(e,t){return TI.call(this,e,t)||this}i(MI,PI=G),MI.prototype.experiment=function(e,t){return e.workspace.getFeatureFlagOrNull(t)},MI.prototype.resolve=function(e,t,r){return r},MI.prototype.evaluationMatches=function(e,t){e="A"!==e.variationKey;return this.valueOperatorMatcher.matches(e,t.match)};var PI,OI=MI;function MI(e,t){return PI.call(this,e,t)||this}CI.prototype.matches=function(e,t,r){if(!this.isEventEvaluatorRequest(e))return!1;e=this.eventValueResolver.resolveOrNull(e.event,r.key);return this.valueOperatorMatcher.matches(e,r.match)},CI.prototype.isEventEvaluatorRequest=function(e){return void 0!==e.event};var SI=CI;function CI(e,t){this.eventValueResolver=e,this.valueOperatorMatcher=t}UI.prototype.resolveOrNull=function(e,t){var r;switch(t.type){case"EVENT_PROPERTY":return null==(r=this.properties(e))?void 0:r[t.name];case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":case"SEGMENT":case"AB_TEST":case"FEATURE_FLAG":case"COHORT":throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}},UI.prototype.properties=function(e){return c0.isTrackEvent(e)?e.event.properties:c0.isExposureEvent(e)||c0.isRemoteConfigEvent(e)?e.properties:void 0};var RI=UI;function UI(){}xI.prototype.matches=function(e,t,r){if("COHORT"!==r.key.type)throw new Error("Unsupported TargetKeyType [".concat(r.key.type,"]"));e=null!=(e=null==(e=e.user.cohorts)?void 0:e.map(function(e){return e.id}))?e:[];return this.valueOperatorMatcher.matches(e,r.match)};var kI=xI;function xI(e){this.valueOperatorMatcher=e}LI.prototype.supports=function(e){return"NUMBER_OF_EVENTS_IN_DAYS"===e||"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"===e},LI.prototype.matches=function(e,t,r){var n,i=r.key.type;if(!this.supports(i))throw new Error("Unsupported TargetKeyType [".concat(i,"]"));var o=null!=(n=e.user.targetEvents)?n:[];switch(i){case"NUMBER_OF_EVENTS_IN_DAYS":return new BI(this.valueOperatorMatcher,this.clock).matches(e,o,r);case"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS":return new jI(this.valueOperatorMatcher,this.clock).matches(e,o,r);default:return i}};var DI=LI;function LI(e,t){this.valueOperatorMatcher=e,this.clock=t}function FI(){}i(KI,VI=FI),KI.prototype.matches=function(e,t,r){var n=this,i=this.convertTargetConditionToExpression(r),o=this.clock.currentMillis()-Fe.daysToUnit(i.days,"milliseconds"),t=t.filter(function(e){return n.expressionMatch(e,i)}),t=f.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},KI.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&null===e.property},KI.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var VI,BI=KI;function KI(e,t){var r=VI.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}i(GI,HI=FI),GI.prototype.matches=function(e,t,r){var n=this,i=this.convertTargetConditionToExpression(r),o=this.clock.currentMillis()-Fe.daysToUnit(i.days,"milliseconds"),t=t.filter(function(e){return n.expressionMatch(e,i)}),t=f.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},GI.prototype.propertyMatch=function(e,t){return(null==e?void 0:e.type)===t.key.type&&e.key===t.key.name&&this.valueOperatorMatcher.matches(e.value,t.match)},GI.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&this.propertyMatch(e.property,t.propertyFilter)},GI.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var HI,jI=GI;function GI(e,t){var r=HI.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}YI.prototype.getMatcher=function(e){switch(e){case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":return this.userConditionMatcher;case"EVENT_PROPERTY":return this.eventConditionMatcher;case"SEGMENT":return this.segmentConditionMatcher;case"AB_TEST":case"FEATURE_FLAG":return this.experimentConditionMatcher;case"COHORT":return this.cohortConditionMatcher;case"NUMBER_OF_EVENTS_IN_DAYS":case"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS":return this.userTargetConditionMatcher;default:return e}};var zI=YI;function YI(e,t){var r=new HA(new cI,new eI);this.userConditionMatcher=new lI(new hI,r),this.eventConditionMatcher=new SI(new RI,r),this.segmentConditionMatcher=new yI(new gI(this.userConditionMatcher)),this.experimentConditionMatcher=new wI(new _I(e,r),new OI(e,r)),this.cohortConditionMatcher=new kI(r),this.userTargetConditionMatcher=new DI(r,t)}var JI={murmurhash3_x86_32:function(e,t,r,n){for(var i,o=-4&(n=void 0===n?e.length:n),s=t,a=0;a<o;a+=4)i=255&e.charCodeAt(a)|(255&e.charCodeAt(a+1))<<8|(255&e.charCodeAt(a+2))<<16|(255&e.charCodeAt(a+3))<<24,i=this.mul32(i,3432918353),s=5*(s=(524287&(s^=i=this.mul32(i=(131071&i)<<15|i>>>17,461845907)))<<13|s>>>19)+3864292196|0;switch(i=0,n%4){case 3:i=(255&e.charCodeAt(2+o))<<16;case 2:i|=(255&e.charCodeAt(1+o))<<8;case 1:i|=255&e.charCodeAt(o),i=this.mul32(i,3432918353),s^=i=this.mul32(i=(131071&i)<<15|i>>>17,461845907)}return s=this.mul32(s=(s^=n)^s>>>16,2246822507),s=this.mul32(s^=s>>>13,3266489909),s^=s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},qI=(WI.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t);return e.slots.find(function(e){return e.contains(r)})},WI.prototype.calculateSlotNumber=function(e,t,r){r=JI.murmurhash3_x86_32(r,e);return Math.abs(r)%Math.abs(t)},WI);function WI(){}var $I=s.log,XI=(ZI.create=function(e,t,r,n){var i=Ve.instance,o=Z0.register("delegatingEvaluator",new $0),s=new qI,i=Z0.register("targetMatcher",new DA(new zI(o,i))),n=new Y0(n),i=new eA(i,s),n=new kA(n,s,Z0.get("targetMatcher")),s=new S0(n),n=new x0(i);return o.add(s),o.add(n),new ZI(s,n,e,t,r,new QI)},ZI.prototype.getExperiment=function(e){if(e){var t=this.workspaceFetcher.get();if(t)return t.getExperimentOrNull(e)}else $I.error("experimentKey must not be empty")},ZI.prototype.experiment=function(e,t,r){var n=this;if(!e)return $I.error("experimentKey must not be empty"),At.of(r,l.INVALID_INPUT);var i=this.workspaceFetcher.get();if(!i)return $I.warn("SDK not ready."),At.of(r,l.SDK_NOT_READY);e=i.getExperimentOrNull(e);if(!e)return $I.warn("Experiment does not exist."),At.of(r,l.EXPERIMENT_NOT_FOUND);i=K0.of(i,t,e,r),t=this.experimentInternal(i),e=t[0],r=t[1];return this.eventFactory.create(i,e).forEach(function(e){return n.eventProcessor.process(e)}),r},ZI.prototype.experiments=function(r){var n=this,i=new gi(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getExperiments().forEach(function(e){var t=K0.of(o,r,e,"A"),t=n.experimentInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},ZI.prototype.experimentInternal=function(e){var e=this.experimentEvaluator.evaluate(e,V0.create()),t=null!=(t=e.config)?t:new Ke;return[e,At.of(e.variationKey,e.reason,t,e.experiment)]},ZI.prototype.featureFlag=function(e,t){var r=this;if(!e)return $I.error("featureKey must not be empty"),Tt.off(l.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return $I.warn("SDK not ready."),Tt.off(l.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return $I.warn("FeatureFlag does not exist."),Tt.off(l.FEATURE_FLAG_NOT_FOUND);n=K0.of(n,t,e,"A"),t=this.featureFlagInternal(n),e=t[0],t=t[1];return this.eventFactory.create(n,e).forEach(function(e){return r.eventProcessor.process(e)}),t},ZI.prototype.featureFlags=function(r){var n=this,i=new gi(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getFeatureFlags().forEach(function(e){var t=K0.of(o,r,e,"A"),t=n.featureFlagInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},ZI.prototype.featureFlagInternal=function(e){var e=this.experimentEvaluator.evaluate(e,V0.create()),t=null!=(t=e.config)?t:new Ke;return[e,"A"===e.variationKey?Tt.off(e.reason,t,e.experiment):Tt.on(e.reason,t,e.experiment)]},ZI.prototype.inAppMessage=function(e,t,r){t=r.evaluate(e,t);return r.record(e,t),t},ZI.prototype.track=function(e,t,r){var n;void 0===r&&(r=(new Date).getTime()),e?"object"!=typeof e?$I.warn("Event must be event type."):"object"!=typeof e||e.key&&"string"==typeof e.key?(n=(null==(n=this.workspaceFetcher.get())?void 0:n.getEventTypeOrNull(e.key))||new Vt(0,e.key),this.eventProcessor.process(c0.track(n,e,t,r))):$I.warn("Event key must be not null. or event key must be string type."):$I.warn("event must not be null.")},ZI.prototype.trackException=function(e,t){this.errorDedupDeterminer.isDedupTarget(e)||(e=T0.toEvent(e),this.flush(),this.track(e,t),this.flush())},ZI.prototype.flush=function(e){this.eventProcessor.flush(e=void 0===e?!1:e)},ZI.prototype.remoteConfig=function(e,t,r,n){var i=this,o=this.workspaceFetcher.get();if(c.isNullOrUndefined(o))return $I.warn("SDK not ready."),wt.of(n,l.SDK_NOT_READY);e=o.getRemoteConfigParameterOrNull(e);if(c.isNullOrUndefined(e))return $I.warn("Remote config parameter does not exist."),wt.of(n,l.REMOTE_CONFIG_PARAMETER_NOT_FOUND);o=j0.of(o,t,e,r,n),t=this.remoteConfigEvaluator.evaluate(o,V0.create());return this.eventFactory.create(o,t).forEach(function(e){return i.eventProcessor.process(e)}),wt.of(t.value,t.reason)},ZI.prototype.close=function(){this.eventProcessor.close()},ZI);function ZI(e,t,r,n,i,o){this.experimentEvaluator=e,this.remoteConfigEvaluator=t,this.workspaceFetcher=r,this.eventFactory=n,this.eventProcessor=i,this.errorDedupDeterminer=o}eT.prototype.isDedupTarget=function(e){return!!this._isSameError(e,this.previous)||(this.previous=e,!1)},eT.prototype._isSameError=function(e,t){return!c.isNullOrUndefined(t)&&(e.name===t.name&&e.message===t.message&&e.stack===t.stack)};var QI=eT;function eT(){}rT.prototype.install=function(e,t){this._install("onerror",e,t),this._install("onunhandledrejection",e,t)},rT.prototype._install=function(e,t,r){e in this._installed||((0,this._installations[e])(t,r),this._installed.push(e))};var tT=rT;function rT(){this._installed=[],this._installations={onerror:oT,onunhandledrejection:sT}}var nT,iT=null;function oT(o,s){iT=window.onerror,window.onerror=function(e,t,r,n,i){c.isNotNullOrUndefined(i)&&o.trackException(i,s.resolve()),iT&&iT.apply(this,arguments)}}function sT(r,n){nT=window.onunhandledrejection,window.onunhandledrejection=function(e){var t;try{"reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason)}catch(e){}t instanceof Error&&r.trackException(t,n.resolve()),nT&&nT.apply(this,arguments)}}uT.prototype.read=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){return(t=this.storage.getItem(this.storageKey))?[2,JSON.parse(t)]:[2,[]]})})},uT.prototype.save=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){return 0===r.length?[2,this.clear()]:(t=JSON.stringify(r.slice(-this.maxSize)),this.storage.setItem(this.storageKey,t),[2])})})},uT.prototype.add=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return[4,this.read()];case 1:return t=e.sent(),[4,this.save(t.concat(r).slice(-this.maxSize))];case 2:return e.sent(),[2]}})})},uT.prototype.delete=function(n){return o(this,void 0,void 0,function(){var t,r=this;return a(this,function(e){switch(e.label){case 0:return[4,this.read()];case 1:return t=e.sent(),t=t.filter(function(e){return!r.isDeleteTarget(e,n)}),[4,this.save(t)];case 2:return e.sent(),[2]}})})},uT.prototype.isDeleteTarget=function(t,e){return e.some(function(e){return e.insertId===t.insertId})},uT.prototype.clear=function(){return o(this,void 0,void 0,function(){return a(this,function(e){return this.storage.removeItem(this.storageKey),[2]})})};var aT=uT;function uT(e,t,r){this.storage=e,this.storageKey=t,this.maxSize=r}function cT(e,t){return null!==e&&(e.userId===t.userId&&e.deviceId===t.deviceId)}lT.builder=function(){return new fT},lT.empty=function(){return lT.builder().build()},lT.from=function(e){return new lT(e)},lT.fromDto=function(e){for(var t=lT.builder(),r=0,n=e.cohorts;r<n.length;r++){var i=n[r];t.put({identifier:i.identifier,cohorts:i.cohorts.map(function(e){return new ii(e)})})}return t.build()},Object.defineProperty(lT.prototype,"rawCohorts",{get:function(){return this.cohorts.values().flatMap(function(e){return e.cohorts})},enumerable:!1,configurable:!0}),lT.prototype.get=function(e){return this.cohorts.get(e)},lT.prototype.filterBy=function(e){var r=jt(e),e=this.asComparable().filter(function(e,t){return r[e.type]===e.value});return lT.from(e)},lT.prototype.asArray=function(){return this.cohorts.values()},lT.prototype.asComparable=function(){return this.cohorts},lT.prototype.toBuilder=function(){return new fT(this)};var pT=lT;function lT(e){this.cohorts=e}hT.prototype.put=function(e){return this.cohorts.add(e.identifier,e),this},hT.prototype.putAll=function(e){var t=this;return e.asArray().forEach(function(e){return t.put(e)}),this},hT.prototype.build=function(){return new pT(this.cohorts)};var fT=hT;function hT(e){this.cohorts=new gi(Ce.isEqual),e&&this.putAll(e)}var N="model",_="name",e="type",P="vendor",M="version",m="architecture",Yl="console",O="mobile",E="tablet",t="smarttv",Ca="wearable",dT=(C.parse=function(e){return{browser:C.getBrowser(e),cpu:C.getCPU(e),device:C.getDevice(e),engine:C.getEngine(e),os:C.getOS(e)}},C.getBrowser=function(e){var t={name:void 0,version:void 0,major:void 0};return C.mapper.rgx.call(t,e,C.regexes.browser),t.major=C.util.major(t.version),t},C.getCPU=function(e){var t={architecture:void 0};return C.mapper.rgx.call(t,e,C.regexes.cpu),t},C.getDevice=function(e){var t={model:void 0,type:void 0,vendor:void 0};return C.mapper.rgx.call(t,e,C.regexes.device),t},C.getEngine=function(e){var t={name:void 0,version:void 0};return C.mapper.rgx.call(t,e,C.regexes.os),t},C.getOS=function(e){var t={name:void 0,version:void 0};return C.mapper.rgx.call(t,e,C.regexes.os),t},C.util={extend:function(e,t){var r,n={};for(r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},C.regexes={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[_,M],[/(opios)[\/\s]+([\w\.]+)/i],[[_,"Opera Mini"],M],[/\s(opr)\/([\w\.]+)/i],[[_,"Opera"],M],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[_,M],[/(konqueror)\/([\w\.]+)/i],[[_,"Konqueror"],M],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[_,"IE"],M],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[_,"Edge"],M],[/(yabrowser)\/([\w\.]+)/i],[[_,"Yandex"],M],[/(Avast)\/([\w\.]+)/i],[[_,"Avast Secure Browser"],M],[/(AVG)\/([\w\.]+)/i],[[_,"AVG Secure Browser"],M],[/(puffin)\/([\w\.]+)/i],[[_,"Puffin"],M],[/(focus)\/([\w\.]+)/i],[[_,"Firefox Focus"],M],[/(opt)\/([\w\.]+)/i],[[_,"Opera Touch"],M],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[_,"UCBrowser"],M],[/(comodo_dragon)\/([\w\.]+)/i],[[_,/_/g," "],M],[/(windowswechat qbcore)\/([\w\.]+)/i],[[_,"WeChat(Win) Desktop"],M],[/(micromessenger)\/([\w\.]+)/i],[[_,"WeChat"],M],[/(brave)\/([\w\.]+)/i],[[_,"Brave"],M],[/(whale)\/([\w\.]+)/i],[[_,"Whale"],M],[/(qqbrowserlite)\/([\w\.]+)/i],[_,M],[/(QQ)\/([\d\.]+)/i],[_,M],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[_,M],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[_,M],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[_,M],[/(MetaSr)[\/\s]?([\w\.]+)/i],[_],[/(LBBROWSER)/i],[_],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[M,[_,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[M,[_,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[_,M],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[M,[_,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[_,/(.+)/,"$1 WebView"],M],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[_,/(.+(?:g|us))(.+)/,"$1 $2"],M],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[_,"Chrome Mobile"],M],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[M,[_,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[_,"Sailfish Browser"],M],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[_,M],[/(dolfin)\/([\w\.]+)/i],[[_,"Dolphin"],M],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[_,"360 Browser"]],[/(coast)\/([\w\.]+)/i],[[_,"Opera Coast"],M],[/fxios\/([\w\.-]+)/i],[M,[_,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[M,[_,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[M,_],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[_,"GSA"],M],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[_,[M,(C.mapper={rgx:function(e,t){for(var r,n,i,o,s,a=0;a<t.length&&!o;){for(var u=t[a],c=t[a+1],p=r=0;p<u.length&&!o;)if(o=u[p++].exec(e))for(n=0;n<c.length;n++)s=o[++r],"object"==typeof(i=c[n])&&0<i.length?2==i.length?"function"==typeof i[1]?this[i[0]]=i[1].call(this,s):this[i[0]]=i[1]:3==i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?this[i[0]]=s?s.replace(i[1],i[2]):void 0:this[i[0]]=s?i[1].call(this,s,i[2]):void 0:4==i.length&&(this[i[0]]=s?i[3].call(this,s.replace(i[1],i[2])):void 0):this[i]=s||void 0;a+=2}},str:function(e,t){for(var r in t)if("object"==typeof t[r]&&0<t[r].length){for(var n=0;n<t[r].length;n++)if(C.util.has(t[r][n],e))return"?"===r?void 0:r}else if(C.util.has(t[r],e))return"?"===r?void 0:r;return e}}).str,(C.maps={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}}).browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[_,M],[/(navigator|netscape)\/([\w\.-]+)/i],[[_,"Netscape"],M],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[_,M]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,C.util.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[m,/ower/,"",C.util.lowerize]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[m,C.util.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[N,P,[e,E]],[/applecoremedia\/[\w\.]+ \((ipad)/],[N,[P,"Apple"],[e,E]],[/(apple\s{0,1}tv)/i],[[N,"Apple TV"],[P,"Apple"],[e,t]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[P,N,[e,E]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[N,[P,"Amazon"],[e,E]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[N,C.mapper.str,C.maps.device.amazon.model],[P,"Amazon"],[e,O]],[/android.+aft([bms])\sbuild/i],[N,[P,"Amazon"],[e,t]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[N,P,[e,O]],[/\((ip[honed|\s\w*]+);/i],[N,[P,"Apple"],[e,O]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[P,N,[e,O]],[/\(bb10;\s(\w+)/i],[N,[P,"BlackBerry"],[e,O]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[N,[P,"Asus"],[e,E]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[P,"Sony"],[N,"Xperia Tablet"],[e,E]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[N,[P,"Sony"],[e,O]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[P,N,[e,Yl]],[/android.+;\s(shield)\sbuild/i],[N,[P,"Nvidia"],[e,Yl]],[/(playstation\s[34portablevi]+)/i],[N,[P,"Sony"],[e,Yl]],[/(sprint\s(\w+))/i],[[P,C.mapper.str,C.maps.device.sprint.vendor],[N,C.mapper.str,C.maps.device.sprint.model],[e,O]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[P,[N,/_/g," "],[e,O]],[/(nexus\s9)/i],[N,[P,"HTC"],[e,E]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i],[N,[P,"Huawei"],[e,O]],[/android.+(bah2?-a?[lw]\d{2})/i],[N,[P,"Huawei"],[e,E]],[/(microsoft);\s(lumia[\s\w]+)/i],[P,N,[e,O]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[N,[P,"Microsoft"],[e,Yl]],[/(kin\.[onetw]{3})/i],[[N,/\./g," "],[P,"Microsoft"],[e,O]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[N,[P,"Motorola"],[e,O]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[N,[P,"Motorola"],[e,E]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[P,C.util.trim],[N,C.util.trim],[e,t]],[/hbbtv.+maple;(\d+)/i],[[N,/^/,"SmartTV"],[P,"Samsung"],[e,t]],[/\(dtv[\);].+(aquos)/i],[N,[P,"Sharp"],[e,t]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[P,"Samsung"],N,[e,E]],[/smart-tv.+(samsung)/i],[P,[e,t],N],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[P,"Samsung"],N,[e,O]],[/sie-(\w*)/i],[N,[P,"Siemens"],[e,O]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[P,"Nokia"],N,[e,O]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[N,[P,"Acer"],[e,E]],[/android.+([vl]k\-?\d{3})\s+build/i],[N,[P,"LG"],[e,E]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[P,"LG"],N,[e,E]],[/(lg) netcast\.tv/i],[P,N,[e,t]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[N,[P,"LG"],[e,O]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[P,N,[e,E]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[N,[P,"Lenovo"],[e,E]],[/(lenovo)[_\s-]?([\w-]+)/i],[P,N,[e,O]],[/linux;.+((jolla));/i],[P,N,[e,O]],[/((pebble))app\/[\d\.]+\s/i],[P,N,[e,Ca]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[P,N,[e,O]],[/crkey/i],[[N,"Chromecast"],[P,"Google"],[e,t]],[/android.+;\s(glass)\s\d/i],[N,[P,"Google"],[e,Ca]],[/android.+;\s(pixel c)[\s)]/i],[N,[P,"Google"],[e,E]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[N,[P,"Google"],[e,O]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[N,/_/g," "],[P,"Xiaomi"],[e,O]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[N,/_/g," "],[P,"Xiaomi"],[e,E]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[N,[P,"Meizu"],[e,O]],[/(mz)-([\w-]{2,})/i],[[P,"Meizu"],N,[e,O]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[N,[P,"OnePlus"],[e,O]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[N,[P,"RCA"],[e,E]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[N,[P,"Dell"],[e,E]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[N,[P,"Verizon"],[e,E]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[P,"Barnes & Noble"],N,[e,E]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[N,[P,"NuVision"],[e,E]],[/android.+;\s(k88)\sbuild/i],[N,[P,"ZTE"],[e,E]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[N,[P,"Swiss"],[e,O]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[N,[P,"Swiss"],[e,E]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[N,[P,"Zeki"],[e,E]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[P,"Dragon Touch"],N,[e,E]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[N,[P,"Insignia"],[e,E]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[N,[P,"NextBook"],[e,E]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[P,"Voice"],N,[e,O]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[P,"LvTel"],N,[e,O]],[/android.+;\s(PH-1)\s/i],[N,[P,"Essential"],[e,O]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[N,[P,"Envizen"],[e,E]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[P,N,[e,E]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[N,[P,"MachSpeed"],[e,E]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[P,N,[e,E]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[N,[P,"Rotor"],[e,E]],[/android.+(KS(.+))\s+build/i],[N,[P,"Amazon"],[e,E]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[P,N,[e,E]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[e,C.util.lowerize],P,N],[/[\s\/\(](smart-?tv)[;\)]/i],[[e,t]],[/(android[\w\.\s\-]{0,9});.+build/i],[N,[P,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[M,[_,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[M,[_,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[_,M],[/rv\:([\w\.]{1,9}).+(gecko)/i],[M,_]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[_,M],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[_,C.mapper.str,C.maps.os.windows],[M,C.mapper.str,C.maps.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[_,"Windows"],[M,C.mapper.str,C.maps.os.windows.version]],[/\((bb)(10);/i],[[_,"BlackBerry"],M],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[_,M],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[_,"Symbian"],M],[/\((series40);/i],[_],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[_,"Firefox OS"],M],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[[_,"Linux"],M],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[_,"Chromium OS"],M],[/(sunos)\s?([\w\.\d]*)/i],[[_,"Solaris"],M],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[[_,"Linux"],M],[/(iphone)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[_,"iOS"],[M,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[_,"iOS"],[M,/_/g,"."]],[/(haiku)\s(\w+)/i],[_,M],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[M,/_/g,"."],[_,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[_,"Mac"],[M,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[_,M]]},C);function C(){}vT.generate=function(e,t){var r,n,e=void 0===e?{navigator:{userAgent:"",vendor:"",languages:[]},screen:{width:"",height:""}}:e,i=dT.parse(e.navigator.userAgent).browser,o="";try{o=null!=(n=null==(r=screen.orientation.type.match(/\b(landscape|portrait)\b/))?void 0:r[0])?n:""}catch(e){}return{browserName:i.name||"",browserMajorVersion:i.major||"",browserVersion:i.version||"",orientation:o,userAgent:e.navigator.userAgent||"",pagePath:t.pagePath,pageTitle:t.pageName,host:t.host,url:t.url,referrer:t.referrer,queryParameter:t.queryParameter,protocol:t.protocol.replace(":","")}};var yT=vT;function vT(){}mT.generate=function(e){var t,r,n,i,e=void 0===e?{navigator:{userAgent:"",vendor:"",languages:[]},screen:{width:"",height:""}}:e,o=dT.parse(e.navigator.userAgent),s=o.os,o=o.device,a=e.screen,e=(null==(e=e.navigator.languages)?void 0:e[0])||"",u=e.split("-")[0],c=(null!=(c=o.type)?c:"pc").replace(/\b(mobile|smarttv)\b/g,function(e,t){return"mobile"===t?"phone":"smarttv"===t?"tv":e}),p=s.name||"",l="";try{p=null!=(r=null==(t=p.match(/\b(Mac|Windows|Linux|Android|iOS)\b/))?void 0:t[0])?r:p,orientation=null!=(i=null==(n=a.orientation.type.match(/\b(landscape|portrait)\b/))?void 0:n[0])?i:"",l=Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){}return{osName:p,osVersion:s.version||"",deviceModel:o.model||"",deviceType:c,deviceVendor:o.vendor||"",deviceBrand:o.vendor||"",screenWidth:a.width||"",screenHeight:a.height||"",locale:e,language:u,timeZone:l}};var gT=mT;function mT(){}wT.generate=function(e,t){t=null!=t?t:ts.createWithCurrentPage();return p(p({platform:"Web"},yT.generate(e,t)),gT.generate(e))};var ET=wT;function wT(){}AT.prototype.map=function(e){return new AT(e(this.previous),e(this.current))};var bT=AT;function AT(e,t){this.previous=e,this.current=t}TT.empty=function(){return this.from([])},TT.from=function(e){return new TT(e)},TT.fromDto=function(e){return this.from(e.events.map(function(e){return ci.fromJson(e)}))},Object.defineProperty(TT.prototype,"rawEvents",{get:function(){return this.events},enumerable:!1,configurable:!0});var IT=TT;function TT(e){this.events=e}NT.prototype.initContext=function(e,t){e=null!=(t=null!=t?t:e)?t:this.defaultUser;return MT.of(CT(e,this.hackleDeviceId),pT.empty(),IT.empty())},NT.prototype.addListener=function(e){this.userListeners.push(e)},Object.defineProperty(NT.prototype,"currentUser",{get:function(){return this.context.user},enumerable:!1,configurable:!0}),NT.prototype.resolve=function(e){e=this.resolveContext(e);return this.hackleUser(e)},NT.prototype.resolveContext=function(e){return void 0===e?this.context:("string"==typeof e?this.updateUser({id:e}):this.updateUser(e)).current},NT.prototype.toHackleUser=function(e){e=this.context.with(e);return this.hackleUser(e)},NT.prototype.hackleUser=function(e){var t=(new Gt).addIdentifiers(e.user.identifiers||{}).add(Kt.ID,e.user.id||this.hackleDeviceId).add(Kt.DEVICE,e.user.deviceId||this.hackleDeviceId).add(Kt.HACKLE_DEVICE,this.hackleDeviceId),t=(c.isNotNullOrUndefined(e.user.userId)&&t.add(Kt.USER,e.user.userId),t.build()),r=this.campaignParser.parse();return{identifiers:t,properties:p(p({},r),e.user.properties),hackleProperties:this.hackleProperties(),cohorts:e.cohorts.rawCohorts,targetEvents:e.targetEvents.rawEvents}},NT.prototype.hackleProperties=function(){return"undefined"!=typeof window?ET.generate(window,this.pageManager.currentPage):{}},NT.prototype.setUser=function(e){return this.updateUser(e).map(function(e){return e.user})},NT.prototype.setUserId=function(e){e=p(p({},this.context.user),{userId:e});return this.setUser(e)},NT.prototype.setDeviceId=function(e){e=p(p({},this.context.user),{deviceId:e});return this.setUser(e)},NT.prototype.updateUserProperties=function(e){return this.operateProperties(e).map(function(e){return e.user})},NT.prototype.resetUser=function(){var e=this;return this.updateContext(function(){return e.defaultUser}).map(function(e){return e.user})},NT.prototype.changeUser=function(t,r,n){this.userListeners.forEach(function(e){e.onUserUpdated(t,r,n)})},NT.prototype.saveUser=function(e){this.storage.saveUser(e)},NT.prototype.updateContext=function(e){var t=this.context,r=t.user,e=e(r),n=this.context.with(e);return this.context=n,cT(r,e)||(this.changeUser(r,e,this.clock.currentMillis()),this.saveUser(e)),new bT(t,n)},NT.prototype.updateUser=function(r){var n=this;return this.updateContext(function(e){return e=e,t=CT(r,n.hackleDeviceId),cT(e,t)?p(p({},t),{properties:p(p({},e.properties),t.properties)}):t;var t})},NT.prototype.operateProperties=function(r){return this.updateContext(function(e){var t=null!=(t=e.properties)?t:{},t=r.operate(new Map(Object.entries(t)));return p(p({},e),{properties:c.fromMap(t)})})},NT.prototype.sync=function(){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.syncCohort(),this.syncUserTarget()])];case 1:return e.sent(),[2]}})})},NT.prototype.syncIfNeeded=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return this.hasNewIdentifiers(t.previous,t.current)?[4,this.syncCohort()]:[3,2];case 1:e.sent(),e.label=2;case 2:return cT(t.previous,t.current)?[3,4]:[4,this.syncUserTarget()];case 3:e.sent(),e.label=4;case 4:return[2]}})})},NT.prototype.syncCohort=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.userCohortFetcher.fetch(this.currentUser)];case 1:return t=e.sent(),this.context=this.context.update(t,this.context.targetEvents),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync cohorts: ".concat(t)),[3,3];case 3:return[2]}})})},NT.prototype.syncUserTarget=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.userTargetFetcher.fetch(this.currentUser)];case 1:return t=e.sent(),this.context=this.context.update(this.context.cohorts,t),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync userTargets: ".concat(t)),[3,3];case 3:return[2]}})})},NT.prototype.hasNewIdentifiers=function(e,t){var r=jt(e),e=jt(t);return Object.entries(e).some(function(e){var t=e[0],e=e[1];return r[t]!==e})},NT.prototype.close=function(){return o(this,void 0,void 0,function(){return a(this,function(e){return[2]})})};var _T=NT;function NT(e,t,r,n,i,o,s,a,u){this.hackleDeviceId=e,this.storage=t,this.userTargetFetcher=r,this.userCohortFetcher=n,this.campaignParser=i,this.pageManager=o,this.clock=s,this.userListeners=[],this.defaultUser={id:this.hackleDeviceId,deviceId:this.hackleDeviceId},this.context=this.initContext(a,u),this.storage.saveUser(this.context.user)}OT.prototype.getUser=function(){var e=this.deviceId||void 0,t=this.userId||void 0;return void 0!==e||void 0!==t?{deviceId:e,userId:t}:null},OT.prototype.saveUser=function(e){this.setDeviceId(e.deviceId||null),this.setUserId(e.userId||null)},Object.defineProperty(OT.prototype,"deviceId",{get:function(){return this.storage.getItem(ot)},enumerable:!1,configurable:!0}),Object.defineProperty(OT.prototype,"userId",{get:function(){return this.storage.getItem(it)},enumerable:!1,configurable:!0}),OT.prototype.setDeviceId=function(e){this.setId(ot,e)},OT.prototype.setUserId=function(e){this.setId(it,e)},OT.prototype.setId=function(e,t){c.isNotNullOrUndefined(t)?this.storage.setItem(e,t):this.storage.removeItem(e)};var PT=OT;function OT(e){this.storage=e}ST.of=function(e,t,r){return new ST(e,t.filterBy(e),r)},ST.prototype.with=function(e){return ST.of(e,this.cohorts.filterBy(e),this.targetEvents)},ST.prototype.update=function(e,t){e=e.filterBy(this.user),e=this.cohorts.toBuilder().putAll(e).build();return ST.of(this.user,e,t)};var MT=ST;function ST(e,t,r){this.user=e,this.cohorts=t,this.targetEvents=r}var CT=function(e,t){return p(p({},e),{id:e.id||t,deviceId:e.deviceId||t})},RT=(Object.defineProperty(UT.prototype,"currentSessionId",{get:function(){return this._currentSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(UT.prototype,"sessionId",{get:function(){var e;return null!=(e=this._currentSessionId)?e:UT.EMPTY_SESSION_ID},enumerable:!1,configurable:!0}),Object.defineProperty(UT.prototype,"lastEventTime",{get:function(){return this._lastEventTime},enumerable:!1,configurable:!0}),UT.prototype.addListener=function(e){this.sessionListeners.push(e)},UT.prototype.startNewSession=function(e,t,r){return e&&this.endSession(e),this.newSession(t,r)},UT.prototype.startNewSessionIfNeeded=function(e,t){var r=this._lastEventTime;return null!==r&&null!==this._currentSessionId&&t-r<this.sessionTimeoutMillis?(this.updateLastEventTime(t),this._currentSessionId):this.startNewSession(e,e,t)},UT.prototype.updateLastEventTime=function(e){this._lastEventTime=e,this.storage.setItem(nt,"".concat(e))},UT.prototype.endSession=function(t){var r=this._currentSessionId,n=this._lastEventTime;null!==r&&null!==n&&this.sessionListeners.forEach(function(e){return e.onSessionEnded(r,t,n)})},UT.prototype.newSession=function(t,r){var n="".concat(r,".").concat(H().slice(0,8));return this.saveSession(n),this.updateLastEventTime(r),this.sessionListeners.forEach(function(e){e.onSessionStarted(n,t,r)}),n},UT.prototype.saveSession=function(e){this._currentSessionId=e,this.storage.setItem(rt,e)},UT.prototype.loadSession=function(){this._currentSessionId=this.storage.getItem(rt)},UT.prototype.loadLastEventTime=function(){var e=this.storage.getItem(nt);null!==e&&0<(e=Number.parseFloat(e))&&(this._lastEventTime=e)},UT.prototype.onUserUpdated=function(e,t,r){this.endSession(e),this.newSession(t,r)},UT.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.updateLastEventTime(t);case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}},UT.EMPTY_SESSION_ID="0.ffffffff",UT);function UT(e,t){this.sessionTimeoutMillis=e,this.storage=t,this.sessionListeners=[],this._currentSessionId=null,this._lastEventTime=null,this.loadSession(),this.loadLastEventTime()}xT.prototype.getItem=function(e){var t;return null!=(t=null==(t=this.storage)?void 0:t.getItem(e))?t:null},xT.prototype.removeItem=function(e){var t;null!=(t=this.storage)&&t.removeItem(e)},xT.prototype.setItem=function(e,t){var r;null!=(r=this.storage)&&r.setItem(e,t)},xT.prototype.clear=function(){var e;null!=(e=this.storage)&&e.clear()};var kT=xT;function xT(){this.storage=window.localStorage}LT.postfix=function(e,t){return new LT(e,function(e){return"".concat(e).concat(t)})},LT.prefix=function(e,t){return new LT(e,function(e){return"".concat(t).concat(e)})},LT.prototype.getItem=function(e){return this.delegate.getItem(this.transform(e))},LT.prototype.removeItem=function(e){this.delegate.removeItem(this.transform(e))},LT.prototype.setItem=function(e,t){this.delegate.setItem(this.transform(e),t)};var DT=LT;function LT(e,t){this.delegate=e,this.transform=t}VT.prototype.isEqualItem=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},VT.prototype.getRemainListSize=function(){try{return this.maxLength-JSON.stringify(this.getList()).length}catch(e){return 0}},VT.prototype.isAddableItem=function(e){try{return this.getRemainListSize()>JSON.stringify(e).length}catch(e){return!1}},VT.prototype.getVictimIndex=function(e){var t=this.getRemainListSize();try{var r=JSON.stringify(e),n=this.getList(),i=0;return n.findIndex(function(e){return(i+=JSON.stringify(e).length)+t>=r.length})}catch(e){return-1}},VT.prototype.getList=function(){try{var e=this.delegate.getItem(this.listKey);if(!e)return[];var t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return[]}},VT.prototype.entries=function(){return this.getList().flatMap(Object.entries)},VT.prototype.setItem=function(e,t){var r;try{this.removeItem(e);var n=this.getList(),i=((r={})[e]=t,r);if(!this.isAddableItem(i)){var o=this.getVictimIndex(i);if(o<0)return;n=n.slice(o+1)}var s=JSON.stringify(n.concat(i));this.delegate.setItem(this.listKey,s)}catch(e){}},VT.prototype.getItem=function(t){var r=this,e=this.getList().find(function(e){return r.isEqualItem(e,t)});if(e&&e[t])return e[t]},VT.prototype.removeItem=function(t){var r=this,e=this.getList();try{var n=e.filter(function(e){return!r.isEqualItem(e,t)}),i=JSON.stringify(n);this.delegate.setItem(this.listKey,i)}catch(e){}},VT.prototype.clear=function(){this.delegate.removeItem(this.listKey)};var FT=VT;function VT(e,t,r){void 0===r&&(r=4096);var n=this;this.delegate=e,this.listKey=t,this.encodedListCharLen=6,this.resolveMaxLength=function(e){e-=n.encodedListCharLen;return e<0?0:e},this.maxLength=this.resolveMaxLength(r)}KT.prototype.currentUser=function(){return this.userManager.resolve()},KT.prototype.getAbTestDecisions=function(){return this.core.experiments(this.currentUser()).entries()},KT.prototype.getAbTestOverrides=function(){return this.abOverrideStorage.getAll()},KT.prototype.setAbTestOverride=function(e,t){this.abOverrideStorage.set(e,t),this.increment("AB_TEST","set")},KT.prototype.resetAbTestOverride=function(e){this.abOverrideStorage.remove(e),this.increment("AB_TEST","reset")},KT.prototype.resetAllAbTestOverride=function(){this.abOverrideStorage.clear(),this.increment("AB_TEST","reset.all")},KT.prototype.getFeatureFlagDecisions=function(){return this.core.featureFlags(this.currentUser()).entries()},KT.prototype.getFeatureFlagOverrides=function(){return this.ffOverrideStorage.getAll()},KT.prototype.setFeatureFlagOverride=function(e,t){this.ffOverrideStorage.set(e,t),this.increment("FEATURE_FLAG","set")},KT.prototype.resetFeatureFlagOverride=function(e){this.ffOverrideStorage.remove(e),this.increment("FEATURE_FLAG","reset")},KT.prototype.resetAllFeatureFlagOverride=function(){this.ffOverrideStorage.clear(),this.increment("FEATURE_FLAG","reset.all")},KT.prototype.increment=function(e,t){zi.counter("experiment.manual.override",{"experiment.type":e,operation:t}).increment()};var BT=KT;function KT(e,t,r,n){this.core=e,this.userManager=t,this.abOverrideStorage=r,this.ffOverrideStorage=n}jT.serverFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},jT.clientFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},jT.userCohorts=function(e){return"".concat(e,"/api/v1/cohorts")},jT.serverDispatch=function(e){return"".concat(e,"/api/v2/events")},jT.clientDispatch=function(e){return"".concat(e,"/api/v2/w/events")},jT.beaconDispatch=function(e,t){return"".concat(e,"/api/v2/w/").concat(t,"/events")},jT.inAppMessageRenderer=function(e,t){return"".concat(e,"/sdk/iam-renderer/").concat(t,"/iam-renderer.js")},jT.monitoring=function(e){return"".concat(e,"/metrics")},jT.userTargets=function(e){return"".concat(e,"/api/v1/user-targets")};var HT=jT;function jT(){}zT.prototype.exist=function(e,t){var e=this.key(e),r=this.storage.getItem(e);if(c.isNullOrUndefined(r))return!1;r=Number.parseInt(r,10);return!Number.isNaN(r)&&t<=r||(this.storage.removeItem(e),!1)},zT.prototype.put=function(e,t){this.storage.setItem(this.key(e),"".concat(t))},zT.prototype.key=function(e){return"".concat(e.key)};var GT=zT;function zT(e){this.storage=e}JT.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var YT=JT;function JT(e){this.handlers=e}WT.prototype.handle=function(e,t){e.close()},WT.prototype.supports=function(e){return"CLOSE"===e.type};var qT=WT;function WT(){}XT.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},XT.prototype.supports=function(e){return"WEB_LINK"===e.type};var $T=XT;function XT(e){this.urlHandler=e}QT.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},QT.prototype.supports=function(e){return"LINK_AND_CLOSE"===e.type};var ZT=QT;function QT(e){this.urlHandler=e}t_.prototype.handle=function(e,t){var r;e.context.decisionReason!==l.OVERRIDDEN&&(r=this.clock.currentMillis()+864e5,this.storage.put(e.context.inAppMessage,r)),e.close()},t_.prototype.supports=function(e){return"HIDDEN"===e.type};var e_=t_;function t_(e,t){this.storage=e,this.clock=t}n_.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},n_.prototype.supports=function(e){return"LINK_NEW_WINDOW"===e.type};var r_=n_;function n_(e){this.urlHandler=e}o_.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},o_.prototype.supports=function(e){return"LINK_NEW_WINDOW_AND_CLOSE"===e.type};var i_=o_;function o_(e){this.urlHandler=e}a_.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},a_.prototype.supports=function(e){return"LINK_NEW_TAB"===e.type};var s_=a_;function a_(e){this.urlHandler=e}c_.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},c_.prototype.supports=function(e){return"LINK_NEW_TAB_AND_CLOSE"===e.type};var u_=c_;function c_(e){this.urlHandler=e}l_.prototype.track=function(e,t,r){t=this.createTrackEvent(t,e);this.core.track(t,e.user,r)},l_.prototype.commonProperties=function(e){return p(p({},e.properties),{in_app_message_id:e.inAppMessage.id,in_app_message_key:e.inAppMessage.key,in_app_message_display_type:e.message.layout.displayType,decision_reason:String(e.decisionReason)})},l_.prototype.createTrackEvent=function(e,t){switch(e.type){case"IMPRESSION":return{key:"$in_app_impression",properties:p(p({},this.commonProperties(t)),{title_text:null==(r=null==(r=t.message.text)?void 0:r.title)?void 0:r.text,body_text:null==(r=null==(r=t.message.text)?void 0:r.body)?void 0:r.text,button_text:t.message.buttons.map(function(e){return e.text}),image_url:t.message.images.map(function(e){return e.imagePath})})};case"CLOSE":return{key:"$in_app_close",properties:this.commonProperties(t)};case"ACTION":var r=e;return{key:"$in_app_action",properties:p(p({},this.commonProperties(t)),{action_type:r.action.type,action_area:r.area,action_value:r.action.value,button_text:r.buttonText,image_url:r.imageUrl,image_order:r.imageOrder,element_id:r.elementId})};case"IMAGE_IMPRESSION":r=e;return{key:"$in_app_image_impression",properties:p(p({},this.commonProperties(t)),{image_url:r.imageUrl,image_order:r.imageOrder})}}};var p_=l_;function l_(e){this.core=e}h_.prototype.setListener=function(e){this.inAppMessageListener=e},h_.prototype.present=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){switch(e.label){case 0:if(this.currentMessageView)return[2];if(this.opening)return[2];this.opening=!0,t=null,e.label=1;case 1:return(e.trys.push([1,3,4,5]),r=c.requiredNotNullOrUndefined(this.viewFactories.get(n),function(){return"Unsupported InAppMessagePresentationContext[".concat(n.message.layout.displayType,"], Can't create message view")}),null===(t=r.create(n,this)))?[2]:[4,(this.currentMessageView=t).open()];case 2:return e.sent(),[3,5];case 3:return e.sent(),null!=t&&t.close(),[3,5];case 4:return this.opening=!1,[7];case 5:return[2]}})})};var f_=h_;function h_(e,t,r,n){void 0===n&&(n=null),this.viewFactories=e,this.viewEventHandleProcessor=t,this.interactionHandlerFactory=r,this.inAppMessageListener=n,this.currentMessageView=null,this.opening=!1}d_.prototype.canOpen=function(){return this.status.canOpen()},d_.prototype.beginOpen=function(){var e,t,r=os.toPublic(this.context.inAppMessage);this.status.current="OPENING",null!=(t=null==(e=this.ui.inAppMessageListener)?void 0:e.beforeInAppMessageOpen)&&t.call(e,r)},d_.prototype.completeOpen=function(){var e,t,r=os.toPublic(this.context.inAppMessage);this.trackImpression(),this.status.current="OPENED",null!=(t=null==(e=this.ui.inAppMessageListener)?void 0:e.afterInAppMessageOpen)&&t.call(e,r)},d_.prototype.failOpen=function(){this.destroy()},d_.prototype.canClose=function(){return this.status.canClose()},d_.prototype.beginClose=function(){var e,t,r=os.toPublic(this.context.inAppMessage);null!=(t=null==(e=this.ui.inAppMessageListener)?void 0:e.beforeInAppMessageClose)&&t.call(e,r),this.status.current="CLOSING"},d_.prototype.completeClose=function(){var e,t,r=os.toPublic(this.context.inAppMessage);this.trackClose(),this.destroy(),null!=(t=null==(e=this.ui.inAppMessageListener)?void 0:e.afterInAppMessageClose)&&t.call(e,r)},d_.prototype.failClose=function(){var e,t,r=os.toPublic(this.context.inAppMessage);this.destroy(),null!=(t=null==(e=this.ui.inAppMessageListener)?void 0:e.afterInAppMessageClose)&&t.call(e,r)},d_.prototype.destroy=function(){this.destroyView(),this.ui.currentMessageView=null,this.status.current="CLOSED"},d_.prototype.handleEvent=function(e,t){this.ui.viewEventHandleProcessor.process(this,e,t=void 0===t?["ACTION","TRACK"]:t)},d_.prototype.trackClose=function(){this.handleEvent({type:"CLOSE"},["TRACK"])},d_.prototype.trackImpression=function(){this.handleEvent({type:"IMPRESSION"},["TRACK"])};Wl=d_;function d_(e,t,r){this.context=e,this.ui=t,this.status=r}i(g_,y_=Wl),g_.prototype.open=function(){return o(this,void 0,void 0,function(){var t,r,n=this;return a(this,function(e){switch(e.label){case 0:if(!this.canOpen())return s.log.debug("InAppMessage is already opened. (key=".concat(this.context.inAppMessage.key,")")),[2];e.label=1;case 1:return e.trys.push([1,4,,5]),this.beginOpen(),window.addEventListener(g_.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.addEventListener(g_.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE,this.resolveLifecycleEnd),[4,this.scriptLoader.load()];case 2:return e.sent(),(t=this.addContainer()).style.display="none",t.classList.add("".concat(g_.CONTAINER_CLASS_NAME,"--loading")),r=window.HackleInAppMessageRenderer,this.renderer=new r.HackleInAppMessageRenderer(t),r=this.renderTypeResolver.resolve(this.context),[4,this.renderer.render({messageId:this.context.inAppMessage.id,message:this.context.message.toJson(),renderType:r})];case 3:return e.sent(),t.classList.remove("".concat(g_.CONTAINER_CLASS_NAME,"--loading")),t.style.display="block",this.handleInAppMessageLifecycle("OPEN",function(){n.completeOpen()},function(){s.log.warn("Failed to open inAppMessage with [Timeout expired.]"),n.destroy()}),[3,5];case 4:return r=e.sent(),s.log.error("Failed to open Script inAppMessage: ".concat(r)),this.failOpen(),[3,5];case 5:return[2]}})})},g_.prototype.close=function(){var e=this;this.canClose()?(this.beginClose(),this.handleInAppMessageLifecycle("CLOSE",function(){e.completeClose()},function(){s.log.warn("Failed to close inAppMessage with [Timeout expired.]"),e.failClose()})):s.log.debug("InAppMessage is already closed. (key=".concat(this.context.inAppMessage.key,")"))},g_.prototype.handleInAppMessageLifecycle=function(e,t,r){var n=this,i=this.lifecycleRegistry.register(e,t);window.dispatchEvent(new CustomEvent(g_.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE,{detail:{type:e,id:i}})),setTimeout(function(){void 0!==n.lifecycleRegistry.getAndRemove(e,i)&&r()},g_.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT)},g_.prototype.destroyView=function(){var e;window.removeEventListener(g_.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.removeEventListener(g_.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE,this.resolveLifecycleEnd),null!=(e=this.renderer)&&e.destroy(),this.renderer=null,this.removeContainer()},g_.prototype.addContainer=function(){var e;return this.container||((e=document.createElement("div")).classList.add(g_.CONTAINER_CLASS_NAME),this.container=e),this.container.parentNode||document.body.appendChild(this.container),this.container},g_.prototype.removeContainer=function(){var e;this.container&&(null!=(e=this.container.parentNode)&&e.removeChild(this.container),this.container=null)},g_.prototype.handleInteraction=function(e){var t=this.ui.interactionHandlerFactory.get(e);t&&t.handle(this,e)},g_.HACKLE_IAM_INTERACTION_EVENT_TYPE="hackle-iam-interaction",g_.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE="hackle-iam-lifecycle-start",g_.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE="hackle-iam-lifecycle-end",g_.CONTAINER_CLASS_NAME="hackle-iam",g_.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT=5e3;var y_,v_=g_;function g_(e,t,r,n,i,o){var s=y_.call(this,t,r,i)||this;return s.scriptLoader=e,s.context=t,s.ui=r,s.renderTypeResolver=n,s.status=i,s.lifecycleRegistry=o,s.container=null,s.renderer=null,s.resolveLifecycleEnd=function(e){var t;e instanceof CustomEvent&&("string"==typeof(t=e).detail.id&&["OPEN","CLOSE"].includes(t.detail.type))&&(e=(t=e.detail).id,t=t.type,null!=(t=s.lifecycleRegistry.getAndRemove(t,e))&&t())},s.handleInAppMessageInteraction=function(e){e instanceof CustomEvent&&e.type===g_.HACKLE_IAM_INTERACTION_EVENT_TYPE&&(e=e.detail,s.handleInteraction(e))},s}E_.prototype.isMobileOS=function(e){e=e.user.hackleProperties.osName;return"string"==typeof e&&Boolean(e.match(this.mobileOSRegex))},E_.prototype.isMobileDeviceType=function(e){e=e.user.hackleProperties.deviceType;return"string"==typeof e&&Boolean(e.match(this.mobileDeviceRegex))},E_.prototype.resolve=function(e){return this.isMobileOS(e)||this.isMobileDeviceType(e)?"mobile":"pc"};var m_=E_;function E_(){this.mobileOSRegex=/(iOS|Android|iPad|iPhone)/g,this.mobileDeviceRegex=/(mobile|phone|tablet)/g}b_.prototype.canOpen=function(){return"OPENED"!==this.current&&"OPENING"!==this.current},b_.prototype.canClose=function(){return"CLOSED"!==this.current&&"CLOSING"!==this.current};var w_=b_;function b_(e){this.current=e=void 0===e?"CLOSED":e}I_.prototype.resolveKey=function(e,t){return"".concat(e,"_").concat(t)},I_.prototype.register=function(e,t){var r=H(),e=this.resolveKey(e,r);return this.record[e]=t,r},I_.prototype.getAndRemove=function(e,t){var e=this.resolveKey(e,t),t=this.record,r=t[e],t=function(e,t){var r={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}(t,["symbol"==typeof e?e:e+""]);return this.record=t,r};var A_=I_;function I_(){this.record={}}__.create=function(e){return new __(e)},__.prototype.create=function(e,t){var r=new m_,n=new w_,i=new A_;switch(e.message.layout.displayType){case"HTML":throw new Error("Invalid displayType[HTML] found. Can't create InAppMessageView. (key=".concat(e.inAppMessage.key,")"));case"MODAL":case"BANNER":case"BOTTOM_SHEET":return new v_(this.scriptLoader,e,t,r,n,i);case"NONE":return null}},__.prototype.supports=function(t){return this.supportedDisplayTypes.some(function(e){return e===t.message.layout.displayType})};var T_=__;function __(e){this.scriptLoader=e,this.supportedDisplayTypes=["MODAL","BANNER","BOTTOM_SHEET","NONE"]}P_.prototype.load=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return window.HackleInAppMessageRenderer?[2]:(t=this.createScript(),document.head.appendChild(t),[4,this.waitForLoad(t)]);case 1:return[2,e.sent()]}})})},P_.prototype.createScript=function(){var e=document.createElement("script");return e.type="text/javascript",e.async=!0,e.src=this.scriptUrl,e},P_.prototype.waitForLoad=function(o){return new Promise(function(e,t){function r(){o.removeEventListener("error",i),o.removeEventListener("load",n)}var n=function(){r(),e(o)},i=function(e){r(),t(e.message)};o.addEventListener("load",n),o.addEventListener("error",i)})};var N_=P_;function P_(e){this.scriptUrl=e}M_.prototype.matches=function(t,r,n){var i=this;return r.eventTrigger.rules.some(function(e){return i.ruleMatches(t,n,r,e)})},M_.prototype.ruleMatches=function(e,t,r,n){if(t.event.key!==n.eventKey)return!1;e=S_.of(e,t,r);return this.targetMatcher.anyMatches(e,V0.create(),n.targets)};var O_=M_;function M_(e){this.targetMatcher=e}C_.of=function(e,t,r){return new C_(new L0("IN_APP_MESSAGE",r.id),e,t.user,t)};var S_=C_;function C_(e,t,r,n){this.key=e,this.workspace=t,this.user=r,this.event=n}U_.prototype.get=function(e){e=this.storage.getItem(e.id.toString());return c.isNullOrUndefined(e)?[]:JSON.parse(e)},U_.prototype.set=function(e,t){this.storage.setItem(e.id.toString(),JSON.stringify(t))};var R_=U_;function U_(e){this.storage=e}x_.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var k_=x_;function x_(e){this.handlers=e}L_.prototype.handle=function(e,t,r){this.eventTracker.track(e.context,t,r)},L_.prototype.supports=function(e){return"TRACK"===e};var D_=L_;function L_(e){this.eventTracker=e}V_.prototype.handle=function(e,t,r){var n=this.viewEventActorFactory.get(t);null!=n&&n.action(e,t)},V_.prototype.supports=function(e){return"ACTION"===e};var F_=V_;function V_(e){this.viewEventActorFactory=e}K_.prototype.process=function(t,r,e){var n=this;e.forEach(function(e){e=n.handlerFactory.get(e);null!=e&&e.handle(t,r,n.clock.currentMillis())})};var B_=K_;function K_(e,t){this.clock=e,this.handlerFactory=t}j_.prototype.matches=function(e,t,r){return this.ruleMatcher.matches(e,t,r)};var H_=j_;function j_(e){this.ruleMatcher=e}z_.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var G_=z_;function z_(e){this.handlers=e}J_.prototype.handle=function(e,t){e.close()},J_.prototype.supports=function(e){return"CLOSE"===e.type};var Y_=J_;function J_(){}W_.prototype.handle=function(e,t){t=this.eventOrNull(t);t&&this.handleProcessor.process(e,t,["ACTION"])},W_.prototype.eventOrNull=function(e){var t=Hn.fromJson(e.action);return t?{type:"ACTION",action:t,area:e.area,buttonText:e.buttonText,imageUrl:e.imageUrl,imageOrder:e.imageOrder}:null},W_.prototype.supports=function(e){return"ACTION"===e.type};var q_=W_;function W_(e){this.handleProcessor=e}X_.prototype.handle=function(e,t){t={type:"IMAGE_IMPRESSION",imageUrl:t.imageUrl,imageOrder:t.imageOrder};this.handleProcessor.process(e,t,["TRACK"])},X_.prototype.supports=function(e){return"IMAGE_IMPRESSION"===e.type};var $_=X_;function X_(e){this.handleProcessor=e}Q_.prototype.open=function(e){window.location.href=e.href};var Z_=Q_;function Q_(){}tN.prototype.open=function(e){window.open(e.href,"Hackle","resizable:true")};var eN=tN;function tN(){}nN.prototype.open=function(e){window.open(e.href)};var rN=nN;function nN(){}oN.prototype.open=function(e){window.location.replace(e.href)};var iN=oN;function oN(){}function sN(e,t,r){return null===e||(!cN(t,aN)||r.current!==r.referrer)&&!cN(e,t)}var aN={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,gclid:void 0,fbclid:void 0},uN={current:void 0,referrer:void 0},cN=function(t,r){return Object.keys(aN).every(function(e){return t[e]===r[e]})},pN=(lN.prototype.startNewCampaign=function(e,t,r){for(var t=p(p({},aN),t),n=new Wo,i=0,o=Object.entries(t);i<o.length;i++){var s=o[i],a=s[0],s=s[1];s?n.set(a,s):n.unset(a)}var t=n.build(),u=t.toEvent(),e=this.userManager.toHackleUser(e);this.core.track(u,e,r),this.userManager.updateUserProperties(t)},lN.prototype.startNewCampaignIfNeeded=function(e,t){var r=this.storage.get(),n=this.parser.parse(),i=this.parser.parseDomain();sN(r,n,i)&&(this.storage.set(n),this.startNewCampaign(e,n,t))},lN.prototype.onSessionEnded=function(e,t,r){},lN.prototype.onSessionStarted=function(e,t,r){this.startNewCampaignIfNeeded(t,r)},lN);function lN(e,t,r,n){this.storage=e,this.parser=t,this.core=r,this.userManager=n}hN.prototype.get=function(){var e=this.storage.getItem(st);return e?JSON.parse(e):null},hN.prototype.set=function(e){this.storage.setItem(st,JSON.stringify(e))};var fN=hN;function hN(e){this.storage=e}yN.prototype.getQueryParam=function(e){return this.getQueryParams(function(){return!0})[e]||""},yN.prototype.getQueryParams=function(e){for(var t={},r=0,n=this.search.substring(1).split("&");r<n.length;r++){var i=n[r].split("="),o=i[0],i=i[1];e&&!e(o,i)||(i=ds.tryDecodeURIComponent(i))&&(t[o]=i)}return t};var dN=yN;function yN(e){this.search=e}gN.extractDomain=function(e){var t=this.DOMAIN_MATCH_REGEX,r=e.split("."),r=r[r.length-1],r=((4<r.length||"com"===r||"org"===r)&&(t=this.SIMPLE_DOMAIN_MATCH_REGEX),e.match(t));return r?r[0]:e},gN.DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,gN.SIMPLE_DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i;var vN=gN;function gN(){}EN.prototype.parse=function(e){e=this.params(e);return this.resolve(e)},EN.prototype.params=function(e){e=c.isNotNullOrUndefined(e)?e:this.pageManager.currentPage.queryParameter;return new dN(e).getQueryParams(EN.CAMPAIGN_QUERY_CONDITION)},EN.prototype.resolve=function(e){return{utm_campaign:e[wN],utm_content:e[bN],utm_id:e[AN],utm_medium:e[IN],utm_source:e[TN],utm_term:e[_N],gclid:e[NN],fbclid:e[PN]}},EN.prototype.parseDomain=function(){var t=this;if("undefined"==typeof window)return uN;return{current:vN.extractDomain(this.pageManager.currentPage.hostname),referrer:function(){var e=t.pageManager.currentPage.referrer;if(e)return e=new URL(e).hostname,vN.extractDomain(e)}()}},EN.CAMPAIGN_QUERY_CONDITION=function(e,t){return Ji.isNotEmptyString(t)};var mN=EN;function EN(e){this.pageManager=e}var wN="utm_campaign",bN="utm_content",AN="utm_id",IN="utm_medium",TN="utm_source",_N="utm_term",NN="gclid",PN="fbclid",ON=(MN.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},MN.prototype.send=function(e){var t=e.experiment.key,r=e.variationKey,t="HACKLE-EXPERIMENT_".concat(t,"_V").concat(e.experiment.version,"-").concat(r);try{window.gtag("event","experience_impression",{exp_variant_string:t})}catch(e){s.log.error("Unexpected exception while sending an event to Google Analytics with gtag: ".concat(e))}},MN);function MN(e,t){var r=this;this.userEventEmitter=e,this.determiner=t,this.onEvent=function(e){e=r.determiner.determineTargetExposureOrNull(e);e&&r.send(e)},this.initialize()}CN.prototype.determineTargetExposureOrNull=function(e){var t=this.workspaceFetcher.get();return!t||!t.getAttributes().integration_ga_experiment||!c0.isExposureEvent(e)||"RUNNING"!==e.experiment.status||e.decisionReason!==l.TRAFFIC_ALLOCATED?null:e};var SN=CN;function CN(e){this.workspaceFetcher=e}var RN={user:void 0,debug:!1,log_disabled:!1,automaticPageTracking:!0,automaticRouteTracking:!0,pollingIntervalMillis:-1,exposureEventDedupIntervalMillis:6e4,sessionTimeoutMillis:18e5,autoOpenDevTool:!1,sdkUrl:"https://sdk-api.hackle.io",eventUrl:"https://event-api.hackle.io",monitoringUrl:"https://monitoring.hackle.io",enableMonitoring:!0,cdnUrl:"https://static.hackle.io",sameSiteCookie:"LAX",secureCookie:!1,SDK_NAME_HEADER:"javascript-sdk_browser",SDK_VERSION_HEADER:"11.54.0-RC.1-canary.41",IAM_RENDERER_VERSION_HEADER:"0.0.12"},UN=(kN.config=function(e){return p(p(p({},RN),e),{automaticPageTracking:kN.resolveAutomaticPageTracking(e)})},kN.resolveAutomaticPageTracking=function(e){return"boolean"!=typeof(null==e?void 0:e.automaticPageTracking)&&"boolean"!=typeof(null==e?void 0:e.auto_track_page_view)?RN.automaticPageTracking:!!e.automaticPageTracking||!!e.auto_track_page_view},kN.logging=function(e){s.initCounter(function(e){return zi.counter("log",{level:e})}),s.setLogLevel(Te.INFO),e.log_disabled?s.setLogLevel(Te.DISABLE):e.debug&&s.setLogLevel(Te.DEBUG)},kN.sdk=function(e,t){return s.log.debug("SDK key: ".concat(e)),e||s.log.error("invalid sdk key: '".concat(e,"' (expected: not null, not undefined and not empty string)")),{key:e,name:t.SDK_NAME_HEADER,version:t.SDK_VERSION_HEADER}},kN.isBeaconSupported=function(){var e=!1;return"undefined"!=typeof window&&(e=window&&window.navigator&&!!window.navigator.sendBeacon&&!0)&&s.log.debug("support sendBeacon API"),e},kN.pollingIntervalMillis=function(e){return void 0===e.pollingIntervalMillis||"number"!=typeof e.pollingIntervalMillis||e.pollingIntervalMillis<=0?-1:Math.max(e.pollingIntervalMillis,6e4)},kN.dedupIntervalMillis=function(e){return void 0===e.exposureEventDedupIntervalMillis||"number"!=typeof e.exposureEventDedupIntervalMillis?6e4:e.exposureEventDedupIntervalMillis<1e3||36e5<e.exposureEventDedupIntervalMillis?(s.log.warn("Exposure event dedup interval is outside allowed range[1_000ms..3_600_000ms]. Setting to default value[1m]."),6e4):e.exposureEventDedupIntervalMillis},kN);function kN(){}DN.prototype.add=function(e){this.synchronizers.push(e)},DN.prototype.sync=function(){return o(this,void 0,void 0,function(){var t=this;return a(this,function(e){switch(e.label){case 0:return[4,Promise.all(this.synchronizers.map(function(e){return t.safe(e.sync())}))];case 1:return e.sent(),[2]}})})},DN.prototype.close=function(){return o(this,void 0,void 0,function(){var t=this;return a(this,function(e){switch(e.label){case 0:return[4,Promise.all(this.synchronizers.map(function(e){return t.safe(e.close())}))];case 1:return e.sent(),[2]}})})},DN.prototype.safe=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,r];case 1:return e.sent(),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync: ".concat(t)),[3,3];case 3:return[2]}})})};var xN=DN;function DN(){this.synchronizers=[]}FN.prototype.sync=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.delegate.sync()];case 1:return e.sent(),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync: ".concat(t)),[3,3];case 3:return[2]}})})},FN.prototype.start=function(){var e=this;-1!==this.intervalMillis&&null===this.pollingJob&&(this.pollingJob=this.scheduler.schedulePeriodically(this.intervalMillis,this.intervalMillis,function(){return e.sync()}))},FN.prototype.stop=function(){var e;-1!==this.intervalMillis&&(null!=(e=this.pollingJob)&&e.cancel(),this.pollingJob=null)},FN.prototype.close=function(){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return this.stop(),[4,this.delegate.close()];case 1:return e.sent(),[2]}})})};var LN=FN;function FN(e,t,r){this.delegate=e,this.scheduler=t,this.intervalMillis=r,this.pollingJob=null}BN.prototype.schedule=function(e,t){e=new KN(e,t);return e.start(),e},BN.prototype.schedulePeriodically=function(e,t,r){var n;switch(this.scheduleType){case"setTimeout":n=new jN(e,t,r);break;case"setInterval":n=new zN(e,t,r)}return n.start(),n};var VN=BN;function BN(e){this.scheduleType=e}HN.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){try{e.task()}catch(e){s.log.error("Failed to run task: ".concat(e))}finally{e.timeout=null}},this.delayMillis)},HN.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var KN=HN;function HN(e,t){this.delayMillis=e,this.task=t,this.timeout=null}GN.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.run()},this.delayMillis)},GN.prototype.run=function(){var e=this;try{this.task()}catch(e){s.log.error("Failed to run task: ".concat(e))}this.timeout=setTimeout(function(){return e.run()},this.intervalMillis)},GN.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var jN=GN;function GN(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null}YN.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){e.run(),e.interval=setInterval(function(){return e.run()},e.intervalMillis)},this.delayMillis)},YN.prototype.run=function(){try{this.task()}catch(e){s.log.error("Failed to run task: ".concat(e))}},YN.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.interval&&(clearInterval(this.interval),this.interval=null)};var zN=YN;function YN(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null,this.interval=null}qN.prototype.fetchIfModified=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},qN.prototype.createRequest=function(e){var t=Wi.builder().url(this.url).method("GET");return null!==e&&t.addHeader(to.IF_MODIFIED_SINCE,e),t.build()},qN.prototype.execute=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){switch(e.label){case 0:t=hi.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),po.record("get.workspace",t,r),[2,r];case 3:throw r=e.sent(),po.record("get.workspace",t,null),r;case 4:return[2]}})})},qN.prototype.handleResponse=function(e){if(e.isNotModified())return null;if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is empty");return{config:JSON.parse(e.body),lastModified:e.headers.get(to.LAST_MODIFIED)}};var JN=qN;function qN(e,t){this.url=e,this.transport=t}$N.prototype.fetch=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},$N.prototype.createRequest=function(e){e={identifiers:jt(e)},e=be.encodeURL(JSON.stringify(e));return Wi.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},$N.prototype.execute=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){switch(e.label){case 0:t=hi.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),po.record("get.cohorts",t,r),[2,r];case 3:throw r=e.sent(),po.record("get.cohorts",t,null),r;case 4:return[2]}})})},$N.prototype.handleResponse=function(e){if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is null");e=JSON.parse(e.body);return pT.fromDto(e)};var WN=$N;function $N(e,t){this.url=e,this.transport=t}ZN.prototype.fetch=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},ZN.prototype.createRequest=function(e){e={identifiers:jt(e)},e=be.encodeURL(JSON.stringify(e));return Wi.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},ZN.prototype.execute=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){switch(e.label){case 0:t=hi.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),po.record("get.user-targets",t,r),[2,r];case 3:throw r=e.sent(),po.record("get.user-targets",t,null),r;case 4:return[2]}})})},ZN.prototype.handleResponse=function(e){if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is null");e=JSON.parse(e.body);return IT.fromDto(e)};var XN=ZN;function ZN(e,t){this.url=e,this.transport=t}eP.prototype.getExperiments=function(){return Array.from(this.experiments.values())},eP.prototype.getSplitUrlExperiments=function(){return Array.from(this.splitUrlExperiments.values())},eP.prototype.getFeatureFlags=function(){return Array.from(this.featureFlags.values())},eP.prototype.getInAppMessages=function(){return Array.from(this.inAppMessages.values())},eP.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},eP.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},eP.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},eP.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)},eP.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},eP.prototype.getContainerOrNull=function(e){return this.containers.get(e)},eP.prototype.getParameterConfigurationOrNull=function(e){return this.parameterConfigurations.get(e)},eP.prototype.getRemoteConfigParameterOrNull=function(e){return this.remoteConfigParameters.get(e)},eP.prototype.getInAppMessageOrNull=function(e){return this.inAppMessages.get(e)},eP.prototype.getAttributes=function(){return this.attributes},eP.from=function(e){var t=e.parameterConfigurations.map(Ot.fromJson),r=f.mapNotNullOrUndefined(e.experiments,function(e){return Ct.fromJson("AB_TEST",e,t)}),n=f.mapNotNullOrUndefined(e.experiments,function(e){return Ct.fromJson("AB_TEST",e,t)}).filter(function(e){return"SPLIT_URL"===e.implementationType}),i=f.mapNotNullOrUndefined(e.featureFlags,function(e){return Ct.fromJson("FEATURE_FLAG",e,t)}),o=e.buckets.map(xt.fromJson),s=e.events.map(Vt.fromJson),a=f.mapNotNullOrUndefined(e.segments,or.fromJson),u=e.containers.map(ar.fromJson),c=f.mapNotNullOrUndefined(e.remoteConfigParameters,lr.fromJson),p=f.mapNotNullOrUndefined(e.inAppMessages,Hr.fromJson),e=e.workspace.attributes;return new eP(r,n,i,o,s,a,u,t,c,p,e)};var QN=eP;function eP(e,t,r,n,i,o,s,a,u,c,p){this.experiments=f.associateBy(e,function(e){return e.key}),this.splitUrlExperiments=f.associateBy(t,function(e){return e.key}),this.featureFlags=f.associateBy(r,function(e){return e.key}),this.buckets=f.associateBy(n,function(e){return e.id}),this.eventTypes=f.associateBy(i,function(e){return e.key}),this.segments=f.associateBy(o,function(e){return e.key}),this.containers=f.associateBy(s,function(e){return e.id}),this.parameterConfigurations=f.associateBy(a,function(e){return e.id}),this.remoteConfigParameters=f.associateBy(u,function(e){return e.key}),this.inAppMessages=f.associateBy(c,function(e){return e.key}),this.attributes=p}rP.prototype.setConfig=function(e){this.setWorkspace(e),this.lastModified=e.lastModified},rP.prototype.setWorkspace=function(e){try{this.workspace=QN.from(e.config)}catch(e){s.log.error("Failed to set workspace: ".concat(e))}},rP.prototype.get=function(){return this.workspace},rP.prototype.sync=function(){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.workspaceFetcher.fetchIfModified(this.lastModified)];case 1:return(t=e.sent())&&(this.setConfig(t),this.workspaceConfigStorage.set(t)),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync workspace: ".concat(t)),[3,3];case 3:return[2]}})})},rP.prototype.close=function(){return o(this,void 0,void 0,function(){return a(this,function(e){return[2]})})};var tP=rP;function rP(e,t){this.workspaceConfigStorage=e,this.workspaceFetcher=t,this.workspace=null,this.lastModified=null;e=this.workspaceConfigStorage.get();e&&this.setConfig(e)}iP.prototype.dispatch=function(e,t){e=e.map(function(e){return e.toDto()});return t?this.dispatchEventsSynchronously(e):this.dispatchEvents(e)},iP.prototype.dispatchEventsSynchronously=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return[4,this.retryManager.add(r)];case 1:return e.sent(),[4,this.synchronousTransport.send(r)];case 2:return(t=e.sent()).isSuccessful()||t.isClientError()?[4,this.retryManager.delete(r)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}})})},iP.prototype.dispatchEvents=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return[4,this.transport.send(r)];case 1:return(t=e.sent()).isSuccessful()||t.isClientError()?[2]:[4,this.retryManager.add(r)];case 2:return e.sent(),[2]}})})};var nP=iP;function iP(e,t,r){this.transport=e,this.synchronousTransport=t,this.retryManager=r}sP.prototype.send=function(e){e=this.createRequest(e);return this.execute(e)},sP.prototype.createRequest=function(e){e=e,t=new Array,r=new Array,n=new Array,e.forEach(function(e){e instanceof c0?c0.isExposureEvent(e)?t.push(e.toDto()):c0.isTrackEvent(e)?r.push(e.toDto()):c0.isRemoteConfigEvent(e)&&n.push(e.toDto()):c0.isExposureEventDto(e)?t.push(e):c0.isTrackEventDto(e)?r.push(e):c0.isRemoteConfigEventDto(e)&&n.push(e)});var t,r,n,e={exposureEvents:t,trackEvents:r,remoteConfigEvents:n};return Wi.builder().url(this.url).method("POST").addHeader("Content-Type","application/json").body(JSON.stringify(e)).build()},sP.prototype.execute=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){switch(e.label){case 0:t=hi.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),po.record("post.events",t,r),[2,r];case 3:throw r=e.sent(),po.record("post.events",t,null),r;case 4:return[2]}})})};var oP=sP;function sP(e,t){this.url=e,this.transport=t}uP.prototype.add=function(e){return this.repository.add(e)},uP.prototype.delete=function(e){return this.repository.delete(e)},uP.prototype.flush=function(){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){switch(e.label){case 0:return[4,this.repository.read()];case 1:return 0===(t=e.sent()).length?[2]:[4,this.transport.send(t)];case 2:return(r=e.sent()).isSuccessful()||r.isClientError()?[4,this.delete(t)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}})})},uP.prototype.onLifecycleChanged=function(e,t){switch(e){case"visible":case"pageshow":return void this.flush().catch(function(e){return s.log.warn("Failed to flush retry events: ".concat(e))});case"blur":case"focus":case"hidden":case"locationChange":case"pagehide":return}};var aP=uP;function uP(e,t){this.repository=e,this.transport=t}function cP(){this.listeners={}}cP.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},cP.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},cP.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};i(lP,pP=cP);var pP,cu=lP;function lP(){return null!==pP&&pP.apply(this,arguments)||this}i(dP,fP=cu),dP.prototype.process=function(e){this.enqueue(e),this.emit("event",e)},dP.prototype.enqueue=function(e){0===this.queue.length&&this.scheduleFlush(),this.queue.push(e),this.queue.length>=this.eventDispatchMaxSize&&this.flush()},dP.prototype.scheduleFlush=function(){var e,t=this;null!=(e=this.flushingJob)&&e.cancel(),this.flushingJob=this.flushScheduler.schedule(this.flushIntervalMillis,function(){return t.flush()})},dP.prototype.flush=function(e){var t;void 0===e&&(e=!1),null!=(t=this.flushingJob)&&t.cancel(),0!==this.queue.length&&(this.eventDispatcher.dispatch(this.queue,e).catch(function(e){return s.log.warn("Failed to dispatch events: ".concat(e))}),this.queue=[])},dP.prototype.close=function(){this.flush(!0)};var fP,hP=dP;function dP(e,t,r,n){var i=fP.call(this)||this;return i.eventDispatcher=e,i.eventDispatchMaxSize=t,i.flushScheduler=r,i.flushIntervalMillis=n,i.queue=[],i.flushingJob=null,i}vP.prototype.send=function(e){e=e.toBuilder().addHeader(ze,this.sdk.key).addHeader(Ye,this.sdk.name).addHeader(Je,this.sdk.version).addHeader(qe,this.clock.currentMillis().toString()).build();return this.delegate.send(e)};var yP=vP;function vP(e,t,r){this.sdk=e,this.clock=t,this.delegate=r}mP.intercept=function(e,t){return t instanceof yP?t:new yP(e,Ve.instance,t)};var gP=mP;function mP(){}wP.create=function(){return new wP},wP.prototype.send=function(s){return new Promise(function(t,r){var e,n=new XMLHttpRequest,i=(s.options.timeoutMillis&&(n.timeout=s.options.timeoutMillis),n.open(s.method,s.url),n.onreadystatechange=function(){var e;n.readyState===n.DONE&&(0===n.status?r(new Error("Request Error")):(e=new Qi(n.status,n.responseText,function(e){var t=to.builder(),e=e.getAllResponseHeaders();if(!e)return t.build();for(var r=0,n=e.split("\r\n");r<n.length;r++){var i,o=n[r],s=o.indexOf(": ");0<s&&(i=o.slice(0,s),o=o.slice(s+2),t.add(i,o))}return t.build()}(n)),t(e)))},n),o=s.headers.raw();for(e in o)o.hasOwnProperty(e)&&i.setRequestHeader(e,o[e]);n.send(s.body)})};var EP=wP;function wP(){}AP.create=function(){return new AP},AP.prototype.send=function(n){var i=this;return new Promise(function(e,t){var r=!1;if(!(r="undefined"!=typeof window?window&&window.navigator&&!!window.navigator.sendBeacon&&!0:r))throw new Error("BeaconTransport not supported.");r=i.createBody(n);if(!window.navigator.sendBeacon(n.url,r))throw Error("Failed to sendBeacon");e(Qi.ok())})},AP.prototype.createBody=function(e){var t=new URLSearchParams,r=e.headers.get(ze),r=(r&&t.append("sdkKey",r),t.append("sdkName",e.headers.getOrDefault(Ye,"unknown")),t.append("sdkVersion",e.headers.getOrDefault(Je,"unknown")),e.headers.get(qe));return r&&t.append("sdkTime",r),e.body&&t.append("data",e.body),t};var bP=AP;function AP(){}TP.prototype.onPageStarted=function(e,t){var r=this.userManager.resolve(),r=this.determiner.determineOrNull(r);r&&(this.core.flush(!0),this.redirector.redirect(r))},TP.prototype.onPageEnded=function(e,t){};var IP=TP;function TP(e,t,r,n){this.determiner=e,this.redirector=t,this.userManager=r,this.core=n}var _P=function(e,t,r,n){this.workspace=e,this.experiment=t,this.decision=r,this.user=n},NP=(PP.prototype.determineOrNull=function(e){if(this.splitUrlRedirectedCookieStorage.alreadyRedirected())return this.splitUrlRedirectedCookieStorage.clear(),null;var t=this.workspaceFetcher.get();if(!t)return null;for(var r=0,n=t.getSplitUrlExperiments();r<n.length;r++){var i,o=n[r];if(this.splitUrlMatcher.matches(t,o,e))return i=this.core.experiment(o.key,e,"A"),new _P(t,o,i,e)}return null},PP);function PP(e,t,r,n){this.workspaceFetcher=e,this.splitUrlMatcher=t,this.splitUrlRedirectedCookieStorage=r,this.core=n}MP.prototype.matches=function(e,t,r){if("SPLIT_URL"!==t.implementationType)return!1;if(!t.splitUrlTargets)return!1;t=t.splitUrlTargets,e=SP.of(e,r);return!(0<t.excludeTargets.length&&this.targetMatcher.anyMatches(e,V0.create(),t.excludeTargets))&&(0<t.includeTargets.length&&this.targetMatcher.anyMatches(e,V0.create(),t.includeTargets))};var OP=MP;function MP(e){this.targetMatcher=e}CP.of=function(e,t){return new CP(new L0("SPLIT_URL",H()),t,e)};var SP=CP;function CP(e,t,r){this.key=e,this.user=t,this.workspace=r}UP.prototype.redirect=function(e){e=this.urlResolver.resolveOrNull(e);e&&(this.initializeEventDispatcher.setNeedDispatch(!1),this.splitUrlRedirectedCookieStorage.setRedirected(!0),this.urlHandler.open(e))};var RP=UP;function UP(e,t,r,n){this.urlResolver=e,this.urlHandler=t,this.splitUrlRedirectedCookieStorage=r,this.initializeEventDispatcher=n}xP.prototype.resolveOrNull=function(e){try{var t=JSON.parse(e.decision.get(xP.SPLIT_URL_CONFIG_KEY,"")),r=oi.fromDto(t);return r.needRedirect?this.resolveByRedirectType(r.redirectType,r.redirectUrl,e):null}catch(e){return null}},xP.prototype.resolveByRedirectType=function(e,t,r){return!t||e!==n.SplitUrlRedirectType.MANUAL?null:this.resolveManualRedirectUrl(t,r)},xP.prototype.resolveManualRedirectUrl=function(e,t){e=ds.tryParse(e);return e?this.decorateCampaign(e,t):null},xP.prototype.decorateCampaign=function(e,t){t=t.user.hackleProperties.queryParameter;if(Ji.isNotEmptyString(t)){for(var t=this.campaignParser.parse(t),r=e,n=0,i=Object.entries(t);n<i.length;n++){var o=i[n],s=o[0],o=o[1];Ji.isNotEmptyString(o)&&r.searchParams.set(s,o)}return r}return e},xP.SPLIT_URL_CONFIG_KEY="redirectUrl";var kP=xP;function xP(e){this.campaignParser=e}LP.prototype.alreadyRedirected=function(){try{var e=this.storage.getItem(this.cookieKey);return c.isNullOrUndefined(e)?!1:Boolean(JSON.parse(e))}catch(e){return!1}},LP.prototype.clear=function(){this.storage.removeItem(this.cookieKey)},LP.prototype.setRedirected=function(e){this.storage.setItem(this.cookieKey,String(e),this.cookieStorageOptions)};var DP=LP;function LP(e,t,r){this.storage=e,this.cookieKey=t,this.cookieStorageOptions=r}VP.prototype.setNeedDispatch=function(e){this.needDispatch=e},VP.prototype.dispatchDoneEventIfNeeded=function(){this.needDispatch&&window.dispatchEvent(new CustomEvent(VP.HACKLE_INITIALIZE_DONE_EVENT_TYPE))},VP.HACKLE_INITIALIZE_DONE_EVENT_TYPE="hackle-initialize-done";var FP=VP;function VP(){this.needDispatch=!0}KP.prototype.get=function(){var e=this.storage.getItem(ht);if(c.isNullOrUndefined(e))return null;try{var t=JSON.parse(e);return this.sdk.version!==t.version?(this.clear(),null):t}catch(e){return this.clear(),null}},KP.prototype.set=function(e){e=p(p({},e),{version:this.sdk.version});this.storage.setItem(ht,JSON.stringify(e))},KP.prototype.clear=function(){this.storage.removeItem(ht)};var BP=KP;function KP(e,t){this.sdk=e,this.storage=t}var HP=s.log,jP=(GP.prototype.install=function(e){void 0===e&&(e=null);try{var t=this.changeLifecycle.bind(this);window.addEventListener("pageshow",function(){return t("pageshow")}),window.addEventListener("pagehide",function(){return t("pagehide")}),document.addEventListener("visibilitychange",function(){return t(document.visibilityState)}),window.addEventListener("blur",function(){return t("blur")}),window.addEventListener("focus",function(){return t("focus")}),GP.isSafariBrowser(e)&&window.addEventListener("beforeunload",function(){return t("hidden")}),history.pushState=(n=history.pushState,function(){try{var e=n.apply(history,arguments);return t("locationChange"),e}catch(e){(e instanceof Error||"string"==typeof e)&&HP.error(e)}}),history.replaceState=(r=history.replaceState,function(){try{var e=r.apply(history,arguments);return t("locationChange"),e}catch(e){(e instanceof Error||"string"==typeof e)&&HP.error(e)}}),window.addEventListener("popstate",function(){try{t("locationChange")}catch(e){(e instanceof Error||"string"==typeof e)&&HP.error(e)}})}catch(e){(e instanceof Error||"string"==typeof e)&&HP.error(e)}var r,n},GP.prototype.addListener=function(e){this.listeners.push(e)},GP.prototype.initialize=function(){this._initialized=!0,this.changeLifecycle("pageshow")},GP.prototype.changeLifecycle=function(e){this._initialized&&this.publish(e)},GP.prototype.publish=function(t){var r=this.clock.currentMillis();this.listeners.forEach(function(e){e.onLifecycleChanged(t,r)})},GP.isSafariBrowser=function(e){return!c.isNullOrUndefined(e)&&e.toLowerCase().includes("safari")},GP);function GP(e){void 0===e&&(e=Ve.instance),this.clock=e,this.listeners=[],this._initialized=!1}YP.create=function(e,t,r){return void 0===r&&(r=Ve.instance),new YP(new JP(r,e,t))},YP.prototype.execute=function(e,t){return(this.limiter.tryAcquire()?e:t)()};var zP=YP;function YP(e){this.limiter=e}qP.prototype.tryAcquire=function(){var e=this.clock.currentMillis();return this.refreshScopeIfNeeded(e).tryAcquire()},qP.prototype.refreshScopeIfNeeded=function(e){return null!=this.currentScope&&!this.currentScope.isExpired(e)||(this.currentScope=new WP(e+this.intervalMillis,this.limit)),this.currentScope};var JP=qP;function qP(e,t,r){this.clock=e,this.intervalMillis=t,this.limit=r,this.currentScope=null}$P.prototype.isExpired=function(e){return this.expirationTime<e},$P.prototype.tryAcquire=function(){return 0<this.token&&(--this.token,!0)};var WP=$P;function $P(e,t){this.expirationTime=e,this.token=t}ZP.prototype.isDedupTarget=function(t){var e=this.determiners.find(function(e){return e.supports(t)});return!!e&&e.isDedupTarget(t)};var XP=ZP;function ZP(e){this.determiners=e}QP.prototype.isDedupTarget=function(e){if(-1===this.dedupIntervalMillis)return!1;Ce.isEquals(e.user.identifiers,null==(t=this.currentUser)?void 0:t.identifiers)||(this.currentUser=e.user,this.cache={});var t=this.cacheKey(e),e=this.clock.currentMillis(),r=this.cache[t];return void 0!==r&&e-r<=this.dedupIntervalMillis||(this.cache[t]=e,!1)};Sa=QP;function QP(e,t){this.dedupIntervalMillis=e,this.clock=t,this.cache={},this.currentUser=null}i(rO,eO=Sa),rO.prototype.supports=function(e){return c0.isRemoteConfigEvent(e)},rO.prototype.cacheKey=function(e){return[e.parameter.id,e.valueId,e.decisionReason].join("-")};var eO,tO=rO;function rO(e,t){return void 0===t&&(t=Ve.instance),eO.call(this,e,t)||this}i(oO,nO=Sa),oO.prototype.supports=function(e){return c0.isExposureEvent(e)},oO.prototype.cacheKey=function(e){return[e.experiment.id,e.variationId,e.variationKey,e.decisionReason].join("-")};var nO,iO=oO;function oO(e,t){return void 0===t&&(t=Ve.instance),nO.call(this,e,t)||this}var sO=s.log,aO=(uO.prototype.onPageStarted=function(e,t){this.track(e,t)},uO.prototype.onPageEnded=function(e,t){},uO.prototype.track=function(e,t){sO.debug("tracking page view");var r,e={key:uO.PAGE_VIEW_EVENT_KEY,properties:p(p({},e.properties),((r={})[uO.PAGE_NAME_PROPERTY_KEY]=e.pageName,r))};this.core.track(e,this.userManager.resolve(),t)},uO.PAGE_VIEW_EVENT_KEY="$page_view",uO.PAGE_NAME_PROPERTY_KEY="$page_name",uO);function uO(e,t){this.core=e,this.userManager=t}Object.defineProperty(pO.prototype,"currentPage",{get:function(){var e;return null!=(e=this._currentPage)?e:ts.createWithCurrentPage()},enumerable:!1,configurable:!0}),pO.prototype.setCurrentPage=function(e){this.updatePage(e,Ve.instance.currentMillis(),!0)},pO.prototype.updatePage=function(e,t,r){var n=this._currentPage;!(r=void 0===r?!1:r)&&n&&e.isEquals(n)||(n&&this.publishEnd(n,t),this._currentPage=e,this.publishStart(e,t))},pO.prototype.publishStart=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageStarted(e,t)},pO.prototype.publishEnd=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageEnded(e,t)},pO.prototype.onLifecycleChanged=function(e,t){switch(e){case"pageshow":case"locationChange":var r=ts.createWithCurrentPage();return this.updatePage(r,t);case"visible":case"pagehide":case"blur":case"focus":case"hidden":return}},pO.prototype.addListener=function(e){this.listeners.push(e)};var cO=pO;function pO(){this.listeners=[],this._currentPage=null}var lO=s.log,fO=(Object.defineProperty(hO.prototype,"lastEngagementTime",{get:function(){return this._lastEngagementTime},enumerable:!1,configurable:!0}),hO.prototype.startEngagement=function(e){lO.debug("startEngagement timestamp:".concat(e,", page:").concat(this.pageManager.currentPage.url)),this._lastEngagementTime=e},hO.prototype.endEngagement=function(e,t){var r;c.isNullOrUndefined(this._lastEngagementTime)||(r=this._lastEngagementTime,this._lastEngagementTime=null,(r=t-r)<this.minimumEngagementDurationMillis||this.publish({page:e,durationMillis:r},t))},hO.prototype.publish=function(e,t){lO.debug("onEngagement timestamp:".concat(t,", page:").concat(this.pageManager.currentPage.url));for(var r=0,n=this.listeners;r<n.length;r++)n[r].onEngagement(e,t)},hO.prototype.onPageStarted=function(e,t){this.startEngagement(t)},hO.prototype.onPageEnded=function(e,t){this.endEngagement(e,t)},hO.prototype.onLifecycleChanged=function(e,t){switch(e){case"visible":case"focus":return this.startEngagement(t);case"pagehide":case"hidden":case"blur":return this.endEngagement(this.pageManager.currentPage,t);case"pageshow":case"locationChange":return}},hO.prototype.addListener=function(e){this.listeners.push(e)},hO);function hO(e,t){this.pageManager=e,this.minimumEngagementDurationMillis=t,this.listeners=[],this._lastEngagementTime=null}yO.prototype.onEngagement=function(e,t){var r,e={key:yO.ENGAGEMENT_EVENT_KEY,properties:p(p({},e.page.properties),((r={})[aO.PAGE_NAME_PROPERTY_KEY]=e.page.pageName,r[yO.ENGAGEMENT_TIME_PROPERTY_KEY]=e.durationMillis,r))};this.core.track(e,this.userManager.resolve(),t)},yO.ENGAGEMENT_EVENT_KEY="$engagement",yO.ENGAGEMENT_TIME_PROPERTY_KEY="$engagement_time_ms";var dO=yO;function yO(e,t){this.core=e,this.userManager=t}gO.prototype.setPhoneNumber=function(e,t){e=(new Wo).set(gO.PHONE_NUMBER_PROPERTY_KEY,e.getValue()).build().toSecuredEvent();this.track(e,t)},gO.prototype.unsetPhoneNumber=function(e){var t=(new Wo).unset(gO.PHONE_NUMBER_PROPERTY_KEY).build().toSecuredEvent();this.track(t,e)},gO.prototype.track=function(e,t){var r=this.userManager.resolve();this.core.track(e,r,t)},gO.PHONE_NUMBER_PROPERTY_KEY="$phone_number";var vO=gO;function gO(e,t){this.core=e,this.userManager=t}EO.prototype.getBrowserProperties=function(e){return yT.generate(window,null!=e?e:ts.createWithCurrentPage())};var mO=EO;function EO(){}Object.defineProperty(bO.prototype,"delayMillis",{get:function(){return this.schedule.time.deliverAt-this.requestedAt},enumerable:!1,configurable:!0}),bO.prototype.toString=function(){return"InAppMessageScheduleRequest(scheduleType=".concat(this.scheduleType,", requestedAt=").concat(this.requestedAt,")")};var wO=bO;function bO(e,t,r){this.schedule=e,this.scheduleType=t,this.requestedAt=r}IO.prototype.toRequest=function(e,t){return new wO(this,e,t)},IO.create=function(e){return new IO(H(),e.inAppMessage.key,e.event.user.identifiers,TO.of(e.inAppMessage,e.event.timestamp),e.reason,new NO(e.event.insertId,e.event.event))},IO.fromDelayStorageEntity=function(e,t){return new IO(e.schedule.dispatchId,e.schedule.inAppMessageKey,e.schedule.identifiers,new TO(t,e.schedule.time.deliverAt),e.schedule.reason,e.schedule.eventBasedContext)};var AO=IO;function IO(e,t,r,n,i,o){this.dispatchId=e,this.inAppMessageKey=t,this.identifiers=r,this.time=n,this.reason=i,this.eventBasedContext=o}_O.prototype.delayMillis=function(e){return this.deliverAt-e},_O.of=function(e,t){return new _O(t,e.eventTrigger.delay.deliverAt(t))};var TO=_O;function _O(e,t){this.startedAt=e,this.deliverAt=t}var NO=function(e,t){this.insertId=e,this.event=t},PO=(OO.prototype.initialize=function(){var t=this;this.userEventEmitter.on("event",function(e){t.onEvent(e)})},OO.prototype.destroy=function(){var t=this;this.userEventEmitter.off("event",function(e){t.onEvent(e)})},OO.prototype.onEvent=function(e){this.triggerProcessor.process(e)},OO.prototype.onUserUpdated=function(e,t,r){e=jt(e),t=jt(t);this.resetProcessor.process({identifiers:e},{identifiers:t})},OO.prototype.loadDelaySchedule=function(){var r=this;this.delayStorage.values().forEach(function(e){var t=r.clock.currentMillis(),e=AO.fromDelayStorageEntity(e,t).toRequest("STORED",t);r.scheduleProcessor.process(e)})},OO);function OO(e,t,r,n,i,o){this.scheduleProcessor=e,this.delayStorage=t,this.triggerProcessor=r,this.resetProcessor=n,this.userEventEmitter=i,this.clock=o,this.initialize()}i(CO,MO=ya),CO.prototype.resolve=function(e,t,r){return t.setProperty("experiment_id",r.experiment.id),t.setProperty("experiment_key",r.experiment.key),t.setProperty("variation_id",r.variationId),t.setProperty("variation_key",r.variationKey),t.setProperty("experiment_decision_reason",r.reason),r};var MO,SO=CO;function CO(e){return MO.call(this,e)||this}i(UO,RO=nc);var RO,au=UO;function UO(){return null!==RO&&RO.apply(this,arguments)||this}Object.defineProperty(xO.prototype,"inAppMessage",{get:function(){return this.request.inAppMessage},enumerable:!1,configurable:!0}),xO.of=function(e,t,r){return new xO(e,l.IN_APP_MESSAGE_TARGET,t.targetEvaluations,r,t.properties)};var kO=xO;function xO(e,t,r,n,i){this.request=e,this.reason=t,this.targetEvaluations=r,this.message=n,this.properties=i}Object.defineProperty(DO.prototype,"key",{get:function(){return new L0("IN_APP_MESSAGE",this.inAppMessage.id)},enumerable:!1,configurable:!0});w=DO;function DO(){}i(VO,LO=w),VO.of=function(e){return e instanceof VO?e:new VO(e.workspace,e.user,e.inAppMessage)},VO.prototype.toString=function(){return"InAppMessageLayoutRequest(type=".concat(this.key.type,", key=").concat(this.inAppMessage.key,")")};var LO,FO=VO;function VO(e,t,r){var n=LO.call(this)||this;return n.workspace=e,n.user=t,n.inAppMessage=r,n}i(HO,BO=au),HO.prototype.supports=function(e){return e instanceof FO},HO.prototype.evaluateInternal=function(e,t){var r=e.inAppMessage.messageContext.experimentContext,r=null!==r?this.evaluateExperiment(e,t,r):this.evaluateDefault(e,t);return kO.of(e,t,r)},HO.prototype.evaluateDefault=function(e,t){var r=jO(e.inAppMessage.messageContext.defaultLang);return this.selector.select(e.inAppMessage,r)},HO.prototype.evaluateExperiment=function(e,t,r){var n,i=c.requiredNotNullOrUndefined(e.workspace.getExperimentOrNull(r.key),function(){return"Experiment[key=".concat(r.key,"]")}),t=this.experimentEvaluator.evaluate(e,t,i),o=jO(e.inAppMessage.messageContext.defaultLang),s=(n=t.variationKey,function(e){return n===e.variationKey});return this.selector.select(e.inAppMessage,function(e){return o(e)&&s(e)})},HO.prototype.record=function(e,t){this.eventRecorder.record(e,t)};var BO,KO=HO;function HO(e,t,r){var n=BO.call(this)||this;return n.experimentEvaluator=e,n.selector=t,n.eventRecorder=r,n}function jO(t){return function(e){return t===e.lang}}zO.prototype.select=function(e,t){t=e.messageContext.messages.find(t);return c.requiredNotNullOrUndefined(t,function(){return"InAppMessage must be decided [".concat(e.id,"]")})};var GO=zO;function zO(){}JO.prototype.record=function(e,t){if(e.reason!==l.OVERRIDDEN)try{this.doRecord(e)}catch(e){s.log.error("Failed to record InAppMessageImpression: ".concat(e))}},JO.prototype.doRecord=function(e){var t=this.storage.get(e.inAppMessage),r={identifiers:e.user.identifiers,timestamp:e.requestedAt},t=Me(Me([],t,!0),[r],!1),r=t.length>this.STORE_MAX_SIZE?t.length-this.STORE_MAX_SIZE:0,t=t.slice(r);this.storage.set(e.inAppMessage,t)};var YO=JO;function JO(e){this.storage=e,this.STORE_MAX_SIZE=100}WO.prototype.toString=function(){return"InAppMessagePresentResponse(dispatchId=".concat(this.dispatchId,", inAppMessage=").concat(this.context.inAppMessage,", displayType=").concat(this.context.message.layout.displayType,", layoutType=").concat(this.context.message.layout.layoutType,")")},WO.of=function(e,t){return new WO(e.dispatchId,t)};var qO=WO;function WO(e,t){this.dispatchId=e,this.context=t}XO.prototype.toString=function(){return"InAppMessagePresentationContext(dispatchId=".concat(this.dispatchId,", inAppMessage=").concat(this.inAppMessage,", message=").concat(this.message,")")},XO.of=function(e){return new XO(e.dispatchId,e.inAppMessage,e.message,e.user,e.reason,e.properties)};var $O=XO;function XO(e,t,r,n,i,o){this.dispatchId=e,this.inAppMessage=t,this.message=r,this.user=n,this.decisionReason=i,this.properties=o}QO.prototype.process=function(e){s.log.debug("InAppMessage Present Request: ".concat(e));var t=this.present(e);return this.recorder.record(e,t),s.log.debug("InAppMessage Present Response: ".concat(t)),t},QO.prototype.present=function(e){var t=$O.of(e);return this.presenter.present(t),qO.of(e,t)};var ZO=QO;function QO(e,t){this.presenter=e,this.recorder=t}tM.prototype.isIdentifierChanged=function(e,t){var r=e[Kt.USER],n=t[Kt.USER];if(void 0!==r&&void 0!==n)return r!==n;r=e[Kt.DEVICE],n=t[Kt.DEVICE];return void 0!==r&&void 0!==n&&r!==n};var eM=tM;function tM(){}Object.defineProperty(nM.prototype,"listener",{get:function(){return this._listener},set:function(e){this._listener=e},enumerable:!1,configurable:!0}),nM.prototype.schedule=function(e){var t=this,r=this.scheduler.schedule(e.delayMillis,function(){return t.delayCommand(e)});return new iM(e,r)},nM.prototype.delayCommand=function(e){var t=this.clock.currentMillis(),e=e.schedule.toRequest("DELAYED",t);null!=(t=this.listener)&&t.onSchedule(e)};var rM=nM;function nM(e,t){this.clock=e,this.scheduler=t}oM.prototype.cancel=function(){this.job.cancel(),s.log.debug("InAppMessageDelay cancelled: ".concat(this.delay))};var iM=oM;function oM(e,t){this.delay=e,this.job=t}Object.defineProperty(aM.prototype,"delayMillis",{get:function(){return this.schedule.time.delayMillis(this.requestedAt)},enumerable:!1,configurable:!0}),aM.from=function(e){return new aM(e.schedule,e.requestedAt)},aM.prototype.toString=function(){return"InAppMessageDelay(dispatchId=".concat(this.schedule.dispatchId,", requestedAt=").concat(this.requestedAt,")")};var sM=aM;function aM(e,t){this.schedule=e,this.requestedAt=t}cM.prototype.registerAndDelay=function(e){return this.storage.set(e.schedule.inAppMessageKey,e.schedule.dispatchId,sM.from(e)),this.delay(e)},cM.prototype.delay=function(e){var t=sM.from(e),r=this.scheduler.schedule(t);return this.tasks.set(t.schedule.dispatchId,r),s.log.debug("InAppMessage Delay started: dispatchId=".concat(e.schedule.dispatchId)),t},cM.prototype.delete=function(e){var t=null!=(t=null==(t=this.tasks.get(e.schedule.dispatchId))?void 0:t.delay)?t:null;return t&&s.log.debug("InAppMessage Delay deleted: dispatchId=".concat(e.schedule.dispatchId)),this.tasks.delete(e.schedule.dispatchId),this.storage.remove(e.schedule.inAppMessageKey,e.schedule.dispatchId),t},cM.prototype.cancelAll=function(){var e=Array.from(this.tasks.values());return e.forEach(function(e){return e.cancel()}),this.tasks.clear(),this.storage.clear(),s.log.debug("InAppMessage Delay clear."),e.map(function(e){return e.delay})};var uM=cM;function cM(e,t,r){this.scheduler=e,this.tasks=t,this.storage=r}lM.prototype.toString=function(){return"InAppMessageDeliverResponse(dispatchId=".concat(this.dispatchId,", inAppMessageKey=").concat(this.inAppMessageKey,", code=").concat(this.code,")")},lM.of=function(e,t,r){return new lM(e.dispatchId,e.inAppMessageKey,t,r=void 0===r?null:r)};var pM=lM;function lM(e,t,r,n){this.dispatchId=e,this.inAppMessageKey=t,this.code=r,this.presentResponse=n}hM.prototype.toString=function(){return"InAppMessagePresentRequest(dispatchId=".concat(this.dispatchId,", inAppMessage=").concat(this.inAppMessage,", user=").concat(this.user.identifiers,", requestedAt=").concat(this.requestedAt,", reason=").concat(this.reason,", properties=").concat(this.properties,")")},hM.of=function(e,t,r,n,i){return new hM(e.dispatchId,t,i.message,r,e.requestedAt,n.reason,p(p({},e.properties),i.properties))};var fM=hM;function hM(e,t,r,n,i,o,s){this.dispatchId=e,this.inAppMessage=t,this.message=r,this.user=n,this.requestedAt=i,this.reason=o,this.properties=s}i(vM,dM=w),vM.prototype.toString=function(){return"InAppMessageEligibilityRequest(type=".concat(this.key.type,", key=").concat(this.inAppMessage.key,")")};var dM,yM=vM;function vM(e,t,r,n){var i=dM.call(this)||this;return i.workspace=e,i.user=t,i.inAppMessage=r,i.timestamp=n,i}mM.prototype.response=function(t){try{return this.deliver(t)}catch(e){return s.log.error("Failed to process InAppMessageDeliver: ".concat(e)),pM.of(t,"EXCEPTION")}},mM.prototype.process=function(e){s.log.debug("InAppMessage Deliver Request: ".concat(e));e=this.response(e);return s.log.debug("InAppMessage Deliver Response: ".concat(e)),e},mM.prototype.deliver=function(e){var t=this.workspaceFetcher.get();if(!t)return pM.of(e,"WORKSPACE_NOT_FOUND");var r=t.getInAppMessageOrNull(e.inAppMessageKey);if(!r)return pM.of(e,"IN_APP_MESSAGE_NOT_FOUND");var n=this.userDecorator.decorate(this.userManager.resolve());if(this.identifierChecker.isIdentifierChanged(e.identifiers,n.identifiers))return pM.of(e,"IDENTIFIER_CHANGED");var i=this.layoutResolver.resolve(t,r,n),t=new yM(t,n,r,e.requestedAt),t=this.evaluateProcessor.process("DELIVER",t);if(!t.isEligible)return pM.of(e,"INELIGIBLE");r=fM.of(e,r,n,t,i),n=this.presentProcessor.process(r);return pM.of(e,"PRESENT",n)};var gM=mM;function mM(e,t,r,n,i,o,s){this.workspaceFetcher=e,this.userManager=t,this.identifierChecker=r,this.layoutResolver=n,this.evaluateProcessor=i,this.presentProcessor=o,this.userDecorator=s}wM.prototype.get=function(t){return c.requiredNotNullOrUndefined(this.schedulers.find(function(e){return e.supports(t)}),function(){return"Unsupported InAppMessageScheduleType[".concat(t,"]")})};var EM=wM;function wM(e){this.schedulers=e}AM.prototype.toString=function(){return"InAppMessageScheduleResponse(dispatchId=".concat(this.dispatchId,", inAppMessageKey=").concat(this.inAppMessageKey,", code=").concat(this.code,")")},AM.of=function(e,t,r,n){return new AM(e.schedule.dispatchId,e.schedule.inAppMessageKey,t,r=void 0===r?null:r,n=void 0===n?null:n)};var bM=AM;function AM(e,t,r,n,i){this.dispatchId=e,this.inAppMessageKey=t,this.code=r,this.deliverResponse=n,this.delay=i}TM.of=function(e){var t=(new Eo).add("$trigger_event_insert_id",e.schedule.eventBasedContext.insertId).build();return new TM(e.schedule.dispatchId,e.schedule.inAppMessageKey,e.schedule.identifiers,e.requestedAt,e.schedule.reason,c.fromMap(t))},TM.prototype.toString=function(){return"InAppMessageDeliverRequest(dispatchId=".concat(this.dispatchId,", inAppMessageKey=").concat(this.inAppMessageKey,", identifiers=").concat(this.identifiers,", requestedAt=").concat(this.requestedAt,", reason=").concat(this.reason)};var IM=TM;function TM(e,t,r,n,i,o){this.dispatchId=e,this.inAppMessageKey=t,this.identifiers=r,this.requestedAt=n,this.reason=i,this.properties=o}_M.prototype.schedule=function(e,t){switch(e){case"DELIVER":return this.deliver(t);case"DELAY":return this.delay(t);case"IGNORE":return this.ignore(t)}};ee=_M;function _M(){}i(OM,NM=ee),OM.prototype.supports=function(e){return"DELAYED"===e},OM.prototype.deliver=function(e){var t=this.delayManager.delete(e),t=(c.requiredNotNullOrUndefined(t,function(){return"InAppMessageDelay not found (inAppMessageKey=".concat(e.schedule.inAppMessageKey,")")}),IM.of(e)),t=this.deliverProcessor.process(t);return bM.of(e,"DELIVER",t)},OM.prototype.delay=function(e){var t=this.delayManager.delay(e);return bM.of(e,"DELAY",null,t)},OM.prototype.ignore=function(e){var t=this.delayManager.delete(e);return bM.of(e,"IGNORE",null,t)};var NM,PM=OM;function OM(e,t){var r=NM.call(this)||this;return r.deliverProcessor=e,r.delayManager=t,r}i(CM,MM=ee),CM.prototype.supports=function(e){return"TRIGGERED"===e},CM.prototype.deliver=function(e){var t=IM.of(e),t=this.deliverProcessor.process(t);return bM.of(e,"DELIVER",t)},CM.prototype.delay=function(e){var t=this.delayManager.registerAndDelay(e);return bM.of(e,"DELAY",null,t)},CM.prototype.ignore=function(e){return bM.of(e,"IGNORE")};var MM,SM=CM;function CM(e,t){var r=MM.call(this)||this;return r.deliverProcessor=e,r.delayManager=t,r}UM.prototype.process=function(e){s.log.debug("InAppMessage Schedule Request: ".concat(e));e=this.schedule(e);return s.log.debug("InAppMessage Schedule Response: ".concat(e)),e},UM.prototype.schedule=function(t){try{var e=this.actionDeterminer.determine(t);return this.schedulerFactory.get(t.scheduleType).schedule(e,t)}catch(e){return s.log.error("Failed to process InAppMessageSchedule: ".concat(e)),bM.of(t,"EXCEPTION")}},UM.prototype.onSchedule=function(e){this.process(e)};var RM=UM;function UM(e,t){this.actionDeterminer=e,this.schedulerFactory=t}xM.prototype.shouldIgnoreRequest=function(e){return"STORED"===e.scheduleType&&e.delayMillis<0},xM.prototype.determineAction=function(e){var t=e.delayMillis;if(0<t)return"DELAY";if(t>=this.DELIVER_DURATION_THRESHOLD_MILLIS)return"DELIVER";if(t<this.DELIVER_DURATION_THRESHOLD_MILLIS)return"IGNORE";throw new Error("InAppMessageScheduleAction cannot be determined (key=".concat(e.schedule.inAppMessageKey,")"))},xM.prototype.determine=function(e){if(this.shouldIgnoreRequest(e))return"IGNORE";var t=this.determineAction(e);return s.log.debug("InAppMessage ScheduleAction determined: action=".concat(t,", dispatchId=").concat(e.schedule.dispatchId)),t};var kM=xM;function xM(){this.DELIVER_DURATION_THRESHOLD_MILLIS=-1e4}LM.prototype.toString=function(){return"InAppMessageTrigger(inAppMessage=".concat(this.inAppMessage.toString(),", reason=").concat(this.reason,", insertId=").concat(this.event.insertId,", timestamp=").concat(this.event.timestamp,", event=").concat(this.event.event.key,")")};var DM=LM;function LM(e,t,r){this.inAppMessage=e,this.reason=t,this.event=r}VM.prototype.determine=function(e){var t=c0.isTrackEvent(e)?e:null;if(!t)return null;var r=this.workspaceFetcher.get();if(!r)return null;for(var n=0,i=r.getInAppMessages();n<i.length;n++){var o=i[n];if(this.eventMatcher.matches(r,o,t)){var s=this.evaluate(r,o,t);if(s.isEligible)return new DM(o,s.reason,t)}}return null},VM.prototype.evaluate=function(e,t,r){e=new yM(e,r.user,t,r.timestamp);return this.evaluateProcessor.process("TRIGGER",e)};var FM=VM;function VM(e,t,r){this.workspaceFetcher=e,this.eventMatcher=t,this.evaluateProcessor=r}KM.prototype.handle=function(e){e=AO.create(e).toRequest("TRIGGERED",e.event.timestamp);this.scheduleProcessor.process(e)};var BM=KM;function KM(e){this.scheduleProcessor=e}jM.prototype.process=function(e){try{var t=this.determiner.determine(e);if(!t)return;s.log.debug("InAppMessage triggered: ".concat(t)),this.handler.handle(t)}catch(e){s.log.error("Failed to process InAppMessage event trigger: ".concat(e))}};var HM=jM;function jM(e,t){this.determiner=e,this.handler=t}zM.prototype.process=function(e,t){try{this.identifierChecker.isIdentifierChanged(jt(e),jt(t))&&this.delayManager.cancelAll()}catch(e){s.log.error("Failed to reset InAppMessage: ".concat(e))}};var GM=zM;function zM(e,t){this.identifierChecker=e,this.delayManager=t}JM.prototype.getDelayStorageItem=function(){var e=this.storage.getItem(this.storageKey);if(c.isNullOrUndefined(e))return null;try{return JSON.parse(e)}catch(e){return s.log.warn("Failed to get delay storage item: ".concat(e)),null}},JM.prototype.get=function(e,t){var r=this.getDelayStorageItem();return!c.isNullOrUndefined(r)&&null!=(e=null==(r=r[e])?void 0:r.find(function(e){return e.schedule.dispatchId===t}))?e:null},JM.prototype.set=function(e,t,r){var n=this.getDelayStorageItem();if(c.isNullOrUndefined(n))return s.log.debug("No delay storage item found. create new item"),void this.storage.setItem(this.storageKey,JSON.stringify(((i={})[e]=[r],i)));var i=null!=(i=n[e])?i:[];i.push(r),n[e]=i,this.storage.setItem(this.storageKey,JSON.stringify(n))},JM.prototype.remove=function(e,t){var r=this.getDelayStorageItem(),n=null==r?void 0:r[e];c.isNullOrUndefined(r)||c.isNullOrUndefined(n)?s.log.debug("No delay storage item found for ".concat(e,". do nothing")):(r[e]=n.filter(function(e){return e.schedule.dispatchId!==t}),0===r[e].length&&delete r[e],this.storage.setItem(this.storageKey,JSON.stringify(r)))},JM.prototype.values=function(){var e=this.getDelayStorageItem();return c.isNullOrUndefined(e)?(s.log.debug("No delay storage item found. do nothing"),[]):Object.values(e).flat()},JM.prototype.clear=function(){this.storage.removeItem(this.storageKey)};var YM=JM;function JM(e){this.storage=e,this.storageKey="iam-delay"}WM.prototype.create=function(r,e){var n=this,i=this.clock.currentMillis(),o=new Array,t=this.createEvent(r,e,i,{});return t&&o.push(t),e.targetEvaluations.forEach(function(e){var t;(t={})[WM.ROOT_TYPE]=r.key.type,t[WM.ROOT_ID]=r.key.id;e=n.createEvent(r,e,i,t);e&&o.push(e)}),o},WM.prototype.createEvent=function(e,t,r,n){var i;return t instanceof P0?(n[WM.CONFIG_ID_PROPERTY_KEY]=null==(i=t.config)?void 0:i.id,n[WM.EXPERIMENT_VERSION_KEY]=t.experiment.version,n[WM.EXECUTION_VERSION_KEY]=t.experiment.executionVersion,c0.exposure(e.user,t,n,r)):t instanceof R0?c0.remoteConfig(e.user,t,p(p({},n),t.properties),r):null},WM.ROOT_TYPE="$targetingRootType",WM.ROOT_ID="$targetingRootId",WM.CONFIG_ID_PROPERTY_KEY="$parameterConfigurationId",WM.EXPERIMENT_VERSION_KEY="$experiment_version",WM.EXECUTION_VERSION_KEY="$execution_version";var qM=WM;function WM(e){this.clock=e}XM.prototype.record=function(e,t){var r=this;this.eventFactory.create(e,t).forEach(function(e){r.eventProcessor.process(e)})};var $M=XM;function XM(e,t){this.eventFactory=e,this.eventProcessor=t}QM.eligible=function(e,t,r){return QM.of(e,t,r,!0)},QM.ineligible=function(e,t,r){return QM.of(e,t,r,!1)},QM.of=function(e,t,r,n){return new QM(String(r),t.targetEvaluations,e.inAppMessage,n,t.get(kO))};var ZM=QM;function QM(e,t,r,n,i){this.reason=e,this.targetEvaluations=t,this.inAppMessage=r,this.isEligible=n,this.layoutEvaluation=i}tS.prototype.evaluate=function(e,t,r){return e.inAppMessage.supports("WEB")?r.evaluate(e,t):ZM.ineligible(e,t,l.UNSUPPORTED_PLATFORM)};var eS=tS;function tS(){}nS.prototype.evaluate=function(e,t,r){return this.userOverrideMatcher.matches(e,t)?ZM.eligible(e,t,l.OVERRIDDEN):r.evaluate(e,t)};var rS=nS;function nS(e){this.userOverrideMatcher=e}oS.prototype.evaluate=function(e,t,r){return"DRAFT"===e.inAppMessage.status?ZM.ineligible(e,t,l.IN_APP_MESSAGE_DRAFT):r.evaluate(e,t)};var iS=oS;function oS(){}aS.prototype.evaluate=function(e,t,r){return"PAUSE"===e.inAppMessage.status?ZM.ineligible(e,t,l.IN_APP_MESSAGE_PAUSED):r.evaluate(e,t)};var sS=aS;function aS(){}cS.prototype.evaluate=function(e,t,r){return e.inAppMessage.period.within(e.timestamp)?r.evaluate(e,t):ZM.ineligible(e,t,l.NOT_IN_IN_APP_MESSAGE_PERIOD)};var uS=cS;function cS(){}lS.prototype.evaluate=function(e,t,r){return e.inAppMessage.timetable.within(e.timestamp)?r.evaluate(e,t):ZM.ineligible(e,t,l.NOT_IN_IN_APP_MESSAGE_TIMETABLE)};var pS=lS;function lS(){}hS.prototype.evaluate=function(e,t,r){return this.hiddenMatcher.matches(e,t)?ZM.ineligible(e,t,l.IN_APP_MESSAGE_HIDDEN):r.evaluate(e,t)};var fS=hS;function hS(e){this.hiddenMatcher=e}yS.prototype.evaluate=function(e,t,r){return this.targetMatcher.matches(e,t)?r.evaluate(e,t):ZM.ineligible(e,t,l.NOT_IN_IN_APP_MESSAGE_TARGET)};var dS=yS;function yS(e){this.targetMatcher=e}gS.prototype.evaluate=function(e,t,r){return this.frequencyCapMatcher.matches(e,t)?ZM.ineligible(e,t,l.IN_APP_MESSAGE_FREQUENCY_CAPPED):r.evaluate(e,t)};var vS=gS;function gS(e){this.frequencyCapMatcher=e}ES.prototype.evaluate=function(e,t,r){return ZM.eligible(e,t,l.IN_APP_MESSAGE_TARGET)};var mS=ES;function ES(){}bS.prototype.evaluate=function(e,t,r){var n=FO.of(e),n=this.layoutEvaluator.evaluate(n,V0.create());return t.set(kO,n),r.evaluate(e,t)};var wS=bS;function bS(e){this.layoutEvaluator=e}IS.prototype.matches=function(t,e){var r=this;return t.inAppMessage.targetContext.overrides.some(function(e){return r.isUserOverridden(t,e)})},IS.prototype.isUserOverridden=function(e,t){e=e.user.identifiers[t.identifierType];return!c.isNullOrUndefined(e)&&t.identifiers.includes(e)};var AS=IS;function IS(){}_S.prototype.matches=function(t,r){var n=this,e=t.inAppMessage.targetContext.targets;return 0===e.length||e.some(function(e){return n.targetMatcher.matches(t,r,e)})};var TS=_S;function _S(e){this.targetMatcher=e}PS.prototype.matches=function(e,t){return this.storage.exist(e.inAppMessage,e.timestamp)};var NS=PS;function PS(e){this.storage=e}MS.prototype.matches=function(e,t){var r=e.inAppMessage,n=e.user,e=e.timestamp;return this.isFrequencyCapped(r,n,e)},MS.prototype.isFrequencyCapped=function(e,t,r){if(!e.eventTrigger.frequencyCap)return!1;var n=this.createMatchContexts(e.eventTrigger.frequencyCap);if(0===n.length)return!1;for(var i=0,o=this.storage.get(e);i<o.length;i++)for(var s=o[i],a=0,u=n;a<u.length;a++)if(u[a].matches(t,r,s))return!0;return!1},MS.prototype.createMatchContexts=function(e){for(var t=[],r=0,n=e.identifierCaps;r<n.length;r++){var i=n[r];t.push(new SS(new RS(i)))}return e.durationCap&&t.push(new SS(new kS(e.durationCap))),t};var OS=MS;function MS(e){this.storage=e}CS.prototype.matches=function(e,t,r){return this.predicate.matches(e,t,r)&&(this.matchCount+=1),this.matchCount>=this.predicate.thresholdCount};var SS=CS;function CS(e){this.matchCount=0,this.predicate=e}Object.defineProperty(US.prototype,"thresholdCount",{get:function(){return this.identifierCap.count},enumerable:!1,configurable:!0}),US.prototype.matches=function(e,t,r){e=e.identifiers[this.identifierCap.identifierType];if(c.isNullOrUndefined(e))return!1;r=r.identifiers[this.identifierCap.identifierType];return!c.isNullOrUndefined(r)&&e===r};var RS=US;function US(e){this.identifierCap=e}Object.defineProperty(xS.prototype,"thresholdCount",{get:function(){return this.durationCap.count},enumerable:!1,configurable:!0}),xS.prototype.matches=function(e,t,r){return t-r.timestamp<=this.durationCap.durationMillis};var kS=xS;function xS(e){this.durationCap=e}LS.prototype.getTriggerFlow=function(){return this.triggerFlow},LS.prototype.getDeliverFlow=function(e){return e?this.deliverReEvaluateFlow:this.deliverFlow};var DS=LS;function LS(e,t,r){this.layoutEvaluator=r;var r=Z0.get("targetMatcher"),r=[new eS,new rS(new AS),new iS,new sS,new uS,new pS,new dS(new TS(r))],n=[new wS(this.layoutEvaluator)],t=[new vS(new OS(t)),new fS(new NS(e))],e=[new mS];this.triggerFlow=iA.of.apply(iA,Me(Me(Me(Me([],r,!1),n,!1),t,!1),e,!1)),this.deliverFlow=iA.of.apply(iA,Me(Me([],t,!1),e,!1)),this.deliverReEvaluateFlow=iA.of.apply(iA,Me(Me(Me([],r,!1),t,!1),e,!1))}i(BS,FS=au),BS.prototype.supports=function(e){return void 0!==e.inAppMessage},BS.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlow.evaluate(e,t))?r:ZM.ineligible(e,t,l.NOT_IN_IN_APP_MESSAGE_TARGET)},BS.prototype.record=function(e,t){this.eventRecorder.record(e,t),t.isEligible||null===t.layoutEvaluation||this.eventRecorder.record(t.layoutEvaluation.request,t.layoutEvaluation)};var FS,VS=BS;function BS(e,t){var r=FS.call(this)||this;return r.evaluationFlow=e,r.eventRecorder=t,r}HS.prototype.process=function(e,t){e=this.resolveFlow(e,t),e=new VS(e,this.eventRecorder);return this.core.inAppMessage(t,V0.create(),e)},HS.prototype.resolveFlow=function(e,t){return"TRIGGER"===e?this.flowFactory.getTriggerFlow():this.flowFactory.getDeliverFlow(null!=(t=null==(e=t.inAppMessage.evaluateContext)?void 0:e.atDeliverTime)&&t)};var KS=HS;function HS(e,t,r){this.core=e,this.flowFactory=t,this.eventRecorder=r}GS.prototype.resolve=function(e,t,r){e=new FO(e,r,t);return this.core.inAppMessage(e,V0.create(),this.layoutEvaluator)};var jS=GS;function GS(e,t){this.core=e,this.layoutEvaluator=t}i(JS,zS=ee),JS.prototype.supports=function(e){return"STORED"===e},JS.prototype.deliver=function(e){var t=this.delayManager.delete(e),r=(c.requiredNotNullOrUndefined(t,function(){return"InAppMessageDelay not found (inAppMessageKey=".concat(e.schedule.inAppMessageKey,")")}),IM.of(e)),r=this.deliverProcessor.process(r);return bM.of(e,"DELIVER",r,t)},JS.prototype.delay=function(e){var t=this.delayManager.delay(e);return s.log.debug("StoredDelay is scheduled (inAppMessageKey=".concat(e.schedule.inAppMessageKey,", delayMillis=").concat(e.delayMillis.toLocaleString(),")")),bM.of(e,"DELAY",null,t)},JS.prototype.ignore=function(e){var t=this.delayManager.delete(e);return bM.of(e,"IGNORE",null,t)};var zS,YS=JS;function JS(e,t){var r=zS.call(this)||this;return r.deliverProcessor=e,r.delayManager=t,r}WS.prototype.decorate=function(e){if(e.identifiers[Kt.SESSION])return e;var t=this.sessionManager.currentSessionId;if(c.isNullOrUndefined(t))return e;t=(new Gt).addIdentifiers(e.identifiers).add(Kt.SESSION,t).build();return p(p({},e),{identifiers:t})};var qS=WS;function WS(e){this.sessionManager=e}XS.prototype.decorate=function(e){var t=this.sessionUserDecorator.decorate(e.user);return e.copyWithUser(t)};var $S=XS;function XS(e){this.sessionUserDecorator=e}QS.prototype.addPageListener=function(e){this.pageManager.addListener(e)},QS.prototype.addEngagementListener=function(e){this.engagementManager.addListener(e)},QS.prototype.addLifecycleListener=function(e){this.lifecycleManager.addListener(e)},QS.prototype.initialize=function(){this.lifecycleManager.initialize()},QS.prototype.install=function(e){this.pageManager.addListener(this.engagementManager),this.lifecycleManager.addListener(this.engagementManager),this.lifecycleManager.install(e)};var ZS=QS;function QS(e,t,r,n){this.lifecycleManager=e,this.pageManager=t,this.engagementManager=r,this.lifecycleManager=e,this.pageManager=t,this.engagementManager=r,this.install("string"==typeof n?n:null)}tC.prototype.get=function(t){var e;return null!=(e=this.factories.find(function(e){return e.supports(t)}))?e:null};var eC=tC;function tC(e){this.factories=e}nC.prototype.run=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.cache=this.callback.apply(this,e),this.isCalled=!0,this.cache},nC.prototype.once=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.isCalled?this.cache:this.run.apply(this,e)};var rC=nC;function nC(e){this.callback=e,this.isCalled=!1,this.cache=null}i(sC,iC=Wl),sC.prototype.open=function(){return o(this,void 0,void 0,function(){var t,r,n,i,o=this;return a(this,function(e){switch(e.label){case 0:if(!this.canOpen())return s.log.debug("InAppMessage is already opened. (key=".concat(this.context.inAppMessage.key,")")),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),this.beginOpen(),r=(t=c).requiredNotNullOrUndefined,[4,this.htmlResolver.resolve(this.context)];case 2:return i=r.apply(t,[e.sent(),function(){return"html content to render is not found."}]),n=new rC(function(){return o.completeOpen()}),this.renderer.render(i,this.bridge,n),[3,4];case 3:return i=e.sent(),s.log.error("Failed to open Html inAppMessage: ".concat(i)),this.failOpen(),[3,4];case 4:return[2]}})})},sC.prototype.close=function(){if(this.canClose())try{this.beginClose(),this.completeClose()}catch(e){s.log.error("Failed to close Html inAppMessage: ".concat(e)),this.failClose()}else s.log.debug("InAppMessage is already closed. (key=".concat(this.context.inAppMessage.key,")"))},sC.prototype.destroyView=function(){this.renderer.destroy()};var iC,oC=sC;function sC(e,t,r,n,i,o){var s=iC.call(this,e,t,r)||this;return s.context=e,s.ui=t,s.status=r,s.htmlResolver=n,s.renderer=i,s.bridge=o,s}uC.prototype.createElement=function(){return this.$wrapper=document.createElement("div"),this.$iframe=document.createElement("iframe"),this.$wrapper.classList.add(this.WRAPPER_CLASS_NAME),this.$iframe.classList.add(this.IFRAME_CLASS_NAME),[this.$wrapper,this.$iframe]},uC.prototype.attachToDOM=function(){var e,t;this.$wrapper&&this.$iframe&&(e=this.$wrapper,t=this.$iframe,e.contains(t)||e.appendChild(t),e.parentNode||document.body.appendChild(e))},uC.prototype.removeElement=function(){this.$wrapper&&(this.$wrapper.remove(),this.$wrapper=null,this.$iframe=null)},uC.prototype.onLoad=function(e){this.$iframe&&(this.$iframe.onload=function(){e()})},uC.prototype.getIframeContentWindow=function(){var e;return null!=(e=null==(e=this.$iframe)?void 0:e.contentWindow)?e:null};var aC=uC;function uC(){this.WRAPPER_CLASS_NAME="hackle-iam-html__wrapper",this.IFRAME_CLASS_NAME="hackle-iam-html__iframe",this.$wrapper=null,this.$iframe=null}pC.prototype.marketing=function(e){return this.operations.set("$marketing",e),this},pC.prototype.information=function(e){return this.operations.set("$information",e),this},pC.prototype.custom=function(e,t){return this.operations.set(e,t),this},pC.prototype.build=function(){return new lC(this.operations)};var cC=pC;function pC(){this.operations=new Map}fC.prototype.toEvent=function(e){var r=new Wo;return this.operations.forEach(function(e,t){r.set(t,e)}),{key:e,properties:c.fromMap(this.operations)}},fC.prototype.toRecord=function(){var r={};return this.operations.forEach(function(e,t){r[t]=e}),r};var lC=fC;function fC(e){this.operations=e}n.HackleSubscriptionStatus=void 0,(cf=n.HackleSubscriptionStatus||(n.HackleSubscriptionStatus={})).SUBSCRIBED="SUBSCRIBED",cf.UNSUBSCRIBED="UNSUBSCRIBED",cf.UNKNOWN="UNKNOWN";dC.createBridgeReadyEvent=function(){return new CustomEvent(dC.HACKLE_IAM_HTML_BRIDGE_READY_EVENT_NAME)},dC.install=function(e,t){e[dC.HACKLE_IAM_SCRIPT_CONTAINER_NAME]=e[dC.HACKLE_IAM_SCRIPT_CONTAINER_NAME]||{},Object.assign(e[dC.HACKLE_IAM_SCRIPT_CONTAINER_NAME],{bridge:t,PropertyOperationsBuilder:Wo,HackleSubscriptionOperationsBuilder:cC,HackleSubscriptionStatus:n.HackleSubscriptionStatus}),e.dispatchEvent(dC.createBridgeReadyEvent())},dC.isBridgeInstalled=function(e){return dC.HACKLE_IAM_SCRIPT_CONTAINER_NAME in e&&void 0!==e[dC.HACKLE_IAM_SCRIPT_CONTAINER_NAME][dC.HACKLE_IAM_HTML_BRIDGE_FIELDN_NAME]},dC.HACKLE_IAM_SCRIPT_CONTAINER_NAME="Hackle",dC.HACKLE_IAM_HTML_BRIDGE_FIELDN_NAME="bridge",dC.HACKLE_IAM_HTML_BRIDGE_READY_EVENT_NAME="hackleBridgeReady";var hC=dC;function dC(){}vC.beforeLoadedWrapperStyles=function(){return{position:"fixed",top:"0",left:"0",bottom:"0",right:"0",zIndex:"9999",opacity:"0",transition:"opacity 0.3s ease-in-out"}},vC.afterLoadedWrapperStyles=function(){return{opacity:"1"}},vC.beforeLoadedIframeStyles=function(){return{width:"100%",height:"100%",border:"none"}},vC.afterLoadedIframeStyles=function(){return{}};var yC=vC;function vC(){}mC.prototype.render=function(e,t,r){var n=this,i=this.domManager.createElement(),o=i[0],s=i[1];this.setStyle(s,yC.beforeLoadedIframeStyles()),this.setStyle(o,yC.beforeLoadedWrapperStyles()),this.domManager.onLoad(function(){var e=c.requiredNotNullOrUndefined(n.domManager.getIframeContentWindow(),function(){return"Failed to render HTML inAppMessage. (HTML inAppMessage's container element is not found.)"});hC.install(e,t),n.setStyle(s,yC.afterLoadedIframeStyles()),n.setStyle(o,yC.afterLoadedWrapperStyles()),r.once()}),this.renderHtmlString(s,e),this.domManager.attachToDOM()},mC.prototype.destroy=function(){this.domManager.removeElement()},mC.prototype.setStyle=function(e,t){Object.assign(e.style,t)},mC.prototype.renderHtmlString=function(e,t){e.srcdoc=t};var gC=mC;function mC(e){this.domManager=e}wC.create=function(e,t){return new wC(e,t)},wC.prototype.create=function(e,t){var r=new w_,n=new aC,n=new gC(n),i=this.bridgeFactory.create();return new oC(e,t,r,this.htmlResolver,n,i)},wC.prototype.supports=function(e){return null!==e.message.html&&"HTML"===e.message.layout.displayType};var EC=wC;function wC(e,t){this.htmlResolver=e,this.bridgeFactory=t}AC.prototype.resolve=function(n){return o(this,void 0,void 0,function(){var t,r;return a(this,function(e){switch(e.label){case 0:if("TEXT"===(t=c.requiredNotNullOrUndefined(n.message.html,function(){return"HTML is not found in InAppMessagePresentationContext [".concat(n.inAppMessage.key,"]")})).resourceType)return[2,t.text];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.htmlFetcher.fetchHtmlContent(t.path)];case 2:return[2,e.sent()];case 3:return r=e.sent(),s.log.error("Failed to get HTML for InAppMessage [".concat(n.inAppMessage.key,"]: ").concat(r)),[2,null];case 4:return[2]}})})};var bC=AC;function AC(e){this.htmlFetcher=e}TC.prototype.fetchHtmlContent=function(r){return o(this,void 0,void 0,function(){var t;return a(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},TC.prototype.createRequest=function(e){return Wi.builder().url(e).method("GET").build()},TC.prototype.execute=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.transport.send(t)];case 1:return[2,e.sent()];case 2:throw e.sent();case 3:return[2]}})})},TC.prototype.handleResponse=function(e){if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is null");return e.body};var IC=TC;function TC(e){this.transport=e}_C.prototype.getOrNull=function(){return this.client},_C.prototype.isInitialized=function(){return null!==this.client},_C.prototype.require=function(){if(null===this.client)throw new Error("HackleClient is not initialized yet");return this.client},_C.prototype.set=function(e){this.client=e};ha=_C;function _C(){this.client=null}PC.prototype.onEngagement=function(e,t){this.track(e,t)},PC.prototype.track=function(e,t){var r={command:"track",parameters:{event:{key:PC.ENGAGEMENT_EVENT_KEY,properties:p(p({},e.page.properties),((r={})[aO.PAGE_NAME_PROPERTY_KEY]=e.page.pageName,r[PC.ENGAGEMENT_TIME_PROPERTY_KEY]=e.durationMillis,r))},user:void 0},browserProperties:this.browserPropertyProvider.getBrowserProperties(e.page)};this.invocationProcessor.process(r)},PC.ENGAGEMENT_EVENT_KEY="$engagement",PC.ENGAGEMENT_TIME_PROPERTY_KEY="$engagement_time_ms";var NC=PC;function PC(e,t){this.invocationProcessor=e,this.browserPropertyProvider=t}MC.prototype.onPageStarted=function(e,t){this.track(e,t)},MC.prototype.onPageEnded=function(e,t){},MC.prototype.track=function(e,t){var r={command:"track",parameters:{event:{key:aO.PAGE_VIEW_EVENT_KEY,properties:p(p({},e.properties),((r={})[aO.PAGE_NAME_PROPERTY_KEY]=e.pageName,r))},user:void 0},browserProperties:this.browserPropertyProvider.getBrowserProperties(e)};this.invocationProcessor.process(r)};var OC=MC;function MC(e,t){this.invocationProcessor=e,this.browserPropertyProvider=t}function SC(e,t,r,n,i){this.sdkKey=e,this.config=t,this.invocationProcessor=r,this.browserPropertyProvider=n,this.lifecycleCompositeManager=i}var CC={automaticRouteTracking:!0,automaticScreenTracking:!1,automaticEngagementTracking:!1},RC=s.log,UC=(kC.prototype.config=function(){var e=this.configResolver.resolve();return p(p({},CC),e)},kC);function kC(e){this.configResolver=e}DC.prototype.supports=function(e){return"getWebViewConfig"in e&&c.isNotNullOrUndefined(e.getWebViewConfig)},DC.prototype.resolveAutomaticRouteTracking=function(e){return("boolean"!=typeof e.automaticRouteTracking?CC:e).automaticRouteTracking},DC.prototype.resolveAutomaticEngagementTracking=function(e){return("boolean"!=typeof e.automaticEngagementTracking?CC:e).automaticEngagementTracking},DC.prototype.resolveAutomaticScreenTracking=function(e){return("boolean"!=typeof e.automaticScreenTracking?CC:e).automaticScreenTracking},DC.prototype.resolve=function(){try{if(!this.supports(this.hackleApp))return CC;var e=this.hackleApp.getWebViewConfig(),t=JSON.parse(e);return{automaticRouteTracking:this.resolveAutomaticRouteTracking(t),automaticEngagementTracking:this.resolveAutomaticEngagementTracking(t),automaticScreenTracking:this.resolveAutomaticScreenTracking(t)}}catch(e){return RC.warn("Failed to resolve web view config: ".concat(e)),CC}};var xC=DC;function DC(e){this.hackleApp=e}FC.prototype.createInvocationRequestDto=function(e){return{_hackle:{command:e.command,parameters:e.parameters,browserProperties:e.browserProperties}}},FC.prototype.process=function(e){var e=this.createInvocationRequestDto(e);return null!=(e=this.invocator.invoke(e).data)?e:null};var LC=FC;function FC(e){this.invocator=e}BC.prototype.invoke=function(e){e=window.prompt(JSON.stringify(e));return this.invocationResponseResolver.resolve(e)};var VC=BC;function BC(e){this.invocationResponseResolver=e}jC.prototype.invoke=function(e){if(null==(t=window._hackleApp)||!t.invoke)throw new Error("window._hackleApp.invoke is not implemented");var t=window._hackleApp.invoke(JSON.stringify(e));return this.invocationResponseResolver.resolve(t)};var KC,HC=jC;function jC(e){this.invocationResponseResolver=e}(df=KC=KC||{}).prompt="prompt",df.function="function";zC.prototype.getInvocator=function(e,t){return e===KC.prompt?new VC(t):e===KC.function?new HC(t):null};var GC=zC;function zC(){}JC.prototype.isInvocatorResponse=function(e){return"object"==typeof e&&null!==e&&"success"in e&&"boolean"==typeof e.success&&"message"in e&&"string"==typeof e.message},JC.prototype.resolve=function(e){e=JSON.parse(null!=e?e:"");if(!this.isInvocatorResponse(e))throw new Error("invalid invocator response data");if(e.success)return{message:e.message,success:e.success,data:e.data};throw new Error("failed response")};var YC=JC;function JC(){}function qC(e){var t=(new GC).getInvocator(e.getInvocationType(),new YC);if(null===t)throw new Error("Failed to get invocator with invocationType:".concat(e.getInvocationType()));return new LC(t)}i(XC,WC=SC),XC.prototype.create=function(e){var t=new Os(this.invocationProcessor,this.browserPropertyProvider,this.lifecycleCompositeManager.pageManager);return this.initialize(e),t},XC.prototype.initialize=function(e){e.automaticRouteTracking&&this.lifecycleCompositeManager.addLifecycleListener(this.lifecycleCompositeManager.pageManager),e.automaticScreenTracking&&this.lifecycleCompositeManager.addPageListener(new OC(this.invocationProcessor,this.browserPropertyProvider)),e.automaticEngagementTracking&&this.lifecycleCompositeManager.addEngagementListener(new NC(this.invocationProcessor,this.browserPropertyProvider)),this.lifecycleCompositeManager.initialize()};var WC,$C=XC;function XC(){return null!==WC&&WC.apply(this,arguments)||this}i(eR,ZC=SC),eR.prototype.create=function(e){var t=this.browserClientFactory(this.sdkKey,this.config,this.lifecycleCompositeManager),r=new Os(this.invocationProcessor,this.browserPropertyProvider,this.lifecycleCompositeManager.pageManager),t=new Ms(t,r);return this.initialize(t),t},eR.prototype.initialize=function(e){e.syncUser()};var ZC,QC=eR;function eR(e,t,r,n,i,o){e=ZC.call(this,e,t,r,n,i)||this;return e.browserClientFactory=o,e}rR.prototype.create=function(e,t){var r=this.factories[e];if(r)return r.create(t);throw new Error("Unsupported HackleAppMode: ".concat(e))};var tR=rR;function rR(e,t,r,n,i,o){this.sdkKey=e,this.config=t,this.browserPropertyProvider=r,this.lifecycleCompositeManager=n,this.browserClientFactory=i,this.invocationProcessor=o,this.factories=((e={})[_s.native]=new $C(this.sdkKey,this.config,this.invocationProcessor,this.browserPropertyProvider,this.lifecycleCompositeManager),e[_s.web_view_wrapper]=new QC(this.sdkKey,this.config,this.invocationProcessor,this.browserPropertyProvider,this.lifecycleCompositeManager,this.browserClientFactory),e)}function nR(e){return"string"==typeof e?new Hn("CLICK","LINK_AND_CLOSE",e):new Hn("CLICK","NEW_WINDOW"===(t=e).target?t.shouldCloseAfterLink?"LINK_NEW_WINDOW_AND_CLOSE":"LINK_NEW_WINDOW":"NEW_TAB"===t.target?t.shouldCloseAfterLink?"LINK_NEW_TAB_AND_CLOSE":"LINK_NEW_TAB":t.shouldCloseAfterLink?"LINK_AND_CLOSE":"WEB_LINK",e.url);var t}function iR(e){var t=e.url,e=e.elementId;return{type:"ACTION",action:t?nR(t):new Hn("CLICK","WEB_LINK",void 0),elementId:e}}R.prototype.getCurrentInAppMessageView=function(){return c.requiredNotNullOrUndefined(this.inAppMessageUi.currentMessageView,function(){return"Failed to get current in-app message view because current in-app message view is not found"})},R.prototype.openUrl=function(e){var t=this.getCurrentInAppMessageView(),e=iR({url:e});this.inAppMessageUi.viewEventHandleProcessor.process(t,e,["ACTION"])},R.prototype.trackClick=function(e){var t=this.getCurrentInAppMessageView(),e=iR({elementId:e});this.inAppMessageUi.viewEventHandleProcessor.process(t,e,["TRACK"])},R.prototype.handleUrl=function(e,t){var r=this.getCurrentInAppMessageView(),e=iR({url:e,elementId:t});this.inAppMessageUi.viewEventHandleProcessor.process(r,e,["TRACK","ACTION"])},R.prototype.closeInAppMessage=function(){var e;null!=(e=this.hackleClient.getDisplayedInAppMessageView())&&e.close()},R.prototype.getUser=function(){return this.hackleClient.getUser()},R.prototype.setUser=function(e){return this.hackleClient.setUser(e)},R.prototype.setUserId=function(e){return this.hackleClient.setUserId(e)},R.prototype.setDeviceId=function(e){return this.hackleClient.setDeviceId(e)},R.prototype.setUserProperty=function(e,t){return this.hackleClient.setUserProperty(e,t)},R.prototype.setUserProperties=function(e){return this.hackleClient.setUserProperties(e)},R.prototype.updateUserProperties=function(e){return this.hackleClient.updateUserProperties(e)},R.prototype.updatePushSubscriptions=function(e){return this.hackleClient.updatePushSubscriptions(e)},R.prototype.updateSmsSubscriptions=function(e){return this.hackleClient.updateSmsSubscriptions(e)},R.prototype.updateKakaoSubscriptions=function(e){return this.hackleClient.updateKakaoSubscriptions(e)},R.prototype.setPhoneNumber=function(e){return this.hackleClient.setPhoneNumber(e)},R.prototype.unsetPhoneNumber=function(){return this.hackleClient.unsetPhoneNumber()},R.prototype.track=function(e,t){this.hackleClient.track(e,t)},R.prototype.getDisplayedInAppMessageView=function(){return this.hackleClient.getDisplayedInAppMessageView()},R.prototype.variation=function(e,t,r){return this.hackleClient.variation(e,t,r)},R.prototype.variationDetail=function(e,t,r){return this.hackleClient.variationDetail(e,t,r)},R.prototype.isFeatureOn=function(e,t){return this.hackleClient.isFeatureOn(e,t)},R.prototype.featureFlagDetail=function(e,t){return this.hackleClient.featureFlagDetail(e,t)},R.prototype.remoteConfig=function(e){return this.hackleClient.remoteConfig(e)},R.prototype.getSessionId=function(){return s.log.error("getSessionId is not supported in InAppMessageHtmlBridge"),""},R.prototype.resetUser=function(){return s.log.error("resetUser is not supported in InAppMessageHtmlBridge"),Promise.resolve()},R.prototype.trackPageView=function(e){s.log.error("trackPageView is not supported in InAppMessageHtmlBridge")},R.prototype.setCurrentPage=function(e){s.log.error("setCurrentPage is not supported in InAppMessageHtmlBridge")},R.prototype.showUserExplorer=function(){s.log.error("showUserExplorer is not supported in InAppMessageHtmlBridge")},R.prototype.hideUserExplorer=function(){s.log.error("hideUserExplorer is not supported in InAppMessageHtmlBridge")},R.prototype.fetch=function(){return s.log.error("fetch is not supported in InAppMessageHtmlBridge"),Promise.resolve()},R.prototype.setInAppMessageListener=function(e){s.log.error("setInAppMessageListener is not supported in InAppMessageHtmlBridge")},R.prototype.getExperiment=function(e){s.log.error("getExperiment is not supported in InAppMessageHtmlBridge")},R.prototype.onReady=function(e,t){s.log.error("onReady is not supported in InAppMessageHtmlBridge")},R.prototype.onInitialized=function(e){return s.log.error("onInitialized is not supported in InAppMessageHtmlBridge"),Promise.resolve({success:!1})},R.prototype.close=function(){s.log.error("close is not supported in InAppMessageHtmlBridge")};var oR=R;function R(e,t){this.hackleClient=e,this.inAppMessageUi=t,this.openUrl=this.openUrl.bind(this),this.trackClick=this.trackClick.bind(this),this.handleUrl=this.handleUrl.bind(this),this.closeInAppMessage=this.closeInAppMessage.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.updatePushSubscriptions=this.updatePushSubscriptions.bind(this),this.updateSmsSubscriptions=this.updateSmsSubscriptions.bind(this),this.updateKakaoSubscriptions=this.updateKakaoSubscriptions.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.track=this.track.bind(this),this.getDisplayedInAppMessageView=this.getDisplayedInAppMessageView.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.remoteConfig=this.remoteConfig.bind(this)}U.prototype.openUrl=function(e){},U.prototype.trackClick=function(e){},U.prototype.handleUrl=function(e,t){},U.prototype.closeInAppMessage=function(){},U.prototype.close=function(){},U.prototype.getSessionId=function(){return""},U.prototype.resetUser=function(){return Promise.resolve()},U.prototype.trackPageView=function(e){},U.prototype.setCurrentPage=function(e){},U.prototype.showUserExplorer=function(){},U.prototype.hideUserExplorer=function(){},U.prototype.fetch=function(){return Promise.resolve()},U.prototype.setInAppMessageListener=function(e){},U.prototype.getExperiment=function(e){},U.prototype.onReady=function(e,t){},U.prototype.onInitialized=function(e){return Promise.resolve({success:!0})},U.prototype.getUser=function(){return{}},U.prototype.setUser=function(e){return Promise.resolve()},U.prototype.setUserId=function(e){return Promise.resolve()},U.prototype.setDeviceId=function(e){return Promise.resolve()},U.prototype.setUserProperty=function(e,t){return Promise.resolve()},U.prototype.setUserProperties=function(e){return Promise.resolve()},U.prototype.updateUserProperties=function(e){return Promise.resolve()},U.prototype.updatePushSubscriptions=function(e){return Promise.resolve()},U.prototype.updateSmsSubscriptions=function(e){return Promise.resolve()},U.prototype.updateKakaoSubscriptions=function(e){return Promise.resolve()},U.prototype.setPhoneNumber=function(e){return Promise.resolve()},U.prototype.unsetPhoneNumber=function(){return Promise.resolve()},U.prototype.track=function(e,t){},U.prototype.getDisplayedInAppMessageView=function(){return null},U.prototype.variation=function(e,t,r){return null!=r?r:"A"},U.prototype.variationDetail=function(e,t,r){return At.of(null!=r?r:"A",l.UNSUPPORTED_PLATFORM)},U.prototype.isFeatureOn=function(e,t){return!1},U.prototype.featureFlagDetail=function(e,t){return Tt.off(l.UNSUPPORTED_PLATFORM)},U.prototype.remoteConfig=function(e){return new Nt};var sR=U;function U(){}k.prototype.resolveViewId=function(){var e;return null!=(e=null!=(e=this.viewId)?e:null==(e=this.getCurrentInAppMessageView())?void 0:e.id)?e:null},k.prototype.getCurrentInAppMessageView=function(){var e={command:"getCurrentInAppMessageView",browserProperties:this.browserPropertyProvider.getBrowserProperties()};return this.invocationProcessor.process(e)},k.prototype.convertUrlToAction=function(e){var e=nR(e);return{behavior:e.behavior,actionType:e.type,value:null!=(e=e.value)?e:null}},k.prototype.openUrl=function(e){var t=this.resolveViewId();t?(e=this.convertUrlToAction(e),t={browserProperties:this.browserPropertyProvider.getBrowserProperties(),command:"handleInAppMessageView",parameters:{viewId:t,handleTypes:["ACTION"],event:{type:"ACTION",action:e,element:{}}}},this.invocationProcessor.process(t)):s.log.error("Failed to open url because current in-app message view is not found")},k.prototype.trackClick=function(e){var t=this.resolveViewId();t?(t={browserProperties:this.browserPropertyProvider.getBrowserProperties(),command:"handleInAppMessageView",parameters:{viewId:t,handleTypes:["TRACK"],event:{type:"ACTION",element:{elementId:e}}}},this.invocationProcessor.process(t)):s.log.error("Failed to track click because current in-app message view is not found")},k.prototype.handleUrl=function(e,t){var r=this.resolveViewId();r?(e=this.convertUrlToAction(e),r={browserProperties:this.browserPropertyProvider.getBrowserProperties(),command:"handleInAppMessageView",parameters:{viewId:r,handleTypes:["ACTION","TRACK"],event:{type:"ACTION",action:e,element:{elementId:t}}}},this.invocationProcessor.process(r)):s.log.error("Failed to handle url because current in-app message view is not found")},k.prototype.closeInAppMessage=function(){var e=this.resolveViewId();e?(e={browserProperties:this.browserPropertyProvider.getBrowserProperties(),command:"closeInAppMessageView",parameters:{viewId:e}},this.invocationProcessor.process(e)):s.log.error("Failed to close in-app message because current in-app message view is not found")},k.prototype.getSessionId=function(){return this.webAppClient.getSessionId()},k.prototype.getUser=function(){return this.webAppClient.getUser()},k.prototype.setUser=function(e){return this.webAppClient.setUser(e)},k.prototype.setUserId=function(e){return this.webAppClient.setUserId(e)},k.prototype.setDeviceId=function(e){return this.webAppClient.setDeviceId(e)},k.prototype.setUserProperty=function(e,t){return this.webAppClient.setUserProperty(e,t)},k.prototype.setUserProperties=function(e){return this.webAppClient.setUserProperties(e)},k.prototype.updateUserProperties=function(e){return this.webAppClient.updateUserProperties(e)},k.prototype.updatePushSubscriptions=function(e){return this.webAppClient.updatePushSubscriptions(e)},k.prototype.updateSmsSubscriptions=function(e){return this.webAppClient.updateSmsSubscriptions(e)},k.prototype.updateKakaoSubscriptions=function(e){return this.webAppClient.updateKakaoSubscriptions(e)},k.prototype.resetUser=function(){return this.webAppClient.resetUser()},k.prototype.setPhoneNumber=function(e){return this.webAppClient.setPhoneNumber(e)},k.prototype.unsetPhoneNumber=function(){return this.webAppClient.unsetPhoneNumber()},k.prototype.variation=function(e,t,r){return this.webAppClient.variation(e,t,r)},k.prototype.variationDetail=function(e,t,r){return this.webAppClient.variationDetail(e,t,r)},k.prototype.isFeatureOn=function(e,t){return this.webAppClient.isFeatureOn(e,t)},k.prototype.featureFlagDetail=function(e,t){return this.webAppClient.featureFlagDetail(e,t)},k.prototype.track=function(e,t){return this.webAppClient.track(e,t)},k.prototype.trackPageView=function(e){return this.webAppClient.trackPageView(e)},k.prototype.setCurrentPage=function(e){return this.webAppClient.setCurrentPage(e)},k.prototype.remoteConfig=function(e){return this.webAppClient.remoteConfig(e)},k.prototype.showUserExplorer=function(){return this.webAppClient.showUserExplorer()},k.prototype.hideUserExplorer=function(){return this.webAppClient.hideUserExplorer()},k.prototype.fetch=function(){return this.webAppClient.fetch()},k.prototype.setInAppMessageListener=function(e){return this.webAppClient.setInAppMessageListener(e)},k.prototype.getDisplayedInAppMessageView=function(){return this.webAppClient.getDisplayedInAppMessageView()},k.prototype.getExperiment=function(e){return this.webAppClient.getExperiment(e)},k.prototype.onReady=function(e,t){return this.webAppClient.onReady(e,t)},k.prototype.onInitialized=function(e){return this.webAppClient.onInitialized(e)},k.prototype.close=function(){return this.webAppClient.close()};var aR=k;function k(e,t,r,n){this.viewId=e,this.webAppClient=t,this.invocationProcessor=r,this.browserPropertyProvider=n,this.openUrl=this.openUrl.bind(this),this.trackClick=this.trackClick.bind(this),this.handleUrl=this.handleUrl.bind(this),this.closeInAppMessage=this.closeInAppMessage.bind(this),this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.updatePushSubscriptions=this.updatePushSubscriptions.bind(this),this.updateSmsSubscriptions=this.updateSmsSubscriptions.bind(this),this.updateKakaoSubscriptions=this.updateKakaoSubscriptions.bind(this),this.resetUser=this.resetUser.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.setCurrentPage=this.setCurrentPage.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getDisplayedInAppMessageView=this.getDisplayedInAppMessageView.bind(this),this.getExperiment=this.getExperiment.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.close=this.close.bind(this)}var uR=s.log;pR.prototype.get=function(t){return this.actors.find(function(e){return e.supports(t)})};var cR=pR;function pR(e){this.actors=e}fR.prototype.supports=function(e){return"IMPRESSION"===e.type},fR.prototype.action=function(e,t){};var lR=fR;function fR(){}dR.prototype.supports=function(e){return"ACTION"===e.type},dR.prototype.action=function(e,t){var r,n,i=this.actionHandlerFactory.get(t.action);!(null==(n=null==(r=e.ui.inAppMessageListener)?void 0:r.onInAppMessageClick)?void 0:n.call(r,os.toPublic(e.context.inAppMessage),as.toPublic(e),$n.fromAction(t.action)))&&e.status.canClose()&&null!=i&&i.handle(e,t.action)};var hR=dR;function dR(e){this.actionHandlerFactory=e}vR.prototype.supports=function(e){return"CLOSE"===e.type},vR.prototype.action=function(e,t){};var yR=vR;function vR(){}mR.create=function(e,t){return new ER(e,t)};var gR=mR;function mR(){}wR.prototype.create=function(){return new oR(this.hackleClientSupplier(),this.inAppMessageUiSupplier())};var ER=wR;function wR(e,t){this.hackleClientSupplier=e,this.inAppMessageUiSupplier=t}bR.prototype.addPageListener=function(e){this.compositeManager.addPageListener(e)},bR.prototype.addEngagementListener=function(e){this.compositeManager.addEngagementListener(e)},bR.prototype.addLifecycleListener=function(e){this.compositeManager.addLifecycleListener(e)},bR.prototype.initialize=function(){this.compositeManager.initialize()};$a=bR;function bR(e,t){void 0===t&&(t=yt);var r=new jP,n=new cO,t=new fO(n,t);this.compositeManager=new ZS(r,n,t,e),this.compositeManager.addLifecycleListener(this.compositeManager.pageManager)}var AR=s.log,IR=new ha;function TR(e,t){var r,n,i,o,s,a,u,t=UN.config(t),c=(UN.logging(t),new mO),p=c.getBrowserProperties().browserName,l=new cO,f=new jP,h=new fO(l,yt),f=new ZS(f,l,h,"string"==typeof p?p:null);try{if(Ps(window)&&e===window._hackleApp.getAppSdkKey())return r={sdkKey:e,browserConfig:t,hackleApp:window._hackleApp,lifecycleComposite:f,browserPropertyProvider:c,browserClientFactory:_R},n=r.sdkKey,i=r.browserConfig,o=r.hackleApp,s=r.lifecycleComposite,a=r.browserPropertyProvider,r=r.browserClientFactory,u=qC(o),n=new tR(n,i,a,s,r,u),i=new UC(new xC(o)),u=null!=(r=null==(s=null==(a=o.getAppMode)?void 0:a.call(o))?void 0:s.toLowerCase())?r:_s.native,a=i.config(),n.create(u,a)}catch(e){AR.error("Unexpected exception while check WebApp client: ".concat(e))}return _R(e,t,f)}function _R(e,t,r){var n=UN.sdk(e,t);if(IR.isInitialized())return AR.debug("use already exists hackleClient"),IR.require();var i=new ms,o=(i.initialize(),new kT),s=vs.getInstance({days:Ze,isCrossSubdomain:!0,sameSite:t.sameSiteCookie,isSecure:t.secureCookie}),a=UN.isBeaconSupported(),u=gP.intercept(n,EP.create()),c=gP.intercept(n,bP.create()),p=u,l=(a&&(p=c),new xN),f=new LN(l,new VN("setTimeout"),UN.pollingIntervalMillis(t)),h=new BP(n,DT.postfix(o,"_".concat(e.slice(0,8)))),d=new JN(HT.clientFetch(t.sdkUrl,n.key),u),h=new tP(h,d),d=(l.add(h),new XN(HT.userTargets(t.sdkUrl),u)),y=new WN(HT.userCohorts(t.sdkUrl),u),v=new mN(r.pageManager),g=new PT(DT.postfix(s,"_".concat(e))),m=g.getUser(),E=t.user||null,g=new _T(ws(),g,d,y,v,r.pageManager,Ve.instance,m,E),d=(l.add(g),new RT(t.sessionTimeoutMillis,DT.postfix(s,"_".concat(e.slice(8))))),y=(g.addListener(d),new aT(o,"".concat(tt,"_").concat(e),We)),E=new oP(HT.clientDispatch(t.eventUrl),u),l=E,a=(a&&(l=new oP(HT.beaconDispatch(t.eventUrl,n.key),c)),new aP(y,E)),n=new nP(E,l,a),c=new XP([new tO(UN.dedupIntervalMillis(t)),new iO(UN.dedupIntervalMillis(t))]),y=new hP(n,We,new VN("setTimeout"),Xe),E=new A0(y,c,d,g),l=new qS(d),n=new $S(l),w=(E.addDecorator(n),new FP),c=new q0(new FT(s,"".concat(at,"_").concat(e.slice(0,8)))),n=new q0(new FT(s,"".concat(ut,"_").concat(e.slice(0,8)))),b=new GT(DT.prefix(o,"".concat(ct,"_").concat(e.slice(0,8),"_"))),A=new R_(DT.prefix(o,"".concat(pt,"_").concat(e.slice(0,8),"_"))),I=new qM(Ve.instance),T=new $M(I,E),I=XI.create(h,I,E,[c,n]),_=new vO(I,g),N=new pN(new fN(DT.postfix(s,"_".concat(e.slice(0,8)))),v,I,g),P=new w0(g,I),P=(d.addListener(N),d.addListener(P),new p_(I)),O=new YT([new qT,new $T(new Z_),new ZT(new Z_),new e_(b,Ve.instance),new r_(new eN),new i_(new eN),new s_(new rN),new u_(new rN)]),O=new cR([new lR,new hR(O),new yR]),P=new k_([new D_(P),new F_(O)]),O=new B_(Ve.instance,P),P=new G_([new Y_,new q_(O),new $_(O)]),M=new N_(HT.inAppMessageRenderer(t.cdnUrl,t.IAM_RENDERER_VERSION_HEADER)),S=gR.create(function(){return IR.require()},function(){return C}),M=T_.create(M),S=EC.create(new bC(new IC(u)),S),M=new eC([M,S]),C=new f_(M,O,P),S=Z0.get("delegatingEvaluator"),M=new KO(new SO(S),new GO,T),O=new YO(A),P=new ZO(C,O),S=new eM,O=new DS(b,A,M),b=new jS(I,M),A=new rM(Ve.instance,new VN("setTimeout")),M=new YM(DT.prefix(o,"".concat(vt,"_").concat(e.slice(0,8),"_"))),o=new uM(A,new Map,M),e=new KS(I,O,T),O=new gM(h,g,S,b,e,P,l),T=[new PM(O,o),new SM(O,o),new YS(O,o)],b=new RM(new kM,new EM(T)),P=(A.listener=b,new H_(new O_(Z0.get("targetMatcher")))),l=new FM(h,P,e),O=new BM(b),T=new HM(l,O),A=new GM(S,o),R=new PO(b,M,T,A,y,Ve.instance),P=(g.addListener(R),new SN(h)),e=(new ON(y,P),new dO(I,g)),l=(r.addEngagementListener(e),new aO(I,g)),O=(t.automaticPageTracking&&r.addPageListener(l),t.automaticRouteTracking&&r.addLifecycleListener(r.pageManager),new OP(Z0.get("targetMatcher"))),S=new DP(s,lt,{days:ft}),o=new NP(h,O,S,I),b=new RP(new kP(v),new iN,S,w),M=new IP(o,b,g,I),T=(r.addPageListener(M),new BT(I,g,c,n)),P=(null==(A=t.devTool)?void 0:A.userExplorer)&&"function"==typeof(null==(y=t.devTool)?void 0:y.userExplorer),e=t.devTool&&P?{manager:t.devTool,userExplorer:T}:void 0,s=(t.enableMonitoring&&(l=new so(HT.monitoring(t.monitoringUrl),u,p,new VN("setTimeout"),$e),zi.addRegistry(l),r.addLifecycleListener(l)),r.addLifecycleListener(d),r.addLifecycleListener(i),r.addLifecycleListener(a),r.addLifecycleListener(E),f.start(),zP.create(dt,1)),U=new ps(I,f,d,g,_,s,r.pageManager,C,e);IR.set(U);return(new tT).install(I,g),h=Date.now(),O=g.currentUser,v=d.currentSessionId,(cT(m,O)?d.startNewSessionIfNeeded(O,h):d.startNewSession(m,O,h))===v&&N.startNewCampaignIfNeeded(O,h),U.onReady(function(){t.autoOpenDevTool&&(t.devTool?U.showUserExplorer():AR.error("DevTool is not provided")),r.initialize(),w.dispatchDoneEventIfNeeded(),R.loadDelaySchedule()}),U}var NR=function(e,t){return(NR=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)};var PR=function(){return(PR=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function OR(e,s,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}o((u=u.apply(e,s||[])).next())})}function MR(n,i){var o,s,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(n,u)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function SR(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}CR.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},CR.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},CR.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};r=CR;function CR(){this.listeners={}}UR.arePropertiesEqual=function(e,t){var r=UR.coerceUnknownToProperties(e),n=UR.coerceUnknownToProperties(t),e=Object.keys(r),t=Object.keys(n);return e.length===t.length&&e.every(function(e){return e in n&&r[e]===n[e]})},UR.coerceUnknownToProperties=function(e){return"object"==typeof e&&null!==e?e:{}};var RR=UR;function UR(){}xR.isUserEqual=function(e,t){return(null==e?void 0:e.id)===(null==t?void 0:t.id)&&(null==e?void 0:e.deviceId)===(null==t?void 0:t.deviceId)&&(null==e?void 0:e.userId)===(null==t?void 0:t.userId)&&RR.arePropertiesEqual(null==e?void 0:e.properties,null==t?void 0:t.properties)&&RR.arePropertiesEqual(null==e?void 0:e.identifiers,null==t?void 0:t.identifiers)};var kR=xR;function xR(){}var DR=function(n){var e=i,t=n;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}function i(e,t){var r=n.call(this)||this;return r._currentUser=null,r.client=TR(e,PR(PR({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"11.54.0-canary.26"})),r.getSessionId=r.getSessionId.bind(r),r.getUser=r.getUser.bind(r),r.setUser=r.setUser.bind(r),r.setUserId=r.setUserId.bind(r),r.setDeviceId=r.setDeviceId.bind(r),r.setUserProperty=r.setUserProperty.bind(r),r.setUserProperties=r.setUserProperties.bind(r),r.updateUserProperties=r.updateUserProperties.bind(r),r.updatePushSubscriptions=r.updatePushSubscriptions.bind(r),r.updateSmsSubscriptions=r.updateSmsSubscriptions.bind(r),r.updateKakaoSubscriptions=r.updateKakaoSubscriptions.bind(r),r.resetUser=r.resetUser.bind(r),r.variation=r.variation.bind(r),r.variationDetail=r.variationDetail.bind(r),r.isFeatureOn=r.isFeatureOn.bind(r),r.featureFlagDetail=r.featureFlagDetail.bind(r),r.track=r.track.bind(r),r.trackPageView=r.trackPageView.bind(r),r.setCurrentPage=r.setCurrentPage.bind(r),r.remoteConfig=r.remoteConfig.bind(r),r.onReady=r.onReady.bind(r),r.onInitialized=r.onInitialized.bind(r),r.showUserExplorer=r.showUserExplorer.bind(r),r.hideUserExplorer=r.hideUserExplorer.bind(r),r.fetch=r.fetch.bind(r),r.close=r.close.bind(r),r.setInAppMessageListener=r.setInAppMessageListener.bind(r),r.getExperiment=r.getExperiment.bind(r),r.setPhoneNumber=r.setPhoneNumber.bind(r),r.unsetPhoneNumber=r.unsetPhoneNumber.bind(r),r.emitUpdatedUser=r.emitUpdatedUser.bind(r),r.getDisplayedInAppMessageView=r.getDisplayedInAppMessageView.bind(r),null!=t&&t.devTool&&null!=t&&t.autoOpenDevTool&&"undefined"!=typeof window&&r.showUserExplorer(),r}return NR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r),i.prototype.getSessionId=function(){return this.client.getSessionId()},i.prototype.getUser=function(){return this.client.getUser()},i.prototype.setUser=function(t){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.setUser(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setUserId=function(t){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.setUserId(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setDeviceId=function(t){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.setDeviceId(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setUserProperty=function(t,r){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.setUserProperty(t,r),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setUserProperties=function(t){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.setUserProperties(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.updateUserProperties=function(t){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.updateUserProperties(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.updatePushSubscriptions=function(t){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.updatePushSubscriptions(t),[2]})})},i.prototype.updateSmsSubscriptions=function(t){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.updateSmsSubscriptions(t),[2]})})},i.prototype.updateKakaoSubscriptions=function(t){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.updateKakaoSubscriptions(t),[2]})})},i.prototype.resetUser=function(){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.resetUser(),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.variation=function(e,t,r){return this.client.variation(e,t||void 0,r)},i.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t||void 0,r)},i.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t||void 0)},i.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t||void 0)},i.prototype.track=function(e,t){this.client.track(e,t||void 0)},i.prototype.trackPageView=function(e){this.client.trackPageView(PR(PR({},e),{user:(null==e?void 0:e.user)||void 0}))},i.prototype.setCurrentPage=function(e){this.client.setCurrentPage(e)},i.prototype.remoteConfig=function(e){return this.client.remoteConfig(e||void 0)},i.prototype.onReady=function(e,t){this.client.onReady(e,t)},i.prototype.getExperiment=function(e){return this.client.getExperiment(e)},i.prototype.onInitialized=function(e){return this.client.onInitialized(e)},i.prototype.emitUpdatedUser=function(e){kR.isUserEqual(this._currentUser,e)||this.emit("user-updated",e),this._currentUser=e},i.prototype.showUserExplorer=function(){this.client.showUserExplorer()},i.prototype.hideUserExplorer=function(){this.client.hideUserExplorer()},i.prototype.fetch=function(){return this.client.fetch()},i.prototype.setInAppMessageListener=function(e){this.client.setInAppMessageListener(e)},i.prototype.close=function(){this.client.close()},i.prototype.setPhoneNumber=function(t){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.setPhoneNumber(t),[2]})})},i.prototype.unsetPhoneNumber=function(){return OR(this,void 0,void 0,function(){return MR(this,function(e){return this.client.unsetPhoneNumber(),[2]})})},i.prototype.getDisplayedInAppMessageView=function(){return this.client.getDisplayedInAppMessageView()},i}(r);var x={exports:{}},b={},LR=Object.getOwnPropertySymbols,FR=Object.prototype.hasOwnProperty,VR=Object.prototype.propertyIsEnumerable;var wp=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),i=1;i<arguments.length;i++){for(var o in r=Object(arguments[i]))FR.call(r,o)&&(n[o]=r[o]);if(LR)for(var s=LR(r),a=0;a<s.length;a++)VR.call(r,s[a])&&(n[s[a]]=r[s[a]])}return n},BR=wp,Xa="function"==typeof Symbol&&Symbol.for,KR=Xa?Symbol.for("react.element"):60103,HR=Xa?Symbol.for("react.portal"):60106,Xu=Xa?Symbol.for("react.fragment"):60107,I=Xa?Symbol.for("react.strict_mode"):60108,Fa=Xa?Symbol.for("react.profiler"):60114,jR=Xa?Symbol.for("react.provider"):60109,GR=Xa?Symbol.for("react.context"):60110,zR=Xa?Symbol.for("react.forward_ref"):60112,Ra=Xa?Symbol.for("react.suspense"):60113,YR=Xa?Symbol.for("react.memo"):60115,JR=Xa?Symbol.for("react.lazy"):60116,qR="function"==typeof Symbol&&Symbol.iterator;function WR(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 $R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},XR={};function ZR(e,t,r){this.props=e,this.context=t,this.refs=XR,this.updater=r||$R}function QR(){}function eU(e,t,r){this.props=e,this.context=t,this.refs=XR,this.updater=r||$R}ZR.prototype.isReactComponent={},ZR.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(WR(85));this.updater.enqueueSetState(this,e,t,"setState")},ZR.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},QR.prototype=ZR.prototype;var nu=eU.prototype=new QR,tU=(nu.constructor=eU,BR(nu,ZR.prototype),nu.isPureReactComponent=!0,{current:null}),rU=Object.prototype.hasOwnProperty,nU={key:!0,ref:!0,__self:!0,__source:!0};function iU(e,t,r){var n,i={},o=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)rU.call(t,n)&&!nU.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(1===a)i.children=r;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===i[n]&&(i[n]=a[n]);return{$$typeof:KR,type:e,key:o,ref:s,props:i,_owner:tU.current}}function oU(e){return"object"==typeof e&&null!==e&&e.$$typeof===KR}var sU=/\/+/g,aU=[];function uU(e,t,r,n){var i;return aU.length?((i=aU.pop()).result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i):{result:e,keyPrefix:t,func:r,context:n,count:0}}function cU(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,aU.length<10&&aU.push(e)}function pU(e,t,r){return null==e?0:function e(t,r,n,i){var o=!1;if(null===(t="undefined"!=(a=typeof t)&&"boolean"!==a?t:null))o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case KR:case HR:o=!0}}if(o)return n(i,t,""===r?"."+lU(t,0):r),1;if(o=0,r=""===r?".":r+":",Array.isArray(t))for(var s=0;s<t.length;s++){var a,u=r+lU(a=t[s],s);o+=e(a,u,n,i)}else if("function"==typeof(u=null!==t&&"object"==typeof t&&"function"==typeof(u=qR&&t[qR]||t["@@iterator"])?u:null))for(t=u.call(t),s=0;!(a=t.next()).done;)o+=e(a=a.value,u=r+lU(a,s++),n,i);else if("object"===a)throw n=""+t,Error(WR(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return o}(e,"",t,r)}function lU(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 fU(e,t){e.func.call(e.context,t,e.count++)}function hU(e,t,r){var n=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?dU(e,n,r,function(e){return e}):null!=e&&(oU(e)&&(t=i+(!(i=e).key||t&&t.key===e.key?"":(""+e.key).replace(sU,"$&/")+"/")+r,e={$$typeof:KR,type:i.type,key:t,ref:i.ref,props:i.props,_owner:i._owner}),n.push(e))}function dU(e,t,r,n,i){var o="";pU(e,hU,t=uU(t,o=null!=r?(""+r).replace(sU,"$&/")+"/":o,n,i)),cU(t)}var yU={current:null};function vU(){var e=yU.current;if(null===e)throw Error(WR(321));return e}var gU,mU,EU,id={ReactCurrentDispatcher:yU,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:tU,IsSomeRendererActing:{current:!1},assign:BR},A=(b.Children={map:function(e,t,r){if(null==e)return e;var n=[];return dU(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;pU(e,fU,t=uU(null,null,t,r)),cU(t)},count:function(e){return pU(e,function(){return null},null)},toArray:function(e){var t=[];return dU(e,t,null,function(e){return e}),t},only:function(e){if(oU(e))return e;throw Error(WR(143))}},b.Component=ZR,b.Fragment=Xu,b.Profiler=Fa,b.PureComponent=eU,b.StrictMode=I,b.Suspense=Ra,b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=id,b.cloneElement=function(e,t,r){if(null==e)throw Error(WR(267,e));var n=BR({},e.props),i=e.key,o=e.ref,s=e._owner;if(null!=t)for(a in void 0!==t.ref&&(o=t.ref,s=tU.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)rU.call(t,a)&&!nU.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==u?u:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];n.children=u}return{$$typeof:KR,type:e.type,key:i,ref:o,props:n,_owner:s}},b.createContext=function(e,t){return(e={$$typeof:GR,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:jR,_context:e},e.Consumer=e},b.createElement=iU,b.createFactory=function(e){var t=iU.bind(null,e);return t.type=e,t},b.createRef=function(){return{current:null}},b.forwardRef=function(e){return{$$typeof:zR,render:e}},b.isValidElement=oU,b.lazy=function(e){return{$$typeof:JR,_ctor:e,_status:-1,_result:null}},b.memo=function(e,t){return{$$typeof:YR,type:e,compare:void 0===t?null:t}},b.useCallback=function(e,t){return vU().useCallback(e,t)},b.useContext=function(e,t){return vU().useContext(e,t)},b.useDebugValue=function(){},b.useEffect=function(e,t){return vU().useEffect(e,t)},b.useImperativeHandle=function(e,t,r){return vU().useImperativeHandle(e,t,r)},b.useLayoutEffect=function(e,t){return vU().useLayoutEffect(e,t)},b.useMemo=function(e,t){return vU().useMemo(e,t)},b.useReducer=function(e,t,r){return vU().useReducer(e,t,r)},b.useRef=function(e){return vU().useRef(e)},b.useState=function(e){return vU().useState(e)},b.version="16.14.0",{}),j=Function.call.bind(Object.prototype.hasOwnProperty),wU=function(){};function bU(e,t,r,n,i){if("production"!==production)for(var o in e)if(EU(e,o)){var s,a;try{if("function"!=typeof e[o])throw(a=Error((n||"React class")+": "+r+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.")).name="Invariant Violation",a;s=e[o](t,o,n,r,null,gU)}catch(e){s=e}!s||s instanceof Error||wU((n||"React class")+": type specification of "+r+" `"+o+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in mU)&&(mU[s.message]=!0,o=i?i():"",wU("Failed "+r+" type: "+s.message+(null!=o?o:"")))}}if("production"!==production&&(gU="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",mU={},EU=j,wU=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),bU.resetWarningCache=function(){"production"!==production&&(mU={})},"production"!==production){var AU=wp,IU=bU,T="function"==typeof Symbol&&Symbol.for,TU=T?Symbol.for("react.element"):60103,_U=T?Symbol.for("react.portal"):60106,NU=T?Symbol.for("react.fragment"):60107,PU=T?Symbol.for("react.strict_mode"):60108,OU=T?Symbol.for("react.profiler"):60114,MU=T?Symbol.for("react.provider"):60109,SU=T?Symbol.for("react.context"):60110,CU=T?Symbol.for("react.concurrent_mode"):60111,RU=T?Symbol.for("react.forward_ref"):60112,UU=T?Symbol.for("react.suspense"):60113,kU=T?Symbol.for("react.suspense_list"):60120,xU=T?Symbol.for("react.memo"):60115,DU=T?Symbol.for("react.lazy"):60116,LU=T?Symbol.for("react.block"):60121,FU=T?Symbol.for("react.fundamental"):60117,VU=T?Symbol.for("react.responder"):60118,BU=T?Symbol.for("react.scope"):60119,KU="function"==typeof Symbol&&Symbol.iterator,HU="@@iterator";function jU(e){if(null===e||"object"!=typeof e)return null;e=KU&&e[KU]||e[HU];return"function"==typeof e?e:null}var GU={current:null},zU={current:null},YU=/^(.*)[\\\/]/,JU=1;function qU(e){if(null==e)return null;if("number"==typeof e.tag&&ek("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 NU:return"Fragment";case _U:return"Portal";case OU:return"Profiler";case PU:return"StrictMode";case UU:return"Suspense";case kU:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case SU:return"Context.Consumer";case MU:return"Context.Provider";case RU:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case xU:return qU(e.type);case LU:return qU(e.render);case DU:r=(t=e)._status===JU?t._result:null;if(r)return qU(r)}var t,r;return null}var WU={},$U=null;function XU(e){$U=e}WU.getCurrentStack=null,WU.getStackAddendum=function(){var e,t,r,n,i,o="",s=($U&&(e=qU($U.type),r=$U._owner,o+=(e=e,t=$U._source,r=r&&qU(r.type),i="",t?(n=(s=t.fileName).replace(YU,""),i=" (at "+(n=/^index\./.test(n)&&(s=s.match(YU))&&(s=s[1])?s.replace(YU,"")+"/"+n:n)+":"+t.lineNumber+")"):r&&(i=" (created by "+r+")"),"\n in "+(e||"Unknown")+i)),WU.getCurrentStack);return s&&(o+=s()||""),o};var ZU={ReactCurrentDispatcher:GU,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:zU,IsSomeRendererActing:{current:!1},assign:AU};function QU(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];tk("warn",e,r)}function ek(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];tk("error",e,r)}function tk(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=ZU.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 i=0,o="Warning: "+t.replace(/%s/g,function(){return r[i++]});throw new Error(o)}catch(e){}}AU(ZU,{ReactDebugCurrentFrame:WU,ReactComponentTreeHook:{}});var rk={};function nk(e,t){var e=e.constructor,e=e&&(e.displayName||e.name)||"ReactClass",r=e+"."+t;rk[r]||(ek("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),rk[r]=!0)}var ik={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){nk(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){nk(e,"replaceState")},enqueueSetState:function(e,t,r,n){nk(e,"setState")}},ok={};function sk(e,t,r){this.props=e,this.context=t,this.refs=ok,this.updater=r||ik}Object.freeze(ok),sk.prototype.isReactComponent={},sk.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")},sk.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var ak,uk={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(ak in uk)uk.hasOwnProperty(ak)&&!function(e,t){Object.defineProperty(sk.prototype,e,{get:function(){QU("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(ak,uk[ak]);function ck(){}function pk(e,t,r){this.props=e,this.context=t,this.refs=ok,this.updater=r||ik}ck.prototype=sk.prototype,(T=pk.prototype=new ck).constructor=pk,AU(T,sk.prototype),T.isPureReactComponent=!0;var lk,fk,hk=Object.prototype.hasOwnProperty,dk={key:!0,ref:!0,__self:!0,__source:!0};function yk(e){if(hk.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function vk(e){if(hk.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var gk={},mk=function(e,t,r,n,i,o,s){e={$$typeof:TU,type:e,key:t,ref:r,props:s,_owner:o,_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:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e};function Ek(e,t,r){var n,i={},o=null,s=null,a=null,u=null;if(null!=t)for(n in yk(t)&&(s=t.ref,"string"==typeof(c=t).ref&&zU.current&&c.__self&&zU.current.stateNode!==c.__self&&(l=qU(zU.current.type),gk[l]||(ek('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',qU(zU.current.type),c.ref),gk[l]=!0))),vk(t)&&(o=""+t.key),a=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source,t)hk.call(t,n)&&!dk.hasOwnProperty(n)&&(i[n]=t[n]);var c,p,l,f,h=arguments.length-2;if(1==h)i.children=r;else if(1<h){for(var d=Array(h),y=0;y<h;y++)d[y]=arguments[y+2];Object.freeze&&Object.freeze(d),i.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(n in v)void 0===i[n]&&(i[n]=v[n])}function g(){fk||(fk=!0,ek("%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)",p))}function m(){lk||(lk=!0,ek("%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)",f))}return(o||s)&&(c="function"==typeof e?e.displayName||e.name||"Unknown":e,o&&(l=i,f=c,m.isReactWarning=!0,Object.defineProperty(l,"key",{get:m,configurable:!0})),s&&(r=i,p=c,g.isReactWarning=!0,Object.defineProperty(r,"ref",{get:g,configurable:!0}))),mk(e,o,s,a,u,zU.current,i)}function wk(e){return"object"==typeof e&&null!==e&&e.$$typeof===TU}var bk=".",Ak=":",Ik=!1,Tk=/\/+/g;function _k(e){return(""+e).replace(Tk,"$&/")}var Nk=10,Pk=[];function Ok(e,t,r,n){var i;return Pk.length?((i=Pk.pop()).result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i):{result:e,keyPrefix:t,func:r,context:n,count:0}}function Mk(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,Pk.length<Nk&&Pk.push(e)}function Sk(e,t,r){return null==e?0:function e(t,r,n,i){var o,s=typeof t,a=!1;if(null===(t="undefined"!=s&&"boolean"!=s?t:null))a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case TU:case _U:a=!0}}if(a)return n(i,t,""===r?bk+Ck(t,0):r),1;var u=0,c=""===r?bk:r+Ak;if(Array.isArray(t))for(var p=0;p<t.length;p++)u+=e(o=t[p],c+Ck(o,p),n,i);else if("function"==typeof(r=jU(t))){r===t.entries&&(Ik||QU("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."),Ik=!0);for(var l,f=r.call(t),h=0;!(l=f.next()).done;)u+=e(o=l.value,c+Ck(o,h++),n,i)}else if("object"==s)throw r="",r=" If you meant to render a collection of children, use an array instead."+WU.getStackAddendum(),s=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==s?"object with keys {"+Object.keys(t).join(", ")+"}":s)+")."+r);return u}(e,"",t,r)}function Ck(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 Rk(e,t,r){var n=e.func,i=e.context;n.call(i,t,e.count++)}function Uk(e,t,r){var n=e.result,i=e.keyPrefix,o=e.func,s=e.context,o=o.call(s,t,e.count++);Array.isArray(o)?kk(o,n,r,function(e){return e}):null!=o&&(wk(o)&&(e=i+(!(s=o).key||t&&t.key===o.key?"":_k(o.key)+"/")+r,o=mk(s.type,e,s.ref,s._self,s._source,s._owner,s.props)),n.push(o))}function kk(e,t,r,n,i){var o="",t=Ok(t,o=null!=r?_k(r)+"/":o,n,i);Sk(e,Uk,t),Mk(t)}function xk(e){return"string"==typeof e||"function"==typeof e||e===NU||e===CU||e===OU||e===PU||e===UU||e===kU||"object"==typeof e&&null!==e&&(e.$$typeof===DU||e.$$typeof===xU||e.$$typeof===MU||e.$$typeof===SU||e.$$typeof===RU||e.$$typeof===FU||e.$$typeof===VU||e.$$typeof===BU||e.$$typeof===LU)}function Dk(){var e=GU.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 Lk(){if(zU.current){var e=qU(zU.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var Fk=!1,Vk={};function Bk(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,t=t,(r=Lk())||(t="string"==typeof t?t:t.displayName||t.name)&&(r="\n\nCheck the top-level render call using <"+t+">."),Vk[t=r]||(Vk[t]=!0,r="",e&&e._owner&&e._owner!==zU.current&&(r=" It was passed a child from "+qU(e._owner.type)+"."),XU(e),ek('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),XU(null)))}function Kk(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];wk(n)&&Bk(n,t)}else if(wk(e))e._store&&(e._store.validated=!0);else if(e){var i=jU(e);if("function"==typeof i&&i!==e.entries)for(var o,s=i.call(e);!(o=s.next()).done;)wk(o.value)&&Bk(o.value,t)}}function Hk(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=qU(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==RU&&t.$$typeof!==xU)return;r=t.propTypes}r?(XU(e),IU(r,e.props,"prop",n,WU.getStackAddendum),XU(null)):void 0===t.PropTypes||Fk||(Fk=!0,ek("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||ek("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jk(e,t,r){var n,i=xk(e),t=(i||(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+".":"")||Lk(),null===e?s="null":Array.isArray(e)?s="array":void 0!==e&&e.$$typeof===TU?(s="<"+(qU(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,ek("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,n)),Ek.apply(this,arguments));if(null==t)return t;if(i)for(var o=2;o<arguments.length;o++)Kk(arguments[o],e);if(e===NU){var s=t;XU(s);for(var a=Object.keys(s.props),u=0;u<a.length;u++){var c=a[u];if("children"!==c&&"key"!==c){ek("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c);break}}null!==s.ref&&ek("Invalid attribute `ref` supplied to `React.Fragment`."),XU(null)}else Hk(t);return t}var Gk=!1;try{var zk=Object.freeze({}),Yk=new Map([[zk,null]]),Jk=new Set([zk]);Yk.set(0,0),Jk.add(0)}catch(e){}function qk(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,i,o=AU({},e.props),s=e.key,a=e.ref,u=e._self,c=e._source,p=e._owner;if(null!=t)for(n in yk(t)&&(a=t.ref,p=zU.current),vk(t)&&(s=""+t.key),e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)hk.call(t,n)&&!dk.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==i?o[n]=i[n]:o[n]=t[n]);var l=arguments.length-2;if(1==l)o.children=r;else if(1<l){for(var f=Array(l),h=0;h<l;h++)f[h]=arguments[h+2];o.children=f}return mk(e.type,s,a,u,c,p,o)}.apply(this,arguments),i=2;i<arguments.length;i++)Kk(arguments[i],n.type);return Hk(n),n}function Wk(e){var t=jk.bind(null,e);return t.type=e,Gk||(Gk=!0,QU("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 QU("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}T=jk,A.Children={map:function(e,t,r){if(null==e)return e;var n=[];return kk(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=Ok(null,null,t,r),Sk(e,Rk,t),Mk(t)},count:function(e){return Sk(e,function(){return null},null)},toArray:function(e){var t=[];return kk(e,t,null,function(e){return e}),t},only:function(e){if(wk(e))return e;throw Error("React.Children.only expected to receive a single React element child.")}},A.Component=sk,A.Fragment=NU,A.Profiler=OU,A.PureComponent=pk,A.StrictMode=PU,A.Suspense=UU,A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZU,A.cloneElement=qk,A.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&ek("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:SU,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:MU,_context:r}),i=!1,t={$$typeof:SU,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(t,{Provider:{get:function(){return i||(i=!0,ek("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,ek("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},A.createElement=T,A.createFactory=Wk,A.createRef=function(){var e={current:null};return Object.seal(e),e},A.forwardRef=function(e){return null!=e&&e.$$typeof===xU?ek("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?ek("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&ek("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||ek("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:RU,render:e}},A.isValidElement=wk,A.lazy=function(e){var t,r,n={$$typeof:DU,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){ek("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){ek("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},A.memo=function(e,t){return xk(e)||ek("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:xU,type:e,compare:void 0===t?null:t}},A.useCallback=function(e,t){return Dk().useCallback(e,t)},A.useContext=function(e,t){var r,n=Dk();return void 0!==t&&ek("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?ek("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&&ek("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},A.useDebugValue=function(e,t){return Dk().useDebugValue(e,t)},A.useEffect=function(e,t){return Dk().useEffect(e,t)},A.useImperativeHandle=function(e,t,r){return Dk().useImperativeHandle(e,t,r)},A.useLayoutEffect=function(e,t){return Dk().useLayoutEffect(e,t)},A.useMemo=function(e,t){return Dk().useMemo(e,t)},A.useReducer=function(e,t,r){return Dk().useReducer(e,t,r)},A.useRef=function(e){return Dk().useRef(e)},A.useState=function(e){return Dk().useState(e)},A.version="16.14.0"}"production"===production?x.exports=b:x.exports=A;var $k=x.exports,Xk=x.exports.createContext({hackle:void 0,userVersion:0,initialized:!1}),Ma=Xk.Consumer,Zk=Xk.Provider;var Qk=s.log;function ex(e,t){e=tx(e,t=void 0===t?"A":t);return{isLoading:e.isLoading,variation:e.decision.variation}}function tx(e,t){void 0===t&&(t="A");var r=x.exports.useContext(Xk),n=r.hackle,i=r.userVersion,o=r.initialized,s=x.exports.useCallback(function(){return o?(null==n?void 0:n.variationDetail(e))||At.of(t,l.EXCEPTION):At.of(t,l.SDK_NOT_READY)},[t,e,n,o]),r=SR(x.exports.useState(function(){return n?s():(Qk.error("HackleClient is not existed"),At.of(t,l.EXCEPTION))}),2),a=r[0],r=r[1],i={key:e,userVersion:i,initialized:o},u=SR(x.exports.useState(i),2),c=u[0],u=u[1];return ix(c,i)||(u(i),r(s())),{isLoading:!o,decision:a}}function rx(e){e=nx(e);return{isLoading:e.isLoading,isOn:e.decision.isOn}}function nx(e){var t=x.exports.useContext(Xk),r=t.hackle,n=t.userVersion,i=t.initialized,o=x.exports.useCallback(function(){return i?(null==r?void 0:r.featureFlagDetail(e))||Tt.off(l.EXCEPTION):Tt.off(l.SDK_NOT_READY)},[e,r,i]),t=SR(x.exports.useState(function(){return r?o():(Qk.error("HackleClient is not existed"),Tt.off(l.EXCEPTION))}),2),s=t[0],t=t[1],n={key:e,userVersion:n,initialized:i},a=SR(x.exports.useState(n),2),u=a[0],a=a[1];return ix(u,n)||(a(n),t(o())),{isLoading:!i,decision:s}}function ix(e,t){return e.initialized===t.initialized&&e.key===t.key&&e.userVersion===t.userVersion}function ox(e){var t,r=e.experimentKey,e=e.children,n=(r=ex(r)).isLoading,i=r.variation;return n?null:e&&"function"==typeof e?e(i):(x.exports.Children.forEach(e,function(e){x.exports.isValidElement(e)&&(e.props.variation?i===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?x.exports.cloneElement(t,{variation:i}):null)}function sx(e){return e.variation,e=e.children,x.exports.createElement(x.exports.Fragment,null,e)}function ax(e){var t=(r=rx(e.featureKey)).isLoading,r=r.isOn;return t?null:$k.createElement($k.Fragment,null,e.children(r))}n.Bucket=xt,n.Cohort=ii,n.Container=ar,n.ContainerGroup=cr,n.CoreVersion=Er,n.Decision=At,n.DecisionReason=l,n.DefaultBrowserPropertyProvider=mO,n.Delay=qn,n.EXPERIMENT_IMPLEMENTATION_TYPE=St,n.EmptyHackleRemoteConfig=Nt,n.EmptyParameterConfig=Ke,n.EventType=Vt,n.Experiment=Ct,n.FeatureFlagDecision=Tt,n.HackleContext=Xk,n.HackleContextConsumer=Ma,n.HackleContextProvider=Zk,n.HackleExperiment=ox,n.HackleFeature=ax,n.HackleInAppMessageActionImpl=$n,n.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=void 0===(i=e.timeout)?3e3:i,i=void 0!==(i=e.supportSSR)&&i,e=e.children,o=SR(x.exports.useState({hackle:t,initialized:!1,userVersion:0}),2),s=o[0],a=o[1];return x.exports.useEffect(function(){null!=r&&t.setUser(r)},[r]),x.exports.useEffect(function(){function e(){a(function(e){return PR(PR({},e),{userVersion:e.userVersion+1})})}return t.on("user-updated",e),function(){t.off("user-updated",e)}},[t]),x.exports.useEffect(function(){t.onInitialized({timeout:n}).then(function(){a(function(e){return PR(PR({},e),{initialized:!0})})},function(){a(function(e){return PR(PR({},e),{initialized:!0})})}).catch(function(){a(function(e){return PR(PR({},e),{initialized:!0})})})},[t]),i||s.initialized?$k.createElement(Zk,{value:s},e):null},n.HackleSubscriptionOperations=lC,n.HackleSubscriptionOperationsBuilder=cC,n.HackleVariation=sx,n.IAM_ACTION_AREA=["BUTTON","IMAGE","MESSAGE","X_BUTTON"],n.IAM_ACTION_TYPE=Fr,n.IAM_BEHAVIOR=Lr,n.IAM_DISPLAY_TYPE=kr,n.IAM_HORIZONTAL_ALIGNMENT=Br,n.IAM_LAYOUT_TYPE=xr,n.IAM_ORIENTATION=Dr,n.IAM_PLATFORM_TYPE=Rr,n.IAM_STATUS=Cr,n.IAM_TIMETABLE_TYPE=Kr,n.IAM_TIMEUNIT=Ur,n.IAM_VERTICAL_ALIGNMENT=Vr,n.IdentifierType=Kt,n.IdentifiersBuilder=Gt,n.InAppMessage=Hr,n.InAppMessageAction=Hn,n.InAppMessageAfterCondition=Yn,n.InAppMessageAlignment=_n,n.InAppMessageBackground=Kn,n.InAppMessageButton=Dn,n.InAppMessageButtonStyle=Bn,n.InAppMessageContext=mn,n.InAppMessageContextLayout=In,n.InAppMessageContextMessage=bn,n.InAppMessageDurationCap=fn,n.InAppMessageEvaluateContext=Gn,n.InAppMessageEventFrequencyCap=un,n.InAppMessageEventTrigger=on,n.InAppMessageEventTriggerRule=sn,n.InAppMessageExperimentContext=wn,n.InAppMessageHtmlFactory=ri,n.InAppMessageHtmlPath=ei,n.InAppMessageHtmlText=Zn,n.InAppMessageIdentifierCap=pn,n.InAppMessageImage=Pn,n.InAppMessageImageAutoScroll=Mn,n.InAppMessagePeriodAlways=Gr,n.InAppMessagePeriodCustom=Yr,n.InAppMessagePositionalButton=Fn,n.InAppMessageTargetContext=dn,n.InAppMessageText=Cn,n.InAppMessageTextAttribute=Un,n.InAppMessageTextStyle=xn,n.InAppMessageTimetable=qr,n.InAppMessageTimetableAll=Xr,n.InAppMessageTimetableCustom=en,n.InAppMessageTimetableSlot=rn,n.InAppMessageUserOverride=vn,n.Logger=s,n.MATCH_OPERATORS=_r,n.MATCH_TYPES=Ir,n.MATCH_VALUE_TYPES=Tr,n.MetaVersion=br,n.ParameterConfiguration=Ot,n.PropertyOperations=Xo,n.PropertyOperationsBuilder=Wo,n.RemoteConfigDecision=wt,n.RemoteConfigParameter=lr,n.RemoteConfigParameterValue=yr,n.RemoteConfigTargetRule=hr,n.SEGMENT_TYPES=Or,n.Segment=or,n.Slot=Lt,n.SplitUrlConfig=oi,n.SplitUrlTargets=ai,n.TARGET_ACTION_TYPES=Nr,n.TARGET_KEY_TYPES=Pr,n.Target=Jt,n.TargetAction=tr,n.TargetCondition=Wt,n.TargetKey=Xt,n.TargetMatch=Qt,n.TargetRule=nr,n.TargetingType=Mr,n.UserTargetEvent=ci,n.Variation=Ut,n.Version=gr,n.WebViewLifecycleCompositeManager=$a,n.createInstance=function(e,t){return new DR(e,t)},n.getUserId=ws,n.removeUserId=bs,n.resolveIdentifiers=jt,n.sanitizeUser=Yt,n.setUserId=function(e){vs.getInstance().setItem(et,e)},n.setWebAppInAppMessageHtmlBridge=function(){var e,s,a;e={targetWindow:window,createClientBySdkKey:function(e){return TR(e)}},s=e.targetWindow,a=e.createClientBySdkKey,hC.isBridgeInstalled(s)?uR.debug("WebAppInAppMessageHtmlBridge is already installed"):(e=function(){var e;try{if(!Ps(s))throw new Error("WebAppInAppMessageHtmlBridge is only supported for WebApp");var t=s._hackleApp,r=new mO,n=qC(t),i=a(t.getAppSdkKey()),o=null==(e=null==s?void 0:s.getInAppMessageViewId)?void 0:e.call(s);if(o)return new aR(o,i,n,r);throw new Error("ViewId is not found")}catch(e){return uR.error("Failed to install WebAppInAppMessageHtmlBridge: ".concat(e)),new sR}}(),hC.install(s,e))},n.useFeature=function(e){var t=(n=x.exports.useContext(Xk)).hackle,r=n.userVersion,n=n.initialized,i=x.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e))||!1},[e,t,n]),o=(s=SR(x.exports.useState(function(){return t?i():("undefined"!=typeof window&&Qk.error("HackleClient is not existed"),!1)}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=SR(x.exports.useState(r),2))[0],n=n[1];return ix(a,r)||(n(r),s(i())),o},n.useFeatureFlagDetail=function(e){var t=(n=x.exports.useContext(Xk)).hackle,r=n.userVersion,n=n.initialized,i=x.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e))||Tt.off(l.EXCEPTION)},[e,t,n]),o=(s=SR(x.exports.useState(function(){return t?i():("undefined"!=typeof window&&Qk.error("HackleClient is not existed"),Tt.off(l.EXCEPTION))}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=SR(x.exports.useState(r),2))[0],n=n[1];return ix(a,r)||(n(r),s(i())),o},n.useLoadableFeature=rx,n.useLoadableFeatureDetail=nx,n.useLoadableRemoteConfig=function(){var e=(o=x.exports.useContext(Xk)).hackle,t=o.userVersion,r=o.initialized,n=x.exports.useCallback(function(){return r&&(null==e?void 0:e.remoteConfig())||new Nt},[e,r]),i=(o=SR(x.exports.useState(function(){return e||Qk.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(a=SR(x.exports.useState(t),2))[0],a=a[1];return ix(s,t)||(a(t),o(n())),{isLoading:!r,remoteConfig:i}},n.useLoadableVariation=ex,n.useLoadableVariationDetail=tx,n.useRemoteConfig=function(){var e=(r=x.exports.useContext(Xk)).hackle,t=r.userVersion,r=r.initialized,n=x.exports.useCallback(function(){return(null==e?void 0:e.remoteConfig())||new Nt},[e,r]),i=(o=SR(x.exports.useState(function(){return e||Qk.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(r=SR(x.exports.useState(t),2))[0],r=r[1];return ix(s,t)||(r(t),o(n())),i},n.useTrack=function(){var t=x.exports.useContext(Xk).hackle;return t?function(e){return null==t?void 0:t.track(e)}:(Qk.error("HackleClient is not existed"),function(){})},n.useVariation=function(e,t){void 0===t&&(t="A");var r=(a=x.exports.useContext(Xk)).hackle,n=a.userVersion,i=a.initialized,o=x.exports.useCallback(function(){return i&&(null==r?void 0:r.variation(e))||t},[t,e,r,i]),s=(a=SR(x.exports.useState(function(){return r?o():("undefined"!=typeof window&&Qk.error("HackleClient is not existed"),t)}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(c=SR(x.exports.useState(n),2))[0],c=c[1];return ix(u,n)||(c(n),a(o())),s},n.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(i=x.exports.useContext(Xk)).hackle,n=i.userVersion,i=i.initialized,o=x.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e))||At.of(t,l.EXCEPTION)},[t,e,r,i]),s=(a=SR(x.exports.useState(function(){return r?o():("undefined"!=typeof window&&Qk.error("HackleClient is not existed"),At.of(t,l.EXCEPTION))}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(i=SR(x.exports.useState(n),2))[0],i=i[1];return ix(u,n)||(i(n),a(o())),s},Object.defineProperty(n,"__esModule",{value:!0})});
|