@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
@@ -1 +1 @@
1
- import{D as te,a as se,e as ne,c as p,L as re,E as ce,C as oe,b as ae,d as H,y as h,A as d,u as o,l as L,r as ie}from"./shared-MTsMddHx.mjs";import{j as le}from"./classnames-DukgfdpI.mjs";import{b as ue,s as he}from"./bringIntoView-CQH5ZgMM.mjs";import{a as de}from"./heading-Cjt0f-Eu.mjs";import{u as fe}from"./Sections-Dy5_pkyQ.mjs";import{F as ve}from"./FieldPill-D5DNJWLy.mjs";import"./styles-CZV1nbBQ.mjs";const O=40,xe=te(function({headingLevel:j=3,sticky:y=false,size:D="large",as:K="div",className:T,...U},k){const{t:B,langOf:V}=se(),{clover:r,language:G}=ne("Search"),b=p(e=>{var s;return((s=re(e.manifest))==null?void 0:s.id)??null}),t=p(e=>e.search),J=p(e=>ce(e.manifest).canvases),a=p(e=>e.annotationId),Q=oe(r.highlight.subscribe,r.highlight.get,r.highlight.get),I=ae(),[$,S]=H(t.query);h(()=>S(t.query),[t.query]);const l=d(null),v=fe(),P=d(0),q=d(false),R=d(null);h(()=>{if(t.status!=="ready"||!t.set||R.current===t.set)return;R.current=t.set;const e=t.hits[0],s=t.hits.some(n=>a&&n.entryIds.includes(a));e&&!s&&r.selectAnnotation(e.entryIds[0])},[r,t.status,t.set,t.hits,a]),h(()=>{var i;const e=(i=l.current)==null?void 0:i.closest(".clover-content-search-field"),s=e==null?void 0:e.parentElement;if(!y||!e||!s||typeof ResizeObserver>"u")return;const n=new ResizeObserver(()=>s.style.setProperty("--clover-content-search-field",`${e.offsetHeight}px`));return n.observe(e),()=>{n.disconnect(),s.style.removeProperty("--clover-content-search-field")}},[y,b]),h(()=>{var s,n;if(!q.current)return;q.current=false;const e=(n=(s=l.current)==null?void 0:s.closest(".clover-content-search"))==null?void 0:n.querySelector('.clover-content-search-hit[aria-current="true"]');e&&ue(e,"nearest")},[a]);const[E,W]=H({set:null,count:O}),w=E.set===t.set?E.count:O,x=()=>W({set:t.set,count:w+O}),z=d(null),A=a?t.hits.findIndex(e=>e.entryIds.includes(a)):-1,N=typeof IntersectionObserver<"u",u=N?Math.min(t.hits.length,Math.max(w,A+1)):t.hits.length,M=d(x);if(M.current=x,h(()=>{const e=z.current;if(!e||!N||u>=t.hits.length)return;const s=new IntersectionObserver(n=>{n.some(i=>i.isIntersecting)&&M.current()},{root:he(e),rootMargin:"0px 0px 400px 0px"});return s.observe(e),()=>s.disconnect()},[N,u,t.hits.length]),h(()=>{!v||v===P.current||!l.current||(P.current=v,l.current.focus())},[v,b]),!b)return null;const F={position:A,total:t.hits.length,step:e=>{const s=t.hits[F.position+e];s&&(q.current=true,r.selectAnnotation(s.entryIds[0]))}},g=[];t.hits.slice(0,u).forEach((e,s)=>{const n=g[g.length-1];(n==null?void 0:n.canvasId)===e.canvasId?n.hits.push({hit:e,index:s}):g.push({canvasId:e.canvasId,hits:[{hit:e,index:s}]})});const X=de(j),f=t.hits.length,m=t.status==="loading"?"contentSearchLoading":t.status==="error"?"contentSearchError":t.status==="ready"?f===0?"contentSearchResultsNone":f===1?"contentSearchResult":"contentSearchResults":null,Y=m?B(m,{count:f}):"",Z=t.status==="ready"?F:null,_=o("p",{className:"clover-content-search-status",role:"status","data-status":t.status,...L(m?V(m):void 0),children:Y});return o(K,{ref:k,className:le("clover-content-search",T),"data-status":t.status,"data-sticky":y||void 0,...U,children:[o("div",{className:"clover-content-search-field",children:o(ve,{ref:l,id:`${I}-query`,value:$,onChange:e=>{S(e),!e&&t.query&&r.search("")},onSubmit:()=>void r.search($),onClear:()=>{var e;S(""),t.query&&r.search(""),(e=l.current)==null||e.focus()},results:Z,size:D,classes:{form:"clover-content-search-form",query:"clover-content-search-query",clear:"clover-content-search-clear",submit:"clover-content-search-submit"}})}),_,g.map(({canvasId:e,hits:s},n)=>{const i=J.find(c=>c.id===e),C=ie(i==null?void 0:i.label,G);return o("section",{className:"clover-content-search-group","aria-labelledby":`${I}-${n}`,children:[o(X,{id:`${I}-${n}`,className:"clover-content-search-canvas",...L(C.text?C.lang:void 0),children:C.text||e}),o("ol",{className:"clover-content-search-hits",children:s.map(({hit:c,index:ee})=>o("li",{children:o("button",{type:"button",className:"clover-content-search-hit","aria-current":a&&c.entryIds.includes(a)?"true":void 0,"data-highlighted":c.entryIds.includes(Q??""),onClick:()=>r.selectAnnotation(c.entryIds[0]),onPointerEnter:()=>r.highlight.emit(c.entryIds[0]),onPointerLeave:()=>r.highlight.emit(null),onFocus:()=>{r.highlight.emit(c.entryIds[0]),u<f&&ee>=u-5&&x()},onBlur:()=>r.highlight.emit(null),children:[c.before,o("mark",{children:c.match}),c.after]})},c.id))})]},`${e}-${n}`)}),u<f&&o("div",{ref:z,className:"clover-content-search-more","aria-hidden":"true"})]})});export{xe as Search};
1
+ import{D as te,a as se,e as ne,c as p,M as re,F as ce,C as oe,b as ae,d as H,y as h,A as d,u as o,l as j,t as ie}from"./shared-DFAX0n3B.mjs";import{j as le}from"./classnames-DukgfdpI.mjs";import{b as ue,s as he}from"./bringIntoView-CQH5ZgMM.mjs";import{a as de}from"./heading-Cjt0f-Eu.mjs";import{u as fe}from"./Sections-DZVrhoAC.mjs";import{F as ve}from"./FieldPill-CVfeeafm.mjs";import"./styles-BwkYiCLC.mjs";const O=40,xe=te(function({headingLevel:D=3,sticky:y=false,size:K="large",as:L="div",className:T,...U},k){const{t:B,langOf:V}=se(),{clover:r,language:G}=ne("Search"),b=p(e=>{var s;return((s=re(e.manifest))==null?void 0:s.id)??null}),t=p(e=>e.search),J=p(e=>ce(e.manifest).canvases),a=p(e=>e.annotationId),Q=oe(r.highlight.subscribe,r.highlight.get,r.highlight.get),I=ae(),[$,S]=H(t.query);h(()=>S(t.query),[t.query]);const l=d(null),v=fe(),P=d(0),q=d(false),R=d(null);h(()=>{if(t.status!=="ready"||!t.set||R.current===t.set)return;R.current=t.set;const e=t.hits[0],s=t.hits.some(n=>a&&n.entryIds.includes(a));e&&!s&&r.selectAnnotation(e.entryIds[0])},[r,t.status,t.set,t.hits,a]),h(()=>{var i;const e=(i=l.current)==null?void 0:i.closest(".clover-content-search-field"),s=e==null?void 0:e.parentElement;if(!y||!e||!s||typeof ResizeObserver>"u")return;const n=new ResizeObserver(()=>s.style.setProperty("--clover-content-search-field",`${e.offsetHeight}px`));return n.observe(e),()=>{n.disconnect(),s.style.removeProperty("--clover-content-search-field")}},[y,b]),h(()=>{var s,n;if(!q.current)return;q.current=false;const e=(n=(s=l.current)==null?void 0:s.closest(".clover-content-search"))==null?void 0:n.querySelector('.clover-content-search-hit[aria-current="true"]');e&&ue(e,"nearest")},[a]);const[M,W]=H({set:null,count:O}),w=M.set===t.set?M.count:O,x=()=>W({set:t.set,count:w+O}),z=d(null),A=a?t.hits.findIndex(e=>e.entryIds.includes(a)):-1,N=typeof IntersectionObserver<"u",u=N?Math.min(t.hits.length,Math.max(w,A+1)):t.hits.length,E=d(x);if(E.current=x,h(()=>{const e=z.current;if(!e||!N||u>=t.hits.length)return;const s=new IntersectionObserver(n=>{n.some(i=>i.isIntersecting)&&E.current()},{root:he(e),rootMargin:"0px 0px 400px 0px"});return s.observe(e),()=>s.disconnect()},[N,u,t.hits.length]),h(()=>{!v||v===P.current||!l.current||(P.current=v,l.current.focus())},[v,b]),!b)return null;const F={position:A,total:t.hits.length,step:e=>{const s=t.hits[F.position+e];s&&(q.current=true,r.selectAnnotation(s.entryIds[0]))}},g=[];t.hits.slice(0,u).forEach((e,s)=>{const n=g[g.length-1];(n==null?void 0:n.canvasId)===e.canvasId?n.hits.push({hit:e,index:s}):g.push({canvasId:e.canvasId,hits:[{hit:e,index:s}]})});const X=de(D),f=t.hits.length,m=t.status==="loading"?"contentSearchLoading":t.status==="error"?"contentSearchError":t.status==="ready"?f===0?"contentSearchResultsNone":f===1?"contentSearchResult":"contentSearchResults":null,Y=m?B(m,{count:f}):"",Z=t.status==="ready"?F:null,_=o("p",{className:"clover-content-search-status",role:"status","data-status":t.status,...j(m?V(m):void 0),children:Y});return o(L,{ref:k,className:le("clover-content-search",T),"data-status":t.status,"data-sticky":y||void 0,...U,children:[o("div",{className:"clover-content-search-field",children:o(ve,{ref:l,id:`${I}-query`,value:$,onChange:e=>{S(e),!e&&t.query&&r.search("")},onSubmit:()=>void r.search($),onClear:()=>{var e;S(""),t.query&&r.search(""),(e=l.current)==null||e.focus()},results:Z,size:K,classes:{form:"clover-content-search-form",query:"clover-content-search-query",clear:"clover-content-search-clear",submit:"clover-content-search-submit"}})}),_,g.map(({canvasId:e,hits:s},n)=>{const i=J.find(c=>c.id===e),C=ie(i==null?void 0:i.label,G);return o("section",{className:"clover-content-search-group","aria-labelledby":`${I}-${n}`,children:[o(X,{id:`${I}-${n}`,className:"clover-content-search-canvas",...j(C.text?C.lang:void 0),children:C.text||e}),o("ol",{className:"clover-content-search-hits",children:s.map(({hit:c,index:ee})=>o("li",{children:o("button",{type:"button",className:"clover-content-search-hit","aria-current":a&&c.entryIds.includes(a)?"true":void 0,"data-highlighted":c.entryIds.includes(Q??""),onClick:()=>r.selectAnnotation(c.entryIds[0]),onPointerEnter:()=>r.highlight.emit(c.entryIds[0]),onPointerLeave:()=>r.highlight.emit(null),onFocus:()=>{r.highlight.emit(c.entryIds[0]),u<f&&ee>=u-5&&x()},onBlur:()=>r.highlight.emit(null),children:[c.before,o("mark",{children:c.match}),c.after]})},c.id))})]},`${e}-${n}`)}),u<f&&o("div",{ref:z,className:"clover-content-search-more","aria-hidden":"true"})]})});export{xe as Search};
@@ -1,2 +1,2 @@
1
- import{b as ae,A as $,a as ie,d as G,y as z,_ as de,u as i,Q as J,l as ue,k as fe,x as Z}from"./shared-MTsMddHx.mjs";import{a as pe}from"./heading-Cjt0f-Eu.mjs";import{T as ve}from"./Tip-BbexILXs.mjs";import{u as he}from"./useContainerName-CrOmY-km.mjs";import{u as ge}from"./useScrollTrack-CEsOU2yT.mjs";import{C as me}from"./Chevron-r-_hUPn8.mjs";import"./styles-CZV1nbBQ.mjs";const V=typeof window>"u"?z:de,ee=J(null);function Pe(){return Z(ee)}const te=J(0);function Ne(){return Z(te)}function $e({items:n,layout:r="tabs",value:R,onValueChange:S,label:E,labelLang:F,headingLevel:h=3}){var Q;const g=ae(),k=he(E??"",F,E===void 0),f=$([]),s=r==="tabs",{t:I,langOf:oe}=ie(),m=ge({dragFree:true,itemCount:n.length}),v=n.some(e=>e.value===R)?R:((Q=n[0])==null?void 0:Q.value)??null,H=$(new Set);v&&H.current.add(v);const T=$(null),[D,ne]=G({value:null,count:0});z(()=>{var d;if(s||!v||T.current!==v)return;T.current=null;const e=n.findIndex(u=>u.value===v),o=document.getElementById(`${g}-panel-${e}`),t=(d=f.current[e])==null?void 0:d.parentElement;if(!o||!t)return;const l=t.getBoundingClientRect().bottom-o.getBoundingClientRect().top;if(l<=0)return;const a=M(o);a&&(a.scrollTop-=l)},[v,s,n,g]);const re=e=>{var B,P,y,N;const o=n.findIndex(A=>A.value===v),t=document.getElementById(`${g}-panel-${o}`),l=e.target;if(!t||l===t||!t.contains(l)||!ye(l))return;const a=(P=(B=f.current[o])==null?void 0:B.parentElement)==null?void 0:P.getBoundingClientRect(),d=o+1<n.length?(N=(y=f.current[o+1])==null?void 0:y.parentElement)==null?void 0:N.getBoundingClientRect():void 0;if(!a)return;const u=l.getBoundingClientRect(),b=u.top<a.bottom?Math.floor(u.top-a.bottom):d&&u.bottom>d.top?Math.ceil(Math.min(u.bottom-d.top,u.top-a.bottom)):0,p=b?M(t):null;p&&(p.scrollTop+=b)},j=$(null),K=n.map(e=>e.value).join(`
2
- `);V(()=>{const e=j.current;if(s||!e||typeof ResizeObserver>"u")return;const o=[...e.querySelectorAll(":scope > .clover-sections-item")],t=o.map(c=>c.firstElementChild),l=t[0],a=t[t.length-1],d=new Map,u=c=>(c&&d.get(c))??0,b=document.scrollingElement;let p=null,B=0;const P=()=>{const c=t.reduce((O,L)=>O+u(L),0);let C=0;o.forEach((O,L)=>{O.style.setProperty("--clover-sections-before",`${C}px`),C+=u(t[L]),O.style.setProperty("--clover-sections-after",`${c-C}px`)}),e.style.setProperty("--clover-sections-total",`${c}px`);const w=l&&getComputedStyle(l);(w==null?void 0:w.position)==="sticky"&&a&&(B=parseFloat(w.top)+parseFloat(getComputedStyle(a).bottom)||0);const x=getComputedStyle(e),ce=parseFloat(x.lineHeight)||1.2*parseFloat(x.fontSize),X=(p==null?void 0:p.clientHeight)??0;X>0&&X-B-c<2*ce?e.dataset.stacks="off":delete e.dataset.stacks},y=new ResizeObserver(c=>{var C,w;for(const x of c)t.includes(x.target)&&d.set(x.target,((w=(C=x.borderBoxSize)==null?void 0:C[0])==null?void 0:w.blockSize)??x.target.getBoundingClientRect().height);P()}),N=()=>{const c=M(e);c!==p&&(p&&p!==b&&y.unobserve(p),c&&c!==b&&y.observe(c),p=c)},A=()=>{N(),P()};N();for(const c of t)c&&y.observe(c,{box:"border-box"});return window.addEventListener("resize",A),()=>{y.disconnect(),window.removeEventListener("resize",A);for(const c of o)c.style.removeProperty("--clover-sections-before"),c.style.removeProperty("--clover-sections-after");e.style.removeProperty("--clover-sections-total"),delete e.dataset.stacks}},[s,K,h]),z(()=>{if(s)return;const e=f.current.map(t=>t==null?void 0:t.parentElement).filter(t=>!!t),o=t=>{var u;if(t.ctrlKey)return;const l=t.currentTarget,a=_(l);if(!a||a===document.scrollingElement)return;t.preventDefault();const d=t.deltaMode===1?parseFloat(getComputedStyle(l).lineHeight)||16:t.deltaMode===2?a.clientHeight:1;(u=_(a)??document.scrollingElement)==null||u.scrollBy({left:t.deltaX*d,top:t.deltaY*d,behavior:"instant"})};for(const t of e)t.addEventListener("wheel",o,{passive:false});return()=>{for(const t of e)t.removeEventListener("wheel",o)}},[s,K]);const W=e=>{e!==v&&(T.current=e,s||ne(o=>({value:e,count:o.count+1})),S==null||S(e))},se=(e,o)=>{var u;const t=n.length-1,[l,a]=s?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"],d=e.key===a?(o+1)%n.length:e.key===l?(o-1+n.length)%n.length:e.key==="Home"?0:e.key==="End"?t:null;d!==null&&(e.preventDefault(),(u=f.current[d])==null||u.focus(),s&&W(n[d].value))},Y=$(false);z(()=>{if(!s)return;const e=n.findIndex(p=>p.value===v),o=f.current[e],t=o==null?void 0:o.parentElement;if(!o||!t)return;const l=getComputedStyle(t),a=t.getBoundingClientRect(),d=o.getBoundingClientRect(),u=a.left+(parseFloat(l.scrollPaddingLeft)||0),b=a.right-(parseFloat(l.scrollPaddingRight)||0);(d.left<u-1||d.right>b+1)&&m.scrollToIndex(e,{instant:!Y.current}),Y.current=true},[v,s,n.length,m.scrollToIndex]);const q=e=>{const o=e==="prev"?m.canScrollPrev:m.canScrollNext,t=e==="prev"?"sectionsScrollBack":"sectionsScrollForward";return i("button",{type:"button",className:`clover-sections-scroll-${e}`,"aria-hidden":"true",tabIndex:-1,hidden:!o,...ue(oe(t)),onMouseDown:l=>l.preventDefault(),onClick:e==="prev"?m.scrollPrev:m.scrollNext,children:[i("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:i("path",{d:e==="next"?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),i(ve,{label:I(t)})]})},le=pe(h,"div"),U=(e,o)=>{const t=e.value===v;return i("button",{ref:l=>{f.current[o]=l},type:"button",id:`${g}-button-${o}`,className:"clover-sections-button","data-value":e.value,"data-track-index":s?o:void 0,"aria-controls":`${g}-panel-${o}`,...s?{role:"tab","aria-selected":t,tabIndex:t?0:-1}:{"aria-expanded":t,"aria-disabled":t||void 0},onClick:()=>W(e.value),onKeyDown:l=>se(l,o),children:[i("span",{className:"clover-sections-label",children:e.label}),!s&&i(me,{open:t,className:"clover-sections-chevron"})]},e.value)};return i("div",{ref:j,className:"clover-sections","data-layout":r,onFocus:s?void 0:re,style:s?void 0:{"--clover-sections-count":n.length},children:[s&&i("div",{className:"clover-sections-tabs","data-more":[m.canScrollPrev&&"start",m.canScrollNext&&"end"].filter(Boolean).join(" ")||void 0,children:i("div",{className:"clover-sections-row",children:[i("div",{role:"tablist",ref:m.ref,...k.props,className:"clover-sections-list",children:n.map(U)}),q("prev"),q("next")]})}),s&&k.node,n.map((e,o)=>{const t=e.value===v;return i("section",{className:"clover-sections-item","data-value":e.value,"data-open":t,style:s?void 0:{"--clover-sections-index":o},children:[!s&&i(le,{className:"clover-sections-heading",children:[U(e,o),i("span",{className:"clover-sections-reach","aria-hidden":"true"})]}),i(te.Provider,{value:D.value===e.value?D.count:0,children:i(be,{id:`${g}-panel-${o}`,tabs:s,labelledBy:`${g}-button-${o}`,hidden:!t,actions:e.actions,children:H.current.has(e.value)?e.content:null})})]},e.value)})]})}function be({id:n,tabs:r,labelledBy:R,hidden:S,actions:E,children:F}){const[h,g]=G(null),k=!S||!!E;return V(()=>{const f=h==null?void 0:h.parentElement;if(!k||!h||!f||typeof ResizeObserver>"u")return;const s=new ResizeObserver(()=>{const I=h.offsetWidth;I?(f.style.setProperty("--clover-sections-actions",`${I}px`),f.setAttribute("data-actions","")):(f.style.removeProperty("--clover-sections-actions"),f.removeAttribute("data-actions"))});return s.observe(h),()=>{s.disconnect(),f.style.removeProperty("--clover-sections-actions"),f.removeAttribute("data-actions")}},[h,k]),i(fe,{children:[!r&&i("div",{ref:g,className:"clover-sections-actions",hidden:!k,children:E}),i("div",{id:n,role:r?"tabpanel":"region","aria-labelledby":R,tabIndex:r?0:void 0,className:"clover-sections-panel",hidden:S,children:i(ee.Provider,{value:r?null:h,children:[r&&E,F]})})]})}function M(n){for(let r=n.parentElement;r&&r!==document.body;r=r.parentElement)if(/auto|scroll|hidden/.test(getComputedStyle(r).overflowY))return r;return document.scrollingElement}function _(n){for(let r=n.parentElement;r&&r!==document.body;r=r.parentElement)if(/auto|scroll/.test(getComputedStyle(r).overflowY)&&r.scrollHeight>r.clientHeight)return r;return document.scrollingElement}function ye(n){try{return n.matches(":focus-visible")}catch{return true}}export{$e as S,Pe as a,Ne as u};
1
+ import{b as ae,A as $,a as ie,d as G,y as z,_ as de,u as i,Q as J,l as ue,k as fe,x as Z}from"./shared-DFAX0n3B.mjs";import{a as pe}from"./heading-Cjt0f-Eu.mjs";import{T as ve}from"./Tip-nJSTYquc.mjs";import{u as he}from"./useContainerName-_48Cdi0m.mjs";import{u as ge}from"./useScrollTrack-DgRGFeP5.mjs";import{C as me}from"./Chevron-DFGbSGPI.mjs";import"./styles-BwkYiCLC.mjs";const V=typeof window>"u"?z:de,ee=J(null);function Pe(){return Z(ee)}const te=J(0);function Ne(){return Z(te)}function $e({items:n,layout:r="tabs",value:R,onValueChange:S,label:E,labelLang:F,headingLevel:h=3}){var Q;const g=ae(),k=he(E??"",F,E===void 0),f=$([]),s=r==="tabs",{t:I,langOf:oe}=ie(),m=ge({dragFree:true,itemCount:n.length}),v=n.some(e=>e.value===R)?R:((Q=n[0])==null?void 0:Q.value)??null,H=$(new Set);v&&H.current.add(v);const T=$(null),[D,ne]=G({value:null,count:0});z(()=>{var d;if(s||!v||T.current!==v)return;T.current=null;const e=n.findIndex(u=>u.value===v),o=document.getElementById(`${g}-panel-${e}`),t=(d=f.current[e])==null?void 0:d.parentElement;if(!o||!t)return;const l=t.getBoundingClientRect().bottom-o.getBoundingClientRect().top;if(l<=0)return;const a=M(o);a&&(a.scrollTop-=l)},[v,s,n,g]);const re=e=>{var B,P,y,N;const o=n.findIndex(A=>A.value===v),t=document.getElementById(`${g}-panel-${o}`),l=e.target;if(!t||l===t||!t.contains(l)||!ye(l))return;const a=(P=(B=f.current[o])==null?void 0:B.parentElement)==null?void 0:P.getBoundingClientRect(),d=o+1<n.length?(N=(y=f.current[o+1])==null?void 0:y.parentElement)==null?void 0:N.getBoundingClientRect():void 0;if(!a)return;const u=l.getBoundingClientRect(),b=u.top<a.bottom?Math.floor(u.top-a.bottom):d&&u.bottom>d.top?Math.ceil(Math.min(u.bottom-d.top,u.top-a.bottom)):0,p=b?M(t):null;p&&(p.scrollTop+=b)},j=$(null),K=n.map(e=>e.value).join(`
2
+ `);V(()=>{const e=j.current;if(s||!e||typeof ResizeObserver>"u")return;const o=[...e.querySelectorAll(":scope > .clover-sections-item")],t=o.map(c=>c.firstElementChild),l=t[0],a=t[t.length-1],d=new Map,u=c=>(c&&d.get(c))??0,b=document.scrollingElement;let p=null,B=0;const P=()=>{const c=t.reduce((O,L)=>O+u(L),0);let C=0;o.forEach((O,L)=>{O.style.setProperty("--clover-sections-before",`${C}px`),C+=u(t[L]),O.style.setProperty("--clover-sections-after",`${c-C}px`)}),e.style.setProperty("--clover-sections-total",`${c}px`);const w=l&&getComputedStyle(l);(w==null?void 0:w.position)==="sticky"&&a&&(B=parseFloat(w.top)+parseFloat(getComputedStyle(a).bottom)||0);const x=getComputedStyle(e),ce=parseFloat(x.lineHeight)||1.2*parseFloat(x.fontSize),X=(p==null?void 0:p.clientHeight)??0;X>0&&X-B-c<2*ce?e.dataset.stacks="off":delete e.dataset.stacks},y=new ResizeObserver(c=>{var C,w;for(const x of c)t.includes(x.target)&&d.set(x.target,((w=(C=x.borderBoxSize)==null?void 0:C[0])==null?void 0:w.blockSize)??x.target.getBoundingClientRect().height);P()}),N=()=>{const c=M(e);c!==p&&(p&&p!==b&&y.unobserve(p),c&&c!==b&&y.observe(c),p=c)},A=()=>{N(),P()};N();for(const c of t)c&&y.observe(c,{box:"border-box"});return window.addEventListener("resize",A),()=>{y.disconnect(),window.removeEventListener("resize",A);for(const c of o)c.style.removeProperty("--clover-sections-before"),c.style.removeProperty("--clover-sections-after");e.style.removeProperty("--clover-sections-total"),delete e.dataset.stacks}},[s,K,h]),z(()=>{if(s)return;const e=f.current.map(t=>t==null?void 0:t.parentElement).filter(t=>!!t),o=t=>{var u;if(t.ctrlKey)return;const l=t.currentTarget,a=_(l);if(!a||a===document.scrollingElement)return;t.preventDefault();const d=t.deltaMode===1?parseFloat(getComputedStyle(l).lineHeight)||16:t.deltaMode===2?a.clientHeight:1;(u=_(a)??document.scrollingElement)==null||u.scrollBy({left:t.deltaX*d,top:t.deltaY*d,behavior:"instant"})};for(const t of e)t.addEventListener("wheel",o,{passive:false});return()=>{for(const t of e)t.removeEventListener("wheel",o)}},[s,K]);const W=e=>{e!==v&&(T.current=e,s||ne(o=>({value:e,count:o.count+1})),S==null||S(e))},se=(e,o)=>{var u;const t=n.length-1,[l,a]=s?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"],d=e.key===a?(o+1)%n.length:e.key===l?(o-1+n.length)%n.length:e.key==="Home"?0:e.key==="End"?t:null;d!==null&&(e.preventDefault(),(u=f.current[d])==null||u.focus(),s&&W(n[d].value))},Y=$(false);z(()=>{if(!s)return;const e=n.findIndex(p=>p.value===v),o=f.current[e],t=o==null?void 0:o.parentElement;if(!o||!t)return;const l=getComputedStyle(t),a=t.getBoundingClientRect(),d=o.getBoundingClientRect(),u=a.left+(parseFloat(l.scrollPaddingLeft)||0),b=a.right-(parseFloat(l.scrollPaddingRight)||0);(d.left<u-1||d.right>b+1)&&m.scrollToIndex(e,{instant:!Y.current}),Y.current=true},[v,s,n.length,m.scrollToIndex]);const q=e=>{const o=e==="prev"?m.canScrollPrev:m.canScrollNext,t=e==="prev"?"sectionsScrollBack":"sectionsScrollForward";return i("button",{type:"button",className:`clover-steps-step clover-sections-scroll-${e}`,"aria-hidden":"true",tabIndex:-1,hidden:!o,...ue(oe(t)),onMouseDown:l=>l.preventDefault(),onClick:e==="prev"?m.scrollPrev:m.scrollNext,children:[i("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:i("path",{d:e==="next"?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),i(ve,{label:I(t)})]})},le=pe(h,"div"),U=(e,o)=>{const t=e.value===v;return i("button",{ref:l=>{f.current[o]=l},type:"button",id:`${g}-button-${o}`,className:"clover-sections-button","data-value":e.value,"data-track-index":s?o:void 0,"aria-controls":`${g}-panel-${o}`,...s?{role:"tab","aria-selected":t,tabIndex:t?0:-1}:{"aria-expanded":t,"aria-disabled":t||void 0},onClick:()=>W(e.value),onKeyDown:l=>se(l,o),children:[i("span",{className:"clover-sections-label",children:e.label}),!s&&i(me,{open:t,className:"clover-sections-chevron"})]},e.value)};return i("div",{ref:j,className:"clover-sections","data-layout":r,onFocus:s?void 0:re,style:s?void 0:{"--clover-sections-count":n.length},children:[s&&i("div",{className:"clover-sections-tabs","data-more":[m.canScrollPrev&&"start",m.canScrollNext&&"end"].filter(Boolean).join(" ")||void 0,children:i("div",{className:"clover-sections-row",children:[i("div",{role:"tablist",ref:m.ref,...k.props,className:"clover-sections-list",children:n.map(U)}),q("prev"),q("next")]})}),s&&k.node,n.map((e,o)=>{const t=e.value===v;return i("section",{className:"clover-sections-item","data-value":e.value,"data-open":t,style:s?void 0:{"--clover-sections-index":o},children:[!s&&i(le,{className:"clover-sections-heading",children:[U(e,o),i("span",{className:"clover-sections-reach","aria-hidden":"true"})]}),i(te.Provider,{value:D.value===e.value?D.count:0,children:i(be,{id:`${g}-panel-${o}`,tabs:s,labelledBy:`${g}-button-${o}`,hidden:!t,actions:e.actions,children:H.current.has(e.value)?e.content:null})})]},e.value)})]})}function be({id:n,tabs:r,labelledBy:R,hidden:S,actions:E,children:F}){const[h,g]=G(null),k=!S||!!E;return V(()=>{const f=h==null?void 0:h.parentElement;if(!k||!h||!f||typeof ResizeObserver>"u")return;const s=new ResizeObserver(()=>{const I=h.offsetWidth;I?(f.style.setProperty("--clover-sections-actions",`${I}px`),f.setAttribute("data-actions","")):(f.style.removeProperty("--clover-sections-actions"),f.removeAttribute("data-actions"))});return s.observe(h),()=>{s.disconnect(),f.style.removeProperty("--clover-sections-actions"),f.removeAttribute("data-actions")}},[h,k]),i(fe,{children:[!r&&i("div",{ref:g,className:"clover-sections-actions",hidden:!k,children:E}),i("div",{id:n,role:r?"tabpanel":"region","aria-labelledby":R,tabIndex:r?0:void 0,className:"clover-sections-panel",hidden:S,children:i(ee.Provider,{value:r?null:h,children:[r&&E,F]})})]})}function M(n){for(let r=n.parentElement;r&&r!==document.body;r=r.parentElement)if(/auto|scroll|hidden/.test(getComputedStyle(r).overflowY))return r;return document.scrollingElement}function _(n){for(let r=n.parentElement;r&&r!==document.body;r=r.parentElement)if(/auto|scroll/.test(getComputedStyle(r).overflowY)&&r.scrollHeight>r.clientHeight)return r;return document.scrollingElement}function ye(n){try{return n.matches(":focus-visible")}catch{return true}}export{$e as S,Pe as a,Ne as u};
@@ -1 +1 @@
1
- import{d as b,A as I,y as L,az as P,T as V,a2 as k,u as O,W as z}from"./shared-MTsMddHx.mjs";import{s as F,P as M,a as R}from"./Items-BHzT9A73.mjs";import{b as T}from"./items-F6hJgdAS.mjs";function B({iiifContent:a,items:e,navigation:w,onSelect:r,request:i,header:x=true,forwardedRef:g,...u}){var p;const[s,A]=b(null),[f,c]=b(0),v=typeof a=="string"?a:a==null?void 0:a.id,m=I({iiifContent:a,request:i});m.current={iiifContent:a,request:i},L(()=>{if(e||m.current.iiifContent===void 0)return;const t=new AbortController;return P(m.current.iiifContent,{request:m.current.request,signal:t.signal}).then(o=>{t.signal.aborted||A(o)}).catch(()=>{}),()=>t.abort()},[v,e]);const n=V(()=>T(e||s),[e,s]);if(!n.length)return null;const h=!e&&(s==null?void 0:s.type)==="Manifest",d=k(s==null?void 0:s.viewingDirection),y=w??(h?"id":"homepage");if(u.layout==="pager")return O(M,{...u,forwardedRef:g,steps:F(n,f,d,(t,o)=>{r==null||r(t,o),c(n.indexOf(t))})});const l=(p=s==null?void 0:s.homepage)==null?void 0:p[0],D=l==null?void 0:l.id;return O(R,{...u,forwardedRef:g,items:n,selected:y==="id"?f:-1,navigation:y,rtl:d==="right-to-left",request:i,showSummary:!h,heading:x&&s?{label:s.label,summary:s.summary,homepage:D,homepageLang:z(l)}:void 0,onActivate:(t,o)=>{r==null||r(t,o),c(n.indexOf(t))},followFocus:t=>c(n.indexOf(t))})}export{B as default};
1
+ import{d as b,A as I,y as L,aD as P,T as V,a3 as k,u as O,Y as F}from"./shared-DFAX0n3B.mjs";import{s as M,P as R,a as T}from"./Items-Drd82_Jj.mjs";import{b as Y}from"./items-BUmOy2QY.mjs";function B({iiifContent:a,items:e,navigation:w,onSelect:r,request:i,header:x=true,forwardedRef:g,...u}){var p;const[s,A]=b(null),[f,c]=b(0),D=typeof a=="string"?a:a==null?void 0:a.id,m=I({iiifContent:a,request:i});m.current={iiifContent:a,request:i},L(()=>{if(e||m.current.iiifContent===void 0)return;const t=new AbortController;return P(m.current.iiifContent,{request:m.current.request,signal:t.signal}).then(o=>{t.signal.aborted||A(o)}).catch(()=>{}),()=>t.abort()},[D,e]);const n=V(()=>Y(e||s),[e,s]);if(!n.length)return null;const h=!e&&(s==null?void 0:s.type)==="Manifest",d=k(s==null?void 0:s.viewingDirection),y=w??(h?"id":"homepage");if(u.layout==="pager")return O(R,{...u,forwardedRef:g,steps:M(n,f,d,(t,o)=>{r==null||r(t,o),c(n.indexOf(t))})});const l=(p=s==null?void 0:s.homepage)==null?void 0:p[0],v=l==null?void 0:l.id;return O(T,{...u,forwardedRef:g,items:n,selected:y==="id"?f:-1,navigation:y,rtl:d==="right-to-left",request:i,showSummary:!h,heading:x&&s?{label:s.label,summary:s.summary,homepage:v,homepageLang:F(l)}:void 0,onActivate:(t,o)=>{r==null||r(t,o),c(n.indexOf(t))},followFocus:t=>c(n.indexOf(t))})}export{B as default};
@@ -1 +1 @@
1
- import{a as p,u as s,v as c,l as d,k as m}from"./shared-MTsMddHx.mjs";import{j as v}from"./classnames-DukgfdpI.mjs";import{b as f}from"./hooks-x7rO95CS.mjs";import{L as h}from"./Loading-zw74TdAz.mjs";function b({className:e,loading:t,error:l}){const{t:n,langOf:i}=p(),{status:a,error:o}=f(),r=a==="loading",u=t!==void 0&&t!==false;return s(m,{children:[s("p",{className:v("clover-status",e),"data-status":r?a:void 0,role:"status",style:r&&t!==false?void 0:c,children:[r&&(u?t:t===void 0&&s(h,{})),r&&!u&&s("span",{style:c,...d(i("statusLoading")),children:n("statusLoading")})]}),a==="error"&&o&&s("div",{className:v("clover-status",e),"data-status":a,role:"alert",children:l?l(o):s(m,{children:[s("p",{...d(i("statusError")),children:n("statusError")}),s("p",{className:"clover-status-detail",lang:"en",children:o.message})]})})]})}export{b as S};
1
+ import{a as p,u as s,v as c,l as d,k as m}from"./shared-DFAX0n3B.mjs";import{j as v}from"./classnames-DukgfdpI.mjs";import{b as f}from"./hooks-C4dJ5K_D.mjs";import{L as h}from"./Loading-CoJLSRkv.mjs";function b({className:e,loading:t,error:l}){const{t:n,langOf:i}=p(),{status:a,error:o}=f(),r=a==="loading",u=t!==void 0&&t!==false;return s(m,{children:[s("p",{className:v("clover-status",e),"data-status":r?a:void 0,role:"status",style:r&&t!==false?void 0:c,children:[r&&(u?t:t===void 0&&s(h,{})),r&&!u&&s("span",{style:c,...d(i("statusLoading")),children:n("statusLoading")})]}),a==="error"&&o&&s("div",{className:v("clover-status",e),"data-status":a,role:"alert",children:l?l(o):s(m,{children:[s("p",{...d(i("statusError")),children:n("statusError")}),s("p",{className:"clover-status-detail",lang:"en",children:o.message})]})})]})}export{b as S};
@@ -1 +1 @@
1
- import{a as c,u as o,l as p,v as u}from"./shared-MTsMddHx.mjs";import{j as h}from"./classnames-DukgfdpI.mjs";import{T as v}from"./Tip-BbexILXs.mjs";import"./styles-CZV1nbBQ.mjs";function g({steps:e,sentence:t,className:a}){const{t:l,langOf:n}=c(),{position:r,total:i}=e;if(i<1)return null;const s=r+1;return o("div",{className:h("clover-steps",a),children:[o("span",{"aria-live":"polite",className:"clover-steps-position",children:[o("span",{"aria-hidden":t?"true":void 0,children:[s>0?s:"\u2013"," / ",i]}),o("span",{className:"clover-steps-room","aria-hidden":"true",hidden:true,children:[i," / ",i]}),t&&s>0&&o("span",{style:u,...p(n(t)),children:l(t,{index:s,total:i})})]}),o(d,{steps:e,step:"previous"}),o(d,{steps:e,step:"next"})]})}function d({steps:e,step:t}){const{t:a,langOf:l}=c(),n=t==="next",r=n?e.position+1<e.total:e.position>0,i=n?"commonNext":"commonPrevious";return o("button",{type:"button",className:"clover-steps-step","data-step":t,...p(l(i)),"aria-disabled":!r||void 0,tabIndex:r?void 0:-1,onClick:()=>{r&&e.step(n?1:-1)},children:[o("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:o("path",{d:n?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),o("span",{style:u,children:a(i)}),o(v,{label:a(i)})]})}export{g as S};
1
+ import{a as c,u as o,l as p,v as u}from"./shared-DFAX0n3B.mjs";import{j as h}from"./classnames-DukgfdpI.mjs";import{T as v}from"./Tip-nJSTYquc.mjs";import"./styles-BwkYiCLC.mjs";function g({steps:e,sentence:t,className:a}){const{t:l,langOf:n}=c(),{position:r,total:i}=e;if(i<1)return null;const s=r+1;return o("div",{className:h("clover-steps",a),children:[o("span",{"aria-live":"polite",className:"clover-steps-position",children:[o("span",{"aria-hidden":t?"true":void 0,children:[s>0?s:"\u2013"," / ",i]}),o("span",{className:"clover-steps-room","aria-hidden":"true",hidden:true,children:[i," / ",i]}),t&&s>0&&o("span",{style:u,...p(n(t)),children:l(t,{index:s,total:i})})]}),o(d,{steps:e,step:"previous"}),o(d,{steps:e,step:"next"})]})}function d({steps:e,step:t}){const{t:a,langOf:l}=c(),n=t==="next",r=n?e.position+1<e.total:e.position>0,i=n?"commonNext":"commonPrevious";return o("button",{type:"button",className:"clover-steps-step","data-step":t,...p(l(i)),"aria-disabled":!r||void 0,tabIndex:r?void 0:-1,onClick:()=>{r&&e.step(n?1:-1)},children:[o("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:o("path",{d:n?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),o("span",{style:u,children:a(i)}),o(v,{label:a(i)})]})}export{g as S};
@@ -1 +1 @@
1
- import{e as g,c as u,aa as v,r as f,u as d,l as h,T as p,d as x,y,E as b}from"./shared-MTsMddHx.mjs";import{s as w,P as M,a as C}from"./Items-BHzT9A73.mjs";import{C as P}from"./CountMenu-DyTp_J4k.mjs";import{f as S,r as N}from"./fetchManifest-BIzne1Pj.mjs";import{S as q}from"./Steps-o_UprQfZ.mjs";import{a as A}from"./heading-Cjt0f-Eu.mjs";function I({onSelect:s,forwardedRef:t,...i}){const{clover:l,language:o}=g("Items"),{items:a,position:e}=z(),r=(n,c)=>{s==null||s(n,c);const m=a.findIndex(T=>T.id===n.id);m>=0&&l.goToTarget(m)};return i.layout==="pager"?d(M,{...i,forwardedRef:t,steps:w(a,e,"left-to-right",r),nameKey:"informationPanelTabsTargets",position:d(P,{position:e,total:a.length,list:n=>d(I,{layout:"list",forwardedRef:null,onSelect:n})})}):d(C,{...i,forwardedRef:t,items:a,selected:e,navigation:"id",language:o,request:l.request,showSummary:true,onActivate:r})}function z(){const{language:s}=g("Items"),t=u(e=>e.targets),i=u(e=>e.manifest),l=u(e=>v(e.targets,e.targetIndex,e.manifest,e.canvasId)),o=B(t==null?void 0:t.items,i);return{items:p(()=>((t==null?void 0:t.items)??[]).map(e=>E(e,o.get(e.manifestId)??(e.manifestAs?o.get(e.manifestAs):void 0),s)),[t,o,s]),position:l}}function B(s,t){const{clover:i}=g("Items"),l=p(()=>[...new Set((s??[]).map(e=>e.manifestId))],[s]),[o,a]=x(new Map);return y(()=>{let e=true;return Promise.all(l.map(async r=>[r,await S(i,r)])).then(r=>{e&&a(new Map(r.filter(n=>!!n[1])))}),()=>{e=false}},[i,l]),p(()=>{const e=new Map(o);return t&&e.set(t.id,t),e},[o,t])}function E(s,t,i){const l=t?b(t).canvases:[],o=l.find(m=>m.id===s.canvasId)??l[0],a=t==null?void 0:t.label,e=o==null?void 0:o.label,r=f(e,i).text?e:a,n=a&&r!==a&&f(a,i).text!==f(r,i).text?a:void 0,c=o&&s.region?N(o,s.region):void 0;return{id:s.id,label:r,summary:n,parts:[{id:s.id,type:"Canvas",label:r,resource:o??{id:s.canvasId??s.manifestId},...c?{source:c}:{}}]}}function k({headingLevel:s=3}){const{clover:t,language:i}=g("Items"),l=u(n=>{var c;return(c=n.targets)==null?void 0:c.label}),o=u(n=>{var c;return((c=n.targets)==null?void 0:c.items.length)??0}),a=u(n=>v(n.targets,n.targetIndex,n.manifest,n.canvasId));if(o<2)return null;const e=f(l,i),r=A(s);return d("div",{className:"clover-about clover-collection clover-targets",children:[d("div",{className:"clover-targets-head",children:[e.text&&d(r,{className:"clover-collection-title",...h(e.lang),children:e.text}),d(q,{className:"clover-targets-steps",steps:{position:a,total:o,step:n=>{const c=a+n;c>=0&&c<o&&t.goToTarget(c)}}})]}),d(I,{layout:"list",forwardedRef:null})]})}export{k as TargetsSection,I as default,z as useTargetItems};
1
+ import{e as g,c as u,ae as v,t as f,u as d,l as h,T as p,d as x,y,F as b}from"./shared-DFAX0n3B.mjs";import{s as w,P as M,a as C}from"./Items-Drd82_Jj.mjs";import{C as P}from"./CountMenu-Dx8D_RJZ.mjs";import{f as S,r as N}from"./fetchManifest-tQXcfFiz.mjs";import{S as q}from"./Steps-Dkpy9KiJ.mjs";import{a as A}from"./heading-Cjt0f-Eu.mjs";function I({onSelect:s,forwardedRef:t,...i}){const{clover:l,language:o}=g("Items"),{items:a,position:e}=F(),r=(n,c)=>{s==null||s(n,c);const m=a.findIndex(T=>T.id===n.id);m>=0&&l.goToTarget(m)};return i.layout==="pager"?d(M,{...i,forwardedRef:t,steps:w(a,e,"left-to-right",r),nameKey:"informationPanelTabsTargets",position:d(P,{position:e,total:a.length,list:n=>d(I,{layout:"list",forwardedRef:null,onSelect:n})})}):d(C,{...i,forwardedRef:t,items:a,selected:e,navigation:"id",language:o,request:l.request,showSummary:true,onActivate:r})}function F(){const{language:s}=g("Items"),t=u(e=>e.targets),i=u(e=>e.manifest),l=u(e=>v(e.targets,e.targetIndex,e.manifest,e.canvasId)),o=z(t==null?void 0:t.items,i);return{items:p(()=>((t==null?void 0:t.items)??[]).map(e=>B(e,o.get(e.manifestId)??(e.manifestAs?o.get(e.manifestAs):void 0),s)),[t,o,s]),position:l}}function z(s,t){const{clover:i}=g("Items"),l=p(()=>[...new Set((s??[]).map(e=>e.manifestId))],[s]),[o,a]=x(new Map);return y(()=>{let e=true;return Promise.all(l.map(async r=>[r,await S(i,r)])).then(r=>{e&&a(new Map(r.filter(n=>!!n[1])))}),()=>{e=false}},[i,l]),p(()=>{const e=new Map(o);return t&&e.set(t.id,t),e},[o,t])}function B(s,t,i){const l=t?b(t).canvases:[],o=l.find(m=>m.id===s.canvasId)??l[0],a=t==null?void 0:t.label,e=o==null?void 0:o.label,r=f(e,i).text?e:a,n=a&&r!==a&&f(a,i).text!==f(r,i).text?a:void 0,c=o&&s.region?N(o,s.region):void 0;return{id:s.id,label:r,summary:n,parts:[{id:s.id,type:"Canvas",label:r,resource:o??{id:s.canvasId??s.manifestId},...c?{source:c}:{}}]}}function D({headingLevel:s=3}){const{clover:t,language:i}=g("Items"),l=u(n=>{var c;return(c=n.targets)==null?void 0:c.label}),o=u(n=>{var c;return((c=n.targets)==null?void 0:c.items.length)??0}),a=u(n=>v(n.targets,n.targetIndex,n.manifest,n.canvasId));if(o<2)return null;const e=f(l,i),r=A(s);return d("div",{className:"clover-about clover-collection clover-targets",children:[d("div",{className:"clover-targets-head",children:[e.text&&d(r,{className:"clover-collection-title clover-title",...h(e.lang),children:e.text}),d(q,{className:"clover-targets-steps",steps:{position:a,total:o,step:n=>{const c=a+n;c>=0&&c<o&&t.goToTarget(c)}}})]}),d(I,{layout:"list",forwardedRef:null})]})}export{D as TargetsSection,I as default,F as useTargetItems};
@@ -0,0 +1 @@
1
+ import{O as f,u as a,z as l,P as r}from"./shared-DFAX0n3B.mjs";import{C as m}from"./CanvasView-DxZASM9E.mjs";import{p as t}from"./playerSurface-BXNLaFk0.mjs";import{C as s}from"./Pending-mcmdyZPA.mjs";import{j as u}from"./classnames-DukgfdpI.mjs";const d=l(()=>import("./Connected-CcbVqzmj.mjs")),v=l(()=>import("./LoadedCanvas-DK6xMmM1.mjs"));function h({timeline:o,className:n,...e}){const c=f(),i=u("clover-timeline",n);return e.iiifContent!==void 0&&o===void 0?a(r,{fallback:a(s,{}),children:a(v,{...e,className:i,of:"Timeline",surface:t})}):o?a(m,{...e,className:i,canvases:[o],navigator:false,surface:t}):c?a(r,{fallback:a(s,{}),children:a(d,{...e,className:n})}):null}export{h as Timeline,h as default};
@@ -1 +1 @@
1
- import{a as k,A as L,y as v,u as f,l as w}from"./shared-MTsMddHx.mjs";import"./styles-CZV1nbBQ.mjs";const M={zoomIn:{keys:"Plus",glyph:"+"},zoomOut:{keys:"-",glyph:"\u2212"},reset:{keys:"0",glyph:"0"},rotateRight:{keys:"R",glyph:"R"},rotateLeft:{keys:"Shift+R",glyph:"\u21E7R"},play:{keys:"K Space",glyph:"K"},mute:{keys:"M",glyph:"M"}},R=new Set(["+","=","-","_","0","r","R","k","K","m","M","j","J","l","L"]);function B({label:t,lang:e,shortcut:n,scrolls:o=false,image:r,lead:i,after:a}){const{t:c}=k(),l=L(null),u=n?c("controlShortcut",{label:t,shortcut:n.glyph}):t;return K(),v(()=>{const s=l.current;s&&y(s)&&p(s)},[u,i]),f("span",{ref:l,className:"clover-tip","aria-hidden":"true",...w(e),...o&&{tabIndex:-1,onMouseDown:s=>{var m;s.preventDefault(),(m=s.currentTarget.parentElement)==null||m.focus({preventScroll:true})}},children:[r&&f("img",{className:"clover-tip-image",src:r,alt:"",loading:"lazy",onLoad:()=>{const s=l.current;s&&y(s)&&p(s)}}),i&&f("span",{className:"clover-tip-lead",children:i}),u,a!=null&&a!==false&&f("span",{className:"clover-tip-after",children:a})]})}function d(t){const e=t.target instanceof Element&&S(t.target),n=e&&h(e);n&&p(n)}function h(t){return Array.from(t.children).find(e=>e.classList.contains("clover-tip"))}function S(t){const e=t.matches("input")?t.parentElement:null;return e&&h(e)?e:t}function y(t){var e;try{return!!((e=t.parentElement)!=null&&e.matches(":hover, :focus-visible, :has(> input:focus-visible)"))}catch{return false}}function p(t){const e=t.parentElement;if(!e)return;t.style.removeProperty("--clover-tip-room"),t.style.removeProperty("--clover-tip-shift");const n=T(e),o=parseFloat(getComputedStyle(t).paddingLeft)||0,r=n.left+o,i=n.right-o,a=e.getBoundingClientRect();let c=t.getBoundingClientRect();const l=c.right<=a.left?c.right-r:c.left>=a.right?i-c.left:i-r;c.width>l&&(t.style.setProperty("--clover-tip-room",`${Math.max(l,0)}px`),c=t.getBoundingClientRect());const u=c.left<r?r-c.left:c.right>i?i-c.right:0;u&&t.style.setProperty("--clover-tip-shift",`${u}px`)}function T(t){let e=0,n=document.documentElement.clientWidth||window.innerWidth;for(let o=t.parentElement;o&&o!==document.documentElement;o=o.parentElement){const{display:r,overflow:i,overflowX:a}=getComputedStyle(o);if(r==="inline"||r==="contents")continue;const c=a||i;if(!c||c==="visible")continue;const l=o.getBoundingClientRect();e=Math.max(e,l.left+o.clientLeft),n=Math.min(n,l.left+o.clientLeft+o.clientWidth)}return{left:e,right:n}}let g=0;function E(t){if(t.key!=="Escape")return;const e=new Set;document.querySelectorAll(":hover > .clover-tip").forEach(r=>r.parentElement&&e.add(r.parentElement));const n=document.activeElement,o=n&&S(n);o&&h(o)&&e.add(o),e.forEach(r=>b(r,"tipHidden",["pointerenter","focusout"]))}function b(t,e,n){t.dataset[e]="";const o=()=>{delete t.dataset[e],n.forEach(r=>t.removeEventListener(r,o))};n.forEach(r=>t.addEventListener(r,o))}function K(){v(()=>(g++===0&&(document.addEventListener("keydown",E,true),document.addEventListener("pointerenter",d,true),document.addEventListener("focus",d,true)),()=>{--g||(document.removeEventListener("keydown",E,true),document.removeEventListener("pointerenter",d,true),document.removeEventListener("focus",d,true))}),[])}function O(t,e){const n=t.target;!e||n===e||e.contains(n)||R.has(t.key)&&(t.altKey||t.metaKey||t.ctrlKey||n.closest("input, select, textarea, [contenteditable]")||(t.preventDefault(),e.dispatchEvent(new KeyboardEvent("keydown",{key:t.key,shiftKey:t.shiftKey,bubbles:true,cancelable:true}))))}export{M as S,B as T,O as f,b as h};
1
+ import{a as k,A as L,y as v,u as f,l as w}from"./shared-DFAX0n3B.mjs";import"./styles-BwkYiCLC.mjs";const M={zoomIn:{keys:"Plus",glyph:"+"},zoomOut:{keys:"-",glyph:"\u2212"},reset:{keys:"0",glyph:"0"},rotateRight:{keys:"R",glyph:"R"},rotateLeft:{keys:"Shift+R",glyph:"\u21E7R"},play:{keys:"K Space",glyph:"K"},mute:{keys:"M",glyph:"M"}},R=new Set(["+","=","-","_","0","r","R","k","K","m","M","j","J","l","L"]);function B({label:t,lang:e,shortcut:n,scrolls:o=false,image:r,lead:i,after:a}){const{t:c}=k(),l=L(null),u=n?c("controlShortcut",{label:t,shortcut:n.glyph}):t;return K(),v(()=>{const s=l.current;s&&y(s)&&p(s)},[u,i]),f("span",{ref:l,className:"clover-tip","aria-hidden":"true",...w(e),...o&&{tabIndex:-1,onMouseDown:s=>{var m;s.preventDefault(),(m=s.currentTarget.parentElement)==null||m.focus({preventScroll:true})}},children:[r&&f("img",{className:"clover-tip-image",src:r,alt:"",loading:"lazy",onLoad:()=>{const s=l.current;s&&y(s)&&p(s)}}),i&&f("span",{className:"clover-tip-lead",children:i}),u,a!=null&&a!==false&&f("span",{className:"clover-tip-after",children:a})]})}function d(t){const e=t.target instanceof Element&&S(t.target),n=e&&h(e);n&&p(n)}function h(t){return Array.from(t.children).find(e=>e.classList.contains("clover-tip"))}function S(t){const e=t.matches("input")?t.parentElement:null;return e&&h(e)?e:t}function y(t){var e;try{return!!((e=t.parentElement)!=null&&e.matches(":hover, :focus-visible, :has(> input:focus-visible)"))}catch{return false}}function p(t){const e=t.parentElement;if(!e)return;t.style.removeProperty("--clover-tip-room"),t.style.removeProperty("--clover-tip-shift");const n=T(e),o=parseFloat(getComputedStyle(t).paddingLeft)||0,r=n.left+o,i=n.right-o,a=e.getBoundingClientRect();let c=t.getBoundingClientRect();const l=c.right<=a.left?c.right-r:c.left>=a.right?i-c.left:i-r;c.width>l&&(t.style.setProperty("--clover-tip-room",`${Math.max(l,0)}px`),c=t.getBoundingClientRect());const u=c.left<r?r-c.left:c.right>i?i-c.right:0;u&&t.style.setProperty("--clover-tip-shift",`${u}px`)}function T(t){let e=0,n=document.documentElement.clientWidth||window.innerWidth;for(let o=t.parentElement;o&&o!==document.documentElement;o=o.parentElement){const{display:r,overflow:i,overflowX:a}=getComputedStyle(o);if(r==="inline"||r==="contents")continue;const c=a||i;if(!c||c==="visible")continue;const l=o.getBoundingClientRect();e=Math.max(e,l.left+o.clientLeft),n=Math.min(n,l.left+o.clientLeft+o.clientWidth)}return{left:e,right:n}}let g=0;function E(t){if(t.key!=="Escape")return;const e=new Set;document.querySelectorAll(":hover > .clover-tip").forEach(r=>r.parentElement&&e.add(r.parentElement));const n=document.activeElement,o=n&&S(n);o&&h(o)&&e.add(o),e.forEach(r=>b(r,"tipHidden",["pointerenter","focusout"]))}function b(t,e,n){t.dataset[e]="";const o=()=>{delete t.dataset[e],n.forEach(r=>t.removeEventListener(r,o))};n.forEach(r=>t.addEventListener(r,o))}function K(){v(()=>(g++===0&&(document.addEventListener("keydown",E,true),document.addEventListener("pointerenter",d,true),document.addEventListener("focus",d,true)),()=>{--g||(document.removeEventListener("keydown",E,true),document.removeEventListener("pointerenter",d,true),document.removeEventListener("focus",d,true))}),[])}function O(t,e){const n=t.target;!e||n===e||e.contains(n)||R.has(t.key)&&(t.altKey||t.metaKey||t.ctrlKey||n.closest("input, select, textarea, [contenteditable]")||(t.preventDefault(),e.dispatchEvent(new KeyboardEvent("keydown",{key:t.key,shiftKey:t.shiftKey,bubbles:true,cancelable:true}))))}export{M as S,B as T,O as f,b as h};
@@ -1 +1 @@
1
- import{D as Le,a as Oe,e as Ie,c as Me,m as $e,T as ie,d as C,y as m,M as Re,C as Se,A as L,b as we,u as n,r as Ae,k as le,l as $,v as Ee,$ as Pe,B as ze}from"./shared-MTsMddHx.mjs";import{c as ue,a as de}from"./layout-De1MOSYe.mjs";import{l as Fe,a as Ve,p as He,b as Ke,c as je}from"./vtt-CacHieeN.mjs";import{j as qe}from"./classnames-DukgfdpI.mjs";import{u as De}from"./readingLanguages-fs_HqvqQ.mjs";import{b as pe,s as Ue}from"./bringIntoView-CQH5ZgMM.mjs";import{C as Xe}from"./Cue-CbZaGwZh.mjs";import{F as Be}from"./FieldPill-D5DNJWLy.mjs";import{l as Ge}from"./languageCode-cCpiU0b0.mjs";import{a as Je}from"./Sections-Dy5_pkyQ.mjs";import{T as Qe}from"./Tip-BbexILXs.mjs";import{u as We}from"./useContainerName-CrOmY-km.mjs";import"./styles-CZV1nbBQ.mjs";const j=40,q=s=>s.toLocaleLowerCase();function Ye(s,i){if(!i)return s;const v=q(s),g=[];let a=0;for(let p=v.indexOf(i);p>=0;p=v.indexOf(i,p+i.length))p>a&&g.push(s.slice(a,p)),g.push(n("mark",{children:s.slice(p,p+i.length)},p)),a=p+i.length;return a<s.length&&g.push(s.slice(a)),g}const R=s=>s.read==="cues"&&s.kind!=="transcript",ft=Le(function({as:i="div",follow:v=true,find:g=true,sticky:a=false,size:p="large",className:fe,...ge},me){const{t:D,langOf:U}=Oe(),{clover:o,language:X}=Ie("Transcript"),T=Me(e=>$e(e.manifest,e.canvasId)).find(e=>ue(e).length>0||de(e).length>0),l=ie(()=>T?[...ue(T).map(e=>({...e,read:"cues"})),...de(T).map(e=>({...e,read:"text"}))]:[],[T]),[B,S]=C(0),u=l[B]??l[0],O=De(),w=(O==null?void 0:O.chosen)??X;m(()=>{if(!w)return;const e=l.findIndex(r=>r.language&&r.language!=="none"&&Re(r.language,w));if(e<0)return;S(e);const t=l[e];R(t)&&o.captions.get()!==t.id&&o.captions.emit(t.id)},[w,l,o]),m(()=>{const e=t=>{const r=l.findIndex(d=>R(d)&&d.id===t);r>=0&&S(r)};return e(o.captions.get()),o.captions.subscribe(e)},[o,l]);const[c,G]=C([]),[ve,J]=C([]);m(()=>{if(G([]),J([]),!u)return;let e=true;return(u.read==="cues"?Fe(u.id,o.request).then(t=>e&&G(He(t))):Ve(u.id,o.request).then(t=>e&&J(Ke(t)))).catch(()=>{}),()=>{e=false}},[u,o]);const h=Se(o.media.subscribe,o.media.get,o.media.get),N=Ze(h,c),A=L(null);m(()=>{var t;if(!v||N<0||!h||h.paused)return;const e=(t=A.current)==null?void 0:t.children[N];e&&pe(e,"nearest")},[N,v,h]);const[Q,W]=C(""),f=q(Q.trim()),b=ie(()=>f?c.flatMap((e,t)=>q(e.text).includes(f)?[t]:[]):[],[c,f]),[E,he]=C({query:"",at:0}),x=E.query===f?E.at:0,P=L(null),z=L(false),[Y,be]=C({cues:[],count:j}),Z=Y.cues===c?Y.count:j,F=()=>be({cues:c,count:Z+j}),_=L(F);_.current=F;const V=typeof IntersectionObserver<"u",y=V?Math.min(c.length,Math.max(Z,N+1,(b[x]??-1)+1)):c.length,ee=L(null);m(()=>{const e=ee.current;if(!e||!V||y>=c.length)return;const t=new IntersectionObserver(r=>{r.some(d=>d.isIntersecting)&&_.current()},{root:Ue(e),rootMargin:"0px 0px 400px 0px"});return t.observe(e),()=>t.disconnect()},[V,y,c.length]);const I=b[x];m(()=>{var t;if(I===void 0)return;const e=(t=A.current)==null?void 0:t.children[I];e&&pe(e,"nearest"),z.current=false},[I,f]);const Ce=c.length>0;m(()=>{var d;const e=(d=P.current)==null?void 0:d.closest(".clover-transcript-find"),t=e==null?void 0:e.parentElement;if(!a||!e||!t||typeof ResizeObserver>"u")return;const r=new ResizeObserver(()=>t.style.setProperty("--clover-transcript-find",`${e.offsetHeight}px`));return r.observe(e),()=>{r.disconnect(),t.style.removeProperty("--clover-transcript-find")}},[a,Ce,g]);const H=we(),te=Je(),ne=l.every(R)?"playerCaptions":"transcriptLabel",se=We(D(ne),U(ne));if(!T||!u)return null;const Te=l.filter(e=>e.read==="text").length,re=l.map(e=>{const t=Ge(e.language);return e.read==="cues"?t:Te>1&&t?`TXT ${t}`:"TXT"}),xe=re.map(e=>e&&re.filter(t=>t===e).length===1?e:void 0),ae=u.language&&u.language!=="none"?u.language:void 0,K=l.length>1&&!O&&n(le,{children:[se.node,n("fieldset",{...se.props,className:"clover-transcript-languages",children:l.map((e,t)=>{const r=Ae(e.label,X),d=xe[t],ke=r.text||e.language||String(t+1);return n("label",{className:"clover-transcript-language",children:[n("input",{type:"radio",name:`${H}-language`,checked:t===B,onChange:()=>{S(t),R(e)&&o.captions.emit(e.id)}}),d&&n(le,{children:[n("span",{className:"clover-transcript-code",children:d})," "]}),n("span",{style:d?Ee:void 0,...$(r.text?r.lang:void 0),children:ke}),d&&r.text&&n(Qe,{label:r.text,lang:r.lang})]},e.id)})})]}),ce=(e,t=true)=>{if(h){t?ze(h,e.start):h.currentTime=e.start;return}o.goTo(T.id,{time:e.start,...t&&{autoplay:true}})},oe=e=>{const t=c[b[e]];t&&(z.current=true,he({query:f,at:e}),ce(t,false))},ye={position:b.length?x:-1,total:b.length,step:e=>oe(x+e)},k=b.length,M=f?k===0?"contentSearchResultsNone":k===1?"contentSearchResult":"contentSearchResults":null,Ne=g&&u.read==="cues"&&c.length>0&&n("div",{className:"clover-transcript-find",children:[n(Be,{ref:P,id:`${H}-find`,value:Q,onChange:W,onSubmit:()=>{if(!k)return;const e=E.query===f&&z.current;oe(e?(x+1)%k:x)},onClear:()=>{var e;W(""),(e=P.current)==null||e.focus()},results:f?ye:null,size:p,classes:{form:"clover-transcript-find-field"}}),n("p",{className:"clover-transcript-find-status",role:"status",...$(M?U(M):void 0),children:M?D(M,{count:k}):""})]});return n(i,{ref:me,className:qe("clover-transcript",fe),"data-sticky":a||void 0,...ge,children:[K&&(te?Pe(K,te):K),Ne,u.read==="text"?n("div",{className:"clover-transcript-body",...$(ae),children:ve.map((e,t)=>n("p",{children:e},t))}):n("ol",{ref:A,className:"clover-transcript-cues",id:`${H}-cues`,...$(ae),children:c.slice(0,y).map((e,t)=>n("li",{className:"clover-transcript-cue","aria-current":t===N?"true":void 0,"data-match":f&&b.includes(t)?t===I?"current":"true":void 0,children:n("button",{type:"button",onClick:()=>ce(e),onFocus:()=>{y<c.length&&t>=y-5&&F()},children:[n(Xe,{start:e.start,className:"clover-transcript-time"}),n("span",{className:"clover-transcript-text clover-cue-text",children:[e.voice&&n("span",{className:"clover-transcript-voice",children:[e.voice,":"," "]}),Ye(e.text,f)]})]})},`${e.start}-${t}`))}),u.read==="cues"&&y<c.length&&n("div",{ref:ee,className:"clover-transcript-more","aria-hidden":"true"})]})});function Ze(s,i){const[v,g]=C(-1);return m(()=>{if(!s||!i.length){g(-1);return}const a=()=>g(je(i,s.currentTime));return a(),s.addEventListener("timeupdate",a),s.addEventListener("seeked",a),()=>{s.removeEventListener("timeupdate",a),s.removeEventListener("seeked",a)}},[s,i]),v}export{ft as Transcript};
1
+ import{D as Le,a as Oe,e as Ie,c as $e,n as Me,T as ie,d as C,y as m,N as Re,C as Se,A as L,b as we,u as n,t as Ee,k as le,l as M,v as Ae,$ as Pe,E as ze}from"./shared-DFAX0n3B.mjs";import{c as ue,a as de}from"./layout-B29v2RKK.mjs";import{l as Fe,a as Ve,p as He,b as Ke,c as je}from"./vtt-C5M5WPSG.mjs";import{j as qe}from"./classnames-DukgfdpI.mjs";import{u as De}from"./readingLanguages-FyVsSWJ8.mjs";import{b as pe,s as Ue}from"./bringIntoView-CQH5ZgMM.mjs";import{C as Xe}from"./Cue-xuo5dgKE.mjs";import{F as Be}from"./FieldPill-CVfeeafm.mjs";import{l as Ge}from"./languageCode-cCpiU0b0.mjs";import{a as Je}from"./Sections-DZVrhoAC.mjs";import{T as Qe}from"./Tip-nJSTYquc.mjs";import{u as We}from"./useContainerName-_48Cdi0m.mjs";import"./styles-BwkYiCLC.mjs";const j=40,q=s=>s.toLocaleLowerCase();function Ye(s,i){if(!i)return s;const v=q(s),g=[];let a=0;for(let p=v.indexOf(i);p>=0;p=v.indexOf(i,p+i.length))p>a&&g.push(s.slice(a,p)),g.push(n("mark",{children:s.slice(p,p+i.length)},p)),a=p+i.length;return a<s.length&&g.push(s.slice(a)),g}const R=s=>s.read==="cues"&&s.kind!=="transcript",ft=Le(function({as:i="div",follow:v=true,find:g=true,sticky:a=false,size:p="large",className:fe,...ge},me){const{t:D,langOf:U}=Oe(),{clover:o,language:X}=Ie("Transcript"),T=$e(e=>Me(e.manifest,e.canvasId)).find(e=>ue(e).length>0||de(e).length>0),l=ie(()=>T?[...ue(T).map(e=>({...e,read:"cues"})),...de(T).map(e=>({...e,read:"text"}))]:[],[T]),[B,S]=C(0),u=l[B]??l[0],O=De(),w=(O==null?void 0:O.chosen)??X;m(()=>{if(!w)return;const e=l.findIndex(r=>r.language&&r.language!=="none"&&Re(r.language,w));if(e<0)return;S(e);const t=l[e];R(t)&&o.captions.get()!==t.id&&o.captions.emit(t.id)},[w,l,o]),m(()=>{const e=t=>{const r=l.findIndex(d=>R(d)&&d.id===t);r>=0&&S(r)};return e(o.captions.get()),o.captions.subscribe(e)},[o,l]);const[c,G]=C([]),[ve,J]=C([]);m(()=>{if(G([]),J([]),!u)return;let e=true;return(u.read==="cues"?Fe(u.id,o.request).then(t=>e&&G(He(t))):Ve(u.id,o.request).then(t=>e&&J(Ke(t)))).catch(()=>{}),()=>{e=false}},[u,o]);const h=Se(o.media.subscribe,o.media.get,o.media.get),y=Ze(h,c),E=L(null);m(()=>{var t;if(!v||y<0||!h||h.paused)return;const e=(t=E.current)==null?void 0:t.children[y];e&&pe(e,"nearest")},[y,v,h]);const[Q,W]=C(""),f=q(Q.trim()),b=ie(()=>f?c.flatMap((e,t)=>q(e.text).includes(f)?[t]:[]):[],[c,f]),[A,he]=C({query:"",at:0}),x=A.query===f?A.at:0,P=L(null),z=L(false),[Y,be]=C({cues:[],count:j}),Z=Y.cues===c?Y.count:j,F=()=>be({cues:c,count:Z+j}),_=L(F);_.current=F;const V=typeof IntersectionObserver<"u",N=V?Math.min(c.length,Math.max(Z,y+1,(b[x]??-1)+1)):c.length,ee=L(null);m(()=>{const e=ee.current;if(!e||!V||N>=c.length)return;const t=new IntersectionObserver(r=>{r.some(d=>d.isIntersecting)&&_.current()},{root:Ue(e),rootMargin:"0px 0px 400px 0px"});return t.observe(e),()=>t.disconnect()},[V,N,c.length]);const I=b[x];m(()=>{var t;if(I===void 0)return;const e=(t=E.current)==null?void 0:t.children[I];e&&pe(e,"nearest"),z.current=false},[I,f]);const Ce=c.length>0;m(()=>{var d;const e=(d=P.current)==null?void 0:d.closest(".clover-transcript-find"),t=e==null?void 0:e.parentElement;if(!a||!e||!t||typeof ResizeObserver>"u")return;const r=new ResizeObserver(()=>t.style.setProperty("--clover-transcript-find",`${e.offsetHeight}px`));return r.observe(e),()=>{r.disconnect(),t.style.removeProperty("--clover-transcript-find")}},[a,Ce,g]);const H=we(),te=Je(),ne=l.every(R)?"playerCaptions":"transcriptLabel",se=We(D(ne),U(ne));if(!T||!u)return null;const Te=l.filter(e=>e.read==="text").length,re=l.map(e=>{const t=Ge(e.language);return e.read==="cues"?t:Te>1&&t?`TXT ${t}`:"TXT"}),xe=re.map(e=>e&&re.filter(t=>t===e).length===1?e:void 0),ae=u.language&&u.language!=="none"?u.language:void 0,K=l.length>1&&!O&&n(le,{children:[se.node,n("fieldset",{...se.props,className:"clover-transcript-languages",children:l.map((e,t)=>{const r=Ee(e.label,X),d=xe[t],ke=r.text||e.language||String(t+1);return n("label",{className:"clover-transcript-language",children:[n("input",{type:"radio",name:`${H}-language`,checked:t===B,onChange:()=>{S(t),R(e)&&o.captions.emit(e.id)}}),d&&n(le,{children:[n("span",{className:"clover-transcript-code",children:d})," "]}),n("span",{style:d?Ae:void 0,...M(r.text?r.lang:void 0),children:ke}),d&&r.text&&n(Qe,{label:r.text,lang:r.lang})]},e.id)})})]}),ce=(e,t=true)=>{if(h){t?ze(h,e.start):h.currentTime=e.start;return}o.goTo(T.id,{time:e.start,...t&&{autoplay:true}})},oe=e=>{const t=c[b[e]];t&&(z.current=true,he({query:f,at:e}),ce(t,false))},Ne={position:b.length?x:-1,total:b.length,step:e=>oe(x+e)},k=b.length,$=f?k===0?"contentSearchResultsNone":k===1?"contentSearchResult":"contentSearchResults":null,ye=g&&u.read==="cues"&&c.length>0&&n("div",{className:"clover-transcript-find",children:[n(Be,{ref:P,id:`${H}-find`,value:Q,onChange:W,onSubmit:()=>{if(!k)return;const e=A.query===f&&z.current;oe(e?(x+1)%k:x)},onClear:()=>{var e;W(""),(e=P.current)==null||e.focus()},results:f?Ne:null,size:p,classes:{form:"clover-transcript-find-field"}}),n("p",{className:"clover-transcript-find-status",role:"status",...M($?U($):void 0),children:$?D($,{count:k}):""})]});return n(i,{ref:me,className:qe("clover-transcript",fe),"data-sticky":a||void 0,...ge,children:[K&&(te?Pe(K,te):K),ye,u.read==="text"?n("div",{className:"clover-transcript-body",...M(ae),children:ve.map((e,t)=>n("p",{children:e},t))}):n("ol",{ref:E,className:"clover-transcript-cues",id:`${H}-cues`,...M(ae),children:c.slice(0,N).map((e,t)=>n("li",{className:"clover-transcript-cue","aria-current":t===y?"true":void 0,"data-match":f&&b.includes(t)?t===I?"current":"true":void 0,children:n("button",{type:"button",onClick:()=>ce(e),onFocus:()=>{N<c.length&&t>=N-5&&F()},children:[n(Xe,{start:e.start,className:"clover-transcript-time"}),n("span",{className:"clover-transcript-text clover-cue-text",children:[e.voice&&n("span",{className:"clover-transcript-voice",children:[e.voice,":"," "]}),Ye(e.text,f)]})]})},`${e.start}-${t}`))}),u.read==="cues"&&N<c.length&&n("div",{ref:ee,className:"clover-transcript-more","aria-hidden":"true"})]})});function Ze(s,i){const[v,g]=C(-1);return m(()=>{if(!s||!i.length){g(-1);return}const a=()=>g(je(i,s.currentTime));return a(),s.addEventListener("timeupdate",a),s.addEventListener("seeked",a),()=>{s.removeEventListener("timeupdate",a),s.removeEventListener("seeked",a)}},[s,i]),v}export{ft as Transcript};
@@ -0,0 +1 @@
1
+ import{a as he,A as N,d as M,_ as z,T as Te,u as e,ai as B,l as F,ac as ke,y as Ne,k as le}from"./shared-DFAX0n3B.mjs";import{u as Ce,g as we,a as Ee,b as ce,l as Se,s as Pe,T as A,P as Fe,c as Ie,V as Oe,d as $e,C as Be,F as Me,e as Re,E as Ve,f as xe,p as De}from"./Transport-VUxSEIQO.mjs";import{imageSource as Ae}from"./thumbnail-EbURh-UM.mjs";import{u as Ke,P as Le,E as Ue}from"./EntryThumbnail-DxHhfRo_.mjs";import{j as je}from"./classnames-DukgfdpI.mjs";import{l as ue}from"./languageCode-cCpiU0b0.mjs";import{T as pe,S as ie}from"./Tip-nJSTYquc.mjs";import{u as qe}from"./useContainerName-_48Cdi0m.mjs";import{u as ze,t as _e}from"./pointer-CJELU3gI.mjs";import"./styles-BwkYiCLC.mjs";const Xe=a=>typeof(a==null?void 0:a.thumbnail)=="string"?{src:a.thumbnail}:Ae(a==null?void 0:a.thumbnail);function de(a,i){var h;let b=-1;a.forEach((I,C)=>{I.start<=i&&(b=C)});const f=(h=a[b])==null?void 0:h.end;return f!==void 0&&i>=f?-1:b}let q;function Ze(){if(q===void 0){if(typeof document>"u")return true;const a=document.createElement("video");a.volume=.5,q=a.volume===.5}return q}function Ge({id:a,label:i,labelLang:b,button:f,icon:h,active:I,current:C,options:O,selected:R,onSelect:l,request:K,asMenu:$=false}){const[p,m]=M(false),d=N(null),g=N(null),V=N(null),w=N(false),E=qe(i,b),T=O.some(r=>ue(r.language));ke(p,()=>m(false));const o=()=>{var r;m(false),(r=g.current)==null||r.focus()};return Ne(()=>{if(!p)return;const r=t=>{var c,u,k;if(t instanceof KeyboardEvent){if(t.key!=="Escape")return;(c=d.current)!=null&&c.contains(document.activeElement)&&(t.preventDefault(),(u=g.current)==null||u.focus())}else if((k=d.current)!=null&&k.contains(t.target))return;m(false)};return document.addEventListener("pointerdown",r),document.addEventListener("keydown",r,true),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("keydown",r,true)}},[p]),z(()=>{const r=V.current,t=d.current,c=t==null?void 0:t.closest(".clover-canvas-transport"),u=t==null?void 0:t.closest(".clover-canvas-media");if(!p||!r||!t||!c||!u)return;const k=()=>De(r,t,c,u);k();const S=new ResizeObserver(k);return S.observe(u),S.observe(c),S.observe(r),()=>S.disconnect()},[p]),e("div",{className:"clover-canvas-transport-menu",ref:d,onBlur:r=>{var c;const t=r.relatedTarget;p&&t instanceof Node&&!((c=d.current)!=null&&c.contains(t))&&m(false)},children:[e("button",{"aria-controls":a,"aria-describedby":C?`${a}-current`:void 0,"aria-expanded":p,"aria-label":i,...F(b),className:"clover-canvas-transport-button","data-active":I?"":void 0,"data-button":f,onClick:()=>m(r=>!r),ref:g,type:"button",children:[h,e(pe,{label:i})]}),C&&e("span",{hidden:true,id:`${a}-current`,...F(C.lang),children:C.label}),p&&E.node,p&&e("fieldset",{...E.props,className:je("clover-canvas-transport-options",$&&"clover-canvas-menu"),id:a,ref:V,children:O.map((r,t)=>{const c=ue(r.language);return e("label",{className:"clover-canvas-transport-option",onPointerDown:()=>{w.current=true},children:[e("input",{checked:R===t,name:a,onChange:()=>l(t),onClick:()=>{w.current&&o()},onKeyDown:u=>{w.current=false,u.key==="Enter"&&(u.preventDefault(),l(t),o())},type:"radio"}),r.time&&e(le,{children:[e("span",{className:"clover-cue-time",children:r.time})," "]}),T&&(c?e(le,{children:[e("span",{className:"clover-canvas-transport-code",children:c})," "]}):e("span",{className:"clover-canvas-transport-code","aria-hidden":"true"})),e("span",{className:"clover-cue-text",...F(r.lang),children:r.label}),R===t&&e(Ue,{source:r.thumbnail,request:K,large:true})]},t)})})]})}const Je=a=>a.querySelector(":scope > .clover-tip"),Qe=a=>{try{return a.matches(":focus-visible")}catch{return false}},ln=({instance:a,controller:i,kind:b,captions:f,activeCaption:h,onCaptionChange:I,fullscreen:C=false,isFullscreen:O=false,video:R,chapters:l=[],highlightedChapter:K=null,onChapterHighlight:$,request:p,fill:m})=>{var te,re;const{t:d,langOf:g}=he(),V=ze()||b==="video",w=N(null);Ce(w);const{paused:E,currentTime:T,duration:o,buffered:r,muted:t,volume:c}=i,u=de(l,T),[k,S]=M(-1),[_,me]=M(0),X=N(-1),Z=n=>{var s;X.current!==n&&(X.current=n,S(n),$==null||$(((s=l[n])==null?void 0:s.id)??null))},[G,J]=M(false),[x,Q]=M(false),y=x?k:G?u:-1,W=(x||G)&&o>0,ve=Ke(Xe(l[y]),Le,p),L=k>=0?k:l.findIndex(n=>n.id!==void 0&&n.id===K),Y=N(null);z(()=>{const n=Y.current,s=n==null?void 0:n.closest(".clover-canvas"),v=n&&y>=0?Je(n):null;if(!s||!v)return;const ae="--clover-transport-preview-top",oe=()=>s.style.setProperty(ae,`${s.getBoundingClientRect().bottom-v.getBoundingClientRect().top}px`);oe();const se=new ResizeObserver(oe);return se.observe(v),()=>{se.disconnect(),s.style.removeProperty(ae)}},[y]);const D=n=>{const{start:s,end:v=o}=l[n];return{left:s/o*100,width:(v-s)/o*100}},fe=E?"playerPlay":"playerPause",H={label:d("playerCaptionsOff"),lang:g("playerCaptionsOff")},ge=t?"playerUnmute":"playerMute",ye=O?"imageExitFullScreen":"imageFullScreen",ee=o?T/o*100:0,U=Te(()=>{const n=we(l,o);return n.length?Ee(n):void 0},[l,o]),be=o?r/o*100:0,j=C&&V,P=N(null),ne=N(null);return z(()=>{var v;const n=P.current;if(!n||n.isConnected)return;P.current=null;const s=document.activeElement;(!s||s===document.body)&&((v=ne.current)==null||v.focus())},[f.length,l.length,j]),e("div",{className:"clover-canvas-transport","data-kind":b,"data-testid":"clover-canvas-transport",onFocus:n=>{P.current=n.target},onBlur:n=>{const s=n.target,v=n.relatedTarget;if(v instanceof Node){n.currentTarget.contains(v)||(P.current=null);return}queueMicrotask(()=>{P.current===s&&s.isConnected&&(P.current=null)})},children:[e("div",{ref:Y,className:"clover-canvas-transport-seek-area",onPointerMove:n=>{if(!o||n.target.closest(".clover-tip"))return;const s=Pe(n.currentTarget,n.clientX)*o;Q(true),me(Math.floor(s)),Z(de(l,s))},onPointerLeave:()=>{Q(false),Z(-1)},style:W?{"--clover-transport-preview":ce(y>=0?D(y).left+D(y).width/2:(x?_:T)/o*100)}:void 0,children:[e("input",{"aria-label":d("playerSeek"),lang:g("playerSeek"),"aria-valuetext":`${B(T)} / ${B(o)}${u>=0?`, ${l[u].label}`:""}`,className:"clover-canvas-transport-seek",onFocus:n=>J(Qe(n.currentTarget)),onBlur:()=>J(false),max:o||0,min:0,onChange:n=>i.seek(Number(n.target.value)),step:"any","data-gaps":U?"":void 0,style:{"--clover-transport-progress":`${ee}%`,"--clover-transport-loaded":`${be}%`,...U&&{"--clover-transport-gaps":U,"--clover-transport-at":ee/100}},type:"range",value:T}),L>=0&&o>0&&e("span",{"aria-hidden":"true",className:"clover-canvas-transport-chapter-span",style:{left:ce(D(L).left),width:Se(D(L).width)}}),W&&e(pe,{lead:B(x?_:T),label:((te=l[y])==null?void 0:te.label)??"",lang:(re=l[y])==null?void 0:re.lang,image:y>=0?ve:void 0},y)]}),e("div",{className:"clover-canvas-transport-bar",ref:w,children:[e(A,{words:fe,button:E?"play":"pause",shortcut:ie.play,onClick:i.toggle,buttonRef:ne,children:E?e(Fe,{}):e(Ie,{})}),e(A,{words:ge,button:"mute",shortcut:ie.mute,onClick:i.toggleMute,children:t||c===0?e(Oe,{}):e($e,{})}),Ze()&&e("input",{"aria-label":d("playerVolume"),lang:g("playerVolume"),className:"clover-canvas-transport-volume",max:1,min:0,onChange:n=>i.setVolume(Number(n.target.value)),step:.05,style:{"--clover-transport-progress":`${(t?0:c)*100}%`},type:"range",value:t?0:c}),e("span",{className:"clover-canvas-transport-status",children:[e("span",{className:"clover-canvas-transport-time",children:[e("span",{"aria-label":d("playerCurrentTime"),...F(g("playerCurrentTime")),children:B(T)}),e("span",{"aria-hidden":"true",children:" / "}),e("span",{"aria-label":d("playerDuration"),...F(g("playerDuration")),children:B(o)})]}),u>=0&&e("span",{className:"clover-canvas-transport-chapter",...F(l[u].lang),children:l[u].label})]}),(f.length>0||j||m)&&e("div",{className:"clover-canvas-transport-end",children:[f.length>0&&e(Ge,{id:`${a}-captions`,label:d("playerCaptions"),labelLang:g("playerCaptions"),button:"captions",icon:e(Be,{on:h>=0}),active:h>=0,current:f[h]??H,options:[H,...f],selected:h+1,onSelect:n=>I(n-1)}),m&&e(A,{words:m.filled?"playerFit":"playerFill",button:"fill",onClick:m.onToggle,children:m.filled?e(Me,{}):e(Re,{})}),j&&e(A,{words:ye,button:"fullscreen",onClick:n=>void _e(n.currentTarget,R),children:O?e(Ve,{}):e(xe,{})})]})]})]})};export{ln as T,Xe as a,de as c};
@@ -0,0 +1 @@
1
+ import{a as b,u as o,l as g,_ as m}from"./shared-DFAX0n3B.mjs";import{T as x}from"./Tip-nJSTYquc.mjs";import{f,g as k}from"./pointer-CJELU3gI.mjs";import{a as y}from"./index-DspT4wUm.mjs";function T({words:r,button:e,shortcut:t,disabled:n,pressed:s,onClick:a,buttonRef:c,children:v}){const{t:i,langOf:h}=b(),d=i(r);return o("button",{"aria-label":d,...g(h(r)),"aria-keyshortcuts":t==null?void 0:t.keys,"aria-disabled":n||void 0,"aria-pressed":s,className:"clover-canvas-transport-button","data-button":e,onClick:a,ref:c,type:"button",children:[v,o(x,{label:d,shortcut:t})]})}function B(r){m(()=>{const e=r.current,t=e==null?void 0:e.closest(".clover-canvas");if(!e||!t)return;const n=()=>{const a=e.offsetHeight;a&&t.style.setProperty("--clover-transport-bar-height",`${a}px`)};n();const s=new ResizeObserver(n);return s.observe(e),()=>{s.disconnect(),t.style.removeProperty("--clover-transport-bar-height")}},[r])}const p=r=>`var(--clover-transport-thumb) / 2 + (100% - var(--clover-transport-thumb)) * ${r/100}`,F=r=>`calc(${p(r)})`,H=r=>`calc((100% - var(--clover-transport-thumb)) * ${r/100})`;function P(r){const e="var(--clover-transport-gap) / 2";return`linear-gradient(to right, ${[...r.flatMap(n=>[`#000 0 calc(${p(n)} - ${e})`,`transparent 0 calc(${p(n)} + ${e})`]),"#000 0"].join(", ")})`}function $(r,e){if(!(e>0))return[];const t=(a,c)=>Math.abs(a-c)<.05,n=[],s=a=>{a>0&&a<e&&!n.some(c=>t(c,a))&&n.push(a)};for(const a of r)s(a.start);for(const a of r)a.end!==void 0&&Number.isFinite(a.end)&&!r.some(c=>t(c.start,a.end))&&s(a.end);return n.sort((a,c)=>a-c).map(a=>a/e*100)}function L(r,e){const t=r.querySelector("input")??r,n=t.getBoundingClientRect(),s=parseFloat(getComputedStyle(t).getPropertyValue("--clover-transport-thumb"))||0,a=n.width-s;return a>0?Math.min(1,Math.max(0,(e-n.left-s/2)/a)):0}function I(r,e,t,n){const s=n.getBoundingClientRect(),a=s.height-(t.getBoundingClientRect().bottom-e.getBoundingClientRect().top);r.style.setProperty("--clover-transport-menu-above",`${a}px`),r.style.removeProperty("--clover-transport-menu-shift");const c=r.getBoundingClientRect(),v=parseFloat(getComputedStyle(t).paddingRight)||0,i=Math.max(s.left+v-c.left,Math.min(0,s.right-v-c.right));i&&r.style.setProperty("--clover-transport-menu-shift",`${i}px`)}const l={xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 512 512","aria-hidden":true,focusable:false},S=()=>o("svg",{...l,children:o("path",{d:"M133 440a35.37 35.37 0 01-17.5-4.67c-12-6.8-19.46-20-19.46-34.33V111c0-14.37 7.46-27.53 19.46-34.33a35.13 35.13 0 0135.77.45l247.85 148.36a36 36 0 010 61.11L151.23 435a35.5 35.5 0 01-18.23 5z"})}),V=()=>o("svg",{...l,children:o("path",{d:"M224 432h-80V80h80zm144 0h-80V80h80z"})}),q=()=>o("svg",{...l,children:[o("path",{d:"M232 416a23.88 23.88 0 01-14.2-4.68 8.27 8.27 0 01-.66-.51L125.76 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.75l91.37-74.81a8.27 8.27 0 01.66-.51A24 24 0 01256 120v272a24 24 0 01-24 24z"}),o("path",{d:"M320 336a16 16 0 01-14.29-23.16c8.34-16.63 12.29-34.5 12.29-56.84s-3.95-40.21-12.29-56.84a16 16 0 0128.58-14.32C345.06 205.86 350 228.13 350 256s-4.94 50.14-15.71 71.16A16 16 0 01320 336zM368 384a16 16 0 01-13.87-24C373.85 325.75 384 292.28 384 256c0-36.28-10.15-69.75-29.87-104a16 16 0 0127.74-16C404.19 174.71 416 214.17 416 256s-11.81 81.29-34.13 120A16 16 0 01368 384z",fillOpacity:"0.85"})]}),R=()=>o("svg",{...l,children:[o("path",{d:"M232 416a23.88 23.88 0 01-14.2-4.68 8.27 8.27 0 01-.66-.51L125.76 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.75l91.37-74.81a8.27 8.27 0 01.66-.51A24 24 0 01256 120v272a24 24 0 01-24 24z"}),o("path",{d:"M320 196l128 120M448 196L320 316",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"32"})]}),j=({on:r=false})=>o("svg",{...l,"data-on":r||void 0,className:"clover-captions-icon",children:[r?o("rect",{x:"22",y:"86",width:"468",height:"340",rx:"74",fill:"currentColor"}):o("rect",{x:"40",y:"104",width:"432",height:"304",rx:"56",fill:"none",stroke:"currentColor",strokeWidth:"36"}),o("path",{className:"clover-captions-icon-letters",d:"M228 216a48 48 0 1 0 0 80M356 216a48 48 0 1 0 0 80",fill:"none",stroke:r?"var(--clover-color-control, #1a1d1e)":"currentColor",strokeLinecap:"round",strokeWidth:"36"})]}),u=()=>o("rect",{x:"40",y:"104",width:"432",height:"304",rx:"56",fill:"none",stroke:"currentColor",strokeWidth:"36"}),W=()=>o("svg",{...l,children:[o(u,{}),o("path",{d:"M204 208l-48 48 48 48M308 208l48 48-48 48",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"36"})]}),O=()=>o("svg",{...l,children:[o(u,{}),o("path",{d:"M140 208l48 48-48 48M372 208l-48 48 48 48",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"36"})]}),A=()=>o("svg",{...l,children:o(k,{})}),N=()=>o("svg",{...l,children:o(f,{})});y(14,"components/Canvas/media/Transport",'@layer clover{.clover-canvas{--clover-transport-room: calc( var(--clover-transport-bar-height, var(--clover-control)) + var(--clover-space-l) + var(--clover-space-xs) + var(--clover-canvas-controls-inset) + var(--clover-space-m) )}.clover-canvas-transport{position:absolute;inset:auto 0 0;z-index:2;display:flex;flex-direction:column;padding:var(--clover-space-xl) var(--clover-canvas-controls-inset) var(--clover-canvas-controls-inset);--clover-controls-edge: 1;--clover-transport-thumb: 12px;--clover-transport-track: var(--clover-space-xs);-webkit-user-select:none;user-select:none;--clover-transport-menu-room: calc( 100cqb - var(--clover-canvas-controls-inset) - var(--clover-control) - var(--clover-space-s) - var(--clover-space-xs) )}.clover-canvas-transport:before{position:absolute;inset:0;z-index:-1;background:linear-gradient(to top,#000000c7,#0009 calc(100% - var(--clover-space-xl)),#0000);pointer-events:none;content:""}.clover-canvas-transport:has([aria-expanded=true],:focus-visible,>.clover-canvas-transport-seek-area:hover){z-index:4}.clover-canvas-transport-bar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--clover-space-xs) var(--clover-space-s);min-width:0}.clover-canvas-transport-bar>*{flex-shrink:0}.clover-canvas-transport-bar>:is(:hover,:active,:focus-within){z-index:1}.clover-canvas-transport-bar>.clover-canvas-transport-status{display:flex;flex:1 1 0;align-items:center;gap:var(--clover-space-s);min-width:min-content}.clover-canvas-transport-end{display:flex;gap:var(--clover-space-s);margin-inline-start:auto}@container (max-width: 37.5rem){.clover-canvas-transport-bar:has([data-button=chapters])>.clover-canvas-transport-status{order:-1;flex-basis:100%}.clover-canvas-transport-status>.clover-canvas-transport-chapter{max-width:none}}@container (max-width: 28rem){.clover-canvas-transport-bar>.clover-canvas-transport-status{order:-1;flex-basis:100%}}.clover-canvas-transport-button svg{fill:currentColor;stroke:none}.clover-canvas-transport-button svg [stroke]{fill:none}.clover-canvas-transport-button:hover,.clover-canvas-transport-button:focus-visible{background-color:var(--clover-color-accent, #0065c3)}:where([data-high-contrast]) .clover-canvas-transport-button:is(:hover,:focus-visible){background-color:var(--clover-accent-fill)}:where([data-high-contrast]) .clover-canvas-transport-button:hover:not(:focus-visible){outline:var(--clover-accent-ring-hover);outline-offset:1px}button.clover-canvas-transport-button[aria-pressed=true]:after{content:"";position:absolute;inset-inline:var(--clover-space-s);bottom:var(--clover-space-2xs);border-bottom:2px solid;border-radius:1px}.clover-canvas-transport-button:focus-visible{outline:none;box-shadow:0 0 0 2px var(--clover-color-secondary, #fff),0 0 0 4px var(--clover-color-accent, #0065c3)}.clover-canvas-transport-seek-area{position:relative;display:flex;margin-bottom:var(--clover-space-xs);--clover-transport-gap: var(--clover-space-2xs)}.clover-canvas-transport input[type=range]{appearance:none;-webkit-appearance:none;width:100%;height:var(--clover-space-l);margin:0;background:transparent;cursor:pointer;touch-action:none}.clover-canvas-transport input.clover-canvas-transport-volume{width:var(--clover-space-2xl)}@container (max-width: 28rem){.clover-canvas-transport input.clover-canvas-transport-volume{width:var(--clover-space-xl)}.clover-canvas-transport-bar,.clover-canvas-transport-end{column-gap:var(--clover-space-xs)}}.clover-canvas-transport input[type=range]::-webkit-slider-runnable-track{height:var(--clover-transport-track);border-radius:var(--clover-radius, 3px);background:linear-gradient(to right,var(--clover-color-accent, #0065c3) var(--clover-transport-progress, 0%),rgb(255 255 255 / 90%) var(--clover-transport-progress, 0%),rgb(255 255 255 / 90%) var(--clover-transport-loaded, 0%),var(--clover-player-track, rgb(255 255 255 / 65%)) var(--clover-transport-loaded, 0%));box-shadow:var(--clover-player-track-shadow, none)}.clover-canvas-transport input[type=range]::-moz-range-track{height:var(--clover-transport-track);border-radius:var(--clover-radius, 3px);background:linear-gradient(to right,var(--clover-color-accent, #0065c3) var(--clover-transport-progress, 0%),rgb(255 255 255 / 90%) var(--clover-transport-progress, 0%),rgb(255 255 255 / 90%) var(--clover-transport-loaded, 0%),var(--clover-player-track, rgb(255 255 255 / 65%)) var(--clover-transport-loaded, 0%));box-shadow:var(--clover-player-track-shadow, none)}.clover-canvas-transport input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:var(--clover-transport-thumb);height:var(--clover-transport-thumb);margin-top:calc((var(--clover-transport-track) - var(--clover-transport-thumb)) / 2);border:none;border-radius:var(--clover-radius-pill, 2rem);background-color:var(--clover-player-text, #fff)}.clover-canvas-transport input[type=range]::-moz-range-thumb{width:var(--clover-transport-thumb);height:var(--clover-transport-thumb);border:none;border-radius:var(--clover-radius-pill, 2rem);background-color:var(--clover-player-text, #fff)}.clover-canvas-transport input[type=range]:focus-visible{outline:none}.clover-canvas-transport input[type=range]:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--clover-color-accent, #0065c3),0 0 0 4px var(--clover-player-text, #fff),0 0 0 6px #0009}.clover-canvas-transport input[type=range]:focus-visible::-moz-range-thumb{box-shadow:0 0 0 2px var(--clover-color-accent, #0065c3),0 0 0 4px var(--clover-player-text, #fff),0 0 0 6px #0009}.clover-canvas-transport-time{display:flex;align-items:center;gap:var(--clover-space-xs);color:var(--clover-player-text, #fff);font-size:var(--clover-text-s);font-variant-numeric:tabular-nums;white-space:nowrap;text-shadow:0 1px 2px rgb(0 0 0 / 90%)}.clover-canvas-transport-frames{position:relative;display:flex}button.clover-canvas-transport-time{margin:0;padding:var(--clover-space-2xs) var(--clover-space-xs);border:0;border-radius:var(--clover-radius, 3px);background:none;font:inherit;font-size:var(--clover-text-s);cursor:pointer}button.clover-canvas-transport-time:is(:hover,[aria-expanded=true]){background-color:#0006}button.clover-canvas-transport-time:focus-visible{outline:2px solid var(--clover-player-text, #fff)}.clover-canvas-transport-place{display:inline-grid;justify-items:end;font-variant-numeric:tabular-nums}.clover-canvas-transport-place>*{grid-area:1 / 1}.clover-canvas-transport-place>.clover-canvas-transport-place-room[hidden]{display:block;visibility:hidden}.clover-canvas-transport-frames>.clover-canvas-menu{right:0;bottom:calc(100% + var(--clover-space-s));left:auto;max-width:min(20rem,100cqi - 2 * var(--clover-canvas-controls-inset));max-height:min(24rem,var(--clover-transport-menu-room),var(--clover-transport-menu-above, 100cqb) - var(--clover-space-s) - var(--clover-space-xs));translate:var(--clover-transport-menu-shift, 0px) 0}.clover-canvas-transport-menu{position:relative;display:flex}.clover-canvas-transport-options{position:absolute;right:0;bottom:calc(100% + var(--clover-space-s));display:flex;flex-direction:column;box-sizing:border-box;min-width:min(11rem,100cqi - 2 * var(--clover-canvas-controls-inset));max-width:calc(100cqi - 2 * var(--clover-canvas-controls-inset));max-height:min(16rem,var(--clover-transport-menu-room),var(--clover-transport-menu-above, 100cqb) - var(--clover-space-s) - var(--clover-space-xs));translate:var(--clover-transport-menu-shift, 0px) 0;margin:0;padding:var(--clover-space-xs);border:none;border-radius:var(--clover-radius, 3px);background-color:var(--clover-player-menu-surface, #151718);color:var(--clover-player-text, #fff);overflow-y:auto}.clover-canvas-transport-option{display:flex;flex:none;align-items:center;gap:var(--clover-space-xs);min-height:var(--clover-space-l);padding:var(--clover-space-xs) var(--clover-space-s);border-radius:var(--clover-radius, 3px);font-size:var(--clover-text-s);cursor:pointer}.clover-canvas-transport-option:hover{background-color:var(--clover-player-menu-hover, #26292b)}.clover-canvas-transport-option:has(input:checked){background-color:color-mix(in srgb,var(--clover-color-accent, #0065c3) 24%,transparent);font-weight:600}.clover-canvas-transport-option:has(input:focus-visible){box-shadow:inset 0 0 0 2px var(--clover-player-text, #fff)}.clover-canvas-transport-code{flex:none;min-width:var(--clover-space-l);color:color-mix(in srgb,currentColor 72%,transparent);font-size:var(--clover-text-xs);font-weight:600;line-height:1}.clover-canvas-transport-options:has(.clover-canvas-transport-code),.clover-canvas-transport-menu:has([data-button=chapters]) .clover-canvas-transport-options{min-width:min(16rem,100cqi - 2 * var(--clover-canvas-controls-inset))}.clover-canvas-transport-option:has(>.clover-entry-thumbnail){display:grid;grid-template-columns:auto minmax(0,1fr);justify-items:start;gap:var(--clover-space-2xs) var(--clover-space-s);padding-block-end:var(--clover-space-s)}.clover-canvas-transport-options.clover-canvas-menu{border-radius:var(--clover-radius, 6px);background-color:var(--clover-color-secondary, #fff);color:var(--clover-color-primary, #1a1d1e)}.clover-canvas-menu>.clover-canvas-transport-option{align-items:baseline;gap:var(--clover-space-s);font-size:inherit}.clover-canvas-menu>.clover-canvas-transport-option:hover{background-color:var(--clover-color-secondary-muted, #e6e8eb)}@media (forced-colors: none){.clover-canvas-menu>.clover-canvas-transport-option:has(input:checked){background-color:color-mix(in srgb,var(--clover-color-accent, #0065c3) 8%,transparent)}}.clover-canvas-menu>.clover-canvas-transport-option:has(input:focus-visible){box-shadow:none;outline:2px solid var(--clover-color-accent, #0065c3);outline-offset:-2px}.clover-canvas-transport-option input{position:absolute;opacity:0;pointer-events:none}@media (forced-colors: active){.clover-canvas-transport button.clover-canvas-transport-button{border:1px solid ButtonText}.clover-canvas-transport input[type=range]{forced-color-adjust:none}.clover-canvas-transport input[type=range]::-webkit-slider-runnable-track{border:1px solid CanvasText;background:linear-gradient(to right,Highlight var(--clover-transport-progress, 0%),Canvas var(--clover-transport-progress, 0%));box-shadow:none}.clover-canvas-transport input[type=range]::-moz-range-track{border:1px solid CanvasText;background:linear-gradient(to right,Highlight var(--clover-transport-progress, 0%),Canvas var(--clover-transport-progress, 0%));box-shadow:none}.clover-canvas-transport input[type=range]::-webkit-slider-thumb,.clover-canvas-transport input[type=range]:focus-visible::-webkit-slider-thumb{background-color:CanvasText;box-shadow:0 0 0 2px Canvas}.clover-canvas-transport input[type=range]::-moz-range-thumb,.clover-canvas-transport input[type=range]:focus-visible::-moz-range-thumb{background-color:CanvasText;box-shadow:0 0 0 2px Canvas}.clover-canvas-transport input[type=range]:focus-visible{outline:2px solid CanvasText;outline-offset:2px}.clover-canvas-transport-button:focus-visible{outline:3px solid CanvasText;outline-offset:2px;box-shadow:none}.clover-canvas-transport-button:is([data-active],[aria-pressed=true]),.clover-canvas-transport-option:has(input:checked){background-color:Highlight;color:HighlightText}.clover-captions-icon[data-on] .clover-captions-icon-letters{stroke:ButtonFace}.clover-canvas-transport-button[data-active] .clover-captions-icon[data-on] .clover-captions-icon-letters{stroke:Highlight}}@media (prefers-reduced-motion: reduce){.clover-canvas-transport,.clover-canvas-transport-button,.clover-canvas-transport-button svg{transition:none}}.clover-canvas-transport-seek[data-gaps]{--clover-transport-disk: calc(var(--clover-transport-thumb) / 2 + 1px);-webkit-mask-image:radial-gradient(circle at calc(var(--clover-transport-thumb) / 2 + (100% - var(--clover-transport-thumb)) * var(--clover-transport-at, 0)) 50%,#000 var(--clover-transport-disk),transparent var(--clover-transport-disk)),var(--clover-transport-gaps);mask-image:radial-gradient(circle at calc(var(--clover-transport-thumb) / 2 + (100% - var(--clover-transport-thumb)) * var(--clover-transport-at, 0)) 50%,#000 var(--clover-transport-disk),transparent var(--clover-transport-disk)),var(--clover-transport-gaps)}.clover-canvas-transport-seek[data-gaps]:focus-visible{--clover-transport-disk: calc(var(--clover-transport-thumb) / 2 + 6px)}.clover-canvas-transport-chapter-span{position:absolute;top:50%;box-sizing:border-box;border-inline:calc(var(--clover-transport-gap) / 2) solid transparent;background-clip:padding-box;height:var(--clover-space-s);translate:0 -50%;border-radius:var(--clover-radius, 3px);background-color:var(--clover-player-text, #fff);opacity:.5;pointer-events:none}.clover-canvas-transport-seek-area>.clover-tip{left:var(--clover-transport-preview, 50%)}.clover-canvas-transport-seek-area>.clover-tip:has(>.clover-tip-image){padding:var(--clover-space-s)}.clover-canvas-transport-seek-area>.clover-tip .clover-tip-image{width:var(--clover-picture);max-height:none;margin-block-end:var(--clover-space-xs)}.clover-canvas-transport-seek-area:is(:hover,:has(>input:focus-visible)):not([data-tip-hidden])>.clover-tip{opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}@media (forced-colors: active){.clover-canvas-transport-chapter-span{background-color:Highlight;opacity:1}}.clover-canvas-transport-status>.clover-canvas-transport-chapter{flex:1 1 auto;overflow:hidden;width:0;min-width:0;max-width:16rem;color:color-mix(in srgb,var(--clover-player-text, #fff) 85%,transparent);font-size:var(--clover-text-s);text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 2px rgb(0 0 0 / 90%)}}');export{j as C,N as E,O as F,S as P,T,R as V,P as a,F as b,V as c,q as d,W as e,A as f,$ as g,H as l,I as p,L as s,B as u};
@@ -1 +1 @@
1
- import{O as l,av as g,at as u,aw as w,au as f}from"./shared-MTsMddHx.mjs";const y=100;async function p(t,n,i){if(typeof t=="string")return await f(n,t,i);const a=t;return a!=null&&a.id&&a.type==="AnnotationPage"&&!a.items?await f(n,a.id,i):a}async function h(t,n,i){const a=String((t==null?void 0:t.type)??(t==null?void 0:t["@type"])??""),c=/AnnotationCollection/.test(a),o=c?[]:[t],r=new Set(c?[]:[t.id]);let e=c?t.first:t.next;for(;e&&o.length<y;){const s=typeof e=="string"?e:e.id;if(r.has(s??e))break;r.add(s??e);const d=await p(e,n,i);o.push(d),e=d.next}return o}async function b(t,{request:n,signal:i}={}){const a=[];for(const c of l(t)){const o=await p(c,n,i);for(const r of await h(o,n,i)){const e=await g(r),s=e.id??`added-${a.length}`,d=u(e,s);d.length&&a.push({id:s,label:w(e,r===o?c:void 0)??o.label,source:"added",entries:d})}}return a}export{b as loadAnnotationSets};
1
+ import{S as l,az as g,ax as y,aA as u,ay as f}from"./shared-DFAX0n3B.mjs";const w=100;async function p(t,n,i){if(typeof t=="string")return await f(n,t,i);const a=t;return a!=null&&a.id&&a.type==="AnnotationPage"&&!a.items?await f(n,a.id,i):a}async function h(t,n,i){const a=String((t==null?void 0:t.type)??(t==null?void 0:t["@type"])??""),c=/AnnotationCollection/.test(a),o=c?[]:[t],r=new Set(c?[]:[t.id]);let e=c?t.first:t.next;for(;e&&o.length<w;){const s=typeof e=="string"?e:e.id;if(r.has(s??e))break;r.add(s??e);const d=await p(e,n,i);o.push(d),e=d.next}return o}async function x(t,{request:n,signal:i}={}){const a=[];for(const c of l(t)){const o=await p(c,n,i);for(const r of await h(o,n,i)){const e=await g(r),s=e.id??`added-${a.length}`,d=y(e,s);d.length&&a.push({id:s,label:u(e,r===o?c:void 0)??o.label,source:"added",entries:d})}}return a}export{x as loadAnnotationSets};
@@ -1 +1 @@
1
- import{r as d,Y as p}from"./shared-MTsMddHx.mjs";import{t as u,r as v,m as T}from"./text-BTAkxEfQ.mjs";const m=t=>t.language&&t.language!=="none"?t.language:"none";function k(t,e){const o=p([...new Set(t.map(m))],e);return t.find(r=>m(r)===o)}function P(t,e){const o=(n,a)=>n?{text:n,...a?{lang:a}:{}}:{},r=t.filter(n=>{var a;return(a=n.value)==null?void 0:a.trim()});if(!r.length){const n=t.find(s=>(s.image||s.place)&&s.label);if(!n)return{};const{text:a,lang:x}=d(n.label,e);return o(u(a).trim(),x)}const l=k(r,e),i=l.value,c=v(l.format,i),f=c==="markdown"?T(i):c==="html"?u(i):i,g=m(l);return o(f.trim(),g==="none"?void 0:g)}export{P as a,k as b};
1
+ import{t as d,V as p}from"./shared-DFAX0n3B.mjs";import{t as u,r as v,m as T}from"./text-BTAkxEfQ.mjs";const m=t=>t.language&&t.language!=="none"?t.language:"none";function k(t,e){const o=p([...new Set(t.map(m))],e);return t.find(r=>m(r)===o)}function P(t,e){const o=(n,a)=>n?{text:n,...a?{lang:a}:{}}:{},r=t.filter(n=>{var a;return(a=n.value)==null?void 0:a.trim()});if(!r.length){const n=t.find(s=>(s.image||s.place)&&s.label);if(!n)return{};const{text:a,lang:x}=d(n.label,e);return o(u(a).trim(),x)}const l=k(r,e),i=l.value,c=v(l.format,i),f=c==="markdown"?T(i):c==="html"?u(i):i,g=m(l);return o(f.trim(),g==="none"?void 0:g)}export{P as a,k as b};
@@ -1 +1 @@
1
- import{loadAnnotationSets as f}from"./annotation-collection-7SS1ELcO.mjs";import{F as i,ax as l,an as c}from"./shared-MTsMddHx.mjs";async function y(n,a){const r={id:String(n.id??""),type:/Collection/.test(String(n.type??n["@type"]))?"AnnotationCollection":"AnnotationPage",...n.label?{label:n.label}:{}},o=(await f(n,a)).map(t=>({...t,content:r})),s=o.flatMap(t=>t.entries),e=s.find(t=>a.manifestId&&i(t.annotation)===a.manifestId)??s.find(t=>i(t.annotation));if(!e)throw new l("The annotations name no Manifest");return{manifest:await c({id:i(e.annotation),type:"Manifest"},a),target:{canvasId:e.canvasId},annotationSets:o,pick:e.id}}export{y as annotationsContent};
1
+ import{loadAnnotationSets as f}from"./annotation-collection-BkC3nBPA.mjs";import{G as i,aB as l,ar as c}from"./shared-DFAX0n3B.mjs";async function y(n,a){const s={id:String(n.id??""),type:/Collection/.test(String(n.type??n["@type"]))?"AnnotationCollection":"AnnotationPage",...n.label?{label:n.label}:{}},o=(await f(n,a)).map(t=>({...t,content:s})),r=o.flatMap(t=>t.entries),e=r.find(t=>a.manifestId&&i(t.annotation)===a.manifestId)??r.find(t=>i(t.annotation));if(!e)throw new l("The annotations name no Manifest");return{manifest:await c({id:i(e.annotation),type:"Manifest"},a),target:{canvasId:e.canvasId},annotationSets:o,pick:e.id}}export{y as annotationsContent};
@@ -1 +1 @@
1
- import{f as m,T as u,h as g,u as r,i as B,g as p}from"./shared-MTsMddHx.mjs";import{B as h}from"./Body-DaY1UJIy.mjs";import{u as y,P as L}from"./nodes-CTw9OqlA.mjs";import{Toggle as b}from"./toggle-C7ODWDEZ.mjs";const R={height:"100%"},T=e=>[...e.children].find(s=>s.localName==="clover-panel-toggle")??null,C=e=>e instanceof HTMLElement&&e.localName==="button";function P({hosted:e,props:s}){const a=y(e.element,()=>T(e.element),Object.is),{controlButtons:n,renderers:l,onReady:c,...d}=s,o=m(B,!!n),t=m(p,!!l),i=u(()=>o==null?void 0:o.toControlButtons(n),[o,n]),f=u(()=>t==null?void 0:t.toRenderers(l),[t,l]);return g(c),n&&!o||l&&!t?null:r(h,{...d,onReady:c,controlButtons:i,renderers:f,style:R,children:[a&&r(b,{element:a}),r(L,{from:e.element,picks:C})]})}export{P as BodyElement};
1
+ import{f as m,T as u,h as g,u as r,i as B,g as p}from"./shared-DFAX0n3B.mjs";import{B as h}from"./Body-QQ1DmnbP.mjs";import{u as y,P as L}from"./nodes-BleXuYE6.mjs";import{Toggle as b}from"./toggle-CJKdi5KH.mjs";const R={height:"100%"},T=e=>[...e.children].find(s=>s.localName==="clover-panel-toggle")??null,C=e=>e instanceof HTMLElement&&e.localName==="button";function P({hosted:e,props:s}){const a=y(e.element,()=>T(e.element),Object.is),{controlButtons:n,renderers:l,onReady:c,...d}=s,o=m(B,!!n),t=m(p,!!l),i=u(()=>o==null?void 0:o.toControlButtons(n),[o,n]),f=u(()=>t==null?void 0:t.toRenderers(l),[t,l]);return g(c),n&&!o||l&&!t?null:r(h,{...d,onReady:c,controlButtons:i,renderers:f,style:R,children:[a&&r(b,{element:a}),r(L,{from:e.element,picks:C})]})}export{P as BodyElement};
@@ -0,0 +1 @@
1
+ import{O as l,u as o,z as c,P as r,f,T as v,h as C,i as m}from"./shared-DFAX0n3B.mjs";import{C as b}from"./CanvasView-DxZASM9E.mjs";import{r as s}from"./rendererSurface-nh6-EfuZ.mjs";import{C as i}from"./Pending-mcmdyZPA.mjs";const h=c(()=>import("./Connected-sYBn_9MK.mjs")),B=c(()=>import("./LoadedCanvas-DK6xMmM1.mjs")),k=n=>{const a=l();if(n.iiifContent!==void 0&&n.canvases===void 0)return o(r,{fallback:o(i,{}),children:o(B,{...n,surface:s})});const e=n.canvases!==void 0||n.body!==void 0||n.src!==void 0;return a&&!e?o(r,{fallback:o(i,{}),children:o(h,{...n,surface:s})}):o(b,{...n,surface:s})};function g({props:n}){const{controlButtons:a,onReady:e,...d}=n,t=f(m,!!a),u=v(()=>t==null?void 0:t.toControlButtons(a),[t,a]);return C(e),a&&!t?null:o(k,{...d,onReady:e,controlButtons:u})}export{g as CanvasElement};
@@ -0,0 +1,164 @@
1
+ import{c as ne,F as ae,i as se,M as ie}from"./models-BXcT4ijX.mjs";import{au as ce,a1 as ue}from"./shared-DFAX0n3B.mjs";const le=["KHR_materials_unlit","KHR_materials_ior","KHR_materials_specular","KHR_mesh_quantization"],Z=1179937895,fe=1313821514,de=5130562;function me(e){const s=new DataView(e);if(s.getUint32(0,true)!==Z)throw new Error("This is not a GLB.");if(s.getUint32(4,true)!==2)throw new Error("Only glTF 2.0 is drawn.");let o,t;const n=Math.min(s.getUint32(8,true),e.byteLength);for(let a=12;a+8<=n;){const i=s.getUint32(a,true),l=s.getUint32(a+4,true),c=a+8;l===fe?o=JSON.parse(new TextDecoder().decode(new Uint8Array(e,c,i))):l===de&&(t=e.slice(c,c+i)),a=c+i}if(!o)throw new Error("The GLB has no JSON chunk.");return{json:o,bin:t}}async function z(e,s,o){const t=new URL(e,s).href,n=t.startsWith("data:")?await fetch(t):await ue(o,t);if(!n.ok)throw new Error(`${t} answered ${n.status}`);return n.arrayBuffer()}const $=new WeakMap;function ve(e,s,o){const t=(s==null?void 0:s.fetch)??globalThis.fetch,n=$.get(t)??new Map;$.set(t,n);const a=`${ce(s)} ${o??""} ${e}`;let i=n.get(a);return i||(i=he(e,s,o).finally(()=>n.delete(a)),n.set(a,i)),i}async function he(e,s,o){const t=await z(e,location.href,s),n=new DataView(t).getUint32(0,true)===Z,{json:a,bin:i}=n?me(t):{json:JSON.parse(new TextDecoder().decode(t))},l=(a.extensionsRequired??[]).filter(f=>!le.includes(f));if(l.length)throw new Error(`Clover's renderer cannot draw this model: it requires ${l.join(", ")}.`);const c=await Promise.all((a.buffers??[]).map((f,r)=>{if(f.uri!==void 0)return z(f.uri,e,s);if(r===0&&i)return i;throw new Error("A buffer of the model has no data.")})),u=await Promise.all((a.images??[]).map(async f=>{try{let r;if(f.bufferView!==void 0){const d=a.bufferViews[f.bufferView];r=new Blob([new Uint8Array(c[d.buffer],d.byteOffset??0,d.byteLength)],{type:f.mimeType})}else if(f.uri!==void 0)r=new Blob([await z(f.uri,e,s)],{type:f.mimeType});else return null;const m={premultiplyAlpha:"none",colorSpaceConversion:"none"};return await pe(await createImageBitmap(r,m),o,m)}catch{return null}}));return{json:a,buffers:c,images:u}}async function pe(e,s,o){const t=Math.max(e.width,e.height);if(!s||t<=s)return e;const n=s/t,a=await createImageBitmap(e,{...o,resizeWidth:Math.max(1,Math.floor(e.width*n)),resizeHeight:Math.max(1,Math.floor(e.height*n)),resizeQuality:"high"});return e.close(),a}const we={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ee={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},q=e=>we[e];function Te(e,s){const o=e.json.accessors[s],t=q(o.type),n=new Float32Array(o.count*t);if(o.bufferView===void 0)return n;const a=e.json.bufferViews[o.bufferView],i=Ee[o.componentType],l=a.byteStride||i*t,c=new DataView(e.buffers[a.buffer],(a.byteOffset??0)+(o.byteOffset??0)),u={5120:r=>c.getInt8(r),5121:r=>c.getUint8(r),5122:r=>c.getInt16(r,true),5123:r=>c.getUint16(r,true),5125:r=>c.getUint32(r,true),5126:r=>c.getFloat32(r,true)}[o.componentType]??(()=>0),f=o.normalized?{5120:127,5121:255,5122:32767,5123:65535}[o.componentType]:void 0;for(let r=0;r<o.count;r++)for(let m=0;m<t;m++){const d=u(r*l+m*i);n[r*t+m]=f?Math.max(d/f,-1):d}return n}const ee=()=>new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function I(e,s){const o=new Float32Array(16);for(let t=0;t<4;t++)for(let n=0;n<4;n++){let a=0;for(let i=0;i<4;i++)a+=e[i*4+n]*s[t*4+i];o[t*4+n]=a}return o}function X([e,s,o],[t,n,a,i],[l,c,u]){const f=t+t,r=n+n,m=a+a,d=t*f,M=t*r,p=t*m,w=n*r,S=n*m,y=a*m,k=i*f,L=i*r,O=i*m;return new Float32Array([(1-(w+y))*l,(M+O)*l,(p-L)*l,0,(M-O)*c,(1-(d+y))*c,(S+k)*c,0,(p+L)*u,(S-k)*u,(1-(d+w))*u,0,e,s,o,1])}const K=e=>X(e,[0,0,0,1],[1,1,1]),xe=e=>X([0,0,0],[0,0,0,1],e);function be([e,s,o]){const t=(n,a)=>{const i=a*Math.PI/180,l=Math.cos(i),c=Math.sin(i),u=ee(),[f,r]=n===0?[1,2]:n===1?[2,0]:[0,1];return u[f*4+f]=l,u[f*4+r]=c,u[r*4+f]=-c,u[r*4+r]=l,u};return I(t(2,o),I(t(1,s),t(0,e)))}function ye(e,s,o,t){const n=1/Math.tan(e/2),a=1/(o-t);return new Float32Array([n/s,0,0,0,0,n,0,0,0,0,(t+o)*a,-1,0,0,2*t*o*a,0])}function Ae(e,s){const o=c=>{const u=Math.hypot(...c)||1;return[c[0]/u,c[1]/u,c[2]/u]},t=(c,u)=>[c[1]*u[2]-c[2]*u[1],c[2]*u[0]-c[0]*u[2],c[0]*u[1]-c[1]*u[0]],n=(c,u)=>c[0]*u[0]+c[1]*u[1]+c[2]*u[2],a=o([e[0]-s[0],e[1]-s[1],e[2]-s[2]]),i=o(t([0,1,0],a)),l=t(a,i);return new Float32Array([i[0],l[0],a[0],0,i[1],l[1],a[1],0,i[2],l[2],a[2],0,-n(i,e),-n(l,e),-n(a,e),1])}function Re(e){const[s,o,t,,n,a,i,,l,c,u]=e,f=a*u-i*c,r=i*l-n*u,m=n*c-a*l,d=s*f+o*r+t*m||1;return new Float32Array([f/d,r/d,m/d,(t*c-o*u)/d,(s*u-t*l)/d,(o*l-s*c)/d,(o*i-t*a)/d,(t*n-s*i)/d,(s*a-o*n)/d])}const Me=()=>({min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]});function _e(e){for(let s=0;s<3;s++){let o=0;for(let t=0;t<3;t++)Math.abs(e[s*4+t])>1e-6&&o++;if(o>1)return false}return true}function Ne(e,s,o,t){const n=s.json.accessors[o];let a;if(_e(t)&&n.min&&n.max&&!n.normalized){const[l,c]=[n.min,n.max];a=Array.from({length:8},(u,f)=>[f&1?c[0]:l[0],f&2?c[1]:l[1],f&4?c[2]:l[2]]).flat()}else a=Te(s,o);const i=t;for(let l=0;l+2<a.length;l+=3){const c=a[l],u=a[l+1],f=a[l+2];for(let r=0;r<3;r++){const m=i[r]*c+i[4+r]*u+i[8+r]*f+i[12+r];m<e.min[r]&&(e.min[r]=m),m>e.max[r]&&(e.max[r]=m)}}return e}const C={normals:1,normalMap:2,unlit:4,mask:8},Y={POSITION:0,NORMAL:1,TEXCOORD_0:2,COLOR_0:3},J=["uBaseTexture","uMetalRoughTexture","uNormalTexture","uOcclusionTexture","uEmissiveTexture"],Se=`#version 300 es
2
+ layout(location = 0) in vec3 aPosition;
3
+ layout(location = 1) in vec3 aNormal;
4
+ layout(location = 2) in vec2 aUv;
5
+ layout(location = 3) in vec4 aColor;
6
+ uniform mat4 uModel;
7
+ uniform mat4 uViewProjection;
8
+ uniform mat3 uNormalMatrix;
9
+ out vec3 vWorld;
10
+ out vec3 vNormal;
11
+ out vec2 vUv;
12
+ out vec4 vColor;
13
+ void main() {
14
+ vec4 world = uModel * vec4(aPosition, 1.0);
15
+ vWorld = world.xyz;
16
+ vNormal = uNormalMatrix * aNormal;
17
+ vUv = aUv;
18
+ vColor = aColor;
19
+ gl_Position = uViewProjection * world;
20
+ }`,Ue=`#version 300 es
21
+ precision highp float;
22
+ in vec3 vWorld;
23
+ in vec3 vNormal;
24
+ in vec2 vUv;
25
+ in vec4 vColor;
26
+ uniform vec3 uCamera;
27
+ uniform vec4 uBaseColor;
28
+ uniform vec3 uSpecular;
29
+ uniform float uMetallic;
30
+ uniform float uRoughness;
31
+ uniform float uNormalScale;
32
+ uniform float uOcclusionStrength;
33
+ uniform vec3 uEmissive;
34
+ uniform float uAlphaCutoff;
35
+ uniform int uFlags;
36
+ uniform sampler2D uBaseTexture;
37
+ uniform sampler2D uMetalRoughTexture;
38
+ uniform sampler2D uNormalTexture;
39
+ uniform sampler2D uOcclusionTexture;
40
+ uniform sampler2D uEmissiveTexture;
41
+ out vec4 outColor;
42
+
43
+ const float PI = 3.14159265;
44
+ const float LAMP = 3.0;
45
+ // The room: a sky and a ground for the light all around, and three lights in it.
46
+ const vec3 SKY = vec3(0.73);
47
+ const vec3 GROUND = vec3(0.58);
48
+ const vec3 LIGHTS[3] = vec3[3](
49
+ normalize(vec3(0.3, 0.7, 0.9)),
50
+ normalize(vec3(-0.8, 0.35, 0.5)),
51
+ normalize(vec3(0.2, 0.4, -1.0))
52
+ );
53
+ const vec3 RADIANCE[3] = vec3[3](vec3(1.2), vec3(0.3), vec3(0.4));
54
+
55
+ vec3 room(vec3 direction) {
56
+ return mix(GROUND, SKY, direction.y * 0.5 + 0.5);
57
+ }
58
+
59
+ // What a surface reflects of the room: its sky and ground, and its lamps, soft panels a
60
+ // glossy surface mirrors and a rough one only glows with.
61
+ const vec3 LAMPS[3] = vec3[3](
62
+ normalize(vec3(0.0, 1.0, 0.3)),
63
+ normalize(vec3(-1.0, 0.5, 0.4)),
64
+ normalize(vec3(1.0, 0.35, -0.3))
65
+ );
66
+ vec3 reflected(vec3 direction, float roughness) {
67
+ vec3 color = room(direction);
68
+ float spread = mix(0.04, 0.9, roughness);
69
+ for (int i = 0; i < 3; i++) {
70
+ float c = dot(direction, LAMPS[i]);
71
+ color += vec3(LAMP) * smoothstep(1.0 - spread, 1.0 - spread * 0.35, c) * (1.0 - 0.85 * roughness);
72
+ }
73
+ return color;
74
+ }
75
+
76
+ // A normal map's normal, in the frame its texture coordinates make (no tangents read).
77
+ vec3 mapped(vec3 n) {
78
+ vec3 tangentNormal = texture(uNormalTexture, vUv).xyz * 2.0 - 1.0;
79
+ tangentNormal.xy *= vec2(uNormalScale, -uNormalScale);
80
+ vec3 dp1 = dFdx(vWorld);
81
+ vec3 dp2 = dFdy(vWorld);
82
+ vec2 duv1 = dFdx(vUv);
83
+ vec2 duv2 = dFdy(vUv);
84
+ vec3 dp2perp = cross(dp2, n);
85
+ vec3 dp1perp = cross(n, dp1);
86
+ vec3 t = dp2perp * duv1.x + dp1perp * duv2.x;
87
+ vec3 b = dp2perp * duv1.y + dp1perp * duv2.y;
88
+ float scale = inversesqrt(max(dot(t, t), dot(b, b)) + 1e-12);
89
+ return normalize(mat3(t * scale, b * scale, n) * tangentNormal);
90
+ }
91
+
92
+ vec3 neutral(vec3 color) {
93
+ const float start = 0.8 - 0.04;
94
+ const float desaturation = 0.15;
95
+ float x = min(color.r, min(color.g, color.b));
96
+ float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
97
+ color -= offset;
98
+ float peak = max(color.r, max(color.g, color.b));
99
+ if (peak < start) return color;
100
+ float d = 1.0 - start;
101
+ float newPeak = 1.0 - d * d / (peak + d - start);
102
+ color *= newPeak / peak;
103
+ float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);
104
+ return mix(color, vec3(newPeak), g);
105
+ }
106
+
107
+ vec3 srgb(vec3 linear) {
108
+ return mix(
109
+ linear * 12.92,
110
+ 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055,
111
+ step(0.0031308, linear)
112
+ );
113
+ }
114
+
115
+ void main() {
116
+ vec4 base = uBaseColor * texture(uBaseTexture, vUv) * vColor;
117
+ if ((uFlags & ${C.mask}) != 0 && base.a < uAlphaCutoff) discard;
118
+ if ((uFlags & ${C.unlit}) != 0) {
119
+ outColor = vec4(srgb(base.rgb) * base.a, base.a);
120
+ return;
121
+ }
122
+ // No normals given: the face's own, as glTF asks.
123
+ vec3 n = (uFlags & ${C.normals}) != 0
124
+ ? normalize(vNormal)
125
+ : normalize(cross(dFdx(vWorld), dFdy(vWorld)));
126
+ if (!gl_FrontFacing) n = -n;
127
+ if ((uFlags & ${C.normalMap}) != 0) n = mapped(n);
128
+ vec3 v = normalize(uCamera - vWorld);
129
+ vec4 metalRough = texture(uMetalRoughTexture, vUv);
130
+ float roughness = clamp(uRoughness * metalRough.g, 0.045, 1.0);
131
+ float metallic = clamp(uMetallic * metalRough.b, 0.0, 1.0);
132
+ vec3 diffuse = base.rgb * (1.0 - metallic);
133
+ vec3 f0 = mix(uSpecular, base.rgb, metallic);
134
+ float a = roughness * roughness;
135
+ float nv = clamp(dot(n, v), 1e-4, 1.0);
136
+ vec3 color = vec3(0.0);
137
+ for (int i = 0; i < 3; i++) {
138
+ vec3 l = LIGHTS[i];
139
+ float nl = clamp(dot(n, l), 0.0, 1.0);
140
+ if (nl <= 0.0) continue;
141
+ vec3 h = normalize(l + v);
142
+ float nh = clamp(dot(n, h), 0.0, 1.0);
143
+ float vh = clamp(dot(v, h), 0.0, 1.0);
144
+ float a2 = a * a;
145
+ float dd = nh * nh * (a2 - 1.0) + 1.0;
146
+ float distribution = a2 / (PI * dd * dd);
147
+ float viewed = nl * sqrt(nv * nv * (1.0 - a2) + a2);
148
+ float lit = nv * sqrt(nl * nl * (1.0 - a2) + a2);
149
+ float visibility = 0.5 / (viewed + lit + 1e-5);
150
+ vec3 fresnel = f0 + (1.0 - f0) * pow(1.0 - vh, 5.0);
151
+ vec3 specular = fresnel * distribution * visibility;
152
+ color += ((1.0 - fresnel) * diffuse + PI * specular) * RADIANCE[i] * nl;
153
+ }
154
+ // The room's light all around: diffuse, and what a rough or smooth surface reflects of it.
155
+ vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
156
+ vec4 c1 = vec4(1.0, 0.0425, 1.04, -0.04);
157
+ vec4 r = roughness * c0 + c1;
158
+ float a004 = min(r.x * r.x, exp2(-9.28 * nv)) * r.x + r.y;
159
+ vec2 ab = vec2(-1.04, 1.04) * a004 + r.zw;
160
+ float occlusion = mix(1.0, texture(uOcclusionTexture, vUv).r, uOcclusionStrength);
161
+ color += (diffuse * room(n) + (f0 * ab.x + ab.y) * reflected(reflect(-v, n), roughness)) * occlusion;
162
+ color += uEmissive * texture(uEmissiveTexture, vUv).rgb;
163
+ outColor = vec4(srgb(neutral(color)) * base.a, base.a);
164
+ }`,Q=10497,Fe=9729,Ce=new Set([9984,9985,9986,9987]);function Pe(e){const s=e.createProgram();for(const[o,t]of[[e.VERTEX_SHADER,Se],[e.FRAGMENT_SHADER,Ue]]){const n=e.createShader(o);e.shaderSource(n,t),e.compileShader(n),e.attachShader(s,n),e.deleteShader(n)}if(e.linkProgram(s),!e.getProgramParameter(s,e.LINK_STATUS))throw new Error(`The 3D view's shaders would not build: ${e.getProgramInfoLog(s)}`);return s}function Ie(e){const s=Pe(e),o=r=>e.getUniformLocation(s,r),t=Object.fromEntries(["uModel","uViewProjection","uNormalMatrix","uCamera","uBaseColor","uSpecular","uMetallic","uRoughness","uNormalScale","uOcclusionStrength","uEmissive","uAlphaCutoff","uFlags",...J].map(r=>[r,o(r)]));e.useProgram(s),J.forEach((r,m)=>e.uniform1i(t[r],m));const n=[],a=[],i=[],l=Me(),c=e.createTexture();e.bindTexture(e.TEXTURE_2D,c),e.texImage2D(e.TEXTURE_2D,0,e.RGBA8,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([255,255,255,255])),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),a.push(c),e.vertexAttrib4f(Y.COLOR_0,1,1,1,1);function u(r,m){var G;const{json:d}=r,M=new Map,p=new Map,w=new Map,S=(E,T)=>{const v=`${E}|${T}`;let h=M.get(v);if(!h){const b=d.bufferViews[E];h=e.createBuffer(),e.bindBuffer(T,h),e.bufferData(T,new Uint8Array(r.buffers[b.buffer],b.byteOffset??0,b.byteLength),e.STATIC_DRAW),M.set(v,h),n.push(h)}return h},y=(E,T)=>{var F,N;const v=E?(F=d.textures)==null?void 0:F[E.index]:void 0,h=(v==null?void 0:v.source)!==void 0?r.images[v.source]:null;if(!E||!h)return null;const b=`${E.index}|${T}`;let _=p.get(b);if(!_){_=e.createTexture(),e.bindTexture(e.TEXTURE_2D,_),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,T?e.SRGB8_ALPHA8:e.RGBA8,e.RGBA,e.UNSIGNED_BYTE,h);const x=(v==null?void 0:v.sampler)!==void 0?(N=d.samplers)==null?void 0:N[v.sampler]:void 0,A=(x==null?void 0:x.minFilter)??e.LINEAR_MIPMAP_LINEAR;e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,A),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,(x==null?void 0:x.magFilter)??Fe),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,(x==null?void 0:x.wrapS)??Q),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,(x==null?void 0:x.wrapT)??Q),Ce.has(A)&&e.generateMipmap(e.TEXTURE_2D),p.set(b,_),a.push(_)}return _},k=E=>{var A,B,D,V,R,P;const T=E??-1;let v=w.get(T);if(v)return v;const h=E!==void 0?((A=d.materials)==null?void 0:A[E])??{}:{},b=h.pbrMetallicRoughness??{},_=y(h.normalTexture,false),F=Number(((D=(B=h.extensions)==null?void 0:B.KHR_materials_ior)==null?void 0:D.ior)??1.5),N=(V=h.extensions)==null?void 0:V.KHR_materials_specular,x=((F-1)/(F+1))**2;return v={base:b.baseColorFactor??[1,1,1,1],specular:((N==null?void 0:N.specularColorFactor)??[1,1,1]).map(g=>Math.min(x*g,1)*((N==null?void 0:N.specularFactor)??1)),metallic:b.metallicFactor??1,roughness:b.roughnessFactor??1,normalScale:((R=h.normalTexture)==null?void 0:R.scale)??1,occlusion:h.occlusionTexture?h.occlusionTexture.strength??1:0,emissive:h.emissiveFactor??[0,0,0],cutoff:h.alphaCutoff??.5,flags:(_?C.normalMap:0)|((P=h.extensions)!=null&&P.KHR_materials_unlit?C.unlit:0)|(h.alphaMode==="MASK"?C.mask:0),doubleSided:!!h.doubleSided,blend:h.alphaMode==="BLEND",textures:[y(b.baseColorTexture,true),y(b.metallicRoughnessTexture,false),_,y(h.occlusionTexture,false),y(h.emissiveTexture,true)]},w.set(T,v),v},L=(E,T)=>{var _,F,N,x;const v=(_=d.nodes)==null?void 0:_[E];if(!v)return;const h=I(T,v.matrix?new Float32Array(v.matrix):X(v.translation??[0,0,0],v.rotation??[0,0,0,1],v.scale??[1,1,1])),b=v.mesh!==void 0?(F=d.meshes)==null?void 0:F[v.mesh]:void 0;for(const A of(b==null?void 0:b.primitives)??[]){const B=A.attributes.POSITION;if(B===void 0)continue;const D=e.createVertexArray();e.bindVertexArray(D);let V=0;for(const[W,H]of Object.entries(Y)){const j=A.attributes[W],U=j!==void 0?(N=d.accessors)==null?void 0:N[j]:void 0;if(!U||U.bufferView===void 0||U.sparse)continue;const re=d.bufferViews[U.bufferView];e.bindBuffer(e.ARRAY_BUFFER,S(U.bufferView,e.ARRAY_BUFFER)),e.enableVertexAttribArray(H),e.vertexAttribPointer(H,q(U.type),U.componentType,!!U.normalized,re.byteStride??0,U.byteOffset??0),W==="NORMAL"&&(V|=C.normals)}const R=A.indices!==void 0?(x=d.accessors)==null?void 0:x[A.indices]:void 0;(R==null?void 0:R.bufferView)!==void 0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,S(R.bufferView,e.ELEMENT_ARRAY_BUFFER)),e.bindVertexArray(null);const P=I(m,h),g=k(A.material);i.push({vao:D,mode:A.mode??e.TRIANGLES,count:R?R.count:d.accessors[B].count,...(R==null?void 0:R.bufferView)!==void 0?{index:{type:R.componentType,offset:R.byteOffset??0}}:{},model:P,normal:Re(P),mirrored:Oe(P)<0,material:{...g,flags:g.flags|V}}),Ne(l,r,B,P)}for(const A of v.children??[])L(A,h)},O=(G=d.scenes)==null?void 0:G[d.scene??0],te=(O==null?void 0:O.nodes)??(d.nodes??[]).map((E,T)=>T).filter(E=>!d.nodes.some(T=>{var v;return(v=T.children)==null?void 0:v.includes(E)})),oe=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);te.forEach(E=>L(E,oe)),i.sort((E,T)=>Number(E.material.blend)-Number(T.material.blend))}function f(r,m,d,M){e.viewport(0,0,d,M),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.enable(e.DEPTH_TEST),e.useProgram(s),e.uniformMatrix4fv(t.uViewProjection,false,r),e.uniform3fv(t.uCamera,m);for(const p of i){const{material:w}=p;w.doubleSided?e.disable(e.CULL_FACE):e.enable(e.CULL_FACE),e.frontFace(p.mirrored?e.CW:e.CCW),w.blend?(e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.depthMask(false)):(e.disable(e.BLEND),e.depthMask(true)),w.textures.forEach((S,y)=>{e.activeTexture(e.TEXTURE0+y),e.bindTexture(e.TEXTURE_2D,S??c)}),e.uniformMatrix4fv(t.uModel,false,p.model),e.uniformMatrix3fv(t.uNormalMatrix,false,p.normal),e.uniform4fv(t.uBaseColor,w.base),e.uniform3fv(t.uSpecular,w.specular),e.uniform1f(t.uMetallic,w.metallic),e.uniform1f(t.uRoughness,w.roughness),e.uniform1f(t.uNormalScale,w.normalScale),e.uniform1f(t.uOcclusionStrength,w.occlusion),e.uniform3fv(t.uEmissive,w.emissive),e.uniform1f(t.uAlphaCutoff,w.cutoff),e.uniform1i(t.uFlags,w.flags),e.bindVertexArray(p.vao),p.index?e.drawElements(p.mode,p.count,p.index.type,p.index.offset):e.drawArrays(p.mode,0,p.count)}e.bindVertexArray(null),e.depthMask(true)}return{add:u,bounds:()=>i.length?l:null,draw:f,dispose(){i.forEach(r=>e.deleteVertexArray(r.vao)),n.forEach(r=>e.deleteBuffer(r)),a.forEach(r=>e.deleteTexture(r)),e.deleteProgram(s),i.length=0}}}function Oe(e){return e[0]*(e[5]*e[10]-e[6]*e[9])-e[4]*(e[1]*e[10]-e[2]*e[9])+e[8]*(e[1]*e[6]-e[2]*e[5])}const Be=2;function Le({position:e,transforms:s}){let o=ee();for(const{type:t,x:n,y:a,z:i}of s){const l=t==="scale"?xe([n,a,i]):t==="translate"?K([n,a,i]):be([n,a,i]);o=I(l,o)}return I(K(e),o)}function ke(e,{onLost:s}){const o=document.createElement("canvas");o.className="clover-canvas-surface",o.setAttribute("aria-hidden","true"),o.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block;pointer-events:none";const t=o.getContext("webgl2",{antialias:true,alpha:true});if(!t)throw new Error("This browser cannot draw 3D: it offers no WebGL2.");const n=u=>{u.preventDefault(),s()};o.addEventListener("webglcontextlost",n),e.prepend(o);const a=Ie(t);let i={center:[0,0,0],radius:1},l=false;const c=()=>{const u=Math.min(globalThis.devicePixelRatio||1,Be),f=Math.round(e.clientWidth*u),r=Math.round(e.clientHeight*u);!f||!r||(o.width=f,o.height=r)};return c(),{async load(u,f){const r=u.filter(se);if(!r.length){const p=[...new Set(u.map(w=>w.format??w.src))];throw new Error(u.length?`Clover draws glTF models (${ie.join(", ")}), not ${p.join(", ")}.`:"The Scene paints no model.")}const m=t.getParameter(t.MAX_TEXTURE_SIZE),d=await Promise.all(r.map(p=>ve(p.src,f,m)));if(l)return i;d.forEach((p,w)=>a.add(p,Le(r[w])));const M=a.bounds();if(M){const p=M.min.map((S,y)=>(S+M.max[y])/2),w=Math.hypot(...M.max.map((S,y)=>S-M.min[y]))/2;i={center:p,radius:w||1}}return i},draw(u){if(l||!o.width||!o.height)return;const f=ne(u,i.center),r=Math.max(i.radius/1e3,u.distance-i.radius*2),m=u.distance+i.radius*4,d=ye(ae*Math.PI/180,o.width/o.height,r,m);a.draw(I(d,Ae(f,i.center)),f,o.width,o.height)},resize:c,dispose(){var u;l||(l=true,o.removeEventListener("webglcontextlost",n),a.dispose(),(u=t.getExtension("WEBGL_lose_context"))==null||u.loseContext(),o.remove())}}}export{ke as createEngine,Le as placement};
@@ -1 +1 @@
1
- import{O as l,a5 as g}from"./shared-MTsMddHx.mjs";function b(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e+"=".repeat((4-e.length%4)%4),o=atob(n);try{return decodeURIComponent(o)}catch{const a=Uint8Array.from(o,s=>s.charCodeAt(0));return new TextDecoder().decode(a)}}function I(t){const e=t.trim();for(const n of[()=>JSON.parse(e),()=>JSON.parse(b(e))])try{const o=n();if(o&&typeof o=="object")return o}catch{}return null}function v(t){if(!t)return;const e=Number(t.split(",")[0]);return Number.isFinite(e)?e:void 0}const u=t=>l(t==null?void 0:t.partOf).find(e=>(e==null?void 0:e.id)&&e.type==="Collection");function h(t){const e=t.type==="Annotation"?l(t.target):[t],n=e[0]?m(e[0],t):null;if(!n||e.length<2)return n;const o=typeof t.id=="string"?t.id:"content-state",a=e.flatMap((s,d)=>{var y,p,f;const i=d===0?n:m(s,t),r=(i==null?void 0:i.type)==="Manifest"?i.id:i==null?void 0:i.manifestId;return!i||!r?[]:[{id:`${o}#target-${d+1}`,manifestId:r,...((y=i.target)==null?void 0:y.canvasId)&&{canvasId:i.target.canvasId},...((p=i.target)==null?void 0:p.region)&&{region:i.target.region},...((f=i.target)==null?void 0:f.time)!==void 0&&{time:i.target.time}}]});return a.length>1?{...n,targets:{id:o,...t.label&&typeof t.label=="object"?{label:t.label}:{},items:a}}:n}function m(t,e){const n=g(t),o=typeof t=="string"?{id:n.id}:t.type==="SpecificResource"?typeof t.source=="string"?{id:t.source}:t.source??{}:t,a=o.type;if(a==="Manifest"||a==="Collection"){const c=a==="Manifest"?u(o):void 0;return c?{id:c.id,type:"Collection",manifestId:n.id}:{id:n.id,type:a}}const s=l(t.selector).find(c=>(c==null?void 0:c.type)==="PointSelector"&&c.t!=null),d={canvasId:n.id};n.rect&&(d.region=n.rect);const i=(s==null?void 0:s.t)??v(n.t);i!==void 0&&(d.time=Number(i));const r=l(o.partOf).find(c=>(c==null?void 0:c.id)&&(!c.type||c.type==="Manifest")),y=u(r),p=e.type==="Annotation"&&l(e.body).length?{id:e.id??`${n.id}#content-state`,type:"Annotation",motivation:l(e.motivation),body:e.body,target:t}:void 0,f=p?{annotation:p}:{};return y&&r?{id:y.id,type:"Collection",manifestId:r.id,target:d,...f}:r?{id:r.id,type:"Manifest",target:d,...f}:{id:n.id,type:a??"Canvas",target:d,...f}}export{I as decodeContentState,h as resolveContentState};
1
+ import{S as l,a9 as g}from"./shared-DFAX0n3B.mjs";function b(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e+"=".repeat((4-e.length%4)%4),o=atob(n);try{return decodeURIComponent(o)}catch{const a=Uint8Array.from(o,s=>s.charCodeAt(0));return new TextDecoder().decode(a)}}function I(t){const e=t.trim();for(const n of[()=>JSON.parse(e),()=>JSON.parse(b(e))])try{const o=n();if(o&&typeof o=="object")return o}catch{}return null}function v(t){if(!t)return;const e=Number(t.split(",")[0]);return Number.isFinite(e)?e:void 0}const u=t=>l(t==null?void 0:t.partOf).find(e=>(e==null?void 0:e.id)&&e.type==="Collection");function h(t){const e=t.type==="Annotation"?l(t.target):[t],n=e[0]?m(e[0],t):null;if(!n||e.length<2)return n;const o=typeof t.id=="string"?t.id:"content-state",a=e.flatMap((s,d)=>{var y,p,f;const i=d===0?n:m(s,t),r=(i==null?void 0:i.type)==="Manifest"?i.id:i==null?void 0:i.manifestId;return!i||!r?[]:[{id:`${o}#target-${d+1}`,manifestId:r,...((y=i.target)==null?void 0:y.canvasId)&&{canvasId:i.target.canvasId},...((p=i.target)==null?void 0:p.region)&&{region:i.target.region},...((f=i.target)==null?void 0:f.time)!==void 0&&{time:i.target.time}}]});return a.length>1?{...n,targets:{id:o,...t.label&&typeof t.label=="object"?{label:t.label}:{},items:a}}:n}function m(t,e){const n=g(t),o=typeof t=="string"?{id:n.id}:t.type==="SpecificResource"?typeof t.source=="string"?{id:t.source}:t.source??{}:t,a=o.type;if(a==="Manifest"||a==="Collection"){const c=a==="Manifest"?u(o):void 0;return c?{id:c.id,type:"Collection",manifestId:n.id}:{id:n.id,type:a}}const s=l(t.selector).find(c=>(c==null?void 0:c.type)==="PointSelector"&&c.t!=null),d={canvasId:n.id};n.rect&&(d.region=n.rect);const i=(s==null?void 0:s.t)??v(n.t);i!==void 0&&(d.time=Number(i));const r=l(o.partOf).find(c=>(c==null?void 0:c.id)&&(!c.type||c.type==="Manifest")),y=u(r),p=e.type==="Annotation"&&l(e.body).length?{id:e.id??`${n.id}#content-state`,type:"Annotation",motivation:l(e.motivation),body:e.body,target:t}:void 0,f=p?{annotation:p}:{};return y&&r?{id:y.id,type:"Collection",manifestId:r.id,target:d,...f}:r?{id:r.id,type:"Manifest",target:d,...f}:{id:n.id,type:a??"Canvas",target:d,...f}}export{I as decodeContentState,h as resolveContentState};
@@ -1 +1 @@
1
- import{u as d,A as v,d as y,_ as g,$ as w,k as A}from"./shared-MTsMddHx.mjs";const E=new Map;function D(o){if(!o||typeof o!="object")return;const s={};for(const[n,r]of Object.entries(o)){if(typeof r!="function")continue;const u=E.get(n)??new WeakMap;E.set(n,u);let c=u.get(r);c||(c=l=>d(x,{...l,name:n,make:r}),u.set(r,c)),s[n]=c}return s}const B=["id","type","aria-label","lang","aria-keyshortcuts","aria-expanded","aria-controls"];function x({name:o,make:s,buttonProps:n,icon:r,label:u,tip:c}){const l=v(null),[m]=y(()=>{const e=document.createElement("span");return e.style.display="contents",e}),[a,k]=y(null),f=v(n.onClick);return f.current=n.onClick,g(()=>{const e=l.current;if(!e)return;const t=s({name:o,label:u,icon:m});if(!(t instanceof HTMLElement)){console.warn(`controlButtons.${o} returned no element; Clover's own is not drawn either.`);return}const i=t.matches("button")?t:t.querySelector("button")??t,b=h=>{var p;return(p=f.current)==null?void 0:p.call(f,h)};return i.addEventListener("click",b),e.after(t),k(i),()=>{i.removeEventListener("click",b),t.remove(),k(null)}},[s]),g(()=>{if(!a)return;const e=n;for(const t of B){const i=e[t];i===void 0?a.removeAttribute(t):a.setAttribute(t,String(i))}}),d(A,{children:[d("span",{ref:l,hidden:true}),w(r,m),a&&w(c,a)]})}export{D as toControlButtons};
1
+ import{u as d,A as v,d as y,_ as g,$ as w,k as A}from"./shared-DFAX0n3B.mjs";const E=new Map;function D(o){if(!o||typeof o!="object")return;const s={};for(const[n,r]of Object.entries(o)){if(typeof r!="function")continue;const u=E.get(n)??new WeakMap;E.set(n,u);let c=u.get(r);c||(c=l=>d(x,{...l,name:n,make:r}),u.set(r,c)),s[n]=c}return s}const B=["id","type","aria-label","lang","aria-keyshortcuts","aria-expanded","aria-controls"];function x({name:o,make:s,buttonProps:n,icon:r,label:u,tip:c}){const l=v(null),[m]=y(()=>{const e=document.createElement("span");return e.style.display="contents",e}),[a,k]=y(null),f=v(n.onClick);return f.current=n.onClick,g(()=>{const e=l.current;if(!e)return;const t=s({name:o,label:u,icon:m});if(!(t instanceof HTMLElement)){console.warn(`controlButtons.${o} returned no element; Clover's own is not drawn either.`);return}const i=t.matches("button")?t:t.querySelector("button")??t,b=h=>{var p;return(p=f.current)==null?void 0:p.call(f,h)};return i.addEventListener("click",b),e.after(t),k(i),()=>{i.removeEventListener("click",b),t.remove(),k(null)}},[s]),g(()=>{if(!a)return;const e=n;for(const t of B){const i=e[t];i===void 0?a.removeAttribute(t):a.setAttribute(t,String(i))}}),d(A,{children:[d("span",{ref:l,hidden:true}),w(r,m),a&&w(c,a)]})}export{D as toControlButtons};