import { p as createBaseState, t as PHDocumentController, v as defaultBaseState } from "./dist-uUUuTqM0.js";
import { a as utils, d as isAccountTransactionsDocument, l as assertIsAccountTransactionsDocument, t as AccountTransactions } from "./module-RiCpyFsE.js";
import { O as useSelectedDocument, _ as useDocumentsInSelectedFolder, g as useDocumentsInSelectedDrive, p as useDocumentById } from "./dist-mx7YTOSV.js";
//#region document-models/account-transactions/v1/gen/ph-factories.ts
function defaultGlobalState() {
	return {
		account: {
			id: "",
			account: "",
			name: "",
			budgetPath: null,
			accountTransactionsId: null,
			chain: null,
			type: null,
			owners: null,
			KycAmlStatus: null
		},
		transactions: [],
		budgets: []
	};
}
function defaultLocalState() {
	return {};
}
function defaultPHState() {
	return {
		...defaultBaseState(),
		global: defaultGlobalState(),
		local: defaultLocalState()
	};
}
function createGlobalState(state) {
	return {
		...defaultGlobalState(),
		...state || {}
	};
}
function createLocalState(state) {
	return {
		...defaultLocalState(),
		...state || {}
	};
}
function createState(baseState, globalState, localState) {
	return {
		...createBaseState(baseState?.auth, baseState?.document),
		global: createGlobalState(globalState),
		local: createLocalState(localState)
	};
}
/**
* Creates a AccountTransactionsDocument with custom global and local state
* This properly handles the PHBaseState requirements while allowing
* document-specific state to be set.
*/
function createAccountTransactionsDocument(state) {
	return utils.createDocument(state ? createState(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
}
//#endregion
//#region document-models/account-transactions/v1/gen/controller.ts
const AccountTransactionsController = PHDocumentController.forDocumentModel(AccountTransactions);
//#endregion
//#region document-models/account-transactions/v1/hooks.ts
/** Hook to get a AccountTransactions document by its id */
function useAccountTransactionsDocumentById(documentId) {
	const [document, dispatch] = useDocumentById(documentId);
	if (!isAccountTransactionsDocument(document)) return [void 0, void 0];
	return [document, dispatch];
}
/** Hook to get the selected AccountTransactions document */
function useSelectedAccountTransactionsDocument() {
	const [document, dispatch] = useSelectedDocument();
	assertIsAccountTransactionsDocument(document);
	return [document, dispatch];
}
/** Hook to get all AccountTransactions documents in the selected drive */
function useAccountTransactionsDocumentsInSelectedDrive() {
	return useDocumentsInSelectedDrive()?.filter(isAccountTransactionsDocument);
}
/** Hook to get all AccountTransactions documents in the selected folder */
function useAccountTransactionsDocumentsInSelectedFolder() {
	return useDocumentsInSelectedFolder()?.filter(isAccountTransactionsDocument);
}
//#endregion
export { AccountTransactionsController as a, defaultGlobalState as c, useSelectedAccountTransactionsDocument as i, defaultLocalState as l, useAccountTransactionsDocumentsInSelectedDrive as n, createAccountTransactionsDocument as o, useAccountTransactionsDocumentsInSelectedFolder as r, createState as s, useAccountTransactionsDocumentById as t, defaultPHState as u };

//# sourceMappingURL=account-transactions-DeAsdH8B.js.map