@nulib/clover 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Body/Body.mjs +16 -1
- package/dist/components/Body/glyphs.mjs +15 -0
- package/dist/components/Canvas/CanvasView.mjs +116 -12
- package/dist/components/Canvas/ChaptersMenu.mjs +105 -0
- package/dist/components/Canvas/ControlMenu.mjs +23 -4
- package/dist/components/Canvas/Controls.mjs +223 -60
- package/dist/components/Canvas/ControlsFade.mjs +16 -0
- package/dist/components/Canvas/ImageControls.mjs +209 -0
- package/dist/components/Canvas/Placeholder.mjs +44 -12
- package/dist/components/Canvas/RowFits.mjs +85 -0
- package/dist/components/Canvas/layout.mjs +11 -0
- package/dist/components/Canvas/media/MediaBody.mjs +105 -46
- package/dist/components/Canvas/media/Player.mjs +0 -55
- package/dist/components/Canvas/media/Transport.mjs +14 -23
- package/dist/components/Canvas/panClearOfControls.mjs +1 -1
- package/dist/components/Collection/Collection.mjs +1 -1
- package/dist/components/Items/CountMenu.mjs +1 -0
- package/dist/components/Items/Item.mjs +4 -3
- package/dist/components/Items/Items.mjs +30 -10
- package/dist/components/Items/PagerLayout.mjs +2 -0
- package/dist/components/Items/TargetItems.mjs +1 -1
- package/dist/components/Items/masonry.mjs +35 -0
- package/dist/components/Panel/About.mjs +25 -8
- package/dist/components/Root/useRootState.mjs +2 -49
- package/dist/components/Scene/SceneView.mjs +13 -2
- package/dist/components/Scene/cloverEngine.mjs +2 -1
- package/dist/components/Timeline/playerSurface.mjs +2 -0
- package/dist/core/clover.mjs +7 -4
- package/dist/core/content-state.mjs +5 -3
- package/dist/i18n/locales/en.json.mjs +1 -1
- package/dist/i18n/locales/es.json.mjs +1 -1
- package/dist/i18n/locales/fi.json.mjs +1 -1
- package/dist/i18n/locales/fr.json.mjs +1 -1
- package/dist/i18n/locales/nb.json.mjs +1 -1
- package/dist/i18n/locales/nn.json.mjs +1 -1
- package/dist/i18n/locales/no.json.mjs +1 -1
- package/dist/i18n/locales/pt.json.mjs +1 -1
- package/dist/index.d.mts +109 -51
- package/dist/lib/gltf/load.mjs +26 -6
- package/dist/lib/renderer/CanvasRenderer.mjs +44 -32
- package/dist/lib/renderer/camera/Camera.mjs +1 -1
- package/dist/react/useContentStateOutput.mjs +71 -0
- package/dist/styles.css +1 -1
- package/dist/templates/default/Default.mjs +37 -128
- package/dist/templates/document/Document.mjs +41 -64
- package/dist/templates/document/Sheets.mjs +13 -5
- package/dist/templates/gallery/Gallery.mjs +90 -18
- package/dist/templates/index.d.mts +299 -17
- package/dist/templates/shared/Lightbox.mjs +161 -69
- package/dist/templates/shared/LightboxView.mjs +118 -0
- package/dist/templates/shared/PanelPane.mjs +104 -0
- package/dist/templates/{document/DocumentPanel.mjs → shared/PanelPart.mjs} +2 -2
- package/dist/templates/shared/dragToClose.mjs +51 -8
- package/dist/templates/shared/givenAnnotations.mjs +13 -0
- package/dist/templates/shared/useDragToClose.mjs +6 -3
- package/dist/templates/shared/useLazyPanelPane.mjs +16 -0
- package/dist/templates/shared/useSlide.mjs +6 -0
- package/dist/templates.css +1 -1
- package/dist/ui/ControlCluster.mjs +15 -17
- package/dist/ui/Sections.mjs +3 -3
- package/dist/ui/mediaIcons.mjs +35 -8
- package/dist/ui/useScrollTrack.mjs +2 -1
- package/dist/web-components/About-DvyvVUK5.mjs +1 -0
- package/dist/web-components/AnnotationItems-BpRcSrOM.mjs +1 -0
- package/dist/web-components/{AnnotationMenu-BCwwwfbb.mjs → AnnotationMenu-BDPec3iI.mjs} +1 -1
- package/dist/web-components/{AnnotationState-CavxnAAq.mjs → AnnotationState-Chs_37Kk.mjs} +1 -1
- package/dist/web-components/{Annotations-DDjSrBL5.mjs → Annotations-6E-oD_wg.mjs} +1 -1
- package/dist/web-components/{Annotations-rBmeI5sR.mjs → Annotations-CLPEq7Ro.mjs} +1 -1
- package/dist/web-components/Body-Ct61yxI7.mjs +1 -0
- package/dist/web-components/{BodyAlert-COKp19lq.mjs → BodyAlert-C_Qh3Up_.mjs} +1 -1
- package/dist/web-components/{Button-DLFYqtz9.mjs → Button-L8ZMy5lY.mjs} +1 -1
- package/dist/web-components/{Camera-Cp5ma-6C.mjs → Camera-BPyLzZjP.mjs} +1 -1
- package/dist/web-components/{Canvas2DBackend-3PToh87Z.mjs → Canvas2DBackend-8wFavYdl.mjs} +1 -1
- package/dist/web-components/CanvasView-2Fj9nT06.mjs +2 -0
- package/dist/web-components/CaptionDetails-DuwS-grE.mjs +1 -0
- package/dist/web-components/ChaptersMenu-Bj2EqtVJ.mjs +1 -0
- package/dist/web-components/{Chevron-r-_hUPn8.mjs → Chevron-Cyr_cc9X.mjs} +1 -1
- package/dist/web-components/ChoiceMenu-ConzybVH.mjs +1 -0
- package/dist/web-components/Collection-CLayN8sv.mjs +1 -0
- package/dist/web-components/{CollectionSelect-CBWUbqQi.mjs → CollectionSelect-D2d8dGJ4.mjs} +1 -1
- package/dist/web-components/{Connected-B2d6EoFl.mjs → Connected-CBQ6xyhr.mjs} +1 -1
- package/dist/web-components/{Connected-BSRM9FJY.mjs → Connected-DMXG3imZ.mjs} +1 -1
- package/dist/web-components/{Connected-BnpxYeJN.mjs → Connected-pyd0EBD3.mjs} +1 -1
- package/dist/web-components/{Contents-D7FPxSH-.mjs → Contents-tCMXBYDK.mjs} +1 -1
- package/dist/web-components/ControlMenu-D1zkB0qX.mjs +1 -0
- package/dist/web-components/ControlsFade-BNXVTL_Q.mjs +1 -0
- package/dist/web-components/{CountMenu-DyTp_J4k.mjs → CountMenu-Dnzb7lKo.mjs} +1 -1
- package/dist/web-components/Cue-CUGmPS3k.mjs +1 -0
- package/dist/web-components/Document-D-8nalCX.mjs +1 -0
- package/dist/web-components/{DomLayers-CTGub6wo.mjs → DomLayers-BxPU05-D.mjs} +1 -1
- package/dist/web-components/{Download-BOYNIb7C.mjs → Download-Bku9Vptk.mjs} +1 -1
- package/dist/web-components/{EntryBodies-Bfd2Z42z.mjs → EntryBodies-77vDudCb.mjs} +1 -1
- package/dist/web-components/{EntryThumbnail-DQE8ajI9.mjs → EntryThumbnail-BxQWKW6e.mjs} +1 -1
- package/dist/web-components/{FieldPill-D5DNJWLy.mjs → FieldPill-nFGsaru9.mjs} +1 -1
- package/dist/web-components/FrameAnimation-BvKiSXcm.mjs +1 -0
- package/dist/web-components/Gallery-4Hd58afA.mjs +1 -0
- package/dist/web-components/{HideToggle-DL911R1Z.mjs → HideToggle-TEhY4TS4.mjs} +1 -1
- package/dist/web-components/ImageControls-CZO7WoPb.mjs +1 -0
- package/dist/web-components/Items-CudZ4Lnb.mjs +1 -0
- package/dist/web-components/Label-f07N5Fld.mjs +1 -0
- package/dist/web-components/{LanguageChoice-DT1UPiDn.mjs → LanguageChoice-B5VM21DV.mjs} +1 -1
- package/dist/web-components/LightboxView-C4OASmkg.mjs +1 -0
- package/dist/web-components/ListEnd-M39M62Cl.mjs +1 -0
- package/dist/web-components/{Loaded-BWfEBJyg.mjs → Loaded-oGFyBuos.mjs} +1 -1
- package/dist/web-components/LoadedCanvas-IvpSzPO6.mjs +1 -0
- package/dist/web-components/LoadedMap-WATGNLxl.mjs +1 -0
- package/dist/web-components/{Loading-zw74TdAz.mjs → Loading-YxuKrDAM.mjs} +1 -1
- package/dist/web-components/{Map--dJhk0_0.mjs → Map-Cw9j3gi3.mjs} +1 -1
- package/dist/web-components/MapView-3OxoCr5l.mjs +3 -0
- package/dist/web-components/Markup-DW75Jx3j.mjs +2 -0
- package/dist/web-components/MediaBody-CLtd0bf0.mjs +1 -0
- package/dist/web-components/MediaBody-JnKnoIqY.mjs +1 -0
- package/dist/web-components/{NavDate-BQHuyLOC.mjs → NavDate-BCCOyycx.mjs} +1 -1
- package/dist/web-components/{Navigator-B3U21_ti.mjs → Navigator-Bx4zS0Yr.mjs} +1 -1
- package/dist/web-components/{Pager-DnJknq92.mjs → Pager-B9GvQ64b.mjs} +1 -1
- package/dist/web-components/PagerLayout-BF33VZL_.mjs +1 -0
- package/dist/web-components/Panel-BvDpCn6K.mjs +1 -0
- package/dist/web-components/PanelPart-Bd4lSUrP.mjs +1 -0
- package/dist/web-components/{PanelToggle-CFtWIeWv.mjs → PanelToggle-bPcIULGZ.mjs} +1 -1
- package/dist/web-components/{PartOfManifest-F87jIrf9.mjs → PartOfManifest-HLg-r00O.mjs} +1 -1
- package/dist/web-components/{Pending-CYAQajKu.mjs → Pending-BxGjjnqq.mjs} +1 -1
- package/dist/web-components/PlaceBox-D-Zhe9-U.mjs +1 -0
- package/dist/web-components/Placeholder-DzY5hcbk.mjs +1 -0
- package/dist/web-components/{Position-BkWBRBfW.mjs → Position-TYnzcm8e.mjs} +1 -1
- package/dist/web-components/{Primitives-BmODPlnK.mjs → Primitives-C6VJXxZD.mjs} +1 -1
- package/dist/web-components/Provider-DyB0wpeO.mjs +1 -0
- package/dist/web-components/{ReadMore-BwGFsLS2.mjs → ReadMore-De_0T7lc.mjs} +1 -1
- package/dist/web-components/Root-Bt3NNBFb.mjs +1 -0
- package/dist/web-components/Scene-DrOM9YlD.mjs +1 -0
- package/dist/web-components/SceneView-DA7Yg20p.mjs +1 -0
- package/dist/web-components/{Search-CbmK9vLp.mjs → Search-DgT8OPsK.mjs} +1 -1
- package/dist/web-components/{Sections-Dy5_pkyQ.mjs → Sections-d1acn7qm.mjs} +2 -2
- package/dist/web-components/{StandaloneItems-BmUnBp0H.mjs → StandaloneItems-DUb4YKCB.mjs} +1 -1
- package/dist/web-components/{Status-Dww3Pyf4.mjs → Status-CcU3u6P4.mjs} +1 -1
- package/dist/web-components/{Steps-o_UprQfZ.mjs → Steps-nlSCzbDQ.mjs} +1 -1
- package/dist/web-components/{TargetItems-BBOGDubv.mjs → TargetItems-BDJM3Ar-.mjs} +1 -1
- package/dist/web-components/Timeline-BfdN3lIv.mjs +1 -0
- package/dist/web-components/{Tip-BbexILXs.mjs → Tip-OCB88zwY.mjs} +1 -1
- package/dist/web-components/{Transcript-ZVXM3ZDA.mjs → Transcript-bSA3cx_K.mjs} +1 -1
- package/dist/web-components/Transport-DaIhfZqC.mjs +1 -0
- package/dist/web-components/Transport-DjOYI-fR.mjs +1 -0
- package/dist/web-components/{annotation-collection-7SS1ELcO.mjs → annotation-collection-D8emkElk.mjs} +1 -1
- package/dist/web-components/{annotation-name-CYkZopdd.mjs → annotation-name-DbWjhgra.mjs} +1 -1
- package/dist/web-components/{annotations-content-Bdtn50sf.mjs → annotations-content-Bg6aVAGC.mjs} +1 -1
- package/dist/web-components/{body-CkOBHlJ0.mjs → body-Ct8dmQdW.mjs} +1 -1
- package/dist/web-components/canvas-goEZLqEd.mjs +1 -0
- package/dist/web-components/cloverEngine-Df7cMwOP.mjs +164 -0
- package/dist/web-components/{content-state-reader-Ahh6artg.mjs → content-state-reader-CNmBpG1L.mjs} +1 -1
- package/dist/web-components/{controls-BJrZVQkS.mjs → controls-BZr16sYQ.mjs} +1 -1
- package/dist/web-components/custom-elements.json +160 -44
- package/dist/web-components/{downloads-CqVWo-yn.mjs → downloads-EjJ6Hpip.mjs} +1 -1
- package/dist/web-components/dragToClose-X9NbZOhA.mjs +1 -0
- package/dist/web-components/{engine-B-sscpLa.mjs → engine-DMoc0tff.mjs} +1 -1
- package/dist/web-components/{engines-DfCHjbt3.mjs → engines-BmB81VXR.mjs} +1 -1
- package/dist/web-components/es-B1NvdYp-.mjs +1 -0
- package/dist/web-components/{fetchManifest-BIzne1Pj.mjs → fetchManifest-CwQC6cCh.mjs} +1 -1
- package/dist/web-components/fi-BjtYZNLo.mjs +1 -0
- package/dist/web-components/fr-Cd22Lziw.mjs +1 -0
- package/dist/web-components/fromManifest-DrAmY1lB.mjs +1 -0
- package/dist/web-components/glyphs-BFK_hvJJ.mjs +1 -0
- package/dist/web-components/hooks-BhtNDs_1.mjs +1 -0
- package/dist/web-components/image-layers-D2nQC4R-.mjs +1 -0
- package/dist/web-components/{imageService-0eTvQ-3h.mjs → imageService-iFElsopt.mjs} +1 -1
- package/dist/web-components/index-FJEpXukG.mjs +1 -0
- package/dist/web-components/index.d.mts +4 -4
- package/dist/web-components/index.mjs +1 -1
- package/dist/web-components/items-BPPrqbeh.mjs +1 -0
- package/dist/web-components/items-BnEnc5ot.mjs +1 -0
- package/dist/web-components/label-DauFa5sg.mjs +1 -0
- package/dist/web-components/layout-Djwu8f4R.mjs +1 -0
- package/dist/web-components/{link-GEdiEwlR.mjs → link-0lUlTZlw.mjs} +1 -1
- package/dist/web-components/logo-DWPxaZaG.mjs +1 -0
- package/dist/web-components/masonry-0QfzOgbB.mjs +1 -0
- package/dist/web-components/{models-59cEeiAA.mjs → models-BF2pqufA.mjs} +1 -1
- package/dist/web-components/nb-CEwZDBiR.mjs +1 -0
- package/dist/web-components/nn-jYQhr9RI.mjs +1 -0
- package/dist/web-components/no-CEwZDBiR.mjs +1 -0
- package/dist/web-components/{nodes-CTw9OqlA.mjs → nodes-ChQRLDGU.mjs} +1 -1
- package/dist/web-components/{overlayImage-BMt4UTlR.mjs → overlayImage-MKrcgDep.mjs} +1 -1
- package/dist/web-components/panClearOfControls-Cn2ZXsZi.mjs +1 -0
- package/dist/web-components/{panel-C17Rl9Ya.mjs → panel-C13V6w6E.mjs} +1 -1
- package/dist/web-components/part-CekFWrtz.mjs +1 -0
- package/dist/web-components/playerSurface-DG1XipTq.mjs +1 -0
- package/dist/web-components/pointer-YQppt0at.mjs +1 -0
- package/dist/web-components/{provider-BpxorEiq.mjs → provider-DiUkZYiW.mjs} +1 -1
- package/dist/web-components/pt-CWR30SzS.mjs +1 -0
- package/dist/web-components/{range-regions-BGQy4E9U.mjs → range-regions-CqGjyM76.mjs} +1 -1
- package/dist/web-components/{read-more-BDM_6CVc.mjs → read-more-D8RJYdtQ.mjs} +1 -1
- package/dist/web-components/readingLanguages-BWOLZK2k.mjs +1 -0
- package/dist/web-components/rendererSurface-BkbGDL_Z.mjs +22 -0
- package/dist/web-components/{renderers-CiB74bQh.mjs → renderers-LtRX5pT0.mjs} +1 -1
- package/dist/web-components/{resource-CRbpf9pX.mjs → resource-Cfydiy4m.mjs} +1 -1
- package/dist/web-components/{save-file-CCuZEuQr.mjs → save-file-dZyOpXgY.mjs} +1 -1
- package/dist/web-components/search-BfUZJM3a.mjs +1 -0
- package/dist/web-components/shared-DkY2a89G.mjs +1 -0
- package/dist/web-components/{show-link-BXm7SNIC.mjs → show-link-DgLJzG7k.mjs} +1 -1
- package/dist/web-components/{sizedImage-k4Q-eyOB.mjs → sizedImage-NHzhcBYk.mjs} +1 -1
- package/dist/web-components/{split-Hp6z-v4h.mjs → split-CuFiKjin.mjs} +1 -1
- package/dist/web-components/{status-BmtuKfAG.mjs → status-C3etlkhY.mjs} +1 -1
- package/dist/web-components/styles-DkkVOSUQ.mjs +1 -0
- package/dist/web-components/three.mjs +1 -1
- package/dist/web-components/{thumbnail-Dp7a8oom.mjs → thumbnail-DecrVnpj.mjs} +1 -1
- package/dist/web-components/{tip-C-oovDZK.mjs → tip-D5YgaIWW.mjs} +1 -1
- package/dist/web-components/{toggle-C7ODWDEZ.mjs → toggle-CZGB65VZ.mjs} +1 -1
- package/dist/web-components/{useContainerName-CrOmY-km.mjs → useContainerName-hKQjEt7a.mjs} +1 -1
- package/dist/web-components/useControlsVisibility-DPg8uAkW.mjs +1 -0
- package/dist/web-components/useLazyPanelPane-eby-OI1V.mjs +1 -0
- package/dist/web-components/{useNearViewport-BqXi9Gn4.mjs → useNearViewport-CDbHQUBk.mjs} +1 -1
- package/dist/web-components/useScrollTrack-D9l_P3_B.mjs +1 -0
- package/dist/web-components/viewer/AnnotationItems-DtsnDXPM.mjs +1 -0
- package/dist/web-components/viewer/{AnnotationMenu-DPOSehBo.mjs → AnnotationMenu-C-Mz6CCn.mjs} +1 -1
- package/dist/web-components/viewer/AnnotationState-5pim5K72.mjs +1 -0
- package/dist/web-components/viewer/Annotations-Cqn1TkzD.mjs +2 -0
- package/dist/web-components/viewer/Annotations-CxwN9FkB.mjs +1 -0
- package/dist/web-components/viewer/{Canvas2DBackend-BTK6ZJh0.mjs → Canvas2DBackend-C-ZMSCak.mjs} +1 -1
- package/dist/web-components/viewer/CaptionDetails-CRD-gSZP.mjs +1 -0
- package/dist/web-components/viewer/ChaptersMenu-Brcq3yJv.mjs +1 -0
- package/dist/web-components/viewer/{ChoiceMenu-DQ1x572Y.mjs → ChoiceMenu-ByGzQQx1.mjs} +1 -1
- package/dist/web-components/viewer/Collection-m0GCcsfQ.mjs +1 -0
- package/dist/web-components/viewer/Connected-Bmc_CdUD.mjs +1 -0
- package/dist/web-components/viewer/Connected-Dvx7wtot.mjs +1 -0
- package/dist/web-components/viewer/Contents-CwDpfiJY.mjs +1 -0
- package/dist/web-components/viewer/ControlMenu-TcO85hDf.mjs +1 -0
- package/dist/web-components/viewer/ControlsFade-BoZ4ABAE.mjs +1 -0
- package/dist/web-components/viewer/{CountMenu-4u6U6yqb.mjs → CountMenu-0-ie8kIZ.mjs} +1 -1
- package/dist/web-components/viewer/Cue-DxmAS9Gx.mjs +1 -0
- package/dist/web-components/viewer/Document-BsryuYJ1.mjs +1 -0
- package/dist/web-components/viewer/{DomLayers-CGkDtemL.mjs → DomLayers-hc0qARQc.mjs} +1 -1
- package/dist/web-components/viewer/Download-MO-1Rik4.mjs +1 -0
- package/dist/web-components/viewer/EntryBodies-g-OEwEsk.mjs +1 -0
- package/dist/web-components/viewer/EntryThumbnail-DcIDYATi.mjs +1 -0
- package/dist/web-components/viewer/{FieldPill-DFXGWrvB.mjs → FieldPill-B9S21lxw.mjs} +1 -1
- package/dist/web-components/viewer/FrameAnimation-qI9cZPEs.mjs +1 -0
- package/dist/web-components/viewer/Gallery-BOgUqfqw.mjs +1 -0
- package/dist/web-components/viewer/{HideToggle-DP5kHzWM.mjs → HideToggle-D8wH49mq.mjs} +1 -1
- package/dist/web-components/viewer/ImageControls-ZoEC9jWd.mjs +1 -0
- package/dist/web-components/viewer/LanguageChoice-CRqsCBAp.mjs +1 -0
- package/dist/web-components/viewer/LightboxView-BB-GcbYr.mjs +1 -0
- package/dist/web-components/viewer/ListEnd-D9Obxie4.mjs +1 -0
- package/dist/web-components/viewer/{MapView-BN9wXQKV.mjs → MapView-DQSwUzd7.mjs} +2 -2
- package/dist/web-components/viewer/MediaBody-CIw2nTlj.mjs +1 -0
- package/dist/web-components/viewer/MediaBody-D5ff6xy-.mjs +1 -0
- package/dist/web-components/viewer/{NavDate-C2-wwLuB.mjs → NavDate-BnfDG57h.mjs} +1 -1
- package/dist/web-components/viewer/{Navigator-C3jghOd3.mjs → Navigator-BNwjmkXY.mjs} +1 -1
- package/dist/web-components/viewer/PagerLayout-C8jraHqs.mjs +1 -0
- package/dist/web-components/viewer/PanelPart-YNbBI9SQ.mjs +1 -0
- package/dist/web-components/viewer/{PartOfManifest-D22yMgCf.mjs → PartOfManifest-DX7H0V4g.mjs} +1 -1
- package/dist/web-components/viewer/PlaceBox-CCWfzsNU.mjs +1 -0
- package/dist/web-components/viewer/Placeholder-CsEkLhz7.mjs +1 -0
- package/dist/web-components/viewer/Search-CsdYzdq1.mjs +1 -0
- package/dist/web-components/viewer/StandaloneItems-BfvBxbUm.mjs +1 -0
- package/dist/web-components/viewer/{Steps-Bw32X5xO.mjs → Steps-BH8ZApS4.mjs} +1 -1
- package/dist/web-components/viewer/{TargetItems-DLhUH1Gq.mjs → TargetItems-BebPFr-c.mjs} +1 -1
- package/dist/web-components/viewer/Transcript-DXLv5WR9.mjs +1 -0
- package/dist/web-components/viewer/Transport-C-fh7Kx2.mjs +1 -0
- package/dist/web-components/viewer/Transport-CY6BWfMi.mjs +1 -0
- package/dist/web-components/viewer/annotation-collection-Cjd8Dgyl.mjs +1 -0
- package/dist/web-components/viewer/annotation-name-CwmgQFia.mjs +1 -0
- package/dist/web-components/viewer/{annotations-content-CbA3eOIC.mjs → annotations-content-BARXoAz-.mjs} +1 -1
- package/dist/web-components/viewer/cloverEngine-CumnJPKO.mjs +164 -0
- package/dist/web-components/viewer/{content-state-reader-C7UBMOq3.mjs → content-state-reader-DuvyLThu.mjs} +1 -1
- package/dist/web-components/viewer/dragToClose-CFCxhUxn.mjs +1 -0
- package/dist/web-components/viewer/{fetchManifest-C2Yxg3x9.mjs → fetchManifest-qNB_KgxL.mjs} +1 -1
- package/dist/web-components/viewer/{host-CZeyjCKR.mjs → host-GTHX2fPK.mjs} +1 -1
- package/dist/web-components/viewer/image-layers-DKOuaRTj.mjs +1 -0
- package/dist/web-components/viewer/index.mjs +1 -1
- package/dist/web-components/viewer/{link-DssZ0Z2N.mjs → link-BlaM0tCa.mjs} +1 -1
- package/dist/web-components/viewer/overlayImage-RVpv69R5.mjs +1 -0
- package/dist/web-components/viewer/range-regions-CIZiAHOp.mjs +1 -0
- package/dist/web-components/viewer/{renderers-DLoqv3QO.mjs → renderers-Dw1klwlx.mjs} +1 -1
- package/dist/web-components/viewer/{save-file-CJT5p5Hg.mjs → save-file-EvzaBEJN.mjs} +1 -1
- package/dist/web-components/viewer/{search-PhOwMKHi.mjs → search-x1QL_bth.mjs} +1 -1
- package/dist/web-components/viewer/styles-I7_LWFGj.mjs +1 -0
- package/dist/web-components/viewer/useControlsVisibility-C_SQHIVR.mjs +1 -0
- package/dist/web-components/viewer/useLazyPanelPane-UuGDJrf_.mjs +1 -0
- package/dist/web-components/viewer/viewer-DJrQuNs1.mjs +29 -0
- package/dist/web-components/viewer/{vtt-1Pk7Dhsj.mjs → vtt-C2G89SWH.mjs} +1 -1
- package/dist/web-components/viewer-Br44EEba.mjs +1 -0
- package/dist/web-components/{vtt-CacHieeN.mjs → vtt-Dd0c7psH.mjs} +1 -1
- package/package.json +1 -1
- package/dist/templates/shared/LightboxBody.mjs +0 -9
- package/dist/web-components/About-DhOGPFaI.mjs +0 -1
- package/dist/web-components/AnnotationItems-CNP4CJiT.mjs +0 -1
- package/dist/web-components/Body-DaY1UJIy.mjs +0 -1
- package/dist/web-components/BodyUnloadable-DcTM7hHF.mjs +0 -1
- package/dist/web-components/CanvasView-BWQ4SK2b.mjs +0 -2
- package/dist/web-components/CaptionDetails-DSziiuQV.mjs +0 -1
- package/dist/web-components/ChoiceMenu-DTuEEUeM.mjs +0 -1
- package/dist/web-components/Collection-B9swJtPW.mjs +0 -1
- package/dist/web-components/ControlMenu-Crtho2cs.mjs +0 -1
- package/dist/web-components/Cue-CbZaGwZh.mjs +0 -1
- package/dist/web-components/Document-BfltLWZZ.mjs +0 -1
- package/dist/web-components/DocumentPanel-ZSe40cV4.mjs +0 -1
- package/dist/web-components/FrameAnimation-IfR1czfc.mjs +0 -1
- package/dist/web-components/Gallery-DD06BDQo.mjs +0 -1
- package/dist/web-components/Items-BHzT9A73.mjs +0 -1
- package/dist/web-components/Label-KabnxuMN.mjs +0 -1
- package/dist/web-components/LightboxBody-BhRhdXo6.mjs +0 -1
- package/dist/web-components/ListEnd-CbwNlty-.mjs +0 -1
- package/dist/web-components/LoadedCanvas-CdZ5WOWz.mjs +0 -1
- package/dist/web-components/LoadedMap-DQyQVRVQ.mjs +0 -1
- package/dist/web-components/MapView-duA5WGsu.mjs +0 -3
- package/dist/web-components/Markup-D-kioDf9.mjs +0 -2
- package/dist/web-components/MediaBody-CoOiVXcv.mjs +0 -1
- package/dist/web-components/MediaBody-d8ErTuwT.mjs +0 -1
- package/dist/web-components/PagerLayout-CvOmKtSW.mjs +0 -1
- package/dist/web-components/Panel-CIdjOznL.mjs +0 -1
- package/dist/web-components/PlaceBox-BtIbIotm.mjs +0 -1
- package/dist/web-components/Placeholder-TIyj4ZjR.mjs +0 -1
- package/dist/web-components/Provider-C8se8i4I.mjs +0 -1
- package/dist/web-components/Root-CAJB0-Mh.mjs +0 -1
- package/dist/web-components/Scene-Ctcdt7CD.mjs +0 -1
- package/dist/web-components/SceneView-B6bEx_7x.mjs +0 -1
- package/dist/web-components/Timeline-CfIF4APc.mjs +0 -1
- package/dist/web-components/canvas-CWf_Fag8.mjs +0 -1
- package/dist/web-components/cloverEngine-6djEHNCD.mjs +0 -164
- package/dist/web-components/dragToClose-C-Pf1IeO.mjs +0 -1
- package/dist/web-components/es-BYfHUZ7P.mjs +0 -1
- package/dist/web-components/fi-B5y2qr8T.mjs +0 -1
- package/dist/web-components/fr-ChezCx6V.mjs +0 -1
- package/dist/web-components/fromManifest-gg5Wx14y.mjs +0 -1
- package/dist/web-components/glyphs-JYl2STEr.mjs +0 -1
- package/dist/web-components/hooks-x7rO95CS.mjs +0 -1
- package/dist/web-components/image-layers-BjbeyHBS.mjs +0 -1
- package/dist/web-components/index-BZ7b9k0N.mjs +0 -1
- package/dist/web-components/items-CnAIl9fS.mjs +0 -1
- package/dist/web-components/items-F6hJgdAS.mjs +0 -1
- package/dist/web-components/label-CI88KH2_.mjs +0 -1
- package/dist/web-components/layout-De1MOSYe.mjs +0 -1
- package/dist/web-components/logo-Ckwj7FlP.mjs +0 -1
- package/dist/web-components/nb-8J22f9Td.mjs +0 -1
- package/dist/web-components/nn-Dv1EvzI1.mjs +0 -1
- package/dist/web-components/no-8J22f9Td.mjs +0 -1
- package/dist/web-components/panClearOfControls-ac9uf-Qs.mjs +0 -1
- package/dist/web-components/part-CXts97_M.mjs +0 -1
- package/dist/web-components/playerSurface-HYwEwPK6.mjs +0 -1
- package/dist/web-components/pt-DWYQkATt.mjs +0 -1
- package/dist/web-components/readingLanguages-fs_HqvqQ.mjs +0 -1
- package/dist/web-components/rendererSurface-C0aKlE0v.mjs +0 -22
- package/dist/web-components/search-CkM0O0Z1.mjs +0 -1
- package/dist/web-components/shared-MTsMddHx.mjs +0 -1
- package/dist/web-components/styles-CZV1nbBQ.mjs +0 -1
- package/dist/web-components/useScrollTrack-CEsOU2yT.mjs +0 -1
- package/dist/web-components/viewer/AnnotationItems-CyhVcRFc.mjs +0 -1
- package/dist/web-components/viewer/AnnotationState-Bjztkobn.mjs +0 -1
- package/dist/web-components/viewer/Annotations-Dh_8Tzi0.mjs +0 -2
- package/dist/web-components/viewer/Annotations-wwuOCxzI.mjs +0 -1
- package/dist/web-components/viewer/CaptionDetails-BwCTovy_.mjs +0 -1
- package/dist/web-components/viewer/Collection-DSBxCmXw.mjs +0 -1
- package/dist/web-components/viewer/Connected-CL3N8F2J.mjs +0 -1
- package/dist/web-components/viewer/Connected-DTk1jlyI.mjs +0 -1
- package/dist/web-components/viewer/Contents-DrXckx7d.mjs +0 -1
- package/dist/web-components/viewer/ControlMenu-Bp91s-g_.mjs +0 -1
- package/dist/web-components/viewer/Cue-C-aF8peC.mjs +0 -1
- package/dist/web-components/viewer/Document-BN1rICu3.mjs +0 -1
- package/dist/web-components/viewer/DocumentPanel-CEesxdeY.mjs +0 -1
- package/dist/web-components/viewer/Download-CawEl9MN.mjs +0 -1
- package/dist/web-components/viewer/EntryBodies-nYHMwSSM.mjs +0 -1
- package/dist/web-components/viewer/EntryThumbnail-DrO_0SzR.mjs +0 -1
- package/dist/web-components/viewer/FrameAnimation-CZfzpxaD.mjs +0 -1
- package/dist/web-components/viewer/Gallery-MWHtvjti.mjs +0 -1
- package/dist/web-components/viewer/LanguageChoice-C50T7dPI.mjs +0 -1
- package/dist/web-components/viewer/LightboxBody-C2T7IC29.mjs +0 -1
- package/dist/web-components/viewer/ListEnd-BDuOx__m.mjs +0 -1
- package/dist/web-components/viewer/MediaBody-CEyswliX.mjs +0 -1
- package/dist/web-components/viewer/MediaBody-Dw3DWDjc.mjs +0 -1
- package/dist/web-components/viewer/PagerLayout-Cg2NpqoD.mjs +0 -1
- package/dist/web-components/viewer/PlaceBox-Dckw4Sfk.mjs +0 -1
- package/dist/web-components/viewer/Placeholder-NYVWYg5Q.mjs +0 -1
- package/dist/web-components/viewer/Search-DC259m4f.mjs +0 -1
- package/dist/web-components/viewer/StandaloneItems-E4kpMne9.mjs +0 -1
- package/dist/web-components/viewer/Transcript-D_VGJQxn.mjs +0 -1
- package/dist/web-components/viewer/annotation-collection-DZHa18ir.mjs +0 -1
- package/dist/web-components/viewer/annotation-name-BaNdW2Xk.mjs +0 -1
- package/dist/web-components/viewer/cloverEngine-C04bCSFR.mjs +0 -164
- package/dist/web-components/viewer/image-layers-B09fporZ.mjs +0 -1
- package/dist/web-components/viewer/overlayImage-BR3eJCKq.mjs +0 -1
- package/dist/web-components/viewer/range-regions-By6L5JOK.mjs +0 -1
- package/dist/web-components/viewer/styles-NZLnZPAC.mjs +0 -1
- package/dist/web-components/viewer/viewer-D30YHqyF.mjs +0 -29
- package/dist/web-components/viewer-CH7re5OO.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e,l as N}from"./shared-
|
|
1
|
+
import{u as e,l as N}from"./shared-DkY2a89G.mjs";import{s as E}from"./Annotations-CLPEq7Ro.mjs";import H from"./ControlMenu-D1zkB0qX.mjs";import{C as T}from"./Cue-CUGmPS3k.mjs";import{H as $}from"./HideToggle-TEhY4TS4.mjs";import{u as w}from"./useContainerName-hKQjEt7a.mjs";import"./styles-DkkVOSUQ.mjs";const q=({id:m,triggerId:b,label:C,labelLang:y,annotations:d,hiddenPages:M=[],onPageVisibilityChange:g,selected:x,onSelect:v,onActivate:i,onClose:k})=>{const u=w(C,y),c=[];d.forEach((a,r)=>{var o,l;const t=c[c.length-1];t&&((o=t.page)==null?void 0:o.text)===((l=a.page)==null?void 0:l.text)?t.items.push(r):c.push({page:a.page,items:[r]})});const I=c.some(a=>!a.page);return e(H,{className:"clover-canvas-annotation-menu","data-testid":"clover-canvas-annotation-menu",id:m,onClose:k,triggerId:b,children:[I&&u.node,c.map((a,r)=>{const t=[...new Set(a.items.flatMap(s=>d[s].pageId??[]))],o=`${m}-page-${r}`,l=g&&t.length>0&&e($,{hidden:t.every(s=>M.includes(s)),onChange:s=>g(t,!s),of:a.page?o:void 0});return e("fieldset",{...a.page?{"aria-labelledby":o}:u.props,className:"clover-canvas-menu-group clover-annotations-set",children:[a.page?e("legend",{className:"clover-canvas-menu-legend clover-annotations-set-header",children:[e("span",{className:"clover-annotations-title",id:o,...N(a.page.lang),children:a.page.text}),l]}):l&&e("div",{className:"clover-annotations-set-header",children:l}),e("div",{className:"clover-annotations-list",children:a.items.map(s=>{const n=d[s],h=E(n),p=x===n.id,f="image"in n?n.image:void 0;return e("label",{className:"clover-canvas-menu-item clover-annotations-entry","data-selected":p,onMouseEnter:()=>i(n.id),onMouseLeave:()=>i(null),children:[e("input",{type:"radio",name:m,checked:p,onChange:()=>v(n),onClick:()=>p&&v(n),onFocus:()=>i(n.id),onBlur:()=>i(null)}),h!==void 0&&e(T,{start:h,className:"clover-annotations-time"}),e("span",{className:"clover-annotations-body clover-cue-text",children:[f&&e("img",{className:"clover-annotations-image",src:f,alt:"",loading:"lazy"}),e("span",{className:"clover-annotations-text",...N(n.label?n.lang:void 0),children:n.label??String(s+1)})]})]},n.id)})})]},r)})]})};export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as i,
|
|
1
|
+
import{T as i,a9 as qt,f as bt,d as C,aE as Gt,q as k,A as l,E as jt,y as z,_ as kt,u as zt}from"./shared-DkY2a89G.mjs";import{w as Dt,p as It,g as Ot,t as Jt,A as Ut}from"./Annotations-CLPEq7Ro.mjs";import{h as Xt}from"./layout-Djwu8f4R.mjs";const Yt=()=>import("./svg-shape-DLY3g7oq.mjs");function Zt(w){var S;const c=i(()=>!!(w!=null&&w.some(({annotation:o})=>{var p;return(p=qt(o==null?void 0:o.target))==null?void 0:p.svg})),[w]);return((S=bt(Yt,c))==null?void 0:S.readSvgShape)??null}const xt=[];function Et({given:w,annotations:c,scene:S,renderer:o,sceneVersion:p,drawn:E,media:I,mediaElement:g,showPlaceholder:F,canvasKey:D,openImages:tt,openMedia:et,host:nt,onModel:H,refind:_=0}){const{canvases:d,language:v,hiddenPages:rt,unlistedPages:yt,onPageVisibilityChange:ct,onAnnotationActive:ut,selectedAnnotation:st,animateAnnotations:ot=false,highlightedAnnotation:Ct,onAnnotationSelect:lt,onAnnotationLink:J}=w,[B,Ft]=C([]),[it,Ht]=C([]),L=rt!==void 0,U=i(()=>{var n;if(L)return xt;const t=new Map;for(const r of c){if(!r.pageId)continue;const f=!(Number((n=d==null?void 0:d[r.targetIndex])==null?void 0:n.duration)>0)&&Gt(r.annotation.motivation,qt(Array.isArray(r.annotation.target)?r.annotation.target[0]:r.annotation.target));t.set(r.pageId,(t.get(r.pageId)??true)&&f)}const e=[...t].filter(([,r])=>r).map(([r])=>r);return e.length?e:xt},[L,c,d]),_t=i(()=>{const t=U.filter(e=>!it.includes(e)&&!B.includes(e));return t.length?[...B,...t]:B},[B,it,U]),a=rt??_t,X=yt??U,N=k(t=>X.length?t.filter(e=>!e.pageId||!X.includes(e.pageId)):t,[X]),dt=i(()=>N(c).length,[c,N]),T=k(t=>a.length?t.filter(e=>!e.pageId||!a.includes(e.pageId)):t,[a]),Q=l(ct);Q.current=ct;const R=k((t,e)=>{var n;(n=Q.current)==null||n.call(Q,t,e),!L&&(Ft(r=>{const s=r.filter(f=>!t.includes(f));return e?s:[...s,...t]}),Ht(r=>{const s=r.filter(f=>!t.includes(f));return e?[...s,...t]:s}))},[L]),gt=i(()=>Dt(T(c),d),[c,T,d]),O=i(()=>{if(!(!S||!d))return(t,e,n)=>{const r=d.findIndex(Wt=>Wt.id===e),s=r===-1?n:r,f=S.placements[s];return f?Xt(d[s],f,t):null}},[S,d]),W=Zt(c),P=i(()=>o&&p>0&&E?It(c,O??((t,e,n)=>o.itemRectToWorld(n,t)),W,v):[],[o,c,p,E,O,W,v]),x=i(()=>T(P),[P,T]),Y=i(()=>P.length||!O?P:It(c,O,W,v),[P,O,c,W,v]),[Bt,Lt]=C(null),[Nt,ft]=C(null),u=st!==void 0?st:Nt,A=l(null),h=l(ut);h.current=ut;const m=l(lt);m.current=lt;const Z=k(t=>{var e;Lt(t),(e=h.current)==null||e.call(h,t)},[]),$=l(ot);$.current=ot;const pt=l(false);pt.current=F;const V=l(g);V.current=g;const at=l(o);at.current=o;const q=l(null),Pt=l(a);Pt.current=a;const ht=l(R);ht.current=R;const K=k(t=>{var e,n,r;if(t.pageId&&Pt.current.includes(t.pageId)&&ht.current([t.pageId],true),ft(t.id),(e=h.current)==null||e.call(h,t.id),(n=m.current)==null||n.call(m,t.id),!pt.current){if("start"in t){const s=V.current;if(!s)return;q.current=t.id,jt(s,t.start);return}if(A.current=t.id,t.track){const s=V.current;s&&Ot(t,s)&&(q.current=t.id);return}(r=at.current)==null||r.fitAnnotation(t.world,!$.current)}},[]),mt=l(u);mt.current=u;const b=k(()=>{var t;return mt.current?(ft(null),A.current=null,(t=m.current)==null||t.call(m,null),true):false},[]),G=l(J);G.current=J;const wt=!!J,Qt=i(()=>wt?t=>{var e,n;(e=nt.current)==null||e.focus({preventScroll:true}),b(),t.link&&((n=G.current)==null||n.call(G,t.link))}:void 0,[wt,b,nt]),St=l(_);z(()=>{if(!u){A.current=null;return}if(St.current!==_&&(St.current=_,A.current=null),A.current===u)return;const t=r=>r.find(s=>s.id===u),e=t(x),n=e??t(P);if(n){if(A.current=n.id,n.track){!e&&g&&Ot(n,g);return}o==null||o.fitAnnotation(n.world,!$.current)}},[u,x,P,g,o,_]);const y=i(()=>I?Jt(c,v):[],[I,c,v]),j=i(()=>T(y),[y,T]),vt=i(()=>N(y.length?[...Y,...y]:Y),[Y,y,N]);z(()=>{if(!u){q.current=null;return}if(q.current===u||!g)return;const t=j.find(e=>e.id===u);t&&(q.current=t.id,g.currentTime=t.start)},[u,j,g]);const M=l(null),[Tt,Rt]=C(null);z(()=>{M.current=u??null},[u]),z(()=>{const t=M.current;if(!(!t||!c.some(e=>{var n;return((n=e.annotation)==null?void 0:n.id)===t}))&&(M.current=null,!!F)){if(!I){tt(true);return}et(D),Rt(D)}},[u,c,F,I,D,tt,et]);const At=i(()=>({menu:vt,placed:x,timed:j,hiddenPages:a,setPagesVisible:R,listedCount:dt,comments:gt,selected:u??null,select:K,activate:Z,release:b,quietlyOpened:Tt}),[vt,x,j,a,R,dt,gt,u,K,Z,b,Tt]);return kt(()=>H(At),[At,H]),kt(()=>()=>H(null),[H]),o&&p>0&&!F?zt(Ut,{renderer:o,placed:x,sceneVersion:p,active:Bt??Ct??u,selected:u,onActivate:Z,onSelect:K,onFollow:Qt,media:I?g:void 0}):null}export{Et as AnnotationState};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as ct,a as Z,e as z,c as y,s as Lt,
|
|
1
|
+
import{D as ct,a as Z,e as z,c as y,s as Lt,n as kt,o as Ct,R as lt,r as Nt,u as a,t as V,w as $t,B as rt,E as At,b as dt,F as ut,T as M,d as tt,A as Tt,y as X,l as B,G as Et,H as Ot,v as Mt,k as ot,f as Bt}from"./shared-DkY2a89G.mjs";import{E as qt}from"./EntryBodies-77vDudCb.mjs";import{u as yt,L as Pt}from"./ListEnd-M39M62Cl.mjs";import{a as Rt}from"./annotation-name-DbWjhgra.mjs";import{r as Vt,a as Ft}from"./link-0lUlTZlw.mjs";import{s as Ht}from"./show-link-DgLJzG7k.mjs";import{f as jt,r as Gt}from"./fetchManifest-CwQC6cCh.mjs";import{j as mt}from"./classnames-DukgfdpI.mjs";import{b as it,s as Kt}from"./bringIntoView-CQH5ZgMM.mjs";import{a as Y}from"./heading-Cjt0f-Eu.mjs";import{C as _t}from"./Cue-CUGmPS3k.mjs";import{E as zt}from"./EntryThumbnail-BxQWKW6e.mjs";import{H as ft}from"./HideToggle-TEhY4TS4.mjs";import{u as ht,s as _}from"./readingLanguages-BWOLZK2k.mjs";import{LanguageChoice as gt}from"./LanguageChoice-B5VM21DV.mjs";import"./styles-DkkVOSUQ.mjs";function vt(t){const s=t.bodies.filter(n=>{var u;return!n.image&&((u=n.value)==null?void 0:u.trim())}).map(n=>n.language).filter(n=>!!n&&n!=="none");return[...new Set(s)]}function pt(t){const s=t.map(vt),n=[...new Set(s.flat())];return n.length<2?[]:s.some(o=>o.length&&n.some(c=>!o.includes(c)))?n:[]}function bt(t,s){if(!s)return true;const n=vt(t);return!n.length||n.includes(s)}const Dt=[],xn=ct(function({scope:s="all",renderEntry:n,headingLevel:u=3,as:o="div",className:c,...m},l){const{t:r,langOf:f}=Z(),{clover:d,language:S}=z("Annotations"),L=y(e=>Lt(e.manifest,e.addedSets)),$=y(e=>kt(e.manifest,e.canvasId)),T=y(e=>Ct(e.manifest,e.addedSets,e.hiddenSets,e.shownSets)),p=y(e=>e.annotationId),A=lt.useSyncExternalStore(d.highlight.subscribe,d.highlight.get,d.highlight.get),g=e=>{const b=$t(L,e),I=b&&rt(b.target.t),P=d.media.get();I&&P&&$.some(F=>F.id===b.canvasId)&&At(P,I.start),d.selectAnnotation(e)},k=y(e=>s==="all"?Nt(e.manifest):Dt),w=yt(k),C=e=>e.entries.filter(b=>$.some(I=>I.id===b.canvasId)),N=L.map(e=>({set:e,entries:C(e)})).filter(({entries:e})=>e.length),E=Y(u),x={text:r("annotationsShow"),lang:f("annotationsShow")};return s==="all"?a(Xt,{ref:l,as:o,className:c,rest:m,sets:L,shown:$.map(e=>e.id),headingLevel:u,language:S,showLabel:x,hiddenSets:T,selected:p,highlighted:A,renderEntry:n,onSelect:g,onHighlight:e=>d.highlight.emit(e),onVisible:(e,b)=>e.forEach(I=>d.setSetVisible(I,b)),end:w.more&&a(Pt,{onReached:w.reachNext})}):N.length?a(o,{ref:l,className:mt("clover-annotations",c),...m,children:N.map(({set:e,entries:b})=>a(Ut,{set:e,entries:b,canvases:$,Heading:E,headingLevel:u,language:S,title:V(e.label,S),showLabel:x,hidden:T.includes(e.id),selected:p,highlighted:A,renderEntry:n,onSelect:g,onHighlight:I=>d.highlight.emit(I),onVisible:I=>d.setSetVisible(e.id,I)},e.id))}):null});function Ut({set:t,entries:s,canvases:n,Heading:u,headingLevel:o,title:c,language:m,showLabel:l,hidden:r,selected:f,highlighted:d,renderEntry:S,onSelect:L,onHighlight:$,onVisible:T}){const p=dt(),A=c.text?o+1:o,g=M(()=>pt(s),[s]),[k,w]=tt(),C=ht(),N=C?_(g,C.chosen):_(g,m,k),E=s.filter(x=>bt(x,N));return a("section",{className:"clover-annotations-set","aria-labelledby":c.text?`${p}-title`:void 0,"data-set":t.id,children:[a("div",{className:"clover-annotations-set-header",children:[c.text&&a(u,{className:"clover-annotations-title",id:`${p}-title`,...B(c.lang),children:c.text}),N&&!C&&a(gt,{languages:g,chosen:N,onChange:w,nameKey:"annotationsLanguage",part:"clover-annotations"}),a(ft,{hidden:r,onChange:x=>T(!x),of:c.text?`${p}-title`:void 0})]}),a("ol",{className:"clover-annotations-list",children:E.map((x,e)=>a(xt,{entry:x,canvas:n.find(b=>b.id===x.canvasId),index:e,headingLevel:A,language:m,showLabel:l,selected:x.id===f,highlighted:x.id===d,renderEntry:S,onSelect:L,onHighlight:$},x.id))})]})}function Wt(t,s,n){const u=new Map(s.map((c,m)=>[c.id,m])),o=new Map;for(const c of t){const m=V(c.label,n),l=m.text;let r=o.get(l);r||(r={title:m,setIds:[],byCanvas:new Map},o.set(l,r)),r.setIds.push(c.id);for(const f of c.entries){const d=r.byCanvas.get(f.canvasId)??[];d.push(f),r.byCanvas.set(f.canvasId,d)}}return[...o.entries()].map(([c,m])=>({key:c,title:m.title,setIds:m.setIds,canvases:Jt([...m.byCanvas.entries()],u).map(([l,r])=>{var f;return{canvasId:l,label:V((f=s.find(d=>d.id===l))==null?void 0:f.label,n),entries:r}})}))}function Jt(t,s){return t.every(([n])=>s.has(n))?t.sort(([n],[u])=>s.get(n)-s.get(u)):t}function Qt(t,s){const{clover:n,language:u}=z("Annotations"),o=M(()=>{const l=new Set;for(const r of t)for(const f of r.canvases){if(s.has(f.canvasId))continue;const d=Et(f.entries[0].annotation);d&&l.add(d)}return[...l]},[t,s]),[c,m]=tt([]);return X(()=>{let l=true;return Promise.all(o.map(r=>jt(n,r))).then(r=>l&&m(r.filter(f=>!!f))),()=>{l=false}},[n,o]),M(()=>{const l=new Map;for(const r of c){const{canvases:f}=ut(r),d=V(r.label,u);for(const S of f){const L=V(S.label,u);l.set(S.id,{canvas:S,label:f.length>1&&L.text?[d,L]:[d]})}}return{named:o.length>0,of:l}},[c,o,u])}const Xt=ct(function({as:s,className:n,rest:u,sets:o,shown:c,headingLevel:m,language:l,showLabel:r,hiddenSets:f,selected:d,highlighted:S,renderEntry:L,onSelect:$,onHighlight:T,onVisible:p,end:A},g){const k=dt(),w=y(i=>ut(i.manifest).canvases),C=M(()=>Wt(o,w,l),[o,w,l]),N=M(()=>new Map(w.map(i=>[i.id,i])),[w]),E=Qt(C,N),[x,e]=tt({}),b=ht(),I=y(i=>{var h;return(h=i.manifest)==null?void 0:h.label}),P=M(()=>V(I,l),[I,l]),F=w.length>1||E.named,G=Tt(null),nt=()=>{const i=G.current;if(!i||!i.getClientRects().length)return true;const h=Kt(i)??i;return h.matches(":hover")||h.contains(document.activeElement)},St=c.join(`
|
|
2
2
|
`);return X(()=>{const i=G.current;if(!i||!F||nt())return;const h=c.map(D=>i.querySelector(`[data-canvas="${CSS.escape(D)}"]`)).find(Boolean);if(!h)return;const q=h.closest(".clover-annotations-set"),H=(q==null?void 0:q.querySelector("[data-canvas]"))===h;it(H&&q?q:h,"start")},[St]),X(()=>{const i=G.current;if(!i||!d||nt())return;const h=i.querySelector(`[data-entry="${CSS.escape(d)}"]`);h&&it(h,"nearest")},[d]),C.length?a(s,{ref:i=>{G.current=i,typeof g=="function"?g(i):g&&(g.current=i)},className:mt("clover-annotations",n),"data-scope":"all",...u,children:[C.map((i,h)=>{const q=Y(m),H=i.title.text?m+1:m,D=Y(H),wt=i.setIds.every(v=>f.includes(v)),U=pt(i.canvases.flatMap(v=>v.entries)),W=b?_(U,b.chosen):_(U,l,x[i.key]);return a("section",{className:"clover-annotations-set","aria-labelledby":i.title.text?`${k}-${h}`:void 0,children:[a("div",{className:"clover-annotations-set-header",children:[i.title.text&&a(q,{className:"clover-annotations-title",id:`${k}-${h}`,...B(i.title.lang),children:i.title.text}),W&&!b&&a(gt,{languages:U,chosen:W,onChange:v=>e(J=>({...J,[i.key]:v})),nameKey:"annotationsLanguage",part:"clover-annotations"}),a(ft,{hidden:wt,onChange:v=>p(i.setIds,!v),of:i.title.text?`${k}-${h}`:void 0})]}),i.canvases.map((v,J)=>{var at;const et=v.entries.filter(O=>bt(O,W));if(!et.length)return null;const j=E.of.get(v.canvasId),R=j?j.label:E.named&&P.text?w.length>1&&v.label.text?[P,v.label]:[P]:[v.label],Q=F&&!!((at=R[0])!=null&&at.text),It=F&&c.includes(v.canvasId),st=`${k}-${h}-${J}`;return a("section",{className:"clover-annotations-canvas","data-canvas":v.canvasId,"aria-labelledby":Q?st:void 0,"aria-current":It?"true":void 0,children:[Q&&a(D,{className:"clover-annotations-canvas-label",id:st,...B(R.length===1?R[0].lang:void 0),children:R.length===1?R[0].text:R.map((O,K)=>a(lt.Fragment,{children:[K>0&&", ",a("span",{...B(O.lang),children:O.text})]},K))}),a("ol",{className:"clover-annotations-list",children:et.map((O,K)=>a(xt,{entry:O,canvas:N.get(v.canvasId)??(j==null?void 0:j.canvas),index:K,headingLevel:Q?H+1:H,language:l,showLabel:r,selected:O.id===d,highlighted:O.id===S,renderEntry:L,onSelect:$,onHighlight:T},O.id))})]},v.canvasId)})]},i.key)}),A]}):null});function Yt(t,s){const n=t.target.rect?void 0:t.target.svg,u=Bt(Zt,!!n);return M(()=>{var m,l;const o=n?(m=u==null?void 0:u.readSvgShape(n))==null?void 0:m.box:void 0,c=t.target.rect??(o?{x:o.x,y:o.y,w:o.width,h:o.height}:void 0);return!c||!s||t.bodies.some(r=>r.image)?null:Gt(s,c,(l=t.layer)==null?void 0:l.image)},[t,s,n,u])}const Zt=()=>import("./svg-shape-DLY3g7oq.mjs");function xt({entry:t,canvas:s,index:n,headingLevel:u,language:o,showLabel:c,selected:m,highlighted:l,renderEntry:r,onSelect:f,onHighlight:d}){const{hostLanguage:S,t:L,langOf:$}=Z(),T=nn(t,o),p=T.text?T:{text:String(n+1)},A=rt(t.target.t),g=A?{text:L("annotationsShowTime"),lang:$("annotationsShowTime")}:c,k=!g.lang&&!Ot(p.lang,S),w=p.text?`${g.text}: ${p.text}`:g.text,{clover:C}=z("Annotations"),N=Yt(t,s);return a("li",{className:"clover-annotations-entry","data-entry":t.id,"data-selected":m,"data-highlighted":l,onMouseEnter:()=>d(t.id),onMouseLeave:()=>d(null),onFocus:()=>d(t.id),onBlur:()=>d(null),onClick:E=>{E.target.closest("a, button")||f(t.id)},children:[A&&a(_t,{start:A.start,className:"clover-annotations-time"}),a(zt,{className:"clover-annotations-thumbnail",source:N,request:C.request}),a("div",{className:"clover-annotations-body clover-cue-text",children:[r?r(t):a(qt,{bodies:t.bodies,language:o,headingLevel:u}),a(tn,{annotation:t.annotation})]}),a("button",{type:"button",className:"clover-annotations-show","aria-pressed":m,"aria-label":k?w:void 0,style:Mt,onClick:()=>f(t.id),children:!k&&a(ot,{children:[a("span",{...B(g.lang),children:[g.text,p.text&&":"]}),p.text&&a(ot,{children:[" ",a("span",{...B(p.lang),children:p.text})]})]})})]})}function tn({annotation:t}){const{clover:s}=z("Annotations"),{t:n,langOf:u}=Z(),o=M(()=>Vt(t)??Ft(t),[t]);if(!o)return null;const c=n("annotationsOpenLink"),m=u("annotationsOpenLink");return!o.canvasId&&!o.manifestId?a("a",{className:"clover-annotations-link",href:o.id,target:"_blank",rel:"noopener noreferrer",...B(m),children:c}):a("button",{type:"button",className:"clover-annotations-link",...B(m),onClick:l=>{var f;const r=l.currentTarget.closest(".clover-root");Ht(s,o)&&((f=r==null?void 0:r.querySelector(".clover-canvas-viewport"))==null||f.focus({preventScroll:true}))},children:c})}function nn(t,s){const{text:n="",lang:u}=Rt(t.bodies,s);return{text:n.slice(0,120),...u?{lang:u}:{}}}export{xn as Annotations};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Q=Object.defineProperty;var tt=(t,o,e)=>o in t?Q(t,o,{enumerable:true,configurable:true,writable:true,value:e}):t[o]=e;var B=(t,o,e)=>tt(t,typeof o!="symbol"?o+"":o,e);import{a5 as q,aB as ot,a6 as D,w as W,T as et,A as L,y as j,q as N,_ as nt,$ as st,u as I,k as it,aC as rt,r as at,d as Z,l as ct,R as lt}from"./shared-MTsMddHx.mjs";import{a as ht}from"./annotation-name-CYkZopdd.mjs";import{r as ut}from"./link-GEdiEwlR.mjs";import{T as dt}from"./Tip-BbexILXs.mjs";import{b as pt}from"./Camera-Cp5ma-6C.mjs";import"./styles-CZV1nbBQ.mjs";const K=t=>Array.isArray(t)?t.flatMap(K):ot.includes(t==null?void 0:t.type)?K(t.items??[]):t==null?[]:[t],ft=t=>K(t).map(o=>q(o)),gt=(t,o)=>Math.abs(t.end-o.start)<.001,H=(t,o,e)=>t+(o-t)*e;function vt(t){const o=[...t].sort((e,n)=>e.start-n.start);return o.map((e,n)=>{const i=o[n+1];return e.end===1/0&&i?{...e,end:i.start}:e})}function U(t,o){let e=0,n=t.length-1,i=-1;for(;e<=n;){const d=e+n>>1;t[d].start<=o?(i=d,e=d+1):n=d-1}const r=t[i];if(!r||o>=r.end)return null;const c=t[i+1];if(!c||!gt(r,c)||!Number.isFinite(r.end))return r.world;const a=(o-r.start)/(r.end-r.start||1),[h,l]=[r.world,c.world];return{x:H(h.x,l.x,a),y:H(h.y,l.y,a),width:H(h.width,l.width,a),height:H(h.height,l.height,a)}}const G=t=>t.overlays??(t.overlays=new wt(t.host));class wt{constructor(o){B(this,"container");B(this,"overlays",new Map);B(this,"view");const e=document.createElement("div");e.className="clover-canvas-overlays",Object.assign(e.style,{position:"absolute",inset:"0",overflow:"clip",pointerEvents:"none"}),o.appendChild(e),this.container=e}add(o,e){return this.overlays.set(o,e),o.classList.add("clover-canvas-overlay"),Object.assign(o.style,{position:"absolute",top:"0",left:"0",pointerEvents:"auto"}),o.parentElement!==this.container&&this.container.appendChild(o),()=>{this.overlays.delete(o)}}move(o,e){this.overlays.has(o)&&(this.overlays.set(o,e),this.view&&this.position(...this.view,o))}position(o,e,n){this.view=[o,e];const i=o.rotation*180/Math.PI,r=Math.cos(o.rotation)>.9999,c=r?window.devicePixelRatio||1:0,a=h=>c?Math.round(h*c)/c:h;for(const[h,l]of this.overlays){if(n&&h!==n)continue;const d=pt(o,e,{x:l.x+l.width/2,y:l.y+l.height/2}),f=a(d.x-l.width*o.zoom/2),g=a(d.y-l.height*o.zoom/2),p=a(l.width*o.zoom),v=a(l.height*o.zoom);h.style.width=`${p}px`,h.style.height=`${v}px`,h.style.transform=`translate(${f}px, ${g}px)`+(i?` rotate(${i}deg)`:"");const{style:w,dataset:m}=h;if(r){w.setProperty("--clover-overlay-x",`${d.x}px`),w.setProperty("--clover-overlay-top",`${g}px`),w.setProperty("--clover-overlay-bottom",`${g+v}px`);const $=d.y>e.height/2?"above":"below";m.overlayRoom!==$&&(m.overlayRoom=$)}else w.removeProperty("--clover-overlay-x"),w.removeProperty("--clover-overlay-top"),w.removeProperty("--clover-overlay-bottom"),delete m.overlayRoom}}dispose(){this.overlays.clear(),this.container.remove()}}const mt=t=>"start"in t,St=t=>{var o,e;return mt(t)?t.start:(e=(o=t.track)==null?void 0:o[0])==null?void 0:e.start},xt=(t,o)=>!t.track||U(t.track,o)!==null;function $t(t,o){return xt(t,o.currentTime)?false:(o.currentTime=t.track[0].start,true)}function yt(t,o,e){var r,c,a;const n=ft(t==null?void 0:t.target);if(!((r=n[0])!=null&&r.rect)||!((c=n[0])!=null&&c.t))return null;const i=[];for(const h of n){const l=W((a=h.t)==null?void 0:a.replace(/^npt:/,""));if(!h.rect||!l)continue;const{x:d,y:f,w:g,h:p}=h.rect,v=o({x:d,y:f,width:g,height:p},h.id,e);v&&i.push({start:l.start,end:l.end??1/0,world:v})}return i.length?vt(i):null}function X(t,o){const{text:e,lang:n}=at(t,o);return e?{page:{text:e,...n?{lang:n}:{}}}:{}}function Nt(t,o){var n;const e=[];for(const{annotation:i,pageLabel:r,pageId:c}of t){const a=q([i==null?void 0:i.target].flat()[0]),h=W((n=a==null?void 0:a.t)==null?void 0:n.replace(/^npt:/,""));if(!h||a.rect||a.point||a.svg)continue;const{text:l,lang:d}=Y(i,o);e.push({id:i.id,...l?{label:l}:{},...d?{lang:d}:{},...h,...X(r,o),...c?{pageId:c}:{}})}return e}const S=40;function qt(t,o,e=null,n){var r;const i=[];for(const{annotation:c,targetIndex:a,pageLabel:h,pageId:l,place:d}of t){const f=q(c==null?void 0:c.target);if(!f)continue;let g=null,p;const v=yt(c,o,a);if(v){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.rect){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.point){const{x:s,y:u}=f.point;g={x:s-S/2,y:u-S/2,width:S,height:S},p={kind:"point"}}else if(f.svg&&e){const s=e(f.svg);s&&(g=s.box,p={kind:"svg",svg:s})}if(!g)continue;const w=v?v[0].world:o(g,f.id,a);if(!w)continue;const{text:m,lang:$}=Y(c,n),P=ut(c),T=(r=D(c).find(s=>(s==null?void 0:s.type)==="Image"&&/^https?:\/\//i.test(s.id??"")))==null?void 0:r.id;i.push({id:c.id,label:m,...$?{lang:$}:{},world:w,...p?{shape:p}:{},...v?{track:v}:{},...P?{link:P}:{},...T?{image:T}:{},...X(h,n),...l?{pageId:l}:{},...d?{place:d}:{}})}return i}const V=({world:t})=>t.width*t.height,kt=(t,o)=>t.x>=o.x&&t.y>=o.y&&t.x+t.width<=o.x+o.width&&t.y+t.height<=o.y+o.height,y=t=>String(Math.round(t*1e3)/1e3||0);function bt(t,o){var g,p;const e=t.world,n=o.world;if(((g=o.shape)==null?void 0:g.kind)==="point"||n.x>=e.x+e.width||n.x+n.width<=e.x||n.y>=e.y+e.height||n.y+n.height<=e.y)return null;const[i,r]=[e.width,e.height],[c,a]=[n.x-e.x,n.y-e.y],h=`${y(-i/10)} ${y(-r/10)} ${y(i*1.2)} ${y(r*1.2)}`,l=`M${y(-i/10)} ${y(-r/10)}h${y(i*1.2)}v${y(r*1.2)}h${y(-i*1.2)}Z`;let d;if(((p=o.shape)==null?void 0:p.kind)==="svg"){const{box:v,shapes:w}=o.shape.svg,m=w.map(({tag:$,attributes:P})=>`<${$} ${Object.entries(P).map(([T,s])=>`${T}="${s}"`).join(" ")}/>`).join("");d=`<mask id="m"><path fill="#fff" d="${l}"/><svg x="${y(c)}" y="${y(a)}" width="${y(n.width)}" height="${y(n.height)}" viewBox="${v.x} ${v.y} ${Math.max(v.width,1)} ${Math.max(v.height,1)}" preserveAspectRatio="none" overflow="visible"><g fill="#000">${m}</g></svg></mask><path d="${l}" mask="url(#m)"/>`}else d=`<path fill-rule="evenodd" d="${l}M${y(c)} ${y(a)}h${y(n.width)}v${y(n.height)}h${y(-n.width)}Z"/>`;const f=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${h}" preserveAspectRatio="none">${d}</svg>`;return`url("data:image/svg+xml,${encodeURIComponent(f)}")`}const Kt=({renderer:t,placed:o,sceneVersion:e,active:n,selected:i,onActivate:r,onSelect:c,onFollow:a,media:h})=>{const l=et(()=>{const s=new Map;return[...o].sort((u,k)=>V(k)-V(u)).forEach((u,k)=>s.set(u,k)),s},[o]),d=o.find(s=>s.id===n),f=L(null);j(()=>{const s=o.find(u=>u.id===i&&u.track);i||(f.current=null),!(!s||!h||f.current===i)&&(f.current=i,$t(s,h))},[o,i,h]);const g=s=>{const u=l.get(s)??0;return d?s===d?o.length:u>(l.get(d)??0)&&!s.track&&!d.track&&kt(s.world,d.world)?o.length+1+u:u:u},p=L(new Map),v=L(new Map),w=L(new WeakMap),m=L({placed:o,current:d,depthOf:g});m.current={placed:o,current:d,depthOf:g};const $=N(s=>{const{placed:u,current:k,depthOf:R}=m.current,O=M=>v.current.get(M.id),x=k&&O(k)!==null?k:void 0,b=M=>{const A=p.current.get(M.id);if(!A)return;const F=O(M),C=x&&M!==x&&F!==null&&R(M)<u.length?bt({...M,world:F??M.world},{...x,world:O(x)??x.world}):null;(w.current.get(A)??"")!==(C??"")&&(w.current.set(A,C??""),C?A.style.setProperty("--clover-annotation-mask",C):A.style.removeProperty("--clover-annotation-mask"))};s&&s!==k?b(s):u.forEach(b)},[]);nt(()=>$());const P=N((s,u)=>{u?p.current.set(s,u):p.current.delete(s)},[]),T=N((s,u)=>{v.current.set(s.id,u),$(s)},[$]);return st(I(it,{children:o.map((s,u)=>I(Tt,{entry:s,name:s.label??String(u+1),lang:s.label?s.lang:void 0,depth:g(s),register:P,onMove:T,renderer:t,active:n===s.id,selected:i===s.id,onActivate:r,onSelect:c,onFollow:a,media:h},`${s.id}|${e}`))}),G(t).container)};let Mt;const _=()=>Mt??(Mt=import("./panClearOfControls-ac9uf-Qs.mjs")),Tt=({entry:t,name:o,lang:e,depth:n,register:i,onMove:r,renderer:c,active:a,selected:h,onActivate:l,onSelect:d,onFollow:f,media:g})=>{var A,F,C;const[p,v]=Z(null),{id:w,place:m}=t,$=m&&`${m.index} / ${m.total}`,P=N(E=>{v(E),i(w,E)},[w,i]),{x:T,y:s,width:u,height:k}=t.world;j(()=>{if(!p)return;const E=G(c).add(p,{x:T,y:s,width:u,height:k});return c.invalidate(),E},[p,c,T,s,u,k]);const R=Et(p,t.track,c,g,()=>l(null),E=>r(t,E)),{link:O}=t,x=O&&!O.canvasId&&!O.manifestId?O.id:void 0,b=O&&!x&&f?()=>f(t):void 0;return I(x?"a":"button",{ref:P,...x?{href:x,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},id:t.id,className:"clover-canvas-annotation",hidden:!R,"data-active":a?"true":"false","data-shape":((A=t.shape)==null?void 0:A.kind)??"rect","data-track":t.track?"":void 0,"data-link":x||b?"true":void 0,"aria-label":$?`${o} ${$}`:o,"aria-current":h?"true":void 0,...ct(e),style:{"--clover-annotation-depth":n},onMouseEnter:()=>l(t.id),onMouseLeave:()=>l(null),onFocus:()=>{l(t.id),_()},onKeyUp:E=>{if(E.key!=="Tab")return;const z=E.currentTarget;_().then(({panClearOfControls:J})=>{document.activeElement===z&&J(c,z)})},onBlur:()=>l(null),onKeyDown:At,onClick:E=>{E.stopPropagation(),!x&&(b?b():d(t))},children:[((F=t.shape)==null?void 0:F.kind)==="point"&&I("span",{className:"clover-canvas-annotation-point","aria-hidden":"true"}),((C=t.shape)==null?void 0:C.kind)==="svg"&&I(Ot,{svg:t.shape.svg}),I(dt,{label:o,scrolls:true,image:t.image,after:$})]})};function Et(t,o,e,n,i,r){const c=!!o&&n!==void 0,[a,h]=Z(()=>!c||(n?U(o,n.currentTime)!==null:false)),l=L(i);l.current=i;const d=L(r);return d.current=r,j(()=>{if(!o||n===void 0){h(true);return}if(!n){h(false);return}let f;const g=x=>{var A,F,C;const b=U(o,x);b&&t&&((A=e.overlays)==null||A.move(t,b)),d.current(b);const M=b!==null;if(M!==f){if(f=M,!M&&t){const E=t.matches(":hover");t.contains(document.activeElement)?(C=(F=e.overlays)==null?void 0:F.container.parentElement)==null||C.focus({preventScroll:true}):E&&l.current()}h(M)}},p=n,v=()=>typeof p.requestVideoFrameCallback=="function"&&p.videoWidth>0;let w=0,m=0;const $=(x,{mediaTime:b})=>{g(b),m=p.requestVideoFrameCallback($)},P=()=>{g(n.currentTime),w=requestAnimationFrame(P)},T=()=>{cancelAnimationFrame(w),m&&p.cancelVideoFrameCallback(m),w=m=0},s=()=>{T(),v()?m=p.requestVideoFrameCallback($):w=requestAnimationFrame(P)},u=()=>g(n.currentTime),k=()=>n.paused&&u(),R=()=>{T(),u()},O=[["play",s],["pause",R],["ended",R],["seeking",u],["seeked",u],["loadeddata",u],["timeupdate",k]];return O.forEach(([x,b])=>n.addEventListener(x,b)),u(),n.paused||s(),()=>{T(),O.forEach(([x,b])=>n.removeEventListener(x,b))}},[t,o,n,e]),a}const Ot=({svg:t})=>{const{x:o,y:e,width:n,height:i}=t.box,r=t.shapes.map(({tag:c,attributes:a},h)=>lt.createElement(c,{key:h,...a,vectorEffect:"non-scaling-stroke"}));return I("svg",{className:"clover-canvas-annotation-shape",viewBox:`${o} ${e} ${Math.max(n,1)} ${Math.max(i,1)}`,preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:[I("g",{children:r}),I("g",{children:r}),I("g",{children:r})]})};function Y(t,o){return ht(rt(t),o)}const Pt={ArrowDown:()=>32,ArrowUp:()=>-32,PageDown:t=>t.clientHeight-32,PageUp:t=>32-t.clientHeight,End:t=>t.scrollHeight,Home:t=>-t.scrollHeight};function At(t){const o=t.currentTarget.querySelector(":scope > .clover-tip"),e=Pt[t.key];if(!o||!e||t.altKey||t.ctrlKey||t.metaKey)return false;const n=e(o);return(n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)<1?false:(t.preventDefault(),o.scrollBy({top:n}),true)}function Ut(t,o){const e=new Map;for(const{annotation:n,targetIndex:i}of t??[]){const r=q([n==null?void 0:n.target].flat()[0]);if(r.rect||r.point||r.svg||r.t||!D(n).some(a=>typeof(a==null?void 0:a.value)=="string"||(a==null?void 0:a.type)==="Image"))continue;const c=(o==null?void 0:o.find(a=>a.id===r.id))??(r.id||o==null?void 0:o[i]);c&&e.set(c.id,[...e.get(c.id)??[],n])}return e}export{Kt as A,$t as g,qt as p,St as s,Nt as t,Ut as w};
|
|
1
|
+
var Q=Object.defineProperty;var tt=(t,o,e)=>o in t?Q(t,o,{enumerable:true,configurable:true,writable:true,value:e}):t[o]=e;var B=(t,o,e)=>tt(t,typeof o!="symbol"?o+"":o,e);import{a9 as q,aF as ot,aa as D,B as G,T as et,A as L,y as j,q as N,_ as nt,$ as st,u as I,k as it,aG as rt,t as at,d as W,l as ct,R as lt}from"./shared-DkY2a89G.mjs";import{a as ht}from"./annotation-name-DbWjhgra.mjs";import{r as ut}from"./link-0lUlTZlw.mjs";import{T as dt}from"./Tip-OCB88zwY.mjs";import{b as pt}from"./Camera-BPyLzZjP.mjs";import"./styles-DkkVOSUQ.mjs";const K=t=>Array.isArray(t)?t.flatMap(K):ot.includes(t==null?void 0:t.type)?K(t.items??[]):t==null?[]:[t],ft=t=>K(t).map(o=>q(o)),gt=(t,o)=>Math.abs(t.end-o.start)<.001,H=(t,o,e)=>t+(o-t)*e;function vt(t){const o=[...t].sort((e,n)=>e.start-n.start);return o.map((e,n)=>{const i=o[n+1];return e.end===1/0&&i?{...e,end:i.start}:e})}function U(t,o){let e=0,n=t.length-1,i=-1;for(;e<=n;){const d=e+n>>1;t[d].start<=o?(i=d,e=d+1):n=d-1}const r=t[i];if(!r||o>=r.end)return null;const c=t[i+1];if(!c||!gt(r,c)||!Number.isFinite(r.end))return r.world;const a=(o-r.start)/(r.end-r.start||1),[h,l]=[r.world,c.world];return{x:H(h.x,l.x,a),y:H(h.y,l.y,a),width:H(h.width,l.width,a),height:H(h.height,l.height,a)}}const Z=t=>t.overlays??(t.overlays=new wt(t.host));class wt{constructor(o){B(this,"container");B(this,"overlays",new Map);B(this,"view");const e=document.createElement("div");e.className="clover-canvas-overlays",Object.assign(e.style,{position:"absolute",inset:"0",overflow:"clip",pointerEvents:"none"}),o.appendChild(e),this.container=e}add(o,e){return this.overlays.set(o,e),o.classList.add("clover-canvas-overlay"),Object.assign(o.style,{position:"absolute",top:"0",left:"0",pointerEvents:"auto"}),o.parentElement!==this.container&&this.container.appendChild(o),()=>{this.overlays.delete(o)}}move(o,e){this.overlays.has(o)&&(this.overlays.set(o,e),this.view&&this.position(...this.view,o))}position(o,e,n){this.view=[o,e];const i=o.rotation*180/Math.PI,r=Math.cos(o.rotation)>.9999,c=r?window.devicePixelRatio||1:0,a=h=>c?Math.round(h*c)/c:h;for(const[h,l]of this.overlays){if(n&&h!==n)continue;const d=pt(o,e,{x:l.x+l.width/2,y:l.y+l.height/2}),f=a(d.x-l.width*o.zoom/2),g=a(d.y-l.height*o.zoom/2),p=a(l.width*o.zoom),v=a(l.height*o.zoom);h.style.width=`${p}px`,h.style.height=`${v}px`,h.style.transform=`translate(${f}px, ${g}px)`+(i?` rotate(${i}deg)`:"");const{style:w,dataset:m}=h;if(r){w.setProperty("--clover-overlay-x",`${d.x}px`),w.setProperty("--clover-overlay-top",`${g}px`),w.setProperty("--clover-overlay-bottom",`${g+v}px`);const $=d.y>e.height/2?"above":"below";m.overlayRoom!==$&&(m.overlayRoom=$)}else w.removeProperty("--clover-overlay-x"),w.removeProperty("--clover-overlay-top"),w.removeProperty("--clover-overlay-bottom"),delete m.overlayRoom}}dispose(){this.overlays.clear(),this.container.remove()}}const mt=t=>"start"in t,St=t=>{var o,e;return mt(t)?t.start:(e=(o=t.track)==null?void 0:o[0])==null?void 0:e.start},xt=(t,o)=>!t.track||U(t.track,o)!==null;function $t(t,o){return xt(t,o.currentTime)?false:(o.currentTime=t.track[0].start,true)}function yt(t,o,e){var r,c,a;const n=ft(t==null?void 0:t.target);if(!((r=n[0])!=null&&r.rect)||!((c=n[0])!=null&&c.t))return null;const i=[];for(const h of n){const l=G((a=h.t)==null?void 0:a.replace(/^npt:/,""));if(!h.rect||!l)continue;const{x:d,y:f,w:g,h:p}=h.rect,v=o({x:d,y:f,width:g,height:p},h.id,e);v&&i.push({start:l.start,end:l.end??1/0,world:v})}return i.length?vt(i):null}function X(t,o){const{text:e,lang:n}=at(t,o);return e?{page:{text:e,...n?{lang:n}:{}}}:{}}function Nt(t,o){var n;const e=[];for(const{annotation:i,pageLabel:r,pageId:c}of t){const a=q([i==null?void 0:i.target].flat()[0]),h=G((n=a==null?void 0:a.t)==null?void 0:n.replace(/^npt:/,""));if(!h||a.rect||a.point||a.svg)continue;const{text:l,lang:d}=Y(i,o);e.push({id:i.id,...l?{label:l}:{},...d?{lang:d}:{},...h,...X(r,o),...c?{pageId:c}:{}})}return e}const S=40;function qt(t,o,e=null,n){var r;const i=[];for(const{annotation:c,targetIndex:a,pageLabel:h,pageId:l,place:d}of t){const f=q(c==null?void 0:c.target);if(!f)continue;let g=null,p;const v=yt(c,o,a);if(v){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.rect){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.point){const{x:s,y:u}=f.point;g={x:s-S/2,y:u-S/2,width:S,height:S},p={kind:"point"}}else if(f.svg&&e){const s=e(f.svg);s&&(g=s.box,p={kind:"svg",svg:s})}if(!g)continue;const w=v?v[0].world:o(g,f.id,a);if(!w)continue;const{text:m,lang:$}=Y(c,n),P=ut(c),T=(r=D(c).find(s=>(s==null?void 0:s.type)==="Image"&&/^https?:\/\//i.test(s.id??"")))==null?void 0:r.id;i.push({id:c.id,label:m,...$?{lang:$}:{},world:w,...p?{shape:p}:{},...v?{track:v}:{},...P?{link:P}:{},...T?{image:T}:{},...X(h,n),...l?{pageId:l}:{},...d?{place:d}:{}})}return i}const V=({world:t})=>t.width*t.height,kt=(t,o)=>t.x>=o.x&&t.y>=o.y&&t.x+t.width<=o.x+o.width&&t.y+t.height<=o.y+o.height,y=t=>String(Math.round(t*1e3)/1e3||0);function bt(t,o){var g,p;const e=t.world,n=o.world;if(((g=o.shape)==null?void 0:g.kind)==="point"||n.x>=e.x+e.width||n.x+n.width<=e.x||n.y>=e.y+e.height||n.y+n.height<=e.y)return null;const[i,r]=[e.width,e.height],[c,a]=[n.x-e.x,n.y-e.y],h=`${y(-i/10)} ${y(-r/10)} ${y(i*1.2)} ${y(r*1.2)}`,l=`M${y(-i/10)} ${y(-r/10)}h${y(i*1.2)}v${y(r*1.2)}h${y(-i*1.2)}Z`;let d;if(((p=o.shape)==null?void 0:p.kind)==="svg"){const{box:v,shapes:w}=o.shape.svg,m=w.map(({tag:$,attributes:P})=>`<${$} ${Object.entries(P).map(([T,s])=>`${T}="${s}"`).join(" ")}/>`).join("");d=`<mask id="m"><path fill="#fff" d="${l}"/><svg x="${y(c)}" y="${y(a)}" width="${y(n.width)}" height="${y(n.height)}" viewBox="${v.x} ${v.y} ${Math.max(v.width,1)} ${Math.max(v.height,1)}" preserveAspectRatio="none" overflow="visible"><g fill="#000">${m}</g></svg></mask><path d="${l}" mask="url(#m)"/>`}else d=`<path fill-rule="evenodd" d="${l}M${y(c)} ${y(a)}h${y(n.width)}v${y(n.height)}h${y(-n.width)}Z"/>`;const f=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${h}" preserveAspectRatio="none">${d}</svg>`;return`url("data:image/svg+xml,${encodeURIComponent(f)}")`}const Kt=({renderer:t,placed:o,sceneVersion:e,active:n,selected:i,onActivate:r,onSelect:c,onFollow:a,media:h})=>{const l=et(()=>{const s=new Map;return[...o].sort((u,k)=>V(k)-V(u)).forEach((u,k)=>s.set(u,k)),s},[o]),d=o.find(s=>s.id===n),f=L(null);j(()=>{const s=o.find(u=>u.id===i&&u.track);i||(f.current=null),!(!s||!h||f.current===i)&&(f.current=i,$t(s,h))},[o,i,h]);const g=s=>{const u=l.get(s)??0;return d?s===d?o.length:u>(l.get(d)??0)&&!s.track&&!d.track&&kt(s.world,d.world)?o.length+1+u:u:u},p=L(new Map),v=L(new Map),w=L(new WeakMap),m=L({placed:o,current:d,depthOf:g});m.current={placed:o,current:d,depthOf:g};const $=N(s=>{const{placed:u,current:k,depthOf:R}=m.current,O=M=>v.current.get(M.id),x=k&&O(k)!==null?k:void 0,b=M=>{const A=p.current.get(M.id);if(!A)return;const C=O(M),F=x&&M!==x&&C!==null&&R(M)<u.length?bt({...M,world:C??M.world},{...x,world:O(x)??x.world}):null;(w.current.get(A)??"")!==(F??"")&&(w.current.set(A,F??""),F?A.style.setProperty("--clover-annotation-mask",F):A.style.removeProperty("--clover-annotation-mask"))};s&&s!==k?b(s):u.forEach(b)},[]);nt(()=>$());const P=N((s,u)=>{u?p.current.set(s,u):p.current.delete(s)},[]),T=N((s,u)=>{v.current.set(s.id,u),$(s)},[$]);return st(I(it,{children:o.map((s,u)=>I(Tt,{entry:s,name:s.label??String(u+1),lang:s.label?s.lang:void 0,depth:g(s),register:P,onMove:T,renderer:t,active:n===s.id,selected:i===s.id,onActivate:r,onSelect:c,onFollow:a,media:h},`${s.id}|${e}`))}),Z(t).container)};let Mt;const _=()=>Mt??(Mt=import("./panClearOfControls-Cn2ZXsZi.mjs")),Tt=({entry:t,name:o,lang:e,depth:n,register:i,onMove:r,renderer:c,active:a,selected:h,onActivate:l,onSelect:d,onFollow:f,media:g})=>{var A,C,F;const[p,v]=W(null),{id:w,place:m}=t,$=m&&`${m.index} / ${m.total}`,P=N(E=>{v(E),i(w,E)},[w,i]),{x:T,y:s,width:u,height:k}=t.world;j(()=>{if(!p)return;const E=Z(c).add(p,{x:T,y:s,width:u,height:k});return c.invalidate(),E},[p,c,T,s,u,k]);const R=Et(p,t.track,c,g,()=>l(null),E=>r(t,E)),{link:O}=t,x=O&&!O.canvasId&&!O.manifestId?O.id:void 0,b=O&&!x&&f?()=>f(t):void 0;return I(x?"a":"button",{ref:P,...x?{href:x,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},id:t.id,className:"clover-canvas-annotation",hidden:!R,"data-active":a?"true":"false","data-shape":((A=t.shape)==null?void 0:A.kind)??"rect","data-track":t.track?"":void 0,"data-link":x||b?"true":void 0,"aria-label":$?`${o} ${$}`:o,"aria-current":h?"true":void 0,...ct(e),style:{"--clover-annotation-depth":n},onMouseEnter:()=>l(t.id),onMouseLeave:()=>l(null),onFocus:()=>{l(t.id),_()},onKeyUp:E=>{if(E.key!=="Tab")return;const z=E.currentTarget;_().then(({panClearOfControls:J})=>{document.activeElement===z&&J(c,z)})},onBlur:()=>l(null),onKeyDown:At,onClick:E=>{E.stopPropagation(),!x&&(b?b():d(t))},children:[((C=t.shape)==null?void 0:C.kind)==="point"&&I("span",{className:"clover-canvas-annotation-point","aria-hidden":"true"}),((F=t.shape)==null?void 0:F.kind)==="svg"&&I(Ot,{svg:t.shape.svg}),I(dt,{label:o,scrolls:true,image:t.image,after:$})]})};function Et(t,o,e,n,i,r){const c=!!o&&n!==void 0,[a,h]=W(()=>!c||(n?U(o,n.currentTime)!==null:false)),l=L(i);l.current=i;const d=L(r);return d.current=r,j(()=>{if(!o||n===void 0){h(true);return}if(!n){h(false);return}let f;const g=x=>{var A,C,F;const b=U(o,x);b&&t&&((A=e.overlays)==null||A.move(t,b)),d.current(b);const M=b!==null;if(M!==f){if(f=M,!M&&t){const E=t.matches(":hover");t.contains(document.activeElement)?(F=(C=e.overlays)==null?void 0:C.container.parentElement)==null||F.focus({preventScroll:true}):E&&l.current()}h(M)}},p=n,v=()=>typeof p.requestVideoFrameCallback=="function"&&p.videoWidth>0;let w=0,m=0;const $=(x,{mediaTime:b})=>{g(b),m=p.requestVideoFrameCallback($)},P=()=>{g(n.currentTime),w=requestAnimationFrame(P)},T=()=>{cancelAnimationFrame(w),m&&p.cancelVideoFrameCallback(m),w=m=0},s=()=>{T(),v()?m=p.requestVideoFrameCallback($):w=requestAnimationFrame(P)},u=()=>g(n.currentTime),k=()=>n.paused&&u(),R=()=>{T(),u()},O=[["play",s],["pause",R],["ended",R],["seeking",u],["seeked",u],["loadeddata",u],["timeupdate",k]];return O.forEach(([x,b])=>n.addEventListener(x,b)),u(),n.paused||s(),()=>{T(),O.forEach(([x,b])=>n.removeEventListener(x,b))}},[t,o,n,e]),a}const Ot=({svg:t})=>{const{x:o,y:e,width:n,height:i}=t.box,r=t.shapes.map(({tag:c,attributes:a},h)=>lt.createElement(c,{key:h,...a,vectorEffect:"non-scaling-stroke"}));return I("svg",{className:"clover-canvas-annotation-shape",viewBox:`${o} ${e} ${Math.max(n,1)} ${Math.max(i,1)}`,preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:[I("g",{children:r}),I("g",{children:r}),I("g",{children:r})]})};function Y(t,o){return ht(rt(t),o)}const Pt={ArrowDown:()=>32,ArrowUp:()=>-32,PageDown:t=>t.clientHeight-32,PageUp:t=>32-t.clientHeight,End:t=>t.scrollHeight,Home:t=>-t.scrollHeight};function At(t){const o=t.currentTarget.querySelector(":scope > .clover-tip"),e=Pt[t.key];if(!o||!e||t.altKey||t.ctrlKey||t.metaKey)return false;const n=e(o);return(n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)<1?false:(t.preventDefault(),o.scrollBy({top:n}),true)}function Ut(t,o){const e=new Map;for(const{annotation:n,targetIndex:i}of t??[]){const r=q([n==null?void 0:n.target].flat()[0]);if(r.rect||r.point||r.svg||r.t||!D(n).some(a=>typeof(a==null?void 0:a.value)=="string"||(a==null?void 0:a.type)==="Image"))continue;const c=(o==null?void 0:o.find(a=>a.id===r.id))??(r.id||o==null?void 0:o[i]);c&&e.set(c.id,[...e.get(c.id)??[],n])}return e}export{Kt as A,$t as g,qt as p,St as s,Nt as t,Ut as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as g,j as h,T as k,p as B,m as T,c as j,u as e,P as p,z as v}from"./shared-DkY2a89G.mjs";import L from"./Connected-DMXG3imZ.mjs";import{r as R}from"./rendererSurface-BkbGDL_Z.mjs";import{j as w}from"./classnames-DukgfdpI.mjs";import{a as x}from"./hooks-BhtNDs_1.mjs";import{L as c}from"./Loading-YxuKrDAM.mjs";const z=v(()=>import("./Connected-pyd0EBD3.mjs")),N=v(()=>import("./Connected-CBQ6xyhr.mjs"));function F({className:f,style:y,renderers:C,collapseControls:b,onContentStateChange:S,children:r,...n}){var u;const l=g("Body");h(l.clover,S);const o=x(),m=k(()=>B(o),[o]),s=T(C??l.renderers,{canvases:o,bodies:m}),a=s==null?void 0:s.component,i=((u=o.find(({type:t})=>t==="Scene"||t==="Timeline"))==null?void 0:u.type)??"Canvas",d=j(t=>t.status==="loading");return e("div",{"aria-busy":d,className:w("clover-body",f),"data-renderer":a?"custom":i.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...y},children:[a?e(a,{canvases:o,bodies:m,children:r}):i==="Scene"?e(p,{fallback:e(c,{overlay:true}),children:e(N,{...n,children:r})}):i==="Timeline"?e(p,{fallback:e(c,{overlay:true}),children:e(z,{...n,children:r})}):e(L,{...n,collapseControls:b,surface:R,children:r}),d&&e(c,{overlay:true})]})}export{F as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,u as r,l}from"./shared-
|
|
1
|
+
import{a as o,u as r,l}from"./shared-DkY2a89G.mjs";import{j as n}from"./classnames-DukgfdpI.mjs";function c({error:a,className:s}){const{t,langOf:e}=o();return r("div",{className:n("clover-status",s),"data-status":"error",role:"alert",children:[r("p",{...l(e("statusError")),children:t("statusError")}),r("p",{className:"clover-status-detail",lang:"en",children:a.message})]})}export{c as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as t,l as d}from"./shared-
|
|
1
|
+
import{u as t,l as d}from"./shared-DkY2a89G.mjs";import{j as u}from"./classnames-DukgfdpI.mjs";import{T as v}from"./Tip-OCB88zwY.mjs";import"./styles-DkkVOSUQ.mjs";const y=({className:n,id:e,label:o,children:r,onClick:s,expanded:i,controls:p,shortcut:a,lang:l})=>{const c=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return t("button",{id:e,className:u("clover-canvas-button",n),"data-testid":"clover-canvas-button","data-button":c,onClick:s,"aria-expanded":i,"aria-controls":p,"aria-label":o,"aria-keyshortcuts":a==null?void 0:a.keys,...d(l),type:"button",children:[t("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:r}),t(v,{label:o,shortcut:a})]})};export{y as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as f,
|
|
1
|
+
import{d as f,r as l,b as i,c,g as a,s as u,t as h}from"./CanvasView-2Fj9nT06.mjs";function g(t,o){return c(h(o.width/2,o.height/2),a(t.rotation),u(t.zoom),h(-t.x,-t.y))}function m(t,o){return c(h(t.x,t.y),u(1/t.zoom),a(-t.rotation),h(-o.width/2,-o.height/2))}function M(t,o,n){return i(m(t,o),n)}function w(t,o,n){return i(g(t,o),n)}function C(t,o){return f(m(t,o),{x:0,y:0,width:o.width,height:o.height})}function N(t,o,n=0,r=0){const e=f(a(n),t),s=Math.max(1,o.width*(1-r*2)),y=Math.max(1,o.height*(1-r*2)),d=Math.min(s/Math.max(e.width,Number.EPSILON),y/Math.max(e.height,Number.EPSILON)),x=l(t);return{x:x.x,y:x.y,zoom:d,rotation:n}}function P(t,o,n,r,e){const s=i(c(u(1/n),a(-r)),{x:o.x-e.width/2,y:o.y-e.height/2});return{x:t.x-s.x,y:t.y-s.y}}function S(t,o){return t.x===o.x&&t.y===o.y&&t.zoom===o.zoom&&t.rotation===o.rotation}export{P as a,w as b,S as c,N as f,M as s,C as v,g as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var l=Object.defineProperty;var o=(r,t,s)=>t in r?l(r,t,{enumerable:true,configurable:true,writable:true,value:s}):r[t]=s;var i=(r,t,s)=>o(r,typeof t!="symbol"?t+"":t,s);import{h as d,b as g}from"./rendererSurface-
|
|
1
|
+
var l=Object.defineProperty;var o=(r,t,s)=>t in r?l(r,t,{enumerable:true,configurable:true,writable:true,value:s}):r[t]=s;var i=(r,t,s)=>o(r,typeof t!="symbol"?t+"":t,s);import{h as d,b as g}from"./rendererSurface-BkbGDL_Z.mjs";class c{constructor(t,s){i(this,"kind","canvas2d");i(this,"canvas");i(this,"ctx");i(this,"pixelRatio",1);i(this,"drawn",new Set);this.canvas=t,this.ctx=s}static create(t){let s=null;try{s=t.getContext("2d",{alpha:true})}catch{s=null}return!s||typeof s.drawImage!="function"?null:new c(t,s)}resize(t,s,a){this.pixelRatio=a;const e=Math.max(1,Math.round(t*a)),h=Math.max(1,Math.round(s*a));this.canvas.width!==e&&(this.canvas.width=e),this.canvas.height!==h&&(this.canvas.height=h)}begin(){const t=this.ctx;t.setTransform(1,0,0,1,0,0),t.globalAlpha=1,t.clearRect(0,0,this.canvas.width,this.canvas.height),t.imageSmoothingEnabled=true,t.imageSmoothingQuality="high"}draw(t){if(!d(t.source))return"skipped";const s=this.ctx,a=t.transform,e=this.pixelRatio,h=t.crop??{x:0,y:0,width:t.width,height:t.height},n=g(t,e);return s.setTransform(e*a.a,e*a.b,e*a.c,e*a.d,e*a.e,e*a.f),s.globalAlpha=t.opacity,s.drawImage(t.source,h.x,h.y,h.width,h.height,h.x,h.y,h.width+n.x,h.height+n.y),this.drawn.add(t.key),"drawn"}end(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.globalAlpha=1}has(t){return this.drawn.has(t)}release(t){this.drawn.delete(t)}dispose(){this.drawn.clear(),this.canvas.width=0,this.canvas.height=0}}export{c as Canvas2DBackend};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as C,_ as Zt,a as On,d as m,q as ve,y as V,t as Je,f as Xe,u as l,R as _t,k as Jn,a2 as Xn,b as Qn,T as L,a3 as eo,a4 as to,a5 as no,P as Me,z as De,v as oo,l as vn,a6 as ao,a7 as so}from"./shared-DkY2a89G.mjs";import{u as lo,d as Mn,r as io,C as ro,Z as co,e as uo,t as fo,f as ho,g as go,R as bn,h as mo,j as po,E as yo,k as vo,l as bo,m as Co,n as wo,o as xo,B as Io,p as ko,q as Oo}from"./pointer-YQppt0at.mjs";import{P as Mo,a as Bo,I as Po,b as So}from"./glyphs-BFK_hvJJ.mjs";import{B as kt}from"./Button-L8ZMy5lY.mjs";import{S as Z,f as Eo}from"./Tip-OCB88zwY.mjs";import{f as Ro,s as Fo,b as Cn,d as To,p as $o,e as Lo,g as wn,h as zo,i as Ao}from"./layout-Djwu8f4R.mjs";import{u as Do,a as No,h as Vo}from"./useNearViewport-CDbHQUBk.mjs";import{L as Ko}from"./Loading-YxuKrDAM.mjs";import{j as qo}from"./classnames-DukgfdpI.mjs";import{u as Ho}from"./useContainerName-hKQjEt7a.mjs";import{b as jo}from"./imageService-iFElsopt.mjs";import"./styles-DkkVOSUQ.mjs";function Wo(e,n,s){return e.reduce((o,u)=>o+u+s,-s)<=n}function Zo(e,n,s){const o=e.ownerDocument,u=d=>d instanceof HTMLElement&&e.contains(d)&&!d.closest("[hidden]"),a=[o.getElementById(n),o.getElementById(s),...Array.from(e.querySelectorAll("button"))].find(u);a==null||a.focus()}function _o({cluster:e,ids:n,more:s,fits:o,onFits:u}){const a=C(o);a.current=o;const d=C(u);d.current=u;const p=C(new Map),z=C(n);z.current=n;const K=C(null),w=n.join(" ");return Zt(()=>{const B=e.ownerDocument,P=()=>{var be;const _=z.current,A=getComputedStyle(e),J=parseFloat(A.columnGap)||0;let q=e.clientWidth-(parseFloat(A.paddingLeft)||0)-(parseFloat(A.paddingRight)||0),y=0;for(const I of _){const Ce=(be=B.getElementById(I))==null?void 0:be.offsetWidth;Ce&&p.current.set(I,Ce),y=Math.max(y,p.current.get(I)??0)}for(const I of Array.from(e.children))!(I instanceof HTMLElement)||_.includes(I.id)||I.id===s||I.classList.contains("clover-canvas-more")||!I.offsetWidth||getComputedStyle(I).position==="absolute"||(q-=I.offsetWidth+J);const re=Wo(_.map(I=>p.current.get(I)??y),q,J);if(re===a.current)return;const ne=B.activeElement;K.current=ne instanceof HTMLElement&&e.contains(ne)?ne.id:null,a.current=re,d.current(re)};P();const te=new ResizeObserver(()=>P());te.observe(e);const f=new MutationObserver(()=>P());return f.observe(e,{childList:true}),()=>{te.disconnect(),f.disconnect()}},[e,w,s]),Zt(()=>{const B=K.current;if(K.current=null,B===null)return;const P=e.ownerDocument.activeElement;(!P||!e.contains(P)||P.closest("[hidden]"))&&Zo(e,B,s)},[o,e,s]),null}const Uo=()=>import("./AnnotationMenu-BDPec3iI.mjs"),Yo=()=>import("./ChaptersMenu-Bj2EqtVJ.mjs"),Go=()=>import("./ChoiceMenu-ConzybVH.mjs"),Jo=()=>import("./ImageControls-CZO7WoPb.mjs"),xn=2,Xo=new Set(["zoomIn","zoomOut","rotateRight","rotateLeft","reset","fullPage"]),Qo=({renderer:e,instance:n,config:s,controlButtons:o,placeholder:u,placeholderIsMore:a=false,choices:d=[],selections:p={},onSelect:z,annotations:K=[],chapters:w=[],mediaElement:B=null,onChapter:P,request:te,hiddenPages:f,onPageVisibilityChange:_,selectedAnnotation:A=null,onAnnotationSelect:J,onAnnotationActivate:q,captionId:y,captionOpen:re=false,onCaptionToggle:ne,placeId:be,placeOpen:I=false,onPlaceToggle:Ce,language:Qe,fit:Be=true,more:X="auto",children:Mt})=>{var ft,ht,Oe,_e;const{t:E,langOf:R}=On(),[Ne,Pe]=m(false),[Q,oe]=m(false),ce=`annotations-${n}`,et=`${ce}-menu`,Ve=E("informationPanelTabsAnnotations"),Ke=R("informationPanelTabsAnnotations"),ue=ve(i=>{var h;oe(false),q==null||q(null),i&&((h=document.getElementById(ce))==null||h.focus())},[ce,q]),qe=s.annotations&&K.length>0&&J,[de,Bt]=m(false),ee=`chapters-${n}`,tt=`${ee}-menu`,we=w.length>0&&!!P,fe=C(false),nt=C(null);V(()=>{const i=()=>{var h;fe.current=((h=document.activeElement)==null?void 0:h.id)===ee};return document.addEventListener("focusin",i),()=>document.removeEventListener("focusin",i)},[ee]);const O=ve(()=>{var h,ge;if(!fe.current)return;fe.current=false;const i=document.activeElement;i&&i!==document.body||(ge=(h=nt.current)==null?void 0:h.querySelector('.clover-canvas-transport :is([data-button="play"], [data-button="pause"])'))==null||ge.focus()},[]);V(()=>{we||O()},[we,O]),V(()=>()=>O(),[O]);const xe=ve(i=>{var h;Bt(false),i&&((h=document.getElementById(ee))==null||h.focus())},[ee]),U=s.information&&y&&ne,ot=s.map&&be&&Ce,D=`choice-${n}`,Y=d.length===1?Je(d[0].label,Qe):null,at=(Y==null?void 0:Y.text)||E("canvasChoice"),x=Y!=null&&Y.text?Y.lang:R("canvasChoice"),Se=`${D}-menu`,he=(ft=Xe(Uo,!!qe))==null?void 0:ft.default,He=(ht=Xe(Yo,we))==null?void 0:ht.default,st=(Oe=Xe(Go,d.length>0&&!!z))==null?void 0:Oe.default,lt=ve(i=>{var h;Pe(false),i&&((h=document.getElementById(D))==null||h.focus())},[D]),it=lo(),[H,Ee]=m(null);V(()=>{nt.current=(H==null?void 0:H.closest(".clover-canvas"))??null},[H]);const Re=Mn(H),[ae,Ie]=m(false),rt=i=>l(kt,{className:i,id:ce,label:Ve,lang:Ke,onClick:()=>oe(h=>!h),expanded:Q,controls:et,children:l(So,{})},"annotations"),ct=(()=>{const i=[],h=e;return s.zoom&&h&&i.push({key:"zoomIn",id:`zoomIn-${n}`,shortcut:Z.zoomIn,label:E("imageZoomIn"),lang:R("imageZoomIn"),glyph:l(co,{}),onClick:()=>h.zoomBy(xn)},{key:"zoomOut",id:`zoomOut-${n}`,shortcut:Z.zoomOut,label:E("imageZoomOut"),lang:R("imageZoomOut"),glyph:l(uo,{}),onClick:()=>h.zoomBy(1/xn)}),s.fullPage&&it&&i.push({key:"fullPage",id:`fullPage-${n}`,label:E(Re?"imageExitFullScreen":"imageFullScreen"),lang:R(Re?"imageExitFullScreen":"imageFullScreen"),glyph:Re?l(ho,{}):l(go,{}),onClick:ge=>void fo(ge.currentTarget)}),s.rotation&&h&&i.push({key:"rotateRight",id:`rotateRight-${n}`,shortcut:Z.rotateRight,label:E("imageRotateRight"),lang:R("imageRotateRight"),glyph:l(bn,{}),onClick:()=>h.rotateBy(90)},{key:"rotateLeft",id:`rotateLeft-${n}`,shortcut:Z.rotateLeft,label:E("imageRotateLeft"),lang:R("imageRotateLeft"),glyph:l(bn,{}),onClick:()=>h.rotateBy(-90)}),s.reset&&h&&i.push({key:"reset",id:`reset-${n}`,shortcut:Z.reset,label:E("imageResetZoom"),lang:R("imageResetZoom"),glyph:l(mo,{}),onClick:()=>h.home()}),d.length&&i.push({key:"choice",id:D,label:at,lang:x,glyph:l(po,{}),onClick:()=>Pe(ge=>!ge),expanded:Ne,controls:Se}),i})(),G=[...ct.filter(i=>i.key!=="fullPage"),...ct.filter(i=>i.key==="fullPage")].map(i=>({id:i.id,view:Xo.has(i.key),node:io(i,o)})),je=[ot&&{id:`place-${n}`,view:false,node:l(kt,{id:`place-${n}`,label:E("mapLabel"),lang:R("mapLabel"),onClick:Ce,expanded:I,controls:be,children:l(Mo,{})},"place")},we&&{id:ee,view:false,node:l(kt,{id:ee,label:E("playerChapters"),lang:R("playerChapters"),onClick:()=>Bt(i=>!i),expanded:de,controls:tt,children:l(Bo,{})},"chapters")},qe&&{id:ce,view:false,node:rt()},U&&{id:`information-${n}`,view:false,node:l(kt,{id:`information-${n}`,label:E("informationPanelTabsAbout"),lang:R("informationPanelTabsAbout"),onClick:ne,expanded:re,controls:y,children:l(Po,{})},"information")},!!u&&{id:`placeholder-${n}`,view:false,node:l(_t.Fragment,{children:u},"placeholder")}].filter(i=>!!i),ut=je.filter(i=>i.id===`placeholder-${n}`),T=[...G.filter(i=>i.view),...ut],We=[...G.filter(i=>!i.view),...je.filter(i=>!ut.includes(i))],se=[...T,...We],[Fe,St]=m(true),Ze=X==="always"||a,M=(_e=Xe(Jo,Be&&(Ze||!Fe)&&se.some(i=>i.view)))==null?void 0:_e.ImageControls,N=Fe&&!Ze||!M?[]:se.filter(i=>i.view),ke=a&&N.length>0;V(()=>{N.length||Ie(false)},[N.length]);const dt=i=>i.filter(h=>!N.includes(h)&&!(ke&&h.id===`placeholder-${n}`)).map(({node:h})=>h);return l(Jn,{children:[l(ro,{fit:Be,clusterRef:Ee,children:[dt(T),M&&N.length>0&&l(M,{instance:n,open:ke||ae,onOpenChange:Ie,toggle:ke?u:void 0,children:N.map(({node:i})=>i)}),dt(We),Mt]}),Be&&!Ze&&H&&l(_o,{cluster:H,ids:se.map(({id:i})=>i),more:`more-${n}`,fits:Fe,onFits:St}),He&&de&&we&&l(He,{id:tt,triggerId:ee,label:E("playerChapters"),labelLang:R("playerChapters"),chapters:w,element:B,onChapter:P,request:te,onClose:xe}),he&&Q&&qe&&l(he,{id:et,triggerId:ce,label:Ve,labelLang:Ke,annotations:K,hiddenPages:f,onPageVisibilityChange:_,selected:A,onSelect:J,onActivate:i=>q==null?void 0:q(i),onClose:ue}),st&&Ne&&d.length>0&&z&&l(st,{id:Se,triggerId:D,label:at,labelLang:x,language:Qe,choices:d,selections:p,onSelect:z,onClose:lt})]})},ea=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function Ta(e,n){return{a:1,b:0,c:0,d:1,e,f:n}}function $a(e,n=e){return{a:e,b:0,c:0,d:n,e:0,f:0}}function La(e){const n=Math.cos(e),s=Math.sin(e);return{a:n,b:s,c:-s,d:n,e:0,f:0}}function ta(e,n){return{a:e.a*n.a+e.c*n.b,b:e.b*n.a+e.d*n.b,c:e.a*n.c+e.c*n.d,d:e.b*n.c+e.d*n.d,e:e.a*n.e+e.c*n.f+e.e,f:e.b*n.e+e.d*n.f+e.f}}function za(...e){return e.reduce((n,s)=>ta(n,s),ea)}function Aa(e){const n=e.a*e.d-e.b*e.c;if(!n||!Number.isFinite(n))return null;const s=1/n;return{a:e.d*s,b:-e.b*s,c:-e.c*s,d:e.a*s,e:(e.c*e.f-e.d*e.e)*s,f:(e.b*e.e-e.a*e.f)*s}}function Ot(e,n){return{x:e.a*n.x+e.c*n.y+e.e,y:e.b*n.x+e.d*n.y+e.f}}function Da(e){return`matrix(${[e.a,e.b,e.c,e.d,e.e,e.f].map(na).join(",")})`}function Na(e,n,s,o=new Float32Array(9)){const u=2/n,a=-2/s;return o[0]=e.a*u,o[1]=e.b*a,o[2]=0,o[3]=e.c*u,o[4]=e.d*a,o[5]=0,o[6]=e.e*u-1,o[7]=e.f*a+1,o[8]=1,o}function na(e){const n=Math.round(e*1e6)/1e6;return Object.is(n,-0)?"0":String(n)}function Va(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function oa(e){if(!e.length)return null;let n=1/0,s=1/0,o=-1/0,u=-1/0;for(const a of e)n=Math.min(n,a.x),s=Math.min(s,a.y),o=Math.max(o,a.x+a.width),u=Math.max(u,a.y+a.height);return{x:n,y:s,width:o-n,height:u-s}}function Ka(e,n){return e.x<n.x+n.width&&n.x<e.x+e.width&&e.y<n.y+n.height&&n.y<e.y+e.height}function qa(e,n){const s=[Ot(e,{x:n.x,y:n.y}),Ot(e,{x:n.x+n.width,y:n.y}),Ot(e,{x:n.x,y:n.y+n.height}),Ot(e,{x:n.x+n.width,y:n.y+n.height})],o=s.map(p=>p.x),u=s.map(p=>p.y),a=Math.min(...o),d=Math.min(...u);return{x:a,y:d,width:Math.max(...o)-a,height:Math.max(...u)-d}}function Ha(e,n,s){return Math.min(Math.max(e,n),s)}const Wt=e=>!!(e&&"overlays"in e),aa=De(()=>import("./MediaBody-CLtd0bf0.mjs")),sa=()=>import("./AnnotationState-Chs_37Kk.mjs"),la=new Map,ia={menu:[],placed:[],timed:[],hiddenPages:[],setPagesVisible:()=>{},listedCount:0,comments:la,selected:null,select:()=>{},activate:()=>{},release:()=>false,quietlyOpened:null},ra=De(()=>import("./FrameAnimation-BvKiSXcm.mjs")),In=De(()=>import("./PlaceBox-D-Zhe9-U.mjs")),ca=De(()=>import("./Placeholder-DzY5hcbk.mjs")),ua=De(()=>import("./ControlsFade-BNXVTL_Q.mjs")),da=()=>true,fa=De(()=>import("./Placeholder-DzY5hcbk.mjs").then(({PlaceholderToggle:e})=>({default:e}))),kn={zoom:true,fullPage:true,rotation:true,reset:true,annotations:true,information:true,map:true},ha={zoom:false,fullPage:false,rotation:false,reset:false,annotations:false,information:false,map:false},ga={description:"canvasKeysImage",keys:["ArrowLeft ArrowRight ArrowUp ArrowDown",Z.zoomIn.keys,Z.zoomOut.keys,Z.reset.keys,Z.rotateRight.keys,Z.rotateLeft.keys].join(" ")},ma={description:"canvasKeysMedia",keys:[Z.play.keys,"J L",Z.mute.keys].join(" ")},pa={description:"canvasKeysAnnotations",keys:"Escape"},ja=e=>{var s;return!!((s=e.canvases)!=null&&s.length)||Bn(e.body,e.src).length>0?l(yo,{children:l(ya,{...e})}):null},ya=e=>{var cn,un,dn,fn,hn,gn;const{surface:n,manifestId:s,canvases:o,viewingDirection:u,body:a,src:d,isTiledImage:p=false,label:z,partOf:K,language:w,highContrast:B,instanceId:P,className:te,options:f,navigator:_=false,controls:A=true,collapseControls:J="auto",controlButtons:q,annotations:y,onReady:re,onViewportChange:ne,onContentStateChange:be,onMediaElement:I,onCaptionChange:Ce,caption:Qe,onEnded:Be,chapters:X,highlightedChapter:Mt,onChapterHighlight:E,placeholder:R=true,children:Ne}=e,{t:Pe}=On(),Q=C(null),[oe,ce]=m(null),et=vo(oe),Ve=Mn(oe),Ke=bo(oe),ue=Xn(ce),qe=Do(B),de=!!n.controlsVisibility,ee=(n.controlsVisibility??da)(de?oe:null,f==null?void 0:f.hideDelay,Q),[tt,we]=m(false),fe=No(oe),nt=Qn(),[O]=m(()=>P??`clover-canvas-${nt}`),xe=C(null),[U,ot]=m(null),D=Wt(U)?U:null,[Y,at]=m(null),x=A===false?null:A===true?kn:{...kn,...A},[Se,he]=m("loading"),[He,st]=m(false),[lt,it]=m(0),H=C(re),Ee=C(ne),Re=C(f);H.current=re,Ee.current=ne,Re.current=f;const ae=eo(u),Ie=L(()=>Ro(o??[]),[o]),rt=L(()=>Fo(Ie),[Ie]),[Pt,ct]=m({}),G=L(()=>({...rt,...Pt}),[rt,Pt]),je=(t,r)=>ct(g=>({...g,[t]:r})),ut=L(()=>y==null?void 0:y.filter(t=>!t.layer||(G[t.layer.key]??0)===t.layer.item),[y,G]),T=(cn=y==null?void 0:y.find(t=>t.layer&&t.annotation.id===e.selectedAnnotation))==null?void 0:cn.layer;V(()=>{T&&(G[T.key]??0)!==T.item&&je(T.key,T.item)},[T==null?void 0:T.key,T==null?void 0:T.item,e.selectedAnnotation]);const We=!!(x!=null&&x.information),se=!!(y!=null&&y.length),Fe=Xe(sa,se),[St,Ze]=m(null),M=se&&St||ia,N=L(()=>{var g,k;const t=(g=y==null?void 0:y.find($=>$.annotation.id===M.selected))==null?void 0:g.annotation,r=(Array.isArray(t==null?void 0:t.body)?t==null?void 0:t.body:[t==null?void 0:t.body]).find($=>($==null?void 0:$.type)==="Feature");return t&&r?{id:String(t.id),feature:r,name:((k=r.properties)==null?void 0:k.label)??t.label}:null},[y,M.selected]),ke=N?`${N.id}:${e.refind??0}`:null,[dt,ft]=m(null),ht=ke!==null&&dt!==ke,Oe=L(()=>{var $,Ae;const t=(o??[]).map(W=>W.navPlace).filter(Boolean),r=t.length?t:e.navPlace?[e.navPlace]:[];if(!r.length)return null;const g=r.flatMap(W=>(W==null?void 0:W.type)==="FeatureCollection"?W.features??[]:(W==null?void 0:W.type)==="Feature"?[W]:[]);if(!g.length)return null;const k=g.length===1?(Ae=($=g[0])==null?void 0:$.properties)==null?void 0:Ae.label:void 0;return{feature:{type:"FeatureCollection",features:g},name:k??e.label}},[o,e.navPlace,e.label]),_e=`place-box-${O}`,[i,h]=m(false),[ge,Sn]=m(false),gt=C(M);gt.current=M;const mt=ve(()=>gt.current.release(),[]),{comments:Et,listedCount:Ut}=M,Te=L(()=>We?(o??[]).filter(t=>Co(t)||Et.has(t.id)):[],[o,We,Et]),Rt=`caption-${O}`,[En,Yt]=m(false),Ft=En&&Te.length>0,Gt=ve(t=>{var r;Yt(false),t&&((r=document.getElementById(`information-${O}`))==null||r.focus())},[O]),j=L(()=>(o??[]).find(t=>Cn(t).length)??null,[o]),Rn=j?Cn(j):ba,F=L(()=>o!=null&&o.length?To(o,ae,G,{standIns:o.length>1}):null,[o,ae,G]),Fn=L(()=>Bn(a,d,p),[a,d,p]),c=(F==null?void 0:F.media[0])??null,Jt=!de&&(c==null?void 0:c.kind)==="video",Tn=de||Jt,$n=de?ee:tt,Ln=L(()=>{if(o!=null&&o.length)return $o(o,G);const t=(Array.isArray(a)?a:a?[a]:[])[0];return typeof(t==null?void 0:t.type)=="string"?t.type.toLowerCase():d?"image":void 0},[o,G,a,d]),[S,zn]=m(null),pt=C(I);pt.current=I;const An=ve(t=>{var r;zn(t),(r=pt.current)==null||r.call(pt,t)},[]),me=F?F.images:Fn,pe=!!c&&(o==null?void 0:o.length)===1,ye=pe&&(c==null?void 0:c.kind)==="audio",Dn=pe&&(c==null?void 0:c.kind)==="video",$e=(o==null?void 0:o.length)===1&&!c&&!j&&me.length===0,yt=!pe&&!$e&&((un=f==null?void 0:f.gestures)==null?void 0:un.navigable)!==false,le=o?`${s??""}
|
|
2
|
+
${o.map(t=>t.id).join("|")}`:null,Le=L(()=>{if(!o||!R)return[];const t=o.flatMap(r=>{const g=Lo(r),k=Je(r.label,w);return g?[{...g,alt:k.text,lang:k.lang}]:[]});return ae==="right-to-left"||ae==="bottom-to-top"?t.reverse():t},[o,ae,R,w]),[Nn,Xt]=m(false),[Vn,Qt]=m(null),v=!ye&&Le.length>0&&(c?Vn!==le:!Nn),en=(t,{annotations:r=false,fullPage:g=false}={})=>({...t,zoom:false,rotation:false,reset:false,fullPage:g&&t.fullPage,annotations:r&&t.annotations}),Ue=$e&&Ve,tn=_t.Children.count(Ne)>0,Tt=Le.length>0&&!ye&&!c,Ye=x?v?Te.length||tn||Ut||c&&(X!=null&&X.length)?en(x,{annotations:true}):null:pe||$e?Ie.length||Te.length||tn||Ut||c&&(X!=null&&X.length)||Ue&&x.fullPage?en(x,{annotations:true,fullPage:Ue}):null:x:null,$t=_&&!v&&(c?c.kind==="audio"&&!pe&&me.length>0:true),[Lt,Kn]=m(null),ze=c?Lt??c.placement:null,[vt,qn]=m(Ca),zt=L(()=>{const t=(c==null?void 0:c.kind)==="video"&&S&&ze?[...me,{id:c.id,placement:ze,width:ze.width,height:ze.height,media:{element:S}}]:me;return vt.length?[...t,...vt]:t},[me,c,S,ze,vt]),nn=pe&&(c==null?void 0:c.kind)==="video"&&Lt?Lt:F?oa(F.placements):null,Hn=JSON.stringify([me,nn,zt.length!==me.length&&[c==null?void 0:c.id,ze],vt.map(t=>t.id)]),bt=C(null),At=C(false),Dt=()=>{c?Qt(v?le:null):Xt(v),v||mt()},Ct=C(null),jn=t=>{if(S&&!v){S.currentTime=t;return}Ct.current=t,v&&Dt()};V(()=>{!S||Ct.current===null||(S.currentTime=Ct.current,Ct.current=null)},[S]);const Nt=Array.isArray(a)?a[0]:a,b=[z,(dn=o==null?void 0:o[0])==null?void 0:dn.label,Nt==null?void 0:Nt.label].map(t=>Je(t,w)).find(t=>t.text),Wn=L(()=>{const t=Je(K,w);return t.text&&t.text!==(b==null?void 0:b.text)?t:void 0},[K,w,b==null?void 0:b.text]),on=Ho((b==null?void 0:b.text)||Pe("canvasImage"),b?b.lang:ue.langOf("canvasImage"),false,ue.hostLanguage),wt=v?[]:[...yt?[ga]:[],...c?[ma]:[],...se?[pa]:[]],an=`keys-${O}`,Zn=yt&&!v&&!ue.langOf("canvasRoleDescription")?Pe("canvasRoleDescription"):void 0,Vt=!!Ye&&Te.length>0,_n=Vt&&Te.map((t,r)=>Je(t.label,w).text?wo(Rt,r):null).filter(Boolean).join(" ")||void 0,sn=C({canvases:o,scene:F,canvasKey:le});sn.current={canvases:o,scene:F,canvasKey:le};const xt=C(null),Kt=ve(()=>{const{canvases:t,scene:r,canvasKey:g}=sn.current;xt.current=t&&r&&bt.current===g?{key:g,canvases:t,placements:r.placements}:null},[]),Un=!o||((fn=xt.current)==null?void 0:fn.key)===le,Ge=to(()=>{const t=xt.current,r=xe.current;if(!t||s==="loading")return null;const g=S&&S.currentTime>0?S.currentTime:null,k=!g&&r&&Wt(r)?Pn(r.getBounds(),t.canvases,t.placements):null,$=t.canvases.find(Ae=>Ae.id===(k==null?void 0:k.canvasId))??t.canvases[0];return $?so({manifestId:s,canvasId:$.id,type:$.type,region:k&&{x:k.rect.x,y:k.rect.y,w:k.rect.width,h:k.rect.height},time:g}):null},be);V(()=>no(S,Ge),[S,Ge]),V(()=>{const t=Q.current;if(!t)return;const r=n(t,Re.current),g=Wt(r)?r:null;xe.current=r,ot(r),r.setDismiss(mt);const k=r.on("open",()=>{var ie;Ht(false),Kt(),Ge(),he("ready"),it(It=>It+1),g&&((ie=H.current)==null||ie.call(H,va(g,()=>xt.current,It=>{var pn,yn;const mn=gt.current.placed.find(jt=>jt.id===It);return mn?(gt.current.select(mn),(yn=Array.from(((pn=g.overlays)==null?void 0:pn.container.querySelectorAll("[id]"))??[]).find(jt=>jt.id===It))==null||yn.focus({preventScroll:true}),true):false})))}),$=r.on("change",()=>{Ht(false),Kt(),Ge(),he("ready"),it(ie=>ie+1)}),Ae=r.on("error",()=>{r.isOpen||he("error")}),W=r.on("unloadable",ie=>st(!!ie)),Gn=r.on("viewport",()=>{var ie;g&&((ie=Ee.current)==null||ie.call(Ee,g.getBounds())),Ge()});return()=>{k(),$(),Ae(),W(),Gn(),r.dispose(),xe.current=null,ot(null)}},[P,n,mt,Kt]),V(()=>{if(!(!D||!Y))return D.attachNavigator(Y)},[D,Y]),V(()=>{if(!(!U||!$e))return U.setGestures({navigable:false}),()=>U.setGestures({})},[U,$e]);const qt=C(false);V(()=>{var r;if(Ue)return;const t=!document.activeElement||document.activeElement===document.body;qt.current&&t&&((r=Q.current)==null||r.focus()),qt.current=false},[Ue]),V(()=>{const t=xe.current;if(v&&(At.current=true),!t||!fe||v)return;const r=bt.current!==null&&bt.current!==le;(!t.isOpen||r)&&he("loading");const g=pe||At.current&&t.isOpen||r;bt.current=le,At.current=false,t.setImages(zt,{world:nn??void 0,fit:g})},[Hn,P,S,fe,v]);const ln=C(s),[Yn,Ht]=m(false);Zt(()=>{var t;s!==ln.current&&(ln.current=s,(t=xe.current)==null||t.clear(),Ht(true),he("loading"))},[s]);const rn=Se==="loading"&&zt.length>0&&fe&&!v;return l(ao.Provider,{value:ue.hostLanguage,children:l("figure",{"aria-labelledby":_n,className:qo("clover-canvas",te),"data-testid":"clover-canvas","data-status":Se,...Vo(qe),"data-unloadable":He||void 0,"data-has-navigator":$t,"data-fullscreen":et,"data-exit":Ke||void 0,"data-controls":Tn?$n?"visible":"hidden":void 0,"data-media":Ln,"data-recording":c?"":void 0,"data-player":ye?"":void 0,"data-animated":j?"":void 0,"data-navigable":yt,"data-placeholder":Le.length&&!ye?v:void 0,ref:ue.ref,onFocus:t=>{qt.current=Ue&&t.target.id===`fullPage-${O}`},onKeyDown:t=>{if(t.key==="Escape"&&Ft&&!t.defaultPrevented){t.preventDefault(),Gt(false);return}if(t.key==="Escape"&&!t.defaultPrevented&&!t.currentTarget.querySelector(".clover-canvas-menu")&&mt()){t.preventDefault();return}Eo(t,Q.current)},style:{position:"relative",width:"100%",height:"100%",margin:0,overflow:"hidden",isolation:"isolate"},children:[(Ye||$t)&&c&&l("div",{className:"clover-canvas-scrim","aria-hidden":"true"}),Jt&&l(Me,{fallback:null,children:l(ua,{element:oe,hideDelay:f==null?void 0:f.hideDelay,picture:Q,onChange:we})}),l(xo,{hidden:!Ke}),U&&(Ye||Tt)&&l(Qo,{renderer:D,instance:O,config:Ye??ha,controlButtons:q,placeholderIsMore:Tt&&!c,chapters:c?X:void 0,mediaElement:S,onChapter:jn,request:f==null?void 0:f.request,placeholder:Tt&&l(Me,{fallback:null,children:l(fa,{instance:O,media:!!c,active:v,onToggle:Dt,more:!!x&&(x.zoom||x.rotation||x.reset||x.fullPage)})}),fit:!de,more:J,choices:v?[]:Ie,selections:G,onSelect:je,annotations:M.menu,hiddenPages:M.hiddenPages,onPageVisibilityChange:M.setPagesVisible,selectedAnnotation:M.selected,onAnnotationSelect:M.select,onAnnotationActivate:M.activate,captionId:Vt?Rt:void 0,captionOpen:Ft,onCaptionToggle:()=>Yt(t=>!t),placeId:Oe?_e:void 0,placeOpen:i,onPlaceToggle:()=>{Sn(true),h(t=>!t)},language:w,children:Ye&&Ne}),$t&&l("div",{ref:at,className:"clover-canvas-navigator","data-testid":"clover-canvas-navigator","aria-hidden":"true"}),l("div",{ref:Q,className:"clover-canvas-viewport",style:{position:"absolute",inset:0,overflow:"hidden",zIndex:-1},"data-testid":"clover-canvas-viewport",role:se?"group":"img","aria-roledescription":Zn,...on.props,"aria-describedby":wt.length?an:void 0,"aria-keyshortcuts":wt.map(({keys:t})=>t).join(" ")||void 0,"aria-busy":rn,tabIndex:0}),on.node,wt.length>0&&l("span",{id:an,style:oo,children:wt.map(({description:t},r)=>l(_t.Fragment,{children:[r>0&&" ",l("span",{...vn(ue.langOf(t)),children:Pe(t)})]},t))}),l(Io,{kind:"image",shown:He&&!v}),$e&&!v&&(b==null?void 0:b.text)&&l(ko,{text:b.text,lang:b.lang||void 0}),(c==null?void 0:c.kind)==="audio"&&!ye&&me.length===0&&!v&&(b==null?void 0:b.text)&&l("p",{className:"clover-canvas-sound-label","aria-hidden":"true",...vn(b.lang||void 0),children:b.text}),Le.length>0&&!ye&&l(Me,{fallback:null,children:l(ca,{instance:O,stills:Le,vertical:ae==="top-to-bottom"||ae==="bottom-to-top",media:!!c,active:v,lingering:Se==="loading"&&!Yn,onToggle:Dt,request:f==null?void 0:f.request})}),U&&c&&fe&&!v&&l(Me,{fallback:null,children:l(aa,{media:c,request:f==null?void 0:f.request,fillable:Dn,surface:U,instance:O,onElement:An,onFit:Kn,onCaptionChange:Ce,caption:Qe,navigable:yt,fullscreen:pe&&!!(x!=null&&x.fullPage),isFullscreen:Ve,onEnded:Be,chapters:X,highlightedChapter:Mt,onChapterHighlight:E,autoPlay:!ye&&Le.length>0&&M.quietlyOpened!==le,language:w,notes:M.timed,player:ye&&o?{canvas:o[0],title:b,partOf:Wn}:void 0})}),D&&j&&(F==null?void 0:F.frames[wn(j)])&&!v&&l(Me,{fallback:null,children:l(ra,{renderer:D,frames:Rn,byFrame:F.frames[wn(j)],animationKey:j.id,sceneVersion:lt,autoplay:(hn=f==null?void 0:f.animation)==null?void 0:hn.autoplay,loop:(gn=f==null?void 0:f.animation)==null?void 0:gn.loop,onEnded:Be,language:w,duration:Number(j.duration),canvas:j,place:F.placements[o.indexOf(j)],onItems:qn},j.id)}),Fe&&se&&y&&l(Fe.AnnotationState,{given:e,annotations:ut??y,scene:F,renderer:D,sceneVersion:lt,drawn:Un,media:c,mediaElement:S,showPlaceholder:v,canvasKey:le,openImages:Xt,openMedia:Qt,host:Q,onModel:Ze,refind:e.refind??0}),rn&&l(Ko,{overlay:true}),N&&l(Me,{fallback:null,children:l(In,{id:`place-of-${O}`,open:ht,onClose:t=>{var r;ft(ke),t&&((r=document.getElementById(N.id))==null||r.focus())},feature:N.feature,name:N.name,language:w})}),Oe&&ge&&l(Me,{fallback:null,children:l(In,{id:_e,open:i,onClose:t=>{var r;h(false),t&&((r=document.getElementById(`place-${O}`))==null||r.focus())},feature:Oe.feature,name:Oe.name,language:w})}),Vt&&l(Oo,{id:Rt,canvases:Te,comments:Et,open:Ft,onClose:Gt,language:w})]})})};function va(e,n,s){return{fitCanvasRect(o,u,a){const d=n(),p=(d==null?void 0:d.canvases.findIndex(z=>z.id===o))??-1;return!d||p===-1?false:(e.fitBounds(zo(d.canvases[p],d.placements[p],u),a),true)},getCanvasRegion(){const o=n();return o?Pn(e.getBounds(),o.canvases,o.placements):null},get backendKind(){return e.backendKind},get atHome(){return e.isAtHome},fitBounds:(o,u)=>e.fitBounds(o,u),fitItemRect:(o,u,a)=>e.fitItemRect(o,u,a),itemRectToWorld:(o,u)=>e.itemRectToWorld(o,u),getBounds:()=>e.getBounds(),getHomeBounds:()=>e.getHomeBounds(),getCamera:()=>e.getCamera(),home:o=>e.home(o),zoomBy:(o,u,a)=>e.zoomBy(o,u,a),panBy:(o,u,a)=>e.panBy(o,u,a),setRotation:(o,u)=>e.setRotation(o,u),getRotation:()=>e.getRotation(),rotateBy:o=>e.rotateBy(o),worldToScreenPoint:o=>e.worldToScreenPoint(o),screenToWorldPoint:o=>e.screenToWorldPoint(o),on:(o,u)=>e.on(o,u),zoomToAnnotation:s}}const ba=[],Ca=[];function Bn(e,n,s=false){const o=Array.isArray(e)?e:e?[e]:[];return o.length?o.map((a,d)=>{const p=jo(a.service);return!p&&!a.id?null:{id:`${d}:${a.id??p}|${a.region??""}`,service:p,url:a.id,width:a.width,height:a.height,region:a.region}}).filter(a=>a!==null):(Array.isArray(n)?n:n?[n]:[]).filter(Boolean).map((a,d)=>({id:`${d}:${a}`,...s?{service:a}:{url:a}}))}function Pn(e,n,s){let o=null;if(s.forEach((B,P)=>{const te=Math.max(e.x,B.x),f=Math.max(e.y,B.y),_=Math.min(e.x+e.width,B.x+B.width)-te,A=Math.min(e.y+e.height,B.y+B.height)-f;if(_<=0||A<=0)return;const J=_*A;(!o||J>o.area)&&(o={index:P,area:J,clip:{x:te,y:f,width:_,height:A}})}),!o)return null;const{index:u,clip:a}=o,d=n[u],p=s[u],z=Ao(d),K=z.width/p.width,w=z.height/p.height;return{canvasId:d.id,rect:{x:Math.round((a.x-p.x)*K),y:Math.round((a.y-p.y)*w),width:Math.round(a.width*K),height:Math.round(a.height*w)}}}export{ja as C,Na as a,Ot as b,za as c,qa as d,Ka as e,Ha as f,La as g,Wt as h,Aa as i,Da as j,Va as r,$a as s,Ta as t,oa as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c,u as a,t as d,l as p,aG as v,k as m}from"./shared-DkY2a89G.mjs";import{M as f,a as h}from"./Markup-DW75Jx3j.mjs";import{R as u}from"./ReadMore-De_0T7lc.mjs";import{E as b}from"./EntryBodies-77vDudCb.mjs";const T=({summary:s,metadata:n,comments:o,language:r})=>{const{t,langOf:l}=c();return a(m,{children:[d(s,r).text&&a(u,{children:a(f,{as:"p",markup:s,language:r,className:"clover-summary clover-canvas-caption-summary"})}),a(h,{metadata:n,language:r,className:"clover-metadata clover-canvas-caption-metadata"}),o!=null&&o.length?a("div",{className:"clover-canvas-caption-annotations",children:[a("p",{className:"clover-canvas-caption-annotations-label",...p(l("informationPanelTabsAnnotations")),children:t("informationPanelTabsAnnotations")}),a("ul",{children:o.map((i,e)=>a("li",{children:a(b,{bodies:v(i),language:r})},i.id??e))})]}):null]})};export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as k,y,A as N,u as t,ai as T,l as L}from"./shared-DkY2a89G.mjs";import b from"./ControlMenu-D1zkB0qX.mjs";import{c as C,a as D}from"./Transport-DjOYI-fR.mjs";import{u as P}from"./useContainerName-hKQjEt7a.mjs";import{E as w}from"./EntryThumbnail-BxQWKW6e.mjs";const z=({id:c,triggerId:p,label:v,labelLang:f,chapters:s,element:e,onChapter:g,request:E,onClose:n})=>{const i=P(v,f),[h,u]=k(()=>(e==null?void 0:e.currentTime)??0);y(()=>{if(!e)return;const r=()=>u(e.currentTime);return r(),e.addEventListener("timeupdate",r),e.addEventListener("seeked",r),()=>{e.removeEventListener("timeupdate",r),e.removeEventListener("seeked",r)}},[e]);const m=C(s,h),o=N(false),d=r=>{g(s[r].start),u(s[r].start)};return t(b,{"data-testid":"clover-canvas-chapters",id:c,onClose:n,triggerId:p,children:[t("fieldset",{className:"clover-canvas-menu-group",...i.props,children:s.map((r,a)=>t("label",{className:"clover-canvas-menu-item clover-canvas-chapters-item",onPointerDown:()=>{o.current=true},children:[t("input",{type:"radio",name:c,checked:a===m,onChange:()=>d(a),onClick:()=>{o.current&&n(true)},onKeyDown:l=>{o.current=false,l.key==="Enter"&&(l.preventDefault(),d(a),n(true))}}),t("span",{className:"clover-cue-time",children:T(r.start)})," ",t("span",{className:"clover-cue-text",...L(r.lang||void 0),children:r.label}),a===m&&t(w,{source:D(r),request:E,large:true})]},r.id??a))}),i.node]})};export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o}from"./shared-
|
|
1
|
+
import{u as o}from"./shared-DkY2a89G.mjs";import{j as i}from"./classnames-DukgfdpI.mjs";import"./styles-DkkVOSUQ.mjs";function s({open:e=false,className:r}){return o("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",className:i("clover-chevron",r),"data-open":e||void 0,children:o("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export{s as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as r,u as a,l as v}from"./shared-DkY2a89G.mjs";import x from"./ControlMenu-D1zkB0qX.mjs";import{m as C}from"./layout-Djwu8f4R.mjs";import{u as z}from"./useContainerName-hKQjEt7a.mjs";import"./styles-DkkVOSUQ.mjs";const P=({id:m,triggerId:u,label:b,labelLang:g,choices:i,selections:h,onSelect:y,onClose:f,language:s})=>{const d=z(b,g),N=i.some(e=>!r(e.label,s).text);return a(x,{"data-testid":"clover-canvas-choice",id:m,onClose:f,triggerId:u,children:[N&&d.node,i.map((e,k)=>{const t=r(e.label,s);return a("fieldset",{...t.text?{}:d.props,className:"clover-canvas-menu-group",children:[t.text&&a("legend",{className:"clover-canvas-menu-legend",...v(t.lang),children:t.text}),e.items.map((l,n)=>{const o=r(l.label,s),c=o.text||(l.image?"":String(n+1)),p=!C(l);return a("label",{className:"clover-canvas-menu-item","data-disabled":p||void 0,children:[a("input",{type:"radio",name:`${m}-${k}`,"aria-label":c?void 0:String(n+1),checked:(h[e.key]??0)===n,disabled:p,onChange:()=>y(e.key,n)}),l.image&&a("img",{alt:"",className:"clover-canvas-menu-image",decoding:"async",loading:"lazy",src:l.image}),c&&a("span",{...v(o.text?o.lang:void 0),children:c})]},n)})]},e.key)})]})};export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as N,e as $,a as j,b as A,c as u,I as H,y as S,u as o,l as T}from"./shared-DkY2a89G.mjs";import{I as q}from"./Items-CudZ4Lnb.mjs";import{L as w}from"./Label-f07N5Fld.mjs";import{Summary as x,Id as D,Homepage as L}from"./Primitives-C6VJXxZD.mjs";import{j as O}from"./classnames-DukgfdpI.mjs";import{t as p}from"./heading-Cjt0f-Eu.mjs";import"./styles-DkkVOSUQ.mjs";const J=N(function({headingLevel:r=3,className:v,...b},d){const{clover:n}=$("Collection"),{t:f,langOf:g}=j(),i=A(),a=u(e=>e.collection),l=u(e=>H(e.manifest));S(()=>{!a&&(l!=null&&l.id)&&n.openCollection(l.id)},[n,a,l]);const t=a??l;if(!t)return null;const s=t.homepage,c=p(r,`${i}-label`),m=(e,C)=>{const{as:h,title:y,group:I}=p(r,`${i}-${e}`);return o("section",{className:"clover-about-section",...I,children:[o(h,{className:"clover-about-heading",...T(g(e)),...y,children:f(e)}),C]})};return o("div",{ref:d,className:O("clover-about clover-collection",v),...t.label?c.group:null,...b,children:[o(w,{as:c.as,label:t.label,className:"clover-collection-title clover-title",...c.title}),o(x,{value:t.summary,className:"clover-about-summary"}),o(q,{of:"members",layout:"list"}),Array.isArray(s)&&s.length>0&&m("aboutHomepage",o(L,{value:s})),m("aboutCollection",o(D,{value:t.id}))]})});export{J as Collection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as C,a as k,e as I,c as v,b as K,d as L,y as w,A as b,
|
|
1
|
+
import{D as C,a as k,e as I,c as v,b as K,d as L,y as w,A as b,t as h,u as r,l as S}from"./shared-DkY2a89G.mjs";import{i as N}from"./items-BnEnc5ot.mjs";import{j as U}from"./classnames-DukgfdpI.mjs";import"./styles-DkkVOSUQ.mjs";const j=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),B=100,z=C(function({onChange:s,className:y,...A},E){const{t:P,langOf:D}=k(),{clover:T,language:u}=I("CollectionSelect"),t=v(e=>e.collection),n=v(e=>{var l;return((l=e.manifest)==null?void 0:l.id)??""}),f=K(),[c,i]=L(null);w(()=>i(null),[n,t]);const d=b(-1/0),o=b(null);w(()=>{o.current=null},[n,t]);const p=e=>{!e||e===n||e===o.current||(o.current=e,s==null||s(e),T.goToManifest(e).finally(()=>{o.current===e&&(o.current=null)}))},m=()=>c===null||c===n||c===o.current?false:(i(null),true),g=N(t);if(g.length<2)return null;const a=h(t==null?void 0:t.label,u);return r("div",{ref:E,className:U("clover-collection-select",y),...A,children:[r("label",{htmlFor:`${f}-select`,className:"clover-collection-select-label",...S(a.text?a.lang:D("collectionLabel")),children:a.text||P("collectionLabel")}),r("select",{id:`${f}-select`,className:"clover-collection-select-control",value:c??n,onKeyDown:e=>{const{key:l}=e;l==="Enter"?p(c):l==="Escape"?m()&&e.preventDefault():(j.has(l)||l.length===1&&!e.ctrlKey&&!e.metaKey)&&(d.current=performance.now())},onBlur:m,onChange:e=>{const l=e.target.value;i(l),performance.now()-d.current>B&&p(l)},children:g.map(e=>{const l=h(e.label,u);return r("option",{value:e.id,...S(l.text?l.lang:void 0),children:l.text||e.id},e.id)})})]})});export{z as CollectionSelect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as v,c as u,y as S,T as b,u as C}from"./shared-
|
|
1
|
+
import{e as v,c as u,y as S,T as b,u as C}from"./shared-DkY2a89G.mjs";import{S as q}from"./SceneView-DA7Yg20p.mjs";import{a as w,e as x}from"./hooks-BhtNDs_1.mjs";function M({label:i,language:d,options:t,...f}){const r=v("Scene"),{clover:a}=r,e=w().find(n=>n.type==="Scene"),s=x(),g=u(n=>{var o;return n.status==="loading"?"loading":((o=n.manifest)==null?void 0:o.id)??""}),c=u(n=>n.target);S(()=>{c&&e&&c.canvasId===e.id&&a.consumeTarget()},[c,e,a]);const l=(t==null?void 0:t.request)??a.request,m=b(()=>({...t,request:l}),[t,l]);return e?C(q,{...f,scene:e,manifestId:g,label:i??e.label??(s==null?void 0:s.label),language:d??r.language,options:m}):null}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as ve,C as q,c as h,A as l,d as me,y as O,T as R,
|
|
1
|
+
import{e as ve,C as q,c as h,A as l,d as me,y as O,T as R,N as be,q as f,am as d,u as Se,an as we,ao as Ae,ap as Ie,o as Ce}from"./shared-DkY2a89G.mjs";import{C as Le}from"./CanvasView-2Fj9nT06.mjs";import{u as ke,a as xe}from"./fromManifest-DrAmY1lB.mjs";import{j as z,k as ye}from"./layout-Djwu8f4R.mjs";import{s as Pe}from"./show-link-DgLJzG7k.mjs";import{a as qe,d as Oe,e as Re,f as Te}from"./hooks-BhtNDs_1.mjs";const Ue=({options:i,onReady:T,onViewportChange:v,onMediaElement:m,onCaptionChange:A,caption:j,onEnded:b,placeholder:F=true,label:G,partOf:J,language:Q,annotations:I,chapters:W,...p})=>{const C=ve("Canvas"),{clover:t}=C,X=q(t.captions.subscribe,t.captions.get,t.captions.get),Y=j??X,B=Q??C.language,c=qe(),{direction:Z}=Oe(),n=Re(),o=Te(),_=h(e=>{var a;return e.status==="loading"?"loading":((a=e.manifest)==null?void 0:a.id)??""}),S=h(e=>e.target),D=h(e=>we(e.manifest,e.addedSets,e.search.set,e.regions)),E=h(e=>Ie(e.manifest,e.addedSets,e.hiddenSets,e.shownSets)),ee=h(e=>Ce(e.manifest,e.addedSets,e.hiddenSets,e.shownSets)),L=h(e=>e.annotationId),H=l(L);H.current=L;const[te,ae]=me(0);O(()=>t.found.subscribe(e=>{e&&e===H.current&&ae(a=>a+1)}),[t]);const ne=q(t.highlight.subscribe,t.highlight.get,t.highlight.get),se=q(t.chapter.subscribe,t.chapter.get,t.chapter.get),u=c.map(e=>e.id).join("|"),ce=R(()=>{if(I)return I;const e=c.map(a=>a.id);return D.flatMap(a=>a.entries.filter(s=>e.includes(s.canvasId)).map(s=>({annotation:s.annotation,targetIndex:e.indexOf(s.canvasId),pageId:a.id,...a.label?{pageLabel:a.label}:{},...s.place?{place:s.place}:{},...s.layer?{layer:{key:s.layer.key,item:s.layer.item}}:{}})))},[I,D,c]),ie=S?(e=>!!e&&c.some(a=>a.id===e))(S.canvasId):false,M=l(null);ie&&(M.current=u);const oe=F&&M.current!==u,k=l(null),x=l(null),y=R(()=>c.some(e=>z(e).length>0),[c]),g=y?c.find(e=>z(e).length>0):void 0,re=ke(n,g,B,Ae),K=l(y);K.current=y;const P=j===void 0?C.language:void 0,le=g==null?void 0:g.id;O(()=>{if(!P||!g)return;const e=ye(g).find(a=>a.language&&be(a.language,P));e&&t.captions.get()!==e.id&&t.captions.emit(e.id)},[P,le,t]);const r=f(()=>{const e=t.store.get().target;!e||!t.store.get().canvasId||xe(e,k.current,x.current,K.current)&&t.consumeTarget()},[t]),N=l(u);O(()=>{N.current!==u&&(N.current=u,x.current=null),S&&r()},[S,u,r]);const w=l(T);w.current=T;const de=f(e=>{var a;k.current=e,e.on("change",r),r(),(a=w.current)==null||a.call(w,e)},[r]),ue=f(e=>{var s;const a=(s=k.current)==null?void 0:s.getCanvasRegion();t.viewport.emit(a?{canvasId:a.canvasId,region:{x:a.rect.x,y:a.rect.y,w:a.rect.width,h:a.rect.height}}:null),v==null||v(e)},[t,v]),ge=f(e=>{x.current=e,t.media.emit(e),e&&r(),m==null||m(e)},[t,r,m]),he=f(()=>{b==null||b(),(d(n,"auto-advance")||d(o,"auto-advance"))&&t.next({autoplay:true,wrap:d(n,"repeat")})},[t,n,o,b]),fe=f(e=>void Pe(t,e),[t]),U=(i==null?void 0:i.request)??t.request,V=d(o,"auto-advance")||d(n,"auto-advance"),$=d(o,"repeat")||d(n,"repeat"),pe=R(()=>({...i,request:U,animation:(i==null?void 0:i.animation)??{autoplay:V,loop:$}}),[i,U,V,$]);return c.length?Se(Le,{...p,manifestId:_,navPlace:n==null?void 0:n.navPlace,canvases:c,viewingDirection:Z,language:B,label:G??(o==null?void 0:o.label)??(n==null?void 0:n.label),partOf:J??(n==null?void 0:n.label),options:pe,placeholder:oe,onReady:de,onViewportChange:ue,onMediaElement:ge,caption:Y,onCaptionChange:e=>{t.captions.emit((e==null?void 0:e.id)??null),A==null||A(e)},onEnded:he,annotations:ce,hiddenPages:ee,unlistedPages:E,onPageVisibilityChange:(e,a)=>e.forEach(s=>t.setSetVisible(s,a)),chapters:W??re,highlightedChapter:se,onChapterHighlight:e=>t.chapter.emit(e),selectedAnnotation:L,refind:te,highlightedAnnotation:ne,onAnnotationSelect:e=>t.selectAnnotation(e),onAnnotationLink:p.onAnnotationLink??fe,onAnnotationActive:e=>{var a;t.highlight.emit(e),(a=p.onAnnotationActive)==null||a.call(p,e)}}):null};export{Ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o}from"./shared-
|
|
1
|
+
import{u as o}from"./shared-DkY2a89G.mjs";import{p as a}from"./playerSurface-DG1XipTq.mjs";import n from"./Connected-DMXG3imZ.mjs";import{j as t}from"./classnames-DukgfdpI.mjs";import{a as m}from"./hooks-BhtNDs_1.mjs";function v({className:e,...r}){return m().some(i=>i.type==="Timeline")?o(n,{...r,className:t("clover-timeline",e),navigator:false,surface:a}):null}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as W,a as X,e as Y,c as $,
|
|
1
|
+
import{D as W,a as X,e as Y,c as $,J as Z,C as O,d as N,b as _,T as tt,A as et,y as B,u as o,t as rt,l as k,k as st,v as nt,K as j,E as at,L as A}from"./shared-DkY2a89G.mjs";import{imageSource as it}from"./thumbnail-DecrVnpj.mjs";import{j as ot}from"./classnames-DukgfdpI.mjs";import{C as ct}from"./Chevron-Cyr_cc9X.mjs";import{E as lt}from"./EntryThumbnail-BxQWKW6e.mjs";import{S as ut}from"./Steps-nlSCzbDQ.mjs";import{C as dt}from"./Cue-CUGmPS3k.mjs";import{u as mt}from"./useContainerName-hKQjEt7a.mjs";import"./styles-DkkVOSUQ.mjs";const Nt=W(function({as:d="nav",className:n,...u},h){const{t:p,langOf:c}=X(),{clover:s,language:F}=Y("Contents"),x=mt(p("informationPanelTabsContents"),c("informationPanelTabsContents"),u["aria-label"]!==void 0||u["aria-labelledby"]!==void 0),f=$(e=>Z(e.manifest)),T=$(e=>e.canvasId),z=$(e=>e.annotationId),S=O(s.media.subscribe,s.media.get,s.media.get),[D,w]=N(null),v=gt(f,T,S,D),H=O(s.chapter.subscribe,s.chapter.get,s.chapter.get),J=_(),C=tt(()=>pt(f,v),[f,v]),[K,L]=N(()=>new Map),M=et(new Set);B(()=>{const e=[...C].filter(r=>!M.current.has(r));M.current=C,L(r=>{if(!e.some(t=>r.has(t)))return r;const i=new Map(r);return e.forEach(t=>i.delete(t)),i})},[C]);const[b,U]=N();if(!f.length)return null;const G=e=>K.get(e.id)??C.has(e.id),P=(e,r)=>{var m,l;const i=(m=e.parts)==null?void 0:m[r];if(!i)return;U({node:e.id,index:r}),w(e.id);const t=A(e.id,r);i.region&&((l=s.store.get().regions)!=null&&l.entries.some(a=>a.id===t))?s.selectAnnotation(t):s.goTo(i.canvasId,i.region?{region:i.region}:{})},Q=e=>{if(e.canvasId){if(w(e.id),e.parts){P(e,0);return}if(e.canvasId===T&&e.time&&S){at(S,e.time.start);return}s.goTo(e.canvasId,{...e.time?{time:e.time.start,autoplay:true}:{},...e.region?{region:e.region}:{}})}},R=(e,r)=>{var l;const i=r.findIndex((a,y)=>!!a.region&&A(e.id,y)===z),t=(b==null?void 0:b.node)===e.id&&((l=r[b.index])==null?void 0:l.canvasId)===T?b.index:-1,m=i>=0?i:t>=0?t:r.findIndex(a=>a.canvasId===T);return{position:m,total:r.length,step:a=>P(e,m+a)}},q=(e,r,i=false)=>o("ol",{className:"clover-contents-list",id:r,hidden:i,children:e.map((t,m)=>{const l=rt(t.label,F),a=r?`${r}-${m}`:`${J}-${m}`,y=t.children.length>0,I=y&&G(t),E=t.id===v?it(t.thumbnail):null;return o("li",{className:"clover-contents-item",children:[o("div",{className:"clover-contents-row","data-current":t.id===v?"true":void 0,children:[o("button",{type:"button",id:`${a}-entry`,className:"clover-contents-button","data-trail":C.has(t.id)?"true":void 0,"aria-current":t.id===v?"true":void 0,"data-highlighted":t.id===H?"true":void 0,disabled:!t.canvasId,onMouseEnter:()=>s.chapter.emit(t.id),onMouseLeave:()=>s.chapter.emit(null),onFocus:()=>s.chapter.emit(t.id),onBlur:()=>s.chapter.emit(null),"data-timed":t.time?"true":void 0,"data-pictured":E?"true":void 0,...k(l.text&&!t.time&&!E?l.lang:void 0),onClick:()=>Q(t),children:t.time||E?o(st,{children:[t.time&&o(dt,{start:t.time.start,className:"clover-contents-time"}),o("span",{className:"clover-cue-text",...k(l.text?l.lang:void 0),children:l.text||t.id}),o(lt,{source:E,request:s.request,large:true})]}):l.text||t.id}),t.id===v&&t.parts&&t.parts.length>1&&o(ut,{className:"clover-contents-steps",steps:R(t,t.parts)}),y&&o("button",{type:"button",className:"clover-contents-toggle","aria-expanded":I,"aria-controls":`${a}-list`,"aria-labelledby":`${a}-toggle ${a}-entry`,onClick:()=>L(V=>new Map(V).set(t.id,!I)),children:[o("span",{id:`${a}-toggle`,style:nt,...k(c("contentsSectionsIn")),children:p("contentsSectionsIn")}),o(ct,{open:I,className:"clover-contents-chevron"})]})]}),y&&q(t.children,`${a}-list`,!I)]},t.id)})});return o(d,{ref:h,...x.props,className:ot("clover-contents",n),...u,children:[x.node,q(f)]})});function pt(g,d){const n=new Set;if(!d)return n;const u=(h,p)=>h.some(c=>c.id===d?(p.forEach(s=>n.add(s)),true):u(c.children,[...p,c.id]));return u(g,[]),n}function gt(g,d,n,u){const[h,p]=N(()=>j(g,d,void 0,u));return B(()=>{const c=()=>p(j(g,d,n==null?void 0:n.currentTime,u));if(c(),!!n)return n.addEventListener("timeupdate",c),n.addEventListener("seeked",c),()=>{n.removeEventListener("timeupdate",c),n.removeEventListener("seeked",c)}},[g,d,n,u]),h}export{Nt as Contents};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as w,ac as b,_ as h,y as T,u as k}from"./shared-DkY2a89G.mjs";import{j as x}from"./classnames-DukgfdpI.mjs";import"./styles-DkkVOSUQ.mjs";const L=({id:a,triggerId:c,onClose:n,"data-testid":s,className:y,holds:e,inside:l=false,children:g})=>{const u=w(null);return b(true,()=>n(false)),h(()=>{const t=u.current;t&&l&&S(t)},[l]),T(()=>{const t=u.current,i=(t==null?void 0:t.querySelector('input[type="radio"]:checked'))??(t==null?void 0:t.querySelector('input[type="radio"]:not(:disabled)'))??(t==null?void 0:t.querySelector("input"))??(t==null?void 0:t.querySelector('[role="option"][tabindex="0"]')),f=i==null?void 0:i.closest('label, [role="option"]');if(t&&f){const o=f.offsetTop+f.offsetHeight;o>t.scrollTop+t.clientHeight&&(t.scrollTop=o-t.clientHeight),f.offsetTop<t.scrollTop&&(t.scrollTop=f.offsetTop)}i==null||i.focus({preventScroll:true});const v=o=>{var d,p,m;const r=o.target;(d=u.current)!=null&&d.contains(r)||(p=document.getElementById(c))!=null&&p.contains(r)||r&&((m=e==null?void 0:e())!=null&&m.contains(r))||n(false)},E=o=>{var p,m;if(o.key!=="Escape")return;const r=document.activeElement,d=!!((p=u.current)!=null&&p.contains(r)||(m=document.getElementById(c))!=null&&m.contains(r));d&&o.preventDefault(),n(d)};return document.addEventListener("pointerdown",v),document.addEventListener("keydown",E,true),()=>{document.removeEventListener("pointerdown",v),document.removeEventListener("keydown",E,true)}},[c,n,e]),k("div",{className:x("clover-canvas-menu",y),"data-testid":s,id:a,ref:u,children:g})};function S(a){const c=a.getBoundingClientRect();let n=0,s=document.documentElement.clientWidth;for(let e=a.parentElement;e;e=e.parentElement){if(getComputedStyle(e).overflowX==="visible")continue;const l=e.getBoundingClientRect();n=Math.max(n,l.left),s=Math.min(s,l.right);break}const y=Math.max(n-c.left,Math.min(0,s-c.right));y&&(a.style.translate=`${y}px 0`)}export{L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as l}from"./shared-DkY2a89G.mjs";import{u}from"./useControlsVisibility-DPg8uAkW.mjs";function f({element:i,hideDelay:r,picture:s,onChange:o}){const t=u(i,r,s);return l(()=>o(t),[t,o]),null}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as m,d as g,A as v,q as u,u as e,P as f,z as b}from"./shared-
|
|
1
|
+
import{b as m,d as g,A as v,q as u,u as e,P as f,z as b}from"./shared-DkY2a89G.mjs";const k=b(()=>import("./ControlMenu-D1zkB0qX.mjs"));function N({position:c,total:l,list:p}){const n=`${m().replace(/:/g,"")}-count`,s=`${n}-menu`,[r,t]=g(false),a=v(null),h=u(()=>{var o;return(o=a.current)==null?void 0:o.closest(".clover-pager")},[]),i=u(o=>{var d;t(false),o&&((d=document.getElementById(n))==null||d.focus())},[n]);return e("span",{className:"clover-pager-count",ref:a,children:[e("button",{type:"button",id:n,className:"clover-pager-count-button","aria-controls":r?s:void 0,"aria-expanded":r,onClick:()=>t(!r),children:[e("span",{className:"clover-pager-position","aria-live":"polite",children:[e("span",{children:[c>=0?c+1:"\u2013"," / ",l]}),e("span",{className:"clover-pager-room","aria-hidden":"true",hidden:true,children:[l," / ",l]})]}),e("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",children:e("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&e(f,{fallback:null,children:e(k,{id:s,triggerId:n,onClose:i,holds:h,inside:true,className:"clover-pager-menu",children:e("div",{className:"clover-collection clover-pager-list",children:p(()=>i(true))})})})]})}export{N as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as i,ai as m}from"./shared-DkY2a89G.mjs";import{j as o}from"./classnames-DukgfdpI.mjs";import"./styles-DkkVOSUQ.mjs";function s({start:r,className:e}){return i("span",{className:o("clover-cue-time",e),children:m(r)})}export{s as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as ee,A as S,T as te,y as H,_ as ae,d as V,u as o,b as oe,v as le,k as ce}from"./shared-DkY2a89G.mjs";import{u as ie,a as se,b as Z,B as de,S as me,c as J,d as ue,P as ve,e as pe,p as he}from"./viewer-Br44EEba.mjs";import{u as fe}from"./useLazyPanelPane-eby-OI1V.mjs";import{d as be,c as re,g as ge,h as we}from"./hooks-BhtNDs_1.mjs";import{B as ye}from"./Body-Ct61yxI7.mjs";import{stillSource as xe,resolveThumbnail as Se}from"./thumbnail-DecrVnpj.mjs";import{a as Ee}from"./index-FJEpXukG.mjs";import{t as Le}from"./heading-Cjt0f-Eu.mjs";import{R as Te}from"./Root-Bt3NNBFb.mjs";import{Position as ke}from"./Position-TYnzcm8e.mjs";import{T as Ne}from"./Tip-OCB88zwY.mjs";import{L as ze}from"./Label-f07N5Fld.mjs";import{Download as Ae}from"./Download-Bku9Vptk.mjs";import{P as Pe,L as De}from"./Provider-DyB0wpeO.mjs";import{S as Me}from"./Status-CcU3u6P4.mjs";import{I as qe}from"./Items-CudZ4Lnb.mjs";const Oe=1600,Be=200,Q=.25,Fe=1500,X=typeof window>"u"?H:ae,ne=a=>{const d=Number(a==null?void 0:a.width),n=Number(a==null?void 0:a.height);return d>0&&n>0?d/n:void 0};function Re({collapseControls:a,children:d}){const{clover:n}=ee("Document"),m=be(),b=re(),l=S(null),E=S(null),g=S(null),k=m.direction==="right-to-left"||m.direction==="bottom-to-top",u=te(()=>m.views.map(e=>{var T;const t=e.map(x=>m.canvases[x]),c=k?[...t].reverse():t,f=c.map(ne);return{key:t.map(x=>x.id).join("|"),first:(T=t[0])==null?void 0:T.id,canvases:c,ratio:f.every(Boolean)?f.reduce((x,O)=>x+O,0):void 0}}),[m,k]),i=Math.max(0,b.position),h=S({sheets:u,position:i});h.current={sheets:u,position:i};const L=S(null),v=S(null),_=S(0),A=S(()=>{}),M=S(false),j=e=>{var t;return(t=E.current)==null?void 0:t.children[e]},r=e=>{const t=l.current,c=j(e);return!t||!c||c===g.current?0:Math.min(c.offsetTop,t.scrollHeight-t.clientHeight)},D=()=>{const e=g.current,t=j(h.current.position);if(e){if(!t||t===e){e.style.top="0px",e.style.height="100%";return}e.style.top=`${t.offsetTop}px`,e.style.height=`${t.offsetHeight}px`}};function N(){const e=l.current;if(!e||e.hasAttribute("data-scrolling")||v.current!==null)return;const t=r(h.current.position);_.current=t,!(Math.abs(e.scrollTop-t)<=1)&&(M.current=true,e.scrollTop=t,requestAnimationFrame(()=>requestAnimationFrame(()=>M.current=false)))}X(D),H(()=>{const e=new ResizeObserver(()=>{D(),N()});return E.current&&e.observe(E.current),l.current&&e.observe(l.current),()=>e.disconnect()},[]);const y=()=>{A.current();for(const[e,t]of[[l.current,"data-scrolling"],[g.current,"data-moved"]])e&&!e.hasAttribute(t)&&e.setAttribute(t,"")},K=()=>{const e=l.current,t=g.current;if(!e||!t)return;A.current(),_.current=e.scrollTop;const c=()=>{const F=t.querySelector(".clover-canvas");return!F||F.getAttribute("data-status")!=="loading"||F.getAttribute("data-placeholder")==="true"};let f=0;const T=new MutationObserver(()=>c()&&B()),x=setTimeout(()=>B(),Fe),O=()=>{cancelAnimationFrame(f),clearTimeout(x),T.disconnect()},B=()=>{O(),t.removeAttribute("data-moved"),e.removeAttribute("data-scrolling")};A.current=O,f=requestAnimationFrame(()=>{f=requestAnimationFrame(()=>{if(c())return B();T.observe(t,{attributes:true,subtree:true,attributeFilter:["data-status","data-placeholder"]})})})},U=(e,t=false)=>{var x;const c=l.current;if(!c)return;const f=r(e);if(Math.abs(c.scrollTop-f)<=1)return K();y(),v.current=e;const T=t||((x=window.matchMedia)==null?void 0:x.call(window,"(prefers-reduced-motion: reduce)").matches);c.scrollTo({top:f,behavior:T?"auto":"smooth"})},C=S(null);X(()=>{const e=C.current!==u;if(C.current=u,s(false),L.current===i&&!e){L.current=null;return}L.current=null,U(i,e)},[i,u]),H(()=>{const e=l.current;if(!e)return;let t=0,c,f=false;const T=p=>{const z=h.current.sheets.length;if(z<2)return 0;let w=0;for(let G=0;G<z&&r(G)<=p+.5;G++)w=G;if(w>=z-1)return z-1;const $=r(w),P=(p-$)/Math.max(1,r(w+1)-$);return p>=_.current?P>Q?w+1:w:P<1-Q?w:w+1},x=()=>{if(t=0,v.current!==null)return;const p=T(e.scrollTop),{sheets:z,position:w}=h.current;p===w||!z[p]||(y(),s(false),L.current=p,n.goTo(z[p].first))},O=()=>{if(f)return;const{sheets:p,position:z}=h.current,w=e.scrollTop,$=v.current;v.current=null;const P=$!==null&&Math.abs(w-r($))<=1?$:T(w);if(!p[P])return K();P!==z&&(y(),s(false),L.current=P,n.goTo(p[P].first)),U(P)},B=()=>{clearTimeout(c),c=setTimeout(O,Be)},F=()=>{M.current||(y(),B(),t||(t=requestAnimationFrame(x)))},R=p=>{v.current=null,(p.type==="touchstart"||p.type==="pointerdown"&&p.target===e)&&(f=true)},I=()=>{f&&(f=false,B())};return e.addEventListener("scroll",F,{passive:true}),e.addEventListener("wheel",R,{passive:true}),e.addEventListener("touchstart",R,{passive:true}),e.addEventListener("pointerdown",R),window.addEventListener("touchend",I),window.addEventListener("touchcancel",I),window.addEventListener("pointerup",I),()=>{cancelAnimationFrame(t),clearTimeout(c),A.current(),e.removeEventListener("scroll",F),e.removeEventListener("wheel",R),e.removeEventListener("touchstart",R),e.removeEventListener("pointerdown",R),window.removeEventListener("touchend",I),window.removeEventListener("touchcancel",I),window.removeEventListener("pointerup",I)}},[n]);const[q,W]=V(null);function s(e){const t=l.current;!t||t.hasAttribute("data-zoomed")===e||(t.toggleAttribute("data-zoomed",e),e&&N())}return H(()=>{if(q)return q.on("viewport",()=>s(!q.atHome))},[q]),o("div",{ref:l,className:"clover-template-document-column",onKeyDown:e=>{if(!(e.defaultPrevented||e.altKey||e.ctrlKey)){if(e.key==="PageDown"&&b.hasNext)b.next();else if(e.key==="PageUp"&&b.hasPrevious)b.previous();else return;e.preventDefault()}},children:o("div",{ref:E,className:"clover-template-document-sheets","data-single":u.length<2||void 0,children:[u.map((e,t)=>o("div",{"aria-hidden":"true",className:"clover-template-document-sheet","data-active":t===i||void 0,"data-fill":e.ratio===void 0||void 0,onClick:()=>t!==i&&n.goTo(e.first),style:e.ratio===void 0?void 0:{"--ratio":e.ratio},children:e.canvases.map(c=>o($e,{canvas:c},c.id))},e.key)),o("div",{ref:g,className:"clover-template-document-live",children:o(ye,{className:"clover-template-document-body",collapseControls:a,onReady:W,children:d})})]})})}function Ie(a){const[d,n]=V(()=>typeof IntersectionObserver>"u");return H(()=>{if(d||!a)return;const m=new IntersectionObserver(b=>{b.some(l=>l.isIntersecting)&&(n(true),m.disconnect())},{root:a.closest(".clover-template-document-column"),rootMargin:"100% 0px"});return m.observe(a),()=>m.disconnect()},[a,d]),d}function $e({canvas:a}){const{clover:d}=ee("Document"),n=te(()=>xe(a),[a]),[m,b]=V(null),l=Ie(m),[E,g]=V(n==null?void 0:n.src);H(()=>{if(!n||n.src)return g(n==null?void 0:n.src);if(!l)return;let i=true;return Se(n,Oe,d.request).then(h=>i&&g(h)),()=>{i=false}},[n,d,l]);const k=ne(a),u=k?{aspectRatio:String(k)}:void 0;return E?o("img",{alt:"",decoding:"async",loading:"lazy",src:E,style:u}):o("span",{ref:b,style:u})}Ee(46,"templates/document/Document","@layer clover{.clover-template-document{--clover-template-document-height: min(85vh, 56rem);display:flex;flex-direction:column;height:var(--clover-template-document-height);min-height:min-content;overflow:hidden;background-color:var(--clover-color-secondary, #fff);color:var(--clover-color-primary, #1a1d1e)}@supports (height: 1svh){.clover-template-document{--clover-template-document-height: min(85svh, 56rem)}}.clover-template-document-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--clover-space-s);padding:var(--clover-space-m) var(--clover-inset);border-bottom:1px solid var(--clover-color-secondary-muted, #e6e8eb)}.clover-template-document-provider{max-width:100%;margin-inline-start:auto}.clover-template-document-toolbar .clover-download-groups{flex-direction:row;flex-wrap:wrap;column-gap:var(--clover-space-m)}.clover-template-document-toolbar .clover-download-group{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:var(--clover-space-s)}.clover-template-document-toolbar .clover-download-title{margin:0}.clover-template-document-toolbar .clover-download-list{display:flex;flex-wrap:wrap;column-gap:var(--clover-space-s)}.clover-template-document-title{flex:1 1 6rem;min-width:0}button.clover-template-document-sidebar-toggle{display:inline-flex;flex:none;align-items:center;gap:var(--clover-space-xs);min-height:var(--clover-control);padding-block:0;padding-inline:var(--clover-space-s) calc(var(--clover-space-xs) + var(--clover-space-3xs));border:0;border-radius:var(--clover-radius-pill, 2rem);background-color:var(--clover-color-control, #1a1d1e);color:var(--clover-color-control-glyph, #fff);cursor:pointer;transition:var(--clover-transition, all .2s cubic-bezier(.16, 1, .3, 1))}button.clover-template-document-sidebar-toggle:is(:hover,:focus-visible){background-color:var(--clover-color-accent, #0065c3)}:where([data-high-contrast]) button.clover-template-document-sidebar-toggle:is(:hover,:focus-visible){background-color:var(--clover-accent-fill)}:where([data-high-contrast]) button.clover-template-document-sidebar-toggle:hover:not(:focus-visible){outline:var(--clover-accent-ring-hover);outline-offset:1px}button.clover-template-document-sidebar-toggle:focus-visible{outline:2px solid var(--clover-color-accent, #0065c3);outline-offset:2px}.clover-template-document-sidebar-toggle .clover-template-document-position{color:inherit;font-size:var(--clover-text-xs);white-space:nowrap}.clover-template-document-sidebar-toggle .clover-template-document-position>.clover-pager-room[hidden]{display:none}.clover-template-document-panes{position:relative;flex:1 1 auto;min-height:16rem}.clover-template-document-panes:is([data-panel=over],[data-narrow])>.clover-template-document-main{isolation:isolate}.clover-template-document-sidebar{contain:size;overflow-y:auto;overscroll-behavior:contain;padding:var(--clover-inset);scroll-padding-top:calc(2 * var(--clover-inset) + var(--clover-control));background-color:var(--clover-color-secondary, #fff)}.clover-template-document-sidebar-closed{position:absolute;top:var(--clover-inset);inset-inline-start:var(--clover-inset);z-index:3}@media (width < 31rem){.clover-template-document-toolbar,.clover-template-document-sidebar-closed,.clover-template-document-spine{--clover-inset: var(--clover-space-m)}}.clover-template-document-sidebar[hidden]{display:none}.clover-template-document-sidebar+.clover-split-handle:before{inset-inline-start:0;inset-inline-end:calc(3px - var(--clover-space-l))}.clover-template-document-sidebar .clover-items[data-layout] .clover-items-figure{grid-template-columns:repeat(var(--parts, 1),minmax(0,1fr));gap:var(--clover-space-xs) 0}.clover-template-document-sidebar .clover-items[data-layout] :is(.clover-items-pictures,.clover-items-caption){grid-column:1 / -1;grid-template-columns:subgrid}.clover-template-document-sidebar .clover-items[data-layout] .clover-items-label{contain:inline-size}.clover-template-document-sidebar .clover-items[data-layout] .clover-items-picture[data-empty],.clover-template-document-sidebar .clover-items[data-layout] .clover-items-picture img{width:100%;height:auto;max-height:20rem;aspect-ratio:var(--clover-items-ratio, auto);object-fit:contain}.clover-template-document-sidebar .clover-items[data-layout] .clover-items-caption{font-size:var(--clover-text-s)}.clover-template-document-main{position:relative;overflow:hidden;background-color:var(--clover-color-secondary-muted, #e6e8eb)}.clover-template-document-column{position:absolute;inset:0;overflow-x:hidden;overflow-y:auto;container-type:size}.clover-template-document-sheets{position:relative}.clover-template-document-sheet{--clover-template-document-tease: calc(2 * var(--clover-inset));display:flex;justify-content:center;box-sizing:border-box;height:min(100cqh - var(--clover-template-document-tease),(100cqw - 2 * var(--clover-inset)) / var(--ratio) + 2 * var(--clover-inset));padding:var(--clover-inset);transition:opacity .2s ease,height .24s cubic-bezier(.16,1,.3,1)}.clover-template-document-sheet[data-fill]{height:calc(100cqh - var(--clover-template-document-tease))}.clover-template-document-column[data-zoomed] .clover-template-document-sheet[data-active]{height:100cqh}.clover-template-document-column[data-zoomed] .clover-template-document-sheet[data-active]>*{visibility:hidden}.clover-template-document-column[data-zoomed] .clover-template-document-sheet:not([data-active]){--clover-template-document-muted: 0;pointer-events:none}.clover-template-document-sheet:not([data-active]){--clover-template-document-muted: .618;cursor:pointer;opacity:var(--clover-template-document-muted)}.clover-template-document-sheet:not([data-active]):hover{--clover-template-document-muted: .809}@media (prefers-reduced-motion: reduce){.clover-template-document-sheet{transition:none}}.clover-template-document-sheets[data-single]>.clover-template-document-sheet{--clover-template-document-tease: 0px}.clover-template-document-sheet>*{display:block;height:100%;min-width:0}.clover-template-document-sheet[data-fill]>*{object-fit:contain}.clover-template-document-live{--clover-body-height: 100%;position:absolute;inset-inline:0;top:0;height:100%;transition:opacity .16s ease}.clover-template-document-body .clover-canvas{--clover-canvas-inset: var(--clover-inset);background-color:transparent}.clover-template-document-live[data-moved]:not(:focus-within){opacity:0;pointer-events:none}.clover-template-document-column[data-scrolling] .clover-template-document-live:not(:focus-within) .clover-canvas-controls>*{--clover-controls-shown: 0;--clover-controls-events: none}.clover-template-document-column:not([data-zoomed]) :not(.clover-scene)>.clover-canvas-viewport{touch-action:pan-y}.clover-template-document-scrim[data-for=sidebar]{z-index:2}.clover-template-document-panes[data-narrow]{--clover-template-sidebar-width: min(14rem, 80%)}.clover-template-document-panes[data-narrow]>.clover-template-document-sidebar{position:absolute;inset-block:0;inset-inline-start:0;z-index:3;width:var(--clover-template-sidebar-width);border-inline-end:1px solid var(--clover-color-secondary-muted, #e6e8eb);--clover-template-inner: right;--clover-template-toward: 1}.clover-template-document-panes[data-narrow]>.clover-template-document-sidebar:dir(rtl){--clover-template-inner: left;--clover-template-toward: -1}.clover-template-document-spine{position:relative;z-index:4;flex:none;width:0}.clover-template-document-spine>*{position:absolute;top:var(--clover-inset);inset-inline-start:-1.5px;translate:-50%}.clover-template-document-spine:dir(rtl)>*{translate:50%}.clover-template-document-spine[data-for=sidebar]>*{inset-inline:auto calc(1.5px - var(--clover-control) / 2);translate:none}.clover-template-document-panes[data-narrow]>.clover-template-document-spine[data-for=sidebar]{inset-inline-start:var(--clover-template-sidebar-width)}.clover-template-document-panes[data-narrow]>.clover-template-document-spine[data-for=sidebar]>*{inset-inline-end:calc(var(--clover-control) / -2)}}");function at({className:a,defaultSidebarOpen:d,singleItem:n=false,defaultPanelOpen:m=false,panelLayout:b="accordion",download:l=true,languages:E=true,headingLevel:g=2,storageKey:k="clover-template-document",collapseControls:u,...i}){const h=Le(g,`${oe().replace(/:/g,"")}-title`);return o(Te,{className:["clover-template-document",a].filter(Boolean).join(" "),...h.group,...i,children:o(je,{title:h,defaultSidebarOpen:d,singleItem:n,defaultPanelOpen:m,panelLayout:b,download:l,languages:E,headingLevel:g,storageKey:k,collapseControls:u})})}const Y=a=>a+1,He=9,_e=40;function je({defaultSidebarOpen:a,singleItem:d,defaultPanelOpen:n,download:m,languages:b,headingLevel:l=2,storageKey:E,panelLayout:g,collapseControls:k,title:u}){const i=ge(),h=we(),L=h("templateSidebar"),v=oe().replace(/:/g,""),_=re(),A=S(null),M=S(null),j=ie(),r=se({id:`${v}-sidebar`,beside:Z(A,_e),defaultOpen:a??true,side:"start",focus:s=>s.querySelector('[role="option"][aria-selected="true"]'),slides:false,alongside:M,followFocus:j}),D=_.total>(d?0:1),N=D&&r.open,y=fe({id:`${v}-panel`,beside:Z(A,de+(N?He:0)),defaultOpen:!!n,followFocus:j}),K=s=>{var e,t;r.over&&((t=(e=s.target).closest)!=null&&t.call(e,`[aria-controls~="${v}-sidebar"]`))&&he()},U=()=>{r.over&&r.close()},C=y.docked,q=y.toggle,W=D&&o("button",{type:"button",className:"clover-template-document-sidebar-toggle","aria-expanded":r.open,"aria-controls":`${v}-sidebar`,lang:h("templateSidebarToggle"),onClick:()=>r.setOpen(!r.open),children:[o("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",fill:r.open?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[o("rect",{x:"1.5",y:"2",width:"5.5",height:"4.5",rx:"1"}),o("rect",{x:"1.5",y:"9.5",width:"5.5",height:"4.5",rx:"1"}),o("path",{d:"M9.5 4.25h5M9.5 11.75h5",fill:"none"})]}),o("span",{style:le,children:i("templateSidebarToggle")}),o(ke,{className:"clover-template-document-position"}),o(Ne,{label:i("templateSidebarToggle")})]});return o(ce,{children:[o("header",{className:"clover-template-document-toolbar",children:[o(ze,{as:u.as,className:"clover-template-document-title clover-template-title clover-title",...u.title}),m&&o(Ae,{headingLevel:Y(l)}),o(Pe,{className:"clover-template-document-provider",children:o(De,{})})]}),o(Me,{loading:false}),o(me,{ref:A,className:"clover-template-document-panes clover-template-panes","data-sidebar":N?"open":"closed","data-narrow":r.over||void 0,"data-panel":y.splitProps["data-panel"],storageKey:E||void 0,onKeyDown:s=>{y.onKeyDown(s),r.onKeyDown(s)},onPointerOver:s=>{y.splitProps.onPointerOver(s),K(s)},onFocus:s=>{y.splitProps.onFocus(s),K(s)},children:[o(J,{ref:r.pane,as:"aside",id:`${v}-sidebar`,name:"sidebar",className:["clover-template-document-sidebar",r.over&&"clover-template-float"].filter(Boolean).join(" "),"aria-label":L?void 0:i("templateSidebar"),"aria-labelledby":L?`${v}-sidebar-name`:void 0,size:"13rem",min:r.over?void 0:"8rem",max:"24rem",hidden:!N,children:[L&&o("span",{hidden:true,id:`${v}-sidebar-name`,lang:L,children:i("templateSidebar")}),o(qe,{layout:"list",singleItem:d,"aria-label":L?void 0:i("templateSidebar"),thumbnailSize:320,onSelect:U})]}),N&&!r.over&&o(ue,{"aria-controls":`${v}-sidebar`}),N&&o("div",{ref:M,className:"clover-template-document-spine","data-for":"sidebar",children:W}),o(J,{className:"clover-template-document-main",min:N&&!r.over||C?ve:void 0,children:[D&&!r.open&&o("div",{className:"clover-template-document-sidebar-closed",children:W}),o(Re,{collapseControls:k,children:!C&&q})]}),o(pe,{pane:y,className:"clover-template-document-panel",layout:g,headingLevel:Y(l),download:false,languages:b}),D&&r.scrim&&o("div",{className:"clover-template-document-scrim clover-template-scrim","data-for":"sidebar",...r.scrim})]})]})}export{at as Document};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var h=(o,t,e)=>t in o?c(o,t,{enumerable:true,configurable:true,writable:true,value:e}):o[t]=e;var l=(o,t,e)=>h(o,typeof t!="symbol"?t+"":t,e);import{
|
|
1
|
+
var c=Object.defineProperty;var h=(o,t,e)=>t in o?c(o,t,{enumerable:true,configurable:true,writable:true,value:e}):o[t]=e;var l=(o,t,e)=>h(o,typeof t!="symbol"?t+"":t,e);import{j as d,c as p,t as x}from"./CanvasView-2Fj9nT06.mjs";class f{constructor(t){l(this,"container");l(this,"boxes",new Map);const e=document.createElement("div");e.className="clover-canvas-dom-layer",Object.assign(e.style,{position:"absolute",inset:"0",overflow:"hidden",pointerEvents:"none"}),t.appendChild(e),this.container=e}sync(t){const e=new Set;t.forEach((s,i)=>{e.add(s.key);const a=this.boxFor(s),n=s.crop??{x:0,y:0,width:s.width,height:s.height};a.style.width=`${n.width}px`,a.style.height=`${n.height}px`,a.style.transform=d(p(s.transform,x(n.x,n.y))),a.style.opacity=String(s.opacity),a.style.zIndex=String(i);const r=s.element;r.style.width=`${s.width}px`,r.style.height=`${s.height}px`,r.style.transform=`translate(${-n.x}px, ${-n.y}px)`});for(const[s,i]of this.boxes)e.has(s)||(i.remove(),this.boxes.delete(s))}dispose(){this.boxes.clear(),this.container.remove()}boxFor(t){let e=this.boxes.get(t.key);return e&&e.firstChild!==t.element&&(e.remove(),e=void 0),e||(e=document.createElement("div"),e.className="clover-canvas-dom-item",e.dataset.key=t.key,Object.assign(e.style,{position:"absolute",top:"0",left:"0",overflow:"hidden",transformOrigin:"0 0"}),t.element.classList.add("clover-canvas-dom-media"),Object.assign(t.element.style,{position:"absolute",top:"0",left:"0",maxWidth:"none",maxHeight:"none",transformOrigin:"0 0"}),e.appendChild(t.element),this.container.appendChild(e),this.boxes.set(t.key,e)),e}}export{f as DomLayers};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N,e as D,b as y,u as l,l as h}from"./shared-
|
|
1
|
+
import{a as N,e as D,b as y,u as l,l as h}from"./shared-DkY2a89G.mjs";import{j as $}from"./classnames-DukgfdpI.mjs";import{a as k}from"./heading-Cjt0f-Eu.mjs";import{u as C}from"./downloads-EjJ6Hpip.mjs";import"./styles-DkkVOSUQ.mjs";const g=new Set,p=a=>{var n;try{return new URL(a,(n=globalThis.location)==null?void 0:n.href).origin}catch{return a}};function K(a,n){import("./save-file-dZyOpXgY.mjs").then(({saveFile:r})=>r(a,n)).then(r=>{r||(g.add(p(a)),window.open(a,"_blank","noopener,noreferrer"))})}function L({page:a,all:n,headingLevel:r=3,inPopover:e=false}){const{t:s,langOf:w}=N(),{clover:m}=D("Download"),c=y(),b=e?"span":k(r),v=e?"div":"section",t=(i,f,u)=>f.length>0&&l(v,{className:"clover-download-group",role:e?"group":void 0,"aria-labelledby":`${c}-${u}`,children:[l(b,{className:"clover-download-title",id:`${c}-${u}`,...h(w(i)),children:s(i)}),l("ul",{className:"clover-download-list",children:f.map(o=>l("li",{children:l("a",{className:"clover-download-link",href:o.id,target:"_blank",rel:"noopener noreferrer",download:"",hrefLang:o.hrefLang,...h(o.lang),onClick:d=>{d.button!==0||d.metaKey||d.ctrlKey||d.shiftKey||d.altKey||g.has(p(o.id))||(d.preventDefault(),K(o.id,m.request))},children:[o.label,o.format&&o.format!==o.label&&l("span",{className:"clover-download-format",children:[" ","(",o.format,")"]})]})},o.id))})]});return l("div",{className:"clover-download-groups",children:[t("downloadPage",a,"page"),t("downloadAll",n,"all")]})}function U({className:a,headingLevel:n=3,...r}){const{page:e,all:s}=C();return!e.length&&!s.length?null:l("div",{...r,className:$("clover-download",a),children:l(L,{page:e,all:s,headingLevel:n})})}export{U as Download,L as DownloadGroups,C as useDownloads};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,u as r,l as h,k as p,
|
|
1
|
+
import{a as u,u as r,l as h,k as p,t as v}from"./shared-DkY2a89G.mjs";import{b as g}from"./annotation-name-DbWjhgra.mjs";import{M as m}from"./Markup-DW75Jx3j.mjs";const x=o=>o.some(n=>{var e;return(e=n.value)==null?void 0:e.trim()}),w=(o,n)=>{const e=new Map;for(const t of o)t.choice!==void 0&&e.set(t.choice,[...e.get(t.choice)??[],t]);if(!e.size)return o;const i=new Set([...e.values()].map(t=>g(t,n)));return o.filter(t=>t.choice===void 0||i.has(t))};function M({bodies:o,language:n,headingLevel:e}){const{t:i,langOf:t}=u(),l=w(o,n),f=a=>{if(x(l))return{text:""};const s=v(a.label,n);return s.text?s:{text:i("annotationsImage"),lang:t("annotationsImage")}};return r(p,{children:l.map((a,s)=>{if(a.place)return r(m,{as:"div",markup:a.label,language:n,className:"clover-annotations-text"},s);if(!a.image)return r(m,{as:"div",markup:{[a.language??"none"]:[a.value??""]},format:a.format,headingLevel:e,language:n,className:"clover-annotations-text"},s);const c=f(a);return r("img",{src:a.image,alt:c.text,...h(c.text?c.lang:void 0),width:200,loading:"lazy",className:"clover-annotations-image"},s)})})}export{M as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as s,d as h,y as e}from"./shared-
|
|
1
|
+
import{u as s,d as h,y as e}from"./shared-DkY2a89G.mjs";import{resolveThumbnail as y}from"./thumbnail-DecrVnpj.mjs";import{j as v}from"./classnames-DukgfdpI.mjs";import"./styles-DkkVOSUQ.mjs";const m=52,E=336;function T(t,i,n,l=false){const[a,r]=h(t==null?void 0:t.src),d=t?JSON.stringify(t):"";return e(()=>{if(!t||t.src)return r(t==null?void 0:t.src);l||r(void 0);let f=true;return y(t,i,n).then(o=>f&&r(o)),()=>{f=false}},[d,i]),a}function N({source:t,request:i,large:n=false,className:l}){const a=T(t,n?E:m,i);return a?s("img",{className:v("clover-entry-thumbnail",l),"data-large":n?"":void 0,src:a,alt:"",...!n&&{width:m/2,height:m/2},loading:"lazy",decoding:"async"}):null}export{N as E,E as P,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as g,a as y,u as e,l as o,v as c}from"./shared-
|
|
1
|
+
import{D as g,a as y,u as e,l as o,v as c}from"./shared-DkY2a89G.mjs";import{j as n}from"./classnames-DukgfdpI.mjs";import{S as k}from"./Steps-nlSCzbDQ.mjs";import{T as m}from"./Tip-OCB88zwY.mjs";import"./styles-DkkVOSUQ.mjs";const F=g(function({id:s,value:h,onChange:u,onSubmit:f,onClear:b,results:a,size:S="large",classes:t={}},v){const{t:l,langOf:r}=y(),d=l("commonSearch"),p=l("contentSearchClear");return e("form",{role:"search",className:n("clover-field-pill",t.form),"data-size":S,onSubmit:i=>{i.preventDefault(),f()},children:[e("label",{htmlFor:s,style:c,...o(r("informationPanelTabsSearch")),children:l("informationPanelTabsSearch")}),e("input",{ref:v,id:s,type:"search",className:n("clover-field-pill-query",t.query),value:h,placeholder:l("contentSearchPlaceholder"),lang:r("contentSearchPlaceholder"),onChange:i=>u(i.target.value)}),a&&(a.total?e(k,{steps:a,sentence:"contentSearchPosition"}):e("span",{className:"clover-field-pill-note","aria-hidden":"true",...o(r("contentSearchResultsNone")),children:l("contentSearchResultsNone")})),h&&e("button",{type:"button",className:n("clover-field-pill-clear",t.clear),...o(r("contentSearchClear")),onClick:b,children:[e("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:e("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),e("span",{style:c,children:p}),e(m,{label:p})]}),e("button",{type:"submit",className:n("clover-field-pill-submit",t.submit),...o(r("commonSearch")),children:[e("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:[e("circle",{cx:"7",cy:"7",r:"4.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),e("path",{d:"M10.5 10.5L14 14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),e("span",{style:c,children:d}),e(m,{label:d})]})]})});export{F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ai as Q,T as V,d as $,y as I,A as F,u as a,v as ee,q as X,a as te,b as ne,O as oe,_ as Y,aa as ae,ab as re,a9 as se,$ as ie}from"./shared-DkY2a89G.mjs";import ce from"./ChoiceMenu-ConzybVH.mjs";import{i as le,r as de}from"./layout-Djwu8f4R.mjs";import{M as Z}from"./Markup-DW75Jx3j.mjs";import{T as ue}from"./Tip-OCB88zwY.mjs";import{g as he,a as me,u as pe,b as fe,p as ve,s as ge,T as z,c as ye,P as ke,V as we,d as be}from"./Transport-DaIhfZqC.mjs";import{imageSource as xe,resolveThumbnail as Me}from"./thumbnail-DecrVnpj.mjs";import"./MediaBody-JnKnoIqY.mjs";import"./styles-DkkVOSUQ.mjs";const R=(e,l)=>l<10?`${Q(e)}.${Math.min(9,Math.floor((e||0)%1*10))}`:Q(e),Te=e=>{try{return e.matches(":focus-visible")}catch{return false}},Ce=50,Ae=250,Ne=(e,l)=>{let u=0;return e.forEach((d,c)=>{d.start<=l&&(u=c)}),u};function U(e,l,u){const d=Math.min(l,u),c=[];return e.forEach((m,k)=>{m.start<=d&&(d<m.end||d>=u&&m.end>=u)&&c.push(k)}),c}const $e=(e,l,u)=>{let d=u;for(const c of e)c.start>l&&c.start<d&&(d=c.start),c.end>l&&c.end<d&&(d=c.end);return d},Pe=128;function Se(e,l){const[u,d]=$([]);return I(()=>{let c=true;return Promise.all(e.map(m=>{const{body:k}=m.annotation,i=de(Array.isArray(k)?k[0]:k),t=(i==null?void 0:i.body.type)==="Image"?xe(i.body,i.region):void 0;return t?Me(t,Pe,l):void 0})).then(m=>c&&d(m)),()=>{c=false}},[e,l]),u}function Be(e,l,{autoplay:u=false,loop:d=false,duration:c,isReady:m,onEnded:k}){const i=V(()=>{if(c&&Number.isFinite(c)&&c>0)return c;const s=e.map(p=>p.end).filter(Number.isFinite);return s.length?Math.max(...s):0},[e,c]),[t,v]=$(0),[g,f]=$(false),[w,h]=$(d),[E,x]=$(0),M=F(0),b=F(m);b.current=m;const C=F(k);C.current=k;const A=X(s=>{const p=Math.max(0,Math.min(i,s));M.current=p,v(p),x(S=>S+1)},[i]);I(()=>{M.current=0,v(0),h(d);const s=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;f(u&&e.length>1&&!s)},[l]),I(()=>{if(!g||e.length<2||!(i>0))return;let s={at:Date.now(),time:M.current>=i?0:M.current},p;const S=N=>{M.current=N,v(N)},L=N=>Math.max(0,Math.min(Ae,($e(e,N,i)-N)*1e3)),H=()=>{var j;const N=M.current;let B=s.time+(Date.now()-s.at)/1e3;if(B>=i){if(!w){S(i),f(false),(j=C.current)==null||j.call(C);return}B=0,s={at:Date.now(),time:0}}const D=U(e,N,i),W=U(e,B,i).filter(O=>!D.includes(O));if(b.current&&W.some(O=>!b.current(O))){s={at:Date.now(),time:N},p=setTimeout(H,Ce);return}S(B),p=setTimeout(H,L(B))};return s.time!==M.current&&S(s.time),p=setTimeout(H,L(s.time)),()=>clearTimeout(p)},[g,e,i,w,E]);const P=Ne(e,t),T=U(e,t,i).join(","),r=V(()=>T?T.split(",").map(Number):[],[T]),n=X(s=>{var p;return A(((p=e[s])==null?void 0:p.start)??0)},[e,A]);return{frame:P,shown:r,time:t,total:i,playing:g,repeat:w,setFrame:n,seek:A,setPlaying:f,setRepeat:h}}function Ie({frames:e,animation:l,language:u,sound:d}){var G;const{t:c,langOf:m}=te(),{frame:k,time:i,total:t,playing:v,repeat:g,setFrame:f,seek:w,setPlaying:h,setRepeat:E}=l,x=V(()=>[...new Set(e.map(o=>o.start))].sort((o,y)=>o-y),[e]);let M=0;x.forEach((o,y)=>{o<=i&&(M=y)});const b=t>0?Math.min(i,t)/t*100:0,C=V(()=>{const o=he(e,t);return o.length?me(o):void 0},[e,t]),A=`${ne().replace(/:/g,"")}-frames`,P=`${A}-menu`,[T,r]=$(false),n=F(null);pe(n);const s=X(o=>{var y;r(false),o&&((y=document.getElementById(A))==null||y.focus())},[A]),p=Se(e,(G=oe())==null?void 0:G.clover.request),S=V(()=>({key:"frame",items:e.map((o,y)=>({label:o.annotation.label,id:o.annotation.id,image:p[y]}))}),[e,p]),[L,H]=$(null),[N,B]=$(false),D=F(null),W=`${k+1} / ${e.length}`;Y(()=>{var o;L===null&&((o=D.current)==null||o.style.setProperty("--clover-transport-preview",fe(b)))},[L,b]);const j=F(null);Y(()=>{const o=j.current,y=o==null?void 0:o.querySelector(".clover-canvas-menu"),q=o==null?void 0:o.closest(".clover-canvas-transport"),K=o==null?void 0:o.closest(".clover-canvas-media");if(!T||!o||!y||!q||!K)return;const J=()=>ve(y,o,q,K);J();const _=new ResizeObserver(J);return _.observe(K),_.observe(q),_.observe(y),()=>_.disconnect()},[T]);const O=o=>{const y=x[M+o];y!==void 0&&(h(false),f(e.findIndex(q=>q.start===y)))};return a("div",{className:"clover-canvas-transport","data-kind":"frames","data-testid":"clover-canvas-frames",children:[a("div",{className:"clover-canvas-transport-seek-area",onPointerMove:o=>{if(!t||o.target.closest(".clover-tip"))return;const y=o.currentTarget.getBoundingClientRect();H(R(ge(o.currentTarget,o.clientX)*t,t)),o.currentTarget.style.setProperty("--clover-transport-preview",`${(o.clientX-y.left)/y.width*100}%`)},onPointerLeave:()=>H(null),ref:D,children:[(L!==null||N)&&a(ue,{label:"",lead:L??R(i,t)}),a("input",{"aria-label":c("playerSeek"),"aria-valuetext":`${R(i,t)} / ${R(t,t)}, ${W}`,onFocus:o=>B(Te(o.currentTarget)),onBlur:()=>B(false),lang:m("playerSeek"),className:"clover-canvas-transport-seek",max:t,min:0,step:"any",type:"range",value:Math.min(i,t),onChange:o=>w(Number(o.target.value)),"data-gaps":C?"":void 0,style:{"--clover-transport-progress":`${b}%`,...C&&{"--clover-transport-gaps":C,"--clover-transport-at":b/100}}})]}),a("div",{className:"clover-canvas-transport-bar",ref:n,children:[a(z,{words:v?"playerPause":"playerPlay",button:v?"pause":"play",onClick:()=>{!v&&i>=t&&w(0),h(!v)},children:v?a(ye,{}):a(ke,{})}),a(z,{words:"frameRepeat",button:"repeat",pressed:g,onClick:()=>E(!g),children:a("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:a("path",{d:"M3 7V6a2 2 0 0 1 2-2h7l-2-2M13 9v1a2 2 0 0 1-2 2H4l2 2",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}),d&&a(z,{words:d.muted?"playerUnmute":"playerMute",button:"mute",onClick:d.toggle,children:d.muted?a(we,{}):a(be,{})}),a("span",{className:"clover-canvas-transport-status","aria-hidden":"true",children:a("span",{className:"clover-canvas-transport-time",children:[R(i,t)," / ",R(t,t)]})}),a("div",{className:"clover-canvas-transport-end",children:[a("span",{className:"clover-canvas-transport-frames",ref:j,children:[a("button",{type:"button",id:A,className:"clover-canvas-transport-time","aria-controls":T?P:void 0,"aria-expanded":T,onClick:()=>{T||h(false),r(!T)},children:[a("span",{className:"clover-canvas-transport-place","aria-live":"off",children:[a("span",{children:W}),a("span",{className:"clover-canvas-transport-place-room","aria-hidden":"true",hidden:true,children:[e.length," / ",e.length]})]}),a("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",children:a("path",{d:"M3 7.5l3-3 3 3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),T&&a(ce,{id:P,triggerId:A,label:c("playerChapters"),labelLang:m("playerChapters"),language:u,choices:[S],selections:{frame:k},onSelect:(o,y)=>{h(false),f(y)},onClose:s})]}),a(z,{words:"commonPrevious",disabled:M===0,onClick:()=>O(-1),children:a("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:a("path",{d:"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),a(z,{words:"commonNext",disabled:M===x.length-1,onClick:()=>O(1),children:a("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:a("path",{d:"M6 3l5 5-5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})]})}function Le(e,l,u){const d=le(l),c=u.width/(d.width||1),m=u.height/(d.height||1);return e.flatMap((k,i)=>{var h;const t=ae(k.annotation)[0],v=t==null?void 0:t.type,g=v==="Video"?"video":re(v)?"audio":v==="TextualBody"&&typeof(t==null?void 0:t.value)=="string"?"text":null;if(!g||!t||g!=="text"&&typeof t.id!="string")return[];const f=(h=se(k.annotation.target))==null?void 0:h.rect,w=f?{x:f.x,y:f.y,width:f.w,height:f.h}:{x:0,y:0,width:d.width,height:d.height};return[{index:i,id:`${k.annotation.id??i}#${g}`,kind:g,body:t,placement:{x:u.x+w.x*c,y:u.y+w.y*m,width:w.width*c,height:w.height*m}}]})}function Fe({host:e,item:l,shown:u,language:d}){return I(()=>{if(!u||e.dataset.fitted)return;let c=0;const m=()=>{if(!e.isConnected){c=requestAnimationFrame(m);return}const{width:k,height:i}=l.placement,t=f=>(e.style.fontSize=`${f}px`,e.scrollWidth<=k+1&&e.scrollHeight<=i+1);let v=1,g=i*.8;if(t(g))v=g;else for(let f=0;f<16;f+=1){const w=(v+g)/2;t(w)?v=w:g=w}e.style.fontSize=`${v}px`,e.dataset.fitted=""};return c=requestAnimationFrame(m),()=>cancelAnimationFrame(c)},[e,l,u]),ie(a(Z,{as:"div",markup:{[l.body.language??"none"]:[l.body.value]},format:l.body.format,language:d}),e)}function We({renderer:e,frames:l,byFrame:u,animationKey:d,sceneVersion:c,autoplay:m,loop:k,onEnded:i,language:t,duration:v,canvas:g,place:f,onItems:w}){const h=Be(l,d,{autoplay:m,loop:k,duration:v,onEnded:i,isReady:r=>(u[r]??[]).every(n=>e.isReady(n))}),E=V(()=>g&&f?Le(l,g,f):[],[l,g,f]),[x,M]=$([]);I(()=>{const r=E.map(n=>{if(n.kind==="text"){const p=document.createElement("div");return p.className="clover-canvas-painted-text",p.setAttribute("aria-hidden","true"),{item:n,element:p}}const s=document.createElement(n.kind);return s.preload="auto",s.playsInline=true,s.src=n.body.id,{item:n,element:s}});return M(r),()=>{for(const{element:n}of r)n instanceof HTMLMediaElement&&(n.pause(),n.removeAttribute("src"),n.load())}},[E]);const b=F(w);b.current=w,I(()=>{var r;return(r=b.current)==null||r.call(b,x.filter(({item:n})=>n.kind!=="audio").map(({item:n,element:s})=>({id:n.id,placement:n.placement,width:n.placement.width,height:n.placement.height,media:{element:s},hidden:true}))),()=>{var n;return(n=b.current)==null?void 0:n.call(b,[])}},[x]);const[C,A]=$(!!m);I(()=>{var r;for(const{item:n,element:s}of x){if(!(s instanceof HTMLMediaElement))continue;if(s.muted=C,!h.shown.includes(n.index)){s.paused||s.pause();continue}const p=Math.max(0,h.time-l[n.index].start);if(Math.abs(s.currentTime-p)>(h.playing?1:.1))try{s.currentTime=p}catch{}h.playing&&s.paused?(r=s.play())==null||r.catch(()=>{}):!h.playing&&!s.paused&&s.pause()}},[x,l,h.shown,h.time,h.playing,C]),I(()=>{const r=new Set([...h.shown.flatMap(n=>u[n]??[]),...x.filter(({item:n})=>h.shown.includes(n.index)).map(({item:n})=>n.id)]);e.setHidden([...u.flat(),...x.map(({item:n})=>n.id)].filter(n=>!r.has(n)))},[e,u,x,h.shown,c]);const P=x.filter(({item:r})=>r.kind==="text"),T=x.some(({item:r})=>r.kind!=="text");return a("div",{className:"clover-canvas-media","data-kind":"frames",children:[P.some(({item:r})=>h.shown.includes(r.index))&&a("div",{style:ee,children:P.filter(({item:r})=>h.shown.includes(r.index)).map(({item:r})=>a(Z,{as:"p",markup:{[r.body.language??"none"]:[r.body.value]},format:r.body.format,language:t},r.id))}),P.map(({item:r,element:n})=>a(Fe,{host:n,item:r,shown:h.shown.includes(r.index),language:t},r.id)),a(Ie,{frames:l,animation:h,language:t,sound:T?{muted:C,toggle:()=>A(r=>!r)}:void 0})]})}export{Ie as FrameControls,R as clockTime,We as default,U as framesAt,Be as useAnimation};
|