{"version":3,"file":"main.js","sources":["theme-122/virtual:init-settings","theme-122/virtual:theme","theme-122/discourse/initializers/theme-field-406-common-html-script-1.js","theme-122/virtual:entrypoint:main"],"sourcesContent":["import { registerSettings } from \"discourse/lib/theme-settings-store\";\n\nregisterSettings(122, {});\n","import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(122);\n\nexport function themePrefix(key) {\n  return `theme_translations.122.${key}`;\n}\n","import { withPluginApi } from \"discourse/lib/plugin-api\";\nimport deprecated from \"discourse/lib/deprecated\";\n\nexport default {\n  name: \"theme-field-406-common-html-script-1\",\n  after: \"inject-objects\",\n\n  initialize() {\n    deprecated(\n      \"Adding JS code using <script type='text/discourse-plugin'> is deprecated. Move this code to a dedicated JavaScript file.\",\n      {\n        id: \"discourse.script-tag-discourse-plugin\",\n        url: \"https://meta.discourse.org/t/366482\",\n      }\n    )\n    withPluginApi(\"0.8\", (api) => {\n      \n\n//Added \"All\" link in the filter navigation bar. [Added by: Saurabh; Date: 08-03-2022]\napi.addNavigationBarItem({\n  name: \"link-to-all-categories\",\n  displayName: \"All\",\n  title: \"All sections\",\n  init: (navItem, category) => {  \t\n    navItem.href = `/tag/${navItem.tagId}`;\n  },\n  customFilter: (category, args) => {\n    const tag = args.tagId;\n    const tagCheck = tag && tag !== \"none\" && tag !== \"all\";\n    return tagCheck;\n  },\n  forceActive: (category, args, router) => {\n    const categoryCheck = !category;\n    const urlCheck = router.currentURL.indexOf(`/c/knowledge-base/${args.tagId}`);\n    const filterCheck = router.currentRouteName === \"tag.show\";\n    return categoryCheck && urlCheck && filterCheck;\n  }\n});\n\napi.addNavigationBarItem({\n  name: \"link-to-knowledge-base-category\",\n  displayName: \"Knowledge base\",\n  title: \"Knowledge base\",\n  init: (navItem, category) => {  \t\n\tnavItem.href = `/tags/c/knowledge-base/6/${navItem.tagId}`;\n  },\n  customFilter: (category, args) => {\n\tconst tag = args.tagId;\n    const tagCheck = tag && tag !== \"none\" && tag !== \"all\";\n    return tagCheck;\n  },\n  forceActive: (category, args, router) => {\n    const categoryCheck = category && category.name === \"Knowledge base\";\n    const urlCheck = router.currentURL.indexOf(`/c/knowledge-base/${args.tagId}`);\n    const filterCheck = router.currentRouteName === \"tags.showCategory\";\n    return categoryCheck && urlCheck && filterCheck;\n  }\n});\n\n\napi.addNavigationBarItem({\n  name: \"link-to-forum-category\",\n  displayName: \"Forum discussions\",\n  title: \"Questions, answers and discussions\",\n  init: (navItem, category) => {\n\tnavItem.href = `/tags/c/forum/1/${navItem.tagId}`;\n  },\n  customFilter: (category, args) => {\n\tconst tag = args.tagId;\n    const tagCheck = tag && tag !== \"none\" && tag !== \"all\";\n    return tagCheck;\n  },\n  forceActive: (category, args, router) => {\n    const categoryCheck = category && category.name === \"Forum\";\n    const urlCheck = router.currentURL.indexOf(`/c/forum/${args.tagId}`);\n    const filterCheck = router.currentRouteName === \"tags.showCategory\";\n    return categoryCheck && urlCheck && filterCheck;\n  }\n});\n\napi.addNavigationBarItem({\n  name: \"link-to-news-category\",\n  displayName: \"News\",\n  title: \"News\",\n  init: (navItem, category) => {\n\tnavItem.href = `/tags/c/news/7/${navItem.tagId}`;\n  },\n  customFilter: (category, args) => {\n\tconst tag = args.tagId;\n    const tagCheck = tag && tag !== \"none\" && tag !== \"all\";\n    return tagCheck;\n  },\n  forceActive: (category, args, router) => {\n    const categoryCheck = category && category.name === \"News\";\n    const urlCheck = router.currentURL.indexOf(`/c/news/${args.tagId}`);\n    const filterCheck = router.currentRouteName === \"tags.showCategory\";\n    return categoryCheck && urlCheck && filterCheck;\n  }\n});\n\n    });\n  }\n};\n","const compatModules = {};import \"virtual:init-settings\";\nimport * as Mod1 from \"./discourse/initializers/theme-field-406-common-html-script-1\";\ncompatModules[\"discourse/initializers/theme-field-406-common-html-script-1\"] = Mod1;\n\nexport * as discourse$initializers$theme__field__406__common__html__script__1$$__module from \"./discourse/initializers/theme-field-406-common-html-script-1\";\nexport {\ndefault as discourse$initializers$theme__field__406__common__html__script__1$$default\n} from \"./discourse/initializers/theme-field-406-common-html-script-1\";\nexport default compatModules;\n"],"names":["registerSettings","getObjectForTheme","themeField406CommonHtmlScript1","name","after","initialize","deprecated","id","url","withPluginApi","api","addNavigationBarItem","displayName","title","init","navItem","category","href","tagId","customFilter","args","tag","forceActive","router","categoryCheck","urlCheck","currentURL","indexOf","filterCheck","currentRouteName","compatModules","Mod1"],"mappings":";AAEAA,EAAiB,IAAK,CAAA,GCAEC,EAAkB;ACC1C,IAAAC,EAAe,CACbC,KAAM,uCACNC,MAAO,iBAEPC,UAAAA,GACEC,EACE,2HACA,CACEC,GAAI,wCACJC,IAAK,wCAGTC,EAAc,MAAQC,IAI1BA,EAAIC,qBAAqB,CACvBR,KAAM,yBACNS,YAAa,MACbC,MAAO,eACPC,KAAMA,CAACC,EAASC,KACdD,EAAQE,KAAO,QAAQF,EAAQG,SAEjCC,aAAcA,CAACH,EAAUI,KACvB,MAAMC,EAAMD,EAAKF;AAEjB,OADiBG,GAAe,SAARA,GAA0B,QAARA,GAG5CC,YAAaA,CAACN,EAAUI,EAAMG,KAC5B,MAAMC,GAAiBR,EACjBS,EAAWF,EAAOG,WAAWC,QAAQ,qBAAqBP,EAAKF,SAC/DU,EAA0C,aAA5BL,EAAOM;AAC3B,OAAOL,GAAiBC,GAAYG,KAIxClB,EAAIC,qBAAqB,CACvBR,KAAM,kCACNS,YAAa,iBACbC,MAAO,iBACPC,KAAMA,CAACC,EAASC,KACjBD,EAAQE,KAAO,4BAA4BF,EAAQG,SAElDC,aAAcA,CAACH,EAAUI,KAC1B,MAAMC,EAAMD,EAAKF;AAEd,OADiBG,GAAe,SAARA,GAA0B,QAARA,GAG5CC,YAAaA,CAACN,EAAUI,EAAMG,KAC5B,MAAMC,EAAgBR,GAA8B,mBAAlBA,EAASb,KACrCsB,EAAWF,EAAOG,WAAWC,QAAQ,qBAAqBP,EAAKF,SAC/DU,EAA0C,sBAA5BL,EAAOM;AAC3B,OAAOL,GAAiBC,GA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