import { defineComponent, computed, resolveComponent, unref, openBlock, createElementBlock, createVNode, withCtx, createBlock, createCommentVNode } from "vue";
import { a$ as RequestHttpEnum, b0 as SelectHttpTimeNameObj, b1 as RequestHttpIntervalEnum, N as loadAsyncComponent, b2 as RequestDataTypeEnum, aa as ChartFrameEnum, a_ as SettingItemBox } from "./index-67bc0910.js";
import { u as useTargetData } from "./useTargetData.hook-83638ed4.js";
var DataResultEnum = /* @__PURE__ */ ((DataResultEnum2) => {
  DataResultEnum2[DataResultEnum2["NULL"] = 0] = "NULL";
  DataResultEnum2[DataResultEnum2["SUCCESS"] = 1] = "SUCCESS";
  DataResultEnum2[DataResultEnum2["FAILURE"] = 2] = "FAILURE";
  return DataResultEnum2;
})(DataResultEnum || {});
var TimelineTitleEnum = /* @__PURE__ */ ((TimelineTitleEnum2) => {
  TimelineTitleEnum2["FILTER"] = "数据过滤";
  TimelineTitleEnum2["MAPPING"] = "数据映射";
  TimelineTitleEnum2["CONTENT"] = "数据内容";
  return TimelineTitleEnum2;
})(TimelineTitleEnum || {});
var SelectCreateDataEnum = /* @__PURE__ */ ((SelectCreateDataEnum2) => {
  SelectCreateDataEnum2["STATIC"] = "静态数据";
  SelectCreateDataEnum2["AJAX"] = "动态请求";
  SelectCreateDataEnum2["Pond"] = "公共接口";
  return SelectCreateDataEnum2;
})(SelectCreateDataEnum || {});
const selectTypeOptions = [
  {
    label: RequestHttpEnum.GET,
    value: RequestHttpEnum.GET,
    style: {
      color: "greenyellow",
      fontWeight: "bold"
    }
  },
  {
    label: RequestHttpEnum.POST,
    value: RequestHttpEnum.POST,
    style: {
      color: "skyblue",
      fontWeight: "bold"
    }
  },
  {
    label: RequestHttpEnum.PUT,
    value: RequestHttpEnum.PUT,
    style: {
      color: "goldenrod",
      fontWeight: "bold"
    }
  },
  {
    label: RequestHttpEnum.PATCH,
    value: RequestHttpEnum.PATCH,
    style: {
      color: "violet",
      fontWeight: "bold"
    }
  },
  {
    label: RequestHttpEnum.DELETE,
    value: RequestHttpEnum.DELETE,
    disabled: true,
    style: {
      fontWeight: "bold"
    }
  }
];
const selectTimeOptions = [
  {
    label: SelectHttpTimeNameObj[RequestHttpIntervalEnum.SECOND],
    value: RequestHttpIntervalEnum.SECOND
  },
  {
    label: SelectHttpTimeNameObj[RequestHttpIntervalEnum.MINUTE],
    value: RequestHttpIntervalEnum.MINUTE
  },
  {
    label: SelectHttpTimeNameObj[RequestHttpIntervalEnum.HOUR],
    value: RequestHttpIntervalEnum.HOUR
  },
  {
    label: SelectHttpTimeNameObj[RequestHttpIntervalEnum.DAY],
    value: RequestHttpIntervalEnum.DAY
  }
];
const _hoisted_1 = {
  key: 0,
  class: "go-chart-configurations-data"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props) {
    const ChartDataStatic = loadAsyncComponent(() => import("./index-60a458f0.js"));
    const ChartDataAjax = loadAsyncComponent(() => import("./index-a613cb1a.js"));
    const ChartDataPond = loadAsyncComponent(() => import("./index-bef94e6e.js"));
    const { targetData } = useTargetData();
    const selectOptions = [
      {
        label: SelectCreateDataEnum.STATIC,
        value: RequestDataTypeEnum.STATIC
      },
      {
        label: SelectCreateDataEnum.AJAX,
        value: RequestDataTypeEnum.AJAX
      },
      {
        label: SelectCreateDataEnum.Pond,
        value: RequestDataTypeEnum.Pond
      }
    ];
    const isNotData = computed(() => {
      var _a, _b, _c;
      return ((_a = targetData.value.chartConfig) == null ? void 0 : _a.chartFrame) === ChartFrameEnum.STATIC || typeof ((_c = (_b = targetData.value) == null ? void 0 : _b.option) == null ? void 0 : _c.dataset) === "undefined";
    });
    return (_ctx, _cache) => {
      const _component_n_select = resolveComponent("n-select");
      return unref(targetData) ? (openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(unref(SettingItemBox), {
          name: "请求方式",
          alone: true
        }, {
          default: withCtx(() => [
            createVNode(_component_n_select, {
              value: unref(targetData).request.requestDataType,
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => unref(targetData).request.requestDataType = $event),
              disabled: isNotData.value,
              options: selectOptions
            }, null, 8, ["value", "disabled"])
          ]),
          _: 1
        }),
        unref(targetData).request.requestDataType === unref(RequestDataTypeEnum).STATIC ? (openBlock(), createBlock(unref(ChartDataStatic), { key: 0 })) : createCommentVNode("", true),
        unref(targetData).request.requestDataType === unref(RequestDataTypeEnum).AJAX ? (openBlock(), createBlock(unref(ChartDataAjax), { key: 1 })) : createCommentVNode("", true),
        unref(targetData).request.requestDataType === unref(RequestDataTypeEnum).Pond ? (openBlock(), createBlock(unref(ChartDataPond), { key: 2 })) : createCommentVNode("", true)
      ])) : createCommentVNode("", true);
    };
  }
});
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: _sfc_main
}, Symbol.toStringTag, { value: "Module" }));
export {
  DataResultEnum as D,
  TimelineTitleEnum as T,
  selectTypeOptions as a,
  index as i,
  selectTimeOptions as s
};
