@amplitude/experiment-tag 0.23.3 → 0.23.4

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.23.3 - For license info see https://unpkg.com/@amplitude/experiment-tag@0.23.3/files/LICENSE */
1
+ /* @amplitude/experiment-tag v0.23.4 - For license info see https://unpkg.com/@amplitude/experiment-tag@0.23.4/files/LICENSE */
2
2
  !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 c=function(){return c=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},c.apply(this,arguments)};function u(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 f(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 v(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 p(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 h="is",g="is not",y="contains",m="does not contain",b="less",w="less or equal",S="greater",x="greater or equal",k="version less",E="version less or equal",_="version greater",O="version greater or equal",A="set is",T="set is not",C="set contains",P="set does not contain",M="set contains any",I="set does not contain any",j="regex match",N="regex does not match",V=-862048943,L=461845907,D=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=R(n,a<<2);o=U(s,o)}var l=i<<2,c=0;switch(r-l){case 3:c^=n[l+2]<<16,c^=n[l+1]<<8,c^=n[l],c=Math.imul(c,V),c=F(c,15),o^=c=Math.imul(c,L);break;case 2:c^=n[l+1]<<8,c^=n[l],c=Math.imul(c,V),c=F(c,15),o^=c=Math.imul(c,L);break;case 1:c^=n[l],c=Math.imul(c,V),c=F(c,15),o^=c=Math.imul(c,L)}return B(o^=r)>>>0},U=function(e,t){var n=e,r=t;return n=Math.imul(n,V),n=F(n,15),n=Math.imul(n,L),r=F(r^=n,13),(r=Math.imul(r,5))+-430675100|0},B=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},F=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},R=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=f(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}},W="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),z=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(W).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=f(t),s=a.next();!s.done;s=a.next()){var l=s.value,c=this.evaluateFlag(o,l);c&&(i[l.key]=c)}}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.evaluateWithTraces=function(e,t){var n,r,i={},o={},a={context:e,result:i};try{for(var s=f(t),l=s.next();!l.done;l=s.next()){var c=l.value,u=this.evaluateFlagWithTrace(a,c),d=u.variant,v=u.trace;d&&(i[c.key]=d),o[c.key]=v}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return{results:i,traces:o}},e.prototype.evaluateFlag=function(e,t){var n,r,i;try{for(var o=f(t.segments),a=o.next();!a.done;a=o.next()){var s=a.value;if(i=this.evaluateSegment(e,t,s)){var l=c(c(c({},t.metadata),s.metadata),i.metadata);i=c(c({},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.evaluateFlagWithTrace=function(e,t){var n,r,i,o,a,s,l,u,d,v,p,h=[];try{for(var g=f(t.segments),y=g.next();!y.done;y=g.next()){var m=y.value;if(m.conditions){var b=[],w=!1;try{for(var S=(i=void 0,f(m.conditions)),x=S.next();!x.done;x=S.next()){var k=x.value,E=!0,_=[];try{for(var O=(a=void 0,f(k)),A=O.next();!A.done;A=O.next()){var T=A.value,C=q(e,T.selector),P=this.matchCondition(e,T);if(_.push({propValue:C,condition:T,matched:P}),!P){E=!1;break}}}catch(e){a={error:e}}finally{try{A&&!A.done&&(s=O.return)&&s.call(O)}finally{if(a)throw a.error}}if(b.push(_),E){w=!0;break}}}catch(e){i={error:e}}finally{try{x&&!x.done&&(o=S.return)&&o.call(S)}finally{if(i)throw i.error}}var M=!1,I=void 0;w&&(M=void 0!==(I=this.bucket(e,m))),h.push({segmentMetadata:m.metadata,conditionsPassed:w,bucketed:M,bucketVariant:I,conditionResult:b,matched:w&&M}),w&&void 0!==I&&!d&&(d=t.variants[I],v=m,p=null===(u=m.metadata)||void 0===u?void 0:u.segmentName)}else{var j=this.bucket(e,m),N=void 0!==j;h.push({segmentMetadata:m.metadata,conditionsPassed:!0,bucketed:N,bucketVariant:j,conditionResult:void 0,matched:N}),d||void 0===j||(d=t.variants[j],v=m,p=null===(l=m.metadata)||void 0===l?void 0:l.segmentName)}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}if(d&&v){var V=c(c(c({},t.metadata),v.metadata),d.metadata);d=c(c({},d),{metadata:V})}return{variant:d,trace:{flagKey:t.key,matched:void 0!==d,matchedSegment:p,steps:h}}},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=f(t),s=a.next();!s.done;s=a.next()){var l=s.value,c=!0;try{for(var u=(i=void 0,f(l)),d=u.next();!d.done;d=u.next()){var v=d.value;if(!(c=this.matchCondition(e,v)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}if(c)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);var r=this.coerceStringArray(n);if(this.isSetOperator(t.op))return!!r&&this.matchSet(r,t.op,t.values);if(r)return this.matchStringsNonSet(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 D(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),c=l%100,u=Math.floor(l/100);try{for(var d=f(t.bucket.allocations),v=d.next();!v.done;v=d.next()){var p=v.value,h=p.range[0],g=p.range[1];if(c>=h&&c<g)try{for(var y=(i=void 0,f(p.distributions)),m=y.next();!m.done;m=y.next()){var b=m.value,w=b.range[0],S=b.range[1];if(u>=w&&u<S)return b.variant}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{v&&!v.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 h:case y:case b:case w:case S:case x:case k:case E:case _:case O:case A:case C:case M:return n;case g:case m:case P:case I:return!n;default:return!1}},e.prototype.matchSet=function(e,t,n){switch(t){case A:return this.setEquals(e,n);case T:return!this.setEquals(e,n);case C:return this.matchesSetContainsAll(e,n);case P:return!this.matchesSetContainsAll(e,n);case M:return this.matchesSetContainsAny(e,n);case I:return!this.matchesSetContainsAny(e,n);default:return!1}},e.prototype.matchString=function(e,t,n){var r=this;switch(t){case h:return this.matchesIs(e,n);case g:return!this.matchesIs(e,n);case y:return this.matchesContains(e,n);case m:return!this.matchesContains(e,n);case b:case w:case S:case x:return this.matchesComparable(e,t,n,function(e){return r.parseNumber(e)},this.comparator);case k:case E:case _:case O:return this.matchesComparable(e,t,n,function(e){return z.parse(e)},this.versionComparator);case j:return this.matchesRegex(e,n);case N:return!this.matchesRegex(e,n);default:return!1}},e.prototype.matchStringsNonSet=function(e,t,n){var r=this;return e.some(function(e){return r.matchString(e,t,n)})},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=f(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 S:case _:return e>n;case x: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 S:case _:return r>0;case x: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);if(n.startsWith("["))try{var r=JSON.parse(n);return Array.isArray(r)?r.map(function(e){return t.coerceString(e)}).filter(Boolean):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case A:case T:case C:case P:case M:case I: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&&p([],v(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=f(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=f(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){var n,r,i=c({},e),o=[],a=t||Object.keys(i);try{for(var s=f(a),l=s.next();!l.done;l=s.next()){var u=l.value,d=G(u,i);d&&o.push.apply(o,p([],v(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},G=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=G(e,t,n);r&&a.push.apply(a,p([],v(r),!1))};try{for(var l=f(o.dependencies),c=l.next();!c.done;c=l.next()){s(c.value)}}catch(e){r={error:e}}finally{try{c&&!c.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,Q=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),$=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Z=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})($),Y=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ee=String.fromCharCode.bind(String),te=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),ne=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),re=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+=$[t>>18&63]+$[t>>12&63]+$[t>>6&63]+$[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},ie="function"==typeof btoa?e=>btoa(e):X?e=>Buffer.from(e,"binary").toString("base64"):re,oe=X?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(ee.apply(null,e.subarray(n,n+4096)));return ie(t.join(""))},ae=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?ee(192|t>>>6)+ee(128|63&t):ee(224|t>>>12&15)+ee(128|t>>>6&63)+ee(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return ee(240|t>>>18&7)+ee(128|t>>>12&63)+ee(128|t>>>6&63)+ee(128|63&t)},se=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,le=e=>e.replace(se,ae),ce=X?e=>Buffer.from(e,"utf8").toString("base64"):Q?e=>oe(Q.encode(e)):e=>ie(le(e)),ue=(e,t=!1)=>t?te(ce(e)):ce(e),de=e=>ue(e,!0),fe=e=>{if(e=e.replace(/\s+/g,""),!Y.test(e))throw new TypeError("malformed base64.");let t,n,r;e+="==".slice(2-(3&e.length));let i=[];for(let o=0;o<e.length;)t=Z[e.charAt(o++)]<<18|Z[e.charAt(o++)]<<12|(n=Z[e.charAt(o++)])<<6|(r=Z[e.charAt(o++)]),64===n?i.push(ee(t>>16&255)):64===r?i.push(ee(t>>16&255,t>>8&255)):i.push(ee(t>>16&255,t>>8&255,255&t));return i.join("")},ve=de;var pe=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),ge=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getVariants=function(e,t){return u(this,void 0,void 0,function(){var n,r,i,o;return d(this,function(a){switch(a.label){case 0:return n=ve(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"]=ve(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 pe(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),ye=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getFlags=function(e){return u(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"]=ve(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,be=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},we=function(){var e=be();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1},Se=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:ke(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ke=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ee=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}(),_e=function(){return _e=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},_e.apply(this,arguments)};function Oe(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 Ae(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 Te=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Oe(["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 c=Object.keys(e).sort(),u=Object.keys(t).sort();if(!Te(c,u))return!1;var d=!0;return Object.keys(e).forEach(function(n){Te(e[n],t[n])||(d=!1)}),d}for(var f=0;f<e.length;f++)if(!Te(e[f],t[f]))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 Ce=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=_e({},this.identity.userProperties),n=_e(_e({},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 c=Oe(Object.entries(e)),u=c.next();!u.done;u=c.next()){var d=Ae(u.value,2),f=d[0],v=d[1];switch(f){case"$set":try{for(var p=(i=void 0,Oe(Object.entries(v))),h=p.next();!h.done;h=p.next()){var g=Ae(h.value,2),y=g[0],m=g[1];l[y]=m}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(a=void 0,Oe(Object.keys(v))),w=b.next();!w.done;w=b.next()){delete l[y=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{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return n.userProperties=l,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return _e({},this.identity)},e.prototype.setIdentity=function(e){var t=_e({},this.identity);this.identity=_e({},e),Te(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}(),Pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Me=function(){function e(){this.identityStore=new Ce,this.eventBridge=new Ee,this.applicationContextProvider=new xe}return e.getInstance=function(t){return Pe.analyticsConnectorInstances||(Pe.analyticsConnectorInstances={}),Pe.analyticsConnectorInstances[t]||(Pe.analyticsConnectorInstances[t]=new e),Pe.analyticsConnectorInstances[t]},e}(),Ie="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var je,Ne,Ve,Le=(je=function(e,t){!function(n,r){var i="function",o="undefined",a="object",s="string",l="model",c="name",u="type",d="vendor",f="version",v="architecture",p="console",h="mobile",g="tablet",y="smarttv",m="wearable",b="embedded",w="Amazon",S="Apple",x="ASUS",k="BlackBerry",E="Browser",_="Chrome",O="Firefox",A="Google",T="Huawei",C="LG",P="Microsoft",M="Motorola",I="Opera",j="Samsung",N="Sharp",V="Sony",L="Xiaomi",D="Zebra",U="Facebook",B=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},F=function(e,t){return typeof e===s&&-1!==R(t).indexOf(R(e))},R=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,c,u,d=0;d<t.length&&!c;){var f=t[d],v=t[d+1];for(n=o=0;n<f.length&&!c;)if(c=f[n++].exec(e))for(s=0;s<v.length;s++)u=c[++o],typeof(l=v[s])===a&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,u):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=u?u.replace(l[1],l[2]):r:this[l[0]]=u?l[1].call(this,u,l[2]):r:4===l.length&&(this[l[0]]=u?l[3].call(this,u.replace(l[1],l[2])):r):this[l]=u||r;d+=2}},W=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(F(t[n][i],e))return"?"===n?r:n}else if(F(t[n],e))return"?"===n?r:n;return e},z={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],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,I+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,I]],[/(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],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+E],f],[/\bfocus\/([\w\.]+)/i],[f,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[f,[c,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+E],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,U],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,_+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,_+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,W,{"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],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,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],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[v,"amd64"]],[/(ia32(?=;))/i],[[v,R]],[/((?:i[346]|x)86)[;\)]/i],[[v,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[v,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[v,"armhf"]],[/windows (ce|mobile); ppc;/i],[[v,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[v,/ower/,"",R]],[/(sun4\w)[;\)]/i],[[v,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[v,R]]],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],[u,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,j],[u,h]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,S],[u,h]],[/(ipad\d+,\d+)/i],[l,[d,S],[u,g]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,S],[u,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,S],[u,g]],[/(macintosh);/i],[l,[d,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,T],[u,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,T],[u,h]],[/\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],[u,h]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,L],[u,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"],[u,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[u,h]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[u,h]],[/\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,M],[u,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,M],[u,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,C],[u,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],[u,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[u,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[u,h]],[/(pixel c)\b/i],[l,[d,A],[u,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,A],[u,h]],[/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],[u,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,V],[u,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[u,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[u,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[u,h]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[u,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,k],[u,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,x],[u,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,x],[u,h]],[/(nexus 9)/i],[l,[d,"HTC"],[u,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[u,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[u,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[u,h]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,N],[u,h]],[/(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,[u,h]],[/(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,[u,g]],[/(surface duo)/i],[l,[d,P],[u,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[u,h]],[/(u304aa)/i],[l,[d,"AT&T"],[u,h]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[u,h]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[u,g]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[u,g]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[u,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[u,g]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[u,g]],[/\b(k88) b/i],[l,[d,"ZTE"],[u,g]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[u,h]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[u,h]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[u,g]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[u,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[u,g]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[u,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[u,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[u,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[u,h]],[/\b(ph-1) /i],[l,[d,"Essential"],[u,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[u,g]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[u,g]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[u,g]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[u,g]],[/(sprint) (\w+)/i],[d,l,[u,h]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,P],[u,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,D],[u,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,D],[u,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[u,p]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[u,p]],[/(playstation [345portablevi]+)/i],[l,[d,V],[u,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,P],[u,p]],[/smart-tv.+(samsung)/i],[d,[u,y]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,j],[u,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,C],[u,y]],[/(apple) ?tv/i],[d,[l,S+" TV"],[u,y]],[/crkey/i],[[l,_+"cast"],[d,A],[u,y]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[u,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,N],[u,y]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,V],[u,y]],[/(mitv-\w{5}) bui/i],[l,[d,L],[u,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,K],[l,K],[u,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,y]],[/((pebble))app/i],[d,l,[u,m]],[/droid.+; (glass) \d/i],[l,[d,A],[u,m]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,D],[u,m]],[/(quest( 2)?)/i],[l,[d,U],[u,m]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[u,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[u,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[u,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,h]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"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],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,W,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,W,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,_+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],f],[/(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],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,f]]},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:""),p=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[c]=r,e[f]=r,q.call(e,i,p.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[v]=r,q.call(e,i,p.cpu),e},this.getDevice=function(){var e={};return e[d]=r,e[l]=r,e[u]=r,q.call(e,i,p.device),e},this.getEngine=function(){var e={};return e[c]=r,e[f]=r,q.call(e,i,p.engine),e},this.getOS=function(){var e={};return e[c]=r,e[f]=r,q.call(e,i,p.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=B([c,f,"major"]),H.CPU=B([v]),H.DEVICE=B([l,d,u,p,h,y,g,m,b]),H.ENGINE=H.OS=B([c,f]),e.exports&&(t=e.exports=H),t.UAParser=H;var G=typeof n!==o&&(n.jQuery||n.Zepto);if(G&&!G.ua){var X=new H;G.ua=X.getResult(),G.ua.get=function(){return X.getUA()},G.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var n in t)G.ua[n]=t[n]}}}("object"==typeof window?window:Ie)},je(Ve={path:Ne,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),De=function(){function e(e){this.amplitudeInstance=e}return e.prototype.getUser=function(){var e,t,n,r,i,o,a,s,l,c;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===(c=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===c?void 0:c.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}(),Be=function(){return Be=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},Be.apply(this,arguments)};
3
- /* @amplitude/experiment-js-client v1.21.1 - For license info see https://app.unpkg.com/@amplitude/experiment-js-client@1.21.1/files/LICENSE */function Fe(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 Re(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 Ke(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 qe(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 We(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=Je(e,t),o=void 0,a=me.document.cookie.split("; ");try{for(var s=Ke(a),l=s.next();!l.done;l=s.next()){var c=qe(l.value.split("=",2),2),u=c[0],d=c[1];u===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 f=atob(o);return JSON.parse(decodeURIComponent(f))}var v=o.split("."),p=void 0;return v.length>=2&&v[1]&&(p=atob(v[1])),{deviceId:v[0],userId:p}}catch(e){return}},Je=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))},He=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 Fe(this,void 0,void 0,function(){return Re(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=Je(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=Je(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 Fe(this,void 0,void 0,function(){var t,n=this;return Re(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 Ge,Xe,Qe,$e=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 c 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(c,t.headers[c]);i.send(t.body||null)})},Ze=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Fe(this,void 0,void 0,function(){return Re(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}(),Ye={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)})}(Fe(void 0,void 0,void 0,function(){var i,o;return Re(this,function(a){switch(a.label){case 0:return[4,$e(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"}(Ge||(Ge={})),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"}(Qe||(Qe={}));var et=function(e){return!e||e===Qe.FallbackInline||e===Qe.FallbackConfig||e===Qe.SecondaryInitialVariants},tt={debug:!1,logLevel:Ge.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:Ye},nt="1.21.1",rt=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:tt.instanceName;this.queue=new ot(i),this.cache=new it(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}(),it=function(){function e(e){this.isSessionStorageAvailable=at(),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}(),ot=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=we(),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}(),at=function(){var e=be();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},st=function(){function e(e,t){void 0===t&&(t=Ge.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>=Ge.Error&&(t=this.logger).error.apply(t,We([e],qe(n),!1))},e.prototype.warn=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Warn&&(t=this.logger).warn.apply(t,We([e],qe(n),!1))},e.prototype.info=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Info&&(t=this.logger).info.apply(t,We([e],qe(n),!1))},e.prototype.debug=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Debug&&(t=this.logger).debug.apply(t,We([e],qe(n),!1))},e.prototype.verbose=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Verbose&&(t=this.logger).verbose.apply(t,We([e],qe(n),!1))},e}(),lt=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,We([e],qe(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,We([e],qe(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,We([e],qe(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,We([e],qe(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,We([e],qe(t),!1))},e}(),ct=function(){function e(){this.globalScope=be()}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}(),dt=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 Be({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,n;try{for(var r=Ke(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=Ke(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}(),ft=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}},vt=function(){function e(){this.globalScope=be()}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}(),pt=function(e){return null==e},ht=function(e){return!!pt(e)||e&&0===Object.keys(e).length},gt=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},yt=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 Fe(this,void 0,void 0,function(){return Re(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 Fe(this,void 0,void 0,function(){var r=this;return Re(this,function(i){return this.done||(this.timeoutHandle=me.setTimeout(function(){return Fe(r,void 0,void 0,function(){var r,i;return Re(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){var t,n,r,i;if(!e)return{};var o={user:e},a=be();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var l=Ke(Object.keys(e.groups)),c=l.next();!c.done;c=l.next()){var u=c.value,d=e.groups[u];if(d.length>0&&d[0]){var f=d[0],v={group_name:f},p=null===(i=null===(r=e.group_properties)||void 0===r?void 0:r[u])||void 0===i?void 0:i[f];p&&Object.keys(p).length>0&&(v.group_properties=p),s[u]=v}}}catch(e){t={error:e}}finally{try{c&&!c.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},bt=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},wt=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},St=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}(),xt=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}(),kt=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=Ke(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=qe(o.value,2),s=a[0],l=a[1];pt(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=Be(Be(Be({},tt),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":tt.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":tt.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=n.flagConfigPollingIntervalMillis)&&void 0!==o?o:tt.flagConfigPollingIntervalMillis}),this.logger=new st(this.config.loggerProvider||new lt,e.getLogLevel(n));var l=null===(a=this.config)||void 0===a?void 0:a.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new Se(function(){return Fe(s,void 0,void 0,function(){var e;return Re(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this.logger.info(e),[3,3];case 3:return[2]}})})},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var c in this.config.initialVariants)this.config.initialVariants[c]=ft(this.config.initialVariants[c]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new St(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new xt(this.config.exposureTrackingProvider)),this.integrationManager=new rt(this.config,this);var u,d=new Ze(this.config.httpClient||Ye);this.flagApi=new ye(this.apiKey,this.config.flagsServerUrl,d),this.evaluationApi=new ge(this.apiKey,this.config.serverUrl,d);var f=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;u=this.isWebExperiment?new vt:new ct,this.variants=function(e,t,n){var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r);return new dt(i,n,ft)}(this.apiKey,f,u),this.flags=function(e,t,n){void 0===n&&(n=new ct);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-flags");return new dt(i,n)}(this.apiKey,f,u),this.fetchVariantsOptions=function(e,t,n){void 0===n&&(n=new ct);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-variants-options");return new ut(i,n)}(this.apiKey,f,u);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Fe(this,void 0,void 0,function(){var t,n,r;return Re(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 Fe(this,arguments,void 0,function(e,t){var n;return void 0===e&&(e=this.user),Re(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);gt(n)||delete e[t]}return Be(Be(Be({},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=Be({},this.user.user_properties);return Be(Be({},this.user),{user_properties:t})}return Be({},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=Be({},e.user_properties);this.user=Be(Be({},e),{user_properties:n})}else this.user=Be({},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=H(this.flags.getAll(),e),o=mt(r),a=this.engine.evaluate(o,i),s={};try{for(var l=Ke(Object.keys(a)),c=l.next();!c.done;c=l.next()){var u=c.value;s[u]=wt(a[u])}}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.getEvaluationTraces=function(e){var t=this.addContext(this.user),n=H(this.flags.getAll(),e),r=mt(t);return this.engine.evaluateWithTraces(r,n).traces},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(gt(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=Qe.LocalEvaluation,s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!pt(o)&&!s)return{variant:bt(o),source:a,hasDefaultVariant:!1};if(s&&(i={variant:bt(o),source:a,hasDefaultVariant:!0}),!pt(n))return{variant:bt(n),source:Qe.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!pt(l))return{variant:bt(l),source:Qe.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var c=bt(this.config.fallbackVariant),u={variant:c,source:Qe.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return ht(c)?i:u},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(!pt(i)&&!o)return{variant:bt(i),source:Qe.LocalStorage,hasDefaultVariant:!1};if(o&&(r={variant:bt(i),source:Qe.LocalStorage,hasDefaultVariant:!0}),!pt(t))return{variant:bt(t),source:Qe.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var a=this.config.initialVariants[e];if(!pt(a))return{variant:bt(a),source:Qe.SecondaryInitialVariants,hasDefaultVariant:r.hasDefaultVariant};var s=bt(this.config.fallbackVariant),l={variant:s,source:Qe.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return ht(s)?r:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var n,r={},i=this.config.initialVariants[e];if(!pt(i))return{variant:bt(i),source:Qe.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(!pt(o)&&!a)return{variant:bt(o),source:Qe.LocalStorage,hasDefaultVariant:!1};if(a&&(r={variant:bt(o),source:Qe.LocalStorage,hasDefaultVariant:!0}),!pt(t))return{variant:bt(t),source:Qe.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var s=bt(this.config.fallbackVariant),l={variant:s,source:Qe.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return ht(s)?r:l},e.prototype.fetchInternal=function(e,t,n,r){return Fe(this,void 0,void 0,function(){var i,o,a;return Re(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,Be({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 Fe(this,void 0,void 0,function(){return Re(this,function(t){return this.fetchVariantsOptions.put(Be(Be({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=Be({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,n){return Fe(this,void 0,void 0,function(){var r,i,o,a,s,l,c;return Re(this,function(u){switch(u.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=u.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Be({timeoutMillis:t},n))];case 2:r=u.sent(),i={};try{for(o=Ke(Object.keys(r)),a=o.next();!a.done;a=o.next())s=a.value,i[s]=wt(r[s])}catch(e){l={error:e}}finally{try{a&&!a.done&&(c=o.return)&&c.call(o)}finally{if(l)throw l.error}}return this.logger.debug("[Experiment] Received variants: ",i),[2,i]}})})},e.prototype.doFlags=function(){return Fe(this,void 0,void 0,function(){var e,t,n;return Re(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:nt,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 Fe(this,void 0,void 0,function(){var n,r,i,o;return Re(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 Fe(this,void 0,void 0,function(){var n=this;return Re(this,function(r){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new yt(8,500,1e4,1.5),this.retriesBackoff.start(function(){return Fe(n,void 0,void 0,function(){return Re(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=Be(Be(Be({},null==n?void 0:n.user_properties),r.user_properties),null==e?void 0:e.user_properties);return Be(Be(Be(Be({library:"experiment-js-client/".concat(nt)},n),r),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Fe(this,void 0,void 0,function(){return Re(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,c,u;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},f=et(t.source);if(!f||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 v=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(f||(null==v?void 0:v.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(c=t.variant)||void 0===c?void 0:c.value)&&(d.variant=t.variant.value)),v&&(d.metadata=v),this.isWebExperiment&&(d.time=Date.now()),this.isWebExperiment){var p=be();if(null==p?void 0:p.location)try{var h=p.location.href;d.metadata.url=h.split("?")[0]||""}catch(e){}}var g=this.addContext(this.getUser());null===(u=this.userSessionExposureTracker)||void 0===u||u.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);et(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?Ge.Debug:null!==(t=e.logLevel)&&void 0!==t?t:Ge.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof pe)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),Et=function(){function e(e,t){var n,r,i;this.globalScope=be(),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 Le.UAParser(this.userAgent).getResult(),this.localStorage=new ct,this.sessionStorage=new vt,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 Be({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=Ke(i.searchParams),a=o.next();!a.done;a=o.next()){var s=qe(a.value,2),l=s[0],c=s[1];r[l]=We(We([],qe(null!==(n=r[l])&&void 0!==n?n:[]),!1),qe(c.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=qe(t,2),r=n[0],i=n[1];return e[r]=1==i.length?i[0]:i,e},{})}},e}();me.experimentInstances={};var _t=me.experimentInstances,Ot=function(e,t){return Ct(e,t)},At=function(e,t){return Ct(e,t,function(){return new He(e,Me.getInstance(Tt(t)),1e4)})},Tt=function(e){return(null==e?void 0:e.instanceName)||tt.instanceName},Ct=function(e,t,n){var r=function(e,t){var n=Tt(t),r=null==t?void 0:t.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)}(e,t),i=_t[r];return i||(i=function(e,t){return new kt(e,Be(Be({},t),{userProvider:new Et(null==t?void 0:t.userProvider,e)}))}(e,t),n&&i.addPlugin(n()),_t[r]=i,i)},Pt={initialize:Ot,initializeWithAmplitudeAnalytics:At},Mt=function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return Fe(this,void 0,void 0,function(){return Re(this,function(e){return[2]})})},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return Fe(this,void 0,void 0,function(){return Re(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 tt.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}(),It=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:Ue,AmplitudeIntegrationPlugin:He,AmplitudeUserProvider:De,ConsoleLogger:lt,Experiment:Pt,ExperimentClient:kt,get LogLevel(){return Ge},get Source(){return Xe},StubExperimentClient:Mt,initialize:Ot,initializeWithAmplitudeAnalytics:At});function jt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Nt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return jt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Vt(){return Vt=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},Vt.apply(null,arguments)}var Lt=["selector","action","value","attribute"],Dt=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Ut={revert:function(){}},Bt=new Map,Ft=[],Rt=new Set,Kt=!1,qt=1;function Wt(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 zt(e){var t=Bt.get(e);return t||(t={element:e,attributes:{}},Bt.set(e,t)),t}function Jt(e,t){return e.parentNode===t.parentNode&&e.insertBeforeNode===t.insertBeforeNode}function Ht(e,t){Rt.add(e),e.__params=t,Kt||e.observe.apply(e,e.__params)}function Gt(e,t,n,r,i){var o,a=n(e),s=function(e){An(),i(e),Tn()},l={isDirty:!1,originalValue:a,virtualValue:a,mutations:[],el:e,rateLimitCount:0,observer:new MutationObserver(function(r){if(!(l.rateLimitCount>=10)){if(l.rateLimitCount++,setTimeout(function(){l.rateLimitCount=l.rateLimitCount-1,l.rateLimitCount<=0&&(l.rateLimitCount=0)},1e3),"html"===t)return An(),r.forEach(function(t){var n=t.target,r=t.type,i=t.oldValue;if("childList"===r)return t.removedNodes.forEach(function(e){n.insertBefore(e,t.nextSibling)}),void t.addedNodes.forEach(function(e){e.remove()});if("characterData"!==r){if("attributes"===r&&n instanceof Element){if(n===e)return;var o=t.attributeName;if(!o)return;null===i?n.removeAttribute(o):n.setAttribute(o,i)}}else n.nodeValue=i}),void Tn();var i=n(e);if("position"===t){if(Jt(i,l.virtualValue))return;var o=l.mutations.at(-1);if(!o)return;if(bn(l.virtualValue.parentNode,o))return}i!==l.virtualValue&&("position"!==t&&(l.originalValue=i),s(l))}}),mutationRunner:s,setValue:r,getCurrentValue:n};return o="position"===t&&e.parentNode?[e.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}]:[e,Wt(t)],Ht(l.observer,o),l}function Xt(e,t){var n=t.getCurrentValue(t.el);t.virtualValue=e,!e||"string"==typeof e||"string"==typeof n||Array.isArray(e)||Array.isArray(n)?e!==n&&(t.isDirty=!0,yn()):n&&Jt(n,e)||(t.isDirty=!0,yn())}var Qt=new DOMParser;function $t(e){var t=e.originalValue,n=t.map(function(e){return e instanceof Element?e.outerHTML:e.nodeValue}).join("");e.mutations.forEach(function(r){if(n=r.mutate(n),r.cachedHtml!==n||!r.cachedNodes.has(e.el)){r.cachedHtml=n;var i=Array.from(Qt.parseFromString(n,"text/html").body.childNodes);r.cachedNodes.set(e.el,i)}t=r.cachedNodes.get(e.el)}),Xt(t,e)}function Zt(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach(function(e){return e.mutate(t)}),Xt(Array.from(t).filter(Boolean).join(" "),e)}function Yt(e){var t=e.originalValue;e.mutations.forEach(function(e){t=e.mutate(t)}),Xt(t,e)}function en(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 Vt({},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 tn(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=en(i.mutate());i.newPosition=o}if(i.newPosition){t=i.newPosition;break}}Xt(t,e)}var nn=function(e){return Array.from(e.childNodes)},rn=function(e,t){for(var n=0,r=Array.from(e.children);n<r.length;n++){r[n].__removedByDomMutator__=!0}e.innerHTML="";for(var i,o=Nt(t);!(i=o()).done;){var a=i.value;a instanceof Element&&delete a.__removedByDomMutator__}e.append.apply(e,t)};function on(e){var t=zt(e);return t.html||(t.html=Gt(e,"html",nn,rn,$t)),t.html}var an=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextSibling}},sn=function(e,t){var n;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 r=null==(n=zt(e).position)?void 0:n.observer;null!=r&&r.__params&&(r.disconnect(),Ht(r,[e.parentNode,r.__params[1]]))};function ln(e){var t=zt(e);return t.position||(t.position=Gt(e,"position",an,sn,tn)),t.position}var cn=function(e,t){t?e.className=t:e.removeAttribute("class")},un=function(e){return e.className};function dn(e){var t=zt(e);return t.classes||(t.classes=Gt(e,"class",un,cn,Zt)),t.classes}var fn=function(e){return function(t){var n;return"style"===e?t.style.cssText:null!=(n=t.getAttribute(e))?n:null}},vn=function(e){return function(t,n){null!==n?"style"===e?n?t.style.cssText=n:t.removeAttribute("style"):t.setAttribute(e,n):t.removeAttribute(e)}};function pn(e,t){var n=zt(e);return n.attributes[t]||(n.attributes[t]=Gt(e,t,fn(t),vn(t),Yt)),n.attributes[t]}function hn(e,t,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||function(e,t){var n,r=Bt.get(e);if(r){var i,o;if("html"===t)i=null==(o=r.html)?void 0:o.observer,delete r.html;else if("class"===t){var a;i=null==(a=r.classes)?void 0:a.observer,delete r.classes}else if("position"===t){var s;i=null==(s=r.position)?void 0:s.observer,delete r.position}else{var l;i=null==(l=r.attributes)||null==(l=l[t])?void 0:l.observer,delete r.attributes[t]}null==(n=i)||n.disconnect(),Rt.delete(i)}}(e,t),n.setValue(e,r)}}function gn(e,t){e.html&&hn(t,"html",e.html),e.classes&&hn(t,"class",e.classes),e.position&&hn(t,"position",e.position),Object.keys(e.attributes).forEach(function(n){hn(t,n,e.attributes[n])})}function yn(){Bt.forEach(gn)}function mn(e,t){var n=null;"html"===e.kind?n=on(t):"class"===e.kind?n=dn(t):"attribute"===e.kind?n=pn(t,e.attribute):"position"===e.kind&&(n=ln(t)),n&&(n.mutations.push(e),n.mutationRunner(n),t.__mutationRecord__=zt(t))}function bn(e,t){for(var n=t._priority||0,r=e;r;){var i;if(((null==(i=Bt.get(r))||null==(i=i.html)||null==(i=i.mutations.at(-1))?void 0:i._priority)||0)>n)return!0;r=r.parentElement}return!1}function wn(e){var t=Array.from(e.elements);if(!t.some(function(e){return e.isConnected})){if(t.length>0){for(var n=t.at(-1);n.parentElement;)n=n.parentElement;if(n.__removedByDomMutator__)return}var r=new Set(e.elements);document.querySelectorAll(e.selector).forEach(function(t){r.has(t)||bn(t.parentElement,e)||(e.elements.add(t),mn(e,t))})}}function Sn(e){for(var t=Ft.indexOf(e),n=[],r=An(!0),i=Ft.length-1;i>t;i--){var o=Ft[i];if("position"===o.kind){var a=o.newPosition;if(a){var s=!("direction"in a)||"before"===a.direction,l=xn(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 c,u=new Set(Array.from(e.elements).concat(Array.from(o.elements))),d=kn((null==(c=a.insertBeforeNode)?void 0:c.previousElementSibling)||a.parentNode.lastElementChild,u);null===d?(a.direction="prepend",a.insertNode=a.parentNode):a.insertNode=d}}}n.push(o),Sn(o)}e.elements.forEach(function(t){return function(e,t){var n=null;if("html"===e.kind?n=on(t):"class"===e.kind?n=dn(t):"attribute"===e.kind?n=pn(t,e.attribute):"position"===e.kind&&(n=ln(t)),n){var r=n.mutations.indexOf(e);-1!==r&&n.mutations.splice(r,1),e.rollback&&(n.originalValue=e.rollback(n.originalValue)),n.mutationRunner(n)}}(e,t)}),Ft.splice(t,1),r();for(var f=function(){var e=n.pop();if(!e)return 1;Pn(e),e.elements.forEach(function(t){return mn(e,t)})};n.length>0;)f()}function xn(e,t,n){for(var r=e;r instanceof Element&&t.has(r);)r=n?r.nextElementSibling:r.nextSibling;return r}function kn(e,t){for(var n=e;n instanceof Element&&t.has(n);)n=n.previousElementSibling;return n}function En(){Ft.forEach(wn)}var _n,On=!1;function An(e){return void 0===e&&(e=!1),Kt=!0,Rt.forEach(function(e){return e.disconnect()}),e&&!On?(On=!0,function(){On=!1,Tn()}):function(){}}function Tn(){Kt&&!On&&(Kt=!1,Rt.forEach(function(e){return e.__params&&e.observe.apply(e,e.__params)}),En())}function Cn(){"undefined"!=typeof document&&(_n||(_n=new MutationObserver(function(){En()})),En(),Ht(_n,[document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}]))}Cn();function Pn(e){return"undefined"==typeof document?Ut:(e._priority=qt++,Ft.push(e),wn(e),{__mutation:e,revert:function(){Sn(e)}})}function Mn(e,t){return Pn({kind:"html",elements:new Set,mutate:t,selector:e,cachedNodes:new Map})}function In(e,t){return Pn({kind:"position",elements:new Set,mutate:t,selector:e})}function jn(e,t,n){return Pn({kind:"class",elements:new Set,mutate:t,selector:e,rollback:n})}function Nn(e,t,n,r){return Dt.test(t)?"class"===t||"className"===t?jn(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)})},r):Pn({kind:"attribute",attribute:t,elements:new Set,mutate:n,selector:e,rollback:r}):Ut}var Vn,Ln={html:Mn,classes:jn,attribute:Nn,position:In,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,Lt);if("html"===i){if("append"===n)return Mn(t,function(e){return e+(null!=r?r:"")});if("set"===n)return Mn(t,function(){return null!=r?r:""})}else if("class"===i){if("append"===n)return jn(t,function(e){r&&e.add(r)},function(e){if(r&&e){var t=new Set(e.split(/\s+/).filter(Boolean));return t.delete(r),Array.from(t).join(" ")}return e});if("remove"===n)return jn(t,function(e){r&&e.delete(r)});if("set"===n)return jn(t,function(e){e.clear(),r&&e.add(r)})}else if("position"===i){if("set"===n){if("insertSelector"in o)return In(t,function(){return{insertSelector:o.insertSelector,direction:o.direction}});if("parentSelector"in o)return In(t,function(){return{insertBeforeSelector:o.insertBeforeSelector,parentSelector:o.parentSelector}})}}else{var a=r||"";if("append"===n)return"style"===i?Nn(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}):Nn(t,i,function(e){return null!==e?e+a:a});if("set"===n)return Nn(t,i,function(){return a});if("remove"===n)return Nn(t,i,function(){return null})}return Ut}},Dn=Object.freeze({__proto__:null,default:Ln,connectGlobalObserver:Cn,disconnectGlobalObserver:function(){var e;null==(e=_n)||e.disconnect()},getHtmlMutationRecordsFromSelector:function(e){var t=document.querySelectorAll(e),n=[];return t.forEach(function(e){var t=on(e);t&&n.push(t)}),n},isGlobalObserverPaused:function(){return Kt},pauseGlobalObserver:An,resumeGlobalObserver:Tn,validAttributeName:Dt}),Un=function(){function e(e){this.eventStorage=e,this.evaluationEngine=new J}return e.prototype.evaluate=function(e){var t,n;try{for(var r=i(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(this.evaluateAndGroup(a))return!0}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!1},e.prototype.evaluateAndGroup=function(e){var t,n;try{for(var r=i(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(!this.evaluateConditionSet(a))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},e.prototype.evaluateConditionSet=function(e){var t=this.evaluateCondition(e.condition);return e.negated?!t:t},e.prototype.evaluateCondition=function(e){var t=this,n=this.eventStorage.getEventsInTimeWindow(e.event_type,e.time_type,e.time_value,e.interval).filter(function(n){return t.evaluatePropertyFilters(n,e.event_props||[])}).length;return this.evaluateCountOperator(n,e.op,e.value)},e.prototype.evaluatePropertyFilters=function(e,t){if(!t||0===t.length)return!0;var n={context:e.properties,result:{}};return this.evaluationEngine.evaluateConditions(n,[t])},e.prototype.evaluateCountOperator=function(e,t,n){switch(t){case x:return e>=n;case S:return e>n;case h:return e===n;case b:return e<n;case w:return e<=n;case g:return e!==n;default:return!1}},e}(),Bn=function(){function e(e,t,n){var r=this;this.debouncedWriteTimeout=null,this.hasPendingWrites=!1,this.handleBeforeUnload=function(){r.flushToLocalStorage()},this.handleVisibilityChange=function(){"hidden"===document.visibilityState&&r.flushToLocalStorage()},this.storageKey="EXP_".concat(e.slice(0,10),"_rtbt_events"),this.sessionManager=t,this.persistedEvents=n,this.memoryCache=this.loadFromLocalStorage(),this.setupFlushHandlers()}return e.prototype.addEvent=function(t,n,r){if(void 0===n&&(n={}),!this.persistedEvents||this.persistedEvents.has(t)){var i=this.sessionManager.getOrCreateSessionId(),o={id:this.memoryCache.nextId++,event_type:t,timestamp:null!=r?r:Date.now(),session_id:i,properties:n};this.memoryCache.events.push(o),this.memoryCache.events.length>e.MAX_EVENTS&&(this.memoryCache.events=this.memoryCache.events.slice(-e.MAX_EVENTS)),this.scheduleDebouncedWrite()}},e.prototype.getAllEvents=function(){return this.memoryCache.events},e.prototype.getEventsByType=function(e){return this.memoryCache.events.filter(function(t){return t.event_type===e})},e.prototype.getEventsInTimeWindow=function(e,t,n,r){var i=this.memoryCache.events.filter(function(t){return t.event_type===e});if("current_session"===t){var o=this.sessionManager.getOrCreateSessionId();i=i.filter(function(e){return e.session_id===o})}else{var a=Date.now()-("day"===r?24*n*60*60*1e3:60*n*60*1e3);i=i.filter(function(e){return e.timestamp>=a})}return i},e.prototype.clearEvents=function(){this.memoryCache={events:[],nextId:1},this.hasPendingWrites=!0,this.flushToLocalStorage()},e.prototype.flush=function(){this.flushToLocalStorage()},e.prototype.getEventCount=function(e){return this.getEventsByType(e).length},e.prototype.getEventCountInTimeWindow=function(e,t,n,r){return this.getEventsInTimeWindow(e,t,n,r).length},e.prototype.loadFromLocalStorage=function(){var e=localStorage.getItem(this.storageKey);if(e)try{var t=JSON.parse(e);return t&&"object"==typeof t&&Array.isArray(t.events)&&"number"==typeof t.nextId?t:{events:[],nextId:1}}catch(e){return{events:[],nextId:1}}return{events:[],nextId:1}},e.prototype.scheduleDebouncedWrite=function(){var t=this;this.hasPendingWrites=!0,this.debouncedWriteTimeout&&clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=setTimeout(function(){t.flushToLocalStorage()},e.DEBOUNCE_MS)},e.prototype.flushToLocalStorage=function(){if(this.hasPendingWrites)try{localStorage.setItem(this.storageKey,JSON.stringify(this.memoryCache)),this.hasPendingWrites=!1,this.debouncedWriteTimeout&&(clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=null)}catch(e){}},e.prototype.setupFlushHandlers=function(){window.addEventListener("beforeunload",this.handleBeforeUnload),document.addEventListener("visibilitychange",this.handleVisibilityChange)},e.prototype.cleanup=function(){this.flushToLocalStorage(),this.debouncedWriteTimeout&&(clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=null),window.removeEventListener("beforeunload",this.handleBeforeUnload),document.removeEventListener("visibilitychange",this.handleVisibilityChange)},e.MAX_EVENTS=500,e.DEBOUNCE_MS=500,e}(),Fn=function(){function e(e){this.storageKey="EXP_".concat(e.slice(0,10),"_rtbt_session")}return e.prototype.getOrCreateSessionId=function(){if(this.sessionId)return this.sessionId;var e=sessionStorage.getItem(this.storageKey);if(e)try{var t=JSON.parse(e);if(t.sessionId&&"string"==typeof t.sessionId)return this.sessionId=t.sessionId,this.sessionStartTime=t.sessionStartTime,t.sessionId}catch(e){}return this.sessionId=this.generateSessionId(),this.sessionStartTime=Date.now(),sessionStorage.setItem(this.storageKey,JSON.stringify({sessionId:this.sessionId,sessionStartTime:this.sessionStartTime})),this.sessionId},e.prototype.getSessionStartTime=function(){return this.sessionStartTime||this.getOrCreateSessionId(),this.sessionStartTime},e.prototype.generateSessionId=function(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))},e.prototype.clearSession=function(){this.sessionId=void 0,this.sessionStartTime=void 0,sessionStorage.removeItem(this.storageKey)},e}(),Rn=function(){function e(e,t){void 0===t&&(t={}),this.matchedBehaviors=new Map,this.eventToBehaviors=new Map,this.rules=t,this.sessionManager=new Fn(e),this.buildEventToBehaviorsMap(),this.eventStorage=new Bn(e,this.sessionManager,new Set(this.eventToBehaviors.keys())),this.evaluator=new Un(this.eventStorage),this.evaluateAll()}return e.prototype.trackEvent=function(e,t){this.eventStorage.addEvent(e,t),this.evaluateEvent(e)},e.prototype.hasRules=function(e){return!!this.rules[e]},e.prototype.getMatchedBehaviors=function(){return this.matchedBehaviors},e.prototype.cleanup=function(){this.eventStorage.cleanup()},e.prototype.buildEventToBehaviorsMap=function(){var e,t,n,r;for(var a in this.rules){var s=this.rules[a];try{for(var l=(e=void 0,i(Object.entries(s))),c=l.next();!c.done;c=l.next()){var u=o(c.value,2),d=u[0],f=u[1],v=this.extractEventTypes(f);try{for(var p=(n=void 0,i(v)),h=p.next();!h.done;h=p.next()){var g=h.value,y=this.eventToBehaviors.get(g);y||(y=[],this.eventToBehaviors.set(g,y)),y.push({id:d,flagKey:a})}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}}},e.prototype.extractEventTypes=function(e){var t,n,r,o,a=new Set;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var c=l.value;try{for(var u=(r=void 0,i(c)),d=u.next();!d.done;d=u.next()){var f=d.value;"behavior"===f.condition.type&&a.add(f.condition.event_type)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a},e.prototype.evaluateAll=function(){for(var e in this.rules)this.evaluateFlag(e)},e.prototype.evaluateEvent=function(e){var t,n,r=this.eventToBehaviors.get(e);if(r)try{for(var o=i(r),a=o.next();!a.done;a=o.next()){var s=a.value,l=s.id,c=s.flagKey;this.evaluateBehaviorId(c,l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},e.prototype.evaluateFlag=function(e){var t,n,r=this.rules[e];if(r){var a=new Set;try{for(var s=i(Object.entries(r)),l=s.next();!l.done;l=s.next()){var c=o(l.value,2),u=c[0],d=c[1];this.evaluator.evaluate(d)&&a.add(u)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}a.size>0?this.matchedBehaviors.set(e,a):this.matchedBehaviors.delete(e)}else this.matchedBehaviors.delete(e)},e.prototype.evaluateBehaviorId=function(e,t){var n=this.rules[e];if(n&&n[t]){var r=this.matchedBehaviors.get(e)||new Set,i=n[t];this.evaluator.evaluate(i)?r.add(t):r.delete(t),r.size>0?this.matchedBehaviors.set(e,r):this.matchedBehaviors.delete(e)}},e}();function Kn(e,t){var n,r,i,s=new(null!==(i=null===(r=(e.nodeType===Node.DOCUMENT_NODE?e:null!==(n=e.ownerDocument)&&void 0!==n?n:document).defaultView)||void 0===r?void 0:r.CSSStyleSheet)&&void 0!==i?i:CSSStyleSheet);s.replaceSync(t);var l=!1,c=function(){l||(e.adoptedStyleSheets=a(a([],o(e.adoptedStyleSheets),!1),[s],!1),l=!0)};return c(),{revert:function(){l&&(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(function(e){return e!==s}),l=!1)},reapply:c}}var qn=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 c=document.createElement("div");c.className="amp-preview-modal-badge amp-preview-modal-preview-badge",c.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 u=document.createElement("span");u.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",u.appendChild(d),u.appendChild(document.createTextNode(i)),a.appendChild(s),a.appendChild(l),a.appendChild(c),a.appendChild(u),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(!Vn){Vn=Kn(document,"\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 ")}},e}();function Wn(e){var t=new qn(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 zn=function(){function e(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map}return e.prototype.subscribe=function(e,t,n){void 0===n&&(n=void 0);var r=this.messageToSubscriberGroup.get(e);r||(r={subscribers:[]},this.messageToSubscriberGroup.set(e,r));var i={identifier:n,callback:t};r.subscribers.push(i)},e.prototype.groupSubscribe=function(e,t){this.subscriberGroupCallback.set(e,t),this.messageToSubscriberGroup.has(e)||this.messageToSubscriberGroup.set(e,{subscribers:[]})},e.prototype.publish=function(e,t){var n,r=this.messageToSubscriberGroup.get(e);r&&(t=t||{},r.subscribers.forEach(function(e){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}();var Jn=[],Hn=!1,Gn="not_started",Xn=null,Qn=function(e){var t;if(!0!==e.__AMP_DEBUG)try{Hn="true"===(null===(t=e.localStorage)||void 0===t?void 0:t.getItem("amp-ve-debug"))}catch(e){Hn=!1}else Hn=!0},$n=function(){return Hn},Zn=function(e,t){Hn&&Jn.push({timestamp:Date.now(),event:e,detail:t})},Yn=function(e){Gn=e},er=function(e){Xn=e},tr=function(){var e,n=null!==(e=null==Xn?void 0:Xn())&&void 0!==e?e:{flags:{},visualEditor:{isActive:!1},currentUrl:""};return{flags:n.flags,visualEditor:t(t({},n.visualEditor),{messengerState:Gn}),events:Jn,currentUrl:n.currentUrl,timestamp:Date.now()}};function nr(e,t){var n,r,o,a,s=[];try{for(var l=i(Object.values(e)),c=l.next();!c.done;c=l.next()){var u=c.value;try{for(var d=(o=void 0,i(Object.values(u))),f=d.next();!f.done;f=d.next()){var v=f.value;t.includes(v.trigger_type)&&s.push(v)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return s}var rr="amp-device-iframe",ir="amp-overlay-device-iframe-container";function or(){try{return"true"===sessionStorage.getItem("amp-visual-editor-mobile-mode")}catch(e){return!1}}function ar(){return document.getElementById(rr)}function sr(e,t){var n=t.location.href;n&&n!==e.location.href&&e.history.replaceState(e.history.state,"",n)}function lr(e){var t=e.document,n=function(){for(Kn(t,"body > *:not(#".concat(ir,"):not(#").concat("overlay-shadow-host",") { display: none !important; }"));t.body.firstChild;)t.body.removeChild(t.body.firstChild);t.body.style.cssText='\n margin: 0;\n padding: 0;\n overflow: auto;\n min-height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fff;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABZSURBVHgB7dG7DYBADANQJxexAiXSTXw9uyExBih34SOxQhr83Li2ASIiIiIiIpo7QbLW1tms1zijq9puSDaGLxhhuBPaqyKZTFK+/r6AZOJlg8shqv5ccAGZWRnaKiSy9QAAAABJRU5ErkJggg==");\n ';var n=t.createElement("div");n.id=ir,n.style.cssText="\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n ";var r=t.createElement("iframe");r.id=rr,r.src=e.location.href,r.style.cssText="\n width: ".concat(402,"px;\n height: ").concat(874,"px;\n border: 1px solid #dedfe2;\n border-radius: 20px;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);\n background: #fff;\n transition: all 0.1s ease;\n "),r.addEventListener("load",function(){var t=r.contentWindow;if(t)try{sr(e,t),function(e,t){var n=t.history,r=function(n){return function(r,i,o){n.call(this,r,i,o),sr(e,t)}};n.pushState=r(n.pushState.bind(n)),n.replaceState=r(n.replaceState.bind(n)),t.addEventListener("popstate",function(){sr(e,t)})}(e,t)}catch(e){}}),n.appendChild(r),t.body.appendChild(n)};return new Promise(function(r){if("complete"===t.readyState&&t.body)n(),r();else{var i=function(){"complete"===t.readyState&&t.body?(n(),r()):e.requestAnimationFrame(i)};e.requestAnimationFrame(i)}})}var cr,ur={observerOptions:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]},debounceMs:100},dr=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({},ur),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}(),fr=new J,vr=function(){function e(e,n,r,s,l,c){var u=this;this.pageChangeSubscribers=new Set,this.lastNotifiedActivePages={},this.lastNotifiedActiveBehavioralFlags=new Map,this.intersectionObservers=new Map,this.elementVisibilityState=new Map,this.elementAppearedState=new Set,this.manuallyActivatedPageObjects=new Set,this.targetedElementSelectors=new Set,this.scrolledToObservers=new Map,this.scrolledToElementState=new Map,this.analyticsEventState=new Set,this.maxScrollPercentage=0,this.timeOnPageTimeouts={},this.firedUserInteractions=new Set,this.clickTimeouts=new Map,this.hoverTimeouts=new WeakMap,this.focusTimeouts=new WeakMap,this.userInteractionAbortController=null,this.pageLoadTime=Number.POSITIVE_INFINITY,this.lastPublishedUrl=null,this.debugStateSubscribers=new Set,this.debugDebounceTimer=null,this.setPageObjects=function(e){u.pageObjects=e},this.markUrlAsPublished=function(e){u.lastPublishedUrl=e},this.initSubscriptions=function(){u.setupPageObjectSubscriptions(),u.options.useDefaultNavigationHandler&&u.setupLocationChangePublisher(),u.setupMutationObserverPublisher(),u.setupVisibilityPublisher(),u.setupUserInteractionPublisher(),u.setupExitIntentPublisher(),u.setupScrolledToPublisher(),u.setupTimeOnPagePublisher(),u.setupVisibilityChangeHandler(),u.checkInitialElements()},this.addPageChangeSubscriber=function(e){return u.pageChangeSubscribers.add(e),function(){u.pageChangeSubscribers.delete(e)}},this.addDebugStateSubscriber=function(e){return u.debugStateSubscribers.add(e),function(){u.debugStateSubscribers.delete(e)}},this.scheduleDebugNotification=function(){u.options.isDebugActive&&0!==u.debugStateSubscribers.size&&(null!==u.debugDebounceTimer&&u.globalScope.clearTimeout(u.debugDebounceTimer),u.debugDebounceTimer=u.globalScope.setTimeout(function(){var e,t;u.debugDebounceTimer=null;var n=u.webExperimentClient.getDebugState();try{for(var r=i(u.debugStateSubscribers),o=r.next();!o.done;o=r.next()){(0,o.value)(n)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},100))},this.setupPageObjectSubscriptions=function(){var e,n,r,s,l,c,d,f,v={url_change:new Set};u.behavioralTargetingManager&&(v.analytics_event=new Set);try{for(var p=i(Object.entries(u.pageObjects)),h=p.next();!h.done;h=p.next()){var g=o(h.value,2),y=g[0],m=g[1];try{for(var b=(r=void 0,i(Object.values(m))),w=b.next();!w.done;w=b.next()){var S=w.value;v[S.trigger_type]||(v[S.trigger_type]=new Set),v[S.trigger_type].add(y)}}catch(e){r={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}var x=function(e,t){var n,r,o=function(t){u.messageBus.subscribe(t.trigger_type,function(n){var r,i=!!(null===(r=u.webExperimentClient.getActivePages()[e])||void 0===r?void 0:r[t.id]),o=u.isPageObjectActive(t,n);u.webExperimentClient.updateActivePages(e,t,o),o&&!i&&Zn("trigger_fired","flag=".concat(e,", page=").concat(t.name||t.id,", ")+"type=".concat(t.trigger_type))})};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 k=i(Object.entries(u.pageObjects)),E=k.next();!E.done;E=k.next()){var _=o(E.value,2);x(y=_[0],m=_[1])}}catch(e){l={error:e}}finally{try{E&&!E.done&&(c=k.return)&&c.call(k)}finally{if(l)throw l.error}}var O=function(e){u.messageBus.groupSubscribe(e,function(n){var r,s,l,c,d="url_change"===e,f="analytics_event"===e;d&&(Zn("url_change","navigated to ".concat(u.globalScope.location.href)),u.resetTriggerStates(),u.revertInjections());var p=u.webExperimentClient.getActivePages(),h=!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 c=i(s),u=c.next();!u.done;u=c.next()){var d=u.value,f=e[d],v=t[d];if(!v)return!1;var p=Object.keys(f),h=Object.keys(v);if(p.length!==h.length)return!1;try{for(var g=(o=void 0,i(p)),y=g.next();!y.done;y=g.next()){var m=y.value,b=f[m],w=v[m];if(!w||b.id!==w.id)return!1}}catch(e){o={error:e}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return!0}(p,u.lastNotifiedActivePages),g=null===(l=u.webExperimentClient.behavioralTargetingManager)||void 0===l?void 0:l.getMatchedBehaviors(),y=f&&!function(e,t){var n,r,a,s;if(!e&&t.size>0)return!1;if(e&&e.size!==t.size)return!1;if(!e)return!0;try{for(var l=i(e),c=l.next();!c.done;c=l.next()){var u=o(c.value,2),d=u[0],f=u[1],v=t.get(d);if(!v)return!1;if(f.size!==v.size)return!1;try{for(var p=(a=void 0,i(f)),h=p.next();!h.done;h=p.next()){var g=h.value;if(!v.has(g))return!1}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return!0}(g,u.lastNotifiedActiveBehavioralFlags);if(y&&u.webExperimentClient.updateUserWithBehaviors(),!("updateActivePages"in n&&n.updateActivePages)&&!u.options.isVisualEditorMode&&(h||y||d)){var m;if(d)m=void 0;else{var b=Array.from(v[e]||[]),w=y?Array.from(new Set(a(a([],o(Array.from((null==g?void 0:g.keys())||[])),!1),o(Array.from((null===(c=u.lastNotifiedActiveBehavioralFlags)||void 0===c?void 0:c.keys())||[])),!1))):[];m=Array.from(new Set(a(a([],o(b),!1),o(w),!1)))}if(u.webExperimentClient.applyVariants({flagKeys:null==m?void 0:m.filter(function(e){return!u.webExperimentClient.previewFlags[e]})}),u.webExperimentClient.isPreviewMode){var S=m?Object.fromEntries(Object.entries(u.webExperimentClient.previewFlags).filter(function(e){var t=o(e,1)[0];return m.includes(t)})):u.webExperimentClient.previewFlags;u.webExperimentClient.previewVariants({keyToVariant:S})}}u.lastNotifiedActivePages=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}(p);try{for(var x=(r=void 0,i(u.pageChangeSubscribers)),k=x.next();!k.done;k=x.next()){(0,k.value)({activePages:p})}}catch(e){r={error:e}}finally{try{k&&!k.done&&(s=x.return)&&s.call(x)}finally{if(r)throw r.error}}(h||d)&&u.scheduleDebugNotification(),y&&g&&(u.lastNotifiedActiveBehavioralFlags=new Map(Array.from(g.entries()).map(function(e){var t=o(e,2),n=t[0],r=t[1];return[n,new Set(r)]})))})};try{for(var A=i(Object.keys(v)),T=A.next();!T.done;T=A.next()){O(T.value)}}catch(e){d={error:e}}finally{try{T&&!T.done&&(f=A.return)&&f.call(A)}finally{if(d)throw d.error}}},this.toggleManualPageObject=function(e,t){t?u.manuallyActivatedPageObjects.add(e):u.manuallyActivatedPageObjects.delete(e),u.messageBus.publish("manual")},this.resetTriggerStates=function(){var e,t,n,r,a,s;Zn("trigger_reset","all non-url_change triggers cleared"),u.elementAppearedState.clear(),u.elementVisibilityState.clear(),u.firedUserInteractions.clear(),u.scrolledToElementState.clear(),u.manuallyActivatedPageObjects.clear(),u.maxScrollPercentage=0,u.pageLoadTime=Date.now(),u.analyticsEventState.clear(),u.lastNotifiedActiveBehavioralFlags=new Map;try{for(var l=i(u.clickTimeouts.values()),c=l.next();!c.done;c=l.next()){var d=c.value;u.globalScope.clearTimeout(d)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}u.clickTimeouts.clear();try{for(var f=i(Object.entries(u.pageObjects)),v=f.next();!v.done;v=f.next()){var p=o(v.value,2),h=p[0],g=p[1];try{for(var y=(a=void 0,i(Object.values(g))),m=y.next();!m.done;m=y.next()){var b=m.value;"url_change"!==b.trigger_type&&u.webExperimentClient.updateActivePages(h,b,!1)}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}u.setupTimeOnPagePublisher(),u.checkInitialElements()},this.revertInjections=function(){Object.values(u.webExperimentClient.appliedMutations).forEach(function(e){Object.values(e).forEach(function(e){e[li]&&Object.values(e[li]).forEach(function(e){var t;null===(t=e.revert)||void 0===t||t.call(e)})})});var e=u.webExperimentClient.appliedMutations;Object.keys(e).forEach(function(t){var n=e[t];Object.keys(n).forEach(function(e){n[e][li]&&(delete n[e][li],0===Object.keys(n[e]).length&&delete n[e])}),0===Object.keys(n).length&&delete e[t]})},this.updateElementAppearedState=function(e,t){var n,r,o,a;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var c=l.value;if(0===t.length||u.isMutationRelevantToSelector(t,c))try{var d=u.contentDocument.querySelectorAll(c);try{for(var f=(o=void 0,i(Array.from(d))),v=f.next();!v.done;v=f.next()){var p=v.value,h=u.contentWindow.getComputedStyle(p);if("none"!==h.display&&"hidden"!==h.visibility){u.elementAppearedState.add(c);break}}}catch(e){o={error:e}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},this.checkInitialElements=function(){u.updateElementAppearedState(u.targetedElementSelectors,[]),u.messageBus.publish("element_appeared",{mutationList:[]})},this.setupMutationObserverPublisher=function(){if(u.targetedElementSelectors=function(e){var t,n,r,o,a=new Set;try{for(var s=i(Object.values(e)),l=s.next();!l.done;l=s.next()){var c=l.value;try{for(var u=(r=void 0,i(Object.values(c))),d=u.next();!d.done;d=u.next()){var f=d.value;if("element_appeared"===f.trigger_type||"element_visible"===f.trigger_type){var v=(p=f.trigger_value).selector;v&&a.add(v)}else if("scrolled_to"===f.trigger_type){var p;"element"===(p=f.trigger_value).mode&&p.selector&&a.add(p.selector)}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}(u.pageObjects),0!==u.targetedElementSelectors.size){var e=[function(e){return Array.from(u.targetedElementSelectors).some(function(t){return u.isMutationRelevantToSelector([e],t)})}];return new dr(u.contentDocument.documentElement,function(e){u.updateElementAppearedState(u.targetedElementSelectors,e),u.messageBus.publish("element_appeared",{mutationList:e})},e).observe()}},this.setupVisibilityPublisher=function(){var e,t,n,r,a;if(0!==nr(u.pageObjects,["element_visible"]).length){try{for(var s=i(Object.values(u.pageObjects)),l=s.next();!l.done;l=s.next()){var c=l.value,d=function(e){if("element_visible"===e.trigger_type){var t=e.trigger_value,n=t.selector,r=null!==(a=t.visibilityRatio)&&void 0!==a?a:0,i="".concat(n,"\0").concat(r);if(u.intersectionObservers.has(i))return"continue";var o=new IntersectionObserver(function(e){e.forEach(function(e){var t=e.intersectionRatio>=r;u.elementVisibilityState.set(i,t),t&&u.messageBus.publish("element_visible")})},{threshold:r});u.intersectionObservers.set(i,o);try{u.contentDocument.querySelectorAll(n).forEach(function(e){o.observe(e)})}catch(e){}}};try{for(var f=(n=void 0,i(Object.values(c))),v=f.next();!v.done;v=f.next()){d(v.value)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}u.messageBus.subscribe("element_appeared",function(e){var t,n,r=e.mutationList,a=function(e,t){var n=o(e.split("\0"),1)[0];if(0===r.length||u.isMutationRelevantToSelector(r,n))try{u.contentDocument.querySelectorAll(n).forEach(function(e){t.observe(e)})}catch(e){}};try{for(var s=i(u.intersectionObservers.entries()),l=s.next();!l.done;l=s.next()){var c=o(l.value,2);a(c[0],c[1])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}})}},this.setupExitIntentPublisher=function(){var e,t,n;u.pageLoadTime=Date.now();var r=Object.values(u.pageObjects).flatMap(function(e){return Object.values(e).filter(function(e){return"exit_intent"===e.trigger_type})});if(0!==r.length){var o=1/0;try{for(var a=i(r),s=a.next();!s.done;s=a.next()){var l=s.value.trigger_value;o=Math.min(o,null!==(n=l.minTimeOnPageMs)&&void 0!==n?n:0)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}var c=function(e){e.clientY<=50&&null===e.relatedTarget&&u.messageBus.publish("exit_intent",{durationMs:Date.now()-u.pageLoadTime})};o>0?u.globalScope.setTimeout(function(){u.contentDocument.addEventListener("mouseleave",c)},o):u.contentDocument.addEventListener("mouseleave",c)}},this.setupLocationChangePublisher=function(){u.globalScope.addEventListener("popstate",function(){var e=u.globalScope.location.href;e!==u.lastPublishedUrl&&(u.lastPublishedUrl=e,u.messageBus.publish("url_change"))});var e,t,n=function(){var e=u.globalScope.location.href;e!==u.lastPublishedUrl&&(u.lastPublishedUrl=e,u.messageBus.publish("url_change"),u.globalScope.webExperiment.previousUrl=e)};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.setupUserInteractionPublisher=function(){var e,t,n,r,o,a,s,l;null===(o=u.userInteractionAbortController)||void 0===o||o.abort(),u.userInteractionAbortController=new AbortController;var c=u.userInteractionAbortController.signal,d=new Map,f=new Map,v=new Map;try{for(var p=i(Object.values(u.pageObjects)),h=p.next();!h.done;h=p.next()){var g=h.value;try{for(var y=(n=void 0,i(Object.values(g))),m=y.next();!m.done;m=y.next()){var b=m.value;if("user_interaction"===b.trigger_type){var w=b.trigger_value,S=w.selector,x=w.interactionType,k=w.minThresholdMs;"click"===x?(d.has(S)||d.set(S,new Set),null===(a=d.get(S))||void 0===a||a.add(k||0)):"hover"===x?(f.has(S)||f.set(S,new Set),null===(s=f.get(S))||void 0===s||s.add(k||0)):"focus"===x&&(v.has(S)||v.set(S,new Set),null===(l=v.get(S))||void 0===l||l.add(k||0))}}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=p.return)&&t.call(p)}finally{if(e)throw e.error}}0===d.size&&0===f.size&&0===v.size||(d.size>0&&u.setupClickDelegation(d,c),f.size>0&&u.setupHoverDelegation(f,c),v.size>0&&u.setupFocusDelegation(v,c))},this.setupClickDelegation=function(e,t){u.contentDocument.addEventListener("click",function(t){var n,r,a,s,l=t.target;if(l)try{for(var c=i(e),d=c.next();!d.done;d=c.next()){var f=o(d.value,2),v=f[0],p=f[1];try{if(l.closest(v)){var h=function(e){var t="".concat(v,"\0click\0").concat(e);if(u.firedUserInteractions.has(t))return"continue";if(u.clickTimeouts.has(t))return"continue";var n=function(){u.firedUserInteractions.add(t),u.messageBus.publish("user_interaction"),u.clickTimeouts.delete(t)};if(e>0){var r=u.globalScope.setTimeout(n,e);u.clickTimeouts.set(t,r)}else n()};try{for(var g=(a=void 0,i(p)),y=g.next();!y.done;y=g.next()){h(y.value)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}break}}catch(e){}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}},{signal:t})},this.setupThresholdBasedDelegation=function(e,t,n){u.contentDocument.addEventListener(n.startEvent,function(t){var r,a,s,l,c=t.target;if(c)try{for(var d=i(e),f=d.next();!f.done;f=d.next()){var v=o(f.value,2),p=v[0],h=v[1];try{var g=c.closest(p);if(g){var y=function(e){var t="".concat(p,"\0").concat(n.interactionType,"\0").concat(e);if(u.firedUserInteractions.has(t))return"continue";var r=n.timeoutStorage.get(g);r||(r=new Map,n.timeoutStorage.set(g,r));var i="".concat(p,"\0").concat(e);if(!r.get(i)){var o=function(){u.firedUserInteractions.add(t),u.messageBus.publish("user_interaction"),null==r||r.delete(i)};if(e){var a=u.globalScope.setTimeout(o,e);r.set(i,a)}else o()}};try{for(var m=(s=void 0,i(h)),b=m.next();!b.done;b=m.next()){y(b.value)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(l=m.return)&&l.call(m)}finally{if(s)throw s.error}}break}}catch(e){}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}},{signal:t}),u.contentDocument.addEventListener(n.endEvent,function(t){var r,a,s,l,c=t.target;if(c){var d=t.relatedTarget;try{for(var f=i(e),v=f.next();!v.done;v=f.next()){var p=o(v.value,1)[0];try{var h=c.closest(p);if(h){if(!d||!h.contains(d)){var g=n.timeoutStorage.get(h);if(g){try{for(var y=(s=void 0,i(g.values())),m=y.next();!m.done;m=y.next()){var b=m.value;u.globalScope.clearTimeout(b)}}catch(e){s={error:e}}finally{try{m&&!m.done&&(l=y.return)&&l.call(y)}finally{if(s)throw s.error}}n.timeoutStorage.delete(h)}}break}}catch(e){}}}catch(e){r={error:e}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}},{signal:t})},this.setupHoverDelegation=function(e,t){u.setupThresholdBasedDelegation(e,t,{interactionType:"hover",startEvent:"mouseover",endEvent:"mouseout",timeoutStorage:u.hoverTimeouts})},this.setupFocusDelegation=function(e,t){u.setupThresholdBasedDelegation(e,t,{interactionType:"focus",startEvent:"focusin",endEvent:"focusout",timeoutStorage:u.focusTimeouts})},this.setupTimeOnPagePublisher=function(){var e,t,n,r;Object.values(u.timeOnPageTimeouts).forEach(clearTimeout),u.timeOnPageTimeouts={};var o=new Set;try{for(var a=i(Object.values(u.pageObjects)),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var c=(n=void 0,i(Object.values(l))),d=c.next();!d.done;d=c.next()){var f=d.value;if("time_on_page"===f.trigger_type){var v=f.trigger_value;o.add(v.durationMs)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==o.size&&u.setUpTimeouts(o)},this.setUpTimeouts=function(e){e.forEach(function(e){u.timeOnPageTimeouts[e]=u.globalScope.setTimeout(function(){u.messageBus.publish("time_on_page",{durationMs:e}),delete u.timeOnPageTimeouts[e]},e)})},this.setupVisibilityChangeHandler=function(){if(0!==nr(u.pageObjects,["time_on_page"]).length){u.globalScope.document.addEventListener("visibilitychange",function(){if(u.globalScope.document.hidden)Object.values(u.timeOnPageTimeouts).forEach(clearTimeout);else{var e=new Set(Object.keys(u.timeOnPageTimeouts).map(Number));u.setUpTimeouts(e)}})}},this.setupScrolledToPublisher=function(){var e,t,n,r,a=nr(u.pageObjects,["scrolled_to"]);if(0!==a.length){var s=!1,l=!1;try{for(var c=i(a),d=c.next();!d.done;d=c.next()){var f=d.value.trigger_value;"percent"===f.mode?s=!0:"element"===f.mode&&(l=!0)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}if(s){var v=null,p=function(){var e=u.calculateScrollPercentage();e>u.maxScrollPercentage&&(u.maxScrollPercentage=e,u.messageBus.publish("scrolled_to",{}))};u.contentWindow.addEventListener("scroll",function(){null===v&&(v=u.globalScope.requestAnimationFrame(function(){p(),v=null}))},{passive:!0}),p()}if(l){var h=function(e){if("scrolled_to"===e.trigger_type){var t=e.trigger_value;if("element"===t.mode){var n=t.selector,r=t.offsetPx||0,i="".concat(n,"\0").concat(r);if(u.scrolledToObservers.has(i))return"continue";var o="0px 0px ".concat(r,"px 0px"),a=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(u.scrolledToElementState.set(i,!0),u.messageBus.publish("scrolled_to",{}))})},{rootMargin:o,threshold:0});u.scrolledToObservers.set(i,a);try{u.contentDocument.querySelectorAll(n).forEach(function(e){a.observe(e)})}catch(e){}}}};try{for(var g=i(a),y=g.next();!y.done;y=g.next()){h(y.value)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}u.messageBus.subscribe("element_appeared",function(e){var t,n,r=e.mutationList,a=function(e,t){var n=o(e.split("\0"),1)[0];if(0===r.length||u.isMutationRelevantToSelector(r,n))try{u.contentDocument.querySelectorAll(n).forEach(function(e){t.observe(e)})}catch(e){}};try{for(var s=i(u.scrolledToObservers.entries()),l=s.next();!l.done;l=s.next()){var c=o(l.value,2);a(c[0],c[1])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}})}}},this.isPageObjectActive=function(e,t){var n,r,i,o={page:{url:u.globalScope.location.href}};if(e.conditions&&e.conditions.length>0&&!fr.evaluateConditions({context:o,result:{}},e.conditions))return!1;switch(e.trigger_type){case"url_change":return!0;case"manual":var a=e.trigger_value;return u.manuallyActivatedPageObjects.has(a.name);case"analytics_event":var s=e.id;if(u.analyticsEventState.has(s))return!0;a=e.trigger_value;var l=t,c={type:"analytics_event",data:{event:l.event,properties:l.properties}},d=fr.evaluateConditions({context:c,result:{}},a);return d&&u.analyticsEventState.add(s),d;case"element_appeared":var f=(a=e.trigger_value).selector;return u.elementAppearedState.has(f);case"element_visible":f=(a=e.trigger_value).selector;var v=null!==(n=a.visibilityRatio)&&void 0!==n?n:0,p="".concat(f,"\0").concat(v);return null!==(r=u.elementVisibilityState.get(p))&&void 0!==r&&r;case"exit_intent":var h=t.durationMs;return void 0===(a=e.trigger_value).minTimeOnPageMs||h>=a.minTimeOnPageMs;case"user_interaction":a=e.trigger_value;var g="".concat(a.selector,"\0").concat(a.interactionType,"\0").concat(a.minThresholdMs||0);return u.firedUserInteractions.has(g);case"time_on_page":var y=t;a=e.trigger_value;return y.durationMs>=a.durationMs;case"scrolled_to":if("percent"===(a=e.trigger_value).mode)return u.maxScrollPercentage>=a.percentage;if("element"===a.mode){var m=a.offsetPx||0;p="".concat(a.selector,"\0").concat(m);return null!==(i=u.scrolledToElementState.get(p))&&void 0!==i&&i}return!1;default:return!1}},this.webExperimentClient=e,this.messageBus=n,this.pageObjects=r,this.behavioralTargetingManager=s,this.options=l,this.globalScope=c}return Object.defineProperty(e.prototype,"contentDocument",{get:function(){return e=this.globalScope,or()&&null!==(n=null===(t=ar())||void 0===t?void 0:t.contentDocument)&&void 0!==n?n:e.document;var e,t,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentWindow",{get:function(){return e=this.globalScope,or()&&null!==(n=null===(t=ar())||void 0===t?void 0:t.contentWindow)&&void 0!==n?n:e;var e,t,n},enumerable:!1,configurable:!0}),e.prototype.getDebugPageObjects=function(){var e,t,n=this,r={},a=this.webExperimentClient.getActivePages(),s=function(e,t){r[e]=Object.values(t).map(function(t){var r=n.evaluateUrlConditions(t),i=n.buildTriggerDebugInfo(t,e,a);return{id:t.id,name:t.name,urlConditionsPassed:r,triggerPassed:i.passed,trigger:i,overallStatus:r&&i.passed?"pass":"fail"}})};try{for(var l=i(Object.entries(this.pageObjects)),c=l.next();!c.done;c=l.next()){var u=o(c.value,2);s(u[0],u[1])}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}return r},e.prototype.evaluateUrlConditions=function(e){return!e.conditions||0===e.conditions.length||fr.evaluateConditions({context:{page:{url:this.globalScope.location.href}},result:{}},e.conditions)},e.prototype.buildTriggerDebugInfo=function(e,t,n){var r,i,o;switch(e.trigger_type){case"url_change":return{type:"url_change",passed:!0};case"element_appeared":var a=e.trigger_value.selector;return{type:"element_appeared",passed:this.elementAppearedState.has(a),config:{selector:a}};case"element_visible":var s=e.trigger_value,l=(a=s.selector,s.visibilityRatio),c=null!=l?l:0,u="".concat(a,"\0").concat(c);return{type:"element_visible",passed:null!==(r=this.elementVisibilityState.get(u))&&void 0!==r&&r,config:{selector:a,visibilityRatio:c}};case"manual":var d=e.trigger_value.name;return{type:"manual",passed:this.manuallyActivatedPageObjects.has(d),config:{name:d}};case"analytics_event":return{type:"analytics_event",passed:this.analyticsEventState.has(e.id),config:{conditions:e.trigger_value}};case"user_interaction":var f=e.trigger_value,v=(a=f.selector,f.interactionType),p=f.minThresholdMs||0;u="".concat(a,"\0").concat(v,"\0").concat(p);return{type:"user_interaction",passed:this.firedUserInteractions.has(u),config:{selector:a,interactionType:v,minThresholdMs:p}};case"exit_intent":var h=e.trigger_value.minTimeOnPageMs;return{type:"exit_intent",passed:!!(null===(i=n[t])||void 0===i?void 0:i[e.id]),config:{minTimeOnPageMs:h}};case"time_on_page":var g=e.trigger_value.durationMs,y=Math.max(0,Date.now()-this.pageLoadTime);return{type:"time_on_page",passed:!(g in this.timeOnPageTimeouts),config:{durationMs:g},elapsedMs:y};case"scrolled_to":var m=e.trigger_value;if("percent"===m.mode){var b=m.percentage;return{type:"scrolled_to",passed:this.maxScrollPercentage>=b,config:{mode:"percent",percentage:b},currentPercentage:Math.round(this.maxScrollPercentage)}}a=m.selector;var w=m.offsetPx,S=w||0;u="".concat(a,"\0").concat(S);return{type:"scrolled_to",passed:null!==(o=this.scrolledToElementState.get(u))&&void 0!==o&&o,config:{mode:"element",selector:a,offsetPx:w}};default:return{type:"url_change",passed:!1}}},e.prototype.isMutationRelevantToSelector=function(e,t){var n,r,o,a;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var c=l.value;if(c.addedNodes.length>0)try{for(var u=(o=void 0,i(Array.from(c.addedNodes))),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.nodeType===Node.ELEMENT_NODE)try{var v=f;if(v.matches(t))return!0;if(v.querySelector(t))return!0}catch(e){}}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}if(c.target.nodeType===Node.ELEMENT_NODE)try{var p=c.target;if(p.matches(t))return!0;if(p.querySelector(t))return!0}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!1},e.prototype.calculateScrollPercentage=function(){var e=this.contentWindow.innerHeight,t=this.contentDocument.documentElement.scrollHeight,n=this.contentWindow.scrollY,r=t-e;return r<=0?0:n/r*100},e}(),pr={useDefaultNavigationHandler:!0},hr=function(){var e;if(!cr){var t=be(),n=Kn(null!==(e=null==t?void 0:t.document)&&void 0!==e?e:document,"* { visibility: hidden !important; background-image: none !important; }");cr=n,null==t||t.window.setTimeout(function(){cr===n&&gr()},1e3)}},gr=function(){null==cr||cr.revert(),cr=void 0},yr="AMP",mr="dclid",br="fbclid",wr="gbraid",Sr="gclid",xr="ko_click_id",kr="li_fat_id",Er="msclkid",_r="rdt_cid",Or="ttclid",Ar="twclid",Tr="wbraid",Cr={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,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Pr="MKTG",Mr=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},Ir=function(){var e,t=Mr();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=jr(n[0]),i=jr(n[1]);return i?(e[r]=i,e):e},{}):{}},jr=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Nr=function(){function e(e,n){void 0===n&&(n={}),this.options=t({},e),this.config=n}return e.prototype.isEnabled=function(){return n(this,void 0,void 0,function(){var n,i,o,a,s=this;return r(this,function(r){switch(r.label){case 0:return n="AMP_TEST",i=t({},this.options),o=new e(i),a=String(Date.now()),[4,o.transaction(n,function(e){var t,r;try{e.set(a);var i=e.get()===a;return!i&&s.config.diagnosticsClient&&(null===(t=s.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:n,testValue:a,sync:!0})),i}catch(e){if(s.config.diagnosticsClient){var o=e instanceof Error?e.message:String(e);null===(r=s.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:n,testValue:a,error:o,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,r.sent()]}})})},e.prototype.get=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=Vr(t);return void 0===n?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(n)}catch(n){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,o;return n(this,void 0,void 0,function(){var n,a,s,l,c,u,d,f,v;return r(this,function(r){switch(r.label){case 0:n=Mr(),a=n,r.label=1;case 1:return r.trys.push([1,4,,5]),(s=null==a?void 0:a.cookieStore)?[4,s.getAll(e)]:[3,3];case 2:if(l=r.sent()){l.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:l.map(function(e){return e.domain})}),null===(o=this.config.diagnosticsClient)||void 0===o||o.increment("cookies.duplicate.occurrence.cookieStore"));try{for(c=i(l),u=c.next();!u.done;u=c.next())if(d=u.value,Lr(d.domain,this.options.domain))return[2,d.value]}catch(e){f={error:e}}finally{try{u&&!u.done&&(v=c.return)&&v.call(c)}finally{if(f)throw f.error}}}r.label=3;case 3:return[3,5];case 4:return r.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,i=Mr(),o=(null!==(n=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,s=this.config.duplicateResolverFn;if("function"==typeof s&&o.length>1&&(a=o.find(function(t){var n;try{var i=s(t.substring(e.length+1));return i||null===(n=r.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),a||(a=o[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return n(this,void 0,void 0,function(){return r(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,i=null!==t?r:-1,o=void 0;if(i){var a=new Date;a.setTime(a.getTime()+24*i*60*60*1e3),o=a}var s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite));var l=Mr();(null==l?void 0:l.document)&&(l.document.cookie=s)}catch(t){var c=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}},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.isDomainWritable=function(t){return n(this,void 0,void 0,function(){var n,i;return r(this,function(r){switch(r.label){case 0:if(e.cachedTlds[t])return[2,!0];n="AMP_TLDTEST",i=new e({domain:"."+t}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i.transaction(n,function(n){if(e.cachedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}})];case 2:return[2,!!r.sent()];case 3:return r.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return n(this,void 0,void 0,function(){var n,i,o=this;return r(this,function(r){switch(r.label){case 0:if(n=function(){var e,t=Mr();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks}(),i=function(){return t({get:function(){return o.getSync(e)},set:function(t){return o.setSync(e,t)}})},!n)return[2,i()];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),i)];case 2:return[2,r.sent()];case 3:return r.sent(),[2,i()];case 4:return[2]}})})},e.cachedTlds={},e}(),Vr=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}}(e)},Lr=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},Dr=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({},Cr),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=Ir();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=Ir();return(e={})[mr]=t[mr],e[br]=t[br],e[wr]=t[wr],e[Sr]=t[Sr],e[xr]=t[xr],e[kr]=t[kr],e[Er]=t[Er],e[_r]=t[_r],e[Or]=t[Or],e[Ar]=t[Ar],e[Tr]=t[Tr],e},e}(),Ur=function(e,t){var n;try{var r=null===(n=Rr(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}},Br=function(e,t,n){var r;try{var i=JSON.stringify(n);null===(r=Rr(e))||void 0===r||r.setItem(t,i)}catch(t){console.warn("Failed to stringify and set JSON in ".concat(e,":"),t)}},Fr=function(e,t){var n;try{null===(n=Rr(e))||void 0===n||n.removeItem(t)}catch(t){console.warn("Failed to remove item from ".concat(e,":"),t)}},Rr=function(e){var t=be();return t?t[e]:null};function Kr(e,a){return n(this,void 0,void 0,function(){var n,s,l,c,u,d,f,v,p,h,g,y,m,b,w,S,x,k,E;return r(this,function(r){switch(r.label){case 0:return n="EXP_".concat(Pr,"_").concat(e.substring(0,10)),[4,qr(e)];case 1:s=o.apply(void 0,[r.sent(),2]),l=s[0],c=s[1],u=Ur("localStorage",n),d={},f=[c,u,l];try{for(v=i(f),p=v.next();!p.done;p=v.next())if(h=p.value)try{for(k=void 0,g=i(Object.entries(h)),y=g.next();!y.done;y=g.next())m=o(y.value,2),b=m[0],w=m[1],b.startsWith("utm_")&&void 0!==w&&(d[b]=w)}catch(e){k={error:e}}finally{try{y&&!y.done&&(E=g.return)&&E.call(g)}finally{if(k)throw k.error}}}catch(e){S={error:e}}finally{try{p&&!p.done&&(x=v.return)&&x.call(v)}finally{if(S)throw S.error}}return Object.keys(d).length>0?(function(e,t){var n="EXP_".concat(Pr,"_").concat(e.substring(0,10));Br("localStorage",n,t)}(e,d),[2,t(t({},a),{persisted_url_param:d})]):[2,a]}})})}function qr(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 Nr,n=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[yr,t,e.substring(0,n)].filter(Boolean).join("_")}(e,Pr),[4,(new Dr).parse()];case 1:return i=r.sent(),[4,t.get(n)];case 2:return o=r.sent(),[2,[i,o]]}})})}var Wr,zr="amp-exp-loading",Jr=function(){if(!document.getElementById(zr)){var e=document.createElement("div");e.id=zr,Wr=setTimeout(function(){Hr()},1e4),e.innerHTML="\n <style>\n #".concat(zr," {\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(zr," .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(zr," .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(zr,' .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(zr)||void 0===Wr||document.body.appendChild(e)};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}},Hr=function(){var e;Wr&&(clearTimeout(Wr),Wr=void 0),null===(e=document.getElementById(zr))||void 0===e||e.remove()},Gr=function(){try{var e=be();if(!e)return!0;var t=e.opener;return!t||t.closed}catch(e){return!0}},Xr="visual-editor-state",Qr=function(){function e(){}return e.setup=function(){var t,n="closed";Zn("opener_check",Gr()?"FAIL: window.opener is null, closed, or inaccessible":"PASS");var r=e.getStoredSession();if(r)return Zn("setup","stored session found, loading ".concat(r.injectSrc)),Yn("loading"),n="opening",Jr(),void $r(r.injectSrc).then(function(){n="open",Yn("loaded"),Zn("script_load_success","from stored session")}).catch(function(e){console.warn("Failed to load overlay from stored session:",e),n="closed",Yn("error"),Zn("script_load_error","from stored session: ".concat((null==e?void 0:e.message)||e)),Hr()});Zn("setup","no stored session, registering message listener"),Yn("waiting"),null===(t=be())||void 0===t||t.addEventListener("message",function(e){var t=/^.*\.amplitude\.com$/;try{if(!e.origin||!t.test(new URL(e.origin).hostname))return void Zn("origin_validation","FAIL: ".concat(e.origin||"(empty)"))}catch(t){return void Zn("origin_validation","FAIL: exception parsing origin ".concat(e.origin))}if("OpenOverlay"===e.data.type){Zn("message_received","origin=".concat(e.origin,", type=OpenOverlay")),Zn("origin_validation","PASS");var r=new URL(e.data.context.injectSrc);if("closed"!==n)return void Zn("state_guard","rejected: state=".concat(n));if("https:"!==r.protocol||!t.test(r.hostname))return void Zn("injectSrc_validation","FAIL: ".concat(r.href));Zn("injectSrc_validation","PASS (".concat(r.hostname,")")),Yn("loading"),n="opening",Jr(),$r(e.data.context.injectSrc).then(function(){n="open",Yn("loaded"),Zn("script_load_success")}).catch(function(){n="closed",Yn("error"),Zn("script_load_error","Failed to load ".concat(e.data.context.injectSrc)),Hr()})}})},e.getStoredSession=function(){var e=Ur("sessionStorage",Xr);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}(),$r=function(e){return new Promise(function(t,n){Zn("script_load_start","loading ".concat(e));Zn("readyState",document.readyState),function(){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e;var o=document.querySelector("[nonce]");if(o){var a=o.nonce||o.nonce||o.getAttribute("nonce");i.setAttribute("nonce",a),Zn("nonce_check","found: ".concat(a))}else Zn("nonce_check","not found, skipping");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)}}()})},Zr="amp-exp-opener-severed",Yr=function(){var e=document.getElementById(Zr);e&&("function"==typeof e.close&&e.open&&e.close(),e.remove())};var ei=Symbol.for("@amplitude/spa-link-interceptor-initiated");function ti(){if(!window[ei]){window[ei]=!0;document.addEventListener("click",function(e){var t,n,r=e.target.closest("a");if(r){var i=r.__mutationRecord__;if(null===(n=null===(t=null==i?void 0:i.attributes)||void 0===t?void 0:t.href)||void 0===n?void 0:n.mutations.length){var o=r.getAttribute("href"),a=r.getAttribute("target");o&&function(e,t,n){var r=n&&"_self"!==n||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button>0,i=new URL(t,window.location.href),o=i.href.split("#")[0]===window.location.href.split("#")[0],a=i.origin===window.location.origin;return!r&&a&&!o}(e,o,a)&&function(e){var t,n,r=Object.keys(e).find(function(e){return e.startsWith("__reactFiber")});return!!r&&String(null===(n=null===(t=e[r])||void 0===t?void 0:t.memoizedProps)||void 0===n?void 0:n.onClick).includes(".defaultPrevented")}(r)&&(e.preventDefault(),function(e){var t,n;if(null===(n=null===(t=window.next)||void 0===t?void 0:t.router)||void 0===n?void 0:n.push)return void window.next.router.push(e);history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate",{state:history.state}))}(o))}}},!0)}}var ni=function(){var e,t,n=be(),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 c=o(l.value,2),u=c[0],d=c[1];a[u]=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},ri=function(e){if(!e)return"";var t=new URL(e);return t.search="",t.hash="",t.toString()},ii=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()},oi=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+"/")})},ai=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,ai)},si="mutate",li="inject",ci="PREVIEW",ui="amp-preview-mode",di="VISUAL_EDITOR";me.Experiment=It;var fi=function(){function e(e,n,r){void 0===r&&(r={});var i,o=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.behavioralTargetingRules={},this.isVisualEditorMode=!1,this.isDebugActive=!1,this.isPreviewMode=!1,this.previewFlags={};var a=be();if(!a||!we())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=a,this.apiKey=e,this.initialFlags=JSON.parse(n.initialFlags),this.pageObjects=JSON.parse(n.pageObjects),this.behavioralTargetingRules=n.behavioralTargetingRules?JSON.parse(n.behavioralTargetingRules):{},Object.keys(this.behavioralTargetingRules).length>0&&(this.behavioralTargetingManager=new Rn(this.apiKey,this.behavioralTargetingRules)),this.config=t(t(t({},pr),r),null!==(i=this.globalScope.experimentConfig)&&void 0!==i?i:{}),this.initialFlags.forEach(function(e){var t=e.key,n=e.variants,r=e.metadata,i=void 0===r?{}:r;o.flagVariantMap[t]={},Object.keys(n).forEach(function(e){o.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]),o.flagVariantMap[t][e].metadata={deliveryMethod:"web"}}),"local"!==i.evaluationMode&&o.remoteFlagKeys.push(t)});var s=JSON.stringify(this.initialFlags);this.experimentClient=Pt.initialize(this.apiKey,t({internalInstanceNameSuffix:"web",initialFlags:s,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var l=this.experimentClient.all();this.localFlagKeys=Object.keys(l).filter(function(e){var t,n;return"local"===(null===(n=null===(t=l[e])||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.evaluationMode)}),this.messageBus=new zn}return e.prototype.start=function(){return n(this,void 0,void 0,function(){var e,n,a,s,l,c,u,d,f,v,p,h,g,y,m,b,w,S=this;return r(this,function(r){switch(r.label){case 0:if(this.isRunning)return[2];HTMLElement.prototype.removeChild=function(e){return e&&e.parentNode!==this?e:Node.prototype.removeChild.call(this,e)},ti(),e=ni(),n=!1;try{n=(null===(b=this.globalScope.frameElement)||void 0===b?void 0:b.id)===rr}catch(e){n=!1}return n&&or()?(this.globalScope.ampDomMutator=Dn,this.isRunning=!0,[2]):(this.isVisualEditorMode="true"===e[di]||null!==Ur("sessionStorage",Xr),Qn(this.globalScope),this.isDebugActive=$n(),this.subscriptionManager=new vr(this,this.messageBus,this.pageObjects,this.behavioralTargetingManager,t(t({},this.config),{isVisualEditorMode:this.isVisualEditorMode,isDebugActive:this.isDebugActive}),this.globalScope),this.setupPreviewMode(e),this.subscriptionManager.initSubscriptions(),er(function(){return{flags:S.buildFlagDebugInfo(),visualEditor:{isActive:S.isVisualEditorMode,source:S.isVisualEditorMode?null!==Ur("sessionStorage",Xr)?"session_storage":"url_param":null},currentUrl:S.globalScope.location.href}}),this.isVisualEditorMode?(a="true"===e[di]?"url_param":"session_storage",Zn("ve_mode_detected","source=".concat(a)),Gr()?(Zn("opener_check","FAIL: window.opener is null, closed, or inaccessible"),Yn("error"),function(){if(!document.getElementById(Zr)){var e=document.createElement("dialog");e.id=Zr,e.setAttribute("role","alertdialog"),e.setAttribute("aria-labelledby","".concat(Zr,"-title")),e.innerHTML="\n <style>\n @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&display=swap');\n\n #".concat(Zr,",\n #").concat(Zr," * {\n font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;\n }\n #").concat(Zr," code {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;\n }\n\n /* Defensive resets — host pages often style h2/h3/p with\n * text-transform, letter-spacing, etc. that would otherwise leak in. */\n #").concat(Zr," h2,\n #").concat(Zr," h3,\n #").concat(Zr," p,\n #").concat(Zr," button,\n #").concat(Zr," code,\n #").concat(Zr," hr {\n text-transform: none !important;\n letter-spacing: normal !important;\n text-decoration: none !important;\n font-style: normal !important;\n }\n\n #").concat(Zr," {\n border: none;\n padding: 0;\n background: white;\n border-radius: 8px;\n max-width: 480px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n color: #212124;\n }\n\n #").concat(Zr,"::backdrop {\n background: rgba(33, 33, 36, 0.4);\n }\n\n #").concat(Zr," .modal {\n position: relative;\n padding: 32px;\n }\n\n #").concat(Zr," .close-icon {\n position: absolute;\n top: 16px;\n right: 16px;\n width: 28px;\n height: 28px;\n padding: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n border-radius: 6px;\n color: #5a5e68;\n cursor: pointer;\n }\n\n #").concat(Zr," .close-icon:hover {\n background: #f3f4f6;\n color: #212124;\n }\n\n #").concat(Zr," .close-icon svg {\n width: 16px;\n height: 16px;\n }\n\n #").concat(Zr," .title {\n font-size: 18px;\n font-weight: 600;\n margin: 0 0 12px 0;\n padding-right: 24px;\n }\n\n #").concat(Zr," .body {\n font-size: 14px;\n line-height: 1.5;\n margin: 0 0 12px 0;\n color: #5a5e68;\n }\n\n #").concat(Zr," .divider {\n border: none;\n border-top: 1px solid #e5e7eb;\n margin: 20px 0;\n }\n\n #").concat(Zr," .subtitle {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 8px 0;\n color: #212124;\n }\n\n #").concat(Zr," code {\n background: #f3f4f6;\n padding: 1px 6px;\n border-radius: 4px;\n font-size: 13px;\n }\n\n #").concat(Zr," .actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 24px;\n }\n\n #").concat(Zr," .secondary {\n font-size: 14px;\n padding: 8px 16px;\n border-radius: 6px;\n background: white;\n color: #212124;\n border: 1px solid #d1d5db;\n cursor: pointer;\n }\n\n #").concat(Zr,' .secondary:hover {\n background: #f9fafb;\n }\n </style>\n\n <div class="modal">\n <button\n type="button"\n class="close-icon"\n data-action="close"\n aria-label="Close"\n >\n <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">\n <path d="M3 3 L13 13 M13 3 L3 13" />\n </svg>\n </button>\n <h2 id="').concat(Zr,'-title" class="title">Can\'t connect to this page</h2>\n <p class="body">\n The Visual Editor lost its connection to this page and can\'t make\n edits here. This is usually a configuration issue on the site.\n </p>\n <hr class="divider" />\n <h3 class="subtitle">Technical Details</h3>\n <p class="body">\n This page sends a <code>Cross-Origin-Opener-Policy</code> header that\n isolates it from the editor window. To resolve this:\n </p>\n <p class="body">\n Remove the <code>Cross-Origin-Opener-Policy</code> header, or set its\n value to <code>unsafe-none</code> on pages you want to edit.\n </p>\n <div class="actions">\n <button type="button" class="secondary" data-action="close">Close</button>\n </div>\n </div>\n ');var t=function(){document.getElementById(Zr)||(document.body.appendChild(e),"function"==typeof e.showModal?e.showModal():e.setAttribute("open",""),e.querySelectorAll('button[data-action="close"]').forEach(function(e){e.addEventListener("click",function(){Yr()})}))};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}}(),this.globalScope.history.replaceState({},"",ii(this.globalScope.location.href,[di])),this.isRunning=!0,[2]):(Zn("opener_check","PASS"),or()?[4,lr(this.globalScope)]:[3,2])):[3,3]);case 1:r.sent(),r.label=2;case 2:return Qr.setup(),this.globalScope.history.replaceState({},"",ii(this.globalScope.location.href,[di])),Zn("url_param_removed","cleaned URL: ".concat(this.globalScope.location.href)),this.subscriptionManager.markUrlAsPublished(this.globalScope.location.href),this.messageBus.publish("url_change",{updateActivePages:!0}),this.isRunning=!0,wi(this),[2];case 3:this.subscriptionManager.markUrlAsPublished(this.globalScope.location.href),this.messageBus.publish("url_change",{updateActivePages:!0}),s="EXP_".concat(this.apiKey.slice(0,10)),(l=Ur("localStorage",s)||{}).web_exp_id?l.web_exp_id&&l.device_id&&(delete l.device_id,Br("localStorage",s,l)):(l.web_exp_id=l.device_id||ai(),delete l.device_id,Br("localStorage",s,l)),c=this.getVariants();try{for(u=i(Object.entries(c)),d=u.next();!d.done;d=u.next())f=o(d.value,2),v=f[0],p=f[1],this.remoteFlagKeys.includes(v)&&(null===(w=p.metadata)||void 0===w?void 0:w.blockingEvaluation)&&Object.keys(this.activePages).includes(v)&&!this.remoteFlagKeys.every(function(e){return Object.keys(S.previewFlags).includes(e)})&&(this.isRemoteBlocking=!0,hr())}catch(e){y={error:e}}finally{try{d&&!d.done&&(m=u.return)&&m.call(u)}finally{if(y)throw y.error}}return[4,Kr(this.apiKey,l)];case 4:return h=r.sent(),this.globalScope.experimentIntegration||(g=Me.getInstance("$default_instance"),this.globalScope.experimentIntegration=new He(this.apiKey,g,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(h),this.updateUserWithBehaviors(),this.isRemoteBlocking||gr(),this.applyVariants({flagKeys:this.localFlagKeys}),this.previewVariants({keyToVariant:this.previewFlags}),this.remoteFlagKeys.every(function(e){return Object.keys(S.previewFlags).includes(e)})?(this.isRunning=!0,wi(this),[2]):[4,this.fetchRemoteFlags()];case 5:return r.sent(),this.applyVariants({flagKeys:this.remoteFlagKeys}),this.isRunning=!0,wi(this),[2]}})})},e.getInstance=function(t,n,r){void 0===r&&(r={});var i=be();if(!i)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(i.webExperiment&&!i.webExperiment.isStub){var o=i.webExperiment;return o.isRunning&&wi(o),o}var a=new e(t,n,r);return i.webExperiment=a,a},e.prototype.getExperimentClient=function(){return this.experimentClient},e.prototype.hideLoadingIndicator=function(){Hr()},e.prototype.applyVariants=function(e){var t,n,r=(e||{}).flagKeys,i=this.getVariants();if(0!==Object.keys(i).length){var o=ri(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 c=Object.keys(this.appliedMutations[a]);c.length>0&&!c.includes(l)&&(this.revertVariants({flagKeys:[a]}),delete this.appliedMutations[a])}if("web"===(null===(n=s.metadata)||void 0===n?void 0:n.deliveryMethod)){var u=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}u&&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 c=l.value,u=this.appliedMutations[c];if(u){for(var d in u){var f=u[d];if(f)for(var v in f)for(var p in f[v])null===(o=null===(r=f[v][p])||void 0===r?void 0:r.revert)||void 0===o||o.call(r)}delete this.appliedMutations[c]}}}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&&Wn({flags:this.previewFlags});var a=o.payload;if(!a||!Array.isArray(a))return void(this.isActionActiveOnPage(n,void 0)&&this.exposureWithDedupe(n,o));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.updateUserWithBehaviors=function(){var e,n;if(this.behavioralTargetingManager){var r=[];try{for(var s=i(this.behavioralTargetingManager.getMatchedBehaviors().values()),l=s.next();!l.done;l=s.next()){var c=l.value;r.push.apply(r,a([],o(c),!1))}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}var u=this.experimentClient.getUser(),d=t(t({},u),{behavioral_targeting:r});this.experimentClient.setUser(d)}},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.toggleManualPageObject=function(e,t){var n;void 0===t&&(t=!0),null===(n=this.subscriptionManager)||void 0===n||n.toggleManualPageObject(e,t)},e.prototype.getDebugState=function(){return tr()},e.prototype.buildFlagDebugInfo=function(){var e,t,n,r,s,l,c={},u=this.getVariants(),d=null!==(r=null===(n=this.subscriptionManager)||void 0===n?void 0:n.getDebugPageObjects())&&void 0!==r?r:{},f=this.localFlagKeys.length>0?this.experimentClient.getEvaluationTraces(this.localFlagKeys):void 0;try{for(var v=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),p=v.next();!p.done;p=v.next()){var h=p.value,g=u[h],y=this.activePages[h],m=void 0,b=null==f?void 0:f[h];b?m={matched:b.matched,matchedSegment:b.matchedSegment,steps:b.steps}:(null===(s=null==g?void 0:g.metadata)||void 0===s?void 0:s.segmentName)&&(m={matched:!0,matchedSegment:g.metadata.segmentName,steps:[]}),c[h]={flagKey:h,variant:(null==g?void 0:g.key)?{key:g.key,value:g.value,metadata:g.metadata}:null,isActive:!!y&&Object.keys(y).length>0,audienceEvaluation:m,pageObjects:null!==(l=d[h])&&void 0!==l?l:[]}}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=v.return)&&t.call(v)}finally{if(e)throw e.error}}return c},e.prototype.addDebugStateSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addDebugStateSubscriber(e)},e.prototype.plugin=function(){var e=this;return{name:"@amplitude/experiment-tag",type:"enrichment",setup:function(){return n(e,void 0,void 0,function(){return r(this,function(e){return[2]})})},execute:function(t){return n(e,void 0,void 0,function(){return r(this,function(e){return this.trackEvent(t.event_type,t.event_properties),[2,t]})})}}},e.prototype.trackEvent=function(e,t){var n;null===(n=this.behavioralTargetingManager)||void 0===n||n.trackEvent(e,t||{}),this.messageBus.publish("analytics_event",{event:e,properties:t||{}})},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===si?this.handleMutate(s,e,t):s.action===li&&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=ri(this.previousUrl||this.globalScope.document.referrer),c=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.url;if(ri(this.globalScope.location.href)!==l){var u=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,c);this.globalScope.location.href!==u&&(this.storeRedirectImpressions(t,i,c),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 Nr({sameSite:"Lax"}),n=new Dr,i="AMP_".concat(Pr,"_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(u):this.globalScope.location.replace(u))}}},e.prototype.handleMutate=function(e,n,r){var i,o,a,s,l,c=this,u=(null===(i=e.data)||void 0===i?void 0:i.mutations)||[],d=r.key||"";if(0!==u.length){var f={};u.forEach(function(e,t){var i,o,a,s,l,u,v,p,h,g,y;c.isActionActiveOnPage(n,null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.scope)?(c.exposureWithDedupe(n,r),(null===(y=null===(g=null===(h=c.appliedMutations[n])||void 0===h?void 0:h[d])||void 0===g?void 0:g[si])||void 0===y?void 0:y[t])||(f[t]=Ln.declarative(e))):(null===(s=null===(a=null===(o=c.appliedMutations[n])||void 0===o?void 0:o[d])||void 0===a?void 0:a[si])||void 0===s?void 0:s[t])&&(null===(p=null===(v=null===(u=null===(l=c.appliedMutations[n])||void 0===l?void 0:l[d])||void 0===u?void 0:u[si])||void 0===v?void 0:v[t])||void 0===p||p.revert(),delete c.appliedMutations[n][d][si][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][si]=t(t({},this.appliedMutations[n][d][si]),f),0===Object.keys(this.appliedMutations[n][d][si]||{}).length&&delete this.appliedMutations[n][d][si],0===Object.keys(this.appliedMutations[n][d]||{}).length&&delete this.appliedMutations[n]}},e.prototype.handleInject=function(e,t,i){var o,a,s,l,c,u,d,f,v,p,h,g,y=this,m=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,S=e.data.js;S&&(w=this.globalScope.document.createElement("script"))&&(w.innerHTML="function ".concat(b,"(html, utils, id){").concat(S,"};"),w.id="js-".concat(b),this.globalScope.document.head.appendChild(w));var x,k=e.data.css;k&&(x=Kn(this.globalScope.document,k));var E,_=e.data.html;_&&(E=null!==(u=(new DOMParser).parseFromString(_,"text/html").body.firstElementChild)&&void 0!==u?u:void 0);var O={cancelled:!1},A=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||(An(),s.insertBefore(t,l),Tn(),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 T=this.globalScope[b];T&&"function"==typeof T&&T(E,A,b)}catch(e){null==w||w.remove(),console.error("Experiment inject failed for ".concat(t," variant ").concat(i.key,". Reason:"),e)}null!==(d=(p=this.appliedMutations)[t])&&void 0!==d||(p[t]={}),null!==(f=(h=this.appliedMutations[t])[m])&&void 0!==f||(h[m]={}),null!==(v=(g=this.appliedMutations[t][m])[li])&&void 0!==v||(g[li]={}),this.appliedMutations[t][m][li][b]={revert:function(){var e;O.cancelled=!0,null===(e=A.remove)||void 0===e||e.call(A),null==x||x.revert(),null==w||w.remove(),y.appliedInjections.delete(b)}},this.exposureWithDedupe(t,i)}}else null===(c=null===(l=null===(s=null===(a=this.appliedMutations[t])||void 0===a?void 0:a[m])||void 0===s?void 0:s[li])||void 0===l?void 0:l[0])||void 0===c||c.revert()},e.prototype.exposureWithDedupe=function(e,t,n){var r,i,o,a,s=ri(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||this.previewFlags[e]){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=Ur("sessionStorage",r)||{};i[e]={redirectUrl:n,variant:t},Br("sessionStorage",r,i)},e.prototype.fireStoredRedirectImpressions=function(){var e=this,t="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),n=Ur("sessionStorage",t)||{};if(Object.keys(n).length>0)for(var r in n){var i=n[r],o=i.redirectUrl,a=i.variant,s=ri(this.globalScope.location.href),l=ri(o);oi([s],l)&&(this.exposureWithDedupe(r,a,!0),delete n[r])}Object.keys(n).length>0?this.globalScope.setTimeout(function(){var n=Ur("sessionStorage",t)||{};for(var r in n)e.exposureWithDedupe(r,n[r].variant,!0);Fr("sessionStorage",t)},500):Fr("sessionStorage",t)},e.prototype.setupPreviewMode=function(e){var t=this;if("true"===e[ci]){Object.keys(e).forEach(function(n){n!==ci&&e[n]&&(t.previewFlags[n]=e[n])}),Br("sessionStorage",ui,{previewFlags:this.previewFlags});var n=a(a([],o(Object.keys(this.previewFlags)),!1),[ci],!1);this.globalScope.history.replaceState({},"",ii(this.globalScope.location.href,n)),Qr.setup()}else{var r=Ur("sessionStorage",ui);r&&(this.previewFlags=r.previewFlags)}Object.keys(this.previewFlags).length>0&&(this.isPreviewMode=!0)},e}();var vi=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 c 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(c,t.headers[c]);i.send(t.body||null)})},pi={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,vi(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,(c=s(),u=a,!u||u<=0?c:Promise.race([c,new Promise(function(e,t){return setTimeout(function(){return t(new he("Timeout after ".concat(u,"ms")))},u)})]))];var c,u})})}},hi=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,o,a;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.23.3"),[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),i=n.flags,o=n.pageObjects,a=n.behavioralTargetingRules,[2,{flags:i,pageViewObjects:o,behavioralTargetingRules:a}]}})})},e}(),gi=[],yi=function(e,t,n){fi.getInstance(e,t,n).start().finally(function(){gr()})},mi=function(e,t){return n(void 0,void 0,void 0,function(){return r(this,function(n){return[2,new hi(e,"EU"===t?"https://api.lab.eu.amplitude.com":"https://api.lab.amplitude.com",pi).getPreviewFlagsAndPageViewObjects()]})})},bi=function(){return{name:"@amplitude/experiment-tag",type:"enrichment",execute:function(e){return n(void 0,void 0,void 0,function(){var t,n;return r(this,function(r){return t=be(),(n=null==t?void 0:t.webExperiment)&&"function"==typeof n.trackEvent&&n.isRunning?n.trackEvent(e.event_type,e.event_properties):gi.push({event_type:e.event_type,event_properties:e.event_properties}),[2,e]})})}}},wi=function(e){gi.length>0&&(gi.forEach(function(t){var n=t.event_type,r=t.event_properties;e.trackEvent(n,r)}),gi.length=0)};e.createPlugin=bi,e.flushEventBuffer=wi,e.initialize=function(e,t,n){var r,i=be();if(!i)throw new Error("Global scope not available");i.webExperiment||(i.webExperiment={plugin:bi,isStub:!0}),function(){if("true"===ni()[ci])return!0;var e=Ur("sessionStorage",ui);return!!((null==e?void 0:e.previewFlags)&&Object.keys(e.previewFlags).length>0)}()||(null===(r=i.WebExperiment)||void 0===r?void 0:r.injectedByExtension)?(hr(),mi(e,n.serverZone).then(function(t){var r=JSON.stringify(t.flags),i=JSON.stringify(t.pageViewObjects),o=JSON.stringify(t.behavioralTargetingRules);yi(e,{initialFlags:r,pageObjects:i,behavioralTargetingRules:o},n)}).catch(function(r){console.warn("Failed to fetch latest configs for preview:",r),yi(e,t,n)}).finally(function(){gr()})):yi(e,t,n)},Object.defineProperty(e,"__esModule",{value:!0})}(this.WebExperiment=this.WebExperiment||{});
3
+ /* @amplitude/experiment-js-client v1.21.1 - For license info see https://app.unpkg.com/@amplitude/experiment-js-client@1.21.1/files/LICENSE */function Fe(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 Re(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 Ke(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 qe(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 We(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=Je(e,t),o=void 0,a=me.document.cookie.split("; ");try{for(var s=Ke(a),l=s.next();!l.done;l=s.next()){var c=qe(l.value.split("=",2),2),u=c[0],d=c[1];u===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 f=atob(o);return JSON.parse(decodeURIComponent(f))}var v=o.split("."),p=void 0;return v.length>=2&&v[1]&&(p=atob(v[1])),{deviceId:v[0],userId:p}}catch(e){return}},Je=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))},He=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 Fe(this,void 0,void 0,function(){return Re(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=Je(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=Je(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 Fe(this,void 0,void 0,function(){var t,n=this;return Re(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 Ge,Xe,Qe,$e=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 c 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(c,t.headers[c]);i.send(t.body||null)})},Ze=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Fe(this,void 0,void 0,function(){return Re(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}(),Ye={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)})}(Fe(void 0,void 0,void 0,function(){var i,o;return Re(this,function(a){switch(a.label){case 0:return[4,$e(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"}(Ge||(Ge={})),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"}(Qe||(Qe={}));var et=function(e){return!e||e===Qe.FallbackInline||e===Qe.FallbackConfig||e===Qe.SecondaryInitialVariants},tt={debug:!1,logLevel:Ge.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:Ye},nt="1.21.1",rt=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:tt.instanceName;this.queue=new ot(i),this.cache=new it(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}(),it=function(){function e(e){this.isSessionStorageAvailable=at(),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}(),ot=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=we(),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}(),at=function(){var e=be();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},st=function(){function e(e,t){void 0===t&&(t=Ge.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>=Ge.Error&&(t=this.logger).error.apply(t,We([e],qe(n),!1))},e.prototype.warn=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Warn&&(t=this.logger).warn.apply(t,We([e],qe(n),!1))},e.prototype.info=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Info&&(t=this.logger).info.apply(t,We([e],qe(n),!1))},e.prototype.debug=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Debug&&(t=this.logger).debug.apply(t,We([e],qe(n),!1))},e.prototype.verbose=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=Ge.Verbose&&(t=this.logger).verbose.apply(t,We([e],qe(n),!1))},e}(),lt=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,We([e],qe(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,We([e],qe(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,We([e],qe(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,We([e],qe(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,We([e],qe(t),!1))},e}(),ct=function(){function e(){this.globalScope=be()}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}(),dt=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 Be({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,n;try{for(var r=Ke(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=Ke(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}(),ft=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}},vt=function(){function e(){this.globalScope=be()}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}(),pt=function(e){return null==e},ht=function(e){return!!pt(e)||e&&0===Object.keys(e).length},gt=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},yt=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 Fe(this,void 0,void 0,function(){return Re(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 Fe(this,void 0,void 0,function(){var r=this;return Re(this,function(i){return this.done||(this.timeoutHandle=me.setTimeout(function(){return Fe(r,void 0,void 0,function(){var r,i;return Re(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){var t,n,r,i;if(!e)return{};var o={user:e},a=be();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var l=Ke(Object.keys(e.groups)),c=l.next();!c.done;c=l.next()){var u=c.value,d=e.groups[u];if(d.length>0&&d[0]){var f=d[0],v={group_name:f},p=null===(i=null===(r=e.group_properties)||void 0===r?void 0:r[u])||void 0===i?void 0:i[f];p&&Object.keys(p).length>0&&(v.group_properties=p),s[u]=v}}}catch(e){t={error:e}}finally{try{c&&!c.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},bt=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},wt=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},St=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}(),xt=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}(),kt=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=Ke(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=qe(o.value,2),s=a[0],l=a[1];pt(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=Be(Be(Be({},tt),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":tt.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":tt.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=n.flagConfigPollingIntervalMillis)&&void 0!==o?o:tt.flagConfigPollingIntervalMillis}),this.logger=new st(this.config.loggerProvider||new lt,e.getLogLevel(n));var l=null===(a=this.config)||void 0===a?void 0:a.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new Se(function(){return Fe(s,void 0,void 0,function(){var e;return Re(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),this.logger.info(e),[3,3];case 3:return[2]}})})},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var c in this.config.initialVariants)this.config.initialVariants[c]=ft(this.config.initialVariants[c]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new St(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new xt(this.config.exposureTrackingProvider)),this.integrationManager=new rt(this.config,this);var u,d=new Ze(this.config.httpClient||Ye);this.flagApi=new ye(this.apiKey,this.config.flagsServerUrl,d),this.evaluationApi=new ge(this.apiKey,this.config.serverUrl,d);var f=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;u=this.isWebExperiment?new vt:new ct,this.variants=function(e,t,n){var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r);return new dt(i,n,ft)}(this.apiKey,f,u),this.flags=function(e,t,n){void 0===n&&(n=new ct);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-flags");return new dt(i,n)}(this.apiKey,f,u),this.fetchVariantsOptions=function(e,t,n){void 0===n&&(n=new ct);var r=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(r,"-variants-options");return new ut(i,n)}(this.apiKey,f,u);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Fe(this,void 0,void 0,function(){var t,n,r;return Re(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 Fe(this,arguments,void 0,function(e,t){var n;return void 0===e&&(e=this.user),Re(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);gt(n)||delete e[t]}return Be(Be(Be({},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=Be({},this.user.user_properties);return Be(Be({},this.user),{user_properties:t})}return Be({},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=Be({},e.user_properties);this.user=Be(Be({},e),{user_properties:n})}else this.user=Be({},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=H(this.flags.getAll(),e),o=mt(r),a=this.engine.evaluate(o,i),s={};try{for(var l=Ke(Object.keys(a)),c=l.next();!c.done;c=l.next()){var u=c.value;s[u]=wt(a[u])}}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.getEvaluationTraces=function(e){var t=this.addContext(this.user),n=H(this.flags.getAll(),e),r=mt(t);return this.engine.evaluateWithTraces(r,n).traces},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(gt(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=Qe.LocalEvaluation,s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!pt(o)&&!s)return{variant:bt(o),source:a,hasDefaultVariant:!1};if(s&&(i={variant:bt(o),source:a,hasDefaultVariant:!0}),!pt(n))return{variant:bt(n),source:Qe.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!pt(l))return{variant:bt(l),source:Qe.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var c=bt(this.config.fallbackVariant),u={variant:c,source:Qe.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return ht(c)?i:u},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(!pt(i)&&!o)return{variant:bt(i),source:Qe.LocalStorage,hasDefaultVariant:!1};if(o&&(r={variant:bt(i),source:Qe.LocalStorage,hasDefaultVariant:!0}),!pt(t))return{variant:bt(t),source:Qe.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var a=this.config.initialVariants[e];if(!pt(a))return{variant:bt(a),source:Qe.SecondaryInitialVariants,hasDefaultVariant:r.hasDefaultVariant};var s=bt(this.config.fallbackVariant),l={variant:s,source:Qe.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return ht(s)?r:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var n,r={},i=this.config.initialVariants[e];if(!pt(i))return{variant:bt(i),source:Qe.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(!pt(o)&&!a)return{variant:bt(o),source:Qe.LocalStorage,hasDefaultVariant:!1};if(a&&(r={variant:bt(o),source:Qe.LocalStorage,hasDefaultVariant:!0}),!pt(t))return{variant:bt(t),source:Qe.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var s=bt(this.config.fallbackVariant),l={variant:s,source:Qe.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return ht(s)?r:l},e.prototype.fetchInternal=function(e,t,n,r){return Fe(this,void 0,void 0,function(){var i,o,a;return Re(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,Be({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 Fe(this,void 0,void 0,function(){return Re(this,function(t){return this.fetchVariantsOptions.put(Be(Be({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=Be({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,n){return Fe(this,void 0,void 0,function(){var r,i,o,a,s,l,c;return Re(this,function(u){switch(u.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=u.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Be({timeoutMillis:t},n))];case 2:r=u.sent(),i={};try{for(o=Ke(Object.keys(r)),a=o.next();!a.done;a=o.next())s=a.value,i[s]=wt(r[s])}catch(e){l={error:e}}finally{try{a&&!a.done&&(c=o.return)&&c.call(o)}finally{if(l)throw l.error}}return this.logger.debug("[Experiment] Received variants: ",i),[2,i]}})})},e.prototype.doFlags=function(){return Fe(this,void 0,void 0,function(){var e,t,n;return Re(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:nt,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 Fe(this,void 0,void 0,function(){var n,r,i,o;return Re(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 Fe(this,void 0,void 0,function(){var n=this;return Re(this,function(r){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new yt(8,500,1e4,1.5),this.retriesBackoff.start(function(){return Fe(n,void 0,void 0,function(){return Re(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=Be(Be(Be({},null==n?void 0:n.user_properties),r.user_properties),null==e?void 0:e.user_properties);return Be(Be(Be(Be({library:"experiment-js-client/".concat(nt)},n),r),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Fe(this,void 0,void 0,function(){return Re(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,c,u;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},f=et(t.source);if(!f||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 v=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(f||(null==v?void 0:v.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(c=t.variant)||void 0===c?void 0:c.value)&&(d.variant=t.variant.value)),v&&(d.metadata=v),this.isWebExperiment&&(d.time=Date.now()),this.isWebExperiment){var p=be();if(null==p?void 0:p.location)try{var h=p.location.href;d.metadata.url=h.split("?")[0]||""}catch(e){}}var g=this.addContext(this.getUser());null===(u=this.userSessionExposureTracker)||void 0===u||u.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);et(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?Ge.Debug:null!==(t=e.logLevel)&&void 0!==t?t:Ge.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof pe)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),Et=function(){function e(e,t){var n,r,i;this.globalScope=be(),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 Le.UAParser(this.userAgent).getResult(),this.localStorage=new ct,this.sessionStorage=new vt,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 Be({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=Ke(i.searchParams),a=o.next();!a.done;a=o.next()){var s=qe(a.value,2),l=s[0],c=s[1];r[l]=We(We([],qe(null!==(n=r[l])&&void 0!==n?n:[]),!1),qe(c.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=qe(t,2),r=n[0],i=n[1];return e[r]=1==i.length?i[0]:i,e},{})}},e}();me.experimentInstances={};var _t=me.experimentInstances,Ot=function(e,t){return Ct(e,t)},At=function(e,t){return Ct(e,t,function(){return new He(e,Me.getInstance(Tt(t)),1e4)})},Tt=function(e){return(null==e?void 0:e.instanceName)||tt.instanceName},Ct=function(e,t,n){var r=function(e,t){var n=Tt(t),r=null==t?void 0:t.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)}(e,t),i=_t[r];return i||(i=function(e,t){return new kt(e,Be(Be({},t),{userProvider:new Et(null==t?void 0:t.userProvider,e)}))}(e,t),n&&i.addPlugin(n()),_t[r]=i,i)},Pt={initialize:Ot,initializeWithAmplitudeAnalytics:At},Mt=function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return Fe(this,void 0,void 0,function(){return Re(this,function(e){return[2]})})},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return Fe(this,void 0,void 0,function(){return Re(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 tt.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}(),It=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:Ue,AmplitudeIntegrationPlugin:He,AmplitudeUserProvider:De,ConsoleLogger:lt,Experiment:Pt,ExperimentClient:kt,get LogLevel(){return Ge},get Source(){return Xe},StubExperimentClient:Mt,initialize:Ot,initializeWithAmplitudeAnalytics:At});function jt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Nt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return jt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Vt(){return Vt=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},Vt.apply(null,arguments)}var Lt=["selector","action","value","attribute"],Dt=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Ut={revert:function(){}},Bt=new Map,Ft=[],Rt=new Set,Kt=!1,qt=1;function Wt(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 zt(e){var t=Bt.get(e);return t||(t={element:e,attributes:{}},Bt.set(e,t)),t}function Jt(e,t){return e.parentNode===t.parentNode&&e.insertBeforeNode===t.insertBeforeNode}function Ht(e,t){Rt.add(e),e.__params=t,Kt||e.observe.apply(e,e.__params)}function Gt(e,t,n,r,i){var o,a=n(e),s=function(e){An(),i(e),Tn()},l={isDirty:!1,originalValue:a,virtualValue:a,mutations:[],el:e,rateLimitCount:0,observer:new MutationObserver(function(r){if(!(l.rateLimitCount>=10)){if(l.rateLimitCount++,setTimeout(function(){l.rateLimitCount=l.rateLimitCount-1,l.rateLimitCount<=0&&(l.rateLimitCount=0)},1e3),"html"===t)return An(),r.forEach(function(t){var n=t.target,r=t.type,i=t.oldValue;if("childList"===r)return t.removedNodes.forEach(function(e){n.insertBefore(e,t.nextSibling)}),void t.addedNodes.forEach(function(e){e.remove()});if("characterData"!==r){if("attributes"===r&&n instanceof Element){if(n===e)return;var o=t.attributeName;if(!o)return;null===i?n.removeAttribute(o):n.setAttribute(o,i)}}else n.nodeValue=i}),void Tn();var i=n(e);if("position"===t){if(Jt(i,l.virtualValue))return;var o=l.mutations.at(-1);if(!o)return;if(bn(l.virtualValue.parentNode,o))return}i!==l.virtualValue&&("position"!==t&&(l.originalValue=i),s(l))}}),mutationRunner:s,setValue:r,getCurrentValue:n};return o="position"===t&&e.parentNode?[e.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}]:[e,Wt(t)],Ht(l.observer,o),l}function Xt(e,t){var n=t.getCurrentValue(t.el);t.virtualValue=e,!e||"string"==typeof e||"string"==typeof n||Array.isArray(e)||Array.isArray(n)?e!==n&&(t.isDirty=!0,yn()):n&&Jt(n,e)||(t.isDirty=!0,yn())}var Qt=new DOMParser;function $t(e){var t=e.originalValue,n=t.map(function(e){return e instanceof Element?e.outerHTML:e.nodeValue}).join("");e.mutations.forEach(function(r){if(n=r.mutate(n),r.cachedHtml!==n||!r.cachedNodes.has(e.el)){r.cachedHtml=n;var i=Array.from(Qt.parseFromString(n,"text/html").body.childNodes);r.cachedNodes.set(e.el,i)}t=r.cachedNodes.get(e.el)}),Xt(t,e)}function Zt(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach(function(e){return e.mutate(t)}),Xt(Array.from(t).filter(Boolean).join(" "),e)}function Yt(e){var t=e.originalValue;e.mutations.forEach(function(e){t=e.mutate(t)}),Xt(t,e)}function en(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 Vt({},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 tn(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=en(i.mutate());i.newPosition=o}if(i.newPosition){t=i.newPosition;break}}Xt(t,e)}var nn=function(e){return Array.from(e.childNodes)},rn=function(e,t){for(var n=0,r=Array.from(e.children);n<r.length;n++){r[n].__removedByDomMutator__=!0}e.innerHTML="";for(var i,o=Nt(t);!(i=o()).done;){var a=i.value;a instanceof Element&&delete a.__removedByDomMutator__}e.append.apply(e,t)};function on(e){var t=zt(e);return t.html||(t.html=Gt(e,"html",nn,rn,$t)),t.html}var an=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextSibling}},sn=function(e,t){var n;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 r=null==(n=zt(e).position)?void 0:n.observer;null!=r&&r.__params&&(r.disconnect(),Ht(r,[e.parentNode,r.__params[1]]))};function ln(e){var t=zt(e);return t.position||(t.position=Gt(e,"position",an,sn,tn)),t.position}var cn=function(e,t){t?e.className=t:e.removeAttribute("class")},un=function(e){return e.className};function dn(e){var t=zt(e);return t.classes||(t.classes=Gt(e,"class",un,cn,Zt)),t.classes}var fn=function(e){return function(t){var n;return"style"===e?t.style.cssText:null!=(n=t.getAttribute(e))?n:null}},vn=function(e){return function(t,n){null!==n?"style"===e?n?t.style.cssText=n:t.removeAttribute("style"):t.setAttribute(e,n):t.removeAttribute(e)}};function pn(e,t){var n=zt(e);return n.attributes[t]||(n.attributes[t]=Gt(e,t,fn(t),vn(t),Yt)),n.attributes[t]}function hn(e,t,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||function(e,t){var n,r=Bt.get(e);if(r){var i,o;if("html"===t)i=null==(o=r.html)?void 0:o.observer,delete r.html;else if("class"===t){var a;i=null==(a=r.classes)?void 0:a.observer,delete r.classes}else if("position"===t){var s;i=null==(s=r.position)?void 0:s.observer,delete r.position}else{var l;i=null==(l=r.attributes)||null==(l=l[t])?void 0:l.observer,delete r.attributes[t]}null==(n=i)||n.disconnect(),Rt.delete(i)}}(e,t),n.setValue(e,r)}}function gn(e,t){e.html&&hn(t,"html",e.html),e.classes&&hn(t,"class",e.classes),e.position&&hn(t,"position",e.position),Object.keys(e.attributes).forEach(function(n){hn(t,n,e.attributes[n])})}function yn(){Bt.forEach(gn)}function mn(e,t){var n=null;"html"===e.kind?n=on(t):"class"===e.kind?n=dn(t):"attribute"===e.kind?n=pn(t,e.attribute):"position"===e.kind&&(n=ln(t)),n&&(n.mutations.push(e),n.mutationRunner(n),t.__mutationRecord__=zt(t))}function bn(e,t){for(var n=t._priority||0,r=e;r;){var i;if(((null==(i=Bt.get(r))||null==(i=i.html)||null==(i=i.mutations.at(-1))?void 0:i._priority)||0)>n)return!0;r=r.parentElement}return!1}function wn(e){var t=Array.from(e.elements);if(!t.some(function(e){return e.isConnected})){if(t.length>0){for(var n=t.at(-1);n.parentElement;)n=n.parentElement;if(n.__removedByDomMutator__)return}var r=new Set(e.elements);document.querySelectorAll(e.selector).forEach(function(t){r.has(t)||bn(t.parentElement,e)||(e.elements.add(t),mn(e,t))})}}function Sn(e){for(var t=Ft.indexOf(e),n=[],r=An(!0),i=Ft.length-1;i>t;i--){var o=Ft[i];if("position"===o.kind){var a=o.newPosition;if(a){var s=!("direction"in a)||"before"===a.direction,l=xn(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 c,u=new Set(Array.from(e.elements).concat(Array.from(o.elements))),d=kn((null==(c=a.insertBeforeNode)?void 0:c.previousElementSibling)||a.parentNode.lastElementChild,u);null===d?(a.direction="prepend",a.insertNode=a.parentNode):a.insertNode=d}}}n.push(o),Sn(o)}e.elements.forEach(function(t){return function(e,t){var n=null;if("html"===e.kind?n=on(t):"class"===e.kind?n=dn(t):"attribute"===e.kind?n=pn(t,e.attribute):"position"===e.kind&&(n=ln(t)),n){var r=n.mutations.indexOf(e);-1!==r&&n.mutations.splice(r,1),e.rollback&&(n.originalValue=e.rollback(n.originalValue)),n.mutationRunner(n)}}(e,t)}),Ft.splice(t,1),r();for(var f=function(){var e=n.pop();if(!e)return 1;Pn(e),e.elements.forEach(function(t){return mn(e,t)})};n.length>0;)f()}function xn(e,t,n){for(var r=e;r instanceof Element&&t.has(r);)r=n?r.nextElementSibling:r.nextSibling;return r}function kn(e,t){for(var n=e;n instanceof Element&&t.has(n);)n=n.previousElementSibling;return n}function En(){Ft.forEach(wn)}var _n,On=!1;function An(e){return void 0===e&&(e=!1),Kt=!0,Rt.forEach(function(e){return e.disconnect()}),e&&!On?(On=!0,function(){On=!1,Tn()}):function(){}}function Tn(){Kt&&!On&&(Kt=!1,Rt.forEach(function(e){return e.__params&&e.observe.apply(e,e.__params)}),En())}function Cn(){"undefined"!=typeof document&&(_n||(_n=new MutationObserver(function(){En()})),En(),Ht(_n,[document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}]))}Cn();function Pn(e){return"undefined"==typeof document?Ut:(e._priority=qt++,Ft.push(e),wn(e),{__mutation:e,revert:function(){Sn(e)}})}function Mn(e,t){return Pn({kind:"html",elements:new Set,mutate:t,selector:e,cachedNodes:new Map})}function In(e,t){return Pn({kind:"position",elements:new Set,mutate:t,selector:e})}function jn(e,t,n){return Pn({kind:"class",elements:new Set,mutate:t,selector:e,rollback:n})}function Nn(e,t,n,r){return Dt.test(t)?"class"===t||"className"===t?jn(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)})},r):Pn({kind:"attribute",attribute:t,elements:new Set,mutate:n,selector:e,rollback:r}):Ut}var Vn,Ln={html:Mn,classes:jn,attribute:Nn,position:In,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,Lt);if("html"===i){if("append"===n)return Mn(t,function(e){return e+(null!=r?r:"")});if("set"===n)return Mn(t,function(){return null!=r?r:""})}else if("class"===i){if("append"===n)return jn(t,function(e){r&&e.add(r)},function(e){if(r&&e){var t=new Set(e.split(/\s+/).filter(Boolean));return t.delete(r),Array.from(t).join(" ")}return e});if("remove"===n)return jn(t,function(e){r&&e.delete(r)});if("set"===n)return jn(t,function(e){e.clear(),r&&e.add(r)})}else if("position"===i){if("set"===n){if("insertSelector"in o)return In(t,function(){return{insertSelector:o.insertSelector,direction:o.direction}});if("parentSelector"in o)return In(t,function(){return{insertBeforeSelector:o.insertBeforeSelector,parentSelector:o.parentSelector}})}}else{var a=r||"";if("append"===n)return"style"===i?Nn(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}):Nn(t,i,function(e){return null!==e?e+a:a});if("set"===n)return Nn(t,i,function(){return a});if("remove"===n)return Nn(t,i,function(){return null})}return Ut}},Dn=Object.freeze({__proto__:null,default:Ln,connectGlobalObserver:Cn,disconnectGlobalObserver:function(){var e;null==(e=_n)||e.disconnect()},getHtmlMutationRecordsFromSelector:function(e){var t=document.querySelectorAll(e),n=[];return t.forEach(function(e){var t=on(e);t&&n.push(t)}),n},isGlobalObserverPaused:function(){return Kt},pauseGlobalObserver:An,resumeGlobalObserver:Tn,validAttributeName:Dt}),Un=function(){function e(e){this.eventStorage=e,this.evaluationEngine=new J}return e.prototype.evaluate=function(e){var t,n;try{for(var r=i(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(this.evaluateAndGroup(a))return!0}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!1},e.prototype.evaluateAndGroup=function(e){var t,n;try{for(var r=i(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(!this.evaluateConditionSet(a))return!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0},e.prototype.evaluateConditionSet=function(e){var t=this.evaluateCondition(e.condition);return e.negated?!t:t},e.prototype.evaluateCondition=function(e){var t=this,n=this.eventStorage.getEventsInTimeWindow(e.event_type,e.time_type,e.time_value,e.interval).filter(function(n){return t.evaluatePropertyFilters(n,e.event_props||[])}).length;return this.evaluateCountOperator(n,e.op,e.value)},e.prototype.evaluatePropertyFilters=function(e,t){if(!t||0===t.length)return!0;var n={context:e.properties,result:{}};return this.evaluationEngine.evaluateConditions(n,[t])},e.prototype.evaluateCountOperator=function(e,t,n){switch(t){case x:return e>=n;case S:return e>n;case h:return e===n;case b:return e<n;case w:return e<=n;case g:return e!==n;default:return!1}},e}(),Bn=function(){function e(e,t,n){var r=this;this.debouncedWriteTimeout=null,this.hasPendingWrites=!1,this.handleBeforeUnload=function(){r.flushToLocalStorage()},this.handleVisibilityChange=function(){"hidden"===document.visibilityState&&r.flushToLocalStorage()},this.storageKey="EXP_".concat(e.slice(0,10),"_rtbt_events"),this.sessionManager=t,this.persistedEvents=n,this.memoryCache=this.loadFromLocalStorage(),this.setupFlushHandlers()}return e.prototype.addEvent=function(t,n,r){if(void 0===n&&(n={}),!this.persistedEvents||this.persistedEvents.has(t)){var i=this.sessionManager.getOrCreateSessionId(),o={id:this.memoryCache.nextId++,event_type:t,timestamp:null!=r?r:Date.now(),session_id:i,properties:n};this.memoryCache.events.push(o),this.memoryCache.events.length>e.MAX_EVENTS&&(this.memoryCache.events=this.memoryCache.events.slice(-e.MAX_EVENTS)),this.scheduleDebouncedWrite()}},e.prototype.getAllEvents=function(){return this.memoryCache.events},e.prototype.getEventsByType=function(e){return this.memoryCache.events.filter(function(t){return t.event_type===e})},e.prototype.getEventsInTimeWindow=function(e,t,n,r){var i=this.memoryCache.events.filter(function(t){return t.event_type===e});if("current_session"===t){var o=this.sessionManager.getOrCreateSessionId();i=i.filter(function(e){return e.session_id===o})}else{var a=Date.now()-("day"===r?24*n*60*60*1e3:60*n*60*1e3);i=i.filter(function(e){return e.timestamp>=a})}return i},e.prototype.clearEvents=function(){this.memoryCache={events:[],nextId:1},this.hasPendingWrites=!0,this.flushToLocalStorage()},e.prototype.flush=function(){this.flushToLocalStorage()},e.prototype.getEventCount=function(e){return this.getEventsByType(e).length},e.prototype.getEventCountInTimeWindow=function(e,t,n,r){return this.getEventsInTimeWindow(e,t,n,r).length},e.prototype.loadFromLocalStorage=function(){var e=localStorage.getItem(this.storageKey);if(e)try{var t=JSON.parse(e);return t&&"object"==typeof t&&Array.isArray(t.events)&&"number"==typeof t.nextId?t:{events:[],nextId:1}}catch(e){return{events:[],nextId:1}}return{events:[],nextId:1}},e.prototype.scheduleDebouncedWrite=function(){var t=this;this.hasPendingWrites=!0,this.debouncedWriteTimeout&&clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=setTimeout(function(){t.flushToLocalStorage()},e.DEBOUNCE_MS)},e.prototype.flushToLocalStorage=function(){if(this.hasPendingWrites)try{localStorage.setItem(this.storageKey,JSON.stringify(this.memoryCache)),this.hasPendingWrites=!1,this.debouncedWriteTimeout&&(clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=null)}catch(e){}},e.prototype.setupFlushHandlers=function(){window.addEventListener("beforeunload",this.handleBeforeUnload),document.addEventListener("visibilitychange",this.handleVisibilityChange)},e.prototype.cleanup=function(){this.flushToLocalStorage(),this.debouncedWriteTimeout&&(clearTimeout(this.debouncedWriteTimeout),this.debouncedWriteTimeout=null),window.removeEventListener("beforeunload",this.handleBeforeUnload),document.removeEventListener("visibilitychange",this.handleVisibilityChange)},e.MAX_EVENTS=500,e.DEBOUNCE_MS=500,e}(),Fn=function(){function e(e){this.storageKey="EXP_".concat(e.slice(0,10),"_rtbt_session")}return e.prototype.getOrCreateSessionId=function(){if(this.sessionId)return this.sessionId;var e=sessionStorage.getItem(this.storageKey);if(e)try{var t=JSON.parse(e);if(t.sessionId&&"string"==typeof t.sessionId)return this.sessionId=t.sessionId,this.sessionStartTime=t.sessionStartTime,t.sessionId}catch(e){}return this.sessionId=this.generateSessionId(),this.sessionStartTime=Date.now(),sessionStorage.setItem(this.storageKey,JSON.stringify({sessionId:this.sessionId,sessionStartTime:this.sessionStartTime})),this.sessionId},e.prototype.getSessionStartTime=function(){return this.sessionStartTime||this.getOrCreateSessionId(),this.sessionStartTime},e.prototype.generateSessionId=function(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))},e.prototype.clearSession=function(){this.sessionId=void 0,this.sessionStartTime=void 0,sessionStorage.removeItem(this.storageKey)},e}(),Rn=function(){function e(e,t){void 0===t&&(t={}),this.matchedBehaviors=new Map,this.eventToBehaviors=new Map,this.rules=t,this.sessionManager=new Fn(e),this.buildEventToBehaviorsMap(),this.eventStorage=new Bn(e,this.sessionManager,new Set(this.eventToBehaviors.keys())),this.evaluator=new Un(this.eventStorage),this.evaluateAll()}return e.prototype.trackEvent=function(e,t){this.eventStorage.addEvent(e,t),this.evaluateEvent(e)},e.prototype.hasRules=function(e){return!!this.rules[e]},e.prototype.getMatchedBehaviors=function(){return this.matchedBehaviors},e.prototype.cleanup=function(){this.eventStorage.cleanup()},e.prototype.buildEventToBehaviorsMap=function(){var e,t,n,r;for(var a in this.rules){var s=this.rules[a];try{for(var l=(e=void 0,i(Object.entries(s))),c=l.next();!c.done;c=l.next()){var u=o(c.value,2),d=u[0],f=u[1],v=this.extractEventTypes(f);try{for(var p=(n=void 0,i(v)),h=p.next();!h.done;h=p.next()){var g=h.value,y=this.eventToBehaviors.get(g);y||(y=[],this.eventToBehaviors.set(g,y)),y.push({id:d,flagKey:a})}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}}},e.prototype.extractEventTypes=function(e){var t,n,r,o,a=new Set;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var c=l.value;try{for(var u=(r=void 0,i(c)),d=u.next();!d.done;d=u.next()){var f=d.value;"behavior"===f.condition.type&&a.add(f.condition.event_type)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a},e.prototype.evaluateAll=function(){for(var e in this.rules)this.evaluateFlag(e)},e.prototype.evaluateEvent=function(e){var t,n,r=this.eventToBehaviors.get(e);if(r)try{for(var o=i(r),a=o.next();!a.done;a=o.next()){var s=a.value,l=s.id,c=s.flagKey;this.evaluateBehaviorId(c,l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},e.prototype.evaluateFlag=function(e){var t,n,r=this.rules[e];if(r){var a=new Set;try{for(var s=i(Object.entries(r)),l=s.next();!l.done;l=s.next()){var c=o(l.value,2),u=c[0],d=c[1];this.evaluator.evaluate(d)&&a.add(u)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}a.size>0?this.matchedBehaviors.set(e,a):this.matchedBehaviors.delete(e)}else this.matchedBehaviors.delete(e)},e.prototype.evaluateBehaviorId=function(e,t){var n=this.rules[e];if(n&&n[t]){var r=this.matchedBehaviors.get(e)||new Set,i=n[t];this.evaluator.evaluate(i)?r.add(t):r.delete(t),r.size>0?this.matchedBehaviors.set(e,r):this.matchedBehaviors.delete(e)}},e}();function Kn(e,t){var n,r,i,s=new(null!==(i=null===(r=(e.nodeType===Node.DOCUMENT_NODE?e:null!==(n=e.ownerDocument)&&void 0!==n?n:document).defaultView)||void 0===r?void 0:r.CSSStyleSheet)&&void 0!==i?i:CSSStyleSheet);s.replaceSync(t);var l=!1,c=function(){l||(e.adoptedStyleSheets=a(a([],o(e.adoptedStyleSheets),!1),[s],!1),l=!0)};return c(),{revert:function(){l&&(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(function(e){return e!==s}),l=!1)},reapply:c}}var qn=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 c=document.createElement("div");c.className="amp-preview-modal-badge amp-preview-modal-preview-badge",c.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 u=document.createElement("span");u.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",u.appendChild(d),u.appendChild(document.createTextNode(i)),a.appendChild(s),a.appendChild(l),a.appendChild(c),a.appendChild(u),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(!Vn){Vn=Kn(document,"\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 ")}},e}();function Wn(e){var t=new qn(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 zn=function(){function e(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map}return e.prototype.subscribe=function(e,t,n){void 0===n&&(n=void 0);var r=this.messageToSubscriberGroup.get(e);r||(r={subscribers:[]},this.messageToSubscriberGroup.set(e,r));var i={identifier:n,callback:t};r.subscribers.push(i)},e.prototype.groupSubscribe=function(e,t){this.subscriberGroupCallback.set(e,t),this.messageToSubscriberGroup.has(e)||this.messageToSubscriberGroup.set(e,{subscribers:[]})},e.prototype.publish=function(e,t){var n,r=this.messageToSubscriberGroup.get(e);r&&(t=t||{},r.subscribers.forEach(function(e){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}();var Jn=[],Hn=!1,Gn="not_started",Xn=null,Qn=function(e){var t;if(!0!==e.__AMP_DEBUG)try{Hn="true"===(null===(t=e.localStorage)||void 0===t?void 0:t.getItem("amp-ve-debug"))}catch(e){Hn=!1}else Hn=!0},$n=function(){return Hn},Zn=function(e,t){Hn&&Jn.push({timestamp:Date.now(),event:e,detail:t})},Yn=function(e){Gn=e},er=function(e){Xn=e},tr=function(){var e,n=null!==(e=null==Xn?void 0:Xn())&&void 0!==e?e:{flags:{},visualEditor:{isActive:!1},currentUrl:""};return{flags:n.flags,visualEditor:t(t({},n.visualEditor),{messengerState:Gn}),events:Jn,currentUrl:n.currentUrl,timestamp:Date.now()}};function nr(e,t){var n,r,o,a,s=[];try{for(var l=i(Object.values(e)),c=l.next();!c.done;c=l.next()){var u=c.value;try{for(var d=(o=void 0,i(Object.values(u))),f=d.next();!f.done;f=d.next()){var v=f.value;t.includes(v.trigger_type)&&s.push(v)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return s}var rr="amp-device-iframe",ir="amp-overlay-device-iframe-container";function or(){try{return"true"===sessionStorage.getItem("amp-visual-editor-mobile-mode")}catch(e){return!1}}function ar(){return document.getElementById(rr)}function sr(e,t){var n=t.location.href;n&&n!==e.location.href&&e.history.replaceState(e.history.state,"",n)}function lr(e){var t=e.document,n=function(){for(Kn(t,"body > *:not(#".concat(ir,"):not(#").concat("overlay-shadow-host",") { display: none !important; }"));t.body.firstChild;)t.body.removeChild(t.body.firstChild);t.body.style.cssText='\n margin: 0;\n padding: 0;\n overflow: auto;\n min-height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fff;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABZSURBVHgB7dG7DYBADANQJxexAiXSTXw9uyExBih34SOxQhr83Li2ASIiIiIiIpo7QbLW1tms1zijq9puSDaGLxhhuBPaqyKZTFK+/r6AZOJlg8shqv5ccAGZWRnaKiSy9QAAAABJRU5ErkJggg==");\n ';var n=t.createElement("div");n.id=ir,n.style.cssText="\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n ";var r=t.createElement("iframe");r.id=rr,r.src=e.location.href,r.style.cssText="\n width: ".concat(402,"px;\n height: ").concat(874,"px;\n border: 1px solid #dedfe2;\n border-radius: 20px;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);\n background: #fff;\n transition: all 0.1s ease;\n "),r.addEventListener("load",function(){var t=r.contentWindow;if(t)try{sr(e,t),function(e,t){var n=t.history,r=function(n){return function(r,i,o){n.call(this,r,i,o),sr(e,t)}};n.pushState=r(n.pushState.bind(n)),n.replaceState=r(n.replaceState.bind(n)),t.addEventListener("popstate",function(){sr(e,t)})}(e,t)}catch(e){}}),n.appendChild(r),t.body.appendChild(n)};return new Promise(function(r){if("complete"===t.readyState&&t.body)n(),r();else{var i=function(){"complete"===t.readyState&&t.body?(n(),r()):e.requestAnimationFrame(i)};e.requestAnimationFrame(i)}})}var cr,ur={observerOptions:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]},debounceMs:100},dr=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({},ur),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}(),fr=new J,vr=function(){function e(e,n,r,s,l,c){var u=this;this.pageChangeSubscribers=new Set,this.lastNotifiedActivePages={},this.lastNotifiedActiveBehavioralFlags=new Map,this.intersectionObservers=new Map,this.elementVisibilityState=new Map,this.elementAppearedState=new Set,this.manuallyActivatedPageObjects=new Set,this.targetedElementSelectors=new Set,this.scrolledToObservers=new Map,this.scrolledToElementState=new Map,this.analyticsEventState=new Set,this.maxScrollPercentage=0,this.timeOnPageTimeouts={},this.firedUserInteractions=new Set,this.clickTimeouts=new Map,this.hoverTimeouts=new WeakMap,this.focusTimeouts=new WeakMap,this.userInteractionAbortController=null,this.pageLoadTime=Number.POSITIVE_INFINITY,this.lastPublishedUrl=null,this.debugStateSubscribers=new Set,this.debugDebounceTimer=null,this.setPageObjects=function(e){u.pageObjects=e},this.markUrlAsPublished=function(e){u.lastPublishedUrl=e},this.initSubscriptions=function(){u.setupPageObjectSubscriptions(),u.options.useDefaultNavigationHandler&&u.setupLocationChangePublisher(),u.setupMutationObserverPublisher(),u.setupVisibilityPublisher(),u.setupUserInteractionPublisher(),u.setupExitIntentPublisher(),u.setupScrolledToPublisher(),u.setupTimeOnPagePublisher(),u.setupVisibilityChangeHandler(),u.checkInitialElements()},this.addPageChangeSubscriber=function(e){return u.pageChangeSubscribers.add(e),function(){u.pageChangeSubscribers.delete(e)}},this.addDebugStateSubscriber=function(e){return u.debugStateSubscribers.add(e),function(){u.debugStateSubscribers.delete(e)}},this.scheduleDebugNotification=function(){u.options.isDebugActive&&0!==u.debugStateSubscribers.size&&(null!==u.debugDebounceTimer&&u.globalScope.clearTimeout(u.debugDebounceTimer),u.debugDebounceTimer=u.globalScope.setTimeout(function(){var e,t;u.debugDebounceTimer=null;var n=u.webExperimentClient.getDebugState();try{for(var r=i(u.debugStateSubscribers),o=r.next();!o.done;o=r.next()){(0,o.value)(n)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},100))},this.setupPageObjectSubscriptions=function(){var e,n,r,s,l,c,d,f,v={url_change:new Set};u.behavioralTargetingManager&&(v.analytics_event=new Set);try{for(var p=i(Object.entries(u.pageObjects)),h=p.next();!h.done;h=p.next()){var g=o(h.value,2),y=g[0],m=g[1];try{for(var b=(r=void 0,i(Object.values(m))),w=b.next();!w.done;w=b.next()){var S=w.value;v[S.trigger_type]||(v[S.trigger_type]=new Set),v[S.trigger_type].add(y)}}catch(e){r={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}var x=function(e,t){var n,r,o=function(t){u.messageBus.subscribe(t.trigger_type,function(n){var r,i=!!(null===(r=u.webExperimentClient.getActivePages()[e])||void 0===r?void 0:r[t.id]),o=u.isPageObjectActive(t,n);u.webExperimentClient.updateActivePages(e,t,o),o&&!i&&Zn("trigger_fired","flag=".concat(e,", page=").concat(t.name||t.id,", ")+"type=".concat(t.trigger_type))})};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 k=i(Object.entries(u.pageObjects)),E=k.next();!E.done;E=k.next()){var _=o(E.value,2);x(y=_[0],m=_[1])}}catch(e){l={error:e}}finally{try{E&&!E.done&&(c=k.return)&&c.call(k)}finally{if(l)throw l.error}}var O=function(e){u.messageBus.groupSubscribe(e,function(n){var r,s,l,c,d="url_change"===e,f="analytics_event"===e;d&&(Zn("url_change","navigated to ".concat(u.globalScope.location.href)),u.resetTriggerStates(),u.revertInjections());var p=u.webExperimentClient.getActivePages(),h=!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 c=i(s),u=c.next();!u.done;u=c.next()){var d=u.value,f=e[d],v=t[d];if(!v)return!1;var p=Object.keys(f),h=Object.keys(v);if(p.length!==h.length)return!1;try{for(var g=(o=void 0,i(p)),y=g.next();!y.done;y=g.next()){var m=y.value,b=f[m],w=v[m];if(!w||b.id!==w.id)return!1}}catch(e){o={error:e}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return!0}(p,u.lastNotifiedActivePages),g=null===(l=u.webExperimentClient.behavioralTargetingManager)||void 0===l?void 0:l.getMatchedBehaviors(),y=f&&!function(e,t){var n,r,a,s;if(!e&&t.size>0)return!1;if(e&&e.size!==t.size)return!1;if(!e)return!0;try{for(var l=i(e),c=l.next();!c.done;c=l.next()){var u=o(c.value,2),d=u[0],f=u[1],v=t.get(d);if(!v)return!1;if(f.size!==v.size)return!1;try{for(var p=(a=void 0,i(f)),h=p.next();!h.done;h=p.next()){var g=h.value;if(!v.has(g))return!1}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return!0}(g,u.lastNotifiedActiveBehavioralFlags);if(y&&u.webExperimentClient.updateUserWithBehaviors(),!("updateActivePages"in n&&n.updateActivePages)&&!u.options.isVisualEditorMode&&(h||y||d)){var m;if(d)m=void 0;else{var b=Array.from(v[e]||[]),w=y?Array.from(new Set(a(a([],o(Array.from((null==g?void 0:g.keys())||[])),!1),o(Array.from((null===(c=u.lastNotifiedActiveBehavioralFlags)||void 0===c?void 0:c.keys())||[])),!1))):[];m=Array.from(new Set(a(a([],o(b),!1),o(w),!1)))}if(u.webExperimentClient.applyVariants({flagKeys:null==m?void 0:m.filter(function(e){return!u.webExperimentClient.previewFlags[e]})}),u.webExperimentClient.isPreviewMode){var S=m?Object.fromEntries(Object.entries(u.webExperimentClient.previewFlags).filter(function(e){var t=o(e,1)[0];return m.includes(t)})):u.webExperimentClient.previewFlags;u.webExperimentClient.previewVariants({keyToVariant:S})}}u.lastNotifiedActivePages=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}(p);try{for(var x=(r=void 0,i(u.pageChangeSubscribers)),k=x.next();!k.done;k=x.next()){(0,k.value)({activePages:p})}}catch(e){r={error:e}}finally{try{k&&!k.done&&(s=x.return)&&s.call(x)}finally{if(r)throw r.error}}(h||d)&&u.scheduleDebugNotification(),y&&g&&(u.lastNotifiedActiveBehavioralFlags=new Map(Array.from(g.entries()).map(function(e){var t=o(e,2),n=t[0],r=t[1];return[n,new Set(r)]})))})};try{for(var A=i(Object.keys(v)),T=A.next();!T.done;T=A.next()){O(T.value)}}catch(e){d={error:e}}finally{try{T&&!T.done&&(f=A.return)&&f.call(A)}finally{if(d)throw d.error}}},this.toggleManualPageObject=function(e,t){t?u.manuallyActivatedPageObjects.add(e):u.manuallyActivatedPageObjects.delete(e),u.messageBus.publish("manual")},this.resetTriggerStates=function(){var e,t,n,r,a,s;Zn("trigger_reset","all non-url_change triggers cleared"),u.elementAppearedState.clear(),u.elementVisibilityState.clear(),u.firedUserInteractions.clear(),u.scrolledToElementState.clear(),u.manuallyActivatedPageObjects.clear(),u.maxScrollPercentage=0,u.pageLoadTime=Date.now(),u.analyticsEventState.clear(),u.lastNotifiedActiveBehavioralFlags=new Map;try{for(var l=i(u.clickTimeouts.values()),c=l.next();!c.done;c=l.next()){var d=c.value;u.globalScope.clearTimeout(d)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}u.clickTimeouts.clear();try{for(var f=i(Object.entries(u.pageObjects)),v=f.next();!v.done;v=f.next()){var p=o(v.value,2),h=p[0],g=p[1];try{for(var y=(a=void 0,i(Object.values(g))),m=y.next();!m.done;m=y.next()){var b=m.value;"url_change"!==b.trigger_type&&u.webExperimentClient.updateActivePages(h,b,!1)}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}u.setupTimeOnPagePublisher(),u.checkInitialElements()},this.revertInjections=function(){Object.values(u.webExperimentClient.appliedMutations).forEach(function(e){Object.values(e).forEach(function(e){e[li]&&Object.values(e[li]).forEach(function(e){var t;null===(t=e.revert)||void 0===t||t.call(e)})})});var e=u.webExperimentClient.appliedMutations;Object.keys(e).forEach(function(t){var n=e[t];Object.keys(n).forEach(function(e){n[e][li]&&(delete n[e][li],0===Object.keys(n[e]).length&&delete n[e])}),0===Object.keys(n).length&&delete e[t]})},this.updateElementAppearedState=function(e,t){var n,r,o,a;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var c=l.value;if(0===t.length||u.isMutationRelevantToSelector(t,c))try{var d=u.contentDocument.querySelectorAll(c);try{for(var f=(o=void 0,i(Array.from(d))),v=f.next();!v.done;v=f.next()){var p=v.value,h=u.contentWindow.getComputedStyle(p);if("none"!==h.display&&"hidden"!==h.visibility){u.elementAppearedState.add(c);break}}}catch(e){o={error:e}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},this.checkInitialElements=function(){u.updateElementAppearedState(u.targetedElementSelectors,[]),u.messageBus.publish("element_appeared",{mutationList:[]})},this.setupMutationObserverPublisher=function(){if(u.targetedElementSelectors=function(e){var t,n,r,o,a=new Set;try{for(var s=i(Object.values(e)),l=s.next();!l.done;l=s.next()){var c=l.value;try{for(var u=(r=void 0,i(Object.values(c))),d=u.next();!d.done;d=u.next()){var f=d.value;if("element_appeared"===f.trigger_type||"element_visible"===f.trigger_type){var v=(p=f.trigger_value).selector;v&&a.add(v)}else if("scrolled_to"===f.trigger_type){var p;"element"===(p=f.trigger_value).mode&&p.selector&&a.add(p.selector)}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}(u.pageObjects),0!==u.targetedElementSelectors.size){var e=[function(e){return Array.from(u.targetedElementSelectors).some(function(t){return u.isMutationRelevantToSelector([e],t)})}];return new dr(u.contentDocument.documentElement,function(e){u.updateElementAppearedState(u.targetedElementSelectors,e),u.messageBus.publish("element_appeared",{mutationList:e})},e).observe()}},this.setupVisibilityPublisher=function(){var e,t,n,r,a;if(0!==nr(u.pageObjects,["element_visible"]).length){try{for(var s=i(Object.values(u.pageObjects)),l=s.next();!l.done;l=s.next()){var c=l.value,d=function(e){if("element_visible"===e.trigger_type){var t=e.trigger_value,n=t.selector,r=null!==(a=t.visibilityRatio)&&void 0!==a?a:0,i="".concat(n,"\0").concat(r);if(u.intersectionObservers.has(i))return"continue";var o=new IntersectionObserver(function(e){e.forEach(function(e){var t=e.intersectionRatio>=r;u.elementVisibilityState.set(i,t),t&&u.messageBus.publish("element_visible")})},{threshold:r});u.intersectionObservers.set(i,o);try{u.contentDocument.querySelectorAll(n).forEach(function(e){o.observe(e)})}catch(e){}}};try{for(var f=(n=void 0,i(Object.values(c))),v=f.next();!v.done;v=f.next()){d(v.value)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}u.messageBus.subscribe("element_appeared",function(e){var t,n,r=e.mutationList,a=function(e,t){var n=o(e.split("\0"),1)[0];if(0===r.length||u.isMutationRelevantToSelector(r,n))try{u.contentDocument.querySelectorAll(n).forEach(function(e){t.observe(e)})}catch(e){}};try{for(var s=i(u.intersectionObservers.entries()),l=s.next();!l.done;l=s.next()){var c=o(l.value,2);a(c[0],c[1])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}})}},this.setupExitIntentPublisher=function(){var e,t,n;u.pageLoadTime=Date.now();var r=Object.values(u.pageObjects).flatMap(function(e){return Object.values(e).filter(function(e){return"exit_intent"===e.trigger_type})});if(0!==r.length){var o=1/0;try{for(var a=i(r),s=a.next();!s.done;s=a.next()){var l=s.value.trigger_value;o=Math.min(o,null!==(n=l.minTimeOnPageMs)&&void 0!==n?n:0)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}var c=function(e){e.clientY<=50&&null===e.relatedTarget&&u.messageBus.publish("exit_intent",{durationMs:Date.now()-u.pageLoadTime})};o>0?u.globalScope.setTimeout(function(){u.contentDocument.addEventListener("mouseleave",c)},o):u.contentDocument.addEventListener("mouseleave",c)}},this.setupLocationChangePublisher=function(){u.globalScope.addEventListener("popstate",function(){var e=u.globalScope.location.href;e!==u.lastPublishedUrl&&(u.lastPublishedUrl=e,u.messageBus.publish("url_change"))});var e,t,n=function(){var e=u.globalScope.location.href;e!==u.lastPublishedUrl&&(u.lastPublishedUrl=e,u.messageBus.publish("url_change"),u.globalScope.webExperiment.previousUrl=e)};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.setupUserInteractionPublisher=function(){var e,t,n,r,o,a,s,l;null===(o=u.userInteractionAbortController)||void 0===o||o.abort(),u.userInteractionAbortController=new AbortController;var c=u.userInteractionAbortController.signal,d=new Map,f=new Map,v=new Map;try{for(var p=i(Object.values(u.pageObjects)),h=p.next();!h.done;h=p.next()){var g=h.value;try{for(var y=(n=void 0,i(Object.values(g))),m=y.next();!m.done;m=y.next()){var b=m.value;if("user_interaction"===b.trigger_type){var w=b.trigger_value,S=w.selector,x=w.interactionType,k=w.minThresholdMs;"click"===x?(d.has(S)||d.set(S,new Set),null===(a=d.get(S))||void 0===a||a.add(k||0)):"hover"===x?(f.has(S)||f.set(S,new Set),null===(s=f.get(S))||void 0===s||s.add(k||0)):"focus"===x&&(v.has(S)||v.set(S,new Set),null===(l=v.get(S))||void 0===l||l.add(k||0))}}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=p.return)&&t.call(p)}finally{if(e)throw e.error}}0===d.size&&0===f.size&&0===v.size||(d.size>0&&u.setupClickDelegation(d,c),f.size>0&&u.setupHoverDelegation(f,c),v.size>0&&u.setupFocusDelegation(v,c))},this.setupClickDelegation=function(e,t){u.contentDocument.addEventListener("click",function(t){var n,r,a,s,l=t.target;if(l)try{for(var c=i(e),d=c.next();!d.done;d=c.next()){var f=o(d.value,2),v=f[0],p=f[1];try{if(l.closest(v)){var h=function(e){var t="".concat(v,"\0click\0").concat(e);if(u.firedUserInteractions.has(t))return"continue";if(u.clickTimeouts.has(t))return"continue";var n=function(){u.firedUserInteractions.add(t),u.messageBus.publish("user_interaction"),u.clickTimeouts.delete(t)};if(e>0){var r=u.globalScope.setTimeout(n,e);u.clickTimeouts.set(t,r)}else n()};try{for(var g=(a=void 0,i(p)),y=g.next();!y.done;y=g.next()){h(y.value)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}break}}catch(e){}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}},{signal:t})},this.setupThresholdBasedDelegation=function(e,t,n){u.contentDocument.addEventListener(n.startEvent,function(t){var r,a,s,l,c=t.target;if(c)try{for(var d=i(e),f=d.next();!f.done;f=d.next()){var v=o(f.value,2),p=v[0],h=v[1];try{var g=c.closest(p);if(g){var y=function(e){var t="".concat(p,"\0").concat(n.interactionType,"\0").concat(e);if(u.firedUserInteractions.has(t))return"continue";var r=n.timeoutStorage.get(g);r||(r=new Map,n.timeoutStorage.set(g,r));var i="".concat(p,"\0").concat(e);if(!r.get(i)){var o=function(){u.firedUserInteractions.add(t),u.messageBus.publish("user_interaction"),null==r||r.delete(i)};if(e){var a=u.globalScope.setTimeout(o,e);r.set(i,a)}else o()}};try{for(var m=(s=void 0,i(h)),b=m.next();!b.done;b=m.next()){y(b.value)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(l=m.return)&&l.call(m)}finally{if(s)throw s.error}}break}}catch(e){}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}},{signal:t}),u.contentDocument.addEventListener(n.endEvent,function(t){var r,a,s,l,c=t.target;if(c){var d=t.relatedTarget;try{for(var f=i(e),v=f.next();!v.done;v=f.next()){var p=o(v.value,1)[0];try{var h=c.closest(p);if(h){if(!d||!h.contains(d)){var g=n.timeoutStorage.get(h);if(g){try{for(var y=(s=void 0,i(g.values())),m=y.next();!m.done;m=y.next()){var b=m.value;u.globalScope.clearTimeout(b)}}catch(e){s={error:e}}finally{try{m&&!m.done&&(l=y.return)&&l.call(y)}finally{if(s)throw s.error}}n.timeoutStorage.delete(h)}}break}}catch(e){}}}catch(e){r={error:e}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}},{signal:t})},this.setupHoverDelegation=function(e,t){u.setupThresholdBasedDelegation(e,t,{interactionType:"hover",startEvent:"mouseover",endEvent:"mouseout",timeoutStorage:u.hoverTimeouts})},this.setupFocusDelegation=function(e,t){u.setupThresholdBasedDelegation(e,t,{interactionType:"focus",startEvent:"focusin",endEvent:"focusout",timeoutStorage:u.focusTimeouts})},this.setupTimeOnPagePublisher=function(){var e,t,n,r;Object.values(u.timeOnPageTimeouts).forEach(clearTimeout),u.timeOnPageTimeouts={};var o=new Set;try{for(var a=i(Object.values(u.pageObjects)),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var c=(n=void 0,i(Object.values(l))),d=c.next();!d.done;d=c.next()){var f=d.value;if("time_on_page"===f.trigger_type){var v=f.trigger_value;o.add(v.durationMs)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==o.size&&u.setUpTimeouts(o)},this.setUpTimeouts=function(e){e.forEach(function(e){u.timeOnPageTimeouts[e]=u.globalScope.setTimeout(function(){u.messageBus.publish("time_on_page",{durationMs:e}),delete u.timeOnPageTimeouts[e]},e)})},this.setupVisibilityChangeHandler=function(){if(0!==nr(u.pageObjects,["time_on_page"]).length){u.globalScope.document.addEventListener("visibilitychange",function(){if(u.globalScope.document.hidden)Object.values(u.timeOnPageTimeouts).forEach(clearTimeout);else{var e=new Set(Object.keys(u.timeOnPageTimeouts).map(Number));u.setUpTimeouts(e)}})}},this.setupScrolledToPublisher=function(){var e,t,n,r,a=nr(u.pageObjects,["scrolled_to"]);if(0!==a.length){var s=!1,l=!1;try{for(var c=i(a),d=c.next();!d.done;d=c.next()){var f=d.value.trigger_value;"percent"===f.mode?s=!0:"element"===f.mode&&(l=!0)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}if(s){var v=null,p=function(){var e=u.calculateScrollPercentage();e>u.maxScrollPercentage&&(u.maxScrollPercentage=e,u.messageBus.publish("scrolled_to",{}))};u.contentWindow.addEventListener("scroll",function(){null===v&&(v=u.globalScope.requestAnimationFrame(function(){p(),v=null}))},{passive:!0}),p()}if(l){var h=function(e){if("scrolled_to"===e.trigger_type){var t=e.trigger_value;if("element"===t.mode){var n=t.selector,r=t.offsetPx||0,i="".concat(n,"\0").concat(r);if(u.scrolledToObservers.has(i))return"continue";var o="0px 0px ".concat(r,"px 0px"),a=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(u.scrolledToElementState.set(i,!0),u.messageBus.publish("scrolled_to",{}))})},{rootMargin:o,threshold:0});u.scrolledToObservers.set(i,a);try{u.contentDocument.querySelectorAll(n).forEach(function(e){a.observe(e)})}catch(e){}}}};try{for(var g=i(a),y=g.next();!y.done;y=g.next()){h(y.value)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}u.messageBus.subscribe("element_appeared",function(e){var t,n,r=e.mutationList,a=function(e,t){var n=o(e.split("\0"),1)[0];if(0===r.length||u.isMutationRelevantToSelector(r,n))try{u.contentDocument.querySelectorAll(n).forEach(function(e){t.observe(e)})}catch(e){}};try{for(var s=i(u.scrolledToObservers.entries()),l=s.next();!l.done;l=s.next()){var c=o(l.value,2);a(c[0],c[1])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}})}}},this.isPageObjectActive=function(e,t){var n,r,i,o={page:{url:u.globalScope.location.href}};if(e.conditions&&e.conditions.length>0&&!fr.evaluateConditions({context:o,result:{}},e.conditions))return!1;switch(e.trigger_type){case"url_change":return!0;case"manual":var a=e.trigger_value;return u.manuallyActivatedPageObjects.has(a.name);case"analytics_event":var s=e.id;if(u.analyticsEventState.has(s))return!0;a=e.trigger_value;var l=t,c={type:"analytics_event",data:{event:l.event,properties:l.properties}},d=fr.evaluateConditions({context:c,result:{}},a);return d&&u.analyticsEventState.add(s),d;case"element_appeared":var f=(a=e.trigger_value).selector;return u.elementAppearedState.has(f);case"element_visible":f=(a=e.trigger_value).selector;var v=null!==(n=a.visibilityRatio)&&void 0!==n?n:0,p="".concat(f,"\0").concat(v);return null!==(r=u.elementVisibilityState.get(p))&&void 0!==r&&r;case"exit_intent":var h=t.durationMs;return void 0===(a=e.trigger_value).minTimeOnPageMs||h>=a.minTimeOnPageMs;case"user_interaction":a=e.trigger_value;var g="".concat(a.selector,"\0").concat(a.interactionType,"\0").concat(a.minThresholdMs||0);return u.firedUserInteractions.has(g);case"time_on_page":var y=t;a=e.trigger_value;return y.durationMs>=a.durationMs;case"scrolled_to":if("percent"===(a=e.trigger_value).mode)return u.maxScrollPercentage>=a.percentage;if("element"===a.mode){var m=a.offsetPx||0;p="".concat(a.selector,"\0").concat(m);return null!==(i=u.scrolledToElementState.get(p))&&void 0!==i&&i}return!1;default:return!1}},this.webExperimentClient=e,this.messageBus=n,this.pageObjects=r,this.behavioralTargetingManager=s,this.options=l,this.globalScope=c}return Object.defineProperty(e.prototype,"contentDocument",{get:function(){return e=this.globalScope,or()&&null!==(n=null===(t=ar())||void 0===t?void 0:t.contentDocument)&&void 0!==n?n:e.document;var e,t,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contentWindow",{get:function(){return e=this.globalScope,or()&&null!==(n=null===(t=ar())||void 0===t?void 0:t.contentWindow)&&void 0!==n?n:e;var e,t,n},enumerable:!1,configurable:!0}),e.prototype.getDebugPageObjects=function(){var e,t,n=this,r={},a=this.webExperimentClient.getActivePages(),s=function(e,t){r[e]=Object.values(t).map(function(t){var r=n.evaluateUrlConditions(t),i=n.buildTriggerDebugInfo(t,e,a);return{id:t.id,name:t.name,urlConditionsPassed:r,triggerPassed:i.passed,trigger:i,overallStatus:r&&i.passed?"pass":"fail"}})};try{for(var l=i(Object.entries(this.pageObjects)),c=l.next();!c.done;c=l.next()){var u=o(c.value,2);s(u[0],u[1])}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}return r},e.prototype.evaluateUrlConditions=function(e){return!e.conditions||0===e.conditions.length||fr.evaluateConditions({context:{page:{url:this.globalScope.location.href}},result:{}},e.conditions)},e.prototype.buildTriggerDebugInfo=function(e,t,n){var r,i,o;switch(e.trigger_type){case"url_change":return{type:"url_change",passed:!0};case"element_appeared":var a=e.trigger_value.selector;return{type:"element_appeared",passed:this.elementAppearedState.has(a),config:{selector:a}};case"element_visible":var s=e.trigger_value,l=(a=s.selector,s.visibilityRatio),c=null!=l?l:0,u="".concat(a,"\0").concat(c);return{type:"element_visible",passed:null!==(r=this.elementVisibilityState.get(u))&&void 0!==r&&r,config:{selector:a,visibilityRatio:c}};case"manual":var d=e.trigger_value.name;return{type:"manual",passed:this.manuallyActivatedPageObjects.has(d),config:{name:d}};case"analytics_event":return{type:"analytics_event",passed:this.analyticsEventState.has(e.id),config:{conditions:e.trigger_value}};case"user_interaction":var f=e.trigger_value,v=(a=f.selector,f.interactionType),p=f.minThresholdMs||0;u="".concat(a,"\0").concat(v,"\0").concat(p);return{type:"user_interaction",passed:this.firedUserInteractions.has(u),config:{selector:a,interactionType:v,minThresholdMs:p}};case"exit_intent":var h=e.trigger_value.minTimeOnPageMs;return{type:"exit_intent",passed:!!(null===(i=n[t])||void 0===i?void 0:i[e.id]),config:{minTimeOnPageMs:h}};case"time_on_page":var g=e.trigger_value.durationMs,y=Math.max(0,Date.now()-this.pageLoadTime);return{type:"time_on_page",passed:!(g in this.timeOnPageTimeouts),config:{durationMs:g},elapsedMs:y};case"scrolled_to":var m=e.trigger_value;if("percent"===m.mode){var b=m.percentage;return{type:"scrolled_to",passed:this.maxScrollPercentage>=b,config:{mode:"percent",percentage:b},currentPercentage:Math.round(this.maxScrollPercentage)}}a=m.selector;var w=m.offsetPx,S=w||0;u="".concat(a,"\0").concat(S);return{type:"scrolled_to",passed:null!==(o=this.scrolledToElementState.get(u))&&void 0!==o&&o,config:{mode:"element",selector:a,offsetPx:w}};default:return{type:"url_change",passed:!1}}},e.prototype.isMutationRelevantToSelector=function(e,t){var n,r,o,a;try{for(var s=i(e),l=s.next();!l.done;l=s.next()){var c=l.value;if(c.addedNodes.length>0)try{for(var u=(o=void 0,i(Array.from(c.addedNodes))),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.nodeType===Node.ELEMENT_NODE)try{var v=f;if(v.matches(t))return!0;if(v.querySelector(t))return!0}catch(e){}}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}if(c.target.nodeType===Node.ELEMENT_NODE)try{var p=c.target;if(p.matches(t))return!0;if(p.querySelector(t))return!0}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!1},e.prototype.calculateScrollPercentage=function(){var e=this.contentWindow.innerHeight,t=this.contentDocument.documentElement.scrollHeight,n=this.contentWindow.scrollY,r=t-e;return r<=0?0:n/r*100},e}(),pr={useDefaultNavigationHandler:!0},hr=function(){var e;if(!cr){var t=be(),n=Kn(null!==(e=null==t?void 0:t.document)&&void 0!==e?e:document,"* { visibility: hidden !important; background-image: none !important; }");cr=n,null==t||t.window.setTimeout(function(){cr===n&&gr()},1e3)}},gr=function(){null==cr||cr.revert(),cr=void 0},yr="AMP",mr="dclid",br="fbclid",wr="gbraid",Sr="gclid",xr="ko_click_id",kr="li_fat_id",Er="msclkid",_r="rdt_cid",Or="ttclid",Ar="twclid",Tr="wbraid",Cr={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,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Pr="MKTG",Mr=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},Ir=function(){var e,t=Mr();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=jr(n[0]),i=jr(n[1]);return i?(e[r]=i,e):e},{}):{}},jr=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Nr=function(){function e(e,n){void 0===n&&(n={}),this.options=t({},e),this.config=n}return e.prototype.isEnabled=function(){return n(this,void 0,void 0,function(){var n,i,o,a,s=this;return r(this,function(r){switch(r.label){case 0:return n="AMP_TEST",i=t({},this.options),o=new e(i),a=String(Date.now()),[4,o.transaction(n,function(e){var t,r;try{e.set(a);var i=e.get()===a;return!i&&s.config.diagnosticsClient&&(null===(t=s.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:n,testValue:a,sync:!0})),i}catch(e){if(s.config.diagnosticsClient){var o=e instanceof Error?e.message:String(e);null===(r=s.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:n,testValue:a,error:o,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,r.sent()]}})})},e.prototype.get=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return t=n.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var n=Vr(t);return void 0===n?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(n)}catch(n){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,o;return n(this,void 0,void 0,function(){var n,a,s,l,c,u,d,f,v;return r(this,function(r){switch(r.label){case 0:n=Mr(),a=n,r.label=1;case 1:return r.trys.push([1,4,,5]),(s=null==a?void 0:a.cookieStore)?[4,s.getAll(e)]:[3,3];case 2:if(l=r.sent()){l.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:l.map(function(e){return e.domain})}),null===(o=this.config.diagnosticsClient)||void 0===o||o.increment("cookies.duplicate.occurrence.cookieStore"));try{for(c=i(l),u=c.next();!u.done;u=c.next())if(d=u.value,Lr(d.domain,this.options.domain))return[2,d.value]}catch(e){f={error:e}}finally{try{u&&!u.done&&(v=c.return)&&v.call(c)}finally{if(f)throw f.error}}}r.label=3;case 3:return[3,5];case 4:return r.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,n,r=this,i=Mr(),o=(null!==(n=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,s=this.config.duplicateResolverFn;if("function"==typeof s&&o.length>1&&(a=o.find(function(t){var n;try{var i=s(t.substring(e.length+1));return i||null===(n=r.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),a||(a=o[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return n(this,void 0,void 0,function(){return r(this,function(n){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var n;try{var r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,i=null!==t?r:-1,o=void 0;if(i){var a=new Date;a.setTime(a.getTime()+24*i*60*60*1e3),o=a}var s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite));var l=Mr();(null==l?void 0:l.document)&&(l.document.cookie=s)}catch(t){var c=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}},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.isDomainWritable=function(t){return n(this,void 0,void 0,function(){var n,i;return r(this,function(r){switch(r.label){case 0:if(e.cachedTlds[t])return[2,!0];n="AMP_TLDTEST",i=new e({domain:"."+t}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i.transaction(n,function(n){if(e.cachedTlds[t])return!0;try{n.set(1);var r=!!n.get();return r&&(e.cachedTlds[t]=!0),r}finally{n.set(null)}})];case 2:return[2,!!r.sent()];case 3:return r.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return n(this,void 0,void 0,function(){var n,i,o=this;return r(this,function(r){switch(r.label){case 0:if(n=function(){var e,t=Mr();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks}(),i=function(){return t({get:function(){return o.getSync(e)},set:function(t){return o.setSync(e,t)}})},!n)return[2,i()];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(e),i)];case 2:return[2,r.sent()];case 3:return r.sent(),[2,i()];case 4:return[2]}})})},e.cachedTlds={},e}(),Vr=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}}(e)},Lr=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},Dr=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({},Cr),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=Ir();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=Ir();return(e={})[mr]=t[mr],e[br]=t[br],e[wr]=t[wr],e[Sr]=t[Sr],e[xr]=t[xr],e[kr]=t[kr],e[Er]=t[Er],e[_r]=t[_r],e[Or]=t[Or],e[Ar]=t[Ar],e[Tr]=t[Tr],e},e}(),Ur=function(e,t){var n;try{var r=null===(n=Rr(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}},Br=function(e,t,n){var r;try{var i=JSON.stringify(n);null===(r=Rr(e))||void 0===r||r.setItem(t,i)}catch(t){console.warn("Failed to stringify and set JSON in ".concat(e,":"),t)}},Fr=function(e,t){var n;try{null===(n=Rr(e))||void 0===n||n.removeItem(t)}catch(t){console.warn("Failed to remove item from ".concat(e,":"),t)}},Rr=function(e){var t=be();return t?t[e]:null};function Kr(e,a){return n(this,void 0,void 0,function(){var n,s,l,c,u,d,f,v,p,h,g,y,m,b,w,S,x,k,E;return r(this,function(r){switch(r.label){case 0:return n="EXP_".concat(Pr,"_").concat(e.substring(0,10)),[4,qr(e)];case 1:s=o.apply(void 0,[r.sent(),2]),l=s[0],c=s[1],u=Ur("localStorage",n),d={},f=[c,u,l];try{for(v=i(f),p=v.next();!p.done;p=v.next())if(h=p.value)try{for(k=void 0,g=i(Object.entries(h)),y=g.next();!y.done;y=g.next())m=o(y.value,2),b=m[0],w=m[1],b.startsWith("utm_")&&void 0!==w&&(d[b]=w)}catch(e){k={error:e}}finally{try{y&&!y.done&&(E=g.return)&&E.call(g)}finally{if(k)throw k.error}}}catch(e){S={error:e}}finally{try{p&&!p.done&&(x=v.return)&&x.call(v)}finally{if(S)throw S.error}}return Object.keys(d).length>0?(function(e,t){var n="EXP_".concat(Pr,"_").concat(e.substring(0,10));Br("localStorage",n,t)}(e,d),[2,t(t({},a),{persisted_url_param:d})]):[2,a]}})})}function qr(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 Nr,n=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[yr,t,e.substring(0,n)].filter(Boolean).join("_")}(e,Pr),[4,(new Dr).parse()];case 1:return i=r.sent(),[4,t.get(n)];case 2:return o=r.sent(),[2,[i,o]]}})})}var Wr,zr="amp-exp-loading",Jr=function(){if(!document.getElementById(zr)){var e=document.createElement("div");e.id=zr,Wr=setTimeout(function(){Hr()},1e4),e.innerHTML="\n <style>\n #".concat(zr," {\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(zr," .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(zr," .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(zr,' .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(zr)||void 0===Wr||document.body.appendChild(e)};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}},Hr=function(){var e;Wr&&(clearTimeout(Wr),Wr=void 0),null===(e=document.getElementById(zr))||void 0===e||e.remove()},Gr=function(){try{var e=be();if(!e)return!0;var t=e.opener;return!t||t.closed}catch(e){return!0}},Xr="visual-editor-state",Qr=function(){function e(){}return e.setup=function(){var t,n="closed";Zn("opener_check",Gr()?"FAIL: window.opener is null, closed, or inaccessible":"PASS");var r=e.getStoredSession();if(r)return Zn("setup","stored session found, loading ".concat(r.injectSrc)),Yn("loading"),n="opening",Jr(),void $r(r.injectSrc).then(function(){n="open",Yn("loaded"),Zn("script_load_success","from stored session")}).catch(function(e){console.warn("Failed to load overlay from stored session:",e),n="closed",Yn("error"),Zn("script_load_error","from stored session: ".concat((null==e?void 0:e.message)||e)),Hr()});Zn("setup","no stored session, registering message listener"),Yn("waiting"),null===(t=be())||void 0===t||t.addEventListener("message",function(e){var t=/^.*\.amplitude\.com$/;try{if(!e.origin||!t.test(new URL(e.origin).hostname))return void Zn("origin_validation","FAIL: ".concat(e.origin||"(empty)"))}catch(t){return void Zn("origin_validation","FAIL: exception parsing origin ".concat(e.origin))}if("OpenOverlay"===e.data.type){Zn("message_received","origin=".concat(e.origin,", type=OpenOverlay")),Zn("origin_validation","PASS");var r=new URL(e.data.context.injectSrc);if("closed"!==n)return void Zn("state_guard","rejected: state=".concat(n));if("https:"!==r.protocol||!t.test(r.hostname))return void Zn("injectSrc_validation","FAIL: ".concat(r.href));Zn("injectSrc_validation","PASS (".concat(r.hostname,")")),Yn("loading"),n="opening",Jr(),$r(e.data.context.injectSrc).then(function(){n="open",Yn("loaded"),Zn("script_load_success")}).catch(function(){n="closed",Yn("error"),Zn("script_load_error","Failed to load ".concat(e.data.context.injectSrc)),Hr()})}})},e.getStoredSession=function(){var e=Ur("sessionStorage",Xr);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}(),$r=function(e){return new Promise(function(t,n){Zn("script_load_start","loading ".concat(e));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]");if(o){var a=o.nonce||o.nonce||o.getAttribute("nonce");i.setAttribute("nonce",a),Zn("nonce_check","found: ".concat(a))}else Zn("nonce_check","not found, skipping");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)}};Zn("readyState",document.readyState);var i=be(),o=function(){document.body?r():(null==i?void 0:i.requestAnimationFrame)?i.requestAnimationFrame(o):r()};o()})},Zr="amp-exp-opener-severed",Yr=function(){var e=document.getElementById(Zr);e&&("function"==typeof e.close&&e.open&&e.close(),e.remove())};var ei=Symbol.for("@amplitude/spa-link-interceptor-initiated");function ti(){if(!window[ei]){window[ei]=!0;document.addEventListener("click",function(e){var t,n,r=e.target.closest("a");if(r){var i=r.__mutationRecord__;if(null===(n=null===(t=null==i?void 0:i.attributes)||void 0===t?void 0:t.href)||void 0===n?void 0:n.mutations.length){var o=r.getAttribute("href"),a=r.getAttribute("target");o&&function(e,t,n){var r=n&&"_self"!==n||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button>0,i=new URL(t,window.location.href),o=i.href.split("#")[0]===window.location.href.split("#")[0],a=i.origin===window.location.origin;return!r&&a&&!o}(e,o,a)&&function(e){var t,n,r=Object.keys(e).find(function(e){return e.startsWith("__reactFiber")});return!!r&&String(null===(n=null===(t=e[r])||void 0===t?void 0:t.memoizedProps)||void 0===n?void 0:n.onClick).includes(".defaultPrevented")}(r)&&(e.preventDefault(),function(e){var t,n;if(null===(n=null===(t=window.next)||void 0===t?void 0:t.router)||void 0===n?void 0:n.push)return void window.next.router.push(e);history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate",{state:history.state}))}(o))}}},!0)}}var ni=function(){var e,t,n=be(),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 c=o(l.value,2),u=c[0],d=c[1];a[u]=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},ri=function(e){if(!e)return"";var t=new URL(e);return t.search="",t.hash="",t.toString()},ii=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()},oi=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+"/")})},ai=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,ai)},si="mutate",li="inject",ci="PREVIEW",ui="amp-preview-mode",di="VISUAL_EDITOR";me.Experiment=It;var fi=function(){function e(e,n,r){void 0===r&&(r={});var i,o=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.behavioralTargetingRules={},this.isVisualEditorMode=!1,this.isDebugActive=!1,this.isPreviewMode=!1,this.previewFlags={};var a=be();if(!a||!we())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=a,this.apiKey=e,this.initialFlags=JSON.parse(n.initialFlags),this.pageObjects=JSON.parse(n.pageObjects),this.behavioralTargetingRules=n.behavioralTargetingRules?JSON.parse(n.behavioralTargetingRules):{},Object.keys(this.behavioralTargetingRules).length>0&&(this.behavioralTargetingManager=new Rn(this.apiKey,this.behavioralTargetingRules)),this.config=t(t(t({},pr),r),null!==(i=this.globalScope.experimentConfig)&&void 0!==i?i:{}),this.initialFlags.forEach(function(e){var t=e.key,n=e.variants,r=e.metadata,i=void 0===r?{}:r;o.flagVariantMap[t]={},Object.keys(n).forEach(function(e){o.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]),o.flagVariantMap[t][e].metadata={deliveryMethod:"web"}}),"local"!==i.evaluationMode&&o.remoteFlagKeys.push(t)});var s=JSON.stringify(this.initialFlags);this.experimentClient=Pt.initialize(this.apiKey,t({internalInstanceNameSuffix:"web",initialFlags:s,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var l=this.experimentClient.all();this.localFlagKeys=Object.keys(l).filter(function(e){var t,n;return"local"===(null===(n=null===(t=l[e])||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.evaluationMode)}),this.messageBus=new zn}return e.prototype.start=function(){return n(this,void 0,void 0,function(){var e,n,a,s,l,c,u,d,f,v,p,h,g,y,m,b,w,S=this;return r(this,function(r){switch(r.label){case 0:if(this.isRunning)return[2];HTMLElement.prototype.removeChild=function(e){return e&&e.parentNode!==this?e:Node.prototype.removeChild.call(this,e)},ti(),e=ni(),n=!1;try{n=(null===(b=this.globalScope.frameElement)||void 0===b?void 0:b.id)===rr}catch(e){n=!1}return n&&or()?(this.globalScope.ampDomMutator=Dn,this.isRunning=!0,[2]):(this.isVisualEditorMode="true"===e[di]||null!==Ur("sessionStorage",Xr),Qn(this.globalScope),this.isDebugActive=$n(),this.subscriptionManager=new vr(this,this.messageBus,this.pageObjects,this.behavioralTargetingManager,t(t({},this.config),{isVisualEditorMode:this.isVisualEditorMode,isDebugActive:this.isDebugActive}),this.globalScope),this.setupPreviewMode(e),this.subscriptionManager.initSubscriptions(),er(function(){return{flags:S.buildFlagDebugInfo(),visualEditor:{isActive:S.isVisualEditorMode,source:S.isVisualEditorMode?null!==Ur("sessionStorage",Xr)?"session_storage":"url_param":null},currentUrl:S.globalScope.location.href}}),this.isVisualEditorMode?(a="true"===e[di]?"url_param":"session_storage",Zn("ve_mode_detected","source=".concat(a)),Gr()?(Zn("opener_check","FAIL: window.opener is null, closed, or inaccessible"),Yn("error"),function(){if(!document.getElementById(Zr)){var e=document.createElement("dialog");e.id=Zr,e.setAttribute("role","alertdialog"),e.setAttribute("aria-labelledby","".concat(Zr,"-title")),e.innerHTML="\n <style>\n @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&display=swap');\n\n #".concat(Zr,",\n #").concat(Zr," * {\n font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;\n }\n #").concat(Zr," code {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;\n }\n\n /* Defensive resets — host pages often style h2/h3/p with\n * text-transform, letter-spacing, etc. that would otherwise leak in. */\n #").concat(Zr," h2,\n #").concat(Zr," h3,\n #").concat(Zr," p,\n #").concat(Zr," button,\n #").concat(Zr," code,\n #").concat(Zr," hr {\n text-transform: none !important;\n letter-spacing: normal !important;\n text-decoration: none !important;\n font-style: normal !important;\n }\n\n #").concat(Zr," {\n border: none;\n padding: 0;\n background: white;\n border-radius: 8px;\n max-width: 480px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n color: #212124;\n }\n\n #").concat(Zr,"::backdrop {\n background: rgba(33, 33, 36, 0.4);\n }\n\n #").concat(Zr," .modal {\n position: relative;\n padding: 32px;\n }\n\n #").concat(Zr," .close-icon {\n position: absolute;\n top: 16px;\n right: 16px;\n width: 28px;\n height: 28px;\n padding: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n border-radius: 6px;\n color: #5a5e68;\n cursor: pointer;\n }\n\n #").concat(Zr," .close-icon:hover {\n background: #f3f4f6;\n color: #212124;\n }\n\n #").concat(Zr," .close-icon svg {\n width: 16px;\n height: 16px;\n }\n\n #").concat(Zr," .title {\n font-size: 18px;\n font-weight: 600;\n margin: 0 0 12px 0;\n padding-right: 24px;\n }\n\n #").concat(Zr," .body {\n font-size: 14px;\n line-height: 1.5;\n margin: 0 0 12px 0;\n color: #5a5e68;\n }\n\n #").concat(Zr," .divider {\n border: none;\n border-top: 1px solid #e5e7eb;\n margin: 20px 0;\n }\n\n #").concat(Zr," .subtitle {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 8px 0;\n color: #212124;\n }\n\n #").concat(Zr," code {\n background: #f3f4f6;\n padding: 1px 6px;\n border-radius: 4px;\n font-size: 13px;\n }\n\n #").concat(Zr," .actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 24px;\n }\n\n #").concat(Zr," .secondary {\n font-size: 14px;\n padding: 8px 16px;\n border-radius: 6px;\n background: white;\n color: #212124;\n border: 1px solid #d1d5db;\n cursor: pointer;\n }\n\n #").concat(Zr,' .secondary:hover {\n background: #f9fafb;\n }\n </style>\n\n <div class="modal">\n <button\n type="button"\n class="close-icon"\n data-action="close"\n aria-label="Close"\n >\n <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">\n <path d="M3 3 L13 13 M13 3 L3 13" />\n </svg>\n </button>\n <h2 id="').concat(Zr,'-title" class="title">Can\'t connect to this page</h2>\n <p class="body">\n The Visual Editor lost its connection to this page and can\'t make\n edits here. This is usually a configuration issue on the site.\n </p>\n <hr class="divider" />\n <h3 class="subtitle">Technical Details</h3>\n <p class="body">\n This page sends a <code>Cross-Origin-Opener-Policy</code> header that\n isolates it from the editor window. To resolve this:\n </p>\n <p class="body">\n Remove the <code>Cross-Origin-Opener-Policy</code> header, or set its\n value to <code>unsafe-none</code> on pages you want to edit.\n </p>\n <div class="actions">\n <button type="button" class="secondary" data-action="close">Close</button>\n </div>\n </div>\n ');var t=function(){document.getElementById(Zr)||(document.body.appendChild(e),"function"==typeof e.showModal?e.showModal():e.setAttribute("open",""),e.querySelectorAll('button[data-action="close"]').forEach(function(e){e.addEventListener("click",function(){Yr()})}))};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}}(),this.globalScope.history.replaceState({},"",ii(this.globalScope.location.href,[di])),this.isRunning=!0,[2]):(Zn("opener_check","PASS"),or()?[4,lr(this.globalScope)]:[3,2])):[3,3]);case 1:r.sent(),r.label=2;case 2:return Qr.setup(),this.globalScope.history.replaceState({},"",ii(this.globalScope.location.href,[di])),Zn("url_param_removed","cleaned URL: ".concat(this.globalScope.location.href)),this.subscriptionManager.markUrlAsPublished(this.globalScope.location.href),this.messageBus.publish("url_change",{updateActivePages:!0}),this.isRunning=!0,wi(this),[2];case 3:this.subscriptionManager.markUrlAsPublished(this.globalScope.location.href),this.messageBus.publish("url_change",{updateActivePages:!0}),s="EXP_".concat(this.apiKey.slice(0,10)),(l=Ur("localStorage",s)||{}).web_exp_id?l.web_exp_id&&l.device_id&&(delete l.device_id,Br("localStorage",s,l)):(l.web_exp_id=l.device_id||ai(),delete l.device_id,Br("localStorage",s,l)),c=this.getVariants();try{for(u=i(Object.entries(c)),d=u.next();!d.done;d=u.next())f=o(d.value,2),v=f[0],p=f[1],this.remoteFlagKeys.includes(v)&&(null===(w=p.metadata)||void 0===w?void 0:w.blockingEvaluation)&&Object.keys(this.activePages).includes(v)&&!this.remoteFlagKeys.every(function(e){return Object.keys(S.previewFlags).includes(e)})&&(this.isRemoteBlocking=!0,hr())}catch(e){y={error:e}}finally{try{d&&!d.done&&(m=u.return)&&m.call(u)}finally{if(y)throw y.error}}return[4,Kr(this.apiKey,l)];case 4:return h=r.sent(),this.globalScope.experimentIntegration||(g=Me.getInstance("$default_instance"),this.globalScope.experimentIntegration=new He(this.apiKey,g,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(h),this.updateUserWithBehaviors(),this.isRemoteBlocking||gr(),this.applyVariants({flagKeys:this.localFlagKeys}),this.previewVariants({keyToVariant:this.previewFlags}),this.remoteFlagKeys.every(function(e){return Object.keys(S.previewFlags).includes(e)})?(this.isRunning=!0,wi(this),[2]):[4,this.fetchRemoteFlags()];case 5:return r.sent(),this.applyVariants({flagKeys:this.remoteFlagKeys}),this.isRunning=!0,wi(this),[2]}})})},e.getInstance=function(t,n,r){void 0===r&&(r={});var i=be();if(!i)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(i.webExperiment&&!i.webExperiment.isStub){var o=i.webExperiment;return o.isRunning&&wi(o),o}var a=new e(t,n,r);return i.webExperiment=a,a},e.prototype.getExperimentClient=function(){return this.experimentClient},e.prototype.hideLoadingIndicator=function(){Hr()},e.prototype.applyVariants=function(e){var t,n,r=(e||{}).flagKeys,i=this.getVariants();if(0!==Object.keys(i).length){var o=ri(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 c=Object.keys(this.appliedMutations[a]);c.length>0&&!c.includes(l)&&(this.revertVariants({flagKeys:[a]}),delete this.appliedMutations[a])}if("web"===(null===(n=s.metadata)||void 0===n?void 0:n.deliveryMethod)){var u=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}u&&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 c=l.value,u=this.appliedMutations[c];if(u){for(var d in u){var f=u[d];if(f)for(var v in f)for(var p in f[v])null===(o=null===(r=f[v][p])||void 0===r?void 0:r.revert)||void 0===o||o.call(r)}delete this.appliedMutations[c]}}}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&&Wn({flags:this.previewFlags});var a=o.payload;if(!a||!Array.isArray(a))return void(this.isActionActiveOnPage(n,void 0)&&this.exposureWithDedupe(n,o));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.updateUserWithBehaviors=function(){var e,n;if(this.behavioralTargetingManager){var r=[];try{for(var s=i(this.behavioralTargetingManager.getMatchedBehaviors().values()),l=s.next();!l.done;l=s.next()){var c=l.value;r.push.apply(r,a([],o(c),!1))}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}var u=this.experimentClient.getUser(),d=t(t({},u),{behavioral_targeting:r});this.experimentClient.setUser(d)}},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.toggleManualPageObject=function(e,t){var n;void 0===t&&(t=!0),null===(n=this.subscriptionManager)||void 0===n||n.toggleManualPageObject(e,t)},e.prototype.getDebugState=function(){return tr()},e.prototype.buildFlagDebugInfo=function(){var e,t,n,r,s,l,c={},u=this.getVariants(),d=null!==(r=null===(n=this.subscriptionManager)||void 0===n?void 0:n.getDebugPageObjects())&&void 0!==r?r:{},f=this.localFlagKeys.length>0?this.experimentClient.getEvaluationTraces(this.localFlagKeys):void 0;try{for(var v=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),p=v.next();!p.done;p=v.next()){var h=p.value,g=u[h],y=this.activePages[h],m=void 0,b=null==f?void 0:f[h];b?m={matched:b.matched,matchedSegment:b.matchedSegment,steps:b.steps}:(null===(s=null==g?void 0:g.metadata)||void 0===s?void 0:s.segmentName)&&(m={matched:!0,matchedSegment:g.metadata.segmentName,steps:[]}),c[h]={flagKey:h,variant:(null==g?void 0:g.key)?{key:g.key,value:g.value,metadata:g.metadata}:null,isActive:!!y&&Object.keys(y).length>0,audienceEvaluation:m,pageObjects:null!==(l=d[h])&&void 0!==l?l:[]}}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=v.return)&&t.call(v)}finally{if(e)throw e.error}}return c},e.prototype.addDebugStateSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addDebugStateSubscriber(e)},e.prototype.plugin=function(){var e=this;return{name:"@amplitude/experiment-tag",type:"enrichment",setup:function(){return n(e,void 0,void 0,function(){return r(this,function(e){return[2]})})},execute:function(t){return n(e,void 0,void 0,function(){return r(this,function(e){return this.trackEvent(t.event_type,t.event_properties),[2,t]})})}}},e.prototype.trackEvent=function(e,t){var n;null===(n=this.behavioralTargetingManager)||void 0===n||n.trackEvent(e,t||{}),this.messageBus.publish("analytics_event",{event:e,properties:t||{}})},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===si?this.handleMutate(s,e,t):s.action===li&&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=ri(this.previousUrl||this.globalScope.document.referrer),c=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.url;if(ri(this.globalScope.location.href)!==l){var u=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,c);this.globalScope.location.href!==u&&(this.storeRedirectImpressions(t,i,c),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 Nr({sameSite:"Lax"}),n=new Dr,i="AMP_".concat(Pr,"_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(u):this.globalScope.location.replace(u))}}},e.prototype.handleMutate=function(e,n,r){var i,o,a,s,l,c=this,u=(null===(i=e.data)||void 0===i?void 0:i.mutations)||[],d=r.key||"";if(0!==u.length){var f={};u.forEach(function(e,t){var i,o,a,s,l,u,v,p,h,g,y;c.isActionActiveOnPage(n,null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.scope)?(c.exposureWithDedupe(n,r),(null===(y=null===(g=null===(h=c.appliedMutations[n])||void 0===h?void 0:h[d])||void 0===g?void 0:g[si])||void 0===y?void 0:y[t])||(f[t]=Ln.declarative(e))):(null===(s=null===(a=null===(o=c.appliedMutations[n])||void 0===o?void 0:o[d])||void 0===a?void 0:a[si])||void 0===s?void 0:s[t])&&(null===(p=null===(v=null===(u=null===(l=c.appliedMutations[n])||void 0===l?void 0:l[d])||void 0===u?void 0:u[si])||void 0===v?void 0:v[t])||void 0===p||p.revert(),delete c.appliedMutations[n][d][si][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][si]=t(t({},this.appliedMutations[n][d][si]),f),0===Object.keys(this.appliedMutations[n][d][si]||{}).length&&delete this.appliedMutations[n][d][si],0===Object.keys(this.appliedMutations[n][d]||{}).length&&delete this.appliedMutations[n]}},e.prototype.handleInject=function(e,t,i){var o,a,s,l,c,u,d,f,v,p,h,g,y=this,m=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,S=e.data.js;S&&(w=this.globalScope.document.createElement("script"))&&(w.innerHTML="function ".concat(b,"(html, utils, id){").concat(S,"};"),w.id="js-".concat(b),this.globalScope.document.head.appendChild(w));var x,k=e.data.css;k&&(x=Kn(this.globalScope.document,k));var E,_=e.data.html;_&&(E=null!==(u=(new DOMParser).parseFromString(_,"text/html").body.firstElementChild)&&void 0!==u?u:void 0);var O={cancelled:!1},A=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||(An(),s.insertBefore(t,l),Tn(),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 T=this.globalScope[b];T&&"function"==typeof T&&T(E,A,b)}catch(e){null==w||w.remove(),console.error("Experiment inject failed for ".concat(t," variant ").concat(i.key,". Reason:"),e)}null!==(d=(p=this.appliedMutations)[t])&&void 0!==d||(p[t]={}),null!==(f=(h=this.appliedMutations[t])[m])&&void 0!==f||(h[m]={}),null!==(v=(g=this.appliedMutations[t][m])[li])&&void 0!==v||(g[li]={}),this.appliedMutations[t][m][li][b]={revert:function(){var e;O.cancelled=!0,null===(e=A.remove)||void 0===e||e.call(A),null==x||x.revert(),null==w||w.remove(),y.appliedInjections.delete(b)}},this.exposureWithDedupe(t,i)}}else null===(c=null===(l=null===(s=null===(a=this.appliedMutations[t])||void 0===a?void 0:a[m])||void 0===s?void 0:s[li])||void 0===l?void 0:l[0])||void 0===c||c.revert()},e.prototype.exposureWithDedupe=function(e,t,n){var r,i,o,a,s=ri(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||this.previewFlags[e]){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=Ur("sessionStorage",r)||{};i[e]={redirectUrl:n,variant:t},Br("sessionStorage",r,i)},e.prototype.fireStoredRedirectImpressions=function(){var e=this,t="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),n=Ur("sessionStorage",t)||{};if(Object.keys(n).length>0)for(var r in n){var i=n[r],o=i.redirectUrl,a=i.variant,s=ri(this.globalScope.location.href),l=ri(o);oi([s],l)&&(this.exposureWithDedupe(r,a,!0),delete n[r])}Object.keys(n).length>0?this.globalScope.setTimeout(function(){var n=Ur("sessionStorage",t)||{};for(var r in n)e.exposureWithDedupe(r,n[r].variant,!0);Fr("sessionStorage",t)},500):Fr("sessionStorage",t)},e.prototype.setupPreviewMode=function(e){var t=this;if("true"===e[ci]){Object.keys(e).forEach(function(n){n!==ci&&e[n]&&(t.previewFlags[n]=e[n])}),Br("sessionStorage",ui,{previewFlags:this.previewFlags});var n=a(a([],o(Object.keys(this.previewFlags)),!1),[ci],!1);this.globalScope.history.replaceState({},"",ii(this.globalScope.location.href,n)),Qr.setup()}else{var r=Ur("sessionStorage",ui);r&&(this.previewFlags=r.previewFlags)}Object.keys(this.previewFlags).length>0&&(this.isPreviewMode=!0)},e}();var vi=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 c 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(c,t.headers[c]);i.send(t.body||null)})},pi={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,vi(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,(c=s(),u=a,!u||u<=0?c:Promise.race([c,new Promise(function(e,t){return setTimeout(function(){return t(new he("Timeout after ".concat(u,"ms")))},u)})]))];var c,u})})}},hi=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,o,a;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.23.4"),[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),i=n.flags,o=n.pageObjects,a=n.behavioralTargetingRules,[2,{flags:i,pageViewObjects:o,behavioralTargetingRules:a}]}})})},e}(),gi=[],yi=function(e,t,n){fi.getInstance(e,t,n).start().finally(function(){gr()})},mi=function(e,t){return n(void 0,void 0,void 0,function(){return r(this,function(n){return[2,new hi(e,"EU"===t?"https://api.lab.eu.amplitude.com":"https://api.lab.amplitude.com",pi).getPreviewFlagsAndPageViewObjects()]})})},bi=function(){return{name:"@amplitude/experiment-tag",type:"enrichment",execute:function(e){return n(void 0,void 0,void 0,function(){var t,n;return r(this,function(r){return t=be(),(n=null==t?void 0:t.webExperiment)&&"function"==typeof n.trackEvent&&n.isRunning?n.trackEvent(e.event_type,e.event_properties):gi.push({event_type:e.event_type,event_properties:e.event_properties}),[2,e]})})}}},wi=function(e){gi.length>0&&(gi.forEach(function(t){var n=t.event_type,r=t.event_properties;e.trackEvent(n,r)}),gi.length=0)};e.createPlugin=bi,e.flushEventBuffer=wi,e.initialize=function(e,t,n){var r,i=be();if(!i)throw new Error("Global scope not available");i.webExperiment||(i.webExperiment={plugin:bi,isStub:!0}),function(){if("true"===ni()[ci])return!0;var e=Ur("sessionStorage",ui);return!!((null==e?void 0:e.previewFlags)&&Object.keys(e.previewFlags).length>0)}()||(null===(r=i.WebExperiment)||void 0===r?void 0:r.injectedByExtension)?(hr(),mi(e,n.serverZone).then(function(t){var r=JSON.stringify(t.flags),i=JSON.stringify(t.pageViewObjects),o=JSON.stringify(t.behavioralTargetingRules);yi(e,{initialFlags:r,pageObjects:i,behavioralTargetingRules:o},n)}).catch(function(r){console.warn("Failed to fetch latest configs for preview:",r),yi(e,t,n)}).finally(function(){gr()})):yi(e,t,n)},Object.defineProperty(e,"__esModule",{value:!0})}(this.WebExperiment=this.WebExperiment||{});
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/experiment-tag",
3
- "version": "0.23.3",
3
+ "version": "0.23.4",
4
4
  "description": "Amplitude Experiment Javascript Snippet",
5
5
  "author": "Amplitude",
6
6
  "homepage": "https://github.com/amplitude/experiment-js-client",
@@ -43,5 +43,5 @@
43
43
  "files": [
44
44
  "dist"
45
45
  ],
46
- "gitHead": "5251759fd315cdac385ee4e1707380f1b23eb0ef"
46
+ "gitHead": "bb39e4125884b7eaab4685d67e8cb719da6d0edf"
47
47
  }