'use strict';

require('../../../utils/index.js');
var runtime = require('../../../utils/props/runtime.js');

"use strict";
const httpUriOptions = [
  {
    label: "Https://",
    value: "https://"
  },
  {
    label: "Http://",
    value: "http://"
  }
];
const getHttpMethodUri = (uri) => {
  let prefix = "https://";
  let url = uri ? uri : "";
  const currentUri = uri ? uri.toLowerCase() : "";
  try {
    const urlObject = new URL(currentUri);
    if (!prefix.includes(urlObject.protocol)) {
      prefix = "http://";
    }
    url = currentUri.replace(prefix, "");
  } catch (error) {
  }
  return {
    prefix,
    url
  };
};
const uriInputProps = runtime.buildProps({
  value: {
    type: [String, null],
    default: ""
  },
  suffix: {
    type: String,
    default: ""
  },
  // 后缀值
  addonAfter: {
    type: String,
    default: ""
  },
  disabled: {
    type: Boolean,
    default: false
  },
  placeholder: {
    type: String,
    default: "\u8BF7\u8F93\u5165"
  },
  // 显示复制
  showCopy: {
    type: Boolean,
    default: true
  }
});
const uriInputEmits = {
  "update:value": (value) => typeof value === "string",
  change: (value) => typeof value === "string"
};

exports.getHttpMethodUri = getHttpMethodUri;
exports.httpUriOptions = httpUriOptions;
exports.uriInputEmits = uriInputEmits;
exports.uriInputProps = uriInputProps;
//# sourceMappingURL=uri-input.js.map
