@nulib/clover 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/dist/components/Body/Body.mjs +16 -1
  2. package/dist/components/Body/glyphs.mjs +15 -0
  3. package/dist/components/Body/useControlsVisibility.mjs +35 -13
  4. package/dist/components/Canvas/CanvasView.mjs +116 -12
  5. package/dist/components/Canvas/ChaptersMenu.mjs +105 -0
  6. package/dist/components/Canvas/ControlMenu.mjs +23 -4
  7. package/dist/components/Canvas/Controls.mjs +223 -60
  8. package/dist/components/Canvas/ControlsFade.mjs +16 -0
  9. package/dist/components/Canvas/ImageControls.mjs +209 -0
  10. package/dist/components/Canvas/Placeholder.mjs +44 -12
  11. package/dist/components/Canvas/RowFits.mjs +85 -0
  12. package/dist/components/Canvas/layout.mjs +11 -0
  13. package/dist/components/Canvas/media/MediaBody.mjs +105 -46
  14. package/dist/components/Canvas/media/Player.mjs +0 -55
  15. package/dist/components/Canvas/media/Transport.mjs +14 -23
  16. package/dist/components/Canvas/panClearOfControls.mjs +1 -1
  17. package/dist/components/Collection/Collection.mjs +1 -1
  18. package/dist/components/Items/CountMenu.mjs +1 -0
  19. package/dist/components/Items/Item.mjs +4 -3
  20. package/dist/components/Items/Items.mjs +30 -10
  21. package/dist/components/Items/PagerLayout.mjs +2 -0
  22. package/dist/components/Items/TargetItems.mjs +1 -1
  23. package/dist/components/Items/masonry.mjs +35 -0
  24. package/dist/components/Panel/About.mjs +25 -8
  25. package/dist/components/Panel/Panel.mjs +47 -59
  26. package/dist/components/Panel/sections.mjs +62 -0
  27. package/dist/components/Root/useRootState.mjs +2 -49
  28. package/dist/components/Scene/SceneView.mjs +13 -2
  29. package/dist/components/Scene/cloverEngine.mjs +2 -1
  30. package/dist/components/Timeline/playerSurface.mjs +2 -0
  31. package/dist/core/clover.mjs +7 -4
  32. package/dist/core/content-state.mjs +5 -3
  33. package/dist/i18n/locales/en.json.mjs +1 -1
  34. package/dist/i18n/locales/es.json.mjs +1 -1
  35. package/dist/i18n/locales/fi.json.mjs +1 -1
  36. package/dist/i18n/locales/fr.json.mjs +1 -1
  37. package/dist/i18n/locales/nb.json.mjs +1 -1
  38. package/dist/i18n/locales/nn.json.mjs +1 -1
  39. package/dist/i18n/locales/no.json.mjs +1 -1
  40. package/dist/i18n/locales/pt.json.mjs +1 -1
  41. package/dist/index.d.mts +178 -56
  42. package/dist/index.mjs +2 -0
  43. package/dist/lib/gltf/load.mjs +26 -6
  44. package/dist/lib/pointer.mjs +1 -1
  45. package/dist/lib/renderer/CanvasRenderer.mjs +44 -32
  46. package/dist/lib/renderer/camera/Camera.mjs +1 -1
  47. package/dist/react/useContentStateOutput.mjs +71 -0
  48. package/dist/styles.css +1 -1
  49. package/dist/templates/default/Default.mjs +42 -128
  50. package/dist/templates/document/Document.mjs +51 -65
  51. package/dist/templates/document/Sheets.mjs +13 -5
  52. package/dist/templates/gallery/Gallery.mjs +94 -18
  53. package/dist/templates/index.d.mts +364 -17
  54. package/dist/templates/shared/Lightbox.mjs +161 -69
  55. package/dist/templates/shared/LightboxView.mjs +123 -0
  56. package/dist/templates/shared/PanelPane.mjs +116 -0
  57. package/dist/templates/{document/DocumentPanel.mjs → shared/PanelPart.mjs} +2 -2
  58. package/dist/templates/shared/dragToClose.mjs +51 -8
  59. package/dist/templates/shared/givenAnnotations.mjs +13 -0
  60. package/dist/templates/shared/useDragToClose.mjs +6 -3
  61. package/dist/templates/shared/useLazyPanelPane.mjs +16 -0
  62. package/dist/templates/shared/useSlide.mjs +6 -0
  63. package/dist/templates.css +1 -1
  64. package/dist/ui/ControlCluster.mjs +15 -17
  65. package/dist/ui/Sections.mjs +3 -3
  66. package/dist/ui/mediaIcons.mjs +35 -8
  67. package/dist/ui/useScrollTrack.mjs +2 -1
  68. package/dist/web-components/About-D1TBGGPL.mjs +1 -0
  69. package/dist/web-components/AnnotationItems-DTacmRA9.mjs +1 -0
  70. package/dist/web-components/{AnnotationMenu-BCwwwfbb.mjs → AnnotationMenu-DYc9ekWS.mjs} +1 -1
  71. package/dist/web-components/{AnnotationState-CavxnAAq.mjs → AnnotationState--5ghW0C2.mjs} +1 -1
  72. package/dist/web-components/{Annotations-rBmeI5sR.mjs → Annotations-BG8lPjk1.mjs} +1 -1
  73. package/dist/web-components/{Annotations-DDjSrBL5.mjs → Annotations-Bvc_FmJ5.mjs} +1 -1
  74. package/dist/web-components/Body-QQ1DmnbP.mjs +1 -0
  75. package/dist/web-components/{BodyAlert-COKp19lq.mjs → BodyAlert-A4xRjOKr.mjs} +1 -1
  76. package/dist/web-components/{Button-DLFYqtz9.mjs → Button-Cx6VE_UW.mjs} +1 -1
  77. package/dist/web-components/{Camera-Cp5ma-6C.mjs → Camera-DqT_1MgD.mjs} +1 -1
  78. package/dist/web-components/{Canvas2DBackend-3PToh87Z.mjs → Canvas2DBackend-TZtR3zHf.mjs} +1 -1
  79. package/dist/web-components/CanvasView-DxZASM9E.mjs +2 -0
  80. package/dist/web-components/CaptionDetails-DMRWmtaY.mjs +1 -0
  81. package/dist/web-components/ChaptersMenu-BAZVVDrK.mjs +1 -0
  82. package/dist/web-components/{Chevron-r-_hUPn8.mjs → Chevron-DFGbSGPI.mjs} +1 -1
  83. package/dist/web-components/ChoiceMenu-C80kdxvq.mjs +1 -0
  84. package/dist/web-components/Collection-B4CxBsFL.mjs +1 -0
  85. package/dist/web-components/{CollectionSelect-CBWUbqQi.mjs → CollectionSelect-DO8YO2p7.mjs} +1 -1
  86. package/dist/web-components/{Connected-BnpxYeJN.mjs → Connected-CcbVqzmj.mjs} +1 -1
  87. package/dist/web-components/{Connected-B2d6EoFl.mjs → Connected-DthCPaHl.mjs} +1 -1
  88. package/dist/web-components/{Connected-BSRM9FJY.mjs → Connected-sYBn_9MK.mjs} +1 -1
  89. package/dist/web-components/{Contents-D7FPxSH-.mjs → Contents-AVPYYXht.mjs} +1 -1
  90. package/dist/web-components/ControlMenu-BjJsWnuZ.mjs +1 -0
  91. package/dist/web-components/ControlsFade-C-6WhSxB.mjs +1 -0
  92. package/dist/web-components/{CountMenu-DyTp_J4k.mjs → CountMenu-Dx8D_RJZ.mjs} +1 -1
  93. package/dist/web-components/Cue-xuo5dgKE.mjs +1 -0
  94. package/dist/web-components/Document-BWdafeEi.mjs +1 -0
  95. package/dist/web-components/{DomLayers-CTGub6wo.mjs → DomLayers-DlRapZ1u.mjs} +1 -1
  96. package/dist/web-components/{Download-BOYNIb7C.mjs → Download-Ci_JUTVd.mjs} +1 -1
  97. package/dist/web-components/{EntryBodies-Bfd2Z42z.mjs → EntryBodies-C0ICfS2R.mjs} +1 -1
  98. package/dist/web-components/{EntryThumbnail-DQE8ajI9.mjs → EntryThumbnail-DxHhfRo_.mjs} +1 -1
  99. package/dist/web-components/{FieldPill-D5DNJWLy.mjs → FieldPill-CVfeeafm.mjs} +1 -1
  100. package/dist/web-components/FrameAnimation-AZpVvu0R.mjs +1 -0
  101. package/dist/web-components/Gallery-C2PTJmvN.mjs +1 -0
  102. package/dist/web-components/{HideToggle-DL911R1Z.mjs → HideToggle-0nlIo-f8.mjs} +1 -1
  103. package/dist/web-components/ImageControls-tKVAMpaj.mjs +1 -0
  104. package/dist/web-components/Items-Drd82_Jj.mjs +1 -0
  105. package/dist/web-components/Label-BIjqJ-_T.mjs +1 -0
  106. package/dist/web-components/{LanguageChoice-DT1UPiDn.mjs → LanguageChoice-DkSc-n6g.mjs} +1 -1
  107. package/dist/web-components/LightboxView-Cuqx2H1m.mjs +1 -0
  108. package/dist/web-components/ListEnd-pq-BgaDI.mjs +1 -0
  109. package/dist/web-components/{Loaded-BWfEBJyg.mjs → Loaded-CSO5NFhm.mjs} +1 -1
  110. package/dist/web-components/LoadedCanvas-DK6xMmM1.mjs +1 -0
  111. package/dist/web-components/LoadedMap-DmPH-LKY.mjs +1 -0
  112. package/dist/web-components/{Loading-zw74TdAz.mjs → Loading-CoJLSRkv.mjs} +1 -1
  113. package/dist/web-components/{Map--dJhk0_0.mjs → Map-BEVtD52O.mjs} +1 -1
  114. package/dist/web-components/MapView-DHJcn9gW.mjs +3 -0
  115. package/dist/web-components/Markup-Hm6bWOjm.mjs +2 -0
  116. package/dist/web-components/MediaBody-BpgNtpKZ.mjs +1 -0
  117. package/dist/web-components/MediaBody-Co23JjUJ.mjs +1 -0
  118. package/dist/web-components/{NavDate-BQHuyLOC.mjs → NavDate-CYNK0Qmp.mjs} +1 -1
  119. package/dist/web-components/{Navigator-B3U21_ti.mjs → Navigator-DrYPepzN.mjs} +1 -1
  120. package/dist/web-components/{Pager-DnJknq92.mjs → Pager-CN4lHURv.mjs} +1 -1
  121. package/dist/web-components/PagerLayout-DeqnSQcF.mjs +1 -0
  122. package/dist/web-components/Panel-CFYUlXup.mjs +1 -0
  123. package/dist/web-components/PanelPart-CpUIRbxr.mjs +1 -0
  124. package/dist/web-components/{PanelToggle-CFtWIeWv.mjs → PanelToggle-9ud55NNI.mjs} +1 -1
  125. package/dist/web-components/{PartOfManifest-F87jIrf9.mjs → PartOfManifest-KUHUq-6q.mjs} +1 -1
  126. package/dist/web-components/{Pending-CYAQajKu.mjs → Pending-mcmdyZPA.mjs} +1 -1
  127. package/dist/web-components/PlaceBox-DX4ZLDat.mjs +1 -0
  128. package/dist/web-components/Placeholder-0hE8q-SY.mjs +1 -0
  129. package/dist/web-components/{Position-BkWBRBfW.mjs → Position-DO5qg5Sp.mjs} +1 -1
  130. package/dist/web-components/{Primitives-BmODPlnK.mjs → Primitives-c9sIz0oQ.mjs} +1 -1
  131. package/dist/web-components/Provider-a3xY016W.mjs +1 -0
  132. package/dist/web-components/{ReadMore-BwGFsLS2.mjs → ReadMore-D_WmmKEP.mjs} +1 -1
  133. package/dist/web-components/Root-CU1o0wje.mjs +1 -0
  134. package/dist/web-components/Scene-CboEeptc.mjs +1 -0
  135. package/dist/web-components/SceneView-hcc78jQT.mjs +1 -0
  136. package/dist/web-components/{Search-CbmK9vLp.mjs → Search-BgxEW1UT.mjs} +1 -1
  137. package/dist/web-components/{Sections-Dy5_pkyQ.mjs → Sections-DZVrhoAC.mjs} +2 -2
  138. package/dist/web-components/{StandaloneItems-BmUnBp0H.mjs → StandaloneItems-6cSw7nbF.mjs} +1 -1
  139. package/dist/web-components/{Status-Dww3Pyf4.mjs → Status-DHTzuTkh.mjs} +1 -1
  140. package/dist/web-components/{Steps-o_UprQfZ.mjs → Steps-Dkpy9KiJ.mjs} +1 -1
  141. package/dist/web-components/{TargetItems-BBOGDubv.mjs → TargetItems-CyOI9_Z4.mjs} +1 -1
  142. package/dist/web-components/Timeline-B9tD3Rar.mjs +1 -0
  143. package/dist/web-components/{Tip-BbexILXs.mjs → Tip-nJSTYquc.mjs} +1 -1
  144. package/dist/web-components/{Transcript-ZVXM3ZDA.mjs → Transcript-WvFFAJQM.mjs} +1 -1
  145. package/dist/web-components/Transport-FxLp_bdW.mjs +1 -0
  146. package/dist/web-components/Transport-VUxSEIQO.mjs +1 -0
  147. package/dist/web-components/{annotation-collection-7SS1ELcO.mjs → annotation-collection-BkC3nBPA.mjs} +1 -1
  148. package/dist/web-components/{annotation-name-CYkZopdd.mjs → annotation-name-Du2KAWoD.mjs} +1 -1
  149. package/dist/web-components/{annotations-content-Bdtn50sf.mjs → annotations-content-CEzAS-P2.mjs} +1 -1
  150. package/dist/web-components/{body-CkOBHlJ0.mjs → body-DPlfbLt3.mjs} +1 -1
  151. package/dist/web-components/canvas-BUwBftJW.mjs +1 -0
  152. package/dist/web-components/cloverEngine-UNw5K4Xg.mjs +164 -0
  153. package/dist/web-components/{content-state-reader-Ahh6artg.mjs → content-state-reader-GgQF2MvJ.mjs} +1 -1
  154. package/dist/web-components/{controls-BJrZVQkS.mjs → controls-CC9G5LxK.mjs} +1 -1
  155. package/dist/web-components/custom-elements.json +191 -45
  156. package/dist/web-components/{downloads-CqVWo-yn.mjs → downloads-CmAYeEIz.mjs} +1 -1
  157. package/dist/web-components/dragToClose-DK-eM097.mjs +1 -0
  158. package/dist/web-components/{engine-B-sscpLa.mjs → engine-Dok0z8WP.mjs} +1 -1
  159. package/dist/web-components/{engines-DfCHjbt3.mjs → engines-BD2IfwQF.mjs} +1 -1
  160. package/dist/web-components/es-B1NvdYp-.mjs +1 -0
  161. package/dist/web-components/{fetchManifest-BIzne1Pj.mjs → fetchManifest-tQXcfFiz.mjs} +1 -1
  162. package/dist/web-components/fi-BjtYZNLo.mjs +1 -0
  163. package/dist/web-components/fr-Cd22Lziw.mjs +1 -0
  164. package/dist/web-components/fromManifest-BwQdeAuL.mjs +1 -0
  165. package/dist/web-components/glyphs-dp_HK3Ja.mjs +1 -0
  166. package/dist/web-components/hooks-C4dJ5K_D.mjs +1 -0
  167. package/dist/web-components/image-layers-xcBsiad9.mjs +1 -0
  168. package/dist/web-components/{imageService-0eTvQ-3h.mjs → imageService-4sFnmAFX.mjs} +1 -1
  169. package/dist/web-components/index-DspT4wUm.mjs +1 -0
  170. package/dist/web-components/index.d.mts +5 -5
  171. package/dist/web-components/index.mjs +1 -1
  172. package/dist/web-components/items-BUmOy2QY.mjs +1 -0
  173. package/dist/web-components/items-CWMI53aN.mjs +1 -0
  174. package/dist/web-components/label-BGjL7I4b.mjs +1 -0
  175. package/dist/web-components/layout-B29v2RKK.mjs +1 -0
  176. package/dist/web-components/{link-GEdiEwlR.mjs → link-Ct5PpHEY.mjs} +1 -1
  177. package/dist/web-components/logo-BFstM-0a.mjs +1 -0
  178. package/dist/web-components/masonry-0QfzOgbB.mjs +1 -0
  179. package/dist/web-components/{models-59cEeiAA.mjs → models-BXcT4ijX.mjs} +1 -1
  180. package/dist/web-components/nb-CEwZDBiR.mjs +1 -0
  181. package/dist/web-components/nn-jYQhr9RI.mjs +1 -0
  182. package/dist/web-components/no-CEwZDBiR.mjs +1 -0
  183. package/dist/web-components/{nodes-CTw9OqlA.mjs → nodes-BleXuYE6.mjs} +1 -1
  184. package/dist/web-components/{overlayImage-BMt4UTlR.mjs → overlayImage-BJtfot4Y.mjs} +1 -1
  185. package/dist/web-components/panClearOfControls-Cn2ZXsZi.mjs +1 -0
  186. package/dist/web-components/{panel-C17Rl9Ya.mjs → panel-BxxV_JkD.mjs} +1 -1
  187. package/dist/web-components/part-D4gjnYmT.mjs +1 -0
  188. package/dist/web-components/playerSurface-BXNLaFk0.mjs +1 -0
  189. package/dist/web-components/pointer-CJELU3gI.mjs +1 -0
  190. package/dist/web-components/{provider-BpxorEiq.mjs → provider-CPp0Sgr_.mjs} +1 -1
  191. package/dist/web-components/pt-CWR30SzS.mjs +1 -0
  192. package/dist/web-components/{range-regions-BGQy4E9U.mjs → range-regions-DAaOu0IS.mjs} +1 -1
  193. package/dist/web-components/{read-more-BDM_6CVc.mjs → read-more-lcqGslUd.mjs} +1 -1
  194. package/dist/web-components/readingLanguages-FyVsSWJ8.mjs +1 -0
  195. package/dist/web-components/rendererSurface-nh6-EfuZ.mjs +22 -0
  196. package/dist/web-components/{renderers-CiB74bQh.mjs → renderers-BFS7hFVU.mjs} +1 -1
  197. package/dist/web-components/{resource-CRbpf9pX.mjs → resource-Bufu7lAr.mjs} +1 -1
  198. package/dist/web-components/{save-file-CCuZEuQr.mjs → save-file-CoknKOPz.mjs} +1 -1
  199. package/dist/web-components/search-5ocrsYmT.mjs +1 -0
  200. package/dist/web-components/shared-DFAX0n3B.mjs +1 -0
  201. package/dist/web-components/{show-link-BXm7SNIC.mjs → show-link-DBaJj4s_.mjs} +1 -1
  202. package/dist/web-components/{sizedImage-k4Q-eyOB.mjs → sizedImage-jnOGcIIZ.mjs} +1 -1
  203. package/dist/web-components/{split-Hp6z-v4h.mjs → split-P6J0qqf5.mjs} +1 -1
  204. package/dist/web-components/{status-BmtuKfAG.mjs → status-honoOMNx.mjs} +1 -1
  205. package/dist/web-components/styles-BwkYiCLC.mjs +1 -0
  206. package/dist/web-components/three.mjs +1 -1
  207. package/dist/web-components/{thumbnail-Dp7a8oom.mjs → thumbnail-EbURh-UM.mjs} +1 -1
  208. package/dist/web-components/{tip-C-oovDZK.mjs → tip-BhNI83aT.mjs} +1 -1
  209. package/dist/web-components/{toggle-C7ODWDEZ.mjs → toggle-CJKdi5KH.mjs} +1 -1
  210. package/dist/web-components/{useContainerName-CrOmY-km.mjs → useContainerName-_48Cdi0m.mjs} +1 -1
  211. package/dist/web-components/useControlsVisibility-CieBxGnK.mjs +1 -0
  212. package/dist/web-components/useLazyPanelPane-Da3kJiOt.mjs +1 -0
  213. package/dist/web-components/{useNearViewport-BqXi9Gn4.mjs → useNearViewport-B34ebmIW.mjs} +1 -1
  214. package/dist/web-components/useScrollTrack-DgRGFeP5.mjs +1 -0
  215. package/dist/web-components/viewer/AnnotationItems-BNA_92Dv.mjs +1 -0
  216. package/dist/web-components/viewer/{AnnotationMenu-DPOSehBo.mjs → AnnotationMenu-BIQYVR4N.mjs} +1 -1
  217. package/dist/web-components/viewer/AnnotationState-BbwQqA1U.mjs +1 -0
  218. package/dist/web-components/viewer/Annotations-CZzOZAFP.mjs +2 -0
  219. package/dist/web-components/viewer/Annotations-P4XzAlNc.mjs +1 -0
  220. package/dist/web-components/viewer/{Canvas2DBackend-BTK6ZJh0.mjs → Canvas2DBackend-DFfCzyjL.mjs} +1 -1
  221. package/dist/web-components/viewer/CaptionDetails-DPtE-RQQ.mjs +1 -0
  222. package/dist/web-components/viewer/ChaptersMenu-D6Jmujag.mjs +1 -0
  223. package/dist/web-components/viewer/{ChoiceMenu-DQ1x572Y.mjs → ChoiceMenu-GkqyTQRQ.mjs} +1 -1
  224. package/dist/web-components/viewer/Collection-DjY_6qa6.mjs +1 -0
  225. package/dist/web-components/viewer/Connected-D5T-mtiy.mjs +1 -0
  226. package/dist/web-components/viewer/Connected-DIOuI3Mv.mjs +1 -0
  227. package/dist/web-components/viewer/Contents-DV-VxXuf.mjs +1 -0
  228. package/dist/web-components/viewer/ControlMenu-BsEpff6N.mjs +1 -0
  229. package/dist/web-components/viewer/ControlsFade-BowtN96W.mjs +1 -0
  230. package/dist/web-components/viewer/{CountMenu-4u6U6yqb.mjs → CountMenu-DCmA6HdK.mjs} +1 -1
  231. package/dist/web-components/viewer/Cue-BjbVzrpl.mjs +1 -0
  232. package/dist/web-components/viewer/Document-4ZQd3W3o.mjs +1 -0
  233. package/dist/web-components/viewer/{DomLayers-CGkDtemL.mjs → DomLayers-BCwCxPDU.mjs} +1 -1
  234. package/dist/web-components/viewer/Download-CL4IClAD.mjs +1 -0
  235. package/dist/web-components/viewer/EntryBodies-e40y47bl.mjs +1 -0
  236. package/dist/web-components/viewer/EntryThumbnail-B_dP3w4o.mjs +1 -0
  237. package/dist/web-components/viewer/{FieldPill-DFXGWrvB.mjs → FieldPill-Hse1cDBE.mjs} +1 -1
  238. package/dist/web-components/viewer/FrameAnimation-CE218DCr.mjs +1 -0
  239. package/dist/web-components/viewer/Gallery-F2sVj4ph.mjs +1 -0
  240. package/dist/web-components/viewer/{HideToggle-DP5kHzWM.mjs → HideToggle-CYoqe_ez.mjs} +1 -1
  241. package/dist/web-components/viewer/ImageControls-C2G4x2Es.mjs +1 -0
  242. package/dist/web-components/viewer/LanguageChoice-BmO-322r.mjs +1 -0
  243. package/dist/web-components/viewer/LightboxView-DKR8dXcg.mjs +1 -0
  244. package/dist/web-components/viewer/ListEnd-DX1jsvJk.mjs +1 -0
  245. package/dist/web-components/viewer/{MapView-BN9wXQKV.mjs → MapView-Df0wZjCh.mjs} +2 -2
  246. package/dist/web-components/viewer/MediaBody-CataNonO.mjs +1 -0
  247. package/dist/web-components/viewer/MediaBody-SkIgrEMj.mjs +1 -0
  248. package/dist/web-components/viewer/{NavDate-C2-wwLuB.mjs → NavDate-BZgeaMG9.mjs} +1 -1
  249. package/dist/web-components/viewer/{Navigator-C3jghOd3.mjs → Navigator-Co76p-1n.mjs} +1 -1
  250. package/dist/web-components/viewer/PagerLayout-tUkN1-FV.mjs +1 -0
  251. package/dist/web-components/viewer/PanelPart-Cl4Sst60.mjs +1 -0
  252. package/dist/web-components/viewer/{PartOfManifest-D22yMgCf.mjs → PartOfManifest-DXnbEPzS.mjs} +1 -1
  253. package/dist/web-components/viewer/PlaceBox-xrJ4CGdN.mjs +1 -0
  254. package/dist/web-components/viewer/Placeholder-B1AcizHL.mjs +1 -0
  255. package/dist/web-components/viewer/Search-DTg1cHZ3.mjs +1 -0
  256. package/dist/web-components/viewer/StandaloneItems-BpBEQG8i.mjs +1 -0
  257. package/dist/web-components/viewer/{Steps-Bw32X5xO.mjs → Steps-SpwMQdCL.mjs} +1 -1
  258. package/dist/web-components/viewer/{TargetItems-DLhUH1Gq.mjs → TargetItems-B6Icep5k.mjs} +1 -1
  259. package/dist/web-components/viewer/Transcript-rTAhuXCF.mjs +1 -0
  260. package/dist/web-components/viewer/Transport-vKIDALE-.mjs +1 -0
  261. package/dist/web-components/viewer/Transport-z_kdVisw.mjs +1 -0
  262. package/dist/web-components/viewer/annotation-collection-B7pZiLVk.mjs +1 -0
  263. package/dist/web-components/viewer/annotation-name-BKj1O9lA.mjs +1 -0
  264. package/dist/web-components/viewer/{annotations-content-CbA3eOIC.mjs → annotations-content-9AtLlPNn.mjs} +1 -1
  265. package/dist/web-components/viewer/cloverEngine-jRrYLrWa.mjs +164 -0
  266. package/dist/web-components/viewer/{content-state-reader-C7UBMOq3.mjs → content-state-reader-CPvkju6Q.mjs} +1 -1
  267. package/dist/web-components/viewer/dragToClose-Co9kGk9q.mjs +1 -0
  268. package/dist/web-components/viewer/{fetchManifest-C2Yxg3x9.mjs → fetchManifest-D7N9WhhF.mjs} +1 -1
  269. package/dist/web-components/viewer/{host-CZeyjCKR.mjs → host-DMD9LE4H.mjs} +1 -1
  270. package/dist/web-components/viewer/image-layers-x_shzPvu.mjs +1 -0
  271. package/dist/web-components/viewer/index.mjs +1 -1
  272. package/dist/web-components/viewer/{link-DssZ0Z2N.mjs → link-DikPGzNO.mjs} +1 -1
  273. package/dist/web-components/viewer/overlayImage-33kKKB0T.mjs +1 -0
  274. package/dist/web-components/viewer/range-regions-TH6WWGTT.mjs +1 -0
  275. package/dist/web-components/viewer/{renderers-DLoqv3QO.mjs → renderers-BxePmixF.mjs} +1 -1
  276. package/dist/web-components/viewer/{save-file-CJT5p5Hg.mjs → save-file-QXKiPlST.mjs} +1 -1
  277. package/dist/web-components/viewer/{search-PhOwMKHi.mjs → search-B_NePyas.mjs} +1 -1
  278. package/dist/web-components/viewer/styles-Bedyz7_l.mjs +1 -0
  279. package/dist/web-components/viewer/useControlsVisibility-Cu-jTDzs.mjs +1 -0
  280. package/dist/web-components/viewer/useLazyPanelPane-BhLtRixT.mjs +1 -0
  281. package/dist/web-components/viewer/viewer-nfPJPwwt.mjs +29 -0
  282. package/dist/web-components/viewer/{vtt-1Pk7Dhsj.mjs → vtt-CUn4h5JB.mjs} +1 -1
  283. package/dist/web-components/viewer-DN2Mo3vc.mjs +1 -0
  284. package/dist/web-components/{vtt-CacHieeN.mjs → vtt-C5M5WPSG.mjs} +1 -1
  285. package/package.json +1 -1
  286. package/dist/templates/shared/LightboxBody.mjs +0 -9
  287. package/dist/web-components/About-DhOGPFaI.mjs +0 -1
  288. package/dist/web-components/AnnotationItems-CNP4CJiT.mjs +0 -1
  289. package/dist/web-components/Body-DaY1UJIy.mjs +0 -1
  290. package/dist/web-components/BodyUnloadable-DcTM7hHF.mjs +0 -1
  291. package/dist/web-components/CanvasView-BWQ4SK2b.mjs +0 -2
  292. package/dist/web-components/CaptionDetails-DSziiuQV.mjs +0 -1
  293. package/dist/web-components/ChoiceMenu-DTuEEUeM.mjs +0 -1
  294. package/dist/web-components/Collection-B9swJtPW.mjs +0 -1
  295. package/dist/web-components/ControlMenu-Crtho2cs.mjs +0 -1
  296. package/dist/web-components/Cue-CbZaGwZh.mjs +0 -1
  297. package/dist/web-components/Document-BfltLWZZ.mjs +0 -1
  298. package/dist/web-components/DocumentPanel-ZSe40cV4.mjs +0 -1
  299. package/dist/web-components/FrameAnimation-IfR1czfc.mjs +0 -1
  300. package/dist/web-components/Gallery-DD06BDQo.mjs +0 -1
  301. package/dist/web-components/Items-BHzT9A73.mjs +0 -1
  302. package/dist/web-components/Label-KabnxuMN.mjs +0 -1
  303. package/dist/web-components/LightboxBody-BhRhdXo6.mjs +0 -1
  304. package/dist/web-components/ListEnd-CbwNlty-.mjs +0 -1
  305. package/dist/web-components/LoadedCanvas-CdZ5WOWz.mjs +0 -1
  306. package/dist/web-components/LoadedMap-DQyQVRVQ.mjs +0 -1
  307. package/dist/web-components/MapView-duA5WGsu.mjs +0 -3
  308. package/dist/web-components/Markup-D-kioDf9.mjs +0 -2
  309. package/dist/web-components/MediaBody-CoOiVXcv.mjs +0 -1
  310. package/dist/web-components/MediaBody-d8ErTuwT.mjs +0 -1
  311. package/dist/web-components/PagerLayout-CvOmKtSW.mjs +0 -1
  312. package/dist/web-components/Panel-CIdjOznL.mjs +0 -1
  313. package/dist/web-components/PlaceBox-BtIbIotm.mjs +0 -1
  314. package/dist/web-components/Placeholder-TIyj4ZjR.mjs +0 -1
  315. package/dist/web-components/Provider-C8se8i4I.mjs +0 -1
  316. package/dist/web-components/Root-CAJB0-Mh.mjs +0 -1
  317. package/dist/web-components/Scene-Ctcdt7CD.mjs +0 -1
  318. package/dist/web-components/SceneView-B6bEx_7x.mjs +0 -1
  319. package/dist/web-components/Timeline-CfIF4APc.mjs +0 -1
  320. package/dist/web-components/canvas-CWf_Fag8.mjs +0 -1
  321. package/dist/web-components/cloverEngine-6djEHNCD.mjs +0 -164
  322. package/dist/web-components/dragToClose-C-Pf1IeO.mjs +0 -1
  323. package/dist/web-components/es-BYfHUZ7P.mjs +0 -1
  324. package/dist/web-components/fi-B5y2qr8T.mjs +0 -1
  325. package/dist/web-components/fr-ChezCx6V.mjs +0 -1
  326. package/dist/web-components/fromManifest-gg5Wx14y.mjs +0 -1
  327. package/dist/web-components/glyphs-JYl2STEr.mjs +0 -1
  328. package/dist/web-components/hooks-x7rO95CS.mjs +0 -1
  329. package/dist/web-components/image-layers-BjbeyHBS.mjs +0 -1
  330. package/dist/web-components/index-BZ7b9k0N.mjs +0 -1
  331. package/dist/web-components/items-CnAIl9fS.mjs +0 -1
  332. package/dist/web-components/items-F6hJgdAS.mjs +0 -1
  333. package/dist/web-components/label-CI88KH2_.mjs +0 -1
  334. package/dist/web-components/layout-De1MOSYe.mjs +0 -1
  335. package/dist/web-components/logo-Ckwj7FlP.mjs +0 -1
  336. package/dist/web-components/nb-8J22f9Td.mjs +0 -1
  337. package/dist/web-components/nn-Dv1EvzI1.mjs +0 -1
  338. package/dist/web-components/no-8J22f9Td.mjs +0 -1
  339. package/dist/web-components/panClearOfControls-ac9uf-Qs.mjs +0 -1
  340. package/dist/web-components/part-CXts97_M.mjs +0 -1
  341. package/dist/web-components/playerSurface-HYwEwPK6.mjs +0 -1
  342. package/dist/web-components/pt-DWYQkATt.mjs +0 -1
  343. package/dist/web-components/readingLanguages-fs_HqvqQ.mjs +0 -1
  344. package/dist/web-components/rendererSurface-C0aKlE0v.mjs +0 -22
  345. package/dist/web-components/search-CkM0O0Z1.mjs +0 -1
  346. package/dist/web-components/shared-MTsMddHx.mjs +0 -1
  347. package/dist/web-components/styles-CZV1nbBQ.mjs +0 -1
  348. package/dist/web-components/useScrollTrack-CEsOU2yT.mjs +0 -1
  349. package/dist/web-components/viewer/AnnotationItems-CyhVcRFc.mjs +0 -1
  350. package/dist/web-components/viewer/AnnotationState-Bjztkobn.mjs +0 -1
  351. package/dist/web-components/viewer/Annotations-Dh_8Tzi0.mjs +0 -2
  352. package/dist/web-components/viewer/Annotations-wwuOCxzI.mjs +0 -1
  353. package/dist/web-components/viewer/CaptionDetails-BwCTovy_.mjs +0 -1
  354. package/dist/web-components/viewer/Collection-DSBxCmXw.mjs +0 -1
  355. package/dist/web-components/viewer/Connected-CL3N8F2J.mjs +0 -1
  356. package/dist/web-components/viewer/Connected-DTk1jlyI.mjs +0 -1
  357. package/dist/web-components/viewer/Contents-DrXckx7d.mjs +0 -1
  358. package/dist/web-components/viewer/ControlMenu-Bp91s-g_.mjs +0 -1
  359. package/dist/web-components/viewer/Cue-C-aF8peC.mjs +0 -1
  360. package/dist/web-components/viewer/Document-BN1rICu3.mjs +0 -1
  361. package/dist/web-components/viewer/DocumentPanel-CEesxdeY.mjs +0 -1
  362. package/dist/web-components/viewer/Download-CawEl9MN.mjs +0 -1
  363. package/dist/web-components/viewer/EntryBodies-nYHMwSSM.mjs +0 -1
  364. package/dist/web-components/viewer/EntryThumbnail-DrO_0SzR.mjs +0 -1
  365. package/dist/web-components/viewer/FrameAnimation-CZfzpxaD.mjs +0 -1
  366. package/dist/web-components/viewer/Gallery-MWHtvjti.mjs +0 -1
  367. package/dist/web-components/viewer/LanguageChoice-C50T7dPI.mjs +0 -1
  368. package/dist/web-components/viewer/LightboxBody-C2T7IC29.mjs +0 -1
  369. package/dist/web-components/viewer/ListEnd-BDuOx__m.mjs +0 -1
  370. package/dist/web-components/viewer/MediaBody-CEyswliX.mjs +0 -1
  371. package/dist/web-components/viewer/MediaBody-Dw3DWDjc.mjs +0 -1
  372. package/dist/web-components/viewer/PagerLayout-Cg2NpqoD.mjs +0 -1
  373. package/dist/web-components/viewer/PlaceBox-Dckw4Sfk.mjs +0 -1
  374. package/dist/web-components/viewer/Placeholder-NYVWYg5Q.mjs +0 -1
  375. package/dist/web-components/viewer/Search-DC259m4f.mjs +0 -1
  376. package/dist/web-components/viewer/StandaloneItems-E4kpMne9.mjs +0 -1
  377. package/dist/web-components/viewer/Transcript-D_VGJQxn.mjs +0 -1
  378. package/dist/web-components/viewer/annotation-collection-DZHa18ir.mjs +0 -1
  379. package/dist/web-components/viewer/annotation-name-BaNdW2Xk.mjs +0 -1
  380. package/dist/web-components/viewer/cloverEngine-C04bCSFR.mjs +0 -164
  381. package/dist/web-components/viewer/image-layers-B09fporZ.mjs +0 -1
  382. package/dist/web-components/viewer/overlayImage-BR3eJCKq.mjs +0 -1
  383. package/dist/web-components/viewer/range-regions-By6L5JOK.mjs +0 -1
  384. package/dist/web-components/viewer/styles-NZLnZPAC.mjs +0 -1
  385. package/dist/web-components/viewer/viewer-D30YHqyF.mjs +0 -29
  386. package/dist/web-components/viewer-CH7re5OO.mjs +0 -1
@@ -0,0 +1,22 @@
1
+ var bt=Object.defineProperty;var Tt=(n,t,e)=>t in n?bt(n,t,{enumerable:true,configurable:true,writable:true,value:e}):n[t]=e;var h=(n,t,e)=>Tt(n,typeof t!="symbol"?t+"":t,e);import{c as Et,r as Y}from"./contexts-ByL3eA_T.mjs";import{c as k,s as _,t as L,a as Mt,u as dt,i as kt,b as ut,d as ft,e as _t,r as Lt,f as A,g as Pt}from"./CanvasView-DxZASM9E.mjs";import{a as S,w as It,v as N,f as At,s as $,b as St,c as Rt}from"./Camera-DqT_1MgD.mjs";import{i as Q,a as Bt,T as Ot,b as j,c as J,D as Ct,s as Ut}from"./pointer-CJELU3gI.mjs";import{a0 as zt,a1 as Wt}from"./shared-DFAX0n3B.mjs";import{a as Ft,i as tt,f as Dt}from"./imageService-4sFnmAFX.mjs";function Nt(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement?n.complete&&n.naturalWidth>0:true}function Ht(n,t){if(!n.bleed)return{x:0,y:0};const e=n.transform,i=Math.hypot(e.a,e.b)*t,s=Math.hypot(e.c,e.d)*t;return{x:n.bleed.right&&i>0?1/i:0,y:n.bleed.bottom&&s>0?1/s:0}}const Gt=`#version 300 es
2
+ in vec2 a_position;
3
+ uniform mat3 u_matrix;
4
+ uniform vec4 u_crop;
5
+ out vec2 v_uv;
6
+
7
+ void main() {
8
+ vec3 clip = u_matrix * vec3(a_position, 1.0);
9
+ gl_Position = vec4(clip.xy, 0.0, 1.0);
10
+ v_uv = u_crop.xy + a_position * u_crop.zw;
11
+ }
12
+ `,Xt=`#version 300 es
13
+ precision highp float;
14
+ in vec2 v_uv;
15
+ uniform sampler2D u_texture;
16
+ uniform float u_opacity;
17
+ out vec4 outColor;
18
+
19
+ void main() {
20
+ outColor = texture(u_texture, v_uv) * u_opacity;
21
+ }
22
+ `;class R{constructor(t,e,i){h(this,"kind","webgl2");h(this,"canvas");h(this,"maxTextureSize");h(this,"gl");h(this,"program",null);h(this,"vao",null);h(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});h(this,"textures",new Map);h(this,"cssWidth",1);h(this,"cssHeight",1);h(this,"pixelRatio",1);h(this,"matrixScratch",new Float32Array(9));h(this,"isLost",false);h(this,"callbacks");h(this,"handleLost",()=>{var t2,e2;this.isLost=true,this.textures.clear(),(e2=(t2=this.callbacks).onLost)==null||e2.call(t2)});this.canvas=t,this.gl=e,this.callbacks=i,this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)||4096;const s=Zt(e,Gt,Xt);this.program=s,this.uniforms={matrix:e.getUniformLocation(s,"u_matrix"),crop:e.getUniformLocation(s,"u_crop"),opacity:e.getUniformLocation(s,"u_opacity"),texture:e.getUniformLocation(s,"u_texture")};const r=e.createVertexArray();e.bindVertexArray(r);const o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),e.STATIC_DRAW);const a=e.getAttribLocation(s,"a_position");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,false,0,0),e.bindVertexArray(null),this.vao=r,e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),t.addEventListener("webglcontextlost",this.handleLost)}static create(t,e={}){let i=null;try{i=t.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{i=null}if(!i||typeof i.createShader!="function")return null;try{return new R(t,i,e)}catch{return null}}resize(t,e,i){this.cssWidth=Math.max(1,t),this.cssHeight=Math.max(1,e),this.pixelRatio=i;const s=Math.max(1,Math.round(t*i)),r=Math.max(1,Math.round(e*i));this.canvas.width!==s&&(this.canvas.width=s),this.canvas.height!==r&&(this.canvas.height=r)}begin(){if(this.isLost)return;const t=this.gl;t.viewport(0,0,this.canvas.width,this.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(this.program),t.bindVertexArray(this.vao),t.activeTexture(t.TEXTURE0),t.uniform1i(this.uniforms.texture,0)}draw(t){if(this.isLost||!Nt(t.source))return"skipped";const e=this.gl,i=this.upload(t);if(i==="tainted")return"tainted";if(!i)return"skipped";const s=t.crop??{x:0,y:0,width:t.width,height:t.height},r=Ht(t,this.pixelRatio),o=k(t.transform,L(s.x,s.y),_(s.width+r.x,s.height+r.y));return e.uniformMatrix3fv(this.uniforms.matrix,false,Mt(o,this.cssWidth,this.cssHeight,this.matrixScratch)),e.uniform4f(this.uniforms.crop,s.x/t.width,s.y/t.height,s.width/t.width,s.height/t.height),e.uniform1f(this.uniforms.opacity,t.opacity),e.bindTexture(e.TEXTURE_2D,i.texture),e.drawArrays(e.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(t){return!this.isLost&&this.textures.has(t)}release(t){const e=this.textures.get(t);e&&(this.isLost||this.gl.deleteTexture(e.texture),this.textures.delete(t))}dispose(){var t;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const e of[...this.textures.keys()])this.release(e);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(t=this.gl.getExtension("WEBGL_lose_context"))==null||t.loseContext(),this.isLost=true}upload(t){const e=this.gl,i=this.textures.get(t.key);if(i&&i.width===t.width&&i.height===t.height)return i;const s=(i==null?void 0:i.texture)??e.createTexture();if(!s)return null;e.bindTexture(e.TEXTURE_2D,s);try{e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source)}catch(o){if(i||e.deleteTexture(s),Kt(o))return"tainted";throw o}e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const r={texture:s,width:t.width,height:t.height};return this.textures.set(t.key,r),r}}function Zt(n,t,e){const i=et(n,n.VERTEX_SHADER,t),s=et(n,n.FRAGMENT_SHADER,e),r=n.createProgram();if(!r)throw new Error("Could not create WebGL program");if(n.attachShader(r,i),n.attachShader(r,s),n.linkProgram(r),n.deleteShader(i),n.deleteShader(s),!n.getProgramParameter(r,n.LINK_STATUS)){const o=n.getProgramInfoLog(r);throw n.deleteProgram(r),new Error(`Could not link WebGL program: ${o}`)}return r}function et(n,t,e){const i=n.createShader(t);if(!i)throw new Error("Could not create WebGL shader");if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){const s=n.getShaderInfoLog(i);throw n.deleteShader(i),new Error(`Could not compile WebGL shader: ${s}`)}return i}function Kt(n){return typeof n=="object"&&n!==null&&n.name==="SecurityError"}const Vt=.09,qt=1e-4,it=.05,Yt=1e-4;class $t{constructor(t,e=Vt){h(this,"current");h(this,"target",null);h(this,"timeConstant");this.current={...t},this.timeConstant=e}get destination(){return this.target?{...this.target.state}:{...this.current}}set(t){this.current={...t},this.target=null}animateTo(t,e,i=false){if(i||this.timeConstant===0){this.set(t.state);return}let s=t.anchor;if(s){const r=S(s.world,s.screen,t.state.zoom,t.state.rotation,e);Math.hypot(r.x-t.state.x,r.y-t.state.y)*t.state.zoom>it&&(s=void 0)}this.target={state:{...t.state},anchor:s}}stop(){this.target=null}step(t,e){const i=this.target;if(!i)return false;const s=1-Math.exp(-Math.max(t,0)/this.timeConstant),r=this.current,o=i.state,a=Math.exp(Math.log(r.zoom)+(Math.log(o.zoom)-Math.log(r.zoom))*s),d=r.rotation+(o.rotation-r.rotation)*s;let l;return i.anchor?l=S(i.anchor.world,i.anchor.screen,a,d,e):l={x:r.x+(o.x-r.x)*s,y:r.y+(o.y-r.y)*s},this.current={x:l.x,y:l.y,zoom:a,rotation:d},Math.abs(Math.log(o.zoom/a))<qt&&Math.abs(o.rotation-d)<Yt&&Math.hypot(o.x-l.x,o.y-l.y)*a<it?(this.current={...o},this.target=null,false):true}}const H={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true},U=2,st=1.5,nt=.1,Qt=100,jt=200,Jt=.002,te=.01;class ee{constructor(t,e,i=H){h(this,"pointers",new Map);h(this,"samples",[]);h(this,"down",null);h(this,"pinch",null);h(this,"lastTap",null);h(this,"lastPointerType","");h(this,"penHovers",false);h(this,"onPointerDown",t2=>{var i2,s;if(this.lastPointerType=t2.pointerType,t2.pointerType==="mouse"&&t2.button!==0||Q(t2.target,this.element))return;(s=(i2=this.element).setPointerCapture)==null||s.call(i2,t2.pointerId);const e2=this.local(t2);this.pointers.set(t2.pointerId,e2),this.pointers.size===1?(this.down={x:e2.x,y:e2.y,t:t2.timeStamp,moved:false},this.samples=[{x:e2.x,y:e2.y,t:t2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});h(this,"onPointerMove",t2=>{var s;Bt(t2)&&(this.penHovers=true);const e2=this.pointers.get(t2.pointerId);if(!e2)return;const i2=this.local(t2);if(this.pointers.set(t2.pointerId,i2),this.pointers.size===1){const r=i2.x-e2.x,o=i2.y-e2.y;this.down&&Math.hypot(i2.x-this.down.x,i2.y-this.down.y)>Ot&&(this.down.moved=true),(s=this.down)!=null&&s.moved&&this.options.navigable&&this.target.panBy(r,o,false),this.samples.push({x:i2.x,y:i2.y,t:t2.timeStamp});const a=t2.timeStamp-Qt;for(;this.samples.length>2&&this.samples[0].t<a;)this.samples.shift()}else if(this.pointers.size===2&&this.pinch&&this.options.navigable){const r=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(r.distance/this.pinch.distance,r.mid,false),this.target.panBy(r.mid.x-this.pinch.mid.x,r.mid.y-this.pinch.mid.y,false),this.pinch=r}});h(this,"onPointerUp",t2=>{var d,l,f,m,c,u;if(!this.pointers.has(t2.pointerId))return;if(this.pointers.delete(t2.pointerId),(l=(d=this.element).releasePointerCapture)==null||l.call(d,t2.pointerId),this.pointers.size===1){this.pinch=null;const[p]=this.pointers.values();this.samples=[{...p,t:t2.timeStamp}];return}if(this.pointers.size>0)return;const e2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!e2)return;const i2=this.local(t2);if(!e2.moved&&t2.type==="pointerup"&&t2.timeStamp-e2.t<j){if((m=(f=this.target).dismiss)!=null&&m.call(f)){this.lastTap=null;return}if(J(t2.pointerType,this.penHovers)){const p=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&p&&t2.timeStamp-p.t<j&&Math.hypot(i2.x-p.x,i2.y-p.y)<Ct?(this.lastTap=null,this.zoomIn(i2)):this.lastTap={x:i2.x,y:i2.y,t:t2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?t2.shiftKey?this.target.zoomBy(1/U,i2,true):this.zoomIn(i2):(u=(c=this.target).tap)==null||u.call(c,i2);return}if(!this.options.navigable)return;const r=this.samples[0],o=this.samples[this.samples.length-1],a=((o==null?void 0:o.t)??0)-((r==null?void 0:r.t)??0);if(r&&o&&a>0&&t2.timeStamp-o.t<50){const p=(o.x-r.x)/a*1e3,w=(o.y-r.y)/a*1e3;Math.hypot(p,w)>jt&&this.target.flick(p,w)}});h(this,"onDoubleClick",t2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||J(this.lastPointerType,this.penHovers)||Q(t2.target,this.element)||(t2.shiftKey?this.target.zoomBy(1/U,this.local(t2),true):this.zoomIn(this.local(t2))))});h(this,"onWheel",t2=>{const e2=t2.ctrlKey;if(!this.options.navigable||!e2&&!this.options.scrollToZoom||!e2&&Ut(t2.target,this.element,t2.deltaY))return;t2.preventDefault();const i2=ie(t2),s=e2?te:Jt;this.target.zoomBy(Math.exp(-i2*s),this.local(t2),!e2)});h(this,"onKeyDown",t2=>{if(t2.target!==this.element||!this.options.navigable||t2.altKey||t2.metaKey||t2.ctrlKey)return;const e2=this.element.getBoundingClientRect(),i2=e2.width*nt*(t2.shiftKey?3:1),s=e2.height*nt*(t2.shiftKey?3:1);switch(t2.key){case"ArrowLeft":this.target.panBy(i2,0,true);break;case"ArrowRight":this.target.panBy(-i2,0,true);break;case"ArrowUp":this.target.panBy(0,s,true);break;case"ArrowDown":this.target.panBy(0,-s,true);break;case"+":case"=":this.target.zoomBy(st,void 0,true);break;case"-":case"_":this.target.zoomBy(1/st,void 0,true);break;case"0":this.target.home();break;case"r":this.target.rotateBy(90);break;case"R":this.target.rotateBy(-90);break;default:return}t2.preventDefault()});this.element=t,this.target=e,this.options=i,t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointermove",this.onPointerMove),t.addEventListener("pointerup",this.onPointerUp),t.addEventListener("pointercancel",this.onPointerUp),t.addEventListener("dblclick",this.onDoubleClick),t.addEventListener("wheel",this.onWheel,{passive:false}),t.addEventListener("keydown",this.onKeyDown)}setOptions(t){this.options=t}dispose(){const t=this.element;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("pointercancel",this.onPointerUp),t.removeEventListener("dblclick",this.onDoubleClick),t.removeEventListener("wheel",this.onWheel),t.removeEventListener("keydown",this.onKeyDown)}local(t){const e=this.element.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}zoomIn(t){var e,i;(i=(e=this.target).atMaxZoom)!=null&&i.call(e)?this.target.home():this.target.zoomBy(U,t,true)}pinchState(){const[t,e]=[...this.pointers.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),mid:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}}function ie(n){return n.deltaMode===1?n.deltaY*16:n.deltaMode===2?n.deltaY*400:n.deltaY}class mt extends Error{constructor(t,e,i){super(t),this.url=e,this.status=i,this.name="ImageLoadError"}}const rt=new Set;async function se(n,t={}){const{signal:e,maxTextureSize:i,request:s}=t,r=zt(s),o=re(n);if(typeof createImageBitmap!="function"||typeof fetch!="function")return z(n,{signal:e,cors:true,withCredentials:r});if(o&&rt.has(o))return z(n,{signal:e,cors:false,withCredentials:r});let a;try{a=await Wt(s,n,{mode:"cors",signal:e})}catch(c){if(oe(c,e))throw c;const u=await z(n,{signal:e,cors:false,withCredentials:r});return o&&rt.add(o),u}if(!a.ok)throw new mt(`Image request failed with ${a.status}`,n,a.status);const d=await a.blob();let l=await ne(d);const f=l.width,m=l.height;if(i&&(l.width>i||l.height>i)){const c=i/Math.max(l.width,l.height),u=await createImageBitmap(l,{resizeWidth:Math.max(1,Math.floor(l.width*c)),resizeHeight:Math.max(1,Math.floor(l.height*c)),resizeQuality:"high"});l.close(),l=u}if(e!=null&&e.aborted)throw l.close(),G();return{kind:"bitmap",source:l,width:l.width,height:l.height,naturalWidth:f,naturalHeight:m,opaque:false}}async function ne(n){const t={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(n,t)}catch(e){if(e instanceof TypeError)return createImageBitmap(n);throw e}}function z(n,{signal:t,cors:e,withCredentials:i}){return new Promise((s,r)=>{if(t!=null&&t.aborted){r(G());return}const o=new Image;o.decoding="async",e&&(o.crossOrigin=i?"use-credentials":"anonymous");const a=()=>{o.onload=null,o.onerror=null,t==null||t.removeEventListener("abort",d)},d=()=>{a(),o.src="",r(G())};t==null||t.addEventListener("abort",d),o.onload=()=>{a();const l=()=>s({kind:"element",source:o,width:o.naturalWidth,height:o.naturalHeight,naturalWidth:o.naturalWidth,naturalHeight:o.naturalHeight,opaque:!e});typeof o.decode=="function"?o.decode().then(l,l):l()},o.onerror=()=>{a(),r(new mt("Image failed to load",n))},o.src=n})}function re(n){var t;try{return new URL(n,(t=globalThis.location)==null?void 0:t.href).origin}catch{return null}}function oe(n,t){return!!(t!=null&&t.aborted)||typeof n=="object"&&n!==null&&n.name==="AbortError"}function G(){const n=new Error("Aborted");return n.name="AbortError",n}function ot(n){n.kind==="bitmap"&&n.source.close()}const ae=192*1024*1024,he=6,ce=2;class le{constructor(t){h(this,"entries",new Map);h(this,"inFlight",0);h(this,"frame",0);h(this,"bytes",0);h(this,"wanted",[]);h(this,"disposed",false);h(this,"budget");h(this,"maxInFlight");this.options=t,this.budget=t.byteBudget??ae,this.maxInFlight=t.maxInFlight??he}get(t){const e=this.entries.get(t);if((e==null?void 0:e.state)==="ready")return e.lastUsed=this.frame,e.image}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="ready"}failed(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(t,e){var s;const i=this.entries.get(t);(i==null?void 0:i.state)!=="ready"&&((s=i==null?void 0:i.controller)==null||s.abort(),this.entries.set(t,{url:t,state:"ready",image:e,bytes:W(e),lastUsed:this.frame,attempts:0,pinned:false,waiters:(i==null?void 0:i.waiters)??[]}),this.bytes+=W(e),this.flushWaiters(t))}prefetch(t){return Promise.all(t.map(e=>new Promise(i=>{const s=this.entries.get(e.url);if(s&&s.state!=="loading")return i();if(s){s.waiters.push(i);return}this.start({...e,priority:-1},i)}))).then(()=>{})}update(t){if(this.disposed)return;this.frame++;const e=new Set(t.map(i=>i.url));this.wanted=[...t].sort((i,s)=>i.priority-s.priority);for(const i of this.entries.values())i.state==="loading"&&!i.pinned&&!e.has(i.url)&&i.controller&&(i.controller.abort(),this.entries.delete(i.url),this.inFlight--);for(const i of this.wanted){const s=this.entries.get(i.url);s&&(s.lastUsed=this.frame)}this.pump(),this.evict(e)}dispose(){var t;this.disposed=true;for(const e of this.entries.values())(t=e.controller)==null||t.abort(),this.flushWaiters(e.url);this.entries.clear(),this.bytes=0}forEachReady(t){for(const e of this.entries.values())e.state==="ready"&&e.image&&t(e.url,e.image)}pump(){for(const t of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(t.url)||this.start(t)}}start(t,e){const i=new AbortController,s={url:t.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:i,pinned:!!e,waiters:e?[e]:[]};this.entries.set(t.url,s),this.inFlight++,this.attempt(s,t,i,t.url)}attempt(t,e,i,s){t.attempts++,this.options.load(s,i.signal).then(r=>{if(this.disposed||this.entries.get(t.url)!==t){ot(r);return}t.state="ready",t.image=r,t.bytes=W(r),t.controller=void 0,t.pinned=false,this.bytes+=t.bytes,this.settle(t)},r=>{if(!(i.signal.aborted||this.disposed)&&this.entries.get(t.url)===t){if(t.attempts<ce&&!de(r,e)){this.attempt(t,e,i,e.fallbackUrl??e.url);return}t.state="failed",t.controller=void 0,t.pinned=false,this.settle(t)}})}settle(t){this.inFlight--,this.flushWaiters(t.url),this.options.onSettled(),this.pump()}flushWaiters(t){const e=this.entries.get(t);if(!e)return;const i=e.waiters;e.waiters=[],i.forEach(s=>s())}evict(t){if(this.bytes<=this.budget)return;const e=[...this.entries.values()].filter(i=>i.state==="ready"&&!t.has(i.url)).sort((i,s)=>i.lastUsed-s.lastUsed);for(const i of e){if(this.bytes<=this.budget)break;this.entries.delete(i.url),this.bytes-=i.bytes,i.image&&ot(i.image),this.options.onEvict(i.url)}}}function W(n){return n.width*n.height*4}function de(n,t){if(t.fallbackUrl)return false;const e=n==null?void 0:n.status;return typeof e=="number"&&e>=400&&e<500&&e!==408&&e!==429}const ue=.1;class fe{constructor(t,e=s=>requestAnimationFrame(s),i=s=>cancelAnimationFrame(s)){h(this,"handle",0);h(this,"last",0);h(this,"disposed",false);h(this,"frame",t2=>{if(this.handle=0,this.disposed)return;const e2=this.last?Math.min((t2-this.last)/1e3,ue):1/60;this.last=t2,this.tick(e2,t2)?this.invalidate():this.last=0});this.tick=t,this.raf=e,this.caf=i}invalidate(){this.disposed||this.handle||(this.handle=this.raf(this.frame))}drawNow(){this.disposed||(this.handle&&this.caf(this.handle),this.frame(performance.now()))}dispose(){this.disposed=true,this.handle&&this.caf(this.handle),this.handle=0}}const me=2*1024*1024;function pe(n,t,e=me){const i=new Set;let s=e,r=false;return{get deferred(){return r},getTile(o){const a=n(o);if(!a||a.kind==="media"||a.opaque||i.has(o)||t(o))return a;const d=a.width*a.height*4;if(i.size>0&&d>s){r=true;return}return s-=d,i.add(o),a}}}function ge(n){const t=/^(!)?(\d+(?:\.\d+)?)$/.exec((n==null?void 0:n.trim())??"");if(!t)return null;const e=Number(t[2]);if(e>360)return null;const i=e%360,s=!!t[1];return i||s?{degrees:i,mirror:s}:null}function we(n,t,e){if(!n)return null;let i=n.trim().replace(/^xywh=/,""),s=false;i.startsWith("pct:")?(s=true,i=i.slice(4)):i.startsWith("pixel:")&&(i=i.slice(6));const r=i.split(",").map(Number);if(r.length!==4||r.some(p=>!Number.isFinite(p)))return null;let[o,a,d,l]=r;s&&(o=o/100*t,a=a/100*e,d=d/100*t,l=l/100*e);const f=Math.max(0,o),m=Math.max(0,a),c=Math.min(t,o+d),u=Math.min(e,a+l);return c<=f||u<=m?null:{x:f,y:m,width:c-f,height:u-m}}const F=512,ye=16e6;function pt(n,t,e){return{width:t,height:e,levels:[{scaleFactor:1,width:t,height:e,tileWidth:t,tileHeight:e,cols:1,rows:1}],tile:s=>({...s,url:n,region:{x:0,y:0,width:t,height:e}})}}function xe(n){const{width:t,height:e}=n,i=[],s=n.regionByPx&&n.sizeByW,r=(c,u,p)=>{const w=Math.ceil(t/c),y=Math.ceil(e/c);return{scaleFactor:c,width:w,height:y,tileWidth:u,tileHeight:p,cols:Math.ceil(w/u),rows:Math.ceil(y/p)}},o=(c,u)=>({scaleFactor:t/c,width:c,height:u,tileWidth:c,tileHeight:u,cols:1,rows:1,whole:true}),a=n.tiles[0];if(a)for(const c of a.scaleFactors)i.push(r(c,a.width,a.height));else if(s)for(let c=1;;c*=2){const u=r(c,F,F);if(i.push(u),u.cols===1&&u.rows===1)break}const d=Math.max(0,...i.map(c=>c.scaleFactor));for(const c of n.sizes){const u=t/c.width;ve(n,c.width,c.height)&&u>d+1e-9&&i.push(o(c.width,c.height))}const l=i.reduce((c,u)=>!c||u.scaleFactor>c.scaleFactor?u:c,null);if(l&&l.cols*l.rows>1&&n.sizeByW){const c=Math.max(t,e)/F;i.push(o(Math.ceil(t/c),Math.ceil(e/c)))}(!i.length||!a&&!s&&t*e<=ye)&&(i.some(c=>c.scaleFactor===1)||i.push(o(t,e)));const f=be(i).sort((c,u)=>u.scaleFactor-c.scaleFactor),m=Ft(n);return{width:t,height:e,levels:f,tile(c){const u=f[c.level],p=u.scaleFactor,w=u.cols===1&&u.rows===1;let y,v,b;if(w)y={x:0,y:0,width:t,height:e},v=u.width,b=u.height;else{const I=Math.round(c.col*u.tileWidth*p),E=Math.round(c.row*u.tileHeight*p);y={x:I,y:E,width:Math.min(Math.round(u.tileWidth*p),t-I),height:Math.min(Math.round(u.tileHeight*p),e-E)},v=Math.ceil(y.width/p),b=Math.ceil(y.height/p)}return{...c,region:y,url:tt(n,y,v,b),fallbackUrl:m?tt(n,y,v,b,m):void 0}}}}function ve(n,t,e){return!(n.maxWidth&&t>n.maxWidth||n.maxHeight&&e>n.maxHeight||n.maxArea&&t*e>n.maxArea)}function be(n){const t=new Map;for(const e of n){const i=`${e.width}x${e.height}`,s=t.get(i);(!s||s.cols*s.rows<e.cols*e.rows)&&t.set(i,e)}return[...t.values()]}function Te(n,t){const e=n.levels;for(let i=0;i<e.length;i++)if(e[i].scaleFactor<=t*(1+1e-6))return i;return e.length-1}function T(n,t,e){const i=n.levels[t],s=i.tileWidth*i.scaleFactor,r=i.tileHeight*i.scaleFactor,o=Math.max(0,e.x),a=Math.max(0,e.y),d=Math.min(n.width,e.x+e.width),l=Math.min(n.height,e.y+e.height);if(d<=o||l<=a)return[];const f=Math.max(0,Math.floor(o/s)),m=Math.min(i.cols-1,Math.floor((d-1e-9)/s)),c=Math.max(0,Math.floor(a/r)),u=Math.min(i.rows-1,Math.floor((l-1e-9)/r)),p=[];for(let w=c;w<=u;w++)for(let y=f;y<=m;y++)p.push({level:t,col:y,row:w});return p}async function Ee(n,t){if(n.media)return Me(n,n.media);let e=null,i=null;if(n.service)try{e=xe(await Dt(n.service,t.infoOptions))}catch(c){i=c}if(!e){if(!n.url)throw i??new Error("Image has no source");const c=await t.loadStatic(n.url);t.cache.seed(n.url,c),e=pt(n.url,c.naturalWidth,c.naturalHeight)}const s=n.width&&n.height&&n.width>0&&n.height>0?{width:n.width,height:n.height}:{width:e.width,height:e.height},r=we(n.region,s.width,s.height)??{x:0,y:0,width:s.width,height:s.height},o=e.width/s.width,a=e.height/s.height,d={x:r.x*o,y:r.y*a,width:r.width*o,height:r.height*a},l=ge(n.rotation),f=l?ke(d,l):void 0,m={id:n.id,spec:n,pyramid:e,size:s,clip:d,contentClip:r,rect:{x:0,y:0,width:r.width,height:r.height},...f?{turn:f}:{}};return await t.cache.prefetch(T(e,0,d).map(c=>{const u=e.tile(c);return{url:u.url,fallbackUrl:u.fallbackUrl}})),m}const gt="media:";function Me(n,t){var a,d;const e=n.width||((a=n.placement)==null?void 0:a.width)||t.element.videoWidth||1600,i=n.height||((d=n.placement)==null?void 0:d.height)||t.element.videoHeight||900,s=`${gt}${n.id}`,r={width:e,height:i},o={x:0,y:0,width:e,height:i};return{id:n.id,spec:n,pyramid:pt(s,e,i),media:{kind:"media",source:t.element,width:e,height:i,naturalWidth:e,naturalHeight:i},size:r,clip:o,contentClip:o,rect:{...o}}}function ke(n,{degrees:t,mirror:e}){const i=t*Math.PI/180,s=f=>Math.abs(f)<1e-12?0:f,r=s(Math.cos(i)),o=s(Math.sin(i)),a=Math.abs(n.width*r)+Math.abs(n.height*o),d=Math.abs(n.width*o)+Math.abs(n.height*r),l=k(L(a/2,d/2),{a:r,b:o,c:-o,d:r,e:0,f:0},_(e?-1:1,1),L(-(n.x+n.width/2),-(n.y+n.height/2)));return{orient:l,unorient:kt(l),width:a,height:d}}function wt(n){var t;return((t=n.turn)==null?void 0:t.orient)??L(-n.clip.x,-n.clip.y)}function _e(n,t){const{turn:e,clip:i}=n;if(!e)return{...t,x:i.x+t.x,y:i.y+t.y};const s=ft(e.unorient,t),r=Math.max(s.x,i.x),o=Math.max(s.y,i.y);return{x:r,y:o,width:Math.max(0,Math.min(s.x+s.width,i.x+i.width)-r),height:Math.max(0,Math.min(s.y+s.height,i.y+i.height)-o)}}function Le(n,t){const{turn:e,clip:i}=n;return e?ut(e.unorient,t):{x:i.x+t.x,y:i.y+t.y}}function at(n){const{turn:t,clip:e,contentClip:i}=n;return t?{width:t.width*i.width/e.width,height:t.height*i.height/e.height}:i}function Pe(n){if(!n.length)return null;if(n.every(i=>i.spec.placement)){for(const i of n)i.rect={...i.spec.placement};return dt(n.map(i=>i.rect))}const t=at(n[0]).height;let e=0;for(const i of n){const s=at(i),r=s.width*t/s.height;i.rect={x:e,y:0,width:r,height:t},e+=r}return{x:0,y:0,width:e,height:t}}function B(n){const t=n.turn??n.clip;return{x:n.rect.width/t.width,y:n.rect.height/t.height}}function Ie(n){const t=B(n);return k(L(n.rect.x,n.rect.y),_(t.x,t.y),wt(n))}function Ae(n,t){var e,i;return n.service===t.service&&n.url===t.url&&n.width===t.width&&n.height===t.height&&n.region===t.region&&n.rotation===t.rotation&&((e=n.media)==null?void 0:e.element)===((i=t.media)==null?void 0:i.element)&&JSON.stringify(n.placement)===JSON.stringify(t.placement)}const Se=1e7,Re=15e6,Be=2e7,Oe=2;function Ce(n){const{items:t,camera:e,viewport:i,pixelRatio:s,getTile:r,destination:o}=n,a=It(e,i),d=[],l=[],f=[],m=(c,u,p)=>{const w=c.tile(u);l.push({url:w.url,fallbackUrl:w.fallbackUrl,priority:p})};for(const c of t){const{pyramid:u,clip:p,rect:w}=c,y=B(c);if(n.wantOverview)for(const g of T(u,0,p))m(u,g,Be);const v=ht(c,e,i,s),b=o?ht(c,o,i,s):v;if(f.push((v==null?void 0:v.target)??-1),!v&&!b)continue;const I=g=>x=>{const P=u.tile(x).region;return Math.hypot(P.x+P.width/2-g.x,P.y+P.height/2-g.y)};if(b){const g=I(b.center);for(const x of T(u,0,b.area))m(u,x,g(x)/1e3);if(b.target>0)for(const x of T(u,b.target,b.area))m(u,x,Se+g(x))}if(!v)continue;const{area:E,target:M}=v,Z=I(v.center),O=T(u,0,E),K=M===0?[]:T(u,M,E);if(b!==v){for(const x of O)m(u,x,Z(x)/1e3);const g=M-Oe;if(g>0)for(const x of T(u,g,E))m(u,x,Re+Z(x))}if(c.spec.hidden)continue;const yt=(M===0?O:K).every(g=>r(u.tile(g).url)!==void 0)?[M]:Array.from({length:M+1},(g,x)=>x),xt=k(a,L(w.x,w.y),_(y.x,y.y),wt(c));for(const g of yt){const x=g===0?O:g===M?K:T(u,g,E),P=u.levels[g].cols*u.levels[g].rows>1;for(const vt of x){const C=u.tile(vt),V=r(C.url);if(!V)continue;const q=Ue(c,C.region,V,xt,P);q&&d.push({...q,url:C.url})}}}return l.sort((c,u)=>c.priority-u.priority),{draws:d,wants:ze(l),levels:f}}function ht(n,t,e,i){const{pyramid:s,rect:r}=n,o=N(t,e);if(!_t(o,r))return null;const a=B(n),d=Math.max(o.x,r.x),l=Math.max(o.y,r.y),f=Math.min(o.x+o.width,r.x+r.width),m=Math.min(o.y+o.height,r.y+r.height),c=1/(a.x*t.zoom*i);return{area:_e(n,{x:(d-r.x)/a.x,y:(l-r.y)/a.y,width:(f-d)/a.x,height:(m-l)/a.y}),center:Le(n,{x:(t.x-r.x)/a.x,y:(t.y-r.y)/a.y}),target:Te(s,c)}}function Ue(n,t,e,i,s){const{clip:r}=n,o=Math.max(t.x,r.x),a=Math.max(t.y,r.y),d=Math.min(t.x+t.width,r.x+r.width),l=Math.min(t.y+t.height,r.y+r.height);if(d<=o||l<=a)return null;const f=e.width/t.width,m=e.height/t.height,c=1e-6;return{item:n,image:e,transform:k(i,L(t.x,t.y),_(1/f,1/m)),crop:{x:(o-t.x)*f,y:(a-t.y)*m,width:(d-o)*f,height:(l-a)*m},bleed:{right:s&&d<r.x+r.width-c,bottom:s&&l<r.y+r.height-c}}}function ze(n){const t=new Set;return n.filter(e=>t.has(e.url)?false:(t.add(e.url),true))}const We={maxZoomPixelRatio:1.1,minZoomImageRatio:.9,animationTime:.09,request:void 0,byteBudget:192*1024*1024,maxInFlight:6,releaseAfterMs:2e3},Fe=2,De=3,Ne=.1,He=1e-6,X={top:0,right:0,bottom:0,left:0};function ct(n,t="padding"){if(!n||typeof getComputedStyle!="function")return X;const e=getComputedStyle(n),i=s=>parseFloat(e.getPropertyValue(`${t}-${s}`))||0;return{top:i("top"),right:i("right"),bottom:i("bottom"),left:i("left")}}const Ge=(n,t)=>n.top===t.top&&n.right===t.right&&n.bottom===t.bottom&&n.left===t.left;let Xe;class Ze{constructor(t,e={}){h(this,"host");h(this,"overlays",null);h(this,"options");h(this,"backend",null);h(this,"backendPreference");h(this,"contextLosses",0);h(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});h(this,"visible",true);h(this,"dom",null);h(this,"domAsked",false);h(this,"pending",null);h(this,"camera");h(this,"loop");h(this,"gestures");h(this,"gestureOptions",{});h(this,"cache");h(this,"navigator",null);h(this,"navigatorAsked",0);h(this,"viewport",{width:1,height:1});h(this,"inset",X);h(this,"pixelRatio",1);h(this,"items",[]);h(this,"worldBounds",null);h(this,"contentVersion",0);h(this,"opaqueUrls",new Set);h(this,"mediaByKey",new Map);h(this,"detachMedia",[]);h(this,"opened",false);h(this,"atHome",true);h(this,"lastEmitted",null);h(this,"generation",0);h(this,"listeners",new Map);h(this,"unloadable",false);h(this,"resizeObserver",null);h(this,"intersectionObserver",null);h(this,"releaseTimer",null);h(this,"dprQuery",null);h(this,"disposed",false);h(this,"dismisser",null);h(this,"tick",t2=>{var d,l;if(this.disposed)return false;const e2=this.camera.step(t2,this.viewport),i=this.camera.current,s=this.backend,r=pe(this.getTile,f=>s?s.has(f):true),o=Ce({items:this.items,camera:i,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:r.getTile,wantOverview:!!this.navigator,destination:e2?this.camera.destination:void 0}),a=o.wants.filter(f=>!f.url.startsWith(gt));return this.cache.update(a),o.draws.length?this.setUnloadable(false):a.length&&a.every(f=>this.cache.failed(f.url))&&this.setUnloadable(true),this.paint(o.draws),(d=this.overlays)==null||d.position(i,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(f=>!f.spec.hidden),this.worldBounds,N(i,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!Rt(this.lastEmitted,i))&&(this.lastEmitted={...i},this.opened&&this.emit("viewport")),e2||r.deferred});h(this,"getTile",t2=>this.mediaByKey.get(t2)??this.cache.get(t2));h(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});h(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=t,this.backendPreference=e.backend??"auto",this.options={...We,...D(e)},Ve()&&(this.options.animationTime=0),this.camera=new $t({x:0,y:0,zoom:1,rotation:0},this.options.animationTime),this.loop=new fe(this.tick),this.gestureOptions=D(e.gestures??{}),this.gestures=new ee(t,this,{...H,...this.gestureOptions}),this.cache=new le({load:(i,s)=>this.loadTile(i,s),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:i=>{var s;return(s=this.backend)==null?void 0:s.release(i)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=Ke(t),this.visible?this.acquireBackend():this.holder.hiddenSince=lt(),this.measure(),this.observe()}get backendKind(){var t;return((t=this.backend)==null?void 0:t.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>i==null?void 0:i.delete(e)}async setImages(t,{world:e,fit:i=false}={}){const s=++this.generation,r=new Map(this.items.map(f=>[f.id,f])),o=await Promise.allSettled(t.map(f=>{const m=r.get(f.id);return m&&Ae(m.spec,f)?(m.spec=f,Promise.resolve(m)):Ee(f,{cache:this.cache,loadStatic:c=>this.loadTile(c),infoOptions:{request:this.options.request}})}));if(s!==this.generation||this.disposed)return;const a=o.filter(f=>f.status==="fulfilled").map(f=>f.value),d=o.filter(f=>f.status==="rejected").map(f=>f.reason);this.items=a,this.watchMedia(a);const l=Pe(a);if(this.worldBounds=e?l?dt([e,l]):e:l,this.contentVersion++,d.length&&this.emit("error",d),this.setUnloadable(t.length>0&&!a.length&&d.length>0),!this.worldBounds){this.invalidate();return}this.opened?i?(this.home(true),this.emit("change")):(this.camera.set(this.constrain(this.camera.current)),this.emit("change")):(this.opened=true,this.home(true),this.emit("open")),this.invalidate()}clear(){this.setUnloadable(false),this.generation++,this.items=[],this.watchMedia([]),this.worldBounds=null,this.contentVersion++,this.invalidate()}setHidden(t){const e=new Set(t);let i=false;for(const s of this.items){const r=e.has(s.id);!!s.spec.hidden!==r&&(s.spec={...s.spec,hidden:r},i=true)}i&&this.invalidate()}isReady(t){const e=this.items.find(s=>s.id===t);if(!e)return false;if(e.spec.media)return true;const i=e.pyramid.levels[0];if(!i)return false;for(let s=0;s<i.rows;s++)for(let r=0;r<i.cols;r++)if(!this.getTile(e.pyramid.tile({level:0,col:r,row:s}).url))return false;return true}fitBounds(t,e=false,i=X){const s=this.fit(t,this.camera.destination.rotation,i);this.atHome=false,this.animateTo(this.constrain(s,{allowBeyondLimits:true}),e)}fit(t,e,{top:i,right:s,bottom:r,left:o}){const{width:a,height:d}=this.viewport,{zoom:l}=At(t,{width:Math.max(1,a-o-s),height:Math.max(1,d-i-r)},e);return{...S(Lt(t),{x:(a+o-s)/2,y:(d+i-r)/2},l,e,this.viewport),zoom:l,rotation:e}}fitItemRect(t,e,i=false){const s=this.itemRectToWorld(t,e);s&&this.fitAnnotation(s,i)}fitAnnotation(t,e=false){var r;const i=this.items[0];if(!i)return;const s=i.rect.width*Ne;this.fitBounds({x:t.x-s,y:t.y-s,width:t.width+s*2,height:t.height+s*2},e,ct((r=this.overlays)==null?void 0:r.container,"scroll-padding"))}getBounds(){return N(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var i;const t=((i=this.homeCamera())==null?void 0:i.zoom)??1,e=this.items.length?Math.min(...this.items.map(s=>B(s).x)):1;return{home:t,min:t*this.options.minZoomImageRatio,max:Math.max(t,this.options.maxZoomPixelRatio/e)}}home(t=false){const e=this.homeCamera();e&&(this.atHome=true,this.animateTo(e,t))}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-He)}zoomBy(t,e,i=true){const s=i?this.camera.destination:this.camera.current,r=e??{x:this.viewport.width/2,y:this.viewport.height/2},o=$(s,this.viewport,r),{min:a,max:d}=this.getZoomLimits(),l=A(s.zoom*t,a,d),f=S(o,r,l,s.rotation,this.viewport),m=this.constrain({...s,...f,zoom:l});this.atHome=false,i?this.camera.animateTo({state:m,anchor:{world:o,screen:r}},this.viewport):this.camera.set(m),this.invalidate()}panBy(t,e,i=false){const s=i?this.camera.destination:this.camera.current,r=ut(k(_(1/s.zoom),Pt(-s.rotation)),{x:t,y:e}),o=this.constrain({...s,x:s.x-r.x,y:s.y-r.y});this.atHome=false,i?this.camera.animateTo({state:o},this.viewport):this.camera.set(o),this.invalidate()}panTo(t,e=false){const i=e?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...i,...t}),e)}flick(t,e){this.panBy(t*.25,e*.25,true)}rotateBy(t){const e=this.camera.destination;this.setRotation(e.rotation*180/Math.PI+t)}setRotation(t,e=false){const i=this.camera.destination,s=t*Math.PI/180;this.animateTo(this.constrain({...i,rotation:s}),e)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(t){this.emit("tap",t)}setDismiss(t){this.dismisser=t}dismiss(){var t;return((t=this.dismisser)==null?void 0:t.call(this))??false}setGestures(t){this.gestures.setOptions({...H,...this.gestureOptions,...D(t)})}setInteracting(t){t&&this.camera.stop()}worldToScreenPoint(t){return St(this.camera.current,this.viewport,t)}screenToWorldPoint(t){return $(this.camera.current,this.viewport,t)}itemRectToWorld(t,e){const i=this.items[t];if(!i)return null;const{contentClip:s,clip:r}=i;if(i.turn)return ft(k(Ie(i),_(r.width/s.width,r.height/s.height)),e);const o=i.rect.width/s.width,a=i.rect.height/s.height;return{x:i.rect.x+(e.x-s.x)*o,y:i.rect.y+(e.y-s.y)*a,width:e.width*o,height:e.height*a}}attachNavigator(t){var r;(r=this.navigator)==null||r.dispose(),this.navigator=null;const e=++this.navigatorAsked;let i=null,s=false;return import("./Navigator-DrYPepzN.mjs").then(o=>{s||this.disposed||e!==this.navigatorAsked||(i=new o.Navigator(t,(a,d)=>this.panTo(a,d)),this.navigator=i,this.invalidate())}),()=>{s=true,i==null||i.dispose(),i&&this.navigator===i&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var t,e,i,s,r,o,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(t=this.resizeObserver)==null||t.disconnect(),(e=this.intersectionObserver)==null||e.disconnect(),(s=(i=this.dprQuery)==null?void 0:i.removeEventListener)==null||s.call(i,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(r=this.navigator)==null||r.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(o=this.dom)==null||o.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(d=>d()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}watchMedia(t){this.detachMedia.forEach(e=>e()),this.detachMedia=[],this.mediaByKey.clear();for(const e of t){if(!e.media||e.media.kind!=="media")continue;const i=e.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(i,e.media);const s=e.media.source,r=()=>this.invalidate(),o=["play","seeked","loadeddata","resize"];o.forEach(a=>s.addEventListener(a,r)),this.detachMedia.push(()=>o.forEach(a=>s.removeEventListener(a,r)))}}paint(t){const e=this.backend,i=[],s=(e==null?void 0:e.kind)==="webgl2";e==null||e.begin();for(const r of t){const{image:o}=r;if(!(o.kind==="media"||o.kind==="element"&&s&&(o.opaque||this.opaqueUrls.has(r.url)))&&e){if(e.draw({key:r.url,source:o.source,width:o.width,height:o.height,transform:r.transform,crop:r.crop,opacity:1,bleed:r.bleed})!=="tainted"||o.kind==="bitmap")continue;this.opaqueUrls.add(r.url)}(o.kind==="element"||o.kind==="media")&&i.push({key:`${r.item.id}|${r.url}`,element:o.source,width:o.width,height:o.height,transform:r.transform,crop:r.crop,opacity:1})}e==null||e.end(),this.dom?this.dom.sync(i):i.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-DlRapZ1u.mjs").then(({DomLayers:r})=>{if(this.disposed)return;const o=new r(this.host);this.overlays&&this.host.insertBefore(o.container,this.overlays.container),this.dom=o,this.invalidate()}))}loadTile(t,e){return se(t,{signal:e,request:this.options.request,maxTextureSize:this.backend instanceof R?this.backend.maxTextureSize:void 0})}animateTo(t,e){this.camera.animateTo({state:t},this.viewport,e),this.invalidate()}homeCamera(){if(!this.worldBounds)return null;const t=2*Math.PI,e=Math.round(this.camera.destination.rotation/t)*t||0;return this.fit(this.worldBounds,e,this.inset)}constrain(t,{allowBeyondLimits:e=false}={}){const i=this.worldBounds;if(!i)return t;const{min:s,max:r}=this.getZoomLimits(),o=e?A(t.zoom,s,Math.max(r,t.zoom)):A(t.zoom,s,r);return{...t,zoom:o,x:A(t.x,i.x,i.x+i.width),y:A(t.y,i.y,i.y+i.height)}}acquireBackend(t=true){var r,o;if(this.backend||this.pending||this.disposed)return;const e=document.createElement("canvas");e.className="clover-canvas-surface",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(e,((r=this.dom)==null?void 0:r.container)??((o=this.overlays)==null?void 0:o.container)??null);const i=t&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<De);let s=null;i&&(Et(this.holder)||this.backendPreference==="webgl2")&&(s=R.create(e,{onLost:this.onContextLost}),s||Y(this.holder)),s?this.install(s):this.backendPreference==="webgl2"?this.none(e):(this.pending=e,(Xe??(Xe=import("./Canvas2DBackend-TZtR3zHf.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==e)return;this.pending=null;const d=a.create(e);d?this.install(d):this.none(e)}))}none(t){t.remove(),this.host.dataset.backend="none"}install(t){this.backend=t,this.host.dataset.backend=t.kind,t.resize(this.viewport.width,this.viewport.height,this.pixelRatio),t.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",t.kind),this.invalidate()}releaseBackend(){var e;if(Y(this.holder),(e=this.pending)==null||e.remove(),this.pending=null,!this.backend)return;const t=this.backend.canvas;this.backend.dispose(),t.remove(),this.backend=null}giveBack(){this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.releaseBackend(),this.host.dataset.backend="released"}observe(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>this.measure(true)),this.resizeObserver.observe(this.host)),typeof IntersectionObserver<"u"&&(this.intersectionObserver=new IntersectionObserver(t=>{const e=t.some(i=>i.isIntersecting);this.setVisible(e)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(t){var e;if(this.visible=t,t){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(e=this.holder).hiddenSince??(e.hiddenSince=lt()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(t=false){var d;const e=this.host.getBoundingClientRect(),i=Math.max(1,e.width),s=Math.max(1,e.height),r=ct(this.host),o=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Fe);if(i===this.viewport.width&&s===this.viewport.height&&o===this.pixelRatio&&Ge(r,this.inset))return;const a=this.viewport;if(this.viewport={width:i,height:s},this.inset=r,this.pixelRatio=o,(d=this.backend)==null||d.resize(i,s,o),this.opened)if(this.atHome)this.home(true);else{const l=this.camera.current,f=i/Math.max(a.width,1);this.camera.set(this.constrain({...l,zoom:l.zoom*f}))}t?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var t,e,i,s;typeof window>"u"||typeof window.matchMedia!="function"||((e=(t=this.dprQuery)==null?void 0:t.removeEventListener)==null||e.call(t,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(s=(i=this.dprQuery).addEventListener)==null||s.call(i,"change",this.onPixelRatioChange))}setUnloadable(t){t!==this.unloadable&&(this.unloadable=t,this.emit("unloadable",t))}emit(t,e){var i;(i=this.listeners.get(t))==null||i.forEach(s=>s(e))}}const lt=()=>typeof performance<"u"?performance.now():Date.now();function Ke(n){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:t,left:e,width:i,height:s}=n.getBoundingClientRect();return t+s>=0&&e+i>=0&&t<=window.innerHeight&&e<=window.innerWidth}function Ve(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function D(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}const si=(n,t)=>new Ze(n,t);export{Ht as b,Nt as h,Ce as p,si as r};
@@ -1 +1 @@
1
- import{u as c,A as l,x as u,ay as p,_ as d,k as m}from"./shared-MTsMddHx.mjs";import"./styles-CZV1nbBQ.mjs";const f=new WeakMap;function v(t){let n=f.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:r=>c(y,{...r,render:o})},f.set(t,n)}return n}function b(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(v)}function y({render:t,canvases:n,bodies:o,children:r}){const a=l(null),i=u(p);return d(()=>{const e=a.current;if(!e)return;const s=t(e,{canvases:n,bodies:o,clover:i});return()=>{typeof s=="function"&&s(),e.replaceChildren()}},[t,n,o,i]),c(m,{children:[c("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),r&&c("div",{className:"clover-canvas-controls",children:r})]})}export{b as toRenderers};
1
+ import{u as c,A as l,x as u,aC as p,_ as d,k as m}from"./shared-DFAX0n3B.mjs";import"./styles-BwkYiCLC.mjs";const f=new WeakMap;function v(t){let n=f.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:r=>c(y,{...r,render:o})},f.set(t,n)}return n}function C(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(v)}function y({render:t,canvases:n,bodies:o,children:r}){const a=l(null),i=u(p);return d(()=>{const e=a.current;if(!e)return;const s=t(e,{canvases:n,bodies:o,clover:i});return()=>{typeof s=="function"&&s(),e.replaceChildren()}},[t,n,o,i]),c(m,{children:[c("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),r&&c("div",{className:"clover-canvas-controls",children:r})]})}export{C as toRenderers};
@@ -1 +1 @@
1
- import{x as n,X as o,Q as r}from"./shared-MTsMddHx.mjs";const t=(s,a)=>a==="canvas"?o(s.manifest,s.canvasId):s.manifest,e=r(null),i=()=>n(e);export{e as P,t as r,i as u};
1
+ import{x as n,Z as o,Q as r}from"./shared-DFAX0n3B.mjs";const t=(s,a)=>a==="canvas"?o(s.manifest,s.canvasId):s.manifest,e=r(null),i=()=>n(e);export{e as P,t as r,i as u};
@@ -1 +1 @@
1
- import{a0 as a}from"./shared-MTsMddHx.mjs";function c(t){try{const o=new URL(t).pathname.split("/").filter(Boolean).pop();return o?decodeURIComponent(o):"download"}catch{return"download"}}async function i(t,o){try{const r=await a(o,t,{referrerPolicy:"no-referrer"});if(!r.ok)return false;const n=URL.createObjectURL(await r.blob()),e=document.createElement("a");return e.href=n,e.download=c(t),document.body.append(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4),true}catch{return false}}export{c as fileName,i as saveFile};
1
+ import{a1 as a}from"./shared-DFAX0n3B.mjs";function c(t){try{const o=new URL(t).pathname.split("/").filter(Boolean).pop();return o?decodeURIComponent(o):"download"}catch{return"download"}}async function i(t,o){try{const r=await a(o,t,{referrerPolicy:"no-referrer"});if(!r.ok)return false;const n=URL.createObjectURL(await r.blob()),e=document.createElement("a");return e.href=n,e.download=c(t),document.body.append(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4),true}catch{return false}}export{c as fileName,i as saveFile};
@@ -0,0 +1 @@
1
+ import{ay as w,S as f,a9 as x,U as S}from"./shared-DFAX0n3B.mjs";const A=10;async function R(r,t,s,o,e){var n,d;const i=(n=r.get().manifest)==null?void 0:n.id;try{const{hits:c,set:u}=await b(t,s,{request:o,signal:e});if(e.aborted||((d=r.get().manifest)==null?void 0:d.id)!==i)return;r.set({search:{query:s,status:"ready",hits:c,set:u}})}catch{if(e.aborted)return;r.set({search:{query:s,status:"error",hits:[],set:null}})}}async function b(r,t,{request:s,signal:o}={}){const e=new URL(r.id);e.searchParams.set("q",t);const i=[];let n=e.toString();const d=new Set;for(;n&&i.length<A&&!d.has(n);){d.add(n);const c=await w(s,n,o);i.push(c),n=$(c)}return E(i,t)}function T(r){var e;const t=f(r)[0];if(typeof t=="string"||!t)return t;const s=t.full??t["@id"],o=(e=f(t.selector)[0])==null?void 0:e.value;return typeof o=="string"&&typeof s=="string"?`${s}#${o}`:s}function $(r){var o;const t=r.next??((o=r.within)==null?void 0:o.next),s=typeof t=="string"?t:(t==null?void 0:t.id)??(t==null?void 0:t["@id"]);return typeof s=="string"?s:null}function E(r,t){var e,i;const s=[],o=[];for(const n of r){const d=Array.isArray(n.resources),c=d?n.resources:f(n.items),u=new Map;for(const a of c){const p=a.id??a["@id"],m=d?T(a.on):f(a.target)[0],v=x(m);if(!p||!v.id)continue;const y=d?(e=a.resource)==null?void 0:e.chars:f(a.body).map(l=>l==null?void 0:l.value).find(l=>typeof l=="string"),I={id:p,setId:S,canvasId:v.id,target:v,motivation:["highlighting"],bodies:[{value:String(y??t)}],annotation:{id:p,type:"Annotation",motivation:["highlighting"],body:{type:"TextualBody",value:String(y??t)},target:m}};u.set(p,I),s.push(I)}const g=d?H(n,u):M(n,u),h=new Set(g.flatMap(a=>a.entryIds));o.push(...g);for(const a of u.values())h.has(a.id)||o.push({id:a.id,canvasId:a.canvasId,entryIds:[a.id],match:((i=a.bodies[0])==null?void 0:i.value)??t})}return{query:t,hits:o,set:{id:S,label:{none:[t]},source:"search",entries:s}}}function H(r,t){var o;const s=[];for(const e of f(r.hits)){const i=f(e.annotations).filter(n=>t.has(n));i.length&&s.push({id:i.join(" "),canvasId:t.get(i[0]).canvasId,entryIds:i,before:e.before,match:String(e.match??((o=t.get(i[0]).bodies[0])==null?void 0:o.value)??""),after:e.after})}return s}function M(r,t){var o,e;const s=[];for(const i of f(r.annotations))for(const n of f(i==null?void 0:i.items))if(f(n==null?void 0:n.motivation).includes("contextualizing"))for(const c of f(n.target)){const u=typeof(c==null?void 0:c.source)=="string"?c.source:(o=c==null?void 0:c.source)==null?void 0:o.id,g=u?t.get(u):void 0;if(!g)continue;const h=f(c.selector).find(a=>(a==null?void 0:a.type)==="TextQuoteSelector");s.push({id:`${n.id??u}#${u}`,canvasId:g.canvasId,entryIds:[g.id],before:h==null?void 0:h.prefix,match:String((h==null?void 0:h.exact)??((e=g.bodies[0])==null?void 0:e.value)??""),after:h==null?void 0:h.suffix})}return s}export{E as readResults,b as search,R as searchInto};
@@ -0,0 +1 @@
1
+ var zo=Object.defineProperty;var qo=(e,t,n)=>t in e?zo(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var oe=(e,t,n)=>qo(e,typeof t!="symbol"?t+"":t,n);import{a as Ce}from"./index-DspT4wUm.mjs";const Jo=JSON.parse('{"commonClose":"Close","commonNext":"Next","commonPrevious":"Previous","commonSearch":"Search","commonViewAll":"View all","controlShortcut":"{{label}} ({{shortcut}})","contentSearchLoading":"Loading...","contentSearchPlaceholder":"Search","contentSearchResultsNone":"No results","contentSearchResult":"1 result","contentSearchResults":"{{count}} results","contentSearchError":"The search could not be completed.","contentSearchPosition":"Result {{index}} of {{total}}","contentSearchClear":"Clear search","canvasPosition":"Item {{index}} of {{total}}","canvasImage":"Image","bodyUnloadableImage":"This image could not be loaded.","bodyUnloadableVideo":"This video could not be loaded.","bodyUnloadableAudio":"This audio could not be loaded.","bodyUnloadableModel":"This model could not be loaded.","canvasRoleDescription":"zoomable image","canvasKeysImage":"Use the arrow keys to pan, with Shift for larger steps, plus and minus to zoom, 0 to reset the view, and R or Shift+R to rotate.","canvasKeysMedia":"Press Space or K to play or pause, J or L to skip ten seconds back or forward, and M to mute or unmute.","canvasKeysAnnotations":"Press Escape to clear the selected annotation.","sceneModel":"3D model","sceneRoleDescription":"rotatable 3D model","sceneKeys":"Use the arrow keys to rotate the model, with Shift for larger steps, plus and minus to zoom, 0 to reset the view, and R or Shift+R to rotate it right or left.","sceneRotateUp":"Rotate up","sceneRotateDown":"Rotate down","sceneRotate":"Rotate","sceneResetView":"Reset view","statusLoading":"Loading\u2026","statusError":"This could not be loaded.","itemsLabel":"Items","download":"Download","downloadPage":"This page","downloadAll":"All pages","templateSidebar":"Items","templateSidebarToggle":"Show items","templateBack":"Back","templateBackTo":"Back to {{label}}","collectionLabel":"Collection","itemsScrollBack":"Show previous items","itemsScrollForward":"Show more items","aboutRights":"Rights","aboutDate":"Date","aboutHomepage":"Homepage","aboutSeeAlso":"See also","aboutProvider":"Provider","logo":"Logo","aboutManifest":"IIIF Manifest","aboutCanvas":"IIIF Canvas","aboutPartOf":"Part of","aboutOpenManifest":"Open the full Manifest","aboutCollection":"IIIF Collection","readingLanguage":"Language","annotationsHide":"Hide annotations","annotationsHideTip":"Hide","readMore":"Read more","readLess":"Read less","annotationsShow":"Find on the image","annotationsShowTime":"Find in the recording","annotationsImage":"Image","annotationsLanguage":"Language","annotationsOpenLink":"Open the link","transcriptLabel":"Transcript","imageViewerOpen":"Open image viewer","imageViewerClose":"Close image viewer","canvasChoice":"Choice","canvasViewerControls":"Viewer controls","canvasExpandControls":"Expand viewer controls","canvasCollapseControls":"Collapse viewer controls","canvasScrollBack":"Show previous controls","canvasScrollForward":"Show more controls","imageFullScreen":"Full screen","imageExitFullScreen":"Exit full screen","imageResetZoom":"Reset zoom","imageRotateLeft":"Rotate left","imageRotateRight":"Rotate right","imageZoomIn":"Zoom in","imageZoomOut":"Zoom out","informationPanelTabs":"Information panel","sectionsScrollBack":"Show previous tabs","sectionsScrollForward":"Show more tabs","informationPanelClose":"Close information panel","informationPanelTabsAbout":"About","informationPanelTabsAnnotations":"Annotations","informationPanelTabsSearch":"Search","informationPanelTabsContents":"Contents","contentsSectionsIn":"Sections in","informationPanelTabsMap":"Map","informationPanelTabsCollection":"Collection","informationPanelTabsTargets":"Views","mapUnavailable":"The map could not be shown.","mapLabel":"Map","mapAttribution":"Map credits","mapPlaceUntitled":"Place {{number}}","mapOverlay":"Georeferenced image","mapPlacesListed":"Places listed after the map: {{count}}","informationPanelToggle":"More information","playerPlay":"Play","playerPause":"Pause","playerMute":"Mute","playerUnmute":"Unmute","playerVolume":"Volume","playerSeek":"Seek","playerCaptions":"Captions","playerCaptionsOff":"Off","playerChapters":"Chapters","playerFill":"Fill frame","playerFit":"Fit to frame","frameRepeat":"Repeat","playerCurrentTime":"Current time","playerDuration":"Duration","splitHandle":"Resize panels"}'),Hn={es:()=>import("./es-B1NvdYp-.mjs"),fi:()=>import("./fi-BjtYZNLo.mjs"),fr:()=>import("./fr-Cd22Lziw.mjs"),nb:()=>import("./nb-CEwZDBiR.mjs"),nn:()=>import("./nn-jYQhr9RI.mjs"),no:()=>import("./no-CEwZDBiR.mjs"),pt:()=>import("./pt-CWR30SzS.mjs")};function Dn(){const e=[];return typeof document<"u"&&e.push(document.documentElement.lang),typeof navigator<"u"&&e.push(...navigator.languages??[],navigator.language),e.filter(Boolean)}const Ge=e=>e.split("-")[0];function Ko(e,t){return Ge(e).toLowerCase()===Ge(t).toLowerCase()}const ot=e=>e.includes("-")?Ge(e):null;function Go(e,t,n=[]){if(!t.length)return;if(t.length===1)return t[0];const o=()=>t.includes("none")?"none":t.includes("@none")?"@none":t[0];if(!e)return t.includes("none")?"none":t[0];if(t.includes(e))return e;const r=ot(e);if(r&&t.includes(r))return r;const s=n.find(a=>t.includes(a));if(s)return s;const i=t.findIndex(a=>ot(a)===e);if(i!==-1)return t[i];for(const a of n){const c=ot(a);if(c&&t.includes(c))return c}return o()}function Zo(e,t){const[n,...o]=t?[t]:Dn();return Go(n,e,o)??e[0]}const K="clover",J={en:{[K]:{...Jo}}};let ye,jn=[],Ze=0;const ft=new Set;function Ct(){Ze++,ft.forEach(e=>e())}function Yo(e){const t=Ge(e);return t&&t!==e?[e,t]:[e]}const Vt=new Map,Xo=e=>Object.prototype.hasOwnProperty.call(Hn,e);function Qo(e){let t=Vt.get(e);return t||(t=Hn[e]().then(({default:n})=>{var o;J[e]={...J[e],[K]:{...n,...(o=J[e])==null?void 0:o[K]}},Ct()},()=>{}),Vt.set(e,t)),t}function Bn(e){const t=e.find(n=>n==="en"||Xo(n));return t&&t!=="en"?Qo(t):Promise.resolve()}let Be=[],zt="";function Pe(){const e=ye?`${Ze}`:`${Ze} ${typeof document<"u"?document.documentElement.lang:""} ${typeof navigator<"u"?navigator.languages:""}`;if(e===zt)return Be;zt=e;const t=ye?[ye]:Dn();return Be=[...new Set([...t,...jn].flatMap(Yo).concat("en"))],Bn(Be),Be}function Wn(e,t){if(e)return Ko(e,t||j.resolvedLanguage)?void 0:e}const j={get language(){return ye??Pe().find(e=>J[e])??"en"},get resolvedLanguage(){return Pe().find(e=>{var t;return Object.keys(((t=J[e])==null?void 0:t[K])??{}).length>0})??"en"},changeLanguage(e){ye=e,Ct()},resolve(e,t,n=K){var r,s;let o={text:e};for(const i of Pe()){const a=(s=(r=J[i])==null?void 0:r[n])==null?void 0:s[e];if(a!==void 0){o={text:a,lang:i};break}}return t?{...o,text:o.text.replace(/\{\{(\w+)\}\}/g,(i,a)=>a in t?String(t[a]):i)}:o},t(e,t,n=K){return j.resolve(e,t,n).text},langOf(e,t,n=K){return Wn(j.resolve(e,void 0,n).lang,t)},ready(){return Bn(Pe())},subscribe(e){return ft.add(e),()=>{ft.delete(e)}},getSnapshot(){return Ze}};typeof document<"u"&&Pe();function er(e={}){for(const[t,n]of Object.entries(e.resources??{}))for(const[o,r]of Object.entries(n??{}))J[t]??(J[t]={}),J[t][o]={...J[t][o],...r};return e.fallbackLng!==void 0&&(jn=e.fallbackLng===false?[]:[e.fallbackLng].flat()),e.lng&&(ye=e.lng),Ct(),j}const gi=Object.freeze(Object.defineProperty({__proto__:null,CLOVER_I18N_NAMESPACE:K,cloverI18n:j,initCloverI18n:er,langWithin:Wn},Symbol.toStringTag,{value:"Module"}));var $e,w,Vn,_e,qt,zn,qn,Jn,xt,_t,dt,Kn,Te={},Gn=[],tr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Re=Array.isArray;function Q(e,t){for(var n in t)e[n]=t[n];return e}function kt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function se(e,t,n){var o,r,s,i={};for(s in t)s=="key"?o=t[s]:s=="ref"?r=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?$e.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)i[s]===void 0&&(i[s]=e.defaultProps[s]);return Me(e,i,o,r,null)}function Me(e,t,n,o,r){var s={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Vn,__i:-1,__u:0};return r==null&&w.vnode!=null&&w.vnode(s),s}function nr(){return{current:null}}function Z(e){return e.children}function G(e,t){this.props=e,this.context=t}function be(e,t){if(t==null)return e.__?be(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?be(e):null}function Zn(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Zn(e)}}function pt(e){(!e.__d&&(e.__d=true)&&_e.push(e)&&!Ye.__r++||qt!=w.debounceRendering)&&((qt=w.debounceRendering)||zn)(Ye)}function Ye(){for(var e,t,n,o,r,s,i,a=1;_e.length;)_e.length>a&&_e.sort(qn),e=_e.shift(),a=_e.length,e.__d&&(n=void 0,o=void 0,r=(o=(t=e).__v).__e,s=[],i=[],t.__P&&((n=Q({},o)).__v=o.__v+1,w.vnode&&w.vnode(n),Ot(t.__P,n,o,t.__n,t.__P.namespaceURI,32&o.__u?[r]:null,s,r??be(o),!!(32&o.__u),i),n.__v=o.__v,n.__.__k[n.__i]=n,Qn(s,n,i),o.__e=o.__=null,n.__e!=r&&Zn(n)));Ye.__r=0}function Yn(e,t,n,o,r,s,i,a,c,l,_){var u,d,v,m,I,k,C,b=o&&o.__k||Gn,S=t.length;for(c=or(n,t,b,c,S),u=0;u<S;u++)(v=n.__k[u])!=null&&(d=v.__i==-1?Te:b[v.__i]||Te,v.__i=u,k=Ot(e,v,d,r,s,i,a,c,l,_),m=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&It(d.ref,null,v),_.push(v.ref,v.__c||m,v)),I==null&&m!=null&&(I=m),(C=!!(4&v.__u))||d.__k===v.__k?c=Xn(v,c,e,C):typeof v.type=="function"&&k!==void 0?c=k:m&&(c=m.nextSibling),v.__u&=-7);return n.__e=I,c}function or(e,t,n,o,r){var s,i,a,c,l,_=n.length,u=_,d=0;for(e.__k=new Array(r),s=0;s<r;s++)(i=t[s])!=null&&typeof i!="boolean"&&typeof i!="function"?(c=s+d,(i=e.__k[s]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?Me(null,i,null,null,null):Re(i)?Me(Z,{children:i},null,null,null):i.constructor==null&&i.__b>0?Me(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,a=null,(l=i.__i=rr(i,n,c,u))!=-1&&(u--,(a=n[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>_?d--:r<_&&d++),typeof i.type!="function"&&(i.__u|=4)):l!=c&&(l==c-1?d--:l==c+1?d++:(l>c?d--:d++,i.__u|=4))):e.__k[s]=null;if(u)for(s=0;s<_;s++)(a=n[s])!=null&&!(2&a.__u)&&(a.__e==o&&(o=be(a)),to(a,a));return o}function Xn(e,t,n,o){var r,s;if(typeof e.type=="function"){for(r=e.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=e,t=Xn(r[s],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=be(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function re(e,t){return t=t||[],e==null||typeof e=="boolean"||(Re(e)?e.some(function(n){re(n,t)}):t.push(e)),t}function rr(e,t,n,o){var r,s,i,a=e.key,c=e.type,l=t[n],_=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||_&&a==l.key&&c==l.type)return n;if(o>(_?1:0)){for(r=n-1,s=n+1;r>=0||s<t.length;)if((l=t[i=r>=0?r--:s++])!=null&&!(2&l.__u)&&a==l.key&&c==l.type)return i}return-1}function Jt(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||tr.test(t)?n:n+"px"}function We(e,t,n,o,r){var s,i;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Jt(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Jt(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(Jn,"$1")),i=t.toLowerCase(),t=i in e||t=="onFocusOut"||t=="onFocusIn"?i.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?o?n.u=o.u:(n.u=xt,e.addEventListener(t,s?dt:_t,s)):e.removeEventListener(t,s?dt:_t,s);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===false&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Kt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=xt++;else if(t.t<n.u)return;return n(w.event?w.event(t):t)}}}function Ot(e,t,n,o,r,s,i,a,c,l){var _,u,d,v,m,I,k,C,b,S,P,A,F,ie,B,Y,X,H=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=t.__e=n.__e]),(_=w.__b)&&_(t);e:if(typeof H=="function")try{if(C=t.props,b="prototype"in H&&H.prototype.render,S=(_=H.contextType)&&o[_.__c],P=_?S?S.props.value:_.__:o,n.__c?k=(u=t.__c=n.__c).__=u.__E:(b?t.__c=u=new H(C,P):(t.__c=u=new G(C,P),u.constructor=H,u.render=ir),S&&S.sub(u),u.props=C,u.state||(u.state={}),u.context=P,u.__n=o,d=u.__d=true,u.__h=[],u._sb=[]),b&&u.__s==null&&(u.__s=u.state),b&&H.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Q({},u.__s)),Q(u.__s,H.getDerivedStateFromProps(C,u.__s))),v=u.props,m=u.state,u.__v=t,d)b&&H.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),b&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(b&&H.getDerivedStateFromProps==null&&C!==v&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(C,P),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(C,u.__s,P)===false||t.__v==n.__v){for(t.__v!=n.__v&&(u.props=C,u.state=u.__s,u.__d=false),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(W){W&&(W.__=t)}),A=0;A<u._sb.length;A++)u.__h.push(u._sb[A]);u._sb=[],u.__h.length&&i.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(C,u.__s,P),b&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(v,m,I)})}if(u.context=P,u.props=C,u.__P=e,u.__e=false,F=w.__r,ie=0,b){for(u.state=u.__s,u.__d=false,F&&F(t),_=u.render(u.props,u.state,u.context),B=0;B<u._sb.length;B++)u.__h.push(u._sb[B]);u._sb=[]}else do u.__d=false,F&&F(t),_=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++ie<25);u.state=u.__s,u.getChildContext!=null&&(o=Q(Q({},o),u.getChildContext())),b&&!d&&u.getSnapshotBeforeUpdate!=null&&(I=u.getSnapshotBeforeUpdate(v,m)),Y=_,_!=null&&_.type===Z&&_.key==null&&(Y=eo(_.props.children)),a=Yn(e,Re(Y)?Y:[Y],t,n,o,r,s,i,a,c,l),u.base=t.__e,t.__u&=-161,u.__h.length&&i.push(u),k&&(u.__E=u.__=null)}catch(W){if(t.__v=null,c||s!=null)if(W.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(X=s.length;X--;)kt(s[X]);vt(t)}else t.__e=n.__e,t.__k=n.__k,W.then||vt(t);w.__e(W,t,n)}else s==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=sr(n.__e,t,n,o,r,s,i,c,l);return(_=w.diffed)&&_(t),128&t.__u?void 0:a}function vt(e){e&&e.__c&&(e.__c.__e=true),e&&e.__k&&e.__k.forEach(vt)}function Qn(e,t,n){for(var o=0;o<n.length;o++)It(n[o],n[++o],n[++o]);w.__c&&w.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(s){s.call(r)})}catch(s){w.__e(s,r.__v)}})}function eo(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Re(e)?e.map(eo):Q({},e)}function sr(e,t,n,o,r,s,i,a,c){var l,_,u,d,v,m,I,k=n.props,C=t.props,b=t.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((v=s[l])&&"setAttribute"in v==!!b&&(b?v.localName==b:v.nodeType==3)){e=v,s[l]=null;break}}if(e==null){if(b==null)return document.createTextNode(C);e=document.createElementNS(r,b,C.is&&C),a&&(w.__m&&w.__m(t,s),a=false),s=null}if(b==null)k===C||a&&e.data==C||(e.data=C);else{if(s=s&&$e.call(e.childNodes),k=n.props||Te,!a&&s!=null)for(k={},l=0;l<e.attributes.length;l++)k[(v=e.attributes[l]).name]=v.value;for(l in k)if(v=k[l],l!="children"){if(l=="dangerouslySetInnerHTML")u=v;else if(!(l in C)){if(l=="value"&&"defaultValue"in C||l=="checked"&&"defaultChecked"in C)continue;We(e,l,null,v,r)}}for(l in C)v=C[l],l=="children"?d=v:l=="dangerouslySetInnerHTML"?_=v:l=="value"?m=v:l=="checked"?I=v:a&&typeof v!="function"||k[l]===v||We(e,l,v,k[l],r);if(_)a||u&&(_.__html==u.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(u&&(e.innerHTML=""),Yn(t.type=="template"?e.content:e,Re(d)?d:[d],t,n,o,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,i,s?s[0]:n.__k&&be(n,0),a,c),s!=null)for(l=s.length;l--;)kt(s[l]);a||(l="value",b=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[l]||b=="progress"&&!m||b=="option"&&m!=k[l])&&We(e,l,m,k[l],r),l="checked",I!=null&&I!=e[l]&&We(e,l,I,k[l],r))}return e}function It(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(r){w.__e(r,n)}}function to(e,t,n){var o,r;if(w.unmount&&w.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||It(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(s){w.__e(s,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&to(o[r],t,n||typeof e.type!="function");n||kt(e.__e),e.__c=e.__=e.__e=void 0}function ir(e,t,n){return this.constructor(e,n)}function Ne(e,t,n){var o,r,s,i;t==document&&(t=document.documentElement),w.__&&w.__(e,t),r=(o=typeof n=="function")?null:n&&n.__k||t.__k,s=[],i=[],Ot(t,e=(!o&&n||t).__k=se(Z,null,[e]),r||Te,Te,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?$e.call(t.childNodes):null,s,!o&&n?n:r?r.__e:t.firstChild,o,i),Qn(s,e,i)}function no(e,t){Ne(e,t,no)}function ar(e,t,n){var o,r,s,i,a=Q({},e.props);for(s in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)s=="key"?o=t[s]:s=="ref"?r=t[s]:a[s]=t[s]===void 0&&i!=null?i[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?$e.call(arguments,2):n),Me(e.type,a,o||e.key,r||e.ref,null)}function Le(e){function t(n){var o,r;return this.getChildContext||(o=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&o.forEach(function(i){i.__e=true,pt(i)})},this.sub=function(s){o.add(s);var i=s.componentWillUnmount;s.componentWillUnmount=function(){o&&o.delete(s),i&&i.call(s)}}),n.children}return t.__c="__cC"+Kn++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,o){return n.children(o)}).contextType=t,t}$e=Gn.slice,w={__e:function(e,t,n,o){for(var r,s,i;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(e)),i=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),i=r.__d),i)return r.__E=r}catch(a){e=a}throw e}},Vn=0,G.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Q({},this.state),typeof e=="function"&&(e=e(Q({},n),this.props)),e&&Q(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),pt(this))},G.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),pt(this))},G.prototype.render=Z,_e=[],zn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,qn=function(e,t){return e.__v.__b-t.__v.__b},Ye.__r=0,Jn=/(PointerCapture)$|Capture$/i,xt=0,_t=Kt(false),dt=Kt(true),Kn=0;var cr=0;function $(e,t,n,o,r,s){t||(t={});var i,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?i=t[a]:c[a]=t[a];var l={type:e,props:c,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--cr,__i:-1,__u:0,__source:r,__self:s};if(typeof e=="function"&&(i=e.defaultProps))for(a in i)c[a]===void 0&&(c[a]=i[a]);return w.vnode&&w.vnode(l),l}var le,M,rt,Gt,we=0,oo=[],N=w,Zt=N.__b,Yt=N.__r,Xt=N.diffed,Qt=N.__c,en=N.unmount,tn=N.__;function xe(e,t){N.__h&&N.__h(M,e,we||t),we=0;var n=M.__H||(M.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ee(e){return we=1,Pt(io,e)}function Pt(e,t,n){var o=xe(le++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):io(void 0,t),function(a){var c=o.__N?o.__N[0]:o.__[0],l=o.t(c,a);c!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=M,!M.__f)){var r=function(a,c,l){if(!o.__c.__H)return true;var _=o.__c.__H.__.filter(function(d){return!!d.__c});if(_.every(function(d){return!d.__N}))return!s||s.call(this,a,c,l);var u=o.__c.props!==a;return _.forEach(function(d){if(d.__N){var v=d.__[0];d.__=d.__N,d.__N=void 0,v!==d.__[0]&&(u=true)}}),s&&s.call(this,a,c,l)||u};M.__f=true;var s=M.shouldComponentUpdate,i=M.componentWillUpdate;M.componentWillUpdate=function(a,c,l){if(this.__e){var _=s;s=void 0,r(a,c,l),s=_}i&&i.call(this,a,c,l)},M.shouldComponentUpdate=r}return o.__N||o.__}function L(e,t){var n=xe(le++,3);!N.__s&&Mt(n.__H,t)&&(n.__=e,n.u=t,M.__H.__h.push(n))}function te(e,t){var n=xe(le++,4);!N.__s&&Mt(n.__H,t)&&(n.__=e,n.u=t,M.__h.push(n))}function U(e){return we=5,de(function(){return{current:e}},[])}function ro(e,t,n){we=6,te(function(){if(typeof e=="function"){var o=e(t());return function(){e(null),o&&typeof o=="function"&&o()}}if(e)return e.current=t(),function(){return e.current=null}},n==null?n:n.concat(e))}function de(e,t){var n=xe(le++,7);return Mt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function pe(e,t){return we=8,de(function(){return e},t)}function ue(e){var t=M.context[e.__c],n=xe(le++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub(M)),t.props.value):e.__}function so(e,t){N.useDebugValue&&N.useDebugValue(t?t(e):e)}function At(){var e=xe(le++,11);if(!e.__){for(var t=M.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function lr(){for(var e;e=oo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Je),e.__H.__h.forEach(ht),e.__H.__h=[]}catch(t){e.__H.__h=[],N.__e(t,e.__v)}}N.__b=function(e){M=null,Zt&&Zt(e)},N.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),tn&&tn(e,t)},N.__r=function(e){Yt&&Yt(e),le=0;var t=(M=e.__c).__H;t&&(rt===M?(t.__h=[],M.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Je),t.__h.forEach(ht),t.__h=[],le=0)),rt=M},N.diffed=function(e){Xt&&Xt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(oo.push(t)!==1&&Gt===N.requestAnimationFrame||((Gt=N.requestAnimationFrame)||ur)(lr)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),rt=M=null},N.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Je),n.__h=n.__h.filter(function(o){return!o.__||ht(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],N.__e(o,n.__v)}}),Qt&&Qt(e,t)},N.unmount=function(e){en&&en(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{Je(o)}catch(r){t=r}}),n.__H=void 0,t&&N.__e(t,n.__v))};var nn=typeof requestAnimationFrame=="function";function ur(e){var t,n=function(){clearTimeout(o),nn&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);nn&&(t=requestAnimationFrame(n))}function Je(e){var t=M,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),M=t}function ht(e){var t=M;e.__c=e.__(),M=t}function Mt(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function io(e,t){return typeof t=="function"?t(e):t}function ao(e,t){for(var n in t)e[n]=t[n];return e}function mt(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return true;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return true;return false}function fe(e,t){var n=t(),o=ee({t:{__:n,u:t}}),r=o[0].t,s=o[1];return te(function(){r.__=n,r.u=t,st(r)&&s({t:r})},[e,n,t]),L(function(){return st(r)&&s({t:r}),e(function(){st(r)&&s({t:r})})},[e]),n}function st(e){var t,n,o=e.u,r=e.__;try{var s=o();return!((t=r)===(n=s)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return true}}function co(e){e()}function lo(e){return e}function uo(){return[false,co]}var fo=te;function gt(e,t){this.props=e,this.context=t}function Et(e,t){function n(r){var s=this.props.ref,i=s==r.ref;return!i&&s&&(s.call?s(null):s.current=null),t?!t(this.props,r)||!i:mt(this.props,r)}function o(r){return this.shouldComponentUpdate=n,se(e,r)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=true,o.__f=true,o.type=e,o}(gt.prototype=new G).isPureReactComponent=true,gt.prototype.shouldComponentUpdate=function(e,t){return mt(this.props,e)||mt(this.state,t)};var on=w.__b;w.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),on&&on(e)};var fr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function _r(e){function t(n){var o=ao({},n);return delete o.ref,e(o,n.ref||null)}return t.$$typeof=fr,t.render=e,t.prototype.isReactComponent=t.__f=true,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var rn=function(e,t){return e==null?null:re(re(e).map(t))},dr={map:rn,forEach:rn,count:function(e){return e?re(e).length:0},only:function(e){var t=re(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:re},pr=w.__e;w.__e=function(e,t,n,o){if(e.then){for(var r,s=t;s=s.__;)if((r=s.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}pr(e,t,n,o)};var sn=w.unmount;function _o(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=ao({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=true,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return _o(o,t,n)})),e}function po(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return po(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function Ke(){this.__u=0,this.o=null,this.__b=null}function vo(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function vr(e){var t,n,o;function r(s){if(t||(t=e()).then(function(i){n=i.default||i},function(i){o=i}),o)throw o;if(!n)throw t;return se(n,s)}return r.displayName="Lazy",r.__f=true,r}function Ae(){this.i=null,this.l=null}w.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),sn&&sn(e)},(Ke.prototype=new G).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=vo(o.__v),s=false,i=function(){s||(s=true,n.__R=null,r?r(a):a())};n.__R=i;var a=function(){if(!--o.__u){if(o.state.__a){var c=o.state.__a;o.__v.__k[0]=po(c,c.__c.__P,c.__c.__O)}var l;for(o.setState({__a:o.__b=null});l=o.o.pop();)l.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(i,i)},Ke.prototype.componentWillUnmount=function(){this.o=[]},Ke.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=_o(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&se(Z,null,e.fallback);return r&&(r.__u&=-33),[se(Z,null,t.__a?null:e.children),r]};var an=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function hr(e){return this.getChildContext=function(){return e.context},e.children}function mr(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){Ne(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;o!==null&&!o.__m&&o.__!==null;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return true},insertBefore:function(r,s){this.childNodes.push(r),t.h.insertBefore(r,s)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.h.removeChild(r)}}}Ne(se(hr,{context:t.context},e.__v),t.v)}function Tt(e,t){var n=se(mr,{__v:e,h:t});return n.containerInfo=t,n}(Ae.prototype=new G).__a=function(e){var t=this,n=vo(t.__v),o=t.l.get(e);return o[0]++,function(r){var s=function(){t.props.revealOrder?(o.push(r),an(t,e,o)):r()};n?n(s):s()}},Ae.prototype.render=function(e){this.i=null,this.l=new Map;var t=re(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ae.prototype.componentDidUpdate=Ae.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){an(e,n,t)})};var ho=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,gr=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,yr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,br=/[A-Z0-9]/g,wr=typeof document<"u",Sr=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function mo(e,t,n){return t.__k==null&&(t.textContent=""),Ne(e,t),typeof n=="function"&&n(),e?e.__c:null}function Cr(e,t,n){return no(e,t),typeof n=="function"&&n(),e?e.__c:null}G.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(G.prototype,e,{configurable:true,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t})}})});var cn=w.event;function xr(){}function kr(){return this.cancelBubble}function Or(){return this.defaultPrevented}w.event=function(e){return cn&&(e=cn(e)),e.persist=xr,e.isPropagationStopped=kr,e.isDefaultPrevented=Or,e.nativeEvent=e};var Nt,Ir={enumerable:false,configurable:true,get:function(){return this.class}},ln=w.vnode;w.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,o=t.type,r={},s=o.indexOf("-")===-1;for(var i in n){var a=n[i];if(!(i==="value"&&"defaultValue"in n&&a==null||wr&&i==="children"&&o==="noscript"||i==="class"||i==="className")){var c=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&a===true?a="":c==="translate"&&a==="no"?a=false:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?i="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||Sr(n.type)?c==="onfocus"?i="onfocusin":c==="onblur"?i="onfocusout":yr.test(i)&&(i=c):c=i="oninput":s&&gr.test(i)?i=i.replace(br,"-$&").toLowerCase():a===null&&(a=void 0),c==="oninput"&&r[i=c]&&(i="oninputCapture"),r[i]=a}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=re(n.children).forEach(function(l){l.props.selected=r.value.indexOf(l.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=re(n.children).forEach(function(l){l.props.selected=r.multiple?r.defaultValue.indexOf(l.props.value)!=-1:r.defaultValue==l.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",Ir)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),t.props=r}(e),e.$$typeof=ho,ln&&ln(e)};var un=w.__r;w.__r=function(e){un&&un(e),Nt=e.__c};var fn=w.diffed;w.diffed=function(e){fn&&fn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Nt=null};var Pr={ReactCurrentDispatcher:{current:{readContext:function(e){return Nt.__n[e.__c].props.value},useCallback:pe,useContext:ue,useDebugValue:so,useDeferredValue:lo,useEffect:L,useId:At,useImperativeHandle:ro,useInsertionEffect:fo,useLayoutEffect:te,useMemo:de,useReducer:Pt,useRef:U,useState:ee,useSyncExternalStore:fe,useTransition:uo}}};function Ar(e){return se.bind(null,e)}function Xe(e){return!!e&&e.$$typeof===ho}function Mr(e){return Xe(e)&&e.type===Z}function Er(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Tr(e){return Xe(e)?ar.apply(null,arguments):e}function go(e){return!!e.__k&&(Ne(null,e),true)}function Nr(e){return e&&(e.base||e.nodeType===1&&e)||null}var $r=function(e,t){return e(t)},Rr=function(e,t){return e(t)},Lr=Z,Ur=Xe,yi={useState:ee,useId:At,useReducer:Pt,useEffect:L,useLayoutEffect:te,useInsertionEffect:fo,useTransition:uo,useDeferredValue:lo,useSyncExternalStore:fe,startTransition:co,useRef:U,useImperativeHandle:ro,useMemo:de,useCallback:pe,useContext:ue,useDebugValue:so,version:"18.3.1",Children:dr,render:mo,hydrate:Cr,unmountComponentAtNode:go,createPortal:Tt,createElement:se,createContext:Le,createFactory:Ar,cloneElement:Tr,createRef:nr,Fragment:Z,isValidElement:Xe,isElement:Ur,isFragment:Mr,isMemo:Er,findDOMNode:Nr,Component:G,PureComponent:gt,memo:Et,forwardRef:_r,flushSync:Rr,unstable_batchedUpdates:$r,StrictMode:Lr,Suspense:Ke,SuspenseList:Ae,lazy:vr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Pr};function Fr(e){return{render:function(t){mo(t,e)},unmount:function(){go(e)}}}const $t=Le("");function Hr(){return ue($t)+At()}Ce(1,"styles/scale","@layer clover{:root{--clover-space-3xs: .146rem;--clover-space-2xs: .236rem;--clover-space-xs: .382rem;--clover-space-s: .618rem;--clover-space-m: 1rem;--clover-space-l: 1.618rem;--clover-space-xl: 2.618rem;--clover-space-2xl: 4.236rem;--clover-text-xs: .764rem;--clover-text-s: .854rem;--clover-text-m: 1.146rem;--clover-text-l: 1.236rem;--clover-control: calc(1rem + 2 * var(--clover-space-s));--clover-inset: var(--clover-space-l);--clover-picture: calc(4 * var(--clover-space-xl))}:where(.clover-title){margin:0;font-weight:var(--clover-title-weight, 400);line-height:1.25;overflow-wrap:anywhere}:where(.clover-root,.clover-canvas,.clover-items,.clover-geomap) :where(button,input,select,textarea){font:inherit}:where(.clover-field-pill-query,.clover-collection-select-control){box-sizing:border-box;padding:var(--clover-space-xs) var(--clover-space-s);border:1px solid var( --clover-field-edge, color-mix( in srgb, var(--clover-color-primary-muted, #26292b) 80%, var(--clover-color-secondary, #fff) ) );border-radius:var(--clover-radius, 3px);background-color:var(--clover-color-secondary, #fff);color:var(--clover-color-primary, #1a1d1e)}:where(.clover-field-pill-query,.clover-collection-select-control):focus-visible{outline:2px solid var(--clover-color-accent, #0065c3);outline-offset:1px}:where(.clover-field-pill-query)::placeholder{color:color-mix(in srgb,var(--clover-color-primary, #1a1d1e) 65%,var(--clover-color-secondary, #fff));opacity:1}}");Ce(2,"styles/contrast","@layer clover{:where([data-high-contrast]){--clover-accent-fill: var(--clover-color-control, #1a1d1e);--clover-accent-ring: 3px solid var(--clover-color-accent, #0065c3);--clover-accent-ring-hover: 3px solid color-mix(in srgb, var(--clover-color-accent, #0065c3) 50%, transparent);--clover-accent-text-fallback: var(--clover-color-primary, #1a1d1e);--clover-transition: none}}");const Dr="clover-root",yo=Symbol("roots"),jr=[];class bo{constructor(t){oe(this,"entries",new Map);oe(this,"lists",new Map);oe(this,"listeners",new Map);oe(this,"languages",new Br(t2=>this.entries.has(t2)));this.count=t}list(t){return this.lists.get(t)??jr}subscribe(t,n){let o=this.listeners.get(t);return o||this.listeners.set(t,o=new Set),o.add(n),()=>{o.delete(n)}}connect(t){var s;const n=t.kind==="part"?((s=t.element.parentElement)==null?void 0:s.closest(Dr))??null:null,o=this.entries.get(t.element);if(o&&o.root===n)return;const r={hosted:t,key:(o==null?void 0:o.key)??++this.count.made,root:n};this.entries.set(t.element,r),o&&this.change(it(o),i=>i.filter(a=>a!==o)),this.change(it(r),i=>[...i,r]),t.needsRoot&&!n&&console.warn(`<${t.element.localName}> shows a <clover-root>'s state: put it inside one.`),t.kind!=="root"&&this.languages.draws(t.element.localName),(t.kind!=="part"||!n)&&this.languages.watch(t.element)}disconnect(t){const n=this.entries.get(t);n&&(this.entries.delete(t),this.change(it(n),o=>o.filter(r=>r!==n)))}change(t,n){var o;this.lists.set(t,n(this.list(t))),(o=this.listeners.get(t))==null||o.forEach(r=>r())}}const it=e=>e.hosted.kind==="root"?yo:e.root;class Br{constructor(t){oe(this,"observer",null);oe(this,"tags",new Set);this.isElement=t}draws(t){this.tags.add(t)}watch(t){this.observer??(this.observer=new MutationObserver(n=>{const o=[...this.tags,".clover-announcer"].join(",");for(const{target:r}of n){const s=r;s.getAttribute("lang")!==""||this.isElement(s)||s.closest(o)&&s.removeAttribute("lang")}})),this.observer.observe(t,{subtree:true,attributes:true,attributeFilter:["lang"]})}}function yt(e,t){const n=pe(r=>e.subscribe(t,r),[e,t]);return fe(n,()=>e.list(t))}function wo(e){return fe(e.subscribe,e.getProps,e.getProps)}function Wr({registry:e}){const t=yt(e,yo),n=yt(e,null);return $(Z,{children:[t.map(o=>$(Vr,{entry:o,registry:e},o.key)),n.map(o=>$(Co,{entry:o},o.key))]})}const So=e=>`clover-${e.key}-`,Vr=Et(function({entry:t,registry:n}){const{hosted:o}=t,r=yt(n,o.element),s=wo(o),i=o.Component;return $(xo,{hosted:o,props:s,children:$($t.Provider,{value:So(t),children:$(i,{hosted:o,props:s,children:r.map(a=>$(Co,{entry:a},a.key))})})})}),Co=Et(function({entry:t}){const{hosted:n}=t,o=wo(n);if(n.needsRoot&&!t.root)return null;const r=n.Component;return Tt($(xo,{hosted:n,props:o,children:$($t.Provider,{value:So(t),children:$(r,{hosted:n,props:o})})}),n.element)});class xo extends G{constructor(){super(...arguments);oe(this,"state",{failed:false})}static getDerivedStateFromError(){return{failed:true}}componentDidCatch(n,o){console.error(`<${this.props.hosted.element.localName}>:`,n)}componentDidUpdate(n){this.state.failed&&n.props!==this.props.props&&this.setState({failed:false})}render(){return this.state.failed?null:this.props.children}}const _n=new WeakMap,Ve=Symbol.for("clover.elements");function zr(e){let t=_n.get(e);if(!t){const n=e;n[Ve]&&console.warn("Clover is loaded twice on this page: load one entry."),t=new bo(n[Ve]??(n[Ve]={made:0})),_n.set(e,t),Fr(e.createElement("div")).render($(Wr,{registry:t}))}return t}const bi=Object.freeze(Object.defineProperty({__proto__:null,Registry:bo,hostOf:zr},Symbol.toStringTag,{value:"Module"})),Rt=Le(void 0);function ko(e=K,t){const n=fe(j.subscribe,j.getSnapshot,j.getSnapshot),o=ue(Rt),r=t??o,s=pe((a,c)=>j.t(a,c,e),[e,n]),i=pe(a=>j.langOf(a,r,e),[e,n,r]);return{t:s,langOf:i,hostLanguage:r,i18n:j}}const qr=/^(ar|arc|ckb|dv|fa|he|iw|ks|ps|sd|syr|ug|ur|yi)$/,Jr=/^(adlm|arab|hebr|nkoo|rohg|syrc|thaa)$/;function Kr(e){if(!e)return;const[t,...n]=e.toLowerCase().split(/[-_]/),o=n.find(r=>r.length===4);return(o?Jr.test(o):qr.test(t))?"rtl":void 0}function dn(e){return e?{lang:e,dir:Kr(e)}:{}}function Gr(e,t,n={}){return((e==null?void 0:e.fetch)??globalThis.fetch)(t,{credentials:(e==null?void 0:e.credentials)??"same-origin",...n,headers:{...n.headers,...e==null?void 0:e.headers}})}const wi=e=>(e==null?void 0:e.credentials)==="include",Zr=e=>JSON.stringify([e==null?void 0:e.credentials,e==null?void 0:e.headers]);class Yr extends Error{constructor(t,n,o){super(t),this.url=n,this.status=o,this.name="CloverRequestError"}}async function Se(e,t,n){const o=await Gr(e,t,{signal:n,headers:{Accept:"application/ld+json, application/json"}});if(!o.ok)throw new Yr(`${t} answered ${o.status}`,t,o.status);return o.json()}const x=e=>Array.isArray(e)?e:e==null?[]:[e],Oo=["Independents","Composite","List"];function Io(e){return x(e==null?void 0:e.body).flatMap(t=>Oo.includes(t==null?void 0:t.type)?x(t.items):[t])}function Xr(e){const t=x(e==null?void 0:e.motivation);return!t.length||t.includes("painting")}function Qr(e){const t=[];for(const n of x(e==null?void 0:e.items))for(const o of x(n==null?void 0:n.items))if(Xr(o))for(let r of Io(o))(r==null?void 0:r.type)==="Choice"&&(r=x(r.items)[0]),(r==null?void 0:r.type)==="SpecificResource"&&(r=typeof r.source=="string"?{id:r.source}:r.source),r&&t.push({body:r,annotation:o});return t}function Po(e,t,n=", "){if(!e)return{text:""};if(typeof e=="string")return{text:e};const o=Object.keys(e).filter(a=>{var c;return(c=e[a])==null?void 0:c.length});if(!o.length)return{text:""};const r=Zo(o,t),s=e[r];return{text:Array.isArray(s)?s.join(n):String(s),lang:r==="none"?void 0:r}}const es=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/;function Si(e){const t=e==null?void 0:e.language,n=(Array.isArray(t)?t:[t]).filter(o=>typeof o=="string"&&es.test(o));return n.length===1?n[0]:void 0}const Qe=Le(null);function Ci(){return ue(Qe)}function ts(e="This part"){const t=ue(Qe);if(!t)throw new Error(`${e} must be rendered inside <Clover.Root>.`);return t}function xi(e,t=Object.is,n){const{clover:o}=ts(n),r=U(null),s=()=>{const i=e(o.store.get());return r.current&&t(r.current.value,i)?r.current.value:(r.current={value:i},i)};return fe(o.store.subscribe,s)}const ns={subscribe:()=>()=>{}};function ki(e,t){const n=ue(Qe),o=n==null?void 0:n.clover.store,r=()=>o?e(o.get()):t;return fe(o?o.subscribe:ns.subscribe,r)}function os(e,t){const n=ue(Rt),o=U(null),[r,s]=ee(""),i=pe(_=>{o.current=_,typeof e=="function"?e(_):e&&(e.current=_)},[e]);L(()=>{var u,d;const _=(u=o.current)==null?void 0:u.parentElement;t!==void 0||n!==void 0||!_||s(((d=_.closest("[lang]"))==null?void 0:d.getAttribute("lang"))??"")});const c=t??n??r,{langOf:l}=ko(void 0,c);return{ref:i,hostLanguage:c,langOf:l}}Ce(22,"ui/ReadMore","@layer clover{.clover-read-more{display:flex;flex-direction:column;align-items:flex-start;gap:var(--clover-space-xs);min-width:0}button.clover-read-more-button{margin:0;padding:0;border:0;background:none;color:var( --clover-color-accent-text, var(--clover-accent-text-fallback, var(--clover-color-accent, #0065c3)) );font-size:var(--clover-text-s);text-decoration:underline 1px;text-decoration-color:color-mix(in srgb,currentColor 20%,transparent);text-underline-offset:var(--clover-space-3xs);cursor:pointer}button.clover-read-more-button:hover{text-decoration-color:currentColor}button.clover-read-more-button:focus-visible{outline:2px solid var(--clover-color-accent, #0065c3);outline-offset:2px;border-radius:var(--clover-radius, 3px)}}");const rs=["left-to-right","right-to-left","top-to-bottom","bottom-to-top"];function ss(e){return rs.includes(e)?e:"left-to-right"}const is=["individuals","paged","continuous","unordered"];function as(e){return x(e).find(n=>is.includes(n))??"individuals"}function cs(e,t){if(!e.length)return[];if(t==="continuous")return[e.map((a,c)=>c)];if(t!=="paged")return e.map((a,c)=>[c]);const n=[];let o=[],r=0,s=false;const i=()=>{o.length&&n.push(o),o=[]};return e.forEach((a,c)=>{const l=x(a.behavior);if(l.includes("non-paged")){c===r&&r++,i(),n.push([c]);return}if(c===r||l.includes("facing-pages")){o.length&&(s=true),i(),n.push([c]);return}if(o.push(c),s){i(),s=false;return}o.length>1&&i()}),i(),n}function ls(e,t){const n=e.findIndex(o=>o.includes(t));return n===-1?0:n}function Ao(e,t){const n=/(?:^|[#&])t=([^&]+)/.exec(t),o=n&&{t:n[1]},r=/(?:^|[#&])xywh=(?:pixel:)?([^&]+)/.exec(t);if(r){const[s,i,a,c]=r[1].split(",").map(Number);if([s,i,a,c].every(Number.isFinite))return{id:e,rect:{x:s,y:i,w:a,h:c},...o}}return o&&{id:e,...o}}function ze(e){const t=e.indexOf("#");if(t>=0){const o=e.slice(0,t);return Ao(o,e.slice(t))??{id:o}}const n=e.indexOf("&t=");return n>=0?{id:e.slice(0,n),t:e.slice(n+3)}:{id:e}}const bt=e=>{var t;return Array.isArray(e)?bt(e[0]):Oo.includes(e==null?void 0:e.type)?bt((t=e.items)==null?void 0:t[0]):e};function et(e){return us(bt(e))}function us(e){var n;if(typeof e=="string")return ze(e);if(!e||typeof e!="object")return{id:""};if(e.type!=="SpecificResource"||e.source===void 0)return ze(e.id??"");const t=typeof e.source=="string"?ze(e.source):ze(((n=e.source)==null?void 0:n.id)??"");for(const o of x(e.selector)){const r=o;if((r==null?void 0:r.type)==="PointSelector"){const[s,i,a]=[r.x,r.y,r.instant??r.t].map(Number),c=Number.isFinite(s)&&Number.isFinite(i);return{id:t.id,...c?{point:{x:s,y:i}}:{},...Number.isFinite(a)?{t:String(a)}:{}}}if((r==null?void 0:r.type)==="SvgSelector"&&r.value)return{id:t.id,svg:String(r.value)};if((r==null?void 0:r.type)==="FragmentSelector"&&r.value){const s=Ao(t.id,String(r.value));if(s)return s}}return t}const Oi=e=>e==="Audio"||e==="Sound",fs=e=>{const t=x(e);return t.length>0&&t.every(n=>n==="supplementing")},_s=(e,t)=>fs(e)&&!!(t.rect||t.svg||t.point)&&!t.t,pn=new WeakMap,ds={canvases:[],views:[],direction:"left-to-right"};function D(e){if(!e)return ds;let t=pn.get(e);if(!t){const n=(e.items??[]).filter(o=>(o==null?void 0:o.type)==="Canvas"||(o==null?void 0:o.type)==="Timeline"||(o==null?void 0:o.type)==="Scene");t={canvases:n,views:cs(n,as(e.behavior)),direction:ss(e.viewingDirection)},pn.set(e,t)}return t}const vn=new WeakMap;function Ue(e,t){if(!t)return null;const n=D(e);let o=vn.get(n);if(!o){o=new Map;for(const r of n.canvases)o.has(r.id)||o.set(r.id,r);vn.set(n,o)}return o.get(t)??null}function tt(e,t){const{canvases:n,views:o}=D(e),r=n.findIndex(s=>s.id===t);return r===-1?0:ls(o,r)}const hn=new WeakMap,ps=[];function Ee(e,t){if(!e)return ps;const n=tt(e,t);let o=hn.get(e);o||hn.set(e,o=new Map);let r=o.get(n);if(!r){const s=D(e);r=(s.views[n]??[]).map(i=>s.canvases[i]),o.set(n,r)}return r}function vs(e,t){var s,i;const{canvases:n,views:o}=D(e),r=(s=o[t])==null?void 0:s[0];return r===void 0?null:((i=n[r])==null?void 0:i.id)??null}function hs(e){const t=e==null?void 0:e.start;if(!t)return null;const n=et(t);if(!n.id)return null;const o={canvasId:n.id};n.rect&&(o.region=n.rect);const r=n.t?Number(n.t.split(",")[0]):NaN;return Number.isFinite(r)&&(o.time=r),o}const Ii=(e,t)=>{const n=e==null?void 0:e.behavior;return Array.isArray(n)?n.includes(t):n===t},Pi=e=>[(e==null?void 0:e.partOf)??[]].flat().find(t=>(t==null?void 0:t.id)&&t.type==="Collection");function Ai(e,t,n,o){const r=e==null?void 0:e.items;if(!(r!=null&&r.length)||!n)return-1;const s=Ee(n,o),i=a=>{const c=r[a];return((c==null?void 0:c.manifestId)===n.id||(c==null?void 0:c.manifestAs)===n.id)&&(!c.canvasId||s.some(l=>l.id===c.canvasId))};return t!==null&&i(t)?t:r.findIndex((a,c)=>i(c))}Ce(28,"components/Primitives/Primitives","@layer clover{.clover-summary:not([data-read-more=open]){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--clover-summary-lines, 5);overflow:hidden}:is(.clover-metadata,.clover-required-statement){display:flex;flex-direction:column;gap:var(--clover-space-s);margin:0}:is(.clover-metadata,.clover-required-statement) dt{margin:0;font-weight:500}:is(.clover-metadata,.clover-required-statement) dd{margin:0}.clover-summary,:is(.clover-metadata,.clover-required-statement) :is(dt,dd){overflow-wrap:anywhere}:is(.clover-about,.clover-canvas-caption,.clover-annotations-body,.clover-metadata,.clover-required-statement,.clover-summary) a:not([class]){text-decoration-line:underline;text-underline-offset:var(--clover-space-3xs)}:is(.clover-homepage,.clover-rendering,.clover-see-also,.clover-part-of)>li{min-block-size:24px}:is(.clover-homepage,.clover-rendering,.clover-see-also,.clover-part-of) a,a:is(.clover-id,.clover-rights){color:var( --clover-color-accent-text, var(--clover-accent-text-fallback, var(--clover-color-accent, #0065c3)) );overflow-wrap:anywhere;text-decoration-line:underline;text-underline-offset:var(--clover-space-3xs)}.clover-link-format{color:var(--clover-color-primary-muted, #26292b);font-size:var(--clover-text-s)}}");const ms={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},gs=e=>(e==null?void 0:e.format)==="text/vtt"||typeof(e==null?void 0:e.id)=="string"&&/\.vtt(\?|$)/i.test(e.id);function ys(e){const t=[];let n=0;const o=(r,s)=>{var a;if(!r||gs(r))return;if(r.type==="SpecificResource"){r.source&&typeof r.source=="object"&&o(r.source,s);return}const i=s===void 0?{}:{choice:s};if(r.type==="TextualBody"||typeof r.value=="string")t.push({value:String(r.value??""),format:r.format,language:x(r.language)[0],...i});else if(r.type==="Image"&&r.id){const c=r.label??e.label;t.push({image:r.id,format:r.format,...c?{label:c}:{},...i})}else if(r.type==="Feature"){const c=((a=r.properties)==null?void 0:a.label)??e.label;c&&typeof c=="object"&&t.push({label:c,place:true,...i})}};for(const r of Io(e))if((r==null?void 0:r.type)!=="Choice")o(r);else{const s=n++;for(const i of x(r.items))o(i,s)}return t}const Mo="content-search",mn=/\/search\/([0-2])\//;function bs(e){if(!e)return null;let t=null;for(const n of x(e.service)){const o=(n==null?void 0:n.id)??(n==null?void 0:n["@id"]);if(typeof o!="string")continue;const r=String(n.type??n["@type"]??""),s=[n.profile,n["@context"]].flat().map(a=>String(a??"")).join(" "),i=r==="SearchService2"?2:r==="SearchService1"?1:mn.test(s)?Number(mn.exec(s)[1])>=2?2:1:null;if(i===2)return{id:o,version:i};i===1&&(t??(t={id:o,version:i}))}return t}const ws="contents",Mi=(e,t)=>`${e}#region-${t+1}`,Ss=e=>x(e==null?void 0:e.motivation).includes("linking");function Eo(e,t,n){const o=[];for(const r of x(e==null?void 0:e.items)){const s=x(r==null?void 0:r.motivation);if(s.includes("painting"))continue;const i=ys(r);if(!i.length&&!Ss(r))continue;const a=et(x(r.target)[0]),c=a.id||n;!c||!r.id||o.push({id:r.id,setId:t,canvasId:c,target:a,motivation:s,bodies:i,annotation:r})}return o}const Cs=e=>D(e).canvases.some(t=>x(t.items).some(n=>x(n==null?void 0:n.items).some(o=>x(o==null?void 0:o.body).some(r=>[r,...x(r==null?void 0:r.items)].some(s=>x(s==null?void 0:s.annotations).length>0)))));function xs(e,t){for(const n of[e,t])if(n!=null&&n.label)return n.label;for(const n of[e,t]){const o=x(n==null?void 0:n.partOf).find(r=>/AnnotationCollection/.test(String((r==null?void 0:r.type)??(r==null?void 0:r["@type"])))&&r.label);if(o)return o.label}}const To=e=>x(e==null?void 0:e.partOf).filter(t=>(t==null?void 0:t.id)&&/AnnotationCollection/.test(String((t==null?void 0:t.type)??(t==null?void 0:t["@type"])))),gn=new WeakMap;function No(e){var n;if(!e)return[];let t=gn.get(e);if(!t){const o=new Map;for(const r of D(e).canvases)for(const s of x(r.annotations)){if(!Array.isArray(s==null?void 0:s.items))continue;const i=s.id??`${r.id}#annotations`;let a=o.get(i);if(!a){const c=(n=To(s)[0])==null?void 0:n.id;a={id:i,label:xs(s),source:"manifest",entries:[],...c?{collection:c}:{}},o.set(i,a)}a.entries.push(...Eo(s,i,r.id))}t=[...o.values()].filter(r=>r.entries.length),gn.set(e,t)}return t}const yn=new WeakMap,$o=[];function Ei(e){if(!e)return $o;let t=yn.get(e);return t||(t=D(e).canvases.flatMap(n=>x(n.annotations).filter(o=>o==null?void 0:o.id).map(o=>({id:String(o.id),canvasId:String(n.id),fetched:Array.isArray(o.items)}))),yn.set(e,t)),t}const at=new WeakMap,ct=new WeakMap;function ks(e,t=Os){var n;if(!ct.has(t)){const o=t.filter(s=>s.content),r=(n=o[0])==null?void 0:n.content;ct.set(t,r?{id:r.id,type:r.type,...r.label?{label:r.label}:{},pages:$o,entries:o.flatMap(s=>s.entries)}:null)}return ct.get(t)??Is(e)}const Os=[];function Is(e){var r;if(!e)return null;if(at.has(e))return at.get(e);const t=D(e).canvases.flatMap(s=>x(s.annotations).flatMap(i=>To(i).map(a=>({part:a,page:i,canvas:s})))),n=(r=t[0])==null?void 0:r.part.id,o=n?(()=>{var l,_;const s=t.filter(({part:u})=>u.id===n),i=(l=s.find(({part:u})=>u.label))==null?void 0:l.part.label,a=Number((_=s.find(({part:u})=>u.total))==null?void 0:_.part.total),c=No(e);return{id:n,type:"AnnotationCollection",...i?{label:i}:{},...a>0?{total:a}:{},pages:s.map(({page:u,canvas:d})=>({id:String(u.id),canvasId:String(d.id),fetched:Array.isArray(u.items)})),entries:s.flatMap(({page:u})=>{var d;return((d=c.find(v=>v.id===u.id))==null?void 0:d.entries)??[]})}})():null;return at.set(e,o),o}const bn=new WeakMap,wn=[];function nt(e,t){const n=No(e);if(!t.length)return n.length?n:wn;const o=e??wn;let r=bn.get(o);r||bn.set(o,r=new Map);let s=r.get(t);if(!s){const i=new Set(n.map(a=>a.id));s=[...n,...t.filter(a=>!i.has(a.id)&&!!i.add(a.id))],r.set(t,s)}return s}const Sn=new WeakMap;function Ps(e,t,n,o=null){const r=nt(e,t),s=n!=null&&n.entries.length?n:null;if(!o&&!s)return r;let i=Sn.get(r);i||Sn.set(r,i=new Map);let a=i.get(o);a||i.set(o,a=new Map);let c=a.get(s);return c||(c=[...r,...o?[o]:[],...s?[s]:[]],a.set(s,c)),c}const As=e=>Number(e==null?void 0:e.duration)>0;function Ro(e,t){return e.source==="search"||!e.entries.length?false:e.entries.every(n=>_s(n.motivation,n.target)&&!As(t(n.canvasId)))}const Cn=new WeakMap;function Ti(e,t){const n=nt(e,t);let o=Cn.get(n);if(!o){const r=n.filter(s=>!Ro(s,i=>Ue(e,i)??void 0));o=r.length===n.length?n:r,Cn.set(n,o)}return o}const xn=new WeakMap;function Lo(e,t,n,o){const r=nt(e,t),s=xn.get(r);if(s&&s.hidden===n&&s.shown===o)return s.ids;const i=r.filter(c=>!n.includes(c.id)&&!o.includes(c.id)&&Ro(c,l=>Ue(e,l)??void 0)).map(c=>c.id),a=i.length?[...n,...i]:n;return xn.set(r,{hidden:n,shown:o,ids:a}),a}const kn=new WeakMap;function Ni(e,t,n,o){const r=Lo(e,t,n,o),s=kn.get(r);if(s&&s.hidden===n)return s.ids;const i=[Mo,ws,...r.filter(a=>!n.includes(a))];return kn.set(r,{hidden:n,ids:i}),i}function Ms(e){for(const t of x(e==null?void 0:e.target)){const n=(t==null?void 0:t.type)==="SpecificResource"?t.source:t,o=x(n==null?void 0:n.partOf).find(r=>(r==null?void 0:r.id)&&(!r.type||r.type==="Manifest"));if(o)return o.id}}function lt(e,t){if(!t)return null;for(const n of e){const o=n.entries.find(r=>r.id===t);if(o)return o}return null}function On(e){const t=e;return!t||typeof t!="object"?false:t.type==="Annotation"?x(t.motivation).includes("contentState"):t.type==="SpecificResource"}function Es(e){return btoa(encodeURIComponent(JSON.stringify(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ts({manifestId:e,canvasId:t,type:n="Canvas",region:o,time:r}){const s={id:t,type:n,...e&&e!==t?{partOf:[{id:e,type:"Manifest"}]}:{}},i=r!=null&&r>0?`t=${Math.round(r*100)/100}`:o?`xywh=${[o.x,o.y,o.w,o.h].map(Math.round).join(",")}`:null,a={"@context":`http://iiif.io/api/presentation/${n==="Canvas"?3:4}/context.json`,id:`${t}#content-state`,type:"Annotation",motivation:["contentState"],target:i?{type:"SpecificResource",source:s,selector:{type:"FragmentSelector",value:i}}:s};return{json:a,encoded:Es(a)}}const Ns=/iiif\.io\/api\/presentation\/4\/context\.json/;function Uo(e){const t=e==null?void 0:e["@context"];return(Array.isArray(t)?t:[t]).some(o=>typeof o=="string"&&Ns.test(o))}let In=null;function Lt(){return In??(In=import("./upgrader-BlbMUEH6.mjs").then(({upgradePresentation3To4:e})=>e)),In}async function ve(e){if(Uo(e))return e;const[t,{upgrade:n}]=await Promise.all([Lt(),import("./upgrade-eNW0DPXq.mjs")]);return await n(e,t)}const Pn=()=>import("./content-state-reader-GgQF2MvJ.mjs"),$s=["summary","metadata","requiredStatement","rights","provider","homepage","seeAlso","rendering","thumbnail","navDate","partOf"];function Rs(e){const t={"@context":Us,id:e.id,type:"Manifest",label:e.label??{none:[""]},items:[e]};for(const n of $s)e[n]!==void 0&&n!=="label"&&(t[n]=e[n]);return t}const $i=e=>{var t,n;return!!e&&((n=(t=e.items)==null?void 0:t[0])==null?void 0:n.id)===e.id},Ls=/^(oa:)?Annotation(Page|Collection)$/;class qe extends Error{constructor(){super(...arguments);oe(this,"name","CloverContentError")}}const Us="http://iiif.io/api/presentation/4/context.json",Fs=e=>/^https?:\/\//i.test(e);async function wt(e,{request:t,signal:n}){return Array.isArray(e.items)&&e.items.length>0||!e.id?e:await Se(t,e.id,n)}const Hs=50;async function Ut(e,t){const n=e;if(Array.isArray(n.items)&&n.items.length||!n.first)return e;const o=[],r=new Set;let s=n.first;for(let i=0;s&&i<Hs;i++){const a=typeof s=="string"?{id:s}:s;if(r.has(a.id??a))break;r.add(a.id??a);const c=a.items?a:await Se(t.request,a.id,t.signal),l=await ve({"@context":c["@context"]??n["@context"],...c,type:"Collection"});o.push(...l.items??[]),s=c.next}return{...n,items:o}}async function Fo(e,t={}){return ve(await wt(e,t))}async function Ho(e,t,n=0){for(const o of e.items??[]){if(o.type==="Manifest")return ve(await wt(o,t));if(o.type==="Collection"&&n<8){const r=await Ut(await ve(await wt(o,t)),t),s=await Ho(r,t,n+1);if(s)return s}}return null}async function Ds(e,{request:t,signal:n}={}){Lt();const o=typeof e=="string"?await Se(t,e.trim(),n):e,r=await ve(o);return r.type==="Collection"?Ut(r,{request:t,signal:n}):r}async function js(e,t={}){var u;const{request:n,signal:o}=t;Lt();let r,s,i,a,c;const l=async d=>{const{resolveContentState:v}=await Pn(),m=v(d);if(!m)throw new qe("Unreadable content state");return r=m.target??r,s=m.manifestId??s,i=m.annotation??i,a=m.targets??a,Se(n,m.id,o)};if(typeof e=="string")if(Fs(e.trim()))c=await Se(n,e.trim(),o);else{const{decodeContentState:d}=await Pn(),v=d(e);if(!v)throw new qe("Unreadable iiifContent");c=On(v)?await l(v):v}else c=e;if(On(c)&&(c=await l(c)),Ls.test(String((c==null?void 0:c.type)??""))){const{annotationsContent:d}=await import("./annotations-content-CEzAS-P2.mjs");return d(c,t)}const _=await ve(c);switch((u=o==null?void 0:o.throwIfAborted)==null||u.call(o),_.type){case"Manifest":return{manifest:_,target:r,annotation:i,targets:a};case"Collection":{const d=await Ut(_,t),v=t.manifestId??s,m=v?(d.items??[]).find(k=>k.id===v&&k.type==="Manifest"):void 0,I=m?await Fo(m,t):await Ho(d,t);if(!I)throw new qe("The Collection holds no Manifest");return{manifest:I,collection:d,target:r,annotation:i,targets:a}}case"Canvas":case"Timeline":case"Scene":{const d=_;return r??(r={canvasId:d.id}),{manifest:Rs(d),target:r,annotation:i}}default:throw new qe(`Cannot show a ${String(_.type??"resource without a type")}`)}}const Do=e=>!!(e!=null&&e.id)&&e.type==="AnnotationPage"&&!e.items;function An(e){const t=[];for(const n of e)for(const o of["items","annotations"])for(const r of n[o]??[])Do(r)&&t.push([n.id,o,r.id]);return t}async function Bs(e,t,n,o){return Ws(await Se(n,e,o),t)}async function Ws(e,t="urn:clover:annotation-page"){var r;const n=e;return Uo(n)?n:((r=(await ve({"@context":n["@context"]??"http://iiif.io/api/presentation/3/context.json",id:t,type:"Canvas",items:[{...n,"@context":void 0}]})).items)==null?void 0:r[0])??n}function Vs(e,t){const n=e,o=t,r=c=>Array.isArray(c)?c:c?[c]:[],s=r(n.partOf),i=r(o.partOf),a=[...s.map(c=>({...i.find(l=>l.id&&l.id===c.id),...c})),...i.filter(c=>!s.some(l=>l.id===c.id))];return{...e,...n.label===void 0&&o.label!==void 0&&{label:o.label},...a.length&&{partOf:a}}}function zs(e,t,n,o){let r=false;const s=(e.items??[]).map(i=>{if(i.id!==t||!Array.isArray(i[n]))return i;const a=i[n].map(c=>c.id!==o.id||!Do(c)?c:(r=true,Vs(o,c)));return r?{...i,[n]:a}:i});return r?{...e,items:s}:e}function qs(e){let t=e;const n=new Set;return{get:()=>t,set(o){const r=typeof o=="function"?o(t):o;Object.keys(r).some(i=>!Object.is(r[i],t[i]))&&(t={...t,...r},n.forEach(i=>i()))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function ge(e){let t=e;const n=new Set;return{get:()=>t,emit(o){t=o,n.forEach(r=>r(o))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function Js(e,t,n){return{position:t,total:n,hasPrevious:t>0,hasNext:t+1<n,previous:()=>e.previous(),next:()=>e.next(),first:()=>e.first(),last:()=>e.last(),goTo:o=>e.goTo(o)}}const St={query:"",status:"idle",hits:[],set:null},Mn={status:"idle",error:null,manifest:null,collection:null,throughCollection:false,canvasId:null,target:null,annotationId:null,hiddenSets:[],shownSets:[],addedSets:[],search:St,regions:null,targets:null,targetIndex:null};function Ks(e={}){const t=qs(Mn),n=ge(null),o=ge(null),r=ge(null),s=ge(null),i=ge(null),a=ge(null);let c=null,l=null,_=[],u=[],d=[],v=0,m=null,I=null,k=null;const C=(f,p)=>{!I||f===p||(I={...I,items:I.items.map(h=>h.manifestId===f&&h.manifestAs!==p?{...h,manifestAs:p}:h)})},b=f=>{var h;const p=(h=t.get().manifest)==null?void 0:h.id;return!!p&&(p===f.manifestId||p===f.manifestAs)},S=()=>_.length||u.length||d.length?[..._,...u,...d]:Mn.addedSets;let P=e.request,A=null;const F=new Set;let ie="view",B=0;const Y=(f,p,h)=>{if(F.has(h))return;F.add(h);const g=A==null?void 0:A.signal;Bs(h,f,P,g).then(y=>{g!=null&&g.aborted||t.set(O=>O.manifest?{manifest:zs(O.manifest,f,p,y)}:{})}).catch(()=>F.delete(h))},X=()=>{const{manifest:f,canvasId:p}=t.get();if(f)for(const[h,g,y]of An(ie==="all"||B>0?D(f).canvases:Ee(f,p)))Y(h,g,y)};t.subscribe(X);const H=(f,p,h,g,y)=>{var jt,Bt,Wt;const{canvases:O}=D(f),E=me=>!!me&&O.some(Vo=>Vo.id===me),T=hs(f),z=E(h==null?void 0:h.canvasId)?h:E(T==null?void 0:T.canvasId)?T:null,q=E(g.canvasId)?g.canvasId:(z==null?void 0:z.canvasId)??(E(g.defaultCanvasId)?g.defaultCanvasId:null)??((jt=O[0])==null?void 0:jt.id)??null;l==null||l.abort();const ne=y&&((Bt=lt(d,y))==null?void 0:Bt.canvasId)===q?y:null,he=z&&ne?{...z,region:void 0}:z,je=++v;_=[],t.set({status:"ready",search:St,regions:null,manifest:f,collection:p,canvasId:q,target:he&&he.canvasId===q?he:null,addedSets:S(),annotationId:ne,targets:I});const Dt=f==null?void 0:f.structures;Array.isArray(Dt)&&JSON.stringify(Dt).includes("xywh=")&&import("./range-regions-DAaOu0IS.mjs").then(({contentsSet:me})=>{v===je&&t.set({regions:me(f)})}),Cs(f)&&import("./image-layers-xcBsiad9.mjs").then(({imageLayers:me})=>{v===je&&(_=me(f),t.set({addedSets:S()}))}),q&&q!==g.canvasId&&((Wt=e.onCanvasChange)==null||Wt.call(e,q))},W=(f,p)=>t.set(h=>{const g=h.hiddenSets.filter(O=>O!==f),y=h.shownSets.filter(O=>O!==f);return p?{hiddenSets:g,shownSets:[...y,f]}:{hiddenSets:[...g,f],shownSets:y}}),ae=(f,p)=>{var g,y,O;if(!f)return;if((g=e.isControlled)!=null&&g.call(e)){p&&t.set({target:p}),(y=e.onCanvasChange)==null||y.call(e,f);return}const h=t.get().canvasId!==f;t.set({canvasId:f,target:p}),h&&((O=e.onCanvasChange)==null||O.call(e,f))},ce=(f,p=false)=>{const{manifest:h}=t.get(),g=vs(h,f);ae(g,g&&p?{canvasId:g,autoplay:p}:null)},ke=()=>{const{manifest:f,canvasId:p}=t.get();return{at:tt(f,p),total:D(f).views.length}},Oe=()=>{A==null||A.abort();const f=new AbortController;return A=f,F.clear(),t.set({status:"loading",error:null,annotationId:null}),f.signal},Fe=f=>t.set({status:"error",error:f instanceof Error?f:new Error(String(f))});async function He(f,p={}){var g;const h=Oe();try{const y=await js(f,{request:P,signal:h,manifestId:p.manifestId??void 0});if(h.aborted)return;const O=y.annotation,E=O?Eo({items:[O]},`${O.id}#content-state`):[];d=E.length?[{id:`${O.id}#content-state`,source:"added",entries:E}]:y.annotationSets??[];const T=m??((g=E[0])==null?void 0:g.id)??y.pick;m=null,t.set({throughCollection:!!y.collection}),I=y.targets??null,I&&C(I.items[0].manifestId,y.manifest.id),t.set({targetIndex:I?0:null}),H(y.manifest,y.collection??null,y.target,p,T)}catch(y){h.aborted||Fe(y)}}const Ie=f=>{const{manifest:p,collection:h}=t.get();return(p==null?void 0:p.id)===f||(h==null?void 0:h.id)===f},De=f=>{var p;return(((p=t.get().collection)==null?void 0:p.items)??[]).find(h=>h.id===f)??{id:f,type:"Manifest"}},V=(f,p)=>{var h,g;if(m=p,(h=e.isManifestControlled)!=null&&h.call(e)){(g=e.onManifestChange)==null||g.call(e,f);return}R({id:f,type:"Manifest"}).then(y=>{var O;return y&&((O=e.onManifestChange)==null?void 0:O.call(e,f))})},R=async(f,p)=>{if(f.type==="Collection")return await He(f.id),t.get().status==="ready";const{collection:h}=t.get(),g=Oe(),y=m;m=null;const O=y?lt(d,y):null,E=typeof p=="string"?{canvasId:p}:p??k;k=null;try{const T=await Fo(f,{request:P,signal:g});return g.aborted?false:(C(f.id,T.id),H(T,h,O?{canvasId:O.canvasId}:E??void 0,{},y),true)}catch(T){return g.aborted||Fe(T),false}};return{store:t,viewport:n,media:o,captions:r,highlight:s,chapter:i,found:a,get request(){return P},setRequest(f){P=f},load:He,async openCollection(f){var h;const p=t.get().manifest;if(!(!p||((h=t.get().collection)==null?void 0:h.id)===f))try{const g=await Ds(f,{request:P});if(g.type!=="Collection"||t.get().manifest!==p)return;t.set({collection:g})}catch{}},async goToManifest(f,p){var g,y,O;if(Ie(f))return;const h=De(f);if(h.type!=="Collection"&&((g=e.isManifestControlled)!=null&&g.call(e))){(y=e.onManifestChange)==null||y.call(e,f);return}await R(h,p)&&((O=e.onManifestChange)==null||O.call(e,t.get().manifest.id))},goToTarget(f){var g,y,O;const p=(g=t.get().targets)==null?void 0:g.items[f];if(!p)return;t.set({targetIndex:f});const h=p.canvasId?{canvasId:p.canvasId,...p.region&&{region:p.region},...p.time!==void 0&&{time:p.time}}:null;if(b(p)){h&&ae(h.canvasId,h);return}if((y=e.isManifestControlled)!=null&&y.call(e)){k=h,(O=e.onManifestChange)==null||O.call(e,p.manifestId);return}R(De(p.manifestId),h??void 0).then(E=>{var T;return E&&((T=e.onManifestChange)==null?void 0:T.call(e,p.manifestId))})},async syncManifest(f){!f||Ie(f)||t.get().status!=="ready"||await R(De(f))},goTo(f,p){ae(f,p?{...p,canvasId:f}:null)},next({autoplay:f=false,wrap:p=false}={}){const{at:h,total:g}=ke();h+1<g?ce(h+1,f):p&&g>1&&ce(0,f)},previous(){const{at:f}=ke();f>0&&ce(f-1)},first(){ce(0)},last(){ce(ke().total-1)},consumeTarget(){t.set({target:null})},syncCanvas(f){f&&t.set({canvasId:f})},selectAnnotation(f){const{manifest:p,addedSets:h,canvasId:g,search:y,regions:O}=t.get(),E=lt(Ps(p,h,y.set,O),f);if(t.set({annotationId:E?f:null}),!E)return;a.emit(f);const{hiddenSets:T,shownSets:z}=t.get();E.setId!==Mo&&Lo(p,h,T,z).includes(E.setId)&&W(E.setId,true);const q=Ee(p,g).some(je=>je.id===E.canvasId),ne=Ue(p,E.canvasId)!==null;!q&&ne&&ae(E.canvasId,null);const he=ne?void 0:Ms(E.annotation);he&&V(he,E.id)},async search(f){l==null||l.abort();const p=bs(t.get().manifest),h=f.trim();if(!h||!p){l=null,t.set({search:St,annotationId:null});return}const g=new AbortController;l=g,t.set(y=>({search:{...y.search,query:h,status:"loading"}}));try{const{searchInto:y}=await import("./search-5ocrsYmT.mjs");await y(t,p,h,P,g.signal)}catch{t.set({search:{query:h,status:"error",hits:[],set:null}})}},setSetVisible(f,p){W(f,p)},async loadAnnotations(f){if(c==null||c.abort(),!f){u=[],t.set({addedSets:S()});return}const p=new AbortController;c=p;try{const{loadAnnotationSets:h}=await import("./annotation-collection-BkC3nBPA.mjs"),g=await h(f,{request:P,signal:p.signal});if(p.signal.aborted)return;u=g,t.set({addedSets:S()})}catch{}},getContentState(){var q;const{manifest:f,canvasId:p}=t.get();if(!f||!p)return null;const h=n.get(),g=o.get(),y=g&&g.currentTime>0?g.currentTime:null,O=Ee(f,p),T=h&&O.some(ne=>ne.id===h.canvasId)&&!y?h:null,z=(T==null?void 0:T.canvasId)??p;return Ts({manifestId:f.id,canvasId:z,type:(q=O.find(ne=>ne.id===z))==null?void 0:q.type,region:T==null?void 0:T.region,time:y})},setAnnotationPages(f){f!==ie&&(ie=f,X())},fetchAnnotationPages(f){const{manifest:p}=t.get();if(!p||!f.length)return;const h=new Set(f);for(const[g,y,O]of An(D(p).canvases))h.has(O)&&Y(g,y,O)},holdAllAnnotationPages(){B++,X();let f=true;return()=>{f&&B--,f=false}},dispose(){A==null||A.abort(),c==null||c.abort(),l==null||l.abort()}}}function Gs({clover:e,language:t}){const{t:n,langOf:o}=ko(),[r,s]=ee(null),i=U(n);return i.current=n,L(()=>{let a=null;return e.store.subscribe(()=>{const{manifest:c,canvasId:l,status:_}=e.store.get();if(_!=="ready"||l===a)return;const u=a===null;if(a=l,u)return;const d=Ue(c,l),v=Po(d==null?void 0:d.label,t),m=i.current("canvasPosition",{index:tt(c,l)+1,total:D(c).views.length});s({label:v.text,lang:v.lang,position:m})})},[e,t]),$("div",{className:"clover-announcer",role:"status","aria-live":"polite","aria-atomic":"true",style:ms,children:[r!=null&&r.label?$(Z,{children:[$("span",{...dn(r.lang),children:r.label}),","," "]}):null,r&&$("span",{...dn(o("canvasPosition")),children:r.position})]})}const Zs=100;function Ys(e,t){const n=U({read:e,onChange:t});n.current={read:e,onChange:t};const o=U(void 0),r=U("");return L(()=>()=>{clearTimeout(o.current),o.current=void 0},[]),pe(()=>{!n.current.onChange||o.current!==void 0||(o.current=setTimeout(()=>{var i,a;o.current=void 0;const s=n.current.read();!s||s.encoded===r.current||(r.current=s.encoded,(a=(i=n.current).onChange)==null||a.call(i,s))},Zs))},[])}function En(e,t){return e==null||e.addEventListener("pause",t),e==null||e.addEventListener("seeked",t),()=>{e==null||e.removeEventListener("pause",t),e==null||e.removeEventListener("seeked",t)}}function Xs(e,t){const n=Ys(()=>e.getContentState(),t),o=!!t;L(()=>{if(!o)return;let r=e.store.get().canvasId;const s=e.store.subscribe(()=>{const l=e.store.get().canvasId;l!==r&&(r=l,n())}),i=e.viewport.subscribe(n);let a=En(e.media.get(),n);const c=e.media.subscribe(l=>{a(),a=En(l,n)});return n(),()=>{s(),i(),c(),a()}},[e,o,n])}function Ri(e){return e.flatMap(t=>Qr(t).map(({body:n})=>n))}function Li(e,t){if(!(e!=null&&e.length)||!t.canvases.length)return null;const n=t.canvases.map(r=>r.id),o=t.bodies.map(r=>r==null?void 0:r.format).filter(Boolean);return e.find(r=>{var s,i,a;return((s=r.canvasId)==null?void 0:s.some(c=>n.includes(c)))||((i=r.format)==null?void 0:i.some(c=>o.includes(c)))||!!((a=r.match)!=null&&a.call(r,t))})??null}function Qs(e,t){return e===t?true:!e||!t||e.length!==t.length?false:e.every((n,o)=>n.component===t[o].component&&n.match===t[o].match&&JSON.stringify([n.canvasId,n.format])===JSON.stringify([t[o].canvasId,t[o].format]))}function ei({iiifContent:e,canvasId:t,defaultCanvasId:n,onCanvasChange:o,onStatusChange:r,manifestId:s,defaultManifestId:i,onManifestChange:a,searchQuery:c,request:l,language:_,renderers:u,annotations:d,annotationPages:v="view",onContentStateChange:m,...I}){const k=t!==void 0,C=s!==void 0,b=U({controlled:k,manifestControlled:C,onCanvasChange:o,onStatusChange:r,onManifestChange:a});b.current={controlled:k,manifestControlled:C,onCanvasChange:o,onStatusChange:r,onManifestChange:a};const[S]=ee(()=>Ks({request:l,onCanvasChange:V=>{var R,f;return(f=(R=b.current).onCanvasChange)==null?void 0:f.call(R,V)},onManifestChange:V=>{var R,f;return(f=(R=b.current).onManifestChange)==null?void 0:f.call(R,V)},isControlled:()=>b.current.controlled,isManifestControlled:()=>b.current.manifestControlled}));S.setRequest(l);const P=U({});P.current={canvasId:t,defaultCanvasId:n,manifestId:s??i};const A=Zr(l),F=U(e);F.current=e;const ie=oi(e);L(()=>(S.load(F.current,P.current),()=>S.dispose()),[S,ie,A]),L(()=>{k&&S.syncCanvas(t??null)},[S,k,t]);const[B,Y]=ee(S.store.get().status);L(()=>{let V=S.store.get().status;return S.store.subscribe(()=>{var p,h;const{status:R,error:f}=S.store.get();R!==V&&(V=R,Y(R),(h=(p=b.current).onStatusChange)==null||h.call(p,R,f))})},[S]);const X=U(d);X.current=d;const H=ni(d);L(()=>{S.loadAnnotations(X.current??null)},[S,H,A]),L(()=>{S.setAnnotationPages(v)},[S,v]),Xs(S,m),L(()=>{C&&B==="ready"&&S.syncManifest(s??null)},[S,C,s,B]);const W=ti(S,V=>{var R;return V.status==="ready"?((R=V.manifest)==null?void 0:R.id)??null:null});L(()=>{c&&W&&S.search(c)},[S,c,W]);const ae=U(u);Qs(ae.current,u)||(ae.current=u);const ce=ae.current,[ke,Oe]=ee(),[Fe,He]=ee(_);Fe!==_&&(He(_),Oe(void 0));const Ie=ke??_;return[de(()=>({clover:S,language:Ie,renderers:ce,chooseLanguage:Oe}),[S,Ie,ce]),B,I]}function ti(e,t){return fe(e.store.subscribe,()=>t(e.store.get()))}function ni(e){const t=Array.isArray(e)?e:e?[e]:[];return JSON.stringify(t.map(n=>typeof n=="string"?n:(n==null?void 0:n.id)??"object"))}function oi(e){return typeof e=="string"?e:e.id??e["@id"]??e}const ut=new Map;function Ui(e,t){const n=Hr(),o=U(t);o.current=t,L(()=>e?jo(n,o):void 0,[e,n])}function jo(e,t){for(const[n,o]of[...ut])n!==e&&o.current();return ut.set(e,t),()=>{ut.delete(e)}}let ri=0;const si=e=>jo(`page-${ri+=1}`,{current:e}),Tn=new WeakMap;function ii(e,t){const[n,o]=ee(()=>Tn.get(e)??null);return L(()=>{if(!t||n)return;let r=true;return e().then(s=>{Tn.set(e,s),r&&o(()=>s)},()=>{}),()=>{r=false}},[e,t,n]),n}function Fi(e){const t=Math.max(0,Math.floor(e||0)),n=Math.floor(t/3600),o=Math.floor(t%3600/60),r=String(t%60).padStart(2,"0");return n?`${n}:${String(o).padStart(2,"0")}:${r}`:`${o}:${r}`}function Hi(e,t){var n;if(e.currentTime=t,!!e.paused)try{(n=e.play())==null||n.catch(()=>{})}catch{}}function Ft(e){if(!e)return;const[t,n]=e.split(","),o=Number(t);if(t===""||Number.isNaN(o))return;if(n===void 0||n==="")return{start:o};const r=Number(n);return Number.isNaN(r)?{start:o}:{start:o,end:r}}function Ht(e){if(typeof e=="string")return Nn(e);const t=e;return(t==null?void 0:t.type)==="SpecificResource"?t:typeof(t==null?void 0:t.id)=="string"?Nn(t.id):t}const Nn=e=>e.replace(/\/((?:t|xywh)=[^/#]*)$/,"#$1");function Bo(e){const t=x(e.thumbnail)[0];return t&&typeof t=="object"?{thumbnail:t}:{}}const $n=new WeakMap,Rn=[];function ai(e,t,n){if(!e||!t)return Rn;let o=$n.get(e);o||$n.set(e,o=new Map);const r=`${t}|${n??""}`,s=o.get(r);if(s)return s;const i=[],a=new Set,c=_=>{if(!_||a.has(_.id??_))return;a.add(_.id??_);const u=!x(_.behavior).includes("no-nav");for(const d of x(_.items)){if((d==null?void 0:d.type)==="Range"){c(d);continue}if(!u)continue;const v=et(Ht(d));if(v.id.split("#")[0]!==t)continue;const m=Ft(v.t);m&&i.push({..._.id?{id:_.id}:{},label:_.label,...m,...Bo(_)})}};for(const _ of x(e.structures))c(_);i.sort((_,u)=>_.start-u.start);const l=i.length?i.map((_,u)=>{var d;return{..._,end:_.end??((d=i[u+1])==null?void 0:d.start)??n}}):Rn;return o.set(r,l),l}const Ln=new WeakMap,Un=[];function Wo(e){if(!e)return Un;const t=Ln.get(e);if(t)return t;const n=new Map(x(e.items).map((c,l)=>[c==null?void 0:c.id,l])),o=new Set,r=c=>{var b,S;if(!c||o.has(c.id??c))return[];o.add(c.id??c);const l=[],_=[],u=[];let d;for(const P of x(c.items))if((P==null?void 0:P.type)==="Range"){const A=r(P);l.push(...A),A.forEach(F=>_.push(...F.canvasIds))}else{const A=et(Ht(P));if(!A.id)continue;d??(d=A),_.push(A.id),u.push(A)}const v=x(c.behavior);if(v.includes("no-nav"))return l;const m=d??void 0,I={id:c.id??`range-${o.size}`,label:c.label,canvasId:(m==null?void 0:m.id)??((b=l[0])==null?void 0:b.canvasId),canvasIds:[...new Set(_)],...v.includes("sequence")?{sequence:true}:{},...Bo(c),children:l},k=Ft(m==null?void 0:m.t);return k?I.time=k:!m&&((S=l[0])!=null&&S.time)&&(I.time=l[0].time),m!=null&&m.rect&&(I.region=m.rect),(v.includes("sequence")&&u.length>1&&!u.some(P=>P.t)||ci(u,n))&&(I.parts=u.map(P=>({canvasId:P.id,...P.rect?{region:P.rect}:{}}))),[I]},s=x(e.structures).flatMap(r),i=s.length===1&&s[0].children.length?s[0].children:s,a=i.length?i:Un;return Ln.set(e,a),a}function ci(e,t){return!e.length||e.some(n=>n.t)?false:e.some(n=>n.rect)?true:e.some((n,o)=>o>0&&t.get(n.id)!==(t.get(e[o-1].id)??NaN)+1)}function li(e,t,n,o){let r=null,s=null;const i=(l,_,u)=>!l||u>l.depth||u===l.depth&&!(l.sequence&&_.sequence),a=(l,_,u)=>{const d=u||l.id===o;if(t&&l.canvasIds.includes(t)&&(!l.time||n!==void 0&&n>=l.time.start&&(l.time.end===void 0||n<l.time.end))){const m={id:l.id,depth:_,...l.sequence?{sequence:true}:{}};i(r,l,_)&&(r=m),d&&i(s,l,_)&&(s=m)}l.children.forEach(v=>a(v,_+1,d))};e.forEach(l=>a(l,0,false));const c=s??r;return c?c.id:null}const Di=Object.freeze(Object.defineProperty({__proto__:null,chaptersOf:ai,currentContents:li,parseTime:Ft,rangeItemTarget:Ht,tableOfContents:Wo},Symbol.toStringTag,{value:"Module"}));Ce(30,"components/Label/Label","@layer clover{.clover-label{text-wrap:balance}}");Ce(31,"components/Status/Status","@layer clover{.clover-status{margin:0;padding:var(--clover-space-m);color:var(--clover-color-primary-muted, #26292b)}.clover-status[data-status=loading]{display:flex}.clover-status[data-status=error] p{margin:0}.clover-status-detail{font-size:var(--clover-text-s)}}");const ji=()=>import("./controls-CC9G5LxK.mjs"),ui=()=>import("./renderers-BFS7hFVU.mjs");function Bi(e){te(()=>()=>e==null?void 0:e(null),[e])}function fi(e,t,n){const o=()=>e.store.get();return{get state(){return o()},subscribe(r){return e.store.subscribe(()=>r(o()))},get language(){return t()},status(){const{status:r,error:s}=o();return{status:r,error:s}},manifest(){return o().manifest},sequence(){return D(o().manifest)},visibleCanvases(){return Ee(o().manifest,o().canvasId)},activeCanvas(){return Ue(o().manifest,o().canvasId)},navigation(){const{manifest:r,canvasId:s}=o();return Js(e,tt(r,s),D(r).views.length)},annotationSets(){return nt(o().manifest,o().addedSets)},annotationCollection(){return ks(o().manifest,o().addedSets)},contents(){return Wo(o().manifest)},localize(r){return Po(r,t())},t(r,s){return j.t(r,s,K)},langOf(r){return j.langOf(r,n(),K)},oneOpen(r){return si(r)}}}function _i(e,t,n){return Object.defineProperties(Object.create(e),Object.getOwnPropertyDescriptors(fi(e,t,n)))}const di=Le(null);function pi({hosted:e,props:t,children:n}){const o=ii(ui,!!t.renderers);return!t.iiifContent||t.renderers&&!o?null:$(vi,{element:e.element,props:t,toRenderers:o==null?void 0:o.toRenderers,children:n})}function vi({element:e,props:t,toRenderers:n,children:o}){const{canvasId:r,manifestId:s,lang:i,onReady:a,renderers:c,...l}=t,_=os(void 0,i);_.ref(e);const u=de(()=>n==null?void 0:n(c),[n,c]),[d,v]=ei({...l,defaultCanvasId:r,defaultManifestId:s,renderers:u}),{clover:m,language:I}=d,k=U({language:I,host:_.hostLanguage});k.current={language:I,host:_.hostLanguage};const C=de(()=>_i(m,()=>k.current.language,()=>k.current.host),[m]);return te(()=>(a==null||a(C),()=>a==null?void 0:a(null)),[C,a]),Fn(m,r,b=>m.goTo(b)),Fn(m,s,b=>void m.goToManifest(b)),te(()=>(e.classList.add("clover-root"),()=>e.classList.remove("clover-root")),[e]),te(()=>{e.setAttribute("data-status",v)},[e,v]),te(()=>()=>e.removeAttribute("data-status"),[e]),$(Qe.Provider,{value:d,children:$(Rt.Provider,{value:_.hostLanguage,children:$(di.Provider,{value:C,children:[o,Tt($(Gs,{clover:m,language:I}),e)]})})})}function Fn(e,t,n){const o=U(t);L(()=>{t&&t!==o.current&&n(t),o.current=t},[e,t])}const Wi=Object.freeze(Object.defineProperty({__proto__:null,RootElement:pi},Symbol.toStringTag,{value:"Module"}));export{Tt as $,U as A,Ft as B,fe as C,_r as D,Hi as E,D as F,Ms as G,Wn as H,Pi as I,Wo as J,li as K,Mi as L,bs as M,Ko as N,Ci as O,Ke as P,Le as Q,yi as R,x as S,de as T,Mo as U,Zo as V,$i as W,ki as X,Si as Y,Ue as Z,te as _,ko as a,wi as a0,Gr as a1,os as a2,ss as a3,Ys as a4,En as a5,Rt as a6,Ts as a7,Xr as a8,et as a9,xs as aA,qe as aB,di as aC,Ds as aD,_s as aE,Oo as aF,ys as aG,js as aH,gi as aI,bi as aJ,Di as aK,Wi as aL,Io as aa,Oi as ab,Ui as ac,Qr as ad,Ai as ae,Js as af,ks as ag,tt as ah,Fi as ai,ei as aj,Gs as ak,Qe as al,Ii as am,Ps as an,ai as ao,Ni as ap,No as aq,Fo as ar,j as as,Kr as at,Zr as au,ws as av,Ht as aw,Eo as ax,Se as ay,Ws as az,Hr as b,xi as c,ee as d,ts as e,ii as f,ui as g,Bi as h,ji as i,Xs as j,Z as k,dn as l,Li as m,Ee as n,Lo as o,Ri as p,pe as q,Ei as r,Ti as s,Po as t,$ as u,ms as v,lt as w,ue as x,L as y,vr as z};
@@ -1 +1 @@
1
- import{E as n}from"./shared-MTsMddHx.mjs";function f(a,e){const s=a.store.get().manifest;if(e.canvasId&&n(s).canvases.some(t=>t.id===e.canvasId))a.goTo(e.canvasId);else if(e.manifestId&&e.manifestId!==(s==null?void 0:s.id))a.goToManifest(e.manifestId,e.canvasId);else return false;return true}export{f as s};
1
+ import{F as n}from"./shared-DFAX0n3B.mjs";function f(a,e){const s=a.store.get().manifest;if(e.canvasId&&n(s).canvases.some(t=>t.id===e.canvasId))a.goTo(e.canvasId);else if(e.manifestId&&e.manifestId!==(s==null?void 0:s.id))a.goToManifest(e.manifestId,e.canvasId);else return false;return true}export{f as s};
@@ -1 +1 @@
1
- import{i as l}from"./imageService-0eTvQ-3h.mjs";function s(t,g,e){const a=(h,d)=>Math.min(Math.max(Math.round(h),0),d),m=e?a(e.x*t.width,t.width-1):0,w=e?a(e.y*t.height,t.height-1):0,i={x:m,y:w,width:e?Math.max(1,a(e.width*t.width,t.width-m)):t.width,height:e?Math.max(1,a(e.height*t.height,t.height-w)):t.height},x=i.width===t.width&&i.height===t.height;if(!x&&!t.regionByPx)return null;if(t.sizeByW){let h=Math.min(1,g/Math.max(i.width,i.height));return t.maxWidth&&(h=Math.min(h,t.maxWidth/i.width)),t.maxHeight&&(h=Math.min(h,t.maxHeight/i.height)),t.maxArea&&(h=Math.min(h,Math.sqrt(t.maxArea/(i.width*i.height)))),l(t,i,Math.max(1,Math.floor(i.width*h)),Math.max(1,Math.floor(i.height*h)))}if(!x)return null;const M=[...t.sizes].sort((h,d)=>h.width-d.width),r=M.find(h=>Math.max(h.width,h.height)>=g)??M.at(-1)??{width:t.width,height:t.height};return l(t,i,r.width,r.height)}export{s};
1
+ import{i as l}from"./imageService-4sFnmAFX.mjs";function s(t,g,e){const a=(h,d)=>Math.min(Math.max(Math.round(h),0),d),m=e?a(e.x*t.width,t.width-1):0,w=e?a(e.y*t.height,t.height-1):0,i={x:m,y:w,width:e?Math.max(1,a(e.width*t.width,t.width-m)):t.width,height:e?Math.max(1,a(e.height*t.height,t.height-w)):t.height},x=i.width===t.width&&i.height===t.height;if(!x&&!t.regionByPx)return null;if(t.sizeByW){let h=Math.min(1,g/Math.max(i.width,i.height));return t.maxWidth&&(h=Math.min(h,t.maxWidth/i.width)),t.maxHeight&&(h=Math.min(h,t.maxHeight/i.height)),t.maxArea&&(h=Math.min(h,Math.sqrt(t.maxArea/(i.width*i.height)))),l(t,i,Math.max(1,Math.floor(i.width*h)),Math.max(1,Math.floor(i.height*h)))}if(!x)return null;const M=[...t.sizes].sort((h,d)=>h.width-d.width),r=M.find(h=>Math.max(h.width,h.height)>=g)??M.at(-1)??{width:t.width,height:t.height};return l(t,i,r.width,r.height)}export{s};
@@ -1 +1 @@
1
- var R=Object.defineProperty;var C=(n,e,t)=>e in n?R(n,e,{enumerable:true,configurable:true,writable:true,value:t}):n[e]=t;var w=(n,e,t)=>C(n,typeof e!="symbol"?e+"":e,t);import{_ as p,C as H,a as B,d as F,A as Z,u as _}from"./shared-MTsMddHx.mjs";import{r as M,w as $,c as A,l as q,t as G,n as j,h as D,a as J}from"./splitting-BnQUxxgH.mjs";import{T as Q}from"./Tip-BbexILXs.mjs";import"./styles-CZV1nbBQ.mjs";class U{constructor(e){w(this,"sizes");w(this,"listeners",new Set);w(this,"subscribe",e2=>(this.listeners.add(e2),()=>{this.listeners.delete(e2)}));this.storageKey=e,this.sizes=M(e)}keyed(e){e!==this.storageKey&&(this.storageKey=e,this.sizes=M(e),this.listeners.forEach(t=>t()))}set(e,t){const o={...this.sizes};t===void 0?delete o[e]:o[e]=Math.round(t),this.sizes=o,$(this.storageKey,o),this.listeners.forEach(l=>l())}}const P=new WeakMap;function S(n){let e=P.get(n);return e||(e=new U(n.getAttribute("storage-key")??void 0),P.set(n,e)),e}const V={},X=()=>()=>{},N=n=>{var e;return((e=n.parentElement)==null?void 0:e.localName)==="clover-split"?n.parentElement:null},v=n=>n==null||n.trim()===""?void 0:/^\d+(\.\d+)?$/.test(n.trim())?Number(n):n.trim();function W(n){const e={};for(const t of T(n))e[t.dataset.splitKey??""]={size:v(t.getAttribute("size")),min:v(t.getAttribute("min")),max:v(t.getAttribute("max"))};return e}const T=n=>[...n.children].filter(e=>e.localName==="clover-split-pane");function ie({hosted:n,props:e}){const t=n.element;return p(()=>(t.classList.add("clover-split"),()=>t.classList.remove("clover-split")),[t]),p(()=>{S(t).keyed(e.storageKey)},[t,e.storageKey]),null}function re({hosted:n,props:e}){const t=n.element,o=N(t),l=o?S(o):null,f=H((l==null?void 0:l.subscribe)??X,()=>(l==null?void 0:l.sizes)??V),h=v(e.size),i=v(e.min),c=v(e.max),u=e.name||String(o?T(o).indexOf(t):0),a=f[u];return p(()=>(t.classList.add("clover-split-pane"),()=>t.classList.remove("clover-split-pane")),[t]),p(()=>{t.dataset.splitKey=u,t.toggleAttribute("data-sized",h!==void 0),t.style.minWidth=A(i)??"0";const g=a!==void 0?`${a}px`:A(h);g?t.style.setProperty("--clover-split-size",g):t.style.removeProperty("--clover-split-size");const d=A(c);d?t.style.setProperty("--clover-split-max",d):t.style.removeProperty("--clover-split-max")},[t,u,h,i,c,a]),null}const K=new WeakMap;function oe({hosted:n}){const e=n.element,{t,langOf:o}=B(),[l]=F(()=>{const i=e.getAttribute("aria-label");return i!==null&&i!==K.get(e)?i:null}),f=l??t("splitHandle");p(()=>(e.classList.add("clover-split-handle"),e.setAttribute("role","separator"),e.setAttribute("aria-orientation","vertical"),e.hasAttribute("tabindex")||(e.tabIndex=0),()=>e.classList.remove("clover-split-handle")),[e]),p(()=>{if(l)return;e.setAttribute("aria-label",f),K.set(e,f);const i=o("splitHandle");i?e.setAttribute("lang",i):e.removeAttribute("lang")},[e,l,f,o]);const h=Z(null);return p(()=>{const i=N(e);if(!i)return;const c=S(i),y=s=>Math.round(s/(i.clientWidth||1)*100),u=(s,r)=>{e.setAttribute("aria-valuenow",String(y(s))),e.setAttribute("aria-valuemin",String(y(r.min))),e.setAttribute("aria-valuemax",String(y(r.max)))},a=()=>q(e,i,W(i)),g=s=>{const r=a();if(!r)return;const z=Math.min(r.max,Math.max(r.min,s));c.set(r.key,z),u(z,r)};h.current={limits:a,resize:g,step:()=>{var L;const s=a();if(!s)return;const r=G((L=W(i)[s.key])==null?void 0:L.size,i.clientWidth),z=j(s,r,c.sizes[s.key]);if(!z.own)return g(z.to);c.set(s.key,void 0),u(r,s)}};const d=()=>{const s=a();s&&u(s.sized.getBoundingClientRect().width,s)};d();const b=typeof ResizeObserver>"u"?null:new ResizeObserver(d);b==null||b.observe(i);const I=c.subscribe(()=>requestAnimationFrame(d));let x=false;const k=()=>{var r;const s=!!((r=J(e).sized)!=null&&r.hidden);s&&!e.hidden?e.hidden=x=true:!s&&x&&(x=false,e.hidden=false)};k();const E=new MutationObserver(()=>{k(),d()});E.observe(i,{attributes:true,subtree:true,attributeFilter:["hidden","data-sized"]});const m=D(()=>e,()=>h.current),O=[["pointerdown",s=>m.down(s)],["pointermove",s=>m.move(s)],["pointerup",s=>m.up(s)],["pointercancel",s=>m.up(s)],["click",s=>m.click(s)],["keydown",s=>m.key(s)]];for(const[s,r]of O)e.addEventListener(s,r);return()=>{for(const[s,r]of O)e.removeEventListener(s,r);m.dispose(),b==null||b.disconnect(),E.disconnect(),I()}},[e]),_(Q,{label:f})}export{ie as SplitElement,oe as SplitHandleElement,re as SplitPaneElement};
1
+ var R=Object.defineProperty;var C=(n,e,t)=>e in n?R(n,e,{enumerable:true,configurable:true,writable:true,value:t}):n[e]=t;var w=(n,e,t)=>C(n,typeof e!="symbol"?e+"":e,t);import{_ as p,C as H,a as B,d as F,A as Z,u as _}from"./shared-DFAX0n3B.mjs";import{r as M,w as $,c as A,l as q,t as G,n as j,h as D,a as J}from"./splitting-BnQUxxgH.mjs";import{T as Q}from"./Tip-nJSTYquc.mjs";import"./styles-BwkYiCLC.mjs";class U{constructor(e){w(this,"sizes");w(this,"listeners",new Set);w(this,"subscribe",e2=>(this.listeners.add(e2),()=>{this.listeners.delete(e2)}));this.storageKey=e,this.sizes=M(e)}keyed(e){e!==this.storageKey&&(this.storageKey=e,this.sizes=M(e),this.listeners.forEach(t=>t()))}set(e,t){const o={...this.sizes};t===void 0?delete o[e]:o[e]=Math.round(t),this.sizes=o,$(this.storageKey,o),this.listeners.forEach(l=>l())}}const P=new WeakMap;function S(n){let e=P.get(n);return e||(e=new U(n.getAttribute("storage-key")??void 0),P.set(n,e)),e}const V={},X=()=>()=>{},N=n=>{var e;return((e=n.parentElement)==null?void 0:e.localName)==="clover-split"?n.parentElement:null},v=n=>n==null||n.trim()===""?void 0:/^\d+(\.\d+)?$/.test(n.trim())?Number(n):n.trim();function W(n){const e={};for(const t of T(n))e[t.dataset.splitKey??""]={size:v(t.getAttribute("size")),min:v(t.getAttribute("min")),max:v(t.getAttribute("max"))};return e}const T=n=>[...n.children].filter(e=>e.localName==="clover-split-pane");function ie({hosted:n,props:e}){const t=n.element;return p(()=>(t.classList.add("clover-split"),()=>t.classList.remove("clover-split")),[t]),p(()=>{S(t).keyed(e.storageKey)},[t,e.storageKey]),null}function re({hosted:n,props:e}){const t=n.element,o=N(t),l=o?S(o):null,f=H((l==null?void 0:l.subscribe)??X,()=>(l==null?void 0:l.sizes)??V),h=v(e.size),i=v(e.min),c=v(e.max),u=e.name||String(o?T(o).indexOf(t):0),a=f[u];return p(()=>(t.classList.add("clover-split-pane"),()=>t.classList.remove("clover-split-pane")),[t]),p(()=>{t.dataset.splitKey=u,t.toggleAttribute("data-sized",h!==void 0),t.style.minWidth=A(i)??"0";const g=a!==void 0?`${a}px`:A(h);g?t.style.setProperty("--clover-split-size",g):t.style.removeProperty("--clover-split-size");const d=A(c);d?t.style.setProperty("--clover-split-max",d):t.style.removeProperty("--clover-split-max")},[t,u,h,i,c,a]),null}const K=new WeakMap;function oe({hosted:n}){const e=n.element,{t,langOf:o}=B(),[l]=F(()=>{const i=e.getAttribute("aria-label");return i!==null&&i!==K.get(e)?i:null}),f=l??t("splitHandle");p(()=>(e.classList.add("clover-split-handle"),e.setAttribute("role","separator"),e.setAttribute("aria-orientation","vertical"),e.hasAttribute("tabindex")||(e.tabIndex=0),()=>e.classList.remove("clover-split-handle")),[e]),p(()=>{if(l)return;e.setAttribute("aria-label",f),K.set(e,f);const i=o("splitHandle");i?e.setAttribute("lang",i):e.removeAttribute("lang")},[e,l,f,o]);const h=Z(null);return p(()=>{const i=N(e);if(!i)return;const c=S(i),y=s=>Math.round(s/(i.clientWidth||1)*100),u=(s,r)=>{e.setAttribute("aria-valuenow",String(y(s))),e.setAttribute("aria-valuemin",String(y(r.min))),e.setAttribute("aria-valuemax",String(y(r.max)))},a=()=>q(e,i,W(i)),g=s=>{const r=a();if(!r)return;const z=Math.min(r.max,Math.max(r.min,s));c.set(r.key,z),u(z,r)};h.current={limits:a,resize:g,step:()=>{var L;const s=a();if(!s)return;const r=G((L=W(i)[s.key])==null?void 0:L.size,i.clientWidth),z=j(s,r,c.sizes[s.key]);if(!z.own)return g(z.to);c.set(s.key,void 0),u(r,s)}};const d=()=>{const s=a();s&&u(s.sized.getBoundingClientRect().width,s)};d();const b=typeof ResizeObserver>"u"?null:new ResizeObserver(d);b==null||b.observe(i);const I=c.subscribe(()=>requestAnimationFrame(d));let x=false;const k=()=>{var r;const s=!!((r=J(e).sized)!=null&&r.hidden);s&&!e.hidden?e.hidden=x=true:!s&&x&&(x=false,e.hidden=false)};k();const E=new MutationObserver(()=>{k(),d()});E.observe(i,{attributes:true,subtree:true,attributeFilter:["hidden","data-sized"]});const m=D(()=>e,()=>h.current),O=[["pointerdown",s=>m.down(s)],["pointermove",s=>m.move(s)],["pointerup",s=>m.up(s)],["pointercancel",s=>m.up(s)],["click",s=>m.click(s)],["keydown",s=>m.key(s)]];for(const[s,r]of O)e.addEventListener(s,r);return()=>{for(const[s,r]of O)e.removeEventListener(s,r);m.dispose(),b==null||b.disconnect(),E.disconnect(),I()}},[e]),_(Q,{label:f})}export{ie as SplitElement,oe as SplitHandleElement,re as SplitPaneElement};
@@ -1 +1 @@
1
- import{u as o}from"./shared-MTsMddHx.mjs";import{S as m}from"./Status-Dww3Pyf4.mjs";import{a,C as i}from"./nodes-CTw9OqlA.mjs";function u({hosted:r,props:t}){const e=a(r.element,"loading"),n=a(r.element,"error");return o(m,{...t,loading:e?o(i,{of:e}):t.loading,error:n?()=>o(i,{of:n}):void 0})}export{u as StatusElement};
1
+ import{u as o}from"./shared-DFAX0n3B.mjs";import{S as m}from"./Status-DHTzuTkh.mjs";import{a,C as i}from"./nodes-BleXuYE6.mjs";function u({hosted:r,props:t}){const e=a(r.element,"loading"),n=a(r.element,"error");return o(m,{...t,loading:e?o(i,{of:e}):t.loading,error:n?()=>o(i,{of:n}):void 0})}export{u as StatusElement};