@manifest-editor/creators 2.2.2-next.0.903673e → 2.2.2-next.0.92cba17
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.
- package/dist/iiif-browser-form.lazy-5m6mTOpt.cjs +2 -0
- package/dist/iiif-browser-form.lazy-5m6mTOpt.cjs.map +1 -0
- package/dist/iiif-browser-form.lazy-B3L53hOy.js +2 -0
- package/dist/iiif-browser-form.lazy-B3L53hOy.js.map +1 -0
- package/dist/iiif-browser-output-BZhwClM1.cjs +2 -0
- package/dist/iiif-browser-output-BZhwClM1.cjs.map +1 -0
- package/dist/iiif-browser-output-Dgz2XDZo.js +2 -0
- package/dist/iiif-browser-output-Dgz2XDZo.js.map +1 -0
- package/dist/index.cjs +20 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +188 -7
- package/dist/index.d.cts +38 -27
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +39 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -19
- package/dist/index.js.map +1 -1
- package/package.json +17 -13
- package/dist/iiif-browser-form.lazy-Df2fAM6b.cjs +0 -2
- package/dist/iiif-browser-form.lazy-Df2fAM6b.cjs.map +0 -1
- package/dist/iiif-browser-form.lazy-DtTHoW1Q.js +0 -2
- package/dist/iiif-browser-form.lazy-DtTHoW1Q.js.map +0 -1
- package/dist/iiif-browser-output-DSDX-M6m.js +0 -2
- package/dist/iiif-browser-output-DSDX-M6m.js.map +0 -1
- package/dist/iiif-browser-output-IFaBMvwa.cjs +0 -2
- package/dist/iiif-browser-output-IFaBMvwa.cjs.map +0 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["getValue","useState","PaddedSidebarContainer","LanguageFieldEditor","InputContainer","InputLabel","Input","ActionButton","defineCreator","isImageService","isSupportedDigitalCollectionPage","useState","useMediaElements","useMediaState","useMediaActions","formatTime","getValue","useState","PaddedSidebarContainer","ErrorMessage","InputContainer","InputLabel","Input","LanguageFieldEditor","CanvasPanel","FormFieldWrapper","ActionButton","defineCreator","AudioIcon","useAnnotationCreatorState","InputContainer","InputLabel","Input","ActionButton","defineCreator","AddImageIcon","useAnnotationCreatorState","getValue","HTMLEditor","ActionButton","defineCreator","HTMLIcon","isImageService","EditorInstance","centerRectangles","EditorInstance","isImageService","createImageServiceRequest","imageServiceRequestToString","parseImageServiceRequest","canonicalServiceUrl","useState","PaddedSidebarContainer","InputContainer","InputLabel","Input","ErrorBoundary","ActionButton","useImage","creatorHelper","defineCreator","IIIFLogo","isImageService","defineCreator","IIIFLogo","getImageDimensions","getFormat","PaddedSidebarContainer","InputContainer","InputLabel","Input","ActionButton","creatorHelper","defineCreator","AddImageIcon","isImageService","defineCreator","AddImageIcon","creatorHelper","PaddedSidebarContainer","Form","ActionButton","creatorHelper","defineCreator","ImageListIcon","defineCreator","EmptyCanvasIcon","useSimpleMediaPlayer","MediaPlayerProvider","CanvasPanel","getValue","useState","PaddedSidebarContainer","ErrorMessage","InputContainer","InputLabel","Input","LanguageFieldEditor","DimensionsTriplet","ActionButton","defineCreator","VideoIcon","defineCreator","defineCreator","EmptyCanvasIcon","defineCreator","useManifest","useVault","useMemo","VaultProvider","IIIFBrowser","useConfig","useState","PaddedSidebarContainer","HTMLEditor","ActionButton","defineCreator","Vault","browserImageApiSelector","getImageServices","browserTransformDimensions","lazy","isImageService","defineCreator","IIIFBrowserIcon","defineCreator","ImageListIcon","useState","PaddedSidebarContainer","LanguageFieldEditor","InputContainer","InputLabel","Input","ActionButton","defineCreator","createImageServiceRequest","imageServiceRequestToString","getCanonicalUrl","parseImageServiceRequest","canonicalServiceUrl","useState","useMemo","getCanonicalUrl","PaddedSidebarContainer","ActionButton","InputContainer","InputLabel","Input","defineCreator","ScaledImageIcon","useState","PaddedSidebarContainer","LanguageFieldEditor","InputContainer","InputLabel","Input","ActionButton","defineCreator","PaddedSidebarContainer","InputContainer","InputLabel","Input","ActionButton","defineCreator","YouTubeIcon","createThumbnailHelper","lazy","ManifestBrowserCreatorForm","usePreviewVault","useMemo","PreviewVaultBoundary","IIIFBrowser","defineCreator","IIIFBrowserIcon","ManifestBrowserCreatorForm","useState","PaddedSidebarContainer","LanguageFieldEditor","ActionButton","defineCreator","RangesIcon","useState","PaddedSidebarContainer","LanguageFieldEditor","ActionButton","defineCreator","RangesIcon"],"sources":["../src/Agent/ProviderCreator/create-provider.tsx","../src/Agent/ProviderCreator/index.tsx","../src/resource-probes.ts","../../ui/ui/MediaControls/MediaControls.icons.tsx","../../ui/ui/MediaControls/MediaControls.styles.ts","../../ui/madoc/components/icons/Spinner.tsx","../../ui/atoms/VisuallHidden/VisuallHidden.tsx","../../ui/ui/MediaControls/MediaControls.tsx","../src/Annotation/AudioAnnotation/create-audio-annotation.tsx","../src/Annotation/AudioAnnotation/index.tsx","../src/Annotation/CaptionedImageAnnotation/create-captioned-image-annotation.tsx","../src/Annotation/CaptionedImageAnnotation/index.tsx","../src/Annotation/HTMLAnnotation/create-html-annotation.tsx","../src/Annotation/HTMLAnnotation/index.tsx","../src/side-effects/reposition-multiple-images.ts","../src/side-effects/resize-resource-to-empty-canvas.ts","../../../node_modules/.pnpm/@atlas-viewer+iiif-image-api@2.2.0/node_modules/@atlas-viewer/iiif-image-api/dist/index.js","../src/side-effects/resize-to-fit-service.ts","../src/ContentResource/image-service-options.ts","../src/ContentResource/ImageServiceCreator/create-image-service.tsx","../src/Annotation/ImageServiceAnnotation/create-service-annotation.tsx","../src/ContentResource/ImageServiceCreator/index.tsx","../src/Annotation/ImageServiceAnnotation/index.tsx","../src/ContentResource/ImageUrlCreator/create-image-url.tsx","../src/Annotation/ImageUrlAnnotation/create-image-url-annotation.tsx","../src/ContentResource/ImageUrlCreator/index.tsx","../src/Annotation/ImageUrlAnnotation/index.tsx","../src/ContentResource/ImageUrlListCreator/create-image-url-list.tsx","../src/Annotation/ImageUrlListAnnotation/create-image-url-list-annotation.tsx","../src/Annotation/ImageUrlListAnnotation/index.tsx","../src/Annotation/NoBodyAnnotation/index.tsx","../../ui/ui/VideoPlayer/VideoPlayer.tsx","../src/Annotation/VideoAnnotation/create-video-annotation.tsx","../src/Annotation/VideoAnnotation/index.tsx","../../ui/icons/ThumbnailStripIcon.tsx","../src/AnnotationPage/EmptyAnnotationPage/index.tsx","../src/Canvas/EmptyCanvas/index.tsx","../../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../src/Canvas/InternalCanvas/index.tsx","../../ui/icons/TextFormatIcon.tsx","../src/ContentResource/HTMLBodyCreator/create-html-body.tsx","../src/ContentResource/HTMLBodyCreator/index.tsx","../src/ContentResource/IIIFBrowserCreator/iiif-browser-creator.tsx","../src/side-effects/update-canvas-thumbnail-from-crop.ts","../src/ContentResource/IIIFBrowserCreator/index.tsx","../src/ContentResource/ImageUrlListCreator/index.tsx","../src/ContentResource/PlaintextCreator/create-plaintext.tsx","../src/ContentResource/PlaintextCreator/index.tsx","../src/ContentResource/ThumbnailCreator/thumbnail-helpers.ts","../src/ContentResource/ThumbnailCreator/create-thumbnail.tsx","../src/ContentResource/ThumbnailCreator/index.tsx","../../ui/icons/LinkIcon.tsx","../src/ContentResource/WebPageCreator/create-web-page.tsx","../src/ContentResource/WebPageCreator/index.tsx","../src/ContentResource/YouTubeCreator/create-youtube-body.tsx","../src/ContentResource/YouTubeCreator/index.tsx","../src/Manifest/ManifestBrowserCreator/manifest-browser-creator.tsx","../src/Manifest/ManifestBrowserCreator/manifest-browser-form.lazy.tsx","../src/Manifest/ManifestBrowserCreator/index.tsx","../src/Range/RangeWithItems/create-range-with-items.tsx","../src/Range/RangeWithItems/index.tsx","../src/Range/TopLevelRangeCreator/create-range-top-level.tsx","../src/Range/TopLevelRangeCreator/index.tsx","../src/index.ts"],"sourcesContent":["import { getValue } from \"@iiif/helpers\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { useState } from \"react\";\n\nexport interface CreateProviderPayload {\n url: string;\n label: InternationalString;\n homepage?: string;\n homepageLabel?: InternationalString;\n logo?: string;\n}\n\nexport async function createProvider(data: CreateProviderPayload, ctx: CreatorFunctionContext) {\n const provider = {\n id: data.url || ctx.generateId(\"provider\"),\n label: data.label,\n type: \"Agent\",\n homepage: [] as any[],\n logo: [] as any[],\n };\n\n if (data.homepage) {\n provider.homepage = [\n ctx.embed({\n id: data.url,\n label: getValue(data.homepageLabel) ? data.homepageLabel : { en: [\"Homepage\"] },\n type: \"Text\",\n format: \"text/html\",\n language: [\"en\"],\n }),\n ];\n }\n\n if (data.logo) {\n provider.logo = [\n ctx.embed({\n id: data.logo,\n type: \"Image\",\n }),\n ];\n }\n\n return ctx.embed(provider);\n}\n\nexport function CreateProviderForm(props: CreatorContext<CreateProviderPayload>) {\n const initialData = props.options.initialData as Partial<CreateProviderPayload>;\n const [url, setUrl] = useState(initialData.url || \"\");\n const [label, setLabel] = useState(initialData.label || ({ en: [\"\"] } as InternationalString));\n const [homepage, setHomepage] = useState(initialData.homepage || \"\");\n const [logo, setLogo] = useState(initialData.logo || \"\");\n const [homepageLabel, setHomepageLabel] = useState(\n initialData.homepageLabel || ({ en: [\"\"] } as InternationalString),\n );\n\n const onSubmit = () => {\n props.runCreate({\n url,\n label,\n homepage,\n homepageLabel,\n logo,\n });\n };\n\n return (\n <PaddedSidebarContainer>\n <div className=\"max-w-xl\">\n <LanguageFieldEditor\n containerId={\"label\"}\n focusId={\"label_\"}\n label={\"Label\"}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <InputContainer $fluid>\n <InputLabel htmlFor=\"provider-logo\">Logo</InputLabel>\n <Input\n placeholder=\"https://example.org/logo.png\"\n type=\"text\"\n id=\"provider-logo\"\n value={logo}\n onChange={(e) => setLogo(e.target.value)}\n />\n </InputContainer>\n\n <InputContainer $fluid>\n <InputLabel htmlFor=\"provider-homepage\">Homepage</InputLabel>\n <Input\n placeholder=\"https://example.org/homepage\"\n type=\"text\"\n id=\"provider-homepage\"\n value={homepage}\n onChange={(e) => setHomepage(e.target.value)}\n />\n </InputContainer>\n\n {homepage ? (\n <div>\n <LanguageFieldEditor\n containerId={\"homepageLabel\"}\n focusId={\"homepageLabel_\"}\n label={\"Homepage label\"}\n fields={homepageLabel}\n onSave={(e: any) => setHomepageLabel(e.toInternationalString())}\n />\n </div>\n ) : null}\n\n <InputContainer $fluid>\n <InputLabel $margin={false} htmlFor=\"provider-url\">\n Provider ID\n </InputLabel>\n <span className=\"text-gray-500 text-sm mb-2\">\n Will be generated if not specified, this is not a URL that the user can follow\n </span>\n <Input\n placeholder=\"https://id.loc.gov/authorities/abc123\"\n type=\"text\"\n id=\"provider-url\"\n value={url}\n onChange={(e) => setUrl(e.target.value)}\n />\n </InputContainer>\n\n <ActionButton primary large type=\"button\" onPress={onSubmit}>\n Add provider\n </ActionButton>\n </div>\n </PaddedSidebarContainer>\n );\n}\n","import { defineCreator } from \"@manifest-editor/creator-api\";\nimport { CreateProviderForm, createProvider } from \"./create-provider\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/provider\": typeof createProvider;\n }\n }\n}\n\nexport const providerCreator = defineCreator({\n id: \"@manifest-editor/provider\",\n label: \"Provider\",\n summary: \"Create a new provider\",\n resourceType: \"Agent\",\n resourceFields: [\"id\", \"type\", \"label\"],\n supports: {\n parentTypes: [\"Manifest\", \"Collection\"],\n parentFields: [\"provider\"],\n initialData: true,\n },\n create: createProvider,\n render(ctx) {\n return <CreateProviderForm {...ctx} />;\n },\n});\n","import type { CreatorResourceProbeHelpers } from \"@manifest-editor/creator-api\";\nimport { isSupportedDigitalCollectionPage } from \"iiif-browser/digital-collections\";\n\nexport function isHttpUrl(value: string) {\n try {\n const url = new URL(value);\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n } catch {\n return false;\n }\n}\n\nexport async function getJsonResource(value: string, helpers: CreatorResourceProbeHelpers) {\n if (!isHttpUrl(value)) return null;\n try {\n return await helpers.json(value);\n } catch {\n return null;\n }\n}\n\nexport function getIIIFType(resource: any) {\n const type = resource?.type || resource?.[\"@type\"];\n if (type === \"sc:Manifest\") return \"Manifest\";\n if (type === \"sc:Collection\") return \"Collection\";\n return type;\n}\n\nexport function isImageService(resource: any) {\n const type = getIIIFType(resource);\n return (\n resource?.protocol === \"http://iiif.io/api/image\" ||\n type === \"ImageService\" ||\n (typeof type === \"string\" && type.startsWith(\"ImageService\"))\n );\n}\n\nexport async function isDigitalCollectionPage(value: string) {\n return isHttpUrl(value) && (await isSupportedDigitalCollectionPage(value));\n}\n\nexport async function getContentType(value: string, helpers: CreatorResourceProbeHelpers) {\n try {\n return await helpers.contentType(value);\n } catch {\n return \"\";\n }\n}\n\nexport function matchesExtension(value: string, extensions: string[]) {\n const pathname = new URL(value).pathname.toLowerCase();\n return extensions.some((extension) => pathname.endsWith(extension));\n}\n","import { SVGProps } from \"react\";\n\nexport const PlayIcon = (props: SVGProps<SVGSVGElement> & { title: string }) => (\n <svg {...props} viewBox=\"4 4 16 16\" xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\">\n {props.title ? <title>{props.title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M8 5v14l11-7z\" fill=\"currentColor\" />\n </svg>\n);\n\nexport const PauseIcon = (props: SVGProps<SVGSVGElement> & { title?: string }) => (\n <svg {...props} viewBox=\"4 4 16 16\" xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\">\n {props.title ? <title>{props.title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path fill=\"currentColor\" d=\"M6 19h4V5H6v14zm8-14v14h4V5h-4z\" />\n </svg>\n);\n\nexport const VolumeUpIcon = ({ title, ...props }: SVGProps<SVGSVGElement> & { title?: string }) => (\n <svg {...props} xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\" viewBox=\"2 2 20 20\">\n {title ? <title>{title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n fill=\"currentColor\"\n d=\"M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z\"\n />\n </svg>\n);\n\nexport const VolumeDownIcon = ({ title, ...props }: SVGProps<SVGSVGElement> & { title?: string }) => (\n <svg {...props} xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\" viewBox=\"2 2 20 20\">\n {title ? <title>{title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n fill=\"currentColor\"\n d=\"M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z\"\n />\n </svg>\n);\n\nexport const VolumeOffIcon = ({ title, ...props }: SVGProps<SVGSVGElement> & { title?: string }) => (\n <svg {...props} xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\" viewBox=\"2 2 20 20\">\n {title ? <title>{title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n fill=\"currentColor\"\n d=\"M16.5 12A4.5 4.5 0 0 0 14 7.97v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51A8.796 8.796 0 0 0 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06a8.99 8.99 0 0 0 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4 9.91 6.09 12 8.18V4z\"\n />\n </svg>\n);\n","import styled, { css } from \"styled-components\";\n\nexport const AudioPlayerContainer = styled.div`\n background: #ededed; // Not in variable.\n display: flex;\n padding: 0.5em;\n align-items: center;\n`;\n\nconst BaseButton = styled.button`\n cursor: pointer;\n padding: 0.75em 1.5em;\n font-size: 0.938em;\n background: none;\n color: inherit;\n border: none;\n text-decoration: none;\n display: inline-block;\n vertical-align: top;\n white-space: nowrap;\n`;\n\nexport const PlayButton = styled(BaseButton)`\n width: 2em;\n height: 2em;\n overflow: hidden;\n font-size: 1.1em;\n background: #fff;\n border-radius: 3px;\n padding: 0;\n margin: 0;\n color: #000; // Not in colours\n\n &:disabled {\n color: #999;\n }\n`;\n\nexport const TimeDisplay = styled.div`\n margin: 0 1em;\n font-size: 0.85em;\n color: #000;\n`;\n\nexport const ProgressContainer = styled.div`\n flex: 1 1 0px;\n height: 6px;\n display: flex;\n position: relative;\n padding: 15px 0;\n`;\n\nexport const ProgressCurrent = styled.div`\n background: #d85680;\n height: 6px;\n pointer-events: none;\n position: absolute;\n top: 13px;\n left: 0;\n border-radius: 3px;\n transition: width 200ms;\n`;\n\nexport const ProgressBackground = styled.div`\n position: absolute;\n top: 13px;\n left: 0;\n height: 6px;\n border-radius: 3px;\n width: 100%;\n pointer-events: none;\n background: #fff;\n`;\n\nexport const SoundButton = styled(BaseButton)`\n width: 2em;\n height: 2em;\n overflow: hidden;\n font-size: 1.1em;\n background: transparent;\n border-radius: 3px;\n padding: 0;\n margin: 0;\n`;\n\nexport const SoundContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const VolumeContainer = styled.div<{ $isOpen: boolean }>`\n width: 0;\n overflow: hidden;\n transition: width 500ms;\n color: #4a473f; // Not in colours\n\n ${(props) =>\n props.$isOpen &&\n css`\n width: 150px;\n `}\n`;\n\nexport const VolumeSlider = styled.input.attrs({ type: \"range\" })`\n width: 120px;\n margin: 0 15px;\n`;\n","import type * as React from \"react\";\n\nexport function Spinner(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 42 42\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n {...props}\n >\n <g transform=\"translate(2 2)\" strokeWidth={5} fill=\"none\" fillRule=\"evenodd\">\n <circle strokeOpacity={0.5} cx={18} cy={18} r={18} />\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 18 18\"\n to=\"360 18 18\"\n dur=\"1s\"\n repeatCount=\"indefinite\"\n />\n </path>\n </g>\n </svg>\n );\n}\n","import styled, { css } from \"styled-components\";\n\nexport const visuallyHidden = css`\n clip: rect(1px, 1px, 1px, 1px);\n clip-path: inset(50%);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n`;\n\nexport const VisuallyHiddenLabel = styled.label`\n ${visuallyHidden}\n`;\n","import { formatTime, useMediaActions, useMediaElements, useMediaState } from \"react-iiif-vault\";\nimport { useEffect, useLayoutEffect, useState } from \"react\";\nimport { PauseIcon, PlayIcon, VolumeDownIcon, VolumeOffIcon, VolumeUpIcon } from \"./MediaControls.icons\";\nimport {\n AudioPlayerContainer,\n PlayButton,\n ProgressBackground,\n ProgressContainer,\n TimeDisplay,\n ProgressCurrent,\n SoundContainer,\n VolumeContainer,\n SoundButton,\n VolumeSlider,\n} from \"./MediaControls.styles\";\nimport { Spinner } from \"../../madoc/components/icons/Spinner\";\nimport { VisuallyHiddenLabel } from \"../../atoms/VisuallHidden/VisuallHidden\";\n\nexport function MediaControls(props: {\n onDimensions?: (width: number, height: number) => void;\n onError?: (error: string) => void;\n onDuration?: (duration: number) => void;\n}) {\n const [isVolumeOpen, setIsVolumeOpen] = useState(false);\n const { progress, currentTime, element } = useMediaElements();\n const { duration, isMuted, volume, isPlaying, playRequested } = useMediaState();\n const { setVolume, toggleMute, play, pause, setDurationPercent } = useMediaActions();\n\n // Volume Icon to use.\n const Volume = isMuted || volume === 0 ? VolumeOffIcon : volume > 50 ? VolumeUpIcon : VolumeDownIcon;\n\n useLayoutEffect(() => {\n if (element.current) {\n const $el = element.current;\n if ($el.error && props.onError) {\n props.onError($el.error?.message || \"Unknown error\");\n return;\n }\n const onError = () => {\n if (props.onError) {\n props.onError($el.error?.message || \"Unknown error\");\n }\n };\n const loadedMetadata = () => {\n if ($el.duration && props.onDuration) {\n props.onDuration($el.duration);\n }\n if (props.onDimensions && $el instanceof HTMLVideoElement) {\n props.onDimensions($el.videoWidth, $el.videoHeight);\n }\n };\n $el.addEventListener(\"loadedmetadata\", loadedMetadata);\n $el.addEventListener(\"error\", onError);\n return () => {\n $el.removeEventListener(\"loadedmetadata\", loadedMetadata);\n $el.removeEventListener(\"error\", onError);\n };\n }\n }, []);\n\n return (\n <AudioPlayerContainer>\n <PlayButton\n disabled={playRequested}\n onClick={() => {\n if (isPlaying) {\n pause();\n } else {\n play();\n }\n }}\n >\n {playRequested ? (\n <Spinner stroke=\"#999\" />\n ) : isPlaying ? (\n <PauseIcon title={\"Pause\"} />\n ) : (\n <PlayIcon title={\"Play\"} />\n )}\n </PlayButton>\n <TimeDisplay ref={currentTime}>0:00</TimeDisplay>\n <ProgressContainer\n onClick={(e) => {\n const { left, width } = e.currentTarget.getBoundingClientRect();\n const percent = (e.pageX - left) / width;\n setDurationPercent(percent);\n }}\n >\n <ProgressBackground />\n {duration ? <ProgressCurrent ref={progress} /> : null}\n </ProgressContainer>\n <TimeDisplay>{formatTime(duration)}</TimeDisplay>\n <SoundContainer onMouseEnter={() => setIsVolumeOpen(true)} onMouseLeave={() => setIsVolumeOpen(false)}>\n <VolumeContainer $isOpen={isVolumeOpen}>\n <span>\n <VisuallyHiddenLabel htmlFor=\"audio-slider\">{\"Change volume\"}</VisuallyHiddenLabel>\n <VolumeSlider\n id=\"audio-slider\"\n role=\"slider\"\n disabled={isMuted}\n min=\"0\"\n max=\"100\"\n value={volume}\n onChange={(e) => setVolume(Number(e.currentTarget.value))}\n />\n </span>\n </VolumeContainer>\n <SoundButton onClick={() => toggleMute()}>\n <Volume title={isMuted ? \"Mute\" : \"Unmute\"} />\n </SoundButton>\n </SoundContainer>\n </AudioPlayerContainer>\n );\n}\n","import { getValue } from \"@iiif/helpers\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, ErrorMessage, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { FormFieldWrapper, Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { MediaControls } from \"@manifest-editor/ui/MediaControls\";\nimport { useEffect, useState } from \"react\";\nimport { CanvasPanel } from \"react-iiif-vault\";\n\nexport interface CreateAudioAnnotationPayload {\n label?: InternationalString;\n motivation?: string;\n duration?: number;\n url: string;\n}\n\nexport async function createAudioAnnotation(data: CreateAudioAnnotationPayload, ctx: CreatorFunctionContext) {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const body = ctx.embed({\n id: data.url,\n type: \"Sound\",\n format: \"audio/mp4\",\n duration: data.duration || 0,\n });\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n label: getValue(data.label) && data.label,\n motivation: data.motivation || ctx.options.initialData?.motivation || \"painting\",\n body,\n target: ctx.getTarget(),\n });\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body,\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled HTML canvas\"] },\n duration: data.duration || 0,\n items: [page],\n });\n }\n}\n\nexport function CreateAudioAnnotationForm(props: CreatorContext<CreateAudioAnnotationPayload>) {\n const initialData = props.options.initialData as Partial<CreateAudioAnnotationPayload>;\n const [url, setUrl] = useState(initialData.url || \"\");\n const [duration, setDuration] = useState(0);\n const [error, setError] = useState(\"\");\n const [label, setLabel] = useState({ en: [\"\"] } as InternationalString);\n\n const onSubmit = () => {\n props.runCreate({\n url,\n duration,\n label,\n });\n };\n\n useEffect(() => {\n setError(\"\");\n setDuration(0);\n if (url) {\n // Find label from url.\n const labelFromUrl = url.split(\"/\").pop()?.split(\".\").shift();\n setLabel({ en: [labelFromUrl || \"\"] } as InternationalString);\n }\n }, [url]);\n\n return (\n <PaddedSidebarContainer>\n {error ? <ErrorMessage>{error}</ErrorMessage> : null}\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"audio-url\">URL</InputLabel>\n <Input type=\"text\" id=\"audio-url\" value={url} onChange={(e) => setUrl(e.target.value)} />\n </InputContainer>\n\n {url && !error ? (\n <div>\n <LanguageFieldEditor\n key={`${url}__${duration}`}\n containerId={\"label\"}\n focusId={\"label_\"}\n label={\"Label\"}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n </div>\n ) : null}\n\n {url && !error ? (\n <CanvasPanel.AudioHTML key={`${url}__${duration}`} media={{ url, duration, type: \"Sound\" } as any}>\n <MediaControls\n key={`${url}__${duration}`}\n onError={(error) => setError(error)}\n onDuration={(duration) => setDuration(~~duration)}\n />\n </CanvasPanel.AudioHTML>\n ) : null}\n\n {duration && !error ? (\n <FormFieldWrapper>\n <InputLabel htmlFor=\"duration\">Duration</InputLabel>\n <Input type=\"number\" id=\"duration\" value={duration} onChange={(e) => setDuration(e.target.valueAsNumber)} />\n </FormFieldWrapper>\n ) : null}\n\n <ActionButton primary large type=\"button\" onPress={onSubmit} isDisabled={!url || !!error}>\n Add audio\n </ActionButton>\n </PaddedSidebarContainer>\n );\n}\n","import { AudioIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getContentType, isHttpUrl, matchesExtension } from \"../../resource-probes\";\nimport {\n CreateAudioAnnotationForm,\n createAudioAnnotation,\n} from \"./create-audio-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/audio-annotation\": typeof audioAnnotation;\n }\n }\n}\n\nexport const audioAnnotation = defineCreator({\n id: \"@manifest-editor/audio-annotation\",\n create: createAudioAnnotation,\n label: \"Audio\",\n summary: \"Audio annotation\",\n icon: <AudioIcon />,\n render(ctx) {\n return <CreateAudioAnnotationForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const contentType = await getContentType(value, helpers);\n if (contentType.startsWith(\"audio/\") || matchesExtension(value, [\".mp3\", \".m4a\", \".wav\", \".ogg\"])) {\n return { initialData: { url: value } };\n }\n return false;\n },\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, HTMLEditor, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { useAnnotationCreatorState } from \"@manifest-editor/shell\";\nimport { type FormEvent, useState } from \"react\";\n\nexport interface CreateCaptionedImageAnnotationPayload {\n label?: InternationalString;\n body: InternationalString;\n imageUrl: string;\n motivation?: string;\n height?: number;\n width?: number;\n}\n\nexport async function createCaptionedImageAnnotation(\n data: CreateCaptionedImageAnnotationPayload,\n ctx: CreatorFunctionContext,\n) {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const languages = Object.keys(data.body);\n const bodies = [];\n for (const language of languages) {\n const body = (data.body as any)[language].join(\"\\n\");\n if (body) {\n bodies.push(\n await ctx.create(\n \"@manifest-editor/html-body-creator\",\n {\n language,\n body,\n },\n { parent: { resource: annotation, property: \"items\" } },\n ),\n );\n }\n }\n\n const resource = await ctx.create(\n \"@manifest-editor/image-url-creator\",\n { url: data.imageUrl },\n {\n parent: { resource: annotation, property: \"body\" },\n },\n );\n\n if (resource) {\n bodies.push(resource);\n }\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n motivation: data.motivation || ctx.options.initialData?.motivation || \"painting\",\n body: bodies,\n target: ctx.getTarget(),\n });\n }\n\n // @todo this might not make sense to be a canvas.\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body: bodies,\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled HTML canvas\"] },\n height: data.height || 1000,\n width: data.width || 1000,\n items: [page],\n });\n }\n}\n\nexport function CreateCaptionedImageAnnotation(props: CreatorContext<CreateCaptionedImageAnnotationPayload>) {\n const [body, setBody] = useAnnotationCreatorState<InternationalString>({\n key: \"bodyValue\",\n initialValue: { en: [\"\"] },\n requestId: props.options.initialData?.requestId,\n });\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n props.runCreate({\n body: { en: [formData.caption] },\n imageUrl: formData.url,\n });\n };\n\n return (\n <form onSubmit={onSubmit}>\n <>\n <InputContainer $wide>\n <InputLabel htmlFor=\"url\">URL to Image</InputLabel>\n <Input id=\"url\" name=\"url\" defaultValue=\"\" placeholder=\"https://example.org/image.jpg\" />\n </InputContainer>\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"caption\">Caption</InputLabel>\n <Input\n id=\"caption\"\n name=\"caption\"\n placeholder=\"Enter a caption\"\n onChange={(e: any) => setBody({ en: [e.target.value] })}\n value={body.en?.[0] || \"\"}\n />\n </InputContainer>\n\n <ActionButton primary type=\"submit\">\n Create\n </ActionButton>\n </>\n </form>\n );\n}\n","import { AddImageIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport {\n CreateCaptionedImageAnnotation,\n createCaptionedImageAnnotation,\n} from \"./create-captioned-image-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/captioned-image-annotation\": typeof captionedImageAnnotation;\n }\n }\n}\n\nexport const captionedImageAnnotation = defineCreator({\n id: \"@manifest-editor/captioned-image-annotation\",\n create: createCaptionedImageAnnotation,\n label: \"Captioned image\",\n summary: \"Add an image from a URL with caption\",\n icon: <AddImageIcon />,\n render(ctx) {\n return <CreateCaptionedImageAnnotation {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supports: {\n initialData: true,\n disallowPainting: true,\n parentTypes: [\"AnnotationPage\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import { getValue } from \"@iiif/helpers\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, HTMLEditor, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { useAnnotationCreatorState } from \"@manifest-editor/shell\";\nimport { useState } from \"react\";\nimport { useCurrentAnnotationMetadata } from \"react-iiif-vault\";\n\nexport interface CreateHTMLAnnotationPayload {\n label?: InternationalString;\n body: InternationalString;\n motivation?: string;\n height?: number;\n width?: number;\n}\n\nexport async function createHtmlAnnotation(data: CreateHTMLAnnotationPayload, ctx: CreatorFunctionContext) {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const languages = Object.keys(data.body);\n const bodies = [];\n for (const language of languages) {\n const body = (data.body as any)[language].join(\"\\n\");\n if (body) {\n bodies.push(\n await ctx.create(\n \"@manifest-editor/html-body-creator\",\n {\n language,\n body,\n },\n { parent: { resource: annotation, property: \"items\" } },\n ),\n );\n }\n }\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n motivation: data.motivation || ctx.options.initialData?.motivation || \"painting\",\n body: bodies,\n target: ctx.getTarget(),\n });\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body: bodies,\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled HTML canvas\"] },\n height: data.height || 1000,\n width: data.width || 1000,\n items: [page],\n });\n }\n}\n\nexport function CreateHTMLAnnotation(props: CreatorContext<CreateHTMLAnnotationPayload>) {\n const [body, setBody] = useAnnotationCreatorState<InternationalString>({\n key: \"bodyValue\",\n initialValue: { en: [\"\"] },\n requestId: props.options.initialData?.requestId,\n });\n\n const isEmpty = getValue(body).trim() === \"\";\n\n const onSubmit = () => {\n props.runCreate({\n body,\n });\n };\n\n return (\n <>\n <HTMLEditor\n className=\"border-none\"\n value={body.en?.[0] || \"\"}\n onChange={(newValue) => setBody({ en: [newValue] })}\n />\n\n <ActionButton primary type=\"button\" onPress={onSubmit} isDisabled={isEmpty}>\n Create\n </ActionButton>\n </>\n );\n}\n","import { HTMLIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { CreateHTMLAnnotation, createHtmlAnnotation } from \"./create-html-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/html-annotation\": typeof htmlAnnotation;\n }\n }\n}\n\nexport const htmlAnnotation = defineCreator({\n id: \"@manifest-editor/html-annotation\",\n create: createHtmlAnnotation,\n label: \"HTML\",\n summary: \"HTML annotation\",\n icon: <HTMLIcon />,\n render(ctx) {\n return <CreateHTMLAnnotation {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supports: {\n initialData: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import { isImageService } from \"@iiif/parser/image-3\";\nimport type { ImageService, SpecificResource } from \"@iiif/presentation-3\";\nimport type { CreatorSideEffect } from \"@manifest-editor/creator-api\";\nimport { EditorInstance } from \"@manifest-editor/editor-api\";\nimport { centerRectangles } from \"@manifest-editor/editors\";\n\nexport const repositionMultipleImages: CreatorSideEffect = {\n canvasInteraction: true,\n spatial: true,\n async run(result, { vault, options }) {\n if (\n result &&\n result.type === \"Annotation\" &&\n options.targetType === \"Annotation\"\n ) {\n const fullAnno = vault.get<any>(result);\n\n const target = fullAnno.target as SpecificResource;\n if (!(target && target.source?.type === \"Canvas\")) {\n return;\n }\n\n const canvasRef = target.source;\n const canvas = vault.get(canvasRef);\n if (!canvas.items) {\n return;\n }\n\n const annoPage = vault.get(canvas.items[0]);\n if (!annoPage) {\n return;\n }\n\n if (\n annoPage.items.length < 2 &&\n !canvas.behavior.includes(\"multi-image\")\n ) {\n return;\n }\n\n const bodies = vault.get(fullAnno.body);\n const body = bodies[0];\n const selector = fullAnno.body[0]?.selector;\n\n const serviceList = body.service || [];\n const imageService = serviceList.find((s: any) => isImageService(s)) as\n | ImageService\n | undefined;\n if (imageService) {\n if (imageService.width && imageService.height) {\n if (imageService.width !== body.width) {\n vault.modifyEntityField(\n { id: body.id, type: \"ContentResource\" },\n \"width\",\n imageService.width,\n );\n }\n if (imageService.height !== body.height) {\n vault.modifyEntityField(\n { id: body.id, type: \"ContentResource\" },\n \"height\",\n imageService.height,\n );\n }\n }\n }\n\n let width = imageService?.width || body.width;\n let height = imageService?.height || body.height;\n\n if (selector) {\n if (\n (selector.type === \"iiif:ImageApiSelector\" ||\n selector.type === \"ImageApiSelector\") &&\n selector.region\n ) {\n const [x, y, width_, height_] = selector.region.split(\",\");\n\n width = Number(width_) || width;\n height = Number(height_) || height;\n }\n }\n\n const editor = new EditorInstance({ vault, reference: result });\n\n const imagePosition = centerRectangles(\n canvas,\n {\n width: width,\n height: height,\n },\n 0.6,\n );\n\n editor.annotation.target.setPosition(imagePosition);\n }\n },\n};\n","import type { SpecificResource } from \"@iiif/presentation-3\";\nimport type { CanvasNormalized } from \"@iiif/presentation-3-normalized\";\nimport type { CreatorSideEffect } from \"@manifest-editor/creator-api\";\nimport { EditorInstance } from \"@manifest-editor/editor-api\";\n\nexport const resizeResourceToEmptyCanvas: CreatorSideEffect = {\n canvasInteraction: true,\n spatial: true,\n async run(result, { vault, options }) {\n if (\n result &&\n result.type === \"Annotation\" &&\n options.targetType === \"Annotation\"\n ) {\n const fullAnno = vault.get<any>(result);\n\n const target = fullAnno.target as SpecificResource;\n if (!(target && target.source?.type === \"Canvas\")) {\n return;\n }\n\n const canvasRef = target.source;\n const canvas = vault.get<CanvasNormalized>(canvasRef);\n if (!canvas.items) {\n return;\n }\n\n if (canvas.behavior.includes(\"multi-image\")) {\n return;\n }\n // This is what broke the aspect ratio work.\n // if (canvas.behavior.length) {\n // // Ignore custom canvas behaviours.\n // return;\n // }\n\n const annoPage = vault.get(canvas.items[0]!);\n if (!annoPage) {\n return;\n }\n\n if (annoPage.items.length > 1) {\n return;\n }\n\n const bodies = vault.get(fullAnno.body);\n if (bodies.length !== 1) {\n return;\n }\n\n const body = bodies[0];\n const selector = fullAnno.body[0]?.selector;\n\n const service = (body.service || [])[0];\n\n let width = service?.width || body.width;\n let height = service?.height || body.height;\n const duration = body.duration || service?.duration;\n\n if (selector) {\n if (\n (selector.type === \"iiif:ImageApiSelector\" ||\n selector.type === \"ImageApiSelector\") &&\n selector.region\n ) {\n const [x, y, width_, height_] = selector.region.split(\",\");\n\n width = Number(width_) || width;\n height = Number(height_) || height;\n }\n }\n\n const editor = new EditorInstance({ vault, reference: canvasRef });\n vault.batch(() => {\n if (typeof width !== \"undefined\") {\n editor.technical.width.set(width);\n }\n if (typeof height !== \"undefined\") {\n editor.technical.height.set(height);\n }\n if (typeof duration !== \"undefined\") {\n editor.technical.duration.set(duration);\n }\n });\n }\n },\n};\n","var Re=Object.defineProperty;var Ae=(i,e,t)=>e in i?Re(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var w=(i,e,t)=>(Ae(i,typeof e!=\"symbol\"?e+\"\":e,t),t);function g(i){return i.endsWith(\"info.json\")?i:i.endsWith(\"/\")?`${i}info.json`:`${i}/info.json`}var Ce=\"http://library.stanford.edu/iiif/image-api/compliance.html#level0\",j=\"http://library.stanford.edu/iiif/image-api/compliance.html#level1\",T=\"http://library.stanford.edu/iiif/image-api/compliance.html#level2\",Le=\"http://library.stanford.edu/iiif/image-api/conformance.html#level0\",$=\"http://library.stanford.edu/iiif/image-api/conformance.html#level1\",B=\"http://library.stanford.edu/iiif/image-api/conformance.html#level2\",Oe=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\",N=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1\",k=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2\",Pe=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0\",H=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1\",G=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2\",We=\"http://iiif.io/api/image/1/level0.json\",Me=\"http://iiif.io/api/image/1/profiles/level0.json\",U=\"http://iiif.io/api/image/1/level1.json\",Q=\"http://iiif.io/api/image/1/profiles/level1.json\",V=\"http://iiif.io/api/image/1/level2.json\",D=\"http://iiif.io/api/image/1/profiles/level2.json\",je=\"http://iiif.io/api/image/2/level0.json\",Te=\"http://iiif.io/api/image/2/profiles/level0.json\",J=\"http://iiif.io/api/image/2/level1.json\",Z=\"http://iiif.io/api/image/2/profiles/level1.json\",K=\"http://iiif.io/api/image/2/level2.json\",X=\"http://iiif.io/api/image/2/profiles/level2.json\",$e=\"level0\",Y=\"level1\",q=\"level2\",Be=\"http://iiif.io/api/image/2/level0\",ee=\"http://iiif.io/api/image/2/level1\",ie=\"http://iiif.io/api/image/2/level2\",A=[ie,T,B,k,G,V,D,K,X,q],z=[...A,ee,j,$,N,H,U,Q,J,Z,Y],C=[Be,ee,ie,Ce,j,T,Le,$,B,Oe,N,k,Pe,H,G,We,Me,U,Q,V,D,je,Te,J,Z,K,X,$e,Y,q],He=C,te={extraFormats:[\"jpg\"],extraQualities:[\"default\"],extraFeatures:[\"sizeByWhListed\"]},re={extraFormats:[\"jpg\"],extraQualities:[\"default\"],extraFeatures:[\"baseUriRedirect\",\"cors\",\"jsonldMediaType\",\"regionByPx\",\"regionSquare\",\"sizeByWhListed\",\"sizeByH\",\"sizeByW\",\"sizeByWh\"]},oe={extraFormats:[\"jpg\",\"png\"],extraQualities:[\"default\"],extraFeatures:[\"baseUriRedirect\",\"cors\",\"jsonldMediaType\",\"regionByPct\",\"regionByPx\",\"regionSquare\",\"rotationBy90s\",\"sizeByWhListed\",\"sizeByConfinedWh\",\"sizeByH\",\"sizeByPct\",\"sizeByW\",\"sizeByWh\"]},L=[\"baseUriRedirect\",\"canonicalLinkHeader\",\"cors\",\"jsonldMediaType\",\"mirroring\",\"profileLinkHeader\",\"regionByPct\",\"regionByPx\",\"regionSquare\",\"rotationArbitrary\",\"rotationBy90s\",\"sizeByConfinedWh\",\"sizeByH\",\"sizeByPct\",\"sizeByW\",\"sizeByWh\",\"sizeUpscaling\",\"sizeByWhListed\",\"sizeByDistortedWh\",\"sizeByForcedWh\"];function ae(i){return A.indexOf(i)!==-1?oe:z.indexOf(i)!==-1?re:te}function _(i){let e=i?Array.isArray(i.profile)?i.profile:[i.profile]:[],t={extraQualities:[],extraFormats:[],extraFeatures:[]};for(let r of e)if(typeof r==\"string\"&&(r=ae(r)),!!r){if(r.formats)for(let o of r.formats)t.extraFormats.indexOf(o)===-1&&t.extraFormats.push(o);if(r.qualities)for(let o of r.qualities)t.extraQualities.indexOf(o)===-1&&t.extraQualities.push(o);if(r.supports)for(let o of r.supports)t.extraFeatures.indexOf(o)===-1&&t.extraFeatures.push(o);if(r.maxHeight&&(t.maxHeight=r.maxHeight),r.maxWidth&&(t.maxWidth=r.maxWidth),r.maxArea&&(t.maxArea=r.maxArea),r.extraFormats)for(let o of r.extraFormats)t.extraFormats.indexOf(o)===-1&&t.extraFormats.push(o);if(r.extraQualities)for(let o of r.extraQualities)t.extraQualities.indexOf(o)===-1&&t.extraQualities.push(o);if(r.extraFeatures)for(let o of r.extraFeatures)t.extraFeatures.indexOf(o)===-1&&t.extraFeatures.push(o);r.maxHeight&&(t.maxHeight=r.maxHeight),r.maxWidth&&(t.maxWidth=r.maxWidth),r.maxArea&&(t.maxArea=r.maxArea)}if(i.extraFormats)for(let r of i.extraFormats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(i.extraFeatures)for(let r of i.extraFeatures)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);if(i.extraQualities)for(let r of i.extraQualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);return t}function ne(i){try{if(i===\"full\")return{full:!0};if(i===\"square\")return{square:!0};let e=i.startsWith(\"pct:\"),r=i.substr(e?4:0).split(\",\").map(o=>parseFloat(o));return{x:r[0],y:r[1],w:r[2],h:r[3],percent:e}}catch{throw new Error(\"Expected 'full', 'square' or 'x,y,w,h'. Found \"+i)}}function se(i){let e={upscaled:!1,max:!1,confined:!1};if(i[0]===\"^\"&&(e.upscaled=!0,i=i.slice(1)),i===\"max\"||i===\"full\")return e.max=!0,e.serialiseAsFull=i===\"full\",e;if(i[0]===\"!\"&&(e.confined=!0,i=i.slice(1)),i[0]===\"p\")return e.percentScale=parseFloat(i.slice(4)),e;let t=i.split(\",\").map(r=>r.trim());return t.length&&typeof t[0]<\"u\"&&(t[0]!==\"\"&&(e.width=parseInt(t[0],10)),typeof t[1]<\"u\"&&t[1]!==\"\"?(e.height=parseInt(t[1],10),e.version=2):e.version=3),e}function fe(i){let e={angle:0};if(i[0]===\"!\"&&(e.mirror=!0,i=i.substr(1)),e.angle=parseFloat(i)%360,Number.isNaN(e.angle))throw new Error(`Invalid rotation ${i}`);return e}function me(i,e=\"\"){let t=i.match(/^(([a-zA-Z]+):\\/\\/([^/]+))?((.*)+)/);if(!t)throw new Error(`Invalid or unknown input ${i}`);let r=t[2],o=t[3],a=t[4];if(a[0]===\"/\"&&(a=a.substring(1)),e.length>0){if(e[0]===\"/\"&&(e=e.substring(1)),e!==a.substring(0,e.length))throw new Error(`Path does not start with prefix (path: ${a}, prefix: ${e})`);a=a.substring(e.length)}return{scheme:r,server:o,path:a,prefix:e}}function le(i,e=\"\"){let{path:t,scheme:r,server:o,prefix:a}=me(i,e),n=(t||\"\").split(\"/\").reverse(),[s,f,h,m,...p]=n,x=p.reverse().filter(Boolean).join(\"/\");if(n.length===1||s===\"\")return{type:\"base\",scheme:r,server:o,prefix:a,identifier:x};if(s===\"info.json\"){let[,...c]=n;return{type:\"info\",scheme:r,server:o,prefix:a,identifier:c.reverse().filter(Boolean).join(\"/\")}}let d=(s||\"\").split(\".\");if(typeof d[1]>\"u\"||typeof d[0]>\"u\"||typeof m>\"u\"||typeof h>\"u\"||typeof f>\"u\")throw new Error(\"Invalid image request\");return{type:\"image\",scheme:r,server:o,prefix:a,identifier:x,originalPath:t,region:ne(m),size:se(h),rotation:fe(f),quality:d[0],format:d[1]}}function ce(i){let e=le(g(i.id));if(e.type!==\"info\")throw new Error(\"Invalid service URL\");let t=_(i);return{identifier:e.identifier,originalPath:\"\",server:e.server,prefix:e.prefix,scheme:e.scheme,type:\"image\",quality:t.extraQualities.indexOf(\"default\")===-1?t.extraQualities[0]:\"default\",region:{full:!0},size:{max:!0,upscaled:!1,confined:!1},format:\"jpg\",rotation:{angle:0}}}function he(i,e,t){let r=t.length,o=[];for(let a=0;a<r;a++){let n=t[a];if(n){let s=n.width;o.push(i/s)}}return o}function pe(i,e,t){let r=t.length,o=[];for(let a=0;a<r;a++){let n=t[a];n&&o.push({width:Math.floor(i/n),height:Math.floor(e/n)})}return o}function l(i){if(i[\"@id\"])return i[\"@id\"];if(i.id)return i.id}function u(i){if(!i||!i.profile||!l(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t==\"string\"&&C.indexOf(t)!==-1)return!0;return!1}function ge(i){if(!u(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t==\"string\"){if(z.indexOf(t)!==-1)return!0}else{let r=[...t.supports||[],...t.extraFeatures||[]];if(r.indexOf(\"regionByPx\")!==-1&&(r.indexOf(\"sizeByW\")!==-1||r.indexOf(\"sizeByWh\")!==-1))return!0}return!1}function v(i,e){if(e&&e.profile){let t=e.profile;if(t){let r=Array.isArray(t)?t:[t];return r.includes(`level${i}`)||r.includes(`http://iiif.io/api/image/2/level${i}.json`)||r.includes(`http://iiif.io/api/image/1/level${i}.json`)||r.includes(`http://iiif.io/api/image/1/profiles/level${i}.json`)}}return!1}function I(i){return u(i)?v(0,i)?0:v(1,i)?1:v(2,i)?2:null:null}function y(i){return(i[\"@context\"]?Array.isArray(i[\"@context\"])?i[\"@context\"]:[i[\"@context\"]]:[]).indexOf(\"http://iiif.io/api/image/3/context.json\")!==-1}function ue(i){if(!ge(i))return[];let e=[],t=Array.isArray(i.profile)?i.profile:[i.profile],r=t.length;for(let o=0;o<r;o++){let a=t[o];if(a&&typeof a!=\"string\"&&(a.maxHeight||a.maxWidth))return[{id:l(i),type:\"variable\",minWidth:0,minHeight:0,maxHeight:a.maxHeight||a.maxWidth,maxWidth:a.maxWidth||a.maxHeight,level:I(i),version:i[\"@context\"]===\"http://iiif.io/api/image/3/context.json\"?3:2}]}if(i.tiles){let o=i.tiles.length;for(let a=0;a<o;a++){let n=i.tiles[a];n&&(n.height||n.width)&&e.push({id:l(i),type:\"variable\",minHeight:0,minWidth:0,maxHeight:n.height||n.width,maxWidth:n.width,level:I(i),version:y(i)?3:2})}}return e}function O(i){let e=/^.*\\/(full)\\/(((\\d+),(\\d+)?)|max)\\/(\\d+)\\/default\\.(jpg|png|jpeg)$/,t=i.match(e);if(t&&t[4]&&t[5]){let r=t[1],o=parseInt(t[4],10),a=parseInt(t[5],10),n=t[7];if((r===\"max\"||r===\"full\")&&o&&a&&n)return{type:\"fixed\",id:i,height:a,width:o}}return{type:\"unknown\",id:i}}function de(i){if(i[\"@type\"])return i[\"@type\"];if(i.type)return i.type}function xe(i){if(typeof i==\"string\")return O(i);let e=de(i);if(e!==\"Image\"&&e!==\"sc:Image\")return null;let t=i,r=l(t);return r?r&&t.width&&t.height?{id:r,type:\"fixed\",width:t.width,height:t.height,unsafe:!0}:O(r):null}function Ie(i){return u(i)?(i&&i.sizes?i.sizes:[]).map(e=>({id:l(i),type:\"fixed-service\",height:e.height,width:e.width,level:I(i),version:y(i)?3:2})):[]}function P(i){let e=[],t=i.length;for(let r=0;r<t;r++){let o=i[r];if(!o)continue;let a=Ie(o);a.length&&e.push(...a);let n=ue(o);n.length&&e.push(...n)}return e}function b(i){let e=i.service?Array.isArray(i.service)?i.service:[i.service]:[],t=e.length,r=[];for(let o=0;o<t;o++)u(e[o])&&r.push(e[o]);return r}function Se(i,e=!0,t){let r=[],o=xe(i);if(o===null)return r;let a=i;if(r.push(o),e&&a&&a.width&&a.height){let n=[],s=b(a);for(let f of s){let h={id:l(f),width:a.width,height:a.height};if(t.canLoadSync(h)){let m=t.loadServiceSync(h);m&&(m.height||(m.height=a.height),m.width||(m.width=a.width),n.push(...P([m])))}}if(n.length)return r.push(...n),r}return a.service&&r.push(...P(a.service)),r}function ve({x:i=0,y:e=0,w:t,h:r,full:o,square:a,percent:n}){if(o)return\"full\";if(a)return\"square\";if(typeof t>\"u\"||typeof r>\"u\")throw new Error(\"RegionParameter: invalid region\");let s=`${i},${e},${t},${r}`;return n?`pct:${s}`:s}function ye({max:i,percentScale:e,upscaled:t,confined:r,width:o,height:a,serialiseAsFull:n,version:s}){let f=[];return t&&f.push(\"^\"),i?(f.push(n?\"full\":\"max\"),f.join(\"\")):(r&&f.push(\"!\"),e&&f.push(`pct:${e}`),o&&f.push(`${o}`),f.push(\",\"),a&&s===3&&f.push(`${a}`),f.join(\"\"))}function Fe(i){return`${i.mirror?\"!\":\"\"}${(i.angle||0)%360}`}function we(i,e){let t=i.prefix.startsWith(\"/\")?i.prefix.substr(1):i.prefix,r=`${i.scheme}://${i.server}/${t?`${t}/`:\"\"}${i.identifier}`;if(i.type===\"base\")return r;if(i.type===\"info\")return`${r}/info.json`;let{size:o}=i,{region:a,rotation:n,format:s,quality:f}=i;if(e){let h=e[\"@context\"]?Array.isArray(e[\"@context\"])?e[\"@context\"]:[e[\"@context\"]]:[],m=h.indexOf(\"http://iiif.io/api/image/2/context.json\")!==-1,p=h.indexOf(\"http://iiif.io/api/image/3/context.json\")!==-1;if((o.width===e.width&&!o.height||o.height===e.height&&!o.width||o.width===e.width&&o.height===e.height)&&(o={...o,max:!0}),m&&(o.max&&!o.serialiseAsFull&&(o={...o,serialiseAsFull:!0}),!o.max&&o.width&&o.height&&(o={...o,height:void 0}),o={...o,version:2}),p){if(o.max&&o.serialiseAsFull&&(o={...o,serialiseAsFull:!1}),o.width&&!o.height&&e.width&&e.height){let x=e.height/e.width;o={...o,height:Math.ceil(o.width*x)}}o={...o,version:3}}}return[r,ve(a),ye(o),Fe(n),`${f}.${s}`].filter(Boolean).join(\"/\")}function E(i,e,t){let r=ce({\"@context\":i.version===3?\"http://iiif.io/api/image/3/context.json\":\"http://iiif.io/api/image/2/context.json\",id:g(l(i)),profile:i.level===null||typeof i.level>\"u\"?\"level0\":`level${i.level}`,type:i.version===3?\"ImageService3\":\"ImageService2\"});if(r.type!==\"image\")throw new Error(\"Invalid service\");return r.size.max=!1,r.size.width=e,r.size.height=t,{id:we(r),type:\"fixed\",width:e,height:t||i.height/(i.width||1)*e,unsafe:i.width>e}}function S(i){let e=i.replace(/(https?:\\/\\/)?(www.)?/i,\"\");return e.indexOf(\"/\")!==-1?e.split(\"/\")[0]:e}function ct(i){if(!i.width||!i.height)return null;if(i.tiles){let e=i.tiles.sort((r,o)=>Math.max(...o.scaleFactors)-Math.max(...r.scaleFactors)),t=e.length;for(let r=0;r<t;r++){let o=e[r];if(!o)continue;let a=o.width;if(!a)continue;let n=o.scaleFactors.length,s=o.scaleFactors.sort();for(let f=0;f<n;f++){let h=s[f];if(h&&i.width/h<=a&&i.height/h<=a)return{id:l(i),type:\"fixed-service\",width:i.width/h|0,height:i.height/h|0,level:I(i),version:y(i)?3:2}}}}return null}function R(i,e){if(!u(i))return[!1,\"Not a valid image service\"];e.extraFeatures=e.extraFeatures?e.extraFeatures:[];let t=_(i);if(e.exactSize){let r=!1;if(i.sizes)for(let o of i.sizes)o.width&&o.width===e.exactSize.width&&(L.indexOf(\"sizeByW\")!==-1||o.height&&o.height===e.exactSize.height)&&(r=!0),o.height&&o.height===e.exactSize.height&&(L.indexOf(\"sizeByH\")!==-1||o.width&&o.width===e.exactSize.width)&&(r=!0);r||(e.maxWidth=Math.max(e.maxWidth||0,e.exactSize.width||0)||void 0,e.maxHeight=Math.max(e.maxHeight||0,e.exactSize.height||0)||void 0,e.maxArea=Math.max(e.maxArea||0,(e.exactSize.width&&e.exactSize.height?e.exactSize.width*e.exactSize.height:e.maxArea)||0)||void 0,!e.exactSize.height&&e.exactSize.width?e.extraFeatures.indexOf(\"sizeByW\")===-1&&e.extraFeatures.push(\"sizeByW\"):!e.exactSize.width&&e.exactSize.height&&e.extraFeatures.indexOf(\"sizeByH\")===-1&&e.extraFeatures.push(\"sizeByH\"))}if(e.maxArea&&t.maxArea&&e.maxArea>t.maxArea)return[!1,`Max area is ${t.maxArea}`];if(e.maxWidth&&t.maxWidth&&e.maxWidth>t.maxWidth)return[!1,`Max width is ${t.maxWidth}`];if(e.maxHeight&&t.maxHeight&&e.maxHeight>t.maxHeight)return[!1,`Max height is ${t.maxHeight}`];if(e.extraFeatures){let r=[];for(let o of e.extraFeatures)t.extraFeatures.indexOf(o)===-1&&r.push(o);if(r.length)return[!1,`Missing features: ${r.join(\", \")}`]}if(e.extraFormats){let r=[];for(let o of e.extraFormats)t.extraFormats.indexOf(o)===-1&&r.push(o);if(r.length)return[!1,`Missing formats: ${r.join(\", \")}`]}if(e.extraQualities){let r=[];for(let o of e.extraQualities)t.extraQualities.indexOf(o)===-1&&r.push(o);if(r.length)return[!1,`Missing qualities: ${r.join(\", \")}`]}return[!0]}function St(i,e){return R(i,{extraFormats:[e]})}function Ft(i,e){if(e.type!==\"image\")return[!0];let t=[];e.rotation.mirror&&t.push(\"mirroring\"),e.region.percent&&t.push(\"regionByPct\"),e.region.square?t.push(\"regionSquare\"):e.region.full||t.push(\"regionByPx\"),e.rotation.angle&&(e.rotation.angle%90?t.push(\"rotationArbitrary\"):t.push(\"rotationBy90s\")),e.size.confined&&t.push(\"sizeByConfinedWh\"),!e.size.width&&e.size.height&&t.push(\"sizeByH\"),e.size.percentScale&&t.push(\"sizeByPct\"),(i.sizes||[]).find(n=>n.width===e.size.width&&!e.size.height||n.height===e.size.height&&!e.size.width||n.height===e.size.height&&n.width===e.size.width)?t.push(\"sizeByWhListed\"):(e.size.width&&!e.size.height&&t.push(\"sizeByW\"),e.size.width&&e.size.height&&t.push(\"sizeByWh\")),e.size.upscaled&&t.push(\"sizeUpscaling\");let[o,a]=R(i,{extraFeatures:t,extraQualities:[e.quality],extraFormats:[e.format],exactSize:e.size});return o?[!0]:[!1,a]}function ze(i,e,t){let r=i.width?i.width:i.maxWidth;return t.height<=i.maxHeight&&t.width<=i.maxWidth&&t.height>=i.minHeight&&t.width>=i.minWidth&&(!e||Math.abs(t.width-r)<Math.abs(e.width-r))}function _e(i,e){let t=[],r=Object.assign({unsafeImageService:!1,atAnyCost:!0,fallback:!0,minHeight:64,minWidth:64,maxHeight:1/0,maxWidth:1/0,returnAllOptions:!1,preferFixedSize:!1,allowUnsafe:!1,explain:!1,height:0,width:0},i),o=(m,p=0)=>r.explain?t.push(new Array(p).fill(0).map(x=>\" \").join(\"\")+m().trim()):void 0,a=[],n=[],s=null;o(()=>`Using configuration: ${JSON.stringify(r,null,2)}`);let f=(m,p)=>{if(o(()=>\"Swapping choice\",3),ze(r,p,m)){if(r.preferFixedSize&&m.unsafe){o(()=>`We found an image that was marked as unsafe, but it was the best size. (${m.id})`,4),n.push(m);return}r.returnAllOptions&&p&&n.push(p),o(()=>`We found a new image that was the best size. (${m.id})`,4),s=m}else r.returnAllOptions&&n.push(m)};o(()=>`The input shows we have ${e.length} list(s) of candidates to choose from.`);let h=e.length;for(let m=0;m<h;m++){let p=e[m]();o(()=>`Candidate group ${m}: ${JSON.stringify(p,null,2)}`,1);let x=p.length;o(()=>`Checking candidate list number ${m} and found ${x} potential ways of creating image(s)`,1);for(let d=0;d<x;d++){let c=p[d];if(o(()=>`-> Checking candidate ${d}`,1),c.type===\"unknown\"&&r.atAnyCost&&(o(()=>`We've found an unknown image type, adding this to the \"last resort\" list`,2),a.push(c)),c.type===\"fixed\"&&(c.unsafe?(o(()=>`We've found an unsafe fixed image type, adding this to the \"last resort\" list`,2),a.push(c)):(o(()=>\"We've found a fixed size image, checking if it matches the request\",2),f(c,s))),c.type===\"fixed-service\")if(r.unsafeImageService){o(()=>\"Checking for an image from the tile source, without calculating the right height and width (unsafeImageService)\",2);let F=E(c,r.width,r.height);f(F,s)}else{o(()=>\"Checking for an image from the tile source 3\",2);let F=E(c,c.width,c.height);f(F,s)}if(c.type===\"variable\"&&c.maxWidth){let F=E({id:c.id,type:\"fixed-service\",width:c.maxWidth,height:c.maxWidth,level:c.level,version:c.version},c.maxWidth);f(F,s)}}if(s&&!r.returnAllOptions){if(s.unsafe||r.allowUnsafe)continue;o(()=>`We found a match in choice list number ${m}, no searching any more`);break}}return r.atAnyCost&&n.length===0?(o(()=>s?`We found an image! ${s.id} of type ${s.type}`:'We found no images, but \"atAnyCost\" is set, so returning that'),{best:s||a[0]||null,fallback:a.slice(1),log:t}):r.returnAllOptions?(o(()=>\"Returning all options that we have found\"),{best:(r.atAnyCost?s||n[0]||a[0]:s||n[0])||null,fallback:[...n,...a],log:t}):(o(()=>\"Returning the best image that we found, and a fallback\"),{best:s||n[0]||null,fallback:s?n:n.slice(1),log:t})}function be(i,e,t){let r=i>e?i:e,o=t.length,a=[];for(let n=0;n<o;n++){let s=t[n];if(!s||s.scaleFactors.length===0)continue;let f=s.scaleFactors[0];if(!f)continue;let h=r/f,m=[f];for(;h>=s.width;)f=f*2,m.push(f),h=h/2;a.push({...s,scaleFactors:m})}return a}function Ee(i,e){if(i.length!==e.length)return!1;if(i.length===0&&e.length===0)return!0;let t=i.length,r=!0;for(let a=0;a<t;a++){let n=i[a],s=e[a];if(n.width!==s.width||n.height!==s.height){r=!1;break}}if(r)return!0;let o=0;for(let a=0;a<t;a++)for(let n=0;n<t;n++)if(i[a].width===e[n].width&&i[a].height===e[n].height){o++;break}return o===t}function W(i){return v(0,i)}var M=class{constructor(e={}){w(this,\"config\",{verificationsRequired:1,approximateServices:!1,enableFetching:!0,disableThrottling:!1});w(this,\"fetchingCount\",0);w(this,\"imageServices\",{});w(this,\"knownImageServers\",{});this.config=Object.assign(this.config,e)}setConfig(e){Object.assign(this.config,e)}sample(e,t,r=!0){let o=S(l(e)),a=g(l(e)),n=this.knownImageServers[o];return this.imageServices[a]=Object.assign(e,{real:!0}),!n&&e.tiles&&!W(e)?(this.knownImageServers[o]={verifications:0,malformed:!1,root:o,preLoaded:r,sampledId:l(e),verified:!1,server:null,result:{context:e[\"@context\"]||[],sampledProfile:e.profile,resourceServiceRatio:t&&e.height?t.height/e.height:1,sampledSizes:e.sizes||[],sizeRatios:he(e.width,e.height,e.sizes||[]),sampledTiles:e.tiles||[]}},!0):this.verify(e)}preLoad(e,t=!0){this.knownImageServers[e.root]=e,t&&(this.knownImageServers[e.root].malformed=!1,this.knownImageServers[e.root].verifications=this.config.verificationsRequired)}predict(e,t=!1,r=!1){let o=e?.source,a=S(l(e)),n=this.knownImageServers[a],s=g(l(e));return this.imageServices[s]?this.imageServices[s]||null:!this.config.approximateServices||!n||!n.result||!(o?.height||e.height)||!(o?.width||e.width)||!r&&(n.malformed||n.verifications<this.config.verificationsRequired)||W(e.source)?null:(this.imageServices[s]||(this.imageServices[s]={\"@context\":n.result.context,\"@id\":l(e),id:l(e),protocol:\"http://iiif.io/api/image\",tiles:o?.tiles||be(e.width,e.height,n.result.sampledTiles),sizes:o?.sizes||pe(Math.round(e.width/n.result.resourceServiceRatio),Math.round(e.height/n.result.resourceServiceRatio),n.result.sizeRatios),profile:o?.profile||n.result.sampledProfile,height:o?.height||e.height,width:o?.width||e.width,real:!1}),this.imageServices[s]||null)}async getThumbnailFromResource(e,t,r=!0,o=[]){let a=e?await this.getImageCandidates(e,r):[];return _e(t,[()=>o,()=>a])}async getImageCandidates(e,t=!0){let r=e;if(t&&r&&r.height&&r.width){let o=b(r);for(let a of o){let n={id:l(a),width:a.width?a.width:r.width,height:a.height?a.height:r.height,source:a};await this.loadService(n)}}return Se(e,t,this)}async verify(e){let t=this.predict(e,!1,!0),r=await this.fetchService(l(e));if(!t)return!1;let o=t.height===r.height&&t.width===r.width&&t[\"@context\"]===r[\"@context\"]&&Ee(t.sizes||[],r.sizes||[]);if(o){let a=S(l(e)),n=this.knownImageServers[a];n&&(n.verifications+=1,n.verifications>=this.config.verificationsRequired&&(n.verified=!0))}return o}canLoadSync(e){let t=typeof e==\"string\"?e:l(e),r=g(t);if(this.imageServices[r])return!0;let o=this.knownImageServers[S(t)];return!!(o&&!o.malformed&&o.verifications>=this.config.verificationsRequired)}async markAsMalformed(e){return this.knownImageServers[S(l(e))].malformed=!0,this.loadService(e,!0)}async fetchService(e,t=!1){let r=g(e),o=this.imageServices[r];if(o&&(!t||o.real))return o;if(!this.config.enableFetching)throw new Error(\"Fetching is not enabled\");let a=await this.fetch(r).then(n=>n.json());return!a.id&&a[\"@id\"]&&(a.id=a[\"@id\"]),a.id!==e&&(a.id=e,a[\"@id\"]&&(a[\"@id\"]=e)),this.imageServices[r]=Object.assign(a,{real:!0}),this.imageServices[r]}async fetch(e,t){return fetch(e,t)}async loadService(e,t=!1){if(!this.config.disableThrottling){let a=!0;for(;a;)if(this.fetchingCount>=this.config.verificationsRequired)await new Promise(n=>setTimeout(n,500));else{a=!1;break}}let r=this.knownImageServers[S(l(e))];if(r&&!r.malformed&&!t){await r.result;let a=this.loadServiceSync(e);if(a)return a}this.fetchingCount++;let o=await this.fetchService(l(e),t);return this.fetchingCount--,o.real&&this.sample(o,e),o}loadServiceSync(e){let t=g(l(e));return this.imageServices[t]?this.imageServices[t]:this.config.approximateServices?this.predict(e):null}},Gt=new M;export{We as IIIF_1_IMAGE_LEVEL_0,Me as IIIF_1_IMAGE_LEVEL_0_PROFILE,U as IIIF_1_IMAGE_LEVEL_1,Q as IIIF_1_IMAGE_LEVEL_1_PROFILE,V as IIIF_1_IMAGE_LEVEL_2,D as IIIF_1_IMAGE_LEVEL_2_PROFILE,je as IIIF_2_IMAGE_LEVEL_0,Be as IIIF_2_IMAGE_LEVEL_0_NO_JSON,Te as IIIF_2_IMAGE_LEVEL_0_PROFILE,J as IIIF_2_IMAGE_LEVEL_1,ee as IIIF_2_IMAGE_LEVEL_1_NO_JSON,Z as IIIF_2_IMAGE_LEVEL_1_PROFILE,K as IIIF_2_IMAGE_LEVEL_2,ie as IIIF_2_IMAGE_LEVEL_2_NO_JSON,X as IIIF_2_IMAGE_LEVEL_2_PROFILE,$e as IIIF_3_IMAGE_LEVEL_0,Y as IIIF_3_IMAGE_LEVEL_1,q as IIIF_3_IMAGE_LEVEL_2,M as ImageServiceLoader,Oe as STANFORD_IIIF_1_IMAGE_COMPLIANCE_0,N as STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,k as STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,Pe as STANFORD_IIIF_1_IMAGE_CONFORMANCE_0,H as STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,G as STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,Ce as STANFORD_IIIF_IMAGE_COMPLIANCE_0,j as STANFORD_IIIF_IMAGE_COMPLIANCE_1,T as STANFORD_IIIF_IMAGE_COMPLIANCE_2,Le as STANFORD_IIIF_IMAGE_CONFORMANCE_0,$ as STANFORD_IIIF_IMAGE_CONFORMANCE_1,B as STANFORD_IIIF_IMAGE_CONFORMANCE_2,g as canonicalServiceUrl,_ as combineProfiles,ce as createImageServiceRequest,L as extraFeatures,he as extractFixedSizeScales,pe as fixedSizesFromScales,ue as getCustomSizeFromService,xe as getFixedSizeFromImage,Ie as getFixedSizesFromService,l as getId,Se as getImageCandidates,P as getImageCandidatesFromService,E as getImageFromTileSource,S as getImageServerFromId,b as getImageServices,ct as getSmallestScaleFactorAsSingleImage,de as getType,Gt as imageServiceLoader,C as imageServiceProfiles,we as imageServiceRequestToString,St as imageServiceSupportsFormat,Ft as imageServiceSupportsRequest,O as inferSizeFromUrl,ze as isBestMatch,u as isImageService,te as level0,He as level0Support,re as level1,z as level1Support,oe as level2,A as level2Support,ae as levelToProfile,le as parseImageServiceRequest,me as parseImageServiceUrl,ne as parseRegionParameter,fe as parseRotationParameter,se as parseSizeParameter,_e as pickBestFromCandidates,ve as regionParameterToString,Fe as rotationParameterToString,be as sampledTilesToTiles,ye as sizeParameterToString,Ee as sizesMatch,R as supports,ge as supportsCustomSizes};\n","import type { ImageService, SpecificResource } from \"@iiif/presentation-3\";\n// @ts-ignore\nimport { isImageService } from \"@atlas-viewer/iiif-image-api\";\nimport type { CreatorSideEffect } from \"@manifest-editor/creator-api\";\n\nexport const resizeToFitService: CreatorSideEffect = {\n canvasInteraction: true,\n spatial: true,\n async run(result, { vault, options }) {\n if (\n result &&\n result.type === \"Annotation\" &&\n options.targetType === \"Annotation\"\n ) {\n const fullAnno = vault.get<any>(result);\n\n const target = fullAnno.target as SpecificResource;\n if (!(target && target.source?.type === \"Canvas\")) {\n return;\n }\n\n const canvasRef = target.source;\n const canvas = vault.get(canvasRef);\n if (!canvas.items) {\n return;\n }\n\n if (canvas.behavior.includes(\"multi-image\")) {\n return;\n }\n\n const annoPage = vault.get(canvas.items[0]);\n if (!annoPage) {\n return;\n }\n\n const resourceBody = Array.isArray(fullAnno.body)\n ? fullAnno.body[0]\n : fullAnno.body;\n if (resourceBody.type === \"SpecificResource\" && resourceBody.selector) {\n return;\n }\n\n const bodies = vault.get(fullAnno.body);\n const body = bodies[0];\n\n const serviceList = body.service || [];\n const imageService = serviceList.find((s: any) => isImageService(s)) as\n | ImageService\n | undefined;\n if (imageService) {\n if (imageService.width && imageService.height) {\n if (imageService.width !== body.width) {\n vault.modifyEntityField(\n { id: body.id, type: \"ContentResource\" },\n \"width\",\n imageService.width,\n );\n }\n if (imageService.height !== body.height) {\n vault.modifyEntityField(\n { id: body.id, type: \"ContentResource\" },\n \"height\",\n imageService.height,\n );\n }\n }\n }\n }\n },\n};\n","import type { ImageService } from \"@iiif/presentation-3\";\n\nexport function normalizeImageService(service: ImageService): ImageService {\n const { \"@id\": legacyId, \"@type\": legacyType, ...info } = service;\n const version = `${service[\"@context\"] || \"\"} ${service.profile || \"\"}`.match(\n /\\/(?:image|image-api)\\/([123])(?:[./])/\n );\n return {\n ...info,\n id: service.id || legacyId,\n type: service.type || legacyType || `ImageService${version?.[1] || \"2\"}`,\n } as ImageService;\n}\n\n/** Select embedded service metadata without changing the info used to create image URLs. */\nexport function compactImageService(\n service: ImageService,\n config: Record<string, unknown> = {},\n thumbnail = false\n): ImageService {\n const fields: Array<keyof ImageService> = [];\n if (config.compact !== \"compact\") fields.push(\"width\", \"height\");\n if (thumbnail || config.includeSizes === true) fields.push(\"sizes\");\n if (thumbnail || config.includeTiles === true) fields.push(\"tiles\");\n const normalized = normalizeImageService(service);\n return {\n id: normalized.id,\n type: normalized.type,\n profile: normalized.profile,\n ...Object.fromEntries(fields.filter((key) => normalized[key] !== undefined).map((key) => [key, normalized[key]])),\n };\n}\n","import {\n canonicalServiceUrl,\n createImageServiceRequest,\n imageServiceRequestToString,\n parseImageServiceRequest,\n type RegionParameter,\n type SizeParameter,\n} from \"@iiif/parser/image-3\";\nimport type { ImageService } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel } from \"@manifest-editor/editors\";\nimport { Spinner } from \"@manifest-editor/ui/madoc/components/icons/Spinner\";\nimport { type FormEvent, useState } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\nimport { ImageService as ImageServiceComponent, useImage } from \"react-iiif-vault\";\nimport { compactImageService, normalizeImageService } from \"../image-service-options\";\n\nexport interface CreateImageServicePayload {\n url: string;\n height?: number;\n width?: number;\n format?: string;\n service: ImageService;\n size?: SizeParameter;\n embedService?: boolean;\n selector?: RegionParameter;\n}\n\nexport async function createImageServer(data: CreateImageServicePayload, ctx: CreatorFunctionContext) {\n const service = normalizeImageService(data.service);\n\n const request = createImageServiceRequest(service);\n const imageId = imageServiceRequestToString({\n identifier: request.identifier,\n server: request.server,\n scheme: request.scheme,\n type: \"image\",\n size: {\n max: !data.size?.width && !data.size?.height,\n confined: false,\n upscaled: false,\n ...(data.size || {}),\n },\n format: \"jpg\",\n // This isn't how it should be modelled, always full,\n // region: data.selector ? data.selector : { full: true },\n region: { full: true },\n rotation: { angle: 0 },\n quality: \"default\",\n prefix: request.prefix,\n originalPath: (request as any).originalPath,\n });\n\n const resource = ctx.embed({\n id: imageId,\n type: \"Image\",\n format: data.format || \"image/jpeg\",\n height: data.height || service.height,\n width: data.width || service.width,\n service:\n data.embedService === false\n ? undefined\n : [compactImageService(service, ctx.config, ctx.options.parent?.property === \"thumbnail\")],\n });\n\n // @todo add in support for the region selector (creating specific resource)\n\n return resource;\n}\n\nexport function getCanonicalUrl(url: string) {\n return url.endsWith(\"default.jpg\")\n ? imageServiceRequestToString({\n ...parseImageServiceRequest(url),\n type: \"info\",\n })\n : canonicalServiceUrl(url);\n}\n\n// @todo cover a lot more things - like offering size dropdown.\nexport function CreateImageServerForm(props: CreatorContext<CreateImageServicePayload>) {\n const initialData = props.options.initialData as Partial<CreateImageServicePayload>;\n const initialUrl = initialData.url ? getCanonicalUrl(initialData.url) : \"\";\n const [url, setUrl] = useState(initialUrl || \"\");\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n const url = formData.url;\n\n if (url) {\n const info = getCanonicalUrl(url);\n\n if (!info) {\n throw new Error(\"Invalid image service request\");\n }\n\n fetch(info)\n .then((r) => r.json())\n .then((service) => {\n props.runCreate({ url: formData.url, service });\n });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <div className=\"flex gap-2 items-center\">\n <InputContainer $wide>\n <InputLabel htmlFor=\"url\">Link to image service</InputLabel>\n <Input\n id=\"url\"\n name=\"url\"\n defaultValue={initialData.url || \"\"}\n onPaste={(e) => {\n const text = e.clipboardData.getData(\"text/plain\");\n setUrl(text ? getCanonicalUrl(text) : \"\");\n }}\n onBlur={(e) => setUrl(e.currentTarget.value ? getCanonicalUrl(e.currentTarget.value) : \"\")}\n />\n </InputContainer>\n </div>\n\n <div className=\"relative flex z-0 my-5 h-96 min-h-0 min-w-0 overflow-hidden bg-gray-200 rounded items-center justify-center\">\n {url.trim() ? (\n <ErrorBoundary fallbackRender={() => <div>Invalid service</div>}>\n <ImageComponent key={url} src={url} />\n </ErrorBoundary>\n ) : (\n <div className=\"text-grey-600\">Preview</div>\n )}\n </div>\n <div>\n <ActionButton primary large type=\"submit\" isDisabled={!url}>\n Create\n </ActionButton>\n </div>\n </form>\n </PaddedSidebarContainer>\n );\n}\n\nfunction ImageComponent({src}: {src: string}) {\n const image = useImage({ id: src } as any, {\n size: { width: 512 }\n })\n\n if (!image) {\n return <Spinner />;\n }\n\n return <div className=\"h-full\">\n <img className=\"w-full h-full object-contain\" src={image}/>\n </div>\n}\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport {\n type CreatorContext,\n type CreatorFunctionContext,\n type CreatorResource,\n creatorHelper,\n} from \"@manifest-editor/creator-api\";\nimport {\n CreateImageServerForm,\n type CreateImageServicePayload,\n} from \"../../ContentResource/ImageServiceCreator/create-image-service\";\n\nexport interface CreateImageServiceAnnotationPayload extends CreateImageServicePayload {\n label?: InternationalString;\n motivation?: string;\n thumbnailSize?: number;\n}\n\nexport async function createImageServiceAnnotation(\n data: CreateImageServiceAnnotationPayload,\n ctx: CreatorFunctionContext,\n): Promise<any> {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const createImage = creatorHelper(ctx, \"Annotation\", \"body\", \"@manifest-editor/image-service-creator\");\n\n const resource = await createImage(data, {\n parent: { resource: annotation, property: \"body\" },\n });\n\n if (targetType === \"Annotation\") {\n return {\n ...annotation,\n body: [resource],\n motivation: data.motivation || \"painting\",\n target: ctx.getTarget(),\n };\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body: [resource],\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n let thumbnail: CreatorResource | undefined = undefined;\n if (data.service?.sizes) {\n // We can use the creator declaratively to get a thumbnail from the service.\n const createThumbnail = creatorHelper(ctx, \"Canvas\", \"thumbnail\", \"@manifest-editor/thumbnail-image\");\n thumbnail = await createThumbnail({\n service: data.service,\n width: data.thumbnailSize || 400,\n });\n }\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled canvas\"] },\n height: resource.resource.height || 1000,\n width: resource.resource.width || 1000,\n thumbnail: thumbnail ? [thumbnail] : undefined,\n items: [page],\n });\n }\n}\n\nexport function CreateImageServiceAnnotationForm(props: CreatorContext<CreateImageServicePayload>) {\n return <CreateImageServerForm {...props} />;\n}\n","import { IIIFLogo } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getJsonResource, isHttpUrl, isImageService } from \"../../resource-probes\";\nimport { CreateImageServerForm, createImageServer, getCanonicalUrl } from \"./create-image-service\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-service-creator\": typeof imageServiceCreator;\n }\n }\n}\n\nexport const imageServiceCreator = defineCreator({\n id: \"@manifest-editor/image-service-creator\",\n configKey: \"iiif-image-services\",\n create: createImageServer,\n label: \"Image Service\",\n summary: \"Add an image from Image Service\",\n icon: <IIIFLogo style={{ padding: 10 }} />,\n tags: [\"image\", \"image-service\"],\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const serviceUrl = getCanonicalUrl(value);\n if (!serviceUrl) return false;\n const service = await getJsonResource(serviceUrl, helpers);\n if (!isImageService(service)) return false;\n return { initialData: { url: value, service } };\n },\n render(ctx) {\n return <CreateImageServerForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"id\", \"type\", \"height\", \"width\", \"format\", \"service\"],\n supports: {\n initialData: true,\n parentFields: [\"logo\", \"body\", \"thumbnail\", \"items\"],\n custom(parent, vault) {\n if (parent.property !== \"items\") {\n return true;\n }\n\n if (parent.resource.type === \"ContentResource\") {\n const resource = vault.get(parent.resource as any, { skipSelfReturn: false } as any) as any;\n return resource?.type === \"Choice\";\n }\n\n return false;\n },\n },\n});\n","import { IIIFLogo } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { repositionMultipleImages } from \"../../side-effects/reposition-multiple-images\";\nimport { resizeResourceToEmptyCanvas } from \"../../side-effects/resize-resource-to-empty-canvas\";\nimport { resizeToFitService } from \"../../side-effects/resize-to-fit-service\";\nimport {\n CreateImageServiceAnnotationForm,\n createImageServiceAnnotation,\n} from \"./create-service-annotation\";\nimport { imageServiceCreator } from \"../../ContentResource/ImageServiceCreator\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-service-annotation\": typeof imageServiceAnnotation;\n }\n }\n}\n\n// @todo combine this with the content resource one.\nexport const imageServiceAnnotation = defineCreator({\n id: \"@manifest-editor/image-service-annotation\",\n create: createImageServiceAnnotation,\n label: \"IIIF Image\",\n dependencies: [\"@manifest-editor/image-service-creator\"],\n summary: \"IIIF Image service\",\n tags: [\"image\", \"image-service\"],\n icon: <IIIFLogo style={{ padding: 10 }} />,\n render(ctx) {\n return <CreateImageServiceAnnotationForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supportsResource: imageServiceCreator.supportsResource,\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n sideEffects: [\n resizeToFitService,\n resizeResourceToEmptyCanvas,\n repositionMultipleImages,\n ],\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import type { ImageService } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext, CreatorResource } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel } from \"@manifest-editor/editors\";\nimport { getFormat, getImageDimensions } from \"@manifest-editor/shell\";\nimport type { FormEvent } from \"react\";\n\nexport interface CreateImageUrlPayload {\n url: string;\n format?: string;\n height?: number;\n width?: number;\n service?: ImageService | ImageService[];\n}\n\nexport async function createImageUrl(\n data: CreateImageUrlPayload,\n ctx: CreatorFunctionContext,\n): Promise<CreatorResource> {\n if (!data.height || !data.width) {\n const dimensions = await getImageDimensions(data.url);\n if (dimensions) {\n data.height = dimensions.height;\n data.width = dimensions.width;\n }\n }\n\n return ctx.embed({\n id: data.url,\n type: \"Image\",\n format: data.format || (await getFormat(data.url)),\n height: data.height,\n width: data.width,\n service: data.service ? (Array.isArray(data.service) ? data.service : [data.service]) : undefined,\n });\n}\n\nexport function CreateImageUrlForm(props: CreatorContext) {\n const initialData = props.options.initialData as Partial<CreateImageUrlPayload>;\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.url) {\n props.runCreate({ url: formData.url });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <InputContainer $wide>\n <InputLabel htmlFor=\"id\">Link to Image</InputLabel>\n <Input id=\"url\" name=\"url\" defaultValue={initialData.url || \"\"} />\n </InputContainer>\n\n <ActionButton primary large type=\"submit\">\n Create\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport {\n type CreatorContext,\n type CreatorFunctionContext,\n type CreatorResource,\n creatorHelper,\n} from \"@manifest-editor/creator-api\";\nimport { CreateImageUrlForm, type CreateImageUrlPayload } from \"../../ContentResource/ImageUrlCreator/create-image-url\";\n\nexport interface CreateImageUrlAnnotationPayload extends CreateImageUrlPayload {\n label?: InternationalString;\n motivation?: string;\n}\n\nexport async function createImageUrlAnnotation(\n data: CreateImageUrlAnnotationPayload,\n ctx: CreatorFunctionContext,\n): Promise<CreatorResource> {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const createImage = creatorHelper(ctx, \"Annotation\", \"body\", \"@manifest-editor/image-url-creator\");\n\n const resource = await createImage(data, {\n parent: { resource: annotation, property: \"body\" },\n });\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n body: [resource],\n motivation: data.motivation || \"painting\",\n target: ctx.getTarget(),\n });\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body: [resource],\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled canvas\"] },\n height: resource.resource.height || 1000,\n width: resource.resource.width || 1000,\n items: [page],\n });\n }\n\n throw new Error(\"Unsupported target type\");\n}\n\nexport function CreateImageUrlAnnotationForm(props: CreatorContext<CreateImageUrlPayload>) {\n return <CreateImageUrlForm {...props} />;\n}\n","import { AddImageIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getContentType, isHttpUrl, isImageService, matchesExtension } from \"../../resource-probes\";\nimport { getCanonicalUrl } from \"../ImageServiceCreator/create-image-service\";\nimport { CreateImageUrlForm, createImageUrl } from \"./create-image-url\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-url-creator\": typeof imageUrlCreator;\n }\n }\n}\n\nexport const imageUrlCreator = defineCreator({\n id: \"@manifest-editor/image-url-creator\",\n create: createImageUrl,\n label: \"Image\",\n summary: \"Image from a URL\",\n icon: <AddImageIcon />,\n tags: [\"image\"],\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const serviceUrl = getCanonicalUrl(value);\n if (serviceUrl) {\n try {\n const service = await helpers.json(serviceUrl);\n if (isImageService(service)) return false;\n } catch {\n // Not an image service; keep checking the image URL itself.\n }\n }\n const contentType = await getContentType(value, helpers);\n if (contentType.startsWith(\"image/\") || matchesExtension(value, [\".jpg\", \".jpeg\", \".png\", \".gif\", \".webp\"])) {\n return { initialData: { url: value, format: contentType || undefined } };\n }\n return false;\n },\n render(ctx) {\n return <CreateImageUrlForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"format\"],\n supports: {\n initialData: true,\n parentFields: [\"logo\", \"body\", \"thumbnail\", \"items\"],\n custom(parent, vault) {\n if (parent.property !== \"items\") {\n return true;\n }\n\n if (parent.resource.type === \"ContentResource\") {\n const resource = vault.get(parent.resource as any, { skipSelfReturn: false } as any) as any;\n return resource?.type === \"Choice\";\n }\n\n return false;\n },\n },\n staticFields: {\n type: \"Image\",\n },\n});\n","import { AddImageIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { repositionMultipleImages } from \"../../side-effects/reposition-multiple-images\";\nimport { resizeResourceToEmptyCanvas } from \"../../side-effects/resize-resource-to-empty-canvas\";\nimport { resizeToFitService } from \"../../side-effects/resize-to-fit-service\";\nimport {\n CreateImageUrlAnnotationForm,\n createImageUrlAnnotation,\n} from \"./create-image-url-annotation\";\nimport { imageUrlCreator } from \"../../ContentResource/ImageUrlCreator\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-url-annotation\": typeof imageUrlAnnotation;\n }\n }\n}\n\nexport const imageUrlAnnotation = defineCreator({\n id: \"@manifest-editor/image-url-annotation\",\n create: createImageUrlAnnotation,\n label: \"Image\",\n dependencies: [\"@manifest-editor/image-url-creator\"],\n summary: \"Image from URL\",\n tags: [\"image\"],\n icon: <AddImageIcon />,\n render(ctx) {\n return <CreateImageUrlAnnotationForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supportsResource: imageUrlCreator.supportsResource,\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n sideEffects: [\n resizeToFitService,\n resizeResourceToEmptyCanvas,\n repositionMultipleImages,\n ],\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import { ActionButton, Form, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport {\n type CreatorContext,\n type CreatorFunctionContext,\n type CreatorResource,\n creatorHelper,\n} from \"@manifest-editor/creator-api\";\nimport type { FormEvent } from \"react\";\nimport type { CreateImageUrlPayload } from \"../ImageUrlCreator/create-image-url\";\n\nexport interface CreateImageUrlListPayload {\n images: CreateImageUrlPayload[];\n}\n\nexport async function createImageUrlList(\n payload: CreateImageUrlListPayload,\n ctx: CreatorFunctionContext,\n): Promise<CreatorResource[]> {\n const items = [];\n const createImage = creatorHelper(ctx, \"Annotation\", \"body\", \"@manifest-editor/image-url-creator\");\n\n for (const image of payload.images) {\n items.push(await createImage(image, ctx.options));\n }\n\n return items as CreatorResource[];\n}\n\nexport function CreateImageUrlListForm(props: CreatorContext<CreateImageUrlListPayload>) {\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.urls) {\n props.runCreate({ images: formData.urls.split(\"\\n\").map((url: string) => ({ url })) });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <Form.Form onSubmit={onSubmit}>\n <Form.InputContainer className=\"mb-4\">\n <Form.Label>Enter a list of URLs (one per line)</Form.Label>\n <Form.TextArea name=\"urls\" rows=\"10\" />\n </Form.InputContainer>\n <ActionButton primary large type=\"submit\">\n Create\n </ActionButton>\n </Form.Form>\n </PaddedSidebarContainer>\n );\n}\n","import { type CreatorFunctionContext, type CreatorResource, creatorHelper } from \"@manifest-editor/creator-api\";\nimport type { CreateImageUrlPayload } from \"../../ContentResource/ImageUrlCreator/create-image-url\";\n\nexport async function createImageUrlListAnnotation(\n payload: {\n images: CreateImageUrlPayload[];\n },\n ctx: CreatorFunctionContext,\n): Promise<CreatorResource[]> {\n const items = [];\n const createAnnotation = creatorHelper(ctx, \"AnnotationPage\", \"items\", \"@manifest-editor/image-url-annotation\");\n\n for (const image of payload.images) {\n items.push(await createAnnotation(image, ctx.options));\n }\n\n return items as CreatorResource[];\n}\n","import { ImageListIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { CreateImageUrlListForm } from \"../../ContentResource/ImageUrlListCreator/create-image-url-list\";\nimport { repositionMultipleImages } from \"../../side-effects/reposition-multiple-images\";\nimport { resizeResourceToEmptyCanvas } from \"../../side-effects/resize-resource-to-empty-canvas\";\nimport { resizeToFitService } from \"../../side-effects/resize-to-fit-service\";\nimport { createImageUrlListAnnotation } from \"./create-image-url-list-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-url-list-annotation\": typeof imageUrlListAnnotation;\n }\n }\n}\n\nexport const imageUrlListAnnotation = defineCreator({\n id: \"@manifest-editor/image-url-list-annotation\",\n create: createImageUrlListAnnotation,\n label: \"List of Images\",\n dependencies: [\"@manifest-editor/image-url-annotation\"],\n summary: \"List of Images from URLs\",\n tags: [\"image\"],\n icon: <ImageListIcon />,\n render(ctx) {\n return <CreateImageUrlListForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supports: {\n onlyPainting: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n sideEffects: [\n resizeToFitService,\n resizeResourceToEmptyCanvas,\n repositionMultipleImages,\n ],\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport { EmptyCanvasIcon } from \"@manifest-editor/components\";\nimport {\n type CreatorFunctionContext,\n defineCreator,\n} from \"@manifest-editor/creator-api\";\n\n// @todo combine this with the content resource one.\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/no-body-annotation\": typeof noBodyAnnotation;\n }\n }\n}\n\nexport interface NoBodyAnnotationPayload {\n label?: InternationalString;\n motivation?: string;\n}\n\nexport const noBodyAnnotation = defineCreator({\n id: \"@manifest-editor/no-body-annotation\",\n create: createNoBodyAnnotation,\n label: \"Annotation without body\",\n summary: \"Add an annotation that only has motivation and target\",\n icon: <EmptyCanvasIcon />,\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"target\"],\n supports: {\n initialData: true,\n parentTypes: [\"AnnotationPage\"],\n parentFields: [\"items\"],\n disallowPainting: true,\n },\n actionButton: \"Create empty annotation\",\n sideEffects: [],\n staticFields: {\n type: \"Annotation\",\n },\n});\n\nexport function createNoBodyAnnotation(\n data: NoBodyAnnotationPayload,\n ctx: CreatorFunctionContext,\n) {\n return ctx.embed({\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n label: data?.label,\n motivation:\n data.motivation || ctx.options.initialData?.motivation || \"highlighting\",\n target: ctx.getTarget(),\n });\n}\n","import { CanvasPanel, MediaPlayerProvider, useSimpleMediaPlayer } from \"react-iiif-vault\";\nimport { SingleVideo } from \"react-iiif-vault\";\nimport { MediaControls } from \"../MediaControls/MediaControls\";\n\nexport function VideoPlayer({\n media,\n onError,\n duration,\n onDuration,\n onDimensions,\n}: {\n media: SingleVideo;\n duration: number;\n onError?: (error: string) => void;\n onDuration?: (duration: number) => void;\n onDimensions?: (width: number, height: number) => void;\n}) {\n const [{ element, currentTime, progress }, state, actions] = useSimpleMediaPlayer({ duration: duration });\n\n return (\n <MediaPlayerProvider\n element={element}\n state={state}\n actions={actions}\n currentTime={currentTime}\n progress={progress}\n >\n <div\n style={{\n maxHeight: 400,\n aspectRatio: `${(media as any).width}/${(media as any).height}`,\n position: \"relative\",\n }}\n >\n <CanvasPanel.VideoHTML element={element} media={media} playPause={actions.playPause} />\n </div>\n <MediaControls onError={onError} onDuration={onDuration} onDimensions={onDimensions} />\n </MediaPlayerProvider>\n );\n}\n","import { getValue } from \"@iiif/helpers\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, ErrorMessage, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { DimensionsTriplet, Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { VideoPlayer } from \"@manifest-editor/ui/VideoPlayer\";\nimport { useEffect, useState } from \"react\";\n\nexport interface CreateVideoAnnotationPayload {\n label?: InternationalString;\n motivation?: string;\n duration?: number;\n url: string;\n width: number;\n height: number;\n}\n\nexport async function createVideoAnnotation(data: CreateVideoAnnotationPayload, ctx: CreatorFunctionContext) {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const body = ctx.embed({\n id: data.url,\n type: \"Video\",\n format: \"video/mp4\",\n width: data.width,\n height: data.height,\n duration: data.duration || 0,\n });\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n label: getValue(data.label) && data.label,\n motivation: data.motivation || ctx.options.initialData?.motivation || \"painting\",\n body,\n target: ctx.getTarget(),\n });\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body,\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled HTML canvas\"] },\n duration: data.duration || 0,\n width: data.width,\n height: data.height,\n items: [page],\n });\n }\n}\n\nexport function CreateVideoAnnotationForm(props: CreatorContext<CreateVideoAnnotationPayload>) {\n const initialData = props.options.initialData as Partial<CreateVideoAnnotationPayload>;\n const [url, setUrl] = useState(initialData.url || \"\");\n const [duration, setDuration] = useState(0);\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const [error, setError] = useState(\"\");\n const [label, setLabel] = useState({ en: [\"\"] } as InternationalString);\n\n const onSubmit = () => {\n props.runCreate({\n url,\n duration,\n label,\n width,\n height,\n });\n };\n\n useEffect(() => {\n setError(\"\");\n setDuration(0);\n if (url) {\n // Find label from url.\n const labelFromUrl = url.split(\"/\").pop()?.split(\".\").shift();\n setLabel({ en: [labelFromUrl || \"\"] } as InternationalString);\n }\n }, [url]);\n\n return (\n <PaddedSidebarContainer>\n {error ? <ErrorMessage>{error}</ErrorMessage> : null}\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"video-url\">URL</InputLabel>\n <Input type=\"text\" id=\"video-url\" value={url} onChange={(e) => setUrl(e.target.value)} />\n </InputContainer>\n\n {url && !error ? (\n <div>\n <LanguageFieldEditor\n key={`${url}__${duration}`}\n containerId={\"label\"}\n focusId={\"label_\"}\n label={\"Label\"}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n </div>\n ) : null}\n\n {url && !error ? (\n <div className=\"mb-4 bg-black\">\n <VideoPlayer\n duration={duration}\n onDuration={(d) => setDuration(d)}\n onError={(err) => setError(err)}\n media={\n {\n url,\n duration,\n height,\n width,\n type: \"Video\",\n } as any\n }\n onDimensions={(w, h) => {\n setWidth(w || 0);\n setHeight(h || 0);\n }}\n />\n </div>\n ) : null}\n\n {!error && (duration || width || height) ? (\n <InputContainer $wide>\n <DimensionsTriplet\n widthId={\"width\"}\n width={width || 0}\n changeWidth={(v) => setWidth(v)}\n heightId={\"height\"}\n height={height || 0}\n changeHeight={(v) => setHeight(v)}\n durationId={\"duration\"}\n duration={duration || 0}\n changeDuration={(v) => setDuration(v)}\n />\n </InputContainer>\n ) : null}\n\n <ActionButton primary large type=\"button\" onPress={onSubmit} isDisabled={!url || !!error}>\n Add video\n </ActionButton>\n </PaddedSidebarContainer>\n );\n}\n","import { VideoIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getContentType, isHttpUrl, matchesExtension } from \"../../resource-probes\";\nimport {\n CreateVideoAnnotationForm,\n createVideoAnnotation,\n} from \"./create-video-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/video-annotation\": typeof videoAnnotation;\n }\n }\n}\n\nexport const videoAnnotation = defineCreator({\n id: \"@manifest-editor/video-annotation\",\n create: createVideoAnnotation,\n label: \"Video\",\n summary: \"Video annotation\",\n icon: <VideoIcon />,\n render(ctx) {\n return <CreateVideoAnnotationForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const contentType = await getContentType(value, helpers);\n if (contentType.startsWith(\"video/\") || matchesExtension(value, [\".mp4\", \".m4v\", \".webm\", \".mov\"])) {\n return { initialData: { url: value } };\n }\n return false;\n },\n supports: {\n onlyPainting: true,\n initialData: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Annotation\",\n },\n});\n","export const ThumbnailStripIcon: React.FC = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"#000000\"\n transform=\"scale(-1, 1)\"\n >\n <g>\n <rect fill=\"none\" height=\"24\" width=\"24\" />\n <path d=\"M16,20H2V4h14V20z M18,8h4V4h-4V8z M18,20h4v-4h-4V20z M18,14h4v-4h-4V14z\" />\n </g>\n </svg>\n);\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { ThumbnailStripIcon } from \"@manifest-editor/ui/icons/ThumbnailStripIcon\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/empty-annotation-page\": typeof emptyAnnotationPage;\n }\n }\n}\n\nexport const emptyAnnotationPage = defineCreator({\n id: \"@manifest-editor/empty-annotation-page\",\n create: (\n data: {\n label?: InternationalString;\n },\n ctx,\n ) => {\n return ctx.embed({\n id: ctx.generateId(\"annotations\"),\n label: data.label,\n type: \"AnnotationPage\",\n items: [],\n });\n },\n label: \"Empty annotation page\",\n summary: \"AnnotationPage with nothing\",\n icon: <ThumbnailStripIcon />,\n resourceType: \"AnnotationPage\",\n resourceFields: [\"id\", \"type\", \"items\"],\n supports: {\n parentTypes: [\"Manifest\", \"Canvas\", \"Range\"],\n parentFieldMap: {\n Manifest: [\"annotations\"],\n Canvas: [\"items\", \"annotations\"],\n Range: [\"annotations\"],\n },\n },\n});\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport { EmptyCanvasIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/empty-canvas\": typeof emptyCanvas;\n }\n }\n}\n\nexport const emptyCanvas = defineCreator({\n id: \"@manifest-editor/empty-canvas\",\n create: (\n data: {\n label?: InternationalString;\n width?: number;\n height?: number;\n },\n ctx,\n ) => {\n const canvasId = ctx.generateId(\"canvas\");\n const page = ctx.embed({\n id: ctx.generateId(\"annotation-page\", { id: canvasId, type: \"Canvas\" }),\n type: \"AnnotationPage\",\n items: [],\n });\n\n return {\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"\"] },\n height: data.height || 1000,\n width: data.width || 1000,\n items: [page],\n };\n },\n label: \"Empty canvas\",\n summary: \"No content\",\n icon: <EmptyCanvasIcon />,\n resourceType: \"Canvas\",\n resourceFields: [\"id\", \"type\", \"label\", \"height\", \"width\", \"items\"],\n supports: {\n parentTypes: [\"Manifest\"],\n parentFields: [\"items\"],\n },\n});\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import { type CreatorContext, type CreatorFunctionContext, defineCreator } from \"@manifest-editor/creator-api\";\nimport { IIIFBrowser, IIIFBrowserProps } from \"iiif-browser\";\nimport { ThumbnailStripIcon } from \"@manifest-editor/ui/icons/ThumbnailStripIcon\";\nimport { useManifest, useVault, VaultProvider } from \"react-iiif-vault\";\nimport invariant from \"tiny-invariant\";\nimport { useMemo } from \"react\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/internal-canvas\": typeof internalCanvas;\n }\n }\n}\n\nexport const internalCanvas = defineCreator({\n id: \"@manifest-editor/internal-canvas\",\n create: createInternalCanvas,\n label: \"Internal canvas link\",\n summary: \"Canvas from the same manifest\",\n icon: <ThumbnailStripIcon />,\n resourceType: \"Canvas\",\n resourceFields: [\"id\", \"type\", \"label\"],\n supports: {\n parentTypes: [\"Manifest\"],\n parentFields: [\"start\"],\n },\n render: (ctx) => <InternalCanvas {...ctx} />,\n});\n\nfunction InternalCanvas(props: CreatorContext<InternalCanvasPayload>) {\n const manifest = useManifest();\n const vault = useVault();\n\n const navigationOptions = useMemo(() => {\n return {\n canSelectCanvas: false,\n canSelectCollection: false,\n canSelectManifest: true,\n canCropImage: false,\n alwaysShowNavigationArrow: false,\n multiSelect: false,\n } as IIIFBrowserProps[\"navigation\"];\n }, []);\n\n const output = useMemo(() => {\n return [\n {\n type: \"callback\",\n cb: (url: string) => props.runCreate({ id: url }),\n label: \"Select canvas\",\n supportedTypes: [\"Canvas\"],\n format: { type: \"url\" },\n },\n ] as IIIFBrowserProps[\"output\"];\n }, [props.runCreate]);\n\n const historyOptions = useMemo(() => {\n return {\n saveToLocalStorage: false,\n restoreFromLocalStorage: false,\n initialHistory: [\n {\n url: manifest?.id,\n resource: manifest?.id,\n route: `/loading?id=${manifest?.id}`,\n metadata: { type: \"Manifest\" },\n },\n ],\n } as IIIFBrowserProps[\"history\"];\n }, [manifest?.id]);\n\n invariant(manifest, \"Manifest is not loaded\");\n\n return (\n <VaultProvider vault={vault}>\n <IIIFBrowser\n vault={vault}\n navigation={navigationOptions}\n output={output}\n history={historyOptions}\n />\n </VaultProvider>\n );\n}\n\nexport interface InternalCanvasPayload {\n id: string;\n}\n\nasync function createInternalCanvas(data: InternalCanvasPayload, ctx: CreatorFunctionContext) {\n return ctx.embed({ id: data.id, type: \"Canvas\" });\n}\n","import * as React from \"react\";\nimport { SVGProps } from \"react\";\n\nexport const TextFormatIcon = (props: SVGProps<SVGSVGElement>) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" {...props}>\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M5 17v2h14v-2H5zm4.5-4.2h5l.9 2.2h2.1L12.75 4h-1.5L6.5 15h2.1l.9-2.2zM12 5.98 13.87 11h-3.74L12 5.98z\" />\n </svg>\n);\n","import { ActionButton, HTMLEditor, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { InputContainer, InputLabel, RichTextLanguageField } from \"@manifest-editor/editors\";\nimport { useConfig } from \"@manifest-editor/shell\";\nimport { useState } from \"react\";\n\nexport interface CreateHTMLBodyPayload {\n language?: string;\n body: string;\n}\n\nexport async function createHtmlBody(data: CreateHTMLBodyPayload, ctx: CreatorFunctionContext) {\n return ctx.embed({\n id: ctx.generateId(`html/${data.language}`),\n language: data.language,\n type: \"TextualBody\",\n format: \"text/html\",\n value: data.body || \"\",\n });\n}\n\nexport function CreateHTMLBodyForm(props: CreatorContext<CreateHTMLBodyPayload>) {\n const { i18n } = useConfig();\n const [body, setBodyValue] = useState<string>(\"<p></p>\");\n const [language, setLang] = useState(i18n.defaultLanguage);\n\n const onSubmit = () => {\n props.runCreate({\n language,\n body,\n });\n };\n\n return (\n <PaddedSidebarContainer>\n <HTMLEditor className=\"border-none\" value={body} onChange={(newValue) => setBodyValue(newValue)} />\n\n <ActionButton primary large type=\"button\" onPress={onSubmit}>\n Create\n </ActionButton>\n </PaddedSidebarContainer>\n );\n}\n","import { defineCreator } from \"@manifest-editor/creator-api\";\nimport { TextFormatIcon } from \"@manifest-editor/ui/icons/TextFormatIcon\";\nimport { CreateHTMLBodyForm, createHtmlBody } from \"./create-html-body\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/html-body-creator\": typeof htmlBodyCreator;\n }\n }\n}\n\nexport const htmlBodyCreator = defineCreator({\n id: \"@manifest-editor/html-body-creator\",\n create: createHtmlBody,\n label: \"HTML Body\",\n summary: \"Add HTML annotation body\",\n icon: <TextFormatIcon />,\n render(ctx) {\n return <CreateHTMLBodyForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"id\", \"language\", \"type\", \"format\", \"value\"],\n supports: {\n parentTypes: [\"Annotation\", \"ContentResource\"],\n parentFields: [\"body\", \"items\"],\n custom(parent, vault) {\n if (parent.resource.type === \"Annotation\") {\n return parent.property === \"body\";\n }\n\n const resource = vault.get(\n parent.resource as any,\n { skipSelfReturn: false } as any,\n ) as any;\n return parent.property === \"items\" && resource?.type === \"Choice\";\n },\n },\n staticFields: {\n type: \"TextualBody\",\n format: \"text/html\",\n },\n});\n","import { type ContentState, normaliseContentState, parseContentState, Vault } from \"@iiif/helpers\";\nimport { canonicalServiceUrl, getImageServices } from \"@iiif/parser/image-3\";\nimport type { Canvas } from \"@iiif/presentation-3\";\nimport type { CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { lazy } from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { browserImageApiSelector, browserTransformDimensions, type IIIFBrowserOutputItem } from \"./iiif-browser-output\";\n\nexport function croppedRegion(\n imageServiceId: string,\n region: {\n x: number;\n y: number;\n width: number;\n height: number;\n },\n size: string,\n rotation: number | string = 0,\n) {\n return `${imageServiceId}/${Math.floor(region.x)},${Math.floor(region.y)},${Math.floor(region.width)},${Math.floor(\n region.height,\n )}/${size}/${rotation}/default.jpg`;\n}\n\nexport interface IIIFBrowserCreatorPayload {\n // This is the output (JSON) from the IIIF Browser.\n // We could have gone with \"IIIF Content State\" here and may do in the future, but this\n // will simplify parsing and importing resources.\n output: IIIFBrowserOutputItem[];\n trackSize?: (dimensions: { width: number; height: number }) => void;\n trackManifest?: (manifest: { requiredStatement: any; rights: any; metadata?: any[]; partOf: any[] }) => void;\n}\n\nexport async function createFromIIIFBrowserOutput(data: IIIFBrowserCreatorPayload, ctx: CreatorFunctionContext) {\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\" | \"ContentResource\";\n const resources = data.output;\n\n const returnResources: any[] = [];\n\n for (const { resource, selector, parent, rotation } of resources) {\n const type = resource.type;\n const previewVault = new Vault();\n\n // Case 1 - we want the WHOLE canvas to come across.\n if (targetType === \"Canvas\" || targetType === \"Annotation\" || targetType === \"ContentResource\") {\n // Then we should have gotten eit\n\n if (type === \"Canvas\") {\n const canvasId = resource.id;\n const manifestId = parent?.type === \"Manifest\" ? parent.id : undefined;\n invariant(manifestId, \"Could not find Manifest\");\n\n const existingManifest = previewVault.get({\n id: manifestId,\n type: \"Manifest\",\n });\n // 1st. Check the preview vault.\n const manifest = existingManifest || (await previewVault.loadManifest(manifestId));\n\n invariant(manifest, \"Manifest not found\");\n\n const addManifestMetadataToCanvas = ctx.config.addManifestMetadataToCanvas !== false;\n data.trackManifest?.({\n requiredStatement: manifest.requiredStatement,\n rights: manifest.rights,\n ...(addManifestMetadataToCanvas ? { metadata: manifest.metadata || [] } : {}),\n partOf: [{ id: manifestId, type: \"Manifest\", label: manifest.label }],\n });\n const addManifestTracking = (resource: any): any => {\n if (resource.type === \"SpecificResource\" && resource.source) {\n return {\n ...resource,\n source: addManifestTracking(resource.source),\n };\n }\n const metadata =\n resource.type === \"Canvas\" && !addManifestMetadataToCanvas ? {} : { metadata: manifest.metadata || [] };\n\n return {\n requiredStatement: manifest.requiredStatement,\n rights: manifest.rights,\n ...metadata,\n ...resource,\n partOf: [{ id: manifestId, type: \"Manifest\", label: manifest.label }],\n };\n };\n\n const canvasRef = manifest.items.find((item) => item.id === canvasId);\n\n invariant(canvasRef, \"Canvas not found\");\n\n const canvas = previewVault.get(canvasRef);\n\n const imageApiSelector = browserImageApiSelector(selector, rotation);\n\n if (targetType === \"Canvas\" && !imageApiSelector) {\n const fullCanvas = previewVault.toPresentation3<Canvas>(canvas)!;\n if (!fullCanvas.label) {\n fullCanvas.label = { en: [\"Untitled canvas\"] };\n }\n\n // Load before embedding.\n ctx.vault.loadSync(fullCanvas.id, addManifestTracking(fullCanvas));\n // Embed the loaded canvas so empty defaults do not overwrite its content on commit.\n returnResources.push(ctx.embed(ctx.vault.get({ id: fullCanvas.id, type: \"Canvas\" })));\n continue;\n }\n\n const annotationPage = previewVault.get(canvas.items[0]!);\n const annotation = previewVault.get(annotationPage.items[0]!);\n if (targetType === \"Annotation\" || targetType === \"Canvas\" || targetType === \"ContentResource\") {\n const fullAnnotation = previewVault.toPresentation3<any>(annotation);\n fullAnnotation.id = ctx.generateId(\"Annotation\");\n\n let service = null;\n\n const dimensions = { width: 0, height: 0 };\n\n if (fullAnnotation?.body?.service) {\n const width = fullAnnotation?.body.width;\n const height = fullAnnotation?.body.height;\n service = getImageServices(fullAnnotation?.body)[0];\n\n if (service && (!service.width || !service.height)) {\n service.width = width;\n service.height = height;\n }\n\n dimensions.width = width;\n dimensions.height = height;\n if (data.trackSize) {\n data.trackSize(dimensions);\n }\n }\n\n // Check for selector on state.\n if (imageApiSelector) {\n // Preserve the existing cropped request URL when a region exists.\n const newBody = { ...fullAnnotation.body };\n let thumbnailId = \"\";\n // Cropped id.\n if (service && selector?.type === \"BoxSelector\") {\n const id = service.id || service[\"@id\"] || \"\";\n if (id) {\n newBody.id = croppedRegion(id, selector.spatial, \"max\", rotation);\n thumbnailId = croppedRegion(id, selector.spatial, \"512,\", rotation);\n }\n }\n // Generate cropped image URL.\n\n fullAnnotation.body = {\n id: ctx.generateId(\"SpecificResource\", annotation),\n type: \"SpecificResource\",\n source: newBody,\n selector: imageApiSelector,\n };\n\n const transformedDimensions = browserTransformDimensions(\n selector?.type === \"BoxSelector\"\n ? {\n width: ~~selector.spatial.width,\n height: ~~selector.spatial.height,\n }\n : dimensions,\n rotation,\n );\n if (data.trackSize) {\n data.trackSize(transformedDimensions);\n }\n\n if (targetType === \"ContentResource\") {\n returnResources.push(addManifestTracking(fullAnnotation.body));\n continue;\n }\n\n // Canvas.\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"Canvas\", annotation);\n fullAnnotation.target = canvasId;\n // Page then canvas.\n const pageId = ctx.generateId(\"Page\", annotation);\n const annotationPage = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [fullAnnotation],\n });\n\n const { width, height } = transformedDimensions;\n\n returnResources.push(\n ctx.embed(\n addManifestTracking({\n id: canvasId,\n type: \"Canvas\",\n label: { en: [\"Untitled canvas\"] },\n width,\n height,\n thumbnail: thumbnailId\n ? [\n ctx.embed({\n id: thumbnailId,\n type: \"Image\",\n format: \"image/jpeg\",\n width: 512,\n height: Math.round((height / width) * 512),\n }),\n ]\n : undefined,\n items: [annotationPage],\n }),\n ),\n );\n continue;\n }\n\n returnResources.push(\n ctx.embed(\n addManifestTracking({\n ...fullAnnotation,\n target: ctx.getTarget(),\n }),\n ),\n );\n continue;\n }\n\n // @todo check return types (At the moment only annotation is supported.)\n\n returnResources.push(\n ctx.embed(\n addManifestTracking({\n ...fullAnnotation,\n target: ctx.getTarget(),\n }),\n ),\n );\n }\n }\n }\n }\n\n return returnResources;\n}\nexport const IIIFBrowserCreatorForm = lazy(() => import(\"./iiif-browser-form.lazy\"));\n","import { isImageService } from \"@iiif/parser/image-3\";\nimport type { ImageService, SpecificResource } from \"@iiif/presentation-3\";\nimport type { CreatorSideEffect } from \"@manifest-editor/creator-api\";\nimport { croppedRegion } from \"../ContentResource/IIIFBrowserCreator/iiif-browser-creator\";\n\nexport const updateCanvasThumbnailFromCrop: CreatorSideEffect = {\n canvasInteraction: true,\n spatial: true,\n async run(result, { vault, options }) {\n if (\n !(\n result &&\n result.type === \"Annotation\" &&\n options.targetType === \"Annotation\"\n )\n ) {\n return;\n }\n\n const fullAnno = vault.get<any>(result);\n const target = fullAnno.target as SpecificResource;\n if (!(target && target.source?.type === \"Canvas\")) {\n return;\n }\n\n const bodyRef = Array.isArray(fullAnno.body)\n ? fullAnno.body[0]\n : fullAnno.body;\n const selector = bodyRef?.selector;\n if (\n !(\n selector &&\n (selector.type === \"iiif:ImageApiSelector\" ||\n selector.type === \"ImageApiSelector\") &&\n selector.region\n )\n ) {\n return;\n }\n\n const [x, y, width, height] = selector.region.split(\",\").map(Number);\n if (\n ![x, y, width, height].every(Number.isFinite) ||\n width <= 0 ||\n height <= 0\n ) {\n return;\n }\n\n const [body] = vault.get(fullAnno.body);\n const imageService = (body?.service || []).find((s: any) =>\n isImageService(s),\n ) as ImageService | undefined;\n const serviceId = imageService?.id || imageService?.[\"@id\"];\n if (!serviceId) {\n return;\n }\n\n const thumbnailId = croppedRegion(serviceId, { x, y, width, height }, \"512,\");\n vault.loadSync(thumbnailId, {\n id: thumbnailId,\n type: \"Image\",\n format: \"image/jpeg\",\n width: 512,\n height: Math.round((height / width) * 512),\n service: [imageService],\n });\n vault.modifyEntityField(target.source, \"thumbnail\", [\n { id: thumbnailId, type: \"ContentResource\" },\n ]);\n },\n};\n","import { IIIFBrowserIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getIIIFType, getJsonResource, isDigitalCollectionPage } from \"../../resource-probes\";\nimport { repositionMultipleImages } from \"../../side-effects/reposition-multiple-images\";\nimport { resizeResourceToEmptyCanvas } from \"../../side-effects/resize-resource-to-empty-canvas\";\nimport { resizeToFitService } from \"../../side-effects/resize-to-fit-service\";\nimport { updateCanvasThumbnailFromCrop } from \"../../side-effects/update-canvas-thumbnail-from-crop\";\nimport { IIIFBrowserCreatorForm, createFromIIIFBrowserOutput } from \"./iiif-browser-creator\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/iiif-browser-creator\": typeof iiifBrowserCreator;\n }\n }\n}\n\nexport const iiifBrowserCreator = defineCreator({\n id: \"@manifest-editor/iiif-browser-creator\",\n create: createFromIIIFBrowserOutput,\n label: \"IIIF Browser\",\n summary: \"Browse IIIF Resources\",\n icon: <IIIFBrowserIcon />,\n configuration: {\n fields: [\n {\n id: \"addManifestMetadataToCanvas\",\n type: \"checkbox\",\n label: \"Add manifest metadata to imported canvases\",\n summary: \"Copies metadata from the source Manifest when the IIIF Browser creates a Canvas.\",\n defaultValue: true,\n },\n ],\n },\n render(ctx: any) {\n return <IIIFBrowserCreatorForm {...ctx} />;\n },\n hiddenModal: true,\n tags: [\"image\", \"image-service\"],\n async supportsResource(value, helpers) {\n const resource = await getJsonResource(value, helpers);\n const type = getIIIFType(resource);\n if (type === \"Manifest\" || type === \"Collection\") {\n return { initialData: { url: value } };\n }\n if (await isDigitalCollectionPage(value)) {\n return { initialData: { url: value } };\n }\n return false;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"id\", \"language\", \"type\", \"format\", \"value\"],\n additionalTypes: [\"Annotation\", \"Canvas\"],\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"Annotation\", \"Manifest\", \"AnnotationPage\"],\n parentFields: [\"body\", \"items\"],\n parentFieldMap: {\n Annotation: [\"body\"],\n Manifest: [\"items\"],\n AnnotationPage: [\"items\"],\n },\n },\n sideEffects: [\n updateCanvasThumbnailFromCrop,\n resizeToFitService,\n resizeResourceToEmptyCanvas,\n repositionMultipleImages,\n ],\n staticFields: {},\n});\n","import { ImageListIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { CreateImageUrlListForm, createImageUrlList } from \"./create-image-url-list\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-url-list\": typeof imageUrlListCreator;\n }\n }\n}\n\nexport const imageUrlListCreator = defineCreator({\n id: \"@manifest-editor/image-url-list\",\n label: \"Image URL List\",\n summary: \"Image from a list of URLs\",\n create: createImageUrlList,\n icon: <ImageListIcon />,\n render(ctx) {\n return <CreateImageUrlListForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"format\"],\n supports: {\n parentFields: [\"logo\", \"body\", \"thumbnail\"],\n },\n staticFields: {\n type: \"Image\",\n },\n});\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { type FormEvent, useState } from \"react\";\n\nexport interface CreatePlaintextPayload {\n url: string;\n label?: InternationalString;\n}\n\nexport async function createPlaintext(data: CreatePlaintextPayload, ctx: CreatorFunctionContext) {\n return ctx.embed({\n id: data.url,\n type: \"Text\",\n label: data.label,\n format: \"text/plain\",\n });\n}\n\nexport function CreatePlaintextForm(props: CreatorContext) {\n const [label, setLabel] = useState<InternationalString>({\n en: [\"View as text\"],\n });\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.url) {\n props.runCreate({ url: formData.url, label });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <LanguageFieldEditor\n focusId={\"label\"}\n label={\"Label\"}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"id\">Link to plaintext</InputLabel>\n <Input id=\"url\" name=\"url\" defaultValue=\"\" />\n </InputContainer>\n\n <ActionButton primary large type=\"submit\">\n Create\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { defineCreator } from \"@manifest-editor/creator-api\";\nimport { TextFormatIcon } from \"@manifest-editor/ui/icons/TextFormatIcon\";\nimport { CreatePlaintextForm, createPlaintext } from \"./create-plaintext\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/plaintext-creator\": typeof plaintextCreator;\n }\n }\n}\n\nexport const plaintextCreator = defineCreator({\n id: \"@manifest-editor/plaintext-creator\",\n create: createPlaintext,\n label: \"Plaintext\",\n summary: \"Add link to an plaintext\",\n icon: <TextFormatIcon />,\n render(ctx) {\n return <CreatePlaintextForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"label\", \"format\"],\n supports: {\n parentFields: [\"seeAlso\", \"rendering\"],\n },\n staticFields: {\n format: \"text/plain\",\n },\n});\n","import {\n canonicalServiceUrl,\n createImageServiceRequest,\n imageServiceRequestToString,\n parseImageServiceRequest,\n} from \"@iiif/parser/image-3\";\nimport type { ImageService } from \"@iiif/presentation-3\";\nimport { normalizeImageService } from \"../image-service-options\";\n\nexport function serviceImageAtSize(service: ImageService, size: { width: number; height?: number }) {\n const request = createImageServiceRequest(normalizeImageService(service));\n return imageServiceRequestToString({\n identifier: request.identifier,\n server: request.server,\n scheme: request.scheme,\n type: \"image\",\n size: {\n max: false,\n confined: false,\n upscaled: false,\n width: size.width,\n height: size.height,\n },\n format: \"jpg\",\n // This isn't how it should be modelled, always full,\n // region: data.selector ? data.selector : { full: true },\n region: { full: true },\n rotation: { angle: 0 },\n quality: \"default\",\n prefix: request.prefix,\n originalPath: (request as any).originalPath,\n });\n}\n\nexport function getCanonicalUrl(url: string) {\n return url.endsWith(\"default.jpg\")\n ? imageServiceRequestToString({\n ...parseImageServiceRequest(url),\n type: \"info\",\n })\n : canonicalServiceUrl(url);\n}\n","import type { ImageService } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext, CreatorResource } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel } from \"@manifest-editor/editors\";\nimport { type FormEvent, useMemo, useState } from \"react\";\nimport { getCanonicalUrl, serviceImageAtSize } from \"./thumbnail-helpers\";\nimport { compactImageService, normalizeImageService } from \"../image-service-options\";\n\nexport interface CreateThumbnailPayload {\n service: ImageService;\n thumbnailUrl?: string;\n width: number;\n height?: number;\n}\n\nexport async function createThumbnail(data: CreateThumbnailPayload, ctx: CreatorFunctionContext) {\n // Here is where we can add a thumbnail, if appropriate.\n const service = normalizeImageService(data.service);\n const sizes = service.sizes;\n // Thumbnails retain available sizes/tiles regardless of the workspace's painting-image defaults.\n const embeddedService = compactImageService(service, ctx.config, true);\n\n if (data.thumbnailUrl) {\n return ctx.embed({\n id: data.thumbnailUrl,\n type: \"Image\",\n format: \"image/jpeg\",\n width: data.width,\n height: data.height,\n service: [embeddedService],\n });\n }\n\n if (sizes) {\n const thumbnailSize = data.width || 400;\n // We have something to work with for a thumbnail - could be improved to listen to height/width.\n let bestMatch: { width: number; height?: number } | null = null;\n for (const size of sizes) {\n if (!bestMatch || Math.abs(size.width - thumbnailSize) < Math.abs(bestMatch.width - thumbnailSize)) {\n bestMatch = { width: size.width, height: size.height };\n }\n }\n if (bestMatch) {\n const imageId = serviceImageAtSize(service, bestMatch);\n\n return ctx.embed({\n id: imageId,\n type: \"Image\",\n format: \"image/jpeg\",\n width: bestMatch.width,\n height: bestMatch.height,\n service: [embeddedService],\n });\n }\n }\n\n // Otherwise we have nothing..\n return null;\n}\n\n// @todo cover a lot more things - like offering size dropdown.\nexport function CreateThumbnailForm(props: CreatorContext) {\n const [url, setUrl] = useState(\"\");\n const [service, setService] = useState<ImageService | null>(null);\n const [selectedSize, setSelectedSize] = useState({ width: 0, height: 0 });\n const previewUrl = useMemo(() => {\n if (!service) return null;\n if (!selectedSize.width || !selectedSize.height) return null;\n\n return serviceImageAtSize(service, selectedSize);\n }, [selectedSize, service]);\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n const url = formData.url;\n\n if (url) {\n const info = getCanonicalUrl(url);\n\n if (!info) {\n throw new Error(\"Invalid image service request\");\n }\n\n fetch(info)\n .then((r) => r.json())\n .then((service) => {\n setService(service);\n const size0 = service.sizes?.[0];\n if (size0) {\n setSelectedSize(size0);\n }\n });\n }\n };\n\n // https://dlcs.digirati.io/iiif-img/58/2/20-carina_nebula~orig.png\n\n if (service) {\n return (\n <PaddedSidebarContainer>\n <div className=\"mb-4\">\n <div className=\"mb-2\">{service[\"@id\"] || service.id}</div>\n <div className=\"flex gap-2 mb-4\">\n {service.sizes?.map((size) => {\n const isSelected = size.width === selectedSize.width;\n return (\n <ActionButton\n key={size.width}\n primary={isSelected}\n isDisabled={isSelected}\n large\n onPress={() => setSelectedSize(size)}\n >\n {size.width}x{size.height}\n </ActionButton>\n );\n })}\n </div>\n\n {previewUrl ? <img src={previewUrl} alt=\"preview of selected resource\" /> : null}\n </div>\n\n <ActionButton\n primary\n large\n isDisabled={!previewUrl}\n onPress={() => {\n if (!service) return;\n props.runCreate({ service, width: selectedSize.width, height: selectedSize.height });\n }}\n >\n Add thumbnail\n </ActionButton>\n </PaddedSidebarContainer>\n );\n }\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <div className=\"flex gap-2 items-center\">\n <InputContainer $wide>\n <InputLabel htmlFor=\"url\">Link to image service</InputLabel>\n <Input\n id=\"url\"\n name=\"url\"\n defaultValue=\"\"\n onPaste={(e) => {\n const text = e.clipboardData.getData(\"text/plain\");\n setUrl(text ? getCanonicalUrl(text) : \"\");\n }}\n onBlur={(e) => setUrl(e.currentTarget.value ? getCanonicalUrl(e.currentTarget.value) : \"\")}\n />\n </InputContainer>\n </div>\n <div>\n <ActionButton primary large type=\"submit\" isDisabled={!url}>\n Select size\n </ActionButton>\n </div>\n </form>\n </PaddedSidebarContainer>\n );\n}\n\nfunction ImageSelectionPreview({ url }: { url: string }) {\n return null;\n}\n","import { ScaledImageIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { CreateThumbnailForm, createThumbnail } from \"./create-thumbnail\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/thumbnail-image\": typeof thumbnailCreator;\n }\n }\n}\n\nexport const thumbnailCreator = defineCreator({\n id: \"@manifest-editor/thumbnail-image\",\n configKey: \"iiif-image-services\",\n create: createThumbnail,\n label: \"Thumbnail from service\",\n summary: \"Add thumbnail from an image service\",\n icon: <ScaledImageIcon />,\n render(ctx) {\n return <CreateThumbnailForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"id\", \"type\", \"format\", \"width\", \"height\", \"service\"],\n supports: {\n parentFields: [\"thumbnail\"],\n },\n});\n","export function LinkIcon() {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\" />\n </svg>\n );\n}\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { type FormEvent, useState } from \"react\";\n\nexport interface CreateWebpagePayload {\n url: string;\n label?: InternationalString;\n}\n\nexport async function createWebPage(data: CreateWebpagePayload, ctx: CreatorFunctionContext) {\n return ctx.embed({\n id: data.url,\n type: \"Text\",\n label: data.label,\n format: \"text/html\",\n });\n}\n\nexport function CreateWebPageForm(props: CreatorContext) {\n const [label, setLabel] = useState<InternationalString>({ en: [\"\"] });\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.url) {\n props.runCreate({ url: formData.url, label });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <LanguageFieldEditor\n focusId={\"label\"}\n label={\"Label\"}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"id\">Link</InputLabel>\n <Input id=\"url\" name=\"url\" defaultValue=\"\" />\n </InputContainer>\n\n <ActionButton primary large type=\"submit\">\n Create link\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { defineCreator } from \"@manifest-editor/creator-api\";\nimport { LinkIcon } from \"@manifest-editor/ui/icons/LinkIcon\";\nimport { CreateWebPageForm, createWebPage } from \"./create-web-page\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/web-page-creator\": typeof webPageCreator;\n }\n }\n}\n\nexport const webPageCreator = defineCreator({\n id: \"@manifest-editor/web-page-creator\",\n create: createWebPage,\n label: \"Web page\",\n summary: \"Add link to an external web page\",\n icon: <LinkIcon />,\n render(ctx) {\n return <CreateWebPageForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"label\", \"format\"],\n supports: {\n parentFields: [\"seeAlso\", \"rendering\", \"homepage\"],\n },\n});\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel } from \"@manifest-editor/editors\";\nimport type { FormEvent } from \"react\";\n\nconst ytRegex = /^.*(?:(?:youtu\\.be\\/|v\\/|vi\\/|u\\/\\w\\/|embed\\/|shorts\\/)|(?:(?:watch)?\\?vi?=|&vi?=))([^#&?]*).*/;\n\nexport interface CreateYouTubeBodyPayload {\n youtubeUrl: string;\n label?: InternationalString;\n height?: number;\n width?: number;\n duration: number;\n}\n\nexport function getYouTubeId(url: string) {\n const id = (url || \"\").match(ytRegex);\n return id ? id[1] : null;\n}\n\nexport function validateYouTube(data: CreateYouTubeBodyPayload) {\n return !!getYouTubeId(data.youtubeUrl);\n}\n\nexport function createYoutubeBodyResource(data: CreateYouTubeBodyPayload, ctx: CreatorFunctionContext) {\n const id = getYouTubeId(data.youtubeUrl);\n return ctx.embed({\n id: `https://www.youtube.com/watch?v=${id}`,\n type: \"Video\",\n service: [\n {\n type: \"Service\",\n profile: \"http://digirati.com/objectifier\",\n params: {\n data: `https://www.youtube.com/embed/${id}`,\n },\n },\n {\n id: `https://www.youtube.com/watch?v=${id}`,\n type: \"Service\",\n profile: \"https://www.youtube.com\",\n },\n ],\n });\n}\n\nexport async function createYoutubeBody(data: CreateYouTubeBodyPayload, ctx: CreatorFunctionContext) {\n const body = createYoutubeBodyResource(data, ctx);\n\n if (ctx.options.targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotation = ctx.embed({\n id: ctx.generateId(\"annotation\", { id: pageId, type: \"AnnotationPage\" }),\n type: \"Annotation\",\n motivation: \"painting\",\n body: [body],\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotation],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled YouTube canvas\"] },\n height: data.height || 1000,\n width: data.width || 1000,\n duration: data.duration || 1,\n items: [page],\n });\n }\n\n if (ctx.options.targetType === \"Annotation\") {\n return ctx.embed({\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n motivation: \"painting\",\n body: [body],\n target: ctx.getTarget(),\n });\n }\n\n return body;\n}\n\nexport function YouTubeForm(props: CreatorContext) {\n const initialData = props.options.initialData as Partial<CreateYouTubeBodyPayload>;\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.youtubeUrl) {\n props.runCreate({ youtubeUrl: formData.youtubeUrl });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <InputContainer $wide>\n <InputLabel htmlFor=\"id\">Link to YouTube</InputLabel>\n <Input id=\"youtubeUrl\" name=\"youtubeUrl\" defaultValue={initialData.youtubeUrl || \"\"} />\n </InputContainer>\n\n <ActionButton primary large type=\"submit\">\n Create\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { YouTubeIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { YouTubeForm, createYoutubeBody, getYouTubeId } from \"./create-youtube-body\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/youtube\": typeof youTubeBodyCreator;\n }\n }\n}\n\nexport const youTubeBodyCreator = defineCreator({\n id: \"@manifest-editor/youtube\",\n create: createYoutubeBody,\n label: \"YouTube\",\n summary: \"Embed YouTube\",\n icon: <YouTubeIcon />,\n resourceType: \"ContentResource\",\n additionalTypes: [\"Canvas\", \"Annotation\"],\n resourceFields: [\"id\", \"type\", \"service\"],\n supportsResource(value) {\n return getYouTubeId(value) ? { initialData: { youtubeUrl: value } } : false;\n },\n render: (ctx) => <YouTubeForm {...ctx} />,\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"Annotation\", \"Manifest\", \"AnnotationPage\"],\n parentFieldMap: {\n Annotation: [\"body\"],\n Manifest: [\"items\"],\n AnnotationPage: [\"items\"],\n },\n },\n staticFields: {\n type: \"Video\",\n },\n});\n","import {\n type BoxSelector,\n createThumbnailHelper,\n normaliseContentState,\n parseContentState,\n} from \"@iiif/helpers\";\nimport type {\n CreatorFunctionContext,\n CreatorResource,\n} from \"@manifest-editor/creator-api\";\nimport type { Resource } from \"@manifest-editor/shell\";\nimport { lazy } from \"react\";\nimport invariant from \"tiny-invariant\";\n\nexport interface ManifestBrowserCreatorPayload {\n // This is the output (JSON) from the IIIF Browser.\n // We could have gone with \"IIIF Content State\" here and may do in the future, but this\n // will simplify parsing and importing resources.\n output: Array<{\n resource: any;\n parent: { id: string; type: string } | undefined;\n selector: BoxSelector | undefined;\n }>;\n}\n\nexport async function createFromManifestBrowserOutput(\n data: ManifestBrowserCreatorPayload,\n ctx: CreatorFunctionContext,\n) {\n const inputItems = data.output || [];\n const itemsToAdd: CreatorResource[] = [];\n\n for (const item of inputItems) {\n const { resource, parent, selector } = item;\n\n const previewVault = ctx.getPreviewVault();\n const thumbnails = createThumbnailHelper(previewVault);\n\n if (resource.type === \"Manifest\") {\n const manifestId = resource.id;\n invariant(manifestId, \"Could not find Manifest ID\");\n\n // 1st. Check the preview vault.\n const manifest = await previewVault.loadManifest(manifestId);\n const thumbnail = await thumbnails.getBestThumbnailAtSize(\n manifest,\n { width: 256, height: 256 },\n false,\n );\n\n invariant(manifest, \"Manifest not found\");\n itemsToAdd.push(\n ctx.embed({\n id: resource.id,\n type: \"Manifest\",\n label: manifest.label,\n summary: manifest.summary,\n thumbnail: thumbnail?.best\n ? [\n {\n id: thumbnail.best.id,\n type: \"Image\",\n },\n ]\n : undefined,\n }),\n );\n continue;\n }\n\n if (resource.type === \"Collection\") {\n const collectionId = resource.id;\n invariant(collectionId, \"Could not find Manifest ID\");\n const collection = await previewVault.loadManifest(collectionId);\n\n invariant(collection, \"Collection not found\");\n itemsToAdd.push(\n ctx.embed({\n id: resource.id,\n type: \"Collection\",\n label: collection.label,\n }),\n );\n }\n }\n\n return itemsToAdd;\n}\nexport const ManifestBrowserCreatorForm = lazy(\n () => import(\"./manifest-browser-form.lazy\"),\n);\n","import type { CreatorContext } from \"@manifest-editor/creator-api\";\nimport { PreviewVaultBoundary, usePreviewVault } from \"@manifest-editor/shell\";\nimport { IIIFBrowser, type IIIFBrowserProps } from \"iiif-browser\";\nimport { useMemo } from \"react\";\n\nexport interface ManifestBrowserCreatorInitialData {\n url?: string;\n iiifBrowserOptions?: Partial<IIIFBrowserProps>;\n}\n\nexport default function ManifestBrowserCreatorForm(props: CreatorContext) {\n const vault = usePreviewVault();\n const initialData: ManifestBrowserCreatorInitialData = useMemo(() => {\n return props.options.initialData || {};\n }, [props.options.initialData]);\n\n const output = useMemo(() => {\n return [\n {\n type: \"callback\",\n label: \"Select\",\n supportedTypes: [\n \"Manifest\",\n \"Collection\",\n \"ManifestList\",\n \"CollectionList\",\n \"CollectionItemList\",\n ],\n cb: (resource) => props.runCreate({ output: resource }),\n format: {\n type: \"custom\",\n format: (resource, parent, vault) => {\n const resourcesAsArray = Array.isArray(resource)\n ? resource\n : [{ ...resource, parent }];\n const resources = [];\n for (const resource of resourcesAsArray) {\n resources.push({\n resource: vault.get(resource),\n parent: resource.parent,\n selector: resource.selector,\n });\n }\n return resources;\n },\n },\n },\n ] as IIIFBrowserProps[\"output\"];\n }, [props.runCreate]);\n\n const navigationOptions = useMemo(() => {\n return {\n canCropImage: false,\n canSelectCanvas: false,\n canSelectManifest: true,\n canSelectCollection: true,\n multiSelect: true,\n ...(initialData.iiifBrowserOptions?.navigation || {}),\n };\n }, [initialData.iiifBrowserOptions?.navigation]);\n\n const uiOptions = useMemo(() => {\n return {\n buttonClassName: \"bg-me-primary-500 text-white hover:bg-me-primary-600\",\n homeLink:\n initialData.url ||\n (typeof props.config?.defaultCollection === \"string\" ? props.config.defaultCollection : undefined),\n ...(initialData.iiifBrowserOptions?.ui || {}),\n } as IIIFBrowserProps[\"ui\"];\n }, [initialData, props.config]);\n const historyOptions = useMemo(() => {\n const history = initialData.iiifBrowserOptions?.history || {};\n if (!initialData.url) return history;\n return {\n ...history,\n restoreFromLocalStorage: false,\n saveToLocalStorage: false,\n initialHistory: [\n {\n url: initialData.url,\n resource: null,\n route: `/loading?id=${encodeURIComponent(initialData.url)}`,\n },\n ],\n } as IIIFBrowserProps[\"history\"];\n }, [initialData]);\n\n return (\n <PreviewVaultBoundary>\n <IIIFBrowser\n ui={uiOptions}\n vault={vault}\n className=\"iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full\"\n output={output}\n navigation={navigationOptions}\n customPages={(initialData.iiifBrowserOptions?.customPages || {})}\n history={historyOptions}\n />\n </PreviewVaultBoundary>\n );\n}\n","import { IIIFBrowserIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getIIIFType, getJsonResource, isDigitalCollectionPage } from \"../../resource-probes\";\nimport { createFromManifestBrowserOutput } from \"./manifest-browser-creator\";\nimport ManifestBrowserCreatorForm from \"./manifest-browser-form.lazy\";\n\nexport type { ManifestBrowserCreatorPayload } from \"./manifest-browser-creator\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/manifest-browser-creator\": typeof manifestBrowserCreator;\n }\n }\n}\n\nexport const manifestBrowserCreator = defineCreator({\n id: \"@manifest-editor/manifest-browser-creator\",\n configKey: \"@manifest-editor/iiif-browser-creator\",\n create: createFromManifestBrowserOutput,\n label: \"IIIF Browser\",\n summary: \"Browse IIIF Resources\",\n icon: <IIIFBrowserIcon />,\n render(ctx: any) {\n return <ManifestBrowserCreatorForm {...ctx} />;\n },\n async supportsResource(value, helpers) {\n const resource = await getJsonResource(value, helpers);\n const type = getIIIFType(resource);\n if (type === \"Manifest\" || type === \"Collection\") {\n return { initialData: { url: value } };\n }\n if (await isDigitalCollectionPage(value)) {\n return { initialData: { url: value } };\n }\n return false;\n },\n resourceType: \"Manifest\",\n resourceFields: [\"id\", \"label\"],\n additionalTypes: [\"Collection\"],\n supports: {\n initialData: true,\n parentTypes: [\"Collection\", \"Manifest\", \"Canvas\"],\n parentFieldMap: {\n Collection: [\"items\"],\n Manifest: [\"partOf\"],\n Canvas: [\"partOf\"],\n },\n },\n sideEffects: [],\n staticFields: {},\n});\n","import type { InternationalString, Reference } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext, CreatorResource } from \"@manifest-editor/creator-api\";\nimport { LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { type FormEvent, useState } from \"react\";\n\nexport interface CreateRangeWithItemsPayload {\n type: \"Range\";\n label?: InternationalString | string;\n items?: Array<Reference<\"Canvas\"> | Reference<\"Range\">>;\n}\n\nexport async function createRangeWithItems(\n data: CreateRangeWithItemsPayload,\n ctx: CreatorFunctionContext,\n parentId?: string,\n): Promise<CreatorResource> {\n const rangeId = ctx.generateId(`range`, parentId ? { id: parentId, type: \"Range\" } : undefined);\n\n return ctx.embed({\n id: rangeId,\n type: \"Range\",\n label: data.label || { en: [\"Untitled range\"] },\n items: data.items || [],\n });\n}\n\nexport function RangeWithItemsCreatorForm(props: CreatorContext<CreateRangeWithItemsPayload>) {\n const [label, setLabel] = useState<InternationalString>({ en: [\"\"] });\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n\n if (label) {\n props.runCreate({ type: \"Range\", label });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <LanguageFieldEditor\n focusId={\"label\"}\n label={\"Label\"}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <ActionButton primary type=\"submit\">\n Create range\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { RangesIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { createRangeWithItems, RangeWithItemsCreatorForm } from \"./create-range-with-items\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/range-with-items\": typeof rangeWithItems;\n }\n }\n}\n\nexport const rangeWithItems = defineCreator({\n id: \"@manifest-editor/range-with-items\",\n create: createRangeWithItems,\n label: \"Range\",\n summary: \"Add a new range\",\n icon: <RangesIcon />,\n render(ctx) {\n return <RangeWithItemsCreatorForm {...ctx} />;\n },\n resourceType: \"Range\",\n resourceFields: [\"id\", \"label\", \"type\"],\n supports: {\n parentTypes: [\"Range\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Range\",\n },\n});\n","import type { InternationalString, Reference } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext, CreatorResource } from \"@manifest-editor/creator-api\";\nimport { LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { type FormEvent, useState } from \"react\";\n\nexport interface CreateTopLevelRangePayload {\n type: \"Range\";\n label?: InternationalString | string;\n items?: Array<Reference<\"Canvas\"> | Reference<\"Range\">>;\n}\n\nexport async function createRangeTopLevel(\n data: CreateTopLevelRangePayload,\n ctx: CreatorFunctionContext,\n parentId?: string,\n): Promise<CreatorResource> {\n const rangeId = ctx.generateId(`range`, parentId ? { id: parentId, type: \"Range\" } : undefined);\n\n return ctx.embed({\n id: rangeId,\n type: \"Range\",\n label: data.label || { en: [\"Table of Contents\"] },\n items: (data.items || []).map((item) => ctx.ref(item)),\n });\n}\n\nexport function TopLevelRangeCreatorForm(props: CreatorContext<CreateTopLevelRangePayload>) {\n const [label, setLabel] = useState<InternationalString>({ en: [\"\"] });\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n\n if (label) {\n props.runCreate({ type: \"Range\", label });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <LanguageFieldEditor\n focusId={\"label\"}\n label={\"Label\"}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <ActionButton primary type=\"submit\">\n Create range\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { RangesIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport {\n createRangeTopLevel,\n TopLevelRangeCreatorForm,\n} from \"./create-range-top-level\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/range-top-level\": typeof rangeTopLevel;\n }\n }\n}\n\nexport const rangeTopLevel = defineCreator({\n id: \"@manifest-editor/range-top-level\",\n create: createRangeTopLevel,\n label: \"Top Level Range\",\n summary: \"Add a new top level range\",\n icon: <RangesIcon />,\n render(ctx) {\n return <TopLevelRangeCreatorForm {...ctx} />;\n },\n resourceType: \"Range\",\n resourceFields: [\"id\", \"label\", \"type\"],\n supports: {\n parentTypes: [\"Manifest\"],\n parentFields: [\"structures\"],\n },\n staticFields: {\n type: \"Range\",\n },\n});\n","import \"./index.css\";\nimport { providerCreator } from \"./Agent/ProviderCreator\";\nimport { audioAnnotation } from \"./Annotation/AudioAnnotation\";\nimport { captionedImageAnnotation } from \"./Annotation/CaptionedImageAnnotation\";\nimport { htmlAnnotation } from \"./Annotation/HTMLAnnotation\";\nimport { imageServiceAnnotation } from \"./Annotation/ImageServiceAnnotation\";\nimport { imageUrlAnnotation } from \"./Annotation/ImageUrlAnnotation\";\nimport { imageUrlListAnnotation } from \"./Annotation/ImageUrlListAnnotation\";\nimport { noBodyAnnotation } from \"./Annotation/NoBodyAnnotation\";\nimport { videoAnnotation } from \"./Annotation/VideoAnnotation\";\nimport { emptyAnnotationPage } from \"./AnnotationPage/EmptyAnnotationPage\";\nimport { emptyCanvas } from \"./Canvas/EmptyCanvas\";\nimport { internalCanvas } from \"./Canvas/InternalCanvas\";\nimport { htmlBodyCreator } from \"./ContentResource/HTMLBodyCreator\";\nimport { iiifBrowserCreator } from \"./ContentResource/IIIFBrowserCreator\";\nimport { imageServiceCreator } from \"./ContentResource/ImageServiceCreator\";\nimport { imageUrlCreator } from \"./ContentResource/ImageUrlCreator\";\nimport { imageUrlListCreator } from \"./ContentResource/ImageUrlListCreator\";\nimport { plaintextCreator } from \"./ContentResource/PlaintextCreator\";\nimport { thumbnailCreator } from \"./ContentResource/ThumbnailCreator\";\nimport { webPageCreator } from \"./ContentResource/WebPageCreator\";\nimport { youTubeBodyCreator } from \"./ContentResource/YouTubeCreator\";\nimport { manifestBrowserCreator } from \"./Manifest/ManifestBrowserCreator\";\nimport { rangeWithItems } from \"./Range/RangeWithItems\";\nimport { rangeTopLevel } from \"./Range/TopLevelRangeCreator\";\n\nexport * from \"./Agent/ProviderCreator/create-provider\";\nexport * from \"./Annotation/AudioAnnotation/create-audio-annotation\";\nexport * from \"./Annotation/CaptionedImageAnnotation/create-captioned-image-annotation\";\nexport * from \"./Annotation/HTMLAnnotation/create-html-annotation\";\nexport * from \"./Annotation/ImageServiceAnnotation/create-service-annotation\";\nexport * from \"./Annotation/ImageUrlAnnotation/create-image-url-annotation\";\nexport * from \"./Annotation/ImageUrlListAnnotation/create-image-url-list-annotation\";\nexport * from \"./Annotation/NoBodyAnnotation/index\";\nexport * from \"./Annotation/VideoAnnotation/create-video-annotation\";\nexport * from \"./Canvas/InternalCanvas/index\";\nexport * from \"./ContentResource/HTMLBodyCreator/create-html-body\";\nexport * from \"./ContentResource/IIIFBrowserCreator/iiif-browser-creator\";\nexport * from \"./ContentResource/ImageServiceCreator/create-image-service\";\nexport * from \"./ContentResource/ImageUrlCreator/create-image-url\";\nexport * from \"./ContentResource/ImageUrlListCreator/create-image-url-list\";\nexport * from \"./ContentResource/PlaintextCreator/create-plaintext\";\nexport * from \"./ContentResource/ThumbnailCreator/create-thumbnail\";\nexport * from \"./ContentResource/WebPageCreator/create-web-page\";\nexport * from \"./ContentResource/YouTubeCreator/create-youtube-body\";\nexport * from \"./Manifest/ManifestBrowserCreator/manifest-browser-creator\";\nexport * from \"./Range/RangeWithItems/create-range-with-items\";\nexport * from \"./Range/TopLevelRangeCreator/create-range-top-level\";\n\nexport const allCreators = [\n // Images first.\n imageServiceCreator,\n imageServiceAnnotation,\n imageUrlCreator,\n imageUrlAnnotation,\n videoAnnotation,\n audioAnnotation,\n htmlBodyCreator,\n htmlAnnotation,\n youTubeBodyCreator,\n iiifBrowserCreator,\n emptyCanvas,\n plaintextCreator,\n webPageCreator,\n emptyAnnotationPage,\n noBodyAnnotation,\n internalCanvas,\n captionedImageAnnotation,\n imageUrlListCreator,\n imageUrlListAnnotation,\n thumbnailCreator,\n rangeTopLevel,\n rangeWithItems,\n providerCreator,\n];\n\nexport {\n emptyCanvas,\n plaintextCreator,\n webPageCreator,\n htmlBodyCreator,\n htmlAnnotation,\n emptyAnnotationPage,\n youTubeBodyCreator,\n imageUrlCreator,\n imageServiceCreator,\n imageServiceAnnotation,\n // noBodyAnnotation,\n iiifBrowserCreator,\n imageUrlAnnotation,\n audioAnnotation,\n videoAnnotation,\n captionedImageAnnotation,\n imageUrlListCreator,\n imageUrlListAnnotation,\n rangeTopLevel,\n rangeWithItems,\n // Not included\n manifestBrowserCreator,\n providerCreator,\n};\n"],"x_google_ignoreList":[16,37],"mappings":"kuCAeA,eAAsB,GAAe,EAA6B,EAA6B,CAC7F,IAAM,EAAW,CACf,GAAI,EAAK,KAAO,EAAI,WAAW,UAAU,EACzC,MAAO,EAAK,MACZ,KAAM,QACN,SAAU,CAAC,EACX,KAAM,CAAC,CACT,EAuBA,OArBI,EAAK,WACP,EAAS,SAAW,CAClB,EAAI,MAAM,CACR,GAAI,EAAK,IACT,OAAA,EAAOA,EAAAA,SAAAA,CAAS,EAAK,aAAa,EAAI,EAAK,cAAgB,CAAE,GAAI,CAAC,UAAU,CAAE,EAC9E,KAAM,OACN,OAAQ,YACR,SAAU,CAAC,IAAI,CACjB,CAAC,CACH,GAGE,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AO,IAAA,EAAYC,EAAAA,SAAAA,CAA8B,CAAE,GAAI,CAAC,EAAE,CAAE,CAAC,EAUpE,OACE,EAAA,EAAA,IAAA,CAACC,EAAAA,uBAAD,CAAA,UACE,EAAA,EAAA,KAAA,CAAC,OAAD,CAAgB,SAVF,GAAiB,CACjC,EAAE,eAAe,EAEb,GACF,EAAM,UAAU,CAAE,KAAM,QAAS,OAAM,CAAC,CAE5C,EAII,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,oBAAD,CACE,QAAS,QACT,MAAO,QACP,OAAQ,EACR,OAAS,GAAW,EAAS,EAAE,sBAAsB,CAAC,CACvD,CAAA,GAED,EAAA,EAAA,IAAA,CAACC,EAAAA,aAAD,CAAc,QAAA,GAAQ,KAAK,SAAS,SAAA,cAEtB,CAAA,CACV,CACgB,CAAA,CAAA,CAAA,CAE5B,CCvCA,MAAa,GAAA,EAAgBC,EAAAA,cAAAA,CAAc,CACzC,GAAI,mCACJ,OAAQ,GACR,MAAO,kBACP,QAAS,4BACT,MAAM,EAAA,EAAA,IAAA,CAACC,EAAAA,WAAD,CAAa,CAAA,EACnB,OAAO,EAAK,CACV,OAAO,EAAA,EAAA,IAAA,CAAC,GAAD,CAA0B,GAAI,CAAM,CAAA,CAC7C,EACA,aAAc,QACd,eAAgB,CAAC,KAAM,QAAS,MAAM,EACtC,SAAU,CACR,YAAa,CAAC,UAAU,EACxB,aAAc,CAAC,YAAY,CAC7B,EACA,aAAc,CACZ,KAAM,OACR,CACF,CAAC,ECgBY,GAAc,CAEzB,EACA,GACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACA,GACA,EACF"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["getValue","useTranslations","useState","PaddedSidebarContainer","LanguageFieldEditor","InputContainer","InputLabel","Input","ActionButton","defineCreator","isImageService","isSupportedDigitalCollectionPage","useTranslations","useId","useRef","useState","useMediaElements","useMediaState","useMediaActions","formatTime","getValue","useTranslations","useState","PaddedSidebarContainer","ErrorMessage","InputContainer","InputLabel","Input","LanguageFieldEditor","CanvasPanel","FormFieldWrapper","ActionButton","defineCreator","AudioIcon","useState","createImageServiceRequest","imageServiceRequestToString","parseImageServiceRequest","canonicalServiceUrl","useTranslations","useState","PaddedSidebarContainer","InputContainer","InputLabel","Input","ErrorBoundary","ActionButton","useImage","getImageDimensions","getFormat","useTranslations","PaddedSidebarContainer","InputContainer","InputLabel","Input","ActionButton","defineCreator","AddImageIcon","isImageService","useTranslations","useAnnotationCreatorState","useId","InputLabel","Input","ActionButton","defineCreator","AddImageIcon","useTranslations","useAnnotationCreatorState","getValue","HTMLEditor","ActionButton","defineCreator","HTMLIcon","isImageService","EditorInstance","centerRectangles","EditorInstance","isImageService","creatorHelper","defineCreator","IIIFLogo","isImageService","defineCreator","IIIFLogo","creatorHelper","defineCreator","AddImageIcon","creatorHelper","useTranslations","PaddedSidebarContainer","Form","ActionButton","creatorHelper","defineCreator","ImageListIcon","defineCreator","EmptyCanvasIcon","useSimpleMediaPlayer","MediaPlayerProvider","CanvasPanel","getValue","useTranslations","useState","PaddedSidebarContainer","ErrorMessage","InputContainer","InputLabel","Input","LanguageFieldEditor","DimensionsTriplet","ActionButton","defineCreator","VideoIcon","defineCreator","getValue","useTranslations","useState","PaddedSidebarContainer","InputContainer","InputLabel","Input","LanguageFieldEditor","ActionButton","defineCreator","canvasHasAv","defineCreator","canvasLayouts","CANVAS_LAYOUT_META","createCanvasLayoutState","CanvasLayoutForm","EmptyCanvasIcon","defineCreator","useTranslations","useNotebookBrowserPlugins","useRef","useManifest","useVault","useMemo","VaultProvider","LocalizedIIIFBrowser","useTranslations","useConfig","useState","PaddedSidebarContainer","HTMLEditor","ActionButton","defineCreator","TextIcon","Vault","isImageService","canonicalServiceUrl","browserTransformDimensions","browserImageApiSelector","getImageServices","lazy","isImageService","defineCreator","IIIFBrowserIcon","defineCreator","ImageListIcon","useTranslations","useState","PaddedSidebarContainer","LanguageFieldEditor","InputContainer","InputLabel","Input","ActionButton","defineCreator","createImageServiceRequest","imageServiceRequestToString","getCanonicalUrl","parseImageServiceRequest","canonicalServiceUrl","useTranslations","useEditorI18n","useState","useMemo","getCanonicalUrl","PaddedSidebarContainer","ActionButton","InputContainer","InputLabel","Input","defineCreator","ScaledImageIcon","useTranslations","useState","PaddedSidebarContainer","LanguageFieldEditor","InputContainer","InputLabel","Input","ActionButton","defineCreator","useTranslations","PaddedSidebarContainer","InputContainer","InputLabel","Input","ActionButton","defineCreator","YouTubeIcon","createThumbnailHelper","lazy","ManifestBrowserCreatorForm","useTranslations","useEditorI18n","useNotebookBrowserPlugins","usePreviewVault","useMemo","useRef","PreviewVaultBoundary","LocalizedIIIFBrowser","defineCreator","IIIFBrowserIcon","ManifestBrowserCreatorForm","useTranslations","useState","PaddedSidebarContainer","LanguageFieldEditor","ActionButton","defineCreator","RangesIcon","useTranslations","useState","PaddedSidebarContainer","LanguageFieldEditor","ActionButton","defineCreator","RangesIcon"],"sources":["../src/Agent/ProviderCreator/create-provider.tsx","../src/Agent/ProviderCreator/index.tsx","../src/resource-probes.ts","../../ui/ui/MediaControls/MediaControls.icons.tsx","../../ui/ui/MediaControls/MediaControls.styles.ts","../../ui/madoc/components/icons/Spinner.tsx","../../ui/atoms/VisuallHidden/VisuallHidden.tsx","../../ui/ui/MediaControls/MediaControls.tsx","../src/Annotation/AudioAnnotation/create-audio-annotation.tsx","../src/Annotation/AudioAnnotation/index.tsx","../src/use-service-request.ts","../src/ContentResource/image-service-options.ts","../src/ContentResource/ImageServiceCreator/create-image-service.tsx","../src/ContentResource/ImageUrlCreator/create-image-url.tsx","../src/ContentResource/ImageUrlCreator/index.tsx","../src/Annotation/CaptionedImageAnnotation/create-captioned-image-annotation.tsx","../src/Annotation/CaptionedImageAnnotation/index.tsx","../src/Annotation/HTMLAnnotation/create-html-annotation.tsx","../src/Annotation/HTMLAnnotation/index.tsx","../src/side-effects/reposition-multiple-images.ts","../src/side-effects/resize-resource-to-empty-canvas.ts","../../../node_modules/.pnpm/@atlas-viewer+iiif-image-api@2.2.0/node_modules/@atlas-viewer/iiif-image-api/dist/index.js","../src/side-effects/resize-to-fit-service.ts","../src/Annotation/ImageServiceAnnotation/create-service-annotation.tsx","../src/ContentResource/ImageServiceCreator/index.tsx","../src/Annotation/ImageServiceAnnotation/index.tsx","../src/Annotation/ImageUrlAnnotation/create-image-url-annotation.tsx","../src/Annotation/ImageUrlAnnotation/index.tsx","../src/ContentResource/ImageUrlListCreator/create-image-url-list.tsx","../src/Annotation/ImageUrlListAnnotation/create-image-url-list-annotation.tsx","../src/Annotation/ImageUrlListAnnotation/index.tsx","../src/Annotation/NoBodyAnnotation/index.tsx","../../ui/ui/VideoPlayer/VideoPlayer.tsx","../src/Annotation/VideoAnnotation/create-video-annotation.tsx","../src/Annotation/VideoAnnotation/index.tsx","../../ui/icons/ThumbnailStripIcon.tsx","../src/AnnotationPage/EmptyAnnotationPage/index.tsx","../src/validation-messages.ts","../../ui/icons/TextFormatIcon.tsx","../src/AnnotationPage/VttAnnotationPage/create-vtt-annotation-page.tsx","../src/AnnotationPage/VttAnnotationPage/index.tsx","../src/Canvas/EmptyCanvas/index.tsx","../../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../src/Canvas/InternalCanvas/index.tsx","../src/ContentResource/HTMLBodyCreator/create-html-body.tsx","../src/ContentResource/HTMLBodyCreator/index.tsx","../src/ContentResource/IIIFBrowserCreator/iiif-browser-creator.tsx","../src/side-effects/update-canvas-thumbnail-from-crop.ts","../src/ContentResource/IIIFBrowserCreator/index.tsx","../src/ContentResource/ImageUrlListCreator/index.tsx","../src/ContentResource/PlaintextCreator/create-plaintext.tsx","../src/ContentResource/PlaintextCreator/index.tsx","../src/ContentResource/ThumbnailCreator/thumbnail-helpers.ts","../src/ContentResource/ThumbnailCreator/create-thumbnail.tsx","../src/ContentResource/ThumbnailCreator/index.tsx","../../ui/icons/LinkIcon.tsx","../src/ContentResource/WebPageCreator/create-web-page.tsx","../src/ContentResource/WebPageCreator/index.tsx","../src/ContentResource/YouTubeCreator/create-youtube-body.tsx","../src/ContentResource/YouTubeCreator/index.tsx","../src/Manifest/ManifestBrowserCreator/manifest-browser-creator.tsx","../src/Manifest/ManifestBrowserCreator/manifest-browser-form.lazy.tsx","../src/Manifest/ManifestBrowserCreator/index.tsx","../src/Range/RangeWithItems/create-range-with-items.tsx","../src/Range/RangeWithItems/index.tsx","../src/Range/TopLevelRangeCreator/create-range-top-level.tsx","../src/Range/TopLevelRangeCreator/index.tsx","../src/index.ts"],"sourcesContent":["import { useTranslations } from \"@manifest-editor/i18n\";\nimport { getValue } from \"@iiif/helpers\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { useState } from \"react\";\n\nexport interface CreateProviderPayload {\n url: string;\n label: InternationalString;\n homepage?: string;\n homepageLabel?: InternationalString;\n logo?: string;\n}\n\nexport async function createProvider(data: CreateProviderPayload, ctx: CreatorFunctionContext) {\n const provider = {\n id: data.url || ctx.generateId(\"provider\"),\n label: data.label,\n type: \"Agent\",\n homepage: [] as any[],\n logo: [] as any[],\n };\n\n if (data.homepage) {\n provider.homepage = [\n ctx.embed({\n id: data.url,\n label: getValue(data.homepageLabel) ? data.homepageLabel : { en: [\"Homepage\"] },\n type: \"Text\",\n format: \"text/html\",\n language: [\"en\"],\n }),\n ];\n }\n\n if (data.logo) {\n provider.logo = [\n ctx.embed({\n id: data.logo,\n type: \"Image\",\n }),\n ];\n }\n\n return ctx.embed(provider);\n}\n\nexport function CreateProviderForm(props: CreatorContext<CreateProviderPayload>) {\n const property = useTranslations(\"editor-api\");\n const t = useTranslations(\"creators\");\n const initialData = props.options.initialData as Partial<CreateProviderPayload>;\n const [url, setUrl] = useState(initialData.url || \"\");\n const [label, setLabel] = useState(initialData.label || ({ en: [\"\"] } as InternationalString));\n const [homepage, setHomepage] = useState(initialData.homepage || \"\");\n const [logo, setLogo] = useState(initialData.logo || \"\");\n const [homepageLabel, setHomepageLabel] = useState(\n initialData.homepageLabel || ({ en: [\"\"] } as InternationalString)\n );\n\n const onSubmit = () => {\n props.runCreate({\n url,\n label,\n homepage,\n homepageLabel,\n logo,\n });\n };\n\n return (\n <PaddedSidebarContainer>\n <div className=\"max-w-xl\">\n <LanguageFieldEditor\n containerId={\"label\"}\n focusId={\"label_\"}\n label={property(\"fields.label\")}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <InputContainer $fluid>\n <InputLabel htmlFor=\"provider-logo\">{property(\"fields.logo\")}</InputLabel>\n <Input\n placeholder=\"https://example.org/logo.png\"\n type=\"text\"\n id=\"provider-logo\"\n value={logo}\n onChange={(e) => setLogo(e.target.value)}\n />\n </InputContainer>\n\n <InputContainer $fluid>\n <InputLabel htmlFor=\"provider-homepage\">{property(\"fields.homepage\")}</InputLabel>\n <Input\n placeholder=\"https://example.org/homepage\"\n type=\"text\"\n id=\"provider-homepage\"\n value={homepage}\n onChange={(e) => setHomepage(e.target.value)}\n />\n </InputContainer>\n\n {homepage ? (\n <div>\n <LanguageFieldEditor\n containerId={\"homepageLabel\"}\n focusId={\"homepageLabel_\"}\n label={t(\"form.homepageLabel\")}\n fields={homepageLabel}\n onSave={(e: any) => setHomepageLabel(e.toInternationalString())}\n />\n </div>\n ) : null}\n\n <InputContainer $fluid>\n <InputLabel $margin={false} htmlFor=\"provider-url\">\n {t(\"form.providerId\")}\n </InputLabel>\n <span className=\"text-gray-500 text-sm mb-2\">{t(\"form.providerIdHelp\")}</span>\n <Input\n placeholder=\"https://id.loc.gov/authorities/abc123\"\n type=\"text\"\n id=\"provider-url\"\n value={url}\n onChange={(e) => setUrl(e.target.value)}\n />\n </InputContainer>\n\n <ActionButton primary large type=\"button\" onPress={onSubmit}>\n {t(\"form.addProvider\")}\n </ActionButton>\n </div>\n </PaddedSidebarContainer>\n );\n}\n","import { defineCreator } from \"@manifest-editor/creator-api\";\nimport { CreateProviderForm, createProvider } from \"./create-provider\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/provider\": typeof createProvider;\n }\n }\n}\n\nexport const providerCreator = defineCreator({\n id: \"@manifest-editor/provider\",\n label: \"Provider\",\n labelMessage: { namespace: \"editor-api\", key: \"fields.provider\" },\n icon: (\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\">\n <path d=\"m3 9 9-6 9 6H3ZM3 21h18M5 10v8m5-8v8m4-8v8m5-8v8\" />\n </svg>\n ),\n summary: \"Add the organisation responsible for providing this resource.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.provider.summary\" },\n resourceType: \"Agent\",\n resourceFields: [\"id\", \"type\", \"label\"],\n supports: {\n parentTypes: [\"Manifest\", \"Collection\"],\n parentFields: [\"provider\"],\n initialData: true,\n },\n create: createProvider,\n render(ctx) {\n return <CreateProviderForm {...ctx} />;\n },\n});\n","import type { CreatorResourceProbeHelpers } from \"@manifest-editor/creator-api\";\nimport { isSupportedDigitalCollectionPage } from \"iiif-browser/digital-collections\";\n\nexport function isHttpUrl(value: string) {\n try {\n const url = new URL(value);\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n } catch {\n return false;\n }\n}\n\nexport async function getJsonResource(value: string, helpers: CreatorResourceProbeHelpers) {\n if (!isHttpUrl(value)) return null;\n try {\n return await helpers.json(value);\n } catch {\n return null;\n }\n}\n\nexport function getIIIFType(resource: any) {\n const type = resource?.type || resource?.[\"@type\"];\n if (type === \"sc:Manifest\") return \"Manifest\";\n if (type === \"sc:Collection\") return \"Collection\";\n return type;\n}\n\nexport function isImageService(resource: any) {\n const type = getIIIFType(resource);\n return (\n resource?.protocol === \"http://iiif.io/api/image\" ||\n type === \"ImageService\" ||\n (typeof type === \"string\" && type.startsWith(\"ImageService\"))\n );\n}\n\nexport async function isDigitalCollectionPage(value: string) {\n return isHttpUrl(value) && (await isSupportedDigitalCollectionPage(value));\n}\n\nexport async function getContentType(value: string, helpers: CreatorResourceProbeHelpers) {\n try {\n return await helpers.contentType(value);\n } catch {\n return \"\";\n }\n}\n\nexport function matchesExtension(value: string, extensions: string[]) {\n const pathname = new URL(value).pathname.toLowerCase();\n return extensions.some((extension) => pathname.endsWith(extension));\n}\n","import { SVGProps } from \"react\";\n\nexport const PlayIcon = (props: SVGProps<SVGSVGElement> & { title: string }) => (\n <svg {...props} viewBox=\"4 4 16 16\" xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\">\n {props.title ? <title>{props.title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M8 5v14l11-7z\" fill=\"currentColor\" />\n </svg>\n);\n\nexport const PauseIcon = (props: SVGProps<SVGSVGElement> & { title?: string }) => (\n <svg {...props} viewBox=\"4 4 16 16\" xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\">\n {props.title ? <title>{props.title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path fill=\"currentColor\" d=\"M6 19h4V5H6v14zm8-14v14h4V5h-4z\" />\n </svg>\n);\n\nexport const VolumeUpIcon = ({ title, ...props }: SVGProps<SVGSVGElement> & { title?: string }) => (\n <svg {...props} xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\" viewBox=\"2 2 20 20\">\n {title ? <title>{title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n fill=\"currentColor\"\n d=\"M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z\"\n />\n </svg>\n);\n\nexport const VolumeDownIcon = ({ title, ...props }: SVGProps<SVGSVGElement> & { title?: string }) => (\n <svg {...props} xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\" viewBox=\"2 2 20 20\">\n {title ? <title>{title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n fill=\"currentColor\"\n d=\"M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z\"\n />\n </svg>\n);\n\nexport const VolumeOffIcon = ({ title, ...props }: SVGProps<SVGSVGElement> & { title?: string }) => (\n <svg {...props} xmlns=\"http://www.w3.org/2000/svg\" height=\"1em\" width=\"1em\" viewBox=\"2 2 20 20\">\n {title ? <title>{title}</title> : null}\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n fill=\"currentColor\"\n d=\"M16.5 12A4.5 4.5 0 0 0 14 7.97v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51A8.796 8.796 0 0 0 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06a8.99 8.99 0 0 0 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4 9.91 6.09 12 8.18V4z\"\n />\n </svg>\n);\n","import styled, { css } from \"styled-components\";\n\nexport const AudioPlayerContainer = styled.div`\n background: #ededed; // Not in variable.\n display: flex;\n padding: 0.5em;\n align-items: center;\n`;\n\nconst BaseButton = styled.button`\n cursor: pointer;\n padding: 0.75em 1.5em;\n font-size: 0.938em;\n background: none;\n color: inherit;\n border: none;\n text-decoration: none;\n display: inline-block;\n vertical-align: top;\n white-space: nowrap;\n`;\n\nexport const PlayButton = styled(BaseButton)`\n width: 2em;\n height: 2em;\n overflow: hidden;\n font-size: 1.1em;\n background: #fff;\n border-radius: 3px;\n padding: 0;\n margin: 0;\n color: #000; // Not in colours\n\n &:disabled {\n color: #999;\n }\n`;\n\nexport const TimeDisplay = styled.div`\n margin: 0 1em;\n font-size: 0.85em;\n color: #000;\n`;\n\nexport const ProgressContainer = styled.div`\n flex: 1 1 0px;\n height: 6px;\n display: flex;\n position: relative;\n padding: 15px 0;\n`;\n\nexport const ProgressCurrent = styled.div`\n background: #d85680;\n height: 6px;\n pointer-events: none;\n position: absolute;\n top: 13px;\n left: 0;\n border-radius: 3px;\n transition: width 200ms;\n`;\n\nexport const ProgressBackground = styled.div`\n position: absolute;\n top: 13px;\n left: 0;\n height: 6px;\n border-radius: 3px;\n width: 100%;\n pointer-events: none;\n background: #fff;\n`;\n\nexport const SoundButton = styled(BaseButton)`\n width: 2em;\n height: 2em;\n overflow: hidden;\n font-size: 1.1em;\n background: transparent;\n border-radius: 3px;\n padding: 0;\n margin: 0;\n`;\n\nexport const SoundContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const VolumeContainer = styled.div<{ $isOpen: boolean }>`\n width: 0;\n overflow: hidden;\n transition: width 500ms;\n color: #4a473f; // Not in colours\n\n ${(props) =>\n props.$isOpen &&\n css`\n width: 150px;\n `}\n`;\n\nexport const VolumeSlider = styled.input.attrs({ type: \"range\" })`\n width: 120px;\n margin: 0 15px;\n`;\n","import type * as React from \"react\";\n\nexport function Spinner(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 42 42\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n {...props}\n >\n <g transform=\"translate(2 2)\" strokeWidth={5} fill=\"none\" fillRule=\"evenodd\">\n <circle strokeOpacity={0.5} cx={18} cy={18} r={18} />\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 18 18\"\n to=\"360 18 18\"\n dur=\"1s\"\n repeatCount=\"indefinite\"\n />\n </path>\n </g>\n </svg>\n );\n}\n","import styled, { css } from \"styled-components\";\n\nexport const visuallyHidden = css`\n clip: rect(1px, 1px, 1px, 1px);\n clip-path: inset(50%);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n`;\n\nexport const VisuallyHiddenLabel = styled.label`\n ${visuallyHidden}\n`;\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport { formatTime, useMediaActions, useMediaElements, useMediaState } from \"react-iiif-vault\";\nimport { useId, useLayoutEffect, useRef, useState } from \"react\";\nimport { PauseIcon, PlayIcon, VolumeDownIcon, VolumeOffIcon, VolumeUpIcon } from \"./MediaControls.icons\";\nimport {\n AudioPlayerContainer,\n PlayButton,\n ProgressBackground,\n ProgressContainer,\n TimeDisplay,\n ProgressCurrent,\n SoundContainer,\n VolumeContainer,\n SoundButton,\n VolumeSlider,\n} from \"./MediaControls.styles\";\nimport { Spinner } from \"../../madoc/components/icons/Spinner\";\nimport { VisuallyHiddenLabel } from \"../../atoms/VisuallHidden/VisuallHidden\";\n\nexport function MediaControls(props: {\n onDimensions?: (width: number, height: number) => void;\n onError?: (error: string) => void;\n onDuration?: (duration: number) => void;\n}) {\n const t = useTranslations(\"ui\");\n const sliderId = useId();\n const callbacks = useRef(props);\n callbacks.current = props;\n const translate = useRef(t);\n translate.current = t;\n const [isVolumeOpen, setIsVolumeOpen] = useState(false);\n const { progress, currentTime, element } = useMediaElements();\n const { duration, isMuted, volume, isPlaying, playRequested } = useMediaState();\n const { setVolume, toggleMute, play, pause, setDurationPercent } = useMediaActions();\n\n // Volume Icon to use.\n const Volume = isMuted || volume === 0 ? VolumeOffIcon : volume > 50 ? VolumeUpIcon : VolumeDownIcon;\n\n useLayoutEffect(() => {\n if (element.current) {\n const $el = element.current;\n if ($el.error && callbacks.current.onError) {\n callbacks.current.onError($el.error?.message || translate.current(\"media.unknownError\"));\n return;\n }\n const onError = () => {\n if (callbacks.current.onError) {\n callbacks.current.onError($el.error?.message || translate.current(\"media.unknownError\"));\n }\n };\n const loadedMetadata = () => {\n if ($el.duration && callbacks.current.onDuration) {\n callbacks.current.onDuration($el.duration);\n }\n if (callbacks.current.onDimensions && $el instanceof HTMLVideoElement) {\n callbacks.current.onDimensions($el.videoWidth, $el.videoHeight);\n }\n };\n $el.addEventListener(\"loadedmetadata\", loadedMetadata);\n $el.addEventListener(\"error\", onError);\n return () => {\n $el.removeEventListener(\"loadedmetadata\", loadedMetadata);\n $el.removeEventListener(\"error\", onError);\n };\n }\n }, [element]);\n\n return (\n <AudioPlayerContainer>\n <PlayButton\n aria-label={playRequested ? t(\"loading.title\") : isPlaying ? t(\"media.pause\") : t(\"media.play\")}\n disabled={playRequested}\n onClick={() => {\n if (isPlaying) {\n pause();\n } else {\n play();\n }\n }}\n >\n {playRequested ? (\n <Spinner stroke=\"#999\" />\n ) : isPlaying ? (\n <PauseIcon title={t(\"media.pause\")} />\n ) : (\n <PlayIcon title={t(\"media.play\")} />\n )}\n </PlayButton>\n <TimeDisplay ref={currentTime}>0:00</TimeDisplay>\n <ProgressContainer\n aria-label={t(\"media.seek\")}\n title={t(\"media.seek\")}\n onClick={(e) => {\n const { left, width } = e.currentTarget.getBoundingClientRect();\n const percent = (e.pageX - left) / width;\n setDurationPercent(percent);\n }}\n >\n <ProgressBackground />\n {duration ? <ProgressCurrent ref={progress} /> : null}\n </ProgressContainer>\n <TimeDisplay>{formatTime(duration)}</TimeDisplay>\n <SoundContainer onMouseEnter={() => setIsVolumeOpen(true)} onMouseLeave={() => setIsVolumeOpen(false)}>\n <VolumeContainer $isOpen={isVolumeOpen}>\n <span>\n <VisuallyHiddenLabel htmlFor={sliderId}>{t(\"media.changeVolume\")}</VisuallyHiddenLabel>\n <VolumeSlider\n id={sliderId}\n disabled={isMuted}\n min=\"0\"\n max=\"100\"\n value={volume}\n onChange={(e) => setVolume(Number(e.currentTarget.value))}\n />\n </span>\n </VolumeContainer>\n <SoundButton aria-label={isMuted ? t(\"media.unmute\") : t(\"media.mute\")} onClick={() => toggleMute()}>\n <Volume title={isMuted ? t(\"media.unmute\") : t(\"media.mute\")} />\n </SoundButton>\n </SoundContainer>\n </AudioPlayerContainer>\n );\n}\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport { getValue } from \"@iiif/helpers\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, ErrorMessage, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { FormFieldWrapper, Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { MediaControls } from \"@manifest-editor/ui/MediaControls\";\nimport { useEffect, useState } from \"react\";\nimport { CanvasPanel } from \"react-iiif-vault\";\n\nexport interface CreateAudioAnnotationPayload {\n label?: InternationalString;\n motivation?: string;\n duration?: number;\n url: string;\n}\n\nexport async function createAudioAnnotation(data: CreateAudioAnnotationPayload, ctx: CreatorFunctionContext) {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const body = ctx.embed({\n id: data.url,\n type: \"Sound\",\n format: \"audio/mp4\",\n duration: data.duration || 0,\n });\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n label: getValue(data.label) && data.label,\n motivation: data.motivation || ctx.options.initialData?.motivation || \"painting\",\n body,\n target: ctx.getTarget(),\n });\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body,\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled HTML canvas\"] },\n duration: data.duration || 0,\n items: [page],\n });\n }\n}\n\nexport function CreateAudioAnnotationForm(props: CreatorContext<CreateAudioAnnotationPayload>) {\n const property = useTranslations(\"editor-api\");\n const t = useTranslations(\"creators\");\n const [initialData] = useState(() => props.options.initialData as Partial<CreateAudioAnnotationPayload>);\n const [url, setUrl] = useState(initialData.url || \"\");\n const [duration, setDuration] = useState(initialData.duration || 0);\n const [error, setError] = useState(\"\");\n const [label, setLabel] = useState(initialData.label || ({ en: [\"\"] } as InternationalString));\n\n const onSubmit = () => {\n props.runCreate({\n url,\n duration,\n label,\n });\n };\n\n useEffect(() => {\n setError(\"\");\n setDuration(url === initialData.url ? initialData.duration || 0 : 0);\n if (url) {\n // Find label from url.\n const labelFromUrl = url.split(\"/\").pop()?.split(\".\").shift();\n setLabel(url === initialData.url && initialData.label ? initialData.label : { en: [labelFromUrl || \"\"] });\n }\n }, [url, initialData]);\n\n return (\n <PaddedSidebarContainer>\n {error ? (\n <ErrorMessage>\n <div role=\"alert\">{t(\"errors.media\")}</div>\n <details>\n <summary>{t(\"errors.details\")}</summary>\n {error}\n </details>\n </ErrorMessage>\n ) : null}\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"audio-url\">{t(\"form.audioUrl\")}</InputLabel>\n <Input\n type=\"url\"\n placeholder=\"https://example.org/audio.mp3\"\n id=\"audio-url\"\n value={url}\n onChange={(e) => setUrl(e.target.value)}\n />\n </InputContainer>\n\n {url && !error ? (\n <div>\n <LanguageFieldEditor\n key={`${url}__${duration}`}\n containerId={\"label\"}\n focusId={\"label_\"}\n label={property(\"fields.label\")}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n </div>\n ) : null}\n\n {url && !error ? (\n <CanvasPanel.AudioHTML key={`${url}__${duration}`} media={{ url, duration, type: \"Sound\" } as any}>\n <MediaControls\n key={`${url}__${duration}`}\n onError={(error) => setError(error)}\n onDuration={(duration) => setDuration(~~duration)}\n />\n </CanvasPanel.AudioHTML>\n ) : null}\n\n {duration && !error ? (\n <FormFieldWrapper>\n <InputLabel htmlFor=\"duration\">{property(\"fields.duration\")}</InputLabel>\n <Input type=\"number\" id=\"duration\" value={duration} onChange={(e) => setDuration(e.target.valueAsNumber)} />\n </FormFieldWrapper>\n ) : null}\n\n <ActionButton primary large type=\"button\" onPress={onSubmit} isDisabled={!url || !!error}>\n {t(\"form.addAudio\")}\n </ActionButton>\n </PaddedSidebarContainer>\n );\n}\n","import { AudioIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getContentType, isHttpUrl, matchesExtension } from \"../../resource-probes\";\nimport { CreateAudioAnnotationForm, createAudioAnnotation } from \"./create-audio-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/audio-annotation\": typeof audioAnnotation;\n }\n }\n}\n\nexport const audioAnnotation = defineCreator({\n id: \"@manifest-editor/audio-annotation\",\n create: createAudioAnnotation,\n label: \"Audio\",\n labelMessage: { namespace: \"creators\", key: \"definitions.audio.label\" },\n summary: \"Add audio from a direct audio-file link.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.audio.summary\" },\n icon: <AudioIcon />,\n render(ctx) {\n return <CreateAudioAnnotationForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const contentType = await getContentType(value, helpers);\n if (contentType.startsWith(\"audio/\") || matchesExtension(value, [\".mp3\", \".m4a\", \".wav\", \".ogg\"])) {\n return { initialData: { url: value } };\n }\n return false;\n },\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import type { ImageService } from \"@iiif/presentation-3\";\nimport { useState } from \"react\";\n\n/** Request state belongs to the form, independently of the UI locale/profile. */\nexport function useServiceRequest() {\n const [loading, setLoading] = useState(false);\n const [failed, setFailed] = useState(false);\n async function load(url: () => string | null, receive: (service: ImageService) => void) {\n setLoading(true);\n setFailed(false);\n try {\n const target = url();\n if (!target) throw new Error(\"Invalid image service request\");\n const response = await fetch(target);\n if (!response.ok) throw new Error(\"Could not load the image service\");\n const service = await response.json();\n receive(service);\n } catch {\n setFailed(true);\n } finally {\n setLoading(false);\n }\n }\n return { load, loading, failed };\n}\n","import type { ImageService } from \"@iiif/presentation-3\";\n\nexport function normalizeImageService(service: ImageService): ImageService {\n const { \"@id\": legacyId, \"@type\": legacyType, ...info } = service;\n const version = `${service[\"@context\"] || \"\"} ${service.profile || \"\"}`.match(\n /\\/(?:image|image-api)\\/([123])(?:[./])/\n );\n return {\n ...info,\n id: service.id || legacyId,\n type: service.type || legacyType || `ImageService${version?.[1] || \"2\"}`,\n } as ImageService;\n}\n\n/** Select embedded service metadata without changing the info used to create image URLs. */\nexport function compactImageService(\n service: ImageService,\n config: Record<string, unknown> = {},\n thumbnail = false\n): ImageService {\n const fields: Array<keyof ImageService> = [];\n if (config.compact !== \"compact\") fields.push(\"width\", \"height\");\n if (thumbnail || config.includeSizes === true) fields.push(\"sizes\");\n if (thumbnail || config.includeTiles === true) fields.push(\"tiles\");\n const normalized = normalizeImageService(service);\n return {\n id: normalized.id,\n type: normalized.type,\n profile: normalized.profile,\n ...Object.fromEntries(fields.filter((key) => normalized[key] !== undefined).map((key) => [key, normalized[key]])),\n };\n}\n","import { useServiceRequest } from \"../../use-service-request\";\nimport { useTranslations } from \"@manifest-editor/i18n\";\nimport {\n canonicalServiceUrl,\n createImageServiceRequest,\n imageServiceRequestToString,\n parseImageServiceRequest,\n type RegionParameter,\n type SizeParameter,\n} from \"@iiif/parser/image-3\";\nimport type { ImageService } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel } from \"@manifest-editor/editors\";\nimport { Spinner } from \"@manifest-editor/ui/madoc/components/icons/Spinner\";\nimport { type FormEvent, useState } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\nimport { ImageService as ImageServiceComponent, useImage } from \"react-iiif-vault\";\nimport { compactImageService, normalizeImageService } from \"../image-service-options\";\n\nexport interface CreateImageServicePayload {\n url: string;\n height?: number;\n width?: number;\n format?: string;\n service: ImageService;\n size?: SizeParameter;\n embedService?: boolean;\n selector?: RegionParameter;\n}\n\nexport async function createImageServer(data: CreateImageServicePayload, ctx: CreatorFunctionContext) {\n const service = normalizeImageService(data.service);\n\n const request = createImageServiceRequest(service);\n const imageId = imageServiceRequestToString({\n identifier: request.identifier,\n server: request.server,\n scheme: request.scheme,\n type: \"image\",\n size: {\n max: !data.size?.width && !data.size?.height,\n confined: false,\n upscaled: false,\n ...(data.size || {}),\n },\n format: \"jpg\",\n // This isn't how it should be modelled, always full,\n // region: data.selector ? data.selector : { full: true },\n region: { full: true },\n rotation: { angle: 0 },\n quality: \"default\",\n prefix: request.prefix,\n originalPath: (request as any).originalPath,\n });\n\n const resource = ctx.embed({\n id: imageId,\n type: \"Image\",\n format: data.format || \"image/jpeg\",\n height: data.height || service.height,\n width: data.width || service.width,\n service:\n data.embedService === false\n ? undefined\n : [compactImageService(service, ctx.config, ctx.options.parent?.property === \"thumbnail\")],\n });\n\n // @todo add in support for the region selector (creating specific resource)\n\n return resource;\n}\n\nexport function getCanonicalUrl(url: string) {\n return url.endsWith(\"default.jpg\")\n ? imageServiceRequestToString({\n ...parseImageServiceRequest(url),\n type: \"info\",\n })\n : canonicalServiceUrl(url);\n}\n\n// @todo cover a lot more things - like offering size dropdown.\nexport function CreateImageServerForm(props: CreatorContext<CreateImageServicePayload>) {\n const t = useTranslations(\"creators\");\n const common = useTranslations(\"common\");\n const initialData = props.options.initialData as Partial<CreateImageServicePayload>;\n const initialUrl = initialData.url ? getCanonicalUrl(initialData.url) : \"\";\n const [url, setUrl] = useState(initialUrl || \"\");\n\n const { load, loading, failed } = useServiceRequest();\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n const url = formData.url;\n\n if (url) {\n void load(\n () => getCanonicalUrl(url),\n (service) => {\n props.runCreate({ url: formData.url, service });\n }\n );\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit} aria-busy={loading}>\n {failed ? <div role=\"alert\">{t(\"errors.service\")}</div> : null}\n {loading ? <output>{common(\"status.loading\")}</output> : null}\n <div className=\"flex gap-2 items-center\">\n <InputContainer $wide>\n <InputLabel htmlFor=\"url\">{t(\"form.serviceUrl\")}</InputLabel>\n <Input\n id=\"url\"\n name=\"url\"\n defaultValue={initialData.url || \"\"}\n onPaste={(e) => {\n const text = e.clipboardData.getData(\"text/plain\");\n setUrl(text ? getCanonicalUrl(text) : \"\");\n }}\n onBlur={(e) => setUrl(e.currentTarget.value ? getCanonicalUrl(e.currentTarget.value) : \"\")}\n />\n </InputContainer>\n </div>\n\n <div className=\"relative flex z-0 my-5 h-96 min-h-0 min-w-0 overflow-hidden bg-gray-200 rounded items-center justify-center\">\n {url.trim() ? (\n <ErrorBoundary fallbackRender={() => <div>{t(\"form.invalidService\")}</div>}>\n <ImageComponent key={url} src={url} />\n </ErrorBoundary>\n ) : (\n <div className=\"text-grey-600\">{common(\"actions.preview\")}</div>\n )}\n </div>\n <div>\n <ActionButton primary large type=\"submit\" isDisabled={!url || loading}>\n {common(\"actions.create\")}\n </ActionButton>\n </div>\n </form>\n </PaddedSidebarContainer>\n );\n}\n\nfunction ImageComponent({ src }: { src: string }) {\n const t = useTranslations(\"creators\");\n const common = useTranslations(\"common\");\n const image = useImage({ id: src } as any, {\n size: { width: 512 },\n });\n\n if (!image) {\n return (\n <output aria-label={common(\"status.loading\")}>\n <Spinner />\n </output>\n );\n }\n\n return (\n <div className=\"h-full\">\n <img className=\"w-full h-full object-contain\" src={image} alt={t(\"image.previewAlt\")} />\n </div>\n );\n}\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport type { ImageService } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext, CreatorResource } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel } from \"@manifest-editor/editors\";\nimport { getFormat, getImageDimensions } from \"@manifest-editor/shell\";\nimport type { FormEvent } from \"react\";\n\nexport interface CreateImageUrlPayload {\n url: string;\n format?: string;\n height?: number;\n width?: number;\n service?: ImageService | ImageService[];\n}\n\nexport async function createImageUrl(\n data: CreateImageUrlPayload,\n ctx: CreatorFunctionContext\n): Promise<CreatorResource> {\n if (!data.height || !data.width) {\n const dimensions = await getImageDimensions(data.url);\n if (dimensions) {\n data.height = dimensions.height;\n data.width = dimensions.width;\n }\n }\n\n return ctx.embed({\n id: data.url,\n type: \"Image\",\n format: data.format || (await getFormat(data.url)),\n height: data.height,\n width: data.width,\n service: data.service ? (Array.isArray(data.service) ? data.service : [data.service]) : undefined,\n });\n}\n\nexport function CreateImageUrlForm(props: CreatorContext) {\n const t = useTranslations(\"creators\");\n const common = useTranslations(\"common\");\n const initialData = props.options.initialData as Partial<CreateImageUrlPayload>;\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.url) {\n props.runCreate({ url: formData.url });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <InputContainer $wide>\n <InputLabel htmlFor=\"url\">{t(\"form.imageUrl\")}</InputLabel>\n <Input type=\"url\" id=\"url\" name=\"url\" defaultValue={initialData.url || \"\"} />\n </InputContainer>\n\n <ActionButton primary large type=\"submit\">\n {common(\"actions.create\")}\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { AddImageIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getContentType, isHttpUrl, isImageService, matchesExtension } from \"../../resource-probes\";\nimport { getCanonicalUrl } from \"../ImageServiceCreator/create-image-service\";\nimport { CreateImageUrlForm, createImageUrl } from \"./create-image-url\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-url-creator\": typeof imageUrlCreator;\n }\n }\n}\n\nexport const imageUrlCreator = defineCreator({\n id: \"@manifest-editor/image-url-creator\",\n create: createImageUrl,\n label: \"Image\",\n labelMessage: { namespace: \"creators\", key: \"definitions.imageUrl.label\" },\n summary: \"Add an image using a direct image-file link.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.imageUrl.summary\" },\n icon: <AddImageIcon />,\n tags: [\"image\"],\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const serviceUrl = getCanonicalUrl(value);\n if (serviceUrl) {\n try {\n const service = await helpers.json(serviceUrl);\n if (isImageService(service)) return false;\n } catch {\n // Not an image service; keep checking the image URL itself.\n }\n }\n const contentType = await getContentType(value, helpers);\n if (contentType.startsWith(\"image/\") || matchesExtension(value, [\".jpg\", \".jpeg\", \".png\", \".gif\", \".webp\"])) {\n return { initialData: { url: value, format: contentType || undefined } };\n }\n return false;\n },\n render(ctx) {\n return <CreateImageUrlForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"format\"],\n supports: {\n initialData: true,\n parentFields: [\"logo\", \"body\", \"thumbnail\", \"items\"],\n custom(parent, vault) {\n if (parent.property !== \"items\") {\n return true;\n }\n\n if (parent.resource.type === \"ContentResource\") {\n const resource = vault.get(parent.resource as any, { skipSelfReturn: false } as any) as any;\n return resource?.type === \"Choice\";\n }\n\n return false;\n },\n },\n staticFields: {\n type: \"Image\",\n },\n});\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputLabel } from \"@manifest-editor/editors\";\nimport { useAnnotationCreatorState } from \"@manifest-editor/shell\";\nimport { type FormEvent, useId } from \"react\";\n\nexport interface CreateCaptionedImageAnnotationPayload {\n label?: InternationalString;\n body: InternationalString;\n imageUrl: string;\n motivation?: string;\n height?: number;\n width?: number;\n}\n\nexport async function createCaptionedImageAnnotation(\n data: CreateCaptionedImageAnnotationPayload,\n ctx: CreatorFunctionContext\n) {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const languages = Object.keys(data.body);\n const bodies = [];\n for (const language of languages) {\n const body = (data.body as any)[language].join(\"\\n\");\n if (body) {\n bodies.push(\n await ctx.create(\n \"@manifest-editor/html-body-creator\",\n {\n language,\n body,\n },\n { parent: { resource: annotation, property: \"items\" } }\n )\n );\n }\n }\n\n const resource = await ctx.create(\n \"@manifest-editor/image-url-creator\",\n { url: data.imageUrl },\n {\n parent: { resource: annotation, property: \"body\" },\n }\n );\n\n if (resource) {\n bodies.push(resource);\n }\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n motivation: data.motivation || ctx.options.initialData?.motivation || \"painting\",\n body: bodies,\n target: ctx.getTarget(),\n });\n }\n\n // @todo this might not make sense to be a canvas.\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body: bodies,\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled HTML canvas\"] },\n height: data.height || 1000,\n width: data.width || 1000,\n items: [page],\n });\n }\n}\n\n// The body is shared with the HTML tab, so show any HTML as its plain text.\nfunction toPlainText(value: string) {\n if (!value.trim().startsWith(\"<\")) return value;\n return new DOMParser().parseFromString(value, \"text/html\").body.textContent || \"\";\n}\n\nexport function CreateCaptionedImageAnnotation(props: CreatorContext<CreateCaptionedImageAnnotationPayload>) {\n const t = useTranslations(\"creators\");\n const common = useTranslations(\"common\");\n const [body, setBody] = useAnnotationCreatorState<InternationalString>({\n key: \"bodyValue\",\n initialValue: props.options.initialData?.body || { en: [\"\"] },\n requestId: props.options.initialData?.requestId,\n });\n\n const id = useId();\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n props.runCreate({\n body: { en: [formData.caption] },\n imageUrl: formData.url,\n });\n };\n\n return (\n <form onSubmit={onSubmit} className=\"flex flex-col gap-3\">\n <div>\n <InputLabel htmlFor={`${id}-url`}>{t(\"image.fromUrl\")}</InputLabel>\n <Input\n id={`${id}-url`}\n name=\"url\"\n type=\"url\"\n required\n defaultValue={props.options.initialData?.imageUrl || \"\"}\n placeholder=\"https://example.org/image.jpg\"\n />\n </div>\n <div>\n <InputLabel htmlFor={`${id}-caption`}>{t(\"form.caption\")}</InputLabel>\n <Input\n id={`${id}-caption`}\n name=\"caption\"\n placeholder={t(\"form.describeImage\")}\n onChange={(e: any) => setBody({ en: [e.target.value] })}\n value={toPlainText(body.en?.[0] || \"\")}\n />\n </div>\n <div className=\"flex justify-end\">\n <ActionButton primary type=\"submit\">\n {common(\"actions.create\")}\n </ActionButton>\n </div>\n </form>\n );\n}\n","import { AddImageIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { imageUrlCreator } from \"../../ContentResource/ImageUrlCreator\";\nimport { CreateCaptionedImageAnnotation, createCaptionedImageAnnotation } from \"./create-captioned-image-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/captioned-image-annotation\": typeof captionedImageAnnotation;\n }\n }\n}\n\nexport const captionedImageAnnotation = defineCreator({\n id: \"@manifest-editor/captioned-image-annotation\",\n create: createCaptionedImageAnnotation,\n label: \"Captioned image\",\n labelMessage: { namespace: \"creators\", key: \"definitions.captionedImage.label\" },\n summary: \"Add an image from a direct link and write its caption.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.captionedImage.summary\" },\n icon: <AddImageIcon />,\n async supportsResource(value, helpers, ctx) {\n const result = await imageUrlCreator.supportsResource!(value, helpers, ctx);\n return result ? { initialData: { imageUrl: value } } : false;\n },\n render(ctx) {\n return <CreateCaptionedImageAnnotation {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supports: {\n initialData: true,\n disallowPainting: true,\n parentTypes: [\"AnnotationPage\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport { getValue } from \"@iiif/helpers\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, HTMLEditor, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { useAnnotationCreatorState } from \"@manifest-editor/shell\";\nimport { useState } from \"react\";\nimport { useCurrentAnnotationMetadata } from \"react-iiif-vault\";\n\nexport interface CreateHTMLAnnotationPayload {\n label?: InternationalString;\n body: InternationalString;\n motivation?: string;\n height?: number;\n width?: number;\n}\n\nexport async function createHtmlAnnotation(data: CreateHTMLAnnotationPayload, ctx: CreatorFunctionContext) {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const languages = Object.keys(data.body);\n const bodies = [];\n for (const language of languages) {\n const body = (data.body as any)[language].join(\"\\n\");\n if (body) {\n bodies.push(\n await ctx.create(\n \"@manifest-editor/html-body-creator\",\n {\n language,\n body,\n },\n { parent: { resource: annotation, property: \"items\" } }\n )\n );\n }\n }\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n motivation: data.motivation || ctx.options.initialData?.motivation || \"painting\",\n body: bodies,\n target: ctx.getTarget(),\n });\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body: bodies,\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled HTML canvas\"] },\n height: data.height || 1000,\n width: data.width || 1000,\n items: [page],\n });\n }\n}\n\nexport function CreateHTMLAnnotation(props: CreatorContext<CreateHTMLAnnotationPayload>) {\n const common = useTranslations(\"common\");\n const [body, setBody] = useAnnotationCreatorState<InternationalString>({\n key: \"bodyValue\",\n initialValue: props.options.initialData?.body || { en: [\"\"] },\n requestId: props.options.initialData?.requestId,\n });\n\n const isEmpty = getValue(body).trim() === \"\";\n\n const onSubmit = () => {\n props.runCreate({\n body,\n });\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <HTMLEditor value={body.en?.[0] || \"\"} onChange={(newValue) => setBody({ en: [newValue] })} />\n <div className=\"flex justify-end\">\n <ActionButton primary type=\"button\" onPress={onSubmit} isDisabled={isEmpty}>\n {common(\"actions.create\")}\n </ActionButton>\n </div>\n </div>\n );\n}\n","import { HTMLIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { CreateHTMLAnnotation, createHtmlAnnotation } from \"./create-html-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/html-annotation\": typeof htmlAnnotation;\n }\n }\n}\n\nexport const htmlAnnotation = defineCreator({\n id: \"@manifest-editor/html-annotation\",\n create: createHtmlAnnotation,\n label: \"HTML\",\n labelMessage: { namespace: \"creators\", key: \"definitions.html.label\" },\n summary: \"Write formatted text to display on a canvas.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.html.summary\" },\n icon: <HTMLIcon />,\n render(ctx) {\n return <CreateHTMLAnnotation {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supports: {\n initialData: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import { isImageService } from \"@iiif/parser/image-3\";\nimport type { ImageService, SpecificResource } from \"@iiif/presentation-3\";\nimport type { CreatorSideEffect } from \"@manifest-editor/creator-api\";\nimport { EditorInstance } from \"@manifest-editor/editor-api\";\nimport { centerRectangles } from \"@manifest-editor/editors\";\n\nexport const repositionMultipleImages: CreatorSideEffect = {\n canvasInteraction: true,\n spatial: true,\n async run(result, { vault, options }) {\n if (\n result &&\n result.type === \"Annotation\" &&\n options.targetType === \"Annotation\"\n ) {\n const fullAnno = vault.get<any>(result);\n\n const target = fullAnno.target as SpecificResource;\n if (!(target && target.source?.type === \"Canvas\")) {\n return;\n }\n\n const canvasRef = target.source;\n const canvas = vault.get(canvasRef);\n if (!canvas.items) {\n return;\n }\n\n const annoPage = vault.get(canvas.items[0]);\n if (!annoPage) {\n return;\n }\n\n if (\n annoPage.items.length < 2 &&\n !canvas.behavior.includes(\"multi-image\")\n ) {\n return;\n }\n\n const bodies = vault.get(fullAnno.body);\n const body = bodies[0];\n const selector = fullAnno.body[0]?.selector;\n\n const serviceList = body.service || [];\n const imageService = serviceList.find((s: any) => isImageService(s)) as\n | ImageService\n | undefined;\n if (imageService) {\n if (imageService.width && imageService.height) {\n if (imageService.width !== body.width) {\n vault.modifyEntityField(\n { id: body.id, type: \"ContentResource\" },\n \"width\",\n imageService.width,\n );\n }\n if (imageService.height !== body.height) {\n vault.modifyEntityField(\n { id: body.id, type: \"ContentResource\" },\n \"height\",\n imageService.height,\n );\n }\n }\n }\n\n let width = imageService?.width || body.width;\n let height = imageService?.height || body.height;\n\n if (selector) {\n if (\n (selector.type === \"iiif:ImageApiSelector\" ||\n selector.type === \"ImageApiSelector\") &&\n selector.region\n ) {\n const [x, y, width_, height_] = selector.region.split(\",\");\n\n width = Number(width_) || width;\n height = Number(height_) || height;\n }\n }\n\n const editor = new EditorInstance({ vault, reference: result });\n\n const imagePosition = centerRectangles(\n canvas,\n {\n width: width,\n height: height,\n },\n 0.6,\n );\n\n editor.annotation.target.setPosition(imagePosition);\n }\n },\n};\n","import type { SpecificResource } from \"@iiif/presentation-3\";\nimport type { CanvasNormalized } from \"@iiif/presentation-3-normalized\";\nimport type { CreatorSideEffect } from \"@manifest-editor/creator-api\";\nimport { EditorInstance } from \"@manifest-editor/editor-api\";\n\nexport const resizeResourceToEmptyCanvas: CreatorSideEffect = {\n canvasInteraction: true,\n spatial: true,\n async run(result, { vault, options }) {\n if (\n result &&\n result.type === \"Annotation\" &&\n options.targetType === \"Annotation\"\n ) {\n const fullAnno = vault.get<any>(result);\n\n const target = fullAnno.target as SpecificResource;\n if (!(target && target.source?.type === \"Canvas\")) {\n return;\n }\n\n const canvasRef = target.source;\n const canvas = vault.get<CanvasNormalized>(canvasRef);\n if (!canvas.items) {\n return;\n }\n\n if (canvas.behavior.includes(\"multi-image\")) {\n return;\n }\n // This is what broke the aspect ratio work.\n // if (canvas.behavior.length) {\n // // Ignore custom canvas behaviours.\n // return;\n // }\n\n const annoPage = vault.get(canvas.items[0]!);\n if (!annoPage) {\n return;\n }\n\n if (annoPage.items.length > 1) {\n return;\n }\n\n const bodies = vault.get(fullAnno.body);\n if (bodies.length !== 1) {\n return;\n }\n\n const body = bodies[0];\n const selector = fullAnno.body[0]?.selector;\n\n const service = (body.service || [])[0];\n\n let width = service?.width || body.width;\n let height = service?.height || body.height;\n const duration = body.duration || service?.duration;\n\n if (selector) {\n if (\n (selector.type === \"iiif:ImageApiSelector\" ||\n selector.type === \"ImageApiSelector\") &&\n selector.region\n ) {\n const [x, y, width_, height_] = selector.region.split(\",\");\n\n width = Number(width_) || width;\n height = Number(height_) || height;\n }\n }\n\n const editor = new EditorInstance({ vault, reference: canvasRef });\n vault.batch(() => {\n if (typeof width !== \"undefined\") {\n editor.technical.width.set(width);\n }\n if (typeof height !== \"undefined\") {\n editor.technical.height.set(height);\n }\n if (typeof duration !== \"undefined\") {\n editor.technical.duration.set(duration);\n }\n });\n }\n },\n};\n","var Re=Object.defineProperty;var Ae=(i,e,t)=>e in i?Re(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var w=(i,e,t)=>(Ae(i,typeof e!=\"symbol\"?e+\"\":e,t),t);function g(i){return i.endsWith(\"info.json\")?i:i.endsWith(\"/\")?`${i}info.json`:`${i}/info.json`}var Ce=\"http://library.stanford.edu/iiif/image-api/compliance.html#level0\",j=\"http://library.stanford.edu/iiif/image-api/compliance.html#level1\",T=\"http://library.stanford.edu/iiif/image-api/compliance.html#level2\",Le=\"http://library.stanford.edu/iiif/image-api/conformance.html#level0\",$=\"http://library.stanford.edu/iiif/image-api/conformance.html#level1\",B=\"http://library.stanford.edu/iiif/image-api/conformance.html#level2\",Oe=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\",N=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1\",k=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2\",Pe=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0\",H=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1\",G=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2\",We=\"http://iiif.io/api/image/1/level0.json\",Me=\"http://iiif.io/api/image/1/profiles/level0.json\",U=\"http://iiif.io/api/image/1/level1.json\",Q=\"http://iiif.io/api/image/1/profiles/level1.json\",V=\"http://iiif.io/api/image/1/level2.json\",D=\"http://iiif.io/api/image/1/profiles/level2.json\",je=\"http://iiif.io/api/image/2/level0.json\",Te=\"http://iiif.io/api/image/2/profiles/level0.json\",J=\"http://iiif.io/api/image/2/level1.json\",Z=\"http://iiif.io/api/image/2/profiles/level1.json\",K=\"http://iiif.io/api/image/2/level2.json\",X=\"http://iiif.io/api/image/2/profiles/level2.json\",$e=\"level0\",Y=\"level1\",q=\"level2\",Be=\"http://iiif.io/api/image/2/level0\",ee=\"http://iiif.io/api/image/2/level1\",ie=\"http://iiif.io/api/image/2/level2\",A=[ie,T,B,k,G,V,D,K,X,q],z=[...A,ee,j,$,N,H,U,Q,J,Z,Y],C=[Be,ee,ie,Ce,j,T,Le,$,B,Oe,N,k,Pe,H,G,We,Me,U,Q,V,D,je,Te,J,Z,K,X,$e,Y,q],He=C,te={extraFormats:[\"jpg\"],extraQualities:[\"default\"],extraFeatures:[\"sizeByWhListed\"]},re={extraFormats:[\"jpg\"],extraQualities:[\"default\"],extraFeatures:[\"baseUriRedirect\",\"cors\",\"jsonldMediaType\",\"regionByPx\",\"regionSquare\",\"sizeByWhListed\",\"sizeByH\",\"sizeByW\",\"sizeByWh\"]},oe={extraFormats:[\"jpg\",\"png\"],extraQualities:[\"default\"],extraFeatures:[\"baseUriRedirect\",\"cors\",\"jsonldMediaType\",\"regionByPct\",\"regionByPx\",\"regionSquare\",\"rotationBy90s\",\"sizeByWhListed\",\"sizeByConfinedWh\",\"sizeByH\",\"sizeByPct\",\"sizeByW\",\"sizeByWh\"]},L=[\"baseUriRedirect\",\"canonicalLinkHeader\",\"cors\",\"jsonldMediaType\",\"mirroring\",\"profileLinkHeader\",\"regionByPct\",\"regionByPx\",\"regionSquare\",\"rotationArbitrary\",\"rotationBy90s\",\"sizeByConfinedWh\",\"sizeByH\",\"sizeByPct\",\"sizeByW\",\"sizeByWh\",\"sizeUpscaling\",\"sizeByWhListed\",\"sizeByDistortedWh\",\"sizeByForcedWh\"];function ae(i){return A.indexOf(i)!==-1?oe:z.indexOf(i)!==-1?re:te}function _(i){let e=i?Array.isArray(i.profile)?i.profile:[i.profile]:[],t={extraQualities:[],extraFormats:[],extraFeatures:[]};for(let r of e)if(typeof r==\"string\"&&(r=ae(r)),!!r){if(r.formats)for(let o of r.formats)t.extraFormats.indexOf(o)===-1&&t.extraFormats.push(o);if(r.qualities)for(let o of r.qualities)t.extraQualities.indexOf(o)===-1&&t.extraQualities.push(o);if(r.supports)for(let o of r.supports)t.extraFeatures.indexOf(o)===-1&&t.extraFeatures.push(o);if(r.maxHeight&&(t.maxHeight=r.maxHeight),r.maxWidth&&(t.maxWidth=r.maxWidth),r.maxArea&&(t.maxArea=r.maxArea),r.extraFormats)for(let o of r.extraFormats)t.extraFormats.indexOf(o)===-1&&t.extraFormats.push(o);if(r.extraQualities)for(let o of r.extraQualities)t.extraQualities.indexOf(o)===-1&&t.extraQualities.push(o);if(r.extraFeatures)for(let o of r.extraFeatures)t.extraFeatures.indexOf(o)===-1&&t.extraFeatures.push(o);r.maxHeight&&(t.maxHeight=r.maxHeight),r.maxWidth&&(t.maxWidth=r.maxWidth),r.maxArea&&(t.maxArea=r.maxArea)}if(i.extraFormats)for(let r of i.extraFormats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(i.extraFeatures)for(let r of i.extraFeatures)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);if(i.extraQualities)for(let r of i.extraQualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);return t}function ne(i){try{if(i===\"full\")return{full:!0};if(i===\"square\")return{square:!0};let e=i.startsWith(\"pct:\"),r=i.substr(e?4:0).split(\",\").map(o=>parseFloat(o));return{x:r[0],y:r[1],w:r[2],h:r[3],percent:e}}catch{throw new Error(\"Expected 'full', 'square' or 'x,y,w,h'. Found \"+i)}}function se(i){let e={upscaled:!1,max:!1,confined:!1};if(i[0]===\"^\"&&(e.upscaled=!0,i=i.slice(1)),i===\"max\"||i===\"full\")return e.max=!0,e.serialiseAsFull=i===\"full\",e;if(i[0]===\"!\"&&(e.confined=!0,i=i.slice(1)),i[0]===\"p\")return e.percentScale=parseFloat(i.slice(4)),e;let t=i.split(\",\").map(r=>r.trim());return t.length&&typeof t[0]<\"u\"&&(t[0]!==\"\"&&(e.width=parseInt(t[0],10)),typeof t[1]<\"u\"&&t[1]!==\"\"?(e.height=parseInt(t[1],10),e.version=2):e.version=3),e}function fe(i){let e={angle:0};if(i[0]===\"!\"&&(e.mirror=!0,i=i.substr(1)),e.angle=parseFloat(i)%360,Number.isNaN(e.angle))throw new Error(`Invalid rotation ${i}`);return e}function me(i,e=\"\"){let t=i.match(/^(([a-zA-Z]+):\\/\\/([^/]+))?((.*)+)/);if(!t)throw new Error(`Invalid or unknown input ${i}`);let r=t[2],o=t[3],a=t[4];if(a[0]===\"/\"&&(a=a.substring(1)),e.length>0){if(e[0]===\"/\"&&(e=e.substring(1)),e!==a.substring(0,e.length))throw new Error(`Path does not start with prefix (path: ${a}, prefix: ${e})`);a=a.substring(e.length)}return{scheme:r,server:o,path:a,prefix:e}}function le(i,e=\"\"){let{path:t,scheme:r,server:o,prefix:a}=me(i,e),n=(t||\"\").split(\"/\").reverse(),[s,f,h,m,...p]=n,x=p.reverse().filter(Boolean).join(\"/\");if(n.length===1||s===\"\")return{type:\"base\",scheme:r,server:o,prefix:a,identifier:x};if(s===\"info.json\"){let[,...c]=n;return{type:\"info\",scheme:r,server:o,prefix:a,identifier:c.reverse().filter(Boolean).join(\"/\")}}let d=(s||\"\").split(\".\");if(typeof d[1]>\"u\"||typeof d[0]>\"u\"||typeof m>\"u\"||typeof h>\"u\"||typeof f>\"u\")throw new Error(\"Invalid image request\");return{type:\"image\",scheme:r,server:o,prefix:a,identifier:x,originalPath:t,region:ne(m),size:se(h),rotation:fe(f),quality:d[0],format:d[1]}}function ce(i){let e=le(g(i.id));if(e.type!==\"info\")throw new Error(\"Invalid service URL\");let t=_(i);return{identifier:e.identifier,originalPath:\"\",server:e.server,prefix:e.prefix,scheme:e.scheme,type:\"image\",quality:t.extraQualities.indexOf(\"default\")===-1?t.extraQualities[0]:\"default\",region:{full:!0},size:{max:!0,upscaled:!1,confined:!1},format:\"jpg\",rotation:{angle:0}}}function he(i,e,t){let r=t.length,o=[];for(let a=0;a<r;a++){let n=t[a];if(n){let s=n.width;o.push(i/s)}}return o}function pe(i,e,t){let r=t.length,o=[];for(let a=0;a<r;a++){let n=t[a];n&&o.push({width:Math.floor(i/n),height:Math.floor(e/n)})}return o}function l(i){if(i[\"@id\"])return i[\"@id\"];if(i.id)return i.id}function u(i){if(!i||!i.profile||!l(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t==\"string\"&&C.indexOf(t)!==-1)return!0;return!1}function ge(i){if(!u(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t==\"string\"){if(z.indexOf(t)!==-1)return!0}else{let r=[...t.supports||[],...t.extraFeatures||[]];if(r.indexOf(\"regionByPx\")!==-1&&(r.indexOf(\"sizeByW\")!==-1||r.indexOf(\"sizeByWh\")!==-1))return!0}return!1}function v(i,e){if(e&&e.profile){let t=e.profile;if(t){let r=Array.isArray(t)?t:[t];return r.includes(`level${i}`)||r.includes(`http://iiif.io/api/image/2/level${i}.json`)||r.includes(`http://iiif.io/api/image/1/level${i}.json`)||r.includes(`http://iiif.io/api/image/1/profiles/level${i}.json`)}}return!1}function I(i){return u(i)?v(0,i)?0:v(1,i)?1:v(2,i)?2:null:null}function y(i){return(i[\"@context\"]?Array.isArray(i[\"@context\"])?i[\"@context\"]:[i[\"@context\"]]:[]).indexOf(\"http://iiif.io/api/image/3/context.json\")!==-1}function ue(i){if(!ge(i))return[];let e=[],t=Array.isArray(i.profile)?i.profile:[i.profile],r=t.length;for(let o=0;o<r;o++){let a=t[o];if(a&&typeof a!=\"string\"&&(a.maxHeight||a.maxWidth))return[{id:l(i),type:\"variable\",minWidth:0,minHeight:0,maxHeight:a.maxHeight||a.maxWidth,maxWidth:a.maxWidth||a.maxHeight,level:I(i),version:i[\"@context\"]===\"http://iiif.io/api/image/3/context.json\"?3:2}]}if(i.tiles){let o=i.tiles.length;for(let a=0;a<o;a++){let n=i.tiles[a];n&&(n.height||n.width)&&e.push({id:l(i),type:\"variable\",minHeight:0,minWidth:0,maxHeight:n.height||n.width,maxWidth:n.width,level:I(i),version:y(i)?3:2})}}return e}function O(i){let e=/^.*\\/(full)\\/(((\\d+),(\\d+)?)|max)\\/(\\d+)\\/default\\.(jpg|png|jpeg)$/,t=i.match(e);if(t&&t[4]&&t[5]){let r=t[1],o=parseInt(t[4],10),a=parseInt(t[5],10),n=t[7];if((r===\"max\"||r===\"full\")&&o&&a&&n)return{type:\"fixed\",id:i,height:a,width:o}}return{type:\"unknown\",id:i}}function de(i){if(i[\"@type\"])return i[\"@type\"];if(i.type)return i.type}function xe(i){if(typeof i==\"string\")return O(i);let e=de(i);if(e!==\"Image\"&&e!==\"sc:Image\")return null;let t=i,r=l(t);return r?r&&t.width&&t.height?{id:r,type:\"fixed\",width:t.width,height:t.height,unsafe:!0}:O(r):null}function Ie(i){return u(i)?(i&&i.sizes?i.sizes:[]).map(e=>({id:l(i),type:\"fixed-service\",height:e.height,width:e.width,level:I(i),version:y(i)?3:2})):[]}function P(i){let e=[],t=i.length;for(let r=0;r<t;r++){let o=i[r];if(!o)continue;let a=Ie(o);a.length&&e.push(...a);let n=ue(o);n.length&&e.push(...n)}return e}function b(i){let e=i.service?Array.isArray(i.service)?i.service:[i.service]:[],t=e.length,r=[];for(let o=0;o<t;o++)u(e[o])&&r.push(e[o]);return r}function Se(i,e=!0,t){let r=[],o=xe(i);if(o===null)return r;let a=i;if(r.push(o),e&&a&&a.width&&a.height){let n=[],s=b(a);for(let f of s){let h={id:l(f),width:a.width,height:a.height};if(t.canLoadSync(h)){let m=t.loadServiceSync(h);m&&(m.height||(m.height=a.height),m.width||(m.width=a.width),n.push(...P([m])))}}if(n.length)return r.push(...n),r}return a.service&&r.push(...P(a.service)),r}function ve({x:i=0,y:e=0,w:t,h:r,full:o,square:a,percent:n}){if(o)return\"full\";if(a)return\"square\";if(typeof t>\"u\"||typeof r>\"u\")throw new Error(\"RegionParameter: invalid region\");let s=`${i},${e},${t},${r}`;return n?`pct:${s}`:s}function ye({max:i,percentScale:e,upscaled:t,confined:r,width:o,height:a,serialiseAsFull:n,version:s}){let f=[];return t&&f.push(\"^\"),i?(f.push(n?\"full\":\"max\"),f.join(\"\")):(r&&f.push(\"!\"),e&&f.push(`pct:${e}`),o&&f.push(`${o}`),f.push(\",\"),a&&s===3&&f.push(`${a}`),f.join(\"\"))}function Fe(i){return`${i.mirror?\"!\":\"\"}${(i.angle||0)%360}`}function we(i,e){let t=i.prefix.startsWith(\"/\")?i.prefix.substr(1):i.prefix,r=`${i.scheme}://${i.server}/${t?`${t}/`:\"\"}${i.identifier}`;if(i.type===\"base\")return r;if(i.type===\"info\")return`${r}/info.json`;let{size:o}=i,{region:a,rotation:n,format:s,quality:f}=i;if(e){let h=e[\"@context\"]?Array.isArray(e[\"@context\"])?e[\"@context\"]:[e[\"@context\"]]:[],m=h.indexOf(\"http://iiif.io/api/image/2/context.json\")!==-1,p=h.indexOf(\"http://iiif.io/api/image/3/context.json\")!==-1;if((o.width===e.width&&!o.height||o.height===e.height&&!o.width||o.width===e.width&&o.height===e.height)&&(o={...o,max:!0}),m&&(o.max&&!o.serialiseAsFull&&(o={...o,serialiseAsFull:!0}),!o.max&&o.width&&o.height&&(o={...o,height:void 0}),o={...o,version:2}),p){if(o.max&&o.serialiseAsFull&&(o={...o,serialiseAsFull:!1}),o.width&&!o.height&&e.width&&e.height){let x=e.height/e.width;o={...o,height:Math.ceil(o.width*x)}}o={...o,version:3}}}return[r,ve(a),ye(o),Fe(n),`${f}.${s}`].filter(Boolean).join(\"/\")}function E(i,e,t){let r=ce({\"@context\":i.version===3?\"http://iiif.io/api/image/3/context.json\":\"http://iiif.io/api/image/2/context.json\",id:g(l(i)),profile:i.level===null||typeof i.level>\"u\"?\"level0\":`level${i.level}`,type:i.version===3?\"ImageService3\":\"ImageService2\"});if(r.type!==\"image\")throw new Error(\"Invalid service\");return r.size.max=!1,r.size.width=e,r.size.height=t,{id:we(r),type:\"fixed\",width:e,height:t||i.height/(i.width||1)*e,unsafe:i.width>e}}function S(i){let e=i.replace(/(https?:\\/\\/)?(www.)?/i,\"\");return e.indexOf(\"/\")!==-1?e.split(\"/\")[0]:e}function ct(i){if(!i.width||!i.height)return null;if(i.tiles){let e=i.tiles.sort((r,o)=>Math.max(...o.scaleFactors)-Math.max(...r.scaleFactors)),t=e.length;for(let r=0;r<t;r++){let o=e[r];if(!o)continue;let a=o.width;if(!a)continue;let n=o.scaleFactors.length,s=o.scaleFactors.sort();for(let f=0;f<n;f++){let h=s[f];if(h&&i.width/h<=a&&i.height/h<=a)return{id:l(i),type:\"fixed-service\",width:i.width/h|0,height:i.height/h|0,level:I(i),version:y(i)?3:2}}}}return null}function R(i,e){if(!u(i))return[!1,\"Not a valid image service\"];e.extraFeatures=e.extraFeatures?e.extraFeatures:[];let t=_(i);if(e.exactSize){let r=!1;if(i.sizes)for(let o of i.sizes)o.width&&o.width===e.exactSize.width&&(L.indexOf(\"sizeByW\")!==-1||o.height&&o.height===e.exactSize.height)&&(r=!0),o.height&&o.height===e.exactSize.height&&(L.indexOf(\"sizeByH\")!==-1||o.width&&o.width===e.exactSize.width)&&(r=!0);r||(e.maxWidth=Math.max(e.maxWidth||0,e.exactSize.width||0)||void 0,e.maxHeight=Math.max(e.maxHeight||0,e.exactSize.height||0)||void 0,e.maxArea=Math.max(e.maxArea||0,(e.exactSize.width&&e.exactSize.height?e.exactSize.width*e.exactSize.height:e.maxArea)||0)||void 0,!e.exactSize.height&&e.exactSize.width?e.extraFeatures.indexOf(\"sizeByW\")===-1&&e.extraFeatures.push(\"sizeByW\"):!e.exactSize.width&&e.exactSize.height&&e.extraFeatures.indexOf(\"sizeByH\")===-1&&e.extraFeatures.push(\"sizeByH\"))}if(e.maxArea&&t.maxArea&&e.maxArea>t.maxArea)return[!1,`Max area is ${t.maxArea}`];if(e.maxWidth&&t.maxWidth&&e.maxWidth>t.maxWidth)return[!1,`Max width is ${t.maxWidth}`];if(e.maxHeight&&t.maxHeight&&e.maxHeight>t.maxHeight)return[!1,`Max height is ${t.maxHeight}`];if(e.extraFeatures){let r=[];for(let o of e.extraFeatures)t.extraFeatures.indexOf(o)===-1&&r.push(o);if(r.length)return[!1,`Missing features: ${r.join(\", \")}`]}if(e.extraFormats){let r=[];for(let o of e.extraFormats)t.extraFormats.indexOf(o)===-1&&r.push(o);if(r.length)return[!1,`Missing formats: ${r.join(\", \")}`]}if(e.extraQualities){let r=[];for(let o of e.extraQualities)t.extraQualities.indexOf(o)===-1&&r.push(o);if(r.length)return[!1,`Missing qualities: ${r.join(\", \")}`]}return[!0]}function St(i,e){return R(i,{extraFormats:[e]})}function Ft(i,e){if(e.type!==\"image\")return[!0];let t=[];e.rotation.mirror&&t.push(\"mirroring\"),e.region.percent&&t.push(\"regionByPct\"),e.region.square?t.push(\"regionSquare\"):e.region.full||t.push(\"regionByPx\"),e.rotation.angle&&(e.rotation.angle%90?t.push(\"rotationArbitrary\"):t.push(\"rotationBy90s\")),e.size.confined&&t.push(\"sizeByConfinedWh\"),!e.size.width&&e.size.height&&t.push(\"sizeByH\"),e.size.percentScale&&t.push(\"sizeByPct\"),(i.sizes||[]).find(n=>n.width===e.size.width&&!e.size.height||n.height===e.size.height&&!e.size.width||n.height===e.size.height&&n.width===e.size.width)?t.push(\"sizeByWhListed\"):(e.size.width&&!e.size.height&&t.push(\"sizeByW\"),e.size.width&&e.size.height&&t.push(\"sizeByWh\")),e.size.upscaled&&t.push(\"sizeUpscaling\");let[o,a]=R(i,{extraFeatures:t,extraQualities:[e.quality],extraFormats:[e.format],exactSize:e.size});return o?[!0]:[!1,a]}function ze(i,e,t){let r=i.width?i.width:i.maxWidth;return t.height<=i.maxHeight&&t.width<=i.maxWidth&&t.height>=i.minHeight&&t.width>=i.minWidth&&(!e||Math.abs(t.width-r)<Math.abs(e.width-r))}function _e(i,e){let t=[],r=Object.assign({unsafeImageService:!1,atAnyCost:!0,fallback:!0,minHeight:64,minWidth:64,maxHeight:1/0,maxWidth:1/0,returnAllOptions:!1,preferFixedSize:!1,allowUnsafe:!1,explain:!1,height:0,width:0},i),o=(m,p=0)=>r.explain?t.push(new Array(p).fill(0).map(x=>\" \").join(\"\")+m().trim()):void 0,a=[],n=[],s=null;o(()=>`Using configuration: ${JSON.stringify(r,null,2)}`);let f=(m,p)=>{if(o(()=>\"Swapping choice\",3),ze(r,p,m)){if(r.preferFixedSize&&m.unsafe){o(()=>`We found an image that was marked as unsafe, but it was the best size. (${m.id})`,4),n.push(m);return}r.returnAllOptions&&p&&n.push(p),o(()=>`We found a new image that was the best size. (${m.id})`,4),s=m}else r.returnAllOptions&&n.push(m)};o(()=>`The input shows we have ${e.length} list(s) of candidates to choose from.`);let h=e.length;for(let m=0;m<h;m++){let p=e[m]();o(()=>`Candidate group ${m}: ${JSON.stringify(p,null,2)}`,1);let x=p.length;o(()=>`Checking candidate list number ${m} and found ${x} potential ways of creating image(s)`,1);for(let d=0;d<x;d++){let c=p[d];if(o(()=>`-> Checking candidate ${d}`,1),c.type===\"unknown\"&&r.atAnyCost&&(o(()=>`We've found an unknown image type, adding this to the \"last resort\" list`,2),a.push(c)),c.type===\"fixed\"&&(c.unsafe?(o(()=>`We've found an unsafe fixed image type, adding this to the \"last resort\" list`,2),a.push(c)):(o(()=>\"We've found a fixed size image, checking if it matches the request\",2),f(c,s))),c.type===\"fixed-service\")if(r.unsafeImageService){o(()=>\"Checking for an image from the tile source, without calculating the right height and width (unsafeImageService)\",2);let F=E(c,r.width,r.height);f(F,s)}else{o(()=>\"Checking for an image from the tile source 3\",2);let F=E(c,c.width,c.height);f(F,s)}if(c.type===\"variable\"&&c.maxWidth){let F=E({id:c.id,type:\"fixed-service\",width:c.maxWidth,height:c.maxWidth,level:c.level,version:c.version},c.maxWidth);f(F,s)}}if(s&&!r.returnAllOptions){if(s.unsafe||r.allowUnsafe)continue;o(()=>`We found a match in choice list number ${m}, no searching any more`);break}}return r.atAnyCost&&n.length===0?(o(()=>s?`We found an image! ${s.id} of type ${s.type}`:'We found no images, but \"atAnyCost\" is set, so returning that'),{best:s||a[0]||null,fallback:a.slice(1),log:t}):r.returnAllOptions?(o(()=>\"Returning all options that we have found\"),{best:(r.atAnyCost?s||n[0]||a[0]:s||n[0])||null,fallback:[...n,...a],log:t}):(o(()=>\"Returning the best image that we found, and a fallback\"),{best:s||n[0]||null,fallback:s?n:n.slice(1),log:t})}function be(i,e,t){let r=i>e?i:e,o=t.length,a=[];for(let n=0;n<o;n++){let s=t[n];if(!s||s.scaleFactors.length===0)continue;let f=s.scaleFactors[0];if(!f)continue;let h=r/f,m=[f];for(;h>=s.width;)f=f*2,m.push(f),h=h/2;a.push({...s,scaleFactors:m})}return a}function Ee(i,e){if(i.length!==e.length)return!1;if(i.length===0&&e.length===0)return!0;let t=i.length,r=!0;for(let a=0;a<t;a++){let n=i[a],s=e[a];if(n.width!==s.width||n.height!==s.height){r=!1;break}}if(r)return!0;let o=0;for(let a=0;a<t;a++)for(let n=0;n<t;n++)if(i[a].width===e[n].width&&i[a].height===e[n].height){o++;break}return o===t}function W(i){return v(0,i)}var M=class{constructor(e={}){w(this,\"config\",{verificationsRequired:1,approximateServices:!1,enableFetching:!0,disableThrottling:!1});w(this,\"fetchingCount\",0);w(this,\"imageServices\",{});w(this,\"knownImageServers\",{});this.config=Object.assign(this.config,e)}setConfig(e){Object.assign(this.config,e)}sample(e,t,r=!0){let o=S(l(e)),a=g(l(e)),n=this.knownImageServers[o];return this.imageServices[a]=Object.assign(e,{real:!0}),!n&&e.tiles&&!W(e)?(this.knownImageServers[o]={verifications:0,malformed:!1,root:o,preLoaded:r,sampledId:l(e),verified:!1,server:null,result:{context:e[\"@context\"]||[],sampledProfile:e.profile,resourceServiceRatio:t&&e.height?t.height/e.height:1,sampledSizes:e.sizes||[],sizeRatios:he(e.width,e.height,e.sizes||[]),sampledTiles:e.tiles||[]}},!0):this.verify(e)}preLoad(e,t=!0){this.knownImageServers[e.root]=e,t&&(this.knownImageServers[e.root].malformed=!1,this.knownImageServers[e.root].verifications=this.config.verificationsRequired)}predict(e,t=!1,r=!1){let o=e?.source,a=S(l(e)),n=this.knownImageServers[a],s=g(l(e));return this.imageServices[s]?this.imageServices[s]||null:!this.config.approximateServices||!n||!n.result||!(o?.height||e.height)||!(o?.width||e.width)||!r&&(n.malformed||n.verifications<this.config.verificationsRequired)||W(e.source)?null:(this.imageServices[s]||(this.imageServices[s]={\"@context\":n.result.context,\"@id\":l(e),id:l(e),protocol:\"http://iiif.io/api/image\",tiles:o?.tiles||be(e.width,e.height,n.result.sampledTiles),sizes:o?.sizes||pe(Math.round(e.width/n.result.resourceServiceRatio),Math.round(e.height/n.result.resourceServiceRatio),n.result.sizeRatios),profile:o?.profile||n.result.sampledProfile,height:o?.height||e.height,width:o?.width||e.width,real:!1}),this.imageServices[s]||null)}async getThumbnailFromResource(e,t,r=!0,o=[]){let a=e?await this.getImageCandidates(e,r):[];return _e(t,[()=>o,()=>a])}async getImageCandidates(e,t=!0){let r=e;if(t&&r&&r.height&&r.width){let o=b(r);for(let a of o){let n={id:l(a),width:a.width?a.width:r.width,height:a.height?a.height:r.height,source:a};await this.loadService(n)}}return Se(e,t,this)}async verify(e){let t=this.predict(e,!1,!0),r=await this.fetchService(l(e));if(!t)return!1;let o=t.height===r.height&&t.width===r.width&&t[\"@context\"]===r[\"@context\"]&&Ee(t.sizes||[],r.sizes||[]);if(o){let a=S(l(e)),n=this.knownImageServers[a];n&&(n.verifications+=1,n.verifications>=this.config.verificationsRequired&&(n.verified=!0))}return o}canLoadSync(e){let t=typeof e==\"string\"?e:l(e),r=g(t);if(this.imageServices[r])return!0;let o=this.knownImageServers[S(t)];return!!(o&&!o.malformed&&o.verifications>=this.config.verificationsRequired)}async markAsMalformed(e){return this.knownImageServers[S(l(e))].malformed=!0,this.loadService(e,!0)}async fetchService(e,t=!1){let r=g(e),o=this.imageServices[r];if(o&&(!t||o.real))return o;if(!this.config.enableFetching)throw new Error(\"Fetching is not enabled\");let a=await this.fetch(r).then(n=>n.json());return!a.id&&a[\"@id\"]&&(a.id=a[\"@id\"]),a.id!==e&&(a.id=e,a[\"@id\"]&&(a[\"@id\"]=e)),this.imageServices[r]=Object.assign(a,{real:!0}),this.imageServices[r]}async fetch(e,t){return fetch(e,t)}async loadService(e,t=!1){if(!this.config.disableThrottling){let a=!0;for(;a;)if(this.fetchingCount>=this.config.verificationsRequired)await new Promise(n=>setTimeout(n,500));else{a=!1;break}}let r=this.knownImageServers[S(l(e))];if(r&&!r.malformed&&!t){await r.result;let a=this.loadServiceSync(e);if(a)return a}this.fetchingCount++;let o=await this.fetchService(l(e),t);return this.fetchingCount--,o.real&&this.sample(o,e),o}loadServiceSync(e){let t=g(l(e));return this.imageServices[t]?this.imageServices[t]:this.config.approximateServices?this.predict(e):null}},Gt=new M;export{We as IIIF_1_IMAGE_LEVEL_0,Me as IIIF_1_IMAGE_LEVEL_0_PROFILE,U as IIIF_1_IMAGE_LEVEL_1,Q as IIIF_1_IMAGE_LEVEL_1_PROFILE,V as IIIF_1_IMAGE_LEVEL_2,D as IIIF_1_IMAGE_LEVEL_2_PROFILE,je as IIIF_2_IMAGE_LEVEL_0,Be as IIIF_2_IMAGE_LEVEL_0_NO_JSON,Te as IIIF_2_IMAGE_LEVEL_0_PROFILE,J as IIIF_2_IMAGE_LEVEL_1,ee as IIIF_2_IMAGE_LEVEL_1_NO_JSON,Z as IIIF_2_IMAGE_LEVEL_1_PROFILE,K as IIIF_2_IMAGE_LEVEL_2,ie as IIIF_2_IMAGE_LEVEL_2_NO_JSON,X as IIIF_2_IMAGE_LEVEL_2_PROFILE,$e as IIIF_3_IMAGE_LEVEL_0,Y as IIIF_3_IMAGE_LEVEL_1,q as IIIF_3_IMAGE_LEVEL_2,M as ImageServiceLoader,Oe as STANFORD_IIIF_1_IMAGE_COMPLIANCE_0,N as STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,k as STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,Pe as STANFORD_IIIF_1_IMAGE_CONFORMANCE_0,H as STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,G as STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,Ce as STANFORD_IIIF_IMAGE_COMPLIANCE_0,j as STANFORD_IIIF_IMAGE_COMPLIANCE_1,T as STANFORD_IIIF_IMAGE_COMPLIANCE_2,Le as STANFORD_IIIF_IMAGE_CONFORMANCE_0,$ as STANFORD_IIIF_IMAGE_CONFORMANCE_1,B as STANFORD_IIIF_IMAGE_CONFORMANCE_2,g as canonicalServiceUrl,_ as combineProfiles,ce as createImageServiceRequest,L as extraFeatures,he as extractFixedSizeScales,pe as fixedSizesFromScales,ue as getCustomSizeFromService,xe as getFixedSizeFromImage,Ie as getFixedSizesFromService,l as getId,Se as getImageCandidates,P as getImageCandidatesFromService,E as getImageFromTileSource,S as getImageServerFromId,b as getImageServices,ct as getSmallestScaleFactorAsSingleImage,de as getType,Gt as imageServiceLoader,C as imageServiceProfiles,we as imageServiceRequestToString,St as imageServiceSupportsFormat,Ft as imageServiceSupportsRequest,O as inferSizeFromUrl,ze as isBestMatch,u as isImageService,te as level0,He as level0Support,re as level1,z as level1Support,oe as level2,A as level2Support,ae as levelToProfile,le as parseImageServiceRequest,me as parseImageServiceUrl,ne as parseRegionParameter,fe as parseRotationParameter,se as parseSizeParameter,_e as pickBestFromCandidates,ve as regionParameterToString,Fe as rotationParameterToString,be as sampledTilesToTiles,ye as sizeParameterToString,Ee as sizesMatch,R as supports,ge as supportsCustomSizes};\n","import type { ImageService, SpecificResource } from \"@iiif/presentation-3\";\n// @ts-ignore\nimport { isImageService } from \"@atlas-viewer/iiif-image-api\";\nimport type { CreatorSideEffect } from \"@manifest-editor/creator-api\";\n\nexport const resizeToFitService: CreatorSideEffect = {\n canvasInteraction: true,\n spatial: true,\n async run(result, { vault, options }) {\n if (\n result &&\n result.type === \"Annotation\" &&\n options.targetType === \"Annotation\"\n ) {\n const fullAnno = vault.get<any>(result);\n\n const target = fullAnno.target as SpecificResource;\n if (!(target && target.source?.type === \"Canvas\")) {\n return;\n }\n\n const canvasRef = target.source;\n const canvas = vault.get(canvasRef);\n if (!canvas.items) {\n return;\n }\n\n if (canvas.behavior.includes(\"multi-image\")) {\n return;\n }\n\n const annoPage = vault.get(canvas.items[0]);\n if (!annoPage) {\n return;\n }\n\n const resourceBody = Array.isArray(fullAnno.body)\n ? fullAnno.body[0]\n : fullAnno.body;\n if (resourceBody.type === \"SpecificResource\" && resourceBody.selector) {\n return;\n }\n\n const bodies = vault.get(fullAnno.body);\n const body = bodies[0];\n\n const serviceList = body.service || [];\n const imageService = serviceList.find((s: any) => isImageService(s)) as\n | ImageService\n | undefined;\n if (imageService) {\n if (imageService.width && imageService.height) {\n if (imageService.width !== body.width) {\n vault.modifyEntityField(\n { id: body.id, type: \"ContentResource\" },\n \"width\",\n imageService.width,\n );\n }\n if (imageService.height !== body.height) {\n vault.modifyEntityField(\n { id: body.id, type: \"ContentResource\" },\n \"height\",\n imageService.height,\n );\n }\n }\n }\n }\n },\n};\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport {\n type CreatorContext,\n type CreatorFunctionContext,\n type CreatorResource,\n creatorHelper,\n} from \"@manifest-editor/creator-api\";\nimport {\n CreateImageServerForm,\n type CreateImageServicePayload,\n} from \"../../ContentResource/ImageServiceCreator/create-image-service\";\n\nexport interface CreateImageServiceAnnotationPayload extends CreateImageServicePayload {\n label?: InternationalString;\n motivation?: string;\n thumbnailSize?: number;\n}\n\nexport async function createImageServiceAnnotation(\n data: CreateImageServiceAnnotationPayload,\n ctx: CreatorFunctionContext,\n): Promise<any> {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const createImage = creatorHelper(ctx, \"Annotation\", \"body\", \"@manifest-editor/image-service-creator\");\n\n const resource = await createImage(data, {\n parent: { resource: annotation, property: \"body\" },\n });\n\n if (targetType === \"Annotation\") {\n return {\n ...annotation,\n body: [resource],\n motivation: data.motivation || \"painting\",\n target: ctx.getTarget(),\n };\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body: [resource],\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n let thumbnail: CreatorResource | undefined = undefined;\n if (data.service?.sizes) {\n // We can use the creator declaratively to get a thumbnail from the service.\n const createThumbnail = creatorHelper(ctx, \"Canvas\", \"thumbnail\", \"@manifest-editor/thumbnail-image\");\n thumbnail = await createThumbnail({\n service: data.service,\n width: data.thumbnailSize || 400,\n });\n }\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled canvas\"] },\n height: resource.resource.height || 1000,\n width: resource.resource.width || 1000,\n thumbnail: thumbnail ? [thumbnail] : undefined,\n items: [page],\n });\n }\n}\n\nexport function CreateImageServiceAnnotationForm(props: CreatorContext<CreateImageServicePayload>) {\n return <CreateImageServerForm {...props} />;\n}\n","import { IIIFLogo } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getJsonResource, isHttpUrl, isImageService } from \"../../resource-probes\";\nimport { CreateImageServerForm, createImageServer, getCanonicalUrl } from \"./create-image-service\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-service-creator\": typeof imageServiceCreator;\n }\n }\n}\n\nexport const imageServiceCreator = defineCreator({\n id: \"@manifest-editor/image-service-creator\",\n configKey: \"iiif-image-services\",\n create: createImageServer,\n label: \"IIIF image\",\n labelMessage: { namespace: \"creators\", key: \"definitions.service.label\" },\n summary: \"Add a zoomable image using an IIIF image service or info.json link.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.service.summary\" },\n icon: <IIIFLogo />,\n tags: [\"image\", \"image-service\"],\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const serviceUrl = getCanonicalUrl(value);\n if (!serviceUrl) return false;\n const service = await getJsonResource(serviceUrl, helpers);\n if (!isImageService(service)) return false;\n return { initialData: { url: value, service } };\n },\n render(ctx) {\n return <CreateImageServerForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"id\", \"type\", \"height\", \"width\", \"format\", \"service\"],\n supports: {\n initialData: true,\n parentFields: [\"logo\", \"body\", \"thumbnail\", \"items\"],\n custom(parent, vault) {\n if (parent.property !== \"items\") {\n return true;\n }\n\n if (parent.resource.type === \"ContentResource\") {\n const resource = vault.get(parent.resource as any, { skipSelfReturn: false } as any) as any;\n return resource?.type === \"Choice\";\n }\n\n return false;\n },\n },\n});\n","import { IIIFLogo } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { repositionMultipleImages } from \"../../side-effects/reposition-multiple-images\";\nimport { resizeResourceToEmptyCanvas } from \"../../side-effects/resize-resource-to-empty-canvas\";\nimport { resizeToFitService } from \"../../side-effects/resize-to-fit-service\";\nimport { CreateImageServiceAnnotationForm, createImageServiceAnnotation } from \"./create-service-annotation\";\nimport { imageServiceCreator } from \"../../ContentResource/ImageServiceCreator\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-service-annotation\": typeof imageServiceAnnotation;\n }\n }\n}\n\n// @todo combine this with the content resource one.\nexport const imageServiceAnnotation = defineCreator({\n id: \"@manifest-editor/image-service-annotation\",\n create: createImageServiceAnnotation,\n label: \"IIIF image\",\n labelMessage: { namespace: \"creators\", key: \"definitions.service.label\" },\n dependencies: [\"@manifest-editor/image-service-creator\"],\n summary: \"Add a zoomable image using an IIIF image service or info.json link.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.service.summary\" },\n tags: [\"image\", \"image-service\"],\n icon: <IIIFLogo />,\n render(ctx) {\n return <CreateImageServiceAnnotationForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supportsResource: imageServiceCreator.supportsResource,\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n sideEffects: [resizeToFitService, resizeResourceToEmptyCanvas, repositionMultipleImages],\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport {\n type CreatorContext,\n type CreatorFunctionContext,\n type CreatorResource,\n creatorHelper,\n} from \"@manifest-editor/creator-api\";\nimport { CreateImageUrlForm, type CreateImageUrlPayload } from \"../../ContentResource/ImageUrlCreator/create-image-url\";\n\nexport interface CreateImageUrlAnnotationPayload extends CreateImageUrlPayload {\n label?: InternationalString;\n motivation?: string;\n}\n\nexport async function createImageUrlAnnotation(\n data: CreateImageUrlAnnotationPayload,\n ctx: CreatorFunctionContext,\n): Promise<CreatorResource> {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const createImage = creatorHelper(ctx, \"Annotation\", \"body\", \"@manifest-editor/image-url-creator\");\n\n const resource = await createImage(data, {\n parent: { resource: annotation, property: \"body\" },\n });\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n body: [resource],\n motivation: data.motivation || \"painting\",\n target: ctx.getTarget(),\n });\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body: [resource],\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled canvas\"] },\n height: resource.resource.height || 1000,\n width: resource.resource.width || 1000,\n items: [page],\n });\n }\n\n throw new Error(\"Unsupported target type\");\n}\n\nexport function CreateImageUrlAnnotationForm(props: CreatorContext<CreateImageUrlPayload>) {\n return <CreateImageUrlForm {...props} />;\n}\n","import { AddImageIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { repositionMultipleImages } from \"../../side-effects/reposition-multiple-images\";\nimport { resizeResourceToEmptyCanvas } from \"../../side-effects/resize-resource-to-empty-canvas\";\nimport { resizeToFitService } from \"../../side-effects/resize-to-fit-service\";\nimport { CreateImageUrlAnnotationForm, createImageUrlAnnotation } from \"./create-image-url-annotation\";\nimport { imageUrlCreator } from \"../../ContentResource/ImageUrlCreator\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-url-annotation\": typeof imageUrlAnnotation;\n }\n }\n}\n\nexport const imageUrlAnnotation = defineCreator({\n id: \"@manifest-editor/image-url-annotation\",\n create: createImageUrlAnnotation,\n label: \"Image\",\n labelMessage: { namespace: \"creators\", key: \"definitions.imageUrl.label\" },\n dependencies: [\"@manifest-editor/image-url-creator\"],\n summary: \"Add an image using a direct image-file link.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.imageUrl.summary\" },\n tags: [\"image\"],\n icon: <AddImageIcon />,\n render(ctx) {\n return <CreateImageUrlAnnotationForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supportsResource: imageUrlCreator.supportsResource,\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n sideEffects: [resizeToFitService, resizeResourceToEmptyCanvas, repositionMultipleImages],\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport { ActionButton, Form, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport {\n type CreatorContext,\n type CreatorFunctionContext,\n type CreatorResource,\n creatorHelper,\n} from \"@manifest-editor/creator-api\";\nimport type { FormEvent } from \"react\";\nimport type { CreateImageUrlPayload } from \"../ImageUrlCreator/create-image-url\";\n\nexport interface CreateImageUrlListPayload {\n images: CreateImageUrlPayload[];\n}\n\nexport async function createImageUrlList(\n payload: CreateImageUrlListPayload,\n ctx: CreatorFunctionContext\n): Promise<CreatorResource[]> {\n const items = [];\n const createImage = creatorHelper(ctx, \"Annotation\", \"body\", \"@manifest-editor/image-url-creator\");\n\n for (const image of payload.images) {\n items.push(await createImage(image, ctx.options));\n }\n\n return items as CreatorResource[];\n}\n\nexport function CreateImageUrlListForm(props: CreatorContext<CreateImageUrlListPayload>) {\n const t = useTranslations(\"creators\");\n const common = useTranslations(\"common\");\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.urls) {\n props.runCreate({ images: formData.urls.split(\"\\n\").map((url: string) => ({ url })) });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <Form.Form onSubmit={onSubmit}>\n <Form.InputContainer className=\"mb-4\">\n <Form.Label>{t(\"form.urlList\")}</Form.Label>\n <Form.TextArea\n aria-label={t(\"form.urlList\")}\n name=\"urls\"\n rows=\"10\"\n defaultValue={\n props.options.initialData?.images?.map((image: CreateImageUrlPayload) => image.url).join(\"\\n\") || \"\"\n }\n />\n </Form.InputContainer>\n <ActionButton primary large type=\"submit\">\n {common(\"actions.create\")}\n </ActionButton>\n </Form.Form>\n </PaddedSidebarContainer>\n );\n}\n","import { type CreatorFunctionContext, type CreatorResource, creatorHelper } from \"@manifest-editor/creator-api\";\nimport type { CreateImageUrlPayload } from \"../../ContentResource/ImageUrlCreator/create-image-url\";\n\nexport async function createImageUrlListAnnotation(\n payload: {\n images: CreateImageUrlPayload[];\n },\n ctx: CreatorFunctionContext,\n): Promise<CreatorResource[]> {\n const items = [];\n const createAnnotation = creatorHelper(ctx, \"AnnotationPage\", \"items\", \"@manifest-editor/image-url-annotation\");\n\n for (const image of payload.images) {\n items.push(await createAnnotation(image, ctx.options));\n }\n\n return items as CreatorResource[];\n}\n","import { ImageListIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { CreateImageUrlListForm } from \"../../ContentResource/ImageUrlListCreator/create-image-url-list\";\nimport { repositionMultipleImages } from \"../../side-effects/reposition-multiple-images\";\nimport { resizeResourceToEmptyCanvas } from \"../../side-effects/resize-resource-to-empty-canvas\";\nimport { resizeToFitService } from \"../../side-effects/resize-to-fit-service\";\nimport { createImageUrlListAnnotation } from \"./create-image-url-list-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-url-list-annotation\": typeof imageUrlListAnnotation;\n }\n }\n}\n\nexport const imageUrlListAnnotation = defineCreator({\n id: \"@manifest-editor/image-url-list-annotation\",\n create: createImageUrlListAnnotation,\n label: \"Multiple images\",\n labelMessage: { namespace: \"creators\", key: \"definitions.imageList.label\" },\n dependencies: [\"@manifest-editor/image-url-annotation\"],\n summary: \"Add several images using one direct image link per line.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.imageList.summary\" },\n tags: [\"image\"],\n icon: <ImageListIcon />,\n render(ctx) {\n return <CreateImageUrlListForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n supports: {\n onlyPainting: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n sideEffects: [resizeToFitService, resizeResourceToEmptyCanvas, repositionMultipleImages],\n staticFields: {\n type: \"Annotation\",\n },\n});\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport { EmptyCanvasIcon } from \"@manifest-editor/components\";\nimport { type CreatorFunctionContext, defineCreator } from \"@manifest-editor/creator-api\";\n\n// @todo combine this with the content resource one.\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/no-body-annotation\": typeof noBodyAnnotation;\n }\n }\n}\n\nexport interface NoBodyAnnotationPayload {\n label?: InternationalString;\n motivation?: string;\n}\n\nexport const noBodyAnnotation = defineCreator({\n id: \"@manifest-editor/no-body-annotation\",\n create: createNoBodyAnnotation,\n label: \"Highlight\",\n labelMessage: { namespace: \"creators\", key: \"definitions.highlight.label\" },\n summary: \"Mark a region of the canvas without adding any content.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.highlight.summary\" },\n icon: <EmptyCanvasIcon />,\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"target\"],\n supports: {\n initialData: true,\n parentTypes: [\"AnnotationPage\"],\n parentFields: [\"items\"],\n disallowPainting: true,\n },\n actionButton: \"Create highlight\",\n actionButtonMessage: { namespace: \"creators\", key: \"definitions.highlight.create\" },\n sideEffects: [],\n staticFields: {\n type: \"Annotation\",\n },\n});\n\nexport function createNoBodyAnnotation(data: NoBodyAnnotationPayload, ctx: CreatorFunctionContext) {\n return ctx.embed({\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n label: data?.label,\n motivation: data.motivation || ctx.options.initialData?.motivation || \"highlighting\",\n target: ctx.getTarget(),\n });\n}\n","import { CanvasPanel, MediaPlayerProvider, useSimpleMediaPlayer } from \"react-iiif-vault\";\nimport { SingleVideo } from \"react-iiif-vault\";\nimport { MediaControls } from \"../MediaControls/MediaControls\";\n\nexport function VideoPlayer({\n media,\n onError,\n duration,\n onDuration,\n onDimensions,\n}: {\n media: SingleVideo;\n duration: number;\n onError?: (error: string) => void;\n onDuration?: (duration: number) => void;\n onDimensions?: (width: number, height: number) => void;\n}) {\n const [{ element, currentTime, progress }, state, actions] = useSimpleMediaPlayer({ duration: duration });\n\n return (\n <MediaPlayerProvider\n element={element}\n state={state}\n actions={actions}\n currentTime={currentTime}\n progress={progress}\n >\n <div\n style={{\n maxHeight: 400,\n aspectRatio: `${(media as any).width}/${(media as any).height}`,\n position: \"relative\",\n }}\n >\n <CanvasPanel.VideoHTML element={element} media={media} playPause={actions.playPause} />\n </div>\n <MediaControls onError={onError} onDuration={onDuration} onDimensions={onDimensions} />\n </MediaPlayerProvider>\n );\n}\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport { getValue } from \"@iiif/helpers\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, ErrorMessage, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { DimensionsTriplet, Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { VideoPlayer } from \"@manifest-editor/ui/VideoPlayer\";\nimport { useEffect, useState } from \"react\";\n\nexport interface CreateVideoAnnotationPayload {\n label?: InternationalString;\n motivation?: string;\n duration?: number;\n url: string;\n width: number;\n height: number;\n}\n\nexport async function createVideoAnnotation(data: CreateVideoAnnotationPayload, ctx: CreatorFunctionContext) {\n const annotation = {\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n };\n\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\";\n\n const body = ctx.embed({\n id: data.url,\n type: \"Video\",\n format: \"video/mp4\",\n width: data.width,\n height: data.height,\n duration: data.duration || 0,\n });\n\n if (targetType === \"Annotation\") {\n return ctx.embed({\n ...annotation,\n label: getValue(data.label) && data.label,\n motivation: data.motivation || ctx.options.initialData?.motivation || \"painting\",\n body,\n target: ctx.getTarget(),\n });\n }\n\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotationResource = ctx.embed({\n ...annotation,\n motivation: \"painting\",\n body,\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotationResource],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: getValue(data.label) ? data.label : undefined,\n duration: data.duration || 0,\n width: data.width,\n height: data.height,\n items: [page],\n });\n }\n}\n\nexport function CreateVideoAnnotationForm(props: CreatorContext<CreateVideoAnnotationPayload>) {\n const property = useTranslations(\"editor-api\");\n const t = useTranslations(\"creators\");\n const [initialData] = useState(() => props.options.initialData as Partial<CreateVideoAnnotationPayload>);\n const [url, setUrl] = useState(initialData.url || \"\");\n const [duration, setDuration] = useState(initialData.duration || 0);\n const [width, setWidth] = useState(initialData.width || 0);\n const [height, setHeight] = useState(initialData.height || 0);\n const [error, setError] = useState(\"\");\n const [label, setLabel] = useState(initialData.label || ({ en: [\"\"] } as InternationalString));\n\n const onSubmit = () => {\n props.runCreate({\n url,\n duration,\n label,\n width,\n height,\n });\n };\n\n useEffect(() => {\n setError(\"\");\n const seed = url === initialData.url ? initialData : {};\n setDuration(seed.duration || 0);\n setWidth(seed.width || 0);\n setHeight(seed.height || 0);\n if (url) {\n // Find label from url.\n const labelFromUrl = url.split(\"/\").pop()?.split(\".\").shift();\n setLabel(url === initialData.url && initialData.label ? initialData.label : { en: [labelFromUrl || \"\"] });\n }\n }, [url, initialData]);\n\n return (\n <PaddedSidebarContainer>\n {error ? (\n <ErrorMessage>\n <div role=\"alert\">{t(\"errors.media\")}</div>\n <details>\n <summary>{t(\"errors.details\")}</summary>\n {error}\n </details>\n </ErrorMessage>\n ) : null}\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"video-url\">{t(\"form.videoUrl\")}</InputLabel>\n <Input\n type=\"url\"\n placeholder=\"https://example.org/video.mp4\"\n id=\"video-url\"\n value={url}\n onChange={(e) => setUrl(e.target.value)}\n />\n </InputContainer>\n\n {url && !error ? (\n <div>\n <LanguageFieldEditor\n key={`${url}__${duration}`}\n containerId={\"label\"}\n focusId={\"label_\"}\n label={property(\"fields.label\")}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n </div>\n ) : null}\n\n {url && !error ? (\n <div className=\"mb-4 bg-black\">\n <VideoPlayer\n duration={duration}\n onDuration={(d) => setDuration(d)}\n onError={(err) => setError(err)}\n media={\n {\n url,\n duration,\n height,\n width,\n type: \"Video\",\n } as any\n }\n onDimensions={(w, h) => {\n setWidth(w || 0);\n setHeight(h || 0);\n }}\n />\n </div>\n ) : null}\n\n {!error && (duration || width || height) ? (\n <InputContainer $wide>\n <DimensionsTriplet\n widthId={\"width\"}\n width={width || 0}\n changeWidth={(v) => setWidth(v)}\n heightId={\"height\"}\n height={height || 0}\n changeHeight={(v) => setHeight(v)}\n durationId={\"duration\"}\n duration={duration || 0}\n changeDuration={(v) => setDuration(v)}\n />\n </InputContainer>\n ) : null}\n\n <ActionButton primary large type=\"button\" onPress={onSubmit} isDisabled={!url || !!error}>\n {t(\"form.addVideo\")}\n </ActionButton>\n </PaddedSidebarContainer>\n );\n}\n","import { VideoIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getContentType, isHttpUrl, matchesExtension } from \"../../resource-probes\";\nimport { CreateVideoAnnotationForm, createVideoAnnotation } from \"./create-video-annotation\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/video-annotation\": typeof videoAnnotation;\n }\n }\n}\n\nexport const videoAnnotation = defineCreator({\n id: \"@manifest-editor/video-annotation\",\n create: createVideoAnnotation,\n label: \"Video\",\n labelMessage: { namespace: \"creators\", key: \"definitions.video.label\" },\n summary: \"Add video from a direct video-file link. Use YouTube for YouTube videos.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.video.summary\" },\n icon: <VideoIcon />,\n render(ctx) {\n return <CreateVideoAnnotationForm {...ctx} />;\n },\n resourceType: \"Annotation\",\n resourceFields: [\"id\", \"type\", \"motivation\", \"body\", \"target\"],\n additionalTypes: [\"Canvas\"],\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const contentType = await getContentType(value, helpers);\n if (contentType.startsWith(\"video/\") || matchesExtension(value, [\".mp4\", \".m4v\", \".webm\", \".mov\"])) {\n return { initialData: { url: value } };\n }\n return false;\n },\n supports: {\n onlyPainting: true,\n initialData: true,\n parentTypes: [\"AnnotationPage\", \"Manifest\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Annotation\",\n },\n});\n","export const ThumbnailStripIcon: React.FC = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"#000000\"\n transform=\"scale(-1, 1)\"\n >\n <g>\n <rect fill=\"none\" height=\"24\" width=\"24\" />\n <path d=\"M16,20H2V4h14V20z M18,8h4V4h-4V8z M18,20h4v-4h-4V20z M18,14h4v-4h-4V14z\" />\n </g>\n </svg>\n);\n","import type { InternationalString } from \"@iiif/presentation-3\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { ThumbnailStripIcon } from \"@manifest-editor/ui/icons/ThumbnailStripIcon\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/empty-annotation-page\": typeof emptyAnnotationPage;\n }\n }\n}\n\nexport const emptyAnnotationPage = defineCreator({\n id: \"@manifest-editor/empty-annotation-page\",\n create: (\n data: {\n label?: InternationalString;\n },\n ctx\n ) => {\n return ctx.embed({\n id: ctx.generateId(\"annotations\"),\n label: data.label,\n type: \"AnnotationPage\",\n items: [],\n });\n },\n label: \"Empty annotation page\",\n labelMessage: { namespace: \"creators\", key: \"definitions.annotationPage.label\" },\n summary: \"Create an empty page to organise annotations.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.annotationPage.summary\" },\n icon: <ThumbnailStripIcon />,\n resourceType: \"AnnotationPage\",\n resourceFields: [\"id\", \"type\", \"items\"],\n supports: {\n parentTypes: [\"Manifest\", \"Canvas\", \"Range\"],\n parentFieldMap: {\n Manifest: [\"annotations\"],\n Canvas: [\"items\", \"annotations\"],\n Range: [\"annotations\"],\n },\n },\n});\n","import type { CreatorValidationMessage } from \"@manifest-editor/creator-api\";\n\n/** Only known first-party failures are mapped. Technical/third-party errors retain shell handling. */\nexport function creatorValidationError(error: unknown): CreatorValidationMessage | undefined {\n if (!(error instanceof Error)) return undefined;\n const keys: Record<string, string> = {\n \"Enter an absolute HTTP or HTTPS URL for the WebVTT file.\": \"vttUrl\",\n \"WebVTT captions must belong to a Canvas.\": \"vttCanvas\",\n \"Could not load the image service\": \"service\",\n \"Could not find Manifest\": \"manifest\",\n \"Could not find Manifest ID\": \"manifest\",\n \"Manifest not found\": \"manifest\",\n \"Collection not found\": \"collection\",\n \"Canvas not found\": \"canvas\",\n };\n const key = Object.hasOwn(keys, error.message) ? keys[error.message] : undefined;\n return key ? { code: key, message: { namespace: \"creators\", key: `errors.${key}` } } : undefined;\n}\n","import * as React from \"react\";\nimport { SVGProps } from \"react\";\n\nexport const TextFormatIcon = (props: SVGProps<SVGSVGElement>) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" height=\"1em\" width=\"1em\" {...props}>\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M5 17v2h14v-2H5zm4.5-4.2h5l.9 2.2h2.1L12.75 4h-1.5L6.5 15h2.1l.9-2.2zM12 5.98 13.87 11h-3.74L12 5.98z\" />\n </svg>\n);\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport { getValue } from \"@iiif/helpers\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { type FormEvent, useState } from \"react\";\nimport { isHttpUrl } from \"../../resource-probes\";\n\nexport interface CreateVttAnnotationPagePayload {\n url: string;\n label?: InternationalString;\n language?: string;\n}\n\nexport async function createVttAnnotationPage(data: CreateVttAnnotationPagePayload, ctx: CreatorFunctionContext) {\n const url = data.url.trim();\n if (!isHttpUrl(url)) throw new Error(\"Enter an absolute HTTP or HTTPS URL for the WebVTT file.\");\n const canvas = ctx.getParent();\n if (canvas?.type !== \"Canvas\") throw new Error(\"WebVTT captions must belong to a Canvas.\");\n\n const body = ctx.embed({\n id: url,\n type: \"Text\",\n format: \"text/vtt\",\n ...(getValue(data.label) ? { label: data.label } : {}),\n ...(data.language?.trim() ? { language: data.language.trim() } : {}),\n });\n const annotation = ctx.embed({\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n motivation: \"supplementing\",\n body,\n target: canvas,\n });\n return ctx.embed({\n id: ctx.generateId(\"annotation-page\"),\n type: \"AnnotationPage\",\n items: [annotation],\n });\n}\n\nexport function CreateVttAnnotationPageForm(props: CreatorContext<CreateVttAnnotationPagePayload>) {\n const property = useTranslations(\"editor-api\");\n const t = useTranslations(\"creators\");\n const [label, setLabel] = useState<InternationalString>(\n props.options.initialData?.label || { en: [\"Captions in WebVTT format\"] }\n );\n\n const onSubmit = (e: FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n const data = new FormData(e.currentTarget);\n const url = String(data.get(\"url\") || \"\").trim();\n const language = String(data.get(\"language\") || \"\").trim();\n\n props.runCreate({\n url,\n label: getValue(label) ? label : undefined,\n language: language || undefined,\n });\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <p id=\"vtt-help\" className=\"mb-4 text-sm text-gray-600\">\n {t(\"form.vttHelp\")}\n </p>\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"vtt-url\">{t(\"form.vttUrl\")}</InputLabel>\n <Input\n id=\"vtt-url\"\n name=\"url\"\n type=\"url\"\n required\n placeholder=\"https://example.org/captions.vtt\"\n pattern=\"https?://.+\"\n title={t(\"form.absoluteUrl\")}\n aria-describedby=\"vtt-help\"\n defaultValue={props.options.initialData?.url || \"\"}\n />\n </InputContainer>\n\n <LanguageFieldEditor\n focusId=\"vtt-label\"\n label={property(\"fields.label\")}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"vtt-language\">{t(\"form.languageCode\")}</InputLabel>\n <Input\n id=\"vtt-language\"\n name=\"language\"\n type=\"text\"\n placeholder=\"en\"\n title={t(\"form.languageCodeHelp\")}\n defaultValue={props.options.initialData?.language ?? \"en\"}\n />\n </InputContainer>\n\n <ActionButton primary large type=\"submit\">\n {t(\"form.addCaptions\")}\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { creatorValidationError } from \"../../validation-messages\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { canvasHasAv } from \"@manifest-editor/editor-api\";\nimport { TextFormatIcon } from \"@manifest-editor/ui/icons/TextFormatIcon\";\nimport { CreateVttAnnotationPageForm, createVttAnnotationPage } from \"./create-vtt-annotation-page\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/vtt-annotation-page\": typeof vttAnnotationPage;\n }\n }\n}\n\nexport const vttAnnotationPage = defineCreator({\n validationErrorMessage: creatorValidationError,\n id: \"@manifest-editor/vtt-annotation-page\",\n label: \"WebVTT captions\",\n labelMessage: { namespace: \"creators\", key: \"definitions.vtt.label\" },\n tags: [\"captions\"],\n summary: \"Add subtitles or captions from a WebVTT file to an audio or video canvas.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.vtt.summary\" },\n icon: <TextFormatIcon />,\n create: createVttAnnotationPage,\n render: (ctx) => <CreateVttAnnotationPageForm {...ctx} />,\n resourceType: \"AnnotationPage\",\n resourceFields: [\"id\", \"type\", \"items\"],\n supports: {\n parentTypes: [\"Canvas\"],\n parentFields: [\"annotations\"],\n custom: ({ resource }, vault) => canvasHasAv(vault, resource),\n },\n});\n","import { canvasLayouts, CANVAS_LAYOUT_META, createCanvasLayoutState } from \"@manifest-editor/editor-api\";\nimport { CanvasLayoutForm, type CanvasLayoutPayload } from \"@manifest-editor/editors\";\nimport { EmptyCanvasIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/empty-canvas\": typeof emptyCanvas;\n }\n }\n}\n\nexport const emptyCanvas = defineCreator({\n id: \"@manifest-editor/empty-canvas\",\n create: (data: CanvasLayoutPayload, ctx) => {\n const canvasId = ctx.generateId(\"canvas\");\n const page = ctx.embed({\n id: ctx.generateId(\"annotation-page\", { id: canvasId, type: \"Canvas\" }),\n type: \"AnnotationPage\",\n items: [],\n });\n\n const resource = ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"\"] },\n height: data.height || 2000,\n width: data.width || 3000,\n items: [page],\n });\n const layout = canvasLayouts.find((layout) => layout.id === data.layoutId);\n if (layout) resource.meta[CANVAS_LAYOUT_META] = { state: createCanvasLayoutState(layout) };\n return resource;\n },\n render: (ctx) => <CanvasLayoutForm runCreate={ctx.runCreate} />,\n label: \"Empty canvas\",\n labelMessage: { namespace: \"creators\", key: \"definitions.emptyCanvas.label\" },\n summary: \"Start with an image layout or a blank canvas\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.emptyCanvas.summary\" },\n icon: <EmptyCanvasIcon />,\n resourceType: \"Canvas\",\n resourceFields: [\"id\", \"type\", \"label\", \"height\", \"width\", \"items\"],\n supports: {\n parentTypes: [\"Manifest\"],\n parentFields: [\"items\"],\n },\n});\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import { LocalizedIIIFBrowser } from \"@manifest-editor/components\";\nimport { useTranslations } from \"@manifest-editor/i18n\";\nimport { useNotebookBrowserPlugins } from \"@manifest-editor/shell\";\nimport { type CreatorContext, type CreatorFunctionContext, defineCreator } from \"@manifest-editor/creator-api\";\nimport type { IIIFBrowserProps } from \"iiif-browser\";\nimport { ThumbnailStripIcon } from \"@manifest-editor/ui/icons/ThumbnailStripIcon\";\nimport { useManifest, useVault, VaultProvider } from \"react-iiif-vault\";\nimport invariant from \"tiny-invariant\";\nimport { useMemo, useRef } from \"react\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/internal-canvas\": typeof internalCanvas;\n }\n }\n}\n\nexport const internalCanvas = defineCreator({\n id: \"@manifest-editor/internal-canvas\",\n create: createInternalCanvas,\n label: \"Existing canvas\",\n labelMessage: { namespace: \"creators\", key: \"definitions.internalCanvas.label\" },\n summary: \"Choose a canvas from this manifest.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.internalCanvas.summary\" },\n icon: <ThumbnailStripIcon />,\n resourceType: \"Canvas\",\n resourceFields: [\"id\", \"type\", \"label\"],\n supports: {\n parentTypes: [\"Manifest\"],\n parentFields: [\"start\"],\n },\n render: (ctx) => <InternalCanvas {...ctx} />,\n});\n\nfunction InternalCanvas(props: CreatorContext<InternalCanvasPayload>) {\n const t = useTranslations(\"creators\");\n const notebookPlugins = useNotebookBrowserPlugins();\n const { runCreate } = props;\n const live = useRef({ t, runCreate });\n live.current = { t, runCreate };\n const manifest = useManifest();\n const vault = useVault();\n\n const navigationOptions = useMemo(() => {\n return {\n canSelectCanvas: true,\n canSelectCollection: false,\n canSelectManifest: false,\n canCropImage: false,\n alwaysShowNavigationArrow: false,\n multiSelect: false,\n } as IIIFBrowserProps[\"navigation\"];\n }, []);\n\n const output = useMemo(() => {\n return [\n {\n type: \"callback\",\n cb: (url: string) => live.current.runCreate({ id: url }),\n // The browser retains output descriptors at mount; resolve the label when displayed.\n get label() {\n return live.current.t(\"browser.selectCanvas\");\n },\n supportedTypes: [\"Canvas\"],\n format: { type: \"url\" },\n },\n ] as IIIFBrowserProps[\"output\"];\n }, [live]);\n\n const historyOptions = useMemo(() => {\n return {\n saveToLocalStorage: false,\n restoreFromLocalStorage: false,\n initialHistory: [\n {\n url: manifest?.id,\n resource: manifest?.id,\n route: `/manifest?id=${encodeURIComponent(manifest?.id || \"\")}`,\n metadata: { type: \"Manifest\" },\n },\n ],\n } as IIIFBrowserProps[\"history\"];\n }, [manifest?.id]);\n\n invariant(manifest, \"Manifest is not loaded\");\n\n return (\n <VaultProvider vault={vault}>\n <LocalizedIIIFBrowser\n plugins={notebookPlugins}\n vault={vault}\n navigation={navigationOptions}\n output={output}\n history={historyOptions}\n />\n </VaultProvider>\n );\n}\n\nexport interface InternalCanvasPayload {\n id: string;\n}\n\nasync function createInternalCanvas(data: InternalCanvasPayload, ctx: CreatorFunctionContext) {\n const canvas = ctx.vault.get({ id: data.id, type: \"Canvas\" }, { skipSelfReturn: true });\n invariant(canvas, \"Selected Canvas is not loaded\");\n return ctx.embed(canvas);\n}\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport { ActionButton, HTMLEditor, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { InputContainer, InputLabel, RichTextLanguageField } from \"@manifest-editor/editors\";\nimport { useConfig } from \"@manifest-editor/shell\";\nimport { useState } from \"react\";\n\nexport interface CreateHTMLBodyPayload {\n language?: string;\n body: string;\n}\n\nexport async function createHtmlBody(data: CreateHTMLBodyPayload, ctx: CreatorFunctionContext) {\n return ctx.embed({\n id: ctx.generateId(`html/${data.language}`),\n language: data.language,\n type: \"TextualBody\",\n format: \"text/html\",\n value: data.body || \"\",\n });\n}\n\nexport function CreateHTMLBodyForm(props: CreatorContext<CreateHTMLBodyPayload>) {\n const common = useTranslations(\"common\");\n const { i18n } = useConfig();\n const [body, setBodyValue] = useState<string>(props.options.initialData?.body ?? \"<p></p>\");\n const [language, setLang] = useState<string>(props.options.initialData?.language ?? i18n.defaultLanguage);\n\n const onSubmit = () => {\n props.runCreate({\n language,\n body,\n });\n };\n\n return (\n <PaddedSidebarContainer>\n <HTMLEditor value={body} onChange={(newValue) => setBodyValue(newValue)} />\n\n <ActionButton primary large type=\"button\" onPress={onSubmit}>\n {common(\"actions.create\")}\n </ActionButton>\n </PaddedSidebarContainer>\n );\n}\n","import { defineCreator } from \"@manifest-editor/creator-api\";\nimport { TextIcon } from \"@manifest-editor/components\";\nimport { CreateHTMLBodyForm, createHtmlBody } from \"./create-html-body\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/html-body-creator\": typeof htmlBodyCreator;\n }\n }\n}\n\nexport const htmlBodyCreator = defineCreator({\n id: \"@manifest-editor/html-body-creator\",\n create: createHtmlBody,\n label: \"Formatted text\",\n labelMessage: { namespace: \"creators\", key: \"definitions.htmlBody.label\" },\n summary: \"Write formatted text as the content of an annotation.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.htmlBody.summary\" },\n icon: <TextIcon />,\n render(ctx) {\n return <CreateHTMLBodyForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"id\", \"language\", \"type\", \"format\", \"value\"],\n supports: {\n parentTypes: [\"Annotation\", \"ContentResource\"],\n parentFields: [\"body\", \"items\"],\n custom(parent, vault) {\n if (parent.resource.type === \"Annotation\") {\n return parent.property === \"body\";\n }\n\n const resource = vault.get(parent.resource as any, { skipSelfReturn: false } as any) as any;\n return parent.property === \"items\" && resource?.type === \"Choice\";\n },\n },\n staticFields: {\n type: \"TextualBody\",\n format: \"text/html\",\n },\n});\n","import { type ContentState, normaliseContentState, parseContentState, Vault } from \"@iiif/helpers\";\nimport { canonicalServiceUrl, getImageServices, isImageService } from \"@iiif/parser/image-3\";\nimport type { Canvas } from \"@iiif/presentation-3\";\nimport type { CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { lazy } from \"react\";\nimport invariant from \"tiny-invariant\";\nimport { browserImageApiSelector, browserTransformDimensions, type IIIFBrowserOutputItem } from \"./iiif-browser-output\";\n\nexport function croppedRegion(\n imageServiceId: string,\n region: {\n x: number;\n y: number;\n width: number;\n height: number;\n },\n size: string,\n rotation: number | string = 0\n) {\n return `${imageServiceId}/${Math.floor(region.x)},${Math.floor(region.y)},${Math.floor(region.width)},${Math.floor(\n region.height\n )}/${size}/${rotation}/default.jpg`;\n}\n\nexport interface IIIFBrowserCreatorPayload {\n // This is the output (JSON) from the IIIF Browser.\n // We could have gone with \"IIIF Content State\" here and may do in the future, but this\n // will simplify parsing and importing resources.\n output: IIIFBrowserOutputItem[];\n trackSize?: (dimensions: { width: number; height: number }) => void;\n trackManifest?: (manifest: { requiredStatement: any; rights: any; metadata?: any[]; partOf: any[] }) => void;\n}\n\nexport async function createFromIIIFBrowserOutput(data: IIIFBrowserCreatorPayload, ctx: CreatorFunctionContext) {\n const targetType = ctx.options.targetType as \"Annotation\" | \"Canvas\" | \"ContentResource\";\n const resources = data.output;\n\n const returnResources: any[] = [];\n\n for (const { resource, selector, parent, rotation } of resources) {\n const type = resource.type;\n const previewVault = new Vault();\n\n if (isImageService(resource) || type === \"ImageService\") {\n const service = isImageService(resource)\n ? resource\n : await fetch(canonicalServiceUrl(resource.id)).then((response) => {\n if (!response.ok) throw new Error(\"Could not load the image service\");\n return response.json();\n });\n let body = await ctx.create(\n \"@manifest-editor/image-service-creator\",\n { url: resource.id, service },\n { targetType: \"ContentResource\" }\n );\n const dimensions = browserTransformDimensions(\n selector?.type === \"BoxSelector\"\n ? { width: Math.floor(selector.spatial.width), height: Math.floor(selector.spatial.height) }\n : { width: service.width, height: service.height },\n rotation\n );\n data.trackSize?.(dimensions);\n const imageApiSelector = browserImageApiSelector(selector, rotation);\n if (imageApiSelector) {\n body = ctx.embed({ type: \"SpecificResource\", source: body, selector: imageApiSelector });\n }\n if (targetType === \"ContentResource\") {\n returnResources.push(body);\n continue;\n }\n const canvasId = targetType === \"Canvas\" ? ctx.generateId(\"Canvas\") : undefined;\n const annotation = ctx.embed({\n id: ctx.generateId(\"Annotation\"),\n type: \"Annotation\",\n motivation: \"painting\",\n body,\n target: canvasId ?? ctx.getTarget(),\n });\n returnResources.push(\n targetType === \"Canvas\"\n ? ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: resource.label || { en: [\"Untitled canvas\"] },\n ...dimensions,\n items: [ctx.embed({ id: ctx.generateId(\"AnnotationPage\"), type: \"AnnotationPage\", items: [annotation] })],\n })\n : annotation\n );\n continue;\n }\n\n // Case 1 - we want the WHOLE canvas to come across.\n if (targetType === \"Canvas\" || targetType === \"Annotation\" || targetType === \"ContentResource\") {\n // Then we should have gotten eit\n\n if (type === \"Canvas\") {\n const canvasId = resource.id;\n const manifestId = parent?.type === \"Manifest\" ? parent.id : undefined;\n invariant(manifestId, \"Could not find Manifest\");\n\n const existingManifest = previewVault.get({\n id: manifestId,\n type: \"Manifest\",\n });\n // 1st. Check the preview vault.\n const manifest = existingManifest || (await previewVault.loadManifest(manifestId));\n\n invariant(manifest, \"Manifest not found\");\n\n const addManifestMetadataToCanvas = ctx.config.addManifestMetadataToCanvas !== false;\n data.trackManifest?.({\n requiredStatement: manifest.requiredStatement,\n rights: manifest.rights,\n ...(addManifestMetadataToCanvas ? { metadata: manifest.metadata || [] } : {}),\n partOf: [{ id: manifestId, type: \"Manifest\", label: manifest.label }],\n });\n const addManifestTracking = (resource: any): any => {\n if (resource.type === \"SpecificResource\" && resource.source) {\n return {\n ...resource,\n source: addManifestTracking(resource.source),\n };\n }\n const metadata =\n resource.type === \"Canvas\" && !addManifestMetadataToCanvas ? {} : { metadata: manifest.metadata || [] };\n\n return {\n requiredStatement: manifest.requiredStatement,\n rights: manifest.rights,\n ...metadata,\n ...resource,\n partOf: [{ id: manifestId, type: \"Manifest\", label: manifest.label }],\n };\n };\n\n const canvasRef = manifest.items.find((item) => item.id === canvasId);\n\n invariant(canvasRef, \"Canvas not found\");\n\n const canvas = previewVault.get(canvasRef);\n\n const imageApiSelector = browserImageApiSelector(selector, rotation);\n\n if (targetType === \"Canvas\" && !imageApiSelector) {\n const fullCanvas = previewVault.toPresentation3<Canvas>(canvas)!;\n if (!fullCanvas.label) {\n fullCanvas.label = { en: [\"Untitled canvas\"] };\n }\n\n // Load before embedding.\n ctx.vault.loadSync(fullCanvas.id, addManifestTracking(fullCanvas));\n // Embed the loaded canvas so empty defaults do not overwrite its content on commit.\n returnResources.push(ctx.embed(ctx.vault.get({ id: fullCanvas.id, type: \"Canvas\" })));\n continue;\n }\n\n const annotationPage = previewVault.get(canvas.items[0]!);\n const annotation = previewVault.get(annotationPage.items[0]!);\n if (targetType === \"Annotation\" || targetType === \"Canvas\" || targetType === \"ContentResource\") {\n const fullAnnotation = previewVault.toPresentation3<any>(annotation);\n fullAnnotation.id = ctx.generateId(\"Annotation\");\n\n let service = null;\n\n const dimensions = { width: 0, height: 0 };\n\n if (fullAnnotation?.body?.service) {\n const width = fullAnnotation?.body.width;\n const height = fullAnnotation?.body.height;\n service = getImageServices(fullAnnotation?.body)[0];\n\n if (service && (!service.width || !service.height)) {\n service.width = width;\n service.height = height;\n }\n\n dimensions.width = width;\n dimensions.height = height;\n if (data.trackSize) {\n data.trackSize(dimensions);\n }\n }\n\n // Check for selector on state.\n if (imageApiSelector) {\n // Preserve the existing cropped request URL when a region exists.\n const newBody = { ...fullAnnotation.body };\n let thumbnailId = \"\";\n // Cropped id.\n if (service && selector?.type === \"BoxSelector\") {\n const id = service.id || service[\"@id\"] || \"\";\n if (id) {\n newBody.id = croppedRegion(id, selector.spatial, \"max\", rotation);\n thumbnailId = croppedRegion(id, selector.spatial, \"512,\", rotation);\n }\n }\n // Generate cropped image URL.\n\n fullAnnotation.body = {\n id: ctx.generateId(\"SpecificResource\", annotation),\n type: \"SpecificResource\",\n source: newBody,\n selector: imageApiSelector,\n };\n\n const transformedDimensions = browserTransformDimensions(\n selector?.type === \"BoxSelector\"\n ? {\n width: ~~selector.spatial.width,\n height: ~~selector.spatial.height,\n }\n : dimensions,\n rotation\n );\n if (data.trackSize) {\n data.trackSize(transformedDimensions);\n }\n\n if (targetType === \"ContentResource\") {\n returnResources.push(addManifestTracking(fullAnnotation.body));\n continue;\n }\n\n // Canvas.\n if (targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"Canvas\", annotation);\n fullAnnotation.target = canvasId;\n // Page then canvas.\n const pageId = ctx.generateId(\"Page\", annotation);\n const annotationPage = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [fullAnnotation],\n });\n\n const { width, height } = transformedDimensions;\n\n returnResources.push(\n ctx.embed(\n addManifestTracking({\n id: canvasId,\n type: \"Canvas\",\n label: { en: [\"Untitled canvas\"] },\n width,\n height,\n thumbnail: thumbnailId\n ? [\n ctx.embed({\n id: thumbnailId,\n type: \"Image\",\n format: \"image/jpeg\",\n width: 512,\n height: Math.round((height / width) * 512),\n }),\n ]\n : undefined,\n items: [annotationPage],\n })\n )\n );\n continue;\n }\n\n returnResources.push(\n ctx.embed(\n addManifestTracking({\n ...fullAnnotation,\n target: ctx.getTarget(),\n })\n )\n );\n continue;\n }\n\n // @todo check return types (At the moment only annotation is supported.)\n\n returnResources.push(\n ctx.embed(\n addManifestTracking({\n ...fullAnnotation,\n target: ctx.getTarget(),\n })\n )\n );\n }\n }\n }\n }\n\n return returnResources;\n}\nexport const IIIFBrowserCreatorForm = lazy(() => import(\"./iiif-browser-form.lazy\"));\n","import { isImageService } from \"@iiif/parser/image-3\";\nimport type { ImageService, SpecificResource } from \"@iiif/presentation-3\";\nimport type { CreatorSideEffect } from \"@manifest-editor/creator-api\";\nimport { croppedRegion } from \"../ContentResource/IIIFBrowserCreator/iiif-browser-creator\";\n\nexport const updateCanvasThumbnailFromCrop: CreatorSideEffect = {\n canvasInteraction: true,\n spatial: true,\n async run(result, { vault, options }) {\n if (\n !(\n result &&\n result.type === \"Annotation\" &&\n options.targetType === \"Annotation\"\n )\n ) {\n return;\n }\n\n const fullAnno = vault.get<any>(result);\n const target = fullAnno.target as SpecificResource;\n if (!(target && target.source?.type === \"Canvas\")) {\n return;\n }\n\n const bodyRef = Array.isArray(fullAnno.body)\n ? fullAnno.body[0]\n : fullAnno.body;\n const selector = bodyRef?.selector;\n if (\n !(\n selector &&\n (selector.type === \"iiif:ImageApiSelector\" ||\n selector.type === \"ImageApiSelector\") &&\n selector.region\n )\n ) {\n return;\n }\n\n const [x, y, width, height] = selector.region.split(\",\").map(Number);\n if (\n ![x, y, width, height].every(Number.isFinite) ||\n width <= 0 ||\n height <= 0\n ) {\n return;\n }\n\n const [body] = vault.get(fullAnno.body);\n const imageService = (body?.service || []).find((s: any) =>\n isImageService(s),\n ) as ImageService | undefined;\n const serviceId = imageService?.id || imageService?.[\"@id\"];\n if (!serviceId) {\n return;\n }\n\n const thumbnailId = croppedRegion(serviceId, { x, y, width, height }, \"512,\");\n vault.loadSync(thumbnailId, {\n id: thumbnailId,\n type: \"Image\",\n format: \"image/jpeg\",\n width: 512,\n height: Math.round((height / width) * 512),\n service: [imageService],\n });\n vault.modifyEntityField(target.source, \"thumbnail\", [\n { id: thumbnailId, type: \"ContentResource\" },\n ]);\n },\n};\n","import { creatorValidationError } from \"../../validation-messages\";\nimport { IIIFBrowserIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getIIIFType, getJsonResource, isDigitalCollectionPage } from \"../../resource-probes\";\nimport { repositionMultipleImages } from \"../../side-effects/reposition-multiple-images\";\nimport { resizeResourceToEmptyCanvas } from \"../../side-effects/resize-resource-to-empty-canvas\";\nimport { resizeToFitService } from \"../../side-effects/resize-to-fit-service\";\nimport { updateCanvasThumbnailFromCrop } from \"../../side-effects/update-canvas-thumbnail-from-crop\";\nimport { IIIFBrowserCreatorForm, createFromIIIFBrowserOutput } from \"./iiif-browser-creator\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/iiif-browser-creator\": typeof iiifBrowserCreator;\n }\n }\n}\n\nexport const iiifBrowserCreator = defineCreator({\n validationErrorMessage: creatorValidationError,\n id: \"@manifest-editor/iiif-browser-creator\",\n create: createFromIIIFBrowserOutput,\n label: \"Browse IIIF content\",\n labelMessage: { namespace: \"creators\", key: \"definitions.browser.label\" },\n hideSummary: true,\n summary: \"Browse an IIIF manifest, collection, or supported collection webpage and choose content to add.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.browser.summary\" },\n icon: <IIIFBrowserIcon />,\n configuration: {\n fields: [\n {\n id: \"addManifestMetadataToCanvas\",\n type: \"checkbox\",\n label: \"Add manifest metadata to imported canvases\",\n labelMessage: { namespace: \"creators\", key: \"definitions.browser.copyMetadata\" },\n summary: \"Copies metadata from the source Manifest when the IIIF Browser creates a Canvas.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.browser.copyMetadataHelp\" },\n defaultValue: true,\n },\n ],\n },\n render(ctx: any) {\n return <IIIFBrowserCreatorForm {...ctx} />;\n },\n hiddenModal: true,\n tags: [\"image\", \"image-service\"],\n async supportsResource(value, helpers) {\n const resource = await getJsonResource(value, helpers);\n const type = getIIIFType(resource);\n if (type === \"Manifest\" || type === \"Collection\") {\n return { initialData: { url: value } };\n }\n if (await isDigitalCollectionPage(value)) {\n return { initialData: { url: value } };\n }\n return false;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"id\", \"language\", \"type\", \"format\", \"value\"],\n additionalTypes: [\"Annotation\", \"Canvas\"],\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"Annotation\", \"Manifest\", \"AnnotationPage\"],\n parentFields: [\"body\", \"items\"],\n parentFieldMap: {\n Annotation: [\"body\"],\n Manifest: [\"items\"],\n AnnotationPage: [\"items\"],\n },\n },\n sideEffects: [\n updateCanvasThumbnailFromCrop,\n resizeToFitService,\n resizeResourceToEmptyCanvas,\n repositionMultipleImages,\n ],\n staticFields: {},\n});\n","import { ImageListIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { CreateImageUrlListForm, createImageUrlList } from \"./create-image-url-list\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/image-url-list\": typeof imageUrlListCreator;\n }\n }\n}\n\nexport const imageUrlListCreator = defineCreator({\n id: \"@manifest-editor/image-url-list\",\n label: \"Multiple images\",\n labelMessage: { namespace: \"creators\", key: \"definitions.imageList.label\" },\n summary: \"Add several images using one direct image link per line.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.imageList.summary\" },\n create: createImageUrlList,\n icon: <ImageListIcon />,\n render(ctx) {\n return <CreateImageUrlListForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"format\"],\n supports: {\n parentFields: [\"logo\", \"body\", \"thumbnail\"],\n },\n staticFields: {\n type: \"Image\",\n },\n});\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { type FormEvent, useState } from \"react\";\n\nexport interface CreatePlaintextPayload {\n url: string;\n label?: InternationalString;\n}\n\nexport async function createPlaintext(data: CreatePlaintextPayload, ctx: CreatorFunctionContext) {\n return ctx.embed({\n id: data.url,\n type: \"Text\",\n label: data.label,\n format: \"text/plain\",\n });\n}\n\nexport function CreatePlaintextForm(props: CreatorContext) {\n const property = useTranslations(\"editor-api\");\n const t = useTranslations(\"creators\");\n const common = useTranslations(\"common\");\n const [label, setLabel] = useState<InternationalString>(\n props.options.initialData?.label || {\n en: [\"View as text\"],\n }\n );\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.url) {\n props.runCreate({ url: formData.url, label });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <LanguageFieldEditor\n focusId={\"label\"}\n label={property(\"fields.label\")}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"url\">{t(\"form.textUrl\")}</InputLabel>\n <Input type=\"url\" id=\"url\" name=\"url\" defaultValue={props.options.initialData?.url || \"\"} />\n </InputContainer>\n\n <ActionButton primary large type=\"submit\">\n {common(\"actions.create\")}\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { getContentType, isHttpUrl, matchesExtension } from \"../../resource-probes\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { TextFormatIcon } from \"@manifest-editor/ui/icons/TextFormatIcon\";\nimport { CreatePlaintextForm, createPlaintext } from \"./create-plaintext\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/plaintext-creator\": typeof plaintextCreator;\n }\n }\n}\n\nexport const plaintextCreator = defineCreator({\n id: \"@manifest-editor/plaintext-creator\",\n create: createPlaintext,\n label: \"Plain text link\",\n labelMessage: { namespace: \"creators\", key: \"definitions.plaintext.label\" },\n summary: \"Link to an external plain-text file.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.plaintext.summary\" },\n icon: <TextFormatIcon />,\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const contentType = await getContentType(value, helpers);\n return contentType.startsWith(\"text/plain\") || matchesExtension(value, [\".txt\"])\n ? { initialData: { url: value } }\n : false;\n },\n render(ctx) {\n return <CreatePlaintextForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"label\", \"format\"],\n supports: {\n initialData: true,\n parentFields: [\"seeAlso\", \"rendering\"],\n },\n staticFields: {\n format: \"text/plain\",\n },\n});\n","import {\n canonicalServiceUrl,\n createImageServiceRequest,\n imageServiceRequestToString,\n parseImageServiceRequest,\n} from \"@iiif/parser/image-3\";\nimport type { ImageService } from \"@iiif/presentation-3\";\nimport { normalizeImageService } from \"../image-service-options\";\n\nexport function serviceImageAtSize(service: ImageService, size: { width: number; height?: number }) {\n const request = createImageServiceRequest(normalizeImageService(service));\n return imageServiceRequestToString({\n identifier: request.identifier,\n server: request.server,\n scheme: request.scheme,\n type: \"image\",\n size: {\n max: false,\n confined: false,\n upscaled: false,\n width: size.width,\n height: size.height,\n },\n format: \"jpg\",\n // This isn't how it should be modelled, always full,\n // region: data.selector ? data.selector : { full: true },\n region: { full: true },\n rotation: { angle: 0 },\n quality: \"default\",\n prefix: request.prefix,\n originalPath: (request as any).originalPath,\n });\n}\n\nexport function getCanonicalUrl(url: string) {\n return url.endsWith(\"default.jpg\")\n ? imageServiceRequestToString({\n ...parseImageServiceRequest(url),\n type: \"info\",\n })\n : canonicalServiceUrl(url);\n}\n","import { useServiceRequest } from \"../../use-service-request\";\nimport { useEditorI18n, useTranslations } from \"@manifest-editor/i18n\";\nimport type { ImageService } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext, CreatorResource } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel } from \"@manifest-editor/editors\";\nimport { type FormEvent, useMemo, useState } from \"react\";\nimport { getCanonicalUrl, serviceImageAtSize } from \"./thumbnail-helpers\";\nimport { compactImageService, normalizeImageService } from \"../image-service-options\";\n\nexport interface CreateThumbnailPayload {\n service: ImageService;\n thumbnailUrl?: string;\n width: number;\n height?: number;\n}\n\nexport async function createThumbnail(data: CreateThumbnailPayload, ctx: CreatorFunctionContext) {\n // Here is where we can add a thumbnail, if appropriate.\n const service = normalizeImageService(data.service);\n const sizes = service.sizes;\n // Thumbnails retain available sizes/tiles regardless of the workspace's painting-image defaults.\n const embeddedService = compactImageService(service, ctx.config, true);\n\n if (data.thumbnailUrl) {\n return ctx.embed({\n id: data.thumbnailUrl,\n type: \"Image\",\n format: \"image/jpeg\",\n width: data.width,\n height: data.height,\n service: [embeddedService],\n });\n }\n\n if (sizes) {\n const thumbnailSize = data.width || 400;\n // We have something to work with for a thumbnail - could be improved to listen to height/width.\n let bestMatch: { width: number; height?: number } | null = null;\n for (const size of sizes) {\n if (!bestMatch || Math.abs(size.width - thumbnailSize) < Math.abs(bestMatch.width - thumbnailSize)) {\n bestMatch = { width: size.width, height: size.height };\n }\n }\n if (bestMatch) {\n const imageId = serviceImageAtSize(service, bestMatch);\n\n return ctx.embed({\n id: imageId,\n type: \"Image\",\n format: \"image/jpeg\",\n width: bestMatch.width,\n height: bestMatch.height,\n service: [embeddedService],\n });\n }\n }\n\n // Otherwise we have nothing..\n return null;\n}\n\n// @todo cover a lot more things - like offering size dropdown.\nexport function CreateThumbnailForm(props: CreatorContext) {\n const t = useTranslations(\"creators\");\n const common = useTranslations(\"common\");\n const { locale } = useEditorI18n();\n const [url, setUrl] = useState(props.options.initialData?.url || \"\");\n const [service, setService] = useState<ImageService | null>(props.options.initialData?.service || null);\n const [selectedSize, setSelectedSize] = useState({\n width: props.options.initialData?.width || 0,\n height: props.options.initialData?.height || 0,\n });\n const previewUrl = useMemo(() => {\n if (!service) return null;\n if (!selectedSize.width || !selectedSize.height) return null;\n\n return serviceImageAtSize(service, selectedSize);\n }, [selectedSize, service]);\n\n const { load, loading, failed } = useServiceRequest();\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n const url = formData.url;\n\n if (url) {\n void load(\n () => getCanonicalUrl(url),\n (service) => {\n setService(service);\n const size0 = service.sizes?.[0];\n if (size0) setSelectedSize(size0);\n }\n );\n }\n };\n\n // https://dlcs.digirati.io/iiif-img/58/2/20-carina_nebula~orig.png\n\n if (service) {\n return (\n <PaddedSidebarContainer>\n <div className=\"mb-4\">\n <div className=\"mb-2\">{service[\"@id\"] || service.id}</div>\n <div className=\"flex gap-2 mb-4\">\n {service.sizes?.map((size) => {\n const isSelected = size.width === selectedSize.width;\n return (\n <ActionButton\n key={size.width}\n primary={isSelected}\n isDisabled={isSelected}\n large\n onPress={() => setSelectedSize(size)}\n >\n {t(\"form.dimensions\", {\n width: new Intl.NumberFormat(locale).format(size.width),\n height: size.height === undefined ? \"\" : new Intl.NumberFormat(locale).format(size.height),\n })}\n </ActionButton>\n );\n })}\n </div>\n\n {previewUrl ? <img src={previewUrl} alt={t(\"image.previewAlt\")} /> : null}\n </div>\n\n <ActionButton\n primary\n large\n isDisabled={!previewUrl}\n onPress={() => {\n if (!service) return;\n props.runCreate({\n service,\n width: selectedSize.width,\n height: selectedSize.height,\n thumbnailUrl: previewUrl,\n });\n }}\n >\n {t(\"form.addThumbnail\")}\n </ActionButton>\n </PaddedSidebarContainer>\n );\n }\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit} aria-busy={loading}>\n {failed ? <div role=\"alert\">{t(\"errors.service\")}</div> : null}\n {loading ? <output>{common(\"status.loading\")}</output> : null}\n <div className=\"flex gap-2 items-center\">\n <InputContainer $wide>\n <InputLabel htmlFor=\"url\">{t(\"form.serviceUrl\")}</InputLabel>\n <Input\n id=\"url\"\n name=\"url\"\n defaultValue={props.options.initialData?.url || \"\"}\n onPaste={(e) => {\n const text = e.clipboardData.getData(\"text/plain\");\n setUrl(text ? getCanonicalUrl(text) : \"\");\n }}\n onBlur={(e) => setUrl(e.currentTarget.value ? getCanonicalUrl(e.currentTarget.value) : \"\")}\n />\n </InputContainer>\n </div>\n <div>\n <ActionButton primary large type=\"submit\" isDisabled={!url || loading}>\n {t(\"form.selectSize\")}\n </ActionButton>\n </div>\n </form>\n </PaddedSidebarContainer>\n );\n}\n\nfunction ImageSelectionPreview({ url }: { url: string }) {\n return null;\n}\n","import { ScaledImageIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { imageServiceCreator } from \"../ImageServiceCreator\";\nimport { CreateThumbnailForm, createThumbnail } from \"./create-thumbnail\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/thumbnail-image\": typeof thumbnailCreator;\n }\n }\n}\n\nexport const thumbnailCreator = defineCreator({\n id: \"@manifest-editor/thumbnail-image\",\n configKey: \"iiif-image-services\",\n create: createThumbnail,\n label: \"IIIF thumbnail\",\n labelMessage: { namespace: \"creators\", key: \"definitions.thumbnail.label\" },\n summary: \"Create a thumbnail from an IIIF image service.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.thumbnail.summary\" },\n icon: <ScaledImageIcon />,\n async supportsResource(value, helpers, ctx) {\n const result = await imageServiceCreator.supportsResource!(value, helpers, ctx);\n if (typeof result !== \"object\") return false;\n const size = result.initialData?.service?.sizes?.[0];\n return size ? { initialData: { ...result.initialData, width: size.width, height: size.height } } : false;\n },\n render(ctx) {\n return <CreateThumbnailForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"id\", \"type\", \"format\", \"width\", \"height\", \"service\"],\n supports: {\n initialData: true,\n parentFields: [\"thumbnail\"],\n },\n});\n","export function LinkIcon() {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\" />\n </svg>\n );\n}\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel, LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { type FormEvent, useState } from \"react\";\n\nexport interface CreateWebpagePayload {\n url: string;\n label?: InternationalString;\n}\n\nexport async function createWebPage(data: CreateWebpagePayload, ctx: CreatorFunctionContext) {\n return ctx.embed({\n id: data.url,\n type: \"Text\",\n label: data.label,\n format: \"text/html\",\n });\n}\n\nexport function CreateWebPageForm(props: CreatorContext) {\n const property = useTranslations(\"editor-api\");\n const t = useTranslations(\"creators\");\n const [label, setLabel] = useState<InternationalString>(props.options.initialData?.label || { en: [\"\"] });\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.url) {\n props.runCreate({ url: formData.url, label });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <LanguageFieldEditor\n focusId={\"label\"}\n label={property(\"fields.label\")}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <InputContainer $wide>\n <InputLabel htmlFor=\"url\">{t(\"form.link\")}</InputLabel>\n <Input type=\"url\" id=\"url\" name=\"url\" defaultValue={props.options.initialData?.url || \"\"} />\n </InputContainer>\n\n <ActionButton primary large type=\"submit\">\n {t(\"form.createLink\")}\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { getContentType, isHttpUrl } from \"../../resource-probes\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { LinkIcon } from \"@manifest-editor/ui/icons/LinkIcon\";\nimport { CreateWebPageForm, createWebPage } from \"./create-web-page\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/web-page-creator\": typeof webPageCreator;\n }\n }\n}\n\nexport const webPageCreator = defineCreator({\n id: \"@manifest-editor/web-page-creator\",\n create: createWebPage,\n label: \"Web page\",\n labelMessage: { namespace: \"creators\", key: \"definitions.webpage.label\" },\n summary: \"Link to an external webpage.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.webpage.summary\" },\n icon: <LinkIcon />,\n async supportsResource(value, helpers) {\n if (!isHttpUrl(value)) return false;\n const contentType = await getContentType(value, helpers);\n return contentType.startsWith(\"text/html\") || contentType.startsWith(\"application/xhtml+xml\")\n ? { initialData: { url: value } }\n : false;\n },\n render(ctx) {\n return <CreateWebPageForm {...ctx} />;\n },\n resourceType: \"ContentResource\",\n resourceFields: [\"label\", \"format\"],\n supports: {\n initialData: true,\n parentFields: [\"seeAlso\", \"rendering\", \"homepage\"],\n },\n});\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport type { InternationalString } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext } from \"@manifest-editor/creator-api\";\nimport { Input, InputContainer, InputLabel } from \"@manifest-editor/editors\";\nimport type { FormEvent } from \"react\";\n\nconst ytRegex = /^.*(?:(?:youtu\\.be\\/|v\\/|vi\\/|u\\/\\w\\/|embed\\/|shorts\\/)|(?:(?:watch)?\\?vi?=|&vi?=))([^#&?]*).*/;\n\nexport interface CreateYouTubeBodyPayload {\n youtubeUrl: string;\n label?: InternationalString;\n height?: number;\n width?: number;\n duration: number;\n}\n\nexport function getYouTubeId(url: string) {\n const id = (url || \"\").match(ytRegex);\n return id ? id[1] : null;\n}\n\nexport function validateYouTube(data: CreateYouTubeBodyPayload) {\n return !!getYouTubeId(data.youtubeUrl);\n}\n\nexport function createYoutubeBodyResource(data: CreateYouTubeBodyPayload, ctx: CreatorFunctionContext) {\n const id = getYouTubeId(data.youtubeUrl);\n return ctx.embed({\n id: `https://www.youtube.com/watch?v=${id}`,\n type: \"Video\",\n service: [\n {\n type: \"Service\",\n profile: \"http://digirati.com/objectifier\",\n params: {\n data: `https://www.youtube.com/embed/${id}`,\n },\n },\n {\n id: `https://www.youtube.com/watch?v=${id}`,\n type: \"Service\",\n profile: \"https://www.youtube.com\",\n },\n ],\n });\n}\n\nexport async function createYoutubeBody(data: CreateYouTubeBodyPayload, ctx: CreatorFunctionContext) {\n const body = createYoutubeBodyResource(data, ctx);\n\n if (ctx.options.targetType === \"Canvas\") {\n const canvasId = ctx.generateId(\"canvas\");\n const pageId = ctx.generateId(\"annotation-page\", {\n id: canvasId,\n type: \"Canvas\",\n });\n\n const annotation = ctx.embed({\n id: ctx.generateId(\"annotation\", { id: pageId, type: \"AnnotationPage\" }),\n type: \"Annotation\",\n motivation: \"painting\",\n body: [body],\n target: {\n type: \"SpecificResource\",\n source: { id: canvasId, type: \"Canvas\" },\n },\n });\n\n const page = ctx.embed({\n id: pageId,\n type: \"AnnotationPage\",\n items: [annotation],\n });\n\n return ctx.embed({\n id: canvasId,\n type: \"Canvas\",\n label: data.label || { en: [\"Untitled YouTube canvas\"] },\n height: data.height || 1000,\n width: data.width || 1000,\n duration: data.duration || 1,\n items: [page],\n });\n }\n\n if (ctx.options.targetType === \"Annotation\") {\n return ctx.embed({\n id: ctx.generateId(\"annotation\"),\n type: \"Annotation\",\n motivation: \"painting\",\n body: [body],\n target: ctx.getTarget(),\n });\n }\n\n return body;\n}\n\nexport function YouTubeForm(props: CreatorContext) {\n const t = useTranslations(\"creators\");\n const common = useTranslations(\"common\");\n const initialData = props.options.initialData as Partial<CreateYouTubeBodyPayload>;\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n const data = new FormData(e.target as HTMLFormElement);\n const formData = Object.fromEntries(data.entries()) as any;\n\n if (formData.youtubeUrl) {\n props.runCreate({ youtubeUrl: formData.youtubeUrl });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <InputContainer $wide>\n <InputLabel htmlFor=\"youtubeUrl\">{t(\"form.youtubeUrl\")}</InputLabel>\n <Input type=\"url\" id=\"youtubeUrl\" name=\"youtubeUrl\" defaultValue={initialData.youtubeUrl || \"\"} />\n </InputContainer>\n\n <ActionButton primary large type=\"submit\">\n {common(\"actions.create\")}\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { YouTubeIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { YouTubeForm, createYoutubeBody, getYouTubeId } from \"./create-youtube-body\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/youtube\": typeof youTubeBodyCreator;\n }\n }\n}\n\nexport const youTubeBodyCreator = defineCreator({\n id: \"@manifest-editor/youtube\",\n create: createYoutubeBody,\n label: \"YouTube\",\n labelMessage: { namespace: \"creators\", key: \"definitions.youtube.label\" },\n summary: \"Embed a video using its YouTube link.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.youtube.summary\" },\n icon: <YouTubeIcon />,\n resourceType: \"ContentResource\",\n additionalTypes: [\"Canvas\", \"Annotation\"],\n resourceFields: [\"id\", \"type\", \"service\"],\n supportsResource(value) {\n return getYouTubeId(value) ? { initialData: { youtubeUrl: value } } : false;\n },\n render: (ctx) => <YouTubeForm {...ctx} />,\n supports: {\n initialData: true,\n onlyPainting: true,\n parentTypes: [\"Annotation\", \"Manifest\", \"AnnotationPage\"],\n parentFieldMap: {\n Annotation: [\"body\"],\n Manifest: [\"items\"],\n AnnotationPage: [\"items\"],\n },\n },\n staticFields: {\n type: \"Video\",\n },\n});\n","import {\n type BoxSelector,\n createThumbnailHelper,\n normaliseContentState,\n parseContentState,\n} from \"@iiif/helpers\";\nimport type {\n CreatorFunctionContext,\n CreatorResource,\n} from \"@manifest-editor/creator-api\";\nimport type { Resource } from \"@manifest-editor/shell\";\nimport { lazy } from \"react\";\nimport invariant from \"tiny-invariant\";\n\nexport interface ManifestBrowserCreatorPayload {\n // This is the output (JSON) from the IIIF Browser.\n // We could have gone with \"IIIF Content State\" here and may do in the future, but this\n // will simplify parsing and importing resources.\n output: Array<{\n resource: any;\n parent: { id: string; type: string } | undefined;\n selector: BoxSelector | undefined;\n }>;\n}\n\nexport async function createFromManifestBrowserOutput(\n data: ManifestBrowserCreatorPayload,\n ctx: CreatorFunctionContext,\n) {\n const inputItems = data.output || [];\n const itemsToAdd: CreatorResource[] = [];\n\n for (const item of inputItems) {\n const { resource, parent, selector } = item;\n\n const previewVault = ctx.getPreviewVault();\n const thumbnails = createThumbnailHelper(previewVault);\n\n if (resource.type === \"Manifest\") {\n const manifestId = resource.id;\n invariant(manifestId, \"Could not find Manifest ID\");\n\n // 1st. Check the preview vault.\n const manifest = await previewVault.loadManifest(manifestId);\n const thumbnail = await thumbnails.getBestThumbnailAtSize(\n manifest,\n { width: 256, height: 256 },\n false,\n );\n\n invariant(manifest, \"Manifest not found\");\n itemsToAdd.push(\n ctx.embed({\n id: resource.id,\n type: \"Manifest\",\n label: manifest.label,\n summary: manifest.summary,\n thumbnail: thumbnail?.best\n ? [\n {\n id: thumbnail.best.id,\n type: \"Image\",\n },\n ]\n : undefined,\n }),\n );\n continue;\n }\n\n if (resource.type === \"Collection\") {\n const collectionId = resource.id;\n invariant(collectionId, \"Could not find Manifest ID\");\n const collection = await previewVault.loadManifest(collectionId);\n\n invariant(collection, \"Collection not found\");\n itemsToAdd.push(\n ctx.embed({\n id: resource.id,\n type: \"Collection\",\n label: collection.label,\n }),\n );\n }\n }\n\n return itemsToAdd;\n}\nexport const ManifestBrowserCreatorForm = lazy(\n () => import(\"./manifest-browser-form.lazy\"),\n);\n","import { LocalizedIIIFBrowser } from \"@manifest-editor/components\";\nimport { useEditorI18n, useTranslations, type MessageReference } from \"@manifest-editor/i18n\";\nimport { useNotebookBrowserPlugins } from \"@manifest-editor/shell\";\nimport type { CreatorContext } from \"@manifest-editor/creator-api\";\nimport { PreviewVaultBoundary, usePreviewVault } from \"@manifest-editor/shell\";\nimport type { IIIFBrowserProps } from \"iiif-browser\";\nimport { useMemo, useRef } from \"react\";\n\nexport interface ManifestBrowserCreatorInitialData {\n /** Optional UI message; legacy caller labels remain literal fallbacks. */\n actionLabelMessage?: MessageReference;\n url?: string;\n iiifBrowserOptions?: Partial<IIIFBrowserProps>;\n}\n\nexport default function ManifestBrowserCreatorForm(props: CreatorContext) {\n const t = useTranslations(\"creators\");\n const { resolveMessage } = useEditorI18n();\n const notebookPlugins = useNotebookBrowserPlugins();\n const vault = usePreviewVault();\n const initialData: ManifestBrowserCreatorInitialData = useMemo(() => {\n return props.options.initialData || {};\n }, [props.options.initialData]);\n\n const { runCreate } = props;\n const live = useRef({ t, resolveMessage, reference: initialData.actionLabelMessage, runCreate });\n live.current = { t, resolveMessage, reference: initialData.actionLabelMessage, runCreate };\n const output = useMemo(() => {\n return [\n {\n type: \"callback\",\n // Retained by the browser store: resolve at display time, without replacing the store.\n get label() {\n const { t, resolveMessage, reference } = live.current;\n return resolveMessage(reference, t(\"browser.select\"));\n },\n supportedTypes: [\"Manifest\", \"Collection\", \"ManifestList\", \"CollectionList\", \"CollectionItemList\"],\n cb: (resource) => live.current.runCreate({ output: resource }),\n format: {\n type: \"custom\",\n format: (resource, parent, vault) => {\n const resourcesAsArray = Array.isArray(resource) ? resource : [{ ...resource, parent }];\n const resources = [];\n for (const resource of resourcesAsArray) {\n resources.push({\n resource: vault.get(resource),\n parent: resource.parent,\n selector: resource.selector,\n });\n }\n return resources;\n },\n },\n },\n ] as IIIFBrowserProps[\"output\"];\n }, [live]);\n\n const navigationOptions = useMemo(() => {\n return {\n canCropImage: false,\n canSelectCanvas: false,\n canSelectManifest: true,\n canSelectCollection: true,\n multiSelect: true,\n ...(initialData.iiifBrowserOptions?.navigation || {}),\n };\n }, [initialData.iiifBrowserOptions?.navigation]);\n\n const uiOptions = useMemo(() => {\n return {\n buttonClassName: \"bg-me-primary-500 text-white hover:bg-me-primary-600\",\n homeLink:\n initialData.url ||\n (typeof props.config?.defaultCollection === \"string\" ? props.config.defaultCollection : undefined),\n ...(initialData.iiifBrowserOptions?.ui || {}),\n } as IIIFBrowserProps[\"ui\"];\n }, [initialData, props.config]);\n const historyOptions = useMemo(() => {\n const history = initialData.iiifBrowserOptions?.history || {};\n if (!initialData.url) return history;\n return {\n ...history,\n restoreFromLocalStorage: false,\n saveToLocalStorage: false,\n initialHistory: [\n {\n url: initialData.url,\n resource: null,\n route: initialData.url.startsWith(\"iiif://\")\n ? initialData.url.replace(\"iiif://\", \"/\")\n : `/loading?id=${encodeURIComponent(initialData.url)}`,\n },\n ],\n } as IIIFBrowserProps[\"history\"];\n }, [initialData]);\n\n return (\n <PreviewVaultBoundary>\n <LocalizedIIIFBrowser\n plugins={[...notebookPlugins, ...(initialData.iiifBrowserOptions?.plugins || [])]}\n ui={uiOptions}\n vault={vault}\n className=\"iiif-browser border-none border-t rounded-none h-[70vh] min-h-[60vh] max-h-full max-w-full\"\n output={output}\n navigation={navigationOptions}\n customPages={initialData.iiifBrowserOptions?.customPages || {}}\n history={historyOptions}\n />\n </PreviewVaultBoundary>\n );\n}\n","import { creatorValidationError } from \"../../validation-messages\";\nimport { IIIFBrowserIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { getIIIFType, getJsonResource, isDigitalCollectionPage } from \"../../resource-probes\";\nimport { createFromManifestBrowserOutput } from \"./manifest-browser-creator\";\nimport ManifestBrowserCreatorForm from \"./manifest-browser-form.lazy\";\n\nexport type { ManifestBrowserCreatorPayload } from \"./manifest-browser-creator\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/manifest-browser-creator\": typeof manifestBrowserCreator;\n }\n }\n}\n\nexport const manifestBrowserCreator = defineCreator({\n validationErrorMessage: creatorValidationError,\n id: \"@manifest-editor/manifest-browser-creator\",\n configKey: \"@manifest-editor/iiif-browser-creator\",\n create: createFromManifestBrowserOutput,\n label: \"Browse IIIF content\",\n labelMessage: { namespace: \"creators\", key: \"definitions.browser.label\" },\n hideSummary: true,\n summary: \"Browse IIIF manifests and collections to choose a resource to add.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.manifestBrowser.summary\" },\n icon: <IIIFBrowserIcon />,\n render(ctx: any) {\n return <ManifestBrowserCreatorForm {...ctx} />;\n },\n async supportsResource(value, helpers) {\n const resource = await getJsonResource(value, helpers);\n const type = getIIIFType(resource);\n if (type === \"Manifest\" || type === \"Collection\") {\n return { initialData: { url: value } };\n }\n if (await isDigitalCollectionPage(value)) {\n return { initialData: { url: value } };\n }\n return false;\n },\n resourceType: \"Manifest\",\n resourceFields: [\"id\", \"label\"],\n additionalTypes: [\"Collection\"],\n supports: {\n initialData: true,\n parentTypes: [\"Collection\", \"Manifest\", \"Canvas\"],\n parentFieldMap: {\n Collection: [\"items\"],\n Manifest: [\"partOf\"],\n Canvas: [\"partOf\"],\n },\n },\n sideEffects: [],\n staticFields: {},\n});\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport type { InternationalString, Reference } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext, CreatorResource } from \"@manifest-editor/creator-api\";\nimport { LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { type FormEvent, useState } from \"react\";\n\nexport interface CreateRangeWithItemsPayload {\n type: \"Range\";\n label?: InternationalString | string;\n items?: Array<Reference<\"Canvas\"> | Reference<\"Range\">>;\n}\n\nexport async function createRangeWithItems(\n data: CreateRangeWithItemsPayload,\n ctx: CreatorFunctionContext,\n parentId?: string\n): Promise<CreatorResource> {\n const rangeId = ctx.generateId(`range`, parentId ? { id: parentId, type: \"Range\" } : undefined);\n\n return ctx.embed({\n id: rangeId,\n type: \"Range\",\n label: data.label || { en: [\"Untitled range\"] },\n items: data.items || [],\n });\n}\n\nexport function RangeWithItemsCreatorForm(props: CreatorContext<CreateRangeWithItemsPayload>) {\n const property = useTranslations(\"editor-api\");\n const t = useTranslations(\"creators\");\n const [label, setLabel] = useState<InternationalString>(props.options.initialData?.label || { en: [\"\"] });\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n\n if (label) {\n props.runCreate({ type: \"Range\", label, items: props.options.initialData?.items || [] });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <LanguageFieldEditor\n focusId={\"label\"}\n label={property(\"fields.label\")}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <ActionButton primary type=\"submit\">\n {t(\"form.createRange\")}\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { RangesIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { createRangeWithItems, RangeWithItemsCreatorForm } from \"./create-range-with-items\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/range-with-items\": typeof rangeWithItems;\n }\n }\n}\n\nexport const rangeWithItems = defineCreator({\n id: \"@manifest-editor/range-with-items\",\n create: createRangeWithItems,\n label: \"Range\",\n labelMessage: { namespace: \"editor-api\", key: \"resources.range\" },\n summary: \"Group canvases or other ranges into a section.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.range.summary\" },\n icon: <RangesIcon />,\n render(ctx) {\n return <RangeWithItemsCreatorForm {...ctx} />;\n },\n resourceType: \"Range\",\n resourceFields: [\"id\", \"label\", \"type\"],\n supports: {\n parentTypes: [\"Range\"],\n parentFields: [\"items\"],\n },\n staticFields: {\n type: \"Range\",\n },\n});\n","import { useTranslations } from \"@manifest-editor/i18n\";\nimport type { InternationalString, Reference } from \"@iiif/presentation-3\";\nimport { ActionButton, PaddedSidebarContainer } from \"@manifest-editor/components\";\nimport type { CreatorContext, CreatorFunctionContext, CreatorResource } from \"@manifest-editor/creator-api\";\nimport { LanguageFieldEditor } from \"@manifest-editor/editors\";\nimport { type FormEvent, useState } from \"react\";\n\nexport interface CreateTopLevelRangePayload {\n type: \"Range\";\n label?: InternationalString | string;\n items?: Array<Reference<\"Canvas\"> | Reference<\"Range\">>;\n}\n\nexport async function createRangeTopLevel(\n data: CreateTopLevelRangePayload,\n ctx: CreatorFunctionContext,\n parentId?: string\n): Promise<CreatorResource> {\n const rangeId = ctx.generateId(`range`, parentId ? { id: parentId, type: \"Range\" } : undefined);\n\n return ctx.embed({\n id: rangeId,\n type: \"Range\",\n label: data.label || { en: [\"Table of Contents\"] },\n items: (data.items || []).map((item) => ctx.ref(item)),\n });\n}\n\nexport function TopLevelRangeCreatorForm(props: CreatorContext<CreateTopLevelRangePayload>) {\n const property = useTranslations(\"editor-api\");\n const t = useTranslations(\"creators\");\n const [label, setLabel] = useState<InternationalString>(props.options.initialData?.label || { en: [\"\"] });\n\n const onSubmit = (e: FormEvent) => {\n e.preventDefault();\n\n if (label) {\n props.runCreate({ type: \"Range\", label });\n }\n };\n\n return (\n <PaddedSidebarContainer>\n <form onSubmit={onSubmit}>\n <LanguageFieldEditor\n focusId={\"label\"}\n label={property(\"fields.label\")}\n fields={label}\n onSave={(e: any) => setLabel(e.toInternationalString())}\n />\n\n <ActionButton primary type=\"submit\">\n {t(\"form.createRange\")}\n </ActionButton>\n </form>\n </PaddedSidebarContainer>\n );\n}\n","import { RangesIcon } from \"@manifest-editor/components\";\nimport { defineCreator } from \"@manifest-editor/creator-api\";\nimport { createRangeTopLevel, TopLevelRangeCreatorForm } from \"./create-range-top-level\";\n\ndeclare module \"@manifest-editor/creator-api\" {\n namespace IIIFManifestEditor {\n interface CreatorDefinitions {\n \"@manifest-editor/range-top-level\": typeof rangeTopLevel;\n }\n }\n}\n\nexport const rangeTopLevel = defineCreator({\n id: \"@manifest-editor/range-top-level\",\n create: createRangeTopLevel,\n label: \"Table of contents\",\n labelMessage: { namespace: \"creators\", key: \"definitions.contents.label\" },\n summary: \"Create a top-level range to organise the manifest’s contents.\",\n summaryMessage: { namespace: \"creators\", key: \"definitions.contents.summary\" },\n icon: <RangesIcon />,\n render(ctx) {\n return <TopLevelRangeCreatorForm {...ctx} />;\n },\n resourceType: \"Range\",\n resourceFields: [\"id\", \"label\", \"type\"],\n supports: {\n parentTypes: [\"Manifest\"],\n parentFields: [\"structures\"],\n },\n staticFields: {\n type: \"Range\",\n },\n});\n","import \"./index.css\";\nimport { providerCreator } from \"./Agent/ProviderCreator\";\nimport { audioAnnotation } from \"./Annotation/AudioAnnotation\";\nimport { captionedImageAnnotation } from \"./Annotation/CaptionedImageAnnotation\";\nimport { htmlAnnotation } from \"./Annotation/HTMLAnnotation\";\nimport { imageServiceAnnotation } from \"./Annotation/ImageServiceAnnotation\";\nimport { imageUrlAnnotation } from \"./Annotation/ImageUrlAnnotation\";\nimport { imageUrlListAnnotation } from \"./Annotation/ImageUrlListAnnotation\";\nimport { noBodyAnnotation } from \"./Annotation/NoBodyAnnotation\";\nimport { videoAnnotation } from \"./Annotation/VideoAnnotation\";\nimport { emptyAnnotationPage } from \"./AnnotationPage/EmptyAnnotationPage\";\nimport { vttAnnotationPage } from \"./AnnotationPage/VttAnnotationPage\";\nimport { emptyCanvas } from \"./Canvas/EmptyCanvas\";\nimport { internalCanvas } from \"./Canvas/InternalCanvas\";\nimport { htmlBodyCreator } from \"./ContentResource/HTMLBodyCreator\";\nimport { iiifBrowserCreator } from \"./ContentResource/IIIFBrowserCreator\";\nimport { imageServiceCreator } from \"./ContentResource/ImageServiceCreator\";\nimport { imageUrlCreator } from \"./ContentResource/ImageUrlCreator\";\nimport { imageUrlListCreator } from \"./ContentResource/ImageUrlListCreator\";\nimport { plaintextCreator } from \"./ContentResource/PlaintextCreator\";\nimport { thumbnailCreator } from \"./ContentResource/ThumbnailCreator\";\nimport { webPageCreator } from \"./ContentResource/WebPageCreator\";\nimport { youTubeBodyCreator } from \"./ContentResource/YouTubeCreator\";\nimport { manifestBrowserCreator } from \"./Manifest/ManifestBrowserCreator\";\nimport { rangeWithItems } from \"./Range/RangeWithItems\";\nimport { rangeTopLevel } from \"./Range/TopLevelRangeCreator\";\n\n// Type-only exports keep the browser form implementations lazy.\nexport type { IIIFBrowserCreatorInitialData } from \"./ContentResource/IIIFBrowserCreator/iiif-browser-form.lazy\";\nexport type { ManifestBrowserCreatorInitialData } from \"./Manifest/ManifestBrowserCreator/manifest-browser-form.lazy\";\n\nexport * from \"./Agent/ProviderCreator/create-provider\";\nexport * from \"./Annotation/AudioAnnotation/create-audio-annotation\";\nexport * from \"./Annotation/CaptionedImageAnnotation/create-captioned-image-annotation\";\nexport * from \"./Annotation/HTMLAnnotation/create-html-annotation\";\nexport * from \"./Annotation/ImageServiceAnnotation/create-service-annotation\";\nexport * from \"./Annotation/ImageUrlAnnotation/create-image-url-annotation\";\nexport * from \"./Annotation/ImageUrlListAnnotation/create-image-url-list-annotation\";\nexport * from \"./Annotation/NoBodyAnnotation/index\";\nexport * from \"./Annotation/VideoAnnotation/create-video-annotation\";\nexport * from \"./AnnotationPage/VttAnnotationPage/create-vtt-annotation-page\";\nexport * from \"./Canvas/InternalCanvas/index\";\nexport * from \"./ContentResource/HTMLBodyCreator/create-html-body\";\nexport * from \"./ContentResource/IIIFBrowserCreator/iiif-browser-creator\";\nexport * from \"./ContentResource/ImageServiceCreator/create-image-service\";\nexport * from \"./ContentResource/ImageUrlCreator/create-image-url\";\nexport * from \"./ContentResource/ImageUrlListCreator/create-image-url-list\";\nexport * from \"./ContentResource/PlaintextCreator/create-plaintext\";\nexport * from \"./ContentResource/ThumbnailCreator/create-thumbnail\";\nexport * from \"./ContentResource/WebPageCreator/create-web-page\";\nexport * from \"./ContentResource/YouTubeCreator/create-youtube-body\";\nexport * from \"./Manifest/ManifestBrowserCreator/manifest-browser-creator\";\nexport * from \"./Range/RangeWithItems/create-range-with-items\";\nexport * from \"./Range/TopLevelRangeCreator/create-range-top-level\";\n\nexport const allCreators = [\n // Images first.\n imageServiceCreator,\n imageServiceAnnotation,\n imageUrlCreator,\n imageUrlAnnotation,\n videoAnnotation,\n audioAnnotation,\n htmlBodyCreator,\n htmlAnnotation,\n youTubeBodyCreator,\n iiifBrowserCreator,\n emptyCanvas,\n plaintextCreator,\n webPageCreator,\n emptyAnnotationPage,\n vttAnnotationPage,\n noBodyAnnotation,\n internalCanvas,\n captionedImageAnnotation,\n imageUrlListCreator,\n imageUrlListAnnotation,\n thumbnailCreator,\n rangeTopLevel,\n rangeWithItems,\n providerCreator,\n];\n\nexport {\n emptyCanvas,\n plaintextCreator,\n webPageCreator,\n htmlBodyCreator,\n htmlAnnotation,\n emptyAnnotationPage,\n vttAnnotationPage,\n youTubeBodyCreator,\n imageUrlCreator,\n imageServiceCreator,\n imageServiceAnnotation,\n // noBodyAnnotation,\n iiifBrowserCreator,\n imageUrlAnnotation,\n audioAnnotation,\n videoAnnotation,\n captionedImageAnnotation,\n imageUrlListCreator,\n imageUrlListAnnotation,\n rangeTopLevel,\n rangeWithItems,\n // Not included\n manifestBrowserCreator,\n providerCreator,\n};\n"],"x_google_ignoreList":[21,42],"mappings":"yuCAgBA,eAAsB,EAAe,EAA6B,EAA6B,CAC7F,IAAM,EAAW,CACf,GAAI,EAAK,KAAO,EAAI,WAAW,UAAU,EACzC,MAAO,EAAK,MACZ,KAAM,QACN,SAAU,CAAC,EACX,KAAM,CAAC,CACT,EAuBA,OArBI,EAAK,WACP,EAAS,SAAW,CAClB,EAAI,MAAM,CACR,GAAI,EAAK,IACT,OAAA,EAAOA,EAAAA,SAAAA,CAAS,EAAK,aAAa,EAAI,EAAK,cAAgB,CAAE,GAAI,CAAC,UAAU,CAAE,EAC9E,KAAM,OACN,OAAQ,YACR,SAAU,CAAC,IAAI,CACjB,CAAC,CACH,GAGE,EAAK,OACP,EAAS,KAAO,CACd,EAAI,MAAM,CACR,GAAI,EAAK,KACT,KAAM,OACR,CAAC,CACH,GAGK,EAAI,MAAM,CAAQ,CAC3B,CAEA,SAAgB,GAAmB,EAA8C,CAC/E,IAAM,GAAA,EAAWC,EAAAA,gBAAAA,CAAgB,YAAY,EACvC,GAAA,EAAIA,EAAAA,gBAAAA,CAAgB,UAAU,EAC9B,EAAc,EAAM,QAAQ,YAC5B,CAAC,EAAK,IAAA,EAAUC,EAAAA,SAAAA,CAAS,EAAY,KAAO,EAAE,EAC9C,CAAC,EAAO,IAAA,EAAYA,EAAAA,SAAAA,CAAS,EAAY,OAAU,CAAE,GAAI,CAAC,EAAE,CAAE,CAAyB,EACvF,CAAC,EAAU,IAAA,EAAeA,EAAAA,SAAAA,CAAS,EAAY,UAAY,EAAE,EAC7D,CAAC,EAAM,IAA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