import { defineComponent, inject, ref, watch, resolveComponent, createBlock, openBlock, withCtx, createVNode, unref } from 'vue';
import '../config/index.mjs';
import { methods, apiUrlEmits, apiUrlProps } from '../config/api-url.mjs';

"use strict";
var _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "api-url",
  props: apiUrlProps,
  emits: apiUrlEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const disabled = inject("disabled");
    const innerValue = ref(props.value);
    const handleChange = () => {
      emits("change", innerValue.value);
      emits("update:value", innerValue.value);
    };
    watch(
      () => props.value,
      (val) => {
        innerValue.value = val;
      },
      {
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_ll_select = resolveComponent("ll-select");
      const _component_ll_input = resolveComponent("ll-input");
      const _component_a_input_group = resolveComponent("a-input-group");
      return openBlock(), createBlock(_component_a_input_group, { compact: "" }, {
        default: withCtx(() => [
          createVNode(_component_ll_select, {
            value: innerValue.value.method,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => innerValue.value.method = $event),
            disabled: unref(disabled),
            options: unref(methods),
            style: { "width": "150px" },
            "allow-clear": false,
            onChange: handleChange
          }, null, 8, ["value", "disabled", "options"]),
          createVNode(_component_ll_input, {
            value: innerValue.value.url,
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value.url = $event),
            disabled: unref(disabled),
            style: { "width": "50%" },
            placeholder: "\u8BF7\u8F93\u5165\u5730\u5740\uFF08\u53BB\u9664\u524D\u7F6EURL)",
            onInput: handleChange
          }, null, 8, ["value", "disabled"])
        ]),
        _: 1
        /* STABLE */
      });
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=api-url.vue2.mjs.map
