import { isReactNative as e } from "../constants/vite.constants.mjs";
import { toBigInt as t } from "../functions/utils/amounts.utils.mjs";
import { ethers as n } from "ethers";
import * as r from "poseidon-lite";
import { buildPoseidon as i } from "circomlibjs-hinkal-fork";
//#region libs/shared/common/src/crypto/poseidon.ts
var a = () => {
	let e = (e) => {
		let t = r[`poseidon${e.length}`];
		if (!t) throw Error(`Poseidon: arity ${e.length} not supported (1..16)`);
		return t(e.map((e) => BigInt(e)));
	};
	return e.F = { toString: (e) => BigInt(e).toString() }, e;
}, o = new class {
	poseidon = void 0;
	async init() {
		this.poseidon ||= (console.log("isReactNative PoseidonHolder", e), e ? a() : await i());
	}
	getPoseidon() {
		return this.poseidon;
	}
}();
function s(...e) {
	let n = o.getPoseidon();
	return t(n.F.toString(n(e)));
}
var c = (...e) => {
	let t = o.getPoseidon();
	return n.toBeHex(t.F.toString(t([...e])));
};
//#endregion
export { s as poseidonFunction, c as poseidonHash, o as poseidonHolder };
