@gramps-connect/story 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/editor/StoryEditor.tsx", "../spec/1.0/story.schema.json", "../src/generated/schemaValidator.js", "../src/version.ts", "../src/validate.ts", "../src/player/StoryPlayer.tsx", "../src/player/dates.ts", "../src/player/geo.ts", "../src/player/MapBackground.tsx", "../src/player/mapStyles.ts", "../src/player/theme.ts", "../src/player/MapModeControl.tsx", "../src/player/text.ts", "../src/player/strings.ts", "../src/player/TimelineStrip.tsx", "../src/player/timelineLayout.ts", "../src/editor/dates.ts", "../src/editor/DateField.tsx", "../src/editor/model.ts", "../src/editor/SlideList.tsx", "../src/editor/StoryTextField.tsx", "../src/editor/strings.ts"],
4
+ "sourcesContent": ["// Edits a story document: a list of slides on the left, the selected\n// slide's (or the story's own) fields in the middle, and the real player\n// on the right showing that slide as it's changed. Works on the document\n// only -- opening and saving files is the host's (the viewer site's editor\n// page does it with the File System Access API or a download).\n//\n// Needs Mantine: wrap it in a MantineProvider and load @mantine/core's\n// stylesheet, as with any Mantine component.\nimport { useCallback, useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport {\n ActionIcon, Badge, Box, Button, Divider, Group, Modal, Popover, Select, Stack, Text, TextInput, Tooltip, UnstyledButton,\n} from \"@mantine/core\";\nimport { useMediaQuery } from \"@mantine/hooks\";\nimport type { MediaItem, Slide, StoryDoc } from \"../types\";\nimport { validate, type StoryIssue } from \"../validate\";\nimport { StoryPlayer } from \"../player/StoryPlayer\";\nimport type { PlayerStrings } from \"../player/strings\";\nimport { suggestEdtf, type DateTextParser } from \"./dates\";\nimport { DateField } from \"./DateField\";\nimport {\n addSlide, deleteSlide, duplicateSlide, moveSlide, record, redo, startHistory, undo, updateSlide, updateStory,\n type History,\n} from \"./model\";\nimport { SlideList } from \"./SlideList\";\nimport { StoryTextField } from \"./StoryTextField\";\nimport { EDITOR_ENGLISH, type EditorStrings } from \"./strings\";\n\nconst BAR_HEIGHT = 56;\n/** The story's own settings, in place of a slide index. */\nconst STORY = -1;\n\nexport interface StoryEditorProps {\n /** The story to start from. Changing it later has no effect: remount\n * (a new `key`) to edit another. */\n initialStory: StoryDoc;\n /** The story's files, for checking that every media file is there. */\n files?: { has(path: string): boolean };\n /** As for StoryPlayer. */\n resolveMedia: (key: string, item: MediaItem) => Promise<string | null>;\n /** Called with the document after every change, undo and redo included. */\n onChange?: (doc: StoryDoc) => void;\n /** The host's own buttons (Open, Save, ...), at the right of the top bar. */\n toolbar?: ReactNode;\n /** Shown first in the top bar, e.g. ViewerBrand. */\n brand?: ReactNode;\n dark?: boolean;\n strings?: Partial<EditorStrings>;\n playerStrings?: Partial<PlayerStrings>;\n /** Date text -> EDTF. By default gramps-date, in the story's language. */\n parseDateText?: DateTextParser;\n}\n\n/** The slide an issue's JSON Pointer is about, or STORY. */\nfunction issueSlide(issue: StoryIssue): number {\n const match = /^\\/slides\\/(\\d+)/.exec(issue.path);\n return match ? Number(match[1]) : STORY;\n}\n\nfunction Thumb({ doc, slide, resolveMedia }: { doc: StoryDoc; slide: Slide; resolveMedia: StoryEditorProps[\"resolveMedia\"] }) {\n const ref = slide.media?.[0]?.ref;\n const item = ref && Object.prototype.hasOwnProperty.call(doc.media, ref) ? doc.media[ref] : undefined;\n const [url, setUrl] = useState<string | null>(null);\n useEffect(() => {\n let live = true;\n setUrl(null);\n if (ref && item) void resolveMedia(ref, item).then((u) => { if (live) setUrl(u); });\n return () => { live = false; };\n }, [ref, item, resolveMedia]);\n return (\n <Box\n w={40} h={40}\n style={{ flex: \"none\", borderRadius: 4, background: \"var(--mantine-color-default-hover)\", overflow: \"hidden\" }}\n >\n {url && <img src={url} alt=\"\" style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\", display: \"block\" }} />}\n </Box>\n );\n}\n\nexport function StoryEditor({\n initialStory, files, resolveMedia, onChange, toolbar, brand, dark = false, strings: stringOverrides, playerStrings,\n parseDateText = suggestEdtf,\n}: StoryEditorProps) {\n const strings = useMemo(() => ({ ...EDITOR_ENGLISH, ...stringOverrides }), [stringOverrides]);\n const [history, setHistory] = useState<History>(() => startHistory(initialStory));\n const [selected, setSelected] = useState(0);\n const [presenting, setPresenting] = useState(false);\n const [problemsOpen, setProblemsOpen] = useState(false);\n const wide = useMediaQuery(\"(min-width: 1000px)\", true);\n const doc = history.present;\n\n // Every change goes through here (and so into history and to the host).\n const apply = useCallback((next: StoryDoc, key?: string) => {\n setHistory((h) => record(h, next, key));\n }, []);\n useEffect(() => { onChange?.(doc); }, [doc, onChange]);\n\n const index = selected === STORY ? STORY : Math.min(selected, doc.slides.length - 1);\n const slide = index === STORY ? undefined : doc.slides[index];\n const setSlide = (patch: Partial<Slide>, key: string) => {\n if (index !== STORY) apply(updateSlide(history.present, index, patch), `${slide!.id}:${key}`);\n };\n\n const issues = useMemo(() => validate(doc, files).errors, [doc, files]);\n\n // Undo/redo from the keyboard, except where a text field has its own.\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (!(e.ctrlKey || e.metaKey) || e.altKey) return;\n const target = e.target as HTMLElement | null;\n if (target?.closest(\"input, textarea, [contenteditable=true]\")) return;\n const key = e.key.toLowerCase();\n if (key === \"z\" && !e.shiftKey) { e.preventDefault(); setHistory(undo); }\n else if ((key === \"z\" && e.shiftKey) || key === \"y\") { e.preventDefault(); setHistory(redo); }\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, []);\n\n const slideActions = slide && (\n <Group gap={6}>\n <Tooltip label={strings.moveUp}>\n <ActionIcon variant=\"default\" aria-label={strings.moveUp} disabled={index === 0}\n onClick={() => { apply(moveSlide(doc, index, index - 1)); setSelected(index - 1); }}>\u2191</ActionIcon>\n </Tooltip>\n <Tooltip label={strings.moveDown}>\n <ActionIcon variant=\"default\" aria-label={strings.moveDown} disabled={index === doc.slides.length - 1}\n onClick={() => { apply(moveSlide(doc, index, index + 1)); setSelected(index + 1); }}>\u2193</ActionIcon>\n </Tooltip>\n <Button variant=\"default\" size=\"xs\" onClick={() => { const r = duplicateSlide(doc, index); apply(r.doc); setSelected(r.index); }}>\n {strings.duplicateSlide}\n </Button>\n <Button variant=\"default\" size=\"xs\" color=\"red\" disabled={doc.slides.length <= 1}\n onClick={() => { const r = deleteSlide(doc, index); apply(r.doc); setSelected(r.index); }}>\n {strings.deleteSlide}\n </Button>\n </Group>\n );\n\n const storyForm = (\n <Stack gap=\"md\">\n <Text fw={600} size=\"lg\">{strings.story}</Text>\n <TextInput\n label={strings.title} required value={doc.title}\n onChange={(e) => apply(updateStory(doc, { title: e.currentTarget.value }), \"story:title\")}\n />\n <TextInput\n label={strings.language} description={strings.languageHint} w={260} value={doc.language ?? \"\"}\n onChange={(e) => apply(updateStory(doc, { language: e.currentTarget.value.trim() || undefined }), \"story:language\")}\n />\n <Select\n label={strings.map} w={320} allowDeselect={false}\n data={[\n { value: \"auto\", label: strings.mapAuto },\n { value: \"standard\", label: strings.mapStandard },\n { value: \"historical\", label: strings.mapHistorical },\n { value: \"none\", label: strings.mapNone },\n ]}\n value={doc.presentation?.basemap ?? \"auto\"}\n onChange={(value) => value && apply(updateStory(doc, {\n presentation: { ...doc.presentation, basemap: value as NonNullable<StoryDoc[\"presentation\"]>[\"basemap\"] },\n }))}\n />\n </Stack>\n );\n\n const slideForm = slide && (\n <Stack gap=\"md\" key={slide.id}>\n <Group justify=\"space-between\" wrap=\"wrap\" gap=\"xs\">\n <Text fw={600} size=\"lg\">{index === 0 ? strings.openingSlide : `${index + 1} / ${doc.slides.length}`}</Text>\n {slideActions}\n </Group>\n <TextInput\n label={strings.slideTitle} value={slide.title ?? \"\"}\n onChange={(e) => setSlide({ title: e.currentTarget.value || undefined }, \"title\")}\n />\n <DateField\n value={slide.date} language={doc.language} parse={parseDateText} strings={strings}\n onChange={(date) => setSlide({ date }, \"date\")}\n />\n <StoryTextField\n label={strings.text} value={slide.text ?? \"\"} boldLabel={strings.bold} italicLabel={strings.italic} minRows={5}\n onChange={(text) => setSlide({ text: text || undefined }, \"text\")}\n />\n {slide.place && (\n <Stack gap={2}>\n <Text size=\"sm\" fw={500}>{strings.place}</Text>\n <Text size=\"sm\">\n {slide.place.name ?? \"\"}\n {slide.place.lat !== undefined && slide.place.lon !== undefined && (\n <Text span c=\"dimmed\" size=\"sm\"> {slide.place.lat.toFixed(4)}, {slide.place.lon.toFixed(4)}</Text>\n )}\n </Text>\n </Stack>\n )}\n {slide.media && slide.media.length > 0 && (\n <Stack gap={4}>\n <Text size=\"sm\" fw={500}>{strings.photos}</Text>\n <Group gap=\"sm\">\n {slide.media.map((m, i) => (\n <Group key={i} gap=\"xs\" wrap=\"nowrap\">\n <Thumb doc={doc} slide={{ id: \"\", media: [m] }} resolveMedia={resolveMedia} />\n <Text size=\"xs\" c=\"dimmed\" maw={200} lineClamp={2}>{m.caption ?? \"\"}</Text>\n </Group>\n ))}\n </Group>\n </Stack>\n )}\n </Stack>\n );\n\n const list = (\n <Stack gap=\"xs\">\n <UnstyledButton\n onClick={() => setSelected(STORY)}\n style={{ padding: \"8px\", borderRadius: 6, background: index === STORY ? \"var(--mantine-primary-color-light)\" : undefined }}\n >\n <Text fw={600} size=\"sm\">{strings.story}</Text>\n <Text size=\"xs\" c=\"dimmed\">{strings.storySettings}</Text>\n </UnstyledButton>\n <Divider label={strings.slides} labelPosition=\"left\" />\n <SlideList\n label={strings.slides}\n items={doc.slides}\n selected={index}\n onSelect={setSelected}\n onMove={(from, to) => { apply(moveSlide(doc, from, to)); setSelected(to); }}\n getKey={(s) => s.id}\n renderItem={(s, i) => (\n <Group gap=\"sm\" wrap=\"nowrap\">\n <Thumb doc={doc} slide={s} resolveMedia={resolveMedia} />\n <Box style={{ minWidth: 0 }}>\n <Text size=\"sm\" fw={500} truncate dir=\"auto\" c={s.title ? undefined : \"dimmed\"}>\n {s.title || strings.untitledSlide}\n </Text>\n <Text size=\"xs\" c=\"dimmed\" truncate>{i === 0 ? strings.openingSlide : s.date?.text ?? \"\"}</Text>\n </Box>\n </Group>\n )}\n />\n <Button\n variant=\"light\" size=\"xs\" mt={4}\n onClick={() => { const r = addSlide(doc, index === STORY ? doc.slides.length - 1 : index); apply(r.doc); setSelected(r.index); }}\n >\n + {strings.addSlide}\n </Button>\n </Stack>\n );\n\n const preview = (\n <Box style={{ position: \"relative\", height: wide ? \"100%\" : 460, borderRadius: 8, overflow: \"hidden\", border: \"1px solid var(--mantine-color-default-border)\" }}>\n <StoryPlayer\n story={doc} resolveMedia={resolveMedia} dark={dark} strings={playerStrings}\n keyboard={false} initialSlide={index === STORY ? 0 : index}\n onSlideChange={(i) => { if (i !== index && index !== STORY) setSelected(i); }}\n />\n </Box>\n );\n\n const column = (children: ReactNode, width?: number | string) => (\n <Box\n style={{\n width, flex: width ? \"none\" : 1, minWidth: 0, padding: 16,\n overflowY: wide ? \"auto\" : undefined, height: wide ? \"100%\" : undefined,\n }}\n >\n {children}\n </Box>\n );\n\n return (\n <Box style={{ height: \"100%\", display: \"flex\", flexDirection: \"column\" }}>\n <Group\n h={BAR_HEIGHT} px=\"md\" gap=\"sm\" wrap=\"nowrap\" justify=\"space-between\"\n style={{ flex: \"none\", borderBottom: \"1px solid var(--mantine-color-default-border)\" }}\n >\n <Group gap=\"sm\" wrap=\"nowrap\" style={{ minWidth: 0 }}>\n {brand}\n <Text fw={600} truncate dir=\"auto\">{doc.title}</Text>\n </Group>\n <Group gap=\"xs\" wrap=\"nowrap\">\n {issues.length > 0 && (\n <Popover opened={problemsOpen} onChange={setProblemsOpen} width={360} position=\"bottom-end\" withArrow>\n <Popover.Target>\n <Badge color=\"red\" variant=\"light\" style={{ cursor: \"pointer\" }} onClick={() => setProblemsOpen((o) => !o)}>\n {strings.problems(issues.length)}\n </Badge>\n </Popover.Target>\n <Popover.Dropdown>\n <Stack gap={6}>\n {issues.map((issue, i) => {\n const at = issueSlide(issue);\n return (\n <UnstyledButton key={i} onClick={() => { setSelected(at); setProblemsOpen(false); }}>\n <Text size=\"sm\" fw={500}>{at === STORY ? strings.story : (doc.slides[at]?.title || `${strings.untitledSlide} ${at + 1}`)}</Text>\n <Text size=\"xs\" c=\"dimmed\">{issue.path} {issue.message}</Text>\n </UnstyledButton>\n );\n })}\n </Stack>\n </Popover.Dropdown>\n </Popover>\n )}\n <Tooltip label={strings.undo}>\n <ActionIcon variant=\"default\" size=\"lg\" aria-label={strings.undo} disabled={history.past.length === 0} onClick={() => setHistory(undo)}>\u21B6</ActionIcon>\n </Tooltip>\n <Tooltip label={strings.redo}>\n <ActionIcon variant=\"default\" size=\"lg\" aria-label={strings.redo} disabled={history.future.length === 0} onClick={() => setHistory(redo)}>\u21B7</ActionIcon>\n </Tooltip>\n <Button variant=\"default\" onClick={() => setPresenting(true)}>{strings.present}</Button>\n {toolbar}\n </Group>\n </Group>\n <Box\n style={{\n flex: 1, minHeight: 0, display: \"flex\", flexDirection: wide ? \"row\" : \"column\",\n overflowY: wide ? undefined : \"auto\",\n }}\n >\n {column(list, wide ? 280 : undefined)}\n {column(index === STORY ? storyForm : slideForm, wide ? \"min(520px, 36%)\" : undefined)}\n {column(preview)}\n </Box>\n <Modal opened={presenting} onClose={() => setPresenting(false)} fullScreen withCloseButton={false} padding={0}>\n <Box style={{ position: \"fixed\", inset: 0 }}>\n <StoryPlayer\n story={doc} resolveMedia={resolveMedia} dark={dark} strings={playerStrings}\n initialSlide={index === STORY ? 0 : index} onClose={() => setPresenting(false)}\n />\n </Box>\n </Modal>\n </Box>\n );\n}\n", "{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json\",\n \"title\": \"Gramps Connect Story, format 1.0\",\n \"description\": \"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).\",\n \"type\": \"object\",\n \"required\": [\"format\", \"version\", \"title\", \"slides\", \"media\"],\n \"properties\": {\n \"$schema\": { \"type\": \"string\" },\n \"format\": { \"const\": \"gramps-connect-story\" },\n \"version\": {\n \"description\": \"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.\",\n \"type\": \"string\",\n \"pattern\": \"^1\\\\.(0|[1-9][0-9]*)$\"\n },\n \"title\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"language\": {\n \"description\": \"BCP 47 language tag of the story's text, e.g. \\\"en\\\", \\\"de-CH\\\".\",\n \"type\": \"string\",\n \"pattern\": \"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"\n },\n \"created\": {\n \"description\": \"When the file was written, as an RFC 3339 date-time.\",\n \"type\": \"string\",\n \"pattern\": \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"\n },\n \"generator\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"version\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\" }\n }\n },\n \"authors\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"url\": { \"type\": \"string\" }\n }\n }\n },\n \"license\": {\n \"description\": \"License of the story's content (text and media), as an SPDX identifier or free text.\",\n \"type\": \"string\"\n },\n \"presentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"basemap\": { \"enum\": [\"standard\", \"historical\", \"auto\", \"none\"] }\n }\n },\n \"slides\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"$ref\": \"#/$defs/slide\" }\n },\n \"media\": {\n \"description\": \"Every media file in the story, keyed by an id that slides and overlays refer to.\",\n \"type\": \"object\",\n \"propertyNames\": { \"$ref\": \"#/$defs/id\" },\n \"additionalProperties\": { \"$ref\": \"#/$defs/mediaItem\" }\n },\n \"extensions\": {\n \"description\": \"Producer-specific data, keyed by namespace. Viewers ignore it.\",\n \"type\": \"object\",\n \"additionalProperties\": { \"type\": \"object\" }\n }\n },\n \"$defs\": {\n \"id\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Za-z0-9_-]{1,64}$\"\n },\n \"storyDate\": {\n \"type\": \"object\",\n \"required\": [\"text\"],\n \"properties\": {\n \"text\": {\n \"description\": \"The date as it should be shown, in the story's language.\",\n \"type\": \"string\",\n \"pattern\": \"\\\\S\"\n },\n \"edtf\": {\n \"description\": \"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).\",\n \"type\": \"string\",\n \"pattern\": \"\\\\S\"\n },\n \"sortYear\": {\n \"description\": \"Optional year (proleptic Gregorian) that places the slide on the timeline.\",\n \"type\": \"integer\"\n }\n }\n },\n \"slide\": {\n \"type\": \"object\",\n \"required\": [\"id\"],\n \"properties\": {\n \"id\": { \"$ref\": \"#/$defs/id\" },\n \"title\": { \"type\": \"string\" },\n \"text\": {\n \"description\": \"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.\",\n \"type\": \"string\"\n },\n \"date\": { \"$ref\": \"#/$defs/storyDate\" },\n \"place\": { \"$ref\": \"#/$defs/place\" },\n \"media\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/slideMedia\" }\n },\n \"people\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"\\\\S\" },\n \"role\": { \"type\": \"string\" }\n }\n }\n }\n }\n },\n \"slideMedia\": {\n \"type\": \"object\",\n \"required\": [\"ref\"],\n \"properties\": {\n \"ref\": { \"$ref\": \"#/$defs/id\" },\n \"caption\": { \"type\": \"string\" },\n \"credit\": { \"type\": \"string\" }\n }\n },\n \"place\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"lat\": { \"type\": \"number\", \"minimum\": -90, \"maximum\": 90 },\n \"lon\": { \"type\": \"number\", \"minimum\": -180, \"maximum\": 180 },\n \"geometry\": {\n \"description\": \"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.\",\n \"type\": \"object\",\n \"required\": [\"type\"],\n \"properties\": { \"type\": { \"type\": \"string\" } },\n \"additionalProperties\": true\n },\n \"overlays\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/overlay\" }\n }\n },\n \"dependentRequired\": {\n \"lat\": [\"lon\"],\n \"lon\": [\"lat\"]\n }\n },\n \"lonLat\": {\n \"type\": \"array\",\n \"prefixItems\": [\n { \"type\": \"number\", \"minimum\": -180, \"maximum\": 180 },\n { \"type\": \"number\", \"minimum\": -90, \"maximum\": 90 }\n ],\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"overlay\": {\n \"type\": \"object\",\n \"required\": [\"media\", \"corners\"],\n \"properties\": {\n \"media\": { \"$ref\": \"#/$defs/id\" },\n \"corners\": {\n \"description\": \"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.\",\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/lonLat\" },\n \"minItems\": 4,\n \"maxItems\": 4\n },\n \"opacity\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"order\": {\n \"description\": \"Stacking order among a slide's overlays; lower is drawn first.\",\n \"type\": \"integer\"\n },\n \"date\": { \"$ref\": \"#/$defs/storyDate\" }\n }\n },\n \"mediaItem\": {\n \"type\": \"object\",\n \"required\": [\"src\", \"mime\"],\n \"properties\": {\n \"src\": {\n \"description\": \"Path of the file inside the zip, relative to its root. No leading slash, no \\\"..\\\" segments.\",\n \"type\": \"string\",\n \"pattern\": \"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"\n },\n \"mime\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z]+/[A-Za-z0-9.+-]+$\"\n },\n \"width\": { \"type\": \"integer\", \"minimum\": 1 },\n \"height\": { \"type\": \"integer\", \"minimum\": 1 },\n \"alt\": { \"type\": \"string\" }\n }\n }\n }\n}\n", "// GENERATED by scripts/generate-validator.mjs from spec/1.0/story.schema.json -- do not edit.\n// @ts-nocheck\n\"use strict\";export const validate = validate20;export default validate20;const schema31 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json\",\"title\":\"Gramps Connect Story, format 1.0\",\"description\":\"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).\",\"type\":\"object\",\"required\":[\"format\",\"version\",\"title\",\"slides\",\"media\"],\"properties\":{\"$schema\":{\"type\":\"string\"},\"format\":{\"const\":\"gramps-connect-story\"},\"version\":{\"description\":\"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.\",\"type\":\"string\",\"pattern\":\"^1\\\\.(0|[1-9][0-9]*)$\"},\"title\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"language\":{\"description\":\"BCP 47 language tag of the story's text, e.g. \\\"en\\\", \\\"de-CH\\\".\",\"type\":\"string\",\"pattern\":\"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"},\"created\":{\"description\":\"When the file was written, as an RFC 3339 date-time.\",\"type\":\"string\",\"pattern\":\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"},\"generator\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"version\":{\"type\":\"string\"},\"url\":{\"type\":\"string\"}}},\"authors\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"url\":{\"type\":\"string\"}}}},\"license\":{\"description\":\"License of the story's content (text and media), as an SPDX identifier or free text.\",\"type\":\"string\"},\"presentation\":{\"type\":\"object\",\"properties\":{\"basemap\":{\"enum\":[\"standard\",\"historical\",\"auto\",\"none\"]}}},\"slides\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/$defs/slide\"}},\"media\":{\"description\":\"Every media file in the story, keyed by an id that slides and overlays refer to.\",\"type\":\"object\",\"propertyNames\":{\"$ref\":\"#/$defs/id\"},\"additionalProperties\":{\"$ref\":\"#/$defs/mediaItem\"}},\"extensions\":{\"description\":\"Producer-specific data, keyed by namespace. Viewers ignore it.\",\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}}},\"$defs\":{\"id\":{\"type\":\"string\",\"pattern\":\"^[A-Za-z0-9_-]{1,64}$\"},\"storyDate\":{\"type\":\"object\",\"required\":[\"text\"],\"properties\":{\"text\":{\"description\":\"The date as it should be shown, in the story's language.\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"edtf\":{\"description\":\"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"sortYear\":{\"description\":\"Optional year (proleptic Gregorian) that places the slide on the timeline.\",\"type\":\"integer\"}}},\"slide\":{\"type\":\"object\",\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/$defs/id\"},\"title\":{\"type\":\"string\"},\"text\":{\"description\":\"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.\",\"type\":\"string\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"},\"place\":{\"$ref\":\"#/$defs/place\"},\"media\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/slideMedia\"}},\"people\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"role\":{\"type\":\"string\"}}}}}},\"slideMedia\":{\"type\":\"object\",\"required\":[\"ref\"],\"properties\":{\"ref\":{\"$ref\":\"#/$defs/id\"},\"caption\":{\"type\":\"string\"},\"credit\":{\"type\":\"string\"}}},\"place\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"lat\":{\"type\":\"number\",\"minimum\":-90,\"maximum\":90},\"lon\":{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},\"geometry\":{\"description\":\"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.\",\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\"}},\"additionalProperties\":true},\"overlays\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/overlay\"}}},\"dependentRequired\":{\"lat\":[\"lon\"],\"lon\":[\"lat\"]}},\"lonLat\":{\"type\":\"array\",\"prefixItems\":[{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},{\"type\":\"number\",\"minimum\":-90,\"maximum\":90}],\"minItems\":2,\"maxItems\":2},\"overlay\":{\"type\":\"object\",\"required\":[\"media\",\"corners\"],\"properties\":{\"media\":{\"$ref\":\"#/$defs/id\"},\"corners\":{\"description\":\"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/lonLat\"},\"minItems\":4,\"maxItems\":4},\"opacity\":{\"type\":\"number\",\"minimum\":0,\"maximum\":1},\"order\":{\"description\":\"Stacking order among a slide's overlays; lower is drawn first.\",\"type\":\"integer\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"}}},\"mediaItem\":{\"type\":\"object\",\"required\":[\"src\",\"mime\"],\"properties\":{\"src\":{\"description\":\"Path of the file inside the zip, relative to its root. No leading slash, no \\\"..\\\" segments.\",\"type\":\"string\",\"pattern\":\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"},\"mime\":{\"type\":\"string\",\"pattern\":\"^[a-z]+/[A-Za-z0-9.+-]+$\"},\"width\":{\"type\":\"integer\",\"minimum\":1},\"height\":{\"type\":\"integer\",\"minimum\":1},\"alt\":{\"type\":\"string\"}}}}};const schema33 = {\"type\":\"string\",\"pattern\":\"^[A-Za-z0-9_-]{1,64}$\"};const schema43 = {\"type\":\"object\",\"required\":[\"src\",\"mime\"],\"properties\":{\"src\":{\"description\":\"Path of the file inside the zip, relative to its root. No leading slash, no \\\"..\\\" segments.\",\"type\":\"string\",\"pattern\":\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"},\"mime\":{\"type\":\"string\",\"pattern\":\"^[a-z]+/[A-Za-z0-9.+-]+$\"},\"width\":{\"type\":\"integer\",\"minimum\":1},\"height\":{\"type\":\"integer\",\"minimum\":1},\"alt\":{\"type\":\"string\"}}};const pattern4 = new RegExp(\"^1\\\\.(0|[1-9][0-9]*)$\", \"u\");const pattern5 = new RegExp(\"\\\\S\", \"u\");const pattern6 = new RegExp(\"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\", \"u\");const pattern7 = new RegExp(\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\", \"u\");const pattern10 = new RegExp(\"^[A-Za-z0-9_-]{1,64}$\", \"u\");const pattern19 = new RegExp(\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\", \"u\");const pattern20 = new RegExp(\"^[a-z]+/[A-Za-z0-9.+-]+$\", \"u\");const schema32 = {\"type\":\"object\",\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/$defs/id\"},\"title\":{\"type\":\"string\"},\"text\":{\"description\":\"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.\",\"type\":\"string\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"},\"place\":{\"$ref\":\"#/$defs/place\"},\"media\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/slideMedia\"}},\"people\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"required\":[\"name\"],\"properties\":{\"name\":{\"type\":\"string\",\"pattern\":\"\\\\S\"},\"role\":{\"type\":\"string\"}}}}}};const schema34 = {\"type\":\"object\",\"required\":[\"text\"],\"properties\":{\"text\":{\"description\":\"The date as it should be shown, in the story's language.\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"edtf\":{\"description\":\"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).\",\"type\":\"string\",\"pattern\":\"\\\\S\"},\"sortYear\":{\"description\":\"Optional year (proleptic Gregorian) that places the slide on the timeline.\",\"type\":\"integer\"}}};const schema35 = {\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"lat\":{\"type\":\"number\",\"minimum\":-90,\"maximum\":90},\"lon\":{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},\"geometry\":{\"description\":\"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.\",\"type\":\"object\",\"required\":[\"type\"],\"properties\":{\"type\":{\"type\":\"string\"}},\"additionalProperties\":true},\"overlays\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/overlay\"}}},\"dependentRequired\":{\"lat\":[\"lon\"],\"lon\":[\"lat\"]}};const schema36 = {\"type\":\"object\",\"required\":[\"media\",\"corners\"],\"properties\":{\"media\":{\"$ref\":\"#/$defs/id\"},\"corners\":{\"description\":\"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.\",\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/lonLat\"},\"minItems\":4,\"maxItems\":4},\"opacity\":{\"type\":\"number\",\"minimum\":0,\"maximum\":1},\"order\":{\"description\":\"Stacking order among a slide's overlays; lower is drawn first.\",\"type\":\"integer\"},\"date\":{\"$ref\":\"#/$defs/storyDate\"}}};const schema38 = {\"type\":\"array\",\"prefixItems\":[{\"type\":\"number\",\"minimum\":-180,\"maximum\":180},{\"type\":\"number\",\"minimum\":-90,\"maximum\":90}],\"minItems\":2,\"maxItems\":2};function validate23(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate23.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.media === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"media\"},message:\"must have required property '\"+\"media\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.corners === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"corners\"},message:\"must have required property '\"+\"corners\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.media !== undefined){let data0 = data.media;if(typeof data0 === \"string\"){if(!pattern10.test(data0)){const err2 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.corners !== undefined){let data1 = data.corners;if(Array.isArray(data1)){if(data1.length > 4){const err4 = {instancePath:instancePath+\"/corners\",schemaPath:\"#/properties/corners/maxItems\",keyword:\"maxItems\",params:{limit: 4},message:\"must NOT have more than 4 items\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data1.length < 4){const err5 = {instancePath:instancePath+\"/corners\",schemaPath:\"#/properties/corners/minItems\",keyword:\"minItems\",params:{limit: 4},message:\"must NOT have fewer than 4 items\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}const len0 = data1.length;for(let i0=0; i0<len0; i0++){let data2 = data1[i0];if(Array.isArray(data2)){if(data2.length > 2){const err6 = {instancePath:instancePath+\"/corners/\" + i0,schemaPath:\"#/$defs/lonLat/maxItems\",keyword:\"maxItems\",params:{limit: 2},message:\"must NOT have more than 2 items\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data2.length < 2){const err7 = {instancePath:instancePath+\"/corners/\" + i0,schemaPath:\"#/$defs/lonLat/minItems\",keyword:\"minItems\",params:{limit: 2},message:\"must NOT have fewer than 2 items\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}const len1 = data2.length;if(len1 > 0){let data3 = data2[0];if((typeof data3 == \"number\") && (isFinite(data3))){if(data3 > 180 || isNaN(data3)){const err8 = {instancePath:instancePath+\"/corners/\" + i0+\"/0\",schemaPath:\"#/$defs/lonLat/prefixItems/0/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 180},message:\"must be <= 180\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data3 < -180 || isNaN(data3)){const err9 = {instancePath:instancePath+\"/corners/\" + i0+\"/0\",schemaPath:\"#/$defs/lonLat/prefixItems/0/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -180},message:\"must be >= -180\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/corners/\" + i0+\"/0\",schemaPath:\"#/$defs/lonLat/prefixItems/0/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(len1 > 1){let data4 = data2[1];if((typeof data4 == \"number\") && (isFinite(data4))){if(data4 > 90 || isNaN(data4)){const err11 = {instancePath:instancePath+\"/corners/\" + i0+\"/1\",schemaPath:\"#/$defs/lonLat/prefixItems/1/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 90},message:\"must be <= 90\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data4 < -90 || isNaN(data4)){const err12 = {instancePath:instancePath+\"/corners/\" + i0+\"/1\",schemaPath:\"#/$defs/lonLat/prefixItems/1/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -90},message:\"must be >= -90\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+\"/corners/\" + i0+\"/1\",schemaPath:\"#/$defs/lonLat/prefixItems/1/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath:instancePath+\"/corners/\" + i0,schemaPath:\"#/$defs/lonLat/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {instancePath:instancePath+\"/corners\",schemaPath:\"#/properties/corners/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.opacity !== undefined){let data5 = data.opacity;if((typeof data5 == \"number\") && (isFinite(data5))){if(data5 > 1 || isNaN(data5)){const err16 = {instancePath:instancePath+\"/opacity\",schemaPath:\"#/properties/opacity/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 1},message:\"must be <= 1\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data5 < 0 || isNaN(data5)){const err17 = {instancePath:instancePath+\"/opacity\",schemaPath:\"#/properties/opacity/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}else {const err18 = {instancePath:instancePath+\"/opacity\",schemaPath:\"#/properties/opacity/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.order !== undefined){let data6 = data.order;if(!(((typeof data6 == \"number\") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){const err19 = {instancePath:instancePath+\"/order\",schemaPath:\"#/properties/order/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.date !== undefined){let data7 = data.date;if(data7 && typeof data7 == \"object\" && !Array.isArray(data7)){if(data7.text === undefined){const err20 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data7.text !== undefined){let data8 = data7.text;if(typeof data8 === \"string\"){if(!pattern5.test(data8)){const err21 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data7.edtf !== undefined){let data9 = data7.edtf;if(typeof data9 === \"string\"){if(!pattern5.test(data9)){const err23 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data7.sortYear !== undefined){let data10 = data7.sortYear;if(!(((typeof data10 == \"number\") && (!(data10 % 1) && !isNaN(data10))) && (isFinite(data10)))){const err25 = {instancePath:instancePath+\"/date/sortYear\",schemaPath:\"#/$defs/storyDate/properties/sortYear/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}else {const err26 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}}else {const err27 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}validate23.errors = vErrors;return errors === 0;}validate23.evaluated = {\"props\":{\"media\":true,\"corners\":true,\"opacity\":true,\"order\":true,\"date\":true},\"dynamicProps\":false,\"dynamicItems\":false};function validate22(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate22.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.name !== undefined){if(typeof data.name !== \"string\"){const err0 = {instancePath:instancePath+\"/name\",schemaPath:\"#/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(data.lat !== undefined){let data1 = data.lat;if((typeof data1 == \"number\") && (isFinite(data1))){if(data1 > 90 || isNaN(data1)){const err1 = {instancePath:instancePath+\"/lat\",schemaPath:\"#/properties/lat/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 90},message:\"must be <= 90\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data1 < -90 || isNaN(data1)){const err2 = {instancePath:instancePath+\"/lat\",schemaPath:\"#/properties/lat/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -90},message:\"must be >= -90\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/lat\",schemaPath:\"#/properties/lat/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.lon !== undefined){let data2 = data.lon;if((typeof data2 == \"number\") && (isFinite(data2))){if(data2 > 180 || isNaN(data2)){const err4 = {instancePath:instancePath+\"/lon\",schemaPath:\"#/properties/lon/maximum\",keyword:\"maximum\",params:{comparison: \"<=\", limit: 180},message:\"must be <= 180\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data2 < -180 || isNaN(data2)){const err5 = {instancePath:instancePath+\"/lon\",schemaPath:\"#/properties/lon/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: -180},message:\"must be >= -180\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/lon\",schemaPath:\"#/properties/lon/type\",keyword:\"type\",params:{type: \"number\"},message:\"must be number\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.geometry !== undefined){let data3 = data.geometry;if(data3 && typeof data3 == \"object\" && !Array.isArray(data3)){if(data3.type === undefined){const err7 = {instancePath:instancePath+\"/geometry\",schemaPath:\"#/properties/geometry/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data3.type !== undefined){if(typeof data3.type !== \"string\"){const err8 = {instancePath:instancePath+\"/geometry/type\",schemaPath:\"#/properties/geometry/properties/type/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath:instancePath+\"/geometry\",schemaPath:\"#/properties/geometry/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.overlays !== undefined){let data5 = data.overlays;if(Array.isArray(data5)){const len0 = data5.length;for(let i0=0; i0<len0; i0++){if(!(validate23(data5[i0], {instancePath:instancePath+\"/overlays/\" + i0,parentData:data5,parentDataProperty:i0,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate23.errors : vErrors.concat(validate23.errors);errors = vErrors.length;}}}else {const err10 = {instancePath:instancePath+\"/overlays\",schemaPath:\"#/properties/overlays/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.lat !== undefined){if(data.lon === undefined){const err11 = {instancePath,schemaPath:\"#/dependentRequired\",keyword:\"dependentRequired\",params:{property: \"lat\",\n missingProperty: \"lon\",\n depsCount: 1,\n deps: \"lon\"},message:\"must have property lon when property lat is present\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.lon !== undefined){if(data.lat === undefined){const err12 = {instancePath,schemaPath:\"#/dependentRequired\",keyword:\"dependentRequired\",params:{property: \"lon\",\n missingProperty: \"lat\",\n depsCount: 1,\n deps: \"lat\"},message:\"must have property lat when property lon is present\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {\"props\":{\"name\":true,\"lat\":true,\"lon\":true,\"geometry\":true,\"overlays\":true},\"dynamicProps\":false,\"dynamicItems\":false};const schema40 = {\"type\":\"object\",\"required\":[\"ref\"],\"properties\":{\"ref\":{\"$ref\":\"#/$defs/id\"},\"caption\":{\"type\":\"string\"},\"credit\":{\"type\":\"string\"}}};function validate26(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate26.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.ref === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"ref\"},message:\"must have required property '\"+\"ref\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.ref !== undefined){let data0 = data.ref;if(typeof data0 === \"string\"){if(!pattern10.test(data0)){const err1 = {instancePath:instancePath+\"/ref\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath:instancePath+\"/ref\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.caption !== undefined){if(typeof data.caption !== \"string\"){const err3 = {instancePath:instancePath+\"/caption\",schemaPath:\"#/properties/caption/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.credit !== undefined){if(typeof data.credit !== \"string\"){const err4 = {instancePath:instancePath+\"/credit\",schemaPath:\"#/properties/credit/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}else {const err5 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}validate26.errors = vErrors;return errors === 0;}validate26.evaluated = {\"props\":{\"ref\":true,\"caption\":true,\"credit\":true},\"dynamicProps\":false,\"dynamicItems\":false};function validate21(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern10.test(data0)){const err1 = {instancePath:instancePath+\"/id\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath:instancePath+\"/id\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.title !== undefined){if(typeof data.title !== \"string\"){const err3 = {instancePath:instancePath+\"/title\",schemaPath:\"#/properties/title/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.text !== undefined){if(typeof data.text !== \"string\"){const err4 = {instancePath:instancePath+\"/text\",schemaPath:\"#/properties/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.date !== undefined){let data3 = data.date;if(data3 && typeof data3 == \"object\" && !Array.isArray(data3)){if(data3.text === undefined){const err5 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data3.text !== undefined){let data4 = data3.text;if(typeof data4 === \"string\"){if(!pattern5.test(data4)){const err6 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/date/text\",schemaPath:\"#/$defs/storyDate/properties/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data3.edtf !== undefined){let data5 = data3.edtf;if(typeof data5 === \"string\"){if(!pattern5.test(data5)){const err8 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+\"/date/edtf\",schemaPath:\"#/$defs/storyDate/properties/edtf/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data3.sortYear !== undefined){let data6 = data3.sortYear;if(!(((typeof data6 == \"number\") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){const err10 = {instancePath:instancePath+\"/date/sortYear\",schemaPath:\"#/$defs/storyDate/properties/sortYear/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath:instancePath+\"/date\",schemaPath:\"#/$defs/storyDate/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.place !== undefined){if(!(validate22(data.place, {instancePath:instancePath+\"/place\",parentData:data,parentDataProperty:\"place\",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data.media !== undefined){let data8 = data.media;if(Array.isArray(data8)){const len0 = data8.length;for(let i0=0; i0<len0; i0++){if(!(validate26(data8[i0], {instancePath:instancePath+\"/media/\" + i0,parentData:data8,parentDataProperty:i0,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);errors = vErrors.length;}}}else {const err12 = {instancePath:instancePath+\"/media\",schemaPath:\"#/properties/media/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.people !== undefined){let data10 = data.people;if(Array.isArray(data10)){const len1 = data10.length;for(let i1=0; i1<len1; i1++){let data11 = data10[i1];if(data11 && typeof data11 == \"object\" && !Array.isArray(data11)){if(data11.name === undefined){const err13 = {instancePath:instancePath+\"/people/\" + i1,schemaPath:\"#/properties/people/items/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data11.name !== undefined){let data12 = data11.name;if(typeof data12 === \"string\"){if(!pattern5.test(data12)){const err14 = {instancePath:instancePath+\"/people/\" + i1+\"/name\",schemaPath:\"#/properties/people/items/properties/name/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+\"/people/\" + i1+\"/name\",schemaPath:\"#/properties/people/items/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data11.role !== undefined){if(typeof data11.role !== \"string\"){const err16 = {instancePath:instancePath+\"/people/\" + i1+\"/role\",schemaPath:\"#/properties/people/items/properties/role/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath:instancePath+\"/people/\" + i1,schemaPath:\"#/properties/people/items/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath:instancePath+\"/people\",schemaPath:\"#/properties/people/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}}else {const err19 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate21.errors = vErrors;return errors === 0;}validate21.evaluated = {\"props\":{\"id\":true,\"title\":true,\"text\":true,\"date\":true,\"place\":true,\"media\":true,\"people\":true},\"dynamicProps\":false,\"dynamicItems\":false};function validate20(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.format === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"format\"},message:\"must have required property '\"+\"format\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.version === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"version\"},message:\"must have required property '\"+\"version\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.title === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"title\"},message:\"must have required property '\"+\"title\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.slides === undefined){const err3 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"slides\"},message:\"must have required property '\"+\"slides\"+\"'\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.media === undefined){const err4 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"media\"},message:\"must have required property '\"+\"media\"+\"'\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.$schema !== undefined){if(typeof data.$schema !== \"string\"){const err5 = {instancePath:instancePath+\"/$schema\",schemaPath:\"#/properties/%24schema/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.format !== undefined){if(\"gramps-connect-story\" !== data.format){const err6 = {instancePath:instancePath+\"/format\",schemaPath:\"#/properties/format/const\",keyword:\"const\",params:{allowedValue: \"gramps-connect-story\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.version !== undefined){let data2 = data.version;if(typeof data2 === \"string\"){if(!pattern4.test(data2)){const err7 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/pattern\",keyword:\"pattern\",params:{pattern: \"^1\\\\.(0|[1-9][0-9]*)$\"},message:\"must match pattern \\\"\"+\"^1\\\\.(0|[1-9][0-9]*)$\"+\"\\\"\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.title !== undefined){let data3 = data.title;if(typeof data3 === \"string\"){if(!pattern5.test(data3)){const err9 = {instancePath:instancePath+\"/title\",schemaPath:\"#/properties/title/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/title\",schemaPath:\"#/properties/title/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.language !== undefined){let data4 = data.language;if(typeof data4 === \"string\"){if(!pattern6.test(data4)){const err11 = {instancePath:instancePath+\"/language\",schemaPath:\"#/properties/language/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$\"+\"\\\"\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+\"/language\",schemaPath:\"#/properties/language/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.created !== undefined){let data5 = data.created;if(typeof data5 === \"string\"){if(!pattern7.test(data5)){const err13 = {instancePath:instancePath+\"/created\",schemaPath:\"#/properties/created/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"},message:\"must match pattern \\\"\"+\"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$\"+\"\\\"\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+\"/created\",schemaPath:\"#/properties/created/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.generator !== undefined){let data6 = data.generator;if(data6 && typeof data6 == \"object\" && !Array.isArray(data6)){if(data6.name === undefined){const err15 = {instancePath:instancePath+\"/generator\",schemaPath:\"#/properties/generator/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data6.name !== undefined){let data7 = data6.name;if(typeof data7 === \"string\"){if(!pattern5.test(data7)){const err16 = {instancePath:instancePath+\"/generator/name\",schemaPath:\"#/properties/generator/properties/name/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+\"/generator/name\",schemaPath:\"#/properties/generator/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data6.version !== undefined){if(typeof data6.version !== \"string\"){const err18 = {instancePath:instancePath+\"/generator/version\",schemaPath:\"#/properties/generator/properties/version/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data6.url !== undefined){if(typeof data6.url !== \"string\"){const err19 = {instancePath:instancePath+\"/generator/url\",schemaPath:\"#/properties/generator/properties/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}else {const err20 = {instancePath:instancePath+\"/generator\",schemaPath:\"#/properties/generator/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.authors !== undefined){let data10 = data.authors;if(Array.isArray(data10)){const len0 = data10.length;for(let i0=0; i0<len0; i0++){let data11 = data10[i0];if(data11 && typeof data11 == \"object\" && !Array.isArray(data11)){if(data11.name === undefined){const err21 = {instancePath:instancePath+\"/authors/\" + i0,schemaPath:\"#/properties/authors/items/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data11.name !== undefined){let data12 = data11.name;if(typeof data12 === \"string\"){if(!pattern5.test(data12)){const err22 = {instancePath:instancePath+\"/authors/\" + i0+\"/name\",schemaPath:\"#/properties/authors/items/properties/name/pattern\",keyword:\"pattern\",params:{pattern: \"\\\\S\"},message:\"must match pattern \\\"\"+\"\\\\S\"+\"\\\"\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+\"/authors/\" + i0+\"/name\",schemaPath:\"#/properties/authors/items/properties/name/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data11.url !== undefined){if(typeof data11.url !== \"string\"){const err24 = {instancePath:instancePath+\"/authors/\" + i0+\"/url\",schemaPath:\"#/properties/authors/items/properties/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}else {const err25 = {instancePath:instancePath+\"/authors/\" + i0,schemaPath:\"#/properties/authors/items/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}else {const err26 = {instancePath:instancePath+\"/authors\",schemaPath:\"#/properties/authors/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data.license !== undefined){if(typeof data.license !== \"string\"){const err27 = {instancePath:instancePath+\"/license\",schemaPath:\"#/properties/license/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data.presentation !== undefined){let data15 = data.presentation;if(data15 && typeof data15 == \"object\" && !Array.isArray(data15)){if(data15.basemap !== undefined){let data16 = data15.basemap;if(!((((data16 === \"standard\") || (data16 === \"historical\")) || (data16 === \"auto\")) || (data16 === \"none\"))){const err28 = {instancePath:instancePath+\"/presentation/basemap\",schemaPath:\"#/properties/presentation/properties/basemap/enum\",keyword:\"enum\",params:{allowedValues: schema31.properties.presentation.properties.basemap.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}}else {const err29 = {instancePath:instancePath+\"/presentation\",schemaPath:\"#/properties/presentation/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data.slides !== undefined){let data17 = data.slides;if(Array.isArray(data17)){if(data17.length < 1){const err30 = {instancePath:instancePath+\"/slides\",schemaPath:\"#/properties/slides/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}const len1 = data17.length;for(let i1=0; i1<len1; i1++){if(!(validate21(data17[i1], {instancePath:instancePath+\"/slides/\" + i1,parentData:data17,parentDataProperty:i1,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}}}else {const err31 = {instancePath:instancePath+\"/slides\",schemaPath:\"#/properties/slides/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.media !== undefined){let data19 = data.media;if(data19 && typeof data19 == \"object\" && !Array.isArray(data19)){for(const key0 in data19){const _errs38 = errors;if(typeof key0 === \"string\"){if(!pattern10.test(key0)){const err32 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[A-Za-z0-9_-]{1,64}$\"},message:\"must match pattern \\\"\"+\"^[A-Za-z0-9_-]{1,64}$\"+\"\\\"\",propertyName:key0};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+\"/media\",schemaPath:\"#/$defs/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\",propertyName:key0};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}var valid8 = _errs38 === errors;if(!valid8){const err34 = {instancePath:instancePath+\"/media\",schemaPath:\"#/properties/media/propertyNames\",keyword:\"propertyNames\",params:{propertyName: key0},message:\"property name must be valid\"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}for(const key1 in data19){let data20 = data19[key1];if(data20 && typeof data20 == \"object\" && !Array.isArray(data20)){if(data20.src === undefined){const err35 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/$defs/mediaItem/required\",keyword:\"required\",params:{missingProperty: \"src\"},message:\"must have required property '\"+\"src\"+\"'\"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(data20.mime === undefined){const err36 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/$defs/mediaItem/required\",keyword:\"required\",params:{missingProperty: \"mime\"},message:\"must have required property '\"+\"mime\"+\"'\"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data20.src !== undefined){let data21 = data20.src;if(typeof data21 === \"string\"){if(!pattern19.test(data21)){const err37 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/src\",schemaPath:\"#/$defs/mediaItem/properties/src/pattern\",keyword:\"pattern\",params:{pattern: \"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"},message:\"must match pattern \\\"\"+\"^(?!/)(?!.*(^|/)\\\\.\\\\.?(/|$))[^\\\\\\\\]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}else {const err38 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/src\",schemaPath:\"#/$defs/mediaItem/properties/src/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data20.mime !== undefined){let data22 = data20.mime;if(typeof data22 === \"string\"){if(!pattern20.test(data22)){const err39 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/mime\",schemaPath:\"#/$defs/mediaItem/properties/mime/pattern\",keyword:\"pattern\",params:{pattern: \"^[a-z]+/[A-Za-z0-9.+-]+$\"},message:\"must match pattern \\\"\"+\"^[a-z]+/[A-Za-z0-9.+-]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/mime\",schemaPath:\"#/$defs/mediaItem/properties/mime/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data20.width !== undefined){let data23 = data20.width;if(!(((typeof data23 == \"number\") && (!(data23 % 1) && !isNaN(data23))) && (isFinite(data23)))){const err41 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/width\",schemaPath:\"#/$defs/mediaItem/properties/width/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if((typeof data23 == \"number\") && (isFinite(data23))){if(data23 < 1 || isNaN(data23)){const err42 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/width\",schemaPath:\"#/$defs/mediaItem/properties/width/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}}if(data20.height !== undefined){let data24 = data20.height;if(!(((typeof data24 == \"number\") && (!(data24 % 1) && !isNaN(data24))) && (isFinite(data24)))){const err43 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/height\",schemaPath:\"#/$defs/mediaItem/properties/height/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}if((typeof data24 == \"number\") && (isFinite(data24))){if(data24 < 1 || isNaN(data24)){const err44 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/height\",schemaPath:\"#/$defs/mediaItem/properties/height/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}if(data20.alt !== undefined){if(typeof data20.alt !== \"string\"){const err45 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\")+\"/alt\",schemaPath:\"#/$defs/mediaItem/properties/alt/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}}else {const err46 = {instancePath:instancePath+\"/media/\" + key1.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/$defs/mediaItem/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}}else {const err47 = {instancePath:instancePath+\"/media\",schemaPath:\"#/properties/media/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data.extensions !== undefined){let data26 = data.extensions;if(data26 && typeof data26 == \"object\" && !Array.isArray(data26)){for(const key2 in data26){let data27 = data26[key2];if(!(data27 && typeof data27 == \"object\" && !Array.isArray(data27))){const err48 = {instancePath:instancePath+\"/extensions/\" + key2.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/properties/extensions/additionalProperties/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+\"/extensions\",schemaPath:\"#/properties/extensions/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}}else {const err50 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {\"props\":{\"$schema\":true,\"format\":true,\"version\":true,\"title\":true,\"language\":true,\"created\":true,\"generator\":true,\"authors\":true,\"license\":true,\"presentation\":true,\"slides\":true,\"media\":true,\"extensions\":true},\"dynamicProps\":false,\"dynamicItems\":false};\n", "// Format identity and versioning (spec/1.0/README.md section 2), and the\n// chain of upgraders that lets this package keep opening every older major\n// version of the format.\nimport type { StoryDoc } from \"./types\";\n\nexport const FORMAT_ID = \"gramps-connect-story\";\n\n/** The version this package writes. */\nexport const FORMAT_VERSION = \"1.0\";\n\nexport const CURRENT_MAJOR = 1;\n\n/** Upgraders, keyed by the major version they upgrade *from*: UPGRADERS[1]\n * turns a 1.x document into a 2.0 one, and so on. Never remove one -- each\n * is the only thing that keeps old files opening -- and give each a fixture\n * from its source version under examples/. Empty while 1 is the only major.\n * Each receives a document that already passed its own version's checks. */\nconst UPGRADERS: Record<number, (doc: Record<string, unknown>) => Record<string, unknown>> = {};\n\n/** Every major version upgradeStory() can open. */\nexport const SUPPORTED_FORMAT_MAJORS: readonly number[] = Object.freeze(\n Array.from({ length: CURRENT_MAJOR }, (_, i) => i + 1).filter(\n (major) => major === CURRENT_MAJOR || UPGRADERS[major] !== undefined,\n ),\n);\n\nexport type StoryErrorCode =\n | \"not-a-zip\"\n | \"no-story-json\"\n | \"bad-json\"\n | \"not-a-story\"\n | \"bad-version\"\n | \"newer-version\"\n | \"too-large\"\n | \"invalid\";\n\nexport class StoryFormatError extends Error {\n readonly code: StoryErrorCode;\n constructor(code: StoryErrorCode, message: string) {\n super(message);\n this.name = \"StoryFormatError\";\n this.code = code;\n }\n}\n\nexport interface ParsedVersion {\n major: number;\n minor: number;\n}\n\nexport function parseVersion(version: unknown): ParsedVersion | null {\n if (typeof version !== \"string\") return null;\n const match = /^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$/.exec(version);\n if (!match) return null;\n return { major: Number(match[1]), minor: Number(match[2]) };\n}\n\n/** Checks `raw` is a story at all and brings it up to CURRENT_MAJOR.\n * Doesn't validate the result -- see validate.ts -- only what it needs to\n * pick upgraders: `format` and `version`. Throws StoryFormatError. */\nexport function upgradeStory(raw: unknown): StoryDoc {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n throw new StoryFormatError(\"not-a-story\", \"story.json is not a JSON object.\");\n }\n let doc = raw as Record<string, unknown>;\n if (doc.format !== FORMAT_ID) {\n throw new StoryFormatError(\"not-a-story\", `story.json's \"format\" is not \"${FORMAT_ID}\".`);\n }\n const parsed = parseVersion(doc.version);\n if (!parsed || parsed.major < 1) {\n throw new StoryFormatError(\"bad-version\", `story.json's \"version\" (${JSON.stringify(doc.version)}) is not a valid MAJOR.MINOR version.`);\n }\n if (parsed.major > CURRENT_MAJOR) {\n throw new StoryFormatError(\n \"newer-version\",\n `This story uses format version ${doc.version}, which is newer than this viewer supports (up to ${CURRENT_MAJOR}.x). A newer viewer is needed to open it.`,\n );\n }\n for (let major = parsed.major; major < CURRENT_MAJOR; major++) {\n const upgrade = UPGRADERS[major];\n if (!upgrade) {\n throw new StoryFormatError(\"bad-version\", `No upgrade path from format version ${major}.x.`);\n }\n doc = upgrade(doc);\n }\n return doc as unknown as StoryDoc;\n}\n", "// Everything that makes a story.json valid: the JSON Schema (compiled ahead\n// of time into generated/schemaValidator.js -- see\n// scripts/generate-validator.mjs for why) plus the cross-references the\n// schema can't express (spec/1.0/README.md section 8).\nimport schema from \"../spec/1.0/story.schema.json\" with { type: \"json\" };\nimport { validate as schemaValidate } from \"./generated/schemaValidator.js\";\nimport { CURRENT_MAJOR, parseVersion } from \"./version\";\nimport type { StoryDoc } from \"./types\";\n\n/** Minor version of the schema bundled here: unknown fields in a file of\n * this minor version or older are probably typos, not newer features. */\nconst SCHEMA_MINOR = 0;\n\nexport interface StoryIssue {\n /** JSON Pointer into story.json (\"\" for the root), e.g. \"/slides/2/media/0/ref\". */\n path: string;\n message: string;\n}\n\nexport interface ValidationResult {\n valid: boolean;\n errors: StoryIssue[];\n /** Not wrong, but probably not intended: unknown fields in a file that\n * claims a version this package fully knows, media nothing uses. */\n warnings: StoryIssue[];\n}\n\n/** Checks a story document. `files`, when given, is the set of paths in the\n * zip (relative to its story root), so every media `src` can be checked\n * too; without it only story.json itself is checked. */\nexport function validate(doc: unknown, files?: { has(path: string): boolean }): ValidationResult {\n const errors: StoryIssue[] = [];\n const warnings: StoryIssue[] = [];\n\n if (!schemaValidate(doc)) {\n for (const err of schemaValidate.errors ?? []) {\n errors.push({ path: err.instancePath, message: describeSchemaError(err) });\n }\n // Cross-reference checks below assume the basic shape is right.\n return { valid: false, errors, warnings };\n }\n const story = doc as StoryDoc;\n\n const slideIds = new Set<string>();\n const usedMedia = new Set<string>();\n const checkRef = (key: string, path: string) => {\n usedMedia.add(key);\n if (!Object.prototype.hasOwnProperty.call(story.media, key)) {\n errors.push({ path, message: `refers to media \"${key}\", which isn't in \"media\".` });\n }\n };\n story.slides.forEach((slide, i) => {\n if (slideIds.has(slide.id)) {\n errors.push({ path: `/slides/${i}/id`, message: `duplicate slide id \"${slide.id}\".` });\n }\n slideIds.add(slide.id);\n slide.media?.forEach((m, j) => checkRef(m.ref, `/slides/${i}/media/${j}/ref`));\n slide.place?.overlays?.forEach((o, j) => checkRef(o.media, `/slides/${i}/place/overlays/${j}/media`));\n });\n\n for (const [key, item] of Object.entries(story.media)) {\n const path = `/media/${escapePointer(key)}`;\n if (files && !files.has(item.src)) {\n errors.push({ path: `${path}/src`, message: `file \"${item.src}\" is not in the zip.` });\n }\n if (!usedMedia.has(key)) {\n warnings.push({ path, message: `media \"${key}\" isn't used by any slide or overlay.` });\n }\n }\n\n const version = parseVersion(story.version);\n if (version && version.major === CURRENT_MAJOR && version.minor <= SCHEMA_MINOR) {\n findUnknownFields(story, schema as unknown as SchemaNode, \"\", warnings);\n }\n\n return { valid: errors.length === 0, errors, warnings };\n}\n\ninterface AjvError {\n instancePath: string;\n keyword: string;\n params: Record<string, unknown>;\n message?: string;\n}\n\nfunction describeSchemaError(err: AjvError): string {\n if (err.keyword === \"pattern\" && err.params.pattern === \"\\\\S\") return \"must not be empty.\";\n if (err.keyword === \"required\") return `is missing required field \"${String(err.params.missingProperty)}\".`;\n if (err.keyword === \"const\") return `must be ${JSON.stringify(err.params.allowedValue)}.`;\n if (err.keyword === \"enum\") return `must be one of ${(err.params.allowedValues as unknown[]).map((v) => JSON.stringify(v)).join(\", \")}.`;\n return `${err.message ?? \"is invalid\"}.`;\n}\n\nfunction escapePointer(key: string): string {\n return key.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\n\ntype SchemaNode = {\n $ref?: string;\n properties?: Record<string, SchemaNode>;\n additionalProperties?: SchemaNode | boolean;\n items?: SchemaNode;\n prefixItems?: SchemaNode[];\n};\n\nfunction resolveRef(node: SchemaNode, root: Record<string, unknown>): SchemaNode {\n if (!node.$ref) return node;\n const name = node.$ref.replace(/^#\\/\\$defs\\//, \"\");\n return (root.$defs as Record<string, SchemaNode>)[name];\n}\n\n/** Walks the document alongside the schema, warning about any key an\n * object's schema doesn't name. An object whose schema says\n * `additionalProperties: true` (GeoJSON) or gives a schema for extra keys\n * (`media`, `extensions`) is open, not a typo trap. */\nfunction findUnknownFields(value: unknown, node: SchemaNode, path: string, warnings: StoryIssue[], root = schema as unknown as Record<string, unknown>) {\n node = resolveRef(node, root);\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n const itemNode = node.prefixItems?.[i] ?? node.items;\n if (itemNode) findUnknownFields(item, itemNode, `${path}/${i}`, warnings, root);\n });\n return;\n }\n if (typeof value !== \"object\" || value === null) return;\n for (const [key, child] of Object.entries(value)) {\n const childPath = `${path}/${escapePointer(key)}`;\n const known = node.properties?.[key];\n if (known) {\n findUnknownFields(child, known, childPath, warnings, root);\n } else if (typeof node.additionalProperties === \"object\") {\n findUnknownFields(child, node.additionalProperties, childPath, warnings, root);\n } else if (node.properties && node.additionalProperties !== true) {\n warnings.push({ path: childPath, message: `unknown field \"${key}\" (ignored).` });\n }\n }\n}\n", "// Presents a story: one slide at a time, with a full-bleed map behind the\n// slides when any of them has a place (modeled on a Knight Lab StoryMapJS\n// slide), or a plain centered card when none does, plus a timeline strip\n// when two or more slides are dated. Fills its container; the host decides\n// whether that's a fullscreen modal, a page, or a box on a blog.\nimport { useEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode, type TouchEvent } from \"react\";\nimport type { MediaItem, Slide, StoryDoc } from \"../types\";\nimport { timelineYear } from \"./dates\";\nimport { placeCenter, storyPlaces } from \"./geo\";\nimport { MapBackground, type MapSlide } from \"./MapBackground\";\nimport { MapModeControl, type MapMode, type MapModeControlProps } from \"./MapModeControl\";\nimport { parseStoryText } from \"./text\";\nimport { stringsFor, type PlayerStrings } from \"./strings\";\nimport { defaultColors, type PlayerColors } from \"./theme\";\nimport { TIMELINE_HEIGHT, TimelineStrip, type TimelinePoint } from \"./TimelineStrip\";\n\n/** How much of the width the slide panel takes over a map; the map\n * centers each point in what's left. */\nconst PANEL_FRACTION = 0.62;\nconst BAR_HEIGHT = 56;\n\nexport interface StoryPlayerProps {\n story: StoryDoc;\n /** A URL the browser can load for a media key: a blob: URL for a file\n * out of a zip, or anything else the host serves. The host owns these\n * URLs (and revoking them); the player may ask for the same key again.\n * Null when it can't be had: the slide shows without it. */\n resolveMedia: (key: string, item: MediaItem) => Promise<string | null>;\n dark?: boolean;\n colors?: Partial<PlayerColors>;\n /** The player's own words. By default, the built-in table for the\n * story's language, else the browser's, else English (strings.ts). */\n strings?: Partial<PlayerStrings>;\n /** Shows a close button that calls this. */\n onClose?: () => void;\n /** Arrow keys move between slides: true listens on the whole window (a\n * fullscreen presentation), \"focus\" only while the player has focus (one\n * of several on a page), false not at all. Default true. */\n keyboard?: boolean | \"focus\";\n /** Called with the new index whenever the slide changes. */\n onSlideChange?: (index: number) => void;\n /** Replaces the built-in map-mode control, e.g. with one from the host's\n * own UI kit. */\n renderMapModeControl?: (props: MapModeControlProps) => ReactNode;\n /** Shown before the title, e.g. ViewerBrand on a standalone page. */\n brand?: ReactNode;\n /** The host's own buttons, at the right of the title bar (before the\n * close button), e.g. the viewer site's Edit. */\n actions?: ReactNode;\n initialSlide?: number;\n}\n\n/** The story's basemap hint (spec section 6) as the control's starting mode:\n * \"historical\" -- a map of each slide's era -- is what the control calls\n * Auto; \"auto\" (viewer's choice) starts on the standard map. */\nfunction initialMapMode(story: StoryDoc): MapMode {\n return story.presentation?.basemap === \"historical\" ? \"auto\" : \"standard\";\n}\n\nfunction SlideText({ text, colors }: { text: string; colors: PlayerColors }) {\n return (\n <>\n {parseStoryText(text).map((lines, p) => (\n <p key={p} dir=\"auto\" style={{ margin: \"0 0 0.6em\", color: colors.text, lineHeight: 1.55 }}>\n {lines.map((spans, l) => (\n <span key={l}>\n {l > 0 && <br />}\n {spans.map((span, s) => {\n if (span.bold) return <b key={s}>{span.text}</b>;\n if (span.italic) return <i key={s}>{span.text}</i>;\n return <span key={s}>{span.text}</span>;\n })}\n </span>\n ))}\n </p>\n ))}\n </>\n );\n}\n\nfunction SlidePhoto({ mediaKey, item, caption, credit, resolveMedia, colors }: {\n mediaKey: string;\n item: MediaItem;\n caption?: string;\n credit?: string;\n resolveMedia: StoryPlayerProps[\"resolveMedia\"];\n colors: PlayerColors;\n}) {\n const [src, setSrc] = useState<string | null>(null);\n useEffect(() => {\n setSrc(null);\n let cancelled = false;\n resolveMedia(mediaKey, item).then((url) => { if (!cancelled) setSrc(url); }, () => {});\n return () => {\n cancelled = true;\n };\n }, [mediaKey, item, resolveMedia]);\n if (!src) return null;\n return (\n <figure style={{ margin: 0, display: \"flex\", flexDirection: \"column\", alignItems: \"center\", gap: 4 }}>\n <img\n src={src}\n alt={item.alt ?? \"\"}\n width={item.width}\n height={item.height}\n style={{ maxHeight: \"42vh\", maxWidth: \"100%\", width: \"auto\", height: \"auto\", objectFit: \"contain\", borderRadius: 4 }}\n />\n {(caption || credit) && (\n <figcaption style={{ fontSize: 13, color: colors.muted }}>\n {[caption, credit && `\u00A9 ${credit}`].filter(Boolean).join(\" \u00B7 \")}\n </figcaption>\n )}\n </figure>\n );\n}\n\nfunction SlideContent({ slide, story, resolveMedia, colors }: {\n slide: Slide | undefined;\n story: StoryDoc;\n resolveMedia: StoryPlayerProps[\"resolveMedia\"];\n colors: PlayerColors;\n}) {\n // The format allows several photos per slide; the player shows the\n // first one that exists.\n const photo = slide?.media?.find((m) => Object.prototype.hasOwnProperty.call(story.media, m.ref));\n const eyebrow = [slide?.date?.text, slide?.place?.name].filter(Boolean).join(\" \u00B7 \");\n return (\n <>\n {photo && (\n <SlidePhoto\n mediaKey={photo.ref}\n item={story.media[photo.ref]}\n caption={photo.caption}\n credit={photo.credit}\n resolveMedia={resolveMedia}\n colors={colors}\n />\n )}\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 4, alignItems: \"center\", maxWidth: 640, textAlign: \"center\" }}>\n {eyebrow && <div dir=\"auto\" style={{ fontSize: 14, color: colors.muted }}>{eyebrow}</div>}\n {slide?.title && <div dir=\"auto\" style={{ fontSize: 20, fontWeight: 700, color: colors.text }}>{slide.title}</div>}\n {slide?.text && <div><SlideText text={slide.text} colors={colors} /></div>}\n </div>\n </>\n );\n}\n\nfunction RoundButton({ label, onClick, disabled, size, children, style }: {\n label: string;\n onClick: () => void;\n disabled?: boolean;\n size: number;\n children: ReactNode;\n style?: CSSProperties;\n}) {\n return (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n onClick={onClick}\n disabled={disabled}\n style={{\n width: size, height: size, borderRadius: \"50%\", border: \"none\",\n background: \"#25262b\", color: \"#ffffff\", fontSize: size >= 48 ? 22 : 18,\n cursor: disabled ? \"default\" : \"pointer\", opacity: disabled ? 0.35 : 0.8,\n display: \"flex\", alignItems: \"center\", justifyContent: \"center\", padding: 0, fontFamily: \"inherit\",\n ...style,\n }}\n >\n {children}\n </button>\n );\n}\n\nfunction NavArrows({ index, total, onPrev, onNext, variant, strings, colors }: {\n index: number;\n total: number;\n onPrev: () => void;\n onNext: () => void;\n /** \"edge\": large buttons at the screen edges, dark so they stay legible\n * over any map. \"inline\": small buttons and an \"n / N\" counter. */\n variant: \"inline\" | \"edge\";\n strings: PlayerStrings;\n colors: PlayerColors;\n}) {\n if (variant === \"edge\") {\n const edge: CSSProperties = { position: \"absolute\", top: \"50%\", transform: \"translateY(-50%)\", zIndex: 2 };\n return (\n <>\n <RoundButton label={strings.previous} size={56} disabled={index === 0} onClick={onPrev} style={{ ...edge, left: 24 }}>\u2190</RoundButton>\n <RoundButton label={strings.next} size={56} disabled={index === total - 1} onClick={onNext} style={{ ...edge, right: 24 }}>\u2192</RoundButton>\n </>\n );\n }\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"center\", gap: 16, marginTop: 16 }}>\n <RoundButton label={strings.previous} size={34} disabled={index === 0} onClick={onPrev}>\u2190</RoundButton>\n <span style={{ fontSize: 14, color: colors.muted }}>{index + 1} / {total}</span>\n <RoundButton label={strings.next} size={34} disabled={index === total - 1} onClick={onNext}>\u2192</RoundButton>\n </div>\n );\n}\n\nexport function StoryPlayer({\n story, resolveMedia, dark = false, colors: colorOverrides, strings: stringOverrides, onClose,\n keyboard = true, onSlideChange, renderMapModeControl, brand, actions, initialSlide = 0,\n}: StoryPlayerProps) {\n const colors = useMemo(() => ({ ...defaultColors(dark), ...colorOverrides }), [dark, colorOverrides]);\n const strings = useMemo(\n () => ({\n ...stringsFor(story.language, typeof navigator === \"undefined\" ? undefined : navigator.language),\n ...stringOverrides,\n }),\n [story.language, stringOverrides],\n );\n const rootRef = useRef<HTMLDivElement>(null);\n const slides = story.slides;\n const [index, setIndex] = useState(initialSlide);\n const slide = slides[index];\n\n useEffect(() => {\n setIndex(Math.min(Math.max(initialSlide, 0), Math.max(slides.length - 1, 0)));\n }, [story, initialSlide, slides.length]);\n\n const datedSlides = useMemo(() => {\n const points: TimelinePoint[] = [];\n slides.forEach((s, i) => {\n const year = timelineYear(s.date);\n if (year !== null) points.push({ index: i, year });\n });\n return points;\n }, [slides]);\n const showTimeline = datedSlides.length >= 2;\n\n // Map modes: \"auto\" follows the current slide's year as the story moves.\n const [mapMode, setMapMode] = useState<MapMode>(() => initialMapMode(story));\n const [historicalYear, setHistoricalYear] = useState(() => new Date().getFullYear());\n const currentYear = timelineYear(slide?.date);\n const autoYear = currentYear !== null ? Math.floor(currentYear) : null;\n const yearBounds = useMemo<[number, number]>(() => {\n if (datedSlides.length === 0) {\n const thisYear = new Date().getFullYear();\n return [thisYear - 200, thisYear];\n }\n const years = datedSlides.map((d) => d.year);\n return [Math.floor(Math.min(...years)), Math.ceil(Math.max(...years))];\n }, [datedSlides]);\n // Entering Historical starts the slider on this slide's year.\n const wasHistoricalRef = useRef(false);\n useEffect(() => {\n if (mapMode === \"historical\" && !wasHistoricalRef.current) setHistoricalYear(autoYear ?? yearBounds[1]);\n wasHistoricalRef.current = mapMode === \"historical\";\n }, [mapMode, autoYear, yearBounds]);\n const ohmYear = mapMode === \"standard\" ? null : mapMode === \"auto\" ? autoYear : historicalYear;\n\n const goPrev = () => setIndex((i) => Math.max(i - 1, 0));\n const goNext = () => setIndex((i) => Math.min(i + 1, slides.length - 1));\n\n const onSlideChangeRef = useRef(onSlideChange);\n onSlideChangeRef.current = onSlideChange;\n useEffect(() => {\n onSlideChangeRef.current?.(index);\n }, [index]);\n\n useEffect(() => {\n if (!keyboard) return;\n const target: HTMLElement | Window | null = keyboard === \"focus\" ? rootRef.current : window;\n if (!target) return;\n function onKey(e: Event) {\n const key = (e as KeyboardEvent).key;\n const from = e.target as HTMLElement | null;\n // Not while typing a year into the map control.\n if (from && (from.tagName === \"INPUT\" || from.tagName === \"TEXTAREA\" || from.isContentEditable)) return;\n if (key === \"ArrowRight\") setIndex((i) => Math.min(i + 1, slides.length - 1));\n if (key === \"ArrowLeft\") setIndex((i) => Math.max(i - 1, 0));\n }\n target.addEventListener(\"keydown\", onKey);\n return () => target.removeEventListener(\"keydown\", onKey);\n }, [keyboard, slides.length]);\n\n // A horizontal swipe on the slide (not the map, which a drag pans)\n // moves between slides.\n const swipeStart = useRef<{ x: number; y: number } | null>(null);\n const swipeHandlers = {\n onTouchStart: (e: TouchEvent) => {\n const t = e.touches[0];\n swipeStart.current = e.touches.length === 1 ? { x: t.clientX, y: t.clientY } : null;\n },\n onTouchEnd: (e: TouchEvent) => {\n const start = swipeStart.current;\n swipeStart.current = null;\n const t = e.changedTouches[0];\n if (!start || !t) return;\n const dx = t.clientX - start.x;\n const dy = t.clientY - start.y;\n if (Math.abs(dx) < 50 || Math.abs(dx) < Math.abs(dy) * 1.5) return;\n if (dx < 0) goNext();\n else goPrev();\n },\n };\n\n // Stable per slide, so a re-render for an unrelated reason (a map-mode\n // click) never looks like a new slide to the map's camera.\n const places = useMemo(() => storyPlaces(slides.map((s) => s.place)), [slides]);\n const mapSlide = useMemo<MapSlide>(() => ({\n key: slide?.id ?? String(index),\n place: slide?.place,\n // The opening card, with no place of its own, shows where the story goes.\n overview: index === 0 && !placeCenter(slide?.place) ? places : null,\n }), [slide, index, places]);\n const firstCenter = useMemo(() => {\n if (story.presentation?.basemap === \"none\") return null;\n for (const s of slides) {\n const center = placeCenter(s.place);\n if (center) return center;\n }\n return null;\n }, [story, slides]);\n\n const modeControlProps: MapModeControlProps = {\n mode: mapMode, onModeChange: setMapMode, autoYear, year: historicalYear, onYearChange: setHistoricalYear, yearBounds,\n };\n const mediaResolver = useMemo(() => (key: string) => {\n const item = Object.prototype.hasOwnProperty.call(story.media, key) ? story.media[key] : undefined;\n return item ? resolveMedia(key, item) : Promise.resolve(null);\n }, [story, resolveMedia]);\n\n const content = <SlideContent slide={slide} story={story} resolveMedia={resolveMedia} colors={colors} />;\n const timeline = showTimeline && (\n <TimelineStrip points={datedSlides} currentIndex={index} onSelect={setIndex} colors={colors} />\n );\n\n return (\n <div\n ref={rootRef}\n lang={story.language}\n tabIndex={keyboard === \"focus\" ? 0 : undefined}\n style={{\n position: \"relative\", width: \"100%\", height: \"100%\", overflow: \"hidden\",\n background: colors.surface, color: colors.text,\n }}\n >\n {/* Title bar: translucent, so it reads over the map too. */}\n <div\n style={{\n position: \"absolute\", top: 0, left: 0, right: 0, height: BAR_HEIGHT, zIndex: 3,\n background: dark ? \"rgba(20,20,20,0.55)\" : \"rgba(255,255,255,0.55)\",\n }}\n />\n <div\n dir=\"auto\"\n style={{\n position: \"absolute\", top: 0, left: 20, height: BAR_HEIGHT, maxWidth: \"26%\", zIndex: 3,\n display: \"flex\", alignItems: \"center\", gap: 10, fontWeight: 600,\n }}\n >\n {brand && <span style={{ flex: \"none\", display: \"flex\" }}>{brand}</span>}\n <span style={{ whiteSpace: \"nowrap\", overflow: \"hidden\", textOverflow: \"ellipsis\" }}>{story.title}</span>\n </div>\n {/* Centered on the whole bar, as a toolbar for the presentation; the\n full-width wrapper lets clicks through to anything under it. */}\n {firstCenter && (\n <div\n style={{\n position: \"absolute\", top: 0, left: 0, right: 0, height: BAR_HEIGHT, zIndex: 3,\n display: \"flex\", alignItems: \"center\", justifyContent: \"center\", pointerEvents: \"none\",\n }}\n >\n <div style={{ pointerEvents: \"auto\" }}>\n {renderMapModeControl\n ? renderMapModeControl(modeControlProps)\n : <MapModeControl {...modeControlProps} strings={strings} colors={colors} />}\n </div>\n </div>\n )}\n {actions && (\n <div\n style={{\n position: \"absolute\", top: 0, right: onClose ? 60 : 12, height: BAR_HEIGHT, zIndex: 3,\n display: \"flex\", alignItems: \"center\", gap: 8,\n }}\n >\n {actions}\n </div>\n )}\n {onClose && (\n <RoundButton\n label={strings.close} size={36} onClick={onClose}\n style={{ position: \"absolute\", top: 10, right: 12, zIndex: 3 }}\n >\n \u00D7\n </RoundButton>\n )}\n\n {firstCenter ? (\n <div style={{ position: \"absolute\", inset: 0 }}>\n <MapBackground\n initialCenter={firstCenter}\n current={mapSlide}\n dark={dark}\n colors={colors}\n panelFraction={PANEL_FRACTION}\n ohmYear={ohmYear}\n resolveMedia={mediaResolver}\n />\n <div\n style={{\n position: \"absolute\", top: 0, bottom: 0, right: 0, width: `${PANEL_FRACTION * 100}%`, zIndex: 1,\n padding: `${BAR_HEIGHT}px 32px ${showTimeline ? TIMELINE_HEIGHT : 32}px`, boxSizing: \"border-box\",\n display: \"flex\", flexDirection: \"column\", justifyContent: \"center\", alignItems: \"center\", gap: 16,\n overflowY: \"auto\",\n // Transparent where the panel starts, mid-screen, and solid\n // well before the centered content, so text never sits on map.\n background: `linear-gradient(to right, transparent 0%, ${colors.panel} 22%)`,\n }}\n {...swipeHandlers}\n >\n {content}\n </div>\n <NavArrows index={index} total={slides.length} onPrev={goPrev} onNext={goNext} variant=\"edge\" strings={strings} colors={colors} />\n {timeline}\n </div>\n ) : (\n <div\n style={{\n position: \"absolute\", inset: 0, overflowY: \"auto\", boxSizing: \"border-box\",\n padding: `${BAR_HEIGHT + 16}px 24px ${showTimeline ? TIMELINE_HEIGHT + 16 : 24}px`,\n display: \"flex\", flexDirection: \"column\", alignItems: \"center\", justifyContent: \"center\", gap: 16,\n }}\n {...swipeHandlers}\n >\n {content}\n <NavArrows index={index} total={slides.length} onPrev={goPrev} onNext={goNext} variant=\"inline\" strings={strings} colors={colors} />\n {timeline}\n </div>\n )}\n </div>\n );\n}\n", "// What the player needs from a story's dates: which years an EDTF value\n// covers (to show a historical map overlay only in its own era), and a\n// position on the timeline finer than a whole year when the date allows.\nimport type { StoryDate } from \"../types\";\n\nexport interface YearRange {\n /** Undefined for an open start (\"../1850\"). */\n min?: number;\n /** Undefined for an open end (\"1850/..\"). */\n max?: number;\n}\n\nconst DATE = /^(-?\\d{4})(?:-(\\d{2}|XX))?(?:-(\\d{2}|XX))?[~?%]?$/;\n\nfunction yearOf(part: string): number | null {\n const match = DATE.exec(part.trim());\n return match ? Number(match[1]) : null;\n}\n\n/** The years an EDTF date covers, or null when it can't be read (which\n * callers treat the same as having no date). Handles single dates\n * (\"1850\", \"1850-03-12\", \"1850~\"), intervals (\"1850/1860\", \"../1850\",\n * \"1850/..\") and one-of sets (\"[1850..1860]\"). */\nexport function edtfYearRange(edtf: string | undefined): YearRange | null {\n if (!edtf) return null;\n const value = edtf.trim();\n const set = /^\\[(.+)\\.\\.(.+)\\]$/.exec(value);\n if (set) {\n const min = yearOf(set[1]);\n const max = yearOf(set[2]);\n return min !== null && max !== null ? { min: Math.min(min, max), max: Math.max(min, max) } : null;\n }\n if (value.includes(\"/\")) {\n const [startText, endText] = value.split(\"/\");\n const openStart = startText === \"..\" || startText === \"\";\n const openEnd = endText === \"..\" || endText === \"\";\n const start = openStart ? undefined : yearOf(startText);\n const end = openEnd ? undefined : yearOf(endText);\n if (start === null || end === null) return null;\n if (start === undefined && end === undefined) return null;\n if (start !== undefined && end !== undefined) return { min: Math.min(start, end), max: Math.max(start, end) };\n return { min: start, max: end };\n }\n const year = yearOf(value);\n return year === null ? null : { min: year, max: year };\n}\n\n/** Whether something dated `date` belongs on a map of `year`. No date, an\n * unreadable one, or no year to compare against (a standard, non-historical\n * map) all mean visible: an undated overlay is never hidden. */\nexport function dateCoversYear(date: StoryDate | undefined, year: number | null): boolean {\n if (!date || year === null) return true;\n const range = edtfYearRange(date.edtf);\n if (!range) return true;\n if (range.min !== undefined && year < range.min) return false;\n if (range.max !== undefined && year > range.max) return false;\n return true;\n}\n\n/** A slide's position on the timeline, as a fractional year: its\n * `sortYear`, nudged within the year by the EDTF month and day when they\n * agree with it -- so two events in the same year don't land on the exact\n * same spot. Null for a slide that isn't on the timeline. */\nexport function timelineYear(date: StoryDate | undefined): number | null {\n if (!date) return null;\n const match = date.edtf ? DATE.exec(date.edtf.trim()) : null;\n const sortYear = date.sortYear ?? (match ? Number(match[1]) : undefined);\n if (sortYear === undefined) return null;\n if (!match || Number(match[1]) !== sortYear) return sortYear;\n const month = match[2] && match[2] !== \"XX\" ? Number(match[2]) : 0;\n const day = match[3] && match[3] !== \"XX\" ? Number(match[3]) : 0;\n if (!month) return sortYear;\n return sortYear + (month - 1) / 12 + (day ? (day - 1) / 365 : 0);\n}\n", "// Where a slide is on the map: its point, or the box around its shape and\n// overlays -- pure geometry, no map library.\nimport type { LonLat, Place } from \"../types\";\n\nexport type Bounds = [west: number, south: number, east: number, north: number];\n\nfunction visit(coords: unknown, bounds: Bounds): void {\n if (!Array.isArray(coords)) return;\n if (coords.length >= 2 && typeof coords[0] === \"number\" && typeof coords[1] === \"number\") {\n const [lon, lat] = coords as number[];\n bounds[0] = Math.min(bounds[0], lon);\n bounds[1] = Math.min(bounds[1], lat);\n bounds[2] = Math.max(bounds[2], lon);\n bounds[3] = Math.max(bounds[3], lat);\n return;\n }\n for (const child of coords) visit(child, bounds);\n}\n\n/** Every coordinate in a GeoJSON object, whatever its nesting. */\nfunction visitGeoJson(node: unknown, bounds: Bounds): void {\n if (!node || typeof node !== \"object\") return;\n const obj = node as { type?: string; coordinates?: unknown; geometry?: unknown; geometries?: unknown[]; features?: unknown[] };\n if (obj.coordinates !== undefined) visit(obj.coordinates, bounds);\n if (obj.geometry) visitGeoJson(obj.geometry, bounds);\n for (const g of obj.geometries ?? []) visitGeoJson(g, bounds);\n for (const f of obj.features ?? []) visitGeoJson(f, bounds);\n}\n\n/** The box around a place's shape and overlays, or null when it has\n * neither (or they hold no coordinates). */\nexport function placeBounds(place: Place | undefined): Bounds | null {\n if (!place) return null;\n const bounds: Bounds = [Infinity, Infinity, -Infinity, -Infinity];\n visitGeoJson(place.geometry, bounds);\n for (const overlay of place.overlays ?? []) visit(overlay.corners as LonLat[], bounds);\n return Number.isFinite(bounds[0]) ? bounds : null;\n}\n\n/** Where to put the pin: the place's own point, else the middle of its\n * shape and overlays. Null for a slide with no position at all. */\nexport function placeCenter(place: Place | undefined): LonLat | null {\n if (place?.lat !== undefined && place.lon !== undefined) return [place.lon, place.lat];\n const bounds = placeBounds(place);\n return bounds ? [(bounds[0] + bounds[2]) / 2, (bounds[1] + bounds[3]) / 2] : null;\n}\n\nexport interface StoryPlaces {\n points: LonLat[];\n bounds: Bounds;\n}\n\n/** Every place in the story at once, for its opening view: one point per\n * distinct place, and the box around all of them, shapes and overlays\n * included. Null when no slide has a position. */\nexport function storyPlaces(places: (Place | undefined)[]): StoryPlaces | null {\n const bounds: Bounds = [Infinity, Infinity, -Infinity, -Infinity];\n const points = new Map<string, LonLat>();\n for (const place of places) {\n const center = placeCenter(place);\n if (!center) continue;\n points.set(`${center[0].toFixed(5)},${center[1].toFixed(5)}`, center);\n visit(center, bounds);\n const box = placeBounds(place);\n if (box) visit([[box[0], box[1]], [box[2], box[3]]], bounds);\n }\n return points.size ? { points: [...points.values()], bounds } : null;\n}\n", "// The full-bleed map behind a located story's slides: flies to the current\n// slide's place (or frames its shape and overlays), draws that shape and\n// those overlays, and holds still -- marker dimmed -- on a slide with no\n// place. Its own small maplibre instance; the host page loads no map of\n// its own for this.\nimport { useEffect, useRef, useState } from \"react\";\nimport * as maplibregl from \"maplibre-gl\";\n// Positions the marker and styles the attribution control; without it the\n// pin sits in normal flow at the top left instead of on its coordinate.\nimport \"maplibre-gl/dist/maplibre-gl.css\";\nimport type { GeoJSONSource, Map as MapLibreMap, Marker as MapLibreMarker } from \"maplibre-gl\";\nimport type { FeatureCollection, GeoJSON } from \"geojson\";\nimport type { Overlay, Place } from \"../types\";\nimport { dateCoversYear } from \"./dates\";\nimport { placeBounds, placeCenter, type StoryPlaces } from \"./geo\";\nimport { applyOhmYear, crossfadeStyleSwap, mapStyleKey, mapStyleUrl } from \"./mapStyles\";\nimport { PIN_PATH_D, type PlayerColors } from \"./theme\";\n\nconst SHAPE_SOURCE = \"story-shape\";\nconst FILL_LAYER = \"story-shape-fill\";\nconst LINE_LAYER = \"story-shape-line\";\nconst POINT_LAYER = \"story-shape-points\";\nconst LABEL_LAYER = \"story-shape-labels\";\nconst OVERLAY_PREFIX = \"story-overlay-\";\nconst PLACES_SOURCE = \"story-places\";\nconst PLACES_LAYER = \"story-places-dots\";\n// Room around the outermost dots of the opening view, inside the part of\n// the map the slide panel leaves free.\nconst OVERVIEW_PADDING = 60;\nconst EMPTY: FeatureCollection = { type: \"FeatureCollection\", features: [] };\n\n/** The current slide, as far as the map cares. `key` is the slide id:\n * what tells \"a new slide\" from \"the same slide, re-rendered\". */\nexport interface MapSlide {\n key: string;\n place: Place | undefined;\n /** Every place in the story, on an opening slide with no place of its\n * own: framed together, a dot each, instead of the pin. */\n overview: StoryPlaces | null;\n}\n\n/** Frame the story's places for an overview; else the place's shape or\n * overlays (usually a field, a route or an old map, far tighter than a\n * town-level zoom); else fly to its point. */\nfunction moveCamera(map: MapLibreMap, slide: MapSlide, duration: number) {\n if (slide.overview) {\n const [west, south, east, north] = slide.overview.bounds;\n map.fitBounds([[west, south], [east, north]], { maxZoom: 9, padding: OVERVIEW_PADDING, duration });\n return;\n }\n const place = slide.place;\n const bounds = placeBounds(place);\n if (bounds) {\n map.fitBounds([[bounds[0], bounds[1]], [bounds[2], bounds[3]]], { maxZoom: 17, duration });\n return;\n }\n const center = placeCenter(place);\n if (center) map.flyTo({ center, zoom: 9, essential: true, duration });\n}\n\n/** The pin on the place; hidden for an overview (the dots stand in for\n * it), else held where it was, dimmed, for a slide with no place. */\nfunction placeMarker(marker: MapLibreMarker | null, slide: MapSlide) {\n if (!marker) return;\n const center = placeCenter(slide.place);\n if (center) marker.setLngLat(center);\n // Through the marker, not its element's style: maplibre rewrites that\n // from the marker's own opacity every frame.\n marker.setOpacity(slide.overview ? 0 : center ? 1 : 0.4);\n}\n\nconst placeDots = (overview: StoryPlaces | null): FeatureCollection => ({\n type: \"FeatureCollection\",\n features: (overview?.points ?? []).map((coordinates) => ({\n type: \"Feature\", properties: {}, geometry: { type: \"Point\", coordinates },\n })),\n});\n\nexport function MapBackground({ initialCenter, current, dark, colors, panelFraction, ohmYear, resolveMedia }: {\n initialCenter: [number, number];\n current: MapSlide;\n dark: boolean;\n colors: PlayerColors;\n /** How much of the right side the slide panel covers: a point is\n * centered in the remaining left part, not the whole width. */\n panelFraction: number;\n /** Non-null switches to OpenHistoricalMap filtered to this year. */\n ohmYear: number | null;\n resolveMedia: (key: string) => Promise<string | null>;\n}) {\n // A callback ref (via state), not useRef: a host that mounts the player\n // inside a modal may not have it in the DOM on the first render, and a\n // plain ref would leave the create-effect below nothing to re-run on.\n const [containerEl, setContainerEl] = useState<HTMLDivElement | null>(null);\n const mapRef = useRef<MapLibreMap | null>(null);\n const markerRef = useRef<MapLibreMarker | null>(null);\n // True after each \"style.load\" (initial load, and again after every\n // style swap, which wipes the layers this component adds).\n const [ready, setReady] = useState(false);\n\n const darkRef = useRef(dark);\n darkRef.current = dark;\n const ohmYearRef = useRef(ohmYear);\n ohmYearRef.current = ohmYear;\n const colorsRef = useRef(colors);\n colorsRef.current = colors;\n // overlay layer id -> its date, for re-checking visibility on a year change.\n const overlayDatesRef = useRef<Map<string, Overlay[\"date\"]>>(new Map());\n // What the map was built or last swapped with, so a re-render with the\n // same effective style never triggers a reload.\n const appliedStyleKeyRef = useRef(mapStyleKey(dark, ohmYear));\n const currentRef = useRef(current);\n currentRef.current = current;\n\n useEffect(() => {\n if (!containerEl) return;\n setReady(false);\n appliedStyleKeyRef.current = mapStyleKey(darkRef.current, ohmYearRef.current);\n const map = new maplibregl.Map({\n container: containerEl,\n style: mapStyleUrl(darkRef.current, ohmYearRef.current),\n zoom: 5,\n attributionControl: { compact: true },\n // So crossfadeStyleSwap's snapshot has the last frame in it.\n canvasContextAttributes: { preserveDrawingBuffer: true },\n });\n mapRef.current = map;\n map.on(\"style.load\", () => setReady(true));\n // Center points in the part of the map the slide panel doesn't cover.\n map.setPadding({ top: 0, bottom: 0, left: 0, right: containerEl.clientWidth * panelFraction });\n // Straight to the opening slide's place, unanimated. The camera effect\n // below ran for it before this map existed (the container arrives a\n // render late), so a story opened partway through starts there too.\n const start = currentRef.current;\n map.jumpTo({ center: placeCenter(start.place) ?? initialCenter });\n moveCamera(map, start, 0);\n map.on(\"load\", () => {\n const c = colorsRef.current;\n const el = document.createElement(\"div\");\n el.style.width = \"26px\";\n el.style.height = \"26px\";\n el.style.transition = \"opacity 300ms\";\n el.innerHTML = `<svg viewBox=\"0 0 24 24\" width=\"26\" height=\"26\">`\n + `<path d=\"${PIN_PATH_D}\" fill=\"${c.mark}\" stroke=\"${c.surface}\" stroke-width=\"1.5\" />`\n + `</svg>`;\n // The pin's tip, not its middle, sits on the coordinate.\n markerRef.current = new maplibregl.Marker({ element: el, anchor: \"bottom\" }).setLngLat(initialCenter).addTo(map);\n placeMarker(markerRef.current, currentRef.current);\n });\n return () => {\n markerRef.current?.remove();\n markerRef.current = null;\n map.remove();\n mapRef.current = null;\n };\n // initialCenter is only the first frame; moving is the effect below.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [containerEl]);\n\n useEffect(() => {\n const map = mapRef.current;\n const key = mapStyleKey(dark, ohmYear);\n if (!map || appliedStyleKeyRef.current === key) return;\n appliedStyleKeyRef.current = key;\n crossfadeStyleSwap(map, mapStyleUrl(dark, ohmYear), () => setReady(false));\n }, [dark, ohmYear]);\n\n useEffect(() => {\n const map = mapRef.current;\n if (!map || !ready || ohmYear == null) return;\n applyOhmYear(map, ohmYear);\n }, [ready, ohmYear]);\n\n // The shape layers, (re-)added after every style load, under the marker.\n useEffect(() => {\n const map = mapRef.current;\n if (!map || !ready || map.getSource(SHAPE_SOURCE)) return;\n const c = colorsRef.current;\n map.addSource(SHAPE_SOURCE, { type: \"geojson\", data: EMPTY });\n // A feature's own `color` property (simplestyle-ish) wins over the mark color.\n const color = [\"coalesce\", [\"get\", \"color\"], c.mark] as maplibregl.ExpressionSpecification;\n map.addLayer({\n id: FILL_LAYER, type: \"fill\", source: SHAPE_SOURCE,\n filter: [\"==\", [\"geometry-type\"], \"Polygon\"],\n paint: { \"fill-color\": color, \"fill-opacity\": 0.25 },\n });\n map.addLayer({\n id: LINE_LAYER, type: \"line\", source: SHAPE_SOURCE,\n filter: [\"any\", [\"==\", [\"geometry-type\"], \"Polygon\"], [\"==\", [\"geometry-type\"], \"LineString\"]],\n paint: { \"line-color\": color, \"line-width\": 2 },\n });\n map.addLayer({\n id: POINT_LAYER, type: \"circle\", source: SHAPE_SOURCE,\n // A named point is a label (next layer), drawn as text only.\n filter: [\"all\", [\"==\", [\"geometry-type\"], \"Point\"], [\"!\", [\"has\", \"name\"]]],\n paint: { \"circle-radius\": 5, \"circle-color\": color, \"circle-stroke-width\": 1, \"circle-stroke-color\": c.surface },\n });\n map.addLayer({\n id: LABEL_LAYER, type: \"symbol\", source: SHAPE_SOURCE,\n filter: [\"all\", [\"==\", [\"geometry-type\"], \"Point\"], [\"has\", \"name\"]],\n layout: {\n \"text-field\": [\"get\", \"name\"],\n \"text-size\": 12,\n \"text-font\": [\"Noto Sans Regular\"],\n \"text-anchor\": \"left\",\n \"text-offset\": [0.6, 0],\n },\n paint: {\n \"text-color\": [\"coalesce\", [\"get\", \"color\"], c.text],\n \"text-halo-color\": c.surface,\n \"text-halo-width\": 1.5,\n },\n });\n map.addSource(PLACES_SOURCE, { type: \"geojson\", data: EMPTY });\n map.addLayer({\n id: PLACES_LAYER, type: \"circle\", source: PLACES_SOURCE,\n paint: { \"circle-radius\": 6, \"circle-color\": c.mark, \"circle-stroke-width\": 2, \"circle-stroke-color\": c.surface },\n });\n }, [ready]);\n\n const place = current.place;\n\n // The current slide's shape, or the overview's dots. Re-supplied after each style load, since a\n // swap empties the source.\n useEffect(() => {\n const map = mapRef.current;\n if (!map || !ready) return;\n const source = map.getSource(SHAPE_SOURCE) as GeoJSONSource | undefined;\n source?.setData((place?.geometry as GeoJSON | undefined) ?? EMPTY);\n const dots = map.getSource(PLACES_SOURCE) as GeoJSONSource | undefined;\n dots?.setData(placeDots(current.overview));\n }, [ready, current.key, place, current.overview]);\n\n // Camera: once per slide (see moveCamera). Keyed to the slide, not to `ready`, so a\n // map-mode switch never yanks the view back from wherever the viewer\n // has since panned.\n useEffect(() => {\n const map = mapRef.current;\n if (!map) return;\n placeMarker(markerRef.current, current);\n // No place and no overview: the camera stays put.\n moveCamera(map, current, 900);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [current.key]);\n\n // Image overlays: one image source + raster layer each, under the shape\n // layers, lowest `order` first so the highest ends up on top. Keyed by\n // the overlays themselves, so consecutive slides at the same place keep\n // theirs instead of reloading them.\n const overlayKey = JSON.stringify(place?.overlays ?? []);\n useEffect(() => {\n const map = mapRef.current;\n const overlays = place?.overlays ?? [];\n if (!map || !ready || overlays.length === 0) return;\n let cancelled = false;\n const added: string[] = [];\n (async () => {\n const sorted = overlays\n .map((overlay, i) => ({ overlay, i }))\n .sort((a, b) => (a.overlay.order ?? a.i) - (b.overlay.order ?? b.i));\n for (const { overlay, i } of sorted) {\n const url = await resolveMedia(overlay.media);\n if (cancelled) return;\n if (!url) continue;\n const id = `${OVERLAY_PREFIX}${i}`;\n if (map.getSource(id)) continue;\n map.addSource(id, { type: \"image\", url, coordinates: overlay.corners });\n map.addLayer({ id, type: \"raster\", source: id }, FILL_LAYER);\n map.setPaintProperty(id, \"raster-opacity\", overlay.opacity ?? 1);\n overlayDatesRef.current.set(id, overlay.date);\n map.setLayoutProperty(id, \"visibility\", dateCoversYear(overlay.date, ohmYearRef.current) ? \"visible\" : \"none\");\n added.push(id);\n }\n })();\n return () => {\n cancelled = true;\n for (const id of added) {\n overlayDatesRef.current.delete(id);\n if (map.getLayer(id)) map.removeLayer(id);\n if (map.getSource(id)) map.removeSource(id);\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [overlayKey, ready]);\n\n // A new map year alone: re-check each overlay's era.\n useEffect(() => {\n const map = mapRef.current;\n if (!map || !ready) return;\n for (const [id, date] of overlayDatesRef.current) {\n if (!map.getLayer(id)) continue;\n map.setLayoutProperty(id, \"visibility\", dateCoversYear(date, ohmYear) ? \"visible\" : \"none\");\n }\n }, [ohmYear, ready]);\n\n return <div ref={setContainerEl} style={{ position: \"absolute\", inset: 0 }} />;\n}\n", "// Basemaps for the story map: OpenFreeMap (light), CARTO Dark Matter (dark)\n// and OpenHistoricalMap (historical, filtered to a year), plus the\n// crossfade used when switching between them. Gramps Connect's own map\n// view uses these too (its visuals/mapStyles.ts re-exports them), so the\n// app and the story player can't drift into two versions of the same three\n// map modes.\nimport type { Map as MapLibreMap } from \"maplibre-gl\";\n// A CJS module with no browser global to patch onto (it only self-attaches\n// to `window.maplibregl`, which our namespace import never creates) -- the\n// named export below is what its `module.exports` branch actually produces,\n// and it's what both callers use directly rather than the `map.filterByDate`\n// method the plugin's own README shows for a script-tag install.\nimport { filterByDate } from \"@openhistoricalmap/maplibre-gl-dates\";\n\n/** The same OpenFreeMap \"liberty\" style gramps-web uses for its light\n * basemap, so the two clients' maps look like the same product in light\n * mode. Free, key-less, and hosted -- which does mean a map (unlike every\n * other view in this app) needs the network even though its *data* is\n * local. */\nexport const STYLE_LIGHT = \"https://tiles.openfreemap.org/styles/liberty\";\n/** OpenFreeMap's own \"dark\" style renders every layer, including water, in\n * the same near-zero-saturation gray (confirmed against their own demo at\n * openfreemap.org) -- there's no hue anywhere to tell land from water at a\n * glance. CARTO's Dark Matter style is the free, key-less alternative with\n * an actual (if muted) blue-gray palette -- water and major roads read as\n * distinct from background and from each other. */\nexport const STYLE_DARK = \"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json\";\n\n/** OHM's own vector style -- one cartography regardless of light/dark,\n * matching gramps-web's choice. */\nexport const OHM_STYLE = \"https://www.openhistoricalmap.org/map-styles/main/main.json\";\n\n/** The three selectable modes wherever a historical map is shown. \"auto\" and\n * \"historical\" both render OHM tiles filtered to a year -- they differ only\n * in where that year comes from (context vs. a user-dragged slider), which\n * is why both map components take a single `ohmYear: number | null` rather\n * than the mode itself: \"standard\" and an \"auto\" with nothing to derive a\n * year from look identical to the map, and are meant to. */\nexport type MapMode = \"auto\" | \"standard\" | \"historical\";\n\n/** A stable key for \"would setStyle() actually change anything\" -- swapping\n * light/dark never matters once OHM is showing (its cartography doesn't\n * have a dark variant), so a slider drag that changes `ohmYear`'s value\n * without leaving historical/auto mode must not trip a style reload. */\nexport function mapStyleKey(dark: boolean, ohmYear: number | null): string {\n return ohmYear != null ? \"ohm\" : dark ? \"dark\" : \"light\";\n}\n\nexport function mapStyleUrl(dark: boolean, ohmYear: number | null): string {\n return ohmYear != null ? OHM_STYLE : dark ? STYLE_DARK : STYLE_LIGHT;\n}\n\n/** Swaps a map's style as a true crossfade -- the old and new basemaps\n * dissolving into each other, not one fading out before the other fades in.\n * A single WebGL map can only ever show one style at a time, so this fakes\n * it: a snapshot of the *old* style (a plain `<img>`, frozen) is overlaid\n * over the live map at full opacity, the live map underneath is swapped to\n * the new style immediately and left to load, and once it's actually\n * finished drawing (`idle`, not `style.load` -- that fires before a single\n * tile of the new style has painted) the snapshot dissolves away, revealing\n * the new style continuously as it goes rather than snapping to it. This\n * also means the old map stays on screen, fully intact, for however long\n * the new style's tiles take to fetch -- no blank/loading gap either way,\n * unlike fading through transparent would give.\n *\n * Requires `preserveDrawingBuffer: true` on the map (see both callers'\n * constructors) -- without it, `toDataURL()` on the canvas can come back\n * blank depending on exactly when the browser clears the drawing buffer\n * after compositing. Falls back to an instant, unfaded swap if the snapshot\n * can't be taken at all (a tainted canvas, or a browser that disallows it) --\n * a plain setStyle() rather than no swap.\n *\n * `beforeSwap` runs at the same moment as setStyle(), so a caller's own\n * `setReady(false)` -- which gates its layer re-add effect -- flips exactly\n * when setStyle() actually discards those layers. */\nexport function crossfadeStyleSwap(map: MapLibreMap, styleUrl: string, beforeSwap: () => void, duration = 300): void {\n const container = map.getContainer();\n // The container is `position: absolute` but neither caller gives it its\n // own `z-index` -- which means it *doesn't* establish a stacking context\n // of its own, and the overlay's z-index below would then be compared not\n // just against the container's own children but against the container's\n // own siblings elsewhere on the page (StoryView.tsx's content panel,\n // MapView.tsx's PlaceCard popup, both positioned with their own z-index).\n // Found live: the overlay ended up painting over the story's content\n // panel instead of staying confined beneath it. Setting a z-index here\n // (any value; 0 keeps this box in the same paint bucket it was already\n // in) traps the overlay inside this container instead.\n if (!container.style.zIndex) container.style.zIndex = \"0\";\n let snapshotUrl: string | null = null;\n try {\n snapshotUrl = map.getCanvas().toDataURL(\"image/png\");\n } catch {\n // Tainted canvas or an unsupported browser -- no crossfade, just swap.\n }\n\n beforeSwap();\n map.setStyle(styleUrl);\n if (!snapshotUrl) return;\n\n const overlay = document.createElement(\"img\");\n overlay.src = snapshotUrl;\n overlay.alt = \"\";\n Object.assign(overlay.style, {\n position: \"absolute\", inset: \"0\", width: \"100%\", height: \"100%\",\n zIndex: \"5\", pointerEvents: \"none\", transition: `opacity ${duration}ms ease`,\n });\n container.appendChild(overlay);\n map.once(\"idle\", () => {\n // rAF, not set on the same tick as append -- a transition needs the\n // browser to have painted the starting opacity (1, the element's\n // default) at least once before a change to it will animate rather\n // than just jumping straight to the end state.\n requestAnimationFrame(() => { overlay.style.opacity = \"0\"; });\n window.setTimeout(() => overlay.remove(), duration + 50);\n });\n}\n\n/** Filters an OHM style's own vector layers to a year. A no-op on any layer\n * without a `source-layer` -- which is every layer either map component\n * adds itself (GeoJSON place markers, clusters, the story's pin) -- and\n * idempotent to call again on every year change: the plugin rewrites a\n * `let`-bound variable in place rather than re-wrapping each layer's filter,\n * so a slider drag never needs a style reload to take effect. */\nexport function applyOhmYear(map: MapLibreMap, year: number): void {\n filterByDate(map, String(Math.round(year)));\n}\n", "// The player's look, as plain values a host can override (a host app\n// passes its own theme's colors, so the story matches it). Its words are\n// in strings.ts.\n\nexport interface PlayerColors {\n /** Page and strip background. */\n surface: string;\n text: string;\n muted: string;\n border: string;\n /** The pin, timeline dots and default shape color. */\n mark: string;\n /** The slide panel's solid color, fading in over the map. */\n panel: string;\n}\n\n/** The marks' blue clears 3:1 against both surfaces. */\nexport function defaultColors(dark: boolean): PlayerColors {\n return dark\n ? { surface: \"#242424\", text: \"#c9c9c9\", muted: \"#828282\", border: \"#424242\", mark: \"#3987e5\", panel: \"rgb(20,20,20)\" }\n : { surface: \"#ffffff\", text: \"#000000\", muted: \"#868e96\", border: \"#dee2e6\", mark: \"#2a78d6\", panel: \"rgb(255,255,255)\" };\n}\n\n/** A map pin (round top, point at the bottom) in a 24x24 box with its tip\n * at (12, 24): the map marker and the current timeline dot share it, and\n * every use aligns that tip to the point it marks. */\nexport const PIN_PATH_D = \"M12 0C7.03 0 3 4.03 3 9c0 6.25 9 15 9 15s9-8.75 9-15c0-4.97-4.03-9-9-9z\";\n", "// The Auto / Standard / Historical map picker, in plain HTML. A host app\n// with its own UI kit can supply its own control instead (StoryPlayer's\n// renderMapModeControl), taking the same props.\nimport type { PlayerStrings } from \"./strings\";\nimport type { PlayerColors } from \"./theme\";\n\n/** \"standard\" is today's map; \"historical\" a map of the year the viewer\n * picks; \"auto\" a map of each slide's own year as the story moves. */\nexport type MapMode = \"auto\" | \"standard\" | \"historical\";\n\nexport interface MapModeControlProps {\n mode: MapMode;\n onModeChange: (mode: MapMode) => void;\n /** What Auto resolves to on this slide, or null with no date to use. */\n autoYear: number | null;\n /** The viewer's own pick, live while mode is \"historical\". */\n year: number;\n onYearChange: (year: number) => void;\n yearBounds: [number, number];\n}\n\nexport function MapModeControl({ mode, onModeChange, autoYear, year, onYearChange, yearBounds, strings, colors }:\n MapModeControlProps & { strings: PlayerStrings; colors: PlayerColors }) {\n const modes: [MapMode, string][] = [[\"auto\", strings.auto], [\"standard\", strings.standard], [\"historical\", strings.historical]];\n const font = { fontSize: 12, fontFamily: \"inherit\" };\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 10, whiteSpace: \"nowrap\" }}>\n <div role=\"radiogroup\" aria-label={strings.mapMode} style={{ display: \"flex\", border: `1px solid ${colors.border}`, borderRadius: 6, overflow: \"hidden\", background: colors.surface }}>\n {modes.map(([value, label]) => (\n <button\n key={value}\n type=\"button\"\n role=\"radio\"\n aria-checked={mode === value}\n onClick={() => onModeChange(value)}\n style={{\n ...font, padding: \"4px 10px\", border: \"none\", cursor: \"pointer\",\n background: mode === value ? colors.mark : \"transparent\",\n color: mode === value ? \"#ffffff\" : colors.text,\n }}\n >\n {label}\n </button>\n ))}\n </div>\n {mode === \"auto\" && (\n <span style={{ ...font, color: colors.muted }}>\n {autoYear != null ? strings.historicalMapYear(autoYear) : strings.noDateStandardMap}\n </span>\n )}\n {mode === \"historical\" && (\n <span style={{ display: \"flex\", alignItems: \"center\", gap: 6 }}>\n <input\n type=\"range\"\n min={yearBounds[0]}\n max={yearBounds[1]}\n step={1}\n value={year}\n onChange={(e) => onYearChange(Number(e.currentTarget.value))}\n aria-label={strings.historicalYear}\n style={{ width: 150, accentColor: colors.mark }}\n />\n <input\n type=\"number\"\n min={yearBounds[0]}\n max={yearBounds[1]}\n step={1}\n value={year}\n onChange={(e) => {\n const value = Number(e.currentTarget.value);\n if (Number.isFinite(value) && e.currentTarget.value !== \"\") onYearChange(Math.round(value));\n }}\n aria-label={strings.historicalYear}\n style={{ ...font, width: 70, padding: \"3px 4px\", border: `1px solid ${colors.border}`, borderRadius: 4, background: colors.surface, color: colors.text }}\n />\n </span>\n )}\n </div>\n );\n}\n", "// Slide text markup (spec/1.0/README.md section 4): **bold**, *italic*,\n// line breaks, and blank lines between paragraphs -- nothing else. Parsed\n// into plain data rather than HTML, so a viewer can never be tricked into\n// rendering markup a story file smuggles in.\n\nexport interface TextSpan {\n text: string;\n bold?: boolean;\n italic?: boolean;\n}\n\n/** Paragraphs of lines of spans. */\nexport type ParsedText = TextSpan[][][];\n\n// Bold before italic, so a bold span's own ** pair isn't read as two empty\n// italic spans. Neither crosses a line break.\nconst MARKERS = /\\*\\*([^\\n]+?)\\*\\*|\\*([^\\n]+?)\\*/g;\n\nfunction parseLine(line: string): TextSpan[] {\n const spans: TextSpan[] = [];\n let last = 0;\n for (const match of line.matchAll(MARKERS)) {\n const index = match.index ?? 0;\n if (index > last) spans.push({ text: line.slice(last, index) });\n if (match[1] !== undefined) spans.push({ text: match[1], bold: true });\n else spans.push({ text: match[2], italic: true });\n last = index + match[0].length;\n }\n if (last < line.length) spans.push({ text: line.slice(last) });\n return spans;\n}\n\nexport function parseStoryText(text: string): ParsedText {\n return text\n .replace(/\\r\\n?/g, \"\\n\")\n .split(/\\n[ \\t]*\\n+/)\n .map((paragraph) => paragraph.replace(/^\\n+|\\n+$/g, \"\"))\n .filter((paragraph) => paragraph.length > 0)\n .map((paragraph) => paragraph.split(\"\\n\").map(parseLine));\n}\n", "// The player's own words -- the few on its buttons and map control, never\n// the story's -- in a handful of languages, chosen by the story's language\n// and then the browser's. A host with its own translations passes\n// StoryPlayer's `strings` instead.\n\nexport interface PlayerStrings {\n previous: string;\n next: string;\n close: string;\n mapMode: string;\n auto: string;\n standard: string;\n historical: string;\n /** The Auto mode's readout. */\n historicalMapYear: (year: number) => string;\n noDateStandardMap: string;\n historicalYear: string;\n}\n\nexport const ENGLISH: PlayerStrings = {\n previous: \"Previous\",\n next: \"Next\",\n close: \"Close\",\n mapMode: \"Map\",\n auto: \"Auto\",\n standard: \"Standard\",\n historical: \"Historical\",\n historicalMapYear: (year) => `Historical map, ${year}`,\n noDateStandardMap: \"No date here \u2014 standard map\",\n historicalYear: \"Historical map year\",\n};\n\nconst TABLE: Record<string, PlayerStrings> = {\n en: ENGLISH,\n de: {\n previous: \"Zur\u00FCck\",\n next: \"Weiter\",\n close: \"Schlie\u00DFen\",\n mapMode: \"Karte\",\n auto: \"Automatisch\",\n standard: \"Standard\",\n historical: \"Historisch\",\n historicalMapYear: (year) => `Historische Karte, ${year}`,\n noDateStandardMap: \"Kein Datum hier \u2014 Standardkarte\",\n historicalYear: \"Jahr der historischen Karte\",\n },\n es: {\n previous: \"Anterior\",\n next: \"Siguiente\",\n close: \"Cerrar\",\n mapMode: \"Mapa\",\n auto: \"Autom\u00E1tico\",\n standard: \"Est\u00E1ndar\",\n historical: \"Hist\u00F3rico\",\n historicalMapYear: (year) => `Mapa hist\u00F3rico, ${year}`,\n noDateStandardMap: \"Sin fecha aqu\u00ED \u2014 mapa est\u00E1ndar\",\n historicalYear: \"A\u00F1o del mapa hist\u00F3rico\",\n },\n fr: {\n previous: \"Pr\u00E9c\u00E9dent\",\n next: \"Suivant\",\n close: \"Fermer\",\n mapMode: \"Carte\",\n auto: \"Auto\",\n standard: \"Standard\",\n historical: \"Historique\",\n historicalMapYear: (year) => `Carte historique, ${year}`,\n noDateStandardMap: \"Pas de date ici \u2014 carte standard\",\n historicalYear: \"Ann\u00E9e de la carte historique\",\n },\n nl: {\n previous: \"Vorige\",\n next: \"Volgende\",\n close: \"Sluiten\",\n mapMode: \"Kaart\",\n auto: \"Automatisch\",\n standard: \"Standaard\",\n historical: \"Historisch\",\n historicalMapYear: (year) => `Historische kaart, ${year}`,\n noDateStandardMap: \"Geen datum hier \u2014 standaardkaart\",\n historicalYear: \"Jaar van de historische kaart\",\n },\n};\n\n/** The best table for a list of BCP 47 tags, most preferred first:\n * \"de-CH\" matches \"de\"; English when nothing does. */\nexport function stringsFor(...languages: (string | undefined)[]): PlayerStrings {\n for (const tag of languages) {\n const base = tag?.toLowerCase().split(/[-_]/)[0];\n if (base && TABLE[base]) return TABLE[base];\n }\n return ENGLISH;\n}\n\n/** Languages with a built-in table. */\nexport const PLAYER_LANGUAGES = Object.keys(TABLE);\n", "// \"A line with years on it, and a dot\": where the current slide sits among\n// the story's dated slides, with click-to-jump per dot. SVG, since a story\n// has at most a few dozen dated slides and SVG rescales for free.\nimport { useEffect, useRef, useState } from \"react\";\nimport { axisTicks, storyDomain, tickLabel, xForYear } from \"./timelineLayout\";\nimport { PIN_PATH_D, type PlayerColors } from \"./theme\";\n\nexport const TIMELINE_HEIGHT = 70;\nconst MARGIN = 28;\n/** Where each pin's tip touches the axis. */\nconst AXIS_Y = 42;\nconst LABEL_Y = 62;\nconst CURRENT_SCALE = 0.95;\n\nexport interface TimelinePoint {\n index: number;\n year: number;\n}\n\nexport function TimelineStrip({ points, currentIndex, onSelect, colors }: {\n points: TimelinePoint[];\n currentIndex: number;\n onSelect: (index: number) => void;\n colors: PlayerColors;\n}) {\n const containerRef = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(0);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n const observer = new ResizeObserver(([entry]) => setWidth(entry.contentRect.width));\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n const plotWidth = Math.max(0, width - MARGIN * 2);\n const domain = storyDomain(points.map((p) => p.year));\n const ticks = plotWidth > 0 ? axisTicks(domain, plotWidth) : [];\n\n return (\n <div\n ref={containerRef}\n style={{\n position: \"absolute\", left: 0, right: 0, bottom: 0, height: TIMELINE_HEIGHT, background: colors.surface,\n // Above the slide panel, whose fading background would otherwise\n // wash out any dot beneath it.\n zIndex: 2,\n }}\n >\n {width > 0 && (\n <svg width={width} height={TIMELINE_HEIGHT} style={{ display: \"block\", overflow: \"visible\" }}>\n <line x1={MARGIN} y1={AXIS_Y} x2={width - MARGIN} y2={AXIS_Y} stroke={colors.border} strokeWidth={1} />\n {ticks.map((tick) => (\n <text key={tick.x} x={MARGIN + tick.x} y={LABEL_Y} fontSize={15} fill={colors.muted} textAnchor=\"middle\">\n {tick.label}\n </text>\n ))}\n {points.map((point) => {\n const cx = MARGIN + xForYear(point.year, domain, plotWidth);\n const current = point.index === currentIndex;\n return current ? (\n <path\n key={point.index}\n d={PIN_PATH_D}\n transform={`translate(${cx - 12 * CURRENT_SCALE} ${AXIS_Y - 24 * CURRENT_SCALE}) scale(${CURRENT_SCALE})`}\n fill={colors.mark}\n stroke={colors.text}\n strokeWidth={1.5}\n style={{ cursor: \"pointer\" }}\n onClick={() => onSelect(point.index)}\n >\n <title>{tickLabel(point.year)}</title>\n </path>\n ) : (\n <circle\n key={point.index}\n cx={cx}\n cy={AXIS_Y}\n r={3.5}\n fill={colors.mark}\n stroke={colors.surface}\n strokeWidth={1.5}\n style={{ cursor: \"pointer\" }}\n onClick={() => onSelect(point.index)}\n >\n <title>{tickLabel(point.year)}</title>\n </circle>\n );\n })}\n </svg>\n )}\n </div>\n );\n}\n", "// Layout math for the timeline strip along the bottom of a story -- pure\n// numbers, no DOM.\n\n/** The year range the strip covers, with a little padding, so a lone dot\n * (or two dots in the same year) still sits on a real span. */\nexport function storyDomain(years: number[]): [number, number] {\n const min = Math.min(...years);\n const max = Math.max(...years);\n if (max - min < 1) return [min - 5, min + 5];\n const padding = (max - min) * 0.05;\n return [min - padding, max + padding];\n}\n\n/** Where a year lands across a `width`-px strip for `domain`. */\nexport function xForYear(year: number, domain: [number, number], width: number): number {\n const [start, end] = domain;\n const span = end - start;\n if (!(span > 0)) return width / 2;\n return ((year - start) / span) * width;\n}\n\nexport interface AxisTick {\n x: number;\n label: string;\n}\n\n/** Candidate tick spacings in years, coarse to fine. */\nconst TICK_STEPS = [1000, 500, 250, 100, 50, 25, 10, 5, 2, 1];\n/** Aim for roughly this many labelled ticks. */\nconst TARGET_TICKS = 8;\n\nexport function axisTicks(domain: [number, number], width: number): AxisTick[] {\n const [start, end] = domain;\n const span = end - start;\n if (!(span > 0) || width <= 0) return [];\n const step = TICK_STEPS.find((candidate) => span / candidate >= TARGET_TICKS) ?? 1;\n const ticks: AxisTick[] = [];\n for (let year = Math.ceil(start / step) * step; year < end; year += step) {\n ticks.push({ x: ((year - start) / span) * width, label: tickLabel(year) });\n }\n return ticks;\n}\n\n/** Negative years are BC: genealogical calendars have no year 0. */\nexport function tickLabel(year: number): string {\n const whole = Math.floor(year);\n return whole < 0 ? `${-whole} BC` : String(whole);\n}\n", "// A date as typed (\"about 1850\", \"um 1850\") to its precise form (EDTF),\n// read the way Gramps reads dates, in the story's language: the player\n// needs the precise form for the timeline and for picking historical maps.\nimport { loadLocale, parseDate, resolveLocaleCode, toEdtf } from \"@gramps-connect/gramps-date\";\n\n/** Turns date text into EDTF, or undefined when the text isn't a date\n * that has one (\"spring 1850\", a non-Gregorian date). */\nexport type DateTextParser = (text: string, language: string | undefined) => Promise<string | undefined>;\n\n/** The default parser: gramps-date in the story's language (loaded on first\n * use), English when the story has none or gramps-date doesn't know it. */\nexport const suggestEdtf: DateTextParser = async (text, language) => {\n if (!text.trim()) return undefined;\n const code = (language && resolveLocaleCode(language.replace(/-/g, \"_\"))) || \"en\";\n if (code !== \"en\" && !(await loadLocale(code))) return undefined;\n try {\n return toEdtf(parseDate(text, { locale: code }));\n } catch {\n return undefined;\n }\n};\n", "// A slide's date: the text readers see, and its precise form (EDTF), which\n// follows the text as it's typed until someone changes it by hand.\nimport { useEffect, useRef, useState } from \"react\";\nimport { Anchor, Group, Stack, Text, TextInput } from \"@mantine/core\";\nimport type { StoryDate } from \"../types\";\nimport { edtfYearRange } from \"../player/dates\";\nimport type { DateTextParser } from \"./dates\";\nimport { slideDate } from \"./model\";\nimport type { EditorStrings } from \"./strings\";\n\nexport interface DateFieldProps {\n value: StoryDate | undefined;\n language: string | undefined;\n parse: DateTextParser;\n strings: EditorStrings;\n onChange: (date: StoryDate | undefined) => void;\n}\n\n/** Keyed by slide in the parent, so `following` starts over per slide. */\nexport function DateField({ value, language, parse, strings, onChange }: DateFieldProps) {\n // Whether the precise form is worked out from the text. Unknown (null)\n // until the stored one has been compared with what the text gives.\n const [following, setFollowing] = useState<boolean | null>(value?.edtf ? null : true);\n const latest = useRef(value);\n latest.current = value;\n const request = useRef(0);\n\n useEffect(() => {\n if (following !== null) return;\n let live = true;\n void parse(value?.text ?? \"\", language).then((edtf) => {\n if (live) setFollowing(edtf === value?.edtf);\n });\n return () => { live = false; };\n // Once, for the stored date.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const follow = (text: string) => {\n const id = ++request.current;\n void parse(text, language).then((edtf) => {\n // Only the latest text's answer, and only onto the date as it is now.\n if (id !== request.current || latest.current?.text !== text) return;\n onChange(slideDate(latest.current, text, edtf));\n });\n };\n\n const onText = (text: string) => {\n onChange(slideDate(latest.current, text, latest.current?.edtf));\n if (following !== false) follow(text);\n };\n\n const edtf = value?.edtf ?? \"\";\n const understood = !edtf || edtfYearRange(edtf) !== null;\n let note: string;\n if (edtf && !understood) note = strings.preciseDateNotUnderstood;\n else if (!edtf) note = strings.noPreciseDate;\n else if (following) note = strings.preciseDateFollows;\n else note = strings.preciseDateHint;\n\n return (\n <Stack gap={6}>\n <TextInput\n label={strings.date}\n description={strings.dateHint}\n value={value?.text ?? \"\"}\n onChange={(e) => onText(e.currentTarget.value)}\n />\n {value?.text && (\n <Group gap=\"sm\" align=\"flex-end\" wrap=\"nowrap\">\n <TextInput\n label={strings.preciseDate}\n size=\"xs\"\n w={200}\n value={edtf}\n error={!understood}\n styles={{ input: { fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\" } }}\n onChange={(e) => {\n setFollowing(false);\n onChange(slideDate(latest.current, latest.current?.text ?? \"\", e.currentTarget.value.trim() || undefined));\n }}\n />\n <Stack gap={0} pb={4}>\n <Text size=\"xs\" c={understood ? \"dimmed\" : \"red\"}>{note}</Text>\n {following === false && (\n <Anchor component=\"button\" type=\"button\" size=\"xs\" onClick={() => { setFollowing(true); follow(value.text); }}>\n {strings.matchDateAsWritten}\n </Anchor>\n )}\n </Stack>\n </Group>\n )}\n </Stack>\n );\n}\n", "// The editor's changes to a story, as pure functions from one StoryDoc to\n// the next -- never mutating, so undo is just keeping the old ones. Every\n// change spreads the object it touches, so fields this version doesn't\n// know (a newer minor version's, an extension's) ride along untouched:\n// opening and saving a story must never lose anything.\nimport { FORMAT_ID, FORMAT_VERSION } from \"../version\";\nimport type { Slide, StoryDate, StoryDoc } from \"../types\";\n\n/** A story with one empty slide: the smallest valid one. */\nexport function blankStory(title: string, language?: string): StoryDoc {\n return {\n format: FORMAT_ID,\n version: FORMAT_VERSION,\n title,\n ...(language ? { language } : {}),\n slides: [{ id: \"s0\", title }],\n media: {},\n };\n}\n\n/** \"s<n>\" past every id already of that form, so it's unique however the\n * story's other ids were made. */\nexport function nextSlideId(doc: StoryDoc): string {\n let max = -1;\n for (const slide of doc.slides) {\n const match = /^s(\\d+)$/.exec(slide.id);\n if (match) max = Math.max(max, Number(match[1]));\n }\n let n = max + 1;\n const ids = new Set(doc.slides.map((s) => s.id));\n while (ids.has(`s${n}`)) n += 1;\n return `s${n}`;\n}\n\nfunction withSlides(doc: StoryDoc, slides: Slide[]): StoryDoc {\n return { ...doc, slides };\n}\n\n/** A new empty slide after `index`; returns the story and the new slide's\n * index. */\nexport function addSlide(doc: StoryDoc, index: number): { doc: StoryDoc; index: number } {\n const slides = [...doc.slides];\n const at = Math.min(Math.max(index + 1, 0), slides.length);\n slides.splice(at, 0, { id: nextSlideId(doc) });\n return { doc: withSlides(doc, slides), index: at };\n}\n\n/** A copy of the slide right after it, with its own id. */\nexport function duplicateSlide(doc: StoryDoc, index: number): { doc: StoryDoc; index: number } {\n const slides = [...doc.slides];\n const copy = structuredClone(slides[index]);\n copy.id = nextSlideId(doc);\n slides.splice(index + 1, 0, copy);\n return { doc: withSlides(doc, slides), index: index + 1 };\n}\n\n/** Removes a slide, unless it's the only one (a story has at least one). */\nexport function deleteSlide(doc: StoryDoc, index: number): { doc: StoryDoc; index: number } {\n if (doc.slides.length <= 1) return { doc, index };\n const slides = doc.slides.filter((_, i) => i !== index);\n return { doc: withSlides(doc, slides), index: Math.min(index, slides.length - 1) };\n}\n\nexport function moveSlide(doc: StoryDoc, from: number, to: number): StoryDoc {\n if (from === to || to < 0 || to >= doc.slides.length) return doc;\n const slides = [...doc.slides];\n const [slide] = slides.splice(from, 1);\n slides.splice(to, 0, slide);\n return withSlides(doc, slides);\n}\n\n/** Sets fields on an object; an undefined value removes the field, so\n * cleared text doesn't linger as \"\". */\nfunction patched<T extends object>(base: T, patch: Partial<T>): T {\n const next = { ...base } as Record<string, unknown>;\n for (const [key, value] of Object.entries(patch)) {\n if (value === undefined) delete next[key];\n else next[key] = value;\n }\n return next as T;\n}\n\nexport function updateSlide(doc: StoryDoc, index: number, patch: Partial<Slide>): StoryDoc {\n const slides = [...doc.slides];\n slides[index] = patched(slides[index], patch);\n return withSlides(doc, slides);\n}\n\nexport function updateStory(doc: StoryDoc, patch: Partial<Omit<StoryDoc, \"slides\" | \"media\">>): StoryDoc {\n return patched(doc, patch as Partial<StoryDoc>);\n}\n\n/** A slide date from what was typed and its precise form. Empty text is no\n * date at all. A new precise form drops a `sortYear` it would contradict\n * (the timeline reads sortYear first); the date's other fields stay. */\nexport function slideDate(previous: StoryDate | undefined, text: string, edtf: string | undefined): StoryDate | undefined {\n if (!text.trim()) return undefined;\n const next = patched(previous ?? { text }, { text, edtf: edtf || undefined });\n if (next.edtf !== previous?.edtf) delete next.sortYear;\n return next;\n}\n\n/** Every media key a slide or overlay refers to. */\nexport function usedMedia(doc: StoryDoc): Set<string> {\n const used = new Set<string>();\n for (const slide of doc.slides) {\n for (const m of slide.media ?? []) used.add(m.ref);\n for (const o of slide.place?.overlays ?? []) used.add(o.media);\n }\n return used;\n}\n\n/** The story as it should be saved: media nothing refers to any more left\n * out, and the files only those that are still used. */\nexport function pruneMedia(doc: StoryDoc, files: Map<string, Uint8Array>): { doc: StoryDoc; files: Map<string, Uint8Array> } {\n const used = usedMedia(doc);\n const media = Object.fromEntries(Object.entries(doc.media).filter(([key]) => used.has(key)));\n const srcs = new Set(Object.values(media).map((m) => m.src));\n return {\n doc: { ...doc, media },\n files: new Map([...files].filter(([path]) => srcs.has(path))),\n };\n}\n\n/** \"Josef Meyer\" -> \"Josef Meyer.story.zip\", minus characters some file\n * systems refuse. */\nexport function storyFileName(title: string): string {\n const safe = title.replace(/[\\\\/:*?\"<>|\\u0000-\\u001f]+/g, \" \").replace(/\\s+/g, \" \").trim().slice(0, 120);\n return `${safe || \"story\"}.story.zip`;\n}\n\n/** Undo and redo over whole documents. Typing in one field makes one step,\n * not one per keystroke: a change with the same `key` within COALESCE_MS\n * of the last replaces it. */\nexport interface History {\n past: StoryDoc[];\n present: StoryDoc;\n future: StoryDoc[];\n lastKey?: string;\n lastAt?: number;\n}\n\nexport const COALESCE_MS = 1500;\nconst MAX_STEPS = 200;\n\nexport function startHistory(doc: StoryDoc): History {\n return { past: [], present: doc, future: [] };\n}\n\nexport function record(history: History, next: StoryDoc, key?: string, now = Date.now()): History {\n if (next === history.present) return history;\n const coalesce = key !== undefined && key === history.lastKey && history.lastAt !== undefined && now - history.lastAt < COALESCE_MS;\n const past = coalesce ? history.past : [...history.past, history.present].slice(-MAX_STEPS);\n return { past, present: next, future: [], lastKey: key, lastAt: now };\n}\n\nexport function undo(history: History): History {\n const previous = history.past[history.past.length - 1];\n if (!previous) return history;\n return { past: history.past.slice(0, -1), present: previous, future: [history.present, ...history.future] };\n}\n\nexport function redo(history: History): History {\n const [next, ...future] = history.future;\n if (!next) return history;\n return { past: [...history.past, history.present], present: next, future };\n}\n", "// A list of slides to pick from and reorder by dragging -- generic over\n// what a slide is, so any story editor can use it with its own rows.\nimport { useState, type ReactNode } from \"react\";\nimport { Stack, UnstyledButton } from \"@mantine/core\";\n\nexport interface SlideListProps<T> {\n items: T[];\n selected: number;\n onSelect: (index: number) => void;\n /** Called when a row is dropped somewhere else. */\n onMove: (from: number, to: number) => void;\n getKey: (item: T, index: number) => string;\n renderItem: (item: T, index: number) => ReactNode;\n label?: string;\n}\n\nexport function SlideList<T>({ items, selected, onSelect, onMove, getKey, renderItem, label }: SlideListProps<T>) {\n const [dragging, setDragging] = useState<number | null>(null);\n const [over, setOver] = useState<number | null>(null);\n const end = () => { setDragging(null); setOver(null); };\n\n return (\n <Stack gap={4} role=\"listbox\" aria-label={label}>\n {items.map((item, i) => {\n const isSelected = i === selected;\n // A line on the side the row will land: below when moving down.\n const dropLine = over === i && dragging !== null && dragging !== i\n ? (dragging < i ? { borderBottom: \"2px solid var(--mantine-primary-color-filled)\" } : { borderTop: \"2px solid var(--mantine-primary-color-filled)\" })\n : {};\n return (\n <UnstyledButton\n key={getKey(item, i)}\n role=\"option\"\n aria-selected={isSelected}\n draggable\n onClick={() => onSelect(i)}\n onDragStart={(e) => { setDragging(i); e.dataTransfer.effectAllowed = \"move\"; e.dataTransfer.setData(\"text/plain\", String(i)); }}\n onDragOver={(e) => { if (dragging === null) return; e.preventDefault(); setOver(i); }}\n onDrop={(e) => { e.preventDefault(); if (dragging !== null && dragging !== i) onMove(dragging, i); end(); }}\n onDragEnd={end}\n style={{\n display: \"block\", width: \"100%\", padding: \"6px 8px\", borderRadius: 6,\n background: isSelected ? \"var(--mantine-primary-color-light)\" : undefined,\n opacity: dragging === i ? 0.5 : 1,\n ...dropLine,\n }}\n >\n {renderItem(item, i)}\n </UnstyledButton>\n );\n })}\n </Stack>\n );\n}\n", "// A plain Textarea plus Bold/Italic buttons that wrap the selection in the\n// story format's `**`/`*` markers -- the only formatting a slide's text has\n// (parseStoryText is the matching reader), so no rich-text editor.\nimport { useRef } from \"react\";\nimport { Button, Group, Stack, Text, Textarea } from \"@mantine/core\";\n\n/** Wraps the textarea's selection in `marker` (or unwraps it, if the\n * selection is already exactly `marker\u2026marker`); with nothing selected,\n * inserts an empty pair and leaves the cursor between them. */\nfunction applyMarker(el: HTMLTextAreaElement, marker: string, value: string, onChange: (v: string) => void) {\n const start = el.selectionStart ?? value.length;\n const end = el.selectionEnd ?? value.length;\n if (start === end) {\n onChange(value.slice(0, start) + marker + marker + value.slice(end));\n requestAnimationFrame(() => {\n el.focus();\n el.setSelectionRange(start + marker.length, start + marker.length);\n });\n return;\n }\n const selected = value.slice(start, end);\n const alreadyWrapped = selected.length > marker.length * 2 && selected.startsWith(marker) && selected.endsWith(marker);\n const replacement = alreadyWrapped ? selected.slice(marker.length, selected.length - marker.length) : `${marker}${selected}${marker}`;\n onChange(value.slice(0, start) + replacement + value.slice(end));\n}\n\nexport interface StoryTextFieldProps {\n label: string;\n value: string;\n onChange: (value: string) => void;\n boldLabel?: string;\n italicLabel?: string;\n minRows?: number;\n}\n\nexport function StoryTextField({ label, value, onChange, boldLabel = \"Bold\", italicLabel = \"Italic\", minRows = 3 }: StoryTextFieldProps) {\n const ref = useRef<HTMLTextAreaElement>(null);\n return (\n <Stack gap={4}>\n <Group gap=\"xs\">\n <Text size=\"sm\" fw={500}>{label}</Text>\n <Button\n variant=\"default\" size=\"compact-xs\" fw={700} aria-label={boldLabel} title={boldLabel}\n onClick={() => ref.current && applyMarker(ref.current, \"**\", value, onChange)}\n >\n B\n </Button>\n <Button\n variant=\"default\" size=\"compact-xs\" fs=\"italic\" aria-label={italicLabel} title={italicLabel}\n onClick={() => ref.current && applyMarker(ref.current, \"*\", value, onChange)}\n >\n i\n </Button>\n </Group>\n <Textarea\n ref={ref} aria-label={label} autosize minRows={minRows} maxRows={14} value={value}\n onChange={(e) => onChange(e.currentTarget.value)}\n />\n </Stack>\n );\n}\n", "// The editor's own words. English here; a host with its own translations\n// (Gramps Connect) passes StoryEditor's `strings` instead.\n\nexport interface EditorStrings {\n story: string;\n storySettings: string;\n title: string;\n language: string;\n languageHint: string;\n map: string;\n mapStandard: string;\n mapHistorical: string;\n mapAuto: string;\n mapNone: string;\n slides: string;\n untitledSlide: string;\n addSlide: string;\n duplicateSlide: string;\n deleteSlide: string;\n moveUp: string;\n moveDown: string;\n slideTitle: string;\n text: string;\n bold: string;\n italic: string;\n date: string;\n dateHint: string;\n preciseDate: string;\n preciseDateHint: string;\n preciseDateFollows: string;\n preciseDateNotUnderstood: string;\n matchDateAsWritten: string;\n noPreciseDate: string;\n place: string;\n photos: string;\n undo: string;\n redo: string;\n present: string;\n preview: string;\n problems: (count: number) => string;\n openingSlide: string;\n}\n\nexport const EDITOR_ENGLISH: EditorStrings = {\n story: \"Story\",\n storySettings: \"Title, language and map\",\n title: \"Title\",\n language: \"Language\",\n languageHint: \"The language the story is written in, e.g. en, de or fr-CA. Dates are read in it.\",\n map: \"Map\",\n mapStandard: \"Today's map\",\n mapHistorical: \"Historical maps for each slide's year\",\n mapAuto: \"Viewer's choice\",\n mapNone: \"No map\",\n slides: \"Slides\",\n untitledSlide: \"Untitled slide\",\n addSlide: \"Add slide\",\n duplicateSlide: \"Duplicate\",\n deleteSlide: \"Delete\",\n moveUp: \"Move up\",\n moveDown: \"Move down\",\n slideTitle: \"Title\",\n text: \"Text\",\n bold: \"Bold\",\n italic: \"Italic\",\n date: \"Date\",\n dateHint: \"As readers should see it, e.g. about 1850, 3 May 1850, between 1850 and 1860.\",\n preciseDate: \"Precise date (EDTF)\",\n preciseDateHint: \"Places the slide on the timeline and picks historical maps.\",\n preciseDateFollows: \"Worked out from the date as written.\",\n preciseDateNotUnderstood: \"Not a date the timeline can use.\",\n matchDateAsWritten: \"Work it out from the date\",\n noPreciseDate: \"None: this slide stays off the timeline.\",\n place: \"Place\",\n photos: \"Photos\",\n undo: \"Undo\",\n redo: \"Redo\",\n present: \"Present\",\n preview: \"Preview\",\n problems: (count) => (count === 1 ? \"1 problem to fix before saving\" : `${count} problems to fix before saving`),\n openingSlide: \"Opening slide\",\n};\n"],
5
+ "mappings": ";AAQA,SAAS,aAAa,aAAAA,YAAW,WAAAC,UAAS,YAAAC,iBAAgC;AAC1E;AAAA,EACE;AAAA,EAAY;A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ACjB;AAAA,IACA,gBAAAD,KAAC,SAAM,QAAQ,YAAY,SAAS,MAAM,cAAc,KAAK,GAAG,YAAU,MAAC,iBAAiB,OAAO,SAAS,GAC1G,0BAAAA,KAAC,OAAI,OAAO,EAAE,UAAU,SAAS,OAAO,EAAE,GACxC,0BAAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QAAK;AAAA,QAA4B;AAAA,QAAY,SAAS;AAAA,QAC7D,cAAc,UAAU,QAAQ,IAAI;AAAA,QAAO,SAAS,MAAM,cAAc,KAAK;AAAA;AAAA,IAC/E,GACF,GACF;AAAA,KACF;AAEJ;",
6
+ "names": ["useEffect", "useMemo", "useState", "Button", "Group", "Stack", "Text", "TextInput", "UnstyledButton", "validate", "usedMedia", "useEffect", "useRef", "useState", "jsx", "useEffect", "useRef", "useState", "jsx", "jsxs", "useRef", "useState", "useEffect", "jsx", "jsxs", "useState", "useEffect", "useRef", "useEffect", "useRef", "useState", "jsx", "jsxs", "useState", "useRef", "useEffect", "edtf", "useState", "Stack", "jsx", "useRef", "Group", "Stack", "Text", "jsx", "jsxs", "jsx", "jsxs", "BAR_HEIGHT", "useState", "useEffect", "useMemo", "validate", "Group", "Button", "Stack", "Text", "TextInput", "UnstyledButton"]
7
+ }