import { n as normalizeComponent, S as Empty, U as Spin, d as api, h as Icon, R as to } from "./index.js";
import { M as MaterialList } from "./index7.js";
import { S as Skeleton } from "./index4.js";
import "vue";
import "./gd-abtest.js";
var render$3 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_vm.loading ? _c("SkeletonTpl", {
    attrs: {
      "rows": _vm.rows,
      "cols": _vm.skeletonColumns
    }
  }) : _vm.list.length === 0 ? _c("Empty") : _vm.errMsg ? _c("div", {
    class: _vm.bem("err")
  }, [_vm._v(" " + _vm._s(_vm.errMsg) + " ")]) : !_vm.loading ? _c("MaterialList", {
    attrs: {
      "columns": _vm.getColumns(_vm.columns),
      "rows": _vm.rows,
      "materials": _vm.list,
      "columnsOffset": _vm.columnsOffset,
      "responsiveWidth": 1440,
      "trackerData": _vm.trackerData,
      "tracker": _vm.tracker
    }
  }) : _vm._e()], 1);
};
var staticRenderFns$3 = [];
var index_vue_vue_type_style_index_0_lang$1 = /* @__PURE__ */ (() => 'body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}@keyframes run{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.load-templates__loading{display:flex;align-items:center;justify-content:center;font-size:14px;color:#999}.load-templates__load-icon{margin-top:-3px;margin-right:4px;vertical-align:middle;animation:run 1s linear infinite}.load-templates__err{text-align:center}\n')();
const SkeletonTpl = Skeleton.Tpl;
const __vue2_script$3 = {
  name: "load-templates",
  components: {
    MaterialList,
    SkeletonTpl,
    Empty
  },
  props: {
    columns: {
      type: Number,
      default: 5
    },
    rows: {
      type: Number,
      default: null
    },
    minHeight: {
      type: Number,
      default: 100
    },
    list: {
      type: Array,
      required: true
    },
    loading: {
      type: Boolean,
      default: false
    },
    errMsg: {
      type: String,
      default: ""
    },
    trackerMetadata: {
      type: Object,
      default: () => {
      }
    },
    trackerData: {
      type: Object,
      default: () => ({})
    },
    tracker: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      skeletonColumns: 5,
      columnsOffset: 1
    };
  },
  computed: {
    innerRow() {
      const listLength = this.list.length;
      return Math.round(listLength / this.columns);
    }
  },
  mounted() {
    this.skeletonColumns = document.body.clientWidth > 1640 ? this.getColumns(this.columns) + 1 : this.getColumns(this.columns);
  },
  methods: {
    getColumns(columns) {
      return columns > 5 ? 5 : columns;
    }
  }
};
const __cssModules$3 = {};
var __component__$3 = /* @__PURE__ */ normalizeComponent(__vue2_script$3, render$3, staticRenderFns$3, false, __vue2_injectStyles$3, null, null, null);
function __vue2_injectStyles$3(context) {
  for (let o in __cssModules$3) {
    this[o] = __cssModules$3[o];
  }
}
var LoadTemplates = /* @__PURE__ */ function() {
  return __component__$3.exports;
}();
var render$2 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_c("h2", [_vm._v(_vm._s(_vm.topic.title))]), _c("div", {
    staticClass: "num",
    domProps: {
      "innerHTML": _vm._s(_vm.topic.describe || "")
    }
  }), _c("Spin", {
    attrs: {
      "spinning": _vm.loading
    }
  }, _vm._l(_vm.topicModules, function(module) {
    return _c("div", {
      key: module.id,
      class: _vm.bem("list-box")
    }, [_vm.moduleTemplatesMap[module.id] ? [!_vm.loading ? _c("h3", [_vm._v(_vm._s(module.title))]) : _vm._e(), _c("LoadTemplates", {
      attrs: {
        "list": _vm.moduleTemplatesMap[module.id],
        "columns": module.line_count,
        "trackerData": {
          source: "\u4E13\u9898\u8BE6\u60C5\u9875",
          source_topic_id: `${_vm.topic.id}`,
          source_topic_title: _vm.topic.title
        },
        "tracker": ""
      }
    })] : _vm._e()], 2);
  }), 0)], 1);
};
var staticRenderFns$2 = [];
var topic_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => 'body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}.page-topic-item body{min-width:1000px}.topic-detail{min-width:1000px;max-width:1880px;padding:0 124px;margin:auto;font-size:14px;color:#000}.topic-detail h2{margin-top:68px;margin-bottom:12px;font-size:32px;text-align:center}.topic-detail .num{margin-bottom:64px;font-size:16px;line-height:24px;color:#444950;text-align:center}.topic-detail__list-box{margin-bottom:96px}.topic-detail__list-box h3{margin-bottom:16px;font-size:24px}.topic-detail__list-box:nth-last-child(2){margin-bottom:56px}.topic-detail .go-back-list{display:inline-flex;height:52px;padding:0 15px;font-size:14px;line-height:52px;color:#fff;background:#2254f4;border-radius:4px}\n')();
const { cdmApi: cdmApi$1, cmApi } = api;
const __vue2_script$2 = {
  name: "topic-detail",
  components: {
    Spin,
    LoadTemplates
  },
  props: {
    topic: {
      type: Object,
      default: () => ({ title: "" })
    }
  },
  data() {
    return {
      list: [],
      title: "",
      moduleTemplatesMap: {},
      loading: false
    };
  },
  computed: {
    total() {
      return this.topicModules.reduce((p, n) => {
        if (n.templet_ids) {
          p += n.templet_ids.split(",").length;
        }
        return p;
      }, 0);
    },
    id() {
      return this.$route.params.id;
    },
    topicModules() {
      return this.topic.modules || [];
    }
  },
  watch: {
    async $route() {
      this.moduleTemplatesMap = {};
      this.init();
    },
    topic() {
      this.init();
    }
  },
  methods: {
    async getFavoIdsByContentIds(datas = []) {
      if (!datas.length) {
        return [];
      }
      await Promise.all(datas.map(async (item) => {
        if (!item.length) {
          return false;
        }
        const ids = item.map((content) => content.id);
        const { data: favos } = await cmApi.queryFavoIdsByContentIds({
          content_ids: ids,
          source: "GD"
        });
        item.map((v) => {
          var _a;
          return Object.assign(v, {
            favo: (_a = favos.includes(v.id + "")) != null ? _a : false
          });
        });
      }));
      return datas;
    },
    async init() {
      this.loading = true;
      const { data = [] } = await cdmApi$1.getTopicTemplatesByModuleIds({
        topicId: this.id
      });
      const result = await this.getFavoIdsByContentIds(data);
      const moduleTemplatesMap = result.reduce((obj, templateArray) => {
        if (templateArray.length === 0)
          return obj;
        obj[templateArray[0].module_id] = templateArray;
        return obj;
      }, {});
      this.moduleTemplatesMap = moduleTemplatesMap;
      this.loading = false;
    }
  }
};
const __cssModules$2 = {};
var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, render$2, staticRenderFns$2, false, __vue2_injectStyles$2, null, null, null);
function __vue2_injectStyles$2(context) {
  for (let o in __cssModules$2) {
    this[o] = __cssModules$2[o];
  }
}
var TopicDetail = /* @__PURE__ */ function() {
  return __component__$2.exports;
}();
var render$1 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_c("span", [_vm.templateAround.prev && _vm.templateAround.prev.id ? _c("span", [_c("Icon", {
    attrs: {
      "type": "iconchevron_left"
    }
  }), _vm._v(" " + _vm._s(_vm.prevLabel) + "\uFF1A "), _c("router-link", {
    attrs: {
      "to": _vm.getPagePath(_vm.templateAround.prev.id)
    },
    nativeOn: {
      "click": function($event) {
        return _vm.$emit("click", "prev");
      }
    }
  }, [_vm._v(" " + _vm._s(_vm.templateAround.prev.title) + " ")])], 1) : _vm._e()]), _c("span", [_vm.templateAround.next && _vm.templateAround.next.id ? _c("span", [_vm._v(" " + _vm._s(_vm.nextLabel) + "\uFF1A "), _c("router-link", {
    attrs: {
      "to": _vm.getPagePath(_vm.templateAround.next.id)
    },
    nativeOn: {
      "click": function($event) {
        return _vm.$emit("click", "next");
      }
    }
  }, [_vm._v(" " + _vm._s(_vm.templateAround.next.title) + " ")]), _c("Icon", {
    attrs: {
      "type": "iconchevron_right"
    }
  })], 1) : _vm._e()])]);
};
var staticRenderFns$1 = [];
var templateAround_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => 'body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}.template-around{display:flex;justify-content:space-between;width:100%;font-family:PingFangSC-Regular;font-size:16px}.template-around span{display:flex;align-items:center;font-size:14px}.template-around a{color:#000;cursor:pointer}.template-around a:hover{color:#2254f4}\n')();
const __vue2_script$1 = {
  name: "template-around",
  components: { Icon },
  props: {
    templateAround: {
      type: Object,
      default: () => ({})
    },
    type: {
      type: String,
      required: true
    },
    prevLabel: {
      type: String,
      default: "\u4E0A\u4E00\u9875"
    },
    nextLabel: {
      type: String,
      default: "\u4E0B\u4E00\u9875"
    }
  },
  methods: {
    getPagePath(id) {
      return `/${this.type}/${id}`;
    }
  }
};
const __cssModules$1 = {};
var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, null, null, null);
function __vue2_injectStyles$1(context) {
  for (let o in __cssModules$1) {
    this[o] = __cssModules$1[o];
  }
}
var TemplateAround = /* @__PURE__ */ function() {
  return __component__$1.exports;
}();
var render = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_vm.type === "normal" ? [_c(_vm.getComponents("normal"), {
    tag: "components",
    attrs: {
      "topic": _vm.topicDetail,
      "type": _vm.type
    }
  })] : _vm._e(), _c("div", {
    class: _vm.bem("placeholder")
  }), _c("div", {
    class: _vm.bem("template-around")
  }, [_c("TemplateAround", {
    attrs: {
      "templateAround": _vm.templateAround,
      "prevLabel": "\u4E0A\u4E2A\u4E13\u9898",
      "nextLabel": "\u4E0B\u4E2A\u4E13\u9898",
      "type": "cdm/topic"
    }
  })], 1)], 2);
};
var staticRenderFns = [];
var index_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.topic-detail-page__placeholder{margin-top:64px}.topic-detail-page__introduction{width:1200px;padding-top:16px;margin:0 auto 56px;font-size:14px;line-height:24px;color:#777;text-align:left;border-top:1px solid #e0e5ea}.topic-detail-page__template-around{min-width:1000px;max-width:1880px;padding:24px 124px;margin:auto}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const { cdmApi } = api;
const loadMap = {
  normal: cdmApi.getTopics
};
const __vue2_script = {
  name: "topic-detail-page",
  components: {
    TopicDetail,
    TemplateAround
  },
  async beforeRouteUpdate(to2, _, next) {
    this.init(to2.params.id);
    next();
  },
  props: {
    type: {
      type: String,
      default: "normal"
    }
  },
  data() {
    return {
      topicDetail: {
        type: ""
      },
      templateAround: {}
    };
  },
  computed: {
    topicId() {
      return Number(this.$route.params.id);
    },
    isNewTopic() {
      return this.topicDetail.type === "normal" && this.topicDetail.banner;
    }
  },
  watch: {
    async type(val) {
      const load = loadMap[val];
      const { data } = await load({ id: this.$route.params.id });
      this.topicDetail = data;
    }
  },
  created() {
    this.init(this.$route.params.id);
  },
  methods: {
    async init(topicId) {
      const load = loadMap[this.type];
      const [[err, res], templateAround] = await Promise.all([
        to(load({ id: topicId })),
        cdmApi.getAround({
          id: topicId,
          type: "topics",
          channel_id: {}.SAAS_CHANNEL_ID || 31
        })
      ]);
      if (err) {
        if (err.status === 404)
          throw new Error("404");
        throw err;
      }
      this.topicDetail = res.data || {};
      this.templateAround = templateAround.data || {};
    },
    setPageMeta(topic) {
      const seo = topic.seo;
      let metaData = {};
      metaData = {
        title: topic.title + "_\u70ED\u70B9\u4E13\u9898\uFF0D\u7A3F\u5B9A\u8BBE\u8BA1",
        description: seo && seo.description || null,
        keywords: seo && seo.keywords || null,
        introduction: seo && seo.introduction || null
      };
      if (seo && seo.title !== "") {
        metaData.title = seo.title;
        if (topic.title === "")
          topic.title = seo.title;
      }
      this.$setTDK(metaData);
    },
    getComponents(type) {
      if (type === "normal") {
        return TopicDetail;
      }
    }
  }
};
const __cssModules = {};
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
function __vue2_injectStyles(context) {
  for (let o in __cssModules) {
    this[o] = __cssModules[o];
  }
}
var index = /* @__PURE__ */ function() {
  return __component__.exports;
}();
export { index as default };
