{"version":3,"file":"main.BywP3b.js","sources":["theme-29/virtual:theme","theme-29/discourse/api-initializers/init-theme.js","theme-29/discourse/api-initializers/modifications_for_google_analytics.js","theme-29/virtual:entrypoint:main"],"sourcesContent":["import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(29);\n\nexport function themePrefix(key) {\n  return `theme_translations.29.${key}`;\n}\n","import { apiInitializer } from \"discourse/lib/api\";\n\nexport default apiInitializer((api) => {\n    api.onPageChange((url, title) => {\n        // send current user info to CORE\n        let current_user = {\n          id: api.getCurrentUser() ? api.getCurrentUser().id : null,\n          external_id: api.getCurrentUser() ? api.getCurrentUser().external_id : null\n        };\n        window.CURRENT_USER = JSON.stringify(current_user);\n\n        if (window.COMSCORE) {\n          window.COMSCORE.beacon({ c1: \"2\", c2: \"6036202\" });\n        }\n\n        // send vendorpage and topic info to CORE\n        const container = Discourse.__container__;\n        const current_route = Discourse._router.currentRoute;\n        const topic_controller = container.lookup('controller:topic');\n        let additional_info = {};\n        if (topic_controller.get(\"model.id\") != undefined) {\n          additional_info['topic_id'] = topic_controller.get(\"model.id\");\n        }\n        if (current_route?.name == 'discovery.category' && current_route?.attributes?.category?.parentCategory?.name == 'Vendors') {\n          additional_info['vendorpage_id'] = current_route.attributes.category.id;\n        }\n        window.ADDITIONAL_INFO = additional_info;\n        \n        setSWZDTaxonomyInfo(current_route);\n\n        // work around discourse invoking onPageChange on first pageview:\n        // wait for discourse to be fully inited before loading core, and then\n        // invoke spaPageViewSignal() only from the 2nd invocation of onPageChange\n        if (window.zd && window.zd.core && window.zd.core.utilities) {\n            window.zd.core.pageData.pageViewId = window.zd.core.utilities.generateUUID();\n            window.zd.core.pageData.cmsPageId = window.zd.core.utilities.getCMSPageId();\n            window.zd.core.pageData.local_uid = window.zd.core.utilities.getLocalUId();\n            window.zd.core.config.isFreshUser = window.zd.core.utilities.isFreshUser();\n            window.zd.core.pageData.url = window.window.location.href;\n            window.zd.core.utilities.spaPageViewSignal();\n        } else {\n            var sc = window.document.createElement('script');\n            sc.src=\"https://cdn.static.zdbb.net/js/z0WVjCBSEeGLoxIxOQVEwQ.min.js\";\n            sc.type=\"text/javascript\";\n            sc.async = 1;\n            document.head.appendChild(sc);\n        }\n    });\n\n    // set SWZD Taxonomy Info\n    function setSWZDTaxonomyInfo(current_route){\n      let swzdTaxonomyInfo = {\n        primary_category: null,\n        secondary_category: null,\n        tags: null\n      };\n\n      let isUnderTopicRoute = current_route?.parent?.name === 'topic';\n      const categoryInfo = current_route?.paramNames?.includes('category_slug_path_with_id') ? current_route?.attributes?.category : (isUnderTopicRoute ? current_route?.parent?.attributes?.category : null);\n      \n      if (categoryInfo){\n        swzdTaxonomyInfo.primary_category = categoryInfo?.parentCategory?.name || categoryInfo?.name;\n        swzdTaxonomyInfo.secondary_category = categoryInfo?.parentCategory ? categoryInfo?.name : null;\n        swzdTaxonomyInfo.tags = isUnderTopicRoute ? current_route?.parent?.attributes?.tags : null;\n      }\n      window.SWZDTaxonomyInfo = swzdTaxonomyInfo;\n    };\n});","import { apiInitializer } from \"discourse/lib/api\";\n\nexport default apiInitializer(\"0.11.1\", api => {\n  const currentUser = api.container.lookup(\"service:current-user\");\n  const userIdObject = window.dataLayer?.find(item => item.userId);\n  if (userIdObject) {\n    userIdObject[\"user_id\"] = currentUser?.external_id;\n    userIdObject[\"discourse_user_id\"] = currentUser?.id;\n  }\n});\n","import * as Mod1 from \"./discourse/api-initializers/init-theme\";\nimport * as Mod2 from \"./discourse/api-initializers/modifications_for_google_analytics\";\nconst compatModules = {\n  \"discourse/api-initializers/init-theme\": Mod1,\n  \"discourse/api-initializers/modifications_for_google_analytics\": Mod2,\n};\nexport { compatModules };\nexport default compatModules;\n"],"names":["getObjectForTheme","initTheme","apiInitializer","api","onPageChange","url","title","current_user","id","getCurrentUser","external_id","window","CURRENT_USER","JSON","stringify","COMSCORE","beacon","c1","c2","container","Discourse","__container__","current_route","_router","currentRoute","topic_controller","lookup","additional_info","undefined","get","name","attributes","category","parentCategory","ADDITIONAL_INFO","swzdTaxonomyInfo","primary_category","secondary_category","tags","isUnderTopicRoute","parent","categoryInfo","paramNames","includes","SWZDTaxonomyInfo","setSWZDTaxonomyInfo","zd","core","utilities","pageData","pageViewId","generateUUID","cmsPageId","getCMSPageId","local_uid","getLocalUId","config","isFreshUser","location","href","spaPageViewSignal","sc","document","createElement","src","type","async","head","appendChild","modifications_for_google_analytics","currentUser","userIdObject","dataLayer","find","item","userId","compatModules","Mod1"],"mappings":";AAEwBA,EAAkB;;;oCCA1C,IAAAC,EAAeC,EAAgBC,IAC3BA,EAAIC,aAAa,CAACC,EAAKC,KAEnB,IAAIC,EAAe,CACjBC,GAAIL,EAAIM,iBAAmBN,EAAIM,iBAAiBD,GAAK,KACrDE,YAAaP,EAAIM,iBAAmBN,EAAIM,iBAAiBC,YAAc;AAEzEC,OAAOC,aAAeC,KAAKC,UAAUP,GAEjCI,OAAOI,UACTJ,OAAOI,SAASC,OAAO,CAAEC,GAAI,IAAKC,GAAI;AAIxC,MAAMC,EAAYC,UAAUC,cACtBC,EAAgBF,UAAUG,QAAQC,aAClCC,EAAmBN,EAAUO,OAAO;AAC1C,IAAIC,EAAkB,CAAA;AActB,GAbwCC,MAApCH,EAAiBI,IAAI,cACvBF,EAA0B,SAAIF,EAAiBI,IAAI,aAE1B,sBAAvBP,GAAeQ,MAA6F,WAA7DR,GAAeS,YAAYC,UAAUC,gBAAgBH,OACtGH,EAA+B,cAAIL,EAAcS,WAAWC,SAASxB,IAEvEG,OAAOuB,gBAAkBP,EAwB7B,SAA6BL,GAC3B,IAAIa,EAAmB,CACrBC,iBAAkB,KAClBC,mBAAoB,KACpBC,KAAM,MAGJC,EAAoD,UAAhCjB,GAAekB,QAAQV;AAC/C,MAAMW,EAAenB,GAAeoB,YAAYC,SAAS,8BAAgCrB,GAAeS,YAAYC,SAAYO,EAAoBjB,GAAekB,QAAQT,YAAYC,SAAW;AAE9LS,IACFN,EAAiBC,iBAAmBK,GA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