import { r as __exportAll } from "./chunk-BSw8zbkd.mjs";
import { A as any, B as url, F as literal, I as number, L as object, M as boolean, N as email, P as lazy, R as string, V as datetime, a as BaseDocumentHeaderSchema, b as generateId, c as baseCreateDocument, f as createAction, g as createState, h as createReducer, j as array, k as _enum, l as baseLoadFromInput, o as BaseDocumentStateSchema, s as baseActions, u as baseSaveToFileHandle, v as defaultBaseState, x as isDocumentAction } from "./dist-CYoGQ6PD.mjs";
//#region document-models/grant-pool/v1/gen/document-model.ts
const documentModel = {
	id: "rfp-hub/grant-pool",
	name: "GrantPool",
	author: {
		name: "Powerhouse",
		website: "https://www.powerhouse.inc/"
	},
	extension: "rfpp",
	description: "DAOIP-5 Grant Pool — a specific funding call (RFP, bounty, QF round, etc.) issued by a Grant System. Supports all 31 DAOIP-5 funding mechanisms.",
	specifications: [{
		state: {
			local: {
				schema: "",
				examples: [],
				initialValue: ""
			},
			global: {
				schema: "type GrantPoolState {\n  # DAOIP-5 canonical (hub added FK to grant-system)\n  grantSystemRef: PHID\n  name: String\n  description: String\n  grantFundingMechanism: FundingMechanism\n  isOpen: Boolean!\n  openDate: DateTime\n  closeDate: DateTime\n  applicationsURI: URL\n  governanceURI: URL\n  attestationIssuersURI: URL\n  requiredCredentials: [String!]!\n  totalGrantPoolSize: [FundingAmount!]!\n  totalGrantPoolSizeInUSD: Amount_Fiat\n  minGrant: [FundingAmount!]!\n  maxGrant: [FundingAmount!]!\n  email: EmailAddress\n  image: URL\n  coverImage: URL\n  extensions: String\n\n  # schema.org addition\n  sameAs: [URL!]!\n\n  # network-admin inspired\n  code: String\n  briefingURI: URL\n  eligibilityCriteria: String\n  evaluationCriteria: String\n  contextDocuments: [ContextDocument!]!\n  reviewers: [Reviewer!]!\n\n  # RFP filter dimensions\n  categories: [String!]!\n  ecosystems: [String!]!\n  tags: [String!]!\n\n  # Richer lifecycle (projects losslessly to DAOIP-5 isOpen)\n  lifecycle: GrantPoolLifecycle!\n\n  # Hub provenance\n  submitter: Submitter\n  publisher: Publisher\n  lastVerifiedAt: DateTime\n  verificationMethod: VerificationMethod\n  verifiedBy: String\n\n  # Hub governance state\n  governanceState: PoolGovernanceState!\n\n  # Lineage\n  supersedes: PHID\n  claimedFromEntry: PHID\n  duplicateOf: PHID\n}\n\nenum FundingMechanism {\n  DIRECT_GRANTS\n  QUADRATIC_FUNDING\n  STREAMING_QUADRATIC_FUNDING\n  RETRO_FUNDING\n  CONVICTION_VOTING\n  SELF_CURATED_REGISTRIES\n  GIFT_CIRCLES\n  SOCIAL_MEDIA_CAPITAL_ALLOCATION\n  FUTARCHY\n  ASSURANCE_CONTRACTS\n  COOKIE_JAR\n  IMPACT_ATTESTATIONS\n  STOKVEL\n  REQUEST_FOR_PROPOSAL\n  DELEGATED_DOMAIN_ALLOCATION\n  EVOLUTIONARY_GRANTS_GAMES\n  DIRECT_TO_CONTRACT_INCENTIVES\n  ANGEL_INVESTMENT\n  DOMINANT_ASSURANCE_CONTRACTS\n  COMMUNITY_CURRENCIES\n  UNIVERSAL_BASIC_INCOME\n  BOUNTIES\n  GNOSIS_SAFE\n  WAQF\n  RANKED_CHOICE_VOTING\n  HONOUR\n  MUTUAL_AID_NETWORKS\n  BONDING_CURVES\n  ZAKAT\n  DECENTRALIZED_VALIDATORS\n  REVNETS\n  OTHER\n}\n\nenum GrantPoolLifecycle {\n  DRAFT\n  REQUEST_FOR_COMMENTS\n  UPCOMING\n  OPEN\n  CLOSED\n  AWARDED\n  NOT_AWARDED\n  CANCELLED\n}\n\nenum PoolGovernanceState {\n  PENDING\n  UNDER_REVIEW\n  APPROVED\n  REJECTED\n  DISPUTED\n  SUPERSEDED\n}\n\nenum SubmitterType {\n  COMMUNITY\n  VERIFIED_PUBLISHER\n  AUTOMATION\n}\n\nenum VerificationMethod {\n  MANUAL_REVIEW\n  DOMAIN_VERIFICATION\n  HTTP_PROBE\n  REVIEWER_CONFIRMATION\n}\n\nenum ReviewerScope {\n  INTERNAL\n  EXTERNAL\n}\n\nenum ReviewerType {\n  HUMAN\n  GROUP\n  AI\n}\n\ntype Submitter {\n  type: SubmitterType!\n  identifier: String!\n  submittedAt: DateTime!\n}\n\ntype Publisher {\n  identifier: String!\n  publishedAt: DateTime!\n}\n\ntype FundingAmount {\n  id: OID!\n  amount: Amount!\n}\n\ntype ContextDocument {\n  id: OID!\n  name: String!\n  url: URL!\n}\n\ntype Reviewer {\n  id: OID!\n  did: String!\n  scope: ReviewerScope!\n  reviewerType: ReviewerType!\n  name: String!\n}\n",
				examples: [],
				initialValue: "{\"grantSystemRef\": null, \"name\": null, \"description\": null, \"grantFundingMechanism\": null, \"isOpen\": false, \"openDate\": null, \"closeDate\": null, \"applicationsURI\": null, \"governanceURI\": null, \"attestationIssuersURI\": null, \"requiredCredentials\": [], \"totalGrantPoolSize\": [], \"totalGrantPoolSizeInUSD\": null, \"minGrant\": [], \"maxGrant\": [], \"email\": null, \"image\": null, \"coverImage\": null, \"extensions\": null, \"sameAs\": [], \"code\": null, \"briefingURI\": null, \"eligibilityCriteria\": null, \"evaluationCriteria\": null, \"contextDocuments\": [], \"reviewers\": [], \"categories\": [], \"ecosystems\": [], \"tags\": [], \"lifecycle\": \"DRAFT\", \"submitter\": null, \"publisher\": null, \"lastVerifiedAt\": null, \"verificationMethod\": null, \"verifiedBy\": null, \"governanceState\": \"PENDING\", \"supersedes\": null, \"claimedFromEntry\": null, \"duplicateOf\": null}"
			}
		},
		modules: [
			{
				id: "metadata-module",
				name: "metadata",
				description: "Name, descriptors, branding, references",
				operations: [
					{
						id: "gp-set-pool-name",
						name: "SET_POOL_NAME",
						description: "",
						schema: "input SetPoolNameInput {\n    name: String!\n}",
						template: "",
						reducer: "state.name = action.input.name;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-description",
						name: "SET_DESCRIPTION",
						description: "",
						schema: "input SetDescriptionInput {\n    description: String\n}",
						template: "",
						reducer: "state.description = action.input.description || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-code",
						name: "SET_CODE",
						description: "",
						schema: "input SetCodeInput {\n    code: String\n}",
						template: "",
						reducer: "state.code = action.input.code || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-grant-system-ref",
						name: "SET_GRANT_SYSTEM_REF",
						description: "",
						schema: "input SetGrantSystemRefInput {\n    grantSystemRef: PHID!\n}",
						template: "",
						reducer: "state.grantSystemRef = action.input.grantSystemRef;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-briefing-uri",
						name: "SET_BRIEFING_URI",
						description: "",
						schema: "input SetBriefingUriInput {\n    briefingURI: URL\n}",
						template: "",
						reducer: "state.briefingURI = action.input.briefingURI || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-eligibility-criteria",
						name: "SET_ELIGIBILITY_CRITERIA",
						description: "",
						schema: "input SetEligibilityCriteriaInput {\n    eligibilityCriteria: String\n}",
						template: "",
						reducer: "state.eligibilityCriteria = action.input.eligibilityCriteria || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-evaluation-criteria",
						name: "SET_EVALUATION_CRITERIA",
						description: "",
						schema: "input SetEvaluationCriteriaInput {\n    evaluationCriteria: String\n}",
						template: "",
						reducer: "state.evaluationCriteria = action.input.evaluationCriteria || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-pool-email",
						name: "SET_POOL_EMAIL",
						description: "",
						schema: "input SetPoolEmailInput {\n    email: EmailAddress\n}",
						template: "",
						reducer: "state.email = action.input.email || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-pool-image",
						name: "SET_POOL_IMAGE",
						description: "",
						schema: "input SetPoolImageInput {\n    image: URL\n}",
						template: "",
						reducer: "state.image = action.input.image || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-pool-cover-image",
						name: "SET_POOL_COVER_IMAGE",
						description: "",
						schema: "input SetPoolCoverImageInput {\n    coverImage: URL\n}",
						template: "",
						reducer: "state.coverImage = action.input.coverImage || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-pool-extensions",
						name: "SET_POOL_EXTENSIONS",
						description: "",
						schema: "input SetPoolExtensionsInput {\n    extensions: String\n}",
						template: "",
						reducer: "state.extensions = action.input.extensions || null;",
						errors: [],
						examples: [],
						scope: "global"
					}
				]
			},
			{
				id: "funding-module",
				name: "funding",
				description: "Funding mechanism, pool size, grant bounds",
				operations: [
					{
						id: "gp-set-funding-mechanism",
						name: "SET_FUNDING_MECHANISM",
						description: "",
						schema: "input SetFundingMechanismInput {\n    grantFundingMechanism: FundingMechanism!\n}",
						template: "",
						reducer: "state.grantFundingMechanism = action.input.grantFundingMechanism;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-add-pool-size-entry",
						name: "ADD_POOL_SIZE_ENTRY",
						description: "",
						schema: "input AddPoolSizeEntryInput {\n    id: OID!\n    amount: Amount!\n}",
						template: "",
						reducer: "state.totalGrantPoolSize.push({\n  id: action.input.id,\n  amount: action.input.amount,\n});",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-remove-pool-size-entry",
						name: "REMOVE_POOL_SIZE_ENTRY",
						description: "",
						schema: "input RemovePoolSizeEntryInput {\n    id: OID!\n}",
						template: "",
						reducer: "const idx = state.totalGrantPoolSize.findIndex((e) => e.id === action.input.id);\nif (idx === -1) {\n  throw new FundingAmountNotFoundError(`Pool size entry ${action.input.id} not found`);\n}\nstate.totalGrantPoolSize.splice(idx, 1);",
						errors: [{
							id: "err-gp-funding-not-found",
							name: "FundingAmountNotFoundError",
							code: "FUNDING_AMOUNT_NOT_FOUND",
							description: "Funding amount entry not found in list.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-total-pool-size-usd",
						name: "SET_TOTAL_POOL_SIZE_USD",
						description: "",
						schema: "input SetTotalPoolSizeUsdInput {\n    totalGrantPoolSizeInUSD: Amount_Fiat\n}",
						template: "",
						reducer: "state.totalGrantPoolSizeInUSD = action.input.totalGrantPoolSizeInUSD || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-grant-bounds",
						name: "SET_GRANT_BOUNDS",
						description: "",
						schema: "input SetGrantBoundsInput {\n    minGrantId1: OID!\n    minGrantAmount1: Amount\n    maxGrantId1: OID!\n    maxGrantAmount1: Amount\n}",
						template: "",
						reducer: "state.minGrant = [{ id: action.input.minGrantId1, amount: action.input.minGrantAmount1 }];\nstate.maxGrant = [{ id: action.input.maxGrantId1, amount: action.input.maxGrantAmount1 }];",
						errors: [],
						examples: [],
						scope: "global"
					}
				]
			},
			{
				id: "schedule-module",
				name: "schedule",
				description: "Timing + lifecycle advancement",
				operations: [
					{
						id: "gp-set-open-date",
						name: "SET_OPEN_DATE",
						description: "",
						schema: "input SetOpenDateInput {\n    openDate: DateTime\n}",
						template: "",
						reducer: "state.openDate = action.input.openDate || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-close-date",
						name: "SET_CLOSE_DATE",
						description: "",
						schema: "input SetCloseDateInput {\n    closeDate: DateTime\n}",
						template: "",
						reducer: "state.closeDate = action.input.closeDate || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-is-open",
						name: "SET_IS_OPEN",
						description: "",
						schema: "input SetIsOpenInput {\n    isOpen: Boolean!\n}",
						template: "",
						reducer: "state.isOpen = action.input.isOpen;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-advance-lifecycle",
						name: "ADVANCE_LIFECYCLE",
						description: "",
						schema: "input AdvanceLifecycleInput {\n    lifecycle: GrantPoolLifecycle!\n}",
						template: "",
						reducer: "const current = state.lifecycle;\nconst target = action.input.lifecycle;\nconst legal = {\n  DRAFT: [\"REQUEST_FOR_COMMENTS\", \"UPCOMING\", \"OPEN\", \"CANCELLED\"],\n  REQUEST_FOR_COMMENTS: [\"UPCOMING\", \"OPEN\", \"CANCELLED\"],\n  UPCOMING: [\"OPEN\", \"CANCELLED\"],\n  OPEN: [\"CLOSED\", \"CANCELLED\"],\n  CLOSED: [\"AWARDED\", \"NOT_AWARDED\"],\n  AWARDED: [],\n  NOT_AWARDED: [],\n  CANCELLED: [],\n};\nif (!legal[current] || !legal[current].includes(target)) {\n  throw new InvalidLifecycleTransitionError(\n    `Cannot transition from ${current} to ${target}`\n  );\n}\nstate.lifecycle = target;\nif (target === \"OPEN\") state.isOpen = true;\nif (target === \"CLOSED\" || target === \"AWARDED\" || target === \"NOT_AWARDED\" || target === \"CANCELLED\") {\n  state.isOpen = false;\n}",
						errors: [{
							id: "err-gp-invalid-lifecycle-advance",
							name: "InvalidLifecycleTransitionError",
							code: "INVALID_LIFECYCLE_TRANSITION",
							description: "Invalid lifecycle state transition.",
							template: ""
						}],
						examples: [],
						scope: "global"
					}
				]
			},
			{
				id: "classification-module",
				name: "classification",
				description: "Categories, ecosystems, tags for filtering",
				operations: [
					{
						id: "gp-add-category",
						name: "ADD_CATEGORY",
						description: "",
						schema: "input AddCategoryInput {\n    category: String!\n}",
						template: "",
						reducer: "if (state.categories.includes(action.input.category)) {\n  throw new DuplicateCategoryError(`Category ${action.input.category} already present`);\n}\nstate.categories.push(action.input.category);",
						errors: [{
							id: "err-gp-duplicate-category",
							name: "DuplicateCategoryError",
							code: "DUPLICATE_CATEGORY",
							description: "Category already present.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-remove-category",
						name: "REMOVE_CATEGORY",
						description: "",
						schema: "input RemoveCategoryInput {\n    category: String!\n}",
						template: "",
						reducer: "const idx = state.categories.indexOf(action.input.category);\nif (idx === -1) {\n  throw new CategoryNotFoundError(`Category ${action.input.category} not found`);\n}\nstate.categories.splice(idx, 1);",
						errors: [{
							id: "err-gp-category-not-found",
							name: "CategoryNotFoundError",
							code: "CATEGORY_NOT_FOUND",
							description: "Category not found.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-add-ecosystem",
						name: "ADD_ECOSYSTEM",
						description: "",
						schema: "input AddEcosystemInput {\n    ecosystem: String!\n}",
						template: "",
						reducer: "if (state.ecosystems.includes(action.input.ecosystem)) {\n  throw new DuplicateEcosystemError(`Ecosystem ${action.input.ecosystem} already present`);\n}\nstate.ecosystems.push(action.input.ecosystem);",
						errors: [{
							id: "err-gp-duplicate-ecosystem",
							name: "DuplicateEcosystemError",
							code: "DUPLICATE_ECOSYSTEM",
							description: "Ecosystem already present.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-remove-ecosystem",
						name: "REMOVE_ECOSYSTEM",
						description: "",
						schema: "input RemoveEcosystemInput {\n    ecosystem: String!\n}",
						template: "",
						reducer: "const idx = state.ecosystems.indexOf(action.input.ecosystem);\nif (idx === -1) {\n  throw new EcosystemNotFoundError(`Ecosystem ${action.input.ecosystem} not found`);\n}\nstate.ecosystems.splice(idx, 1);",
						errors: [{
							id: "err-gp-ecosystem-not-found",
							name: "EcosystemNotFoundError",
							code: "ECOSYSTEM_NOT_FOUND",
							description: "Ecosystem not found.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-add-tag",
						name: "ADD_TAG",
						description: "",
						schema: "input AddTagInput {\n    tag: String!\n}",
						template: "",
						reducer: "if (state.tags.includes(action.input.tag)) {\n  throw new DuplicateTagError(`Tag ${action.input.tag} already present`);\n}\nstate.tags.push(action.input.tag);",
						errors: [{
							id: "err-gp-duplicate-tag",
							name: "DuplicateTagError",
							code: "DUPLICATE_TAG",
							description: "Tag already present.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-remove-tag",
						name: "REMOVE_TAG",
						description: "",
						schema: "input RemoveTagInput {\n    tag: String!\n}",
						template: "",
						reducer: "const idx = state.tags.indexOf(action.input.tag);\nif (idx === -1) {\n  throw new TagNotFoundError(`Tag ${action.input.tag} not found`);\n}\nstate.tags.splice(idx, 1);",
						errors: [{
							id: "err-gp-tag-not-found",
							name: "TagNotFoundError",
							code: "TAG_NOT_FOUND",
							description: "Tag not found.",
							template: ""
						}],
						examples: [],
						scope: "global"
					}
				]
			},
			{
				id: "resources-module",
				name: "resources",
				description: "Linked URIs, credentials, context docs, sameAs",
				operations: [
					{
						id: "gp-set-governance-uri",
						name: "SET_GOVERNANCE_URI",
						description: "",
						schema: "input SetGovernanceUriInput {\n    governanceURI: URL\n}",
						template: "",
						reducer: "state.governanceURI = action.input.governanceURI || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-applications-uri",
						name: "SET_APPLICATIONS_URI",
						description: "",
						schema: "input SetApplicationsUriInput {\n    applicationsURI: URL\n}",
						template: "",
						reducer: "state.applicationsURI = action.input.applicationsURI || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-attestation-issuers-uri",
						name: "SET_ATTESTATION_ISSUERS_URI",
						description: "",
						schema: "input SetAttestationIssuersUriInput {\n    attestationIssuersURI: URL\n}",
						template: "",
						reducer: "state.attestationIssuersURI = action.input.attestationIssuersURI || null;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-add-required-credential",
						name: "ADD_REQUIRED_CREDENTIAL",
						description: "",
						schema: "input AddRequiredCredentialInput {\n    credential: String!\n}",
						template: "",
						reducer: "if (state.requiredCredentials.includes(action.input.credential)) {\n  throw new DuplicateCredentialError(`Credential ${action.input.credential} already required`);\n}\nstate.requiredCredentials.push(action.input.credential);",
						errors: [{
							id: "err-gp-duplicate-credential",
							name: "DuplicateCredentialError",
							code: "DUPLICATE_CREDENTIAL",
							description: "Credential already required.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-remove-required-credential",
						name: "REMOVE_REQUIRED_CREDENTIAL",
						description: "",
						schema: "input RemoveRequiredCredentialInput {\n    credential: String!\n}",
						template: "",
						reducer: "const idx = state.requiredCredentials.indexOf(action.input.credential);\nif (idx === -1) {\n  throw new CredentialNotFoundError(`Credential ${action.input.credential} not found`);\n}\nstate.requiredCredentials.splice(idx, 1);",
						errors: [{
							id: "err-gp-credential-not-found",
							name: "CredentialNotFoundError",
							code: "CREDENTIAL_NOT_FOUND",
							description: "Credential not found.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-add-context-document",
						name: "ADD_CONTEXT_DOCUMENT",
						description: "",
						schema: "input AddContextDocumentInput {\n    id: OID!\n    name: String!\n    url: URL!\n}",
						template: "",
						reducer: "state.contextDocuments.push({\n  id: action.input.id,\n  name: action.input.name,\n  url: action.input.url,\n});",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-remove-context-document",
						name: "REMOVE_CONTEXT_DOCUMENT",
						description: "",
						schema: "input RemoveContextDocumentInput {\n    id: OID!\n}",
						template: "",
						reducer: "const idx = state.contextDocuments.findIndex((d) => d.id === action.input.id);\nif (idx === -1) {\n  throw new ContextDocumentNotFoundError(`Context document ${action.input.id} not found`);\n}\nstate.contextDocuments.splice(idx, 1);",
						errors: [{
							id: "err-gp-ctx-doc-not-found",
							name: "ContextDocumentNotFoundError",
							code: "CONTEXT_DOC_NOT_FOUND",
							description: "Context document not found.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-add-pool-same-as",
						name: "ADD_POOL_SAME_AS",
						description: "",
						schema: "input AddPoolSameAsInput {\n    url: URL!\n}",
						template: "",
						reducer: "if (state.sameAs.includes(action.input.url)) {\n  throw new SameAsAlreadyExistsError(`URL already in sameAs list`);\n}\nstate.sameAs.push(action.input.url);",
						errors: [{
							id: "err-gp-same-as-exists",
							name: "SameAsAlreadyExistsError",
							code: "SAME_AS_ALREADY_EXISTS_POOL",
							description: "URL already in sameAs list.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-remove-pool-same-as",
						name: "REMOVE_POOL_SAME_AS",
						description: "",
						schema: "input RemovePoolSameAsInput {\n    url: URL!\n}",
						template: "",
						reducer: "const idx = state.sameAs.indexOf(action.input.url);\nif (idx === -1) {\n  throw new SameAsNotFoundError(`URL not in sameAs list`);\n}\nstate.sameAs.splice(idx, 1);",
						errors: [{
							id: "err-gp-same-as-not-found",
							name: "SameAsNotFoundError",
							code: "SAME_AS_NOT_FOUND_POOL",
							description: "URL not in sameAs list.",
							template: ""
						}],
						examples: [],
						scope: "global"
					}
				]
			},
			{
				id: "reviewers-module",
				name: "reviewers",
				description: "Invited reviewers (internal/external, human/AI)",
				operations: [{
					id: "gp-add-reviewer",
					name: "ADD_REVIEWER",
					description: "",
					schema: "input AddReviewerInput {\n    id: OID!\n    did: String!\n    scope: ReviewerScope!\n    reviewerType: ReviewerType!\n    name: String!\n}",
					template: "",
					reducer: "state.reviewers.push({\n  id: action.input.id,\n  did: action.input.did,\n  scope: action.input.scope,\n  reviewerType: action.input.reviewerType,\n  name: action.input.name,\n});",
					errors: [],
					examples: [],
					scope: "global"
				}, {
					id: "gp-remove-reviewer",
					name: "REMOVE_REVIEWER",
					description: "",
					schema: "input RemoveReviewerInput {\n    id: OID!\n}",
					template: "",
					reducer: "const idx = state.reviewers.findIndex((r) => r.id === action.input.id);\nif (idx === -1) {\n  throw new ReviewerNotFoundError(`Reviewer ${action.input.id} not found`);\n}\nstate.reviewers.splice(idx, 1);",
					errors: [{
						id: "err-gp-reviewer-not-found",
						name: "ReviewerNotFoundError",
						code: "REVIEWER_NOT_FOUND",
						description: "Reviewer not found.",
						template: ""
					}],
					examples: [],
					scope: "global"
				}]
			},
			{
				id: "governance-module",
				name: "governance",
				description: "Submitter, publisher, verification, publish/close/cancel",
				operations: [
					{
						id: "gp-set-submitter",
						name: "SET_SUBMITTER",
						description: "",
						schema: "input SetSubmitterInput {\n    type: SubmitterType!\n    identifier: String!\n    submittedAt: DateTime!\n}",
						template: "",
						reducer: "state.submitter = {\n  type: action.input.type,\n  identifier: action.input.identifier,\n  submittedAt: action.input.submittedAt,\n};",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-publisher",
						name: "SET_PUBLISHER",
						description: "",
						schema: "input SetPublisherInput {\n    identifier: String!\n    publishedAt: DateTime!\n}",
						template: "",
						reducer: "state.publisher = {\n  identifier: action.input.identifier,\n  publishedAt: action.input.publishedAt,\n};",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-record-verification",
						name: "RECORD_VERIFICATION",
						description: "",
						schema: "input RecordVerificationInput {\n    verifiedBy: String!\n    verificationMethod: VerificationMethod!\n    verifiedAt: DateTime!\n}",
						template: "",
						reducer: "state.verifiedBy = action.input.verifiedBy;\nstate.verificationMethod = action.input.verificationMethod;\nstate.lastVerifiedAt = action.input.verifiedAt;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-publish-pool",
						name: "PUBLISH_POOL",
						description: "",
						schema: "input PublishPoolInput {\n    publishedAt: DateTime!\n}",
						template: "",
						reducer: "if (state.governanceState === \"APPROVED\") {\n  throw new AlreadyPublishedError(`Pool already published`);\n}\nstate.governanceState = \"APPROVED\";\nif (state.lifecycle === \"DRAFT\") state.lifecycle = \"UPCOMING\";",
						errors: [{
							id: "err-gp-already-published",
							name: "AlreadyPublishedError",
							code: "POOL_ALREADY_PUBLISHED",
							description: "Pool already published.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-close-pool",
						name: "CLOSE_POOL",
						description: "",
						schema: "input ClosePoolInput {\n    closedAt: DateTime!\n}",
						template: "",
						reducer: "if (state.lifecycle !== \"OPEN\") {\n  throw new InvalidLifecycleTransitionError(`Cannot close pool unless OPEN`);\n}\nstate.lifecycle = \"CLOSED\";\nstate.isOpen = false;",
						errors: [{
							id: "err-gp-close-wrong-state",
							name: "InvalidCloseStateError",
							code: "INVALID_CLOSE_STATE",
							description: "Cannot close pool unless lifecycle is OPEN.",
							template: ""
						}],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-cancel-pool",
						name: "CANCEL_POOL",
						description: "",
						schema: "input CancelPoolInput {\n    cancelledAt: DateTime!\n    reason: String\n}",
						template: "",
						reducer: "state.lifecycle = \"CANCELLED\";\nstate.isOpen = false;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-set-governance-state",
						name: "SET_GOVERNANCE_STATE",
						description: "",
						schema: "input SetGovernanceStateInput {\n    governanceState: PoolGovernanceState!\n}",
						template: "",
						reducer: "state.governanceState = action.input.governanceState;",
						errors: [],
						examples: [],
						scope: "global"
					}
				]
			},
			{
				id: "lineage-module",
				name: "lineage",
				description: "Supersedes, claim, duplicate tracking",
				operations: [
					{
						id: "gp-mark-supersedes",
						name: "MARK_SUPERSEDES",
						description: "",
						schema: "input MarkSupersedesInput {\n    supersedes: PHID!\n}",
						template: "",
						reducer: "state.supersedes = action.input.supersedes;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-mark-claimed-from-entry",
						name: "MARK_CLAIMED_FROM_ENTRY",
						description: "",
						schema: "input MarkClaimedFromEntryInput {\n    claimedFromEntry: PHID!\n}",
						template: "",
						reducer: "state.claimedFromEntry = action.input.claimedFromEntry;",
						errors: [],
						examples: [],
						scope: "global"
					},
					{
						id: "gp-mark-duplicate-of",
						name: "MARK_DUPLICATE_OF",
						description: "",
						schema: "input MarkDuplicateOfInput {\n    duplicateOf: PHID!\n}",
						template: "",
						reducer: "state.duplicateOf = action.input.duplicateOf;",
						errors: [],
						examples: [],
						scope: "global"
					}
				]
			}
		],
		version: 1,
		changeLog: []
	}]
};
//#endregion
//#region document-models/grant-pool/v1/src/reducers/metadata.ts
const grantPoolMetadataOperations = {
	setPoolNameOperation(state, action) {
		state.name = action.input.name;
	},
	setDescriptionOperation(state, action) {
		state.description = action.input.description || null;
	},
	setCodeOperation(state, action) {
		state.code = action.input.code || null;
	},
	setGrantSystemRefOperation(state, action) {
		state.grantSystemRef = action.input.grantSystemRef;
	},
	setBriefingUriOperation(state, action) {
		state.briefingURI = action.input.briefingURI || null;
	},
	setEligibilityCriteriaOperation(state, action) {
		state.eligibilityCriteria = action.input.eligibilityCriteria || null;
	},
	setEvaluationCriteriaOperation(state, action) {
		state.evaluationCriteria = action.input.evaluationCriteria || null;
	},
	setPoolEmailOperation(state, action) {
		state.email = action.input.email || null;
	},
	setPoolImageOperation(state, action) {
		state.image = action.input.image || null;
	},
	setPoolCoverImageOperation(state, action) {
		state.coverImage = action.input.coverImage || null;
	},
	setPoolExtensionsOperation(state, action) {
		state.extensions = action.input.extensions || null;
	}
};
//#endregion
//#region document-models/grant-pool/v1/src/reducers/funding.ts
const grantPoolFundingOperations = {
	setFundingMechanismOperation(state, action) {
		state.grantFundingMechanism = action.input.grantFundingMechanism;
	},
	addPoolSizeEntryOperation(state, action) {
		state.totalGrantPoolSize.push({
			id: action.input.id,
			amount: action.input.amount
		});
	},
	removePoolSizeEntryOperation(state, action) {
		const idx = state.totalGrantPoolSize.findIndex((e) => e.id === action.input.id);
		if (idx === -1) throw new Error(`Pool size entry ${action.input.id} not found`);
		state.totalGrantPoolSize.splice(idx, 1);
	},
	setTotalPoolSizeUsdOperation(state, action) {
		state.totalGrantPoolSizeInUSD = action.input.totalGrantPoolSizeInUSD || null;
	},
	setGrantBoundsOperation(state, action) {
		state.minGrant = [{
			id: action.input.minGrantId1,
			amount: action.input.minGrantAmount1 ?? {
				value: void 0,
				unit: void 0
			}
		}];
		state.maxGrant = [{
			id: action.input.maxGrantId1,
			amount: action.input.maxGrantAmount1 ?? {
				value: void 0,
				unit: void 0
			}
		}];
	}
};
//#endregion
//#region document-models/grant-pool/v1/src/reducers/schedule.ts
const grantPoolScheduleOperations = {
	setOpenDateOperation(state, action) {
		state.openDate = action.input.openDate || null;
	},
	setCloseDateOperation(state, action) {
		state.closeDate = action.input.closeDate || null;
	},
	setIsOpenOperation(state, action) {
		state.isOpen = action.input.isOpen;
	},
	advanceLifecycleOperation(state, action) {
		const current = state.lifecycle;
		const target = action.input.lifecycle;
		const legal = {
			DRAFT: [
				"REQUEST_FOR_COMMENTS",
				"UPCOMING",
				"OPEN",
				"CANCELLED"
			],
			REQUEST_FOR_COMMENTS: [
				"UPCOMING",
				"OPEN",
				"CANCELLED"
			],
			UPCOMING: ["OPEN", "CANCELLED"],
			OPEN: ["CLOSED", "CANCELLED"],
			CLOSED: ["AWARDED", "NOT_AWARDED"],
			AWARDED: [],
			NOT_AWARDED: [],
			CANCELLED: []
		};
		if (!legal[current] || !legal[current].includes(target)) throw new Error(`Cannot transition from ${current} to ${target}`);
		state.lifecycle = target;
		if (target === "OPEN") state.isOpen = true;
		if (target === "CLOSED" || target === "AWARDED" || target === "NOT_AWARDED" || target === "CANCELLED") state.isOpen = false;
	}
};
//#endregion
//#region document-models/grant-pool/v1/gen/classification/error.ts
var DuplicateCategoryError = class extends Error {
	errorCode = "DuplicateCategoryError";
	constructor(message = "DuplicateCategoryError") {
		super(message);
	}
};
var CategoryNotFoundError = class extends Error {
	errorCode = "CategoryNotFoundError";
	constructor(message = "CategoryNotFoundError") {
		super(message);
	}
};
var DuplicateEcosystemError = class extends Error {
	errorCode = "DuplicateEcosystemError";
	constructor(message = "DuplicateEcosystemError") {
		super(message);
	}
};
var EcosystemNotFoundError = class extends Error {
	errorCode = "EcosystemNotFoundError";
	constructor(message = "EcosystemNotFoundError") {
		super(message);
	}
};
var DuplicateTagError = class extends Error {
	errorCode = "DuplicateTagError";
	constructor(message = "DuplicateTagError") {
		super(message);
	}
};
var TagNotFoundError = class extends Error {
	errorCode = "TagNotFoundError";
	constructor(message = "TagNotFoundError") {
		super(message);
	}
};
//#endregion
//#region document-models/grant-pool/v1/src/reducers/classification.ts
const grantPoolClassificationOperations = {
	addCategoryOperation(state, action) {
		if (state.categories.includes(action.input.category)) throw new DuplicateCategoryError(`Category ${action.input.category} already present`);
		state.categories.push(action.input.category);
	},
	removeCategoryOperation(state, action) {
		const idx = state.categories.indexOf(action.input.category);
		if (idx === -1) throw new CategoryNotFoundError(`Category ${action.input.category} not found`);
		state.categories.splice(idx, 1);
	},
	addEcosystemOperation(state, action) {
		if (state.ecosystems.includes(action.input.ecosystem)) throw new DuplicateEcosystemError(`Ecosystem ${action.input.ecosystem} already present`);
		state.ecosystems.push(action.input.ecosystem);
	},
	removeEcosystemOperation(state, action) {
		const idx = state.ecosystems.indexOf(action.input.ecosystem);
		if (idx === -1) throw new EcosystemNotFoundError(`Ecosystem ${action.input.ecosystem} not found`);
		state.ecosystems.splice(idx, 1);
	},
	addTagOperation(state, action) {
		if (state.tags.includes(action.input.tag)) throw new DuplicateTagError(`Tag ${action.input.tag} already present`);
		state.tags.push(action.input.tag);
	},
	removeTagOperation(state, action) {
		const idx = state.tags.indexOf(action.input.tag);
		if (idx === -1) throw new TagNotFoundError(`Tag ${action.input.tag} not found`);
		state.tags.splice(idx, 1);
	}
};
//#endregion
//#region document-models/grant-pool/v1/gen/resources/error.ts
var DuplicateCredentialError = class extends Error {
	errorCode = "DuplicateCredentialError";
	constructor(message = "DuplicateCredentialError") {
		super(message);
	}
};
var CredentialNotFoundError = class extends Error {
	errorCode = "CredentialNotFoundError";
	constructor(message = "CredentialNotFoundError") {
		super(message);
	}
};
var ContextDocumentNotFoundError = class extends Error {
	errorCode = "ContextDocumentNotFoundError";
	constructor(message = "ContextDocumentNotFoundError") {
		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/grant-pool/v1/src/reducers/resources.ts
const grantPoolResourcesOperations = {
	setGovernanceUriOperation(state, action) {
		state.governanceURI = action.input.governanceURI || null;
	},
	setApplicationsUriOperation(state, action) {
		state.applicationsURI = action.input.applicationsURI || null;
	},
	setAttestationIssuersUriOperation(state, action) {
		state.attestationIssuersURI = action.input.attestationIssuersURI || null;
	},
	addRequiredCredentialOperation(state, action) {
		if (state.requiredCredentials.includes(action.input.credential)) throw new DuplicateCredentialError(`Credential ${action.input.credential} already required`);
		state.requiredCredentials.push(action.input.credential);
	},
	removeRequiredCredentialOperation(state, action) {
		const idx = state.requiredCredentials.indexOf(action.input.credential);
		if (idx === -1) throw new CredentialNotFoundError(`Credential ${action.input.credential} not found`);
		state.requiredCredentials.splice(idx, 1);
	},
	addContextDocumentOperation(state, action) {
		state.contextDocuments.push({
			id: action.input.id,
			name: action.input.name,
			url: action.input.url
		});
	},
	removeContextDocumentOperation(state, action) {
		const idx = state.contextDocuments.findIndex((d) => d.id === action.input.id);
		if (idx === -1) throw new ContextDocumentNotFoundError(`Context document ${action.input.id} not found`);
		state.contextDocuments.splice(idx, 1);
	},
	addPoolSameAsOperation(state, action) {
		if (state.sameAs.includes(action.input.url)) throw new SameAsAlreadyExistsError(`URL already in sameAs list`);
		state.sameAs.push(action.input.url);
	},
	removePoolSameAsOperation(state, action) {
		const idx = state.sameAs.indexOf(action.input.url);
		if (idx === -1) throw new SameAsNotFoundError(`URL not in sameAs list`);
		state.sameAs.splice(idx, 1);
	}
};
//#endregion
//#region document-models/grant-pool/v1/gen/reviewers/error.ts
var ReviewerNotFoundError = class extends Error {
	errorCode = "ReviewerNotFoundError";
	constructor(message = "ReviewerNotFoundError") {
		super(message);
	}
};
//#endregion
//#region document-models/grant-pool/v1/src/reducers/reviewers.ts
const grantPoolReviewersOperations = {
	addReviewerOperation(state, action) {
		state.reviewers.push({
			id: action.input.id,
			did: action.input.did,
			scope: action.input.scope,
			reviewerType: action.input.reviewerType,
			name: action.input.name
		});
	},
	removeReviewerOperation(state, action) {
		const idx = state.reviewers.findIndex((r) => r.id === action.input.id);
		if (idx === -1) throw new ReviewerNotFoundError(`Reviewer ${action.input.id} not found`);
		state.reviewers.splice(idx, 1);
	}
};
//#endregion
//#region document-models/grant-pool/v1/src/reducers/governance.ts
const grantPoolGovernanceOperations = {
	setSubmitterOperation(state, action) {
		state.submitter = {
			type: action.input.type,
			identifier: action.input.identifier,
			submittedAt: action.input.submittedAt
		};
	},
	setPublisherOperation(state, action) {
		state.publisher = {
			identifier: action.input.identifier,
			publishedAt: action.input.publishedAt
		};
	},
	recordVerificationOperation(state, action) {
		state.verifiedBy = action.input.verifiedBy;
		state.verificationMethod = action.input.verificationMethod;
		state.lastVerifiedAt = action.input.verifiedAt;
	},
	publishPoolOperation(state, _action) {
		if (state.governanceState === "APPROVED") throw new Error("Pool already published");
		state.governanceState = "APPROVED";
		if (state.lifecycle === "DRAFT") state.lifecycle = "UPCOMING";
	},
	closePoolOperation(state, _action) {
		if (state.lifecycle !== "OPEN") throw new Error("Cannot close pool unless OPEN");
		state.lifecycle = "CLOSED";
		state.isOpen = false;
	},
	cancelPoolOperation(state, _action) {
		state.lifecycle = "CANCELLED";
		state.isOpen = false;
	},
	setGovernanceStateOperation(state, action) {
		state.governanceState = action.input.governanceState;
	}
};
//#endregion
//#region document-models/grant-pool/v1/src/reducers/lineage.ts
const grantPoolLineageOperations = {
	markSupersedesOperation(state, action) {
		state.supersedes = action.input.supersedes;
	},
	markClaimedFromEntryOperation(state, action) {
		state.claimedFromEntry = action.input.claimedFromEntry;
	},
	markDuplicateOfOperation(state, action) {
		state.duplicateOf = action.input.duplicateOf;
	}
};
//#endregion
//#region document-models/grant-pool/v1/gen/schema/zod.ts
const isDefinedNonNullAny = (v) => v !== void 0 && v !== null;
const definedNonNullAnySchema = any().refine((v) => isDefinedNonNullAny(v));
const FundingMechanismSchema = _enum([
	"ANGEL_INVESTMENT",
	"ASSURANCE_CONTRACTS",
	"BONDING_CURVES",
	"BOUNTIES",
	"COMMUNITY_CURRENCIES",
	"CONVICTION_VOTING",
	"COOKIE_JAR",
	"DECENTRALIZED_VALIDATORS",
	"DELEGATED_DOMAIN_ALLOCATION",
	"DIRECT_GRANTS",
	"DIRECT_TO_CONTRACT_INCENTIVES",
	"DOMINANT_ASSURANCE_CONTRACTS",
	"EVOLUTIONARY_GRANTS_GAMES",
	"FUTARCHY",
	"GIFT_CIRCLES",
	"GNOSIS_SAFE",
	"HONOUR",
	"IMPACT_ATTESTATIONS",
	"MUTUAL_AID_NETWORKS",
	"OTHER",
	"QUADRATIC_FUNDING",
	"RANKED_CHOICE_VOTING",
	"REQUEST_FOR_PROPOSAL",
	"RETRO_FUNDING",
	"REVNETS",
	"SELF_CURATED_REGISTRIES",
	"SOCIAL_MEDIA_CAPITAL_ALLOCATION",
	"STOKVEL",
	"STREAMING_QUADRATIC_FUNDING",
	"UNIVERSAL_BASIC_INCOME",
	"WAQF",
	"ZAKAT"
]);
const GrantPoolLifecycleSchema = _enum([
	"AWARDED",
	"CANCELLED",
	"CLOSED",
	"DRAFT",
	"NOT_AWARDED",
	"OPEN",
	"REQUEST_FOR_COMMENTS",
	"UPCOMING"
]);
const PoolGovernanceStateSchema = _enum([
	"APPROVED",
	"DISPUTED",
	"PENDING",
	"REJECTED",
	"SUPERSEDED",
	"UNDER_REVIEW"
]);
const ReviewerScopeSchema = _enum(["EXTERNAL", "INTERNAL"]);
const ReviewerTypeSchema = _enum([
	"AI",
	"GROUP",
	"HUMAN"
]);
const SubmitterTypeSchema = _enum([
	"AUTOMATION",
	"COMMUNITY",
	"VERIFIED_PUBLISHER"
]);
const VerificationMethodSchema = _enum([
	"DOMAIN_VERIFICATION",
	"HTTP_PROBE",
	"MANUAL_REVIEW",
	"REVIEWER_CONFIRMATION"
]);
function AddCategoryInputSchema() {
	return object({ category: string() });
}
function AddContextDocumentInputSchema() {
	return object({
		id: string(),
		name: string(),
		url: url()
	});
}
function AddEcosystemInputSchema() {
	return object({ ecosystem: string() });
}
function AddPoolSameAsInputSchema() {
	return object({ url: url() });
}
function AddPoolSizeEntryInputSchema() {
	return object({
		amount: object({
			unit: string().optional(),
			value: number().finite()
		}),
		id: string()
	});
}
function AddRequiredCredentialInputSchema() {
	return object({ credential: string() });
}
function AddReviewerInputSchema() {
	return object({
		did: string(),
		id: string(),
		name: string(),
		reviewerType: ReviewerTypeSchema,
		scope: ReviewerScopeSchema
	});
}
function AddTagInputSchema() {
	return object({ tag: string() });
}
function AdvanceLifecycleInputSchema() {
	return object({ lifecycle: GrantPoolLifecycleSchema });
}
function CancelPoolInputSchema() {
	return object({
		cancelledAt: datetime(),
		reason: string().nullish()
	});
}
function ClosePoolInputSchema() {
	return object({ closedAt: datetime() });
}
function ContextDocumentSchema() {
	return object({
		__typename: literal("ContextDocument").optional(),
		id: string(),
		name: string(),
		url: url()
	});
}
function FundingAmountSchema() {
	return object({
		__typename: literal("FundingAmount").optional(),
		amount: object({
			unit: string().optional(),
			value: number().finite()
		}),
		id: string()
	});
}
function GrantPoolStateSchema() {
	return object({
		__typename: literal("GrantPoolState").optional(),
		applicationsURI: url().nullish(),
		attestationIssuersURI: url().nullish(),
		briefingURI: url().nullish(),
		categories: array(string()),
		claimedFromEntry: string().nullish(),
		closeDate: datetime().nullish(),
		code: string().nullish(),
		contextDocuments: array(lazy(() => ContextDocumentSchema())),
		coverImage: url().nullish(),
		description: string().nullish(),
		duplicateOf: string().nullish(),
		ecosystems: array(string()),
		eligibilityCriteria: string().nullish(),
		email: email().nullish(),
		evaluationCriteria: string().nullish(),
		extensions: string().nullish(),
		governanceState: PoolGovernanceStateSchema,
		governanceURI: url().nullish(),
		grantFundingMechanism: FundingMechanismSchema.nullish(),
		grantSystemRef: string().nullish(),
		image: url().nullish(),
		isOpen: boolean(),
		lastVerifiedAt: datetime().nullish(),
		lifecycle: GrantPoolLifecycleSchema,
		maxGrant: array(lazy(() => FundingAmountSchema())),
		minGrant: array(lazy(() => FundingAmountSchema())),
		name: string().nullish(),
		openDate: datetime().nullish(),
		publisher: lazy(() => PublisherSchema().nullish()),
		requiredCredentials: array(string()),
		reviewers: array(lazy(() => ReviewerSchema())),
		sameAs: array(url()),
		submitter: lazy(() => SubmitterSchema().nullish()),
		supersedes: string().nullish(),
		tags: array(string()),
		totalGrantPoolSize: array(lazy(() => FundingAmountSchema())),
		totalGrantPoolSizeInUSD: object({
			unit: string(),
			value: number().finite()
		}).nullish(),
		verificationMethod: VerificationMethodSchema.nullish(),
		verifiedBy: string().nullish()
	});
}
function MarkClaimedFromEntryInputSchema() {
	return object({ claimedFromEntry: string() });
}
function MarkDuplicateOfInputSchema() {
	return object({ duplicateOf: string() });
}
function MarkSupersedesInputSchema() {
	return object({ supersedes: string() });
}
function PublishPoolInputSchema() {
	return object({ publishedAt: datetime() });
}
function PublisherSchema() {
	return object({
		__typename: literal("Publisher").optional(),
		identifier: string(),
		publishedAt: datetime()
	});
}
function RecordVerificationInputSchema() {
	return object({
		verificationMethod: VerificationMethodSchema,
		verifiedAt: datetime(),
		verifiedBy: string()
	});
}
function RemoveCategoryInputSchema() {
	return object({ category: string() });
}
function RemoveContextDocumentInputSchema() {
	return object({ id: string() });
}
function RemoveEcosystemInputSchema() {
	return object({ ecosystem: string() });
}
function RemovePoolSameAsInputSchema() {
	return object({ url: url() });
}
function RemovePoolSizeEntryInputSchema() {
	return object({ id: string() });
}
function RemoveRequiredCredentialInputSchema() {
	return object({ credential: string() });
}
function RemoveReviewerInputSchema() {
	return object({ id: string() });
}
function RemoveTagInputSchema() {
	return object({ tag: string() });
}
function ReviewerSchema() {
	return object({
		__typename: literal("Reviewer").optional(),
		did: string(),
		id: string(),
		name: string(),
		reviewerType: ReviewerTypeSchema,
		scope: ReviewerScopeSchema
	});
}
function SetApplicationsUriInputSchema() {
	return object({ applicationsURI: url().nullish() });
}
function SetAttestationIssuersUriInputSchema() {
	return object({ attestationIssuersURI: url().nullish() });
}
function SetBriefingUriInputSchema() {
	return object({ briefingURI: url().nullish() });
}
function SetCloseDateInputSchema() {
	return object({ closeDate: datetime().nullish() });
}
function SetCodeInputSchema() {
	return object({ code: string().nullish() });
}
function SetDescriptionInputSchema() {
	return object({ description: string().nullish() });
}
function SetEligibilityCriteriaInputSchema() {
	return object({ eligibilityCriteria: string().nullish() });
}
function SetEvaluationCriteriaInputSchema() {
	return object({ evaluationCriteria: string().nullish() });
}
function SetFundingMechanismInputSchema() {
	return object({ grantFundingMechanism: FundingMechanismSchema });
}
function SetGovernanceStateInputSchema() {
	return object({ governanceState: PoolGovernanceStateSchema });
}
function SetGovernanceUriInputSchema() {
	return object({ governanceURI: url().nullish() });
}
function SetGrantBoundsInputSchema() {
	return object({
		maxGrantAmount1: object({
			unit: string().optional(),
			value: number().finite()
		}).nullish(),
		maxGrantId1: string(),
		minGrantAmount1: object({
			unit: string().optional(),
			value: number().finite()
		}).nullish(),
		minGrantId1: string()
	});
}
function SetGrantSystemRefInputSchema() {
	return object({ grantSystemRef: string() });
}
function SetIsOpenInputSchema() {
	return object({ isOpen: boolean() });
}
function SetOpenDateInputSchema() {
	return object({ openDate: datetime().nullish() });
}
function SetPoolCoverImageInputSchema() {
	return object({ coverImage: url().nullish() });
}
function SetPoolEmailInputSchema() {
	return object({ email: email().nullish() });
}
function SetPoolExtensionsInputSchema() {
	return object({ extensions: string().nullish() });
}
function SetPoolImageInputSchema() {
	return object({ image: url().nullish() });
}
function SetPoolNameInputSchema() {
	return object({ name: string() });
}
function SetPublisherInputSchema() {
	return object({
		identifier: string(),
		publishedAt: datetime()
	});
}
function SetSubmitterInputSchema() {
	return object({
		identifier: string(),
		submittedAt: datetime(),
		type: SubmitterTypeSchema
	});
}
function SetTotalPoolSizeUsdInputSchema() {
	return object({ totalGrantPoolSizeInUSD: object({
		unit: string(),
		value: number().finite()
	}).nullish() });
}
function SubmitterSchema() {
	return object({
		__typename: literal("Submitter").optional(),
		identifier: string(),
		submittedAt: datetime(),
		type: SubmitterTypeSchema
	});
}
//#endregion
//#region document-models/grant-pool/v1/gen/reducer.ts
const stateReducer = (state, action, dispatch) => {
	if (isDocumentAction(action)) return state;
	switch (action.type) {
		case "SET_POOL_NAME":
			SetPoolNameInputSchema().parse(action.input);
			grantPoolMetadataOperations.setPoolNameOperation(state[action.scope], action, dispatch);
			break;
		case "SET_DESCRIPTION":
			SetDescriptionInputSchema().parse(action.input);
			grantPoolMetadataOperations.setDescriptionOperation(state[action.scope], action, dispatch);
			break;
		case "SET_CODE":
			SetCodeInputSchema().parse(action.input);
			grantPoolMetadataOperations.setCodeOperation(state[action.scope], action, dispatch);
			break;
		case "SET_GRANT_SYSTEM_REF":
			SetGrantSystemRefInputSchema().parse(action.input);
			grantPoolMetadataOperations.setGrantSystemRefOperation(state[action.scope], action, dispatch);
			break;
		case "SET_BRIEFING_URI":
			SetBriefingUriInputSchema().parse(action.input);
			grantPoolMetadataOperations.setBriefingUriOperation(state[action.scope], action, dispatch);
			break;
		case "SET_ELIGIBILITY_CRITERIA":
			SetEligibilityCriteriaInputSchema().parse(action.input);
			grantPoolMetadataOperations.setEligibilityCriteriaOperation(state[action.scope], action, dispatch);
			break;
		case "SET_EVALUATION_CRITERIA":
			SetEvaluationCriteriaInputSchema().parse(action.input);
			grantPoolMetadataOperations.setEvaluationCriteriaOperation(state[action.scope], action, dispatch);
			break;
		case "SET_POOL_EMAIL":
			SetPoolEmailInputSchema().parse(action.input);
			grantPoolMetadataOperations.setPoolEmailOperation(state[action.scope], action, dispatch);
			break;
		case "SET_POOL_IMAGE":
			SetPoolImageInputSchema().parse(action.input);
			grantPoolMetadataOperations.setPoolImageOperation(state[action.scope], action, dispatch);
			break;
		case "SET_POOL_COVER_IMAGE":
			SetPoolCoverImageInputSchema().parse(action.input);
			grantPoolMetadataOperations.setPoolCoverImageOperation(state[action.scope], action, dispatch);
			break;
		case "SET_POOL_EXTENSIONS":
			SetPoolExtensionsInputSchema().parse(action.input);
			grantPoolMetadataOperations.setPoolExtensionsOperation(state[action.scope], action, dispatch);
			break;
		case "SET_FUNDING_MECHANISM":
			SetFundingMechanismInputSchema().parse(action.input);
			grantPoolFundingOperations.setFundingMechanismOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_POOL_SIZE_ENTRY":
			AddPoolSizeEntryInputSchema().parse(action.input);
			grantPoolFundingOperations.addPoolSizeEntryOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_POOL_SIZE_ENTRY":
			RemovePoolSizeEntryInputSchema().parse(action.input);
			grantPoolFundingOperations.removePoolSizeEntryOperation(state[action.scope], action, dispatch);
			break;
		case "SET_TOTAL_POOL_SIZE_USD":
			SetTotalPoolSizeUsdInputSchema().parse(action.input);
			grantPoolFundingOperations.setTotalPoolSizeUsdOperation(state[action.scope], action, dispatch);
			break;
		case "SET_GRANT_BOUNDS":
			SetGrantBoundsInputSchema().parse(action.input);
			grantPoolFundingOperations.setGrantBoundsOperation(state[action.scope], action, dispatch);
			break;
		case "SET_OPEN_DATE":
			SetOpenDateInputSchema().parse(action.input);
			grantPoolScheduleOperations.setOpenDateOperation(state[action.scope], action, dispatch);
			break;
		case "SET_CLOSE_DATE":
			SetCloseDateInputSchema().parse(action.input);
			grantPoolScheduleOperations.setCloseDateOperation(state[action.scope], action, dispatch);
			break;
		case "SET_IS_OPEN":
			SetIsOpenInputSchema().parse(action.input);
			grantPoolScheduleOperations.setIsOpenOperation(state[action.scope], action, dispatch);
			break;
		case "ADVANCE_LIFECYCLE":
			AdvanceLifecycleInputSchema().parse(action.input);
			grantPoolScheduleOperations.advanceLifecycleOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_CATEGORY":
			AddCategoryInputSchema().parse(action.input);
			grantPoolClassificationOperations.addCategoryOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_CATEGORY":
			RemoveCategoryInputSchema().parse(action.input);
			grantPoolClassificationOperations.removeCategoryOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_ECOSYSTEM":
			AddEcosystemInputSchema().parse(action.input);
			grantPoolClassificationOperations.addEcosystemOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_ECOSYSTEM":
			RemoveEcosystemInputSchema().parse(action.input);
			grantPoolClassificationOperations.removeEcosystemOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_TAG":
			AddTagInputSchema().parse(action.input);
			grantPoolClassificationOperations.addTagOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_TAG":
			RemoveTagInputSchema().parse(action.input);
			grantPoolClassificationOperations.removeTagOperation(state[action.scope], action, dispatch);
			break;
		case "SET_GOVERNANCE_URI":
			SetGovernanceUriInputSchema().parse(action.input);
			grantPoolResourcesOperations.setGovernanceUriOperation(state[action.scope], action, dispatch);
			break;
		case "SET_APPLICATIONS_URI":
			SetApplicationsUriInputSchema().parse(action.input);
			grantPoolResourcesOperations.setApplicationsUriOperation(state[action.scope], action, dispatch);
			break;
		case "SET_ATTESTATION_ISSUERS_URI":
			SetAttestationIssuersUriInputSchema().parse(action.input);
			grantPoolResourcesOperations.setAttestationIssuersUriOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_REQUIRED_CREDENTIAL":
			AddRequiredCredentialInputSchema().parse(action.input);
			grantPoolResourcesOperations.addRequiredCredentialOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_REQUIRED_CREDENTIAL":
			RemoveRequiredCredentialInputSchema().parse(action.input);
			grantPoolResourcesOperations.removeRequiredCredentialOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_CONTEXT_DOCUMENT":
			AddContextDocumentInputSchema().parse(action.input);
			grantPoolResourcesOperations.addContextDocumentOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_CONTEXT_DOCUMENT":
			RemoveContextDocumentInputSchema().parse(action.input);
			grantPoolResourcesOperations.removeContextDocumentOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_POOL_SAME_AS":
			AddPoolSameAsInputSchema().parse(action.input);
			grantPoolResourcesOperations.addPoolSameAsOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_POOL_SAME_AS":
			RemovePoolSameAsInputSchema().parse(action.input);
			grantPoolResourcesOperations.removePoolSameAsOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_REVIEWER":
			AddReviewerInputSchema().parse(action.input);
			grantPoolReviewersOperations.addReviewerOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_REVIEWER":
			RemoveReviewerInputSchema().parse(action.input);
			grantPoolReviewersOperations.removeReviewerOperation(state[action.scope], action, dispatch);
			break;
		case "SET_SUBMITTER":
			SetSubmitterInputSchema().parse(action.input);
			grantPoolGovernanceOperations.setSubmitterOperation(state[action.scope], action, dispatch);
			break;
		case "SET_PUBLISHER":
			SetPublisherInputSchema().parse(action.input);
			grantPoolGovernanceOperations.setPublisherOperation(state[action.scope], action, dispatch);
			break;
		case "RECORD_VERIFICATION":
			RecordVerificationInputSchema().parse(action.input);
			grantPoolGovernanceOperations.recordVerificationOperation(state[action.scope], action, dispatch);
			break;
		case "PUBLISH_POOL":
			PublishPoolInputSchema().parse(action.input);
			grantPoolGovernanceOperations.publishPoolOperation(state[action.scope], action, dispatch);
			break;
		case "CLOSE_POOL":
			ClosePoolInputSchema().parse(action.input);
			grantPoolGovernanceOperations.closePoolOperation(state[action.scope], action, dispatch);
			break;
		case "CANCEL_POOL":
			CancelPoolInputSchema().parse(action.input);
			grantPoolGovernanceOperations.cancelPoolOperation(state[action.scope], action, dispatch);
			break;
		case "SET_GOVERNANCE_STATE":
			SetGovernanceStateInputSchema().parse(action.input);
			grantPoolGovernanceOperations.setGovernanceStateOperation(state[action.scope], action, dispatch);
			break;
		case "MARK_SUPERSEDES":
			MarkSupersedesInputSchema().parse(action.input);
			grantPoolLineageOperations.markSupersedesOperation(state[action.scope], action, dispatch);
			break;
		case "MARK_CLAIMED_FROM_ENTRY":
			MarkClaimedFromEntryInputSchema().parse(action.input);
			grantPoolLineageOperations.markClaimedFromEntryOperation(state[action.scope], action, dispatch);
			break;
		case "MARK_DUPLICATE_OF":
			MarkDuplicateOfInputSchema().parse(action.input);
			grantPoolLineageOperations.markDuplicateOfOperation(state[action.scope], action, dispatch);
			break;
		default: return state;
	}
};
const reducer = createReducer(stateReducer);
//#endregion
//#region document-models/grant-pool/v1/gen/metadata/creators.ts
var creators_exports$7 = /* @__PURE__ */ __exportAll({
	setBriefingUri: () => setBriefingUri,
	setCode: () => setCode,
	setDescription: () => setDescription,
	setEligibilityCriteria: () => setEligibilityCriteria,
	setEvaluationCriteria: () => setEvaluationCriteria,
	setGrantSystemRef: () => setGrantSystemRef,
	setPoolCoverImage: () => setPoolCoverImage,
	setPoolEmail: () => setPoolEmail,
	setPoolExtensions: () => setPoolExtensions,
	setPoolImage: () => setPoolImage,
	setPoolName: () => setPoolName
});
const setPoolName = (input) => createAction("SET_POOL_NAME", { ...input }, void 0, SetPoolNameInputSchema, "global");
const setDescription = (input) => createAction("SET_DESCRIPTION", { ...input }, void 0, SetDescriptionInputSchema, "global");
const setCode = (input) => createAction("SET_CODE", { ...input }, void 0, SetCodeInputSchema, "global");
const setGrantSystemRef = (input) => createAction("SET_GRANT_SYSTEM_REF", { ...input }, void 0, SetGrantSystemRefInputSchema, "global");
const setBriefingUri = (input) => createAction("SET_BRIEFING_URI", { ...input }, void 0, SetBriefingUriInputSchema, "global");
const setEligibilityCriteria = (input) => createAction("SET_ELIGIBILITY_CRITERIA", { ...input }, void 0, SetEligibilityCriteriaInputSchema, "global");
const setEvaluationCriteria = (input) => createAction("SET_EVALUATION_CRITERIA", { ...input }, void 0, SetEvaluationCriteriaInputSchema, "global");
const setPoolEmail = (input) => createAction("SET_POOL_EMAIL", { ...input }, void 0, SetPoolEmailInputSchema, "global");
const setPoolImage = (input) => createAction("SET_POOL_IMAGE", { ...input }, void 0, SetPoolImageInputSchema, "global");
const setPoolCoverImage = (input) => createAction("SET_POOL_COVER_IMAGE", { ...input }, void 0, SetPoolCoverImageInputSchema, "global");
const setPoolExtensions = (input) => createAction("SET_POOL_EXTENSIONS", { ...input }, void 0, SetPoolExtensionsInputSchema, "global");
//#endregion
//#region document-models/grant-pool/v1/gen/funding/creators.ts
var creators_exports$6 = /* @__PURE__ */ __exportAll({
	addPoolSizeEntry: () => addPoolSizeEntry,
	removePoolSizeEntry: () => removePoolSizeEntry,
	setFundingMechanism: () => setFundingMechanism,
	setGrantBounds: () => setGrantBounds,
	setTotalPoolSizeUsd: () => setTotalPoolSizeUsd
});
const setFundingMechanism = (input) => createAction("SET_FUNDING_MECHANISM", { ...input }, void 0, SetFundingMechanismInputSchema, "global");
const addPoolSizeEntry = (input) => createAction("ADD_POOL_SIZE_ENTRY", { ...input }, void 0, AddPoolSizeEntryInputSchema, "global");
const removePoolSizeEntry = (input) => createAction("REMOVE_POOL_SIZE_ENTRY", { ...input }, void 0, RemovePoolSizeEntryInputSchema, "global");
const setTotalPoolSizeUsd = (input) => createAction("SET_TOTAL_POOL_SIZE_USD", { ...input }, void 0, SetTotalPoolSizeUsdInputSchema, "global");
const setGrantBounds = (input) => createAction("SET_GRANT_BOUNDS", { ...input }, void 0, SetGrantBoundsInputSchema, "global");
//#endregion
//#region document-models/grant-pool/v1/gen/schedule/creators.ts
var creators_exports$5 = /* @__PURE__ */ __exportAll({
	advanceLifecycle: () => advanceLifecycle,
	setCloseDate: () => setCloseDate,
	setIsOpen: () => setIsOpen,
	setOpenDate: () => setOpenDate
});
const setOpenDate = (input) => createAction("SET_OPEN_DATE", { ...input }, void 0, SetOpenDateInputSchema, "global");
const setCloseDate = (input) => createAction("SET_CLOSE_DATE", { ...input }, void 0, SetCloseDateInputSchema, "global");
const setIsOpen = (input) => createAction("SET_IS_OPEN", { ...input }, void 0, SetIsOpenInputSchema, "global");
const advanceLifecycle = (input) => createAction("ADVANCE_LIFECYCLE", { ...input }, void 0, AdvanceLifecycleInputSchema, "global");
//#endregion
//#region document-models/grant-pool/v1/gen/classification/creators.ts
var creators_exports$4 = /* @__PURE__ */ __exportAll({
	addCategory: () => addCategory,
	addEcosystem: () => addEcosystem,
	addTag: () => addTag,
	removeCategory: () => removeCategory,
	removeEcosystem: () => removeEcosystem,
	removeTag: () => removeTag
});
const addCategory = (input) => createAction("ADD_CATEGORY", { ...input }, void 0, AddCategoryInputSchema, "global");
const removeCategory = (input) => createAction("REMOVE_CATEGORY", { ...input }, void 0, RemoveCategoryInputSchema, "global");
const addEcosystem = (input) => createAction("ADD_ECOSYSTEM", { ...input }, void 0, AddEcosystemInputSchema, "global");
const removeEcosystem = (input) => createAction("REMOVE_ECOSYSTEM", { ...input }, void 0, RemoveEcosystemInputSchema, "global");
const addTag = (input) => createAction("ADD_TAG", { ...input }, void 0, AddTagInputSchema, "global");
const removeTag = (input) => createAction("REMOVE_TAG", { ...input }, void 0, RemoveTagInputSchema, "global");
//#endregion
//#region document-models/grant-pool/v1/gen/resources/creators.ts
var creators_exports$3 = /* @__PURE__ */ __exportAll({
	addContextDocument: () => addContextDocument,
	addPoolSameAs: () => addPoolSameAs,
	addRequiredCredential: () => addRequiredCredential,
	removeContextDocument: () => removeContextDocument,
	removePoolSameAs: () => removePoolSameAs,
	removeRequiredCredential: () => removeRequiredCredential,
	setApplicationsUri: () => setApplicationsUri,
	setAttestationIssuersUri: () => setAttestationIssuersUri,
	setGovernanceUri: () => setGovernanceUri
});
const setGovernanceUri = (input) => createAction("SET_GOVERNANCE_URI", { ...input }, void 0, SetGovernanceUriInputSchema, "global");
const setApplicationsUri = (input) => createAction("SET_APPLICATIONS_URI", { ...input }, void 0, SetApplicationsUriInputSchema, "global");
const setAttestationIssuersUri = (input) => createAction("SET_ATTESTATION_ISSUERS_URI", { ...input }, void 0, SetAttestationIssuersUriInputSchema, "global");
const addRequiredCredential = (input) => createAction("ADD_REQUIRED_CREDENTIAL", { ...input }, void 0, AddRequiredCredentialInputSchema, "global");
const removeRequiredCredential = (input) => createAction("REMOVE_REQUIRED_CREDENTIAL", { ...input }, void 0, RemoveRequiredCredentialInputSchema, "global");
const addContextDocument = (input) => createAction("ADD_CONTEXT_DOCUMENT", { ...input }, void 0, AddContextDocumentInputSchema, "global");
const removeContextDocument = (input) => createAction("REMOVE_CONTEXT_DOCUMENT", { ...input }, void 0, RemoveContextDocumentInputSchema, "global");
const addPoolSameAs = (input) => createAction("ADD_POOL_SAME_AS", { ...input }, void 0, AddPoolSameAsInputSchema, "global");
const removePoolSameAs = (input) => createAction("REMOVE_POOL_SAME_AS", { ...input }, void 0, RemovePoolSameAsInputSchema, "global");
//#endregion
//#region document-models/grant-pool/v1/gen/reviewers/creators.ts
var creators_exports$2 = /* @__PURE__ */ __exportAll({
	addReviewer: () => addReviewer,
	removeReviewer: () => removeReviewer
});
const addReviewer = (input) => createAction("ADD_REVIEWER", { ...input }, void 0, AddReviewerInputSchema, "global");
const removeReviewer = (input) => createAction("REMOVE_REVIEWER", { ...input }, void 0, RemoveReviewerInputSchema, "global");
//#endregion
//#region document-models/grant-pool/v1/gen/governance/creators.ts
var creators_exports$1 = /* @__PURE__ */ __exportAll({
	cancelPool: () => cancelPool,
	closePool: () => closePool,
	publishPool: () => publishPool,
	recordVerification: () => recordVerification,
	setGovernanceState: () => setGovernanceState,
	setPublisher: () => setPublisher,
	setSubmitter: () => setSubmitter
});
const setSubmitter = (input) => createAction("SET_SUBMITTER", { ...input }, void 0, SetSubmitterInputSchema, "global");
const setPublisher = (input) => createAction("SET_PUBLISHER", { ...input }, void 0, SetPublisherInputSchema, "global");
const recordVerification = (input) => createAction("RECORD_VERIFICATION", { ...input }, void 0, RecordVerificationInputSchema, "global");
const publishPool = (input) => createAction("PUBLISH_POOL", { ...input }, void 0, PublishPoolInputSchema, "global");
const closePool = (input) => createAction("CLOSE_POOL", { ...input }, void 0, ClosePoolInputSchema, "global");
const cancelPool = (input) => createAction("CANCEL_POOL", { ...input }, void 0, CancelPoolInputSchema, "global");
const setGovernanceState = (input) => createAction("SET_GOVERNANCE_STATE", { ...input }, void 0, SetGovernanceStateInputSchema, "global");
//#endregion
//#region document-models/grant-pool/v1/gen/lineage/creators.ts
var creators_exports = /* @__PURE__ */ __exportAll({
	markClaimedFromEntry: () => markClaimedFromEntry,
	markDuplicateOf: () => markDuplicateOf,
	markSupersedes: () => markSupersedes
});
const markSupersedes = (input) => createAction("MARK_SUPERSEDES", { ...input }, void 0, MarkSupersedesInputSchema, "global");
const markClaimedFromEntry = (input) => createAction("MARK_CLAIMED_FROM_ENTRY", { ...input }, void 0, MarkClaimedFromEntryInputSchema, "global");
const markDuplicateOf = (input) => createAction("MARK_DUPLICATE_OF", { ...input }, void 0, MarkDuplicateOfInputSchema, "global");
//#endregion
//#region document-models/grant-pool/v1/actions.ts
/** Actions for the GrantPool document model */
const actions = {
	...baseActions,
	...creators_exports$7,
	...creators_exports$6,
	...creators_exports$5,
	...creators_exports$4,
	...creators_exports$3,
	...creators_exports$2,
	...creators_exports$1,
	...creators_exports
};
//#endregion
//#region document-models/grant-pool/v1/gen/document-type.ts
const grantPoolDocumentType = "rfp-hub/grant-pool";
//#endregion
//#region document-models/grant-pool/v1/gen/document-schema.ts
/** Schema for validating the header object of a GrantPool document */
const GrantPoolDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: literal(grantPoolDocumentType) });
/** Schema for validating the state object of a GrantPool document */
const GrantPoolPHStateSchema = BaseDocumentStateSchema.extend({ global: GrantPoolStateSchema() });
const GrantPoolDocumentSchema = object({
	header: GrantPoolDocumentHeaderSchema,
	state: GrantPoolPHStateSchema,
	initialState: GrantPoolPHStateSchema
});
/** Simple helper function to check if a state object is a GrantPool document state object */
function isGrantPoolState(state) {
	return GrantPoolPHStateSchema.safeParse(state).success;
}
/** Simple helper function to assert that a document state object is a GrantPool document state object */
function assertIsGrantPoolState(state) {
	GrantPoolPHStateSchema.parse(state);
}
/** Simple helper function to check if a document is a GrantPool document */
function isGrantPoolDocument(document) {
	return GrantPoolDocumentSchema.safeParse(document).success;
}
/** Simple helper function to assert that a document is a GrantPool document */
function assertIsGrantPoolDocument(document) {
	GrantPoolDocumentSchema.parse(document);
}
//#endregion
//#region document-models/grant-pool/v1/gen/utils.ts
const initialGlobalState = {
	grantSystemRef: null,
	name: null,
	description: null,
	grantFundingMechanism: null,
	isOpen: false,
	openDate: null,
	closeDate: null,
	applicationsURI: null,
	governanceURI: null,
	attestationIssuersURI: null,
	requiredCredentials: [],
	totalGrantPoolSize: [],
	totalGrantPoolSizeInUSD: null,
	minGrant: [],
	maxGrant: [],
	email: null,
	image: null,
	coverImage: null,
	extensions: null,
	sameAs: [],
	code: null,
	briefingURI: null,
	eligibilityCriteria: null,
	evaluationCriteria: null,
	contextDocuments: [],
	reviewers: [],
	categories: [],
	ecosystems: [],
	tags: [],
	lifecycle: "DRAFT",
	submitter: null,
	publisher: null,
	lastVerifiedAt: null,
	verificationMethod: null,
	verifiedBy: null,
	governanceState: "PENDING",
	supersedes: null,
	claimedFromEntry: null,
	duplicateOf: null
};
const initialLocalState = {};
const utils$1 = {
	fileExtension: "rfpp",
	createState(state) {
		return {
			...defaultBaseState(),
			global: {
				...initialGlobalState,
				...state?.global
			},
			local: {
				...initialLocalState,
				...state?.local
			}
		};
	},
	createDocument(state) {
		const document = baseCreateDocument(utils$1.createState, state);
		document.header.documentType = grantPoolDocumentType;
		document.header.id = generateId();
		return document;
	},
	saveToFileHandle(document, input) {
		return baseSaveToFileHandle(document, input);
	},
	loadFromInput(input) {
		return baseLoadFromInput(input, reducer);
	},
	isStateOfType(state) {
		return isGrantPoolState(state);
	},
	assertIsStateOfType(state) {
		return assertIsGrantPoolState(state);
	},
	isDocumentOfType(document) {
		return isGrantPoolDocument(document);
	},
	assertIsDocumentOfType(document) {
		return assertIsGrantPoolDocument(document);
	}
};
//#endregion
//#region document-models/grant-pool/v1/src/utils.ts
var utils_exports = /* @__PURE__ */ __exportAll({});
//#endregion
//#region document-models/grant-pool/v1/utils.ts
/** Utils for the GrantPool document model */
const utils = {
	...utils$1,
	...utils_exports
};
//#endregion
//#region document-models/grant-pool/v1/module.ts
/** Document model module for the GrantPool document type */
const GrantPool = {
	version: 1,
	reducer,
	actions,
	utils,
	documentModel: createState(defaultBaseState(), documentModel)
};
//#endregion
export { creators_exports$6 as $, SetBriefingUriInputSchema as $t, addContextDocument as A, FundingMechanismSchema as At, addCategory as B, RemoveCategoryInputSchema as Bt, recordVerification as C, definedNonNullAnySchema as Cn, AddReviewerInputSchema as Ct, addReviewer as D, ClosePoolInputSchema as Dt, setSubmitter as E, CancelPoolInputSchema as Et, removePoolSameAs as F, MarkSupersedesInputSchema as Ft, removeEcosystem as G, RemoveRequiredCredentialInputSchema as Gt, addTag as H, RemoveEcosystemInputSchema as Ht, removeRequiredCredential as I, PoolGovernanceStateSchema as It, creators_exports$5 as J, ReviewerSchema as Jt, removeTag as K, RemoveReviewerInputSchema as Kt, setApplicationsUri as L, PublishPoolInputSchema as Lt, addRequiredCredential as M, GrantPoolStateSchema as Mt, creators_exports$3 as N, MarkClaimedFromEntryInputSchema as Nt, creators_exports$2 as O, ContextDocumentSchema as Ot, removeContextDocument as P, MarkDuplicateOfInputSchema as Pt, addPoolSizeEntry as Q, SetAttestationIssuersUriInputSchema as Qt, setAttestationIssuersUri as R, PublisherSchema as Rt, publishPool as S, VerificationMethodSchema as Sn, AddRequiredCredentialInputSchema as St, setPublisher as T, documentModel as Tn, AdvanceLifecycleInputSchema as Tt, creators_exports$4 as U, RemovePoolSameAsInputSchema as Ut, addEcosystem as V, RemoveContextDocumentInputSchema as Vt, removeCategory as W, RemovePoolSizeEntryInputSchema as Wt, setIsOpen as X, ReviewerTypeSchema as Xt, setCloseDate as Y, ReviewerScopeSchema as Yt, setOpenDate as Z, SetApplicationsUriInputSchema as Zt, markDuplicateOf as _, SetPublisherInputSchema as _n, AddCategoryInputSchema as _t, utils$1 as a, SetFundingMechanismInputSchema as an, setBriefingUri as at, closePool as b, SubmitterSchema as bn, AddPoolSameAsInputSchema as bt, GrantPoolPHStateSchema as c, SetGrantBoundsInputSchema as cn, setEligibilityCriteria as ct, isGrantPoolDocument as d, SetOpenDateInputSchema as dn, setPoolCoverImage as dt, SetCloseDateInputSchema as en, removePoolSizeEntry as et, isGrantPoolState as f, SetPoolCoverImageInputSchema as fn, setPoolEmail as ft, markClaimedFromEntry as g, SetPoolNameInputSchema as gn, reducer as gt, creators_exports as h, SetPoolImageInputSchema as hn, setPoolName as ht, initialLocalState as i, SetEvaluationCriteriaInputSchema as in, creators_exports$7 as it, addPoolSameAs as j, GrantPoolLifecycleSchema as jt, removeReviewer as k, FundingAmountSchema as kt, assertIsGrantPoolDocument as l, SetGrantSystemRefInputSchema as ln, setEvaluationCriteria as lt, actions as m, SetPoolExtensionsInputSchema as mn, setPoolImage as mt, utils as n, SetDescriptionInputSchema as nn, setGrantBounds as nt, GrantPoolDocumentHeaderSchema as o, SetGovernanceStateInputSchema as on, setCode as ot, grantPoolDocumentType as p, SetPoolEmailInputSchema as pn, setPoolExtensions as pt, advanceLifecycle as q, RemoveTagInputSchema as qt, initialGlobalState as r, SetEligibilityCriteriaInputSchema as rn, setTotalPoolSizeUsd as rt, GrantPoolDocumentSchema as s, SetGovernanceUriInputSchema as sn, setDescription as st, GrantPool as t, SetCodeInputSchema as tn, setFundingMechanism as tt, assertIsGrantPoolState as u, SetIsOpenInputSchema as un, setGrantSystemRef as ut, markSupersedes as v, SetSubmitterInputSchema as vn, AddContextDocumentInputSchema as vt, setGovernanceState as w, isDefinedNonNullAny as wn, AddTagInputSchema as wt, creators_exports$1 as x, SubmitterTypeSchema as xn, AddPoolSizeEntryInputSchema as xt, cancelPool as y, SetTotalPoolSizeUsdInputSchema as yn, AddEcosystemInputSchema as yt, setGovernanceUri as z, RecordVerificationInputSchema as zt };

//# sourceMappingURL=module-BMSfcjYx.mjs.map