{"version":3,"file":"main.D3sbuN.js","sources":["theme-190/virtual:theme","theme-190/discourse/connectors/topic-list-before-activity/activity-icon.gjs","theme-190/discourse/connectors/topic-list-before-reply-count/comment-icon-new.gjs","theme-190/discourse/connectors/topic-list-before-status/vote-count-new.gjs","theme-190/discourse/connectors/topic-list-before-views/views-icon.gjs","theme-190/discourse/connectors/topic-list-header-before-activity/activity-icon.gjs","theme-190/discourse/connectors/topic-list-header-before-views/views-icon.gjs","theme-190/discourse/initializers/init-alt-vote-cat-style.js","theme-190/virtual:entrypoint:main"],"sourcesContent":["import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(190);\n\nexport function themePrefix(key) {\n  return `theme_translations.190.${key}`;\n}\n","import Component from \"@glimmer/component\";\nimport { service } from \"@ember/service\";\nimport icon from \"discourse/helpers/d-icon\";\n\nexport default class ActivityIcon extends Component {\n  @service discovery;\n  @service site;\n\n  get showActivityIcon() {\n    const id = this.discovery.category?.id;\n\n    if (this.site.desktopView && id && settings.add_column_icons) {\n      const votingCategories = settings.voting_categories\n        .split(\"|\")\n        .map(Number);\n      return votingCategories.some((category) => category === id);\n    }\n  }\n\n  <template>\n    {{#if this.showActivityIcon}}\n      {{icon \"clock\"}}\n    {{/if}}\n  </template>\n} ","import Component from \"@glimmer/component\";\nimport { service } from \"@ember/service\";\nimport icon from \"discourse/helpers/d-icon\";\n\nexport default class CommentIcon extends Component {\n  @service discovery;\n  @service site;\n\n  get showCommentIcon() {\n    const id = this.discovery.category?.id;\n\n    if (this.site.desktopView && id && settings.add_column_icons) {\n      const votingCategories = settings.voting_categories\n        .split(\"|\")\n        .map(Number);\n      return votingCategories.some((category) => category === id);\n    }\n  }\n\n  <template>\n    {{#if this.showCommentIcon}}\n      {{icon \"far-comment\"}}\n    {{/if}}\n  </template>\n}\n","import Component from \"@glimmer/component\";\nimport { on } from \"@ember/modifier\";\nimport { action } from \"@ember/object\";\nimport { service } from \"@ember/service\";\nimport bodyClass from \"discourse/helpers/body-class\";\nimport concatClass from \"discourse/helpers/concat-class\";\nimport icon from \"discourse/helpers/d-icon\";\nimport { ajax } from \"discourse/lib/ajax\";\nimport { popupAjaxError } from \"discourse/lib/ajax-error\";\nimport { i18n } from \"discourse-i18n\";\n\nexport default class VoteCount extends Component {\n  @service currentUser;\n  @service discovery;\n  @service site;\n  @service router;\n\n  get topic() {\n    return this.args.outletArgs.topic;\n  }\n\n  get showVoteCount() {\n    const votingCategories = settings.voting_categories.split(\"|\").map(Number);\n    const id = this.discovery.category?.id;\n\n    return (\n      this.site.desktopView &&\n      this.topic.get(\"can_vote\") &&\n      id &&\n      votingCategories.some((category) => category === id)\n    );\n  }\n\n  get votingDisabled() {\n    // Don't disable if user is not logged in and redirect setting is enabled\n    if (!this.currentUser && settings.redirect_to_login_on_vote) {\n      return false;\n    }\n    \n    return (\n      (this.currentUser?.get(\"votes_left\") <= 0 &&\n        !this.topic.get(\"user_voted\")) ||\n      this.topic.get(\"closed\") ||\n      this.topic.get(\"unread\") === undefined\n    );\n  }\n\n  get votedStatus() {\n    if (!settings.vote_from_topic_list) {\n      return;\n    }\n\n    // No tooltip for non-logged-in users\n    if (!this.currentUser) {\n      return;\n    }\n\n    if (this.topic.get(\"closed\")) {\n      return i18n(themePrefix(\"closed\"));\n    } else if (\n      this.currentUser?.get(\"votes_left\") <= 0 &&\n      !this.topic.get(\"user_voted\")\n    ) {\n      return i18n(themePrefix(\"out_of_votes\"));\n    } else {\n      return this.topic.get(\"user_voted\")\n        ? i18n(themePrefix(\"user_vote\"))\n        : i18n(themePrefix(\"user_no_vote\"));\n    }\n  }\n\n  @action\n  async vote() {\n    // Redirect to login if user is not logged in and setting is enabled\n    if (!this.currentUser && settings.redirect_to_login_on_vote) {\n      this.router.transitionTo(\"login\");\n      return;\n    }\n\n    if (\n      !settings.vote_from_topic_list ||\n      (this.currentUser.get(\"votes_left\") <= 0 && !this.topic.user_voted) ||\n      this.topic.closed ||\n      this.topic.unread === undefined\n    ) {\n      return;\n    }\n\n    let voteType;\n\n    if (this.topic.user_voted) {\n      this.topic.set(\"vote_count\", this.topic.vote_count - 1);\n      voteType = \"unvote\";\n\n      this.currentUser.set(\"votes_left\", this.currentUser.votes_left + 1);\n      this.topic.set(\"user_voted\", false);\n    } else {\n      this.topic.set(\"vote_count\", this.topic.vote_count + 1);\n      voteType = \"vote\";\n\n      this.currentUser.set(\"votes_left\", this.currentUser.votes_left - 1);\n      this.topic.set(\"user_voted\", true);\n    }\n\n    try {\n      const result = await ajax(`/voting/${voteType}`, {\n        type: \"POST\",\n        data: { topic_id: this.topic.id },\n      });\n\n      this.currentUser.setProperties({\n        votes_exceeded: !result.can_vote,\n        votes_left: result.votes_left,\n      });\n    } catch (e) {\n      popupAjaxError(e);\n    }\n  }\n\n  <template>\n    {{#if this.showVoteCount}}\n      {{bodyClass \"voting-category\"}}\n\n      <div class=\"vote-count-before-title\">\n        <button\n          {{on \"click\" this.vote}}\n          type=\"button\"\n          title={{this.votedStatus}}\n          class={{concatClass\n            \"topic-list-vote-button btn-flat\"\n            (unless this.topic.user_voted \"can-vote\")\n            (if this.votingDisabled \"disabled\")\n          }}\n        >{{icon \"caret-up\"}}</button>\n        <span class=\"vote-count-value\">{{this.topic.vote_count}}</span>\n      </div>\n    {{/if}}\n  </template>\n}\n","import Component from \"@glimmer/component\";\nimport { service } from \"@ember/service\";\nimport icon from \"discourse/helpers/d-icon\";\n\nexport default class ViewsIcon extends Component {\n  @service discovery;\n  @service site;\n\n  get showViewsIcon() {\n    const id = this.discovery.category?.id;\n\n    if (this.site.desktopView && id && settings.add_column_icons) {\n      const votingCategories = settings.voting_categories\n        .split(\"|\")\n        .map(Number);\n      return votingCategories.some((category) => category === id);\n    }\n  }\n\n  <template>\n    {{#if this.showViewsIcon}}\n      {{icon \"far-eye\"}}\n    {{/if}}\n  </template>\n} ","import Component from \"@glimmer/component\";\nimport { service } from \"@ember/service\";\nimport icon from \"discourse/helpers/d-icon\";\n\nexport default class ActivityIcon extends Component {\n  @service discovery;\n  @service site;\n\n  get showActivityIcon() {\n    const id = this.discovery.category?.id;\n\n    if (this.site.desktopView && id && settings.add_column_icons) {\n      const votingCategories = settings.voting_categories\n        .split(\"|\")\n        .map(Number);\n      return votingCategories.some((category) => category === id);\n    }\n  }\n\n  <template>\n    {{#if this.showActivityIcon}}\n      {{icon \"clock\"}}\n    {{/if}}\n  </template>\n} ","import Component from \"@glimmer/component\";\nimport { service } from \"@ember/service\";\nimport icon from \"discourse/helpers/d-icon\";\n\nexport default class ViewsIcon extends Component {\n  @service discovery;\n  @service site;\n\n  get showViewsIcon() {\n    const id = this.discovery.category?.id;\n\n    if (this.site.desktopView && id && settings.add_column_icons) {\n      const votingCategories = settings.voting_categories\n        .split(\"|\")\n        .map(Number);\n      return votingCategories.some((category) => category === id);\n    }\n  }\n\n  <template>\n    {{#if this.showViewsIcon}}\n      {{icon \"far-eye\"}}\n    {{/if}}\n  </template>\n} ","import { apiInitializer } from \"discourse/lib/api\";\nimport NavItem from \"discourse/models/nav-item\";\n\nconst votingCategories = settings.voting_categories.split(\"|\").map(Number);\n\nexport default apiInitializer(\"1.1\", (api) => {\n  const discovery = api.container.lookup(\"service:discovery\");\n  const router = api.container.lookup(\"service:router\");\n\n  function isVotingCategory() {\n    const currentCategoryId = discovery.category?.id;\n    return (\n      currentCategoryId && votingCategories.some((c) => c === currentCategoryId)\n    );\n  }\n\n  function isVotingCategoryById(categoryId) {\n    return categoryId && votingCategories.some((c) => c === categoryId);\n  }\n\n  const hiddenNavItems = [\"top\", \"latest\", \"hot\", \"new\"];\n\n  // Hide default Top, Latest, Hot, and New nav items for voting categories\n  api.registerValueTransformer(\"navigation-bar-items\", ({ value, context }) => {\n    if (context.category && isVotingCategoryById(context.category.id)) {\n      return value.filter(item => !hiddenNavItems.includes(item.name));\n    }\n    return value;\n  });\n\n  // Also try modifying nav items directly\n  api.modifyClass(\"component:navigation-bar\", {\n    pluginId: \"alt-vote-cat-style\",\n    \n    get navItems() {\n      let items = this._super(...arguments);\n      if (this.category && isVotingCategoryById(this.category.id)) {\n        items = items.filter(item => !hiddenNavItems.includes(item.name));\n      }\n      return items;\n    }\n  });\n\n  // Apply body class and redirect when in voting category\n  api.onPageChange((url) => {\n    // Always apply/remove body class based on category\n    if (isVotingCategory()) {\n      document.body.classList.add(\"voting-category\");\n    } else {\n      document.body.classList.remove(\"voting-category\");\n    }\n    \n    if (!isVotingCategory()) return;\n    \n    const currentUrl = new URL(url, window.location.origin);\n    const hasQueryParams = currentUrl.search && currentUrl.search.length > 1;\n    const isTopRoute = url.includes(\"/l/top\");\n    \n    // If we're on a voting category with no query params and not on /top, redirect to open view\n    if (!hasQueryParams && !url.includes(\"?\") && !isTopRoute) {\n      const category = discovery.category;\n      if (category) {\n        const openUrl = `/c/${category.slug}/${category.id}/l/latest?solved=no&order=votes`;\n        router.transitionTo(openUrl);\n      }\n    }\n  });\n\n  // 1. Open - Unsolved feature requests sorted by votes (DEFAULT)\n  api.addNavigationBarItem({\n    name: \"open\",\n    displayName: \"Open\",\n    customFilter: (category) => {\n      return category && votingCategories.includes(category.id);\n    },\n    customHref: (category, args) => {\n      const path = NavItem.pathFor(\"latest\", args);\n      return `${path}?solved=no&order=votes`;\n    },\n    forceActive: (category, args, router) => {\n      const queryParams = router.currentRoute.queryParams;\n      const currentRouteName = router.currentRouteName || \"\";\n      const isTopRoute = currentRouteName.includes(\"top\");\n      \n      // Don't show as active if we're on the top/trending route\n      if (isTopRoute) return false;\n      \n      // Default when no params, or explicit open+votes params\n      return (\n        !queryParams ||\n        Object.keys(queryParams).length === 0 ||\n        (queryParams[\"solved\"] === \"no\" && queryParams[\"order\"] === \"votes\")\n      );\n    },\n  });\n\n  // 2. Solved\n  api.addNavigationBarItem({\n    name: \"solved\",\n    displayName: \"Solved\",\n    after: \"open\",\n    customFilter: (category) => {\n      return category && votingCategories.includes(category.id);\n    },\n    customHref: (category, args) => {\n      const path = NavItem.pathFor(\"latest\", args);\n      return `${path}?solved=yes`;\n    },\n    forceActive: (category, args, router) => {\n      const queryParams = router.currentRoute.queryParams;\n      return queryParams && queryParams[\"solved\"] === \"yes\";\n    },\n  });\n\n  // 3. Trending - with time period selector\n  api.addNavigationBarItem({\n    name: \"trending_custom\",\n    displayName: \"Trending\",\n    after: \"solved\",\n    customFilter: (category) => {\n      return category && votingCategories.includes(category.id);\n    },\n    customHref: (category, args) => {\n      return NavItem.pathFor(\"top\", args);\n    },\n    forceActive: (category, args, router) => {\n      const currentRouteName = router.currentRouteName;\n      return currentRouteName && currentRouteName.includes(\"top\");\n    },\n  });\n\n  // 4. Your Votes\n  api.addNavigationBarItem({\n    name: \"your_votes\",\n    displayName: \"Your Votes\",\n    after: \"trending_custom\",\n    customFilter: (category) => {\n      return category && votingCategories.includes(category.id) && api.getCurrentUser();\n    },\n    customHref: (category, args) => {\n      const path = NavItem.pathFor(\"latest\", args);\n      return `${path}?state=my_votes`;\n    },\n    forceActive: (category, args, router) => {\n      const queryParams = router.currentRoute.queryParams;\n      return queryParams && queryParams[\"state\"] === \"my_votes\";\n    },\n  });\n\n  // 5. New - sorted by creation date (newest first)\n  api.addNavigationBarItem({\n    name: \"new_custom\",\n    displayName: \"New\",\n    after: \"your_votes\",\n    customFilter: (category) => {\n      return category && votingCategories.includes(category.id);\n    },\n    customHref: (category, args) => {\n      const path = NavItem.pathFor(\"latest\", args);\n      return `${path}?order=created`;\n    },\n    forceActive: (category, args, router) => {\n      const queryParams = router.currentRoute.queryParams;\n      return queryParams && queryParams[\"order\"] === \"created\";\n    },\n  });\n\n  api.registerValueTransformer(\"topic-list-columns\", ({ value: columns }) => {\n    if (isVotingCategory()) {\n      if (!settings.show_activity_column) {\n        columns.delete(\"activity\");\n      }\n      if (!settings.show_views_column) {\n        columns.delete(\"views\");\n      }\n      // Always delete posters since it's replaced by replies\n      columns.delete(\"posters\");\n    }\n  });\n\n  api.registerValueTransformer(\n    \"topic-list-item-class\",\n    ({ value, context }) => {\n      if (!context.topic.get(\"can_vote\")) {\n        value.push(\"non-voting\");\n      }\n      return value;\n    }\n  );\n\n  api.registerValueTransformer(\"topic-list-item-expand-pinned\", ({ value }) => {\n    return (\n      ((settings.include_excerpts || settings.vote_from_topic_list) &&\n        isVotingCategory()) ||\n      value\n    );\n  });\n});\n","import * as Mod1 from \"./discourse/connectors/topic-list-before-activity/activity-icon.gjs\";\nimport * as Mod2 from \"./discourse/connectors/topic-list-before-reply-count/comment-icon-new.gjs\";\nimport * as Mod3 from \"./discourse/connectors/topic-list-before-status/vote-count-new.gjs\";\nimport * as Mod4 from \"./discourse/connectors/topic-list-before-views/views-icon.gjs\";\nimport * as Mod5 from \"./discourse/connectors/topic-list-header-before-activity/activity-icon.gjs\";\nimport * as Mod6 from \"./discourse/connectors/topic-list-header-before-views/views-icon.gjs\";\nimport * as Mod7 from \"./discourse/initializers/init-alt-vote-cat-style\";\nconst compatModules = {\n  \"discourse/connectors/topic-list-before-activity/activity-icon\": Mod1,\n  \"discourse/connectors/topic-list-before-reply-count/comment-icon-new\": Mod2,\n  \"discourse/connectors/topic-list-before-status/vote-count-new\": Mod3,\n  \"discourse/connectors/topic-list-before-views/views-icon\": Mod4,\n  \"discourse/connectors/topic-list-header-before-activity/activity-icon\": Mod5,\n  \"discourse/connectors/topic-list-header-before-views/views-icon\": Mod6,\n  \"discourse/initializers/init-alt-vote-cat-style\": Mod7,\n};\nexport { compatModules };\nexport default compatModules;\n"],"names":["settings","getObjectForTheme","themePrefix","key","Component","dt7948","g","this","prototype","service","discovery","i","site","showActivityIcon","id","category","desktopView","add_column_icons","voting_categories","split","map","Number","some","setComponentTemplate","createTemplateFactory","block","moduleName","scope","icon","isStrictMode","CommentIcon","showCommentIcon","VoteCount","currentUser","router","topic","args","outletArgs","showVoteCount","votingCategories","get","votingDisabled","redirect_to_login_on_vote","undefined","votedStatus","vote_from_topic_list","i18n","vote","transitionTo","user_voted","closed","unread","voteType","set","vote_count","votes_left","result","ajax","type","data","topic_id","setProperties","votes_exceeded","can_vote","e","popupAjaxError","n","action","bodyClass","concatClass","on","showViewsIcon","ActivityIcon","ViewsIcon","initAltVoteCatStyle","apiInitializer","api","container","lookup","isVotingCategory","currentCategoryId","c","isVotingCategoryById","categoryId","hiddenNavItems","registerValueTransformer","value","context","filter","item","includes","name","modifyClass","pluginId","navItems","items","_super","arguments","onPageChange","url","document","body","classList","add","remove","currentUrl","URL","window","location","origin","hasQueryParams","search","length","isTopRoute","openUrl","slug","addNavigationBarItem","displayName","customFilter","customHref","NavItem","pathFor","forceActive","queryParams","currentRoute","currentRouteName","Object","keys","after","getCurrentUser","columns","show_activity_column","delete","show_views_column","push","include_excerpts","compatModules","Mod1","Mod2","Mod3","Mod4","Mod5","Mod6"],"mappings":"igCAEaA,EAAWC,EAAkB;AAEnC,SAASC,EAAYC,GAC1B,MAAO,0BAA0BA,GACnC,OCFe,cAA2BC,SAAAC,OAAAC,EAAAC,KAAAC,uBACvCC,GAAA,CAAAC,QAAAL,OAAAM,EAAAJ,KAAA;OAAAF,OAAAC,EAAAC,KAAAC,kBACAC,GAAA,CAAAG,QAAAP,OAAAM,EAAAJ,KAAA;AAED,oBAAIM,GACF,MAAMC,EAAKP,KAAKG,UAAUK,UAAUD;AAEpC,GAAIP,KAAKK,KAAKI,aAAeF,GAAMd,EAASiB,iBAAkB,CAI5D,OAHyBjB,EAASkB,kBAC/BC,MAAM,KACNC,IAAIC,QACiBC,KAAMP,GAAaA,IAAaD,EAC1D,CACF,QAEAS,EAAAC,EAAA,CAAAV,GAAA,KAAAW,MAAA,+GAAAC,WAAA,4BAAAC,MAAAA,KAAAA,CAAAC,SAAAC,cAAA,IAIAtB,KAAU;;ACnBG,MAAMuB,UAAoB1B,SAAAC,OAAAC,EAAAC,KAAAC,uBACtCC,GAAA,CAAAC,QAAAL,OAAAM,EAAAJ,KAAA;OAAAF,OAAAC,EAAAC,KAAAC,kBACAC,GAAA,CAAAG,QAAAP,OAAAM,EAAAJ,KAAA;AAED,mBAAIwB,GACF,MAAMjB,EAAKP,KA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