@nulib/clover 4.6.0 → 4.6.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 +18 -4
- package/dist/components/Canvas/Connected.mjs +1 -1
- package/dist/components/Canvas/LoadedCanvas.mjs +26 -6
- package/dist/components/Canvas/Placeholder.mjs +1 -1
- package/dist/components/Canvas/media/Player.mjs +2 -2
- package/dist/components/CollectionSelect/CollectionSelect.mjs +6 -4
- package/dist/components/Items/Items.mjs +2 -5
- package/dist/components/Items/Position.mjs +2 -5
- package/dist/components/Items/StandaloneItems.mjs +6 -0
- package/dist/components/Map/MapView.mjs +2 -8
- package/dist/components/Root/useRootState.mjs +15 -14
- package/dist/components/Scene/Loaded.mjs +5 -1
- package/dist/core/clover.mjs +38 -10
- package/dist/core/geo.mjs +5 -4
- package/dist/core/selectors.mjs +7 -1
- package/dist/index.d.mts +14 -2
- package/dist/lib/renderer/CanvasRenderer.mjs +4 -3
- package/dist/map/index.d.mts +2 -1
- package/dist/ui/EntryThumbnail.mjs +6 -3
- package/dist/web-components/About-I4h1cfup.mjs +1 -0
- package/dist/web-components/AnnotationItems-BfQm1YRD.mjs +1 -0
- package/dist/web-components/{AnnotationMenu-4PN2LNP-.mjs → AnnotationMenu-guk9SbaL.mjs} +1 -1
- package/dist/web-components/{AnnotationState-3KHHmQhl.mjs → AnnotationState-BX7xh-bd.mjs} +1 -1
- package/dist/web-components/{Annotations-BwKS6fG8.mjs → Annotations-BJrje3Ey.mjs} +1 -1
- package/dist/web-components/{Annotations-CPUvoKJe.mjs → Annotations-DBxLDLDf.mjs} +1 -1
- package/dist/web-components/{Body-CTzmxY8R.mjs → Body-CQuiRv9p.mjs} +1 -1
- package/dist/web-components/{BodyAlert-CXOxbNBE.mjs → BodyAlert-DF9rnG5o.mjs} +1 -1
- package/dist/web-components/{Button-a59NBnOp.mjs → Button-qhI73GCI.mjs} +1 -1
- package/dist/web-components/{Camera-BlbXBgYZ.mjs → Camera-D2MnETlC.mjs} +1 -1
- package/dist/web-components/{Canvas2DBackend-DXCfms6g.mjs → Canvas2DBackend-kJpOk_Pb.mjs} +1 -1
- package/dist/web-components/CanvasView-B752g1bm.mjs +2 -0
- package/dist/web-components/{CaptionDetails-CCCTWTQP.mjs → CaptionDetails-Cl3fLJfr.mjs} +1 -1
- package/dist/web-components/ChaptersMenu-CB4zdVOh.mjs +1 -0
- package/dist/web-components/{Chevron-CH8yyEDi.mjs → Chevron-CT1ntI6B.mjs} +1 -1
- package/dist/web-components/{ChoiceMenu-BQVTRzXj.mjs → ChoiceMenu-DoXMSLjk.mjs} +1 -1
- package/dist/web-components/{Collection-CbEMQWrO.mjs → Collection-B8ipKdPl.mjs} +1 -1
- package/dist/web-components/CollectionSelect-C0Tunk6c.mjs +1 -0
- package/dist/web-components/{Connected-Dq0xux9o.mjs → Connected-DaP_DgGw.mjs} +1 -1
- package/dist/web-components/{Connected-C31vzWei.mjs → Connected-L47VwCva.mjs} +1 -1
- package/dist/web-components/Connected-shq2_tc-.mjs +1 -0
- package/dist/web-components/{Contents-CGc6_Z5c.mjs → Contents-_u13TaBJ.mjs} +1 -1
- package/dist/web-components/{ControlMenu-ej-Kpb31.mjs → ControlMenu-BW39OjKC.mjs} +1 -1
- package/dist/web-components/ControlsFade-LFHufW32.mjs +1 -0
- package/dist/web-components/{CountMenu-D4M1roIh.mjs → CountMenu-CQ7ThPWJ.mjs} +1 -1
- package/dist/web-components/Cue-B1IlY4Ae.mjs +1 -0
- package/dist/web-components/{Document-CPQELxSI.mjs → Document-BChOw20c.mjs} +1 -1
- package/dist/web-components/{DomLayers-DwhkzPRS.mjs → DomLayers-BIFA6J56.mjs} +1 -1
- package/dist/web-components/{Download-Dsei4KG3.mjs → Download-BfZJVu-O.mjs} +1 -1
- package/dist/web-components/{EntryBodies-BI7V3B5i.mjs → EntryBodies-Bld2RXeE.mjs} +1 -1
- package/dist/web-components/EntryThumbnail-C5df3CaH.mjs +1 -0
- package/dist/web-components/{FieldPill-BOeOasUT.mjs → FieldPill-Dx--yBoK.mjs} +1 -1
- package/dist/web-components/FrameAnimation-CpniJMTK.mjs +1 -0
- package/dist/web-components/{Gallery-BDGDzt0R.mjs → Gallery-CkaSdVAP.mjs} +1 -1
- package/dist/web-components/{GlobeGlyph-9zKXX7B6.mjs → GlobeGlyph-CCi1sZgm.mjs} +1 -1
- package/dist/web-components/{HideToggle-CmwFnHcZ.mjs → HideToggle-nvJtMFOZ.mjs} +1 -1
- package/dist/web-components/{ImageControls-CSHxdUD1.mjs → ImageControls-Df-M7F2R.mjs} +1 -1
- package/dist/web-components/Items-BsKByN_b.mjs +1 -0
- package/dist/web-components/{ItemsVertical-BeIiJ37B.mjs → ItemsVertical-Dmhm1DBy.mjs} +1 -1
- package/dist/web-components/Label-DElSTYS5.mjs +1 -0
- package/dist/web-components/{LanguageChoice-D_vEiQp9.mjs → LanguageChoice-t55qbd8x.mjs} +1 -1
- package/dist/web-components/{LanguageMenu-ycNvnbOB.mjs → LanguageMenu-BlFBWRSO.mjs} +1 -1
- package/dist/web-components/{LightboxView-CsOAsZ3f.mjs → LightboxView-BhPao9ao.mjs} +1 -1
- package/dist/web-components/{ListEnd-B6tyeK1B.mjs → ListEnd-KSoUQrsM.mjs} +1 -1
- package/dist/web-components/Loaded-uGqT3xyD.mjs +1 -0
- package/dist/web-components/LoadedCanvas-fqjWHH0H.mjs +3 -0
- package/dist/web-components/LoadedMap-BpRHQPoU.mjs +1 -0
- package/dist/web-components/{Loading-CAkF1fBT.mjs → Loading-DSaV1vxb.mjs} +1 -1
- package/dist/web-components/{Map-BDsBYSp5.mjs → Map-CUY8HEgh.mjs} +1 -1
- package/dist/web-components/MapView-DIVMYZZ1.mjs +3 -0
- package/dist/web-components/{Markup-COA2t_y1.mjs → Markup-DzUsOaNC.mjs} +1 -1
- package/dist/web-components/{MediaBody-CNk9fFfN.mjs → MediaBody-CJELKAWJ.mjs} +1 -1
- package/dist/web-components/{MediaBody-XsEObuYV.mjs → MediaBody-CN2ZTxK0.mjs} +1 -1
- package/dist/web-components/{NavDate-1LLiZ8Vq.mjs → NavDate-CD3sFxZJ.mjs} +1 -1
- package/dist/web-components/{Navigator-t1y35uj8.mjs → Navigator-CVDhe8R_.mjs} +1 -1
- package/dist/web-components/{Pager-35N8_3lH.mjs → Pager-BmZaB--9.mjs} +1 -1
- package/dist/web-components/PagerLayout-DhIz3hKA.mjs +1 -0
- package/dist/web-components/{Panel-D16u98YB.mjs → Panel-CdJyJVBh.mjs} +1 -1
- package/dist/web-components/PanelPart-m2QWHh_4.mjs +1 -0
- package/dist/web-components/{PanelToggle-BcUVIbQw.mjs → PanelToggle-BqVj7sX0.mjs} +1 -1
- package/dist/web-components/PartOfManifest-Dgw1shMM.mjs +1 -0
- package/dist/web-components/{Pending-bIYd0PwB.mjs → Pending-CDXsIk5O.mjs} +1 -1
- package/dist/web-components/{PlaceBox-D-pLIX5w.mjs → PlaceBox-DNnl9coD.mjs} +1 -1
- package/dist/web-components/Placeholder-D8Sabput.mjs +1 -0
- package/dist/web-components/Position-oFMJoo4P.mjs +1 -0
- package/dist/web-components/{Primitives-DP2uwwcU.mjs → Primitives-BdXIEpYW.mjs} +1 -1
- package/dist/web-components/{Provider-BUDzNTyJ.mjs → Provider-DWIlPOzR.mjs} +1 -1
- package/dist/web-components/{ReadMore-B6qft77s.mjs → ReadMore-f34RbHMm.mjs} +1 -1
- package/dist/web-components/{Root-J9v7nQ6o.mjs → Root-CEtLCE4Y.mjs} +1 -1
- package/dist/web-components/Scene-BJE8miZL.mjs +1 -0
- package/dist/web-components/{SceneView-DykQJepG.mjs → SceneView-D635_fRV.mjs} +1 -1
- package/dist/web-components/{Search-DEoFdx2g.mjs → Search-219u7M8o.mjs} +1 -1
- package/dist/web-components/{Sections-B6j9eFao.mjs → Sections-C3fPhGNx.mjs} +1 -1
- package/dist/web-components/{SeekMarks-C3ZDOMbt.mjs → SeekMarks-Ds8v3SaW.mjs} +1 -1
- package/dist/web-components/StandaloneItems-Mdh-k3w9.mjs +1 -0
- package/dist/web-components/{Status-C49DxNaY.mjs → Status-CEkhPlDF.mjs} +1 -1
- package/dist/web-components/{Steps-BTAJ3lc6.mjs → Steps-BoNd47eB.mjs} +1 -1
- package/dist/web-components/{TargetItems-BZFSWVs6.mjs → TargetItems-dFjJs-VP.mjs} +1 -1
- package/dist/web-components/Timeline-DPdS6bYG.mjs +1 -0
- package/dist/web-components/{Tip-Dv-gYN8n.mjs → Tip-mcI7IRQh.mjs} +1 -1
- package/dist/web-components/{Transcript-FmC6HR0-.mjs → Transcript-5wVgmZmU.mjs} +1 -1
- package/dist/web-components/{Transport-BKFLjI45.mjs → Transport-DYjd2GnA.mjs} +1 -1
- package/dist/web-components/{Transport-pRWbs9M3.mjs → Transport-DdNRlSa0.mjs} +1 -1
- package/dist/web-components/{annotation-collection-Dc-peX7w.mjs → annotation-collection-C3UpNV1K.mjs} +1 -1
- package/dist/web-components/{annotation-name-BhbhOgES.mjs → annotation-name-DhMF4ZHj.mjs} +1 -1
- package/dist/web-components/{annotations-content-BJSUCNd1.mjs → annotations-content-CuWJZr4t.mjs} +1 -1
- package/dist/web-components/{body-BEZ3sYcR.mjs → body-Bym9Uvav.mjs} +1 -1
- package/dist/web-components/canvas-BIXBggVo.mjs +1 -0
- package/dist/web-components/{cloverEngine-BstElW9l.mjs → cloverEngine-BEdb3g52.mjs} +1 -1
- package/dist/web-components/{content-state-reader-DGOg8oAH.mjs → content-state-reader-BGZEChSM.mjs} +1 -1
- package/dist/web-components/{controlGlyphs-Lxfq7zz4.mjs → controlGlyphs-DMQCxKaT.mjs} +1 -1
- package/dist/web-components/{controls-BibZpBh1.mjs → controls-B1pIwRgH.mjs} +1 -1
- package/dist/web-components/{downloads-cYib41PV.mjs → downloads-DwzBIS-9.mjs} +1 -1
- package/dist/web-components/{dragToClose-BpzjNnPx.mjs → dragToClose-BYUJ9qgo.mjs} +1 -1
- package/dist/web-components/{engine-Cl755NaO.mjs → engine-DUv-Syum.mjs} +1 -1
- package/dist/web-components/{engines-fZzYf1dz.mjs → engines-BzM_oBU_.mjs} +1 -1
- package/dist/web-components/{fetchManifest-D31pEPrb.mjs → fetchManifest-Cp7c8vs5.mjs} +1 -1
- package/dist/web-components/{follow-content-Byosc3Ev.mjs → follow-content-CmXq05TW.mjs} +1 -1
- package/dist/web-components/{fromManifest-DqCyZd2Q.mjs → fromManifest-DbgwTeBo.mjs} +1 -1
- package/dist/web-components/{glyphs-8fjIPAtZ.mjs → glyphs-atKuagcd.mjs} +1 -1
- package/dist/web-components/{hooks-Bo5GjPGX.mjs → hooks-DhTYPPVG.mjs} +1 -1
- package/dist/web-components/image-layers-CoBPhMZw.mjs +1 -0
- package/dist/web-components/{image-service-content-bUFBZCr1.mjs → image-service-content-CL_EZugL.mjs} +1 -1
- package/dist/web-components/{imageService-CCKieCxo.mjs → imageService-BoQQvo1U.mjs} +1 -1
- package/dist/web-components/{index-DhlRi3H9.mjs → index-Ciz5x8Tt.mjs} +1 -1
- package/dist/web-components/index.mjs +1 -1
- package/dist/web-components/{items-CKMFXz0W.mjs → items-CjtUJjSU.mjs} +1 -1
- package/dist/web-components/items-DiQ3K5TV.mjs +1 -0
- package/dist/web-components/label-CKgFcOzZ.mjs +1 -0
- package/dist/web-components/{layout-DQtgCOJJ.mjs → layout-zjkkOHIj.mjs} +1 -1
- package/dist/web-components/{link-q4quIuuD.mjs → link-CrNaByf-.mjs} +1 -1
- package/dist/web-components/logo-C2xm9WAL.mjs +1 -0
- package/dist/web-components/{models-Dw-cADIz.mjs → models-BFKa5v_H.mjs} +1 -1
- package/dist/web-components/{nodes-nZmQ93ib.mjs → nodes-BDyXzQhk.mjs} +1 -1
- package/dist/web-components/{overlayImage-B-ybt0wn.mjs → overlayImage-BGxovfPN.mjs} +1 -1
- package/dist/web-components/{panel-C27fOmhT.mjs → panel-rEGhe5fL.mjs} +1 -1
- package/dist/web-components/part-PF-s_vD-.mjs +1 -0
- package/dist/web-components/{playerSurface-BLzwC0Ux.mjs → playerSurface-BthXi9l2.mjs} +1 -1
- package/dist/web-components/{pointer-BYZjBehK.mjs → pointer-C22ufJ5w.mjs} +1 -1
- package/dist/web-components/{provider-Cs6sFr4G.mjs → provider-B2C3eH9p.mjs} +1 -1
- package/dist/web-components/{range-regions-DssQTTra.mjs → range-regions-Ytq4QkMX.mjs} +1 -1
- package/dist/web-components/{read-more-Cp9CLzyd.mjs → read-more-B7LHzF4-.mjs} +1 -1
- package/dist/web-components/{readingLanguages-D97yt-4s.mjs → readingLanguages-B20n_dkw.mjs} +1 -1
- package/dist/web-components/{rendererSurface-BuBm8Th_.mjs → rendererSurface-BfZP5clN.mjs} +2 -2
- package/dist/web-components/{renderers-BL-b8snn.mjs → renderers-C569MeQB.mjs} +1 -1
- package/dist/web-components/{resource-DwKOZbOZ.mjs → resource-C5cMic8z.mjs} +1 -1
- package/dist/web-components/{save-file-CcfAgDXf.mjs → save-file-DsYdCZpi.mjs} +1 -1
- package/dist/web-components/{search-C45Jd7QH.mjs → search-kJ_71fbN.mjs} +1 -1
- package/dist/web-components/shared-ByrLMUQa.mjs +1 -0
- package/dist/web-components/{show-link-D9bByIzf.mjs → show-link-BqrJDDMV.mjs} +1 -1
- package/dist/web-components/{sizedImage-BFAry04f.mjs → sizedImage-CyCf0GtL.mjs} +1 -1
- package/dist/web-components/{split-CDZiE4rz.mjs → split-BZRKCI3g.mjs} +1 -1
- package/dist/web-components/{status-BtCciELI.mjs → status-CwO2mygB.mjs} +1 -1
- package/dist/web-components/{styles-Bf3qmdsh.mjs → styles-BOXm_R8o.mjs} +1 -1
- package/dist/web-components/three.mjs +1 -1
- package/dist/web-components/thumbnail-Np4ftjUo.mjs +1 -0
- package/dist/web-components/{tip-_XUeFMj4.mjs → tip-CNyxI6xd.mjs} +1 -1
- package/dist/web-components/{toggle-DkPNS5eL.mjs → toggle-lop2se80.mjs} +1 -1
- package/dist/web-components/{useContainerName-BfU0IozO.mjs → useContainerName-DR_6TyDU.mjs} +1 -1
- package/dist/web-components/{useControlsVisibility-pU1JVIpK.mjs → useControlsVisibility-Dig_1-0T.mjs} +1 -1
- package/dist/web-components/{useNearViewport-D1kQt-tS.mjs → useNearViewport-B_kjW0WB.mjs} +1 -1
- package/dist/web-components/{useScrollTrack-cQfG_zk_.mjs → useScrollTrack-6BV6IizZ.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationItems-UHFS1uDO.mjs → AnnotationItems-BDFH_6F_.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationMenu-0Ru0csCz.mjs → AnnotationMenu-BHCrJoNx.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationState-hEds2Tpa.mjs → AnnotationState-BV0fzlj8.mjs} +1 -1
- package/dist/web-components/viewer/{Annotations-Oprg7015.mjs → Annotations-BhA_Bbyj.mjs} +1 -1
- package/dist/web-components/viewer/{Annotations-vzP6-fS4.mjs → Annotations-DEqkGlE1.mjs} +1 -1
- package/dist/web-components/viewer/{Canvas2DBackend-3b5xEKac.mjs → Canvas2DBackend-Bq_bo1mL.mjs} +1 -1
- package/dist/web-components/viewer/{CaptionDetails-DDIjm-rC.mjs → CaptionDetails-D6Gd_EGS.mjs} +1 -1
- package/dist/web-components/viewer/ChaptersMenu-DE2TFesS.mjs +1 -0
- package/dist/web-components/viewer/{ChoiceMenu-COUDRKGM.mjs → ChoiceMenu-BVlpPUhr.mjs} +1 -1
- package/dist/web-components/viewer/{Collection-kWUradiW.mjs → Collection-DIgmeOCD.mjs} +1 -1
- package/dist/web-components/viewer/{Connected-B2TrgX9-.mjs → Connected-7TgFouaR.mjs} +1 -1
- package/dist/web-components/viewer/{Connected-FiJKHEv9.mjs → Connected-D9dz_v1p.mjs} +1 -1
- package/dist/web-components/viewer/{Contents-DHyzbjco.mjs → Contents-ROI1iuuR.mjs} +1 -1
- package/dist/web-components/viewer/{ControlMenu-DWi6tgKb.mjs → ControlMenu-CZlN7x0D.mjs} +1 -1
- package/dist/web-components/viewer/ControlsFade-QEgqI3wY.mjs +1 -0
- package/dist/web-components/viewer/{CountMenu-BYU6T0Ou.mjs → CountMenu-CCEH_rEu.mjs} +1 -1
- package/dist/web-components/viewer/{Cue-Ct2isFl7.mjs → Cue-CLbO9g2X.mjs} +1 -1
- package/dist/web-components/viewer/{Document-BtN3vmsO.mjs → Document-8ADB98RM.mjs} +1 -1
- package/dist/web-components/viewer/{DomLayers-CEzVM7HQ.mjs → DomLayers-BXPbPq1a.mjs} +1 -1
- package/dist/web-components/viewer/{Download-5BsnDZLL.mjs → Download-YfjzAcAF.mjs} +1 -1
- package/dist/web-components/viewer/{EntryBodies-D9R-wouw.mjs → EntryBodies-B2DBmUYl.mjs} +1 -1
- package/dist/web-components/viewer/EntryThumbnail-B2cRaP5D.mjs +1 -0
- package/dist/web-components/viewer/{FieldPill-CsyRt9Xh.mjs → FieldPill-C7o8586T.mjs} +1 -1
- package/dist/web-components/viewer/{FrameAnimation-f4RKtdpP.mjs → FrameAnimation-CytZC2Lx.mjs} +1 -1
- package/dist/web-components/viewer/{Gallery-DC4QY9lG.mjs → Gallery-CQma5dBZ.mjs} +1 -1
- package/dist/web-components/viewer/{GlobeGlyph-BwZm2Ffj.mjs → GlobeGlyph-UxhwZJy1.mjs} +1 -1
- package/dist/web-components/viewer/{HideToggle-BD6zlrz3.mjs → HideToggle-DZMCACLG.mjs} +1 -1
- package/dist/web-components/viewer/{ImageControls-Bw9a17cS.mjs → ImageControls-fzFWqFVh.mjs} +1 -1
- package/dist/web-components/viewer/{LanguageChoice-CcDmpHnE.mjs → LanguageChoice-B8F2WhUM.mjs} +1 -1
- package/dist/web-components/viewer/{LanguageMenu-CRtM-mLy.mjs → LanguageMenu-BIpATvd4.mjs} +1 -1
- package/dist/web-components/viewer/{LightboxView-DJoH23fL.mjs → LightboxView-D-6yYXCc.mjs} +1 -1
- package/dist/web-components/viewer/{ListEnd-CSp0KGGZ.mjs → ListEnd-DhrDIRKM.mjs} +1 -1
- package/dist/web-components/viewer/MapView-XFUp4DVX.mjs +3 -0
- package/dist/web-components/viewer/{MediaBody-CMddJWMF.mjs → MediaBody-C3fVbzuD.mjs} +1 -1
- package/dist/web-components/viewer/{NavDate-BJ_MF_t1.mjs → NavDate-B47wyKdc.mjs} +1 -1
- package/dist/web-components/viewer/{Navigator-Gt56cM6f.mjs → Navigator-BqNBxE5l.mjs} +1 -1
- package/dist/web-components/viewer/{PagerLayout-BMrlMLfO.mjs → PagerLayout-DKdFxLZ1.mjs} +1 -1
- package/dist/web-components/viewer/PanelPart-CuddftmQ.mjs +1 -0
- package/dist/web-components/viewer/{PartOfManifest-BdZWbAQI.mjs → PartOfManifest-DF40jLNB.mjs} +1 -1
- package/dist/web-components/viewer/{PlaceBox-C27N2KG8.mjs → PlaceBox-Bi1inmQv.mjs} +1 -1
- package/dist/web-components/viewer/{Placeholder-BX2y25Fo.mjs → Placeholder-BhAzmG0d.mjs} +1 -1
- package/dist/web-components/viewer/{Search-auUpOyeS.mjs → Search-CTkCx-SZ.mjs} +1 -1
- package/dist/web-components/viewer/{SeekMarks-Bg0PLdp0.mjs → SeekMarks-8NvVfr4F.mjs} +1 -1
- package/dist/web-components/viewer/StandaloneItems-P1ygiZtX.mjs +1 -0
- package/dist/web-components/viewer/{Steps-ABKs2V_m.mjs → Steps-DwqiM7sH.mjs} +1 -1
- package/dist/web-components/viewer/{TargetItems-BQVUKMAs.mjs → TargetItems-B873PbFR.mjs} +1 -1
- package/dist/web-components/viewer/{Transcript-DaShc1z-.mjs → Transcript-D7cFMWGk.mjs} +1 -1
- package/dist/web-components/viewer/{Transport-ClkPaaOB.mjs → Transport-DPURF464.mjs} +1 -1
- package/dist/web-components/viewer/{Transport-6wRUIGiD.mjs → Transport-TvkdinN-.mjs} +1 -1
- package/dist/web-components/viewer/{annotation-collection-eyRpE2h4.mjs → annotation-collection-BwY8uYqa.mjs} +1 -1
- package/dist/web-components/viewer/{annotation-name-DdchUvJI.mjs → annotation-name-DQMCd2DB.mjs} +1 -1
- package/dist/web-components/viewer/{annotations-content-BZXlT3bR.mjs → annotations-content-q11OcPdT.mjs} +1 -1
- package/dist/web-components/viewer/{cloverEngine-CZWHXlyY.mjs → cloverEngine-K2HNl3W1.mjs} +1 -1
- package/dist/web-components/viewer/{content-state-reader-CDV0Igdx.mjs → content-state-reader-BhDMcVmC.mjs} +1 -1
- package/dist/web-components/viewer/{dragToClose-CD-MJb-V.mjs → dragToClose-BFhEkxmf.mjs} +1 -1
- package/dist/web-components/viewer/{fetchManifest-C1IEIf45.mjs → fetchManifest-aJRqlL7Q.mjs} +1 -1
- package/dist/web-components/viewer/{follow-content-IQqCbvbJ.mjs → follow-content-Cy0flRSN.mjs} +1 -1
- package/dist/web-components/viewer/{host-BxQrzQnu.mjs → host-C4OSSUrc.mjs} +1 -1
- package/dist/web-components/viewer/{image-layers-DurrQgfL.mjs → image-layers-BmOyugIr.mjs} +1 -1
- package/dist/web-components/viewer/{image-service-content-ClAm_g0Y.mjs → image-service-content-BuqFuXBZ.mjs} +1 -1
- package/dist/web-components/viewer/index.mjs +1 -1
- package/dist/web-components/viewer/{link-Drdj-HcB.mjs → link-BtdcvLLg.mjs} +1 -1
- package/dist/web-components/viewer/overlayImage-BOilakHT.mjs +1 -0
- package/dist/web-components/viewer/{range-regions-a5eVBfJy.mjs → range-regions-S1HcVfpb.mjs} +1 -1
- package/dist/web-components/viewer/{renderers-CdXzZ9As.mjs → renderers-CetbXlHH.mjs} +1 -1
- package/dist/web-components/viewer/{save-file-B2UBQRXz.mjs → save-file-BohgaD35.mjs} +1 -1
- package/dist/web-components/viewer/{search-BBZKUiMB.mjs → search-C0ZHXQW-.mjs} +1 -1
- package/dist/web-components/viewer/{useControlsVisibility-BfTACzo_.mjs → useControlsVisibility-CmA6PMfv.mjs} +1 -1
- package/dist/web-components/viewer/viewer-BXbkj7DJ.mjs +29 -0
- package/dist/web-components/viewer/{vtt-CCkTp_f2.mjs → vtt-BIJk7HEl.mjs} +1 -1
- package/dist/web-components/{viewer-D-AQ7mGw.mjs → viewer-f_6tefcG.mjs} +1 -1
- package/dist/web-components/{vtt-BjXkNfI_.mjs → vtt-BRwnCWbJ.mjs} +1 -1
- package/package.json +1 -1
- package/dist/web-components/About-Brbhm22a.mjs +0 -1
- package/dist/web-components/AnnotationItems-Dy4BNabL.mjs +0 -1
- package/dist/web-components/CanvasView-CiP25Iqc.mjs +0 -2
- package/dist/web-components/ChaptersMenu-Bne6N9cf.mjs +0 -1
- package/dist/web-components/CollectionSelect-BpvtCwSl.mjs +0 -1
- package/dist/web-components/Connected-BWomgzfE.mjs +0 -1
- package/dist/web-components/ControlsFade-CStkqANR.mjs +0 -1
- package/dist/web-components/Cue-BhXRUDe9.mjs +0 -1
- package/dist/web-components/EntryThumbnail-BnMLzy5M.mjs +0 -1
- package/dist/web-components/FrameAnimation-BcEfAQrI.mjs +0 -1
- package/dist/web-components/Items-DCRr750U.mjs +0 -1
- package/dist/web-components/Label-CVfL9bMO.mjs +0 -1
- package/dist/web-components/Loaded-CSYg8oIR.mjs +0 -1
- package/dist/web-components/LoadedCanvas-W9sCFkdf.mjs +0 -1
- package/dist/web-components/LoadedMap-jx7uEeDg.mjs +0 -1
- package/dist/web-components/MapView-DO23FSrT.mjs +0 -3
- package/dist/web-components/PagerLayout-SNT5cl4D.mjs +0 -1
- package/dist/web-components/PanelPart-DfjlK_hB.mjs +0 -1
- package/dist/web-components/PartOfManifest-BYyflVQI.mjs +0 -1
- package/dist/web-components/Placeholder-Mq1Iaasr.mjs +0 -1
- package/dist/web-components/Position-Bh1Iq4d6.mjs +0 -1
- package/dist/web-components/Scene-CdqC1O-B.mjs +0 -1
- package/dist/web-components/StandaloneItems-CtxMB090.mjs +0 -1
- package/dist/web-components/Timeline-D5oL1UyW.mjs +0 -1
- package/dist/web-components/canvas-CfnKZqTU.mjs +0 -1
- package/dist/web-components/image-layers-CFarmTfZ.mjs +0 -1
- package/dist/web-components/items-BXd02UN6.mjs +0 -1
- package/dist/web-components/label-DcF-YCIN.mjs +0 -1
- package/dist/web-components/logo-DWI0N9FL.mjs +0 -1
- package/dist/web-components/part-B9t8Qe9D.mjs +0 -1
- package/dist/web-components/shared-D2pvbPvF.mjs +0 -1
- package/dist/web-components/thumbnail-By5wfGlE.mjs +0 -1
- package/dist/web-components/viewer/ChaptersMenu-DmJy-cfd.mjs +0 -1
- package/dist/web-components/viewer/ControlsFade-CuooJOpa.mjs +0 -1
- package/dist/web-components/viewer/EntryThumbnail-P6CmjmO9.mjs +0 -1
- package/dist/web-components/viewer/MapView-BO2ppZpW.mjs +0 -3
- package/dist/web-components/viewer/PanelPart-CaxBca8z.mjs +0 -1
- package/dist/web-components/viewer/StandaloneItems-CBRWUCNf.mjs +0 -1
- package/dist/web-components/viewer/overlayImage-CDT5ohRo.mjs +0 -1
- package/dist/web-components/viewer/viewer-BrkFZVo_.mjs +0 -29
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Bt=Object.defineProperty;var Ot=(n,t,e)=>t in n?Bt(n,t,{enumerable:true,configurable:true,writable:true,value:e}):n[t]=e;var h=(n,t,e)=>Ot(n,typeof t!="symbol"?t+"":t,e);import{c as Ct,r as et}from"./contexts-ByL3eA_T.mjs";import{c as A,s as I,t as S,a as Dt,u as D,i as zt,b as Et,d as kt,e as Ut,r as Wt,f as C,g as Ft}from"./CanvasView-
|
|
1
|
+
var Bt=Object.defineProperty;var Ot=(n,t,e)=>t in n?Bt(n,t,{enumerable:true,configurable:true,writable:true,value:e}):n[t]=e;var h=(n,t,e)=>Ot(n,typeof t!="symbol"?t+"":t,e);import{c as Ct,r as et}from"./contexts-ByL3eA_T.mjs";import{c as A,s as I,t as S,a as Dt,u as D,i as zt,b as Et,d as kt,e as Ut,r as Wt,f as C,g as Ft}from"./CanvasView-B752g1bm.mjs";import{a as z,w as Nt,v as q,f as Ht,s as it,b as st,c as Zt}from"./Camera-D2MnETlC.mjs";import{i as nt,a as Gt,T as Xt,b as ot,c as rt,D as Kt,s as qt}from"./pointer-C22ufJ5w.mjs";import{a4 as Vt,a5 as Yt,a6 as $t}from"./shared-ByrLMUQa.mjs";import{a as Qt,i as at,f as jt}from"./imageService-BoQQvo1U.mjs";function Jt(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement?n.complete&&n.naturalWidth>0:true}function te(n,t){if(!n.bleed)return{x:0,y:0};const e=n.transform,i=Math.hypot(e.a,e.b)*t,s=Math.hypot(e.c,e.d)*t;return{x:n.bleed.right&&i>0?1/i:0,y:n.bleed.bottom&&s>0?1/s:0}}const ee=`#version 300 es
|
|
2
2
|
in vec2 a_position;
|
|
3
3
|
uniform mat3 u_matrix;
|
|
4
4
|
uniform vec4 u_crop;
|
|
@@ -19,4 +19,4 @@ out vec4 outColor;
|
|
|
19
19
|
void main() {
|
|
20
20
|
outColor = texture(u_texture, v_uv, ${ie.toFixed(1)}) * u_opacity;
|
|
21
21
|
}
|
|
22
|
-
`;class U{constructor(t,e,i){h(this,"kind","webgl2");h(this,"canvas");h(this,"maxTextureSize");h(this,"gl");h(this,"program",null);h(this,"vao",null);h(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});h(this,"textures",new Map);h(this,"cssWidth",1);h(this,"cssHeight",1);h(this,"pixelRatio",1);h(this,"matrixScratch",new Float32Array(9));h(this,"isLost",false);h(this,"callbacks");h(this,"handleLost",()=>{var t2,e2;this.isLost=true,this.textures.clear(),(e2=(t2=this.callbacks).onLost)==null||e2.call(t2)});this.canvas=t,this.gl=e,this.callbacks=i,this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)||4096;const s=ne(e,ee,se);this.program=s,this.uniforms={matrix:e.getUniformLocation(s,"u_matrix"),crop:e.getUniformLocation(s,"u_crop"),opacity:e.getUniformLocation(s,"u_opacity"),texture:e.getUniformLocation(s,"u_texture")};const o=e.createVertexArray();e.bindVertexArray(o);const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),e.STATIC_DRAW);const a=e.getAttribLocation(s,"a_position");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,false,0,0),e.bindVertexArray(null),this.vao=o,e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),t.addEventListener("webglcontextlost",this.handleLost)}static create(t,e={}){let i=null;try{i=t.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{i=null}if(!i||typeof i.createShader!="function")return null;try{return new U(t,i,e)}catch{return null}}resize(t,e,i){this.cssWidth=Math.max(1,t),this.cssHeight=Math.max(1,e),this.pixelRatio=i;const s=Math.max(1,Math.round(t*i)),o=Math.max(1,Math.round(e*i));this.canvas.width!==s&&(this.canvas.width=s),this.canvas.height!==o&&(this.canvas.height=o)}begin(){if(this.isLost)return;const t=this.gl;t.viewport(0,0,this.canvas.width,this.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(this.program),t.bindVertexArray(this.vao),t.activeTexture(t.TEXTURE0),t.uniform1i(this.uniforms.texture,0)}draw(t){if(this.isLost||!Jt(t.source))return"skipped";const e=this.gl,i=this.upload(t);if(i==="tainted")return"tainted";if(!i)return"skipped";const s=t.crop??{x:0,y:0,width:t.width,height:t.height},o=te(t,this.pixelRatio),r=A(t.transform,S(s.x,s.y),I(s.width+o.x,s.height+o.y));return e.uniformMatrix3fv(this.uniforms.matrix,false,Dt(r,this.cssWidth,this.cssHeight,this.matrixScratch)),e.uniform4f(this.uniforms.crop,s.x/t.width,s.y/t.height,s.width/t.width,s.height/t.height),e.uniform1f(this.uniforms.opacity,t.opacity),e.bindTexture(e.TEXTURE_2D,i.texture),e.drawArrays(e.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(t){return!this.isLost&&this.textures.has(t)}release(t){const e=this.textures.get(t);e&&(this.isLost||this.gl.deleteTexture(e.texture),this.textures.delete(t))}dispose(){var t;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const e of[...this.textures.keys()])this.release(e);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(t=this.gl.getExtension("WEBGL_lose_context"))==null||t.loseContext(),this.isLost=true}upload(t){const e=this.gl,i=this.textures.get(t.key);if(i&&i.width===t.width&&i.height===t.height)return i;const s=(i==null?void 0:i.texture)??e.createTexture();if(!s)return null;e.bindTexture(e.TEXTURE_2D,s);try{e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source)}catch(r){if(i||e.deleteTexture(s),oe(r))return"tainted";throw r}e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const o={texture:s,width:t.width,height:t.height};return this.textures.set(t.key,o),o}}function ne(n,t,e){const i=ht(n,n.VERTEX_SHADER,t),s=ht(n,n.FRAGMENT_SHADER,e),o=n.createProgram();if(!o)throw new Error("Could not create WebGL program");if(n.attachShader(o,i),n.attachShader(o,s),n.linkProgram(o),n.deleteShader(i),n.deleteShader(s),!n.getProgramParameter(o,n.LINK_STATUS)){const r=n.getProgramInfoLog(o);throw n.deleteProgram(o),new Error(`Could not link WebGL program: ${r}`)}return o}function ht(n,t,e){const i=n.createShader(t);if(!i)throw new Error("Could not create WebGL shader");if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){const s=n.getShaderInfoLog(i);throw n.deleteShader(i),new Error(`Could not compile WebGL shader: ${s}`)}return i}function oe(n){return typeof n=="object"&&n!==null&&n.name==="SecurityError"}const re=.09,ae=1e-4,ct=.05,he=1e-4;class ce{constructor(t,e=re,i){h(this,"current");h(this,"target",null);h(this,"timeConstant");h(this,"spring");h(this,"start");h(this,"elapsed",0);this.current={...t},this.start={...t},this.timeConstant=e,this.spring=i}get destination(){return this.target?{...this.target.state}:{...this.current}}set(t){this.current={...t},this.target=null}animateTo(t,e,i=false){const s=this.spring?this.spring.duration<=0:this.timeConstant===0;if(i||s){this.set(t.state);return}let o=t.anchor;if(o){const r=z(o.world,o.screen,t.state.zoom,t.state.rotation,e);Math.hypot(r.x-t.state.x,r.y-t.state.y)*t.state.zoom>ct&&(o=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...t.state},anchor:o}}stop(){this.target=null}step(t,e){const i=this.target;if(!i)return false;const s=i.state;let o,r;if(this.spring){this.elapsed+=Math.max(t,0);const g=this.elapsed/this.spring.duration;if(g>=1)return this.current={...s},this.target=null,false;const p=this.spring.stiffness;o=this.start,r=(1-Math.exp(-p*g))/(1-Math.exp(-p))}else o=this.current,r=1-Math.exp(-Math.max(t,0)/this.timeConstant);const a=Math.exp(Math.log(o.zoom)+(Math.log(s.zoom)-Math.log(o.zoom))*r),u=o.rotation+(s.rotation-o.rotation)*r,c=i.anchor?z(i.anchor.world,i.anchor.screen,a,u,e):{x:o.x+(s.x-o.x)*r,y:o.y+(s.y-o.y)*r};return this.current={x:c.x,y:c.y,zoom:a,rotation:u},this.spring?true:Math.abs(Math.log(s.zoom/a))<ae&&Math.abs(s.rotation-u)<he&&Math.hypot(s.x-c.x,s.y-c.y)*a<ct?(this.current={...s},this.target=null,false):true}}const V={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},N=2,lt=1.5,dt=.1,le=100,de=.002,ue=.01;class fe{constructor(t,e,i=V){h(this,"pointers",new Map);h(this,"samples",[]);h(this,"down",null);h(this,"pinch",null);h(this,"lastTap",null);h(this,"lastPointerType","");h(this,"penHovers",false);h(this,"onPointerDown",t2=>{var i2,s;if(this.lastPointerType=t2.pointerType,t2.pointerType==="mouse"&&t2.button!==0||nt(t2.target,this.element))return;(s=(i2=this.element).setPointerCapture)==null||s.call(i2,t2.pointerId);const e2=this.local(t2);this.pointers.set(t2.pointerId,e2),this.pointers.size===1?(this.down={x:e2.x,y:e2.y,t:t2.timeStamp,moved:false},this.samples=[{x:e2.x,y:e2.y,t:t2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});h(this,"onPointerMove",t2=>{var s;Gt(t2)&&(this.penHovers=true);const e2=this.pointers.get(t2.pointerId);if(!e2)return;const i2=this.local(t2);if(this.pointers.set(t2.pointerId,i2),this.pointers.size===1){const o=i2.x-e2.x,r=i2.y-e2.y;this.down&&Math.hypot(i2.x-this.down.x,i2.y-this.down.y)>Xt&&(this.down.moved=true),(s=this.down)!=null&&s.moved&&this.options.navigable&&this.target.panBy(o,r,!this.tracksPointer(t2.pointerType)),this.samples.push({x:i2.x,y:i2.y,t:t2.timeStamp});const a=t2.timeStamp-le;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 o=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(o.distance/this.pinch.distance,o.mid,false),this.target.panBy(o.mid.x-this.pinch.mid.x,o.mid.y-this.pinch.mid.y,false),this.pinch=o}});h(this,"onPointerUp",t2=>{var u,c,m,g,p,l;if(!this.pointers.has(t2.pointerId))return;if(this.pointers.delete(t2.pointerId),(c=(u=this.element).releasePointerCapture)==null||c.call(u,t2.pointerId),this.pointers.size===1){this.pinch=null;const[d]=this.pointers.values();this.samples=[{...d,t:t2.timeStamp}];return}if(this.pointers.size>0)return;const e2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!e2)return;const i2=this.local(t2);if(!e2.moved&&t2.type==="pointerup"&&t2.timeStamp-e2.t<ot){if((g=(m=this.target).dismiss)!=null&&g.call(m)){this.lastTap=null;return}if(rt(t2.pointerType,this.penHovers)){const d=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&d&&t2.timeStamp-d.t<ot&&Math.hypot(i2.x-d.x,i2.y-d.y)<Kt?(this.lastTap=null,this.zoomIn(i2)):this.lastTap={x:i2.x,y:i2.y,t:t2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?t2.shiftKey?this.target.zoomBy(1/N,i2,true):this.zoomIn(i2):(l=(p=this.target).tap)==null||l.call(p,i2);return}if(!this.options.navigable||!this.tracksPointer(t2.pointerType))return;const o=this.samples[0],r=this.samples[this.samples.length-1],a=((r==null?void 0:r.t)??0)-((o==null?void 0:o.t)??0);if(o&&r&&a>0&&t2.timeStamp-r.t<50){const d=(r.x-o.x)/a*1e3,w=(r.y-o.y)/a*1e3,f=this.options.flickMomentum;f>0&&Math.hypot(d,w)>this.options.flickMinSpeed&&this.target.panBy(d*f,w*f,true)}});h(this,"onDoubleClick",t2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||rt(this.lastPointerType,this.penHovers)||nt(t2.target,this.element)||(t2.shiftKey?this.target.zoomBy(1/N,this.local(t2),true):this.zoomIn(this.local(t2))))});h(this,"onWheel",t2=>{const e2=t2.ctrlKey;if(!this.options.navigable||!e2&&!this.options.scrollToZoom||!e2&&qt(t2.target,this.element,t2.deltaY))return;t2.preventDefault();const i2=me(t2),s=e2?ue:de;this.target.zoomBy(Math.exp(-i2*s),this.local(t2),!e2)});h(this,"onKeyDown",t2=>{if(t2.target!==this.element||!this.options.navigable||t2.altKey||t2.metaKey||t2.ctrlKey)return;const e2=this.element.getBoundingClientRect(),i2=e2.width*dt*(t2.shiftKey?3:1),s=e2.height*dt*(t2.shiftKey?3:1);switch(t2.key){case"ArrowLeft":this.target.panBy(i2,0,true);break;case"ArrowRight":this.target.panBy(-i2,0,true);break;case"ArrowUp":this.target.panBy(0,s,true);break;case"ArrowDown":this.target.panBy(0,-s,true);break;case"+":case"=":this.target.zoomBy(lt,void 0,true);break;case"-":case"_":this.target.zoomBy(1/lt,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}t2.preventDefault()});this.element=t,this.target=e,this.options=i,t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointermove",this.onPointerMove),t.addEventListener("pointerup",this.onPointerUp),t.addEventListener("pointercancel",this.onPointerUp),t.addEventListener("dblclick",this.onDoubleClick),t.addEventListener("wheel",this.onWheel,{passive:false}),t.addEventListener("keydown",this.onKeyDown)}setOptions(t){this.options=t}dispose(){const t=this.element;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("pointercancel",this.onPointerUp),t.removeEventListener("dblclick",this.onDoubleClick),t.removeEventListener("wheel",this.onWheel),t.removeEventListener("keydown",this.onKeyDown)}local(t){const e=this.element.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}zoomIn(t){var e,i;(i=(e=this.target).atMaxZoom)!=null&&i.call(e)?this.target.home():this.target.zoomBy(N,t,true)}tracksPointer(t){return t==="touch"||this.options.flickEnabled}pinchState(){const[t,e]=[...this.pointers.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),mid:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}}function me(n){return n.deltaMode===1?n.deltaY*16:n.deltaMode===2?n.deltaY*400:n.deltaY}class Lt extends Error{constructor(t,e,i){super(t),this.url=e,this.status=i,this.name="ImageLoadError"}}const ut=new Set;async function pe(n,t={}){const{signal:e,maxTextureSize:i,request:s}=t,o=Vt(s),r=we(n);if(typeof createImageBitmap!="function"||typeof fetch!="function")return H(n,{signal:e,cors:true,withCredentials:o});if(r&&ut.has(r))return H(n,{signal:e,cors:false,withCredentials:o});let a;try{a=await Yt(s,n,{mode:"cors",signal:e})}catch(p){if(ye(p,e))throw p;const l=await H(n,{signal:e,cors:false,withCredentials:o});return r&&ut.add(r),l}if(!a.ok)throw $t(a),new Lt(`Image request failed with ${a.status}`,n,a.status);const u=await a.blob();let c=await ge(u);const m=c.width,g=c.height;if(i&&(c.width>i||c.height>i)){const p=i/Math.max(c.width,c.height),l=await createImageBitmap(c,{resizeWidth:Math.max(1,Math.floor(c.width*p)),resizeHeight:Math.max(1,Math.floor(c.height*p)),resizeQuality:"high"});c.close(),c=l}if(e!=null&&e.aborted)throw c.close(),Y();return{kind:"bitmap",source:c,width:c.width,height:c.height,naturalWidth:m,naturalHeight:g,opaque:false}}async function ge(n){const t={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(n,t)}catch(e){if(e instanceof TypeError)return createImageBitmap(n);throw e}}function H(n,{signal:t,cors:e,withCredentials:i}){return new Promise((s,o)=>{if(t!=null&&t.aborted){o(Y());return}const r=new Image;r.decoding="async",e&&(r.crossOrigin=i?"use-credentials":"anonymous");const a=()=>{r.onload=null,r.onerror=null,t==null||t.removeEventListener("abort",u)},u=()=>{a(),r.src="",o(Y())};t==null||t.addEventListener("abort",u),r.onload=()=>{a();const c=()=>s({kind:"element",source:r,width:r.naturalWidth,height:r.naturalHeight,naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,opaque:!e});typeof r.decode=="function"?r.decode().then(c,c):c()},r.onerror=()=>{a(),o(new Lt("Image failed to load",n))},r.src=n})}function we(n){var t;try{return new URL(n,(t=globalThis.location)==null?void 0:t.href).origin}catch{return null}}function ye(n,t){return!!(t!=null&&t.aborted)||typeof n=="object"&&n!==null&&n.name==="AbortError"}function Y(){const n=new Error("Aborted");return n.name="AbortError",n}function ft(n){n.kind==="bitmap"&&n.source.close()}const xe=192*1024*1024,ve=16,be=2;class Te{constructor(t){h(this,"entries",new Map);h(this,"inFlight",0);h(this,"frame",0);h(this,"bytes",0);h(this,"wanted",[]);h(this,"disposed",false);h(this,"budget");h(this,"maxInFlight");this.options=t,this.budget=t.byteBudget??xe,this.maxInFlight=t.maxInFlight??ve}get(t){const e=this.entries.get(t);if((e==null?void 0:e.state)==="ready")return e.lastUsed=this.frame,e.image}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="ready"}failed(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(t,e){var s;const i=this.entries.get(t);(i==null?void 0:i.state)!=="ready"&&((s=i==null?void 0:i.controller)==null||s.abort(),this.entries.set(t,{url:t,state:"ready",image:e,bytes:Z(e),lastUsed:this.frame,attempts:0,pinned:false,waiters:(i==null?void 0:i.waiters)??[]}),this.bytes+=Z(e),this.flushWaiters(t))}prefetch(t){return Promise.all(t.map(e=>new Promise(i=>{const s=this.entries.get(e.url);if(s&&s.state!=="loading")return i();if(s){s.waiters.push(i);return}this.start({...e,priority:-1},i)}))).then(()=>{})}update(t){if(this.disposed)return;this.frame++;const e=new Set(t.map(i=>i.url));this.wanted=[...t].sort((i,s)=>i.priority-s.priority);for(const i of this.entries.values())i.state==="loading"&&!i.pinned&&!e.has(i.url)&&i.controller&&(i.controller.abort(),this.entries.delete(i.url),this.inFlight--);for(const i of this.wanted){const s=this.entries.get(i.url);s&&(s.lastUsed=this.frame)}this.pump(),this.evict(e)}dispose(){var t;this.disposed=true;for(const e of this.entries.values())(t=e.controller)==null||t.abort(),this.flushWaiters(e.url);this.entries.clear(),this.bytes=0}forEachReady(t){for(const e of this.entries.values())e.state==="ready"&&e.image&&t(e.url,e.image)}pump(){for(const t of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(t.url)||this.start(t)}}start(t,e){const i=new AbortController,s={url:t.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:i,pinned:!!e,waiters:e?[e]:[]};this.entries.set(t.url,s),this.inFlight++,this.attempt(s,t,i,t.url)}attempt(t,e,i,s){t.attempts++,this.options.load(s,i.signal).then(o=>{if(this.disposed||this.entries.get(t.url)!==t){ft(o);return}t.state="ready",t.image=o,t.bytes=Z(o),t.controller=void 0,t.pinned=false,this.bytes+=t.bytes,this.settle(t)},o=>{if(!(i.signal.aborted||this.disposed)&&this.entries.get(t.url)===t){if(t.attempts<be&&!Me(o,e)){this.attempt(t,e,i,e.fallbackUrl??e.url);return}t.state="failed",t.controller=void 0,t.pinned=false,this.settle(t)}})}settle(t){this.inFlight--,this.flushWaiters(t.url),this.options.onSettled(),this.pump()}flushWaiters(t){const e=this.entries.get(t);if(!e)return;const i=e.waiters;e.waiters=[],i.forEach(s=>s())}evict(t){if(this.bytes<=this.budget)return;const e=[...this.entries.values()].filter(i=>i.state==="ready"&&!t.has(i.url)).sort((i,s)=>i.lastUsed-s.lastUsed);for(const i of e){if(this.bytes<=this.budget)break;this.entries.delete(i.url),this.bytes-=i.bytes,i.image&&ft(i.image),this.options.onEvict(i.url)}}}function Z(n){return n.width*n.height*4}function Me(n,t){if(t.fallbackUrl)return false;const e=n==null?void 0:n.status;return typeof e=="number"&&e>=400&&e<500&&e!==408&&e!==429}const Ee=.1;class ke{constructor(t,e=s=>requestAnimationFrame(s),i=s=>cancelAnimationFrame(s)){h(this,"handle",0);h(this,"last",0);h(this,"disposed",false);h(this,"frame",t2=>{if(this.handle=0,this.disposed)return;const e2=this.last?Math.min((t2-this.last)/1e3,Ee):1/60;this.last=t2,this.tick(e2,t2)?this.invalidate():this.last=0});this.tick=t,this.raf=e,this.caf=i}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 Le=2*1024*1024;function _e(n,t,e=Le){const i=new Set;let s=e,o=false;return{get deferred(){return o},getTile(r){const a=n(r);if(!a||a.kind==="media"||a.opaque||i.has(r)||t(r))return a;const u=a.width*a.height*4;if(i.size>0&&u>s){o=true;return}return s-=u,i.add(r),a}}}function Pe(n){const t=/^(!)?(\d+(?:\.\d+)?)$/.exec((n==null?void 0:n.trim())??"");if(!t)return null;const e=Number(t[2]);if(e>360)return null;const i=e%360,s=!!t[1];return i||s?{degrees:i,mirror:s}:null}function Ae(n,t,e){if(!n)return null;let i=n.trim().replace(/^xywh=/,""),s=false;i.startsWith("pct:")?(s=true,i=i.slice(4)):i.startsWith("pixel:")&&(i=i.slice(6));const o=i.split(",").map(Number);if(o.length!==4||o.some(d=>!Number.isFinite(d)))return null;let[r,a,u,c]=o;s&&(r=r/100*t,a=a/100*e,u=u/100*t,c=c/100*e);const m=Math.max(0,r),g=Math.max(0,a),p=Math.min(t,r+u),l=Math.min(e,a+c);return p<=m||l<=g?null:{x:m,y:g,width:p-m,height:l-g}}const G=512,Ie=1024,Se=16e6;function _t(n,t,e){return{width:t,height:e,levels:[{scaleFactor:1,width:t,height:e,tileWidth:t,tileHeight:e,cols:1,rows:1}],tile:s=>({...s,url:n,region:{x:0,y:0,width:t,height:e}})}}function Re(n,t=Ie){const{width:e,height:i}=n,s=[],o=n.regionByPx&&n.sizeByW,r=(l,d,w)=>{const f=Math.ceil(e/l),x=Math.ceil(i/l);return{scaleFactor:l,width:f,height:x,tileWidth:d,tileHeight:w,cols:Math.ceil(f/d),rows:Math.ceil(x/w)}},a=(l,d)=>({scaleFactor:e/l,width:l,height:d,tileWidth:l,tileHeight:d,cols:1,rows:1,whole:true}),u=n.tiles[0];if(u){const{width:l,height:d}=o?Be(n,u,t):u;for(const w of u.scaleFactors)s.push(r(w,l,d))}else if(o){let l=Math.max(G,t);for(;l>G&&!$(n,l,l);)l/=2;for(let d=1;;d*=2){const w=r(d,l,l);if(s.push(w),w.cols===1&&w.rows===1)break}}const c=Math.max(0,...s.map(l=>l.scaleFactor));for(const l of n.sizes){const d=e/l.width;$(n,l.width,l.height)&&d>c+1e-9&&s.push(a(l.width,l.height))}const m=s.reduce((l,d)=>!l||d.scaleFactor>l.scaleFactor?d:l,null);if(m&&m.cols*m.rows>1&&n.sizeByW){const l=Math.max(e,i)/G;s.push(a(Math.ceil(e/l),Math.ceil(i/l)))}(!s.length||!u&&!o&&e*i<=Se)&&(s.some(l=>l.scaleFactor===1)||s.push(a(e,i)));const g=Oe(s).sort((l,d)=>d.scaleFactor-l.scaleFactor),p=Qt(n);return{width:e,height:i,levels:g,tile(l){const d=g[l.level],w=d.scaleFactor,f=d.cols===1&&d.rows===1;let x,v,b;if(f)x={x:0,y:0,width:e,height:i},v=d.width,b=d.height;else{const M=Math.round(l.col*d.tileWidth*w),E=Math.round(l.row*d.tileHeight*w);x={x:M,y:E,width:Math.min(Math.round(d.tileWidth*w),e-M),height:Math.min(Math.round(d.tileHeight*w),i-E)},v=Math.ceil(x.width/w),b=Math.ceil(x.height/w)}return{...l,region:x,url:at(n,x,v,b),fallbackUrl:p?at(n,x,v,b,p):void 0}}}}function Be(n,t,e){let i=Math.max(1,Math.floor(e/Math.max(t.width,t.height)));for(;i>1&&!$(n,t.width*i,t.height*i);)i--;return{width:t.width*i,height:t.height*i}}function $(n,t,e){return!(n.maxWidth&&t>n.maxWidth||n.maxHeight&&e>n.maxHeight||n.maxArea&&t*e>n.maxArea)}function Oe(n){const t=new Map;for(const e of n){const i=`${e.width}x${e.height}`,s=t.get(i);(!s||s.cols*s.rows<e.cols*e.rows)&&t.set(i,e)}return[...t.values()]}function Ce(n,t){const e=n.levels;for(let i=0;i<e.length;i++)if(e[i].scaleFactor<=t*(1+1e-6))return i;return e.length-1}function P(n,t,e){const i=n.levels[t],s=i.tileWidth*i.scaleFactor,o=i.tileHeight*i.scaleFactor,r=Math.max(0,e.x),a=Math.max(0,e.y),u=Math.min(n.width,e.x+e.width),c=Math.min(n.height,e.y+e.height);if(u<=r||c<=a)return[];const m=Math.max(0,Math.floor(r/s)),g=Math.min(i.cols-1,Math.floor((u-1e-9)/s)),p=Math.max(0,Math.floor(a/o)),l=Math.min(i.rows-1,Math.floor((c-1e-9)/o)),d=[];for(let w=p;w<=l;w++)for(let f=m;f<=g;f++)d.push({level:t,col:f,row:w});return d}async function mt(n,t){if(n.media)return ze(n,n.media);let e=null,i=null;if(n.service)try{e=Re(await jt(n.service,t.infoOptions))}catch(p){i=p}if(!e){if(!n.url)throw i??new Error("Image has no source");const p=await t.loadStatic(n.url);t.cache.seed(n.url,p),e=_t(n.url,p.naturalWidth,p.naturalHeight)}const s=n.width&&n.height&&n.width>0&&n.height>0?{width:n.width,height:n.height}:{width:e.width,height:e.height},o=Ae(n.region,s.width,s.height)??{x:0,y:0,width:s.width,height:s.height},r=e.width/s.width,a=e.height/s.height,u={x:o.x*r,y:o.y*a,width:o.width*r,height:o.height*a},c=Pe(n.rotation),m=c?Ue(u,c):void 0;return{id:n.id,spec:n,pyramid:e,size:s,clip:u,contentClip:o,rect:{x:0,y:0,width:o.width,height:o.height},...m?{turn:m}:{}}}function De(n,t){if(n.media)return Promise.resolve();const{pyramid:e,clip:i}=n;return t.prefetch(P(e,0,i).map(s=>{const o=e.tile(s);return{url:o.url,fallbackUrl:o.fallbackUrl}}))}const Pt="media:";function ze(n,t){var a,u;const e=n.width||((a=n.placement)==null?void 0:a.width)||t.element.videoWidth||1600,i=n.height||((u=n.placement)==null?void 0:u.height)||t.element.videoHeight||900,s=`${Pt}${n.id}`,o={width:e,height:i},r={x:0,y:0,width:e,height:i};return{id:n.id,spec:n,pyramid:_t(s,e,i),media:{kind:"media",source:t.element,width:e,height:i,naturalWidth:e,naturalHeight:i},size:o,clip:r,contentClip:r,rect:{...r}}}function Ue(n,{degrees:t,mirror:e}){const i=t*Math.PI/180,s=m=>Math.abs(m)<1e-12?0:m,o=s(Math.cos(i)),r=s(Math.sin(i)),a=Math.abs(n.width*o)+Math.abs(n.height*r),u=Math.abs(n.width*r)+Math.abs(n.height*o),c=A(S(a/2,u/2),{a:o,b:r,c:-r,d:o,e:0,f:0},I(e?-1:1,1),S(-(n.x+n.width/2),-(n.y+n.height/2)));return{orient:c,unorient:zt(c),width:a,height:u}}function At(n){var t;return((t=n.turn)==null?void 0:t.orient)??S(-n.clip.x,-n.clip.y)}function We(n,t){const{turn:e,clip:i}=n;if(!e)return{...t,x:i.x+t.x,y:i.y+t.y};const s=kt(e.unorient,t),o=Math.max(s.x,i.x),r=Math.max(s.y,i.y);return{x:o,y:r,width:Math.max(0,Math.min(s.x+s.width,i.x+i.width)-o),height:Math.max(0,Math.min(s.y+s.height,i.y+i.height)-r)}}function Fe(n,t){const{turn:e,clip:i}=n;return e?Et(e.unorient,t):{x:i.x+t.x,y:i.y+t.y}}function pt(n){const{turn:t,clip:e,contentClip:i}=n;return t?{width:t.width*i.width/e.width,height:t.height*i.height/e.height}:i}function gt(n){if(!n.length)return null;if(n.every(i=>i.spec.placement)){for(const i of n)i.rect={...i.spec.placement};return D(n.map(i=>i.rect))}const t=pt(n[0]).height;let e=0;for(const i of n){const s=pt(i),o=s.width*t/s.height;i.rect={x:e,y:0,width:o,height:t},e+=o}return{x:0,y:0,width:e,height:t}}function W(n){const t=n.turn??n.clip;return{x:n.rect.width/t.width,y:n.rect.height/t.height}}function Ne(n){const t=W(n);return A(S(n.rect.x,n.rect.y),I(t.x,t.y),At(n))}function He(n,t){var e,i;return n.service===t.service&&n.url===t.url&&n.width===t.width&&n.height===t.height&&n.region===t.region&&n.rotation===t.rotation&&((e=n.media)==null?void 0:e.element)===((i=t.media)==null?void 0:i.element)&&JSON.stringify(n.placement)===JSON.stringify(t.placement)}const Ze=5e6,It=1e7,Ge=15e6,Xe=2e7,wt=2;function yt(n){const{items:t,camera:e,viewport:i,pixelRatio:s,getTile:o,destination:r}=n,a=n.has??(l=>o(l)!==void 0),u=Nt(e,i),c=[],m=[],g=[],p=(l,d,w)=>{const f=l.tile(d);m.push({url:f.url,fallbackUrl:f.fallbackUrl,priority:w})};for(const l of t){const{pyramid:d,clip:w,rect:f}=l,x=W(l);if(n.wantOverview)for(const y of P(d,0,w))p(d,y,Xe);const v=xt(l,e,i,s),b=r?xt(l,r,i,s):v;if(g.push((v==null?void 0:v.target)??-1),!v&&!b)continue;const M=y=>T=>{const _=d.tile(T).region;return Math.hypot(_.x+_.width/2-y.x,_.y+_.height/2-y.y)};if(b){const y=M(b.center);for(const T of P(d,0,b.area))p(d,T,y(T)/1e3);if(b.target>0)for(const T of P(d,b.target,b.area))p(d,T,It+y(T))}if(!v)continue;const{area:E,target:k}=v,L=M(v.center),O=P(d,0,E),F=k===0?[]:P(d,k,E);if(b!==v){for(const T of O)p(d,T,L(T)/1e3);const y=k-wt;if(y>0)for(const T of P(d,y,E))p(d,T,Ge+L(T))}const j=k-wt;if(b===v&&j>0){const y=new Set;for(const T of F){const _=d.tile(T);if(!a(_.url))for(const R of P(d,j,_.region)){const B=`${R.col},${R.row}`;y.has(B)||(y.add(B),p(d,R,Ze+L(R)))}}}if(l.spec.hidden)continue;const St=(k===0?O:F).every(y=>o(d.tile(y).url)!==void 0)?[k]:Array.from({length:k+1},(y,T)=>T),Rt=A(u,S(f.x,f.y),I(x.x,x.y),At(l));for(const y of St){const T=y===0?O:y===k?F:P(d,y,E),_=d.levels[y].cols*d.levels[y].rows>1;for(const R of T){const B=d.tile(R),J=o(B.url);if(!J)continue;const tt=Ke(l,B.region,J,Rt,_);tt&&c.push({...tt,url:B.url})}}}return m.sort((l,d)=>l.priority-d.priority),{draws:c,wants:qe(m),levels:g}}function xt(n,t,e,i){const{pyramid:s,rect:o}=n,r=q(t,e);if(!Ut(r,o))return null;const a=W(n),u=Math.max(r.x,o.x),c=Math.max(r.y,o.y),m=Math.min(r.x+r.width,o.x+o.width),g=Math.min(r.y+r.height,o.y+o.height),p=1/(a.x*t.zoom*i);return{area:We(n,{x:(u-o.x)/a.x,y:(c-o.y)/a.y,width:(m-u)/a.x,height:(g-c)/a.y}),center:Fe(n,{x:(t.x-o.x)/a.x,y:(t.y-o.y)/a.y}),target:Ce(s,p)}}function Ke(n,t,e,i,s){const{clip:o}=n,r=Math.max(t.x,o.x),a=Math.max(t.y,o.y),u=Math.min(t.x+t.width,o.x+o.width),c=Math.min(t.y+t.height,o.y+o.height);if(u<=r||c<=a)return null;const m=e.width/t.width,g=e.height/t.height,p=1e-6;return{item:n,image:e,transform:A(i,S(t.x,t.y),I(1/m,1/g)),crop:{x:(r-t.x)*m,y:(a-t.y)*g,width:(u-r)*m,height:(c-a)*g},bleed:{right:s&&u<o.x+o.width-p,bottom:s&&c<o.y+o.height-p}}}function qe(n){const t=new Set;return n.filter(e=>t.has(e.url)?false:(t.add(e.url),true))}const Ve={maxZoomPixelRatio:1.1,minZoomImageRatio:.9,upscale:true,animationTime:.09,animationDuration:void 0,springStiffness:6.5,constrainDuringPan:true,request:void 0,byteBudget:192*1024*1024,maxInFlight:16,releaseAfterMs:2e3},Ye=2,$e=3,Qe=.1,X=1e-6,vt=1e8,je=6,Q={top:0,right:0,bottom:0,left:0};function bt(n,t="padding"){if(!n||typeof getComputedStyle!="function")return Q;const e=getComputedStyle(n),i=s=>parseFloat(e.getPropertyValue(`${t}-${s}`))||0;return{top:i("top"),right:i("right"),bottom:i("bottom"),left:i("left")}}const Je=(n,t)=>n.top===t.top&&n.right===t.right&&n.bottom===t.bottom&&n.left===t.left;let ti;class ei{constructor(t,e={}){h(this,"host");h(this,"overlays",null);h(this,"options");h(this,"backend",null);h(this,"backendPreference");h(this,"contextLosses",0);h(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});h(this,"visible",true);h(this,"dom",null);h(this,"domAsked",false);h(this,"pending",null);h(this,"camera");h(this,"loop");h(this,"gestures");h(this,"gestureOptions",{});h(this,"cache");h(this,"navigator",null);h(this,"navigatorAsked",0);h(this,"viewport",{width:1,height:1});h(this,"inset",Q);h(this,"pixelRatio",1);h(this,"items",[]);h(this,"worldBounds",null);h(this,"contentVersion",0);h(this,"opaqueUrls",new Set);h(this,"mediaByKey",new Map);h(this,"detachMedia",[]);h(this,"opened",false);h(this,"atHome",true);h(this,"interacting",false);h(this,"lastEmitted",null);h(this,"generation",0);h(this,"landing",[]);h(this,"ahead",null);h(this,"listeners",new Map);h(this,"unloadable",false);h(this,"resizeObserver",null);h(this,"intersectionObserver",null);h(this,"releaseTimer",null);h(this,"dprQuery",null);h(this,"disposed",false);h(this,"dismisser",null);h(this,"tick",t2=>{var u,c;if(this.disposed)return false;const e2=this.camera.step(t2,this.viewport),i2=this.camera.current,s2=this.backend,o=_e(this.getTile,m=>s2?s2.has(m):true),r=yt({items:this.items,camera:i2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:o.getTile,has:this.hasTile,wantOverview:!!this.navigator,destination:e2?this.camera.destination:void 0}),a=(this.landing.length?[...this.landing,...r.wants]:r.wants).filter(m=>!m.url.startsWith(Pt));if(this.cache.update(a),this.ahead&&!e2&&!this.cache.pending){const m=this.ahead;this.ahead=null,this.readAhead(m)}return r.draws.length?this.setUnloadable(false):a.length&&a.every(m=>this.cache.failed(m.url))&&this.setUnloadable(true),this.paint(r.draws),(u=this.overlays)==null||u.position(i2,this.viewport),(c=this.navigator)==null||c.render(this.items.filter(m=>!m.spec.hidden),this.worldBounds,q(i2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!st(this.lastEmitted,i2))&&(this.lastEmitted={...i2},this.opened&&this.emit("viewport")),e2||o.deferred});h(this,"getTile",t2=>this.mediaByKey.get(t2)??this.cache.get(t2));h(this,"hasTile",t2=>this.mediaByKey.has(t2)||this.cache.has(t2));h(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});h(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=t,this.backendPreference=e.backend??"auto",this.options={...Ve,...K(e)},Mt()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:i,springStiffness:s}=this.options;this.camera=new ce({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,i===void 0?void 0:{duration:i,stiffness:s}),this.loop=new ke(this.tick),this.gestureOptions=K(e.gestures??{}),Mt()&&(this.gestureOptions.flickMomentum=0),this.gestures=new fe(t,this,{...V,...this.gestureOptions}),this.cache=new Te({load:(o,r)=>this.loadTile(o,r),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:o=>{var r;return(r=this.backend)==null?void 0:r.release(o)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=ii(t),this.visible?this.acquireBackend():this.holder.hiddenSince=Tt(),this.measure(),this.observe()}get backendKind(){var t;return((t=this.backend)==null?void 0:t.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>i==null?void 0:i.delete(e)}async setImages(t,{world:e,fit:i=false}={}){const s=++this.generation,o=()=>s!==this.generation||this.disposed,r=new Map(this.items.map(f=>[f.id,f]));this.landing=[],this.ahead=null;const a=this.prepareContext(),u=[],c=t.map(f=>{const x=r.get(f.id);if(x&&He(x.spec,f))return x.spec=f,{item:Promise.resolve(x),ready:Promise.resolve()};let v,b,M;const E=new Promise((L,O)=>{v=L,b=O}),k=new Promise(L=>M=L);return u.push(()=>mt(f,a).then(L=>(v(L),De(L,this.cache)),b).then(M,M)),{item:E,ready:k}}),m=()=>{var f;return(f=u.shift())==null?void 0:f().then(m)};for(let f=0;f<je;f++)m();const g=t.flatMap(f=>f.placement?[f.placement]:[]);let p=false;if(!this.items.length&&t.length>1&&g.length===t.length){const f=D(e?[e,...g]:g),x=[];c.forEach(({item:v,ready:b},M)=>{Promise.all([v,b]).then(([E])=>{o()||(x[M]=E,this.place(x.filter(Boolean),f,i,!p,false),p=true)},()=>{})})}const l=await Promise.allSettled(c.map(({item:f})=>f));if(o()||(this.landing=this.landingWants(l.flatMap(f=>f.status==="fulfilled"?[f.value]:[]),e,i||!this.opened),this.invalidate(),await Promise.all(c.map(({ready:f})=>f)),o()))return;this.landing=[];const d=l.filter(f=>f.status==="fulfilled").map(f=>f.value),w=l.filter(f=>f.status==="rejected").map(f=>f.reason);w.length&&this.emit("error",w),this.setUnloadable(t.length>0&&!d.length&&w.length>0),this.place(d,e,i,!p,true)}place(t,e,i,s,o){this.items=t,this.watchMedia(t);const r=gt(t);this.worldBounds=e?r?D([e,r]):e:r,this.contentVersion++,this.worldBounds&&(this.opened?s?(i?this.home(true):this.camera.set(this.constrain(this.camera.current)),this.emit("change")):o&&this.emit("change"):(this.opened=true,this.home(true),this.emit("open"))),this.invalidate()}prefetch(t,{world:e}={}){const i=t.filter(s=>!s.media);this.ahead=i.length?{images:i,world:e}:null,this.ahead&&this.invalidate()}async readAhead({images:t,world:e}){const i=this.generation,s=this.prepareContext(),o=(await Promise.allSettled(t.map(a=>mt(a,s)))).flatMap(a=>a.status==="fulfilled"?[a.value]:[]);if(!o.length||i!==this.generation||this.disposed)return;const r=this.landingWants(o,e,true).filter(a=>a.priority<It-vt);await this.cache.prefetch(r)}prepareContext(){return{cache:this.cache,loadStatic:t=>this.loadTile(t),infoOptions:{request:this.options.request}}}clear(){this.setUnloadable(false),this.generation++,this.landing=[],this.ahead=null,this.items=[],this.watchMedia([]),this.worldBounds=null,this.contentVersion++,this.invalidate()}setHidden(t){const e=new Set(t);let i=false;for(const s of this.items){const o=e.has(s.id);!!s.spec.hidden!==o&&(s.spec={...s.spec,hidden:o},i=true)}i&&this.invalidate()}isReady(t){const e=this.items.find(s=>s.id===t);if(!e)return false;if(e.spec.media)return true;const i=e.pyramid.levels[0];if(!i)return false;for(let s=0;s<i.rows;s++)for(let o=0;o<i.cols;o++)if(!this.getTile(e.pyramid.tile({level:0,col:o,row:s}).url))return false;return true}fitBounds(t,e=false,i=Q){const s=this.fit(t,this.camera.destination.rotation,i);this.atHome=false,this.animateTo(this.constrain(s,{allowBeyondLimits:true}),e)}fit(t,e,{top:i,right:s,bottom:o,left:r},a=1/0){const{width:u,height:c}=this.viewport,m=Ht(t,{width:Math.max(1,u-r-s),height:Math.max(1,c-i-o)},e),g=Math.min(m.zoom,a);return{...z(Wt(t),{x:(u+r-s)/2,y:(c+i-o)/2},g,e,this.viewport),zoom:g,rotation:e}}fitItemRect(t,e,i=false){const s=this.itemRectToWorld(t,e);s&&this.fitAnnotation(s,i)}fitAnnotation(t,e=false){var o;const i=this.items[0];if(!i)return;const s=i.rect.width*Qe;this.fitBounds({x:t.x-s,y:t.y-s,width:t.width+s*2,height:t.height+s*2},e,bt((o=this.overlays)==null?void 0:o.container,"scroll-padding"))}getBounds(){return q(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var e;const t=((e=this.homeCamera())==null?void 0:e.zoom)??1;return{home:t,min:t*this.options.minZoomImageRatio,max:Math.max(t,this.closestZoom())}}closestZoom(t=this.items){const e=t.length?Math.min(...t.map(i=>W(i).x)):1;return this.options.maxZoomPixelRatio/e}home(t=false){const e=this.homeCamera();if(!e)return;const i=this.atHome;this.atHome=true,this.animateTo(e,t),!i&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-X)}viewLimits(){const{zoom:t,x:e,y:i,rotation:s}=this.camera.destination,{min:o,max:r}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:t>=r*(1-X),atMin:t<=o*(1+X),atHome:this.atHome&&(!a||Math.abs(t/a.zoom-1)<.001&&Math.hypot(e-a.x,i-a.y)*t<.5&&Math.abs(s-a.rotation)<.001)}}zoomBy(t,e,i=true){const s=i?this.camera.destination:this.camera.current,o=e??{x:this.viewport.width/2,y:this.viewport.height/2},r=it(s,this.viewport,o),{min:a,max:u}=this.getZoomLimits(),c=C(s.zoom*t,a,u),m=z(r,o,c,s.rotation,this.viewport),g=this.constrain({...s,...m,zoom:c});this.atHome=false,i?this.camera.animateTo({state:g,anchor:{world:r,screen:o}},this.viewport):this.camera.set(g),this.invalidate()}panBy(t,e,i=false){const s=i?this.camera.destination:this.camera.current,o=Et(A(I(1/s.zoom),Ft(-s.rotation)),{x:t,y:e}),r=this.constrain({...s,x:s.x-o.x,y:s.y-o.y});this.atHome=false,i?this.camera.animateTo({state:r},this.viewport):this.camera.set(r),this.invalidate()}panTo(t,e=false){const i=e?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...i,...t}),e)}rotateBy(t){const e=this.camera.destination;this.setRotation(e.rotation*180/Math.PI+t)}setRotation(t,e=false){const i=this.camera.destination,s=t*Math.PI/180;this.animateTo(this.constrain({...i,rotation:s}),e)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(t){this.emit("tap",t)}setDismiss(t){this.dismisser=t}dismiss(){var t;return((t=this.dismisser)==null?void 0:t.call(this))??false}setGestures(t){this.gestures.setOptions({...V,...this.gestureOptions,...K(t)})}setInteracting(t){if(this.interacting=t,t){this.camera.stop();return}if(this.options.constrainDuringPan)return;const e=this.camera.destination,i=this.constrain(e);st(e,i)||this.animateTo(i,false)}worldToScreenPoint(t){return Zt(this.camera.current,this.viewport,t)}screenToWorldPoint(t){return it(this.camera.current,this.viewport,t)}itemRectToWorld(t,e){const i=this.items[t];if(!i)return null;const{contentClip:s,clip:o}=i;if(i.turn)return kt(A(Ne(i),I(o.width/s.width,o.height/s.height)),e);const r=i.rect.width/s.width,a=i.rect.height/s.height;return{x:i.rect.x+(e.x-s.x)*r,y:i.rect.y+(e.y-s.y)*a,width:e.width*r,height:e.height*a}}attachNavigator(t){var o;(o=this.navigator)==null||o.dispose(),this.navigator=null;const e=++this.navigatorAsked;let i=null,s=false;return import("./Navigator-t1y35uj8.mjs").then(r=>{s||this.disposed||e!==this.navigatorAsked||(i=new r.Navigator(t,(a,u)=>this.panTo(a,u)),this.navigator=i,this.invalidate())}),()=>{s=true,i==null||i.dispose(),i&&this.navigator===i&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var t,e,i,s,o,r,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(t=this.resizeObserver)==null||t.disconnect(),(e=this.intersectionObserver)==null||e.disconnect(),(s=(i=this.dprQuery)==null?void 0:i.removeEventListener)==null||s.call(i,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(o=this.navigator)==null||o.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(r=this.dom)==null||r.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(u=>u()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}landingWants(t,e,i){const s=t.map(c=>({...c,rect:{...c.rect}})),o=gt(s),r=e?o?D([e,o]):e:o;if(!r)return[];const a=i?this.homeCamera(r,s):this.camera.destination;if(!a)return[];const{wants:u}=yt({items:s,camera:a,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:c=>this.cache.get(c)});return u.map(c=>({...c,priority:c.priority-vt}))}watchMedia(t){this.detachMedia.forEach(e=>e()),this.detachMedia=[],this.mediaByKey.clear();for(const e of t){if(!e.media||e.media.kind!=="media")continue;const i=e.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(i,e.media);const s=e.media.source,o=()=>this.invalidate(),r=["play","seeked","loadeddata","resize"];r.forEach(a=>s.addEventListener(a,o)),this.detachMedia.push(()=>r.forEach(a=>s.removeEventListener(a,o)))}}paint(t){const e=this.backend,i=[],s=(e==null?void 0:e.kind)==="webgl2";e==null||e.begin();for(const o of t){const{image:r}=o;if(!(r.kind==="media"||r.kind==="element"&&s&&(r.opaque||this.opaqueUrls.has(o.url)))&&e){if(e.draw({key:o.url,source:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1,bleed:o.bleed})!=="tainted"||r.kind==="bitmap")continue;this.opaqueUrls.add(o.url)}(r.kind==="element"||r.kind==="media")&&i.push({key:`${o.item.id}|${o.url}`,element:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1})}e==null||e.end(),this.dom?this.dom.sync(i):i.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-DwhkzPRS.mjs").then(({DomLayers:o})=>{if(this.disposed)return;const r=new o(this.host);this.overlays&&this.host.insertBefore(r.container,this.overlays.container),this.dom=r,this.invalidate()}))}loadTile(t,e){return pe(t,{signal:e,request:this.options.request,maxTextureSize:this.backend instanceof U?this.backend.maxTextureSize:void 0})}animateTo(t,e){this.camera.animateTo({state:t},this.viewport,e),this.invalidate()}homeCamera(t=this.worldBounds,e=this.items){if(!t)return null;const i=2*Math.PI,s=Math.round(this.camera.destination.rotation/i)*i||0;return this.fit(t,s,this.inset,this.options.upscale?1/0:this.closestZoom(e))}constrain(t,{allowBeyondLimits:e=false}={}){const i=this.worldBounds;if(!i)return t;const{min:s,max:o}=this.getZoomLimits(),r=e?C(t.zoom,s,Math.max(o,t.zoom)):C(t.zoom,s,o);return this.interacting&&!this.options.constrainDuringPan?{...t,zoom:r}:{...t,zoom:r,x:C(t.x,i.x,i.x+i.width),y:C(t.y,i.y,i.y+i.height)}}acquireBackend(t=true){var o,r;if(this.backend||this.pending||this.disposed)return;const e=document.createElement("canvas");e.className="clover-canvas-surface",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(e,((o=this.dom)==null?void 0:o.container)??((r=this.overlays)==null?void 0:r.container)??null);const i=t&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<$e);let s=null;i&&(Ct(this.holder)||this.backendPreference==="webgl2")&&(s=U.create(e,{onLost:this.onContextLost}),s||et(this.holder)),s?this.install(s):this.backendPreference==="webgl2"?this.none(e):(this.pending=e,(ti??(ti=import("./Canvas2DBackend-DXCfms6g.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==e)return;this.pending=null;const u=a.create(e);u?this.install(u):this.none(e)}))}none(t){t.remove(),this.host.dataset.backend="none"}install(t){this.backend=t,this.host.dataset.backend=t.kind,t.resize(this.viewport.width,this.viewport.height,this.pixelRatio),t.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",t.kind),this.invalidate()}releaseBackend(){var e;if(et(this.holder),(e=this.pending)==null||e.remove(),this.pending=null,!this.backend)return;const t=this.backend.canvas;this.backend.dispose(),t.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(t=>{const e=t.some(i=>i.isIntersecting);this.setVisible(e)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(t){var e;if(this.visible=t,t){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(e=this.holder).hiddenSince??(e.hiddenSince=Tt()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(t=false){var u;const e=this.host.getBoundingClientRect(),i=Math.max(1,e.width),s=Math.max(1,e.height),o=bt(this.host),r=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Ye);if(i===this.viewport.width&&s===this.viewport.height&&r===this.pixelRatio&&Je(o,this.inset))return;const a=this.viewport;if(this.viewport={width:i,height:s},this.inset=o,this.pixelRatio=r,(u=this.backend)==null||u.resize(i,s,r),this.opened){if(this.atHome)this.home(true);else{const c=this.camera.current,m=i/Math.max(a.width,1);this.camera.set(this.constrain({...c,zoom:c.zoom*m}))}this.emit("viewport")}t?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var t,e,i,s;typeof window>"u"||typeof window.matchMedia!="function"||((e=(t=this.dprQuery)==null?void 0:t.removeEventListener)==null||e.call(t,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(s=(i=this.dprQuery).addEventListener)==null||s.call(i,"change",this.onPixelRatioChange))}setUnloadable(t){t!==this.unloadable&&(this.unloadable=t,this.emit("unloadable",t))}emit(t,e){var i;(i=this.listeners.get(t))==null||i.forEach(s=>s(e))}}const Tt=()=>typeof performance<"u"?performance.now():Date.now();function ii(n){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:t,left:e,width:i,height:s}=n.getBoundingClientRect();return t+s>=0&&e+i>=0&&t<=window.innerHeight&&e<=window.innerWidth}function Mt(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function K(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}const ui=(n,t)=>new ei(n,t);export{te as b,Jt as h,yt as p,ui as r};
|
|
22
|
+
`;class U{constructor(t,e,i){h(this,"kind","webgl2");h(this,"canvas");h(this,"maxTextureSize");h(this,"gl");h(this,"program",null);h(this,"vao",null);h(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});h(this,"textures",new Map);h(this,"cssWidth",1);h(this,"cssHeight",1);h(this,"pixelRatio",1);h(this,"matrixScratch",new Float32Array(9));h(this,"isLost",false);h(this,"callbacks");h(this,"handleLost",()=>{var t2,e2;this.isLost=true,this.textures.clear(),(e2=(t2=this.callbacks).onLost)==null||e2.call(t2)});this.canvas=t,this.gl=e,this.callbacks=i,this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)||4096;const s=ne(e,ee,se);this.program=s,this.uniforms={matrix:e.getUniformLocation(s,"u_matrix"),crop:e.getUniformLocation(s,"u_crop"),opacity:e.getUniformLocation(s,"u_opacity"),texture:e.getUniformLocation(s,"u_texture")};const o=e.createVertexArray();e.bindVertexArray(o);const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),e.STATIC_DRAW);const a=e.getAttribLocation(s,"a_position");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,false,0,0),e.bindVertexArray(null),this.vao=o,e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),t.addEventListener("webglcontextlost",this.handleLost)}static create(t,e={}){let i=null;try{i=t.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{i=null}if(!i||typeof i.createShader!="function")return null;try{return new U(t,i,e)}catch{return null}}resize(t,e,i){this.cssWidth=Math.max(1,t),this.cssHeight=Math.max(1,e),this.pixelRatio=i;const s=Math.max(1,Math.round(t*i)),o=Math.max(1,Math.round(e*i));this.canvas.width!==s&&(this.canvas.width=s),this.canvas.height!==o&&(this.canvas.height=o)}begin(){if(this.isLost)return;const t=this.gl;t.viewport(0,0,this.canvas.width,this.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(this.program),t.bindVertexArray(this.vao),t.activeTexture(t.TEXTURE0),t.uniform1i(this.uniforms.texture,0)}draw(t){if(this.isLost||!Jt(t.source))return"skipped";const e=this.gl,i=this.upload(t);if(i==="tainted")return"tainted";if(!i)return"skipped";const s=t.crop??{x:0,y:0,width:t.width,height:t.height},o=te(t,this.pixelRatio),r=A(t.transform,S(s.x,s.y),I(s.width+o.x,s.height+o.y));return e.uniformMatrix3fv(this.uniforms.matrix,false,Dt(r,this.cssWidth,this.cssHeight,this.matrixScratch)),e.uniform4f(this.uniforms.crop,s.x/t.width,s.y/t.height,s.width/t.width,s.height/t.height),e.uniform1f(this.uniforms.opacity,t.opacity),e.bindTexture(e.TEXTURE_2D,i.texture),e.drawArrays(e.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(t){return!this.isLost&&this.textures.has(t)}release(t){const e=this.textures.get(t);e&&(this.isLost||this.gl.deleteTexture(e.texture),this.textures.delete(t))}dispose(){var t;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const e of[...this.textures.keys()])this.release(e);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(t=this.gl.getExtension("WEBGL_lose_context"))==null||t.loseContext(),this.isLost=true}upload(t){const e=this.gl,i=this.textures.get(t.key);if(i&&i.width===t.width&&i.height===t.height)return i;const s=(i==null?void 0:i.texture)??e.createTexture();if(!s)return null;e.bindTexture(e.TEXTURE_2D,s);try{e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source)}catch(r){if(i||e.deleteTexture(s),oe(r))return"tainted";throw r}e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const o={texture:s,width:t.width,height:t.height};return this.textures.set(t.key,o),o}}function ne(n,t,e){const i=ht(n,n.VERTEX_SHADER,t),s=ht(n,n.FRAGMENT_SHADER,e),o=n.createProgram();if(!o)throw new Error("Could not create WebGL program");if(n.attachShader(o,i),n.attachShader(o,s),n.linkProgram(o),n.deleteShader(i),n.deleteShader(s),!n.getProgramParameter(o,n.LINK_STATUS)){const r=n.getProgramInfoLog(o);throw n.deleteProgram(o),new Error(`Could not link WebGL program: ${r}`)}return o}function ht(n,t,e){const i=n.createShader(t);if(!i)throw new Error("Could not create WebGL shader");if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){const s=n.getShaderInfoLog(i);throw n.deleteShader(i),new Error(`Could not compile WebGL shader: ${s}`)}return i}function oe(n){return typeof n=="object"&&n!==null&&n.name==="SecurityError"}const re=.09,ae=1e-4,ct=.05,he=1e-4;class ce{constructor(t,e=re,i){h(this,"current");h(this,"target",null);h(this,"timeConstant");h(this,"spring");h(this,"start");h(this,"elapsed",0);this.current={...t},this.start={...t},this.timeConstant=e,this.spring=i}get destination(){return this.target?{...this.target.state}:{...this.current}}set(t){this.current={...t},this.target=null}animateTo(t,e,i=false){const s=this.spring?this.spring.duration<=0:this.timeConstant===0;if(i||s){this.set(t.state);return}let o=t.anchor;if(o){const r=z(o.world,o.screen,t.state.zoom,t.state.rotation,e);Math.hypot(r.x-t.state.x,r.y-t.state.y)*t.state.zoom>ct&&(o=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...t.state},anchor:o}}stop(){this.target=null}step(t,e){const i=this.target;if(!i)return false;const s=i.state;let o,r;if(this.spring){this.elapsed+=Math.max(t,0);const g=this.elapsed/this.spring.duration;if(g>=1)return this.current={...s},this.target=null,false;const p=this.spring.stiffness;o=this.start,r=(1-Math.exp(-p*g))/(1-Math.exp(-p))}else o=this.current,r=1-Math.exp(-Math.max(t,0)/this.timeConstant);const a=Math.exp(Math.log(o.zoom)+(Math.log(s.zoom)-Math.log(o.zoom))*r),u=o.rotation+(s.rotation-o.rotation)*r,c=i.anchor?z(i.anchor.world,i.anchor.screen,a,u,e):{x:o.x+(s.x-o.x)*r,y:o.y+(s.y-o.y)*r};return this.current={x:c.x,y:c.y,zoom:a,rotation:u},this.spring?true:Math.abs(Math.log(s.zoom/a))<ae&&Math.abs(s.rotation-u)<he&&Math.hypot(s.x-c.x,s.y-c.y)*a<ct?(this.current={...s},this.target=null,false):true}}const V={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},N=2,lt=1.5,dt=.1,le=100,de=.002,ue=.01;class fe{constructor(t,e,i=V){h(this,"pointers",new Map);h(this,"samples",[]);h(this,"down",null);h(this,"pinch",null);h(this,"lastTap",null);h(this,"lastPointerType","");h(this,"penHovers",false);h(this,"onPointerDown",t2=>{var i2,s;if(this.lastPointerType=t2.pointerType,t2.pointerType==="mouse"&&t2.button!==0||nt(t2.target,this.element))return;(s=(i2=this.element).setPointerCapture)==null||s.call(i2,t2.pointerId);const e2=this.local(t2);this.pointers.set(t2.pointerId,e2),this.pointers.size===1?(this.down={x:e2.x,y:e2.y,t:t2.timeStamp,moved:false},this.samples=[{x:e2.x,y:e2.y,t:t2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});h(this,"onPointerMove",t2=>{var s;Gt(t2)&&(this.penHovers=true);const e2=this.pointers.get(t2.pointerId);if(!e2)return;const i2=this.local(t2);if(this.pointers.set(t2.pointerId,i2),this.pointers.size===1){const o=i2.x-e2.x,r=i2.y-e2.y;this.down&&Math.hypot(i2.x-this.down.x,i2.y-this.down.y)>Xt&&(this.down.moved=true),(s=this.down)!=null&&s.moved&&this.options.navigable&&this.target.panBy(o,r,!this.tracksPointer(t2.pointerType)),this.samples.push({x:i2.x,y:i2.y,t:t2.timeStamp});const a=t2.timeStamp-le;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 o=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(o.distance/this.pinch.distance,o.mid,false),this.target.panBy(o.mid.x-this.pinch.mid.x,o.mid.y-this.pinch.mid.y,false),this.pinch=o}});h(this,"onPointerUp",t2=>{var u,c,m,g,p,l;if(!this.pointers.has(t2.pointerId))return;if(this.pointers.delete(t2.pointerId),(c=(u=this.element).releasePointerCapture)==null||c.call(u,t2.pointerId),this.pointers.size===1){this.pinch=null;const[d]=this.pointers.values();this.samples=[{...d,t:t2.timeStamp}];return}if(this.pointers.size>0)return;const e2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!e2)return;const i2=this.local(t2);if(!e2.moved&&t2.type==="pointerup"&&t2.timeStamp-e2.t<ot){if((g=(m=this.target).dismiss)!=null&&g.call(m)){this.lastTap=null;return}if(rt(t2.pointerType,this.penHovers)){const d=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&d&&t2.timeStamp-d.t<ot&&Math.hypot(i2.x-d.x,i2.y-d.y)<Kt?(this.lastTap=null,this.zoomIn(i2)):this.lastTap={x:i2.x,y:i2.y,t:t2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?t2.shiftKey?this.target.zoomBy(1/N,i2,true):this.zoomIn(i2):(l=(p=this.target).tap)==null||l.call(p,i2);return}if(!this.options.navigable||!this.tracksPointer(t2.pointerType))return;const o=this.samples[0],r=this.samples[this.samples.length-1],a=((r==null?void 0:r.t)??0)-((o==null?void 0:o.t)??0);if(o&&r&&a>0&&t2.timeStamp-r.t<50){const d=(r.x-o.x)/a*1e3,w=(r.y-o.y)/a*1e3,f=this.options.flickMomentum;f>0&&Math.hypot(d,w)>this.options.flickMinSpeed&&this.target.panBy(d*f,w*f,true)}});h(this,"onDoubleClick",t2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||rt(this.lastPointerType,this.penHovers)||nt(t2.target,this.element)||(t2.shiftKey?this.target.zoomBy(1/N,this.local(t2),true):this.zoomIn(this.local(t2))))});h(this,"onWheel",t2=>{const e2=t2.ctrlKey;if(!this.options.navigable||!e2&&!this.options.scrollToZoom||!e2&&qt(t2.target,this.element,t2.deltaY))return;t2.preventDefault();const i2=me(t2),s=e2?ue:de;this.target.zoomBy(Math.exp(-i2*s),this.local(t2),!e2)});h(this,"onKeyDown",t2=>{if(t2.target!==this.element||!this.options.navigable||t2.altKey||t2.metaKey||t2.ctrlKey)return;const e2=this.element.getBoundingClientRect(),i2=e2.width*dt*(t2.shiftKey?3:1),s=e2.height*dt*(t2.shiftKey?3:1);switch(t2.key){case"ArrowLeft":this.target.panBy(i2,0,true);break;case"ArrowRight":this.target.panBy(-i2,0,true);break;case"ArrowUp":this.target.panBy(0,s,true);break;case"ArrowDown":this.target.panBy(0,-s,true);break;case"+":case"=":this.target.zoomBy(lt,void 0,true);break;case"-":case"_":this.target.zoomBy(1/lt,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}t2.preventDefault()});this.element=t,this.target=e,this.options=i,t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointermove",this.onPointerMove),t.addEventListener("pointerup",this.onPointerUp),t.addEventListener("pointercancel",this.onPointerUp),t.addEventListener("dblclick",this.onDoubleClick),t.addEventListener("wheel",this.onWheel,{passive:false}),t.addEventListener("keydown",this.onKeyDown)}setOptions(t){this.options=t}dispose(){const t=this.element;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("pointercancel",this.onPointerUp),t.removeEventListener("dblclick",this.onDoubleClick),t.removeEventListener("wheel",this.onWheel),t.removeEventListener("keydown",this.onKeyDown)}local(t){const e=this.element.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}zoomIn(t){var e,i;(i=(e=this.target).atMaxZoom)!=null&&i.call(e)?this.target.home():this.target.zoomBy(N,t,true)}tracksPointer(t){return t==="touch"||this.options.flickEnabled}pinchState(){const[t,e]=[...this.pointers.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),mid:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}}function me(n){return n.deltaMode===1?n.deltaY*16:n.deltaMode===2?n.deltaY*400:n.deltaY}class Lt extends Error{constructor(t,e,i){super(t),this.url=e,this.status=i,this.name="ImageLoadError"}}const ut=new Set;async function pe(n,t={}){const{signal:e,maxTextureSize:i,request:s}=t,o=Vt(s),r=we(n);if(typeof createImageBitmap!="function"||typeof fetch!="function")return H(n,{signal:e,cors:true,withCredentials:o});if(r&&ut.has(r))return H(n,{signal:e,cors:false,withCredentials:o});let a;try{a=await Yt(s,n,{mode:"cors",signal:e})}catch(p){if(ye(p,e))throw p;const l=await H(n,{signal:e,cors:false,withCredentials:o});return r&&ut.add(r),l}if(!a.ok)throw $t(a),new Lt(`Image request failed with ${a.status}`,n,a.status);const u=await a.blob();let c=await ge(u);const m=c.width,g=c.height;if(i&&(c.width>i||c.height>i)){const p=i/Math.max(c.width,c.height),l=await createImageBitmap(c,{resizeWidth:Math.max(1,Math.floor(c.width*p)),resizeHeight:Math.max(1,Math.floor(c.height*p)),resizeQuality:"high"});c.close(),c=l}if(e!=null&&e.aborted)throw c.close(),Y();return{kind:"bitmap",source:c,width:c.width,height:c.height,naturalWidth:m,naturalHeight:g,opaque:false}}async function ge(n){const t={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(n,t)}catch(e){if(e instanceof TypeError)return createImageBitmap(n);throw e}}function H(n,{signal:t,cors:e,withCredentials:i}){return new Promise((s,o)=>{if(t!=null&&t.aborted){o(Y());return}const r=new Image;r.decoding="async",e&&(r.crossOrigin=i?"use-credentials":"anonymous");const a=()=>{r.onload=null,r.onerror=null,t==null||t.removeEventListener("abort",u)},u=()=>{a(),r.src="",o(Y())};t==null||t.addEventListener("abort",u),r.onload=()=>{a();const c=()=>s({kind:"element",source:r,width:r.naturalWidth,height:r.naturalHeight,naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,opaque:!e});typeof r.decode=="function"?r.decode().then(c,c):c()},r.onerror=()=>{a(),o(new Lt("Image failed to load",n))},r.src=n})}function we(n){var t;try{return new URL(n,(t=globalThis.location)==null?void 0:t.href).origin}catch{return null}}function ye(n,t){return!!(t!=null&&t.aborted)||typeof n=="object"&&n!==null&&n.name==="AbortError"}function Y(){const n=new Error("Aborted");return n.name="AbortError",n}function ft(n){n.kind==="bitmap"&&n.source.close()}const xe=192*1024*1024,ve=16,be=2;class Te{constructor(t){h(this,"entries",new Map);h(this,"inFlight",0);h(this,"frame",0);h(this,"bytes",0);h(this,"wanted",[]);h(this,"disposed",false);h(this,"budget");h(this,"maxInFlight");this.options=t,this.budget=t.byteBudget??xe,this.maxInFlight=t.maxInFlight??ve}get(t){const e=this.entries.get(t);if((e==null?void 0:e.state)==="ready")return e.lastUsed=this.frame,e.image}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="ready"}failed(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(t,e){var s;const i=this.entries.get(t);(i==null?void 0:i.state)!=="ready"&&((s=i==null?void 0:i.controller)==null||s.abort(),this.entries.set(t,{url:t,state:"ready",image:e,bytes:Z(e),lastUsed:this.frame,attempts:0,pinned:false,waiters:(i==null?void 0:i.waiters)??[]}),this.bytes+=Z(e),this.flushWaiters(t))}prefetch(t){return Promise.all(t.map(e=>new Promise(i=>{const s=this.entries.get(e.url);if(s&&s.state!=="loading")return i();if(s){s.waiters.push(i);return}this.start({...e,priority:-1},i)}))).then(()=>{})}update(t){if(this.disposed)return;this.frame++;const e=new Set(t.map(i=>i.url));this.wanted=[...t].sort((i,s)=>i.priority-s.priority);for(const i of this.entries.values())i.state==="loading"&&!i.pinned&&!e.has(i.url)&&i.controller&&(i.controller.abort(),this.entries.delete(i.url),this.inFlight--);for(const i of this.wanted){const s=this.entries.get(i.url);s&&(s.lastUsed=this.frame)}this.pump(),this.evict(e)}dispose(){var t;this.disposed=true;for(const e of this.entries.values())(t=e.controller)==null||t.abort(),this.flushWaiters(e.url);this.entries.clear(),this.bytes=0}forEachReady(t){for(const e of this.entries.values())e.state==="ready"&&e.image&&t(e.url,e.image)}pump(){for(const t of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(t.url)||this.start(t)}}start(t,e){const i=new AbortController,s={url:t.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:i,pinned:!!e,waiters:e?[e]:[]};this.entries.set(t.url,s),this.inFlight++,this.attempt(s,t,i,t.url)}attempt(t,e,i,s){t.attempts++,this.options.load(s,i.signal).then(o=>{if(this.disposed||this.entries.get(t.url)!==t){ft(o);return}t.state="ready",t.image=o,t.bytes=Z(o),t.controller=void 0,t.pinned=false,this.bytes+=t.bytes,this.settle(t)},o=>{if(!(i.signal.aborted||this.disposed)&&this.entries.get(t.url)===t){if(t.attempts<be&&!Me(o,e)){this.attempt(t,e,i,e.fallbackUrl??e.url);return}t.state="failed",t.controller=void 0,t.pinned=false,this.settle(t)}})}settle(t){this.inFlight--,this.flushWaiters(t.url),this.options.onSettled(),this.pump()}flushWaiters(t){const e=this.entries.get(t);if(!e)return;const i=e.waiters;e.waiters=[],i.forEach(s=>s())}evict(t){if(this.bytes<=this.budget)return;const e=[...this.entries.values()].filter(i=>i.state==="ready"&&!t.has(i.url)).sort((i,s)=>i.lastUsed-s.lastUsed);for(const i of e){if(this.bytes<=this.budget)break;this.entries.delete(i.url),this.bytes-=i.bytes,i.image&&ft(i.image),this.options.onEvict(i.url)}}}function Z(n){return n.width*n.height*4}function Me(n,t){if(t.fallbackUrl)return false;const e=n==null?void 0:n.status;return typeof e=="number"&&e>=400&&e<500&&e!==408&&e!==429}const Ee=.1;class ke{constructor(t,e=s=>requestAnimationFrame(s),i=s=>cancelAnimationFrame(s)){h(this,"handle",0);h(this,"last",0);h(this,"disposed",false);h(this,"frame",t2=>{if(this.handle=0,this.disposed)return;const e2=this.last?Math.min((t2-this.last)/1e3,Ee):1/60;this.last=t2,this.tick(e2,t2)?this.invalidate():this.last=0});this.tick=t,this.raf=e,this.caf=i}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 Le=2*1024*1024;function _e(n,t,e=Le){const i=new Set;let s=e,o=false;return{get deferred(){return o},getTile(r){const a=n(r);if(!a||a.kind==="media"||a.opaque||i.has(r)||t(r))return a;const u=a.width*a.height*4;if(i.size>0&&u>s){o=true;return}return s-=u,i.add(r),a}}}function Pe(n){const t=/^(!)?(\d+(?:\.\d+)?)$/.exec((n==null?void 0:n.trim())??"");if(!t)return null;const e=Number(t[2]);if(e>360)return null;const i=e%360,s=!!t[1];return i||s?{degrees:i,mirror:s}:null}function Ae(n,t,e){if(!n)return null;let i=n.trim().replace(/^xywh=/,""),s=false;i.startsWith("pct:")?(s=true,i=i.slice(4)):i.startsWith("pixel:")&&(i=i.slice(6));const o=i.split(",").map(Number);if(o.length!==4||o.some(d=>!Number.isFinite(d)))return null;let[r,a,u,c]=o;s&&(r=r/100*t,a=a/100*e,u=u/100*t,c=c/100*e);const m=Math.max(0,r),g=Math.max(0,a),p=Math.min(t,r+u),l=Math.min(e,a+c);return p<=m||l<=g?null:{x:m,y:g,width:p-m,height:l-g}}const G=512,Ie=1024,Se=16e6;function _t(n,t,e){return{width:t,height:e,levels:[{scaleFactor:1,width:t,height:e,tileWidth:t,tileHeight:e,cols:1,rows:1}],tile:s=>({...s,url:n,region:{x:0,y:0,width:t,height:e}})}}function Re(n,t=Ie){const{width:e,height:i}=n,s=[],o=n.regionByPx&&n.sizeByW,r=(l,d,w)=>{const f=Math.ceil(e/l),x=Math.ceil(i/l);return{scaleFactor:l,width:f,height:x,tileWidth:d,tileHeight:w,cols:Math.ceil(f/d),rows:Math.ceil(x/w)}},a=(l,d)=>({scaleFactor:e/l,width:l,height:d,tileWidth:l,tileHeight:d,cols:1,rows:1,whole:true}),u=n.tiles[0];if(u){const{width:l,height:d}=o?Be(n,u,t):u;for(const w of u.scaleFactors)s.push(r(w,l,d))}else if(o){let l=Math.max(G,t);for(;l>G&&!$(n,l,l);)l/=2;for(let d=1;;d*=2){const w=r(d,l,l);if(s.push(w),w.cols===1&&w.rows===1)break}}const c=Math.max(0,...s.map(l=>l.scaleFactor));for(const l of n.sizes){const d=e/l.width;$(n,l.width,l.height)&&d>c+1e-9&&s.push(a(l.width,l.height))}const m=s.reduce((l,d)=>!l||d.scaleFactor>l.scaleFactor?d:l,null);if(m&&m.cols*m.rows>1&&n.sizeByW){const l=Math.max(e,i)/G;s.push(a(Math.ceil(e/l),Math.ceil(i/l)))}(!s.length||!u&&!o&&e*i<=Se)&&(s.some(l=>l.scaleFactor===1)||s.push(a(e,i)));const g=Oe(s).sort((l,d)=>d.scaleFactor-l.scaleFactor),p=Qt(n);return{width:e,height:i,levels:g,tile(l){const d=g[l.level],w=d.scaleFactor,f=d.cols===1&&d.rows===1;let x,v,b;if(f)x={x:0,y:0,width:e,height:i},v=d.width,b=d.height;else{const M=Math.round(l.col*d.tileWidth*w),E=Math.round(l.row*d.tileHeight*w);x={x:M,y:E,width:Math.min(Math.round(d.tileWidth*w),e-M),height:Math.min(Math.round(d.tileHeight*w),i-E)},v=Math.ceil(x.width/w),b=Math.ceil(x.height/w)}return{...l,region:x,url:at(n,x,v,b),fallbackUrl:p?at(n,x,v,b,p):void 0}}}}function Be(n,t,e){let i=Math.max(1,Math.floor(e/Math.max(t.width,t.height)));for(;i>1&&!$(n,t.width*i,t.height*i);)i--;return{width:t.width*i,height:t.height*i}}function $(n,t,e){return!(n.maxWidth&&t>n.maxWidth||n.maxHeight&&e>n.maxHeight||n.maxArea&&t*e>n.maxArea)}function Oe(n){const t=new Map;for(const e of n){const i=`${e.width}x${e.height}`,s=t.get(i);(!s||s.cols*s.rows<e.cols*e.rows)&&t.set(i,e)}return[...t.values()]}function Ce(n,t){const e=n.levels;for(let i=0;i<e.length;i++)if(e[i].scaleFactor<=t*(1+1e-6))return i;return e.length-1}function P(n,t,e){const i=n.levels[t],s=i.tileWidth*i.scaleFactor,o=i.tileHeight*i.scaleFactor,r=Math.max(0,e.x),a=Math.max(0,e.y),u=Math.min(n.width,e.x+e.width),c=Math.min(n.height,e.y+e.height);if(u<=r||c<=a)return[];const m=Math.max(0,Math.floor(r/s)),g=Math.min(i.cols-1,Math.floor((u-1e-9)/s)),p=Math.max(0,Math.floor(a/o)),l=Math.min(i.rows-1,Math.floor((c-1e-9)/o)),d=[];for(let w=p;w<=l;w++)for(let f=m;f<=g;f++)d.push({level:t,col:f,row:w});return d}async function mt(n,t){if(n.media)return ze(n,n.media);let e=null,i=null;if(n.service)try{e=Re(await jt(n.service,t.infoOptions))}catch(p){i=p}if(!e){if(!n.url)throw i??new Error("Image has no source");const p=await t.loadStatic(n.url);t.cache.seed(n.url,p),e=_t(n.url,p.naturalWidth,p.naturalHeight)}const s=n.width&&n.height&&n.width>0&&n.height>0?{width:n.width,height:n.height}:{width:e.width,height:e.height},o=Ae(n.region,s.width,s.height)??{x:0,y:0,width:s.width,height:s.height},r=e.width/s.width,a=e.height/s.height,u={x:o.x*r,y:o.y*a,width:o.width*r,height:o.height*a},c=Pe(n.rotation),m=c?Ue(u,c):void 0;return{id:n.id,spec:n,pyramid:e,size:s,clip:u,contentClip:o,rect:{x:0,y:0,width:o.width,height:o.height},...m?{turn:m}:{}}}function De(n,t){if(n.media)return Promise.resolve();const{pyramid:e,clip:i}=n;return t.prefetch(P(e,0,i).map(s=>{const o=e.tile(s);return{url:o.url,fallbackUrl:o.fallbackUrl}}))}const Pt="media:";function ze(n,t){var a,u;const e=n.width||((a=n.placement)==null?void 0:a.width)||t.element.videoWidth||1600,i=n.height||((u=n.placement)==null?void 0:u.height)||t.element.videoHeight||900,s=`${Pt}${n.id}`,o={width:e,height:i},r={x:0,y:0,width:e,height:i};return{id:n.id,spec:n,pyramid:_t(s,e,i),media:{kind:"media",source:t.element,width:e,height:i,naturalWidth:e,naturalHeight:i},size:o,clip:r,contentClip:r,rect:{...r}}}function Ue(n,{degrees:t,mirror:e}){const i=t*Math.PI/180,s=m=>Math.abs(m)<1e-12?0:m,o=s(Math.cos(i)),r=s(Math.sin(i)),a=Math.abs(n.width*o)+Math.abs(n.height*r),u=Math.abs(n.width*r)+Math.abs(n.height*o),c=A(S(a/2,u/2),{a:o,b:r,c:-r,d:o,e:0,f:0},I(e?-1:1,1),S(-(n.x+n.width/2),-(n.y+n.height/2)));return{orient:c,unorient:zt(c),width:a,height:u}}function At(n){var t;return((t=n.turn)==null?void 0:t.orient)??S(-n.clip.x,-n.clip.y)}function We(n,t){const{turn:e,clip:i}=n;if(!e)return{...t,x:i.x+t.x,y:i.y+t.y};const s=kt(e.unorient,t),o=Math.max(s.x,i.x),r=Math.max(s.y,i.y);return{x:o,y:r,width:Math.max(0,Math.min(s.x+s.width,i.x+i.width)-o),height:Math.max(0,Math.min(s.y+s.height,i.y+i.height)-r)}}function Fe(n,t){const{turn:e,clip:i}=n;return e?Et(e.unorient,t):{x:i.x+t.x,y:i.y+t.y}}function pt(n){const{turn:t,clip:e,contentClip:i}=n;return t?{width:t.width*i.width/e.width,height:t.height*i.height/e.height}:i}function gt(n){if(!n.length)return null;if(n.every(i=>i.spec.placement)){for(const i of n)i.rect={...i.spec.placement};return D(n.map(i=>i.rect))}const t=pt(n[0]).height;let e=0;for(const i of n){const s=pt(i),o=s.width*t/s.height;i.rect={x:e,y:0,width:o,height:t},e+=o}return{x:0,y:0,width:e,height:t}}function W(n){const t=n.turn??n.clip;return{x:n.rect.width/t.width,y:n.rect.height/t.height}}function Ne(n){const t=W(n);return A(S(n.rect.x,n.rect.y),I(t.x,t.y),At(n))}function He(n,t){var e,i;return n.service===t.service&&n.url===t.url&&n.width===t.width&&n.height===t.height&&n.region===t.region&&n.rotation===t.rotation&&((e=n.media)==null?void 0:e.element)===((i=t.media)==null?void 0:i.element)&&JSON.stringify(n.placement)===JSON.stringify(t.placement)}const Ze=5e6,It=1e7,Ge=15e6,Xe=2e7,wt=2;function yt(n){const{items:t,camera:e,viewport:i,pixelRatio:s,getTile:o,destination:r}=n,a=n.has??(l=>o(l)!==void 0),u=Nt(e,i),c=[],m=[],g=[],p=(l,d,w)=>{const f=l.tile(d);m.push({url:f.url,fallbackUrl:f.fallbackUrl,priority:w})};for(const l of t){const{pyramid:d,clip:w,rect:f}=l,x=W(l);if(n.wantOverview)for(const y of P(d,0,w))p(d,y,Xe);const v=xt(l,e,i,s),b=r?xt(l,r,i,s):v;if(g.push((v==null?void 0:v.target)??-1),!v&&!b)continue;const M=y=>T=>{const _=d.tile(T).region;return Math.hypot(_.x+_.width/2-y.x,_.y+_.height/2-y.y)};if(b){const y=M(b.center);for(const T of P(d,0,b.area))p(d,T,y(T)/1e3);if(b.target>0)for(const T of P(d,b.target,b.area))p(d,T,It+y(T))}if(!v)continue;const{area:E,target:k}=v,L=M(v.center),O=P(d,0,E),F=k===0?[]:P(d,k,E);if(b!==v){for(const T of O)p(d,T,L(T)/1e3);const y=k-wt;if(y>0)for(const T of P(d,y,E))p(d,T,Ge+L(T))}const j=k-wt;if(b===v&&j>0){const y=new Set;for(const T of F){const _=d.tile(T);if(!a(_.url))for(const R of P(d,j,_.region)){const B=`${R.col},${R.row}`;y.has(B)||(y.add(B),p(d,R,Ze+L(R)))}}}if(l.spec.hidden)continue;const St=(k===0?O:F).every(y=>o(d.tile(y).url)!==void 0)?[k]:Array.from({length:k+1},(y,T)=>T),Rt=A(u,S(f.x,f.y),I(x.x,x.y),At(l));for(const y of St){const T=y===0?O:y===k?F:P(d,y,E),_=d.levels[y].cols*d.levels[y].rows>1;for(const R of T){const B=d.tile(R),J=o(B.url);if(!J)continue;const tt=Ke(l,B.region,J,Rt,_);tt&&c.push({...tt,url:B.url})}}}return m.sort((l,d)=>l.priority-d.priority),{draws:c,wants:qe(m),levels:g}}function xt(n,t,e,i){const{pyramid:s,rect:o}=n,r=q(t,e);if(!Ut(r,o))return null;const a=W(n),u=Math.max(r.x,o.x),c=Math.max(r.y,o.y),m=Math.min(r.x+r.width,o.x+o.width),g=Math.min(r.y+r.height,o.y+o.height),p=1/(a.x*t.zoom*i);return{area:We(n,{x:(u-o.x)/a.x,y:(c-o.y)/a.y,width:(m-u)/a.x,height:(g-c)/a.y}),center:Fe(n,{x:(t.x-o.x)/a.x,y:(t.y-o.y)/a.y}),target:Ce(s,p)}}function Ke(n,t,e,i,s){const{clip:o}=n,r=Math.max(t.x,o.x),a=Math.max(t.y,o.y),u=Math.min(t.x+t.width,o.x+o.width),c=Math.min(t.y+t.height,o.y+o.height);if(u<=r||c<=a)return null;const m=e.width/t.width,g=e.height/t.height,p=1e-6;return{item:n,image:e,transform:A(i,S(t.x,t.y),I(1/m,1/g)),crop:{x:(r-t.x)*m,y:(a-t.y)*g,width:(u-r)*m,height:(c-a)*g},bleed:{right:s&&u<o.x+o.width-p,bottom:s&&c<o.y+o.height-p}}}function qe(n){const t=new Set;return n.filter(e=>t.has(e.url)?false:(t.add(e.url),true))}const Ve={maxZoomPixelRatio:1.1,minZoomImageRatio:.9,upscale:true,animationTime:.09,animationDuration:void 0,springStiffness:6.5,constrainDuringPan:true,request:void 0,byteBudget:192*1024*1024,maxInFlight:16,releaseAfterMs:2e3},Ye=2,$e=3,Qe=.1,X=1e-6,vt=1e8,je=6,Q={top:0,right:0,bottom:0,left:0};function bt(n,t="padding"){if(!n||typeof getComputedStyle!="function")return Q;const e=getComputedStyle(n),i=s=>parseFloat(e.getPropertyValue(`${t}-${s}`))||0;return{top:i("top"),right:i("right"),bottom:i("bottom"),left:i("left")}}const Je=(n,t)=>n.top===t.top&&n.right===t.right&&n.bottom===t.bottom&&n.left===t.left;let ti;class ei{constructor(t,e={}){h(this,"host");h(this,"overlays",null);h(this,"options");h(this,"backend",null);h(this,"backendPreference");h(this,"contextLosses",0);h(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});h(this,"visible",true);h(this,"dom",null);h(this,"domAsked",false);h(this,"pending",null);h(this,"camera");h(this,"loop");h(this,"gestures");h(this,"gestureOptions",{});h(this,"cache");h(this,"navigator",null);h(this,"navigatorAsked",0);h(this,"viewport",{width:1,height:1});h(this,"inset",Q);h(this,"pixelRatio",1);h(this,"items",[]);h(this,"worldBounds",null);h(this,"contentVersion",0);h(this,"opaqueUrls",new Set);h(this,"mediaByKey",new Map);h(this,"detachMedia",[]);h(this,"opened",false);h(this,"atHome",true);h(this,"interacting",false);h(this,"lastEmitted",null);h(this,"generation",0);h(this,"landing",[]);h(this,"ahead",null);h(this,"listeners",new Map);h(this,"unloadable",false);h(this,"resizeObserver",null);h(this,"intersectionObserver",null);h(this,"releaseTimer",null);h(this,"dprQuery",null);h(this,"disposed",false);h(this,"dismisser",null);h(this,"tick",t2=>{var u,c;if(this.disposed)return false;const e2=this.camera.step(t2,this.viewport),i2=this.camera.current,s2=this.backend,o=_e(this.getTile,m=>s2?s2.has(m):true),r=yt({items:this.items,camera:i2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:o.getTile,has:this.hasTile,wantOverview:!!this.navigator,destination:e2?this.camera.destination:void 0}),a=(this.landing.length?[...this.landing,...r.wants]:r.wants).filter(m=>!m.url.startsWith(Pt));if(this.cache.update(a),this.ahead&&!e2&&!this.cache.pending){const m=this.ahead;this.ahead=null,this.readAhead(m)}return r.draws.length?this.setUnloadable(false):a.length&&a.every(m=>this.cache.failed(m.url))&&this.setUnloadable(true),this.paint(r.draws),(u=this.overlays)==null||u.position(i2,this.viewport),(c=this.navigator)==null||c.render(this.items.filter(m=>!m.spec.hidden),this.worldBounds,q(i2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!st(this.lastEmitted,i2))&&(this.lastEmitted={...i2},this.opened&&this.emit("viewport")),e2||o.deferred});h(this,"getTile",t2=>this.mediaByKey.get(t2)??this.cache.get(t2));h(this,"hasTile",t2=>this.mediaByKey.has(t2)||this.cache.has(t2));h(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});h(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=t,this.backendPreference=e.backend??"auto",this.options={...Ve,...K(e)},Mt()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:i,springStiffness:s}=this.options;this.camera=new ce({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,i===void 0?void 0:{duration:i,stiffness:s}),this.loop=new ke(this.tick),this.gestureOptions=K(e.gestures??{}),Mt()&&(this.gestureOptions.flickMomentum=0),this.gestures=new fe(t,this,{...V,...this.gestureOptions}),this.cache=new Te({load:(o,r)=>this.loadTile(o,r),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:o=>{var r;return(r=this.backend)==null?void 0:r.release(o)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=ii(t),this.visible?this.acquireBackend():this.holder.hiddenSince=Tt(),this.measure(),this.observe()}get backendKind(){var t;return((t=this.backend)==null?void 0:t.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>i==null?void 0:i.delete(e)}async setImages(t,{world:e,fit:i=false}={}){const s=++this.generation,o=()=>s!==this.generation||this.disposed,r=new Map(this.items.map(f=>[f.id,f]));this.landing=[],this.ahead=null;const a=this.prepareContext(),u=[],c=t.map(f=>{const x=r.get(f.id);if(x&&He(x.spec,f))return x.spec=f,{item:Promise.resolve(x),ready:Promise.resolve()};let v,b,M;const E=new Promise((L,O)=>{v=L,b=O}),k=new Promise(L=>M=L);return u.push(()=>mt(f,a).then(L=>(v(L),De(L,this.cache)),b).then(M,M)),{item:E,ready:k}}),m=()=>{var f;return(f=u.shift())==null?void 0:f().then(m)};for(let f=0;f<je;f++)m();const g=t.flatMap(f=>f.placement?[f.placement]:[]);let p=false;if(!this.items.length&&t.length>1&&g.length===t.length){const f=D(e?[e,...g]:g),x=[];c.forEach(({item:v,ready:b},M)=>{Promise.all([v,b]).then(([E])=>{o()||(x[M]=E,this.place(x.filter(Boolean),f,i,!p,false),p=true)},()=>{})})}const l=await Promise.allSettled(c.map(({item:f})=>f));if(o()||(this.landing=this.landingWants(l.flatMap(f=>f.status==="fulfilled"?[f.value]:[]),e,i||!this.opened),this.invalidate(),await Promise.all(c.map(({ready:f})=>f)),o()))return;this.landing=[];const d=l.filter(f=>f.status==="fulfilled").map(f=>f.value),w=l.filter(f=>f.status==="rejected").map(f=>f.reason);w.length&&this.emit("error",w),this.setUnloadable(t.length>0&&!d.length&&w.length>0),this.place(d,e,i,!p,true)}place(t,e,i,s,o){this.items=t,this.watchMedia(t);const r=gt(t);this.worldBounds=e?r?D([e,r]):e:r,this.contentVersion++,this.worldBounds&&(this.opened?s?(i?this.home(true):this.camera.set(this.constrain(this.camera.current)),this.emit("change")):o&&this.emit("change"):(this.opened=true,this.home(true),this.emit("open"))),this.invalidate()}prefetch(t,{world:e}={}){const i=t.filter(s=>!s.media);this.ahead=i.length?{images:i,world:e}:null,this.ahead&&this.invalidate()}async readAhead({images:t,world:e}){const i=this.generation,s=this.prepareContext(),o=(await Promise.allSettled(t.map(a=>mt(a,s)))).flatMap(a=>a.status==="fulfilled"?[a.value]:[]);if(!o.length||i!==this.generation||this.disposed)return;const r=this.landingWants(o,e,true).filter(a=>a.priority<It-vt);await this.cache.prefetch(r)}prepareContext(){return{cache:this.cache,loadStatic:t=>this.loadTile(t),infoOptions:{request:this.options.request}}}clear(){this.setUnloadable(false),this.generation++,this.landing=[],this.ahead=null,this.items=[],this.watchMedia([]),this.worldBounds=null,this.contentVersion++,this.invalidate()}setHidden(t){const e=new Set(t);let i=false;for(const s of this.items){const o=e.has(s.id);!!s.spec.hidden!==o&&(s.spec={...s.spec,hidden:o},i=true)}i&&this.invalidate()}isReady(t){const e=this.items.find(s=>s.id===t);if(!e)return false;if(e.spec.media)return true;const i=e.pyramid.levels[0];if(!i)return false;for(let s=0;s<i.rows;s++)for(let o=0;o<i.cols;o++)if(!this.getTile(e.pyramid.tile({level:0,col:o,row:s}).url))return false;return true}fitBounds(t,e=false,i=Q){const s=this.fit(t,this.camera.destination.rotation,i);this.atHome=false,this.animateTo(this.constrain(s,{allowBeyondLimits:true}),e)}fit(t,e,{top:i,right:s,bottom:o,left:r},a=1/0){const{width:u,height:c}=this.viewport,m=Ht(t,{width:Math.max(1,u-r-s),height:Math.max(1,c-i-o)},e),g=Math.min(m.zoom,a);return{...z(Wt(t),{x:(u+r-s)/2,y:(c+i-o)/2},g,e,this.viewport),zoom:g,rotation:e}}fitItemRect(t,e,i=false){const s=this.itemRectToWorld(t,e);s&&this.fitAnnotation(s,i)}fitAnnotation(t,e=false){var o;const i=this.items[0];if(!i)return;const s=i.rect.width*Qe;this.fitBounds({x:t.x-s,y:t.y-s,width:t.width+s*2,height:t.height+s*2},e,bt((o=this.overlays)==null?void 0:o.container,"scroll-padding"))}getBounds(){return q(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var e;const t=((e=this.homeCamera())==null?void 0:e.zoom)??1;return{home:t,min:t*this.options.minZoomImageRatio,max:Math.max(t,this.closestZoom())}}closestZoom(t=this.items){const e=t.length?Math.min(...t.map(i=>W(i).x)):1;return this.options.maxZoomPixelRatio/e}home(t=false){const e=this.homeCamera();if(!e)return;const i=this.atHome;this.atHome=true,this.animateTo(e,t),!i&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-X)}viewLimits(){const{zoom:t,x:e,y:i,rotation:s}=this.camera.destination,{min:o,max:r}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:t>=r*(1-X),atMin:t<=o*(1+X),atHome:this.atHome&&(!a||Math.abs(t/a.zoom-1)<.001&&Math.hypot(e-a.x,i-a.y)*t<.5&&Math.abs(s-a.rotation)<.001)}}zoomBy(t,e,i=true){const s=i?this.camera.destination:this.camera.current,o=e??{x:this.viewport.width/2,y:this.viewport.height/2},r=it(s,this.viewport,o),{min:a,max:u}=this.getZoomLimits(),c=C(s.zoom*t,a,u),m=z(r,o,c,s.rotation,this.viewport),g=this.constrain({...s,...m,zoom:c});this.atHome=false,i?this.camera.animateTo({state:g,anchor:{world:r,screen:o}},this.viewport):this.camera.set(g),this.invalidate()}panBy(t,e,i=false){const s=i?this.camera.destination:this.camera.current,o=Et(A(I(1/s.zoom),Ft(-s.rotation)),{x:t,y:e}),r=this.constrain({...s,x:s.x-o.x,y:s.y-o.y});this.atHome=false,i?this.camera.animateTo({state:r},this.viewport):this.camera.set(r),this.invalidate()}panTo(t,e=false){const i=e?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...i,...t}),e)}rotateBy(t){const e=this.camera.destination;this.setRotation(e.rotation*180/Math.PI+t)}setRotation(t,e=false){const i=this.camera.destination,s=t*Math.PI/180;this.animateTo(this.constrain({...i,rotation:s}),e)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(t){this.emit("tap",t)}setDismiss(t){this.dismisser=t}dismiss(){var t;return((t=this.dismisser)==null?void 0:t.call(this))??false}setGestures(t){this.gestures.setOptions({...V,...this.gestureOptions,...K(t)})}setInteracting(t){if(this.interacting=t,t){this.camera.stop();return}if(this.options.constrainDuringPan)return;const e=this.camera.destination,i=this.constrain(e);st(e,i)||this.animateTo(i,false)}worldToScreenPoint(t){return Zt(this.camera.current,this.viewport,t)}screenToWorldPoint(t){return it(this.camera.current,this.viewport,t)}itemRectToWorld(t,e){const i=this.items[t];if(!i)return null;const{contentClip:s,clip:o}=i;if(i.turn)return kt(A(Ne(i),I(o.width/s.width,o.height/s.height)),e);const r=i.rect.width/s.width,a=i.rect.height/s.height;return{x:i.rect.x+(e.x-s.x)*r,y:i.rect.y+(e.y-s.y)*a,width:e.width*r,height:e.height*a}}attachNavigator(t){var o;(o=this.navigator)==null||o.dispose(),this.navigator=null;const e=++this.navigatorAsked;let i=null,s=false;return import("./Navigator-CVDhe8R_.mjs").then(r=>{s||this.disposed||e!==this.navigatorAsked||(i=new r.Navigator(t,(a,u)=>this.panTo(a,u)),this.navigator=i,this.invalidate())}),()=>{s=true,i==null||i.dispose(),i&&this.navigator===i&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var t,e,i,s,o,r,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(t=this.resizeObserver)==null||t.disconnect(),(e=this.intersectionObserver)==null||e.disconnect(),(s=(i=this.dprQuery)==null?void 0:i.removeEventListener)==null||s.call(i,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(o=this.navigator)==null||o.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(r=this.dom)==null||r.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(u=>u()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}landingWants(t,e,i){const s=t.map(c=>({...c,rect:{...c.rect}})),o=gt(s),r=e?o?D([e,o]):e:o;if(!r)return[];const a=i?this.homeCamera(r,s):this.camera.destination;if(!a)return[];const{wants:u}=yt({items:s,camera:a,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:c=>this.cache.get(c)});return u.map(c=>({...c,priority:c.priority-vt}))}watchMedia(t){this.detachMedia.forEach(e=>e()),this.detachMedia=[],this.mediaByKey.clear();for(const e of t){if(!e.media||e.media.kind!=="media")continue;const i=e.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(i,e.media);const s=e.media.source,o=()=>this.invalidate(),r=["play","seeked","loadeddata","resize"];r.forEach(a=>s.addEventListener(a,o)),this.detachMedia.push(()=>r.forEach(a=>s.removeEventListener(a,o)))}}paint(t){const e=this.backend,i=[],s=(e==null?void 0:e.kind)==="webgl2";e==null||e.begin();for(const o of t){const{image:r}=o;if(!(r.kind==="media"||r.kind==="element"&&s&&(r.opaque||this.opaqueUrls.has(o.url)))&&e){if(e.draw({key:o.url,source:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1,bleed:o.bleed})!=="tainted"||r.kind==="bitmap")continue;this.opaqueUrls.add(o.url)}(r.kind==="element"||r.kind==="media")&&i.push({key:`${o.item.id}|${o.url}`,element:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1})}e==null||e.end(),this.dom?this.dom.sync(i):i.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-BIFA6J56.mjs").then(({DomLayers:o})=>{if(this.disposed)return;const r=new o(this.host);this.overlays&&this.host.insertBefore(r.container,this.overlays.container),this.dom=r,this.invalidate()}))}loadTile(t,e){return pe(t,{signal:e,request:this.options.request,maxTextureSize:this.backend instanceof U?this.backend.maxTextureSize:void 0})}animateTo(t,e){this.camera.animateTo({state:t},this.viewport,e),this.invalidate()}homeCamera(t=this.worldBounds,e=this.items){if(!t)return null;const i=2*Math.PI,s=Math.round(this.camera.destination.rotation/i)*i||0;return this.fit(t,s,this.inset,this.options.upscale?1/0:this.closestZoom(e))}constrain(t,{allowBeyondLimits:e=false}={}){const i=this.worldBounds;if(!i)return t;const{min:s,max:o}=this.getZoomLimits(),r=e?C(t.zoom,s,Math.max(o,t.zoom)):C(t.zoom,s,o);return this.interacting&&!this.options.constrainDuringPan?{...t,zoom:r}:{...t,zoom:r,x:C(t.x,i.x,i.x+i.width),y:C(t.y,i.y,i.y+i.height)}}acquireBackend(t=true){var o,r;if(this.backend||this.pending||this.disposed)return;const e=document.createElement("canvas");e.className="clover-canvas-surface",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(e,((o=this.dom)==null?void 0:o.container)??((r=this.overlays)==null?void 0:r.container)??null);const i=t&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<$e);let s=null;i&&(Ct(this.holder)||this.backendPreference==="webgl2")&&(s=U.create(e,{onLost:this.onContextLost}),s||et(this.holder)),s?this.install(s):this.backendPreference==="webgl2"?this.none(e):(this.pending=e,(ti??(ti=import("./Canvas2DBackend-kJpOk_Pb.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==e)return;this.pending=null;const u=a.create(e);u?this.install(u):this.none(e)}))}none(t){t.remove(),this.host.dataset.backend="none"}install(t){this.backend=t,this.host.dataset.backend=t.kind,t.resize(this.viewport.width,this.viewport.height,this.pixelRatio),t.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",t.kind),this.invalidate()}releaseBackend(){var e;if(et(this.holder),(e=this.pending)==null||e.remove(),this.pending=null,!this.backend)return;const t=this.backend.canvas;this.backend.dispose(),t.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(t=>{const e=t.some(i=>i.isIntersecting);this.setVisible(e)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(t){var e;if(this.visible=t,t){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(e=this.holder).hiddenSince??(e.hiddenSince=Tt()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(t=false){var u;const e=this.host.getBoundingClientRect(),i=Math.max(1,e.width),s=Math.max(1,e.height),o=bt(this.host),r=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Ye);if(i===this.viewport.width&&s===this.viewport.height&&r===this.pixelRatio&&Je(o,this.inset))return;const a=this.viewport;if(this.viewport={width:i,height:s},this.inset=o,this.pixelRatio=r,(u=this.backend)==null||u.resize(i,s,r),this.opened){if(this.atHome)this.home(true);else{const c=this.camera.current,m=i/Math.max(a.width,1);this.camera.set(this.constrain({...c,zoom:c.zoom*m}))}this.emit("viewport")}t?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var t,e,i,s;typeof window>"u"||typeof window.matchMedia!="function"||((e=(t=this.dprQuery)==null?void 0:t.removeEventListener)==null||e.call(t,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(s=(i=this.dprQuery).addEventListener)==null||s.call(i,"change",this.onPixelRatioChange))}setUnloadable(t){t!==this.unloadable&&(this.unloadable=t,this.emit("unloadable",t))}emit(t,e){var i;(i=this.listeners.get(t))==null||i.forEach(s=>s(e))}}const Tt=()=>typeof performance<"u"?performance.now():Date.now();function ii(n){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:t,left:e,width:i,height:s}=n.getBoundingClientRect();return t+s>=0&&e+i>=0&&t<=window.innerHeight&&e<=window.innerWidth}function Mt(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function K(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}const ui=(n,t)=>new ei(n,t);export{te as b,Jt as h,yt as p,ui as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as c,A as l,x as u,
|
|
1
|
+
import{u as c,A as l,x as u,aK as p,_ as d,k as m}from"./shared-ByrLMUQa.mjs";import"./styles-BOXm_R8o.mjs";const f=new WeakMap;function v(t){let n=f.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:r=>c(y,{...r,render:o})},f.set(t,n)}return n}function b(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(v)}function y({render:t,canvases:n,bodies:o,children:r}){const a=l(null),i=u(p);return d(()=>{const e=a.current;if(!e)return;const s=t(e,{canvases:n,bodies:o,clover:i});return()=>{typeof s=="function"&&s(),e.replaceChildren()}},[t,n,o,i]),c(m,{children:[c("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),r&&c("div",{className:"clover-canvas-controls",children:r})]})}export{b as toRenderers};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as n,
|
|
1
|
+
import{x as n,a3 as o,Q as r}from"./shared-ByrLMUQa.mjs";const t=(s,a)=>a==="canvas"?o(s.manifest,s.canvasId):s.manifest,e=r(null),i=()=>n(e);export{e as P,t as r,i as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a5 as a,a6 as c}from"./shared-ByrLMUQa.mjs";function l(t){try{const o=new URL(t).pathname.split("/").filter(Boolean).pop();return o?decodeURIComponent(o):"download"}catch{return"download"}}async function d(t,o){try{const r=await a(o,t,{referrerPolicy:"no-referrer"});if(!r.ok)return c(r),false;const n=URL.createObjectURL(await r.blob()),e=document.createElement("a");return e.href=n,e.download=l(t),document.body.append(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4),true}catch{return false}}export{l as fileName,d as saveFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aF as w,V as f,af as x,X as S}from"./shared-ByrLMUQa.mjs";const A=10;async function P(r,t,s,o,e){var n,d;const i=(n=r.get().manifest)==null?void 0:n.id;try{const{hits:c,set:u}=await b(t,s,{request:o,signal:e});if(e.aborted||((d=r.get().manifest)==null?void 0:d.id)!==i)return;r.set({search:{query:s,status:"ready",hits:c,set:u}})}catch{if(e.aborted)return;r.set({search:{query:s,status:"error",hits:[],set:null}})}}async function b(r,t,{request:s,signal:o}={}){const e=new URL(r.id);e.searchParams.set("q",t);const i=[];let n=e.toString();const d=new Set;for(;n&&i.length<A&&!d.has(n);){d.add(n);const c=await w(s,n,o);i.push(c),n=V(c)}return $(i,t)}function T(r){var e;const t=f(r)[0];if(typeof t=="string"||!t)return t;const s=t.full??t["@id"],o=(e=f(t.selector)[0])==null?void 0:e.value;return typeof o=="string"&&typeof s=="string"?`${s}#${o}`:s}function V(r){var o;const t=r.next??((o=r.within)==null?void 0:o.next),s=typeof t=="string"?t:(t==null?void 0:t.id)??(t==null?void 0:t["@id"]);return typeof s=="string"?s:null}function $(r,t){var e,i;const s=[],o=[];for(const n of r){const d=Array.isArray(n.resources),c=d?n.resources:f(n.items),u=new Map;for(const a of c){const p=a.id??a["@id"],m=d?T(a.on):f(a.target)[0],v=x(m);if(!p||!v.id)continue;const y=d?(e=a.resource)==null?void 0:e.chars:f(a.body).map(l=>l==null?void 0:l.value).find(l=>typeof l=="string"),I={id:p,setId:S,canvasId:v.id,target:v,motivation:["highlighting"],bodies:[{value:String(y??t)}],annotation:{id:p,type:"Annotation",motivation:["highlighting"],body:{type:"TextualBody",value:String(y??t)},target:m}};u.set(p,I),s.push(I)}const g=d?E(n,u):H(n,u),h=new Set(g.flatMap(a=>a.entryIds));o.push(...g);for(const a of u.values())h.has(a.id)||o.push({id:a.id,canvasId:a.canvasId,entryIds:[a.id],match:((i=a.bodies[0])==null?void 0:i.value)??t})}return{query:t,hits:o,set:{id:S,label:{none:[t]},source:"search",entries:s}}}function E(r,t){var o;const s=[];for(const e of f(r.hits)){const i=f(e.annotations).filter(n=>t.has(n));i.length&&s.push({id:i.join(" "),canvasId:t.get(i[0]).canvasId,entryIds:i,before:e.before,match:String(e.match??((o=t.get(i[0]).bodies[0])==null?void 0:o.value)??""),after:e.after})}return s}function H(r,t){var o,e;const s=[];for(const i of f(r.annotations))for(const n of f(i==null?void 0:i.items))if(f(n==null?void 0:n.motivation).includes("contextualizing"))for(const c of f(n.target)){const u=typeof(c==null?void 0:c.source)=="string"?c.source:(o=c==null?void 0:c.source)==null?void 0:o.id,g=u?t.get(u):void 0;if(!g)continue;const h=f(c.selector).find(a=>(a==null?void 0:a.type)==="TextQuoteSelector");s.push({id:`${n.id??u}#${u}`,canvasId:g.canvasId,entryIds:[g.id],before:h==null?void 0:h.prefix,match:String((h==null?void 0:h.exact)??((e=g.bodies[0])==null?void 0:e.value)??""),after:h==null?void 0:h.suffix})}return s}export{$ as readResults,b as search,P as searchInto};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ur=Object.defineProperty;var fr=(e,t,n)=>t in e?ur(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var se=(e,t,n)=>fr(e,typeof t!="symbol"?t+"":t,n);import{a as Ie}from"./index-Ciz5x8Tt.mjs";const dr=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","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","playerCurrentTime":"Current time","playerDuration":"Duration","splitHandle":"Resize panels"}'),Gn={es:()=>import("./es-Bx-zZBfZ.mjs"),fi:()=>import("./fi-DsP1FhBy.mjs"),fr:()=>import("./fr-BuL_F9Jq.mjs"),it:()=>import("./it-DH3EtrgI.mjs"),ja:()=>import("./ja-BEHbDotv.mjs"),nb:()=>import("./nb-Bdfn_mZs.mjs"),nn:()=>import("./nn-BCWbSuK0.mjs"),no:()=>import("./no-Bdfn_mZs.mjs"),pt:()=>import("./pt-Da5El49z.mjs"),"zh-Hans":()=>import("./zh-Hans-BhTHTZXT.mjs"),"zh-Hant":()=>import("./zh-Hant-_CJAOTzC.mjs")};function Mt(){return typeof navigator>"u"?[]:[...navigator.languages??[],navigator.language].filter(Boolean)}function Zn(){if(!(typeof document>"u"))return document.documentElement.lang||void 0}let Yn=()=>[];function _r(e){Yn=e}function pr(){const[e,...t]=Yn();return[...new Set([e,...Mt(),...t,Zn()].filter(n=>!!n))]}const Qe=e=>e.split("-")[0];function hr(e,t){return Qe(e).toLowerCase()===Qe(t).toLowerCase()}function vt(e){try{const{language:t,script:n}=new Intl.Locale(e).maximize();return n&&`${t}-${n}`}catch{return}}function vr(e,t){const n=vt(e);if(n)return t.find(o=>o!=="none"&&o!=="@none"&&vt(o)===n)}const at=e=>e.includes("-")?Qe(e):null;function mr(e,t,n=[]){if(!t.length)return;if(t.length===1)return t[0];const o=()=>t.includes("none")?"none":t.includes("@none")?"@none":t[0];if(!e)return t.includes("none")?"none":t[0];if(t.includes(e))return e;const r=at(e);if(r&&t.includes(r))return r;const s=vr(e,t);if(s)return s;const i=n.find(c=>t.includes(c));if(i)return i;const a=t.findIndex(c=>at(c)===e);if(a!==-1)return t[a];for(const c of n){const l=at(c);if(l&&t.includes(l))return l}return o()}function Xn(e,t){const[n,...o]=t?[t]:pr();return mr(n,e,o)??e[0]}function Wi(e,t,n){if(n&&e.includes(n))return n;if(!e.length)return;const o=Xn(e,t);return o==="none"?e[0]:o}const Y="clover",K={en:{[Y]:{...dr}}};let Me=[],q,et=[],Qn=[],Et=0;const mt=new Set;function Tt(){Et++,mt.forEach(e=>e())}function eo(e){return[e,vt(e),Qe(e)].filter(t=>!!t)}const gr=e=>e==="en"||to(e)||!!K[e],de=e=>eo(e).find(gr),Qt=new Map,to=e=>Object.prototype.hasOwnProperty.call(Gn,e);function yr(e){let t=Qt.get(e);return t||(t=Gn[e]().then(({default:n})=>{var o;K[e]={...K[e],[Y]:{...n,...(o=K[e])==null?void 0:o[Y]}},Tt()},()=>{}),Qt.set(e,t)),t}function gt(e){const t=e.find(n=>n==="en"||to(n));return t&&t!=="en"?yr(t):Promise.resolve()}let qe=[],en="",Ne="en";function nt(){const e=Zn();return[...new Set([...Me,...e?[e]:[]])]}function fe(){const e=`${Et} ${typeof document<"u"?document.documentElement.lang:""} ${typeof navigator<"u"?navigator.languages:""}`;if(e===en)return qe;en=e;const t=nt();return Ne=Mt().map(de).find(Boolean)??t.map(de).find(Boolean)??"en",qe=[...new Set([q??Ne,...Qn,...t].filter(o=>!!o).flatMap(eo).concat("en"))],gt(qe),qe}function br(){return fe(),[...new Set([Ne,...nt().map(de),...et.map(de)].filter(e=>!!e))]}_r(()=>(fe(),[q,Ne,...nt()]));function no(e,t){if(e)return hr(e,t||L.resolvedLanguage)?void 0:e}const L={get language(){return q??fe().find(e=>K[e])??"en"},get chosenLanguage(){return q},stringsFor(e){return de(e)},interfaceLanguages(){return{languages:br(),chosen:q&&de(q)||Ne}},chooseInterfaceLanguage(e){return q=e||void 0,et=q?[...new Set([...et,q])]:[],Tt(),gt(fe())},get resolvedLanguage(){return fe().find(e=>{var t;return Object.keys(((t=K[e])==null?void 0:t[Y])??{}).length>0})??"en"},changeLanguage(e){return L.chooseInterfaceLanguage(e)},resolve(e,t,n=Y){var r,s;let o={text:e};for(const i of fe()){const a=(s=(r=K[i])==null?void 0:r[n])==null?void 0:s[e];if(a!==void 0){o={text:a,lang:i};break}}return t?{...o,text:o.text.replace(/\{\{(\w+)\}\}/g,(i,a)=>a in t?String(t[a]):i)}:o},t(e,t,n=Y){return L.resolve(e,t,n).text},langOf(e,t,n=Y){return no(L.resolve(e,void 0,n).lang,t)},ready(){return gt(fe())},subscribe(e){return mt.add(e),()=>{mt.delete(e)}},getSnapshot(){return Et}};typeof document<"u"&&fe();function wr(e={}){for(const[n,o]of Object.entries(e.resources??{}))for(const[r,s]of Object.entries(o??{}))K[n]??(K[n]={}),K[n][r]={...K[n][r],...s};e.fallbackLng!==void 0&&(Qn=e.fallbackLng===false?[]:[e.fallbackLng].flat());const t=Me.join();if(e.languages!==void 0?Me=[e.languages].flat().filter(Boolean):e.lng&&(Me=[e.lng]),Me.join()!==t){et=[];const n=[...Mt(),...nt()].map(de);q&&!n.includes(de(q))&&(q=void 0)}return Tt(),L}const Vi=Object.freeze(Object.defineProperty({__proto__:null,CLOVER_I18N_NAMESPACE:Y,cloverI18n:L,initCloverI18n:wr,langWithin:no},Symbol.toStringTag,{value:"Module"}));var Fe,x,oo,he,tn,ro,so,io,$t,yt,bt,ao,Le={},co=[],Sr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,He=Array.isArray;function te(e,t){for(var n in t)e[n]=t[n];return e}function Nt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ae(e,t,n){var o,r,s,i={};for(s in t)s=="key"?o=t[s]:s=="ref"?r=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?Fe.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)i[s]===void 0&&(i[s]=e.defaultProps[s]);return Te(e,i,o,r,null)}function Te(e,t,n,o,r){var s={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++oo,__i:-1,__u:0};return r==null&&x.vnode!=null&&x.vnode(s),s}function Cr(){return{current:null}}function Q(e){return e.children}function X(e,t){this.props=e,this.context=t}function Ce(e,t){if(t==null)return e.__?Ce(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Ce(e):null}function lo(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return lo(e)}}function wt(e){(!e.__d&&(e.__d=true)&&he.push(e)&&!tt.__r++||tn!=x.debounceRendering)&&((tn=x.debounceRendering)||ro)(tt)}function tt(){for(var e,t,n,o,r,s,i,a=1;he.length;)he.length>a&&he.sort(so),e=he.shift(),a=he.length,e.__d&&(n=void 0,o=void 0,r=(o=(t=e).__v).__e,s=[],i=[],t.__P&&((n=te({},o)).__v=o.__v+1,x.vnode&&x.vnode(n),Lt(t.__P,n,o,t.__n,t.__P.namespaceURI,32&o.__u?[r]:null,s,r??Ce(o),!!(32&o.__u),i),n.__v=o.__v,n.__.__k[n.__i]=n,_o(s,n,i),o.__e=o.__=null,n.__e!=r&&lo(n)));tt.__r=0}function uo(e,t,n,o,r,s,i,a,c,l,d){var u,p,v,g,P,I,k,C=o&&o.__k||co,b=t.length;for(c=xr(n,t,C,c,b),u=0;u<b;u++)(v=n.__k[u])!=null&&(p=v.__i==-1?Le:C[v.__i]||Le,v.__i=u,I=Lt(e,v,p,r,s,i,a,c,l,d),g=v.__e,v.ref&&p.ref!=v.ref&&(p.ref&&Rt(p.ref,null,v),d.push(v.ref,v.__c||g,v)),P==null&&g!=null&&(P=g),(k=!!(4&v.__u))||p.__k===v.__k?c=fo(v,c,e,k):typeof v.type=="function"&&I!==void 0?c=I:g&&(c=g.nextSibling),v.__u&=-7);return n.__e=P,c}function xr(e,t,n,o,r){var s,i,a,c,l,d=n.length,u=d,p=0;for(e.__k=new Array(r),s=0;s<r;s++)(i=t[s])!=null&&typeof i!="boolean"&&typeof i!="function"?(c=s+p,(i=e.__k[s]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?Te(null,i,null,null,null):He(i)?Te(Q,{children:i},null,null,null):i.constructor==null&&i.__b>0?Te(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,a=null,(l=i.__i=kr(i,n,c,u))!=-1&&(u--,(a=n[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>d?p--:r<d&&p++),typeof i.type!="function"&&(i.__u|=4)):l!=c&&(l==c-1?p--:l==c+1?p++:(l>c?p--:p++,i.__u|=4))):e.__k[s]=null;if(u)for(s=0;s<d;s++)(a=n[s])!=null&&!(2&a.__u)&&(a.__e==o&&(o=Ce(a)),ho(a,a));return o}function fo(e,t,n,o){var r,s;if(typeof e.type=="function"){for(r=e.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=e,t=fo(r[s],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Ce(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ie(e,t){return t=t||[],e==null||typeof e=="boolean"||(He(e)?e.some(function(n){ie(n,t)}):t.push(e)),t}function kr(e,t,n,o){var r,s,i,a=e.key,c=e.type,l=t[n],d=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||d&&a==l.key&&c==l.type)return n;if(o>(d?1:0)){for(r=n-1,s=n+1;r>=0||s<t.length;)if((l=t[i=r>=0?r--:s++])!=null&&!(2&l.__u)&&a==l.key&&c==l.type)return i}return-1}function nn(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Sr.test(t)?n:n+"px"}function Je(e,t,n,o,r){var s,i;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||nn(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||nn(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(io,"$1")),i=t.toLowerCase(),t=i in e||t=="onFocusOut"||t=="onFocusIn"?i.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?o?n.u=o.u:(n.u=$t,e.addEventListener(t,s?bt:yt,s)):e.removeEventListener(t,s?bt:yt,s);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===false&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function on(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=$t++;else if(t.t<n.u)return;return n(x.event?x.event(t):t)}}}function Lt(e,t,n,o,r,s,i,a,c,l){var d,u,p,v,g,P,I,k,C,b,O,T,j,oe,Z,W,ee,B=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=t.__e=n.__e]),(d=x.__b)&&d(t);e:if(typeof B=="function")try{if(k=t.props,C="prototype"in B&&B.prototype.render,b=(d=B.contextType)&&o[d.__c],O=d?b?b.props.value:d.__:o,n.__c?I=(u=t.__c=n.__c).__=u.__E:(C?t.__c=u=new B(k,O):(t.__c=u=new X(k,O),u.constructor=B,u.render=Or),b&&b.sub(u),u.props=k,u.state||(u.state={}),u.context=O,u.__n=o,p=u.__d=true,u.__h=[],u._sb=[]),C&&u.__s==null&&(u.__s=u.state),C&&B.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=te({},u.__s)),te(u.__s,B.getDerivedStateFromProps(k,u.__s))),v=u.props,g=u.state,u.__v=t,p)C&&B.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),C&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(C&&B.getDerivedStateFromProps==null&&k!==v&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(k,O),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(k,u.__s,O)===false||t.__v==n.__v){for(t.__v!=n.__v&&(u.props=k,u.state=u.__s,u.__d=false),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(V){V&&(V.__=t)}),T=0;T<u._sb.length;T++)u.__h.push(u._sb[T]);u._sb=[],u.__h.length&&i.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(k,u.__s,O),C&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(v,g,P)})}if(u.context=O,u.props=k,u.__P=e,u.__e=false,j=x.__r,oe=0,C){for(u.state=u.__s,u.__d=false,j&&j(t),d=u.render(u.props,u.state,u.context),Z=0;Z<u._sb.length;Z++)u.__h.push(u._sb[Z]);u._sb=[]}else do u.__d=false,j&&j(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++oe<25);u.state=u.__s,u.getChildContext!=null&&(o=te(te({},o),u.getChildContext())),C&&!p&&u.getSnapshotBeforeUpdate!=null&&(P=u.getSnapshotBeforeUpdate(v,g)),W=d,d!=null&&d.type===Q&&d.key==null&&(W=po(d.props.children)),a=uo(e,He(W)?W:[W],t,n,o,r,s,i,a,c,l),u.base=t.__e,t.__u&=-161,u.__h.length&&i.push(u),I&&(u.__E=u.__=null)}catch(V){if(t.__v=null,c||s!=null)if(V.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(ee=s.length;ee--;)Nt(s[ee]);St(t)}else t.__e=n.__e,t.__k=n.__k,V.then||St(t);x.__e(V,t,n)}else s==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=Ir(n.__e,t,n,o,r,s,i,c,l);return(d=x.diffed)&&d(t),128&t.__u?void 0:a}function St(e){e&&e.__c&&(e.__c.__e=true),e&&e.__k&&e.__k.forEach(St)}function _o(e,t,n){for(var o=0;o<n.length;o++)Rt(n[o],n[++o],n[++o]);x.__c&&x.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(s){s.call(r)})}catch(s){x.__e(s,r.__v)}})}function po(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:He(e)?e.map(po):te({},e)}function Ir(e,t,n,o,r,s,i,a,c){var l,d,u,p,v,g,P,I=n.props,k=t.props,C=t.type;if(C=="svg"?r="http://www.w3.org/2000/svg":C=="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((v=s[l])&&"setAttribute"in v==!!C&&(C?v.localName==C:v.nodeType==3)){e=v,s[l]=null;break}}if(e==null){if(C==null)return document.createTextNode(k);e=document.createElementNS(r,C,k.is&&k),a&&(x.__m&&x.__m(t,s),a=false),s=null}if(C==null)I===k||a&&e.data==k||(e.data=k);else{if(s=s&&Fe.call(e.childNodes),I=n.props||Le,!a&&s!=null)for(I={},l=0;l<e.attributes.length;l++)I[(v=e.attributes[l]).name]=v.value;for(l in I)if(v=I[l],l!="children"){if(l=="dangerouslySetInnerHTML")u=v;else if(!(l in k)){if(l=="value"&&"defaultValue"in k||l=="checked"&&"defaultChecked"in k)continue;Je(e,l,null,v,r)}}for(l in k)v=k[l],l=="children"?p=v:l=="dangerouslySetInnerHTML"?d=v:l=="value"?g=v:l=="checked"?P=v:a&&typeof v!="function"||I[l]===v||Je(e,l,v,I[l],r);if(d)a||u&&(d.__html==u.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),uo(t.type=="template"?e.content:e,He(p)?p:[p],t,n,o,C=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,i,s?s[0]:n.__k&&Ce(n,0),a,c),s!=null)for(l=s.length;l--;)Nt(s[l]);a||(l="value",C=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[l]||C=="progress"&&!g||C=="option"&&g!=I[l])&&Je(e,l,g,I[l],r),l="checked",P!=null&&P!=e[l]&&Je(e,l,P,I[l],r))}return e}function Rt(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(r){x.__e(r,n)}}function ho(e,t,n){var o,r;if(x.unmount&&x.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Rt(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(s){x.__e(s,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&ho(o[r],t,n||typeof e.type!="function");n||Nt(e.__e),e.__c=e.__=e.__e=void 0}function Or(e,t,n){return this.constructor(e,n)}function Re(e,t,n){var o,r,s,i;t==document&&(t=document.documentElement),x.__&&x.__(e,t),r=(o=typeof n=="function")?null:n&&n.__k||t.__k,s=[],i=[],Lt(t,e=(!o&&n||t).__k=ae(Q,null,[e]),r||Le,Le,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?Fe.call(t.childNodes):null,s,!o&&n?n:r?r.__e:t.firstChild,o,i),_o(s,e,i)}function vo(e,t){Re(e,t,vo)}function Ar(e,t,n){var o,r,s,i,a=te({},e.props);for(s in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)s=="key"?o=t[s]:s=="ref"?r=t[s]:a[s]=t[s]===void 0&&i!=null?i[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?Fe.call(arguments,2):n),Te(e.type,a,o||e.key,r||e.ref,null)}function De(e){function t(n){var o,r;return this.getChildContext||(o=new Set,(r={})[t.__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,wt(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 t.__c="__cC"+ao++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,o){return n.children(o)}).contextType=t,t}Fe=co.slice,x={__e:function(e,t,n,o){for(var r,s,i;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(e)),i=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),i=r.__d),i)return r.__E=r}catch(a){e=a}throw e}},oo=0,X.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=te({},this.state),typeof e=="function"&&(e=e(te({},n),this.props)),e&&te(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),wt(this))},X.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),wt(this))},X.prototype.render=Q,he=[],ro=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,so=function(e,t){return e.__v.__b-t.__v.__b},tt.__r=0,io=/(PointerCapture)$|Capture$/i,$t=0,yt=on(false),bt=on(true),ao=0;var Pr=0;function R(e,t,n,o,r,s){t||(t={});var i,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?i=t[a]:c[a]=t[a];var l={type:e,props:c,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Pr,__i:-1,__u:0,__source:r,__self:s};if(typeof e=="function"&&(i=e.defaultProps))for(a in i)c[a]===void 0&&(c[a]=i[a]);return x.vnode&&x.vnode(l),l}var _e,$,ct,rn,xe=0,mo=[],N=x,sn=N.__b,an=N.__r,cn=N.diffed,ln=N.__c,un=N.unmount,fn=N.__;function Oe(e,t){N.__h&&N.__h($,e,xe||t),xe=0;var n=$.__H||($.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function J(e){return xe=1,Ut(bo,e)}function Ut(e,t,n){var o=Oe(_e++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):bo(void 0,t),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=$,!$.__f)){var r=function(a,c,l){if(!o.__c.__H)return true;var d=o.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!s||s.call(this,a,c,l);var u=o.__c.props!==a;return d.forEach(function(p){if(p.__N){var v=p.__[0];p.__=p.__N,p.__N=void 0,v!==p.__[0]&&(u=true)}}),s&&s.call(this,a,c,l)||u};$.__f=true;var s=$.shouldComponentUpdate,i=$.componentWillUpdate;$.componentWillUpdate=function(a,c,l){if(this.__e){var d=s;s=void 0,r(a,c,l),s=d}i&&i.call(this,a,c,l)},$.shouldComponentUpdate=r}return o.__N||o.__}function F(e,t){var n=Oe(_e++,3);!N.__s&&Ht(n.__H,t)&&(n.__=e,n.u=t,$.__H.__h.push(n))}function G(e,t){var n=Oe(_e++,4);!N.__s&&Ht(n.__H,t)&&(n.__=e,n.u=t,$.__h.push(n))}function H(e){return xe=5,ve(function(){return{current:e}},[])}function go(e,t,n){xe=6,G(function(){if(typeof e=="function"){var o=e(t());return function(){e(null),o&&typeof o=="function"&&o()}}if(e)return e.current=t(),function(){return e.current=null}},n==null?n:n.concat(e))}function ve(e,t){var n=Oe(_e++,7);return Ht(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ce(e,t){return xe=8,ve(function(){return e},t)}function pe(e){var t=$.context[e.__c],n=Oe(_e++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub($)),t.props.value):e.__}function yo(e,t){N.useDebugValue&&N.useDebugValue(t?t(e):e)}function Ft(){var e=Oe(_e++,11);if(!e.__){for(var t=$.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Mr(){for(var e;e=mo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ze),e.__H.__h.forEach(Ct),e.__H.__h=[]}catch(t){e.__H.__h=[],N.__e(t,e.__v)}}N.__b=function(e){$=null,sn&&sn(e)},N.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),fn&&fn(e,t)},N.__r=function(e){an&&an(e),_e=0;var t=($=e.__c).__H;t&&(ct===$?(t.__h=[],$.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Ze),t.__h.forEach(Ct),t.__h=[],_e=0)),ct=$},N.diffed=function(e){cn&&cn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(mo.push(t)!==1&&rn===N.requestAnimationFrame||((rn=N.requestAnimationFrame)||Er)(Mr)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),ct=$=null},N.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ze),n.__h=n.__h.filter(function(o){return!o.__||Ct(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],N.__e(o,n.__v)}}),ln&&ln(e,t)},N.unmount=function(e){un&&un(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{Ze(o)}catch(r){t=r}}),n.__H=void 0,t&&N.__e(t,n.__v))};var dn=typeof requestAnimationFrame=="function";function Er(e){var t,n=function(){clearTimeout(o),dn&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);dn&&(t=requestAnimationFrame(n))}function Ze(e){var t=$,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),$=t}function Ct(e){var t=$;e.__c=e.__(),$=t}function Ht(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function bo(e,t){return typeof t=="function"?t(e):t}function wo(e,t){for(var n in t)e[n]=t[n];return e}function xt(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return true;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return true;return false}function ne(e,t){var n=t(),o=J({t:{__:n,u:t}}),r=o[0].t,s=o[1];return G(function(){r.__=n,r.u=t,lt(r)&&s({t:r})},[e,n,t]),F(function(){return lt(r)&&s({t:r}),e(function(){lt(r)&&s({t:r})})},[e]),n}function lt(e){var t,n,o=e.u,r=e.__;try{var s=o();return!((t=r)===(n=s)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return true}}function So(e){e()}function Co(e){return e}function xo(){return[false,So]}var ko=G;function kt(e,t){this.props=e,this.context=t}function Dt(e,t){function n(r){var s=this.props.ref,i=s==r.ref;return!i&&s&&(s.call?s(null):s.current=null),t?!t(this.props,r)||!i:xt(this.props,r)}function o(r){return this.shouldComponentUpdate=n,ae(e,r)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=true,o.__f=true,o.type=e,o}(kt.prototype=new X).isPureReactComponent=true,kt.prototype.shouldComponentUpdate=function(e,t){return xt(this.props,e)||xt(this.state,t)};var _n=x.__b;x.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),_n&&_n(e)};var Tr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function $r(e){function t(n){var o=wo({},n);return delete o.ref,e(o,n.ref||null)}return t.$$typeof=Tr,t.render=e,t.prototype.isReactComponent=t.__f=true,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var pn=function(e,t){return e==null?null:ie(ie(e).map(t))},Nr={map:pn,forEach:pn,count:function(e){return e?ie(e).length:0},only:function(e){var t=ie(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ie},Lr=x.__e;x.__e=function(e,t,n,o){if(e.then){for(var r,s=t;s=s.__;)if((r=s.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}Lr(e,t,n,o)};var hn=x.unmount;function Io(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=wo({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=true,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return Io(o,t,n)})),e}function Oo(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return Oo(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function Ye(){this.__u=0,this.o=null,this.__b=null}function Ao(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Rr(e){var t,n,o;function r(s){if(t||(t=e()).then(function(i){n=i.default||i},function(i){o=i}),o)throw o;if(!n)throw t;return ae(n,s)}return r.displayName="Lazy",r.__f=true,r}function Ee(){this.i=null,this.l=null}x.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),hn&&hn(e)},(Ye.prototype=new X).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=Ao(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]=Oo(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&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(i,i)},Ye.prototype.componentWillUnmount=function(){this.o=[]},Ye.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Io(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&ae(Q,null,e.fallback);return r&&(r.__u&=-33),[ae(Q,null,t.__a?null:e.children),r]};var vn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Ur(e){return this.getChildContext=function(){return e.context},e.children}function Fr(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){Re(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;o!==null&&!o.__m&&o.__!==null;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return true},insertBefore:function(r,s){this.childNodes.push(r),t.h.insertBefore(r,s)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.h.removeChild(r)}}}Re(ae(Ur,{context:t.context},e.__v),t.v)}function jt(e,t){var n=ae(Fr,{__v:e,h:t});return n.containerInfo=t,n}(Ee.prototype=new X).__a=function(e){var t=this,n=Ao(t.__v),o=t.l.get(e);return o[0]++,function(r){var s=function(){t.props.revealOrder?(o.push(r),vn(t,e,o)):r()};n?n(s):s()}},Ee.prototype.render=function(e){this.i=null,this.l=new Map;var t=ie(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ee.prototype.componentDidUpdate=Ee.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){vn(e,n,t)})};var Po=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Hr=/^(?: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]/,Dr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,jr=/[A-Z0-9]/g,Br=typeof document<"u",Wr=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Mo(e,t,n){return t.__k==null&&(t.textContent=""),Re(e,t),typeof n=="function"&&n(),e?e.__c:null}function Vr(e,t,n){return vo(e,t),typeof n=="function"&&n(),e?e.__c:null}X.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(X.prototype,e,{configurable:true,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t})}})});var mn=x.event;function zr(){}function qr(){return this.cancelBubble}function Jr(){return this.defaultPrevented}x.event=function(e){return mn&&(e=mn(e)),e.persist=zr,e.isPropagationStopped=qr,e.isDefaultPrevented=Jr,e.nativeEvent=e};var Bt,Kr={enumerable:false,configurable:true,get:function(){return this.class}},gn=x.vnode;x.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,o=t.type,r={},s=o.indexOf("-")===-1;for(var i in n){var a=n[i];if(!(i==="value"&&"defaultValue"in n&&a==null||Br&&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"||Wr(n.type)?c==="onfocus"?i="onfocusin":c==="onblur"?i="onfocusout":Dr.test(i)&&(i=c):c=i="oninput":s&&Hr.test(i)?i=i.replace(jr,"-$&").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=ie(n.children).forEach(function(l){l.props.selected=r.value.indexOf(l.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=ie(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",Kr)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),t.props=r}(e),e.$$typeof=Po,gn&&gn(e)};var yn=x.__r;x.__r=function(e){yn&&yn(e),Bt=e.__c};var bn=x.diffed;x.diffed=function(e){bn&&bn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Bt=null};var Gr={ReactCurrentDispatcher:{current:{readContext:function(e){return Bt.__n[e.__c].props.value},useCallback:ce,useContext:pe,useDebugValue:yo,useDeferredValue:Co,useEffect:F,useId:Ft,useImperativeHandle:go,useInsertionEffect:ko,useLayoutEffect:G,useMemo:ve,useReducer:Ut,useRef:H,useState:J,useSyncExternalStore:ne,useTransition:xo}}};function Zr(e){return ae.bind(null,e)}function ot(e){return!!e&&e.$$typeof===Po}function Yr(e){return ot(e)&&e.type===Q}function Xr(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Qr(e){return ot(e)?Ar.apply(null,arguments):e}function Eo(e){return!!e.__k&&(Re(null,e),true)}function es(e){return e&&(e.base||e.nodeType===1&&e)||null}var ts=function(e,t){return e(t)},ns=function(e,t){return e(t)},os=Q,rs=ot,zi={useState:J,useId:Ft,useReducer:Ut,useEffect:F,useLayoutEffect:G,useInsertionEffect:ko,useTransition:xo,useDeferredValue:Co,useSyncExternalStore:ne,startTransition:So,useRef:H,useImperativeHandle:go,useMemo:ve,useCallback:ce,useContext:pe,useDebugValue:yo,version:"18.3.1",Children:Nr,render:Mo,hydrate:Vr,unmountComponentAtNode:Eo,createPortal:jt,createElement:ae,createContext:De,createFactory:Zr,cloneElement:Qr,createRef:Cr,Fragment:Q,isValidElement:ot,isElement:rs,isFragment:Yr,isMemo:Xr,findDOMNode:es,Component:X,PureComponent:kt,memo:Dt,forwardRef:$r,flushSync:ns,unstable_batchedUpdates:ts,StrictMode:os,Suspense:Ye,SuspenseList:Ee,lazy:Rr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Gr};function ss(e){return{render:function(t){Mo(t,e)},unmount:function(){Eo(e)}}}const Wt=De("");function is(){return pe(Wt)+Ft()}Ie(1,"styles/scale","@layer clover{:root{--clover-space-3xs: .146rem;--clover-space-2xs: .236rem;--clover-space-xs: .382rem;--clover-space-s: .618rem;--clover-space-m: 1rem;--clover-space-l: 1.618rem;--clover-space-xl: 2.618rem;--clover-space-2xl: 4.236rem;--clover-text-xs: .764rem;--clover-text-s: .854rem;--clover-text-m: 1.146rem;--clover-text-l: 1.236rem;--clover-control: calc(1rem + 2 * var(--clover-space-s));--clover-inset: var(--clover-space-l);--clover-picture: calc(4 * var(--clover-space-xl))}:where(.clover-title){margin:0;font-weight:var(--clover-title-weight, 400);line-height:1.25;overflow-wrap:anywhere}:where(.clover-root,.clover-canvas,.clover-items,.clover-geomap) :where(button,input,select,textarea){font:inherit}:where(.clover-field-pill-query,.clover-collection-select-control){box-sizing:border-box;padding:var(--clover-space-xs) var(--clover-space-s);border:1px solid var( --clover-field-edge, color-mix( in srgb, var(--clover-color-primary-muted, #26292b) 80%, var(--clover-color-secondary, #fff) ) );border-radius:var(--clover-radius, 3px);background-color:var(--clover-color-secondary, #fff);color:var(--clover-color-primary, #1a1d1e)}:where(.clover-field-pill-query,.clover-collection-select-control):focus-visible{outline:2px solid var(--clover-color-accent, #0065c3);outline-offset:1px}:where(.clover-field-pill-query)::placeholder{color:color-mix(in srgb,var(--clover-color-primary, #1a1d1e) 65%,var(--clover-color-secondary, #fff));opacity:1}}");Ie(2,"styles/contrast","@layer clover{:where([data-high-contrast]){--clover-accent-fill: var(--clover-color-control, #1a1d1e);--clover-accent-ring: 3px solid var(--clover-color-accent, #0065c3);--clover-accent-ring-hover: 3px solid color-mix(in srgb, var(--clover-color-accent, #0065c3) 50%, transparent);--clover-accent-text-fallback: var(--clover-color-primary, #1a1d1e);--clover-transition: none}}");const as="clover-root",To=Symbol("roots"),cs=[];class $o{constructor(t){se(this,"entries",new Map);se(this,"lists",new Map);se(this,"listeners",new Map);se(this,"languages",new ls(t2=>this.entries.has(t2)));this.count=t}list(t){return this.lists.get(t)??cs}subscribe(t,n){let o=this.listeners.get(t);return o||this.listeners.set(t,o=new Set),o.add(n),()=>{o.delete(n)}}connect(t){var s;const n=t.kind==="part"?((s=t.element.parentElement)==null?void 0:s.closest(as))??null:null,o=this.entries.get(t.element);if(o&&o.root===n)return;const r={hosted:t,key:(o==null?void 0:o.key)??++this.count.made,root:n};this.entries.set(t.element,r),o&&this.change(ut(o),i=>i.filter(a=>a!==o)),this.change(ut(r),i=>[...i,r]),t.needsRoot&&!n&&console.warn(`<${t.element.localName}> shows a <clover-root>'s state: put it inside one.`),t.kind!=="root"&&this.languages.draws(t.element.localName),(t.kind!=="part"||!n)&&this.languages.watch(t.element)}disconnect(t){const n=this.entries.get(t);n&&(this.entries.delete(t),this.change(ut(n),o=>o.filter(r=>r!==n)))}change(t,n){var o;this.lists.set(t,n(this.list(t))),(o=this.listeners.get(t))==null||o.forEach(r=>r())}}const ut=e=>e.hosted.kind==="root"?To:e.root;class ls{constructor(t){se(this,"observer",null);se(this,"tags",new Set);this.isElement=t}draws(t){this.tags.add(t)}watch(t){this.observer??(this.observer=new MutationObserver(n=>{const o=[...this.tags,".clover-announcer"].join(",");for(const{target:r}of n){const s=r;s.getAttribute("lang")!==""||this.isElement(s)||s.closest(o)&&s.removeAttribute("lang")}})),this.observer.observe(t,{subtree:true,attributes:true,attributeFilter:["lang"]})}}function It(e,t){const n=ce(r=>e.subscribe(t,r),[e,t]);return ne(n,()=>e.list(t))}function No(e){return ne(e.subscribe,e.getProps,e.getProps)}function us({registry:e}){const t=It(e,To),n=It(e,null);return R(Q,{children:[t.map(o=>R(fs,{entry:o,registry:e},o.key)),n.map(o=>R(Ro,{entry:o},o.key))]})}const Lo=e=>`clover-${e.key}-`,fs=Dt(function({entry:t,registry:n}){const{hosted:o}=t,r=It(n,o.element),s=No(o),i=o.Component;return R(Uo,{hosted:o,props:s,children:R(Wt.Provider,{value:Lo(t),children:R(i,{hosted:o,props:s,children:r.map(a=>R(Ro,{entry:a},a.key))})})})}),Ro=Dt(function({entry:t}){const{hosted:n}=t,o=No(n);if(n.needsRoot&&!t.root)return null;const r=n.Component;return jt(R(Uo,{hosted:n,props:o,children:R(Wt.Provider,{value:Lo(t),children:R(r,{hosted:n,props:o})})}),n.element)});class Uo extends X{constructor(){super(...arguments);se(this,"state",{failed:false})}static getDerivedStateFromError(){return{failed:true}}componentDidCatch(n,o){console.error(`<${this.props.hosted.element.localName}>:`,n)}componentDidUpdate(n){this.state.failed&&n.props!==this.props.props&&this.setState({failed:false})}render(){return this.state.failed?null:this.props.children}}const wn=new WeakMap,Ke=Symbol.for("clover.elements");function ds(e){let t=wn.get(e);if(!t){const n=e;n[Ke]&&console.warn("Clover is loaded twice on this page: load one entry."),t=new $o(n[Ke]??(n[Ke]={made:0})),wn.set(e,t),ss(e.createElement("div")).render(R(us,{registry:t}))}return t}const qi=Object.freeze(Object.defineProperty({__proto__:null,Registry:$o,hostOf:ds},Symbol.toStringTag,{value:"Module"})),Vt=De(void 0);function Fo(e=Y,t){const n=ne(L.subscribe,L.getSnapshot,L.getSnapshot),o=pe(Vt),r=t??o,s=ce((a,c)=>L.t(a,c,e),[e,n]),i=ce(a=>L.langOf(a,r,e),[e,n,r]);return{t:s,langOf:i,hostLanguage:r,i18n:L}}const _s=/^(ar|arc|ckb|dv|fa|he|iw|ks|ps|sd|syr|ug|ur|yi|ota|prs|azb|pnb|bal|glk|mzn|lrc|khw|nqo|rhg|jrb|jpr|sam|arz|ary|apc|acm|ajp|aeb|ars)$/,ps=/^(adlm|arab|hebr|nkoo|rohg|syrc|thaa)$/;function hs(e){if(!e)return;const[t,...n]=e.toLowerCase().split(/[-_]/),o=n.find(r=>/^[a-z]{4}$/.test(r));return(o?ps.test(o):_s.test(t))?"rtl":void 0}function Sn(e){return e?{lang:e,dir:hs(e)}:{}}function vs(e,t,n={}){return((e==null?void 0:e.fetch)??globalThis.fetch)(t,{credentials:(e==null?void 0:e.credentials)??"same-origin",...n,headers:{...n.headers,...e==null?void 0:e.headers}})}function ms(e){var t;(t=e.body)==null||t.cancel().catch(()=>{})}const Ji=e=>(e==null?void 0:e.credentials)==="include",gs=e=>JSON.stringify([e==null?void 0:e.credentials,e==null?void 0:e.headers]);class ys extends Error{constructor(t,n,o){super(t),this.url=n,this.status=o,this.name="CloverRequestError"}}async function ke(e,t,n){const o=await vs(e,t,{signal:n,headers:{Accept:"application/ld+json, application/json"}});if(!o.ok)throw ms(o),new ys(`${t} answered ${o.status}`,t,o.status);return o.json()}const A=e=>Array.isArray(e)?e:e==null?[]:[e],Ho=["Independents","Composite","List"];function Do(e){return A(e==null?void 0:e.body).flatMap(t=>Ho.includes(t==null?void 0:t.type)?A(t.items):[t])}function bs(e){const t=A(e==null?void 0:e.motivation);return!t.length||t.includes("painting")}function ws(e){const t=[];for(const n of A(e==null?void 0:e.items))for(const o of A(n==null?void 0:n.items))if(bs(o))for(let r of Do(o))(r==null?void 0:r.type)==="Choice"&&(r=A(r.items)[0]),(r==null?void 0:r.type)==="SpecificResource"&&(r=typeof r.source=="string"?{id:r.source}:r.source),r&&t.push({body:r,annotation:o});return t}function jo(e,t,n=", "){if(!e)return{text:""};if(typeof e=="string")return{text:e};const o=Object.keys(e).filter(a=>{var c;return(c=e[a])==null?void 0:c.length});if(!o.length)return{text:""};const r=Xn(o,t),s=e[r];return{text:Array.isArray(s)?s.join(n):String(s),lang:r==="none"||r==="@none"?void 0:r}}const Ss=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/;function Ki(e){const t=e==null?void 0:e.language,n=(Array.isArray(t)?t:[t]).filter(o=>typeof o=="string"&&Ss.test(o));return n.length===1?n[0]:void 0}const rt=De(null);function Gi(){return pe(rt)}function Cs(e="This part"){const t=pe(rt);if(!t)throw new Error(`${e} must be rendered inside <Clover.Root>.`);return t}function Zi(e,t=Object.is,n){const{clover:o}=Cs(n),r=H(null),s=()=>{const i=e(o.store.get());return r.current&&t(r.current.value,i)?r.current.value:(r.current={value:i},i)};return ne(o.store.subscribe,s)}const xs={subscribe:()=>()=>{}};function Yi(e,t){const n=pe(rt),o=n==null?void 0:n.clover.store,r=()=>o?e(o.get()):t;return ne(o?o.subscribe:xs.subscribe,r)}function ks(e,t){const n=pe(Vt),o=H(null),[r,s]=J(""),i=ce(d=>{o.current=d,typeof e=="function"?e(d):e&&(e.current=d)},[e]);F(()=>{var u,p;const d=(u=o.current)==null?void 0:u.parentElement;t!==void 0||n!==void 0||!d||s(((p=d.closest("[lang]"))==null?void 0:p.getAttribute("lang"))??"")});const c=t??n??r,{langOf:l}=Fo(void 0,c);return{ref:i,hostLanguage:c,langOf:l}}Ie(23,"ui/ReadMore","@layer clover{.clover-read-more{display:flex;flex-direction:column;align-items:flex-start;gap:var(--clover-space-xs);min-width:0}button.clover-read-more-button{margin:0;padding:0;border:0;background:none;color:var( --clover-color-accent-text, var(--clover-accent-text-fallback, var(--clover-color-accent, #0065c3)) );font-size:var(--clover-text-s);text-decoration:underline 1px;text-decoration-color:color-mix(in srgb,currentColor 20%,transparent);text-underline-offset:var(--clover-space-3xs);cursor:pointer}button.clover-read-more-button:hover{text-decoration-color:currentColor}button.clover-read-more-button:focus-visible{outline:2px solid var(--clover-color-accent, #0065c3);outline-offset:2px;border-radius:var(--clover-radius, 3px)}}");const Is=["left-to-right","right-to-left","top-to-bottom","bottom-to-top"];function Os(e){return Is.includes(e)?e:"left-to-right"}const As=["individuals","paged","continuous","unordered"];function Ps(e){return A(e).find(n=>As.includes(n))??"individuals"}function Ms(e,t){if(!e.length)return[];if(t==="continuous")return[e.map((a,c)=>c)];if(t!=="paged")return e.map((a,c)=>[c]);const n=[];let o=[],r=0,s=false;const i=()=>{o.length&&n.push(o),o=[]};return e.forEach((a,c)=>{const l=A(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 Es(e,t){const n=e.findIndex(o=>o.includes(t));return n===-1?0:n}function Bo(e,t){const n=/(?:^|[#&])t=([^&]+)/.exec(t),o=n&&{t:n[1]},r=/(?:^|[#&])xywh=(?:pixel:)?([^&]+)/.exec(t);if(r){const[s,i,a,c]=r[1].split(",").map(Number);if([s,i,a,c].every(Number.isFinite))return{id:e,rect:{x:s,y:i,w:a,h:c},...o}}return o&&{id:e,...o}}function Ge(e){const t=e.indexOf("#");if(t>=0){const o=e.slice(0,t);return Bo(o,e.slice(t))??{id:o}}const n=e.indexOf("&t=");return n>=0?{id:e.slice(0,n),t:e.slice(n+3)}:{id:e}}const Ot=e=>{var t;return Array.isArray(e)?Ot(e[0]):Ho.includes(e==null?void 0:e.type)?Ot((t=e.items)==null?void 0:t[0]):e};function st(e){return Ts(Ot(e))}function Ts(e){var n;if(typeof e=="string")return Ge(e);if(!e||typeof e!="object")return{id:""};if(e.type!=="SpecificResource"||e.source===void 0)return Ge(e.id??"");const t=typeof e.source=="string"?Ge(e.source):Ge(((n=e.source)==null?void 0:n.id)??"");for(const o of A(e.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:t.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:t.id,svg:String(r.value)};if((r==null?void 0:r.type)==="FragmentSelector"&&r.value){const s=Bo(t.id,String(r.value));if(s)return s}}return t}const Xi=e=>e==="Audio"||e==="Sound",$s=e=>{const t=A(e);return t.length>0&&t.every(n=>n==="supplementing")},Ns=(e,t)=>$s(e)&&!!(t.rect||t.svg||t.point)&&!t.t,Cn=new WeakMap,Ls={canvases:[],views:[],direction:"left-to-right"};function D(e){if(!e)return Ls;let t=Cn.get(e);if(!t){const n=(e.items??[]).filter(o=>(o==null?void 0:o.type)==="Canvas"||(o==null?void 0:o.type)==="Timeline"||(o==null?void 0:o.type)==="Scene");t={canvases:n,views:Ms(n,Ps(e.behavior)),direction:Os(e.viewingDirection)},Cn.set(e,t)}return t}const xn=new WeakMap;function je(e,t){if(!t)return null;const n=D(e);let o=xn.get(n);if(!o){o=new Map;for(const r of n.canvases)o.has(r.id)||o.set(r.id,r);xn.set(n,o)}return o.get(t)??null}function Be(e,t){const{canvases:n,views:o}=D(e),r=n.findIndex(s=>s.id===t);return r===-1?0:Es(o,r)}const kn=new WeakMap,At=[];function $e(e,t){return e?Wo(e,Be(e,t)):At}function Qi(e,t){if(!e)return At;const n=Be(e,t)+1;return n<D(e).views.length?Wo(e,n):At}function Wo(e,t){let n=kn.get(e);n||kn.set(e,n=new Map);let o=n.get(t);if(!o){const r=D(e);o=(r.views[t]??[]).map(s=>r.canvases[s]),n.set(t,o)}return o}function Rs(e,t){var s,i;const{canvases:n,views:o}=D(e),r=(s=o[t])==null?void 0:s[0];return r===void 0?null:((i=n[r])==null?void 0:i.id)??null}function Us(e){const t=e==null?void 0:e.start;if(!t)return null;const n=st(t);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 ea=(e,t)=>{const n=e==null?void 0:e.behavior;return Array.isArray(n)?n.includes(t):n===t},ta=e=>[(e==null?void 0:e.partOf)??[]].flat().find(t=>(t==null?void 0:t.id)&&t.type==="Collection");function na(e){var t;return((t=e.manifest)==null?void 0:t.id)??e.opening}function oa(e,t,n,o){const r=e==null?void 0:e.items;if(!(r!=null&&r.length))return-1;if(!n)return t??-1;const s=$e(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 t!==null&&i(t)?t:r.findIndex((a,c)=>i(c))}Ie(29,"components/Primitives/Primitives","@layer clover{.clover-summary:not([data-read-more=open]){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--clover-summary-lines, 5);overflow:hidden}:is(.clover-metadata,.clover-required-statement){display:flex;flex-direction:column;gap:var(--clover-space-s);margin:0}:is(.clover-metadata,.clover-required-statement) dt{margin:0;font-weight:500}:is(.clover-metadata,.clover-required-statement) dd{margin:0}.clover-summary,:is(.clover-metadata,.clover-required-statement) :is(dt,dd){overflow-wrap:anywhere}:is(.clover-about,.clover-canvas-caption,.clover-annotations-body,.clover-metadata,.clover-required-statement,.clover-summary) a:not([class]){text-decoration-line:underline;text-underline-offset:var(--clover-space-3xs)}:is(.clover-homepage,.clover-rendering,.clover-see-also,.clover-part-of)>li{min-block-size:24px}:is(.clover-homepage,.clover-rendering,.clover-see-also,.clover-part-of) a,a:is(.clover-id,.clover-rights){color:var( --clover-color-accent-text, var(--clover-accent-text-fallback, var(--clover-color-accent, #0065c3)) );overflow-wrap:anywhere;text-decoration-line:underline;text-underline-offset:var(--clover-space-3xs)}.clover-link-format{color:var(--clover-color-primary-muted, #26292b);font-size:var(--clover-text-s)}}");const Fs={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Hs=e=>(e==null?void 0:e.format)==="text/vtt"||typeof(e==null?void 0:e.id)=="string"&&/\.vtt(\?|$)/i.test(e.id);function Ds(e){const t=[];let n=0;const o=(r,s)=>{var a;if(!r||Hs(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")t.push({value:String(r.value??""),format:r.format,language:A(r.language)[0],...i});else if(r.type==="Image"&&r.id){const c=r.label??e.label;t.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)??e.label;c&&typeof c=="object"&&t.push({label:c,place:true,...i})}};for(const r of Do(e))if((r==null?void 0:r.type)!=="Choice")o(r);else{const s=n++;for(const i of A(r.items))o(i,s)}return t}const Vo="content-search",js="contents",ra=(e,t)=>`${e}#region-${t+1}`,Bs=e=>A(e==null?void 0:e.motivation).includes("linking");function zo(e,t,n){const o=[];for(const r of A(e==null?void 0:e.items)){const s=A(r==null?void 0:r.motivation);if(s.includes("painting"))continue;const i=Ds(r);if(!i.length&&!Bs(r))continue;const a=st(A(r.target)[0]),c=a.id||n;!c||!r.id||o.push({id:r.id,setId:t,canvasId:c,target:a,motivation:s,bodies:i,annotation:r})}return o}const Ws=e=>D(e).canvases.some(t=>A(t.items).some(n=>A(n==null?void 0:n.items).some(o=>A(o==null?void 0:o.body).some(r=>[r,...A(r==null?void 0:r.items)].some(s=>A(s==null?void 0:s.annotations).length>0)))));function Vs(e,t){for(const n of[e,t])if(n!=null&&n.label)return n.label;for(const n of[e,t]){const o=A(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 qo=e=>A(e==null?void 0:e.partOf).filter(t=>(t==null?void 0:t.id)&&/AnnotationCollection/.test(String((t==null?void 0:t.type)??(t==null?void 0:t["@type"])))),In=new WeakMap;function Jo(e){var n;if(!e)return[];let t=In.get(e);if(!t){const o=new Map;for(const r of D(e).canvases)for(const s of A(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=qo(s)[0])==null?void 0:n.id;a={id:i,label:Vs(s),source:"manifest",entries:[],...c?{collection:c}:{}},o.set(i,a)}a.entries.push(...zo(s,i,r.id))}t=[...o.values()].filter(r=>r.entries.length),In.set(e,t)}return t}const On=new WeakMap,Ko=[];function sa(e){if(!e)return Ko;let t=On.get(e);return t||(t=D(e).canvases.flatMap(n=>A(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)}))),On.set(e,t)),t}const ft=new WeakMap,dt=new WeakMap;function zs(e,t=qs){var n;if(!dt.has(t)){const o=t.filter(s=>s.content),r=(n=o[0])==null?void 0:n.content;dt.set(t,r?{id:r.id,type:r.type,...r.label?{label:r.label}:{},pages:Ko,entries:o.flatMap(s=>s.entries)}:null)}return dt.get(t)??Js(e)}const qs=[];function Js(e){var r;if(!e)return null;if(ft.has(e))return ft.get(e);const t=D(e).canvases.flatMap(s=>A(s.annotations).flatMap(i=>qo(i).map(a=>({part:a,page:i,canvas:s})))),n=(r=t[0])==null?void 0:r.part.id,o=n?(()=>{var l,d;const s=t.filter(({part:u})=>u.id===n),i=(l=s.find(({part:u})=>u.label))==null?void 0:l.part.label,a=Number((d=s.find(({part:u})=>u.total))==null?void 0:d.part.total),c=Jo(e);return{id:n,type:"AnnotationCollection",...i?{label:i}:{},...a>0?{total:a}:{},pages:s.map(({page:u,canvas:p})=>({id:String(u.id),canvasId:String(p.id),fetched:Array.isArray(u.items)})),entries:s.flatMap(({page:u})=>{var p;return((p=c.find(v=>v.id===u.id))==null?void 0:p.entries)??[]})}})():null;return ft.set(e,o),o}const An=new WeakMap,Pn=[];function Ue(e,t){const n=Jo(e);if(!t.length)return n.length?n:Pn;const o=e??Pn;let r=An.get(o);r||An.set(o,r=new Map);let s=r.get(t);if(!s){const i=new Set(n.map(a=>a.id));s=[...n,...t.filter(a=>!i.has(a.id)&&!!i.add(a.id))],r.set(t,s)}return s}const Mn=new WeakMap;function Ks(e,t,n,o=null){const r=Ue(e,t),s=n!=null&&n.entries.length?n:null;if(!o&&!s)return r;let i=Mn.get(r);i||Mn.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 Gs=e=>Number(e==null?void 0:e.duration)>0;function Go(e,t){return e.source==="search"||!e.entries.length?false:e.entries.every(n=>Ns(n.motivation,n.target)&&!Gs(t(n.canvasId)))}const En=new WeakMap;function ia(e,t){const n=Ue(e,t);let o=En.get(n);if(!o){const r=n.filter(s=>!Go(s,i=>je(e,i)??void 0));o=r.length===n.length?n:r,En.set(n,o)}return o}const Tn=new WeakMap;function Zo(e,t,n,o){const r=Ue(e,t),s=Tn.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)&&Go(c,l=>je(e,l)??void 0)).map(c=>c.id),a=i.length?[...n,...i]:n;return Tn.set(r,{hidden:n,shown:o,ids:a}),a}const $n=new WeakMap,Nn=[Vo,js];function aa(e,t,n,o,r){if(!r)return Nn;const s=Zo(e,t,n,o),i=$n.get(s);if(i&&i.hidden===n)return i.ids;const a=[...Nn,...s.filter(c=>!n.includes(c))];return $n.set(s,{hidden:n,ids:a}),a}function Zs(e){for(const t of A(e==null?void 0:e.target)){const n=(t==null?void 0:t.type)==="SpecificResource"?t.source:t,o=A(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 _t(e,t){if(!t)return null;for(const n of e){const o=n.entries.find(r=>r.id===t);if(o)return o}return null}function Yo(e){return btoa(encodeURIComponent(JSON.stringify(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Xo({manifestId:e,canvasId:t,type:n="Canvas",region:o,time:r}){const s={id:t,type:n,...e&&e!==t?{partOf:[{id:e,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:`${t}#content-state`,type:"Annotation",motivation:["contentState"],target:i?{type:"SpecificResource",source:s,selector:{type:"FragmentSelector",value:i}}:s};return{json:a,encoded:Yo(a)}}const ca=Object.freeze(Object.defineProperty({__proto__:null,buildContentState:Xo,encodeContentState:Yo},Symbol.toStringTag,{value:"Module"})),Ys=/iiif\.io\/api\/presentation\/4\/context\.json/;function Qo(e){const t=e==null?void 0:e["@context"];return(Array.isArray(t)?t:[t]).some(o=>typeof o=="string"&&Ys.test(o))}let Ln=null,Rn=null;function zt(){return Rn??(Rn=import("./upgrade-eNW0DPXq.mjs")),Ln??(Ln=import("./upgrader-BlbMUEH6.mjs").then(({upgradePresentation3To4:e})=>e)),Promise.all([Ln,Rn])}async function me(e){if(Qo(e))return e;const[t,{upgrade:n}]=await zt();return await n(e,t)}const Xs=()=>import("./content-state-reader-BGZEChSM.mjs");function Qs(e){const t=e;return!t||typeof t!="object"?false:t.type==="Annotation"||t["@type"]==="oa:Annotation"||t.type==="SpecificResource"}const er=e=>!!e&&typeof e=="object"&&/ImageService[123]|iiif\.io\/api\/image/.test(JSON.stringify(["@context","type","@type","protocol"].map(t=>e[t])));async function ei(e,t,n){try{return await ke(e,t,n)}catch(o){if(n!=null&&n.aborted||/\.json([?#]|$)/i.test(t))throw o;try{const r=await ke(e,`${t.replace(/\/+$/,"")}/info.json`,n);if(er(r))return r}catch{}throw o}}const ti=["summary","metadata","requiredStatement","rights","provider","homepage","seeAlso","rendering","thumbnail","navDate","partOf"];function ni(e){const t={"@context":ri,id:e.id,type:"Manifest",label:e.label??{none:[""]},items:[e]};for(const n of ti)e[n]!==void 0&&n!=="label"&&(t[n]=e[n]);return t}const la=e=>{var t,n;return!!e&&((n=(t=e.items)==null?void 0:t[0])==null?void 0:n.id)===e.id},ua=e=>{var t,n;return!!e&&((t=e.items)==null?void 0:t.length)===1&&((n=e.items[0])==null?void 0:n.id)===`${e.id}/canvas`},oi=/^(oa:)?Annotation(Page|Collection)$/;class pt extends Error{constructor(){super(...arguments);se(this,"name","CloverContentError")}}const ri="http://iiif.io/api/presentation/4/context.json",si=e=>/^https?:\/\//i.test(e);async function Pt(e,{request:t,signal:n}){return Array.isArray(e.items)&&e.items.length>0||!e.id?e:await ke(t,e.id,n)}const ii=50;async function qt(e,t){const n=e;if(Array.isArray(n.items)&&n.items.length||!n.first)return e;const o=[],r=new Set;let s=n.first;for(let i=0;s&&i<ii;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 ke(t.request,a.id,t.signal),l=await me({"@context":c["@context"]??n["@context"],...c,type:"Collection"});o.push(...l.items??[]),s=c.next}return{...n,items:o}}async function tr(e,t={}){return me(await Pt(e,t))}async function nr(e,t,n=0){for(const o of e.items??[]){if(o.type==="Manifest")return me(await Pt(o,t));if(o.type==="Collection"&&n<8){const r=await qt(await me(await Pt(o,t)),t),s=await nr(r,t,n+1);if(s)return s}}return null}async function ai(e,{request:t,signal:n}={}){zt();const o=typeof e=="string"?await ke(t,e.trim(),n):e,r=await me(o);return r.type==="Collection"?qt(r,{request:t,signal:n}):r}async function or(e,t={}){var i;const{request:n,signal:o}=t;zt();let r=e;if(typeof e=="string"&&(r=si(e.trim())?await ei(n,e.trim(),o):(await Xs()).decodeContentState(e),!r))throw new pt("Unreadable iiifContent");if(Qs(r)&&(t.follows??0)<2){const{follow:a}=await import("./follow-content-CmXq05TW.mjs");return a(r,t,or)}if(oi.test(String((r==null?void 0:r.type)??""))){const{annotationsContent:a}=await import("./annotations-content-CuWJZr4t.mjs");return a(r,t)}if(er(r)){const{imageServiceContent:a}=await import("./image-service-content-CL_EZugL.mjs");return a(r,typeof e=="string"?e.trim():void 0)}const s=await me(r);switch((i=o==null?void 0:o.throwIfAborted)==null||i.call(o),s.type){case"Manifest":return{manifest:s};case"Collection":{const a=await qt(s,t),c=t.manifestId,l=c?(a.items??[]).find(u=>u.id===c&&u.type==="Manifest"):void 0,d=l?await tr(l,t):await nr(a,t);if(!d)throw new pt("The Collection holds no Manifest");return{manifest:d,collection:a}}case"Canvas":case"Timeline":case"Scene":return{manifest:ni(s),target:{canvasId:s.id}};default:throw new pt(`Cannot show a ${String(s.type??"resource without a type")}`)}}const rr=e=>!!(e!=null&&e.id)&&e.type==="AnnotationPage"&&!e.items;function Un(e){const t=[];for(const n of e)for(const o of["items","annotations"])for(const r of n[o]??[])rr(r)&&t.push([n.id,o,r.id]);return t}async function ci(e,t,n,o){return li(await ke(n,e,o),t)}async function li(e,t="urn:clover:annotation-page"){var r;const n=e;return Qo(n)?n:((r=(await me({"@context":n["@context"]??"http://iiif.io/api/presentation/3/context.json",id:t,type:"Canvas",items:[{...n,"@context":void 0}]})).items)==null?void 0:r[0])??n}function ui(e,t){const n=e,o=t,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{...e,...n.label===void 0&&o.label!==void 0&&{label:o.label},...a.length&&{partOf:a}}}function fi(e,t,n,o){let r=false;const s=(e.items??[]).map(i=>{if(i.id!==t||!Array.isArray(i[n]))return i;const a=i[n].map(c=>c.id!==o.id||!rr(c)?c:(r=true,ui(o,c)));return r?{...i,[n]:a}:i});return r?{...e,items:s}:e}const Fn=/\/search\/([0-2])\//;function di(e){if(!e)return null;let t=null;for(const n of A(e.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:Fn.test(s)?Number(Fn.exec(s)[1])>=2?2:1:null;if(i===2)return{id:o,version:i};i===1&&(t??(t={id:o,version:i}))}return t}function _i(e){let t=e;const n=new Set;return{get:()=>t,set(o){const r=typeof o=="function"?o(t):o;Object.keys(r).some(i=>!Object.is(r[i],t[i]))&&(t={...t,...r},n.forEach(i=>i()))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function Se(e){let t=e;const n=new Set;return{get:()=>t,emit(o){t=o,n.forEach(r=>r(o))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function pi(e,t,n){return{position:t,total:n,hasPrevious:t>0,hasNext:t+1<n,previous:()=>e.previous(),next:()=>e.next(),first:()=>e.first(),last:()=>e.last(),goTo:o=>e.goTo(o)}}const Xe={query:"",status:"idle",hits:[],set:null},Hn={status:"idle",error:null,manifest:null,opening:null,collection:null,throughCollection:false,canvasId:null,target:null,annotationId:null,hiddenSets:[],shownSets:[],addedSets:[],search:Xe,regions:null,targets:null,targetIndex:null};function hi(e={}){const t=_i(Hn),n=Se(null),o=Se(null),r=Se(null),s=Se(null),i=Se(null),a=Se(null);let c=null,l=null,d=[],u=[],p=[],v=0,g=null,P=null,I=null;const k=(f,_)=>{!P||f===_||(P={...P,items:P.items.map(h=>h.manifestId===f&&h.manifestAs!==_?{...h,manifestAs:_}:h)})},C=f=>{var h;const _=(h=t.get().manifest)==null?void 0:h.id;return!!_&&(_===f.manifestId||_===f.manifestAs)},b=()=>d.length||u.length||p.length?[...d,...u,...p]:Hn.addedSets;let O=e.request,T=null;const j=new Set;let oe="view",Z=0;const W=(f,_,h)=>{if(j.has(h))return;j.add(h);const m=T==null?void 0:T.signal;ci(h,f,O,m).then(S=>{m!=null&&m.aborted||t.set(y=>y.manifest?{manifest:fi(y.manifest,f,_,S)}:{})}).catch(()=>j.delete(h))},ee=()=>{const{manifest:f,canvasId:_}=t.get();if(f)for(const[h,m,S]of Un(oe==="all"||Z>0?D(f).canvases:$e(f,_)))W(h,m,S)};t.subscribe(ee);const B=(f,_,h,m,S)=>{var Zt,Yt,Xt;const{canvases:y}=D(f),E=we=>!!we&&y.some(lr=>lr.id===we),w=Us(f),M=E(h==null?void 0:h.canvasId)?h:E(w==null?void 0:w.canvasId)?w:null,U=E(m.canvasId)?m.canvasId:(M==null?void 0:M.canvasId)??(E(m.defaultCanvasId)?m.defaultCanvasId:null)??((Zt=y[0])==null?void 0:Zt.id)??null,z=S&&((Yt=_t(p,S))==null?void 0:Yt.canvasId)===U?S:null,re=M&&z?{...M,region:void 0}:M,ze=++v;d=[],t.set({status:"ready",search:Xe,regions:null,manifest:f,opening:null,collection:_,canvasId:U,target:re&&re.canvasId===U?re:null,addedSets:b(),annotationId:z,targets:P});const Gt=f==null?void 0:f.structures;Array.isArray(Gt)&&JSON.stringify(Gt).includes("xywh=")&&import("./range-regions-Ytq4QkMX.mjs").then(({contentsSet:we})=>{v===ze&&t.set({regions:we(f)})}),Ws(f)&&import("./image-layers-CoBPhMZw.mjs").then(({imageLayers:we})=>{v===ze&&(d=we(f),t.set({addedSets:b()}))}),U&&U!==m.canvasId&&((Xt=e.onCanvasChange)==null||Xt.call(e,U))},V=(f,_)=>t.set(h=>{const m=h.hiddenSets.filter(y=>y!==f),S=h.shownSets.filter(y=>y!==f);return _?{hiddenSets:m,shownSets:[...S,f]}:{hiddenSets:[...m,f],shownSets:S}}),le=(f,_)=>{var m,S,y;if(!f)return;if((m=e.isControlled)!=null&&m.call(e)){_&&t.set({target:_}),(S=e.onCanvasChange)==null||S.call(e,f);return}const h=t.get().canvasId!==f;t.set({canvasId:f,target:_}),h&&((y=e.onCanvasChange)==null||y.call(e,f))},ue=(f,_=false)=>{const{manifest:h}=t.get(),m=Rs(h,f);le(m,m&&_?{canvasId:m,autoplay:_}:null)},Ae=()=>{const{manifest:f,canvasId:_}=t.get();return{at:Be(f,_),total:D(f).views.length}},ge=(f,_)=>{T==null||T.abort(),l==null||l.abort();const h=new AbortController;return T=h,j.clear(),v++,d=[],_||(p=[],P=null),t.set({status:"loading",error:null,manifest:null,opening:f,canvasId:null,target:null,annotationId:null,search:Xe,regions:null,addedSets:b(),...!_&&{collection:null,throughCollection:false,targets:null,targetIndex:null}}),h.signal},We=f=>t.set({status:"error",error:f instanceof Error?f:new Error(String(f))});async function Ve(f,_={},h=false){var S;const m=ge(h&&typeof f=="string"?f:null,h);try{const y=await or(f,{request:O,signal:m,manifestId:_.manifestId??void 0});if(m.aborted)return;const E=y.annotation,w=E?zo({items:[E]},`${E.id}#content-state`):[];p=w.length?[{id:`${E.id}#content-state`,source:"added",entries:w}]:y.annotationSets??[];const M=g??((S=w[0])==null?void 0:S.id)??y.pick;g=null,t.set({throughCollection:!!y.collection}),P=y.targets??null,P&&k(P.items[0].manifestId,y.manifest.id),t.set({targetIndex:P?0:null}),B(y.manifest,y.collection??null,y.target,_,M)}catch(y){m.aborted||We(y)}}const ye=f=>{const{manifest:_,collection:h,opening:m,status:S}=t.get();return(_==null?void 0:_.id)===f||(h==null?void 0:h.id)===f||m===f&&S==="loading"},Pe=f=>{var _;return(((_=t.get().collection)==null?void 0:_.items)??[]).find(h=>h.id===f)??{id:f,type:"Manifest"}},it=(f,_)=>{var h,m;if(g=_,(h=e.isManifestControlled)!=null&&h.call(e)){(m=e.onManifestChange)==null||m.call(e,f);return}be({id:f,type:"Manifest"}).then(S=>{var y;return S&&((y=e.onManifestChange)==null?void 0:y.call(e,f))})},be=async(f,_)=>{if(f.type==="Collection")return await Ve(f.id,{},true),t.get().status==="ready";const{collection:h}=t.get(),m=ge(f.id,true),S=g;g=null;const y=S?_t(p,S):null,E=typeof _=="string"?{canvasId:_}:_??I;I=null;try{const w=await tr(f,{request:O,signal:m});return m.aborted?false:(k(f.id,w.id),B(w,h,y?{canvasId:y.canvasId}:E??void 0,{},S),true)}catch(w){return m.aborted||We(w),false}};return{store:t,viewport:n,media:o,captions:r,highlight:s,chapter:i,found:a,get request(){return O},setRequest(f){O=f},load:Ve,async openCollection(f){var h;const _=t.get().manifest;if(!(!_||((h=t.get().collection)==null?void 0:h.id)===f))try{const m=await ai(f,{request:O});if(m.type!=="Collection"||t.get().manifest!==_)return;t.set({collection:m})}catch{}},async goToManifest(f,_){var m,S,y;if(ye(f))return;const h=Pe(f);if(h.type!=="Collection"&&((m=e.isManifestControlled)!=null&&m.call(e))){(S=e.onManifestChange)==null||S.call(e,f);return}await be(h,_)&&((y=e.onManifestChange)==null||y.call(e,t.get().manifest.id))},goToTarget(f){var m,S,y;const _=(m=t.get().targets)==null?void 0:m.items[f];if(!_)return;t.set({targetIndex:f});const h=_.canvasId?{canvasId:_.canvasId,..._.region&&{region:_.region},..._.time!==void 0&&{time:_.time}}:null;if(C(_)){h&&le(h.canvasId,h);return}if((S=e.isManifestControlled)!=null&&S.call(e)){I=h,(y=e.onManifestChange)==null||y.call(e,_.manifestId);return}be(Pe(_.manifestId),h??void 0).then(E=>{var w;return E&&((w=e.onManifestChange)==null?void 0:w.call(e,_.manifestId))})},async syncManifest(f){!f||ye(f)||t.get().status!=="ready"||await be(Pe(f))},goTo(f,_){le(f,_?{..._,canvasId:f}:null)},next({autoplay:f=false,wrap:_=false}={}){const{at:h,total:m}=Ae();h+1<m?ue(h+1,f):_&&m>1&&ue(0,f)},previous(){const{at:f}=Ae();f>0&&ue(f-1)},first(){ue(0)},last(){ue(Ae().total-1)},consumeTarget(){t.set({target:null})},syncCanvas(f){f&&t.set({canvasId:f})},selectAnnotation(f){const{manifest:_,addedSets:h,canvasId:m,search:S,regions:y}=t.get(),E=_t(Ks(_,h,S.set,y),f);if(t.set({annotationId:E?f:null}),!E)return;a.emit(f);const{hiddenSets:w,shownSets:M}=t.get();E.setId!==Vo&&Zo(_,h,w,M).includes(E.setId)&&V(E.setId,true);const U=$e(_,m).some(ze=>ze.id===E.canvasId),z=je(_,E.canvasId)!==null;!U&&z&&le(E.canvasId,null);const re=z?void 0:Zs(E.annotation);re&&it(re,E.id)},async search(f){l==null||l.abort();const _=di(t.get().manifest),h=f.trim();if(!h||!_){l=null,t.set({search:Xe,annotationId:null});return}const m=new AbortController;l=m,t.set(S=>({search:{...S.search,query:h,status:"loading"}}));try{const{searchInto:S}=await import("./search-kJ_71fbN.mjs");await S(t,_,h,O,m.signal)}catch{t.set({search:{query:h,status:"error",hits:[],set:null}})}},setSetVisible(f,_){V(f,_)},async loadAnnotations(f){if(c==null||c.abort(),!f){u=[],t.set({addedSets:b()});return}const _=new AbortController;c=_;try{const{loadAnnotationSets:h}=await import("./annotation-collection-C3UpNV1K.mjs"),m=await h(f,{request:O,signal:_.signal});if(_.signal.aborted)return;u=m,t.set({addedSets:b()})}catch{}},getContentState(){var U;const{manifest:f,canvasId:_}=t.get();if(!f||!_)return null;const h=n.get(),m=o.get(),S=m&&m.currentTime>0?m.currentTime:null,y=$e(f,_),w=h&&y.some(z=>z.id===h.canvasId)&&!S?h:null,M=(w==null?void 0:w.canvasId)??_;return Xo({manifestId:f.id,canvasId:M,type:(U=y.find(z=>z.id===M))==null?void 0:U.type,region:w==null?void 0:w.region,time:S})},setAnnotationPages(f){f!==oe&&(oe=f,ee())},fetchAnnotationPages(f){const{manifest:_}=t.get();if(!_||!f.length)return;const h=new Set(f);for(const[m,S,y]of Un(D(_).canvases))h.has(y)&&W(m,S,y)},holdAllAnnotationPages(){Z++,ee();let f=true;return()=>{f&&Z--,f=false}},dispose(){T==null||T.abort(),c==null||c.abort(),l==null||l.abort()}}}function vi(e){const t=ne(gi,yi);return!!e||t}const fa=e=>e?{"data-high-contrast":""}:{},mi="(prefers-contrast: more)",sr=()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(mi):null;function gi(e){var n;const t=sr();return(n=t==null?void 0:t.addEventListener)==null||n.call(t,"change",e),()=>{var o;return(o=t==null?void 0:t.removeEventListener)==null?void 0:o.call(t,"change",e)}}const yi=()=>{var e;return!!((e=sr())!=null&&e.matches)};function bi({clover:e,language:t}){const{t:n,langOf:o}=Fo(),[r,s]=J(null),i=H(n);return i.current=n,F(()=>{let a=null;return e.store.subscribe(()=>{const{manifest:c,canvasId:l,status:d}=e.store.get();if(d!=="ready"||l===a)return;const u=a===null;if(a=l,u)return;const p=je(c,l),v=jo(p==null?void 0:p.label,t),g=i.current("canvasPosition",{index:Be(c,l)+1,total:D(c).views.length});s({label:v.text,lang:v.lang,position:g})})},[e,t]),R("div",{className:"clover-announcer",role:"status","aria-live":"polite","aria-atomic":"true",style:Fs,children:[r!=null&&r.label?R(Q,{children:[R("span",{...Sn(r.lang),children:r.label}),","," "]}):null,r&&R("span",{...Sn(o("canvasPosition")),children:r.position})]})}const wi=100;function Si(e,t){const n=H({read:e,onChange:t});n.current={read:e,onChange:t};const o=H(void 0),r=H("");return F(()=>()=>{clearTimeout(o.current),o.current=void 0},[]),ce(()=>{!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))},wi))},[])}function Dn(e,t){return e==null||e.addEventListener("pause",t),e==null||e.addEventListener("seeked",t),()=>{e==null||e.removeEventListener("pause",t),e==null||e.removeEventListener("seeked",t)}}function Ci(e,t){const n=Si(()=>e.getContentState(),t),o=!!t;F(()=>{if(!o)return;let r=e.store.get().canvasId;const s=e.store.subscribe(()=>{const l=e.store.get().canvasId;l!==r&&(r=l,n())}),i=e.viewport.subscribe(n);let a=Dn(e.media.get(),n);const c=e.media.subscribe(l=>{a(),a=Dn(l,n)});return n(),()=>{s(),i(),c(),a()}},[e,o,n])}function da(e){return e.flatMap(t=>ws(t).map(({body:n})=>n))}function _a(e,t){if(!(e!=null&&e.length)||!t.canvases.length)return null;const n=t.canvases.map(r=>r.id),o=t.bodies.map(r=>r==null?void 0:r.format).filter(Boolean);return e.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,t))})??null}function xi(e,t){return e===t?true:!e||!t||e.length!==t.length?false:e.every((n,o)=>n.component===t[o].component&&n.match===t[o].match&&JSON.stringify([n.canvasId,n.format])===JSON.stringify([t[o].canvasId,t[o].format]))}const jn=typeof window<"u"?G:F;function ki({iiifContent:e,canvasId:t,defaultCanvasId:n,onCanvasChange:o,onStatusChange:r,manifestId:s,defaultManifestId:i,onManifestChange:a,searchQuery:c,request:l,language:d,renderers:u,annotations:p,annotationPages:v="view",onContentStateChange:g,...P}){const I=t!==void 0,k=s!==void 0,C=H({controlled:I,manifestControlled:k,onCanvasChange:o,onStatusChange:r,onManifestChange:a});C.current={controlled:I,manifestControlled:k,onCanvasChange:o,onStatusChange:r,onManifestChange:a};const[b]=J(()=>hi({request:l,onCanvasChange:w=>{var M,U;return(U=(M=C.current).onCanvasChange)==null?void 0:U.call(M,w)},onManifestChange:w=>{var M,U;return(U=(M=C.current).onManifestChange)==null?void 0:U.call(M,w)},isControlled:()=>C.current.controlled,isManifestControlled:()=>C.current.manifestControlled}));b.setRequest(l);const[O,T]=J(b.store.get().status);jn(()=>{let w=b.store.get().status;return b.store.subscribe(()=>{var z,re;const{status:M,error:U}=b.store.get();M!==w&&(w=M,T(M),(re=(z=C.current).onStatusChange)==null||re.call(z,M,U))})},[b]);const j=H({});j.current={canvasId:t,defaultCanvasId:n,manifestId:s??i};const oe=gs(l),Z=H(e);Z.current=e;const W=Ai(e);jn(()=>(b.load(Z.current,j.current),()=>b.dispose()),[b,W,oe]),F(()=>{I&&b.syncCanvas(t??null)},[b,I,t]);const ee=H(p);ee.current=p;const B=Oi(p);F(()=>{b.loadAnnotations(ee.current??null)},[b,B,oe]),F(()=>{b.setAnnotationPages(v)},[b,v]),Ci(b,g),F(()=>{k&&O==="ready"&&b.syncManifest(s??null)},[b,k,s,O]);const V=Ii(b,w=>{var M;return w.status==="ready"?((M=w.manifest)==null?void 0:M.id)??null:null});F(()=>{c&&V&&b.search(c)},[b,c,V]);const le=H(u);xi(le.current,u)||(le.current=u);const ue=le.current,[Ae,ge]=J(),[We,Ve]=J(d);We!==d&&(Ve(d),ge(void 0));const ye=H(void 0),[Pe,it]=J(W);Pe!==W&&(it(W),ge(void 0)),F(()=>()=>{const w=ye.current;ye.current=void 0,w&&L.chosenLanguage===w&&L.chooseInterfaceLanguage()},[W]);const be=ne(L.subscribe,()=>L.chosenLanguage),f=Ae??d??be,_=ce(w=>{ge(w);const M=L.stringsFor(w);ye.current=M,M&&L.chooseInterfaceLanguage(M)},[]),[h,m]=J(0),S=ce(()=>(m(w=>w+1),()=>m(w=>w-1)),[]),y=h>0;return[ve(()=>({clover:b,language:f,renderers:ue,chooseLanguage:_,toggleDrawn:y,drawsToggle:S}),[b,f,ue,_,y,S]),O,P]}function Ii(e,t){return ne(e.store.subscribe,()=>t(e.store.get()))}function Oi(e){const t=Array.isArray(e)?e:e?[e]:[];return JSON.stringify(t.map(n=>typeof n=="string"?n:(n==null?void 0:n.id)??"object"))}function Ai(e){return typeof e=="string"?e:e.id??e["@id"]??e}const ht=new Map;function pa(e,t){const n=is(),o=H(t);o.current=t,F(()=>e?ir(n,o):void 0,[e,n])}function ir(e,t){for(const[n,o]of[...ht])n!==e&&o.current();return ht.set(e,t),()=>{ht.delete(e)}}let Pi=0;const Mi=e=>ir(`page-${Pi+=1}`,{current:e}),Bn=new WeakMap;function Ei(e,t){const[n,o]=J(()=>Bn.get(e)??null);return F(()=>{if(!t||n)return;let r=true;return e().then(s=>{Bn.set(e,s),r&&o(()=>s)},()=>{}),()=>{r=false}},[e,t,n]),n}function ha(e){const t=Math.max(0,Math.floor(e||0)),n=Math.floor(t/3600),o=Math.floor(t%3600/60),r=String(t%60).padStart(2,"0");return n?`${n}:${String(o).padStart(2,"0")}:${r}`:`${o}:${r}`}function va(e,t){var n;if(e.currentTime=t,!!e.paused)try{(n=e.play())==null||n.catch(()=>{})}catch{}}function Jt(e){if(!e)return;const[t,n]=e.split(","),o=Number(t);if(t===""||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}}function Kt(e){if(typeof e=="string")return Wn(e);const t=e;return(t==null?void 0:t.type)==="SpecificResource"?t:typeof(t==null?void 0:t.id)=="string"?Wn(t.id):t}const Wn=e=>e.replace(/\/((?:t|xywh)=[^/#]*)$/,"#$1");function ar(e){const t=A(e.thumbnail)[0];return t&&typeof t=="object"?{thumbnail:t}:{}}const Vn=new WeakMap,zn=[];function Ti(e,t,n){if(!e||!t)return zn;let o=Vn.get(e);o||Vn.set(e,o=new Map);const r=`${t}|${n??""}`,s=o.get(r);if(s)return s;const i=[],a=new Set,c=d=>{if(!d||a.has(d.id??d))return;a.add(d.id??d);const u=!A(d.behavior).includes("no-nav");for(const p of A(d.items)){if((p==null?void 0:p.type)==="Range"){c(p);continue}if(!u)continue;const v=st(Kt(p));if(v.id.split("#")[0]!==t)continue;const g=Jt(v.t);g&&i.push({...d.id?{id:d.id}:{},label:d.label,...g,...ar(d)})}};for(const d of A(e.structures))c(d);i.sort((d,u)=>d.start-u.start);const l=i.length?i.map((d,u)=>{var p;return{...d,end:d.end??((p=i[u+1])==null?void 0:p.start)??n}}):zn;return o.set(r,l),l}const qn=new WeakMap,Jn=[];function cr(e){if(!e)return Jn;const t=qn.get(e);if(t)return t;const n=new Map(A(e.items).map((c,l)=>[c==null?void 0:c.id,l])),o=new Set,r=c=>{var C,b;if(!c||o.has(c.id??c))return[];o.add(c.id??c);const l=[],d=[],u=[];let p;for(const O of A(c.items))if((O==null?void 0:O.type)==="Range"){const T=r(O);l.push(...T),T.forEach(j=>d.push(...j.canvasIds))}else{const T=st(Kt(O));if(!T.id)continue;p??(p=T),d.push(T.id),u.push(T)}const v=A(c.behavior);if(v.includes("no-nav"))return l;const g=p??void 0,P={id:c.id??`range-${o.size}`,label:c.label,canvasId:(g==null?void 0:g.id)??((C=l[0])==null?void 0:C.canvasId),canvasIds:[...new Set(d)],...v.includes("sequence")?{sequence:true}:{},...ar(c),children:l},I=Jt(g==null?void 0:g.t);return I?P.time=I:!g&&((b=l[0])!=null&&b.time)&&(P.time=l[0].time),g!=null&&g.rect&&(P.region=g.rect),(v.includes("sequence")&&u.length>1&&!u.some(O=>O.t)||$i(u,n))&&(P.parts=u.map(O=>({canvasId:O.id,...O.rect?{region:O.rect}:{}}))),[P]},s=A(e.structures).flatMap(r),i=s.length===1&&s[0].children.length?s[0].children:s,a=i.length?i:Jn;return qn.set(e,a),a}function $i(e,t){return!e.length||e.some(n=>n.t)?false:e.some(n=>n.rect)?true:e.some((n,o)=>o>0&&t.get(n.id)!==(t.get(e[o-1].id)??NaN)+1)}function Ni(e,t,n,o){let r=null,s=null;const i=(l,d,u)=>!l||u>l.depth||u===l.depth&&!(l.sequence&&d.sequence),a=(l,d,u)=>{const p=u||l.id===o;if(t&&l.canvasIds.includes(t)&&(!l.time||n!==void 0&&n>=l.time.start&&(l.time.end===void 0||n<l.time.end))){const g={id:l.id,depth:d,...l.sequence?{sequence:true}:{}};i(r,l,d)&&(r=g),p&&i(s,l,d)&&(s=g)}l.children.forEach(v=>a(v,d+1,p))};e.forEach(l=>a(l,0,false));const c=s??r;return c?c.id:null}const ma=Object.freeze(Object.defineProperty({__proto__:null,chaptersOf:Ti,currentContents:Ni,parseTime:Jt,rangeItemTarget:Kt,tableOfContents:cr},Symbol.toStringTag,{value:"Module"}));Ie(31,"components/Label/Label","@layer clover{.clover-label{text-wrap:balance}}");Ie(32,"components/Status/Status","@layer clover{.clover-status{margin:0;padding:var(--clover-space-m);color:var(--clover-color-primary-muted, #26292b)}.clover-status[data-status=loading]{display:flex}.clover-status[data-status=error] p{margin:0}.clover-status-detail{font-size:var(--clover-text-s)}}");const ga=()=>import("./controls-B1pIwRgH.mjs"),Li=()=>import("./renderers-C569MeQB.mjs");function ya(e){G(()=>()=>e==null?void 0:e(null),[e])}function Ri(e,t,n){const o=()=>e.store.get();return{get state(){return o()},subscribe(r){return e.store.subscribe(()=>r(o()))},get language(){return t()},status(){const{status:r,error:s}=o();return{status:r,error:s}},manifest(){return o().manifest},sequence(){return D(o().manifest)},visibleCanvases(){return $e(o().manifest,o().canvasId)},activeCanvas(){return je(o().manifest,o().canvasId)},navigation(){const{manifest:r,canvasId:s}=o();return pi(e,Be(r,s),D(r).views.length)},annotationPages(){return Ue(o().manifest,o().addedSets)},annotationSets(){return Ue(o().manifest,o().addedSets)},annotationCollection(){return zs(o().manifest,o().addedSets)},contents(){return cr(o().manifest)},localize(r){return jo(r,t())},t(r,s){return L.t(r,s,Y)},langOf(r){return L.langOf(r,n(),Y)},oneOpen(r){return Mi(r)}}}function Ui(e,t,n){return Object.defineProperties(Object.create(e),Object.getOwnPropertyDescriptors(Ri(e,t,n)))}const Fi=De(null);function Hi({hosted:e,props:t,children:n}){const o=Ei(Li,!!t.renderers);return!t.iiifContent||t.renderers&&!o?null:R(Di,{element:e.element,props:t,toRenderers:o==null?void 0:o.toRenderers,children:n})}function Di({element:e,props:t,toRenderers:n,children:o}){const{canvasId:r,manifestId:s,lang:i,highContrast:a,onReady:c,renderers:l,...d}=t,u=vi(a),p=ks(void 0,i);p.ref(e);const v=ve(()=>n==null?void 0:n(l),[n,l]),[g,P]=ki({...d,defaultCanvasId:r,defaultManifestId:s,renderers:v}),{clover:I,language:k}=g,C=H({language:k,host:p.hostLanguage});C.current={language:k,host:p.hostLanguage};const b=ve(()=>Ui(I,()=>C.current.language,()=>C.current.host),[I]);return G(()=>(c==null||c(b),()=>c==null?void 0:c(null)),[b,c]),Kn(I,r,O=>I.goTo(O)),Kn(I,s,O=>void I.goToManifest(O)),G(()=>(e.classList.add("clover-root"),()=>e.classList.remove("clover-root")),[e]),G(()=>{e.setAttribute("data-status",P)},[e,P]),G(()=>(e.toggleAttribute("data-high-contrast",u),()=>e.removeAttribute("data-high-contrast")),[e,u]),G(()=>()=>e.removeAttribute("data-status"),[e]),R(rt.Provider,{value:g,children:R(Vt.Provider,{value:p.hostLanguage,children:R(Fi.Provider,{value:b,children:[o,jt(R(bi,{clover:I,language:k}),e)]})})})}function Kn(e,t,n){const o=H(t);F(()=>{t&&t!==o.current&&n(t),o.current=t},[e,t])}const ba=Object.freeze(Object.defineProperty({__proto__:null,RootElement:Hi},Symbol.toStringTag,{value:"Module"}));export{jt as $,H as A,Jt as B,ne as C,$r as D,va as E,D as F,Wi as G,Zs as H,no as I,ta as J,na as K,cr as L,Ni as M,ra as N,di as O,Ye as P,De as Q,zi as R,hr as S,ve as T,Gi as U,A as V,ua as W,Vo as X,Xn as Y,L as Z,G as _,Fo as a,la as a0,Yi as a1,Ki as a2,je as a3,Ji as a4,vs as a5,ms as a6,ks as a7,vi as a8,Os as a9,Xo as aA,gs as aB,js as aC,Kt as aD,zo as aE,ke as aF,li as aG,Vs as aH,pt as aI,me as aJ,Fi as aK,ai as aL,Ns as aM,Ho as aN,Ds as aO,or as aP,Vi as aQ,qi as aR,ca as aS,ma as aT,ba as aU,Si as aa,Dn as ab,fa as ac,Vt as ad,bs as ae,st as af,Do as ag,Xi as ah,pa as ai,ws as aj,oa as ak,pi as al,zs as am,Be as an,ha as ao,ki as ap,bi as aq,rt as ar,ea as as,Ks as at,Ti as au,aa as av,Qi as aw,Jo as ax,tr as ay,hs as az,is as b,Zi as c,J as d,Cs as e,Ei as f,Li as g,ya as h,ga as i,Ci as j,Q as k,Sn as l,_a as m,$e as n,Zo as o,da as p,ce as q,sa as r,ia as s,jo as t,R as u,Fs as v,_t as w,pe as x,F as y,Rr as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as n}from"./shared-
|
|
1
|
+
import{F as n}from"./shared-ByrLMUQa.mjs";function f(a,e){const s=a.store.get().manifest;if(e.canvasId&&n(s).canvases.some(t=>t.id===e.canvasId))a.goTo(e.canvasId);else if(e.manifestId&&e.manifestId!==(s==null?void 0:s.id))a.goToManifest(e.manifestId,e.canvasId);else return false;return true}export{f as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as l}from"./imageService-
|
|
1
|
+
import{i as l}from"./imageService-BoQQvo1U.mjs";function s(t,g,e){const a=(h,d)=>Math.min(Math.max(Math.round(h),0),d),m=e?a(e.x*t.width,t.width-1):0,w=e?a(e.y*t.height,t.height-1):0,i={x:m,y:w,width:e?Math.max(1,a(e.width*t.width,t.width-m)):t.width,height:e?Math.max(1,a(e.height*t.height,t.height-w)):t.height},x=i.width===t.width&&i.height===t.height;if(!x&&!t.regionByPx)return null;if(t.sizeByW){let h=Math.min(1,g/Math.max(i.width,i.height));return t.maxWidth&&(h=Math.min(h,t.maxWidth/i.width)),t.maxHeight&&(h=Math.min(h,t.maxHeight/i.height)),t.maxArea&&(h=Math.min(h,Math.sqrt(t.maxArea/(i.width*i.height)))),l(t,i,Math.max(1,Math.floor(i.width*h)),Math.max(1,Math.floor(i.height*h)))}if(!x)return null;const M=[...t.sizes].sort((h,d)=>h.width-d.width),r=M.find(h=>Math.max(h.width,h.height)>=g)??M.at(-1)??{width:t.width,height:t.height};return l(t,i,r.width,r.height)}export{s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var R=Object.defineProperty;var C=(n,e,t)=>e in n?R(n,e,{enumerable:true,configurable:true,writable:true,value:t}):n[e]=t;var w=(n,e,t)=>C(n,typeof e!="symbol"?e+"":e,t);import{_ as p,C as H,a as B,d as F,A as Z,u as _}from"./shared-
|
|
1
|
+
var R=Object.defineProperty;var C=(n,e,t)=>e in n?R(n,e,{enumerable:true,configurable:true,writable:true,value:t}):n[e]=t;var w=(n,e,t)=>C(n,typeof e!="symbol"?e+"":e,t);import{_ as p,C as H,a as B,d as F,A as Z,u as _}from"./shared-ByrLMUQa.mjs";import{r as M,w as $,c as A,l as q,t as G,n as j,h as D,a as J}from"./splitting-BnQUxxgH.mjs";import{T as Q}from"./Tip-mcI7IRQh.mjs";import"./styles-BOXm_R8o.mjs";class U{constructor(e){w(this,"sizes");w(this,"listeners",new Set);w(this,"subscribe",e2=>(this.listeners.add(e2),()=>{this.listeners.delete(e2)}));this.storageKey=e,this.sizes=M(e)}keyed(e){e!==this.storageKey&&(this.storageKey=e,this.sizes=M(e),this.listeners.forEach(t=>t()))}set(e,t){const o={...this.sizes};t===void 0?delete o[e]:o[e]=Math.round(t),this.sizes=o,$(this.storageKey,o),this.listeners.forEach(l=>l())}}const P=new WeakMap;function S(n){let e=P.get(n);return e||(e=new U(n.getAttribute("storage-key")??void 0),P.set(n,e)),e}const V={},X=()=>()=>{},N=n=>{var e;return((e=n.parentElement)==null?void 0:e.localName)==="clover-split"?n.parentElement:null},v=n=>n==null||n.trim()===""?void 0:/^\d+(\.\d+)?$/.test(n.trim())?Number(n):n.trim();function W(n){const e={};for(const t of T(n))e[t.dataset.splitKey??""]={size:v(t.getAttribute("size")),min:v(t.getAttribute("min")),max:v(t.getAttribute("max"))};return e}const T=n=>[...n.children].filter(e=>e.localName==="clover-split-pane");function ie({hosted:n,props:e}){const t=n.element;return p(()=>(t.classList.add("clover-split"),()=>t.classList.remove("clover-split")),[t]),p(()=>{S(t).keyed(e.storageKey)},[t,e.storageKey]),null}function re({hosted:n,props:e}){const t=n.element,o=N(t),l=o?S(o):null,f=H((l==null?void 0:l.subscribe)??X,()=>(l==null?void 0:l.sizes)??V),h=v(e.size),i=v(e.min),c=v(e.max),u=e.name||String(o?T(o).indexOf(t):0),a=f[u];return p(()=>(t.classList.add("clover-split-pane"),()=>t.classList.remove("clover-split-pane")),[t]),p(()=>{t.dataset.splitKey=u,t.toggleAttribute("data-sized",h!==void 0),t.style.minWidth=A(i)??"0";const g=a!==void 0?`${a}px`:A(h);g?t.style.setProperty("--clover-split-size",g):t.style.removeProperty("--clover-split-size");const d=A(c);d?t.style.setProperty("--clover-split-max",d):t.style.removeProperty("--clover-split-max")},[t,u,h,i,c,a]),null}const K=new WeakMap;function oe({hosted:n}){const e=n.element,{t,langOf:o}=B(),[l]=F(()=>{const i=e.getAttribute("aria-label");return i!==null&&i!==K.get(e)?i:null}),f=l??t("splitHandle");p(()=>(e.classList.add("clover-split-handle"),e.setAttribute("role","separator"),e.setAttribute("aria-orientation","vertical"),e.hasAttribute("tabindex")||(e.tabIndex=0),()=>e.classList.remove("clover-split-handle")),[e]),p(()=>{if(l)return;e.setAttribute("aria-label",f),K.set(e,f);const i=o("splitHandle");i?e.setAttribute("lang",i):e.removeAttribute("lang")},[e,l,f,o]);const h=Z(null);return p(()=>{const i=N(e);if(!i)return;const c=S(i),y=s=>Math.round(s/(i.clientWidth||1)*100),u=(s,r)=>{e.setAttribute("aria-valuenow",String(y(s))),e.setAttribute("aria-valuemin",String(y(r.min))),e.setAttribute("aria-valuemax",String(y(r.max)))},a=()=>q(e,i,W(i)),g=s=>{const r=a();if(!r)return;const z=Math.min(r.max,Math.max(r.min,s));c.set(r.key,z),u(z,r)};h.current={limits:a,resize:g,step:()=>{var L;const s=a();if(!s)return;const r=G((L=W(i)[s.key])==null?void 0:L.size,i.clientWidth),z=j(s,r,c.sizes[s.key]);if(!z.own)return g(z.to);c.set(s.key,void 0),u(r,s)}};const d=()=>{const s=a();s&&u(s.sized.getBoundingClientRect().width,s)};d();const b=typeof ResizeObserver>"u"?null:new ResizeObserver(d);b==null||b.observe(i);const I=c.subscribe(()=>requestAnimationFrame(d));let x=false;const k=()=>{var r;const s=!!((r=J(e).sized)!=null&&r.hidden);s&&!e.hidden?e.hidden=x=true:!s&&x&&(x=false,e.hidden=false)};k();const E=new MutationObserver(()=>{k(),d()});E.observe(i,{attributes:true,subtree:true,attributeFilter:["hidden","data-sized"]});const m=D(()=>e,()=>h.current),O=[["pointerdown",s=>m.down(s)],["pointermove",s=>m.move(s)],["pointerup",s=>m.up(s)],["pointercancel",s=>m.up(s)],["click",s=>m.click(s)],["keydown",s=>m.key(s)]];for(const[s,r]of O)e.addEventListener(s,r);return()=>{for(const[s,r]of O)e.removeEventListener(s,r);m.dispose(),b==null||b.disconnect(),E.disconnect(),I()}},[e]),_(Q,{label:f})}export{ie as SplitElement,oe as SplitHandleElement,re as SplitPaneElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o}from"./shared-
|
|
1
|
+
import{u as o}from"./shared-ByrLMUQa.mjs";import{S as m}from"./Status-CEkhPlDF.mjs";import{a,C as i}from"./nodes-BDyXzQhk.mjs";function u({hosted:r,props:t}){const e=a(r.element,"loading"),n=a(r.element,"error");return o(m,{...t,loading:e?o(i,{of:e}):t.loading,error:n?()=>o(i,{of:n}):void 0})}export{u as StatusElement};
|