require("../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_hooks = require("../hooks.js");
let react = require("react");
//#region src/components/eftpos/PairModal/hooks.ts
const usePairModal = () => {
	const [visible, setVisible] = (0, react.useState)(false);
	const [modalProps, setModalProps] = (0, react.useState)({});
	const open = (props) => {
		setModalProps(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props || {}), {}, {
			visible: true,
			close
		}));
		setVisible(true);
	};
	const close = () => {
		setVisible(false);
		setModalProps({});
	};
	return {
		visible,
		open,
		close,
		modalProps
	};
};
/**
* @title 解除配对
*/
const useUnPairRequest = () => {
	const request = require_hooks.useRequest();
	const run = (params) => {
		return request.post("/shop/pay/card-reader/unpair", params, {});
	};
	return { run };
};
/**
* @title 检查配对状态
*/
const useCheckPairRequest = () => {
	const request = require_hooks.useRequest();
	const run = (params) => {
		return request.post("/shop/pay/card-reader/pairing-info", params, {});
	};
	return { run };
};
//#endregion
exports.useCheckPairRequest = useCheckPairRequest;
exports.usePairModal = usePairModal;
exports.useUnPairRequest = useUnPairRequest;
