import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import { ClientEnum, EftposEnum, ModeEnum, PayRouteEnum, StatusEnum } from "../const.js";
import { locales } from "@pisell/utils";
//#region src/components/eftposPay/adyenPos/const.ts
const _excluded = [
	"order_id",
	"name",
	"symbol",
	"amount",
	"mode",
	"number",
	"pay",
	"device",
	"net",
	"client"
];
/**
* 初始步骤配置
* Adyen 仅一个 loading 步骤，支付结果由 API 回调驱动
*/
const getStep = (mode = ModeEnum.Pay) => [{
	key: Date.now(),
	title: locales.getText("page.eftpos-pay.text.loading")(mode),
	text: locales.getText("page.eftpos-pay.text.waiting.processing"),
	warn: "",
	tip: locales.getText("page.eftpos-pay.text.processing"),
	status: StatusEnum.Loading
}];
/**
* Adyen 常规支付初始 State 工厂
*
* 与 huifu 模式相同：
*   - Pay / FullPay → Init 状态（先展示操作 UI，等待用户触发支付）
*   - Refund / Query → Loading 状态（直接发起请求）
*/
const getAdyenInitState = (params) => {
	const _ref = params || { mode: ModeEnum.Pay }, { order_id, name, symbol, amount, mode, number, pay, device, net, client } = _ref, other = _objectWithoutProperties(_ref, _excluded);
	mode === ModeEnum.Pay || ModeEnum.FullPay;
	return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
		order_id,
		name,
		symbol,
		amount,
		mode,
		eftpos: EftposEnum.AdyenPos,
		key: Date.now(),
		step: 0,
		type: PayRouteEnum.Step,
		title: locales.getText("page.eftpos-pay.text.loading")(mode),
		component: "",
		status: StatusEnum.Loading,
		steps: getStep(mode),
		render: true,
		client: client !== "undefined" && client !== void 0 ? client : ClientEnum.Merchant,
		warn: "",
		custom: other || {}
	}, typeof net !== "undefined" ? { net } : {}), typeof number !== "undefined" ? { number } : {}), typeof pay !== "undefined" ? { pay } : {}), typeof device !== "undefined" ? { device } : {});
};
//#endregion
export { getAdyenInitState as default };
