code:
App.Encyclopedia.addArticle("Body", function() {
	const fragment = new DocumentFragment();
	App.UI.DOM.appendNewElement("p", fragment, "Future room for lore text", "note");
	App.UI.DOM.appendNewElement("div", fragment, "Choose a more particular entry below:");
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Waist", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("waist"));
	r.push(`contributes to beauty. Waists can be altered permanently by corsets over time, or quickly in the surgery. (wiki: needs more technical detail)`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Anuses", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("anuses"));
	r.push(`are a valuable commodity. Like`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("vaginas", "Vaginas"),
		`,`
	));
	r.push(`they appear in four degrees of tightness: virgin and three increasing levels of looseness. Tighter anuses improve performance at sexual assignments, but most methods of learning `);
	r.push(App.Encyclopedia.Dialog.linkDOM("anal skill", "Anal Skill"));
	r.push(`tend to loosen anuses. Assigning a virgin to sex work will result in a one-time bonus to performance, but may anger her and can result in skipping up one level of looseness. A virgin anus applies a moderate cost multiplier for slave purchase or sale. Anuses can be loosened by events, strenuous sex work, or plug accessories; they can be tightened with rest from strenuous sex work, personal attention, or the autosurgery, though such surgery can reduce`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("anal skill", "Anal Skill"),
		`.`
	));
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Areolae", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("areolae"));
	r.push(`can be altered in size or shape through surgery. (wiki: needs more technical detail)`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Breasts", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("breasts"));
	r.push(`contribute to beauty. They can be enlarged with`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("XX hormones", "Hormones (XX)"),
		`, intense`
	));
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("lactation", "Lactation"),
		`,`
	));
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("weight gain", "Weight"),
		`, or surgery (which`
	));
	r.push(App.Encyclopedia.Dialog.linkDOM("boob fetishists", "Boob Fetishists"));
	r.push(`will be grateful for).`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Clits", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("clits"));
	r.push(`contribute to beauty. (wiki: needs more technical detail)`);
	// TODO: how are clits tied to dicks, vaginas, and hormones?
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Dicks", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("dicks"));
	r.push(`are less straightforward than`);

	r.push(App.Encyclopedia.Dialog.linkDOM("anuses", "Anuses"));
	r.push(`or `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("vaginas", "Vaginas"), `.`
	));
	r.push(`At game start, larger dicks reduce slave value, though this can be reduced or even reversed by some future society choices. Slaves will remain capable of erection so long as they retain `);
	r.push(App.Encyclopedia.Dialog.linkDOM("testicles", "Testicles"));
	r.push(`and are not on `);
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("female hormone treatments", "Hormones (XX)"), `.`));
	App.Events.addParagraph(fragment, r);
	fragment.append(App.Encyclopedia.Dialog.linkDOM("Clits?", "Clits"));
	// TODO: how do dicks and clits relate, future coder?
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Ethnicity", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("ethnicity"));
	r.push(`affects random slave generation; the game produces bodies according to broad phenotypes. For example, black hair is almost universal among randomly generated Asian slaves. Its only other impact at game start is that white slaves enjoy a minor bonus to beauty, modeling the near-universal reach of western standards of beauty. Racially based future societies can apply ethnic bonuses or penalties to beauty, changing this landscape.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Faces", function() {
	const fragment = new DocumentFragment();
	let r = [];
	for (const [key, shape] of App.Medicine.Modification.faceShape) {
		if (!shape.hasOwnProperty("requirements") || shape.requirements) {
			r.push(App.UI.DOM.makeElement("span", capFirstChar(key), "note"));
			r.push(shape.desc);
			App.Events.addNode(fragment, r, "div");
			r = [];
		}
	}
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("faces"));
	r.push(`contribute heavily to beauty. They occur in six shapes and seven levels of attractiveness, which can be affected by surgery or, if the slave is unattractive or masculine, intensive `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("XX hormones", "Hormones (XX)"),
		`.`
	));
	r.push(`Unlike most other attributes, a slave's face cannot be improved more than two steps by surgery. The autosurgery upgrade removes this limitation.`);
	App.Events.addParagraph(fragment, r);
	r = [];
	r.push(App.UI.DOM.makeElement("h2", `Facial shapes and beauty`));
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Height", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("height"));
	r.push(`contributes to beauty and improves combat effectiveness. It is measured in`); // TODO: link to CE?
	if (V.showInches === 2) {
		r.push(`inches,`);
	} else {
		r.push(`centimeters,`);
	}
	r.push(`though the game handles it in terms of ranges; beyond ${heightToEitherUnit(190)}, all very tall slaves will be treated almost identically. Height can be affected by surgery, and younger slaves can also see minor hormonal impacts on height. Unlike most other attributes, a slave's height cannot be changed more than one step by surgery.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Hips", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("hips"));
	r.push(`contribute to beauty. (wiki: needs more technical detail)`);
	// TODO: how are clits tied to dicks, vaginas, and hormones?
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Lactation", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves can begin to`);
	r.push(App.Encyclopedia.topic("lactate"));
	r.push(`two ways: naturally due to pregnancy or constant stimulation, or artificially, through surgical implantation of a slow-release lactation-inducing drug pellet. Drug-induced lactation is more copious, but may damage `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("health", "Health"),
		`. Larger `
	));
	r.push(App.Encyclopedia.Dialog.linkDOM("breasts", "Breasts"));
	r.push(`will produce more milk, but not linearly: diminishing returns apply to bigger tits. Happy and `);
	r.push(App.Encyclopedia.Dialog.linkDOM("healthy", "Health"));
	r.push(`cows are also more productive, and slaves with`);
	r.push(App.Encyclopedia.Dialog.linkDOM("ovaries", "Ovaries"));
	r.push(`enjoy a bonus to milk production. Natural lactation will dry up over time if not constantly maintained.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Lips", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("lips"));
	r.push(`contribute to beauty. At very large sizes, they will alter dialog, though this has no mechanical effect. They can be enlarged with targeted growth hormones or surgery, but such surgery can reduce `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("oral skill", "Oral Skill"),
		`.`
	));
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Musculature", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("musculature"));
	r.push(`occurs in seven levels, and affects combat effectiveness, beauty, and the effects of breasts. For combat, the penultimate level is best. At game start, muscles are a minor detriment to beauty, though this can be changed through `);
	r.push(App.Encyclopedia.Dialog.linkDOM("future society", "Future Societies"));
	r.push(`choices. Extremely large breasts can begin to hinder slaves, but the first level will allow them to carry their burdens.`);
	App.Events.addParagraph(fragment, r);
	r = [];

	r.push(`From the slave documentation;`);
	const table = App.UI.DOM.makeElement("table", null, "invisible");
	r.push(table);
	App.UI.DOM.makeRow(table, `96`, `100`, `extremely muscular`);
	App.UI.DOM.makeRow(table, `31`, `95`, `muscular`);
	App.UI.DOM.makeRow(table, `6`, `30`, `toned`);
	App.UI.DOM.makeRow(table, `-5`, `5`, `none`);
	App.UI.DOM.makeRow(table, `-30`, `-6`, `weak`);
	App.UI.DOM.makeRow(table, `-95`, `-31`, `very weak`);
	App.UI.DOM.makeRow(table, `-100`, `-96`, `frail`);

	App.Events.addParagraph(fragment, r);
	r = [];
	r.push(`A standard`);
	r.push(App.Encyclopedia.Dialog.linkDOM("bodyguard", "Bodyguard"));
	r.push(`is negatively impacted by being weak or extremely muscular and positively impacted by being muscular. A slave that is at the max of tall or very tall (>= 185) can handle being extremely muscular.`);
	App.Events.addParagraph(fragment, r);
	App.UI.DOM.appendNewElement("p", fragment, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("DJ", "DJ"),
		`'s are more effective when they are just under being muscular and inside being toned.`
	));

	App.UI.DOM.appendNewElement("p", fragment, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Nurse", "Nurse"),
		` is more effective when they are toned or greater.`
	));
	App.UI.DOM.appendNewElement("p", fragment, `Values >= 95 allows slaves with extremely hypertrophied balls (>70) to move around with effort.`);

	return fragment;
}, "body");

App.Encyclopedia.addArticle("Nipples", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("nipples"));
	r.push(`have varying effects, depending on their shape. Tiny nipples have a negative effect on beauty, puffy and inverted nipples improve it, huge nipples improve it more strongly, and all others have no effect. Inverted and partially inverted nipples can be permanently protruded by nipple piercings or milking: this is uncomfortable, and will reduce`);
	r.push(App.UI.DOM.makeElement("span",
		App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), "hotpink"
	));
	r.push(`unless the slave is a`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("masochist", "Masochists"),
		`. Tiny nipples can be enlarged with `,
		App.Encyclopedia.Dialog.linkDOM("XX hormones", "Hormones (XX)"),
		`, huge nipples can be reduced with `,
		App.Encyclopedia.Dialog.linkDOM("XY hormones", "Hormones (XY)"),
		`, breast growth hormones will grow and may invert nipples, and breast implantation may damage nipples enough to shrink them slightly.`
	));

	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Ovaries", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("ovaries"));
	r.push(`are necessary for pregnancy and provide a small amount of natural XX hormones. An oophorectomy, available with extreme content enabled, will render a slave barren and stop ovaries' hormonal effects, producing a slave with no natural hormones. Barren slaves do suffer penalties under some future society choices, but do not require costly contraceptives to avoid pregnancy. Ovaries grant a bonus to `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("lactation", "Lactation"),
		`.`
	));
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Pregnancy", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves require both`);
	r.push(App.Encyclopedia.Dialog.linkDOM("vaginas", "Vaginas"));
	r.push(`and`);
	r.push(App.Encyclopedia.Dialog.linkDOM("ovaries", "Ovaries"));
	r.push(`to become pregnant. However, it's rumored that Gender Radicalist societies have developed a method for `);
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("male impregnation", "Gender Radicalism Research"), "."));
	r.push(`Fertile slaves can be impregnated by the player character or a slave with`);
	r.push(App.Encyclopedia.Dialog.linkDOM("testicles", "Testicles"));
	r.push(`from the fertile slave's individual menu. Otherwise, slaves with vaginas and ovaries who aren't wearing chastity belts or taking contraceptives, and have not had their tubes tied via surgery, will likely become pregnant if performing sexual jobs or if allowed to have sex with slaves with balls. Pregnancy has a number of minor physical effects and will induce`);
	r.push(App.Encyclopedia.Dialog.linkDOM("lactation", "Lactation"));
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Skin Distinctions", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves can have various`);
	r.push(App.Encyclopedia.topic("skin distinctions,"));
	r.push(`including freckles, heavy freckling, beauty marks, and birthmarks. Beauty marks and birthmarks can be removed in the Salon.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(App.UI.DOM.makeElement("span", "Freckles", "italics"));
	r.push(`of both densities will slightly improve a slave's `);
	App.Encyclopedia.Dialog.linkDOM("attractiveness score", "Slave Score (Attractiveness)");
	r.push(`if she has pale or fair skin, and slightly improve it again if she has red hair.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(App.UI.DOM.makeElement("span", "Beauty marks,", "italics"));
	r.push(`otherwise known as facial moles, will improve a slave's`);
	App.Encyclopedia.Dialog.linkDOM("attractiveness score", "Slave Score (Attractiveness)");
	r.push(`if she has a gorgeous `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("face", "Faces"),
		`, reduce it if she has an average or worse face, and have no effect if she has a very pretty face.`
	));
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(App.UI.DOM.makeElement("span", "Birthmarks", "italics"));
	r.push(`will improve a slave's attractiveness score if she is prestigious, and reduce it if she is not.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Teeth", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("teeth"));
	r.push(`have a variety of impacts and can be customized in several ways.`);
	App.Events.addParagraph(fragment, r);
	r = [];
	for (const [key, teeth] of App.Medicine.Modification.teeth) {
		if (!teeth.hasOwnProperty("requirements") || teeth.requirements) {
			r.push(App.UI.DOM.makeElement("span", capFirstChar(key), "note"));
			r.push(teeth.desc);
			App.Events.addNode(fragment, r, "div");
			r = [];
		}
	}
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Testicles", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("testicles"));
	r.push(`are necessary for erection and provide a small amount of natural XY hormones. At game start, larger testicles reduce slave value, though this can be reduced or even reversed by some future society choices. Orchiectomy, available with extreme content enabled, will stop testicles' hormonal effects, producing a slave with no natural hormones. It also has significant mental effects.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Vaginas", function() {
	const fragment = new DocumentFragment();
	const r = [];
	r.push(`Slaves'`);
	r.push(App.Encyclopedia.topic("vaginas"));
	r.push(`are a valuable commodity. Like `);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("anuses", "Anuses"),
		`, they appear in four degrees of tightness: virgin and three increasing levels of looseness. Tighter vaginas improve performance at sexual assignments, but most methods of learning `
	));

	r.push(App.Encyclopedia.Dialog.linkDOM("anal skill", "Anal Skill"));
	r.push(`tend to loosen anuses. Assigning a virgin to sex work will result in a one-time bonus to performance but may anger her; alternatively, a chastity belt can be used to preserve virginity during sexual assignments. A virgin vagina applies a large cost multiplier for slave purchase or sale. Vaginas can be loosened by events, strenuous sex work, or plug accessories; they can be tightened with rest from strenuous sex work, personal attention, or the autosurgery, though such surgery can reduce`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("vaginal skill", "Vaginal Skill"),
		`.`
	));
	App.Events.addParagraph(fragment, r);

	fragment.append(App.Encyclopedia.Dialog.linkDOM("Clit?", "Clits"));

	return fragment;
}, "body");

App.Encyclopedia.addArticle("Weight", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(`A slaves'`);
	r.push(App.Encyclopedia.topic("weight"));
	r.push(`contributes to their beauty. The middle three values (thin, average and curvy) are all considered equally good; outside that range, penalties are applied. Gaining and losing weight can cause changes to a slave's`);
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("breast", "Breasts"),
		` and `,
		App.Encyclopedia.Dialog.linkDOM("butt", "Butts"),
		` size, and will be different for `,
		App.Encyclopedia.Dialog.linkDOM("anorexics", "Anorexic"),
		`, `,
		App.Encyclopedia.Dialog.linkDOM("gluttons", "Gluttonous"),
		`, and `,
		App.Encyclopedia.Dialog.linkDOM("fitness", "Fitness"),
		` fanatics.`,
	));
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(`From the slave documentation;`);
	const table = App.UI.DOM.makeElement("table", null, "invisible");
	r.push(table);
	App.UI.DOM.makeRow(table, `191`, `200`, `dangerously obese. This can lead to a slave losing their leadership position.`);
	App.UI.DOM.makeRow(table, `161`, `190`, `super obese`);
	App.UI.DOM.makeRow(table, `131`, `160`, `obese`);
	App.UI.DOM.makeRow(table, `96`, `130`, `fat`);
	App.UI.DOM.makeRow(table, `31`, `95`, `overweight`);
	App.UI.DOM.makeRow(table, `11`, `30`, `curvy`);
	App.UI.DOM.makeRow(table, `-10`, `10`, `neither too fat nor too skinny`);
	App.UI.DOM.makeRow(table, `-30`, `-11`, `thin`);
	App.UI.DOM.makeRow(table, `-95`, `-31`, `very thin`);
	App.UI.DOM.makeRow(table, `-100`, `-96`, `emaciated`);

	App.Events.addParagraph(fragment, r);
	r = [];
	r.push(`he ideal range for a`);
	r.push(App.Encyclopedia.Dialog.linkDOM("bodyguard", "Bodyguard"));
	r.push(`is -10 to 30, going either way negatively impacts them.`);
	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Hormones (XX)", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.topic("XX Hormones"),
		`are female hormones, either from hormone treatments or from `,
		App.Encyclopedia.Dialog.linkDOM("ovaries", "Ovaries"),
		`. A hidden hormonal score is calculated for each slave, with positive values more feminine:`
	));
	App.Events.addNode(fragment, r, "div");

	const list = App.UI.DOM.appendNewElement("ul", fragment);

	App.UI.DOM.appendNewElement("li", list, `normal XX hormones provide +1`);
	App.UI.DOM.appendNewElement("li", list, `heavy XX hormones provide +2`);
	App.UI.DOM.appendNewElement("li", list, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Ovaries", "Ovaries"),
		` provide +1`
	));
	App.UI.DOM.appendNewElement("li", list, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Testicles", "Testicles"),
		` provide -1`
	));

	r = [];
	r.push(`At a total of +1 with no ovaries present, XY attraction will increase, dicks will shrink, testicles will shrink, deep voices will be raised, small breasts and buttocks will grow, ugly faces will soften, huge clits will shrink, and extreme `);
	r.push(App.Encyclopedia.Dialog.linkDOM("musculature", "Musculature"));
	r.push(`will soften.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(`At +2, all these effects become more likely and more extreme, and`);
	r.push(App.UI.DOM.makeElement("span", App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), "hotpink"));
	r.push(`and`);
	r.push(App.UI.DOM.makeElement("span", App.Encyclopedia.Dialog.linkDOM("trust", "Trust"), "mediumaquamarine"));
	r.push(`can both increase.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(`Artificial hormonal effects can be accelerated by installing the second `);
	r.push(App.Encyclopedia.Dialog.linkDOM("upgrade", "What the Upgrades Do"));
	r.push(`to the kitchen, which will also stop slave's assets from shrinking due to natural hormonal effects.`);

	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addArticle("Hormones (XY)", function() {
	const fragment = new DocumentFragment();
	let r = [];
	r.push(App.UI.DOM.combineNodes(
		App.Encyclopedia.topic("XY Hormones"),
		`are male hormones, either from hormone treatments or from `,
		App.Encyclopedia.Dialog.linkDOM("Testicles", "Testicles"),
		`. A hidden hormonal score is calculated for each slave, with negative values more masculine:`
	));
	App.Events.addNode(fragment, r, "div");

	const list = App.UI.DOM.appendNewElement("ul", fragment);

	App.UI.DOM.appendNewElement("li", list, `normal XY hormones provide -1`);
	App.UI.DOM.appendNewElement("li", list, `heavy XY hormones provide -2`);
	App.UI.DOM.appendNewElement("li", list, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Ovaries", "Ovaries"),
		` provide +1`
	));
	App.UI.DOM.appendNewElement("li", list, App.UI.DOM.combineNodes(
		App.Encyclopedia.Dialog.linkDOM("Testicles", "Testicles"),
		` provide -1`
	));

	App.UI.DOM.appendNewElement("p", fragment, `At a total of -1, XY attraction will increase, large breasts and buttocks will shrink, and clits will grow.`);

	r = [];
	r.push(`At +2, all these effects become more likely and more extreme,`);
	r.push(App.UI.DOM.makeElement("span", App.Encyclopedia.Dialog.linkDOM("devotion", "From Rebellious to Devoted"), "hotpink"));
	r.push(`can decrease, dicks and testicles will grow, voices will deepen, and faces will become uglier.`);
	App.Events.addParagraph(fragment, r);

	r = [];
	r.push(`Artificial hormonal effects can be accelerated by installing the second `);
	r.push(App.Encyclopedia.Dialog.linkDOM("upgrade", "What the Upgrades Do"));
	r.push(`to the kitchen, which will also stop slave's assets from shrinking due to natural hormonal effects.`);

	App.Events.addParagraph(fragment, r);
	return fragment;
}, "body");

App.Encyclopedia.addCategory("body", function() {
	const links = [];
	links.push(App.Encyclopedia.Dialog.linkDOM("Anuses", "Anuses"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Areolae", "Areolae"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Breasts", "Breasts"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Butts", "Butts"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Clits", "Clits"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Dicks", "Dicks"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Ethnicity", "Ethnicity"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Faces", "Faces"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Height", "Height"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Hips", "Hips"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Lactation", "Lactation"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Lips", "Lips"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Musculature", "Musculature"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Nipples", "Nipples"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Ovaries", "Ovaries"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Pregnancy", "Pregnancy"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Skin Distinctions", "Skin Distinctions"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Teeth", "Teeth"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Testicles", "Testicles"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Vaginas", "Vaginas"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Waist", "Waist"));
	links.push(App.Encyclopedia.Dialog.linkDOM("Weight", "Weight"));
	links.push(App.Encyclopedia.Dialog.linkDOM("XX", "Hormones (XX)"));
	links.push(App.Encyclopedia.Dialog.linkDOM("XY", "Hormones (XY)"));
	return App.UI.DOM.generateLinksStrip(links);
});


code:
/* TODO: add entries for Nursery */

App.Encyclopedia.Assignments = {
	/**
	 * @returns {DocumentFragment}
	 */
	attendingClasses() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Attending classes"),
			" is an assignment which educates the slave, raising intelligence if possible. Being educated raises value and is useful for some jobs and leadership positions."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	confinement() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Confinement"),
			" is an assignment which accelerates breaking for disobedient slaves. If a slave isn't obedient enough to work and isn't ",
			App.Encyclopedia.Dialog.linkDOM("unhealthy", "Health"),
			" enough to need rest, this will make them useful sooner."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	fucktoy() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Fucktoy service"),
			" is an assignment which keeps the slave close and under the player's eye. It's mostly just for fun, but fucktoys can improve ",
			App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "reputation inc"),
			" based on their beauty, and the player character's attention can be targeted to areas of the slave's body with possible fetish effects on happy slaves."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	gloryHole() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Occupying a glory hole"),
			" is an assignment which makes money off of slaves regardless of their beauty, skills, or feelings; it's not fun or ",
			App.Encyclopedia.Dialog.linkDOM("healthy", "Health"),
			" but very powerful for extracting ¤ out of otherwise useless slaves."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	milking() {
		const fragment = document.createDocumentFragment();

		fragment.append(
			App.Encyclopedia.topic("Getting milked"),
			" is an assignment which makes money from lactation based on a slave's breasts, ",
			App.Encyclopedia.Dialog.linkDOM("health", "Health"),
			" and hormonal status."
		);
		if (V.seeDicks > 0) {
			fragment.append(" Cows with balls will also give semen.");
		}
		fragment.append(` Creates profit quickly from slaves with big tits${V.seeDicks ? " or balls" : ""}.`);

		return fragment;
	},

	/**
	 * @returns {DocumentFragment}
	 */
	farming() {
		const fragment = document.createDocumentFragment();
		fragment.append(
			App.Encyclopedia.topic("Farming"),
			" is an assignment which produces ",
			App.Encyclopedia.Dialog.linkDOM("food", "Food"),
			" from your slaves' hard work"
		);
		if (V.seeBestiality) {
			fragment.append(" and allows you to breed slaves with animals");
		}
		fragment.append(
			". Can also reduce arcology upkeep with upgrades in the ",
			App.Encyclopedia.Dialog.linkDOM("Farmyard", "Farmyard")
		);
		return fragment;
	},

	/**
	 * @returns {DocumentFragment}
	 */
	publicService() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Public Service"),
			" is an assignment which increases reputation based on a slave's beauty, sexual appeal, and skills. Very similar to whoring, but for reputation rather than money."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	rest() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Rest"),
			" is an assignment mostly used to improve ",
			App.Encyclopedia.Dialog.linkDOM("health", "Health"),
			". It can be useful to order slaves you wish to intensively modify to rest, since most modifications damage health. It will synergize with curative treatments, providing bonus healing when both are simultaneously applied."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	sexualServitude() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Sexual servitude"),
			" is an assignment which pleases other slaves by forcing the slave to service them sexually. Useful for driving the targeted slave's ",
			App.Encyclopedia.Dialog.linkDOM("devotion", "Devotion"),
			" up quickly."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	servitude() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Servitude"),
			" is an assignment which reduces your upkeep based on the slave's ",
			App.Encyclopedia.Dialog.linkDOM("devotion", "Devotion"),
			". Available at lower obedience than other jobs, is insensitive to the quality of a slave's body, and doesn't require skills; a good transitional assignment. Unusually, low sex drive is advantageous as a servant, since it reduces distraction. Lactating slaves are slightly better at this job, since they can contribute to their fellow slaves' nutrition."
		);
	},

	/**
	 * @returns {DocumentFragment}
	 */
	whoring() {
		return App.UI.DOM.combineNodes(
			App.Encyclopedia.topic("Whoring"),
			" is an assignment which makes money based on a slave's beauty, sexual appeal, and skills. Good whores take a long time to train and beautify but become very profitable."
		);
	}
};

App.Encyclopedia.addArticle("Slave Assignments", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push("Slave assignments are stratified into ordinary assignments and");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("leadership positions", "Leadership Positions"), "."));
	App.Events.addParagraph(frag, r);

	App.UI.DOM.appendNewElement("p", frag, "Choose a more particular entry below:");

	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Attending Classes", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.attendingClasses());
	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Schoolroom", "Schoolroom")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Confinement", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.confinement());
	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Cellblock", "Cellblock")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Fucktoy", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.fucktoy());
	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Master Suite", "Master Suite")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Glory Hole", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.gloryHole());
	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Arcade", "Arcade")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Milking", function() {
	const frag = document.createDocumentFragment();
	const r = [];

	r.push(App.Encyclopedia.Assignments.milking());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Dairy", "Dairy")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Farming", function() {
	const frag = document.createDocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.farming());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Farmyard", "Farmyard")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Public Service", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.publicService());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Club", "Club")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Rest", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.rest());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facilities: ", App.Encyclopedia.Dialog.linkDOM("Spa", "Spa"),
			", ", App.Encyclopedia.Dialog.linkDOM("Clinic", "Clinic")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Sexual Servitude", App.Encyclopedia.Assignments.servitude, "assignmentCommon");

App.Encyclopedia.addArticle("Servitude", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.servitude());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Servants' Quarters", "Servants' Quarters")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addArticle("Whoring", function() {
	const frag = new DocumentFragment();
	const r = [];
	r.push(App.Encyclopedia.Assignments.whoring());

	r.push(App.UI.DOM.makeElement("span",
		App.UI.DOM.combineNodes("Associated facility: ", App.Encyclopedia.Dialog.linkDOM("Brothel", "Brothel")),
		"note"));
	frag.append(...App.Events.spaceSentences(r));
	return frag;
}, "assignmentCommon");

App.Encyclopedia.addCategory("assignmentCommon", function() {
	const r = [];
	r.push(App.Encyclopedia.Dialog.linkDOM("Common Assignments", "Slave Assignments"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Career Experience", "Career Experience"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Attending Classes", "Attending Classes"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Confinement", "Confinement"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Farming", "Farming"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Fucktoy", "Fucktoy"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Glory Hole", "Glory Hole"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Milking", "Milking"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Public Service", "Public Service"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Rest", "Rest"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Servitude, Sexual", "Sexual Servitude"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Servitude", "Servitude"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Whoring", "Whoring"));
	return App.UI.DOM.generateLinksStrip(r);
});

repo_name: Fekenol/fc

license: mit


code:
App.Encyclopedia.Dialog = (function() {
	/** Create a link to an encyclopedia dialog for a given article with the given text
	 * @param {string} text Text for link
	 * @param {string} article Encyclopedia article to link to
	 * @returns {string} SugarCube link markup
	 */
	function makeLinkSC(text, article) {
		return App.UI.link(text, () => showArticleInDialog(article));
	}

	/** Create a link to an encyclopedia dialog for a given article with the given text
	 * @param {string} text Text for link
	 * @param {string} [article] Encyclopedia article to link to (if not supplied defaults to capFirstChar version of text)
	 * @param {string} [classNames] CSS Class to add to the link
	 * @returns {HTMLElement} DOM link element
	 */
	function makeLinkDOM(text, article = capFirstChar(text), classNames) {
		const link = App.UI.DOM.link(text, () => showArticleInDialog(article));
		if (!classNames) {
			return link;
		}
		// Wrap in a span for coloring, more reliable when hovering over the link
		const span = document.createElement("span");
		span.className += classNames;
		span.append(link);
		return span;
	}

	/** Show a given encyclopedia article in the encyclopedia dialog
	 * @param {string} article
	 */
	function showArticleInDialog(article) {
		let origEncyclopedia = V.encyclopedia;
		if (Dialog.isOpen()) {
			Dialog.close();
		}
		Dialog.setup("Encyclopedia", "encyclopedia");
		V.encyclopedia = article;
		$(Dialog.body()).empty().wiki(jsInclude("Encyclopedia"));
		Dialog.open();
		V.encyclopedia = origEncyclopedia;
	}

	return {
		linkSC: makeLinkSC,
		linkDOM: makeLinkDOM,
	};
})();


code:
App.Encyclopedia.addArticle("Future Societies", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push("The evolution of society has never been linear. Times of unrest and upheaval produce rapid change, followed by long periods of stasis in the absence of the necessary ingredients for further change. The world is undoubtedly in the midst of a time of great change: society is certainly evolving. But into what?");
	r.toNode("div", ["note"]);

	r.push("Not since antiquity have single persons held as much practical power over the direction of society as Free Cities arcology owners now have. Naturally, different Free Cities notables are going different ways with their great power. Many are building new societies as different from each other as they are from the old world.");
	r.toNode("p", ["note"]);

	r.push("One arcology might hold a society that is moving towards a fundamentalist interpretation of an old slaveholding religious tradition. Another might pay homage to historical racially segregated societies. A third might see intentional manipulation of gender roles that have held since the start of recorded history. And these three arcologies might well be each other's neighbors.");
	r.toNode("p", ["note"]);

	r.push("— Lawrence, W. G., Guide to Modern Slavery, Online Edition. Accessed April 2, 2032.");
	r.toNode("p", ["note"]);

	r.push(App.UI.DOM.makeElement("span", "Future Society Models"), `are societal goals the player can select and pursue for the arcology. It is possible to maintain four future society goals at once. The first is unlocked after week 5 for players with greater than rumored/${num(3000)}`, App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"), "or at game start with the Social Engineering character option; the rest unlock as the player achieves higher", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"), "levels.");
	r.toParagraph();

	r.push("All societies approve of specific things, usually slaves with specific characteristics; some societies also have dislikes. All societies are advanced by the things they approve of and slowed by the things they disapprove of, and all societies give and take", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"), "when approving and disapproving. All societies unlock unique events, arcology upgrades, and slave behaviors; some even unlock special clothing.");
	r.toParagraph();

	r.push(App.Encyclopedia.Dialog.linkDOM("Money", "Money", "yellowgreen"), "can be expended to directly advance future societies; the spending level can be set from the future society submenu of the arcology management menu. These funds are automatically spent each week. Once a future society is fully adopted (as noted on the future society submenu), this spending does not advance the society further. However, it can provide a guarantee against loss of progress should the player do something the society strongly disapproves of. Also, the spending is applied equally to all active future society models, meaning that there is no loss of efficiency in spending if the player has two maximized models and one still under development.");
	r.toParagraph();
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Ethnic Supremacy", ["bold"]), "is a future society model which approves of");
	r.push("slaves not of the chosen race and disapproves of slaves of the chosen race.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves the perceived beauty of racially superior slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Drastically lowers the desire of racially superior slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to affect the ethnic balance and economics seen in the slave market."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for slaves of inferior races from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Ethnic Subjugationism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Ethnic Subjugationism", ["bold"]), "is a future society model which approves of");
	r.push("slaves of the chosen race.");
	r.toNode("div");
	App.Events.addNode(t, ["Reduces the perceived beauty of racially inferior slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Drastically increases the desire to use racially inferior slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for slaves of the disfavored race from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Gender Radicalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Gender Radicalism", ["bold"]), "is a future society model which approves of");
	r.push("hormonal and surgical feminization and slaves with dicks.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves the value of slaves with dicks and slaves with balls."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to affect the biology seen in the slave market, and subtly influence arcology society."], "div", ["indent"]);
	App.Events.addNode(t, [`Provides demand for; slaves with dicks, hormonally treated slaves and  futanari${V.seeDicks !== 0 ? ' and ballsless bitches' : ''} from`, App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Gender Fundamentalism.", "Gender Fundamentalism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Gender Fundamentalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Gender Fundamentalism", ["bold"]), "is a future society model which approves of");
	r.push("pregnancy and fertility and disapproves of slaves who retain testicles.");
	r.toNode("div");
	App.Events.addNode(t, ["Reduces the slave value penalty due to pregnancy and reduces the beauty of slaves with dicks, though gelding can ameliorate this."], "div", ["indent"]);
	App.Events.addNode(t, ["Like Gender Radicalism, can be developed to affect the biology seen in the slave market, and subtly influence arcology society."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for naturally female slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Gender Radicalism.", "Gender Radicalism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Paternalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	const devotion = (text="devotion", colour="hotpink") => App.Encyclopedia.Dialog.linkDOM(text, "From Rebellious to Devoted", colour);
	const PaternalismApproval = [devotion(), "slaves choosing their own assignments", "good education", "mental health treatment", App.Encyclopedia.Dialog.linkDOM("high health", "Health")];

	r.push(App.UI.DOM.makeElement("span", "Paternalism", ["bold"]), "is a future society model which approves of");
	r.push(App.UI.DOM.toSentence(PaternalismApproval), "while stupidity and undereducation is disapproved.");
	r.toNode("div");
	App.Events.addNode(t, ["Applies a small", devotion(), "boost to all slaves and increases fines paid by citizens who injure whores and public servants."], "div", ["indent"]);
	App.Events.addNode(t, ["Increases the", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"), "penalty for operating an arcade."], "div", ["indent"]);
	App.Events.addNode(t, ["Slows increases in the ratio of slaves to citizens."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to build a", App.Encyclopedia.Dialog.linkDOM("trusting", "Trust", "mediumaquamarine"), "society that welcomes new slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for careful slave breaking and gentle cosmetic surgeries from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Degradationism.", "Degradationism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Degradationism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Degradationism", ["bold"]), "is a future society model which approves of");
	r.push("frightened or mindbroken slaves, glory holes, the arcade, and heavy tattoos and piercings; it disapproves of", App.Encyclopedia.Dialog.linkDOM("trusting", "Trust", "mediumaquamarine"), "(except for the Head Girl and Recruiter) and slaves choosing their own assignments.");
	r.toNode("div");
	App.Events.addNode(t, ["Makes intelligent slaves less attractive and stupid slaves more attractive."], "div", ["indent"]);
	App.Events.addNode(t, ["Can apply unique names to slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Drives an increase in the ratio of slaves to citizens."], "div", ["indent"]);
	App.Events.addNode(t, ["Eliminates the", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"),  "penalty for operating an arcade along with fining citizens who injure whores and public servants."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to increase demand for glory holes and arcades."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for: brutal slave breaking, stupid slaves and cruelly altered slaves from the", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Paternalism.", "Paternalism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Body Purism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Body Purism", ["bold"]), "is a future society model which approves of");
	r.push("unimplanted slaves and no heavy tattoos or piercings; disapproves of implants.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves value of slaves without implants."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to affect goods seen in the slave market and work towards a solution to the long term effects of drug use."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for slaves without implants from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Transformation Fetishism.", "Transformation Fetishism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Transformation Fetishism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Transformation Fetishism", ["bold"]), "is a future society model which approves of");
	r.push("implants and extreme surgery; disapproves of slaves without implants.");
	r.toNode("div");
	App.Events.addNode(t, ["Reduces value of slaves without implants."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to radically affect goods seen in the slave market."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for slaves with implants from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Body Purism.", "Body Purism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Maturity Preferentialism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Maturity Preferentialism", ["bold"]), "is a future society model which approves of");
	r.push("older slaves.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves value of older slaves, but reduces value of young slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Will not entirely eliminate the usual preference for younger slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to make it easier for older player characters to maintain", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"), "and advance the arcology's prosperity."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for older slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Youth Preferentialism.", "Youth Preferentialism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Youth Preferentialism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Youth Preferentialism", ["bold"]), "is a future society model which approves of");
	r.push("younger slaves.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves value of younger slaves, but reduces value of old slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to make it easier for younger player characters to maintain", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"), "and advance the arcology's prosperity."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for young slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Maturity Preferentialism.", "Maturity Preferentialism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Slimness Enthusiasm", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Slimness Enthusiasm", ["bold"]), "is a future society model which approves of");
	r.push("slaves with girlish figures; disapproves of slaves with stacked figures.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves value of slim slaves, but reduces value of stacked slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to affect goods seen in the slave market and improve slave health."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for unexpanded slaves at a healthy weight from", App.Encyclopedia.Dialog.linkDOM("The Corporation", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Asset Expansionism.", "Asset Expansionism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Asset Expansionism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Asset Expansionism", ["bold"]), "is a future society model which approves of");
	r.push("slaves with very large body parts.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves value of stacked slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to radically affect goods seen in the slave market."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for asset expansion from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Slimness Enthusiasm.", "Slimness Enthusiasm")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Pastoralism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Pastoralism", ["bold"]), "is a future society model which approves of");
	r.push("lactation, cockmilking, and the dairy.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves value of milk and semen."], "div", ["indent"]);
	App.Events.addNode(t, ["Drives an increase in the ratio of slaves to citizens."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to massively improve value of milk and semen."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for production focused asset expansion from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Physical Idealism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Physical Idealism", ["bold"]), "is a future society model which approves of");
	r.push("musculature, height, and health.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves value of slaves with", App.Encyclopedia.Dialog.linkDOM("muscles.", "Musculature")]);
	App.Events.addNode(t, ["Can be developed to affect goods seen in the slave market."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for muscular slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Hedonistic Decadence.", "Hedonistic Decadence")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Chattel Religionism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	const devotion = (text="devotion") => App.Encyclopedia.Dialog.linkDOM(text, "From Rebellious to Devoted", "hotpink");
	const chattelReligionism = ["appropriate clothing", devotion("high devotion"), App.Encyclopedia.Dialog.linkDOM("slave marriages")];

	r.push(App.UI.DOM.makeElement("span", "Chattel Religionism", ["bold"]), "is a future society model which approves of");
	r.push(App.UI.DOM.toSentence(chattelReligionism), "while disapproving of slutty clothing.");
	r.toNode("div");
	App.Events.addNode(t, ["Applies a small", devotion(), "boost to all slaves, and can remove the weekly", devotion(), "gain cap."], "div", ["indent"]);
	App.Events.addNode(t, ["Drives an increase in the ratio of slaves to citizens."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to permanently boost", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"), "and quicken slaves' mental conditioning."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for sexual training from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Multiculturalism.", "Multiculturalism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Multiculturalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Multiculturalism", ["bold"]), "is a future society model which approves of");
	r.push("is a future society model which advances differently than other models: it is improved by the investment of more future society model slots, which can be withdrawn individually if desired. No other advancement occurs and all benefits at each level are available instantly.");
	r.toNode("div");
	App.Events.addNode(t, ["Each week provides free", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"), "and increases arcology prosperity."], "div", ["indent"]);
	App.Events.addNode(t, ["Helps prevent citizens from falling into slavery, slowing population drift towards slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Chattel Religionism.", "Chattel Religionism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Roman Revivalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Roman Revivalism", ["bold"]), "is a future society model which approves of");
	r.push("good leadership qualities like wealth and strong defense; disapproves of debt.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves rate of prosperity gain and at high levels will drive down all slave prices."], "div", ["indent"]);
	App.Events.addNode(t, ["Can apply unique names to slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Slows increases in the ratio of slaves to citizens."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to greatly improve the arcology's resistance to insurrection."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for basic educations from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with the other Revivalist models."], "div", ["indent"]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Egyptian Revivalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Egyptian Revivalism", ["bold"]), "is a future society model which approves of");
	r.push("keeping a large harem, slave incest, and having a wide racial variety of public slaves.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves value of slaves in incestuous relationships and efficiency of fucktoys in improving", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green")]);
	App.Events.addNode(t, ["Can apply unique names to slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Slows increases in the ratio of slaves to citizens."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to improve the Head Girl position, with an additional bonus for Head Girls married to the Concubine, and a massive bonus if the Head Girl is also related to the Concubine."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for exotic accents from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with the other Revivalist models."], "div", ["indent"]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Edo Revivalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Edo Revivalism", ["bold"]), "is a future society model which approves of");
	r.push("provision for the arcology's cultural development by providing a large number of public servants or club girls, which increases with", App.Encyclopedia.Dialog.linkDOM("reputation.", "Arcologies and Reputation", "green"), "and disapproves of failure to do so.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves efficiency of public servants and club girls."], "div", ["indent"]);
	App.Events.addNode(t, ["Greatly improves beauty of Japanese slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to greatly improve the efficiency of direct spending on future societies."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for unaccented slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with the other Revivalist models."], "div", ["indent"]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Arabian Revivalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Arabian Revivalism", ["bold"]), "is a future society model which approves of");
	r.push("keeping a large number of fucktoys and slaves in the master suite, which increases with", App.Encyclopedia.Dialog.linkDOM("reputation", "Arcologies and Reputation", "green"), "and disapproves of failure to do so.");
	r.toNode("div");
	App.Events.addNode(t, ["Grants a bonus to the price received when selling slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to improve the efficiency of direct spending on future societies and moderately increase rents."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for more", App.Encyclopedia.Dialog.linkDOM("devoted", "From Rebellious to Devoted", "hotpink"), "slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with the other Revivalist models."], "div", ["indent"]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Chinese Revivalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Chinese Revivalism", ["bold"]), "is a future society model which approves of");
	r.push("maintaining a solid imperial administration by keeping a Head Girl, a Recruiter, and a Bodyguard; disapproves of failure to do so.");
	r.toNode("div");
	App.Events.addNode(t, ["Increases prosperity growth when all three of these positions are staffed."], "div", ["indent"]);
	App.Events.addNode(t, ["Greatly improves beauty of Chinese slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to permit the Head Girl to see to an additional slave each week."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for", App.UI.DOM.makeElement("span", "intelligence", ["cyan"]), "from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with the other Revivalist models."], "div", ["indent"]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Repopulationism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Repopulation Focus", ["bold"]), "is a future society model. It:");
	r.toNode("div");
	App.Events.addNode(t, ["Approves of pregnant slaves and slaves that have given birth."], "div", ["indent"]);
	App.Events.addNode(t, ["Improves value and beauty of pregnant slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to radically affect goods seen in the slave market."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for lactating slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Provides demand for young slaves from the corporation."], "div", ["indent"]);
	App.Events.addNode(t, ["Is mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Eugenics.", "Eugenics Focus")]);
	r.push("Repopulationism is a difficult Future Society and not recommended for beginners. Try to keep as many slaves as possible visibly pregnant; if they're pregnant but not showing yet, Pregnancy Biometrics Collars can help.");
	r.toNode("p", ["note", "yellow"]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Eugenics Focus", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Eugenics", ["bold"]), "is a future society model. It:");
	r.toNode("div");
	App.Events.addNode(t, ["Disapproves of slave reproduction."], "div", ["indent"]);
	App.Events.addNode(t, ["Drastically reduces value and beauty of pregnant slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Opens benefits exclusive to the connections made by the powerful individuals attracted to the arcology."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for; gelded, skilled and smart slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation", "The Corporation")]);
	App.Events.addNode(t, ["Is mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Repopulation Focus.", "Repopulationism")]);
	App.Events.addNode(t, ["It is made up of four to five social classes: Slaves, low class citizens, chosen slaves, elite citizens, and the Societal Elite: a group of individuals with vast connections and wealth attracted by the promises of a society built around them. Low class citizens are encouraged to face testing and join the ranks of the elite, though the cost of failing the test is sterilization; a detail that is not revealed until after the test is complete."], "div", ["indent"]);
	r.push(App.UI.DOM.makeElement("span", "Eugenics is a difficult Future Society and not recommended for beginners. For a more complete guide to playing with a Eugenics arcology, see the", ["yellow"]), App.UI.DOM.makeElement("span", App.Encyclopedia.Dialog.linkDOM("Guide to Eugenics.", "Guide to Eugenics"), ["yellow"]));
	r.toNode("p", ["note"]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Slave Professionalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Slave Professionalism", ["bold"]), "is a future society model. It:");
	r.toNode("div");
	App.Events.addNode(t, ["Approves of intelligent, well-trained slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Improves value and beauty of smart slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Dislikes slaves ruled by their libido."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to radically affect goods seen in the slave market"], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for; smart, educated and trained", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Is mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Intellectual Dependency.", "Intellectual Dependency")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Intellectual Dependency", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Intellectual Dependency", ["bold"]), "is a future society model. It:");
	r.toNode("div");
	App.Events.addNode(t, ["Approves of horny, vapid slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Improves value and beauty of moronic slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to adore bimbo bodies or radically affect goods seen in the slave market."], "div", ["indent"]);
	App.Events.addNode(t, ["Allows for", App.Encyclopedia.Dialog.linkDOM("the Schoolroom", "Schoolroom"), "to be radically redesigned."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for; idiotic, young and uneducated slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Is mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Slave Professionalism.", "Slave Professionalism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Petite Admiration", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Petite Admiration", ["bold"]), "is a future society model. It:");
	r.toNode("div");
	App.Events.addNode(t, [`Approves of slaves shorter than ${lengthToEitherUnit(160)}.`]);
	App.Events.addNode(t, ["Improves value and beauty of sufficiently short slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to accept relative shortness or radically affect goods seen in the slave market."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for shorter slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Is mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Statuesque Glorification.", "Statuesque Glorification")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Statuesque Glorification", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Statuesque Glorification", ["bold"]), "is a future society model. It:");
	r.toNode("div");
	App.Events.addNode(t, [`Approves of slaves taller than ${lengthToEitherUnit(170)}.`]);
	App.Events.addNode(t, ["Improves value and beauty of sufficiently tall slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to accept relative tallness or radically affect goods seen in the slave market."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for taller slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Is mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Petite Admiration.", "Petite Admiration")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Hedonistic Decadence", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Hedonistic Decadence", ["bold"]), "is a future society model. It:");
	r.toNode("div");
	App.Events.addNode(t, ["Approves of overindulgence and luxury."], "div", ["indent"]);
	App.Events.addNode(t, ["Improves value and beauty of heavyset slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to radically affect goods seen in the slave market."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for pampered and skilled slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with", App.Encyclopedia.Dialog.linkDOM("Physical Idealism.", "Physical Idealism")]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Aztec Revivalism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Aztec Revivalism", ["bold"]), "is a future society model which approves of");
	r.push("qualities like good military education and an older leader.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves all military acquisitions of slaves and allows for the sacrifice of slaves for", App.Encyclopedia.Dialog.linkDOM("reputation.", "Arcologies and Reputation", "green"),]);
	App.Events.addNode(t, ["Can apply unique names to slaves."], "div", ["indent"]);
	App.Events.addNode(t, ["Slows increases in the ratio of slaves to citizens."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to greatly rely on the Head Girl position as an advisor and assistant."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for menial slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with the other Revivalist models."], "div", ["indent"]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Neo-Imperialism", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);
	r.push(App.UI.DOM.makeElement("span", "Neo-Imperialism", ["bold"]), "is a future society model which approves of");
	r.push("high wealth, prosperity, and personal combat skills and disapproves of weakness and poverty in leaders.");
	r.toNode("div");
	App.Events.addNode(t, ["Improves rate of prosperity gain and can be developed to increase rents via Imperial Barons."], "div", ["indent"]);
	App.Events.addNode(t, ["Slows increases in the ratio of slaves to citizens."], "div", ["indent"]);
	App.Events.addNode(t, ["Can be developed to improve the Arcology's combat prowess and resistance to insurrection via Imperial Knights."], "div", ["indent"]);
	App.Events.addNode(t, ["Provides demand for healthy slaves from", App.Encyclopedia.Dialog.linkDOM("The Corporation.", "The Corporation")]);
	App.Events.addNode(t, ["Mutually exclusive with all Revivalist models."], "div", ["indent"]);
	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Gender Radicalism Research", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);

	r.push("Advanced Gender Radicalist societies can fund research to produce modified uteri and ovaries designed to be implanted into male slaves to grant them the ability to become pregnant, thus leaving no gender specific traits remaining.");
	r.toNode("div");

	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Slave Professionalism Research", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);

	r.push("Advanced Slave Professionalism societies can fund efforts to synthesize a compound capable of improving mental capacities.");
	r.toNode("div");

	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Transformation Fetishism Research", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);

	r.push("Advanced Transformation Fetishist societies can fund research to produce implants capable of reaching previously undocumented sizes.");
	r.toNode("div");

	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Asset Expansionist Research", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);

	r.push("Advanced Asset Expansionist societies can fund research to produce extremely powerful growth drugs capable of growing body parts to previously undocumented sizes. Drugs are also standardized in slave diets to prevent loss of asset size. Due to the rapid growth in said assets, and the strength of the drug cocktails, slaves are more likely to develop side effects of excessive drug use.");
	r.toNode("div");

	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Slimness Enthusiast Research", function() {
	const t = new DocumentFragment();

	App.Events.addNode(t, ["Advanced Slimness Enthusiast societies can fund research into several drugs designed to slim slaves down."], "div");
	App.Events.addNode(t, ["They include:"], "div");
	App.Events.addNode(t, ["Appetite suppressants to make dieting easier."], "div", ["indent"]);
	App.Events.addNode(t, ["Redistributors to draw fat from oversized assets and settle them around the slave's core for easy removal."], "div", ["indent"]);
	App.Events.addNode(t, ["Atrophiers to shrink non-fat based assets."], "div", ["indent"]);

	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Youth Preferentialism Research", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);

	r.push("Specialized creams built off of stem cells and several ingredients known for reducing the ravages of age. Steady use leaves a slave looking younger, though the effects are literally skin deep; several gossip pieces have run about celebrities bedding youthful slaves just to accidentally find their efforts resulting in a broken hip.");
	r.toNode("div");

	return t;
}, "FutureSocities");

App.Encyclopedia.addArticle("Hedonistic Decadence Research", function() {
	const t = new DocumentFragment();
	const r = new SpacedTextAccumulator(t);

	r.push("Advanced Hedonistic Decadence societies can purchase plans for specialized slave food. Said food is shaped to resemble actual food and flavored accordingly, however, its texture can only be described as gooey or gummy. A plus if that is how the food should be, but a shocker otherwise, given how tantalizing that steak looks after nothing but liquid slave food for so long. Since the food is essentially compacted liquid slave food, it is highly addictive thanks to the, typically, low presence of aphrodisiacs and can easily lead to excessive", App.Encyclopedia.Dialog.linkDOM("weight gain", "Weight"), "as slaves are driven to gorge themselves on it. They'll be happy, at least, as they steadily outgrow their clothes. Alterations to the recipe exist to prevent", App.Encyclopedia.Dialog.linkDOM("weight gain", "Weight"), "for Slimness Enthusiast societies and to cause gastric distress in Degradationist societies.");
	r.toNode("div");

	return t;
}, "FutureSocities");

App.Encyclopedia.addCategory("FutureSocities", function() {
	const t = new DocumentFragment();
	const vanilla = [];
	const modded = [];
	const research = [];

	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Ethnic Supremacy"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Ethnic Subjugationism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Gender Radicalism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Gender Fundamentalism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Paternalism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Degradationism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Body Purism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Transformation Fetishism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Maturity Preferentialism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Youth Preferentialism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Slimness Enthusiasm"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Asset Expansionism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Pastoralism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Physical Idealism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Chattel Religionism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Multiculturalism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Roman Revivalism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Egyptian Revivalism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Edo Revivalism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Arabian Revivalism"));
	vanilla.push(App.Encyclopedia.Dialog.linkDOM("Chinese Revivalism"));

	modded.push(App.Encyclopedia.Dialog.linkDOM("Repopulationism"));
	modded.push(App.Encyclopedia.Dialog.linkDOM("Eugenics Focus"));
	modded.push(App.Encyclopedia.Dialog.linkDOM("Slave Professionalism"));
	modded.push(App.Encyclopedia.Dialog.linkDOM("Intellectual Dependency"));
	modded.push(App.Encyclopedia.Dialog.linkDOM("Petite Admiration"));
	modded.push(App.Encyclopedia.Dialog.linkDOM("Statuesque Glorification"));
	modded.push(App.Encyclopedia.Dialog.linkDOM("Hedonistic Decadence"));
	modded.push(App.Encyclopedia.Dialog.linkDOM("Aztec Revivalism"));
	modded.push(App.Encyclopedia.Dialog.linkDOM("Neo-Imperialism"));

	research.push(App.Encyclopedia.Dialog.linkDOM("Gender Radicalism Research"));
	research.push(App.Encyclopedia.Dialog.linkDOM("Slave Professionalism Research"));
	research.push(App.Encyclopedia.Dialog.linkDOM("Transformation Fetishism Research"));
	research.push(App.Encyclopedia.Dialog.linkDOM("Asset Expansionist Research"));
	research.push(App.Encyclopedia.Dialog.linkDOM("Slimness Enthusiast Research"));
	research.push(App.Encyclopedia.Dialog.linkDOM("Youth Preferentialism Research"));
	research.push(App.Encyclopedia.Dialog.linkDOM("Hedonistic Decadence Research"));

	if (V.encyclopedia !== "Future Societies") {
		App.Events.addNode(t, ["Future Societies"], "div");
	}
	App.Events.addNode(t, ["Vanilla Future Societies:", App.UI.DOM.generateLinksStrip(vanilla)], "div");
	App.Events.addNode(t, ["Modded Future Societies:", App.UI.DOM.generateLinksStrip(modded)], "div");
	App.Events.addNode(t, ["Research:", App.UI.DOM.generateLinksStrip(research)], "div");
	return t;
});


code:
App.Encyclopedia.addArticle("Obtaining Slaves", function() {
	const f = new DocumentFragment();
	App.UI.DOM.appendNewElement("p", f, "Future room for lore text", "note");
	App.UI.DOM.appendNewElement("p", f, "Choose a more particular entry below:");
	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Kidnapped Slaves", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["Slavers, from disreputable to noble, visit the Free Cities in droves. Their merchandise is, as a rule, offered as-is and no questions asked. This usually means that their charges have been forcibly kidnapped. These slaves are generally rebellious, often unhealthy, and always cheap."]);

	App.Encyclopedia.addArticleSource(f, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Slave Schools", function() {
	const f = new DocumentFragment();
	let r;

	r = [];
	if (V.minimumSlaveAge < 16) {
		r.push("The Free Cities host what are referred to as 'orphanages,' but are in fact slave schools.");
	} else {
		r.push("It is not legal to own children in the Free Cities. It is however legal to hold an interest in future ownership of a child once they reach their 16th birthday. The Free Cities host what are referred to as 'orphanages,' but are in fact slave schools. Of course, instruction cannot include sexual training, so it instead focuses on obedience and fitness.");
	}
	App.Events.addParagraph(f, r);

	App.Events.addParagraph(f, ["The standard slave school produces merchandise to a strict mold. Their stock is guaranteed to be robustly healthy, at a sleek weight, body modification free, 16 to 19 years of age, very obedient, and 100% virgin. A few schools specialize in slaves with non-standard organs or in modified slaves, but most protect brand identity by confining themselves to natural females."]);

	App.Events.addParagraph(f, ["It has recently become common practice to begin treating such trainees with drugs years before sale. Not all orphanages engage in this questionable practice, usually justified as 'seeing to orphans' medical welfare,' but you will occasionally see fresh slaves sold with breasts and asses unusually well-developed for their age. These are very rare, as the newness of slavery means that few slaves have been so from a young age. Presumably, slaves treated in this way will become more common as the Free Cities mature."]);

	App.Encyclopedia.addArticleSource(f, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Stables", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["At any given time, many hundreds of new slaves are listed for sale in the Free City. Since these slaves have come through a training stable, they will tend to be fairly obedient, reasonably healthy, and have basic sexual skill, but will never be virgins."]);

	App.Encyclopedia.addArticleSource(f, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Household Liquidations", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["It is natural that where there is a demand for slaves who are related to one another, supply should arise."]);

	App.Events.addParagraph(f, ["Suppliers of slaves from the outside world are well aware that paired slaves, whether mothers and daughters or sisters, command a premium. This special merchandise is best found at dealers that specialize in it. After all, the demand is strong enough that only experienced dealers have the skill and equipment to defeat all the tricks suppliers are willing to use to pass slaves off as relatives."]);

	App.Events.addParagraph(f, ["Nature has contrived that the demand for twin slaves should far outstrip the supply. Since slavery is new, a majority of those now enslaved were born free, so this is difficult for slave trainers to address. However, the coming decades should see a great increase in the number of slave twins as breeders improve fertility treatments."]);

	App.Encyclopedia.addArticleSource(f, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Direct Sales", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["On occasion, an established slaveowner will sell a trained and modified slave due to financial need, because he is bored of her, or because he trains unique slaves as a hobby."]);

	App.Events.addParagraph(f, ["Some of the most powerful persons in the Free Cities also maneuver their enemies into selling a favorite slave as a way of bloodlessly showing dominance. The truly powerful occasionally feel the need to show that they can obtain any slave, at any time, regardless of her owners' wishes."]);

	App.Encyclopedia.addArticleSource(f, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Pre-Owned Slaves", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["The slaves left behind by the previous owner of your arcology are from a catalog of slaves that can also be accessed through the pre-owned slave vendor."]);

	// TODO: update link
	App.Events.addParagraph(f, ["Most of these slaves were submitted to the game by anons on /d/. If you'd like to submit a slave for addition to the game, you can do so at the GitGud development site."]);

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Discarded Slaves", function() {
	const f = new DocumentFragment();
	let r;

	App.Events.addParagraph(f, ["Slaves don't last forever in the Free Cities. Many don't even last until retirement, with broken minds and abused or over-used bodies."]);

	r = [];
	r.push("These slaves which have lost their value are often simply culled from the owners' herds, but may also be sold through");
	r.push(App.Encyclopedia.Dialog.linkDOM("the Flesh Heap", "The Flesh Heap"));
	r.push("as discount merchandise for new or cash-strapped slaveowners who can wring some final use out of them. Their new owners may end up using them as discount whores,");
	r.push(App.UI.DOM.combineNodes(App.Encyclopedia.Dialog.linkDOM("living sex toys", "Fuckdolls"), ","));
	r.push("or for medical testing.");
	App.Events.addParagraph(f, r);

	r = [];
	r.push("Some discarded slaves are also");
	r.push(App.Encyclopedia.topic("rescued"));
	r.push("by the so-called Slave Shelters. These charities place the discarded slaves with well-off slaveowners who are willing to invest the time and effort into caring for them, whether to restore them to serviceable condition or simply for humanitarian reasons. Abuse and resale of placed shelter slaves is generally prohibited, and most shelters attempt to enforce these terms with regular inspections.");
	App.Events.addParagraph(f, r);

	App.Encyclopedia.addArticleSource(f, "Guide to Modern Slavery, 2037 Edition", "Lawrence, W. G.");

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("The Flesh Heap", function() {
	const f = new DocumentFragment();
	let r;

	r = [];
	r.push("More of a trash heap than a slave market, the");
	r.push(App.Encyclopedia.topic("Flesh Heap"));
	r.push("is a dumping ground for thoroughly broken slaves. Relatively healthy bodies are usually scooped up for medical testing or other purposes; several that one wouldn't want to waste a valuable slave on. Anything with some sort of life in it is up for sale, usually at extremely low prices, though one gets what they pay for; most slaves are nothing more than vegetables. One would have to place a reserve should they want a mindless, healthy slave for whatever they seek.");
	App.Events.addParagraph(f, r);

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("The Job Fulfillment Center", function() {
	const f = new DocumentFragment();
	let r;

	r = [];
	r.push("If you are looking for a slave qualified for a specific role, look no further than the Traders Union that makes up the Job Fulfillment Center. Leave the job description and a list of desired traits and before long a suitable slave will be delivered to your doorstep and ready to serve you. Due to the nature of the business, these slaves are not");
	r.push(App.Encyclopedia.Dialog.linkDOM("cheap", "Money", "cash"));
	r.push("and usually not perfect, but they always fulfill their job adequately and obediently.");
	App.Events.addParagraph(f, r);

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addArticle("Wetware CPUs", function() {
	const f = new DocumentFragment();

	App.Events.addParagraph(f, ["Slaves stripped of all unneeded parts, attached to a VR world, and honed to near perfection. Their minds are peerless, but their bodies are broken; if one is able to overcome such an obstacle, a valuable slave awaits."]);

	return f;
}, "obtainingSlaves");

App.Encyclopedia.addCategory("obtainingSlaves", function() {
	const r = [];
	r.push(App.Encyclopedia.Dialog.linkDOM("Kidnapped Slaves", "Kidnapped Slaves"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Slave Schools", "Slave Schools"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Stables", "Stables"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Household Liquidations", "Household Liquidations"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Direct Sales", "Direct Sales"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Pre-Owned Slaves", "Pre-Owned Slaves"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Random Events", "Random Events"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Discarded Slaves", "Discarded Slaves"));
	r.push(App.Encyclopedia.Dialog.linkDOM("The Flesh Heap", "The Flesh Heap"));
	r.push(App.Encyclopedia.Dialog.linkDOM("The Job Fulfillment Center", "The Job Fulfillment Center"));
	r.push(App.Encyclopedia.Dialog.linkDOM("Wetware CPUs", "Wetware CPUs"));
	r.push(App.Encyclopedia.Dialog.linkDOM("The Corporation", "The Corporation"));
	return App.UI.DOM.generateLinksStrip(r);
});


code:
App.Encyclopedia.addArticle("RA Condition Editor", function() {
	/**
	 * @param {HTMLElement} container
	 * @param {string} col1
	 * @param {string} col2
	 * @param {string} col3
	 */
	function tableHead(container, col1, col2, col3) {
		App.UI.DOM.appendNewElement("div", container, col1, "head");
		App.UI.DOM.appendNewElement("div", container, col2, "head");
		App.UI.DOM.appendNewElement("div", container, col3, "head");
	}

	/**
	 * @param {ReadonlyMap<string, Getter<*>>} getters
	 */
	function getterTable(getters) {
		const container = document.createElement("p");
		container.classList.add("rule-help-table");

		tableHead(container, "Name", "Description", "Requirements");

		for (const getter of getters.values()) {
			if (getter.visible && !getter.visible()) {
				continue;
			}
			App.UI.DOM.appendNewElement("div", container, getter.name);
			App.UI.DOM.appendNewElement("div", container, getter.description);
			const div = document.createElement("div");
			if (getter.requirements) {
				div.append(getter.requirements);
			}
			container.append(div);
		}

		return container;
	}

	/**
	 * @param {HTMLElement} container
	 * @param {string} name
	 * @param {string} description
	 * @param {string} dataTypes
	 */
	function transformerRow(container, name, description, dataTypes) {
		App.UI.DOM.appendNewElement("div", container, name);
		App.UI.DOM.appendNewElement("div", container, description);
		App.UI.DOM.appendNewElement("div", container, dataTypes);
	}

	function transformerTable() {
		const el = document.createElement("p");
		el.classList.add("rule-help-table");

		tableHead(el, "Name", "Description", "Data types");

		transformerRow(el, "And", "True, if all input values are true.", "Boolean");
		transformerRow(el, "Or", "True, if at least one input value is true.", "Boolean");
		transformerRow(el, "Sum all", "Sums up all input values", "Number");
		transformerRow(el, "Multiply all", "Multiplies all input values", "Number");
		transformerRow(el, "Maximum", "Gives the largest input value", "Number");
		transformerRow(el, "Minimum", "Gives the smallest input value", "Number");
		transformerRow(el, "=, ≠", "Compares the input values based on the comparator in " +
			"the middle. Both sides need to have the same data type.", "Boolean, Number, String");
		transformerRow(el, "<, ⩽, >, ⩾", "Compares the input values based on the comparator in " +
			"the middle. Both sides need to have the same data type.", "Boolean, Number");
		transformerRow(el, "-", "Subtracts the second value from the first value", "Number");
		transformerRow(el, "/", "Divides the second value by the first value", "Number");
		transformerRow(el, "Contains", "True, if the second value is somewhere in the first value",
			"String");
		transformerRow(el, "Matches", "True, if the first value matches the regular expression in the second value",
			"String");
		transformerRow(el, "Not …", "Negates the input value.", "Boolean");
		transformerRow(el, "If … Then … Else …",
			"If the first value is true, returns the second value, otherwise the third value. The second " +
			"and third input value have to be the same data type.", "Boolean / Any");

		return el;
	}

	const acc = new SpacedTextAccumulator();

	acc.push("Rule conditions consist of two types of elements, data getters and data transformers. Data getters can " +
		"read out values from various places, which can then be used to base conditions on. Data transformers " +
		"take one or more elements as input and transform the input values into a single new value. Together they " +
		"can create complex conditions for activating rules.");
	acc.toParagraph();

	acc.push("To build a new condition drag the elements you need from the part browser into the main condition " +
		"field next to it.");
	acc.toParagraph();

	App.UI.DOM.appendNewElement("h2", acc.container(), "Finding errors");
	acc.push("It is possible to create element trees which are invalid, for example because the input value of an " +
		"element has the wrong data type. When this is the case there will be an error message above the rule " +
		"editor and the broken elements are marked. As long as there are errors the rule cannot be saved and will " +
		"revert to it's previous state when leaving the RA or editing another rule. In the error message the first " +
		"error corresponds to the innermost broken element. When solving errors it is advised to work from inside to " +
		"outside, as outer errors are often caused by errors further inside.");
	acc.toParagraph();

	App.UI.DOM.appendNewElement("h2", acc.container(), "Data transformers");
	acc.push("Data transformers can handle 3 different data types: Boolean, Number and String. Not all transformers " +
		"accept all data types. Number and Boolean can be used interchangeably, the conversion is as follows: " +
		"Putting a Number into a boolean transformer will interpret 0 as false and all other values as true. " +
		"Putting a Boolean into a number transformer will interpret false as 0 and true as 1.");
	acc.toParagraph();
	acc.container().append(transformerTable());

	App.UI.DOM.appendNewElement("h2", acc.container(), "Data getters");

	acc.push("There are a number of predefined getters which read values either from a slave or from the global " +
		"state. They always have a predefined data type.");
	acc.toParagraph();

	let c = acc.container();
	App.UI.DOM.appendNewElement("h3", c, "Boolean getters");
	c.append(getterTable(App.RA.Activation.getterManager.booleanGetters));
	App.UI.DOM.appendNewElement("h3", c, "Assignment getters");
	acc.push("A special type of boolean getters checking if the slave has the given assignment");
	acc.toParagraph();
	c = acc.container();
	c.append(getterTable(App.RA.Activation.getterManager.assignmentGetters));
	App.UI.DOM.appendNewElement("h3", c, "Number getters");
	c.append(getterTable(App.RA.Activation.getterManager.numberGetters));
	App.UI.DOM.appendNewElement("h3", c, "String getters");
	c.append(getterTable(App.RA.Activation.getterManager.stringGetters));

	App.UI.DOM.appendNewElement("h3", c, "Custom getters");
	acc.push("If greater freedom is required for the conditions needed, a custom data getter can be used.",
		"It operates on a context object with the following properties: slave: The slave currently tested against.",
		"It is required to explicitly set the return type. If the set type does not match the actual return type, " +
		"the condition evaluation will fail!");
	acc.toParagraph();
	acc.push("For example to get the slave name you can use");
	acc.push(App.UI.DOM.makeElement("span", "context => context.slave.slaveName", ["monospace"]));
	acc.push("and set the getter type to string.");
	acc.toParagraph();
	acc.push("Documentation for slave attributes can be found " +
		"here.");
	acc.toParagraph();

	return acc.container();
}, "beingInCharge");