@nulib/clover 4.5.2 → 4.5.4

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 (274) hide show
  1. package/dist/components/Annotations/Annotations.mjs +1 -1
  2. package/dist/components/Canvas/AnnotationState.mjs +1 -1
  3. package/dist/components/Canvas/CanvasView.mjs +4 -1
  4. package/dist/components/Canvas/Connected.mjs +3 -1
  5. package/dist/components/Canvas/layout.mjs +10 -3
  6. package/dist/components/Canvas/media/MediaBody.mjs +11 -1
  7. package/dist/components/Canvas/media/useCaptionTracks.mjs +3 -3
  8. package/dist/components/Panel/Panel.mjs +1 -1
  9. package/dist/components/Transcript/Transcript.mjs +12 -5
  10. package/dist/core/annotation-sets.mjs +5 -4
  11. package/dist/core/clover.mjs +2 -1
  12. package/dist/core/language-choice.mjs +1 -9
  13. package/dist/core/search-service.mjs +0 -2
  14. package/dist/core/search-set-id.mjs +5 -0
  15. package/dist/core/search.mjs +1 -1
  16. package/dist/i18n/languages.mjs +7 -0
  17. package/dist/index.d.mts +8 -4
  18. package/dist/index.mjs +2 -1
  19. package/dist/react/readingLanguages.mjs +2 -2
  20. package/dist/styles/core.css +1 -1
  21. package/dist/styles/default.css +1 -1
  22. package/dist/styles.css +1 -1
  23. package/dist/templates.css +1 -1
  24. package/dist/web-components/{About-CQxtgS3v.mjs → About-DCeIMPXs.mjs} +1 -1
  25. package/dist/web-components/AnnotationItems-vokjqFpJ.mjs +1 -0
  26. package/dist/web-components/{AnnotationMenu-Byf1nA-O.mjs → AnnotationMenu-n8wZulkI.mjs} +1 -1
  27. package/dist/web-components/AnnotationState-DJSkyiw0.mjs +1 -0
  28. package/dist/web-components/{Annotations-BznHfXJT.mjs → Annotations-CgPEcwft.mjs} +1 -1
  29. package/dist/web-components/{Annotations-0gzRTwNG.mjs → Annotations-D2Iy6k3X.mjs} +2 -2
  30. package/dist/web-components/{Body-Do9PiELy.mjs → Body-h5ykt3jO.mjs} +1 -1
  31. package/dist/web-components/{BodyAlert-CpsyVtYl.mjs → BodyAlert-COFJjxVV.mjs} +1 -1
  32. package/dist/web-components/{Button-DqfkGSl5.mjs → Button-CgTdpmNf.mjs} +1 -1
  33. package/dist/web-components/{Camera-bs3W3OK0.mjs → Camera-i2fafLIh.mjs} +1 -1
  34. package/dist/web-components/{Canvas2DBackend-9VTWQiW6.mjs → Canvas2DBackend-C2AYDVCI.mjs} +1 -1
  35. package/dist/web-components/{CanvasView-m9ooNUhD.mjs → CanvasView-uvJ5kDYN.mjs} +2 -2
  36. package/dist/web-components/{CaptionDetails-yyxvF-_h.mjs → CaptionDetails-m7amd8MS.mjs} +1 -1
  37. package/dist/web-components/{ChaptersMenu-DCyICayx.mjs → ChaptersMenu-6dDzuI0m.mjs} +1 -1
  38. package/dist/web-components/{Chevron-DpLzbCaE.mjs → Chevron-DVax9RTn.mjs} +1 -1
  39. package/dist/web-components/{ChoiceMenu-_z-WmYj6.mjs → ChoiceMenu-DH4n5jdL.mjs} +1 -1
  40. package/dist/web-components/Collection-CCjFTuVG.mjs +1 -0
  41. package/dist/web-components/{CollectionSelect-vO2qCVbK.mjs → CollectionSelect-0wNC970P.mjs} +1 -1
  42. package/dist/web-components/Connected-CGF0cSzv.mjs +1 -0
  43. package/dist/web-components/{Connected-wXkAqvjL.mjs → Connected-Cr4h-tHh.mjs} +1 -1
  44. package/dist/web-components/{Connected-DdmRznGj.mjs → Connected-CssvezHA.mjs} +1 -1
  45. package/dist/web-components/{Contents-Bfmghfq-.mjs → Contents-Cs7_X8jD.mjs} +1 -1
  46. package/dist/web-components/{ControlMenu-BaBwqPBx.mjs → ControlMenu-J-gMDza-.mjs} +1 -1
  47. package/dist/web-components/ControlsFade-BDjMo25i.mjs +1 -0
  48. package/dist/web-components/{CountMenu-mvPiRqfS.mjs → CountMenu--Z7rGivu.mjs} +1 -1
  49. package/dist/web-components/Cue-BzhK_KTz.mjs +1 -0
  50. package/dist/web-components/Document-D5r6QJ9F.mjs +1 -0
  51. package/dist/web-components/{DomLayers-B4wyEylP.mjs → DomLayers-6wCUT5ap.mjs} +1 -1
  52. package/dist/web-components/{Download-DPJ0jEM8.mjs → Download-Cff-mZmi.mjs} +1 -1
  53. package/dist/web-components/{EntryBodies-BeD_WacH.mjs → EntryBodies-D2OorCCX.mjs} +1 -1
  54. package/dist/web-components/{EntryThumbnail-Cs_9m02f.mjs → EntryThumbnail-iY1cnsAP.mjs} +1 -1
  55. package/dist/web-components/{FieldPill-3OFVRLOg.mjs → FieldPill-Swznzuhd.mjs} +1 -1
  56. package/dist/web-components/FrameAnimation-CjHUil6t.mjs +1 -0
  57. package/dist/web-components/{Gallery-Bt8ZE7KN.mjs → Gallery-CCKnJzQY.mjs} +1 -1
  58. package/dist/web-components/{GlobeGlyph-BcR00ptO.mjs → GlobeGlyph-D_ZaGUO8.mjs} +1 -1
  59. package/dist/web-components/{HideToggle-CzoPlLH7.mjs → HideToggle-D_n5lwkp.mjs} +1 -1
  60. package/dist/web-components/{ImageControls-6aS0WiPB.mjs → ImageControls-Dk8F5lUA.mjs} +1 -1
  61. package/dist/web-components/{Items-Cylhcqm3.mjs → Items-CbO0GqAH.mjs} +1 -1
  62. package/dist/web-components/Label-jKQGRD5d.mjs +1 -0
  63. package/dist/web-components/{LanguageChoice-I2zbqR8s.mjs → LanguageChoice-e7MGPRCd.mjs} +1 -1
  64. package/dist/web-components/{LanguageMenu-D7wMhxR_.mjs → LanguageMenu-BsWzKg__.mjs} +1 -1
  65. package/dist/web-components/{LightboxView-P-bt35KW.mjs → LightboxView-BjJ20ylQ.mjs} +1 -1
  66. package/dist/web-components/{ListEnd-Ch79vv6H.mjs → ListEnd-BXjH6six.mjs} +1 -1
  67. package/dist/web-components/{Loaded-nfW9JcE1.mjs → Loaded-CL-mpRHG.mjs} +1 -1
  68. package/dist/web-components/LoadedCanvas-juLvz5vu.mjs +1 -0
  69. package/dist/web-components/LoadedMap-CowAds3f.mjs +1 -0
  70. package/dist/web-components/{Loading-27_CRfmr.mjs → Loading-DGPqbYw2.mjs} +1 -1
  71. package/dist/web-components/{Map-VBS7o7LM.mjs → Map-0ImX0W-q.mjs} +1 -1
  72. package/dist/web-components/MapView-B-etTZqp.mjs +3 -0
  73. package/dist/web-components/{Markup-zy52Xoel.mjs → Markup-D5v_pfK-.mjs} +1 -1
  74. package/dist/web-components/{MediaBody-CMOc8TAG.mjs → MediaBody-BBu6nfi8.mjs} +1 -1
  75. package/dist/web-components/MediaBody-CU6BHhYo.mjs +1 -0
  76. package/dist/web-components/{NavDate-Hjz-ZUV8.mjs → NavDate-CJkis3CR.mjs} +1 -1
  77. package/dist/web-components/{Navigator-B-vYs2Cu.mjs → Navigator-CHoyJlHU.mjs} +1 -1
  78. package/dist/web-components/{Pager-DtwQLNol.mjs → Pager-CObS0xYo.mjs} +1 -1
  79. package/dist/web-components/PagerLayout-DEwXb6TF.mjs +1 -0
  80. package/dist/web-components/{Panel-DrIRuV4y.mjs → Panel-CyP3eeQ5.mjs} +1 -1
  81. package/dist/web-components/PanelPart-DzeT8Atv.mjs +1 -0
  82. package/dist/web-components/{PanelToggle-CXt2QzGI.mjs → PanelToggle-CxkqIgxi.mjs} +1 -1
  83. package/dist/web-components/{PartOfManifest-D5WYs-Kh.mjs → PartOfManifest-Cn_HgJ7I.mjs} +1 -1
  84. package/dist/web-components/{Pending-DRm1E_06.mjs → Pending-DI4VIePO.mjs} +1 -1
  85. package/dist/web-components/{PlaceBox-tTnsemz1.mjs → PlaceBox-CHl0X25c.mjs} +1 -1
  86. package/dist/web-components/{Placeholder-B8Y0k5OK.mjs → Placeholder-Cg3ByN0S.mjs} +1 -1
  87. package/dist/web-components/{Position-bBjejirV.mjs → Position-DMsgzBqP.mjs} +1 -1
  88. package/dist/web-components/Primitives-7dLlwNwr.mjs +1 -0
  89. package/dist/web-components/Provider-YGHeWGVP.mjs +1 -0
  90. package/dist/web-components/{ReadMore-EjrUmbD0.mjs → ReadMore-D80et8BG.mjs} +1 -1
  91. package/dist/web-components/Root-CUaKZDXj.mjs +1 -0
  92. package/dist/web-components/Scene-B9X0CUW5.mjs +1 -0
  93. package/dist/web-components/{SceneView-B38QNUQr.mjs → SceneView-CunAaAoN.mjs} +1 -1
  94. package/dist/web-components/{Search-D5f3L4Mi.mjs → Search-C3LFmKil.mjs} +1 -1
  95. package/dist/web-components/{Sections-kRJ1okE8.mjs → Sections-BT3WtluQ.mjs} +1 -1
  96. package/dist/web-components/{SeekMarks-DqKFHbLX.mjs → SeekMarks-DazilTox.mjs} +1 -1
  97. package/dist/web-components/StandaloneItems-8zvqQ2eQ.mjs +1 -0
  98. package/dist/web-components/{Status-CjtyBONJ.mjs → Status-CvunwdwM.mjs} +1 -1
  99. package/dist/web-components/{Steps-BEkT1NQg.mjs → Steps-Cw27EFcs.mjs} +1 -1
  100. package/dist/web-components/{TargetItems-Itkqt2Tb.mjs → TargetItems-_jmvEEEp.mjs} +1 -1
  101. package/dist/web-components/Timeline-CKGsgOW4.mjs +1 -0
  102. package/dist/web-components/{Tip-ByWHicZ5.mjs → Tip-DxvfQm-l.mjs} +1 -1
  103. package/dist/web-components/Transcript-C7pTS92q.mjs +1 -0
  104. package/dist/web-components/{Transport-C1bwJBQM.mjs → Transport-K0u9YhmA.mjs} +1 -1
  105. package/dist/web-components/{Transport-DXc48Ck8.mjs → Transport-hORVpyCc.mjs} +1 -1
  106. package/dist/web-components/{annotation-collection-x1YCBmx8.mjs → annotation-collection-y13MLLGX.mjs} +1 -1
  107. package/dist/web-components/{annotation-name-dLmSFXbG.mjs → annotation-name-U_Yiz_CP.mjs} +1 -1
  108. package/dist/web-components/{annotations-content-C0p3XB-1.mjs → annotations-content-B6PtnG5P.mjs} +1 -1
  109. package/dist/web-components/{body-DhIi0tSa.mjs → body-Eiq36Gou.mjs} +1 -1
  110. package/dist/web-components/{canvas-BMBhMAO5.mjs → canvas-CDjBaQ75.mjs} +1 -1
  111. package/dist/web-components/{cloverEngine-CgwMyPTV.mjs → cloverEngine-65MawacL.mjs} +1 -1
  112. package/dist/web-components/{content-state-reader-DYl2djp5.mjs → content-state-reader-CY-uQUXA.mjs} +1 -1
  113. package/dist/web-components/{controlGlyphs-CAs5NitM.mjs → controlGlyphs-BI3qUN6D.mjs} +1 -1
  114. package/dist/web-components/{controls-BFETnZ7b.mjs → controls-Cc5LuT8p.mjs} +1 -1
  115. package/dist/web-components/{downloads-Dxku671h.mjs → downloads-Pq5Aedpe.mjs} +1 -1
  116. package/dist/web-components/{dragToClose-BJ07Mayh.mjs → dragToClose-DBlTMmyC.mjs} +1 -1
  117. package/dist/web-components/{engine-zjivMDZQ.mjs → engine-BHQWLVxn.mjs} +1 -1
  118. package/dist/web-components/{engines-DdvyIGhW.mjs → engines-BnPu5Ggs.mjs} +1 -1
  119. package/dist/web-components/{fetchManifest-J64cuwEZ.mjs → fetchManifest-BKGaZzDw.mjs} +1 -1
  120. package/dist/web-components/{fromManifest-BByCRrb9.mjs → fromManifest-qxJrEfn6.mjs} +1 -1
  121. package/dist/web-components/{glyphs-3j_wsdG0.mjs → glyphs-PlEEwLrB.mjs} +1 -1
  122. package/dist/web-components/{hooks-uHKfYuKB.mjs → hooks--n9dMuHb.mjs} +1 -1
  123. package/dist/web-components/image-layers-BLqN0BKU.mjs +1 -0
  124. package/dist/web-components/{image-service-content-BzLp6nth.mjs → image-service-content-DHDgPYBV.mjs} +1 -1
  125. package/dist/web-components/{imageService-BIVE0K1I.mjs → imageService-DfXP25SW.mjs} +1 -1
  126. package/dist/web-components/{index-CjNkvvfl.mjs → index-BjpZQ9J-.mjs} +1 -1
  127. package/dist/web-components/index.mjs +1 -1
  128. package/dist/web-components/{items-DDv9RUBA.mjs → items-BwKkJEOS.mjs} +1 -1
  129. package/dist/web-components/items-Hk3_LJmo.mjs +1 -0
  130. package/dist/web-components/label-CGhzU3ki.mjs +1 -0
  131. package/dist/web-components/layout-DbMbjpx4.mjs +1 -0
  132. package/dist/web-components/{link-BiM9KdpG.mjs → link-BIc77IY3.mjs} +1 -1
  133. package/dist/web-components/logo-BV7vGA6L.mjs +1 -0
  134. package/dist/web-components/{models-CObUKgMl.mjs → models-BXBEOLKe.mjs} +1 -1
  135. package/dist/web-components/{nodes-BJ4P1NTa.mjs → nodes-BWN5jzoG.mjs} +1 -1
  136. package/dist/web-components/{overlayImage-lYLaIThc.mjs → overlayImage-jvgcflf8.mjs} +1 -1
  137. package/dist/web-components/{panel-CoYAVlbj.mjs → panel-BW39vvfB.mjs} +1 -1
  138. package/dist/web-components/part-C9K_lQE1.mjs +1 -0
  139. package/dist/web-components/{playerSurface-DuHYLLBb.mjs → playerSurface-PBbBGoj5.mjs} +1 -1
  140. package/dist/web-components/{pointer--iHWeLVV.mjs → pointer-DsqyiOIC.mjs} +1 -1
  141. package/dist/web-components/{provider-DcsevgMJ.mjs → provider-Dg6Gi5Ft.mjs} +1 -1
  142. package/dist/web-components/{range-regions-Bnyl9SWk.mjs → range-regions-BmSXWBAS.mjs} +1 -1
  143. package/dist/web-components/{read-more-C9PqroD1.mjs → read-more-BstyFDUC.mjs} +1 -1
  144. package/dist/web-components/readingLanguages-BY2NUfQE.mjs +1 -0
  145. package/dist/web-components/{rendererSurface-BAvGJcFy.mjs → rendererSurface-AGFetq7k.mjs} +2 -2
  146. package/dist/web-components/{renderers-DGfMWk93.mjs → renderers-BjtPgVnV.mjs} +1 -1
  147. package/dist/web-components/{resource-Dt6dILeb.mjs → resource-i359_a15.mjs} +1 -1
  148. package/dist/web-components/{save-file-DzI4VfDl.mjs → save-file-nlQm0Sup.mjs} +1 -1
  149. package/dist/web-components/{search-DLXYDW3B.mjs → search-BPTt1eUz.mjs} +1 -1
  150. package/dist/web-components/shared-Cqxks7jF.mjs +1 -0
  151. package/dist/web-components/{show-link-DRW4U86r.mjs → show-link-DwefC5LJ.mjs} +1 -1
  152. package/dist/web-components/{sizedImage-Bb488in6.mjs → sizedImage-BBoqi5ZU.mjs} +1 -1
  153. package/dist/web-components/{split-BSvilwgY.mjs → split-DqzkMVr3.mjs} +1 -1
  154. package/dist/web-components/{status-DCylOE_H.mjs → status-BSpwZ8rO.mjs} +1 -1
  155. package/dist/web-components/{styles-Cm1KSkd5.mjs → styles-C9QeBpjd.mjs} +1 -1
  156. package/dist/web-components/three.mjs +1 -1
  157. package/dist/web-components/{thumbnail-IWjwr85c.mjs → thumbnail-Ckf6EotT.mjs} +1 -1
  158. package/dist/web-components/{tip-XxruPb74.mjs → tip-DTTyG5KI.mjs} +1 -1
  159. package/dist/web-components/{toggle-Bm06TZio.mjs → toggle-DAC1XODI.mjs} +1 -1
  160. package/dist/web-components/{useContainerName-jjktq7OB.mjs → useContainerName-D_XCWIWP.mjs} +1 -1
  161. package/dist/web-components/{useControlsVisibility-K1HUKs93.mjs → useControlsVisibility-CIjHTnaa.mjs} +1 -1
  162. package/dist/web-components/{useNearViewport-DpYbV4NQ.mjs → useNearViewport-B5E-oZb_.mjs} +1 -1
  163. package/dist/web-components/{useScrollTrack-Cy6z-b7G.mjs → useScrollTrack-C2xSfGF6.mjs} +1 -1
  164. package/dist/web-components/viewer/{AnnotationItems-BnihkLNH.mjs → AnnotationItems-B16qAKiN.mjs} +1 -1
  165. package/dist/web-components/viewer/{AnnotationMenu-Dha0gE5m.mjs → AnnotationMenu-DgJSq4fy.mjs} +1 -1
  166. package/dist/web-components/viewer/AnnotationState-YuVCBM29.mjs +1 -0
  167. package/dist/web-components/viewer/{Annotations-CW-BFATW.mjs → Annotations-Cq5fXZrj.mjs} +1 -1
  168. package/dist/web-components/viewer/{Annotations-DuWIPFH3.mjs → Annotations-DYkHWOeR.mjs} +2 -2
  169. package/dist/web-components/viewer/{Canvas2DBackend-mmhuXqdi.mjs → Canvas2DBackend-DvKFoHuh.mjs} +1 -1
  170. package/dist/web-components/viewer/{CaptionDetails-DA6_oiQF.mjs → CaptionDetails-DxTKPbOM.mjs} +1 -1
  171. package/dist/web-components/viewer/{ChaptersMenu-C2WL8jFt.mjs → ChaptersMenu-BC3qFrhN.mjs} +1 -1
  172. package/dist/web-components/viewer/{ChoiceMenu-QB_5keQb.mjs → ChoiceMenu-DXBx-fGv.mjs} +1 -1
  173. package/dist/web-components/viewer/{Collection-D5a6WYZI.mjs → Collection-CeCEHMv-.mjs} +1 -1
  174. package/dist/web-components/viewer/{Connected-Di1-LIOg.mjs → Connected-CEraiqd1.mjs} +1 -1
  175. package/dist/web-components/viewer/{Connected-C1NtY97-.mjs → Connected-DakTdEny.mjs} +1 -1
  176. package/dist/web-components/viewer/{Contents-BzTwcDZy.mjs → Contents-DOuB3pTB.mjs} +1 -1
  177. package/dist/web-components/viewer/{ControlMenu-CxmfQ8Cm.mjs → ControlMenu-CBb7ZoP6.mjs} +1 -1
  178. package/dist/web-components/viewer/ControlsFade-WJ98Wqju.mjs +1 -0
  179. package/dist/web-components/viewer/{CountMenu-CgQWpBDd.mjs → CountMenu-WadMuI5T.mjs} +1 -1
  180. package/dist/web-components/viewer/Cue-BF5ZjVa8.mjs +1 -0
  181. package/dist/web-components/viewer/{Document-DId3Ww6w.mjs → Document-DfRQ7S0l.mjs} +1 -1
  182. package/dist/web-components/viewer/{DomLayers-D6T0qkEm.mjs → DomLayers-uwjfbBsp.mjs} +1 -1
  183. package/dist/web-components/viewer/{Download-Cj4jZnPF.mjs → Download-C1nPhWlq.mjs} +1 -1
  184. package/dist/web-components/viewer/{EntryBodies-JslI0mKb.mjs → EntryBodies-EWZ8rnB_.mjs} +1 -1
  185. package/dist/web-components/viewer/{EntryThumbnail-CHc7jDuf.mjs → EntryThumbnail-BGpml8t4.mjs} +1 -1
  186. package/dist/web-components/viewer/{FieldPill-CeO1-KpF.mjs → FieldPill-KWuDZTXX.mjs} +1 -1
  187. package/dist/web-components/viewer/{FrameAnimation-CCXxhEGY.mjs → FrameAnimation-ChvHbIgp.mjs} +1 -1
  188. package/dist/web-components/viewer/{Gallery-CLw13i4w.mjs → Gallery-DAal6sgL.mjs} +1 -1
  189. package/dist/web-components/viewer/{GlobeGlyph-XyW874Xa.mjs → GlobeGlyph-ByDERN9z.mjs} +1 -1
  190. package/dist/web-components/viewer/{HideToggle-CbduRY6y.mjs → HideToggle-C-gM8Mk8.mjs} +1 -1
  191. package/dist/web-components/viewer/{ImageControls-BlpTLXbh.mjs → ImageControls-B2aR8D82.mjs} +1 -1
  192. package/dist/web-components/viewer/{LanguageChoice-D26bb87S.mjs → LanguageChoice-CbcBytbo.mjs} +1 -1
  193. package/dist/web-components/viewer/{LanguageMenu-ECLF6mSI.mjs → LanguageMenu-D_tV0uO9.mjs} +1 -1
  194. package/dist/web-components/viewer/{LightboxView-CFvsyP57.mjs → LightboxView-C_Ofd0zk.mjs} +1 -1
  195. package/dist/web-components/viewer/{ListEnd-BbZ0cF34.mjs → ListEnd-DN2oUjyx.mjs} +1 -1
  196. package/dist/web-components/viewer/{MapView-DJ0uaPAX.mjs → MapView-C0qrLqaP.mjs} +2 -2
  197. package/dist/web-components/viewer/MediaBody-CfnBYVg-.mjs +1 -0
  198. package/dist/web-components/viewer/{MediaBody-BgBDbfHg.mjs → MediaBody-CnKOjrdE.mjs} +1 -1
  199. package/dist/web-components/viewer/{NavDate-1vpKxZK1.mjs → NavDate-NJcjaWOv.mjs} +1 -1
  200. package/dist/web-components/viewer/{Navigator-CSlUlVI-.mjs → Navigator-DRRodGLA.mjs} +1 -1
  201. package/dist/web-components/viewer/{PagerLayout-CeqR69iN.mjs → PagerLayout-Dgbs71Hu.mjs} +1 -1
  202. package/dist/web-components/viewer/PanelPart-BibD4mAY.mjs +1 -0
  203. package/dist/web-components/viewer/{PartOfManifest-BBTld3mZ.mjs → PartOfManifest-f8ZMHngG.mjs} +1 -1
  204. package/dist/web-components/viewer/{PlaceBox-jyu7a0on.mjs → PlaceBox-CamClgeV.mjs} +1 -1
  205. package/dist/web-components/viewer/{Placeholder-CedWZbsU.mjs → Placeholder-D7t4rsFp.mjs} +1 -1
  206. package/dist/web-components/viewer/{Search-D_hveAZH.mjs → Search-CednujgR.mjs} +1 -1
  207. package/dist/web-components/viewer/{SeekMarks-YIQFWYfI.mjs → SeekMarks-gvJ2UZoh.mjs} +1 -1
  208. package/dist/web-components/viewer/{StandaloneItems-DcLGj-VV.mjs → StandaloneItems-DkquLq5p.mjs} +1 -1
  209. package/dist/web-components/viewer/{Steps-BLXeVvHo.mjs → Steps-CFmYNpo3.mjs} +1 -1
  210. package/dist/web-components/viewer/{TargetItems-BNor7HFs.mjs → TargetItems-CfLAMuj8.mjs} +1 -1
  211. package/dist/web-components/viewer/Transcript-_eA-Dm0M.mjs +1 -0
  212. package/dist/web-components/viewer/{Transport-DFssphP9.mjs → Transport-5jVVRct0.mjs} +1 -1
  213. package/dist/web-components/viewer/{Transport-C_pFOBzJ.mjs → Transport-B4K4XAF-.mjs} +1 -1
  214. package/dist/web-components/viewer/{annotation-collection-BLtyEjru.mjs → annotation-collection-DBuApZiI.mjs} +1 -1
  215. package/dist/web-components/viewer/{annotation-name-mRcTA1c1.mjs → annotation-name-C-CMfd6g.mjs} +1 -1
  216. package/dist/web-components/viewer/{annotations-content-DBQgx1j7.mjs → annotations-content-D8UWdcFt.mjs} +1 -1
  217. package/dist/web-components/viewer/{cloverEngine-BF_4X8lm.mjs → cloverEngine-CKfaQ-Wc.mjs} +1 -1
  218. package/dist/web-components/viewer/{content-state-reader-Bmd-lwNd.mjs → content-state-reader-BvfAdXET.mjs} +1 -1
  219. package/dist/web-components/viewer/{dragToClose-aeU6bjg0.mjs → dragToClose-DDJ3XwRu.mjs} +1 -1
  220. package/dist/web-components/viewer/{fetchManifest-D3mfpSBh.mjs → fetchManifest-pVcLruTs.mjs} +1 -1
  221. package/dist/web-components/viewer/{host-DKJIdeDV.mjs → host-BbYrtAtM.mjs} +1 -1
  222. package/dist/web-components/viewer/{image-layers-CwutsuDL.mjs → image-layers-D0QWXFeZ.mjs} +1 -1
  223. package/dist/web-components/viewer/{image-service-content-DUG6BXnh.mjs → image-service-content-ClTuuZ5p.mjs} +1 -1
  224. package/dist/web-components/viewer/index.mjs +1 -1
  225. package/dist/web-components/viewer/{link-BUSPRbyE.mjs → link-CE5biAiK.mjs} +1 -1
  226. package/dist/web-components/viewer/{overlayImage-D8N9rwQF.mjs → overlayImage-ykHbPvnH.mjs} +1 -1
  227. package/dist/web-components/viewer/{range-regions-D4lx-cRg.mjs → range-regions-DD-NwcwE.mjs} +1 -1
  228. package/dist/web-components/viewer/{renderers-CFKRycnu.mjs → renderers-N8qGiR4Q.mjs} +1 -1
  229. package/dist/web-components/viewer/{save-file-D8fcn3qy.mjs → save-file-Bczd1gGN.mjs} +1 -1
  230. package/dist/web-components/viewer/{search-CXoMviyv.mjs → search--UfJW1mN.mjs} +1 -1
  231. package/dist/web-components/viewer/{styles-BjjJM8OS.mjs → styles-LW5XsRcK.mjs} +1 -1
  232. package/dist/web-components/viewer/{useControlsVisibility-nGLR8EFY.mjs → useControlsVisibility-B1Ag1zm_.mjs} +1 -1
  233. package/dist/web-components/viewer/viewer-DL8dyfj_.mjs +29 -0
  234. package/dist/web-components/viewer/{vtt-CMfIBDAL.mjs → vtt-U7j7H25c.mjs} +1 -1
  235. package/dist/web-components/{viewer-FSKFHjRd.mjs → viewer-CkXVnqu5.mjs} +1 -1
  236. package/dist/web-components/{vtt-COiqtr-4.mjs → vtt-Di31JcWg.mjs} +1 -1
  237. package/package.json +1 -1
  238. package/dist/web-components/AnnotationItems-CcK8lOdr.mjs +0 -1
  239. package/dist/web-components/AnnotationState-idcYZf3N.mjs +0 -1
  240. package/dist/web-components/Collection-Kwdu1S-6.mjs +0 -1
  241. package/dist/web-components/Connected-1kdGMIWC.mjs +0 -1
  242. package/dist/web-components/ControlsFade-BJe8pU1f.mjs +0 -1
  243. package/dist/web-components/Cue-DKACn0J1.mjs +0 -1
  244. package/dist/web-components/Document-CPD-9KDe.mjs +0 -1
  245. package/dist/web-components/FrameAnimation-2B6rRU4W.mjs +0 -1
  246. package/dist/web-components/Label-DHHchol3.mjs +0 -1
  247. package/dist/web-components/LoadedCanvas-Bfrvk-Yt.mjs +0 -1
  248. package/dist/web-components/LoadedMap-BaakosFd.mjs +0 -1
  249. package/dist/web-components/MapView-D-RJ69f2.mjs +0 -3
  250. package/dist/web-components/MediaBody-Bh8301OV.mjs +0 -1
  251. package/dist/web-components/PagerLayout-D10GPTRD.mjs +0 -1
  252. package/dist/web-components/PanelPart-xW94FuNJ.mjs +0 -1
  253. package/dist/web-components/Primitives-PRo4k-fb.mjs +0 -1
  254. package/dist/web-components/Provider-CrpDmnzZ.mjs +0 -1
  255. package/dist/web-components/Root-DK9ssTa2.mjs +0 -1
  256. package/dist/web-components/Scene-DYbvcQXW.mjs +0 -1
  257. package/dist/web-components/StandaloneItems-C2e9PPxg.mjs +0 -1
  258. package/dist/web-components/Timeline-g0fwghKo.mjs +0 -1
  259. package/dist/web-components/Transcript-CsQ9bYfS.mjs +0 -1
  260. package/dist/web-components/image-layers-BCWDCZEA.mjs +0 -1
  261. package/dist/web-components/items-Bc1JPQjI.mjs +0 -1
  262. package/dist/web-components/label-CS0CGhZ5.mjs +0 -1
  263. package/dist/web-components/layout-CdBuqKxn.mjs +0 -1
  264. package/dist/web-components/logo-CFz7_HVm.mjs +0 -1
  265. package/dist/web-components/part-cbvAb44O.mjs +0 -1
  266. package/dist/web-components/readingLanguages-BB0nHlI0.mjs +0 -1
  267. package/dist/web-components/shared-DJyYaNgB.mjs +0 -1
  268. package/dist/web-components/viewer/AnnotationState-fj1N93ri.mjs +0 -1
  269. package/dist/web-components/viewer/ControlsFade-BVpQ-3q7.mjs +0 -1
  270. package/dist/web-components/viewer/Cue-DuP2wssL.mjs +0 -1
  271. package/dist/web-components/viewer/MediaBody-CSzkjuJn.mjs +0 -1
  272. package/dist/web-components/viewer/PanelPart-BCQo2YZ-.mjs +0 -1
  273. package/dist/web-components/viewer/Transcript-Crl3zPhV.mjs +0 -1
  274. package/dist/web-components/viewer/viewer-4EayGlH3.mjs +0 -29
@@ -1,4 +1,4 @@
1
- var Et=Object.defineProperty;var kt=(n,t,e)=>t in n?Et(n,t,{enumerable:true,configurable:true,writable:true,value:e}):n[t]=e;var h=(n,t,e)=>kt(n,typeof t!="symbol"?t+"":t,e);import{c as Lt,r as $}from"./contexts-ByL3eA_T.mjs";import{c as k,s as L,t as _,a as _t,u as mt,i as Pt,b as pt,d as gt,e as It,r as At,f as A,g as St}from"./CanvasView-m9ooNUhD.mjs";import{a as S,w as Rt,v as N,f as Bt,s as Q,b as j,c as Ot}from"./Camera-bs3W3OK0.mjs";import{i as J,a as Ct,T as zt,b as tt,c as et,D as Ut,s as Dt}from"./pointer--iHWeLVV.mjs";import{a2 as Wt,a3 as Ft}from"./shared-DJyYaNgB.mjs";import{a as Ht,i as it,f as Nt}from"./imageService-BIVE0K1I.mjs";function Zt(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement?n.complete&&n.naturalWidth>0:true}function Gt(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 Xt=`#version 300 es
1
+ var Et=Object.defineProperty;var kt=(n,t,e)=>t in n?Et(n,t,{enumerable:true,configurable:true,writable:true,value:e}):n[t]=e;var h=(n,t,e)=>kt(n,typeof t!="symbol"?t+"":t,e);import{c as Lt,r as $}from"./contexts-ByL3eA_T.mjs";import{c as k,s as L,t as _,a as _t,u as mt,i as Pt,b as pt,d as gt,e as It,r as At,f as A,g as St}from"./CanvasView-uvJ5kDYN.mjs";import{a as S,w as Rt,v as N,f as Bt,s as Q,b as j,c as Ot}from"./Camera-i2fafLIh.mjs";import{i as J,a as Ct,T as zt,b as tt,c as et,D as Ut,s as Dt}from"./pointer-DsqyiOIC.mjs";import{a3 as Wt,a4 as Ft}from"./shared-Cqxks7jF.mjs";import{a as Ht,i as it,f as Nt}from"./imageService-DfXP25SW.mjs";function Zt(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement?n.complete&&n.naturalWidth>0:true}function Gt(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 Xt=`#version 300 es
2
2
  in vec2 a_position;
3
3
  uniform mat3 u_matrix;
4
4
  uniform vec4 u_crop;
@@ -19,4 +19,4 @@ out vec4 outColor;
19
19
  void main() {
20
20
  outColor = texture(u_texture, v_uv) * u_opacity;
21
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=Vt(e,Xt,Kt);this.program=s,this.uniforms={matrix:e.getUniformLocation(s,"u_matrix"),crop:e.getUniformLocation(s,"u_crop"),opacity:e.getUniformLocation(s,"u_opacity"),texture:e.getUniformLocation(s,"u_texture")};const o=e.createVertexArray();e.bindVertexArray(o);const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),e.STATIC_DRAW);const a=e.getAttribLocation(s,"a_position");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,false,0,0),e.bindVertexArray(null),this.vao=o,e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),t.addEventListener("webglcontextlost",this.handleLost)}static create(t,e={}){let i=null;try{i=t.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{i=null}if(!i||typeof i.createShader!="function")return null;try{return new 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)),o=Math.max(1,Math.round(e*i));this.canvas.width!==s&&(this.canvas.width=s),this.canvas.height!==o&&(this.canvas.height=o)}begin(){if(this.isLost)return;const t=this.gl;t.viewport(0,0,this.canvas.width,this.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(this.program),t.bindVertexArray(this.vao),t.activeTexture(t.TEXTURE0),t.uniform1i(this.uniforms.texture,0)}draw(t){if(this.isLost||!Zt(t.source))return"skipped";const e=this.gl,i=this.upload(t);if(i==="tainted")return"tainted";if(!i)return"skipped";const s=t.crop??{x:0,y:0,width:t.width,height:t.height},o=Gt(t,this.pixelRatio),r=k(t.transform,_(s.x,s.y),L(s.width+o.x,s.height+o.y));return e.uniformMatrix3fv(this.uniforms.matrix,false,_t(r,this.cssWidth,this.cssHeight,this.matrixScratch)),e.uniform4f(this.uniforms.crop,s.x/t.width,s.y/t.height,s.width/t.width,s.height/t.height),e.uniform1f(this.uniforms.opacity,t.opacity),e.bindTexture(e.TEXTURE_2D,i.texture),e.drawArrays(e.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(t){return!this.isLost&&this.textures.has(t)}release(t){const e=this.textures.get(t);e&&(this.isLost||this.gl.deleteTexture(e.texture),this.textures.delete(t))}dispose(){var t;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const e of[...this.textures.keys()])this.release(e);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(t=this.gl.getExtension("WEBGL_lose_context"))==null||t.loseContext(),this.isLost=true}upload(t){const e=this.gl,i=this.textures.get(t.key);if(i&&i.width===t.width&&i.height===t.height)return i;const s=(i==null?void 0:i.texture)??e.createTexture();if(!s)return null;e.bindTexture(e.TEXTURE_2D,s);try{e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source)}catch(r){if(i||e.deleteTexture(s),qt(r))return"tainted";throw r}e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const o={texture:s,width:t.width,height:t.height};return this.textures.set(t.key,o),o}}function Vt(n,t,e){const i=st(n,n.VERTEX_SHADER,t),s=st(n,n.FRAGMENT_SHADER,e),o=n.createProgram();if(!o)throw new Error("Could not create WebGL program");if(n.attachShader(o,i),n.attachShader(o,s),n.linkProgram(o),n.deleteShader(i),n.deleteShader(s),!n.getProgramParameter(o,n.LINK_STATUS)){const r=n.getProgramInfoLog(o);throw n.deleteProgram(o),new Error(`Could not link WebGL program: ${r}`)}return o}function st(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 qt(n){return typeof n=="object"&&n!==null&&n.name==="SecurityError"}const Yt=.09,$t=1e-4,nt=.05,Qt=1e-4;class jt{constructor(t,e=Yt,i){h(this,"current");h(this,"target",null);h(this,"timeConstant");h(this,"spring");h(this,"start");h(this,"elapsed",0);this.current={...t},this.start={...t},this.timeConstant=e,this.spring=i}get destination(){return this.target?{...this.target.state}:{...this.current}}set(t){this.current={...t},this.target=null}animateTo(t,e,i=false){const s=this.spring?this.spring.duration<=0:this.timeConstant===0;if(i||s){this.set(t.state);return}let o=t.anchor;if(o){const r=S(o.world,o.screen,t.state.zoom,t.state.rotation,e);Math.hypot(r.x-t.state.x,r.y-t.state.y)*t.state.zoom>nt&&(o=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...t.state},anchor:o}}stop(){this.target=null}step(t,e){const i=this.target;if(!i)return false;const s=i.state;let o,r;if(this.spring){this.elapsed+=Math.max(t,0);const m=this.elapsed/this.spring.duration;if(m>=1)return this.current={...s},this.target=null,false;const c=this.spring.stiffness;o=this.start,r=(1-Math.exp(-c*m))/(1-Math.exp(-c))}else o=this.current,r=1-Math.exp(-Math.max(t,0)/this.timeConstant);const a=Math.exp(Math.log(o.zoom)+(Math.log(s.zoom)-Math.log(o.zoom))*r),d=o.rotation+(s.rotation-o.rotation)*r,l=i.anchor?S(i.anchor.world,i.anchor.screen,a,d,e):{x:o.x+(s.x-o.x)*r,y:o.y+(s.y-o.y)*r};return this.current={x:l.x,y:l.y,zoom:a,rotation:d},this.spring?true:Math.abs(Math.log(s.zoom/a))<$t&&Math.abs(s.rotation-d)<Qt&&Math.hypot(s.x-l.x,s.y-l.y)*a<nt?(this.current={...s},this.target=null,false):true}}const Z={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},z=2,ot=1.5,rt=.1,Jt=100,te=.002,ee=.01;class ie{constructor(t,e,i=Z){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||J(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;Ct(t2)&&(this.penHovers=true);const e2=this.pointers.get(t2.pointerId);if(!e2)return;const i2=this.local(t2);if(this.pointers.set(t2.pointerId,i2),this.pointers.size===1){const o=i2.x-e2.x,r=i2.y-e2.y;this.down&&Math.hypot(i2.x-this.down.x,i2.y-this.down.y)>zt&&(this.down.moved=true),(s=this.down)!=null&&s.moved&&this.options.navigable&&this.target.panBy(o,r,!this.tracksPointer(t2.pointerType)),this.samples.push({x:i2.x,y:i2.y,t:t2.timeStamp});const a=t2.timeStamp-Jt;for(;this.samples.length>2&&this.samples[0].t<a;)this.samples.shift()}else if(this.pointers.size===2&&this.pinch&&this.options.navigable){const o=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(o.distance/this.pinch.distance,o.mid,false),this.target.panBy(o.mid.x-this.pinch.mid.x,o.mid.y-this.pinch.mid.y,false),this.pinch=o}});h(this,"onPointerUp",t2=>{var 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<tt){if((m=(f=this.target).dismiss)!=null&&m.call(f)){this.lastTap=null;return}if(et(t2.pointerType,this.penHovers)){const p=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&p&&t2.timeStamp-p.t<tt&&Math.hypot(i2.x-p.x,i2.y-p.y)<Ut?(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/z,i2,true):this.zoomIn(i2):(u=(c=this.target).tap)==null||u.call(c,i2);return}if(!this.options.navigable||!this.tracksPointer(t2.pointerType))return;const o=this.samples[0],r=this.samples[this.samples.length-1],a=((r==null?void 0:r.t)??0)-((o==null?void 0:o.t)??0);if(o&&r&&a>0&&t2.timeStamp-r.t<50){const p=(r.x-o.x)/a*1e3,y=(r.y-o.y)/a*1e3,g=this.options.flickMomentum;g>0&&Math.hypot(p,y)>this.options.flickMinSpeed&&this.target.panBy(p*g,y*g,true)}});h(this,"onDoubleClick",t2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||et(this.lastPointerType,this.penHovers)||J(t2.target,this.element)||(t2.shiftKey?this.target.zoomBy(1/z,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&&Dt(t2.target,this.element,t2.deltaY))return;t2.preventDefault();const i2=se(t2),s=e2?ee:te;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*rt*(t2.shiftKey?3:1),s=e2.height*rt*(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(ot,void 0,true);break;case"-":case"_":this.target.zoomBy(1/ot,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(z,t,true)}tracksPointer(t){return t==="touch"||this.options.flickEnabled}pinchState(){const[t,e]=[...this.pointers.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),mid:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}}function se(n){return n.deltaMode===1?n.deltaY*16:n.deltaMode===2?n.deltaY*400:n.deltaY}class wt extends Error{constructor(t,e,i){super(t),this.url=e,this.status=i,this.name="ImageLoadError"}}const at=new Set;async function ne(n,t={}){const{signal:e,maxTextureSize:i,request:s}=t,o=Wt(s),r=re(n);if(typeof createImageBitmap!="function"||typeof fetch!="function")return U(n,{signal:e,cors:true,withCredentials:o});if(r&&at.has(r))return U(n,{signal:e,cors:false,withCredentials:o});let a;try{a=await Ft(s,n,{mode:"cors",signal:e})}catch(c){if(ae(c,e))throw c;const u=await U(n,{signal:e,cors:false,withCredentials:o});return r&&at.add(r),u}if(!a.ok)throw new wt(`Image request failed with ${a.status}`,n,a.status);const d=await a.blob();let l=await oe(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 oe(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 U(n,{signal:t,cors:e,withCredentials:i}){return new Promise((s,o)=>{if(t!=null&&t.aborted){o(G());return}const r=new Image;r.decoding="async",e&&(r.crossOrigin=i?"use-credentials":"anonymous");const a=()=>{r.onload=null,r.onerror=null,t==null||t.removeEventListener("abort",d)},d=()=>{a(),r.src="",o(G())};t==null||t.addEventListener("abort",d),r.onload=()=>{a();const l=()=>s({kind:"element",source:r,width:r.naturalWidth,height:r.naturalHeight,naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,opaque:!e});typeof r.decode=="function"?r.decode().then(l,l):l()},r.onerror=()=>{a(),o(new wt("Image failed to load",n))},r.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 ae(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 ht(n){n.kind==="bitmap"&&n.source.close()}const he=192*1024*1024,ce=6,le=2;class de{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??he,this.maxInFlight=t.maxInFlight??ce}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:D(e),lastUsed:this.frame,attempts:0,pinned:false,waiters:(i==null?void 0:i.waiters)??[]}),this.bytes+=D(e),this.flushWaiters(t))}prefetch(t){return Promise.all(t.map(e=>new Promise(i=>{const s=this.entries.get(e.url);if(s&&s.state!=="loading")return i();if(s){s.waiters.push(i);return}this.start({...e,priority:-1},i)}))).then(()=>{})}update(t){if(this.disposed)return;this.frame++;const e=new Set(t.map(i=>i.url));this.wanted=[...t].sort((i,s)=>i.priority-s.priority);for(const i of this.entries.values())i.state==="loading"&&!i.pinned&&!e.has(i.url)&&i.controller&&(i.controller.abort(),this.entries.delete(i.url),this.inFlight--);for(const i of this.wanted){const s=this.entries.get(i.url);s&&(s.lastUsed=this.frame)}this.pump(),this.evict(e)}dispose(){var t;this.disposed=true;for(const e of this.entries.values())(t=e.controller)==null||t.abort(),this.flushWaiters(e.url);this.entries.clear(),this.bytes=0}forEachReady(t){for(const e of this.entries.values())e.state==="ready"&&e.image&&t(e.url,e.image)}pump(){for(const t of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(t.url)||this.start(t)}}start(t,e){const i=new AbortController,s={url:t.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:i,pinned:!!e,waiters:e?[e]:[]};this.entries.set(t.url,s),this.inFlight++,this.attempt(s,t,i,t.url)}attempt(t,e,i,s){t.attempts++,this.options.load(s,i.signal).then(o=>{if(this.disposed||this.entries.get(t.url)!==t){ht(o);return}t.state="ready",t.image=o,t.bytes=D(o),t.controller=void 0,t.pinned=false,this.bytes+=t.bytes,this.settle(t)},o=>{if(!(i.signal.aborted||this.disposed)&&this.entries.get(t.url)===t){if(t.attempts<le&&!ue(o,e)){this.attempt(t,e,i,e.fallbackUrl??e.url);return}t.state="failed",t.controller=void 0,t.pinned=false,this.settle(t)}})}settle(t){this.inFlight--,this.flushWaiters(t.url),this.options.onSettled(),this.pump()}flushWaiters(t){const e=this.entries.get(t);if(!e)return;const i=e.waiters;e.waiters=[],i.forEach(s=>s())}evict(t){if(this.bytes<=this.budget)return;const e=[...this.entries.values()].filter(i=>i.state==="ready"&&!t.has(i.url)).sort((i,s)=>i.lastUsed-s.lastUsed);for(const i of e){if(this.bytes<=this.budget)break;this.entries.delete(i.url),this.bytes-=i.bytes,i.image&&ht(i.image),this.options.onEvict(i.url)}}}function D(n){return n.width*n.height*4}function ue(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 fe=.1;class me{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,fe):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 pe=2*1024*1024;function ge(n,t,e=pe){const i=new Set;let s=e,o=false;return{get deferred(){return o},getTile(r){const a=n(r);if(!a||a.kind==="media"||a.opaque||i.has(r)||t(r))return a;const d=a.width*a.height*4;if(i.size>0&&d>s){o=true;return}return s-=d,i.add(r),a}}}function we(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 ye(n,t,e){if(!n)return null;let i=n.trim().replace(/^xywh=/,""),s=false;i.startsWith("pct:")?(s=true,i=i.slice(4)):i.startsWith("pixel:")&&(i=i.slice(6));const o=i.split(",").map(Number);if(o.length!==4||o.some(p=>!Number.isFinite(p)))return null;let[r,a,d,l]=o;s&&(r=r/100*t,a=a/100*e,d=d/100*t,l=l/100*e);const f=Math.max(0,r),m=Math.max(0,a),c=Math.min(t,r+d),u=Math.min(e,a+l);return c<=f||u<=m?null:{x:f,y:m,width:c-f,height:u-m}}const W=512,xe=16e6;function yt(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 ve(n){const{width:t,height:e}=n,i=[],s=n.regionByPx&&n.sizeByW,o=(c,u,p)=>{const y=Math.ceil(t/c),g=Math.ceil(e/c);return{scaleFactor:c,width:y,height:g,tileWidth:u,tileHeight:p,cols:Math.ceil(y/u),rows:Math.ceil(g/p)}},r=(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(o(c,a.width,a.height));else if(s)for(let c=1;;c*=2){const u=o(c,W,W);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;be(n,c.width,c.height)&&u>d+1e-9&&i.push(r(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)/W;i.push(r(Math.ceil(t/c),Math.ceil(e/c)))}(!i.length||!a&&!s&&t*e<=xe)&&(i.some(c=>c.scaleFactor===1)||i.push(r(t,e)));const f=Te(i).sort((c,u)=>u.scaleFactor-c.scaleFactor),m=Ht(n);return{width:t,height:e,levels:f,tile(c){const u=f[c.level],p=u.scaleFactor,y=u.cols===1&&u.rows===1;let g,v,b;if(y)g={x:0,y:0,width:t,height:e},v=u.width,b=u.height;else{const I=Math.round(c.col*u.tileWidth*p),M=Math.round(c.row*u.tileHeight*p);g={x:I,y:M,width:Math.min(Math.round(u.tileWidth*p),t-I),height:Math.min(Math.round(u.tileHeight*p),e-M)},v=Math.ceil(g.width/p),b=Math.ceil(g.height/p)}return{...c,region:g,url:it(n,g,v,b),fallbackUrl:m?it(n,g,v,b,m):void 0}}}}function be(n,t,e){return!(n.maxWidth&&t>n.maxWidth||n.maxHeight&&e>n.maxHeight||n.maxArea&&t*e>n.maxArea)}function Te(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 Me(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,o=i.tileHeight*i.scaleFactor,r=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<=r||l<=a)return[];const f=Math.max(0,Math.floor(r/s)),m=Math.min(i.cols-1,Math.floor((d-1e-9)/s)),c=Math.max(0,Math.floor(a/o)),u=Math.min(i.rows-1,Math.floor((l-1e-9)/o)),p=[];for(let y=c;y<=u;y++)for(let g=f;g<=m;g++)p.push({level:t,col:g,row:y});return p}async function Ee(n,t){if(n.media)return ke(n,n.media);let e=null,i=null;if(n.service)try{e=ve(await Nt(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=yt(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},o=ye(n.region,s.width,s.height)??{x:0,y:0,width:s.width,height:s.height},r=e.width/s.width,a=e.height/s.height,d={x:o.x*r,y:o.y*a,width:o.width*r,height:o.height*a},l=we(n.rotation),f=l?Le(d,l):void 0,m={id:n.id,spec:n,pyramid:e,size:s,clip:d,contentClip:o,rect:{x:0,y:0,width:o.width,height:o.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 xt="media:";function ke(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=`${xt}${n.id}`,o={width:e,height:i},r={x:0,y:0,width:e,height:i};return{id:n.id,spec:n,pyramid:yt(s,e,i),media:{kind:"media",source:t.element,width:e,height:i,naturalWidth:e,naturalHeight:i},size:o,clip:r,contentClip:r,rect:{...r}}}function Le(n,{degrees:t,mirror:e}){const i=t*Math.PI/180,s=f=>Math.abs(f)<1e-12?0:f,o=s(Math.cos(i)),r=s(Math.sin(i)),a=Math.abs(n.width*o)+Math.abs(n.height*r),d=Math.abs(n.width*r)+Math.abs(n.height*o),l=k(_(a/2,d/2),{a:o,b:r,c:-r,d:o,e:0,f:0},L(e?-1:1,1),_(-(n.x+n.width/2),-(n.y+n.height/2)));return{orient:l,unorient:Pt(l),width:a,height:d}}function vt(n){var t;return((t=n.turn)==null?void 0:t.orient)??_(-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=gt(e.unorient,t),o=Math.max(s.x,i.x),r=Math.max(s.y,i.y);return{x:o,y:r,width:Math.max(0,Math.min(s.x+s.width,i.x+i.width)-o),height:Math.max(0,Math.min(s.y+s.height,i.y+i.height)-r)}}function Pe(n,t){const{turn:e,clip:i}=n;return e?pt(e.unorient,t):{x:i.x+t.x,y:i.y+t.y}}function ct(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 Ie(n){if(!n.length)return null;if(n.every(i=>i.spec.placement)){for(const i of n)i.rect={...i.spec.placement};return mt(n.map(i=>i.rect))}const t=ct(n[0]).height;let e=0;for(const i of n){const s=ct(i),o=s.width*t/s.height;i.rect={x:e,y:0,width:o,height:t},e+=o}return{x:0,y:0,width:e,height:t}}function B(n){const t=n.turn??n.clip;return{x:n.rect.width/t.width,y:n.rect.height/t.height}}function Ae(n){const t=B(n);return k(_(n.rect.x,n.rect.y),L(t.x,t.y),vt(n))}function Se(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 Re=1e7,Be=15e6,Oe=2e7,Ce=2;function ze(n){const{items:t,camera:e,viewport:i,pixelRatio:s,getTile:o,destination:r}=n,a=Rt(e,i),d=[],l=[],f=[],m=(c,u,p)=>{const y=c.tile(u);l.push({url:y.url,fallbackUrl:y.fallbackUrl,priority:p})};for(const c of t){const{pyramid:u,clip:p,rect:y}=c,g=B(c);if(n.wantOverview)for(const w of T(u,0,p))m(u,w,Oe);const v=lt(c,e,i,s),b=r?lt(c,r,i,s):v;if(f.push((v==null?void 0:v.target)??-1),!v&&!b)continue;const I=w=>x=>{const P=u.tile(x).region;return Math.hypot(P.x+P.width/2-w.x,P.y+P.height/2-w.y)};if(b){const w=I(b.center);for(const x of T(u,0,b.area))m(u,x,w(x)/1e3);if(b.target>0)for(const x of T(u,b.target,b.area))m(u,x,Re+w(x))}if(!v)continue;const{area:M,target:E}=v,K=I(v.center),O=T(u,0,M),V=E===0?[]:T(u,E,M);if(b!==v){for(const x of O)m(u,x,K(x)/1e3);const w=E-Ce;if(w>0)for(const x of T(u,w,M))m(u,x,Be+K(x))}if(c.spec.hidden)continue;const bt=(E===0?O:V).every(w=>o(u.tile(w).url)!==void 0)?[E]:Array.from({length:E+1},(w,x)=>x),Tt=k(a,_(y.x,y.y),L(g.x,g.y),vt(c));for(const w of bt){const x=w===0?O:w===E?V:T(u,w,M),P=u.levels[w].cols*u.levels[w].rows>1;for(const Mt of x){const C=u.tile(Mt),q=o(C.url);if(!q)continue;const Y=Ue(c,C.region,q,Tt,P);Y&&d.push({...Y,url:C.url})}}}return l.sort((c,u)=>c.priority-u.priority),{draws:d,wants:De(l),levels:f}}function lt(n,t,e,i){const{pyramid:s,rect:o}=n,r=N(t,e);if(!It(r,o))return null;const a=B(n),d=Math.max(r.x,o.x),l=Math.max(r.y,o.y),f=Math.min(r.x+r.width,o.x+o.width),m=Math.min(r.y+r.height,o.y+o.height),c=1/(a.x*t.zoom*i);return{area:_e(n,{x:(d-o.x)/a.x,y:(l-o.y)/a.y,width:(f-d)/a.x,height:(m-l)/a.y}),center:Pe(n,{x:(t.x-o.x)/a.x,y:(t.y-o.y)/a.y}),target:Me(s,c)}}function Ue(n,t,e,i,s){const{clip:o}=n,r=Math.max(t.x,o.x),a=Math.max(t.y,o.y),d=Math.min(t.x+t.width,o.x+o.width),l=Math.min(t.y+t.height,o.y+o.height);if(d<=r||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,_(t.x,t.y),L(1/f,1/m)),crop:{x:(r-t.x)*f,y:(a-t.y)*m,width:(d-r)*f,height:(l-a)*m},bleed:{right:s&&d<o.x+o.width-c,bottom:s&&l<o.y+o.height-c}}}function De(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,upscale:true,animationTime:.09,animationDuration:void 0,springStiffness:6.5,constrainDuringPan:true,request:void 0,byteBudget:192*1024*1024,maxInFlight:6,releaseAfterMs:2e3},Fe=2,He=3,Ne=.1,F=1e-6,X={top:0,right:0,bottom:0,left:0};function dt(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 Ze=(n,t)=>n.top===t.top&&n.right===t.right&&n.bottom===t.bottom&&n.left===t.left;let Ge;class Xe{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,"interacting",false);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),i2=this.camera.current,s2=this.backend,o=ge(this.getTile,f=>s2?s2.has(f):true),r=ze({items:this.items,camera:i2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:o.getTile,wantOverview:!!this.navigator,destination:e2?this.camera.destination:void 0}),a=r.wants.filter(f=>!f.url.startsWith(xt));return this.cache.update(a),r.draws.length?this.setUnloadable(false):a.length&&a.every(f=>this.cache.failed(f.url))&&this.setUnloadable(true),this.paint(r.draws),(d=this.overlays)==null||d.position(i2,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(f=>!f.spec.hidden),this.worldBounds,N(i2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!j(this.lastEmitted,i2))&&(this.lastEmitted={...i2},this.opened&&this.emit("viewport")),e2||o.deferred});h(this,"getTile",t2=>this.mediaByKey.get(t2)??this.cache.get(t2));h(this,"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,...H(e)},ft()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:i,springStiffness:s}=this.options;this.camera=new jt({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,i===void 0?void 0:{duration:i,stiffness:s}),this.loop=new me(this.tick),this.gestureOptions=H(e.gestures??{}),ft()&&(this.gestureOptions.flickMomentum=0),this.gestures=new ie(t,this,{...Z,...this.gestureOptions}),this.cache=new de({load:(o,r)=>this.loadTile(o,r),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:o=>{var r;return(r=this.backend)==null?void 0:r.release(o)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=Ke(t),this.visible?this.acquireBackend():this.holder.hiddenSince=ut(),this.measure(),this.observe()}get backendKind(){var t;return((t=this.backend)==null?void 0:t.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>i==null?void 0:i.delete(e)}async setImages(t,{world:e,fit:i=false}={}){const s=++this.generation,o=new Map(this.items.map(f=>[f.id,f])),r=await Promise.allSettled(t.map(f=>{const m=o.get(f.id);return m&&Se(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=r.filter(f=>f.status==="fulfilled").map(f=>f.value),d=r.filter(f=>f.status==="rejected").map(f=>f.reason);this.items=a,this.watchMedia(a);const l=Ie(a);if(this.worldBounds=e?l?mt([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 o=e.has(s.id);!!s.spec.hidden!==o&&(s.spec={...s.spec,hidden:o},i=true)}i&&this.invalidate()}isReady(t){const e=this.items.find(s=>s.id===t);if(!e)return false;if(e.spec.media)return true;const i=e.pyramid.levels[0];if(!i)return false;for(let s=0;s<i.rows;s++)for(let o=0;o<i.cols;o++)if(!this.getTile(e.pyramid.tile({level:0,col:o,row:s}).url))return false;return true}fitBounds(t,e=false,i=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:o,left:r},a=1/0){const{width:d,height:l}=this.viewport,f=Bt(t,{width:Math.max(1,d-r-s),height:Math.max(1,l-i-o)},e),m=Math.min(f.zoom,a);return{...S(At(t),{x:(d+r-s)/2,y:(l+i-o)/2},m,e,this.viewport),zoom:m,rotation:e}}fitItemRect(t,e,i=false){const s=this.itemRectToWorld(t,e);s&&this.fitAnnotation(s,i)}fitAnnotation(t,e=false){var o;const i=this.items[0];if(!i)return;const s=i.rect.width*Ne;this.fitBounds({x:t.x-s,y:t.y-s,width:t.width+s*2,height:t.height+s*2},e,dt((o=this.overlays)==null?void 0:o.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 e;const t=((e=this.homeCamera())==null?void 0:e.zoom)??1;return{home:t,min:t*this.options.minZoomImageRatio,max:Math.max(t,this.closestZoom())}}closestZoom(){const t=this.items.length?Math.min(...this.items.map(e=>B(e).x)):1;return this.options.maxZoomPixelRatio/t}home(t=false){const e=this.homeCamera();if(!e)return;const i=this.atHome;this.atHome=true,this.animateTo(e,t),!i&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-F)}viewLimits(){const{zoom:t,x:e,y:i,rotation:s}=this.camera.destination,{min:o,max:r}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:t>=r*(1-F),atMin:t<=o*(1+F),atHome:this.atHome&&(!a||Math.abs(t/a.zoom-1)<.001&&Math.hypot(e-a.x,i-a.y)*t<.5&&Math.abs(s-a.rotation)<.001)}}zoomBy(t,e,i=true){const s=i?this.camera.destination:this.camera.current,o=e??{x:this.viewport.width/2,y:this.viewport.height/2},r=Q(s,this.viewport,o),{min:a,max:d}=this.getZoomLimits(),l=A(s.zoom*t,a,d),f=S(r,o,l,s.rotation,this.viewport),m=this.constrain({...s,...f,zoom:l});this.atHome=false,i?this.camera.animateTo({state:m,anchor:{world:r,screen:o}},this.viewport):this.camera.set(m),this.invalidate()}panBy(t,e,i=false){const s=i?this.camera.destination:this.camera.current,o=pt(k(L(1/s.zoom),St(-s.rotation)),{x:t,y:e}),r=this.constrain({...s,x:s.x-o.x,y:s.y-o.y});this.atHome=false,i?this.camera.animateTo({state:r},this.viewport):this.camera.set(r),this.invalidate()}panTo(t,e=false){const i=e?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...i,...t}),e)}rotateBy(t){const e=this.camera.destination;this.setRotation(e.rotation*180/Math.PI+t)}setRotation(t,e=false){const i=this.camera.destination,s=t*Math.PI/180;this.animateTo(this.constrain({...i,rotation:s}),e)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(t){this.emit("tap",t)}setDismiss(t){this.dismisser=t}dismiss(){var t;return((t=this.dismisser)==null?void 0:t.call(this))??false}setGestures(t){this.gestures.setOptions({...Z,...this.gestureOptions,...H(t)})}setInteracting(t){if(this.interacting=t,t){this.camera.stop();return}if(this.options.constrainDuringPan)return;const e=this.camera.destination,i=this.constrain(e);j(e,i)||this.animateTo(i,false)}worldToScreenPoint(t){return Ot(this.camera.current,this.viewport,t)}screenToWorldPoint(t){return Q(this.camera.current,this.viewport,t)}itemRectToWorld(t,e){const i=this.items[t];if(!i)return null;const{contentClip:s,clip:o}=i;if(i.turn)return gt(k(Ae(i),L(o.width/s.width,o.height/s.height)),e);const r=i.rect.width/s.width,a=i.rect.height/s.height;return{x:i.rect.x+(e.x-s.x)*r,y:i.rect.y+(e.y-s.y)*a,width:e.width*r,height:e.height*a}}attachNavigator(t){var o;(o=this.navigator)==null||o.dispose(),this.navigator=null;const e=++this.navigatorAsked;let i=null,s=false;return import("./Navigator-B-vYs2Cu.mjs").then(r=>{s||this.disposed||e!==this.navigatorAsked||(i=new r.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,o,r,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(t=this.resizeObserver)==null||t.disconnect(),(e=this.intersectionObserver)==null||e.disconnect(),(s=(i=this.dprQuery)==null?void 0:i.removeEventListener)==null||s.call(i,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(o=this.navigator)==null||o.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(r=this.dom)==null||r.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(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,o=()=>this.invalidate(),r=["play","seeked","loadeddata","resize"];r.forEach(a=>s.addEventListener(a,o)),this.detachMedia.push(()=>r.forEach(a=>s.removeEventListener(a,o)))}}paint(t){const e=this.backend,i=[],s=(e==null?void 0:e.kind)==="webgl2";e==null||e.begin();for(const o of t){const{image:r}=o;if(!(r.kind==="media"||r.kind==="element"&&s&&(r.opaque||this.opaqueUrls.has(o.url)))&&e){if(e.draw({key:o.url,source:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1,bleed:o.bleed})!=="tainted"||r.kind==="bitmap")continue;this.opaqueUrls.add(o.url)}(r.kind==="element"||r.kind==="media")&&i.push({key:`${o.item.id}|${o.url}`,element:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1})}e==null||e.end(),this.dom?this.dom.sync(i):i.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-B4wyEylP.mjs").then(({DomLayers:o})=>{if(this.disposed)return;const r=new o(this.host);this.overlays&&this.host.insertBefore(r.container,this.overlays.container),this.dom=r,this.invalidate()}))}loadTile(t,e){return ne(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,this.options.upscale?1/0:this.closestZoom())}constrain(t,{allowBeyondLimits:e=false}={}){const i=this.worldBounds;if(!i)return t;const{min:s,max:o}=this.getZoomLimits(),r=e?A(t.zoom,s,Math.max(o,t.zoom)):A(t.zoom,s,o);return this.interacting&&!this.options.constrainDuringPan?{...t,zoom:r}:{...t,zoom:r,x:A(t.x,i.x,i.x+i.width),y:A(t.y,i.y,i.y+i.height)}}acquireBackend(t=true){var o,r;if(this.backend||this.pending||this.disposed)return;const e=document.createElement("canvas");e.className="clover-canvas-surface",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(e,((o=this.dom)==null?void 0:o.container)??((r=this.overlays)==null?void 0:r.container)??null);const i=t&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<He);let s=null;i&&(Lt(this.holder)||this.backendPreference==="webgl2")&&(s=R.create(e,{onLost:this.onContextLost}),s||$(this.holder)),s?this.install(s):this.backendPreference==="webgl2"?this.none(e):(this.pending=e,(Ge??(Ge=import("./Canvas2DBackend-9VTWQiW6.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($(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=ut()),!(!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),o=dt(this.host),r=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Fe);if(i===this.viewport.width&&s===this.viewport.height&&r===this.pixelRatio&&Ze(o,this.inset))return;const a=this.viewport;if(this.viewport={width:i,height:s},this.inset=o,this.pixelRatio=r,(d=this.backend)==null||d.resize(i,s,r),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}))}this.emit("viewport")}t?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var t,e,i,s;typeof window>"u"||typeof window.matchMedia!="function"||((e=(t=this.dprQuery)==null?void 0:t.removeEventListener)==null||e.call(t,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(s=(i=this.dprQuery).addEventListener)==null||s.call(i,"change",this.onPixelRatioChange))}setUnloadable(t){t!==this.unloadable&&(this.unloadable=t,this.emit("unloadable",t))}emit(t,e){var i;(i=this.listeners.get(t))==null||i.forEach(s=>s(e))}}const ut=()=>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 ft(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function H(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}const ii=(n,t)=>new Xe(n,t);export{Gt as b,Zt as h,ze as p,ii as r};
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=Vt(e,Xt,Kt);this.program=s,this.uniforms={matrix:e.getUniformLocation(s,"u_matrix"),crop:e.getUniformLocation(s,"u_crop"),opacity:e.getUniformLocation(s,"u_opacity"),texture:e.getUniformLocation(s,"u_texture")};const o=e.createVertexArray();e.bindVertexArray(o);const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),e.STATIC_DRAW);const a=e.getAttribLocation(s,"a_position");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,false,0,0),e.bindVertexArray(null),this.vao=o,e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),t.addEventListener("webglcontextlost",this.handleLost)}static create(t,e={}){let i=null;try{i=t.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{i=null}if(!i||typeof i.createShader!="function")return null;try{return new 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)),o=Math.max(1,Math.round(e*i));this.canvas.width!==s&&(this.canvas.width=s),this.canvas.height!==o&&(this.canvas.height=o)}begin(){if(this.isLost)return;const t=this.gl;t.viewport(0,0,this.canvas.width,this.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(this.program),t.bindVertexArray(this.vao),t.activeTexture(t.TEXTURE0),t.uniform1i(this.uniforms.texture,0)}draw(t){if(this.isLost||!Zt(t.source))return"skipped";const e=this.gl,i=this.upload(t);if(i==="tainted")return"tainted";if(!i)return"skipped";const s=t.crop??{x:0,y:0,width:t.width,height:t.height},o=Gt(t,this.pixelRatio),r=k(t.transform,_(s.x,s.y),L(s.width+o.x,s.height+o.y));return e.uniformMatrix3fv(this.uniforms.matrix,false,_t(r,this.cssWidth,this.cssHeight,this.matrixScratch)),e.uniform4f(this.uniforms.crop,s.x/t.width,s.y/t.height,s.width/t.width,s.height/t.height),e.uniform1f(this.uniforms.opacity,t.opacity),e.bindTexture(e.TEXTURE_2D,i.texture),e.drawArrays(e.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(t){return!this.isLost&&this.textures.has(t)}release(t){const e=this.textures.get(t);e&&(this.isLost||this.gl.deleteTexture(e.texture),this.textures.delete(t))}dispose(){var t;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const e of[...this.textures.keys()])this.release(e);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(t=this.gl.getExtension("WEBGL_lose_context"))==null||t.loseContext(),this.isLost=true}upload(t){const e=this.gl,i=this.textures.get(t.key);if(i&&i.width===t.width&&i.height===t.height)return i;const s=(i==null?void 0:i.texture)??e.createTexture();if(!s)return null;e.bindTexture(e.TEXTURE_2D,s);try{e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source)}catch(r){if(i||e.deleteTexture(s),qt(r))return"tainted";throw r}e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const o={texture:s,width:t.width,height:t.height};return this.textures.set(t.key,o),o}}function Vt(n,t,e){const i=st(n,n.VERTEX_SHADER,t),s=st(n,n.FRAGMENT_SHADER,e),o=n.createProgram();if(!o)throw new Error("Could not create WebGL program");if(n.attachShader(o,i),n.attachShader(o,s),n.linkProgram(o),n.deleteShader(i),n.deleteShader(s),!n.getProgramParameter(o,n.LINK_STATUS)){const r=n.getProgramInfoLog(o);throw n.deleteProgram(o),new Error(`Could not link WebGL program: ${r}`)}return o}function st(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 qt(n){return typeof n=="object"&&n!==null&&n.name==="SecurityError"}const Yt=.09,$t=1e-4,nt=.05,Qt=1e-4;class jt{constructor(t,e=Yt,i){h(this,"current");h(this,"target",null);h(this,"timeConstant");h(this,"spring");h(this,"start");h(this,"elapsed",0);this.current={...t},this.start={...t},this.timeConstant=e,this.spring=i}get destination(){return this.target?{...this.target.state}:{...this.current}}set(t){this.current={...t},this.target=null}animateTo(t,e,i=false){const s=this.spring?this.spring.duration<=0:this.timeConstant===0;if(i||s){this.set(t.state);return}let o=t.anchor;if(o){const r=S(o.world,o.screen,t.state.zoom,t.state.rotation,e);Math.hypot(r.x-t.state.x,r.y-t.state.y)*t.state.zoom>nt&&(o=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...t.state},anchor:o}}stop(){this.target=null}step(t,e){const i=this.target;if(!i)return false;const s=i.state;let o,r;if(this.spring){this.elapsed+=Math.max(t,0);const m=this.elapsed/this.spring.duration;if(m>=1)return this.current={...s},this.target=null,false;const c=this.spring.stiffness;o=this.start,r=(1-Math.exp(-c*m))/(1-Math.exp(-c))}else o=this.current,r=1-Math.exp(-Math.max(t,0)/this.timeConstant);const a=Math.exp(Math.log(o.zoom)+(Math.log(s.zoom)-Math.log(o.zoom))*r),d=o.rotation+(s.rotation-o.rotation)*r,l=i.anchor?S(i.anchor.world,i.anchor.screen,a,d,e):{x:o.x+(s.x-o.x)*r,y:o.y+(s.y-o.y)*r};return this.current={x:l.x,y:l.y,zoom:a,rotation:d},this.spring?true:Math.abs(Math.log(s.zoom/a))<$t&&Math.abs(s.rotation-d)<Qt&&Math.hypot(s.x-l.x,s.y-l.y)*a<nt?(this.current={...s},this.target=null,false):true}}const Z={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},z=2,ot=1.5,rt=.1,Jt=100,te=.002,ee=.01;class ie{constructor(t,e,i=Z){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||J(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;Ct(t2)&&(this.penHovers=true);const e2=this.pointers.get(t2.pointerId);if(!e2)return;const i2=this.local(t2);if(this.pointers.set(t2.pointerId,i2),this.pointers.size===1){const o=i2.x-e2.x,r=i2.y-e2.y;this.down&&Math.hypot(i2.x-this.down.x,i2.y-this.down.y)>zt&&(this.down.moved=true),(s=this.down)!=null&&s.moved&&this.options.navigable&&this.target.panBy(o,r,!this.tracksPointer(t2.pointerType)),this.samples.push({x:i2.x,y:i2.y,t:t2.timeStamp});const a=t2.timeStamp-Jt;for(;this.samples.length>2&&this.samples[0].t<a;)this.samples.shift()}else if(this.pointers.size===2&&this.pinch&&this.options.navigable){const o=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(o.distance/this.pinch.distance,o.mid,false),this.target.panBy(o.mid.x-this.pinch.mid.x,o.mid.y-this.pinch.mid.y,false),this.pinch=o}});h(this,"onPointerUp",t2=>{var 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<tt){if((m=(f=this.target).dismiss)!=null&&m.call(f)){this.lastTap=null;return}if(et(t2.pointerType,this.penHovers)){const p=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&p&&t2.timeStamp-p.t<tt&&Math.hypot(i2.x-p.x,i2.y-p.y)<Ut?(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/z,i2,true):this.zoomIn(i2):(u=(c=this.target).tap)==null||u.call(c,i2);return}if(!this.options.navigable||!this.tracksPointer(t2.pointerType))return;const o=this.samples[0],r=this.samples[this.samples.length-1],a=((r==null?void 0:r.t)??0)-((o==null?void 0:o.t)??0);if(o&&r&&a>0&&t2.timeStamp-r.t<50){const p=(r.x-o.x)/a*1e3,y=(r.y-o.y)/a*1e3,g=this.options.flickMomentum;g>0&&Math.hypot(p,y)>this.options.flickMinSpeed&&this.target.panBy(p*g,y*g,true)}});h(this,"onDoubleClick",t2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||et(this.lastPointerType,this.penHovers)||J(t2.target,this.element)||(t2.shiftKey?this.target.zoomBy(1/z,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&&Dt(t2.target,this.element,t2.deltaY))return;t2.preventDefault();const i2=se(t2),s=e2?ee:te;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*rt*(t2.shiftKey?3:1),s=e2.height*rt*(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(ot,void 0,true);break;case"-":case"_":this.target.zoomBy(1/ot,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(z,t,true)}tracksPointer(t){return t==="touch"||this.options.flickEnabled}pinchState(){const[t,e]=[...this.pointers.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),mid:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}}function se(n){return n.deltaMode===1?n.deltaY*16:n.deltaMode===2?n.deltaY*400:n.deltaY}class wt extends Error{constructor(t,e,i){super(t),this.url=e,this.status=i,this.name="ImageLoadError"}}const at=new Set;async function ne(n,t={}){const{signal:e,maxTextureSize:i,request:s}=t,o=Wt(s),r=re(n);if(typeof createImageBitmap!="function"||typeof fetch!="function")return U(n,{signal:e,cors:true,withCredentials:o});if(r&&at.has(r))return U(n,{signal:e,cors:false,withCredentials:o});let a;try{a=await Ft(s,n,{mode:"cors",signal:e})}catch(c){if(ae(c,e))throw c;const u=await U(n,{signal:e,cors:false,withCredentials:o});return r&&at.add(r),u}if(!a.ok)throw new wt(`Image request failed with ${a.status}`,n,a.status);const d=await a.blob();let l=await oe(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 oe(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 U(n,{signal:t,cors:e,withCredentials:i}){return new Promise((s,o)=>{if(t!=null&&t.aborted){o(G());return}const r=new Image;r.decoding="async",e&&(r.crossOrigin=i?"use-credentials":"anonymous");const a=()=>{r.onload=null,r.onerror=null,t==null||t.removeEventListener("abort",d)},d=()=>{a(),r.src="",o(G())};t==null||t.addEventListener("abort",d),r.onload=()=>{a();const l=()=>s({kind:"element",source:r,width:r.naturalWidth,height:r.naturalHeight,naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,opaque:!e});typeof r.decode=="function"?r.decode().then(l,l):l()},r.onerror=()=>{a(),o(new wt("Image failed to load",n))},r.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 ae(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 ht(n){n.kind==="bitmap"&&n.source.close()}const he=192*1024*1024,ce=6,le=2;class de{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??he,this.maxInFlight=t.maxInFlight??ce}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:D(e),lastUsed:this.frame,attempts:0,pinned:false,waiters:(i==null?void 0:i.waiters)??[]}),this.bytes+=D(e),this.flushWaiters(t))}prefetch(t){return Promise.all(t.map(e=>new Promise(i=>{const s=this.entries.get(e.url);if(s&&s.state!=="loading")return i();if(s){s.waiters.push(i);return}this.start({...e,priority:-1},i)}))).then(()=>{})}update(t){if(this.disposed)return;this.frame++;const e=new Set(t.map(i=>i.url));this.wanted=[...t].sort((i,s)=>i.priority-s.priority);for(const i of this.entries.values())i.state==="loading"&&!i.pinned&&!e.has(i.url)&&i.controller&&(i.controller.abort(),this.entries.delete(i.url),this.inFlight--);for(const i of this.wanted){const s=this.entries.get(i.url);s&&(s.lastUsed=this.frame)}this.pump(),this.evict(e)}dispose(){var t;this.disposed=true;for(const e of this.entries.values())(t=e.controller)==null||t.abort(),this.flushWaiters(e.url);this.entries.clear(),this.bytes=0}forEachReady(t){for(const e of this.entries.values())e.state==="ready"&&e.image&&t(e.url,e.image)}pump(){for(const t of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(t.url)||this.start(t)}}start(t,e){const i=new AbortController,s={url:t.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:i,pinned:!!e,waiters:e?[e]:[]};this.entries.set(t.url,s),this.inFlight++,this.attempt(s,t,i,t.url)}attempt(t,e,i,s){t.attempts++,this.options.load(s,i.signal).then(o=>{if(this.disposed||this.entries.get(t.url)!==t){ht(o);return}t.state="ready",t.image=o,t.bytes=D(o),t.controller=void 0,t.pinned=false,this.bytes+=t.bytes,this.settle(t)},o=>{if(!(i.signal.aborted||this.disposed)&&this.entries.get(t.url)===t){if(t.attempts<le&&!ue(o,e)){this.attempt(t,e,i,e.fallbackUrl??e.url);return}t.state="failed",t.controller=void 0,t.pinned=false,this.settle(t)}})}settle(t){this.inFlight--,this.flushWaiters(t.url),this.options.onSettled(),this.pump()}flushWaiters(t){const e=this.entries.get(t);if(!e)return;const i=e.waiters;e.waiters=[],i.forEach(s=>s())}evict(t){if(this.bytes<=this.budget)return;const e=[...this.entries.values()].filter(i=>i.state==="ready"&&!t.has(i.url)).sort((i,s)=>i.lastUsed-s.lastUsed);for(const i of e){if(this.bytes<=this.budget)break;this.entries.delete(i.url),this.bytes-=i.bytes,i.image&&ht(i.image),this.options.onEvict(i.url)}}}function D(n){return n.width*n.height*4}function ue(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 fe=.1;class me{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,fe):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 pe=2*1024*1024;function ge(n,t,e=pe){const i=new Set;let s=e,o=false;return{get deferred(){return o},getTile(r){const a=n(r);if(!a||a.kind==="media"||a.opaque||i.has(r)||t(r))return a;const d=a.width*a.height*4;if(i.size>0&&d>s){o=true;return}return s-=d,i.add(r),a}}}function we(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 ye(n,t,e){if(!n)return null;let i=n.trim().replace(/^xywh=/,""),s=false;i.startsWith("pct:")?(s=true,i=i.slice(4)):i.startsWith("pixel:")&&(i=i.slice(6));const o=i.split(",").map(Number);if(o.length!==4||o.some(p=>!Number.isFinite(p)))return null;let[r,a,d,l]=o;s&&(r=r/100*t,a=a/100*e,d=d/100*t,l=l/100*e);const f=Math.max(0,r),m=Math.max(0,a),c=Math.min(t,r+d),u=Math.min(e,a+l);return c<=f||u<=m?null:{x:f,y:m,width:c-f,height:u-m}}const W=512,xe=16e6;function yt(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 ve(n){const{width:t,height:e}=n,i=[],s=n.regionByPx&&n.sizeByW,o=(c,u,p)=>{const y=Math.ceil(t/c),g=Math.ceil(e/c);return{scaleFactor:c,width:y,height:g,tileWidth:u,tileHeight:p,cols:Math.ceil(y/u),rows:Math.ceil(g/p)}},r=(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(o(c,a.width,a.height));else if(s)for(let c=1;;c*=2){const u=o(c,W,W);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;be(n,c.width,c.height)&&u>d+1e-9&&i.push(r(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)/W;i.push(r(Math.ceil(t/c),Math.ceil(e/c)))}(!i.length||!a&&!s&&t*e<=xe)&&(i.some(c=>c.scaleFactor===1)||i.push(r(t,e)));const f=Te(i).sort((c,u)=>u.scaleFactor-c.scaleFactor),m=Ht(n);return{width:t,height:e,levels:f,tile(c){const u=f[c.level],p=u.scaleFactor,y=u.cols===1&&u.rows===1;let g,v,b;if(y)g={x:0,y:0,width:t,height:e},v=u.width,b=u.height;else{const I=Math.round(c.col*u.tileWidth*p),M=Math.round(c.row*u.tileHeight*p);g={x:I,y:M,width:Math.min(Math.round(u.tileWidth*p),t-I),height:Math.min(Math.round(u.tileHeight*p),e-M)},v=Math.ceil(g.width/p),b=Math.ceil(g.height/p)}return{...c,region:g,url:it(n,g,v,b),fallbackUrl:m?it(n,g,v,b,m):void 0}}}}function be(n,t,e){return!(n.maxWidth&&t>n.maxWidth||n.maxHeight&&e>n.maxHeight||n.maxArea&&t*e>n.maxArea)}function Te(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 Me(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,o=i.tileHeight*i.scaleFactor,r=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<=r||l<=a)return[];const f=Math.max(0,Math.floor(r/s)),m=Math.min(i.cols-1,Math.floor((d-1e-9)/s)),c=Math.max(0,Math.floor(a/o)),u=Math.min(i.rows-1,Math.floor((l-1e-9)/o)),p=[];for(let y=c;y<=u;y++)for(let g=f;g<=m;g++)p.push({level:t,col:g,row:y});return p}async function Ee(n,t){if(n.media)return ke(n,n.media);let e=null,i=null;if(n.service)try{e=ve(await Nt(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=yt(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},o=ye(n.region,s.width,s.height)??{x:0,y:0,width:s.width,height:s.height},r=e.width/s.width,a=e.height/s.height,d={x:o.x*r,y:o.y*a,width:o.width*r,height:o.height*a},l=we(n.rotation),f=l?Le(d,l):void 0,m={id:n.id,spec:n,pyramid:e,size:s,clip:d,contentClip:o,rect:{x:0,y:0,width:o.width,height:o.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 xt="media:";function ke(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=`${xt}${n.id}`,o={width:e,height:i},r={x:0,y:0,width:e,height:i};return{id:n.id,spec:n,pyramid:yt(s,e,i),media:{kind:"media",source:t.element,width:e,height:i,naturalWidth:e,naturalHeight:i},size:o,clip:r,contentClip:r,rect:{...r}}}function Le(n,{degrees:t,mirror:e}){const i=t*Math.PI/180,s=f=>Math.abs(f)<1e-12?0:f,o=s(Math.cos(i)),r=s(Math.sin(i)),a=Math.abs(n.width*o)+Math.abs(n.height*r),d=Math.abs(n.width*r)+Math.abs(n.height*o),l=k(_(a/2,d/2),{a:o,b:r,c:-r,d:o,e:0,f:0},L(e?-1:1,1),_(-(n.x+n.width/2),-(n.y+n.height/2)));return{orient:l,unorient:Pt(l),width:a,height:d}}function vt(n){var t;return((t=n.turn)==null?void 0:t.orient)??_(-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=gt(e.unorient,t),o=Math.max(s.x,i.x),r=Math.max(s.y,i.y);return{x:o,y:r,width:Math.max(0,Math.min(s.x+s.width,i.x+i.width)-o),height:Math.max(0,Math.min(s.y+s.height,i.y+i.height)-r)}}function Pe(n,t){const{turn:e,clip:i}=n;return e?pt(e.unorient,t):{x:i.x+t.x,y:i.y+t.y}}function ct(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 Ie(n){if(!n.length)return null;if(n.every(i=>i.spec.placement)){for(const i of n)i.rect={...i.spec.placement};return mt(n.map(i=>i.rect))}const t=ct(n[0]).height;let e=0;for(const i of n){const s=ct(i),o=s.width*t/s.height;i.rect={x:e,y:0,width:o,height:t},e+=o}return{x:0,y:0,width:e,height:t}}function B(n){const t=n.turn??n.clip;return{x:n.rect.width/t.width,y:n.rect.height/t.height}}function Ae(n){const t=B(n);return k(_(n.rect.x,n.rect.y),L(t.x,t.y),vt(n))}function Se(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 Re=1e7,Be=15e6,Oe=2e7,Ce=2;function ze(n){const{items:t,camera:e,viewport:i,pixelRatio:s,getTile:o,destination:r}=n,a=Rt(e,i),d=[],l=[],f=[],m=(c,u,p)=>{const y=c.tile(u);l.push({url:y.url,fallbackUrl:y.fallbackUrl,priority:p})};for(const c of t){const{pyramid:u,clip:p,rect:y}=c,g=B(c);if(n.wantOverview)for(const w of T(u,0,p))m(u,w,Oe);const v=lt(c,e,i,s),b=r?lt(c,r,i,s):v;if(f.push((v==null?void 0:v.target)??-1),!v&&!b)continue;const I=w=>x=>{const P=u.tile(x).region;return Math.hypot(P.x+P.width/2-w.x,P.y+P.height/2-w.y)};if(b){const w=I(b.center);for(const x of T(u,0,b.area))m(u,x,w(x)/1e3);if(b.target>0)for(const x of T(u,b.target,b.area))m(u,x,Re+w(x))}if(!v)continue;const{area:M,target:E}=v,K=I(v.center),O=T(u,0,M),V=E===0?[]:T(u,E,M);if(b!==v){for(const x of O)m(u,x,K(x)/1e3);const w=E-Ce;if(w>0)for(const x of T(u,w,M))m(u,x,Be+K(x))}if(c.spec.hidden)continue;const bt=(E===0?O:V).every(w=>o(u.tile(w).url)!==void 0)?[E]:Array.from({length:E+1},(w,x)=>x),Tt=k(a,_(y.x,y.y),L(g.x,g.y),vt(c));for(const w of bt){const x=w===0?O:w===E?V:T(u,w,M),P=u.levels[w].cols*u.levels[w].rows>1;for(const Mt of x){const C=u.tile(Mt),q=o(C.url);if(!q)continue;const Y=Ue(c,C.region,q,Tt,P);Y&&d.push({...Y,url:C.url})}}}return l.sort((c,u)=>c.priority-u.priority),{draws:d,wants:De(l),levels:f}}function lt(n,t,e,i){const{pyramid:s,rect:o}=n,r=N(t,e);if(!It(r,o))return null;const a=B(n),d=Math.max(r.x,o.x),l=Math.max(r.y,o.y),f=Math.min(r.x+r.width,o.x+o.width),m=Math.min(r.y+r.height,o.y+o.height),c=1/(a.x*t.zoom*i);return{area:_e(n,{x:(d-o.x)/a.x,y:(l-o.y)/a.y,width:(f-d)/a.x,height:(m-l)/a.y}),center:Pe(n,{x:(t.x-o.x)/a.x,y:(t.y-o.y)/a.y}),target:Me(s,c)}}function Ue(n,t,e,i,s){const{clip:o}=n,r=Math.max(t.x,o.x),a=Math.max(t.y,o.y),d=Math.min(t.x+t.width,o.x+o.width),l=Math.min(t.y+t.height,o.y+o.height);if(d<=r||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,_(t.x,t.y),L(1/f,1/m)),crop:{x:(r-t.x)*f,y:(a-t.y)*m,width:(d-r)*f,height:(l-a)*m},bleed:{right:s&&d<o.x+o.width-c,bottom:s&&l<o.y+o.height-c}}}function De(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,upscale:true,animationTime:.09,animationDuration:void 0,springStiffness:6.5,constrainDuringPan:true,request:void 0,byteBudget:192*1024*1024,maxInFlight:6,releaseAfterMs:2e3},Fe=2,He=3,Ne=.1,F=1e-6,X={top:0,right:0,bottom:0,left:0};function dt(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 Ze=(n,t)=>n.top===t.top&&n.right===t.right&&n.bottom===t.bottom&&n.left===t.left;let Ge;class Xe{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,"interacting",false);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),i2=this.camera.current,s2=this.backend,o=ge(this.getTile,f=>s2?s2.has(f):true),r=ze({items:this.items,camera:i2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:o.getTile,wantOverview:!!this.navigator,destination:e2?this.camera.destination:void 0}),a=r.wants.filter(f=>!f.url.startsWith(xt));return this.cache.update(a),r.draws.length?this.setUnloadable(false):a.length&&a.every(f=>this.cache.failed(f.url))&&this.setUnloadable(true),this.paint(r.draws),(d=this.overlays)==null||d.position(i2,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(f=>!f.spec.hidden),this.worldBounds,N(i2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!j(this.lastEmitted,i2))&&(this.lastEmitted={...i2},this.opened&&this.emit("viewport")),e2||o.deferred});h(this,"getTile",t2=>this.mediaByKey.get(t2)??this.cache.get(t2));h(this,"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,...H(e)},ft()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:i,springStiffness:s}=this.options;this.camera=new jt({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,i===void 0?void 0:{duration:i,stiffness:s}),this.loop=new me(this.tick),this.gestureOptions=H(e.gestures??{}),ft()&&(this.gestureOptions.flickMomentum=0),this.gestures=new ie(t,this,{...Z,...this.gestureOptions}),this.cache=new de({load:(o,r)=>this.loadTile(o,r),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:o=>{var r;return(r=this.backend)==null?void 0:r.release(o)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=Ke(t),this.visible?this.acquireBackend():this.holder.hiddenSince=ut(),this.measure(),this.observe()}get backendKind(){var t;return((t=this.backend)==null?void 0:t.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>i==null?void 0:i.delete(e)}async setImages(t,{world:e,fit:i=false}={}){const s=++this.generation,o=new Map(this.items.map(f=>[f.id,f])),r=await Promise.allSettled(t.map(f=>{const m=o.get(f.id);return m&&Se(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=r.filter(f=>f.status==="fulfilled").map(f=>f.value),d=r.filter(f=>f.status==="rejected").map(f=>f.reason);this.items=a,this.watchMedia(a);const l=Ie(a);if(this.worldBounds=e?l?mt([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 o=e.has(s.id);!!s.spec.hidden!==o&&(s.spec={...s.spec,hidden:o},i=true)}i&&this.invalidate()}isReady(t){const e=this.items.find(s=>s.id===t);if(!e)return false;if(e.spec.media)return true;const i=e.pyramid.levels[0];if(!i)return false;for(let s=0;s<i.rows;s++)for(let o=0;o<i.cols;o++)if(!this.getTile(e.pyramid.tile({level:0,col:o,row:s}).url))return false;return true}fitBounds(t,e=false,i=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:o,left:r},a=1/0){const{width:d,height:l}=this.viewport,f=Bt(t,{width:Math.max(1,d-r-s),height:Math.max(1,l-i-o)},e),m=Math.min(f.zoom,a);return{...S(At(t),{x:(d+r-s)/2,y:(l+i-o)/2},m,e,this.viewport),zoom:m,rotation:e}}fitItemRect(t,e,i=false){const s=this.itemRectToWorld(t,e);s&&this.fitAnnotation(s,i)}fitAnnotation(t,e=false){var o;const i=this.items[0];if(!i)return;const s=i.rect.width*Ne;this.fitBounds({x:t.x-s,y:t.y-s,width:t.width+s*2,height:t.height+s*2},e,dt((o=this.overlays)==null?void 0:o.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 e;const t=((e=this.homeCamera())==null?void 0:e.zoom)??1;return{home:t,min:t*this.options.minZoomImageRatio,max:Math.max(t,this.closestZoom())}}closestZoom(){const t=this.items.length?Math.min(...this.items.map(e=>B(e).x)):1;return this.options.maxZoomPixelRatio/t}home(t=false){const e=this.homeCamera();if(!e)return;const i=this.atHome;this.atHome=true,this.animateTo(e,t),!i&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-F)}viewLimits(){const{zoom:t,x:e,y:i,rotation:s}=this.camera.destination,{min:o,max:r}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:t>=r*(1-F),atMin:t<=o*(1+F),atHome:this.atHome&&(!a||Math.abs(t/a.zoom-1)<.001&&Math.hypot(e-a.x,i-a.y)*t<.5&&Math.abs(s-a.rotation)<.001)}}zoomBy(t,e,i=true){const s=i?this.camera.destination:this.camera.current,o=e??{x:this.viewport.width/2,y:this.viewport.height/2},r=Q(s,this.viewport,o),{min:a,max:d}=this.getZoomLimits(),l=A(s.zoom*t,a,d),f=S(r,o,l,s.rotation,this.viewport),m=this.constrain({...s,...f,zoom:l});this.atHome=false,i?this.camera.animateTo({state:m,anchor:{world:r,screen:o}},this.viewport):this.camera.set(m),this.invalidate()}panBy(t,e,i=false){const s=i?this.camera.destination:this.camera.current,o=pt(k(L(1/s.zoom),St(-s.rotation)),{x:t,y:e}),r=this.constrain({...s,x:s.x-o.x,y:s.y-o.y});this.atHome=false,i?this.camera.animateTo({state:r},this.viewport):this.camera.set(r),this.invalidate()}panTo(t,e=false){const i=e?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...i,...t}),e)}rotateBy(t){const e=this.camera.destination;this.setRotation(e.rotation*180/Math.PI+t)}setRotation(t,e=false){const i=this.camera.destination,s=t*Math.PI/180;this.animateTo(this.constrain({...i,rotation:s}),e)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(t){this.emit("tap",t)}setDismiss(t){this.dismisser=t}dismiss(){var t;return((t=this.dismisser)==null?void 0:t.call(this))??false}setGestures(t){this.gestures.setOptions({...Z,...this.gestureOptions,...H(t)})}setInteracting(t){if(this.interacting=t,t){this.camera.stop();return}if(this.options.constrainDuringPan)return;const e=this.camera.destination,i=this.constrain(e);j(e,i)||this.animateTo(i,false)}worldToScreenPoint(t){return Ot(this.camera.current,this.viewport,t)}screenToWorldPoint(t){return Q(this.camera.current,this.viewport,t)}itemRectToWorld(t,e){const i=this.items[t];if(!i)return null;const{contentClip:s,clip:o}=i;if(i.turn)return gt(k(Ae(i),L(o.width/s.width,o.height/s.height)),e);const r=i.rect.width/s.width,a=i.rect.height/s.height;return{x:i.rect.x+(e.x-s.x)*r,y:i.rect.y+(e.y-s.y)*a,width:e.width*r,height:e.height*a}}attachNavigator(t){var o;(o=this.navigator)==null||o.dispose(),this.navigator=null;const e=++this.navigatorAsked;let i=null,s=false;return import("./Navigator-CHoyJlHU.mjs").then(r=>{s||this.disposed||e!==this.navigatorAsked||(i=new r.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,o,r,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(t=this.resizeObserver)==null||t.disconnect(),(e=this.intersectionObserver)==null||e.disconnect(),(s=(i=this.dprQuery)==null?void 0:i.removeEventListener)==null||s.call(i,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(o=this.navigator)==null||o.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(r=this.dom)==null||r.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(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,o=()=>this.invalidate(),r=["play","seeked","loadeddata","resize"];r.forEach(a=>s.addEventListener(a,o)),this.detachMedia.push(()=>r.forEach(a=>s.removeEventListener(a,o)))}}paint(t){const e=this.backend,i=[],s=(e==null?void 0:e.kind)==="webgl2";e==null||e.begin();for(const o of t){const{image:r}=o;if(!(r.kind==="media"||r.kind==="element"&&s&&(r.opaque||this.opaqueUrls.has(o.url)))&&e){if(e.draw({key:o.url,source:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1,bleed:o.bleed})!=="tainted"||r.kind==="bitmap")continue;this.opaqueUrls.add(o.url)}(r.kind==="element"||r.kind==="media")&&i.push({key:`${o.item.id}|${o.url}`,element:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1})}e==null||e.end(),this.dom?this.dom.sync(i):i.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-6wCUT5ap.mjs").then(({DomLayers:o})=>{if(this.disposed)return;const r=new o(this.host);this.overlays&&this.host.insertBefore(r.container,this.overlays.container),this.dom=r,this.invalidate()}))}loadTile(t,e){return ne(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,this.options.upscale?1/0:this.closestZoom())}constrain(t,{allowBeyondLimits:e=false}={}){const i=this.worldBounds;if(!i)return t;const{min:s,max:o}=this.getZoomLimits(),r=e?A(t.zoom,s,Math.max(o,t.zoom)):A(t.zoom,s,o);return this.interacting&&!this.options.constrainDuringPan?{...t,zoom:r}:{...t,zoom:r,x:A(t.x,i.x,i.x+i.width),y:A(t.y,i.y,i.y+i.height)}}acquireBackend(t=true){var o,r;if(this.backend||this.pending||this.disposed)return;const e=document.createElement("canvas");e.className="clover-canvas-surface",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(e,((o=this.dom)==null?void 0:o.container)??((r=this.overlays)==null?void 0:r.container)??null);const i=t&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<He);let s=null;i&&(Lt(this.holder)||this.backendPreference==="webgl2")&&(s=R.create(e,{onLost:this.onContextLost}),s||$(this.holder)),s?this.install(s):this.backendPreference==="webgl2"?this.none(e):(this.pending=e,(Ge??(Ge=import("./Canvas2DBackend-C2AYDVCI.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($(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=ut()),!(!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),o=dt(this.host),r=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Fe);if(i===this.viewport.width&&s===this.viewport.height&&r===this.pixelRatio&&Ze(o,this.inset))return;const a=this.viewport;if(this.viewport={width:i,height:s},this.inset=o,this.pixelRatio=r,(d=this.backend)==null||d.resize(i,s,r),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}))}this.emit("viewport")}t?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var t,e,i,s;typeof window>"u"||typeof window.matchMedia!="function"||((e=(t=this.dprQuery)==null?void 0:t.removeEventListener)==null||e.call(t,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(s=(i=this.dprQuery).addEventListener)==null||s.call(i,"change",this.onPixelRatioChange))}setUnloadable(t){t!==this.unloadable&&(this.unloadable=t,this.emit("unloadable",t))}emit(t,e){var i;(i=this.listeners.get(t))==null||i.forEach(s=>s(e))}}const ut=()=>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 ft(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function H(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}const ii=(n,t)=>new Xe(n,t);export{Gt as b,Zt as h,ze as p,ii as r};
@@ -1 +1 @@
1
- import{u as c,A as l,x as u,aG as p,_ as d,k as m}from"./shared-DJyYaNgB.mjs";import"./styles-Cm1KSkd5.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,aH as p,_ as d,k as m}from"./shared-Cqxks7jF.mjs";import"./styles-C9QeBpjd.mjs";const f=new WeakMap;function v(t){let n=f.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:r=>c(y,{...r,render:o})},f.set(t,n)}return n}function b(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(v)}function y({render:t,canvases:n,bodies:o,children:r}){const a=l(null),i=u(p);return d(()=>{const e=a.current;if(!e)return;const s=t(e,{canvases:n,bodies:o,clover:i});return()=>{typeof s=="function"&&s(),e.replaceChildren()}},[t,n,o,i]),c(m,{children:[c("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),r&&c("div",{className:"clover-canvas-controls",children:r})]})}export{b as toRenderers};
@@ -1 +1 @@
1
- import{x as n,a1 as o,Q as r}from"./shared-DJyYaNgB.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,a2 as o,Q as r}from"./shared-Cqxks7jF.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{a3 as a}from"./shared-DJyYaNgB.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{a4 as a}from"./shared-Cqxks7jF.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 +1 @@
1
- import{aB as w,S as f,ac as x,V as S}from"./shared-DJyYaNgB.mjs";const A=10;async function P(r,t,s,o,e){var n,d;const i=(n=r.get().manifest)==null?void 0:n.id;try{const{hits:c,set:u}=await b(t,s,{request:o,signal:e});if(e.aborted||((d=r.get().manifest)==null?void 0:d.id)!==i)return;r.set({search:{query:s,status:"ready",hits:c,set:u}})}catch{if(e.aborted)return;r.set({search:{query:s,status:"error",hits:[],set:null}})}}async function b(r,t,{request:s,signal:o}={}){const e=new URL(r.id);e.searchParams.set("q",t);const i=[];let n=e.toString();const d=new Set;for(;n&&i.length<A&&!d.has(n);){d.add(n);const c=await w(s,n,o);i.push(c),n=V(c)}return $(i,t)}function T(r){var e;const t=f(r)[0];if(typeof t=="string"||!t)return t;const s=t.full??t["@id"],o=(e=f(t.selector)[0])==null?void 0:e.value;return typeof o=="string"&&typeof s=="string"?`${s}#${o}`:s}function V(r){var o;const t=r.next??((o=r.within)==null?void 0:o.next),s=typeof t=="string"?t:(t==null?void 0:t.id)??(t==null?void 0:t["@id"]);return typeof s=="string"?s:null}function $(r,t){var e,i;const s=[],o=[];for(const n of r){const d=Array.isArray(n.resources),c=d?n.resources:f(n.items),u=new Map;for(const a of c){const p=a.id??a["@id"],m=d?T(a.on):f(a.target)[0],v=x(m);if(!p||!v.id)continue;const y=d?(e=a.resource)==null?void 0:e.chars:f(a.body).map(l=>l==null?void 0:l.value).find(l=>typeof l=="string"),I={id:p,setId:S,canvasId:v.id,target:v,motivation:["highlighting"],bodies:[{value:String(y??t)}],annotation:{id:p,type:"Annotation",motivation:["highlighting"],body:{type:"TextualBody",value:String(y??t)},target:m}};u.set(p,I),s.push(I)}const g=d?E(n,u):H(n,u),h=new Set(g.flatMap(a=>a.entryIds));o.push(...g);for(const a of u.values())h.has(a.id)||o.push({id:a.id,canvasId:a.canvasId,entryIds:[a.id],match:((i=a.bodies[0])==null?void 0:i.value)??t})}return{query:t,hits:o,set:{id:S,label:{none:[t]},source:"search",entries:s}}}function E(r,t){var o;const s=[];for(const e of f(r.hits)){const i=f(e.annotations).filter(n=>t.has(n));i.length&&s.push({id:i.join(" "),canvasId:t.get(i[0]).canvasId,entryIds:i,before:e.before,match:String(e.match??((o=t.get(i[0]).bodies[0])==null?void 0:o.value)??""),after:e.after})}return s}function H(r,t){var o,e;const s=[];for(const i of f(r.annotations))for(const n of f(i==null?void 0:i.items))if(f(n==null?void 0:n.motivation).includes("contextualizing"))for(const c of f(n.target)){const u=typeof(c==null?void 0:c.source)=="string"?c.source:(o=c==null?void 0:c.source)==null?void 0:o.id,g=u?t.get(u):void 0;if(!g)continue;const h=f(c.selector).find(a=>(a==null?void 0:a.type)==="TextQuoteSelector");s.push({id:`${n.id??u}#${u}`,canvasId:g.canvasId,entryIds:[g.id],before:h==null?void 0:h.prefix,match:String((h==null?void 0:h.exact)??((e=g.bodies[0])==null?void 0:e.value)??""),after:h==null?void 0:h.suffix})}return s}export{$ as readResults,b as search,P as searchInto};
1
+ import{aC as w,U as f,ad as x,W as S}from"./shared-Cqxks7jF.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 cr=Object.defineProperty;var lr=(e,t,n)=>t in e?cr(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var se=(e,t,n)=>lr(e,typeof t!="symbol"?t+"":t,n);import{a as Ie}from"./index-BjpZQ9J-.mjs";const ur=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"}'),Gn={es:()=>import("./es-B1NvdYp-.mjs"),fi:()=>import("./fi-BjtYZNLo.mjs"),fr:()=>import("./fr-Cd22Lziw.mjs"),it:()=>import("./it-UWaPOPDN.mjs"),ja:()=>import("./ja-Cg1enUhM.mjs"),nb:()=>import("./nb-CEwZDBiR.mjs"),nn:()=>import("./nn-jYQhr9RI.mjs"),no:()=>import("./no-CEwZDBiR.mjs"),pt:()=>import("./pt-CWR30SzS.mjs"),"zh-Hans":()=>import("./zh-Hans-DnYm6PWu.mjs"),"zh-Hant":()=>import("./zh-Hant-DsxnuLPZ.mjs")};function At(){return typeof navigator>"u"?[]:[...navigator.languages??[],navigator.language].filter(Boolean)}function Zn(){if(!(typeof document>"u"))return document.documentElement.lang||void 0}let Yn=()=>[];function fr(e){Yn=e}function dr(){const[e,...t]=Yn();return[...new Set([e,...At(),...t,Zn()].filter(n=>!!n))]}const Xe=e=>e.split("-")[0];function _r(e,t){return Xe(e).toLowerCase()===Xe(t).toLowerCase()}function vt(e){try{const{language:t,script:n}=new Intl.Locale(e).maximize();return n&&`${t}-${n}`}catch{return}}function pr(e,t){const n=vt(e);if(n)return t.find(o=>o!=="none"&&o!=="@none"&&vt(o)===n)}const at=e=>e.includes("-")?Xe(e):null;function vr(e,t,n=[]){if(!t.length)return;if(t.length===1)return t[0];const o=()=>t.includes("none")?"none":t.includes("@none")?"@none":t[0];if(!e)return t.includes("none")?"none":t[0];if(t.includes(e))return e;const r=at(e);if(r&&t.includes(r))return r;const s=pr(e,t);if(s)return s;const i=n.find(a=>t.includes(a));if(i)return i;const c=t.findIndex(a=>at(a)===e);if(c!==-1)return t[c];for(const a of n){const l=at(a);if(l&&t.includes(l))return l}return o()}function Xn(e,t){const[n,...o]=t?[t]:dr();return vr(n,e,o)??e[0]}function Di(e,t,n){if(n&&e.includes(n))return n;if(!e.length)return;const o=Xn(e,t);return o==="none"?e[0]:o}const Y="clover",G={en:{[Y]:{...ur}}};let Me=[],J,Qe=[],Qn=[],Mt=0;const ht=new Set;function Et(){Mt++,ht.forEach(e=>e())}function eo(e){return[e,vt(e),Xe(e)].filter(t=>!!t)}const hr=e=>e==="en"||to(e)||!!G[e],de=e=>eo(e).find(hr),Xt=new Map,to=e=>Object.prototype.hasOwnProperty.call(Gn,e);function mr(e){let t=Xt.get(e);return t||(t=Gn[e]().then(({default:n})=>{var o;G[e]={...G[e],[Y]:{...n,...(o=G[e])==null?void 0:o[Y]}},Et()},()=>{}),Xt.set(e,t)),t}function mt(e){const t=e.find(n=>n==="en"||to(n));return t&&t!=="en"?mr(t):Promise.resolve()}let ze=[],Qt="",Ne="en";function tt(){const e=Zn();return[...new Set([...Me,...e?[e]:[]])]}function fe(){const e=`${Mt} ${typeof document<"u"?document.documentElement.lang:""} ${typeof navigator<"u"?navigator.languages:""}`;if(e===Qt)return ze;Qt=e;const t=tt();return Ne=At().map(de).find(Boolean)??t.map(de).find(Boolean)??"en",ze=[...new Set([J??Ne,...Qn,...t].filter(o=>!!o).flatMap(eo).concat("en"))],mt(ze),ze}function gr(){return fe(),[...new Set([Ne,...tt().map(de),...Qe.map(de)].filter(e=>!!e))]}fr(()=>(fe(),[J,Ne,...tt()]));function no(e,t){if(e)return _r(e,t||R.resolvedLanguage)?void 0:e}const R={get language(){return J??fe().find(e=>G[e])??"en"},get chosenLanguage(){return J},stringsFor(e){return de(e)},interfaceLanguages(){return{languages:gr(),chosen:J&&de(J)||Ne}},chooseInterfaceLanguage(e){return J=e||void 0,Qe=J?[...new Set([...Qe,J])]:[],Et(),mt(fe())},get resolvedLanguage(){return fe().find(e=>{var t;return Object.keys(((t=G[e])==null?void 0:t[Y])??{}).length>0})??"en"},changeLanguage(e){return R.chooseInterfaceLanguage(e)},resolve(e,t,n=Y){var r,s;let o={text:e};for(const i of fe()){const c=(s=(r=G[i])==null?void 0:r[n])==null?void 0:s[e];if(c!==void 0){o={text:c,lang:i};break}}return t?{...o,text:o.text.replace(/\{\{(\w+)\}\}/g,(i,c)=>c in t?String(t[c]):i)}:o},t(e,t,n=Y){return R.resolve(e,t,n).text},langOf(e,t,n=Y){return no(R.resolve(e,void 0,n).lang,t)},ready(){return mt(fe())},subscribe(e){return ht.add(e),()=>{ht.delete(e)}},getSnapshot(){return Mt}};typeof document<"u"&&fe();function yr(e={}){for(const[n,o]of Object.entries(e.resources??{}))for(const[r,s]of Object.entries(o??{}))G[n]??(G[n]={}),G[n][r]={...G[n][r],...s};e.fallbackLng!==void 0&&(Qn=e.fallbackLng===false?[]:[e.fallbackLng].flat());const t=Me.join();if(e.languages!==void 0?Me=[e.languages].flat().filter(Boolean):e.lng&&(Me=[e.lng]),Me.join()!==t){Qe=[];const n=[...At(),...tt()].map(de);J&&!n.includes(de(J))&&(J=void 0)}return Et(),R}const ji=Object.freeze(Object.defineProperty({__proto__:null,CLOVER_I18N_NAMESPACE:Y,cloverI18n:R,initCloverI18n:yr,langWithin:no},Symbol.toStringTag,{value:"Module"}));var Fe,x,oo,ve,en,ro,so,io,Tt,gt,yt,ao,Re={},co=[],br=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,He=Array.isArray;function ne(e,t){for(var n in t)e[n]=t[n];return e}function $t(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ae(e,t,n){var o,r,s,i={};for(s in t)s=="key"?o=t[s]:s=="ref"?r=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?Fe.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)i[s]===void 0&&(i[s]=e.defaultProps[s]);return Te(e,i,o,r,null)}function Te(e,t,n,o,r){var s={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++oo,__i:-1,__u:0};return r==null&&x.vnode!=null&&x.vnode(s),s}function wr(){return{current:null}}function Q(e){return e.children}function X(e,t){this.props=e,this.context=t}function xe(e,t){if(t==null)return e.__?xe(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"?xe(e):null}function lo(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return lo(e)}}function bt(e){(!e.__d&&(e.__d=true)&&ve.push(e)&&!et.__r++||en!=x.debounceRendering)&&((en=x.debounceRendering)||ro)(et)}function et(){for(var e,t,n,o,r,s,i,c=1;ve.length;)ve.length>c&&ve.sort(so),e=ve.shift(),c=ve.length,e.__d&&(n=void 0,o=void 0,r=(o=(t=e).__v).__e,s=[],i=[],t.__P&&((n=ne({},o)).__v=o.__v+1,x.vnode&&x.vnode(n),Nt(t.__P,n,o,t.__n,t.__P.namespaceURI,32&o.__u?[r]:null,s,r??xe(o),!!(32&o.__u),i),n.__v=o.__v,n.__.__k[n.__i]=n,_o(s,n,i),o.__e=o.__=null,n.__e!=r&&lo(n)));et.__r=0}function uo(e,t,n,o,r,s,i,c,a,l,d){var u,_,v,g,A,C,I,S=o&&o.__k||co,b=t.length;for(a=Sr(n,t,S,a,b),u=0;u<b;u++)(v=n.__k[u])!=null&&(_=v.__i==-1?Re:S[v.__i]||Re,v.__i=u,C=Nt(e,v,_,r,s,i,c,a,l,d),g=v.__e,v.ref&&_.ref!=v.ref&&(_.ref&&Rt(_.ref,null,v),d.push(v.ref,v.__c||g,v)),A==null&&g!=null&&(A=g),(I=!!(4&v.__u))||_.__k===v.__k?a=fo(v,a,e,I):typeof v.type=="function"&&C!==void 0?a=C:g&&(a=g.nextSibling),v.__u&=-7);return n.__e=A,a}function Sr(e,t,n,o,r){var s,i,c,a,l,d=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"?(a=s+_,(i=e.__k[s]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?Te(null,i,null,null,null):He(i)?Te(Q,{children:i},null,null,null):i.constructor==null&&i.__b>0?Te(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,c=null,(l=i.__i=Cr(i,n,a,u))!=-1&&(u--,(c=n[l])&&(c.__u|=2)),c==null||c.__v==null?(l==-1&&(r>d?_--:r<d&&_++),typeof i.type!="function"&&(i.__u|=4)):l!=a&&(l==a-1?_--:l==a+1?_++:(l>a?_--:_++,i.__u|=4))):e.__k[s]=null;if(u)for(s=0;s<d;s++)(c=n[s])!=null&&!(2&c.__u)&&(c.__e==o&&(o=xe(c)),vo(c,c));return o}function fo(e,t,n,o){var r,s;if(typeof e.type=="function"){for(r=e.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=e,t=fo(r[s],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=xe(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ie(e,t){return t=t||[],e==null||typeof e=="boolean"||(He(e)?e.some(function(n){ie(n,t)}):t.push(e)),t}function Cr(e,t,n,o){var r,s,i,c=e.key,a=e.type,l=t[n],d=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||d&&c==l.key&&a==l.type)return n;if(o>(d?1:0)){for(r=n-1,s=n+1;r>=0||s<t.length;)if((l=t[i=r>=0?r--:s++])!=null&&!(2&l.__u)&&c==l.key&&a==l.type)return i}return-1}function tn(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||br.test(t)?n:n+"px"}function qe(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||tn(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||tn(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(io,"$1")),i=t.toLowerCase(),t=i in e||t=="onFocusOut"||t=="onFocusIn"?i.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?o?n.u=o.u:(n.u=Tt,e.addEventListener(t,s?yt:gt,s)):e.removeEventListener(t,s?yt:gt,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 nn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Tt++;else if(t.t<n.u)return;return n(x.event?x.event(t):t)}}}function Nt(e,t,n,o,r,s,i,c,a,l){var d,u,_,v,g,A,C,I,S,b,P,E,D,W,V,ee,te,j=t.type;if(t.constructor!=null)return null;128&n.__u&&(a=!!(32&n.__u),s=[c=t.__e=n.__e]),(d=x.__b)&&d(t);e:if(typeof j=="function")try{if(I=t.props,S="prototype"in j&&j.prototype.render,b=(d=j.contextType)&&o[d.__c],P=d?b?b.props.value:d.__:o,n.__c?C=(u=t.__c=n.__c).__=u.__E:(S?t.__c=u=new j(I,P):(t.__c=u=new X(I,P),u.constructor=j,u.render=kr),b&&b.sub(u),u.props=I,u.state||(u.state={}),u.context=P,u.__n=o,_=u.__d=true,u.__h=[],u._sb=[]),S&&u.__s==null&&(u.__s=u.state),S&&j.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ne({},u.__s)),ne(u.__s,j.getDerivedStateFromProps(I,u.__s))),v=u.props,g=u.state,u.__v=t,_)S&&j.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),S&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(S&&j.getDerivedStateFromProps==null&&I!==v&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(I,P),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(I,u.__s,P)===false||t.__v==n.__v){for(t.__v!=n.__v&&(u.props=I,u.state=u.__s,u.__d=false),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(z){z&&(z.__=t)}),E=0;E<u._sb.length;E++)u.__h.push(u._sb[E]);u._sb=[],u.__h.length&&i.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(I,u.__s,P),S&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(v,g,A)})}if(u.context=P,u.props=I,u.__P=e,u.__e=false,D=x.__r,W=0,S){for(u.state=u.__s,u.__d=false,D&&D(t),d=u.render(u.props,u.state,u.context),V=0;V<u._sb.length;V++)u.__h.push(u._sb[V]);u._sb=[]}else do u.__d=false,D&&D(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++W<25);u.state=u.__s,u.getChildContext!=null&&(o=ne(ne({},o),u.getChildContext())),S&&!_&&u.getSnapshotBeforeUpdate!=null&&(A=u.getSnapshotBeforeUpdate(v,g)),ee=d,d!=null&&d.type===Q&&d.key==null&&(ee=po(d.props.children)),c=uo(e,He(ee)?ee:[ee],t,n,o,r,s,i,c,a,l),u.base=t.__e,t.__u&=-161,u.__h.length&&i.push(u),C&&(u.__E=u.__=null)}catch(z){if(t.__v=null,a||s!=null)if(z.then){for(t.__u|=a?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,t.__e=c}else{for(te=s.length;te--;)$t(s[te]);wt(t)}else t.__e=n.__e,t.__k=n.__k,z.then||wt(t);x.__e(z,t,n)}else s==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=xr(n.__e,t,n,o,r,s,i,a,l);return(d=x.diffed)&&d(t),128&t.__u?void 0:c}function wt(e){e&&e.__c&&(e.__c.__e=true),e&&e.__k&&e.__k.forEach(wt)}function _o(e,t,n){for(var o=0;o<n.length;o++)Rt(n[o],n[++o],n[++o]);x.__c&&x.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(s){s.call(r)})}catch(s){x.__e(s,r.__v)}})}function po(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:He(e)?e.map(po):ne({},e)}function xr(e,t,n,o,r,s,i,c,a){var l,d,u,_,v,g,A,C=n.props,I=t.props,S=t.type;if(S=="svg"?r="http://www.w3.org/2000/svg":S=="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==!!S&&(S?v.localName==S:v.nodeType==3)){e=v,s[l]=null;break}}if(e==null){if(S==null)return document.createTextNode(I);e=document.createElementNS(r,S,I.is&&I),c&&(x.__m&&x.__m(t,s),c=false),s=null}if(S==null)C===I||c&&e.data==I||(e.data=I);else{if(s=s&&Fe.call(e.childNodes),C=n.props||Re,!c&&s!=null)for(C={},l=0;l<e.attributes.length;l++)C[(v=e.attributes[l]).name]=v.value;for(l in C)if(v=C[l],l!="children"){if(l=="dangerouslySetInnerHTML")u=v;else if(!(l in I)){if(l=="value"&&"defaultValue"in I||l=="checked"&&"defaultChecked"in I)continue;qe(e,l,null,v,r)}}for(l in I)v=I[l],l=="children"?_=v:l=="dangerouslySetInnerHTML"?d=v:l=="value"?g=v:l=="checked"?A=v:c&&typeof v!="function"||C[l]===v||qe(e,l,v,C[l],r);if(d)c||u&&(d.__html==u.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),uo(t.type=="template"?e.content:e,He(_)?_:[_],t,n,o,S=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,i,s?s[0]:n.__k&&xe(n,0),c,a),s!=null)for(l=s.length;l--;)$t(s[l]);c||(l="value",S=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[l]||S=="progress"&&!g||S=="option"&&g!=C[l])&&qe(e,l,g,C[l],r),l="checked",A!=null&&A!=e[l]&&qe(e,l,A,C[l],r))}return e}function Rt(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(r){x.__e(r,n)}}function vo(e,t,n){var o,r;if(x.unmount&&x.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Rt(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(s){x.__e(s,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&vo(o[r],t,n||typeof e.type!="function");n||$t(e.__e),e.__c=e.__=e.__e=void 0}function kr(e,t,n){return this.constructor(e,n)}function Le(e,t,n){var o,r,s,i;t==document&&(t=document.documentElement),x.__&&x.__(e,t),r=(o=typeof n=="function")?null:n&&n.__k||t.__k,s=[],i=[],Nt(t,e=(!o&&n||t).__k=ae(Q,null,[e]),r||Re,Re,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?Fe.call(t.childNodes):null,s,!o&&n?n:r?r.__e:t.firstChild,o,i),_o(s,e,i)}function ho(e,t){Le(e,t,ho)}function Ir(e,t,n){var o,r,s,i,c=ne({},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]:c[s]=t[s]===void 0&&i!=null?i[s]:t[s];return arguments.length>2&&(c.children=arguments.length>3?Fe.call(arguments,2):n),Te(e.type,c,o||e.key,r||e.ref,null)}function De(e){function t(n){var o,r;return this.getChildContext||(o=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&o.forEach(function(i){i.__e=true,bt(i)})},this.sub=function(s){o.add(s);var i=s.componentWillUnmount;s.componentWillUnmount=function(){o&&o.delete(s),i&&i.call(s)}}),n.children}return t.__c="__cC"+ao++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,o){return n.children(o)}).contextType=t,t}Fe=co.slice,x={__e:function(e,t,n,o){for(var r,s,i;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(e)),i=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),i=r.__d),i)return r.__E=r}catch(c){e=c}throw e}},oo=0,X.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ne({},this.state),typeof e=="function"&&(e=e(ne({},n),this.props)),e&&ne(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),bt(this))},X.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),bt(this))},X.prototype.render=Q,ve=[],ro=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,so=function(e,t){return e.__v.__b-t.__v.__b},et.__r=0,io=/(PointerCapture)$|Capture$/i,Tt=0,gt=nn(false),yt=nn(true),ao=0;var Or=0;function L(e,t,n,o,r,s){t||(t={});var i,c,a=t;if("ref"in a)for(c in a={},t)c=="ref"?i=t[c]:a[c]=t[c];var l={type:e,props:a,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Or,__i:-1,__u:0,__source:r,__self:s};if(typeof e=="function"&&(i=e.defaultProps))for(c in i)a[c]===void 0&&(a[c]=i[c]);return x.vnode&&x.vnode(l),l}var _e,$,ct,on,ke=0,mo=[],N=x,rn=N.__b,sn=N.__r,an=N.diffed,cn=N.__c,ln=N.unmount,un=N.__;function Oe(e,t){N.__h&&N.__h($,e,ke||t),ke=0;var n=$.__H||($.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function K(e){return ke=1,Lt(bo,e)}function Lt(e,t,n){var o=Oe(_e++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):bo(void 0,t),function(c){var a=o.__N?o.__N[0]:o.__[0],l=o.t(a,c);a!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=$,!$.__f)){var r=function(c,a,l){if(!o.__c.__H)return true;var d=o.__c.__H.__.filter(function(_){return!!_.__c});if(d.every(function(_){return!_.__N}))return!s||s.call(this,c,a,l);var u=o.__c.props!==c;return d.forEach(function(_){if(_.__N){var v=_.__[0];_.__=_.__N,_.__N=void 0,v!==_.__[0]&&(u=true)}}),s&&s.call(this,c,a,l)||u};$.__f=true;var s=$.shouldComponentUpdate,i=$.componentWillUpdate;$.componentWillUpdate=function(c,a,l){if(this.__e){var d=s;s=void 0,r(c,a,l),s=d}i&&i.call(this,c,a,l)},$.shouldComponentUpdate=r}return o.__N||o.__}function F(e,t){var n=Oe(_e++,3);!N.__s&&Ft(n.__H,t)&&(n.__=e,n.u=t,$.__H.__h.push(n))}function Z(e,t){var n=Oe(_e++,4);!N.__s&&Ft(n.__H,t)&&(n.__=e,n.u=t,$.__h.push(n))}function H(e){return ke=5,he(function(){return{current:e}},[])}function go(e,t,n){ke=6,Z(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 he(e,t){var n=Oe(_e++,7);return Ft(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ce(e,t){return ke=8,he(function(){return e},t)}function pe(e){var t=$.context[e.__c],n=Oe(_e++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub($)),t.props.value):e.__}function yo(e,t){N.useDebugValue&&N.useDebugValue(t?t(e):e)}function Ut(){var e=Oe(_e++,11);if(!e.__){for(var t=$.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Pr(){for(var e;e=mo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ze),e.__H.__h.forEach(St),e.__H.__h=[]}catch(t){e.__H.__h=[],N.__e(t,e.__v)}}N.__b=function(e){$=null,rn&&rn(e)},N.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),un&&un(e,t)},N.__r=function(e){sn&&sn(e),_e=0;var t=($=e.__c).__H;t&&(ct===$?(t.__h=[],$.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Ze),t.__h.forEach(St),t.__h=[],_e=0)),ct=$},N.diffed=function(e){an&&an(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(mo.push(t)!==1&&on===N.requestAnimationFrame||((on=N.requestAnimationFrame)||Ar)(Pr)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),ct=$=null},N.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ze),n.__h=n.__h.filter(function(o){return!o.__||St(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],N.__e(o,n.__v)}}),cn&&cn(e,t)},N.unmount=function(e){ln&&ln(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{Ze(o)}catch(r){t=r}}),n.__H=void 0,t&&N.__e(t,n.__v))};var fn=typeof requestAnimationFrame=="function";function Ar(e){var t,n=function(){clearTimeout(o),fn&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);fn&&(t=requestAnimationFrame(n))}function Ze(e){var t=$,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),$=t}function St(e){var t=$;e.__c=e.__(),$=t}function Ft(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function bo(e,t){return typeof t=="function"?t(e):t}function wo(e,t){for(var n in t)e[n]=t[n];return e}function Ct(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 oe(e,t){var n=t(),o=K({t:{__:n,u:t}}),r=o[0].t,s=o[1];return Z(function(){r.__=n,r.u=t,lt(r)&&s({t:r})},[e,n,t]),F(function(){return lt(r)&&s({t:r}),e(function(){lt(r)&&s({t:r})})},[e]),n}function lt(e){var t,n,o=e.u,r=e.__;try{var s=o();return!((t=r)===(n=s)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return true}}function So(e){e()}function Co(e){return e}function xo(){return[false,So]}var ko=Z;function xt(e,t){this.props=e,this.context=t}function Ht(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:Ct(this.props,r)}function o(r){return this.shouldComponentUpdate=n,ae(e,r)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=true,o.__f=true,o.type=e,o}(xt.prototype=new X).isPureReactComponent=true,xt.prototype.shouldComponentUpdate=function(e,t){return Ct(this.props,e)||Ct(this.state,t)};var dn=x.__b;x.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),dn&&dn(e)};var Mr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Er(e){function t(n){var o=wo({},n);return delete o.ref,e(o,n.ref||null)}return t.$$typeof=Mr,t.render=e,t.prototype.isReactComponent=t.__f=true,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var _n=function(e,t){return e==null?null:ie(ie(e).map(t))},Tr={map:_n,forEach:_n,count:function(e){return e?ie(e).length:0},only:function(e){var t=ie(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ie},$r=x.__e;x.__e=function(e,t,n,o){if(e.then){for(var r,s=t;s=s.__;)if((r=s.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}$r(e,t,n,o)};var pn=x.unmount;function Io(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=wo({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=true,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return Io(o,t,n)})),e}function Oo(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return Oo(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function Ye(){this.__u=0,this.o=null,this.__b=null}function Po(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Nr(e){var t,n,o;function r(s){if(t||(t=e()).then(function(i){n=i.default||i},function(i){o=i}),o)throw o;if(!n)throw t;return ae(n,s)}return r.displayName="Lazy",r.__f=true,r}function Ee(){this.i=null,this.l=null}x.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),pn&&pn(e)},(Ye.prototype=new X).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=Po(o.__v),s=false,i=function(){s||(s=true,n.__R=null,r?r(c):c())};n.__R=i;var c=function(){if(!--o.__u){if(o.state.__a){var a=o.state.__a;o.__v.__k[0]=Oo(a,a.__c.__P,a.__c.__O)}var l;for(o.setState({__a:o.__b=null});l=o.o.pop();)l.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(i,i)},Ye.prototype.componentWillUnmount=function(){this.o=[]},Ye.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Io(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&ae(Q,null,e.fallback);return r&&(r.__u&=-33),[ae(Q,null,t.__a?null:e.children),r]};var vn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Rr(e){return this.getChildContext=function(){return e.context},e.children}function Lr(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){Le(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)}}}Le(ae(Rr,{context:t.context},e.__v),t.v)}function Dt(e,t){var n=ae(Lr,{__v:e,h:t});return n.containerInfo=t,n}(Ee.prototype=new X).__a=function(e){var t=this,n=Po(t.__v),o=t.l.get(e);return o[0]++,function(r){var s=function(){t.props.revealOrder?(o.push(r),vn(t,e,o)):r()};n?n(s):s()}},Ee.prototype.render=function(e){this.i=null,this.l=new Map;var t=ie(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ee.prototype.componentDidUpdate=Ee.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){vn(e,n,t)})};var Ao=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Ur=/^(?: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]/,Fr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Hr=/[A-Z0-9]/g,Dr=typeof document<"u",jr=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=""),Le(e,t),typeof n=="function"&&n(),e?e.__c:null}function Br(e,t,n){return ho(e,t),typeof n=="function"&&n(),e?e.__c:null}X.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(X.prototype,e,{configurable:true,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t})}})});var hn=x.event;function Wr(){}function Vr(){return this.cancelBubble}function zr(){return this.defaultPrevented}x.event=function(e){return hn&&(e=hn(e)),e.persist=Wr,e.isPropagationStopped=Vr,e.isDefaultPrevented=zr,e.nativeEvent=e};var jt,qr={enumerable:false,configurable:true,get:function(){return this.class}},mn=x.vnode;x.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,o=t.type,r={},s=o.indexOf("-")===-1;for(var i in n){var c=n[i];if(!(i==="value"&&"defaultValue"in n&&c==null||Dr&&i==="children"&&o==="noscript"||i==="class"||i==="className")){var a=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&c===true?c="":a==="translate"&&c==="no"?c=false:a[0]==="o"&&a[1]==="n"?a==="ondoubleclick"?i="ondblclick":a!=="onchange"||o!=="input"&&o!=="textarea"||jr(n.type)?a==="onfocus"?i="onfocusin":a==="onblur"?i="onfocusout":Fr.test(i)&&(i=a):a=i="oninput":s&&Ur.test(i)?i=i.replace(Hr,"-$&").toLowerCase():c===null&&(c=void 0),a==="oninput"&&r[i=a]&&(i="oninputCapture"),r[i]=c}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=ie(n.children).forEach(function(l){l.props.selected=r.value.indexOf(l.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=ie(n.children).forEach(function(l){l.props.selected=r.multiple?r.defaultValue.indexOf(l.props.value)!=-1:r.defaultValue==l.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",qr)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),t.props=r}(e),e.$$typeof=Ao,mn&&mn(e)};var gn=x.__r;x.__r=function(e){gn&&gn(e),jt=e.__c};var yn=x.diffed;x.diffed=function(e){yn&&yn(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),jt=null};var Jr={ReactCurrentDispatcher:{current:{readContext:function(e){return jt.__n[e.__c].props.value},useCallback:ce,useContext:pe,useDebugValue:yo,useDeferredValue:Co,useEffect:F,useId:Ut,useImperativeHandle:go,useInsertionEffect:ko,useLayoutEffect:Z,useMemo:he,useReducer:Lt,useRef:H,useState:K,useSyncExternalStore:oe,useTransition:xo}}};function Kr(e){return ae.bind(null,e)}function nt(e){return!!e&&e.$$typeof===Ao}function Gr(e){return nt(e)&&e.type===Q}function Zr(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Yr(e){return nt(e)?Ir.apply(null,arguments):e}function Eo(e){return!!e.__k&&(Le(null,e),true)}function Xr(e){return e&&(e.base||e.nodeType===1&&e)||null}var Qr=function(e,t){return e(t)},es=function(e,t){return e(t)},ts=Q,ns=nt,Bi={useState:K,useId:Ut,useReducer:Lt,useEffect:F,useLayoutEffect:Z,useInsertionEffect:ko,useTransition:xo,useDeferredValue:Co,useSyncExternalStore:oe,startTransition:So,useRef:H,useImperativeHandle:go,useMemo:he,useCallback:ce,useContext:pe,useDebugValue:yo,version:"18.3.1",Children:Tr,render:Mo,hydrate:Br,unmountComponentAtNode:Eo,createPortal:Dt,createElement:ae,createContext:De,createFactory:Kr,cloneElement:Yr,createRef:wr,Fragment:Q,isValidElement:nt,isElement:ns,isFragment:Gr,isMemo:Zr,findDOMNode:Xr,Component:X,PureComponent:xt,memo:Ht,forwardRef:Er,flushSync:es,unstable_batchedUpdates:Qr,StrictMode:ts,Suspense:Ye,SuspenseList:Ee,lazy:Nr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Jr};function os(e){return{render:function(t){Mo(t,e)},unmount:function(){Eo(e)}}}const Bt=De("");function rs(){return pe(Bt)+Ut()}Ie(1,"styles/scale","@layer clover{:root{--clover-space-3xs: .146rem;--clover-space-2xs: .236rem;--clover-space-xs: .382rem;--clover-space-s: .618rem;--clover-space-m: 1rem;--clover-space-l: 1.618rem;--clover-space-xl: 2.618rem;--clover-space-2xl: 4.236rem;--clover-text-xs: .764rem;--clover-text-s: .854rem;--clover-text-m: 1.146rem;--clover-text-l: 1.236rem;--clover-control: calc(1rem + 2 * var(--clover-space-s));--clover-inset: var(--clover-space-l);--clover-picture: calc(4 * var(--clover-space-xl))}:where(.clover-title){margin:0;font-weight:var(--clover-title-weight, 400);line-height:1.25;overflow-wrap:anywhere}:where(.clover-root,.clover-canvas,.clover-items,.clover-geomap) :where(button,input,select,textarea){font:inherit}:where(.clover-field-pill-query,.clover-collection-select-control){box-sizing:border-box;padding:var(--clover-space-xs) var(--clover-space-s);border:1px solid var( --clover-field-edge, color-mix( in srgb, var(--clover-color-primary-muted, #26292b) 80%, var(--clover-color-secondary, #fff) ) );border-radius:var(--clover-radius, 3px);background-color:var(--clover-color-secondary, #fff);color:var(--clover-color-primary, #1a1d1e)}:where(.clover-field-pill-query,.clover-collection-select-control):focus-visible{outline:2px solid var(--clover-color-accent, #0065c3);outline-offset:1px}:where(.clover-field-pill-query)::placeholder{color:color-mix(in srgb,var(--clover-color-primary, #1a1d1e) 65%,var(--clover-color-secondary, #fff));opacity:1}}");Ie(2,"styles/contrast","@layer clover{:where([data-high-contrast]){--clover-accent-fill: var(--clover-color-control, #1a1d1e);--clover-accent-ring: 3px solid var(--clover-color-accent, #0065c3);--clover-accent-ring-hover: 3px solid color-mix(in srgb, var(--clover-color-accent, #0065c3) 50%, transparent);--clover-accent-text-fallback: var(--clover-color-primary, #1a1d1e);--clover-transition: none}}");const ss="clover-root",To=Symbol("roots"),is=[];class $o{constructor(t){se(this,"entries",new Map);se(this,"lists",new Map);se(this,"listeners",new Map);se(this,"languages",new as(t2=>this.entries.has(t2)));this.count=t}list(t){return this.lists.get(t)??is}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(ss))??null:null,o=this.entries.get(t.element);if(o&&o.root===n)return;const r={hosted:t,key:(o==null?void 0:o.key)??++this.count.made,root:n};this.entries.set(t.element,r),o&&this.change(ut(o),i=>i.filter(c=>c!==o)),this.change(ut(r),i=>[...i,r]),t.needsRoot&&!n&&console.warn(`<${t.element.localName}> shows a <clover-root>'s state: put it inside one.`),t.kind!=="root"&&this.languages.draws(t.element.localName),(t.kind!=="part"||!n)&&this.languages.watch(t.element)}disconnect(t){const n=this.entries.get(t);n&&(this.entries.delete(t),this.change(ut(n),o=>o.filter(r=>r!==n)))}change(t,n){var o;this.lists.set(t,n(this.list(t))),(o=this.listeners.get(t))==null||o.forEach(r=>r())}}const ut=e=>e.hosted.kind==="root"?To:e.root;class as{constructor(t){se(this,"observer",null);se(this,"tags",new Set);this.isElement=t}draws(t){this.tags.add(t)}watch(t){this.observer??(this.observer=new MutationObserver(n=>{const o=[...this.tags,".clover-announcer"].join(",");for(const{target:r}of n){const s=r;s.getAttribute("lang")!==""||this.isElement(s)||s.closest(o)&&s.removeAttribute("lang")}})),this.observer.observe(t,{subtree:true,attributes:true,attributeFilter:["lang"]})}}function kt(e,t){const n=ce(r=>e.subscribe(t,r),[e,t]);return oe(n,()=>e.list(t))}function No(e){return oe(e.subscribe,e.getProps,e.getProps)}function cs({registry:e}){const t=kt(e,To),n=kt(e,null);return L(Q,{children:[t.map(o=>L(ls,{entry:o,registry:e},o.key)),n.map(o=>L(Lo,{entry:o},o.key))]})}const Ro=e=>`clover-${e.key}-`,ls=Ht(function({entry:t,registry:n}){const{hosted:o}=t,r=kt(n,o.element),s=No(o),i=o.Component;return L(Uo,{hosted:o,props:s,children:L(Bt.Provider,{value:Ro(t),children:L(i,{hosted:o,props:s,children:r.map(c=>L(Lo,{entry:c},c.key))})})})}),Lo=Ht(function({entry:t}){const{hosted:n}=t,o=No(n);if(n.needsRoot&&!t.root)return null;const r=n.Component;return Dt(L(Uo,{hosted:n,props:o,children:L(Bt.Provider,{value:Ro(t),children:L(r,{hosted:n,props:o})})}),n.element)});class Uo extends X{constructor(){super(...arguments);se(this,"state",{failed:false})}static getDerivedStateFromError(){return{failed:true}}componentDidCatch(n,o){console.error(`<${this.props.hosted.element.localName}>:`,n)}componentDidUpdate(n){this.state.failed&&n.props!==this.props.props&&this.setState({failed:false})}render(){return this.state.failed?null:this.props.children}}const bn=new WeakMap,Je=Symbol.for("clover.elements");function us(e){let t=bn.get(e);if(!t){const n=e;n[Je]&&console.warn("Clover is loaded twice on this page: load one entry."),t=new $o(n[Je]??(n[Je]={made:0})),bn.set(e,t),os(e.createElement("div")).render(L(cs,{registry:t}))}return t}const Wi=Object.freeze(Object.defineProperty({__proto__:null,Registry:$o,hostOf:us},Symbol.toStringTag,{value:"Module"})),Wt=De(void 0);function Fo(e=Y,t){const n=oe(R.subscribe,R.getSnapshot,R.getSnapshot),o=pe(Wt),r=t??o,s=ce((c,a)=>R.t(c,a,e),[e,n]),i=ce(c=>R.langOf(c,r,e),[e,n,r]);return{t:s,langOf:i,hostLanguage:r,i18n:R}}const fs=/^(ar|arc|ckb|dv|fa|he|iw|ks|ps|sd|syr|ug|ur|yi|ota|prs|azb|pnb|bal|glk|mzn|lrc|khw|nqo|rhg|jrb|jpr|sam|arz|ary|apc|acm|ajp|aeb|ars)$/,ds=/^(adlm|arab|hebr|nkoo|rohg|syrc|thaa)$/;function _s(e){if(!e)return;const[t,...n]=e.toLowerCase().split(/[-_]/),o=n.find(r=>/^[a-z]{4}$/.test(r));return(o?ds.test(o):fs.test(t))?"rtl":void 0}function wn(e){return e?{lang:e,dir:_s(e)}:{}}function ps(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 Vi=e=>(e==null?void 0:e.credentials)==="include",vs=e=>JSON.stringify([e==null?void 0:e.credentials,e==null?void 0:e.headers]);class hs extends Error{constructor(t,n,o){super(t),this.url=n,this.status=o,this.name="CloverRequestError"}}async function me(e,t,n){const o=await ps(e,t,{signal:n,headers:{Accept:"application/ld+json, application/json"}});if(!o.ok)throw new hs(`${t} answered ${o.status}`,t,o.status);return o.json()}const O=e=>Array.isArray(e)?e:e==null?[]:[e],Ho=["Independents","Composite","List"];function Do(e){return O(e==null?void 0:e.body).flatMap(t=>Ho.includes(t==null?void 0:t.type)?O(t.items):[t])}function ms(e){const t=O(e==null?void 0:e.motivation);return!t.length||t.includes("painting")}function gs(e){const t=[];for(const n of O(e==null?void 0:e.items))for(const o of O(n==null?void 0:n.items))if(ms(o))for(let r of Do(o))(r==null?void 0:r.type)==="Choice"&&(r=O(r.items)[0]),(r==null?void 0:r.type)==="SpecificResource"&&(r=typeof r.source=="string"?{id:r.source}:r.source),r&&t.push({body:r,annotation:o});return t}function jo(e,t,n=", "){if(!e)return{text:""};if(typeof e=="string")return{text:e};const o=Object.keys(e).filter(c=>{var a;return(a=e[c])==null?void 0:a.length});if(!o.length)return{text:""};const r=Xn(o,t),s=e[r];return{text:Array.isArray(s)?s.join(n):String(s),lang:r==="none"||r==="@none"?void 0:r}}const ys=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/;function zi(e){const t=e==null?void 0:e.language,n=(Array.isArray(t)?t:[t]).filter(o=>typeof o=="string"&&ys.test(o));return n.length===1?n[0]:void 0}const ot=De(null);function qi(){return pe(ot)}function bs(e="This part"){const t=pe(ot);if(!t)throw new Error(`${e} must be rendered inside <Clover.Root>.`);return t}function Ji(e,t=Object.is,n){const{clover:o}=bs(n),r=H(null),s=()=>{const i=e(o.store.get());return r.current&&t(r.current.value,i)?r.current.value:(r.current={value:i},i)};return oe(o.store.subscribe,s)}const ws={subscribe:()=>()=>{}};function Ki(e,t){const n=pe(ot),o=n==null?void 0:n.clover.store,r=()=>o?e(o.get()):t;return oe(o?o.subscribe:ws.subscribe,r)}function Ss(e,t){const n=pe(Wt),o=H(null),[r,s]=K(""),i=ce(d=>{o.current=d,typeof e=="function"?e(d):e&&(e.current=d)},[e]);F(()=>{var u,_;const d=(u=o.current)==null?void 0:u.parentElement;t!==void 0||n!==void 0||!d||s(((_=d.closest("[lang]"))==null?void 0:_.getAttribute("lang"))??"")});const a=t??n??r,{langOf:l}=Fo(void 0,a);return{ref:i,hostLanguage:a,langOf:l}}Ie(23,"ui/ReadMore","@layer clover{.clover-read-more{display:flex;flex-direction:column;align-items:flex-start;gap:var(--clover-space-xs);min-width:0}button.clover-read-more-button{margin:0;padding:0;border:0;background:none;color:var( --clover-color-accent-text, var(--clover-accent-text-fallback, var(--clover-color-accent, #0065c3)) );font-size:var(--clover-text-s);text-decoration:underline 1px;text-decoration-color:color-mix(in srgb,currentColor 20%,transparent);text-underline-offset:var(--clover-space-3xs);cursor:pointer}button.clover-read-more-button:hover{text-decoration-color:currentColor}button.clover-read-more-button:focus-visible{outline:2px solid var(--clover-color-accent, #0065c3);outline-offset:2px;border-radius:var(--clover-radius, 3px)}}");const Cs=["left-to-right","right-to-left","top-to-bottom","bottom-to-top"];function xs(e){return Cs.includes(e)?e:"left-to-right"}const ks=["individuals","paged","continuous","unordered"];function Is(e){return O(e).find(n=>ks.includes(n))??"individuals"}function Os(e,t){if(!e.length)return[];if(t==="continuous")return[e.map((c,a)=>a)];if(t!=="paged")return e.map((c,a)=>[a]);const n=[];let o=[],r=0,s=false;const i=()=>{o.length&&n.push(o),o=[]};return e.forEach((c,a)=>{const l=O(c.behavior);if(l.includes("non-paged")){a===r&&r++,i(),n.push([a]);return}if(a===r||l.includes("facing-pages")){o.length&&(s=true),i(),n.push([a]);return}if(o.push(a),s){i(),s=false;return}o.length>1&&i()}),i(),n}function Ps(e,t){const n=e.findIndex(o=>o.includes(t));return n===-1?0:n}function Bo(e,t){const n=/(?:^|[#&])t=([^&]+)/.exec(t),o=n&&{t:n[1]},r=/(?:^|[#&])xywh=(?:pixel:)?([^&]+)/.exec(t);if(r){const[s,i,c,a]=r[1].split(",").map(Number);if([s,i,c,a].every(Number.isFinite))return{id:e,rect:{x:s,y:i,w:c,h:a},...o}}return o&&{id:e,...o}}function Ke(e){const t=e.indexOf("#");if(t>=0){const o=e.slice(0,t);return Bo(o,e.slice(t))??{id:o}}const n=e.indexOf("&t=");return n>=0?{id:e.slice(0,n),t:e.slice(n+3)}:{id:e}}const It=e=>{var t;return Array.isArray(e)?It(e[0]):Ho.includes(e==null?void 0:e.type)?It((t=e.items)==null?void 0:t[0]):e};function rt(e){return As(It(e))}function As(e){var n;if(typeof e=="string")return Ke(e);if(!e||typeof e!="object")return{id:""};if(e.type!=="SpecificResource"||e.source===void 0)return Ke(e.id??"");const t=typeof e.source=="string"?Ke(e.source):Ke(((n=e.source)==null?void 0:n.id)??"");for(const o of O(e.selector)){const r=o;if((r==null?void 0:r.type)==="PointSelector"){const[s,i,c]=[r.x,r.y,r.instant??r.t].map(Number),a=Number.isFinite(s)&&Number.isFinite(i);return{id:t.id,...a?{point:{x:s,y:i}}:{},...Number.isFinite(c)?{t:String(c)}:{}}}if((r==null?void 0:r.type)==="SvgSelector"&&r.value)return{id:t.id,svg:String(r.value)};if((r==null?void 0:r.type)==="FragmentSelector"&&r.value){const s=Bo(t.id,String(r.value));if(s)return s}}return t}const Gi=e=>e==="Audio"||e==="Sound",Ms=e=>{const t=O(e);return t.length>0&&t.every(n=>n==="supplementing")},Es=(e,t)=>Ms(e)&&!!(t.rect||t.svg||t.point)&&!t.t,Sn=new WeakMap,Ts={canvases:[],views:[],direction:"left-to-right"};function B(e){if(!e)return Ts;let t=Sn.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:Os(n,Is(e.behavior)),direction:xs(e.viewingDirection)},Sn.set(e,t)}return t}const Cn=new WeakMap;function je(e,t){if(!t)return null;const n=B(e);let o=Cn.get(n);if(!o){o=new Map;for(const r of n.canvases)o.has(r.id)||o.set(r.id,r);Cn.set(n,o)}return o.get(t)??null}function st(e,t){const{canvases:n,views:o}=B(e),r=n.findIndex(s=>s.id===t);return r===-1?0:Ps(o,r)}const xn=new WeakMap,$s=[];function $e(e,t){if(!e)return $s;const n=st(e,t);let o=xn.get(e);o||xn.set(e,o=new Map);let r=o.get(n);if(!r){const s=B(e);r=(s.views[n]??[]).map(i=>s.canvases[i]),o.set(n,r)}return r}function Ns(e,t){var s,i;const{canvases:n,views:o}=B(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 Rs(e){const t=e==null?void 0:e.start;if(!t)return null;const n=rt(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 Zi=(e,t)=>{const n=e==null?void 0:e.behavior;return Array.isArray(n)?n.includes(t):n===t},Yi=e=>[(e==null?void 0:e.partOf)??[]].flat().find(t=>(t==null?void 0:t.id)&&t.type==="Collection");function Xi(e,t,n,o){const r=e==null?void 0:e.items;if(!(r!=null&&r.length)||!n)return-1;const s=$e(n,o),i=c=>{const a=r[c];return((a==null?void 0:a.manifestId)===n.id||(a==null?void 0:a.manifestAs)===n.id)&&(!a.canvasId||s.some(l=>l.id===a.canvasId))};return t!==null&&i(t)?t:r.findIndex((c,a)=>i(a))}Ie(29,"components/Primitives/Primitives","@layer clover{.clover-summary:not([data-read-more=open]){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--clover-summary-lines, 5);overflow:hidden}:is(.clover-metadata,.clover-required-statement){display:flex;flex-direction:column;gap:var(--clover-space-s);margin:0}:is(.clover-metadata,.clover-required-statement) dt{margin:0;font-weight:500}:is(.clover-metadata,.clover-required-statement) dd{margin:0}.clover-summary,:is(.clover-metadata,.clover-required-statement) :is(dt,dd){overflow-wrap:anywhere}:is(.clover-about,.clover-canvas-caption,.clover-annotations-body,.clover-metadata,.clover-required-statement,.clover-summary) a:not([class]){text-decoration-line:underline;text-underline-offset:var(--clover-space-3xs)}:is(.clover-homepage,.clover-rendering,.clover-see-also,.clover-part-of)>li{min-block-size:24px}:is(.clover-homepage,.clover-rendering,.clover-see-also,.clover-part-of) a,a:is(.clover-id,.clover-rights){color:var( --clover-color-accent-text, var(--clover-accent-text-fallback, var(--clover-color-accent, #0065c3)) );overflow-wrap:anywhere;text-decoration-line:underline;text-underline-offset:var(--clover-space-3xs)}.clover-link-format{color:var(--clover-color-primary-muted, #26292b);font-size:var(--clover-text-s)}}");const Ls={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Us=e=>(e==null?void 0:e.format)==="text/vtt"||typeof(e==null?void 0:e.id)=="string"&&/\.vtt(\?|$)/i.test(e.id);function Fs(e){const t=[];let n=0;const o=(r,s)=>{var c;if(!r||Us(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:O(r.language)[0],...i});else if(r.type==="Image"&&r.id){const a=r.label??e.label;t.push({image:r.id,format:r.format,...a?{label:a}:{},...i})}else if(r.type==="Feature"){const a=((c=r.properties)==null?void 0:c.label)??e.label;a&&typeof a=="object"&&t.push({label:a,place:true,...i})}};for(const r of Do(e))if((r==null?void 0:r.type)!=="Choice")o(r);else{const s=n++;for(const i of O(r.items))o(i,s)}return t}const Wo="content-search",Hs="contents",Qi=(e,t)=>`${e}#region-${t+1}`,Ds=e=>O(e==null?void 0:e.motivation).includes("linking");function Vo(e,t,n){const o=[];for(const r of O(e==null?void 0:e.items)){const s=O(r==null?void 0:r.motivation);if(s.includes("painting"))continue;const i=Fs(r);if(!i.length&&!Ds(r))continue;const c=rt(O(r.target)[0]),a=c.id||n;!a||!r.id||o.push({id:r.id,setId:t,canvasId:a,target:c,motivation:s,bodies:i,annotation:r})}return o}const js=e=>B(e).canvases.some(t=>O(t.items).some(n=>O(n==null?void 0:n.items).some(o=>O(o==null?void 0:o.body).some(r=>[r,...O(r==null?void 0:r.items)].some(s=>O(s==null?void 0:s.annotations).length>0)))));function Bs(e,t){for(const n of[e,t])if(n!=null&&n.label)return n.label;for(const n of[e,t]){const o=O(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 zo=e=>O(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"])))),kn=new WeakMap;function qo(e){var n;if(!e)return[];let t=kn.get(e);if(!t){const o=new Map;for(const r of B(e).canvases)for(const s of O(r.annotations)){if(!Array.isArray(s==null?void 0:s.items))continue;const i=s.id??`${r.id}#annotations`;let c=o.get(i);if(!c){const a=(n=zo(s)[0])==null?void 0:n.id;c={id:i,label:Bs(s),source:"manifest",entries:[],...a?{collection:a}:{}},o.set(i,c)}c.entries.push(...Vo(s,i,r.id))}t=[...o.values()].filter(r=>r.entries.length),kn.set(e,t)}return t}const In=new WeakMap,Jo=[];function ea(e){if(!e)return Jo;let t=In.get(e);return t||(t=B(e).canvases.flatMap(n=>O(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)}))),In.set(e,t)),t}const ft=new WeakMap,dt=new WeakMap;function Ws(e,t=Vs){var n;if(!dt.has(t)){const o=t.filter(s=>s.content),r=(n=o[0])==null?void 0:n.content;dt.set(t,r?{id:r.id,type:r.type,...r.label?{label:r.label}:{},pages:Jo,entries:o.flatMap(s=>s.entries)}:null)}return dt.get(t)??zs(e)}const Vs=[];function zs(e){var r;if(!e)return null;if(ft.has(e))return ft.get(e);const t=B(e).canvases.flatMap(s=>O(s.annotations).flatMap(i=>zo(i).map(c=>({part:c,page:i,canvas:s})))),n=(r=t[0])==null?void 0:r.part.id,o=n?(()=>{var l,d;const s=t.filter(({part:u})=>u.id===n),i=(l=s.find(({part:u})=>u.label))==null?void 0:l.part.label,c=Number((d=s.find(({part:u})=>u.total))==null?void 0:d.part.total),a=qo(e);return{id:n,type:"AnnotationCollection",...i?{label:i}:{},...c>0?{total:c}:{},pages:s.map(({page:u,canvas:_})=>({id:String(u.id),canvasId:String(_.id),fetched:Array.isArray(u.items)})),entries:s.flatMap(({page:u})=>{var _;return((_=a.find(v=>v.id===u.id))==null?void 0:_.entries)??[]})}})():null;return ft.set(e,o),o}const On=new WeakMap,Pn=[];function Ue(e,t){const n=qo(e);if(!t.length)return n.length?n:Pn;const o=e??Pn;let r=On.get(o);r||On.set(o,r=new Map);let s=r.get(t);if(!s){const i=new Set(n.map(c=>c.id));s=[...n,...t.filter(c=>!i.has(c.id)&&!!i.add(c.id))],r.set(t,s)}return s}const An=new WeakMap;function qs(e,t,n,o=null){const r=Ue(e,t),s=n!=null&&n.entries.length?n:null;if(!o&&!s)return r;let i=An.get(r);i||An.set(r,i=new Map);let c=i.get(o);c||i.set(o,c=new Map);let a=c.get(s);return a||(a=[...r,...o?[o]:[],...s?[s]:[]],c.set(s,a)),a}const Js=e=>Number(e==null?void 0:e.duration)>0;function Ko(e,t){return e.source==="search"||!e.entries.length?false:e.entries.every(n=>Es(n.motivation,n.target)&&!Js(t(n.canvasId)))}const Mn=new WeakMap;function ta(e,t){const n=Ue(e,t);let o=Mn.get(n);if(!o){const r=n.filter(s=>!Ko(s,i=>je(e,i)??void 0));o=r.length===n.length?n:r,Mn.set(n,o)}return o}const En=new WeakMap;function Go(e,t,n,o){const r=Ue(e,t),s=En.get(r);if(s&&s.hidden===n&&s.shown===o)return s.ids;const i=r.filter(a=>!n.includes(a.id)&&!o.includes(a.id)&&Ko(a,l=>je(e,l)??void 0)).map(a=>a.id),c=i.length?[...n,...i]:n;return En.set(r,{hidden:n,shown:o,ids:c}),c}const Tn=new WeakMap,$n=[Wo,Hs];function na(e,t,n,o,r){if(!r)return $n;const s=Go(e,t,n,o),i=Tn.get(s);if(i&&i.hidden===n)return i.ids;const c=[...$n,...s.filter(a=>!n.includes(a))];return Tn.set(s,{hidden:n,ids:c}),c}function Ks(e){for(const t of O(e==null?void 0:e.target)){const n=(t==null?void 0:t.type)==="SpecificResource"?t.source:t,o=O(n==null?void 0:n.partOf).find(r=>(r==null?void 0:r.id)&&(!r.type||r.type==="Manifest"));if(o)return o.id}}function _t(e,t){if(!t)return null;for(const n of e){const o=n.entries.find(r=>r.id===t);if(o)return o}return null}function Zo(e){return btoa(encodeURIComponent(JSON.stringify(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Yo({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,c={"@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:c,encoded:Zo(c)}}const oa=Object.freeze(Object.defineProperty({__proto__:null,buildContentState:Yo,encodeContentState:Zo},Symbol.toStringTag,{value:"Module"})),Gs=/iiif\.io\/api\/presentation\/4\/context\.json/;function Xo(e){const t=e==null?void 0:e["@context"];return(Array.isArray(t)?t:[t]).some(o=>typeof o=="string"&&Gs.test(o))}let Nn=null,Rn=null;function Vt(){return Rn??(Rn=import("./upgrade-eNW0DPXq.mjs")),Nn??(Nn=import("./upgrader-BlbMUEH6.mjs").then(({upgradePresentation3To4:e})=>e)),Promise.all([Nn,Rn])}async function ge(e){if(Xo(e))return e;const[t,{upgrade:n}]=await Vt();return await n(e,t)}const Ln=()=>import("./content-state-reader-CY-uQUXA.mjs");function Un(e){const t=e;return!t||typeof t!="object"?false:t.type==="Annotation"?O(t.motivation).includes("contentState"):t.type==="SpecificResource"}const Qo=e=>!!e&&typeof e=="object"&&/ImageService[123]|iiif\.io\/api\/image/.test(JSON.stringify(["@context","type","@type","protocol"].map(t=>e[t])));async function Zs(e,t,n){try{return await me(e,t,n)}catch(o){if(n!=null&&n.aborted||/\.json([?#]|$)/i.test(t))throw o;try{const r=await me(e,`${t.replace(/\/+$/,"")}/info.json`,n);if(Qo(r))return r}catch{}throw o}}const Ys=["summary","metadata","requiredStatement","rights","provider","homepage","seeAlso","rendering","thumbnail","navDate","partOf"];function Xs(e){const t={"@context":ei,id:e.id,type:"Manifest",label:e.label??{none:[""]},items:[e]};for(const n of Ys)e[n]!==void 0&&n!=="label"&&(t[n]=e[n]);return t}const ra=e=>{var t,n;return!!e&&((n=(t=e.items)==null?void 0:t[0])==null?void 0:n.id)===e.id},sa=e=>{var t,n;return!!e&&((t=e.items)==null?void 0:t.length)===1&&((n=e.items[0])==null?void 0:n.id)===`${e.id}/canvas`},Qs=/^(oa:)?Annotation(Page|Collection)$/;class Ge extends Error{constructor(){super(...arguments);se(this,"name","CloverContentError")}}const ei="http://iiif.io/api/presentation/4/context.json",ti=e=>/^https?:\/\//i.test(e);async function Ot(e,{request:t,signal:n}){return Array.isArray(e.items)&&e.items.length>0||!e.id?e:await me(t,e.id,n)}const ni=50;async function zt(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<ni;i++){const c=typeof s=="string"?{id:s}:s;if(r.has(c.id??c))break;r.add(c.id??c);const a=c.items?c:await me(t.request,c.id,t.signal),l=await ge({"@context":a["@context"]??n["@context"],...a,type:"Collection"});o.push(...l.items??[]),s=a.next}return{...n,items:o}}async function er(e,t={}){return ge(await Ot(e,t))}async function tr(e,t,n=0){for(const o of e.items??[]){if(o.type==="Manifest")return ge(await Ot(o,t));if(o.type==="Collection"&&n<8){const r=await zt(await ge(await Ot(o,t)),t),s=await tr(r,t,n+1);if(s)return s}}return null}async function oi(e,{request:t,signal:n}={}){Vt();const o=typeof e=="string"?await me(t,e.trim(),n):e,r=await ge(o);return r.type==="Collection"?zt(r,{request:t,signal:n}):r}async function ri(e,t={}){var u;const{request:n,signal:o}=t;Vt();let r,s,i,c,a;const l=async _=>{const{resolveContentState:v}=await Ln(),g=v(_);if(!g)throw new Ge("Unreadable content state");return r=g.target??r,s=g.manifestId??s,i=g.annotation??i,c=g.targets??c,me(n,g.id,o)};if(typeof e=="string")if(ti(e.trim()))a=await Zs(n,e.trim(),o);else{const{decodeContentState:_}=await Ln(),v=_(e);if(!v)throw new Ge("Unreadable iiifContent");a=Un(v)?await l(v):v}else a=e;if(Un(a)&&(a=await l(a)),Qs.test(String((a==null?void 0:a.type)??""))){const{annotationsContent:_}=await import("./annotations-content-B6PtnG5P.mjs");return _(a,t)}if(Qo(a)){const{imageServiceContent:_}=await import("./image-service-content-DHDgPYBV.mjs");return _(a,typeof e=="string"?e.trim():void 0)}const d=await ge(a);switch((u=o==null?void 0:o.throwIfAborted)==null||u.call(o),d.type){case"Manifest":return{manifest:d,target:r,annotation:i,targets:c};case"Collection":{const _=await zt(d,t),v=t.manifestId??s,g=v?(_.items??[]).find(C=>C.id===v&&C.type==="Manifest"):void 0,A=g?await er(g,t):await tr(_,t);if(!A)throw new Ge("The Collection holds no Manifest");return{manifest:A,collection:_,target:r,annotation:i,targets:c}}case"Canvas":case"Timeline":case"Scene":{const _=d;return r??(r={canvasId:_.id}),{manifest:Xs(_),target:r,annotation:i}}default:throw new Ge(`Cannot show a ${String(d.type??"resource without a type")}`)}}const nr=e=>!!(e!=null&&e.id)&&e.type==="AnnotationPage"&&!e.items;function Fn(e){const t=[];for(const n of e)for(const o of["items","annotations"])for(const r of n[o]??[])nr(r)&&t.push([n.id,o,r.id]);return t}async function si(e,t,n,o){return ii(await me(n,e,o),t)}async function ii(e,t="urn:clover:annotation-page"){var r;const n=e;return Xo(n)?n:((r=(await ge({"@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 ai(e,t){const n=e,o=t,r=a=>Array.isArray(a)?a:a?[a]:[],s=r(n.partOf),i=r(o.partOf),c=[...s.map(a=>({...i.find(l=>l.id&&l.id===a.id),...a})),...i.filter(a=>!s.some(l=>l.id===a.id))];return{...e,...n.label===void 0&&o.label!==void 0&&{label:o.label},...c.length&&{partOf:c}}}function ci(e,t,n,o){let r=false;const s=(e.items??[]).map(i=>{if(i.id!==t||!Array.isArray(i[n]))return i;const c=i[n].map(a=>a.id!==o.id||!nr(a)?a:(r=true,ai(o,a)));return r?{...i,[n]:c}:i});return r?{...e,items:s}:e}const Hn=/\/search\/([0-2])\//;function li(e){if(!e)return null;let t=null;for(const n of O(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(c=>String(c??"")).join(" "),i=r==="SearchService2"?2:r==="SearchService1"?1:Hn.test(s)?Number(Hn.exec(s)[1])>=2?2:1:null;if(i===2)return{id:o,version:i};i===1&&(t??(t={id:o,version:i}))}return t}function ui(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 Ce(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 fi(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 Pt={query:"",status:"idle",hits:[],set:null},Dn={status:"idle",error:null,manifest:null,collection:null,throughCollection:false,canvasId:null,target:null,annotationId:null,hiddenSets:[],shownSets:[],addedSets:[],search:Pt,regions:null,targets:null,targetIndex:null};function di(e={}){const t=ui(Dn),n=Ce(null),o=Ce(null),r=Ce(null),s=Ce(null),i=Ce(null),c=Ce(null);let a=null,l=null,d=[],u=[],_=[],v=0,g=null,A=null,C=null;const I=(f,p)=>{!A||f===p||(A={...A,items:A.items.map(h=>h.manifestId===f&&h.manifestAs!==p?{...h,manifestAs:p}:h)})},S=f=>{var h;const p=(h=t.get().manifest)==null?void 0:h.id;return!!p&&(p===f.manifestId||p===f.manifestAs)},b=()=>d.length||u.length||_.length?[...d,...u,..._]:Dn.addedSets;let P=e.request,E=null;const D=new Set;let W="view",V=0;const ee=(f,p,h)=>{if(D.has(h))return;D.add(h);const m=E==null?void 0:E.signal;si(h,f,P,m).then(y=>{m!=null&&m.aborted||t.set(k=>k.manifest?{manifest:ci(k.manifest,f,p,y)}:{})}).catch(()=>D.delete(h))},te=()=>{const{manifest:f,canvasId:p}=t.get();if(f)for(const[h,m,y]of Fn(W==="all"||V>0?B(f).canvases:$e(f,p)))ee(h,m,y)};t.subscribe(te);const j=(f,p,h,m,y)=>{var Gt,Zt,Yt;const{canvases:k}=B(f),T=Se=>!!Se&&k.some(ar=>ar.id===Se),w=Rs(f),M=T(h==null?void 0:h.canvasId)?h:T(w==null?void 0:w.canvasId)?w:null,U=T(m.canvasId)?m.canvasId:(M==null?void 0:M.canvasId)??(T(m.defaultCanvasId)?m.defaultCanvasId:null)??((Gt=k[0])==null?void 0:Gt.id)??null;l==null||l.abort();const q=y&&((Zt=_t(_,y))==null?void 0:Zt.canvasId)===U?y:null,re=M&&q?{...M,region:void 0}:M,Ve=++v;d=[],t.set({status:"ready",search:Pt,regions:null,manifest:f,collection:p,canvasId:U,target:re&&re.canvasId===U?re:null,addedSets:b(),annotationId:q,targets:A});const Kt=f==null?void 0:f.structures;Array.isArray(Kt)&&JSON.stringify(Kt).includes("xywh=")&&import("./range-regions-BmSXWBAS.mjs").then(({contentsSet:Se})=>{v===Ve&&t.set({regions:Se(f)})}),js(f)&&import("./image-layers-BLqN0BKU.mjs").then(({imageLayers:Se})=>{v===Ve&&(d=Se(f),t.set({addedSets:b()}))}),U&&U!==m.canvasId&&((Yt=e.onCanvasChange)==null||Yt.call(e,U))},z=(f,p)=>t.set(h=>{const m=h.hiddenSets.filter(k=>k!==f),y=h.shownSets.filter(k=>k!==f);return p?{hiddenSets:m,shownSets:[...y,f]}:{hiddenSets:[...m,f],shownSets:y}}),le=(f,p)=>{var m,y,k;if(!f)return;if((m=e.isControlled)!=null&&m.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&&((k=e.onCanvasChange)==null||k.call(e,f))},ue=(f,p=false)=>{const{manifest:h}=t.get(),m=Ns(h,f);le(m,m&&p?{canvasId:m,autoplay:p}:null)},Pe=()=>{const{manifest:f,canvasId:p}=t.get();return{at:st(f,p),total:B(f).views.length}},ye=()=>{E==null||E.abort();const f=new AbortController;return E=f,D.clear(),t.set({status:"loading",error:null,annotationId:null}),f.signal},Be=f=>t.set({status:"error",error:f instanceof Error?f:new Error(String(f))});async function We(f,p={}){var m;const h=ye();try{const y=await ri(f,{request:P,signal:h,manifestId:p.manifestId??void 0});if(h.aborted)return;const k=y.annotation,T=k?Vo({items:[k]},`${k.id}#content-state`):[];_=T.length?[{id:`${k.id}#content-state`,source:"added",entries:T}]:y.annotationSets??[];const w=g??((m=T[0])==null?void 0:m.id)??y.pick;g=null,t.set({throughCollection:!!y.collection}),A=y.targets??null,A&&I(A.items[0].manifestId,y.manifest.id),t.set({targetIndex:A?0:null}),j(y.manifest,y.collection??null,y.target,p,w)}catch(y){h.aborted||Be(y)}}const be=f=>{const{manifest:p,collection:h}=t.get();return(p==null?void 0:p.id)===f||(h==null?void 0:h.id)===f},Ae=f=>{var p;return(((p=t.get().collection)==null?void 0:p.items)??[]).find(h=>h.id===f)??{id:f,type:"Manifest"}},it=(f,p)=>{var h,m;if(g=p,(h=e.isManifestControlled)!=null&&h.call(e)){(m=e.onManifestChange)==null||m.call(e,f);return}we({id:f,type:"Manifest"}).then(y=>{var k;return y&&((k=e.onManifestChange)==null?void 0:k.call(e,f))})},we=async(f,p)=>{if(f.type==="Collection")return await We(f.id),t.get().status==="ready";const{collection:h}=t.get(),m=ye(),y=g;g=null;const k=y?_t(_,y):null,T=typeof p=="string"?{canvasId:p}:p??C;C=null;try{const w=await er(f,{request:P,signal:m});return m.aborted?false:(I(f.id,w.id),j(w,h,k?{canvasId:k.canvasId}:T??void 0,{},y),true)}catch(w){return m.aborted||Be(w),false}};return{store:t,viewport:n,media:o,captions:r,highlight:s,chapter:i,found:c,get request(){return P},setRequest(f){P=f},load:We,async openCollection(f){var h;const p=t.get().manifest;if(!(!p||((h=t.get().collection)==null?void 0:h.id)===f))try{const m=await oi(f,{request:P});if(m.type!=="Collection"||t.get().manifest!==p)return;t.set({collection:m})}catch{}},async goToManifest(f,p){var m,y,k;if(be(f))return;const h=Ae(f);if(h.type!=="Collection"&&((m=e.isManifestControlled)!=null&&m.call(e))){(y=e.onManifestChange)==null||y.call(e,f);return}await we(h,p)&&((k=e.onManifestChange)==null||k.call(e,t.get().manifest.id))},goToTarget(f){var m,y,k;const p=(m=t.get().targets)==null?void 0:m.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(S(p)){h&&le(h.canvasId,h);return}if((y=e.isManifestControlled)!=null&&y.call(e)){C=h,(k=e.onManifestChange)==null||k.call(e,p.manifestId);return}we(Ae(p.manifestId),h??void 0).then(T=>{var w;return T&&((w=e.onManifestChange)==null?void 0:w.call(e,p.manifestId))})},async syncManifest(f){!f||be(f)||t.get().status!=="ready"||await we(Ae(f))},goTo(f,p){le(f,p?{...p,canvasId:f}:null)},next({autoplay:f=false,wrap:p=false}={}){const{at:h,total:m}=Pe();h+1<m?ue(h+1,f):p&&m>1&&ue(0,f)},previous(){const{at:f}=Pe();f>0&&ue(f-1)},first(){ue(0)},last(){ue(Pe().total-1)},consumeTarget(){t.set({target:null})},syncCanvas(f){f&&t.set({canvasId:f})},selectAnnotation(f){const{manifest:p,addedSets:h,canvasId:m,search:y,regions:k}=t.get(),T=_t(qs(p,h,y.set,k),f);if(t.set({annotationId:T?f:null}),!T)return;c.emit(f);const{hiddenSets:w,shownSets:M}=t.get();T.setId!==Wo&&Go(p,h,w,M).includes(T.setId)&&z(T.setId,true);const U=$e(p,m).some(Ve=>Ve.id===T.canvasId),q=je(p,T.canvasId)!==null;!U&&q&&le(T.canvasId,null);const re=q?void 0:Ks(T.annotation);re&&it(re,T.id)},async search(f){l==null||l.abort();const p=li(t.get().manifest),h=f.trim();if(!h||!p){l=null,t.set({search:Pt,annotationId:null});return}const m=new AbortController;l=m,t.set(y=>({search:{...y.search,query:h,status:"loading"}}));try{const{searchInto:y}=await import("./search-BPTt1eUz.mjs");await y(t,p,h,P,m.signal)}catch{t.set({search:{query:h,status:"error",hits:[],set:null}})}},setSetVisible(f,p){z(f,p)},async loadAnnotations(f){if(a==null||a.abort(),!f){u=[],t.set({addedSets:b()});return}const p=new AbortController;a=p;try{const{loadAnnotationSets:h}=await import("./annotation-collection-y13MLLGX.mjs"),m=await h(f,{request:P,signal:p.signal});if(p.signal.aborted)return;u=m,t.set({addedSets:b()})}catch{}},getContentState(){var U;const{manifest:f,canvasId:p}=t.get();if(!f||!p)return null;const h=n.get(),m=o.get(),y=m&&m.currentTime>0?m.currentTime:null,k=$e(f,p),w=h&&k.some(q=>q.id===h.canvasId)&&!y?h:null,M=(w==null?void 0:w.canvasId)??p;return Yo({manifestId:f.id,canvasId:M,type:(U=k.find(q=>q.id===M))==null?void 0:U.type,region:w==null?void 0:w.region,time:y})},setAnnotationPages(f){f!==W&&(W=f,te())},fetchAnnotationPages(f){const{manifest:p}=t.get();if(!p||!f.length)return;const h=new Set(f);for(const[m,y,k]of Fn(B(p).canvases))h.has(k)&&ee(m,y,k)},holdAllAnnotationPages(){V++,te();let f=true;return()=>{f&&V--,f=false}},dispose(){E==null||E.abort(),a==null||a.abort(),l==null||l.abort()}}}function _i(e){const t=oe(vi,hi);return!!e||t}const ia=e=>e?{"data-high-contrast":""}:{},pi="(prefers-contrast: more)",or=()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(pi):null;function vi(e){var n;const t=or();return(n=t==null?void 0:t.addEventListener)==null||n.call(t,"change",e),()=>{var o;return(o=t==null?void 0:t.removeEventListener)==null?void 0:o.call(t,"change",e)}}const hi=()=>{var e;return!!((e=or())!=null&&e.matches)};function mi({clover:e,language:t}){const{t:n,langOf:o}=Fo(),[r,s]=K(null),i=H(n);return i.current=n,F(()=>{let c=null;return e.store.subscribe(()=>{const{manifest:a,canvasId:l,status:d}=e.store.get();if(d!=="ready"||l===c)return;const u=c===null;if(c=l,u)return;const _=je(a,l),v=jo(_==null?void 0:_.label,t),g=i.current("canvasPosition",{index:st(a,l)+1,total:B(a).views.length});s({label:v.text,lang:v.lang,position:g})})},[e,t]),L("div",{className:"clover-announcer",role:"status","aria-live":"polite","aria-atomic":"true",style:Ls,children:[r!=null&&r.label?L(Q,{children:[L("span",{...wn(r.lang),children:r.label}),","," "]}):null,r&&L("span",{...wn(o("canvasPosition")),children:r.position})]})}const gi=100;function yi(e,t){const n=H({read:e,onChange:t});n.current={read:e,onChange:t};const o=H(void 0),r=H("");return F(()=>()=>{clearTimeout(o.current),o.current=void 0},[]),ce(()=>{!n.current.onChange||o.current!==void 0||(o.current=setTimeout(()=>{var i,c;o.current=void 0;const s=n.current.read();!s||s.encoded===r.current||(r.current=s.encoded,(c=(i=n.current).onChange)==null||c.call(i,s))},gi))},[])}function jn(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 bi(e,t){const n=yi(()=>e.getContentState(),t),o=!!t;F(()=>{if(!o)return;let r=e.store.get().canvasId;const s=e.store.subscribe(()=>{const l=e.store.get().canvasId;l!==r&&(r=l,n())}),i=e.viewport.subscribe(n);let c=jn(e.media.get(),n);const a=e.media.subscribe(l=>{c(),c=jn(l,n)});return n(),()=>{s(),i(),a(),c()}},[e,o,n])}function aa(e){return e.flatMap(t=>gs(t).map(({body:n})=>n))}function ca(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,c;return((s=r.canvasId)==null?void 0:s.some(a=>n.includes(a)))||((i=r.format)==null?void 0:i.some(a=>o.includes(a)))||!!((c=r.match)!=null&&c.call(r,t))})??null}function wi(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 Si({iiifContent:e,canvasId:t,defaultCanvasId:n,onCanvasChange:o,onStatusChange:r,manifestId:s,defaultManifestId:i,onManifestChange:c,searchQuery:a,request:l,language:d,renderers:u,annotations:_,annotationPages:v="view",onContentStateChange:g,...A}){const C=t!==void 0,I=s!==void 0,S=H({controlled:C,manifestControlled:I,onCanvasChange:o,onStatusChange:r,onManifestChange:c});S.current={controlled:C,manifestControlled:I,onCanvasChange:o,onStatusChange:r,onManifestChange:c};const[b]=K(()=>di({request:l,onCanvasChange:w=>{var M,U;return(U=(M=S.current).onCanvasChange)==null?void 0:U.call(M,w)},onManifestChange:w=>{var M,U;return(U=(M=S.current).onManifestChange)==null?void 0:U.call(M,w)},isControlled:()=>S.current.controlled,isManifestControlled:()=>S.current.manifestControlled}));b.setRequest(l);const P=H({});P.current={canvasId:t,defaultCanvasId:n,manifestId:s??i};const E=vs(l),D=H(e);D.current=e;const W=ki(e);F(()=>(b.load(D.current,P.current),()=>b.dispose()),[b,W,E]),F(()=>{C&&b.syncCanvas(t??null)},[b,C,t]);const[V,ee]=K(b.store.get().status);F(()=>{let w=b.store.get().status;return b.store.subscribe(()=>{var q,re;const{status:M,error:U}=b.store.get();M!==w&&(w=M,ee(M),(re=(q=S.current).onStatusChange)==null||re.call(q,M,U))})},[b]);const te=H(_);te.current=_;const j=xi(_);F(()=>{b.loadAnnotations(te.current??null)},[b,j,E]),F(()=>{b.setAnnotationPages(v)},[b,v]),bi(b,g),F(()=>{I&&V==="ready"&&b.syncManifest(s??null)},[b,I,s,V]);const z=Ci(b,w=>{var M;return w.status==="ready"?((M=w.manifest)==null?void 0:M.id)??null:null});F(()=>{a&&z&&b.search(a)},[b,a,z]);const le=H(u);wi(le.current,u)||(le.current=u);const ue=le.current,[Pe,ye]=K(),[Be,We]=K(d);Be!==d&&(We(d),ye(void 0));const be=H(void 0),[Ae,it]=K(W);Ae!==W&&(it(W),ye(void 0)),F(()=>()=>{const w=be.current;be.current=void 0,w&&R.chosenLanguage===w&&R.chooseInterfaceLanguage()},[W]);const we=oe(R.subscribe,()=>R.chosenLanguage),f=Pe??d??we,p=ce(w=>{ye(w);const M=R.stringsFor(w);be.current=M,M&&R.chooseInterfaceLanguage(M)},[]),[h,m]=K(0),y=ce(()=>(m(w=>w+1),()=>m(w=>w-1)),[]),k=h>0;return[he(()=>({clover:b,language:f,renderers:ue,chooseLanguage:p,toggleDrawn:k,drawsToggle:y}),[b,f,ue,p,k,y]),V,A]}function Ci(e,t){return oe(e.store.subscribe,()=>t(e.store.get()))}function xi(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 ki(e){return typeof e=="string"?e:e.id??e["@id"]??e}const pt=new Map;function la(e,t){const n=rs(),o=H(t);o.current=t,F(()=>e?rr(n,o):void 0,[e,n])}function rr(e,t){for(const[n,o]of[...pt])n!==e&&o.current();return pt.set(e,t),()=>{pt.delete(e)}}let Ii=0;const Oi=e=>rr(`page-${Ii+=1}`,{current:e}),Bn=new WeakMap;function Pi(e,t){const[n,o]=K(()=>Bn.get(e)??null);return F(()=>{if(!t||n)return;let r=true;return e().then(s=>{Bn.set(e,s),r&&o(()=>s)},()=>{}),()=>{r=false}},[e,t,n]),n}function ua(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 fa(e,t){var n;if(e.currentTime=t,!!e.paused)try{(n=e.play())==null||n.catch(()=>{})}catch{}}function qt(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 Jt(e){if(typeof e=="string")return Wn(e);const t=e;return(t==null?void 0:t.type)==="SpecificResource"?t:typeof(t==null?void 0:t.id)=="string"?Wn(t.id):t}const Wn=e=>e.replace(/\/((?:t|xywh)=[^/#]*)$/,"#$1");function sr(e){const t=O(e.thumbnail)[0];return t&&typeof t=="object"?{thumbnail:t}:{}}const Vn=new WeakMap,zn=[];function Ai(e,t,n){if(!e||!t)return zn;let o=Vn.get(e);o||Vn.set(e,o=new Map);const r=`${t}|${n??""}`,s=o.get(r);if(s)return s;const i=[],c=new Set,a=d=>{if(!d||c.has(d.id??d))return;c.add(d.id??d);const u=!O(d.behavior).includes("no-nav");for(const _ of O(d.items)){if((_==null?void 0:_.type)==="Range"){a(_);continue}if(!u)continue;const v=rt(Jt(_));if(v.id.split("#")[0]!==t)continue;const g=qt(v.t);g&&i.push({...d.id?{id:d.id}:{},label:d.label,...g,...sr(d)})}};for(const d of O(e.structures))a(d);i.sort((d,u)=>d.start-u.start);const l=i.length?i.map((d,u)=>{var _;return{...d,end:d.end??((_=i[u+1])==null?void 0:_.start)??n}}):zn;return o.set(r,l),l}const qn=new WeakMap,Jn=[];function ir(e){if(!e)return Jn;const t=qn.get(e);if(t)return t;const n=new Map(O(e.items).map((a,l)=>[a==null?void 0:a.id,l])),o=new Set,r=a=>{var S,b;if(!a||o.has(a.id??a))return[];o.add(a.id??a);const l=[],d=[],u=[];let _;for(const P of O(a.items))if((P==null?void 0:P.type)==="Range"){const E=r(P);l.push(...E),E.forEach(D=>d.push(...D.canvasIds))}else{const E=rt(Jt(P));if(!E.id)continue;_??(_=E),d.push(E.id),u.push(E)}const v=O(a.behavior);if(v.includes("no-nav"))return l;const g=_??void 0,A={id:a.id??`range-${o.size}`,label:a.label,canvasId:(g==null?void 0:g.id)??((S=l[0])==null?void 0:S.canvasId),canvasIds:[...new Set(d)],...v.includes("sequence")?{sequence:true}:{},...sr(a),children:l},C=qt(g==null?void 0:g.t);return C?A.time=C:!g&&((b=l[0])!=null&&b.time)&&(A.time=l[0].time),g!=null&&g.rect&&(A.region=g.rect),(v.includes("sequence")&&u.length>1&&!u.some(P=>P.t)||Mi(u,n))&&(A.parts=u.map(P=>({canvasId:P.id,...P.rect?{region:P.rect}:{}}))),[A]},s=O(e.structures).flatMap(r),i=s.length===1&&s[0].children.length?s[0].children:s,c=i.length?i:Jn;return qn.set(e,c),c}function Mi(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 Ei(e,t,n,o){let r=null,s=null;const i=(l,d,u)=>!l||u>l.depth||u===l.depth&&!(l.sequence&&d.sequence),c=(l,d,u)=>{const _=u||l.id===o;if(t&&l.canvasIds.includes(t)&&(!l.time||n!==void 0&&n>=l.time.start&&(l.time.end===void 0||n<l.time.end))){const g={id:l.id,depth:d,...l.sequence?{sequence:true}:{}};i(r,l,d)&&(r=g),_&&i(s,l,d)&&(s=g)}l.children.forEach(v=>c(v,d+1,_))};e.forEach(l=>c(l,0,false));const a=s??r;return a?a.id:null}const da=Object.freeze(Object.defineProperty({__proto__:null,chaptersOf:Ai,currentContents:Ei,parseTime:qt,rangeItemTarget:Jt,tableOfContents:ir},Symbol.toStringTag,{value:"Module"}));Ie(31,"components/Label/Label","@layer clover{.clover-label{text-wrap:balance}}");Ie(32,"components/Status/Status","@layer clover{.clover-status{margin:0;padding:var(--clover-space-m);color:var(--clover-color-primary-muted, #26292b)}.clover-status[data-status=loading]{display:flex}.clover-status[data-status=error] p{margin:0}.clover-status-detail{font-size:var(--clover-text-s)}}");const _a=()=>import("./controls-Cc5LuT8p.mjs"),Ti=()=>import("./renderers-BjtPgVnV.mjs");function pa(e){Z(()=>()=>e==null?void 0:e(null),[e])}function $i(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 B(o().manifest)},visibleCanvases(){return $e(o().manifest,o().canvasId)},activeCanvas(){return je(o().manifest,o().canvasId)},navigation(){const{manifest:r,canvasId:s}=o();return fi(e,st(r,s),B(r).views.length)},annotationPages(){return Ue(o().manifest,o().addedSets)},annotationSets(){return Ue(o().manifest,o().addedSets)},annotationCollection(){return Ws(o().manifest,o().addedSets)},contents(){return ir(o().manifest)},localize(r){return jo(r,t())},t(r,s){return R.t(r,s,Y)},langOf(r){return R.langOf(r,n(),Y)},oneOpen(r){return Oi(r)}}}function Ni(e,t,n){return Object.defineProperties(Object.create(e),Object.getOwnPropertyDescriptors($i(e,t,n)))}const Ri=De(null);function Li({hosted:e,props:t,children:n}){const o=Pi(Ti,!!t.renderers);return!t.iiifContent||t.renderers&&!o?null:L(Ui,{element:e.element,props:t,toRenderers:o==null?void 0:o.toRenderers,children:n})}function Ui({element:e,props:t,toRenderers:n,children:o}){const{canvasId:r,manifestId:s,lang:i,highContrast:c,onReady:a,renderers:l,...d}=t,u=_i(c),_=Ss(void 0,i);_.ref(e);const v=he(()=>n==null?void 0:n(l),[n,l]),[g,A]=Si({...d,defaultCanvasId:r,defaultManifestId:s,renderers:v}),{clover:C,language:I}=g,S=H({language:I,host:_.hostLanguage});S.current={language:I,host:_.hostLanguage};const b=he(()=>Ni(C,()=>S.current.language,()=>S.current.host),[C]);return Z(()=>(a==null||a(b),()=>a==null?void 0:a(null)),[b,a]),Kn(C,r,P=>C.goTo(P)),Kn(C,s,P=>void C.goToManifest(P)),Z(()=>(e.classList.add("clover-root"),()=>e.classList.remove("clover-root")),[e]),Z(()=>{e.setAttribute("data-status",A)},[e,A]),Z(()=>(e.toggleAttribute("data-high-contrast",u),()=>e.removeAttribute("data-high-contrast")),[e,u]),Z(()=>()=>e.removeAttribute("data-status"),[e]),L(ot.Provider,{value:g,children:L(Wt.Provider,{value:_.hostLanguage,children:L(Ri.Provider,{value:b,children:[o,Dt(L(mi,{clover:C,language:I}),e)]})})})}function Kn(e,t,n){const o=H(t);F(()=>{t&&t!==o.current&&n(t),o.current=t},[e,t])}const va=Object.freeze(Object.defineProperty({__proto__:null,RootElement:Li},Symbol.toStringTag,{value:"Module"}));export{Dt as $,H as A,qt as B,oe as C,Er as D,fa as E,B as F,Di as G,Ks as H,no as I,Yi as J,ir as K,Ei as L,Qi as M,li as N,_r as O,Ye as P,De as Q,Bi as R,qi as S,he as T,O as U,sa as V,Wo as W,Xn as X,R as Y,ra as Z,Z as _,Fo as a,Ki as a0,zi as a1,je as a2,Vi as a3,ps as a4,Ss as a5,_i as a6,xs as a7,yi as a8,jn as a9,Jt as aA,Vo as aB,me as aC,ii as aD,Bs as aE,Ge as aF,ge as aG,Ri as aH,oi as aI,Es as aJ,Ho as aK,Fs as aL,ri as aM,ji as aN,Wi as aO,oa as aP,da as aQ,va as aR,ia as aa,Wt as ab,ms as ac,rt as ad,Do as ae,Gi as af,la as ag,gs as ah,Xi as ai,fi as aj,Ws as ak,st as al,ua as am,Si as an,mi as ao,ot as ap,Zi as aq,qs as ar,Ai as as,na as at,qo as au,er as av,_s as aw,Yo as ax,vs as ay,Hs as az,rs as b,Ji as c,K as d,bs as e,Pi as f,Ti as g,pa as h,_a as i,bi as j,Q as k,wn as l,ca as m,$e as n,Go as o,aa as p,ce as q,ea as r,ta as s,jo as t,L as u,Ls as v,_t as w,pe as x,F as y,Nr as z};
@@ -1 +1 @@
1
- import{F as n}from"./shared-DJyYaNgB.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-Cqxks7jF.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-BIVE0K1I.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-DfXP25SW.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-DJyYaNgB.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-ByWHicZ5.mjs";import"./styles-Cm1KSkd5.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-Cqxks7jF.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-DxvfQm-l.mjs";import"./styles-C9QeBpjd.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-DJyYaNgB.mjs";import{S as m}from"./Status-CjtyBONJ.mjs";import{a,C as i}from"./nodes-BJ4P1NTa.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-Cqxks7jF.mjs";import{S as m}from"./Status-CvunwdwM.mjs";import{a,C as i}from"./nodes-BWN5jzoG.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};