vendor: 11,142 bytes, line 1
1var _growthbook=function(){"use strict";function t(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)"__proto__"!==i&&(t[i]=n[i])}return t}var e=function e(n,i){function r(e,r,s){if("undefined"!=typeof document){"number"==typeof(s=t({},i,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var u in s)s[u]&&(o+="; "+u,!0!==s[u]&&(o+="="+s[u].split(";")[0]));return document.cookie=e+"="+n.write(r,e)+o}}return Object.create({set:r,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var e=document.cookie?document.cookie.split("; "):[],i={},r=0;r<e.length;r++){var s=e[r].split("="),o=s.slice(1).join("=");try{var u=decodeURIComponent(s[0]);if(u in i||(i[u]=n.read(o,u)),t===u)break}catch{}}return t?i[t]:i}},remove:function(e,n){r(e,"",t({},n,{expires:-1}))},withAttributes:function(n){return e(this.converter,t({},this.attributes,n))},withConverter:function(n){return e(t({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(n)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),n=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,i={revert:function(){}},r=new Map,s=new Set;function o(t){var e=r.get(t);return e||r.set(t,e={element:t,attributes:{}}),e}function u(t,e,n,i,r){var s=n(t),o={isDirty:!1,originalValue:s,virtualValue:s,mutations:[],el:t,t:null,observer:new MutationObserver((function(){if("position"!==e||!o.t){"position"===e&&(o.t=setTimeout((function(){o.t=null}),1e3));var i=n(t);"position"===e&&i.parentNode===o.virtualValue.parentNode&&i.insertBeforeNode===o.virtualValue.insertBeforeNode||i!==o.virtualValue&&(o.originalValue=i,r(o))}})),mutationRunner:r,setValue:i,getCurrentValue:n};return"position"===e&&t.parentNode?o.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):o.observer.observe(t,function(t){return"html"===t?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}(e)),o}function c(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&"string"!=typeof t?n&&t.parentNode===n.parentNode&&t.insertBeforeNode===n.insertBeforeNode||(e.isDirty=!0,E()):t!==n&&(e.isDirty=!0,E())}function a(t){var e=t.originalValue;t.mutations.forEach((function(t){return e=t.mutate(e)})),c(function(t){return v||(v=document.createElement("div")),v.innerHTML=t,v.innerHTML}(e),t)}function l(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach((function(t){return t.mutate(e)})),c(Array.from(e).filter(Boolean).join(" "),t)}function h(t){var e=t.originalValue;t.mutations.forEach((function(t){return e=t.mutate(e)})),c(e,t)}function f(t){var e=t.originalValue;t.mutations.forEach((function(t){var n=function(t){var e=t.insertBeforeSelector,n=document.querySelector(t.parentSelector);if(!n)return null;var i=e?document.querySelector(e):null;return e&&!i?null:{parentNode:n,insertBeforeNode:i}}(t.mutate());e=n||e})),c(e,t)}var d=function(t){return t.innerHTML},w=function(t,e){return t.innerHTML=e};function p(t){var e=o(t);return e.html||(e.html=u(t,"html",d,w,a)),e.html}var y=function(t){return{parentNode:t.parentElement,insertBeforeNode:t.nextElementSibling}},g=function(t,e){e.insertBeforeNode&&!e.parentNode.contains(e.insertBeforeNode)||e.parentNode.insertBefore(t,e.insertBeforeNode)};function m(t){var e=o(t);return e.position||(e.position=u(t,"position",y,g,f)),e.position}var v,b,k=function(t,e){return e?t.className=e:t.removeAttribute("class")},S=function(t){return t.className};function A(t){var e=o(t);return e.classes||(e.classes=u(t,"class",S,k,l)),e.classes}function _(t,e){var n,i=o(t);return i.attributes[e]||(i.attributes[e]=u(t,e,(n=e,function(t){var e;return null!=(e=t.getAttribute(n))?e:null}),function(t){return function(e,n){return null!==n?e.setAttribute(t,n):e.removeAttribute(t)}}(e),h)),i.attributes[e]}function x(t,e,n){if(n.isDirty){n.isDirty=!1;var i=n.virtualValue;n.mutations.length||function(t,e){var n,i,s=r.get(t);if(s)if("html"===e)null==(n=s.html)||null==(i=n.observer)||i.disconnect(),delete s.html;else if("class"===e){var o,u;null==(o=s.classes)||null==(u=o.observer)||u.disconnect(),delete s.classes}else if("position"===e){var c,a;null==(c=s.position)||null==(a=c.observer)||a.disconnect(),delete s.position}else{var l,h,f;null==(l=s.attributes)||null==(h=l[e])||null==(f=h.observer)||f.disconnect(),delete s.attributes[e]}}(t,e),n.setValue(t,i)}}function $(t,e){t.html&&x(e,"html",t.html),t.classes&&x(e,"class",t.classes),t.position&&x(e,"position",t.position),Object.keys(t.attributes).forEach((function(n){x(e,n,t.attributes[n])}))}function E(){r.forEach($)}function C(t){if("position"!==t.kind||1!==t.elements.size){var e=new Set(t.elements);document.querySelectorAll(t.selector).forEach((function(n){e.has(n)||(t.elements.add(n),function(t,e){var n=null;"html"===t.kind?n=p(e):"class"===t.kind?n=A(e):"attribute"===t.kind?n=_(e,t.attribute):"position"===t.kind&&(n=m(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}(t,n))}))}}function O(){s.forEach(C)}function T(t){return"undefined"==typeof document?i:(s.add(t),C(t),{revert:function(){var e;(e=t).elements.forEach((function(t){return function(t,e){var n=null;if("html"===t.kind?n=p(e):"class"===t.kind?n=A(e):"attribute"===t.kind?n=_(e,t.attribute):"position"===t.kind&&(n=m(e)),n){var i=n.mutations.indexOf(t);-1!==i&&n.mutations.splice(i,1),n.mutationRunner(n)}}(e,t)})),e.elements.clear(),s.delete(e)}})}function N(t,e){return T({kind:"html",elements:new Set,mutate:e,selector:t})}function I(t,e){return T({kind:"class",elements:new Set,mutate:e,selector:t})}function D(t,e,r){return n.test(e)?"class"===e||"className"===e?I(t,(function(t){var e=r(Array.from(t).join(" "));t.clear(),e&&e.split(/\s+/g).filter(Boolean).forEach((function(e){return t.add(e)}))})):T({kind:"attribute",attribute:e,elements:new Set,mutate:r,selector:t}):i}"undefined"!=typeof document&&(b||(b=new MutationObserver((function(){O()}))),O(),b.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}));const F={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function B(t){let e=2166136261;const n=t.length;for(let i=0;i<n;i++)e^=t.charCodeAt(i),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function M(t,e,n){return 2===n?B(B(t+e)+"")%1e4/1e4:1===n?B(e+t)%1e3/1e3:null}function R(t){return t<=0?[]:new Array(t).fill(1/t)}function U(t,e){return t>=e[0]&&t<e[1]}function V(t){try{const e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(t){return void console.error(t)}}function j(t,e){if(!e.length)return!1;let n=!1,i=!1;for(let r=0;r<e.length;r++){const s=J(t,e[r].type,e[r].pattern);if(!1===e[r].include){if(s)return!1}else n=!0,s&&(i=!0)}return i||!n}function J(t,e,n){try{const i=new URL(t,"https://_");if("regex"===e){const t=V(n);return!!t&&(t.test(i.href)||t.test(i.href.substring(i.origin.length)))}return"simple"===e&&function(t,e){try{const n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),i=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&i.push([t.hash,n.hash,!1]),n.searchParams.forEach(((e,n)=>{i.push([t.searchParams.get(n)||"",e,!1])})),!i.some((t=>!function(t,e,n){try{let i=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(i="\\/?"+i.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+i+"$","i").test(t)}catch(t){return!1}}(t[0],t[1],t[2])))}catch(t){return!1}}(i,n)}catch(t){return!1}}const P=t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0)));async function L(t,e,n){if(e=e||"",!(n=n||globalThis.crypto&&globalThis.crypto.subtle||F.SubtleCrypto))throw new Error("No SubtleCrypto implementation found");try{const i=await n.importKey("raw",P(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[r,s]=t.split("."),o=await n.decrypt({name:"AES-CBC",iv:P(r)},i,P(s));return(new TextDecoder).decode(o)}catch(t){throw new Error("Failed to decrypt")}}function K(t){return"string"==typeof t?t:JSON.stringify(t)}function H(t){"number"==typeof t&&(t+=""),t&&"string"==typeof t||(t="0");const e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return 3===e.length&&e.push("~"),e.map((t=>t.match(/^[0-9]+$/)?t.padStart(5," "):t)).join("-")}function q(){let t;try{t="1.8.0"}catch(e){t=""}return t}function G(t){return"object"==typeof t&&null!==t}function z(t){return t.urlPatterns&&t.variations.some((t=>G(t)&&"urlRedirect"in t))?"redirect":t.variations.some((t=>G(t)&&(t.domMutations||"js"in t||"css"in t)))?"visual":"unknown"}async function W(t,e){return new Promise((n=>{let i,r=!1;const s=t=>{r||(r=!0,i&&clearTimeout(i),n(t||null))};e&&(i=setTimeout((()=>s()),e)),t.then((t=>s(t))).catch((()=>s()))}))}const Z={staleTTL:6e4,maxAge:144e5,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},Q=F,X={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>Q.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:i})=>{const r={method:"POST",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)};return Q.fetch(`${t}/api/eval/${e}`,r)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new Q.EventSource(`${t}/sub/${e}`,{headers:n}):new Q.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if("undefined"==typeof window||"undefined"==typeof document)return;const e=()=>{"visible"===document.visibilityState?(window.clearTimeout(t),it.forEach((t=>{t&&"idle"===t.state&&bt(t)}))):"hidden"===document.visibilityState&&(t=window.setTimeout(ut,Z.idleStreamInterval))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(Q.localStorage=globalThis.localStorage)}catch(t){}const Y=new Map;let tt=!1;const et=new Map,nt=new Map,it=new Map,rt=new Map,st=new Set,ot=new Set;function ut(){it.forEach((t=>{t&&(t.state="idle",vt(t))}))}function ct(t,e,n){return Math.min(t*Math.pow(e,n)*(1+Math.random()),3e5)}function at(t){console.warn(`[GrowthBook] ${t}`)}function lt(t){ot.has(t)||(ot.add(t),at(`Streaming is enabled, but not active: ${t}. Features will not be updated in the background. Set \`pollingInterval\` to refresh on a timer instead, or see https://docs.growthbook.io/lib/node#refreshing-features`))}async function ht(){try{if(!Q.localStorage)return;await Q.localStorage.setItem(Z.cacheKey,JSON.stringify(Array.from(et.entries())))}catch(t){}}function ft(t){const[e,n]=t.getApiInfo();return`${e}||${n}`}function dt(t){const e=ft(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;const n=t.getAttributes(),i=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),r={};
1i.forEach((t=>{r[t]=n[t]}));const s=t.getForcedVariations(),o=t.getUrl();return`${e}||${JSON.stringify({ca:r,fv:s,url:o})}`}function wt(){const t=Array.from(et.entries()).map((([t,e])=>({key:t,staleAt:e.staleAt.getTime()}))).sort(((t,e)=>t.staleAt-e.staleAt)),e=Math.min(Math.max(0,et.size-Z.maxEntries),et.size);for(let n=0;n<e;n++)et.delete(t[n].key)}function pt(t,e,n){const i=n.dateUpdated||"",r=new Date(Date.now()+Z.staleTTL),s=Z.disableCache?void 0:et.get(e);if(s&&i&&s.version===i)return s.staleAt=r,void ht();Z.disableCache||(et.set(e,{data:n,version:i,staleAt:r,sse:st.has(t)}),wt()),ht();const o=Y.get(t);o&&o.forEach((t=>async function(t,e){await t.setPayload(e||t.getPayload())}(t,n)))}async function yt(t){const{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),i=t.getClientKey(),r="isRemoteEval"in t&&t.isRemoteEval(),s=ft(t),o=dt(t);let u=nt.get(o);return u||(u=(r?X.fetchRemoteEvalCall({host:e,clientKey:i,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):X.fetchFeaturesCall({host:e,clientKey:i,headers:n})).then((t=>{if(!t.ok)throw new Error(`HTTP error: ${t.status}`);return"enabled"===t.headers.get("x-sse-support")&&st.add(s),t.json()})).then((e=>(pt(s,o,e),gt(t),nt.delete(o),{data:e,success:!0,source:"network"}))).catch((t=>(nt.delete(o),{data:null,source:"error",success:!1,error:t}))),nt.set(o,u)),u}function gt(t,e=!1){const n=ft(t),i=dt(t),{streamingHost:r,streamingHostRequestHeaders:s}=t.getApiHosts(),o=t.getClientKey();if(e&&st.add(n),Z.backgroundSync&&st.has(n)&&Q.EventSource){if(it.has(n))return;const t={src:null,key:n,host:r,clientKey:o,headers:s,cb:e=>{try{if("features-updated"===e.type){const t=Y.get(n);t&&t.forEach((t=>{yt(t)}))}else if("features"===e.type){const t=JSON.parse(e.data);pt(n,i,t)}t.errors=0}catch(e){mt(t)}},errors:0,state:"active"};it.set(n,t),bt(t)}}function mt(t){if("idle"!==t.state&&(t.errors++,t.errors>3||t.src&&2===t.src.readyState)){const e=ct(1e3,3,t.errors-3);vt(t),setTimeout((()=>{["idle","active"].includes(t.state)||it.get(t.key)===t&&bt(t)}),e)}}function vt(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,"active"===t.state&&(t.state="disabled"))}function bt(t){try{t.src=X.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>mt(t),t.src.onopen=()=>{t.errors=0;const e=rt.get(t.key);e&&_t(e,t.key)}}catch(e){try{t.src&&(t.src.close(),t.src.onerror=null,t.src.onopen=null)}catch(t){}t.src=null,t.state="disabled",it.get(t.key)===t&&it.delete(t.key),lt(`the EventSource implementation threw an error (${e?e.message:"unknown error"})`)}}function kt(t,e){vt(t),it.delete(e)}function St(t,e){if(!Number.isFinite(e)||e<1||e>2147483647)return void at(`Ignoring invalid pollingInterval (${e}). Expected a finite number of milliseconds between 1 and 2147483647.`);if(rt.has(t))return;const n={timer:null,interval:e,errors:0};rt.set(t,n),At(t,n)}function At(t,e){const n=e.errors>0?ct(e.interval,2,e.errors-1):e.interval,i=setTimeout((()=>{const n=Y.get(t),i=n&&n.values().next().value;i?yt(i).then((n=>{e.errors=n.success?0:e.errors+1,rt.get(t)===e&&At(t,e)})):_t(e,t)}),n);i.unref&&i.unref(),e.timer=i}function _t(t,e){t.timer&&clearTimeout(t.timer),rt.delete(e)}function xt(){st.clear(),ot.clear(),it.forEach(kt),rt.forEach(_t),Y.clear(),X.stopIdleListener()}function $t(t,e){if(!e.streaming&&void 0===e.pollingInterval)return;
1if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming or polling");e.streaming&&(e.payload&>(t,!0),Q.EventSource?Z.backgroundSync&&!st.has(ft(t))&<("the API host did not report SSE support (missing `x-sse-support` response header). This is also expected when the initial payload fetch fails"):lt("no EventSource implementation is available. In Node.js, install the `eventsource` package and pass it to setPolyfills({ EventSource })")),function(t){const e=ft(t),n=Y.get(e)||new Set;n.add(t),Y.set(e,n)}(t);const n=ft(t);void 0!==e.pollingInterval&&Z.backgroundSync&&St(n,e.pollingInterval)}const Et={};function Ct(t,e,n,i){n=n||{},i=i||new Set;for(const[r,s]of Object.entries(e))switch(r){case"$or":if(!Ut(t,s,n,i))return!1;break;case"$nor":if(Ut(t,s,n,i))return!1;break;case"$and":if(!Vt(t,s,n,i))return!1;break;case"$not":if(Ct(t,s,n,i))return!1;break;case"$savedGroup":if(!Ot(t,s,n,i))return!1;break;default:if(!It(s,Tt(t,r),n,!1,i))return!1}return!0}function Ot(t,e,n,i){if(!e||"object"!=typeof e||Array.isArray(e))return!1;const{id:r,attributeKey:s}=e;if("string"!=typeof r||i.has(r))return!1;if(void 0!==s&&"string"!=typeof s)return!1;const o=n[r];if(!o||Array.isArray(o)||"object"!=typeof o)return!1;const u=new Set(i).add(r);if("list"===o.type){const e=s??o.attributeKey;return"string"==typeof e&&!!Array.isArray(o.values)&&Ft(Tt(t,e),o.values)}return"condition"===o.type&&!(!o.condition||"object"!=typeof o.condition)&&Ct(t,o.condition,n,u)}function Tt(t,e){const n=e.split(".");let i=t;for(let t=0;t<n.length;t++){if(!i||"object"!=typeof i||!(n[t]in i))return null;i=i[n[t]]}return i}function Nt(t,e=!1){const n=`${t}${e?"/i":""}`;return Et[n]||(Et[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Et[n]}function It(t,e,n,i=!1,r=new Set){if("string"==typeof t)return i?String(e).toLowerCase()===t.toLowerCase():e+""===t;if("number"==typeof t)return 1*e===t;if("boolean"==typeof t)return null!==e&&!!e===t;if(null===t)return null===e;if(Array.isArray(t)||!Dt(t))return JSON.stringify(e)===JSON.stringify(t);for(const i in t)if(!Rt(i,e,t[i],n,r))return!1;return!0}function Dt(t){const e=Object.keys(t);return e.length>0&&e.filter((t=>"$"===t[0])).length===e.length}function Ft(t,e,n=!1){if(n){const n=t=>"string"==typeof t?t.toLowerCase():t;return Array.isArray(t)?t.some((t=>e.some((e=>n(t)===n(e))))):e.some((e=>n(t)===n(e)))}return Array.isArray(t)?t.some((t=>e.includes(t))):e.includes(t)}function Bt(t){return void 0===t?[]:Array.isArray(t)?t:t&&"object"==typeof t&&"list"===t.type&&Array.isArray(t.values)?t.values:null}function Mt(t,e,n,i=!1,r=new Set){if(!Array.isArray(t))return!1;for(let s=0;s<e.length;s++){let o=!1;for(let u=0;u<t.length;u++)if(It(e[s],t[u],n,i,r)){o=!0;break}if(!o)return!1}return!0}function Rt(t,e,n,i,r=new Set){switch(t){case"$veq":return H(e)===H(n);case"$vne":return H(e)!==H(n);case"$vgt":return H(e)>H(n);case"$vgte":return H(e)>=H(n);case"$vlt":return H(e)<H(n);case"$vlte":return H(e)<=H(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?null!=e:null==e;case"$in":return!!Array.isArray(n)&&Ft(e,n);case"$ini":return!!Array.isArray(n)&&Ft(e,n,!0);case"$inGroup":{const t=Bt(i[n]);return null!==t&&Ft(e,t)}case"$notInGroup":{const t=Bt(i[n]);return null!==t&&!Ft(e,t)}case"$nin":return!!Array.isArray(n)&&!Ft(e,n);case"$nini":return!!Array.isArray(n)&&!Ft(e,n,!0);case"$not":return!It(n,e,i,!1,r);case"$size":return!!Array.isArray(e)&&It(n,e.length,i,!1,r);case"$elemMatch":return function(t,e,n,i){if(!Array.isArray(t))return!1;const r=Dt(e)?t=>It(e,t,n,!1,i):t=>Ct(t,e,n,i);for(let e=0;e<t.length;e++)if(null!==(t[e]??null)&&r(t[e]))return!0;return!1}(e,n,i,r);case"$all":return!!Array.isArray(n)&&Mt(e,n,i,!1,r);case"$alli":return!!Array.isArray(n)&&Mt(e,n,i,!0,r);case"$regex":try{return Nt(n).test(e)}catch(t){return!1}case"$regexi":try{return Nt(n,!0).test(e)}catch(t){return!1}case"$type":return function(t){if(null===t)return"null";if(Array.isArray(t))return"array";const e=typeof t;return["string","number","boolean","object","undefined"].includes(e)?e:"unknown"}(e)===n;default:return console.error("Unknown operator: "+t),!1}}function Ut(t,e,n,i){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(Ct(t,e[r],n,i))return!0;return!1}function Vt(t,e,n,i){for(let r=0;r<e.length;r++)if(!Ct(t,e[r],n,i))return!1;return!0}const jt="Feature Evaluated",Jt="Experiment Viewed";async function Pt(t){try{await t()}catch(t){}}function Lt(t,e,n){if(t.user.trackedExperiments){const i=re(e,n);if(t.user.trackedExperiments.has(i))return[];t.user.trackedExperiments.add(i)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});const i=[];if(t.global.trackingCallback){const r=t.global.trackingCallback;i.push(Pt((()=>r(e,n,zt(t.user)))))}if(t.user.trackingCallback){const r=t.user.trackingCallback;i.push(Pt((()=>r(e,n,zt(t.user)))))}if(t.global.eventLogger){const r=t.global.eventLogger;i.push(Pt((()=>r(Jt,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},zt(t.user)))))}if(t.user.experimentViewedSubs?.size){const i=zt(t.user);
1t.user.experimentViewedSubs.forEach((t=>{try{t(e,n,i)}catch(t){console.error(t)}}))}return i}function Kt(t,e){if(e.stack.evaluatedFeatures.has(t))return qt(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;const n=function(t){const e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach(((t,n)=>e.set(n,t))),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach(((t,n)=>e.set(n,t))),e}(e);if(n.has(t))return qt(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return qt(e,t,null,"unknownFeature");const i=e.global.features[t];if(i.rules){const n=new Set(e.stack.evaluatedFeatures);t:for(const r of i.rules){if(r.parentConditions)for(const i of r.parentConditions){e.stack.evaluatedFeatures=new Set(n);const r=Kt(i.id,e);if("cyclicPrerequisite"===r.source)return qt(e,t,null,"cyclicPrerequisite");if(!Ct({value:r.value},i.condition||{},e.global.savedGroups||{})){if(i.gate)return qt(e,t,null,"prerequisite");continue t}}if(r.filters&&Qt(r.filters,e))continue;if("force"in r){if(r.condition&&!Zt(r.condition,e))continue;if(!Xt(e,r.seed||t,r.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!r.disableStickyBucketing?r.fallbackAttribute:void 0,r.range,r.coverage,r.hashVersion))continue;return r.tracks&&r.tracks.forEach((t=>{!Lt(e,t.experiment,t.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:t.experiment,result:t.result,user:zt(e.user)})})),qt(e,t,r.force,"force",r.id)}const i=r.contextualVariations??r.variations;if(!i)continue;const s={variations:i,key:r.key||t};"coverage"in r&&(s.coverage=r.coverage),r.weights&&(s.weights=r.weights),r.hashAttribute&&(s.hashAttribute=r.hashAttribute),r.fallbackAttribute&&(s.fallbackAttribute=r.fallbackAttribute),r.disableStickyBucketing&&(s.disableStickyBucketing=r.disableStickyBucketing),void 0!==r.bucketVersion&&(s.bucketVersion=r.bucketVersion),void 0!==r.minBucketVersion&&(s.minBucketVersion=r.minBucketVersion),r.namespace&&(s.namespace=r.namespace),r.meta&&(s.meta=r.meta),r.ranges&&(s.ranges=r.ranges),r.name&&(s.name=r.name),r.phase&&(s.phase=r.phase),r.seed&&(s.seed=r.seed),r.hashVersion&&(s.hashVersion=r.hashVersion),r.filters&&(s.filters=r.filters),r.condition&&(s.condition=r.condition),r.contextualBanditRef&&Wt(s,r.contextualBanditRef,0,e);const{result:o}=Ht(s,t,e);if(!s.contextualBandit||o.hashUsed&&o.inExperiment||delete s.contextualBandit,e.global.onExperimentEval&&e.global.onExperimentEval(s,o),o.inExperiment&&!o.passthrough)return qt(e,t,o.value,"experiment",r.id,s,o)}}return qt(e,t,void 0===i.defaultValue?null:i.defaultValue,"defaultValue")}function Ht(t,e,n){const i=t.key,r=t.variations.length;if(r<2)return{result:Yt(n,t,-1,!1,e)};if(!1===n.global.enabled||!1===n.user.enabled)return{result:Yt(n,t,-1,!1,e)};if(t=function(t,e){const n=t.key,i=e.global.overrides;return i&&i[n]&&"string"==typeof(t=Object.assign({},t,i[n])).url&&(t.url=V(t.url)),t}(t,n),t.contextualBandit&&t.weights&&(t.contextualBandit={...t.contextualBandit,variationWeights:t.weights}),t.urlPatterns&&!j(n.user.url||"",t.urlPatterns))return{result:Yt(n,t,-1,!1,e)};const s=function(t,e,n){if(!e)return null;const i=e.split("?")[1];if(!i)return null;const r=i.replace(/#.*/,"").split("&").map((t=>t.split("=",2))).filter((([e])=>e===t)).map((([,t])=>parseInt(t)));return r.length>0&&r[0]>=0&&r[0]<n?r[0]:null}(i,n.user.url||"",r);if(null!==s)return{result:Yt(n,t,s,!1,e)};const o=function(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}(n);if(i in o)return{result:Yt(n,t,o[i],!1,e)};if("draft"===t.status||!1===t.active)return{result:Yt(n,t,-1,!1,e)};const{hashAttribute:u,hashValue:c}=te(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!c)return{result:Yt(n,t,-1,!1,e)};let a=-1,l=!1,h=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){const{variation:e,versionIsBlocked:i}=function({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:i,expFallbackAttribute:r,expMinBucketVersion:s,expMeta:o}){s=s||0,i=i||"id",o=o||[];const u=ee(e,n=n||0),c=function(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};const{hashAttribute:i,hashValue:r}=te(t,e),s=ne(i,K(r)),{hashAttribute:o,hashValue:u}=te(t,n),c=u?ne(o,K(u)):null,a={};return c&&t.user.stickyBucketAssignmentDocs[c]&&Object.assign(a,t.user.stickyBucketAssignmentDocs[c].assignments||{}),t.user.stickyBucketAssignmentDocs[s]&&Object.assign(a,t.user.stickyBucketAssignmentDocs[s].assignments||{}),a}(t,i,r);if(s>0)for(let t=0;t<s;t++)if(void 0!==c[ee(e,t)])return{variation:-1,versionIsBlocked:!0};const a=c[u];if(void 0===a)return{variation:-1};const l=o.findIndex((t=>t.key===a));return l<0?{variation:-1}:{variation:l}}({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});l=e>=0,a=e,h=!!i}if(!l){if(t.filters){if(Qt(t.filters,n))return{result:Yt(n,t,-1,!1,e)}}else if(t.namespace&&!function(t,e){const n=M("__"+e[0],t,1);return null!==n&&n>=e[1]&&n<e[2]}
vendor: 5,593 bytes, line 1
1(c,t.namespace))return{result:Yt(n,t,-1,!1,e)};if(t.include&&!function(t){try{return t()}catch(t){return console.error(t),!1}}(t.include))return{result:Yt(n,t,-1,!1,e)};if(t.condition&&!Zt(t.condition,n))return{result:Yt(n,t,-1,!1,e)};if(t.parentConditions){const i=new Set(n.stack.evaluatedFeatures);for(const r of t.parentConditions){n.stack.evaluatedFeatures=new Set(i);const s=Kt(r.id,n);if("cyclicPrerequisite"===s.source)return{result:Yt(n,t,-1,!1,e)};if(!Ct({value:s.value},r.condition||{},n.global.savedGroups||{}))return{result:Yt(n,t,-1,!1,e)}}}if(t.groups&&!function(t,e){const n=e.global.groups||{};for(let e=0;e<t.length;e++)if(n[t[e]])return!0;return!1}(t.groups,n))return{result:Yt(n,t,-1,!1,e)}}if(t.url&&!function(t,e){const n=e.user.url;if(!n)return!1;const i=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!t.test(n)||!!t.test(i)}(t.url,n))return{result:Yt(n,t,-1,!1,e)};const f=M(t.seed||i,c,t.hashVersion||1);if(null===f)return{result:Yt(n,t,-1,!1,e)};if(!l){const e=t.ranges||function(t,e,n){(e=void 0===e?1:e)<0?e=0:e>1&&(e=1);const i=R(t);(n=n||i).length!==t&&(n=i);const r=n.reduce(((t,e)=>e+t),0);(r<.99||r>1.01)&&(n=i);let s=0;return n.map((t=>{const n=s;return s+=t,[n,n+e*t]}))}(r,void 0===t.coverage?1:t.coverage,t.weights);a=function(t,e){for(let n=0;n<e.length;n++)if(U(t,e[n]))return n;return-1}(f,e)}if(h)return{result:Yt(n,t,-1,!1,e,void 0,!0)};if(a<0)return{result:Yt(n,t,-1,!1,e)};if("force"in t)return{result:Yt(n,t,void 0===t.force?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:Yt(n,t,-1,!1,e)};if("stopped"===t.status)return{result:Yt(n,t,-1,!1,e)};const d=Yt(n,t,a,!0,e,f,l);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){const{changed:e,key:i,doc:r}=function(t,e,n,i){const r=ne(e,n),s=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[r]&&t.user.stickyBucketAssignmentDocs[r].assignments||{},o={...s,...i};return{key:r,doc:{attributeName:e,attributeValue:n,assignments:o},changed:JSON.stringify(s)!==JSON.stringify(o)}}(n,u,K(c),{[ee(t.key,t.bucketVersion)]:d.key});e&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[i]=r,n.user.saveStickyBucketAssignmentDoc(r))}const w=Lt(n,t,d);0===w.length&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:d,user:zt(n.user)});const p=w.length?1===w.length?w[0]:Promise.all(w).then((()=>{})):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:d,trackingCall:p}}function qt(t,e,n,i,r,s,o){const u={value:n,on:!!n,off:!n,source:i,ruleId:r||""};return s&&(u.experiment=s),o&&(u.experimentResult=o),"override"!==i&&function(t,e,n){if(t.user.trackedFeatureUsage){const i=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===i)return;t.user.trackedFeatureUsage[e]=i,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"}),t.user.featureUsageSubs?.size&&t.user.featureUsageSubs.forEach((t=>{try{t(e,n)}catch(t){console.error(t)}}))}if(t.global.onFeatureUsage){const i=t.global.onFeatureUsage;Pt((()=>i(e,n,zt(t.user))))}if(t.user.onFeatureUsage){const i=t.user.onFeatureUsage;Pt((()=>i(e,n)))}if(t.global.eventLogger){const i=t.global.eventLogger;Pt((()=>i(jt,{feature:e,source:n.source,value:n.value,ruleId:"defaultValue"===n.source?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},zt(t.user))))}}(t,e,u),u}function Gt(t){return{...t.attributes,...t.attributeOverrides}}function zt(t){return{attributes:Gt(t),url:t.url}}function Wt(t,e,n,i){const r=i.global.contextualBandits?.[e];if(!r)return;let s=null;if(r.contexts&&r.contexts.length)try{s=function(t,e){for(const n of t.contexts||[])if(Zt(n.condition||{},e))return{leafId:n.leafId,weights:n.weights};return null}(r,i)}catch(t){}if(s)return t.weights=s.weights,void(t.contextualBandit={leafId:s.leafId,variationWeights:s.weights,banditVersion:r.banditVersion});t.contextualBandit={leafId:-1,variationWeights:t.weights??R(t.variations.length),banditVersion:r.banditVersion}}function Zt(t,e){return Ct(Gt(e.user),t,e.global.savedGroups||{})}function Qt(t,e){return t.some((t=>{const{hashValue:n}=te(e,t.attribute);if(!n)return!0;const i=M(t.seed,n,t.hashVersion||2);return null===i||!t.ranges.some((t=>U(i,t)))}))}function Xt(t,e,n,i,r,s,o){if(!r&&void 0===s)return!0;if(!r&&0===s)return!1;const{hashValue:u}=te(t,n,i);if(!u)return!1;const c=M(e,u,o||1);return null!==c&&(r?U(c,r):void 0===s||c<=s)}function Yt(t,e,n,i,r,s,o){let u=!0;(n<0||n>=e.variations.length)&&(n=0,u=!1);const{hashAttribute:c,hashValue:a}=te(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),l=e.meta?e.meta[n]:{},h={key:l.key||""+n,featureId:r,inExperiment:u,hashUsed:i,variationId:n,value:e.variations[n],hashAttribute:c,hashValue:a,stickyBucketUsed:!!o};l.name&&(h.name=l.name),void 0!==s&&(h.bucket=s),l.passthrough&&(h.passthrough=l.passthrough);const f=e.contextualBandit;return f&&i&&u&&(h.leafId=f.leafId,h.variationWeights=f.variationWeights,void 0!==f.banditVersion&&(h.banditVersion=f.banditVersion)),h}function te(t,e,n){let i=e||"id",r="";const s=Gt(t.user);return s[i]&&(r=s[i]),!r&&n&&(s[n]&&(r=s[n]),r&&(i=n)),{hashAttribute:i,hashValue:r}}function ee(t,e){return`${t}__${e=e||0}`}function ne(t,e){return`${t}||${e}`}function ie(t,e){const n={},i=function(t,e){const n=new Set,i=e&&e.features?e.features:t.global.features||{},r=e&&e.experiments?e.experiments:t.global.experiments||[];
1return Object.keys(i).forEach((t=>{const e=i[t];if(e.rules)for(const t of e.rules)(t.variations||t.contextualVariations)&&(n.add(t.hashAttribute||"id"),t.fallbackAttribute&&n.add(t.fallbackAttribute))})),r.map((t=>{n.add(t.hashAttribute||"id"),t.fallbackAttribute&&n.add(t.fallbackAttribute)})),Array.from(n)}(t,e);return i.forEach((e=>{const{hashValue:i}=te(t,e);n[e]=K(i)})),n}function re(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}const se="undefined"!=typeof window&&"undefined"!=typeof document,oe=q();class ue{constructor(t){this.prefix=(t=t||{}).prefix||""}async getAllAssignments(t){const e={};return(await Promise.all(Object.entries(t).map((([t,e])=>this.getAssignments(t,e))))).forEach((t=>{if(t){const n=ne(t.attributeName,t.attributeValue);e[n]=t}})),e}getKey(t,e){return`${this.prefix}${t}||${e}`}}class ce extends ue{async getAssignments(t,e){return this.getAssignmentsSync(t,e)}async saveAssignments(t){this.saveAssignmentsSync(t)}getAllAssignmentsSync(t){const e={};return Object.entries(t).map((([t,e])=>this.getAssignmentsSync(t,e))).forEach((t=>{if(t){const n=ne(t.attributeName,t.attributeValue);e[n]=t}})),e}}function ae(t){return{browser:t.match(/Edg/)?"edge":t.match(/Chrome/)?"chrome":t.match(/Firefox/)?"firefox":t.match(/Safari/)?"safari":"unknown",deviceType:t.match(/Mobi/)?"mobile":"desktop"}}function le(t){return t?{url:t.href,path:t.pathname,host:t.host,query:t.search}:{}}function he(t,e,n){const i=new Date;i.setTime(i.getTime()+3456e7),document.cookie=t+"="+e+";path=/"+(n?";domain="+n:"")+";expires="+i.toUTCString()}function fe(t){const e=("; "+document.cookie).split(`; ${t}=`);return e.length>=2?e[1].split(";")[0]:""}function de(t){let e={};try{const t=sessionStorage.getItem("utm_params");t&&(e=JSON.parse(t))}catch(t){}if(t&&t.search){const n=new URLSearchParams(t.search);let i=!1;if(["source","medium","campaign","term","content"].forEach((t=>{const r=`utm_${t}`,s="utm"+t[0].toUpperCase()+t.slice(1);
1n.has(r)&&(e[s]=n.get(r)||"",i=!0)})),i)try{sessionStorage.setItem("utm_params",JSON.stringify(e))}catch(t){}}return e}function we(){if("undefined"==typeof window||!window.dataLayer||!window.dataLayer.forEach)return{};const t={};return window.dataLayer.forEach((e=>{e&&"object"==typeof e&&!("length"in e)&&("event"in e||Object.keys(e).forEach((n=>{if("string"!=typeof n||n.match(/^(gtm)/))return;const i=e[n];["string","number","boolean"].includes(typeof i)&&(t[n]=i)})))})),t}const pe=q();function ye(t){return"string"==typeof t?t:null}window.dataLayer=window.dataLayer||[];const ge=document.currentScript,me=ge?ge.dataset:{},ve=window.growthbook_config||{};let be;function ke(){window.clearTimeout(be);let t=ve.antiFlickerTimeout??(me.antiFlickerTimeout?parseInt(me.antiFlickerTimeout):null)??3500;isFinite(t)||(t=3500);try{if(!document.getElementById("gb-anti-flicker-style")){const t=document.createElement("style");t.setAttribute("id","gb-anti-flicker-style"),t.innerHTML=".gb-anti-flicker { opacity: 0 !important; pointer-events: none; }",document.head.appendChild(t)}document.documentElement.classList.add("gb-anti-flicker"),be=window.setTimeout(Se,t)}catch(t){console.error(t)}}function Se(){window.clearTimeout(be);try{document.documentElement.classList.remove("gb-anti-flicker")}catch(t){console.error(t)}}(ve.antiFlicker||me.antiFlicker)&&ke();const Ae=ve.uuidCookieDomain||me.uuidCookieDomain;let _e;"cookie"===ve.useStickyBucketService||"cookie"===me.useStickyBucketService?_e=new class extends ce{constructor({prefix:t="gbStickyBuckets__",jsCookie:e,cookieAttributes:n={expires:180}}){super(),this.prefix=t,this.jsCookie=e,this.cookieAttributes=n}getAssignmentsSync(t,e){const n=this.getKey(t,e);let i=null;if(!this.jsCookie)return i;try{const t=this.jsCookie.get(n),e=JSON.parse(t||"{}");e.attributeName&&e.attributeValue&&e.assignments&&(i=e)}catch(t){}return i}async saveAssignmentsSync(t){const e=this.getKey(t.attributeName,t.attributeValue);if(!this.jsCookie)return;const n=JSON.stringify(t),{domain:i,...r}=this.cookieAttributes;i?(this.jsCookie.remove(e,r),this.jsCookie.set(e,n,this.cookieAttributes),this.jsCookie.get(e)!==n&&this.jsCookie.set(e,n,r)):this.jsCookie.set(e,n,this.cookieAttributes)}}({prefix:ve.stickyBucketPrefix||me.stickyBucketPrefix||void 0,jsCookie:e,...Ae?{cookieAttributes:{expires:180,domain:Ae}}:{}}):"localStorage"!==ve.useStickyBucketService&&"localStorage"!==me.useStickyBucketService||(_e=new class extends ue{constructor(t){t=t||{},super(),this.prefix=t.prefix||"gbStickyBuckets__";try{this.localStorage=t.localStorage||globalThis.localStorage}catch(t){}}async getAssignments(t,e){const n=this.getKey(t,e);let i=null;if(!this.localStorage)return i;try{const t=await this.localStorage.getItem(n)||"{}",e=JSON.parse(t);e.attributeName&&e.attributeValue&&e.assignments&&(i=e)}catch(t){}return i}async saveAssignments(t){const e=this.getKey(t.attributeName,t.attributeValue);if(this.localStorage)try{await this.localStorage.setItem(e,JSON.stringify(t))}catch(t){}}}({prefix:ve.stickyBucketPrefix||me.stickyBucketPrefix||void 0}));const xe=me.uuid||ve.uuid,$e=[function(t={}){if("undefined"==typeof window)throw new Error("autoAttributesPlugin only works in the browser");const e=t.uuidCookieName||"gbuuid",n=t.uuidCookieDomain||"",i=t.uuidKey||"id";let r=t.uuid||"";function s(){n?(document.cookie=e+"=;path=/;expires=Thu, 01 Jan 1970 00:00:00 GMT",he(e,r,n),fe(e)!==r&&he(e,r)):he(e,r)}function o(t){const n=navigator.userAgent,o=r||(r=fe(e),r||(u=window.crypto,r=u&&u.randomUUID?u.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(t=>(t^(u&&u.getRandomValues?u.getRandomValues(new Uint8Array(1))[0]:Math.floor(256*Math.random()))&15>>t/4).toString(16))),r));var u;(t.uuidAutoPersist??!t.uuid)&&s();const c=location;return{...we(),[i]:o,...le(c),pageTitle:document.title,...ae(n),...de(c)}}return document.addEventListener("growthbookpersist",(()=>{s()})),e=>{if("createScopedInstance"in e)return;const n=o(t);n.url&&e.setURL(n.url),e.updateAttributes(n);let i=n.url;const r=setInterval((()=>{location.href!==i&&(i=location.href,e.setURL(i),e.updateAttributes(o(t)))}),500),s=()=>{location.href!==i&&(i=location.href,e.setURL(i)),e.updateAttributes(o(t))};document.addEventListener("growthbookrefresh",s),"onDestroy"in e&&e.onDestroy((()=>{clearInterval(r),document.removeEventListener("growthbookrefresh",s)}))}}({uuid:xe,uuidCookieName:ve.uuidCookieName||me.uuidCookieName,uuidCookieDomain:Ae,uuidKey:ve.uuidKey||me.uuidKey,uuidAutoPersist:!xe&&null==me.noAutoCookies})],Ee=me.tracking||"gtag,gtm,segment";if("none"!==Ee){const t=Ee.toLowerCase().split(",").map((t=>t.trim()));if(t.includes("growthbook")){const t=ve.eventTransport||me.eventTransport;$e.push(function({queueFlushInterval:t=100,ingestorHost:e,enable:n=!0,enableFeatureUsageEvents:i=!0,debug:r,dedupeCacheSize:s=1e3,dedupeKeyAttributes:o=[],eventFilter:u,transport:c="auto"}={}){return a=>{const l=a.getClientKey();if(!l)throw new Error("clientKey must be specified to use event logging");const h=new Set,f="createScopedInstance"in a;if("setEventLogger"in a){let d=[],w=null,p=null,y=null;const g=async t=>{const n=d;d=[],w&&clearTimeout(w),w=null;const i=y;y=null,p=null;try{n.length&&await async function({clientKey:t,ingestorHost:e,events:n,useBeacon:i}){if(!n.length)return;const r=`${e||"https://us-east-1.gb-ingest.com"}/track?client_key=${t}`,s=JSON.stringify(n);if(i&&"undefined"!=typeof navigator&&navigator.sendBeacon)try{if(navigator.sendBeacon(r,new Blob([s],{type:"text/plain"})))return}catch(t){}try{await fetch(r,{method:"POST",body:s,headers:{Accept:"application/json","Content-Type":"text/plain"},credentials:"omit",keepalive:(o=s,("undefined"!=typeof TextEncoder?(new TextEncoder).encode(o).length:3*o.length)<6e4)})}catch(t){console.error("Failed to track event",t)}var o}({clientKey:l,events:n,ingestorHost:e,useBeacon:"beacon"===c||"auto"===c&&!!t})}finally{i&&i()}};if(a.setEventLogger((async(e,c,a)=>{const l={eventName:e,properties:c,attributes:a.attributes||{},url:a.url||""};if(!i&&e===jt)return;if(u&&!u(l))return;if(e===jt||e===Jt){const t={eventName:e,properties:c},n=o.length?o:f&&e===jt?Object.keys(l.attributes):[];for(const e of n)t["attr:"+e]=l.attributes[e];const i=JSON.stringify(t);if(h.has(i))return h.delete(i),void h.add(i);if(h.add(i),h.size>s){const t=h.values().next().value;t&&h.delete(t)}}const m=function({eventName:t,properties:e,attributes:n,url:i}){const{nested:r,topLevel:s}=function(t){const{user_id:e,device_id:n,anonymous_id:i,id:r,page_id:s,session_id:o,utmCampaign:u,utmContent:c,utmMedium:a,utmSource:l,utmTerm:h,pageTitle:f,...d}=t;return{nested:d,topLevel:{user_id:ye(e),device_id:ye(n||i||r),page_id:ye(s),session_id:ye(o),utm_campaign:ye(u)||void 0,utm_c
1ontent:ye(c)||void 0,utm_medium:ye(a)||void 0,utm_source:ye(l)||void 0,utm_term:ye(h)||void 0,page_title:ye(f)||void 0}}}(n||{});return{event_name:t,properties_json:e||{},...s,sdk_language:"js",sdk_version:pe,url:i,context_json:r}}(l);r&&console.log("Logging event to GrowthBook",JSON.parse(JSON.stringify(m))),n&&(d.push(m),p||(p=new Promise((e=>{y=e,w=setTimeout((()=>{g().catch(console.error)}),t)}))),await p)})),"undefined"!=typeof document&&document.visibilityState){const t=()=>{"hidden"===document.visibilityState&&g(!0).catch(console.error)};document.addEventListener("visibilitychange",t),"onDestroy"in a&&a.onDestroy((()=>document.removeEventListener("visibilitychange",t)))}if("undefined"!=typeof window){const t=()=>{g(!0).catch(console.error)};window.addEventListener("pagehide",t),"onDestroy"in a&&a.onDestroy((()=>window.removeEventListener("pagehide",t)))}"onDestroy"in a&&a.onDestroy((()=>{g().catch(console.error)}))}if("undefined"!=typeof window&&!("createScopedInstance"in a)){const t=Array.isArray(window.gbEvents)?window.gbEvents:[];window.gbEvents={push:t=>{"isDestroyed"in a&&a.isDestroyed()?window.gbEvents=[t]:"string"==typeof t?a.logEvent(t):t&&a.logEvent(t.eventName,t.properties)}};for(const e of t)window.gbEvents.push(e)}}}({ingestorHost:me.eventIngestorHost,transport:"auto"===t||"beacon"===t||"fetch"===t?t:void 0}))}ve.trackingCallback||$e.push(function({additionalCallback:t,trackers:e=["gtag","gtm","segment"]}={}){if("undefined"==typeof window)throw new Error("thirdPartyTrackingPlugin only works in the browser");return n=>{n.setTrackingCallback((async(n,i)=>{const r=[],s={experiment_id:n.key,variation_id:i.key};if(t&&r.push(Promise.resolve(t(n,i))),e.includes("gtag")&&window.gtag){let t;const e=new Promise((e=>{t=e}));r.push(e),window.gtag("event","experiment_viewed",{...s,event_callback:t})}if(e.includes("gtm")&&window.dataLayer){let t;const e=new Promise((e=>{t=e}));r.push(e),window.dataLayer.push({event:"experiment_viewed",...s,eventCallback:t})}if(e.includes("segment")&&window.analytics&&window.analytics.track){window.analytics.track("Experiment Viewed",s);const t=new Promise((t=>window.setTimeout(t,300)));r.push(t)}await Promise.all(r)}))}}({additionalCallback:ve.additionalTrackingCallback,trackers:t}))}const Ce=new class{constructor(t){if(t=t||{},this.version=oe,this.i=this.context=t,this.o=t.renderer||null,this.u=new Set,this.l=new Set,this.h={},this.debug=!!t.debug,this.p=new Set,this.g=new Set,this.m=new Set,this.v=new Set,this.ready=!1,this.k=new Map,this.S=new Map,this.A=new Set,this._=!1,this.$="",this.C=new Map,this.O=!t.disableExperimentsOnLoad,this.T=[],this.logs=[],this.log=this.log.bind(this),this.N=this.N.bind(this),this.I=this.I.bind(this),this.D=this.D.bind(this),this.F=this.F.bind(this),t.remoteEval){if(t.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!t.clientKey)throw new Error("Missing clientKey");let e=!1;try{e=!!new URL(t.apiHost||"").hostname.match(/growthbook\.io$/i)}catch(t){}if(e)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(t.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(t.stickyBucketService){const e=t.stickyBucketService;this.B=t=>e.saveAssignments(t)}if(t.plugins)for(const e of t.plugins)e(this);if(t.features&&(this.ready=!0),se&&t.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),t.experiments&&(this.ready=!0,this.M()),this.i.stickyBucketService&&this.i.stickyBucketAssignmentDocs)for(const t in this.i.stickyBucketAssignmentDocs){const e=this.i.stickyBucketAssignmentDocs[t];e&&this.i.stickyBucketService.saveAssignments(e).catch((()=>{}))}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(t){this.R=t;const e=await async function(t,e,n){if((t={...t}).encryptedFeatures){try{t.features=JSON.parse(await L(t.encryptedFeatures,e,n))}catch(t){console.error(t)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await L(t.encryptedExperiments,e,n))}catch(t){console.error(t)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await L(t.encryptedSavedGroups,e,n))}catch(t){console.error(t)}delete t.encryptedSavedGroups}if(t.encryptedContextualBandits){try{t.contextualBandits=JSON.parse(await L(t.encryptedContextualBandits,e,n))}catch(t){console.error(t)}delete t.encryptedContextualBandits}return t}(t,this.i.decryptionKey);this.U=e,await this.refreshStickyBuckets(e),e.features&&(this.i.features=e.features),e.savedGroups&&(this.i.savedGroups=e.savedGroups),e.contextualBandits&&(this.i.contextualBandits=e.contextualBandits),e.experiments&&(this.i.experiments=e.experiments,this.M()),this.ready=!0,this.V()}initSync(t){this._=!0;const e=t.payload;if(e.encryptedExperiments||e.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this.i.stickyBucketService&&!this.i.stickyBucketAssignmentDocs&&(this.i.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this.i.stickyBucketService,e)),this.R=e,this.U=e,e.features&&(this.i.features=e.features),e.savedGroups&&(this.i.savedGroups=e.savedGroups),e.contextualBandits&&(this.i.contextualBandits=e.contextualBandits),e.experiments&&(this.i.experiments=e.experiments,this.M()),this.ready=!0,$t(this,t),this}async init(t){if(this._=!0,(t=t||{}).cacheSettings&&(Object.assign(Z,t.cacheSettings),Z.backgroundSync||xt()),t.payload)return await this.setPayload(t.payload),$t(this,t),{success:!0,source:"init"};{const{data:e,...n}=await this.j({...t,allowStale:!0});return $t(this,t),await this.setPayload(e||{}),n}}async loadFeatures(t){t=t||{},await this.init({skipCache:t.skipCache,timeout:t.timeout,streaming:(this.i.backgroundSync??!0)&&(t.autoRefresh||this.i.subscribeToChanges)})}async refreshFeatures(t){const e=await this.j({...t||{},allowStale:!1});e.data&&await this.setPayload(e.data)}
1getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return function(t){const e=t.apiHost||"https://cdn.growthbook.io";return{apiHost:e.replace(/\/*$/,""),streamingHost:(t.streamingHost||e).replace(/\/*$/,""),apiRequestHeaders:t.apiHostRequestHeaders,streamingHostRequestHeaders:t.streamingHostRequestHeaders}}(this.i)}getClientKey(){return this.i.clientKey||""}getPayload(){return this.R||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this.U||this.getPayload()}isRemoteEval(){return this.i.remoteEval||!1}getCacheKeyAttributes(){return this.i.cacheKeyAttributes}async j({timeout:t,skipCache:e,allowStale:n,streaming:i}){if(!this.i.clientKey)throw new Error("Missing clientKey");return async function({instance:t,timeout:e,skipCache:n,allowStale:i,backgroundSync:r}){return r||(Z.backgroundSync=!1),async function({instance:t,allowStale:e,timeout:n,skipCache:i}){const r=ft(t),s=dt(t),o=new Date,u=new Date(o.getTime()-Z.maxAge+Z.staleTTL);await async function(){if(!tt){tt=!0;try{if(Q.localStorage){const t=await Q.localStorage.getItem(Z.cacheKey);if(!Z.disableCache&&t){const e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach((([t,e])=>{et.set(t,{...e,staleAt:new Date(e.staleAt)})})),wt()}}}catch(t){}if(!Z.disableIdleStreams){const t=X.startIdleListener();t&&(X.stopIdleListener=t)}}}();const c=Z.disableCache||i?void 0:et.get(s);return c&&(e||c.staleAt>o)&&c.staleAt>u?(c.sse&&st.add(r),c.staleAt<o?yt(t):gt(t),{data:c.data,success:!0,source:"cache"}):await W(yt(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}({instance:t,allowStale:i,timeout:e,skipCache:n})}({instance:this,timeout:t,skipCache:e||this.i.disableCache,allowStale:n,backgroundSync:i??this.i.backgroundSync??!0})}V(){if(this.o)try{this.o()}catch(t){console.error("Failed to render",t)}}setFeatures(t){this.i.features=t,this.ready=!0,this.V()}async setEncryptedFeatures(t,e,n){const i=await L(t,e||this.i.decryptionKey,n);this.setFeatures(JSON.parse(i))}setExperiments(t){this.i.experiments=t,this.ready=!0,this.M()}async setEncryptedExperiments(t,e,n){const i=await L(t,e||this.i.decryptionKey,n);this.setExperiments(JSON.parse(i))}async setAttributes(t){this.i.attributes=t,this.i.stickyBucketService&&await this.refreshStickyBuckets(),this.i.remoteEval?await this.J():(this.V(),this.M())}async updateAttributes(t){return this.setAttributes({...this.i.attributes,...t})}async setAttributeOverrides(t){this.i.attributeOverrides=t,this.i.stickyBucketService&&await this.refreshStickyBuckets(),this.i.remoteEval?await this.J():(this.V(),this.M())}async setForcedVariations(t){this.i.forcedVariations=t||{},this.i.remoteEval?await this.J():(this.V(),this.M())}setForcedFeatures(t){this.i.forcedFeatureValues=t,this.V()}async setURL(t){if(t!==this.i.url){if(this.i.url=t,this.$="",this.i.remoteEval)return await this.J(),void this.M(!0);this.M(!0)}}getAttributes(){return{...this.i.attributes,...this.i.attributeOverrides}}getForcedVariations(){return this.i.forcedVariations||{}}getForcedFeatures(){return this.i.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this.i.stickyBucketAssignmentDocs||{}}getUrl(){return this.i.url||""}getFeatures(){return this.i.features||{}}getExperiments(){return this.i.experiments||[]}getCompletedChangeIds(){return Array.from(this.l)}subscribe(t){return this.p.add(t),()=>{this.p.delete(t)}}P(t){return this.g.add(t),()=>this.g.delete(t)}L(t){return this.v.add(t),()=>this.v.delete(t)}K(t){return this.m.add(t),()=>this.m.delete(t)}async J(){if(!this.i.remoteEval)return;if(!this._)return;const t=await this.j({allowStale:!1});t.data&&await this.setPayload(t.data)}getAllResults(){return new Map(this.k)}onDestroy(t){this.T.push(t)}isDestroyed(){return!!this.H}destroy(t){var e;t=t||{},this.H=!0,this.T.forEach((t=>{try{t()}catch(t){console.error(t)}})),this.p.clear(),this.g.clear(),this.m.clear(),this.v.clear(),this.k.clear(),this.u.clear(),this.l.clear(),this.C.clear(),this.h={},this.T=[],this.R=void 0,this.B=void 0,e=this,Y.forEach(((t,n)=>{t.delete(e);const i=t.size?void 0:rt.get(n);i&&_t(i,n)})),t.destroyAllStreams&&xt(),this.logs=[],se&&window._growthbook===this&&delete window._growthbook,this.S.forEac
vendor: 8,000 bytes, line 1
1h((t=>{t.undo()})),this.S.clear(),this.A.clear()}setRenderer(t){this.o=t}forceVariation(t,e){this.i.forcedVariations=this.i.forcedVariations||{},this.i.forcedVariations[t]=e,this.i.remoteEval?this.J():(this.M(),this.V())}run(t){const{result:e}=Ht(t,null,this.q());return this.I(t,e),e}triggerExperiment(t){return this.A.add(t),this.i.experiments?this.i.experiments.filter((e=>e.key===t)).map((t=>this.G(t))).filter((t=>null!==t)):null}triggerAutoExperiments(){this.O=!0,this.M(!0)}q(){return{user:this.W(),global:this.Z(),stack:{evaluatedFeatures:new Set}}}W(){return{attributes:this.i.user?{...this.i.user,...this.i.attributes}:this.i.attributes,enableDevMode:this.i.enableDevMode,blockedChangeIds:this.i.blockedChangeIds,stickyBucketAssignmentDocs:this.i.stickyBucketAssignmentDocs,url:this.X(),forcedVariations:this.i.forcedVariations,forcedFeatureValues:this.i.forcedFeatureValues,attributeOverrides:this.i.attributeOverrides,saveStickyBucketAssignmentDoc:this.B,trackingCallback:this.i.trackingCallback,onFeatureUsage:this.i.onFeatureUsage,devLogs:this.logs,featureUsageSubs:this.g,experimentViewedSubs:this.v,trackedExperiments:this.u,trackedFeatureUsage:this.h}}Z(){return{features:this.i.features,experiments:this.i.experiments,log:this.log,enabled:this.i.enabled,qaMode:this.i.qaMode,savedGroups:this.i.savedGroups,contextualBandits:this.i.contextualBandits,groups:this.i.groups,overrides:this.i.overrides,onExperimentEval:this.I,recordChangeId:this.F,saveDeferredTrack:this.N,eventLogger:this.i.eventLogger}}G(t,e){const n=this.S.get(t);if(t.manual&&!this.A.has(t.key)&&!n)return null;let i,r;this.Y(t)?i=Yt(this.q(),t,-1,!1,""):(({result:i,trackingCall:r}=Ht(t,null,this.q())),this.I(t,i));const s=JSON.stringify(i.value);if(!e&&i.inExperiment&&n&&n.valueHash===s)return i;if(n&&this.tt(t),i.inExperiment){const e=z(t);if("redirect"===e&&i.value.urlRedirect&&t.urlPatterns){const e=t.persistQueryString?function(t,e){let n,i;try{n=new URL(t),i=new URL(e)}catch(t){return console.error(`Unable to merge query strings: ${t}`),e}return n.searchParams.forEach(((t,e)=>{i.searchParams.has(e)||i.searchParams.set(e,t)})),i.toString()}(this.X(),i.value.urlRedirect):i.value.urlRedirect;if(j(e,t.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:t.key}),i;this.$=e;const{navigate:n,delay:s}=this.et();if(n)if(se)Promise.all([...r?[W(r,this.i.maxNavigateDelay??1e3)]:[],new Promise((t=>window.setTimeout(t,this.i.navigateDelay??s)))]).then((()=>{try{n(e)}catch(t){console.error(t)}}));else try{n(e)}catch(t){console.error(t)}}else if("visual"===e){const e=this.i.applyDomChangesCallback?this.i.applyDomChangesCallback(i.value):this.nt(i.value);e&&this.S.set(t,{undo:e,valueHash:s})}}return i}tt(t){const e=this.S.get(t);e&&(e.undo(),this.S.delete(t))}M(t){if(!this.O)return;const e=this.i.experiments||[],n=new Set(e);this.S.forEach(((t,e)=>{n.has(e)||(t.undo(),this.S.delete(e))}));for(const n of e){const e=this.G(n,t);if(e&&e.inExperiment&&"redirect"===z(n))break}}I(t,e){const n=this.k.get(t.key);this.k.set(t.key,{experiment:t,result:e}),this.p.size>0&&this.D(t,e,n)}D(t,e,n){n&&n.result.inExperiment===e.inExperiment&&n.result.variationId===e.variationId||this.p.forEach((n=>{try{n(t,e)}catch(t){console.error(t)}}))}F(t){this.l.add(t)}isOn(t){return this.evalFeature(t).on}isOff(t){return this.evalFeature(t).off}getFeatureValue(t,e){const n=this.evalFeature(t).value;return null===n?e:n}feature(t){return this.evalFeature(t)}evalFeature(t){return Kt(t,this.q())}log(t,e){this.debug&&(this.i.log?this.i.log(t,e):console.log(t,e))}getDeferredTrackingCalls(){return Array.from(this.C.values())}setDeferredTrackingCalls(t){this.C=new Map(t.filter((t=>t&&t.experiment&&t.result)).map((t=>[re(t.experiment,t.result),t])))}async fireDeferredTrackingCalls(){if(!this.i.trackingCallback)return;const t=[];this.C.forEach((e=>{e&&e.experiment&&e.result?t.push(this.i.trackingCallback(e.experiment,e.result,e.user)):console.error("Invalid deferred tracking call",{call:e})})),this.C.clear(),await Promise.all(t)}setTrackingCallback(t){this.i.trackingCallback=t,this.fireDeferredTrackingCalls()}setFeatureUsageCallback(t){this.i.onFeatureUsage=t}setEventLogger(t){this.i.eventLogger=t}async logEvent(t,e){if(this.H)console.error("Cannot log event to destroyed GrowthBook instance");else if(this.i.enableDevMode&&this.logs.push({eventName:t,properties:e,timestamp:Date.now().toString(),logType:"event"}),this.m.size&&this.m.forEach((n=>{try{n(t,e||{})}catch(t){console.error(t)}})),this.i.eventLogger)try{await this.i.eventLogger(t,e||{},zt(this.W()))}catch(t){console.error(t)}else console.error("No event logger configured")}N(t){this.C.set(re(t.experiment,t.result),t)}X(){return this.i.url||(se?window.location.href:"")}Y(t){const e=z(t);if("visual"===e){if(this.i.disableVisualExperiments)return!0;if(this.i.disableJsInjection&&t.variations.some((t=>t.js)))return!0}else{if("redirect"!==e)return!0;if(this.i.disableUrlRedirectExperiments)return!0;try{const e=new URL(this.X());for(const n of t.variations){if(!n||!n.urlRedirect)continue;const t=new URL(n.urlRedirect);if(this.i.disableCrossOriginUrlRedirectExperiments){if(t.protocol!==e.protocol)return!0;if(t.host!==e.host)return!0}}}catch(e){return this.log("Error parsing current or redirect URL",{id:t.key,error:e}),!0}}return!(!t.changeId||!(this.i.blockedChangeIds||[]).includes(t.changeId))}getRedirectUrl(){return this.$}et(){return this.i.navigate?{navigate:this.i.navigate,delay:0}:se?{navigate:t=>{window.location.replace(t)},delay:100}:{navigate:null,delay:0}}nt(t){if(!se)return;const e=[];if(t.css){const n=document.createElement("style");n.innerHTML=t.css,document.head.appendChild(n),e.push((()=>n.remove()))}if(t.js){const n=document.createElement("script");n.innerHTML=t.js,this.i.jsInjectionNonce&&(n.nonce=this.i.jsInjectionNonce),document.head.appendChild(n),e.push((()=>n.remove()))}return t.domMutations&&t.domMutations.forEach((t=>{e.push(function(t){var e=t.selector,n=t.action,r=t.value,s=t.attribute,o=t.parentSelector,u=t.insertBeforeSelector;if("html"===s){if("append"===n)return N(e,(function(t){return t+(null!=r?r:"")}));if("set"===n)return N(e,(function(){return null!=r?r:""}))}else if("class"===s){if("append"===n)return I(e,(function(t){r&&t.add(r)}));if("remove"===n)return I(e,(function(t){r&&t.delete(r)}));if("set"===n)return I(e,(function(t){t.clear(),r&&t.add(r)}))}else if("position"===s){if("set"===n&&o)return function(t,e){return T({kind:"position",elements:new Set,mutate:function(){return{insertBeforeSelector:u,parentSelector:o}},selector:t})}(e)}else{if("append"===n)return D(e,s,(function(t){return null!==t?t+(null!=r?r:""):null!=r?r:""}));if("set"===n)return D(e,s,(function(){return null!=r?r:""}));if("remove"===n)return D(e,s,(function(){return null}))}return i}(t).revert)})),()=>{e.forEach((t=>t()))}}async refreshStickyBuckets(t){if(this.i.stickyBucketService){const e=this.q(),n=await async function(t,e,n){const i=ie(t,n);return e.getAllAssignments(i)}(e,this.i.stickyBucketService,t);this.i.stickyBucketAssignmentDocs=n}}generateStickyBucketAssignmentDocsSync(t,e){if(!("getAllAssignmentsSync"in t))return void console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");const n=ie(this.q(),e);return t.getAllAssignmentsSync(n)}inDevMode(){return!!this.i.enableDevMode}}({enableDevMode:!0,...me,remoteEval:!!me.remoteEval,...ve,plugins:$e,stickyBucketService:_e});Ce.setRenderer((()=>{document.dispatchEvent(new CustomEvent("growthbookdata"))})),Ce.init({payload:ve.payload,streaming:!(ve.noStreaming||me.noStreaming||!1===ve.backgroundSync),cacheSettings:ve.cacheSettings}).then((()=>{(ve.antiFlicker||me.antiFlicker)&&(Ce.getRedirectUrl()?ke():Se())}));const Oe=t=>{try{t&&t(Ce)}catch(t){console.error("Uncaught growthbook_queue error",t)}};return window.growthbook_queue&&Array.isArray(window.growthbook_queue)&&window.growthbook_queue.forEach((t=>{Oe(t)})),window.growthbook_queue={push:t=>{Oe(t)}},Ce}()
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.