"use strict";(self.webpackChunk_anaconda_core=self.webpackChunk_anaconda_core||[]).push([[225,994],{225:(e,n,t)=>{t.r(n),t.d(n,{CorePlugin:()=>g});var a=t(369),i=t(597);async function o(e){let n;try{n=await async function(){return await a.backend.backendFetch("aext_core_server/feature_flag/init",{},{}).then((e=>a.backend.handleProxyResponse(e)))}()}catch(e){n={kind:"user",key:`user:${r()}`}}console.log("initializing launch darkly",n);const t=i.j2(e.featureFlag.clientId,n);return await t.waitUntilReady(),t}function r(){let e="unknown-user-id";const n=window.location.pathname.match(/\/user\/([^/]*)\//i);return n&&n.length>0&&(e=n[1]),e}var c=t(360);async function l(e){try{if(e.environment!==a.Environment.local)return console.log("initializing heap"),c.Z.initialize(e.heap.clientId),function(e){const n=window.heap;if(!n)return!1;console.log("initializing heap user and event properties");let t=e.getContext().key;"user:unknown-user-id"!==t&&n.identify(t.replace("user:",""));const a={"ff-initialized":"true"};for(const[n,t]of Object.entries(e.allFlags()))a[`ff-${n}`]=t;n.addUserProperties({ffUserID:t}),n.clearEventProperties(),n.addEventProperties({ldInitialized:"true",...a})}(await o(e)),!0}catch(e){console.log("failed to initialize heap")}return!1}var s=t(929);function d(e,n){try{if(e.environment===a.Environment.production&&n)return console.log("Initializing Datadog"),s.fy.init({clientToken:e.datadog.clientToken,service:e.datadog.service,forwardErrorsToLogs:!0,silentMultipleInit:!0}),!0}catch(e){console.log("failed to initialize datadog")}return!1}class g{#e;constructor(){this.#e=this._getReady()}activate(e,n){}ready(){return this.#e}async getConfig(){return await a.backend.backendFetch("aext_core_server/config")}async _getReady(){const e=await this.getConfig();if(e.environment==a.Environment.local)return console.log("[Config] local config"),{featureFlag:(n=e.featureFlag.overrides,{getBool(e,t){const a=n[e];return"boolean"==typeof a?a:t},getString(e,t){const a=n[e];return"string"==typeof a?a:t}}),analytics:{heap:!1,datadog:!1},config:e};var n;console.log("[Config] cloud config");const t=function(e,n){return{getBool(t,a){const i=n[t];return"boolean"==typeof i?i:e.variation(t,a)},getString(t,a){const i=n[t];return"string"==typeof i?i:e.variation(t,a)}}}(await o(e),e.featureFlag.overrides),i={heap:await l(e),datadog:d(e,t.getBool("monorepo-datadog",!1))};return{featureFlag:t,analytics:i,config:e}}}}}]);