import { n as __exportAll } from "./chunk-YKewjYmz.js";
import { A as any, B as url, F as literal, L as object, N as email, P as lazy, R as string, a as BaseDocumentHeaderSchema, b as generateId, c as baseCreateDocument, f as createAction, g as createState, h as createReducer, j as array, l as baseLoadFromInput, o as BaseDocumentStateSchema, s as baseActions, u as baseSaveToFileHandle, v as defaultBaseState, x as isDocumentAction } from "./dist-CdWSQzOH.js";
//#region document-models/project/v1/gen/document-model.ts
const documentModel = {
	id: "rfp-hub/project",
	name: "Project",
	author: {
		name: "Powerhouse",
		website: "https://www.powerhouse.inc/"
	},
	extension: "rfpr",
	description: "DAOIP-5 Project — the applicant's persistent profile ('common application'). Lives in the applicant's own drive and is referenced by grant-application documents.",
	specifications: [{
		state: {
			local: {
				schema: "",
				examples: [],
				initialValue: ""
			},
			global: {
				schema: "type ProjectState {\n  # DAOIP-5 canonical Project fields\n  name: String\n  description: String\n  contentURI: URL\n  email: EmailAddress\n  membersURI: URL\n  attestationIssuersURI: URL\n  relevantTo: [RelevantPool!]!\n  image: URL\n  coverImage: URL\n  licenseURI: URL\n  socials: [ProjectSocial!]!\n  extensions: String\n\n  # schema.org addition\n  sameAs: [URL!]!\n\n  # Hub additions\n  ownerDid: String\n  code: String\n}\n\ntype RelevantPool {\n  id: OID!\n  poolId: PHID!\n  poolName: String!\n}\n\ntype ProjectSocial {\n  id: OID!\n  name: String!\n  value: URL!\n}\n",
				examples: [],
				initialValue: "{\"name\": null, \"description\": null, \"contentURI\": null, \"email\": null, \"membersURI\": null, \"attestationIssuersURI\": null, \"relevantTo\": [], \"image\": null, \"coverImage\": null, \"licenseURI\": null, \"socials\": [], \"extensions\": null, \"sameAs\": [], \"ownerDid\": null, \"code\": null}"
			}
		},
		modules: [
			{
				id: "profile-module",
				name: "profile",
				description: "Core DAOIP-5 project identity fields",
				operations: [
					{
						id: "pr-set-project-name",
						name: "SET_PROJECT_NAME",
						description: "",
						schema: "input SetProjectNameInput {\n    name: String!\n}",
						template: "",
						reducer: "state.name = action.input.name;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-description",
						name: "SET_PROJECT_DESCRIPTION",
						description: "",
						schema: "input SetProjectDescriptionInput {\n    description: String\n}",
						template: "",
						reducer: "state.description = action.input.description || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-content-uri",
						name: "SET_CONTENT_URI",
						description: "",
						schema: "input SetContentUriInput {\n    contentURI: URL\n}",
						template: "",
						reducer: "state.contentURI = action.input.contentURI || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-email",
						name: "SET_PROJECT_EMAIL",
						description: "",
						schema: "input SetProjectEmailInput {\n    email: EmailAddress\n}",
						template: "",
						reducer: "state.email = action.input.email || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-members-uri",
						name: "SET_MEMBERS_URI",
						description: "",
						schema: "input SetMembersUriInput {\n    membersURI: URL\n}",
						template: "",
						reducer: "state.membersURI = action.input.membersURI || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-image",
						name: "SET_PROJECT_IMAGE",
						description: "",
						schema: "input SetProjectImageInput {\n    image: URL\n}",
						template: "",
						reducer: "state.image = action.input.image || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-cover-image",
						name: "SET_PROJECT_COVER_IMAGE",
						description: "",
						schema: "input SetProjectCoverImageInput {\n    coverImage: URL\n}",
						template: "",
						reducer: "state.coverImage = action.input.coverImage || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-license-uri",
						name: "SET_LICENSE_URI",
						description: "",
						schema: "input SetLicenseUriInput {\n    licenseURI: URL\n}",
						template: "",
						reducer: "state.licenseURI = action.input.licenseURI || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-code",
						name: "SET_PROJECT_CODE",
						description: "",
						schema: "input SetProjectCodeInput {\n    code: String\n}",
						template: "",
						reducer: "state.code = action.input.code || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-owner-did",
						name: "SET_OWNER_DID",
						description: "",
						schema: "input SetOwnerDidInput {\n    ownerDid: String!\n}",
						template: "",
						reducer: "state.ownerDid = action.input.ownerDid;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-set-project-extensions",
						name: "SET_PROJECT_EXTENSIONS",
						description: "",
						schema: "input SetProjectExtensionsInput {\n    extensions: String\n}",
						template: "",
						reducer: "state.extensions = action.input.extensions || null;",
						errors: [],
						examples: [],
						scope: "global"
					}
				]
			},
			{
				id: "attestations-module",
				name: "attestations",
				description: "Attestation issuer references",
				operations: [{
					id: "pr-set-attestation-issuers-uri",
					name: "SET_PROJECT_ATTESTATION_ISSUERS_URI",
					description: "",
					schema: "input SetProjectAttestationIssuersUriInput {\n    attestationIssuersURI: URL\n}",
					template: "",
					reducer: "state.attestationIssuersURI = action.input.attestationIssuersURI || null;",
					errors: [],
					examples: [],
					scope: "global"
				}]
			},
			{
				id: "relevance-module",
				name: "relevance",
				description: "Relevant grant pools the project is applying to or interested in",
				operations: [{
					id: "pr-add-relevant-pool",
					name: "ADD_RELEVANT_POOL",
					description: "",
					schema: "input AddRelevantPoolInput {\n    id: OID!\n    poolId: PHID!\n    poolName: String!\n}",
					template: "",
					reducer: "state.relevantTo.push({\n  id: action.input.id,\n  poolId: action.input.poolId,\n  poolName: action.input.poolName,\n});",
					errors: [],
					examples: [],
					scope: "global"
				}, {
					id: "pr-remove-relevant-pool",
					name: "REMOVE_RELEVANT_POOL",
					description: "",
					schema: "input RemoveRelevantPoolInput {\n    id: OID!\n}",
					template: "",
					reducer: "const idx = state.relevantTo.findIndex((r) => r.id === action.input.id);\nif (idx === -1) {\n  throw new RelevantPoolNotFoundError(`Relevant pool ${action.input.id} not found`);\n}\nstate.relevantTo.splice(idx, 1);",
					errors: [{
						id: "err-pr-relevant-pool-not-found",
						name: "RelevantPoolNotFoundError",
						code: "RELEVANT_POOL_NOT_FOUND",
						description: "Relevant pool entry not found.",
						template: ""
					}],
					examples: [],
					scope: "global"
				}]
			},
			{
				id: "links-module",
				name: "links",
				description: "Social media + schema.org identity links",
				operations: [
					{
						id: "pr-add-project-social",
						name: "ADD_PROJECT_SOCIAL",
						description: "",
						schema: "input AddProjectSocialInput {\n    id: OID!\n    name: String!\n    value: URL!\n}",
						template: "",
						reducer: "state.socials.push({\n  id: action.input.id,\n  name: action.input.name,\n  value: action.input.value,\n});",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-remove-project-social",
						name: "REMOVE_PROJECT_SOCIAL",
						description: "",
						schema: "input RemoveProjectSocialInput {\n    id: OID!\n}",
						template: "",
						reducer: "const idx = state.socials.findIndex((s) => s.id === action.input.id);\nif (idx === -1) {\n  throw new ProjectSocialNotFoundError(`Social ${action.input.id} not found`);\n}\nstate.socials.splice(idx, 1);",
						errors: [{
							id: "err-pr-social-not-found-remove",
							name: "ProjectSocialNotFoundError",
							code: "PROJECT_SOCIAL_NOT_FOUND_REMOVE",
							description: "Social entry not found.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-update-project-social-url",
						name: "UPDATE_PROJECT_SOCIAL_URL",
						description: "",
						schema: "input UpdateProjectSocialUrlInput {\n    id: OID!\n    value: URL!\n}",
						template: "",
						reducer: "const s = state.socials.find((x) => x.id === action.input.id);\nif (!s) {\n  throw new ProjectSocialNotFoundError(`Social ${action.input.id} not found`);\n}\ns.value = action.input.value;",
						errors: [{
							id: "err-pr-social-not-found-update",
							name: "ProjectSocialNotFoundUpdateError",
							code: "PROJECT_SOCIAL_NOT_FOUND_UPDATE",
							description: "Social entry not found for update.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-add-project-same-as",
						name: "ADD_PROJECT_SAME_AS",
						description: "",
						schema: "input AddProjectSameAsInput {\n    url: URL!\n}",
						template: "",
						reducer: "if (state.sameAs.includes(action.input.url)) {\n  throw new SameAsAlreadyExistsError(`URL already present`);\n}\nstate.sameAs.push(action.input.url);",
						errors: [{
							id: "err-pr-same-as-exists",
							name: "SameAsAlreadyExistsError",
							code: "SAME_AS_ALREADY_EXISTS_PROJECT",
							description: "URL already in sameAs.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "pr-remove-project-same-as",
						name: "REMOVE_PROJECT_SAME_AS",
						description: "",
						schema: "input RemoveProjectSameAsInput {\n    url: URL!\n}",
						template: "",
						reducer: "const idx = state.sameAs.indexOf(action.input.url);\nif (idx === -1) {\n  throw new SameAsNotFoundError(`URL not found`);\n}\nstate.sameAs.splice(idx, 1);",
						errors: [{
							id: "err-pr-same-as-not-found",
							name: "SameAsNotFoundError",
							code: "SAME_AS_NOT_FOUND_PROJECT",
							description: "URL not in sameAs.",
							template: ""
						}],
						examples: [],
						scope: "global"
					}
				]
			}
		],
		version: 1,
		changeLog: []
	}]
};
//#endregion
//#region document-models/project/v1/src/reducers/profile.ts
const projectProfileOperations = {
	setProjectNameOperation(state, action) {
		state.name = action.input.name;
	},
	setProjectDescriptionOperation(state, action) {
		state.description = action.input.description || null;
	},
	setContentUriOperation(state, action) {
		state.contentURI = action.input.contentURI || null;
	},
	setProjectEmailOperation(state, action) {
		state.email = action.input.email || null;
	},
	setMembersUriOperation(state, action) {
		state.membersURI = action.input.membersURI || null;
	},
	setProjectImageOperation(state, action) {
		state.image = action.input.image || null;
	},
	setProjectCoverImageOperation(state, action) {
		state.coverImage = action.input.coverImage || null;
	},
	setLicenseUriOperation(state, action) {
		state.licenseURI = action.input.licenseURI || null;
	},
	setProjectCodeOperation(state, action) {
		state.code = action.input.code || null;
	},
	setOwnerDidOperation(state, action) {
		state.ownerDid = action.input.ownerDid;
	},
	setProjectExtensionsOperation(state, action) {
		state.extensions = action.input.extensions || null;
	}
};
//#endregion
//#region document-models/project/v1/src/reducers/attestations.ts
const projectAttestationsOperations = { setProjectAttestationIssuersUriOperation(state, action) {
	state.attestationIssuersURI = action.input.attestationIssuersURI || null;
} };
//#endregion
//#region document-models/project/v1/gen/relevance/error.ts
var RelevantPoolNotFoundError = class extends Error {
	errorCode = "RelevantPoolNotFoundError";
	constructor(message = "RelevantPoolNotFoundError") {
		super(message);
	}
};
//#endregion
//#region document-models/project/v1/src/reducers/relevance.ts
const projectRelevanceOperations = {
	addRelevantPoolOperation(state, action) {
		state.relevantTo.push({
			id: action.input.id,
			poolId: action.input.poolId,
			poolName: action.input.poolName
		});
	},
	removeRelevantPoolOperation(state, action) {
		const idx = state.relevantTo.findIndex((r) => r.id === action.input.id);
		if (idx === -1) throw new RelevantPoolNotFoundError(`Relevant pool ${action.input.id} not found`);
		state.relevantTo.splice(idx, 1);
	}
};
//#endregion
//#region document-models/project/v1/gen/links/error.ts
var ProjectSocialNotFoundError = class extends Error {
	errorCode = "ProjectSocialNotFoundError";
	constructor(message = "ProjectSocialNotFoundError") {
		super(message);
	}
};
var SameAsAlreadyExistsError = class extends Error {
	errorCode = "SameAsAlreadyExistsError";
	constructor(message = "SameAsAlreadyExistsError") {
		super(message);
	}
};
var SameAsNotFoundError = class extends Error {
	errorCode = "SameAsNotFoundError";
	constructor(message = "SameAsNotFoundError") {
		super(message);
	}
};
//#endregion
//#region document-models/project/v1/src/reducers/links.ts
const projectLinksOperations = {
	addProjectSocialOperation(state, action) {
		state.socials.push({
			id: action.input.id,
			name: action.input.name,
			value: action.input.value
		});
	},
	removeProjectSocialOperation(state, action) {
		const idx = state.socials.findIndex((s) => s.id === action.input.id);
		if (idx === -1) throw new ProjectSocialNotFoundError(`Social ${action.input.id} not found`);
		state.socials.splice(idx, 1);
	},
	updateProjectSocialUrlOperation(state, action) {
		const s = state.socials.find((x) => x.id === action.input.id);
		if (!s) throw new ProjectSocialNotFoundError(`Social ${action.input.id} not found`);
		s.value = action.input.value;
	},
	addProjectSameAsOperation(state, action) {
		if (state.sameAs.includes(action.input.url)) throw new SameAsAlreadyExistsError(`URL already present`);
		state.sameAs.push(action.input.url);
	},
	removeProjectSameAsOperation(state, action) {
		const idx = state.sameAs.indexOf(action.input.url);
		if (idx === -1) throw new SameAsNotFoundError(`URL not found`);
		state.sameAs.splice(idx, 1);
	}
};
//#endregion
//#region document-models/project/v1/gen/schema/zod.ts
const isDefinedNonNullAny = (v) => v !== void 0 && v !== null;
const definedNonNullAnySchema = any().refine((v) => isDefinedNonNullAny(v));
function AddProjectSameAsInputSchema() {
	return object({ url: url() });
}
function AddProjectSocialInputSchema() {
	return object({
		id: string(),
		name: string(),
		value: url()
	});
}
function AddRelevantPoolInputSchema() {
	return object({
		id: string(),
		poolId: string(),
		poolName: string()
	});
}
function ProjectSocialSchema() {
	return object({
		__typename: literal("ProjectSocial").optional(),
		id: string(),
		name: string(),
		value: url()
	});
}
function ProjectStateSchema() {
	return object({
		__typename: literal("ProjectState").optional(),
		attestationIssuersURI: url().nullish(),
		code: string().nullish(),
		contentURI: url().nullish(),
		coverImage: url().nullish(),
		description: string().nullish(),
		email: email().nullish(),
		extensions: string().nullish(),
		image: url().nullish(),
		licenseURI: url().nullish(),
		membersURI: url().nullish(),
		name: string().nullish(),
		ownerDid: string().nullish(),
		relevantTo: array(lazy(() => RelevantPoolSchema())),
		sameAs: array(url()),
		socials: array(lazy(() => ProjectSocialSchema()))
	});
}
function RelevantPoolSchema() {
	return object({
		__typename: literal("RelevantPool").optional(),
		id: string(),
		poolId: string(),
		poolName: string()
	});
}
function RemoveProjectSameAsInputSchema() {
	return object({ url: url() });
}
function RemoveProjectSocialInputSchema() {
	return object({ id: string() });
}
function RemoveRelevantPoolInputSchema() {
	return object({ id: string() });
}
function SetContentUriInputSchema() {
	return object({ contentURI: url().nullish() });
}
function SetLicenseUriInputSchema() {
	return object({ licenseURI: url().nullish() });
}
function SetMembersUriInputSchema() {
	return object({ membersURI: url().nullish() });
}
function SetOwnerDidInputSchema() {
	return object({ ownerDid: string() });
}
function SetProjectAttestationIssuersUriInputSchema() {
	return object({ attestationIssuersURI: url().nullish() });
}
function SetProjectCodeInputSchema() {
	return object({ code: string().nullish() });
}
function SetProjectCoverImageInputSchema() {
	return object({ coverImage: url().nullish() });
}
function SetProjectDescriptionInputSchema() {
	return object({ description: string().nullish() });
}
function SetProjectEmailInputSchema() {
	return object({ email: email().nullish() });
}
function SetProjectExtensionsInputSchema() {
	return object({ extensions: string().nullish() });
}
function SetProjectImageInputSchema() {
	return object({ image: url().nullish() });
}
function SetProjectNameInputSchema() {
	return object({ name: string() });
}
function UpdateProjectSocialUrlInputSchema() {
	return object({
		id: string(),
		value: url()
	});
}
//#endregion
//#region document-models/project/v1/gen/reducer.ts
const stateReducer = (state, action, dispatch) => {
	if (isDocumentAction(action)) return state;
	switch (action.type) {
		case "SET_PROJECT_NAME":
			SetProjectNameInputSchema().parse(action.input);
			projectProfileOperations.setProjectNameOperation(state[action.scope], action, dispatch);
			break;
		case "SET_PROJECT_DESCRIPTION":
			SetProjectDescriptionInputSchema().parse(action.input);
			projectProfileOperations.setProjectDescriptionOperation(state[action.scope], action, dispatch);
			break;
		case "SET_CONTENT_URI":
			SetContentUriInputSchema().parse(action.input);
			projectProfileOperations.setContentUriOperation(state[action.scope], action, dispatch);
			break;
		case "SET_PROJECT_EMAIL":
			SetProjectEmailInputSchema().parse(action.input);
			projectProfileOperations.setProjectEmailOperation(state[action.scope], action, dispatch);
			break;
		case "SET_MEMBERS_URI":
			SetMembersUriInputSchema().parse(action.input);
			projectProfileOperations.setMembersUriOperation(state[action.scope], action, dispatch);
			break;
		case "SET_PROJECT_IMAGE":
			SetProjectImageInputSchema().parse(action.input);
			projectProfileOperations.setProjectImageOperation(state[action.scope], action, dispatch);
			break;
		case "SET_PROJECT_COVER_IMAGE":
			SetProjectCoverImageInputSchema().parse(action.input);
			projectProfileOperations.setProjectCoverImageOperation(state[action.scope], action, dispatch);
			break;
		case "SET_LICENSE_URI":
			SetLicenseUriInputSchema().parse(action.input);
			projectProfileOperations.setLicenseUriOperation(state[action.scope], action, dispatch);
			break;
		case "SET_PROJECT_CODE":
			SetProjectCodeInputSchema().parse(action.input);
			projectProfileOperations.setProjectCodeOperation(state[action.scope], action, dispatch);
			break;
		case "SET_OWNER_DID":
			SetOwnerDidInputSchema().parse(action.input);
			projectProfileOperations.setOwnerDidOperation(state[action.scope], action, dispatch);
			break;
		case "SET_PROJECT_EXTENSIONS":
			SetProjectExtensionsInputSchema().parse(action.input);
			projectProfileOperations.setProjectExtensionsOperation(state[action.scope], action, dispatch);
			break;
		case "SET_PROJECT_ATTESTATION_ISSUERS_URI":
			SetProjectAttestationIssuersUriInputSchema().parse(action.input);
			projectAttestationsOperations.setProjectAttestationIssuersUriOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_RELEVANT_POOL":
			AddRelevantPoolInputSchema().parse(action.input);
			projectRelevanceOperations.addRelevantPoolOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_RELEVANT_POOL":
			RemoveRelevantPoolInputSchema().parse(action.input);
			projectRelevanceOperations.removeRelevantPoolOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_PROJECT_SOCIAL":
			AddProjectSocialInputSchema().parse(action.input);
			projectLinksOperations.addProjectSocialOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_PROJECT_SOCIAL":
			RemoveProjectSocialInputSchema().parse(action.input);
			projectLinksOperations.removeProjectSocialOperation(state[action.scope], action, dispatch);
			break;
		case "UPDATE_PROJECT_SOCIAL_URL":
			UpdateProjectSocialUrlInputSchema().parse(action.input);
			projectLinksOperations.updateProjectSocialUrlOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_PROJECT_SAME_AS":
			AddProjectSameAsInputSchema().parse(action.input);
			projectLinksOperations.addProjectSameAsOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_PROJECT_SAME_AS":
			RemoveProjectSameAsInputSchema().parse(action.input);
			projectLinksOperations.removeProjectSameAsOperation(state[action.scope], action, dispatch);
			break;
		default: return state;
	}
};
const reducer = createReducer(stateReducer);
//#endregion
//#region document-models/project/v1/gen/profile/creators.ts
var creators_exports$3 = /* @__PURE__ */ __exportAll({
	setContentUri: () => setContentUri,
	setLicenseUri: () => setLicenseUri,
	setMembersUri: () => setMembersUri,
	setOwnerDid: () => setOwnerDid,
	setProjectCode: () => setProjectCode,
	setProjectCoverImage: () => setProjectCoverImage,
	setProjectDescription: () => setProjectDescription,
	setProjectEmail: () => setProjectEmail,
	setProjectExtensions: () => setProjectExtensions,
	setProjectImage: () => setProjectImage,
	setProjectName: () => setProjectName
});
const setProjectName = (input) => createAction("SET_PROJECT_NAME", { ...input }, void 0, SetProjectNameInputSchema, "global");
const setProjectDescription = (input) => createAction("SET_PROJECT_DESCRIPTION", { ...input }, void 0, SetProjectDescriptionInputSchema, "global");
const setContentUri = (input) => createAction("SET_CONTENT_URI", { ...input }, void 0, SetContentUriInputSchema, "global");
const setProjectEmail = (input) => createAction("SET_PROJECT_EMAIL", { ...input }, void 0, SetProjectEmailInputSchema, "global");
const setMembersUri = (input) => createAction("SET_MEMBERS_URI", { ...input }, void 0, SetMembersUriInputSchema, "global");
const setProjectImage = (input) => createAction("SET_PROJECT_IMAGE", { ...input }, void 0, SetProjectImageInputSchema, "global");
const setProjectCoverImage = (input) => createAction("SET_PROJECT_COVER_IMAGE", { ...input }, void 0, SetProjectCoverImageInputSchema, "global");
const setLicenseUri = (input) => createAction("SET_LICENSE_URI", { ...input }, void 0, SetLicenseUriInputSchema, "global");
const setProjectCode = (input) => createAction("SET_PROJECT_CODE", { ...input }, void 0, SetProjectCodeInputSchema, "global");
const setOwnerDid = (input) => createAction("SET_OWNER_DID", { ...input }, void 0, SetOwnerDidInputSchema, "global");
const setProjectExtensions = (input) => createAction("SET_PROJECT_EXTENSIONS", { ...input }, void 0, SetProjectExtensionsInputSchema, "global");
//#endregion
//#region document-models/project/v1/gen/attestations/creators.ts
var creators_exports$2 = /* @__PURE__ */ __exportAll({ setProjectAttestationIssuersUri: () => setProjectAttestationIssuersUri });
const setProjectAttestationIssuersUri = (input) => createAction("SET_PROJECT_ATTESTATION_ISSUERS_URI", { ...input }, void 0, SetProjectAttestationIssuersUriInputSchema, "global");
//#endregion
//#region document-models/project/v1/gen/relevance/creators.ts
var creators_exports$1 = /* @__PURE__ */ __exportAll({
	addRelevantPool: () => addRelevantPool,
	removeRelevantPool: () => removeRelevantPool
});
const addRelevantPool = (input) => createAction("ADD_RELEVANT_POOL", { ...input }, void 0, AddRelevantPoolInputSchema, "global");
const removeRelevantPool = (input) => createAction("REMOVE_RELEVANT_POOL", { ...input }, void 0, RemoveRelevantPoolInputSchema, "global");
//#endregion
//#region document-models/project/v1/gen/links/creators.ts
var creators_exports = /* @__PURE__ */ __exportAll({
	addProjectSameAs: () => addProjectSameAs,
	addProjectSocial: () => addProjectSocial,
	removeProjectSameAs: () => removeProjectSameAs,
	removeProjectSocial: () => removeProjectSocial,
	updateProjectSocialUrl: () => updateProjectSocialUrl
});
const addProjectSocial = (input) => createAction("ADD_PROJECT_SOCIAL", { ...input }, void 0, AddProjectSocialInputSchema, "global");
const removeProjectSocial = (input) => createAction("REMOVE_PROJECT_SOCIAL", { ...input }, void 0, RemoveProjectSocialInputSchema, "global");
const updateProjectSocialUrl = (input) => createAction("UPDATE_PROJECT_SOCIAL_URL", { ...input }, void 0, UpdateProjectSocialUrlInputSchema, "global");
const addProjectSameAs = (input) => createAction("ADD_PROJECT_SAME_AS", { ...input }, void 0, AddProjectSameAsInputSchema, "global");
const removeProjectSameAs = (input) => createAction("REMOVE_PROJECT_SAME_AS", { ...input }, void 0, RemoveProjectSameAsInputSchema, "global");
//#endregion
//#region document-models/project/v1/actions.ts
/** Actions for the Project document model */
const actions = {
	...baseActions,
	...creators_exports$3,
	...creators_exports$2,
	...creators_exports$1,
	...creators_exports
};
//#endregion
//#region document-models/project/v1/gen/document-type.ts
const projectDocumentType = "rfp-hub/project";
//#endregion
//#region document-models/project/v1/gen/document-schema.ts
/** Schema for validating the header object of a Project document */
const ProjectDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: literal(projectDocumentType) });
/** Schema for validating the state object of a Project document */
const ProjectPHStateSchema = BaseDocumentStateSchema.extend({ global: ProjectStateSchema() });
const ProjectDocumentSchema = object({
	header: ProjectDocumentHeaderSchema,
	state: ProjectPHStateSchema,
	initialState: ProjectPHStateSchema
});
/** Simple helper function to check if a state object is a Project document state object */
function isProjectState(state) {
	return ProjectPHStateSchema.safeParse(state).success;
}
/** Simple helper function to assert that a document state object is a Project document state object */
function assertIsProjectState(state) {
	ProjectPHStateSchema.parse(state);
}
/** Simple helper function to check if a document is a Project document */
function isProjectDocument(document) {
	return ProjectDocumentSchema.safeParse(document).success;
}
/** Simple helper function to assert that a document is a Project document */
function assertIsProjectDocument(document) {
	ProjectDocumentSchema.parse(document);
}
//#endregion
//#region document-models/project/v1/gen/utils.ts
const initialGlobalState = {
	name: null,
	description: null,
	contentURI: null,
	email: null,
	membersURI: null,
	attestationIssuersURI: null,
	relevantTo: [],
	image: null,
	coverImage: null,
	licenseURI: null,
	socials: [],
	extensions: null,
	sameAs: [],
	ownerDid: null,
	code: null
};
const initialLocalState = {};
const utils$1 = {
	fileExtension: "rfpr",
	createState(state) {
		return {
			...defaultBaseState(),
			global: {
				...initialGlobalState,
				...state?.global
			},
			local: {
				...initialLocalState,
				...state?.local
			}
		};
	},
	createDocument(state) {
		const document = baseCreateDocument(utils$1.createState, state);
		document.header.documentType = projectDocumentType;
		document.header.id = generateId();
		return document;
	},
	saveToFileHandle(document, input) {
		return baseSaveToFileHandle(document, input);
	},
	loadFromInput(input) {
		return baseLoadFromInput(input, reducer);
	},
	isStateOfType(state) {
		return isProjectState(state);
	},
	assertIsStateOfType(state) {
		return assertIsProjectState(state);
	},
	isDocumentOfType(document) {
		return isProjectDocument(document);
	},
	assertIsDocumentOfType(document) {
		return assertIsProjectDocument(document);
	}
};
//#endregion
//#region document-models/project/v1/src/utils.ts
var utils_exports = /* @__PURE__ */ __exportAll({});
//#endregion
//#region document-models/project/v1/utils.ts
/** Utils for the Project document model */
const utils = {
	...utils$1,
	...utils_exports
};
//#endregion
//#region document-models/project/v1/module.ts
/** Document model module for the Project document type */
const Project = {
	version: 1,
	reducer,
	actions,
	utils,
	documentModel: createState(defaultBaseState(), documentModel)
};
//#endregion
export { SetProjectCodeInputSchema as $, setOwnerDid as A, AddProjectSocialInputSchema as B, removeRelevantPool as C, setContentUri as D, creators_exports$3 as E, setProjectExtensions as F, RemoveProjectSameAsInputSchema as G, ProjectSocialSchema as H, setProjectImage as I, SetContentUriInputSchema as J, RemoveProjectSocialInputSchema as K, setProjectName as L, setProjectCoverImage as M, setProjectDescription as N, setLicenseUri as O, setProjectEmail as P, SetProjectAttestationIssuersUriInputSchema as Q, reducer as R, creators_exports$1 as S, setProjectAttestationIssuersUri as T, ProjectStateSchema as U, AddRelevantPoolInputSchema as V, RelevantPoolSchema as W, SetMembersUriInputSchema as X, SetLicenseUriInputSchema as Y, SetOwnerDidInputSchema as Z, creators_exports as _, utils$1 as a, SetProjectNameInputSchema as at, updateProjectSocialUrl as b, ProjectPHStateSchema as c, isDefinedNonNullAny as ct, isProjectDocument as d, SetProjectCoverImageInputSchema as et, isProjectState as f, addProjectSocial as g, addProjectSameAs as h, initialLocalState as i, SetProjectImageInputSchema as it, setProjectCode as j, setMembersUri as k, assertIsProjectDocument as l, documentModel as lt, actions as m, utils as n, SetProjectEmailInputSchema as nt, ProjectDocumentHeaderSchema as o, UpdateProjectSocialUrlInputSchema as ot, projectDocumentType as p, RemoveRelevantPoolInputSchema as q, initialGlobalState as r, SetProjectExtensionsInputSchema as rt, ProjectDocumentSchema as s, definedNonNullAnySchema as st, Project as t, SetProjectDescriptionInputSchema as tt, assertIsProjectState as u, removeProjectSameAs as v, creators_exports$2 as w, addRelevantPool as x, removeProjectSocial as y, AddProjectSameAsInputSchema as z };

//# sourceMappingURL=module-Cpz1JYVM.js.map