const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_pisell_components = require("../../theme/pisell-components.js");
const require_ReadOnlyView = require("./components/ReadOnlyView.js");
const require_EditView = require("./components/EditView.js");
const require_DisabledView = require("./components/DisabledView.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let antd = require("antd");
require("./PisellUrl.less");
//#region src/components/pisellUrl/PisellUrl.tsx
/**
* PisellUrl URL 链接组件
* 
* URL 链接输入/展示组件，支持只读、编辑、禁用三种状态。
* 基于 Ant Design Input 组件开发，提供 URL 格式校验、协议自动补全、
* 链接跳转和协议/路径显示控制功能。
* 
* @param props 组件 Props
* 
* @example
* // 编辑态（URL 输入）
* <PisellUrl 
*   placeholder="请输入网址"
*   required
* />
* 
* @example
* // 只读态（可跳转）
* <PisellUrl 
*   mode="read"
*   value="https://www.example.com"
*   enableLinkClick
* />
* 
* @example
* // 协议自动补全
* <PisellUrl 
*   autoCompleteProtocol
*   defaultProtocol="https://"
* />
*/
const PisellUrl = (props) => {
	const { mode = "edit", disabled = false } = props;
	const displayState = (0, _pisell_utils.getDisplayState)(mode, disabled);
	const render = () => {
		switch (displayState) {
			case "read": return /* @__PURE__ */ react.default.createElement(require_ReadOnlyView.default, props);
			case "edit": return /* @__PURE__ */ react.default.createElement(require_EditView.default, props);
			case "disabled": return /* @__PURE__ */ react.default.createElement(require_DisabledView.default, props);
			default: return null;
		}
	};
	const theme = require_pisell_components.getPisellComponentsThemeConfig();
	return /* @__PURE__ */ react.default.createElement(antd.ConfigProvider, { theme }, render());
};
var PisellUrl_default = react.default.memo(PisellUrl, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled && prevProps.autoCompleteProtocol === nextProps.autoCompleteProtocol;
});
//#endregion
exports.default = PisellUrl_default;
