@nulib/clover 4.3.0 → 4.3.1
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/components/Canvas/CanvasView.mjs +4 -0
- package/dist/components/Canvas/media/MediaBody.mjs +38 -10
- package/dist/components/Canvas/media/SeekMarks.mjs +236 -0
- package/dist/components/Canvas/media/Transport.mjs +26 -3
- package/dist/components/Canvas/media/useMediaElement.mjs +23 -11
- package/dist/styles/core.css +1 -1
- package/dist/styles/media.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/ui/sheets/media.mjs +1 -1
- package/dist/web-components/{About-uNCjvWgs.mjs → About-j3O9cA3r.mjs} +1 -1
- package/dist/web-components/{AnnotationItems-JwlcCvPo.mjs → AnnotationItems-U0WmWGOh.mjs} +1 -1
- package/dist/web-components/{AnnotationMenu-BWyKEyvW.mjs → AnnotationMenu-C1fAWWYy.mjs} +1 -1
- package/dist/web-components/{AnnotationState-Bhqs75Br.mjs → AnnotationState-C9UhGpsr.mjs} +1 -1
- package/dist/web-components/{Annotations-ZwcRh2UE.mjs → Annotations-BtJ4IVmy.mjs} +1 -1
- package/dist/web-components/{Annotations-C7y0N8Lj.mjs → Annotations-YcFbQRJx.mjs} +1 -1
- package/dist/web-components/{Body-DyrvRDkt.mjs → Body-Ccxmucbr.mjs} +1 -1
- package/dist/web-components/{BodyAlert-XV88XjL8.mjs → BodyAlert-BBSStCpI.mjs} +1 -1
- package/dist/web-components/{Button-BIaw5k1q.mjs → Button-Bphsp8rv.mjs} +1 -1
- package/dist/web-components/{Camera-7SlnmGtb.mjs → Camera-DSk-YFpW.mjs} +1 -1
- package/dist/web-components/{Canvas2DBackend-DBGZRGid.mjs → Canvas2DBackend-CYAJ-W6-.mjs} +1 -1
- package/dist/web-components/CanvasView-BAJ6OYvn.mjs +2 -0
- package/dist/web-components/{CaptionDetails-Bxz8AXMz.mjs → CaptionDetails-Dg9Y11o_.mjs} +1 -1
- package/dist/web-components/{ChaptersMenu-CMQiBqvx.mjs → ChaptersMenu-i4bFwR8c.mjs} +1 -1
- package/dist/web-components/{Chevron-B3XaClVT.mjs → Chevron-BnlK9F4K.mjs} +1 -1
- package/dist/web-components/{ChoiceMenu-pugo5zxI.mjs → ChoiceMenu-YXA7Ku8M.mjs} +1 -1
- package/dist/web-components/{Collection-Ch_FeSKp.mjs → Collection-DgSFQbN-.mjs} +1 -1
- package/dist/web-components/{CollectionSelect-2jDEkOcK.mjs → CollectionSelect-PUcTh3Uv.mjs} +1 -1
- package/dist/web-components/{Connected-Bne3I5E1.mjs → Connected-B_caNIrW.mjs} +1 -1
- package/dist/web-components/{Connected-DuANHN93.mjs → Connected-XhRc6yaA.mjs} +1 -1
- package/dist/web-components/{Connected-3hnIPSWM.mjs → Connected-YgL5BWf5.mjs} +1 -1
- package/dist/web-components/{Contents-DIQrin_-.mjs → Contents-CoC4TK6G.mjs} +1 -1
- package/dist/web-components/{ControlMenu-BydnCTTQ.mjs → ControlMenu-CYfLg3Ok.mjs} +1 -1
- package/dist/web-components/ControlsFade-BcGL7yUH.mjs +1 -0
- package/dist/web-components/{CountMenu-CReBYVwu.mjs → CountMenu-C7XawAoa.mjs} +1 -1
- package/dist/web-components/Cue-DZJ5TBKU.mjs +1 -0
- package/dist/web-components/{Document-pjc2qOX4.mjs → Document-DZDYR2Tk.mjs} +1 -1
- package/dist/web-components/{DomLayers-D9X_FPto.mjs → DomLayers-Bbrulm6v.mjs} +1 -1
- package/dist/web-components/{Download-B8MpVqgk.mjs → Download-CfRPt74Y.mjs} +1 -1
- package/dist/web-components/{EntryBodies-DdpRfU5U.mjs → EntryBodies-Bz8hyAUW.mjs} +1 -1
- package/dist/web-components/{EntryThumbnail-DM7Zjj1z.mjs → EntryThumbnail-R9h0AXcu.mjs} +1 -1
- package/dist/web-components/{FieldPill-BAql8_6s.mjs → FieldPill-DFIdy-hn.mjs} +1 -1
- package/dist/web-components/{FrameAnimation-Dj46RxuL.mjs → FrameAnimation-DFDuFwwt.mjs} +1 -1
- package/dist/web-components/{Gallery-B9FNA02Z.mjs → Gallery-BrYWLufL.mjs} +1 -1
- package/dist/web-components/{HideToggle-duXvDvDw.mjs → HideToggle-geO9QfFR.mjs} +1 -1
- package/dist/web-components/{ImageControls-DODKjC0d.mjs → ImageControls-B9PhCHqi.mjs} +1 -1
- package/dist/web-components/{Items-BHTQJU7T.mjs → Items-C7wjylgH.mjs} +1 -1
- package/dist/web-components/{Label-D4dlrtpH.mjs → Label-S7o8PlWU.mjs} +1 -1
- package/dist/web-components/{LanguageChoice-DR3X-dtJ.mjs → LanguageChoice-URJJAdah.mjs} +1 -1
- package/dist/web-components/{LightboxView-D-aBaKfB.mjs → LightboxView-65ROPr0_.mjs} +1 -1
- package/dist/web-components/{ListEnd-CQ4vX-NW.mjs → ListEnd-B0wGr87o.mjs} +1 -1
- package/dist/web-components/{Loaded-DsNSPXWf.mjs → Loaded-Do53YvYw.mjs} +1 -1
- package/dist/web-components/{LoadedCanvas-Cq7_O2bw.mjs → LoadedCanvas-BrtGPpSm.mjs} +1 -1
- package/dist/web-components/LoadedMap-C06TIgvf.mjs +1 -0
- package/dist/web-components/{Loading-4PmhMeZ-.mjs → Loading-Du3wn1EM.mjs} +1 -1
- package/dist/web-components/{Map-B29Ba50b.mjs → Map-B6LVO0gx.mjs} +1 -1
- package/dist/web-components/{MapView-nHeg39Kz.mjs → MapView-CzV3y5iI.mjs} +2 -2
- package/dist/web-components/{Markup-BZ7l5GbG.mjs → Markup-DACv7sRg.mjs} +1 -1
- package/dist/web-components/MediaBody-CcuO5IZT.mjs +1 -0
- package/dist/web-components/MediaBody-DGd2uFfK.mjs +1 -0
- package/dist/web-components/{NavDate-0MsHRjBW.mjs → NavDate-DRKmjc54.mjs} +1 -1
- package/dist/web-components/{Navigator-qJ79A8Nk.mjs → Navigator-CA8zB6CU.mjs} +1 -1
- package/dist/web-components/{Pager-SPd_u0qz.mjs → Pager-DWp6u3iv.mjs} +1 -1
- package/dist/web-components/{PagerLayout-CkSwDAnp.mjs → PagerLayout-DHRpcI8x.mjs} +1 -1
- package/dist/web-components/{Panel-C8r3EsWn.mjs → Panel-CzUDNn8M.mjs} +1 -1
- package/dist/web-components/PanelPart-DKb9dXm6.mjs +1 -0
- package/dist/web-components/{PanelToggle-CrKP8BqE.mjs → PanelToggle-D5sx5FP9.mjs} +1 -1
- package/dist/web-components/{PartOfManifest-BdDSxK4k.mjs → PartOfManifest-Ct-I8Ofm.mjs} +1 -1
- package/dist/web-components/{Pending-CmgVU1kF.mjs → Pending-f1heQNo7.mjs} +1 -1
- package/dist/web-components/{PlaceBox-D7HLNGxE.mjs → PlaceBox-_an9ya_W.mjs} +1 -1
- package/dist/web-components/{Placeholder-DVAlXejQ.mjs → Placeholder-D4-VCxeD.mjs} +1 -1
- package/dist/web-components/{Position-C6KUAceQ.mjs → Position-DA4rzRiy.mjs} +1 -1
- package/dist/web-components/{Primitives-ClQVjY6x.mjs → Primitives-DU_VhdO2.mjs} +1 -1
- package/dist/web-components/{Provider-C0IUdU6v.mjs → Provider-Dl_t_qEC.mjs} +1 -1
- package/dist/web-components/{ReadMore-BiEJA4yO.mjs → ReadMore-BpA8Dex8.mjs} +1 -1
- package/dist/web-components/{Root-Drt5N4_s.mjs → Root-DixSZV9Y.mjs} +1 -1
- package/dist/web-components/Scene-CSaXgBNr.mjs +1 -0
- package/dist/web-components/{SceneView-BHg37-rs.mjs → SceneView-BJNlboix.mjs} +1 -1
- package/dist/web-components/{Search-Bpd_lGzH.mjs → Search-CvpKzlYP.mjs} +1 -1
- package/dist/web-components/{Sections-D_bS5IQH.mjs → Sections-BhfcUyaf.mjs} +1 -1
- package/dist/web-components/SeekMarks-BfOrFnvQ.mjs +1 -0
- package/dist/web-components/{StandaloneItems-YV9O9M8F.mjs → StandaloneItems-CoiceHd8.mjs} +1 -1
- package/dist/web-components/{Status-BCG7AN9B.mjs → Status-B4327UOL.mjs} +1 -1
- package/dist/web-components/{Steps-Dnn8Ajqf.mjs → Steps-ACdXJZrV.mjs} +1 -1
- package/dist/web-components/{TargetItems-xxbtePln.mjs → TargetItems-D1bLKA_B.mjs} +1 -1
- package/dist/web-components/Timeline-DY8LpnOG.mjs +1 -0
- package/dist/web-components/{Tip-DPFWlNLu.mjs → Tip-BatwzZZo.mjs} +1 -1
- package/dist/web-components/{Transcript-C-_DbUO5.mjs → Transcript-B1nh9UJK.mjs} +1 -1
- package/dist/web-components/Transport-BsjGGbFJ.mjs +1 -0
- package/dist/web-components/Transport-DKb3XTMA.mjs +1 -0
- package/dist/web-components/{annotation-collection-nmxzo_hO.mjs → annotation-collection-CtxYL-V3.mjs} +1 -1
- package/dist/web-components/{annotation-name-DoUUo-8D.mjs → annotation-name-KQ4wAi8-.mjs} +1 -1
- package/dist/web-components/{annotations-content-Cl1upbdd.mjs → annotations-content-XVgQ5me7.mjs} +1 -1
- package/dist/web-components/{body-DC8Oq8rY.mjs → body-CbYkzpmQ.mjs} +1 -1
- package/dist/web-components/{canvas-gzoTnBxw.mjs → canvas-Du31_Dru.mjs} +1 -1
- package/dist/web-components/{cloverEngine-CFL1Bd7n.mjs → cloverEngine-CuRCXZNZ.mjs} +1 -1
- package/dist/web-components/{content-state-reader-DYbmXxCp.mjs → content-state-reader-DLlBY4Ox.mjs} +1 -1
- package/dist/web-components/{controlGlyphs-d7KUIUwi.mjs → controlGlyphs-ClH59vLg.mjs} +1 -1
- package/dist/web-components/{controls-VC9D1mwr.mjs → controls-smixEi0i.mjs} +1 -1
- package/dist/web-components/{downloads-D2cnWDbs.mjs → downloads-BqkNwsM0.mjs} +1 -1
- package/dist/web-components/{dragToClose-CzYeh_12.mjs → dragToClose-2joCF413.mjs} +1 -1
- package/dist/web-components/{engine-Dcfyp2DV.mjs → engine-DNTgJBST.mjs} +1 -1
- package/dist/web-components/{engines-BMr7naGM.mjs → engines-BpFZX2dO.mjs} +1 -1
- package/dist/web-components/{fetchManifest-DxptUh4u.mjs → fetchManifest-B-poGgag.mjs} +1 -1
- package/dist/web-components/{fromManifest-BpPFLVyZ.mjs → fromManifest-Dw3BwjHM.mjs} +1 -1
- package/dist/web-components/{glyphs-BCnJl8py.mjs → glyphs-VoJVEqLE.mjs} +1 -1
- package/dist/web-components/{hooks-Dz_5UXXp.mjs → hooks-Syt1XLVX.mjs} +1 -1
- package/dist/web-components/{image-layers-BPnq7jk1.mjs → image-layers-ryUJ_0bq.mjs} +1 -1
- package/dist/web-components/{imageService-DFPkPNfe.mjs → imageService-DBU_Xks1.mjs} +1 -1
- package/dist/web-components/{index-ClM6Kq8w.mjs → index-DGXCFoHu.mjs} +1 -1
- package/dist/web-components/index.mjs +1 -1
- package/dist/web-components/{items-D03KhDg6.mjs → items-BQPvL5D6.mjs} +1 -1
- package/dist/web-components/items-TIbaHoB8.mjs +1 -0
- package/dist/web-components/label-Bd-QYEXn.mjs +1 -0
- package/dist/web-components/{layout-DVa_DnGH.mjs → layout-MzMKFa5I.mjs} +1 -1
- package/dist/web-components/{link-DxXxMXiw.mjs → link-BUQQE9P2.mjs} +1 -1
- package/dist/web-components/logo-Cn820OoX.mjs +1 -0
- package/dist/web-components/{models-pO77sm3z.mjs → models-wl-5vW2i.mjs} +1 -1
- package/dist/web-components/{nodes-CmL3eoRE.mjs → nodes-CmOpA3s7.mjs} +1 -1
- package/dist/web-components/{overlayImage-DFGetjMh.mjs → overlayImage-tb9-Md51.mjs} +1 -1
- package/dist/web-components/{panel-B1vzUm6_.mjs → panel-BPVyAugu.mjs} +1 -1
- package/dist/web-components/part-DeZI8Hmp.mjs +1 -0
- package/dist/web-components/{playerSurface-CQ1wrIAQ.mjs → playerSurface-BxxMV-va.mjs} +1 -1
- package/dist/web-components/{pointer-DWnCT3D3.mjs → pointer-BqgxBJ82.mjs} +1 -1
- package/dist/web-components/{provider-U7xzX_0T.mjs → provider-B9oAQG-u.mjs} +1 -1
- package/dist/web-components/{range-regions-Di_lmVqZ.mjs → range-regions-BFB1374L.mjs} +1 -1
- package/dist/web-components/{read-more-BtA1sriO.mjs → read-more-oWPk0OLi.mjs} +1 -1
- package/dist/web-components/{readingLanguages-Ptho-Co9.mjs → readingLanguages-BigCi6rZ.mjs} +1 -1
- package/dist/web-components/{rendererSurface-BgZPnAwj.mjs → rendererSurface-B_OOhxzA.mjs} +2 -2
- package/dist/web-components/{renderers-hoD3WKYA.mjs → renderers-CBupZj8Z.mjs} +1 -1
- package/dist/web-components/{resource-DuTMsPEj.mjs → resource-B6uUsU6D.mjs} +1 -1
- package/dist/web-components/{save-file-CLB5IM4a.mjs → save-file-BaIrLp1V.mjs} +1 -1
- package/dist/web-components/{search-Dd2Y1dsZ.mjs → search-DaGpvTki.mjs} +1 -1
- package/dist/web-components/{shared-CCg1Iag8.mjs → shared-D2RadIoz.mjs} +1 -1
- package/dist/web-components/{show-link-NjacLIdz.mjs → show-link-Cxylys81.mjs} +1 -1
- package/dist/web-components/{sizedImage-CKOGmqhN.mjs → sizedImage-DchqGFdt.mjs} +1 -1
- package/dist/web-components/{split-CcoXZcGX.mjs → split-oaEIep3T.mjs} +1 -1
- package/dist/web-components/{status-B4a3Izph.mjs → status-CfCgO5OB.mjs} +1 -1
- package/dist/web-components/styles-DZIDbHxL.mjs +1 -0
- package/dist/web-components/three.mjs +1 -1
- package/dist/web-components/{thumbnail-ez20ssEY.mjs → thumbnail-D83GaQ8C.mjs} +1 -1
- package/dist/web-components/{tip-DeFPN33O.mjs → tip-CMEBtCil.mjs} +1 -1
- package/dist/web-components/{toggle-CGSnnjW-.mjs → toggle-3NncfBSZ.mjs} +1 -1
- package/dist/web-components/{useContainerName-BfyeBf6_.mjs → useContainerName-fp0-n_9x.mjs} +1 -1
- package/dist/web-components/{useControlsVisibility-oRiMiQhD.mjs → useControlsVisibility-BYZlgiAt.mjs} +1 -1
- package/dist/web-components/useLazyPanelPane-DXYGGS7f.mjs +1 -0
- package/dist/web-components/{useNearViewport-BADiMpLi.mjs → useNearViewport-DMqMdvue.mjs} +1 -1
- package/dist/web-components/{useScrollTrack-9QsMaHSx.mjs → useScrollTrack-BHuPAWxB.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationItems-Cvh3jfmf.mjs → AnnotationItems-B5Vs0dYi.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationMenu-d5PT7q8D.mjs → AnnotationMenu-BO18q_Ze.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationState-DbtYTHMy.mjs → AnnotationState-ZPmnCpbZ.mjs} +1 -1
- package/dist/web-components/viewer/{Annotations-D_wg4O99.mjs → Annotations-C46kSUA6.mjs} +1 -1
- package/dist/web-components/viewer/{Annotations-DKWYJOo2.mjs → Annotations-DEKa_9xz.mjs} +1 -1
- package/dist/web-components/viewer/{Canvas2DBackend-B4IXvdsN.mjs → Canvas2DBackend-DHSI3dKr.mjs} +1 -1
- package/dist/web-components/viewer/{CaptionDetails-Bxh9VD7n.mjs → CaptionDetails-BVCqV9NT.mjs} +1 -1
- package/dist/web-components/viewer/{ChaptersMenu-CaAIaRZN.mjs → ChaptersMenu-CIwIM2Pb.mjs} +1 -1
- package/dist/web-components/viewer/{ChoiceMenu-Clp4Zeog.mjs → ChoiceMenu-Ww7lcPnq.mjs} +1 -1
- package/dist/web-components/viewer/{Collection-C5BfoUOH.mjs → Collection-DCYM9eE6.mjs} +1 -1
- package/dist/web-components/viewer/{Connected-Cd2qwuuo.mjs → Connected-Bbk8M5rE.mjs} +1 -1
- package/dist/web-components/viewer/{Connected-9VGl2Xnx.mjs → Connected-DAOMKtJR.mjs} +1 -1
- package/dist/web-components/viewer/{Contents-CsG9e7v2.mjs → Contents-BnRBx3rc.mjs} +1 -1
- package/dist/web-components/viewer/{ControlMenu-q_u_UC8q.mjs → ControlMenu-Co6yBttc.mjs} +1 -1
- package/dist/web-components/viewer/ControlsFade-pOQ5VQ5i.mjs +1 -0
- package/dist/web-components/viewer/{CountMenu-Dn0-z5A9.mjs → CountMenu-lu21fO_7.mjs} +1 -1
- package/dist/web-components/viewer/Cue-oaiVO9ZO.mjs +1 -0
- package/dist/web-components/viewer/{Document-r3Sz3RfH.mjs → Document-ByBRhL68.mjs} +1 -1
- package/dist/web-components/viewer/{DomLayers-CwHg1jZg.mjs → DomLayers-BjxGaZkt.mjs} +1 -1
- package/dist/web-components/viewer/{Download-Clx_e2ga.mjs → Download-DhMD4AJt.mjs} +1 -1
- package/dist/web-components/viewer/{EntryBodies-B4SnV6NJ.mjs → EntryBodies-DL5UolEz.mjs} +1 -1
- package/dist/web-components/viewer/{EntryThumbnail-CsAqKh38.mjs → EntryThumbnail-CJisDcni.mjs} +1 -1
- package/dist/web-components/viewer/{FieldPill-NQfq8SXA.mjs → FieldPill-DAk6zxxD.mjs} +1 -1
- package/dist/web-components/viewer/{FrameAnimation-wN2VNW7D.mjs → FrameAnimation-DGMuFNdW.mjs} +1 -1
- package/dist/web-components/viewer/{Gallery-nX9kQlft.mjs → Gallery-CbHhyWlF.mjs} +1 -1
- package/dist/web-components/viewer/{HideToggle-B843JuKU.mjs → HideToggle-C6B9B2Bo.mjs} +1 -1
- package/dist/web-components/viewer/{ImageControls--qeUY5kg.mjs → ImageControls-BDx7C1q5.mjs} +1 -1
- package/dist/web-components/viewer/{LanguageChoice-CZ6K3Mhv.mjs → LanguageChoice-BM9xZr_D.mjs} +1 -1
- package/dist/web-components/viewer/{LightboxView-BcbP3cJD.mjs → LightboxView-RrioB0CN.mjs} +1 -1
- package/dist/web-components/viewer/{ListEnd-DbYDv46a.mjs → ListEnd-8vdKw6Py.mjs} +1 -1
- package/dist/web-components/viewer/{MapView-Dj7Iq7P2.mjs → MapView-G3yj-Bjd.mjs} +2 -2
- package/dist/web-components/viewer/MediaBody-BokgnTO-.mjs +1 -0
- package/dist/web-components/viewer/MediaBody-DPOcyiYH.mjs +1 -0
- package/dist/web-components/viewer/{NavDate-Clj6OMa6.mjs → NavDate-B6rCV-Cd.mjs} +1 -1
- package/dist/web-components/viewer/{Navigator-DPdR3SYX.mjs → Navigator-CjgUcgKY.mjs} +1 -1
- package/dist/web-components/viewer/{PagerLayout-CtlmDRjI.mjs → PagerLayout-LZmC6VpV.mjs} +1 -1
- package/dist/web-components/viewer/PanelPart-Cw1G5W4b.mjs +1 -0
- package/dist/web-components/viewer/{PartOfManifest-NAXs2DYd.mjs → PartOfManifest-B0TYADTv.mjs} +1 -1
- package/dist/web-components/viewer/{PlaceBox-C2k5Fsfo.mjs → PlaceBox-Cjdjg-_9.mjs} +1 -1
- package/dist/web-components/viewer/{Placeholder-DF6dRMjt.mjs → Placeholder-MYLjXbiF.mjs} +1 -1
- package/dist/web-components/viewer/{Search-DoUc8tWu.mjs → Search-CyRrBHsr.mjs} +1 -1
- package/dist/web-components/viewer/SeekMarks-1WSjARP5.mjs +1 -0
- package/dist/web-components/viewer/{StandaloneItems-DuXasJO0.mjs → StandaloneItems-CQrzTSPC.mjs} +1 -1
- package/dist/web-components/viewer/{Steps-B3MrG4Cv.mjs → Steps-Bd42-eq7.mjs} +1 -1
- package/dist/web-components/viewer/{TargetItems-DOFSQtYR.mjs → TargetItems-BpmZEVMS.mjs} +1 -1
- package/dist/web-components/viewer/{Transcript-Dy-FHWMo.mjs → Transcript-CE4BsnWd.mjs} +1 -1
- package/dist/web-components/viewer/Transport-1ROUkfsf.mjs +1 -0
- package/dist/web-components/viewer/Transport-g0_Cjy0f.mjs +1 -0
- package/dist/web-components/viewer/{annotation-collection-A0PNdPhI.mjs → annotation-collection-vM0aeJgP.mjs} +1 -1
- package/dist/web-components/viewer/{annotation-name-CfQs7Mb2.mjs → annotation-name-kjUrGbhg.mjs} +1 -1
- package/dist/web-components/viewer/{annotations-content-B52-zM99.mjs → annotations-content-CysDLy4t.mjs} +1 -1
- package/dist/web-components/viewer/{cloverEngine-4sgpB7Rz.mjs → cloverEngine-S8GEd-YZ.mjs} +1 -1
- package/dist/web-components/viewer/{content-state-reader-vtATl-W3.mjs → content-state-reader-BTZKS9Hq.mjs} +1 -1
- package/dist/web-components/viewer/{dragToClose-B4rj1D3r.mjs → dragToClose-Bt4QtVSO.mjs} +1 -1
- package/dist/web-components/viewer/{fetchManifest-gAj8phm4.mjs → fetchManifest-D4aIqcDV.mjs} +1 -1
- package/dist/web-components/viewer/{host-Hv8WXfiF.mjs → host-ClJe-BX1.mjs} +1 -1
- package/dist/web-components/viewer/{image-layers-gFEDKVkV.mjs → image-layers-DGa5HJt8.mjs} +1 -1
- package/dist/web-components/viewer/index.mjs +1 -1
- package/dist/web-components/viewer/{link-DIh6ysyo.mjs → link-CU71f0wU.mjs} +1 -1
- package/dist/web-components/viewer/{overlayImage-BRjcH40Q.mjs → overlayImage-D9GHzMmm.mjs} +1 -1
- package/dist/web-components/viewer/{range-regions-uPqjKIER.mjs → range-regions-CiceyEuu.mjs} +1 -1
- package/dist/web-components/viewer/{renderers-C5EfPrd7.mjs → renderers-2BgvLkI0.mjs} +1 -1
- package/dist/web-components/viewer/{save-file-dIa0LCAn.mjs → save-file-BW7D7oYG.mjs} +1 -1
- package/dist/web-components/viewer/{search-Bbv9dCNq.mjs → search-DBMO82DV.mjs} +1 -1
- package/dist/web-components/viewer/styles-DogZyfVz.mjs +1 -0
- package/dist/web-components/viewer/{useControlsVisibility-jopIdHZi.mjs → useControlsVisibility-DSSIzst5.mjs} +1 -1
- package/dist/web-components/viewer/useLazyPanelPane-_6IY7cV5.mjs +1 -0
- package/dist/web-components/viewer/{viewer-DqpSyvH-.mjs → viewer-ClQD1LNQ.mjs} +6 -6
- package/dist/web-components/viewer/{vtt-DpgB_K8v.mjs → vtt-Dk5bwDVQ.mjs} +1 -1
- package/dist/web-components/{viewer-D2lGdifc.mjs → viewer-DLfZQmZs.mjs} +1 -1
- package/dist/web-components/{vtt-KUQbi4PK.mjs → vtt-9Ui3h60h.mjs} +1 -1
- package/package.json +1 -1
- package/dist/web-components/CanvasView-CmDxczm9.mjs +0 -2
- package/dist/web-components/ControlsFade-CleBsk-W.mjs +0 -1
- package/dist/web-components/Cue-2zGQuUOC.mjs +0 -1
- package/dist/web-components/LoadedMap-0_prxuA4.mjs +0 -1
- package/dist/web-components/MediaBody-DH-rr_0N.mjs +0 -1
- package/dist/web-components/MediaBody-eSThjFzH.mjs +0 -1
- package/dist/web-components/PanelPart-BA1NoeLA.mjs +0 -1
- package/dist/web-components/Scene-C7t16NjC.mjs +0 -1
- package/dist/web-components/Timeline-Danuk_Nn.mjs +0 -1
- package/dist/web-components/Transport-BKona8RD.mjs +0 -1
- package/dist/web-components/Transport-Bonmu77-.mjs +0 -1
- package/dist/web-components/items-BHporT5i.mjs +0 -1
- package/dist/web-components/label-r0ki6r1U.mjs +0 -1
- package/dist/web-components/logo-Br42Vlsk.mjs +0 -1
- package/dist/web-components/part-DmRBh4pf.mjs +0 -1
- package/dist/web-components/styles-C7PVxtkQ.mjs +0 -1
- package/dist/web-components/useLazyPanelPane-CReKsr8z.mjs +0 -1
- package/dist/web-components/viewer/ControlsFade-Db3IWArv.mjs +0 -1
- package/dist/web-components/viewer/Cue-slOJQhPI.mjs +0 -1
- package/dist/web-components/viewer/MediaBody-TN4XsCm7.mjs +0 -1
- package/dist/web-components/viewer/MediaBody-iAxGgXNy.mjs +0 -1
- package/dist/web-components/viewer/PanelPart-DzZWRlK1.mjs +0 -1
- package/dist/web-components/viewer/Transport-C5wkxVOF.mjs +0 -1
- package/dist/web-components/viewer/Transport-CUXmY_jW.mjs +0 -1
- package/dist/web-components/viewer/styles-L1HpSoL2.mjs +0 -1
- package/dist/web-components/viewer/useLazyPanelPane-CoPgtYkx.mjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var $l=Object.defineProperty;var Fl=(t,e,n)=>e in t?$l(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var I=(t,e,n)=>Fl(t,typeof e!="symbol"?e+"":e,n);import{s as ma}from"./styles-L1HpSoL2.mjs";function Dl(t={}){return Promise.resolve().then(()=>Wu).then(e=>e.initCloverI18n(t))}const ga="@layer clover{:is(clover-root,clover-items,clover-viewer,clover-panel,clover-read-more):not([hidden]){display:block}:is(clover-body,clover-canvas,clover-timeline,clover-scene):not([hidden]){display:block;height:var(--clover-body-height,60vh)}clover-split:not([hidden]){display:flex}:is(clover-label,clover-panel-toggle):not([hidden]){display:contents}clover-tab,clover-tip,clover-status>[slot]{display:none}}";let zl=null,bn=null;const Hl=()=>zl??(zl=import("./host-Hv8WXfiF.mjs").then(t=>bn=t)),Wl=t=>t.trim().toLowerCase()==="false";function Ul(t,{type:e,min:n},o){if(t===null)return;if(e==="string")return t;if(e==="boolean")return!Wl(t);if(e==="number"){const s=Number(t);if(t.trim()===""||!Number.isFinite(s)){o("is not a number");return}if(n!==void 0&&s<n){o(`is less than ${n}`);return}return s}if(e==="data"){const s=t.trim();if(!/^[[{"]/.test(s))return t;try{return JSON.parse(s)}catch{o("is not JSON");return}}const r=t.trim().toLowerCase();if(e.includes(r))return r==="false"?false:r;o(`is not ${e.join(", ")}`)}const jl=(t,e)=>{const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(o=>Object.is(t[o],e[o]))};function Vl(t){class e extends HTMLElement{constructor(){super(...arguments);I(this,"kind",t.kind)}static get observedAttributes(){return Object.keys(t.attributes)}connectedCallback(){ma(this.ownerDocument).inject("elements",ga)}}customElements.define(t.tag,e)}function ql(t,e){if(typeof customElements>"u"||customElements.get(t.tag))return;if(t.kind==="config"||!e)return Vl(t);const n=t.kind,o=t.properties??[],r=Object.entries(t.events??{});let s=null,i=null;const a=()=>i??(i=Promise.all([e().then(l=>s=l),Hl()]));class c extends HTMLElement{constructor(){super(...arguments);I(this,"kind",n);I(this,"needsRoot",!!t.needsRoot);I(this,"values",{});I(this,"kept",{});I(this,"props",{});I(this,"listeners",new Set);I(this,"warned",new Set);I(this,"handlers",Object.fromEntries(r.map(([d,h])=>[h.prop,(...p)=>{var v;if(h.keeps&&(this.kept[h.keeps]=p[0]??null,p[0]==null))return true;const m=h.detail==="first"?p[0]:Object.fromEntries(h.detail.map((w,_)=>[w,p[_]])),g=new CustomEvent(d,{detail:m,bubbles:!h.keeps,composed:!h.keeps,cancelable:!!h.cancelable}),b=this.dispatchEvent(g);if(!b&&h.cancelable){const w=p[p.length-1];(v=w==null?void 0:w.preventDefault)==null||v.call(w)}return b}])));I(this,"getProps",()=>this.props);I(this,"subscribe",d=>(this.listeners.add(d),()=>{this.listeners.delete(d)}))}static get observedAttributes(){return Object.keys(t.attributes)}get element(){return this}get Component(){return s}connectedCallback(){for(const d of o){if(!Object.prototype.hasOwnProperty.call(this,d))continue;const h=this[d];delete this[d],h!=null&&(this.values[d]=h)}this.update(),this.warnOfAria(),ma(this.ownerDocument).inject("elements",ga),a().then(()=>{this.isConnected&&bn.hostOf(this.ownerDocument).connect(this)})}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||bn==null||bn.hostOf(this.ownerDocument).disconnect(this)})}attributeChangedCallback(){this.update()}warnOfAria(){if(!t.native)for(const d of["aria-label","aria-labelledby","role"])!this.hasAttribute(d)||this.warned.has(d)||(this.warned.add(d),console.warn(`<${t.tag}>: ${d} names the element, a box no reader is told of; Clover names what it draws itself.`))}update(){const d={...this.handlers,...this.values};for(const[h,p]of Object.entries(t.attributes)){if(p.prop in this.values)continue;const m=this.getAttribute(h),g=Ul(m,p,b=>{const v=`${h}=${m}`;this.warned.has(v)||(this.warned.add(v),console.warn(`<${t.tag}>: ${h}="${m}" ${b}; ignored.`))});g!==void 0&&(d[p.prop]=g)}jl(d,this.props)||(this.props=d,this.listeners.forEach(h=>h()))}}I(c,"initCloverI18n",Dl);for(const l of o)Object.defineProperty(c.prototype,l,{configurable:true,enumerable:true,get(){return l in this.values?this.values[l]:this.getProps()[l]},set(u){u==null?delete this.values[l]:this.values[l]=u,this.update()}});for(const[,l]of r){if(!l.keeps)continue;const u=l.keeps;Object.defineProperty(c.prototype,u,{configurable:true,enumerable:true,get(){return this.kept[u]??null}})}customElements.define(t.tag,c)}var Tn,at,va,$e,Vs,ya,ba,_a,Fr,pr,mr,wa,kn={},xa=[],Kl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,In=Array.isArray;function se(t,e){for(var n in e)t[n]=e[n];return t}function Dr(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function _e(t,e,n){var o,r,s,i={};for(s in e)s=="key"?o=e[s]:s=="ref"?r=e[s]:i[s]=e[s];if(arguments.length>2&&(i.children=arguments.length>3?Tn.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)i[s]===void 0&&(i[s]=t.defaultProps[s]);return xn(t,i,o,r,null)}function xn(t,e,n,o,r){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++va,__i:-1,__u:0};return r==null&&at.vnode!=null&&at.vnode(s),s}function Zl(){return{current:null}}function Ct(t){return t.children}function ie(t,e){this.props=t,this.context=e}function on(t,e){if(e==null)return t.__?on(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?on(t):null}function Sa(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Sa(t)}}function gr(t){(!t.__d&&(t.__d=true)&&$e.push(t)&&!io.__r++||Vs!=at.debounceRendering)&&((Vs=at.debounceRendering)||ya)(io)}function io(){for(var t,e,n,o,r,s,i,a=1;$e.length;)$e.length>a&&$e.sort(ba),t=$e.shift(),a=$e.length,t.__d&&(n=void 0,o=void 0,r=(o=(e=t).__v).__e,s=[],i=[],e.__P&&((n=se({},o)).__v=o.__v+1,at.vnode&&at.vnode(n),zr(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[r]:null,s,r??on(o),!!(32&o.__u),i),n.__v=o.__v,n.__.__k[n.__i]=n,Ea(s,n,i),o.__e=o.__=null,n.__e!=r&&Sa(n)));io.__r=0}function ka(t,e,n,o,r,s,i,a,c,l,u){var d,h,p,m,g,b,v,w=o&&o.__k||xa,_=e.length;for(c=Gl(n,e,w,c,_),d=0;d<_;d++)(p=n.__k[d])!=null&&(h=p.__i==-1?kn:w[p.__i]||kn,p.__i=d,b=zr(t,p,h,r,s,i,a,c,l,u),m=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Hr(h.ref,null,p),u.push(p.ref,p.__c||m,p)),g==null&&m!=null&&(g=m),(v=!!(4&p.__u))||h.__k===p.__k?c=Ca(p,c,t,v):typeof p.type=="function"&&b!==void 0?c=b:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=g,c}function Gl(t,e,n,o,r){var s,i,a,c,l,u=n.length,d=u,h=0;for(t.__k=new Array(r),s=0;s<r;s++)(i=e[s])!=null&&typeof i!="boolean"&&typeof i!="function"?(c=s+h,(i=t.__k[s]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?xn(null,i,null,null,null):In(i)?xn(Ct,{children:i},null,null,null):i.constructor==null&&i.__b>0?xn(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=t,i.__b=t.__b+1,a=null,(l=i.__i=Xl(i,n,c,d))!=-1&&(d--,(a=n[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>u?h--:r<u&&h++),typeof i.type!="function"&&(i.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,i.__u|=4))):t.__k[s]=null;if(d)for(s=0;s<u;s++)(a=n[s])!=null&&!(2&a.__u)&&(a.__e==o&&(o=on(a)),Ta(a,a));return o}function Ca(t,e,n,o){var r,s;if(typeof t.type=="function"){for(r=t.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=t,e=Ca(r[s],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=on(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function be(t,e){return e=e||[],t==null||typeof t=="boolean"||(In(t)?t.some(function(n){be(n,e)}):e.push(t)),e}function Xl(t,e,n,o){var r,s,i,a=t.key,c=t.type,l=e[n],u=l!=null&&(2&l.__u)==0;if(l===null&&t.key==null||u&&a==l.key&&c==l.type)return n;if(o>(u?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((l=e[i=r>=0?r--:s++])!=null&&!(2&l.__u)&&a==l.key&&c==l.type)return i}return-1}function qs(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Kl.test(e)?n:n+"px"}function Jn(t,e,n,o,r){var s,i;t:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||qs(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||qs(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(_a,"$1")),i=e.toLowerCase(),e=i in t||e=="onFocusOut"||e=="onFocusIn"?i.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?o?n.u=o.u:(n.u=Fr,t.addEventListener(e,s?mr:pr,s)):t.removeEventListener(e,s?mr:pr,s);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break t}catch{}typeof n=="function"||(n==null||n===false&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Ks(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Fr++;else if(e.t<n.u)return;return n(at.event?at.event(e):e)}}}function zr(t,e,n,o,r,s,i,a,c,l){var u,d,h,p,m,g,b,v,w,_,x,S,M,R,N,J,et,X=e.type;if(e.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=e.__e=n.__e]),(u=at.__b)&&u(e);t:if(typeof X=="function")try{if(v=e.props,w="prototype"in X&&X.prototype.render,_=(u=X.contextType)&&o[u.__c],x=u?_?_.props.value:u.__:o,n.__c?b=(d=e.__c=n.__c).__=d.__E:(w?e.__c=d=new X(v,x):(e.__c=d=new ie(v,x),d.constructor=X,d.render=Jl),_&&_.sub(d),d.props=v,d.state||(d.state={}),d.context=x,d.__n=o,h=d.__d=true,d.__h=[],d._sb=[]),w&&d.__s==null&&(d.__s=d.state),w&&X.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=se({},d.__s)),se(d.__s,X.getDerivedStateFromProps(v,d.__s))),p=d.props,m=d.state,d.__v=e,h)w&&X.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),w&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(w&&X.getDerivedStateFromProps==null&&v!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,x),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,x)===false||e.__v==n.__v){for(e.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=false),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(V){V&&(V.__=e)}),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[],d.__h.length&&i.push(d);break t}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,x),w&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,g)})}if(d.context=x,d.props=v,d.__P=t,d.__e=false,M=at.__r,R=0,w){for(d.state=d.__s,d.__d=false,M&&M(e),u=d.render(d.props,d.state,d.context),N=0;N<d._sb.length;N++)d.__h.push(d._sb[N]);d._sb=[]}else do d.__d=false,M&&M(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++R<25);d.state=d.__s,d.getChildContext!=null&&(o=se(se({},o),d.getChildContext())),w&&!h&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(p,m)),J=u,u!=null&&u.type===Ct&&u.key==null&&(J=Ma(u.props.children)),a=ka(t,In(J)?J:[J],e,n,o,r,s,i,a,c,l),d.base=e.__e,e.__u&=-161,d.__h.length&&i.push(d),b&&(d.__E=d.__=null)}catch(V){if(e.__v=null,c||s!=null)if(V.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(et=s.length;et--;)Dr(s[et]);vr(e)}else e.__e=n.__e,e.__k=n.__k,V.then||vr(e);at.__e(V,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=Yl(n.__e,e,n,o,r,s,i,c,l);return(u=at.diffed)&&u(e),128&e.__u?void 0:a}function vr(t){t&&t.__c&&(t.__c.__e=true),t&&t.__k&&t.__k.forEach(vr)}function Ea(t,e,n){for(var o=0;o<n.length;o++)Hr(n[o],n[++o],n[++o]);at.__c&&at.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){at.__e(s,r.__v)}})}function Ma(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:In(t)?t.map(Ma):se({},t)}function Yl(t,e,n,o,r,s,i,a,c){var l,u,d,h,p,m,g,b=n.props,v=e.props,w=e.type;if(w=="svg"?r="http://www.w3.org/2000/svg":w=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((p=s[l])&&"setAttribute"in p==!!w&&(w?p.localName==w:p.nodeType==3)){t=p,s[l]=null;break}}if(t==null){if(w==null)return document.createTextNode(v);t=document.createElementNS(r,w,v.is&&v),a&&(at.__m&&at.__m(e,s),a=false),s=null}if(w==null)b===v||a&&t.data==v||(t.data=v);else{if(s=s&&Tn.call(t.childNodes),b=n.props||kn,!a&&s!=null)for(b={},l=0;l<t.attributes.length;l++)b[(p=t.attributes[l]).name]=p.value;for(l in b)if(p=b[l],l!="children"){if(l=="dangerouslySetInnerHTML")d=p;else if(!(l in v)){if(l=="value"&&"defaultValue"in v||l=="checked"&&"defaultChecked"in v)continue;Jn(t,l,null,p,r)}}for(l in v)p=v[l],l=="children"?h=p:l=="dangerouslySetInnerHTML"?u=p:l=="value"?m=p:l=="checked"?g=p:a&&typeof p!="function"||b[l]===p||Jn(t,l,p,b[l],r);if(u)a||d&&(u.__html==d.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),ka(e.type=="template"?t.content:t,In(h)?h:[h],e,n,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,i,s?s[0]:n.__k&&on(n,0),a,c),s!=null)for(l=s.length;l--;)Dr(s[l]);a||(l="value",w=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[l]||w=="progress"&&!m||w=="option"&&m!=b[l])&&Jn(t,l,m,b[l],r),l="checked",g!=null&&g!=t[l]&&Jn(t,l,g,b[l],r))}return t}function Hr(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(r){at.__e(r,n)}}function Ta(t,e,n){var o,r;if(at.unmount&&at.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||Hr(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(s){at.__e(s,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&Ta(o[r],e,n||typeof t.type!="function");n||Dr(t.__e),t.__c=t.__=t.__e=void 0}function Jl(t,e,n){return this.constructor(t,n)}function Cn(t,e,n){var o,r,s,i;e==document&&(e=document.documentElement),at.__&&at.__(t,e),r=(o=typeof n=="function")?null:n&&n.__k||e.__k,s=[],i=[],zr(e,t=(!o&&n||e).__k=_e(Ct,null,[t]),r||kn,kn,e.namespaceURI,!o&&n?[n]:r?null:e.firstChild?Tn.call(e.childNodes):null,s,!o&&n?n:r?r.__e:e.firstChild,o,i),Ea(s,t,i)}function Ia(t,e){Cn(t,e,Ia)}function Ql(t,e,n){var o,r,s,i,a=se({},t.props);for(s in t.type&&t.type.defaultProps&&(i=t.type.defaultProps),e)s=="key"?o=e[s]:s=="ref"?r=e[s]:a[s]=e[s]===void 0&&i!=null?i[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Tn.call(arguments,2):n),xn(t.type,a,o||t.key,r||t.ref,null)}function ue(t){function e(n){var o,r;return this.getChildContext||(o=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&o.forEach(function(i){i.__e=true,gr(i)})},this.sub=function(s){o.add(s);var i=s.componentWillUnmount;s.componentWillUnmount=function(){o&&o.delete(s),i&&i.call(s)}}),n.children}return e.__c="__cC"+wa++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,o){return n.children(o)}).contextType=e,e}Tn=xa.slice,at={__e:function(t,e,n,o){for(var r,s,i;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),i=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,o||{}),i=r.__d),i)return r.__E=r}catch(a){t=a}throw t}},va=0,ie.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=se({},this.state),typeof t=="function"&&(t=t(se({},n),this.props)),t&&se(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),gr(this))},ie.prototype.forceUpdate=function(t){this.__v&&(this.__e=true,t&&this.__h.push(t),gr(this))},ie.prototype.render=Ct,$e=[],ya=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ba=function(t,e){return t.__v.__b-e.__v.__b},io.__r=0,_a=/(PointerCapture)$|Capture$/i,Fr=0,pr=Ks(false),mr=Ks(true),wa=0;var tu=0;function f(t,e,n,o,r,s){e||(e={});var i,a,c=e;if("ref"in c)for(a in c={},e)a=="ref"?i=e[a]:c[a]=e[a];var l={type:t,props:c,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tu,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(i=t.defaultProps))for(a in i)c[a]===void 0&&(c[a]=i[a]);return at.vnode&&at.vnode(l),l}var Ie,kt,Zo,Zs,rn=0,Pa=[],Et=at,Gs=Et.__b,Xs=Et.__r,Ys=Et.diffed,Js=Et.__c,Qs=Et.unmount,ti=Et.__;function ln(t,e){Et.__h&&Et.__h(kt,t,rn||e),rn=0;var n=kt.__H||(kt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function z(t){return rn=1,Wr(Oa,t)}function Wr(t,e,n){var o=ln(Ie++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Oa(void 0,e),function(a){var c=o.__N?o.__N[0]:o.__[0],l=o.t(c,a);c!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=kt,!kt.__f)){var r=function(a,c,l){if(!o.__c.__H)return true;var u=o.__c.__H.__.filter(function(h){return!!h.__c});if(u.every(function(h){return!h.__N}))return!s||s.call(this,a,c,l);var d=o.__c.props!==a;return u.forEach(function(h){if(h.__N){var p=h.__[0];h.__=h.__N,h.__N=void 0,p!==h.__[0]&&(d=true)}}),s&&s.call(this,a,c,l)||d};kt.__f=true;var s=kt.shouldComponentUpdate,i=kt.componentWillUpdate;kt.componentWillUpdate=function(a,c,l){if(this.__e){var u=s;s=void 0,r(a,c,l),s=u}i&&i.call(this,a,c,l)},kt.shouldComponentUpdate=r}return o.__N||o.__}function D(t,e){var n=ln(Ie++,3);!Et.__s&&jr(n.__H,e)&&(n.__=t,n.u=e,kt.__H.__h.push(n))}function Dt(t,e){var n=ln(Ie++,4);!Et.__s&&jr(n.__H,e)&&(n.__=t,n.u=e,kt.__h.push(n))}function $(t){return rn=5,vt(function(){return{current:t}},[])}function La(t,e,n){rn=6,Dt(function(){if(typeof t=="function"){var o=t(e());return function(){t(null),o&&typeof o=="function"&&o()}}if(t)return t.current=e(),function(){return t.current=null}},n==null?n:n.concat(t))}function vt(t,e){var n=ln(Ie++,7);return jr(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function dt(t,e){return rn=8,vt(function(){return t},e)}function zt(t){var e=kt.context[t.__c],n=ln(Ie++,9);return n.c=t,e?(n.__==null&&(n.__=true,e.sub(kt)),e.props.value):t.__}function Aa(t,e){Et.useDebugValue&&Et.useDebugValue(e?e(t):t)}function Ur(){var t=ln(Ie++,11);if(!t.__){for(var e=kt.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function eu(){for(var t;t=Pa.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(oo),t.__H.__h.forEach(yr),t.__H.__h=[]}catch(e){t.__H.__h=[],Et.__e(e,t.__v)}}Et.__b=function(t){kt=null,Gs&&Gs(t)},Et.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ti&&ti(t,e)},Et.__r=function(t){Xs&&Xs(t),Ie=0;var e=(kt=t.__c).__H;e&&(Zo===kt?(e.__h=[],kt.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(oo),e.__h.forEach(yr),e.__h=[],Ie=0)),Zo=kt},Et.diffed=function(t){Ys&&Ys(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Pa.push(e)!==1&&Zs===Et.requestAnimationFrame||((Zs=Et.requestAnimationFrame)||nu)(eu)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Zo=kt=null},Et.__c=function(t,e){e.some(function(n){try{n.__h.forEach(oo),n.__h=n.__h.filter(function(o){return!o.__||yr(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Et.__e(o,n.__v)}}),Js&&Js(t,e)},Et.unmount=function(t){Qs&&Qs(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{oo(o)}catch(r){e=r}}),n.__H=void 0,e&&Et.__e(e,n.__v))};var ei=typeof requestAnimationFrame=="function";function nu(t){var e,n=function(){clearTimeout(o),ei&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);ei&&(e=requestAnimationFrame(n))}function oo(t){var e=kt,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),kt=e}function yr(t){var e=kt;t.__c=t.__(),kt=e}function jr(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Oa(t,e){return typeof e=="function"?e(t):e}function Na(t,e){for(var n in e)t[n]=e[n];return t}function br(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return true;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return true;return false}function te(t,e){var n=e(),o=z({t:{__:n,u:e}}),r=o[0].t,s=o[1];return Dt(function(){r.__=n,r.u=e,Go(r)&&s({t:r})},[t,n,e]),D(function(){return Go(r)&&s({t:r}),t(function(){Go(r)&&s({t:r})})},[t]),n}function Go(t){var e,n,o=t.u,r=t.__;try{var s=o();return!((e=r)===(n=s)&&(e!==0||1/e==1/n)||e!=e&&n!=n)}catch{return true}}function Ra(t){t()}function Ba(t){return t}function $a(){return[false,Ra]}var Fa=Dt;function _r(t,e){this.props=t,this.context=e}function ou(t,e){function n(r){var s=this.props.ref,i=s==r.ref;return!i&&s&&(s.call?s(null):s.current=null),e?!e(this.props,r)||!i:br(this.props,r)}function o(r){return this.shouldComponentUpdate=n,_e(t,r)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=true,o.__f=true,o.type=t,o}(_r.prototype=new ie).isPureReactComponent=true,_r.prototype.shouldComponentUpdate=function(t,e){return br(this.props,t)||br(this.state,e)};var ni=at.__b;at.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),ni&&ni(t)};var ru=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ne(t){function e(n){var o=Na({},n);return delete o.ref,t(o,n.ref||null)}return e.$$typeof=ru,e.render=t,e.prototype.isReactComponent=e.__f=true,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var oi=function(t,e){return t==null?null:be(be(t).map(e))},su={map:oi,forEach:oi,count:function(t){return t?be(t).length:0},only:function(t){var e=be(t);if(e.length!==1)throw"Children.only";return e[0]},toArray:be},iu=at.__e;at.__e=function(t,e,n,o){if(t.then){for(var r,s=e;s=s.__;)if((r=s.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e)}iu(t,e,n,o)};var ri=at.unmount;function Da(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=Na({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=true,t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return Da(o,e,n)})),t}function za(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return za(o,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=true,t.__c.__P=n)),t}function _t(){this.__u=0,this.o=null,this.__b=null}function Ha(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function mt(t){var e,n,o;function r(s){if(e||(e=t()).then(function(i){n=i.default||i},function(i){o=i}),o)throw o;if(!n)throw e;return _e(n,s)}return r.displayName="Lazy",r.__f=true,r}function _n(){this.i=null,this.l=null}at.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),ri&&ri(t)},(_t.prototype=new ie).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=Ha(o.__v),s=false,i=function(){s||(s=true,n.__R=null,r?r(a):a())};n.__R=i;var a=function(){if(!--o.__u){if(o.state.__a){var c=o.state.__a;o.__v.__k[0]=za(c,c.__c.__P,c.__c.__O)}var l;for(o.setState({__a:o.__b=null});l=o.o.pop();)l.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(i,i)},_t.prototype.componentWillUnmount=function(){this.o=[]},_t.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Da(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&_e(Ct,null,t.fallback);return r&&(r.__u&=-33),[_e(Ct,null,e.__a?null:t.children),r]};var si=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};function au(t){return this.getChildContext=function(){return t.context},t.children}function cu(t){var e=this,n=t.h;if(e.componentWillUnmount=function(){Cn(null,e.v),e.v=null,e.h=null},e.h&&e.h!==n&&e.componentWillUnmount(),!e.v){for(var o=e.__v;o!==null&&!o.__m&&o.__!==null;)o=o.__;e.h=n,e.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return true},insertBefore:function(r,s){this.childNodes.push(r),e.h.insertBefore(r,s)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.h.removeChild(r)}}}Cn(_e(au,{context:e.context},t.__v),e.v)}function lu(t,e){var n=_e(cu,{__v:t,h:e});return n.containerInfo=e,n}(_n.prototype=new ie).__a=function(t){var e=this,n=Ha(e.__v),o=e.l.get(t);return o[0]++,function(r){var s=function(){e.props.revealOrder?(o.push(r),si(e,t,o)):r()};n?n(s):s()}},_n.prototype.render=function(t){this.i=null,this.l=new Map;var e=be(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},_n.prototype.componentDidUpdate=_n.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){si(t,n,e)})};var Wa=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,uu=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,du=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,fu=/[A-Z0-9]/g,hu=typeof document<"u",pu=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function mu(t,e,n){return e.__k==null&&(e.textContent=""),Cn(t,e),typeof n=="function"&&n(),t?t.__c:null}function gu(t,e,n){return Ia(t,e),typeof n=="function"&&n(),t?t.__c:null}ie.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(ie.prototype,t,{configurable:true,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:true,writable:true,value:e})}})});var ii=at.event;function vu(){}function yu(){return this.cancelBubble}function bu(){return this.defaultPrevented}at.event=function(t){return ii&&(t=ii(t)),t.persist=vu,t.isPropagationStopped=yu,t.isDefaultPrevented=bu,t.nativeEvent=t};var Vr,_u={enumerable:false,configurable:true,get:function(){return this.class}},ai=at.vnode;at.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,o=e.type,r={},s=o.indexOf("-")===-1;for(var i in n){var a=n[i];if(!(i==="value"&&"defaultValue"in n&&a==null||hu&&i==="children"&&o==="noscript"||i==="class"||i==="className")){var c=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&a===true?a="":c==="translate"&&a==="no"?a=false:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?i="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||pu(n.type)?c==="onfocus"?i="onfocusin":c==="onblur"?i="onfocusout":du.test(i)&&(i=c):c=i="oninput":s&&uu.test(i)?i=i.replace(fu,"-$&").toLowerCase():a===null&&(a=void 0),c==="oninput"&&r[i=c]&&(i="oninputCapture"),r[i]=a}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=be(n.children).forEach(function(l){l.props.selected=r.value.indexOf(l.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=be(n.children).forEach(function(l){l.props.selected=r.multiple?r.defaultValue.indexOf(l.props.value)!=-1:r.defaultValue==l.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",_u)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),e.props=r}(t),t.$$typeof=Wa,ai&&ai(t)};var ci=at.__r;at.__r=function(t){ci&&ci(t),Vr=t.__c};var li=at.diffed;at.diffed=function(t){li&&li(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value),Vr=null};var wu={ReactCurrentDispatcher:{current:{readContext:function(t){return Vr.__n[t.__c].props.value},useCallback:dt,useContext:zt,useDebugValue:Aa,useDeferredValue:Ba,useEffect:D,useId:Ur,useImperativeHandle:La,useInsertionEffect:Fa,useLayoutEffect:Dt,useMemo:vt,useReducer:Wr,useRef:$,useState:z,useSyncExternalStore:te,useTransition:$a}}};function xu(t){return _e.bind(null,t)}function yo(t){return!!t&&t.$$typeof===Wa}function Su(t){return yo(t)&&t.type===Ct}function ku(t){return!!t&&!!t.displayName&&(typeof t.displayName=="string"||t.displayName instanceof String)&&t.displayName.startsWith("Memo(")}function Cu(t){return yo(t)?Ql.apply(null,arguments):t}function Eu(t){return!!t.__k&&(Cn(null,t),true)}function Mu(t){return t&&(t.base||t.nodeType===1&&t)||null}var Tu=function(t,e){return t(e)},Iu=function(t,e){return t(e)},Pu=Ct,Lu=yo,ae={useState:z,useId:Ur,useReducer:Wr,useEffect:D,useLayoutEffect:Dt,useInsertionEffect:Fa,useTransition:$a,useDeferredValue:Ba,useSyncExternalStore:te,startTransition:Ra,useRef:$,useImperativeHandle:La,useMemo:vt,useCallback:dt,useContext:zt,useDebugValue:Aa,version:"18.3.1",Children:su,render:mu,hydrate:gu,unmountComponentAtNode:Eu,createPortal:lu,createElement:_e,createContext:ue,createFactory:xu,cloneElement:Cu,createRef:Zl,Fragment:Ct,isValidElement:yo,isElement:Lu,isFragment:Su,isMemo:ku,findDOMNode:Mu,Component:ie,PureComponent:_r,memo:ou,forwardRef:ne,flushSync:Iu,unstable_batchedUpdates:Tu,StrictMode:Pu,Suspense:_t,SuspenseList:_n,lazy:mt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:wu};function qr(t){const e=te(Ou,Nu);return!!t||e}const Kr=t=>t?{"data-high-contrast":""}:{},Au="(prefers-contrast: more)",Ua=()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Au):null;function Ou(t){var n;const e=Ua();return(n=e==null?void 0:e.addEventListener)==null||n.call(e,"change",t),()=>{var o;return(o=e==null?void 0:e.removeEventListener)==null?void 0:o.call(e,"change",t)}}const Nu=()=>{var t;return!!((t=Ua())!=null&&t.matches)},Pn=ue(void 0),Mt=(...t)=>t.filter(Boolean).join(" "),bo=ue(null);function Pe(){return zt(bo)}function de(t="This part"){const e=zt(bo);if(!e)throw new Error(`${t} must be rendered inside <Clover.Root>.`);return e}function it(t,e=Object.is,n){const{clover:o}=de(n),r=$(null),s=()=>{const i=t(o.store.get());return r.current&&e(r.current.value,i)?r.current.value:(r.current={value:i},i)};return te(o.store.subscribe,s)}const Ru={subscribe:()=>()=>{}};function Ln(t,e){const n=zt(bo),o=n==null?void 0:n.clover.store,r=()=>o?t(o.get()):e;return te(o?o.subscribe:Ru.subscribe,r)}const Bu=JSON.parse('{"commonClose":"Close","commonNext":"Next","commonPrevious":"Previous","commonSearch":"Search","commonViewAll":"View all","controlShortcut":"{{label}} ({{shortcut}})","contentSearchLoading":"Loading...","contentSearchPlaceholder":"Search","contentSearchResultsNone":"No results","contentSearchResult":"1 result","contentSearchResults":"{{count}} results","contentSearchError":"The search could not be completed.","contentSearchPosition":"Result {{index}} of {{total}}","contentSearchClear":"Clear search","canvasPosition":"Item {{index}} of {{total}}","canvasImage":"Image","bodyUnloadableImage":"This image could not be loaded.","bodyUnloadableVideo":"This video could not be loaded.","bodyUnloadableAudio":"This audio could not be loaded.","bodyUnloadableModel":"This model could not be loaded.","canvasRoleDescription":"zoomable image","canvasKeysImage":"Use the arrow keys to pan, with Shift for larger steps, plus and minus to zoom, 0 to reset the view, and R or Shift+R to rotate.","canvasKeysMedia":"Press Space or K to play or pause, J or L to skip ten seconds back or forward, and M to mute or unmute.","canvasKeysAnnotations":"Press Escape to clear the selected annotation.","sceneModel":"3D model","sceneRoleDescription":"rotatable 3D model","sceneKeys":"Use the arrow keys to rotate the model, with Shift for larger steps, plus and minus to zoom, 0 to reset the view, and R or Shift+R to rotate it right or left.","sceneRotateUp":"Rotate up","sceneRotateDown":"Rotate down","sceneRotate":"Rotate","sceneResetView":"Reset view","statusLoading":"Loading\u2026","statusError":"This could not be loaded.","itemsLabel":"Items","download":"Download","downloadPage":"This page","downloadAll":"All pages","templateSidebar":"Items","templateSidebarToggle":"Show items","templateBack":"Back","templateBackTo":"Back to {{label}}","collectionLabel":"Collection","itemsScrollBack":"Show previous items","itemsScrollForward":"Show more items","aboutRights":"Rights","aboutDate":"Date","aboutHomepage":"Homepage","aboutSeeAlso":"See also","aboutProvider":"Provider","logo":"Logo","aboutManifest":"IIIF Manifest","aboutCanvas":"IIIF Canvas","aboutPartOf":"Part of","aboutOpenManifest":"Open the full Manifest","aboutCollection":"IIIF Collection","readingLanguage":"Language","annotationsHide":"Hide annotations","annotationsHideTip":"Hide","readMore":"Read more","readLess":"Read less","annotationsShow":"Find on the image","annotationsShowTime":"Find in the recording","annotationsImage":"Image","annotationsLanguage":"Language","annotationsOpenLink":"Open the link","transcriptLabel":"Transcript","imageViewerOpen":"Open image viewer","imageViewerClose":"Close image viewer","canvasChoice":"Choice","canvasViewerControls":"Viewer controls","canvasExpandControls":"Expand viewer controls","canvasCollapseControls":"Collapse viewer controls","canvasScrollBack":"Show previous controls","canvasScrollForward":"Show more controls","imageFullScreen":"Full screen","imageExitFullScreen":"Exit full screen","imageResetZoom":"Reset zoom","imageRotateLeft":"Rotate left","imageRotateRight":"Rotate right","imageZoomIn":"Zoom in","imageZoomOut":"Zoom out","informationPanelTabs":"Information panel","sectionsScrollBack":"Show previous tabs","sectionsScrollForward":"Show more tabs","informationPanelClose":"Close information panel","informationPanelTabsAbout":"About","informationPanelTabsAnnotations":"Annotations","informationPanelTabsSearch":"Search","informationPanelTabsContents":"Contents","contentsSectionsIn":"Sections in","informationPanelTabsMap":"Map","informationPanelTabsCollection":"Collection","informationPanelTabsTargets":"Views","mapUnavailable":"The map could not be shown.","mapLabel":"Map","mapAttribution":"Map credits","mapPlaceUntitled":"Place {{number}}","mapOverlay":"Georeferenced image","mapPlacesListed":"Places listed after the map: {{count}}","informationPanelToggle":"More information","playerPlay":"Play","playerPause":"Pause","playerMute":"Mute","playerUnmute":"Unmute","playerVolume":"Volume","playerSeek":"Seek","playerCaptions":"Captions","playerCaptionsOff":"Off","playerChapters":"Chapters","playerFill":"Fill frame","playerFit":"Fit to frame","frameRepeat":"Repeat","playerCurrentTime":"Current time","playerDuration":"Duration","splitHandle":"Resize panels"}'),ja={es:()=>import("../es-B1NvdYp-.mjs"),fi:()=>import("../fi-BjtYZNLo.mjs"),fr:()=>import("../fr-Cd22Lziw.mjs"),nb:()=>import("../nb-CEwZDBiR.mjs"),nn:()=>import("../nn-jYQhr9RI.mjs"),no:()=>import("../no-CEwZDBiR.mjs"),pt:()=>import("../pt-CWR30SzS.mjs")};function Va(){const t=[];return typeof document<"u"&&t.push(document.documentElement.lang),typeof navigator<"u"&&t.push(...navigator.languages??[],navigator.language),t.filter(Boolean)}const ao=t=>t.split("-")[0];function qa(t,e){return ao(t).toLowerCase()===ao(e).toLowerCase()}const Xo=t=>t.includes("-")?ao(t):null;function $u(t,e,n=[]){if(!e.length)return;if(e.length===1)return e[0];const o=()=>e.includes("none")?"none":e.includes("@none")?"@none":e[0];if(!t)return e.includes("none")?"none":e[0];if(e.includes(t))return t;const r=Xo(t);if(r&&e.includes(r))return r;const s=n.find(a=>e.includes(a));if(s)return s;const i=e.findIndex(a=>Xo(a)===t);if(i!==-1)return e[i];for(const a of n){const c=Xo(a);if(c&&e.includes(c))return c}return o()}function Zr(t,e){const[n,...o]=e?[e]:Va();return $u(n,t,o)??t[0]}const ge="clover",Qt={en:{[ge]:{...Bu}}};let tn,Ka=[],co=0;const wr=new Set;function Gr(){co++,wr.forEach(t=>t())}function Fu(t){const e=ao(t);return e&&e!==t?[t,e]:[t]}const ui=new Map,Du=t=>Object.prototype.hasOwnProperty.call(ja,t);function zu(t){let e=ui.get(t);return e||(e=ja[t]().then(({default:n})=>{var o;Qt[t]={...Qt[t],[ge]:{...n,...(o=Qt[t])==null?void 0:o[ge]}},Gr()},()=>{}),ui.set(t,e)),e}function Za(t){const e=t.find(n=>n==="en"||Du(n));return e&&e!=="en"?zu(e):Promise.resolve()}let Qn=[],di="";function wn(){const t=tn?`${co}`:`${co} ${typeof document<"u"?document.documentElement.lang:""} ${typeof navigator<"u"?navigator.languages:""}`;if(t===di)return Qn;di=t;const e=tn?[tn]:Va();return Qn=[...new Set([...e,...Ka].flatMap(Fu).concat("en"))],Za(Qn),Qn}function _o(t,e){if(t)return qa(t,e||Jt.resolvedLanguage)?void 0:t}const Jt={get language(){return tn??wn().find(t=>Qt[t])??"en"},get resolvedLanguage(){return wn().find(t=>{var e;return Object.keys(((e=Qt[t])==null?void 0:e[ge])??{}).length>0})??"en"},changeLanguage(t){tn=t,Gr()},resolve(t,e,n=ge){var r,s;let o={text:t};for(const i of wn()){const a=(s=(r=Qt[i])==null?void 0:r[n])==null?void 0:s[t];if(a!==void 0){o={text:a,lang:i};break}}return e?{...o,text:o.text.replace(/\{\{(\w+)\}\}/g,(i,a)=>a in e?String(e[a]):i)}:o},t(t,e,n=ge){return Jt.resolve(t,e,n).text},langOf(t,e,n=ge){return _o(Jt.resolve(t,void 0,n).lang,e)},ready(){return Za(wn())},subscribe(t){return wr.add(t),()=>{wr.delete(t)}},getSnapshot(){return co}};typeof document<"u"&&wn();function Hu(t={}){for(const[e,n]of Object.entries(t.resources??{}))for(const[o,r]of Object.entries(n??{}))Qt[e]??(Qt[e]={}),Qt[e][o]={...Qt[e][o],...r};return t.fallbackLng!==void 0&&(Ka=t.fallbackLng===false?[]:[t.fallbackLng].flat()),t.lng&&(tn=t.lng),Gr(),Jt}const Wu=Object.freeze(Object.defineProperty({__proto__:null,CLOVER_I18N_NAMESPACE:ge,cloverI18n:Jt,initCloverI18n:Hu,langWithin:_o},Symbol.toStringTag,{value:"Module"}));function It(t=ge,e){const n=te(Jt.subscribe,Jt.getSnapshot,Jt.getSnapshot),o=zt(Pn),r=e??o,s=dt((a,c)=>Jt.t(a,c,t),[t,n]),i=dt(a=>Jt.langOf(a,r,t),[t,n,r]);return{t:s,langOf:i,hostLanguage:r,i18n:Jt}}function wo(t,e){const n=zt(Pn),o=$(null),[r,s]=z(""),i=dt(u=>{o.current=u,typeof t=="function"?t(u):t&&(t.current=u)},[t]);D(()=>{var d,h;const u=(d=o.current)==null?void 0:d.parentElement;e!==void 0||n!==void 0||!u||s(((h=u.closest("[lang]"))==null?void 0:h.getAttribute("lang"))??"")});const c=e??n??r,{langOf:l}=It(void 0,c);return{ref:i,hostLanguage:c,langOf:l}}const H=t=>Array.isArray(t)?t:t==null?[]:[t],Uu=["left-to-right","right-to-left","top-to-bottom","bottom-to-top"];function Xr(t){return Uu.includes(t)?t:"left-to-right"}const ju=["individuals","paged","continuous","unordered"];function Vu(t){return H(t).find(n=>ju.includes(n))??"individuals"}function qu(t,e){if(!t.length)return[];if(e==="continuous")return[t.map((a,c)=>c)];if(e!=="paged")return t.map((a,c)=>[c]);const n=[];let o=[],r=0,s=false;const i=()=>{o.length&&n.push(o),o=[]};return t.forEach((a,c)=>{const l=H(a.behavior);if(l.includes("non-paged")){c===r&&r++,i(),n.push([c]);return}if(c===r||l.includes("facing-pages")){o.length&&(s=true),i(),n.push([c]);return}if(o.push(c),s){i(),s=false;return}o.length>1&&i()}),i(),n}function Ku(t,e){const n=t.findIndex(o=>o.includes(e));return n===-1?0:n}const Ga=["Independents","Composite","List"];function xo(t){return H(t==null?void 0:t.body).flatMap(e=>Ga.includes(e==null?void 0:e.type)?H(e.items):[e])}function Yr(t){const e=H(t==null?void 0:t.motivation);return!e.length||e.includes("painting")}function Xa(t,e){const n=/(?:^|[#&])t=([^&]+)/.exec(e),o=n&&{t:n[1]},r=/(?:^|[#&])xywh=(?:pixel:)?([^&]+)/.exec(e);if(r){const[s,i,a,c]=r[1].split(",").map(Number);if([s,i,a,c].every(Number.isFinite))return{id:t,rect:{x:s,y:i,w:a,h:c},...o}}return o&&{id:t,...o}}function to(t){const e=t.indexOf("#");if(e>=0){const o=t.slice(0,e);return Xa(o,t.slice(e))??{id:o}}const n=t.indexOf("&t=");return n>=0?{id:t.slice(0,n),t:t.slice(n+3)}:{id:t}}const xr=t=>{var e;return Array.isArray(t)?xr(t[0]):Ga.includes(t==null?void 0:t.type)?xr((e=t.items)==null?void 0:e[0]):t};function un(t){return Zu(xr(t))}function Zu(t){var n;if(typeof t=="string")return to(t);if(!t||typeof t!="object")return{id:""};if(t.type!=="SpecificResource"||t.source===void 0)return to(t.id??"");const e=typeof t.source=="string"?to(t.source):to(((n=t.source)==null?void 0:n.id)??"");for(const o of H(t.selector)){const r=o;if((r==null?void 0:r.type)==="PointSelector"){const[s,i,a]=[r.x,r.y,r.instant??r.t].map(Number),c=Number.isFinite(s)&&Number.isFinite(i);return{id:e.id,...c?{point:{x:s,y:i}}:{},...Number.isFinite(a)?{t:String(a)}:{}}}if((r==null?void 0:r.type)==="SvgSelector"&&r.value)return{id:e.id,svg:String(r.value)};if((r==null?void 0:r.type)==="FragmentSelector"&&r.value){const s=Xa(e.id,String(r.value));if(s)return s}}return e}const An=t=>t==="Audio"||t==="Sound",Gu=t=>{const e=H(t);return e.length>0&&e.every(n=>n==="supplementing")},Xu=(t,e)=>Gu(t)&&!!(e.rect||e.svg||e.point)&&!e.t,fi=new WeakMap,Yu={canvases:[],views:[],direction:"left-to-right"};function Lt(t){if(!t)return Yu;let e=fi.get(t);if(!e){const n=(t.items??[]).filter(o=>(o==null?void 0:o.type)==="Canvas"||(o==null?void 0:o.type)==="Timeline"||(o==null?void 0:o.type)==="Scene");e={canvases:n,views:qu(n,Vu(t.behavior)),direction:Xr(t.viewingDirection)},fi.set(t,e)}return e}const hi=new WeakMap;function He(t,e){if(!e)return null;const n=Lt(t);let o=hi.get(n);if(!o){o=new Map;for(const r of n.canvases)o.has(r.id)||o.set(r.id,r);hi.set(n,o)}return o.get(e)??null}function On(t,e){const{canvases:n,views:o}=Lt(t),r=n.findIndex(s=>s.id===e);return r===-1?0:Ku(o,r)}const pi=new WeakMap,Ju=[];function De(t,e){if(!t)return Ju;const n=On(t,e);let o=pi.get(t);o||pi.set(t,o=new Map);let r=o.get(n);if(!r){const s=Lt(t);r=(s.views[n]??[]).map(i=>s.canvases[i]),o.set(n,r)}return r}function Qu(t,e){var s,i;const{canvases:n,views:o}=Lt(t),r=(s=o[e])==null?void 0:s[0];return r===void 0?null:((i=n[r])==null?void 0:i.id)??null}function td(t){const e=t==null?void 0:t.start;if(!e)return null;const n=un(e);if(!n.id)return null;const o={canvasId:n.id};n.rect&&(o.region=n.rect);const r=n.t?Number(n.t.split(",")[0]):NaN;return Number.isFinite(r)&&(o.time=r),o}const Ne=(t,e)=>{const n=t==null?void 0:t.behavior;return Array.isArray(n)?n.includes(e):n===e},ed=t=>[(t==null?void 0:t.partOf)??[]].flat().find(e=>(e==null?void 0:e.id)&&e.type==="Collection");function nd(t,e,n,o){const r=t==null?void 0:t.items;if(!(r!=null&&r.length)||!n)return-1;const s=De(n,o),i=a=>{const c=r[a];return((c==null?void 0:c.manifestId)===n.id||(c==null?void 0:c.manifestAs)===n.id)&&(!c.canvasId||s.some(l=>l.id===c.canvasId))};return e!==null&&i(e)?e:r.findIndex((a,c)=>i(c))}function bt(t,e,n=", "){if(!t)return{text:""};if(typeof t=="string")return{text:t};const o=Object.keys(t).filter(a=>{var c;return(c=t[a])==null?void 0:c.length});if(!o.length)return{text:""};const r=Zr(o,e),s=t[r];return{text:Array.isArray(s)?s.join(n):String(s),lang:r==="none"?void 0:r}}const od=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/;function En(t){const e=t==null?void 0:t.language,n=(Array.isArray(e)?e:[e]).filter(o=>typeof o=="string"&&od.test(o));return n.length===1?n[0]:void 0}const sn={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},rd=/^(ar|arc|ckb|dv|fa|he|iw|ks|ps|sd|syr|ug|ur|yi)$/,sd=/^(adlm|arab|hebr|nkoo|rohg|syrc|thaa)$/;function id(t){if(!t)return;const[e,...n]=t.toLowerCase().split(/[-_]/),o=n.find(r=>r.length===4);return(o?sd.test(o):rd.test(e))?"rtl":void 0}function ut(t){return t?{lang:t,dir:id(t)}:{}}function ad({clover:t,language:e}){const{t:n,langOf:o}=It(),[r,s]=z(null),i=$(n);return i.current=n,D(()=>{let a=null;return t.store.subscribe(()=>{const{manifest:c,canvasId:l,status:u}=t.store.get();if(u!=="ready"||l===a)return;const d=a===null;if(a=l,d)return;const h=He(c,l),p=bt(h==null?void 0:h.label,e),m=i.current("canvasPosition",{index:On(c,l)+1,total:Lt(c).views.length});s({label:p.text,lang:p.lang,position:m})})},[t,e]),f("div",{className:"clover-announcer",role:"status","aria-live":"polite","aria-atomic":"true",style:sn,children:[r!=null&&r.label?f(Ct,{children:[f("span",{...ut(r.lang),children:r.label}),","," "]}):null,r&&f("span",{...ut(o("canvasPosition")),children:r.position})]})}const cd=t=>(t==null?void 0:t.format)==="text/vtt"||typeof(t==null?void 0:t.id)=="string"&&/\.vtt(\?|$)/i.test(t.id);function ld(t){const e=[];let n=0;const o=(r,s)=>{var a;if(!r||cd(r))return;if(r.type==="SpecificResource"){r.source&&typeof r.source=="object"&&o(r.source,s);return}const i=s===void 0?{}:{choice:s};if(r.type==="TextualBody"||typeof r.value=="string")e.push({value:String(r.value??""),format:r.format,language:H(r.language)[0],...i});else if(r.type==="Image"&&r.id){const c=r.label??t.label;e.push({image:r.id,format:r.format,...c?{label:c}:{},...i})}else if(r.type==="Feature"){const c=((a=r.properties)==null?void 0:a.label)??t.label;c&&typeof c=="object"&&e.push({label:c,place:true,...i})}};for(const r of xo(t))if((r==null?void 0:r.type)!=="Choice")o(r);else{const s=n++;for(const i of H(r.items))o(i,s)}return e}const Jr="content-search",mi=/\/search\/([0-2])\//;function Ya(t){if(!t)return null;let e=null;for(const n of H(t.service)){const o=(n==null?void 0:n.id)??(n==null?void 0:n["@id"]);if(typeof o!="string")continue;const r=String(n.type??n["@type"]??""),s=[n.profile,n["@context"]].flat().map(a=>String(a??"")).join(" "),i=r==="SearchService2"?2:r==="SearchService1"?1:mi.test(s)?Number(mi.exec(s)[1])>=2?2:1:null;if(i===2)return{id:o,version:i};i===1&&(e??(e={id:o,version:i}))}return e}const ud="contents",Uv=(t,e)=>`${t}#region-${e+1}`,dd=t=>H(t==null?void 0:t.motivation).includes("linking");function Ja(t,e,n){const o=[];for(const r of H(t==null?void 0:t.items)){const s=H(r==null?void 0:r.motivation);if(s.includes("painting"))continue;const i=ld(r);if(!i.length&&!dd(r))continue;const a=un(H(r.target)[0]),c=a.id||n;!c||!r.id||o.push({id:r.id,setId:e,canvasId:c,target:a,motivation:s,bodies:i,annotation:r})}return o}const fd=t=>Lt(t).canvases.some(e=>H(e.items).some(n=>H(n==null?void 0:n.items).some(o=>H(o==null?void 0:o.body).some(r=>[r,...H(r==null?void 0:r.items)].some(s=>H(s==null?void 0:s.annotations).length>0)))));function hd(t,e){for(const n of[t,e])if(n!=null&&n.label)return n.label;for(const n of[t,e]){const o=H(n==null?void 0:n.partOf).find(r=>/AnnotationCollection/.test(String((r==null?void 0:r.type)??(r==null?void 0:r["@type"])))&&r.label);if(o)return o.label}}const Qa=t=>H(t==null?void 0:t.partOf).filter(e=>(e==null?void 0:e.id)&&/AnnotationCollection/.test(String((e==null?void 0:e.type)??(e==null?void 0:e["@type"])))),gi=new WeakMap;function tc(t){var n;if(!t)return[];let e=gi.get(t);if(!e){const o=new Map;for(const r of Lt(t).canvases)for(const s of H(r.annotations)){if(!Array.isArray(s==null?void 0:s.items))continue;const i=s.id??`${r.id}#annotations`;let a=o.get(i);if(!a){const c=(n=Qa(s)[0])==null?void 0:n.id;a={id:i,label:hd(s),source:"manifest",entries:[],...c?{collection:c}:{}},o.set(i,a)}a.entries.push(...Ja(s,i,r.id))}e=[...o.values()].filter(r=>r.entries.length),gi.set(t,e)}return e}const vi=new WeakMap,ec=[];function jv(t){if(!t)return ec;let e=vi.get(t);return e||(e=Lt(t).canvases.flatMap(n=>H(n.annotations).filter(o=>o==null?void 0:o.id).map(o=>({id:String(o.id),canvasId:String(n.id),fetched:Array.isArray(o.items)}))),vi.set(t,e)),e}const Yo=new WeakMap,Jo=new WeakMap;function nc(t,e=pd){var n;if(!Jo.has(e)){const o=e.filter(s=>s.content),r=(n=o[0])==null?void 0:n.content;Jo.set(e,r?{id:r.id,type:r.type,...r.label?{label:r.label}:{},pages:ec,entries:o.flatMap(s=>s.entries)}:null)}return Jo.get(e)??md(t)}const pd=[];function md(t){var r;if(!t)return null;if(Yo.has(t))return Yo.get(t);const e=Lt(t).canvases.flatMap(s=>H(s.annotations).flatMap(i=>Qa(i).map(a=>({part:a,page:i,canvas:s})))),n=(r=e[0])==null?void 0:r.part.id,o=n?(()=>{var l,u;const s=e.filter(({part:d})=>d.id===n),i=(l=s.find(({part:d})=>d.label))==null?void 0:l.part.label,a=Number((u=s.find(({part:d})=>d.total))==null?void 0:u.part.total),c=tc(t);return{id:n,type:"AnnotationCollection",...i?{label:i}:{},...a>0?{total:a}:{},pages:s.map(({page:d,canvas:h})=>({id:String(d.id),canvasId:String(h.id),fetched:Array.isArray(d.items)})),entries:s.flatMap(({page:d})=>{var h;return((h=c.find(p=>p.id===d.id))==null?void 0:h.entries)??[]})}})():null;return Yo.set(t,o),o}const yi=new WeakMap,bi=[];function Qr(t,e){const n=tc(t);if(!e.length)return n.length?n:bi;const o=t??bi;let r=yi.get(o);r||yi.set(o,r=new Map);let s=r.get(e);if(!s){const i=new Set(n.map(a=>a.id));s=[...n,...e.filter(a=>!i.has(a.id)&&!!i.add(a.id))],r.set(e,s)}return s}const _i=new WeakMap;function oc(t,e,n,o=null){const r=Qr(t,e),s=n!=null&&n.entries.length?n:null;if(!o&&!s)return r;let i=_i.get(r);i||_i.set(r,i=new Map);let a=i.get(o);a||i.set(o,a=new Map);let c=a.get(s);return c||(c=[...r,...o?[o]:[],...s?[s]:[]],a.set(s,c)),c}const gd=t=>Number(t==null?void 0:t.duration)>0;function rc(t,e){return t.source==="search"||!t.entries.length?false:t.entries.every(n=>Xu(n.motivation,n.target)&&!gd(e(n.canvasId)))}const wi=new WeakMap;function vd(t,e){const n=Qr(t,e);let o=wi.get(n);if(!o){const r=n.filter(s=>!rc(s,i=>He(t,i)??void 0));o=r.length===n.length?n:r,wi.set(n,o)}return o}const xi=new WeakMap;function ts(t,e,n,o){const r=Qr(t,e),s=xi.get(r);if(s&&s.hidden===n&&s.shown===o)return s.ids;const i=r.filter(c=>!n.includes(c.id)&&!o.includes(c.id)&&rc(c,l=>He(t,l)??void 0)).map(c=>c.id),a=i.length?[...n,...i]:n;return xi.set(r,{hidden:n,shown:o,ids:a}),a}const Si=new WeakMap;function yd(t,e,n,o){const r=ts(t,e,n,o),s=Si.get(r);if(s&&s.hidden===n)return s.ids;const i=[Jr,ud,...r.filter(a=>!n.includes(a))];return Si.set(r,{hidden:n,ids:i}),i}function bd(t){for(const e of H(t==null?void 0:t.target)){const n=(e==null?void 0:e.type)==="SpecificResource"?e.source:e,o=H(n==null?void 0:n.partOf).find(r=>(r==null?void 0:r.id)&&(!r.type||r.type==="Manifest"));if(o)return o.id}}function Qo(t,e){if(!e)return null;for(const n of t){const o=n.entries.find(r=>r.id===e);if(o)return o}return null}function sc(t){return btoa(encodeURIComponent(JSON.stringify(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ic({manifestId:t,canvasId:e,type:n="Canvas",region:o,time:r}){const s={id:e,type:n,...t&&t!==e?{partOf:[{id:t,type:"Manifest"}]}:{}},i=r!=null&&r>0?`t=${Math.round(r*100)/100}`:o?`xywh=${[o.x,o.y,o.w,o.h].map(Math.round).join(",")}`:null,a={"@context":`http://iiif.io/api/presentation/${n==="Canvas"?3:4}/context.json`,id:`${e}#content-state`,type:"Annotation",motivation:["contentState"],target:i?{type:"SpecificResource",source:s,selector:{type:"FragmentSelector",value:i}}:s};return{json:a,encoded:sc(a)}}const _d=Object.freeze(Object.defineProperty({__proto__:null,buildContentState:ic,encodeContentState:sc},Symbol.toStringTag,{value:"Module"})),wd=/iiif\.io\/api\/presentation\/4\/context\.json/;function ac(t){const e=t==null?void 0:t["@context"];return(Array.isArray(e)?e:[e]).some(o=>typeof o=="string"&&wd.test(o))}let ki=null,Ci=null;function es(){return Ci??(Ci=import("../upgrade-eNW0DPXq.mjs")),ki??(ki=import("../upgrader-BlbMUEH6.mjs").then(({upgradePresentation3To4:t})=>t)),Promise.all([ki,Ci])}async function ze(t){if(ac(t))return t;const[e,{upgrade:n}]=await es();return await n(t,e)}function ns(t,e,n={}){return((t==null?void 0:t.fetch)??globalThis.fetch)(e,{credentials:(t==null?void 0:t.credentials)??"same-origin",...n,headers:{...n.headers,...t==null?void 0:t.headers}})}const xd=t=>(t==null?void 0:t.credentials)==="include",Sd=t=>JSON.stringify([t==null?void 0:t.credentials,t==null?void 0:t.headers]);class kd extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="CloverRequestError"}}async function an(t,e,n){const o=await ns(t,e,{signal:n,headers:{Accept:"application/ld+json, application/json"}});if(!o.ok)throw new kd(`${e} answered ${o.status}`,e,o.status);return o.json()}const Ei=()=>import("./content-state-reader-vtATl-W3.mjs");function Mi(t){const e=t;return!e||typeof e!="object"?false:e.type==="Annotation"?H(e.motivation).includes("contentState"):e.type==="SpecificResource"}const Cd=["summary","metadata","requiredStatement","rights","provider","homepage","seeAlso","rendering","thumbnail","navDate","partOf"];function Ed(t){const e={"@context":Td,id:t.id,type:"Manifest",label:t.label??{none:[""]},items:[t]};for(const n of Cd)t[n]!==void 0&&n!=="label"&&(e[n]=t[n]);return e}const Ti=t=>{var e,n;return!!t&&((n=(e=t.items)==null?void 0:e[0])==null?void 0:n.id)===t.id},Md=/^(oa:)?Annotation(Page|Collection)$/;class eo extends Error{constructor(){super(...arguments);I(this,"name","CloverContentError")}}const Td="http://iiif.io/api/presentation/4/context.json",Id=t=>/^https?:\/\//i.test(t);async function Sr(t,{request:e,signal:n}){return Array.isArray(t.items)&&t.items.length>0||!t.id?t:await an(e,t.id,n)}const Pd=50;async function os(t,e){const n=t;if(Array.isArray(n.items)&&n.items.length||!n.first)return t;const o=[],r=new Set;let s=n.first;for(let i=0;s&&i<Pd;i++){const a=typeof s=="string"?{id:s}:s;if(r.has(a.id??a))break;r.add(a.id??a);const c=a.items?a:await an(e.request,a.id,e.signal),l=await ze({"@context":c["@context"]??n["@context"],...c,type:"Collection"});o.push(...l.items??[]),s=c.next}return{...n,items:o}}async function cc(t,e={}){return ze(await Sr(t,e))}async function lc(t,e,n=0){for(const o of t.items??[]){if(o.type==="Manifest")return ze(await Sr(o,e));if(o.type==="Collection"&&n<8){const r=await os(await ze(await Sr(o,e)),e),s=await lc(r,e,n+1);if(s)return s}}return null}async function Ld(t,{request:e,signal:n}={}){es();const o=typeof t=="string"?await an(e,t.trim(),n):t,r=await ze(o);return r.type==="Collection"?os(r,{request:e,signal:n}):r}async function Ad(t,e={}){var d;const{request:n,signal:o}=e;es();let r,s,i,a,c;const l=async h=>{const{resolveContentState:p}=await Ei(),m=p(h);if(!m)throw new eo("Unreadable content state");return r=m.target??r,s=m.manifestId??s,i=m.annotation??i,a=m.targets??a,an(n,m.id,o)};if(typeof t=="string")if(Id(t.trim()))c=await an(n,t.trim(),o);else{const{decodeContentState:h}=await Ei(),p=h(t);if(!p)throw new eo("Unreadable iiifContent");c=Mi(p)?await l(p):p}else c=t;if(Mi(c)&&(c=await l(c)),Md.test(String((c==null?void 0:c.type)??""))){const{annotationsContent:h}=await import("./annotations-content-B52-zM99.mjs");return h(c,e)}const u=await ze(c);switch((d=o==null?void 0:o.throwIfAborted)==null||d.call(o),u.type){case"Manifest":return{manifest:u,target:r,annotation:i,targets:a};case"Collection":{const h=await os(u,e),p=e.manifestId??s,m=p?(h.items??[]).find(b=>b.id===p&&b.type==="Manifest"):void 0,g=m?await cc(m,e):await lc(h,e);if(!g)throw new eo("The Collection holds no Manifest");return{manifest:g,collection:h,target:r,annotation:i,targets:a}}case"Canvas":case"Timeline":case"Scene":{const h=u;return r??(r={canvasId:h.id}),{manifest:Ed(h),target:r,annotation:i}}default:throw new eo(`Cannot show a ${String(u.type??"resource without a type")}`)}}const uc=t=>!!(t!=null&&t.id)&&t.type==="AnnotationPage"&&!t.items;function Ii(t){const e=[];for(const n of t)for(const o of["items","annotations"])for(const r of n[o]??[])uc(r)&&e.push([n.id,o,r.id]);return e}async function Od(t,e,n,o){return Nd(await an(n,t,o),e)}async function Nd(t,e="urn:clover:annotation-page"){var r;const n=t;return ac(n)?n:((r=(await ze({"@context":n["@context"]??"http://iiif.io/api/presentation/3/context.json",id:e,type:"Canvas",items:[{...n,"@context":void 0}]})).items)==null?void 0:r[0])??n}function Rd(t,e){const n=t,o=e,r=c=>Array.isArray(c)?c:c?[c]:[],s=r(n.partOf),i=r(o.partOf),a=[...s.map(c=>({...i.find(l=>l.id&&l.id===c.id),...c})),...i.filter(c=>!s.some(l=>l.id===c.id))];return{...t,...n.label===void 0&&o.label!==void 0&&{label:o.label},...a.length&&{partOf:a}}}function Bd(t,e,n,o){let r=false;const s=(t.items??[]).map(i=>{if(i.id!==e||!Array.isArray(i[n]))return i;const a=i[n].map(c=>c.id!==o.id||!uc(c)?c:(r=true,Rd(o,c)));return r?{...i,[n]:a}:i});return r?{...t,items:s}:t}function $d(t){let e=t;const n=new Set;return{get:()=>e,set(o){const r=typeof o=="function"?o(e):o;Object.keys(r).some(i=>!Object.is(r[i],e[i]))&&(e={...e,...r},n.forEach(i=>i()))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function Xe(t){let e=t;const n=new Set;return{get:()=>e,emit(o){e=o,n.forEach(r=>r(o))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function Fd(t,e,n){return{position:e,total:n,hasPrevious:e>0,hasNext:e+1<n,previous:()=>t.previous(),next:()=>t.next(),first:()=>t.first(),last:()=>t.last(),goTo:o=>t.goTo(o)}}const kr={query:"",status:"idle",hits:[],set:null},Pi={status:"idle",error:null,manifest:null,collection:null,throughCollection:false,canvasId:null,target:null,annotationId:null,hiddenSets:[],shownSets:[],addedSets:[],search:kr,regions:null,targets:null,targetIndex:null};function Dd(t={}){const e=$d(Pi),n=Xe(null),o=Xe(null),r=Xe(null),s=Xe(null),i=Xe(null),a=Xe(null);let c=null,l=null,u=[],d=[],h=[],p=0,m=null,g=null,b=null;const v=(y,C)=>{!g||y===C||(g={...g,items:g.items.map(L=>L.manifestId===y&&L.manifestAs!==C?{...L,manifestAs:C}:L)})},w=y=>{var L;const C=(L=e.get().manifest)==null?void 0:L.id;return!!C&&(C===y.manifestId||C===y.manifestAs)},_=()=>u.length||d.length||h.length?[...u,...d,...h]:Pi.addedSets;let x=t.request,S=null;const M=new Set;let R="view",N=0;const J=(y,C,L)=>{if(M.has(L))return;M.add(L);const F=S==null?void 0:S.signal;Od(L,y,x,F).then(O=>{F!=null&&F.aborted||e.set(P=>P.manifest?{manifest:Bd(P.manifest,y,C,O)}:{})}).catch(()=>M.delete(L))},et=()=>{const{manifest:y,canvasId:C}=e.get();if(y)for(const[L,F,O]of Ii(R==="all"||N>0?Lt(y).canvases:De(y,C)))J(L,F,O)};e.subscribe(et);const X=(y,C,L,F,O)=>{var q,rt,Q;const{canvases:P}=Lt(y),U=wt=>!!wt&&P.some(Bt=>Bt.id===wt),K=td(y),yt=U(L==null?void 0:L.canvasId)?L:U(K==null?void 0:K.canvasId)?K:null,tt=U(F.canvasId)?F.canvasId:(yt==null?void 0:yt.canvasId)??(U(F.defaultCanvasId)?F.defaultCanvasId:null)??((q=P[0])==null?void 0:q.id)??null;l==null||l.abort();const pt=O&&((rt=Qo(h,O))==null?void 0:rt.canvasId)===tt?O:null,ft=yt&&pt?{...yt,region:void 0}:yt,Ht=++p;u=[],e.set({status:"ready",search:kr,regions:null,manifest:y,collection:C,canvasId:tt,target:ft&&ft.canvasId===tt?ft:null,addedSets:_(),annotationId:pt,targets:g});const Nt=y==null?void 0:y.structures;Array.isArray(Nt)&&JSON.stringify(Nt).includes("xywh=")&&import("./range-regions-uPqjKIER.mjs").then(({contentsSet:wt})=>{p===Ht&&e.set({regions:wt(y)})}),fd(y)&&import("./image-layers-gFEDKVkV.mjs").then(({imageLayers:wt})=>{p===Ht&&(u=wt(y),e.set({addedSets:_()}))}),tt&&tt!==F.canvasId&&((Q=t.onCanvasChange)==null||Q.call(t,tt))},V=(y,C)=>e.set(L=>{const F=L.hiddenSets.filter(P=>P!==y),O=L.shownSets.filter(P=>P!==y);return C?{hiddenSets:F,shownSets:[...O,y]}:{hiddenSets:[...F,y],shownSets:O}}),T=(y,C)=>{var F,O,P;if(!y)return;if((F=t.isControlled)!=null&&F.call(t)){C&&e.set({target:C}),(O=t.onCanvasChange)==null||O.call(t,y);return}const L=e.get().canvasId!==y;e.set({canvasId:y,target:C}),L&&((P=t.onCanvasChange)==null||P.call(t,y))},E=(y,C=false)=>{const{manifest:L}=e.get(),F=Qu(L,y);T(F,F&&C?{canvasId:F,autoplay:C}:null)},A=()=>{const{manifest:y,canvasId:C}=e.get();return{at:On(y,C),total:Lt(y).views.length}},W=()=>{S==null||S.abort();const y=new AbortController;return S=y,M.clear(),e.set({status:"loading",error:null,annotationId:null}),y.signal},G=y=>e.set({status:"error",error:y instanceof Error?y:new Error(String(y))});async function Y(y,C={}){var F;const L=W();try{const O=await Ad(y,{request:x,signal:L,manifestId:C.manifestId??void 0});if(L.aborted)return;const P=O.annotation,U=P?Ja({items:[P]},`${P.id}#content-state`):[];h=U.length?[{id:`${P.id}#content-state`,source:"added",entries:U}]:O.annotationSets??[];const K=m??((F=U[0])==null?void 0:F.id)??O.pick;m=null,e.set({throughCollection:!!O.collection}),g=O.targets??null,g&&v(g.items[0].manifestId,O.manifest.id),e.set({targetIndex:g?0:null}),X(O.manifest,O.collection??null,O.target,C,K)}catch(O){L.aborted||G(O)}}const st=y=>{const{manifest:C,collection:L}=e.get();return(C==null?void 0:C.id)===y||(L==null?void 0:L.id)===y},St=y=>{var C;return(((C=e.get().collection)==null?void 0:C.items)??[]).find(L=>L.id===y)??{id:y,type:"Manifest"}},ot=(y,C)=>{var L,F;if(m=C,(L=t.isManifestControlled)!=null&&L.call(t)){(F=t.onManifestChange)==null||F.call(t,y);return}ct({id:y,type:"Manifest"}).then(O=>{var P;return O&&((P=t.onManifestChange)==null?void 0:P.call(t,y))})},ct=async(y,C)=>{if(y.type==="Collection")return await Y(y.id),e.get().status==="ready";const{collection:L}=e.get(),F=W(),O=m;m=null;const P=O?Qo(h,O):null,U=typeof C=="string"?{canvasId:C}:C??b;b=null;try{const K=await cc(y,{request:x,signal:F});return F.aborted?false:(v(y.id,K.id),X(K,L,P?{canvasId:P.canvasId}:U??void 0,{},O),true)}catch(K){return F.aborted||G(K),false}};return{store:e,viewport:n,media:o,captions:r,highlight:s,chapter:i,found:a,get request(){return x},setRequest(y){x=y},load:Y,async openCollection(y){var L;const C=e.get().manifest;if(!(!C||((L=e.get().collection)==null?void 0:L.id)===y))try{const F=await Ld(y,{request:x});if(F.type!=="Collection"||e.get().manifest!==C)return;e.set({collection:F})}catch{}},async goToManifest(y,C){var F,O,P;if(st(y))return;const L=St(y);if(L.type!=="Collection"&&((F=t.isManifestControlled)!=null&&F.call(t))){(O=t.onManifestChange)==null||O.call(t,y);return}await ct(L,C)&&((P=t.onManifestChange)==null||P.call(t,e.get().manifest.id))},goToTarget(y){var F,O,P;const C=(F=e.get().targets)==null?void 0:F.items[y];if(!C)return;e.set({targetIndex:y});const L=C.canvasId?{canvasId:C.canvasId,...C.region&&{region:C.region},...C.time!==void 0&&{time:C.time}}:null;if(w(C)){L&&T(L.canvasId,L);return}if((O=t.isManifestControlled)!=null&&O.call(t)){b=L,(P=t.onManifestChange)==null||P.call(t,C.manifestId);return}ct(St(C.manifestId),L??void 0).then(U=>{var K;return U&&((K=t.onManifestChange)==null?void 0:K.call(t,C.manifestId))})},async syncManifest(y){!y||st(y)||e.get().status!=="ready"||await ct(St(y))},goTo(y,C){T(y,C?{...C,canvasId:y}:null)},next({autoplay:y=false,wrap:C=false}={}){const{at:L,total:F}=A();L+1<F?E(L+1,y):C&&F>1&&E(0,y)},previous(){const{at:y}=A();y>0&&E(y-1)},first(){E(0)},last(){E(A().total-1)},consumeTarget(){e.set({target:null})},syncCanvas(y){y&&e.set({canvasId:y})},selectAnnotation(y){const{manifest:C,addedSets:L,canvasId:F,search:O,regions:P}=e.get(),U=Qo(oc(C,L,O.set,P),y);if(e.set({annotationId:U?y:null}),!U)return;a.emit(y);const{hiddenSets:K,shownSets:yt}=e.get();U.setId!==Jr&&ts(C,L,K,yt).includes(U.setId)&&V(U.setId,true);const tt=De(C,F).some(Ht=>Ht.id===U.canvasId),pt=He(C,U.canvasId)!==null;!tt&&pt&&T(U.canvasId,null);const ft=pt?void 0:bd(U.annotation);ft&&ot(ft,U.id)},async search(y){l==null||l.abort();const C=Ya(e.get().manifest),L=y.trim();if(!L||!C){l=null,e.set({search:kr,annotationId:null});return}const F=new AbortController;l=F,e.set(O=>({search:{...O.search,query:L,status:"loading"}}));try{const{searchInto:O}=await import("./search-Bbv9dCNq.mjs");await O(e,C,L,x,F.signal)}catch{e.set({search:{query:L,status:"error",hits:[],set:null}})}},setSetVisible(y,C){V(y,C)},async loadAnnotations(y){if(c==null||c.abort(),!y){d=[],e.set({addedSets:_()});return}const C=new AbortController;c=C;try{const{loadAnnotationSets:L}=await import("./annotation-collection-A0PNdPhI.mjs"),F=await L(y,{request:x,signal:C.signal});if(C.signal.aborted)return;d=F,e.set({addedSets:_()})}catch{}},getContentState(){var tt;const{manifest:y,canvasId:C}=e.get();if(!y||!C)return null;const L=n.get(),F=o.get(),O=F&&F.currentTime>0?F.currentTime:null,P=De(y,C),K=L&&P.some(pt=>pt.id===L.canvasId)&&!O?L:null,yt=(K==null?void 0:K.canvasId)??C;return ic({manifestId:y.id,canvasId:yt,type:(tt=P.find(pt=>pt.id===yt))==null?void 0:tt.type,region:K==null?void 0:K.region,time:O})},setAnnotationPages(y){y!==R&&(R=y,et())},fetchAnnotationPages(y){const{manifest:C}=e.get();if(!C||!y.length)return;const L=new Set(y);for(const[F,O,P]of Ii(Lt(C).canvases))L.has(P)&&J(F,O,P)},holdAllAnnotationPages(){N++,et();let y=true;return()=>{y&&N--,y=false}},dispose(){S==null||S.abort(),c==null||c.abort(),l==null||l.abort()}}}const zd=100;function dc(t,e){const n=$({read:t,onChange:e});n.current={read:t,onChange:e};const o=$(void 0),r=$("");return D(()=>()=>{clearTimeout(o.current),o.current=void 0},[]),dt(()=>{!n.current.onChange||o.current!==void 0||(o.current=setTimeout(()=>{var i,a;o.current=void 0;const s=n.current.read();!s||s.encoded===r.current||(r.current=s.encoded,(a=(i=n.current).onChange)==null||a.call(i,s))},zd))},[])}function Cr(t,e){return t==null||t.addEventListener("pause",e),t==null||t.addEventListener("seeked",e),()=>{t==null||t.removeEventListener("pause",e),t==null||t.removeEventListener("seeked",e)}}function fc(t,e){const n=dc(()=>t.getContentState(),e),o=!!e;D(()=>{if(!o)return;let r=t.store.get().canvasId;const s=t.store.subscribe(()=>{const l=t.store.get().canvasId;l!==r&&(r=l,n())}),i=t.viewport.subscribe(n);let a=Cr(t.media.get(),n);const c=t.media.subscribe(l=>{a(),a=Cr(l,n)});return n(),()=>{s(),i(),c(),a()}},[t,o,n])}function rs(t){const e=[];for(const n of H(t==null?void 0:t.items))for(const o of H(n==null?void 0:n.items))if(Yr(o))for(let r of xo(o))(r==null?void 0:r.type)==="Choice"&&(r=H(r.items)[0]),(r==null?void 0:r.type)==="SpecificResource"&&(r=typeof r.source=="string"?{id:r.source}:r.source),r&&e.push({body:r,annotation:o});return e}function Hd(t){return t.flatMap(e=>rs(e).map(({body:n})=>n))}function Wd(t,e){if(!(t!=null&&t.length)||!e.canvases.length)return null;const n=e.canvases.map(r=>r.id),o=e.bodies.map(r=>r==null?void 0:r.format).filter(Boolean);return t.find(r=>{var s,i,a;return((s=r.canvasId)==null?void 0:s.some(c=>n.includes(c)))||((i=r.format)==null?void 0:i.some(c=>o.includes(c)))||!!((a=r.match)!=null&&a.call(r,e))})??null}function Ud(t,e){return t===e?true:!t||!e||t.length!==e.length?false:t.every((n,o)=>n.component===e[o].component&&n.match===e[o].match&&JSON.stringify([n.canvasId,n.format])===JSON.stringify([e[o].canvasId,e[o].format]))}function jd({iiifContent:t,canvasId:e,defaultCanvasId:n,onCanvasChange:o,onStatusChange:r,manifestId:s,defaultManifestId:i,onManifestChange:a,searchQuery:c,request:l,language:u,renderers:d,annotations:h,annotationPages:p="view",onContentStateChange:m,...g}){const b=e!==void 0,v=s!==void 0,w=$({controlled:b,manifestControlled:v,onCanvasChange:o,onStatusChange:r,onManifestChange:a});w.current={controlled:b,manifestControlled:v,onCanvasChange:o,onStatusChange:r,onManifestChange:a};const[_]=z(()=>Dd({request:l,onCanvasChange:ot=>{var ct,y;return(y=(ct=w.current).onCanvasChange)==null?void 0:y.call(ct,ot)},onManifestChange:ot=>{var ct,y;return(y=(ct=w.current).onManifestChange)==null?void 0:y.call(ct,ot)},isControlled:()=>w.current.controlled,isManifestControlled:()=>w.current.manifestControlled}));_.setRequest(l);const x=$({});x.current={canvasId:e,defaultCanvasId:n,manifestId:s??i};const S=Sd(l),M=$(t);M.current=t;const R=Kd(t);D(()=>(_.load(M.current,x.current),()=>_.dispose()),[_,R,S]),D(()=>{b&&_.syncCanvas(e??null)},[_,b,e]);const[N,J]=z(_.store.get().status);D(()=>{let ot=_.store.get().status;return _.store.subscribe(()=>{var C,L;const{status:ct,error:y}=_.store.get();ct!==ot&&(ot=ct,J(ct),(L=(C=w.current).onStatusChange)==null||L.call(C,ct,y))})},[_]);const et=$(h);et.current=h;const X=qd(h);D(()=>{_.loadAnnotations(et.current??null)},[_,X,S]),D(()=>{_.setAnnotationPages(p)},[_,p]),fc(_,m),D(()=>{v&&N==="ready"&&_.syncManifest(s??null)},[_,v,s,N]);const V=Vd(_,ot=>{var ct;return ot.status==="ready"?((ct=ot.manifest)==null?void 0:ct.id)??null:null});D(()=>{c&&V&&_.search(c)},[_,c,V]);const T=$(d);Ud(T.current,d)||(T.current=d);const E=T.current,[A,W]=z(),[G,Y]=z(u);G!==u&&(Y(u),W(void 0));const st=A??u;return[vt(()=>({clover:_,language:st,renderers:E,chooseLanguage:W}),[_,st,E]),N,g]}function Vd(t,e){return te(t.store.subscribe,()=>e(t.store.get()))}function qd(t){const e=Array.isArray(t)?t:t?[t]:[];return JSON.stringify(e.map(n=>typeof n=="string"?n:(n==null?void 0:n.id)??"object"))}function Kd(t){return typeof t=="string"?t:t.id??t["@id"]??t}const Zd=ne(function({as:e="div",className:n,children:o,highContrast:r,...s},i){const[a,c,l]=jd(s),u=wo(i,l.lang),d=qr(r);return f(bo.Provider,{value:a,children:f(Pn.Provider,{value:u.hostLanguage,children:f(e,{ref:u.ref,className:Mt("clover-root",n),"data-status":c,...Kr(d),...l,children:[o,f(ad,{clover:a.clover,language:a.language})]})})})}),Gd=()=>f("path",{fillRule:"evenodd",stroke:"none",d:"M144 72H368A96 96 0 0 1 464 168V296A96 96 0 0 1 368 392H200L104 460L144 392A96 96 0 0 1 48 296V168A96 96 0 0 1 144 72Z M168 184H344A16 16 0 0 1 344 216H168A16 16 0 0 1 168 184Z M168 264H280A16 16 0 0 1 280 296H168A16 16 0 0 1 168 264Z"}),Xd=()=>f(Ct,{children:[f("path",{d:"M160 144h288M160 256h288M160 368h288",fill:"none",strokeLinecap:"round",strokeWidth:"32"}),f("circle",{cx:"80",cy:"144",r:"20",stroke:"none"}),f("circle",{cx:"80",cy:"256",r:"20",stroke:"none"}),f("circle",{cx:"80",cy:"368",r:"20",stroke:"none"})]}),Yd=()=>f("path",{stroke:"none",d:"M256 72A48 48 0 1 1 256 168A48 48 0 1 1 256 72Z M192 216H296V384H328V432H184V384H216V264H192Z"}),Jd=()=>f("path",{fillRule:"evenodd",stroke:"none",d:"M256 40C166 40 100 108 100 196C100 300 216 420 246 452A14 14 0 0 0 266 452C296 420 412 300 412 196C412 108 346 40 256 40Z M256 136A60 60 0 1 1 256 256A60 60 0 1 1 256 136Z"}),Vv=()=>f("path",{strokeLinejoin:"round",strokeWidth:"40",d:"M184 128V384L392 256Z"}),hc=()=>f("path",{strokeLinecap:"round",strokeWidth:"45",d:"M154 154L358 358M358 154L154 358"}),qv=()=>f(Ct,{children:[f("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),f("path",{stroke:"none",d:"m279.5,197.76h-3.35s-28.47,0-28.47,0v-31.82c-.77-13.79-12.57-24.33-26.36-23.56-12.71.71-22.85,10.86-23.56,23.56v3.35h0v28.47h-31.82c-13.79.77-24.33,12.57-23.56,26.36.71,12.71,10.86,22.85,23.56,23.56h3.35s28.47,0,28.47,0v31.82c.77,13.79,12.57,24.33,26.36,23.56,12.71-.71,22.85-10.86,23.56-23.56v-3.35h0v-28.47h31.82c13.79-.77,24.33-12.57,23.56-26.36-.71-12.71-10.86-22.85-23.56-23.56Z"})]}),Kv=()=>f(Ct,{children:[f("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),f("path",{stroke:"none",d:"M167.26 197.76H278.1a24.96 24.96 0 0 1 0 49.92H167.26a24.96 24.96 0 0 1 0-49.92Z"})]}),Gt={zoomIn:{keys:"Plus",glyph:"+"},zoomOut:{keys:"-",glyph:"\u2212"},reset:{keys:"0",glyph:"0"},rotateRight:{keys:"R",glyph:"R"},rotateLeft:{keys:"Shift+R",glyph:"\u21E7R"},play:{keys:"K Space",glyph:"K"},mute:{keys:"M",glyph:"M"}},Qd=new Set(["+","=","-","_","0","r","R","k","K","m","M","j","J","l","L"]);function We({label:t,lang:e,shortcut:n,scrolls:o=false,image:r,lead:s,after:i}){const{t:a}=It(),c=$(null),l=n?a("controlShortcut",{label:t,shortcut:n.glyph}):t;return ef(),D(()=>{const u=c.current;u&&Er(u)&&lo(u)},[l,s]),f("span",{ref:c,className:"clover-tip","aria-hidden":"true",...ut(e),...o&&{tabIndex:-1,onMouseDown:u=>{var d;u.preventDefault(),(d=u.currentTarget.parentElement)==null||d.focus({preventScroll:true})}},children:[r&&f("img",{className:"clover-tip-image",src:r,alt:"",loading:"lazy",onLoad:()=>{const u=c.current;u&&Er(u)&&lo(u)}}),s&&f("span",{className:"clover-tip-lead",children:s}),l,i!=null&&i!==false&&f("span",{className:"clover-tip-after",children:i})]})}function no(t){const e=t.target instanceof Element&&ss(t.target),n=e&&So(e);n&&lo(n)}function Zv(t){const e=So(ss(t));e&&Er(e)&&lo(e)}function So(t){return Array.from(t.children).find(e=>e.classList.contains("clover-tip"))}function ss(t){const e=t.matches("input")?t.parentElement:null;return e&&So(e)?e:t}function Er(t){var e;try{return!!((e=t.parentElement)!=null&&e.matches(":hover, :focus-visible, :has(> input:focus-visible)"))}catch{return false}}function lo(t){const e=t.parentElement;if(!e)return;t.style.removeProperty("--clover-tip-room"),t.style.removeProperty("--clover-tip-shift");const n=tf(e),o=parseFloat(getComputedStyle(t).paddingLeft)||0,r=n.left+o,s=n.right-o,i=e.getBoundingClientRect();let a=t.getBoundingClientRect();const c=a.right<=i.left?a.right-r:a.left>=i.right?s-a.left:s-r;a.width>c&&(t.style.setProperty("--clover-tip-room",`${Math.max(c,0)}px`),a=t.getBoundingClientRect());const l=a.left<r?r-a.left:a.right>s?s-a.right:0;l&&t.style.setProperty("--clover-tip-shift",`${l}px`)}function tf(t){let e=0,n=document.documentElement.clientWidth||window.innerWidth;for(let o=t.parentElement;o&&o!==document.documentElement;o=o.parentElement){const{display:r,overflow:s,overflowX:i}=getComputedStyle(o);if(r==="inline"||r==="contents")continue;const a=i||s;if(!a||a==="visible")continue;const c=o.getBoundingClientRect();e=Math.max(e,c.left+o.clientLeft),n=Math.min(n,c.left+o.clientLeft+o.clientWidth)}return{left:e,right:n}}let Li=0;function Ai(t){if(t.key!=="Escape")return;const e=new Set;document.querySelectorAll(":hover > .clover-tip").forEach(r=>r.parentElement&&e.add(r.parentElement));const n=document.activeElement,o=n&&ss(n);o&&So(o)&&e.add(o),e.forEach(r=>pc(r,"tipHidden",["pointerenter","focusout"]))}function pc(t,e,n){t.dataset[e]="";const o=()=>{delete t.dataset[e],n.forEach(r=>t.removeEventListener(r,o))};n.forEach(r=>t.addEventListener(r,o))}function ef(){D(()=>(Li++===0&&(document.addEventListener("keydown",Ai,true),document.addEventListener("pointerenter",no,true),document.addEventListener("focus",no,true)),()=>{--Li||(document.removeEventListener("keydown",Ai,true),document.removeEventListener("pointerenter",no,true),document.removeEventListener("focus",no,true))}),[])}function nf(t,e){const n=t.target;!e||n===e||e.contains(n)||Qd.has(t.key)&&(t.altKey||t.metaKey||t.ctrlKey||n.closest("input, select, textarea, [contenteditable]")||(t.preventDefault(),e.dispatchEvent(new KeyboardEvent("keydown",{key:t.key,shiftKey:t.shiftKey,bubbles:true,cancelable:true}))))}const Fe=({className:t,id:e,label:n,children:o,onClick:r,expanded:s,controls:i,shortcut:a,lang:c,unavailable:l})=>{const d=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return f("button",{id:e,className:Mt("clover-canvas-button",t),"data-testid":"clover-canvas-button","data-button":d,onClick:r,"aria-disabled":l||void 0,"aria-expanded":s,"aria-controls":i,"aria-label":n,"aria-keyshortcuts":a==null?void 0:a.keys,...ut(c),type:"button",children:[f("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:o}),f(We,{label:n,shortcut:a})]})},of=ue("");function fe(){return zt(of)+Ur()}const tr=new Map;function rf(t,e){const n=fe(),o=$(e);o.current=e,D(()=>t?sf(n,o):void 0,[t,n])}function sf(t,e){for(const[n,o]of[...tr])n!==t&&o.current();return tr.set(t,e),()=>{tr.delete(t)}}const af=mt(()=>import("./CaptionDetails-Bxh9VD7n.mjs"));function cf(t){var e;return!!t.summary||!!((e=t.metadata)!=null&&e.length)}const mc=(t,e)=>`${t}-label-${e}`,lf=({id:t,canvases:e,comments:n,open:o,onClose:r,language:s})=>{const{t:i,langOf:a}=It(),c=$(null),[l,u]=z(o);return o&&!l&&u(true),rf(o,()=>r(false)),D(()=>{var d;o&&((d=c.current)==null||d.focus())},[o]),f("figcaption",{className:"clover-canvas-caption","data-open":o,"data-testid":"clover-canvas-caption",id:t,onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),r(true))},ref:c,tabIndex:-1,children:[f(Fe,{className:"clover-canvas-caption-close",id:`close-${t}`,label:i("commonClose"),lang:a("commonClose"),onClick:()=>r(true),children:f(hc,{})}),e.map((d,h)=>{const p=bt(d.label,s);return f("section",{className:"clover-canvas-caption-canvas",children:[p.text&&f("p",{className:"clover-canvas-caption-label",id:mc(t,h),...ut(p.lang),children:p.text}),l&&f(_t,{fallback:null,children:f(af,{summary:d.summary,metadata:d.metadata,comments:n==null?void 0:n.get(d.id),language:s})})]},d.id)})]})},uf=()=>f("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M256 112v288M400 256H112"}),df=()=>f("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 256H112"}),ff=()=>f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"}),hf=()=>f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M304 416v-112h112M405.77 405.77L304 304M208 96v112H96M106.23 106.23L208 208M416 208H304V96M405.77 106.23L304 208M96 304h112v112M106.23 405.77L208 304"}),pf=()=>f("path",{d:"M448 440a16 16 0 01-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 01-27 11.57l-176-168a16 16 0 010-23.14l176-168A16 16 0 01256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 01-16 16z"}),Oi=()=>f(Ct,{children:[f("path",{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"}),f("path",{d:"M464 97.42V208a16 16 0 01-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"})]}),mf=()=>f(Ct,{children:[f("path",{fill:"none",strokeLinecap:"round",strokeWidth:"64",d:"M112 144h0M112 256h0M112 368h0"}),f("path",{fill:"none",strokeLinecap:"round",strokeWidth:"40",d:"M208 144h208M208 256h208M208 368h208"})]}),gf=({children:t,label:e})=>f("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512",fill:"currentColor",stroke:"currentColor",focusable:"false","aria-hidden":"true",role:"presentation","data-testid":"clover-canvas-button-svg","data-label":e,children:t}),vf=112,yf=128;function bf(t){Dt(()=>{const e=t==null?void 0:t.closest(".clover-canvas");if(!t||!e)return;const n=(s=false)=>{let i=t.offsetWidth,a=0;for(const p of s?[]:Array.from(t.children))!(p instanceof HTMLElement)||!p.offsetParent||(i=Math.min(i,p.offsetLeft),a=Math.max(a,p.offsetTop+p.offsetHeight));const c={width:t.offsetWidth-i,height:a};for(const[p,m]of Object.entries(c)){const g=`--clover-canvas-controls-${p}`;a?e.style.setProperty(g,`${m}px`):e.style.removeProperty(g)}const l=t.offsetTop,u=e.querySelector(":scope > .clover-canvas-media > .clover-canvas-transport"),d=e.clientHeight-2*l-c.height-((u==null?void 0:u.offsetHeight)??0),h=t.offsetLeft+i-l;a&&d<vf&&h>=yf?e.dataset.popups="beside":delete e.dataset.popups};n();const o=new ResizeObserver(()=>n());o.observe(t),o.observe(e);const r=new MutationObserver(()=>n());return r.observe(t,{childList:true}),r.observe(e,{childList:true}),()=>{o.disconnect(),r.disconnect(),n(true)}},[t])}const ko=()=>{if(typeof document>"u")return null;const t=document;return t.fullscreenElement??t.webkitFullscreenElement??null},gc=()=>{if(typeof document>"u")return false;const t=document;return!!(t.fullscreenEnabled??t.webkitFullscreenEnabled)},vc=t=>{const e=t==null?void 0:t.closest(".clover-root"),n=t==null?void 0:t.closest("dialog");return e&&!(n&&e.contains(n))?e:(t==null?void 0:t.closest(".clover-canvas"))??null},_f=(t,e)=>{if(typeof t.webkitEnterFullscreen!="function")return;const n=e.closest(".clover-canvas"),o=!t.isConnected&&!!n;if(o&&n){const s=t.getAttribute("style");t.style.cssText="position:absolute;inset:0;z-index:-1;width:100%;height:100%;object-fit:contain;pointer-events:none",n.prepend(t),t.addEventListener("webkitendfullscreen",()=>{t.remove(),s===null?t.removeAttribute("style"):t.setAttribute("style",s)},{once:true})}const r=()=>{var s;try{(s=t.webkitEnterFullscreen)==null||s.call(t)}catch{}};o?requestAnimationFrame(r):r()},yc=async(t,e)=>{var o,r,s,i;const n=vc(t);if(n)try{if(ko()){const c=document;await(((o=c.exitFullscreen)==null?void 0:o.call(c))??((r=c.webkitExitFullscreen)==null?void 0:r.call(c)));return}if(!gc()){e&&t&&_f(e,t);return}const a=n;await(((s=a.requestFullscreen)==null?void 0:s.call(a))??((i=a.webkitRequestFullscreen)==null?void 0:i.call(a)))}catch{}};function is(t){const[e,n]=z(false);return D(()=>{if(!t)return;const o=()=>{var r;return n(!!((r=ko())!=null&&r.contains(t)))};return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}function wf({key:t,id:e,label:n,glyph:o,onClick:r,expanded:s,controls:i,shortcut:a,lang:c,unavailable:l},u){const d=u==null?void 0:u[t];return d?f(d,{buttonProps:{id:e,type:"button","aria-label":n,...c&&{lang:c},...a&&{"aria-keyshortcuts":a.keys},onClick:l?void 0:r,...l&&{"aria-disabled":true},...s!==void 0&&{"aria-expanded":s,"aria-controls":i}},icon:f(gf,{label:n,children:o}),label:n,tip:f(We,{label:n,shortcut:a})},t):f(Fe,{id:e,label:n,onClick:l?void 0:r,unavailable:l,expanded:s,controls:i,shortcut:a,lang:c,children:o},t)}const xf=({fit:t=false,clusterRef:e,children:n})=>{const[o,r]=z(null),s=is(o);bf(o);const i=dt(a=>{r(a),e==null||e(a)},[e]);return f("div",{className:"clover-canvas-controls","data-fit":t||void 0,"data-fullscreen":s,"data-testid":"clover-canvas-controls",ref:i,children:n})},Sf=()=>()=>{};function kf(){return te(Sf,gc)}const Ni=new WeakMap;function Je(t,e){const[n,o]=z(()=>Ni.get(t)??null);return D(()=>{if(!e||n)return;let r=true;return t().then(s=>{Ni.set(t,s),r&&o(()=>s)},()=>{}),()=>{r=false}},[t,e,n]),n}function Cf(t,e,n){return t.reduce((o,r)=>o+r+n,-n)<=e}function Ef(t,e,n){const o=t.ownerDocument,r=i=>i instanceof HTMLElement&&t.contains(i)&&!i.closest("[hidden]"),s=[o.getElementById(e),o.getElementById(n),...Array.from(t.querySelectorAll("button"))].find(r);s==null||s.focus()}function Mf({cluster:t,ids:e,more:n,fits:o,settled:r,onFits:s}){const i=$(o);i.current=o;const a=$(s);a.current=s;const c=$(new Map),l=$(e);l.current=e;const u=$(null),d=e.join(" ");return Dt(()=>{const h=t.ownerDocument,p=()=>{var R;const b=l.current,v=getComputedStyle(t),w=parseFloat(v.columnGap)||0;let _=t.clientWidth-(parseFloat(v.paddingLeft)||0)-(parseFloat(v.paddingRight)||0),x=0;for(const N of b){const J=(R=h.getElementById(N))==null?void 0:R.offsetWidth;J&&c.current.set(N,J),x=Math.max(x,c.current.get(N)??0)}for(const N of Array.from(t.children))!(N instanceof HTMLElement)||b.includes(N.id)||N.id===n||N.classList.contains("clover-canvas-more")||!N.offsetWidth||getComputedStyle(N).position==="absolute"||(_-=N.offsetWidth+w);const S=Cf(b.map(N=>c.current.get(N)??x),_,w);if(S===i.current)return;const M=h.activeElement;u.current=M instanceof HTMLElement&&t.contains(M)?M.id:null,i.current=S,a.current(S)};p();const m=new ResizeObserver(()=>p());m.observe(t);const g=new MutationObserver(()=>p());return g.observe(t,{childList:true}),()=>{m.disconnect(),g.disconnect()}},[t,d,n]),Dt(()=>{if(!r)return;const h=u.current;if(u.current=null,h===null)return;const p=t.ownerDocument.activeElement;(!p||!t.contains(p)||p.closest("[hidden]"))&&Ef(t,h,n)},[o,r,t,n]),null}const Tf=()=>import("./AnnotationMenu-d5PT7q8D.mjs"),If=()=>import("./ChaptersMenu-CaAIaRZN.mjs"),Pf=()=>import("./ChoiceMenu-Clp4Zeog.mjs"),Lf=()=>import("./ImageControls--qeUY5kg.mjs"),Ri=2,Af=new Set(["zoomIn","zoomOut","rotateRight","rotateLeft","reset","fullPage"]),bc={atMax:false,atMin:false,atHome:false},Of=({renderer:t,instance:e,config:n,controlButtons:o,limits:r=bc,placeholder:s,placeholderIsMore:i=false,choices:a=[],selections:c={},onSelect:l,annotations:u=[],chapters:d=[],mediaElement:h=null,onChapter:p,overStill:m,request:g,hiddenPages:b,onPageVisibilityChange:v,selectedAnnotation:w=null,onAnnotationSelect:_,onAnnotationActivate:x,captionId:S,captionOpen:M=false,onCaptionToggle:R,placeId:N,placeOpen:J=false,onPlaceToggle:et,language:X,fit:V=true,more:T="auto",children:E})=>{var Hn,Wn,Oe,mn;const{t:A,langOf:W}=It(),[G,Y]=z(false),[st,St]=z(false),ot=`annotations-${e}`,ct=`${ot}-menu`,y=A("informationPanelTabsAnnotations"),C=W("informationPanelTabsAnnotations"),L=dt(j=>{var ht;St(false),x==null||x(null),j&&((ht=document.getElementById(ot))==null||ht.focus())},[ot,x]),F=n.annotations&&u.length>0&&_,[O,P]=z(false),U=`chapters-${e}`,K=`${U}-menu`,yt=d.length>0&&!!p,tt=$(false),pt=$(null);D(()=>{const j=()=>{var ht;tt.current=((ht=document.activeElement)==null?void 0:ht.id)===U};return document.addEventListener("focusin",j),()=>document.removeEventListener("focusin",j)},[U]);const ft=dt(()=>{var ht,Se;if(!tt.current)return;tt.current=false;const j=document.activeElement;j&&j!==document.body||(Se=(ht=pt.current)==null?void 0:ht.querySelector('.clover-canvas-transport :is([data-button="play"], [data-button="pause"])'))==null||Se.focus()},[]);D(()=>{yt||ft()},[yt,ft]),D(()=>()=>ft(),[ft]);const Ht=dt(j=>{var ht;P(false),j&&((ht=document.getElementById(U))==null||ht.focus())},[U]),Nt=n.information&&S&&R,q=n.map&&N&&et,rt=`choice-${e}`,Q=a.length===1?bt(a[0].label,X):null,wt=(Q==null?void 0:Q.text)||A("canvasChoice"),Bt=Q!=null&&Q.text?Q.lang:W("canvasChoice"),oe=`${rt}-menu`,we=(Hn=Je(Tf,!!F))==null?void 0:Hn.default,B=(Wn=Je(If,yt))==null?void 0:Wn.default,lt=(Oe=Je(Pf,a.length>0&&!!l))==null?void 0:Oe.default,At=dt(j=>{var ht;Y(false),j&&((ht=document.getElementById(rt))==null||ht.focus())},[rt]),Po=kf(),[qt,Ue]=z(null);D(()=>{pt.current=(qt==null?void 0:qt.closest(".clover-canvas"))??null},[qt]);const je=is(qt),[he,Le]=z(false),$n=j=>f(Fe,{className:j,id:ot,label:y,lang:C,onClick:()=>St(ht=>!ht),expanded:st,controls:ct,children:f(Gd,{})},"annotations"),Fn=(()=>{const j=[],ht=t;return n.zoom&&ht&&j.push({key:"zoomIn",id:`zoomIn-${e}`,shortcut:Gt.zoomIn,label:A("imageZoomIn"),lang:W("imageZoomIn"),glyph:f(uf,{}),unavailable:r.atMax,onClick:()=>ht.zoomBy(Ri)},{key:"zoomOut",id:`zoomOut-${e}`,shortcut:Gt.zoomOut,label:A("imageZoomOut"),lang:W("imageZoomOut"),glyph:f(df,{}),unavailable:r.atMin,onClick:()=>ht.zoomBy(1/Ri)}),n.fullPage&&Po&&j.push({key:"fullPage",id:`fullPage-${e}`,label:A(je?"imageExitFullScreen":"imageFullScreen"),lang:W(je?"imageExitFullScreen":"imageFullScreen"),glyph:je?f(hf,{}):f(ff,{}),onClick:Se=>void yc(Se.currentTarget)}),n.rotation&&ht&&j.push({key:"rotateRight",id:`rotateRight-${e}`,shortcut:Gt.rotateRight,label:A("imageRotateRight"),lang:W("imageRotateRight"),glyph:f(Oi,{}),onClick:()=>ht.rotateBy(90)},{key:"rotateLeft",id:`rotateLeft-${e}`,shortcut:Gt.rotateLeft,label:A("imageRotateLeft"),lang:W("imageRotateLeft"),glyph:f(Oi,{}),onClick:()=>ht.rotateBy(-90)}),n.reset&&ht&&j.push({key:"reset",id:`reset-${e}`,shortcut:Gt.reset,label:A("imageResetZoom"),lang:W("imageResetZoom"),glyph:f(pf,{}),unavailable:r.atHome,onClick:()=>ht.home()}),a.length&&j.push({key:"choice",id:rt,label:wt,lang:Bt,glyph:f(mf,{}),onClick:()=>Y(Se=>!Se),expanded:G,controls:oe}),j})(),Xt=[...Fn.filter(j=>j.key!=="fullPage"),...Fn.filter(j=>j.key==="fullPage")].map(j=>({id:j.id,view:Af.has(j.key),node:wf(j,o)})),fn=[q&&{id:`place-${e}`,view:false,node:f(Fe,{id:`place-${e}`,label:A("mapLabel"),lang:W("mapLabel"),onClick:et,expanded:J,controls:N,children:f(Jd,{})},"place")},yt&&{id:U,view:false,node:f(Fe,{id:U,label:A("playerChapters"),lang:W("playerChapters"),onClick:()=>P(j=>!j),expanded:O,controls:K,children:f(Xd,{})},"chapters")},F&&{id:ot,view:false,node:$n()},Nt&&{id:`information-${e}`,view:false,node:f(Fe,{id:`information-${e}`,label:A("informationPanelTabsAbout"),lang:W("informationPanelTabsAbout"),onClick:R,expanded:M,controls:S,children:f(Yd,{})},"information")},!!s&&{id:`placeholder-${e}`,view:false,node:f(ae.Fragment,{children:s},"placeholder")}].filter(j=>!!j),Dn=fn.filter(j=>j.id===`placeholder-${e}`),Wt=[...Xt.filter(j=>j.view),...Dn],hn=[...Xt.filter(j=>!j.view),...fn.filter(j=>!Dn.includes(j))],re=[...Wt,...hn],[Ae,Ao]=z(true),pn=T==="always"||i,Ot=(mn=Je(Lf,V&&(i||(pn||!Ae)&&re.some(j=>j.view))))==null?void 0:mn.ImageControls,Ut=Ae&&!pn||!Ot?[]:re.filter(j=>j.view),xe=i&&!!s&&!!Ot;D(()=>{Ut.length||Le(false)},[Ut.length]);const zn=j=>j.filter(ht=>!Ut.includes(ht)&&!(xe&&ht.id===`placeholder-${e}`)).map(({node:ht})=>ht);return f(Ct,{children:[f(xf,{fit:V,clusterRef:Ue,children:[zn(Wt),Ot&&(Ut.length>0||xe)&&f(Ot,{instance:e,open:xe?Ut.length>0:he,onOpenChange:Le,toggle:xe?s:void 0,children:Ut.map(({node:j})=>j)}),zn(hn),E]}),V&&!pn&&qt&&f(Mf,{cluster:qt,ids:re.map(({id:j})=>j),more:`more-${e}`,fits:Ae,settled:Ae||Ut.length>0||!re.some(j=>j.view),onFits:Ao}),B&&O&&yt&&f(B,{id:K,triggerId:U,label:A("playerChapters"),labelLang:W("playerChapters"),chapters:d,element:h,onChapter:p,overStill:m,request:g,onClose:Ht}),we&&st&&F&&f(we,{id:ct,triggerId:ot,label:y,labelLang:C,annotations:u,hiddenPages:b,onPageVisibilityChange:v,selected:w,onSelect:_,onActivate:j=>x==null?void 0:x(j),onClose:L}),lt&&G&&a.length>0&&l&&f(lt,{id:oe,triggerId:rt,label:wt,labelLang:Bt,language:X,choices:a,selections:c,onSelect:l,onClose:At})]})},Nf=["jpg","png","webp","gif"];class Mr extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageServiceError"}}function as(t){return t.replace(/\/info\.json$/,"").replace(/\/+$/,"")}function Co(t){const e=Array.isArray(t)?t:t?[t]:[];for(const n of e){if(!n||typeof n!="object")continue;const o=n,r=String(o.type??o["@type"]??""),s=JSON.stringify(o.profile??""),i=/ImageService/i.test(r)||/iiif\.io\/api\/image/.test(s)||/^"level[012]"$/.test(s)||!r&&!o.profile,a=o["@id"]??o.id;if(i&&typeof a=="string")return as(a)}}function Rf(t,e){if(!t||typeof t!="object")throw new Mr("info.json is not an object",e??"");const n=t,o=Bf(n),r=o===3?n.id??n["@id"]:n["@id"]??n.id,s=as(r??e??""),i=Number(n.width),a=Number(n.height);if(!s||!(i>0)||!(a>0))throw new Mr("info.json is missing id, width or height",e??s);const c=Array.isArray(n.profile)?n.profile:[n.profile],l=c.find(w=>typeof w=="string"),u=c.filter(w=>!!w&&typeof w=="object"),d=$f(l),h=new Set([...Array.isArray(n.extraFeatures)?n.extraFeatures:[],...u.flatMap(w=>Array.isArray(w.supports)?w.supports:[])]),m=[...Array.isArray(n.preferredFormats)?n.preferredFormats:[]].map(w=>String(w).toLowerCase()).find(w=>Nf.includes(w))??"jpg",g=w=>{var x;const _=n[w]??((x=u.find(S=>S[w]!==void 0))==null?void 0:x[w]);return Number(_)>0?Number(_):void 0};let b=g("maxWidth"),v=g("maxHeight");return b&&!v&&(v=b),v&&!b&&(b=void 0),{id:s,version:o,level:d,width:i,height:a,tiles:Ff(n.tiles),sizes:Df(n.sizes),maxWidth:b,maxHeight:v,maxArea:g("maxArea"),regionByPx:d>=1||h.has("regionByPx"),sizeByW:d>=1||h.has("sizeByW")||h.has("sizeByWh"),format:m,quality:"default"}}function Bf(t){const e=[].concat(t["@context"]??[]).map(String);return e.some(n=>n.includes("/image/3"))?3:e.some(n=>n.includes("/image/2"))?2:t.type==="ImageService3"?3:t["@id"]?2:3}function $f(t){const e=t==null?void 0:t.match(/level([012])/);return e?Number(e[1]):0}function Ff(t){return Array.isArray(t)?t.map(e=>{const n=Number(e==null?void 0:e.width),o=Number((e==null?void 0:e.height)??(e==null?void 0:e.width)),r=(Array.isArray(e==null?void 0:e.scaleFactors)?e.scaleFactors:[1]).map(Number).filter(s=>s>0).sort((s,i)=>s-i);return{width:n,height:o,scaleFactors:r}}).filter(e=>e.width>0&&e.height>0&&e.scaleFactors.length):[]}function Df(t){return Array.isArray(t)?t.map(e=>({width:Number(e==null?void 0:e.width),height:Number(e==null?void 0:e.height)})).filter(e=>e.width>0&&e.height>0).sort((e,n)=>e.width-n.width):[]}function uo(t,e,n,o,r=t.quality){const s=e.x===0&&e.y===0&&e.width===t.width&&e.height===t.height,i=s?"full":`${e.x},${e.y},${e.width},${e.height}`,a=s&&n===t.width&&o===t.height;let c;return t.version===3?c=a?"max":`${n},${o}`:c=a?"full":`${n},`,`${t.id}/${i}/${c}/0/${r}.${t.format}`}function zf(t){return t.version===2&&t.level===0?"native":void 0}const er=new Map;function cs(t,{request:e}={}){const n=as(t),o=er.get(n);if(o)return o;const r=`${n}/info.json`,s=ns(e,r,{headers:{Accept:"application/ld+json, application/json"}}).then(async i=>{if(!i.ok)throw new Mr(`info.json request failed with ${i.status}`,r,i.status);return Rf(await i.json(),n)}).catch(i=>{throw er.delete(n),i});return er.set(n,s),s}function Hf(t){const e=Math.max(0,Math.floor(t||0)),n=Math.floor(e/3600),o=Math.floor(e%3600/60),r=String(e%60).padStart(2,"0");return n?`${n}:${String(o).padStart(2,"0")}:${r}`:`${o}:${r}`}function Gv(t,e){var n;if(t.currentTime=e,!!t.paused)try{(n=t.play())==null||n.catch(()=>{})}catch{}}function ls(t){if(!t)return;const[e,n]=t.split(","),o=Number(e);if(e===""||Number.isNaN(o))return;if(n===void 0||n==="")return{start:o};const r=Number(n);return Number.isNaN(r)?{start:o}:{start:o,end:r}}const Wf=(t,e,n,o,r)=>`${t}|${e??`${n}:${o}`}|${r}`,Uf=/^((application|audio|video)\/)?(vnd\.apple\.|x-)?mpegurl$/i,jf=(t,e)=>!!(t&&/\.m3u8$/i.test(t.split(/[?#]/)[0]))||!!(e&&Uf.test(e)),Vf={width:1600,height:900};function qf(t,e){const n=new Array(t.length);if(!t.length)return n;const o=t.map(cn),r=e==="left-to-right"||e==="right-to-left",s=e==="right-to-left"||e==="bottom-to-top",i=r?o[0].height:o[0].width,a=t.map((l,u)=>u);s&&a.reverse();let c=0;for(const l of a){const u=o[l],d=i/(r?u.height:u.width),h=u.width*d,p=u.height*d;n[l]=r?{x:c,y:0,width:h,height:p}:{x:0,y:c,width:h,height:p},c+=r?h:p}return n}function cn(t){var s,i;if(t.width&&t.height)return{width:t.width,height:t.height};const e=_c(t);if(e!=null&&e.width&&e.height)return{width:e.width,height:e.height};const n=((s=fo(t)[0])==null?void 0:s.body)??((i=ho(t)[0])==null?void 0:i.body),o=Number(n==null?void 0:n.width),r=Number(n==null?void 0:n.height);return o>0&&r>0?{width:o,height:r}:Vf}function _c(t){return t.accompanyingContainer??t.placeholderContainer}function Kf(t,e,n,o,r){return Wf(t.id,e.id,n,o,r)}function Zf(t){const e=[];for(const n of t)wc(n,(o,r)=>{const s=o;if((s==null?void 0:s.type)!=="Choice")return;const i=H(s.items).filter(a=>!!a&&typeof a=="object");i.length>1&&e.push({key:r,canvasId:n.id,label:s.label,items:i.map(a=>({label:a.label,id:a.id,...typeof a.type=="string"?{type:a.type}:{},...typeof a.format=="string"?{format:a.format}:{}}))})});return e}const nr={};function Gf(t){if(t.type!=="Video"&&!An(t.type)||!t.format||jf(t.id,t.format)||typeof document>"u")return true;const e=t.type==="Video"?"video":"audio",n=nr[e]??(nr[e]=document.createElement(e));return typeof n.canPlayType!="function"?true:n.canPlayType(t.format)!==""}function Xf(t){const e={};for(const n of t){const o=n.items.findIndex(Gf);o>0&&(e[n.key]=o)}return e}const or=new WeakMap,rr=[];function Yf(t){return xo(t).some(e=>((e==null?void 0:e.type)==="Choice"?H(e.items):[e]).some(o=>(o==null?void 0:o.type)==="Video"||An(o==null?void 0:o.type)))}function Tr(t){var i;const e=or.get(t);if(e)return e;const n=[];for(const a of t.items??[])for(const c of a.items??[]){if(!Yr(c))continue;const l=c.target?(i=un(c.target))==null?void 0:i.t:void 0;if(!l)continue;const[u,d]=l.split(",").map(Number);Number.isFinite(u)&&n.push({annotation:c,start:u,end:Number.isFinite(d)?d:NaN})}if(n.every(a=>Yf(a.annotation)))return or.set(t,rr),rr;n.sort((a,c)=>a.start-c.start);const o=Number(t.duration),r=Number.isFinite(o)&&o/n.length||.5;n.forEach((a,c)=>{var u;const l=(u=n[c+1])==null?void 0:u.start;a.end>a.start||(l!=null?a.end=l>a.start?l:a.start+r:Number.isFinite(o)&&o>a.start?a.end=o:a.end>a.start||(a.end=a.start+r))});const s=n.length>1?n:rr;return or.set(t,s),s}const Mn=t=>`frame:${t.id}`;function wc(t,e){(t.items??[]).forEach((n,o)=>{(n.items??[]).forEach((r,s)=>{Yr(r)&&xo(r).forEach((i,a)=>e(i,Kf(t,r,o,s,a),r))})})}function fo(t,e={},{allFrames:n=false}={}){const o=[];return us(t,e,(r,s,i)=>{r.body.type==="Image"&&o.push({body:r.body,region:r.region,...r.rotation?{rotation:r.rotation}:{},target:s,...i>=0?{frame:i}:{}})},n),o}function Jf(t,e={}){for(const n of t){let o;if(us(n,e,r=>{o??(o=r.body.type)}),typeof o=="string")return o.toLowerCase()}}function ho(t,e={}){const n=[];return us(t,e,(o,r,s,i)=>{const a=o.body.type;if(a!=="Video"&&!An(a))return;const c=ls(i);n.push({kind:a==="Video"?"video":"audio",body:o.body,target:r,...c?{time:c}:{}})}),n}function Qf(t){const e=t.filter(o=>o.time&&typeof o.body.id=="string"),n=new Set(e.map(o=>o.time.start));if(!(e.length<2||n.size!==e.length))return e.sort((o,r)=>o.time.start-r.time.start).map(o=>{const r=Number(o.body.duration)||(o.time.end!==void 0?o.time.end-o.time.start:void 0);return{src:o.body.id,...o.body.format?{format:o.body.format}:{},start:o.time.start,...r?{duration:r}:{}}})}function us(t,e,n,o=false){const r=t.width??0,s=t.height??0,i=Tr(t),a=Math.min(e[Mn(t)]??0,Math.max(0,i.length-1));wc(t,(c,l,u)=>{const d=i.findIndex(g=>g.annotation===u);if(!o&&d>=0&&d!==a)return;const h=Ir(c,e[l]??0);if(!h)return;const p=u.target?un(u.target):void 0,m=p==null?void 0:p.rect;n(h,m?{x:m.x,y:m.y,width:m.w,height:m.h}:{x:0,y:0,width:r||Number(h.body.width)||0,height:s||Number(h.body.height)||0},d,p==null?void 0:p.t)})}function xc(t){return Sc(t).filter(e=>e.kind!=="transcript")}function th(t){const e=H(t.provides);return e.includes("closedCaptions")?"captions":e.includes("subtitles")||e.includes("translation")?"subtitles":e.includes("transcript")?"transcript":"captions"}function Sc(t){const e=[],n=[...t.annotations??[],...t.items??[]];for(const o of n)for(const r of o.items??[])if(H(r.motivation).includes("supplementing"))for(const s of H(r.body)){const i=s,a=(i==null?void 0:i.type)==="Choice"?H(i.items):[i];for(const c of a){const l=c==null?void 0:c.id;!((c==null?void 0:c.format)==="text/vtt"||typeof l=="string"&&/\.vtt(\?|$)/i.test(l))||typeof l!="string"||e.push({id:l,label:c.label,language:H(c.language)[0],kind:th(r)})}}return e}function eh(t){const e=[],n=r=>{const s=r,i=s==null?void 0:s.id;if(typeof i!="string"||e.some(c=>c.id===i))return;const a=s==null?void 0:s.format;(a?a!=="text/plain":!/\.txt(\?|$)/i.test(i))||e.push({id:i,label:s==null?void 0:s.label,language:H(s==null?void 0:s.language)[0]})},o=[...t.annotations??[],...t.items??[]];for(const r of o)for(const s of r.items??[])if(H(s.motivation).includes("supplementing"))for(const i of H(s.body)){const a=i;((a==null?void 0:a.type)==="Choice"?H(a.items):[a]).forEach(n)}return H(t.rendering).forEach(n),e}function Ir(t,e=0){if(!t||typeof t!="object")return null;const n=t;if(n.type==="Choice"){const o=H(n.items);return Ir(o[e]??o[0])}if(n.type==="SpecificResource"&&n.source){const o=typeof n.source=="string"?{id:n.source}:n.source,r=H(n.selector).find(a=>(a==null?void 0:a.type)==="ImageApiSelector"),s=Ir({type:"Image",...o});if(!s)return null;const i=(r==null?void 0:r.rotation)!=null?String(r.rotation):void 0;return{...s,region:(r==null?void 0:r.region)||s.region,...i?{rotation:i}:{}}}return n.type!=="Image"&&n.type!=="Video"&&!An(n.type)?null:{body:n,region:typeof n.region=="string"?n.region:void 0}}function nh(t,e,n={},{standIns:o=true}={}){const r=qf(t,e),s=[],i=[],a={};return t.forEach((c,l)=>{const u=r[l],d=cn(c),h=u.width/d.width,p=u.height/d.height,m=x=>({x:u.x+x.x*h,y:u.y+x.y*p,width:x.width*h,height:x.height*p}),g=ho(c,n),b=fo(c,n,{allFrames:true}).map(x=>({...x,canvas:c})),v=_c(c);if(o&&!b.length&&g.some(x=>x.kind==="audio")&&v){const x=cn(v);for(const S of fo(v))b.push({...S,canvas:v,target:{x:S.target.x/x.width*d.width,y:S.target.y/x.height*d.height,width:S.target.width/x.width*d.width,height:S.target.height/x.height*d.height}})}const w=n[Mn(c)]??0;b.forEach(({body:x,target:S,region:M,rotation:R,frame:N,canvas:J},et)=>{var E;const X=Co(x.service);if(!X&&!x.id)return;const V=`${J.id}|${et}|${x.id??X}|${M??""}|${R??""}`,T=!(X&&M);if(s.push({id:V,service:X,url:x.id,width:T&&Number(x.width)||void 0,height:T&&Number(x.height)||void 0,region:M,...R?{rotation:R}:{},placement:m(S),...N!=null&&N!==w?{hidden:true}:{}}),N!=null){const A=a[E=Mn(c)]??(a[E]=[]);(A[N]??(A[N]=[])).push(V)}});const[_]=g;if(_!=null&&_.body.id){const x=Qf(g),S=x?x[0]:void 0;i.push({id:`${c.id}|media|${_.body.id}`,kind:_.kind,src:(S==null?void 0:S.src)??_.body.id,format:S?S.format:_.body.format,placement:m(_.target),duration:x?Number(c.duration)||void 0:Number(_.body.duration??c.duration)||void 0,...x?{segments:x}:{},poster:oh(c),captions:xc(c)})}}),{images:s,media:i,placements:r,frames:a}}function oh(t){var e;return(e=kc(t))==null?void 0:e.source}const Xv=1280;function kc(t){var c;const e=t.placeholderContainer;if(!e)return;const n=(c=fo(e)[0])==null?void 0:c.body;if(!n)return;const o=Co(n.service),r=typeof n.id=="string"?n.id:void 0,s=o?{service:o,fallback:r}:r?{src:r}:void 0;if(!s)return;const{width:i,height:a}=cn(e);return{source:s,width:i,height:a}}function rh(t,e,n){const o=cn(t),r=e.width/o.width,s=e.height/o.height;return{x:e.x+n.x*r,y:e.y+n.y*s,width:n.width*r,height:n.height*s}}const sh=({hidden:t})=>{const{t:e,langOf:n}=It(),o=e("imageExitFullScreen");return f("button",{"aria-label":o,...ut(n("imageExitFullScreen")),className:"clover-canvas-exit-full-screen",hidden:t,onClick:r=>void yc(r.currentTarget),type:"button",children:[f("svg",{viewBox:"0 0 512 512",width:"20",height:"20","aria-hidden":"true",focusable:"false",children:f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"})}),o]})},Cc="50%";function Ec(t,e=Cc,n=null){const[o,r]=z(()=>typeof IntersectionObserver>"u");return D(()=>{if(o||!t)return;const s=new IntersectionObserver(i=>{i.some(a=>a.isIntersecting)&&(r(true),s.disconnect())},{root:n,rootMargin:e});return s.observe(t),()=>s.disconnect()},[t,o,e,n]),o}function ih(t){const[e,n]=z(false);return D(()=>{if(!t)return;const o=()=>n(ko()===t);return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}function ah(t){const[e,n]=z(false);return D(()=>{if(!t)return;const o=()=>{const r=ko();n(r===t||!!r&&vc(t)===r&&(r==null?void 0:r.querySelector(".clover-canvas"))===t)};return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}class ch extends ae.Component{constructor(){super(...arguments);I(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}render(){const{error:n}=this.state;return n?f("div",{className:"clover-canvas-error",role:"alert",lang:"en",children:[f("p",{className:"clover-canvas-error-headline","data-testid":"headline",children:"Something went wrong"}),n.message&&f("span",{className:"clover-canvas-error-body",children:`Error message: ${n.message}`})]}):this.props.children}}function Sn({overlay:t=false,className:e}){return f("span",{"aria-hidden":"true",className:Mt("clover-loading",e),"data-overlay":t||void 0,children:f("span",{})})}const lh={image:"bodyUnloadableImage",video:"bodyUnloadableVideo",audio:"bodyUnloadableAudio",model:"bodyUnloadableModel"};function uh({kind:t,shown:e,room:n=false}){const{t:o,langOf:r}=It(),s=lh[t];return f("div",{className:"clover-body-unloadable","data-room":n||void 0,role:"status",children:e&&f("p",{...ut(r(s)),children:o(s)})})}function dh({text:t,lang:e}){return f("div",{className:"clover-body-note","aria-hidden":"true",children:f("p",{...ut(e),children:t})})}function Eo(t,e,n=false,o){const r=fe(),{hostLanguage:s}=It(void 0,o);if(n)return{props:{},node:null};const i=_o(e,s);return i===void 0?{props:{"aria-label":t},node:null}:{props:{"aria-labelledby":r},node:f("span",{hidden:true,id:r,...ut(i),children:t})}}const fh=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function ee(t,e){return{a:1,b:0,c:0,d:1,e:t,f:e}}function ce(t,e=t){return{a:t,b:0,c:0,d:e,e:0,f:0}}function Nn(t){const e=Math.cos(t),n=Math.sin(t);return{a:e,b:n,c:-n,d:e,e:0,f:0}}function hh(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function le(...t){return t.reduce((e,n)=>hh(e,n),fh)}function ph(t){const e=t.a*t.d-t.b*t.c;if(!e||!Number.isFinite(e))return null;const n=1/e;return{a:t.d*n,b:-t.b*n,c:-t.c*n,d:t.a*n,e:(t.c*t.f-t.d*t.e)*n,f:(t.b*t.e-t.a*t.f)*n}}function ve(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function Yv(t){return`matrix(${[t.a,t.b,t.c,t.d,t.e,t.f].map(gh).join(",")})`}function mh(t,e,n,o=new Float32Array(9)){const r=2/e,s=-2/n;return o[0]=t.a*r,o[1]=t.b*s,o[2]=0,o[3]=t.c*r,o[4]=t.d*s,o[5]=0,o[6]=t.e*r-1,o[7]=t.f*s+1,o[8]=1,o}function gh(t){const e=Math.round(t*1e6)/1e6;return Object.is(e,-0)?"0":String(e)}function Mc(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function ds(t){if(!t.length)return null;let e=1/0,n=1/0,o=-1/0,r=-1/0;for(const s of t)e=Math.min(e,s.x),n=Math.min(n,s.y),o=Math.max(o,s.x+s.width),r=Math.max(r,s.y+s.height);return{x:e,y:n,width:o-e,height:r-n}}function vh(t,e){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height}function Mo(t,e){const n=[ve(t,{x:e.x,y:e.y}),ve(t,{x:e.x+e.width,y:e.y}),ve(t,{x:e.x,y:e.y+e.height}),ve(t,{x:e.x+e.width,y:e.y+e.height})],o=n.map(a=>a.x),r=n.map(a=>a.y),s=Math.min(...o),i=Math.min(...r);return{x:s,y:i,width:Math.max(...o)-s,height:Math.max(...r)-i}}function yn(t,e,n){return Math.min(Math.max(t,e),n)}const sr=t=>!!(t&&"overlays"in t);let Pr;const yh=()=>Promise.resolve().then(()=>_d).then(t=>{Pr=t.buildContentState}),bh=mt(()=>import("./MediaBody-TN4XsCm7.mjs")),_h=()=>import("./AnnotationState-DbtYTHMy.mjs"),wh=new Map,xh={menu:[],placed:[],timed:[],hiddenPages:[],setPagesVisible:()=>{},listedCount:0,comments:wh,selected:null,select:()=>{},activate:()=>{},release:()=>false,quietlyOpened:null},Sh=mt(()=>import("./FrameAnimation-wN2VNW7D.mjs")),Bi=mt(()=>import("./PlaceBox-C2k5Fsfo.mjs")),kh=mt(()=>import("./Placeholder-DF6dRMjt.mjs")),Ch=mt(()=>import("./ControlsFade-Db3IWArv.mjs")),Eh=()=>true,Mh=mt(()=>import("./Placeholder-DF6dRMjt.mjs").then(({PlaceholderToggle:t})=>({default:t}))),$i={zoom:true,fullPage:true,rotation:true,reset:true,annotations:true,information:true,map:true},Th={zoom:false,fullPage:false,rotation:false,reset:false,annotations:false,information:false,map:false},Ih={description:"canvasKeysImage",keys:["ArrowLeft ArrowRight ArrowUp ArrowDown",Gt.zoomIn.keys,Gt.zoomOut.keys,Gt.reset.keys,Gt.rotateRight.keys,Gt.rotateLeft.keys].join(" ")},Ph={description:"canvasKeysMedia",keys:[Gt.play.keys,"J L",Gt.mute.keys].join(" ")},Lh={description:"canvasKeysAnnotations",keys:"Escape"},Ah=t=>{var n;return!!((n=t.canvases)!=null&&n.length)||Tc(t.body,t.src).length>0?f(ch,{children:f(Oh,{...t})}):null},Oh=t=>{var Bs,$s,Fs,Ds,zs,Hs;const{surface:e,manifestId:n,canvases:o,viewingDirection:r,body:s,src:i,isTiledImage:a=false,label:c,partOf:l,language:u,highContrast:d,instanceId:h,className:p,options:m,navigator:g=false,controls:b=true,collapseControls:v="auto",controlButtons:w,annotations:_,onReady:x,onViewportChange:S,onContentStateChange:M,onMediaElement:R,onCaptionChange:N,caption:J,onEnded:et,chapters:X,highlightedChapter:V,onChapterHighlight:T,placeholder:E=true,children:A}=t,{t:W}=It(),G=$(null),[Y,st]=z(null),St=ih(Y),ot=is(Y),ct=ah(Y),y=wo(st),C=qr(d),L=!!e.controlsVisibility,O=(e.controlsVisibility??Eh)(L?Y:null,m==null?void 0:m.hideDelay,G),[P,U]=z(false),K=Ec(Y),yt=fe(),[tt]=z(()=>h??`clover-canvas-${yt}`),pt=$(null),[ft,Ht]=z(null),Nt=sr(ft)?ft:null,[q,rt]=z(null),Q=b===false?null:b===true?$i:{...$i,...b},[wt,Bt]=z("loading"),[oe,we]=z(false),[B,lt]=z(0),[At,Po]=z(bc),qt=$(x),Ue=$(S),je=$(m);qt.current=x,Ue.current=S,je.current=m;const he=Xr(r),Le=vt(()=>Zf(o??[]),[o]),$n=vt(()=>Xf(Le),[Le]),[Lo,Fn]=z({}),Xt=vt(()=>({...$n,...Lo}),[$n,Lo]),fn=(k,Z)=>Fn(gt=>({...gt,[k]:Z})),Dn=vt(()=>_==null?void 0:_.filter(k=>!k.layer||(Xt[k.layer.key]??0)===k.layer.item),[_,Xt]),Wt=(Bs=_==null?void 0:_.find(k=>k.layer&&k.annotation.id===t.selectedAnnotation))==null?void 0:Bs.layer;D(()=>{Wt&&(Xt[Wt.key]??0)!==Wt.item&&fn(Wt.key,Wt.item)},[Wt==null?void 0:Wt.key,Wt==null?void 0:Wt.item,t.selectedAnnotation]);const hn=!!(Q!=null&&Q.information),re=!!(_!=null&&_.length),Ae=Je(_h,re),[Ao,pn]=z(null),Ot=re&&Ao||xh,Ut=vt(()=>{var gt,Pt;const k=(gt=_==null?void 0:_.find(jt=>jt.annotation.id===Ot.selected))==null?void 0:gt.annotation,Z=(Array.isArray(k==null?void 0:k.body)?k==null?void 0:k.body:[k==null?void 0:k.body]).find(jt=>(jt==null?void 0:jt.type)==="Feature");return k&&Z?{id:String(k.id),feature:Z,name:((Pt=Z.properties)==null?void 0:Pt.label)??k.label}:null},[_,Ot.selected]),xe=Ut?`${Ut.id}:${t.refind??0}`:null,[zn,Hn]=z(null),Wn=xe!==null&&zn!==xe,Oe=vt(()=>{var jt,Ge;const k=(o??[]).map(Zt=>Zt.navPlace).filter(Boolean),Z=k.length?k:t.navPlace?[t.navPlace]:[];if(!Z.length)return null;const gt=Z.flatMap(Zt=>(Zt==null?void 0:Zt.type)==="FeatureCollection"?Zt.features??[]:(Zt==null?void 0:Zt.type)==="Feature"?[Zt]:[]);if(!gt.length)return null;const Pt=gt.length===1?(Ge=(jt=gt[0])==null?void 0:jt.properties)==null?void 0:Ge.label:void 0;return{feature:{type:"FeatureCollection",features:gt},name:Pt??t.label}},[o,t.navPlace,t.label]),mn=`place-box-${tt}`,[j,ht]=z(false),[Se,pl]=z(false),Un=$(Ot);Un.current=Ot;const jn=dt(()=>Un.current.release(),[]),{comments:Oo,listedCount:ws}=Ot,Ve=vt(()=>hn?(o??[]).filter(k=>cf(k)||Oo.has(k.id)):[],[o,hn,Oo]),No=`caption-${tt}`,[ml,xs]=z(false),Ro=ml&&Ve.length>0,Ss=dt(k=>{var Z;xs(false),k&&((Z=document.getElementById(`information-${tt}`))==null||Z.focus())},[tt]),Kt=vt(()=>(o??[]).find(k=>Tr(k).length)??null,[o]),gl=Kt?Tr(Kt):Rh,Ft=vt(()=>o!=null&&o.length?nh(o,he,Xt,{standIns:o.length>1}):null,[o,he,Xt]),vl=vt(()=>Tc(s,i,a),[s,i,a]),nt=(Ft==null?void 0:Ft.media[0])??null,ks=!L&&(nt==null?void 0:nt.kind)==="video",yl=L||ks,bl=L?O:P,_l=vt(()=>{if(o!=null&&o.length)return Jf(o,Xt);const k=(Array.isArray(s)?s:s?[s]:[])[0];return typeof(k==null?void 0:k.type)=="string"?k.type.toLowerCase():i?"image":void 0},[o,Xt,s,i]),[$t,wl]=z(null),Vn=$(R);Vn.current=R;const xl=dt(k=>{var Z;wl(k),(Z=Vn.current)==null||Z.call(Vn,k)},[]),ke=Ft?Ft.images:vl,Ce=!!nt&&(o==null?void 0:o.length)===1,Ee=Ce&&(nt==null?void 0:nt.kind)==="audio",Sl=Ce&&(nt==null?void 0:nt.kind)==="video",qe=(o==null?void 0:o.length)===1&&!nt&&!Kt&&ke.length===0,qn=!Ce&&!qe&&(($s=m==null?void 0:m.gestures)==null?void 0:$s.navigable)!==false,pe=o?`${n??""}
|
|
2
|
-
${o.map(k=>k.id).join("|")}`:null,Me=vt(()=>{if(!o||!E)return[];const k=o.flatMap(Z=>{const gt=kc(Z),Pt=bt(Z.label,u);return gt?[{...gt,alt:Pt.text,lang:Pt.lang}]:[]});return he==="right-to-left"||he==="bottom-to-top"?k.reverse():k},[o,he,E,u]),[kl,Cs]=z(false),[Cl,Es]=z(null),xt=!Ee&&Me.length>0&&(nt?Cl!==pe:!kl),Ms=m==null?void 0:m.request;D(()=>{if(xt){Promise.resolve().then(()=>vm);for(const{source:k}of Me)k.service&&cs(k.service,{request:Ms}).catch(()=>{})}},[xt,Me,Ms]);const Ts=(k,{annotations:Z=false,fullPage:gt=false}={})=>({...k,zoom:false,rotation:false,reset:false,fullPage:gt&&k.fullPage,annotations:Z&&k.annotations}),gn=qe&&ot,Is=ae.Children.count(A)>0,Bo=Me.length>0&&!Ee&&!nt,vn=Q?xt?Ve.length||Is||ws||nt&&(X!=null&&X.length)?Ts(Q,{annotations:true}):null:Ce||qe?Le.length||Ve.length||Is||ws||nt&&(X!=null&&X.length)||gn&&Q.fullPage?Ts(Q,{annotations:true,fullPage:gn}):null:Q:null,$o=g&&!xt&&(nt?nt.kind==="audio"&&!Ce&&ke.length>0:true),[Fo,El]=z(null),Ke=nt?Fo??nt.placement:null,[Kn,Ml]=z(Bh),Do=vt(()=>{const k=(nt==null?void 0:nt.kind)==="video"&&$t&&Ke?[...ke,{id:nt.id,placement:Ke,width:Ke.width,height:Ke.height,media:{element:$t}}]:ke;return Kn.length?[...k,...Kn]:k},[ke,nt,$t,Ke,Kn]),Ps=Ce&&(nt==null?void 0:nt.kind)==="video"&&Fo?Fo:Ft?ds(Ft.placements):null,Tl=JSON.stringify([ke,Ps,Do.length!==ke.length&&[nt==null?void 0:nt.id,Ke],Kn.map(k=>k.id)]),Zn=$(null),zo=$(false),Ho=()=>{nt?Es(xt?pe:null):Cs(xt),xt||jn()},Gn=$(null),Il=k=>{if($t&&!xt){$t.currentTime=k;return}Gn.current=k,xt&&Ho()};D(()=>{!$t||Gn.current===null||($t.currentTime=Gn.current,Gn.current=null)},[$t]);const Wo=Array.isArray(s)?s[0]:s,Tt=[c,(Fs=o==null?void 0:o[0])==null?void 0:Fs.label,Wo==null?void 0:Wo.label].map(k=>bt(k,u)).find(k=>k.text),Pl=vt(()=>{const k=bt(l,u);return k.text&&k.text!==(Tt==null?void 0:Tt.text)?k:void 0},[l,u,Tt==null?void 0:Tt.text]),Ls=Eo((Tt==null?void 0:Tt.text)||W("canvasImage"),Tt?Tt.lang:y.langOf("canvasImage"),false,y.hostLanguage),Xn=xt?[]:[...qn?[Ih]:[],...nt?[Ph]:[],...re?[Lh]:[]],As=`keys-${tt}`,Ll=qn&&!xt&&!y.langOf("canvasRoleDescription")?W("canvasRoleDescription"):void 0,Uo=!!vn&&Ve.length>0,Al=Uo&&Ve.map((k,Z)=>bt(k.label,u).text?mc(No,Z):null).filter(Boolean).join(" ")||void 0,Os=$({canvases:o,scene:Ft,canvasKey:pe});Os.current={canvases:o,scene:Ft,canvasKey:pe};const Yn=$(null),jo=dt(()=>{const{canvases:k,scene:Z,canvasKey:gt}=Os.current;Yn.current=k&&Z&&Zn.current===gt?{key:gt,canvases:k,placements:Z.placements}:null},[]),Ol=!o||((Ds=Yn.current)==null?void 0:Ds.key)===pe,Ze=dc(()=>{const k=Yn.current,Z=pt.current;if(!k||n==="loading")return null;const gt=$t&&$t.currentTime>0?$t.currentTime:null,Pt=!gt&&Z&&sr(Z)?Ic(Z.getBounds(),k.canvases,k.placements):null,jt=k.canvases.find(Ge=>Ge.id===(Pt==null?void 0:Pt.canvasId))??k.canvases[0];return jt?Pr?Pr({manifestId:n,canvasId:jt.id,type:jt.type,region:Pt&&{x:Pt.rect.x,y:Pt.rect.y,w:Pt.rect.width,h:Pt.rect.height},time:gt}):(yh().then(()=>Ze()),null):null},M);D(()=>Cr($t,Ze),[$t,Ze]),D(()=>{const k=G.current;if(!k)return;const Z=e(k,je.current),gt=sr(Z)?Z:null;pt.current=Z,Ht(Z),Z.setDismiss(jn);const Pt=()=>{if(!gt)return;const Vt=gt.viewLimits();Po(me=>me.atMax===Vt.atMax&&me.atMin===Vt.atMin&&me.atHome===Vt.atHome?me:Vt)},jt=Z.on("open",()=>{var Vt;Pt(),qo(false),jo(),Ze(),Bt("ready"),lt(me=>me+1),gt&&((Vt=qt.current)==null||Vt.call(qt,Nh(gt,()=>Yn.current,me=>{var Us,js;const Ws=Un.current.placed.find(Ko=>Ko.id===me);return Ws?(Un.current.select(Ws),(js=Array.from(((Us=gt.overlays)==null?void 0:Us.container.querySelectorAll("[id]"))??[]).find(Ko=>Ko.id===me))==null||js.focus({preventScroll:true}),true):false})))}),Ge=Z.on("change",()=>{Pt(),qo(false),jo(),Ze(),Bt("ready"),lt(Vt=>Vt+1)}),Zt=Z.on("error",()=>{Z.isOpen||Bt("error")}),Rl=Z.on("unloadable",Vt=>we(!!Vt)),Bl=Z.on("viewport",()=>{var Vt;Pt(),gt&&((Vt=Ue.current)==null||Vt.call(Ue,gt.getBounds())),Ze()});return()=>{jt(),Ge(),Zt(),Rl(),Bl(),Z.dispose(),pt.current=null,Ht(null)}},[h,e,jn,jo]),D(()=>{if(!(!Nt||!q))return Nt.attachNavigator(q)},[Nt,q]),D(()=>{if(!(!ft||!qe))return ft.setGestures({navigable:false}),()=>ft.setGestures({})},[ft,qe]);const Vo=$(false);D(()=>{var Z;if(gn)return;const k=!document.activeElement||document.activeElement===document.body;Vo.current&&k&&((Z=G.current)==null||Z.focus()),Vo.current=false},[gn]),D(()=>{const k=pt.current;if(xt&&(zo.current=true),!k||!K||xt)return;const Z=Zn.current!==null&&Zn.current!==pe;(!k.isOpen||Z)&&Bt("loading");const gt=Ce||zo.current&&k.isOpen||Z;Zn.current=pe,zo.current=false,k.setImages(Do,{world:Ps??void 0,fit:gt})},[Tl,h,$t,K,xt]);const Ns=$(n),[Nl,qo]=z(false);Dt(()=>{var k;n!==Ns.current&&(Ns.current=n,(k=pt.current)==null||k.clear(),qo(true),Bt("loading"))},[n]);const Rs=wt==="loading"&&Do.length>0&&K&&!xt;return f(Pn.Provider,{value:y.hostLanguage,children:f("figure",{"aria-labelledby":Al,className:Mt("clover-canvas",p),"data-testid":"clover-canvas","data-status":wt,...Kr(C),"data-unloadable":oe||void 0,"data-has-navigator":$o,"data-fullscreen":St,"data-exit":ct||void 0,"data-controls":yl?bl?"visible":"hidden":void 0,"data-media":_l,"data-recording":nt?"":void 0,"data-player":Ee?"":void 0,"data-animated":Kt?"":void 0,"data-navigable":qn,"data-placeholder":Me.length&&!Ee?xt:void 0,ref:y.ref,onFocus:k=>{Vo.current=gn&&k.target.id===`fullPage-${tt}`},onKeyDown:k=>{if(k.key==="Escape"&&Ro&&!k.defaultPrevented){k.preventDefault(),Ss(false);return}if(k.key==="Escape"&&!k.defaultPrevented&&!k.currentTarget.querySelector(".clover-canvas-menu")&&jn()){k.preventDefault();return}nf(k,G.current)},style:{position:"relative",width:"100%",height:"100%",margin:0,overflow:"hidden",isolation:"isolate"},children:[(vn||$o)&&nt&&f("div",{className:"clover-canvas-scrim","aria-hidden":"true"}),ks&&f(_t,{fallback:null,children:f(Ch,{element:Y,hideDelay:m==null?void 0:m.hideDelay,picture:G,onChange:U})}),f(sh,{hidden:!ct}),ft&&(vn||Bo)&&f(Of,{renderer:Nt,instance:tt,config:vn??Th,controlButtons:w,limits:At,placeholderIsMore:Bo&&!nt,chapters:nt?X:void 0,mediaElement:$t,onChapter:Il,overStill:!!nt&&xt,request:m==null?void 0:m.request,placeholder:Bo&&f(_t,{fallback:null,children:f(Mh,{instance:tt,media:!!nt,active:xt,onToggle:Ho,more:!!Q&&(Q.zoom||Q.rotation||Q.reset||Q.fullPage)})}),fit:!L,more:v,choices:xt?[]:Le,selections:Xt,onSelect:fn,annotations:Ot.menu,hiddenPages:Ot.hiddenPages,onPageVisibilityChange:Ot.setPagesVisible,selectedAnnotation:Ot.selected,onAnnotationSelect:Ot.select,onAnnotationActivate:Ot.activate,captionId:Uo?No:void 0,captionOpen:Ro,onCaptionToggle:()=>xs(k=>!k),placeId:Oe?mn:void 0,placeOpen:j,onPlaceToggle:()=>{pl(true),ht(k=>!k)},language:u,children:vn&&A}),$o&&f("div",{ref:rt,className:"clover-canvas-navigator","data-testid":"clover-canvas-navigator","aria-hidden":"true"}),f("div",{ref:G,className:"clover-canvas-viewport",style:{position:"absolute",inset:0,overflow:"hidden",zIndex:-1},"data-testid":"clover-canvas-viewport",role:re?"group":"img","aria-roledescription":Ll,...Ls.props,"aria-describedby":Xn.length?As:void 0,"aria-keyshortcuts":Xn.map(({keys:k})=>k).join(" ")||void 0,"aria-busy":Rs,tabIndex:0}),Ls.node,Xn.length>0&&f("span",{id:As,style:sn,children:Xn.map(({description:k},Z)=>f(ae.Fragment,{children:[Z>0&&" ",f("span",{...ut(y.langOf(k)),children:W(k)})]},k))}),f(uh,{kind:"image",shown:oe&&!xt}),qe&&!xt&&(Tt==null?void 0:Tt.text)&&f(dh,{text:Tt.text,lang:Tt.lang||void 0}),(nt==null?void 0:nt.kind)==="audio"&&!Ee&&ke.length===0&&!xt&&(Tt==null?void 0:Tt.text)&&f("p",{className:"clover-canvas-sound-label","aria-hidden":"true",...ut(Tt.lang||void 0),children:Tt.text}),Me.length>0&&!Ee&&f(_t,{fallback:null,children:f(kh,{instance:tt,stills:Me,vertical:he==="top-to-bottom"||he==="bottom-to-top",media:!!nt,active:xt,lingering:wt==="loading"&&!Nl,onToggle:Ho,request:m==null?void 0:m.request})}),ft&&nt&&K&&!xt&&f(_t,{fallback:null,children:f(bh,{media:nt,request:m==null?void 0:m.request,fillable:Sl,surface:ft,instance:tt,onElement:xl,onFit:El,onCaptionChange:N,caption:J,navigable:qn,fullscreen:Ce&&!!(Q!=null&&Q.fullPage),isFullscreen:ot,onEnded:et,chapters:X,highlightedChapter:V,onChapterHighlight:T,autoPlay:!Ee&&Me.length>0&&Ot.quietlyOpened!==pe,language:u,notes:Ot.timed,player:Ee&&o?{canvas:o[0],title:Tt,partOf:Pl}:void 0})}),Nt&&Kt&&(Ft==null?void 0:Ft.frames[Mn(Kt)])&&!xt&&f(_t,{fallback:null,children:f(Sh,{renderer:Nt,frames:gl,byFrame:Ft.frames[Mn(Kt)],animationKey:Kt.id,sceneVersion:B,autoplay:(zs=m==null?void 0:m.animation)==null?void 0:zs.autoplay,loop:(Hs=m==null?void 0:m.animation)==null?void 0:Hs.loop,onEnded:et,language:u,duration:Number(Kt.duration),canvas:Kt,place:Ft.placements[o.indexOf(Kt)],onItems:Ml},Kt.id)}),Ae&&re&&_&&f(Ae.AnnotationState,{given:t,annotations:Dn??_,scene:Ft,renderer:Nt,sceneVersion:B,drawn:Ol,media:nt,mediaElement:$t,showPlaceholder:xt,canvasKey:pe,openImages:Cs,openMedia:Es,host:G,onModel:pn,refind:t.refind??0}),Rs&&f(Sn,{overlay:true}),Ut&&f(_t,{fallback:null,children:f(Bi,{id:`place-of-${tt}`,open:Wn,onClose:k=>{var Z;Hn(xe),k&&((Z=document.getElementById(Ut.id))==null||Z.focus())},feature:Ut.feature,name:Ut.name,language:u})}),Oe&&Se&&f(_t,{fallback:null,children:f(Bi,{id:mn,open:j,onClose:k=>{var Z;ht(false),k&&((Z=document.getElementById(`place-${tt}`))==null||Z.focus())},feature:Oe.feature,name:Oe.name,language:u})}),Uo&&f(lf,{id:No,canvases:Ve,comments:Oo,open:Ro,onClose:Ss,language:u})]})})};function Nh(t,e,n){return{fitCanvasRect(o,r,s){const i=e(),a=(i==null?void 0:i.canvases.findIndex(c=>c.id===o))??-1;return!i||a===-1?false:(t.fitBounds(rh(i.canvases[a],i.placements[a],r),s),true)},getCanvasRegion(){const o=e();return o?Ic(t.getBounds(),o.canvases,o.placements):null},get backendKind(){return t.backendKind},get atHome(){return t.isAtHome},fitBounds:(o,r)=>t.fitBounds(o,r),fitItemRect:(o,r,s)=>t.fitItemRect(o,r,s),itemRectToWorld:(o,r)=>t.itemRectToWorld(o,r),getBounds:()=>t.getBounds(),getHomeBounds:()=>t.getHomeBounds(),getCamera:()=>t.getCamera(),home:o=>t.home(o),zoomBy:(o,r,s)=>t.zoomBy(o,r,s),panBy:(o,r,s)=>t.panBy(o,r,s),setRotation:(o,r)=>t.setRotation(o,r),getRotation:()=>t.getRotation(),rotateBy:o=>t.rotateBy(o),worldToScreenPoint:o=>t.worldToScreenPoint(o),screenToWorldPoint:o=>t.screenToWorldPoint(o),on:(o,r)=>t.on(o,r),zoomToAnnotation:n}}const Rh=[],Bh=[];function Tc(t,e,n=false){const o=Array.isArray(t)?t:t?[t]:[];return o.length?o.map((s,i)=>{const a=Co(s.service);return!a&&!s.id?null:{id:`${i}:${s.id??a}|${s.region??""}`,service:a,url:s.id,width:s.width,height:s.height,region:s.region}}).filter(s=>s!==null):(Array.isArray(e)?e:e?[e]:[]).filter(Boolean).map((s,i)=>({id:`${i}:${s}`,...n?{service:s}:{url:s}}))}function Ic(t,e,n){let o=null;if(n.forEach((d,h)=>{const p=Math.max(t.x,d.x),m=Math.max(t.y,d.y),g=Math.min(t.x+t.width,d.x+d.width)-p,b=Math.min(t.y+t.height,d.y+d.height)-m;if(g<=0||b<=0)return;const v=g*b;(!o||v>o.area)&&(o={index:h,area:v,clip:{x:p,y:m,width:g,height:b}})}),!o)return null;const{index:r,clip:s}=o,i=e[r],a=n[r],c=cn(i),l=c.width/a.width,u=c.height/a.height;return{canvasId:i.id,rect:{x:Math.round((s.x-a.x)*l),y:Math.round((s.y-a.y)*u),width:Math.round(s.width*l),height:Math.round(s.height*u)}}}function $h(t,e,n,o){return vt(()=>((o==null?void 0:o(t??null,(e==null?void 0:e.id)??null,e==null?void 0:e.duration))??[]).map(r=>{const s=bt(r.label,n);return{...r.id?{id:r.id}:{},label:s.text,lang:s.lang,start:r.start,end:r.end,...r.thumbnail?{thumbnail:r.thumbnail}:{}}}),[t,e,n,o])}function Fh(t,e,n,o){if(t.region){if(!e)return false;const{x:r,y:s,w:i,h:a}=t.region;if(!e.fitCanvasRect(t.canvasId,{x:r,y:s,width:i,height:a},true))return false}if(o&&(t.time!==void 0||t.autoplay)){if(!n)return false;const r=()=>{t.time!==void 0&&(n.currentTime=t.time),t.autoplay&&n.play().catch(()=>{})};n.readyState>=HTMLMediaElement.HAVE_METADATA?r():n.addEventListener("loadedmetadata",r,{once:true})}return true}function Dh(t,e){const n=t.store.get().manifest;if(e.canvasId&&Lt(n).canvases.some(r=>r.id===e.canvasId))t.goTo(e.canvasId);else if(e.manifestId&&e.manifestId!==(n==null?void 0:n.id))t.goToManifest(e.manifestId,e.canvasId);else return false;return true}function Pc(t){if(typeof t=="string")return Fi(t);const e=t;return(e==null?void 0:e.type)==="SpecificResource"?e:typeof(e==null?void 0:e.id)=="string"?Fi(e.id):e}const Fi=t=>t.replace(/\/((?:t|xywh)=[^/#]*)$/,"#$1");function Lc(t){const e=H(t.thumbnail)[0];return e&&typeof e=="object"?{thumbnail:e}:{}}const Di=new WeakMap,zi=[];function zh(t,e,n){if(!t||!e)return zi;let o=Di.get(t);o||Di.set(t,o=new Map);const r=`${e}|${n??""}`,s=o.get(r);if(s)return s;const i=[],a=new Set,c=u=>{if(!u||a.has(u.id??u))return;a.add(u.id??u);const d=!H(u.behavior).includes("no-nav");for(const h of H(u.items)){if((h==null?void 0:h.type)==="Range"){c(h);continue}if(!d)continue;const p=un(Pc(h));if(p.id.split("#")[0]!==e)continue;const m=ls(p.t);m&&i.push({...u.id?{id:u.id}:{},label:u.label,...m,...Lc(u)})}};for(const u of H(t.structures))c(u);i.sort((u,d)=>u.start-d.start);const l=i.length?i.map((u,d)=>{var h;return{...u,end:u.end??((h=i[d+1])==null?void 0:h.start)??n}}):zi;return o.set(r,l),l}const Hi=new WeakMap,Wi=[];function Hh(t){if(!t)return Wi;const e=Hi.get(t);if(e)return e;const n=new Map(H(t.items).map((c,l)=>[c==null?void 0:c.id,l])),o=new Set,r=c=>{var w,_;if(!c||o.has(c.id??c))return[];o.add(c.id??c);const l=[],u=[],d=[];let h;for(const x of H(c.items))if((x==null?void 0:x.type)==="Range"){const S=r(x);l.push(...S),S.forEach(M=>u.push(...M.canvasIds))}else{const S=un(Pc(x));if(!S.id)continue;h??(h=S),u.push(S.id),d.push(S)}const p=H(c.behavior);if(p.includes("no-nav"))return l;const m=h??void 0,g={id:c.id??`range-${o.size}`,label:c.label,canvasId:(m==null?void 0:m.id)??((w=l[0])==null?void 0:w.canvasId),canvasIds:[...new Set(u)],...p.includes("sequence")?{sequence:true}:{},...Lc(c),children:l},b=ls(m==null?void 0:m.t);return b?g.time=b:!m&&((_=l[0])!=null&&_.time)&&(g.time=l[0].time),m!=null&&m.rect&&(g.region=m.rect),(p.includes("sequence")&&d.length>1&&!d.some(x=>x.t)||Wh(d,n))&&(g.parts=d.map(x=>({canvasId:x.id,...x.rect?{region:x.rect}:{}}))),[g]},s=H(t.structures).flatMap(r),i=s.length===1&&s[0].children.length?s[0].children:s,a=i.length?i:Wi;return Hi.set(t,a),a}function Wh(t,e){return!t.length||t.some(n=>n.t)?false:t.some(n=>n.rect)?true:t.some((n,o)=>o>0&&e.get(n.id)!==(e.get(t[o-1].id)??NaN)+1)}function Jv(t,e,n,o){let r=null,s=null;const i=(l,u,d)=>!l||d>l.depth||d===l.depth&&!(l.sequence&&u.sequence),a=(l,u,d)=>{const h=d||l.id===o;if(e&&l.canvasIds.includes(e)&&(!l.time||n!==void 0&&n>=l.time.start&&(l.time.end===void 0||n<l.time.end))){const m={id:l.id,depth:u,...l.sequence?{sequence:true}:{}};i(r,l,u)&&(r=m),h&&i(s,l,u)&&(s=m)}l.children.forEach(p=>a(p,u+1,h))};t.forEach(l=>a(l,0,false));const c=s??r;return c?c.id:null}function Uh(){const t=it(n=>n.status),e=it(n=>n.error);return vt(()=>({status:t,error:e}),[t,e])}function jh(){return it(t=>t.manifest)}function Ac(){return it(t=>Lt(t.manifest))}function fs(){return it(t=>De(t.manifest,t.canvasId))}function Vh(){return it(t=>He(t.manifest,t.canvasId))}function qh(){const{clover:t}=de("useNavigation"),e=it(o=>On(o.manifest,o.canvasId)),n=it(o=>Lt(o.manifest).views.length);return vt(()=>Fd(t,e,n),[t,e,n])}function Kh(){return it(t=>nc(t.manifest,t.addedSets))}function Qv(t){const{language:e}=de("useLocalized");return vt(()=>bt(t,e),[t,e])}function ty(){return It().t}function ey(){return It().langOf}const Zh=({options:t,onReady:e,onViewportChange:n,onMediaElement:o,onCaptionChange:r,caption:s,onEnded:i,placeholder:a=true,label:c,partOf:l,language:u,annotations:d,chapters:h,...p})=>{const m=de("Canvas"),{clover:g}=m,b=te(g.captions.subscribe,g.captions.get,g.captions.get),v=s??b,w=u??m.language,_=fs(),{direction:x}=Ac(),S=jh(),M=Vh(),R=it(B=>{var lt;return B.status==="loading"?"loading":((lt=B.manifest)==null?void 0:lt.id)??""}),N=it(B=>B.target),J=it(B=>oc(B.manifest,B.addedSets,B.search.set,B.regions)),et=it(B=>yd(B.manifest,B.addedSets,B.hiddenSets,B.shownSets)),X=it(B=>ts(B.manifest,B.addedSets,B.hiddenSets,B.shownSets)),V=it(B=>B.annotationId),T=$(V);T.current=V;const[E,A]=z(0);D(()=>g.found.subscribe(B=>{B&&B===T.current&&A(lt=>lt+1)}),[g]);const W=te(g.highlight.subscribe,g.highlight.get,g.highlight.get),G=te(g.chapter.subscribe,g.chapter.get,g.chapter.get),Y=_.map(B=>B.id).join("|"),st=vt(()=>{if(d)return d;const B=_.map(lt=>lt.id);return J.flatMap(lt=>lt.entries.filter(At=>B.includes(At.canvasId)).map(At=>({annotation:At.annotation,targetIndex:B.indexOf(At.canvasId),pageId:lt.id,...lt.label?{pageLabel:lt.label}:{},...At.place?{place:At.place}:{},...At.layer?{layer:{key:At.layer.key,item:At.layer.item}}:{}})))},[d,J,_]),ot=N?(B=>!!B&&_.some(lt=>lt.id===B))(N.canvasId):false,ct=$(null);ot&&(ct.current=Y);const y=a&&ct.current!==Y,C=$(null),L=$(null),F=vt(()=>_.some(B=>ho(B).length>0),[_]),O=F?_.find(B=>ho(B).length>0):void 0,P=$h(S,O,w,zh),U=$(F);U.current=F;const K=s===void 0?m.language:void 0,yt=O==null?void 0:O.id;D(()=>{if(!K||!O)return;const B=xc(O).find(lt=>lt.language&&qa(lt.language,K));B&&g.captions.get()!==B.id&&g.captions.emit(B.id)},[K,yt,g]);const tt=dt(()=>{const B=g.store.get().target;!B||!g.store.get().canvasId||Fh(B,C.current,L.current,U.current)&&g.consumeTarget()},[g]),pt=$(Y);D(()=>{pt.current!==Y&&(pt.current=Y,L.current=null),N&&tt()},[N,Y,tt]);const ft=$(e);ft.current=e;const Ht=dt(B=>{var lt;C.current=B,B.on("change",tt),tt(),(lt=ft.current)==null||lt.call(ft,B)},[tt]),Nt=dt(B=>{var At;const lt=(At=C.current)==null?void 0:At.getCanvasRegion();g.viewport.emit(lt?{canvasId:lt.canvasId,region:{x:lt.rect.x,y:lt.rect.y,w:lt.rect.width,h:lt.rect.height}}:null),n==null||n(B)},[g,n]),q=dt(B=>{L.current=B,g.media.emit(B),B&&tt(),o==null||o(B)},[g,tt,o]),rt=dt(()=>{i==null||i(),(Ne(S,"auto-advance")||Ne(M,"auto-advance"))&&g.next({autoplay:true,wrap:Ne(S,"repeat")})},[g,S,M,i]),Q=dt(B=>void Dh(g,B),[g]),wt=(t==null?void 0:t.request)??g.request,Bt=Ne(M,"auto-advance")||Ne(S,"auto-advance"),oe=Ne(M,"repeat")||Ne(S,"repeat"),we=vt(()=>({...t,request:wt,animation:(t==null?void 0:t.animation)??{autoplay:Bt,loop:oe}}),[t,wt,Bt,oe]);return _.length?f(Ah,{...p,manifestId:R,navPlace:S==null?void 0:S.navPlace,canvases:_,viewingDirection:x,language:w,label:c??(M==null?void 0:M.label)??(S==null?void 0:S.label),partOf:l??(S==null?void 0:S.label),options:we,placeholder:y,onReady:Ht,onViewportChange:Nt,onMediaElement:q,caption:v,onCaptionChange:B=>{g.captions.emit((B==null?void 0:B.id)??null),r==null||r(B)},onEnded:rt,annotations:st,hiddenPages:X,unlistedPages:et,onPageVisibilityChange:(B,lt)=>B.forEach(At=>g.setSetVisible(At,lt)),chapters:h??P,highlightedChapter:G,onChapterHighlight:B=>g.chapter.emit(B),selectedAnnotation:V,refind:E,highlightedAnnotation:W,onAnnotationSelect:B=>g.selectAnnotation(B),onAnnotationLink:p.onAnnotationLink??Q,onAnnotationActive:B=>{var lt;g.highlight.emit(B),(lt=p.onAnnotationActive)==null||lt.call(p,B)}}):null},Gh=6,Ye=new Set;function Xh(t){if(Ye.has(t))return true;for(;Ye.size>=Gh;){let e;for(const n of Ye)n.hiddenSince!==null&&(!e||n.hiddenSince<e.hiddenSince)&&(e=n);if(!e)return false;Ye.delete(e),e.release()}return Ye.add(t),true}function Ui(t){Ye.delete(t)}function Yh(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement?t.complete&&t.naturalWidth>0:true}function Jh(t,e){if(!t.bleed)return{x:0,y:0};const n=t.transform,o=Math.hypot(n.a,n.b)*e,r=Math.hypot(n.c,n.d)*e;return{x:t.bleed.right&&o>0?1/o:0,y:t.bleed.bottom&&r>0?1/r:0}}const Qh=`#version 300 es
|
|
1
|
+
var $l=Object.defineProperty;var Fl=(t,e,n)=>e in t?$l(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var I=(t,e,n)=>Fl(t,typeof e!="symbol"?e+"":e,n);import{s as ma}from"./styles-DogZyfVz.mjs";function Dl(t={}){return Promise.resolve().then(()=>Wu).then(e=>e.initCloverI18n(t))}const ga="@layer clover{:is(clover-root,clover-items,clover-viewer,clover-panel,clover-read-more):not([hidden]){display:block}:is(clover-body,clover-canvas,clover-timeline,clover-scene):not([hidden]){display:block;height:var(--clover-body-height,60vh)}clover-split:not([hidden]){display:flex}:is(clover-label,clover-panel-toggle):not([hidden]){display:contents}clover-tab,clover-tip,clover-status>[slot]{display:none}}";let zl=null,bn=null;const Hl=()=>zl??(zl=import("./host-ClJe-BX1.mjs").then(t=>bn=t)),Wl=t=>t.trim().toLowerCase()==="false";function Ul(t,{type:e,min:n},o){if(t===null)return;if(e==="string")return t;if(e==="boolean")return!Wl(t);if(e==="number"){const s=Number(t);if(t.trim()===""||!Number.isFinite(s)){o("is not a number");return}if(n!==void 0&&s<n){o(`is less than ${n}`);return}return s}if(e==="data"){const s=t.trim();if(!/^[[{"]/.test(s))return t;try{return JSON.parse(s)}catch{o("is not JSON");return}}const r=t.trim().toLowerCase();if(e.includes(r))return r==="false"?false:r;o(`is not ${e.join(", ")}`)}const jl=(t,e)=>{const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(o=>Object.is(t[o],e[o]))};function Vl(t){class e extends HTMLElement{constructor(){super(...arguments);I(this,"kind",t.kind)}static get observedAttributes(){return Object.keys(t.attributes)}connectedCallback(){ma(this.ownerDocument).inject("elements",ga)}}customElements.define(t.tag,e)}function ql(t,e){if(typeof customElements>"u"||customElements.get(t.tag))return;if(t.kind==="config"||!e)return Vl(t);const n=t.kind,o=t.properties??[],r=Object.entries(t.events??{});let s=null,i=null;const a=()=>i??(i=Promise.all([e().then(l=>s=l),Hl()]));class c extends HTMLElement{constructor(){super(...arguments);I(this,"kind",n);I(this,"needsRoot",!!t.needsRoot);I(this,"values",{});I(this,"kept",{});I(this,"props",{});I(this,"listeners",new Set);I(this,"warned",new Set);I(this,"handlers",Object.fromEntries(r.map(([d,h])=>[h.prop,(...p)=>{var v;if(h.keeps&&(this.kept[h.keeps]=p[0]??null,p[0]==null))return true;const m=h.detail==="first"?p[0]:Object.fromEntries(h.detail.map((w,_)=>[w,p[_]])),g=new CustomEvent(d,{detail:m,bubbles:!h.keeps,composed:!h.keeps,cancelable:!!h.cancelable}),b=this.dispatchEvent(g);if(!b&&h.cancelable){const w=p[p.length-1];(v=w==null?void 0:w.preventDefault)==null||v.call(w)}return b}])));I(this,"getProps",()=>this.props);I(this,"subscribe",d=>(this.listeners.add(d),()=>{this.listeners.delete(d)}))}static get observedAttributes(){return Object.keys(t.attributes)}get element(){return this}get Component(){return s}connectedCallback(){for(const d of o){if(!Object.prototype.hasOwnProperty.call(this,d))continue;const h=this[d];delete this[d],h!=null&&(this.values[d]=h)}this.update(),this.warnOfAria(),ma(this.ownerDocument).inject("elements",ga),a().then(()=>{this.isConnected&&bn.hostOf(this.ownerDocument).connect(this)})}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||bn==null||bn.hostOf(this.ownerDocument).disconnect(this)})}attributeChangedCallback(){this.update()}warnOfAria(){if(!t.native)for(const d of["aria-label","aria-labelledby","role"])!this.hasAttribute(d)||this.warned.has(d)||(this.warned.add(d),console.warn(`<${t.tag}>: ${d} names the element, a box no reader is told of; Clover names what it draws itself.`))}update(){const d={...this.handlers,...this.values};for(const[h,p]of Object.entries(t.attributes)){if(p.prop in this.values)continue;const m=this.getAttribute(h),g=Ul(m,p,b=>{const v=`${h}=${m}`;this.warned.has(v)||(this.warned.add(v),console.warn(`<${t.tag}>: ${h}="${m}" ${b}; ignored.`))});g!==void 0&&(d[p.prop]=g)}jl(d,this.props)||(this.props=d,this.listeners.forEach(h=>h()))}}I(c,"initCloverI18n",Dl);for(const l of o)Object.defineProperty(c.prototype,l,{configurable:true,enumerable:true,get(){return l in this.values?this.values[l]:this.getProps()[l]},set(u){u==null?delete this.values[l]:this.values[l]=u,this.update()}});for(const[,l]of r){if(!l.keeps)continue;const u=l.keeps;Object.defineProperty(c.prototype,u,{configurable:true,enumerable:true,get(){return this.kept[u]??null}})}customElements.define(t.tag,c)}var Tn,at,va,$e,Vs,ya,ba,_a,Fr,pr,mr,wa,kn={},xa=[],Kl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,In=Array.isArray;function se(t,e){for(var n in e)t[n]=e[n];return t}function Dr(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function _e(t,e,n){var o,r,s,i={};for(s in e)s=="key"?o=e[s]:s=="ref"?r=e[s]:i[s]=e[s];if(arguments.length>2&&(i.children=arguments.length>3?Tn.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)i[s]===void 0&&(i[s]=t.defaultProps[s]);return xn(t,i,o,r,null)}function xn(t,e,n,o,r){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++va,__i:-1,__u:0};return r==null&&at.vnode!=null&&at.vnode(s),s}function Zl(){return{current:null}}function Ct(t){return t.children}function ie(t,e){this.props=t,this.context=e}function on(t,e){if(e==null)return t.__?on(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?on(t):null}function Sa(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Sa(t)}}function gr(t){(!t.__d&&(t.__d=true)&&$e.push(t)&&!io.__r++||Vs!=at.debounceRendering)&&((Vs=at.debounceRendering)||ya)(io)}function io(){for(var t,e,n,o,r,s,i,a=1;$e.length;)$e.length>a&&$e.sort(ba),t=$e.shift(),a=$e.length,t.__d&&(n=void 0,o=void 0,r=(o=(e=t).__v).__e,s=[],i=[],e.__P&&((n=se({},o)).__v=o.__v+1,at.vnode&&at.vnode(n),zr(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[r]:null,s,r??on(o),!!(32&o.__u),i),n.__v=o.__v,n.__.__k[n.__i]=n,Ea(s,n,i),o.__e=o.__=null,n.__e!=r&&Sa(n)));io.__r=0}function ka(t,e,n,o,r,s,i,a,c,l,u){var d,h,p,m,g,b,v,w=o&&o.__k||xa,_=e.length;for(c=Gl(n,e,w,c,_),d=0;d<_;d++)(p=n.__k[d])!=null&&(h=p.__i==-1?kn:w[p.__i]||kn,p.__i=d,b=zr(t,p,h,r,s,i,a,c,l,u),m=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Hr(h.ref,null,p),u.push(p.ref,p.__c||m,p)),g==null&&m!=null&&(g=m),(v=!!(4&p.__u))||h.__k===p.__k?c=Ca(p,c,t,v):typeof p.type=="function"&&b!==void 0?c=b:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=g,c}function Gl(t,e,n,o,r){var s,i,a,c,l,u=n.length,d=u,h=0;for(t.__k=new Array(r),s=0;s<r;s++)(i=e[s])!=null&&typeof i!="boolean"&&typeof i!="function"?(c=s+h,(i=t.__k[s]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?xn(null,i,null,null,null):In(i)?xn(Ct,{children:i},null,null,null):i.constructor==null&&i.__b>0?xn(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=t,i.__b=t.__b+1,a=null,(l=i.__i=Xl(i,n,c,d))!=-1&&(d--,(a=n[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>u?h--:r<u&&h++),typeof i.type!="function"&&(i.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,i.__u|=4))):t.__k[s]=null;if(d)for(s=0;s<u;s++)(a=n[s])!=null&&!(2&a.__u)&&(a.__e==o&&(o=on(a)),Ta(a,a));return o}function Ca(t,e,n,o){var r,s;if(typeof t.type=="function"){for(r=t.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=t,e=Ca(r[s],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=on(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function be(t,e){return e=e||[],t==null||typeof t=="boolean"||(In(t)?t.some(function(n){be(n,e)}):e.push(t)),e}function Xl(t,e,n,o){var r,s,i,a=t.key,c=t.type,l=e[n],u=l!=null&&(2&l.__u)==0;if(l===null&&t.key==null||u&&a==l.key&&c==l.type)return n;if(o>(u?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((l=e[i=r>=0?r--:s++])!=null&&!(2&l.__u)&&a==l.key&&c==l.type)return i}return-1}function qs(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Kl.test(e)?n:n+"px"}function Jn(t,e,n,o,r){var s,i;t:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||qs(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||qs(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(_a,"$1")),i=e.toLowerCase(),e=i in t||e=="onFocusOut"||e=="onFocusIn"?i.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?o?n.u=o.u:(n.u=Fr,t.addEventListener(e,s?mr:pr,s)):t.removeEventListener(e,s?mr:pr,s);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break t}catch{}typeof n=="function"||(n==null||n===false&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Ks(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Fr++;else if(e.t<n.u)return;return n(at.event?at.event(e):e)}}}function zr(t,e,n,o,r,s,i,a,c,l){var u,d,h,p,m,g,b,v,w,_,x,S,M,R,N,J,et,X=e.type;if(e.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=e.__e=n.__e]),(u=at.__b)&&u(e);t:if(typeof X=="function")try{if(v=e.props,w="prototype"in X&&X.prototype.render,_=(u=X.contextType)&&o[u.__c],x=u?_?_.props.value:u.__:o,n.__c?b=(d=e.__c=n.__c).__=d.__E:(w?e.__c=d=new X(v,x):(e.__c=d=new ie(v,x),d.constructor=X,d.render=Jl),_&&_.sub(d),d.props=v,d.state||(d.state={}),d.context=x,d.__n=o,h=d.__d=true,d.__h=[],d._sb=[]),w&&d.__s==null&&(d.__s=d.state),w&&X.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=se({},d.__s)),se(d.__s,X.getDerivedStateFromProps(v,d.__s))),p=d.props,m=d.state,d.__v=e,h)w&&X.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),w&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(w&&X.getDerivedStateFromProps==null&&v!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,x),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,x)===false||e.__v==n.__v){for(e.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=false),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(V){V&&(V.__=e)}),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[],d.__h.length&&i.push(d);break t}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,x),w&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,g)})}if(d.context=x,d.props=v,d.__P=t,d.__e=false,M=at.__r,R=0,w){for(d.state=d.__s,d.__d=false,M&&M(e),u=d.render(d.props,d.state,d.context),N=0;N<d._sb.length;N++)d.__h.push(d._sb[N]);d._sb=[]}else do d.__d=false,M&&M(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++R<25);d.state=d.__s,d.getChildContext!=null&&(o=se(se({},o),d.getChildContext())),w&&!h&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(p,m)),J=u,u!=null&&u.type===Ct&&u.key==null&&(J=Ma(u.props.children)),a=ka(t,In(J)?J:[J],e,n,o,r,s,i,a,c,l),d.base=e.__e,e.__u&=-161,d.__h.length&&i.push(d),b&&(d.__E=d.__=null)}catch(V){if(e.__v=null,c||s!=null)if(V.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(et=s.length;et--;)Dr(s[et]);vr(e)}else e.__e=n.__e,e.__k=n.__k,V.then||vr(e);at.__e(V,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=Yl(n.__e,e,n,o,r,s,i,c,l);return(u=at.diffed)&&u(e),128&e.__u?void 0:a}function vr(t){t&&t.__c&&(t.__c.__e=true),t&&t.__k&&t.__k.forEach(vr)}function Ea(t,e,n){for(var o=0;o<n.length;o++)Hr(n[o],n[++o],n[++o]);at.__c&&at.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){at.__e(s,r.__v)}})}function Ma(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:In(t)?t.map(Ma):se({},t)}function Yl(t,e,n,o,r,s,i,a,c){var l,u,d,h,p,m,g,b=n.props,v=e.props,w=e.type;if(w=="svg"?r="http://www.w3.org/2000/svg":w=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((p=s[l])&&"setAttribute"in p==!!w&&(w?p.localName==w:p.nodeType==3)){t=p,s[l]=null;break}}if(t==null){if(w==null)return document.createTextNode(v);t=document.createElementNS(r,w,v.is&&v),a&&(at.__m&&at.__m(e,s),a=false),s=null}if(w==null)b===v||a&&t.data==v||(t.data=v);else{if(s=s&&Tn.call(t.childNodes),b=n.props||kn,!a&&s!=null)for(b={},l=0;l<t.attributes.length;l++)b[(p=t.attributes[l]).name]=p.value;for(l in b)if(p=b[l],l!="children"){if(l=="dangerouslySetInnerHTML")d=p;else if(!(l in v)){if(l=="value"&&"defaultValue"in v||l=="checked"&&"defaultChecked"in v)continue;Jn(t,l,null,p,r)}}for(l in v)p=v[l],l=="children"?h=p:l=="dangerouslySetInnerHTML"?u=p:l=="value"?m=p:l=="checked"?g=p:a&&typeof p!="function"||b[l]===p||Jn(t,l,p,b[l],r);if(u)a||d&&(u.__html==d.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),ka(e.type=="template"?t.content:t,In(h)?h:[h],e,n,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,i,s?s[0]:n.__k&&on(n,0),a,c),s!=null)for(l=s.length;l--;)Dr(s[l]);a||(l="value",w=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[l]||w=="progress"&&!m||w=="option"&&m!=b[l])&&Jn(t,l,m,b[l],r),l="checked",g!=null&&g!=t[l]&&Jn(t,l,g,b[l],r))}return t}function Hr(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(r){at.__e(r,n)}}function Ta(t,e,n){var o,r;if(at.unmount&&at.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||Hr(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(s){at.__e(s,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&Ta(o[r],e,n||typeof t.type!="function");n||Dr(t.__e),t.__c=t.__=t.__e=void 0}function Jl(t,e,n){return this.constructor(t,n)}function Cn(t,e,n){var o,r,s,i;e==document&&(e=document.documentElement),at.__&&at.__(t,e),r=(o=typeof n=="function")?null:n&&n.__k||e.__k,s=[],i=[],zr(e,t=(!o&&n||e).__k=_e(Ct,null,[t]),r||kn,kn,e.namespaceURI,!o&&n?[n]:r?null:e.firstChild?Tn.call(e.childNodes):null,s,!o&&n?n:r?r.__e:e.firstChild,o,i),Ea(s,t,i)}function Ia(t,e){Cn(t,e,Ia)}function Ql(t,e,n){var o,r,s,i,a=se({},t.props);for(s in t.type&&t.type.defaultProps&&(i=t.type.defaultProps),e)s=="key"?o=e[s]:s=="ref"?r=e[s]:a[s]=e[s]===void 0&&i!=null?i[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Tn.call(arguments,2):n),xn(t.type,a,o||t.key,r||t.ref,null)}function ue(t){function e(n){var o,r;return this.getChildContext||(o=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&o.forEach(function(i){i.__e=true,gr(i)})},this.sub=function(s){o.add(s);var i=s.componentWillUnmount;s.componentWillUnmount=function(){o&&o.delete(s),i&&i.call(s)}}),n.children}return e.__c="__cC"+wa++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,o){return n.children(o)}).contextType=e,e}Tn=xa.slice,at={__e:function(t,e,n,o){for(var r,s,i;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),i=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,o||{}),i=r.__d),i)return r.__E=r}catch(a){t=a}throw t}},va=0,ie.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=se({},this.state),typeof t=="function"&&(t=t(se({},n),this.props)),t&&se(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),gr(this))},ie.prototype.forceUpdate=function(t){this.__v&&(this.__e=true,t&&this.__h.push(t),gr(this))},ie.prototype.render=Ct,$e=[],ya=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ba=function(t,e){return t.__v.__b-e.__v.__b},io.__r=0,_a=/(PointerCapture)$|Capture$/i,Fr=0,pr=Ks(false),mr=Ks(true),wa=0;var tu=0;function f(t,e,n,o,r,s){e||(e={});var i,a,c=e;if("ref"in c)for(a in c={},e)a=="ref"?i=e[a]:c[a]=e[a];var l={type:t,props:c,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tu,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(i=t.defaultProps))for(a in i)c[a]===void 0&&(c[a]=i[a]);return at.vnode&&at.vnode(l),l}var Ie,kt,Zo,Zs,rn=0,Pa=[],Et=at,Gs=Et.__b,Xs=Et.__r,Ys=Et.diffed,Js=Et.__c,Qs=Et.unmount,ti=Et.__;function ln(t,e){Et.__h&&Et.__h(kt,t,rn||e),rn=0;var n=kt.__H||(kt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function z(t){return rn=1,Wr(Oa,t)}function Wr(t,e,n){var o=ln(Ie++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Oa(void 0,e),function(a){var c=o.__N?o.__N[0]:o.__[0],l=o.t(c,a);c!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=kt,!kt.__f)){var r=function(a,c,l){if(!o.__c.__H)return true;var u=o.__c.__H.__.filter(function(h){return!!h.__c});if(u.every(function(h){return!h.__N}))return!s||s.call(this,a,c,l);var d=o.__c.props!==a;return u.forEach(function(h){if(h.__N){var p=h.__[0];h.__=h.__N,h.__N=void 0,p!==h.__[0]&&(d=true)}}),s&&s.call(this,a,c,l)||d};kt.__f=true;var s=kt.shouldComponentUpdate,i=kt.componentWillUpdate;kt.componentWillUpdate=function(a,c,l){if(this.__e){var u=s;s=void 0,r(a,c,l),s=u}i&&i.call(this,a,c,l)},kt.shouldComponentUpdate=r}return o.__N||o.__}function D(t,e){var n=ln(Ie++,3);!Et.__s&&jr(n.__H,e)&&(n.__=t,n.u=e,kt.__H.__h.push(n))}function Dt(t,e){var n=ln(Ie++,4);!Et.__s&&jr(n.__H,e)&&(n.__=t,n.u=e,kt.__h.push(n))}function $(t){return rn=5,vt(function(){return{current:t}},[])}function La(t,e,n){rn=6,Dt(function(){if(typeof t=="function"){var o=t(e());return function(){t(null),o&&typeof o=="function"&&o()}}if(t)return t.current=e(),function(){return t.current=null}},n==null?n:n.concat(t))}function vt(t,e){var n=ln(Ie++,7);return jr(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function dt(t,e){return rn=8,vt(function(){return t},e)}function zt(t){var e=kt.context[t.__c],n=ln(Ie++,9);return n.c=t,e?(n.__==null&&(n.__=true,e.sub(kt)),e.props.value):t.__}function Aa(t,e){Et.useDebugValue&&Et.useDebugValue(e?e(t):t)}function Ur(){var t=ln(Ie++,11);if(!t.__){for(var e=kt.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function eu(){for(var t;t=Pa.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(oo),t.__H.__h.forEach(yr),t.__H.__h=[]}catch(e){t.__H.__h=[],Et.__e(e,t.__v)}}Et.__b=function(t){kt=null,Gs&&Gs(t)},Et.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ti&&ti(t,e)},Et.__r=function(t){Xs&&Xs(t),Ie=0;var e=(kt=t.__c).__H;e&&(Zo===kt?(e.__h=[],kt.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(oo),e.__h.forEach(yr),e.__h=[],Ie=0)),Zo=kt},Et.diffed=function(t){Ys&&Ys(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Pa.push(e)!==1&&Zs===Et.requestAnimationFrame||((Zs=Et.requestAnimationFrame)||nu)(eu)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Zo=kt=null},Et.__c=function(t,e){e.some(function(n){try{n.__h.forEach(oo),n.__h=n.__h.filter(function(o){return!o.__||yr(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Et.__e(o,n.__v)}}),Js&&Js(t,e)},Et.unmount=function(t){Qs&&Qs(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{oo(o)}catch(r){e=r}}),n.__H=void 0,e&&Et.__e(e,n.__v))};var ei=typeof requestAnimationFrame=="function";function nu(t){var e,n=function(){clearTimeout(o),ei&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);ei&&(e=requestAnimationFrame(n))}function oo(t){var e=kt,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),kt=e}function yr(t){var e=kt;t.__c=t.__(),kt=e}function jr(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Oa(t,e){return typeof e=="function"?e(t):e}function Na(t,e){for(var n in e)t[n]=e[n];return t}function br(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return true;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return true;return false}function ee(t,e){var n=e(),o=z({t:{__:n,u:e}}),r=o[0].t,s=o[1];return Dt(function(){r.__=n,r.u=e,Go(r)&&s({t:r})},[t,n,e]),D(function(){return Go(r)&&s({t:r}),t(function(){Go(r)&&s({t:r})})},[t]),n}function Go(t){var e,n,o=t.u,r=t.__;try{var s=o();return!((e=r)===(n=s)&&(e!==0||1/e==1/n)||e!=e&&n!=n)}catch{return true}}function Ra(t){t()}function Ba(t){return t}function $a(){return[false,Ra]}var Fa=Dt;function _r(t,e){this.props=t,this.context=e}function ou(t,e){function n(r){var s=this.props.ref,i=s==r.ref;return!i&&s&&(s.call?s(null):s.current=null),e?!e(this.props,r)||!i:br(this.props,r)}function o(r){return this.shouldComponentUpdate=n,_e(t,r)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=true,o.__f=true,o.type=t,o}(_r.prototype=new ie).isPureReactComponent=true,_r.prototype.shouldComponentUpdate=function(t,e){return br(this.props,t)||br(this.state,e)};var ni=at.__b;at.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),ni&&ni(t)};var ru=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function oe(t){function e(n){var o=Na({},n);return delete o.ref,t(o,n.ref||null)}return e.$$typeof=ru,e.render=t,e.prototype.isReactComponent=e.__f=true,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var oi=function(t,e){return t==null?null:be(be(t).map(e))},su={map:oi,forEach:oi,count:function(t){return t?be(t).length:0},only:function(t){var e=be(t);if(e.length!==1)throw"Children.only";return e[0]},toArray:be},iu=at.__e;at.__e=function(t,e,n,o){if(t.then){for(var r,s=e;s=s.__;)if((r=s.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e)}iu(t,e,n,o)};var ri=at.unmount;function Da(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=Na({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=true,t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return Da(o,e,n)})),t}function za(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return za(o,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=true,t.__c.__P=n)),t}function _t(){this.__u=0,this.o=null,this.__b=null}function Ha(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function mt(t){var e,n,o;function r(s){if(e||(e=t()).then(function(i){n=i.default||i},function(i){o=i}),o)throw o;if(!n)throw e;return _e(n,s)}return r.displayName="Lazy",r.__f=true,r}function _n(){this.i=null,this.l=null}at.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),ri&&ri(t)},(_t.prototype=new ie).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=Ha(o.__v),s=false,i=function(){s||(s=true,n.__R=null,r?r(a):a())};n.__R=i;var a=function(){if(!--o.__u){if(o.state.__a){var c=o.state.__a;o.__v.__k[0]=za(c,c.__c.__P,c.__c.__O)}var l;for(o.setState({__a:o.__b=null});l=o.o.pop();)l.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(i,i)},_t.prototype.componentWillUnmount=function(){this.o=[]},_t.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Da(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&_e(Ct,null,t.fallback);return r&&(r.__u&=-33),[_e(Ct,null,e.__a?null:t.children),r]};var si=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};function au(t){return this.getChildContext=function(){return t.context},t.children}function cu(t){var e=this,n=t.h;if(e.componentWillUnmount=function(){Cn(null,e.v),e.v=null,e.h=null},e.h&&e.h!==n&&e.componentWillUnmount(),!e.v){for(var o=e.__v;o!==null&&!o.__m&&o.__!==null;)o=o.__;e.h=n,e.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return true},insertBefore:function(r,s){this.childNodes.push(r),e.h.insertBefore(r,s)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.h.removeChild(r)}}}Cn(_e(au,{context:e.context},t.__v),e.v)}function lu(t,e){var n=_e(cu,{__v:t,h:e});return n.containerInfo=e,n}(_n.prototype=new ie).__a=function(t){var e=this,n=Ha(e.__v),o=e.l.get(t);return o[0]++,function(r){var s=function(){e.props.revealOrder?(o.push(r),si(e,t,o)):r()};n?n(s):s()}},_n.prototype.render=function(t){this.i=null,this.l=new Map;var e=be(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},_n.prototype.componentDidUpdate=_n.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){si(t,n,e)})};var Wa=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,uu=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,du=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,fu=/[A-Z0-9]/g,hu=typeof document<"u",pu=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function mu(t,e,n){return e.__k==null&&(e.textContent=""),Cn(t,e),typeof n=="function"&&n(),t?t.__c:null}function gu(t,e,n){return Ia(t,e),typeof n=="function"&&n(),t?t.__c:null}ie.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(ie.prototype,t,{configurable:true,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:true,writable:true,value:e})}})});var ii=at.event;function vu(){}function yu(){return this.cancelBubble}function bu(){return this.defaultPrevented}at.event=function(t){return ii&&(t=ii(t)),t.persist=vu,t.isPropagationStopped=yu,t.isDefaultPrevented=bu,t.nativeEvent=t};var Vr,_u={enumerable:false,configurable:true,get:function(){return this.class}},ai=at.vnode;at.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,o=e.type,r={},s=o.indexOf("-")===-1;for(var i in n){var a=n[i];if(!(i==="value"&&"defaultValue"in n&&a==null||hu&&i==="children"&&o==="noscript"||i==="class"||i==="className")){var c=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&a===true?a="":c==="translate"&&a==="no"?a=false:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?i="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||pu(n.type)?c==="onfocus"?i="onfocusin":c==="onblur"?i="onfocusout":du.test(i)&&(i=c):c=i="oninput":s&&uu.test(i)?i=i.replace(fu,"-$&").toLowerCase():a===null&&(a=void 0),c==="oninput"&&r[i=c]&&(i="oninputCapture"),r[i]=a}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=be(n.children).forEach(function(l){l.props.selected=r.value.indexOf(l.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=be(n.children).forEach(function(l){l.props.selected=r.multiple?r.defaultValue.indexOf(l.props.value)!=-1:r.defaultValue==l.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",_u)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),e.props=r}(t),t.$$typeof=Wa,ai&&ai(t)};var ci=at.__r;at.__r=function(t){ci&&ci(t),Vr=t.__c};var li=at.diffed;at.diffed=function(t){li&&li(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value),Vr=null};var wu={ReactCurrentDispatcher:{current:{readContext:function(t){return Vr.__n[t.__c].props.value},useCallback:dt,useContext:zt,useDebugValue:Aa,useDeferredValue:Ba,useEffect:D,useId:Ur,useImperativeHandle:La,useInsertionEffect:Fa,useLayoutEffect:Dt,useMemo:vt,useReducer:Wr,useRef:$,useState:z,useSyncExternalStore:ee,useTransition:$a}}};function xu(t){return _e.bind(null,t)}function yo(t){return!!t&&t.$$typeof===Wa}function Su(t){return yo(t)&&t.type===Ct}function ku(t){return!!t&&!!t.displayName&&(typeof t.displayName=="string"||t.displayName instanceof String)&&t.displayName.startsWith("Memo(")}function Cu(t){return yo(t)?Ql.apply(null,arguments):t}function Eu(t){return!!t.__k&&(Cn(null,t),true)}function Mu(t){return t&&(t.base||t.nodeType===1&&t)||null}var Tu=function(t,e){return t(e)},Iu=function(t,e){return t(e)},Pu=Ct,Lu=yo,ae={useState:z,useId:Ur,useReducer:Wr,useEffect:D,useLayoutEffect:Dt,useInsertionEffect:Fa,useTransition:$a,useDeferredValue:Ba,useSyncExternalStore:ee,startTransition:Ra,useRef:$,useImperativeHandle:La,useMemo:vt,useCallback:dt,useContext:zt,useDebugValue:Aa,version:"18.3.1",Children:su,render:mu,hydrate:gu,unmountComponentAtNode:Eu,createPortal:lu,createElement:_e,createContext:ue,createFactory:xu,cloneElement:Cu,createRef:Zl,Fragment:Ct,isValidElement:yo,isElement:Lu,isFragment:Su,isMemo:ku,findDOMNode:Mu,Component:ie,PureComponent:_r,memo:ou,forwardRef:oe,flushSync:Iu,unstable_batchedUpdates:Tu,StrictMode:Pu,Suspense:_t,SuspenseList:_n,lazy:mt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:wu};function qr(t){const e=ee(Ou,Nu);return!!t||e}const Kr=t=>t?{"data-high-contrast":""}:{},Au="(prefers-contrast: more)",Ua=()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Au):null;function Ou(t){var n;const e=Ua();return(n=e==null?void 0:e.addEventListener)==null||n.call(e,"change",t),()=>{var o;return(o=e==null?void 0:e.removeEventListener)==null?void 0:o.call(e,"change",t)}}const Nu=()=>{var t;return!!((t=Ua())!=null&&t.matches)},Pn=ue(void 0),Mt=(...t)=>t.filter(Boolean).join(" "),bo=ue(null);function Pe(){return zt(bo)}function de(t="This part"){const e=zt(bo);if(!e)throw new Error(`${t} must be rendered inside <Clover.Root>.`);return e}function it(t,e=Object.is,n){const{clover:o}=de(n),r=$(null),s=()=>{const i=t(o.store.get());return r.current&&e(r.current.value,i)?r.current.value:(r.current={value:i},i)};return ee(o.store.subscribe,s)}const Ru={subscribe:()=>()=>{}};function Ln(t,e){const n=zt(bo),o=n==null?void 0:n.clover.store,r=()=>o?t(o.get()):e;return ee(o?o.subscribe:Ru.subscribe,r)}const Bu=JSON.parse('{"commonClose":"Close","commonNext":"Next","commonPrevious":"Previous","commonSearch":"Search","commonViewAll":"View all","controlShortcut":"{{label}} ({{shortcut}})","contentSearchLoading":"Loading...","contentSearchPlaceholder":"Search","contentSearchResultsNone":"No results","contentSearchResult":"1 result","contentSearchResults":"{{count}} results","contentSearchError":"The search could not be completed.","contentSearchPosition":"Result {{index}} of {{total}}","contentSearchClear":"Clear search","canvasPosition":"Item {{index}} of {{total}}","canvasImage":"Image","bodyUnloadableImage":"This image could not be loaded.","bodyUnloadableVideo":"This video could not be loaded.","bodyUnloadableAudio":"This audio could not be loaded.","bodyUnloadableModel":"This model could not be loaded.","canvasRoleDescription":"zoomable image","canvasKeysImage":"Use the arrow keys to pan, with Shift for larger steps, plus and minus to zoom, 0 to reset the view, and R or Shift+R to rotate.","canvasKeysMedia":"Press Space or K to play or pause, J or L to skip ten seconds back or forward, and M to mute or unmute.","canvasKeysAnnotations":"Press Escape to clear the selected annotation.","sceneModel":"3D model","sceneRoleDescription":"rotatable 3D model","sceneKeys":"Use the arrow keys to rotate the model, with Shift for larger steps, plus and minus to zoom, 0 to reset the view, and R or Shift+R to rotate it right or left.","sceneRotateUp":"Rotate up","sceneRotateDown":"Rotate down","sceneRotate":"Rotate","sceneResetView":"Reset view","statusLoading":"Loading\u2026","statusError":"This could not be loaded.","itemsLabel":"Items","download":"Download","downloadPage":"This page","downloadAll":"All pages","templateSidebar":"Items","templateSidebarToggle":"Show items","templateBack":"Back","templateBackTo":"Back to {{label}}","collectionLabel":"Collection","itemsScrollBack":"Show previous items","itemsScrollForward":"Show more items","aboutRights":"Rights","aboutDate":"Date","aboutHomepage":"Homepage","aboutSeeAlso":"See also","aboutProvider":"Provider","logo":"Logo","aboutManifest":"IIIF Manifest","aboutCanvas":"IIIF Canvas","aboutPartOf":"Part of","aboutOpenManifest":"Open the full Manifest","aboutCollection":"IIIF Collection","readingLanguage":"Language","annotationsHide":"Hide annotations","annotationsHideTip":"Hide","readMore":"Read more","readLess":"Read less","annotationsShow":"Find on the image","annotationsShowTime":"Find in the recording","annotationsImage":"Image","annotationsLanguage":"Language","annotationsOpenLink":"Open the link","transcriptLabel":"Transcript","imageViewerOpen":"Open image viewer","imageViewerClose":"Close image viewer","canvasChoice":"Choice","canvasViewerControls":"Viewer controls","canvasExpandControls":"Expand viewer controls","canvasCollapseControls":"Collapse viewer controls","canvasScrollBack":"Show previous controls","canvasScrollForward":"Show more controls","imageFullScreen":"Full screen","imageExitFullScreen":"Exit full screen","imageResetZoom":"Reset zoom","imageRotateLeft":"Rotate left","imageRotateRight":"Rotate right","imageZoomIn":"Zoom in","imageZoomOut":"Zoom out","informationPanelTabs":"Information panel","sectionsScrollBack":"Show previous tabs","sectionsScrollForward":"Show more tabs","informationPanelClose":"Close information panel","informationPanelTabsAbout":"About","informationPanelTabsAnnotations":"Annotations","informationPanelTabsSearch":"Search","informationPanelTabsContents":"Contents","contentsSectionsIn":"Sections in","informationPanelTabsMap":"Map","informationPanelTabsCollection":"Collection","informationPanelTabsTargets":"Views","mapUnavailable":"The map could not be shown.","mapLabel":"Map","mapAttribution":"Map credits","mapPlaceUntitled":"Place {{number}}","mapOverlay":"Georeferenced image","mapPlacesListed":"Places listed after the map: {{count}}","informationPanelToggle":"More information","playerPlay":"Play","playerPause":"Pause","playerMute":"Mute","playerUnmute":"Unmute","playerVolume":"Volume","playerSeek":"Seek","playerCaptions":"Captions","playerCaptionsOff":"Off","playerChapters":"Chapters","playerFill":"Fill frame","playerFit":"Fit to frame","frameRepeat":"Repeat","playerCurrentTime":"Current time","playerDuration":"Duration","splitHandle":"Resize panels"}'),ja={es:()=>import("../es-B1NvdYp-.mjs"),fi:()=>import("../fi-BjtYZNLo.mjs"),fr:()=>import("../fr-Cd22Lziw.mjs"),nb:()=>import("../nb-CEwZDBiR.mjs"),nn:()=>import("../nn-jYQhr9RI.mjs"),no:()=>import("../no-CEwZDBiR.mjs"),pt:()=>import("../pt-CWR30SzS.mjs")};function Va(){const t=[];return typeof document<"u"&&t.push(document.documentElement.lang),typeof navigator<"u"&&t.push(...navigator.languages??[],navigator.language),t.filter(Boolean)}const ao=t=>t.split("-")[0];function qa(t,e){return ao(t).toLowerCase()===ao(e).toLowerCase()}const Xo=t=>t.includes("-")?ao(t):null;function $u(t,e,n=[]){if(!e.length)return;if(e.length===1)return e[0];const o=()=>e.includes("none")?"none":e.includes("@none")?"@none":e[0];if(!t)return e.includes("none")?"none":e[0];if(e.includes(t))return t;const r=Xo(t);if(r&&e.includes(r))return r;const s=n.find(a=>e.includes(a));if(s)return s;const i=e.findIndex(a=>Xo(a)===t);if(i!==-1)return e[i];for(const a of n){const c=Xo(a);if(c&&e.includes(c))return c}return o()}function Zr(t,e){const[n,...o]=e?[e]:Va();return $u(n,t,o)??t[0]}const ge="clover",te={en:{[ge]:{...Bu}}};let tn,Ka=[],co=0;const wr=new Set;function Gr(){co++,wr.forEach(t=>t())}function Fu(t){const e=ao(t);return e&&e!==t?[t,e]:[t]}const ui=new Map,Du=t=>Object.prototype.hasOwnProperty.call(ja,t);function zu(t){let e=ui.get(t);return e||(e=ja[t]().then(({default:n})=>{var o;te[t]={...te[t],[ge]:{...n,...(o=te[t])==null?void 0:o[ge]}},Gr()},()=>{}),ui.set(t,e)),e}function Za(t){const e=t.find(n=>n==="en"||Du(n));return e&&e!=="en"?zu(e):Promise.resolve()}let Qn=[],di="";function wn(){const t=tn?`${co}`:`${co} ${typeof document<"u"?document.documentElement.lang:""} ${typeof navigator<"u"?navigator.languages:""}`;if(t===di)return Qn;di=t;const e=tn?[tn]:Va();return Qn=[...new Set([...e,...Ka].flatMap(Fu).concat("en"))],Za(Qn),Qn}function _o(t,e){if(t)return qa(t,e||Qt.resolvedLanguage)?void 0:t}const Qt={get language(){return tn??wn().find(t=>te[t])??"en"},get resolvedLanguage(){return wn().find(t=>{var e;return Object.keys(((e=te[t])==null?void 0:e[ge])??{}).length>0})??"en"},changeLanguage(t){tn=t,Gr()},resolve(t,e,n=ge){var r,s;let o={text:t};for(const i of wn()){const a=(s=(r=te[i])==null?void 0:r[n])==null?void 0:s[t];if(a!==void 0){o={text:a,lang:i};break}}return e?{...o,text:o.text.replace(/\{\{(\w+)\}\}/g,(i,a)=>a in e?String(e[a]):i)}:o},t(t,e,n=ge){return Qt.resolve(t,e,n).text},langOf(t,e,n=ge){return _o(Qt.resolve(t,void 0,n).lang,e)},ready(){return Za(wn())},subscribe(t){return wr.add(t),()=>{wr.delete(t)}},getSnapshot(){return co}};typeof document<"u"&&wn();function Hu(t={}){for(const[e,n]of Object.entries(t.resources??{}))for(const[o,r]of Object.entries(n??{}))te[e]??(te[e]={}),te[e][o]={...te[e][o],...r};return t.fallbackLng!==void 0&&(Ka=t.fallbackLng===false?[]:[t.fallbackLng].flat()),t.lng&&(tn=t.lng),Gr(),Qt}const Wu=Object.freeze(Object.defineProperty({__proto__:null,CLOVER_I18N_NAMESPACE:ge,cloverI18n:Qt,initCloverI18n:Hu,langWithin:_o},Symbol.toStringTag,{value:"Module"}));function Pt(t=ge,e){const n=ee(Qt.subscribe,Qt.getSnapshot,Qt.getSnapshot),o=zt(Pn),r=e??o,s=dt((a,c)=>Qt.t(a,c,t),[t,n]),i=dt(a=>Qt.langOf(a,r,t),[t,n,r]);return{t:s,langOf:i,hostLanguage:r,i18n:Qt}}function wo(t,e){const n=zt(Pn),o=$(null),[r,s]=z(""),i=dt(u=>{o.current=u,typeof t=="function"?t(u):t&&(t.current=u)},[t]);D(()=>{var d,h;const u=(d=o.current)==null?void 0:d.parentElement;e!==void 0||n!==void 0||!u||s(((h=u.closest("[lang]"))==null?void 0:h.getAttribute("lang"))??"")});const c=e??n??r,{langOf:l}=Pt(void 0,c);return{ref:i,hostLanguage:c,langOf:l}}const H=t=>Array.isArray(t)?t:t==null?[]:[t],Uu=["left-to-right","right-to-left","top-to-bottom","bottom-to-top"];function Xr(t){return Uu.includes(t)?t:"left-to-right"}const ju=["individuals","paged","continuous","unordered"];function Vu(t){return H(t).find(n=>ju.includes(n))??"individuals"}function qu(t,e){if(!t.length)return[];if(e==="continuous")return[t.map((a,c)=>c)];if(e!=="paged")return t.map((a,c)=>[c]);const n=[];let o=[],r=0,s=false;const i=()=>{o.length&&n.push(o),o=[]};return t.forEach((a,c)=>{const l=H(a.behavior);if(l.includes("non-paged")){c===r&&r++,i(),n.push([c]);return}if(c===r||l.includes("facing-pages")){o.length&&(s=true),i(),n.push([c]);return}if(o.push(c),s){i(),s=false;return}o.length>1&&i()}),i(),n}function Ku(t,e){const n=t.findIndex(o=>o.includes(e));return n===-1?0:n}const Ga=["Independents","Composite","List"];function xo(t){return H(t==null?void 0:t.body).flatMap(e=>Ga.includes(e==null?void 0:e.type)?H(e.items):[e])}function Yr(t){const e=H(t==null?void 0:t.motivation);return!e.length||e.includes("painting")}function Xa(t,e){const n=/(?:^|[#&])t=([^&]+)/.exec(e),o=n&&{t:n[1]},r=/(?:^|[#&])xywh=(?:pixel:)?([^&]+)/.exec(e);if(r){const[s,i,a,c]=r[1].split(",").map(Number);if([s,i,a,c].every(Number.isFinite))return{id:t,rect:{x:s,y:i,w:a,h:c},...o}}return o&&{id:t,...o}}function to(t){const e=t.indexOf("#");if(e>=0){const o=t.slice(0,e);return Xa(o,t.slice(e))??{id:o}}const n=t.indexOf("&t=");return n>=0?{id:t.slice(0,n),t:t.slice(n+3)}:{id:t}}const xr=t=>{var e;return Array.isArray(t)?xr(t[0]):Ga.includes(t==null?void 0:t.type)?xr((e=t.items)==null?void 0:e[0]):t};function un(t){return Zu(xr(t))}function Zu(t){var n;if(typeof t=="string")return to(t);if(!t||typeof t!="object")return{id:""};if(t.type!=="SpecificResource"||t.source===void 0)return to(t.id??"");const e=typeof t.source=="string"?to(t.source):to(((n=t.source)==null?void 0:n.id)??"");for(const o of H(t.selector)){const r=o;if((r==null?void 0:r.type)==="PointSelector"){const[s,i,a]=[r.x,r.y,r.instant??r.t].map(Number),c=Number.isFinite(s)&&Number.isFinite(i);return{id:e.id,...c?{point:{x:s,y:i}}:{},...Number.isFinite(a)?{t:String(a)}:{}}}if((r==null?void 0:r.type)==="SvgSelector"&&r.value)return{id:e.id,svg:String(r.value)};if((r==null?void 0:r.type)==="FragmentSelector"&&r.value){const s=Xa(e.id,String(r.value));if(s)return s}}return e}const An=t=>t==="Audio"||t==="Sound",Gu=t=>{const e=H(t);return e.length>0&&e.every(n=>n==="supplementing")},Xu=(t,e)=>Gu(t)&&!!(e.rect||e.svg||e.point)&&!e.t,fi=new WeakMap,Yu={canvases:[],views:[],direction:"left-to-right"};function At(t){if(!t)return Yu;let e=fi.get(t);if(!e){const n=(t.items??[]).filter(o=>(o==null?void 0:o.type)==="Canvas"||(o==null?void 0:o.type)==="Timeline"||(o==null?void 0:o.type)==="Scene");e={canvases:n,views:qu(n,Vu(t.behavior)),direction:Xr(t.viewingDirection)},fi.set(t,e)}return e}const hi=new WeakMap;function He(t,e){if(!e)return null;const n=At(t);let o=hi.get(n);if(!o){o=new Map;for(const r of n.canvases)o.has(r.id)||o.set(r.id,r);hi.set(n,o)}return o.get(e)??null}function On(t,e){const{canvases:n,views:o}=At(t),r=n.findIndex(s=>s.id===e);return r===-1?0:Ku(o,r)}const pi=new WeakMap,Ju=[];function De(t,e){if(!t)return Ju;const n=On(t,e);let o=pi.get(t);o||pi.set(t,o=new Map);let r=o.get(n);if(!r){const s=At(t);r=(s.views[n]??[]).map(i=>s.canvases[i]),o.set(n,r)}return r}function Qu(t,e){var s,i;const{canvases:n,views:o}=At(t),r=(s=o[e])==null?void 0:s[0];return r===void 0?null:((i=n[r])==null?void 0:i.id)??null}function td(t){const e=t==null?void 0:t.start;if(!e)return null;const n=un(e);if(!n.id)return null;const o={canvasId:n.id};n.rect&&(o.region=n.rect);const r=n.t?Number(n.t.split(",")[0]):NaN;return Number.isFinite(r)&&(o.time=r),o}const Ne=(t,e)=>{const n=t==null?void 0:t.behavior;return Array.isArray(n)?n.includes(e):n===e},ed=t=>[(t==null?void 0:t.partOf)??[]].flat().find(e=>(e==null?void 0:e.id)&&e.type==="Collection");function nd(t,e,n,o){const r=t==null?void 0:t.items;if(!(r!=null&&r.length)||!n)return-1;const s=De(n,o),i=a=>{const c=r[a];return((c==null?void 0:c.manifestId)===n.id||(c==null?void 0:c.manifestAs)===n.id)&&(!c.canvasId||s.some(l=>l.id===c.canvasId))};return e!==null&&i(e)?e:r.findIndex((a,c)=>i(c))}function bt(t,e,n=", "){if(!t)return{text:""};if(typeof t=="string")return{text:t};const o=Object.keys(t).filter(a=>{var c;return(c=t[a])==null?void 0:c.length});if(!o.length)return{text:""};const r=Zr(o,e),s=t[r];return{text:Array.isArray(s)?s.join(n):String(s),lang:r==="none"?void 0:r}}const od=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/;function En(t){const e=t==null?void 0:t.language,n=(Array.isArray(e)?e:[e]).filter(o=>typeof o=="string"&&od.test(o));return n.length===1?n[0]:void 0}const sn={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},rd=/^(ar|arc|ckb|dv|fa|he|iw|ks|ps|sd|syr|ug|ur|yi)$/,sd=/^(adlm|arab|hebr|nkoo|rohg|syrc|thaa)$/;function id(t){if(!t)return;const[e,...n]=t.toLowerCase().split(/[-_]/),o=n.find(r=>r.length===4);return(o?sd.test(o):rd.test(e))?"rtl":void 0}function ut(t){return t?{lang:t,dir:id(t)}:{}}function ad({clover:t,language:e}){const{t:n,langOf:o}=Pt(),[r,s]=z(null),i=$(n);return i.current=n,D(()=>{let a=null;return t.store.subscribe(()=>{const{manifest:c,canvasId:l,status:u}=t.store.get();if(u!=="ready"||l===a)return;const d=a===null;if(a=l,d)return;const h=He(c,l),p=bt(h==null?void 0:h.label,e),m=i.current("canvasPosition",{index:On(c,l)+1,total:At(c).views.length});s({label:p.text,lang:p.lang,position:m})})},[t,e]),f("div",{className:"clover-announcer",role:"status","aria-live":"polite","aria-atomic":"true",style:sn,children:[r!=null&&r.label?f(Ct,{children:[f("span",{...ut(r.lang),children:r.label}),","," "]}):null,r&&f("span",{...ut(o("canvasPosition")),children:r.position})]})}const cd=t=>(t==null?void 0:t.format)==="text/vtt"||typeof(t==null?void 0:t.id)=="string"&&/\.vtt(\?|$)/i.test(t.id);function ld(t){const e=[];let n=0;const o=(r,s)=>{var a;if(!r||cd(r))return;if(r.type==="SpecificResource"){r.source&&typeof r.source=="object"&&o(r.source,s);return}const i=s===void 0?{}:{choice:s};if(r.type==="TextualBody"||typeof r.value=="string")e.push({value:String(r.value??""),format:r.format,language:H(r.language)[0],...i});else if(r.type==="Image"&&r.id){const c=r.label??t.label;e.push({image:r.id,format:r.format,...c?{label:c}:{},...i})}else if(r.type==="Feature"){const c=((a=r.properties)==null?void 0:a.label)??t.label;c&&typeof c=="object"&&e.push({label:c,place:true,...i})}};for(const r of xo(t))if((r==null?void 0:r.type)!=="Choice")o(r);else{const s=n++;for(const i of H(r.items))o(i,s)}return e}const Jr="content-search",mi=/\/search\/([0-2])\//;function Ya(t){if(!t)return null;let e=null;for(const n of H(t.service)){const o=(n==null?void 0:n.id)??(n==null?void 0:n["@id"]);if(typeof o!="string")continue;const r=String(n.type??n["@type"]??""),s=[n.profile,n["@context"]].flat().map(a=>String(a??"")).join(" "),i=r==="SearchService2"?2:r==="SearchService1"?1:mi.test(s)?Number(mi.exec(s)[1])>=2?2:1:null;if(i===2)return{id:o,version:i};i===1&&(e??(e={id:o,version:i}))}return e}const ud="contents",Uv=(t,e)=>`${t}#region-${e+1}`,dd=t=>H(t==null?void 0:t.motivation).includes("linking");function Ja(t,e,n){const o=[];for(const r of H(t==null?void 0:t.items)){const s=H(r==null?void 0:r.motivation);if(s.includes("painting"))continue;const i=ld(r);if(!i.length&&!dd(r))continue;const a=un(H(r.target)[0]),c=a.id||n;!c||!r.id||o.push({id:r.id,setId:e,canvasId:c,target:a,motivation:s,bodies:i,annotation:r})}return o}const fd=t=>At(t).canvases.some(e=>H(e.items).some(n=>H(n==null?void 0:n.items).some(o=>H(o==null?void 0:o.body).some(r=>[r,...H(r==null?void 0:r.items)].some(s=>H(s==null?void 0:s.annotations).length>0)))));function hd(t,e){for(const n of[t,e])if(n!=null&&n.label)return n.label;for(const n of[t,e]){const o=H(n==null?void 0:n.partOf).find(r=>/AnnotationCollection/.test(String((r==null?void 0:r.type)??(r==null?void 0:r["@type"])))&&r.label);if(o)return o.label}}const Qa=t=>H(t==null?void 0:t.partOf).filter(e=>(e==null?void 0:e.id)&&/AnnotationCollection/.test(String((e==null?void 0:e.type)??(e==null?void 0:e["@type"])))),gi=new WeakMap;function tc(t){var n;if(!t)return[];let e=gi.get(t);if(!e){const o=new Map;for(const r of At(t).canvases)for(const s of H(r.annotations)){if(!Array.isArray(s==null?void 0:s.items))continue;const i=s.id??`${r.id}#annotations`;let a=o.get(i);if(!a){const c=(n=Qa(s)[0])==null?void 0:n.id;a={id:i,label:hd(s),source:"manifest",entries:[],...c?{collection:c}:{}},o.set(i,a)}a.entries.push(...Ja(s,i,r.id))}e=[...o.values()].filter(r=>r.entries.length),gi.set(t,e)}return e}const vi=new WeakMap,ec=[];function jv(t){if(!t)return ec;let e=vi.get(t);return e||(e=At(t).canvases.flatMap(n=>H(n.annotations).filter(o=>o==null?void 0:o.id).map(o=>({id:String(o.id),canvasId:String(n.id),fetched:Array.isArray(o.items)}))),vi.set(t,e)),e}const Yo=new WeakMap,Jo=new WeakMap;function nc(t,e=pd){var n;if(!Jo.has(e)){const o=e.filter(s=>s.content),r=(n=o[0])==null?void 0:n.content;Jo.set(e,r?{id:r.id,type:r.type,...r.label?{label:r.label}:{},pages:ec,entries:o.flatMap(s=>s.entries)}:null)}return Jo.get(e)??md(t)}const pd=[];function md(t){var r;if(!t)return null;if(Yo.has(t))return Yo.get(t);const e=At(t).canvases.flatMap(s=>H(s.annotations).flatMap(i=>Qa(i).map(a=>({part:a,page:i,canvas:s})))),n=(r=e[0])==null?void 0:r.part.id,o=n?(()=>{var l,u;const s=e.filter(({part:d})=>d.id===n),i=(l=s.find(({part:d})=>d.label))==null?void 0:l.part.label,a=Number((u=s.find(({part:d})=>d.total))==null?void 0:u.part.total),c=tc(t);return{id:n,type:"AnnotationCollection",...i?{label:i}:{},...a>0?{total:a}:{},pages:s.map(({page:d,canvas:h})=>({id:String(d.id),canvasId:String(h.id),fetched:Array.isArray(d.items)})),entries:s.flatMap(({page:d})=>{var h;return((h=c.find(p=>p.id===d.id))==null?void 0:h.entries)??[]})}})():null;return Yo.set(t,o),o}const yi=new WeakMap,bi=[];function Qr(t,e){const n=tc(t);if(!e.length)return n.length?n:bi;const o=t??bi;let r=yi.get(o);r||yi.set(o,r=new Map);let s=r.get(e);if(!s){const i=new Set(n.map(a=>a.id));s=[...n,...e.filter(a=>!i.has(a.id)&&!!i.add(a.id))],r.set(e,s)}return s}const _i=new WeakMap;function oc(t,e,n,o=null){const r=Qr(t,e),s=n!=null&&n.entries.length?n:null;if(!o&&!s)return r;let i=_i.get(r);i||_i.set(r,i=new Map);let a=i.get(o);a||i.set(o,a=new Map);let c=a.get(s);return c||(c=[...r,...o?[o]:[],...s?[s]:[]],a.set(s,c)),c}const gd=t=>Number(t==null?void 0:t.duration)>0;function rc(t,e){return t.source==="search"||!t.entries.length?false:t.entries.every(n=>Xu(n.motivation,n.target)&&!gd(e(n.canvasId)))}const wi=new WeakMap;function vd(t,e){const n=Qr(t,e);let o=wi.get(n);if(!o){const r=n.filter(s=>!rc(s,i=>He(t,i)??void 0));o=r.length===n.length?n:r,wi.set(n,o)}return o}const xi=new WeakMap;function ts(t,e,n,o){const r=Qr(t,e),s=xi.get(r);if(s&&s.hidden===n&&s.shown===o)return s.ids;const i=r.filter(c=>!n.includes(c.id)&&!o.includes(c.id)&&rc(c,l=>He(t,l)??void 0)).map(c=>c.id),a=i.length?[...n,...i]:n;return xi.set(r,{hidden:n,shown:o,ids:a}),a}const Si=new WeakMap;function yd(t,e,n,o){const r=ts(t,e,n,o),s=Si.get(r);if(s&&s.hidden===n)return s.ids;const i=[Jr,ud,...r.filter(a=>!n.includes(a))];return Si.set(r,{hidden:n,ids:i}),i}function bd(t){for(const e of H(t==null?void 0:t.target)){const n=(e==null?void 0:e.type)==="SpecificResource"?e.source:e,o=H(n==null?void 0:n.partOf).find(r=>(r==null?void 0:r.id)&&(!r.type||r.type==="Manifest"));if(o)return o.id}}function Qo(t,e){if(!e)return null;for(const n of t){const o=n.entries.find(r=>r.id===e);if(o)return o}return null}function sc(t){return btoa(encodeURIComponent(JSON.stringify(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ic({manifestId:t,canvasId:e,type:n="Canvas",region:o,time:r}){const s={id:e,type:n,...t&&t!==e?{partOf:[{id:t,type:"Manifest"}]}:{}},i=r!=null&&r>0?`t=${Math.round(r*100)/100}`:o?`xywh=${[o.x,o.y,o.w,o.h].map(Math.round).join(",")}`:null,a={"@context":`http://iiif.io/api/presentation/${n==="Canvas"?3:4}/context.json`,id:`${e}#content-state`,type:"Annotation",motivation:["contentState"],target:i?{type:"SpecificResource",source:s,selector:{type:"FragmentSelector",value:i}}:s};return{json:a,encoded:sc(a)}}const _d=Object.freeze(Object.defineProperty({__proto__:null,buildContentState:ic,encodeContentState:sc},Symbol.toStringTag,{value:"Module"})),wd=/iiif\.io\/api\/presentation\/4\/context\.json/;function ac(t){const e=t==null?void 0:t["@context"];return(Array.isArray(e)?e:[e]).some(o=>typeof o=="string"&&wd.test(o))}let ki=null,Ci=null;function es(){return Ci??(Ci=import("../upgrade-eNW0DPXq.mjs")),ki??(ki=import("../upgrader-BlbMUEH6.mjs").then(({upgradePresentation3To4:t})=>t)),Promise.all([ki,Ci])}async function ze(t){if(ac(t))return t;const[e,{upgrade:n}]=await es();return await n(t,e)}function ns(t,e,n={}){return((t==null?void 0:t.fetch)??globalThis.fetch)(e,{credentials:(t==null?void 0:t.credentials)??"same-origin",...n,headers:{...n.headers,...t==null?void 0:t.headers}})}const xd=t=>(t==null?void 0:t.credentials)==="include",Sd=t=>JSON.stringify([t==null?void 0:t.credentials,t==null?void 0:t.headers]);class kd extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="CloverRequestError"}}async function an(t,e,n){const o=await ns(t,e,{signal:n,headers:{Accept:"application/ld+json, application/json"}});if(!o.ok)throw new kd(`${e} answered ${o.status}`,e,o.status);return o.json()}const Ei=()=>import("./content-state-reader-BTZKS9Hq.mjs");function Mi(t){const e=t;return!e||typeof e!="object"?false:e.type==="Annotation"?H(e.motivation).includes("contentState"):e.type==="SpecificResource"}const Cd=["summary","metadata","requiredStatement","rights","provider","homepage","seeAlso","rendering","thumbnail","navDate","partOf"];function Ed(t){const e={"@context":Td,id:t.id,type:"Manifest",label:t.label??{none:[""]},items:[t]};for(const n of Cd)t[n]!==void 0&&n!=="label"&&(e[n]=t[n]);return e}const Ti=t=>{var e,n;return!!t&&((n=(e=t.items)==null?void 0:e[0])==null?void 0:n.id)===t.id},Md=/^(oa:)?Annotation(Page|Collection)$/;class eo extends Error{constructor(){super(...arguments);I(this,"name","CloverContentError")}}const Td="http://iiif.io/api/presentation/4/context.json",Id=t=>/^https?:\/\//i.test(t);async function Sr(t,{request:e,signal:n}){return Array.isArray(t.items)&&t.items.length>0||!t.id?t:await an(e,t.id,n)}const Pd=50;async function os(t,e){const n=t;if(Array.isArray(n.items)&&n.items.length||!n.first)return t;const o=[],r=new Set;let s=n.first;for(let i=0;s&&i<Pd;i++){const a=typeof s=="string"?{id:s}:s;if(r.has(a.id??a))break;r.add(a.id??a);const c=a.items?a:await an(e.request,a.id,e.signal),l=await ze({"@context":c["@context"]??n["@context"],...c,type:"Collection"});o.push(...l.items??[]),s=c.next}return{...n,items:o}}async function cc(t,e={}){return ze(await Sr(t,e))}async function lc(t,e,n=0){for(const o of t.items??[]){if(o.type==="Manifest")return ze(await Sr(o,e));if(o.type==="Collection"&&n<8){const r=await os(await ze(await Sr(o,e)),e),s=await lc(r,e,n+1);if(s)return s}}return null}async function Ld(t,{request:e,signal:n}={}){es();const o=typeof t=="string"?await an(e,t.trim(),n):t,r=await ze(o);return r.type==="Collection"?os(r,{request:e,signal:n}):r}async function Ad(t,e={}){var d;const{request:n,signal:o}=e;es();let r,s,i,a,c;const l=async h=>{const{resolveContentState:p}=await Ei(),m=p(h);if(!m)throw new eo("Unreadable content state");return r=m.target??r,s=m.manifestId??s,i=m.annotation??i,a=m.targets??a,an(n,m.id,o)};if(typeof t=="string")if(Id(t.trim()))c=await an(n,t.trim(),o);else{const{decodeContentState:h}=await Ei(),p=h(t);if(!p)throw new eo("Unreadable iiifContent");c=Mi(p)?await l(p):p}else c=t;if(Mi(c)&&(c=await l(c)),Md.test(String((c==null?void 0:c.type)??""))){const{annotationsContent:h}=await import("./annotations-content-CysDLy4t.mjs");return h(c,e)}const u=await ze(c);switch((d=o==null?void 0:o.throwIfAborted)==null||d.call(o),u.type){case"Manifest":return{manifest:u,target:r,annotation:i,targets:a};case"Collection":{const h=await os(u,e),p=e.manifestId??s,m=p?(h.items??[]).find(b=>b.id===p&&b.type==="Manifest"):void 0,g=m?await cc(m,e):await lc(h,e);if(!g)throw new eo("The Collection holds no Manifest");return{manifest:g,collection:h,target:r,annotation:i,targets:a}}case"Canvas":case"Timeline":case"Scene":{const h=u;return r??(r={canvasId:h.id}),{manifest:Ed(h),target:r,annotation:i}}default:throw new eo(`Cannot show a ${String(u.type??"resource without a type")}`)}}const uc=t=>!!(t!=null&&t.id)&&t.type==="AnnotationPage"&&!t.items;function Ii(t){const e=[];for(const n of t)for(const o of["items","annotations"])for(const r of n[o]??[])uc(r)&&e.push([n.id,o,r.id]);return e}async function Od(t,e,n,o){return Nd(await an(n,t,o),e)}async function Nd(t,e="urn:clover:annotation-page"){var r;const n=t;return ac(n)?n:((r=(await ze({"@context":n["@context"]??"http://iiif.io/api/presentation/3/context.json",id:e,type:"Canvas",items:[{...n,"@context":void 0}]})).items)==null?void 0:r[0])??n}function Rd(t,e){const n=t,o=e,r=c=>Array.isArray(c)?c:c?[c]:[],s=r(n.partOf),i=r(o.partOf),a=[...s.map(c=>({...i.find(l=>l.id&&l.id===c.id),...c})),...i.filter(c=>!s.some(l=>l.id===c.id))];return{...t,...n.label===void 0&&o.label!==void 0&&{label:o.label},...a.length&&{partOf:a}}}function Bd(t,e,n,o){let r=false;const s=(t.items??[]).map(i=>{if(i.id!==e||!Array.isArray(i[n]))return i;const a=i[n].map(c=>c.id!==o.id||!uc(c)?c:(r=true,Rd(o,c)));return r?{...i,[n]:a}:i});return r?{...t,items:s}:t}function $d(t){let e=t;const n=new Set;return{get:()=>e,set(o){const r=typeof o=="function"?o(e):o;Object.keys(r).some(i=>!Object.is(r[i],e[i]))&&(e={...e,...r},n.forEach(i=>i()))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function Xe(t){let e=t;const n=new Set;return{get:()=>e,emit(o){e=o,n.forEach(r=>r(o))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function Fd(t,e,n){return{position:e,total:n,hasPrevious:e>0,hasNext:e+1<n,previous:()=>t.previous(),next:()=>t.next(),first:()=>t.first(),last:()=>t.last(),goTo:o=>t.goTo(o)}}const kr={query:"",status:"idle",hits:[],set:null},Pi={status:"idle",error:null,manifest:null,collection:null,throughCollection:false,canvasId:null,target:null,annotationId:null,hiddenSets:[],shownSets:[],addedSets:[],search:kr,regions:null,targets:null,targetIndex:null};function Dd(t={}){const e=$d(Pi),n=Xe(null),o=Xe(null),r=Xe(null),s=Xe(null),i=Xe(null),a=Xe(null);let c=null,l=null,u=[],d=[],h=[],p=0,m=null,g=null,b=null;const v=(y,C)=>{!g||y===C||(g={...g,items:g.items.map(L=>L.manifestId===y&&L.manifestAs!==C?{...L,manifestAs:C}:L)})},w=y=>{var L;const C=(L=e.get().manifest)==null?void 0:L.id;return!!C&&(C===y.manifestId||C===y.manifestAs)},_=()=>u.length||d.length||h.length?[...u,...d,...h]:Pi.addedSets;let x=t.request,S=null;const M=new Set;let R="view",N=0;const J=(y,C,L)=>{if(M.has(L))return;M.add(L);const F=S==null?void 0:S.signal;Od(L,y,x,F).then(O=>{F!=null&&F.aborted||e.set(P=>P.manifest?{manifest:Bd(P.manifest,y,C,O)}:{})}).catch(()=>M.delete(L))},et=()=>{const{manifest:y,canvasId:C}=e.get();if(y)for(const[L,F,O]of Ii(R==="all"||N>0?At(y).canvases:De(y,C)))J(L,F,O)};e.subscribe(et);const X=(y,C,L,F,O)=>{var q,rt,Q;const{canvases:P}=At(y),U=wt=>!!wt&&P.some(Bt=>Bt.id===wt),K=td(y),yt=U(L==null?void 0:L.canvasId)?L:U(K==null?void 0:K.canvasId)?K:null,tt=U(F.canvasId)?F.canvasId:(yt==null?void 0:yt.canvasId)??(U(F.defaultCanvasId)?F.defaultCanvasId:null)??((q=P[0])==null?void 0:q.id)??null;l==null||l.abort();const pt=O&&((rt=Qo(h,O))==null?void 0:rt.canvasId)===tt?O:null,ft=yt&&pt?{...yt,region:void 0}:yt,Ht=++p;u=[],e.set({status:"ready",search:kr,regions:null,manifest:y,collection:C,canvasId:tt,target:ft&&ft.canvasId===tt?ft:null,addedSets:_(),annotationId:pt,targets:g});const Nt=y==null?void 0:y.structures;Array.isArray(Nt)&&JSON.stringify(Nt).includes("xywh=")&&import("./range-regions-CiceyEuu.mjs").then(({contentsSet:wt})=>{p===Ht&&e.set({regions:wt(y)})}),fd(y)&&import("./image-layers-DGa5HJt8.mjs").then(({imageLayers:wt})=>{p===Ht&&(u=wt(y),e.set({addedSets:_()}))}),tt&&tt!==F.canvasId&&((Q=t.onCanvasChange)==null||Q.call(t,tt))},V=(y,C)=>e.set(L=>{const F=L.hiddenSets.filter(P=>P!==y),O=L.shownSets.filter(P=>P!==y);return C?{hiddenSets:F,shownSets:[...O,y]}:{hiddenSets:[...F,y],shownSets:O}}),T=(y,C)=>{var F,O,P;if(!y)return;if((F=t.isControlled)!=null&&F.call(t)){C&&e.set({target:C}),(O=t.onCanvasChange)==null||O.call(t,y);return}const L=e.get().canvasId!==y;e.set({canvasId:y,target:C}),L&&((P=t.onCanvasChange)==null||P.call(t,y))},E=(y,C=false)=>{const{manifest:L}=e.get(),F=Qu(L,y);T(F,F&&C?{canvasId:F,autoplay:C}:null)},A=()=>{const{manifest:y,canvasId:C}=e.get();return{at:On(y,C),total:At(y).views.length}},W=()=>{S==null||S.abort();const y=new AbortController;return S=y,M.clear(),e.set({status:"loading",error:null,annotationId:null}),y.signal},G=y=>e.set({status:"error",error:y instanceof Error?y:new Error(String(y))});async function Y(y,C={}){var F;const L=W();try{const O=await Ad(y,{request:x,signal:L,manifestId:C.manifestId??void 0});if(L.aborted)return;const P=O.annotation,U=P?Ja({items:[P]},`${P.id}#content-state`):[];h=U.length?[{id:`${P.id}#content-state`,source:"added",entries:U}]:O.annotationSets??[];const K=m??((F=U[0])==null?void 0:F.id)??O.pick;m=null,e.set({throughCollection:!!O.collection}),g=O.targets??null,g&&v(g.items[0].manifestId,O.manifest.id),e.set({targetIndex:g?0:null}),X(O.manifest,O.collection??null,O.target,C,K)}catch(O){L.aborted||G(O)}}const st=y=>{const{manifest:C,collection:L}=e.get();return(C==null?void 0:C.id)===y||(L==null?void 0:L.id)===y},St=y=>{var C;return(((C=e.get().collection)==null?void 0:C.items)??[]).find(L=>L.id===y)??{id:y,type:"Manifest"}},ot=(y,C)=>{var L,F;if(m=C,(L=t.isManifestControlled)!=null&&L.call(t)){(F=t.onManifestChange)==null||F.call(t,y);return}ct({id:y,type:"Manifest"}).then(O=>{var P;return O&&((P=t.onManifestChange)==null?void 0:P.call(t,y))})},ct=async(y,C)=>{if(y.type==="Collection")return await Y(y.id),e.get().status==="ready";const{collection:L}=e.get(),F=W(),O=m;m=null;const P=O?Qo(h,O):null,U=typeof C=="string"?{canvasId:C}:C??b;b=null;try{const K=await cc(y,{request:x,signal:F});return F.aborted?false:(v(y.id,K.id),X(K,L,P?{canvasId:P.canvasId}:U??void 0,{},O),true)}catch(K){return F.aborted||G(K),false}};return{store:e,viewport:n,media:o,captions:r,highlight:s,chapter:i,found:a,get request(){return x},setRequest(y){x=y},load:Y,async openCollection(y){var L;const C=e.get().manifest;if(!(!C||((L=e.get().collection)==null?void 0:L.id)===y))try{const F=await Ld(y,{request:x});if(F.type!=="Collection"||e.get().manifest!==C)return;e.set({collection:F})}catch{}},async goToManifest(y,C){var F,O,P;if(st(y))return;const L=St(y);if(L.type!=="Collection"&&((F=t.isManifestControlled)!=null&&F.call(t))){(O=t.onManifestChange)==null||O.call(t,y);return}await ct(L,C)&&((P=t.onManifestChange)==null||P.call(t,e.get().manifest.id))},goToTarget(y){var F,O,P;const C=(F=e.get().targets)==null?void 0:F.items[y];if(!C)return;e.set({targetIndex:y});const L=C.canvasId?{canvasId:C.canvasId,...C.region&&{region:C.region},...C.time!==void 0&&{time:C.time}}:null;if(w(C)){L&&T(L.canvasId,L);return}if((O=t.isManifestControlled)!=null&&O.call(t)){b=L,(P=t.onManifestChange)==null||P.call(t,C.manifestId);return}ct(St(C.manifestId),L??void 0).then(U=>{var K;return U&&((K=t.onManifestChange)==null?void 0:K.call(t,C.manifestId))})},async syncManifest(y){!y||st(y)||e.get().status!=="ready"||await ct(St(y))},goTo(y,C){T(y,C?{...C,canvasId:y}:null)},next({autoplay:y=false,wrap:C=false}={}){const{at:L,total:F}=A();L+1<F?E(L+1,y):C&&F>1&&E(0,y)},previous(){const{at:y}=A();y>0&&E(y-1)},first(){E(0)},last(){E(A().total-1)},consumeTarget(){e.set({target:null})},syncCanvas(y){y&&e.set({canvasId:y})},selectAnnotation(y){const{manifest:C,addedSets:L,canvasId:F,search:O,regions:P}=e.get(),U=Qo(oc(C,L,O.set,P),y);if(e.set({annotationId:U?y:null}),!U)return;a.emit(y);const{hiddenSets:K,shownSets:yt}=e.get();U.setId!==Jr&&ts(C,L,K,yt).includes(U.setId)&&V(U.setId,true);const tt=De(C,F).some(Ht=>Ht.id===U.canvasId),pt=He(C,U.canvasId)!==null;!tt&&pt&&T(U.canvasId,null);const ft=pt?void 0:bd(U.annotation);ft&&ot(ft,U.id)},async search(y){l==null||l.abort();const C=Ya(e.get().manifest),L=y.trim();if(!L||!C){l=null,e.set({search:kr,annotationId:null});return}const F=new AbortController;l=F,e.set(O=>({search:{...O.search,query:L,status:"loading"}}));try{const{searchInto:O}=await import("./search-DBMO82DV.mjs");await O(e,C,L,x,F.signal)}catch{e.set({search:{query:L,status:"error",hits:[],set:null}})}},setSetVisible(y,C){V(y,C)},async loadAnnotations(y){if(c==null||c.abort(),!y){d=[],e.set({addedSets:_()});return}const C=new AbortController;c=C;try{const{loadAnnotationSets:L}=await import("./annotation-collection-vM0aeJgP.mjs"),F=await L(y,{request:x,signal:C.signal});if(C.signal.aborted)return;d=F,e.set({addedSets:_()})}catch{}},getContentState(){var tt;const{manifest:y,canvasId:C}=e.get();if(!y||!C)return null;const L=n.get(),F=o.get(),O=F&&F.currentTime>0?F.currentTime:null,P=De(y,C),K=L&&P.some(pt=>pt.id===L.canvasId)&&!O?L:null,yt=(K==null?void 0:K.canvasId)??C;return ic({manifestId:y.id,canvasId:yt,type:(tt=P.find(pt=>pt.id===yt))==null?void 0:tt.type,region:K==null?void 0:K.region,time:O})},setAnnotationPages(y){y!==R&&(R=y,et())},fetchAnnotationPages(y){const{manifest:C}=e.get();if(!C||!y.length)return;const L=new Set(y);for(const[F,O,P]of Ii(At(C).canvases))L.has(P)&&J(F,O,P)},holdAllAnnotationPages(){N++,et();let y=true;return()=>{y&&N--,y=false}},dispose(){S==null||S.abort(),c==null||c.abort(),l==null||l.abort()}}}const zd=100;function dc(t,e){const n=$({read:t,onChange:e});n.current={read:t,onChange:e};const o=$(void 0),r=$("");return D(()=>()=>{clearTimeout(o.current),o.current=void 0},[]),dt(()=>{!n.current.onChange||o.current!==void 0||(o.current=setTimeout(()=>{var i,a;o.current=void 0;const s=n.current.read();!s||s.encoded===r.current||(r.current=s.encoded,(a=(i=n.current).onChange)==null||a.call(i,s))},zd))},[])}function Cr(t,e){return t==null||t.addEventListener("pause",e),t==null||t.addEventListener("seeked",e),()=>{t==null||t.removeEventListener("pause",e),t==null||t.removeEventListener("seeked",e)}}function fc(t,e){const n=dc(()=>t.getContentState(),e),o=!!e;D(()=>{if(!o)return;let r=t.store.get().canvasId;const s=t.store.subscribe(()=>{const l=t.store.get().canvasId;l!==r&&(r=l,n())}),i=t.viewport.subscribe(n);let a=Cr(t.media.get(),n);const c=t.media.subscribe(l=>{a(),a=Cr(l,n)});return n(),()=>{s(),i(),c(),a()}},[t,o,n])}function rs(t){const e=[];for(const n of H(t==null?void 0:t.items))for(const o of H(n==null?void 0:n.items))if(Yr(o))for(let r of xo(o))(r==null?void 0:r.type)==="Choice"&&(r=H(r.items)[0]),(r==null?void 0:r.type)==="SpecificResource"&&(r=typeof r.source=="string"?{id:r.source}:r.source),r&&e.push({body:r,annotation:o});return e}function Hd(t){return t.flatMap(e=>rs(e).map(({body:n})=>n))}function Wd(t,e){if(!(t!=null&&t.length)||!e.canvases.length)return null;const n=e.canvases.map(r=>r.id),o=e.bodies.map(r=>r==null?void 0:r.format).filter(Boolean);return t.find(r=>{var s,i,a;return((s=r.canvasId)==null?void 0:s.some(c=>n.includes(c)))||((i=r.format)==null?void 0:i.some(c=>o.includes(c)))||!!((a=r.match)!=null&&a.call(r,e))})??null}function Ud(t,e){return t===e?true:!t||!e||t.length!==e.length?false:t.every((n,o)=>n.component===e[o].component&&n.match===e[o].match&&JSON.stringify([n.canvasId,n.format])===JSON.stringify([e[o].canvasId,e[o].format]))}function jd({iiifContent:t,canvasId:e,defaultCanvasId:n,onCanvasChange:o,onStatusChange:r,manifestId:s,defaultManifestId:i,onManifestChange:a,searchQuery:c,request:l,language:u,renderers:d,annotations:h,annotationPages:p="view",onContentStateChange:m,...g}){const b=e!==void 0,v=s!==void 0,w=$({controlled:b,manifestControlled:v,onCanvasChange:o,onStatusChange:r,onManifestChange:a});w.current={controlled:b,manifestControlled:v,onCanvasChange:o,onStatusChange:r,onManifestChange:a};const[_]=z(()=>Dd({request:l,onCanvasChange:ot=>{var ct,y;return(y=(ct=w.current).onCanvasChange)==null?void 0:y.call(ct,ot)},onManifestChange:ot=>{var ct,y;return(y=(ct=w.current).onManifestChange)==null?void 0:y.call(ct,ot)},isControlled:()=>w.current.controlled,isManifestControlled:()=>w.current.manifestControlled}));_.setRequest(l);const x=$({});x.current={canvasId:e,defaultCanvasId:n,manifestId:s??i};const S=Sd(l),M=$(t);M.current=t;const R=Kd(t);D(()=>(_.load(M.current,x.current),()=>_.dispose()),[_,R,S]),D(()=>{b&&_.syncCanvas(e??null)},[_,b,e]);const[N,J]=z(_.store.get().status);D(()=>{let ot=_.store.get().status;return _.store.subscribe(()=>{var C,L;const{status:ct,error:y}=_.store.get();ct!==ot&&(ot=ct,J(ct),(L=(C=w.current).onStatusChange)==null||L.call(C,ct,y))})},[_]);const et=$(h);et.current=h;const X=qd(h);D(()=>{_.loadAnnotations(et.current??null)},[_,X,S]),D(()=>{_.setAnnotationPages(p)},[_,p]),fc(_,m),D(()=>{v&&N==="ready"&&_.syncManifest(s??null)},[_,v,s,N]);const V=Vd(_,ot=>{var ct;return ot.status==="ready"?((ct=ot.manifest)==null?void 0:ct.id)??null:null});D(()=>{c&&V&&_.search(c)},[_,c,V]);const T=$(d);Ud(T.current,d)||(T.current=d);const E=T.current,[A,W]=z(),[G,Y]=z(u);G!==u&&(Y(u),W(void 0));const st=A??u;return[vt(()=>({clover:_,language:st,renderers:E,chooseLanguage:W}),[_,st,E]),N,g]}function Vd(t,e){return ee(t.store.subscribe,()=>e(t.store.get()))}function qd(t){const e=Array.isArray(t)?t:t?[t]:[];return JSON.stringify(e.map(n=>typeof n=="string"?n:(n==null?void 0:n.id)??"object"))}function Kd(t){return typeof t=="string"?t:t.id??t["@id"]??t}const Zd=oe(function({as:e="div",className:n,children:o,highContrast:r,...s},i){const[a,c,l]=jd(s),u=wo(i,l.lang),d=qr(r);return f(bo.Provider,{value:a,children:f(Pn.Provider,{value:u.hostLanguage,children:f(e,{ref:u.ref,className:Mt("clover-root",n),"data-status":c,...Kr(d),...l,children:[o,f(ad,{clover:a.clover,language:a.language})]})})})}),Gd=()=>f("path",{fillRule:"evenodd",stroke:"none",d:"M144 72H368A96 96 0 0 1 464 168V296A96 96 0 0 1 368 392H200L104 460L144 392A96 96 0 0 1 48 296V168A96 96 0 0 1 144 72Z M168 184H344A16 16 0 0 1 344 216H168A16 16 0 0 1 168 184Z M168 264H280A16 16 0 0 1 280 296H168A16 16 0 0 1 168 264Z"}),Xd=()=>f(Ct,{children:[f("path",{d:"M160 144h288M160 256h288M160 368h288",fill:"none",strokeLinecap:"round",strokeWidth:"32"}),f("circle",{cx:"80",cy:"144",r:"20",stroke:"none"}),f("circle",{cx:"80",cy:"256",r:"20",stroke:"none"}),f("circle",{cx:"80",cy:"368",r:"20",stroke:"none"})]}),Yd=()=>f("path",{stroke:"none",d:"M256 72A48 48 0 1 1 256 168A48 48 0 1 1 256 72Z M192 216H296V384H328V432H184V384H216V264H192Z"}),Jd=()=>f("path",{fillRule:"evenodd",stroke:"none",d:"M256 40C166 40 100 108 100 196C100 300 216 420 246 452A14 14 0 0 0 266 452C296 420 412 300 412 196C412 108 346 40 256 40Z M256 136A60 60 0 1 1 256 256A60 60 0 1 1 256 136Z"}),Vv=()=>f("path",{strokeLinejoin:"round",strokeWidth:"40",d:"M184 128V384L392 256Z"}),hc=()=>f("path",{strokeLinecap:"round",strokeWidth:"45",d:"M154 154L358 358M358 154L154 358"}),qv=()=>f(Ct,{children:[f("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),f("path",{stroke:"none",d:"m279.5,197.76h-3.35s-28.47,0-28.47,0v-31.82c-.77-13.79-12.57-24.33-26.36-23.56-12.71.71-22.85,10.86-23.56,23.56v3.35h0v28.47h-31.82c-13.79.77-24.33,12.57-23.56,26.36.71,12.71,10.86,22.85,23.56,23.56h3.35s28.47,0,28.47,0v31.82c.77,13.79,12.57,24.33,26.36,23.56,12.71-.71,22.85-10.86,23.56-23.56v-3.35h0v-28.47h31.82c13.79-.77,24.33-12.57,23.56-26.36-.71-12.71-10.86-22.85-23.56-23.56Z"})]}),Kv=()=>f(Ct,{children:[f("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),f("path",{stroke:"none",d:"M167.26 197.76H278.1a24.96 24.96 0 0 1 0 49.92H167.26a24.96 24.96 0 0 1 0-49.92Z"})]}),Gt={zoomIn:{keys:"Plus",glyph:"+"},zoomOut:{keys:"-",glyph:"\u2212"},reset:{keys:"0",glyph:"0"},rotateRight:{keys:"R",glyph:"R"},rotateLeft:{keys:"Shift+R",glyph:"\u21E7R"},play:{keys:"K Space",glyph:"K"},mute:{keys:"M",glyph:"M"}},Qd=new Set(["+","=","-","_","0","r","R","k","K","m","M","j","J","l","L"]);function We({label:t,lang:e,shortcut:n,scrolls:o=false,image:r,lead:s,after:i}){const{t:a}=Pt(),c=$(null),l=n?a("controlShortcut",{label:t,shortcut:n.glyph}):t;return ef(),D(()=>{const u=c.current;u&&Er(u)&&lo(u)},[l,s]),f("span",{ref:c,className:"clover-tip","aria-hidden":"true",...ut(e),...o&&{tabIndex:-1,onMouseDown:u=>{var d;u.preventDefault(),(d=u.currentTarget.parentElement)==null||d.focus({preventScroll:true})}},children:[r&&f("img",{className:"clover-tip-image",src:r,alt:"",loading:"lazy",onLoad:()=>{const u=c.current;u&&Er(u)&&lo(u)}}),s&&f("span",{className:"clover-tip-lead",children:s}),l,i!=null&&i!==false&&f("span",{className:"clover-tip-after",children:i})]})}function no(t){const e=t.target instanceof Element&&ss(t.target),n=e&&So(e);n&&lo(n)}function Zv(t){const e=So(ss(t));e&&Er(e)&&lo(e)}function So(t){return Array.from(t.children).find(e=>e.classList.contains("clover-tip"))}function ss(t){const e=t.matches("input")?t.parentElement:null;return e&&So(e)?e:t}function Er(t){var e;try{return!!((e=t.parentElement)!=null&&e.matches(":hover, :focus-visible, :has(> input:focus-visible)"))}catch{return false}}function lo(t){const e=t.parentElement;if(!e)return;t.style.removeProperty("--clover-tip-room"),t.style.removeProperty("--clover-tip-shift");const n=tf(e),o=parseFloat(getComputedStyle(t).paddingLeft)||0,r=n.left+o,s=n.right-o,i=e.getBoundingClientRect();let a=t.getBoundingClientRect();const c=a.right<=i.left?a.right-r:a.left>=i.right?s-a.left:s-r;a.width>c&&(t.style.setProperty("--clover-tip-room",`${Math.max(c,0)}px`),a=t.getBoundingClientRect());const l=a.left<r?r-a.left:a.right>s?s-a.right:0;l&&t.style.setProperty("--clover-tip-shift",`${l}px`)}function tf(t){let e=0,n=document.documentElement.clientWidth||window.innerWidth;for(let o=t.parentElement;o&&o!==document.documentElement;o=o.parentElement){const{display:r,overflow:s,overflowX:i}=getComputedStyle(o);if(r==="inline"||r==="contents")continue;const a=i||s;if(!a||a==="visible")continue;const c=o.getBoundingClientRect();e=Math.max(e,c.left+o.clientLeft),n=Math.min(n,c.left+o.clientLeft+o.clientWidth)}return{left:e,right:n}}let Li=0;function Ai(t){if(t.key!=="Escape")return;const e=new Set;document.querySelectorAll(":hover > .clover-tip").forEach(r=>r.parentElement&&e.add(r.parentElement));const n=document.activeElement,o=n&&ss(n);o&&So(o)&&e.add(o),e.forEach(r=>pc(r,"tipHidden",["pointerenter","focusout"]))}function pc(t,e,n){t.dataset[e]="";const o=()=>{delete t.dataset[e],n.forEach(r=>t.removeEventListener(r,o))};n.forEach(r=>t.addEventListener(r,o))}function ef(){D(()=>(Li++===0&&(document.addEventListener("keydown",Ai,true),document.addEventListener("pointerenter",no,true),document.addEventListener("focus",no,true)),()=>{--Li||(document.removeEventListener("keydown",Ai,true),document.removeEventListener("pointerenter",no,true),document.removeEventListener("focus",no,true))}),[])}function nf(t,e){const n=t.target;!e||n===e||e.contains(n)||Qd.has(t.key)&&(t.altKey||t.metaKey||t.ctrlKey||n.closest("input, select, textarea, [contenteditable]")||(t.preventDefault(),e.dispatchEvent(new KeyboardEvent("keydown",{key:t.key,shiftKey:t.shiftKey,bubbles:true,cancelable:true}))))}const Fe=({className:t,id:e,label:n,children:o,onClick:r,expanded:s,controls:i,shortcut:a,lang:c,unavailable:l})=>{const d=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return f("button",{id:e,className:Mt("clover-canvas-button",t),"data-testid":"clover-canvas-button","data-button":d,onClick:r,"aria-disabled":l||void 0,"aria-expanded":s,"aria-controls":i,"aria-label":n,"aria-keyshortcuts":a==null?void 0:a.keys,...ut(c),type:"button",children:[f("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:o}),f(We,{label:n,shortcut:a})]})},of=ue("");function fe(){return zt(of)+Ur()}const tr=new Map;function rf(t,e){const n=fe(),o=$(e);o.current=e,D(()=>t?sf(n,o):void 0,[t,n])}function sf(t,e){for(const[n,o]of[...tr])n!==t&&o.current();return tr.set(t,e),()=>{tr.delete(t)}}const af=mt(()=>import("./CaptionDetails-BVCqV9NT.mjs"));function cf(t){var e;return!!t.summary||!!((e=t.metadata)!=null&&e.length)}const mc=(t,e)=>`${t}-label-${e}`,lf=({id:t,canvases:e,comments:n,open:o,onClose:r,language:s})=>{const{t:i,langOf:a}=Pt(),c=$(null),[l,u]=z(o);return o&&!l&&u(true),rf(o,()=>r(false)),D(()=>{var d;o&&((d=c.current)==null||d.focus())},[o]),f("figcaption",{className:"clover-canvas-caption","data-open":o,"data-testid":"clover-canvas-caption",id:t,onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),r(true))},ref:c,tabIndex:-1,children:[f(Fe,{className:"clover-canvas-caption-close",id:`close-${t}`,label:i("commonClose"),lang:a("commonClose"),onClick:()=>r(true),children:f(hc,{})}),e.map((d,h)=>{const p=bt(d.label,s);return f("section",{className:"clover-canvas-caption-canvas",children:[p.text&&f("p",{className:"clover-canvas-caption-label",id:mc(t,h),...ut(p.lang),children:p.text}),l&&f(_t,{fallback:null,children:f(af,{summary:d.summary,metadata:d.metadata,comments:n==null?void 0:n.get(d.id),language:s})})]},d.id)})]})},uf=()=>f("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M256 112v288M400 256H112"}),df=()=>f("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 256H112"}),ff=()=>f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"}),hf=()=>f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M304 416v-112h112M405.77 405.77L304 304M208 96v112H96M106.23 106.23L208 208M416 208H304V96M405.77 106.23L304 208M96 304h112v112M106.23 405.77L208 304"}),pf=()=>f("path",{d:"M448 440a16 16 0 01-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 01-27 11.57l-176-168a16 16 0 010-23.14l176-168A16 16 0 01256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 01-16 16z"}),Oi=()=>f(Ct,{children:[f("path",{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"}),f("path",{d:"M464 97.42V208a16 16 0 01-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"})]}),mf=()=>f(Ct,{children:[f("path",{fill:"none",strokeLinecap:"round",strokeWidth:"64",d:"M112 144h0M112 256h0M112 368h0"}),f("path",{fill:"none",strokeLinecap:"round",strokeWidth:"40",d:"M208 144h208M208 256h208M208 368h208"})]}),gf=({children:t,label:e})=>f("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512",fill:"currentColor",stroke:"currentColor",focusable:"false","aria-hidden":"true",role:"presentation","data-testid":"clover-canvas-button-svg","data-label":e,children:t}),vf=112,yf=128;function bf(t){Dt(()=>{const e=t==null?void 0:t.closest(".clover-canvas");if(!t||!e)return;const n=(s=false)=>{let i=t.offsetWidth,a=0;for(const p of s?[]:Array.from(t.children))!(p instanceof HTMLElement)||!p.offsetParent||(i=Math.min(i,p.offsetLeft),a=Math.max(a,p.offsetTop+p.offsetHeight));const c={width:t.offsetWidth-i,height:a};for(const[p,m]of Object.entries(c)){const g=`--clover-canvas-controls-${p}`;a?e.style.setProperty(g,`${m}px`):e.style.removeProperty(g)}const l=t.offsetTop,u=e.querySelector(":scope > .clover-canvas-media > .clover-canvas-transport"),d=e.clientHeight-2*l-c.height-((u==null?void 0:u.offsetHeight)??0),h=t.offsetLeft+i-l;a&&d<vf&&h>=yf?e.dataset.popups="beside":delete e.dataset.popups};n();const o=new ResizeObserver(()=>n());o.observe(t),o.observe(e);const r=new MutationObserver(()=>n());return r.observe(t,{childList:true}),r.observe(e,{childList:true}),()=>{o.disconnect(),r.disconnect(),n(true)}},[t])}const ko=()=>{if(typeof document>"u")return null;const t=document;return t.fullscreenElement??t.webkitFullscreenElement??null},gc=()=>{if(typeof document>"u")return false;const t=document;return!!(t.fullscreenEnabled??t.webkitFullscreenEnabled)},vc=t=>{const e=t==null?void 0:t.closest(".clover-root"),n=t==null?void 0:t.closest("dialog");return e&&!(n&&e.contains(n))?e:(t==null?void 0:t.closest(".clover-canvas"))??null},_f=(t,e)=>{if(typeof t.webkitEnterFullscreen!="function")return;const n=e.closest(".clover-canvas"),o=!t.isConnected&&!!n;if(o&&n){const s=t.getAttribute("style");t.style.cssText="position:absolute;inset:0;z-index:-1;width:100%;height:100%;object-fit:contain;pointer-events:none",n.prepend(t),t.addEventListener("webkitendfullscreen",()=>{t.remove(),s===null?t.removeAttribute("style"):t.setAttribute("style",s)},{once:true})}const r=()=>{var s;try{(s=t.webkitEnterFullscreen)==null||s.call(t)}catch{}};o?requestAnimationFrame(r):r()},yc=async(t,e)=>{var o,r,s,i;const n=vc(t);if(n)try{if(ko()){const c=document;await(((o=c.exitFullscreen)==null?void 0:o.call(c))??((r=c.webkitExitFullscreen)==null?void 0:r.call(c)));return}if(!gc()){e&&t&&_f(e,t);return}const a=n;await(((s=a.requestFullscreen)==null?void 0:s.call(a))??((i=a.webkitRequestFullscreen)==null?void 0:i.call(a)))}catch{}};function is(t){const[e,n]=z(false);return D(()=>{if(!t)return;const o=()=>{var r;return n(!!((r=ko())!=null&&r.contains(t)))};return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}function wf({key:t,id:e,label:n,glyph:o,onClick:r,expanded:s,controls:i,shortcut:a,lang:c,unavailable:l},u){const d=u==null?void 0:u[t];return d?f(d,{buttonProps:{id:e,type:"button","aria-label":n,...c&&{lang:c},...a&&{"aria-keyshortcuts":a.keys},onClick:l?void 0:r,...l&&{"aria-disabled":true},...s!==void 0&&{"aria-expanded":s,"aria-controls":i}},icon:f(gf,{label:n,children:o}),label:n,tip:f(We,{label:n,shortcut:a})},t):f(Fe,{id:e,label:n,onClick:l?void 0:r,unavailable:l,expanded:s,controls:i,shortcut:a,lang:c,children:o},t)}const xf=({fit:t=false,clusterRef:e,children:n})=>{const[o,r]=z(null),s=is(o);bf(o);const i=dt(a=>{r(a),e==null||e(a)},[e]);return f("div",{className:"clover-canvas-controls","data-fit":t||void 0,"data-fullscreen":s,"data-testid":"clover-canvas-controls",ref:i,children:n})},Sf=()=>()=>{};function kf(){return ee(Sf,gc)}const Ni=new WeakMap;function Je(t,e){const[n,o]=z(()=>Ni.get(t)??null);return D(()=>{if(!e||n)return;let r=true;return t().then(s=>{Ni.set(t,s),r&&o(()=>s)},()=>{}),()=>{r=false}},[t,e,n]),n}function Cf(t,e,n){return t.reduce((o,r)=>o+r+n,-n)<=e}function Ef(t,e,n){const o=t.ownerDocument,r=i=>i instanceof HTMLElement&&t.contains(i)&&!i.closest("[hidden]"),s=[o.getElementById(e),o.getElementById(n),...Array.from(t.querySelectorAll("button"))].find(r);s==null||s.focus()}function Mf({cluster:t,ids:e,more:n,fits:o,settled:r,onFits:s}){const i=$(o);i.current=o;const a=$(s);a.current=s;const c=$(new Map),l=$(e);l.current=e;const u=$(null),d=e.join(" ");return Dt(()=>{const h=t.ownerDocument,p=()=>{var R;const b=l.current,v=getComputedStyle(t),w=parseFloat(v.columnGap)||0;let _=t.clientWidth-(parseFloat(v.paddingLeft)||0)-(parseFloat(v.paddingRight)||0),x=0;for(const N of b){const J=(R=h.getElementById(N))==null?void 0:R.offsetWidth;J&&c.current.set(N,J),x=Math.max(x,c.current.get(N)??0)}for(const N of Array.from(t.children))!(N instanceof HTMLElement)||b.includes(N.id)||N.id===n||N.classList.contains("clover-canvas-more")||!N.offsetWidth||getComputedStyle(N).position==="absolute"||(_-=N.offsetWidth+w);const S=Cf(b.map(N=>c.current.get(N)??x),_,w);if(S===i.current)return;const M=h.activeElement;u.current=M instanceof HTMLElement&&t.contains(M)?M.id:null,i.current=S,a.current(S)};p();const m=new ResizeObserver(()=>p());m.observe(t);const g=new MutationObserver(()=>p());return g.observe(t,{childList:true}),()=>{m.disconnect(),g.disconnect()}},[t,d,n]),Dt(()=>{if(!r)return;const h=u.current;if(u.current=null,h===null)return;const p=t.ownerDocument.activeElement;(!p||!t.contains(p)||p.closest("[hidden]"))&&Ef(t,h,n)},[o,r,t,n]),null}const Tf=()=>import("./AnnotationMenu-BO18q_Ze.mjs"),If=()=>import("./ChaptersMenu-CIwIM2Pb.mjs"),Pf=()=>import("./ChoiceMenu-Ww7lcPnq.mjs"),Lf=()=>import("./ImageControls-BDx7C1q5.mjs"),Ri=2,Af=new Set(["zoomIn","zoomOut","rotateRight","rotateLeft","reset","fullPage"]),bc={atMax:false,atMin:false,atHome:false},Of=({renderer:t,instance:e,config:n,controlButtons:o,limits:r=bc,placeholder:s,placeholderIsMore:i=false,choices:a=[],selections:c={},onSelect:l,annotations:u=[],chapters:d=[],mediaElement:h=null,onChapter:p,overStill:m,request:g,hiddenPages:b,onPageVisibilityChange:v,selectedAnnotation:w=null,onAnnotationSelect:_,onAnnotationActivate:x,captionId:S,captionOpen:M=false,onCaptionToggle:R,placeId:N,placeOpen:J=false,onPlaceToggle:et,language:X,fit:V=true,more:T="auto",children:E})=>{var Hn,Wn,Oe,mn;const{t:A,langOf:W}=Pt(),[G,Y]=z(false),[st,St]=z(false),ot=`annotations-${e}`,ct=`${ot}-menu`,y=A("informationPanelTabsAnnotations"),C=W("informationPanelTabsAnnotations"),L=dt(j=>{var ht;St(false),x==null||x(null),j&&((ht=document.getElementById(ot))==null||ht.focus())},[ot,x]),F=n.annotations&&u.length>0&&_,[O,P]=z(false),U=`chapters-${e}`,K=`${U}-menu`,yt=d.length>0&&!!p,tt=$(false),pt=$(null);D(()=>{const j=()=>{var ht;tt.current=((ht=document.activeElement)==null?void 0:ht.id)===U};return document.addEventListener("focusin",j),()=>document.removeEventListener("focusin",j)},[U]);const ft=dt(()=>{var ht,Se;if(!tt.current)return;tt.current=false;const j=document.activeElement;j&&j!==document.body||(Se=(ht=pt.current)==null?void 0:ht.querySelector('.clover-canvas-transport :is([data-button="play"], [data-button="pause"])'))==null||Se.focus()},[]);D(()=>{yt||ft()},[yt,ft]),D(()=>()=>ft(),[ft]);const Ht=dt(j=>{var ht;P(false),j&&((ht=document.getElementById(U))==null||ht.focus())},[U]),Nt=n.information&&S&&R,q=n.map&&N&&et,rt=`choice-${e}`,Q=a.length===1?bt(a[0].label,X):null,wt=(Q==null?void 0:Q.text)||A("canvasChoice"),Bt=Q!=null&&Q.text?Q.lang:W("canvasChoice"),re=`${rt}-menu`,we=(Hn=Je(Tf,!!F))==null?void 0:Hn.default,B=(Wn=Je(If,yt))==null?void 0:Wn.default,lt=(Oe=Je(Pf,a.length>0&&!!l))==null?void 0:Oe.default,Ot=dt(j=>{var ht;Y(false),j&&((ht=document.getElementById(rt))==null||ht.focus())},[rt]),Po=kf(),[qt,Ue]=z(null);D(()=>{pt.current=(qt==null?void 0:qt.closest(".clover-canvas"))??null},[qt]);const je=is(qt),[he,Le]=z(false),$n=j=>f(Fe,{className:j,id:ot,label:y,lang:C,onClick:()=>St(ht=>!ht),expanded:st,controls:ct,children:f(Gd,{})},"annotations"),Fn=(()=>{const j=[],ht=t;return n.zoom&&ht&&j.push({key:"zoomIn",id:`zoomIn-${e}`,shortcut:Gt.zoomIn,label:A("imageZoomIn"),lang:W("imageZoomIn"),glyph:f(uf,{}),unavailable:r.atMax,onClick:()=>ht.zoomBy(Ri)},{key:"zoomOut",id:`zoomOut-${e}`,shortcut:Gt.zoomOut,label:A("imageZoomOut"),lang:W("imageZoomOut"),glyph:f(df,{}),unavailable:r.atMin,onClick:()=>ht.zoomBy(1/Ri)}),n.fullPage&&Po&&j.push({key:"fullPage",id:`fullPage-${e}`,label:A(je?"imageExitFullScreen":"imageFullScreen"),lang:W(je?"imageExitFullScreen":"imageFullScreen"),glyph:je?f(hf,{}):f(ff,{}),onClick:Se=>void yc(Se.currentTarget)}),n.rotation&&ht&&j.push({key:"rotateRight",id:`rotateRight-${e}`,shortcut:Gt.rotateRight,label:A("imageRotateRight"),lang:W("imageRotateRight"),glyph:f(Oi,{}),onClick:()=>ht.rotateBy(90)},{key:"rotateLeft",id:`rotateLeft-${e}`,shortcut:Gt.rotateLeft,label:A("imageRotateLeft"),lang:W("imageRotateLeft"),glyph:f(Oi,{}),onClick:()=>ht.rotateBy(-90)}),n.reset&&ht&&j.push({key:"reset",id:`reset-${e}`,shortcut:Gt.reset,label:A("imageResetZoom"),lang:W("imageResetZoom"),glyph:f(pf,{}),unavailable:r.atHome,onClick:()=>ht.home()}),a.length&&j.push({key:"choice",id:rt,label:wt,lang:Bt,glyph:f(mf,{}),onClick:()=>Y(Se=>!Se),expanded:G,controls:re}),j})(),Xt=[...Fn.filter(j=>j.key!=="fullPage"),...Fn.filter(j=>j.key==="fullPage")].map(j=>({id:j.id,view:Af.has(j.key),node:wf(j,o)})),fn=[q&&{id:`place-${e}`,view:false,node:f(Fe,{id:`place-${e}`,label:A("mapLabel"),lang:W("mapLabel"),onClick:et,expanded:J,controls:N,children:f(Jd,{})},"place")},yt&&{id:U,view:false,node:f(Fe,{id:U,label:A("playerChapters"),lang:W("playerChapters"),onClick:()=>P(j=>!j),expanded:O,controls:K,children:f(Xd,{})},"chapters")},F&&{id:ot,view:false,node:$n()},Nt&&{id:`information-${e}`,view:false,node:f(Fe,{id:`information-${e}`,label:A("informationPanelTabsAbout"),lang:W("informationPanelTabsAbout"),onClick:R,expanded:M,controls:S,children:f(Yd,{})},"information")},!!s&&{id:`placeholder-${e}`,view:false,node:f(ae.Fragment,{children:s},"placeholder")}].filter(j=>!!j),Dn=fn.filter(j=>j.id===`placeholder-${e}`),Wt=[...Xt.filter(j=>j.view),...Dn],hn=[...Xt.filter(j=>!j.view),...fn.filter(j=>!Dn.includes(j))],Yt=[...Wt,...hn],[Ae,Ao]=z(true),pn=T==="always"||i,Tt=(mn=Je(Lf,V&&(i||(pn||!Ae)&&Yt.some(j=>j.view))))==null?void 0:mn.ImageControls,Ut=Ae&&!pn||!Tt?[]:Yt.filter(j=>j.view),xe=i&&!!s&&!!Tt;D(()=>{Ut.length||Le(false)},[Ut.length]);const zn=j=>j.filter(ht=>!Ut.includes(ht)&&!(xe&&ht.id===`placeholder-${e}`)).map(({node:ht})=>ht);return f(Ct,{children:[f(xf,{fit:V,clusterRef:Ue,children:[zn(Wt),Tt&&(Ut.length>0||xe)&&f(Tt,{instance:e,open:xe?Ut.length>0:he,onOpenChange:Le,toggle:xe?s:void 0,children:Ut.map(({node:j})=>j)}),zn(hn),E]}),V&&!pn&&qt&&f(Mf,{cluster:qt,ids:Yt.map(({id:j})=>j),more:`more-${e}`,fits:Ae,settled:Ae||Ut.length>0||!Yt.some(j=>j.view),onFits:Ao}),B&&O&&yt&&f(B,{id:K,triggerId:U,label:A("playerChapters"),labelLang:W("playerChapters"),chapters:d,element:h,onChapter:p,overStill:m,request:g,onClose:Ht}),we&&st&&F&&f(we,{id:ct,triggerId:ot,label:y,labelLang:C,annotations:u,hiddenPages:b,onPageVisibilityChange:v,selected:w,onSelect:_,onActivate:j=>x==null?void 0:x(j),onClose:L}),lt&&G&&a.length>0&&l&&f(lt,{id:re,triggerId:rt,label:wt,labelLang:Bt,language:X,choices:a,selections:c,onSelect:l,onClose:Ot})]})},Nf=["jpg","png","webp","gif"];class Mr extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageServiceError"}}function as(t){return t.replace(/\/info\.json$/,"").replace(/\/+$/,"")}function Co(t){const e=Array.isArray(t)?t:t?[t]:[];for(const n of e){if(!n||typeof n!="object")continue;const o=n,r=String(o.type??o["@type"]??""),s=JSON.stringify(o.profile??""),i=/ImageService/i.test(r)||/iiif\.io\/api\/image/.test(s)||/^"level[012]"$/.test(s)||!r&&!o.profile,a=o["@id"]??o.id;if(i&&typeof a=="string")return as(a)}}function Rf(t,e){if(!t||typeof t!="object")throw new Mr("info.json is not an object",e??"");const n=t,o=Bf(n),r=o===3?n.id??n["@id"]:n["@id"]??n.id,s=as(r??e??""),i=Number(n.width),a=Number(n.height);if(!s||!(i>0)||!(a>0))throw new Mr("info.json is missing id, width or height",e??s);const c=Array.isArray(n.profile)?n.profile:[n.profile],l=c.find(w=>typeof w=="string"),u=c.filter(w=>!!w&&typeof w=="object"),d=$f(l),h=new Set([...Array.isArray(n.extraFeatures)?n.extraFeatures:[],...u.flatMap(w=>Array.isArray(w.supports)?w.supports:[])]),m=[...Array.isArray(n.preferredFormats)?n.preferredFormats:[]].map(w=>String(w).toLowerCase()).find(w=>Nf.includes(w))??"jpg",g=w=>{var x;const _=n[w]??((x=u.find(S=>S[w]!==void 0))==null?void 0:x[w]);return Number(_)>0?Number(_):void 0};let b=g("maxWidth"),v=g("maxHeight");return b&&!v&&(v=b),v&&!b&&(b=void 0),{id:s,version:o,level:d,width:i,height:a,tiles:Ff(n.tiles),sizes:Df(n.sizes),maxWidth:b,maxHeight:v,maxArea:g("maxArea"),regionByPx:d>=1||h.has("regionByPx"),sizeByW:d>=1||h.has("sizeByW")||h.has("sizeByWh"),format:m,quality:"default"}}function Bf(t){const e=[].concat(t["@context"]??[]).map(String);return e.some(n=>n.includes("/image/3"))?3:e.some(n=>n.includes("/image/2"))?2:t.type==="ImageService3"?3:t["@id"]?2:3}function $f(t){const e=t==null?void 0:t.match(/level([012])/);return e?Number(e[1]):0}function Ff(t){return Array.isArray(t)?t.map(e=>{const n=Number(e==null?void 0:e.width),o=Number((e==null?void 0:e.height)??(e==null?void 0:e.width)),r=(Array.isArray(e==null?void 0:e.scaleFactors)?e.scaleFactors:[1]).map(Number).filter(s=>s>0).sort((s,i)=>s-i);return{width:n,height:o,scaleFactors:r}}).filter(e=>e.width>0&&e.height>0&&e.scaleFactors.length):[]}function Df(t){return Array.isArray(t)?t.map(e=>({width:Number(e==null?void 0:e.width),height:Number(e==null?void 0:e.height)})).filter(e=>e.width>0&&e.height>0).sort((e,n)=>e.width-n.width):[]}function uo(t,e,n,o,r=t.quality){const s=e.x===0&&e.y===0&&e.width===t.width&&e.height===t.height,i=s?"full":`${e.x},${e.y},${e.width},${e.height}`,a=s&&n===t.width&&o===t.height;let c;return t.version===3?c=a?"max":`${n},${o}`:c=a?"full":`${n},`,`${t.id}/${i}/${c}/0/${r}.${t.format}`}function zf(t){return t.version===2&&t.level===0?"native":void 0}const er=new Map;function cs(t,{request:e}={}){const n=as(t),o=er.get(n);if(o)return o;const r=`${n}/info.json`,s=ns(e,r,{headers:{Accept:"application/ld+json, application/json"}}).then(async i=>{if(!i.ok)throw new Mr(`info.json request failed with ${i.status}`,r,i.status);return Rf(await i.json(),n)}).catch(i=>{throw er.delete(n),i});return er.set(n,s),s}function Hf(t){const e=Math.max(0,Math.floor(t||0)),n=Math.floor(e/3600),o=Math.floor(e%3600/60),r=String(e%60).padStart(2,"0");return n?`${n}:${String(o).padStart(2,"0")}:${r}`:`${o}:${r}`}function Gv(t,e){var n;if(t.currentTime=e,!!t.paused)try{(n=t.play())==null||n.catch(()=>{})}catch{}}function ls(t){if(!t)return;const[e,n]=t.split(","),o=Number(e);if(e===""||Number.isNaN(o))return;if(n===void 0||n==="")return{start:o};const r=Number(n);return Number.isNaN(r)?{start:o}:{start:o,end:r}}const Wf=(t,e,n,o,r)=>`${t}|${e??`${n}:${o}`}|${r}`,Uf=/^((application|audio|video)\/)?(vnd\.apple\.|x-)?mpegurl$/i,jf=(t,e)=>!!(t&&/\.m3u8$/i.test(t.split(/[?#]/)[0]))||!!(e&&Uf.test(e)),Vf={width:1600,height:900};function qf(t,e){const n=new Array(t.length);if(!t.length)return n;const o=t.map(cn),r=e==="left-to-right"||e==="right-to-left",s=e==="right-to-left"||e==="bottom-to-top",i=r?o[0].height:o[0].width,a=t.map((l,u)=>u);s&&a.reverse();let c=0;for(const l of a){const u=o[l],d=i/(r?u.height:u.width),h=u.width*d,p=u.height*d;n[l]=r?{x:c,y:0,width:h,height:p}:{x:0,y:c,width:h,height:p},c+=r?h:p}return n}function cn(t){var s,i;if(t.width&&t.height)return{width:t.width,height:t.height};const e=_c(t);if(e!=null&&e.width&&e.height)return{width:e.width,height:e.height};const n=((s=fo(t)[0])==null?void 0:s.body)??((i=ho(t)[0])==null?void 0:i.body),o=Number(n==null?void 0:n.width),r=Number(n==null?void 0:n.height);return o>0&&r>0?{width:o,height:r}:Vf}function _c(t){return t.accompanyingContainer??t.placeholderContainer}function Kf(t,e,n,o,r){return Wf(t.id,e.id,n,o,r)}function Zf(t){const e=[];for(const n of t)wc(n,(o,r)=>{const s=o;if((s==null?void 0:s.type)!=="Choice")return;const i=H(s.items).filter(a=>!!a&&typeof a=="object");i.length>1&&e.push({key:r,canvasId:n.id,label:s.label,items:i.map(a=>({label:a.label,id:a.id,...typeof a.type=="string"?{type:a.type}:{},...typeof a.format=="string"?{format:a.format}:{}}))})});return e}const nr={};function Gf(t){if(t.type!=="Video"&&!An(t.type)||!t.format||jf(t.id,t.format)||typeof document>"u")return true;const e=t.type==="Video"?"video":"audio",n=nr[e]??(nr[e]=document.createElement(e));return typeof n.canPlayType!="function"?true:n.canPlayType(t.format)!==""}function Xf(t){const e={};for(const n of t){const o=n.items.findIndex(Gf);o>0&&(e[n.key]=o)}return e}const or=new WeakMap,rr=[];function Yf(t){return xo(t).some(e=>((e==null?void 0:e.type)==="Choice"?H(e.items):[e]).some(o=>(o==null?void 0:o.type)==="Video"||An(o==null?void 0:o.type)))}function Tr(t){var i;const e=or.get(t);if(e)return e;const n=[];for(const a of t.items??[])for(const c of a.items??[]){if(!Yr(c))continue;const l=c.target?(i=un(c.target))==null?void 0:i.t:void 0;if(!l)continue;const[u,d]=l.split(",").map(Number);Number.isFinite(u)&&n.push({annotation:c,start:u,end:Number.isFinite(d)?d:NaN})}if(n.every(a=>Yf(a.annotation)))return or.set(t,rr),rr;n.sort((a,c)=>a.start-c.start);const o=Number(t.duration),r=Number.isFinite(o)&&o/n.length||.5;n.forEach((a,c)=>{var u;const l=(u=n[c+1])==null?void 0:u.start;a.end>a.start||(l!=null?a.end=l>a.start?l:a.start+r:Number.isFinite(o)&&o>a.start?a.end=o:a.end>a.start||(a.end=a.start+r))});const s=n.length>1?n:rr;return or.set(t,s),s}const Mn=t=>`frame:${t.id}`;function wc(t,e){(t.items??[]).forEach((n,o)=>{(n.items??[]).forEach((r,s)=>{Yr(r)&&xo(r).forEach((i,a)=>e(i,Kf(t,r,o,s,a),r))})})}function fo(t,e={},{allFrames:n=false}={}){const o=[];return us(t,e,(r,s,i)=>{r.body.type==="Image"&&o.push({body:r.body,region:r.region,...r.rotation?{rotation:r.rotation}:{},target:s,...i>=0?{frame:i}:{}})},n),o}function Jf(t,e={}){for(const n of t){let o;if(us(n,e,r=>{o??(o=r.body.type)}),typeof o=="string")return o.toLowerCase()}}function ho(t,e={}){const n=[];return us(t,e,(o,r,s,i)=>{const a=o.body.type;if(a!=="Video"&&!An(a))return;const c=ls(i);n.push({kind:a==="Video"?"video":"audio",body:o.body,target:r,...c?{time:c}:{}})}),n}function Qf(t){const e=t.filter(o=>o.time&&typeof o.body.id=="string"),n=new Set(e.map(o=>o.time.start));if(!(e.length<2||n.size!==e.length))return e.sort((o,r)=>o.time.start-r.time.start).map(o=>{const r=Number(o.body.duration)||(o.time.end!==void 0?o.time.end-o.time.start:void 0);return{src:o.body.id,...o.body.format?{format:o.body.format}:{},start:o.time.start,...r?{duration:r}:{}}})}function us(t,e,n,o=false){const r=t.width??0,s=t.height??0,i=Tr(t),a=Math.min(e[Mn(t)]??0,Math.max(0,i.length-1));wc(t,(c,l,u)=>{const d=i.findIndex(g=>g.annotation===u);if(!o&&d>=0&&d!==a)return;const h=Ir(c,e[l]??0);if(!h)return;const p=u.target?un(u.target):void 0,m=p==null?void 0:p.rect;n(h,m?{x:m.x,y:m.y,width:m.w,height:m.h}:{x:0,y:0,width:r||Number(h.body.width)||0,height:s||Number(h.body.height)||0},d,p==null?void 0:p.t)})}function xc(t){return Sc(t).filter(e=>e.kind!=="transcript")}function th(t){const e=H(t.provides);return e.includes("closedCaptions")?"captions":e.includes("subtitles")||e.includes("translation")?"subtitles":e.includes("transcript")?"transcript":"captions"}function Sc(t){const e=[],n=[...t.annotations??[],...t.items??[]];for(const o of n)for(const r of o.items??[])if(H(r.motivation).includes("supplementing"))for(const s of H(r.body)){const i=s,a=(i==null?void 0:i.type)==="Choice"?H(i.items):[i];for(const c of a){const l=c==null?void 0:c.id;!((c==null?void 0:c.format)==="text/vtt"||typeof l=="string"&&/\.vtt(\?|$)/i.test(l))||typeof l!="string"||e.push({id:l,label:c.label,language:H(c.language)[0],kind:th(r)})}}return e}function eh(t){const e=[],n=r=>{const s=r,i=s==null?void 0:s.id;if(typeof i!="string"||e.some(c=>c.id===i))return;const a=s==null?void 0:s.format;(a?a!=="text/plain":!/\.txt(\?|$)/i.test(i))||e.push({id:i,label:s==null?void 0:s.label,language:H(s==null?void 0:s.language)[0]})},o=[...t.annotations??[],...t.items??[]];for(const r of o)for(const s of r.items??[])if(H(s.motivation).includes("supplementing"))for(const i of H(s.body)){const a=i;((a==null?void 0:a.type)==="Choice"?H(a.items):[a]).forEach(n)}return H(t.rendering).forEach(n),e}function Ir(t,e=0){if(!t||typeof t!="object")return null;const n=t;if(n.type==="Choice"){const o=H(n.items);return Ir(o[e]??o[0])}if(n.type==="SpecificResource"&&n.source){const o=typeof n.source=="string"?{id:n.source}:n.source,r=H(n.selector).find(a=>(a==null?void 0:a.type)==="ImageApiSelector"),s=Ir({type:"Image",...o});if(!s)return null;const i=(r==null?void 0:r.rotation)!=null?String(r.rotation):void 0;return{...s,region:(r==null?void 0:r.region)||s.region,...i?{rotation:i}:{}}}return n.type!=="Image"&&n.type!=="Video"&&!An(n.type)?null:{body:n,region:typeof n.region=="string"?n.region:void 0}}function nh(t,e,n={},{standIns:o=true}={}){const r=qf(t,e),s=[],i=[],a={};return t.forEach((c,l)=>{const u=r[l],d=cn(c),h=u.width/d.width,p=u.height/d.height,m=x=>({x:u.x+x.x*h,y:u.y+x.y*p,width:x.width*h,height:x.height*p}),g=ho(c,n),b=fo(c,n,{allFrames:true}).map(x=>({...x,canvas:c})),v=_c(c);if(o&&!b.length&&g.some(x=>x.kind==="audio")&&v){const x=cn(v);for(const S of fo(v))b.push({...S,canvas:v,target:{x:S.target.x/x.width*d.width,y:S.target.y/x.height*d.height,width:S.target.width/x.width*d.width,height:S.target.height/x.height*d.height}})}const w=n[Mn(c)]??0;b.forEach(({body:x,target:S,region:M,rotation:R,frame:N,canvas:J},et)=>{var E;const X=Co(x.service);if(!X&&!x.id)return;const V=`${J.id}|${et}|${x.id??X}|${M??""}|${R??""}`,T=!(X&&M);if(s.push({id:V,service:X,url:x.id,width:T&&Number(x.width)||void 0,height:T&&Number(x.height)||void 0,region:M,...R?{rotation:R}:{},placement:m(S),...N!=null&&N!==w?{hidden:true}:{}}),N!=null){const A=a[E=Mn(c)]??(a[E]=[]);(A[N]??(A[N]=[])).push(V)}});const[_]=g;if(_!=null&&_.body.id){const x=Qf(g),S=x?x[0]:void 0;i.push({id:`${c.id}|media|${_.body.id}`,kind:_.kind,src:(S==null?void 0:S.src)??_.body.id,format:S?S.format:_.body.format,placement:m(_.target),duration:x?Number(c.duration)||void 0:Number(_.body.duration??c.duration)||void 0,...x?{segments:x}:{},poster:oh(c),captions:xc(c)})}}),{images:s,media:i,placements:r,frames:a}}function oh(t){var e;return(e=kc(t))==null?void 0:e.source}const Xv=1280;function kc(t){var c;const e=t.placeholderContainer;if(!e)return;const n=(c=fo(e)[0])==null?void 0:c.body;if(!n)return;const o=Co(n.service),r=typeof n.id=="string"?n.id:void 0,s=o?{service:o,fallback:r}:r?{src:r}:void 0;if(!s)return;const{width:i,height:a}=cn(e);return{source:s,width:i,height:a}}function rh(t,e,n){const o=cn(t),r=e.width/o.width,s=e.height/o.height;return{x:e.x+n.x*r,y:e.y+n.y*s,width:n.width*r,height:n.height*s}}const sh=({hidden:t})=>{const{t:e,langOf:n}=Pt(),o=e("imageExitFullScreen");return f("button",{"aria-label":o,...ut(n("imageExitFullScreen")),className:"clover-canvas-exit-full-screen",hidden:t,onClick:r=>void yc(r.currentTarget),type:"button",children:[f("svg",{viewBox:"0 0 512 512",width:"20",height:"20","aria-hidden":"true",focusable:"false",children:f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"})}),o]})},Cc="50%";function Ec(t,e=Cc,n=null){const[o,r]=z(()=>typeof IntersectionObserver>"u");return D(()=>{if(o||!t)return;const s=new IntersectionObserver(i=>{i.some(a=>a.isIntersecting)&&(r(true),s.disconnect())},{root:n,rootMargin:e});return s.observe(t),()=>s.disconnect()},[t,o,e,n]),o}function ih(t){const[e,n]=z(false);return D(()=>{if(!t)return;const o=()=>n(ko()===t);return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}function ah(t){const[e,n]=z(false);return D(()=>{if(!t)return;const o=()=>{const r=ko();n(r===t||!!r&&vc(t)===r&&(r==null?void 0:r.querySelector(".clover-canvas"))===t)};return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}class ch extends ae.Component{constructor(){super(...arguments);I(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}render(){const{error:n}=this.state;return n?f("div",{className:"clover-canvas-error",role:"alert",lang:"en",children:[f("p",{className:"clover-canvas-error-headline","data-testid":"headline",children:"Something went wrong"}),n.message&&f("span",{className:"clover-canvas-error-body",children:`Error message: ${n.message}`})]}):this.props.children}}function Sn({overlay:t=false,className:e}){return f("span",{"aria-hidden":"true",className:Mt("clover-loading",e),"data-overlay":t||void 0,children:f("span",{})})}const lh={image:"bodyUnloadableImage",video:"bodyUnloadableVideo",audio:"bodyUnloadableAudio",model:"bodyUnloadableModel"};function uh({kind:t,shown:e,room:n=false}){const{t:o,langOf:r}=Pt(),s=lh[t];return f("div",{className:"clover-body-unloadable","data-room":n||void 0,role:"status",children:e&&f("p",{...ut(r(s)),children:o(s)})})}function dh({text:t,lang:e}){return f("div",{className:"clover-body-note","aria-hidden":"true",children:f("p",{...ut(e),children:t})})}function Eo(t,e,n=false,o){const r=fe(),{hostLanguage:s}=Pt(void 0,o);if(n)return{props:{},node:null};const i=_o(e,s);return i===void 0?{props:{"aria-label":t},node:null}:{props:{"aria-labelledby":r},node:f("span",{hidden:true,id:r,...ut(i),children:t})}}const fh=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function ne(t,e){return{a:1,b:0,c:0,d:1,e:t,f:e}}function ce(t,e=t){return{a:t,b:0,c:0,d:e,e:0,f:0}}function Nn(t){const e=Math.cos(t),n=Math.sin(t);return{a:e,b:n,c:-n,d:e,e:0,f:0}}function hh(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function le(...t){return t.reduce((e,n)=>hh(e,n),fh)}function ph(t){const e=t.a*t.d-t.b*t.c;if(!e||!Number.isFinite(e))return null;const n=1/e;return{a:t.d*n,b:-t.b*n,c:-t.c*n,d:t.a*n,e:(t.c*t.f-t.d*t.e)*n,f:(t.b*t.e-t.a*t.f)*n}}function ve(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function Yv(t){return`matrix(${[t.a,t.b,t.c,t.d,t.e,t.f].map(gh).join(",")})`}function mh(t,e,n,o=new Float32Array(9)){const r=2/e,s=-2/n;return o[0]=t.a*r,o[1]=t.b*s,o[2]=0,o[3]=t.c*r,o[4]=t.d*s,o[5]=0,o[6]=t.e*r-1,o[7]=t.f*s+1,o[8]=1,o}function gh(t){const e=Math.round(t*1e6)/1e6;return Object.is(e,-0)?"0":String(e)}function Mc(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function ds(t){if(!t.length)return null;let e=1/0,n=1/0,o=-1/0,r=-1/0;for(const s of t)e=Math.min(e,s.x),n=Math.min(n,s.y),o=Math.max(o,s.x+s.width),r=Math.max(r,s.y+s.height);return{x:e,y:n,width:o-e,height:r-n}}function vh(t,e){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height}function Mo(t,e){const n=[ve(t,{x:e.x,y:e.y}),ve(t,{x:e.x+e.width,y:e.y}),ve(t,{x:e.x,y:e.y+e.height}),ve(t,{x:e.x+e.width,y:e.y+e.height})],o=n.map(a=>a.x),r=n.map(a=>a.y),s=Math.min(...o),i=Math.min(...r);return{x:s,y:i,width:Math.max(...o)-s,height:Math.max(...r)-i}}function yn(t,e,n){return Math.min(Math.max(t,e),n)}const sr=t=>!!(t&&"overlays"in t);let Pr;const yh=()=>Promise.resolve().then(()=>_d).then(t=>{Pr=t.buildContentState}),bh=mt(()=>import("./MediaBody-DPOcyiYH.mjs")),_h=()=>import("./AnnotationState-ZPmnCpbZ.mjs"),wh=new Map,xh={menu:[],placed:[],timed:[],hiddenPages:[],setPagesVisible:()=>{},listedCount:0,comments:wh,selected:null,select:()=>{},activate:()=>{},release:()=>false,quietlyOpened:null},Sh=mt(()=>import("./FrameAnimation-DGMuFNdW.mjs")),Bi=mt(()=>import("./PlaceBox-Cjdjg-_9.mjs")),kh=mt(()=>import("./Placeholder-MYLjXbiF.mjs")),Ch=mt(()=>import("./ControlsFade-pOQ5VQ5i.mjs")),Eh=()=>true,Mh=mt(()=>import("./Placeholder-MYLjXbiF.mjs").then(({PlaceholderToggle:t})=>({default:t}))),$i={zoom:true,fullPage:true,rotation:true,reset:true,annotations:true,information:true,map:true},Th={zoom:false,fullPage:false,rotation:false,reset:false,annotations:false,information:false,map:false},Ih={description:"canvasKeysImage",keys:["ArrowLeft ArrowRight ArrowUp ArrowDown",Gt.zoomIn.keys,Gt.zoomOut.keys,Gt.reset.keys,Gt.rotateRight.keys,Gt.rotateLeft.keys].join(" ")},Ph={description:"canvasKeysMedia",keys:[Gt.play.keys,"J L",Gt.mute.keys].join(" ")},Lh={description:"canvasKeysAnnotations",keys:"Escape"},Ah=t=>{var n;return!!((n=t.canvases)!=null&&n.length)||Tc(t.body,t.src).length>0?f(ch,{children:f(Oh,{...t})}):null},Oh=t=>{var Bs,$s,Fs,Ds,zs,Hs;const{surface:e,manifestId:n,canvases:o,viewingDirection:r,body:s,src:i,isTiledImage:a=false,label:c,partOf:l,language:u,highContrast:d,instanceId:h,className:p,options:m,navigator:g=false,controls:b=true,collapseControls:v="auto",controlButtons:w,annotations:_,onReady:x,onViewportChange:S,onContentStateChange:M,onMediaElement:R,onCaptionChange:N,caption:J,onEnded:et,chapters:X,highlightedChapter:V,onChapterHighlight:T,placeholder:E=true,children:A}=t,{t:W}=Pt(),G=$(null),[Y,st]=z(null),St=ih(Y),ot=is(Y),ct=ah(Y),y=wo(st),C=qr(d),L=!!e.controlsVisibility,O=(e.controlsVisibility??Eh)(L?Y:null,m==null?void 0:m.hideDelay,G),[P,U]=z(false),K=Ec(Y),yt=fe(),[tt]=z(()=>h??`clover-canvas-${yt}`),pt=$(null),[ft,Ht]=z(null),Nt=sr(ft)?ft:null,[q,rt]=z(null),Q=b===false?null:b===true?$i:{...$i,...b},[wt,Bt]=z("loading"),[re,we]=z(false),[B,lt]=z(0),[Ot,Po]=z(bc),qt=$(x),Ue=$(S),je=$(m);qt.current=x,Ue.current=S,je.current=m;const he=Xr(r),Le=vt(()=>Zf(o??[]),[o]),$n=vt(()=>Xf(Le),[Le]),[Lo,Fn]=z({}),Xt=vt(()=>({...$n,...Lo}),[$n,Lo]),fn=(k,Z)=>Fn(gt=>({...gt,[k]:Z})),Dn=vt(()=>_==null?void 0:_.filter(k=>!k.layer||(Xt[k.layer.key]??0)===k.layer.item),[_,Xt]),Wt=(Bs=_==null?void 0:_.find(k=>k.layer&&k.annotation.id===t.selectedAnnotation))==null?void 0:Bs.layer;D(()=>{Wt&&(Xt[Wt.key]??0)!==Wt.item&&fn(Wt.key,Wt.item)},[Wt==null?void 0:Wt.key,Wt==null?void 0:Wt.item,t.selectedAnnotation]);const hn=!!(Q!=null&&Q.information),Yt=!!(_!=null&&_.length),Ae=Je(_h,Yt),[Ao,pn]=z(null),Tt=Yt&&Ao||xh,Ut=vt(()=>{var gt,Lt;const k=(gt=_==null?void 0:_.find(jt=>jt.annotation.id===Tt.selected))==null?void 0:gt.annotation,Z=(Array.isArray(k==null?void 0:k.body)?k==null?void 0:k.body:[k==null?void 0:k.body]).find(jt=>(jt==null?void 0:jt.type)==="Feature");return k&&Z?{id:String(k.id),feature:Z,name:((Lt=Z.properties)==null?void 0:Lt.label)??k.label}:null},[_,Tt.selected]),xe=Ut?`${Ut.id}:${t.refind??0}`:null,[zn,Hn]=z(null),Wn=xe!==null&&zn!==xe,Oe=vt(()=>{var jt,Ge;const k=(o??[]).map(Zt=>Zt.navPlace).filter(Boolean),Z=k.length?k:t.navPlace?[t.navPlace]:[];if(!Z.length)return null;const gt=Z.flatMap(Zt=>(Zt==null?void 0:Zt.type)==="FeatureCollection"?Zt.features??[]:(Zt==null?void 0:Zt.type)==="Feature"?[Zt]:[]);if(!gt.length)return null;const Lt=gt.length===1?(Ge=(jt=gt[0])==null?void 0:jt.properties)==null?void 0:Ge.label:void 0;return{feature:{type:"FeatureCollection",features:gt},name:Lt??t.label}},[o,t.navPlace,t.label]),mn=`place-box-${tt}`,[j,ht]=z(false),[Se,pl]=z(false),Un=$(Tt);Un.current=Tt;const jn=dt(()=>Un.current.release(),[]),{comments:Oo,listedCount:ws}=Tt,Ve=vt(()=>hn?(o??[]).filter(k=>cf(k)||Oo.has(k.id)):[],[o,hn,Oo]),No=`caption-${tt}`,[ml,xs]=z(false),Ro=ml&&Ve.length>0,Ss=dt(k=>{var Z;xs(false),k&&((Z=document.getElementById(`information-${tt}`))==null||Z.focus())},[tt]),Kt=vt(()=>(o??[]).find(k=>Tr(k).length)??null,[o]),gl=Kt?Tr(Kt):Rh,Ft=vt(()=>o!=null&&o.length?nh(o,he,Xt,{standIns:o.length>1}):null,[o,he,Xt]),vl=vt(()=>Tc(s,i,a),[s,i,a]),nt=(Ft==null?void 0:Ft.media[0])??null,ks=!L&&(nt==null?void 0:nt.kind)==="video",yl=L||ks,bl=L?O:P,_l=vt(()=>{if(o!=null&&o.length)return Jf(o,Xt);const k=(Array.isArray(s)?s:s?[s]:[])[0];return typeof(k==null?void 0:k.type)=="string"?k.type.toLowerCase():i?"image":void 0},[o,Xt,s,i]),[$t,wl]=z(null),Vn=$(R);Vn.current=R;const xl=dt(k=>{var Z;wl(k),(Z=Vn.current)==null||Z.call(Vn,k)},[]),ke=Ft?Ft.images:vl,Ce=!!nt&&(o==null?void 0:o.length)===1,Ee=Ce&&(nt==null?void 0:nt.kind)==="audio",Sl=Ce&&(nt==null?void 0:nt.kind)==="video",qe=(o==null?void 0:o.length)===1&&!nt&&!Kt&&ke.length===0,qn=!Ce&&!qe&&(($s=m==null?void 0:m.gestures)==null?void 0:$s.navigable)!==false,pe=o?`${n??""}
|
|
2
|
+
${o.map(k=>k.id).join("|")}`:null,Me=vt(()=>{if(!o||!E)return[];const k=o.flatMap(Z=>{const gt=kc(Z),Lt=bt(Z.label,u);return gt?[{...gt,alt:Lt.text,lang:Lt.lang}]:[]});return he==="right-to-left"||he==="bottom-to-top"?k.reverse():k},[o,he,E,u]),[kl,Cs]=z(false),[Cl,Es]=z(null),xt=!Ee&&Me.length>0&&(nt?Cl!==pe:!kl),Ms=m==null?void 0:m.request;D(()=>{if(xt){Promise.resolve().then(()=>vm);for(const{source:k}of Me)k.service&&cs(k.service,{request:Ms}).catch(()=>{})}},[xt,Me,Ms]);const Ts=(k,{annotations:Z=false,fullPage:gt=false}={})=>({...k,zoom:false,rotation:false,reset:false,fullPage:gt&&k.fullPage,annotations:Z&&k.annotations}),gn=qe&&ot,Is=ae.Children.count(A)>0,Bo=Me.length>0&&!Ee&&!nt,vn=Q?xt?Ve.length||Is||ws||nt&&(X!=null&&X.length)?Ts(Q,{annotations:true}):null:Ce||qe?Le.length||Ve.length||Is||ws||nt&&(X!=null&&X.length)||gn&&Q.fullPage?Ts(Q,{annotations:true,fullPage:gn}):null:Q:null,$o=g&&!xt&&(nt?nt.kind==="audio"&&!Ce&&ke.length>0:true),[Fo,El]=z(null),Ke=nt?Fo??nt.placement:null,[Kn,Ml]=z(Bh),Do=vt(()=>{const k=(nt==null?void 0:nt.kind)==="video"&&$t&&Ke?[...ke,{id:nt.id,placement:Ke,width:Ke.width,height:Ke.height,media:{element:$t}}]:ke;return Kn.length?[...k,...Kn]:k},[ke,nt,$t,Ke,Kn]),Ps=Ce&&(nt==null?void 0:nt.kind)==="video"&&Fo?Fo:Ft?ds(Ft.placements):null,Tl=JSON.stringify([ke,Ps,Do.length!==ke.length&&[nt==null?void 0:nt.id,Ke],Kn.map(k=>k.id)]),Zn=$(null),zo=$(false),Ho=()=>{nt?Es(xt?pe:null):Cs(xt),xt||jn()},Gn=$(null),Il=k=>{if($t&&!xt){$t.currentTime=k;return}Gn.current=k,xt&&Ho()};D(()=>{!$t||Gn.current===null||($t.currentTime=Gn.current,Gn.current=null)},[$t]);const Wo=Array.isArray(s)?s[0]:s,It=[c,(Fs=o==null?void 0:o[0])==null?void 0:Fs.label,Wo==null?void 0:Wo.label].map(k=>bt(k,u)).find(k=>k.text),Pl=vt(()=>{const k=bt(l,u);return k.text&&k.text!==(It==null?void 0:It.text)?k:void 0},[l,u,It==null?void 0:It.text]),Ls=Eo((It==null?void 0:It.text)||W("canvasImage"),It?It.lang:y.langOf("canvasImage"),false,y.hostLanguage),Xn=xt?[]:[...qn?[Ih]:[],...nt?[Ph]:[],...Yt?[Lh]:[]],As=`keys-${tt}`,Ll=qn&&!xt&&!y.langOf("canvasRoleDescription")?W("canvasRoleDescription"):void 0,Uo=!!vn&&Ve.length>0,Al=Uo&&Ve.map((k,Z)=>bt(k.label,u).text?mc(No,Z):null).filter(Boolean).join(" ")||void 0,Os=$({canvases:o,scene:Ft,canvasKey:pe});Os.current={canvases:o,scene:Ft,canvasKey:pe};const Yn=$(null),jo=dt(()=>{const{canvases:k,scene:Z,canvasKey:gt}=Os.current;Yn.current=k&&Z&&Zn.current===gt?{key:gt,canvases:k,placements:Z.placements}:null},[]),Ol=!o||((Ds=Yn.current)==null?void 0:Ds.key)===pe,Ze=dc(()=>{const k=Yn.current,Z=pt.current;if(!k||n==="loading")return null;const gt=$t&&$t.currentTime>0?$t.currentTime:null,Lt=!gt&&Z&&sr(Z)?Ic(Z.getBounds(),k.canvases,k.placements):null,jt=k.canvases.find(Ge=>Ge.id===(Lt==null?void 0:Lt.canvasId))??k.canvases[0];return jt?Pr?Pr({manifestId:n,canvasId:jt.id,type:jt.type,region:Lt&&{x:Lt.rect.x,y:Lt.rect.y,w:Lt.rect.width,h:Lt.rect.height},time:gt}):(yh().then(()=>Ze()),null):null},M);D(()=>Cr($t,Ze),[$t,Ze]),D(()=>{const k=G.current;if(!k)return;const Z=e(k,je.current),gt=sr(Z)?Z:null;pt.current=Z,Ht(Z),Z.setDismiss(jn);const Lt=()=>{if(!gt)return;const Vt=gt.viewLimits();Po(me=>me.atMax===Vt.atMax&&me.atMin===Vt.atMin&&me.atHome===Vt.atHome?me:Vt)},jt=Z.on("open",()=>{var Vt;Lt(),qo(false),jo(),Ze(),Bt("ready"),lt(me=>me+1),gt&&((Vt=qt.current)==null||Vt.call(qt,Nh(gt,()=>Yn.current,me=>{var Us,js;const Ws=Un.current.placed.find(Ko=>Ko.id===me);return Ws?(Un.current.select(Ws),(js=Array.from(((Us=gt.overlays)==null?void 0:Us.container.querySelectorAll("[id]"))??[]).find(Ko=>Ko.id===me))==null||js.focus({preventScroll:true}),true):false})))}),Ge=Z.on("change",()=>{Lt(),qo(false),jo(),Ze(),Bt("ready"),lt(Vt=>Vt+1)}),Zt=Z.on("error",()=>{Z.isOpen||Bt("error")}),Rl=Z.on("unloadable",Vt=>we(!!Vt)),Bl=Z.on("viewport",()=>{var Vt;Lt(),gt&&((Vt=Ue.current)==null||Vt.call(Ue,gt.getBounds())),Ze()});return()=>{jt(),Ge(),Zt(),Rl(),Bl(),Z.dispose(),pt.current=null,Ht(null)}},[h,e,jn,jo]),D(()=>{if(!(!Nt||!q))return Nt.attachNavigator(q)},[Nt,q]),D(()=>{if(!(!ft||!qe))return ft.setGestures({navigable:false}),()=>ft.setGestures({})},[ft,qe]);const Vo=$(false);D(()=>{var Z;if(gn)return;const k=!document.activeElement||document.activeElement===document.body;Vo.current&&k&&((Z=G.current)==null||Z.focus()),Vo.current=false},[gn]),D(()=>{const k=pt.current;if(xt&&(zo.current=true),!k||!K||xt)return;const Z=Zn.current!==null&&Zn.current!==pe;(!k.isOpen||Z)&&Bt("loading");const gt=Ce||zo.current&&k.isOpen||Z;Zn.current=pe,zo.current=false,k.setImages(Do,{world:Ps??void 0,fit:gt})},[Tl,h,$t,K,xt]);const Ns=$(n),[Nl,qo]=z(false);Dt(()=>{var k;n!==Ns.current&&(Ns.current=n,(k=pt.current)==null||k.clear(),qo(true),Bt("loading"))},[n]);const Rs=wt==="loading"&&Do.length>0&&K&&!xt;return f(Pn.Provider,{value:y.hostLanguage,children:f("figure",{"aria-labelledby":Al,className:Mt("clover-canvas",p),"data-testid":"clover-canvas","data-status":wt,...Kr(C),"data-unloadable":re||void 0,"data-has-navigator":$o,"data-fullscreen":St,"data-exit":ct||void 0,"data-controls":yl?bl?"visible":"hidden":void 0,"data-media":_l,"data-recording":nt?"":void 0,"data-player":Ee?"":void 0,"data-animated":Kt?"":void 0,"data-navigable":qn,"data-placeholder":Me.length&&!Ee?xt:void 0,ref:y.ref,onFocus:k=>{Vo.current=gn&&k.target.id===`fullPage-${tt}`},onKeyDown:k=>{if(k.key==="Escape"&&Ro&&!k.defaultPrevented){k.preventDefault(),Ss(false);return}if(k.key==="Escape"&&!k.defaultPrevented&&!k.currentTarget.querySelector(".clover-canvas-menu")&&jn()){k.preventDefault();return}nf(k,G.current)},style:{position:"relative",width:"100%",height:"100%",margin:0,overflow:"hidden",isolation:"isolate"},children:[(vn||$o)&&nt&&f("div",{className:"clover-canvas-scrim","aria-hidden":"true"}),ks&&f(_t,{fallback:null,children:f(Ch,{element:Y,hideDelay:m==null?void 0:m.hideDelay,picture:G,onChange:U})}),f(sh,{hidden:!ct}),ft&&(vn||Bo)&&f(Of,{renderer:Nt,instance:tt,config:vn??Th,controlButtons:w,limits:Ot,placeholderIsMore:Bo&&!nt,chapters:nt?X:void 0,mediaElement:$t,onChapter:Il,overStill:!!nt&&xt,request:m==null?void 0:m.request,placeholder:Bo&&f(_t,{fallback:null,children:f(Mh,{instance:tt,media:!!nt,active:xt,onToggle:Ho,more:!!Q&&(Q.zoom||Q.rotation||Q.reset||Q.fullPage)})}),fit:!L,more:v,choices:xt?[]:Le,selections:Xt,onSelect:fn,annotations:Tt.menu,hiddenPages:Tt.hiddenPages,onPageVisibilityChange:Tt.setPagesVisible,selectedAnnotation:Tt.selected,onAnnotationSelect:Tt.select,onAnnotationActivate:Tt.activate,captionId:Uo?No:void 0,captionOpen:Ro,onCaptionToggle:()=>xs(k=>!k),placeId:Oe?mn:void 0,placeOpen:j,onPlaceToggle:()=>{pl(true),ht(k=>!k)},language:u,children:vn&&A}),$o&&f("div",{ref:rt,className:"clover-canvas-navigator","data-testid":"clover-canvas-navigator","aria-hidden":"true"}),f("div",{ref:G,className:"clover-canvas-viewport",style:{position:"absolute",inset:0,overflow:"hidden",zIndex:-1},"data-testid":"clover-canvas-viewport",role:Yt?"group":"img","aria-roledescription":Ll,...Ls.props,"aria-describedby":Xn.length?As:void 0,"aria-keyshortcuts":Xn.map(({keys:k})=>k).join(" ")||void 0,"aria-busy":Rs,tabIndex:0}),Ls.node,Xn.length>0&&f("span",{id:As,style:sn,children:Xn.map(({description:k},Z)=>f(ae.Fragment,{children:[Z>0&&" ",f("span",{...ut(y.langOf(k)),children:W(k)})]},k))}),f(uh,{kind:"image",shown:re&&!xt}),qe&&!xt&&(It==null?void 0:It.text)&&f(dh,{text:It.text,lang:It.lang||void 0}),(nt==null?void 0:nt.kind)==="audio"&&!Ee&&ke.length===0&&!xt&&(It==null?void 0:It.text)&&f("p",{className:"clover-canvas-sound-label","aria-hidden":"true",...ut(It.lang||void 0),children:It.text}),Me.length>0&&!Ee&&f(_t,{fallback:null,children:f(kh,{instance:tt,stills:Me,vertical:he==="top-to-bottom"||he==="bottom-to-top",media:!!nt,active:xt,lingering:wt==="loading"&&!Nl,onToggle:Ho,request:m==null?void 0:m.request})}),ft&&nt&&K&&!xt&&f(_t,{fallback:null,children:f(bh,{media:nt,request:m==null?void 0:m.request,fillable:Sl,surface:ft,instance:tt,onElement:xl,onFit:El,onCaptionChange:N,caption:J,navigable:qn,fullscreen:Ce&&!!(Q!=null&&Q.fullPage),isFullscreen:ot,onEnded:et,chapters:X,highlightedChapter:V,onChapterHighlight:T,autoPlay:!Ee&&Me.length>0&&Tt.quietlyOpened!==pe,language:u,notes:Tt.timed,marked:Tt.placed,selectedAnnotation:Tt.selected,onAnnotationSelect:Yt?Tt.select:void 0,onAnnotationActivate:Tt.activate,player:Ee&&o?{canvas:o[0],title:It,partOf:Pl}:void 0})}),Nt&&Kt&&(Ft==null?void 0:Ft.frames[Mn(Kt)])&&!xt&&f(_t,{fallback:null,children:f(Sh,{renderer:Nt,frames:gl,byFrame:Ft.frames[Mn(Kt)],animationKey:Kt.id,sceneVersion:B,autoplay:(zs=m==null?void 0:m.animation)==null?void 0:zs.autoplay,loop:(Hs=m==null?void 0:m.animation)==null?void 0:Hs.loop,onEnded:et,language:u,duration:Number(Kt.duration),canvas:Kt,place:Ft.placements[o.indexOf(Kt)],onItems:Ml},Kt.id)}),Ae&&Yt&&_&&f(Ae.AnnotationState,{given:t,annotations:Dn??_,scene:Ft,renderer:Nt,sceneVersion:B,drawn:Ol,media:nt,mediaElement:$t,showPlaceholder:xt,canvasKey:pe,openImages:Cs,openMedia:Es,host:G,onModel:pn,refind:t.refind??0}),Rs&&f(Sn,{overlay:true}),Ut&&f(_t,{fallback:null,children:f(Bi,{id:`place-of-${tt}`,open:Wn,onClose:k=>{var Z;Hn(xe),k&&((Z=document.getElementById(Ut.id))==null||Z.focus())},feature:Ut.feature,name:Ut.name,language:u})}),Oe&&Se&&f(_t,{fallback:null,children:f(Bi,{id:mn,open:j,onClose:k=>{var Z;ht(false),k&&((Z=document.getElementById(`place-${tt}`))==null||Z.focus())},feature:Oe.feature,name:Oe.name,language:u})}),Uo&&f(lf,{id:No,canvases:Ve,comments:Oo,open:Ro,onClose:Ss,language:u})]})})};function Nh(t,e,n){return{fitCanvasRect(o,r,s){const i=e(),a=(i==null?void 0:i.canvases.findIndex(c=>c.id===o))??-1;return!i||a===-1?false:(t.fitBounds(rh(i.canvases[a],i.placements[a],r),s),true)},getCanvasRegion(){const o=e();return o?Ic(t.getBounds(),o.canvases,o.placements):null},get backendKind(){return t.backendKind},get atHome(){return t.isAtHome},fitBounds:(o,r)=>t.fitBounds(o,r),fitItemRect:(o,r,s)=>t.fitItemRect(o,r,s),itemRectToWorld:(o,r)=>t.itemRectToWorld(o,r),getBounds:()=>t.getBounds(),getHomeBounds:()=>t.getHomeBounds(),getCamera:()=>t.getCamera(),home:o=>t.home(o),zoomBy:(o,r,s)=>t.zoomBy(o,r,s),panBy:(o,r,s)=>t.panBy(o,r,s),setRotation:(o,r)=>t.setRotation(o,r),getRotation:()=>t.getRotation(),rotateBy:o=>t.rotateBy(o),worldToScreenPoint:o=>t.worldToScreenPoint(o),screenToWorldPoint:o=>t.screenToWorldPoint(o),on:(o,r)=>t.on(o,r),zoomToAnnotation:n}}const Rh=[],Bh=[];function Tc(t,e,n=false){const o=Array.isArray(t)?t:t?[t]:[];return o.length?o.map((s,i)=>{const a=Co(s.service);return!a&&!s.id?null:{id:`${i}:${s.id??a}|${s.region??""}`,service:a,url:s.id,width:s.width,height:s.height,region:s.region}}).filter(s=>s!==null):(Array.isArray(e)?e:e?[e]:[]).filter(Boolean).map((s,i)=>({id:`${i}:${s}`,...n?{service:s}:{url:s}}))}function Ic(t,e,n){let o=null;if(n.forEach((d,h)=>{const p=Math.max(t.x,d.x),m=Math.max(t.y,d.y),g=Math.min(t.x+t.width,d.x+d.width)-p,b=Math.min(t.y+t.height,d.y+d.height)-m;if(g<=0||b<=0)return;const v=g*b;(!o||v>o.area)&&(o={index:h,area:v,clip:{x:p,y:m,width:g,height:b}})}),!o)return null;const{index:r,clip:s}=o,i=e[r],a=n[r],c=cn(i),l=c.width/a.width,u=c.height/a.height;return{canvasId:i.id,rect:{x:Math.round((s.x-a.x)*l),y:Math.round((s.y-a.y)*u),width:Math.round(s.width*l),height:Math.round(s.height*u)}}}function $h(t,e,n,o){return vt(()=>((o==null?void 0:o(t??null,(e==null?void 0:e.id)??null,e==null?void 0:e.duration))??[]).map(r=>{const s=bt(r.label,n);return{...r.id?{id:r.id}:{},label:s.text,lang:s.lang,start:r.start,end:r.end,...r.thumbnail?{thumbnail:r.thumbnail}:{}}}),[t,e,n,o])}function Fh(t,e,n,o){if(t.region){if(!e)return false;const{x:r,y:s,w:i,h:a}=t.region;if(!e.fitCanvasRect(t.canvasId,{x:r,y:s,width:i,height:a},true))return false}if(o&&(t.time!==void 0||t.autoplay)){if(!n)return false;const r=()=>{t.time!==void 0&&(n.currentTime=t.time),t.autoplay&&n.play().catch(()=>{})};n.readyState>=HTMLMediaElement.HAVE_METADATA?r():n.addEventListener("loadedmetadata",r,{once:true})}return true}function Dh(t,e){const n=t.store.get().manifest;if(e.canvasId&&At(n).canvases.some(r=>r.id===e.canvasId))t.goTo(e.canvasId);else if(e.manifestId&&e.manifestId!==(n==null?void 0:n.id))t.goToManifest(e.manifestId,e.canvasId);else return false;return true}function Pc(t){if(typeof t=="string")return Fi(t);const e=t;return(e==null?void 0:e.type)==="SpecificResource"?e:typeof(e==null?void 0:e.id)=="string"?Fi(e.id):e}const Fi=t=>t.replace(/\/((?:t|xywh)=[^/#]*)$/,"#$1");function Lc(t){const e=H(t.thumbnail)[0];return e&&typeof e=="object"?{thumbnail:e}:{}}const Di=new WeakMap,zi=[];function zh(t,e,n){if(!t||!e)return zi;let o=Di.get(t);o||Di.set(t,o=new Map);const r=`${e}|${n??""}`,s=o.get(r);if(s)return s;const i=[],a=new Set,c=u=>{if(!u||a.has(u.id??u))return;a.add(u.id??u);const d=!H(u.behavior).includes("no-nav");for(const h of H(u.items)){if((h==null?void 0:h.type)==="Range"){c(h);continue}if(!d)continue;const p=un(Pc(h));if(p.id.split("#")[0]!==e)continue;const m=ls(p.t);m&&i.push({...u.id?{id:u.id}:{},label:u.label,...m,...Lc(u)})}};for(const u of H(t.structures))c(u);i.sort((u,d)=>u.start-d.start);const l=i.length?i.map((u,d)=>{var h;return{...u,end:u.end??((h=i[d+1])==null?void 0:h.start)??n}}):zi;return o.set(r,l),l}const Hi=new WeakMap,Wi=[];function Hh(t){if(!t)return Wi;const e=Hi.get(t);if(e)return e;const n=new Map(H(t.items).map((c,l)=>[c==null?void 0:c.id,l])),o=new Set,r=c=>{var w,_;if(!c||o.has(c.id??c))return[];o.add(c.id??c);const l=[],u=[],d=[];let h;for(const x of H(c.items))if((x==null?void 0:x.type)==="Range"){const S=r(x);l.push(...S),S.forEach(M=>u.push(...M.canvasIds))}else{const S=un(Pc(x));if(!S.id)continue;h??(h=S),u.push(S.id),d.push(S)}const p=H(c.behavior);if(p.includes("no-nav"))return l;const m=h??void 0,g={id:c.id??`range-${o.size}`,label:c.label,canvasId:(m==null?void 0:m.id)??((w=l[0])==null?void 0:w.canvasId),canvasIds:[...new Set(u)],...p.includes("sequence")?{sequence:true}:{},...Lc(c),children:l},b=ls(m==null?void 0:m.t);return b?g.time=b:!m&&((_=l[0])!=null&&_.time)&&(g.time=l[0].time),m!=null&&m.rect&&(g.region=m.rect),(p.includes("sequence")&&d.length>1&&!d.some(x=>x.t)||Wh(d,n))&&(g.parts=d.map(x=>({canvasId:x.id,...x.rect?{region:x.rect}:{}}))),[g]},s=H(t.structures).flatMap(r),i=s.length===1&&s[0].children.length?s[0].children:s,a=i.length?i:Wi;return Hi.set(t,a),a}function Wh(t,e){return!t.length||t.some(n=>n.t)?false:t.some(n=>n.rect)?true:t.some((n,o)=>o>0&&e.get(n.id)!==(e.get(t[o-1].id)??NaN)+1)}function Jv(t,e,n,o){let r=null,s=null;const i=(l,u,d)=>!l||d>l.depth||d===l.depth&&!(l.sequence&&u.sequence),a=(l,u,d)=>{const h=d||l.id===o;if(e&&l.canvasIds.includes(e)&&(!l.time||n!==void 0&&n>=l.time.start&&(l.time.end===void 0||n<l.time.end))){const m={id:l.id,depth:u,...l.sequence?{sequence:true}:{}};i(r,l,u)&&(r=m),h&&i(s,l,u)&&(s=m)}l.children.forEach(p=>a(p,u+1,h))};t.forEach(l=>a(l,0,false));const c=s??r;return c?c.id:null}function Uh(){const t=it(n=>n.status),e=it(n=>n.error);return vt(()=>({status:t,error:e}),[t,e])}function jh(){return it(t=>t.manifest)}function Ac(){return it(t=>At(t.manifest))}function fs(){return it(t=>De(t.manifest,t.canvasId))}function Vh(){return it(t=>He(t.manifest,t.canvasId))}function qh(){const{clover:t}=de("useNavigation"),e=it(o=>On(o.manifest,o.canvasId)),n=it(o=>At(o.manifest).views.length);return vt(()=>Fd(t,e,n),[t,e,n])}function Kh(){return it(t=>nc(t.manifest,t.addedSets))}function Qv(t){const{language:e}=de("useLocalized");return vt(()=>bt(t,e),[t,e])}function ty(){return Pt().t}function ey(){return Pt().langOf}const Zh=({options:t,onReady:e,onViewportChange:n,onMediaElement:o,onCaptionChange:r,caption:s,onEnded:i,placeholder:a=true,label:c,partOf:l,language:u,annotations:d,chapters:h,...p})=>{const m=de("Canvas"),{clover:g}=m,b=ee(g.captions.subscribe,g.captions.get,g.captions.get),v=s??b,w=u??m.language,_=fs(),{direction:x}=Ac(),S=jh(),M=Vh(),R=it(B=>{var lt;return B.status==="loading"?"loading":((lt=B.manifest)==null?void 0:lt.id)??""}),N=it(B=>B.target),J=it(B=>oc(B.manifest,B.addedSets,B.search.set,B.regions)),et=it(B=>yd(B.manifest,B.addedSets,B.hiddenSets,B.shownSets)),X=it(B=>ts(B.manifest,B.addedSets,B.hiddenSets,B.shownSets)),V=it(B=>B.annotationId),T=$(V);T.current=V;const[E,A]=z(0);D(()=>g.found.subscribe(B=>{B&&B===T.current&&A(lt=>lt+1)}),[g]);const W=ee(g.highlight.subscribe,g.highlight.get,g.highlight.get),G=ee(g.chapter.subscribe,g.chapter.get,g.chapter.get),Y=_.map(B=>B.id).join("|"),st=vt(()=>{if(d)return d;const B=_.map(lt=>lt.id);return J.flatMap(lt=>lt.entries.filter(Ot=>B.includes(Ot.canvasId)).map(Ot=>({annotation:Ot.annotation,targetIndex:B.indexOf(Ot.canvasId),pageId:lt.id,...lt.label?{pageLabel:lt.label}:{},...Ot.place?{place:Ot.place}:{},...Ot.layer?{layer:{key:Ot.layer.key,item:Ot.layer.item}}:{}})))},[d,J,_]),ot=N?(B=>!!B&&_.some(lt=>lt.id===B))(N.canvasId):false,ct=$(null);ot&&(ct.current=Y);const y=a&&ct.current!==Y,C=$(null),L=$(null),F=vt(()=>_.some(B=>ho(B).length>0),[_]),O=F?_.find(B=>ho(B).length>0):void 0,P=$h(S,O,w,zh),U=$(F);U.current=F;const K=s===void 0?m.language:void 0,yt=O==null?void 0:O.id;D(()=>{if(!K||!O)return;const B=xc(O).find(lt=>lt.language&&qa(lt.language,K));B&&g.captions.get()!==B.id&&g.captions.emit(B.id)},[K,yt,g]);const tt=dt(()=>{const B=g.store.get().target;!B||!g.store.get().canvasId||Fh(B,C.current,L.current,U.current)&&g.consumeTarget()},[g]),pt=$(Y);D(()=>{pt.current!==Y&&(pt.current=Y,L.current=null),N&&tt()},[N,Y,tt]);const ft=$(e);ft.current=e;const Ht=dt(B=>{var lt;C.current=B,B.on("change",tt),tt(),(lt=ft.current)==null||lt.call(ft,B)},[tt]),Nt=dt(B=>{var Ot;const lt=(Ot=C.current)==null?void 0:Ot.getCanvasRegion();g.viewport.emit(lt?{canvasId:lt.canvasId,region:{x:lt.rect.x,y:lt.rect.y,w:lt.rect.width,h:lt.rect.height}}:null),n==null||n(B)},[g,n]),q=dt(B=>{L.current=B,g.media.emit(B),B&&tt(),o==null||o(B)},[g,tt,o]),rt=dt(()=>{i==null||i(),(Ne(S,"auto-advance")||Ne(M,"auto-advance"))&&g.next({autoplay:true,wrap:Ne(S,"repeat")})},[g,S,M,i]),Q=dt(B=>void Dh(g,B),[g]),wt=(t==null?void 0:t.request)??g.request,Bt=Ne(M,"auto-advance")||Ne(S,"auto-advance"),re=Ne(M,"repeat")||Ne(S,"repeat"),we=vt(()=>({...t,request:wt,animation:(t==null?void 0:t.animation)??{autoplay:Bt,loop:re}}),[t,wt,Bt,re]);return _.length?f(Ah,{...p,manifestId:R,navPlace:S==null?void 0:S.navPlace,canvases:_,viewingDirection:x,language:w,label:c??(M==null?void 0:M.label)??(S==null?void 0:S.label),partOf:l??(S==null?void 0:S.label),options:we,placeholder:y,onReady:Ht,onViewportChange:Nt,onMediaElement:q,caption:v,onCaptionChange:B=>{g.captions.emit((B==null?void 0:B.id)??null),r==null||r(B)},onEnded:rt,annotations:st,hiddenPages:X,unlistedPages:et,onPageVisibilityChange:(B,lt)=>B.forEach(Ot=>g.setSetVisible(Ot,lt)),chapters:h??P,highlightedChapter:G,onChapterHighlight:B=>g.chapter.emit(B),selectedAnnotation:V,refind:E,highlightedAnnotation:W,onAnnotationSelect:B=>g.selectAnnotation(B),onAnnotationLink:p.onAnnotationLink??Q,onAnnotationActive:B=>{var lt;g.highlight.emit(B),(lt=p.onAnnotationActive)==null||lt.call(p,B)}}):null},Gh=6,Ye=new Set;function Xh(t){if(Ye.has(t))return true;for(;Ye.size>=Gh;){let e;for(const n of Ye)n.hiddenSince!==null&&(!e||n.hiddenSince<e.hiddenSince)&&(e=n);if(!e)return false;Ye.delete(e),e.release()}return Ye.add(t),true}function Ui(t){Ye.delete(t)}function Yh(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement?t.complete&&t.naturalWidth>0:true}function Jh(t,e){if(!t.bleed)return{x:0,y:0};const n=t.transform,o=Math.hypot(n.a,n.b)*e,r=Math.hypot(n.c,n.d)*e;return{x:t.bleed.right&&o>0?1/o:0,y:t.bleed.bottom&&r>0?1/r:0}}const Qh=`#version 300 es
|
|
3
3
|
in vec2 a_position;
|
|
4
4
|
uniform mat3 u_matrix;
|
|
5
5
|
uniform vec4 u_crop;
|
|
@@ -20,10 +20,10 @@ out vec4 outColor;
|
|
|
20
20
|
void main() {
|
|
21
21
|
outColor = texture(u_texture, v_uv) * u_opacity;
|
|
22
22
|
}
|
|
23
|
-
`;class po{constructor(e,n,o){I(this,"kind","webgl2");I(this,"canvas");I(this,"maxTextureSize");I(this,"gl");I(this,"program",null);I(this,"vao",null);I(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});I(this,"textures",new Map);I(this,"cssWidth",1);I(this,"cssHeight",1);I(this,"pixelRatio",1);I(this,"matrixScratch",new Float32Array(9));I(this,"isLost",false);I(this,"callbacks");I(this,"handleLost",()=>{var e2,n2;this.isLost=true,this.textures.clear(),(n2=(e2=this.callbacks).onLost)==null||n2.call(e2)});this.canvas=e,this.gl=n,this.callbacks=o,this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE)||4096;const r=ep(n,Qh,tp);this.program=r,this.uniforms={matrix:n.getUniformLocation(r,"u_matrix"),crop:n.getUniformLocation(r,"u_crop"),opacity:n.getUniformLocation(r,"u_opacity"),texture:n.getUniformLocation(r,"u_texture")};const s=n.createVertexArray();n.bindVertexArray(s);const i=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,i),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),n.STATIC_DRAW);const a=n.getAttribLocation(r,"a_position");n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,false,0,0),n.bindVertexArray(null),this.vao=s,n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,false),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL),e.addEventListener("webglcontextlost",this.handleLost)}static create(e,n={}){let o=null;try{o=e.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{o=null}if(!o||typeof o.createShader!="function")return null;try{return new po(e,o,n)}catch{return null}}resize(e,n,o){this.cssWidth=Math.max(1,e),this.cssHeight=Math.max(1,n),this.pixelRatio=o;const r=Math.max(1,Math.round(e*o)),s=Math.max(1,Math.round(n*o));this.canvas.width!==r&&(this.canvas.width=r),this.canvas.height!==s&&(this.canvas.height=s)}begin(){if(this.isLost)return;const e=this.gl;e.viewport(0,0,this.canvas.width,this.canvas.height),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.useProgram(this.program),e.bindVertexArray(this.vao),e.activeTexture(e.TEXTURE0),e.uniform1i(this.uniforms.texture,0)}draw(e){if(this.isLost||!Yh(e.source))return"skipped";const n=this.gl,o=this.upload(e);if(o==="tainted")return"tainted";if(!o)return"skipped";const r=e.crop??{x:0,y:0,width:e.width,height:e.height},s=Jh(e,this.pixelRatio),i=le(e.transform,ee(r.x,r.y),ce(r.width+s.x,r.height+s.y));return n.uniformMatrix3fv(this.uniforms.matrix,false,mh(i,this.cssWidth,this.cssHeight,this.matrixScratch)),n.uniform4f(this.uniforms.crop,r.x/e.width,r.y/e.height,r.width/e.width,r.height/e.height),n.uniform1f(this.uniforms.opacity,e.opacity),n.bindTexture(n.TEXTURE_2D,o.texture),n.drawArrays(n.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(e){return!this.isLost&&this.textures.has(e)}release(e){const n=this.textures.get(e);n&&(this.isLost||this.gl.deleteTexture(n.texture),this.textures.delete(e))}dispose(){var e;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const n of[...this.textures.keys()])this.release(n);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(e=this.gl.getExtension("WEBGL_lose_context"))==null||e.loseContext(),this.isLost=true}upload(e){const n=this.gl,o=this.textures.get(e.key);if(o&&o.width===e.width&&o.height===e.height)return o;const r=(o==null?void 0:o.texture)??n.createTexture();if(!r)return null;n.bindTexture(n.TEXTURE_2D,r);try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e.source)}catch(i){if(o||n.deleteTexture(r),np(i))return"tainted";throw i}n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);const s={texture:r,width:e.width,height:e.height};return this.textures.set(e.key,s),s}}function ep(t,e,n){const o=ji(t,t.VERTEX_SHADER,e),r=ji(t,t.FRAGMENT_SHADER,n),s=t.createProgram();if(!s)throw new Error("Could not create WebGL program");if(t.attachShader(s,o),t.attachShader(s,r),t.linkProgram(s),t.deleteShader(o),t.deleteShader(r),!t.getProgramParameter(s,t.LINK_STATUS)){const i=t.getProgramInfoLog(s);throw t.deleteProgram(s),new Error(`Could not link WebGL program: ${i}`)}return s}function ji(t,e,n){const o=t.createShader(e);if(!o)throw new Error("Could not create WebGL shader");if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const r=t.getShaderInfoLog(o);throw t.deleteShader(o),new Error(`Could not compile WebGL shader: ${r}`)}return o}function np(t){return typeof t=="object"&&t!==null&&t.name==="SecurityError"}function Oc(t,e){return le(ee(e.width/2,e.height/2),Nn(t.rotation),ce(t.zoom),ee(-t.x,-t.y))}function Nc(t,e){return le(ee(t.x,t.y),ce(1/t.zoom),Nn(-t.rotation),ee(-e.width/2,-e.height/2))}function Vi(t,e,n){return ve(Nc(t,e),n)}function op(t,e,n){return ve(Oc(t,e),n)}function Lr(t,e){return Mo(Nc(t,e),{x:0,y:0,width:e.width,height:e.height})}function rp(t,e,n=0,o=0){const r=Mo(Nn(n),t),s=Math.max(1,e.width*(1-o*2)),i=Math.max(1,e.height*(1-o*2)),a=Math.min(s/Math.max(r.width,Number.EPSILON),i/Math.max(r.height,Number.EPSILON)),c=Mc(t);return{x:c.x,y:c.y,zoom:a,rotation:n}}function mo(t,e,n,o,r){const s=ve(le(ce(1/n),Nn(-o)),{x:e.x-r.width/2,y:e.y-r.height/2});return{x:t.x-s.x,y:t.y-s.y}}function qi(t,e){return t.x===e.x&&t.y===e.y&&t.zoom===e.zoom&&t.rotation===e.rotation}const sp=.09,ip=1e-4,Ki=.05,ap=1e-4;class cp{constructor(e,n=sp,o){I(this,"current");I(this,"target",null);I(this,"timeConstant");I(this,"spring");I(this,"start");I(this,"elapsed",0);this.current={...e},this.start={...e},this.timeConstant=n,this.spring=o}get destination(){return this.target?{...this.target.state}:{...this.current}}set(e){this.current={...e},this.target=null}animateTo(e,n,o=false){const r=this.spring?this.spring.duration<=0:this.timeConstant===0;if(o||r){this.set(e.state);return}let s=e.anchor;if(s){const i=mo(s.world,s.screen,e.state.zoom,e.state.rotation,n);Math.hypot(i.x-e.state.x,i.y-e.state.y)*e.state.zoom>Ki&&(s=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...e.state},anchor:s}}stop(){this.target=null}step(e,n){const o=this.target;if(!o)return false;const r=o.state;let s,i;if(this.spring){this.elapsed+=Math.max(e,0);const d=this.elapsed/this.spring.duration;if(d>=1)return this.current={...r},this.target=null,false;const h=this.spring.stiffness;s=this.start,i=(1-Math.exp(-h*d))/(1-Math.exp(-h))}else s=this.current,i=1-Math.exp(-Math.max(e,0)/this.timeConstant);const a=Math.exp(Math.log(s.zoom)+(Math.log(r.zoom)-Math.log(s.zoom))*i),c=s.rotation+(r.rotation-s.rotation)*i,l=o.anchor?mo(o.anchor.world,o.anchor.screen,a,c,n):{x:s.x+(r.x-s.x)*i,y:s.y+(r.y-s.y)*i};return this.current={x:l.x,y:l.y,zoom:a,rotation:c},this.spring?true:Math.abs(Math.log(r.zoom/a))<ip&&Math.abs(r.rotation-c)<ap&&Math.hypot(r.x-l.x,r.y-l.y)*a<Ki?(this.current={...r},this.target=null,false):true}}const Rc=5,Zi=300,lp=Rc*4;function Gi(t,e=false){return t==="touch"||t==="pen"&&!e}function up(t){return t.pointerType==="pen"&&t.buttons===0}function dp(t,e,n){for(let o=t;o&&o!==e;o=o.parentElement)if((n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)>=1&&/auto|scroll/.test(getComputedStyle(o).overflowY))return true;return false}function Xi(t,e){var o;let n=t;for(;n&&n!==e;){if(n instanceof HTMLButtonElement||n instanceof HTMLAnchorElement||n instanceof HTMLInputElement||n instanceof HTMLLabelElement||n instanceof HTMLSelectElement||((o=n.dataset)==null?void 0:o.cloverCanvasInteractive)!==void 0)return true;n=n.parentElement}return false}const Ar={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},ir=2,Yi=1.5,Ji=.1,fp=100,hp=.002,pp=.01;class mp{constructor(e,n,o=Ar){I(this,"pointers",new Map);I(this,"samples",[]);I(this,"down",null);I(this,"pinch",null);I(this,"lastTap",null);I(this,"lastPointerType","");I(this,"penHovers",false);I(this,"onPointerDown",e2=>{var o2,r;if(this.lastPointerType=e2.pointerType,e2.pointerType==="mouse"&&e2.button!==0||Xi(e2.target,this.element))return;(r=(o2=this.element).setPointerCapture)==null||r.call(o2,e2.pointerId);const n2=this.local(e2);this.pointers.set(e2.pointerId,n2),this.pointers.size===1?(this.down={x:n2.x,y:n2.y,t:e2.timeStamp,moved:false},this.samples=[{x:n2.x,y:n2.y,t:e2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});I(this,"onPointerMove",e2=>{var r;up(e2)&&(this.penHovers=true);const n2=this.pointers.get(e2.pointerId);if(!n2)return;const o2=this.local(e2);if(this.pointers.set(e2.pointerId,o2),this.pointers.size===1){const s=o2.x-n2.x,i=o2.y-n2.y;this.down&&Math.hypot(o2.x-this.down.x,o2.y-this.down.y)>Rc&&(this.down.moved=true),(r=this.down)!=null&&r.moved&&this.options.navigable&&this.target.panBy(s,i,!this.tracksPointer(e2.pointerType)),this.samples.push({x:o2.x,y:o2.y,t:e2.timeStamp});const a=e2.timeStamp-fp;for(;this.samples.length>2&&this.samples[0].t<a;)this.samples.shift()}else if(this.pointers.size===2&&this.pinch&&this.options.navigable){const s=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(s.distance/this.pinch.distance,s.mid,false),this.target.panBy(s.mid.x-this.pinch.mid.x,s.mid.y-this.pinch.mid.y,false),this.pinch=s}});I(this,"onPointerUp",e2=>{var c,l,u,d,h,p;if(!this.pointers.has(e2.pointerId))return;if(this.pointers.delete(e2.pointerId),(l=(c=this.element).releasePointerCapture)==null||l.call(c,e2.pointerId),this.pointers.size===1){this.pinch=null;const[m]=this.pointers.values();this.samples=[{...m,t:e2.timeStamp}];return}if(this.pointers.size>0)return;const n2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!n2)return;const o2=this.local(e2);if(!n2.moved&&e2.type==="pointerup"&&e2.timeStamp-n2.t<Zi){if((d=(u=this.target).dismiss)!=null&&d.call(u)){this.lastTap=null;return}if(Gi(e2.pointerType,this.penHovers)){const m=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&m&&e2.timeStamp-m.t<Zi&&Math.hypot(o2.x-m.x,o2.y-m.y)<lp?(this.lastTap=null,this.zoomIn(o2)):this.lastTap={x:o2.x,y:o2.y,t:e2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?e2.shiftKey?this.target.zoomBy(1/ir,o2,true):this.zoomIn(o2):(p=(h=this.target).tap)==null||p.call(h,o2);return}if(!this.options.navigable||!this.tracksPointer(e2.pointerType))return;const s=this.samples[0],i=this.samples[this.samples.length-1],a=((i==null?void 0:i.t)??0)-((s==null?void 0:s.t)??0);if(s&&i&&a>0&&e2.timeStamp-i.t<50){const m=(i.x-s.x)/a*1e3,g=(i.y-s.y)/a*1e3,b=this.options.flickMomentum;b>0&&Math.hypot(m,g)>this.options.flickMinSpeed&&this.target.panBy(m*b,g*b,true)}});I(this,"onDoubleClick",e2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||Gi(this.lastPointerType,this.penHovers)||Xi(e2.target,this.element)||(e2.shiftKey?this.target.zoomBy(1/ir,this.local(e2),true):this.zoomIn(this.local(e2))))});I(this,"onWheel",e2=>{const n2=e2.ctrlKey;if(!this.options.navigable||!n2&&!this.options.scrollToZoom||!n2&&dp(e2.target,this.element,e2.deltaY))return;e2.preventDefault();const o2=gp(e2),r=n2?pp:hp;this.target.zoomBy(Math.exp(-o2*r),this.local(e2),!n2)});I(this,"onKeyDown",e2=>{if(e2.target!==this.element||!this.options.navigable||e2.altKey||e2.metaKey||e2.ctrlKey)return;const n2=this.element.getBoundingClientRect(),o2=n2.width*Ji*(e2.shiftKey?3:1),r=n2.height*Ji*(e2.shiftKey?3:1);switch(e2.key){case"ArrowLeft":this.target.panBy(o2,0,true);break;case"ArrowRight":this.target.panBy(-o2,0,true);break;case"ArrowUp":this.target.panBy(0,r,true);break;case"ArrowDown":this.target.panBy(0,-r,true);break;case"+":case"=":this.target.zoomBy(Yi,void 0,true);break;case"-":case"_":this.target.zoomBy(1/Yi,void 0,true);break;case"0":this.target.home();break;case"r":this.target.rotateBy(90);break;case"R":this.target.rotateBy(-90);break;default:return}e2.preventDefault()});this.element=e,this.target=n,this.options=o,e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("dblclick",this.onDoubleClick),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("keydown",this.onKeyDown)}setOptions(e){this.options=e}dispose(){const e=this.element;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("dblclick",this.onDoubleClick),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("keydown",this.onKeyDown)}local(e){const n=this.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}zoomIn(e){var n,o;(o=(n=this.target).atMaxZoom)!=null&&o.call(n)?this.target.home():this.target.zoomBy(ir,e,true)}tracksPointer(e){return e==="touch"||this.options.flickEnabled}pinchState(){const[e,n]=[...this.pointers.values()];return{distance:Math.hypot(n.x-e.x,n.y-e.y),mid:{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}}}function gp(t){return t.deltaMode===1?t.deltaY*16:t.deltaMode===2?t.deltaY*400:t.deltaY}class Bc extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageLoadError"}}const Qi=new Set;async function vp(t,e={}){const{signal:n,maxTextureSize:o,request:r}=e,s=xd(r),i=bp(t);if(typeof createImageBitmap!="function"||typeof fetch!="function")return ar(t,{signal:n,cors:true,withCredentials:s});if(i&&Qi.has(i))return ar(t,{signal:n,cors:false,withCredentials:s});let a;try{a=await ns(r,t,{mode:"cors",signal:n})}catch(h){if(_p(h,n))throw h;const p=await ar(t,{signal:n,cors:false,withCredentials:s});return i&&Qi.add(i),p}if(!a.ok)throw new Bc(`Image request failed with ${a.status}`,t,a.status);const c=await a.blob();let l=await yp(c);const u=l.width,d=l.height;if(o&&(l.width>o||l.height>o)){const h=o/Math.max(l.width,l.height),p=await createImageBitmap(l,{resizeWidth:Math.max(1,Math.floor(l.width*h)),resizeHeight:Math.max(1,Math.floor(l.height*h)),resizeQuality:"high"});l.close(),l=p}if(n!=null&&n.aborted)throw l.close(),Or();return{kind:"bitmap",source:l,width:l.width,height:l.height,naturalWidth:u,naturalHeight:d,opaque:false}}async function yp(t){const e={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(t,e)}catch(n){if(n instanceof TypeError)return createImageBitmap(t);throw n}}function ar(t,{signal:e,cors:n,withCredentials:o}){return new Promise((r,s)=>{if(e!=null&&e.aborted){s(Or());return}const i=new Image;i.decoding="async",n&&(i.crossOrigin=o?"use-credentials":"anonymous");const a=()=>{i.onload=null,i.onerror=null,e==null||e.removeEventListener("abort",c)},c=()=>{a(),i.src="",s(Or())};e==null||e.addEventListener("abort",c),i.onload=()=>{a();const l=()=>r({kind:"element",source:i,width:i.naturalWidth,height:i.naturalHeight,naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight,opaque:!n});typeof i.decode=="function"?i.decode().then(l,l):l()},i.onerror=()=>{a(),s(new Bc("Image failed to load",t))},i.src=t})}function bp(t){var e;try{return new URL(t,(e=globalThis.location)==null?void 0:e.href).origin}catch{return null}}function _p(t,e){return!!(e!=null&&e.aborted)||typeof t=="object"&&t!==null&&t.name==="AbortError"}function Or(){const t=new Error("Aborted");return t.name="AbortError",t}function ta(t){t.kind==="bitmap"&&t.source.close()}const wp=192*1024*1024,xp=6,Sp=2;class kp{constructor(e){I(this,"entries",new Map);I(this,"inFlight",0);I(this,"frame",0);I(this,"bytes",0);I(this,"wanted",[]);I(this,"disposed",false);I(this,"budget");I(this,"maxInFlight");this.options=e,this.budget=e.byteBudget??wp,this.maxInFlight=e.maxInFlight??xp}get(e){const n=this.entries.get(e);if((n==null?void 0:n.state)==="ready")return n.lastUsed=this.frame,n.image}has(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="ready"}failed(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(e,n){var r;const o=this.entries.get(e);(o==null?void 0:o.state)!=="ready"&&((r=o==null?void 0:o.controller)==null||r.abort(),this.entries.set(e,{url:e,state:"ready",image:n,bytes:cr(n),lastUsed:this.frame,attempts:0,pinned:false,waiters:(o==null?void 0:o.waiters)??[]}),this.bytes+=cr(n),this.flushWaiters(e))}prefetch(e){return Promise.all(e.map(n=>new Promise(o=>{const r=this.entries.get(n.url);if(r&&r.state!=="loading")return o();if(r){r.waiters.push(o);return}this.start({...n,priority:-1},o)}))).then(()=>{})}update(e){if(this.disposed)return;this.frame++;const n=new Set(e.map(o=>o.url));this.wanted=[...e].sort((o,r)=>o.priority-r.priority);for(const o of this.entries.values())o.state==="loading"&&!o.pinned&&!n.has(o.url)&&o.controller&&(o.controller.abort(),this.entries.delete(o.url),this.inFlight--);for(const o of this.wanted){const r=this.entries.get(o.url);r&&(r.lastUsed=this.frame)}this.pump(),this.evict(n)}dispose(){var e;this.disposed=true;for(const n of this.entries.values())(e=n.controller)==null||e.abort(),this.flushWaiters(n.url);this.entries.clear(),this.bytes=0}forEachReady(e){for(const n of this.entries.values())n.state==="ready"&&n.image&&e(n.url,n.image)}pump(){for(const e of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(e.url)||this.start(e)}}start(e,n){const o=new AbortController,r={url:e.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:o,pinned:!!n,waiters:n?[n]:[]};this.entries.set(e.url,r),this.inFlight++,this.attempt(r,e,o,e.url)}attempt(e,n,o,r){e.attempts++,this.options.load(r,o.signal).then(s=>{if(this.disposed||this.entries.get(e.url)!==e){ta(s);return}e.state="ready",e.image=s,e.bytes=cr(s),e.controller=void 0,e.pinned=false,this.bytes+=e.bytes,this.settle(e)},s=>{if(!(o.signal.aborted||this.disposed)&&this.entries.get(e.url)===e){if(e.attempts<Sp&&!Cp(s,n)){this.attempt(e,n,o,n.fallbackUrl??n.url);return}e.state="failed",e.controller=void 0,e.pinned=false,this.settle(e)}})}settle(e){this.inFlight--,this.flushWaiters(e.url),this.options.onSettled(),this.pump()}flushWaiters(e){const n=this.entries.get(e);if(!n)return;const o=n.waiters;n.waiters=[],o.forEach(r=>r())}evict(e){if(this.bytes<=this.budget)return;const n=[...this.entries.values()].filter(o=>o.state==="ready"&&!e.has(o.url)).sort((o,r)=>o.lastUsed-r.lastUsed);for(const o of n){if(this.bytes<=this.budget)break;this.entries.delete(o.url),this.bytes-=o.bytes,o.image&&ta(o.image),this.options.onEvict(o.url)}}}function cr(t){return t.width*t.height*4}function Cp(t,e){if(e.fallbackUrl)return false;const n=t==null?void 0:t.status;return typeof n=="number"&&n>=400&&n<500&&n!==408&&n!==429}const Ep=.1;class Mp{constructor(e,n=r=>requestAnimationFrame(r),o=r=>cancelAnimationFrame(r)){I(this,"handle",0);I(this,"last",0);I(this,"disposed",false);I(this,"frame",e2=>{if(this.handle=0,this.disposed)return;const n2=this.last?Math.min((e2-this.last)/1e3,Ep):1/60;this.last=e2,this.tick(n2,e2)?this.invalidate():this.last=0});this.tick=e,this.raf=n,this.caf=o}invalidate(){this.disposed||this.handle||(this.handle=this.raf(this.frame))}drawNow(){this.disposed||(this.handle&&this.caf(this.handle),this.frame(performance.now()))}dispose(){this.disposed=true,this.handle&&this.caf(this.handle),this.handle=0}}const Tp=2*1024*1024;function Ip(t,e,n=Tp){const o=new Set;let r=n,s=false;return{get deferred(){return s},getTile(i){const a=t(i);if(!a||a.kind==="media"||a.opaque||o.has(i)||e(i))return a;const c=a.width*a.height*4;if(o.size>0&&c>r){s=true;return}return r-=c,o.add(i),a}}}function Pp(t){const e=/^(!)?(\d+(?:\.\d+)?)$/.exec((t==null?void 0:t.trim())??"");if(!e)return null;const n=Number(e[2]);if(n>360)return null;const o=n%360,r=!!e[1];return o||r?{degrees:o,mirror:r}:null}function Lp(t,e,n){if(!t)return null;let o=t.trim().replace(/^xywh=/,""),r=false;o.startsWith("pct:")?(r=true,o=o.slice(4)):o.startsWith("pixel:")&&(o=o.slice(6));const s=o.split(",").map(Number);if(s.length!==4||s.some(m=>!Number.isFinite(m)))return null;let[i,a,c,l]=s;r&&(i=i/100*e,a=a/100*n,c=c/100*e,l=l/100*n);const u=Math.max(0,i),d=Math.max(0,a),h=Math.min(e,i+c),p=Math.min(n,a+l);return h<=u||p<=d?null:{x:u,y:d,width:h-u,height:p-d}}const lr=512,Ap=16e6;function $c(t,e,n){return{width:e,height:n,levels:[{scaleFactor:1,width:e,height:n,tileWidth:e,tileHeight:n,cols:1,rows:1}],tile:r=>({...r,url:t,region:{x:0,y:0,width:e,height:n}})}}function Op(t){const{width:e,height:n}=t,o=[],r=t.regionByPx&&t.sizeByW,s=(h,p,m)=>{const g=Math.ceil(e/h),b=Math.ceil(n/h);return{scaleFactor:h,width:g,height:b,tileWidth:p,tileHeight:m,cols:Math.ceil(g/p),rows:Math.ceil(b/m)}},i=(h,p)=>({scaleFactor:e/h,width:h,height:p,tileWidth:h,tileHeight:p,cols:1,rows:1,whole:true}),a=t.tiles[0];if(a)for(const h of a.scaleFactors)o.push(s(h,a.width,a.height));else if(r)for(let h=1;;h*=2){const p=s(h,lr,lr);if(o.push(p),p.cols===1&&p.rows===1)break}const c=Math.max(0,...o.map(h=>h.scaleFactor));for(const h of t.sizes){const p=e/h.width;Np(t,h.width,h.height)&&p>c+1e-9&&o.push(i(h.width,h.height))}const l=o.reduce((h,p)=>!h||p.scaleFactor>h.scaleFactor?p:h,null);if(l&&l.cols*l.rows>1&&t.sizeByW){const h=Math.max(e,n)/lr;o.push(i(Math.ceil(e/h),Math.ceil(n/h)))}(!o.length||!a&&!r&&e*n<=Ap)&&(o.some(h=>h.scaleFactor===1)||o.push(i(e,n)));const u=Rp(o).sort((h,p)=>p.scaleFactor-h.scaleFactor),d=zf(t);return{width:e,height:n,levels:u,tile(h){const p=u[h.level],m=p.scaleFactor,g=p.cols===1&&p.rows===1;let b,v,w;if(g)b={x:0,y:0,width:e,height:n},v=p.width,w=p.height;else{const _=Math.round(h.col*p.tileWidth*m),x=Math.round(h.row*p.tileHeight*m);b={x:_,y:x,width:Math.min(Math.round(p.tileWidth*m),e-_),height:Math.min(Math.round(p.tileHeight*m),n-x)},v=Math.ceil(b.width/m),w=Math.ceil(b.height/m)}return{...h,region:b,url:uo(t,b,v,w),fallbackUrl:d?uo(t,b,v,w,d):void 0}}}}function Np(t,e,n){return!(t.maxWidth&&e>t.maxWidth||t.maxHeight&&n>t.maxHeight||t.maxArea&&e*n>t.maxArea)}function Rp(t){const e=new Map;for(const n of t){const o=`${n.width}x${n.height}`,r=e.get(o);(!r||r.cols*r.rows<n.cols*n.rows)&&e.set(o,n)}return[...e.values()]}function Bp(t,e){const n=t.levels;for(let o=0;o<n.length;o++)if(n[o].scaleFactor<=e*(1+1e-6))return o;return n.length-1}function Te(t,e,n){const o=t.levels[e],r=o.tileWidth*o.scaleFactor,s=o.tileHeight*o.scaleFactor,i=Math.max(0,n.x),a=Math.max(0,n.y),c=Math.min(t.width,n.x+n.width),l=Math.min(t.height,n.y+n.height);if(c<=i||l<=a)return[];const u=Math.max(0,Math.floor(i/r)),d=Math.min(o.cols-1,Math.floor((c-1e-9)/r)),h=Math.max(0,Math.floor(a/s)),p=Math.min(o.rows-1,Math.floor((l-1e-9)/s)),m=[];for(let g=h;g<=p;g++)for(let b=u;b<=d;b++)m.push({level:e,col:b,row:g});return m}async function $p(t,e){if(t.media)return Fp(t,t.media);let n=null,o=null;if(t.service)try{n=Op(await cs(t.service,e.infoOptions))}catch(h){o=h}if(!n){if(!t.url)throw o??new Error("Image has no source");const h=await e.loadStatic(t.url);e.cache.seed(t.url,h),n=$c(t.url,h.naturalWidth,h.naturalHeight)}const r=t.width&&t.height&&t.width>0&&t.height>0?{width:t.width,height:t.height}:{width:n.width,height:n.height},s=Lp(t.region,r.width,r.height)??{x:0,y:0,width:r.width,height:r.height},i=n.width/r.width,a=n.height/r.height,c={x:s.x*i,y:s.y*a,width:s.width*i,height:s.height*a},l=Pp(t.rotation),u=l?Dp(c,l):void 0,d={id:t.id,spec:t,pyramid:n,size:r,clip:c,contentClip:s,rect:{x:0,y:0,width:s.width,height:s.height},...u?{turn:u}:{}};return await e.cache.prefetch(Te(n,0,c).map(h=>{const p=n.tile(h);return{url:p.url,fallbackUrl:p.fallbackUrl}})),d}const Fc="media:";function Fp(t,e){var a,c;const n=t.width||((a=t.placement)==null?void 0:a.width)||e.element.videoWidth||1600,o=t.height||((c=t.placement)==null?void 0:c.height)||e.element.videoHeight||900,r=`${Fc}${t.id}`,s={width:n,height:o},i={x:0,y:0,width:n,height:o};return{id:t.id,spec:t,pyramid:$c(r,n,o),media:{kind:"media",source:e.element,width:n,height:o,naturalWidth:n,naturalHeight:o},size:s,clip:i,contentClip:i,rect:{...i}}}function Dp(t,{degrees:e,mirror:n}){const o=e*Math.PI/180,r=u=>Math.abs(u)<1e-12?0:u,s=r(Math.cos(o)),i=r(Math.sin(o)),a=Math.abs(t.width*s)+Math.abs(t.height*i),c=Math.abs(t.width*i)+Math.abs(t.height*s),l=le(ee(a/2,c/2),{a:s,b:i,c:-i,d:s,e:0,f:0},ce(n?-1:1,1),ee(-(t.x+t.width/2),-(t.y+t.height/2)));return{orient:l,unorient:ph(l),width:a,height:c}}function Dc(t){var e;return((e=t.turn)==null?void 0:e.orient)??ee(-t.clip.x,-t.clip.y)}function zp(t,e){const{turn:n,clip:o}=t;if(!n)return{...e,x:o.x+e.x,y:o.y+e.y};const r=Mo(n.unorient,e),s=Math.max(r.x,o.x),i=Math.max(r.y,o.y);return{x:s,y:i,width:Math.max(0,Math.min(r.x+r.width,o.x+o.width)-s),height:Math.max(0,Math.min(r.y+r.height,o.y+o.height)-i)}}function Hp(t,e){const{turn:n,clip:o}=t;return n?ve(n.unorient,e):{x:o.x+e.x,y:o.y+e.y}}function ea(t){const{turn:e,clip:n,contentClip:o}=t;return e?{width:e.width*o.width/n.width,height:e.height*o.height/n.height}:o}function Wp(t){if(!t.length)return null;if(t.every(o=>o.spec.placement)){for(const o of t)o.rect={...o.spec.placement};return ds(t.map(o=>o.rect))}const e=ea(t[0]).height;let n=0;for(const o of t){const r=ea(o),s=r.width*e/r.height;o.rect={x:n,y:0,width:s,height:e},n+=s}return{x:0,y:0,width:n,height:e}}function To(t){const e=t.turn??t.clip;return{x:t.rect.width/e.width,y:t.rect.height/e.height}}function Up(t){const e=To(t);return le(ee(t.rect.x,t.rect.y),ce(e.x,e.y),Dc(t))}function jp(t,e){var n,o;return t.service===e.service&&t.url===e.url&&t.width===e.width&&t.height===e.height&&t.region===e.region&&t.rotation===e.rotation&&((n=t.media)==null?void 0:n.element)===((o=e.media)==null?void 0:o.element)&&JSON.stringify(t.placement)===JSON.stringify(e.placement)}const Vp=1e7,qp=15e6,Kp=2e7,Zp=2;function Gp(t){const{items:e,camera:n,viewport:o,pixelRatio:r,getTile:s,destination:i}=t,a=Oc(n,o),c=[],l=[],u=[],d=(h,p,m)=>{const g=h.tile(p);l.push({url:g.url,fallbackUrl:g.fallbackUrl,priority:m})};for(const h of e){const{pyramid:p,clip:m,rect:g}=h,b=To(h);if(t.wantOverview)for(const T of Te(p,0,m))d(p,T,Kp);const v=na(h,n,o,r),w=i?na(h,i,o,r):v;if(u.push((v==null?void 0:v.target)??-1),!v&&!w)continue;const _=T=>E=>{const A=p.tile(E).region;return Math.hypot(A.x+A.width/2-T.x,A.y+A.height/2-T.y)};if(w){const T=_(w.center);for(const E of Te(p,0,w.area))d(p,E,T(E)/1e3);if(w.target>0)for(const E of Te(p,w.target,w.area))d(p,E,Vp+T(E))}if(!v)continue;const{area:x,target:S}=v,M=_(v.center),R=Te(p,0,x),N=S===0?[]:Te(p,S,x);if(w!==v){for(const E of R)d(p,E,M(E)/1e3);const T=S-Zp;if(T>0)for(const E of Te(p,T,x))d(p,E,qp+M(E))}if(h.spec.hidden)continue;const X=(S===0?R:N).every(T=>s(p.tile(T).url)!==void 0)?[S]:Array.from({length:S+1},(T,E)=>E),V=le(a,ee(g.x,g.y),ce(b.x,b.y),Dc(h));for(const T of X){const E=T===0?R:T===S?N:Te(p,T,x),A=p.levels[T].cols*p.levels[T].rows>1;for(const W of E){const G=p.tile(W),Y=s(G.url);if(!Y)continue;const st=Xp(h,G.region,Y,V,A);st&&c.push({...st,url:G.url})}}}return l.sort((h,p)=>h.priority-p.priority),{draws:c,wants:Yp(l),levels:u}}function na(t,e,n,o){const{pyramid:r,rect:s}=t,i=Lr(e,n);if(!vh(i,s))return null;const a=To(t),c=Math.max(i.x,s.x),l=Math.max(i.y,s.y),u=Math.min(i.x+i.width,s.x+s.width),d=Math.min(i.y+i.height,s.y+s.height),h=1/(a.x*e.zoom*o);return{area:zp(t,{x:(c-s.x)/a.x,y:(l-s.y)/a.y,width:(u-c)/a.x,height:(d-l)/a.y}),center:Hp(t,{x:(e.x-s.x)/a.x,y:(e.y-s.y)/a.y}),target:Bp(r,h)}}function Xp(t,e,n,o,r){const{clip:s}=t,i=Math.max(e.x,s.x),a=Math.max(e.y,s.y),c=Math.min(e.x+e.width,s.x+s.width),l=Math.min(e.y+e.height,s.y+s.height);if(c<=i||l<=a)return null;const u=n.width/e.width,d=n.height/e.height,h=1e-6;return{item:t,image:n,transform:le(o,ee(e.x,e.y),ce(1/u,1/d)),crop:{x:(i-e.x)*u,y:(a-e.y)*d,width:(c-i)*u,height:(l-a)*d},bleed:{right:r&&c<s.x+s.width-h,bottom:r&&l<s.y+s.height-h}}}function Yp(t){const e=new Set;return t.filter(n=>e.has(n.url)?false:(e.add(n.url),true))}const Jp={maxZoomPixelRatio:1.1,minZoomImageRatio:.9,animationTime:.09,animationDuration:void 0,springStiffness:6.5,constrainDuringPan:true,request:void 0,byteBudget:192*1024*1024,maxInFlight:6,releaseAfterMs:2e3},Qp=2,tm=3,em=.1,ur=1e-6,Nr={top:0,right:0,bottom:0,left:0};function oa(t,e="padding"){if(!t||typeof getComputedStyle!="function")return Nr;const n=getComputedStyle(t),o=r=>parseFloat(n.getPropertyValue(`${e}-${r}`))||0;return{top:o("top"),right:o("right"),bottom:o("bottom"),left:o("left")}}const nm=(t,e)=>t.top===e.top&&t.right===e.right&&t.bottom===e.bottom&&t.left===e.left;let om;class rm{constructor(e,n={}){I(this,"host");I(this,"overlays",null);I(this,"options");I(this,"backend",null);I(this,"backendPreference");I(this,"contextLosses",0);I(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});I(this,"visible",true);I(this,"dom",null);I(this,"domAsked",false);I(this,"pending",null);I(this,"camera");I(this,"loop");I(this,"gestures");I(this,"gestureOptions",{});I(this,"cache");I(this,"navigator",null);I(this,"navigatorAsked",0);I(this,"viewport",{width:1,height:1});I(this,"inset",Nr);I(this,"pixelRatio",1);I(this,"items",[]);I(this,"worldBounds",null);I(this,"contentVersion",0);I(this,"opaqueUrls",new Set);I(this,"mediaByKey",new Map);I(this,"detachMedia",[]);I(this,"opened",false);I(this,"atHome",true);I(this,"interacting",false);I(this,"lastEmitted",null);I(this,"generation",0);I(this,"listeners",new Map);I(this,"unloadable",false);I(this,"resizeObserver",null);I(this,"intersectionObserver",null);I(this,"releaseTimer",null);I(this,"dprQuery",null);I(this,"disposed",false);I(this,"dismisser",null);I(this,"tick",e2=>{var c,l;if(this.disposed)return false;const n2=this.camera.step(e2,this.viewport),o2=this.camera.current,r2=this.backend,s=Ip(this.getTile,u=>r2?r2.has(u):true),i=Gp({items:this.items,camera:o2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:s.getTile,wantOverview:!!this.navigator,destination:n2?this.camera.destination:void 0}),a=i.wants.filter(u=>!u.url.startsWith(Fc));return this.cache.update(a),i.draws.length?this.setUnloadable(false):a.length&&a.every(u=>this.cache.failed(u.url))&&this.setUnloadable(true),this.paint(i.draws),(c=this.overlays)==null||c.position(o2,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(u=>!u.spec.hidden),this.worldBounds,Lr(o2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!qi(this.lastEmitted,o2))&&(this.lastEmitted={...o2},this.opened&&this.emit("viewport")),n2||s.deferred});I(this,"getTile",e2=>this.mediaByKey.get(e2)??this.cache.get(e2));I(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});I(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=e,this.backendPreference=n.backend??"auto",this.options={...Jp,...dr(n)},sa()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:o,springStiffness:r}=this.options;this.camera=new cp({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,o===void 0?void 0:{duration:o,stiffness:r}),this.loop=new Mp(this.tick),this.gestureOptions=dr(n.gestures??{}),sa()&&(this.gestureOptions.flickMomentum=0),this.gestures=new mp(e,this,{...Ar,...this.gestureOptions}),this.cache=new kp({load:(s,i)=>this.loadTile(s,i),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:s=>{var i;return(i=this.backend)==null?void 0:i.release(s)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=sm(e),this.visible?this.acquireBackend():this.holder.hiddenSince=ra(),this.measure(),this.observe()}get backendKind(){var e;return((e=this.backend)==null?void 0:e.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(e,n){let o=this.listeners.get(e);return o||(o=new Set,this.listeners.set(e,o)),o.add(n),()=>o==null?void 0:o.delete(n)}async setImages(e,{world:n,fit:o=false}={}){const r=++this.generation,s=new Map(this.items.map(u=>[u.id,u])),i=await Promise.allSettled(e.map(u=>{const d=s.get(u.id);return d&&jp(d.spec,u)?(d.spec=u,Promise.resolve(d)):$p(u,{cache:this.cache,loadStatic:h=>this.loadTile(h),infoOptions:{request:this.options.request}})}));if(r!==this.generation||this.disposed)return;const a=i.filter(u=>u.status==="fulfilled").map(u=>u.value),c=i.filter(u=>u.status==="rejected").map(u=>u.reason);this.items=a,this.watchMedia(a);const l=Wp(a);if(this.worldBounds=n?l?ds([n,l]):n:l,this.contentVersion++,c.length&&this.emit("error",c),this.setUnloadable(e.length>0&&!a.length&&c.length>0),!this.worldBounds){this.invalidate();return}this.opened?o?(this.home(true),this.emit("change")):(this.camera.set(this.constrain(this.camera.current)),this.emit("change")):(this.opened=true,this.home(true),this.emit("open")),this.invalidate()}clear(){this.setUnloadable(false),this.generation++,this.items=[],this.watchMedia([]),this.worldBounds=null,this.contentVersion++,this.invalidate()}setHidden(e){const n=new Set(e);let o=false;for(const r of this.items){const s=n.has(r.id);!!r.spec.hidden!==s&&(r.spec={...r.spec,hidden:s},o=true)}o&&this.invalidate()}isReady(e){const n=this.items.find(r=>r.id===e);if(!n)return false;if(n.spec.media)return true;const o=n.pyramid.levels[0];if(!o)return false;for(let r=0;r<o.rows;r++)for(let s=0;s<o.cols;s++)if(!this.getTile(n.pyramid.tile({level:0,col:s,row:r}).url))return false;return true}fitBounds(e,n=false,o=Nr){const r=this.fit(e,this.camera.destination.rotation,o);this.atHome=false,this.animateTo(this.constrain(r,{allowBeyondLimits:true}),n)}fit(e,n,{top:o,right:r,bottom:s,left:i}){const{width:a,height:c}=this.viewport,{zoom:l}=rp(e,{width:Math.max(1,a-i-r),height:Math.max(1,c-o-s)},n);return{...mo(Mc(e),{x:(a+i-r)/2,y:(c+o-s)/2},l,n,this.viewport),zoom:l,rotation:n}}fitItemRect(e,n,o=false){const r=this.itemRectToWorld(e,n);r&&this.fitAnnotation(r,o)}fitAnnotation(e,n=false){var s;const o=this.items[0];if(!o)return;const r=o.rect.width*em;this.fitBounds({x:e.x-r,y:e.y-r,width:e.width+r*2,height:e.height+r*2},n,oa((s=this.overlays)==null?void 0:s.container,"scroll-padding"))}getBounds(){return Lr(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var o;const e=((o=this.homeCamera())==null?void 0:o.zoom)??1,n=this.items.length?Math.min(...this.items.map(r=>To(r).x)):1;return{home:e,min:e*this.options.minZoomImageRatio,max:Math.max(e,this.options.maxZoomPixelRatio/n)}}home(e=false){const n=this.homeCamera();if(!n)return;const o=this.atHome;this.atHome=true,this.animateTo(n,e),!o&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-ur)}viewLimits(){const{zoom:e,x:n,y:o,rotation:r}=this.camera.destination,{min:s,max:i}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:e>=i*(1-ur),atMin:e<=s*(1+ur),atHome:this.atHome&&(!a||Math.abs(e/a.zoom-1)<.001&&Math.hypot(n-a.x,o-a.y)*e<.5&&Math.abs(r-a.rotation)<.001)}}zoomBy(e,n,o=true){const r=o?this.camera.destination:this.camera.current,s=n??{x:this.viewport.width/2,y:this.viewport.height/2},i=Vi(r,this.viewport,s),{min:a,max:c}=this.getZoomLimits(),l=yn(r.zoom*e,a,c),u=mo(i,s,l,r.rotation,this.viewport),d=this.constrain({...r,...u,zoom:l});this.atHome=false,o?this.camera.animateTo({state:d,anchor:{world:i,screen:s}},this.viewport):this.camera.set(d),this.invalidate()}panBy(e,n,o=false){const r=o?this.camera.destination:this.camera.current,s=ve(le(ce(1/r.zoom),Nn(-r.rotation)),{x:e,y:n}),i=this.constrain({...r,x:r.x-s.x,y:r.y-s.y});this.atHome=false,o?this.camera.animateTo({state:i},this.viewport):this.camera.set(i),this.invalidate()}panTo(e,n=false){const o=n?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...o,...e}),n)}rotateBy(e){const n=this.camera.destination;this.setRotation(n.rotation*180/Math.PI+e)}setRotation(e,n=false){const o=this.camera.destination,r=e*Math.PI/180;this.animateTo(this.constrain({...o,rotation:r}),n)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(e){this.emit("tap",e)}setDismiss(e){this.dismisser=e}dismiss(){var e;return((e=this.dismisser)==null?void 0:e.call(this))??false}setGestures(e){this.gestures.setOptions({...Ar,...this.gestureOptions,...dr(e)})}setInteracting(e){if(this.interacting=e,e){this.camera.stop();return}if(this.options.constrainDuringPan)return;const n=this.camera.destination,o=this.constrain(n);qi(n,o)||this.animateTo(o,false)}worldToScreenPoint(e){return op(this.camera.current,this.viewport,e)}screenToWorldPoint(e){return Vi(this.camera.current,this.viewport,e)}itemRectToWorld(e,n){const o=this.items[e];if(!o)return null;const{contentClip:r,clip:s}=o;if(o.turn)return Mo(le(Up(o),ce(s.width/r.width,s.height/r.height)),n);const i=o.rect.width/r.width,a=o.rect.height/r.height;return{x:o.rect.x+(n.x-r.x)*i,y:o.rect.y+(n.y-r.y)*a,width:n.width*i,height:n.height*a}}attachNavigator(e){var s;(s=this.navigator)==null||s.dispose(),this.navigator=null;const n=++this.navigatorAsked;let o=null,r=false;return import("./Navigator-DPdR3SYX.mjs").then(i=>{r||this.disposed||n!==this.navigatorAsked||(o=new i.Navigator(e,(a,c)=>this.panTo(a,c)),this.navigator=o,this.invalidate())}),()=>{r=true,o==null||o.dispose(),o&&this.navigator===o&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var e,n,o,r,s,i,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(e=this.resizeObserver)==null||e.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),(r=(o=this.dprQuery)==null?void 0:o.removeEventListener)==null||r.call(o,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(s=this.navigator)==null||s.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(i=this.dom)==null||i.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(c=>c()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}watchMedia(e){this.detachMedia.forEach(n=>n()),this.detachMedia=[],this.mediaByKey.clear();for(const n of e){if(!n.media||n.media.kind!=="media")continue;const o=n.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(o,n.media);const r=n.media.source,s=()=>this.invalidate(),i=["play","seeked","loadeddata","resize"];i.forEach(a=>r.addEventListener(a,s)),this.detachMedia.push(()=>i.forEach(a=>r.removeEventListener(a,s)))}}paint(e){const n=this.backend,o=[],r=(n==null?void 0:n.kind)==="webgl2";n==null||n.begin();for(const s of e){const{image:i}=s;if(!(i.kind==="media"||i.kind==="element"&&r&&(i.opaque||this.opaqueUrls.has(s.url)))&&n){if(n.draw({key:s.url,source:i.source,width:i.width,height:i.height,transform:s.transform,crop:s.crop,opacity:1,bleed:s.bleed})!=="tainted"||i.kind==="bitmap")continue;this.opaqueUrls.add(s.url)}(i.kind==="element"||i.kind==="media")&&o.push({key:`${s.item.id}|${s.url}`,element:i.source,width:i.width,height:i.height,transform:s.transform,crop:s.crop,opacity:1})}n==null||n.end(),this.dom?this.dom.sync(o):o.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-CwHg1jZg.mjs").then(({DomLayers:s})=>{if(this.disposed)return;const i=new s(this.host);this.overlays&&this.host.insertBefore(i.container,this.overlays.container),this.dom=i,this.invalidate()}))}loadTile(e,n){return vp(e,{signal:n,request:this.options.request,maxTextureSize:this.backend instanceof po?this.backend.maxTextureSize:void 0})}animateTo(e,n){this.camera.animateTo({state:e},this.viewport,n),this.invalidate()}homeCamera(){if(!this.worldBounds)return null;const e=2*Math.PI,n=Math.round(this.camera.destination.rotation/e)*e||0;return this.fit(this.worldBounds,n,this.inset)}constrain(e,{allowBeyondLimits:n=false}={}){const o=this.worldBounds;if(!o)return e;const{min:r,max:s}=this.getZoomLimits(),i=n?yn(e.zoom,r,Math.max(s,e.zoom)):yn(e.zoom,r,s);return this.interacting&&!this.options.constrainDuringPan?{...e,zoom:i}:{...e,zoom:i,x:yn(e.x,o.x,o.x+o.width),y:yn(e.y,o.y,o.y+o.height)}}acquireBackend(e=true){var s,i;if(this.backend||this.pending||this.disposed)return;const n=document.createElement("canvas");n.className="clover-canvas-surface",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(n,((s=this.dom)==null?void 0:s.container)??((i=this.overlays)==null?void 0:i.container)??null);const o=e&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<tm);let r=null;o&&(Xh(this.holder)||this.backendPreference==="webgl2")&&(r=po.create(n,{onLost:this.onContextLost}),r||Ui(this.holder)),r?this.install(r):this.backendPreference==="webgl2"?this.none(n):(this.pending=n,(om??(om=import("./Canvas2DBackend-B4IXvdsN.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==n)return;this.pending=null;const c=a.create(n);c?this.install(c):this.none(n)}))}none(e){e.remove(),this.host.dataset.backend="none"}install(e){this.backend=e,this.host.dataset.backend=e.kind,e.resize(this.viewport.width,this.viewport.height,this.pixelRatio),e.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",e.kind),this.invalidate()}releaseBackend(){var n;if(Ui(this.holder),(n=this.pending)==null||n.remove(),this.pending=null,!this.backend)return;const e=this.backend.canvas;this.backend.dispose(),e.remove(),this.backend=null}giveBack(){this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.releaseBackend(),this.host.dataset.backend="released"}observe(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>this.measure(true)),this.resizeObserver.observe(this.host)),typeof IntersectionObserver<"u"&&(this.intersectionObserver=new IntersectionObserver(e=>{const n=e.some(o=>o.isIntersecting);this.setVisible(n)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(e){var n;if(this.visible=e,e){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(n=this.holder).hiddenSince??(n.hiddenSince=ra()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(e=false){var c;const n=this.host.getBoundingClientRect(),o=Math.max(1,n.width),r=Math.max(1,n.height),s=oa(this.host),i=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Qp);if(o===this.viewport.width&&r===this.viewport.height&&i===this.pixelRatio&&nm(s,this.inset))return;const a=this.viewport;if(this.viewport={width:o,height:r},this.inset=s,this.pixelRatio=i,(c=this.backend)==null||c.resize(o,r,i),this.opened){if(this.atHome)this.home(true);else{const l=this.camera.current,u=o/Math.max(a.width,1);this.camera.set(this.constrain({...l,zoom:l.zoom*u}))}this.emit("viewport")}e?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var e,n,o,r;typeof window>"u"||typeof window.matchMedia!="function"||((n=(e=this.dprQuery)==null?void 0:e.removeEventListener)==null||n.call(e,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(r=(o=this.dprQuery).addEventListener)==null||r.call(o,"change",this.onPixelRatioChange))}setUnloadable(e){e!==this.unloadable&&(this.unloadable=e,this.emit("unloadable",e))}emit(e,n){var o;(o=this.listeners.get(e))==null||o.forEach(r=>r(n))}}const ra=()=>typeof performance<"u"?performance.now():Date.now();function sm(t){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:e,left:n,width:o,height:r}=t.getBoundingClientRect();return e+r>=0&&n+o>=0&&e<=window.innerHeight&&n<=window.innerWidth}function sa(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function dr(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}const im=(t,e)=>new rm(t,e),am=mt(()=>import("./Connected-Cd2qwuuo.mjs")),cm=mt(()=>import("./Connected-9VGl2Xnx.mjs").then(t=>t.C));function lm({className:t,style:e,renderers:n,collapseControls:o,onContentStateChange:r,children:s,...i}){var m;const a=de("Body");fc(a.clover,r);const c=fs(),l=vt(()=>Hd(c),[c]),u=Wd(n??a.renderers,{canvases:c,bodies:l}),d=u==null?void 0:u.component,h=((m=c.find(({type:g})=>g==="Scene"||g==="Timeline"))==null?void 0:m.type)??"Canvas",p=it(g=>g.status==="loading");return f("div",{"aria-busy":p,className:Mt("clover-body",t),"data-renderer":d?"custom":h.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...e},children:[d?f(d,{canvases:c,bodies:l,children:s}):h==="Scene"?f(_t,{fallback:f(Sn,{overlay:true}),children:f(cm,{...i,children:s})}):h==="Timeline"?f(_t,{fallback:f(Sn,{overlay:true}),children:f(am,{...i,children:s})}):f(Zh,{...i,collapseControls:o,surface:im,children:s}),p&&f(Sn,{overlay:true})]})}const um={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function Rn(t){return t.replace(/<br\s*\/?>/gi,`
|
|
23
|
+
`;class po{constructor(e,n,o){I(this,"kind","webgl2");I(this,"canvas");I(this,"maxTextureSize");I(this,"gl");I(this,"program",null);I(this,"vao",null);I(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});I(this,"textures",new Map);I(this,"cssWidth",1);I(this,"cssHeight",1);I(this,"pixelRatio",1);I(this,"matrixScratch",new Float32Array(9));I(this,"isLost",false);I(this,"callbacks");I(this,"handleLost",()=>{var e2,n2;this.isLost=true,this.textures.clear(),(n2=(e2=this.callbacks).onLost)==null||n2.call(e2)});this.canvas=e,this.gl=n,this.callbacks=o,this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE)||4096;const r=ep(n,Qh,tp);this.program=r,this.uniforms={matrix:n.getUniformLocation(r,"u_matrix"),crop:n.getUniformLocation(r,"u_crop"),opacity:n.getUniformLocation(r,"u_opacity"),texture:n.getUniformLocation(r,"u_texture")};const s=n.createVertexArray();n.bindVertexArray(s);const i=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,i),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),n.STATIC_DRAW);const a=n.getAttribLocation(r,"a_position");n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,false,0,0),n.bindVertexArray(null),this.vao=s,n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,false),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL),e.addEventListener("webglcontextlost",this.handleLost)}static create(e,n={}){let o=null;try{o=e.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{o=null}if(!o||typeof o.createShader!="function")return null;try{return new po(e,o,n)}catch{return null}}resize(e,n,o){this.cssWidth=Math.max(1,e),this.cssHeight=Math.max(1,n),this.pixelRatio=o;const r=Math.max(1,Math.round(e*o)),s=Math.max(1,Math.round(n*o));this.canvas.width!==r&&(this.canvas.width=r),this.canvas.height!==s&&(this.canvas.height=s)}begin(){if(this.isLost)return;const e=this.gl;e.viewport(0,0,this.canvas.width,this.canvas.height),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.useProgram(this.program),e.bindVertexArray(this.vao),e.activeTexture(e.TEXTURE0),e.uniform1i(this.uniforms.texture,0)}draw(e){if(this.isLost||!Yh(e.source))return"skipped";const n=this.gl,o=this.upload(e);if(o==="tainted")return"tainted";if(!o)return"skipped";const r=e.crop??{x:0,y:0,width:e.width,height:e.height},s=Jh(e,this.pixelRatio),i=le(e.transform,ne(r.x,r.y),ce(r.width+s.x,r.height+s.y));return n.uniformMatrix3fv(this.uniforms.matrix,false,mh(i,this.cssWidth,this.cssHeight,this.matrixScratch)),n.uniform4f(this.uniforms.crop,r.x/e.width,r.y/e.height,r.width/e.width,r.height/e.height),n.uniform1f(this.uniforms.opacity,e.opacity),n.bindTexture(n.TEXTURE_2D,o.texture),n.drawArrays(n.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(e){return!this.isLost&&this.textures.has(e)}release(e){const n=this.textures.get(e);n&&(this.isLost||this.gl.deleteTexture(n.texture),this.textures.delete(e))}dispose(){var e;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const n of[...this.textures.keys()])this.release(n);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(e=this.gl.getExtension("WEBGL_lose_context"))==null||e.loseContext(),this.isLost=true}upload(e){const n=this.gl,o=this.textures.get(e.key);if(o&&o.width===e.width&&o.height===e.height)return o;const r=(o==null?void 0:o.texture)??n.createTexture();if(!r)return null;n.bindTexture(n.TEXTURE_2D,r);try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e.source)}catch(i){if(o||n.deleteTexture(r),np(i))return"tainted";throw i}n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);const s={texture:r,width:e.width,height:e.height};return this.textures.set(e.key,s),s}}function ep(t,e,n){const o=ji(t,t.VERTEX_SHADER,e),r=ji(t,t.FRAGMENT_SHADER,n),s=t.createProgram();if(!s)throw new Error("Could not create WebGL program");if(t.attachShader(s,o),t.attachShader(s,r),t.linkProgram(s),t.deleteShader(o),t.deleteShader(r),!t.getProgramParameter(s,t.LINK_STATUS)){const i=t.getProgramInfoLog(s);throw t.deleteProgram(s),new Error(`Could not link WebGL program: ${i}`)}return s}function ji(t,e,n){const o=t.createShader(e);if(!o)throw new Error("Could not create WebGL shader");if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const r=t.getShaderInfoLog(o);throw t.deleteShader(o),new Error(`Could not compile WebGL shader: ${r}`)}return o}function np(t){return typeof t=="object"&&t!==null&&t.name==="SecurityError"}function Oc(t,e){return le(ne(e.width/2,e.height/2),Nn(t.rotation),ce(t.zoom),ne(-t.x,-t.y))}function Nc(t,e){return le(ne(t.x,t.y),ce(1/t.zoom),Nn(-t.rotation),ne(-e.width/2,-e.height/2))}function Vi(t,e,n){return ve(Nc(t,e),n)}function op(t,e,n){return ve(Oc(t,e),n)}function Lr(t,e){return Mo(Nc(t,e),{x:0,y:0,width:e.width,height:e.height})}function rp(t,e,n=0,o=0){const r=Mo(Nn(n),t),s=Math.max(1,e.width*(1-o*2)),i=Math.max(1,e.height*(1-o*2)),a=Math.min(s/Math.max(r.width,Number.EPSILON),i/Math.max(r.height,Number.EPSILON)),c=Mc(t);return{x:c.x,y:c.y,zoom:a,rotation:n}}function mo(t,e,n,o,r){const s=ve(le(ce(1/n),Nn(-o)),{x:e.x-r.width/2,y:e.y-r.height/2});return{x:t.x-s.x,y:t.y-s.y}}function qi(t,e){return t.x===e.x&&t.y===e.y&&t.zoom===e.zoom&&t.rotation===e.rotation}const sp=.09,ip=1e-4,Ki=.05,ap=1e-4;class cp{constructor(e,n=sp,o){I(this,"current");I(this,"target",null);I(this,"timeConstant");I(this,"spring");I(this,"start");I(this,"elapsed",0);this.current={...e},this.start={...e},this.timeConstant=n,this.spring=o}get destination(){return this.target?{...this.target.state}:{...this.current}}set(e){this.current={...e},this.target=null}animateTo(e,n,o=false){const r=this.spring?this.spring.duration<=0:this.timeConstant===0;if(o||r){this.set(e.state);return}let s=e.anchor;if(s){const i=mo(s.world,s.screen,e.state.zoom,e.state.rotation,n);Math.hypot(i.x-e.state.x,i.y-e.state.y)*e.state.zoom>Ki&&(s=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...e.state},anchor:s}}stop(){this.target=null}step(e,n){const o=this.target;if(!o)return false;const r=o.state;let s,i;if(this.spring){this.elapsed+=Math.max(e,0);const d=this.elapsed/this.spring.duration;if(d>=1)return this.current={...r},this.target=null,false;const h=this.spring.stiffness;s=this.start,i=(1-Math.exp(-h*d))/(1-Math.exp(-h))}else s=this.current,i=1-Math.exp(-Math.max(e,0)/this.timeConstant);const a=Math.exp(Math.log(s.zoom)+(Math.log(r.zoom)-Math.log(s.zoom))*i),c=s.rotation+(r.rotation-s.rotation)*i,l=o.anchor?mo(o.anchor.world,o.anchor.screen,a,c,n):{x:s.x+(r.x-s.x)*i,y:s.y+(r.y-s.y)*i};return this.current={x:l.x,y:l.y,zoom:a,rotation:c},this.spring?true:Math.abs(Math.log(r.zoom/a))<ip&&Math.abs(r.rotation-c)<ap&&Math.hypot(r.x-l.x,r.y-l.y)*a<Ki?(this.current={...r},this.target=null,false):true}}const Rc=5,Zi=300,lp=Rc*4;function Gi(t,e=false){return t==="touch"||t==="pen"&&!e}function up(t){return t.pointerType==="pen"&&t.buttons===0}function dp(t,e,n){for(let o=t;o&&o!==e;o=o.parentElement)if((n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)>=1&&/auto|scroll/.test(getComputedStyle(o).overflowY))return true;return false}function Xi(t,e){var o;let n=t;for(;n&&n!==e;){if(n instanceof HTMLButtonElement||n instanceof HTMLAnchorElement||n instanceof HTMLInputElement||n instanceof HTMLLabelElement||n instanceof HTMLSelectElement||((o=n.dataset)==null?void 0:o.cloverCanvasInteractive)!==void 0)return true;n=n.parentElement}return false}const Ar={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},ir=2,Yi=1.5,Ji=.1,fp=100,hp=.002,pp=.01;class mp{constructor(e,n,o=Ar){I(this,"pointers",new Map);I(this,"samples",[]);I(this,"down",null);I(this,"pinch",null);I(this,"lastTap",null);I(this,"lastPointerType","");I(this,"penHovers",false);I(this,"onPointerDown",e2=>{var o2,r;if(this.lastPointerType=e2.pointerType,e2.pointerType==="mouse"&&e2.button!==0||Xi(e2.target,this.element))return;(r=(o2=this.element).setPointerCapture)==null||r.call(o2,e2.pointerId);const n2=this.local(e2);this.pointers.set(e2.pointerId,n2),this.pointers.size===1?(this.down={x:n2.x,y:n2.y,t:e2.timeStamp,moved:false},this.samples=[{x:n2.x,y:n2.y,t:e2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});I(this,"onPointerMove",e2=>{var r;up(e2)&&(this.penHovers=true);const n2=this.pointers.get(e2.pointerId);if(!n2)return;const o2=this.local(e2);if(this.pointers.set(e2.pointerId,o2),this.pointers.size===1){const s=o2.x-n2.x,i=o2.y-n2.y;this.down&&Math.hypot(o2.x-this.down.x,o2.y-this.down.y)>Rc&&(this.down.moved=true),(r=this.down)!=null&&r.moved&&this.options.navigable&&this.target.panBy(s,i,!this.tracksPointer(e2.pointerType)),this.samples.push({x:o2.x,y:o2.y,t:e2.timeStamp});const a=e2.timeStamp-fp;for(;this.samples.length>2&&this.samples[0].t<a;)this.samples.shift()}else if(this.pointers.size===2&&this.pinch&&this.options.navigable){const s=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(s.distance/this.pinch.distance,s.mid,false),this.target.panBy(s.mid.x-this.pinch.mid.x,s.mid.y-this.pinch.mid.y,false),this.pinch=s}});I(this,"onPointerUp",e2=>{var c,l,u,d,h,p;if(!this.pointers.has(e2.pointerId))return;if(this.pointers.delete(e2.pointerId),(l=(c=this.element).releasePointerCapture)==null||l.call(c,e2.pointerId),this.pointers.size===1){this.pinch=null;const[m]=this.pointers.values();this.samples=[{...m,t:e2.timeStamp}];return}if(this.pointers.size>0)return;const n2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!n2)return;const o2=this.local(e2);if(!n2.moved&&e2.type==="pointerup"&&e2.timeStamp-n2.t<Zi){if((d=(u=this.target).dismiss)!=null&&d.call(u)){this.lastTap=null;return}if(Gi(e2.pointerType,this.penHovers)){const m=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&m&&e2.timeStamp-m.t<Zi&&Math.hypot(o2.x-m.x,o2.y-m.y)<lp?(this.lastTap=null,this.zoomIn(o2)):this.lastTap={x:o2.x,y:o2.y,t:e2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?e2.shiftKey?this.target.zoomBy(1/ir,o2,true):this.zoomIn(o2):(p=(h=this.target).tap)==null||p.call(h,o2);return}if(!this.options.navigable||!this.tracksPointer(e2.pointerType))return;const s=this.samples[0],i=this.samples[this.samples.length-1],a=((i==null?void 0:i.t)??0)-((s==null?void 0:s.t)??0);if(s&&i&&a>0&&e2.timeStamp-i.t<50){const m=(i.x-s.x)/a*1e3,g=(i.y-s.y)/a*1e3,b=this.options.flickMomentum;b>0&&Math.hypot(m,g)>this.options.flickMinSpeed&&this.target.panBy(m*b,g*b,true)}});I(this,"onDoubleClick",e2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||Gi(this.lastPointerType,this.penHovers)||Xi(e2.target,this.element)||(e2.shiftKey?this.target.zoomBy(1/ir,this.local(e2),true):this.zoomIn(this.local(e2))))});I(this,"onWheel",e2=>{const n2=e2.ctrlKey;if(!this.options.navigable||!n2&&!this.options.scrollToZoom||!n2&&dp(e2.target,this.element,e2.deltaY))return;e2.preventDefault();const o2=gp(e2),r=n2?pp:hp;this.target.zoomBy(Math.exp(-o2*r),this.local(e2),!n2)});I(this,"onKeyDown",e2=>{if(e2.target!==this.element||!this.options.navigable||e2.altKey||e2.metaKey||e2.ctrlKey)return;const n2=this.element.getBoundingClientRect(),o2=n2.width*Ji*(e2.shiftKey?3:1),r=n2.height*Ji*(e2.shiftKey?3:1);switch(e2.key){case"ArrowLeft":this.target.panBy(o2,0,true);break;case"ArrowRight":this.target.panBy(-o2,0,true);break;case"ArrowUp":this.target.panBy(0,r,true);break;case"ArrowDown":this.target.panBy(0,-r,true);break;case"+":case"=":this.target.zoomBy(Yi,void 0,true);break;case"-":case"_":this.target.zoomBy(1/Yi,void 0,true);break;case"0":this.target.home();break;case"r":this.target.rotateBy(90);break;case"R":this.target.rotateBy(-90);break;default:return}e2.preventDefault()});this.element=e,this.target=n,this.options=o,e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("dblclick",this.onDoubleClick),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("keydown",this.onKeyDown)}setOptions(e){this.options=e}dispose(){const e=this.element;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("dblclick",this.onDoubleClick),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("keydown",this.onKeyDown)}local(e){const n=this.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}zoomIn(e){var n,o;(o=(n=this.target).atMaxZoom)!=null&&o.call(n)?this.target.home():this.target.zoomBy(ir,e,true)}tracksPointer(e){return e==="touch"||this.options.flickEnabled}pinchState(){const[e,n]=[...this.pointers.values()];return{distance:Math.hypot(n.x-e.x,n.y-e.y),mid:{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}}}function gp(t){return t.deltaMode===1?t.deltaY*16:t.deltaMode===2?t.deltaY*400:t.deltaY}class Bc extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageLoadError"}}const Qi=new Set;async function vp(t,e={}){const{signal:n,maxTextureSize:o,request:r}=e,s=xd(r),i=bp(t);if(typeof createImageBitmap!="function"||typeof fetch!="function")return ar(t,{signal:n,cors:true,withCredentials:s});if(i&&Qi.has(i))return ar(t,{signal:n,cors:false,withCredentials:s});let a;try{a=await ns(r,t,{mode:"cors",signal:n})}catch(h){if(_p(h,n))throw h;const p=await ar(t,{signal:n,cors:false,withCredentials:s});return i&&Qi.add(i),p}if(!a.ok)throw new Bc(`Image request failed with ${a.status}`,t,a.status);const c=await a.blob();let l=await yp(c);const u=l.width,d=l.height;if(o&&(l.width>o||l.height>o)){const h=o/Math.max(l.width,l.height),p=await createImageBitmap(l,{resizeWidth:Math.max(1,Math.floor(l.width*h)),resizeHeight:Math.max(1,Math.floor(l.height*h)),resizeQuality:"high"});l.close(),l=p}if(n!=null&&n.aborted)throw l.close(),Or();return{kind:"bitmap",source:l,width:l.width,height:l.height,naturalWidth:u,naturalHeight:d,opaque:false}}async function yp(t){const e={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(t,e)}catch(n){if(n instanceof TypeError)return createImageBitmap(t);throw n}}function ar(t,{signal:e,cors:n,withCredentials:o}){return new Promise((r,s)=>{if(e!=null&&e.aborted){s(Or());return}const i=new Image;i.decoding="async",n&&(i.crossOrigin=o?"use-credentials":"anonymous");const a=()=>{i.onload=null,i.onerror=null,e==null||e.removeEventListener("abort",c)},c=()=>{a(),i.src="",s(Or())};e==null||e.addEventListener("abort",c),i.onload=()=>{a();const l=()=>r({kind:"element",source:i,width:i.naturalWidth,height:i.naturalHeight,naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight,opaque:!n});typeof i.decode=="function"?i.decode().then(l,l):l()},i.onerror=()=>{a(),s(new Bc("Image failed to load",t))},i.src=t})}function bp(t){var e;try{return new URL(t,(e=globalThis.location)==null?void 0:e.href).origin}catch{return null}}function _p(t,e){return!!(e!=null&&e.aborted)||typeof t=="object"&&t!==null&&t.name==="AbortError"}function Or(){const t=new Error("Aborted");return t.name="AbortError",t}function ta(t){t.kind==="bitmap"&&t.source.close()}const wp=192*1024*1024,xp=6,Sp=2;class kp{constructor(e){I(this,"entries",new Map);I(this,"inFlight",0);I(this,"frame",0);I(this,"bytes",0);I(this,"wanted",[]);I(this,"disposed",false);I(this,"budget");I(this,"maxInFlight");this.options=e,this.budget=e.byteBudget??wp,this.maxInFlight=e.maxInFlight??xp}get(e){const n=this.entries.get(e);if((n==null?void 0:n.state)==="ready")return n.lastUsed=this.frame,n.image}has(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="ready"}failed(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(e,n){var r;const o=this.entries.get(e);(o==null?void 0:o.state)!=="ready"&&((r=o==null?void 0:o.controller)==null||r.abort(),this.entries.set(e,{url:e,state:"ready",image:n,bytes:cr(n),lastUsed:this.frame,attempts:0,pinned:false,waiters:(o==null?void 0:o.waiters)??[]}),this.bytes+=cr(n),this.flushWaiters(e))}prefetch(e){return Promise.all(e.map(n=>new Promise(o=>{const r=this.entries.get(n.url);if(r&&r.state!=="loading")return o();if(r){r.waiters.push(o);return}this.start({...n,priority:-1},o)}))).then(()=>{})}update(e){if(this.disposed)return;this.frame++;const n=new Set(e.map(o=>o.url));this.wanted=[...e].sort((o,r)=>o.priority-r.priority);for(const o of this.entries.values())o.state==="loading"&&!o.pinned&&!n.has(o.url)&&o.controller&&(o.controller.abort(),this.entries.delete(o.url),this.inFlight--);for(const o of this.wanted){const r=this.entries.get(o.url);r&&(r.lastUsed=this.frame)}this.pump(),this.evict(n)}dispose(){var e;this.disposed=true;for(const n of this.entries.values())(e=n.controller)==null||e.abort(),this.flushWaiters(n.url);this.entries.clear(),this.bytes=0}forEachReady(e){for(const n of this.entries.values())n.state==="ready"&&n.image&&e(n.url,n.image)}pump(){for(const e of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(e.url)||this.start(e)}}start(e,n){const o=new AbortController,r={url:e.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:o,pinned:!!n,waiters:n?[n]:[]};this.entries.set(e.url,r),this.inFlight++,this.attempt(r,e,o,e.url)}attempt(e,n,o,r){e.attempts++,this.options.load(r,o.signal).then(s=>{if(this.disposed||this.entries.get(e.url)!==e){ta(s);return}e.state="ready",e.image=s,e.bytes=cr(s),e.controller=void 0,e.pinned=false,this.bytes+=e.bytes,this.settle(e)},s=>{if(!(o.signal.aborted||this.disposed)&&this.entries.get(e.url)===e){if(e.attempts<Sp&&!Cp(s,n)){this.attempt(e,n,o,n.fallbackUrl??n.url);return}e.state="failed",e.controller=void 0,e.pinned=false,this.settle(e)}})}settle(e){this.inFlight--,this.flushWaiters(e.url),this.options.onSettled(),this.pump()}flushWaiters(e){const n=this.entries.get(e);if(!n)return;const o=n.waiters;n.waiters=[],o.forEach(r=>r())}evict(e){if(this.bytes<=this.budget)return;const n=[...this.entries.values()].filter(o=>o.state==="ready"&&!e.has(o.url)).sort((o,r)=>o.lastUsed-r.lastUsed);for(const o of n){if(this.bytes<=this.budget)break;this.entries.delete(o.url),this.bytes-=o.bytes,o.image&&ta(o.image),this.options.onEvict(o.url)}}}function cr(t){return t.width*t.height*4}function Cp(t,e){if(e.fallbackUrl)return false;const n=t==null?void 0:t.status;return typeof n=="number"&&n>=400&&n<500&&n!==408&&n!==429}const Ep=.1;class Mp{constructor(e,n=r=>requestAnimationFrame(r),o=r=>cancelAnimationFrame(r)){I(this,"handle",0);I(this,"last",0);I(this,"disposed",false);I(this,"frame",e2=>{if(this.handle=0,this.disposed)return;const n2=this.last?Math.min((e2-this.last)/1e3,Ep):1/60;this.last=e2,this.tick(n2,e2)?this.invalidate():this.last=0});this.tick=e,this.raf=n,this.caf=o}invalidate(){this.disposed||this.handle||(this.handle=this.raf(this.frame))}drawNow(){this.disposed||(this.handle&&this.caf(this.handle),this.frame(performance.now()))}dispose(){this.disposed=true,this.handle&&this.caf(this.handle),this.handle=0}}const Tp=2*1024*1024;function Ip(t,e,n=Tp){const o=new Set;let r=n,s=false;return{get deferred(){return s},getTile(i){const a=t(i);if(!a||a.kind==="media"||a.opaque||o.has(i)||e(i))return a;const c=a.width*a.height*4;if(o.size>0&&c>r){s=true;return}return r-=c,o.add(i),a}}}function Pp(t){const e=/^(!)?(\d+(?:\.\d+)?)$/.exec((t==null?void 0:t.trim())??"");if(!e)return null;const n=Number(e[2]);if(n>360)return null;const o=n%360,r=!!e[1];return o||r?{degrees:o,mirror:r}:null}function Lp(t,e,n){if(!t)return null;let o=t.trim().replace(/^xywh=/,""),r=false;o.startsWith("pct:")?(r=true,o=o.slice(4)):o.startsWith("pixel:")&&(o=o.slice(6));const s=o.split(",").map(Number);if(s.length!==4||s.some(m=>!Number.isFinite(m)))return null;let[i,a,c,l]=s;r&&(i=i/100*e,a=a/100*n,c=c/100*e,l=l/100*n);const u=Math.max(0,i),d=Math.max(0,a),h=Math.min(e,i+c),p=Math.min(n,a+l);return h<=u||p<=d?null:{x:u,y:d,width:h-u,height:p-d}}const lr=512,Ap=16e6;function $c(t,e,n){return{width:e,height:n,levels:[{scaleFactor:1,width:e,height:n,tileWidth:e,tileHeight:n,cols:1,rows:1}],tile:r=>({...r,url:t,region:{x:0,y:0,width:e,height:n}})}}function Op(t){const{width:e,height:n}=t,o=[],r=t.regionByPx&&t.sizeByW,s=(h,p,m)=>{const g=Math.ceil(e/h),b=Math.ceil(n/h);return{scaleFactor:h,width:g,height:b,tileWidth:p,tileHeight:m,cols:Math.ceil(g/p),rows:Math.ceil(b/m)}},i=(h,p)=>({scaleFactor:e/h,width:h,height:p,tileWidth:h,tileHeight:p,cols:1,rows:1,whole:true}),a=t.tiles[0];if(a)for(const h of a.scaleFactors)o.push(s(h,a.width,a.height));else if(r)for(let h=1;;h*=2){const p=s(h,lr,lr);if(o.push(p),p.cols===1&&p.rows===1)break}const c=Math.max(0,...o.map(h=>h.scaleFactor));for(const h of t.sizes){const p=e/h.width;Np(t,h.width,h.height)&&p>c+1e-9&&o.push(i(h.width,h.height))}const l=o.reduce((h,p)=>!h||p.scaleFactor>h.scaleFactor?p:h,null);if(l&&l.cols*l.rows>1&&t.sizeByW){const h=Math.max(e,n)/lr;o.push(i(Math.ceil(e/h),Math.ceil(n/h)))}(!o.length||!a&&!r&&e*n<=Ap)&&(o.some(h=>h.scaleFactor===1)||o.push(i(e,n)));const u=Rp(o).sort((h,p)=>p.scaleFactor-h.scaleFactor),d=zf(t);return{width:e,height:n,levels:u,tile(h){const p=u[h.level],m=p.scaleFactor,g=p.cols===1&&p.rows===1;let b,v,w;if(g)b={x:0,y:0,width:e,height:n},v=p.width,w=p.height;else{const _=Math.round(h.col*p.tileWidth*m),x=Math.round(h.row*p.tileHeight*m);b={x:_,y:x,width:Math.min(Math.round(p.tileWidth*m),e-_),height:Math.min(Math.round(p.tileHeight*m),n-x)},v=Math.ceil(b.width/m),w=Math.ceil(b.height/m)}return{...h,region:b,url:uo(t,b,v,w),fallbackUrl:d?uo(t,b,v,w,d):void 0}}}}function Np(t,e,n){return!(t.maxWidth&&e>t.maxWidth||t.maxHeight&&n>t.maxHeight||t.maxArea&&e*n>t.maxArea)}function Rp(t){const e=new Map;for(const n of t){const o=`${n.width}x${n.height}`,r=e.get(o);(!r||r.cols*r.rows<n.cols*n.rows)&&e.set(o,n)}return[...e.values()]}function Bp(t,e){const n=t.levels;for(let o=0;o<n.length;o++)if(n[o].scaleFactor<=e*(1+1e-6))return o;return n.length-1}function Te(t,e,n){const o=t.levels[e],r=o.tileWidth*o.scaleFactor,s=o.tileHeight*o.scaleFactor,i=Math.max(0,n.x),a=Math.max(0,n.y),c=Math.min(t.width,n.x+n.width),l=Math.min(t.height,n.y+n.height);if(c<=i||l<=a)return[];const u=Math.max(0,Math.floor(i/r)),d=Math.min(o.cols-1,Math.floor((c-1e-9)/r)),h=Math.max(0,Math.floor(a/s)),p=Math.min(o.rows-1,Math.floor((l-1e-9)/s)),m=[];for(let g=h;g<=p;g++)for(let b=u;b<=d;b++)m.push({level:e,col:b,row:g});return m}async function $p(t,e){if(t.media)return Fp(t,t.media);let n=null,o=null;if(t.service)try{n=Op(await cs(t.service,e.infoOptions))}catch(h){o=h}if(!n){if(!t.url)throw o??new Error("Image has no source");const h=await e.loadStatic(t.url);e.cache.seed(t.url,h),n=$c(t.url,h.naturalWidth,h.naturalHeight)}const r=t.width&&t.height&&t.width>0&&t.height>0?{width:t.width,height:t.height}:{width:n.width,height:n.height},s=Lp(t.region,r.width,r.height)??{x:0,y:0,width:r.width,height:r.height},i=n.width/r.width,a=n.height/r.height,c={x:s.x*i,y:s.y*a,width:s.width*i,height:s.height*a},l=Pp(t.rotation),u=l?Dp(c,l):void 0,d={id:t.id,spec:t,pyramid:n,size:r,clip:c,contentClip:s,rect:{x:0,y:0,width:s.width,height:s.height},...u?{turn:u}:{}};return await e.cache.prefetch(Te(n,0,c).map(h=>{const p=n.tile(h);return{url:p.url,fallbackUrl:p.fallbackUrl}})),d}const Fc="media:";function Fp(t,e){var a,c;const n=t.width||((a=t.placement)==null?void 0:a.width)||e.element.videoWidth||1600,o=t.height||((c=t.placement)==null?void 0:c.height)||e.element.videoHeight||900,r=`${Fc}${t.id}`,s={width:n,height:o},i={x:0,y:0,width:n,height:o};return{id:t.id,spec:t,pyramid:$c(r,n,o),media:{kind:"media",source:e.element,width:n,height:o,naturalWidth:n,naturalHeight:o},size:s,clip:i,contentClip:i,rect:{...i}}}function Dp(t,{degrees:e,mirror:n}){const o=e*Math.PI/180,r=u=>Math.abs(u)<1e-12?0:u,s=r(Math.cos(o)),i=r(Math.sin(o)),a=Math.abs(t.width*s)+Math.abs(t.height*i),c=Math.abs(t.width*i)+Math.abs(t.height*s),l=le(ne(a/2,c/2),{a:s,b:i,c:-i,d:s,e:0,f:0},ce(n?-1:1,1),ne(-(t.x+t.width/2),-(t.y+t.height/2)));return{orient:l,unorient:ph(l),width:a,height:c}}function Dc(t){var e;return((e=t.turn)==null?void 0:e.orient)??ne(-t.clip.x,-t.clip.y)}function zp(t,e){const{turn:n,clip:o}=t;if(!n)return{...e,x:o.x+e.x,y:o.y+e.y};const r=Mo(n.unorient,e),s=Math.max(r.x,o.x),i=Math.max(r.y,o.y);return{x:s,y:i,width:Math.max(0,Math.min(r.x+r.width,o.x+o.width)-s),height:Math.max(0,Math.min(r.y+r.height,o.y+o.height)-i)}}function Hp(t,e){const{turn:n,clip:o}=t;return n?ve(n.unorient,e):{x:o.x+e.x,y:o.y+e.y}}function ea(t){const{turn:e,clip:n,contentClip:o}=t;return e?{width:e.width*o.width/n.width,height:e.height*o.height/n.height}:o}function Wp(t){if(!t.length)return null;if(t.every(o=>o.spec.placement)){for(const o of t)o.rect={...o.spec.placement};return ds(t.map(o=>o.rect))}const e=ea(t[0]).height;let n=0;for(const o of t){const r=ea(o),s=r.width*e/r.height;o.rect={x:n,y:0,width:s,height:e},n+=s}return{x:0,y:0,width:n,height:e}}function To(t){const e=t.turn??t.clip;return{x:t.rect.width/e.width,y:t.rect.height/e.height}}function Up(t){const e=To(t);return le(ne(t.rect.x,t.rect.y),ce(e.x,e.y),Dc(t))}function jp(t,e){var n,o;return t.service===e.service&&t.url===e.url&&t.width===e.width&&t.height===e.height&&t.region===e.region&&t.rotation===e.rotation&&((n=t.media)==null?void 0:n.element)===((o=e.media)==null?void 0:o.element)&&JSON.stringify(t.placement)===JSON.stringify(e.placement)}const Vp=1e7,qp=15e6,Kp=2e7,Zp=2;function Gp(t){const{items:e,camera:n,viewport:o,pixelRatio:r,getTile:s,destination:i}=t,a=Oc(n,o),c=[],l=[],u=[],d=(h,p,m)=>{const g=h.tile(p);l.push({url:g.url,fallbackUrl:g.fallbackUrl,priority:m})};for(const h of e){const{pyramid:p,clip:m,rect:g}=h,b=To(h);if(t.wantOverview)for(const T of Te(p,0,m))d(p,T,Kp);const v=na(h,n,o,r),w=i?na(h,i,o,r):v;if(u.push((v==null?void 0:v.target)??-1),!v&&!w)continue;const _=T=>E=>{const A=p.tile(E).region;return Math.hypot(A.x+A.width/2-T.x,A.y+A.height/2-T.y)};if(w){const T=_(w.center);for(const E of Te(p,0,w.area))d(p,E,T(E)/1e3);if(w.target>0)for(const E of Te(p,w.target,w.area))d(p,E,Vp+T(E))}if(!v)continue;const{area:x,target:S}=v,M=_(v.center),R=Te(p,0,x),N=S===0?[]:Te(p,S,x);if(w!==v){for(const E of R)d(p,E,M(E)/1e3);const T=S-Zp;if(T>0)for(const E of Te(p,T,x))d(p,E,qp+M(E))}if(h.spec.hidden)continue;const X=(S===0?R:N).every(T=>s(p.tile(T).url)!==void 0)?[S]:Array.from({length:S+1},(T,E)=>E),V=le(a,ne(g.x,g.y),ce(b.x,b.y),Dc(h));for(const T of X){const E=T===0?R:T===S?N:Te(p,T,x),A=p.levels[T].cols*p.levels[T].rows>1;for(const W of E){const G=p.tile(W),Y=s(G.url);if(!Y)continue;const st=Xp(h,G.region,Y,V,A);st&&c.push({...st,url:G.url})}}}return l.sort((h,p)=>h.priority-p.priority),{draws:c,wants:Yp(l),levels:u}}function na(t,e,n,o){const{pyramid:r,rect:s}=t,i=Lr(e,n);if(!vh(i,s))return null;const a=To(t),c=Math.max(i.x,s.x),l=Math.max(i.y,s.y),u=Math.min(i.x+i.width,s.x+s.width),d=Math.min(i.y+i.height,s.y+s.height),h=1/(a.x*e.zoom*o);return{area:zp(t,{x:(c-s.x)/a.x,y:(l-s.y)/a.y,width:(u-c)/a.x,height:(d-l)/a.y}),center:Hp(t,{x:(e.x-s.x)/a.x,y:(e.y-s.y)/a.y}),target:Bp(r,h)}}function Xp(t,e,n,o,r){const{clip:s}=t,i=Math.max(e.x,s.x),a=Math.max(e.y,s.y),c=Math.min(e.x+e.width,s.x+s.width),l=Math.min(e.y+e.height,s.y+s.height);if(c<=i||l<=a)return null;const u=n.width/e.width,d=n.height/e.height,h=1e-6;return{item:t,image:n,transform:le(o,ne(e.x,e.y),ce(1/u,1/d)),crop:{x:(i-e.x)*u,y:(a-e.y)*d,width:(c-i)*u,height:(l-a)*d},bleed:{right:r&&c<s.x+s.width-h,bottom:r&&l<s.y+s.height-h}}}function Yp(t){const e=new Set;return t.filter(n=>e.has(n.url)?false:(e.add(n.url),true))}const Jp={maxZoomPixelRatio:1.1,minZoomImageRatio:.9,animationTime:.09,animationDuration:void 0,springStiffness:6.5,constrainDuringPan:true,request:void 0,byteBudget:192*1024*1024,maxInFlight:6,releaseAfterMs:2e3},Qp=2,tm=3,em=.1,ur=1e-6,Nr={top:0,right:0,bottom:0,left:0};function oa(t,e="padding"){if(!t||typeof getComputedStyle!="function")return Nr;const n=getComputedStyle(t),o=r=>parseFloat(n.getPropertyValue(`${e}-${r}`))||0;return{top:o("top"),right:o("right"),bottom:o("bottom"),left:o("left")}}const nm=(t,e)=>t.top===e.top&&t.right===e.right&&t.bottom===e.bottom&&t.left===e.left;let om;class rm{constructor(e,n={}){I(this,"host");I(this,"overlays",null);I(this,"options");I(this,"backend",null);I(this,"backendPreference");I(this,"contextLosses",0);I(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});I(this,"visible",true);I(this,"dom",null);I(this,"domAsked",false);I(this,"pending",null);I(this,"camera");I(this,"loop");I(this,"gestures");I(this,"gestureOptions",{});I(this,"cache");I(this,"navigator",null);I(this,"navigatorAsked",0);I(this,"viewport",{width:1,height:1});I(this,"inset",Nr);I(this,"pixelRatio",1);I(this,"items",[]);I(this,"worldBounds",null);I(this,"contentVersion",0);I(this,"opaqueUrls",new Set);I(this,"mediaByKey",new Map);I(this,"detachMedia",[]);I(this,"opened",false);I(this,"atHome",true);I(this,"interacting",false);I(this,"lastEmitted",null);I(this,"generation",0);I(this,"listeners",new Map);I(this,"unloadable",false);I(this,"resizeObserver",null);I(this,"intersectionObserver",null);I(this,"releaseTimer",null);I(this,"dprQuery",null);I(this,"disposed",false);I(this,"dismisser",null);I(this,"tick",e2=>{var c,l;if(this.disposed)return false;const n2=this.camera.step(e2,this.viewport),o2=this.camera.current,r2=this.backend,s=Ip(this.getTile,u=>r2?r2.has(u):true),i=Gp({items:this.items,camera:o2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:s.getTile,wantOverview:!!this.navigator,destination:n2?this.camera.destination:void 0}),a=i.wants.filter(u=>!u.url.startsWith(Fc));return this.cache.update(a),i.draws.length?this.setUnloadable(false):a.length&&a.every(u=>this.cache.failed(u.url))&&this.setUnloadable(true),this.paint(i.draws),(c=this.overlays)==null||c.position(o2,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(u=>!u.spec.hidden),this.worldBounds,Lr(o2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!qi(this.lastEmitted,o2))&&(this.lastEmitted={...o2},this.opened&&this.emit("viewport")),n2||s.deferred});I(this,"getTile",e2=>this.mediaByKey.get(e2)??this.cache.get(e2));I(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});I(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=e,this.backendPreference=n.backend??"auto",this.options={...Jp,...dr(n)},sa()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:o,springStiffness:r}=this.options;this.camera=new cp({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,o===void 0?void 0:{duration:o,stiffness:r}),this.loop=new Mp(this.tick),this.gestureOptions=dr(n.gestures??{}),sa()&&(this.gestureOptions.flickMomentum=0),this.gestures=new mp(e,this,{...Ar,...this.gestureOptions}),this.cache=new kp({load:(s,i)=>this.loadTile(s,i),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:s=>{var i;return(i=this.backend)==null?void 0:i.release(s)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=sm(e),this.visible?this.acquireBackend():this.holder.hiddenSince=ra(),this.measure(),this.observe()}get backendKind(){var e;return((e=this.backend)==null?void 0:e.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(e,n){let o=this.listeners.get(e);return o||(o=new Set,this.listeners.set(e,o)),o.add(n),()=>o==null?void 0:o.delete(n)}async setImages(e,{world:n,fit:o=false}={}){const r=++this.generation,s=new Map(this.items.map(u=>[u.id,u])),i=await Promise.allSettled(e.map(u=>{const d=s.get(u.id);return d&&jp(d.spec,u)?(d.spec=u,Promise.resolve(d)):$p(u,{cache:this.cache,loadStatic:h=>this.loadTile(h),infoOptions:{request:this.options.request}})}));if(r!==this.generation||this.disposed)return;const a=i.filter(u=>u.status==="fulfilled").map(u=>u.value),c=i.filter(u=>u.status==="rejected").map(u=>u.reason);this.items=a,this.watchMedia(a);const l=Wp(a);if(this.worldBounds=n?l?ds([n,l]):n:l,this.contentVersion++,c.length&&this.emit("error",c),this.setUnloadable(e.length>0&&!a.length&&c.length>0),!this.worldBounds){this.invalidate();return}this.opened?o?(this.home(true),this.emit("change")):(this.camera.set(this.constrain(this.camera.current)),this.emit("change")):(this.opened=true,this.home(true),this.emit("open")),this.invalidate()}clear(){this.setUnloadable(false),this.generation++,this.items=[],this.watchMedia([]),this.worldBounds=null,this.contentVersion++,this.invalidate()}setHidden(e){const n=new Set(e);let o=false;for(const r of this.items){const s=n.has(r.id);!!r.spec.hidden!==s&&(r.spec={...r.spec,hidden:s},o=true)}o&&this.invalidate()}isReady(e){const n=this.items.find(r=>r.id===e);if(!n)return false;if(n.spec.media)return true;const o=n.pyramid.levels[0];if(!o)return false;for(let r=0;r<o.rows;r++)for(let s=0;s<o.cols;s++)if(!this.getTile(n.pyramid.tile({level:0,col:s,row:r}).url))return false;return true}fitBounds(e,n=false,o=Nr){const r=this.fit(e,this.camera.destination.rotation,o);this.atHome=false,this.animateTo(this.constrain(r,{allowBeyondLimits:true}),n)}fit(e,n,{top:o,right:r,bottom:s,left:i}){const{width:a,height:c}=this.viewport,{zoom:l}=rp(e,{width:Math.max(1,a-i-r),height:Math.max(1,c-o-s)},n);return{...mo(Mc(e),{x:(a+i-r)/2,y:(c+o-s)/2},l,n,this.viewport),zoom:l,rotation:n}}fitItemRect(e,n,o=false){const r=this.itemRectToWorld(e,n);r&&this.fitAnnotation(r,o)}fitAnnotation(e,n=false){var s;const o=this.items[0];if(!o)return;const r=o.rect.width*em;this.fitBounds({x:e.x-r,y:e.y-r,width:e.width+r*2,height:e.height+r*2},n,oa((s=this.overlays)==null?void 0:s.container,"scroll-padding"))}getBounds(){return Lr(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var o;const e=((o=this.homeCamera())==null?void 0:o.zoom)??1,n=this.items.length?Math.min(...this.items.map(r=>To(r).x)):1;return{home:e,min:e*this.options.minZoomImageRatio,max:Math.max(e,this.options.maxZoomPixelRatio/n)}}home(e=false){const n=this.homeCamera();if(!n)return;const o=this.atHome;this.atHome=true,this.animateTo(n,e),!o&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-ur)}viewLimits(){const{zoom:e,x:n,y:o,rotation:r}=this.camera.destination,{min:s,max:i}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:e>=i*(1-ur),atMin:e<=s*(1+ur),atHome:this.atHome&&(!a||Math.abs(e/a.zoom-1)<.001&&Math.hypot(n-a.x,o-a.y)*e<.5&&Math.abs(r-a.rotation)<.001)}}zoomBy(e,n,o=true){const r=o?this.camera.destination:this.camera.current,s=n??{x:this.viewport.width/2,y:this.viewport.height/2},i=Vi(r,this.viewport,s),{min:a,max:c}=this.getZoomLimits(),l=yn(r.zoom*e,a,c),u=mo(i,s,l,r.rotation,this.viewport),d=this.constrain({...r,...u,zoom:l});this.atHome=false,o?this.camera.animateTo({state:d,anchor:{world:i,screen:s}},this.viewport):this.camera.set(d),this.invalidate()}panBy(e,n,o=false){const r=o?this.camera.destination:this.camera.current,s=ve(le(ce(1/r.zoom),Nn(-r.rotation)),{x:e,y:n}),i=this.constrain({...r,x:r.x-s.x,y:r.y-s.y});this.atHome=false,o?this.camera.animateTo({state:i},this.viewport):this.camera.set(i),this.invalidate()}panTo(e,n=false){const o=n?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...o,...e}),n)}rotateBy(e){const n=this.camera.destination;this.setRotation(n.rotation*180/Math.PI+e)}setRotation(e,n=false){const o=this.camera.destination,r=e*Math.PI/180;this.animateTo(this.constrain({...o,rotation:r}),n)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(e){this.emit("tap",e)}setDismiss(e){this.dismisser=e}dismiss(){var e;return((e=this.dismisser)==null?void 0:e.call(this))??false}setGestures(e){this.gestures.setOptions({...Ar,...this.gestureOptions,...dr(e)})}setInteracting(e){if(this.interacting=e,e){this.camera.stop();return}if(this.options.constrainDuringPan)return;const n=this.camera.destination,o=this.constrain(n);qi(n,o)||this.animateTo(o,false)}worldToScreenPoint(e){return op(this.camera.current,this.viewport,e)}screenToWorldPoint(e){return Vi(this.camera.current,this.viewport,e)}itemRectToWorld(e,n){const o=this.items[e];if(!o)return null;const{contentClip:r,clip:s}=o;if(o.turn)return Mo(le(Up(o),ce(s.width/r.width,s.height/r.height)),n);const i=o.rect.width/r.width,a=o.rect.height/r.height;return{x:o.rect.x+(n.x-r.x)*i,y:o.rect.y+(n.y-r.y)*a,width:n.width*i,height:n.height*a}}attachNavigator(e){var s;(s=this.navigator)==null||s.dispose(),this.navigator=null;const n=++this.navigatorAsked;let o=null,r=false;return import("./Navigator-CjgUcgKY.mjs").then(i=>{r||this.disposed||n!==this.navigatorAsked||(o=new i.Navigator(e,(a,c)=>this.panTo(a,c)),this.navigator=o,this.invalidate())}),()=>{r=true,o==null||o.dispose(),o&&this.navigator===o&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var e,n,o,r,s,i,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(e=this.resizeObserver)==null||e.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),(r=(o=this.dprQuery)==null?void 0:o.removeEventListener)==null||r.call(o,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(s=this.navigator)==null||s.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(i=this.dom)==null||i.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(c=>c()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}watchMedia(e){this.detachMedia.forEach(n=>n()),this.detachMedia=[],this.mediaByKey.clear();for(const n of e){if(!n.media||n.media.kind!=="media")continue;const o=n.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(o,n.media);const r=n.media.source,s=()=>this.invalidate(),i=["play","seeked","loadeddata","resize"];i.forEach(a=>r.addEventListener(a,s)),this.detachMedia.push(()=>i.forEach(a=>r.removeEventListener(a,s)))}}paint(e){const n=this.backend,o=[],r=(n==null?void 0:n.kind)==="webgl2";n==null||n.begin();for(const s of e){const{image:i}=s;if(!(i.kind==="media"||i.kind==="element"&&r&&(i.opaque||this.opaqueUrls.has(s.url)))&&n){if(n.draw({key:s.url,source:i.source,width:i.width,height:i.height,transform:s.transform,crop:s.crop,opacity:1,bleed:s.bleed})!=="tainted"||i.kind==="bitmap")continue;this.opaqueUrls.add(s.url)}(i.kind==="element"||i.kind==="media")&&o.push({key:`${s.item.id}|${s.url}`,element:i.source,width:i.width,height:i.height,transform:s.transform,crop:s.crop,opacity:1})}n==null||n.end(),this.dom?this.dom.sync(o):o.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-BjxGaZkt.mjs").then(({DomLayers:s})=>{if(this.disposed)return;const i=new s(this.host);this.overlays&&this.host.insertBefore(i.container,this.overlays.container),this.dom=i,this.invalidate()}))}loadTile(e,n){return vp(e,{signal:n,request:this.options.request,maxTextureSize:this.backend instanceof po?this.backend.maxTextureSize:void 0})}animateTo(e,n){this.camera.animateTo({state:e},this.viewport,n),this.invalidate()}homeCamera(){if(!this.worldBounds)return null;const e=2*Math.PI,n=Math.round(this.camera.destination.rotation/e)*e||0;return this.fit(this.worldBounds,n,this.inset)}constrain(e,{allowBeyondLimits:n=false}={}){const o=this.worldBounds;if(!o)return e;const{min:r,max:s}=this.getZoomLimits(),i=n?yn(e.zoom,r,Math.max(s,e.zoom)):yn(e.zoom,r,s);return this.interacting&&!this.options.constrainDuringPan?{...e,zoom:i}:{...e,zoom:i,x:yn(e.x,o.x,o.x+o.width),y:yn(e.y,o.y,o.y+o.height)}}acquireBackend(e=true){var s,i;if(this.backend||this.pending||this.disposed)return;const n=document.createElement("canvas");n.className="clover-canvas-surface",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(n,((s=this.dom)==null?void 0:s.container)??((i=this.overlays)==null?void 0:i.container)??null);const o=e&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<tm);let r=null;o&&(Xh(this.holder)||this.backendPreference==="webgl2")&&(r=po.create(n,{onLost:this.onContextLost}),r||Ui(this.holder)),r?this.install(r):this.backendPreference==="webgl2"?this.none(n):(this.pending=n,(om??(om=import("./Canvas2DBackend-DHSI3dKr.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==n)return;this.pending=null;const c=a.create(n);c?this.install(c):this.none(n)}))}none(e){e.remove(),this.host.dataset.backend="none"}install(e){this.backend=e,this.host.dataset.backend=e.kind,e.resize(this.viewport.width,this.viewport.height,this.pixelRatio),e.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",e.kind),this.invalidate()}releaseBackend(){var n;if(Ui(this.holder),(n=this.pending)==null||n.remove(),this.pending=null,!this.backend)return;const e=this.backend.canvas;this.backend.dispose(),e.remove(),this.backend=null}giveBack(){this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.releaseBackend(),this.host.dataset.backend="released"}observe(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>this.measure(true)),this.resizeObserver.observe(this.host)),typeof IntersectionObserver<"u"&&(this.intersectionObserver=new IntersectionObserver(e=>{const n=e.some(o=>o.isIntersecting);this.setVisible(n)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(e){var n;if(this.visible=e,e){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(n=this.holder).hiddenSince??(n.hiddenSince=ra()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(e=false){var c;const n=this.host.getBoundingClientRect(),o=Math.max(1,n.width),r=Math.max(1,n.height),s=oa(this.host),i=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Qp);if(o===this.viewport.width&&r===this.viewport.height&&i===this.pixelRatio&&nm(s,this.inset))return;const a=this.viewport;if(this.viewport={width:o,height:r},this.inset=s,this.pixelRatio=i,(c=this.backend)==null||c.resize(o,r,i),this.opened){if(this.atHome)this.home(true);else{const l=this.camera.current,u=o/Math.max(a.width,1);this.camera.set(this.constrain({...l,zoom:l.zoom*u}))}this.emit("viewport")}e?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var e,n,o,r;typeof window>"u"||typeof window.matchMedia!="function"||((n=(e=this.dprQuery)==null?void 0:e.removeEventListener)==null||n.call(e,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(r=(o=this.dprQuery).addEventListener)==null||r.call(o,"change",this.onPixelRatioChange))}setUnloadable(e){e!==this.unloadable&&(this.unloadable=e,this.emit("unloadable",e))}emit(e,n){var o;(o=this.listeners.get(e))==null||o.forEach(r=>r(n))}}const ra=()=>typeof performance<"u"?performance.now():Date.now();function sm(t){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:e,left:n,width:o,height:r}=t.getBoundingClientRect();return e+r>=0&&n+o>=0&&e<=window.innerHeight&&n<=window.innerWidth}function sa(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function dr(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}const im=(t,e)=>new rm(t,e),am=mt(()=>import("./Connected-Bbk8M5rE.mjs")),cm=mt(()=>import("./Connected-DAOMKtJR.mjs").then(t=>t.C));function lm({className:t,style:e,renderers:n,collapseControls:o,onContentStateChange:r,children:s,...i}){var m;const a=de("Body");fc(a.clover,r);const c=fs(),l=vt(()=>Hd(c),[c]),u=Wd(n??a.renderers,{canvases:c,bodies:l}),d=u==null?void 0:u.component,h=((m=c.find(({type:g})=>g==="Scene"||g==="Timeline"))==null?void 0:m.type)??"Canvas",p=it(g=>g.status==="loading");return f("div",{"aria-busy":p,className:Mt("clover-body",t),"data-renderer":d?"custom":h.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...e},children:[d?f(d,{canvases:c,bodies:l,children:s}):h==="Scene"?f(_t,{fallback:f(Sn,{overlay:true}),children:f(cm,{...i,children:s})}):h==="Timeline"?f(_t,{fallback:f(Sn,{overlay:true}),children:f(am,{...i,children:s})}):f(Zh,{...i,collapseControls:o,surface:im,children:s}),p&&f(Sn,{overlay:true})]})}const um={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function Rn(t){return t.replace(/<br\s*\/?>/gi,`
|
|
24
24
|
`).replace(/<[^>]*>/g,"").replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){const o=n[1]==="x"||n[1]==="X"?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return o>0&&o<=1114111?String.fromCodePoint(o):e}return um[n.toLowerCase()]??e})}const dm=t=>/<[a-z!/]|&(#x?[0-9a-f]+|[a-z]+);/i.test(t);function fm(t,e=""){const n=t==null?void 0:t.split(";")[0].trim().toLowerCase();if(n)return n==="text/html"?"html":n==="text/markdown"?"markdown":"plain";const o=e.trim();return o.startsWith("<")&&o.endsWith(">")?"html":"plain"}function hm(t){return t.replace(/\r\n?/g,`
|
|
25
25
|
`).replace(/^\[\^[^\]]+\]:[ \t]*/gm,"").replace(/\[\^[^\]]+\]/g,"").replace(/^#{1,6}[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/gm,"$1").replace(/^[ \t]*(?:[-*+]|\d+[.)])[ \t]+/gm,"").replace(/\[([^\]]+)\]\((?:https?:\/\/|mailto:)[^\s)]+\)/g,"$1").replace(/\*\*([^*]+)\*\*|__([^_]+)__/g,(e,n,o)=>n??o).replace(/\*([^*\s][^*]*)\*|_([^_\s][^_]*)_/g,(e,n,o)=>n??o).replace(/\\\n/g,`
|
|
26
26
|
`).replace(/\n\s*\n/g,`
|
|
27
|
-
`).trim()}const Io=(t,e)=>e==="canvas"?He(t.manifest,t.canvasId):t.manifest,zc=ue(null),hs=()=>zt(zc),en=ne(function({of:e="manifest",label:n,as:o="span",className:r,...s},i){var h;const a=Ln(p=>{var m,g;return e==="canvas"?(m=He(p.manifest,p.canvasId))==null?void 0:m.label:(g=p.manifest)==null?void 0:g.label},void 0),c=hs(),l=(h=Pe())==null?void 0:h.language,{text:u,lang:d}=bt(n??(c?c.label:a),l);return u?f(o,{ref:i,className:Mt("clover-label",r),...ut(d),...s,children:Rn(u)}):null});function pm(t,e,n){const o=(u,d)=>Math.min(Math.max(Math.round(u),0),d),r=n?o(n.x*t.width,t.width-1):0,s=n?o(n.y*t.height,t.height-1):0,i={x:r,y:s,width:n?Math.max(1,o(n.width*t.width,t.width-r)):t.width,height:n?Math.max(1,o(n.height*t.height,t.height-s)):t.height},a=i.width===t.width&&i.height===t.height;if(!a&&!t.regionByPx)return null;if(t.sizeByW){let u=Math.min(1,e/Math.max(i.width,i.height));return t.maxWidth&&(u=Math.min(u,t.maxWidth/i.width)),t.maxHeight&&(u=Math.min(u,t.maxHeight/i.height)),t.maxArea&&(u=Math.min(u,Math.sqrt(t.maxArea/(i.width*i.height)))),uo(t,i,Math.max(1,Math.floor(i.width*u)),Math.max(1,Math.floor(i.height*u)))}if(!a)return null;const c=[...t.sizes].sort((u,d)=>u.width-d.width),l=c.find(u=>Math.max(u.width,u.height)>=e)??c.at(-1)??{width:t.width,height:t.height};return uo(t,i,l.width,l.height)}function nn(t){var e;return(e=rs(t).find(({body:n})=>n.type==="Image"||n.id&&!n.type))==null?void 0:e.body}function mm(t,{width:e,height:n}){if(t==="full")return{x:0,y:0,width:1,height:1};const o=/^(pct:)?([\d.]+),([\d.]+),([\d.]+),([\d.]+)$/.exec(t);if(!o)return null;const[r,s,i,a]=o.slice(2).map(Number),[c,l]=o[1]?[100,100]:[e,n];return{x:r/c,y:s/l,width:i/c,height:a/l}}function ye(t,e="full",n=false){if(!t)return null;const o=Co(t.service);if(o){if(e!=="full")return{service:o,region:e,fallback:t.id};const{width:r,height:s}=t;return n&&t.id&&r>0&&s>0?{service:o,fallback:t.id,fallbackSize:{width:r,height:s}}:{service:o,fallback:t.id}}return t.id?{src:t.id}:null}function ps(t){const e=t;return e?ye(H(e.thumbnail)[0],"full",true)??ye(nn(e))??ye(nn(e.placeholderContainer))??ye(nn(e.accompanyingContainer)):null}function gm(t){const e=t;return e?ye(nn(e))??ye(nn(e.placeholderContainer))??ye(nn(e.accompanyingContainer))??ye(H(e.thumbnail)[0],"full",true):null}async function ms(t,e=200,n){if(t.src)return t.src;if(!t.service)return t.fallback;const o=t.fallbackSize;if(o&&t.fallback&&t.region===void 0){const r=Math.max(o.width,o.height);if(r>=e&&r<=e*2)return t.fallback}try{const r=await cs(t.service,{request:n}),s=typeof t.region=="string"?mm(t.region,r):t.region;return s===null?t.fallback:pm(r,e,s)??t.fallback}catch{return t.fallback}}const vm=Object.freeze(Object.defineProperty({__proto__:null,imageSource:ye,resolveThumbnail:ms,stillSource:gm,thumbnailSource:ps},Symbol.toStringTag,{value:"Module"})),ia='.clover-items-item[role="option"], .clover-items-link',Qe=new Map;let Rt=null,Yt=null,Rr=0;function gs(t){const e=Qe.get(t);if(!e)return;const n=t.clientHeight>0&&t.scrollHeight>t.clientHeight+1;n!==e.cut&&(e.cut=n,e.change(n))}function Br(){cancelAnimationFrame(Rr),Rr=requestAnimationFrame(()=>Qe.forEach((t,e)=>gs(e)))}function Hc(t){var r,s;if(t.key!=="Escape")return;const e=new Set,n=(s=(r=document.activeElement)==null?void 0:r.closest)==null?void 0:s.call(r,ia);n&&e.add(n);try{document.querySelectorAll(`:is(${ia}):hover`).forEach(i=>e.add(i))}catch{}const o=[...e].filter(i=>i.dataset.fullHidden===void 0&&i.querySelector(".clover-items-label-full"));o.length&&(t.preventDefault(),t.stopPropagation(),o.forEach(i=>pc(i,"fullHidden",["pointerenter",i===n?"blur":"focus"])))}function ym(){var t,e;Rt=typeof ResizeObserver>"u"?null:new ResizeObserver(n=>n.forEach(o=>gs(o.target))),Yt=typeof MutationObserver>"u"?null:new MutationObserver(Br),Yt==null||Yt.observe(document.head,{childList:true,subtree:true,characterData:true}),Yt==null||Yt.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),(e=(t=document.fonts)==null?void 0:t.addEventListener)==null||e.call(t,"loadingdone",Br),document.addEventListener("keydown",Hc,true)}function bm(){var t,e,n;cancelAnimationFrame(Rr),(t=Rt==null?void 0:Rt.disconnect)==null||t.call(Rt),Yt==null||Yt.disconnect(),Rt=Yt=null,(n=(e=document.fonts)==null?void 0:e.removeEventListener)==null||n.call(e,"loadingdone",Br),document.removeEventListener("keydown",Hc,true)}function _m(t,e){var n;return Qe.size||ym(),Qe.set(t,{change:e}),(n=Rt==null?void 0:Rt.observe)==null||n.call(Rt,t),gs(t),()=>{var o;Qe.delete(t),(o=Rt==null?void 0:Rt.unobserve)==null||o.call(Rt,t),Qe.size||bm()}}const wm=/^(-?\d{4,})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?)?/;function Wc(t,e){if(typeof t!="string")return null;const n=wm.exec(t.trim());if(!n)return null;const[o,r,s,i=0,a=0,c=0]=n.slice(1,7).map(d=>d===void 0?void 0:Number(d)),l=new Date(Date.UTC(2e3,r-1,s,i,a,c));if(l.setUTCFullYear(o),l.getUTCMonth()!==r-1||l.getUTCDate()!==s)return null;const u=!i&&!a&&!c&&!Number(n[7]??0);return{at:l,precision:e??(u?s!==1?"day":r!==1?"month":"year":"time")}}const xm=mt(()=>import("./NavDate-Clj6OMa6.mjs").then(t=>t.a).then(({NavDate:t})=>({default:t})));function Sm(t,e,n,o){const r=t.source!==void 0?t.source:ps(t.resource),[s,i]=z(r==null?void 0:r.src),a=(r==null?void 0:r.src)??(r==null?void 0:r.service)??(r==null?void 0:r.fallback);return D(()=>{if(!r)return i(void 0);if(r.src)return i(r.src);if(!o)return;let c=true;return ms(r,e,n).then(l=>{c&&i(l)}),()=>{c=false}},[a,e,o]),{src:s,none:!r}}const km=()=>f("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",children:[f("path",{d:"M232 416a24 24 0 01-14.9-5.2L125.8 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.8l91.3-74.8A24 24 0 01256 120v272a24 24 0 01-24 24z"}),f("path",{d:"M336 176a112 112 0 010 160M384 128a176 176 0 010 256",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"32"})]});function Cm({part:t,size:e,request:n,alt:o,altLang:r}){const[s,i]=z(null),a=Ec(s,Cc,s==null?void 0:s.closest('[data-layout="slider"] .clover-items-viewport')),{src:c,none:l}=Sm(t,e,n,a),[u,d]=z(false),{width:h,height:p}=t.resource??{},m=h&&p?h/p:1;return f("span",{ref:i,className:"clover-items-picture","data-loaded":u,"data-empty":c?void 0:true,style:c&&!(h&&p)?void 0:{"--clover-items-ratio":m},children:[!c&&l&&An(t.media)&&f(km,{}),c&&f("img",{src:c,alt:o,...ut(o?r:void 0),width:e,height:Math.round(e/m),loading:"lazy",decoding:"async",draggable:false,onLoad:()=>d(true),onError:()=>d(true)}),t.duration?f("span",{className:"clover-items-duration",children:Hf(t.duration)}):null]})}function Em({text:t,lang:e,first:n}){const o=$(null),[r,s]=z(false);return D(()=>{const i=o.current;if(!(!i||!t))return _m(i,s)},[t]),f("span",{className:"clover-items-label","data-clamped":r||void 0,children:[!n&&" ",f("span",{ref:o,className:"clover-items-label-text",...ut(t?e:void 0),children:t}),r&&f("span",{className:"clover-items-label-full",...ut(e),"aria-hidden":"true",hidden:true,children:t})]})}function Mm({item:t,size:e,language:n,request:o,showSummary:r=false,secondary:s="summary"}){var u,d;const i=t.parts.map(h=>bt(t.parts.length===1?t.label:h.label,n)),a=r&&s==="summary"?bt(t.summary,n):null,c=r&&s==="navDate"?Wc(t.navDate):null,l=i.some(h=>h.text);return f("figure",{role:"none",className:"clover-items-figure","data-parts":t.parts.length,"data-media":(d=(u=t.parts[0])==null?void 0:u.media)==null?void 0:d.toLowerCase(),style:{"--parts":t.parts.length},children:[f("span",{className:"clover-items-pictures",children:t.parts.map((h,p)=>{const m=i[p].text?{text:""}:bt(h.label,n);return f(Cm,{part:h,size:e,request:o,alt:m.text,altLang:m.lang},h.id)})}),(l||c||(a==null?void 0:a.text))&&f("figcaption",{className:"clover-items-caption",children:[i.map((h,p)=>f(Em,{text:h.text,lang:h.lang,first:p===0},t.parts[p].id)),c&&f(_t,{fallback:null,children:f(xm,{value:t.navDate,className:"clover-items-date"})}),(a==null?void 0:a.text)&&f("span",{className:"clover-items-summary",...ut(a.lang),children:a.text.replace(/<[^>]*>/g,"")})]})]})}function Tm(t){var e;return(e=rs(t).find(({body:n})=>n.type))==null?void 0:e.body.type}function Uc(t){const e=Tm(t)??(t.type==="Timeline"?"Sound":void 0);return{id:t.id,type:t.type,label:t.label,resource:t,duration:Number(t.duration)||void 0,media:e}}const aa=new WeakMap;function jc(t){if(!t)return[];let e=aa.get(t);if(!e){const{canvases:n,views:o}=Lt(t);e=o.map(r=>{const s=r.map(i=>Uc(n[i]));return{id:s[0].id,parts:s,label:s.length===1?s[0].label:{none:[s.map(i=>bt(i.label).text).filter(Boolean).join(" \u2013 ")]}}}),aa.set(t,e)}return e}const ca=new WeakMap;function go(t){if(!t)return[];let e=ca.get(t);return e||(e=H(t.items).filter(n=>n==null?void 0:n.id).map(n=>{var o;return{id:n.id,parts:[Uc(n)],label:n.label,summary:n.summary,...typeof n.navDate=="string"?{navDate:n.navDate}:{},href:((o=H(n.homepage)[0])==null?void 0:o.id)??n.id,...En(H(n.homepage)[0])?{hrefLang:En(H(n.homepage)[0])}:{}}}),ca.set(t,e)),e}function ny(t){return t?Array.isArray(t)?go({items:t}):t.type==="Collection"?go(t):jc(t):[]}function Vc(t){const e=Math.max(1,Math.round(t));return e<=6?`h${e}`:null}const vs=(t,e="p")=>Vc(t)??e;function qc(t,e,n="p"){const o=Vc(t);return o?{as:o,title:{},group:{}}:{as:n,title:{id:e},group:{role:"group","aria-labelledby":e}}}function Im(t,e,{orientation:n="both",rtl:o=false,onActivate:r,onMove:s}={}){const[i,a]=z(Math.max(0,e)),c=$([]),l=$(r);l.current=r;const u=$(s);u.current=s,D(()=>{e>=0&&a(e)},[e]);const d=Math.min(i,Math.max(0,t-1)),h=dt(g=>{var b;a(g),(b=c.current[g])==null||b.focus()},[]),p=dt((g,b)=>{var M,R;const v=o?"ArrowLeft":"ArrowRight",w=o?"ArrowRight":"ArrowLeft",_=n!=="vertical",x=n!=="horizontal";let S=null;if(_&&g.key===v||x&&g.key==="ArrowDown")S=Math.min(t-1,b+1);else if(_&&g.key===w||x&&g.key==="ArrowUp")S=Math.max(0,b-1);else if(g.key==="Home")S=0;else if(g.key==="End")S=t-1;else if(g.key==="Enter"||g.key===" "){(M=l.current)==null||M.call(l,b,g),g.preventDefault();return}S!==null&&(g.preventDefault(),h(S),S!==b&&((R=u.current)==null||R.call(u,S,g)))},[t,n,o,h]);return{focused:d,itemProps:g=>({ref:b=>{c.current[g]=b},tabIndex:g===d?0:-1,onKeyDown:b=>p(b,g),onFocus:()=>a(g)})}}const Pm=5,Lm=()=>{var t;return typeof window<"u"&&!!((t=window.matchMedia)!=null&&t.call(window,"(prefers-reduced-motion: reduce)").matches)};function Kc({align:t="start",dragFree:e=false,itemCount:n=0}={}){const[o,r]=z(null),[s,i]=z(false),[a,c]=z(false),l=$(t);l.current=t;const u=e?"none":"x mandatory",d=dt(()=>{if(!o)return;const v=Math.abs(o.scrollLeft),w=o.scrollWidth-o.clientWidth;i(v>1),c(v<w-1)},[o]);D(()=>{if(!o)return;const v=o.style;v.overflowX="auto",v.overflowY="hidden",v.scrollSnapType=u,v.setProperty("--clover-track-align",t),v.overscrollBehaviorX="contain"},[o,u,t]),D(()=>{if(!o)return;let v=0;const w=()=>{cancelAnimationFrame(v),v=requestAnimationFrame(d)};d(),o.addEventListener("scroll",w,{passive:true});const _=typeof ResizeObserver<"u"?new ResizeObserver(w):null;return _==null||_.observe(o),o.firstElementChild&&(_==null||_.observe(o.firstElementChild)),()=>{cancelAnimationFrame(v),o.removeEventListener("scroll",w),_==null||_.disconnect()}},[o,d,n]);const h=dt((v,w=false)=>{if(!o||!v)return;const _=w||Lm()?"auto":"smooth";o.scrollBy({left:v,behavior:_})},[o]),p=dt((v,{instant:w=false}={})=>{const _=o==null?void 0:o.querySelector(`[data-track-index="${v}"]`);if(!o||!_)return false;const x=o.getBoundingClientRect(),S=_.getBoundingClientRect(),M=getComputedStyle(o).direction==="rtl";return h(l.current==="center"?S.left+S.width/2-(x.left+x.width/2):M?S.right-x.right:S.left-x.left,w),true},[o,h]),m=dt(v=>{if(!o)return;const w=getComputedStyle(o).direction==="rtl";h(v*o.clientWidth*.9*(w?-1:1))},[o,h]),g=dt(()=>m(1),[m]),b=dt(()=>m(-1),[m]);return D(()=>{if(!o)return;let v=null,w=false;const _=R=>{R.pointerType!=="mouse"||R.button!==0||(v={x:R.clientX,scroll:o.scrollLeft},w=false)},x=R=>{var J;if(!v)return;const N=R.clientX-v.x;!w&&Math.abs(N)<Pm||(w||(w=true,(J=o.setPointerCapture)==null||J.call(o,R.pointerId),o.style.scrollSnapType="none",o.dataset.dragging="true"),o.scrollLeft=v.scroll-N)},S=R=>{var N;v&&(v=null,w&&((N=o.releasePointerCapture)==null||N.call(o,R.pointerId),delete o.dataset.dragging,o.style.scrollSnapType=u))},M=R=>{w&&(w=false,R.preventDefault(),R.stopPropagation())};return o.addEventListener("pointerdown",_),o.addEventListener("pointermove",x),o.addEventListener("pointerup",S),o.addEventListener("pointercancel",S),o.addEventListener("click",M,true),()=>{o.removeEventListener("pointerdown",_),o.removeEventListener("pointermove",x),o.removeEventListener("pointerup",S),o.removeEventListener("pointercancel",S),o.removeEventListener("click",M,true)}},[o,u]),{ref:r,canScrollPrev:s,canScrollNext:a,scrollPrev:b,scrollNext:g,scrollToIndex:p,measure:d}}const vo=ne(function(e,n){return!Pe()||e.iiifContent!==void 0||e.items!==void 0?f(_t,{fallback:null,children:f(Am,{...e,forwardedRef:n})}):f(Om,{...e,forwardedRef:n})}),Am=mt(()=>import("./StandaloneItems-DuXasJO0.mjs"));function Om({of:t="views",...e}){return t==="targets"?f(Rm,{...e}):t==="annotations"?f($m,{...e}):t==="members"?f(Zc,{...e}):f(Fm,{...e})}const Nm=mt(()=>import("./TargetItems-DOFSQtYR.mjs"));function Rm(t){return it(n=>{var o;return(((o=n.targets)==null?void 0:o.items.length)??0)>1})?f(_t,{fallback:null,children:f(Nm,{...t})}):null}const Bm=mt(()=>import("./AnnotationItems-Cvh3jfmf.mjs"));function $m(t){return it(n=>!!nc(n.manifest,n.addedSets))?f(_t,{fallback:null,children:f(Bm,{...t})}):null}function Zc({onSelect:t,forwardedRef:e,...n}){const{clover:o,language:r}=Pe(),s=it(u=>u.collection),i=it(u=>{var d;return((d=u.manifest)==null?void 0:d.id)??null}),a=go(s),c=Xr(s==null?void 0:s.viewingDirection);if(!a.length)return null;const l=(u,d)=>{t==null||t(u,d),o.goToManifest(u.id)};if(n.layout==="pager"){const u=a.findIndex(d=>d.id===i);return f(Xc,{...n,forwardedRef:e,steps:Gc(a,u,c,l),nameKey:"informationPanelTabsCollection",position:f(zm,{position:u,total:a.length,list:d=>f(Zc,{layout:"list",forwardedRef:null,onSelect:d})})})}return f(Yc,{...n,forwardedRef:e,items:a,selected:a.findIndex(u=>u.id===i),navigation:"id",rtl:c==="right-to-left",language:r,request:o.request,showSummary:true,onActivate:l})}function Fm({onSelect:t,forwardedRef:e,singleItem:n=false,...o}){const{clover:r,language:s}=Pe(),i=it(d=>d.manifest),a=it(d=>On(d.manifest,d.canvasId)),c=it(d=>Lt(d.manifest).direction),l=jc(i);if(l.length<(n?1:2))return null;const u=d=>r.goTo(d.id);return o.layout==="pager"?f(Xc,{...o,forwardedRef:e,steps:Gc(l,a,c,u)}):f(Yc,{...o,forwardedRef:e,items:l,selected:a,navigation:"id",rtl:c==="right-to-left",language:s,request:r.request,onActivate:(d,h)=>{t==null||t(d,h),r.goTo(d.id)},followFocus:u})}function Gc(t,e,n,o){return{position:e,total:t.length,direction:n,step:(r,s)=>{const i=t[e+r];i&&o(i,s)}}}const Dm=mt(()=>import("./PagerLayout-CtlmDRjI.mjs")),zm=mt(()=>import("./PagerLayout-CtlmDRjI.mjs").then(({CountMenu:t})=>({default:t})));function Xc(t){return f(_t,{fallback:null,children:f(Dm,{...t})})}function Yc({forwardedRef:t,items:e,selected:n,navigation:o,rtl:r=false,layout:s="slider",thumbnailSize:i=200,request:a,language:c,showSummary:l=false,secondary:u="summary",heading:d,headingLevel:h=2,renderItem:p,onActivate:m,followFocus:g,as:b="section",className:v,"aria-label":w,size:_,singleItem:x,highContrast:S,...M}){var Nt;const{t:R}=It(),N=fe(),J=wo(t,M.lang),{langOf:et}=J,X=qr(S),V=s==="slider",T=o==="id",E=$(null),A=s==="masonry";D(()=>{const q=E.current;if(!A||!q)return;let rt,Q=true;return import("../masonry-BZCdA3bV.mjs").then(({attachMasonry:wt})=>{Q&&(rt=wt(q))}),()=>{Q=false,rt==null||rt()}},[A]);const W=Kc({align:T?"center":"start",itemCount:e.length}),G=$(void 0);D(()=>()=>window.clearTimeout(G.current),[]);const Y=Im(e.length,n,{orientation:s==="slider"?"horizontal":s==="list"?"vertical":"both",rtl:r,onActivate:(q,rt)=>m(e[q],rt),onMove:g?(q,rt)=>{window.clearTimeout(G.current);const Q=()=>g(e[q]);rt.repeat?G.current=window.setTimeout(Q,150):Q()}:void 0}),st=$(null),St=$(false);St.current=!!((Nt=st.current)!=null&&Nt.contains(st.current.ownerDocument.activeElement)),D(()=>{var wt;const q=st.current;if(!q||!St.current)return;const{activeElement:rt,body:Q}=q.ownerDocument;rt&&rt!==Q||(wt=q.querySelector(`[data-track-index="${Math.max(0,n)}"]`))==null||wt.focus()},[e]);const ot=$(false);D(()=>{var Q;if(n<0)return;const q=!ot.current;if(V){W.scrollToIndex(n,{instant:q})&&(ot.current=true);return}ot.current=true;const rt=(Q=st.current)==null?void 0:Q.querySelector(`[data-track-index="${n}"]`);rt&&Hm(rt,q)},[V,n,W.scrollToIndex]);const ct=vs(h),y=d?bt(d.label,c):null,C=d?bt(d.summary,c):null,L=w===void 0&&!!(y!=null&&y.text),F=Eo(R("itemsLabel"),et("itemsLabel"),w!==void 0||L,J.hostLanguage),O=L?{"aria-labelledby":`${N}-title`}:w!==void 0?{"aria-label":w}:F.props,P=(q,rt)=>p?p(q,{selected:rt}):f(Mm,{item:q,size:i,language:c,request:a,showSummary:l,secondary:u}),U=q=>!(p||bt(q.label,c).text||l&&u==="summary"&&bt(q.summary,c).text),K=(q,rt)=>U(q)?R("canvasPosition",{index:rt+1,total:e.length}):void 0,yt=q=>U(q)?et("canvasPosition"):void 0,tt=V?{display:"flex",margin:0,padding:0,listStyle:"none"}:void 0,pt=V?{flex:"0 0 auto",scrollSnapAlign:T?"center":"start"}:void 0,ft=T&&n>=0,Ht=q=>{const rt=n+(q==="prev"?-1:1),Q=ft?rt>=0&&rt<e.length:q==="prev"?W.canScrollPrev:W.canScrollNext,wt=ft?q==="prev"?"commonPrevious":"commonNext":q==="prev"?"itemsScrollBack":"itemsScrollForward",Bt=R(wt),oe=we=>{if(!Q)return;if(!ft)return(q==="prev"?W.scrollPrev:W.scrollNext)();const B=e[rt];g?g(B):m(B,we)};return f("button",{type:"button",className:`clover-items-scroll-${q}`,"aria-controls":ft?void 0:`${N}-viewport`,...ut(et(wt)),"aria-disabled":!Q||void 0,tabIndex:Q?void 0:-1,onClick:oe,children:[f("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:f("path",{d:q==="next"!==r?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),f("span",{style:sn,children:Bt}),f(We,{label:Bt})]})};return f(Pn.Provider,{value:J.hostLanguage,children:f(b,{ref:J.ref,className:Mt("clover-items",v),"data-layout":s,"data-navigation":o,...Kr(X),...M,children:[d&&((y==null?void 0:y.text)||(C==null?void 0:C.text))&&f("header",{className:"clover-items-header",children:[(y==null?void 0:y.text)&&f(ct,{className:"clover-items-title clover-title",id:`${N}-title`,...ut(y.lang),children:y.text}),(C==null?void 0:C.text)&&f("p",{className:"clover-items-description",...ut(C.lang),children:C.text.replace(/<[^>]*>/g,"")}),d.homepage&&f("a",{className:"clover-items-homepage",href:d.homepage,hrefLang:d.homepageLang,...ut(et("commonViewAll")),children:R("commonViewAll")})]}),f("div",{className:"clover-items-frame",style:{position:"relative"},dir:r?"rtl":void 0,children:[V&&Ht("prev"),f("div",{id:`${N}-viewport`,className:"clover-items-viewport",ref:V?W.ref:E,children:T?f("div",{ref:st,role:"listbox",...O,"aria-orientation":V?"horizontal":"vertical",className:"clover-items-track",style:tt,children:e.map((q,rt)=>{const Q=rt===n;return f("div",{id:`${N}-${rt}`,role:"option","aria-selected":Q,"aria-label":K(q,rt),...ut(yt(q)),className:"clover-items-item","data-track-index":rt,style:pt,...Y.itemProps(rt),onClick:wt=>m(q,wt),children:P(q,Q)},q.id)})}):f("ul",{...O,className:"clover-items-track",style:tt,children:e.map((q,rt)=>f("li",{className:"clover-items-item","data-track-index":rt,style:pt,children:f("a",{className:"clover-items-link",href:q.href,hrefLang:q.hrefLang,"aria-label":K(q,rt),...ut(yt(q)),draggable:false,onClick:Q=>m(q,Q),children:P(q,false)})},q.id))})}),V&&Ht("next")]}),F.node]})})}function Hm(t,e){var i;let n=t.parentElement;for(;n&&n!==document.body;){const{overflowY:a}=getComputedStyle(n);if(/(auto|scroll)/.test(a)&&n.scrollHeight>n.clientHeight)break;n=n.parentElement}if(!n||n===document.body)return;const o=n.getBoundingClientRect(),r=t.getBoundingClientRect(),s=r.top<o.top?r.top-o.top:r.bottom>o.bottom?r.bottom-o.bottom:0;s&&((i=n.scrollBy)==null||i.call(n,{top:s,behavior:e?"auto":"smooth"}))}function Wm(t,e){const{clover:n}=de(e),o=qh(),{direction:r}=Ac(),s=it(l=>l.collection),i=it(l=>{var u;return((u=l.manifest)==null?void 0:u.id)??null}),a=it(l=>{var u;return((u=l.targets)==null?void 0:u.items.length)??0}),c=it(l=>nd(l.targets,l.targetIndex,l.manifest,l.canvasId));if(t==="targets")return{position:c,total:a,direction:"left-to-right",step:l=>{const u=c+l;u>=0&&u<a&&n.goToTarget(u)}};if(t==="members"){const l=go(s),u=l.findIndex(d=>d.id===i);return{position:u,total:l.length,direction:"left-to-right",step:d=>{const h=l[u+d];h&&n.goToManifest(h.id)}}}return{position:o.position,total:o.total,direction:r,step:l=>l<0?o.previous():o.next()}}const Um=ne(function({steps:e,as:n="span",className:o,...r},s){const{t:i,langOf:a}=It(),{position:c,total:l}=e;if(l<2||c<0)return null;const u=c+1;return f(n,{ref:s,className:Mt("clover-pager-position",o),...r,children:[f("span",{"aria-hidden":"true",children:[u," / ",l]}),f("span",{className:"clover-pager-room","aria-hidden":"true",hidden:true,children:[l," / ",l]}),f("span",{style:sn,...ut(a("canvasPosition")),children:i("canvasPosition",{index:u,total:l})})]})}),jm=ne(function({of:e="views",...n},o){const r=Wm(e,"Position");return f(Um,{ref:o,...n,steps:r})});function Vm({className:t,loading:e,error:n}){const{t:o,langOf:r}=It(),{status:s,error:i}=Uh(),a=s==="loading",c=e!==void 0&&e!==false;return f(Ct,{children:[f("p",{className:Mt("clover-status",t),"data-status":a?s:void 0,role:"status",style:a&&e!==false?void 0:sn,children:[a&&(c?e:e===void 0&&f(Sn,{})),a&&!c&&f("span",{style:sn,...ut(r("statusLoading")),children:o("statusLoading")})]}),s==="error"&&i&&f("div",{className:Mt("clover-status",t),"data-status":s,role:"alert",children:n?n(i):f(Ct,{children:[f("p",{...ut(r("statusError")),children:o("statusError")}),f("p",{className:"clover-status-detail",lang:"en",children:i.message})]})})]})}function qm(t,e=false,n=3){const o=e||dm(t),r=e?`${n}
|
|
28
|
-
${t}`:t,[s,i]=z(null);return D(()=>{if(!o)return;let a=true;return Promise.all([import("../sanitize-BedC_UE5.mjs"),e?import("../markdown-CCYJwzFn.mjs"):null]).then(([{sanitizeHTML:c,trusted:l},u])=>{const d=u?u.markdownToHtml(t,{headingLevel:n}):t,h=c(d,{markdown:!!u});a&&i({for:r,html:h,inner:l(h)})}),()=>{a=false}},[t,r,o,e,n]),o&&(s==null?void 0:s.for)===r?s:null}const Km=new Set(["p","span","h1","h2","h3","h4","h5","h6","a","b","i","em","strong","small","sub","sup","label"]),Jc=ne(function({as:e="span",markup:n,language:o,format:r,headingLevel:s,...i},a){const{text:c,lang:l}=bt(n,o),u=ut(l),d=fm(r,c),h=d==="markdown",p=qm(d==="plain"?"":c,h,s),m=(p==null?void 0:p.html)??null;if(!c)return null;if(d==="plain")return f(e,{ref:a,...i,...u,children:c.split(/\r?\n/).map((b,v)=>f(ae.Fragment,{children:[v>0&&f("br",{}),b]},v))});const g=typeof e=="string"&&Km.has(e)&&m&&/<(p|ul|ol|div)[\s>]/i.test(m)?"div":e;return p?f(g,{ref:a,...i,...u,dangerouslySetInnerHTML:{__html:p.inner}}):f(e,{ref:a,...i,...u,children:h?hm(c):Rn(c)})}),Qc=({metadata:t,language:e,renderValue:n,...o})=>t!=null&&t.length?f("dl",{...o,children:t.map((r,s)=>{const i=bt(r.label,e),a=n==null?void 0:n(r);return f("div",{"data-label":bt(r.label,"none").text.replace(/\s+/g,"-").toLowerCase(),children:[f("dt",{...ut(i.lang),children:i.text}),a!==void 0?f("dd",{children:a}):f(Jc,{as:"dd",markup:r.value,language:e})]},s)})}):null,Zm=typeof window>"u"?D:Dt;function Gm({children:t}){const{t:e}=It(),n=wo(),o=$(null),r=fe(),s=ae.Children.only(t),i=s.props.id??r,{open:a,cut:c,toggle:l}=Xm(o);return f("div",{className:"clover-read-more",children:[ae.cloneElement(s,{ref:o,id:i,"data-read-more":a?"open":""}),(c||a)&&f("button",{type:"button",className:"clover-read-more-button","aria-expanded":a,"aria-controls":i,onClick:l,ref:n.ref,...ut(n.langOf(a?"readLess":"readMore")),children:e(a?"readLess":"readMore")})]})}function Xm(t){const[e,n]=z(false),[o,r]=z(false),s=()=>{const i=t.current;i&&!e&&r(i.scrollHeight>i.clientHeight+1)};return Zm(s),D(()=>{var d,h;const i=t.current;if(!i)return;let a=0;const c=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(s)},l=typeof ResizeObserver>"u"?null:new ResizeObserver(c);l==null||l.observe(i);const u=typeof MutationObserver>"u"?null:new MutationObserver(c);return u==null||u.observe(document.head,{childList:true,subtree:true,characterData:true}),u==null||u.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),u==null||u.observe(i,{attributes:true,attributeFilter:["style"]}),(h=(d=document.fonts)==null?void 0:d.addEventListener)==null||h.call(d,"loadingdone",c),()=>{var p,m;cancelAnimationFrame(a),l==null||l.disconnect(),u==null||u.disconnect(),(m=(p=document.fonts)==null?void 0:p.removeEventListener)==null||m.call(p,"loadingdone",c)}},[e,t.current]),{open:e,cut:o,toggle:()=>n(i=>!i)}}function dn(t,e,n){const o=hs(),r=Ln(s=>{var i;return(i=Io(s,t))==null?void 0:i[e]},void 0);return n!==void 0?n:o?o[e]:r}const Bn=()=>{var t;return(t=Pe())==null?void 0:t.language};function la({of:t="manifest",as:e="p",value:n,className:o,...r}){const s=dn(t,"summary",n),i=Bn();return bt(s,i).text?f(Gm,{children:f(Jc,{as:e,markup:s,language:i,className:Mt("clover-summary",o),...r})}):null}function Ym({of:t="manifest",value:e,className:n,renderValue:o,...r}){const s=dn(t,"metadata",e),i=Bn();return f(Qc,{metadata:s,language:i,renderValue:o,className:Mt("clover-metadata",n),...r})}function Jm({of:t="manifest",value:e,className:n,...o}){const r=dn(t,"requiredStatement",e),s=Bn();return f(Qc,{metadata:r?[r]:null,language:s,className:Mt("clover-required-statement",n),...o})}function Qm({of:t="manifest",value:e,className:n,...o}){const r=dn(t,"rights",e);return r?f("a",{href:r,className:Mt("clover-rights",n),...o,children:r}):null}function tg({of:t="manifest",value:e,className:n,...o}){const r=dn(t,"id",e);return r?f("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:Mt("clover-id",n),...o,children:r}):null}function tl({property:t,className:e,of:n="manifest",value:o,...r}){const s=H(dn(n,t,o)),i=Bn(),a=s.filter(c=>c==null?void 0:c.id);return a.length?f("ul",{className:e,...r,children:a.map(c=>{const l=bt(c.label,i);return f("li",{children:[f("a",{href:c.id,target:"_blank",rel:"noopener noreferrer",hrefLang:En(c),...ut(l.text?l.lang:void 0),children:l.text?Rn(l.text):c.id}),c.format&&f("span",{className:"clover-link-format",children:[" (",c.format,")"]})]},c.id)})}):null}const eg=({className:t,...e})=>f(tl,{property:"homepage",className:Mt("clover-homepage",t),...e}),ng=({className:t,...e})=>f(tl,{property:"seeAlso",className:Mt("clover-see-also",t),...e});function og({of:t="manifest",value:e,size:n=400,className:o,...r}){var m;const s=Ln(g=>Io(g,t),null),i=e??s,a=Bn(),c=i?ps(i):null,l=(c==null?void 0:c.src)??(c==null?void 0:c.service)??(c==null?void 0:c.fallback),[u,d]=z(c==null?void 0:c.src),h=(m=Pe())==null?void 0:m.clover.request;if(D(()=>{if(!c)return d(void 0);if(c.src)return d(c.src);let g=true;return ms(c,n,h).then(b=>g&&d(b)),()=>{g=false}},[l,n]),!u)return null;const p=bt(i==null?void 0:i.label,a);return f("img",{src:u,alt:Rn(p.text),...ut(r.alt===void 0&&p.text?p.lang:void 0),width:n,loading:"lazy",decoding:"async",className:Mt("clover-thumbnail",o),...r})}const rg=typeof window>"u"?D:Dt,el=ue(null),sg=t=>{var e;return!!((e=t.textContent)!=null&&e.trim())||t.querySelector("img, svg, picture, video, canvas, object")!==null},ig=t=>!!t&&typeof t=="object"&&["label","logo","homepage"].some(e=>H(t[e]).length>0),$r=t=>!!t&&typeof t.id=="string",ag=t=>{const e=H(t.homepage).find($r);return e?{id:e.id,hrefLang:En(e)}:void 0},cg=(t,e)=>{var n;if(!t)return null;for(const o of[t.label,(n=H(t.homepage).find(r=>r==null?void 0:r.label))==null?void 0:n.label]){const r=bt(o,e);if(r.text)return{text:Rn(r.text),lang:r.lang}}return null};function nl({of:t="manifest",value:e,link:n=true,children:o,className:r,...s}){var l;const i=Ln(u=>{var d;return(d=Io(u,t))==null?void 0:d.provider},void 0),a=(l=Pe())==null?void 0:l.language,c=H(e!==void 0?e:i).filter(ig);return c.length?f("ul",{className:Mt("clover-provider",r),...s,children:c.map((u,d)=>{const h=n?ag(u):void 0,p=!!bt(u.label,a).text;return f(lg,{agent:u,homepage:h,children:o??f(Ct,{children:[f(ol,{alt:p?"":void 0}),f(en,{className:"clover-provider-label"})]})},u.id??d)})}):null}function lg({agent:t,homepage:e,children:n}){const o=$(null),[r,s]=z(null),i=dt(()=>{o.current&&!sg(o.current)&&s(t)},[t]);return r===t?null:f("li",{className:"clover-provider-agent",children:f(zc.Provider,{value:t,children:f(el.Provider,{value:i,children:e?f("a",{ref:o,href:e.id,target:"_blank",rel:"noopener noreferrer",hrefLang:e.hrefLang,className:"clover-provider-link",children:n}):f("span",{ref:o,className:"clover-provider-content",children:n})})})})}function ol({of:t="manifest",value:e,alt:n,className:o,...r}){var h;const{t:s,langOf:i}=It(),a=hs(),c=Ln(p=>{var m;return(m=Io(p,t))==null?void 0:m.provider},void 0),l=(h=Pe())==null?void 0:h.language,d=(e!==void 0?H(e):a?[a]:H(c)).flatMap(p=>{if(!p||typeof p!="object")return[];const m=p;if(m.type!=="Agent"&&$r(m)&&!m.logo)return[{image:m,agent:null}];const g=H(m.logo).find($r);return g?[{image:g,agent:m}]:[]});return d.length?f(Ct,{children:d.map(({image:p,agent:m},g)=>{const b=cg(m,l);return f(ug,{src:p.id,alt:n??(b==null?void 0:b.text)??s("logo"),...ut(n!==void 0?void 0:b?b.lang:i("logo")),width:p.width,height:p.height,loading:"lazy",decoding:"async",className:Mt("clover-logo",o),...r},`${p.id}-${g}`)})}):null}function ug({alt:t,onError:e,...n}){const o=zt(el),[r,s]=z(false),i=dt(()=>s(true),[]);rg(()=>{r&&(o==null||o())},[r,o]);const a=dt(c=>{var l;c!=null&&c.complete&&!c.naturalWidth&&((l=c.decode)==null||l.call(c).catch(i))},[i]);return r?null:f("img",{ref:a,alt:t,onError:c=>{e==null||e(c),i()},...n})}function dg(t,e,n){if(n&&t.includes(n))return n;if(!t.length)return;const o=Zr(t,e);return o==="none"?t[0]:o}const fg=t=>t&&typeof t=="object"&&!Array.isArray(t)?Object.keys(t).filter(e=>e!=="none"&&e!=="@none"&&bt({[e]:t[e]}).text):[];function hg(t){if(!t)return[];const e=[...Array.isArray(t.metadata)?t.metadata:[],t.requiredStatement].filter(Boolean),o=[t.label,t.summary,...e.flatMap(r=>[r==null?void 0:r.label,r==null?void 0:r.value])].map(fg).filter(r=>r.length>1);return[...new Set(o.flat())]}function rl(){const{language:t,chooseLanguage:e}=de("About"),n=it(s=>s.manifest),o=vt(()=>hg(n),[n]),r=dg(o,t);return r&&e?{languages:o,chosen:r,onChange:e}:null}const pg=mt(()=>import("./LanguageChoice-CZ6K3Mhv.mjs").then(t=>({default:t.LanguageChoice}))),sl=ue(false);function mg({part:t}){const e=rl();return e?f(_t,{fallback:null,children:f(pg,{...e,nameKey:"readingLanguage",part:t})}):null}function ua(t,e){const n=new Set,o=[];for(const r of t)for(const s of H(r==null?void 0:r.rendering)){const i=(s==null?void 0:s.id)??(s==null?void 0:s["@id"]);if(typeof i!="string"||n.has(i))continue;n.add(i);const a=bt(s.label,e);o.push({id:i,label:a.text||s.format||i,lang:a.text?a.lang:void 0,format:s.format,hrefLang:En(s)})}return o}function il(){const{language:t}=de("Download"),e=it(o=>o.manifest),n=it(o=>De(o.manifest,o.canvasId));return{page:ua(n,t),all:ua([e],t)}}const gg=mt(()=>import("./Download-Clx_e2ga.mjs").then(({DownloadGroups:t})=>({default:t}))),vg=mt(()=>import("./NavDate-Clj6OMa6.mjs").then(t=>t.a).then(({NavDate:t})=>({default:t}))),yg=mt(()=>import("./PartOfManifest-NAXs2DYd.mjs"));function bg({languages:t=true,...e}){const n=zt(sl);return f(_g,{...e,download:!n&&e.download!==false,choice:n||!t?null:f(mg,{part:"clover-about"})})}function _g({choice:t,canvasSummary:e=false,headingLevel:n=3,download:o=true,thumbnail:r=true,label:s=true,className:i,...a}){const{t:c,langOf:l}=It(),u=il(),d=it(v=>v.manifest,Object.is,"About"),h=$(null);D(()=>{const v=h.current,w=v==null?void 0:v.querySelector(".clover-about-head");if(!v||!w||typeof ResizeObserver>"u")return;const _=new Set,x=()=>{const R=w.querySelector(".clover-about-thumbnail"),N=w.querySelector(".clover-about-label");for(const V of[R,N])V&&!_.has(V)&&(_.add(V),M.observe(V));const J=v.style;if(!R){J.removeProperty("--clover-about-label-height"),J.removeProperty("--clover-about-thumbnail-width");return}const et=`${(N==null?void 0:N.offsetHeight)??0}px`,X=`${R.offsetWidth}px`;J.getPropertyValue("--clover-about-label-height")!==et&&J.setProperty("--clover-about-label-height",et),J.getPropertyValue("--clover-about-thumbnail-width")!==X&&J.setProperty("--clover-about-thumbnail-width",X)};let S=0;const M=new ResizeObserver(()=>{cancelAnimationFrame(S),S=requestAnimationFrame(x)});return M.observe(w),x(),()=>{cancelAnimationFrame(S),M.disconnect(),v.style.removeProperty("--clover-about-label-height"),v.style.removeProperty("--clover-about-thumbnail-width")}},[s,r,d]);const p=fe(),m=()=>{var _,x;const v=h.current;(x=((_=v==null?void 0:v.closest(".clover-sections-item"))==null?void 0:_.querySelector(".clover-sections-button"))??v)==null||x.focus({preventScroll:true})};if(!d)return null;const g=(v,w,_)=>{if(!w)return null;const{as:x,title:S,group:M}=qc(n,`${p}-${v}`);return f("section",{className:"clover-about-section",...M,children:[f(x,{className:"clover-about-heading",...ut(l(v)),...S,children:c(v)}),_]})},b=v=>Array.isArray(d[v])?d[v].length>0:!!d[v];return f("div",{ref:h,className:Mt("clover-about",i),tabIndex:-1,...a,children:[t,(r||s)&&f("div",{className:"clover-about-head",children:[r&&f(og,{className:"clover-about-thumbnail",size:256,alt:s?"":void 0}),s&&f(en,{as:vs(n),className:"clover-about-label clover-title"})]}),e&&f(la,{of:"canvas",className:"clover-about-summary"}),Ti(d)&&d.partOf&&f(_t,{fallback:null,children:f(yg,{manifest:d,headingLevel:n,onOpened:m})}),f(la,{className:"clover-about-summary"}),f(Ym,{className:"clover-about-metadata"}),f(Jm,{className:"clover-about-metadata"}),g("aboutDate",Wc(d.navDate),f(_t,{fallback:null,children:f(vg,{value:d.navDate,className:"clover-about-date"})})),g("aboutProvider",b("provider"),f(nl,{})),g("aboutRights",d.rights,f(Qm,{})),g("aboutHomepage",b("homepage"),f(eg,{})),g("aboutSeeAlso",b("seeAlso"),f(ng,{})),g("download",o&&u.page.length+u.all.length>0,f(_t,{fallback:null,children:f(gg,{page:u.page,all:u.all,headingLevel:n+1})})),g(Ti(d)?"aboutCanvas":"aboutManifest",d.id,f(tg,{}))]})}const wg=mt(()=>import("./LanguageChoice-CZ6K3Mhv.mjs").then(t=>({default:t.LanguageChoice}))),xg=mt(()=>import("./ControlMenu-q_u_UC8q.mjs")),Sg=mt(()=>import("./Download-Clx_e2ga.mjs").then(({DownloadGroups:t})=>({default:t})));function kg({languages:t=true,download:e=true}){const n=rl(),{page:o,all:r}=il(),s=e&&o.length+r.length>0;return!(t&&n)&&!s?null:f("div",{className:"clover-about-actions",children:[s&&f(Cg,{page:o,all:r}),t&&n&&f(_t,{fallback:null,children:f(wg,{...n,nameKey:"readingLanguage",part:"clover-about"})})]})}function Cg({page:t,all:e}){const{t:n,langOf:o}=It(),[r,s]=z(false),a=`${fe()}-download`,c=dt(l=>{var u;s(false),l&&((u=document.getElementById(a))==null||u.focus())},[a]);return f("span",{className:"clover-about-download",onBlur:l=>{const u=l.relatedTarget;r&&u&&!l.currentTarget.contains(u)&&s(false)},children:[f("button",{type:"button",id:a,className:"clover-about-download-button","aria-label":n("download"),...ut(o("download")),"aria-expanded":r,"aria-controls":r?`${a}-menu`:void 0,onClick:()=>s(l=>!l),children:[f(Eg,{}),f(We,{label:n("download")})]}),r&&f(_t,{fallback:null,children:f(xg,{id:`${a}-menu`,triggerId:a,onClose:c,className:"clover-about-download-menu",children:f(Sg,{page:t,all:e,inPopover:true})})})]})}function Eg(){return f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512","aria-hidden":"true",focusable:"false",fill:"none",stroke:"currentColor",strokeWidth:"56",strokeLinecap:"round",strokeLinejoin:"round",children:f("path",{d:"M256 64v272M160 240l96 96 96-96M80 352v48a48 48 0 0 0 48 48h256a48 48 0 0 0 48-48v-48"})})}function Mg(t,e=null){if(!t)return false;if(e!=null&&e.navPlace||t.navPlace)return true;for(const n of Lt(t).canvases){if(n.navPlace)return true;for(const o of H(n.annotations))for(const r of H(o==null?void 0:o.items))if(r!=null&&r.navPlace||H(r==null?void 0:r.motivation).includes("georeferencing")||H(r==null?void 0:r.body).some(i=>(i==null?void 0:i.type)==="Feature"||(i==null?void 0:i.type)==="FeatureCollection"))return true}return false}const Tg=["about","targets","collection","contents","search","map","transcript","annotations"],Re={targets:t=>{var e;return(((e=t.targets)==null?void 0:e.items.length)??0)>1},collection:t=>{var e,n;return(((n=(e=t.collection)==null?void 0:e.items)==null?void 0:n.length)??0)>0||!!ed(t.manifest)},contents:t=>Hh(t.manifest).length>0,search:t=>!!Ya(t.manifest),map:t=>Mg(t.manifest,t.collection),transcript:t=>De(t.manifest,t.canvasId).some(e=>Sc(e).length>0||eh(e).length>0),annotations:t=>vd(t.manifest,t.addedSets).length>0},Ig=(t,e)=>{const n=Array.isArray(e)?new Set(e):void 0;return Tg.filter(o=>t[o]&&(!n||n.has(o)))};function ys(t){const e={about:true,targets:it(Re.targets),collection:it(Re.collection),contents:it(Re.contents),search:it(Re.search),map:it(Re.map),transcript:it(Re.transcript),annotations:it(Re.annotations)};return Ig(e,t)}function Pg({open:t=false,className:e}){return f("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",className:Mt("clover-chevron",e),"data-open":t||void 0,children:f("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const al=typeof window>"u"?D:Dt,cl=ue(null);function oy(){return zt(cl)}const ll=ue(0);function ry(){return zt(ll)}function Lg({items:t,layout:e="tabs",value:n,onValueChange:o,label:r,labelLang:s,headingLevel:i=3}){var V;const a=fe(),c=Eo(r??"",s,r===void 0),l=$([]),u=e==="tabs",{t:d,langOf:h}=It(),p=Kc({dragFree:true,itemCount:t.length}),m=t.some(T=>T.value===n)?n:((V=t[0])==null?void 0:V.value)??null,g=$(new Set);m&&g.current.add(m);const b=$(null),[v,w]=z({value:null,count:0});D(()=>{var Y;if(u||!m||b.current!==m)return;b.current=null;const T=t.findIndex(st=>st.value===m),E=document.getElementById(`${a}-panel-${T}`),A=(Y=l.current[T])==null?void 0:Y.parentElement;if(!E||!A)return;const W=A.getBoundingClientRect().bottom-E.getBoundingClientRect().top;if(W<=0)return;const G=fr(E);G&&(G.scrollTop-=W)},[m,u,t,a]);const _=T=>{var ct,y,C,L;const E=t.findIndex(F=>F.value===m),A=document.getElementById(`${a}-panel-${E}`),W=T.target;if(!A||W===A||!A.contains(W)||!Og(W))return;const G=(y=(ct=l.current[E])==null?void 0:ct.parentElement)==null?void 0:y.getBoundingClientRect(),Y=E+1<t.length?(L=(C=l.current[E+1])==null?void 0:C.parentElement)==null?void 0:L.getBoundingClientRect():void 0;if(!G)return;const st=W.getBoundingClientRect(),St=st.top<G.bottom?Math.floor(st.top-G.bottom):Y&&st.bottom>Y.top?Math.ceil(Math.min(st.bottom-Y.top,st.top-G.bottom)):0,ot=St?fr(A):null;ot&&(ot.scrollTop+=St)},x=$(null),S=t.map(T=>T.value).join(`
|
|
29
|
-
`);al(()=>{const T=x.current;if(u||!T||typeof ResizeObserver>"u")return;const E=[...T.querySelectorAll(":scope > .clover-sections-item")],A=E.map(O=>O.firstElementChild),W=A[0],G=A[A.length-1],Y=new Map,st=O=>(O&&Y.get(O))??0,St=document.scrollingElement;let ot=null,ct=0;const y=()=>{const O=A.reduce((pt,ft)=>pt+st(ft),0);let P=0;E.forEach((pt,ft)=>{pt.style.setProperty("--clover-sections-before",`${P}px`),P+=st(A[ft]),pt.style.setProperty("--clover-sections-after",`${O-P}px`)}),T.style.setProperty("--clover-sections-total",`${O}px`);const U=W&&getComputedStyle(W);(U==null?void 0:U.position)==="sticky"&&G&&(ct=parseFloat(U.top)+parseFloat(getComputedStyle(G).bottom)||0);const K=getComputedStyle(T),yt=parseFloat(K.lineHeight)||1.2*parseFloat(K.fontSize),tt=(ot==null?void 0:ot.clientHeight)??0;tt>0&&tt-ct-O<2*yt?T.dataset.stacks="off":delete T.dataset.stacks},C=new ResizeObserver(O=>{var P,U;for(const K of O)A.includes(K.target)&&Y.set(K.target,((U=(P=K.borderBoxSize)==null?void 0:P[0])==null?void 0:U.blockSize)??K.target.getBoundingClientRect().height);y()}),L=()=>{const O=fr(T);O!==ot&&(ot&&ot!==St&&C.unobserve(ot),O&&O!==St&&C.observe(O),ot=O)},F=()=>{L(),y()};L();for(const O of A)O&&C.observe(O,{box:"border-box"});return window.addEventListener("resize",F),()=>{C.disconnect(),window.removeEventListener("resize",F);for(const O of E)O.style.removeProperty("--clover-sections-before"),O.style.removeProperty("--clover-sections-after");T.style.removeProperty("--clover-sections-total"),delete T.dataset.stacks}},[u,S,i]),D(()=>{if(u)return;const T=l.current.map(A=>A==null?void 0:A.parentElement).filter(A=>!!A),E=A=>{var st;if(A.ctrlKey)return;const W=A.currentTarget,G=da(W);if(!G||G===document.scrollingElement)return;A.preventDefault();const Y=A.deltaMode===1?parseFloat(getComputedStyle(W).lineHeight)||16:A.deltaMode===2?G.clientHeight:1;(st=da(G)??document.scrollingElement)==null||st.scrollBy({left:A.deltaX*Y,top:A.deltaY*Y,behavior:"instant"})};for(const A of T)A.addEventListener("wheel",E,{passive:false});return()=>{for(const A of T)A.removeEventListener("wheel",E)}},[u,S]);const M=T=>{T!==m&&(b.current=T,u||w(E=>({value:T,count:E.count+1})),o==null||o(T))},R=(T,E)=>{var st;const A=t.length-1,[W,G]=u?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"],Y=T.key===G?(E+1)%t.length:T.key===W?(E-1+t.length)%t.length:T.key==="Home"?0:T.key==="End"?A:null;Y!==null&&(T.preventDefault(),(st=l.current[Y])==null||st.focus(),u&&M(t[Y].value))},N=$(false);D(()=>{if(!u)return;const T=t.findIndex(ot=>ot.value===m),E=l.current[T],A=E==null?void 0:E.parentElement;if(!E||!A)return;const W=getComputedStyle(A),G=A.getBoundingClientRect(),Y=E.getBoundingClientRect(),st=G.left+(parseFloat(W.scrollPaddingLeft)||0),St=G.right-(parseFloat(W.scrollPaddingRight)||0);(Y.left<st-1||Y.right>St+1)&&p.scrollToIndex(T,{instant:!N.current}),N.current=true},[m,u,t.length,p.scrollToIndex]);const J=T=>{const E=T==="prev"?p.canScrollPrev:p.canScrollNext,A=T==="prev"?"sectionsScrollBack":"sectionsScrollForward";return f("button",{type:"button",className:`clover-steps-step clover-sections-scroll-${T}`,"aria-hidden":"true",tabIndex:-1,hidden:!E,...ut(h(A)),onMouseDown:W=>W.preventDefault(),onClick:T==="prev"?p.scrollPrev:p.scrollNext,children:[f("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:f("path",{d:T==="next"?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),f(We,{label:d(A)})]})},et=vs(i,"div"),X=(T,E)=>{const A=T.value===m;return f("button",{ref:W=>{l.current[E]=W},type:"button",id:`${a}-button-${E}`,className:"clover-sections-button","data-value":T.value,"data-track-index":u?E:void 0,"aria-controls":`${a}-panel-${E}`,...u?{role:"tab","aria-selected":A,tabIndex:A?0:-1}:{"aria-expanded":A,"aria-disabled":A||void 0},onClick:()=>M(T.value),onKeyDown:W=>R(W,E),children:[f("span",{className:"clover-sections-label",children:T.label}),!u&&f(Pg,{open:A,className:"clover-sections-chevron"})]},T.value)};return f("div",{ref:x,className:"clover-sections","data-layout":e,onFocus:u?void 0:_,style:u?void 0:{"--clover-sections-count":t.length},children:[u&&f("div",{className:"clover-sections-tabs","data-more":[p.canScrollPrev&&"start",p.canScrollNext&&"end"].filter(Boolean).join(" ")||void 0,children:f("div",{className:"clover-sections-row",children:[f("div",{role:"tablist",ref:p.ref,...c.props,className:"clover-sections-list",children:t.map(X)}),J("prev"),J("next")]})}),u&&c.node,t.map((T,E)=>{const A=T.value===m;return f("section",{className:"clover-sections-item","data-value":T.value,"data-open":A,style:u?void 0:{"--clover-sections-index":E},children:[!u&&f(et,{className:"clover-sections-heading",children:[X(T,E),f("span",{className:"clover-sections-reach","aria-hidden":"true"})]}),f(ll.Provider,{value:v.value===T.value?v.count:0,children:f(Ag,{id:`${a}-panel-${E}`,tabs:u,labelledBy:`${a}-button-${E}`,hidden:!A,actions:T.actions,children:g.current.has(T.value)?T.content:null})})]},T.value)})]})}function Ag({id:t,tabs:e,labelledBy:n,hidden:o,actions:r,children:s}){const[i,a]=z(null),c=!o||!!r;return al(()=>{const l=i==null?void 0:i.parentElement;if(!c||!i||!l||typeof ResizeObserver>"u")return;const u=new ResizeObserver(()=>{const d=i.offsetWidth;d?(l.style.setProperty("--clover-sections-actions",`${d}px`),l.setAttribute("data-actions","")):(l.style.removeProperty("--clover-sections-actions"),l.removeAttribute("data-actions"))});return u.observe(i),()=>{u.disconnect(),l.style.removeProperty("--clover-sections-actions"),l.removeAttribute("data-actions")}},[i,c]),f(Ct,{children:[!e&&f("div",{ref:a,className:"clover-sections-actions",hidden:!c,children:r}),f("div",{id:t,role:e?"tabpanel":"region","aria-labelledby":n,tabIndex:e?0:void 0,className:"clover-sections-panel",hidden:o,children:f(cl.Provider,{value:e?null:i,children:[e&&r,s]})})]})}function fr(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll|hidden/.test(getComputedStyle(e).overflowY))return e;return document.scrollingElement}function da(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll/.test(getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight)return e;return document.scrollingElement}function Og(t){try{return t.matches(":focus-visible")}catch{return true}}const Ng=mt(()=>import("./MapView-Dj7Iq7P2.mjs").then(t=>({default:t.RootMap}))),Rg=mt(()=>import("./Collection-C5BfoUOH.mjs").then(t=>({default:t.Collection}))),Bg=mt(()=>import("./TargetItems-DOFSQtYR.mjs").then(t=>({default:t.TargetsSection}))),$g=mt(()=>import("./Contents-CsG9e7v2.mjs").then(t=>({default:t.Contents}))),Fg=mt(()=>import("./Search-DoUc8tWu.mjs").then(t=>({default:t.Search}))),Dg=mt(()=>import("./Transcript-Dy-FHWMo.mjs").then(t=>({default:t.Transcript}))),zg=mt(()=>import("./Annotations-DKWYJOo2.mjs").then(t=>({default:t.Annotations}))),Be=t=>f(_t,{fallback:null,children:t}),Hg=()=>null,Wg=ne(function({layout:e="tabs",value:n,defaultValue:o,onValueChange:r,onClose:s,closeOnEscape:i=false,headingLevel:a=3,as:c="aside",download:l=true,languages:u=true,sections:d,labels:h,className:p,children:m,onKeyDown:g,...b},v){var O;const{clover:w}=de("Panel"),_=$(null),{t:x,langOf:S,hostLanguage:M,i18n:R}=It(),N=Eo(x("informationPanelTabs"),S("informationPanelTabs"),!!(b["aria-label"]||b["aria-labelledby"])||!(["aside","section","nav"].includes(c)||b.role)),J=P=>{const U=S(P);return U?f("span",{...ut(U),children:x(P)}):x(P)},et=(P,U)=>{const K=h==null?void 0:h[P];if(K===void 0)return J(U);if(typeof K=="string")return K;const yt=Object.keys(K),tt=Zr(yt,R.language);if(!tt)return J(U);const pt=_o(tt,M);return pt?f("span",{...ut(pt),children:K[tt]}):K[tt]},X=ys(d),V=P=>X.includes(P),T=ae.Children.toArray(m).filter(P=>ae.isValidElement(P)&&P.type===Hg),E=e==="accordion"?a+1:a,A=u||l?f(kg,{languages:u,download:l}):void 0,W=T.length?T.map(({props:P})=>({value:P.value,label:P.label,content:P.children,...P.value==="about"&&{actions:A}})):[...V("about")?[{value:"about",label:et("about","informationPanelTabsAbout"),content:f(bg,{headingLevel:E,download:l}),actions:A}]:[],...V("targets")?[{value:"targets",label:et("targets","informationPanelTabsTargets"),content:Be(f(Bg,{headingLevel:E}))}]:[],...V("collection")?[{value:"collection",label:et("collection","informationPanelTabsCollection"),content:Be(f(Rg,{headingLevel:E}))}]:[],...V("contents")?[{value:"contents",label:et("contents","informationPanelTabsContents"),content:Be(f($g,{}))}]:[],...V("search")?[{value:"search",label:et("search","informationPanelTabsSearch"),content:Be(f(Fg,{headingLevel:E,sticky:true,size:"small"}))}]:[],...V("map")?[{value:"map",label:et("map","informationPanelTabsMap"),content:Be(f(Ng,{}))}]:[],...V("transcript")?[{value:"transcript",label:et("transcript","transcriptLabel"),content:Be(f(Dg,{sticky:true,size:"small"}))}]:[],...V("annotations")?[{value:"annotations",label:et("annotations","informationPanelTabsAnnotations"),content:Be(f(zg,{headingLevel:E}))}]:[]],G=it(P=>P.search.query),Y=W.some(P=>P.value==="search"),[st,St]=z(()=>G&&Y?"search":o??null),ot=$(G&&Y?G:"");D(()=>{Y&&(G&&G!==ot.current&&n===void 0&&St("search"),ot.current=G)},[G,Y,n]);const ct=it(P=>{var U;return P.annotationId&&((U=P.regions)!=null&&U.entries.some(K=>K.id===P.annotationId))?P.annotationId:null}),y=W.some(P=>P.value==="contents");D(()=>{ct&&y&&n===void 0&&St("contents")},[ct,y,n]);const C=n!==void 0?n:st,L=(W.some(P=>P.value===C)?C:(O=W[0])==null?void 0:O.value)==="search";if(D(()=>{Y&&w.setSetVisible(Jr,L)},[w,Y,L]),!W.length)return null;const F=()=>{var U;const P=_.current;P!=null&&P.contains(document.activeElement)&&((U=Ug(P))==null||U.focus()),s==null||s()};return f(c,{ref:P=>{_.current=P,typeof v=="function"?v(P):v&&(v.current=P)},className:Mt("clover-panel",p),"data-layout":e,"data-closable":s?"":void 0,"data-floating":i?"":void 0,...N.props,onKeyDown:P=>{g==null||g(P),i&&s&&P.key==="Escape"&&!P.defaultPrevented&&(P.preventDefault(),F())},...b,children:[N.node,s&&f("button",{type:"button",className:"clover-panel-close","aria-label":x("informationPanelClose"),...ut(S("informationPanelClose")),onClick:F,children:[f("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",fill:"none",stroke:"currentColor",children:f(hc,{})}),f(We,{label:x("informationPanelClose")})]}),f(sl.Provider,{value:W.some(P=>P.value==="about"),children:f(Lg,{items:W,layout:e,value:n!==void 0?n:st,onValueChange:P=>{n===void 0&&St(P),r==null||r(P)},label:x("informationPanelTabs"),labelLang:S("informationPanelTabs"),headingLevel:a})})]})});function Ug(t){for(let e=t;e&&e!==document.body;e=e.parentElement){if(!e.id)continue;const n=document.querySelector(`[aria-controls~="${e.id.replace(/["\\]/g,"\\$&")}"]`);if(n)return n}return null}const jg=1,Vg=4,qg=8,Kg=500,Zg=4,fa=["pointerdown","mousedown","pointerup","mouseup","click","dblclick"],ul=()=>typeof document>"u"?16:parseFloat(getComputedStyle(document.documentElement).fontSize)||16;function ro(t,e){if(t===void 0)return;if(typeof t=="number")return t;const n=parseFloat(t);if(!Number.isNaN(n))return t.endsWith("rem")?n*ul():t.endsWith("%")?n/100*e:n}const hr=t=>typeof t=="number"?`${t}px`:t,Gg=t=>{if(!t||typeof localStorage>"u")return{};try{const e=JSON.parse(localStorage.getItem(t)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}},Xg=(t,e)=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},Yg=t=>t?Array.from(t.children).filter(e=>e.classList.contains("clover-split-pane")):[];function Jg(t){const e=i=>{let a=t[i];for(;a&&!a.classList.contains("clover-split-pane");)a=a[i];return a},n=e("previousElementSibling"),o=e("nextElementSibling"),r=o!=null&&o.hasAttribute("data-sized")?o:n!=null&&n.hasAttribute("data-sized")?n:null;return{sized:r,other:r===o?n:o}}function Qg(t,e,n){const{sized:o,other:r}=Jg(t);if(!o)return null;const s=e.clientWidth,i=o.dataset.splitKey??"",a=n[i]??{},c=n[(r==null?void 0:r.dataset.splitKey)??""]??{},l=ro(a.min,s)??0,d=o.getBoundingClientRect().width+((r==null?void 0:r.getBoundingClientRect().width)??0)-(ro(c.min,s)??0),h=Math.max(l,Math.min(ro(a.max,s)??d,d)),p=o.getBoundingClientRect().left>=t.getBoundingClientRect().left-1;return{sized:o,key:i,min:l,max:h,after:p}}function tv(t,e,n){const o=e!==void 0&&e>t.min+1&&e<t.max-1?[t.min,e,t.max]:[t.min,t.max],r=n??e??t.sized.getBoundingClientRect().width,s=o.find(i=>i>r+1)??o[0];return{to:s,own:e!==void 0&&Math.abs(s-e)<=1}}function ev(t,e){const n=e.sized.getBoundingClientRect().width,o=jg*ul()*(t.shiftKey?4:1),r=e.after?"ArrowLeft":"ArrowRight",s=e.after?"ArrowRight":"ArrowLeft";if(t.key===r)return n+o;if(t.key===s)return n-o;if(t.key==="Home")return e.min;if(t.key==="End")return e.max}function ha(t){var n,o,r;const e=(o=(n=t.target)==null?void 0:n.closest)==null?void 0:o.call(n,".clover-tip");return!!(e&&((r=t.currentTarget)!=null&&r.contains(e)))}function nv(t,e){let n=null,o=false,r=null,s=null;const i=a=>{s==null||s();const c=t(),l=c==null?void 0:c.ownerDocument.defaultView;if(!c||!l)return;const u=g=>Math.hypot(g.clientX-a.x,g.clientY-a.y)>a.reach,d=()=>{fa.forEach(g=>l.removeEventListener(g,h,true)),l.removeEventListener("pointermove",p,true),clearTimeout(m),s=null},h=g=>{if(!c.contains(g.target)){if(g.type==="pointerdown"&&u(g))return d();g.preventDefault(),g.stopPropagation()}},p=g=>u(g)&&d();fa.forEach(g=>l.addEventListener(g,h,true)),l.addEventListener("pointermove",p,true);const m=setTimeout(d,Kg);s=d};return{down(a){var u;if(o=false,r=null,a.defaultPrevented||a.button!==0||ha(a))return;const c=e().limits();if(!c)return;a.preventDefault(),n={found:c,x:a.clientX,from:c.sized.getBoundingClientRect().width,slop:a.pointerType==="touch"?qg:Vg,moved:false};const l=a.currentTarget;l.dataset.dragging="",(u=l.setPointerCapture)==null||u.call(l,a.pointerId)},move(a){const c=n;if(!c)return;const l=a.clientX-c.x;!c.moved&&Math.abs(l)<c.slop||(c.moved=true,e().resize(c.from+(c.found.after?-l:l)))},up(a){const c=n;o=(c==null?void 0:c.moved)??false,r=c&&!c.moved&&a.type==="pointerup"?{x:a.clientX,y:a.clientY,reach:c.slop*Zg}:null,n=null,delete a.currentTarget.dataset.dragging},click(a){const c=o,l=r;o=false,r=null,!(a.defaultPrevented||c||ha(a))&&(e().step(),l&&i(l))},key(a){if(a.defaultPrevented)return;const c=e().limits();if(!c)return;const l=ev(a,c);l!==void 0&&(e().resize(l),a.preventDefault())},dispose(){s==null||s()}}}const bs=ue(null);function _s(t,e){typeof t=="function"?t(e):t&&(t.current=e)}const ov=ne(function({as:e="div",storageKey:n,className:o,style:r,children:s,...i},a){const c=$(null),l=$({}),[u,d]=z({});D(()=>d(Gg(n)),[n]);const h=dt((m,g)=>d(b=>{const v={...b};return g===void 0?delete v[m]:v[m]=Math.round(g),Xg(n,v),v}),[n]),p=vt(()=>({sizes:u,setSize:h,specs:l,element:c}),[u,h]);return f(bs.Provider,{value:p,children:f(e,{ref:m=>{c.current=m,_s(a,m)},className:["clover-split",o].filter(Boolean).join(" "),style:{display:"flex",...r},...i,children:s})})}),dl=ne(function({as:e="div",size:n,min:o,max:r,name:s,className:i,style:a,children:c,...l},u){const d=zt(bs),h=$(null),[p,m]=z(s??"");D(()=>{if(s)return m(s);const b=Yg(d==null?void 0:d.element.current);m(String(b.indexOf(h.current)))},[s,d]),d&&p&&(d.specs.current[p]={min:o,max:r,size:n});const g=d&&p?d.sizes[p]:void 0;return f(e,{ref:b=>{h.current=b,_s(u,b)},className:["clover-split-pane",i].filter(Boolean).join(" "),"data-split-key":p||void 0,"data-sized":n!==void 0?"":void 0,style:{minWidth:hr(o)??0,"--clover-split-size":g!==void 0?`${g}px`:hr(n),"--clover-split-max":hr(r),...a},...l,children:c})}),rv=ne(function({className:e,children:n,onPointerDown:o,onClick:r,onKeyDown:s,...i},a){const c=zt(bs),{t:l,langOf:u}=It(),d=$(null),[h,p]=z(),m=dt(()=>{const M=d.current,R=c==null?void 0:c.element.current;return!M||!R||!c?null:Qg(M,R,c.specs.current)},[c]),g=dt(M=>{const R=m();if(!R||!c)return;const N=Math.min(R.max,Math.max(R.min,M));c.setSize(R.key,N),p({now:N,min:R.min,max:R.max})},[m,c]),b=dt(()=>{const M=m();M&&p({now:M.sized.getBoundingClientRect().width,min:M.min,max:M.max})},[m]);D(()=>{const M=c==null?void 0:c.element.current;if(b(),!M||typeof ResizeObserver>"u")return;let R=0;const N=new ResizeObserver(()=>{cancelAnimationFrame(R),R=requestAnimationFrame(b)});return N.observe(M),()=>{cancelAnimationFrame(R),N.disconnect()}},[b,c,c==null?void 0:c.sizes]);const v=M=>{var R;return Math.round(M/(((R=c==null?void 0:c.element.current)==null?void 0:R.clientWidth)||1)*100)},w=()=>{var et,X;const M=m();if(!M||!c)return;const R=((et=c.element.current)==null?void 0:et.clientWidth)??0,N=ro((X=c.specs.current[M.key])==null?void 0:X.size,R),J=tv(M,N,c.sizes[M.key]);if(!J.own)return g(J.to);c.setSize(M.key,void 0),p({now:N,min:M.min,max:M.max})},_=$({limits:m,resize:g,step:w});_.current={limits:m,resize:g,step:w};const[x]=z(()=>nv(()=>d.current,()=>_.current));D(()=>()=>x.dispose(),[x]);const S=i["aria-label"]??l("splitHandle");return f("div",{ref:M=>{d.current=M,_s(a,M)},role:"separator","aria-orientation":"vertical","aria-label":S,...ut(i["aria-label"]===void 0?u("splitHandle"):void 0),"aria-valuenow":h?v(h.now):void 0,"aria-valuemin":h?v(h.min):void 0,"aria-valuemax":h?v(h.max):void 0,tabIndex:0,className:["clover-split-handle",e].filter(Boolean).join(" "),onPointerDown:M=>{o==null||o(M),x.down(M)},onPointerMove:M=>x.move(M),onPointerUp:M=>x.up(M),onPointerCancel:M=>x.up(M),onClick:M=>{r==null||r(M),x.click(M)},onKeyDown:M=>{s==null||s(M),x.key(M)},...i,children:[n,f(We,{label:S})]})});let fl;function sv(t){fl=t}function sy(){return fl}function iv({open:t,onOpenChange:e,controls:n}){const{t:o,langOf:r}=It(),s=fe().replace(/:/g,"");return f(Fe,{id:`panel-${s}`,label:o("informationPanelToggle"),lang:r("informationPanelToggle"),expanded:t,controls:n,onClick:()=>e(!t),children:f(Ct,{children:[f("rect",{x:"64",y:"96",width:"384",height:"320",rx:"40",fill:"none",strokeWidth:"36"}),f("path",{d:"M320 96v320",fill:"none",strokeWidth:"36"}),t&&f("path",{d:"M320 96h88a40 40 0 0 1 40 40v240a40 40 0 0 1-40 40h-88z"})]})})}let av,so;const hl=()=>av??(av=import("./dragToClose-B4rj1D3r.mjs").then(t=>so=t));function cv(){hl()}function lv(t,{enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i=false}){const a=$({enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i});a.current={enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i},D(()=>{const c=t.current;if(!c||(so==null||so.reset(c,a),!e))return;let l=true,u;return hl().then(d=>{l&&(u=d.attach(c,a))}),()=>{l=false,u==null||u()}},[t,e])}const uv=240,dv="16rem",fv="14rem",hv=31;function pv(t){const[e,n]=z(t),[o,r]=z(t);return D(()=>{if(t){n(true);const i=requestAnimationFrame(()=>requestAnimationFrame(()=>r(true)));return()=>cancelAnimationFrame(i)}r(false);const s=setTimeout(()=>n(false),uv);return()=>clearTimeout(s)},[t]),{mounted:e,open:t&&o}}function mv(t){const e=n=>t.querySelector(n);return e('[role="tab"][aria-selected="true"]')??e('.clover-sections-button[aria-expanded="true"]')??e(".clover-sections-button")}const gv=typeof window>"u"?D:Dt;function vv(t,e){const[n,o]=z();return gv(()=>{const r=t.current;if(!r)return;const s=()=>{const a=r.clientWidth;if(!a)return;const c=parseFloat(getComputedStyle(document.documentElement).fontSize);o(a>=e*(c||16))};if(s(),typeof ResizeObserver>"u")return;const i=new ResizeObserver(s);return i.observe(r),()=>i.disconnect()},[t,e]),n}const yv=typeof window>"u"?D:Dt;function bv({id:t,beside:e,defaultOpen:n,side:o,focus:r=mv,slides:s=true,alongside:i,followFocus:a}){var V,T;const c=$(null),l=$(null),u=e===false,[d,h]=z(n),[p,m]=z(false),g=u?p:d,b=()=>document.querySelector(`button[aria-controls~="${t}"]`),v=()=>a(b),w=()=>{var E,A;(E=c.current)!=null&&E.contains(document.activeElement)&&((A=b())==null||A.focus(),v())},_=$(0),x=E=>{_.current=u&&E?3:0,_.current||v(),u&&m(E),h(E)},S=()=>{w(),x(false)},M=$(e),R=$(false);if(M.current===true&&e===false){const E=document.activeElement;R.current=!!(E&&((V=c.current)!=null&&V.contains(E)||(T=b())!=null&&T.contains(E)))}yv(()=>{var E;R.current&&(R.current=false,(E=b())==null||E.focus(),v()),e===true&&m(false),M.current=e},[e]);const N=pv(s&&u&&g),J=s&&u,et=J?N.mounted:g,X=J?N.open:g;return D(()=>{if(!_.current||!c.current)return;_.current-=1;const E=r(c.current);E==null||E.focus({preventScroll:true}),E&&document.activeElement===E&&(_.current=0)}),lv(c,{enabled:u&&X,side:o,onClose:S,scrim:l,alongside:i,exits:!s}),{pane:c,over:u,open:g,shown:et,opened:X,setOpen:x,close:S,onKeyDown:E=>{u&&g&&E.key==="Escape"&&!E.defaultPrevented&&(E.preventDefault(),S())},scrim:u&&et&&{ref:l,"data-open":X,"aria-hidden":true,onMouseDown:E=>E.preventDefault(),onClick:S}}}const _v=typeof window>"u"?D:Dt;function wv(t,e,n){_v(()=>{const o=t.current,r=o==null?void 0:o.parentElement;if(!n||!o||!r)return;const s=()=>{const c=e();o.style.setProperty("--clover-template-spine-top",`${c?c.getBoundingClientRect().top-r.getBoundingClientRect().top:0}px`)};s();const i=new ResizeObserver(s);for(const c of Array.from(r.children))i.observe(c);const a=e();return a&&i.observe(a),()=>i.disconnect()},[t,n])}function xv({id:t,beside:e,defaultOpen:n,followFocus:o,body:r,sections:s,panel:i,load:a}){const c=bv({id:t,beside:e,defaultOpen:n,side:"end",followFocus:o}),l=!c.over&&c.open,u=$(null);wv(u,()=>r==null?void 0:r(),l&&!!r);const d=p=>{var m,g;(g=(m=p.target).closest)!=null&&g.call(m,`[aria-controls~="${t}"]`)&&(i||a==null||a(),c.over&&cv())},h=f(Sv,{sections:s,open:c.open,onOpenChange:p=>p&&!i&&a?a().then(()=>c.setOpen(true)):c.setOpen(p),controls:t});return{...c,id:t,docked:l,spine:u,toggle:h,Part:i,splitProps:{"data-panel":c.over?"over":"beside",onKeyDown:c.onKeyDown,onPointerOver:d,onFocus:d}}}function Sv({sections:t,...e}){return ys(t).length?f(iv,{...e}):null}function kv({pane:t,className:e,...n}){const{id:o,over:r,docked:s,Part:i}=t,a=ys(n.sections);return a.length?f(Ct,{children:[s&&f(rv,{className:"clover-template-panel-handle","aria-controls":o}),s&&f("div",{ref:t.spine,className:"clover-template-spine",children:t.toggle}),f(dl,{ref:t.pane,id:o,"data-spine":r||void 0,name:"panel","data-about":a.includes("about")||void 0,className:["clover-template-panel clover-template-drawer",e].filter(Boolean).join(" "),size:"24rem",min:r?void 0:fv,"data-open":t.opened,hidden:!t.shown,children:i&&f(i,{...n,onClose:r?t.close:void 0,closeOnEscape:r})}),t.scrim&&f("div",{className:"clover-template-scrim",...t.scrim})]}):null}const Cv=30;function Ev(){const t=$(0);return D(()=>()=>cancelAnimationFrame(t.current),[]),e=>{cancelAnimationFrame(t.current);let n=0;const o=()=>{const r=e();r&&Mv()?r.focus():++n<Cv&&(t.current=requestAnimationFrame(o))};t.current=requestAnimationFrame(o)}}function Mv(){const t=document.activeElement;return!t||t===document.body||!t.isConnected||t.closest("[hidden], [inert]")!==null}function Tv({className:t,header:e=true,headingLevel:n=2,panel:o=true,defaultPanelOpen:r,panelLayout:s="accordion",panelSections:i,panelLabels:a,download:c=true,languages:l=true,items:u="slider",singleItem:d=false,storageKey:h="clover-template-default",fill:p=false,collapseControls:m,canvasOptions:g,...b}){const v=$(null),w=fe().replace(/:/g,""),_=`${w}-panel`,x=qc(n,`${w}-title`),S=xv({id:_,beside:vv(v,hv),defaultOpen:r??true,followFocus:Ev(),sections:i,body:()=>{var N;return(N=v.current)==null?void 0:N.querySelector(".clover-template-default-body")},panel:Wg}),M=S.over,R=o&&S.docked;return f(Zd,{className:["clover-template-default",t].filter(Boolean).join(" "),"data-fill":p||void 0,...e?x.group:null,...b,children:f(ov,{ref:v,className:"clover-template-default-panes clover-template-panes",storageKey:h||void 0,...o?S.splitProps:{"data-panel":"beside"},children:[f(dl,{className:"clover-template-default-main",min:M?void 0:dv,children:[e&&f("header",{className:"clover-template-default-header",children:[f(Iv,{title:x}),f(vo,{of:"targets",layout:"pager",size:"small",className:"clover-template-default-pager"}),f(nl,{className:"clover-template-default-provider",children:f(ol,{})})]}),f(Vm,{loading:false}),f(lm,{className:"clover-template-default-body",collapseControls:m,options:g,children:o&&!R&&S.toggle}),f("div",{className:"clover-template-default-rail",children:[f("div",{className:"clover-template-default-rail-header",children:[f(Av,{}),f(jm,{})]}),u&&f(vo,{layout:u,singleItem:d})]})]}),o&&f(kv,{pane:S,className:"clover-template-default-panel",layout:s,sections:i,labels:a,download:c,languages:l,headingLevel:e?Lv(n):n})]})})}function Iv({title:t}){const e=it(o=>{var r;return o.throughCollection?(r=o.collection)==null?void 0:r.label:void 0}),n=Kh();return Pv(n==null?void 0:n.entries[0]),f(Ct,{children:[f(en,{as:t.as,className:"clover-template-default-title clover-template-title clover-title",...t.title}),e&&f("div",{className:"clover-template-default-collection-row",children:[f(en,{as:"p",label:e,className:"clover-template-default-collection"}),f(vo,{of:"members",layout:"pager",size:"small",className:"clover-template-default-pager"})]}),n&&f("div",{className:"clover-template-default-collection-row",children:[n.label&&f(en,{as:"p",label:n.label,className:"clover-template-default-collection"}),f(vo,{of:"annotations",layout:"pager",size:"small",className:"clover-template-default-pager"})]})]})}function Pv(t){const{clover:e}=de(),n=it(r=>{var s;return(s=r.manifest)==null?void 0:s.id}),o=$(null);D(()=>{if(!t||!n||o.current===n)return;o.current=n;const{annotationId:r,canvasId:s}=e.store.get();!r&&s===t.canvasId&&e.selectAnnotation(t.id)},[e,t,n])}const Lv=t=>t+1;function Av(){const t=fs();return f("p",{className:"clover-template-default-titles",children:t.map((e,n)=>f(ae.Fragment,{children:[n>0&&f("span",{className:"clover-template-default-titles-dot","aria-hidden":"true",children:"\xB7"}),f(en,{label:e.label})]},e.id))})}const Ov=()=>import("./renderers-C5EfPrd7.mjs"),Nv=mt(()=>import("./Document-r3Sz3RfH.mjs").then(t=>({default:t.Document}))),Rv=mt(()=>import("./Gallery-nX9kQlft.mjs").then(t=>({default:t.Gallery}))),pa={default:Tv,document:Nv,gallery:Rv},Bv={header:["default"],panel:["default","gallery"],items:["default","gallery"],singleItem:["default","document"],fill:["default"],defaultPanelOpen:["default","document","gallery"],panelLayout:["default","document","gallery"],panelSections:["default","document","gallery"],panelLabels:["default","document","gallery"],download:["default","document","gallery"],languages:["default","document","gallery"],storageKey:["default","document","gallery"],defaultSidebarOpen:["document"],size:["gallery"],height:["gallery"],gap:["gallery"],secondary:["gallery"],summary:["gallery"],lightboxItems:["gallery"]};function $v({props:t}){const e=typeof t.template=="string"&&t.template in pa?t.template:"default",n=Object.fromEntries(Object.entries(t).filter(([i])=>{var a;return i!=="template"&&(((a=Bv[i])==null?void 0:a.includes(e))??true)})),o=Je(Ov,!!t.renderers),r=vt(()=>o==null?void 0:o.toRenderers(t.renderers),[o,t.renderers]);if(t.renderers&&!o)return null;n.renderers=r,typeof n.storageKey=="string"&&(n.storageKey=n.storageKey.trim().toLowerCase()==="false"?false:n.storageKey);const s=pa[e];return f(_t,{fallback:null,children:f(s,{...n,iiifContent:t.iiifContent})})}const Fv=""+new URL("../assets/maplibre-gl-worker-kTz9OPxr.js",import.meta.url).href,Dv={mapWorkerUrl:Fv},zv={tag:"clover-viewer",kind:"alone",attributes:{template:{prop:"template",type:["default","document","gallery"]},"iiif-content":{prop:"iiifContent",type:"string"},"canvas-id":{prop:"defaultCanvasId",type:"string"},"manifest-id":{prop:"defaultManifestId",type:"string"},language:{prop:"language",type:"string"},"high-contrast":{prop:"highContrast",type:"boolean"},"search-query":{prop:"searchQuery",type:"string"},annotations:{prop:"annotations",type:"data"},"heading-level":{prop:"headingLevel",type:"number",min:2},items:{prop:"items",type:["slider","list","grid","masonry","false"]},"single-item":{prop:"singleItem",type:"boolean"},header:{prop:"header",type:"boolean"},panel:{prop:"panel",type:"boolean"},download:{prop:"download",type:"boolean"},languages:{prop:"languages",type:"boolean"},"panel-open":{prop:"defaultPanelOpen",type:"boolean"},"panel-layout":{prop:"panelLayout",type:["accordion","tabs"]},"panel-sections":{prop:"panelSections",type:"data"},"panel-labels":{prop:"panelLabels",type:"data"},"sidebar-open":{prop:"defaultSidebarOpen",type:"boolean"},"storage-key":{prop:"storageKey",type:"string"},fill:{prop:"fill",type:"boolean"},"collapse-controls":{prop:"collapseControls",type:["auto","always"]},size:{prop:"size",type:"string"},height:{prop:"height",type:"string"},gap:{prop:"gap",type:"string"},secondary:{prop:"secondary",type:["summary","navDate","none"]},summary:{prop:"summary",type:"boolean"},"lightbox-items":{prop:"lightboxItems",type:["slider","pager"]}},properties:["iiifContent","annotations","request","renderers","canvasOptions"],events:{"clover-canvas-change":{prop:"onCanvasChange",detail:["canvasId"]},"clover-manifest-change":{prop:"onManifestChange",detail:["manifestId"]},"clover-status-change":{prop:"onStatusChange",detail:["status","error"]},"clover-content-state-change":{prop:"onContentStateChange",detail:"first"}}};sv(Dv.mapWorkerUrl);ql(zv,()=>Promise.resolve($v));export{lu as $,$ as A,lm as B,te as C,dl as D,vo as E,rv as F,dv as G,kv as H,of as I,cv as J,it as K,en as L,ou as M,Kh as N,Qv as O,jm as P,jh as Q,Zd as R,Vm as S,vt as T,_t as U,mt as V,la as W,ue as X,zt as Y,Ld as Z,Dt as _,de as a,ff as a$,ny as a0,Xr as a1,Gc as a2,Xc as a3,En as a4,Yc as a5,nd as a6,bt as a7,vs as a8,ut as a9,ch as aA,dc as aB,ic as aC,ih as aD,ah as aE,kf as aF,Ec as aG,Sd as aH,is as aI,Xh as aJ,Ui as aK,cf as aL,mc as aM,Gt as aN,pf as aO,sh as aP,xf as aQ,Fe as aR,Yd as aS,uh as aT,Sn as aU,lf as aV,nf as aW,uf as aX,df as aY,yc as aZ,hf as a_,Lt as aa,nc as ab,bd as ac,He as ad,It as ae,Eo as af,Mt as ag,Um as ah,ne as ai,Wm as aj,wo as ak,qr as al,Kr as am,Pn as an,up as ao,Gi as ap,Zi as aq,Rc as ar,fs as as,Zh as at,Xi as au,Yr as av,xo as aw,H as ax,ae as ay,wf as az,Eu as b,hd as b$,ed as b0,tg as b1,eg as b2,Hh as b3,ye as b4,Pg as b5,Jv as b6,Gv as b7,Uv as b8,Ya as b9,Ja as bA,an as bB,Jr as bC,ps as bD,xd as bE,Xv as bF,jf as bG,Pe as bH,sr as bI,ns as bJ,Xu as bK,rh as bL,xv as bM,Rn as bN,fm as bO,hm as bP,Zr as bQ,lp as bR,Ln as bS,sy as bT,Wc as bU,Jt as bV,id as bW,Hf as bX,Jc as bY,rf as bZ,Nd as b_,ry as ba,De as bb,Sc as bc,eh as bd,rl as be,qa as bf,oy as bg,vd as bh,ts as bi,jv as bj,Qo as bk,ls as bl,dg as bm,_o as bn,Je as bo,Dh as bp,tc as bq,Co as br,un as bs,cc as bt,uv as bu,il as bv,Ti as bw,ud as bx,Pc as by,Wf as bz,Ac as c,Ga as c0,op as c1,ld as c2,cn as c3,An as c4,Ir as c5,Gf as c6,hc as c7,Vv as c8,qv as c9,Kv as ca,rp as cb,Gp as cc,Vi as cd,Yh as ce,Jh as cf,Yv as cg,le as ch,ee as ci,eo as cj,Gm as ck,Qc as cl,Zv as cm,Wg as cn,cs as co,pm as cp,Dl as cq,vm as cr,qh as d,z as e,fe as f,ty as g,ey as h,Ev as i,bv as j,Ct as k,vv as l,hv as m,mu as n,We as o,nl as p,dt as q,ms as r,gm as s,qc as t,f as u,sn as v,ol as w,ie as x,D as y,ov as z};
|
|
27
|
+
`).trim()}const Io=(t,e)=>e==="canvas"?He(t.manifest,t.canvasId):t.manifest,zc=ue(null),hs=()=>zt(zc),en=oe(function({of:e="manifest",label:n,as:o="span",className:r,...s},i){var h;const a=Ln(p=>{var m,g;return e==="canvas"?(m=He(p.manifest,p.canvasId))==null?void 0:m.label:(g=p.manifest)==null?void 0:g.label},void 0),c=hs(),l=(h=Pe())==null?void 0:h.language,{text:u,lang:d}=bt(n??(c?c.label:a),l);return u?f(o,{ref:i,className:Mt("clover-label",r),...ut(d),...s,children:Rn(u)}):null});function pm(t,e,n){const o=(u,d)=>Math.min(Math.max(Math.round(u),0),d),r=n?o(n.x*t.width,t.width-1):0,s=n?o(n.y*t.height,t.height-1):0,i={x:r,y:s,width:n?Math.max(1,o(n.width*t.width,t.width-r)):t.width,height:n?Math.max(1,o(n.height*t.height,t.height-s)):t.height},a=i.width===t.width&&i.height===t.height;if(!a&&!t.regionByPx)return null;if(t.sizeByW){let u=Math.min(1,e/Math.max(i.width,i.height));return t.maxWidth&&(u=Math.min(u,t.maxWidth/i.width)),t.maxHeight&&(u=Math.min(u,t.maxHeight/i.height)),t.maxArea&&(u=Math.min(u,Math.sqrt(t.maxArea/(i.width*i.height)))),uo(t,i,Math.max(1,Math.floor(i.width*u)),Math.max(1,Math.floor(i.height*u)))}if(!a)return null;const c=[...t.sizes].sort((u,d)=>u.width-d.width),l=c.find(u=>Math.max(u.width,u.height)>=e)??c.at(-1)??{width:t.width,height:t.height};return uo(t,i,l.width,l.height)}function nn(t){var e;return(e=rs(t).find(({body:n})=>n.type==="Image"||n.id&&!n.type))==null?void 0:e.body}function mm(t,{width:e,height:n}){if(t==="full")return{x:0,y:0,width:1,height:1};const o=/^(pct:)?([\d.]+),([\d.]+),([\d.]+),([\d.]+)$/.exec(t);if(!o)return null;const[r,s,i,a]=o.slice(2).map(Number),[c,l]=o[1]?[100,100]:[e,n];return{x:r/c,y:s/l,width:i/c,height:a/l}}function ye(t,e="full",n=false){if(!t)return null;const o=Co(t.service);if(o){if(e!=="full")return{service:o,region:e,fallback:t.id};const{width:r,height:s}=t;return n&&t.id&&r>0&&s>0?{service:o,fallback:t.id,fallbackSize:{width:r,height:s}}:{service:o,fallback:t.id}}return t.id?{src:t.id}:null}function ps(t){const e=t;return e?ye(H(e.thumbnail)[0],"full",true)??ye(nn(e))??ye(nn(e.placeholderContainer))??ye(nn(e.accompanyingContainer)):null}function gm(t){const e=t;return e?ye(nn(e))??ye(nn(e.placeholderContainer))??ye(nn(e.accompanyingContainer))??ye(H(e.thumbnail)[0],"full",true):null}async function ms(t,e=200,n){if(t.src)return t.src;if(!t.service)return t.fallback;const o=t.fallbackSize;if(o&&t.fallback&&t.region===void 0){const r=Math.max(o.width,o.height);if(r>=e&&r<=e*2)return t.fallback}try{const r=await cs(t.service,{request:n}),s=typeof t.region=="string"?mm(t.region,r):t.region;return s===null?t.fallback:pm(r,e,s)??t.fallback}catch{return t.fallback}}const vm=Object.freeze(Object.defineProperty({__proto__:null,imageSource:ye,resolveThumbnail:ms,stillSource:gm,thumbnailSource:ps},Symbol.toStringTag,{value:"Module"})),ia='.clover-items-item[role="option"], .clover-items-link',Qe=new Map;let Rt=null,Jt=null,Rr=0;function gs(t){const e=Qe.get(t);if(!e)return;const n=t.clientHeight>0&&t.scrollHeight>t.clientHeight+1;n!==e.cut&&(e.cut=n,e.change(n))}function Br(){cancelAnimationFrame(Rr),Rr=requestAnimationFrame(()=>Qe.forEach((t,e)=>gs(e)))}function Hc(t){var r,s;if(t.key!=="Escape")return;const e=new Set,n=(s=(r=document.activeElement)==null?void 0:r.closest)==null?void 0:s.call(r,ia);n&&e.add(n);try{document.querySelectorAll(`:is(${ia}):hover`).forEach(i=>e.add(i))}catch{}const o=[...e].filter(i=>i.dataset.fullHidden===void 0&&i.querySelector(".clover-items-label-full"));o.length&&(t.preventDefault(),t.stopPropagation(),o.forEach(i=>pc(i,"fullHidden",["pointerenter",i===n?"blur":"focus"])))}function ym(){var t,e;Rt=typeof ResizeObserver>"u"?null:new ResizeObserver(n=>n.forEach(o=>gs(o.target))),Jt=typeof MutationObserver>"u"?null:new MutationObserver(Br),Jt==null||Jt.observe(document.head,{childList:true,subtree:true,characterData:true}),Jt==null||Jt.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),(e=(t=document.fonts)==null?void 0:t.addEventListener)==null||e.call(t,"loadingdone",Br),document.addEventListener("keydown",Hc,true)}function bm(){var t,e,n;cancelAnimationFrame(Rr),(t=Rt==null?void 0:Rt.disconnect)==null||t.call(Rt),Jt==null||Jt.disconnect(),Rt=Jt=null,(n=(e=document.fonts)==null?void 0:e.removeEventListener)==null||n.call(e,"loadingdone",Br),document.removeEventListener("keydown",Hc,true)}function _m(t,e){var n;return Qe.size||ym(),Qe.set(t,{change:e}),(n=Rt==null?void 0:Rt.observe)==null||n.call(Rt,t),gs(t),()=>{var o;Qe.delete(t),(o=Rt==null?void 0:Rt.unobserve)==null||o.call(Rt,t),Qe.size||bm()}}const wm=/^(-?\d{4,})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?)?/;function Wc(t,e){if(typeof t!="string")return null;const n=wm.exec(t.trim());if(!n)return null;const[o,r,s,i=0,a=0,c=0]=n.slice(1,7).map(d=>d===void 0?void 0:Number(d)),l=new Date(Date.UTC(2e3,r-1,s,i,a,c));if(l.setUTCFullYear(o),l.getUTCMonth()!==r-1||l.getUTCDate()!==s)return null;const u=!i&&!a&&!c&&!Number(n[7]??0);return{at:l,precision:e??(u?s!==1?"day":r!==1?"month":"year":"time")}}const xm=mt(()=>import("./NavDate-B6rCV-Cd.mjs").then(t=>t.a).then(({NavDate:t})=>({default:t})));function Sm(t,e,n,o){const r=t.source!==void 0?t.source:ps(t.resource),[s,i]=z(r==null?void 0:r.src),a=(r==null?void 0:r.src)??(r==null?void 0:r.service)??(r==null?void 0:r.fallback);return D(()=>{if(!r)return i(void 0);if(r.src)return i(r.src);if(!o)return;let c=true;return ms(r,e,n).then(l=>{c&&i(l)}),()=>{c=false}},[a,e,o]),{src:s,none:!r}}const km=()=>f("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",children:[f("path",{d:"M232 416a24 24 0 01-14.9-5.2L125.8 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.8l91.3-74.8A24 24 0 01256 120v272a24 24 0 01-24 24z"}),f("path",{d:"M336 176a112 112 0 010 160M384 128a176 176 0 010 256",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"32"})]});function Cm({part:t,size:e,request:n,alt:o,altLang:r}){const[s,i]=z(null),a=Ec(s,Cc,s==null?void 0:s.closest('[data-layout="slider"] .clover-items-viewport')),{src:c,none:l}=Sm(t,e,n,a),[u,d]=z(false),{width:h,height:p}=t.resource??{},m=h&&p?h/p:1;return f("span",{ref:i,className:"clover-items-picture","data-loaded":u,"data-empty":c?void 0:true,style:c&&!(h&&p)?void 0:{"--clover-items-ratio":m},children:[!c&&l&&An(t.media)&&f(km,{}),c&&f("img",{src:c,alt:o,...ut(o?r:void 0),width:e,height:Math.round(e/m),loading:"lazy",decoding:"async",draggable:false,onLoad:()=>d(true),onError:()=>d(true)}),t.duration?f("span",{className:"clover-items-duration",children:Hf(t.duration)}):null]})}function Em({text:t,lang:e,first:n}){const o=$(null),[r,s]=z(false);return D(()=>{const i=o.current;if(!(!i||!t))return _m(i,s)},[t]),f("span",{className:"clover-items-label","data-clamped":r||void 0,children:[!n&&" ",f("span",{ref:o,className:"clover-items-label-text",...ut(t?e:void 0),children:t}),r&&f("span",{className:"clover-items-label-full",...ut(e),"aria-hidden":"true",hidden:true,children:t})]})}function Mm({item:t,size:e,language:n,request:o,showSummary:r=false,secondary:s="summary"}){var u,d;const i=t.parts.map(h=>bt(t.parts.length===1?t.label:h.label,n)),a=r&&s==="summary"?bt(t.summary,n):null,c=r&&s==="navDate"?Wc(t.navDate):null,l=i.some(h=>h.text);return f("figure",{role:"none",className:"clover-items-figure","data-parts":t.parts.length,"data-media":(d=(u=t.parts[0])==null?void 0:u.media)==null?void 0:d.toLowerCase(),style:{"--parts":t.parts.length},children:[f("span",{className:"clover-items-pictures",children:t.parts.map((h,p)=>{const m=i[p].text?{text:""}:bt(h.label,n);return f(Cm,{part:h,size:e,request:o,alt:m.text,altLang:m.lang},h.id)})}),(l||c||(a==null?void 0:a.text))&&f("figcaption",{className:"clover-items-caption",children:[i.map((h,p)=>f(Em,{text:h.text,lang:h.lang,first:p===0},t.parts[p].id)),c&&f(_t,{fallback:null,children:f(xm,{value:t.navDate,className:"clover-items-date"})}),(a==null?void 0:a.text)&&f("span",{className:"clover-items-summary",...ut(a.lang),children:a.text.replace(/<[^>]*>/g,"")})]})]})}function Tm(t){var e;return(e=rs(t).find(({body:n})=>n.type))==null?void 0:e.body.type}function Uc(t){const e=Tm(t)??(t.type==="Timeline"?"Sound":void 0);return{id:t.id,type:t.type,label:t.label,resource:t,duration:Number(t.duration)||void 0,media:e}}const aa=new WeakMap;function jc(t){if(!t)return[];let e=aa.get(t);if(!e){const{canvases:n,views:o}=At(t);e=o.map(r=>{const s=r.map(i=>Uc(n[i]));return{id:s[0].id,parts:s,label:s.length===1?s[0].label:{none:[s.map(i=>bt(i.label).text).filter(Boolean).join(" \u2013 ")]}}}),aa.set(t,e)}return e}const ca=new WeakMap;function go(t){if(!t)return[];let e=ca.get(t);return e||(e=H(t.items).filter(n=>n==null?void 0:n.id).map(n=>{var o;return{id:n.id,parts:[Uc(n)],label:n.label,summary:n.summary,...typeof n.navDate=="string"?{navDate:n.navDate}:{},href:((o=H(n.homepage)[0])==null?void 0:o.id)??n.id,...En(H(n.homepage)[0])?{hrefLang:En(H(n.homepage)[0])}:{}}}),ca.set(t,e)),e}function ny(t){return t?Array.isArray(t)?go({items:t}):t.type==="Collection"?go(t):jc(t):[]}function Vc(t){const e=Math.max(1,Math.round(t));return e<=6?`h${e}`:null}const vs=(t,e="p")=>Vc(t)??e;function qc(t,e,n="p"){const o=Vc(t);return o?{as:o,title:{},group:{}}:{as:n,title:{id:e},group:{role:"group","aria-labelledby":e}}}function Im(t,e,{orientation:n="both",rtl:o=false,onActivate:r,onMove:s}={}){const[i,a]=z(Math.max(0,e)),c=$([]),l=$(r);l.current=r;const u=$(s);u.current=s,D(()=>{e>=0&&a(e)},[e]);const d=Math.min(i,Math.max(0,t-1)),h=dt(g=>{var b;a(g),(b=c.current[g])==null||b.focus()},[]),p=dt((g,b)=>{var M,R;const v=o?"ArrowLeft":"ArrowRight",w=o?"ArrowRight":"ArrowLeft",_=n!=="vertical",x=n!=="horizontal";let S=null;if(_&&g.key===v||x&&g.key==="ArrowDown")S=Math.min(t-1,b+1);else if(_&&g.key===w||x&&g.key==="ArrowUp")S=Math.max(0,b-1);else if(g.key==="Home")S=0;else if(g.key==="End")S=t-1;else if(g.key==="Enter"||g.key===" "){(M=l.current)==null||M.call(l,b,g),g.preventDefault();return}S!==null&&(g.preventDefault(),h(S),S!==b&&((R=u.current)==null||R.call(u,S,g)))},[t,n,o,h]);return{focused:d,itemProps:g=>({ref:b=>{c.current[g]=b},tabIndex:g===d?0:-1,onKeyDown:b=>p(b,g),onFocus:()=>a(g)})}}const Pm=5,Lm=()=>{var t;return typeof window<"u"&&!!((t=window.matchMedia)!=null&&t.call(window,"(prefers-reduced-motion: reduce)").matches)};function Kc({align:t="start",dragFree:e=false,itemCount:n=0}={}){const[o,r]=z(null),[s,i]=z(false),[a,c]=z(false),l=$(t);l.current=t;const u=e?"none":"x mandatory",d=dt(()=>{if(!o)return;const v=Math.abs(o.scrollLeft),w=o.scrollWidth-o.clientWidth;i(v>1),c(v<w-1)},[o]);D(()=>{if(!o)return;const v=o.style;v.overflowX="auto",v.overflowY="hidden",v.scrollSnapType=u,v.setProperty("--clover-track-align",t),v.overscrollBehaviorX="contain"},[o,u,t]),D(()=>{if(!o)return;let v=0;const w=()=>{cancelAnimationFrame(v),v=requestAnimationFrame(d)};d(),o.addEventListener("scroll",w,{passive:true});const _=typeof ResizeObserver<"u"?new ResizeObserver(w):null;return _==null||_.observe(o),o.firstElementChild&&(_==null||_.observe(o.firstElementChild)),()=>{cancelAnimationFrame(v),o.removeEventListener("scroll",w),_==null||_.disconnect()}},[o,d,n]);const h=dt((v,w=false)=>{if(!o||!v)return;const _=w||Lm()?"auto":"smooth";o.scrollBy({left:v,behavior:_})},[o]),p=dt((v,{instant:w=false}={})=>{const _=o==null?void 0:o.querySelector(`[data-track-index="${v}"]`);if(!o||!_)return false;const x=o.getBoundingClientRect(),S=_.getBoundingClientRect(),M=getComputedStyle(o).direction==="rtl";return h(l.current==="center"?S.left+S.width/2-(x.left+x.width/2):M?S.right-x.right:S.left-x.left,w),true},[o,h]),m=dt(v=>{if(!o)return;const w=getComputedStyle(o).direction==="rtl";h(v*o.clientWidth*.9*(w?-1:1))},[o,h]),g=dt(()=>m(1),[m]),b=dt(()=>m(-1),[m]);return D(()=>{if(!o)return;let v=null,w=false;const _=R=>{R.pointerType!=="mouse"||R.button!==0||(v={x:R.clientX,scroll:o.scrollLeft},w=false)},x=R=>{var J;if(!v)return;const N=R.clientX-v.x;!w&&Math.abs(N)<Pm||(w||(w=true,(J=o.setPointerCapture)==null||J.call(o,R.pointerId),o.style.scrollSnapType="none",o.dataset.dragging="true"),o.scrollLeft=v.scroll-N)},S=R=>{var N;v&&(v=null,w&&((N=o.releasePointerCapture)==null||N.call(o,R.pointerId),delete o.dataset.dragging,o.style.scrollSnapType=u))},M=R=>{w&&(w=false,R.preventDefault(),R.stopPropagation())};return o.addEventListener("pointerdown",_),o.addEventListener("pointermove",x),o.addEventListener("pointerup",S),o.addEventListener("pointercancel",S),o.addEventListener("click",M,true),()=>{o.removeEventListener("pointerdown",_),o.removeEventListener("pointermove",x),o.removeEventListener("pointerup",S),o.removeEventListener("pointercancel",S),o.removeEventListener("click",M,true)}},[o,u]),{ref:r,canScrollPrev:s,canScrollNext:a,scrollPrev:b,scrollNext:g,scrollToIndex:p,measure:d}}const vo=oe(function(e,n){return!Pe()||e.iiifContent!==void 0||e.items!==void 0?f(_t,{fallback:null,children:f(Am,{...e,forwardedRef:n})}):f(Om,{...e,forwardedRef:n})}),Am=mt(()=>import("./StandaloneItems-CQrzTSPC.mjs"));function Om({of:t="views",...e}){return t==="targets"?f(Rm,{...e}):t==="annotations"?f($m,{...e}):t==="members"?f(Zc,{...e}):f(Fm,{...e})}const Nm=mt(()=>import("./TargetItems-BpmZEVMS.mjs"));function Rm(t){return it(n=>{var o;return(((o=n.targets)==null?void 0:o.items.length)??0)>1})?f(_t,{fallback:null,children:f(Nm,{...t})}):null}const Bm=mt(()=>import("./AnnotationItems-B5Vs0dYi.mjs"));function $m(t){return it(n=>!!nc(n.manifest,n.addedSets))?f(_t,{fallback:null,children:f(Bm,{...t})}):null}function Zc({onSelect:t,forwardedRef:e,...n}){const{clover:o,language:r}=Pe(),s=it(u=>u.collection),i=it(u=>{var d;return((d=u.manifest)==null?void 0:d.id)??null}),a=go(s),c=Xr(s==null?void 0:s.viewingDirection);if(!a.length)return null;const l=(u,d)=>{t==null||t(u,d),o.goToManifest(u.id)};if(n.layout==="pager"){const u=a.findIndex(d=>d.id===i);return f(Xc,{...n,forwardedRef:e,steps:Gc(a,u,c,l),nameKey:"informationPanelTabsCollection",position:f(zm,{position:u,total:a.length,list:d=>f(Zc,{layout:"list",forwardedRef:null,onSelect:d})})})}return f(Yc,{...n,forwardedRef:e,items:a,selected:a.findIndex(u=>u.id===i),navigation:"id",rtl:c==="right-to-left",language:r,request:o.request,showSummary:true,onActivate:l})}function Fm({onSelect:t,forwardedRef:e,singleItem:n=false,...o}){const{clover:r,language:s}=Pe(),i=it(d=>d.manifest),a=it(d=>On(d.manifest,d.canvasId)),c=it(d=>At(d.manifest).direction),l=jc(i);if(l.length<(n?1:2))return null;const u=d=>r.goTo(d.id);return o.layout==="pager"?f(Xc,{...o,forwardedRef:e,steps:Gc(l,a,c,u)}):f(Yc,{...o,forwardedRef:e,items:l,selected:a,navigation:"id",rtl:c==="right-to-left",language:s,request:r.request,onActivate:(d,h)=>{t==null||t(d,h),r.goTo(d.id)},followFocus:u})}function Gc(t,e,n,o){return{position:e,total:t.length,direction:n,step:(r,s)=>{const i=t[e+r];i&&o(i,s)}}}const Dm=mt(()=>import("./PagerLayout-LZmC6VpV.mjs")),zm=mt(()=>import("./PagerLayout-LZmC6VpV.mjs").then(({CountMenu:t})=>({default:t})));function Xc(t){return f(_t,{fallback:null,children:f(Dm,{...t})})}function Yc({forwardedRef:t,items:e,selected:n,navigation:o,rtl:r=false,layout:s="slider",thumbnailSize:i=200,request:a,language:c,showSummary:l=false,secondary:u="summary",heading:d,headingLevel:h=2,renderItem:p,onActivate:m,followFocus:g,as:b="section",className:v,"aria-label":w,size:_,singleItem:x,highContrast:S,...M}){var Nt;const{t:R}=Pt(),N=fe(),J=wo(t,M.lang),{langOf:et}=J,X=qr(S),V=s==="slider",T=o==="id",E=$(null),A=s==="masonry";D(()=>{const q=E.current;if(!A||!q)return;let rt,Q=true;return import("../masonry-BZCdA3bV.mjs").then(({attachMasonry:wt})=>{Q&&(rt=wt(q))}),()=>{Q=false,rt==null||rt()}},[A]);const W=Kc({align:T?"center":"start",itemCount:e.length}),G=$(void 0);D(()=>()=>window.clearTimeout(G.current),[]);const Y=Im(e.length,n,{orientation:s==="slider"?"horizontal":s==="list"?"vertical":"both",rtl:r,onActivate:(q,rt)=>m(e[q],rt),onMove:g?(q,rt)=>{window.clearTimeout(G.current);const Q=()=>g(e[q]);rt.repeat?G.current=window.setTimeout(Q,150):Q()}:void 0}),st=$(null),St=$(false);St.current=!!((Nt=st.current)!=null&&Nt.contains(st.current.ownerDocument.activeElement)),D(()=>{var wt;const q=st.current;if(!q||!St.current)return;const{activeElement:rt,body:Q}=q.ownerDocument;rt&&rt!==Q||(wt=q.querySelector(`[data-track-index="${Math.max(0,n)}"]`))==null||wt.focus()},[e]);const ot=$(false);D(()=>{var Q;if(n<0)return;const q=!ot.current;if(V){W.scrollToIndex(n,{instant:q})&&(ot.current=true);return}ot.current=true;const rt=(Q=st.current)==null?void 0:Q.querySelector(`[data-track-index="${n}"]`);rt&&Hm(rt,q)},[V,n,W.scrollToIndex]);const ct=vs(h),y=d?bt(d.label,c):null,C=d?bt(d.summary,c):null,L=w===void 0&&!!(y!=null&&y.text),F=Eo(R("itemsLabel"),et("itemsLabel"),w!==void 0||L,J.hostLanguage),O=L?{"aria-labelledby":`${N}-title`}:w!==void 0?{"aria-label":w}:F.props,P=(q,rt)=>p?p(q,{selected:rt}):f(Mm,{item:q,size:i,language:c,request:a,showSummary:l,secondary:u}),U=q=>!(p||bt(q.label,c).text||l&&u==="summary"&&bt(q.summary,c).text),K=(q,rt)=>U(q)?R("canvasPosition",{index:rt+1,total:e.length}):void 0,yt=q=>U(q)?et("canvasPosition"):void 0,tt=V?{display:"flex",margin:0,padding:0,listStyle:"none"}:void 0,pt=V?{flex:"0 0 auto",scrollSnapAlign:T?"center":"start"}:void 0,ft=T&&n>=0,Ht=q=>{const rt=n+(q==="prev"?-1:1),Q=ft?rt>=0&&rt<e.length:q==="prev"?W.canScrollPrev:W.canScrollNext,wt=ft?q==="prev"?"commonPrevious":"commonNext":q==="prev"?"itemsScrollBack":"itemsScrollForward",Bt=R(wt),re=we=>{if(!Q)return;if(!ft)return(q==="prev"?W.scrollPrev:W.scrollNext)();const B=e[rt];g?g(B):m(B,we)};return f("button",{type:"button",className:`clover-items-scroll-${q}`,"aria-controls":ft?void 0:`${N}-viewport`,...ut(et(wt)),"aria-disabled":!Q||void 0,tabIndex:Q?void 0:-1,onClick:re,children:[f("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:f("path",{d:q==="next"!==r?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),f("span",{style:sn,children:Bt}),f(We,{label:Bt})]})};return f(Pn.Provider,{value:J.hostLanguage,children:f(b,{ref:J.ref,className:Mt("clover-items",v),"data-layout":s,"data-navigation":o,...Kr(X),...M,children:[d&&((y==null?void 0:y.text)||(C==null?void 0:C.text))&&f("header",{className:"clover-items-header",children:[(y==null?void 0:y.text)&&f(ct,{className:"clover-items-title clover-title",id:`${N}-title`,...ut(y.lang),children:y.text}),(C==null?void 0:C.text)&&f("p",{className:"clover-items-description",...ut(C.lang),children:C.text.replace(/<[^>]*>/g,"")}),d.homepage&&f("a",{className:"clover-items-homepage",href:d.homepage,hrefLang:d.homepageLang,...ut(et("commonViewAll")),children:R("commonViewAll")})]}),f("div",{className:"clover-items-frame",style:{position:"relative"},dir:r?"rtl":void 0,children:[V&&Ht("prev"),f("div",{id:`${N}-viewport`,className:"clover-items-viewport",ref:V?W.ref:E,children:T?f("div",{ref:st,role:"listbox",...O,"aria-orientation":V?"horizontal":"vertical",className:"clover-items-track",style:tt,children:e.map((q,rt)=>{const Q=rt===n;return f("div",{id:`${N}-${rt}`,role:"option","aria-selected":Q,"aria-label":K(q,rt),...ut(yt(q)),className:"clover-items-item","data-track-index":rt,style:pt,...Y.itemProps(rt),onClick:wt=>m(q,wt),children:P(q,Q)},q.id)})}):f("ul",{...O,className:"clover-items-track",style:tt,children:e.map((q,rt)=>f("li",{className:"clover-items-item","data-track-index":rt,style:pt,children:f("a",{className:"clover-items-link",href:q.href,hrefLang:q.hrefLang,"aria-label":K(q,rt),...ut(yt(q)),draggable:false,onClick:Q=>m(q,Q),children:P(q,false)})},q.id))})}),V&&Ht("next")]}),F.node]})})}function Hm(t,e){var i;let n=t.parentElement;for(;n&&n!==document.body;){const{overflowY:a}=getComputedStyle(n);if(/(auto|scroll)/.test(a)&&n.scrollHeight>n.clientHeight)break;n=n.parentElement}if(!n||n===document.body)return;const o=n.getBoundingClientRect(),r=t.getBoundingClientRect(),s=r.top<o.top?r.top-o.top:r.bottom>o.bottom?r.bottom-o.bottom:0;s&&((i=n.scrollBy)==null||i.call(n,{top:s,behavior:e?"auto":"smooth"}))}function Wm(t,e){const{clover:n}=de(e),o=qh(),{direction:r}=Ac(),s=it(l=>l.collection),i=it(l=>{var u;return((u=l.manifest)==null?void 0:u.id)??null}),a=it(l=>{var u;return((u=l.targets)==null?void 0:u.items.length)??0}),c=it(l=>nd(l.targets,l.targetIndex,l.manifest,l.canvasId));if(t==="targets")return{position:c,total:a,direction:"left-to-right",step:l=>{const u=c+l;u>=0&&u<a&&n.goToTarget(u)}};if(t==="members"){const l=go(s),u=l.findIndex(d=>d.id===i);return{position:u,total:l.length,direction:"left-to-right",step:d=>{const h=l[u+d];h&&n.goToManifest(h.id)}}}return{position:o.position,total:o.total,direction:r,step:l=>l<0?o.previous():o.next()}}const Um=oe(function({steps:e,as:n="span",className:o,...r},s){const{t:i,langOf:a}=Pt(),{position:c,total:l}=e;if(l<2||c<0)return null;const u=c+1;return f(n,{ref:s,className:Mt("clover-pager-position",o),...r,children:[f("span",{"aria-hidden":"true",children:[u," / ",l]}),f("span",{className:"clover-pager-room","aria-hidden":"true",hidden:true,children:[l," / ",l]}),f("span",{style:sn,...ut(a("canvasPosition")),children:i("canvasPosition",{index:u,total:l})})]})}),jm=oe(function({of:e="views",...n},o){const r=Wm(e,"Position");return f(Um,{ref:o,...n,steps:r})});function Vm({className:t,loading:e,error:n}){const{t:o,langOf:r}=Pt(),{status:s,error:i}=Uh(),a=s==="loading",c=e!==void 0&&e!==false;return f(Ct,{children:[f("p",{className:Mt("clover-status",t),"data-status":a?s:void 0,role:"status",style:a&&e!==false?void 0:sn,children:[a&&(c?e:e===void 0&&f(Sn,{})),a&&!c&&f("span",{style:sn,...ut(r("statusLoading")),children:o("statusLoading")})]}),s==="error"&&i&&f("div",{className:Mt("clover-status",t),"data-status":s,role:"alert",children:n?n(i):f(Ct,{children:[f("p",{...ut(r("statusError")),children:o("statusError")}),f("p",{className:"clover-status-detail",lang:"en",children:i.message})]})})]})}function qm(t,e=false,n=3){const o=e||dm(t),r=e?`${n}
|
|
28
|
+
${t}`:t,[s,i]=z(null);return D(()=>{if(!o)return;let a=true;return Promise.all([import("../sanitize-BedC_UE5.mjs"),e?import("../markdown-CCYJwzFn.mjs"):null]).then(([{sanitizeHTML:c,trusted:l},u])=>{const d=u?u.markdownToHtml(t,{headingLevel:n}):t,h=c(d,{markdown:!!u});a&&i({for:r,html:h,inner:l(h)})}),()=>{a=false}},[t,r,o,e,n]),o&&(s==null?void 0:s.for)===r?s:null}const Km=new Set(["p","span","h1","h2","h3","h4","h5","h6","a","b","i","em","strong","small","sub","sup","label"]),Jc=oe(function({as:e="span",markup:n,language:o,format:r,headingLevel:s,...i},a){const{text:c,lang:l}=bt(n,o),u=ut(l),d=fm(r,c),h=d==="markdown",p=qm(d==="plain"?"":c,h,s),m=(p==null?void 0:p.html)??null;if(!c)return null;if(d==="plain")return f(e,{ref:a,...i,...u,children:c.split(/\r?\n/).map((b,v)=>f(ae.Fragment,{children:[v>0&&f("br",{}),b]},v))});const g=typeof e=="string"&&Km.has(e)&&m&&/<(p|ul|ol|div)[\s>]/i.test(m)?"div":e;return p?f(g,{ref:a,...i,...u,dangerouslySetInnerHTML:{__html:p.inner}}):f(e,{ref:a,...i,...u,children:h?hm(c):Rn(c)})}),Qc=({metadata:t,language:e,renderValue:n,...o})=>t!=null&&t.length?f("dl",{...o,children:t.map((r,s)=>{const i=bt(r.label,e),a=n==null?void 0:n(r);return f("div",{"data-label":bt(r.label,"none").text.replace(/\s+/g,"-").toLowerCase(),children:[f("dt",{...ut(i.lang),children:i.text}),a!==void 0?f("dd",{children:a}):f(Jc,{as:"dd",markup:r.value,language:e})]},s)})}):null,Zm=typeof window>"u"?D:Dt;function Gm({children:t}){const{t:e}=Pt(),n=wo(),o=$(null),r=fe(),s=ae.Children.only(t),i=s.props.id??r,{open:a,cut:c,toggle:l}=Xm(o);return f("div",{className:"clover-read-more",children:[ae.cloneElement(s,{ref:o,id:i,"data-read-more":a?"open":""}),(c||a)&&f("button",{type:"button",className:"clover-read-more-button","aria-expanded":a,"aria-controls":i,onClick:l,ref:n.ref,...ut(n.langOf(a?"readLess":"readMore")),children:e(a?"readLess":"readMore")})]})}function Xm(t){const[e,n]=z(false),[o,r]=z(false),s=()=>{const i=t.current;i&&!e&&r(i.scrollHeight>i.clientHeight+1)};return Zm(s),D(()=>{var d,h;const i=t.current;if(!i)return;let a=0;const c=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(s)},l=typeof ResizeObserver>"u"?null:new ResizeObserver(c);l==null||l.observe(i);const u=typeof MutationObserver>"u"?null:new MutationObserver(c);return u==null||u.observe(document.head,{childList:true,subtree:true,characterData:true}),u==null||u.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),u==null||u.observe(i,{attributes:true,attributeFilter:["style"]}),(h=(d=document.fonts)==null?void 0:d.addEventListener)==null||h.call(d,"loadingdone",c),()=>{var p,m;cancelAnimationFrame(a),l==null||l.disconnect(),u==null||u.disconnect(),(m=(p=document.fonts)==null?void 0:p.removeEventListener)==null||m.call(p,"loadingdone",c)}},[e,t.current]),{open:e,cut:o,toggle:()=>n(i=>!i)}}function dn(t,e,n){const o=hs(),r=Ln(s=>{var i;return(i=Io(s,t))==null?void 0:i[e]},void 0);return n!==void 0?n:o?o[e]:r}const Bn=()=>{var t;return(t=Pe())==null?void 0:t.language};function la({of:t="manifest",as:e="p",value:n,className:o,...r}){const s=dn(t,"summary",n),i=Bn();return bt(s,i).text?f(Gm,{children:f(Jc,{as:e,markup:s,language:i,className:Mt("clover-summary",o),...r})}):null}function Ym({of:t="manifest",value:e,className:n,renderValue:o,...r}){const s=dn(t,"metadata",e),i=Bn();return f(Qc,{metadata:s,language:i,renderValue:o,className:Mt("clover-metadata",n),...r})}function Jm({of:t="manifest",value:e,className:n,...o}){const r=dn(t,"requiredStatement",e),s=Bn();return f(Qc,{metadata:r?[r]:null,language:s,className:Mt("clover-required-statement",n),...o})}function Qm({of:t="manifest",value:e,className:n,...o}){const r=dn(t,"rights",e);return r?f("a",{href:r,className:Mt("clover-rights",n),...o,children:r}):null}function tg({of:t="manifest",value:e,className:n,...o}){const r=dn(t,"id",e);return r?f("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:Mt("clover-id",n),...o,children:r}):null}function tl({property:t,className:e,of:n="manifest",value:o,...r}){const s=H(dn(n,t,o)),i=Bn(),a=s.filter(c=>c==null?void 0:c.id);return a.length?f("ul",{className:e,...r,children:a.map(c=>{const l=bt(c.label,i);return f("li",{children:[f("a",{href:c.id,target:"_blank",rel:"noopener noreferrer",hrefLang:En(c),...ut(l.text?l.lang:void 0),children:l.text?Rn(l.text):c.id}),c.format&&f("span",{className:"clover-link-format",children:[" (",c.format,")"]})]},c.id)})}):null}const eg=({className:t,...e})=>f(tl,{property:"homepage",className:Mt("clover-homepage",t),...e}),ng=({className:t,...e})=>f(tl,{property:"seeAlso",className:Mt("clover-see-also",t),...e});function og({of:t="manifest",value:e,size:n=400,className:o,...r}){var m;const s=Ln(g=>Io(g,t),null),i=e??s,a=Bn(),c=i?ps(i):null,l=(c==null?void 0:c.src)??(c==null?void 0:c.service)??(c==null?void 0:c.fallback),[u,d]=z(c==null?void 0:c.src),h=(m=Pe())==null?void 0:m.clover.request;if(D(()=>{if(!c)return d(void 0);if(c.src)return d(c.src);let g=true;return ms(c,n,h).then(b=>g&&d(b)),()=>{g=false}},[l,n]),!u)return null;const p=bt(i==null?void 0:i.label,a);return f("img",{src:u,alt:Rn(p.text),...ut(r.alt===void 0&&p.text?p.lang:void 0),width:n,loading:"lazy",decoding:"async",className:Mt("clover-thumbnail",o),...r})}const rg=typeof window>"u"?D:Dt,el=ue(null),sg=t=>{var e;return!!((e=t.textContent)!=null&&e.trim())||t.querySelector("img, svg, picture, video, canvas, object")!==null},ig=t=>!!t&&typeof t=="object"&&["label","logo","homepage"].some(e=>H(t[e]).length>0),$r=t=>!!t&&typeof t.id=="string",ag=t=>{const e=H(t.homepage).find($r);return e?{id:e.id,hrefLang:En(e)}:void 0},cg=(t,e)=>{var n;if(!t)return null;for(const o of[t.label,(n=H(t.homepage).find(r=>r==null?void 0:r.label))==null?void 0:n.label]){const r=bt(o,e);if(r.text)return{text:Rn(r.text),lang:r.lang}}return null};function nl({of:t="manifest",value:e,link:n=true,children:o,className:r,...s}){var l;const i=Ln(u=>{var d;return(d=Io(u,t))==null?void 0:d.provider},void 0),a=(l=Pe())==null?void 0:l.language,c=H(e!==void 0?e:i).filter(ig);return c.length?f("ul",{className:Mt("clover-provider",r),...s,children:c.map((u,d)=>{const h=n?ag(u):void 0,p=!!bt(u.label,a).text;return f(lg,{agent:u,homepage:h,children:o??f(Ct,{children:[f(ol,{alt:p?"":void 0}),f(en,{className:"clover-provider-label"})]})},u.id??d)})}):null}function lg({agent:t,homepage:e,children:n}){const o=$(null),[r,s]=z(null),i=dt(()=>{o.current&&!sg(o.current)&&s(t)},[t]);return r===t?null:f("li",{className:"clover-provider-agent",children:f(zc.Provider,{value:t,children:f(el.Provider,{value:i,children:e?f("a",{ref:o,href:e.id,target:"_blank",rel:"noopener noreferrer",hrefLang:e.hrefLang,className:"clover-provider-link",children:n}):f("span",{ref:o,className:"clover-provider-content",children:n})})})})}function ol({of:t="manifest",value:e,alt:n,className:o,...r}){var h;const{t:s,langOf:i}=Pt(),a=hs(),c=Ln(p=>{var m;return(m=Io(p,t))==null?void 0:m.provider},void 0),l=(h=Pe())==null?void 0:h.language,d=(e!==void 0?H(e):a?[a]:H(c)).flatMap(p=>{if(!p||typeof p!="object")return[];const m=p;if(m.type!=="Agent"&&$r(m)&&!m.logo)return[{image:m,agent:null}];const g=H(m.logo).find($r);return g?[{image:g,agent:m}]:[]});return d.length?f(Ct,{children:d.map(({image:p,agent:m},g)=>{const b=cg(m,l);return f(ug,{src:p.id,alt:n??(b==null?void 0:b.text)??s("logo"),...ut(n!==void 0?void 0:b?b.lang:i("logo")),width:p.width,height:p.height,loading:"lazy",decoding:"async",className:Mt("clover-logo",o),...r},`${p.id}-${g}`)})}):null}function ug({alt:t,onError:e,...n}){const o=zt(el),[r,s]=z(false),i=dt(()=>s(true),[]);rg(()=>{r&&(o==null||o())},[r,o]);const a=dt(c=>{var l;c!=null&&c.complete&&!c.naturalWidth&&((l=c.decode)==null||l.call(c).catch(i))},[i]);return r?null:f("img",{ref:a,alt:t,onError:c=>{e==null||e(c),i()},...n})}function dg(t,e,n){if(n&&t.includes(n))return n;if(!t.length)return;const o=Zr(t,e);return o==="none"?t[0]:o}const fg=t=>t&&typeof t=="object"&&!Array.isArray(t)?Object.keys(t).filter(e=>e!=="none"&&e!=="@none"&&bt({[e]:t[e]}).text):[];function hg(t){if(!t)return[];const e=[...Array.isArray(t.metadata)?t.metadata:[],t.requiredStatement].filter(Boolean),o=[t.label,t.summary,...e.flatMap(r=>[r==null?void 0:r.label,r==null?void 0:r.value])].map(fg).filter(r=>r.length>1);return[...new Set(o.flat())]}function rl(){const{language:t,chooseLanguage:e}=de("About"),n=it(s=>s.manifest),o=vt(()=>hg(n),[n]),r=dg(o,t);return r&&e?{languages:o,chosen:r,onChange:e}:null}const pg=mt(()=>import("./LanguageChoice-BM9xZr_D.mjs").then(t=>({default:t.LanguageChoice}))),sl=ue(false);function mg({part:t}){const e=rl();return e?f(_t,{fallback:null,children:f(pg,{...e,nameKey:"readingLanguage",part:t})}):null}function ua(t,e){const n=new Set,o=[];for(const r of t)for(const s of H(r==null?void 0:r.rendering)){const i=(s==null?void 0:s.id)??(s==null?void 0:s["@id"]);if(typeof i!="string"||n.has(i))continue;n.add(i);const a=bt(s.label,e);o.push({id:i,label:a.text||s.format||i,lang:a.text?a.lang:void 0,format:s.format,hrefLang:En(s)})}return o}function il(){const{language:t}=de("Download"),e=it(o=>o.manifest),n=it(o=>De(o.manifest,o.canvasId));return{page:ua(n,t),all:ua([e],t)}}const gg=mt(()=>import("./Download-DhMD4AJt.mjs").then(({DownloadGroups:t})=>({default:t}))),vg=mt(()=>import("./NavDate-B6rCV-Cd.mjs").then(t=>t.a).then(({NavDate:t})=>({default:t}))),yg=mt(()=>import("./PartOfManifest-B0TYADTv.mjs"));function bg({languages:t=true,...e}){const n=zt(sl);return f(_g,{...e,download:!n&&e.download!==false,choice:n||!t?null:f(mg,{part:"clover-about"})})}function _g({choice:t,canvasSummary:e=false,headingLevel:n=3,download:o=true,thumbnail:r=true,label:s=true,className:i,...a}){const{t:c,langOf:l}=Pt(),u=il(),d=it(v=>v.manifest,Object.is,"About"),h=$(null);D(()=>{const v=h.current,w=v==null?void 0:v.querySelector(".clover-about-head");if(!v||!w||typeof ResizeObserver>"u")return;const _=new Set,x=()=>{const R=w.querySelector(".clover-about-thumbnail"),N=w.querySelector(".clover-about-label");for(const V of[R,N])V&&!_.has(V)&&(_.add(V),M.observe(V));const J=v.style;if(!R){J.removeProperty("--clover-about-label-height"),J.removeProperty("--clover-about-thumbnail-width");return}const et=`${(N==null?void 0:N.offsetHeight)??0}px`,X=`${R.offsetWidth}px`;J.getPropertyValue("--clover-about-label-height")!==et&&J.setProperty("--clover-about-label-height",et),J.getPropertyValue("--clover-about-thumbnail-width")!==X&&J.setProperty("--clover-about-thumbnail-width",X)};let S=0;const M=new ResizeObserver(()=>{cancelAnimationFrame(S),S=requestAnimationFrame(x)});return M.observe(w),x(),()=>{cancelAnimationFrame(S),M.disconnect(),v.style.removeProperty("--clover-about-label-height"),v.style.removeProperty("--clover-about-thumbnail-width")}},[s,r,d]);const p=fe(),m=()=>{var _,x;const v=h.current;(x=((_=v==null?void 0:v.closest(".clover-sections-item"))==null?void 0:_.querySelector(".clover-sections-button"))??v)==null||x.focus({preventScroll:true})};if(!d)return null;const g=(v,w,_)=>{if(!w)return null;const{as:x,title:S,group:M}=qc(n,`${p}-${v}`);return f("section",{className:"clover-about-section",...M,children:[f(x,{className:"clover-about-heading",...ut(l(v)),...S,children:c(v)}),_]})},b=v=>Array.isArray(d[v])?d[v].length>0:!!d[v];return f("div",{ref:h,className:Mt("clover-about",i),tabIndex:-1,...a,children:[t,(r||s)&&f("div",{className:"clover-about-head",children:[r&&f(og,{className:"clover-about-thumbnail",size:256,alt:s?"":void 0}),s&&f(en,{as:vs(n),className:"clover-about-label clover-title"})]}),e&&f(la,{of:"canvas",className:"clover-about-summary"}),Ti(d)&&d.partOf&&f(_t,{fallback:null,children:f(yg,{manifest:d,headingLevel:n,onOpened:m})}),f(la,{className:"clover-about-summary"}),f(Ym,{className:"clover-about-metadata"}),f(Jm,{className:"clover-about-metadata"}),g("aboutDate",Wc(d.navDate),f(_t,{fallback:null,children:f(vg,{value:d.navDate,className:"clover-about-date"})})),g("aboutProvider",b("provider"),f(nl,{})),g("aboutRights",d.rights,f(Qm,{})),g("aboutHomepage",b("homepage"),f(eg,{})),g("aboutSeeAlso",b("seeAlso"),f(ng,{})),g("download",o&&u.page.length+u.all.length>0,f(_t,{fallback:null,children:f(gg,{page:u.page,all:u.all,headingLevel:n+1})})),g(Ti(d)?"aboutCanvas":"aboutManifest",d.id,f(tg,{}))]})}const wg=mt(()=>import("./LanguageChoice-BM9xZr_D.mjs").then(t=>({default:t.LanguageChoice}))),xg=mt(()=>import("./ControlMenu-Co6yBttc.mjs")),Sg=mt(()=>import("./Download-DhMD4AJt.mjs").then(({DownloadGroups:t})=>({default:t})));function kg({languages:t=true,download:e=true}){const n=rl(),{page:o,all:r}=il(),s=e&&o.length+r.length>0;return!(t&&n)&&!s?null:f("div",{className:"clover-about-actions",children:[s&&f(Cg,{page:o,all:r}),t&&n&&f(_t,{fallback:null,children:f(wg,{...n,nameKey:"readingLanguage",part:"clover-about"})})]})}function Cg({page:t,all:e}){const{t:n,langOf:o}=Pt(),[r,s]=z(false),a=`${fe()}-download`,c=dt(l=>{var u;s(false),l&&((u=document.getElementById(a))==null||u.focus())},[a]);return f("span",{className:"clover-about-download",onBlur:l=>{const u=l.relatedTarget;r&&u&&!l.currentTarget.contains(u)&&s(false)},children:[f("button",{type:"button",id:a,className:"clover-about-download-button","aria-label":n("download"),...ut(o("download")),"aria-expanded":r,"aria-controls":r?`${a}-menu`:void 0,onClick:()=>s(l=>!l),children:[f(Eg,{}),f(We,{label:n("download")})]}),r&&f(_t,{fallback:null,children:f(xg,{id:`${a}-menu`,triggerId:a,onClose:c,className:"clover-about-download-menu",children:f(Sg,{page:t,all:e,inPopover:true})})})]})}function Eg(){return f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512","aria-hidden":"true",focusable:"false",fill:"none",stroke:"currentColor",strokeWidth:"56",strokeLinecap:"round",strokeLinejoin:"round",children:f("path",{d:"M256 64v272M160 240l96 96 96-96M80 352v48a48 48 0 0 0 48 48h256a48 48 0 0 0 48-48v-48"})})}function Mg(t,e=null){if(!t)return false;if(e!=null&&e.navPlace||t.navPlace)return true;for(const n of At(t).canvases){if(n.navPlace)return true;for(const o of H(n.annotations))for(const r of H(o==null?void 0:o.items))if(r!=null&&r.navPlace||H(r==null?void 0:r.motivation).includes("georeferencing")||H(r==null?void 0:r.body).some(i=>(i==null?void 0:i.type)==="Feature"||(i==null?void 0:i.type)==="FeatureCollection"))return true}return false}const Tg=["about","targets","collection","contents","search","map","transcript","annotations"],Re={targets:t=>{var e;return(((e=t.targets)==null?void 0:e.items.length)??0)>1},collection:t=>{var e,n;return(((n=(e=t.collection)==null?void 0:e.items)==null?void 0:n.length)??0)>0||!!ed(t.manifest)},contents:t=>Hh(t.manifest).length>0,search:t=>!!Ya(t.manifest),map:t=>Mg(t.manifest,t.collection),transcript:t=>De(t.manifest,t.canvasId).some(e=>Sc(e).length>0||eh(e).length>0),annotations:t=>vd(t.manifest,t.addedSets).length>0},Ig=(t,e)=>{const n=Array.isArray(e)?new Set(e):void 0;return Tg.filter(o=>t[o]&&(!n||n.has(o)))};function ys(t){const e={about:true,targets:it(Re.targets),collection:it(Re.collection),contents:it(Re.contents),search:it(Re.search),map:it(Re.map),transcript:it(Re.transcript),annotations:it(Re.annotations)};return Ig(e,t)}function Pg({open:t=false,className:e}){return f("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",className:Mt("clover-chevron",e),"data-open":t||void 0,children:f("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const al=typeof window>"u"?D:Dt,cl=ue(null);function oy(){return zt(cl)}const ll=ue(0);function ry(){return zt(ll)}function Lg({items:t,layout:e="tabs",value:n,onValueChange:o,label:r,labelLang:s,headingLevel:i=3}){var V;const a=fe(),c=Eo(r??"",s,r===void 0),l=$([]),u=e==="tabs",{t:d,langOf:h}=Pt(),p=Kc({dragFree:true,itemCount:t.length}),m=t.some(T=>T.value===n)?n:((V=t[0])==null?void 0:V.value)??null,g=$(new Set);m&&g.current.add(m);const b=$(null),[v,w]=z({value:null,count:0});D(()=>{var Y;if(u||!m||b.current!==m)return;b.current=null;const T=t.findIndex(st=>st.value===m),E=document.getElementById(`${a}-panel-${T}`),A=(Y=l.current[T])==null?void 0:Y.parentElement;if(!E||!A)return;const W=A.getBoundingClientRect().bottom-E.getBoundingClientRect().top;if(W<=0)return;const G=fr(E);G&&(G.scrollTop-=W)},[m,u,t,a]);const _=T=>{var ct,y,C,L;const E=t.findIndex(F=>F.value===m),A=document.getElementById(`${a}-panel-${E}`),W=T.target;if(!A||W===A||!A.contains(W)||!Og(W))return;const G=(y=(ct=l.current[E])==null?void 0:ct.parentElement)==null?void 0:y.getBoundingClientRect(),Y=E+1<t.length?(L=(C=l.current[E+1])==null?void 0:C.parentElement)==null?void 0:L.getBoundingClientRect():void 0;if(!G)return;const st=W.getBoundingClientRect(),St=st.top<G.bottom?Math.floor(st.top-G.bottom):Y&&st.bottom>Y.top?Math.ceil(Math.min(st.bottom-Y.top,st.top-G.bottom)):0,ot=St?fr(A):null;ot&&(ot.scrollTop+=St)},x=$(null),S=t.map(T=>T.value).join(`
|
|
29
|
+
`);al(()=>{const T=x.current;if(u||!T||typeof ResizeObserver>"u")return;const E=[...T.querySelectorAll(":scope > .clover-sections-item")],A=E.map(O=>O.firstElementChild),W=A[0],G=A[A.length-1],Y=new Map,st=O=>(O&&Y.get(O))??0,St=document.scrollingElement;let ot=null,ct=0;const y=()=>{const O=A.reduce((pt,ft)=>pt+st(ft),0);let P=0;E.forEach((pt,ft)=>{pt.style.setProperty("--clover-sections-before",`${P}px`),P+=st(A[ft]),pt.style.setProperty("--clover-sections-after",`${O-P}px`)}),T.style.setProperty("--clover-sections-total",`${O}px`);const U=W&&getComputedStyle(W);(U==null?void 0:U.position)==="sticky"&&G&&(ct=parseFloat(U.top)+parseFloat(getComputedStyle(G).bottom)||0);const K=getComputedStyle(T),yt=parseFloat(K.lineHeight)||1.2*parseFloat(K.fontSize),tt=(ot==null?void 0:ot.clientHeight)??0;tt>0&&tt-ct-O<2*yt?T.dataset.stacks="off":delete T.dataset.stacks},C=new ResizeObserver(O=>{var P,U;for(const K of O)A.includes(K.target)&&Y.set(K.target,((U=(P=K.borderBoxSize)==null?void 0:P[0])==null?void 0:U.blockSize)??K.target.getBoundingClientRect().height);y()}),L=()=>{const O=fr(T);O!==ot&&(ot&&ot!==St&&C.unobserve(ot),O&&O!==St&&C.observe(O),ot=O)},F=()=>{L(),y()};L();for(const O of A)O&&C.observe(O,{box:"border-box"});return window.addEventListener("resize",F),()=>{C.disconnect(),window.removeEventListener("resize",F);for(const O of E)O.style.removeProperty("--clover-sections-before"),O.style.removeProperty("--clover-sections-after");T.style.removeProperty("--clover-sections-total"),delete T.dataset.stacks}},[u,S,i]),D(()=>{if(u)return;const T=l.current.map(A=>A==null?void 0:A.parentElement).filter(A=>!!A),E=A=>{var st;if(A.ctrlKey)return;const W=A.currentTarget,G=da(W);if(!G||G===document.scrollingElement)return;A.preventDefault();const Y=A.deltaMode===1?parseFloat(getComputedStyle(W).lineHeight)||16:A.deltaMode===2?G.clientHeight:1;(st=da(G)??document.scrollingElement)==null||st.scrollBy({left:A.deltaX*Y,top:A.deltaY*Y,behavior:"instant"})};for(const A of T)A.addEventListener("wheel",E,{passive:false});return()=>{for(const A of T)A.removeEventListener("wheel",E)}},[u,S]);const M=T=>{T!==m&&(b.current=T,u||w(E=>({value:T,count:E.count+1})),o==null||o(T))},R=(T,E)=>{var st;const A=t.length-1,[W,G]=u?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"],Y=T.key===G?(E+1)%t.length:T.key===W?(E-1+t.length)%t.length:T.key==="Home"?0:T.key==="End"?A:null;Y!==null&&(T.preventDefault(),(st=l.current[Y])==null||st.focus(),u&&M(t[Y].value))},N=$(false);D(()=>{if(!u)return;const T=t.findIndex(ot=>ot.value===m),E=l.current[T],A=E==null?void 0:E.parentElement;if(!E||!A)return;const W=getComputedStyle(A),G=A.getBoundingClientRect(),Y=E.getBoundingClientRect(),st=G.left+(parseFloat(W.scrollPaddingLeft)||0),St=G.right-(parseFloat(W.scrollPaddingRight)||0);(Y.left<st-1||Y.right>St+1)&&p.scrollToIndex(T,{instant:!N.current}),N.current=true},[m,u,t.length,p.scrollToIndex]);const J=T=>{const E=T==="prev"?p.canScrollPrev:p.canScrollNext,A=T==="prev"?"sectionsScrollBack":"sectionsScrollForward";return f("button",{type:"button",className:`clover-steps-step clover-sections-scroll-${T}`,"aria-hidden":"true",tabIndex:-1,hidden:!E,...ut(h(A)),onMouseDown:W=>W.preventDefault(),onClick:T==="prev"?p.scrollPrev:p.scrollNext,children:[f("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:f("path",{d:T==="next"?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),f(We,{label:d(A)})]})},et=vs(i,"div"),X=(T,E)=>{const A=T.value===m;return f("button",{ref:W=>{l.current[E]=W},type:"button",id:`${a}-button-${E}`,className:"clover-sections-button","data-value":T.value,"data-track-index":u?E:void 0,"aria-controls":`${a}-panel-${E}`,...u?{role:"tab","aria-selected":A,tabIndex:A?0:-1}:{"aria-expanded":A,"aria-disabled":A||void 0},onClick:()=>M(T.value),onKeyDown:W=>R(W,E),children:[f("span",{className:"clover-sections-label",children:T.label}),!u&&f(Pg,{open:A,className:"clover-sections-chevron"})]},T.value)};return f("div",{ref:x,className:"clover-sections","data-layout":e,onFocus:u?void 0:_,style:u?void 0:{"--clover-sections-count":t.length},children:[u&&f("div",{className:"clover-sections-tabs","data-more":[p.canScrollPrev&&"start",p.canScrollNext&&"end"].filter(Boolean).join(" ")||void 0,children:f("div",{className:"clover-sections-row",children:[f("div",{role:"tablist",ref:p.ref,...c.props,className:"clover-sections-list",children:t.map(X)}),J("prev"),J("next")]})}),u&&c.node,t.map((T,E)=>{const A=T.value===m;return f("section",{className:"clover-sections-item","data-value":T.value,"data-open":A,style:u?void 0:{"--clover-sections-index":E},children:[!u&&f(et,{className:"clover-sections-heading",children:[X(T,E),f("span",{className:"clover-sections-reach","aria-hidden":"true"})]}),f(ll.Provider,{value:v.value===T.value?v.count:0,children:f(Ag,{id:`${a}-panel-${E}`,tabs:u,labelledBy:`${a}-button-${E}`,hidden:!A,actions:T.actions,children:g.current.has(T.value)?T.content:null})})]},T.value)})]})}function Ag({id:t,tabs:e,labelledBy:n,hidden:o,actions:r,children:s}){const[i,a]=z(null),c=!o||!!r;return al(()=>{const l=i==null?void 0:i.parentElement;if(!c||!i||!l||typeof ResizeObserver>"u")return;const u=new ResizeObserver(()=>{const d=i.offsetWidth;d?(l.style.setProperty("--clover-sections-actions",`${d}px`),l.setAttribute("data-actions","")):(l.style.removeProperty("--clover-sections-actions"),l.removeAttribute("data-actions"))});return u.observe(i),()=>{u.disconnect(),l.style.removeProperty("--clover-sections-actions"),l.removeAttribute("data-actions")}},[i,c]),f(Ct,{children:[!e&&f("div",{ref:a,className:"clover-sections-actions",hidden:!c,children:r}),f("div",{id:t,role:e?"tabpanel":"region","aria-labelledby":n,tabIndex:e?0:void 0,className:"clover-sections-panel",hidden:o,children:f(cl.Provider,{value:e?null:i,children:[e&&r,s]})})]})}function fr(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll|hidden/.test(getComputedStyle(e).overflowY))return e;return document.scrollingElement}function da(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll/.test(getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight)return e;return document.scrollingElement}function Og(t){try{return t.matches(":focus-visible")}catch{return true}}const Ng=mt(()=>import("./MapView-G3yj-Bjd.mjs").then(t=>({default:t.RootMap}))),Rg=mt(()=>import("./Collection-DCYM9eE6.mjs").then(t=>({default:t.Collection}))),Bg=mt(()=>import("./TargetItems-BpmZEVMS.mjs").then(t=>({default:t.TargetsSection}))),$g=mt(()=>import("./Contents-BnRBx3rc.mjs").then(t=>({default:t.Contents}))),Fg=mt(()=>import("./Search-CyRrBHsr.mjs").then(t=>({default:t.Search}))),Dg=mt(()=>import("./Transcript-CE4BsnWd.mjs").then(t=>({default:t.Transcript}))),zg=mt(()=>import("./Annotations-DEKa_9xz.mjs").then(t=>({default:t.Annotations}))),Be=t=>f(_t,{fallback:null,children:t}),Hg=()=>null,Wg=oe(function({layout:e="tabs",value:n,defaultValue:o,onValueChange:r,onClose:s,closeOnEscape:i=false,headingLevel:a=3,as:c="aside",download:l=true,languages:u=true,sections:d,labels:h,className:p,children:m,onKeyDown:g,...b},v){var O;const{clover:w}=de("Panel"),_=$(null),{t:x,langOf:S,hostLanguage:M,i18n:R}=Pt(),N=Eo(x("informationPanelTabs"),S("informationPanelTabs"),!!(b["aria-label"]||b["aria-labelledby"])||!(["aside","section","nav"].includes(c)||b.role)),J=P=>{const U=S(P);return U?f("span",{...ut(U),children:x(P)}):x(P)},et=(P,U)=>{const K=h==null?void 0:h[P];if(K===void 0)return J(U);if(typeof K=="string")return K;const yt=Object.keys(K),tt=Zr(yt,R.language);if(!tt)return J(U);const pt=_o(tt,M);return pt?f("span",{...ut(pt),children:K[tt]}):K[tt]},X=ys(d),V=P=>X.includes(P),T=ae.Children.toArray(m).filter(P=>ae.isValidElement(P)&&P.type===Hg),E=e==="accordion"?a+1:a,A=u||l?f(kg,{languages:u,download:l}):void 0,W=T.length?T.map(({props:P})=>({value:P.value,label:P.label,content:P.children,...P.value==="about"&&{actions:A}})):[...V("about")?[{value:"about",label:et("about","informationPanelTabsAbout"),content:f(bg,{headingLevel:E,download:l}),actions:A}]:[],...V("targets")?[{value:"targets",label:et("targets","informationPanelTabsTargets"),content:Be(f(Bg,{headingLevel:E}))}]:[],...V("collection")?[{value:"collection",label:et("collection","informationPanelTabsCollection"),content:Be(f(Rg,{headingLevel:E}))}]:[],...V("contents")?[{value:"contents",label:et("contents","informationPanelTabsContents"),content:Be(f($g,{}))}]:[],...V("search")?[{value:"search",label:et("search","informationPanelTabsSearch"),content:Be(f(Fg,{headingLevel:E,sticky:true,size:"small"}))}]:[],...V("map")?[{value:"map",label:et("map","informationPanelTabsMap"),content:Be(f(Ng,{}))}]:[],...V("transcript")?[{value:"transcript",label:et("transcript","transcriptLabel"),content:Be(f(Dg,{sticky:true,size:"small"}))}]:[],...V("annotations")?[{value:"annotations",label:et("annotations","informationPanelTabsAnnotations"),content:Be(f(zg,{headingLevel:E}))}]:[]],G=it(P=>P.search.query),Y=W.some(P=>P.value==="search"),[st,St]=z(()=>G&&Y?"search":o??null),ot=$(G&&Y?G:"");D(()=>{Y&&(G&&G!==ot.current&&n===void 0&&St("search"),ot.current=G)},[G,Y,n]);const ct=it(P=>{var U;return P.annotationId&&((U=P.regions)!=null&&U.entries.some(K=>K.id===P.annotationId))?P.annotationId:null}),y=W.some(P=>P.value==="contents");D(()=>{ct&&y&&n===void 0&&St("contents")},[ct,y,n]);const C=n!==void 0?n:st,L=(W.some(P=>P.value===C)?C:(O=W[0])==null?void 0:O.value)==="search";if(D(()=>{Y&&w.setSetVisible(Jr,L)},[w,Y,L]),!W.length)return null;const F=()=>{var U;const P=_.current;P!=null&&P.contains(document.activeElement)&&((U=Ug(P))==null||U.focus()),s==null||s()};return f(c,{ref:P=>{_.current=P,typeof v=="function"?v(P):v&&(v.current=P)},className:Mt("clover-panel",p),"data-layout":e,"data-closable":s?"":void 0,"data-floating":i?"":void 0,...N.props,onKeyDown:P=>{g==null||g(P),i&&s&&P.key==="Escape"&&!P.defaultPrevented&&(P.preventDefault(),F())},...b,children:[N.node,s&&f("button",{type:"button",className:"clover-panel-close","aria-label":x("informationPanelClose"),...ut(S("informationPanelClose")),onClick:F,children:[f("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",fill:"none",stroke:"currentColor",children:f(hc,{})}),f(We,{label:x("informationPanelClose")})]}),f(sl.Provider,{value:W.some(P=>P.value==="about"),children:f(Lg,{items:W,layout:e,value:n!==void 0?n:st,onValueChange:P=>{n===void 0&&St(P),r==null||r(P)},label:x("informationPanelTabs"),labelLang:S("informationPanelTabs"),headingLevel:a})})]})});function Ug(t){for(let e=t;e&&e!==document.body;e=e.parentElement){if(!e.id)continue;const n=document.querySelector(`[aria-controls~="${e.id.replace(/["\\]/g,"\\$&")}"]`);if(n)return n}return null}const jg=1,Vg=4,qg=8,Kg=500,Zg=4,fa=["pointerdown","mousedown","pointerup","mouseup","click","dblclick"],ul=()=>typeof document>"u"?16:parseFloat(getComputedStyle(document.documentElement).fontSize)||16;function ro(t,e){if(t===void 0)return;if(typeof t=="number")return t;const n=parseFloat(t);if(!Number.isNaN(n))return t.endsWith("rem")?n*ul():t.endsWith("%")?n/100*e:n}const hr=t=>typeof t=="number"?`${t}px`:t,Gg=t=>{if(!t||typeof localStorage>"u")return{};try{const e=JSON.parse(localStorage.getItem(t)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}},Xg=(t,e)=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},Yg=t=>t?Array.from(t.children).filter(e=>e.classList.contains("clover-split-pane")):[];function Jg(t){const e=i=>{let a=t[i];for(;a&&!a.classList.contains("clover-split-pane");)a=a[i];return a},n=e("previousElementSibling"),o=e("nextElementSibling"),r=o!=null&&o.hasAttribute("data-sized")?o:n!=null&&n.hasAttribute("data-sized")?n:null;return{sized:r,other:r===o?n:o}}function Qg(t,e,n){const{sized:o,other:r}=Jg(t);if(!o)return null;const s=e.clientWidth,i=o.dataset.splitKey??"",a=n[i]??{},c=n[(r==null?void 0:r.dataset.splitKey)??""]??{},l=ro(a.min,s)??0,d=o.getBoundingClientRect().width+((r==null?void 0:r.getBoundingClientRect().width)??0)-(ro(c.min,s)??0),h=Math.max(l,Math.min(ro(a.max,s)??d,d)),p=o.getBoundingClientRect().left>=t.getBoundingClientRect().left-1;return{sized:o,key:i,min:l,max:h,after:p}}function tv(t,e,n){const o=e!==void 0&&e>t.min+1&&e<t.max-1?[t.min,e,t.max]:[t.min,t.max],r=n??e??t.sized.getBoundingClientRect().width,s=o.find(i=>i>r+1)??o[0];return{to:s,own:e!==void 0&&Math.abs(s-e)<=1}}function ev(t,e){const n=e.sized.getBoundingClientRect().width,o=jg*ul()*(t.shiftKey?4:1),r=e.after?"ArrowLeft":"ArrowRight",s=e.after?"ArrowRight":"ArrowLeft";if(t.key===r)return n+o;if(t.key===s)return n-o;if(t.key==="Home")return e.min;if(t.key==="End")return e.max}function ha(t){var n,o,r;const e=(o=(n=t.target)==null?void 0:n.closest)==null?void 0:o.call(n,".clover-tip");return!!(e&&((r=t.currentTarget)!=null&&r.contains(e)))}function nv(t,e){let n=null,o=false,r=null,s=null;const i=a=>{s==null||s();const c=t(),l=c==null?void 0:c.ownerDocument.defaultView;if(!c||!l)return;const u=g=>Math.hypot(g.clientX-a.x,g.clientY-a.y)>a.reach,d=()=>{fa.forEach(g=>l.removeEventListener(g,h,true)),l.removeEventListener("pointermove",p,true),clearTimeout(m),s=null},h=g=>{if(!c.contains(g.target)){if(g.type==="pointerdown"&&u(g))return d();g.preventDefault(),g.stopPropagation()}},p=g=>u(g)&&d();fa.forEach(g=>l.addEventListener(g,h,true)),l.addEventListener("pointermove",p,true);const m=setTimeout(d,Kg);s=d};return{down(a){var u;if(o=false,r=null,a.defaultPrevented||a.button!==0||ha(a))return;const c=e().limits();if(!c)return;a.preventDefault(),n={found:c,x:a.clientX,from:c.sized.getBoundingClientRect().width,slop:a.pointerType==="touch"?qg:Vg,moved:false};const l=a.currentTarget;l.dataset.dragging="",(u=l.setPointerCapture)==null||u.call(l,a.pointerId)},move(a){const c=n;if(!c)return;const l=a.clientX-c.x;!c.moved&&Math.abs(l)<c.slop||(c.moved=true,e().resize(c.from+(c.found.after?-l:l)))},up(a){const c=n;o=(c==null?void 0:c.moved)??false,r=c&&!c.moved&&a.type==="pointerup"?{x:a.clientX,y:a.clientY,reach:c.slop*Zg}:null,n=null,delete a.currentTarget.dataset.dragging},click(a){const c=o,l=r;o=false,r=null,!(a.defaultPrevented||c||ha(a))&&(e().step(),l&&i(l))},key(a){if(a.defaultPrevented)return;const c=e().limits();if(!c)return;const l=ev(a,c);l!==void 0&&(e().resize(l),a.preventDefault())},dispose(){s==null||s()}}}const bs=ue(null);function _s(t,e){typeof t=="function"?t(e):t&&(t.current=e)}const ov=oe(function({as:e="div",storageKey:n,className:o,style:r,children:s,...i},a){const c=$(null),l=$({}),[u,d]=z({});D(()=>d(Gg(n)),[n]);const h=dt((m,g)=>d(b=>{const v={...b};return g===void 0?delete v[m]:v[m]=Math.round(g),Xg(n,v),v}),[n]),p=vt(()=>({sizes:u,setSize:h,specs:l,element:c}),[u,h]);return f(bs.Provider,{value:p,children:f(e,{ref:m=>{c.current=m,_s(a,m)},className:["clover-split",o].filter(Boolean).join(" "),style:{display:"flex",...r},...i,children:s})})}),dl=oe(function({as:e="div",size:n,min:o,max:r,name:s,className:i,style:a,children:c,...l},u){const d=zt(bs),h=$(null),[p,m]=z(s??"");D(()=>{if(s)return m(s);const b=Yg(d==null?void 0:d.element.current);m(String(b.indexOf(h.current)))},[s,d]),d&&p&&(d.specs.current[p]={min:o,max:r,size:n});const g=d&&p?d.sizes[p]:void 0;return f(e,{ref:b=>{h.current=b,_s(u,b)},className:["clover-split-pane",i].filter(Boolean).join(" "),"data-split-key":p||void 0,"data-sized":n!==void 0?"":void 0,style:{minWidth:hr(o)??0,"--clover-split-size":g!==void 0?`${g}px`:hr(n),"--clover-split-max":hr(r),...a},...l,children:c})}),rv=oe(function({className:e,children:n,onPointerDown:o,onClick:r,onKeyDown:s,...i},a){const c=zt(bs),{t:l,langOf:u}=Pt(),d=$(null),[h,p]=z(),m=dt(()=>{const M=d.current,R=c==null?void 0:c.element.current;return!M||!R||!c?null:Qg(M,R,c.specs.current)},[c]),g=dt(M=>{const R=m();if(!R||!c)return;const N=Math.min(R.max,Math.max(R.min,M));c.setSize(R.key,N),p({now:N,min:R.min,max:R.max})},[m,c]),b=dt(()=>{const M=m();M&&p({now:M.sized.getBoundingClientRect().width,min:M.min,max:M.max})},[m]);D(()=>{const M=c==null?void 0:c.element.current;if(b(),!M||typeof ResizeObserver>"u")return;let R=0;const N=new ResizeObserver(()=>{cancelAnimationFrame(R),R=requestAnimationFrame(b)});return N.observe(M),()=>{cancelAnimationFrame(R),N.disconnect()}},[b,c,c==null?void 0:c.sizes]);const v=M=>{var R;return Math.round(M/(((R=c==null?void 0:c.element.current)==null?void 0:R.clientWidth)||1)*100)},w=()=>{var et,X;const M=m();if(!M||!c)return;const R=((et=c.element.current)==null?void 0:et.clientWidth)??0,N=ro((X=c.specs.current[M.key])==null?void 0:X.size,R),J=tv(M,N,c.sizes[M.key]);if(!J.own)return g(J.to);c.setSize(M.key,void 0),p({now:N,min:M.min,max:M.max})},_=$({limits:m,resize:g,step:w});_.current={limits:m,resize:g,step:w};const[x]=z(()=>nv(()=>d.current,()=>_.current));D(()=>()=>x.dispose(),[x]);const S=i["aria-label"]??l("splitHandle");return f("div",{ref:M=>{d.current=M,_s(a,M)},role:"separator","aria-orientation":"vertical","aria-label":S,...ut(i["aria-label"]===void 0?u("splitHandle"):void 0),"aria-valuenow":h?v(h.now):void 0,"aria-valuemin":h?v(h.min):void 0,"aria-valuemax":h?v(h.max):void 0,tabIndex:0,className:["clover-split-handle",e].filter(Boolean).join(" "),onPointerDown:M=>{o==null||o(M),x.down(M)},onPointerMove:M=>x.move(M),onPointerUp:M=>x.up(M),onPointerCancel:M=>x.up(M),onClick:M=>{r==null||r(M),x.click(M)},onKeyDown:M=>{s==null||s(M),x.key(M)},...i,children:[n,f(We,{label:S})]})});let fl;function sv(t){fl=t}function sy(){return fl}function iv({open:t,onOpenChange:e,controls:n}){const{t:o,langOf:r}=Pt(),s=fe().replace(/:/g,"");return f(Fe,{id:`panel-${s}`,label:o("informationPanelToggle"),lang:r("informationPanelToggle"),expanded:t,controls:n,onClick:()=>e(!t),children:f(Ct,{children:[f("rect",{x:"64",y:"96",width:"384",height:"320",rx:"40",fill:"none",strokeWidth:"36"}),f("path",{d:"M320 96v320",fill:"none",strokeWidth:"36"}),t&&f("path",{d:"M320 96h88a40 40 0 0 1 40 40v240a40 40 0 0 1-40 40h-88z"})]})})}let av,so;const hl=()=>av??(av=import("./dragToClose-Bt4QtVSO.mjs").then(t=>so=t));function cv(){hl()}function lv(t,{enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i=false}){const a=$({enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i});a.current={enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i},D(()=>{const c=t.current;if(!c||(so==null||so.reset(c,a),!e))return;let l=true,u;return hl().then(d=>{l&&(u=d.attach(c,a))}),()=>{l=false,u==null||u()}},[t,e])}const uv=240,dv="16rem",fv="14rem",hv=31;function pv(t){const[e,n]=z(t),[o,r]=z(t);return D(()=>{if(t){n(true);const i=requestAnimationFrame(()=>requestAnimationFrame(()=>r(true)));return()=>cancelAnimationFrame(i)}r(false);const s=setTimeout(()=>n(false),uv);return()=>clearTimeout(s)},[t]),{mounted:e,open:t&&o}}function mv(t){const e=n=>t.querySelector(n);return e('[role="tab"][aria-selected="true"]')??e('.clover-sections-button[aria-expanded="true"]')??e(".clover-sections-button")}const gv=typeof window>"u"?D:Dt;function vv(t,e){const[n,o]=z();return gv(()=>{const r=t.current;if(!r)return;const s=()=>{const a=r.clientWidth;if(!a)return;const c=parseFloat(getComputedStyle(document.documentElement).fontSize);o(a>=e*(c||16))};if(s(),typeof ResizeObserver>"u")return;const i=new ResizeObserver(s);return i.observe(r),()=>i.disconnect()},[t,e]),n}const yv=typeof window>"u"?D:Dt;function bv({id:t,beside:e,defaultOpen:n,side:o,focus:r=mv,slides:s=true,alongside:i,followFocus:a}){var V,T;const c=$(null),l=$(null),u=e===false,[d,h]=z(n),[p,m]=z(false),g=u?p:d,b=()=>document.querySelector(`button[aria-controls~="${t}"]`),v=()=>a(b),w=()=>{var E,A;(E=c.current)!=null&&E.contains(document.activeElement)&&((A=b())==null||A.focus(),v())},_=$(0),x=E=>{_.current=u&&E?3:0,_.current||v(),u&&m(E),h(E)},S=()=>{w(),x(false)},M=$(e),R=$(false);if(M.current===true&&e===false){const E=document.activeElement;R.current=!!(E&&((V=c.current)!=null&&V.contains(E)||(T=b())!=null&&T.contains(E)))}yv(()=>{var E;R.current&&(R.current=false,(E=b())==null||E.focus(),v()),e===true&&m(false),M.current=e},[e]);const N=pv(s&&u&&g),J=s&&u,et=J?N.mounted:g,X=J?N.open:g;return D(()=>{if(!_.current||!c.current)return;_.current-=1;const E=r(c.current);E==null||E.focus({preventScroll:true}),E&&document.activeElement===E&&(_.current=0)}),lv(c,{enabled:u&&X,side:o,onClose:S,scrim:l,alongside:i,exits:!s}),{pane:c,over:u,open:g,shown:et,opened:X,setOpen:x,close:S,onKeyDown:E=>{u&&g&&E.key==="Escape"&&!E.defaultPrevented&&(E.preventDefault(),S())},scrim:u&&et&&{ref:l,"data-open":X,"aria-hidden":true,onMouseDown:E=>E.preventDefault(),onClick:S}}}const _v=typeof window>"u"?D:Dt;function wv(t,e,n){_v(()=>{const o=t.current,r=o==null?void 0:o.parentElement;if(!n||!o||!r)return;const s=()=>{const c=e();o.style.setProperty("--clover-template-spine-top",`${c?c.getBoundingClientRect().top-r.getBoundingClientRect().top:0}px`)};s();const i=new ResizeObserver(s);for(const c of Array.from(r.children))i.observe(c);const a=e();return a&&i.observe(a),()=>i.disconnect()},[t,n])}function xv({id:t,beside:e,defaultOpen:n,followFocus:o,body:r,sections:s,panel:i,load:a}){const c=bv({id:t,beside:e,defaultOpen:n,side:"end",followFocus:o}),l=!c.over&&c.open,u=$(null);wv(u,()=>r==null?void 0:r(),l&&!!r);const d=p=>{var m,g;(g=(m=p.target).closest)!=null&&g.call(m,`[aria-controls~="${t}"]`)&&(i||a==null||a(),c.over&&cv())},h=f(Sv,{sections:s,open:c.open,onOpenChange:p=>p&&!i&&a?a().then(()=>c.setOpen(true)):c.setOpen(p),controls:t});return{...c,id:t,docked:l,spine:u,toggle:h,Part:i,splitProps:{"data-panel":c.over?"over":"beside",onKeyDown:c.onKeyDown,onPointerOver:d,onFocus:d}}}function Sv({sections:t,...e}){return ys(t).length?f(iv,{...e}):null}function kv({pane:t,className:e,...n}){const{id:o,over:r,docked:s,Part:i}=t,a=ys(n.sections);return a.length?f(Ct,{children:[s&&f(rv,{className:"clover-template-panel-handle","aria-controls":o}),s&&f("div",{ref:t.spine,className:"clover-template-spine",children:t.toggle}),f(dl,{ref:t.pane,id:o,"data-spine":r||void 0,name:"panel","data-about":a.includes("about")||void 0,className:["clover-template-panel clover-template-drawer",e].filter(Boolean).join(" "),size:"24rem",min:r?void 0:fv,"data-open":t.opened,hidden:!t.shown,children:i&&f(i,{...n,onClose:r?t.close:void 0,closeOnEscape:r})}),t.scrim&&f("div",{className:"clover-template-scrim",...t.scrim})]}):null}const Cv=30;function Ev(){const t=$(0);return D(()=>()=>cancelAnimationFrame(t.current),[]),e=>{cancelAnimationFrame(t.current);let n=0;const o=()=>{const r=e();r&&Mv()?r.focus():++n<Cv&&(t.current=requestAnimationFrame(o))};t.current=requestAnimationFrame(o)}}function Mv(){const t=document.activeElement;return!t||t===document.body||!t.isConnected||t.closest("[hidden], [inert]")!==null}function Tv({className:t,header:e=true,headingLevel:n=2,panel:o=true,defaultPanelOpen:r,panelLayout:s="accordion",panelSections:i,panelLabels:a,download:c=true,languages:l=true,items:u="slider",singleItem:d=false,storageKey:h="clover-template-default",fill:p=false,collapseControls:m,canvasOptions:g,...b}){const v=$(null),w=fe().replace(/:/g,""),_=`${w}-panel`,x=qc(n,`${w}-title`),S=xv({id:_,beside:vv(v,hv),defaultOpen:r??true,followFocus:Ev(),sections:i,body:()=>{var N;return(N=v.current)==null?void 0:N.querySelector(".clover-template-default-body")},panel:Wg}),M=S.over,R=o&&S.docked;return f(Zd,{className:["clover-template-default",t].filter(Boolean).join(" "),"data-fill":p||void 0,...e?x.group:null,...b,children:f(ov,{ref:v,className:"clover-template-default-panes clover-template-panes",storageKey:h||void 0,...o?S.splitProps:{"data-panel":"beside"},children:[f(dl,{className:"clover-template-default-main",min:M?void 0:dv,children:[e&&f("header",{className:"clover-template-default-header",children:[f(Iv,{title:x}),f(vo,{of:"targets",layout:"pager",size:"small",className:"clover-template-default-pager"}),f(nl,{className:"clover-template-default-provider",children:f(ol,{})})]}),f(Vm,{loading:false}),f(lm,{className:"clover-template-default-body",collapseControls:m,options:g,children:o&&!R&&S.toggle}),f("div",{className:"clover-template-default-rail",children:[f("div",{className:"clover-template-default-rail-header",children:[f(Av,{}),f(jm,{})]}),u&&f(vo,{layout:u,singleItem:d})]})]}),o&&f(kv,{pane:S,className:"clover-template-default-panel",layout:s,sections:i,labels:a,download:c,languages:l,headingLevel:e?Lv(n):n})]})})}function Iv({title:t}){const e=it(o=>{var r;return o.throughCollection?(r=o.collection)==null?void 0:r.label:void 0}),n=Kh();return Pv(n==null?void 0:n.entries[0]),f(Ct,{children:[f(en,{as:t.as,className:"clover-template-default-title clover-template-title clover-title",...t.title}),e&&f("div",{className:"clover-template-default-collection-row",children:[f(en,{as:"p",label:e,className:"clover-template-default-collection"}),f(vo,{of:"members",layout:"pager",size:"small",className:"clover-template-default-pager"})]}),n&&f("div",{className:"clover-template-default-collection-row",children:[n.label&&f(en,{as:"p",label:n.label,className:"clover-template-default-collection"}),f(vo,{of:"annotations",layout:"pager",size:"small",className:"clover-template-default-pager"})]})]})}function Pv(t){const{clover:e}=de(),n=it(r=>{var s;return(s=r.manifest)==null?void 0:s.id}),o=$(null);D(()=>{if(!t||!n||o.current===n)return;o.current=n;const{annotationId:r,canvasId:s}=e.store.get();!r&&s===t.canvasId&&e.selectAnnotation(t.id)},[e,t,n])}const Lv=t=>t+1;function Av(){const t=fs();return f("p",{className:"clover-template-default-titles",children:t.map((e,n)=>f(ae.Fragment,{children:[n>0&&f("span",{className:"clover-template-default-titles-dot","aria-hidden":"true",children:"\xB7"}),f(en,{label:e.label})]},e.id))})}const Ov=()=>import("./renderers-2BgvLkI0.mjs"),Nv=mt(()=>import("./Document-ByBRhL68.mjs").then(t=>({default:t.Document}))),Rv=mt(()=>import("./Gallery-CbHhyWlF.mjs").then(t=>({default:t.Gallery}))),pa={default:Tv,document:Nv,gallery:Rv},Bv={header:["default"],panel:["default","gallery"],items:["default","gallery"],singleItem:["default","document"],fill:["default"],defaultPanelOpen:["default","document","gallery"],panelLayout:["default","document","gallery"],panelSections:["default","document","gallery"],panelLabels:["default","document","gallery"],download:["default","document","gallery"],languages:["default","document","gallery"],storageKey:["default","document","gallery"],defaultSidebarOpen:["document"],size:["gallery"],height:["gallery"],gap:["gallery"],secondary:["gallery"],summary:["gallery"],lightboxItems:["gallery"]};function $v({props:t}){const e=typeof t.template=="string"&&t.template in pa?t.template:"default",n=Object.fromEntries(Object.entries(t).filter(([i])=>{var a;return i!=="template"&&(((a=Bv[i])==null?void 0:a.includes(e))??true)})),o=Je(Ov,!!t.renderers),r=vt(()=>o==null?void 0:o.toRenderers(t.renderers),[o,t.renderers]);if(t.renderers&&!o)return null;n.renderers=r,typeof n.storageKey=="string"&&(n.storageKey=n.storageKey.trim().toLowerCase()==="false"?false:n.storageKey);const s=pa[e];return f(_t,{fallback:null,children:f(s,{...n,iiifContent:t.iiifContent})})}const Fv=""+new URL("../assets/maplibre-gl-worker-kTz9OPxr.js",import.meta.url).href,Dv={mapWorkerUrl:Fv},zv={tag:"clover-viewer",kind:"alone",attributes:{template:{prop:"template",type:["default","document","gallery"]},"iiif-content":{prop:"iiifContent",type:"string"},"canvas-id":{prop:"defaultCanvasId",type:"string"},"manifest-id":{prop:"defaultManifestId",type:"string"},language:{prop:"language",type:"string"},"high-contrast":{prop:"highContrast",type:"boolean"},"search-query":{prop:"searchQuery",type:"string"},annotations:{prop:"annotations",type:"data"},"heading-level":{prop:"headingLevel",type:"number",min:2},items:{prop:"items",type:["slider","list","grid","masonry","false"]},"single-item":{prop:"singleItem",type:"boolean"},header:{prop:"header",type:"boolean"},panel:{prop:"panel",type:"boolean"},download:{prop:"download",type:"boolean"},languages:{prop:"languages",type:"boolean"},"panel-open":{prop:"defaultPanelOpen",type:"boolean"},"panel-layout":{prop:"panelLayout",type:["accordion","tabs"]},"panel-sections":{prop:"panelSections",type:"data"},"panel-labels":{prop:"panelLabels",type:"data"},"sidebar-open":{prop:"defaultSidebarOpen",type:"boolean"},"storage-key":{prop:"storageKey",type:"string"},fill:{prop:"fill",type:"boolean"},"collapse-controls":{prop:"collapseControls",type:["auto","always"]},size:{prop:"size",type:"string"},height:{prop:"height",type:"string"},gap:{prop:"gap",type:"string"},secondary:{prop:"secondary",type:["summary","navDate","none"]},summary:{prop:"summary",type:"boolean"},"lightbox-items":{prop:"lightboxItems",type:["slider","pager"]}},properties:["iiifContent","annotations","request","renderers","canvasOptions"],events:{"clover-canvas-change":{prop:"onCanvasChange",detail:["canvasId"]},"clover-manifest-change":{prop:"onManifestChange",detail:["manifestId"]},"clover-status-change":{prop:"onStatusChange",detail:["status","error"]},"clover-content-state-change":{prop:"onContentStateChange",detail:"first"}}};sv(Dv.mapWorkerUrl);ql(zv,()=>Promise.resolve($v));export{lu as $,$ as A,lm as B,ee as C,dl as D,vo as E,rv as F,dv as G,kv as H,of as I,cv as J,it as K,en as L,ou as M,Kh as N,Qv as O,jm as P,jh as Q,Zd as R,Vm as S,vt as T,_t as U,mt as V,la as W,ue as X,zt as Y,Ld as Z,Dt as _,de as a,ff as a$,ny as a0,Xr as a1,Gc as a2,Xc as a3,En as a4,Yc as a5,nd as a6,bt as a7,vs as a8,ut as a9,ch as aA,dc as aB,ic as aC,ih as aD,ah as aE,kf as aF,Ec as aG,Sd as aH,is as aI,Xh as aJ,Ui as aK,cf as aL,mc as aM,Gt as aN,pf as aO,sh as aP,xf as aQ,Fe as aR,Yd as aS,uh as aT,Sn as aU,lf as aV,nf as aW,uf as aX,df as aY,yc as aZ,hf as a_,At as aa,nc as ab,bd as ac,He as ad,Pt as ae,Eo as af,Mt as ag,Um as ah,oe as ai,Wm as aj,wo as ak,qr as al,Kr as am,Pn as an,up as ao,Gi as ap,Zi as aq,Rc as ar,fs as as,Zh as at,Xi as au,Yr as av,xo as aw,H as ax,ae as ay,wf as az,Eu as b,hd as b$,ed as b0,tg as b1,eg as b2,Hh as b3,ye as b4,Pg as b5,Jv as b6,Gv as b7,Uv as b8,Ya as b9,Ja as bA,an as bB,Jr as bC,ps as bD,xd as bE,Xv as bF,jf as bG,Pe as bH,sr as bI,ns as bJ,Xu as bK,rh as bL,xv as bM,Rn as bN,fm as bO,hm as bP,Zr as bQ,lp as bR,Ln as bS,sy as bT,Wc as bU,Qt as bV,id as bW,Hf as bX,Jc as bY,rf as bZ,Nd as b_,ry as ba,De as bb,Sc as bc,eh as bd,rl as be,qa as bf,oy as bg,vd as bh,ts as bi,jv as bj,Qo as bk,ls as bl,dg as bm,_o as bn,Je as bo,Dh as bp,tc as bq,Co as br,un as bs,cc as bt,uv as bu,il as bv,Ti as bw,ud as bx,Pc as by,Wf as bz,Ac as c,Ga as c0,op as c1,ld as c2,cn as c3,An as c4,Ir as c5,Gf as c6,hc as c7,Vv as c8,qv as c9,Kv as ca,rp as cb,Gp as cc,Vi as cd,Yh as ce,Jh as cf,Yv as cg,le as ch,ne as ci,eo as cj,Gm as ck,Qc as cl,Zv as cm,Wg as cn,cs as co,pm as cp,pc as cq,Dl as cr,vm as cs,qh as d,z as e,fe as f,ty as g,ey as h,Ev as i,bv as j,Ct as k,vv as l,hv as m,mu as n,We as o,nl as p,dt as q,ms as r,gm as s,qc as t,f as u,sn as v,ol as w,ie as x,D as y,ov as z};
|