@nulib/clover 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/dist/components/Body/Body.mjs +16 -1
  2. package/dist/components/Body/glyphs.mjs +15 -0
  3. package/dist/components/Body/useControlsVisibility.mjs +35 -13
  4. package/dist/components/Canvas/CanvasView.mjs +116 -12
  5. package/dist/components/Canvas/ChaptersMenu.mjs +105 -0
  6. package/dist/components/Canvas/ControlMenu.mjs +23 -4
  7. package/dist/components/Canvas/Controls.mjs +223 -60
  8. package/dist/components/Canvas/ControlsFade.mjs +16 -0
  9. package/dist/components/Canvas/ImageControls.mjs +209 -0
  10. package/dist/components/Canvas/Placeholder.mjs +44 -12
  11. package/dist/components/Canvas/RowFits.mjs +85 -0
  12. package/dist/components/Canvas/layout.mjs +11 -0
  13. package/dist/components/Canvas/media/MediaBody.mjs +105 -46
  14. package/dist/components/Canvas/media/Player.mjs +0 -55
  15. package/dist/components/Canvas/media/Transport.mjs +14 -23
  16. package/dist/components/Canvas/panClearOfControls.mjs +1 -1
  17. package/dist/components/Collection/Collection.mjs +1 -1
  18. package/dist/components/Items/CountMenu.mjs +1 -0
  19. package/dist/components/Items/Item.mjs +4 -3
  20. package/dist/components/Items/Items.mjs +30 -10
  21. package/dist/components/Items/PagerLayout.mjs +2 -0
  22. package/dist/components/Items/TargetItems.mjs +1 -1
  23. package/dist/components/Items/masonry.mjs +35 -0
  24. package/dist/components/Panel/About.mjs +25 -8
  25. package/dist/components/Panel/Panel.mjs +47 -59
  26. package/dist/components/Panel/sections.mjs +62 -0
  27. package/dist/components/Root/useRootState.mjs +2 -49
  28. package/dist/components/Scene/SceneView.mjs +13 -2
  29. package/dist/components/Scene/cloverEngine.mjs +2 -1
  30. package/dist/components/Timeline/playerSurface.mjs +2 -0
  31. package/dist/core/clover.mjs +7 -4
  32. package/dist/core/content-state.mjs +5 -3
  33. package/dist/i18n/locales/en.json.mjs +1 -1
  34. package/dist/i18n/locales/es.json.mjs +1 -1
  35. package/dist/i18n/locales/fi.json.mjs +1 -1
  36. package/dist/i18n/locales/fr.json.mjs +1 -1
  37. package/dist/i18n/locales/nb.json.mjs +1 -1
  38. package/dist/i18n/locales/nn.json.mjs +1 -1
  39. package/dist/i18n/locales/no.json.mjs +1 -1
  40. package/dist/i18n/locales/pt.json.mjs +1 -1
  41. package/dist/index.d.mts +178 -56
  42. package/dist/index.mjs +2 -0
  43. package/dist/lib/gltf/load.mjs +26 -6
  44. package/dist/lib/pointer.mjs +1 -1
  45. package/dist/lib/renderer/CanvasRenderer.mjs +44 -32
  46. package/dist/lib/renderer/camera/Camera.mjs +1 -1
  47. package/dist/react/useContentStateOutput.mjs +71 -0
  48. package/dist/styles.css +1 -1
  49. package/dist/templates/default/Default.mjs +42 -128
  50. package/dist/templates/document/Document.mjs +51 -65
  51. package/dist/templates/document/Sheets.mjs +13 -5
  52. package/dist/templates/gallery/Gallery.mjs +94 -18
  53. package/dist/templates/index.d.mts +364 -17
  54. package/dist/templates/shared/Lightbox.mjs +161 -69
  55. package/dist/templates/shared/LightboxView.mjs +123 -0
  56. package/dist/templates/shared/PanelPane.mjs +116 -0
  57. package/dist/templates/{document/DocumentPanel.mjs → shared/PanelPart.mjs} +2 -2
  58. package/dist/templates/shared/dragToClose.mjs +51 -8
  59. package/dist/templates/shared/givenAnnotations.mjs +13 -0
  60. package/dist/templates/shared/useDragToClose.mjs +6 -3
  61. package/dist/templates/shared/useLazyPanelPane.mjs +16 -0
  62. package/dist/templates/shared/useSlide.mjs +6 -0
  63. package/dist/templates.css +1 -1
  64. package/dist/ui/ControlCluster.mjs +15 -17
  65. package/dist/ui/Sections.mjs +3 -3
  66. package/dist/ui/mediaIcons.mjs +35 -8
  67. package/dist/ui/useScrollTrack.mjs +2 -1
  68. package/dist/web-components/About-D1TBGGPL.mjs +1 -0
  69. package/dist/web-components/AnnotationItems-DTacmRA9.mjs +1 -0
  70. package/dist/web-components/{AnnotationMenu-BCwwwfbb.mjs → AnnotationMenu-DYc9ekWS.mjs} +1 -1
  71. package/dist/web-components/{AnnotationState-CavxnAAq.mjs → AnnotationState--5ghW0C2.mjs} +1 -1
  72. package/dist/web-components/{Annotations-rBmeI5sR.mjs → Annotations-BG8lPjk1.mjs} +1 -1
  73. package/dist/web-components/{Annotations-DDjSrBL5.mjs → Annotations-Bvc_FmJ5.mjs} +1 -1
  74. package/dist/web-components/Body-QQ1DmnbP.mjs +1 -0
  75. package/dist/web-components/{BodyAlert-COKp19lq.mjs → BodyAlert-A4xRjOKr.mjs} +1 -1
  76. package/dist/web-components/{Button-DLFYqtz9.mjs → Button-Cx6VE_UW.mjs} +1 -1
  77. package/dist/web-components/{Camera-Cp5ma-6C.mjs → Camera-DqT_1MgD.mjs} +1 -1
  78. package/dist/web-components/{Canvas2DBackend-3PToh87Z.mjs → Canvas2DBackend-TZtR3zHf.mjs} +1 -1
  79. package/dist/web-components/CanvasView-DxZASM9E.mjs +2 -0
  80. package/dist/web-components/CaptionDetails-DMRWmtaY.mjs +1 -0
  81. package/dist/web-components/ChaptersMenu-BAZVVDrK.mjs +1 -0
  82. package/dist/web-components/{Chevron-r-_hUPn8.mjs → Chevron-DFGbSGPI.mjs} +1 -1
  83. package/dist/web-components/ChoiceMenu-C80kdxvq.mjs +1 -0
  84. package/dist/web-components/Collection-B4CxBsFL.mjs +1 -0
  85. package/dist/web-components/{CollectionSelect-CBWUbqQi.mjs → CollectionSelect-DO8YO2p7.mjs} +1 -1
  86. package/dist/web-components/{Connected-BnpxYeJN.mjs → Connected-CcbVqzmj.mjs} +1 -1
  87. package/dist/web-components/{Connected-B2d6EoFl.mjs → Connected-DthCPaHl.mjs} +1 -1
  88. package/dist/web-components/{Connected-BSRM9FJY.mjs → Connected-sYBn_9MK.mjs} +1 -1
  89. package/dist/web-components/{Contents-D7FPxSH-.mjs → Contents-AVPYYXht.mjs} +1 -1
  90. package/dist/web-components/ControlMenu-BjJsWnuZ.mjs +1 -0
  91. package/dist/web-components/ControlsFade-C-6WhSxB.mjs +1 -0
  92. package/dist/web-components/{CountMenu-DyTp_J4k.mjs → CountMenu-Dx8D_RJZ.mjs} +1 -1
  93. package/dist/web-components/Cue-xuo5dgKE.mjs +1 -0
  94. package/dist/web-components/Document-BWdafeEi.mjs +1 -0
  95. package/dist/web-components/{DomLayers-CTGub6wo.mjs → DomLayers-DlRapZ1u.mjs} +1 -1
  96. package/dist/web-components/{Download-BOYNIb7C.mjs → Download-Ci_JUTVd.mjs} +1 -1
  97. package/dist/web-components/{EntryBodies-Bfd2Z42z.mjs → EntryBodies-C0ICfS2R.mjs} +1 -1
  98. package/dist/web-components/{EntryThumbnail-DQE8ajI9.mjs → EntryThumbnail-DxHhfRo_.mjs} +1 -1
  99. package/dist/web-components/{FieldPill-D5DNJWLy.mjs → FieldPill-CVfeeafm.mjs} +1 -1
  100. package/dist/web-components/FrameAnimation-AZpVvu0R.mjs +1 -0
  101. package/dist/web-components/Gallery-C2PTJmvN.mjs +1 -0
  102. package/dist/web-components/{HideToggle-DL911R1Z.mjs → HideToggle-0nlIo-f8.mjs} +1 -1
  103. package/dist/web-components/ImageControls-tKVAMpaj.mjs +1 -0
  104. package/dist/web-components/Items-Drd82_Jj.mjs +1 -0
  105. package/dist/web-components/Label-BIjqJ-_T.mjs +1 -0
  106. package/dist/web-components/{LanguageChoice-DT1UPiDn.mjs → LanguageChoice-DkSc-n6g.mjs} +1 -1
  107. package/dist/web-components/LightboxView-Cuqx2H1m.mjs +1 -0
  108. package/dist/web-components/ListEnd-pq-BgaDI.mjs +1 -0
  109. package/dist/web-components/{Loaded-BWfEBJyg.mjs → Loaded-CSO5NFhm.mjs} +1 -1
  110. package/dist/web-components/LoadedCanvas-DK6xMmM1.mjs +1 -0
  111. package/dist/web-components/LoadedMap-DmPH-LKY.mjs +1 -0
  112. package/dist/web-components/{Loading-zw74TdAz.mjs → Loading-CoJLSRkv.mjs} +1 -1
  113. package/dist/web-components/{Map--dJhk0_0.mjs → Map-BEVtD52O.mjs} +1 -1
  114. package/dist/web-components/MapView-DHJcn9gW.mjs +3 -0
  115. package/dist/web-components/Markup-Hm6bWOjm.mjs +2 -0
  116. package/dist/web-components/MediaBody-BpgNtpKZ.mjs +1 -0
  117. package/dist/web-components/MediaBody-Co23JjUJ.mjs +1 -0
  118. package/dist/web-components/{NavDate-BQHuyLOC.mjs → NavDate-CYNK0Qmp.mjs} +1 -1
  119. package/dist/web-components/{Navigator-B3U21_ti.mjs → Navigator-DrYPepzN.mjs} +1 -1
  120. package/dist/web-components/{Pager-DnJknq92.mjs → Pager-CN4lHURv.mjs} +1 -1
  121. package/dist/web-components/PagerLayout-DeqnSQcF.mjs +1 -0
  122. package/dist/web-components/Panel-CFYUlXup.mjs +1 -0
  123. package/dist/web-components/PanelPart-CpUIRbxr.mjs +1 -0
  124. package/dist/web-components/{PanelToggle-CFtWIeWv.mjs → PanelToggle-9ud55NNI.mjs} +1 -1
  125. package/dist/web-components/{PartOfManifest-F87jIrf9.mjs → PartOfManifest-KUHUq-6q.mjs} +1 -1
  126. package/dist/web-components/{Pending-CYAQajKu.mjs → Pending-mcmdyZPA.mjs} +1 -1
  127. package/dist/web-components/PlaceBox-DX4ZLDat.mjs +1 -0
  128. package/dist/web-components/Placeholder-0hE8q-SY.mjs +1 -0
  129. package/dist/web-components/{Position-BkWBRBfW.mjs → Position-DO5qg5Sp.mjs} +1 -1
  130. package/dist/web-components/{Primitives-BmODPlnK.mjs → Primitives-c9sIz0oQ.mjs} +1 -1
  131. package/dist/web-components/Provider-a3xY016W.mjs +1 -0
  132. package/dist/web-components/{ReadMore-BwGFsLS2.mjs → ReadMore-D_WmmKEP.mjs} +1 -1
  133. package/dist/web-components/Root-CU1o0wje.mjs +1 -0
  134. package/dist/web-components/Scene-CboEeptc.mjs +1 -0
  135. package/dist/web-components/SceneView-hcc78jQT.mjs +1 -0
  136. package/dist/web-components/{Search-CbmK9vLp.mjs → Search-BgxEW1UT.mjs} +1 -1
  137. package/dist/web-components/{Sections-Dy5_pkyQ.mjs → Sections-DZVrhoAC.mjs} +2 -2
  138. package/dist/web-components/{StandaloneItems-BmUnBp0H.mjs → StandaloneItems-6cSw7nbF.mjs} +1 -1
  139. package/dist/web-components/{Status-Dww3Pyf4.mjs → Status-DHTzuTkh.mjs} +1 -1
  140. package/dist/web-components/{Steps-o_UprQfZ.mjs → Steps-Dkpy9KiJ.mjs} +1 -1
  141. package/dist/web-components/{TargetItems-BBOGDubv.mjs → TargetItems-CyOI9_Z4.mjs} +1 -1
  142. package/dist/web-components/Timeline-B9tD3Rar.mjs +1 -0
  143. package/dist/web-components/{Tip-BbexILXs.mjs → Tip-nJSTYquc.mjs} +1 -1
  144. package/dist/web-components/{Transcript-ZVXM3ZDA.mjs → Transcript-WvFFAJQM.mjs} +1 -1
  145. package/dist/web-components/Transport-FxLp_bdW.mjs +1 -0
  146. package/dist/web-components/Transport-VUxSEIQO.mjs +1 -0
  147. package/dist/web-components/{annotation-collection-7SS1ELcO.mjs → annotation-collection-BkC3nBPA.mjs} +1 -1
  148. package/dist/web-components/{annotation-name-CYkZopdd.mjs → annotation-name-Du2KAWoD.mjs} +1 -1
  149. package/dist/web-components/{annotations-content-Bdtn50sf.mjs → annotations-content-CEzAS-P2.mjs} +1 -1
  150. package/dist/web-components/{body-CkOBHlJ0.mjs → body-DPlfbLt3.mjs} +1 -1
  151. package/dist/web-components/canvas-BUwBftJW.mjs +1 -0
  152. package/dist/web-components/cloverEngine-UNw5K4Xg.mjs +164 -0
  153. package/dist/web-components/{content-state-reader-Ahh6artg.mjs → content-state-reader-GgQF2MvJ.mjs} +1 -1
  154. package/dist/web-components/{controls-BJrZVQkS.mjs → controls-CC9G5LxK.mjs} +1 -1
  155. package/dist/web-components/custom-elements.json +191 -45
  156. package/dist/web-components/{downloads-CqVWo-yn.mjs → downloads-CmAYeEIz.mjs} +1 -1
  157. package/dist/web-components/dragToClose-DK-eM097.mjs +1 -0
  158. package/dist/web-components/{engine-B-sscpLa.mjs → engine-Dok0z8WP.mjs} +1 -1
  159. package/dist/web-components/{engines-DfCHjbt3.mjs → engines-BD2IfwQF.mjs} +1 -1
  160. package/dist/web-components/es-B1NvdYp-.mjs +1 -0
  161. package/dist/web-components/{fetchManifest-BIzne1Pj.mjs → fetchManifest-tQXcfFiz.mjs} +1 -1
  162. package/dist/web-components/fi-BjtYZNLo.mjs +1 -0
  163. package/dist/web-components/fr-Cd22Lziw.mjs +1 -0
  164. package/dist/web-components/fromManifest-BwQdeAuL.mjs +1 -0
  165. package/dist/web-components/glyphs-dp_HK3Ja.mjs +1 -0
  166. package/dist/web-components/hooks-C4dJ5K_D.mjs +1 -0
  167. package/dist/web-components/image-layers-xcBsiad9.mjs +1 -0
  168. package/dist/web-components/{imageService-0eTvQ-3h.mjs → imageService-4sFnmAFX.mjs} +1 -1
  169. package/dist/web-components/index-DspT4wUm.mjs +1 -0
  170. package/dist/web-components/index.d.mts +5 -5
  171. package/dist/web-components/index.mjs +1 -1
  172. package/dist/web-components/items-BUmOy2QY.mjs +1 -0
  173. package/dist/web-components/items-CWMI53aN.mjs +1 -0
  174. package/dist/web-components/label-BGjL7I4b.mjs +1 -0
  175. package/dist/web-components/layout-B29v2RKK.mjs +1 -0
  176. package/dist/web-components/{link-GEdiEwlR.mjs → link-Ct5PpHEY.mjs} +1 -1
  177. package/dist/web-components/logo-BFstM-0a.mjs +1 -0
  178. package/dist/web-components/masonry-0QfzOgbB.mjs +1 -0
  179. package/dist/web-components/{models-59cEeiAA.mjs → models-BXcT4ijX.mjs} +1 -1
  180. package/dist/web-components/nb-CEwZDBiR.mjs +1 -0
  181. package/dist/web-components/nn-jYQhr9RI.mjs +1 -0
  182. package/dist/web-components/no-CEwZDBiR.mjs +1 -0
  183. package/dist/web-components/{nodes-CTw9OqlA.mjs → nodes-BleXuYE6.mjs} +1 -1
  184. package/dist/web-components/{overlayImage-BMt4UTlR.mjs → overlayImage-BJtfot4Y.mjs} +1 -1
  185. package/dist/web-components/panClearOfControls-Cn2ZXsZi.mjs +1 -0
  186. package/dist/web-components/{panel-C17Rl9Ya.mjs → panel-BxxV_JkD.mjs} +1 -1
  187. package/dist/web-components/part-D4gjnYmT.mjs +1 -0
  188. package/dist/web-components/playerSurface-BXNLaFk0.mjs +1 -0
  189. package/dist/web-components/pointer-CJELU3gI.mjs +1 -0
  190. package/dist/web-components/{provider-BpxorEiq.mjs → provider-CPp0Sgr_.mjs} +1 -1
  191. package/dist/web-components/pt-CWR30SzS.mjs +1 -0
  192. package/dist/web-components/{range-regions-BGQy4E9U.mjs → range-regions-DAaOu0IS.mjs} +1 -1
  193. package/dist/web-components/{read-more-BDM_6CVc.mjs → read-more-lcqGslUd.mjs} +1 -1
  194. package/dist/web-components/readingLanguages-FyVsSWJ8.mjs +1 -0
  195. package/dist/web-components/rendererSurface-nh6-EfuZ.mjs +22 -0
  196. package/dist/web-components/{renderers-CiB74bQh.mjs → renderers-BFS7hFVU.mjs} +1 -1
  197. package/dist/web-components/{resource-CRbpf9pX.mjs → resource-Bufu7lAr.mjs} +1 -1
  198. package/dist/web-components/{save-file-CCuZEuQr.mjs → save-file-CoknKOPz.mjs} +1 -1
  199. package/dist/web-components/search-5ocrsYmT.mjs +1 -0
  200. package/dist/web-components/shared-DFAX0n3B.mjs +1 -0
  201. package/dist/web-components/{show-link-BXm7SNIC.mjs → show-link-DBaJj4s_.mjs} +1 -1
  202. package/dist/web-components/{sizedImage-k4Q-eyOB.mjs → sizedImage-jnOGcIIZ.mjs} +1 -1
  203. package/dist/web-components/{split-Hp6z-v4h.mjs → split-P6J0qqf5.mjs} +1 -1
  204. package/dist/web-components/{status-BmtuKfAG.mjs → status-honoOMNx.mjs} +1 -1
  205. package/dist/web-components/styles-BwkYiCLC.mjs +1 -0
  206. package/dist/web-components/three.mjs +1 -1
  207. package/dist/web-components/{thumbnail-Dp7a8oom.mjs → thumbnail-EbURh-UM.mjs} +1 -1
  208. package/dist/web-components/{tip-C-oovDZK.mjs → tip-BhNI83aT.mjs} +1 -1
  209. package/dist/web-components/{toggle-C7ODWDEZ.mjs → toggle-CJKdi5KH.mjs} +1 -1
  210. package/dist/web-components/{useContainerName-CrOmY-km.mjs → useContainerName-_48Cdi0m.mjs} +1 -1
  211. package/dist/web-components/useControlsVisibility-CieBxGnK.mjs +1 -0
  212. package/dist/web-components/useLazyPanelPane-Da3kJiOt.mjs +1 -0
  213. package/dist/web-components/{useNearViewport-BqXi9Gn4.mjs → useNearViewport-B34ebmIW.mjs} +1 -1
  214. package/dist/web-components/useScrollTrack-DgRGFeP5.mjs +1 -0
  215. package/dist/web-components/viewer/AnnotationItems-BNA_92Dv.mjs +1 -0
  216. package/dist/web-components/viewer/{AnnotationMenu-DPOSehBo.mjs → AnnotationMenu-BIQYVR4N.mjs} +1 -1
  217. package/dist/web-components/viewer/AnnotationState-BbwQqA1U.mjs +1 -0
  218. package/dist/web-components/viewer/Annotations-CZzOZAFP.mjs +2 -0
  219. package/dist/web-components/viewer/Annotations-P4XzAlNc.mjs +1 -0
  220. package/dist/web-components/viewer/{Canvas2DBackend-BTK6ZJh0.mjs → Canvas2DBackend-DFfCzyjL.mjs} +1 -1
  221. package/dist/web-components/viewer/CaptionDetails-DPtE-RQQ.mjs +1 -0
  222. package/dist/web-components/viewer/ChaptersMenu-D6Jmujag.mjs +1 -0
  223. package/dist/web-components/viewer/{ChoiceMenu-DQ1x572Y.mjs → ChoiceMenu-GkqyTQRQ.mjs} +1 -1
  224. package/dist/web-components/viewer/Collection-DjY_6qa6.mjs +1 -0
  225. package/dist/web-components/viewer/Connected-D5T-mtiy.mjs +1 -0
  226. package/dist/web-components/viewer/Connected-DIOuI3Mv.mjs +1 -0
  227. package/dist/web-components/viewer/Contents-DV-VxXuf.mjs +1 -0
  228. package/dist/web-components/viewer/ControlMenu-BsEpff6N.mjs +1 -0
  229. package/dist/web-components/viewer/ControlsFade-BowtN96W.mjs +1 -0
  230. package/dist/web-components/viewer/{CountMenu-4u6U6yqb.mjs → CountMenu-DCmA6HdK.mjs} +1 -1
  231. package/dist/web-components/viewer/Cue-BjbVzrpl.mjs +1 -0
  232. package/dist/web-components/viewer/Document-4ZQd3W3o.mjs +1 -0
  233. package/dist/web-components/viewer/{DomLayers-CGkDtemL.mjs → DomLayers-BCwCxPDU.mjs} +1 -1
  234. package/dist/web-components/viewer/Download-CL4IClAD.mjs +1 -0
  235. package/dist/web-components/viewer/EntryBodies-e40y47bl.mjs +1 -0
  236. package/dist/web-components/viewer/EntryThumbnail-B_dP3w4o.mjs +1 -0
  237. package/dist/web-components/viewer/{FieldPill-DFXGWrvB.mjs → FieldPill-Hse1cDBE.mjs} +1 -1
  238. package/dist/web-components/viewer/FrameAnimation-CE218DCr.mjs +1 -0
  239. package/dist/web-components/viewer/Gallery-F2sVj4ph.mjs +1 -0
  240. package/dist/web-components/viewer/{HideToggle-DP5kHzWM.mjs → HideToggle-CYoqe_ez.mjs} +1 -1
  241. package/dist/web-components/viewer/ImageControls-C2G4x2Es.mjs +1 -0
  242. package/dist/web-components/viewer/LanguageChoice-BmO-322r.mjs +1 -0
  243. package/dist/web-components/viewer/LightboxView-DKR8dXcg.mjs +1 -0
  244. package/dist/web-components/viewer/ListEnd-DX1jsvJk.mjs +1 -0
  245. package/dist/web-components/viewer/{MapView-BN9wXQKV.mjs → MapView-Df0wZjCh.mjs} +2 -2
  246. package/dist/web-components/viewer/MediaBody-CataNonO.mjs +1 -0
  247. package/dist/web-components/viewer/MediaBody-SkIgrEMj.mjs +1 -0
  248. package/dist/web-components/viewer/{NavDate-C2-wwLuB.mjs → NavDate-BZgeaMG9.mjs} +1 -1
  249. package/dist/web-components/viewer/{Navigator-C3jghOd3.mjs → Navigator-Co76p-1n.mjs} +1 -1
  250. package/dist/web-components/viewer/PagerLayout-tUkN1-FV.mjs +1 -0
  251. package/dist/web-components/viewer/PanelPart-Cl4Sst60.mjs +1 -0
  252. package/dist/web-components/viewer/{PartOfManifest-D22yMgCf.mjs → PartOfManifest-DXnbEPzS.mjs} +1 -1
  253. package/dist/web-components/viewer/PlaceBox-xrJ4CGdN.mjs +1 -0
  254. package/dist/web-components/viewer/Placeholder-B1AcizHL.mjs +1 -0
  255. package/dist/web-components/viewer/Search-DTg1cHZ3.mjs +1 -0
  256. package/dist/web-components/viewer/StandaloneItems-BpBEQG8i.mjs +1 -0
  257. package/dist/web-components/viewer/{Steps-Bw32X5xO.mjs → Steps-SpwMQdCL.mjs} +1 -1
  258. package/dist/web-components/viewer/{TargetItems-DLhUH1Gq.mjs → TargetItems-B6Icep5k.mjs} +1 -1
  259. package/dist/web-components/viewer/Transcript-rTAhuXCF.mjs +1 -0
  260. package/dist/web-components/viewer/Transport-vKIDALE-.mjs +1 -0
  261. package/dist/web-components/viewer/Transport-z_kdVisw.mjs +1 -0
  262. package/dist/web-components/viewer/annotation-collection-B7pZiLVk.mjs +1 -0
  263. package/dist/web-components/viewer/annotation-name-BKj1O9lA.mjs +1 -0
  264. package/dist/web-components/viewer/{annotations-content-CbA3eOIC.mjs → annotations-content-9AtLlPNn.mjs} +1 -1
  265. package/dist/web-components/viewer/cloverEngine-jRrYLrWa.mjs +164 -0
  266. package/dist/web-components/viewer/{content-state-reader-C7UBMOq3.mjs → content-state-reader-CPvkju6Q.mjs} +1 -1
  267. package/dist/web-components/viewer/dragToClose-Co9kGk9q.mjs +1 -0
  268. package/dist/web-components/viewer/{fetchManifest-C2Yxg3x9.mjs → fetchManifest-D7N9WhhF.mjs} +1 -1
  269. package/dist/web-components/viewer/{host-CZeyjCKR.mjs → host-DMD9LE4H.mjs} +1 -1
  270. package/dist/web-components/viewer/image-layers-x_shzPvu.mjs +1 -0
  271. package/dist/web-components/viewer/index.mjs +1 -1
  272. package/dist/web-components/viewer/{link-DssZ0Z2N.mjs → link-DikPGzNO.mjs} +1 -1
  273. package/dist/web-components/viewer/overlayImage-33kKKB0T.mjs +1 -0
  274. package/dist/web-components/viewer/range-regions-TH6WWGTT.mjs +1 -0
  275. package/dist/web-components/viewer/{renderers-DLoqv3QO.mjs → renderers-BxePmixF.mjs} +1 -1
  276. package/dist/web-components/viewer/{save-file-CJT5p5Hg.mjs → save-file-QXKiPlST.mjs} +1 -1
  277. package/dist/web-components/viewer/{search-PhOwMKHi.mjs → search-B_NePyas.mjs} +1 -1
  278. package/dist/web-components/viewer/styles-Bedyz7_l.mjs +1 -0
  279. package/dist/web-components/viewer/useControlsVisibility-Cu-jTDzs.mjs +1 -0
  280. package/dist/web-components/viewer/useLazyPanelPane-BhLtRixT.mjs +1 -0
  281. package/dist/web-components/viewer/viewer-nfPJPwwt.mjs +29 -0
  282. package/dist/web-components/viewer/{vtt-1Pk7Dhsj.mjs → vtt-CUn4h5JB.mjs} +1 -1
  283. package/dist/web-components/viewer-DN2Mo3vc.mjs +1 -0
  284. package/dist/web-components/{vtt-CacHieeN.mjs → vtt-C5M5WPSG.mjs} +1 -1
  285. package/package.json +1 -1
  286. package/dist/templates/shared/LightboxBody.mjs +0 -9
  287. package/dist/web-components/About-DhOGPFaI.mjs +0 -1
  288. package/dist/web-components/AnnotationItems-CNP4CJiT.mjs +0 -1
  289. package/dist/web-components/Body-DaY1UJIy.mjs +0 -1
  290. package/dist/web-components/BodyUnloadable-DcTM7hHF.mjs +0 -1
  291. package/dist/web-components/CanvasView-BWQ4SK2b.mjs +0 -2
  292. package/dist/web-components/CaptionDetails-DSziiuQV.mjs +0 -1
  293. package/dist/web-components/ChoiceMenu-DTuEEUeM.mjs +0 -1
  294. package/dist/web-components/Collection-B9swJtPW.mjs +0 -1
  295. package/dist/web-components/ControlMenu-Crtho2cs.mjs +0 -1
  296. package/dist/web-components/Cue-CbZaGwZh.mjs +0 -1
  297. package/dist/web-components/Document-BfltLWZZ.mjs +0 -1
  298. package/dist/web-components/DocumentPanel-ZSe40cV4.mjs +0 -1
  299. package/dist/web-components/FrameAnimation-IfR1czfc.mjs +0 -1
  300. package/dist/web-components/Gallery-DD06BDQo.mjs +0 -1
  301. package/dist/web-components/Items-BHzT9A73.mjs +0 -1
  302. package/dist/web-components/Label-KabnxuMN.mjs +0 -1
  303. package/dist/web-components/LightboxBody-BhRhdXo6.mjs +0 -1
  304. package/dist/web-components/ListEnd-CbwNlty-.mjs +0 -1
  305. package/dist/web-components/LoadedCanvas-CdZ5WOWz.mjs +0 -1
  306. package/dist/web-components/LoadedMap-DQyQVRVQ.mjs +0 -1
  307. package/dist/web-components/MapView-duA5WGsu.mjs +0 -3
  308. package/dist/web-components/Markup-D-kioDf9.mjs +0 -2
  309. package/dist/web-components/MediaBody-CoOiVXcv.mjs +0 -1
  310. package/dist/web-components/MediaBody-d8ErTuwT.mjs +0 -1
  311. package/dist/web-components/PagerLayout-CvOmKtSW.mjs +0 -1
  312. package/dist/web-components/Panel-CIdjOznL.mjs +0 -1
  313. package/dist/web-components/PlaceBox-BtIbIotm.mjs +0 -1
  314. package/dist/web-components/Placeholder-TIyj4ZjR.mjs +0 -1
  315. package/dist/web-components/Provider-C8se8i4I.mjs +0 -1
  316. package/dist/web-components/Root-CAJB0-Mh.mjs +0 -1
  317. package/dist/web-components/Scene-Ctcdt7CD.mjs +0 -1
  318. package/dist/web-components/SceneView-B6bEx_7x.mjs +0 -1
  319. package/dist/web-components/Timeline-CfIF4APc.mjs +0 -1
  320. package/dist/web-components/canvas-CWf_Fag8.mjs +0 -1
  321. package/dist/web-components/cloverEngine-6djEHNCD.mjs +0 -164
  322. package/dist/web-components/dragToClose-C-Pf1IeO.mjs +0 -1
  323. package/dist/web-components/es-BYfHUZ7P.mjs +0 -1
  324. package/dist/web-components/fi-B5y2qr8T.mjs +0 -1
  325. package/dist/web-components/fr-ChezCx6V.mjs +0 -1
  326. package/dist/web-components/fromManifest-gg5Wx14y.mjs +0 -1
  327. package/dist/web-components/glyphs-JYl2STEr.mjs +0 -1
  328. package/dist/web-components/hooks-x7rO95CS.mjs +0 -1
  329. package/dist/web-components/image-layers-BjbeyHBS.mjs +0 -1
  330. package/dist/web-components/index-BZ7b9k0N.mjs +0 -1
  331. package/dist/web-components/items-CnAIl9fS.mjs +0 -1
  332. package/dist/web-components/items-F6hJgdAS.mjs +0 -1
  333. package/dist/web-components/label-CI88KH2_.mjs +0 -1
  334. package/dist/web-components/layout-De1MOSYe.mjs +0 -1
  335. package/dist/web-components/logo-Ckwj7FlP.mjs +0 -1
  336. package/dist/web-components/nb-8J22f9Td.mjs +0 -1
  337. package/dist/web-components/nn-Dv1EvzI1.mjs +0 -1
  338. package/dist/web-components/no-8J22f9Td.mjs +0 -1
  339. package/dist/web-components/panClearOfControls-ac9uf-Qs.mjs +0 -1
  340. package/dist/web-components/part-CXts97_M.mjs +0 -1
  341. package/dist/web-components/playerSurface-HYwEwPK6.mjs +0 -1
  342. package/dist/web-components/pt-DWYQkATt.mjs +0 -1
  343. package/dist/web-components/readingLanguages-fs_HqvqQ.mjs +0 -1
  344. package/dist/web-components/rendererSurface-C0aKlE0v.mjs +0 -22
  345. package/dist/web-components/search-CkM0O0Z1.mjs +0 -1
  346. package/dist/web-components/shared-MTsMddHx.mjs +0 -1
  347. package/dist/web-components/styles-CZV1nbBQ.mjs +0 -1
  348. package/dist/web-components/useScrollTrack-CEsOU2yT.mjs +0 -1
  349. package/dist/web-components/viewer/AnnotationItems-CyhVcRFc.mjs +0 -1
  350. package/dist/web-components/viewer/AnnotationState-Bjztkobn.mjs +0 -1
  351. package/dist/web-components/viewer/Annotations-Dh_8Tzi0.mjs +0 -2
  352. package/dist/web-components/viewer/Annotations-wwuOCxzI.mjs +0 -1
  353. package/dist/web-components/viewer/CaptionDetails-BwCTovy_.mjs +0 -1
  354. package/dist/web-components/viewer/Collection-DSBxCmXw.mjs +0 -1
  355. package/dist/web-components/viewer/Connected-CL3N8F2J.mjs +0 -1
  356. package/dist/web-components/viewer/Connected-DTk1jlyI.mjs +0 -1
  357. package/dist/web-components/viewer/Contents-DrXckx7d.mjs +0 -1
  358. package/dist/web-components/viewer/ControlMenu-Bp91s-g_.mjs +0 -1
  359. package/dist/web-components/viewer/Cue-C-aF8peC.mjs +0 -1
  360. package/dist/web-components/viewer/Document-BN1rICu3.mjs +0 -1
  361. package/dist/web-components/viewer/DocumentPanel-CEesxdeY.mjs +0 -1
  362. package/dist/web-components/viewer/Download-CawEl9MN.mjs +0 -1
  363. package/dist/web-components/viewer/EntryBodies-nYHMwSSM.mjs +0 -1
  364. package/dist/web-components/viewer/EntryThumbnail-DrO_0SzR.mjs +0 -1
  365. package/dist/web-components/viewer/FrameAnimation-CZfzpxaD.mjs +0 -1
  366. package/dist/web-components/viewer/Gallery-MWHtvjti.mjs +0 -1
  367. package/dist/web-components/viewer/LanguageChoice-C50T7dPI.mjs +0 -1
  368. package/dist/web-components/viewer/LightboxBody-C2T7IC29.mjs +0 -1
  369. package/dist/web-components/viewer/ListEnd-BDuOx__m.mjs +0 -1
  370. package/dist/web-components/viewer/MediaBody-CEyswliX.mjs +0 -1
  371. package/dist/web-components/viewer/MediaBody-Dw3DWDjc.mjs +0 -1
  372. package/dist/web-components/viewer/PagerLayout-Cg2NpqoD.mjs +0 -1
  373. package/dist/web-components/viewer/PlaceBox-Dckw4Sfk.mjs +0 -1
  374. package/dist/web-components/viewer/Placeholder-NYVWYg5Q.mjs +0 -1
  375. package/dist/web-components/viewer/Search-DC259m4f.mjs +0 -1
  376. package/dist/web-components/viewer/StandaloneItems-E4kpMne9.mjs +0 -1
  377. package/dist/web-components/viewer/Transcript-D_VGJQxn.mjs +0 -1
  378. package/dist/web-components/viewer/annotation-collection-DZHa18ir.mjs +0 -1
  379. package/dist/web-components/viewer/annotation-name-BaNdW2Xk.mjs +0 -1
  380. package/dist/web-components/viewer/cloverEngine-C04bCSFR.mjs +0 -164
  381. package/dist/web-components/viewer/image-layers-B09fporZ.mjs +0 -1
  382. package/dist/web-components/viewer/overlayImage-BR3eJCKq.mjs +0 -1
  383. package/dist/web-components/viewer/range-regions-By6L5JOK.mjs +0 -1
  384. package/dist/web-components/viewer/styles-NZLnZPAC.mjs +0 -1
  385. package/dist/web-components/viewer/viewer-D30YHqyF.mjs +0 -29
  386. package/dist/web-components/viewer-CH7re5OO.mjs +0 -1
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { useState, useEffect } from "react";
3
+ import { usePanelPane } from "./PanelPane.mjs";
4
+ const loadPanel = () => import("./PanelPart.mjs");
5
+ function useLazyPanelPane(options) {
6
+ const [Part, setPart] = useState();
7
+ const load = () => loadPanel().then((module) => setPart(() => module.default));
8
+ const pane = usePanelPane({ ...options, panel: Part, load });
9
+ useEffect(() => {
10
+ if (pane.open && !Part) void load();
11
+ }, [pane.open]);
12
+ return pane;
13
+ }
14
+ export {
15
+ useLazyPanelPane
16
+ };
@@ -1,6 +1,9 @@
1
1
  "use client";
2
2
  import { useState, useEffect, useLayoutEffect } from "react";
3
3
  const SLIDE_MS = 240;
4
+ const PAGE_MIN = "16rem";
5
+ const PANEL_MIN = "14rem";
6
+ const BESIDE_REM = 16 + 14 + 1;
4
7
  function useSlide(want) {
5
8
  const [mounted, setMounted] = useState(want);
6
9
  const [open, setOpen] = useState(want);
@@ -45,6 +48,9 @@ function useWideEnough(element, rem) {
45
48
  return wide;
46
49
  }
47
50
  export {
51
+ BESIDE_REM,
52
+ PAGE_MIN,
53
+ PANEL_MIN,
48
54
  SLIDE_MS,
49
55
  panelFocus,
50
56
  useSlide,
@@ -1 +1 @@
1
- @layer clover{.clover-template-lightbox{width:min(96vw,72rem);max-height:94vh;padding:0;border:0;border-radius:var(--clover-radius, 3px);background:var(--clover-color-secondary, #fff);color:var(--clover-color-primary, #1a1d1e);box-shadow:0 8px 40px #00000059}.clover-template-lightbox::backdrop{background:#0009}.clover-template-lightbox-content{display:flex;flex-direction:column;gap:var(--clover-space-m);padding:var(--clover-inset);--clover-body-height: min(70vh, 48rem)}.clover-template-lightbox-pending{height:var(--clover-body-height, 60vh);background-color:#0001}.clover-template-lightbox-header{display:flex;align-items:center;gap:var(--clover-space-m)}.clover-template-lightbox-title{flex:1 1 auto;min-width:0;margin:0;font-size:var(--clover-text-l);font-weight:700}button.clover-template-lightbox-close{display:inline-flex;align-items:center;justify-content:center;width:var(--clover-control);height:var(--clover-control);padding:0;border:0;border-radius:var(--clover-radius-pill, 2rem);background:var(--clover-color-secondary-muted, #f1f1f1);color:inherit;cursor:pointer}button.clover-template-lightbox-close:is(:hover,:focus-visible){background:var(--clover-color-accent, #0065c3);color:var(--clover-color-control-glyph, #fff)}:where([data-high-contrast]) button.clover-template-lightbox-close:is(:hover,:focus-visible){background:var(--clover-accent-fill)}:where([data-high-contrast]) button.clover-template-lightbox-close:hover:not(:focus-visible){outline:var(--clover-accent-ring-hover);outline-offset:1px}.clover-template-document{--clover-template-document-height: min(85vh, 56rem);display:flex;flex-direction:column;height:var(--clover-template-document-height);overflow:hidden;background-color:var(--clover-color-secondary, #fff);color:var(--clover-color-primary, #1a1d1e)}.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;margin:0;font-size:var(--clover-text-l);line-height:1.25;font-weight:400;overflow-wrap:anywhere}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:0}.clover-template-document-sidebar{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}.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-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-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]) .clover-canvas-viewport{touch-action:pan-y}.clover-template-document-panel{contain:size;overflow-y:auto;overscroll-behavior:contain;background-color:var(--clover-color-secondary, #fff)}.clover-template-document-panel[hidden]{display:none}.clover-template-document-scrim[data-for=sidebar]{z-index:2}.clover-template-document{--clover-grip: color-mix( in srgb, var(--clover-color-primary-muted, #26292b) 30%, transparent )}.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);background:linear-gradient(var(--clover-grip),var(--clover-grip)) no-repeat right var(--clover-space-2xs) center / 4px var(--clover-space-xl),var(--clover-color-secondary, #fff);touch-action:pan-y;box-shadow:var(--clover-space-s) 0 var(--clover-space-l) #0000001f}.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)}.clover-template-gallery{display:flex;flex-direction:column;gap:var(--clover-space-m);color:var(--clover-color-primary, #1a1d1e)}.clover-template-gallery-header{display:flex;flex-direction:column;gap:var(--clover-space-2xs)}.clover-template-gallery-title{margin:0;font-size:var(--clover-text-l);line-height:1.25;font-weight:700}.clover-template-gallery-summary{margin:0}}
1
+ @layer clover{.clover-template-lightbox{position:absolute;inset:0;z-index:10;padding:var(--clover-template-lightbox-inset, 0);background:var(--clover-template-lightbox-backdrop, transparent)}.clover-template-lightbox[hidden]{display:none}.clover-template-lightbox-content{position:sticky;top:calc(var(--clover-template-lightbox-top, 0px) + var(--clover-template-lightbox-inset, 0px));box-sizing:border-box;display:flex;flex-direction:column;gap:var(--clover-space-m);height:min(100%,calc(100vh - var(--clover-template-lightbox-top, 0px) - 2 * var(--clover-template-lightbox-inset, 0px)));padding:var(--clover-inset);border-radius:var(--clover-template-lightbox-radius, 0);background:var(--clover-color-secondary, #fff);color:var(--clover-color-primary, #1a1d1e);--clover-body-height: min(70vh, 48rem)}@supports (height: 1svh){.clover-template-lightbox-content{height:min(100%,calc(100svh - var(--clover-template-lightbox-top, 0px) - 2 * var(--clover-template-lightbox-inset, 0px)));--clover-body-height: min(70svh, 48rem)}}.clover-template-lightbox-content>.clover-template-lightbox-panes{flex:1 1 auto;min-height:0}.clover-template-lightbox-main{display:flex;flex-direction:column;gap:var(--clover-space-m);min-height:0}.clover-template-lightbox-main>.clover-template-lightbox-body{flex:1 1 auto;min-height:0}.clover-template-lightbox-main>.clover-items[data-layout=slider]{flex:none;--clover-items-height: 4rem;--clover-items-lines: 1}.clover-template-lightbox-pending{height:var(--clover-body-height, 60vh);background-color:#0001}.clover-template-lightbox-header{display:flex;align-items:center;gap:var(--clover-space-m)}.clover-template-lightbox-title{flex:1 1 auto;min-width:0}.clover-template-lightbox-caption{flex:none;margin:calc(var(--clover-space-xs) - var(--clover-space-m)) 0 0;overflow-wrap:anywhere}.clover-template-lightbox-back:dir(rtl) svg{transform:scaleX(-1)}button:is(.clover-template-lightbox-back,.clover-template-lightbox-close){flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--clover-control);height:var(--clover-control);padding:0;border:0;border-radius:var(--clover-radius-pill, 2rem);background:transparent;color:inherit;cursor:pointer}button:is(.clover-template-lightbox-back,.clover-template-lightbox-close):is(:hover,:focus-visible){background:var(--clover-color-accent, #0065c3);color:var(--clover-color-control-glyph, #fff)}:where([data-high-contrast]) button:is(.clover-template-lightbox-back,.clover-template-lightbox-close):is(:hover,:focus-visible){background:var(--clover-accent-fill)}:where([data-high-contrast]) button:is(.clover-template-lightbox-back,.clover-template-lightbox-close):hover:not(:focus-visible){outline:var(--clover-accent-ring-hover);outline-offset:1px}.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)}.clover-template-gallery{position:relative;isolation:isolate;display:flex;flex-direction:column;gap:var(--clover-space-l);padding:var(--clover-inset);color:var(--clover-color-primary, #1a1d1e)}.clover-template-gallery[data-height=fixed]{box-sizing:border-box;height:var(--clover-template-gallery-height)}.clover-template-gallery[data-height=fixed]>.clover-items{flex:1 1 auto;min-height:0;overflow:auto;margin:calc(-1 * var(--clover-items-ring-room, 4px));padding:var(--clover-items-ring-room, 4px)}.clover-template-gallery-header{flex:none;display:flex;flex-direction:column;gap:var(--clover-space-2xs)}.clover-template-gallery-summary{margin:0;--clover-summary-lines: 2}.clover-template-gallery .clover-items{--clover-items-gap: var(--clover-template-gallery-gap, var(--clover-inset));--clover-items-lines: none}}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { jsxs, jsx } from "react/jsx-runtime";
3
- import { useState } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useState, useCallback } from "react";
4
4
  import Button from "./Button.mjs";
5
5
  import { Tip } from "./Tip.mjs";
6
6
  import { ControlIcon } from "./controlGlyphs.mjs";
@@ -56,31 +56,29 @@ function renderControl({
56
56
  );
57
57
  }
58
58
  const ControlCluster = ({
59
- controls,
60
- controlButtons,
61
- hasPlaceholder = false,
59
+ fit = false,
60
+ clusterRef,
62
61
  children
63
62
  }) => {
64
63
  const [element, setElement] = useState(null);
65
64
  const isFullscreen = useWithinFullscreen(element);
66
65
  useClusterReach(element);
67
- const specs = controls(isFullscreen);
68
- const ordered = [
69
- ...specs.filter((spec) => spec.key !== "fullPage"),
70
- ...specs.filter((spec) => spec.key === "fullPage")
71
- ];
72
- return /* @__PURE__ */ jsxs(
66
+ const ref = useCallback(
67
+ (node) => {
68
+ setElement(node);
69
+ clusterRef == null ? void 0 : clusterRef(node);
70
+ },
71
+ [clusterRef]
72
+ );
73
+ return /* @__PURE__ */ jsx(
73
74
  "div",
74
75
  {
75
76
  className: "clover-canvas-controls",
77
+ "data-fit": fit || void 0,
76
78
  "data-fullscreen": isFullscreen,
77
- "data-has-placeholder": hasPlaceholder,
78
79
  "data-testid": "clover-canvas-controls",
79
- ref: setElement,
80
- children: [
81
- ordered.map((spec) => renderControl(spec, controlButtons)),
82
- children
83
- ]
80
+ ref,
81
+ children
84
82
  }
85
83
  );
86
84
  };
@@ -211,7 +211,7 @@ function Sections({
211
211
  "button",
212
212
  {
213
213
  type: "button",
214
- className: `clover-sections-scroll-${step}`,
214
+ className: `clover-steps-step clover-sections-scroll-${step}`,
215
215
  "aria-hidden": "true",
216
216
  tabIndex: -1,
217
217
  hidden: !more,
@@ -224,8 +224,8 @@ function Sections({
224
224
  {
225
225
  "aria-hidden": "true",
226
226
  focusable: "false",
227
- width: "16",
228
- height: "16",
227
+ width: "12",
228
+ height: "12",
229
229
  viewBox: "0 0 16 16",
230
230
  children: /* @__PURE__ */ jsx(
231
231
  "path",
@@ -75,27 +75,54 @@ const CaptionsIcon = ({ on = false }) => /* @__PURE__ */ jsxs("svg", { ...svgPro
75
75
  }
76
76
  )
77
77
  ] });
78
- const ChaptersIcon = () => /* @__PURE__ */ jsxs("svg", { ...svgProps, children: [
78
+ const Frame = () => /* @__PURE__ */ jsx(
79
+ "rect",
80
+ {
81
+ x: "40",
82
+ y: "104",
83
+ width: "432",
84
+ height: "304",
85
+ rx: "56",
86
+ fill: "none",
87
+ stroke: "currentColor",
88
+ strokeWidth: "36"
89
+ }
90
+ );
91
+ const FillIcon = () => /* @__PURE__ */ jsxs("svg", { ...svgProps, children: [
92
+ /* @__PURE__ */ jsx(Frame, {}),
79
93
  /* @__PURE__ */ jsx(
80
94
  "path",
81
95
  {
82
- d: "M160 144h288M160 256h288M160 368h288",
96
+ d: "M204 208l-48 48 48 48M308 208l48 48-48 48",
83
97
  fill: "none",
84
98
  stroke: "currentColor",
85
99
  strokeLinecap: "round",
86
- strokeWidth: "32"
100
+ strokeLinejoin: "round",
101
+ strokeWidth: "36"
87
102
  }
88
- ),
89
- /* @__PURE__ */ jsx("circle", { cx: "80", cy: "144", r: "20" }),
90
- /* @__PURE__ */ jsx("circle", { cx: "80", cy: "256", r: "20" }),
91
- /* @__PURE__ */ jsx("circle", { cx: "80", cy: "368", r: "20" })
103
+ )
104
+ ] });
105
+ const FitIcon = () => /* @__PURE__ */ jsxs("svg", { ...svgProps, children: [
106
+ /* @__PURE__ */ jsx(Frame, {}),
107
+ /* @__PURE__ */ jsx(
108
+ "path",
109
+ {
110
+ d: "M140 208l48 48-48 48M372 208l-48 48 48 48",
111
+ fill: "none",
112
+ stroke: "currentColor",
113
+ strokeLinecap: "round",
114
+ strokeLinejoin: "round",
115
+ strokeWidth: "36"
116
+ }
117
+ )
92
118
  ] });
93
119
  const FullScreenIcon = () => /* @__PURE__ */ jsx("svg", { ...svgProps, children: /* @__PURE__ */ jsx(ZoomFullScreen, {}) });
94
120
  const ExitFullScreenIcon = () => /* @__PURE__ */ jsx("svg", { ...svgProps, children: /* @__PURE__ */ jsx(ZoomExitFullScreen, {}) });
95
121
  export {
96
122
  CaptionsIcon,
97
- ChaptersIcon,
98
123
  ExitFullScreenIcon,
124
+ FillIcon,
125
+ FitIcon,
99
126
  FullScreenIcon,
100
127
  PauseIcon,
101
128
  PlayIcon,
@@ -64,7 +64,7 @@ function useScrollTrack({
64
64
  const slide = viewport == null ? void 0 : viewport.querySelector(
65
65
  `[data-track-index="${index}"]`
66
66
  );
67
- if (!viewport || !slide) return;
67
+ if (!viewport || !slide) return false;
68
68
  const box = viewport.getBoundingClientRect();
69
69
  const rect = slide.getBoundingClientRect();
70
70
  const rtl = getComputedStyle(viewport).direction === "rtl";
@@ -72,6 +72,7 @@ function useScrollTrack({
72
72
  alignment.current === "center" ? rect.left + rect.width / 2 - (box.left + box.width / 2) : rtl ? rect.right - box.right : rect.left - box.left,
73
73
  instant
74
74
  );
75
+ return true;
75
76
  },
76
77
  [viewport, scrollAlong]
77
78
  );
@@ -0,0 +1 @@
1
+ import{Q as I,u as e,z as p,P as g,x as T,a as $,c as M,A as _,y as F,b as H,W as D,l as k}from"./shared-DFAX0n3B.mjs";import{j as G}from"./classnames-DukgfdpI.mjs";import{u as V}from"./readingLanguages-FyVsSWJ8.mjs";import{Thumbnail as W,Summary as O,Metadata as B,RequiredStatement as Q,Rights as U,Homepage as E,SeeAlso as J,Id as X}from"./Primitives-c9sIz0oQ.mjs";import{u as Y}from"./downloads-CmAYeEIz.mjs";import{P as Z}from"./Provider-a3xY016W.mjs";import{a as K,t as ee}from"./heading-Cjt0f-Eu.mjs";import{L as te}from"./Label-BIjqJ-_T.mjs";import{r as oe}from"./dates-DR3gfcON.mjs";import"./styles-BwkYiCLC.mjs";const ae=p(()=>import("./LanguageChoice-DkSc-n6g.mjs").then(o=>({default:o.LanguageChoice}))),re=I(false);function ne({part:o}){const r=V();return r?e(g,{fallback:null,children:e(ae,{...r,nameKey:"readingLanguage",part:o})}):null}const le=p(()=>import("./Download-Ci_JUTVd.mjs").then(({DownloadGroups:o})=>({default:o}))),se=p(()=>import("./NavDate-CYNK0Qmp.mjs").then(o=>o.a).then(({NavDate:o})=>({default:o}))),ce=p(()=>import("./PartOfManifest-KUHUq-6q.mjs"));function ue({languages:o=true,...r}){const n=T(re);return e(ie,{...r,download:!n&&r.download!==false,choice:n||!o?null:e(ne,{part:"clover-about"})})}function ie({choice:o,canvasSummary:r=false,headingLevel:n=3,download:C=true,thumbnail:y=true,label:b=true,className:q,...R}){const{t:x,langOf:L}=$(),f=Y(),a=M(t=>t.manifest,Object.is,"About"),P=_(null);F(()=>{const t=P.current,s=t==null?void 0:t.querySelector(".clover-about-head");if(!t||!s||typeof ResizeObserver>"u")return;const c=new Set,u=()=>{const A=s.querySelector(".clover-about-thumbnail"),h=s.querySelector(".clover-about-label");for(const v of[A,h])v&&!c.has(v)&&(c.add(v),d.observe(v));const i=t.style;if(!A){i.removeProperty("--clover-about-label-height"),i.removeProperty("--clover-about-thumbnail-width");return}const N=`${(h==null?void 0:h.offsetHeight)??0}px`,S=`${A.offsetWidth}px`;i.getPropertyValue("--clover-about-label-height")!==N&&i.setProperty("--clover-about-label-height",N),i.getPropertyValue("--clover-about-thumbnail-width")!==S&&i.setProperty("--clover-about-thumbnail-width",S)};let m=0;const d=new ResizeObserver(()=>{cancelAnimationFrame(m),m=requestAnimationFrame(u)});return d.observe(s),u(),()=>{cancelAnimationFrame(m),d.disconnect(),t.style.removeProperty("--clover-about-label-height"),t.style.removeProperty("--clover-about-thumbnail-width")}},[b,y,a]);const j=H(),z=()=>{var c,u;const t=P.current;(u=((c=t==null?void 0:t.closest(".clover-sections-item"))==null?void 0:c.querySelector(".clover-sections-button"))??t)==null||u.focus({preventScroll:true})};if(!a)return null;const l=(t,s,c)=>{if(!s)return null;const{as:u,title:m,group:d}=ee(n,`${j}-${t}`);return e("section",{className:"clover-about-section",...d,children:[e(u,{className:"clover-about-heading",...k(L(t)),...m,children:x(t)}),c]})},w=t=>Array.isArray(a[t])?a[t].length>0:!!a[t];return e("div",{ref:P,className:G("clover-about",q),tabIndex:-1,...R,children:[o,(y||b)&&e("div",{className:"clover-about-head",children:[y&&e(W,{className:"clover-about-thumbnail",size:256,alt:b?"":void 0}),b&&e(te,{as:K(n),className:"clover-about-label clover-title"})]}),r&&e(O,{of:"canvas",className:"clover-about-summary"}),D(a)&&a.partOf&&e(g,{fallback:null,children:e(ce,{manifest:a,headingLevel:n,onOpened:z})}),e(O,{className:"clover-about-summary"}),e(B,{className:"clover-about-metadata"}),e(Q,{className:"clover-about-metadata"}),l("aboutDate",oe(a.navDate),e(g,{fallback:null,children:e(se,{value:a.navDate,className:"clover-about-date"})})),l("aboutProvider",w("provider"),e(Z,{})),l("aboutRights",a.rights,e(U,{})),l("aboutHomepage",w("homepage"),e(E,{})),l("aboutSeeAlso",w("seeAlso"),e(J,{})),l("download",C&&f.page.length+f.all.length>0,e(g,{fallback:null,children:e(le,{page:f.page,all:f.all,headingLevel:n+1})})),l(D(a)?"aboutCanvas":"aboutManifest",a.id,e(X,{}))]})}const we=Object.freeze(Object.defineProperty({__proto__:null,About:ue},Symbol.toStringTag,{value:"Module"}));export{ue as A,re as I,we as a};
@@ -0,0 +1 @@
1
+ import{e as P,c as v,ag as _,T as E,G as O,A as R,y as T,u as f,k,d as q,Z as F}from"./shared-DFAX0n3B.mjs";import{P as G,a as L}from"./Items-Drd82_Jj.mjs";import{C as y}from"./CountMenu-Dx8D_RJZ.mjs";import{a as B}from"./annotation-name-Du2KAWoD.mjs";import{f as D,r as K}from"./fetchManifest-tQXcfFiz.mjs";import{u as V,L as Z}from"./ListEnd-pq-BgaDI.mjs";function j({onSelect:o,forwardedRef:r,...c}){const{clover:l,language:e}=P("Items"),n=v(t=>t.manifest),s=v(t=>_(t.manifest,t.addedSets)),u=v(t=>t.annotationId),d=(s==null?void 0:s.pages)??z,m=(s==null?void 0:s.entries)??H,{loaded:A,more:N,reachNext:S}=V(d),x=E(()=>[...new Set(m.map(t=>O(t.annotation)).filter(t=>!!t&&t!==(n==null?void 0:n.id)))],[m,n==null?void 0:n.id]),C=Q(c.layout==="pager"?J:x),M=x.length>0,i=E(()=>{const t=d.length?new Set(d.slice(0,A).map(a=>a.id)):null;return m.filter(a=>!t||t.has(a.setId)).map(a=>{const g=O(a.annotation),p=g&&g!==(n==null?void 0:n.id)?C.get(g)??null:n;return W(a,p,e,M)})},[d,A,m,n,C,M,e]),b=Math.max((s==null?void 0:s.total)??0,i.length),I=R(null);if(T(()=>{const t=I.current;t===null||!i[t]||(I.current=null,l.selectAnnotation(i[t].id))},[l,i]),!i.length)return null;const h=i.findIndex(t=>t.id===u),w=(t,a)=>{o==null||o(t,a),l.selectAnnotation(t.id)};return c.layout==="pager"?f(G,{...c,forwardedRef:r,steps:{position:h,total:b,direction:"left-to-right",step:(a,g)=>{const p=h+a;if(!(p<0)){if(i[p])return w(i[p],g);N&&(I.current=p,S())}}},nameKey:"informationPanelTabsAnnotations",position:f(y,{position:h,total:b,list:a=>f(j,{layout:"list",forwardedRef:null,onSelect:a})})}):f(k,{children:[f(L,{...c,forwardedRef:r,items:i,selected:h,navigation:"id",language:e,request:l.request,showSummary:true,onActivate:w}),N&&f(Z,{onReached:S})]})}const z=[],H=[],J=[];function Q(o){const{clover:r}=P("Items"),[c,l]=q(U);return T(()=>{if(!o.length)return;let e=true;for(const n of o)D(r,n).then(s=>{e&&s&&l(u=>u.has(n)?u:new Map(u).set(n,s))});return()=>{e=false}},[r,o]),c}const U=new Map;function W(o,r,c,l){const e=F(r,o.canvasId),n=B(o.bodies,c),s=n.text?{[n.lang??"none"]:[n.text]}:e==null?void 0:e.label,u=l?r==null?void 0:r.label:e==null?void 0:e.label,d=e&&o.target.rect?K(e,o.target.rect):void 0;return{id:o.id,label:s,summary:n.text?u:void 0,parts:[{id:o.id,type:"Canvas",label:s,resource:e??{id:o.canvasId},...d?{source:d}:{}}]}}export{j as default};
@@ -1 +1 @@
1
- import{u as e,l as N}from"./shared-MTsMddHx.mjs";import{s as E}from"./Annotations-rBmeI5sR.mjs";import H from"./ControlMenu-Crtho2cs.mjs";import{C as T}from"./Cue-CbZaGwZh.mjs";import{H as $}from"./HideToggle-DL911R1Z.mjs";import{u as w}from"./useContainerName-CrOmY-km.mjs";import"./styles-CZV1nbBQ.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
+ import{u as e,l as N}from"./shared-DFAX0n3B.mjs";import{s as E}from"./Annotations-BG8lPjk1.mjs";import H from"./ControlMenu-BjJsWnuZ.mjs";import{C as T}from"./Cue-xuo5dgKE.mjs";import{H as $}from"./HideToggle-0nlIo-f8.mjs";import{u as w}from"./useContainerName-_48Cdi0m.mjs";import"./styles-BwkYiCLC.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,a5 as qt,f as bt,d as C,aA as Gt,q as k,A as l,B as jt,y as z,_ as kt,u as zt}from"./shared-MTsMddHx.mjs";import{w as Dt,p as It,g as Ot,t as Jt,A as Ut}from"./Annotations-rBmeI5sR.mjs";import{g as Xt}from"./layout-De1MOSYe.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:B,canvasKey:D,openImages:tt,openMedia:et,host:nt,onModel:F,refind:H=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,[_,Bt]=C([]),[it,Ft]=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]),Ht=i(()=>{const t=U.filter(e=>!it.includes(e)&&!_.includes(e));return t.length?[..._,...t]:_},[_,it,U]),a=rt??Ht,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]),A=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&&(Bt(r=>{const s=r.filter(f=>!t.includes(f));return e?s:[...s,...t]}),Ft(r=>{const s=r.filter(f=>!t.includes(f));return e?[...s,...t]:s}))},[L]),gt=i(()=>Dt(A(c),d),[c,A,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(()=>A(P),[P,A]),Y=i(()=>P.length||!O?P:It(c,O,W,v),[P,O,c,W,v]),[_t,Lt]=C(null),[Nt,ft]=C(null),u=st!==void 0?st:Nt,T=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=B;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(T.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),T.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(H);z(()=>{if(!u){T.current=null;return}if(St.current!==H&&(St.current=H,T.current=null),T.current===u)return;const t=r=>r.find(s=>s.id===u),e=t(x),n=e??t(P);if(n){if(T.current=n.id,n.track){!e&&g&&Ot(n,g);return}o==null||o.fitAnnotation(n.world,!$.current)}},[u,x,P,g,o,H]);const y=i(()=>I?Jt(c,v):[],[I,c,v]),j=i(()=>A(y),[y,A]),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),[At,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,!!B)){if(!I){tt(true);return}et(D),Rt(D)}},[u,c,B,I,D,tt,et]);const Tt=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:At}),[vt,x,j,a,R,dt,gt,u,K,Z,b,At]);return kt(()=>F(Tt),[Tt,F]),kt(()=>()=>F(null),[F]),o&&p>0&&!B?zt(Ut,{renderer:o,placed:x,sceneVersion:p,active:_t??Ct??u,selected:u,onActivate:Z,onSelect:K,onFollow:Qt,media:I?g:void 0}):null}export{Et as AnnotationState};
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-DFAX0n3B.mjs";import{w as Dt,p as It,g as Ot,t as Jt,A as Ut}from"./Annotations-BG8lPjk1.mjs";import{h as Xt}from"./layout-B29v2RKK.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 +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-DFAX0n3B.mjs";import{a as ht}from"./annotation-name-Du2KAWoD.mjs";import{r as ut}from"./link-Ct5PpHEY.mjs";import{T as dt}from"./Tip-nJSTYquc.mjs";import{b as pt}from"./Camera-DqT_1MgD.mjs";import"./styles-BwkYiCLC.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};
@@ -1,2 +1,2 @@
1
- import{D as ct,a as Z,e as z,c as y,s as Lt,m as kt,n as Ct,R as lt,o as Nt,u as a,r as V,t as $t,w as rt,B as At,b as dt,E as ut,T as M,d as tt,A as Tt,y as X,l as B,F as Et,G as Ot,v as Mt,k as ot,f as Bt}from"./shared-MTsMddHx.mjs";import{E as qt}from"./EntryBodies-Bfd2Z42z.mjs";import{u as yt,L as Pt}from"./ListEnd-CbwNlty-.mjs";import{a as Rt}from"./annotation-name-CYkZopdd.mjs";import{r as Vt,a as Ft}from"./link-GEdiEwlR.mjs";import{s as Ht}from"./show-link-BXm7SNIC.mjs";import{f as jt,r as Gt}from"./fetchManifest-BIzne1Pj.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-CbZaGwZh.mjs";import{E as zt}from"./EntryThumbnail-DQE8ajI9.mjs";import{H as ft}from"./HideToggle-DL911R1Z.mjs";import{u as ht,s as _}from"./readingLanguages-fs_HqvqQ.mjs";import{LanguageChoice as gt}from"./LanguageChoice-DT1UPiDn.mjs";import"./styles-CZV1nbBQ.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(`
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-DFAX0n3B.mjs";import{E as qt}from"./EntryBodies-C0ICfS2R.mjs";import{u as yt,L as Pt}from"./ListEnd-pq-BgaDI.mjs";import{a as Rt}from"./annotation-name-Du2KAWoD.mjs";import{r as Vt,a as Ft}from"./link-Ct5PpHEY.mjs";import{s as Ht}from"./show-link-DBaJj4s_.mjs";import{f as jt,r as Gt}from"./fetchManifest-tQXcfFiz.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-xuo5dgKE.mjs";import{E as zt}from"./EntryThumbnail-DxHhfRo_.mjs";import{H as ft}from"./HideToggle-0nlIo-f8.mjs";import{u as ht,s as _}from"./readingLanguages-FyVsSWJ8.mjs";import{LanguageChoice as gt}from"./LanguageChoice-DkSc-n6g.mjs";import"./styles-BwkYiCLC.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};
@@ -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-DFAX0n3B.mjs";import L from"./Connected-sYBn_9MK.mjs";import{r as R}from"./rendererSurface-nh6-EfuZ.mjs";import{j as w}from"./classnames-DukgfdpI.mjs";import{a as x}from"./hooks-C4dJ5K_D.mjs";import{L as c}from"./Loading-CoJLSRkv.mjs";const z=v(()=>import("./Connected-CcbVqzmj.mjs")),N=v(()=>import("./Connected-DthCPaHl.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-MTsMddHx.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
+ import{a as o,u as r,l}from"./shared-DFAX0n3B.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-MTsMddHx.mjs";import{j as u}from"./classnames-DukgfdpI.mjs";import{T as v}from"./Tip-BbexILXs.mjs";import"./styles-CZV1nbBQ.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
+ import{u as t,l as d}from"./shared-DFAX0n3B.mjs";import{j as u}from"./classnames-DukgfdpI.mjs";import{T as v}from"./Tip-nJSTYquc.mjs";import"./styles-BwkYiCLC.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,g as l,b as i,c,r as a,t as h,s as u}from"./CanvasView-BWQ4SK2b.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
+ import{d as f,r as l,b as i,c,g as a,s as u,t as h}from"./CanvasView-DxZASM9E.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-C0aKlE0v.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};
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-nh6-EfuZ.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-DFAX0n3B.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-CJELU3gI.mjs";import{P as Mo,a as Bo,I as Po,b as So}from"./glyphs-dp_HK3Ja.mjs";import{B as kt}from"./Button-Cx6VE_UW.mjs";import{S as Z,f as Eo}from"./Tip-nJSTYquc.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-B29v2RKK.mjs";import{u as Do,a as No,h as Vo}from"./useNearViewport-B34ebmIW.mjs";import{L as Ko}from"./Loading-CoJLSRkv.mjs";import{j as qo}from"./classnames-DukgfdpI.mjs";import{u as Ho}from"./useContainerName-_48Cdi0m.mjs";import{b as jo}from"./imageService-4sFnmAFX.mjs";import"./styles-BwkYiCLC.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-DYc9ekWS.mjs"),Yo=()=>import("./ChaptersMenu-BAZVVDrK.mjs"),Go=()=>import("./ChoiceMenu-C80kdxvq.mjs"),Jo=()=>import("./ImageControls-tKVAMpaj.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-BpgNtpKZ.mjs")),sa=()=>import("./AnnotationState--5ghW0C2.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-AZpVvu0R.mjs")),In=De(()=>import("./PlaceBox-DX4ZLDat.mjs")),ca=De(()=>import("./Placeholder-0hE8q-SY.mjs")),ua=De(()=>import("./ControlsFade-C-6WhSxB.mjs")),da=()=>true,fa=De(()=>import("./Placeholder-0hE8q-SY.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-DFAX0n3B.mjs";import{M as f,a as h}from"./Markup-Hm6bWOjm.mjs";import{R as u}from"./ReadMore-D_WmmKEP.mjs";import{E as b}from"./EntryBodies-C0ICfS2R.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-DFAX0n3B.mjs";import b from"./ControlMenu-BjJsWnuZ.mjs";import{c as C,a as D}from"./Transport-FxLp_bdW.mjs";import{u as P}from"./useContainerName-_48Cdi0m.mjs";import{E as w}from"./EntryThumbnail-DxHhfRo_.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-MTsMddHx.mjs";import{j as i}from"./classnames-DukgfdpI.mjs";import"./styles-CZV1nbBQ.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};
1
+ import{u as o}from"./shared-DFAX0n3B.mjs";import{j as i}from"./classnames-DukgfdpI.mjs";import"./styles-BwkYiCLC.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-DFAX0n3B.mjs";import x from"./ControlMenu-BjJsWnuZ.mjs";import{m as C}from"./layout-B29v2RKK.mjs";import{u as z}from"./useContainerName-_48Cdi0m.mjs";import"./styles-BwkYiCLC.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-DFAX0n3B.mjs";import{I as q}from"./Items-Drd82_Jj.mjs";import{L as w}from"./Label-BIjqJ-_T.mjs";import{Summary as x,Id as D,Homepage as L}from"./Primitives-c9sIz0oQ.mjs";import{j as O}from"./classnames-DukgfdpI.mjs";import{t as p}from"./heading-Cjt0f-Eu.mjs";import"./styles-BwkYiCLC.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,r as h,u as r,l as S}from"./shared-MTsMddHx.mjs";import{i as N}from"./items-F6hJgdAS.mjs";import{j as U}from"./classnames-DukgfdpI.mjs";import"./styles-CZV1nbBQ.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
+ 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-DFAX0n3B.mjs";import{i as N}from"./items-BUmOy2QY.mjs";import{j as U}from"./classnames-DukgfdpI.mjs";import"./styles-BwkYiCLC.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{u as o}from"./shared-MTsMddHx.mjs";import{p as a}from"./playerSurface-HYwEwPK6.mjs";import n from"./Connected-BSRM9FJY.mjs";import{j as t}from"./classnames-DukgfdpI.mjs";import{a as m}from"./hooks-x7rO95CS.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
+ import{u as o}from"./shared-DFAX0n3B.mjs";import{p as a}from"./playerSurface-BXNLaFk0.mjs";import n from"./Connected-sYBn_9MK.mjs";import{j as t}from"./classnames-DukgfdpI.mjs";import{a as m}from"./hooks-C4dJ5K_D.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{e as v,c as u,y as S,T as b,u as C}from"./shared-MTsMddHx.mjs";import{S as q}from"./SceneView-B6bEx_7x.mjs";import{a as w,e as x}from"./hooks-x7rO95CS.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
+ import{e as v,c as u,y as S,T as b,u as C}from"./shared-DFAX0n3B.mjs";import{S as q}from"./SceneView-hcc78jQT.mjs";import{a as w,e as x}from"./hooks-C4dJ5K_D.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};