var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
import { c as computed, l as lodash, h as Icon, f as mapState, N as localCache, n as normalizeComponent, b as reactive, w as watch, d as api, t as toRefs, O as constants } from "./index.js";
import { c, d, u as useRequest } from "./vue-router.js";
import "vue";
import { M as MaterialList } from "./index7.js";
import { E as Expose, b as useThrottleFn } from "./index5.js";
import { W as WjxFeedbackLink, O as OptionFilters } from "./index8.js";
import "./gd-abtest.js";
function _slicedToArray(arr, i) {
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray(o, minLen);
  var n = Object.prototype.toString.call(o).slice(8, -1);
  if (n === "Object" && o.constructor)
    n = o.constructor.name;
  if (n === "Map" || n === "Set")
    return Array.from(o);
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
    return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
    arr2[i] = arr[i];
  }
  return arr2;
}
function _iterableToArrayLimit(arr, i) {
  if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
    return;
  var _arr = [];
  var _n = true;
  var _d = false;
  var _e = void 0;
  try {
    for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
      _arr.push(_s.value);
      if (i && _arr.length === i)
        break;
    }
  } catch (err) {
    _d = true;
    _e = err;
  } finally {
    try {
      if (!_n && _i["return"] != null)
        _i["return"]();
    } finally {
      if (_d)
        throw _e;
    }
  }
  return _arr;
}
function _arrayWithHoles(arr) {
  if (Array.isArray(arr))
    return arr;
}
function ownKeys$1(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly)
      symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      });
    keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread$1(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};
    if (i % 2) {
      ownKeys$1(Object(source), true).forEach(function(key) {
        _defineProperty$1(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys$1(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }
  return target;
}
function _defineProperty$1(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
var useRouteQuery = function useRouteQuery2() {
  var router = c();
  var route = d();
  var query = computed(function() {
    return route.query;
  });
  var setQuery = function setQuery2(params) {
    var type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "push";
    var finalParams = _objectSpread$1({}, query.value, {}, params);
    var obj = {};
    Object.entries(finalParams).forEach(function(_ref) {
      var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
      if (value) {
        obj[key] = value;
      }
    });
    router[type]({
      query: obj
    }).catch(lodash.exports.noop);
  };
  return {
    query,
    setQuery
  };
};
(function() {
  try {
    return document.createElement("canvas").toDataURL("image/webp", 0.5).indexOf("data:image/webp") === 0;
  } catch (err) {
    return false;
  }
})();
function _typeof(obj) {
  "@babel/helpers - typeof";
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof = function _typeof2(obj2) {
      return typeof obj2;
    };
  } else {
    _typeof = function _typeof2(obj2) {
      return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    };
  }
  return _typeof(obj);
}
function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly)
      symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      });
    keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};
    if (i % 2) {
      ownKeys(Object(source), true).forEach(function(key) {
        _defineProperty(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }
  return target;
}
function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _objectWithoutProperties(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose(source, excluded);
  var key, i;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i = 0; i < sourceSymbolKeys.length; i++) {
      key = sourceSymbolKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;
  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _toPropertyKey(arg) {
  var key = _toPrimitive(arg, "string");
  return _typeof(key) === "symbol" ? key : String(key);
}
function _toPrimitive(input, hint) {
  if (_typeof(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function traverseTree(tree, func) {
  var childKey = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "children";
  if (!tree || !Array.isArray(tree)) {
    return;
  }
  if (!func || typeof func !== "function") {
    return;
  }
  for (var index = 0; index < tree.length; index++) {
    var node = tree[index];
    var isDone = func(node);
    if (isDone) {
      return true;
    }
    if (node && node[childKey]) {
      if (traverseTree(node[childKey], func)) {
        return true;
      }
    }
  }
}
function formatTree(tree, func) {
  var childKey = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "children";
  if (!tree || !Array.isArray(tree)) {
    return;
  }
  if (!func || typeof func !== "function") {
    return;
  }
  return tree.map(function(item) {
    var children = item[childKey], rest = _objectWithoutProperties(item, [childKey].map(_toPropertyKey));
    if (children) {
      return _objectSpread({}, func(_objectSpread({}, rest)), _defineProperty({}, childKey, formatTree(children, func, childKey)));
    }
    return func(item);
  });
}
var render$4 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_vm._t("default"), _vm.isTipsShow ? _c("div", {
    class: _vm.bem("tips")
  }, [_vm._v(" \u5BF9\u7ED3\u679C\u4E0D\u6EE1\u610F\uFF1F\u70B9\u51FB\u6B64\u5904 "), _c("WjxFeedbackLink", {
    class: _vm.bem("tips-link"),
    on: {
      "click": _vm.onTipsClick
    }
  }, [_vm._v(" \u53CD\u9988\u7ED9\u6211\u4EEC ")]), _c("Icon", {
    class: _vm.bem("tips-close"),
    attrs: {
      "type": "iconclear_big_outline"
    },
    on: {
      "click": _vm.closeTips
    }
  })], 1) : _vm._e(), _vm.allLoaded ? _c("Expose", {
    on: {
      "expose": _vm.onExpose,
      "hide": _vm.onHide
    }
  }, [_c("div", {
    class: _vm.bem("bottom-tips")
  }, [_c("img", {
    class: _vm.bem("icon"),
    attrs: {
      "src": "https://st0.dancf.com/static/02/202111050234-a2c6.png",
      "alt": ""
    }
  }), _c("span", [_vm._v(" \u5BF9\u7ED3\u679C\u4E0D\u6EE1\u610F\uFF1F\u70B9\u51FB\u6B64\u5904 "), _c("WjxFeedbackLink", {
    on: {
      "click": _vm.onBottomTipsClick
    }
  }, [_vm._v("\u53CD\u9988\u7ED9\u6211\u4EEC")])], 1)])]) : _vm._e()], 2);
};
var staticRenderFns$4 = [];
var index_vue_vue_type_style_index_0_lang$2 = /* @__PURE__ */ (() => '.material-feedback-container{text-align:center}.material-feedback-container__icon{width:96px;height:96px;margin-right:16px}.material-feedback-container__bottom-tips{display:flex;align-items:center;padding:16px 32px;margin-top:32px;font-size:14px;line-height:22px;color:#33383e;background:#f6f7f9;border-radius:4px}.material-feedback-container__tips{position:fixed;bottom:0;left:calc(50% - 138px);display:flex;align-items:center;justify-content:center;width:400px;height:50px;font-size:14px;line-height:22px;color:#fff;text-align:center;background:rgba(0,0,0,.5);border-radius:4px 4px 0 0}.material-feedback-container__tips-link,.material-feedback-container__tips-link:hover{color:#fff;text-decoration:underline}.material-feedback-container__tips-close{position:absolute;right:24px;font-size:16px;cursor:pointer}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')();
let unwatch = null;
const MAX_PAGE = 4;
const __vue2_script$4 = {
  name: "material-feedback-container",
  components: {
    Expose,
    WjxFeedbackLink,
    Icon
  },
  props: {
    allLoaded: {
      type: Boolean,
      default: false
    },
    count: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      bottomTipExpose: false,
      showTips: true,
      manuallyClose: false
    };
  },
  computed: __spreadProps(__spreadValues({}, mapState("user", ["user"])), {
    isReachMax() {
      return this.count >= MAX_PAGE;
    },
    isTipsShow() {
      return !this.manuallyClose && this.showTips && !this.bottomTipExpose && this.isReachMax;
    },
    localCacheKey() {
      const prefix = "HAS_USER_MANUALLY_CLOSE_TIP_";
      const { id = "" } = this.user || {};
      return prefix + id;
    }
  }),
  watch: {
    isTipsShow(val) {
    }
  },
  mounted() {
    const manuallyCloseTipCount = localCache.get(this.localCacheKey);
    if (manuallyCloseTipCount >= 5) {
      this.showTips = false;
    }
    unwatch = this.$watch("$route", this.reset);
  },
  beforeDestroy() {
    unwatch && unwatch();
  },
  methods: {
    reset() {
      this.bottomTipExpose = false;
      this.showTips = true;
    },
    closeTips() {
      let closeCount = localCache.get(this.localCacheKey);
      if (!closeCount) {
        closeCount = 0;
      }
      localCache.set(this.localCacheKey, +closeCount + 1, { time: -1 });
      this.manuallyClose = true;
      this.showTips = false;
    },
    onExpose() {
      this.bottomTipExpose = true;
      if (this.allLoaded) {
        this.showTips = false;
      }
    },
    onHide() {
      this.bottomTipExpose = false;
    },
    onTipsClick() {
    },
    onBottomTipsClick() {
    }
  }
};
const __cssModules$4 = {};
var __component__$4 = /* @__PURE__ */ normalizeComponent(__vue2_script$4, render$4, staticRenderFns$4, false, __vue2_injectStyles$4, null, null, null);
function __vue2_injectStyles$4(context) {
  for (let o in __cssModules$4) {
    this[o] = __cssModules$4[o];
  }
}
var FeedbackContainer = /* @__PURE__ */ function() {
  return __component__$4.exports;
}();
function getTagOptions(tags, needAllTag = true) {
  if (!tags)
    return [];
  const options = [];
  let allChildTags = [];
  if (tags.length === 1 && tags[0].children && tags[0].children.length)
    tags = tags[0].children;
  tags.forEach((tag) => {
    const childs = [];
    const childList = tag.children;
    if (childList && childList.length > 1) {
      childList.forEach((c2) => {
        childs.push({
          label: c2.name,
          value: c2.id,
          parentId: tag.id
        });
      });
      allChildTags = allChildTags.concat(childs);
      childs.unshift({
        label: "\u63A8\u8350",
        value: tag.id
      });
    }
    options.push({
      label: tag.name,
      value: tag.id,
      children: childs
    });
  });
  if (options.length > 1) {
    if (allChildTags.length > 1) {
      allChildTags.unshift({
        label: "\u63A8\u8350",
        value: ""
      });
    }
    if (needAllTag) {
      options.unshift({
        label: "\u5168\u90E8",
        value: "",
        children: allChildTags
      });
    }
  }
  return options;
}
function getVal(val) {
  if (val === void 0) {
    return "";
  }
  return val ? +val : val;
}
const PARAM_MAP = {
  s_design_category_id: "design_category_id",
  s_channel_category_id: "channel_category_id",
  s_tag_ids: "tag_ids",
  s_industry_category_id: "industry_category_id"
};
function formatParams(params) {
  const obj = {};
  Object.entries(params).forEach(([key, value]) => {
    obj[PARAM_MAP[key] || key] = value;
  });
  return obj;
}
function filterDesignTags(tags) {
  return tags.filter((tag) => {
    const reg = /^网店装修|图文模板$/i;
    return !reg.test(tag.name);
  });
}
function getFilterIdStr(arr) {
  if (!arr || arr.length === 0) {
    return "";
  }
  return arr.filter((id) => !!id).join(",");
}
const { cdmApi: cdmApi$6 } = api;
const filterAdaptor = (arr = []) => {
  var _a;
  const allTagsMap = {};
  const filters = formatTree(arr, (item) => __spreadProps(__spreadValues({}, item), { id: +item.id }));
  traverseTree(filters, (item) => {
    allTagsMap[item.id] = item;
  });
  const rootFilterId = (_a = filters[0]) == null ? void 0 : _a.parentId;
  const designMap = {};
  const excludeNodes = [];
  const designList = filters.map((_b) => {
    var _c = _b, { children, id, name } = _c, rest = __objRest(_c, ["children", "id", "name"]);
    const obj = {};
    if (children && children.length) {
      children.forEach((c2) => {
        if (c2.name === "\u6E20\u9053") {
          obj.channelTags = getTagOptions(c2.children || []);
          obj.channelId = +c2.id;
        } else if (c2.name === "\u7528\u9014") {
          obj.useTags = getTagOptions(c2.children || []);
          obj.useId = +c2.id;
        } else if (c2.name === "\u884C\u4E1A") {
          obj.industryTags = getTagOptions(c2.children || []);
          obj.industryId = +c2.id;
        }
        excludeNodes.push(+c2.id);
      });
    }
    designMap[id] = obj;
    return __spreadValues({ label: name, value: id }, rest);
  });
  return { allTagsMap, designList, rootFilterId, designMap, excludeNodes };
};
function useFilterTags(options) {
  const state = reactive({
    allTagsMap: {},
    designMap: {},
    designTags: [],
    channelTags: [],
    useTags: [],
    industryTags: [],
    channelId: "",
    useId: "",
    industryId: "",
    excludeNodes: []
  });
  const { query } = useRouteQuery();
  const refresh = (id) => {
    var _a;
    const designId = id ? +id : (_a = state.designTags[0]) == null ? void 0 : _a.id;
    const nowItem = state.designMap[designId] || {};
    state.channelTags = nowItem.channelTags || [];
    state.useTags = nowItem.useTags || [];
    state.industryTags = nowItem.industryTags || [];
    state.channelId = nowItem.channelId;
    state.useId = nowItem.useId;
    state.industryId = nowItem.industryId;
  };
  const { data: rootFilterId, run } = useRequest(cdmApi$6.getAllFilters, __spreadValues({
    formatResult(res) {
      const { data = [] } = res;
      const formatData = filterAdaptor(data);
      const { allTagsMap, designList, designMap, excludeNodes, rootFilterId: rootFilterId2 } = formatData;
      state.allTagsMap = allTagsMap;
      state.designMap = designMap;
      state.designTags = designList;
      state.excludeNodes = excludeNodes;
      refresh(query.value.design_category_id);
      return rootFilterId2;
    },
    manual: true
  }, options));
  watch(() => query.value.design_category_id, (newV) => {
    refresh(newV);
  });
  return {
    rootFilterId,
    data: state,
    run
  };
}
const { cdmApi: cdmApi$5 } = api;
function useSearchTags() {
  const state = reactive({
    designTags: [],
    channelTags: [],
    useTags: [],
    industryTags: []
  });
  const { run: getSearchTags } = useRequest((params) => cdmApi$5.getSearchFilters(formatParams(params)), {
    onSuccess(res) {
      const { design = [], channel = [], industry = [] } = res || {};
      state.designTags = getTagOptions(filterDesignTags(design));
      state.channelTags = getTagOptions(channel);
      state.industryTags = getTagOptions(industry);
    },
    manual: true
  });
  return {
    data: state,
    getSearchTags
  };
}
const { cdmApi: cdmApi$4 } = api;
function useSceneTags(options) {
  const state = reactive({
    designTags: [],
    channelTags: [],
    useTags: [],
    industryTags: []
  });
  const { data: done, run } = useRequest((params) => cdmApi$4.getFilterTagsOfScene(__spreadProps(__spreadValues({}, params), {
    page_size: 100
  })), __spreadValues({
    formatResult(res) {
      const { data } = res;
      const { design_list, channel_list, use_list, industry_list } = data;
      if (design_list) {
        state.designTags = getTagOptions(filterDesignTags(design_list));
      }
      state.channelTags = channel_list ? getTagOptions(channel_list) : [];
      state.useTags = use_list ? getTagOptions(use_list) : [];
      state.industryTags = industry_list ? getTagOptions(industry_list) : [];
      return true;
    },
    manual: true
  }, options));
  return {
    done,
    data: state,
    run
  };
}
const { cdmApi: cdmApi$3, cmApi } = api;
const INTEGRATED_TYPES = ["tool"];
function useMaterials(options = {}) {
  const { rootFilterId, sceneFilterId, filterTags } = options;
  const state = reactive({
    total: 0,
    data: [],
    pageNum: 1,
    pageSize: 100,
    ready: false
  });
  const { query } = useRouteQuery();
  const getFavoIdsByContentIds = async (datas) => {
    if (!datas.length) {
      return;
    }
    const { data: favoIds } = await cmApi.queryFavoIdsByContentIds({
      content_ids: datas.map((content) => content.id),
      source: "GD"
    });
    const result = {};
    for (const item of favoIds) {
      result[item] = true;
    }
    return result;
  };
  const filterSearchResult = async (res) => {
    res.data = res.data.filter((template) => !INTEGRATED_TYPES.includes(template.type));
    if (!res.data.length) {
      return res;
    }
    const favoList = await getFavoIdsByContentIds(res.data);
    res.data = res.data.map((v) => {
      var _a;
      return __spreadProps(__spreadValues({}, v), {
        favo: (_a = favoList[v.id]) != null ? _a : false
      });
    });
    return res;
  };
  const getParams = (params) => {
    const sortMaps = ["publish_time", "hot"];
    const { sort } = params;
    if (sort && lodash.exports.isNumber(Number(sort))) {
      params.sort = sortMaps[sort - 1] || "";
    }
    return __spreadProps(__spreadValues({}, formatParams(params)), {
      page_size: state.pageSize,
      page_num: state.pageNum
    });
  };
  const fetchDataWithQ = async () => {
    const _a = query.value, {
      design_category_id,
      channel_category_id,
      tag_ids,
      industry_category_id
    } = _a, rest = __objRest(_a, [
      "design_category_id",
      "channel_category_id",
      "tag_ids",
      "industry_category_id"
    ]);
    const finalParams = getParams(__spreadValues({}, rest));
    const filter_id = getFilterIdStr([
      rootFilterId.value,
      sceneFilterId,
      design_category_id,
      channel_category_id,
      tag_ids,
      industry_category_id
    ]);
    return await cdmApi$3.getTemplatesByQuery(__spreadProps(__spreadValues({}, finalParams), {
      filter_id
    })).then((res) => filterSearchResult(res));
  };
  const getParentId = (id) => {
    var _a;
    if (filterTags && filterTags.allTagsMap) {
      const pId = (_a = filterTags.allTagsMap[+id]) == null ? void 0 : _a.parent_id;
      if (pId) {
        return filterTags.excludeNodes.includes(pId) ? "" : pId;
      }
    }
    return "";
  };
  const fetchDataWithoutQ = async () => {
    const _a = query.value, {
      design_category_id,
      channel_category_id,
      tag_ids,
      industry_category_id
    } = _a, rest = __objRest(_a, [
      "design_category_id",
      "channel_category_id",
      "tag_ids",
      "industry_category_id"
    ]);
    const finalParams = getParams(__spreadValues({}, rest));
    const filter_id = getFilterIdStr([
      rootFilterId.value,
      sceneFilterId,
      design_category_id,
      channel_category_id,
      getParentId(channel_category_id),
      tag_ids,
      getParentId(tag_ids),
      industry_category_id,
      getParentId(industry_category_id)
    ]);
    return await cdmApi$3.getTemplatesByTags(__spreadProps(__spreadValues({}, finalParams), {
      filter_id
    })).then((res) => filterSearchResult(res));
  };
  const finalService = () => {
    return query.value.q ? fetchDataWithQ : fetchDataWithoutQ;
  };
  const { loading, run, cancel } = useRequest(finalService, {
    formatResult(res) {
      const { data, pagination: { total = 0 } = {} } = res;
      state.data.push(...data);
      state.total = +total;
      if (state.pageNum === 1) {
        state.ready = true;
      }
      return data;
    },
    debounceInterval: 50,
    manual: true
  });
  const loadMore = useThrottleFn(() => {
    if (loading.value)
      return;
    if (state.pageNum * state.pageSize >= state.total)
      return;
    state.pageNum += 1;
    state.ready = false;
    run();
  }, 300);
  const refresh = () => {
    state.pageNum = 1;
    state.data = [];
    state.ready = false;
    cancel();
    run();
  };
  return __spreadProps(__spreadValues({}, toRefs(state)), {
    loading,
    refresh,
    loadMore
  });
}
const { cdmApi: cdmApi$2 } = api;
function useEmptyTags(allTags) {
  const { query } = useRouteQuery();
  const {
    data: emptyChildren,
    run: getChildren,
    mutate: setChildren
  } = useRequest(cdmApi$2.getEmptyChildren, {
    manual: true,
    initialData: [],
    formatResult(res) {
      const { data = [] } = res;
      return data;
    }
  });
  const {
    data: emptySiblings,
    run: getSiblings,
    mutate: setSiblings
  } = useRequest(cdmApi$2.getEmptySiblings, {
    manual: true,
    initialData: [],
    formatResult(res) {
      const { data = [] } = res;
      return data;
    }
  });
  const getParentId = (id, deep) => {
    var _a;
    const pId = (_a = allTags.allTagsMap[id]) == null ? void 0 : _a.parent_id;
    if (id) {
      return pId;
    }
    if (deep) {
      return getParentId(pId);
    }
  };
  const getDeep = (id, arr = [], stopId) => {
    const pId = getParentId(id);
    if (pId && pId !== stopId) {
      arr.push(pId);
      getDeep(pId, arr, stopId);
    }
  };
  const getAllParentId = (id, stopId) => {
    const arr = [id];
    getDeep(id, arr, stopId);
    return arr.filter((id2) => !!id2 && !allTags.excludeNodes.includes(id2)).reverse();
  };
  const getChildrenBrotherIds = (type) => {
    const {
      design_category_id,
      channel_category_id,
      tag_ids,
      industry_category_id
    } = query.value;
    const obj = {
      channel_category_id,
      tag_ids,
      industry_category_id,
      [type]: ""
    };
    let arr = [];
    Object.entries(obj).forEach(([, value]) => {
      arr = arr.concat(getAllParentId(+value, +design_category_id));
    });
    return arr;
  };
  const getBrotherNodeIds = (type) => {
    const arr = [allTags.channelId, allTags.useId, allTags.industryId];
    return arr.filter((item) => {
      if (!item)
        return false;
      if (type === "channel_category_id") {
        return item !== allTags.channelId;
      } else if (type === "tag_ids") {
        return item !== allTags.useId;
      } else if (type === "industry_category_id") {
        return item !== allTags.industryId;
      }
      return true;
    });
  };
  const run = ({ id, type }) => {
    let nowId = id;
    if (!id) {
      switch (type) {
        case "channel_category_id":
          nowId = allTags.channelId;
          break;
        case "tag_ids":
          nowId = allTags.useId;
          break;
        case "industry_category_id":
          nowId = allTags.industryId;
          break;
      }
    }
    const childParams = {
      parent_id: [nowId],
      click_parent_id: getParentId(nowId),
      selected_ids: getAllParentId(nowId, getParentId(+query.value.design_category_id)),
      brother_selected_ids: getChildrenBrotherIds(type)
    };
    const siblingParams = {
      parent_id: getBrotherNodeIds(type),
      brother_selected_ids: id ? getAllParentId(id, +query.value.design_category_id) : [],
      selected_ids: [+query.value.design_category_id].concat(getChildrenBrotherIds(type))
    };
    getChildren(childParams);
    getSiblings(siblingParams);
  };
  const clear = () => {
    setChildren([]);
    setSiblings([]);
  };
  const tags = computed(() => {
    return [...emptyChildren.value, ...emptySiblings.value];
  });
  return {
    data: tags,
    run,
    clear
  };
}
const { COLORS: COLORS$1, SORT_OPTIONS: SORT_OPTIONS$1, STYLE_OPTIONS: STYLE_OPTIONS$1, FORMAT_OPTIONS } = constants;
function useOptionFilters() {
  const state = reactive({
    formats: FORMAT_OPTIONS,
    styles: [{ label: "\u5168\u90E8", value: "" }].concat(STYLE_OPTIONS$1),
    colors: COLORS$1,
    sorts: SORT_OPTIONS$1
  });
  return {
    data: state
  };
}
var render$3 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_vm.label ? _c("span", {
    class: _vm.bem("label")
  }, [_vm._v(_vm._s(_vm.label))]) : _vm._e(), _c("div", {
    class: _vm.bem("content")
  }, [_vm._l(_vm.shownGrouping, function(options, i) {
    return _c("div", {
      key: i,
      class: _vm.bem("group")
    }, [_vm._l(options, function(option) {
      return [_c("span", {
        key: option[_vm.fieldNames.value],
        class: _vm.bem("item", {
          active: _vm.innerValues[0] === option[_vm.fieldNames.value],
          disabled: _vm.disabledTags.includes(option[_vm.fieldNames.value])
        }),
        on: {
          "click": function($event) {
            return _vm.change(option);
          }
        }
      }, [_vm._v(" " + _vm._s(option[_vm.fieldNames.label]) + " ")])];
    }), i === _vm.shownGrouping.length - 1 ? _vm._t("default") : _vm._e(), i == 0 && _vm.optionGrouping.length > 1 ? _c("span", {
      class: [_vm.bem("item", {
        light: _vm.showMore
      }), _vm.bem("expansion")],
      on: {
        "click": function($event) {
          _vm.showMore = !_vm.showMore;
        }
      }
    }, [_vm._v(" " + _vm._s(_vm.showMore ? "\u6536\u8D77" : "\u66F4\u591A") + " "), _c("Icon", {
      class: _vm.bem("icon-down"),
      attrs: {
        "type": "iconChevronDown"
      }
    })], 1) : _vm._e()], 2);
  }), _vm.childrenOptionGrouping.length ? _c("div", {
    class: _vm.bem("child")
  }, _vm._l(_vm.childrenShowMore ? _vm.childrenOptionGrouping : _vm.childrenOptionGrouping.slice(0, 1), function(tags, i) {
    return _c("div", {
      key: i,
      class: _vm.bem("child-row-wrapper")
    }, [_c("div", {
      class: _vm.bem("child-row")
    }, [_vm._l(tags, function(tag) {
      return _c("span", {
        key: tag[_vm.fieldNames.value],
        class: _vm.bem("item", {
          active: _vm.realValue === tag[_vm.fieldNames.value],
          disabled: _vm.disabledTags.includes(tag[_vm.fieldNames.value]) || tag.parentId && _vm.disabledTags.includes(tag.parentId)
        }),
        on: {
          "click": function($event) {
            return _vm.changeSub(tag);
          }
        }
      }, [_vm._v(" " + _vm._s(tag[_vm.fieldNames.label]) + " ")]);
    }), i == 0 && _vm.childrenOptionGrouping.length > 1 ? _c("span", {
      class: [_vm.bem("item", {
        light: _vm.childrenShowMore
      }), _vm.bem("expansion")],
      on: {
        "click": function($event) {
          _vm.childrenShowMore = !_vm.childrenShowMore;
        }
      }
    }, [_vm._v(" " + _vm._s(_vm.childrenShowMore ? "\u6536\u8D77" : "\u66F4\u591A") + " "), _c("Icon", {
      class: _vm.bem("icon-down"),
      attrs: {
        "type": "iconChevronDown"
      }
    })], 1) : _vm._e()], 2)]);
  }), 0) : _vm._e()], 2)]);
};
var staticRenderFns$3 = [];
var index_vue_vue_type_style_index_0_lang$1 = /* @__PURE__ */ (() => '.tag-filter{display:flex;box-sizing:border-box}.tag-filter__label,.tag-filter__item{display:inline-flex;align-items:center;width:max-content;height:32px;letter-spacing:normal;white-space:nowrap;border-radius:4px;cursor:pointer}.tag-filter__label{display:flex;align-items:center;width:max-content;min-width:35px;padding:0;margin-right:16px;color:#b4b8bf;cursor:default}.tag-filter__group .tag-filter__item{color:#33383e}.tag-filter__group .tag-filter__item--active{padding:0 11px;color:#2254f4;background:rgba(34,84,244,.05);border:1px solid #e8eaec;border-radius:4px}.tag-filter__child .tag-filter__item{color:#636c78}.tag-filter__child .tag-filter__item--active{color:#2254f4}.tag-filter__item{padding:0 12px}.tag-filter__item:hover,.tag-filter__item--light{color:#2254f4!important}.tag-filter__item--disabled{color:#ccc!important;cursor:not-allowed!important}.tag-filter__item--disabled:hover{color:#ccc!important}.tag-filter__expansion{display:inline-flex;align-items:center;padding-right:14px}.tag-filter__group{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;height:32px;line-height:1}.tag-filter__group:first-of-type{padding-left:0}.tag-filter__label+.tag-filter__group{padding-left:0}.tag-filter__child{display:inline-block;margin-top:4px;overflow:hidden;border-top:1px dashed #e8eaec;border-radius:4px}.tag-filter__child-row{display:inline-block;line-height:1}.tag-filter__child-row:first-child{border-top-right-radius:4px}.tag-filter__child-row:last-child{border-bottom-left-radius:4px}.tag-filter__icon-down{font-size:20px;color:#9da3ac}.tag-filter__item--light .tag-filter__icon-down,.tag-filter__item:hover .tag-filter__icon-down{color:#2254f4}.tag-filter__item--light .tag-filter__icon-down{transform:rotate(180deg)}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 __vue2_script$3 = {
  name: "tag-filter",
  components: {
    Icon
  },
  model: {
    name: "value",
    event: "change"
  },
  props: {
    value: {
      type: [String, Number],
      required: true
    },
    filterValue: {
      type: [String, Number],
      default: ""
    },
    defaultShowMore: {
      type: Boolean,
      default: false
    },
    label: {
      type: String,
      default: ""
    },
    options: {
      type: Array,
      required: true
    },
    hasFilter: {
      type: Boolean,
      default: false
    },
    fieldNames: {
      type: Object,
      default: () => ({
        label: "label",
        value: "value"
      })
    },
    disabledTags: {
      type: Array,
      default: () => []
    },
    noDoubleTrigger: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      showMore: this.defaultShowMore,
      childrenShowMore: false,
      childOptions: [],
      activeIndex: 0,
      width: 930
    };
  },
  computed: {
    realValue() {
      return this.hasFilter ? this.filterValue : this.value;
    },
    innerValues() {
      let values = [];
      for (let index = this.options.length - 1; index >= 0; index--) {
        if (this.options[index][this.fieldNames.value] === this.value) {
          values = [this.value];
          break;
        } else if (this.options[index].children && !this.hasFilter) {
          if (this.options[index].children.find((c2) => c2[this.fieldNames.value] === this.value)) {
            values = [this.options[index][this.fieldNames.value], this.value];
            break;
          }
        }
      }
      return values;
    },
    optionGrouping() {
      return this.calculationOptionGrouping(this.options, this.width - 86);
    },
    childrenOptionGrouping() {
      const option = this.options.find((o) => o[this.fieldNames.value] === this.innerValues[0]);
      if (option && option.children) {
        return this.calculationOptionGrouping(option.children, this.width - 86);
      }
      return [];
    },
    shownGrouping() {
      return this.showMore ? this.optionGrouping : this.optionGrouping.slice(0, 1);
    }
  },
  watch: {
    value(value, oldValue) {
      if (value !== oldValue) {
        this.changeShowMore();
      }
    },
    options(value, oldValue) {
      if (value !== oldValue) {
        this.childOptions = value[0].children;
        this.changeShowMore();
        this.getContainerWidth();
      }
    }
  },
  mounted() {
    this.getContainerWidth();
    window.addEventListener("resize", this.getContainerWidth);
    this.changeShowMore();
  },
  beforeDestroy() {
    window.removeEventListener("resize", this.getContainerWidth);
  },
  methods: {
    change(option) {
      if (this.noDoubleTrigger && this.innerValues[this.innerValues.length - 1] === option.value) {
        return;
      }
      if (this.disabledTags.includes(option.value)) {
        return;
      }
      this.$emit("change", option, option[this.fieldNames.value]);
    },
    changeSub(subTag) {
      if (this.noDoubleTrigger && this.innerValues[this.innerValues.length - 1] === subTag.value) {
        return;
      }
      if (this.disabledTags.includes(subTag.value) || subTag.parentId && this.disabledTags.includes(subTag.parentId)) {
        return;
      }
      let parent = null;
      if (subTag[this.fieldNames.value]) {
        parent = this.options.find((option) => option.value && option.children.find((item) => item[this.fieldNames.value] === subTag[[this.fieldNames.value]]));
      }
      this.$emit("change", __spreadProps(__spreadValues({}, subTag), {
        parentId: parent ? parent[this.fieldNames.value] : "",
        type: "sub"
      }));
    },
    changeShowMore() {
      if (this.options.length && this.innerValues.length) {
        const options = this.optionGrouping[0];
        const childs = this.childrenOptionGrouping[0];
        if (!options.find((o) => o[this.fieldNames.value] === this.innerValues[0])) {
          this.showMore = true;
        }
        if (this.innerValues[1] && !childs.find((o) => o[this.fieldNames.value] === this.innerValues[1])) {
          this.childrenShowMore = true;
        }
      }
    },
    getContainerWidth() {
      this.width = this.label ? this.$el.clientWidth - 50 : this.$el.clientWidth;
    },
    calculationOptionGrouping(data, maxWidth = 930) {
      let arr = [];
      let v = 0;
      const optionGrouping = [];
      for (let i = 0; i < data.length; i++) {
        v = v + lodash.exports.get(data[i], `${this.fieldNames.label}.length`) * 14 + 24;
        if (v >= maxWidth) {
          optionGrouping.push(arr);
          arr = [];
          v = data[i][this.fieldNames.label].length * 14 + 24;
        }
        arr.push(data[i]);
      }
      if (arr.length) {
        optionGrouping.push(arr);
      }
      return optionGrouping;
    }
  }
};
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 Tags = /* @__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()
  }, [_vm.query.q || _vm.isScenePage ? [_vm.filterTags.designTags.length > 1 ? _c("Tags", {
    key: "designTags",
    attrs: {
      "label": "\u7C7B\u578B",
      "value": _vm.getVal(_vm.query.q ? _vm.query.s_design_category_id : _vm.query.design_category_id),
      "options": _vm.filterTags.designTags,
      "noDoubleTrigger": ""
    },
    on: {
      "change": function(t) {
        return _vm.handleFilterChange(t.value, "design_category_id");
      }
    }
  }) : _vm._e()] : _c("g-tabs", {
    attrs: {
      "active-key": _vm.getVal(_vm.query.design_category_id),
      "animated": false
    },
    on: {
      "change": function(t) {
        return _vm.handleFilterChange(t, "design_category_id");
      }
    }
  }, _vm._l(_vm.filterTags.designTags, function(item) {
    return _c("g-tab-pane", {
      key: item.value,
      attrs: {
        "tab": item.label
      }
    });
  }), 1), _vm.filterTags.channelTags.length > 1 ? _c("Tags", {
    key: "channelTags",
    attrs: {
      "label": _vm.query.q ? "\u5206\u7C7B" : "\u6E20\u9053",
      "disabledTags": _vm.disabledTags,
      "value": _vm.getVal(_vm.query.q ? _vm.query.s_channel_category_id : _vm.query.channel_category_id),
      "options": _vm.filterTags.channelTags,
      "noDoubleTrigger": ""
    },
    on: {
      "change": function(t) {
        return _vm.handleFilterChange(t.value, "channel_category_id");
      }
    }
  }) : _vm._e(), (_vm.query.q ? _vm.filterTags.channelTags.length <= 1 : true) && _vm.filterTags.useTags.length > 1 ? _c("Tags", {
    key: "useTags",
    attrs: {
      "label": "\u7528\u9014",
      "disabledTags": _vm.disabledTags,
      "value": _vm.getVal(_vm.query.q ? _vm.query.s_tag_ids : _vm.query.tag_ids),
      "options": _vm.filterTags.useTags,
      "noDoubleTrigger": ""
    },
    on: {
      "change": function(t) {
        return _vm.handleFilterChange(t.value, "tag_ids");
      }
    }
  }) : _vm._e(), _vm.filterTags.industryTags.length > 1 ? _c("Tags", {
    key: "industryTags",
    attrs: {
      "label": "\u884C\u4E1A",
      "disabledTags": _vm.disabledTags,
      "value": _vm.getVal(_vm.query.q ? _vm.query.s_industry_category_id : _vm.query.industry_category_id),
      "options": _vm.filterTags.industryTags,
      "noDoubleTrigger": ""
    },
    on: {
      "change": function(t) {
        return _vm.handleFilterChange(t.value, "industry_category_id");
      }
    }
  }) : _vm._e()], 2);
};
var staticRenderFns$2 = [];
var filterTags_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}\n')();
const __vue2_script$2 = {
  name: "filter-tags",
  components: {
    Tags
  },
  props: {
    filterTags: {
      type: Object,
      default: () => {
      }
    },
    isScenePage: {
      type: Boolean,
      default: false
    },
    disabledTags: {
      type: Array,
      default: () => []
    }
  },
  setup(props, ctx) {
    const state = reactive({});
    const { query } = useRouteQuery();
    const handleFilterChange = (tag, type) => {
      ctx.emit("change", tag, type);
    };
    return __spreadProps(__spreadValues({}, toRefs(state)), {
      query,
      getVal,
      handleFilterChange
    });
  }
};
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 FilterTags = /* @__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("GBreadcrumb", {
    class: _vm.bem("breadcrumb"),
    attrs: {
      "size": "small"
    },
    scopedSlots: _vm._u([{
      key: "separator",
      fn: function() {
        return [_c("Icon", {
          attrs: {
            "type": "iconchevron_right"
          }
        })];
      },
      proxy: true
    }])
  }, [_vm._t("title", function() {
    return [_c("GBreadcrumbItem", [_c("router-link", {
      attrs: {
        "to": {
          name: _vm.$route.name,
          query: {}
        }
      }
    }, [_vm._v(" \u6A21\u677F\u4E2D\u5FC3 ")])], 1)];
  }), _vm.$route.query.q ? _c("GBreadcrumbItem", [_vm.resultList.length ? _c("div", {
    class: _vm.bem("result")
  }, _vm._l(_vm.resultList, function(item) {
    return _c("div", {
      key: item.value
    }, [_vm._v(" " + _vm._s(item.label) + " "), _c("Icon", {
      class: _vm.bem("clear"),
      attrs: {
        "type": "iconclear_circle_fill"
      },
      on: {
        "click": function($event) {
          return _vm.handleClear(item);
        }
      }
    })], 1);
  }), 0) : _vm._e()]) : _vm._e(), _vm.$route.query.q ? _c("GBreadcrumbItem", {
    class: _vm.bem("detail"),
    attrs: {
      "current": ""
    }
  }, [_vm._v(" \u641C\u7D22 "), _c("span", {
    class: _vm.bem("breadcrumb-keyword")
  }, [_vm._v("\u201C" + _vm._s(_vm.$route.query.q) + "\u201D")]), _vm._v(" , \u5171 "), _c("span", {
    class: _vm.bem("breadcrumb-result")
  }, [_vm._v(_vm._s(_vm.total))]), _vm._v(" \u4E2A\u7ED3\u679C ")]) : _vm._e()], 2), _vm.$route.query.q && _vm.list && _vm.list.length ? _c("span", {
    class: _vm.bem("divider")
  }) : _vm._e(), _vm.$route.query.q && _vm.list && _vm.list.length ? _c("div", {
    class: _vm.bem("more")
  }, [_vm._v(" \u4F60\u662F\u4E0D\u662F\u60F3\u627E\uFF1A "), _vm._l(_vm.list, function(item) {
    return _c("span", {
      key: item,
      on: {
        "click": function($event) {
          return _vm.handleClick(item);
        }
      }
    }, [_vm._v(_vm._s(item))]);
  })], 2) : _vm._e()], 1);
};
var staticRenderFns$1 = [];
var searchResult_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.search-result{display:flex;flex-wrap:wrap;align-items:center}.search-result__detail{font-weight:400!important;color:#7f8792!important}.search-result__breadcrumb .gdaicon-iconchevron_right{vertical-align:-.2em}.search-result__breadcrumb .gda-breadcrumb-separator{margin:0 2px}.search-result__breadcrumb-keyword{color:#33383e}.search-result__breadcrumb-result{margin:0 2px;color:#2254f4}.search-result__result{display:inline-flex;flex-wrap:wrap;padding:0;margin:0 -4px;background:#fff}.search-result__result>div{position:relative;display:flex;align-items:center;padding:3px 12px;margin:6px;font-size:14px;line-height:22px;color:#7f8792;background:#f6f7f9;border-radius:4px}.search-result__clear{position:absolute;top:-8px;right:-8px;color:#9da3ac;cursor:pointer}.search-result__divider{width:1px;height:16px;margin:0 12px;background:#b4b8bf}.search-result__more span{box-sizing:border-box;padding:2px 8px;margin-right:8px;font-size:12px;line-height:18px;color:#2254f4;border:1px solid #c7dbff;border-radius:4px;cursor:pointer}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: cdmApi$1 } = api;
const __vue2_script$1 = {
  name: "search-result",
  components: { Icon },
  props: {
    total: {
      type: Number,
      default: 0
    },
    filterTags: {
      type: Object,
      default: () => {
      }
    }
  },
  setup(props) {
    const { query, setQuery } = useRouteQuery();
    const { data: list } = useRequest(() => cdmApi$1.getRelativeWords({ q: query.value.q }), {
      initialData: [],
      refreshDeps: [() => query.value.q],
      formatResult(res) {
        const { data = [] } = res;
        if (data.length < 3) {
          return [];
        }
        return data.slice(0, 7);
      }
    });
    const findItem = (dataSource, valueType) => {
      if (!dataSource)
        return "";
      return dataSource.find((it) => it.value === +query.value[valueType]);
    };
    const getItem = (sourceType, valueType) => {
      var _a;
      const d2 = findItem(props.filterTags[sourceType], valueType);
      if (d2) {
        return {
          type: valueType,
          label: d2.label
        };
      }
      const d22 = findItem((_a = props.filterTags[sourceType][0]) == null ? void 0 : _a.children, valueType);
      return d22 ? {
        type: valueType,
        label: d22.label
      } : "";
    };
    const resultList = computed(() => {
      const arr = [];
      if (query.value.design_category_id) {
        const d2 = getItem("designTags", "design_category_id");
        d2 && arr.push(d2);
      }
      if (query.value.channel_category_id) {
        const d2 = getItem("channelTags", "channel_category_id");
        d2 && arr.push(d2);
      }
      if (query.value.tag_ids) {
        const d2 = getItem("useTags", "tag_ids");
        d2 && arr.push(d2);
      }
      if (query.value.industry_category_id) {
        const d2 = getItem("industryTags", "industry_category_id");
        d2 && arr.push(d2);
      }
      return arr;
    });
    const handleClick = (item) => {
      setQuery({
        q: item,
        from: "recommend_top",
        s_design_category_id: "",
        s_channel_category_id: "",
        s_tag_ids: "",
        s_industry_category_id: "",
        sort: "",
        styles: "",
        colors: "",
        design_category_id: "",
        channel_category_id: "",
        tag_ids: "",
        industry_category_id: ""
      });
    };
    const handleClear = (item) => {
      const searchParam = {
        s_design_category_id: "",
        s_channel_category_id: "",
        s_tag_ids: "",
        s_industry_category_id: "",
        colors: "",
        styles: "",
        sort: "",
        from: ""
      };
      if (item.type === "design_category_id") {
        setQuery(__spreadValues({
          design_category_id: "",
          channel_category_id: "",
          tag_ids: "",
          industry_category_id: ""
        }, searchParam));
      } else {
        setQuery(__spreadValues({
          [item.type]: ""
        }, searchParam));
      }
    };
    return {
      list,
      resultList,
      handleClick,
      handleClear
    };
  }
};
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 SearchResult = /* @__PURE__ */ function() {
  return __component__$1.exports;
}();
var render = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("section", {
    class: _vm.bem()
  }, [_vm.initialLoading ? _c("GSpin", {
    class: _vm.bem("initial-loading")
  }) : _c("div", {
    class: _vm.bem("container")
  }, [_vm.query.q || _vm.isScenePage ? _c("SearchResult", {
    class: _vm.bem("result"),
    attrs: {
      "filterTags": _vm.finalResultTags,
      "total": _vm.total
    },
    scopedSlots: _vm._u([{
      key: "title",
      fn: function() {
        return [_vm._t("title")];
      },
      proxy: true
    }], null, true)
  }) : _vm._e(), _c("div", {
    class: _vm.bem("options")
  }, [_c("FilterTags", {
    attrs: {
      "isScenePage": _vm.isScenePage,
      "filterTags": _vm.finalFilterTags,
      "disabledTags": _vm.emptyTags
    },
    on: {
      "change": _vm.handleFilterChange
    }
  })], 1), _c("OptionFilters", {
    attrs: {
      "menu": _vm.menu,
      "selectedMenu": _vm.query
    },
    on: {
      "menuChange": _vm.onMenuChange
    }
  }), _c("div", {
    class: _vm.bem("content")
  }, [!_vm.listLoading && _vm.materialsList.length === 0 ? _c("div", {
    class: _vm.bem("search-tip")
  }, [_c("div", {
    class: _vm.bem("search-tip-main")
  }, [_c("img", {
    class: _vm.bem("empty-icon"),
    attrs: {
      "src": "https://st0.dancf.com/static/02/202111050234-a2c6.png",
      "alt": ""
    }
  }), _c("div", [_vm._v("\u62B1\u6B49\u6CA1\u6709\u76F8\u5173\u7ED3\u679C")])]), _c("div", {
    class: _vm.bem("search-tip-feedback")
  }, [_vm._v(" \u60A8\u53EF\u4EE5\u70B9\u51FB\u6B64\u5904 "), _c("WjxFeedbackLink", {
    class: _vm.bem("search-tip-link"),
    on: {
      "click": _vm.handleFeedback
    }
  }, [_vm._v(" \u53CD\u9988\u7ED9\u6211\u4EEC ")]), _vm._v(" \u6211\u4EEC\u5C06\u4F1A\u7B2C\u4E00\u65F6\u95F4\u8DDF\u8FDB\u60A8\u7684\u9700\u6C42\uFF01 ")], 1)]) : [_c("FeedbackContainer", {
    attrs: {
      "allLoaded": _vm.isAllMaterialLoaded,
      "count": _vm.pageNum,
      "loading": _vm.listLoading
    }
  }, [_c("MaterialList", {
    class: _vm.bem("search-list"),
    attrs: {
      "columns": _vm.column,
      "materials": _vm.materialsList,
      "trackerData": Object.assign({
        source: "\u6A21\u677F\u4E2D\u5FC3\u9875"
      }, _vm.getTrackerData()),
      "tracker": ""
    },
    on: {
      "loadNextPage": _vm.loadMore
    }
  }), _vm.listLoading ? _c("GSpin", {
    class: _vm.bem("list-loading", {
      "after-list": _vm.materialsList.length
    })
  }) : _vm._e()], 1)]], 2)], 1)], 1);
};
var staticRenderFns = [];
var index_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.gaoding-page__container{display:flex;flex-direction:column;align-items:stretch;min-height:calc(100vh - 64px);padding:32px 48px}.gaoding-page__container .material-preview{background:#fff!important}.gaoding-page__initial-loading{display:flex;align-items:center;justify-content:center;height:calc(100vh - 64px)}.gaoding-page__result{margin-bottom:24px}.gaoding-page__search-list{width:100%}.gaoding-page__list-loading:not(.gaoding-page__list-loading--after-list){display:flex;flex:1;align-items:center;justify-content:center}.gaoding-page__search-tip-main{margin-top:16px;margin-bottom:16px;font-size:16px;font-weight:600;line-height:20px;color:#000}.gaoding-page__search-tip-feedback{font-size:14px;line-height:22px;color:#7f8792}.gaoding-page__search-tip{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center}.gaoding-page__search-tip-link,.gaoding-page__search-tip-link:hover{color:#2254f4}.gaoding-page__list-loading--after-list{margin-top:20px}.gaoding-page__empty-icon{width:160px;height:160px}.gaoding-page .tag-filter+.tag-filter{margin-top:16px}.gaoding-page__separator{width:100%;height:1px;margin:24px 0 12px;background:#f0f3f4}.gaoding-page__select-view{display:flex;align-items:center;justify-content:space-between;width:100%;height:36px;margin:0 auto}.gaoding-page__select-left{display:inline-flex;align-items:center}.gaoding-page__select-divider{width:1px;height:16px;margin:0 12px;background:#b4b8bf}.gaoding-page__link-color{display:flex;align-items:center}.gaoding-page__link-color>div{display:flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:8px;border-radius:50%}.gaoding-page__link-color img{width:100%}.gaoding-page__sort{cursor:pointer}.gaoding-page__sort--active{color:#2254f4}.gaoding-page__sort+.gaoding-page__sort{margin-left:24px}.gaoding-page__content{display:flex;flex:1;flex-direction:column;margin-top:24px}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 {
  COLORS,
  STYLE_OPTIONS,
  SORT_OPTIONS,
  PAGE_INFO: {
    gaoding_templates: { title: pageTitle }
  }
} = constants;
const DEFAULT_COLUMN = 5;
const __vue2_script = {
  name: "gaoding-page",
  metaInfo: {
    title: pageTitle
  },
  components: {
    FilterTags,
    SearchResult,
    FeedbackContainer,
    WjxFeedbackLink,
    MaterialList,
    OptionFilters
  },
  props: {
    sceneFilterId: {
      type: [Number, String],
      default: ""
    }
  },
  setup(props) {
    const state = reactive({
      initialLoading: false,
      STYLE_OPTIONS,
      SORT_OPTIONS,
      column: DEFAULT_COLUMN
    });
    const route = d();
    const isScenePage = computed(() => {
      return !!route.params.scene;
    });
    const { query, setQuery } = useRouteQuery();
    const { data: menu } = useOptionFilters();
    const {
      data: filterTags,
      rootFilterId,
      run: getDefaultFilterTags
    } = useFilterTags();
    const { data: searchTags, getSearchTags } = useSearchTags();
    const { data: sceneTags, done, run: getSceneFilterTags } = useSceneTags();
    const { data: sceneTagsQ, run: getSceneFilterTagsQ } = useSceneTags();
    const {
      data: materialsList,
      total,
      pageNum,
      pageSize,
      ready,
      loading: listLoading,
      refresh: getMaterialList,
      loadMore
    } = useMaterials({
      rootFilterId,
      sceneFilterId: props.sceneFilterId,
      filterTags
    });
    const {
      data: emptyTags,
      run: getEmptyTags,
      clear: clearEmptyTags
    } = useEmptyTags(filterTags);
    const getColumn = async () => {
      const value = query.value.s_channel_category_id || query.value.channel_category_id;
      if (value && query.value.q) {
        const cate = await cdmApi.getCategoryDetail({ id: value }).then((res) => res.data);
        state.column = lodash.exports.get(cate, "extra.line_count") || DEFAULT_COLUMN;
      } else {
        state.column = DEFAULT_COLUMN;
      }
    };
    const initDefaultFilter = async () => {
      var _a;
      if (!query.value.design_category_id) {
        setQuery({
          design_category_id: (_a = filterTags == null ? void 0 : filterTags.designTags[0]) == null ? void 0 : _a.value
        }, "replace");
      }
    };
    const getFilterIds = () => {
      return getFilterIdStr([
        rootFilterId.value,
        query.value.design_category_id,
        query.value.channel_category_id,
        query.value.tag_ids,
        query.value.industry_category_id
      ]);
    };
    const initSearchFilter = () => getSearchTags({
      q: query.value.q,
      filter_id: getFilterIds(),
      design_category_id: query.value.s_design_category_id,
      channel_category_id: query.value.s_channel_category_id,
      tag_ids: query.value.s_tag_ids
    });
    const initSceneFilter = async () => {
      var _a;
      if (!done.value) {
        await getSceneFilterTags({ filter_id: props.sceneFilterId });
      }
      if (query.value.q) {
        await getSceneFilterTagsQ({
          q: query.value.q,
          filter_id: getFilterIdStr([
            props.sceneFilterId,
            query.value.design_category_id,
            query.value.channel_category_id,
            query.value.tag_ids,
            query.value.industry_category_id
          ])
        });
      }
      if (!query.value.q && !query.value.design_category_id) {
        setQuery({
          design_category_id: (_a = sceneTags.designTags[0]) == null ? void 0 : _a.value
        }, "replace");
      }
    };
    const init = async () => {
      state.initialLoading = true;
      if (isScenePage.value) {
        await initSceneFilter();
      } else {
        if (!rootFilterId.value) {
          await getDefaultFilterTags();
        }
        if (query.value.q) {
          await initSearchFilter();
        } else {
          await initDefaultFilter();
        }
      }
      await getMaterialList();
      state.initialLoading = false;
    };
    const onMenuChange = (res) => {
      setQuery({
        [res.type]: res.value
      });
    };
    init();
    watch(() => query.value, (newV, oldV) => {
      const _a = newV, { from } = _a, restNew = __objRest(_a, ["from"]);
      const _b = oldV, { from: _from } = _b, restOld = __objRest(_b, ["from"]);
      if (!lodash.exports.isEqual(restNew, restOld)) {
        getMaterialList();
      }
      if (newV.s_channel_category_id !== oldV.s_channel_category_id) {
        getColumn();
      }
      if (isScenePage.value) {
        if (!newV.q && oldV.q) {
          initSceneFilter();
          return;
        }
        if (newV.q) {
          if (newV.q !== oldV.q || newV.design_category_id !== oldV.design_category_id || newV.channel_category_id !== oldV.channel_category_id || newV.tag_ids !== oldV.tag_ids || newV.industry_category_id !== oldV.industry_category_id) {
            initSceneFilter();
            return;
          }
        }
        return;
      }
      if (newV.q) {
        if (newV.q !== oldV.q || newV.design_category_id !== oldV.design_category_id || newV.channel_category_id !== oldV.channel_category_id || newV.tag_ids !== oldV.tag_ids || newV.industry_category_id !== oldV.industry_category_id || newV.s_design_category_id !== oldV.s_design_category_id || newV.s_channel_category_id !== oldV.s_channel_category_id || newV.s_tag_ids !== oldV.s_tag_ids) {
          initSearchFilter();
          return;
        }
      }
      if (newV.q !== oldV.q || !newV.q) {
        initDefaultFilter();
      }
    });
    watch(() => query.value.design_category_id, () => {
      !query.value.q && !isScenePage.value && clearEmptyTags();
    });
    const handleFilterChange = (tag, type) => {
      if (query.value.q) {
        switch (type) {
          case "design_category_id":
            setQuery({
              s_design_category_id: tag,
              s_channel_category_id: "",
              s_tag_ids: "",
              s_industry_category_id: ""
            });
            break;
          case "channel_category_id":
            setQuery({
              s_channel_category_id: tag,
              s_tag_ids: "",
              s_industry_category_id: ""
            });
            break;
          case "tag_ids":
            setQuery({
              s_tag_ids: tag,
              s_industry_category_id: ""
            });
            break;
          case "industry_category_id":
            setQuery({
              s_industry_category_id: tag
            });
            break;
        }
        return;
      }
      if (type === "design_category_id") {
        setQuery({
          design_category_id: tag,
          channel_category_id: "",
          tag_ids: "",
          industry_category_id: ""
        });
        !isScenePage.value && clearEmptyTags();
        return;
      }
      setQuery({
        [type]: tag
      });
      !isScenePage.value && getEmptyTags({
        id: tag,
        type
      });
    };
    const handleFeedback = () => {
    };
    const isAllMaterialLoaded = computed(() => {
      return pageNum.value * pageSize.value >= total.value && materialsList.value.length > 0 && !state.initialLoading && !listLoading.value;
    });
    const finalFilterTags = computed(() => {
      if (isScenePage.value) {
        if (query.value.q) {
          return sceneTagsQ;
        }
        return sceneTags;
      }
      if (query.value.q) {
        return searchTags;
      }
      return filterTags;
    });
    const finalResultTags = computed(() => {
      if (isScenePage.value) {
        return sceneTags;
      }
      return filterTags;
    });
    const getStr = (source, v) => {
      var _a, _b, _c;
      return (_c = (_b = (_a = source == null ? void 0 : source.value) == null ? void 0 : _a.allTagsMap) == null ? void 0 : _b[v]) == null ? void 0 : _c.name;
    };
    const getStrFromList = (source, v) => {
      const res = [];
      traverseTree(source, (node) => {
        var _a;
        if (res.length) {
          return true;
        }
        if (node.value === v) {
          res.push(node.label);
          return true;
        }
        if (node.label !== "\u5168\u90E8" && ((_a = node.children) == null ? void 0 : _a.length)) {
          traverseTree(node.children, (node2) => {
            if (node2.value === v) {
              res.push(node.label, node2.label);
              return true;
            }
          }, "none");
        }
      }, "none");
      return res;
    };
    const filterEmpty = (arr) => arr.filter((it) => !!it);
    const getCommonTrackerData = () => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
      const obj = {};
      const searchWordType = {
        hot: "\u70ED\u95E8\u641C\u7D22\u8BCD",
        input: "\u624B\u52A8\u8F93\u5165\u641C\u7D22\u8BCD",
        history: "\u5386\u53F2\u641C\u7D22\u8BCD",
        placeholder: "\u9ED8\u8BA4\u641C\u7D22\u8BCD",
        select: "\u8054\u60F3\u641C\u7D22\u8BCD",
        recommend_top: "\u641C\u7D22\u53D1\u73B0",
        set: "\u8FD0\u8425\u914D\u7F6E"
      };
      if (query.value.from) {
        obj.search_word_type = searchWordType[query.value.from];
      }
      obj.sort_type = ((_a = SORT_OPTIONS.find((it) => it.value === query.value.sort)) == null ? void 0 : _a.label) || SORT_OPTIONS[0].label;
      obj.color = ((_b = COLORS.find((it) => it.value === +query.value.colors)) == null ? void 0 : _b.label) || "\u5168\u90E8";
      obj.style = ((_c = STYLE_OPTIONS.find((it) => it.value === query.value.styles)) == null ? void 0 : _c.label) || "\u5168\u90E8";
      const {
        design_category_id,
        s_design_category_id,
        channel_category_id,
        s_channel_category_id,
        tag_ids,
        s_tag_ids,
        industry_category_id,
        s_industry_category_id
      } = query.value;
      obj.filter_one = filterEmpty([
        getStr(finalResultTags, +design_category_id),
        ...getStrFromList((_d = finalFilterTags.value) == null ? void 0 : _d.designTags, +s_design_category_id)
      ]);
      obj.filter_two = filterEmpty([
        ...getStrFromList((_e = finalResultTags.value) == null ? void 0 : _e.channelTags, +channel_category_id),
        ...getStrFromList((_f = finalFilterTags.value) == null ? void 0 : _f.channelTags, +s_channel_category_id)
      ]);
      obj.filter_three = filterEmpty([
        ...getStrFromList((_g = finalResultTags.value) == null ? void 0 : _g.useTags, +tag_ids),
        ...getStrFromList((_h = finalFilterTags.value) == null ? void 0 : _h.useTags, +s_tag_ids)
      ]);
      obj.filter_four = filterEmpty([
        ...getStrFromList((_i = finalResultTags.value) == null ? void 0 : _i.industryTags, +industry_category_id),
        ...getStrFromList((_j = finalFilterTags.value) == null ? void 0 : _j.industryTags, +s_industry_category_id)
      ]);
      return obj;
    };
    const getTrackerData = () => {
      const obj = {};
      if (query.value.q) {
        obj.search_terms = query.value.q;
      }
      return __spreadValues(__spreadValues({}, obj), getCommonTrackerData());
    };
    watch(materialsList, () => {
      if (ready.value) {
        let search_type = "both";
        const queryLen = Object.keys(query.value).length;
        if (!query.value.q) {
          search_type = "\u7B5B\u9009\u5668-\u70B9\u51FB";
        }
        if (query.value.q && queryLen === 1 || query.value.q && query.value.from && queryLen === 2) {
          search_type = "\u641C\u7D22\u680F-\u641C\u7D22";
        }
        __spreadValues(__spreadProps(__spreadValues({
          search_source: "\u6A21\u677F\u4E2D\u5FC3\u9875",
          search_type
        }, query.value.q ? { search_word: query.value.q } : null), {
          search_result_number: total.value
        }), getCommonTrackerData());
      }
    });
    return __spreadProps(__spreadValues({}, toRefs(state)), {
      materialsList,
      total,
      listLoading,
      pageNum,
      isScenePage,
      finalResultTags,
      finalFilterTags,
      query,
      setQuery,
      getVal,
      handleFilterChange,
      loadMore,
      handleFeedback,
      isAllMaterialLoaded,
      emptyTags,
      getTrackerData,
      menu,
      onMenuChange
    });
  }
};
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 Gaoding = /* @__PURE__ */ function() {
  return __component__.exports;
}();
export { Gaoding as default };
