@amplitude/experiment-tag 0.15.1 → 0.15.2

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.
@@ -1,3 +1,3 @@
1
- /* @amplitude/experiment-tag v0.15.1 - For license info see https://unpkg.com/@amplitude/experiment-tag@0.15.1/files/LICENSE */
2
- var WebExperiment=function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function n(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function r(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function h(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var v="is",g="is not",m="contains",y="does not contain",b="less",w="less or equal",x="greater",S="greater or equal",k="version less",E="version less or equal",C="version greater",O="version greater or equal",P="set is",M="set is not",_="set contains",I="set does not contain",A="set contains any",j="set does not contain any",N="regex match",T="regex does not match",V=-862048943,L=461845907,U=function(e,t){void 0===t&&(t=0);for(var n=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return Uint8Array.from(t)}(e),r=n.length,i=r>>2,o=t,a=0;a<i;a++){var s=B(n,a<<2);o=F(s,o)}var l=i<<2,u=0;switch(r-l){case 3:u^=n[l+2]<<16,u^=n[l+1]<<8,u^=n[l],u=Math.imul(u,V),u=D(u,15),o^=u=Math.imul(u,L);break;case 2:u^=n[l+1]<<8,u^=n[l],u=Math.imul(u,V),u=D(u,15),o^=u=Math.imul(u,L);break;case 1:u^=n[l],u=Math.imul(u,V),u=D(u,15),o^=u=Math.imul(u,L)}return R(o^=r)>>>0},F=function(e,t){var n=e,r=t;return n=Math.imul(n,V),n=D(n,15),n=Math.imul(n,L),r=D(r^=n,13),(r=Math.imul(r,5))+-430675100|0},R=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},D=function(e,t,n){return void 0===n&&(n=32),t>n&&(t%=n),(e<<t|(e&4294967295<<n-t>>>0)>>>0>>>n-t>>>0)>>>0},B=function(e,t){void 0===t&&(t=0);var n=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return K(n)},K=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},q=function(e,t){var n,r;if(t&&0!==t.length){try{for(var i=p(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!a||!e||"object"!=typeof e)return;e=e[a]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null==e?void 0:e}},z="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),W=function(){function e(e,t,n,r){void 0===r&&(r=void 0),this.major=e,this.minor=t,this.patch=n,this.preRelease=r}return e.parse=function(t){if(t){var n=new RegExp(z).exec(t);if(n){var r=Number(n[1]),i=Number(n[2]);if(!isNaN(r)&&!isNaN(i))return new e(r,i,Number(n[4])||0,n[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),J=function(){function e(){}return e.prototype.evaluate=function(e,t){var n,r,i={},o={context:e,result:i};try{for(var a=p(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.evaluateFlag=function(e,t){var n,r,i;try{for(var o=p(t.segments),a=o.next();!a.done;a=o.next()){var s=a.value;if(i=this.evaluateSegment(e,t,s)){var l=u(u(u({},t.metadata),s.metadata),i.metadata);i=u(u({},i),{metadata:l});break}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.prototype.evaluateSegment=function(e,t,n){var r;return n.conditions?this.evaluateConditions(e,n.conditions)&&void 0!==(r=this.bucket(e,n))?t.variants[r]:void 0:void 0!==(r=this.bucket(e,n))?t.variants[r]:void 0},e.prototype.evaluateConditions=function(e,t){var n,r,i,o;try{for(var a=p(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=!0;try{for(var c=(i=void 0,p(l)),d=c.next();!d.done;d=c.next()){var f=d.value;if(!(u=this.matchCondition(e,f)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return!1},e.prototype.matchCondition=function(e,t){var n=q(e,t.selector);if(null==n)return this.matchNull(t.op,t.values);if(this.isSetOperator(t.op)){var r=this.coerceStringArray(n);return!!r&&this.matchSet(r,t.op,t.values)}var i=this.coerceString(n);return void 0!==i&&this.matchString(i,t.op,t.values)},e.prototype.getHash=function(e){return U(e)},e.prototype.bucket=function(e,t){var n,r,i,o;if(!t.bucket)return t.variant;var a=this.coerceString(q(e,t.bucket.selector));if(!a||0===a.length)return t.variant;var s="".concat(t.bucket.salt,"/").concat(a),l=this.getHash(s),u=l%100,c=Math.floor(l/100);try{for(var d=p(t.bucket.allocations),f=d.next();!f.done;f=d.next()){var h=f.value,v=h.range[0],g=h.range[1];if(u>=v&&u<g)try{for(var m=(i=void 0,p(h.distributions)),y=m.next();!y.done;y=m.next()){var b=y.value,w=b.range[0],x=b.range[1];if(c>=w&&c<x)return b.variant}}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return t.variant},e.prototype.matchNull=function(e,t){var n=this.containsNone(t);switch(e){case v:case m:case b:case w:case x:case S:case k:case E:case C:case O:case P:case _:case A:return n;case g:case y:case I:case j:return!n;default:return!1}},e.prototype.matchSet=function(e,t,n){switch(t){case P:return this.setEquals(e,n);case M:return!this.setEquals(e,n);case _:return this.matchesSetContainsAll(e,n);case I:return!this.matchesSetContainsAll(e,n);case A:return this.matchesSetContainsAny(e,n);case j:return!this.matchesSetContainsAny(e,n);default:return!1}},e.prototype.matchString=function(e,t,n){var r=this;switch(t){case v:return this.matchesIs(e,n);case g:return!this.matchesIs(e,n);case m:return this.matchesContains(e,n);case y:return!this.matchesContains(e,n);case b:case w:case x:case S:return this.matchesComparable(e,t,n,(function(e){return r.parseNumber(e)}),this.comparator);case k:case E:case C:case O:return this.matchesComparable(e,t,n,(function(e){return W.parse(e)}),this.versionComparator);case N:return this.matchesRegex(e,n);case T:return!this.matchesRegex(e,n);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var n=e.toLowerCase();if("true"===n||"false"===n)return t.some((function(e){return e.toLowerCase()===n}))}return t.some((function(t){return e===t}))},e.prototype.matchesContains=function(e,t){var n,r;try{for(var i=p(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.toLowerCase().includes(a.toLowerCase()))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.prototype.matchesComparable=function(e,t,n,r,i){var o=this,a=r(e),s=n.map((function(e){return r(e)})).filter((function(e){return void 0!==e}));return void 0===a||0===s.length?n.some((function(n){return o.comparator(e,t,n)})):s.some((function(e){return i(a,t,e)}))},e.prototype.comparator=function(e,t,n){switch(t){case b:case k:return e<n;case w:case E:return e<=n;case x:case C:return e>n;case S:case O:return e>=n;default:return!1}},e.prototype.versionComparator=function(e,t,n){var r=e.compareTo(n);switch(t){case b:case k:return r<0;case w:case E:return r<=0;case x:case C:return r>0;case S:case O:return r>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some((function(t){return Boolean(new RegExp(t).exec(e))}))},e.prototype.containsNone=function(e){return e.some((function(e){return"(none)"===e}))},e.prototype.containsBooleans=function(e){return e.some((function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map((function(e){return t.coerceString(e)})).filter(Boolean);var n=String(e);try{var r=JSON.parse(n);return Array.isArray(r)?e.map((function(e){return t.coerceString(e)})).filter(Boolean):(i=this.coerceString(n))?[i]:void 0}catch(e){var i;return(i=this.coerceString(n))?[i]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case P:case M:case _:case I:case A:case j:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var n=new Set(e),r=new Set(t);return n.size===r.size&&h([],f(r),!1).every((function(e){return n.has(e)}))},e.prototype.matchesSetContainsAll=function(e,t){var n,r;if(e.length<t.length)return!1;try{for(var i=p(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!this.matchesIs(a,e))return!1}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var n,r;try{for(var i=p(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(this.matchesIs(a,e))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e}(),H=function(e,t,n){var r,i;void 0===n&&(n=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];n.push(o.key);var a=[],s=function(e){if(n.some((function(t){return t===e})))throw Error("Detected a cycle between flags ".concat(n));var r=H(e,t,n);r&&a.push.apply(a,h([],f(r),!1))};try{for(var l=p(o.dependencies),u=l.next();!u.done;u=l.next()){s(u.value)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return a.push(o),n.pop(),delete t[o.key],a}};const X="function"==typeof Buffer,$=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),G=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Q=(e=>{let t={};return e.forEach(((e,n)=>t[e]=n)),t})(G),Z=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Y=String.fromCharCode.bind(String),ee=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),te=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),ne=e=>{let t,n,r,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,o+=G[t>>18&63]+G[t>>12&63]+G[t>>6&63]+G[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},re="function"==typeof btoa?e=>btoa(e):X?e=>Buffer.from(e,"binary").toString("base64"):ne,ie=X?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Y.apply(null,e.subarray(n,n+4096)));return re(t.join(""))},oe=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Y(192|t>>>6)+Y(128|63&t):Y(224|t>>>12&15)+Y(128|t>>>6&63)+Y(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Y(240|t>>>18&7)+Y(128|t>>>12&63)+Y(128|t>>>6&63)+Y(128|63&t)},ae=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,se=e=>e.replace(ae,oe),le=X?e=>Buffer.from(e,"utf8").toString("base64"):$?e=>ie($.encode(e)):e=>re(se(e)),ue=(e,t=!1)=>t?ee(le(e)):le(e),ce=e=>ue(e,!0),de=e=>{if(e=e.replace(/\s+/g,""),!Z.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,i="";for(let o=0;o<e.length;)t=Q[e.charAt(o++)]<<18|Q[e.charAt(o++)]<<12|(n=Q[e.charAt(o++)])<<6|(r=Q[e.charAt(o++)]),i+=64===n?Y(t>>16&255):64===r?Y(t>>16&255,t>>8&255):Y(t>>16&255,t>>8&255,255&t);return i},pe=ce;var fe=function(e){function t(n,r){var i=e.call(this,r)||this;return i.statusCode=n,Object.setPrototypeOf(i,t.prototype),i}return l(t,e),t}(Error),he=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return l(t,e),t}(Error),ve=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getVariants=function(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o;return d(this,(function(a){switch(a.label){case 0:return n=pe(JSON.stringify(e)),r={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":n},(null==t?void 0:t.flagKeys)&&(r["X-Amp-Exp-Flag-Keys"]=pe(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(r["X-Amp-Exp-Track"]=t.trackingOption),(null==t?void 0:t.exposureTrackingOption)&&(r["X-Amp-Exp-Exposure-Track"]=t.exposureTrackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:r,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=a.sent()).status)throw new fe(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),ge=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getFlags=function(e){return c(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){switch(r.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=pe(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(n=r.sent()).status)throw Error("Flags error response: status=".concat(n.status));return[2,JSON.parse(n.body).reduce((function(e,t){return e[t.key]=t,e}),{})]}}))}))},e}(),me="undefined"!=typeof globalThis?globalThis:global||self,ye=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},be=function(){var e=ye();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1},we=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=me.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(me.clearInterval(this.poller),this.poller=void 0)},e}(),xe=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Se(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),Se=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ke=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),Ee=function(){return Ee=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ee.apply(this,arguments)};function Ce(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Oe(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var Pe=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Ce(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===i)return e===t}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var s=Array.isArray(e),l=Array.isArray(t);if(s!==l)return!1;if(!s||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!Pe(u,c))return!1;var d=!0;return Object.keys(e).forEach((function(n){Pe(e[n],t[n])||(d=!1)})),d}for(var p=0;p<e.length;p++)if(!Pe(e[p],t[p]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var Me=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Ee({},this.identity.userProperties),n=Ee(Ee({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,a,s,l=n.userProperties||{};try{for(var u=Ce(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=Oe(c.value,2),p=d[0],f=d[1];switch(p){case"$set":try{for(var h=(i=void 0,Ce(Object.entries(f))),v=h.next();!v.done;v=h.next()){var g=Oe(v.value,2),m=g[0],y=g[1];l[m]=y}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(a=void 0,Ce(Object.keys(f))),w=b.next();!w.done;w=b.next()){delete l[m=w.value]}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=l,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return Ee({},this.identity)},e.prototype.setIdentity=function(e){var t=Ee({},this.identity);this.identity=Ee({},e),Pe(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),_e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Ie=function(){function e(){this.identityStore=new Me,this.eventBridge=new ke,this.applicationContextProvider=new xe}return e.getInstance=function(t){return _e.analyticsConnectorInstances||(_e.analyticsConnectorInstances={}),_e.analyticsConnectorInstances[t]||(_e.analyticsConnectorInstances[t]=new e),_e.analyticsConnectorInstances[t]},e}(),Ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var je,Ne,Te,Ve=(je=function(e,t){!function(n,r){var i="function",o="undefined",a="object",s="string",l="model",u="name",c="type",d="vendor",p="version",f="architecture",h="console",v="mobile",g="tablet",m="smarttv",y="wearable",b="embedded",w="Amazon",x="Apple",S="ASUS",k="BlackBerry",E="Browser",C="Chrome",O="Firefox",P="Google",M="Huawei",_="LG",I="Microsoft",A="Motorola",j="Opera",N="Samsung",T="Sharp",V="Sony",L="Xiaomi",U="Zebra",F="Facebook",R=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},D=function(e,t){return typeof e===s&&-1!==B(t).indexOf(B(e))},B=function(e){return e.toLowerCase()},K=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},q=function(e,t){for(var n,o,s,l,u,c,d=0;d<t.length&&!u;){var p=t[d],f=t[d+1];for(n=o=0;n<p.length&&!u;)if(u=p[n++].exec(e))for(s=0;s<f.length;s++)c=u[++o],typeof(l=f[s])===a&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):r:this[l[0]]=c?l[1].call(this,c,l[2]):r:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):r):this[l]=c||r;d+=2}},z=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(D(t[n][i],e))return"?"===n?r:n}else if(D(t[n],e))return"?"===n?r:n;return e},W={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"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,p],[/opios[\/ ]+([\w\.]+)/i],[p,[u,j+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[u,j]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[u,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+E],p],[/\bfocus\/([\w\.]+)/i],[p,[u,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[u,j+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[u,j+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[u,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[p,[u,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+E],p],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,F],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[u,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,C+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[u,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[p,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[u,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,p],[/(cobalt)\/([\w\.]+)/i],[u,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,B]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",B]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,B]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,N],[c,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,N],[c,v]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,x],[c,v]],[/(ipad\d+,\d+)/i],[l,[d,x],[c,g]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,x],[c,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,x],[c,g]],[/(macintosh);/i],[l,[d,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,M],[c,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,M],[c,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,L],[c,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,L],[c,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[c,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[c,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[c,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,A],[c,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,A],[c,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,_],[c,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,_],[c,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[c,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[c,v]],[/(pixel c)\b/i],[l,[d,P],[c,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,P],[c,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,V],[c,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,V],[c,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[c,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[c,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[c,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[c,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,k],[c,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,S],[c,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,S],[c,v]],[/(nexus 9)/i],[l,[d,"HTC"],[c,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[c,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[c,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[c,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,T],[c,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[c,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[c,g]],[/(surface duo)/i],[l,[d,I],[c,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[c,v]],[/(u304aa)/i],[l,[d,"AT&T"],[c,v]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[c,v]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[c,g]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[c,g]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[c,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[c,g]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[c,g]],[/\b(k88) b/i],[l,[d,"ZTE"],[c,g]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[c,v]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[c,v]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[c,g]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[c,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[c,g]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[c,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[c,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[c,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[c,v]],[/\b(ph-1) /i],[l,[d,"Essential"],[c,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[c,g]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[c,g]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[c,g]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[c,g]],[/(sprint) (\w+)/i],[d,l,[c,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,I],[c,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,U],[c,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,U],[c,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[c,h]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[c,h]],[/(playstation [345portablevi]+)/i],[l,[d,V],[c,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,I],[c,h]],[/smart-tv.+(samsung)/i],[d,[c,m]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,N],[c,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,_],[c,m]],[/(apple) ?tv/i],[d,[l,x+" TV"],[c,m]],[/crkey/i],[[l,C+"cast"],[d,P],[c,m]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[c,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,T],[c,m]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,V],[c,m]],[/(mitv-\w{5}) bui/i],[l,[d,L],[c,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,K],[l,K],[c,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,m]],[/((pebble))app/i],[d,l,[c,y]],[/droid.+; (glass) \d/i],[l,[d,P],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,U],[c,y]],[/(quest( 2)?)/i],[l,[d,F],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[p,z,W]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[p,z,W]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,p],[/\(bb(10);/i],[p,[u,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[u,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[u,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,p],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,p]]},H=function(e,t){if(typeof e===a&&(t=e,e=r),!(this instanceof H))return new H(e,t).getResult();var i=e||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),h=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(J,t):J;return this.getBrowser=function(){var e={};return e[u]=r,e[p]=r,q.call(e,i,h.browser),e.major=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r}(e.version),e},this.getCPU=function(){var e={};return e[f]=r,q.call(e,i,h.cpu),e},this.getDevice=function(){var e={};return e[d]=r,e[l]=r,e[c]=r,q.call(e,i,h.device),e},this.getEngine=function(){var e={};return e[u]=r,e[p]=r,q.call(e,i,h.engine),e},this.getOS=function(){var e={};return e[u]=r,e[p]=r,q.call(e,i,h.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===s&&e.length>350?K(e,350):e,this},this.setUA(i),this};H.VERSION="0.7.33",H.BROWSER=R([u,p,"major"]),H.CPU=R([f]),H.DEVICE=R([l,d,c,h,v,m,g,y,b]),H.ENGINE=H.OS=R([u,p]),e.exports&&(t=e.exports=H),t.UAParser=H;var X=typeof n!==o&&(n.jQuery||n.Zepto);if(X&&!X.ua){var $=new H;X.ua=$.getResult(),X.ua.get=function(){return $.getUA()},X.ua.set=function(e){$.setUA(e);var t=$.getResult();for(var n in t)X.ua[n]=t[n]}}}("object"==typeof window?window:Ae)},je(Te={path:Ne,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&Te.path)}},Te.exports),Te.exports),Le=function(){function e(e){this.amplitudeInstance=e}return e.prototype.getUser=function(){var e,t,n,r,i,o,a,s,l,u;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(r=null===(n=this.amplitudeInstance)||void 0===n?void 0:n.options)||void 0===r?void 0:r.userId,version:null===(o=null===(i=this.amplitudeInstance)||void 0===i?void 0:i.options)||void 0===o?void 0:o.versionName,language:null===(s=null===(a=this.amplitudeInstance)||void 0===a?void 0:a.options)||void 0===s?void 0:s.language,platform:null===(u=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===u?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,n,r,i,o;return[null===(n=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===n?void 0:n.name,null===(o=null===(i=null===(r=this.amplitudeInstance)||void 0===r?void 0:r._ua)||void 0===i?void 0:i.browser)||void 0===o?void 0:o.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(){var e,t,n;return null===(n=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===n?void 0:n.name},e}(),Ue=function(){function e(e){this.amplitudeInstance=e}return e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,n;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(n=e.variant)||void 0===n?void 0:n.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(t={},t[e.userProperty]="-",t)})},e}(),Fe=function(){return Fe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Fe.apply(this,arguments)};
3
- /* @amplitude/experiment-js-client v1.20.3 - For license info see https://app.unpkg.com/@amplitude/experiment-js-client@1.20.3/files/LICENSE */function Re(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function De(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Be(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ke(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function qe(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var ze=function(e,t){var n,r;void 0===t&&(t=!1);var i=We(e,t),o=void 0,a=me.document.cookie.split("; ");try{for(var s=Be(a),l=s.next();!l.done;l=s.next()){var u=Ke(l.value.split("=",2),2),c=u[0],d=u[1];c===i&&(o=decodeURIComponent(d))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}if(o)try{if(t){var p=atob(o);return JSON.parse(decodeURIComponent(p))}var f=o.split("."),h=void 0;return f.length>=2&&f[1]&&(h=atob(f[1])),{deviceId:f[0],userId:h}}catch(e){return}},We=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},Je=function(){function e(e,t,n){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=n,this.loadPersistedState(),n<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return Re(this,void 0,void 0,(function(){return De(this,(function(n){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==t||t.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=ze(this.apiKey,!0);return(e||(e=ze(this.apiKey,!1))||(e=function(e){var t=We(e,!0);try{var n=me.localStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=We(e,!0);try{var n=me.sessionStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return Re(this,void 0,void 0,(function(){var t,n=this;return De(this,(function(r){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise((function(e){var t=function(){e(),n.identityStore.removeIdentityListener(t)};n.identityStore.addIdentityListener(t)})),new Promise((function(t,n){me.setTimeout(n,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var He,Xe,$e,Ge=me.fetch||function(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n})),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))},Qe=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}}))}))},e}(),Ze={request:function(e,t,n,r,i){return function(e,t){return null==t||t<=0?e:new Promise((function(n,r){me.setTimeout((function(){r(new he("Request timeout after "+t+" milliseconds"))}),t),e.then(n,r)}))}(Re(void 0,void 0,void 0,(function(){var i,o;return De(this,(function(a){switch(a.label){case 0:return[4,Ge(e,{method:t,headers:n,body:r})];case 1:return i=a.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=a.sent(),[2,o]}}))})),i)}};!function(e){e[e.Disable=0]="Disable",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose"}(He||(He={})),function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(Xe||(Xe={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}($e||($e={}));var Ye=function(e){return!e||e===$e.FallbackInline||e===$e.FallbackConfig||e===$e.SecondaryInitialVariants},et={debug:!1,logLevel:He.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:Xe.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:Ze},tt="1.20.3",nt=function(){function e(e,t){var n,r=this;this.isReady=new Promise((function(e){r.resolve=e})),this.config=e,this.client=t;var i=null!==(n=e.instanceName)&&void 0!==n?n:et.instanceName;this.queue=new it(i),this.cache=new rt(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then((function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}),(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()})):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e,t){if(this.cache.shouldTrack(e,t)){var n=this.getExposureEvent(e);this.queue.push(n)}},e.prototype.getExposureEvent=function(e){var t,n,r,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(n=e.metadata)||void 0===n?void 0:n.exposureEvent,eventProperties:e}:"web"===(null===(r=e.metadata)||void 0===r?void 0:r.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),rt=function(){function e(e){this.isSessionStorageAvailable=ot(),this.inMemoryCache={},this.identity={},this.storageKey="EXP_sent_v3_".concat(e),this.isSessionStorageAvailable&&(me.sessionStorage.removeItem("EXP_sent_".concat(e)),me.sessionStorage.removeItem("EXP_sent_v2_".concat(e)))}return e.prototype.shouldTrack=function(e,t){var n,r;if("web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod))return!0;var i={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,i)||this.clearCache(),this.identity=i,this.loadCache();var o=e.flag_key in this.inMemoryCache,a=this.inMemoryCache[e.flag_key],s=null!==(r=e.variant)&&void 0!==r?r:null,l=!1;return o&&(null!=a?a:null)===s||(l=!0,this.inMemoryCache[e.flag_key]=s),this.storeCache(),l},e.prototype.clearCache=function(){this.inMemoryCache={},this.isSessionStorageAvailable&&me.sessionStorage.removeItem(this.storageKey)},e.prototype.identityEquals=function(e,t){return e.userId&&t.userId?e.userId===t.userId:!e.userId&&!t.userId&&e.deviceId===t.deviceId},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=me.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){if(this.isSessionStorageAvailable)try{me.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch(e){}},e}(),it=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=be(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=me.setInterval((function(){t.loadFlushStore()}),1e3),this.loadFlushStore()},e.prototype.flush=function(){if(this.tracker&&0!==this.inMemoryQueue.length){for(var e=0;e<this.inMemoryQueue.length;e++)try{if(!this.tracker(this.inMemoryQueue[e]))break}catch(e){break}this.inMemoryQueue=this.inMemoryQueue.slice(e),0===this.inMemoryQueue.length&&this.poller&&(me.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=me.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),me.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),ot=function(){var e=ye();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},at=function(){function e(e,t){void 0===t&&(t=He.Error),this.logger=e,this.logLevel=t}return e.prototype.error=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=He.Error&&(t=this.logger).error.apply(t,qe([e],Ke(n),!1))},e.prototype.warn=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=He.Warn&&(t=this.logger).warn.apply(t,qe([e],Ke(n),!1))},e.prototype.info=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=He.Info&&(t=this.logger).info.apply(t,qe([e],Ke(n),!1))},e.prototype.debug=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=He.Debug&&(t=this.logger).debug.apply(t,qe([e],Ke(n),!1))},e.prototype.verbose=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=He.Verbose&&(t=this.logger).verbose.apply(t,qe([e],Ke(n),!1))},e}(),st=function(){function e(){}return e.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.error.apply(console,qe([e],Ke(t),!1))},e.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.warn.apply(console,qe([e],Ke(t),!1))},e.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.info.apply(console,qe([e],Ke(t),!1))},e.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.debug.apply(console,qe([e],Ke(t),!1))},e.prototype.verbose=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.debug.apply(console,qe([e],Ke(t),!1))},e}(),lt=function(){function e(){this.globalScope=ye()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var n;null===(n=this.globalScope)||void 0===n||n.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),ut=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),ct=function(){function e(e,t,n){this.cache={},this.namespace=e,this.storage=t,this.transformer=n}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return Fe({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,n;try{for(var r=Be(Object.keys(e)),i=r.next();!i.done;i=r.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,n,r=this.storage.get(this.namespace);try{n=JSON.parse(r)||{}}catch(e){return}var i={};try{for(var o=Be(Object.keys(n)),a=o.next();!a.done;a=o.next()){var s=a.value;try{var l=void 0;(l=this.transformer?this.transformer(n[s]):n[s])&&(i[s]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),dt=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,n=e.value,r=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var a={};return t?a.key=t:n&&(a.key=n),n&&(a.value=n),i&&(a.metadata=i),r&&(a.payload=r),o&&(a.expKey=o),a}},pt=function(){function e(){this.globalScope=ye()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var n;null===(n=this.globalScope)||void 0===n||n.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),ft=function(e){return null==e},ht=function(e){return!!ft(e)||e&&0===Object.keys(e).length},vt=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},gt=function(){function e(e,t,n,r){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=n,this.scalar=r}return e.prototype.start=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}}))}))},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,n){return Re(this,void 0,void 0,(function(){var r=this;return De(this,(function(i){return this.done||(this.timeoutHandle=me.setTimeout((function(){return Re(r,void 0,void 0,(function(){var r,i;return De(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(r=t+1)<this.attempts&&(i=Math.min(n*this.scalar,this.max),this.backoff(e,r,i)),[3,3];case 3:return[2]}}))}))}),n)),[2]}))}))},e}(),mt=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},yt=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n},bt=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),wt=function(){function e(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}return e.prototype.track=function(e,t){var n={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,n)||(this.tracked={}),this.identity=n;var r=e.flag_key in this.tracked,i=this.tracked[e.flag_key];r&&i===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))},e.prototype.identityEquals=function(e,t){return e.userId===t.userId&&e.deviceId===t.deviceId},e}(),xt=function(){function e(t,n){var r,i,o,a,s=this;this.engine=new J,this.isRunning=!1,this.apiKey=t,n=function(e){var t,n;if(!e||"object"!=typeof e)return{};var r={};try{for(var i=Be(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=Ke(o.value,2),s=a[0],l=a[1];ft(l)||(r[s]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(n),this.config=Fe(Fe(Fe({},et),n),{serverUrl:(null==n?void 0:n.serverUrl)||("eu"===(null===(r=null==n?void 0:n.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":et.serverUrl),flagsServerUrl:(null==n?void 0:n.flagsServerUrl)||("eu"===(null===(i=null==n?void 0:n.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":et.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=n.flagConfigPollingIntervalMillis)&&void 0!==o?o:et.flagConfigPollingIntervalMillis}),this.logger=new at(this.config.loggerProvider||new st,e.getLogLevel(n));var l=null===(a=this.config)||void 0===a?void 0:a.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new we((function(){return s.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=dt(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new bt(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new wt(this.config.exposureTrackingProvider)),this.integrationManager=new nt(this.config,this);var c,d=new Qe(this.config.httpClient||Ze);this.flagApi=new ge(this.apiKey,this.config.flagsServerUrl,d),this.evaluationApi=new ve(this.apiKey,this.config.serverUrl,d);var p=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;c=this.isWebExperiment?new pt:new lt,this.variants=function(e,t,n){var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r);return new ct(i,n,dt)}(this.apiKey,p,c),this.flags=function(e,t,n){void 0===n&&(n=new lt);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-flags");return new ct(i,n)}(this.apiKey,p,c),this.fetchVariantsOptions=function(e,t,n){void 0===n&&(n=new lt);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-variants-options");return new ut(i,n)}(this.apiKey,p,c);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Re(this,void 0,void 0,(function(){var t,n,r;return De(this,(function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:return i.trys.push([1,6,,7]),t=this.doFlags(),null===(r=this.config.fetchOnStart)||void 0===r||r?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(n=i.sent(),this.config.throwOnError)throw n;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}}))}))},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return Re(this,arguments,void 0,(function(e,t){var n;return void 0===e&&(e=this.user),De(this,(function(r){switch(r.label){case 0:this.setUser(e||{}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return r.sent(),[3,4];case 3:if(n=r.sent(),this.config.throwOnError)throw n;return n instanceof he?this.logger.debug(n):this.logger.error(n),[3,4];case 4:return[2,this]}}))}))},e.prototype.variant=function(e,t){var n,r;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.logger.debug("[Experiment] variant for ".concat(e," is ").concat((null===(n=i.variant)||void 0===n?void 0:n.key)||(null===(r=i.variant)||void 0===r?void 0:r.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var n=this.flags.get(t);vt(n)||delete e[t]}return Fe(Fe(Fe({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=Fe({},this.user.user_properties);return Fe(Fe({},this.user),{user_properties:t})}return Fe({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var n=Fe({},e.user_properties);this.user=Fe(Fe({},e),{user_properties:n})}else this.user=Fe({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(t){e.flags.get(t.key)||e.flags.put(t.key,t)}))},e.prototype.evaluate=function(e){var t,n,r=this.addContext(this.user),i=function(e,t){var n,r,i=u({},e),o=[],a=t||Object.keys(i);try{for(var s=p(a),l=s.next();!l.done;l=s.next()){var c=l.value,d=H(c,i);d&&o.push.apply(o,h([],f(d),!1))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(this.flags.getAll(),e),o=function(e){var t,n,r,i;if(!e)return{};var o={user:e},a=ye();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var l=Be(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e.groups[c];if(d.length>0&&d[0]){var p=d[0],f={group_name:p},h=null===(i=null===(r=e.group_properties)||void 0===r?void 0:r[c])||void 0===i?void 0:i[p];h&&Object.keys(h).length>0&&(f.group_properties=h),s[c]=f}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return Object.keys(s).length>0&&(o.groups=s),delete o.user.groups,delete o.user.group_properties,o}(r),a=this.engine.evaluate(o,i),s={};try{for(var l=Be(Object.keys(a)),c=l.next();!c.done;c=l.next()){var d=c.value;s[d]=yt(a[d])}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return s},e.prototype.variantAndSource=function(e,t){var n={};this.config.source===Xe.LocalStorage?n=this.localStorageVariantAndSource(e,t):this.config.source===Xe.InitialVariants&&(n=this.initialVariantsVariantAndSource(e,t));var r=this.flags.get(e);return(vt(r)||!n.variant&&r)&&(n=this.localEvaluationVariantAndSource(e,r,t)),n},e.prototype.localEvaluationVariantAndSource=function(e,t,n){var r,i={},o=this.evaluate([t.key])[e],a=$e.LocalEvaluation,s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!ft(o)&&!s)return{variant:mt(o),source:a,hasDefaultVariant:!1};if(s&&(i={variant:mt(o),source:a,hasDefaultVariant:!0}),!ft(n))return{variant:mt(n),source:$e.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!ft(l))return{variant:mt(l),source:$e.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=mt(this.config.fallbackVariant),c={variant:u,source:$e.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return ht(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var n,r={},i=this.variants.get(e),o=null===(n=null==i?void 0:i.metadata)||void 0===n?void 0:n.default;if(!ft(i)&&!o)return{variant:mt(i),source:$e.LocalStorage,hasDefaultVariant:!1};if(o&&(r={variant:mt(i),source:$e.LocalStorage,hasDefaultVariant:!0}),!ft(t))return{variant:mt(t),source:$e.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var a=this.config.initialVariants[e];if(!ft(a))return{variant:mt(a),source:$e.SecondaryInitialVariants,hasDefaultVariant:r.hasDefaultVariant};var s=mt(this.config.fallbackVariant),l={variant:s,source:$e.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return ht(s)?r:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var n,r={},i=this.config.initialVariants[e];if(!ft(i))return{variant:mt(i),source:$e.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!ft(o)&&!a)return{variant:mt(o),source:$e.LocalStorage,hasDefaultVariant:!1};if(a&&(r={variant:mt(o),source:$e.LocalStorage,hasDefaultVariant:!0}),!ft(t))return{variant:mt(t),source:$e.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var s=mt(this.config.fallbackVariant),l={variant:s,source:$e.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return ht(s)?r:l},e.prototype.fetchInternal=function(e,t,n,r){return Re(this,void 0,void 0,(function(){var i,o,a;return De(this,(function(s){switch(s.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(n)),n&&this.stopRetries(),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.doFetch(e,t,Fe({trackingOption:null===(a=this.fetchVariantsOptions.get())||void 0===a?void 0:a.trackingOption},r))];case 2:return i=s.sent(),[4,this.storeVariants(i,r)];case 3:return s.sent(),[2,i];case 4:throw o=s.sent(),n&&this.shouldRetryFetch(o)&&this.startRetries(e,r),o;case 5:return[2]}}))}))},e.prototype.setTracksAssignment=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(t){return this.fetchVariantsOptions.put(Fe(Fe({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]}))}))},e.prototype.cleanUserPropsForFetch=function(e){var t=Fe({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,n){return Re(this,void 0,void 0,(function(){var r,i,o,a,s,l,u;return De(this,(function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Fe({timeoutMillis:t},n))];case 2:r=c.sent(),i={};try{for(o=Be(Object.keys(r)),a=o.next();!a.done;a=o.next())s=a.value,i[s]=yt(r[s])}catch(e){l={error:e}}finally{try{a&&!a.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.logger.debug("[Experiment] Received variants: ",i),[2,i]}}))}))},e.prototype.doFlags=function(){return Re(this,void 0,void 0,(function(){var e,t,n;return De(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=r.sent(),r.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:tt,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=r.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((n=r.sent())instanceof he))throw n;if(this.logger.debug(n),this.config.throwOnError)throw n;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},e.prototype.storeVariants=function(e,t){return Re(this,void 0,void 0,(function(){var n,r,i,o;return De(this,(function(a){for(o in 0===(n=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),r=function(t){n=n.filter((function(e){return e!==t})),i.variants.put(t,e[t])},i=this,e)r(o);for(o in n)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.logger.debug("[Experiment] Stored variants: ",e),[2]}))}))},e.prototype.startRetries=function(e,t){return Re(this,void 0,void 0,(function(){var n=this;return De(this,(function(r){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new gt(8,500,1e4,1.5),this.retriesBackoff.start((function(){return Re(n,void 0,void 0,(function(){return De(this,(function(n){switch(n.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return n.sent(),[2]}}))}))})),[2]}))}))},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,n=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),r=this.integrationManager.getUser(),i=Fe(Fe(Fe({},null==n?void 0:n.user_properties),r.user_properties),null==e?void 0:e.user_properties);return Fe(Fe(Fe(Fe({library:"experiment-js-client/".concat(tt)},n),r),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}}))}))},e.prototype.sourceVariants=function(){return this.config.source==Xe.LocalStorage?this.variants.getAll():this.config.source==Xe.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==Xe.LocalStorage?this.config.initialVariants:this.config.source==Xe.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var n,r,i,o,a,s,l,u,c;if(null===(i=null===(r=null===(n=t.variant)||void 0===n?void 0:n.metadata)||void 0===r?void 0:r.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var d={flag_key:e},p=Ye(t.source);if(!p||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(d.experiment_key=null===(a=t.variant)||void 0===a?void 0:a.expKey);var f=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(p||(null==f?void 0:f.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(d.variant=t.variant.value)),f&&(d.metadata=f),this.isWebExperiment&&(d.time=Date.now()),this.isWebExperiment){var h=ye();if(null==h?void 0:h.location)try{var v=h.location.href;d.metadata.url=v.split("?")[0]||""}catch(e){}}var g=this.addContext(this.getUser());null===(c=this.userSessionExposureTracker)||void 0===c||c.track(d,g),this.integrationManager.track(d,g)}}},e.prototype.legacyExposureInternal=function(e,t,n){var r,i,o,a,s;if(this.analyticsProvider){var l=function(e,t,n,r){var i,o=null==n?void 0:n.value,a="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:n,userProperty:a,properties:{key:t,variant:o,source:r},userProperties:(i={},i[a]=o,i)}}(this.addContext(this.getUser()),e,t,n);Ye(n)||!(null==t?void 0:t.value)?null===(i=null===(r=this.analyticsProvider)||void 0===r?void 0:r.unsetUserProperty)||void 0===i||i.call(r,l):(null==t?void 0:t.value)&&(null===(a=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===a||a.call(o,l),null===(s=this.analyticsProvider)||void 0===s||s.track(l))}},e.getLogLevel=function(e){var t;return!0===e.debug?He.Debug:null!==(t=e.logLevel)&&void 0!==t?t:He.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof fe)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),St=function(){function e(e,t){var n,r,i;this.globalScope=ye(),this.userAgent=void 0!==(null===(n=this.globalScope)||void 0===n?void 0:n.navigator)?null===(r=this.globalScope)||void 0===r?void 0:r.navigator.userAgent:void 0,this.ua=new Ve.UAParser(this.userAgent).getResult(),this.localStorage=new lt,this.sessionStorage=new pt,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,n,r,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return Fe({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(n=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==n?n:"desktop",referring_url:null===(i=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,n;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(n=e.browser)||void 0===n?void 0:n.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,n=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==n?void 0:n.includes("Chrom"))&&(n="Chrome"),(null==n?void 0:n.includes("Firefox"))&&(n="Firefox"),(null==n?void 0:n.includes("Safari"))&&(n="Safari"),(null==n?void 0:n.includes("Edge"))&&(n="Edge"),(null==n?void 0:n.includes("Opera"))&&(n="Opera"),n},e.prototype.getCookie=function(){var e,t,n,r,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(r=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===r?void 0:r.cookie)||void 0===i?void 0:i.split("; ").map((function(e){return e.split("=")})))},e.prototype.getLandingUrl=function(){var e,t;try{var n=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return n.landing_url||(n.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(n))),n.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,n;if(this.globalScope){var r={};try{var i=new URL(this.globalScope.location.href);try{for(var o=Be(i.searchParams),a=o.next();!a.done;a=o.next()){var s=Ke(a.value,2),l=s[0],u=s[1];r[l]=qe(qe([],Ke(null!==(n=r[l])&&void 0!==n?n:[]),!1),Ke(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(r).reduce((function(e,t){var n=Ke(t,2),r=n[0],i=n[1];return e[r]=1==i.length?i[0]:i,e}),{})}},e}();me.experimentInstances={};var kt=me.experimentInstances,Et=function(e,t){return Pt(e,t)},Ct=function(e,t){return Pt(e,t,(function(){return new Je(e,Ie.getInstance(Ot(t)),1e4)}))},Ot=function(e){return(null==e?void 0:e.instanceName)||et.instanceName},Pt=function(e,t,n){var r=function(e,t){var n=Ot(t),r=null==t?void 0:t.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)}(e,t),i=kt[r];return i||(i=function(e,t){return new xt(e,Fe(Fe({},t),{userProvider:new St(null==t?void 0:t.userProvider,e)}))}(e,t),n&&i.addPlugin(n()),kt[r]=i,i)},Mt={initialize:Et,initializeWithAmplitudeAnalytics:Ct},_t=function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(e){return[2]}))}))},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return Re(this,void 0,void 0,(function(){return De(this,(function(e){return[2,this]}))}))},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return et.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}(),It=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:Ue,AmplitudeIntegrationPlugin:Je,AmplitudeUserProvider:Le,ConsoleLogger:st,Experiment:Mt,ExperimentClient:xt,get LogLevel(){return He},get Source(){return Xe},StubExperimentClient:_t,initialize:Et,initializeWithAmplitudeAnalytics:Ct});function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At.apply(null,arguments)}var jt=["selector","action","value","attribute"],Nt=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Tt={revert:function(){}},Vt=new Map,Lt=[];function Ut(e){var t=Vt.get(e);return t||(t={element:e,attributes:{}},Vt.set(e,t)),t}function Ft(e,t){return e.parentNode===t.parentNode&&e.insertBeforeNode===t.insertBeforeNode}function Rt(e,t,n,r,i){var o=n(e),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:e,_positionTimeout:null,rateLimitCount:0,observer:new MutationObserver((function(){if(!(a.rateLimitCount>=10||(a.rateLimitCount++,setTimeout((function(){a.rateLimitCount=a.rateLimitCount-1,a.rateLimitCount<=0&&(a.rateLimitCount=0)}),1e3),"position"===t&&a._positionTimeout))){"position"===t&&(a._positionTimeout=setTimeout((function(){a._positionTimeout=null}),1e3));var r=n(e);"position"===t&&Ft(r,a.virtualValue)||r!==a.virtualValue&&(a.originalValue=r,i(a))}})),mutationRunner:i,setValue:r,getCurrentValue:n};return"position"===t&&e.parentNode?a.observer.observe(e.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(e,function(e){return"html"===e?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}(t)),a}function Dt(e,t){var n=t.getCurrentValue(t.el);t.virtualValue=e,e&&"string"!=typeof e&&"string"!=typeof n?n&&Ft(n,e)||(t.isDirty=!0,sn()):e!==n&&(t.isDirty=!0,sn())}function Bt(e){var t=e.originalValue;e.mutations.forEach((function(e){t=e.mutate(t)})),Dt(function(e){tn||(tn=document.createElement("div"));return tn.innerHTML=e,tn.innerHTML}(t),e)}function Kt(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach((function(e){return e.mutate(t)})),Dt(Array.from(t).filter(Boolean).join(" "),e)}function qt(e){var t=e.originalValue;e.mutations.forEach((function(e){t=e.mutate(t)})),Dt(t,e)}function zt(e){if("insertSelector"in e){var t,n=e.insertSelector,r=e.direction,i=document.querySelector(n);if(!i)return null;switch(r){case"prepend":t={parentNode:i,insertBeforeNode:i.firstChild};break;case"append":t={parentNode:i,insertBeforeNode:null};break;case"before":t={parentNode:i.parentElement,insertBeforeNode:i};break;case"after":t={parentNode:i.parentElement,insertBeforeNode:i.nextSibling}}return At({},t,{insertNode:i,direction:r})}var o=e.parentSelector,a=e.insertBeforeSelector,s=document.querySelector(o);if(!s)return null;var l=a?document.querySelector(a):null;return a&&!l?null:{parentNode:s,insertBeforeNode:l}}function Wt(e){for(var t=e.originalValue,n=e.mutations.length-1;n>=0;n--){var r,i=e.mutations[n];if(!i.newPosition||!i.newPosition.parentNode.isConnected||!1===(null==(r=i.newPosition.insertBeforeNode)?void 0:r.isConnected)){var o=zt(i.mutate());i.newPosition=o}if(i.newPosition){t=i.newPosition;break}}Dt(t,e)}var Jt=function(e){return e.innerHTML},Ht=function(e,t){e.innerHTML=t};function Xt(e){var t=Ut(e);return t.html||(t.html=Rt(e,"html",Jt,Ht,Bt)),t.html}var $t=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextSibling}},Gt=function(e,t){if("insertNode"in t)return t.insertNode[t.direction](e),void(t.insertBeforeNode=e.nextSibling||null);t.insertBeforeNode&&!t.parentNode.contains(t.insertBeforeNode)||t.parentNode.insertBefore(e,t.insertBeforeNode)};function Qt(e){var t=Ut(e);return t.position||(t.position=Rt(e,"position",$t,Gt,Wt)),t.position}var Zt=function(e,t){t?e.className=t:e.removeAttribute("class")},Yt=function(e){return e.className};function en(e){var t=Ut(e);return t.classes||(t.classes=Rt(e,"class",Yt,Zt,Kt)),t.classes}var tn,nn;function rn(e,t){var n,r=Ut(e);return r.attributes[t]||(r.attributes[t]=Rt(e,t,(n=t,function(e){var t;return null!=(t=e.getAttribute(n))?t:null}),function(e){return function(t,n){return null!==n?t.setAttribute(e,n):t.removeAttribute(e)}}(t),qt)),r.attributes[t]}function on(e,t,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||function(e,t){var n,r=Vt.get(e);if(r)if("html"===t)null==(n=r.html)||null==(n=n.observer)||n.disconnect(),delete r.html;else if("class"===t){var i;null==(i=r.classes)||null==(i=i.observer)||i.disconnect(),delete r.classes}else if("position"===t){var o;null==(o=r.position)||null==(o=o.observer)||o.disconnect(),delete r.position}else{var a;null==(a=r.attributes)||null==(a=a[t])||null==(a=a.observer)||a.disconnect(),delete r.attributes[t]}}(e,t),n.setValue(e,r)}}function an(e,t){e.html&&on(t,"html",e.html),e.classes&&on(t,"class",e.classes),e.position&&on(t,"position",e.position),Object.keys(e.attributes).forEach((function(n){on(t,n,e.attributes[n])}))}function sn(){Vt.forEach(an)}function ln(e,t){var n=null;"html"===e.kind?n=Xt(t):"class"===e.kind?n=en(t):"attribute"===e.kind?n=rn(t,e.attribute):"position"===e.kind&&(n=Qt(t)),n&&(n.mutations.push(e),n.mutationRunner(n))}function un(e){if(!("position"===e.kind&&e.elements.size>0)){var t=new Set(e.elements);document.querySelectorAll(e.selector).forEach((function(n){t.has(n)||(e.elements.add(n),ln(e,n))}))}}function cn(e){var t=Lt.indexOf(e),n=[];if("position"===e.kind)for(var r=Lt.length-1;r>t;r--){var i=Lt[r];if("position"===i.kind){var o=i.newPosition;if(o){var a=!("direction"in o)||"before"===o.direction,s=dn(o.insertBeforeNode,e.elements,a);if(o.insertBeforeNode=s,"insertNode"in o)if("before"===o.direction)null===s?(o.insertNode=o.parentNode,o.direction="append"):o.insertNode=s;else if("after"===o.direction){var l=new Set(Array.from(e.elements).concat(Array.from(i.elements))),u=pn(o.insertBeforeNode,l);null===u?(o.direction="prepend",o.insertNode=o.parentNode):o.insertNode=u}}}n.push(i),cn(i)}e.elements.forEach((function(t){return function(e,t){var n=null;if("html"===e.kind?n=Xt(t):"class"===e.kind?n=en(t):"attribute"===e.kind?n=rn(t,e.attribute):"position"===e.kind&&(n=Qt(t)),n){var r=n.mutations.indexOf(e);-1!==r&&n.mutations.splice(r,1),n.mutationRunner(n)}}(e,t)})),Lt.splice(t,1);for(var c=function(){var e=n.pop();if(!e)return 1;hn(e),e.elements.forEach((function(t){return ln(e,t)}))};n.length>0;)c()}function dn(e,t,n){for(var r=e;r instanceof Element&&t.has(r);)r=n?r.nextElementSibling:r.nextSibling;return r}function pn(e,t){for(var n=(null==e?void 0:e.previousElementSibling)||null;n instanceof Element&&t.has(n);)n=n.previousElementSibling;return n}function fn(){Lt.forEach(un)}function hn(e){return"undefined"==typeof document?Tt:(Lt.push(e),un(e),{__mutation:e,revert:function(){cn(e)}})}function vn(e,t){return hn({kind:"html",elements:new Set,mutate:t,selector:e})}function gn(e,t){return hn({kind:"position",elements:new Set,mutate:t,selector:e})}function mn(e,t){return hn({kind:"class",elements:new Set,mutate:t,selector:e})}function yn(e,t,n){return Nt.test(t)?"class"===t||"className"===t?mn(e,(function(e){var t=n(Array.from(e).join(" "));e.clear(),t&&t.split(/\s+/g).filter(Boolean).forEach((function(t){return e.add(t)}))})):hn({kind:"attribute",attribute:t,elements:new Set,mutate:n,selector:e}):Tt}"undefined"!=typeof document&&(nn||(nn=new MutationObserver((function(){fn()}))),fn(),nn.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}));var bn={html:vn,classes:mn,attribute:yn,position:gn,declarative:function(e){var t=e.selector,n=e.action,r=e.value,i=e.attribute,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,jt);if("html"===i){if("append"===n)return vn(t,(function(e){return e+(null!=r?r:"")}));if("set"===n)return vn(t,(function(){return null!=r?r:""}))}else if("class"===i){if("append"===n)return mn(t,(function(e){r&&e.add(r)}));if("remove"===n)return mn(t,(function(e){r&&e.delete(r)}));if("set"===n)return mn(t,(function(e){e.clear(),r&&e.add(r)}))}else if("position"===i){if("set"===n){if("insertSelector"in o)return gn(t,(function(){return{insertSelector:o.insertSelector,direction:o.direction}}));if("parentSelector"in o)return gn(t,(function(){return{insertBeforeSelector:o.insertBeforeSelector,parentSelector:o.parentSelector}}))}}else{if("append"===n)return yn(t,i,(function(e){return null!==e?e+(null!=r?r:""):null!=r?r:""}));if("set"===n)return yn(t,i,(function(){return null!=r?r:""}));if("remove"===n)return yn(t,i,(function(){return null}))}return Tt}},wn=function(){function e(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map}return e.prototype.subscribe=function(e,t,n,r){void 0===n&&(n=void 0);var i=this.messageToSubscriberGroup.get(e);i||(i={subscribers:[]},this.messageToSubscriberGroup.set(e,i),r&&this.subscriberGroupCallback.set(e,r));var o={identifier:n,callback:t};i.subscribers.push(o)},e.prototype.publish=function(e,t){var n,r=this.messageToSubscriberGroup.get(e);r&&(r.subscribers.forEach((function(e){t=t||{},e.callback(t)})),null===(n=this.subscriberGroupCallback.get(e))||void 0===n||n(t))},e.prototype.unsubscribeAll=function(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map},e}(),xn=function(){function e(e){this.modal=null,this.options=e}return e.prototype.show=function(){document.getElementById("amp-preview-modal")||(this.createModal(),this.attachEventListeners())},e.prototype.hide=function(){var e,t;this.modal&&(this.modal.remove(),this.modal=null),null===(t=(e=this.options).onDismiss)||void 0===t||t.call(e)},e.prototype.createModal=function(){var e=this;if(document.body){this.modal=document.createElement("div"),this.modal.id="amp-preview-modal",this.modal.className="amp-preview-modal";var t=document.createElement("div");t.className="amp-preview-modal-container",Object.entries(this.options.flags).forEach((function(e){var n=o(e,2),r=n[0],i=n[1],a=document.createElement("div");a.className="amp-preview-modal-row";var s=document.createElement("div");s.className="amp-preview-modal-icon",s.innerHTML='\n <svg class="amp-preview-modal-icon-img" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.1389 11.4324L18.2087 18.1956H6.04109L11.1109 11.4324V6.02794H13.1389V11.4324ZM16.1402 4H8.10959C7.68372 4 7.45051 4.4867 7.71414 4.82131L9.083 6.53492V10.7632L3.20198 18.6011C2.70514 19.2704 3.1817 20.2235 4.01316 20.2235H20.2366C21.0681 20.2235 21.5447 19.2704 21.0478 18.6011L15.1668 10.7632V6.53492L16.5357 4.82131C16.7993 4.4867 16.5661 4 16.1402 4Z" fill="currentColor"/>\n </svg>\n ';var l=document.createElement("span");l.className="amp-preview-modal-title",l.textContent=r;var u=document.createElement("div");u.className="amp-preview-modal-badge amp-preview-modal-preview-badge",u.innerHTML='\n <svg class="amp-preview-modal-preview-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 6C15.79 6 19.17 8.13 20.82 11.5C19.17 14.87 15.79 17 12 17C8.21 17 4.83 14.87 3.18 11.5C4.83 8.13 8.21 6 12 6ZM12 4C7 4 2.73 7.11 1 11.5C2.73 15.89 7 19 12 19C17 19 21.27 15.89 23 11.5C21.27 7.11 17 4 12 4ZM12 9C13.38 9 14.5 10.12 14.5 11.5C14.5 12.88 13.38 14 12 14C10.62 14 9.5 12.88 9.5 11.5C9.5 10.12 10.62 9 12 9ZM12 7C9.52 7 7.5 9.02 7.5 11.5C7.5 13.98 9.52 16 12 16C14.48 16 16.5 13.98 16.5 11.5C16.5 9.02 14.48 7 12 7Z" fill="currentColor"/>\n </svg>\n Preview Mode\n ';var c=document.createElement("span");c.className="amp-preview-modal-badge amp-preview-modal-variant-badge amp-preview-modal-variant-".concat(i.toLowerCase());var d=document.createElement("span");d.className="amp-preview-modal-variant-dot",c.appendChild(d),c.appendChild(document.createTextNode(i)),a.appendChild(s),a.appendChild(l),a.appendChild(u),a.appendChild(c),t.appendChild(a)}));var n=document.createElement("button");n.className="amp-preview-modal-close",n.setAttribute("aria-label","Dismiss preview mode notification"),n.innerHTML="×",this.modal.appendChild(t),this.modal.appendChild(n),this.injectStyles(),requestAnimationFrame((function(){e.modal&&document.body&&document.body.appendChild(e.modal)}))}},e.prototype.attachEventListeners=function(){var e=this;if(this.modal){var t=this.modal.querySelector(".amp-preview-modal-close");t&&t.addEventListener("click",(function(){return e.hide()}))}},e.prototype.injectStyles=function(){if(!document.getElementById("amp-preview-modal-styles")){var e=document.createElement("style");e.id="amp-preview-modal-styles",e.textContent="\n .amp-preview-modal {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 10000;\n background-color: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.4;\n color: #2d3748;\n animation: amp-preview-modal-slide-in 0.3s ease-out;\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 12px 16px;\n max-width: 600px;\n }\n\n @keyframes amp-preview-modal-slide-in {\n from {\n transform: translateX(100%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n\n .amp-preview-modal-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .amp-preview-modal-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .amp-preview-modal-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .amp-preview-modal-icon-img {\n width: 16px;\n height: 16px;\n color: #718096;\n }\n\n .amp-preview-modal-title {\n font-weight: 600;\n color: #1a202c;\n font-size: 14px;\n white-space: nowrap;\n max-width: 300px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* Base badge styles */\n .amp-preview-modal-badge {\n background-color: #ffffff;\n color: #4a5568;\n padding: 4px 8px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n display: flex;\n align-items: center;\n gap: 6px;\n border: 1px solid #e2e8f0;\n }\n\n .amp-preview-modal-preview-badge {\n color: #718096;\n }\n\n .amp-preview-modal-preview-icon {\n width: 14px;\n height: 14px;\n color: currentColor;\n }\n\n .amp-preview-modal-variant-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #68d391;\n flex-shrink: 0;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n border-radius: 6px;\n color: #a0aec0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 18px;\n line-height: 1;\n width: 24px;\n height: 24px;\n transition: all 0.2s ease;\n align-self: flex-start;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #f7fafc;\n color: #718096;\n }\n\n .amp-preview-modal-close:focus {\n outline: 2px solid #3182ce;\n outline-offset: 1px;\n }\n\n /* Dark mode support */\n @media (prefers-color-scheme: dark) {\n .amp-preview-modal {\n background-color: #2d3748;\n border-color: #4a5568;\n color: #e2e8f0;\n }\n\n .amp-preview-modal-title {\n color: #f7fafc;\n }\n\n .amp-preview-modal-badge {\n background-color: #2d3748;\n color: #e2e8f0;\n border-color: #4a5568;\n }\n\n .amp-preview-modal-preview-badge {\n color: #a0aec0;\n }\n\n .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n color: #718096;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #4a5568;\n color: #e2e8f0;\n }\n }\n ",document.head.appendChild(e)}},e}();function Sn(e){var t=new xn(e),n=!1,r=!1,i=function(){n&&r&&t.show()};return"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(){n=!0,i()})):n=!0,setTimeout((function(){r=!0,i()}),500),t}var kn={observerOptions:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]},debounceMs:150},En=function(){function e(n,r,i,s){void 0===i&&(i=[]),void 0===s&&(s={});var l=this;this.mutationObserver=null,this.pendingMutations=[],this.processMutationsImmediately=function(){if(l.mutationObserver)try{l.pendingMutations.length>0&&l.onMutations(l.pendingMutations)}catch(e){}finally{l.pendingMutations=[]}},this.handleMutations=function(t){var n,r;try{var i=t.filter((function(e){return l.shouldProcessMutation(e)}));if(0===i.length)return;if(l.pendingMutations.length+i.length>e.MAX_PENDING_MUTATIONS)return(n=l.pendingMutations).push.apply(n,a([],o(i),!1)),l.processMutationsDebounced.cancel(),void l.processMutationsImmediately();(r=l.pendingMutations).push.apply(r,a([],o(i),!1)),l.processMutationsDebounced()}catch(e){}},this.target=n,this.onMutations=r,this.filters=i,this.options=t(t({},kn),s),this.processMutationsDebounced=function(e,t,n){void 0===n&&(n={});var r=null,i=null,s=function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];n.maxWait&&!i&&(i=setTimeout((function(){r&&(clearTimeout(r),r=null),i=null,e.apply(void 0,a([],o(s),!1))}),n.maxWait)),r&&clearTimeout(r),r=setTimeout((function(){i&&(clearTimeout(i),i=null),e.apply(void 0,a([],o(s),!1))}),t)};return s.cancel=function(){r&&clearTimeout(r),i&&clearTimeout(i),r=null,i=null},s}(this.processMutationsImmediately,this.options.debounceMs,{maxWait:2*this.options.debounceMs})}return e.prototype.shouldProcessMutation=function(e){if(0===this.filters.length)return!0;try{return this.filters.every((function(t){return t(e)}))}catch(e){return!1}},e.prototype.cleanup=function(){var e;this.processMutationsDebounced.cancel(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.pendingMutations=[],this.mutationObserver=null},e.prototype.observe=function(){var e=this;return this.mutationObserver&&this.cleanup(),this.mutationObserver=new MutationObserver(this.handleMutations),this.mutationObserver.observe(this.target,this.options.observerOptions),function(){e.cleanup()}},e.MAX_PENDING_MUTATIONS=1e3,e}(),Cn=new J,On=function(e,n,r,a,s){var l=this;this.pageChangeSubscribers=new Set,this.lastNotifiedActivePages={},this.setPageObjects=function(e){l.pageObjects=e},this.initSubscriptions=function(){l.options.useDefaultNavigationHandler&&l.setupLocationChangePublisher(),l.setupPageObjectSubscriptions()},this.addPageChangeSubscriber=function(e){return l.pageChangeSubscribers.add(e),function(){l.pageChangeSubscribers.delete(e)}},this.setupPageObjectSubscriptions=function(){var e,t,n=function(e,t){var n,r,o=function(t){l.messageBus.subscribe(t.trigger_type,(function(n){l.isPageObjectActive(t,n)?l.webExperimentClient.updateActivePages(e,t,!0):l.webExperimentClient.updateActivePages(e,t,!1)}),void 0,(function(e){var n,r;if(!("updateActivePages"in e&&e.updateActivePages||l.options.isVisualEditorMode)){if("url_change"===t.trigger_type){Object.values(l.webExperimentClient.appliedMutations).forEach((function(e){Object.values(e).forEach((function(e){e[vr]&&Object.values(e[vr]).forEach((function(e){var t;null===(t=e.revert)||void 0===t||t.call(e)}))}))}));var o=l.webExperimentClient.appliedMutations;Object.keys(o).forEach((function(e){var t=o[e];Object.keys(t).forEach((function(e){t[e][vr]&&(delete t[e][vr],0===Object.keys(t[e]).length&&delete t[e])})),0===Object.keys(t).length&&delete o[e]}))}l.webExperimentClient.applyVariants(),l.webExperimentClient.isPreviewMode&&l.webExperimentClient.previewVariants({keyToVariant:l.webExperimentClient.previewFlags})}var a=l.webExperimentClient.getActivePages();if(!l.areActivePagesEqual(a,l.lastNotifiedActivePages)){l.lastNotifiedActivePages=l.cloneActivePagesMap(a);try{for(var s=(n=void 0,i(l.pageChangeSubscribers)),u=s.next();!u.done;u=s.next())(0,u.value)({activePages:a})}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}}))};try{for(var a=(n=void 0,i(Object.values(t))),s=a.next();!s.done;s=a.next())o(s.value)}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}};try{for(var r=i(Object.entries(l.pageObjects)),a=r.next();!a.done;a=r.next()){var s=o(a.value,2);n(s[0],s[1])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},this.setupMutationObserverPublisher=function(){return new En(l.globalScope.document.documentElement,(function(e){l.messageBus.publish("element_appeared",{mutationList:e})}),[]).observe()},this.setupLocationChangePublisher=function(){l.globalScope.addEventListener("popstate",(function(){l.messageBus.publish("url_change")}));var e,t,n=function(){l.messageBus.publish("url_change"),l.globalScope.webExperiment.previousUrl=l.globalScope.location.href};e=history.pushState,t=history.replaceState,history.pushState=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=e.apply(this,t);return n(),i},history.replaceState=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=t.apply(this,e);return n(),i}},this.isPageObjectActive=function(e,t){if(e.conditions&&e.conditions.length>0&&!Cn.evaluateConditions({context:{page:{url:l.globalScope.location.href}},result:{}},e.conditions))return!1;switch(e.trigger_type){case"url_change":return!0;case"manual":return t.name===e.trigger_value.name;case"analytics_event":var n=t;return n.event_type===e.trigger_value.event_type&&Object.entries(e.trigger_value.event_properties||{}).every((function(e){var t=o(e,2),r=t[0],i=t[1];return n.event_properties[r]===i}));case"element_appeared":var r=l.globalScope.document.querySelector(e.trigger_value.selector);if(r){var i=window.getComputedStyle(r);return"none"!==i.display&&"hidden"!==i.visibility}return!1;default:return!1}},this.cloneActivePagesMap=function(e){var n={};for(var r in e)for(var i in n[r]={},e[r])n[r][i]=t({},e[r][i]);return n},this.areActivePagesEqual=function(e,t){var n,r,o,a,s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;try{for(var u=i(s),c=u.next();!c.done;c=u.next()){var d=c.value,p=e[d],f=t[d];if(!f)return!1;var h=Object.keys(p),v=Object.keys(f);if(h.length!==v.length)return!1;try{for(var g=(o=void 0,i(h)),m=g.next();!m.done;m=g.next()){var y=m.value,b=p[y],w=f[y];if(!w||b.id!==w.id)return!1}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return!0},this.webExperimentClient=e,this.messageBus=n,this.pageObjects=r,this.options=a,this.globalScope=s},Pn={useDefaultNavigationHandler:!0},Mn=function(){var e=ye();if(!(null==e?void 0:e.document.getElementById("amp-exp-css"))){var t=document.createElement("style");t.id="amp-exp-css",t.innerText="* { visibility: hidden !important; background-image: none !important; }",document.head.appendChild(t),null==e||e.window.setTimeout((function(){t.remove()}),1e3)}},_n="AMP",In="dclid",An="fbclid",jn="gbraid",Nn="gclid",Tn="ko_click_id",Vn="li_fat_id",Ln="msclkid",Un="rtd_cid",Fn="ttclid",Rn="twclid",Dn="wbraid",Bn={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Kn="MKTG",qn=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},zn=function(){var e,t=qn();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=Wn(n[0]),i=Wn(n[1]);return i?(e[r]=i,e):e}),{}):{}},Wn=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Jn=function(){function e(e){this.options=t({},e)}return e.prototype.isEnabled=function(){return n(this,void 0,void 0,(function(){var t,n;return r(this,(function(r){switch(r.label){case 0:if(!qn())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return r.sent(),[4,t.get(n)];case 3:return[2,r.sent()===e.testValue];case 4:return r.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){var t;return n(this,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:if(!(n=r.sent()))return[2,void 0];try{return void 0===(i=null!==(t=Hn(n))&&void 0!==t?t:Xn(n))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]):[2,JSON.parse(i)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,i;return n(this,void 0,void 0,(function(){var n,o,a;return r(this,(function(r){return n=qn(),o=null!==(i=null===(t=null==n?void 0:n.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==i?i:[],(a=o.find((function(t){return 0===t.indexOf(e+"=")})))?[2,a.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return n(this,void 0,void 0,(function(){var n,o,a,s,l,u,c;return r(this,(function(r){try{n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,a=void 0,(o=null!==t?n:-1)&&((s=new Date).setTime(s.getTime()+24*o*60*60*1e3),a=s),l="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),a&&(l+="; expires=".concat(a.toUTCString())),l+="; path=/",this.options.domain&&(l+="; domain=".concat(this.options.domain)),this.options.secure&&(l+="; Secure"),this.options.sameSite&&(l+="; SameSite=".concat(this.options.sameSite)),(u=qn())&&(u.document.cookie=l)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]}))}))},e.prototype.remove=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))},e}(),Hn=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},Xn=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},$n=function(){function e(){}return e.prototype.parse=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){return[2,t(t(t(t({},Bn),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=zn();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=zn();return(e={})[In]=t[In],e[An]=t[An],e[jn]=t[jn],e[Nn]=t[Nn],e[Tn]=t[Tn],e[Vn]=t[Vn],e[Ln]=t[Ln],e[Un]=t[Un],e[Fn]=t[Fn],e[Rn]=t[Rn],e[Dn]=t[Dn],e},e}(),Gn=function(e,t){var n;try{var r=null===(n=Yn(e))||void 0===n?void 0:n.getItem(t);return r?JSON.parse(r):null}catch(t){return console.warn("Failed to get and parse JSON from ".concat(e,":"),t),null}},Qn=function(e,t,n){var r;try{var i=JSON.stringify(n);null===(r=Yn(e))||void 0===r||r.setItem(t,i)}catch(t){console.warn("Failed to stringify and set JSON in ".concat(e,":"),t)}},Zn=function(e,t){var n;try{null===(n=Yn(e))||void 0===n||n.removeItem(t)}catch(t){console.warn("Failed to remove item from ".concat(e,":"),t)}},Yn=function(e){var t=ye();return t?t[e]:null};function er(e,a){return n(this,void 0,void 0,(function(){var n,s,l,u,c,d,p,f,h,v,g,m,y,b,w,x,S,k,E;return r(this,(function(r){switch(r.label){case 0:return n="EXP_".concat(Kn,"_").concat(e.substring(0,10)),[4,tr(e)];case 1:s=o.apply(void 0,[r.sent(),2]),l=s[0],u=s[1],c=Gn("localStorage",n),d={},p=[u,c,l];try{for(f=i(p),h=f.next();!h.done;h=f.next())if(v=h.value)try{for(k=void 0,g=i(Object.entries(v)),m=g.next();!m.done;m=g.next())y=o(m.value,2),b=y[0],w=y[1],b.startsWith("utm_")&&void 0!==w&&(d[b]=w)}catch(e){k={error:e}}finally{try{m&&!m.done&&(E=g.return)&&E.call(g)}finally{if(k)throw k.error}}}catch(e){x={error:e}}finally{try{h&&!h.done&&(S=f.return)&&S.call(f)}finally{if(x)throw x.error}}return Object.keys(d).length>0?(function(e,t){var n="EXP_".concat(Kn,"_").concat(e.substring(0,10));Qn("localStorage",n,t)}(e,d),[2,t(t({},a),{persisted_url_param:d})]):[2,a]}}))}))}function tr(e){return n(this,void 0,void 0,(function(){var t,n,i,o;return r(this,(function(r){switch(r.label){case 0:return t=new Jn,n=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[_n,t,e.substring(0,n)].filter(Boolean).join("_")}(e,Kn),[4,(new $n).parse()];case 1:return i=r.sent(),[4,t.get(n)];case 2:return o=r.sent(),[2,[i,o]]}}))}))}var nr,rr="amp-exp-loading",ir=function(){if(!document.getElementById(rr)){var e=document.createElement("div");e.id=rr,nr=setTimeout((function(){or()}),1e4),e.innerHTML="\n <style>\n #".concat(rr," {\n position: fixed;\n inset: 0;\n background: rgba(33, 33, 36, 0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 2147483647;\n }\n\n #").concat(rr," .modal {\n background: white;\n border-radius: 8px;\n padding: 32px 48px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n }\n\n #").concat(rr," .spinner {\n width: 32px;\n height: 32px;\n border: 3px solid #e5e7eb;\n border-top-color: ").concat("#1e61f0",";\n border-radius: 50%;\n animation: amp-spin 1s linear infinite;\n }\n\n @keyframes amp-spin {\n to { transform: rotate(360deg); }\n }\n\n #").concat(rr,' .text {\n color: #212124;\n font-size: 16px;\n font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n }\n </style>\n\n <div class="modal">\n <div class="spinner"></div>\n <div class="text">Loading Visual Editor</div>\n </div>\n ');var t=function(){document.getElementById(rr)||void 0===nr||document.body.appendChild(e)};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}},or=function(){var e;nr&&(clearTimeout(nr),nr=void 0),null===(e=document.getElementById(rr))||void 0===e||e.remove()},ar="visual-editor-state",sr=function(){function e(){}return e.setup=function(){var t,n="closed",r=e.getStoredSession();if(r)return n="opening",ir(),void lr(r.injectSrc).then((function(){n="open"})).catch((function(e){console.warn("Failed to load overlay from stored session:",e),n="closed",or()}));null===(t=ye())||void 0===t||t.addEventListener("message",(function(e){var t=/^.*\.amplitude\.com$/;try{if(!e.origin||!t.test(new URL(e.origin).hostname))return}catch(e){return}if("OpenOverlay"===e.data.type){var r=new URL(e.data.context.injectSrc);if("closed"!==n||"https:"!==r.protocol||!t.test(r.hostname))return;n="opening",ir(),lr(e.data.context.injectSrc).then((function(){n="open"})).catch((function(){n="closed",or()}))}}))},e.getStoredSession=function(){var e=Gn("sessionStorage",ar);if(!e)return null;try{var t=new URL(e.injectSrc);if("https:"!==t.protocol||!/^.*\.amplitude\.com$/.test(t.hostname))return null}catch(e){return null}return e},e}(),lr=function(e){return new Promise((function(t,n){var r=function(){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e;var o=document.querySelector("[nonce]");o&&i.setAttribute("nonce",o.nonce||o.nonce||o.getAttribute("nonce")),i.addEventListener("load",(function(){t({status:!0})}),{once:!0}),i.addEventListener("error",(function(){n({status:!1,message:"Failed to load the script ".concat(e)})})),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(e){n(e)}};"complete"===document.readyState?r():window.addEventListener("load",r,{once:!0})}))},ur=function(){var e,t,n=ye(),r=new URLSearchParams(null==n?void 0:n.location.search),a={};try{for(var s=i(r),l=s.next();!l.done;l=s.next()){var u=o(l.value,2),c=u[0],d=u[1];a[c]=d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return a},cr=function(e){if(!e)return"";var t=new URL(e);return t.search="",t.hash="",t.toString()},dr=function(e,t){var n,r,o=new URL(e);try{for(var a=i(t),s=a.next();!s.done;s=a.next()){var l=s.value;o.searchParams.delete(l)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o.toString()},pr=function(e,t){return t=t.replace(/\/$/,""),e.some((function(e){e=(e=(e=e.replace(/\/$/,"")).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).replace(/\\\*/,".*");var n=new RegExp("^".concat(e,"$"));return n.test(t)||n.test(t+"/")}))},fr=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,fr)},hr="mutate",vr="inject",gr="PREVIEW",mr="amp-preview-mode",yr="VISUAL_EDITOR";me.Experiment=It;var br=function(){function e(e,n,r,i){void 0===i&&(i={});var o,a=this;this.appliedInjections=new Set,this.appliedMutations={},this.previousUrl=void 0,this.urlExposureCache={},this.flagVariantMap={},this.localFlagKeys=[],this.remoteFlagKeys=[],this.isRemoteBlocking=!1,this.isRunning=!1,this.activePages={},this.isVisualEditorMode=!1,this.isPreviewMode=!1,this.previewFlags={};var s=ye();if(!s||!be())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=s,this.apiKey=e,this.initialFlags=JSON.parse(n),this.pageObjects=JSON.parse(r),this.config=t(t(t({},Pn),i),null!==(o=this.globalScope.experimentConfig)&&void 0!==o?o:{}),this.initialFlags.forEach((function(e){var t=e.key,n=e.variants,r=e.metadata,i=void 0===r?{}:r;a.flagVariantMap[t]={},Object.keys(n).forEach((function(e){a.flagVariantMap[t][e]=function(e){if(!e)return{};var t=void 0;e.metadata&&(t="string"==typeof e.metadata.experimentKey?e.metadata.experimentKey:void 0);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n}(n[e]),a.flagVariantMap[t][e].metadata={deliveryMethod:"web"}})),"local"!==i.evaluationMode&&a.remoteFlagKeys.push(t)}));var l=JSON.stringify(this.initialFlags);this.experimentClient=Mt.initialize(this.apiKey,t({internalInstanceNameSuffix:"web",initialFlags:l,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var u=this.experimentClient.all();this.localFlagKeys=Object.keys(u).filter((function(e){var t,n;return"local"===(null===(n=null===(t=u[e])||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.evaluationMode)})),this.messageBus=new wn}return e.prototype.start=function(){return n(this,void 0,void 0,(function(){var e,n,a,s,l,u,c,d,p,f,h,v,g,m,y,b,w,x=this;return r(this,(function(r){switch(r.label){case 0:if(this.isRunning)return[2];if(HTMLElement.prototype.removeChild=function(e){return e&&e.parentNode!==this?e:Node.prototype.removeChild.call(this,e)},e=ur(),this.isVisualEditorMode="true"===e[yr]||null!==Gn("sessionStorage",ar),this.subscriptionManager=new On(this,this.messageBus,this.pageObjects,t(t({},this.config),{isVisualEditorMode:this.isVisualEditorMode}),this.globalScope),this.setupPreviewMode(e),this.subscriptionManager.initSubscriptions(),this.isVisualEditorMode)return sr.setup(),this.globalScope.history.replaceState({},"",dr(this.globalScope.location.href,[yr])),this.messageBus.publish("url_change",{updateActivePages:!0}),this.isRunning=!0,[2];this.messageBus.publish("url_change",{updateActivePages:!0}),n="EXP_".concat(this.apiKey.slice(0,10)),(a=Gn("localStorage",n)||{}).web_exp_id?a.web_exp_id&&a.device_id&&(delete a.device_id,Qn("localStorage",n,a)):(a.web_exp_id=a.device_id||fr(),delete a.device_id,Qn("localStorage",n,a)),s=this.getVariants();try{for(l=i(Object.entries(s)),u=l.next();!u.done;u=l.next())c=o(u.value,2),d=c[0],p=c[1],this.remoteFlagKeys.includes(d)&&(null===(m=p.metadata)||void 0===m?void 0:m.blockingEvaluation)&&Object.keys(this.activePages).includes(d)&&!this.remoteFlagKeys.every((function(e){return Object.keys(x.previewFlags).includes(e)}))&&(this.isRemoteBlocking=!0,Mn())}catch(e){v={error:e}}finally{try{u&&!u.done&&(g=l.return)&&g.call(l)}finally{if(v)throw v.error}}return[4,er(this.apiKey,a)];case 1:return f=r.sent(),this.globalScope.experimentIntegration||(h=Ie.getInstance("$default_instance"),this.globalScope.experimentIntegration=new Je(this.apiKey,h,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(f),this.isRemoteBlocking||null===(w=null===(b=(y=this.globalScope.document).getElementById)||void 0===b?void 0:b.call(y,"amp-exp-css"))||void 0===w||w.remove(),this.applyVariants({flagKeys:this.localFlagKeys}),this.previewVariants({keyToVariant:this.previewFlags}),this.remoteFlagKeys.every((function(e){return Object.keys(x.previewFlags).includes(e)}))?(this.isRunning=!0,[2]):[4,this.fetchRemoteFlags()];case 2:return r.sent(),this.applyVariants({flagKeys:this.remoteFlagKeys}),this.isRunning=!0,[2]}}))}))},e.getInstance=function(t,n,r,i){void 0===i&&(i={});var o=ye();if(!o)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(null==o?void 0:o.webExperiment)return o.webExperiment;var a=new e(t,n,r,i);return o.webExperiment=a,a},e.prototype.getExperimentClient=function(){return this.experimentClient},e.prototype.hideLoadingIndicator=function(){or()},e.prototype.applyVariants=function(e){var t,n,r=(e||{}).flagKeys,i=this.getVariants();if(0!==Object.keys(i).length){var o=cr(this.globalScope.location.href);for(var a in(null===(t=this.urlExposureCache)||void 0===t?void 0:t[o])||(this.urlExposureCache={},this.urlExposureCache[o]={}),this.fireStoredRedirectImpressions(),i)if(!(r&&!r.includes(a)||this.previewFlags[a])){var s=i[a],l=s.key||"";if(this.appliedMutations[a]){var u=Object.keys(this.appliedMutations[a]);u.length>0&&!u.includes(l)&&(this.revertVariants({flagKeys:[a]}),delete this.appliedMutations[a])}if("web"===(null===(n=s.metadata)||void 0===n?void 0:n.deliveryMethod)){var c=Array.isArray(s.payload);if(("off"===s.key||"control"===s.key)&&(this.isActionActiveOnPage(a,void 0)&&this.exposureWithDedupe(a,s),"off"===s.key)){this.revertVariants({flagKeys:[a]});continue}c&&this.handleVariantAction(a,s)}}}},e.prototype.revertVariants=function(e){var t,n,r,o;if(this.appliedMutations){var a=(e||{}).flagKeys;a||(a=Object.keys(this.appliedMutations));try{for(var s=i(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=this.appliedMutations[u];if(c){for(var d in c){var p=c[d];if(p)for(var f in p)for(var h in p[f])null===(o=null===(r=p[f][h])||void 0===r?void 0:r.revert)||void 0===o||o.call(r)}delete this.appliedMutations[u]}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},e.prototype.previewVariants=function(e){var t=e.keyToVariant;if(t)for(var n in this.revertVariants({flagKeys:Object.keys(t)}),t){var r=t[n],i=this.flagVariantMap[n];if(!i)return;var o=i[r];if(!o)return;this.isPreviewMode&&(this.exposureWithDedupe(n,o,!0),Sn({flags:this.previewFlags}));var a=o.payload;if(!a||!Array.isArray(a))return;this.handleVariantAction(n,o)}},e.prototype.getVariants=function(){var e,t,n={};try{for(var r=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),s=r.next();!s.done;s=r.next()){var l=s.value;n[l]=this.experimentClient.variant(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},e.prototype.getActiveExperiments=function(){return Object.keys(this.appliedMutations)},e.prototype.getActivePages=function(){return this.activePages},e.prototype.addPageChangeSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addPageChangeSubscriber(e)},e.prototype.setPageObjects=function(e){var t,n;this.isVisualEditorMode&&(this.pageObjects=e,null===(t=this.subscriptionManager)||void 0===t||t.setPageObjects(e),this.activePages={},this.messageBus.unsubscribeAll(),null===(n=this.subscriptionManager)||void 0===n||n.initSubscriptions(),this.messageBus.publish("url_change",{updateActivePages:!0}))},e.prototype.setRedirectHandler=function(e){this.customRedirectHandler=e},e.prototype.fetchRemoteFlags=function(){return n(this,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.experimentClient.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn("Error fetching remote flags:",e),[3,3];case 3:return[2]}}))}))},e.prototype.handleVariantAction=function(e,t){var n,r;try{for(var o=i(t.payload),a=o.next();!a.done;a=o.next()){var s=a.value;"redirect"===s.action?this.handleRedirect(s,e,t):s.action===hr?this.handleMutate(s,e,t):s.action===vr&&this.handleInject(s,e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.handleRedirect=function(e,t,i){var o,a,s;if(this.isActionActiveOnPage(t,null===(a=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.scope)){var l=cr(this.previousUrl||this.globalScope.document.referrer),u=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.url;if(cr(this.globalScope.location.href)!==l){var c=function(e,t){var n=new URL(e),r=new URL(t),i=new URL(t);return n.searchParams.forEach((function(e,t){r.searchParams.has(t)||i.searchParams.append(t,e)})),i.toString()}(this.globalScope.location.href,u);this.globalScope.location.href!==c&&(this.storeRedirectImpressions(t,i,u),this.previousUrl=this.globalScope.location.href,function(e){return n(this,void 0,void 0,(function(){var t,n,i,o;return r(this,(function(r){switch(r.label){case 0:return t=new Jn({sameSite:"Lax"}),n=new $n,i="AMP_".concat(Kn,"_ORIGINAL_").concat(e.substring(0,10)),[4,n.parse()];case 1:return o=r.sent(),[4,t.set(i,o)];case 2:return r.sent(),[2]}}))}))}(this.apiKey).then(),this.customRedirectHandler?this.customRedirectHandler(c):this.globalScope.location.replace(c))}}},e.prototype.handleMutate=function(e,n,r){var i,o,a,s,l,u=this,c=(null===(i=e.data)||void 0===i?void 0:i.mutations)||[],d=r.key||"";if(0!==c.length){var p={};c.forEach((function(e,t){var i,o,a,s,l,c,f,h,v,g,m;u.isActionActiveOnPage(n,null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.scope)?(u.exposureWithDedupe(n,r),(null===(m=null===(g=null===(v=u.appliedMutations[n])||void 0===v?void 0:v[d])||void 0===g?void 0:g[hr])||void 0===m?void 0:m[t])||(p[t]=bn.declarative(e))):(null===(s=null===(a=null===(o=u.appliedMutations[n])||void 0===o?void 0:o[d])||void 0===a?void 0:a[hr])||void 0===s?void 0:s[t])&&(null===(h=null===(f=null===(c=null===(l=u.appliedMutations[n])||void 0===l?void 0:l[d])||void 0===c?void 0:c[hr])||void 0===f?void 0:f[t])||void 0===h||h.revert(),delete u.appliedMutations[n][d][hr][t])})),null!==(o=(s=this.appliedMutations)[n])&&void 0!==o||(s[n]={}),null!==(a=(l=this.appliedMutations[n])[d])&&void 0!==a||(l[d]={}),this.appliedMutations[n][d][hr]=t(t({},this.appliedMutations[n][d][hr]),p),0===Object.keys(this.appliedMutations[n][d][hr]||{}).length&&delete this.appliedMutations[n][d][hr],0===Object.keys(this.appliedMutations[n][d]||{}).length&&delete this.appliedMutations[n]}},e.prototype.handleInject=function(e,t,i){var o,a,s,l,u,c,d,p,f,h,v,g,m=this,y=i.key||"";if(this.isActionActiveOnPage(t,null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.scope)){var b=e.data.id;if(b&&"string"==typeof b&&0!==b.length&&(b=b.replace(/-/g,""),!this.appliedInjections.has(b))){var w,x=e.data.js;x&&(w=this.globalScope.document.createElement("script"))&&(w.innerHTML="function ".concat(b,"(html, utils, id){").concat(x,"};"),w.id="js-".concat(b),this.globalScope.document.head.appendChild(w));var S,k=e.data.css;k&&(S=this.globalScope.document.createElement("style"))&&(S.innerHTML=k,S.id="css-".concat(b),this.globalScope.document.head.appendChild(S));var E,C=e.data.html;C&&(E=null!==(c=(new DOMParser).parseFromString(C,"text/html").body.firstElementChild)&&void 0!==c?c:void 0);var O={cancelled:!1},P=function(e){return{waitForElement:function(t){return n(this,void 0,void 0,(function(){var n,i,o;return r(this,(function(r){return n=void 0,(o=(i=function(){if(!e.cancelled)return document.querySelector(t);null==n||n.disconnect()})())?[2,o]:[2,new Promise((function(e){n=new MutationObserver((function(){var t=i();t&&(null==n||n.disconnect(),e(t))})),n.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}))]}))}))},insertElement:function(t,n,r){return new Promise((function(i){var o=0,a=void 0,s=function(){if(e.cancelled)null==a||a.disconnect();else if(!(t.isConnected&&t.ownerDocument===document||o>=10)){o++,setTimeout((function(){return o--}),1e3);var s=document.querySelector(n.parentSelector);if(s){var l=n.insertBeforeSelector?s.querySelector(n.insertBeforeSelector):null;n.insertBeforeSelector&&!l||(s.insertBefore(t,l),null==r||r(),i())}}};s(),(a=new MutationObserver(s)).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}))}}}(O);this.appliedInjections.add(b);try{var M=this.globalScope[b];M&&"function"==typeof M&&M(E,P,b)}catch(e){null==w||w.remove(),console.error("Experiment inject failed for ".concat(t," variant ").concat(i.key,". Reason:"),e)}null!==(d=(h=this.appliedMutations)[t])&&void 0!==d||(h[t]={}),null!==(p=(v=this.appliedMutations[t])[y])&&void 0!==p||(v[y]={}),null!==(f=(g=this.appliedMutations[t][y])[vr])&&void 0!==f||(g[vr]={}),this.appliedMutations[t][y][vr][b]={revert:function(){var e;O.cancelled=!0,null===(e=P.remove)||void 0===e||e.call(P),null==S||S.remove(),null==w||w.remove(),m.appliedInjections.delete(b)}},this.exposureWithDedupe(t,i)}}else null===(u=null===(l=null===(s=null===(a=this.appliedMutations[t])||void 0===a?void 0:a[y])||void 0===s?void 0:s[vr])||void 0===l?void 0:l[0])||void 0===u||u.revert()},e.prototype.exposureWithDedupe=function(e,t,n){var r,i,o,a,s=cr(this.globalScope.location.href);if(!((null===(i=null===(r=this.urlExposureCache)||void 0===r?void 0:r[s])||void 0===i?void 0:i[e])===t.key)){if(n){var l={variant:t,source:"local-evaluation",hasDefaultVariant:!1};this.experimentClient.exposureInternal(e,l)}else this.experimentClient.exposure(e);(null!==(o=(a=this.urlExposureCache)[s])&&void 0!==o?o:a[s]={})[e]=t.key}},e.prototype.updateActivePages=function(e,t,n){this.activePages[e]||(this.activePages[e]={}),n?this.activePages[e][t.id]=t:(delete this.activePages[e][t.id],0===Object.keys(this.activePages[e]).length&&delete this.activePages[e])},e.prototype.isActionActiveOnPage=function(e,t){var n=this.activePages[e];return t?t.some((function(e){var t;return null!==(t=null==n?void 0:n[e])&&void 0!==t&&t})):!!n&&Object.values(n).some(Boolean)},e.prototype.storeRedirectImpressions=function(e,t,n){var r="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),i=Gn("sessionStorage",r)||{};i[e]={redirectUrl:n,variant:t},Qn("sessionStorage",r,i)},e.prototype.fireStoredRedirectImpressions=function(){var e=this,t="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),n=Gn("sessionStorage",t)||{};if(Object.keys(n).length>0)for(var r in n){var i=n[r],o=i.redirectUrl,a=i.variant,s=cr(this.globalScope.location.href),l=cr(o);pr([s],l)&&(this.exposureWithDedupe(r,a,!0),delete n[r])}Object.keys(n).length>0?this.globalScope.setTimeout((function(){var n=Gn("sessionStorage",t)||{};for(var r in n)e.exposureWithDedupe(r,n[r].variant,!0);Zn("sessionStorage",t)}),500):Zn("sessionStorage",t)},e.prototype.setupPreviewMode=function(e){var t=this;if("true"===e[gr]){Object.keys(e).forEach((function(n){n!==gr&&e[n]&&(t.previewFlags[n]=e[n])})),Qn("sessionStorage",mr,{previewFlags:this.previewFlags});var n=a(a([],o(Object.keys(this.previewFlags)),!1),[gr],!1);this.globalScope.history.replaceState({},"",dr(this.globalScope.location.href,n)),sr.setup()}else{var r=Gn("sessionStorage",mr);r&&(this.previewFlags=r.previewFlags)}Object.keys(this.previewFlags).length>0&&(this.isPreviewMode=!0)},e}();var wr=me.fetch||function(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n})),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))},xr={request:function(e,t,i,o,a){return n(void 0,void 0,void 0,(function(){var s;return r(this,(function(l){return s=function(){return n(void 0,void 0,void 0,(function(){var n,a;return r(this,(function(r){switch(r.label){case 0:return[4,wr(e,{method:t,headers:i,body:o})];case 1:return n=r.sent(),a={status:n.status},[4,n.text()];case 2:return[2,(a.body=r.sent(),a)]}}))}))},[2,(u=s(),c=a,!c||c<=0?u:Promise.race([u,new Promise((function(e,t){return setTimeout((function(){return t(new he("Timeout after ".concat(c,"ms")))}),c)}))]))];var u,c}))}))}},Sr=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getPreviewFlagsAndPageViewObjects=function(){return n(this,void 0,void 0,(function(){var e,t,n,i;return r(this,(function(r){switch(r.label){case 0:return(e={Authorization:"Api-Key ".concat(this.deploymentKey)})["X-Amp-Exp-Library"]="experiment-tag/".concat("0.15.1"),[4,this.httpClient.request("".concat(this.serverUrl,"/web/v1/configs"),"GET",e,null,1e4)];case 1:if(200!=(t=r.sent()).status)throw Error("Preview error response: status=".concat(t.status));return n=JSON.parse(t.body).flags,i=JSON.parse(t.body).pageObjects,[2,{flags:n,pageViewObjects:i}]}}))}))},e}(),kr=function(e,t,n,r){br.getInstance(e,t,n,r).start().finally((function(){var e;null===(e=document.getElementById("amp-exp-css"))||void 0===e||e.remove()}))},Er=function(e,t){return n(void 0,void 0,void 0,(function(){return r(this,(function(n){return[2,new Sr(e,"EU"===t?"https://api.lab.eu.amplitude.com":"https://api.lab.amplitude.com",xr).getPreviewFlagsAndPageViewObjects()]}))}))};return e.initialize=function(e,t,n,r){var i;(function(){if("true"===ur()[gr])return!0;var e=Gn("sessionStorage",mr);return!!((null==e?void 0:e.previewFlags)&&Object.keys(e.previewFlags).length>0)})()||(null===(i=ye())||void 0===i?void 0:i.WebExperiment.injectedByExtension)?(Mn(),Er(e,r.serverZone).then((function(t){var n=JSON.stringify(t.flags),i=JSON.stringify(t.pageViewObjects);kr(e,n,i,r)})).catch((function(i){console.warn("Failed to fetch latest configs for preview:",i),kr(e,t,n,r)}))):kr(e,t,n,r)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ /* @amplitude/experiment-tag v0.15.2 - For license info see https://unpkg.com/@amplitude/experiment-tag@0.15.2/files/LICENSE */
2
+ var WebExperiment=function(e){"use strict";var t=function(){return t=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},t.apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function n(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.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 a}function a(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)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s=function(e,t){return s=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])},s(e,t)};function l(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}s(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var u=function(){return u=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},u.apply(this,arguments)};function c(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function d(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.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 a}function h(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)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var v="is",g="is not",m="contains",y="does not contain",b="less",w="less or equal",x="greater",S="greater or equal",k="version less",E="version less or equal",C="version greater",O="version greater or equal",P="set is",_="set is not",M="set contains",I="set does not contain",A="set contains any",N="set does not contain any",j="regex match",V="regex does not match",T=-862048943,L=461845907,U=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)}(e),n=r.length,i=n>>2,o=t,a=0;a<i;a++){var s=B(r,a<<2);o=F(s,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,T),u=D(u,15),o^=u=Math.imul(u,L);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,T),u=D(u,15),o^=u=Math.imul(u,L);break;case 1:u^=r[l],u=Math.imul(u,T),u=D(u,15),o^=u=Math.imul(u,L)}return R(o^=n)>>>0},F=function(e,t){var r=e,n=t;return r=Math.imul(r,T),r=D(r,15),r=Math.imul(r,L),n=D(n^=r,13),(n=Math.imul(n,5))+-430675100|0},R=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},D=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},B=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return K(r)},K=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},q=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=p(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!a||!e||"object"!=typeof e)return;e=e[a]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null==e?void 0:e}},z="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),W=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(z).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),J=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var a=p(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=p(t.segments),a=o.next();!a.done;a=o.next()){var s=a.value;if(i=this.evaluateSegment(e,t,s)){var l=u(u(u({},t.metadata),s.metadata),i.metadata);i=u(u({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateSegment=function(e,t,r){var n;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0:void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0},e.prototype.evaluateConditions=function(e,t){var r,n,i,o;try{for(var a=p(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=!0;try{for(var c=(i=void 0,p(l)),d=c.next();!d.done;d=c.next()){var f=d.value;if(!(u=this.matchCondition(e,f)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=q(e,t.selector);if(null==r)return this.matchNull(t.op,t.values);if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)},e.prototype.getHash=function(e){return U(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var a=this.coerceString(q(e,t.bucket.selector));if(!a||0===a.length)return t.variant;var s="".concat(t.bucket.salt,"/").concat(a),l=this.getHash(s),u=l%100,c=Math.floor(l/100);try{for(var d=p(t.bucket.allocations),f=d.next();!f.done;f=d.next()){var h=f.value,v=h.range[0],g=h.range[1];if(u>=v&&u<g)try{for(var m=(i=void 0,p(h.distributions)),y=m.next();!y.done;y=m.next()){var b=y.value,w=b.range[0],x=b.range[1];if(c>=w&&c<x)return b.variant}}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case v:case m:case b:case w:case x:case S:case k:case E:case C:case O:case P:case M:case A:return r;case g:case y:case I:case N:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case P:return this.setEquals(e,r);case _:return!this.setEquals(e,r);case M:return this.matchesSetContainsAll(e,r);case I:return!this.matchesSetContainsAll(e,r);case A:return this.matchesSetContainsAny(e,r);case N:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case v:return this.matchesIs(e,r);case g:return!this.matchesIs(e,r);case m:return this.matchesContains(e,r);case y:return!this.matchesContains(e,r);case b:case w:case x:case S:return this.matchesComparable(e,t,r,(function(e){return n.parseNumber(e)}),this.comparator);case k:case E:case C:case O:return this.matchesComparable(e,t,r,(function(e){return W.parse(e)}),this.versionComparator);case j:return this.matchesRegex(e,r);case V:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some((function(e){return e.toLowerCase()===r}))}return t.some((function(t){return e===t}))},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=p(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.toLowerCase().includes(a.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,a=n(e),s=r.map((function(e){return n(e)})).filter((function(e){return void 0!==e}));return void 0===a||0===s.length?r.some((function(r){return o.comparator(e,t,r)})):s.some((function(e){return i(a,t,e)}))},e.prototype.comparator=function(e,t,r){switch(t){case b:case k:return e<r;case w:case E:return e<=r;case x:case C:return e>r;case S:case O:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case b:case k:return n<0;case w:case E:return n<=0;case x:case C:return n>0;case S:case O:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some((function(t){return Boolean(new RegExp(t).exec(e))}))},e.prototype.containsNone=function(e){return e.some((function(e){return"(none)"===e}))},e.prototype.containsBooleans=function(e){return e.some((function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map((function(e){return t.coerceString(e)})).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map((function(e){return t.coerceString(e)})).filter(Boolean):(i=this.coerceString(r))?[i]:void 0}catch(e){var i;return(i=this.coerceString(r))?[i]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case P:case _:case M:case I:case A:case N:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&h([],f(n),!1).every((function(e){return r.has(e)}))},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=p(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!this.matchesIs(a,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=p(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(this.matchesIs(a,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),H=function(e,t,r){var n,i;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var a=[],s=function(e){if(r.some((function(t){return t===e})))throw Error("Detected a cycle between flags ".concat(r));var n=H(e,t,r);n&&a.push.apply(a,h([],f(n),!1))};try{for(var l=p(o.dependencies),u=l.next();!u.done;u=l.next()){s(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return a.push(o),r.pop(),delete t[o.key],a}};const X="function"==typeof Buffer,$=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),G=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Q=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(G),Z=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Y=String.fromCharCode.bind(String),ee=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),te=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),re=e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=G[t>>18&63]+G[t>>12&63]+G[t>>6&63]+G[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},ne="function"==typeof btoa?e=>btoa(e):X?e=>Buffer.from(e,"binary").toString("base64"):re,ie=X?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(Y.apply(null,e.subarray(r,r+4096)));return ne(t.join(""))},oe=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Y(192|t>>>6)+Y(128|63&t):Y(224|t>>>12&15)+Y(128|t>>>6&63)+Y(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Y(240|t>>>18&7)+Y(128|t>>>12&63)+Y(128|t>>>6&63)+Y(128|63&t)},ae=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,se=e=>e.replace(ae,oe),le=X?e=>Buffer.from(e,"utf8").toString("base64"):$?e=>ie($.encode(e)):e=>ne(se(e)),ue=(e,t=!1)=>t?ee(le(e)):le(e),ce=e=>ue(e,!0),de=e=>{if(e=e.replace(/\s+/g,""),!Z.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=Q[e.charAt(o++)]<<18|Q[e.charAt(o++)]<<12|(r=Q[e.charAt(o++)])<<6|(n=Q[e.charAt(o++)]),i+=64===r?Y(t>>16&255):64===n?Y(t>>16&255,t>>8&255):Y(t>>16&255,t>>8&255,255&t);return i},pe=ce;var fe=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return l(t,e),t}(Error),he=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return l(t,e),t}(Error),ve=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return c(this,void 0,void 0,(function(){var r,n,i,o;return d(this,(function(a){switch(a.label){case 0:return r=pe(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=pe(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),(null==t?void 0:t.exposureTrackingOption)&&(n["X-Amp-Exp-Exposure-Track"]=t.exposureTrackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=a.sent()).status)throw new fe(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),ge=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return c(this,void 0,void 0,(function(){var t,r;return d(this,(function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=pe(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce((function(e,t){return e[t.key]=t,e}),{})]}}))}))},e}(),me="undefined"!=typeof globalThis?globalThis:global||self,ye=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},be=function(){var e=ye();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1},we=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=me.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(me.clearInterval(this.poller),this.poller=void 0)},e}(),xe=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Se(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),Se=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ke=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),Ee=function(){return Ee=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},Ee.apply(this,arguments)};function Ce(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Oe(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.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 a}"function"==typeof SuppressedError&&SuppressedError;var Pe=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Ce(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===i)return e===t}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var s=Array.isArray(e),l=Array.isArray(t);if(s!==l)return!1;if(!s||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!Pe(u,c))return!1;var d=!0;return Object.keys(e).forEach((function(r){Pe(e[r],t[r])||(d=!1)})),d}for(var p=0;p<e.length;p++)if(!Pe(e[p],t[p]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var _e=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Ee({},this.identity.userProperties),r=Ee(Ee({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,a,s,l=r.userProperties||{};try{for(var u=Ce(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=Oe(c.value,2),p=d[0],f=d[1];switch(p){case"$set":try{for(var h=(i=void 0,Ce(Object.entries(f))),v=h.next();!v.done;v=h.next()){var g=Oe(v.value,2),m=g[0],y=g[1];l[m]=y}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(a=void 0,Ce(Object.keys(f))),w=b.next();!w.done;w=b.next()){delete l[m=w.value]}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return Ee({},this.identity)},e.prototype.setIdentity=function(e){var t=Ee({},this.identity);this.identity=Ee({},e),Pe(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),Me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Ie=function(){function e(){this.identityStore=new _e,this.eventBridge=new ke,this.applicationContextProvider=new xe}return e.getInstance=function(t){return Me.analyticsConnectorInstances||(Me.analyticsConnectorInstances={}),Me.analyticsConnectorInstances[t]||(Me.analyticsConnectorInstances[t]=new e),Me.analyticsConnectorInstances[t]},e}(),Ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var Ne,je,Ve,Te=(Ne=function(e,t){!function(r,n){var i="function",o="undefined",a="object",s="string",l="model",u="name",c="type",d="vendor",p="version",f="architecture",h="console",v="mobile",g="tablet",m="smarttv",y="wearable",b="embedded",w="Amazon",x="Apple",S="ASUS",k="BlackBerry",E="Browser",C="Chrome",O="Firefox",P="Google",_="Huawei",M="LG",I="Microsoft",A="Motorola",N="Opera",j="Samsung",V="Sharp",T="Sony",L="Xiaomi",U="Zebra",F="Facebook",R=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},D=function(e,t){return typeof e===s&&-1!==B(t).indexOf(B(e))},B=function(e){return e.toLowerCase()},K=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},q=function(e,t){for(var r,o,s,l,u,c,d=0;d<t.length&&!u;){var p=t[d],f=t[d+1];for(r=o=0;r<p.length&&!u;)if(u=p[r++].exec(e))for(s=0;s<f.length;s++)c=u[++o],typeof(l=f[s])===a&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;d+=2}},z=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(D(t[r][i],e))return"?"===r?n:r}else if(D(t[r],e))return"?"===r?n:r;return e},W={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"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,p],[/opios[\/ ]+([\w\.]+)/i],[p,[u,N+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[u,N]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[u,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+E],p],[/\bfocus\/([\w\.]+)/i],[p,[u,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[u,N+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[u,N+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[u,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[p,[u,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+E],p],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,F],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[u,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,C+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[u,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[p,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[u,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,p],[/(cobalt)\/([\w\.]+)/i],[u,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,B]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",B]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,B]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,j],[c,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,j],[c,v]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,x],[c,v]],[/(ipad\d+,\d+)/i],[l,[d,x],[c,g]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,x],[c,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,x],[c,g]],[/(macintosh);/i],[l,[d,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,_],[c,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,_],[c,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,L],[c,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,L],[c,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[c,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[c,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[c,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,A],[c,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,A],[c,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,M],[c,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,M],[c,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[c,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[c,v]],[/(pixel c)\b/i],[l,[d,P],[c,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,P],[c,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,T],[c,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,T],[c,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[c,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[c,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[c,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[c,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,k],[c,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,S],[c,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,S],[c,v]],[/(nexus 9)/i],[l,[d,"HTC"],[c,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[c,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[c,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[c,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,V],[c,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[c,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[c,g]],[/(surface duo)/i],[l,[d,I],[c,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[c,v]],[/(u304aa)/i],[l,[d,"AT&T"],[c,v]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[c,v]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[c,g]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[c,g]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[c,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[c,g]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[c,g]],[/\b(k88) b/i],[l,[d,"ZTE"],[c,g]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[c,v]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[c,v]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[c,g]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[c,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[c,g]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[c,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[c,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[c,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[c,v]],[/\b(ph-1) /i],[l,[d,"Essential"],[c,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[c,g]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[c,g]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[c,g]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[c,g]],[/(sprint) (\w+)/i],[d,l,[c,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,I],[c,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,U],[c,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,U],[c,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[c,h]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[c,h]],[/(playstation [345portablevi]+)/i],[l,[d,T],[c,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,I],[c,h]],[/smart-tv.+(samsung)/i],[d,[c,m]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,j],[c,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,M],[c,m]],[/(apple) ?tv/i],[d,[l,x+" TV"],[c,m]],[/crkey/i],[[l,C+"cast"],[d,P],[c,m]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[c,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,V],[c,m]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,T],[c,m]],[/(mitv-\w{5}) bui/i],[l,[d,L],[c,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,K],[l,K],[c,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,m]],[/((pebble))app/i],[d,l,[c,y]],[/droid.+; (glass) \d/i],[l,[d,P],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,U],[c,y]],[/(quest( 2)?)/i],[l,[d,F],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[p,z,W]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[p,z,W]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,p],[/\(bb(10);/i],[p,[u,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[u,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[u,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,p],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,p]]},H=function(e,t){if(typeof e===a&&(t=e,e=n),!(this instanceof H))return new H(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),h=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(J,t):J;return this.getBrowser=function(){var e={};return e[u]=n,e[p]=n,q.call(e,i,h.browser),e.major=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e[f]=n,q.call(e,i,h.cpu),e},this.getDevice=function(){var e={};return e[d]=n,e[l]=n,e[c]=n,q.call(e,i,h.device),e},this.getEngine=function(){var e={};return e[u]=n,e[p]=n,q.call(e,i,h.engine),e},this.getOS=function(){var e={};return e[u]=n,e[p]=n,q.call(e,i,h.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===s&&e.length>350?K(e,350):e,this},this.setUA(i),this};H.VERSION="0.7.33",H.BROWSER=R([u,p,"major"]),H.CPU=R([f]),H.DEVICE=R([l,d,c,h,v,m,g,y,b]),H.ENGINE=H.OS=R([u,p]),e.exports&&(t=e.exports=H),t.UAParser=H;var X=typeof r!==o&&(r.jQuery||r.Zepto);if(X&&!X.ua){var $=new H;X.ua=$.getResult(),X.ua.get=function(){return $.getUA()},X.ua.set=function(e){$.setUA(e);var t=$.getResult();for(var r in t)X.ua[r]=t[r]}}}("object"==typeof window?window:Ae)},Ne(Ve={path:je,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&Ve.path)}},Ve.exports),Ve.exports),Le=function(){function e(e){this.amplitudeInstance=e}return e.prototype.getUser=function(){var e,t,r,n,i,o,a,s,l,u;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(n=null===(r=this.amplitudeInstance)||void 0===r?void 0:r.options)||void 0===n?void 0:n.userId,version:null===(o=null===(i=this.amplitudeInstance)||void 0===i?void 0:i.options)||void 0===o?void 0:o.versionName,language:null===(s=null===(a=this.amplitudeInstance)||void 0===a?void 0:a.options)||void 0===s?void 0:s.language,platform:null===(u=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===u?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,r,n,i,o;return[null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===r?void 0:r.name,null===(o=null===(i=null===(n=this.amplitudeInstance)||void 0===n?void 0:n._ua)||void 0===i?void 0:i.browser)||void 0===o?void 0:o.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(){var e,t,r;return null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===r?void 0:r.name},e}(),Ue=function(){function e(e){this.amplitudeInstance=e}return e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,r;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(r=e.variant)||void 0===r?void 0:r.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(t={},t[e.userProperty]="-",t)})},e}(),Fe=function(){return Fe=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},Fe.apply(this,arguments)};
3
+ /* @amplitude/experiment-js-client v1.20.3 - For license info see https://app.unpkg.com/@amplitude/experiment-js-client@1.20.3/files/LICENSE */function Re(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function De(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Be(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ke(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.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 a}function qe(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)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var ze=function(e,t){var r,n;void 0===t&&(t=!1);var i=We(e,t),o=void 0,a=me.document.cookie.split("; ");try{for(var s=Be(a),l=s.next();!l.done;l=s.next()){var u=Ke(l.value.split("=",2),2),c=u[0],d=u[1];c===i&&(o=decodeURIComponent(d))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}if(o)try{if(t){var p=atob(o);return JSON.parse(decodeURIComponent(p))}var f=o.split("."),h=void 0;return f.length>=2&&f[1]&&(h=atob(f[1])),{deviceId:f[0],userId:h}}catch(e){return}},We=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},Je=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return Re(this,void 0,void 0,(function(){return De(this,(function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==t||t.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=ze(this.apiKey,!0);return(e||(e=ze(this.apiKey,!1))||(e=function(e){var t=We(e,!0);try{var r=me.localStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=We(e,!0);try{var r=me.sessionStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return Re(this,void 0,void 0,(function(){var t,r=this;return De(this,(function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise((function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)})),new Promise((function(t,r){me.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var He,Xe,$e,Ge=me.fetch||function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))},Qe=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}}))}))},e}(),Ze={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise((function(r,n){me.setTimeout((function(){n(new he("Request timeout after "+t+" milliseconds"))}),t),e.then(r,n)}))}(Re(void 0,void 0,void 0,(function(){var i,o;return De(this,(function(a){switch(a.label){case 0:return[4,Ge(e,{method:t,headers:r,body:n})];case 1:return i=a.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=a.sent(),[2,o]}}))})),i)}};!function(e){e[e.Disable=0]="Disable",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose"}(He||(He={})),function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(Xe||(Xe={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}($e||($e={}));var Ye=function(e){return!e||e===$e.FallbackInline||e===$e.FallbackConfig||e===$e.SecondaryInitialVariants},et={debug:!1,logLevel:He.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:Xe.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:Ze},tt="1.20.3",rt=function(){function e(e,t){var r,n=this;this.isReady=new Promise((function(e){n.resolve=e})),this.config=e,this.client=t;var i=null!==(r=e.instanceName)&&void 0!==r?r:et.instanceName;this.queue=new it(i),this.cache=new nt(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then((function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}),(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()})):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e,t){if(this.cache.shouldTrack(e,t)){var r=this.getExposureEvent(e);this.queue.push(r)}},e.prototype.getExposureEvent=function(e){var t,r,n,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),nt=function(){function e(e){this.isSessionStorageAvailable=ot(),this.inMemoryCache={},this.identity={},this.storageKey="EXP_sent_v3_".concat(e),this.isSessionStorageAvailable&&(me.sessionStorage.removeItem("EXP_sent_".concat(e)),me.sessionStorage.removeItem("EXP_sent_v2_".concat(e)))}return e.prototype.shouldTrack=function(e,t){var r,n;if("web"===(null===(r=e.metadata)||void 0===r?void 0:r.deliveryMethod))return!0;var i={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,i)||this.clearCache(),this.identity=i,this.loadCache();var o=e.flag_key in this.inMemoryCache,a=this.inMemoryCache[e.flag_key],s=null!==(n=e.variant)&&void 0!==n?n:null,l=!1;return o&&(null!=a?a:null)===s||(l=!0,this.inMemoryCache[e.flag_key]=s),this.storeCache(),l},e.prototype.clearCache=function(){this.inMemoryCache={},this.isSessionStorageAvailable&&me.sessionStorage.removeItem(this.storageKey)},e.prototype.identityEquals=function(e,t){return e.userId&&t.userId?e.userId===t.userId:!e.userId&&!t.userId&&e.deviceId===t.deviceId},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=me.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){if(this.isSessionStorageAvailable)try{me.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch(e){}},e}(),it=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=be(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=me.setInterval((function(){t.loadFlushStore()}),1e3),this.loadFlushStore()},e.prototype.flush=function(){if(this.tracker&&0!==this.inMemoryQueue.length){for(var e=0;e<this.inMemoryQueue.length;e++)try{if(!this.tracker(this.inMemoryQueue[e]))break}catch(e){break}this.inMemoryQueue=this.inMemoryQueue.slice(e),0===this.inMemoryQueue.length&&this.poller&&(me.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=me.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),me.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),ot=function(){var e=ye();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},at=function(){function e(e,t){void 0===t&&(t=He.Error),this.logger=e,this.logLevel=t}return e.prototype.error=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=He.Error&&(t=this.logger).error.apply(t,qe([e],Ke(r),!1))},e.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=He.Warn&&(t=this.logger).warn.apply(t,qe([e],Ke(r),!1))},e.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=He.Info&&(t=this.logger).info.apply(t,qe([e],Ke(r),!1))},e.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=He.Debug&&(t=this.logger).debug.apply(t,qe([e],Ke(r),!1))},e.prototype.verbose=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=He.Verbose&&(t=this.logger).verbose.apply(t,qe([e],Ke(r),!1))},e}(),st=function(){function e(){}return e.prototype.error=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.error.apply(console,qe([e],Ke(t),!1))},e.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.warn.apply(console,qe([e],Ke(t),!1))},e.prototype.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.info.apply(console,qe([e],Ke(t),!1))},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.debug.apply(console,qe([e],Ke(t),!1))},e.prototype.verbose=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.debug.apply(console,qe([e],Ke(t),!1))},e}(),lt=function(){function e(){this.globalScope=ye()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),ut=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),ct=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return Fe({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=Be(Object.keys(e)),i=n.next();!i.done;i=n.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,n=this.storage.get(this.namespace);try{r=JSON.parse(n)||{}}catch(e){return}var i={};try{for(var o=Be(Object.keys(r)),a=o.next();!a.done;a=o.next()){var s=a.value;try{var l=void 0;(l=this.transformer?this.transformer(r[s]):r[s])&&(i[s]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),dt=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,n=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var a={};return t?a.key=t:r&&(a.key=r),r&&(a.value=r),i&&(a.metadata=i),n&&(a.payload=n),o&&(a.expKey=o),a}},pt=function(){function e(){this.globalScope=ye()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),ft=function(e){return null==e},ht=function(e){return!!ft(e)||e&&0===Object.keys(e).length},vt=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},gt=function(){function e(e,t,r,n){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=n}return e.prototype.start=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}}))}))},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return Re(this,void 0,void 0,(function(){var n=this;return De(this,(function(i){return this.done||(this.timeoutHandle=me.setTimeout((function(){return Re(n,void 0,void 0,(function(){var n,i;return De(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(n=t+1)<this.attempts&&(i=Math.min(r*this.scalar,this.max),this.backoff(e,n,i)),[3,3];case 3:return[2]}}))}))}),r)),[2]}))}))},e}(),mt=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},yt=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},bt=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),wt=function(){function e(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}return e.prototype.track=function(e,t){var r={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,r)||(this.tracked={}),this.identity=r;var n=e.flag_key in this.tracked,i=this.tracked[e.flag_key];n&&i===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))},e.prototype.identityEquals=function(e,t){return e.userId===t.userId&&e.deviceId===t.deviceId},e}(),xt=function(){function e(t,r){var n,i,o,a,s=this;this.engine=new J,this.isRunning=!1,this.apiKey=t,r=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=Be(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=Ke(o.value,2),s=a[0],l=a[1];ft(l)||(n[s]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}(r),this.config=Fe(Fe(Fe({},et),r),{serverUrl:(null==r?void 0:r.serverUrl)||("eu"===(null===(n=null==r?void 0:r.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://api.lab.eu.amplitude.com":et.serverUrl),flagsServerUrl:(null==r?void 0:r.flagsServerUrl)||("eu"===(null===(i=null==r?void 0:r.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":et.flagsServerUrl),flagConfigPollingIntervalMillis:r.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=r.flagConfigPollingIntervalMillis)&&void 0!==o?o:et.flagConfigPollingIntervalMillis}),this.logger=new at(this.config.loggerProvider||new st,e.getLogLevel(r));var l=null===(a=this.config)||void 0===a?void 0:a.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new we((function(){return s.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=dt(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new bt(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new wt(this.config.exposureTrackingProvider)),this.integrationManager=new rt(this.config,this);var c,d=new Qe(this.config.httpClient||Ze);this.flagApi=new ge(this.apiKey,this.config.flagsServerUrl,d),this.evaluationApi=new ve(this.apiKey,this.config.serverUrl,d);var p=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;c=this.isWebExperiment?new pt:new lt,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new ct(i,r,dt)}(this.apiKey,p,c),this.flags=function(e,t,r){void 0===r&&(r=new lt);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new ct(i,r)}(this.apiKey,p,c),this.fetchVariantsOptions=function(e,t,r){void 0===r&&(r=new lt);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-variants-options");return new ut(i,r)}(this.apiKey,p,c);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Re(this,void 0,void 0,(function(){var t,r,n;return De(this,(function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:return i.trys.push([1,6,,7]),t=this.doFlags(),null===(n=this.config.fetchOnStart)||void 0===n||n?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(r=i.sent(),this.config.throwOnError)throw r;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}}))}))},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return Re(this,arguments,void 0,(function(e,t){var r;return void 0===e&&(e=this.user),De(this,(function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:if(r=n.sent(),this.config.throwOnError)throw r;return r instanceof he?this.logger.debug(r):this.logger.error(r),[3,4];case 4:return[2,this]}}))}))},e.prototype.variant=function(e,t){var r,n;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.logger.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=i.variant)||void 0===r?void 0:r.key)||(null===(n=i.variant)||void 0===n?void 0:n.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);vt(r)||delete e[t]}return Fe(Fe(Fe({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=Fe({},this.user.user_properties);return Fe(Fe({},this.user),{user_properties:t})}return Fe({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=Fe({},e.user_properties);this.user=Fe(Fe({},e),{user_properties:r})}else this.user=Fe({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(t){e.flags.get(t.key)||e.flags.put(t.key,t)}))},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),i=function(e,t){var r,n,i=u({},e),o=[],a=t||Object.keys(i);try{for(var s=p(a),l=s.next();!l.done;l=s.next()){var c=l.value,d=H(c,i);d&&o.push.apply(o,h([],f(d),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}(this.flags.getAll(),e),o=function(e){var t,r,n,i;if(!e)return{};var o={user:e},a=ye();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var l=Be(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e.groups[c];if(d.length>0&&d[0]){var p=d[0],f={group_name:p},h=null===(i=null===(n=e.group_properties)||void 0===n?void 0:n[c])||void 0===i?void 0:i[p];h&&Object.keys(h).length>0&&(f.group_properties=h),s[c]=f}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return Object.keys(s).length>0&&(o.groups=s),delete o.user.groups,delete o.user.group_properties,o}(n),a=this.engine.evaluate(o,i),s={};try{for(var l=Be(Object.keys(a)),c=l.next();!c.done;c=l.next()){var d=c.value;s[d]=yt(a[d])}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return s},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===Xe.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===Xe.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(vt(n)||!r.variant&&n)&&(r=this.localEvaluationVariantAndSource(e,n,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},o=this.evaluate([t.key])[e],a=$e.LocalEvaluation,s=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!ft(o)&&!s)return{variant:mt(o),source:a,hasDefaultVariant:!1};if(s&&(i={variant:mt(o),source:a,hasDefaultVariant:!0}),!ft(r))return{variant:mt(r),source:$e.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!ft(l))return{variant:mt(l),source:$e.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=mt(this.config.fallbackVariant),c={variant:u,source:$e.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return ht(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),o=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!ft(i)&&!o)return{variant:mt(i),source:$e.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:mt(i),source:$e.LocalStorage,hasDefaultVariant:!0}),!ft(t))return{variant:mt(t),source:$e.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=this.config.initialVariants[e];if(!ft(a))return{variant:mt(a),source:$e.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var s=mt(this.config.fallbackVariant),l={variant:s,source:$e.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return ht(s)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!ft(i))return{variant:mt(i),source:$e.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),a=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!ft(o)&&!a)return{variant:mt(o),source:$e.LocalStorage,hasDefaultVariant:!1};if(a&&(n={variant:mt(o),source:$e.LocalStorage,hasDefaultVariant:!0}),!ft(t))return{variant:mt(t),source:$e.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=mt(this.config.fallbackVariant),l={variant:s,source:$e.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return ht(s)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return Re(this,void 0,void 0,(function(){var i,o,a;return De(this,(function(s){switch(s.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.doFetch(e,t,Fe({trackingOption:null===(a=this.fetchVariantsOptions.get())||void 0===a?void 0:a.trackingOption},n))];case 2:return i=s.sent(),[4,this.storeVariants(i,n)];case 3:return s.sent(),[2,i];case 4:throw o=s.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}}))}))},e.prototype.setTracksAssignment=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(t){return this.fetchVariantsOptions.put(Fe(Fe({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]}))}))},e.prototype.cleanUserPropsForFetch=function(e){var t=Fe({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return Re(this,void 0,void 0,(function(){var n,i,o,a,s,l,u;return De(this,(function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Fe({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=Be(Object.keys(n)),a=o.next();!a.done;a=o.next())s=a.value,i[s]=yt(n[s])}catch(e){l={error:e}}finally{try{a&&!a.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.logger.debug("[Experiment] Received variants: ",i),[2,i]}}))}))},e.prototype.doFlags=function(){return Re(this,void 0,void 0,(function(){var e,t,r;return De(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:tt,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=n.sent())instanceof he))throw r;if(this.logger.debug(r),this.config.throwOnError)throw r;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},e.prototype.storeVariants=function(e,t){return Re(this,void 0,void 0,(function(){var r,n,i,o;return De(this,(function(a){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter((function(e){return e!==t})),i.variants.put(t,e[t])},i=this,e)n(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.logger.debug("[Experiment] Stored variants: ",e),[2]}))}))},e.prototype.startRetries=function(e,t){return Re(this,void 0,void 0,(function(){var r=this;return De(this,(function(n){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new gt(8,500,1e4,1.5),this.retriesBackoff.start((function(){return Re(r,void 0,void 0,(function(){return De(this,(function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}}))}))})),[2]}))}))},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),i=Fe(Fe(Fe({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return Fe(Fe(Fe(Fe({library:"experiment-js-client/".concat(tt)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}}))}))},e.prototype.sourceVariants=function(){return this.config.source==Xe.LocalStorage?this.variants.getAll():this.config.source==Xe.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==Xe.LocalStorage?this.config.initialVariants:this.config.source==Xe.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,n,i,o,a,s,l,u,c;if(null===(i=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var d={flag_key:e},p=Ye(t.source);if(!p||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(d.experiment_key=null===(a=t.variant)||void 0===a?void 0:a.expKey);var f=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(p||(null==f?void 0:f.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(d.variant=t.variant.value)),f&&(d.metadata=f),this.isWebExperiment&&(d.time=Date.now()),this.isWebExperiment){var h=ye();if(null==h?void 0:h.location)try{var v=h.location.href;d.metadata.url=v.split("?")[0]||""}catch(e){}}var g=this.addContext(this.getUser());null===(c=this.userSessionExposureTracker)||void 0===c||c.track(d,g),this.integrationManager.track(d,g)}}},e.prototype.legacyExposureInternal=function(e,t,r){var n,i,o,a,s;if(this.analyticsProvider){var l=function(e,t,r,n){var i,o=null==r?void 0:r.value,a="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:a,properties:{key:t,variant:o,source:n},userProperties:(i={},i[a]=o,i)}}(this.addContext(this.getUser()),e,t,r);Ye(r)||!(null==t?void 0:t.value)?null===(i=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===i||i.call(n,l):(null==t?void 0:t.value)&&(null===(a=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===a||a.call(o,l),null===(s=this.analyticsProvider)||void 0===s||s.track(l))}},e.getLogLevel=function(e){var t;return!0===e.debug?He.Debug:null!==(t=e.logLevel)&&void 0!==t?t:He.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof fe)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),St=function(){function e(e,t){var r,n,i;this.globalScope=ye(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(n=this.globalScope)||void 0===n?void 0:n.navigator.userAgent:void 0,this.ua=new Te.UAParser(this.userAgent).getResult(),this.localStorage=new lt,this.sessionStorage=new pt,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return Fe({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(i=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===i?void 0:i.split("; ").map((function(e){return e.split("=")})))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var n={};try{var i=new URL(this.globalScope.location.href);try{for(var o=Be(i.searchParams),a=o.next();!a.done;a=o.next()){var s=Ke(a.value,2),l=s[0],u=s[1];n[l]=qe(qe([],Ke(null!==(r=n[l])&&void 0!==r?r:[]),!1),Ke(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(n).reduce((function(e,t){var r=Ke(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e}),{})}},e}();me.experimentInstances={};var kt=me.experimentInstances,Et=function(e,t){return Pt(e,t)},Ct=function(e,t){return Pt(e,t,(function(){return new Je(e,Ie.getInstance(Ot(t)),1e4)}))},Ot=function(e){return(null==e?void 0:e.instanceName)||et.instanceName},Pt=function(e,t,r){var n=function(e,t){var r=Ot(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=kt[n];return i||(i=function(e,t){return new xt(e,Fe(Fe({},t),{userProvider:new St(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),kt[n]=i,i)},_t={initialize:Et,initializeWithAmplitudeAnalytics:Ct},Mt=function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return Re(this,void 0,void 0,(function(){return De(this,(function(e){return[2]}))}))},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return Re(this,void 0,void 0,(function(){return De(this,(function(e){return[2,this]}))}))},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return et.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}(),It=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:Ue,AmplitudeIntegrationPlugin:Je,AmplitudeUserProvider:Le,ConsoleLogger:st,Experiment:_t,ExperimentClient:xt,get LogLevel(){return He},get Source(){return Xe},StubExperimentClient:Mt,initialize:Et,initializeWithAmplitudeAnalytics:Ct});function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},At.apply(null,arguments)}var Nt=["selector","action","value","attribute"],jt=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Vt={revert:function(){}},Tt=new Map,Lt=[],Ut=new Set,Ft=!1,Rt=1;function Dt(e){return"html"===e?{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}function Bt(e){var t=Tt.get(e);return t||(t={element:e,attributes:{}},Tt.set(e,t)),t}function Kt(e,t){return e.parentNode===t.parentNode&&e.insertBeforeNode===t.insertBeforeNode}function qt(e,t){Ut.add(e),e.__params=t,Ft||e.observe.apply(e,e.__params)}function zt(e,t,r,n,i){var o,a=r(e),s=function(e){Sr(),i(e),kr()},l={isDirty:!1,originalValue:a,virtualValue:a,mutations:[],el:e,rateLimitCount:0,observer:new MutationObserver((function(n){if(!(l.rateLimitCount>=10)){if(l.rateLimitCount++,setTimeout((function(){l.rateLimitCount=l.rateLimitCount-1,l.rateLimitCount<=0&&(l.rateLimitCount=0)}),1e3),"html"===t)return Sr(),n.forEach((function(t){var r=t.target,n=t.type,i=t.oldValue;if("childList"===n)return t.removedNodes.forEach((function(e){r.insertBefore(e,t.nextSibling)})),void t.addedNodes.forEach((function(e){e.remove()}));if("characterData"!==n){if("attributes"===n&&r instanceof Element){if(r===e)return;var o=t.attributeName;if(!o)return;null===i?r.removeAttribute(o):r.setAttribute(o,i)}}else r.nodeValue=i})),void kr();var i=r(e);if("position"===t){if(Kt(i,l.virtualValue))return;var o=l.mutations.at(-1);if(!o)return;if(hr(l.virtualValue.parentNode,o))return}i!==l.virtualValue&&("position"!==t&&(l.originalValue=i),s(l))}})),mutationRunner:s,setValue:n,getCurrentValue:r};return o="position"===t&&e.parentNode?[e.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}]:[e,Dt(t)],qt(l.observer,o),l}function Wt(e,t){var r=t.getCurrentValue(t.el);t.virtualValue=e,!e||"string"==typeof e||"string"==typeof r||Array.isArray(e)||Array.isArray(r)?e!==r&&(t.isDirty=!0,pr()):r&&Kt(r,e)||(t.isDirty=!0,pr())}var Jt=new DOMParser;function Ht(e){var t=e.originalValue,r=t.map((function(e){return e instanceof Element?e.outerHTML:e.nodeValue})).join("");e.mutations.forEach((function(n){if(r=n.mutate(r),n.cachedHtml!==r||!n.cachedNodes.has(e.el)){n.cachedHtml=r;var i=Array.from(Jt.parseFromString(r,"text/html").body.childNodes);n.cachedNodes.set(e.el,i)}t=n.cachedNodes.get(e.el)})),Wt(t,e)}function Xt(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach((function(e){return e.mutate(t)})),Wt(Array.from(t).filter(Boolean).join(" "),e)}function $t(e){var t=e.originalValue;e.mutations.forEach((function(e){t=e.mutate(t)})),Wt(t,e)}function Gt(e){if("insertSelector"in e){var t,r=e.insertSelector,n=e.direction,i=document.querySelector(r);if(!i)return null;switch(n){case"prepend":t={parentNode:i,insertBeforeNode:i.firstChild};break;case"append":t={parentNode:i,insertBeforeNode:null};break;case"before":t={parentNode:i.parentElement,insertBeforeNode:i};break;case"after":t={parentNode:i.parentElement,insertBeforeNode:i.nextSibling}}return At({},t,{insertNode:i,direction:n})}var o=e.parentSelector,a=e.insertBeforeSelector,s=document.querySelector(o);if(!s)return null;var l=a?document.querySelector(a):null;return a&&!l?null:{parentNode:s,insertBeforeNode:l}}function Qt(e){for(var t=e.originalValue,r=e.mutations.length-1;r>=0;r--){var n,i=e.mutations[r];if(!i.newPosition||!i.newPosition.parentNode.isConnected||!1===(null==(n=i.newPosition.insertBeforeNode)?void 0:n.isConnected)){var o=Gt(i.mutate());i.newPosition=o}if(i.newPosition){t=i.newPosition;break}}Wt(t,e)}var Zt=function(e){return Array.from(e.childNodes)},Yt=function(e,t){e.innerHTML="",e.append.apply(e,t)};function er(e){var t=Bt(e);return t.html||(t.html=zt(e,"html",Zt,Yt,Ht)),t.html}var tr=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextSibling}},rr=function(e,t){var r;if("insertNode"in t){t.insertNode[t.direction](e),t.insertBeforeNode=e.nextSibling||null}else{if(t.insertBeforeNode&&!t.parentNode.contains(t.insertBeforeNode))return;t.parentNode.insertBefore(e,t.insertBeforeNode)}var n=null==(r=Bt(e).position)?void 0:r.observer;null!=n&&n.__params&&(n.disconnect(),qt(n,[e.parentNode,n.__params[1]]))};function nr(e){var t=Bt(e);return t.position||(t.position=zt(e,"position",tr,rr,Qt)),t.position}var ir=function(e,t){t?e.className=t:e.removeAttribute("class")},or=function(e){return e.className};function ar(e){var t=Bt(e);return t.classes||(t.classes=zt(e,"class",or,ir,Xt)),t.classes}var sr=function(e){return function(t){var r;return"style"===e?t.style.cssText:null!=(r=t.getAttribute(e))?r:null}},lr=function(e){return function(t,r){null!==r?"style"===e?r?t.style.cssText=r:t.removeAttribute("style"):t.setAttribute(e,r):t.removeAttribute(e)}};function ur(e,t){var r=Bt(e);return r.attributes[t]||(r.attributes[t]=zt(e,t,sr(t),lr(t),$t)),r.attributes[t]}function cr(e,t,r){if(r.isDirty){r.isDirty=!1;var n=r.virtualValue;r.mutations.length||function(e,t){var r,n=Tt.get(e);if(n){var i,o;if("html"===t)i=null==(o=n.html)?void 0:o.observer,delete n.html;else if("class"===t){var a;i=null==(a=n.classes)?void 0:a.observer,delete n.classes}else if("position"===t){var s;i=null==(s=n.position)?void 0:s.observer,delete n.position}else{var l;i=null==(l=n.attributes)||null==(l=l[t])?void 0:l.observer,delete n.attributes[t]}null==(r=i)||r.disconnect(),Ut.delete(i)}}(e,t),r.setValue(e,n)}}function dr(e,t){e.html&&cr(t,"html",e.html),e.classes&&cr(t,"class",e.classes),e.position&&cr(t,"position",e.position),Object.keys(e.attributes).forEach((function(r){cr(t,r,e.attributes[r])}))}function pr(){Tt.forEach(dr)}function fr(e,t){var r=null;"html"===e.kind?r=er(t):"class"===e.kind?r=ar(t):"attribute"===e.kind?r=ur(t,e.attribute):"position"===e.kind&&(r=nr(t)),r&&(r.mutations.push(e),r.mutationRunner(r))}function hr(e,t){for(var r=t._priority||0,n=e;n;){var i;if(((null==(i=Tt.get(n))||null==(i=i.html)||null==(i=i.mutations.at(-1))?void 0:i._priority)||0)>r)return!0;n=n.parentElement}return!1}function vr(e){if(!("position"===e.kind&&e.elements.size>0||Array.from(e.elements).some((function(e){return e.isConnected})))){var t=new Set(e.elements);document.querySelectorAll(e.selector).forEach((function(r){t.has(r)||hr(r.parentElement,e)||(e.elements.add(r),fr(e,r))}))}}function gr(e){for(var t=Lt.indexOf(e),r=[],n=Sr(!0),i=Lt.length-1;i>t;i--){var o=Lt[i];if("position"===o.kind){var a=o.newPosition;if(a){var s=!("direction"in a)||"before"===a.direction,l=mr(a.insertBeforeNode,e.elements,s);if(a.insertBeforeNode=l,"insertNode"in a)if("before"===a.direction)null===l?(a.insertNode=a.parentNode,a.direction="append"):a.insertNode=l;else if("after"===a.direction){var u,c=new Set(Array.from(e.elements).concat(Array.from(o.elements))),d=yr((null==(u=a.insertBeforeNode)?void 0:u.previousElementSibling)||a.parentNode.lastElementChild,c);null===d?(a.direction="prepend",a.insertNode=a.parentNode):a.insertNode=d}}}r.push(o),gr(o)}e.elements.forEach((function(t){return function(e,t){var r=null;if("html"===e.kind?r=er(t):"class"===e.kind?r=ar(t):"attribute"===e.kind?r=ur(t,e.attribute):"position"===e.kind&&(r=nr(t)),r){var n=r.mutations.indexOf(e);-1!==n&&r.mutations.splice(n,1),e.rollback&&(r.originalValue=e.rollback(r.originalValue)),r.mutationRunner(r)}}(e,t)})),Lt.splice(t,1),n();for(var p=function(){var e=r.pop();if(!e)return 1;Er(e),e.elements.forEach((function(t){return fr(e,t)}))};r.length>0;)p()}function mr(e,t,r){for(var n=e;n instanceof Element&&t.has(n);)n=r?n.nextElementSibling:n.nextSibling;return n}function yr(e,t){for(var r=e;r instanceof Element&&t.has(r);)r=r.previousElementSibling;return r}function br(){Lt.forEach(vr)}var wr,xr=!1;function Sr(e){return void 0===e&&(e=!1),Ft=!0,Ut.forEach((function(e){return e.disconnect()})),e&&!xr?(xr=!0,function(){xr=!1,kr()}):function(){}}function kr(){Ft&&!xr&&(Ft=!1,Ut.forEach((function(e){return e.__params&&e.observe.apply(e,e.__params)})),br())}function Er(e){return"undefined"==typeof document?Vt:(e._priority=Rt++,Lt.push(e),vr(e),{__mutation:e,revert:function(){gr(e)}})}function Cr(e,t){return Er({kind:"html",elements:new Set,mutate:t,selector:e,cachedNodes:new Map})}function Or(e,t){return Er({kind:"position",elements:new Set,mutate:t,selector:e})}function Pr(e,t,r){return Er({kind:"class",elements:new Set,mutate:t,selector:e,rollback:r})}function _r(e,t,r,n){return jt.test(t)?"class"===t||"className"===t?Pr(e,(function(e){var t=r(Array.from(e).join(" "));e.clear(),t&&t.split(/\s+/g).filter(Boolean).forEach((function(t){return e.add(t)}))}),n):Er({kind:"attribute",attribute:t,elements:new Set,mutate:r,selector:e,rollback:n}):Vt}"undefined"!=typeof document&&(wr||(wr=new MutationObserver((function(){br()}))),br(),qt(wr,[document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}]));var Mr={html:Cr,classes:Pr,attribute:_r,position:Or,declarative:function(e){var t=e.selector,r=e.action,n=e.value,i=e.attribute,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,Nt);if("html"===i){if("append"===r)return Cr(t,(function(e){return e+(null!=n?n:"")}));if("set"===r)return Cr(t,(function(){return null!=n?n:""}))}else if("class"===i){if("append"===r)return Pr(t,(function(e){n&&e.add(n)}),(function(e){if(n&&e){var t=new Set(e.split(/\s+/).filter(Boolean));return t.delete(n),Array.from(t).join(" ")}return e}));if("remove"===r)return Pr(t,(function(e){n&&e.delete(n)}));if("set"===r)return Pr(t,(function(e){e.clear(),n&&e.add(n)}))}else if("position"===i){if("set"===r){if("insertSelector"in o)return Or(t,(function(){return{insertSelector:o.insertSelector,direction:o.direction}}));if("parentSelector"in o)return Or(t,(function(){return{insertBeforeSelector:o.insertBeforeSelector,parentSelector:o.parentSelector}}))}}else{var a=n||"";if("append"===r)return"style"===i?_r(t,i,(function(e){return e?e+a:a}),(function(e){if(null===e)return null;var t=e.lastIndexOf(a);return-1!==t?e.substring(0,t)+e.substring(t+a.length):e})):_r(t,i,(function(e){return null!==e?e+a:a}));if("set"===r)return _r(t,i,(function(){return a}));if("remove"===r)return _r(t,i,(function(){return null}))}return Vt}},Ir=function(){function e(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map}return e.prototype.subscribe=function(e,t,r,n){void 0===r&&(r=void 0);var i=this.messageToSubscriberGroup.get(e);i||(i={subscribers:[]},this.messageToSubscriberGroup.set(e,i),n&&this.subscriberGroupCallback.set(e,n));var o={identifier:r,callback:t};i.subscribers.push(o)},e.prototype.publish=function(e,t){var r,n=this.messageToSubscriberGroup.get(e);n&&(n.subscribers.forEach((function(e){t=t||{},e.callback(t)})),null===(r=this.subscriberGroupCallback.get(e))||void 0===r||r(t))},e.prototype.unsubscribeAll=function(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map},e}(),Ar=function(){function e(e){this.modal=null,this.options=e}return e.prototype.show=function(){document.getElementById("amp-preview-modal")||(this.createModal(),this.attachEventListeners())},e.prototype.hide=function(){var e,t;this.modal&&(this.modal.remove(),this.modal=null),null===(t=(e=this.options).onDismiss)||void 0===t||t.call(e)},e.prototype.createModal=function(){var e=this;if(document.body){this.modal=document.createElement("div"),this.modal.id="amp-preview-modal",this.modal.className="amp-preview-modal";var t=document.createElement("div");t.className="amp-preview-modal-container",Object.entries(this.options.flags).forEach((function(e){var r=o(e,2),n=r[0],i=r[1],a=document.createElement("div");a.className="amp-preview-modal-row";var s=document.createElement("div");s.className="amp-preview-modal-icon",s.innerHTML='\n <svg class="amp-preview-modal-icon-img" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.1389 11.4324L18.2087 18.1956H6.04109L11.1109 11.4324V6.02794H13.1389V11.4324ZM16.1402 4H8.10959C7.68372 4 7.45051 4.4867 7.71414 4.82131L9.083 6.53492V10.7632L3.20198 18.6011C2.70514 19.2704 3.1817 20.2235 4.01316 20.2235H20.2366C21.0681 20.2235 21.5447 19.2704 21.0478 18.6011L15.1668 10.7632V6.53492L16.5357 4.82131C16.7993 4.4867 16.5661 4 16.1402 4Z" fill="currentColor"/>\n </svg>\n ';var l=document.createElement("span");l.className="amp-preview-modal-title",l.textContent=n;var u=document.createElement("div");u.className="amp-preview-modal-badge amp-preview-modal-preview-badge",u.innerHTML='\n <svg class="amp-preview-modal-preview-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 6C15.79 6 19.17 8.13 20.82 11.5C19.17 14.87 15.79 17 12 17C8.21 17 4.83 14.87 3.18 11.5C4.83 8.13 8.21 6 12 6ZM12 4C7 4 2.73 7.11 1 11.5C2.73 15.89 7 19 12 19C17 19 21.27 15.89 23 11.5C21.27 7.11 17 4 12 4ZM12 9C13.38 9 14.5 10.12 14.5 11.5C14.5 12.88 13.38 14 12 14C10.62 14 9.5 12.88 9.5 11.5C9.5 10.12 10.62 9 12 9ZM12 7C9.52 7 7.5 9.02 7.5 11.5C7.5 13.98 9.52 16 12 16C14.48 16 16.5 13.98 16.5 11.5C16.5 9.02 14.48 7 12 7Z" fill="currentColor"/>\n </svg>\n Preview Mode\n ';var c=document.createElement("span");c.className="amp-preview-modal-badge amp-preview-modal-variant-badge amp-preview-modal-variant-".concat(i.toLowerCase());var d=document.createElement("span");d.className="amp-preview-modal-variant-dot",c.appendChild(d),c.appendChild(document.createTextNode(i)),a.appendChild(s),a.appendChild(l),a.appendChild(u),a.appendChild(c),t.appendChild(a)}));var r=document.createElement("button");r.className="amp-preview-modal-close",r.setAttribute("aria-label","Dismiss preview mode notification"),r.innerHTML="×",this.modal.appendChild(t),this.modal.appendChild(r),this.injectStyles(),requestAnimationFrame((function(){e.modal&&document.body&&document.body.appendChild(e.modal)}))}},e.prototype.attachEventListeners=function(){var e=this;if(this.modal){var t=this.modal.querySelector(".amp-preview-modal-close");t&&t.addEventListener("click",(function(){return e.hide()}))}},e.prototype.injectStyles=function(){if(!document.getElementById("amp-preview-modal-styles")){var e=document.createElement("style");e.id="amp-preview-modal-styles",e.textContent="\n .amp-preview-modal {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 10000;\n background-color: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.4;\n color: #2d3748;\n animation: amp-preview-modal-slide-in 0.3s ease-out;\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 12px 16px;\n max-width: 600px;\n }\n\n @keyframes amp-preview-modal-slide-in {\n from {\n transform: translateX(100%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n\n .amp-preview-modal-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .amp-preview-modal-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .amp-preview-modal-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .amp-preview-modal-icon-img {\n width: 16px;\n height: 16px;\n color: #718096;\n }\n\n .amp-preview-modal-title {\n font-weight: 600;\n color: #1a202c;\n font-size: 14px;\n white-space: nowrap;\n max-width: 300px;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* Base badge styles */\n .amp-preview-modal-badge {\n background-color: #ffffff;\n color: #4a5568;\n padding: 4px 8px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n display: flex;\n align-items: center;\n gap: 6px;\n border: 1px solid #e2e8f0;\n }\n\n .amp-preview-modal-preview-badge {\n color: #718096;\n }\n\n .amp-preview-modal-preview-icon {\n width: 14px;\n height: 14px;\n color: currentColor;\n }\n\n .amp-preview-modal-variant-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #68d391;\n flex-shrink: 0;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n border-radius: 6px;\n color: #a0aec0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 18px;\n line-height: 1;\n width: 24px;\n height: 24px;\n transition: all 0.2s ease;\n align-self: flex-start;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #f7fafc;\n color: #718096;\n }\n\n .amp-preview-modal-close:focus {\n outline: 2px solid #3182ce;\n outline-offset: 1px;\n }\n\n /* Dark mode support */\n @media (prefers-color-scheme: dark) {\n .amp-preview-modal {\n background-color: #2d3748;\n border-color: #4a5568;\n color: #e2e8f0;\n }\n\n .amp-preview-modal-title {\n color: #f7fafc;\n }\n\n .amp-preview-modal-badge {\n background-color: #2d3748;\n color: #e2e8f0;\n border-color: #4a5568;\n }\n\n .amp-preview-modal-preview-badge {\n color: #a0aec0;\n }\n\n .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n color: #718096;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #4a5568;\n color: #e2e8f0;\n }\n }\n ",document.head.appendChild(e)}},e}();function Nr(e){var t=new Ar(e),r=!1,n=!1,i=function(){r&&n&&t.show()};return"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(){r=!0,i()})):r=!0,setTimeout((function(){n=!0,i()}),500),t}var jr={observerOptions:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]},debounceMs:150},Vr=function(){function e(r,n,i,s){void 0===i&&(i=[]),void 0===s&&(s={});var l=this;this.mutationObserver=null,this.pendingMutations=[],this.processMutationsImmediately=function(){if(l.mutationObserver)try{l.pendingMutations.length>0&&l.onMutations(l.pendingMutations)}catch(e){}finally{l.pendingMutations=[]}},this.handleMutations=function(t){var r,n;try{var i=t.filter((function(e){return l.shouldProcessMutation(e)}));if(0===i.length)return;if(l.pendingMutations.length+i.length>e.MAX_PENDING_MUTATIONS)return(r=l.pendingMutations).push.apply(r,a([],o(i),!1)),l.processMutationsDebounced.cancel(),void l.processMutationsImmediately();(n=l.pendingMutations).push.apply(n,a([],o(i),!1)),l.processMutationsDebounced()}catch(e){}},this.target=r,this.onMutations=n,this.filters=i,this.options=t(t({},jr),s),this.processMutationsDebounced=function(e,t,r){void 0===r&&(r={});var n=null,i=null,s=function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];r.maxWait&&!i&&(i=setTimeout((function(){n&&(clearTimeout(n),n=null),i=null,e.apply(void 0,a([],o(s),!1))}),r.maxWait)),n&&clearTimeout(n),n=setTimeout((function(){i&&(clearTimeout(i),i=null),e.apply(void 0,a([],o(s),!1))}),t)};return s.cancel=function(){n&&clearTimeout(n),i&&clearTimeout(i),n=null,i=null},s}(this.processMutationsImmediately,this.options.debounceMs,{maxWait:2*this.options.debounceMs})}return e.prototype.shouldProcessMutation=function(e){if(0===this.filters.length)return!0;try{return this.filters.every((function(t){return t(e)}))}catch(e){return!1}},e.prototype.cleanup=function(){var e;this.processMutationsDebounced.cancel(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.pendingMutations=[],this.mutationObserver=null},e.prototype.observe=function(){var e=this;return this.mutationObserver&&this.cleanup(),this.mutationObserver=new MutationObserver(this.handleMutations),this.mutationObserver.observe(this.target,this.options.observerOptions),function(){e.cleanup()}},e.MAX_PENDING_MUTATIONS=1e3,e}(),Tr=new J,Lr=function(e,r,n,a,s){var l=this;this.pageChangeSubscribers=new Set,this.lastNotifiedActivePages={},this.setPageObjects=function(e){l.pageObjects=e},this.initSubscriptions=function(){l.options.useDefaultNavigationHandler&&l.setupLocationChangePublisher(),l.setupPageObjectSubscriptions()},this.addPageChangeSubscriber=function(e){return l.pageChangeSubscribers.add(e),function(){l.pageChangeSubscribers.delete(e)}},this.setupPageObjectSubscriptions=function(){var e,t,r=function(e,t){var r,n,o=function(t){l.messageBus.subscribe(t.trigger_type,(function(r){l.isPageObjectActive(t,r)?l.webExperimentClient.updateActivePages(e,t,!0):l.webExperimentClient.updateActivePages(e,t,!1)}),void 0,(function(e){var r,n;if(!("updateActivePages"in e&&e.updateActivePages||l.options.isVisualEditorMode)){if("url_change"===t.trigger_type){Object.values(l.webExperimentClient.appliedMutations).forEach((function(e){Object.values(e).forEach((function(e){e[On]&&Object.values(e[On]).forEach((function(e){var t;null===(t=e.revert)||void 0===t||t.call(e)}))}))}));var o=l.webExperimentClient.appliedMutations;Object.keys(o).forEach((function(e){var t=o[e];Object.keys(t).forEach((function(e){t[e][On]&&(delete t[e][On],0===Object.keys(t[e]).length&&delete t[e])})),0===Object.keys(t).length&&delete o[e]}))}l.webExperimentClient.applyVariants(),l.webExperimentClient.isPreviewMode&&l.webExperimentClient.previewVariants({keyToVariant:l.webExperimentClient.previewFlags})}var a=l.webExperimentClient.getActivePages();if(!l.areActivePagesEqual(a,l.lastNotifiedActivePages)){l.lastNotifiedActivePages=l.cloneActivePagesMap(a);try{for(var s=(r=void 0,i(l.pageChangeSubscribers)),u=s.next();!u.done;u=s.next())(0,u.value)({activePages:a})}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}))};try{for(var a=(r=void 0,i(Object.values(t))),s=a.next();!s.done;s=a.next())o(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}};try{for(var n=i(Object.entries(l.pageObjects)),a=n.next();!a.done;a=n.next()){var s=o(a.value,2);r(s[0],s[1])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},this.setupMutationObserverPublisher=function(){return new Vr(l.globalScope.document.documentElement,(function(e){l.messageBus.publish("element_appeared",{mutationList:e})}),[]).observe()},this.setupLocationChangePublisher=function(){l.globalScope.addEventListener("popstate",(function(){l.messageBus.publish("url_change")}));var e,t,r=function(){l.messageBus.publish("url_change"),l.globalScope.webExperiment.previousUrl=l.globalScope.location.href};e=history.pushState,t=history.replaceState,history.pushState=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=e.apply(this,t);return r(),i},history.replaceState=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t.apply(this,e);return r(),i}},this.isPageObjectActive=function(e,t){if(e.conditions&&e.conditions.length>0&&!Tr.evaluateConditions({context:{page:{url:l.globalScope.location.href}},result:{}},e.conditions))return!1;switch(e.trigger_type){case"url_change":return!0;case"manual":return t.name===e.trigger_value.name;case"analytics_event":var r=t;return r.event_type===e.trigger_value.event_type&&Object.entries(e.trigger_value.event_properties||{}).every((function(e){var t=o(e,2),n=t[0],i=t[1];return r.event_properties[n]===i}));case"element_appeared":var n=l.globalScope.document.querySelector(e.trigger_value.selector);if(n){var i=window.getComputedStyle(n);return"none"!==i.display&&"hidden"!==i.visibility}return!1;default:return!1}},this.cloneActivePagesMap=function(e){var r={};for(var n in e)for(var i in r[n]={},e[n])r[n][i]=t({},e[n][i]);return r},this.areActivePagesEqual=function(e,t){var r,n,o,a,s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;try{for(var u=i(s),c=u.next();!c.done;c=u.next()){var d=c.value,p=e[d],f=t[d];if(!f)return!1;var h=Object.keys(p),v=Object.keys(f);if(h.length!==v.length)return!1;try{for(var g=(o=void 0,i(h)),m=g.next();!m.done;m=g.next()){var y=m.value,b=p[y],w=f[y];if(!w||b.id!==w.id)return!1}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!0},this.webExperimentClient=e,this.messageBus=r,this.pageObjects=n,this.options=a,this.globalScope=s},Ur={useDefaultNavigationHandler:!0},Fr=function(){var e=ye();if(!(null==e?void 0:e.document.getElementById("amp-exp-css"))){var t=document.createElement("style");t.id="amp-exp-css",t.innerText="* { visibility: hidden !important; background-image: none !important; }",document.head.appendChild(t),null==e||e.window.setTimeout((function(){t.remove()}),1e3)}},Rr="AMP",Dr="dclid",Br="fbclid",Kr="gbraid",qr="gclid",zr="ko_click_id",Wr="li_fat_id",Jr="msclkid",Hr="rtd_cid",Xr="ttclid",$r="twclid",Gr="wbraid",Qr={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Zr="MKTG",Yr=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},en=function(){var e,t=Yr();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var r=t.split("=",2),n=tn(r[0]),i=tn(r[1]);return i?(e[n]=i,e):e}),{}):{}},tn=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},rn=function(){function e(e){this.options=t({},e)}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:if(!Yr())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),r="AMP_TEST",n.label=1;case 1:return n.trys.push([1,4,5,7]),[4,t.set(r,e.testValue)];case 2:return n.sent(),[4,t.get(r)];case 3:return[2,n.sent()===e.testValue];case 4:return n.sent(),[2,!1];case 5:return[4,t.remove(r)];case 6:return n.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){var t;return r(this,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(!(r=n.sent()))return[2,void 0];try{return void 0===(i=null!==(t=nn(r))&&void 0!==t?t:on(r))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]):[2,JSON.parse(i)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,i;return r(this,void 0,void 0,(function(){var r,o,a;return n(this,(function(n){return r=Yr(),o=null!==(i=null===(t=null==r?void 0:r.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==i?i:[],(a=o.find((function(t){return 0===t.indexOf(e+"=")})))?[2,a.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){var r,o,a,s,l,u,c;return n(this,(function(n){try{r=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,a=void 0,(o=null!==t?r:-1)&&((s=new Date).setTime(s.getTime()+24*o*60*60*1e3),a=s),l="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),a&&(l+="; expires=".concat(a.toUTCString())),l+="; path=/",this.options.domain&&(l+="; domain=".concat(this.options.domain)),this.options.secure&&(l+="; Secure"),this.options.sameSite&&(l+="; SameSite=".concat(this.options.sameSite)),(u=Yr())&&(u.document.cookie=l)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))},e}(),nn=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},on=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},an=function(){function e(){}return e.prototype.parse=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,t(t(t(t({},Qr),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=en();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=en();return(e={})[Dr]=t[Dr],e[Br]=t[Br],e[Kr]=t[Kr],e[qr]=t[qr],e[zr]=t[zr],e[Wr]=t[Wr],e[Jr]=t[Jr],e[Hr]=t[Hr],e[Xr]=t[Xr],e[$r]=t[$r],e[Gr]=t[Gr],e},e}(),sn=function(e,t){var r;try{var n=null===(r=cn(e))||void 0===r?void 0:r.getItem(t);return n?JSON.parse(n):null}catch(t){return console.warn("Failed to get and parse JSON from ".concat(e,":"),t),null}},ln=function(e,t,r){var n;try{var i=JSON.stringify(r);null===(n=cn(e))||void 0===n||n.setItem(t,i)}catch(t){console.warn("Failed to stringify and set JSON in ".concat(e,":"),t)}},un=function(e,t){var r;try{null===(r=cn(e))||void 0===r||r.removeItem(t)}catch(t){console.warn("Failed to remove item from ".concat(e,":"),t)}},cn=function(e){var t=ye();return t?t[e]:null};function dn(e,a){return r(this,void 0,void 0,(function(){var r,s,l,u,c,d,p,f,h,v,g,m,y,b,w,x,S,k,E;return n(this,(function(n){switch(n.label){case 0:return r="EXP_".concat(Zr,"_").concat(e.substring(0,10)),[4,pn(e)];case 1:s=o.apply(void 0,[n.sent(),2]),l=s[0],u=s[1],c=sn("localStorage",r),d={},p=[u,c,l];try{for(f=i(p),h=f.next();!h.done;h=f.next())if(v=h.value)try{for(k=void 0,g=i(Object.entries(v)),m=g.next();!m.done;m=g.next())y=o(m.value,2),b=y[0],w=y[1],b.startsWith("utm_")&&void 0!==w&&(d[b]=w)}catch(e){k={error:e}}finally{try{m&&!m.done&&(E=g.return)&&E.call(g)}finally{if(k)throw k.error}}}catch(e){x={error:e}}finally{try{h&&!h.done&&(S=f.return)&&S.call(f)}finally{if(x)throw x.error}}return Object.keys(d).length>0?(function(e,t){var r="EXP_".concat(Zr,"_").concat(e.substring(0,10));ln("localStorage",r,t)}(e,d),[2,t(t({},a),{persisted_url_param:d})]):[2,a]}}))}))}function pn(e){return r(this,void 0,void 0,(function(){var t,r,i,o;return n(this,(function(n){switch(n.label){case 0:return t=new rn,r=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[Rr,t,e.substring(0,r)].filter(Boolean).join("_")}(e,Zr),[4,(new an).parse()];case 1:return i=n.sent(),[4,t.get(r)];case 2:return o=n.sent(),[2,[i,o]]}}))}))}var fn,hn="amp-exp-loading",vn=function(){if(!document.getElementById(hn)){var e=document.createElement("div");e.id=hn,fn=setTimeout((function(){gn()}),1e4),e.innerHTML="\n <style>\n #".concat(hn," {\n position: fixed;\n inset: 0;\n background: rgba(33, 33, 36, 0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 2147483647;\n }\n\n #").concat(hn," .modal {\n background: white;\n border-radius: 8px;\n padding: 32px 48px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n }\n\n #").concat(hn," .spinner {\n width: 32px;\n height: 32px;\n border: 3px solid #e5e7eb;\n border-top-color: ").concat("#1e61f0",";\n border-radius: 50%;\n animation: amp-spin 1s linear infinite;\n }\n\n @keyframes amp-spin {\n to { transform: rotate(360deg); }\n }\n\n #").concat(hn,' .text {\n color: #212124;\n font-size: 16px;\n font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n }\n </style>\n\n <div class="modal">\n <div class="spinner"></div>\n <div class="text">Loading Visual Editor</div>\n </div>\n ');var t=function(){document.getElementById(hn)||void 0===fn||document.body.appendChild(e)};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}},gn=function(){var e;fn&&(clearTimeout(fn),fn=void 0),null===(e=document.getElementById(hn))||void 0===e||e.remove()},mn="visual-editor-state",yn=function(){function e(){}return e.setup=function(){var t,r="closed",n=e.getStoredSession();if(n)return r="opening",vn(),void bn(n.injectSrc).then((function(){r="open"})).catch((function(e){console.warn("Failed to load overlay from stored session:",e),r="closed",gn()}));null===(t=ye())||void 0===t||t.addEventListener("message",(function(e){var t=/^.*\.amplitude\.com$/;try{if(!e.origin||!t.test(new URL(e.origin).hostname))return}catch(e){return}if("OpenOverlay"===e.data.type){var n=new URL(e.data.context.injectSrc);if("closed"!==r||"https:"!==n.protocol||!t.test(n.hostname))return;r="opening",vn(),bn(e.data.context.injectSrc).then((function(){r="open"})).catch((function(){r="closed",gn()}))}}))},e.getStoredSession=function(){var e=sn("sessionStorage",mn);if(!e)return null;try{var t=new URL(e.injectSrc);if("https:"!==t.protocol||!/^.*\.amplitude\.com$/.test(t.hostname))return null}catch(e){return null}return e},e}(),bn=function(e){return new Promise((function(t,r){var n=function(){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e;var o=document.querySelector("[nonce]");o&&i.setAttribute("nonce",o.nonce||o.nonce||o.getAttribute("nonce")),i.addEventListener("load",(function(){t({status:!0})}),{once:!0}),i.addEventListener("error",(function(){r({status:!1,message:"Failed to load the script ".concat(e)})})),null===(n=document.head)||void 0===n||n.appendChild(i)}catch(e){r(e)}};"complete"===document.readyState?n():window.addEventListener("load",n,{once:!0})}))},wn=function(){var e,t,r=ye(),n=new URLSearchParams(null==r?void 0:r.location.search),a={};try{for(var s=i(n),l=s.next();!l.done;l=s.next()){var u=o(l.value,2),c=u[0],d=u[1];a[c]=d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return a},xn=function(e){if(!e)return"";var t=new URL(e);return t.search="",t.hash="",t.toString()},Sn=function(e,t){var r,n,o=new URL(e);try{for(var a=i(t),s=a.next();!s.done;s=a.next()){var l=s.value;o.searchParams.delete(l)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o.toString()},kn=function(e,t){return t=t.replace(/\/$/,""),e.some((function(e){e=(e=(e=e.replace(/\/$/,"")).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).replace(/\\\*/,".*");var r=new RegExp("^".concat(e,"$"));return r.test(t)||r.test(t+"/")}))},En=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,En)},Cn="mutate",On="inject",Pn="PREVIEW",_n="amp-preview-mode",Mn="VISUAL_EDITOR";me.Experiment=It;var In=function(){function e(e,r,n,i){void 0===i&&(i={});var o,a=this;this.appliedInjections=new Set,this.appliedMutations={},this.previousUrl=void 0,this.urlExposureCache={},this.flagVariantMap={},this.localFlagKeys=[],this.remoteFlagKeys=[],this.isRemoteBlocking=!1,this.isRunning=!1,this.activePages={},this.isVisualEditorMode=!1,this.isPreviewMode=!1,this.previewFlags={};var s=ye();if(!s||!be())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=s,this.apiKey=e,this.initialFlags=JSON.parse(r),this.pageObjects=JSON.parse(n),this.config=t(t(t({},Ur),i),null!==(o=this.globalScope.experimentConfig)&&void 0!==o?o:{}),this.initialFlags.forEach((function(e){var t=e.key,r=e.variants,n=e.metadata,i=void 0===n?{}:n;a.flagVariantMap[t]={},Object.keys(r).forEach((function(e){a.flagVariantMap[t][e]=function(e){if(!e)return{};var t=void 0;e.metadata&&(t="string"==typeof e.metadata.experimentKey?e.metadata.experimentKey:void 0);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r}(r[e]),a.flagVariantMap[t][e].metadata={deliveryMethod:"web"}})),"local"!==i.evaluationMode&&a.remoteFlagKeys.push(t)}));var l=JSON.stringify(this.initialFlags);this.experimentClient=_t.initialize(this.apiKey,t({internalInstanceNameSuffix:"web",initialFlags:l,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var u=this.experimentClient.all();this.localFlagKeys=Object.keys(u).filter((function(e){var t,r;return"local"===(null===(r=null===(t=u[e])||void 0===t?void 0:t.metadata)||void 0===r?void 0:r.evaluationMode)})),this.messageBus=new Ir}return e.prototype.start=function(){return r(this,void 0,void 0,(function(){var e,r,a,s,l,u,c,d,p,f,h,v,g,m,y,b,w,x=this;return n(this,(function(n){switch(n.label){case 0:if(this.isRunning)return[2];if(HTMLElement.prototype.removeChild=function(e){return e&&e.parentNode!==this?e:Node.prototype.removeChild.call(this,e)},e=wn(),this.isVisualEditorMode="true"===e[Mn]||null!==sn("sessionStorage",mn),this.subscriptionManager=new Lr(this,this.messageBus,this.pageObjects,t(t({},this.config),{isVisualEditorMode:this.isVisualEditorMode}),this.globalScope),this.setupPreviewMode(e),this.subscriptionManager.initSubscriptions(),this.isVisualEditorMode)return yn.setup(),this.globalScope.history.replaceState({},"",Sn(this.globalScope.location.href,[Mn])),this.messageBus.publish("url_change",{updateActivePages:!0}),this.isRunning=!0,[2];this.messageBus.publish("url_change",{updateActivePages:!0}),r="EXP_".concat(this.apiKey.slice(0,10)),(a=sn("localStorage",r)||{}).web_exp_id?a.web_exp_id&&a.device_id&&(delete a.device_id,ln("localStorage",r,a)):(a.web_exp_id=a.device_id||En(),delete a.device_id,ln("localStorage",r,a)),s=this.getVariants();try{for(l=i(Object.entries(s)),u=l.next();!u.done;u=l.next())c=o(u.value,2),d=c[0],p=c[1],this.remoteFlagKeys.includes(d)&&(null===(m=p.metadata)||void 0===m?void 0:m.blockingEvaluation)&&Object.keys(this.activePages).includes(d)&&!this.remoteFlagKeys.every((function(e){return Object.keys(x.previewFlags).includes(e)}))&&(this.isRemoteBlocking=!0,Fr())}catch(e){v={error:e}}finally{try{u&&!u.done&&(g=l.return)&&g.call(l)}finally{if(v)throw v.error}}return[4,dn(this.apiKey,a)];case 1:return f=n.sent(),this.globalScope.experimentIntegration||(h=Ie.getInstance("$default_instance"),this.globalScope.experimentIntegration=new Je(this.apiKey,h,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(f),this.isRemoteBlocking||null===(w=null===(b=(y=this.globalScope.document).getElementById)||void 0===b?void 0:b.call(y,"amp-exp-css"))||void 0===w||w.remove(),this.applyVariants({flagKeys:this.localFlagKeys}),this.previewVariants({keyToVariant:this.previewFlags}),this.remoteFlagKeys.every((function(e){return Object.keys(x.previewFlags).includes(e)}))?(this.isRunning=!0,[2]):[4,this.fetchRemoteFlags()];case 2:return n.sent(),this.applyVariants({flagKeys:this.remoteFlagKeys}),this.isRunning=!0,[2]}}))}))},e.getInstance=function(t,r,n,i){void 0===i&&(i={});var o=ye();if(!o)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(null==o?void 0:o.webExperiment)return o.webExperiment;var a=new e(t,r,n,i);return o.webExperiment=a,a},e.prototype.getExperimentClient=function(){return this.experimentClient},e.prototype.hideLoadingIndicator=function(){gn()},e.prototype.applyVariants=function(e){var t,r,n=(e||{}).flagKeys,i=this.getVariants();if(0!==Object.keys(i).length){var o=xn(this.globalScope.location.href);for(var a in(null===(t=this.urlExposureCache)||void 0===t?void 0:t[o])||(this.urlExposureCache={},this.urlExposureCache[o]={}),this.fireStoredRedirectImpressions(),i)if(!(n&&!n.includes(a)||this.previewFlags[a])){var s=i[a],l=s.key||"";if(this.appliedMutations[a]){var u=Object.keys(this.appliedMutations[a]);u.length>0&&!u.includes(l)&&(this.revertVariants({flagKeys:[a]}),delete this.appliedMutations[a])}if("web"===(null===(r=s.metadata)||void 0===r?void 0:r.deliveryMethod)){var c=Array.isArray(s.payload);if(("off"===s.key||"control"===s.key)&&(this.isActionActiveOnPage(a,void 0)&&this.exposureWithDedupe(a,s),"off"===s.key)){this.revertVariants({flagKeys:[a]});continue}c&&this.handleVariantAction(a,s)}}}},e.prototype.revertVariants=function(e){var t,r,n,o;if(this.appliedMutations){var a=(e||{}).flagKeys;a||(a=Object.keys(this.appliedMutations));try{for(var s=i(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=this.appliedMutations[u];if(c){for(var d in c){var p=c[d];if(p)for(var f in p)for(var h in p[f])null===(o=null===(n=p[f][h])||void 0===n?void 0:n.revert)||void 0===o||o.call(n)}delete this.appliedMutations[u]}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}},e.prototype.previewVariants=function(e){var t=e.keyToVariant;if(t)for(var r in this.revertVariants({flagKeys:Object.keys(t)}),t){var n=t[r],i=this.flagVariantMap[r];if(!i)return;var o=i[n];if(!o)return;this.isPreviewMode&&(this.exposureWithDedupe(r,o,!0),Nr({flags:this.previewFlags}));var a=o.payload;if(!a||!Array.isArray(a))return;this.handleVariantAction(r,o)}},e.prototype.getVariants=function(){var e,t,r={};try{for(var n=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),s=n.next();!s.done;s=n.next()){var l=s.value;r[l]=this.experimentClient.variant(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},e.prototype.getActiveExperiments=function(){return Object.keys(this.appliedMutations)},e.prototype.getActivePages=function(){return this.activePages},e.prototype.addPageChangeSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addPageChangeSubscriber(e)},e.prototype.setPageObjects=function(e){var t,r;this.isVisualEditorMode&&(this.pageObjects=e,null===(t=this.subscriptionManager)||void 0===t||t.setPageObjects(e),this.activePages={},this.messageBus.unsubscribeAll(),null===(r=this.subscriptionManager)||void 0===r||r.initSubscriptions(),this.messageBus.publish("url_change",{updateActivePages:!0}))},e.prototype.setRedirectHandler=function(e){this.customRedirectHandler=e},e.prototype.fetchRemoteFlags=function(){return r(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.experimentClient.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn("Error fetching remote flags:",e),[3,3];case 3:return[2]}}))}))},e.prototype.handleVariantAction=function(e,t){var r,n;try{for(var o=i(t.payload),a=o.next();!a.done;a=o.next()){var s=a.value;"redirect"===s.action?this.handleRedirect(s,e,t):s.action===Cn?this.handleMutate(s,e,t):s.action===On&&this.handleInject(s,e,t)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},e.prototype.handleRedirect=function(e,t,i){var o,a,s;if(this.isActionActiveOnPage(t,null===(a=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.scope)){var l=xn(this.previousUrl||this.globalScope.document.referrer),u=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.url;if(xn(this.globalScope.location.href)!==l){var c=function(e,t){var r=new URL(e),n=new URL(t),i=new URL(t);return r.searchParams.forEach((function(e,t){n.searchParams.has(t)||i.searchParams.append(t,e)})),i.toString()}(this.globalScope.location.href,u);this.globalScope.location.href!==c&&(this.storeRedirectImpressions(t,i,u),this.previousUrl=this.globalScope.location.href,function(e){return r(this,void 0,void 0,(function(){var t,r,i,o;return n(this,(function(n){switch(n.label){case 0:return t=new rn({sameSite:"Lax"}),r=new an,i="AMP_".concat(Zr,"_ORIGINAL_").concat(e.substring(0,10)),[4,r.parse()];case 1:return o=n.sent(),[4,t.set(i,o)];case 2:return n.sent(),[2]}}))}))}(this.apiKey).then(),this.customRedirectHandler?this.customRedirectHandler(c):this.globalScope.location.replace(c))}}},e.prototype.handleMutate=function(e,r,n){var i,o,a,s,l,u=this,c=(null===(i=e.data)||void 0===i?void 0:i.mutations)||[],d=n.key||"";if(0!==c.length){var p={};c.forEach((function(e,t){var i,o,a,s,l,c,f,h,v,g,m;u.isActionActiveOnPage(r,null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.scope)?(u.exposureWithDedupe(r,n),(null===(m=null===(g=null===(v=u.appliedMutations[r])||void 0===v?void 0:v[d])||void 0===g?void 0:g[Cn])||void 0===m?void 0:m[t])||(p[t]=Mr.declarative(e))):(null===(s=null===(a=null===(o=u.appliedMutations[r])||void 0===o?void 0:o[d])||void 0===a?void 0:a[Cn])||void 0===s?void 0:s[t])&&(null===(h=null===(f=null===(c=null===(l=u.appliedMutations[r])||void 0===l?void 0:l[d])||void 0===c?void 0:c[Cn])||void 0===f?void 0:f[t])||void 0===h||h.revert(),delete u.appliedMutations[r][d][Cn][t])})),null!==(o=(s=this.appliedMutations)[r])&&void 0!==o||(s[r]={}),null!==(a=(l=this.appliedMutations[r])[d])&&void 0!==a||(l[d]={}),this.appliedMutations[r][d][Cn]=t(t({},this.appliedMutations[r][d][Cn]),p),0===Object.keys(this.appliedMutations[r][d][Cn]||{}).length&&delete this.appliedMutations[r][d][Cn],0===Object.keys(this.appliedMutations[r][d]||{}).length&&delete this.appliedMutations[r]}},e.prototype.handleInject=function(e,t,i){var o,a,s,l,u,c,d,p,f,h,v,g,m=this,y=i.key||"";if(this.isActionActiveOnPage(t,null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.scope)){var b=e.data.id;if(b&&"string"==typeof b&&0!==b.length&&(b=b.replace(/-/g,""),!this.appliedInjections.has(b))){var w,x=e.data.js;x&&(w=this.globalScope.document.createElement("script"))&&(w.innerHTML="function ".concat(b,"(html, utils, id){").concat(x,"};"),w.id="js-".concat(b),this.globalScope.document.head.appendChild(w));var S,k=e.data.css;k&&(S=this.globalScope.document.createElement("style"))&&(S.innerHTML=k,S.id="css-".concat(b),this.globalScope.document.head.appendChild(S));var E,C=e.data.html;C&&(E=null!==(c=(new DOMParser).parseFromString(C,"text/html").body.firstElementChild)&&void 0!==c?c:void 0);var O={cancelled:!1},P=function(e){return{waitForElement:function(t){return r(this,void 0,void 0,(function(){var r,i,o;return n(this,(function(n){return r=void 0,(o=(i=function(){if(!e.cancelled)return document.querySelector(t);null==r||r.disconnect()})())?[2,o]:[2,new Promise((function(e){r=new MutationObserver((function(){var t=i();t&&(null==r||r.disconnect(),e(t))})),r.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}))]}))}))},insertElement:function(t,r,n){return new Promise((function(i){var o=0,a=void 0,s=function(){if(e.cancelled)null==a||a.disconnect();else if(!(t.isConnected&&t.ownerDocument===document||o>=10)){o++,setTimeout((function(){return o--}),1e3);var s=document.querySelector(r.parentSelector);if(s){var l=r.insertBeforeSelector?s.querySelector(r.insertBeforeSelector):null;r.insertBeforeSelector&&!l||(s.insertBefore(t,l),null==n||n(),i())}}};s(),(a=new MutationObserver(s)).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}))}}}(O);this.appliedInjections.add(b);try{var _=this.globalScope[b];_&&"function"==typeof _&&_(E,P,b)}catch(e){null==w||w.remove(),console.error("Experiment inject failed for ".concat(t," variant ").concat(i.key,". Reason:"),e)}null!==(d=(h=this.appliedMutations)[t])&&void 0!==d||(h[t]={}),null!==(p=(v=this.appliedMutations[t])[y])&&void 0!==p||(v[y]={}),null!==(f=(g=this.appliedMutations[t][y])[On])&&void 0!==f||(g[On]={}),this.appliedMutations[t][y][On][b]={revert:function(){var e;O.cancelled=!0,null===(e=P.remove)||void 0===e||e.call(P),null==S||S.remove(),null==w||w.remove(),m.appliedInjections.delete(b)}},this.exposureWithDedupe(t,i)}}else null===(u=null===(l=null===(s=null===(a=this.appliedMutations[t])||void 0===a?void 0:a[y])||void 0===s?void 0:s[On])||void 0===l?void 0:l[0])||void 0===u||u.revert()},e.prototype.exposureWithDedupe=function(e,t,r){var n,i,o,a,s=xn(this.globalScope.location.href);if(!((null===(i=null===(n=this.urlExposureCache)||void 0===n?void 0:n[s])||void 0===i?void 0:i[e])===t.key)){if(r){var l={variant:t,source:"local-evaluation",hasDefaultVariant:!1};this.experimentClient.exposureInternal(e,l)}else this.experimentClient.exposure(e);(null!==(o=(a=this.urlExposureCache)[s])&&void 0!==o?o:a[s]={})[e]=t.key}},e.prototype.updateActivePages=function(e,t,r){this.activePages[e]||(this.activePages[e]={}),r?this.activePages[e][t.id]=t:(delete this.activePages[e][t.id],0===Object.keys(this.activePages[e]).length&&delete this.activePages[e])},e.prototype.isActionActiveOnPage=function(e,t){var r=this.activePages[e];return t?t.some((function(e){var t;return null!==(t=null==r?void 0:r[e])&&void 0!==t&&t})):!!r&&Object.values(r).some(Boolean)},e.prototype.storeRedirectImpressions=function(e,t,r){var n="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),i=sn("sessionStorage",n)||{};i[e]={redirectUrl:r,variant:t},ln("sessionStorage",n,i)},e.prototype.fireStoredRedirectImpressions=function(){var e=this,t="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),r=sn("sessionStorage",t)||{};if(Object.keys(r).length>0)for(var n in r){var i=r[n],o=i.redirectUrl,a=i.variant,s=xn(this.globalScope.location.href),l=xn(o);kn([s],l)&&(this.exposureWithDedupe(n,a,!0),delete r[n])}Object.keys(r).length>0?this.globalScope.setTimeout((function(){var r=sn("sessionStorage",t)||{};for(var n in r)e.exposureWithDedupe(n,r[n].variant,!0);un("sessionStorage",t)}),500):un("sessionStorage",t)},e.prototype.setupPreviewMode=function(e){var t=this;if("true"===e[Pn]){Object.keys(e).forEach((function(r){r!==Pn&&e[r]&&(t.previewFlags[r]=e[r])})),ln("sessionStorage",_n,{previewFlags:this.previewFlags});var r=a(a([],o(Object.keys(this.previewFlags)),!1),[Pn],!1);this.globalScope.history.replaceState({},"",Sn(this.globalScope.location.href,r)),yn.setup()}else{var n=sn("sessionStorage",_n);n&&(this.previewFlags=n.previewFlags)}Object.keys(this.previewFlags).length>0&&(this.isPreviewMode=!0)},e}();var An=me.fetch||function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))},Nn={request:function(e,t,i,o,a){return r(void 0,void 0,void 0,(function(){var s;return n(this,(function(l){return s=function(){return r(void 0,void 0,void 0,(function(){var r,a;return n(this,(function(n){switch(n.label){case 0:return[4,An(e,{method:t,headers:i,body:o})];case 1:return r=n.sent(),a={status:r.status},[4,r.text()];case 2:return[2,(a.body=n.sent(),a)]}}))}))},[2,(u=s(),c=a,!c||c<=0?u:Promise.race([u,new Promise((function(e,t){return setTimeout((function(){return t(new he("Timeout after ".concat(c,"ms")))}),c)}))]))];var u,c}))}))}},jn=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getPreviewFlagsAndPageViewObjects=function(){return r(this,void 0,void 0,(function(){var e,t,r,i;return n(this,(function(n){switch(n.label){case 0:return(e={Authorization:"Api-Key ".concat(this.deploymentKey)})["X-Amp-Exp-Library"]="experiment-tag/".concat("0.15.2"),[4,this.httpClient.request("".concat(this.serverUrl,"/web/v1/configs"),"GET",e,null,1e4)];case 1:if(200!=(t=n.sent()).status)throw Error("Preview error response: status=".concat(t.status));return r=JSON.parse(t.body).flags,i=JSON.parse(t.body).pageObjects,[2,{flags:r,pageViewObjects:i}]}}))}))},e}(),Vn=function(e,t,r,n){In.getInstance(e,t,r,n).start().finally((function(){var e;null===(e=document.getElementById("amp-exp-css"))||void 0===e||e.remove()}))},Tn=function(e,t){return r(void 0,void 0,void 0,(function(){return n(this,(function(r){return[2,new jn(e,"EU"===t?"https://api.lab.eu.amplitude.com":"https://api.lab.amplitude.com",Nn).getPreviewFlagsAndPageViewObjects()]}))}))};return e.initialize=function(e,t,r,n){var i;(function(){if("true"===wn()[Pn])return!0;var e=sn("sessionStorage",_n);return!!((null==e?void 0:e.previewFlags)&&Object.keys(e.previewFlags).length>0)})()||(null===(i=ye())||void 0===i?void 0:i.WebExperiment.injectedByExtension)?(Fr(),Tn(e,n.serverZone).then((function(t){var r=JSON.stringify(t.flags),i=JSON.stringify(t.pageViewObjects);Vn(e,r,i,n)})).catch((function(i){console.warn("Failed to fetch latest configs for preview:",i),Vn(e,t,r,n)}))):Vn(e,t,r,n)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/experiment-tag",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "Amplitude Experiment Javascript Snippet",
5
5
  "author": "Amplitude",
6
6
  "homepage": "https://github.com/amplitude/experiment-js-client",
@@ -30,7 +30,7 @@
30
30
  "@amplitude/analytics-core": "^2.21.0",
31
31
  "@amplitude/experiment-core": "^0.12.0",
32
32
  "@amplitude/experiment-js-client": "^1.20.3",
33
- "dom-mutator": "git+ssh://git@github.com:amplitude/dom-mutator#ef95c531a822bce55c197a6bf5e1d86d03bc086c",
33
+ "dom-mutator": "git+ssh://git@github.com:amplitude/dom-mutator#0294e723c6a8f85d448bdfa59999591f2ae9e476",
34
34
  "rollup-plugin-license": "^3.6.0"
35
35
  },
36
36
  "devDependencies": {
@@ -41,5 +41,5 @@
41
41
  "files": [
42
42
  "dist"
43
43
  ],
44
- "gitHead": "7fcd5b96a00f868bbf075f2103f1c78066c380af"
44
+ "gitHead": "664770b9341d179c7ef25bea0c31dc33607a441f"
45
45
  }