@nulib/clover 4.5.5 → 4.5.6

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 (263) hide show
  1. package/dist/components/Annotations/Annotations.mjs +6 -2
  2. package/dist/core/link.mjs +13 -10
  3. package/dist/i18n/locales/en.json.mjs +1 -1
  4. package/dist/i18n/locales/es.json.mjs +1 -1
  5. package/dist/i18n/locales/fi.json.mjs +1 -1
  6. package/dist/i18n/locales/fr.json.mjs +1 -1
  7. package/dist/i18n/locales/it.json.mjs +1 -1
  8. package/dist/i18n/locales/ja.json.mjs +1 -1
  9. package/dist/i18n/locales/nb.json.mjs +1 -1
  10. package/dist/i18n/locales/nn.json.mjs +1 -1
  11. package/dist/i18n/locales/no.json.mjs +1 -1
  12. package/dist/i18n/locales/pt.json.mjs +1 -1
  13. package/dist/i18n/locales/zh-Hans.json.mjs +1 -1
  14. package/dist/i18n/locales/zh-Hant.json.mjs +1 -1
  15. package/dist/index.d.mts +3 -2
  16. package/dist/styles/core.css +1 -1
  17. package/dist/styles.css +1 -1
  18. package/dist/ui/ExternalGlyph.mjs +22 -0
  19. package/dist/web-components/{About-Cpf_iDP6.mjs → About-C-o1MARK.mjs} +1 -1
  20. package/dist/web-components/{AnnotationItems-C1e8vrQO.mjs → AnnotationItems-BtX1-AkD.mjs} +1 -1
  21. package/dist/web-components/{AnnotationMenu-BE10k1MN.mjs → AnnotationMenu-eXo5QJ9p.mjs} +1 -1
  22. package/dist/web-components/{AnnotationState-Du0q2Lkv.mjs → AnnotationState-B4-vsjYK.mjs} +1 -1
  23. package/dist/web-components/Annotations-BMMp4TzW.mjs +2 -0
  24. package/dist/web-components/{Annotations-BQ5w1-ZP.mjs → Annotations-KJI1g3JX.mjs} +1 -1
  25. package/dist/web-components/{Body-DhQxrVvR.mjs → Body-Bx9aZhz_.mjs} +1 -1
  26. package/dist/web-components/{BodyAlert-BQET-pQO.mjs → BodyAlert-01XtjU91.mjs} +1 -1
  27. package/dist/web-components/{Button-BirIS0UB.mjs → Button-DmqdooHe.mjs} +1 -1
  28. package/dist/web-components/{Camera-U-go7jsP.mjs → Camera-ZgGejDUV.mjs} +1 -1
  29. package/dist/web-components/{Canvas2DBackend-aLTLJt5G.mjs → Canvas2DBackend-B1YLZdY_.mjs} +1 -1
  30. package/dist/web-components/{CanvasView-w6t-JMBB.mjs → CanvasView-BRtiqo9o.mjs} +2 -2
  31. package/dist/web-components/{CaptionDetails-DXZRgiVF.mjs → CaptionDetails-JtN_s8Vd.mjs} +1 -1
  32. package/dist/web-components/{ChaptersMenu-BYyi47lT.mjs → ChaptersMenu-nW6su_V2.mjs} +1 -1
  33. package/dist/web-components/{Chevron-HuG2pLVe.mjs → Chevron-C6B1ERz3.mjs} +1 -1
  34. package/dist/web-components/{ChoiceMenu-DhUQ0nC7.mjs → ChoiceMenu-Ep3PVmNU.mjs} +1 -1
  35. package/dist/web-components/{Collection-CJo6fTNU.mjs → Collection-IHIeRtAZ.mjs} +1 -1
  36. package/dist/web-components/{CollectionSelect-BPiJm2qX.mjs → CollectionSelect-CFak4aY5.mjs} +1 -1
  37. package/dist/web-components/{Connected-Dy05dLlD.mjs → Connected-CNWHy7Nf.mjs} +1 -1
  38. package/dist/web-components/{Connected-BXc1y6St.mjs → Connected-CVQI5ppY.mjs} +1 -1
  39. package/dist/web-components/{Connected-BbzI2zK6.mjs → Connected-DBFLtGSX.mjs} +1 -1
  40. package/dist/web-components/{Contents-DyEvnvBZ.mjs → Contents-H1p0ziCX.mjs} +1 -1
  41. package/dist/web-components/{ControlMenu-DILqYp7x.mjs → ControlMenu-Dzc3r70f.mjs} +1 -1
  42. package/dist/web-components/ControlsFade-COi8-AZI.mjs +1 -0
  43. package/dist/web-components/{CountMenu-30RDtctj.mjs → CountMenu-CVXxogQn.mjs} +1 -1
  44. package/dist/web-components/Cue-CQFnHV1R.mjs +1 -0
  45. package/dist/web-components/{Document-CWn0VzSO.mjs → Document-Bq69tdp9.mjs} +1 -1
  46. package/dist/web-components/{DomLayers-BOeW3v4e.mjs → DomLayers-BNFCWPIf.mjs} +1 -1
  47. package/dist/web-components/{Download-B1pH_Wet.mjs → Download-8s_1j0hn.mjs} +1 -1
  48. package/dist/web-components/{EntryBodies-CCt_bYce.mjs → EntryBodies-CuH57Wdm.mjs} +1 -1
  49. package/dist/web-components/{EntryThumbnail-DApiQdWi.mjs → EntryThumbnail-BBn3c02-.mjs} +1 -1
  50. package/dist/web-components/{FieldPill-EHefq8lM.mjs → FieldPill-CDDBQn83.mjs} +1 -1
  51. package/dist/web-components/{FrameAnimation-BNmzR70z.mjs → FrameAnimation-OBaRI-rP.mjs} +1 -1
  52. package/dist/web-components/{Gallery-DpF-Cdw0.mjs → Gallery-BY4cH76P.mjs} +1 -1
  53. package/dist/web-components/{GlobeGlyph-DBYxhqnr.mjs → GlobeGlyph-DgNI--BA.mjs} +1 -1
  54. package/dist/web-components/{HideToggle-YnPk4svB.mjs → HideToggle-CQcp5w_t.mjs} +1 -1
  55. package/dist/web-components/{ImageControls-CThSHB8z.mjs → ImageControls-DREK-1SC.mjs} +1 -1
  56. package/dist/web-components/{Items-DdbOaRXQ.mjs → Items-eaCz7ufI.mjs} +1 -1
  57. package/dist/web-components/{Label-Bk_O5G3C.mjs → Label-Cur5KZAJ.mjs} +1 -1
  58. package/dist/web-components/{LanguageChoice-DoyxbEct.mjs → LanguageChoice-BWmkORxS.mjs} +1 -1
  59. package/dist/web-components/{LanguageMenu-BeGB_jhm.mjs → LanguageMenu-CW1_hI1x.mjs} +1 -1
  60. package/dist/web-components/{LightboxView-b6uDS_BD.mjs → LightboxView-Cd92FAYV.mjs} +1 -1
  61. package/dist/web-components/{ListEnd-BYM99ASf.mjs → ListEnd-CefIIerg.mjs} +1 -1
  62. package/dist/web-components/{Loaded-BHfiAJdt.mjs → Loaded-DtzpCxju.mjs} +1 -1
  63. package/dist/web-components/{LoadedCanvas-DEf79L39.mjs → LoadedCanvas-CUrQv2k_.mjs} +1 -1
  64. package/dist/web-components/LoadedMap-BVkNlBeH.mjs +1 -0
  65. package/dist/web-components/{Loading-DrMN5RS9.mjs → Loading-DhTFaFBg.mjs} +1 -1
  66. package/dist/web-components/{Map-BS8OC5D2.mjs → Map-eb1aK0Z9.mjs} +1 -1
  67. package/dist/web-components/{MapView-D4IDbUGn.mjs → MapView-3j8gkLYi.mjs} +2 -2
  68. package/dist/web-components/{Markup-D_gTftnI.mjs → Markup-Dy6leTBV.mjs} +1 -1
  69. package/dist/web-components/{MediaBody-E-rYLYaC.mjs → MediaBody-DMrJQG34.mjs} +1 -1
  70. package/dist/web-components/{MediaBody-DhaTtx4R.mjs → MediaBody-Dg0-LWYL.mjs} +1 -1
  71. package/dist/web-components/{NavDate-BCUGnx3P.mjs → NavDate-Ck30M1Ve.mjs} +1 -1
  72. package/dist/web-components/{Navigator-DzySqVUa.mjs → Navigator-B9rs7wKo.mjs} +1 -1
  73. package/dist/web-components/{Pager-By7ZH6O7.mjs → Pager-BV2GC__-.mjs} +1 -1
  74. package/dist/web-components/{PagerLayout-BtEwyK5X.mjs → PagerLayout-Cd08Alpt.mjs} +1 -1
  75. package/dist/web-components/{Panel-Dvrq3M-Q.mjs → Panel-DR6ycHyX.mjs} +1 -1
  76. package/dist/web-components/PanelPart-BJwA1Z3f.mjs +1 -0
  77. package/dist/web-components/{PanelToggle-C-sqVIs1.mjs → PanelToggle-gAffLvlc.mjs} +1 -1
  78. package/dist/web-components/{PartOfManifest-CbMlCcX3.mjs → PartOfManifest-nziNto_q.mjs} +1 -1
  79. package/dist/web-components/{Pending-DQJcdc5H.mjs → Pending-D1rYOP_R.mjs} +1 -1
  80. package/dist/web-components/{PlaceBox-DokzoF67.mjs → PlaceBox-C2JMFQV0.mjs} +1 -1
  81. package/dist/web-components/{Placeholder-CuzCilBT.mjs → Placeholder-BDMLULRp.mjs} +1 -1
  82. package/dist/web-components/{Position-fepKcPfZ.mjs → Position-IRJVIQdA.mjs} +1 -1
  83. package/dist/web-components/{Primitives-AJjxmiOF.mjs → Primitives-DqRNtE60.mjs} +1 -1
  84. package/dist/web-components/{Provider-rBUKn839.mjs → Provider-DPSj538n.mjs} +1 -1
  85. package/dist/web-components/{ReadMore-BuFCtdGh.mjs → ReadMore-B2DB6MuP.mjs} +1 -1
  86. package/dist/web-components/{Root-BSE4OmuO.mjs → Root-DCA1d0D7.mjs} +1 -1
  87. package/dist/web-components/Scene-CS2xqRNL.mjs +1 -0
  88. package/dist/web-components/{SceneView-BjNoL0uV.mjs → SceneView-YtkAJ2zP.mjs} +1 -1
  89. package/dist/web-components/{Search-BcrZLdEQ.mjs → Search-FWPa5UNO.mjs} +1 -1
  90. package/dist/web-components/{Sections-01Q3gAlf.mjs → Sections-73lsQFnt.mjs} +1 -1
  91. package/dist/web-components/{SeekMarks-DVs5pj-u.mjs → SeekMarks-DLT93mL0.mjs} +1 -1
  92. package/dist/web-components/{StandaloneItems-CMDIvH00.mjs → StandaloneItems-5d_3l6hK.mjs} +1 -1
  93. package/dist/web-components/{Status-h__hPYUf.mjs → Status-6tfWoLV_.mjs} +1 -1
  94. package/dist/web-components/{Steps-B0-nEjZX.mjs → Steps-DINk164Y.mjs} +1 -1
  95. package/dist/web-components/{TargetItems-vqRcAP52.mjs → TargetItems-CouPOIsE.mjs} +1 -1
  96. package/dist/web-components/Timeline-j4BWRpk4.mjs +1 -0
  97. package/dist/web-components/{Tip-CDk5jVbe.mjs → Tip-CmrY2ZoP.mjs} +1 -1
  98. package/dist/web-components/{Transcript-CCFPC1Q6.mjs → Transcript-D-J5T_7K.mjs} +1 -1
  99. package/dist/web-components/{Transport-DzxbhG8Z.mjs → Transport-BBGTe9TR.mjs} +1 -1
  100. package/dist/web-components/{Transport-KakYzWlH.mjs → Transport-Cy7wwjA5.mjs} +1 -1
  101. package/dist/web-components/{annotation-collection-DFeI_mDz.mjs → annotation-collection-OX2RwxfU.mjs} +1 -1
  102. package/dist/web-components/{annotation-name-FBisev7H.mjs → annotation-name-Cqw8uzpW.mjs} +1 -1
  103. package/dist/web-components/{annotations-content-BOOCdTm4.mjs → annotations-content-D8U3ZjMP.mjs} +1 -1
  104. package/dist/web-components/{body-CXwg03cI.mjs → body-B7mRbGgu.mjs} +1 -1
  105. package/dist/web-components/{canvas-DoyxoYGC.mjs → canvas-BNnp_JHf.mjs} +1 -1
  106. package/dist/web-components/{cloverEngine-GBxKE0AS.mjs → cloverEngine-9q7PRtb-.mjs} +1 -1
  107. package/dist/web-components/{content-state-reader-_LdLjiP1.mjs → content-state-reader-DKXoVOui.mjs} +1 -1
  108. package/dist/web-components/{controlGlyphs-DJPsdVYe.mjs → controlGlyphs-Bsm42pMw.mjs} +1 -1
  109. package/dist/web-components/{controls-C_p3vZR8.mjs → controls-DO27swab.mjs} +1 -1
  110. package/dist/web-components/{downloads-BbtPYZBf.mjs → downloads-BTKk4gk-.mjs} +1 -1
  111. package/dist/web-components/{dragToClose-DIwndGui.mjs → dragToClose-Dno8cLqV.mjs} +1 -1
  112. package/dist/web-components/{engine-BjIE4NRo.mjs → engine-yxhv49UX.mjs} +1 -1
  113. package/dist/web-components/{engines-CrU7hjmx.mjs → engines-BT170pvZ.mjs} +1 -1
  114. package/dist/web-components/{es-B1NvdYp-.mjs → es-Bn4XnLxy.mjs} +1 -1
  115. package/dist/web-components/{fetchManifest-CnNL49H6.mjs → fetchManifest-CV61siyX.mjs} +1 -1
  116. package/dist/web-components/{fi-BjtYZNLo.mjs → fi-CjAXeLqH.mjs} +1 -1
  117. package/dist/web-components/{follow-content-DucWQI_6.mjs → follow-content-1bNP_6Yi.mjs} +1 -1
  118. package/dist/web-components/{fr-Cd22Lziw.mjs → fr-CeFhkxoi.mjs} +1 -1
  119. package/dist/web-components/{fromManifest-DP9m_bqJ.mjs → fromManifest-ypX5N9bQ.mjs} +1 -1
  120. package/dist/web-components/{glyphs-F7ExZRQ9.mjs → glyphs-1YNgPYCb.mjs} +1 -1
  121. package/dist/web-components/{hooks-BiGLi7Q8.mjs → hooks-Bj5sYuBM.mjs} +1 -1
  122. package/dist/web-components/{image-layers-COBMItDq.mjs → image-layers-CdogbVZE.mjs} +1 -1
  123. package/dist/web-components/{image-service-content-Dy89TOVT.mjs → image-service-content-j8IL6mb0.mjs} +1 -1
  124. package/dist/web-components/{imageService-Dg5zJI3p.mjs → imageService-D4p3HE1q.mjs} +1 -1
  125. package/dist/web-components/{index-e37SYBar.mjs → index-D13DzX3i.mjs} +1 -1
  126. package/dist/web-components/index.mjs +1 -1
  127. package/dist/web-components/{it-UWaPOPDN.mjs → it-DxtfVek2.mjs} +1 -1
  128. package/dist/web-components/items-CLwd-kOq.mjs +1 -0
  129. package/dist/web-components/{items-CbXnr9UA.mjs → items-XHM03spJ.mjs} +1 -1
  130. package/dist/web-components/{ja-Cg1enUhM.mjs → ja-rsicBgWR.mjs} +1 -1
  131. package/dist/web-components/label-DOqlHvhq.mjs +1 -0
  132. package/dist/web-components/{layout-DdBH1AmH.mjs → layout-D6H3uuwu.mjs} +1 -1
  133. package/dist/web-components/link-D9hsGxQp.mjs +1 -0
  134. package/dist/web-components/logo-DpAvbwvh.mjs +1 -0
  135. package/dist/web-components/{models-2j6yvmPN.mjs → models-DaDtM_UM.mjs} +1 -1
  136. package/dist/web-components/{nb-CEwZDBiR.mjs → nb-BkyI1fhp.mjs} +1 -1
  137. package/dist/web-components/{nn-jYQhr9RI.mjs → nn-n_xM6AGl.mjs} +1 -1
  138. package/dist/web-components/{no-CEwZDBiR.mjs → no-BkyI1fhp.mjs} +1 -1
  139. package/dist/web-components/{nodes-kA2jmFay.mjs → nodes-B-e9mbx0.mjs} +1 -1
  140. package/dist/web-components/{overlayImage-D9cRfY3j.mjs → overlayImage-CSW7jSWt.mjs} +1 -1
  141. package/dist/web-components/{panel-V_TPnipr.mjs → panel-C5jcVkr6.mjs} +1 -1
  142. package/dist/web-components/part-Du5hBwFZ.mjs +1 -0
  143. package/dist/web-components/{playerSurface-BTKHmxO1.mjs → playerSurface-pHccePJd.mjs} +1 -1
  144. package/dist/web-components/{pointer-DoAsoxqF.mjs → pointer-rqjpl5E4.mjs} +1 -1
  145. package/dist/web-components/{provider-fkcSwXBE.mjs → provider-B9QvZ_Y9.mjs} +1 -1
  146. package/dist/web-components/{pt-CWR30SzS.mjs → pt-COchUT7D.mjs} +1 -1
  147. package/dist/web-components/{range-regions-CT95uHM0.mjs → range-regions-BQ8bqNTs.mjs} +1 -1
  148. package/dist/web-components/{read-more-D_b7dY43.mjs → read-more-BT_3kkHZ.mjs} +1 -1
  149. package/dist/web-components/{readingLanguages-CJajD7v0.mjs → readingLanguages-B_k-QfX6.mjs} +1 -1
  150. package/dist/web-components/{rendererSurface-CEHeWJwy.mjs → rendererSurface-CLbNE-t_.mjs} +2 -2
  151. package/dist/web-components/{renderers-CJ5nm0SY.mjs → renderers-DHgTVdtM.mjs} +1 -1
  152. package/dist/web-components/{resource-Dz_XBsCi.mjs → resource-xQiWQSb9.mjs} +1 -1
  153. package/dist/web-components/{save-file-DKe_h_U9.mjs → save-file-Dp3LOhHi.mjs} +1 -1
  154. package/dist/web-components/{search-BMpq8b3X.mjs → search-DRZzJ0qo.mjs} +1 -1
  155. package/dist/web-components/shared-BTZk52xk.mjs +1 -0
  156. package/dist/web-components/{show-link-Ch_hofEX.mjs → show-link-CljTxYbA.mjs} +1 -1
  157. package/dist/web-components/{sizedImage-BG2tDbvS.mjs → sizedImage-Cv3QSASL.mjs} +1 -1
  158. package/dist/web-components/{split-m0F4ovjo.mjs → split-CrTZjLVF.mjs} +1 -1
  159. package/dist/web-components/{status-jWbjVYSN.mjs → status-DCmJGFlF.mjs} +1 -1
  160. package/dist/web-components/{styles-BCj9RoYW.mjs → styles-BdBFz9SS.mjs} +1 -1
  161. package/dist/web-components/three.mjs +1 -1
  162. package/dist/web-components/{thumbnail-CF6-tqyq.mjs → thumbnail-BezXZOSj.mjs} +1 -1
  163. package/dist/web-components/{tip-uTbAyNGJ.mjs → tip-3wRL05_i.mjs} +1 -1
  164. package/dist/web-components/{toggle-CVnC0vUV.mjs → toggle-CyRtVTRf.mjs} +1 -1
  165. package/dist/web-components/{useContainerName-7-Q4e3xe.mjs → useContainerName-Dcg9-lIU.mjs} +1 -1
  166. package/dist/web-components/{useControlsVisibility-BmZEKLoQ.mjs → useControlsVisibility-DJGzcs6D.mjs} +1 -1
  167. package/dist/web-components/{useNearViewport-Cm5F5962.mjs → useNearViewport-C8lmKYws.mjs} +1 -1
  168. package/dist/web-components/{useScrollTrack-CsQQUZVJ.mjs → useScrollTrack-D6TRdz7f.mjs} +1 -1
  169. package/dist/web-components/viewer/{AnnotationItems-OHw3CidZ.mjs → AnnotationItems-DJVaxdsI.mjs} +1 -1
  170. package/dist/web-components/viewer/{AnnotationMenu-0qO_As1t.mjs → AnnotationMenu-C0d0lTcC.mjs} +1 -1
  171. package/dist/web-components/viewer/{AnnotationState-NPVw45tA.mjs → AnnotationState-B4T0TkvH.mjs} +1 -1
  172. package/dist/web-components/viewer/{Annotations-CwoomsDV.mjs → Annotations-CcvLU7jz.mjs} +1 -1
  173. package/dist/web-components/viewer/Annotations-WWqn_FbM.mjs +2 -0
  174. package/dist/web-components/viewer/{Canvas2DBackend-CMRWLAd4.mjs → Canvas2DBackend-B5QR4dhT.mjs} +1 -1
  175. package/dist/web-components/viewer/{CaptionDetails-CJisf1i_.mjs → CaptionDetails-B_fCdkw6.mjs} +1 -1
  176. package/dist/web-components/viewer/{ChaptersMenu-5Oh-jx8r.mjs → ChaptersMenu-BB97eRTx.mjs} +1 -1
  177. package/dist/web-components/viewer/{ChoiceMenu-BUzPTObN.mjs → ChoiceMenu-BtDTvEbQ.mjs} +1 -1
  178. package/dist/web-components/viewer/{Collection-BccJjqj8.mjs → Collection-Bz89v2FT.mjs} +1 -1
  179. package/dist/web-components/viewer/{Connected-D4hTMjqQ.mjs → Connected-CjKNxIxy.mjs} +1 -1
  180. package/dist/web-components/viewer/{Connected-CtmQ-wSs.mjs → Connected-Dt8bLgZK.mjs} +1 -1
  181. package/dist/web-components/viewer/{Contents-drpA8FtX.mjs → Contents-jBpCiUSe.mjs} +1 -1
  182. package/dist/web-components/viewer/{ControlMenu-jv4lvjpj.mjs → ControlMenu-l4F81Jg8.mjs} +1 -1
  183. package/dist/web-components/viewer/ControlsFade-BPFSCV0a.mjs +1 -0
  184. package/dist/web-components/viewer/{CountMenu-D1b27rQp.mjs → CountMenu-DU_EJGFs.mjs} +1 -1
  185. package/dist/web-components/viewer/Cue-D4-as926.mjs +1 -0
  186. package/dist/web-components/viewer/{Document-7CrcC3Cu.mjs → Document-BldAeNoK.mjs} +1 -1
  187. package/dist/web-components/viewer/{DomLayers-GyEF7J55.mjs → DomLayers-Bo7DQUIZ.mjs} +1 -1
  188. package/dist/web-components/viewer/{Download-D-aGRZnK.mjs → Download-HDlM1brf.mjs} +1 -1
  189. package/dist/web-components/viewer/{EntryBodies-CEzcz1SY.mjs → EntryBodies-k9Kf71ll.mjs} +1 -1
  190. package/dist/web-components/viewer/{EntryThumbnail-Cz2jEZTC.mjs → EntryThumbnail-DEXlu64w.mjs} +1 -1
  191. package/dist/web-components/viewer/{FieldPill-CcYYMw3C.mjs → FieldPill-BTuiYb55.mjs} +1 -1
  192. package/dist/web-components/viewer/{FrameAnimation-CXyt9tLj.mjs → FrameAnimation-DXJvvX_O.mjs} +1 -1
  193. package/dist/web-components/viewer/{Gallery-Dmmh85gM.mjs → Gallery-BR4uUPRO.mjs} +1 -1
  194. package/dist/web-components/viewer/{GlobeGlyph-BkeoT59U.mjs → GlobeGlyph-BFChlnAW.mjs} +1 -1
  195. package/dist/web-components/viewer/{HideToggle-BtfoToGM.mjs → HideToggle-Cl2mlgJh.mjs} +1 -1
  196. package/dist/web-components/viewer/{ImageControls-DdV9OCC9.mjs → ImageControls-rNkvWCA9.mjs} +1 -1
  197. package/dist/web-components/viewer/{LanguageChoice-BC4raDCD.mjs → LanguageChoice-Bel5VdoV.mjs} +1 -1
  198. package/dist/web-components/viewer/{LanguageMenu-B7qmgfps.mjs → LanguageMenu-Bj0g79QR.mjs} +1 -1
  199. package/dist/web-components/viewer/{LightboxView-Dr3R75lS.mjs → LightboxView-DO8edg2H.mjs} +1 -1
  200. package/dist/web-components/viewer/{ListEnd-oPxO8hQE.mjs → ListEnd-D63rV7LR.mjs} +1 -1
  201. package/dist/web-components/viewer/{MapView-Z1P-A5bs.mjs → MapView-ahuj5gKJ.mjs} +2 -2
  202. package/dist/web-components/viewer/{MediaBody-CnKOjrdE.mjs → MediaBody-DJE41Ggr.mjs} +1 -1
  203. package/dist/web-components/viewer/{MediaBody-C2hFgOY8.mjs → MediaBody-DhSdnEui.mjs} +1 -1
  204. package/dist/web-components/viewer/{NavDate-B32M8WGG.mjs → NavDate-C5fftA6E.mjs} +1 -1
  205. package/dist/web-components/viewer/{Navigator-DwbQ5u2i.mjs → Navigator-BVkHzfLs.mjs} +1 -1
  206. package/dist/web-components/viewer/{PagerLayout-BgvyIDpY.mjs → PagerLayout-CKN0Llkn.mjs} +1 -1
  207. package/dist/web-components/viewer/PanelPart-Z12fMdZh.mjs +1 -0
  208. package/dist/web-components/viewer/{PartOfManifest-B9RWDleM.mjs → PartOfManifest-Brc4z7df.mjs} +1 -1
  209. package/dist/web-components/viewer/{PlaceBox-DdCjBb2D.mjs → PlaceBox-ByWy7e9J.mjs} +1 -1
  210. package/dist/web-components/viewer/{Placeholder-CS9JVhwU.mjs → Placeholder-CmKEgeqP.mjs} +1 -1
  211. package/dist/web-components/viewer/{Search-DQ6z5C9S.mjs → Search-COUo-BuO.mjs} +1 -1
  212. package/dist/web-components/viewer/{SeekMarks--tMu7IYO.mjs → SeekMarks-BWHqY1g-.mjs} +1 -1
  213. package/dist/web-components/viewer/{StandaloneItems-DYrbonjJ.mjs → StandaloneItems-87W1Mih3.mjs} +1 -1
  214. package/dist/web-components/viewer/{Steps-WYWqChoR.mjs → Steps-CUzjymlQ.mjs} +1 -1
  215. package/dist/web-components/viewer/{TargetItems-l-tLGkfE.mjs → TargetItems-Bms6M3cB.mjs} +1 -1
  216. package/dist/web-components/viewer/{Transcript-CuHNI7e_.mjs → Transcript-DigEuuAR.mjs} +1 -1
  217. package/dist/web-components/viewer/{Transport-Bu79eBtv.mjs → Transport-BZcrgDpa.mjs} +1 -1
  218. package/dist/web-components/viewer/{Transport-BJRUqslB.mjs → Transport-DFpiEGiY.mjs} +1 -1
  219. package/dist/web-components/viewer/{annotation-collection-C2MWEnuY.mjs → annotation-collection-JyxEZk8B.mjs} +1 -1
  220. package/dist/web-components/viewer/{annotation-name-CKGOe06W.mjs → annotation-name-BJTap0Us.mjs} +1 -1
  221. package/dist/web-components/viewer/{annotations-content-ConN9zDA.mjs → annotations-content-yT8J4zoX.mjs} +1 -1
  222. package/dist/web-components/viewer/{cloverEngine-BCS7nTmf.mjs → cloverEngine-DZDKElxt.mjs} +1 -1
  223. package/dist/web-components/viewer/{content-state-reader-BTtuWgX0.mjs → content-state-reader-RmqJu8gE.mjs} +1 -1
  224. package/dist/web-components/viewer/{dragToClose-aTN7qXF5.mjs → dragToClose-C995dPad.mjs} +1 -1
  225. package/dist/web-components/viewer/{fetchManifest-CCrNctKu.mjs → fetchManifest-CS577eE5.mjs} +1 -1
  226. package/dist/web-components/viewer/{follow-content-C6F0s_fJ.mjs → follow-content-DLMLz7-u.mjs} +1 -1
  227. package/dist/web-components/viewer/{host-BQ8w6end.mjs → host-C79mYkpB.mjs} +1 -1
  228. package/dist/web-components/viewer/{image-layers-D7_YIZD2.mjs → image-layers-zMvi4pmw.mjs} +1 -1
  229. package/dist/web-components/viewer/{image-service-content-D_HLWst7.mjs → image-service-content-CjRd-2iP.mjs} +1 -1
  230. package/dist/web-components/viewer/index.mjs +1 -1
  231. package/dist/web-components/viewer/link-DaJErMnE.mjs +1 -0
  232. package/dist/web-components/viewer/{overlayImage-LSQOVinl.mjs → overlayImage-DCBpb4lw.mjs} +1 -1
  233. package/dist/web-components/viewer/{range-regions-C_AleS_r.mjs → range-regions-BY9UB0kS.mjs} +1 -1
  234. package/dist/web-components/viewer/{renderers-CKX3o8vY.mjs → renderers-BsrSfP28.mjs} +1 -1
  235. package/dist/web-components/viewer/{save-file-BMJIsv-z.mjs → save-file-CwXaCAyi.mjs} +1 -1
  236. package/dist/web-components/viewer/{search-DwsVuur9.mjs → search-CmWgigDq.mjs} +1 -1
  237. package/dist/web-components/viewer/{styles-LW5XsRcK.mjs → styles-ihp-vncb.mjs} +1 -1
  238. package/dist/web-components/viewer/{useControlsVisibility-DIvgbH07.mjs → useControlsVisibility-DbCeSjAK.mjs} +1 -1
  239. package/dist/web-components/viewer/{viewer-8GpsPBqv.mjs → viewer-Ds1v3IFN.mjs} +5 -5
  240. package/dist/web-components/viewer/{vtt-Bnz0c60d.mjs → vtt-CkDv-L8Y.mjs} +1 -1
  241. package/dist/web-components/{viewer-Tuo0l3iL.mjs → viewer-B2HVSNC2.mjs} +1 -1
  242. package/dist/web-components/{vtt-BUo1kBkL.mjs → vtt-CylghmBS.mjs} +1 -1
  243. package/dist/web-components/{zh-Hans-DnYm6PWu.mjs → zh-Hans-Bfn3LUnq.mjs} +1 -1
  244. package/dist/web-components/{zh-Hant-DsxnuLPZ.mjs → zh-Hant-DzmK541A.mjs} +1 -1
  245. package/package.json +1 -1
  246. package/dist/web-components/Annotations-DrqkNr7d.mjs +0 -2
  247. package/dist/web-components/ControlsFade-_qZMmd34.mjs +0 -1
  248. package/dist/web-components/Cue-I_zHaG-m.mjs +0 -1
  249. package/dist/web-components/LoadedMap-Drwww6ZP.mjs +0 -1
  250. package/dist/web-components/PanelPart-hk33tq-m.mjs +0 -1
  251. package/dist/web-components/Scene-DkWFm9Ym.mjs +0 -1
  252. package/dist/web-components/Timeline-BBUkJGOZ.mjs +0 -1
  253. package/dist/web-components/items-Bu0NTcJ9.mjs +0 -1
  254. package/dist/web-components/label-DXfO2yzp.mjs +0 -1
  255. package/dist/web-components/link-CVd4-rY6.mjs +0 -1
  256. package/dist/web-components/logo-1fBtW3pZ.mjs +0 -1
  257. package/dist/web-components/part-DyDa2O7K.mjs +0 -1
  258. package/dist/web-components/shared-GHegGgtP.mjs +0 -1
  259. package/dist/web-components/viewer/Annotations-C0uuxF0R.mjs +0 -2
  260. package/dist/web-components/viewer/ControlsFade-cDNVSrmI.mjs +0 -1
  261. package/dist/web-components/viewer/Cue-kaHJidpH.mjs +0 -1
  262. package/dist/web-components/viewer/PanelPart-7C8kqYXz.mjs +0 -1
  263. package/dist/web-components/viewer/link-CX0131kM.mjs +0 -1
@@ -1,4 +1,4 @@
1
- var Ql=Object.defineProperty;var tu=(t,e,n)=>e in t?Ql(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var L=(t,e,n)=>tu(t,typeof e!="symbol"?e+"":e,n);import{s as Ea}from"./styles-LW5XsRcK.mjs";function eu(t={}){return Promise.resolve().then(()=>ad).then(e=>e.initCloverI18n(t))}const Ma="@layer clover{:is(clover-root,clover-items,clover-viewer,clover-panel,clover-read-more):not([hidden]){display:block}:is(clover-body,clover-canvas,clover-timeline,clover-scene):not([hidden]){display:block;height:var(--clover-body-height,60vh)}clover-split:not([hidden]){display:flex}:is(clover-label,clover-panel-toggle):not([hidden]){display:contents}clover-tab,clover-tip,clover-status>[slot]{display:none}}";let nu=null,xn=null;const ou=()=>nu??(nu=import("./host-BQ8w6end.mjs").then(t=>xn=t)),ru=t=>t.trim().toLowerCase()==="false";function su(t,{type:e,min:n},o){if(t===null)return;if(e==="string")return t;if(e==="boolean")return!ru(t);if(e==="number"){const s=Number(t);if(t.trim()===""||!Number.isFinite(s)){o("is not a number");return}if(n!==void 0&&s<n){o(`is less than ${n}`);return}return s}if(e==="data"){const s=t.trim();if(!/^[[{"]/.test(s))return t;try{return JSON.parse(s)}catch{o("is not JSON");return}}const r=t.trim().toLowerCase();if(e.includes(r))return r==="false"?false:r;o(`is not ${e.join(", ")}`)}const iu=(t,e)=>{const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(o=>Object.is(t[o],e[o]))};function au(t){class e extends HTMLElement{constructor(){super(...arguments);L(this,"kind",t.kind)}static get observedAttributes(){return Object.keys(t.attributes)}connectedCallback(){Ea(this.ownerDocument).inject("elements",Ma)}}customElements.define(t.tag,e)}function cu(t,e){if(typeof customElements>"u"||customElements.get(t.tag))return;if(t.kind==="config"||!e)return au(t);const n=t.kind,o=t.properties??[],r=Object.entries(t.events??{});let s=null,i=null;const a=()=>i??(i=Promise.all([e().then(l=>s=l),ou()]));class c extends HTMLElement{constructor(){super(...arguments);L(this,"kind",n);L(this,"needsRoot",!!t.needsRoot);L(this,"values",{});L(this,"kept",{});L(this,"props",{});L(this,"listeners",new Set);L(this,"warned",new Set);L(this,"handlers",Object.fromEntries(r.map(([u,p])=>[p.prop,(...h)=>{var w;if(p.keeps&&(this.kept[p.keeps]=h[0]??null,h[0]==null))return true;const m=p.detail==="first"?h[0]:Object.fromEntries(p.detail.map((S,v)=>[S,h[v]])),g=new CustomEvent(u,{detail:m,bubbles:!p.keeps,composed:!p.keeps,cancelable:!!p.cancelable}),_=this.dispatchEvent(g);if(!_&&p.cancelable){const S=h[h.length-1];(w=S==null?void 0:S.preventDefault)==null||w.call(S)}return _}])));L(this,"getProps",()=>this.props);L(this,"subscribe",u=>(this.listeners.add(u),()=>{this.listeners.delete(u)}))}static get observedAttributes(){return Object.keys(t.attributes)}get element(){return this}get Component(){return s}connectedCallback(){for(const u of o){if(!Object.prototype.hasOwnProperty.call(this,u))continue;const p=this[u];delete this[u],p!=null&&(this.values[u]=p)}this.update(),this.warnOfAria(),Ea(this.ownerDocument).inject("elements",Ma),a().then(()=>{this.isConnected&&xn.hostOf(this.ownerDocument).connect(this)})}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||xn==null||xn.hostOf(this.ownerDocument).disconnect(this)})}attributeChangedCallback(){this.update()}warnOfAria(){if(!t.native)for(const u of["aria-label","aria-labelledby","role"])!this.hasAttribute(u)||this.warned.has(u)||(this.warned.add(u),console.warn(`<${t.tag}>: ${u} names the element, a box no reader is told of; Clover names what it draws itself.`))}update(){const u={...this.handlers,...this.values};for(const[p,h]of Object.entries(t.attributes)){if(h.prop in this.values)continue;const m=this.getAttribute(p),g=su(m,h,_=>{const w=`${p}=${m}`;this.warned.has(w)||(this.warned.add(w),console.warn(`<${t.tag}>: ${p}="${m}" ${_}; ignored.`))});g!==void 0&&(u[h.prop]=g)}iu(u,this.props)||(this.props=u,this.listeners.forEach(p=>p()))}}L(c,"initCloverI18n",eu);for(const l of o)Object.defineProperty(c.prototype,l,{configurable:true,enumerable:true,get(){return l in this.values?this.values[l]:this.getProps()[l]},set(d){d==null?delete this.values[l]:this.values[l]=d,this.update()}});for(const[,l]of r){if(!l.keeps)continue;const d=l.keeps;Object.defineProperty(c.prototype,d,{configurable:true,enumerable:true,get(){return this.kept[d]??null}})}customElements.define(t.tag,c)}var An,it,Ta,ze,ei,Ia,La,Pa,jr,yr,br,Aa,Mn={},Oa=[],lu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,On=Array.isArray;function ce(t,e){for(var n in e)t[n]=e[n];return t}function Vr(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function xe(t,e,n){var o,r,s,i={};for(s in e)s=="key"?o=e[s]:s=="ref"?r=e[s]:i[s]=e[s];if(arguments.length>2&&(i.children=arguments.length>3?An.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)i[s]===void 0&&(i[s]=t.defaultProps[s]);return Cn(t,i,o,r,null)}function Cn(t,e,n,o,r){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Ta,__i:-1,__u:0};return r==null&&it.vnode!=null&&it.vnode(s),s}function uu(){return{current:null}}function Ct(t){return t.children}function le(t,e){this.props=t,this.context=e}function cn(t,e){if(e==null)return t.__?cn(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?cn(t):null}function Na(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Na(t)}}function _r(t){(!t.__d&&(t.__d=true)&&ze.push(t)&&!lo.__r++||ei!=it.debounceRendering)&&((ei=it.debounceRendering)||Ia)(lo)}function lo(){for(var t,e,n,o,r,s,i,a=1;ze.length;)ze.length>a&&ze.sort(La),t=ze.shift(),a=ze.length,t.__d&&(n=void 0,o=void 0,r=(o=(e=t).__v).__e,s=[],i=[],e.__P&&((n=ce({},o)).__v=o.__v+1,it.vnode&&it.vnode(n),qr(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[r]:null,s,r??cn(o),!!(32&o.__u),i),n.__v=o.__v,n.__.__k[n.__i]=n,$a(s,n,i),o.__e=o.__=null,n.__e!=r&&Na(n)));lo.__r=0}function Ra(t,e,n,o,r,s,i,a,c,l,d){var u,p,h,m,g,_,w,S=o&&o.__k||Oa,v=e.length;for(c=du(n,e,S,c,v),u=0;u<v;u++)(h=n.__k[u])!=null&&(p=h.__i==-1?Mn:S[h.__i]||Mn,h.__i=u,_=qr(t,h,p,r,s,i,a,c,l,d),m=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Kr(p.ref,null,h),d.push(h.ref,h.__c||m,h)),g==null&&m!=null&&(g=m),(w=!!(4&h.__u))||p.__k===h.__k?c=Ba(h,c,t,w):typeof h.type=="function"&&_!==void 0?c=_:m&&(c=m.nextSibling),h.__u&=-7);return n.__e=g,c}function du(t,e,n,o,r){var s,i,a,c,l,d=n.length,u=d,p=0;for(t.__k=new Array(r),s=0;s<r;s++)(i=e[s])!=null&&typeof i!="boolean"&&typeof i!="function"?(c=s+p,(i=t.__k[s]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?Cn(null,i,null,null,null):On(i)?Cn(Ct,{children:i},null,null,null):i.constructor==null&&i.__b>0?Cn(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=t,i.__b=t.__b+1,a=null,(l=i.__i=fu(i,n,c,u))!=-1&&(u--,(a=n[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>d?p--:r<d&&p++),typeof i.type!="function"&&(i.__u|=4)):l!=c&&(l==c-1?p--:l==c+1?p++:(l>c?p--:p++,i.__u|=4))):t.__k[s]=null;if(u)for(s=0;s<d;s++)(a=n[s])!=null&&!(2&a.__u)&&(a.__e==o&&(o=cn(a)),Da(a,a));return o}function Ba(t,e,n,o){var r,s;if(typeof t.type=="function"){for(r=t.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=t,e=Ba(r[s],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=cn(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function we(t,e){return e=e||[],t==null||typeof t=="boolean"||(On(t)?t.some(function(n){we(n,e)}):e.push(t)),e}function fu(t,e,n,o){var r,s,i,a=t.key,c=t.type,l=e[n],d=l!=null&&(2&l.__u)==0;if(l===null&&t.key==null||d&&a==l.key&&c==l.type)return n;if(o>(d?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((l=e[i=r>=0?r--:s++])!=null&&!(2&l.__u)&&a==l.key&&c==l.type)return i}return-1}function ni(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||lu.test(e)?n:n+"px"}function no(t,e,n,o,r){var s,i;t:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||ni(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||ni(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Pa,"$1")),i=e.toLowerCase(),e=i in t||e=="onFocusOut"||e=="onFocusIn"?i.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?o?n.u=o.u:(n.u=jr,t.addEventListener(e,s?br:yr,s)):t.removeEventListener(e,s?br:yr,s);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break t}catch{}typeof n=="function"||(n==null||n===false&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function oi(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=jr++;else if(e.t<n.u)return;return n(it.event?it.event(e):e)}}}function qr(t,e,n,o,r,s,i,a,c,l){var d,u,p,h,m,g,_,w,S,v,y,x,k,N,D,j,et,V=e.type;if(e.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=e.__e=n.__e]),(d=it.__b)&&d(e);t:if(typeof V=="function")try{if(w=e.props,S="prototype"in V&&V.prototype.render,v=(d=V.contextType)&&o[d.__c],y=d?v?v.props.value:d.__:o,n.__c?_=(u=e.__c=n.__c).__=u.__E:(S?e.__c=u=new V(w,y):(e.__c=u=new le(w,y),u.constructor=V,u.render=pu),v&&v.sub(u),u.props=w,u.state||(u.state={}),u.context=y,u.__n=o,p=u.__d=true,u.__h=[],u._sb=[]),S&&u.__s==null&&(u.__s=u.state),S&&V.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ce({},u.__s)),ce(u.__s,V.getDerivedStateFromProps(w,u.__s))),h=u.props,m=u.state,u.__v=e,p)S&&V.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),S&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(S&&V.getDerivedStateFromProps==null&&w!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(w,y),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,y)===false||e.__v==n.__v){for(e.__v!=n.__v&&(u.props=w,u.state=u.__s,u.__d=false),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(nt){nt&&(nt.__=e)}),x=0;x<u._sb.length;x++)u.__h.push(u._sb[x]);u._sb=[],u.__h.length&&i.push(u);break t}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,y),S&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,m,g)})}if(u.context=y,u.props=w,u.__P=t,u.__e=false,k=it.__r,N=0,S){for(u.state=u.__s,u.__d=false,k&&k(e),d=u.render(u.props,u.state,u.context),D=0;D<u._sb.length;D++)u.__h.push(u._sb[D]);u._sb=[]}else do u.__d=false,k&&k(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++N<25);u.state=u.__s,u.getChildContext!=null&&(o=ce(ce({},o),u.getChildContext())),S&&!p&&u.getSnapshotBeforeUpdate!=null&&(g=u.getSnapshotBeforeUpdate(h,m)),j=d,d!=null&&d.type===Ct&&d.key==null&&(j=Fa(d.props.children)),a=Ra(t,On(j)?j:[j],e,n,o,r,s,i,a,c,l),u.base=e.__e,e.__u&=-161,u.__h.length&&i.push(u),_&&(u.__E=u.__=null)}catch(nt){if(e.__v=null,c||s!=null)if(nt.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(et=s.length;et--;)Vr(s[et]);wr(e)}else e.__e=n.__e,e.__k=n.__k,nt.then||wr(e);it.__e(nt,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=hu(n.__e,e,n,o,r,s,i,c,l);return(d=it.diffed)&&d(e),128&e.__u?void 0:a}function wr(t){t&&t.__c&&(t.__c.__e=true),t&&t.__k&&t.__k.forEach(wr)}function $a(t,e,n){for(var o=0;o<n.length;o++)Kr(n[o],n[++o],n[++o]);it.__c&&it.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){it.__e(s,r.__v)}})}function Fa(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:On(t)?t.map(Fa):ce({},t)}function hu(t,e,n,o,r,s,i,a,c){var l,d,u,p,h,m,g,_=n.props,w=e.props,S=e.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((h=s[l])&&"setAttribute"in h==!!S&&(S?h.localName==S:h.nodeType==3)){t=h,s[l]=null;break}}if(t==null){if(S==null)return document.createTextNode(w);t=document.createElementNS(r,S,w.is&&w),a&&(it.__m&&it.__m(e,s),a=false),s=null}if(S==null)_===w||a&&t.data==w||(t.data=w);else{if(s=s&&An.call(t.childNodes),_=n.props||Mn,!a&&s!=null)for(_={},l=0;l<t.attributes.length;l++)_[(h=t.attributes[l]).name]=h.value;for(l in _)if(h=_[l],l!="children"){if(l=="dangerouslySetInnerHTML")u=h;else if(!(l in w)){if(l=="value"&&"defaultValue"in w||l=="checked"&&"defaultChecked"in w)continue;no(t,l,null,h,r)}}for(l in w)h=w[l],l=="children"?p=h:l=="dangerouslySetInnerHTML"?d=h:l=="value"?m=h:l=="checked"?g=h:a&&typeof h!="function"||_[l]===h||no(t,l,h,_[l],r);if(d)a||u&&(d.__html==u.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(u&&(t.innerHTML=""),Ra(e.type=="template"?t.content:t,On(p)?p:[p],e,n,o,S=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,i,s?s[0]:n.__k&&cn(n,0),a,c),s!=null)for(l=s.length;l--;)Vr(s[l]);a||(l="value",S=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[l]||S=="progress"&&!m||S=="option"&&m!=_[l])&&no(t,l,m,_[l],r),l="checked",g!=null&&g!=t[l]&&no(t,l,g,_[l],r))}return t}function Kr(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(r){it.__e(r,n)}}function Da(t,e,n){var o,r;if(it.unmount&&it.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||Kr(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(s){it.__e(s,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&Da(o[r],e,n||typeof t.type!="function");n||Vr(t.__e),t.__c=t.__=t.__e=void 0}function pu(t,e,n){return this.constructor(t,n)}function Tn(t,e,n){var o,r,s,i;e==document&&(e=document.documentElement),it.__&&it.__(t,e),r=(o=typeof n=="function")?null:n&&n.__k||e.__k,s=[],i=[],qr(e,t=(!o&&n||e).__k=xe(Ct,null,[t]),r||Mn,Mn,e.namespaceURI,!o&&n?[n]:r?null:e.firstChild?An.call(e.childNodes):null,s,!o&&n?n:r?r.__e:e.firstChild,o,i),$a(s,t,i)}function za(t,e){Tn(t,e,za)}function mu(t,e,n){var o,r,s,i,a=ce({},t.props);for(s in t.type&&t.type.defaultProps&&(i=t.type.defaultProps),e)s=="key"?o=e[s]:s=="ref"?r=e[s]:a[s]=e[s]===void 0&&i!=null?i[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?An.call(arguments,2):n),Cn(t.type,a,o||t.key,r||t.ref,null)}function he(t){function e(n){var o,r;return this.getChildContext||(o=new Set,(r={})[e.__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,_r(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 e.__c="__cC"+Aa++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,o){return n.children(o)}).contextType=e,e}An=Oa.slice,it={__e:function(t,e,n,o){for(var r,s,i;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),i=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,o||{}),i=r.__d),i)return r.__E=r}catch(a){t=a}throw t}},Ta=0,le.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ce({},this.state),typeof t=="function"&&(t=t(ce({},n),this.props)),t&&ce(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),_r(this))},le.prototype.forceUpdate=function(t){this.__v&&(this.__e=true,t&&this.__h.push(t),_r(this))},le.prototype.render=Ct,ze=[],Ia=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,La=function(t,e){return t.__v.__b-e.__v.__b},lo.__r=0,Pa=/(PointerCapture)$|Capture$/i,jr=0,yr=oi(false),br=oi(true),Aa=0;var gu=0;function f(t,e,n,o,r,s){e||(e={});var i,a,c=e;if("ref"in c)for(a in c={},e)a=="ref"?i=e[a]:c[a]=e[a];var l={type:t,props:c,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--gu,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(i=t.defaultProps))for(a in i)c[a]===void 0&&(c[a]=i[a]);return it.vnode&&it.vnode(l),l}var Ae,kt,Yo,ri,ln=0,Ha=[],Mt=it,si=Mt.__b,ii=Mt.__r,ai=Mt.diffed,ci=Mt.__c,li=Mt.unmount,ui=Mt.__;function fn(t,e){Mt.__h&&Mt.__h(kt,t,ln||e),ln=0;var n=kt.__H||(kt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function H(t){return ln=1,Zr(ja,t)}function Zr(t,e,n){var o=fn(Ae++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):ja(void 0,e),function(a){var c=o.__N?o.__N[0]:o.__[0],l=o.t(c,a);c!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=kt,!kt.__f)){var r=function(a,c,l){if(!o.__c.__H)return true;var d=o.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!s||s.call(this,a,c,l);var u=o.__c.props!==a;return d.forEach(function(p){if(p.__N){var h=p.__[0];p.__=p.__N,p.__N=void 0,h!==p.__[0]&&(u=true)}}),s&&s.call(this,a,c,l)||u};kt.__f=true;var s=kt.shouldComponentUpdate,i=kt.componentWillUpdate;kt.componentWillUpdate=function(a,c,l){if(this.__e){var d=s;s=void 0,r(a,c,l),s=d}i&&i.call(this,a,c,l)},kt.shouldComponentUpdate=r}return o.__N||o.__}function F(t,e){var n=fn(Ae++,3);!Mt.__s&&Xr(n.__H,e)&&(n.__=t,n.u=e,kt.__H.__h.push(n))}function Ut(t,e){var n=fn(Ae++,4);!Mt.__s&&Xr(n.__H,e)&&(n.__=t,n.u=e,kt.__h.push(n))}function R(t){return ln=5,bt(function(){return{current:t}},[])}function Wa(t,e,n){ln=6,Ut(function(){if(typeof t=="function"){var o=t(e());return function(){t(null),o&&typeof o=="function"&&o()}}if(t)return t.current=e(),function(){return t.current=null}},n==null?n:n.concat(t))}function bt(t,e){var n=fn(Ae++,7);return Xr(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function ut(t,e){return ln=8,bt(function(){return t},e)}function jt(t){var e=kt.context[t.__c],n=fn(Ae++,9);return n.c=t,e?(n.__==null&&(n.__=true,e.sub(kt)),e.props.value):t.__}function Ua(t,e){Mt.useDebugValue&&Mt.useDebugValue(e?e(t):t)}function Gr(){var t=fn(Ae++,11);if(!t.__){for(var e=kt.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function vu(){for(var t;t=Ha.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(io),t.__H.__h.forEach(xr),t.__H.__h=[]}catch(e){t.__H.__h=[],Mt.__e(e,t.__v)}}Mt.__b=function(t){kt=null,si&&si(t)},Mt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ui&&ui(t,e)},Mt.__r=function(t){ii&&ii(t),Ae=0;var e=(kt=t.__c).__H;e&&(Yo===kt?(e.__h=[],kt.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(io),e.__h.forEach(xr),e.__h=[],Ae=0)),Yo=kt},Mt.diffed=function(t){ai&&ai(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ha.push(e)!==1&&ri===Mt.requestAnimationFrame||((ri=Mt.requestAnimationFrame)||yu)(vu)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Yo=kt=null},Mt.__c=function(t,e){e.some(function(n){try{n.__h.forEach(io),n.__h=n.__h.filter(function(o){return!o.__||xr(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Mt.__e(o,n.__v)}}),ci&&ci(t,e)},Mt.unmount=function(t){li&&li(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{io(o)}catch(r){e=r}}),n.__H=void 0,e&&Mt.__e(e,n.__v))};var di=typeof requestAnimationFrame=="function";function yu(t){var e,n=function(){clearTimeout(o),di&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);di&&(e=requestAnimationFrame(n))}function io(t){var e=kt,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),kt=e}function xr(t){var e=kt;t.__c=t.__(),kt=e}function Xr(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function ja(t,e){return typeof e=="function"?e(t):e}function Va(t,e){for(var n in e)t[n]=e[n];return t}function Sr(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return true;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return true;return false}function ee(t,e){var n=e(),o=H({t:{__:n,u:e}}),r=o[0].t,s=o[1];return Ut(function(){r.__=n,r.u=e,Jo(r)&&s({t:r})},[t,n,e]),F(function(){return Jo(r)&&s({t:r}),t(function(){Jo(r)&&s({t:r})})},[t]),n}function Jo(t){var e,n,o=t.u,r=t.__;try{var s=o();return!((e=r)===(n=s)&&(e!==0||1/e==1/n)||e!=e&&n!=n)}catch{return true}}function qa(t){t()}function Ka(t){return t}function Za(){return[false,qa]}var Ga=Ut;function kr(t,e){this.props=t,this.context=e}function bu(t,e){function n(r){var s=this.props.ref,i=s==r.ref;return!i&&s&&(s.call?s(null):s.current=null),e?!e(this.props,r)||!i:Sr(this.props,r)}function o(r){return this.shouldComponentUpdate=n,xe(t,r)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=true,o.__f=true,o.type=t,o}(kr.prototype=new le).isPureReactComponent=true,kr.prototype.shouldComponentUpdate=function(t,e){return Sr(this.props,t)||Sr(this.state,e)};var fi=it.__b;it.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),fi&&fi(t)};var _u=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ie(t){function e(n){var o=Va({},n);return delete o.ref,t(o,n.ref||null)}return e.$$typeof=_u,e.render=t,e.prototype.isReactComponent=e.__f=true,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var hi=function(t,e){return t==null?null:we(we(t).map(e))},wu={map:hi,forEach:hi,count:function(t){return t?we(t).length:0},only:function(t){var e=we(t);if(e.length!==1)throw"Children.only";return e[0]},toArray:we},xu=it.__e;it.__e=function(t,e,n,o){if(t.then){for(var r,s=e;s=s.__;)if((r=s.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e)}xu(t,e,n,o)};var pi=it.unmount;function Xa(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=Va({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=true,t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return Xa(o,e,n)})),t}function Ya(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return Ya(o,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=true,t.__c.__P=n)),t}function St(){this.__u=0,this.o=null,this.__b=null}function Ja(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function vt(t){var e,n,o;function r(s){if(e||(e=t()).then(function(i){n=i.default||i},function(i){o=i}),o)throw o;if(!n)throw e;return xe(n,s)}return r.displayName="Lazy",r.__f=true,r}function Sn(){this.i=null,this.l=null}it.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),pi&&pi(t)},(St.prototype=new le).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=Ja(o.__v),s=false,i=function(){s||(s=true,n.__R=null,r?r(a):a())};n.__R=i;var a=function(){if(!--o.__u){if(o.state.__a){var c=o.state.__a;o.__v.__k[0]=Ya(c,c.__c.__P,c.__c.__O)}var l;for(o.setState({__a:o.__b=null});l=o.o.pop();)l.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(i,i)},St.prototype.componentWillUnmount=function(){this.o=[]},St.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Xa(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&xe(Ct,null,t.fallback);return r&&(r.__u&=-33),[xe(Ct,null,e.__a?null:t.children),r]};var mi=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};function Su(t){return this.getChildContext=function(){return t.context},t.children}function ku(t){var e=this,n=t.h;if(e.componentWillUnmount=function(){Tn(null,e.v),e.v=null,e.h=null},e.h&&e.h!==n&&e.componentWillUnmount(),!e.v){for(var o=e.__v;o!==null&&!o.__m&&o.__!==null;)o=o.__;e.h=n,e.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return true},insertBefore:function(r,s){this.childNodes.push(r),e.h.insertBefore(r,s)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.h.removeChild(r)}}}Tn(xe(Su,{context:e.context},t.__v),e.v)}function Cu(t,e){var n=xe(ku,{__v:t,h:e});return n.containerInfo=e,n}(Sn.prototype=new le).__a=function(t){var e=this,n=Ja(e.__v),o=e.l.get(t);return o[0]++,function(r){var s=function(){e.props.revealOrder?(o.push(r),mi(e,t,o)):r()};n?n(s):s()}},Sn.prototype.render=function(t){this.i=null,this.l=new Map;var e=we(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Sn.prototype.componentDidUpdate=Sn.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){mi(t,n,e)})};var Qa=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Eu=/^(?: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]/,Mu=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Tu=/[A-Z0-9]/g,Iu=typeof document<"u",Lu=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function Pu(t,e,n){return e.__k==null&&(e.textContent=""),Tn(t,e),typeof n=="function"&&n(),t?t.__c:null}function Au(t,e,n){return za(t,e),typeof n=="function"&&n(),t?t.__c:null}le.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(le.prototype,t,{configurable:true,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:true,writable:true,value:e})}})});var gi=it.event;function Ou(){}function Nu(){return this.cancelBubble}function Ru(){return this.defaultPrevented}it.event=function(t){return gi&&(t=gi(t)),t.persist=Ou,t.isPropagationStopped=Nu,t.isDefaultPrevented=Ru,t.nativeEvent=t};var Yr,Bu={enumerable:false,configurable:true,get:function(){return this.class}},vi=it.vnode;it.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,o=e.type,r={},s=o.indexOf("-")===-1;for(var i in n){var a=n[i];if(!(i==="value"&&"defaultValue"in n&&a==null||Iu&&i==="children"&&o==="noscript"||i==="class"||i==="className")){var c=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&a===true?a="":c==="translate"&&a==="no"?a=false:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?i="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||Lu(n.type)?c==="onfocus"?i="onfocusin":c==="onblur"?i="onfocusout":Mu.test(i)&&(i=c):c=i="oninput":s&&Eu.test(i)?i=i.replace(Tu,"-$&").toLowerCase():a===null&&(a=void 0),c==="oninput"&&r[i=c]&&(i="oninputCapture"),r[i]=a}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=we(n.children).forEach(function(l){l.props.selected=r.value.indexOf(l.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=we(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",Bu)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),e.props=r}(t),t.$$typeof=Qa,vi&&vi(t)};var yi=it.__r;it.__r=function(t){yi&&yi(t),Yr=t.__c};var bi=it.diffed;it.diffed=function(t){bi&&bi(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value),Yr=null};var $u={ReactCurrentDispatcher:{current:{readContext:function(t){return Yr.__n[t.__c].props.value},useCallback:ut,useContext:jt,useDebugValue:Ua,useDeferredValue:Ka,useEffect:F,useId:Gr,useImperativeHandle:Wa,useInsertionEffect:Ga,useLayoutEffect:Ut,useMemo:bt,useReducer:Zr,useRef:R,useState:H,useSyncExternalStore:ee,useTransition:Za}}};function Fu(t){return xe.bind(null,t)}function wo(t){return!!t&&t.$$typeof===Qa}function Du(t){return wo(t)&&t.type===Ct}function zu(t){return!!t&&!!t.displayName&&(typeof t.displayName=="string"||t.displayName instanceof String)&&t.displayName.startsWith("Memo(")}function Hu(t){return wo(t)?mu.apply(null,arguments):t}function Wu(t){return!!t.__k&&(Tn(null,t),true)}function Uu(t){return t&&(t.base||t.nodeType===1&&t)||null}var ju=function(t,e){return t(e)},Vu=function(t,e){return t(e)},qu=Ct,Ku=wo,ue={useState:H,useId:Gr,useReducer:Zr,useEffect:F,useLayoutEffect:Ut,useInsertionEffect:Ga,useTransition:Za,useDeferredValue:Ka,useSyncExternalStore:ee,startTransition:qa,useRef:R,useImperativeHandle:Wa,useMemo:bt,useCallback:ut,useContext:jt,useDebugValue:Ua,version:"18.3.1",Children:wu,render:Pu,hydrate:Au,unmountComponentAtNode:Wu,createPortal:Cu,createElement:xe,createContext:he,createFactory:Fu,cloneElement:Hu,createRef:uu,Fragment:Ct,isValidElement:wo,isElement:Ku,isFragment:Du,isMemo:zu,findDOMNode:Uu,Component:le,PureComponent:kr,memo:bu,forwardRef:ie,flushSync:Vu,unstable_batchedUpdates:ju,StrictMode:qu,Suspense:St,SuspenseList:Sn,lazy:vt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:$u};function Jr(t){const e=ee(Gu,Xu);return!!t||e}const Qr=t=>t?{"data-high-contrast":""}:{},Zu="(prefers-contrast: more)",tc=()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Zu):null;function Gu(t){var n;const e=tc();return(n=e==null?void 0:e.addEventListener)==null||n.call(e,"change",t),()=>{var o;return(o=e==null?void 0:e.removeEventListener)==null?void 0:o.call(e,"change",t)}}const Xu=()=>{var t;return!!((t=tc())!=null&&t.matches)},Nn=he(void 0),It=(...t)=>t.filter(Boolean).join(" "),xo=he(null);function Ne(){return jt(xo)}function ae(t="This part"){const e=jt(xo);if(!e)throw new Error(`${t} must be rendered inside <Clover.Root>.`);return e}function st(t,e=Object.is,n){const{clover:o}=ae(n),r=R(null),s=()=>{const i=t(o.store.get());return r.current&&e(r.current.value,i)?r.current.value:(r.current={value:i},i)};return ee(o.store.subscribe,s)}const Yu={subscribe:()=>()=>{}};function Rn(t,e){const n=jt(xo),o=n==null?void 0:n.clover.store,r=()=>o?t(o.get()):e;return ee(o?o.subscribe:Yu.subscribe,r)}const Ju=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"}'),ec={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 ts(){return typeof navigator>"u"?[]:[...navigator.languages??[],navigator.language].filter(Boolean)}function nc(){if(!(typeof document>"u"))return document.documentElement.lang||void 0}let oc=()=>[];function Qu(t){oc=t}function td(){const[t,...e]=oc();return[...new Set([t,...ts(),...e,nc()].filter(n=>!!n))]}const uo=t=>t.split("-")[0];function es(t,e){return uo(t).toLowerCase()===uo(e).toLowerCase()}function Cr(t){try{const{language:e,script:n}=new Intl.Locale(t).maximize();return n&&`${e}-${n}`}catch{return}}function ed(t,e){const n=Cr(t);if(n)return e.find(o=>o!=="none"&&o!=="@none"&&Cr(o)===n)}const Qo=t=>t.includes("-")?uo(t):null;function nd(t,e,n=[]){if(!e.length)return;if(e.length===1)return e[0];const o=()=>e.includes("none")?"none":e.includes("@none")?"@none":e[0];if(!t)return e.includes("none")?"none":e[0];if(e.includes(t))return t;const r=Qo(t);if(r&&e.includes(r))return r;const s=ed(t,e);if(s)return s;const i=n.find(c=>e.includes(c));if(i)return i;const a=e.findIndex(c=>Qo(c)===t);if(a!==-1)return e[a];for(const c of n){const l=Qo(c);if(l&&e.includes(l))return l}return o()}function ns(t,e){const[n,...o]=e?[e]:td();return nd(n,t,o)??t[0]}function rc(t,e,n){if(n&&t.includes(n))return n;if(!t.length)return;const o=ns(t,e);return o==="none"?t[0]:o}const ye="clover",Qt={en:{[ye]:{...Ju}}};let kn=[],Jt,fo=[],sc=[],os=0;const Er=new Set;function rs(){os++,Er.forEach(t=>t())}function ic(t){return[t,Cr(t),uo(t)].filter(e=>!!e)}const od=t=>t==="en"||ac(t)||!!Qt[t],Oe=t=>ic(t).find(od),_i=new Map,ac=t=>Object.prototype.hasOwnProperty.call(ec,t);function rd(t){let e=_i.get(t);return e||(e=ec[t]().then(({default:n})=>{var o;Qt[t]={...Qt[t],[ye]:{...n,...(o=Qt[t])==null?void 0:o[ye]}},rs()},()=>{}),_i.set(t,e)),e}function Mr(t){const e=t.find(n=>n==="en"||ac(n));return e&&e!=="en"?rd(e):Promise.resolve()}let oo=[],wi="",In="en";function So(){const t=nc();return[...new Set([...kn,...t?[t]:[]])]}function Pe(){const t=`${os} ${typeof document<"u"?document.documentElement.lang:""} ${typeof navigator<"u"?navigator.languages:""}`;if(t===wi)return oo;wi=t;const e=So();return In=ts().map(Oe).find(Boolean)??e.map(Oe).find(Boolean)??"en",oo=[...new Set([Jt??In,...sc,...e].filter(o=>!!o).flatMap(ic).concat("en"))],Mr(oo),oo}function sd(){return Pe(),[...new Set([In,...So().map(Oe),...fo.map(Oe)].filter(t=>!!t))]}Qu(()=>(Pe(),[Jt,In,...So()]));function ko(t,e){if(t)return es(t,e||Tt.resolvedLanguage)?void 0:t}const Tt={get language(){return Jt??Pe().find(t=>Qt[t])??"en"},get chosenLanguage(){return Jt},stringsFor(t){return Oe(t)},interfaceLanguages(){return{languages:sd(),chosen:Jt&&Oe(Jt)||In}},chooseInterfaceLanguage(t){return Jt=t||void 0,fo=Jt?[...new Set([...fo,Jt])]:[],rs(),Mr(Pe())},get resolvedLanguage(){return Pe().find(t=>{var e;return Object.keys(((e=Qt[t])==null?void 0:e[ye])??{}).length>0})??"en"},changeLanguage(t){return Tt.chooseInterfaceLanguage(t)},resolve(t,e,n=ye){var r,s;let o={text:t};for(const i of Pe()){const a=(s=(r=Qt[i])==null?void 0:r[n])==null?void 0:s[t];if(a!==void 0){o={text:a,lang:i};break}}return e?{...o,text:o.text.replace(/\{\{(\w+)\}\}/g,(i,a)=>a in e?String(e[a]):i)}:o},t(t,e,n=ye){return Tt.resolve(t,e,n).text},langOf(t,e,n=ye){return ko(Tt.resolve(t,void 0,n).lang,e)},ready(){return Mr(Pe())},subscribe(t){return Er.add(t),()=>{Er.delete(t)}},getSnapshot(){return os}};typeof document<"u"&&Pe();function id(t={}){for(const[n,o]of Object.entries(t.resources??{}))for(const[r,s]of Object.entries(o??{}))Qt[n]??(Qt[n]={}),Qt[n][r]={...Qt[n][r],...s};t.fallbackLng!==void 0&&(sc=t.fallbackLng===false?[]:[t.fallbackLng].flat());const e=kn.join();if(t.languages!==void 0?kn=[t.languages].flat().filter(Boolean):t.lng&&(kn=[t.lng]),kn.join()!==e){fo=[];const n=[...ts(),...So()].map(Oe);Jt&&!n.includes(Oe(Jt))&&(Jt=void 0)}return rs(),Tt}const ad=Object.freeze(Object.defineProperty({__proto__:null,CLOVER_I18N_NAMESPACE:ye,cloverI18n:Tt,initCloverI18n:id,langWithin:ko},Symbol.toStringTag,{value:"Module"}));function Et(t=ye,e){const n=ee(Tt.subscribe,Tt.getSnapshot,Tt.getSnapshot),o=jt(Nn),r=e??o,s=ut((a,c)=>Tt.t(a,c,t),[t,n]),i=ut(a=>Tt.langOf(a,r,t),[t,n,r]);return{t:s,langOf:i,hostLanguage:r,i18n:Tt}}function Co(t,e){const n=jt(Nn),o=R(null),[r,s]=H(""),i=ut(d=>{o.current=d,typeof t=="function"?t(d):t&&(t.current=d)},[t]);F(()=>{var u,p;const d=(u=o.current)==null?void 0:u.parentElement;e!==void 0||n!==void 0||!d||s(((p=d.closest("[lang]"))==null?void 0:p.getAttribute("lang"))??"")});const c=e??n??r,{langOf:l}=Et(void 0,c);return{ref:i,hostLanguage:c,langOf:l}}const W=t=>Array.isArray(t)?t:t==null?[]:[t],cd=["left-to-right","right-to-left","top-to-bottom","bottom-to-top"];function ss(t){return cd.includes(t)?t:"left-to-right"}const ld=["individuals","paged","continuous","unordered"];function ud(t){return W(t).find(n=>ld.includes(n))??"individuals"}function dd(t,e){if(!t.length)return[];if(e==="continuous")return[t.map((a,c)=>c)];if(e!=="paged")return t.map((a,c)=>[c]);const n=[];let o=[],r=0,s=false;const i=()=>{o.length&&n.push(o),o=[]};return t.forEach((a,c)=>{const l=W(a.behavior);if(l.includes("non-paged")){c===r&&r++,i(),n.push([c]);return}if(c===r||l.includes("facing-pages")){o.length&&(s=true),i(),n.push([c]);return}if(o.push(c),s){i(),s=false;return}o.length>1&&i()}),i(),n}function fd(t,e){const n=t.findIndex(o=>o.includes(e));return n===-1?0:n}const cc=["Independents","Composite","List"];function Eo(t){return W(t==null?void 0:t.body).flatMap(e=>cc.includes(e==null?void 0:e.type)?W(e.items):[e])}function is(t){const e=W(t==null?void 0:t.motivation);return!e.length||e.includes("painting")}function lc(t,e){const n=/(?:^|[#&])t=([^&]+)/.exec(e),o=n&&{t:n[1]},r=/(?:^|[#&])xywh=(?:pixel:)?([^&]+)/.exec(e);if(r){const[s,i,a,c]=r[1].split(",").map(Number);if([s,i,a,c].every(Number.isFinite))return{id:t,rect:{x:s,y:i,w:a,h:c},...o}}return o&&{id:t,...o}}function ro(t){const e=t.indexOf("#");if(e>=0){const o=t.slice(0,e);return lc(o,t.slice(e))??{id:o}}const n=t.indexOf("&t=");return n>=0?{id:t.slice(0,n),t:t.slice(n+3)}:{id:t}}const Tr=t=>{var e;return Array.isArray(t)?Tr(t[0]):cc.includes(t==null?void 0:t.type)?Tr((e=t.items)==null?void 0:e[0]):t};function hn(t){return hd(Tr(t))}function hd(t){var n;if(typeof t=="string")return ro(t);if(!t||typeof t!="object")return{id:""};if(t.type!=="SpecificResource"||t.source===void 0)return ro(t.id??"");const e=typeof t.source=="string"?ro(t.source):ro(((n=t.source)==null?void 0:n.id)??"");for(const o of W(t.selector)){const r=o;if((r==null?void 0:r.type)==="PointSelector"){const[s,i,a]=[r.x,r.y,r.instant??r.t].map(Number),c=Number.isFinite(s)&&Number.isFinite(i);return{id:e.id,...c?{point:{x:s,y:i}}:{},...Number.isFinite(a)?{t:String(a)}:{}}}if((r==null?void 0:r.type)==="SvgSelector"&&r.value)return{id:e.id,svg:String(r.value)};if((r==null?void 0:r.type)==="FragmentSelector"&&r.value){const s=lc(e.id,String(r.value));if(s)return s}}return e}const Bn=t=>t==="Audio"||t==="Sound",pd=t=>{const e=W(t);return e.length>0&&e.every(n=>n==="supplementing")},md=(t,e)=>pd(t)&&!!(e.rect||e.svg||e.point)&&!e.t,xi=new WeakMap,gd={canvases:[],views:[],direction:"left-to-right"};function Bt(t){if(!t)return gd;let e=xi.get(t);if(!e){const n=(t.items??[]).filter(o=>(o==null?void 0:o.type)==="Canvas"||(o==null?void 0:o.type)==="Timeline"||(o==null?void 0:o.type)==="Scene");e={canvases:n,views:dd(n,ud(t.behavior)),direction:ss(t.viewingDirection)},xi.set(t,e)}return e}const Si=new WeakMap;function Ve(t,e){if(!e)return null;const n=Bt(t);let o=Si.get(n);if(!o){o=new Map;for(const r of n.canvases)o.has(r.id)||o.set(r.id,r);Si.set(n,o)}return o.get(e)??null}function $n(t,e){const{canvases:n,views:o}=Bt(t),r=n.findIndex(s=>s.id===e);return r===-1?0:fd(o,r)}const ki=new WeakMap,vd=[];function We(t,e){if(!t)return vd;const n=$n(t,e);let o=ki.get(t);o||ki.set(t,o=new Map);let r=o.get(n);if(!r){const s=Bt(t);r=(s.views[n]??[]).map(i=>s.canvases[i]),o.set(n,r)}return r}function yd(t,e){var s,i;const{canvases:n,views:o}=Bt(t),r=(s=o[e])==null?void 0:s[0];return r===void 0?null:((i=n[r])==null?void 0:i.id)??null}function bd(t){const e=t==null?void 0:t.start;if(!e)return null;const n=hn(e);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 Fe=(t,e)=>{const n=t==null?void 0:t.behavior;return Array.isArray(n)?n.includes(e):n===e},_d=t=>[(t==null?void 0:t.partOf)??[]].flat().find(e=>(e==null?void 0:e.id)&&e.type==="Collection");function wd(t,e,n,o){const r=t==null?void 0:t.items;if(!(r!=null&&r.length)||!n)return-1;const s=We(n,o),i=a=>{const c=r[a];return((c==null?void 0:c.manifestId)===n.id||(c==null?void 0:c.manifestAs)===n.id)&&(!c.canvasId||s.some(l=>l.id===c.canvasId))};return e!==null&&i(e)?e:r.findIndex((a,c)=>i(c))}function wt(t,e,n=", "){if(!t)return{text:""};if(typeof t=="string")return{text:t};const o=Object.keys(t).filter(a=>{var c;return(c=t[a])==null?void 0:c.length});if(!o.length)return{text:""};const r=ns(o,e),s=t[r];return{text:Array.isArray(s)?s.join(n):String(s),lang:r==="none"||r==="@none"?void 0:r}}const xd=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/;function Ln(t){const e=t==null?void 0:t.language,n=(Array.isArray(e)?e:[e]).filter(o=>typeof o=="string"&&xd.test(o));return n.length===1?n[0]:void 0}const Ue={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Sd=/^(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)$/,kd=/^(adlm|arab|hebr|nkoo|rohg|syrc|thaa)$/;function Cd(t){if(!t)return;const[e,...n]=t.toLowerCase().split(/[-_]/),o=n.find(r=>/^[a-z]{4}$/.test(r));return(o?kd.test(o):Sd.test(e))?"rtl":void 0}function dt(t){return t?{lang:t,dir:Cd(t)}:{}}function Ed({clover:t,language:e}){const{t:n,langOf:o}=Et(),[r,s]=H(null),i=R(n);return i.current=n,F(()=>{let a=null;return t.store.subscribe(()=>{const{manifest:c,canvasId:l,status:d}=t.store.get();if(d!=="ready"||l===a)return;const u=a===null;if(a=l,u)return;const p=Ve(c,l),h=wt(p==null?void 0:p.label,e),m=i.current("canvasPosition",{index:$n(c,l)+1,total:Bt(c).views.length});s({label:h.text,lang:h.lang,position:m})})},[t,e]),f("div",{className:"clover-announcer",role:"status","aria-live":"polite","aria-atomic":"true",style:Ue,children:[r!=null&&r.label?f(Ct,{children:[f("span",{...dt(r.lang),children:r.label}),","," "]}):null,r&&f("span",{...dt(o("canvasPosition")),children:r.position})]})}const Md=t=>(t==null?void 0:t.format)==="text/vtt"||typeof(t==null?void 0:t.id)=="string"&&/\.vtt(\?|$)/i.test(t.id);function Td(t){const e=[];let n=0;const o=(r,s)=>{var a;if(!r||Md(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")e.push({value:String(r.value??""),format:r.format,language:W(r.language)[0],...i});else if(r.type==="Image"&&r.id){const c=r.label??t.label;e.push({image:r.id,format:r.format,...c?{label:c}:{},...i})}else if(r.type==="Feature"){const c=((a=r.properties)==null?void 0:a.label)??t.label;c&&typeof c=="object"&&e.push({label:c,place:true,...i})}};for(const r of Eo(t))if((r==null?void 0:r.type)!=="Choice")o(r);else{const s=n++;for(const i of W(r.items))o(i,s)}return e}const as="content-search",Id="contents",dy=(t,e)=>`${t}#region-${e+1}`,Ld=t=>W(t==null?void 0:t.motivation).includes("linking");function uc(t,e,n){const o=[];for(const r of W(t==null?void 0:t.items)){const s=W(r==null?void 0:r.motivation);if(s.includes("painting"))continue;const i=Td(r);if(!i.length&&!Ld(r))continue;const a=hn(W(r.target)[0]),c=a.id||n;!c||!r.id||o.push({id:r.id,setId:e,canvasId:c,target:a,motivation:s,bodies:i,annotation:r})}return o}const Pd=t=>Bt(t).canvases.some(e=>W(e.items).some(n=>W(n==null?void 0:n.items).some(o=>W(o==null?void 0:o.body).some(r=>[r,...W(r==null?void 0:r.items)].some(s=>W(s==null?void 0:s.annotations).length>0)))));function Ad(t,e){for(const n of[t,e])if(n!=null&&n.label)return n.label;for(const n of[t,e]){const o=W(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 dc=t=>W(t==null?void 0:t.partOf).filter(e=>(e==null?void 0:e.id)&&/AnnotationCollection/.test(String((e==null?void 0:e.type)??(e==null?void 0:e["@type"])))),Ci=new WeakMap;function fc(t){var n;if(!t)return[];let e=Ci.get(t);if(!e){const o=new Map;for(const r of Bt(t).canvases)for(const s of W(r.annotations)){if(!Array.isArray(s==null?void 0:s.items))continue;const i=s.id??`${r.id}#annotations`;let a=o.get(i);if(!a){const c=(n=dc(s)[0])==null?void 0:n.id;a={id:i,label:Ad(s),source:"manifest",entries:[],...c?{collection:c}:{}},o.set(i,a)}a.entries.push(...uc(s,i,r.id))}e=[...o.values()].filter(r=>r.entries.length),Ci.set(t,e)}return e}const Ei=new WeakMap,hc=[];function fy(t){if(!t)return hc;let e=Ei.get(t);return e||(e=Bt(t).canvases.flatMap(n=>W(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)}))),Ei.set(t,e)),e}const tr=new WeakMap,er=new WeakMap;function pc(t,e=Od){var n;if(!er.has(e)){const o=e.filter(s=>s.content),r=(n=o[0])==null?void 0:n.content;er.set(e,r?{id:r.id,type:r.type,...r.label?{label:r.label}:{},pages:hc,entries:o.flatMap(s=>s.entries)}:null)}return er.get(e)??Nd(t)}const Od=[];function Nd(t){var r;if(!t)return null;if(tr.has(t))return tr.get(t);const e=Bt(t).canvases.flatMap(s=>W(s.annotations).flatMap(i=>dc(i).map(a=>({part:a,page:i,canvas:s})))),n=(r=e[0])==null?void 0:r.part.id,o=n?(()=>{var l,d;const s=e.filter(({part:u})=>u.id===n),i=(l=s.find(({part:u})=>u.label))==null?void 0:l.part.label,a=Number((d=s.find(({part:u})=>u.total))==null?void 0:d.part.total),c=fc(t);return{id:n,type:"AnnotationCollection",...i?{label:i}:{},...a>0?{total:a}:{},pages:s.map(({page:u,canvas:p})=>({id:String(u.id),canvasId:String(p.id),fetched:Array.isArray(u.items)})),entries:s.flatMap(({page:u})=>{var p;return((p=c.find(h=>h.id===u.id))==null?void 0:p.entries)??[]})}})():null;return tr.set(t,o),o}const Mi=new WeakMap,Ti=[];function cs(t,e){const n=fc(t);if(!e.length)return n.length?n:Ti;const o=t??Ti;let r=Mi.get(o);r||Mi.set(o,r=new Map);let s=r.get(e);if(!s){const i=new Set(n.map(a=>a.id));s=[...n,...e.filter(a=>!i.has(a.id)&&!!i.add(a.id))],r.set(e,s)}return s}const Ii=new WeakMap;function mc(t,e,n,o=null){const r=cs(t,e),s=n!=null&&n.entries.length?n:null;if(!o&&!s)return r;let i=Ii.get(r);i||Ii.set(r,i=new Map);let a=i.get(o);a||i.set(o,a=new Map);let c=a.get(s);return c||(c=[...r,...o?[o]:[],...s?[s]:[]],a.set(s,c)),c}const Rd=t=>Number(t==null?void 0:t.duration)>0;function gc(t,e){return t.source==="search"||!t.entries.length?false:t.entries.every(n=>md(n.motivation,n.target)&&!Rd(e(n.canvasId)))}const Li=new WeakMap;function Bd(t,e){const n=cs(t,e);let o=Li.get(n);if(!o){const r=n.filter(s=>!gc(s,i=>Ve(t,i)??void 0));o=r.length===n.length?n:r,Li.set(n,o)}return o}const Pi=new WeakMap;function ls(t,e,n,o){const r=cs(t,e),s=Pi.get(r);if(s&&s.hidden===n&&s.shown===o)return s.ids;const i=r.filter(c=>!n.includes(c.id)&&!o.includes(c.id)&&gc(c,l=>Ve(t,l)??void 0)).map(c=>c.id),a=i.length?[...n,...i]:n;return Pi.set(r,{hidden:n,shown:o,ids:a}),a}const Ai=new WeakMap,Oi=[as,Id];function $d(t,e,n,o,r){if(!r)return Oi;const s=ls(t,e,n,o),i=Ai.get(s);if(i&&i.hidden===n)return i.ids;const a=[...Oi,...s.filter(c=>!n.includes(c))];return Ai.set(s,{hidden:n,ids:a}),a}function Fd(t){for(const e of W(t==null?void 0:t.target)){const n=(e==null?void 0:e.type)==="SpecificResource"?e.source:e,o=W(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 nr(t,e){if(!e)return null;for(const n of t){const o=n.entries.find(r=>r.id===e);if(o)return o}return null}function vc(t){return btoa(encodeURIComponent(JSON.stringify(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function yc({manifestId:t,canvasId:e,type:n="Canvas",region:o,time:r}){const s={id:e,type:n,...t&&t!==e?{partOf:[{id:t,type:"Manifest"}]}:{}},i=r!=null&&r>0?`t=${Math.round(r*100)/100}`:o?`xywh=${[o.x,o.y,o.w,o.h].map(Math.round).join(",")}`:null,a={"@context":`http://iiif.io/api/presentation/${n==="Canvas"?3:4}/context.json`,id:`${e}#content-state`,type:"Annotation",motivation:["contentState"],target:i?{type:"SpecificResource",source:s,selector:{type:"FragmentSelector",value:i}}:s};return{json:a,encoded:vc(a)}}const Dd=Object.freeze(Object.defineProperty({__proto__:null,buildContentState:yc,encodeContentState:vc},Symbol.toStringTag,{value:"Module"})),zd=/iiif\.io\/api\/presentation\/4\/context\.json/;function bc(t){const e=t==null?void 0:t["@context"];return(Array.isArray(e)?e:[e]).some(o=>typeof o=="string"&&zd.test(o))}let Ni=null,Ri=null;function us(){return Ri??(Ri=import("../upgrade-eNW0DPXq.mjs")),Ni??(Ni=import("../upgrader-BlbMUEH6.mjs").then(({upgradePresentation3To4:t})=>t)),Promise.all([Ni,Ri])}async function je(t){if(bc(t))return t;const[e,{upgrade:n}]=await us();return await n(t,e)}function ds(t,e,n={}){return((t==null?void 0:t.fetch)??globalThis.fetch)(e,{credentials:(t==null?void 0:t.credentials)??"same-origin",...n,headers:{...n.headers,...t==null?void 0:t.headers}})}const Hd=t=>(t==null?void 0:t.credentials)==="include",Wd=t=>JSON.stringify([t==null?void 0:t.credentials,t==null?void 0:t.headers]);class Ud extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="CloverRequestError"}}async function un(t,e,n){const o=await ds(t,e,{signal:n,headers:{Accept:"application/ld+json, application/json"}});if(!o.ok)throw new Ud(`${e} answered ${o.status}`,e,o.status);return o.json()}const jd=()=>import("./content-state-reader-BTtuWgX0.mjs");function Vd(t){const e=t;return!e||typeof e!="object"?false:e.type==="Annotation"||e["@type"]==="oa:Annotation"||e.type==="SpecificResource"}const _c=t=>!!t&&typeof t=="object"&&/ImageService[123]|iiif\.io\/api\/image/.test(JSON.stringify(["@context","type","@type","protocol"].map(e=>t[e])));async function qd(t,e,n){try{return await un(t,e,n)}catch(o){if(n!=null&&n.aborted||/\.json([?#]|$)/i.test(e))throw o;try{const r=await un(t,`${e.replace(/\/+$/,"")}/info.json`,n);if(_c(r))return r}catch{}throw o}}const Kd=["summary","metadata","requiredStatement","rights","provider","homepage","seeAlso","rendering","thumbnail","navDate","partOf"];function Zd(t){const e={"@context":Xd,id:t.id,type:"Manifest",label:t.label??{none:[""]},items:[t]};for(const n of Kd)t[n]!==void 0&&n!=="label"&&(e[n]=t[n]);return e}const Bi=t=>{var e,n;return!!t&&((n=(e=t.items)==null?void 0:e[0])==null?void 0:n.id)===t.id},wc=t=>{var e,n;return!!t&&((e=t.items)==null?void 0:e.length)===1&&((n=t.items[0])==null?void 0:n.id)===`${t.id}/canvas`},Gd=/^(oa:)?Annotation(Page|Collection)$/;class or extends Error{constructor(){super(...arguments);L(this,"name","CloverContentError")}}const Xd="http://iiif.io/api/presentation/4/context.json",Yd=t=>/^https?:\/\//i.test(t);async function Ir(t,{request:e,signal:n}){return Array.isArray(t.items)&&t.items.length>0||!t.id?t:await un(e,t.id,n)}const Jd=50;async function fs(t,e){const n=t;if(Array.isArray(n.items)&&n.items.length||!n.first)return t;const o=[],r=new Set;let s=n.first;for(let i=0;s&&i<Jd;i++){const a=typeof s=="string"?{id:s}:s;if(r.has(a.id??a))break;r.add(a.id??a);const c=a.items?a:await un(e.request,a.id,e.signal),l=await je({"@context":c["@context"]??n["@context"],...c,type:"Collection"});o.push(...l.items??[]),s=c.next}return{...n,items:o}}async function xc(t,e={}){return je(await Ir(t,e))}async function Sc(t,e,n=0){for(const o of t.items??[]){if(o.type==="Manifest")return je(await Ir(o,e));if(o.type==="Collection"&&n<8){const r=await fs(await je(await Ir(o,e)),e),s=await Sc(r,e,n+1);if(s)return s}}return null}async function Qd(t,{request:e,signal:n}={}){us();const o=typeof t=="string"?await un(e,t.trim(),n):t,r=await je(o);return r.type==="Collection"?fs(r,{request:e,signal:n}):r}async function kc(t,e={}){var i;const{request:n,signal:o}=e;us();let r=t;if(typeof t=="string"&&(r=Yd(t.trim())?await qd(n,t.trim(),o):(await jd()).decodeContentState(t),!r))throw new or("Unreadable iiifContent");if(Vd(r)&&(e.follows??0)<2){const{follow:a}=await import("./follow-content-C6F0s_fJ.mjs");return a(r,e,kc)}if(Gd.test(String((r==null?void 0:r.type)??""))){const{annotationsContent:a}=await import("./annotations-content-ConN9zDA.mjs");return a(r,e)}if(_c(r)){const{imageServiceContent:a}=await import("./image-service-content-D_HLWst7.mjs");return a(r,typeof t=="string"?t.trim():void 0)}const s=await je(r);switch((i=o==null?void 0:o.throwIfAborted)==null||i.call(o),s.type){case"Manifest":return{manifest:s};case"Collection":{const a=await fs(s,e),c=e.manifestId,l=c?(a.items??[]).find(u=>u.id===c&&u.type==="Manifest"):void 0,d=l?await xc(l,e):await Sc(a,e);if(!d)throw new or("The Collection holds no Manifest");return{manifest:d,collection:a}}case"Canvas":case"Timeline":case"Scene":return{manifest:Zd(s),target:{canvasId:s.id}};default:throw new or(`Cannot show a ${String(s.type??"resource without a type")}`)}}const Cc=t=>!!(t!=null&&t.id)&&t.type==="AnnotationPage"&&!t.items;function $i(t){const e=[];for(const n of t)for(const o of["items","annotations"])for(const r of n[o]??[])Cc(r)&&e.push([n.id,o,r.id]);return e}async function tf(t,e,n,o){return ef(await un(n,t,o),e)}async function ef(t,e="urn:clover:annotation-page"){var r;const n=t;return bc(n)?n:((r=(await je({"@context":n["@context"]??"http://iiif.io/api/presentation/3/context.json",id:e,type:"Canvas",items:[{...n,"@context":void 0}]})).items)==null?void 0:r[0])??n}function nf(t,e){const n=t,o=e,r=c=>Array.isArray(c)?c:c?[c]:[],s=r(n.partOf),i=r(o.partOf),a=[...s.map(c=>({...i.find(l=>l.id&&l.id===c.id),...c})),...i.filter(c=>!s.some(l=>l.id===c.id))];return{...t,...n.label===void 0&&o.label!==void 0&&{label:o.label},...a.length&&{partOf:a}}}function of(t,e,n,o){let r=false;const s=(t.items??[]).map(i=>{if(i.id!==e||!Array.isArray(i[n]))return i;const a=i[n].map(c=>c.id!==o.id||!Cc(c)?c:(r=true,nf(o,c)));return r?{...i,[n]:a}:i});return r?{...t,items:s}:t}const Fi=/\/search\/([0-2])\//;function hs(t){if(!t)return null;let e=null;for(const n of W(t.service)){const o=(n==null?void 0:n.id)??(n==null?void 0:n["@id"]);if(typeof o!="string")continue;const r=String(n.type??n["@type"]??""),s=[n.profile,n["@context"]].flat().map(a=>String(a??"")).join(" "),i=r==="SearchService2"?2:r==="SearchService1"?1:Fi.test(s)?Number(Fi.exec(s)[1])>=2?2:1:null;if(i===2)return{id:o,version:i};i===1&&(e??(e={id:o,version:i}))}return e}function rf(t){let e=t;const n=new Set;return{get:()=>e,set(o){const r=typeof o=="function"?o(e):o;Object.keys(r).some(i=>!Object.is(r[i],e[i]))&&(e={...e,...r},n.forEach(i=>i()))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function en(t){let e=t;const n=new Set;return{get:()=>e,emit(o){e=o,n.forEach(r=>r(o))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function sf(t,e,n){return{position:e,total:n,hasPrevious:e>0,hasNext:e+1<n,previous:()=>t.previous(),next:()=>t.next(),first:()=>t.first(),last:()=>t.last(),goTo:o=>t.goTo(o)}}const Lr={query:"",status:"idle",hits:[],set:null},Di={status:"idle",error:null,manifest:null,collection:null,throughCollection:false,canvasId:null,target:null,annotationId:null,hiddenSets:[],shownSets:[],addedSets:[],search:Lr,regions:null,targets:null,targetIndex:null};function af(t={}){const e=rf(Di),n=en(null),o=en(null),r=en(null),s=en(null),i=en(null),a=en(null);let c=null,l=null,d=[],u=[],p=[],h=0,m=null,g=null,_=null;const w=(b,I)=>{!g||b===I||(g={...g,items:g.items.map(P=>P.manifestId===b&&P.manifestAs!==I?{...P,manifestAs:I}:P)})},S=b=>{var P;const I=(P=e.get().manifest)==null?void 0:P.id;return!!I&&(I===b.manifestId||I===b.manifestAs)},v=()=>d.length||u.length||p.length?[...d,...u,...p]:Di.addedSets;let y=t.request,x=null;const k=new Set;let N="view",D=0;const j=(b,I,P)=>{if(k.has(P))return;k.add(P);const A=x==null?void 0:x.signal;tf(P,b,y,A).then(B=>{A!=null&&A.aborted||e.set(Z=>Z.manifest?{manifest:of(Z.manifest,b,I,B)}:{})}).catch(()=>k.delete(P))},et=()=>{const{manifest:b,canvasId:I}=e.get();if(b)for(const[P,A,B]of $i(N==="all"||D>0?Bt(b).canvases:We(b,I)))j(P,A,B)};e.subscribe(et);const V=(b,I,P,A,B)=>{var zt,Ht,gt;const{canvases:Z}=Bt(b),E=q=>!!q&&Z.some(ot=>ot.id===q),z=bd(b),K=E(P==null?void 0:P.canvasId)?P:E(z==null?void 0:z.canvasId)?z:null,G=E(A.canvasId)?A.canvasId:(K==null?void 0:K.canvasId)??(E(A.defaultCanvasId)?A.defaultCanvasId:null)??((zt=Z[0])==null?void 0:zt.id)??null;l==null||l.abort();const ht=B&&((Ht=nr(p,B))==null?void 0:Ht.canvasId)===G?B:null,ft=K&&ht?{...K,region:void 0}:K,Rt=++h;d=[],e.set({status:"ready",search:Lr,regions:null,manifest:b,collection:I,canvasId:G,target:ft&&ft.canvasId===G?ft:null,addedSets:v(),annotationId:ht,targets:g});const At=b==null?void 0:b.structures;Array.isArray(At)&&JSON.stringify(At).includes("xywh=")&&import("./range-regions-C_AleS_r.mjs").then(({contentsSet:q})=>{h===Rt&&e.set({regions:q(b)})}),Pd(b)&&import("./image-layers-D7_YIZD2.mjs").then(({imageLayers:q})=>{h===Rt&&(d=q(b),e.set({addedSets:v()}))}),G&&G!==A.canvasId&&((gt=t.onCanvasChange)==null||gt.call(t,G))},nt=(b,I)=>e.set(P=>{const A=P.hiddenSets.filter(Z=>Z!==b),B=P.shownSets.filter(Z=>Z!==b);return I?{hiddenSets:A,shownSets:[...B,b]}:{hiddenSets:[...A,b],shownSets:B}}),Y=(b,I)=>{var A,B,Z;if(!b)return;if((A=t.isControlled)!=null&&A.call(t)){I&&e.set({target:I}),(B=t.onCanvasChange)==null||B.call(t,b);return}const P=e.get().canvasId!==b;e.set({canvasId:b,target:I}),P&&((Z=t.onCanvasChange)==null||Z.call(t,b))},J=(b,I=false)=>{const{manifest:P}=e.get(),A=yd(P,b);Y(A,A&&I?{canvasId:A,autoplay:I}:null)},M=()=>{const{manifest:b,canvasId:I}=e.get();return{at:$n(b,I),total:Bt(b).views.length}},T=()=>{x==null||x.abort();const b=new AbortController;return x=b,k.clear(),e.set({status:"loading",error:null,annotationId:null}),b.signal},O=b=>e.set({status:"error",error:b instanceof Error?b:new Error(String(b))});async function U(b,I={}){var A;const P=T();try{const B=await kc(b,{request:y,signal:P,manifestId:I.manifestId??void 0});if(P.aborted)return;const Z=B.annotation,E=Z?uc({items:[Z]},`${Z.id}#content-state`):[];p=E.length?[{id:`${Z.id}#content-state`,source:"added",entries:E}]:B.annotationSets??[];const z=m??((A=E[0])==null?void 0:A.id)??B.pick;m=null,e.set({throughCollection:!!B.collection}),g=B.targets??null,g&&w(g.items[0].manifestId,B.manifest.id),e.set({targetIndex:g?0:null}),V(B.manifest,B.collection??null,B.target,I,z)}catch(B){P.aborted||O(B)}}const Q=b=>{const{manifest:I,collection:P}=e.get();return(I==null?void 0:I.id)===b||(P==null?void 0:P.id)===b},at=b=>{var I;return(((I=e.get().collection)==null?void 0:I.items)??[]).find(P=>P.id===b)??{id:b,type:"Manifest"}},ct=(b,I)=>{var P,A;if(m=I,(P=t.isManifestControlled)!=null&&P.call(t)){(A=t.onManifestChange)==null||A.call(t,b);return}mt({id:b,type:"Manifest"}).then(B=>{var Z;return B&&((Z=t.onManifestChange)==null?void 0:Z.call(t,b))})},mt=async(b,I)=>{if(b.type==="Collection")return await U(b.id),e.get().status==="ready";const{collection:P}=e.get(),A=T(),B=m;m=null;const Z=B?nr(p,B):null,E=typeof I=="string"?{canvasId:I}:I??_;_=null;try{const z=await xc(b,{request:y,signal:A});return A.aborted?false:(w(b.id,z.id),V(z,P,Z?{canvasId:Z.canvasId}:E??void 0,{},B),true)}catch(z){return A.aborted||O(z),false}};return{store:e,viewport:n,media:o,captions:r,highlight:s,chapter:i,found:a,get request(){return y},setRequest(b){y=b},load:U,async openCollection(b){var P;const I=e.get().manifest;if(!(!I||((P=e.get().collection)==null?void 0:P.id)===b))try{const A=await Qd(b,{request:y});if(A.type!=="Collection"||e.get().manifest!==I)return;e.set({collection:A})}catch{}},async goToManifest(b,I){var A,B,Z;if(Q(b))return;const P=at(b);if(P.type!=="Collection"&&((A=t.isManifestControlled)!=null&&A.call(t))){(B=t.onManifestChange)==null||B.call(t,b);return}await mt(P,I)&&((Z=t.onManifestChange)==null||Z.call(t,e.get().manifest.id))},goToTarget(b){var A,B,Z;const I=(A=e.get().targets)==null?void 0:A.items[b];if(!I)return;e.set({targetIndex:b});const P=I.canvasId?{canvasId:I.canvasId,...I.region&&{region:I.region},...I.time!==void 0&&{time:I.time}}:null;if(S(I)){P&&Y(P.canvasId,P);return}if((B=t.isManifestControlled)!=null&&B.call(t)){_=P,(Z=t.onManifestChange)==null||Z.call(t,I.manifestId);return}mt(at(I.manifestId),P??void 0).then(E=>{var z;return E&&((z=t.onManifestChange)==null?void 0:z.call(t,I.manifestId))})},async syncManifest(b){!b||Q(b)||e.get().status!=="ready"||await mt(at(b))},goTo(b,I){Y(b,I?{...I,canvasId:b}:null)},next({autoplay:b=false,wrap:I=false}={}){const{at:P,total:A}=M();P+1<A?J(P+1,b):I&&A>1&&J(0,b)},previous(){const{at:b}=M();b>0&&J(b-1)},first(){J(0)},last(){J(M().total-1)},consumeTarget(){e.set({target:null})},syncCanvas(b){b&&e.set({canvasId:b})},selectAnnotation(b){const{manifest:I,addedSets:P,canvasId:A,search:B,regions:Z}=e.get(),E=nr(mc(I,P,B.set,Z),b);if(e.set({annotationId:E?b:null}),!E)return;a.emit(b);const{hiddenSets:z,shownSets:K}=e.get();E.setId!==as&&ls(I,P,z,K).includes(E.setId)&&nt(E.setId,true);const G=We(I,A).some(Rt=>Rt.id===E.canvasId),ht=Ve(I,E.canvasId)!==null;!G&&ht&&Y(E.canvasId,null);const ft=ht?void 0:Fd(E.annotation);ft&&ct(ft,E.id)},async search(b){l==null||l.abort();const I=hs(e.get().manifest),P=b.trim();if(!P||!I){l=null,e.set({search:Lr,annotationId:null});return}const A=new AbortController;l=A,e.set(B=>({search:{...B.search,query:P,status:"loading"}}));try{const{searchInto:B}=await import("./search-DwsVuur9.mjs");await B(e,I,P,y,A.signal)}catch{e.set({search:{query:P,status:"error",hits:[],set:null}})}},setSetVisible(b,I){nt(b,I)},async loadAnnotations(b){if(c==null||c.abort(),!b){u=[],e.set({addedSets:v()});return}const I=new AbortController;c=I;try{const{loadAnnotationSets:P}=await import("./annotation-collection-C2MWEnuY.mjs"),A=await P(b,{request:y,signal:I.signal});if(I.signal.aborted)return;u=A,e.set({addedSets:v()})}catch{}},getContentState(){var G;const{manifest:b,canvasId:I}=e.get();if(!b||!I)return null;const P=n.get(),A=o.get(),B=A&&A.currentTime>0?A.currentTime:null,Z=We(b,I),z=P&&Z.some(ht=>ht.id===P.canvasId)&&!B?P:null,K=(z==null?void 0:z.canvasId)??I;return yc({manifestId:b.id,canvasId:K,type:(G=Z.find(ht=>ht.id===K))==null?void 0:G.type,region:z==null?void 0:z.region,time:B})},setAnnotationPages(b){b!==N&&(N=b,et())},fetchAnnotationPages(b){const{manifest:I}=e.get();if(!I||!b.length)return;const P=new Set(b);for(const[A,B,Z]of $i(Bt(I).canvases))P.has(Z)&&j(A,B,Z)},holdAllAnnotationPages(){D++,et();let b=true;return()=>{b&&D--,b=false}},dispose(){x==null||x.abort(),c==null||c.abort(),l==null||l.abort()}}}const cf=100;function Ec(t,e){const n=R({read:t,onChange:e});n.current={read:t,onChange:e};const o=R(void 0),r=R("");return F(()=>()=>{clearTimeout(o.current),o.current=void 0},[]),ut(()=>{!n.current.onChange||o.current!==void 0||(o.current=setTimeout(()=>{var i,a;o.current=void 0;const s=n.current.read();!s||s.encoded===r.current||(r.current=s.encoded,(a=(i=n.current).onChange)==null||a.call(i,s))},cf))},[])}function Pr(t,e){return t==null||t.addEventListener("pause",e),t==null||t.addEventListener("seeked",e),()=>{t==null||t.removeEventListener("pause",e),t==null||t.removeEventListener("seeked",e)}}function Mc(t,e){const n=Ec(()=>t.getContentState(),e),o=!!e;F(()=>{if(!o)return;let r=t.store.get().canvasId;const s=t.store.subscribe(()=>{const l=t.store.get().canvasId;l!==r&&(r=l,n())}),i=t.viewport.subscribe(n);let a=Pr(t.media.get(),n);const c=t.media.subscribe(l=>{a(),a=Pr(l,n)});return n(),()=>{s(),i(),c(),a()}},[t,o,n])}function ps(t){const e=[];for(const n of W(t==null?void 0:t.items))for(const o of W(n==null?void 0:n.items))if(is(o))for(let r of Eo(o))(r==null?void 0:r.type)==="Choice"&&(r=W(r.items)[0]),(r==null?void 0:r.type)==="SpecificResource"&&(r=typeof r.source=="string"?{id:r.source}:r.source),r&&e.push({body:r,annotation:o});return e}function lf(t){return t.flatMap(e=>ps(e).map(({body:n})=>n))}function uf(t,e){if(!(t!=null&&t.length)||!e.canvases.length)return null;const n=e.canvases.map(r=>r.id),o=e.bodies.map(r=>r==null?void 0:r.format).filter(Boolean);return t.find(r=>{var s,i,a;return((s=r.canvasId)==null?void 0:s.some(c=>n.includes(c)))||((i=r.format)==null?void 0:i.some(c=>o.includes(c)))||!!((a=r.match)!=null&&a.call(r,e))})??null}function df(t,e){return t===e?true:!t||!e||t.length!==e.length?false:t.every((n,o)=>n.component===e[o].component&&n.match===e[o].match&&JSON.stringify([n.canvasId,n.format])===JSON.stringify([e[o].canvasId,e[o].format]))}function ff({iiifContent:t,canvasId:e,defaultCanvasId:n,onCanvasChange:o,onStatusChange:r,manifestId:s,defaultManifestId:i,onManifestChange:a,searchQuery:c,request:l,language:d,renderers:u,annotations:p,annotationPages:h="view",onContentStateChange:m,...g}){const _=e!==void 0,w=s!==void 0,S=R({controlled:_,manifestControlled:w,onCanvasChange:o,onStatusChange:r,onManifestChange:a});S.current={controlled:_,manifestControlled:w,onCanvasChange:o,onStatusChange:r,onManifestChange:a};const[v]=H(()=>af({request:l,onCanvasChange:z=>{var K,G;return(G=(K=S.current).onCanvasChange)==null?void 0:G.call(K,z)},onManifestChange:z=>{var K,G;return(G=(K=S.current).onManifestChange)==null?void 0:G.call(K,z)},isControlled:()=>S.current.controlled,isManifestControlled:()=>S.current.manifestControlled}));v.setRequest(l);const y=R({});y.current={canvasId:e,defaultCanvasId:n,manifestId:s??i};const x=Wd(l),k=R(t);k.current=t;const N=mf(t);F(()=>(v.load(k.current,y.current),()=>v.dispose()),[v,N,x]),F(()=>{_&&v.syncCanvas(e??null)},[v,_,e]);const[D,j]=H(v.store.get().status);F(()=>{let z=v.store.get().status;return v.store.subscribe(()=>{var ht,ft;const{status:K,error:G}=v.store.get();K!==z&&(z=K,j(K),(ft=(ht=S.current).onStatusChange)==null||ft.call(ht,K,G))})},[v]);const et=R(p);et.current=p;const V=pf(p);F(()=>{v.loadAnnotations(et.current??null)},[v,V,x]),F(()=>{v.setAnnotationPages(h)},[v,h]),Mc(v,m),F(()=>{w&&D==="ready"&&v.syncManifest(s??null)},[v,w,s,D]);const nt=hf(v,z=>{var K;return z.status==="ready"?((K=z.manifest)==null?void 0:K.id)??null:null});F(()=>{c&&nt&&v.search(c)},[v,c,nt]);const Y=R(u);df(Y.current,u)||(Y.current=u);const J=Y.current,[M,T]=H(),[O,U]=H(d);O!==d&&(U(d),T(void 0));const Q=R(void 0),[at,ct]=H(N);at!==N&&(ct(N),T(void 0)),F(()=>()=>{const z=Q.current;Q.current=void 0,z&&Tt.chosenLanguage===z&&Tt.chooseInterfaceLanguage()},[N]);const mt=ee(Tt.subscribe,()=>Tt.chosenLanguage),b=M??d??mt,I=ut(z=>{T(z);const K=Tt.stringsFor(z);Q.current=K,K&&Tt.chooseInterfaceLanguage(K)},[]),[P,A]=H(0),B=ut(()=>(A(z=>z+1),()=>A(z=>z-1)),[]),Z=P>0;return[bt(()=>({clover:v,language:b,renderers:J,chooseLanguage:I,toggleDrawn:Z,drawsToggle:B}),[v,b,J,I,Z,B]),D,g]}function hf(t,e){return ee(t.store.subscribe,()=>e(t.store.get()))}function pf(t){const e=Array.isArray(t)?t:t?[t]:[];return JSON.stringify(e.map(n=>typeof n=="string"?n:(n==null?void 0:n.id)??"object"))}function mf(t){return typeof t=="string"?t:t.id??t["@id"]??t}const gf=ie(function({as:e="div",className:n,children:o,highContrast:r,...s},i){const[a,c,l]=ff(s),d=Co(i,l.lang),u=Jr(r);return f(xo.Provider,{value:a,children:f(Nn.Provider,{value:d.hostLanguage,children:f(e,{ref:d.ref,className:It("clover-root",n),"data-status":c,...Qr(u),...l,children:[o,f(Ed,{clover:a.clover,language:a.language})]})})})}),vf=()=>f("path",{fillRule:"evenodd",stroke:"none",d:"M144 72H368A96 96 0 0 1 464 168V296A96 96 0 0 1 368 392H200L104 460L144 392A96 96 0 0 1 48 296V168A96 96 0 0 1 144 72Z M168 184H344A16 16 0 0 1 344 216H168A16 16 0 0 1 168 184Z M168 264H280A16 16 0 0 1 280 296H168A16 16 0 0 1 168 264Z"}),yf=()=>f(Ct,{children:[f("path",{d:"M160 144h288M160 256h288M160 368h288",fill:"none",strokeLinecap:"round",strokeWidth:"32"}),f("circle",{cx:"80",cy:"144",r:"20",stroke:"none"}),f("circle",{cx:"80",cy:"256",r:"20",stroke:"none"}),f("circle",{cx:"80",cy:"368",r:"20",stroke:"none"})]}),bf=()=>f("path",{stroke:"none",d:"M256 72A48 48 0 1 1 256 168A48 48 0 1 1 256 72Z M192 216H296V384H328V432H184V384H216V264H192Z"}),_f=()=>f("path",{fillRule:"evenodd",stroke:"none",d:"M256 40C166 40 100 108 100 196C100 300 216 420 246 452A14 14 0 0 0 266 452C296 420 412 300 412 196C412 108 346 40 256 40Z M256 136A60 60 0 1 1 256 256A60 60 0 1 1 256 136Z"}),hy=()=>f("path",{strokeLinejoin:"round",strokeWidth:"40",d:"M184 128V384L392 256Z"}),Tc=()=>f("path",{strokeLinecap:"round",strokeWidth:"45",d:"M154 154L358 358M358 154L154 358"}),py=()=>f(Ct,{children:[f("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),f("path",{stroke:"none",d:"m279.5,197.76h-3.35s-28.47,0-28.47,0v-31.82c-.77-13.79-12.57-24.33-26.36-23.56-12.71.71-22.85,10.86-23.56,23.56v3.35h0v28.47h-31.82c-13.79.77-24.33,12.57-23.56,26.36.71,12.71,10.86,22.85,23.56,23.56h3.35s28.47,0,28.47,0v31.82c.77,13.79,12.57,24.33,26.36,23.56,12.71-.71,22.85-10.86,23.56-23.56v-3.35h0v-28.47h31.82c13.79-.77,24.33-12.57,23.56-26.36-.71-12.71-10.86-22.85-23.56-23.56Z"})]}),my=()=>f(Ct,{children:[f("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),f("path",{stroke:"none",d:"M167.26 197.76H278.1a24.96 24.96 0 0 1 0 49.92H167.26a24.96 24.96 0 0 1 0-49.92Z"})]}),te={zoomIn:{keys:"Plus",glyph:"+"},zoomOut:{keys:"-",glyph:"\u2212"},reset:{keys:"0",glyph:"0"},rotateRight:{keys:"R",glyph:"R"},rotateLeft:{keys:"Shift+R",glyph:"\u21E7R"},play:{keys:"K Space",glyph:"K"},mute:{keys:"M",glyph:"M"}},wf=new Set(["+","=","-","_","0","r","R","k","K","m","M","j","J","l","L"]);function qe({label:t,lang:e,shortcut:n,scrolls:o=false,image:r,lead:s,after:i}){const{t:a}=Et(),c=R(null),l=n?a("controlShortcut",{label:t,shortcut:n.glyph}):t;return Sf(),F(()=>{const d=c.current;d&&Ar(d)&&ho(d)},[l,s]),f("span",{ref:c,className:"clover-tip","aria-hidden":"true",...dt(e),...o&&{tabIndex:-1,onMouseDown:d=>{var u;d.preventDefault(),(u=d.currentTarget.parentElement)==null||u.focus({preventScroll:true})}},children:[r&&f("img",{className:"clover-tip-image",src:r,alt:"",loading:"lazy",onLoad:()=>{const d=c.current;d&&Ar(d)&&ho(d)}}),s&&f("span",{className:"clover-tip-lead",children:s}),l,i!=null&&i!==false&&f("span",{className:"clover-tip-after",children:i})]})}function so(t){const e=t.target instanceof Element&&ms(t.target),n=e&&Mo(e);n&&ho(n)}function gy(t){const e=Mo(ms(t));e&&Ar(e)&&ho(e)}function Mo(t){return Array.from(t.children).find(e=>e.classList.contains("clover-tip"))}function ms(t){const e=t.matches("input")?t.parentElement:null;return e&&Mo(e)?e:t}function Ar(t){var e;try{return!!((e=t.parentElement)!=null&&e.matches(":hover, :focus-visible, :has(> input:focus-visible)"))}catch{return false}}function ho(t){const e=t.parentElement;if(!e)return;t.style.removeProperty("--clover-tip-room"),t.style.removeProperty("--clover-tip-shift");const n=xf(e),o=parseFloat(getComputedStyle(t).paddingLeft)||0,r=n.left+o,s=n.right-o,i=e.getBoundingClientRect();let a=t.getBoundingClientRect();const c=a.right<=i.left?a.right-r:a.left>=i.right?s-a.left:s-r;a.width>c&&(t.style.setProperty("--clover-tip-room",`${Math.max(c,0)}px`),a=t.getBoundingClientRect());const l=a.left<r?r-a.left:a.right>s?s-a.right:0;l&&t.style.setProperty("--clover-tip-shift",`${l}px`)}function xf(t){let e=0,n=document.documentElement.clientWidth||window.innerWidth;for(let o=t.parentElement;o&&o!==document.documentElement;o=o.parentElement){const{display:r,overflow:s,overflowX:i}=getComputedStyle(o);if(r==="inline"||r==="contents")continue;const a=i||s;if(!a||a==="visible")continue;const c=o.getBoundingClientRect();e=Math.max(e,c.left+o.clientLeft),n=Math.min(n,c.left+o.clientLeft+o.clientWidth)}return{left:e,right:n}}let zi=0;function Hi(t){if(t.key!=="Escape"||t.defaultPrevented)return;const e=new Set;document.querySelectorAll(":hover > .clover-tip").forEach(r=>r.parentElement&&e.add(r.parentElement));const n=document.activeElement,o=n&&ms(n);o&&Mo(o)&&e.add(o),e.forEach(r=>Ic(r,"tipHidden",["pointerenter","focusout"]))}function Ic(t,e,n){t.dataset[e]="";const o=()=>{delete t.dataset[e],n.forEach(r=>t.removeEventListener(r,o))};n.forEach(r=>t.addEventListener(r,o))}function Sf(){F(()=>(zi++===0&&(document.addEventListener("keydown",Hi,true),document.addEventListener("pointerenter",so,true),document.addEventListener("focus",so,true)),()=>{--zi||(document.removeEventListener("keydown",Hi,true),document.removeEventListener("pointerenter",so,true),document.removeEventListener("focus",so,true))}),[])}function kf(t,e){const n=t.target;!e||n===e||e.contains(n)&&!n.closest(".clover-canvas-overlays")||wf.has(t.key)&&(t.altKey||t.metaKey||t.ctrlKey||n.closest("input, select, textarea, [contenteditable]")||(t.preventDefault(),e.dispatchEvent(new KeyboardEvent("keydown",{key:t.key,shiftKey:t.shiftKey,bubbles:true,cancelable:true}))))}const He=({className:t,id:e,label:n,children:o,onClick:r,expanded:s,controls:i,shortcut:a,lang:c,unavailable:l,side:d})=>{const p=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return f("button",{id:e,className:It("clover-canvas-button",t),"data-testid":"clover-canvas-button","data-button":p,"data-side":d,onClick:r,"aria-disabled":l||void 0,"aria-expanded":s,"aria-controls":i,"aria-label":n,"aria-keyshortcuts":a==null?void 0:a.keys,...dt(c),type:"button",children:[f("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:o}),f(qe,{label:n,shortcut:a})]})},Cf=he("");function pe(){return jt(Cf)+Gr()}const rr=new Map;function Ef(t,e){const n=pe(),o=R(e);o.current=e,F(()=>t?Mf(n,o):void 0,[t,n])}function Mf(t,e){for(const[n,o]of[...rr])n!==t&&o.current();return rr.set(t,e),()=>{rr.delete(t)}}const Tf=vt(()=>import("./CaptionDetails-CJisf1i_.mjs"));function If(t){var e;return!!t.summary||!!((e=t.metadata)!=null&&e.length)}const Lc=(t,e)=>`${t}-label-${e}`,Lf=({id:t,canvases:e,comments:n,open:o,onClose:r,language:s})=>{const{t:i,langOf:a}=Et(),c=R(null),[l,d]=H(o);return o&&!l&&d(true),Ef(o,()=>r(false)),F(()=>{var u;o&&((u=c.current)==null||u.focus())},[o]),f("figcaption",{className:"clover-canvas-caption","data-open":o,"data-testid":"clover-canvas-caption",id:t,onKeyDown:u=>{u.key!=="Escape"||u.defaultPrevented||(u.preventDefault(),u.stopPropagation(),r(true))},ref:c,tabIndex:-1,children:[f(He,{className:"clover-canvas-caption-close",id:`close-${t}`,label:i("commonClose"),lang:a("commonClose"),onClick:()=>r(true),children:f(Tc,{})}),e.map((u,p)=>{const h=wt(u.label,s);return f("section",{className:"clover-canvas-caption-canvas",children:[h.text&&f("p",{className:"clover-canvas-caption-label",id:Lc(t,p),...dt(h.lang),children:h.text}),l&&f(St,{fallback:null,children:f(Tf,{summary:u.summary,metadata:u.metadata,comments:n==null?void 0:n.get(u.id),language:s})})]},u.id)})]})},Pf=()=>f("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M256 112v288M400 256H112"}),Af=()=>f("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 256H112"}),Of=()=>f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"}),Nf=()=>f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M304 416v-112h112M405.77 405.77L304 304M208 96v112H96M106.23 106.23L208 208M416 208H304V96M405.77 106.23L304 208M96 304h112v112M106.23 405.77L208 304"}),Rf=()=>f("path",{d:"M448 440a16 16 0 01-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 01-27 11.57l-176-168a16 16 0 010-23.14l176-168A16 16 0 01256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 01-16 16z"}),Wi=()=>f(Ct,{children:[f("path",{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"}),f("path",{d:"M464 97.42V208a16 16 0 01-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"})]}),Bf=()=>f(Ct,{children:[f("path",{fill:"none",strokeLinecap:"round",strokeWidth:"64",d:"M112 144h0M112 256h0M112 368h0"}),f("path",{fill:"none",strokeLinecap:"round",strokeWidth:"40",d:"M208 144h208M208 256h208M208 368h208"})]}),$f=({children:t,label:e})=>f("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512",fill:"currentColor",stroke:"currentColor",focusable:"false","aria-hidden":"true",role:"presentation","data-testid":"clover-canvas-button-svg","data-label":e,children:t}),Ff=112,Df=128;function zf(t){Ut(()=>{const e=t==null?void 0:t.closest(".clover-canvas");if(!t||!e)return;const n=(s=false)=>{let i=t.offsetWidth,a=0;for(const h of s?[]:Array.from(t.children))!(h instanceof HTMLElement)||!h.offsetParent||(i=Math.min(i,h.offsetLeft),a=Math.max(a,h.offsetTop+h.offsetHeight));const c={width:t.offsetWidth-i,height:a};for(const[h,m]of Object.entries(c)){const g=`--clover-canvas-controls-${h}`;a?e.style.setProperty(g,`${m}px`):e.style.removeProperty(g)}const l=t.offsetTop,d=e.querySelector(":scope > .clover-canvas-media > .clover-canvas-transport"),u=e.clientHeight-2*l-c.height-((d==null?void 0:d.offsetHeight)??0),p=t.offsetLeft+i-l;a&&u<Ff&&p>=Df?e.dataset.popups="beside":delete e.dataset.popups};n();const o=new ResizeObserver(()=>n());o.observe(t),o.observe(e);const r=new MutationObserver(()=>n());return r.observe(t,{childList:true}),r.observe(e,{childList:true}),()=>{o.disconnect(),r.disconnect(),n(true)}},[t])}const To=()=>{if(typeof document>"u")return null;const t=document;return t.fullscreenElement??t.webkitFullscreenElement??null},Pc=()=>{if(typeof document>"u")return false;const t=document;return!!(t.fullscreenEnabled??t.webkitFullscreenEnabled)},Ac=t=>{const e=t==null?void 0:t.closest(".clover-root"),n=t==null?void 0:t.closest("dialog");return e&&!(n&&e.contains(n))?e:(t==null?void 0:t.closest(".clover-canvas"))??null},Hf=(t,e)=>{if(typeof t.webkitEnterFullscreen!="function")return;const n=e.closest(".clover-canvas"),o=!t.isConnected&&!!n;if(o&&n){const s=t.getAttribute("style");t.style.cssText="position:absolute;inset:0;z-index:-1;width:100%;height:100%;object-fit:contain;pointer-events:none",n.prepend(t),t.addEventListener("webkitendfullscreen",()=>{t.remove(),s===null?t.removeAttribute("style"):t.setAttribute("style",s)},{once:true})}const r=()=>{var s;try{(s=t.webkitEnterFullscreen)==null||s.call(t)}catch{}};o?requestAnimationFrame(r):r()},Oc=async(t,e)=>{var o,r,s,i;const n=Ac(t);if(n)try{if(To()){const c=document;await(((o=c.exitFullscreen)==null?void 0:o.call(c))??((r=c.webkitExitFullscreen)==null?void 0:r.call(c)));return}if(!Pc()){e&&t&&Hf(e,t);return}const a=n;await(((s=a.requestFullscreen)==null?void 0:s.call(a))??((i=a.webkitRequestFullscreen)==null?void 0:i.call(a)))}catch{}};function gs(t){const[e,n]=H(false);return F(()=>{if(!t)return;const o=()=>{var r;return n(!!((r=To())!=null&&r.contains(t)))};return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}function Wf({key:t,id:e,label:n,glyph:o,onClick:r,expanded:s,controls:i,shortcut:a,lang:c,unavailable:l},d){const u=d==null?void 0:d[t];return u?f(u,{buttonProps:{id:e,type:"button","aria-label":n,...c&&{lang:c},...a&&{"aria-keyshortcuts":a.keys},onClick:l?void 0:r,...l&&{"aria-disabled":true},...s!==void 0&&{"aria-expanded":s,"aria-controls":i}},icon:f($f,{label:n,children:o}),label:n,tip:f(qe,{label:n,shortcut:a})},t):f(He,{id:e,label:n,onClick:l?void 0:r,unavailable:l,expanded:s,controls:i,shortcut:a,lang:c,children:o},t)}const Uf=({fit:t=false,clusterRef:e,children:n})=>{const[o,r]=H(null),s=gs(o);zf(o);const i=ut(a=>{r(a),e==null||e(a)},[e]);return f("div",{className:"clover-canvas-controls","data-fit":t||void 0,"data-fullscreen":s,"data-testid":"clover-canvas-controls",ref:i,children:n})},jf=()=>()=>{};function Vf(){return ee(jf,Pc)}const Ui=new WeakMap;function on(t,e){const[n,o]=H(()=>Ui.get(t)??null);return F(()=>{if(!e||n)return;let r=true;return t().then(s=>{Ui.set(t,s),r&&o(()=>s)},()=>{}),()=>{r=false}},[t,e,n]),n}function qf(t,e,n){return t.reduce((o,r)=>o+r+n,-n)<=e}function Kf(t,e,n){const o=t.ownerDocument,r=i=>i instanceof HTMLElement&&t.contains(i)&&!i.closest("[hidden]"),s=[o.getElementById(e),o.getElementById(n),...Array.from(t.querySelectorAll("button"))].find(r);s==null||s.focus()}function Zf({cluster:t,ids:e,more:n,fits:o,settled:r,onFits:s}){const i=R(o);i.current=o;const a=R(s);a.current=s;const c=R(new Map),l=R(e);l.current=e;const d=R(null),u=e.join(" ");return Ut(()=>{const p=t.ownerDocument,h=()=>{var N;const _=l.current,w=getComputedStyle(t),S=parseFloat(w.columnGap)||0;let v=t.clientWidth-(parseFloat(w.paddingLeft)||0)-(parseFloat(w.paddingRight)||0),y=0;for(const D of _){const j=(N=p.getElementById(D))==null?void 0:N.offsetWidth;j&&c.current.set(D,j),y=Math.max(y,c.current.get(D)??0)}for(const D of Array.from(t.children))!(D instanceof HTMLElement)||_.includes(D.id)||D.id===n||D.classList.contains("clover-canvas-more")||!D.offsetWidth||getComputedStyle(D).position==="absolute"||(v-=D.offsetWidth+S);const x=qf(_.map(D=>c.current.get(D)??y),v,S);if(x===i.current)return;const k=p.activeElement;d.current=k instanceof HTMLElement&&t.contains(k)?k.id:null,i.current=x,a.current(x)};h();const m=new ResizeObserver(()=>h());m.observe(t);const g=new MutationObserver(()=>h());return g.observe(t,{childList:true}),()=>{m.disconnect(),g.disconnect()}},[t,u,n]),Ut(()=>{if(!r)return;const p=d.current;if(d.current=null,p===null)return;const h=t.ownerDocument.activeElement;(!h||!t.contains(h)||h.closest("[hidden]"))&&Kf(t,p,n)},[o,r,t,n]),null}const Gf=()=>import("./AnnotationMenu-0qO_As1t.mjs"),Xf=()=>import("./ChaptersMenu-5Oh-jx8r.mjs"),Yf=()=>import("./ChoiceMenu-BUzPTObN.mjs"),Jf=()=>import("./ImageControls-DdV9OCC9.mjs"),ji=2,Qf=new Set(["zoomIn","zoomOut","rotateRight","rotateLeft","reset","fullPage"]),Nc={atMax:false,atMin:false,atHome:false},th=({renderer:t,instance:e,config:n,controlButtons:o,limits:r=Nc,placeholder:s,placeholderIsMore:i=false,choices:a=[],selections:c={},onSelect:l,annotations:d=[],chapters:u=[],mediaElement:p=null,onChapter:h,overStill:m,request:g,hiddenPages:_,onPageVisibilityChange:w,selectedAnnotation:S=null,onAnnotationSelect:v,onAnnotationActivate:y,captionId:x,captionOpen:k=false,onCaptionToggle:N,placeId:D,placeOpen:j=false,onPlaceToggle:et,language:V,fit:nt=true,more:Y="auto",children:J})=>{var Vn,qn,$e,yn;const{t:M,langOf:T}=Et(),[O,U]=H(false),[Q,at]=H(false),ct=`annotations-${e}`,mt=`${ct}-menu`,b=M("informationPanelTabsAnnotations"),I=T("informationPanelTabsAnnotations"),P=ut(X=>{var pt;at(false),y==null||y(null),X&&((pt=document.getElementById(ct))==null||pt.focus())},[ct,y]),A=n.annotations&&d.length>0&&v,[B,Z]=H(false),E=`chapters-${e}`,z=`${E}-menu`,K=u.length>0&&!!h,G=R(false),ht=R(null);F(()=>{const X=()=>{var pt;G.current=((pt=document.activeElement)==null?void 0:pt.id)===E};return document.addEventListener("focusin",X),()=>document.removeEventListener("focusin",X)},[E]);const ft=ut(()=>{var pt,ke;if(!G.current)return;G.current=false;const X=document.activeElement;X&&X!==document.body||(ke=(pt=ht.current)==null?void 0:pt.querySelector('.clover-canvas-transport :is([data-button="play"], [data-button="pause"])'))==null||ke.focus()},[]);F(()=>{K||ft()},[K,ft]),F(()=>()=>ft(),[ft]);const Rt=ut(X=>{var pt;Z(false),X&&((pt=document.getElementById(E))==null||pt.focus())},[E]),At=n.information&&x&&N,zt=n.map&&D&&et,Ht=`choice-${e}`,gt=a.length===1?wt(a[0].label,V):null,q=(gt==null?void 0:gt.text)||M("canvasChoice"),ot=gt!=null&&gt.text?gt.lang:T("canvasChoice"),_t=`${Ht}-menu`,Ft=(Vn=on(Gf,!!A))==null?void 0:Vn.default,$=(qn=on(Xf,K))==null?void 0:qn.default,lt=($e=on(Yf,a.length>0&&!!l))==null?void 0:$e.default,Ot=ut(X=>{var pt;U(false),X&&((pt=document.getElementById(Ht))==null||pt.focus())},[Ht]),Ke=Vf(),[Gt,Ze]=H(null);F(()=>{ht.current=(Gt==null?void 0:Gt.closest(".clover-canvas"))??null},[Gt]);const Ge=gs(Gt),[me,Re]=H(false),Hn=X=>f(He,{className:X,id:ct,label:b,lang:I,onClick:()=>at(pt=>!pt),expanded:Q,controls:mt,children:f(vf,{})},"annotations"),Wn=(()=>{const X=[],pt=t;return n.zoom&&pt&&X.push({key:"zoomIn",id:`zoomIn-${e}`,shortcut:te.zoomIn,label:M("imageZoomIn"),lang:T("imageZoomIn"),glyph:f(Pf,{}),unavailable:r.atMax,onClick:()=>pt.zoomBy(ji)},{key:"zoomOut",id:`zoomOut-${e}`,shortcut:te.zoomOut,label:M("imageZoomOut"),lang:T("imageZoomOut"),glyph:f(Af,{}),unavailable:r.atMin,onClick:()=>pt.zoomBy(1/ji)}),n.fullPage&&Ke&&X.push({key:"fullPage",id:`fullPage-${e}`,label:M(Ge?"imageExitFullScreen":"imageFullScreen"),lang:T(Ge?"imageExitFullScreen":"imageFullScreen"),glyph:Ge?f(Nf,{}):f(Of,{}),onClick:ke=>void Oc(ke.currentTarget)}),n.rotation&&pt&&X.push({key:"rotateRight",id:`rotateRight-${e}`,shortcut:te.rotateRight,label:M("imageRotateRight"),lang:T("imageRotateRight"),glyph:f(Wi,{}),onClick:()=>pt.rotateBy(90)},{key:"rotateLeft",id:`rotateLeft-${e}`,shortcut:te.rotateLeft,label:M("imageRotateLeft"),lang:T("imageRotateLeft"),glyph:f(Wi,{}),onClick:()=>pt.rotateBy(-90)}),n.reset&&pt&&X.push({key:"reset",id:`reset-${e}`,shortcut:te.reset,label:M("imageResetZoom"),lang:T("imageResetZoom"),glyph:f(Rf,{}),unavailable:r.atHome,onClick:()=>pt.home()}),a.length&&X.push({key:"choice",id:Ht,label:q,lang:ot,glyph:f(Bf,{}),onClick:()=>U(ke=>!ke),expanded:O,controls:_t}),X})(),ne=[...Wn.filter(X=>X.key!=="fullPage"),...Wn.filter(X=>X.key==="fullPage")].map(X=>({id:X.id,view:Qf.has(X.key),node:Wf(X,o)})),mn=[zt&&{id:`place-${e}`,view:false,node:f(He,{id:`place-${e}`,label:M("mapLabel"),lang:T("mapLabel"),onClick:et,expanded:j,controls:D,children:f(_f,{})},"place")},K&&{id:E,view:false,node:f(He,{id:E,label:M("playerChapters"),lang:T("playerChapters"),onClick:()=>Z(X=>!X),expanded:B,controls:z,children:f(yf,{})},"chapters")},A&&{id:ct,view:false,node:Hn()},At&&{id:`information-${e}`,view:false,node:f(He,{id:`information-${e}`,label:M("informationPanelTabsAbout"),lang:T("informationPanelTabsAbout"),onClick:N,expanded:k,controls:x,children:f(bf,{})},"information")},!!s&&{id:`placeholder-${e}`,view:false,node:f(ue.Fragment,{children:s},"placeholder")}].filter(X=>!!X),Un=mn.filter(X=>X.id===`placeholder-${e}`),Vt=[...ne.filter(X=>X.view),...Un],gn=[...ne.filter(X=>!X.view),...mn.filter(X=>!Un.includes(X))],oe=[...Vt,...gn],[Be,Ro]=H(true),vn=Y==="always"||i,Lt=(yn=on(Jf,nt&&(i||(vn||!Be)&&oe.some(X=>X.view))))==null?void 0:yn.ImageControls,qt=Be&&!vn||!Lt?[]:oe.filter(X=>X.view),Se=i&&!!s&&!!Lt;F(()=>{qt.length||Re(false)},[qt.length]);const jn=X=>X.filter(pt=>!qt.includes(pt)&&!(Se&&pt.id===`placeholder-${e}`)).map(({node:pt})=>pt);return f(Ct,{children:[f(Uf,{fit:nt,clusterRef:Ze,children:[jn(Vt),Lt&&(qt.length>0||Se)&&f(Lt,{instance:e,open:Se?qt.length>0:me,onOpenChange:Re,toggle:Se?s:void 0,children:qt.map(({node:X})=>X)}),jn(gn),J]}),nt&&!vn&&Gt&&f(Zf,{cluster:Gt,ids:oe.map(({id:X})=>X),more:`more-${e}`,fits:Be,settled:Be||qt.length>0||!oe.some(X=>X.view),onFits:Ro}),$&&B&&K&&f($,{id:z,triggerId:E,label:M("playerChapters"),labelLang:T("playerChapters"),chapters:u,element:p,onChapter:h,overStill:m,request:g,onClose:Rt}),Ft&&Q&&A&&f(Ft,{id:mt,triggerId:ct,label:b,labelLang:I,annotations:d,hiddenPages:_,onPageVisibilityChange:w,selected:S,onSelect:v,onActivate:X=>y==null?void 0:y(X),onClose:P}),lt&&O&&a.length>0&&l&&f(lt,{id:_t,triggerId:Ht,label:q,labelLang:ot,language:V,choices:a,selections:c,onSelect:l,onClose:Ot})]})},eh=["jpg","png","webp","gif"];class Or extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageServiceError"}}function vs(t){return t.replace(/\/info\.json$/,"").replace(/\/+$/,"")}function Io(t){const e=Array.isArray(t)?t:t?[t]:[];for(const n of e){if(!n||typeof n!="object")continue;const o=n,r=String(o.type??o["@type"]??""),s=JSON.stringify(o.profile??""),i=/ImageService/i.test(r)||/iiif\.io\/api\/image/.test(s)||/^"level[012]"$/.test(s)||!r&&!o.profile,a=o["@id"]??o.id;if(i&&typeof a=="string")return vs(a)}}function nh(t,e){if(!t||typeof t!="object")throw new Or("info.json is not an object",e??"");const n=t,o=oh(n),r=o===3?n.id??n["@id"]:n["@id"]??n.id,s=vs(r??e??""),i=Number(n.width),a=Number(n.height);if(!s||!(i>0)||!(a>0))throw new Or("info.json is missing id, width or height",e??s);const c=Array.isArray(n.profile)?n.profile:[n.profile],l=c.find(S=>typeof S=="string"),d=c.filter(S=>!!S&&typeof S=="object"),u=rh(l),p=new Set([...Array.isArray(n.extraFeatures)?n.extraFeatures:[],...d.flatMap(S=>Array.isArray(S.supports)?S.supports:[])]),m=[...Array.isArray(n.preferredFormats)?n.preferredFormats:[]].map(S=>String(S).toLowerCase()).find(S=>eh.includes(S))??"jpg",g=S=>{var y;const v=n[S]??((y=d.find(x=>x[S]!==void 0))==null?void 0:y[S]);return Number(v)>0?Number(v):void 0};let _=g("maxWidth"),w=g("maxHeight");return _&&!w&&(w=_),w&&!_&&(_=void 0),{id:s,version:o,level:u,width:i,height:a,tiles:sh(n.tiles),sizes:ih(n.sizes),maxWidth:_,maxHeight:w,maxArea:g("maxArea"),regionByPx:u>=1||p.has("regionByPx"),sizeByW:u>=1||p.has("sizeByW")||p.has("sizeByWh"),format:m,quality:"default"}}function oh(t){const e=[].concat(t["@context"]??[]).map(String);return e.some(n=>n.includes("/image/3"))?3:e.some(n=>n.includes("/image/2"))?2:t.type==="ImageService3"?3:t["@id"]?2:3}function rh(t){const e=t==null?void 0:t.match(/level([012])/);return e?Number(e[1]):0}function sh(t){return Array.isArray(t)?t.map(e=>{const n=Number(e==null?void 0:e.width),o=Number((e==null?void 0:e.height)??(e==null?void 0:e.width)),r=(Array.isArray(e==null?void 0:e.scaleFactors)?e.scaleFactors:[1]).map(Number).filter(s=>s>0).sort((s,i)=>s-i);return{width:n,height:o,scaleFactors:r}}).filter(e=>e.width>0&&e.height>0&&e.scaleFactors.length):[]}function ih(t){return Array.isArray(t)?t.map(e=>({width:Number(e==null?void 0:e.width),height:Number(e==null?void 0:e.height)})).filter(e=>e.width>0&&e.height>0).sort((e,n)=>e.width-n.width):[]}function po(t,e,n,o,r=t.quality){const s=e.x===0&&e.y===0&&e.width===t.width&&e.height===t.height,i=s?"full":`${e.x},${e.y},${e.width},${e.height}`,a=s&&n===t.width&&o===t.height;let c;return t.version===3?c=a?"max":`${n},${o}`:c=a?"full":`${n},`,`${t.id}/${i}/${c}/0/${r}.${t.format}`}function ah(t){return t.version===2&&t.level===0?"native":void 0}const sr=new Map;function ys(t,{request:e}={}){const n=vs(t),o=sr.get(n);if(o)return o;const r=`${n}/info.json`,s=ds(e,r,{headers:{Accept:"application/ld+json, application/json"}}).then(async i=>{if(!i.ok)throw new Or(`info.json request failed with ${i.status}`,r,i.status);return nh(await i.json(),n)}).catch(i=>{throw sr.delete(n),i});return sr.set(n,s),s}function ch(t){const e=Math.max(0,Math.floor(t||0)),n=Math.floor(e/3600),o=Math.floor(e%3600/60),r=String(e%60).padStart(2,"0");return n?`${n}:${String(o).padStart(2,"0")}:${r}`:`${o}:${r}`}function vy(t,e){var n;if(t.currentTime=e,!!t.paused)try{(n=t.play())==null||n.catch(()=>{})}catch{}}function bs(t){if(!t)return;const[e,n]=t.split(","),o=Number(e);if(e===""||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}}const lh=(t,e,n,o,r)=>`${t}|${e??`${n}:${o}`}|${r}`,uh=/^((application|audio|video)\/)?(vnd\.apple\.|x-)?mpegurl$/i,dh=(t,e)=>!!(t&&/\.m3u8$/i.test(t.split(/[?#]/)[0]))||!!(e&&uh.test(e)),fh={width:1600,height:900};function hh(t,e){const n=new Array(t.length);if(!t.length)return n;const o=t.map(dn),r=e==="left-to-right"||e==="right-to-left",s=e==="right-to-left"||e==="bottom-to-top",i=r?o[0].height:o[0].width,a=t.map((l,d)=>d);s&&a.reverse();let c=0;for(const l of a){const d=o[l],u=i/(r?d.height:d.width),p=d.width*u,h=d.height*u;n[l]=r?{x:c,y:0,width:p,height:h}:{x:0,y:c,width:p,height:h},c+=r?p:h}return n}function dn(t){var s,i;if(t.width&&t.height)return{width:t.width,height:t.height};const e=Rc(t);if(e!=null&&e.width&&e.height)return{width:e.width,height:e.height};const n=((s=mo(t)[0])==null?void 0:s.body)??((i=go(t)[0])==null?void 0:i.body),o=Number(n==null?void 0:n.width),r=Number(n==null?void 0:n.height);return o>0&&r>0?{width:o,height:r}:fh}function Rc(t){return t.accompanyingContainer??t.placeholderContainer}function ph(t,e,n,o,r){return lh(t.id,e.id,n,o,r)}function mh(t){const e=[];for(const n of t)Bc(n,(o,r)=>{const s=o;if((s==null?void 0:s.type)!=="Choice")return;const i=W(s.items).filter(a=>!!a&&typeof a=="object");i.length>1&&e.push({key:r,canvasId:n.id,label:s.label,items:i.map(a=>({label:a.label,id:a.id,...typeof a.type=="string"?{type:a.type}:{},...typeof a.format=="string"?{format:a.format}:{},...typeof W(a.language)[0]=="string"?{language:W(a.language)[0]}:{}}))})});return e}const ir={};function Vi(t){if(t.type!=="Video"&&!Bn(t.type)||!t.format||dh(t.id,t.format)||typeof document>"u")return true;const e=t.type==="Video"?"video":"audio",n=ir[e]??(ir[e]=document.createElement(e));return typeof n.canPlayType!="function"?true:n.canPlayType(t.format)!==""}function gh(t,e){const n={};for(const o of t){const r=o.items.filter(Vi),s=[...new Set(r.flatMap(c=>c.language??[]))],i=s.length>1?rc(s,e):void 0,a=o.items.findIndex(c=>Vi(c)&&(!i||c.language===i));a>0&&(n[o.key]=a)}return n}const ar=new WeakMap,cr=[];function vh(t){return Eo(t).some(e=>((e==null?void 0:e.type)==="Choice"?W(e.items):[e]).some(o=>(o==null?void 0:o.type)==="Video"||Bn(o==null?void 0:o.type)))}function Nr(t){var i;const e=ar.get(t);if(e)return e;const n=[];for(const a of t.items??[])for(const c of a.items??[]){if(!is(c))continue;const l=c.target?(i=hn(c.target))==null?void 0:i.t:void 0;if(!l)continue;const[d,u]=l.split(",").map(Number);Number.isFinite(d)&&n.push({annotation:c,start:d,end:Number.isFinite(u)?u:NaN})}if(n.every(a=>vh(a.annotation)))return ar.set(t,cr),cr;n.sort((a,c)=>a.start-c.start);const o=Number(t.duration),r=Number.isFinite(o)&&o/n.length||.5;n.forEach((a,c)=>{var d;const l=(d=n[c+1])==null?void 0:d.start;a.end>a.start||(l!=null?a.end=l>a.start?l:a.start+r:Number.isFinite(o)&&o>a.start?a.end=o:a.end>a.start||(a.end=a.start+r))});const s=n.length>1?n:cr;return ar.set(t,s),s}const Pn=t=>`frame:${t.id}`;function Bc(t,e){(t.items??[]).forEach((n,o)=>{(n.items??[]).forEach((r,s)=>{is(r)&&Eo(r).forEach((i,a)=>e(i,ph(t,r,o,s,a),r))})})}function mo(t,e={},{allFrames:n=false}={}){const o=[];return _s(t,e,(r,s,i)=>{r.body.type==="Image"&&o.push({body:r.body,region:r.region,...r.rotation?{rotation:r.rotation}:{},target:s,...i>=0?{frame:i}:{}})},n),o}function yh(t,e={}){for(const n of t){let o;if(_s(n,e,r=>{o??(o=r.body.type)}),typeof o=="string")return o.toLowerCase()}}function go(t,e={}){const n=[];return _s(t,e,(o,r,s,i)=>{const a=o.body.type;if(a!=="Video"&&!Bn(a))return;const c=bs(i);n.push({kind:a==="Video"?"video":"audio",body:o.body,target:r,...c?{time:c}:{}})}),n}function bh(t){const e=t.filter(o=>o.time&&typeof o.body.id=="string"),n=new Set(e.map(o=>o.time.start));if(!(e.length<2||n.size!==e.length))return e.sort((o,r)=>o.time.start-r.time.start).map(o=>{const r=Number(o.body.duration)||(o.time.end!==void 0?o.time.end-o.time.start:void 0);return{src:o.body.id,...o.body.format?{format:o.body.format}:{},start:o.time.start,...r?{duration:r}:{}}})}function _s(t,e,n,o=false){const r=t.width??0,s=t.height??0,i=Nr(t),a=Math.min(e[Pn(t)]??0,Math.max(0,i.length-1));Bc(t,(c,l,d)=>{const u=i.findIndex(g=>g.annotation===d);if(!o&&u>=0&&u!==a)return;const p=Rr(c,e[l]??0);if(!p)return;const h=d.target?hn(d.target):void 0,m=h==null?void 0:h.rect;n(p,m?{x:m.x,y:m.y,width:m.w,height:m.h}:{x:0,y:0,width:r||Number(p.body.width)||0,height:s||Number(p.body.height)||0},u,h==null?void 0:h.t)})}function $c(t){return Fc(t).filter(e=>e.kind!=="transcript")}function _h(t){const e=W(t.provides);return e.includes("closedCaptions")?"captions":e.includes("subtitles")||e.includes("translation")?"subtitles":e.includes("transcript")?"transcript":"captions"}function Fc(t){const e=[],n=[...t.annotations??[],...t.items??[]];for(const o of n)for(const r of o.items??[])if(W(r.motivation).includes("supplementing"))for(const s of W(r.body)){const i=s,a=(i==null?void 0:i.type)==="Choice"?W(i.items):[i];for(const c of a){const l=c==null?void 0:c.id;!((c==null?void 0:c.format)==="text/vtt"||typeof l=="string"&&/\.vtt(\?|$)/i.test(l))||typeof l!="string"||e.push({id:l,label:c.label,language:W(c.language)[0],kind:_h(r)})}}return e}function wh(t){const e=[],n=r=>{const s=r,i=s==null?void 0:s.id;if(typeof i!="string"||e.some(c=>c.id===i))return;const a=s==null?void 0:s.format;(a?a!=="text/plain":!/\.txt(\?|$)/i.test(i))||e.push({id:i,label:s==null?void 0:s.label,language:W(s==null?void 0:s.language)[0]})},o=[...t.annotations??[],...t.items??[]];for(const r of o)for(const s of r.items??[])if(W(s.motivation).includes("supplementing"))for(const i of W(s.body)){const a=i;((a==null?void 0:a.type)==="Choice"?W(a.items):[a]).forEach(n)}return W(t.rendering).forEach(n),e}function Rr(t,e=0){if(!t||typeof t!="object")return null;const n=t;if(n.type==="Choice"){const o=W(n.items);return Rr(o[e]??o[0])}if(n.type==="SpecificResource"&&n.source){const o=typeof n.source=="string"?{id:n.source}:n.source,r=W(n.selector).find(a=>(a==null?void 0:a.type)==="ImageApiSelector"),s=Rr({type:"Image",...o});if(!s)return null;const i=(r==null?void 0:r.rotation)!=null?String(r.rotation):void 0;return{...s,region:(r==null?void 0:r.region)||s.region,...i?{rotation:i}:{}}}return n.type!=="Image"&&n.type!=="Video"&&!Bn(n.type)?null:{body:n,region:typeof n.region=="string"?n.region:void 0}}function xh(t,e,n={},{standIns:o=true}={}){const r=hh(t,e),s=[],i=[],a={};return t.forEach((c,l)=>{const d=r[l],u=dn(c),p=d.width/u.width,h=d.height/u.height,m=y=>({x:d.x+y.x*p,y:d.y+y.y*h,width:y.width*p,height:y.height*h}),g=go(c,n),_=mo(c,n,{allFrames:true}).map(y=>({...y,canvas:c})),w=Rc(c);if(o&&!_.length&&g.some(y=>y.kind==="audio")&&w){const y=dn(w);for(const x of mo(w))_.push({...x,canvas:w,target:{x:x.target.x/y.width*u.width,y:x.target.y/y.height*u.height,width:x.target.width/y.width*u.width,height:x.target.height/y.height*u.height}})}const S=n[Pn(c)]??0;_.forEach(({body:y,target:x,region:k,rotation:N,frame:D,canvas:j},et)=>{var J;const V=Io(y.service);if(!V&&!y.id)return;const nt=`${j.id}|${et}|${y.id??V}|${k??""}|${N??""}`,Y=!(V&&k);if(s.push({id:nt,service:V,url:y.id,width:Y&&Number(y.width)||void 0,height:Y&&Number(y.height)||void 0,region:k,...N?{rotation:N}:{},placement:m(x),...D!=null&&D!==S?{hidden:true}:{}}),D!=null){const M=a[J=Pn(c)]??(a[J]=[]);(M[D]??(M[D]=[])).push(nt)}});const[v]=g;if(v!=null&&v.body.id){const y=bh(g),x=y?y[0]:void 0;i.push({id:`${c.id}|media|${v.body.id}`,kind:v.kind,src:(x==null?void 0:x.src)??v.body.id,format:x?x.format:v.body.format,placement:m(v.target),duration:y?Number(c.duration)||void 0:Number(v.body.duration??c.duration)||void 0,...y?{segments:y}:{},poster:Sh(c),captions:$c(c)})}}),{images:s,media:i,placements:r,frames:a}}function Sh(t){var e;return(e=Dc(t))==null?void 0:e.source}const yy=1280;function Dc(t){var c;const e=t.placeholderContainer;if(!e)return;const n=(c=mo(e)[0])==null?void 0:c.body;if(!n)return;const o=Io(n.service),r=typeof n.id=="string"?n.id:void 0,s=o?{service:o,fallback:r}:r?{src:r}:void 0;if(!s)return;const{width:i,height:a}=dn(e);return{source:s,width:i,height:a}}function kh(t,e,n){const o=dn(t),r=e.width/o.width,s=e.height/o.height;return{x:e.x+n.x*r,y:e.y+n.y*s,width:n.width*r,height:n.height*s}}const Ch=({hidden:t})=>{const{t:e,langOf:n}=Et(),o=e("imageExitFullScreen");return f("button",{"aria-label":o,...dt(n("imageExitFullScreen")),className:"clover-canvas-exit-full-screen",hidden:t,onClick:r=>void Oc(r.currentTarget),type:"button",children:[f("svg",{viewBox:"0 0 512 512",width:"20",height:"20","aria-hidden":"true",focusable:"false",children:f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"})}),o]})},zc="50%";function Hc(t,e=zc,n=null){const[o,r]=H(()=>typeof IntersectionObserver>"u");return F(()=>{if(o||!t)return;const s=new IntersectionObserver(i=>{i.some(a=>a.isIntersecting)&&(r(true),s.disconnect())},{root:n,rootMargin:e});return s.observe(t),()=>s.disconnect()},[t,o,e,n]),o}function Eh(t){const[e,n]=H(false);return F(()=>{if(!t)return;const o=()=>n(To()===t);return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}function Mh(t){const[e,n]=H(false);return F(()=>{if(!t)return;const o=()=>{const r=To();n(r===t||!!r&&Ac(t)===r&&(r==null?void 0:r.querySelector(".clover-canvas"))===t)};return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}class Th extends ue.Component{constructor(){super(...arguments);L(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}render(){const{error:n}=this.state;return n?f(Ih,{error:n}):this.props.children}}function Ih({error:t}){const{t:e,langOf:n}=Et();return f("div",{className:"clover-canvas-error",role:"alert",children:[f("p",{className:"clover-canvas-error-headline","data-testid":"headline",...dt(n("statusError")),children:e("statusError")}),t.message&&f("span",{className:"clover-canvas-error-body",lang:"en",children:t.message})]})}function En({overlay:t=false,className:e}){return f("span",{"aria-hidden":"true",className:It("clover-loading",e),"data-overlay":t||void 0,children:f("span",{})})}const Lh={image:"bodyUnloadableImage",video:"bodyUnloadableVideo",audio:"bodyUnloadableAudio",model:"bodyUnloadableModel"};function Ph({kind:t,shown:e,room:n=false}){const{t:o,langOf:r}=Et(),s=Lh[t];return f("div",{className:"clover-body-unloadable","data-room":n||void 0,role:"status",children:e&&f("p",{...dt(r(s)),children:o(s)})})}function Ah({text:t,lang:e}){return f("div",{className:"clover-body-note","aria-hidden":"true",children:f("p",{...dt(e),children:t})})}function Lo(t,e,n=false,o){const r=pe(),{hostLanguage:s}=Et(void 0,o);if(n)return{props:{},node:null};const i=ko(e,s);return i===void 0?{props:{"aria-label":t},node:null}:{props:{"aria-labelledby":r},node:f("span",{hidden:true,id:r,...dt(i),children:t})}}const Oh=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function se(t,e){return{a:1,b:0,c:0,d:1,e:t,f:e}}function de(t,e=t){return{a:t,b:0,c:0,d:e,e:0,f:0}}function Fn(t){const e=Math.cos(t),n=Math.sin(t);return{a:e,b:n,c:-n,d:e,e:0,f:0}}function Nh(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function fe(...t){return t.reduce((e,n)=>Nh(e,n),Oh)}function Rh(t){const e=t.a*t.d-t.b*t.c;if(!e||!Number.isFinite(e))return null;const n=1/e;return{a:t.d*n,b:-t.b*n,c:-t.c*n,d:t.a*n,e:(t.c*t.f-t.d*t.e)*n,f:(t.b*t.e-t.a*t.f)*n}}function be(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function by(t){return`matrix(${[t.a,t.b,t.c,t.d,t.e,t.f].map($h).join(",")})`}function Bh(t,e,n,o=new Float32Array(9)){const r=2/e,s=-2/n;return o[0]=t.a*r,o[1]=t.b*s,o[2]=0,o[3]=t.c*r,o[4]=t.d*s,o[5]=0,o[6]=t.e*r-1,o[7]=t.f*s+1,o[8]=1,o}function $h(t){const e=Math.round(t*1e6)/1e6;return Object.is(e,-0)?"0":String(e)}function Wc(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function ws(t){if(!t.length)return null;let e=1/0,n=1/0,o=-1/0,r=-1/0;for(const s of t)e=Math.min(e,s.x),n=Math.min(n,s.y),o=Math.max(o,s.x+s.width),r=Math.max(r,s.y+s.height);return{x:e,y:n,width:o-e,height:r-n}}function Fh(t,e){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height}function Po(t,e){const n=[be(t,{x:e.x,y:e.y}),be(t,{x:e.x+e.width,y:e.y}),be(t,{x:e.x,y:e.y+e.height}),be(t,{x:e.x+e.width,y:e.y+e.height})],o=n.map(a=>a.x),r=n.map(a=>a.y),s=Math.min(...o),i=Math.min(...r);return{x:s,y:i,width:Math.max(...o)-s,height:Math.max(...r)-i}}function wn(t,e,n){return Math.min(Math.max(t,e),n)}const lr=t=>!!(t&&"overlays"in t);let Br;const Dh=()=>Promise.resolve().then(()=>Dd).then(t=>{Br=t.buildContentState}),zh=vt(()=>import("./MediaBody-C2hFgOY8.mjs")),Hh=()=>import("./AnnotationState-NPVw45tA.mjs"),Wh=new Map,Uh={menu:[],placed:[],timed:[],hiddenPages:[],setPagesVisible:()=>{},listedCount:0,comments:Wh,selected:null,select:()=>{},activate:()=>{},release:()=>false,quietlyOpened:null},jh=vt(()=>import("./FrameAnimation-CXyt9tLj.mjs")),qi=vt(()=>import("./PlaceBox-DdCjBb2D.mjs")),Vh=vt(()=>import("./Placeholder-CS9JVhwU.mjs")),qh=vt(()=>import("./ControlsFade-cDNVSrmI.mjs")),Kh=()=>true,Zh=vt(()=>import("./Placeholder-CS9JVhwU.mjs").then(({PlaceholderToggle:t})=>({default:t}))),Ki={zoom:true,fullPage:true,rotation:true,reset:true,annotations:true,information:true,map:true},Gh={zoom:false,fullPage:false,rotation:false,reset:false,annotations:false,information:false,map:false},Xh={description:"canvasKeysImage",keys:["ArrowLeft ArrowRight ArrowUp ArrowDown",te.zoomIn.keys,te.zoomOut.keys,te.reset.keys,te.rotateRight.keys,te.rotateLeft.keys].join(" ")},Yh={description:"canvasKeysMedia",keys:[te.play.keys,"J L",te.mute.keys].join(" ")},Jh={description:"canvasKeysAnnotations",keys:"Escape"},Qh=t=>{var n;return!!((n=t.canvases)!=null&&n.length)||Uc(t.body,t.src).length>0?f(Th,{children:f(tp,{...t})}):null},tp=t=>{var qs,Ks,Zs,Gs,Xs,Ys;const{surface:e,manifestId:n,canvases:o,viewingDirection:r,body:s,src:i,isTiledImage:a=false,label:c,partOf:l,language:d,highContrast:u,instanceId:p,className:h,options:m,navigator:g=false,controls:_=true,collapseControls:w="auto",controlButtons:S,annotations:v,onReady:y,onViewportChange:x,onContentStateChange:k,onMediaElement:N,onCaptionChange:D,caption:j,onEnded:et,chapters:V,highlightedChapter:nt,onChapterHighlight:Y,placeholder:J=true,children:M}=t,{t:T}=Et(),O=R(null),[U,Q]=H(null),at=Eh(U),ct=gs(U),mt=Mh(U),b=Co(Q),I=Jr(u),P=!!e.controlsVisibility,B=(e.controlsVisibility??Kh)(P?U:null,m==null?void 0:m.hideDelay,O),[Z,E]=H(false),z=Hc(U),K=pe(),[G]=H(()=>p??`clover-canvas-${K}`),ht=R(null),[ft,Rt]=H(null),At=lr(ft)?ft:null,[zt,Ht]=H(null),gt=_===false?null:_===true?Ki:{...Ki,..._},[q,ot]=H("loading"),[_t,Ft]=H(false),[$,lt]=H(0),[Ot,Ke]=H(Nc),Gt=R(y),Ze=R(x),Ge=R(m);Gt.current=y,Ze.current=x,Ge.current=m;const me=ss(r),Re=bt(()=>mh(o??[]),[o]),Hn=bt(()=>gh(Re,d),[Re,d]),[No,Wn]=H({}),ne=bt(()=>({...Hn,...No}),[Hn,No]),mn=(C,tt)=>Wn(yt=>({...yt,[C]:tt})),Un=bt(()=>v==null?void 0:v.filter(C=>!C.layer||(ne[C.layer.key]??0)===C.layer.item),[v,ne]),Vt=(qs=v==null?void 0:v.find(C=>C.layer&&C.annotation.id===t.selectedAnnotation))==null?void 0:qs.layer;F(()=>{Vt&&(ne[Vt.key]??0)!==Vt.item&&mn(Vt.key,Vt.item)},[Vt==null?void 0:Vt.key,Vt==null?void 0:Vt.item,t.selectedAnnotation]);const gn=!!(gt!=null&&gt.information),oe=!!(v!=null&&v.length),Be=on(Hh,oe),[Ro,vn]=H(null),Lt=oe&&Ro||Uh,qt=bt(()=>{var yt,Nt;const C=(yt=v==null?void 0:v.find(Kt=>Kt.annotation.id===Lt.selected))==null?void 0:yt.annotation,tt=(Array.isArray(C==null?void 0:C.body)?C==null?void 0:C.body:[C==null?void 0:C.body]).find(Kt=>(Kt==null?void 0:Kt.type)==="Feature");return C&&tt?{id:String(C.id),feature:tt,name:((Nt=tt.properties)==null?void 0:Nt.label)??C.label}:null},[v,Lt.selected]),Se=qt?`${qt.id}:${t.refind??0}`:null,[jn,Vn]=H(null),qn=Se!==null&&jn!==Se,$e=bt(()=>{var Kt,tn;const C=(o??[]).map(Yt=>Yt.navPlace).filter(Boolean),tt=C.length?C:t.navPlace?[t.navPlace]:[];if(!tt.length)return null;const yt=tt.flatMap(Yt=>(Yt==null?void 0:Yt.type)==="FeatureCollection"?Yt.features??[]:(Yt==null?void 0:Yt.type)==="Feature"?[Yt]:[]);if(!yt.length)return null;const Nt=yt.length===1?(tn=(Kt=yt[0])==null?void 0:Kt.properties)==null?void 0:tn.label:void 0;return{feature:{type:"FeatureCollection",features:yt},name:Nt??t.label}},[o,t.navPlace,t.label]),yn=`place-box-${G}`,[X,pt]=H(false),[ke,Ll]=H(false),Kn=R(Lt);Kn.current=Lt;const Zn=ut(()=>Kn.current.release(),[]),{comments:Bo,listedCount:Ps}=Lt,Xe=bt(()=>gn?(o??[]).filter(C=>If(C)||Bo.has(C.id)):[],[o,gn,Bo]),$o=`caption-${G}`,[Pl,As]=H(false),Fo=Pl&&Xe.length>0,Os=ut(C=>{var tt;As(false),C&&((tt=document.getElementById(`information-${G}`))==null||tt.focus())},[G]),Xt=bt(()=>(o??[]).find(C=>Nr(C).length)??null,[o]),Al=Xt?Nr(Xt):np,Wt=bt(()=>o!=null&&o.length?xh(o,me,ne,{standIns:o.length>1}):null,[o,me,ne]),Ol=bt(()=>Uc(s,i,a),[s,i,a]),rt=(Wt==null?void 0:Wt.media[0])??null,Ns=!P&&(rt==null?void 0:rt.kind)==="video",Nl=P||Ns,Rl=P?B:Z,Bl=bt(()=>{if(o!=null&&o.length)return yh(o,ne);const C=(Array.isArray(s)?s:s?[s]:[])[0];return typeof(C==null?void 0:C.type)=="string"?C.type.toLowerCase():i?"image":void 0},[o,ne,s,i]),[Dt,$l]=H(null),Gn=R(N);Gn.current=N;const Fl=ut(C=>{var tt;$l(C),(tt=Gn.current)==null||tt.call(Gn,C)},[]),Ce=Wt?Wt.images:Ol,Ee=!!rt&&(o==null?void 0:o.length)===1,Me=Ee&&(rt==null?void 0:rt.kind)==="audio",Dl=Ee&&(rt==null?void 0:rt.kind)==="video",Ye=(o==null?void 0:o.length)===1&&!rt&&!Xt&&Ce.length===0,Xn=!Ee&&!Ye&&((Ks=m==null?void 0:m.gestures)==null?void 0:Ks.navigable)!==false,ge=o?`${n??""}
1
+ var Ql=Object.defineProperty;var tu=(t,e,n)=>e in t?Ql(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var L=(t,e,n)=>tu(t,typeof e!="symbol"?e+"":e,n);import{s as Ea}from"./styles-ihp-vncb.mjs";function eu(t={}){return Promise.resolve().then(()=>ad).then(e=>e.initCloverI18n(t))}const Ma="@layer clover{:is(clover-root,clover-items,clover-viewer,clover-panel,clover-read-more):not([hidden]){display:block}:is(clover-body,clover-canvas,clover-timeline,clover-scene):not([hidden]){display:block;height:var(--clover-body-height,60vh)}clover-split:not([hidden]){display:flex}:is(clover-label,clover-panel-toggle):not([hidden]){display:contents}clover-tab,clover-tip,clover-status>[slot]{display:none}}";let nu=null,xn=null;const ou=()=>nu??(nu=import("./host-C79mYkpB.mjs").then(t=>xn=t)),ru=t=>t.trim().toLowerCase()==="false";function su(t,{type:e,min:n},o){if(t===null)return;if(e==="string")return t;if(e==="boolean")return!ru(t);if(e==="number"){const s=Number(t);if(t.trim()===""||!Number.isFinite(s)){o("is not a number");return}if(n!==void 0&&s<n){o(`is less than ${n}`);return}return s}if(e==="data"){const s=t.trim();if(!/^[[{"]/.test(s))return t;try{return JSON.parse(s)}catch{o("is not JSON");return}}const r=t.trim().toLowerCase();if(e.includes(r))return r==="false"?false:r;o(`is not ${e.join(", ")}`)}const iu=(t,e)=>{const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(o=>Object.is(t[o],e[o]))};function au(t){class e extends HTMLElement{constructor(){super(...arguments);L(this,"kind",t.kind)}static get observedAttributes(){return Object.keys(t.attributes)}connectedCallback(){Ea(this.ownerDocument).inject("elements",Ma)}}customElements.define(t.tag,e)}function cu(t,e){if(typeof customElements>"u"||customElements.get(t.tag))return;if(t.kind==="config"||!e)return au(t);const n=t.kind,o=t.properties??[],r=Object.entries(t.events??{});let s=null,i=null;const a=()=>i??(i=Promise.all([e().then(l=>s=l),ou()]));class c extends HTMLElement{constructor(){super(...arguments);L(this,"kind",n);L(this,"needsRoot",!!t.needsRoot);L(this,"values",{});L(this,"kept",{});L(this,"props",{});L(this,"listeners",new Set);L(this,"warned",new Set);L(this,"handlers",Object.fromEntries(r.map(([u,p])=>[p.prop,(...h)=>{var w;if(p.keeps&&(this.kept[p.keeps]=h[0]??null,h[0]==null))return true;const m=p.detail==="first"?h[0]:Object.fromEntries(p.detail.map((S,v)=>[S,h[v]])),g=new CustomEvent(u,{detail:m,bubbles:!p.keeps,composed:!p.keeps,cancelable:!!p.cancelable}),_=this.dispatchEvent(g);if(!_&&p.cancelable){const S=h[h.length-1];(w=S==null?void 0:S.preventDefault)==null||w.call(S)}return _}])));L(this,"getProps",()=>this.props);L(this,"subscribe",u=>(this.listeners.add(u),()=>{this.listeners.delete(u)}))}static get observedAttributes(){return Object.keys(t.attributes)}get element(){return this}get Component(){return s}connectedCallback(){for(const u of o){if(!Object.prototype.hasOwnProperty.call(this,u))continue;const p=this[u];delete this[u],p!=null&&(this.values[u]=p)}this.update(),this.warnOfAria(),Ea(this.ownerDocument).inject("elements",Ma),a().then(()=>{this.isConnected&&xn.hostOf(this.ownerDocument).connect(this)})}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||xn==null||xn.hostOf(this.ownerDocument).disconnect(this)})}attributeChangedCallback(){this.update()}warnOfAria(){if(!t.native)for(const u of["aria-label","aria-labelledby","role"])!this.hasAttribute(u)||this.warned.has(u)||(this.warned.add(u),console.warn(`<${t.tag}>: ${u} names the element, a box no reader is told of; Clover names what it draws itself.`))}update(){const u={...this.handlers,...this.values};for(const[p,h]of Object.entries(t.attributes)){if(h.prop in this.values)continue;const m=this.getAttribute(p),g=su(m,h,_=>{const w=`${p}=${m}`;this.warned.has(w)||(this.warned.add(w),console.warn(`<${t.tag}>: ${p}="${m}" ${_}; ignored.`))});g!==void 0&&(u[h.prop]=g)}iu(u,this.props)||(this.props=u,this.listeners.forEach(p=>p()))}}L(c,"initCloverI18n",eu);for(const l of o)Object.defineProperty(c.prototype,l,{configurable:true,enumerable:true,get(){return l in this.values?this.values[l]:this.getProps()[l]},set(d){d==null?delete this.values[l]:this.values[l]=d,this.update()}});for(const[,l]of r){if(!l.keeps)continue;const d=l.keeps;Object.defineProperty(c.prototype,d,{configurable:true,enumerable:true,get(){return this.kept[d]??null}})}customElements.define(t.tag,c)}var An,it,Ta,ze,ei,Ia,La,Pa,jr,yr,br,Aa,Mn={},Oa=[],lu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,On=Array.isArray;function ce(t,e){for(var n in e)t[n]=e[n];return t}function Vr(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function xe(t,e,n){var o,r,s,i={};for(s in e)s=="key"?o=e[s]:s=="ref"?r=e[s]:i[s]=e[s];if(arguments.length>2&&(i.children=arguments.length>3?An.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)i[s]===void 0&&(i[s]=t.defaultProps[s]);return Cn(t,i,o,r,null)}function Cn(t,e,n,o,r){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Ta,__i:-1,__u:0};return r==null&&it.vnode!=null&&it.vnode(s),s}function uu(){return{current:null}}function Ct(t){return t.children}function le(t,e){this.props=t,this.context=e}function cn(t,e){if(e==null)return t.__?cn(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?cn(t):null}function Na(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Na(t)}}function _r(t){(!t.__d&&(t.__d=true)&&ze.push(t)&&!lo.__r++||ei!=it.debounceRendering)&&((ei=it.debounceRendering)||Ia)(lo)}function lo(){for(var t,e,n,o,r,s,i,a=1;ze.length;)ze.length>a&&ze.sort(La),t=ze.shift(),a=ze.length,t.__d&&(n=void 0,o=void 0,r=(o=(e=t).__v).__e,s=[],i=[],e.__P&&((n=ce({},o)).__v=o.__v+1,it.vnode&&it.vnode(n),qr(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[r]:null,s,r??cn(o),!!(32&o.__u),i),n.__v=o.__v,n.__.__k[n.__i]=n,$a(s,n,i),o.__e=o.__=null,n.__e!=r&&Na(n)));lo.__r=0}function Ra(t,e,n,o,r,s,i,a,c,l,d){var u,p,h,m,g,_,w,S=o&&o.__k||Oa,v=e.length;for(c=du(n,e,S,c,v),u=0;u<v;u++)(h=n.__k[u])!=null&&(p=h.__i==-1?Mn:S[h.__i]||Mn,h.__i=u,_=qr(t,h,p,r,s,i,a,c,l,d),m=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Kr(p.ref,null,h),d.push(h.ref,h.__c||m,h)),g==null&&m!=null&&(g=m),(w=!!(4&h.__u))||p.__k===h.__k?c=Ba(h,c,t,w):typeof h.type=="function"&&_!==void 0?c=_:m&&(c=m.nextSibling),h.__u&=-7);return n.__e=g,c}function du(t,e,n,o,r){var s,i,a,c,l,d=n.length,u=d,p=0;for(t.__k=new Array(r),s=0;s<r;s++)(i=e[s])!=null&&typeof i!="boolean"&&typeof i!="function"?(c=s+p,(i=t.__k[s]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?Cn(null,i,null,null,null):On(i)?Cn(Ct,{children:i},null,null,null):i.constructor==null&&i.__b>0?Cn(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=t,i.__b=t.__b+1,a=null,(l=i.__i=fu(i,n,c,u))!=-1&&(u--,(a=n[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>d?p--:r<d&&p++),typeof i.type!="function"&&(i.__u|=4)):l!=c&&(l==c-1?p--:l==c+1?p++:(l>c?p--:p++,i.__u|=4))):t.__k[s]=null;if(u)for(s=0;s<d;s++)(a=n[s])!=null&&!(2&a.__u)&&(a.__e==o&&(o=cn(a)),Da(a,a));return o}function Ba(t,e,n,o){var r,s;if(typeof t.type=="function"){for(r=t.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=t,e=Ba(r[s],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=cn(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function we(t,e){return e=e||[],t==null||typeof t=="boolean"||(On(t)?t.some(function(n){we(n,e)}):e.push(t)),e}function fu(t,e,n,o){var r,s,i,a=t.key,c=t.type,l=e[n],d=l!=null&&(2&l.__u)==0;if(l===null&&t.key==null||d&&a==l.key&&c==l.type)return n;if(o>(d?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((l=e[i=r>=0?r--:s++])!=null&&!(2&l.__u)&&a==l.key&&c==l.type)return i}return-1}function ni(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||lu.test(e)?n:n+"px"}function no(t,e,n,o,r){var s,i;t:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||ni(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||ni(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Pa,"$1")),i=e.toLowerCase(),e=i in t||e=="onFocusOut"||e=="onFocusIn"?i.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?o?n.u=o.u:(n.u=jr,t.addEventListener(e,s?br:yr,s)):t.removeEventListener(e,s?br:yr,s);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break t}catch{}typeof n=="function"||(n==null||n===false&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function oi(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=jr++;else if(e.t<n.u)return;return n(it.event?it.event(e):e)}}}function qr(t,e,n,o,r,s,i,a,c,l){var d,u,p,h,m,g,_,w,S,v,y,x,k,N,D,j,et,V=e.type;if(e.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=e.__e=n.__e]),(d=it.__b)&&d(e);t:if(typeof V=="function")try{if(w=e.props,S="prototype"in V&&V.prototype.render,v=(d=V.contextType)&&o[d.__c],y=d?v?v.props.value:d.__:o,n.__c?_=(u=e.__c=n.__c).__=u.__E:(S?e.__c=u=new V(w,y):(e.__c=u=new le(w,y),u.constructor=V,u.render=pu),v&&v.sub(u),u.props=w,u.state||(u.state={}),u.context=y,u.__n=o,p=u.__d=true,u.__h=[],u._sb=[]),S&&u.__s==null&&(u.__s=u.state),S&&V.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ce({},u.__s)),ce(u.__s,V.getDerivedStateFromProps(w,u.__s))),h=u.props,m=u.state,u.__v=e,p)S&&V.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),S&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(S&&V.getDerivedStateFromProps==null&&w!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(w,y),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,y)===false||e.__v==n.__v){for(e.__v!=n.__v&&(u.props=w,u.state=u.__s,u.__d=false),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(nt){nt&&(nt.__=e)}),x=0;x<u._sb.length;x++)u.__h.push(u._sb[x]);u._sb=[],u.__h.length&&i.push(u);break t}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,y),S&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,m,g)})}if(u.context=y,u.props=w,u.__P=t,u.__e=false,k=it.__r,N=0,S){for(u.state=u.__s,u.__d=false,k&&k(e),d=u.render(u.props,u.state,u.context),D=0;D<u._sb.length;D++)u.__h.push(u._sb[D]);u._sb=[]}else do u.__d=false,k&&k(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++N<25);u.state=u.__s,u.getChildContext!=null&&(o=ce(ce({},o),u.getChildContext())),S&&!p&&u.getSnapshotBeforeUpdate!=null&&(g=u.getSnapshotBeforeUpdate(h,m)),j=d,d!=null&&d.type===Ct&&d.key==null&&(j=Fa(d.props.children)),a=Ra(t,On(j)?j:[j],e,n,o,r,s,i,a,c,l),u.base=e.__e,e.__u&=-161,u.__h.length&&i.push(u),_&&(u.__E=u.__=null)}catch(nt){if(e.__v=null,c||s!=null)if(nt.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(et=s.length;et--;)Vr(s[et]);wr(e)}else e.__e=n.__e,e.__k=n.__k,nt.then||wr(e);it.__e(nt,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=hu(n.__e,e,n,o,r,s,i,c,l);return(d=it.diffed)&&d(e),128&e.__u?void 0:a}function wr(t){t&&t.__c&&(t.__c.__e=true),t&&t.__k&&t.__k.forEach(wr)}function $a(t,e,n){for(var o=0;o<n.length;o++)Kr(n[o],n[++o],n[++o]);it.__c&&it.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){it.__e(s,r.__v)}})}function Fa(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:On(t)?t.map(Fa):ce({},t)}function hu(t,e,n,o,r,s,i,a,c){var l,d,u,p,h,m,g,_=n.props,w=e.props,S=e.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((h=s[l])&&"setAttribute"in h==!!S&&(S?h.localName==S:h.nodeType==3)){t=h,s[l]=null;break}}if(t==null){if(S==null)return document.createTextNode(w);t=document.createElementNS(r,S,w.is&&w),a&&(it.__m&&it.__m(e,s),a=false),s=null}if(S==null)_===w||a&&t.data==w||(t.data=w);else{if(s=s&&An.call(t.childNodes),_=n.props||Mn,!a&&s!=null)for(_={},l=0;l<t.attributes.length;l++)_[(h=t.attributes[l]).name]=h.value;for(l in _)if(h=_[l],l!="children"){if(l=="dangerouslySetInnerHTML")u=h;else if(!(l in w)){if(l=="value"&&"defaultValue"in w||l=="checked"&&"defaultChecked"in w)continue;no(t,l,null,h,r)}}for(l in w)h=w[l],l=="children"?p=h:l=="dangerouslySetInnerHTML"?d=h:l=="value"?m=h:l=="checked"?g=h:a&&typeof h!="function"||_[l]===h||no(t,l,h,_[l],r);if(d)a||u&&(d.__html==u.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(u&&(t.innerHTML=""),Ra(e.type=="template"?t.content:t,On(p)?p:[p],e,n,o,S=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,i,s?s[0]:n.__k&&cn(n,0),a,c),s!=null)for(l=s.length;l--;)Vr(s[l]);a||(l="value",S=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[l]||S=="progress"&&!m||S=="option"&&m!=_[l])&&no(t,l,m,_[l],r),l="checked",g!=null&&g!=t[l]&&no(t,l,g,_[l],r))}return t}function Kr(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(r){it.__e(r,n)}}function Da(t,e,n){var o,r;if(it.unmount&&it.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||Kr(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(s){it.__e(s,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&Da(o[r],e,n||typeof t.type!="function");n||Vr(t.__e),t.__c=t.__=t.__e=void 0}function pu(t,e,n){return this.constructor(t,n)}function Tn(t,e,n){var o,r,s,i;e==document&&(e=document.documentElement),it.__&&it.__(t,e),r=(o=typeof n=="function")?null:n&&n.__k||e.__k,s=[],i=[],qr(e,t=(!o&&n||e).__k=xe(Ct,null,[t]),r||Mn,Mn,e.namespaceURI,!o&&n?[n]:r?null:e.firstChild?An.call(e.childNodes):null,s,!o&&n?n:r?r.__e:e.firstChild,o,i),$a(s,t,i)}function za(t,e){Tn(t,e,za)}function mu(t,e,n){var o,r,s,i,a=ce({},t.props);for(s in t.type&&t.type.defaultProps&&(i=t.type.defaultProps),e)s=="key"?o=e[s]:s=="ref"?r=e[s]:a[s]=e[s]===void 0&&i!=null?i[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?An.call(arguments,2):n),Cn(t.type,a,o||t.key,r||t.ref,null)}function he(t){function e(n){var o,r;return this.getChildContext||(o=new Set,(r={})[e.__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,_r(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 e.__c="__cC"+Aa++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,o){return n.children(o)}).contextType=e,e}An=Oa.slice,it={__e:function(t,e,n,o){for(var r,s,i;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),i=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,o||{}),i=r.__d),i)return r.__E=r}catch(a){t=a}throw t}},Ta=0,le.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ce({},this.state),typeof t=="function"&&(t=t(ce({},n),this.props)),t&&ce(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),_r(this))},le.prototype.forceUpdate=function(t){this.__v&&(this.__e=true,t&&this.__h.push(t),_r(this))},le.prototype.render=Ct,ze=[],Ia=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,La=function(t,e){return t.__v.__b-e.__v.__b},lo.__r=0,Pa=/(PointerCapture)$|Capture$/i,jr=0,yr=oi(false),br=oi(true),Aa=0;var gu=0;function f(t,e,n,o,r,s){e||(e={});var i,a,c=e;if("ref"in c)for(a in c={},e)a=="ref"?i=e[a]:c[a]=e[a];var l={type:t,props:c,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--gu,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(i=t.defaultProps))for(a in i)c[a]===void 0&&(c[a]=i[a]);return it.vnode&&it.vnode(l),l}var Ae,kt,Yo,ri,ln=0,Ha=[],Mt=it,si=Mt.__b,ii=Mt.__r,ai=Mt.diffed,ci=Mt.__c,li=Mt.unmount,ui=Mt.__;function fn(t,e){Mt.__h&&Mt.__h(kt,t,ln||e),ln=0;var n=kt.__H||(kt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function H(t){return ln=1,Zr(ja,t)}function Zr(t,e,n){var o=fn(Ae++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):ja(void 0,e),function(a){var c=o.__N?o.__N[0]:o.__[0],l=o.t(c,a);c!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=kt,!kt.__f)){var r=function(a,c,l){if(!o.__c.__H)return true;var d=o.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!s||s.call(this,a,c,l);var u=o.__c.props!==a;return d.forEach(function(p){if(p.__N){var h=p.__[0];p.__=p.__N,p.__N=void 0,h!==p.__[0]&&(u=true)}}),s&&s.call(this,a,c,l)||u};kt.__f=true;var s=kt.shouldComponentUpdate,i=kt.componentWillUpdate;kt.componentWillUpdate=function(a,c,l){if(this.__e){var d=s;s=void 0,r(a,c,l),s=d}i&&i.call(this,a,c,l)},kt.shouldComponentUpdate=r}return o.__N||o.__}function F(t,e){var n=fn(Ae++,3);!Mt.__s&&Xr(n.__H,e)&&(n.__=t,n.u=e,kt.__H.__h.push(n))}function Ut(t,e){var n=fn(Ae++,4);!Mt.__s&&Xr(n.__H,e)&&(n.__=t,n.u=e,kt.__h.push(n))}function R(t){return ln=5,bt(function(){return{current:t}},[])}function Wa(t,e,n){ln=6,Ut(function(){if(typeof t=="function"){var o=t(e());return function(){t(null),o&&typeof o=="function"&&o()}}if(t)return t.current=e(),function(){return t.current=null}},n==null?n:n.concat(t))}function bt(t,e){var n=fn(Ae++,7);return Xr(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function ut(t,e){return ln=8,bt(function(){return t},e)}function jt(t){var e=kt.context[t.__c],n=fn(Ae++,9);return n.c=t,e?(n.__==null&&(n.__=true,e.sub(kt)),e.props.value):t.__}function Ua(t,e){Mt.useDebugValue&&Mt.useDebugValue(e?e(t):t)}function Gr(){var t=fn(Ae++,11);if(!t.__){for(var e=kt.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function vu(){for(var t;t=Ha.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(io),t.__H.__h.forEach(xr),t.__H.__h=[]}catch(e){t.__H.__h=[],Mt.__e(e,t.__v)}}Mt.__b=function(t){kt=null,si&&si(t)},Mt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ui&&ui(t,e)},Mt.__r=function(t){ii&&ii(t),Ae=0;var e=(kt=t.__c).__H;e&&(Yo===kt?(e.__h=[],kt.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(io),e.__h.forEach(xr),e.__h=[],Ae=0)),Yo=kt},Mt.diffed=function(t){ai&&ai(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ha.push(e)!==1&&ri===Mt.requestAnimationFrame||((ri=Mt.requestAnimationFrame)||yu)(vu)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Yo=kt=null},Mt.__c=function(t,e){e.some(function(n){try{n.__h.forEach(io),n.__h=n.__h.filter(function(o){return!o.__||xr(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Mt.__e(o,n.__v)}}),ci&&ci(t,e)},Mt.unmount=function(t){li&&li(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{io(o)}catch(r){e=r}}),n.__H=void 0,e&&Mt.__e(e,n.__v))};var di=typeof requestAnimationFrame=="function";function yu(t){var e,n=function(){clearTimeout(o),di&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);di&&(e=requestAnimationFrame(n))}function io(t){var e=kt,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),kt=e}function xr(t){var e=kt;t.__c=t.__(),kt=e}function Xr(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function ja(t,e){return typeof e=="function"?e(t):e}function Va(t,e){for(var n in e)t[n]=e[n];return t}function Sr(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return true;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return true;return false}function ee(t,e){var n=e(),o=H({t:{__:n,u:e}}),r=o[0].t,s=o[1];return Ut(function(){r.__=n,r.u=e,Jo(r)&&s({t:r})},[t,n,e]),F(function(){return Jo(r)&&s({t:r}),t(function(){Jo(r)&&s({t:r})})},[t]),n}function Jo(t){var e,n,o=t.u,r=t.__;try{var s=o();return!((e=r)===(n=s)&&(e!==0||1/e==1/n)||e!=e&&n!=n)}catch{return true}}function qa(t){t()}function Ka(t){return t}function Za(){return[false,qa]}var Ga=Ut;function kr(t,e){this.props=t,this.context=e}function bu(t,e){function n(r){var s=this.props.ref,i=s==r.ref;return!i&&s&&(s.call?s(null):s.current=null),e?!e(this.props,r)||!i:Sr(this.props,r)}function o(r){return this.shouldComponentUpdate=n,xe(t,r)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=true,o.__f=true,o.type=t,o}(kr.prototype=new le).isPureReactComponent=true,kr.prototype.shouldComponentUpdate=function(t,e){return Sr(this.props,t)||Sr(this.state,e)};var fi=it.__b;it.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),fi&&fi(t)};var _u=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ie(t){function e(n){var o=Va({},n);return delete o.ref,t(o,n.ref||null)}return e.$$typeof=_u,e.render=t,e.prototype.isReactComponent=e.__f=true,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var hi=function(t,e){return t==null?null:we(we(t).map(e))},wu={map:hi,forEach:hi,count:function(t){return t?we(t).length:0},only:function(t){var e=we(t);if(e.length!==1)throw"Children.only";return e[0]},toArray:we},xu=it.__e;it.__e=function(t,e,n,o){if(t.then){for(var r,s=e;s=s.__;)if((r=s.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e)}xu(t,e,n,o)};var pi=it.unmount;function Xa(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=Va({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=true,t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return Xa(o,e,n)})),t}function Ya(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return Ya(o,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=true,t.__c.__P=n)),t}function St(){this.__u=0,this.o=null,this.__b=null}function Ja(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function vt(t){var e,n,o;function r(s){if(e||(e=t()).then(function(i){n=i.default||i},function(i){o=i}),o)throw o;if(!n)throw e;return xe(n,s)}return r.displayName="Lazy",r.__f=true,r}function Sn(){this.i=null,this.l=null}it.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),pi&&pi(t)},(St.prototype=new le).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=Ja(o.__v),s=false,i=function(){s||(s=true,n.__R=null,r?r(a):a())};n.__R=i;var a=function(){if(!--o.__u){if(o.state.__a){var c=o.state.__a;o.__v.__k[0]=Ya(c,c.__c.__P,c.__c.__O)}var l;for(o.setState({__a:o.__b=null});l=o.o.pop();)l.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(i,i)},St.prototype.componentWillUnmount=function(){this.o=[]},St.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Xa(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&xe(Ct,null,t.fallback);return r&&(r.__u&=-33),[xe(Ct,null,e.__a?null:t.children),r]};var mi=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};function Su(t){return this.getChildContext=function(){return t.context},t.children}function ku(t){var e=this,n=t.h;if(e.componentWillUnmount=function(){Tn(null,e.v),e.v=null,e.h=null},e.h&&e.h!==n&&e.componentWillUnmount(),!e.v){for(var o=e.__v;o!==null&&!o.__m&&o.__!==null;)o=o.__;e.h=n,e.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return true},insertBefore:function(r,s){this.childNodes.push(r),e.h.insertBefore(r,s)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.h.removeChild(r)}}}Tn(xe(Su,{context:e.context},t.__v),e.v)}function Cu(t,e){var n=xe(ku,{__v:t,h:e});return n.containerInfo=e,n}(Sn.prototype=new le).__a=function(t){var e=this,n=Ja(e.__v),o=e.l.get(t);return o[0]++,function(r){var s=function(){e.props.revealOrder?(o.push(r),mi(e,t,o)):r()};n?n(s):s()}},Sn.prototype.render=function(t){this.i=null,this.l=new Map;var e=we(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Sn.prototype.componentDidUpdate=Sn.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){mi(t,n,e)})};var Qa=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Eu=/^(?: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]/,Mu=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Tu=/[A-Z0-9]/g,Iu=typeof document<"u",Lu=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function Pu(t,e,n){return e.__k==null&&(e.textContent=""),Tn(t,e),typeof n=="function"&&n(),t?t.__c:null}function Au(t,e,n){return za(t,e),typeof n=="function"&&n(),t?t.__c:null}le.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(le.prototype,t,{configurable:true,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:true,writable:true,value:e})}})});var gi=it.event;function Ou(){}function Nu(){return this.cancelBubble}function Ru(){return this.defaultPrevented}it.event=function(t){return gi&&(t=gi(t)),t.persist=Ou,t.isPropagationStopped=Nu,t.isDefaultPrevented=Ru,t.nativeEvent=t};var Yr,Bu={enumerable:false,configurable:true,get:function(){return this.class}},vi=it.vnode;it.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,o=e.type,r={},s=o.indexOf("-")===-1;for(var i in n){var a=n[i];if(!(i==="value"&&"defaultValue"in n&&a==null||Iu&&i==="children"&&o==="noscript"||i==="class"||i==="className")){var c=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&a===true?a="":c==="translate"&&a==="no"?a=false:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?i="ondblclick":c!=="onchange"||o!=="input"&&o!=="textarea"||Lu(n.type)?c==="onfocus"?i="onfocusin":c==="onblur"?i="onfocusout":Mu.test(i)&&(i=c):c=i="oninput":s&&Eu.test(i)?i=i.replace(Tu,"-$&").toLowerCase():a===null&&(a=void 0),c==="oninput"&&r[i=c]&&(i="oninputCapture"),r[i]=a}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=we(n.children).forEach(function(l){l.props.selected=r.value.indexOf(l.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=we(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",Bu)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),e.props=r}(t),t.$$typeof=Qa,vi&&vi(t)};var yi=it.__r;it.__r=function(t){yi&&yi(t),Yr=t.__c};var bi=it.diffed;it.diffed=function(t){bi&&bi(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value),Yr=null};var $u={ReactCurrentDispatcher:{current:{readContext:function(t){return Yr.__n[t.__c].props.value},useCallback:ut,useContext:jt,useDebugValue:Ua,useDeferredValue:Ka,useEffect:F,useId:Gr,useImperativeHandle:Wa,useInsertionEffect:Ga,useLayoutEffect:Ut,useMemo:bt,useReducer:Zr,useRef:R,useState:H,useSyncExternalStore:ee,useTransition:Za}}};function Fu(t){return xe.bind(null,t)}function wo(t){return!!t&&t.$$typeof===Qa}function Du(t){return wo(t)&&t.type===Ct}function zu(t){return!!t&&!!t.displayName&&(typeof t.displayName=="string"||t.displayName instanceof String)&&t.displayName.startsWith("Memo(")}function Hu(t){return wo(t)?mu.apply(null,arguments):t}function Wu(t){return!!t.__k&&(Tn(null,t),true)}function Uu(t){return t&&(t.base||t.nodeType===1&&t)||null}var ju=function(t,e){return t(e)},Vu=function(t,e){return t(e)},qu=Ct,Ku=wo,ue={useState:H,useId:Gr,useReducer:Zr,useEffect:F,useLayoutEffect:Ut,useInsertionEffect:Ga,useTransition:Za,useDeferredValue:Ka,useSyncExternalStore:ee,startTransition:qa,useRef:R,useImperativeHandle:Wa,useMemo:bt,useCallback:ut,useContext:jt,useDebugValue:Ua,version:"18.3.1",Children:wu,render:Pu,hydrate:Au,unmountComponentAtNode:Wu,createPortal:Cu,createElement:xe,createContext:he,createFactory:Fu,cloneElement:Hu,createRef:uu,Fragment:Ct,isValidElement:wo,isElement:Ku,isFragment:Du,isMemo:zu,findDOMNode:Uu,Component:le,PureComponent:kr,memo:bu,forwardRef:ie,flushSync:Vu,unstable_batchedUpdates:ju,StrictMode:qu,Suspense:St,SuspenseList:Sn,lazy:vt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:$u};function Jr(t){const e=ee(Gu,Xu);return!!t||e}const Qr=t=>t?{"data-high-contrast":""}:{},Zu="(prefers-contrast: more)",tc=()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Zu):null;function Gu(t){var n;const e=tc();return(n=e==null?void 0:e.addEventListener)==null||n.call(e,"change",t),()=>{var o;return(o=e==null?void 0:e.removeEventListener)==null?void 0:o.call(e,"change",t)}}const Xu=()=>{var t;return!!((t=tc())!=null&&t.matches)},Nn=he(void 0),It=(...t)=>t.filter(Boolean).join(" "),xo=he(null);function Ne(){return jt(xo)}function ae(t="This part"){const e=jt(xo);if(!e)throw new Error(`${t} must be rendered inside <Clover.Root>.`);return e}function st(t,e=Object.is,n){const{clover:o}=ae(n),r=R(null),s=()=>{const i=t(o.store.get());return r.current&&e(r.current.value,i)?r.current.value:(r.current={value:i},i)};return ee(o.store.subscribe,s)}const Yu={subscribe:()=>()=>{}};function Rn(t,e){const n=jt(xo),o=n==null?void 0:n.clover.store,r=()=>o?t(o.get()):e;return ee(o?o.subscribe:Yu.subscribe,r)}const Ju=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","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"}'),ec={es:()=>import("../es-Bn4XnLxy.mjs"),fi:()=>import("../fi-CjAXeLqH.mjs"),fr:()=>import("../fr-CeFhkxoi.mjs"),it:()=>import("../it-DxtfVek2.mjs"),ja:()=>import("../ja-rsicBgWR.mjs"),nb:()=>import("../nb-BkyI1fhp.mjs"),nn:()=>import("../nn-n_xM6AGl.mjs"),no:()=>import("../no-BkyI1fhp.mjs"),pt:()=>import("../pt-COchUT7D.mjs"),"zh-Hans":()=>import("../zh-Hans-Bfn3LUnq.mjs"),"zh-Hant":()=>import("../zh-Hant-DzmK541A.mjs")};function ts(){return typeof navigator>"u"?[]:[...navigator.languages??[],navigator.language].filter(Boolean)}function nc(){if(!(typeof document>"u"))return document.documentElement.lang||void 0}let oc=()=>[];function Qu(t){oc=t}function td(){const[t,...e]=oc();return[...new Set([t,...ts(),...e,nc()].filter(n=>!!n))]}const uo=t=>t.split("-")[0];function es(t,e){return uo(t).toLowerCase()===uo(e).toLowerCase()}function Cr(t){try{const{language:e,script:n}=new Intl.Locale(t).maximize();return n&&`${e}-${n}`}catch{return}}function ed(t,e){const n=Cr(t);if(n)return e.find(o=>o!=="none"&&o!=="@none"&&Cr(o)===n)}const Qo=t=>t.includes("-")?uo(t):null;function nd(t,e,n=[]){if(!e.length)return;if(e.length===1)return e[0];const o=()=>e.includes("none")?"none":e.includes("@none")?"@none":e[0];if(!t)return e.includes("none")?"none":e[0];if(e.includes(t))return t;const r=Qo(t);if(r&&e.includes(r))return r;const s=ed(t,e);if(s)return s;const i=n.find(c=>e.includes(c));if(i)return i;const a=e.findIndex(c=>Qo(c)===t);if(a!==-1)return e[a];for(const c of n){const l=Qo(c);if(l&&e.includes(l))return l}return o()}function ns(t,e){const[n,...o]=e?[e]:td();return nd(n,t,o)??t[0]}function rc(t,e,n){if(n&&t.includes(n))return n;if(!t.length)return;const o=ns(t,e);return o==="none"?t[0]:o}const ye="clover",Qt={en:{[ye]:{...Ju}}};let kn=[],Jt,fo=[],sc=[],os=0;const Er=new Set;function rs(){os++,Er.forEach(t=>t())}function ic(t){return[t,Cr(t),uo(t)].filter(e=>!!e)}const od=t=>t==="en"||ac(t)||!!Qt[t],Oe=t=>ic(t).find(od),_i=new Map,ac=t=>Object.prototype.hasOwnProperty.call(ec,t);function rd(t){let e=_i.get(t);return e||(e=ec[t]().then(({default:n})=>{var o;Qt[t]={...Qt[t],[ye]:{...n,...(o=Qt[t])==null?void 0:o[ye]}},rs()},()=>{}),_i.set(t,e)),e}function Mr(t){const e=t.find(n=>n==="en"||ac(n));return e&&e!=="en"?rd(e):Promise.resolve()}let oo=[],wi="",In="en";function So(){const t=nc();return[...new Set([...kn,...t?[t]:[]])]}function Pe(){const t=`${os} ${typeof document<"u"?document.documentElement.lang:""} ${typeof navigator<"u"?navigator.languages:""}`;if(t===wi)return oo;wi=t;const e=So();return In=ts().map(Oe).find(Boolean)??e.map(Oe).find(Boolean)??"en",oo=[...new Set([Jt??In,...sc,...e].filter(o=>!!o).flatMap(ic).concat("en"))],Mr(oo),oo}function sd(){return Pe(),[...new Set([In,...So().map(Oe),...fo.map(Oe)].filter(t=>!!t))]}Qu(()=>(Pe(),[Jt,In,...So()]));function ko(t,e){if(t)return es(t,e||Tt.resolvedLanguage)?void 0:t}const Tt={get language(){return Jt??Pe().find(t=>Qt[t])??"en"},get chosenLanguage(){return Jt},stringsFor(t){return Oe(t)},interfaceLanguages(){return{languages:sd(),chosen:Jt&&Oe(Jt)||In}},chooseInterfaceLanguage(t){return Jt=t||void 0,fo=Jt?[...new Set([...fo,Jt])]:[],rs(),Mr(Pe())},get resolvedLanguage(){return Pe().find(t=>{var e;return Object.keys(((e=Qt[t])==null?void 0:e[ye])??{}).length>0})??"en"},changeLanguage(t){return Tt.chooseInterfaceLanguage(t)},resolve(t,e,n=ye){var r,s;let o={text:t};for(const i of Pe()){const a=(s=(r=Qt[i])==null?void 0:r[n])==null?void 0:s[t];if(a!==void 0){o={text:a,lang:i};break}}return e?{...o,text:o.text.replace(/\{\{(\w+)\}\}/g,(i,a)=>a in e?String(e[a]):i)}:o},t(t,e,n=ye){return Tt.resolve(t,e,n).text},langOf(t,e,n=ye){return ko(Tt.resolve(t,void 0,n).lang,e)},ready(){return Mr(Pe())},subscribe(t){return Er.add(t),()=>{Er.delete(t)}},getSnapshot(){return os}};typeof document<"u"&&Pe();function id(t={}){for(const[n,o]of Object.entries(t.resources??{}))for(const[r,s]of Object.entries(o??{}))Qt[n]??(Qt[n]={}),Qt[n][r]={...Qt[n][r],...s};t.fallbackLng!==void 0&&(sc=t.fallbackLng===false?[]:[t.fallbackLng].flat());const e=kn.join();if(t.languages!==void 0?kn=[t.languages].flat().filter(Boolean):t.lng&&(kn=[t.lng]),kn.join()!==e){fo=[];const n=[...ts(),...So()].map(Oe);Jt&&!n.includes(Oe(Jt))&&(Jt=void 0)}return rs(),Tt}const ad=Object.freeze(Object.defineProperty({__proto__:null,CLOVER_I18N_NAMESPACE:ye,cloverI18n:Tt,initCloverI18n:id,langWithin:ko},Symbol.toStringTag,{value:"Module"}));function Et(t=ye,e){const n=ee(Tt.subscribe,Tt.getSnapshot,Tt.getSnapshot),o=jt(Nn),r=e??o,s=ut((a,c)=>Tt.t(a,c,t),[t,n]),i=ut(a=>Tt.langOf(a,r,t),[t,n,r]);return{t:s,langOf:i,hostLanguage:r,i18n:Tt}}function Co(t,e){const n=jt(Nn),o=R(null),[r,s]=H(""),i=ut(d=>{o.current=d,typeof t=="function"?t(d):t&&(t.current=d)},[t]);F(()=>{var u,p;const d=(u=o.current)==null?void 0:u.parentElement;e!==void 0||n!==void 0||!d||s(((p=d.closest("[lang]"))==null?void 0:p.getAttribute("lang"))??"")});const c=e??n??r,{langOf:l}=Et(void 0,c);return{ref:i,hostLanguage:c,langOf:l}}const W=t=>Array.isArray(t)?t:t==null?[]:[t],cd=["left-to-right","right-to-left","top-to-bottom","bottom-to-top"];function ss(t){return cd.includes(t)?t:"left-to-right"}const ld=["individuals","paged","continuous","unordered"];function ud(t){return W(t).find(n=>ld.includes(n))??"individuals"}function dd(t,e){if(!t.length)return[];if(e==="continuous")return[t.map((a,c)=>c)];if(e!=="paged")return t.map((a,c)=>[c]);const n=[];let o=[],r=0,s=false;const i=()=>{o.length&&n.push(o),o=[]};return t.forEach((a,c)=>{const l=W(a.behavior);if(l.includes("non-paged")){c===r&&r++,i(),n.push([c]);return}if(c===r||l.includes("facing-pages")){o.length&&(s=true),i(),n.push([c]);return}if(o.push(c),s){i(),s=false;return}o.length>1&&i()}),i(),n}function fd(t,e){const n=t.findIndex(o=>o.includes(e));return n===-1?0:n}const cc=["Independents","Composite","List"];function Eo(t){return W(t==null?void 0:t.body).flatMap(e=>cc.includes(e==null?void 0:e.type)?W(e.items):[e])}function is(t){const e=W(t==null?void 0:t.motivation);return!e.length||e.includes("painting")}function lc(t,e){const n=/(?:^|[#&])t=([^&]+)/.exec(e),o=n&&{t:n[1]},r=/(?:^|[#&])xywh=(?:pixel:)?([^&]+)/.exec(e);if(r){const[s,i,a,c]=r[1].split(",").map(Number);if([s,i,a,c].every(Number.isFinite))return{id:t,rect:{x:s,y:i,w:a,h:c},...o}}return o&&{id:t,...o}}function ro(t){const e=t.indexOf("#");if(e>=0){const o=t.slice(0,e);return lc(o,t.slice(e))??{id:o}}const n=t.indexOf("&t=");return n>=0?{id:t.slice(0,n),t:t.slice(n+3)}:{id:t}}const Tr=t=>{var e;return Array.isArray(t)?Tr(t[0]):cc.includes(t==null?void 0:t.type)?Tr((e=t.items)==null?void 0:e[0]):t};function hn(t){return hd(Tr(t))}function hd(t){var n;if(typeof t=="string")return ro(t);if(!t||typeof t!="object")return{id:""};if(t.type!=="SpecificResource"||t.source===void 0)return ro(t.id??"");const e=typeof t.source=="string"?ro(t.source):ro(((n=t.source)==null?void 0:n.id)??"");for(const o of W(t.selector)){const r=o;if((r==null?void 0:r.type)==="PointSelector"){const[s,i,a]=[r.x,r.y,r.instant??r.t].map(Number),c=Number.isFinite(s)&&Number.isFinite(i);return{id:e.id,...c?{point:{x:s,y:i}}:{},...Number.isFinite(a)?{t:String(a)}:{}}}if((r==null?void 0:r.type)==="SvgSelector"&&r.value)return{id:e.id,svg:String(r.value)};if((r==null?void 0:r.type)==="FragmentSelector"&&r.value){const s=lc(e.id,String(r.value));if(s)return s}}return e}const Bn=t=>t==="Audio"||t==="Sound",pd=t=>{const e=W(t);return e.length>0&&e.every(n=>n==="supplementing")},md=(t,e)=>pd(t)&&!!(e.rect||e.svg||e.point)&&!e.t,xi=new WeakMap,gd={canvases:[],views:[],direction:"left-to-right"};function Bt(t){if(!t)return gd;let e=xi.get(t);if(!e){const n=(t.items??[]).filter(o=>(o==null?void 0:o.type)==="Canvas"||(o==null?void 0:o.type)==="Timeline"||(o==null?void 0:o.type)==="Scene");e={canvases:n,views:dd(n,ud(t.behavior)),direction:ss(t.viewingDirection)},xi.set(t,e)}return e}const Si=new WeakMap;function Ve(t,e){if(!e)return null;const n=Bt(t);let o=Si.get(n);if(!o){o=new Map;for(const r of n.canvases)o.has(r.id)||o.set(r.id,r);Si.set(n,o)}return o.get(e)??null}function $n(t,e){const{canvases:n,views:o}=Bt(t),r=n.findIndex(s=>s.id===e);return r===-1?0:fd(o,r)}const ki=new WeakMap,vd=[];function We(t,e){if(!t)return vd;const n=$n(t,e);let o=ki.get(t);o||ki.set(t,o=new Map);let r=o.get(n);if(!r){const s=Bt(t);r=(s.views[n]??[]).map(i=>s.canvases[i]),o.set(n,r)}return r}function yd(t,e){var s,i;const{canvases:n,views:o}=Bt(t),r=(s=o[e])==null?void 0:s[0];return r===void 0?null:((i=n[r])==null?void 0:i.id)??null}function bd(t){const e=t==null?void 0:t.start;if(!e)return null;const n=hn(e);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 Fe=(t,e)=>{const n=t==null?void 0:t.behavior;return Array.isArray(n)?n.includes(e):n===e},_d=t=>[(t==null?void 0:t.partOf)??[]].flat().find(e=>(e==null?void 0:e.id)&&e.type==="Collection");function wd(t,e,n,o){const r=t==null?void 0:t.items;if(!(r!=null&&r.length)||!n)return-1;const s=We(n,o),i=a=>{const c=r[a];return((c==null?void 0:c.manifestId)===n.id||(c==null?void 0:c.manifestAs)===n.id)&&(!c.canvasId||s.some(l=>l.id===c.canvasId))};return e!==null&&i(e)?e:r.findIndex((a,c)=>i(c))}function wt(t,e,n=", "){if(!t)return{text:""};if(typeof t=="string")return{text:t};const o=Object.keys(t).filter(a=>{var c;return(c=t[a])==null?void 0:c.length});if(!o.length)return{text:""};const r=ns(o,e),s=t[r];return{text:Array.isArray(s)?s.join(n):String(s),lang:r==="none"||r==="@none"?void 0:r}}const xd=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/;function Ln(t){const e=t==null?void 0:t.language,n=(Array.isArray(e)?e:[e]).filter(o=>typeof o=="string"&&xd.test(o));return n.length===1?n[0]:void 0}const Ue={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Sd=/^(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)$/,kd=/^(adlm|arab|hebr|nkoo|rohg|syrc|thaa)$/;function Cd(t){if(!t)return;const[e,...n]=t.toLowerCase().split(/[-_]/),o=n.find(r=>/^[a-z]{4}$/.test(r));return(o?kd.test(o):Sd.test(e))?"rtl":void 0}function dt(t){return t?{lang:t,dir:Cd(t)}:{}}function Ed({clover:t,language:e}){const{t:n,langOf:o}=Et(),[r,s]=H(null),i=R(n);return i.current=n,F(()=>{let a=null;return t.store.subscribe(()=>{const{manifest:c,canvasId:l,status:d}=t.store.get();if(d!=="ready"||l===a)return;const u=a===null;if(a=l,u)return;const p=Ve(c,l),h=wt(p==null?void 0:p.label,e),m=i.current("canvasPosition",{index:$n(c,l)+1,total:Bt(c).views.length});s({label:h.text,lang:h.lang,position:m})})},[t,e]),f("div",{className:"clover-announcer",role:"status","aria-live":"polite","aria-atomic":"true",style:Ue,children:[r!=null&&r.label?f(Ct,{children:[f("span",{...dt(r.lang),children:r.label}),","," "]}):null,r&&f("span",{...dt(o("canvasPosition")),children:r.position})]})}const Md=t=>(t==null?void 0:t.format)==="text/vtt"||typeof(t==null?void 0:t.id)=="string"&&/\.vtt(\?|$)/i.test(t.id);function Td(t){const e=[];let n=0;const o=(r,s)=>{var a;if(!r||Md(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")e.push({value:String(r.value??""),format:r.format,language:W(r.language)[0],...i});else if(r.type==="Image"&&r.id){const c=r.label??t.label;e.push({image:r.id,format:r.format,...c?{label:c}:{},...i})}else if(r.type==="Feature"){const c=((a=r.properties)==null?void 0:a.label)??t.label;c&&typeof c=="object"&&e.push({label:c,place:true,...i})}};for(const r of Eo(t))if((r==null?void 0:r.type)!=="Choice")o(r);else{const s=n++;for(const i of W(r.items))o(i,s)}return e}const as="content-search",Id="contents",dy=(t,e)=>`${t}#region-${e+1}`,Ld=t=>W(t==null?void 0:t.motivation).includes("linking");function uc(t,e,n){const o=[];for(const r of W(t==null?void 0:t.items)){const s=W(r==null?void 0:r.motivation);if(s.includes("painting"))continue;const i=Td(r);if(!i.length&&!Ld(r))continue;const a=hn(W(r.target)[0]),c=a.id||n;!c||!r.id||o.push({id:r.id,setId:e,canvasId:c,target:a,motivation:s,bodies:i,annotation:r})}return o}const Pd=t=>Bt(t).canvases.some(e=>W(e.items).some(n=>W(n==null?void 0:n.items).some(o=>W(o==null?void 0:o.body).some(r=>[r,...W(r==null?void 0:r.items)].some(s=>W(s==null?void 0:s.annotations).length>0)))));function Ad(t,e){for(const n of[t,e])if(n!=null&&n.label)return n.label;for(const n of[t,e]){const o=W(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 dc=t=>W(t==null?void 0:t.partOf).filter(e=>(e==null?void 0:e.id)&&/AnnotationCollection/.test(String((e==null?void 0:e.type)??(e==null?void 0:e["@type"])))),Ci=new WeakMap;function fc(t){var n;if(!t)return[];let e=Ci.get(t);if(!e){const o=new Map;for(const r of Bt(t).canvases)for(const s of W(r.annotations)){if(!Array.isArray(s==null?void 0:s.items))continue;const i=s.id??`${r.id}#annotations`;let a=o.get(i);if(!a){const c=(n=dc(s)[0])==null?void 0:n.id;a={id:i,label:Ad(s),source:"manifest",entries:[],...c?{collection:c}:{}},o.set(i,a)}a.entries.push(...uc(s,i,r.id))}e=[...o.values()].filter(r=>r.entries.length),Ci.set(t,e)}return e}const Ei=new WeakMap,hc=[];function fy(t){if(!t)return hc;let e=Ei.get(t);return e||(e=Bt(t).canvases.flatMap(n=>W(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)}))),Ei.set(t,e)),e}const tr=new WeakMap,er=new WeakMap;function pc(t,e=Od){var n;if(!er.has(e)){const o=e.filter(s=>s.content),r=(n=o[0])==null?void 0:n.content;er.set(e,r?{id:r.id,type:r.type,...r.label?{label:r.label}:{},pages:hc,entries:o.flatMap(s=>s.entries)}:null)}return er.get(e)??Nd(t)}const Od=[];function Nd(t){var r;if(!t)return null;if(tr.has(t))return tr.get(t);const e=Bt(t).canvases.flatMap(s=>W(s.annotations).flatMap(i=>dc(i).map(a=>({part:a,page:i,canvas:s})))),n=(r=e[0])==null?void 0:r.part.id,o=n?(()=>{var l,d;const s=e.filter(({part:u})=>u.id===n),i=(l=s.find(({part:u})=>u.label))==null?void 0:l.part.label,a=Number((d=s.find(({part:u})=>u.total))==null?void 0:d.part.total),c=fc(t);return{id:n,type:"AnnotationCollection",...i?{label:i}:{},...a>0?{total:a}:{},pages:s.map(({page:u,canvas:p})=>({id:String(u.id),canvasId:String(p.id),fetched:Array.isArray(u.items)})),entries:s.flatMap(({page:u})=>{var p;return((p=c.find(h=>h.id===u.id))==null?void 0:p.entries)??[]})}})():null;return tr.set(t,o),o}const Mi=new WeakMap,Ti=[];function cs(t,e){const n=fc(t);if(!e.length)return n.length?n:Ti;const o=t??Ti;let r=Mi.get(o);r||Mi.set(o,r=new Map);let s=r.get(e);if(!s){const i=new Set(n.map(a=>a.id));s=[...n,...e.filter(a=>!i.has(a.id)&&!!i.add(a.id))],r.set(e,s)}return s}const Ii=new WeakMap;function mc(t,e,n,o=null){const r=cs(t,e),s=n!=null&&n.entries.length?n:null;if(!o&&!s)return r;let i=Ii.get(r);i||Ii.set(r,i=new Map);let a=i.get(o);a||i.set(o,a=new Map);let c=a.get(s);return c||(c=[...r,...o?[o]:[],...s?[s]:[]],a.set(s,c)),c}const Rd=t=>Number(t==null?void 0:t.duration)>0;function gc(t,e){return t.source==="search"||!t.entries.length?false:t.entries.every(n=>md(n.motivation,n.target)&&!Rd(e(n.canvasId)))}const Li=new WeakMap;function Bd(t,e){const n=cs(t,e);let o=Li.get(n);if(!o){const r=n.filter(s=>!gc(s,i=>Ve(t,i)??void 0));o=r.length===n.length?n:r,Li.set(n,o)}return o}const Pi=new WeakMap;function ls(t,e,n,o){const r=cs(t,e),s=Pi.get(r);if(s&&s.hidden===n&&s.shown===o)return s.ids;const i=r.filter(c=>!n.includes(c.id)&&!o.includes(c.id)&&gc(c,l=>Ve(t,l)??void 0)).map(c=>c.id),a=i.length?[...n,...i]:n;return Pi.set(r,{hidden:n,shown:o,ids:a}),a}const Ai=new WeakMap,Oi=[as,Id];function $d(t,e,n,o,r){if(!r)return Oi;const s=ls(t,e,n,o),i=Ai.get(s);if(i&&i.hidden===n)return i.ids;const a=[...Oi,...s.filter(c=>!n.includes(c))];return Ai.set(s,{hidden:n,ids:a}),a}function Fd(t){for(const e of W(t==null?void 0:t.target)){const n=(e==null?void 0:e.type)==="SpecificResource"?e.source:e,o=W(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 nr(t,e){if(!e)return null;for(const n of t){const o=n.entries.find(r=>r.id===e);if(o)return o}return null}function vc(t){return btoa(encodeURIComponent(JSON.stringify(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function yc({manifestId:t,canvasId:e,type:n="Canvas",region:o,time:r}){const s={id:e,type:n,...t&&t!==e?{partOf:[{id:t,type:"Manifest"}]}:{}},i=r!=null&&r>0?`t=${Math.round(r*100)/100}`:o?`xywh=${[o.x,o.y,o.w,o.h].map(Math.round).join(",")}`:null,a={"@context":`http://iiif.io/api/presentation/${n==="Canvas"?3:4}/context.json`,id:`${e}#content-state`,type:"Annotation",motivation:["contentState"],target:i?{type:"SpecificResource",source:s,selector:{type:"FragmentSelector",value:i}}:s};return{json:a,encoded:vc(a)}}const Dd=Object.freeze(Object.defineProperty({__proto__:null,buildContentState:yc,encodeContentState:vc},Symbol.toStringTag,{value:"Module"})),zd=/iiif\.io\/api\/presentation\/4\/context\.json/;function bc(t){const e=t==null?void 0:t["@context"];return(Array.isArray(e)?e:[e]).some(o=>typeof o=="string"&&zd.test(o))}let Ni=null,Ri=null;function us(){return Ri??(Ri=import("../upgrade-eNW0DPXq.mjs")),Ni??(Ni=import("../upgrader-BlbMUEH6.mjs").then(({upgradePresentation3To4:t})=>t)),Promise.all([Ni,Ri])}async function je(t){if(bc(t))return t;const[e,{upgrade:n}]=await us();return await n(t,e)}function ds(t,e,n={}){return((t==null?void 0:t.fetch)??globalThis.fetch)(e,{credentials:(t==null?void 0:t.credentials)??"same-origin",...n,headers:{...n.headers,...t==null?void 0:t.headers}})}const Hd=t=>(t==null?void 0:t.credentials)==="include",Wd=t=>JSON.stringify([t==null?void 0:t.credentials,t==null?void 0:t.headers]);class Ud extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="CloverRequestError"}}async function un(t,e,n){const o=await ds(t,e,{signal:n,headers:{Accept:"application/ld+json, application/json"}});if(!o.ok)throw new Ud(`${e} answered ${o.status}`,e,o.status);return o.json()}const jd=()=>import("./content-state-reader-RmqJu8gE.mjs");function Vd(t){const e=t;return!e||typeof e!="object"?false:e.type==="Annotation"||e["@type"]==="oa:Annotation"||e.type==="SpecificResource"}const _c=t=>!!t&&typeof t=="object"&&/ImageService[123]|iiif\.io\/api\/image/.test(JSON.stringify(["@context","type","@type","protocol"].map(e=>t[e])));async function qd(t,e,n){try{return await un(t,e,n)}catch(o){if(n!=null&&n.aborted||/\.json([?#]|$)/i.test(e))throw o;try{const r=await un(t,`${e.replace(/\/+$/,"")}/info.json`,n);if(_c(r))return r}catch{}throw o}}const Kd=["summary","metadata","requiredStatement","rights","provider","homepage","seeAlso","rendering","thumbnail","navDate","partOf"];function Zd(t){const e={"@context":Xd,id:t.id,type:"Manifest",label:t.label??{none:[""]},items:[t]};for(const n of Kd)t[n]!==void 0&&n!=="label"&&(e[n]=t[n]);return e}const Bi=t=>{var e,n;return!!t&&((n=(e=t.items)==null?void 0:e[0])==null?void 0:n.id)===t.id},wc=t=>{var e,n;return!!t&&((e=t.items)==null?void 0:e.length)===1&&((n=t.items[0])==null?void 0:n.id)===`${t.id}/canvas`},Gd=/^(oa:)?Annotation(Page|Collection)$/;class or extends Error{constructor(){super(...arguments);L(this,"name","CloverContentError")}}const Xd="http://iiif.io/api/presentation/4/context.json",Yd=t=>/^https?:\/\//i.test(t);async function Ir(t,{request:e,signal:n}){return Array.isArray(t.items)&&t.items.length>0||!t.id?t:await un(e,t.id,n)}const Jd=50;async function fs(t,e){const n=t;if(Array.isArray(n.items)&&n.items.length||!n.first)return t;const o=[],r=new Set;let s=n.first;for(let i=0;s&&i<Jd;i++){const a=typeof s=="string"?{id:s}:s;if(r.has(a.id??a))break;r.add(a.id??a);const c=a.items?a:await un(e.request,a.id,e.signal),l=await je({"@context":c["@context"]??n["@context"],...c,type:"Collection"});o.push(...l.items??[]),s=c.next}return{...n,items:o}}async function xc(t,e={}){return je(await Ir(t,e))}async function Sc(t,e,n=0){for(const o of t.items??[]){if(o.type==="Manifest")return je(await Ir(o,e));if(o.type==="Collection"&&n<8){const r=await fs(await je(await Ir(o,e)),e),s=await Sc(r,e,n+1);if(s)return s}}return null}async function Qd(t,{request:e,signal:n}={}){us();const o=typeof t=="string"?await un(e,t.trim(),n):t,r=await je(o);return r.type==="Collection"?fs(r,{request:e,signal:n}):r}async function kc(t,e={}){var i;const{request:n,signal:o}=e;us();let r=t;if(typeof t=="string"&&(r=Yd(t.trim())?await qd(n,t.trim(),o):(await jd()).decodeContentState(t),!r))throw new or("Unreadable iiifContent");if(Vd(r)&&(e.follows??0)<2){const{follow:a}=await import("./follow-content-DLMLz7-u.mjs");return a(r,e,kc)}if(Gd.test(String((r==null?void 0:r.type)??""))){const{annotationsContent:a}=await import("./annotations-content-yT8J4zoX.mjs");return a(r,e)}if(_c(r)){const{imageServiceContent:a}=await import("./image-service-content-CjRd-2iP.mjs");return a(r,typeof t=="string"?t.trim():void 0)}const s=await je(r);switch((i=o==null?void 0:o.throwIfAborted)==null||i.call(o),s.type){case"Manifest":return{manifest:s};case"Collection":{const a=await fs(s,e),c=e.manifestId,l=c?(a.items??[]).find(u=>u.id===c&&u.type==="Manifest"):void 0,d=l?await xc(l,e):await Sc(a,e);if(!d)throw new or("The Collection holds no Manifest");return{manifest:d,collection:a}}case"Canvas":case"Timeline":case"Scene":return{manifest:Zd(s),target:{canvasId:s.id}};default:throw new or(`Cannot show a ${String(s.type??"resource without a type")}`)}}const Cc=t=>!!(t!=null&&t.id)&&t.type==="AnnotationPage"&&!t.items;function $i(t){const e=[];for(const n of t)for(const o of["items","annotations"])for(const r of n[o]??[])Cc(r)&&e.push([n.id,o,r.id]);return e}async function tf(t,e,n,o){return ef(await un(n,t,o),e)}async function ef(t,e="urn:clover:annotation-page"){var r;const n=t;return bc(n)?n:((r=(await je({"@context":n["@context"]??"http://iiif.io/api/presentation/3/context.json",id:e,type:"Canvas",items:[{...n,"@context":void 0}]})).items)==null?void 0:r[0])??n}function nf(t,e){const n=t,o=e,r=c=>Array.isArray(c)?c:c?[c]:[],s=r(n.partOf),i=r(o.partOf),a=[...s.map(c=>({...i.find(l=>l.id&&l.id===c.id),...c})),...i.filter(c=>!s.some(l=>l.id===c.id))];return{...t,...n.label===void 0&&o.label!==void 0&&{label:o.label},...a.length&&{partOf:a}}}function of(t,e,n,o){let r=false;const s=(t.items??[]).map(i=>{if(i.id!==e||!Array.isArray(i[n]))return i;const a=i[n].map(c=>c.id!==o.id||!Cc(c)?c:(r=true,nf(o,c)));return r?{...i,[n]:a}:i});return r?{...t,items:s}:t}const Fi=/\/search\/([0-2])\//;function hs(t){if(!t)return null;let e=null;for(const n of W(t.service)){const o=(n==null?void 0:n.id)??(n==null?void 0:n["@id"]);if(typeof o!="string")continue;const r=String(n.type??n["@type"]??""),s=[n.profile,n["@context"]].flat().map(a=>String(a??"")).join(" "),i=r==="SearchService2"?2:r==="SearchService1"?1:Fi.test(s)?Number(Fi.exec(s)[1])>=2?2:1:null;if(i===2)return{id:o,version:i};i===1&&(e??(e={id:o,version:i}))}return e}function rf(t){let e=t;const n=new Set;return{get:()=>e,set(o){const r=typeof o=="function"?o(e):o;Object.keys(r).some(i=>!Object.is(r[i],e[i]))&&(e={...e,...r},n.forEach(i=>i()))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function en(t){let e=t;const n=new Set;return{get:()=>e,emit(o){e=o,n.forEach(r=>r(o))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function sf(t,e,n){return{position:e,total:n,hasPrevious:e>0,hasNext:e+1<n,previous:()=>t.previous(),next:()=>t.next(),first:()=>t.first(),last:()=>t.last(),goTo:o=>t.goTo(o)}}const Lr={query:"",status:"idle",hits:[],set:null},Di={status:"idle",error:null,manifest:null,collection:null,throughCollection:false,canvasId:null,target:null,annotationId:null,hiddenSets:[],shownSets:[],addedSets:[],search:Lr,regions:null,targets:null,targetIndex:null};function af(t={}){const e=rf(Di),n=en(null),o=en(null),r=en(null),s=en(null),i=en(null),a=en(null);let c=null,l=null,d=[],u=[],p=[],h=0,m=null,g=null,_=null;const w=(b,I)=>{!g||b===I||(g={...g,items:g.items.map(P=>P.manifestId===b&&P.manifestAs!==I?{...P,manifestAs:I}:P)})},S=b=>{var P;const I=(P=e.get().manifest)==null?void 0:P.id;return!!I&&(I===b.manifestId||I===b.manifestAs)},v=()=>d.length||u.length||p.length?[...d,...u,...p]:Di.addedSets;let y=t.request,x=null;const k=new Set;let N="view",D=0;const j=(b,I,P)=>{if(k.has(P))return;k.add(P);const A=x==null?void 0:x.signal;tf(P,b,y,A).then(B=>{A!=null&&A.aborted||e.set(Z=>Z.manifest?{manifest:of(Z.manifest,b,I,B)}:{})}).catch(()=>k.delete(P))},et=()=>{const{manifest:b,canvasId:I}=e.get();if(b)for(const[P,A,B]of $i(N==="all"||D>0?Bt(b).canvases:We(b,I)))j(P,A,B)};e.subscribe(et);const V=(b,I,P,A,B)=>{var zt,Ht,gt;const{canvases:Z}=Bt(b),E=q=>!!q&&Z.some(ot=>ot.id===q),z=bd(b),K=E(P==null?void 0:P.canvasId)?P:E(z==null?void 0:z.canvasId)?z:null,G=E(A.canvasId)?A.canvasId:(K==null?void 0:K.canvasId)??(E(A.defaultCanvasId)?A.defaultCanvasId:null)??((zt=Z[0])==null?void 0:zt.id)??null;l==null||l.abort();const ht=B&&((Ht=nr(p,B))==null?void 0:Ht.canvasId)===G?B:null,ft=K&&ht?{...K,region:void 0}:K,Rt=++h;d=[],e.set({status:"ready",search:Lr,regions:null,manifest:b,collection:I,canvasId:G,target:ft&&ft.canvasId===G?ft:null,addedSets:v(),annotationId:ht,targets:g});const At=b==null?void 0:b.structures;Array.isArray(At)&&JSON.stringify(At).includes("xywh=")&&import("./range-regions-BY9UB0kS.mjs").then(({contentsSet:q})=>{h===Rt&&e.set({regions:q(b)})}),Pd(b)&&import("./image-layers-zMvi4pmw.mjs").then(({imageLayers:q})=>{h===Rt&&(d=q(b),e.set({addedSets:v()}))}),G&&G!==A.canvasId&&((gt=t.onCanvasChange)==null||gt.call(t,G))},nt=(b,I)=>e.set(P=>{const A=P.hiddenSets.filter(Z=>Z!==b),B=P.shownSets.filter(Z=>Z!==b);return I?{hiddenSets:A,shownSets:[...B,b]}:{hiddenSets:[...A,b],shownSets:B}}),Y=(b,I)=>{var A,B,Z;if(!b)return;if((A=t.isControlled)!=null&&A.call(t)){I&&e.set({target:I}),(B=t.onCanvasChange)==null||B.call(t,b);return}const P=e.get().canvasId!==b;e.set({canvasId:b,target:I}),P&&((Z=t.onCanvasChange)==null||Z.call(t,b))},J=(b,I=false)=>{const{manifest:P}=e.get(),A=yd(P,b);Y(A,A&&I?{canvasId:A,autoplay:I}:null)},M=()=>{const{manifest:b,canvasId:I}=e.get();return{at:$n(b,I),total:Bt(b).views.length}},T=()=>{x==null||x.abort();const b=new AbortController;return x=b,k.clear(),e.set({status:"loading",error:null,annotationId:null}),b.signal},O=b=>e.set({status:"error",error:b instanceof Error?b:new Error(String(b))});async function U(b,I={}){var A;const P=T();try{const B=await kc(b,{request:y,signal:P,manifestId:I.manifestId??void 0});if(P.aborted)return;const Z=B.annotation,E=Z?uc({items:[Z]},`${Z.id}#content-state`):[];p=E.length?[{id:`${Z.id}#content-state`,source:"added",entries:E}]:B.annotationSets??[];const z=m??((A=E[0])==null?void 0:A.id)??B.pick;m=null,e.set({throughCollection:!!B.collection}),g=B.targets??null,g&&w(g.items[0].manifestId,B.manifest.id),e.set({targetIndex:g?0:null}),V(B.manifest,B.collection??null,B.target,I,z)}catch(B){P.aborted||O(B)}}const Q=b=>{const{manifest:I,collection:P}=e.get();return(I==null?void 0:I.id)===b||(P==null?void 0:P.id)===b},at=b=>{var I;return(((I=e.get().collection)==null?void 0:I.items)??[]).find(P=>P.id===b)??{id:b,type:"Manifest"}},ct=(b,I)=>{var P,A;if(m=I,(P=t.isManifestControlled)!=null&&P.call(t)){(A=t.onManifestChange)==null||A.call(t,b);return}mt({id:b,type:"Manifest"}).then(B=>{var Z;return B&&((Z=t.onManifestChange)==null?void 0:Z.call(t,b))})},mt=async(b,I)=>{if(b.type==="Collection")return await U(b.id),e.get().status==="ready";const{collection:P}=e.get(),A=T(),B=m;m=null;const Z=B?nr(p,B):null,E=typeof I=="string"?{canvasId:I}:I??_;_=null;try{const z=await xc(b,{request:y,signal:A});return A.aborted?false:(w(b.id,z.id),V(z,P,Z?{canvasId:Z.canvasId}:E??void 0,{},B),true)}catch(z){return A.aborted||O(z),false}};return{store:e,viewport:n,media:o,captions:r,highlight:s,chapter:i,found:a,get request(){return y},setRequest(b){y=b},load:U,async openCollection(b){var P;const I=e.get().manifest;if(!(!I||((P=e.get().collection)==null?void 0:P.id)===b))try{const A=await Qd(b,{request:y});if(A.type!=="Collection"||e.get().manifest!==I)return;e.set({collection:A})}catch{}},async goToManifest(b,I){var A,B,Z;if(Q(b))return;const P=at(b);if(P.type!=="Collection"&&((A=t.isManifestControlled)!=null&&A.call(t))){(B=t.onManifestChange)==null||B.call(t,b);return}await mt(P,I)&&((Z=t.onManifestChange)==null||Z.call(t,e.get().manifest.id))},goToTarget(b){var A,B,Z;const I=(A=e.get().targets)==null?void 0:A.items[b];if(!I)return;e.set({targetIndex:b});const P=I.canvasId?{canvasId:I.canvasId,...I.region&&{region:I.region},...I.time!==void 0&&{time:I.time}}:null;if(S(I)){P&&Y(P.canvasId,P);return}if((B=t.isManifestControlled)!=null&&B.call(t)){_=P,(Z=t.onManifestChange)==null||Z.call(t,I.manifestId);return}mt(at(I.manifestId),P??void 0).then(E=>{var z;return E&&((z=t.onManifestChange)==null?void 0:z.call(t,I.manifestId))})},async syncManifest(b){!b||Q(b)||e.get().status!=="ready"||await mt(at(b))},goTo(b,I){Y(b,I?{...I,canvasId:b}:null)},next({autoplay:b=false,wrap:I=false}={}){const{at:P,total:A}=M();P+1<A?J(P+1,b):I&&A>1&&J(0,b)},previous(){const{at:b}=M();b>0&&J(b-1)},first(){J(0)},last(){J(M().total-1)},consumeTarget(){e.set({target:null})},syncCanvas(b){b&&e.set({canvasId:b})},selectAnnotation(b){const{manifest:I,addedSets:P,canvasId:A,search:B,regions:Z}=e.get(),E=nr(mc(I,P,B.set,Z),b);if(e.set({annotationId:E?b:null}),!E)return;a.emit(b);const{hiddenSets:z,shownSets:K}=e.get();E.setId!==as&&ls(I,P,z,K).includes(E.setId)&&nt(E.setId,true);const G=We(I,A).some(Rt=>Rt.id===E.canvasId),ht=Ve(I,E.canvasId)!==null;!G&&ht&&Y(E.canvasId,null);const ft=ht?void 0:Fd(E.annotation);ft&&ct(ft,E.id)},async search(b){l==null||l.abort();const I=hs(e.get().manifest),P=b.trim();if(!P||!I){l=null,e.set({search:Lr,annotationId:null});return}const A=new AbortController;l=A,e.set(B=>({search:{...B.search,query:P,status:"loading"}}));try{const{searchInto:B}=await import("./search-CmWgigDq.mjs");await B(e,I,P,y,A.signal)}catch{e.set({search:{query:P,status:"error",hits:[],set:null}})}},setSetVisible(b,I){nt(b,I)},async loadAnnotations(b){if(c==null||c.abort(),!b){u=[],e.set({addedSets:v()});return}const I=new AbortController;c=I;try{const{loadAnnotationSets:P}=await import("./annotation-collection-JyxEZk8B.mjs"),A=await P(b,{request:y,signal:I.signal});if(I.signal.aborted)return;u=A,e.set({addedSets:v()})}catch{}},getContentState(){var G;const{manifest:b,canvasId:I}=e.get();if(!b||!I)return null;const P=n.get(),A=o.get(),B=A&&A.currentTime>0?A.currentTime:null,Z=We(b,I),z=P&&Z.some(ht=>ht.id===P.canvasId)&&!B?P:null,K=(z==null?void 0:z.canvasId)??I;return yc({manifestId:b.id,canvasId:K,type:(G=Z.find(ht=>ht.id===K))==null?void 0:G.type,region:z==null?void 0:z.region,time:B})},setAnnotationPages(b){b!==N&&(N=b,et())},fetchAnnotationPages(b){const{manifest:I}=e.get();if(!I||!b.length)return;const P=new Set(b);for(const[A,B,Z]of $i(Bt(I).canvases))P.has(Z)&&j(A,B,Z)},holdAllAnnotationPages(){D++,et();let b=true;return()=>{b&&D--,b=false}},dispose(){x==null||x.abort(),c==null||c.abort(),l==null||l.abort()}}}const cf=100;function Ec(t,e){const n=R({read:t,onChange:e});n.current={read:t,onChange:e};const o=R(void 0),r=R("");return F(()=>()=>{clearTimeout(o.current),o.current=void 0},[]),ut(()=>{!n.current.onChange||o.current!==void 0||(o.current=setTimeout(()=>{var i,a;o.current=void 0;const s=n.current.read();!s||s.encoded===r.current||(r.current=s.encoded,(a=(i=n.current).onChange)==null||a.call(i,s))},cf))},[])}function Pr(t,e){return t==null||t.addEventListener("pause",e),t==null||t.addEventListener("seeked",e),()=>{t==null||t.removeEventListener("pause",e),t==null||t.removeEventListener("seeked",e)}}function Mc(t,e){const n=Ec(()=>t.getContentState(),e),o=!!e;F(()=>{if(!o)return;let r=t.store.get().canvasId;const s=t.store.subscribe(()=>{const l=t.store.get().canvasId;l!==r&&(r=l,n())}),i=t.viewport.subscribe(n);let a=Pr(t.media.get(),n);const c=t.media.subscribe(l=>{a(),a=Pr(l,n)});return n(),()=>{s(),i(),c(),a()}},[t,o,n])}function ps(t){const e=[];for(const n of W(t==null?void 0:t.items))for(const o of W(n==null?void 0:n.items))if(is(o))for(let r of Eo(o))(r==null?void 0:r.type)==="Choice"&&(r=W(r.items)[0]),(r==null?void 0:r.type)==="SpecificResource"&&(r=typeof r.source=="string"?{id:r.source}:r.source),r&&e.push({body:r,annotation:o});return e}function lf(t){return t.flatMap(e=>ps(e).map(({body:n})=>n))}function uf(t,e){if(!(t!=null&&t.length)||!e.canvases.length)return null;const n=e.canvases.map(r=>r.id),o=e.bodies.map(r=>r==null?void 0:r.format).filter(Boolean);return t.find(r=>{var s,i,a;return((s=r.canvasId)==null?void 0:s.some(c=>n.includes(c)))||((i=r.format)==null?void 0:i.some(c=>o.includes(c)))||!!((a=r.match)!=null&&a.call(r,e))})??null}function df(t,e){return t===e?true:!t||!e||t.length!==e.length?false:t.every((n,o)=>n.component===e[o].component&&n.match===e[o].match&&JSON.stringify([n.canvasId,n.format])===JSON.stringify([e[o].canvasId,e[o].format]))}function ff({iiifContent:t,canvasId:e,defaultCanvasId:n,onCanvasChange:o,onStatusChange:r,manifestId:s,defaultManifestId:i,onManifestChange:a,searchQuery:c,request:l,language:d,renderers:u,annotations:p,annotationPages:h="view",onContentStateChange:m,...g}){const _=e!==void 0,w=s!==void 0,S=R({controlled:_,manifestControlled:w,onCanvasChange:o,onStatusChange:r,onManifestChange:a});S.current={controlled:_,manifestControlled:w,onCanvasChange:o,onStatusChange:r,onManifestChange:a};const[v]=H(()=>af({request:l,onCanvasChange:z=>{var K,G;return(G=(K=S.current).onCanvasChange)==null?void 0:G.call(K,z)},onManifestChange:z=>{var K,G;return(G=(K=S.current).onManifestChange)==null?void 0:G.call(K,z)},isControlled:()=>S.current.controlled,isManifestControlled:()=>S.current.manifestControlled}));v.setRequest(l);const y=R({});y.current={canvasId:e,defaultCanvasId:n,manifestId:s??i};const x=Wd(l),k=R(t);k.current=t;const N=mf(t);F(()=>(v.load(k.current,y.current),()=>v.dispose()),[v,N,x]),F(()=>{_&&v.syncCanvas(e??null)},[v,_,e]);const[D,j]=H(v.store.get().status);F(()=>{let z=v.store.get().status;return v.store.subscribe(()=>{var ht,ft;const{status:K,error:G}=v.store.get();K!==z&&(z=K,j(K),(ft=(ht=S.current).onStatusChange)==null||ft.call(ht,K,G))})},[v]);const et=R(p);et.current=p;const V=pf(p);F(()=>{v.loadAnnotations(et.current??null)},[v,V,x]),F(()=>{v.setAnnotationPages(h)},[v,h]),Mc(v,m),F(()=>{w&&D==="ready"&&v.syncManifest(s??null)},[v,w,s,D]);const nt=hf(v,z=>{var K;return z.status==="ready"?((K=z.manifest)==null?void 0:K.id)??null:null});F(()=>{c&&nt&&v.search(c)},[v,c,nt]);const Y=R(u);df(Y.current,u)||(Y.current=u);const J=Y.current,[M,T]=H(),[O,U]=H(d);O!==d&&(U(d),T(void 0));const Q=R(void 0),[at,ct]=H(N);at!==N&&(ct(N),T(void 0)),F(()=>()=>{const z=Q.current;Q.current=void 0,z&&Tt.chosenLanguage===z&&Tt.chooseInterfaceLanguage()},[N]);const mt=ee(Tt.subscribe,()=>Tt.chosenLanguage),b=M??d??mt,I=ut(z=>{T(z);const K=Tt.stringsFor(z);Q.current=K,K&&Tt.chooseInterfaceLanguage(K)},[]),[P,A]=H(0),B=ut(()=>(A(z=>z+1),()=>A(z=>z-1)),[]),Z=P>0;return[bt(()=>({clover:v,language:b,renderers:J,chooseLanguage:I,toggleDrawn:Z,drawsToggle:B}),[v,b,J,I,Z,B]),D,g]}function hf(t,e){return ee(t.store.subscribe,()=>e(t.store.get()))}function pf(t){const e=Array.isArray(t)?t:t?[t]:[];return JSON.stringify(e.map(n=>typeof n=="string"?n:(n==null?void 0:n.id)??"object"))}function mf(t){return typeof t=="string"?t:t.id??t["@id"]??t}const gf=ie(function({as:e="div",className:n,children:o,highContrast:r,...s},i){const[a,c,l]=ff(s),d=Co(i,l.lang),u=Jr(r);return f(xo.Provider,{value:a,children:f(Nn.Provider,{value:d.hostLanguage,children:f(e,{ref:d.ref,className:It("clover-root",n),"data-status":c,...Qr(u),...l,children:[o,f(Ed,{clover:a.clover,language:a.language})]})})})}),vf=()=>f("path",{fillRule:"evenodd",stroke:"none",d:"M144 72H368A96 96 0 0 1 464 168V296A96 96 0 0 1 368 392H200L104 460L144 392A96 96 0 0 1 48 296V168A96 96 0 0 1 144 72Z M168 184H344A16 16 0 0 1 344 216H168A16 16 0 0 1 168 184Z M168 264H280A16 16 0 0 1 280 296H168A16 16 0 0 1 168 264Z"}),yf=()=>f(Ct,{children:[f("path",{d:"M160 144h288M160 256h288M160 368h288",fill:"none",strokeLinecap:"round",strokeWidth:"32"}),f("circle",{cx:"80",cy:"144",r:"20",stroke:"none"}),f("circle",{cx:"80",cy:"256",r:"20",stroke:"none"}),f("circle",{cx:"80",cy:"368",r:"20",stroke:"none"})]}),bf=()=>f("path",{stroke:"none",d:"M256 72A48 48 0 1 1 256 168A48 48 0 1 1 256 72Z M192 216H296V384H328V432H184V384H216V264H192Z"}),_f=()=>f("path",{fillRule:"evenodd",stroke:"none",d:"M256 40C166 40 100 108 100 196C100 300 216 420 246 452A14 14 0 0 0 266 452C296 420 412 300 412 196C412 108 346 40 256 40Z M256 136A60 60 0 1 1 256 256A60 60 0 1 1 256 136Z"}),hy=()=>f("path",{strokeLinejoin:"round",strokeWidth:"40",d:"M184 128V384L392 256Z"}),Tc=()=>f("path",{strokeLinecap:"round",strokeWidth:"45",d:"M154 154L358 358M358 154L154 358"}),py=()=>f(Ct,{children:[f("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),f("path",{stroke:"none",d:"m279.5,197.76h-3.35s-28.47,0-28.47,0v-31.82c-.77-13.79-12.57-24.33-26.36-23.56-12.71.71-22.85,10.86-23.56,23.56v3.35h0v28.47h-31.82c-13.79.77-24.33,12.57-23.56,26.36.71,12.71,10.86,22.85,23.56,23.56h3.35s28.47,0,28.47,0v31.82c.77,13.79,12.57,24.33,26.36,23.56,12.71-.71,22.85-10.86,23.56-23.56v-3.35h0v-28.47h31.82c13.79-.77,24.33-12.57,23.56-26.36-.71-12.71-10.86-22.85-23.56-23.56Z"})]}),my=()=>f(Ct,{children:[f("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),f("path",{stroke:"none",d:"M167.26 197.76H278.1a24.96 24.96 0 0 1 0 49.92H167.26a24.96 24.96 0 0 1 0-49.92Z"})]}),te={zoomIn:{keys:"Plus",glyph:"+"},zoomOut:{keys:"-",glyph:"\u2212"},reset:{keys:"0",glyph:"0"},rotateRight:{keys:"R",glyph:"R"},rotateLeft:{keys:"Shift+R",glyph:"\u21E7R"},play:{keys:"K Space",glyph:"K"},mute:{keys:"M",glyph:"M"}},wf=new Set(["+","=","-","_","0","r","R","k","K","m","M","j","J","l","L"]);function qe({label:t,lang:e,shortcut:n,scrolls:o=false,image:r,lead:s,after:i}){const{t:a}=Et(),c=R(null),l=n?a("controlShortcut",{label:t,shortcut:n.glyph}):t;return Sf(),F(()=>{const d=c.current;d&&Ar(d)&&ho(d)},[l,s]),f("span",{ref:c,className:"clover-tip","aria-hidden":"true",...dt(e),...o&&{tabIndex:-1,onMouseDown:d=>{var u;d.preventDefault(),(u=d.currentTarget.parentElement)==null||u.focus({preventScroll:true})}},children:[r&&f("img",{className:"clover-tip-image",src:r,alt:"",loading:"lazy",onLoad:()=>{const d=c.current;d&&Ar(d)&&ho(d)}}),s&&f("span",{className:"clover-tip-lead",children:s}),l,i!=null&&i!==false&&f("span",{className:"clover-tip-after",children:i})]})}function so(t){const e=t.target instanceof Element&&ms(t.target),n=e&&Mo(e);n&&ho(n)}function gy(t){const e=Mo(ms(t));e&&Ar(e)&&ho(e)}function Mo(t){return Array.from(t.children).find(e=>e.classList.contains("clover-tip"))}function ms(t){const e=t.matches("input")?t.parentElement:null;return e&&Mo(e)?e:t}function Ar(t){var e;try{return!!((e=t.parentElement)!=null&&e.matches(":hover, :focus-visible, :has(> input:focus-visible)"))}catch{return false}}function ho(t){const e=t.parentElement;if(!e)return;t.style.removeProperty("--clover-tip-room"),t.style.removeProperty("--clover-tip-shift");const n=xf(e),o=parseFloat(getComputedStyle(t).paddingLeft)||0,r=n.left+o,s=n.right-o,i=e.getBoundingClientRect();let a=t.getBoundingClientRect();const c=a.right<=i.left?a.right-r:a.left>=i.right?s-a.left:s-r;a.width>c&&(t.style.setProperty("--clover-tip-room",`${Math.max(c,0)}px`),a=t.getBoundingClientRect());const l=a.left<r?r-a.left:a.right>s?s-a.right:0;l&&t.style.setProperty("--clover-tip-shift",`${l}px`)}function xf(t){let e=0,n=document.documentElement.clientWidth||window.innerWidth;for(let o=t.parentElement;o&&o!==document.documentElement;o=o.parentElement){const{display:r,overflow:s,overflowX:i}=getComputedStyle(o);if(r==="inline"||r==="contents")continue;const a=i||s;if(!a||a==="visible")continue;const c=o.getBoundingClientRect();e=Math.max(e,c.left+o.clientLeft),n=Math.min(n,c.left+o.clientLeft+o.clientWidth)}return{left:e,right:n}}let zi=0;function Hi(t){if(t.key!=="Escape"||t.defaultPrevented)return;const e=new Set;document.querySelectorAll(":hover > .clover-tip").forEach(r=>r.parentElement&&e.add(r.parentElement));const n=document.activeElement,o=n&&ms(n);o&&Mo(o)&&e.add(o),e.forEach(r=>Ic(r,"tipHidden",["pointerenter","focusout"]))}function Ic(t,e,n){t.dataset[e]="";const o=()=>{delete t.dataset[e],n.forEach(r=>t.removeEventListener(r,o))};n.forEach(r=>t.addEventListener(r,o))}function Sf(){F(()=>(zi++===0&&(document.addEventListener("keydown",Hi,true),document.addEventListener("pointerenter",so,true),document.addEventListener("focus",so,true)),()=>{--zi||(document.removeEventListener("keydown",Hi,true),document.removeEventListener("pointerenter",so,true),document.removeEventListener("focus",so,true))}),[])}function kf(t,e){const n=t.target;!e||n===e||e.contains(n)&&!n.closest(".clover-canvas-overlays")||wf.has(t.key)&&(t.altKey||t.metaKey||t.ctrlKey||n.closest("input, select, textarea, [contenteditable]")||(t.preventDefault(),e.dispatchEvent(new KeyboardEvent("keydown",{key:t.key,shiftKey:t.shiftKey,bubbles:true,cancelable:true}))))}const He=({className:t,id:e,label:n,children:o,onClick:r,expanded:s,controls:i,shortcut:a,lang:c,unavailable:l,side:d})=>{const p=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return f("button",{id:e,className:It("clover-canvas-button",t),"data-testid":"clover-canvas-button","data-button":p,"data-side":d,onClick:r,"aria-disabled":l||void 0,"aria-expanded":s,"aria-controls":i,"aria-label":n,"aria-keyshortcuts":a==null?void 0:a.keys,...dt(c),type:"button",children:[f("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:o}),f(qe,{label:n,shortcut:a})]})},Cf=he("");function pe(){return jt(Cf)+Gr()}const rr=new Map;function Ef(t,e){const n=pe(),o=R(e);o.current=e,F(()=>t?Mf(n,o):void 0,[t,n])}function Mf(t,e){for(const[n,o]of[...rr])n!==t&&o.current();return rr.set(t,e),()=>{rr.delete(t)}}const Tf=vt(()=>import("./CaptionDetails-B_fCdkw6.mjs"));function If(t){var e;return!!t.summary||!!((e=t.metadata)!=null&&e.length)}const Lc=(t,e)=>`${t}-label-${e}`,Lf=({id:t,canvases:e,comments:n,open:o,onClose:r,language:s})=>{const{t:i,langOf:a}=Et(),c=R(null),[l,d]=H(o);return o&&!l&&d(true),Ef(o,()=>r(false)),F(()=>{var u;o&&((u=c.current)==null||u.focus())},[o]),f("figcaption",{className:"clover-canvas-caption","data-open":o,"data-testid":"clover-canvas-caption",id:t,onKeyDown:u=>{u.key!=="Escape"||u.defaultPrevented||(u.preventDefault(),u.stopPropagation(),r(true))},ref:c,tabIndex:-1,children:[f(He,{className:"clover-canvas-caption-close",id:`close-${t}`,label:i("commonClose"),lang:a("commonClose"),onClick:()=>r(true),children:f(Tc,{})}),e.map((u,p)=>{const h=wt(u.label,s);return f("section",{className:"clover-canvas-caption-canvas",children:[h.text&&f("p",{className:"clover-canvas-caption-label",id:Lc(t,p),...dt(h.lang),children:h.text}),l&&f(St,{fallback:null,children:f(Tf,{summary:u.summary,metadata:u.metadata,comments:n==null?void 0:n.get(u.id),language:s})})]},u.id)})]})},Pf=()=>f("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M256 112v288M400 256H112"}),Af=()=>f("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 256H112"}),Of=()=>f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"}),Nf=()=>f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M304 416v-112h112M405.77 405.77L304 304M208 96v112H96M106.23 106.23L208 208M416 208H304V96M405.77 106.23L304 208M96 304h112v112M106.23 405.77L208 304"}),Rf=()=>f("path",{d:"M448 440a16 16 0 01-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 01-27 11.57l-176-168a16 16 0 010-23.14l176-168A16 16 0 01256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 01-16 16z"}),Wi=()=>f(Ct,{children:[f("path",{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"}),f("path",{d:"M464 97.42V208a16 16 0 01-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"})]}),Bf=()=>f(Ct,{children:[f("path",{fill:"none",strokeLinecap:"round",strokeWidth:"64",d:"M112 144h0M112 256h0M112 368h0"}),f("path",{fill:"none",strokeLinecap:"round",strokeWidth:"40",d:"M208 144h208M208 256h208M208 368h208"})]}),$f=({children:t,label:e})=>f("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512",fill:"currentColor",stroke:"currentColor",focusable:"false","aria-hidden":"true",role:"presentation","data-testid":"clover-canvas-button-svg","data-label":e,children:t}),Ff=112,Df=128;function zf(t){Ut(()=>{const e=t==null?void 0:t.closest(".clover-canvas");if(!t||!e)return;const n=(s=false)=>{let i=t.offsetWidth,a=0;for(const h of s?[]:Array.from(t.children))!(h instanceof HTMLElement)||!h.offsetParent||(i=Math.min(i,h.offsetLeft),a=Math.max(a,h.offsetTop+h.offsetHeight));const c={width:t.offsetWidth-i,height:a};for(const[h,m]of Object.entries(c)){const g=`--clover-canvas-controls-${h}`;a?e.style.setProperty(g,`${m}px`):e.style.removeProperty(g)}const l=t.offsetTop,d=e.querySelector(":scope > .clover-canvas-media > .clover-canvas-transport"),u=e.clientHeight-2*l-c.height-((d==null?void 0:d.offsetHeight)??0),p=t.offsetLeft+i-l;a&&u<Ff&&p>=Df?e.dataset.popups="beside":delete e.dataset.popups};n();const o=new ResizeObserver(()=>n());o.observe(t),o.observe(e);const r=new MutationObserver(()=>n());return r.observe(t,{childList:true}),r.observe(e,{childList:true}),()=>{o.disconnect(),r.disconnect(),n(true)}},[t])}const To=()=>{if(typeof document>"u")return null;const t=document;return t.fullscreenElement??t.webkitFullscreenElement??null},Pc=()=>{if(typeof document>"u")return false;const t=document;return!!(t.fullscreenEnabled??t.webkitFullscreenEnabled)},Ac=t=>{const e=t==null?void 0:t.closest(".clover-root"),n=t==null?void 0:t.closest("dialog");return e&&!(n&&e.contains(n))?e:(t==null?void 0:t.closest(".clover-canvas"))??null},Hf=(t,e)=>{if(typeof t.webkitEnterFullscreen!="function")return;const n=e.closest(".clover-canvas"),o=!t.isConnected&&!!n;if(o&&n){const s=t.getAttribute("style");t.style.cssText="position:absolute;inset:0;z-index:-1;width:100%;height:100%;object-fit:contain;pointer-events:none",n.prepend(t),t.addEventListener("webkitendfullscreen",()=>{t.remove(),s===null?t.removeAttribute("style"):t.setAttribute("style",s)},{once:true})}const r=()=>{var s;try{(s=t.webkitEnterFullscreen)==null||s.call(t)}catch{}};o?requestAnimationFrame(r):r()},Oc=async(t,e)=>{var o,r,s,i;const n=Ac(t);if(n)try{if(To()){const c=document;await(((o=c.exitFullscreen)==null?void 0:o.call(c))??((r=c.webkitExitFullscreen)==null?void 0:r.call(c)));return}if(!Pc()){e&&t&&Hf(e,t);return}const a=n;await(((s=a.requestFullscreen)==null?void 0:s.call(a))??((i=a.webkitRequestFullscreen)==null?void 0:i.call(a)))}catch{}};function gs(t){const[e,n]=H(false);return F(()=>{if(!t)return;const o=()=>{var r;return n(!!((r=To())!=null&&r.contains(t)))};return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}function Wf({key:t,id:e,label:n,glyph:o,onClick:r,expanded:s,controls:i,shortcut:a,lang:c,unavailable:l},d){const u=d==null?void 0:d[t];return u?f(u,{buttonProps:{id:e,type:"button","aria-label":n,...c&&{lang:c},...a&&{"aria-keyshortcuts":a.keys},onClick:l?void 0:r,...l&&{"aria-disabled":true},...s!==void 0&&{"aria-expanded":s,"aria-controls":i}},icon:f($f,{label:n,children:o}),label:n,tip:f(qe,{label:n,shortcut:a})},t):f(He,{id:e,label:n,onClick:l?void 0:r,unavailable:l,expanded:s,controls:i,shortcut:a,lang:c,children:o},t)}const Uf=({fit:t=false,clusterRef:e,children:n})=>{const[o,r]=H(null),s=gs(o);zf(o);const i=ut(a=>{r(a),e==null||e(a)},[e]);return f("div",{className:"clover-canvas-controls","data-fit":t||void 0,"data-fullscreen":s,"data-testid":"clover-canvas-controls",ref:i,children:n})},jf=()=>()=>{};function Vf(){return ee(jf,Pc)}const Ui=new WeakMap;function on(t,e){const[n,o]=H(()=>Ui.get(t)??null);return F(()=>{if(!e||n)return;let r=true;return t().then(s=>{Ui.set(t,s),r&&o(()=>s)},()=>{}),()=>{r=false}},[t,e,n]),n}function qf(t,e,n){return t.reduce((o,r)=>o+r+n,-n)<=e}function Kf(t,e,n){const o=t.ownerDocument,r=i=>i instanceof HTMLElement&&t.contains(i)&&!i.closest("[hidden]"),s=[o.getElementById(e),o.getElementById(n),...Array.from(t.querySelectorAll("button"))].find(r);s==null||s.focus()}function Zf({cluster:t,ids:e,more:n,fits:o,settled:r,onFits:s}){const i=R(o);i.current=o;const a=R(s);a.current=s;const c=R(new Map),l=R(e);l.current=e;const d=R(null),u=e.join(" ");return Ut(()=>{const p=t.ownerDocument,h=()=>{var N;const _=l.current,w=getComputedStyle(t),S=parseFloat(w.columnGap)||0;let v=t.clientWidth-(parseFloat(w.paddingLeft)||0)-(parseFloat(w.paddingRight)||0),y=0;for(const D of _){const j=(N=p.getElementById(D))==null?void 0:N.offsetWidth;j&&c.current.set(D,j),y=Math.max(y,c.current.get(D)??0)}for(const D of Array.from(t.children))!(D instanceof HTMLElement)||_.includes(D.id)||D.id===n||D.classList.contains("clover-canvas-more")||!D.offsetWidth||getComputedStyle(D).position==="absolute"||(v-=D.offsetWidth+S);const x=qf(_.map(D=>c.current.get(D)??y),v,S);if(x===i.current)return;const k=p.activeElement;d.current=k instanceof HTMLElement&&t.contains(k)?k.id:null,i.current=x,a.current(x)};h();const m=new ResizeObserver(()=>h());m.observe(t);const g=new MutationObserver(()=>h());return g.observe(t,{childList:true}),()=>{m.disconnect(),g.disconnect()}},[t,u,n]),Ut(()=>{if(!r)return;const p=d.current;if(d.current=null,p===null)return;const h=t.ownerDocument.activeElement;(!h||!t.contains(h)||h.closest("[hidden]"))&&Kf(t,p,n)},[o,r,t,n]),null}const Gf=()=>import("./AnnotationMenu-C0d0lTcC.mjs"),Xf=()=>import("./ChaptersMenu-BB97eRTx.mjs"),Yf=()=>import("./ChoiceMenu-BtDTvEbQ.mjs"),Jf=()=>import("./ImageControls-rNkvWCA9.mjs"),ji=2,Qf=new Set(["zoomIn","zoomOut","rotateRight","rotateLeft","reset","fullPage"]),Nc={atMax:false,atMin:false,atHome:false},th=({renderer:t,instance:e,config:n,controlButtons:o,limits:r=Nc,placeholder:s,placeholderIsMore:i=false,choices:a=[],selections:c={},onSelect:l,annotations:d=[],chapters:u=[],mediaElement:p=null,onChapter:h,overStill:m,request:g,hiddenPages:_,onPageVisibilityChange:w,selectedAnnotation:S=null,onAnnotationSelect:v,onAnnotationActivate:y,captionId:x,captionOpen:k=false,onCaptionToggle:N,placeId:D,placeOpen:j=false,onPlaceToggle:et,language:V,fit:nt=true,more:Y="auto",children:J})=>{var Vn,qn,$e,yn;const{t:M,langOf:T}=Et(),[O,U]=H(false),[Q,at]=H(false),ct=`annotations-${e}`,mt=`${ct}-menu`,b=M("informationPanelTabsAnnotations"),I=T("informationPanelTabsAnnotations"),P=ut(X=>{var pt;at(false),y==null||y(null),X&&((pt=document.getElementById(ct))==null||pt.focus())},[ct,y]),A=n.annotations&&d.length>0&&v,[B,Z]=H(false),E=`chapters-${e}`,z=`${E}-menu`,K=u.length>0&&!!h,G=R(false),ht=R(null);F(()=>{const X=()=>{var pt;G.current=((pt=document.activeElement)==null?void 0:pt.id)===E};return document.addEventListener("focusin",X),()=>document.removeEventListener("focusin",X)},[E]);const ft=ut(()=>{var pt,ke;if(!G.current)return;G.current=false;const X=document.activeElement;X&&X!==document.body||(ke=(pt=ht.current)==null?void 0:pt.querySelector('.clover-canvas-transport :is([data-button="play"], [data-button="pause"])'))==null||ke.focus()},[]);F(()=>{K||ft()},[K,ft]),F(()=>()=>ft(),[ft]);const Rt=ut(X=>{var pt;Z(false),X&&((pt=document.getElementById(E))==null||pt.focus())},[E]),At=n.information&&x&&N,zt=n.map&&D&&et,Ht=`choice-${e}`,gt=a.length===1?wt(a[0].label,V):null,q=(gt==null?void 0:gt.text)||M("canvasChoice"),ot=gt!=null&&gt.text?gt.lang:T("canvasChoice"),_t=`${Ht}-menu`,Ft=(Vn=on(Gf,!!A))==null?void 0:Vn.default,$=(qn=on(Xf,K))==null?void 0:qn.default,lt=($e=on(Yf,a.length>0&&!!l))==null?void 0:$e.default,Ot=ut(X=>{var pt;U(false),X&&((pt=document.getElementById(Ht))==null||pt.focus())},[Ht]),Ke=Vf(),[Gt,Ze]=H(null);F(()=>{ht.current=(Gt==null?void 0:Gt.closest(".clover-canvas"))??null},[Gt]);const Ge=gs(Gt),[me,Re]=H(false),Hn=X=>f(He,{className:X,id:ct,label:b,lang:I,onClick:()=>at(pt=>!pt),expanded:Q,controls:mt,children:f(vf,{})},"annotations"),Wn=(()=>{const X=[],pt=t;return n.zoom&&pt&&X.push({key:"zoomIn",id:`zoomIn-${e}`,shortcut:te.zoomIn,label:M("imageZoomIn"),lang:T("imageZoomIn"),glyph:f(Pf,{}),unavailable:r.atMax,onClick:()=>pt.zoomBy(ji)},{key:"zoomOut",id:`zoomOut-${e}`,shortcut:te.zoomOut,label:M("imageZoomOut"),lang:T("imageZoomOut"),glyph:f(Af,{}),unavailable:r.atMin,onClick:()=>pt.zoomBy(1/ji)}),n.fullPage&&Ke&&X.push({key:"fullPage",id:`fullPage-${e}`,label:M(Ge?"imageExitFullScreen":"imageFullScreen"),lang:T(Ge?"imageExitFullScreen":"imageFullScreen"),glyph:Ge?f(Nf,{}):f(Of,{}),onClick:ke=>void Oc(ke.currentTarget)}),n.rotation&&pt&&X.push({key:"rotateRight",id:`rotateRight-${e}`,shortcut:te.rotateRight,label:M("imageRotateRight"),lang:T("imageRotateRight"),glyph:f(Wi,{}),onClick:()=>pt.rotateBy(90)},{key:"rotateLeft",id:`rotateLeft-${e}`,shortcut:te.rotateLeft,label:M("imageRotateLeft"),lang:T("imageRotateLeft"),glyph:f(Wi,{}),onClick:()=>pt.rotateBy(-90)}),n.reset&&pt&&X.push({key:"reset",id:`reset-${e}`,shortcut:te.reset,label:M("imageResetZoom"),lang:T("imageResetZoom"),glyph:f(Rf,{}),unavailable:r.atHome,onClick:()=>pt.home()}),a.length&&X.push({key:"choice",id:Ht,label:q,lang:ot,glyph:f(Bf,{}),onClick:()=>U(ke=>!ke),expanded:O,controls:_t}),X})(),ne=[...Wn.filter(X=>X.key!=="fullPage"),...Wn.filter(X=>X.key==="fullPage")].map(X=>({id:X.id,view:Qf.has(X.key),node:Wf(X,o)})),mn=[zt&&{id:`place-${e}`,view:false,node:f(He,{id:`place-${e}`,label:M("mapLabel"),lang:T("mapLabel"),onClick:et,expanded:j,controls:D,children:f(_f,{})},"place")},K&&{id:E,view:false,node:f(He,{id:E,label:M("playerChapters"),lang:T("playerChapters"),onClick:()=>Z(X=>!X),expanded:B,controls:z,children:f(yf,{})},"chapters")},A&&{id:ct,view:false,node:Hn()},At&&{id:`information-${e}`,view:false,node:f(He,{id:`information-${e}`,label:M("informationPanelTabsAbout"),lang:T("informationPanelTabsAbout"),onClick:N,expanded:k,controls:x,children:f(bf,{})},"information")},!!s&&{id:`placeholder-${e}`,view:false,node:f(ue.Fragment,{children:s},"placeholder")}].filter(X=>!!X),Un=mn.filter(X=>X.id===`placeholder-${e}`),Vt=[...ne.filter(X=>X.view),...Un],gn=[...ne.filter(X=>!X.view),...mn.filter(X=>!Un.includes(X))],oe=[...Vt,...gn],[Be,Ro]=H(true),vn=Y==="always"||i,Lt=(yn=on(Jf,nt&&(i||(vn||!Be)&&oe.some(X=>X.view))))==null?void 0:yn.ImageControls,qt=Be&&!vn||!Lt?[]:oe.filter(X=>X.view),Se=i&&!!s&&!!Lt;F(()=>{qt.length||Re(false)},[qt.length]);const jn=X=>X.filter(pt=>!qt.includes(pt)&&!(Se&&pt.id===`placeholder-${e}`)).map(({node:pt})=>pt);return f(Ct,{children:[f(Uf,{fit:nt,clusterRef:Ze,children:[jn(Vt),Lt&&(qt.length>0||Se)&&f(Lt,{instance:e,open:Se?qt.length>0:me,onOpenChange:Re,toggle:Se?s:void 0,children:qt.map(({node:X})=>X)}),jn(gn),J]}),nt&&!vn&&Gt&&f(Zf,{cluster:Gt,ids:oe.map(({id:X})=>X),more:`more-${e}`,fits:Be,settled:Be||qt.length>0||!oe.some(X=>X.view),onFits:Ro}),$&&B&&K&&f($,{id:z,triggerId:E,label:M("playerChapters"),labelLang:T("playerChapters"),chapters:u,element:p,onChapter:h,overStill:m,request:g,onClose:Rt}),Ft&&Q&&A&&f(Ft,{id:mt,triggerId:ct,label:b,labelLang:I,annotations:d,hiddenPages:_,onPageVisibilityChange:w,selected:S,onSelect:v,onActivate:X=>y==null?void 0:y(X),onClose:P}),lt&&O&&a.length>0&&l&&f(lt,{id:_t,triggerId:Ht,label:q,labelLang:ot,language:V,choices:a,selections:c,onSelect:l,onClose:Ot})]})},eh=["jpg","png","webp","gif"];class Or extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageServiceError"}}function vs(t){return t.replace(/\/info\.json$/,"").replace(/\/+$/,"")}function Io(t){const e=Array.isArray(t)?t:t?[t]:[];for(const n of e){if(!n||typeof n!="object")continue;const o=n,r=String(o.type??o["@type"]??""),s=JSON.stringify(o.profile??""),i=/ImageService/i.test(r)||/iiif\.io\/api\/image/.test(s)||/^"level[012]"$/.test(s)||!r&&!o.profile,a=o["@id"]??o.id;if(i&&typeof a=="string")return vs(a)}}function nh(t,e){if(!t||typeof t!="object")throw new Or("info.json is not an object",e??"");const n=t,o=oh(n),r=o===3?n.id??n["@id"]:n["@id"]??n.id,s=vs(r??e??""),i=Number(n.width),a=Number(n.height);if(!s||!(i>0)||!(a>0))throw new Or("info.json is missing id, width or height",e??s);const c=Array.isArray(n.profile)?n.profile:[n.profile],l=c.find(S=>typeof S=="string"),d=c.filter(S=>!!S&&typeof S=="object"),u=rh(l),p=new Set([...Array.isArray(n.extraFeatures)?n.extraFeatures:[],...d.flatMap(S=>Array.isArray(S.supports)?S.supports:[])]),m=[...Array.isArray(n.preferredFormats)?n.preferredFormats:[]].map(S=>String(S).toLowerCase()).find(S=>eh.includes(S))??"jpg",g=S=>{var y;const v=n[S]??((y=d.find(x=>x[S]!==void 0))==null?void 0:y[S]);return Number(v)>0?Number(v):void 0};let _=g("maxWidth"),w=g("maxHeight");return _&&!w&&(w=_),w&&!_&&(_=void 0),{id:s,version:o,level:u,width:i,height:a,tiles:sh(n.tiles),sizes:ih(n.sizes),maxWidth:_,maxHeight:w,maxArea:g("maxArea"),regionByPx:u>=1||p.has("regionByPx"),sizeByW:u>=1||p.has("sizeByW")||p.has("sizeByWh"),format:m,quality:"default"}}function oh(t){const e=[].concat(t["@context"]??[]).map(String);return e.some(n=>n.includes("/image/3"))?3:e.some(n=>n.includes("/image/2"))?2:t.type==="ImageService3"?3:t["@id"]?2:3}function rh(t){const e=t==null?void 0:t.match(/level([012])/);return e?Number(e[1]):0}function sh(t){return Array.isArray(t)?t.map(e=>{const n=Number(e==null?void 0:e.width),o=Number((e==null?void 0:e.height)??(e==null?void 0:e.width)),r=(Array.isArray(e==null?void 0:e.scaleFactors)?e.scaleFactors:[1]).map(Number).filter(s=>s>0).sort((s,i)=>s-i);return{width:n,height:o,scaleFactors:r}}).filter(e=>e.width>0&&e.height>0&&e.scaleFactors.length):[]}function ih(t){return Array.isArray(t)?t.map(e=>({width:Number(e==null?void 0:e.width),height:Number(e==null?void 0:e.height)})).filter(e=>e.width>0&&e.height>0).sort((e,n)=>e.width-n.width):[]}function po(t,e,n,o,r=t.quality){const s=e.x===0&&e.y===0&&e.width===t.width&&e.height===t.height,i=s?"full":`${e.x},${e.y},${e.width},${e.height}`,a=s&&n===t.width&&o===t.height;let c;return t.version===3?c=a?"max":`${n},${o}`:c=a?"full":`${n},`,`${t.id}/${i}/${c}/0/${r}.${t.format}`}function ah(t){return t.version===2&&t.level===0?"native":void 0}const sr=new Map;function ys(t,{request:e}={}){const n=vs(t),o=sr.get(n);if(o)return o;const r=`${n}/info.json`,s=ds(e,r,{headers:{Accept:"application/ld+json, application/json"}}).then(async i=>{if(!i.ok)throw new Or(`info.json request failed with ${i.status}`,r,i.status);return nh(await i.json(),n)}).catch(i=>{throw sr.delete(n),i});return sr.set(n,s),s}function ch(t){const e=Math.max(0,Math.floor(t||0)),n=Math.floor(e/3600),o=Math.floor(e%3600/60),r=String(e%60).padStart(2,"0");return n?`${n}:${String(o).padStart(2,"0")}:${r}`:`${o}:${r}`}function vy(t,e){var n;if(t.currentTime=e,!!t.paused)try{(n=t.play())==null||n.catch(()=>{})}catch{}}function bs(t){if(!t)return;const[e,n]=t.split(","),o=Number(e);if(e===""||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}}const lh=(t,e,n,o,r)=>`${t}|${e??`${n}:${o}`}|${r}`,uh=/^((application|audio|video)\/)?(vnd\.apple\.|x-)?mpegurl$/i,dh=(t,e)=>!!(t&&/\.m3u8$/i.test(t.split(/[?#]/)[0]))||!!(e&&uh.test(e)),fh={width:1600,height:900};function hh(t,e){const n=new Array(t.length);if(!t.length)return n;const o=t.map(dn),r=e==="left-to-right"||e==="right-to-left",s=e==="right-to-left"||e==="bottom-to-top",i=r?o[0].height:o[0].width,a=t.map((l,d)=>d);s&&a.reverse();let c=0;for(const l of a){const d=o[l],u=i/(r?d.height:d.width),p=d.width*u,h=d.height*u;n[l]=r?{x:c,y:0,width:p,height:h}:{x:0,y:c,width:p,height:h},c+=r?p:h}return n}function dn(t){var s,i;if(t.width&&t.height)return{width:t.width,height:t.height};const e=Rc(t);if(e!=null&&e.width&&e.height)return{width:e.width,height:e.height};const n=((s=mo(t)[0])==null?void 0:s.body)??((i=go(t)[0])==null?void 0:i.body),o=Number(n==null?void 0:n.width),r=Number(n==null?void 0:n.height);return o>0&&r>0?{width:o,height:r}:fh}function Rc(t){return t.accompanyingContainer??t.placeholderContainer}function ph(t,e,n,o,r){return lh(t.id,e.id,n,o,r)}function mh(t){const e=[];for(const n of t)Bc(n,(o,r)=>{const s=o;if((s==null?void 0:s.type)!=="Choice")return;const i=W(s.items).filter(a=>!!a&&typeof a=="object");i.length>1&&e.push({key:r,canvasId:n.id,label:s.label,items:i.map(a=>({label:a.label,id:a.id,...typeof a.type=="string"?{type:a.type}:{},...typeof a.format=="string"?{format:a.format}:{},...typeof W(a.language)[0]=="string"?{language:W(a.language)[0]}:{}}))})});return e}const ir={};function Vi(t){if(t.type!=="Video"&&!Bn(t.type)||!t.format||dh(t.id,t.format)||typeof document>"u")return true;const e=t.type==="Video"?"video":"audio",n=ir[e]??(ir[e]=document.createElement(e));return typeof n.canPlayType!="function"?true:n.canPlayType(t.format)!==""}function gh(t,e){const n={};for(const o of t){const r=o.items.filter(Vi),s=[...new Set(r.flatMap(c=>c.language??[]))],i=s.length>1?rc(s,e):void 0,a=o.items.findIndex(c=>Vi(c)&&(!i||c.language===i));a>0&&(n[o.key]=a)}return n}const ar=new WeakMap,cr=[];function vh(t){return Eo(t).some(e=>((e==null?void 0:e.type)==="Choice"?W(e.items):[e]).some(o=>(o==null?void 0:o.type)==="Video"||Bn(o==null?void 0:o.type)))}function Nr(t){var i;const e=ar.get(t);if(e)return e;const n=[];for(const a of t.items??[])for(const c of a.items??[]){if(!is(c))continue;const l=c.target?(i=hn(c.target))==null?void 0:i.t:void 0;if(!l)continue;const[d,u]=l.split(",").map(Number);Number.isFinite(d)&&n.push({annotation:c,start:d,end:Number.isFinite(u)?u:NaN})}if(n.every(a=>vh(a.annotation)))return ar.set(t,cr),cr;n.sort((a,c)=>a.start-c.start);const o=Number(t.duration),r=Number.isFinite(o)&&o/n.length||.5;n.forEach((a,c)=>{var d;const l=(d=n[c+1])==null?void 0:d.start;a.end>a.start||(l!=null?a.end=l>a.start?l:a.start+r:Number.isFinite(o)&&o>a.start?a.end=o:a.end>a.start||(a.end=a.start+r))});const s=n.length>1?n:cr;return ar.set(t,s),s}const Pn=t=>`frame:${t.id}`;function Bc(t,e){(t.items??[]).forEach((n,o)=>{(n.items??[]).forEach((r,s)=>{is(r)&&Eo(r).forEach((i,a)=>e(i,ph(t,r,o,s,a),r))})})}function mo(t,e={},{allFrames:n=false}={}){const o=[];return _s(t,e,(r,s,i)=>{r.body.type==="Image"&&o.push({body:r.body,region:r.region,...r.rotation?{rotation:r.rotation}:{},target:s,...i>=0?{frame:i}:{}})},n),o}function yh(t,e={}){for(const n of t){let o;if(_s(n,e,r=>{o??(o=r.body.type)}),typeof o=="string")return o.toLowerCase()}}function go(t,e={}){const n=[];return _s(t,e,(o,r,s,i)=>{const a=o.body.type;if(a!=="Video"&&!Bn(a))return;const c=bs(i);n.push({kind:a==="Video"?"video":"audio",body:o.body,target:r,...c?{time:c}:{}})}),n}function bh(t){const e=t.filter(o=>o.time&&typeof o.body.id=="string"),n=new Set(e.map(o=>o.time.start));if(!(e.length<2||n.size!==e.length))return e.sort((o,r)=>o.time.start-r.time.start).map(o=>{const r=Number(o.body.duration)||(o.time.end!==void 0?o.time.end-o.time.start:void 0);return{src:o.body.id,...o.body.format?{format:o.body.format}:{},start:o.time.start,...r?{duration:r}:{}}})}function _s(t,e,n,o=false){const r=t.width??0,s=t.height??0,i=Nr(t),a=Math.min(e[Pn(t)]??0,Math.max(0,i.length-1));Bc(t,(c,l,d)=>{const u=i.findIndex(g=>g.annotation===d);if(!o&&u>=0&&u!==a)return;const p=Rr(c,e[l]??0);if(!p)return;const h=d.target?hn(d.target):void 0,m=h==null?void 0:h.rect;n(p,m?{x:m.x,y:m.y,width:m.w,height:m.h}:{x:0,y:0,width:r||Number(p.body.width)||0,height:s||Number(p.body.height)||0},u,h==null?void 0:h.t)})}function $c(t){return Fc(t).filter(e=>e.kind!=="transcript")}function _h(t){const e=W(t.provides);return e.includes("closedCaptions")?"captions":e.includes("subtitles")||e.includes("translation")?"subtitles":e.includes("transcript")?"transcript":"captions"}function Fc(t){const e=[],n=[...t.annotations??[],...t.items??[]];for(const o of n)for(const r of o.items??[])if(W(r.motivation).includes("supplementing"))for(const s of W(r.body)){const i=s,a=(i==null?void 0:i.type)==="Choice"?W(i.items):[i];for(const c of a){const l=c==null?void 0:c.id;!((c==null?void 0:c.format)==="text/vtt"||typeof l=="string"&&/\.vtt(\?|$)/i.test(l))||typeof l!="string"||e.push({id:l,label:c.label,language:W(c.language)[0],kind:_h(r)})}}return e}function wh(t){const e=[],n=r=>{const s=r,i=s==null?void 0:s.id;if(typeof i!="string"||e.some(c=>c.id===i))return;const a=s==null?void 0:s.format;(a?a!=="text/plain":!/\.txt(\?|$)/i.test(i))||e.push({id:i,label:s==null?void 0:s.label,language:W(s==null?void 0:s.language)[0]})},o=[...t.annotations??[],...t.items??[]];for(const r of o)for(const s of r.items??[])if(W(s.motivation).includes("supplementing"))for(const i of W(s.body)){const a=i;((a==null?void 0:a.type)==="Choice"?W(a.items):[a]).forEach(n)}return W(t.rendering).forEach(n),e}function Rr(t,e=0){if(!t||typeof t!="object")return null;const n=t;if(n.type==="Choice"){const o=W(n.items);return Rr(o[e]??o[0])}if(n.type==="SpecificResource"&&n.source){const o=typeof n.source=="string"?{id:n.source}:n.source,r=W(n.selector).find(a=>(a==null?void 0:a.type)==="ImageApiSelector"),s=Rr({type:"Image",...o});if(!s)return null;const i=(r==null?void 0:r.rotation)!=null?String(r.rotation):void 0;return{...s,region:(r==null?void 0:r.region)||s.region,...i?{rotation:i}:{}}}return n.type!=="Image"&&n.type!=="Video"&&!Bn(n.type)?null:{body:n,region:typeof n.region=="string"?n.region:void 0}}function xh(t,e,n={},{standIns:o=true}={}){const r=hh(t,e),s=[],i=[],a={};return t.forEach((c,l)=>{const d=r[l],u=dn(c),p=d.width/u.width,h=d.height/u.height,m=y=>({x:d.x+y.x*p,y:d.y+y.y*h,width:y.width*p,height:y.height*h}),g=go(c,n),_=mo(c,n,{allFrames:true}).map(y=>({...y,canvas:c})),w=Rc(c);if(o&&!_.length&&g.some(y=>y.kind==="audio")&&w){const y=dn(w);for(const x of mo(w))_.push({...x,canvas:w,target:{x:x.target.x/y.width*u.width,y:x.target.y/y.height*u.height,width:x.target.width/y.width*u.width,height:x.target.height/y.height*u.height}})}const S=n[Pn(c)]??0;_.forEach(({body:y,target:x,region:k,rotation:N,frame:D,canvas:j},et)=>{var J;const V=Io(y.service);if(!V&&!y.id)return;const nt=`${j.id}|${et}|${y.id??V}|${k??""}|${N??""}`,Y=!(V&&k);if(s.push({id:nt,service:V,url:y.id,width:Y&&Number(y.width)||void 0,height:Y&&Number(y.height)||void 0,region:k,...N?{rotation:N}:{},placement:m(x),...D!=null&&D!==S?{hidden:true}:{}}),D!=null){const M=a[J=Pn(c)]??(a[J]=[]);(M[D]??(M[D]=[])).push(nt)}});const[v]=g;if(v!=null&&v.body.id){const y=bh(g),x=y?y[0]:void 0;i.push({id:`${c.id}|media|${v.body.id}`,kind:v.kind,src:(x==null?void 0:x.src)??v.body.id,format:x?x.format:v.body.format,placement:m(v.target),duration:y?Number(c.duration)||void 0:Number(v.body.duration??c.duration)||void 0,...y?{segments:y}:{},poster:Sh(c),captions:$c(c)})}}),{images:s,media:i,placements:r,frames:a}}function Sh(t){var e;return(e=Dc(t))==null?void 0:e.source}const yy=1280;function Dc(t){var c;const e=t.placeholderContainer;if(!e)return;const n=(c=mo(e)[0])==null?void 0:c.body;if(!n)return;const o=Io(n.service),r=typeof n.id=="string"?n.id:void 0,s=o?{service:o,fallback:r}:r?{src:r}:void 0;if(!s)return;const{width:i,height:a}=dn(e);return{source:s,width:i,height:a}}function kh(t,e,n){const o=dn(t),r=e.width/o.width,s=e.height/o.height;return{x:e.x+n.x*r,y:e.y+n.y*s,width:n.width*r,height:n.height*s}}const Ch=({hidden:t})=>{const{t:e,langOf:n}=Et(),o=e("imageExitFullScreen");return f("button",{"aria-label":o,...dt(n("imageExitFullScreen")),className:"clover-canvas-exit-full-screen",hidden:t,onClick:r=>void Oc(r.currentTarget),type:"button",children:[f("svg",{viewBox:"0 0 512 512",width:"20",height:"20","aria-hidden":"true",focusable:"false",children:f("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"})}),o]})},zc="50%";function Hc(t,e=zc,n=null){const[o,r]=H(()=>typeof IntersectionObserver>"u");return F(()=>{if(o||!t)return;const s=new IntersectionObserver(i=>{i.some(a=>a.isIntersecting)&&(r(true),s.disconnect())},{root:n,rootMargin:e});return s.observe(t),()=>s.disconnect()},[t,o,e,n]),o}function Eh(t){const[e,n]=H(false);return F(()=>{if(!t)return;const o=()=>n(To()===t);return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}function Mh(t){const[e,n]=H(false);return F(()=>{if(!t)return;const o=()=>{const r=To();n(r===t||!!r&&Ac(t)===r&&(r==null?void 0:r.querySelector(".clover-canvas"))===t)};return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}class Th extends ue.Component{constructor(){super(...arguments);L(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}render(){const{error:n}=this.state;return n?f(Ih,{error:n}):this.props.children}}function Ih({error:t}){const{t:e,langOf:n}=Et();return f("div",{className:"clover-canvas-error",role:"alert",children:[f("p",{className:"clover-canvas-error-headline","data-testid":"headline",...dt(n("statusError")),children:e("statusError")}),t.message&&f("span",{className:"clover-canvas-error-body",lang:"en",children:t.message})]})}function En({overlay:t=false,className:e}){return f("span",{"aria-hidden":"true",className:It("clover-loading",e),"data-overlay":t||void 0,children:f("span",{})})}const Lh={image:"bodyUnloadableImage",video:"bodyUnloadableVideo",audio:"bodyUnloadableAudio",model:"bodyUnloadableModel"};function Ph({kind:t,shown:e,room:n=false}){const{t:o,langOf:r}=Et(),s=Lh[t];return f("div",{className:"clover-body-unloadable","data-room":n||void 0,role:"status",children:e&&f("p",{...dt(r(s)),children:o(s)})})}function Ah({text:t,lang:e}){return f("div",{className:"clover-body-note","aria-hidden":"true",children:f("p",{...dt(e),children:t})})}function Lo(t,e,n=false,o){const r=pe(),{hostLanguage:s}=Et(void 0,o);if(n)return{props:{},node:null};const i=ko(e,s);return i===void 0?{props:{"aria-label":t},node:null}:{props:{"aria-labelledby":r},node:f("span",{hidden:true,id:r,...dt(i),children:t})}}const Oh=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function se(t,e){return{a:1,b:0,c:0,d:1,e:t,f:e}}function de(t,e=t){return{a:t,b:0,c:0,d:e,e:0,f:0}}function Fn(t){const e=Math.cos(t),n=Math.sin(t);return{a:e,b:n,c:-n,d:e,e:0,f:0}}function Nh(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function fe(...t){return t.reduce((e,n)=>Nh(e,n),Oh)}function Rh(t){const e=t.a*t.d-t.b*t.c;if(!e||!Number.isFinite(e))return null;const n=1/e;return{a:t.d*n,b:-t.b*n,c:-t.c*n,d:t.a*n,e:(t.c*t.f-t.d*t.e)*n,f:(t.b*t.e-t.a*t.f)*n}}function be(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function by(t){return`matrix(${[t.a,t.b,t.c,t.d,t.e,t.f].map($h).join(",")})`}function Bh(t,e,n,o=new Float32Array(9)){const r=2/e,s=-2/n;return o[0]=t.a*r,o[1]=t.b*s,o[2]=0,o[3]=t.c*r,o[4]=t.d*s,o[5]=0,o[6]=t.e*r-1,o[7]=t.f*s+1,o[8]=1,o}function $h(t){const e=Math.round(t*1e6)/1e6;return Object.is(e,-0)?"0":String(e)}function Wc(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function ws(t){if(!t.length)return null;let e=1/0,n=1/0,o=-1/0,r=-1/0;for(const s of t)e=Math.min(e,s.x),n=Math.min(n,s.y),o=Math.max(o,s.x+s.width),r=Math.max(r,s.y+s.height);return{x:e,y:n,width:o-e,height:r-n}}function Fh(t,e){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height}function Po(t,e){const n=[be(t,{x:e.x,y:e.y}),be(t,{x:e.x+e.width,y:e.y}),be(t,{x:e.x,y:e.y+e.height}),be(t,{x:e.x+e.width,y:e.y+e.height})],o=n.map(a=>a.x),r=n.map(a=>a.y),s=Math.min(...o),i=Math.min(...r);return{x:s,y:i,width:Math.max(...o)-s,height:Math.max(...r)-i}}function wn(t,e,n){return Math.min(Math.max(t,e),n)}const lr=t=>!!(t&&"overlays"in t);let Br;const Dh=()=>Promise.resolve().then(()=>Dd).then(t=>{Br=t.buildContentState}),zh=vt(()=>import("./MediaBody-DhSdnEui.mjs")),Hh=()=>import("./AnnotationState-B4T0TkvH.mjs"),Wh=new Map,Uh={menu:[],placed:[],timed:[],hiddenPages:[],setPagesVisible:()=>{},listedCount:0,comments:Wh,selected:null,select:()=>{},activate:()=>{},release:()=>false,quietlyOpened:null},jh=vt(()=>import("./FrameAnimation-DXJvvX_O.mjs")),qi=vt(()=>import("./PlaceBox-ByWy7e9J.mjs")),Vh=vt(()=>import("./Placeholder-CmKEgeqP.mjs")),qh=vt(()=>import("./ControlsFade-BPFSCV0a.mjs")),Kh=()=>true,Zh=vt(()=>import("./Placeholder-CmKEgeqP.mjs").then(({PlaceholderToggle:t})=>({default:t}))),Ki={zoom:true,fullPage:true,rotation:true,reset:true,annotations:true,information:true,map:true},Gh={zoom:false,fullPage:false,rotation:false,reset:false,annotations:false,information:false,map:false},Xh={description:"canvasKeysImage",keys:["ArrowLeft ArrowRight ArrowUp ArrowDown",te.zoomIn.keys,te.zoomOut.keys,te.reset.keys,te.rotateRight.keys,te.rotateLeft.keys].join(" ")},Yh={description:"canvasKeysMedia",keys:[te.play.keys,"J L",te.mute.keys].join(" ")},Jh={description:"canvasKeysAnnotations",keys:"Escape"},Qh=t=>{var n;return!!((n=t.canvases)!=null&&n.length)||Uc(t.body,t.src).length>0?f(Th,{children:f(tp,{...t})}):null},tp=t=>{var qs,Ks,Zs,Gs,Xs,Ys;const{surface:e,manifestId:n,canvases:o,viewingDirection:r,body:s,src:i,isTiledImage:a=false,label:c,partOf:l,language:d,highContrast:u,instanceId:p,className:h,options:m,navigator:g=false,controls:_=true,collapseControls:w="auto",controlButtons:S,annotations:v,onReady:y,onViewportChange:x,onContentStateChange:k,onMediaElement:N,onCaptionChange:D,caption:j,onEnded:et,chapters:V,highlightedChapter:nt,onChapterHighlight:Y,placeholder:J=true,children:M}=t,{t:T}=Et(),O=R(null),[U,Q]=H(null),at=Eh(U),ct=gs(U),mt=Mh(U),b=Co(Q),I=Jr(u),P=!!e.controlsVisibility,B=(e.controlsVisibility??Kh)(P?U:null,m==null?void 0:m.hideDelay,O),[Z,E]=H(false),z=Hc(U),K=pe(),[G]=H(()=>p??`clover-canvas-${K}`),ht=R(null),[ft,Rt]=H(null),At=lr(ft)?ft:null,[zt,Ht]=H(null),gt=_===false?null:_===true?Ki:{...Ki,..._},[q,ot]=H("loading"),[_t,Ft]=H(false),[$,lt]=H(0),[Ot,Ke]=H(Nc),Gt=R(y),Ze=R(x),Ge=R(m);Gt.current=y,Ze.current=x,Ge.current=m;const me=ss(r),Re=bt(()=>mh(o??[]),[o]),Hn=bt(()=>gh(Re,d),[Re,d]),[No,Wn]=H({}),ne=bt(()=>({...Hn,...No}),[Hn,No]),mn=(C,tt)=>Wn(yt=>({...yt,[C]:tt})),Un=bt(()=>v==null?void 0:v.filter(C=>!C.layer||(ne[C.layer.key]??0)===C.layer.item),[v,ne]),Vt=(qs=v==null?void 0:v.find(C=>C.layer&&C.annotation.id===t.selectedAnnotation))==null?void 0:qs.layer;F(()=>{Vt&&(ne[Vt.key]??0)!==Vt.item&&mn(Vt.key,Vt.item)},[Vt==null?void 0:Vt.key,Vt==null?void 0:Vt.item,t.selectedAnnotation]);const gn=!!(gt!=null&&gt.information),oe=!!(v!=null&&v.length),Be=on(Hh,oe),[Ro,vn]=H(null),Lt=oe&&Ro||Uh,qt=bt(()=>{var yt,Nt;const C=(yt=v==null?void 0:v.find(Kt=>Kt.annotation.id===Lt.selected))==null?void 0:yt.annotation,tt=(Array.isArray(C==null?void 0:C.body)?C==null?void 0:C.body:[C==null?void 0:C.body]).find(Kt=>(Kt==null?void 0:Kt.type)==="Feature");return C&&tt?{id:String(C.id),feature:tt,name:((Nt=tt.properties)==null?void 0:Nt.label)??C.label}:null},[v,Lt.selected]),Se=qt?`${qt.id}:${t.refind??0}`:null,[jn,Vn]=H(null),qn=Se!==null&&jn!==Se,$e=bt(()=>{var Kt,tn;const C=(o??[]).map(Yt=>Yt.navPlace).filter(Boolean),tt=C.length?C:t.navPlace?[t.navPlace]:[];if(!tt.length)return null;const yt=tt.flatMap(Yt=>(Yt==null?void 0:Yt.type)==="FeatureCollection"?Yt.features??[]:(Yt==null?void 0:Yt.type)==="Feature"?[Yt]:[]);if(!yt.length)return null;const Nt=yt.length===1?(tn=(Kt=yt[0])==null?void 0:Kt.properties)==null?void 0:tn.label:void 0;return{feature:{type:"FeatureCollection",features:yt},name:Nt??t.label}},[o,t.navPlace,t.label]),yn=`place-box-${G}`,[X,pt]=H(false),[ke,Ll]=H(false),Kn=R(Lt);Kn.current=Lt;const Zn=ut(()=>Kn.current.release(),[]),{comments:Bo,listedCount:Ps}=Lt,Xe=bt(()=>gn?(o??[]).filter(C=>If(C)||Bo.has(C.id)):[],[o,gn,Bo]),$o=`caption-${G}`,[Pl,As]=H(false),Fo=Pl&&Xe.length>0,Os=ut(C=>{var tt;As(false),C&&((tt=document.getElementById(`information-${G}`))==null||tt.focus())},[G]),Xt=bt(()=>(o??[]).find(C=>Nr(C).length)??null,[o]),Al=Xt?Nr(Xt):np,Wt=bt(()=>o!=null&&o.length?xh(o,me,ne,{standIns:o.length>1}):null,[o,me,ne]),Ol=bt(()=>Uc(s,i,a),[s,i,a]),rt=(Wt==null?void 0:Wt.media[0])??null,Ns=!P&&(rt==null?void 0:rt.kind)==="video",Nl=P||Ns,Rl=P?B:Z,Bl=bt(()=>{if(o!=null&&o.length)return yh(o,ne);const C=(Array.isArray(s)?s:s?[s]:[])[0];return typeof(C==null?void 0:C.type)=="string"?C.type.toLowerCase():i?"image":void 0},[o,ne,s,i]),[Dt,$l]=H(null),Gn=R(N);Gn.current=N;const Fl=ut(C=>{var tt;$l(C),(tt=Gn.current)==null||tt.call(Gn,C)},[]),Ce=Wt?Wt.images:Ol,Ee=!!rt&&(o==null?void 0:o.length)===1,Me=Ee&&(rt==null?void 0:rt.kind)==="audio",Dl=Ee&&(rt==null?void 0:rt.kind)==="video",Ye=(o==null?void 0:o.length)===1&&!rt&&!Xt&&Ce.length===0,Xn=!Ee&&!Ye&&((Ks=m==null?void 0:m.gestures)==null?void 0:Ks.navigable)!==false,ge=o?`${n??""}
2
2
  ${o.map(C=>C.id).join("|")}`:null,Te=bt(()=>{if(!o||!J)return[];const C=o.flatMap(tt=>{const yt=Dc(tt),Nt=wt(tt.label,d);return yt?[{...yt,alt:Nt.text,lang:Nt.lang}]:[]});return me==="right-to-left"||me==="bottom-to-top"?C.reverse():C},[o,me,J,d]),[zl,Rs]=H(false),[Hl,Bs]=H(null),xt=!Me&&Te.length>0&&(rt?Hl!==ge:!zl),$s=m==null?void 0:m.request;F(()=>{if(xt){Promise.resolve().then(()=>Fm);for(const{source:C}of Te)C.service&&ys(C.service,{request:$s}).catch(()=>{})}},[xt,Te,$s]);const Fs=(C,{annotations:tt=false,fullPage:yt=false}={})=>({...C,zoom:false,rotation:false,reset:false,fullPage:yt&&C.fullPage,annotations:tt&&C.annotations}),bn=Ye&&ct,Ds=ue.Children.count(M)>0,Do=Te.length>0&&!Me&&!rt,_n=gt?xt?Xe.length||Ds||Ps||rt&&(V!=null&&V.length)?Fs(gt,{annotations:true}):null:Ee||Ye?Re.length||Xe.length||Ds||Ps||rt&&(V!=null&&V.length)||bn&&gt.fullPage?Fs(gt,{annotations:true,fullPage:bn}):null:gt:null,zo=g&&!xt&&(rt?rt.kind==="audio"&&!Ee&&Ce.length>0:true),[Ho,Wl]=H(null),Je=rt?Ho??rt.placement:null,[Yn,Ul]=H(op),Wo=bt(()=>{const C=(rt==null?void 0:rt.kind)==="video"&&Dt&&Je?[...Ce,{id:rt.id,placement:Je,width:Je.width,height:Je.height,media:{element:Dt}}]:Ce;return Yn.length?[...C,...Yn]:C},[Ce,rt,Dt,Je,Yn]),zs=Ee&&(rt==null?void 0:rt.kind)==="video"&&Ho?Ho:Wt?ws(Wt.placements):null,jl=JSON.stringify([Ce,zs,Wo.length!==Ce.length&&[rt==null?void 0:rt.id,Je],Yn.map(C=>C.id)]),Jn=R(null),Uo=R(false),jo=()=>{rt?Bs(xt?ge:null):Rs(xt),xt||Zn()},Qn=R(null),Vl=C=>{if(Dt&&!xt){Dt.currentTime=C;return}Qn.current=C,xt&&jo()};F(()=>{!Dt||Qn.current===null||(Dt.currentTime=Qn.current,Qn.current=null)},[Dt]);const Vo=Array.isArray(s)?s[0]:s,Pt=[c,(Zs=o==null?void 0:o[0])==null?void 0:Zs.label,Vo==null?void 0:Vo.label].map(C=>wt(C,d)).find(C=>C.text),ql=bt(()=>{const C=wt(l,d);return C.text&&C.text!==(Pt==null?void 0:Pt.text)?C:void 0},[l,d,Pt==null?void 0:Pt.text]),Hs=Lo((Pt==null?void 0:Pt.text)||T("canvasImage"),Pt?Pt.lang:b.langOf("canvasImage"),false,b.hostLanguage),to=xt?[]:[...Xn?[Xh]:[],...rt?[Yh]:[],...oe?[Jh]:[]],Ws=`keys-${G}`,Kl=Xn&&!xt&&!b.langOf("canvasRoleDescription")?T("canvasRoleDescription"):void 0,qo=!!_n&&Xe.length>0,Zl=qo&&Xe.map((C,tt)=>wt(C.label,d).text?Lc($o,tt):null).filter(Boolean).join(" ")||void 0,Us=R({canvases:o,scene:Wt,canvasKey:ge});Us.current={canvases:o,scene:Wt,canvasKey:ge};const eo=R(null),Ko=ut(()=>{const{canvases:C,scene:tt,canvasKey:yt}=Us.current;eo.current=C&&tt&&Jn.current===yt?{key:yt,canvases:C,placements:tt.placements}:null},[]),Gl=!o||((Gs=eo.current)==null?void 0:Gs.key)===ge,Qe=Ec(()=>{const C=eo.current,tt=ht.current;if(!C||n==="loading")return null;const yt=Dt&&Dt.currentTime>0?Dt.currentTime:null,Nt=!yt&&tt&&lr(tt)?jc(tt.getBounds(),C.canvases,C.placements):null,Kt=C.canvases.find(tn=>tn.id===(Nt==null?void 0:Nt.canvasId))??C.canvases[0];return Kt?Br?Br({manifestId:n,canvasId:Kt.id,type:Kt.type,region:Nt&&{x:Nt.rect.x,y:Nt.rect.y,w:Nt.rect.width,h:Nt.rect.height},time:yt}):(Dh().then(()=>Qe()),null):null},k);F(()=>Pr(Dt,Qe),[Dt,Qe]),F(()=>{const C=O.current;if(!C)return;const tt=e(C,Ge.current),yt=lr(tt)?tt:null;ht.current=tt,Rt(tt),tt.setDismiss(Zn);const Nt=()=>{if(!yt)return;const Zt=yt.viewLimits();Ke(ve=>ve.atMax===Zt.atMax&&ve.atMin===Zt.atMin&&ve.atHome===Zt.atHome?ve:Zt)},Kt=tt.on("open",()=>{var Zt;Nt(),Go(false),Ko(),Qe(),ot("ready"),lt(ve=>ve+1),yt&&((Zt=Gt.current)==null||Zt.call(Gt,ep(yt,()=>eo.current,ve=>{var Qs,ti;const Js=Kn.current.placed.find(Xo=>Xo.id===ve);return Js?(Kn.current.select(Js),(ti=Array.from(((Qs=yt.overlays)==null?void 0:Qs.container.querySelectorAll("[id]"))??[]).find(Xo=>Xo.id===ve))==null||ti.focus({preventScroll:true}),true):false})))}),tn=tt.on("change",()=>{Nt(),Go(false),Ko(),Qe(),ot("ready"),lt(Zt=>Zt+1)}),Yt=tt.on("error",()=>{tt.isOpen||ot("error")}),Yl=tt.on("unloadable",Zt=>Ft(!!Zt)),Jl=tt.on("viewport",()=>{var Zt;Nt(),yt&&((Zt=Ze.current)==null||Zt.call(Ze,yt.getBounds())),Qe()});return()=>{Kt(),tn(),Yt(),Yl(),Jl(),tt.dispose(),ht.current=null,Rt(null)}},[p,e,Zn,Ko]),F(()=>{if(!(!At||!zt))return At.attachNavigator(zt)},[At,zt]),F(()=>{if(!(!ft||!Ye))return ft.setGestures({navigable:false}),()=>ft.setGestures({})},[ft,Ye]);const Zo=R(false);F(()=>{var tt;if(bn)return;const C=!document.activeElement||document.activeElement===document.body;Zo.current&&C&&((tt=O.current)==null||tt.focus()),Zo.current=false},[bn]),F(()=>{const C=ht.current;if(xt&&(Uo.current=true),!C||!z||xt)return;const tt=Jn.current!==null&&Jn.current!==ge;(!C.isOpen||tt)&&ot("loading");const yt=Ee||Uo.current&&C.isOpen||tt;Jn.current=ge,Uo.current=false,C.setImages(Wo,{world:zs??void 0,fit:yt})},[jl,p,Dt,z,xt]);const js=R(n),[Xl,Go]=H(false);Ut(()=>{var C;n!==js.current&&(js.current=n,(C=ht.current)==null||C.clear(),Go(true),ot("loading"))},[n]);const Vs=q==="loading"&&Wo.length>0&&z&&!xt;return f(Nn.Provider,{value:b.hostLanguage,children:f("figure",{"aria-labelledby":Zl,className:It("clover-canvas",h),"data-testid":"clover-canvas","data-status":q,...Qr(I),"data-unloadable":_t||void 0,"data-has-navigator":zo,"data-fullscreen":at,"data-exit":mt||void 0,"data-controls":Nl?Rl?"visible":"hidden":void 0,"data-media":Bl,"data-recording":rt?"":void 0,"data-player":Me?"":void 0,"data-animated":Xt?"":void 0,"data-navigable":Xn,"data-placeholder":Te.length&&!Me?xt:void 0,ref:b.ref,onFocus:C=>{Zo.current=bn&&C.target.id===`fullPage-${G}`},onKeyDown:C=>{if(C.key==="Escape"&&Fo&&!C.defaultPrevented){C.preventDefault(),Os(false);return}if(C.key==="Escape"&&!C.defaultPrevented&&!C.currentTarget.querySelector(".clover-canvas-menu")&&Zn()){C.preventDefault();return}kf(C,O.current)},style:{position:"relative",width:"100%",height:"100%",margin:0,overflow:"hidden",isolation:"isolate"},children:[(_n||zo)&&rt&&f("div",{className:"clover-canvas-scrim","aria-hidden":"true"}),Ns&&f(St,{fallback:null,children:f(qh,{element:U,hideDelay:m==null?void 0:m.hideDelay,picture:O,onChange:E})}),f(Ch,{hidden:!mt}),ft&&(_n||Do)&&f(th,{renderer:At,instance:G,config:_n??Gh,controlButtons:S,limits:Ot,placeholderIsMore:Do&&!rt,chapters:rt?V:void 0,mediaElement:Dt,onChapter:Vl,overStill:!!rt&&xt,request:m==null?void 0:m.request,placeholder:Do&&f(St,{fallback:null,children:f(Zh,{instance:G,media:!!rt,active:xt,onToggle:jo,more:!!gt&&(gt.zoom||gt.rotation||gt.reset||gt.fullPage)})}),fit:!P,more:w,choices:xt?[]:Re,selections:ne,onSelect:mn,annotations:Lt.menu,hiddenPages:Lt.hiddenPages,onPageVisibilityChange:Lt.setPagesVisible,selectedAnnotation:Lt.selected,onAnnotationSelect:Lt.select,onAnnotationActivate:Lt.activate,captionId:qo?$o:void 0,captionOpen:Fo,onCaptionToggle:()=>As(C=>!C),placeId:$e?yn:void 0,placeOpen:X,onPlaceToggle:()=>{Ll(true),pt(C=>!C)},language:d,children:_n&&M}),zo&&f("div",{ref:Ht,className:"clover-canvas-navigator","data-testid":"clover-canvas-navigator","aria-hidden":"true"}),f("div",{ref:O,className:"clover-canvas-viewport",style:{position:"absolute",inset:0,overflow:"hidden",zIndex:-1},"data-testid":"clover-canvas-viewport",role:oe?"group":"img","aria-roledescription":Kl,...Hs.props,"aria-describedby":to.length?Ws:void 0,"aria-keyshortcuts":to.map(({keys:C})=>C).join(" ")||void 0,"aria-busy":Vs,tabIndex:0}),Hs.node,to.length>0&&f("span",{id:Ws,style:Ue,children:to.map(({description:C},tt)=>f(ue.Fragment,{children:[tt>0&&" ",f("span",{...dt(b.langOf(C)),children:T(C)})]},C))}),f(Ph,{kind:"image",shown:_t&&!xt}),Ye&&!xt&&(Pt==null?void 0:Pt.text)&&f(Ah,{text:Pt.text,lang:Pt.lang||void 0}),(rt==null?void 0:rt.kind)==="audio"&&!Me&&Ce.length===0&&!xt&&(Pt==null?void 0:Pt.text)&&f("p",{className:"clover-canvas-sound-label","aria-hidden":"true",...dt(Pt.lang||void 0),children:Pt.text}),Te.length>0&&!Me&&f(St,{fallback:null,children:f(Vh,{instance:G,stills:Te,vertical:me==="top-to-bottom"||me==="bottom-to-top",media:!!rt,active:xt,lingering:q==="loading"&&!Xl,onToggle:jo,request:m==null?void 0:m.request})}),ft&&rt&&z&&!xt&&f(St,{fallback:null,children:f(zh,{media:rt,request:m==null?void 0:m.request,fillable:Dl,surface:ft,instance:G,onElement:Fl,onFit:Wl,onCaptionChange:D,caption:j,navigable:Xn,fullscreen:Ee&&!!(gt!=null&&gt.fullPage),isFullscreen:ct,onEnded:et,chapters:V,highlightedChapter:nt,onChapterHighlight:Y,autoPlay:!Me&&Te.length>0&&Lt.quietlyOpened!==ge,language:d,notes:Lt.timed,marked:Lt.placed,selectedAnnotation:Lt.selected,onAnnotationSelect:oe?Lt.select:void 0,onAnnotationActivate:Lt.activate,player:Me&&o?{canvas:o[0],title:Pt,partOf:ql}:void 0})}),At&&Xt&&(Wt==null?void 0:Wt.frames[Pn(Xt)])&&!xt&&f(St,{fallback:null,children:f(jh,{renderer:At,frames:Al,byFrame:Wt.frames[Pn(Xt)],animationKey:Xt.id,sceneVersion:$,autoplay:(Xs=m==null?void 0:m.animation)==null?void 0:Xs.autoplay,loop:(Ys=m==null?void 0:m.animation)==null?void 0:Ys.loop,onEnded:et,language:d,duration:Number(Xt.duration),canvas:Xt,place:Wt.placements[o.indexOf(Xt)],onItems:Ul},Xt.id)}),Be&&oe&&v&&f(Be.AnnotationState,{given:t,annotations:Un??v,scene:Wt,renderer:At,sceneVersion:$,drawn:Gl,media:rt,mediaElement:Dt,showPlaceholder:xt,canvasKey:ge,openImages:Rs,openMedia:Bs,host:O,onModel:vn,refind:t.refind??0}),Vs&&f(En,{overlay:true}),qt&&f(St,{fallback:null,children:f(qi,{id:`place-of-${G}`,open:qn,onClose:C=>{var tt;Vn(Se),C&&((tt=document.getElementById(qt.id))==null||tt.focus())},feature:qt.feature,name:qt.name,language:d})}),$e&&ke&&f(St,{fallback:null,children:f(qi,{id:yn,open:X,onClose:C=>{var tt;pt(false),C&&((tt=document.getElementById(`place-${G}`))==null||tt.focus())},feature:$e.feature,name:$e.name,language:d})}),qo&&f(Lf,{id:$o,canvases:Xe,comments:Bo,open:Fo,onClose:Os,language:d})]})})};function ep(t,e,n){return{fitCanvasRect(o,r,s){const i=e(),a=(i==null?void 0:i.canvases.findIndex(c=>c.id===o))??-1;return!i||a===-1?false:(t.fitBounds(kh(i.canvases[a],i.placements[a],r),s),true)},getCanvasRegion(){const o=e();return o?jc(t.getBounds(),o.canvases,o.placements):null},get backendKind(){return t.backendKind},get atHome(){return t.isAtHome},fitBounds:(o,r)=>t.fitBounds(o,r),fitItemRect:(o,r,s)=>t.fitItemRect(o,r,s),itemRectToWorld:(o,r)=>t.itemRectToWorld(o,r),getBounds:()=>t.getBounds(),getHomeBounds:()=>t.getHomeBounds(),getCamera:()=>t.getCamera(),home:o=>t.home(o),zoomBy:(o,r,s)=>t.zoomBy(o,r,s),panBy:(o,r,s)=>t.panBy(o,r,s),setRotation:(o,r)=>t.setRotation(o,r),getRotation:()=>t.getRotation(),rotateBy:o=>t.rotateBy(o),worldToScreenPoint:o=>t.worldToScreenPoint(o),screenToWorldPoint:o=>t.screenToWorldPoint(o),on:(o,r)=>t.on(o,r),zoomToAnnotation:n}}const np=[],op=[];function Uc(t,e,n=false){const o=Array.isArray(t)?t:t?[t]:[];return o.length?o.map((s,i)=>{const a=Io(s.service);return!a&&!s.id?null:{id:`${i}:${s.id??a}|${s.region??""}`,service:a,url:s.id,width:s.width,height:s.height,region:s.region}}).filter(s=>s!==null):(Array.isArray(e)?e:e?[e]:[]).filter(Boolean).map((s,i)=>({id:`${i}:${s}`,...n?{service:s}:{url:s}}))}function jc(t,e,n){let o=null;if(n.forEach((u,p)=>{const h=Math.max(t.x,u.x),m=Math.max(t.y,u.y),g=Math.min(t.x+t.width,u.x+u.width)-h,_=Math.min(t.y+t.height,u.y+u.height)-m;if(g<=0||_<=0)return;const w=g*_;(!o||w>o.area)&&(o={index:p,area:w,clip:{x:h,y:m,width:g,height:_}})}),!o)return null;const{index:r,clip:s}=o,i=e[r],a=n[r],c=dn(i),l=c.width/a.width,d=c.height/a.height;return{canvasId:i.id,rect:{x:Math.round((s.x-a.x)*l),y:Math.round((s.y-a.y)*d),width:Math.round(s.width*l),height:Math.round(s.height*d)}}}function rp(t,e,n,o){return bt(()=>((o==null?void 0:o(t??null,(e==null?void 0:e.id)??null,e==null?void 0:e.duration))??[]).map(r=>{const s=wt(r.label,n);return{...r.id?{id:r.id}:{},label:s.text,lang:s.lang,start:r.start,end:r.end,...r.thumbnail?{thumbnail:r.thumbnail}:{}}}),[t,e,n,o])}function sp(t,e,n,o){if(t.region){if(!e)return false;const{x:r,y:s,w:i,h:a}=t.region;if(!e.fitCanvasRect(t.canvasId,{x:r,y:s,width:i,height:a},true))return false}if(o&&(t.time!==void 0||t.autoplay)){if(!n)return false;const r=()=>{t.time!==void 0&&(n.currentTime=t.time),t.autoplay&&n.play().catch(()=>{})};n.readyState>=HTMLMediaElement.HAVE_METADATA?r():n.addEventListener("loadedmetadata",r,{once:true})}return true}function ip(t,e){const n=t.store.get().manifest;if(e.canvasId&&Bt(n).canvases.some(r=>r.id===e.canvasId))t.goTo(e.canvasId);else if(e.manifestId&&e.manifestId!==(n==null?void 0:n.id))t.goToManifest(e.manifestId,e.canvasId);else return false;return true}function Vc(t){if(typeof t=="string")return Zi(t);const e=t;return(e==null?void 0:e.type)==="SpecificResource"?e:typeof(e==null?void 0:e.id)=="string"?Zi(e.id):e}const Zi=t=>t.replace(/\/((?:t|xywh)=[^/#]*)$/,"#$1");function qc(t){const e=W(t.thumbnail)[0];return e&&typeof e=="object"?{thumbnail:e}:{}}const Gi=new WeakMap,Xi=[];function ap(t,e,n){if(!t||!e)return Xi;let o=Gi.get(t);o||Gi.set(t,o=new Map);const r=`${e}|${n??""}`,s=o.get(r);if(s)return s;const i=[],a=new Set,c=d=>{if(!d||a.has(d.id??d))return;a.add(d.id??d);const u=!W(d.behavior).includes("no-nav");for(const p of W(d.items)){if((p==null?void 0:p.type)==="Range"){c(p);continue}if(!u)continue;const h=hn(Vc(p));if(h.id.split("#")[0]!==e)continue;const m=bs(h.t);m&&i.push({...d.id?{id:d.id}:{},label:d.label,...m,...qc(d)})}};for(const d of W(t.structures))c(d);i.sort((d,u)=>d.start-u.start);const l=i.length?i.map((d,u)=>{var p;return{...d,end:d.end??((p=i[u+1])==null?void 0:p.start)??n}}):Xi;return o.set(r,l),l}const Yi=new WeakMap,Ji=[];function cp(t){if(!t)return Ji;const e=Yi.get(t);if(e)return e;const n=new Map(W(t.items).map((c,l)=>[c==null?void 0:c.id,l])),o=new Set,r=c=>{var S,v;if(!c||o.has(c.id??c))return[];o.add(c.id??c);const l=[],d=[],u=[];let p;for(const y of W(c.items))if((y==null?void 0:y.type)==="Range"){const x=r(y);l.push(...x),x.forEach(k=>d.push(...k.canvasIds))}else{const x=hn(Vc(y));if(!x.id)continue;p??(p=x),d.push(x.id),u.push(x)}const h=W(c.behavior);if(h.includes("no-nav"))return l;const m=p??void 0,g={id:c.id??`range-${o.size}`,label:c.label,canvasId:(m==null?void 0:m.id)??((S=l[0])==null?void 0:S.canvasId),canvasIds:[...new Set(d)],...h.includes("sequence")?{sequence:true}:{},...qc(c),children:l},_=bs(m==null?void 0:m.t);return _?g.time=_:!m&&((v=l[0])!=null&&v.time)&&(g.time=l[0].time),m!=null&&m.rect&&(g.region=m.rect),(h.includes("sequence")&&u.length>1&&!u.some(y=>y.t)||lp(u,n))&&(g.parts=u.map(y=>({canvasId:y.id,...y.rect?{region:y.rect}:{}}))),[g]},s=W(t.structures).flatMap(r),i=s.length===1&&s[0].children.length?s[0].children:s,a=i.length?i:Ji;return Yi.set(t,a),a}function lp(t,e){return!t.length||t.some(n=>n.t)?false:t.some(n=>n.rect)?true:t.some((n,o)=>o>0&&e.get(n.id)!==(e.get(t[o-1].id)??NaN)+1)}function _y(t,e,n,o){let r=null,s=null;const i=(l,d,u)=>!l||u>l.depth||u===l.depth&&!(l.sequence&&d.sequence),a=(l,d,u)=>{const p=u||l.id===o;if(e&&l.canvasIds.includes(e)&&(!l.time||n!==void 0&&n>=l.time.start&&(l.time.end===void 0||n<l.time.end))){const m={id:l.id,depth:d,...l.sequence?{sequence:true}:{}};i(r,l,d)&&(r=m),p&&i(s,l,d)&&(s=m)}l.children.forEach(h=>a(h,d+1,p))};t.forEach(l=>a(l,0,false));const c=s??r;return c?c.id:null}function up(){const t=st(n=>n.status),e=st(n=>n.error);return bt(()=>({status:t,error:e}),[t,e])}function dp(){return st(t=>t.manifest)}function Kc(){return st(t=>Bt(t.manifest))}function xs(){return st(t=>We(t.manifest,t.canvasId))}function fp(){return st(t=>Ve(t.manifest,t.canvasId))}function hp(){const{clover:t}=ae("useNavigation"),e=st(o=>$n(o.manifest,o.canvasId)),n=st(o=>Bt(o.manifest).views.length);return bt(()=>sf(t,e,n),[t,e,n])}function pp(){return st(t=>pc(t.manifest,t.addedSets))}function wy(t){const{language:e}=ae("useLocalized");return bt(()=>wt(t,e),[t,e])}function xy(){return Et().t}function Sy(){return Et().langOf}const mp=({options:t,onReady:e,onViewportChange:n,onMediaElement:o,onCaptionChange:r,caption:s,onEnded:i,placeholder:a=true,label:c,partOf:l,language:d,annotations:u,chapters:p,...h})=>{const m=ae("Canvas"),{clover:g}=m,_=ee(g.captions.subscribe,g.captions.get,g.captions.get),w=s??_,S=d??m.language,v=xs(),{direction:y}=Kc(),x=dp(),k=fp(),N=st($=>{var lt;return $.status==="loading"?"loading":((lt=$.manifest)==null?void 0:lt.id)??""}),D=st($=>$.target),j=st($=>mc($.manifest,$.addedSets,$.search.set,$.regions)),et=st($=>$d($.manifest,$.addedSets,$.hiddenSets,$.shownSets,!!hs($.manifest))),V=st($=>ls($.manifest,$.addedSets,$.hiddenSets,$.shownSets)),nt=st($=>$.annotationId),Y=R(nt);Y.current=nt;const[J,M]=H(0);F(()=>g.found.subscribe($=>{$&&$===Y.current&&M(lt=>lt+1)}),[g]);const T=ee(g.highlight.subscribe,g.highlight.get,g.highlight.get),O=ee(g.chapter.subscribe,g.chapter.get,g.chapter.get),U=v.map($=>$.id).join("|"),Q=bt(()=>{if(u)return u;const $=v.map(lt=>lt.id);return j.flatMap(lt=>lt.entries.filter(Ot=>$.includes(Ot.canvasId)).map(Ot=>({annotation:Ot.annotation,targetIndex:$.indexOf(Ot.canvasId),pageId:lt.id,...lt.label?{pageLabel:lt.label}:{},...Ot.place?{place:Ot.place}:{},...Ot.layer?{layer:{key:Ot.layer.key,item:Ot.layer.item}}:{}})))},[u,j,v]),ct=D?($=>!!$&&v.some(lt=>lt.id===$))(D.canvasId):false,mt=R(null);ct&&(mt.current=U);const b=a&&mt.current!==U,I=R(null),P=R(null),A=bt(()=>v.some($=>go($).length>0),[v]),B=A?v.find($=>go($).length>0):void 0,Z=rp(x,B,S,ap),E=R(A);E.current=A;const z=s===void 0?m.language:void 0,K=B==null?void 0:B.id;F(()=>{if(!z||!B)return;const $=$c(B).find(lt=>lt.language&&es(lt.language,z));$&&g.captions.get()!==$.id&&g.captions.emit($.id)},[z,K,g]);const G=ut(()=>{const $=g.store.get().target;!$||!g.store.get().canvasId||sp($,I.current,P.current,E.current)&&g.consumeTarget()},[g]),ht=R(U);F(()=>{ht.current!==U&&(ht.current=U,P.current=null),D&&G()},[D,U,G]);const ft=R(e);ft.current=e;const Rt=ut($=>{var lt;I.current=$,$.on("change",G),G(),(lt=ft.current)==null||lt.call(ft,$)},[G]),At=ut($=>{var Ot;const lt=(Ot=I.current)==null?void 0:Ot.getCanvasRegion();g.viewport.emit(lt?{canvasId:lt.canvasId,region:{x:lt.rect.x,y:lt.rect.y,w:lt.rect.width,h:lt.rect.height}}:null),n==null||n($)},[g,n]),zt=ut($=>{P.current=$,g.media.emit($),$&&G(),o==null||o($)},[g,G,o]),Ht=ut(()=>{i==null||i(),(Fe(x,"auto-advance")||Fe(k,"auto-advance"))&&g.next({autoplay:true,wrap:Fe(x,"repeat")})},[g,x,k,i]),gt=ut($=>void ip(g,$),[g]),q=(t==null?void 0:t.request)??g.request,ot=Fe(k,"auto-advance")||Fe(x,"auto-advance"),_t=Fe(k,"repeat")||Fe(x,"repeat"),Ft=bt(()=>({...t,request:q,animation:(t==null?void 0:t.animation)??{autoplay:ot,loop:_t}}),[t,q,ot,_t]);return v.length?f(Qh,{...h,manifestId:N,navPlace:x==null?void 0:x.navPlace,canvases:v,viewingDirection:y,language:S,label:c??(k==null?void 0:k.label)??(x==null?void 0:x.label),partOf:l??(x==null?void 0:x.label),options:Ft,placeholder:b,onReady:Rt,onViewportChange:At,onMediaElement:zt,caption:w,onCaptionChange:$=>{g.captions.emit(($==null?void 0:$.id)??null),r==null||r($)},onEnded:Ht,annotations:Q,hiddenPages:V,unlistedPages:et,onPageVisibilityChange:($,lt)=>$.forEach(Ot=>g.setSetVisible(Ot,lt)),chapters:p??Z,highlightedChapter:O,onChapterHighlight:$=>g.chapter.emit($),selectedAnnotation:nt,refind:J,highlightedAnnotation:T,onAnnotationSelect:$=>g.selectAnnotation($),onAnnotationLink:h.onAnnotationLink??gt,onAnnotationActive:$=>{var lt;g.highlight.emit($),(lt=h.onAnnotationActive)==null||lt.call(h,$)}}):null},gp=6,nn=new Set;function vp(t){if(nn.has(t))return true;for(;nn.size>=gp;){let e;for(const n of nn)n.hiddenSince!==null&&(!e||n.hiddenSince<e.hiddenSince)&&(e=n);if(!e)return false;nn.delete(e),e.release()}return nn.add(t),true}function Qi(t){nn.delete(t)}function yp(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement?t.complete&&t.naturalWidth>0:true}function bp(t,e){if(!t.bleed)return{x:0,y:0};const n=t.transform,o=Math.hypot(n.a,n.b)*e,r=Math.hypot(n.c,n.d)*e;return{x:t.bleed.right&&o>0?1/o:0,y:t.bleed.bottom&&r>0?1/r:0}}const _p=`#version 300 es
3
3
  in vec2 a_position;
4
4
  uniform mat3 u_matrix;
@@ -20,10 +20,10 @@ out vec4 outColor;
20
20
  void main() {
21
21
  outColor = texture(u_texture, v_uv) * u_opacity;
22
22
  }
23
- `;class vo{constructor(e,n,o){L(this,"kind","webgl2");L(this,"canvas");L(this,"maxTextureSize");L(this,"gl");L(this,"program",null);L(this,"vao",null);L(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});L(this,"textures",new Map);L(this,"cssWidth",1);L(this,"cssHeight",1);L(this,"pixelRatio",1);L(this,"matrixScratch",new Float32Array(9));L(this,"isLost",false);L(this,"callbacks");L(this,"handleLost",()=>{var e2,n2;this.isLost=true,this.textures.clear(),(n2=(e2=this.callbacks).onLost)==null||n2.call(e2)});this.canvas=e,this.gl=n,this.callbacks=o,this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE)||4096;const r=xp(n,_p,wp);this.program=r,this.uniforms={matrix:n.getUniformLocation(r,"u_matrix"),crop:n.getUniformLocation(r,"u_crop"),opacity:n.getUniformLocation(r,"u_opacity"),texture:n.getUniformLocation(r,"u_texture")};const s=n.createVertexArray();n.bindVertexArray(s);const i=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,i),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),n.STATIC_DRAW);const a=n.getAttribLocation(r,"a_position");n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,false,0,0),n.bindVertexArray(null),this.vao=s,n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,false),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL),e.addEventListener("webglcontextlost",this.handleLost)}static create(e,n={}){let o=null;try{o=e.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{o=null}if(!o||typeof o.createShader!="function")return null;try{return new vo(e,o,n)}catch{return null}}resize(e,n,o){this.cssWidth=Math.max(1,e),this.cssHeight=Math.max(1,n),this.pixelRatio=o;const r=Math.max(1,Math.round(e*o)),s=Math.max(1,Math.round(n*o));this.canvas.width!==r&&(this.canvas.width=r),this.canvas.height!==s&&(this.canvas.height=s)}begin(){if(this.isLost)return;const e=this.gl;e.viewport(0,0,this.canvas.width,this.canvas.height),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.useProgram(this.program),e.bindVertexArray(this.vao),e.activeTexture(e.TEXTURE0),e.uniform1i(this.uniforms.texture,0)}draw(e){if(this.isLost||!yp(e.source))return"skipped";const n=this.gl,o=this.upload(e);if(o==="tainted")return"tainted";if(!o)return"skipped";const r=e.crop??{x:0,y:0,width:e.width,height:e.height},s=bp(e,this.pixelRatio),i=fe(e.transform,se(r.x,r.y),de(r.width+s.x,r.height+s.y));return n.uniformMatrix3fv(this.uniforms.matrix,false,Bh(i,this.cssWidth,this.cssHeight,this.matrixScratch)),n.uniform4f(this.uniforms.crop,r.x/e.width,r.y/e.height,r.width/e.width,r.height/e.height),n.uniform1f(this.uniforms.opacity,e.opacity),n.bindTexture(n.TEXTURE_2D,o.texture),n.drawArrays(n.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(e){return!this.isLost&&this.textures.has(e)}release(e){const n=this.textures.get(e);n&&(this.isLost||this.gl.deleteTexture(n.texture),this.textures.delete(e))}dispose(){var e;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const n of[...this.textures.keys()])this.release(n);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(e=this.gl.getExtension("WEBGL_lose_context"))==null||e.loseContext(),this.isLost=true}upload(e){const n=this.gl,o=this.textures.get(e.key);if(o&&o.width===e.width&&o.height===e.height)return o;const r=(o==null?void 0:o.texture)??n.createTexture();if(!r)return null;n.bindTexture(n.TEXTURE_2D,r);try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e.source)}catch(i){if(o||n.deleteTexture(r),Sp(i))return"tainted";throw i}n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);const s={texture:r,width:e.width,height:e.height};return this.textures.set(e.key,s),s}}function xp(t,e,n){const o=ta(t,t.VERTEX_SHADER,e),r=ta(t,t.FRAGMENT_SHADER,n),s=t.createProgram();if(!s)throw new Error("Could not create WebGL program");if(t.attachShader(s,o),t.attachShader(s,r),t.linkProgram(s),t.deleteShader(o),t.deleteShader(r),!t.getProgramParameter(s,t.LINK_STATUS)){const i=t.getProgramInfoLog(s);throw t.deleteProgram(s),new Error(`Could not link WebGL program: ${i}`)}return s}function ta(t,e,n){const o=t.createShader(e);if(!o)throw new Error("Could not create WebGL shader");if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const r=t.getShaderInfoLog(o);throw t.deleteShader(o),new Error(`Could not compile WebGL shader: ${r}`)}return o}function Sp(t){return typeof t=="object"&&t!==null&&t.name==="SecurityError"}function Zc(t,e){return fe(se(e.width/2,e.height/2),Fn(t.rotation),de(t.zoom),se(-t.x,-t.y))}function Gc(t,e){return fe(se(t.x,t.y),de(1/t.zoom),Fn(-t.rotation),se(-e.width/2,-e.height/2))}function ea(t,e,n){return be(Gc(t,e),n)}function kp(t,e,n){return be(Zc(t,e),n)}function $r(t,e){return Po(Gc(t,e),{x:0,y:0,width:e.width,height:e.height})}function Cp(t,e,n=0,o=0){const r=Po(Fn(n),t),s=Math.max(1,e.width*(1-o*2)),i=Math.max(1,e.height*(1-o*2)),a=Math.min(s/Math.max(r.width,Number.EPSILON),i/Math.max(r.height,Number.EPSILON)),c=Wc(t);return{x:c.x,y:c.y,zoom:a,rotation:n}}function yo(t,e,n,o,r){const s=be(fe(de(1/n),Fn(-o)),{x:e.x-r.width/2,y:e.y-r.height/2});return{x:t.x-s.x,y:t.y-s.y}}function na(t,e){return t.x===e.x&&t.y===e.y&&t.zoom===e.zoom&&t.rotation===e.rotation}const Ep=.09,Mp=1e-4,oa=.05,Tp=1e-4;class Ip{constructor(e,n=Ep,o){L(this,"current");L(this,"target",null);L(this,"timeConstant");L(this,"spring");L(this,"start");L(this,"elapsed",0);this.current={...e},this.start={...e},this.timeConstant=n,this.spring=o}get destination(){return this.target?{...this.target.state}:{...this.current}}set(e){this.current={...e},this.target=null}animateTo(e,n,o=false){const r=this.spring?this.spring.duration<=0:this.timeConstant===0;if(o||r){this.set(e.state);return}let s=e.anchor;if(s){const i=yo(s.world,s.screen,e.state.zoom,e.state.rotation,n);Math.hypot(i.x-e.state.x,i.y-e.state.y)*e.state.zoom>oa&&(s=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...e.state},anchor:s}}stop(){this.target=null}step(e,n){const o=this.target;if(!o)return false;const r=o.state;let s,i;if(this.spring){this.elapsed+=Math.max(e,0);const u=this.elapsed/this.spring.duration;if(u>=1)return this.current={...r},this.target=null,false;const p=this.spring.stiffness;s=this.start,i=(1-Math.exp(-p*u))/(1-Math.exp(-p))}else s=this.current,i=1-Math.exp(-Math.max(e,0)/this.timeConstant);const a=Math.exp(Math.log(s.zoom)+(Math.log(r.zoom)-Math.log(s.zoom))*i),c=s.rotation+(r.rotation-s.rotation)*i,l=o.anchor?yo(o.anchor.world,o.anchor.screen,a,c,n):{x:s.x+(r.x-s.x)*i,y:s.y+(r.y-s.y)*i};return this.current={x:l.x,y:l.y,zoom:a,rotation:c},this.spring?true:Math.abs(Math.log(r.zoom/a))<Mp&&Math.abs(r.rotation-c)<Tp&&Math.hypot(r.x-l.x,r.y-l.y)*a<oa?(this.current={...r},this.target=null,false):true}}const Xc=5,ra=300,Lp=Xc*4;function sa(t,e=false){return t==="touch"||t==="pen"&&!e}function Pp(t){return t.pointerType==="pen"&&t.buttons===0}function Ap(t,e,n){for(let o=t;o&&o!==e;o=o.parentElement)if((n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)>=1&&/auto|scroll/.test(getComputedStyle(o).overflowY))return true;return false}function ia(t,e){var o;let n=t;for(;n&&n!==e;){if(n instanceof HTMLButtonElement||n instanceof HTMLAnchorElement||n instanceof HTMLInputElement||n instanceof HTMLLabelElement||n instanceof HTMLSelectElement||((o=n.dataset)==null?void 0:o.cloverCanvasInteractive)!==void 0)return true;n=n.parentElement}return false}const Fr={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},ur=2,aa=1.5,ca=.1,Op=100,Np=.002,Rp=.01;class Bp{constructor(e,n,o=Fr){L(this,"pointers",new Map);L(this,"samples",[]);L(this,"down",null);L(this,"pinch",null);L(this,"lastTap",null);L(this,"lastPointerType","");L(this,"penHovers",false);L(this,"onPointerDown",e2=>{var o2,r;if(this.lastPointerType=e2.pointerType,e2.pointerType==="mouse"&&e2.button!==0||ia(e2.target,this.element))return;(r=(o2=this.element).setPointerCapture)==null||r.call(o2,e2.pointerId);const n2=this.local(e2);this.pointers.set(e2.pointerId,n2),this.pointers.size===1?(this.down={x:n2.x,y:n2.y,t:e2.timeStamp,moved:false},this.samples=[{x:n2.x,y:n2.y,t:e2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});L(this,"onPointerMove",e2=>{var r;Pp(e2)&&(this.penHovers=true);const n2=this.pointers.get(e2.pointerId);if(!n2)return;const o2=this.local(e2);if(this.pointers.set(e2.pointerId,o2),this.pointers.size===1){const s=o2.x-n2.x,i=o2.y-n2.y;this.down&&Math.hypot(o2.x-this.down.x,o2.y-this.down.y)>Xc&&(this.down.moved=true),(r=this.down)!=null&&r.moved&&this.options.navigable&&this.target.panBy(s,i,!this.tracksPointer(e2.pointerType)),this.samples.push({x:o2.x,y:o2.y,t:e2.timeStamp});const a=e2.timeStamp-Op;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 s=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(s.distance/this.pinch.distance,s.mid,false),this.target.panBy(s.mid.x-this.pinch.mid.x,s.mid.y-this.pinch.mid.y,false),this.pinch=s}});L(this,"onPointerUp",e2=>{var c,l,d,u,p,h;if(!this.pointers.has(e2.pointerId))return;if(this.pointers.delete(e2.pointerId),(l=(c=this.element).releasePointerCapture)==null||l.call(c,e2.pointerId),this.pointers.size===1){this.pinch=null;const[m]=this.pointers.values();this.samples=[{...m,t:e2.timeStamp}];return}if(this.pointers.size>0)return;const n2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!n2)return;const o2=this.local(e2);if(!n2.moved&&e2.type==="pointerup"&&e2.timeStamp-n2.t<ra){if((u=(d=this.target).dismiss)!=null&&u.call(d)){this.lastTap=null;return}if(sa(e2.pointerType,this.penHovers)){const m=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&m&&e2.timeStamp-m.t<ra&&Math.hypot(o2.x-m.x,o2.y-m.y)<Lp?(this.lastTap=null,this.zoomIn(o2)):this.lastTap={x:o2.x,y:o2.y,t:e2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?e2.shiftKey?this.target.zoomBy(1/ur,o2,true):this.zoomIn(o2):(h=(p=this.target).tap)==null||h.call(p,o2);return}if(!this.options.navigable||!this.tracksPointer(e2.pointerType))return;const s=this.samples[0],i=this.samples[this.samples.length-1],a=((i==null?void 0:i.t)??0)-((s==null?void 0:s.t)??0);if(s&&i&&a>0&&e2.timeStamp-i.t<50){const m=(i.x-s.x)/a*1e3,g=(i.y-s.y)/a*1e3,_=this.options.flickMomentum;_>0&&Math.hypot(m,g)>this.options.flickMinSpeed&&this.target.panBy(m*_,g*_,true)}});L(this,"onDoubleClick",e2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||sa(this.lastPointerType,this.penHovers)||ia(e2.target,this.element)||(e2.shiftKey?this.target.zoomBy(1/ur,this.local(e2),true):this.zoomIn(this.local(e2))))});L(this,"onWheel",e2=>{const n2=e2.ctrlKey;if(!this.options.navigable||!n2&&!this.options.scrollToZoom||!n2&&Ap(e2.target,this.element,e2.deltaY))return;e2.preventDefault();const o2=$p(e2),r=n2?Rp:Np;this.target.zoomBy(Math.exp(-o2*r),this.local(e2),!n2)});L(this,"onKeyDown",e2=>{if(e2.target!==this.element||!this.options.navigable||e2.altKey||e2.metaKey||e2.ctrlKey)return;const n2=this.element.getBoundingClientRect(),o2=n2.width*ca*(e2.shiftKey?3:1),r=n2.height*ca*(e2.shiftKey?3:1);switch(e2.key){case"ArrowLeft":this.target.panBy(o2,0,true);break;case"ArrowRight":this.target.panBy(-o2,0,true);break;case"ArrowUp":this.target.panBy(0,r,true);break;case"ArrowDown":this.target.panBy(0,-r,true);break;case"+":case"=":this.target.zoomBy(aa,void 0,true);break;case"-":case"_":this.target.zoomBy(1/aa,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}e2.preventDefault()});this.element=e,this.target=n,this.options=o,e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("dblclick",this.onDoubleClick),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("keydown",this.onKeyDown)}setOptions(e){this.options=e}dispose(){const e=this.element;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("dblclick",this.onDoubleClick),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("keydown",this.onKeyDown)}local(e){const n=this.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}zoomIn(e){var n,o;(o=(n=this.target).atMaxZoom)!=null&&o.call(n)?this.target.home():this.target.zoomBy(ur,e,true)}tracksPointer(e){return e==="touch"||this.options.flickEnabled}pinchState(){const[e,n]=[...this.pointers.values()];return{distance:Math.hypot(n.x-e.x,n.y-e.y),mid:{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}}}function $p(t){return t.deltaMode===1?t.deltaY*16:t.deltaMode===2?t.deltaY*400:t.deltaY}class Yc extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageLoadError"}}const la=new Set;async function Fp(t,e={}){const{signal:n,maxTextureSize:o,request:r}=e,s=Hd(r),i=zp(t);if(typeof createImageBitmap!="function"||typeof fetch!="function")return dr(t,{signal:n,cors:true,withCredentials:s});if(i&&la.has(i))return dr(t,{signal:n,cors:false,withCredentials:s});let a;try{a=await ds(r,t,{mode:"cors",signal:n})}catch(p){if(Hp(p,n))throw p;const h=await dr(t,{signal:n,cors:false,withCredentials:s});return i&&la.add(i),h}if(!a.ok)throw new Yc(`Image request failed with ${a.status}`,t,a.status);const c=await a.blob();let l=await Dp(c);const d=l.width,u=l.height;if(o&&(l.width>o||l.height>o)){const p=o/Math.max(l.width,l.height),h=await createImageBitmap(l,{resizeWidth:Math.max(1,Math.floor(l.width*p)),resizeHeight:Math.max(1,Math.floor(l.height*p)),resizeQuality:"high"});l.close(),l=h}if(n!=null&&n.aborted)throw l.close(),Dr();return{kind:"bitmap",source:l,width:l.width,height:l.height,naturalWidth:d,naturalHeight:u,opaque:false}}async function Dp(t){const e={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(t,e)}catch(n){if(n instanceof TypeError)return createImageBitmap(t);throw n}}function dr(t,{signal:e,cors:n,withCredentials:o}){return new Promise((r,s)=>{if(e!=null&&e.aborted){s(Dr());return}const i=new Image;i.decoding="async",n&&(i.crossOrigin=o?"use-credentials":"anonymous");const a=()=>{i.onload=null,i.onerror=null,e==null||e.removeEventListener("abort",c)},c=()=>{a(),i.src="",s(Dr())};e==null||e.addEventListener("abort",c),i.onload=()=>{a();const l=()=>r({kind:"element",source:i,width:i.naturalWidth,height:i.naturalHeight,naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight,opaque:!n});typeof i.decode=="function"?i.decode().then(l,l):l()},i.onerror=()=>{a(),s(new Yc("Image failed to load",t))},i.src=t})}function zp(t){var e;try{return new URL(t,(e=globalThis.location)==null?void 0:e.href).origin}catch{return null}}function Hp(t,e){return!!(e!=null&&e.aborted)||typeof t=="object"&&t!==null&&t.name==="AbortError"}function Dr(){const t=new Error("Aborted");return t.name="AbortError",t}function ua(t){t.kind==="bitmap"&&t.source.close()}const Wp=192*1024*1024,Up=6,jp=2;class Vp{constructor(e){L(this,"entries",new Map);L(this,"inFlight",0);L(this,"frame",0);L(this,"bytes",0);L(this,"wanted",[]);L(this,"disposed",false);L(this,"budget");L(this,"maxInFlight");this.options=e,this.budget=e.byteBudget??Wp,this.maxInFlight=e.maxInFlight??Up}get(e){const n=this.entries.get(e);if((n==null?void 0:n.state)==="ready")return n.lastUsed=this.frame,n.image}has(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="ready"}failed(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(e,n){var r;const o=this.entries.get(e);(o==null?void 0:o.state)!=="ready"&&((r=o==null?void 0:o.controller)==null||r.abort(),this.entries.set(e,{url:e,state:"ready",image:n,bytes:fr(n),lastUsed:this.frame,attempts:0,pinned:false,waiters:(o==null?void 0:o.waiters)??[]}),this.bytes+=fr(n),this.flushWaiters(e))}prefetch(e){return Promise.all(e.map(n=>new Promise(o=>{const r=this.entries.get(n.url);if(r&&r.state!=="loading")return o();if(r){r.waiters.push(o);return}this.start({...n,priority:-1},o)}))).then(()=>{})}update(e){if(this.disposed)return;this.frame++;const n=new Set(e.map(o=>o.url));this.wanted=[...e].sort((o,r)=>o.priority-r.priority);for(const o of this.entries.values())o.state==="loading"&&!o.pinned&&!n.has(o.url)&&o.controller&&(o.controller.abort(),this.entries.delete(o.url),this.inFlight--);for(const o of this.wanted){const r=this.entries.get(o.url);r&&(r.lastUsed=this.frame)}this.pump(),this.evict(n)}dispose(){var e;this.disposed=true;for(const n of this.entries.values())(e=n.controller)==null||e.abort(),this.flushWaiters(n.url);this.entries.clear(),this.bytes=0}forEachReady(e){for(const n of this.entries.values())n.state==="ready"&&n.image&&e(n.url,n.image)}pump(){for(const e of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(e.url)||this.start(e)}}start(e,n){const o=new AbortController,r={url:e.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:o,pinned:!!n,waiters:n?[n]:[]};this.entries.set(e.url,r),this.inFlight++,this.attempt(r,e,o,e.url)}attempt(e,n,o,r){e.attempts++,this.options.load(r,o.signal).then(s=>{if(this.disposed||this.entries.get(e.url)!==e){ua(s);return}e.state="ready",e.image=s,e.bytes=fr(s),e.controller=void 0,e.pinned=false,this.bytes+=e.bytes,this.settle(e)},s=>{if(!(o.signal.aborted||this.disposed)&&this.entries.get(e.url)===e){if(e.attempts<jp&&!qp(s,n)){this.attempt(e,n,o,n.fallbackUrl??n.url);return}e.state="failed",e.controller=void 0,e.pinned=false,this.settle(e)}})}settle(e){this.inFlight--,this.flushWaiters(e.url),this.options.onSettled(),this.pump()}flushWaiters(e){const n=this.entries.get(e);if(!n)return;const o=n.waiters;n.waiters=[],o.forEach(r=>r())}evict(e){if(this.bytes<=this.budget)return;const n=[...this.entries.values()].filter(o=>o.state==="ready"&&!e.has(o.url)).sort((o,r)=>o.lastUsed-r.lastUsed);for(const o of n){if(this.bytes<=this.budget)break;this.entries.delete(o.url),this.bytes-=o.bytes,o.image&&ua(o.image),this.options.onEvict(o.url)}}}function fr(t){return t.width*t.height*4}function qp(t,e){if(e.fallbackUrl)return false;const n=t==null?void 0:t.status;return typeof n=="number"&&n>=400&&n<500&&n!==408&&n!==429}const Kp=.1;class Zp{constructor(e,n=r=>requestAnimationFrame(r),o=r=>cancelAnimationFrame(r)){L(this,"handle",0);L(this,"last",0);L(this,"disposed",false);L(this,"frame",e2=>{if(this.handle=0,this.disposed)return;const n2=this.last?Math.min((e2-this.last)/1e3,Kp):1/60;this.last=e2,this.tick(n2,e2)?this.invalidate():this.last=0});this.tick=e,this.raf=n,this.caf=o}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 Gp=2*1024*1024;function Xp(t,e,n=Gp){const o=new Set;let r=n,s=false;return{get deferred(){return s},getTile(i){const a=t(i);if(!a||a.kind==="media"||a.opaque||o.has(i)||e(i))return a;const c=a.width*a.height*4;if(o.size>0&&c>r){s=true;return}return r-=c,o.add(i),a}}}function Yp(t){const e=/^(!)?(\d+(?:\.\d+)?)$/.exec((t==null?void 0:t.trim())??"");if(!e)return null;const n=Number(e[2]);if(n>360)return null;const o=n%360,r=!!e[1];return o||r?{degrees:o,mirror:r}:null}function Jp(t,e,n){if(!t)return null;let o=t.trim().replace(/^xywh=/,""),r=false;o.startsWith("pct:")?(r=true,o=o.slice(4)):o.startsWith("pixel:")&&(o=o.slice(6));const s=o.split(",").map(Number);if(s.length!==4||s.some(m=>!Number.isFinite(m)))return null;let[i,a,c,l]=s;r&&(i=i/100*e,a=a/100*n,c=c/100*e,l=l/100*n);const d=Math.max(0,i),u=Math.max(0,a),p=Math.min(e,i+c),h=Math.min(n,a+l);return p<=d||h<=u?null:{x:d,y:u,width:p-d,height:h-u}}const hr=512,Qp=16e6;function Jc(t,e,n){return{width:e,height:n,levels:[{scaleFactor:1,width:e,height:n,tileWidth:e,tileHeight:n,cols:1,rows:1}],tile:r=>({...r,url:t,region:{x:0,y:0,width:e,height:n}})}}function tm(t){const{width:e,height:n}=t,o=[],r=t.regionByPx&&t.sizeByW,s=(p,h,m)=>{const g=Math.ceil(e/p),_=Math.ceil(n/p);return{scaleFactor:p,width:g,height:_,tileWidth:h,tileHeight:m,cols:Math.ceil(g/h),rows:Math.ceil(_/m)}},i=(p,h)=>({scaleFactor:e/p,width:p,height:h,tileWidth:p,tileHeight:h,cols:1,rows:1,whole:true}),a=t.tiles[0];if(a)for(const p of a.scaleFactors)o.push(s(p,a.width,a.height));else if(r)for(let p=1;;p*=2){const h=s(p,hr,hr);if(o.push(h),h.cols===1&&h.rows===1)break}const c=Math.max(0,...o.map(p=>p.scaleFactor));for(const p of t.sizes){const h=e/p.width;em(t,p.width,p.height)&&h>c+1e-9&&o.push(i(p.width,p.height))}const l=o.reduce((p,h)=>!p||h.scaleFactor>p.scaleFactor?h:p,null);if(l&&l.cols*l.rows>1&&t.sizeByW){const p=Math.max(e,n)/hr;o.push(i(Math.ceil(e/p),Math.ceil(n/p)))}(!o.length||!a&&!r&&e*n<=Qp)&&(o.some(p=>p.scaleFactor===1)||o.push(i(e,n)));const d=nm(o).sort((p,h)=>h.scaleFactor-p.scaleFactor),u=ah(t);return{width:e,height:n,levels:d,tile(p){const h=d[p.level],m=h.scaleFactor,g=h.cols===1&&h.rows===1;let _,w,S;if(g)_={x:0,y:0,width:e,height:n},w=h.width,S=h.height;else{const v=Math.round(p.col*h.tileWidth*m),y=Math.round(p.row*h.tileHeight*m);_={x:v,y,width:Math.min(Math.round(h.tileWidth*m),e-v),height:Math.min(Math.round(h.tileHeight*m),n-y)},w=Math.ceil(_.width/m),S=Math.ceil(_.height/m)}return{...p,region:_,url:po(t,_,w,S),fallbackUrl:u?po(t,_,w,S,u):void 0}}}}function em(t,e,n){return!(t.maxWidth&&e>t.maxWidth||t.maxHeight&&n>t.maxHeight||t.maxArea&&e*n>t.maxArea)}function nm(t){const e=new Map;for(const n of t){const o=`${n.width}x${n.height}`,r=e.get(o);(!r||r.cols*r.rows<n.cols*n.rows)&&e.set(o,n)}return[...e.values()]}function om(t,e){const n=t.levels;for(let o=0;o<n.length;o++)if(n[o].scaleFactor<=e*(1+1e-6))return o;return n.length-1}function Le(t,e,n){const o=t.levels[e],r=o.tileWidth*o.scaleFactor,s=o.tileHeight*o.scaleFactor,i=Math.max(0,n.x),a=Math.max(0,n.y),c=Math.min(t.width,n.x+n.width),l=Math.min(t.height,n.y+n.height);if(c<=i||l<=a)return[];const d=Math.max(0,Math.floor(i/r)),u=Math.min(o.cols-1,Math.floor((c-1e-9)/r)),p=Math.max(0,Math.floor(a/s)),h=Math.min(o.rows-1,Math.floor((l-1e-9)/s)),m=[];for(let g=p;g<=h;g++)for(let _=d;_<=u;_++)m.push({level:e,col:_,row:g});return m}async function rm(t,e){if(t.media)return sm(t,t.media);let n=null,o=null;if(t.service)try{n=tm(await ys(t.service,e.infoOptions))}catch(p){o=p}if(!n){if(!t.url)throw o??new Error("Image has no source");const p=await e.loadStatic(t.url);e.cache.seed(t.url,p),n=Jc(t.url,p.naturalWidth,p.naturalHeight)}const r=t.width&&t.height&&t.width>0&&t.height>0?{width:t.width,height:t.height}:{width:n.width,height:n.height},s=Jp(t.region,r.width,r.height)??{x:0,y:0,width:r.width,height:r.height},i=n.width/r.width,a=n.height/r.height,c={x:s.x*i,y:s.y*a,width:s.width*i,height:s.height*a},l=Yp(t.rotation),d=l?im(c,l):void 0,u={id:t.id,spec:t,pyramid:n,size:r,clip:c,contentClip:s,rect:{x:0,y:0,width:s.width,height:s.height},...d?{turn:d}:{}};return await e.cache.prefetch(Le(n,0,c).map(p=>{const h=n.tile(p);return{url:h.url,fallbackUrl:h.fallbackUrl}})),u}const Qc="media:";function sm(t,e){var a,c;const n=t.width||((a=t.placement)==null?void 0:a.width)||e.element.videoWidth||1600,o=t.height||((c=t.placement)==null?void 0:c.height)||e.element.videoHeight||900,r=`${Qc}${t.id}`,s={width:n,height:o},i={x:0,y:0,width:n,height:o};return{id:t.id,spec:t,pyramid:Jc(r,n,o),media:{kind:"media",source:e.element,width:n,height:o,naturalWidth:n,naturalHeight:o},size:s,clip:i,contentClip:i,rect:{...i}}}function im(t,{degrees:e,mirror:n}){const o=e*Math.PI/180,r=d=>Math.abs(d)<1e-12?0:d,s=r(Math.cos(o)),i=r(Math.sin(o)),a=Math.abs(t.width*s)+Math.abs(t.height*i),c=Math.abs(t.width*i)+Math.abs(t.height*s),l=fe(se(a/2,c/2),{a:s,b:i,c:-i,d:s,e:0,f:0},de(n?-1:1,1),se(-(t.x+t.width/2),-(t.y+t.height/2)));return{orient:l,unorient:Rh(l),width:a,height:c}}function tl(t){var e;return((e=t.turn)==null?void 0:e.orient)??se(-t.clip.x,-t.clip.y)}function am(t,e){const{turn:n,clip:o}=t;if(!n)return{...e,x:o.x+e.x,y:o.y+e.y};const r=Po(n.unorient,e),s=Math.max(r.x,o.x),i=Math.max(r.y,o.y);return{x:s,y:i,width:Math.max(0,Math.min(r.x+r.width,o.x+o.width)-s),height:Math.max(0,Math.min(r.y+r.height,o.y+o.height)-i)}}function cm(t,e){const{turn:n,clip:o}=t;return n?be(n.unorient,e):{x:o.x+e.x,y:o.y+e.y}}function da(t){const{turn:e,clip:n,contentClip:o}=t;return e?{width:e.width*o.width/n.width,height:e.height*o.height/n.height}:o}function lm(t){if(!t.length)return null;if(t.every(o=>o.spec.placement)){for(const o of t)o.rect={...o.spec.placement};return ws(t.map(o=>o.rect))}const e=da(t[0]).height;let n=0;for(const o of t){const r=da(o),s=r.width*e/r.height;o.rect={x:n,y:0,width:s,height:e},n+=s}return{x:0,y:0,width:n,height:e}}function Ao(t){const e=t.turn??t.clip;return{x:t.rect.width/e.width,y:t.rect.height/e.height}}function um(t){const e=Ao(t);return fe(se(t.rect.x,t.rect.y),de(e.x,e.y),tl(t))}function dm(t,e){var n,o;return t.service===e.service&&t.url===e.url&&t.width===e.width&&t.height===e.height&&t.region===e.region&&t.rotation===e.rotation&&((n=t.media)==null?void 0:n.element)===((o=e.media)==null?void 0:o.element)&&JSON.stringify(t.placement)===JSON.stringify(e.placement)}const fm=1e7,hm=15e6,pm=2e7,mm=2;function gm(t){const{items:e,camera:n,viewport:o,pixelRatio:r,getTile:s,destination:i}=t,a=Zc(n,o),c=[],l=[],d=[],u=(p,h,m)=>{const g=p.tile(h);l.push({url:g.url,fallbackUrl:g.fallbackUrl,priority:m})};for(const p of e){const{pyramid:h,clip:m,rect:g}=p,_=Ao(p);if(t.wantOverview)for(const Y of Le(h,0,m))u(h,Y,pm);const w=fa(p,n,o,r),S=i?fa(p,i,o,r):w;if(d.push((w==null?void 0:w.target)??-1),!w&&!S)continue;const v=Y=>J=>{const M=h.tile(J).region;return Math.hypot(M.x+M.width/2-Y.x,M.y+M.height/2-Y.y)};if(S){const Y=v(S.center);for(const J of Le(h,0,S.area))u(h,J,Y(J)/1e3);if(S.target>0)for(const J of Le(h,S.target,S.area))u(h,J,fm+Y(J))}if(!w)continue;const{area:y,target:x}=w,k=v(w.center),N=Le(h,0,y),D=x===0?[]:Le(h,x,y);if(S!==w){for(const J of N)u(h,J,k(J)/1e3);const Y=x-mm;if(Y>0)for(const J of Le(h,Y,y))u(h,J,hm+k(J))}if(p.spec.hidden)continue;const V=(x===0?N:D).every(Y=>s(h.tile(Y).url)!==void 0)?[x]:Array.from({length:x+1},(Y,J)=>J),nt=fe(a,se(g.x,g.y),de(_.x,_.y),tl(p));for(const Y of V){const J=Y===0?N:Y===x?D:Le(h,Y,y),M=h.levels[Y].cols*h.levels[Y].rows>1;for(const T of J){const O=h.tile(T),U=s(O.url);if(!U)continue;const Q=vm(p,O.region,U,nt,M);Q&&c.push({...Q,url:O.url})}}}return l.sort((p,h)=>p.priority-h.priority),{draws:c,wants:ym(l),levels:d}}function fa(t,e,n,o){const{pyramid:r,rect:s}=t,i=$r(e,n);if(!Fh(i,s))return null;const a=Ao(t),c=Math.max(i.x,s.x),l=Math.max(i.y,s.y),d=Math.min(i.x+i.width,s.x+s.width),u=Math.min(i.y+i.height,s.y+s.height),p=1/(a.x*e.zoom*o);return{area:am(t,{x:(c-s.x)/a.x,y:(l-s.y)/a.y,width:(d-c)/a.x,height:(u-l)/a.y}),center:cm(t,{x:(e.x-s.x)/a.x,y:(e.y-s.y)/a.y}),target:om(r,p)}}function vm(t,e,n,o,r){const{clip:s}=t,i=Math.max(e.x,s.x),a=Math.max(e.y,s.y),c=Math.min(e.x+e.width,s.x+s.width),l=Math.min(e.y+e.height,s.y+s.height);if(c<=i||l<=a)return null;const d=n.width/e.width,u=n.height/e.height,p=1e-6;return{item:t,image:n,transform:fe(o,se(e.x,e.y),de(1/d,1/u)),crop:{x:(i-e.x)*d,y:(a-e.y)*u,width:(c-i)*d,height:(l-a)*u},bleed:{right:r&&c<s.x+s.width-p,bottom:r&&l<s.y+s.height-p}}}function ym(t){const e=new Set;return t.filter(n=>e.has(n.url)?false:(e.add(n.url),true))}const bm={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},_m=2,wm=3,xm=.1,pr=1e-6,zr={top:0,right:0,bottom:0,left:0};function ha(t,e="padding"){if(!t||typeof getComputedStyle!="function")return zr;const n=getComputedStyle(t),o=r=>parseFloat(n.getPropertyValue(`${e}-${r}`))||0;return{top:o("top"),right:o("right"),bottom:o("bottom"),left:o("left")}}const Sm=(t,e)=>t.top===e.top&&t.right===e.right&&t.bottom===e.bottom&&t.left===e.left;let km;class Cm{constructor(e,n={}){L(this,"host");L(this,"overlays",null);L(this,"options");L(this,"backend",null);L(this,"backendPreference");L(this,"contextLosses",0);L(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});L(this,"visible",true);L(this,"dom",null);L(this,"domAsked",false);L(this,"pending",null);L(this,"camera");L(this,"loop");L(this,"gestures");L(this,"gestureOptions",{});L(this,"cache");L(this,"navigator",null);L(this,"navigatorAsked",0);L(this,"viewport",{width:1,height:1});L(this,"inset",zr);L(this,"pixelRatio",1);L(this,"items",[]);L(this,"worldBounds",null);L(this,"contentVersion",0);L(this,"opaqueUrls",new Set);L(this,"mediaByKey",new Map);L(this,"detachMedia",[]);L(this,"opened",false);L(this,"atHome",true);L(this,"interacting",false);L(this,"lastEmitted",null);L(this,"generation",0);L(this,"listeners",new Map);L(this,"unloadable",false);L(this,"resizeObserver",null);L(this,"intersectionObserver",null);L(this,"releaseTimer",null);L(this,"dprQuery",null);L(this,"disposed",false);L(this,"dismisser",null);L(this,"tick",e2=>{var c,l;if(this.disposed)return false;const n2=this.camera.step(e2,this.viewport),o2=this.camera.current,r2=this.backend,s=Xp(this.getTile,d=>r2?r2.has(d):true),i=gm({items:this.items,camera:o2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:s.getTile,wantOverview:!!this.navigator,destination:n2?this.camera.destination:void 0}),a=i.wants.filter(d=>!d.url.startsWith(Qc));return this.cache.update(a),i.draws.length?this.setUnloadable(false):a.length&&a.every(d=>this.cache.failed(d.url))&&this.setUnloadable(true),this.paint(i.draws),(c=this.overlays)==null||c.position(o2,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(d=>!d.spec.hidden),this.worldBounds,$r(o2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!na(this.lastEmitted,o2))&&(this.lastEmitted={...o2},this.opened&&this.emit("viewport")),n2||s.deferred});L(this,"getTile",e2=>this.mediaByKey.get(e2)??this.cache.get(e2));L(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});L(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=e,this.backendPreference=n.backend??"auto",this.options={...bm,...mr(n)},ma()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:o,springStiffness:r}=this.options;this.camera=new Ip({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,o===void 0?void 0:{duration:o,stiffness:r}),this.loop=new Zp(this.tick),this.gestureOptions=mr(n.gestures??{}),ma()&&(this.gestureOptions.flickMomentum=0),this.gestures=new Bp(e,this,{...Fr,...this.gestureOptions}),this.cache=new Vp({load:(s,i)=>this.loadTile(s,i),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:s=>{var i;return(i=this.backend)==null?void 0:i.release(s)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=Em(e),this.visible?this.acquireBackend():this.holder.hiddenSince=pa(),this.measure(),this.observe()}get backendKind(){var e;return((e=this.backend)==null?void 0:e.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(e,n){let o=this.listeners.get(e);return o||(o=new Set,this.listeners.set(e,o)),o.add(n),()=>o==null?void 0:o.delete(n)}async setImages(e,{world:n,fit:o=false}={}){const r=++this.generation,s=new Map(this.items.map(d=>[d.id,d])),i=await Promise.allSettled(e.map(d=>{const u=s.get(d.id);return u&&dm(u.spec,d)?(u.spec=d,Promise.resolve(u)):rm(d,{cache:this.cache,loadStatic:p=>this.loadTile(p),infoOptions:{request:this.options.request}})}));if(r!==this.generation||this.disposed)return;const a=i.filter(d=>d.status==="fulfilled").map(d=>d.value),c=i.filter(d=>d.status==="rejected").map(d=>d.reason);this.items=a,this.watchMedia(a);const l=lm(a);if(this.worldBounds=n?l?ws([n,l]):n:l,this.contentVersion++,c.length&&this.emit("error",c),this.setUnloadable(e.length>0&&!a.length&&c.length>0),!this.worldBounds){this.invalidate();return}this.opened?o?(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(e){const n=new Set(e);let o=false;for(const r of this.items){const s=n.has(r.id);!!r.spec.hidden!==s&&(r.spec={...r.spec,hidden:s},o=true)}o&&this.invalidate()}isReady(e){const n=this.items.find(r=>r.id===e);if(!n)return false;if(n.spec.media)return true;const o=n.pyramid.levels[0];if(!o)return false;for(let r=0;r<o.rows;r++)for(let s=0;s<o.cols;s++)if(!this.getTile(n.pyramid.tile({level:0,col:s,row:r}).url))return false;return true}fitBounds(e,n=false,o=zr){const r=this.fit(e,this.camera.destination.rotation,o);this.atHome=false,this.animateTo(this.constrain(r,{allowBeyondLimits:true}),n)}fit(e,n,{top:o,right:r,bottom:s,left:i},a=1/0){const{width:c,height:l}=this.viewport,d=Cp(e,{width:Math.max(1,c-i-r),height:Math.max(1,l-o-s)},n),u=Math.min(d.zoom,a);return{...yo(Wc(e),{x:(c+i-r)/2,y:(l+o-s)/2},u,n,this.viewport),zoom:u,rotation:n}}fitItemRect(e,n,o=false){const r=this.itemRectToWorld(e,n);r&&this.fitAnnotation(r,o)}fitAnnotation(e,n=false){var s;const o=this.items[0];if(!o)return;const r=o.rect.width*xm;this.fitBounds({x:e.x-r,y:e.y-r,width:e.width+r*2,height:e.height+r*2},n,ha((s=this.overlays)==null?void 0:s.container,"scroll-padding"))}getBounds(){return $r(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var n;const e=((n=this.homeCamera())==null?void 0:n.zoom)??1;return{home:e,min:e*this.options.minZoomImageRatio,max:Math.max(e,this.closestZoom())}}closestZoom(){const e=this.items.length?Math.min(...this.items.map(n=>Ao(n).x)):1;return this.options.maxZoomPixelRatio/e}home(e=false){const n=this.homeCamera();if(!n)return;const o=this.atHome;this.atHome=true,this.animateTo(n,e),!o&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-pr)}viewLimits(){const{zoom:e,x:n,y:o,rotation:r}=this.camera.destination,{min:s,max:i}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:e>=i*(1-pr),atMin:e<=s*(1+pr),atHome:this.atHome&&(!a||Math.abs(e/a.zoom-1)<.001&&Math.hypot(n-a.x,o-a.y)*e<.5&&Math.abs(r-a.rotation)<.001)}}zoomBy(e,n,o=true){const r=o?this.camera.destination:this.camera.current,s=n??{x:this.viewport.width/2,y:this.viewport.height/2},i=ea(r,this.viewport,s),{min:a,max:c}=this.getZoomLimits(),l=wn(r.zoom*e,a,c),d=yo(i,s,l,r.rotation,this.viewport),u=this.constrain({...r,...d,zoom:l});this.atHome=false,o?this.camera.animateTo({state:u,anchor:{world:i,screen:s}},this.viewport):this.camera.set(u),this.invalidate()}panBy(e,n,o=false){const r=o?this.camera.destination:this.camera.current,s=be(fe(de(1/r.zoom),Fn(-r.rotation)),{x:e,y:n}),i=this.constrain({...r,x:r.x-s.x,y:r.y-s.y});this.atHome=false,o?this.camera.animateTo({state:i},this.viewport):this.camera.set(i),this.invalidate()}panTo(e,n=false){const o=n?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...o,...e}),n)}rotateBy(e){const n=this.camera.destination;this.setRotation(n.rotation*180/Math.PI+e)}setRotation(e,n=false){const o=this.camera.destination,r=e*Math.PI/180;this.animateTo(this.constrain({...o,rotation:r}),n)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(e){this.emit("tap",e)}setDismiss(e){this.dismisser=e}dismiss(){var e;return((e=this.dismisser)==null?void 0:e.call(this))??false}setGestures(e){this.gestures.setOptions({...Fr,...this.gestureOptions,...mr(e)})}setInteracting(e){if(this.interacting=e,e){this.camera.stop();return}if(this.options.constrainDuringPan)return;const n=this.camera.destination,o=this.constrain(n);na(n,o)||this.animateTo(o,false)}worldToScreenPoint(e){return kp(this.camera.current,this.viewport,e)}screenToWorldPoint(e){return ea(this.camera.current,this.viewport,e)}itemRectToWorld(e,n){const o=this.items[e];if(!o)return null;const{contentClip:r,clip:s}=o;if(o.turn)return Po(fe(um(o),de(s.width/r.width,s.height/r.height)),n);const i=o.rect.width/r.width,a=o.rect.height/r.height;return{x:o.rect.x+(n.x-r.x)*i,y:o.rect.y+(n.y-r.y)*a,width:n.width*i,height:n.height*a}}attachNavigator(e){var s;(s=this.navigator)==null||s.dispose(),this.navigator=null;const n=++this.navigatorAsked;let o=null,r=false;return import("./Navigator-DwbQ5u2i.mjs").then(i=>{r||this.disposed||n!==this.navigatorAsked||(o=new i.Navigator(e,(a,c)=>this.panTo(a,c)),this.navigator=o,this.invalidate())}),()=>{r=true,o==null||o.dispose(),o&&this.navigator===o&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var e,n,o,r,s,i,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(e=this.resizeObserver)==null||e.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),(r=(o=this.dprQuery)==null?void 0:o.removeEventListener)==null||r.call(o,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(s=this.navigator)==null||s.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(i=this.dom)==null||i.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(c=>c()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}watchMedia(e){this.detachMedia.forEach(n=>n()),this.detachMedia=[],this.mediaByKey.clear();for(const n of e){if(!n.media||n.media.kind!=="media")continue;const o=n.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(o,n.media);const r=n.media.source,s=()=>this.invalidate(),i=["play","seeked","loadeddata","resize"];i.forEach(a=>r.addEventListener(a,s)),this.detachMedia.push(()=>i.forEach(a=>r.removeEventListener(a,s)))}}paint(e){const n=this.backend,o=[],r=(n==null?void 0:n.kind)==="webgl2";n==null||n.begin();for(const s of e){const{image:i}=s;if(!(i.kind==="media"||i.kind==="element"&&r&&(i.opaque||this.opaqueUrls.has(s.url)))&&n){if(n.draw({key:s.url,source:i.source,width:i.width,height:i.height,transform:s.transform,crop:s.crop,opacity:1,bleed:s.bleed})!=="tainted"||i.kind==="bitmap")continue;this.opaqueUrls.add(s.url)}(i.kind==="element"||i.kind==="media")&&o.push({key:`${s.item.id}|${s.url}`,element:i.source,width:i.width,height:i.height,transform:s.transform,crop:s.crop,opacity:1})}n==null||n.end(),this.dom?this.dom.sync(o):o.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-GyEF7J55.mjs").then(({DomLayers:s})=>{if(this.disposed)return;const i=new s(this.host);this.overlays&&this.host.insertBefore(i.container,this.overlays.container),this.dom=i,this.invalidate()}))}loadTile(e,n){return Fp(e,{signal:n,request:this.options.request,maxTextureSize:this.backend instanceof vo?this.backend.maxTextureSize:void 0})}animateTo(e,n){this.camera.animateTo({state:e},this.viewport,n),this.invalidate()}homeCamera(){if(!this.worldBounds)return null;const e=2*Math.PI,n=Math.round(this.camera.destination.rotation/e)*e||0;return this.fit(this.worldBounds,n,this.inset,this.options.upscale?1/0:this.closestZoom())}constrain(e,{allowBeyondLimits:n=false}={}){const o=this.worldBounds;if(!o)return e;const{min:r,max:s}=this.getZoomLimits(),i=n?wn(e.zoom,r,Math.max(s,e.zoom)):wn(e.zoom,r,s);return this.interacting&&!this.options.constrainDuringPan?{...e,zoom:i}:{...e,zoom:i,x:wn(e.x,o.x,o.x+o.width),y:wn(e.y,o.y,o.y+o.height)}}acquireBackend(e=true){var s,i;if(this.backend||this.pending||this.disposed)return;const n=document.createElement("canvas");n.className="clover-canvas-surface",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(n,((s=this.dom)==null?void 0:s.container)??((i=this.overlays)==null?void 0:i.container)??null);const o=e&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<wm);let r=null;o&&(vp(this.holder)||this.backendPreference==="webgl2")&&(r=vo.create(n,{onLost:this.onContextLost}),r||Qi(this.holder)),r?this.install(r):this.backendPreference==="webgl2"?this.none(n):(this.pending=n,(km??(km=import("./Canvas2DBackend-CMRWLAd4.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==n)return;this.pending=null;const c=a.create(n);c?this.install(c):this.none(n)}))}none(e){e.remove(),this.host.dataset.backend="none"}install(e){this.backend=e,this.host.dataset.backend=e.kind,e.resize(this.viewport.width,this.viewport.height,this.pixelRatio),e.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",e.kind),this.invalidate()}releaseBackend(){var n;if(Qi(this.holder),(n=this.pending)==null||n.remove(),this.pending=null,!this.backend)return;const e=this.backend.canvas;this.backend.dispose(),e.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(e=>{const n=e.some(o=>o.isIntersecting);this.setVisible(n)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(e){var n;if(this.visible=e,e){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(n=this.holder).hiddenSince??(n.hiddenSince=pa()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(e=false){var c;const n=this.host.getBoundingClientRect(),o=Math.max(1,n.width),r=Math.max(1,n.height),s=ha(this.host),i=Math.min(typeof window<"u"&&window.devicePixelRatio||1,_m);if(o===this.viewport.width&&r===this.viewport.height&&i===this.pixelRatio&&Sm(s,this.inset))return;const a=this.viewport;if(this.viewport={width:o,height:r},this.inset=s,this.pixelRatio=i,(c=this.backend)==null||c.resize(o,r,i),this.opened){if(this.atHome)this.home(true);else{const l=this.camera.current,d=o/Math.max(a.width,1);this.camera.set(this.constrain({...l,zoom:l.zoom*d}))}this.emit("viewport")}e?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var e,n,o,r;typeof window>"u"||typeof window.matchMedia!="function"||((n=(e=this.dprQuery)==null?void 0:e.removeEventListener)==null||n.call(e,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(r=(o=this.dprQuery).addEventListener)==null||r.call(o,"change",this.onPixelRatioChange))}setUnloadable(e){e!==this.unloadable&&(this.unloadable=e,this.emit("unloadable",e))}emit(e,n){var o;(o=this.listeners.get(e))==null||o.forEach(r=>r(n))}}const pa=()=>typeof performance<"u"?performance.now():Date.now();function Em(t){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:e,left:n,width:o,height:r}=t.getBoundingClientRect();return e+r>=0&&n+o>=0&&e<=window.innerHeight&&n<=window.innerWidth}function ma(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function mr(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}const Mm=(t,e)=>new Cm(t,e),Tm=vt(()=>import("./Connected-D4hTMjqQ.mjs")),Im=vt(()=>import("./Connected-CtmQ-wSs.mjs").then(t=>t.C));function Lm({className:t,style:e,renderers:n,collapseControls:o,onContentStateChange:r,children:s,...i}){var m;const a=ae("Body");Mc(a.clover,r);const c=xs(),l=bt(()=>lf(c),[c]),d=uf(n??a.renderers,{canvases:c,bodies:l}),u=d==null?void 0:d.component,p=((m=c.find(({type:g})=>g==="Scene"||g==="Timeline"))==null?void 0:m.type)??"Canvas",h=st(g=>g.status==="loading");return f("div",{"aria-busy":h,className:It("clover-body",t),"data-renderer":u?"custom":p.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...e},children:[u?f(u,{canvases:c,bodies:l,children:s}):p==="Scene"?f(St,{fallback:f(En,{overlay:true}),children:f(Im,{...i,children:s})}):p==="Timeline"?f(St,{fallback:f(En,{overlay:true}),children:f(Tm,{...i,children:s})}):f(mp,{...i,collapseControls:o,surface:Mm,children:s}),h&&f(En,{overlay:true})]})}const Pm={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function Dn(t){return t.replace(/<br\s*\/?>/gi,`
23
+ `;class vo{constructor(e,n,o){L(this,"kind","webgl2");L(this,"canvas");L(this,"maxTextureSize");L(this,"gl");L(this,"program",null);L(this,"vao",null);L(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});L(this,"textures",new Map);L(this,"cssWidth",1);L(this,"cssHeight",1);L(this,"pixelRatio",1);L(this,"matrixScratch",new Float32Array(9));L(this,"isLost",false);L(this,"callbacks");L(this,"handleLost",()=>{var e2,n2;this.isLost=true,this.textures.clear(),(n2=(e2=this.callbacks).onLost)==null||n2.call(e2)});this.canvas=e,this.gl=n,this.callbacks=o,this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE)||4096;const r=xp(n,_p,wp);this.program=r,this.uniforms={matrix:n.getUniformLocation(r,"u_matrix"),crop:n.getUniformLocation(r,"u_crop"),opacity:n.getUniformLocation(r,"u_opacity"),texture:n.getUniformLocation(r,"u_texture")};const s=n.createVertexArray();n.bindVertexArray(s);const i=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,i),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),n.STATIC_DRAW);const a=n.getAttribLocation(r,"a_position");n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,false,0,0),n.bindVertexArray(null),this.vao=s,n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,false),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL),e.addEventListener("webglcontextlost",this.handleLost)}static create(e,n={}){let o=null;try{o=e.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{o=null}if(!o||typeof o.createShader!="function")return null;try{return new vo(e,o,n)}catch{return null}}resize(e,n,o){this.cssWidth=Math.max(1,e),this.cssHeight=Math.max(1,n),this.pixelRatio=o;const r=Math.max(1,Math.round(e*o)),s=Math.max(1,Math.round(n*o));this.canvas.width!==r&&(this.canvas.width=r),this.canvas.height!==s&&(this.canvas.height=s)}begin(){if(this.isLost)return;const e=this.gl;e.viewport(0,0,this.canvas.width,this.canvas.height),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.useProgram(this.program),e.bindVertexArray(this.vao),e.activeTexture(e.TEXTURE0),e.uniform1i(this.uniforms.texture,0)}draw(e){if(this.isLost||!yp(e.source))return"skipped";const n=this.gl,o=this.upload(e);if(o==="tainted")return"tainted";if(!o)return"skipped";const r=e.crop??{x:0,y:0,width:e.width,height:e.height},s=bp(e,this.pixelRatio),i=fe(e.transform,se(r.x,r.y),de(r.width+s.x,r.height+s.y));return n.uniformMatrix3fv(this.uniforms.matrix,false,Bh(i,this.cssWidth,this.cssHeight,this.matrixScratch)),n.uniform4f(this.uniforms.crop,r.x/e.width,r.y/e.height,r.width/e.width,r.height/e.height),n.uniform1f(this.uniforms.opacity,e.opacity),n.bindTexture(n.TEXTURE_2D,o.texture),n.drawArrays(n.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(e){return!this.isLost&&this.textures.has(e)}release(e){const n=this.textures.get(e);n&&(this.isLost||this.gl.deleteTexture(n.texture),this.textures.delete(e))}dispose(){var e;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const n of[...this.textures.keys()])this.release(n);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(e=this.gl.getExtension("WEBGL_lose_context"))==null||e.loseContext(),this.isLost=true}upload(e){const n=this.gl,o=this.textures.get(e.key);if(o&&o.width===e.width&&o.height===e.height)return o;const r=(o==null?void 0:o.texture)??n.createTexture();if(!r)return null;n.bindTexture(n.TEXTURE_2D,r);try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e.source)}catch(i){if(o||n.deleteTexture(r),Sp(i))return"tainted";throw i}n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);const s={texture:r,width:e.width,height:e.height};return this.textures.set(e.key,s),s}}function xp(t,e,n){const o=ta(t,t.VERTEX_SHADER,e),r=ta(t,t.FRAGMENT_SHADER,n),s=t.createProgram();if(!s)throw new Error("Could not create WebGL program");if(t.attachShader(s,o),t.attachShader(s,r),t.linkProgram(s),t.deleteShader(o),t.deleteShader(r),!t.getProgramParameter(s,t.LINK_STATUS)){const i=t.getProgramInfoLog(s);throw t.deleteProgram(s),new Error(`Could not link WebGL program: ${i}`)}return s}function ta(t,e,n){const o=t.createShader(e);if(!o)throw new Error("Could not create WebGL shader");if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const r=t.getShaderInfoLog(o);throw t.deleteShader(o),new Error(`Could not compile WebGL shader: ${r}`)}return o}function Sp(t){return typeof t=="object"&&t!==null&&t.name==="SecurityError"}function Zc(t,e){return fe(se(e.width/2,e.height/2),Fn(t.rotation),de(t.zoom),se(-t.x,-t.y))}function Gc(t,e){return fe(se(t.x,t.y),de(1/t.zoom),Fn(-t.rotation),se(-e.width/2,-e.height/2))}function ea(t,e,n){return be(Gc(t,e),n)}function kp(t,e,n){return be(Zc(t,e),n)}function $r(t,e){return Po(Gc(t,e),{x:0,y:0,width:e.width,height:e.height})}function Cp(t,e,n=0,o=0){const r=Po(Fn(n),t),s=Math.max(1,e.width*(1-o*2)),i=Math.max(1,e.height*(1-o*2)),a=Math.min(s/Math.max(r.width,Number.EPSILON),i/Math.max(r.height,Number.EPSILON)),c=Wc(t);return{x:c.x,y:c.y,zoom:a,rotation:n}}function yo(t,e,n,o,r){const s=be(fe(de(1/n),Fn(-o)),{x:e.x-r.width/2,y:e.y-r.height/2});return{x:t.x-s.x,y:t.y-s.y}}function na(t,e){return t.x===e.x&&t.y===e.y&&t.zoom===e.zoom&&t.rotation===e.rotation}const Ep=.09,Mp=1e-4,oa=.05,Tp=1e-4;class Ip{constructor(e,n=Ep,o){L(this,"current");L(this,"target",null);L(this,"timeConstant");L(this,"spring");L(this,"start");L(this,"elapsed",0);this.current={...e},this.start={...e},this.timeConstant=n,this.spring=o}get destination(){return this.target?{...this.target.state}:{...this.current}}set(e){this.current={...e},this.target=null}animateTo(e,n,o=false){const r=this.spring?this.spring.duration<=0:this.timeConstant===0;if(o||r){this.set(e.state);return}let s=e.anchor;if(s){const i=yo(s.world,s.screen,e.state.zoom,e.state.rotation,n);Math.hypot(i.x-e.state.x,i.y-e.state.y)*e.state.zoom>oa&&(s=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...e.state},anchor:s}}stop(){this.target=null}step(e,n){const o=this.target;if(!o)return false;const r=o.state;let s,i;if(this.spring){this.elapsed+=Math.max(e,0);const u=this.elapsed/this.spring.duration;if(u>=1)return this.current={...r},this.target=null,false;const p=this.spring.stiffness;s=this.start,i=(1-Math.exp(-p*u))/(1-Math.exp(-p))}else s=this.current,i=1-Math.exp(-Math.max(e,0)/this.timeConstant);const a=Math.exp(Math.log(s.zoom)+(Math.log(r.zoom)-Math.log(s.zoom))*i),c=s.rotation+(r.rotation-s.rotation)*i,l=o.anchor?yo(o.anchor.world,o.anchor.screen,a,c,n):{x:s.x+(r.x-s.x)*i,y:s.y+(r.y-s.y)*i};return this.current={x:l.x,y:l.y,zoom:a,rotation:c},this.spring?true:Math.abs(Math.log(r.zoom/a))<Mp&&Math.abs(r.rotation-c)<Tp&&Math.hypot(r.x-l.x,r.y-l.y)*a<oa?(this.current={...r},this.target=null,false):true}}const Xc=5,ra=300,Lp=Xc*4;function sa(t,e=false){return t==="touch"||t==="pen"&&!e}function Pp(t){return t.pointerType==="pen"&&t.buttons===0}function Ap(t,e,n){for(let o=t;o&&o!==e;o=o.parentElement)if((n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)>=1&&/auto|scroll/.test(getComputedStyle(o).overflowY))return true;return false}function ia(t,e){var o;let n=t;for(;n&&n!==e;){if(n instanceof HTMLButtonElement||n instanceof HTMLAnchorElement||n instanceof HTMLInputElement||n instanceof HTMLLabelElement||n instanceof HTMLSelectElement||((o=n.dataset)==null?void 0:o.cloverCanvasInteractive)!==void 0)return true;n=n.parentElement}return false}const Fr={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},ur=2,aa=1.5,ca=.1,Op=100,Np=.002,Rp=.01;class Bp{constructor(e,n,o=Fr){L(this,"pointers",new Map);L(this,"samples",[]);L(this,"down",null);L(this,"pinch",null);L(this,"lastTap",null);L(this,"lastPointerType","");L(this,"penHovers",false);L(this,"onPointerDown",e2=>{var o2,r;if(this.lastPointerType=e2.pointerType,e2.pointerType==="mouse"&&e2.button!==0||ia(e2.target,this.element))return;(r=(o2=this.element).setPointerCapture)==null||r.call(o2,e2.pointerId);const n2=this.local(e2);this.pointers.set(e2.pointerId,n2),this.pointers.size===1?(this.down={x:n2.x,y:n2.y,t:e2.timeStamp,moved:false},this.samples=[{x:n2.x,y:n2.y,t:e2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});L(this,"onPointerMove",e2=>{var r;Pp(e2)&&(this.penHovers=true);const n2=this.pointers.get(e2.pointerId);if(!n2)return;const o2=this.local(e2);if(this.pointers.set(e2.pointerId,o2),this.pointers.size===1){const s=o2.x-n2.x,i=o2.y-n2.y;this.down&&Math.hypot(o2.x-this.down.x,o2.y-this.down.y)>Xc&&(this.down.moved=true),(r=this.down)!=null&&r.moved&&this.options.navigable&&this.target.panBy(s,i,!this.tracksPointer(e2.pointerType)),this.samples.push({x:o2.x,y:o2.y,t:e2.timeStamp});const a=e2.timeStamp-Op;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 s=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(s.distance/this.pinch.distance,s.mid,false),this.target.panBy(s.mid.x-this.pinch.mid.x,s.mid.y-this.pinch.mid.y,false),this.pinch=s}});L(this,"onPointerUp",e2=>{var c,l,d,u,p,h;if(!this.pointers.has(e2.pointerId))return;if(this.pointers.delete(e2.pointerId),(l=(c=this.element).releasePointerCapture)==null||l.call(c,e2.pointerId),this.pointers.size===1){this.pinch=null;const[m]=this.pointers.values();this.samples=[{...m,t:e2.timeStamp}];return}if(this.pointers.size>0)return;const n2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!n2)return;const o2=this.local(e2);if(!n2.moved&&e2.type==="pointerup"&&e2.timeStamp-n2.t<ra){if((u=(d=this.target).dismiss)!=null&&u.call(d)){this.lastTap=null;return}if(sa(e2.pointerType,this.penHovers)){const m=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&m&&e2.timeStamp-m.t<ra&&Math.hypot(o2.x-m.x,o2.y-m.y)<Lp?(this.lastTap=null,this.zoomIn(o2)):this.lastTap={x:o2.x,y:o2.y,t:e2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?e2.shiftKey?this.target.zoomBy(1/ur,o2,true):this.zoomIn(o2):(h=(p=this.target).tap)==null||h.call(p,o2);return}if(!this.options.navigable||!this.tracksPointer(e2.pointerType))return;const s=this.samples[0],i=this.samples[this.samples.length-1],a=((i==null?void 0:i.t)??0)-((s==null?void 0:s.t)??0);if(s&&i&&a>0&&e2.timeStamp-i.t<50){const m=(i.x-s.x)/a*1e3,g=(i.y-s.y)/a*1e3,_=this.options.flickMomentum;_>0&&Math.hypot(m,g)>this.options.flickMinSpeed&&this.target.panBy(m*_,g*_,true)}});L(this,"onDoubleClick",e2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||sa(this.lastPointerType,this.penHovers)||ia(e2.target,this.element)||(e2.shiftKey?this.target.zoomBy(1/ur,this.local(e2),true):this.zoomIn(this.local(e2))))});L(this,"onWheel",e2=>{const n2=e2.ctrlKey;if(!this.options.navigable||!n2&&!this.options.scrollToZoom||!n2&&Ap(e2.target,this.element,e2.deltaY))return;e2.preventDefault();const o2=$p(e2),r=n2?Rp:Np;this.target.zoomBy(Math.exp(-o2*r),this.local(e2),!n2)});L(this,"onKeyDown",e2=>{if(e2.target!==this.element||!this.options.navigable||e2.altKey||e2.metaKey||e2.ctrlKey)return;const n2=this.element.getBoundingClientRect(),o2=n2.width*ca*(e2.shiftKey?3:1),r=n2.height*ca*(e2.shiftKey?3:1);switch(e2.key){case"ArrowLeft":this.target.panBy(o2,0,true);break;case"ArrowRight":this.target.panBy(-o2,0,true);break;case"ArrowUp":this.target.panBy(0,r,true);break;case"ArrowDown":this.target.panBy(0,-r,true);break;case"+":case"=":this.target.zoomBy(aa,void 0,true);break;case"-":case"_":this.target.zoomBy(1/aa,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}e2.preventDefault()});this.element=e,this.target=n,this.options=o,e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("dblclick",this.onDoubleClick),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("keydown",this.onKeyDown)}setOptions(e){this.options=e}dispose(){const e=this.element;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("dblclick",this.onDoubleClick),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("keydown",this.onKeyDown)}local(e){const n=this.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}zoomIn(e){var n,o;(o=(n=this.target).atMaxZoom)!=null&&o.call(n)?this.target.home():this.target.zoomBy(ur,e,true)}tracksPointer(e){return e==="touch"||this.options.flickEnabled}pinchState(){const[e,n]=[...this.pointers.values()];return{distance:Math.hypot(n.x-e.x,n.y-e.y),mid:{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}}}function $p(t){return t.deltaMode===1?t.deltaY*16:t.deltaMode===2?t.deltaY*400:t.deltaY}class Yc extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageLoadError"}}const la=new Set;async function Fp(t,e={}){const{signal:n,maxTextureSize:o,request:r}=e,s=Hd(r),i=zp(t);if(typeof createImageBitmap!="function"||typeof fetch!="function")return dr(t,{signal:n,cors:true,withCredentials:s});if(i&&la.has(i))return dr(t,{signal:n,cors:false,withCredentials:s});let a;try{a=await ds(r,t,{mode:"cors",signal:n})}catch(p){if(Hp(p,n))throw p;const h=await dr(t,{signal:n,cors:false,withCredentials:s});return i&&la.add(i),h}if(!a.ok)throw new Yc(`Image request failed with ${a.status}`,t,a.status);const c=await a.blob();let l=await Dp(c);const d=l.width,u=l.height;if(o&&(l.width>o||l.height>o)){const p=o/Math.max(l.width,l.height),h=await createImageBitmap(l,{resizeWidth:Math.max(1,Math.floor(l.width*p)),resizeHeight:Math.max(1,Math.floor(l.height*p)),resizeQuality:"high"});l.close(),l=h}if(n!=null&&n.aborted)throw l.close(),Dr();return{kind:"bitmap",source:l,width:l.width,height:l.height,naturalWidth:d,naturalHeight:u,opaque:false}}async function Dp(t){const e={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(t,e)}catch(n){if(n instanceof TypeError)return createImageBitmap(t);throw n}}function dr(t,{signal:e,cors:n,withCredentials:o}){return new Promise((r,s)=>{if(e!=null&&e.aborted){s(Dr());return}const i=new Image;i.decoding="async",n&&(i.crossOrigin=o?"use-credentials":"anonymous");const a=()=>{i.onload=null,i.onerror=null,e==null||e.removeEventListener("abort",c)},c=()=>{a(),i.src="",s(Dr())};e==null||e.addEventListener("abort",c),i.onload=()=>{a();const l=()=>r({kind:"element",source:i,width:i.naturalWidth,height:i.naturalHeight,naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight,opaque:!n});typeof i.decode=="function"?i.decode().then(l,l):l()},i.onerror=()=>{a(),s(new Yc("Image failed to load",t))},i.src=t})}function zp(t){var e;try{return new URL(t,(e=globalThis.location)==null?void 0:e.href).origin}catch{return null}}function Hp(t,e){return!!(e!=null&&e.aborted)||typeof t=="object"&&t!==null&&t.name==="AbortError"}function Dr(){const t=new Error("Aborted");return t.name="AbortError",t}function ua(t){t.kind==="bitmap"&&t.source.close()}const Wp=192*1024*1024,Up=6,jp=2;class Vp{constructor(e){L(this,"entries",new Map);L(this,"inFlight",0);L(this,"frame",0);L(this,"bytes",0);L(this,"wanted",[]);L(this,"disposed",false);L(this,"budget");L(this,"maxInFlight");this.options=e,this.budget=e.byteBudget??Wp,this.maxInFlight=e.maxInFlight??Up}get(e){const n=this.entries.get(e);if((n==null?void 0:n.state)==="ready")return n.lastUsed=this.frame,n.image}has(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="ready"}failed(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(e,n){var r;const o=this.entries.get(e);(o==null?void 0:o.state)!=="ready"&&((r=o==null?void 0:o.controller)==null||r.abort(),this.entries.set(e,{url:e,state:"ready",image:n,bytes:fr(n),lastUsed:this.frame,attempts:0,pinned:false,waiters:(o==null?void 0:o.waiters)??[]}),this.bytes+=fr(n),this.flushWaiters(e))}prefetch(e){return Promise.all(e.map(n=>new Promise(o=>{const r=this.entries.get(n.url);if(r&&r.state!=="loading")return o();if(r){r.waiters.push(o);return}this.start({...n,priority:-1},o)}))).then(()=>{})}update(e){if(this.disposed)return;this.frame++;const n=new Set(e.map(o=>o.url));this.wanted=[...e].sort((o,r)=>o.priority-r.priority);for(const o of this.entries.values())o.state==="loading"&&!o.pinned&&!n.has(o.url)&&o.controller&&(o.controller.abort(),this.entries.delete(o.url),this.inFlight--);for(const o of this.wanted){const r=this.entries.get(o.url);r&&(r.lastUsed=this.frame)}this.pump(),this.evict(n)}dispose(){var e;this.disposed=true;for(const n of this.entries.values())(e=n.controller)==null||e.abort(),this.flushWaiters(n.url);this.entries.clear(),this.bytes=0}forEachReady(e){for(const n of this.entries.values())n.state==="ready"&&n.image&&e(n.url,n.image)}pump(){for(const e of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(e.url)||this.start(e)}}start(e,n){const o=new AbortController,r={url:e.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:o,pinned:!!n,waiters:n?[n]:[]};this.entries.set(e.url,r),this.inFlight++,this.attempt(r,e,o,e.url)}attempt(e,n,o,r){e.attempts++,this.options.load(r,o.signal).then(s=>{if(this.disposed||this.entries.get(e.url)!==e){ua(s);return}e.state="ready",e.image=s,e.bytes=fr(s),e.controller=void 0,e.pinned=false,this.bytes+=e.bytes,this.settle(e)},s=>{if(!(o.signal.aborted||this.disposed)&&this.entries.get(e.url)===e){if(e.attempts<jp&&!qp(s,n)){this.attempt(e,n,o,n.fallbackUrl??n.url);return}e.state="failed",e.controller=void 0,e.pinned=false,this.settle(e)}})}settle(e){this.inFlight--,this.flushWaiters(e.url),this.options.onSettled(),this.pump()}flushWaiters(e){const n=this.entries.get(e);if(!n)return;const o=n.waiters;n.waiters=[],o.forEach(r=>r())}evict(e){if(this.bytes<=this.budget)return;const n=[...this.entries.values()].filter(o=>o.state==="ready"&&!e.has(o.url)).sort((o,r)=>o.lastUsed-r.lastUsed);for(const o of n){if(this.bytes<=this.budget)break;this.entries.delete(o.url),this.bytes-=o.bytes,o.image&&ua(o.image),this.options.onEvict(o.url)}}}function fr(t){return t.width*t.height*4}function qp(t,e){if(e.fallbackUrl)return false;const n=t==null?void 0:t.status;return typeof n=="number"&&n>=400&&n<500&&n!==408&&n!==429}const Kp=.1;class Zp{constructor(e,n=r=>requestAnimationFrame(r),o=r=>cancelAnimationFrame(r)){L(this,"handle",0);L(this,"last",0);L(this,"disposed",false);L(this,"frame",e2=>{if(this.handle=0,this.disposed)return;const n2=this.last?Math.min((e2-this.last)/1e3,Kp):1/60;this.last=e2,this.tick(n2,e2)?this.invalidate():this.last=0});this.tick=e,this.raf=n,this.caf=o}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 Gp=2*1024*1024;function Xp(t,e,n=Gp){const o=new Set;let r=n,s=false;return{get deferred(){return s},getTile(i){const a=t(i);if(!a||a.kind==="media"||a.opaque||o.has(i)||e(i))return a;const c=a.width*a.height*4;if(o.size>0&&c>r){s=true;return}return r-=c,o.add(i),a}}}function Yp(t){const e=/^(!)?(\d+(?:\.\d+)?)$/.exec((t==null?void 0:t.trim())??"");if(!e)return null;const n=Number(e[2]);if(n>360)return null;const o=n%360,r=!!e[1];return o||r?{degrees:o,mirror:r}:null}function Jp(t,e,n){if(!t)return null;let o=t.trim().replace(/^xywh=/,""),r=false;o.startsWith("pct:")?(r=true,o=o.slice(4)):o.startsWith("pixel:")&&(o=o.slice(6));const s=o.split(",").map(Number);if(s.length!==4||s.some(m=>!Number.isFinite(m)))return null;let[i,a,c,l]=s;r&&(i=i/100*e,a=a/100*n,c=c/100*e,l=l/100*n);const d=Math.max(0,i),u=Math.max(0,a),p=Math.min(e,i+c),h=Math.min(n,a+l);return p<=d||h<=u?null:{x:d,y:u,width:p-d,height:h-u}}const hr=512,Qp=16e6;function Jc(t,e,n){return{width:e,height:n,levels:[{scaleFactor:1,width:e,height:n,tileWidth:e,tileHeight:n,cols:1,rows:1}],tile:r=>({...r,url:t,region:{x:0,y:0,width:e,height:n}})}}function tm(t){const{width:e,height:n}=t,o=[],r=t.regionByPx&&t.sizeByW,s=(p,h,m)=>{const g=Math.ceil(e/p),_=Math.ceil(n/p);return{scaleFactor:p,width:g,height:_,tileWidth:h,tileHeight:m,cols:Math.ceil(g/h),rows:Math.ceil(_/m)}},i=(p,h)=>({scaleFactor:e/p,width:p,height:h,tileWidth:p,tileHeight:h,cols:1,rows:1,whole:true}),a=t.tiles[0];if(a)for(const p of a.scaleFactors)o.push(s(p,a.width,a.height));else if(r)for(let p=1;;p*=2){const h=s(p,hr,hr);if(o.push(h),h.cols===1&&h.rows===1)break}const c=Math.max(0,...o.map(p=>p.scaleFactor));for(const p of t.sizes){const h=e/p.width;em(t,p.width,p.height)&&h>c+1e-9&&o.push(i(p.width,p.height))}const l=o.reduce((p,h)=>!p||h.scaleFactor>p.scaleFactor?h:p,null);if(l&&l.cols*l.rows>1&&t.sizeByW){const p=Math.max(e,n)/hr;o.push(i(Math.ceil(e/p),Math.ceil(n/p)))}(!o.length||!a&&!r&&e*n<=Qp)&&(o.some(p=>p.scaleFactor===1)||o.push(i(e,n)));const d=nm(o).sort((p,h)=>h.scaleFactor-p.scaleFactor),u=ah(t);return{width:e,height:n,levels:d,tile(p){const h=d[p.level],m=h.scaleFactor,g=h.cols===1&&h.rows===1;let _,w,S;if(g)_={x:0,y:0,width:e,height:n},w=h.width,S=h.height;else{const v=Math.round(p.col*h.tileWidth*m),y=Math.round(p.row*h.tileHeight*m);_={x:v,y,width:Math.min(Math.round(h.tileWidth*m),e-v),height:Math.min(Math.round(h.tileHeight*m),n-y)},w=Math.ceil(_.width/m),S=Math.ceil(_.height/m)}return{...p,region:_,url:po(t,_,w,S),fallbackUrl:u?po(t,_,w,S,u):void 0}}}}function em(t,e,n){return!(t.maxWidth&&e>t.maxWidth||t.maxHeight&&n>t.maxHeight||t.maxArea&&e*n>t.maxArea)}function nm(t){const e=new Map;for(const n of t){const o=`${n.width}x${n.height}`,r=e.get(o);(!r||r.cols*r.rows<n.cols*n.rows)&&e.set(o,n)}return[...e.values()]}function om(t,e){const n=t.levels;for(let o=0;o<n.length;o++)if(n[o].scaleFactor<=e*(1+1e-6))return o;return n.length-1}function Le(t,e,n){const o=t.levels[e],r=o.tileWidth*o.scaleFactor,s=o.tileHeight*o.scaleFactor,i=Math.max(0,n.x),a=Math.max(0,n.y),c=Math.min(t.width,n.x+n.width),l=Math.min(t.height,n.y+n.height);if(c<=i||l<=a)return[];const d=Math.max(0,Math.floor(i/r)),u=Math.min(o.cols-1,Math.floor((c-1e-9)/r)),p=Math.max(0,Math.floor(a/s)),h=Math.min(o.rows-1,Math.floor((l-1e-9)/s)),m=[];for(let g=p;g<=h;g++)for(let _=d;_<=u;_++)m.push({level:e,col:_,row:g});return m}async function rm(t,e){if(t.media)return sm(t,t.media);let n=null,o=null;if(t.service)try{n=tm(await ys(t.service,e.infoOptions))}catch(p){o=p}if(!n){if(!t.url)throw o??new Error("Image has no source");const p=await e.loadStatic(t.url);e.cache.seed(t.url,p),n=Jc(t.url,p.naturalWidth,p.naturalHeight)}const r=t.width&&t.height&&t.width>0&&t.height>0?{width:t.width,height:t.height}:{width:n.width,height:n.height},s=Jp(t.region,r.width,r.height)??{x:0,y:0,width:r.width,height:r.height},i=n.width/r.width,a=n.height/r.height,c={x:s.x*i,y:s.y*a,width:s.width*i,height:s.height*a},l=Yp(t.rotation),d=l?im(c,l):void 0,u={id:t.id,spec:t,pyramid:n,size:r,clip:c,contentClip:s,rect:{x:0,y:0,width:s.width,height:s.height},...d?{turn:d}:{}};return await e.cache.prefetch(Le(n,0,c).map(p=>{const h=n.tile(p);return{url:h.url,fallbackUrl:h.fallbackUrl}})),u}const Qc="media:";function sm(t,e){var a,c;const n=t.width||((a=t.placement)==null?void 0:a.width)||e.element.videoWidth||1600,o=t.height||((c=t.placement)==null?void 0:c.height)||e.element.videoHeight||900,r=`${Qc}${t.id}`,s={width:n,height:o},i={x:0,y:0,width:n,height:o};return{id:t.id,spec:t,pyramid:Jc(r,n,o),media:{kind:"media",source:e.element,width:n,height:o,naturalWidth:n,naturalHeight:o},size:s,clip:i,contentClip:i,rect:{...i}}}function im(t,{degrees:e,mirror:n}){const o=e*Math.PI/180,r=d=>Math.abs(d)<1e-12?0:d,s=r(Math.cos(o)),i=r(Math.sin(o)),a=Math.abs(t.width*s)+Math.abs(t.height*i),c=Math.abs(t.width*i)+Math.abs(t.height*s),l=fe(se(a/2,c/2),{a:s,b:i,c:-i,d:s,e:0,f:0},de(n?-1:1,1),se(-(t.x+t.width/2),-(t.y+t.height/2)));return{orient:l,unorient:Rh(l),width:a,height:c}}function tl(t){var e;return((e=t.turn)==null?void 0:e.orient)??se(-t.clip.x,-t.clip.y)}function am(t,e){const{turn:n,clip:o}=t;if(!n)return{...e,x:o.x+e.x,y:o.y+e.y};const r=Po(n.unorient,e),s=Math.max(r.x,o.x),i=Math.max(r.y,o.y);return{x:s,y:i,width:Math.max(0,Math.min(r.x+r.width,o.x+o.width)-s),height:Math.max(0,Math.min(r.y+r.height,o.y+o.height)-i)}}function cm(t,e){const{turn:n,clip:o}=t;return n?be(n.unorient,e):{x:o.x+e.x,y:o.y+e.y}}function da(t){const{turn:e,clip:n,contentClip:o}=t;return e?{width:e.width*o.width/n.width,height:e.height*o.height/n.height}:o}function lm(t){if(!t.length)return null;if(t.every(o=>o.spec.placement)){for(const o of t)o.rect={...o.spec.placement};return ws(t.map(o=>o.rect))}const e=da(t[0]).height;let n=0;for(const o of t){const r=da(o),s=r.width*e/r.height;o.rect={x:n,y:0,width:s,height:e},n+=s}return{x:0,y:0,width:n,height:e}}function Ao(t){const e=t.turn??t.clip;return{x:t.rect.width/e.width,y:t.rect.height/e.height}}function um(t){const e=Ao(t);return fe(se(t.rect.x,t.rect.y),de(e.x,e.y),tl(t))}function dm(t,e){var n,o;return t.service===e.service&&t.url===e.url&&t.width===e.width&&t.height===e.height&&t.region===e.region&&t.rotation===e.rotation&&((n=t.media)==null?void 0:n.element)===((o=e.media)==null?void 0:o.element)&&JSON.stringify(t.placement)===JSON.stringify(e.placement)}const fm=1e7,hm=15e6,pm=2e7,mm=2;function gm(t){const{items:e,camera:n,viewport:o,pixelRatio:r,getTile:s,destination:i}=t,a=Zc(n,o),c=[],l=[],d=[],u=(p,h,m)=>{const g=p.tile(h);l.push({url:g.url,fallbackUrl:g.fallbackUrl,priority:m})};for(const p of e){const{pyramid:h,clip:m,rect:g}=p,_=Ao(p);if(t.wantOverview)for(const Y of Le(h,0,m))u(h,Y,pm);const w=fa(p,n,o,r),S=i?fa(p,i,o,r):w;if(d.push((w==null?void 0:w.target)??-1),!w&&!S)continue;const v=Y=>J=>{const M=h.tile(J).region;return Math.hypot(M.x+M.width/2-Y.x,M.y+M.height/2-Y.y)};if(S){const Y=v(S.center);for(const J of Le(h,0,S.area))u(h,J,Y(J)/1e3);if(S.target>0)for(const J of Le(h,S.target,S.area))u(h,J,fm+Y(J))}if(!w)continue;const{area:y,target:x}=w,k=v(w.center),N=Le(h,0,y),D=x===0?[]:Le(h,x,y);if(S!==w){for(const J of N)u(h,J,k(J)/1e3);const Y=x-mm;if(Y>0)for(const J of Le(h,Y,y))u(h,J,hm+k(J))}if(p.spec.hidden)continue;const V=(x===0?N:D).every(Y=>s(h.tile(Y).url)!==void 0)?[x]:Array.from({length:x+1},(Y,J)=>J),nt=fe(a,se(g.x,g.y),de(_.x,_.y),tl(p));for(const Y of V){const J=Y===0?N:Y===x?D:Le(h,Y,y),M=h.levels[Y].cols*h.levels[Y].rows>1;for(const T of J){const O=h.tile(T),U=s(O.url);if(!U)continue;const Q=vm(p,O.region,U,nt,M);Q&&c.push({...Q,url:O.url})}}}return l.sort((p,h)=>p.priority-h.priority),{draws:c,wants:ym(l),levels:d}}function fa(t,e,n,o){const{pyramid:r,rect:s}=t,i=$r(e,n);if(!Fh(i,s))return null;const a=Ao(t),c=Math.max(i.x,s.x),l=Math.max(i.y,s.y),d=Math.min(i.x+i.width,s.x+s.width),u=Math.min(i.y+i.height,s.y+s.height),p=1/(a.x*e.zoom*o);return{area:am(t,{x:(c-s.x)/a.x,y:(l-s.y)/a.y,width:(d-c)/a.x,height:(u-l)/a.y}),center:cm(t,{x:(e.x-s.x)/a.x,y:(e.y-s.y)/a.y}),target:om(r,p)}}function vm(t,e,n,o,r){const{clip:s}=t,i=Math.max(e.x,s.x),a=Math.max(e.y,s.y),c=Math.min(e.x+e.width,s.x+s.width),l=Math.min(e.y+e.height,s.y+s.height);if(c<=i||l<=a)return null;const d=n.width/e.width,u=n.height/e.height,p=1e-6;return{item:t,image:n,transform:fe(o,se(e.x,e.y),de(1/d,1/u)),crop:{x:(i-e.x)*d,y:(a-e.y)*u,width:(c-i)*d,height:(l-a)*u},bleed:{right:r&&c<s.x+s.width-p,bottom:r&&l<s.y+s.height-p}}}function ym(t){const e=new Set;return t.filter(n=>e.has(n.url)?false:(e.add(n.url),true))}const bm={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},_m=2,wm=3,xm=.1,pr=1e-6,zr={top:0,right:0,bottom:0,left:0};function ha(t,e="padding"){if(!t||typeof getComputedStyle!="function")return zr;const n=getComputedStyle(t),o=r=>parseFloat(n.getPropertyValue(`${e}-${r}`))||0;return{top:o("top"),right:o("right"),bottom:o("bottom"),left:o("left")}}const Sm=(t,e)=>t.top===e.top&&t.right===e.right&&t.bottom===e.bottom&&t.left===e.left;let km;class Cm{constructor(e,n={}){L(this,"host");L(this,"overlays",null);L(this,"options");L(this,"backend",null);L(this,"backendPreference");L(this,"contextLosses",0);L(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});L(this,"visible",true);L(this,"dom",null);L(this,"domAsked",false);L(this,"pending",null);L(this,"camera");L(this,"loop");L(this,"gestures");L(this,"gestureOptions",{});L(this,"cache");L(this,"navigator",null);L(this,"navigatorAsked",0);L(this,"viewport",{width:1,height:1});L(this,"inset",zr);L(this,"pixelRatio",1);L(this,"items",[]);L(this,"worldBounds",null);L(this,"contentVersion",0);L(this,"opaqueUrls",new Set);L(this,"mediaByKey",new Map);L(this,"detachMedia",[]);L(this,"opened",false);L(this,"atHome",true);L(this,"interacting",false);L(this,"lastEmitted",null);L(this,"generation",0);L(this,"listeners",new Map);L(this,"unloadable",false);L(this,"resizeObserver",null);L(this,"intersectionObserver",null);L(this,"releaseTimer",null);L(this,"dprQuery",null);L(this,"disposed",false);L(this,"dismisser",null);L(this,"tick",e2=>{var c,l;if(this.disposed)return false;const n2=this.camera.step(e2,this.viewport),o2=this.camera.current,r2=this.backend,s=Xp(this.getTile,d=>r2?r2.has(d):true),i=gm({items:this.items,camera:o2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:s.getTile,wantOverview:!!this.navigator,destination:n2?this.camera.destination:void 0}),a=i.wants.filter(d=>!d.url.startsWith(Qc));return this.cache.update(a),i.draws.length?this.setUnloadable(false):a.length&&a.every(d=>this.cache.failed(d.url))&&this.setUnloadable(true),this.paint(i.draws),(c=this.overlays)==null||c.position(o2,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(d=>!d.spec.hidden),this.worldBounds,$r(o2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!na(this.lastEmitted,o2))&&(this.lastEmitted={...o2},this.opened&&this.emit("viewport")),n2||s.deferred});L(this,"getTile",e2=>this.mediaByKey.get(e2)??this.cache.get(e2));L(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});L(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=e,this.backendPreference=n.backend??"auto",this.options={...bm,...mr(n)},ma()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:o,springStiffness:r}=this.options;this.camera=new Ip({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,o===void 0?void 0:{duration:o,stiffness:r}),this.loop=new Zp(this.tick),this.gestureOptions=mr(n.gestures??{}),ma()&&(this.gestureOptions.flickMomentum=0),this.gestures=new Bp(e,this,{...Fr,...this.gestureOptions}),this.cache=new Vp({load:(s,i)=>this.loadTile(s,i),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:s=>{var i;return(i=this.backend)==null?void 0:i.release(s)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=Em(e),this.visible?this.acquireBackend():this.holder.hiddenSince=pa(),this.measure(),this.observe()}get backendKind(){var e;return((e=this.backend)==null?void 0:e.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(e,n){let o=this.listeners.get(e);return o||(o=new Set,this.listeners.set(e,o)),o.add(n),()=>o==null?void 0:o.delete(n)}async setImages(e,{world:n,fit:o=false}={}){const r=++this.generation,s=new Map(this.items.map(d=>[d.id,d])),i=await Promise.allSettled(e.map(d=>{const u=s.get(d.id);return u&&dm(u.spec,d)?(u.spec=d,Promise.resolve(u)):rm(d,{cache:this.cache,loadStatic:p=>this.loadTile(p),infoOptions:{request:this.options.request}})}));if(r!==this.generation||this.disposed)return;const a=i.filter(d=>d.status==="fulfilled").map(d=>d.value),c=i.filter(d=>d.status==="rejected").map(d=>d.reason);this.items=a,this.watchMedia(a);const l=lm(a);if(this.worldBounds=n?l?ws([n,l]):n:l,this.contentVersion++,c.length&&this.emit("error",c),this.setUnloadable(e.length>0&&!a.length&&c.length>0),!this.worldBounds){this.invalidate();return}this.opened?o?(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(e){const n=new Set(e);let o=false;for(const r of this.items){const s=n.has(r.id);!!r.spec.hidden!==s&&(r.spec={...r.spec,hidden:s},o=true)}o&&this.invalidate()}isReady(e){const n=this.items.find(r=>r.id===e);if(!n)return false;if(n.spec.media)return true;const o=n.pyramid.levels[0];if(!o)return false;for(let r=0;r<o.rows;r++)for(let s=0;s<o.cols;s++)if(!this.getTile(n.pyramid.tile({level:0,col:s,row:r}).url))return false;return true}fitBounds(e,n=false,o=zr){const r=this.fit(e,this.camera.destination.rotation,o);this.atHome=false,this.animateTo(this.constrain(r,{allowBeyondLimits:true}),n)}fit(e,n,{top:o,right:r,bottom:s,left:i},a=1/0){const{width:c,height:l}=this.viewport,d=Cp(e,{width:Math.max(1,c-i-r),height:Math.max(1,l-o-s)},n),u=Math.min(d.zoom,a);return{...yo(Wc(e),{x:(c+i-r)/2,y:(l+o-s)/2},u,n,this.viewport),zoom:u,rotation:n}}fitItemRect(e,n,o=false){const r=this.itemRectToWorld(e,n);r&&this.fitAnnotation(r,o)}fitAnnotation(e,n=false){var s;const o=this.items[0];if(!o)return;const r=o.rect.width*xm;this.fitBounds({x:e.x-r,y:e.y-r,width:e.width+r*2,height:e.height+r*2},n,ha((s=this.overlays)==null?void 0:s.container,"scroll-padding"))}getBounds(){return $r(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var n;const e=((n=this.homeCamera())==null?void 0:n.zoom)??1;return{home:e,min:e*this.options.minZoomImageRatio,max:Math.max(e,this.closestZoom())}}closestZoom(){const e=this.items.length?Math.min(...this.items.map(n=>Ao(n).x)):1;return this.options.maxZoomPixelRatio/e}home(e=false){const n=this.homeCamera();if(!n)return;const o=this.atHome;this.atHome=true,this.animateTo(n,e),!o&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-pr)}viewLimits(){const{zoom:e,x:n,y:o,rotation:r}=this.camera.destination,{min:s,max:i}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:e>=i*(1-pr),atMin:e<=s*(1+pr),atHome:this.atHome&&(!a||Math.abs(e/a.zoom-1)<.001&&Math.hypot(n-a.x,o-a.y)*e<.5&&Math.abs(r-a.rotation)<.001)}}zoomBy(e,n,o=true){const r=o?this.camera.destination:this.camera.current,s=n??{x:this.viewport.width/2,y:this.viewport.height/2},i=ea(r,this.viewport,s),{min:a,max:c}=this.getZoomLimits(),l=wn(r.zoom*e,a,c),d=yo(i,s,l,r.rotation,this.viewport),u=this.constrain({...r,...d,zoom:l});this.atHome=false,o?this.camera.animateTo({state:u,anchor:{world:i,screen:s}},this.viewport):this.camera.set(u),this.invalidate()}panBy(e,n,o=false){const r=o?this.camera.destination:this.camera.current,s=be(fe(de(1/r.zoom),Fn(-r.rotation)),{x:e,y:n}),i=this.constrain({...r,x:r.x-s.x,y:r.y-s.y});this.atHome=false,o?this.camera.animateTo({state:i},this.viewport):this.camera.set(i),this.invalidate()}panTo(e,n=false){const o=n?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...o,...e}),n)}rotateBy(e){const n=this.camera.destination;this.setRotation(n.rotation*180/Math.PI+e)}setRotation(e,n=false){const o=this.camera.destination,r=e*Math.PI/180;this.animateTo(this.constrain({...o,rotation:r}),n)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(e){this.emit("tap",e)}setDismiss(e){this.dismisser=e}dismiss(){var e;return((e=this.dismisser)==null?void 0:e.call(this))??false}setGestures(e){this.gestures.setOptions({...Fr,...this.gestureOptions,...mr(e)})}setInteracting(e){if(this.interacting=e,e){this.camera.stop();return}if(this.options.constrainDuringPan)return;const n=this.camera.destination,o=this.constrain(n);na(n,o)||this.animateTo(o,false)}worldToScreenPoint(e){return kp(this.camera.current,this.viewport,e)}screenToWorldPoint(e){return ea(this.camera.current,this.viewport,e)}itemRectToWorld(e,n){const o=this.items[e];if(!o)return null;const{contentClip:r,clip:s}=o;if(o.turn)return Po(fe(um(o),de(s.width/r.width,s.height/r.height)),n);const i=o.rect.width/r.width,a=o.rect.height/r.height;return{x:o.rect.x+(n.x-r.x)*i,y:o.rect.y+(n.y-r.y)*a,width:n.width*i,height:n.height*a}}attachNavigator(e){var s;(s=this.navigator)==null||s.dispose(),this.navigator=null;const n=++this.navigatorAsked;let o=null,r=false;return import("./Navigator-BVkHzfLs.mjs").then(i=>{r||this.disposed||n!==this.navigatorAsked||(o=new i.Navigator(e,(a,c)=>this.panTo(a,c)),this.navigator=o,this.invalidate())}),()=>{r=true,o==null||o.dispose(),o&&this.navigator===o&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var e,n,o,r,s,i,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(e=this.resizeObserver)==null||e.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),(r=(o=this.dprQuery)==null?void 0:o.removeEventListener)==null||r.call(o,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(s=this.navigator)==null||s.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(i=this.dom)==null||i.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(c=>c()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}watchMedia(e){this.detachMedia.forEach(n=>n()),this.detachMedia=[],this.mediaByKey.clear();for(const n of e){if(!n.media||n.media.kind!=="media")continue;const o=n.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(o,n.media);const r=n.media.source,s=()=>this.invalidate(),i=["play","seeked","loadeddata","resize"];i.forEach(a=>r.addEventListener(a,s)),this.detachMedia.push(()=>i.forEach(a=>r.removeEventListener(a,s)))}}paint(e){const n=this.backend,o=[],r=(n==null?void 0:n.kind)==="webgl2";n==null||n.begin();for(const s of e){const{image:i}=s;if(!(i.kind==="media"||i.kind==="element"&&r&&(i.opaque||this.opaqueUrls.has(s.url)))&&n){if(n.draw({key:s.url,source:i.source,width:i.width,height:i.height,transform:s.transform,crop:s.crop,opacity:1,bleed:s.bleed})!=="tainted"||i.kind==="bitmap")continue;this.opaqueUrls.add(s.url)}(i.kind==="element"||i.kind==="media")&&o.push({key:`${s.item.id}|${s.url}`,element:i.source,width:i.width,height:i.height,transform:s.transform,crop:s.crop,opacity:1})}n==null||n.end(),this.dom?this.dom.sync(o):o.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-Bo7DQUIZ.mjs").then(({DomLayers:s})=>{if(this.disposed)return;const i=new s(this.host);this.overlays&&this.host.insertBefore(i.container,this.overlays.container),this.dom=i,this.invalidate()}))}loadTile(e,n){return Fp(e,{signal:n,request:this.options.request,maxTextureSize:this.backend instanceof vo?this.backend.maxTextureSize:void 0})}animateTo(e,n){this.camera.animateTo({state:e},this.viewport,n),this.invalidate()}homeCamera(){if(!this.worldBounds)return null;const e=2*Math.PI,n=Math.round(this.camera.destination.rotation/e)*e||0;return this.fit(this.worldBounds,n,this.inset,this.options.upscale?1/0:this.closestZoom())}constrain(e,{allowBeyondLimits:n=false}={}){const o=this.worldBounds;if(!o)return e;const{min:r,max:s}=this.getZoomLimits(),i=n?wn(e.zoom,r,Math.max(s,e.zoom)):wn(e.zoom,r,s);return this.interacting&&!this.options.constrainDuringPan?{...e,zoom:i}:{...e,zoom:i,x:wn(e.x,o.x,o.x+o.width),y:wn(e.y,o.y,o.y+o.height)}}acquireBackend(e=true){var s,i;if(this.backend||this.pending||this.disposed)return;const n=document.createElement("canvas");n.className="clover-canvas-surface",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(n,((s=this.dom)==null?void 0:s.container)??((i=this.overlays)==null?void 0:i.container)??null);const o=e&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<wm);let r=null;o&&(vp(this.holder)||this.backendPreference==="webgl2")&&(r=vo.create(n,{onLost:this.onContextLost}),r||Qi(this.holder)),r?this.install(r):this.backendPreference==="webgl2"?this.none(n):(this.pending=n,(km??(km=import("./Canvas2DBackend-B5QR4dhT.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==n)return;this.pending=null;const c=a.create(n);c?this.install(c):this.none(n)}))}none(e){e.remove(),this.host.dataset.backend="none"}install(e){this.backend=e,this.host.dataset.backend=e.kind,e.resize(this.viewport.width,this.viewport.height,this.pixelRatio),e.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",e.kind),this.invalidate()}releaseBackend(){var n;if(Qi(this.holder),(n=this.pending)==null||n.remove(),this.pending=null,!this.backend)return;const e=this.backend.canvas;this.backend.dispose(),e.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(e=>{const n=e.some(o=>o.isIntersecting);this.setVisible(n)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(e){var n;if(this.visible=e,e){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(n=this.holder).hiddenSince??(n.hiddenSince=pa()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(e=false){var c;const n=this.host.getBoundingClientRect(),o=Math.max(1,n.width),r=Math.max(1,n.height),s=ha(this.host),i=Math.min(typeof window<"u"&&window.devicePixelRatio||1,_m);if(o===this.viewport.width&&r===this.viewport.height&&i===this.pixelRatio&&Sm(s,this.inset))return;const a=this.viewport;if(this.viewport={width:o,height:r},this.inset=s,this.pixelRatio=i,(c=this.backend)==null||c.resize(o,r,i),this.opened){if(this.atHome)this.home(true);else{const l=this.camera.current,d=o/Math.max(a.width,1);this.camera.set(this.constrain({...l,zoom:l.zoom*d}))}this.emit("viewport")}e?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var e,n,o,r;typeof window>"u"||typeof window.matchMedia!="function"||((n=(e=this.dprQuery)==null?void 0:e.removeEventListener)==null||n.call(e,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(r=(o=this.dprQuery).addEventListener)==null||r.call(o,"change",this.onPixelRatioChange))}setUnloadable(e){e!==this.unloadable&&(this.unloadable=e,this.emit("unloadable",e))}emit(e,n){var o;(o=this.listeners.get(e))==null||o.forEach(r=>r(n))}}const pa=()=>typeof performance<"u"?performance.now():Date.now();function Em(t){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:e,left:n,width:o,height:r}=t.getBoundingClientRect();return e+r>=0&&n+o>=0&&e<=window.innerHeight&&n<=window.innerWidth}function ma(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function mr(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}const Mm=(t,e)=>new Cm(t,e),Tm=vt(()=>import("./Connected-CjKNxIxy.mjs")),Im=vt(()=>import("./Connected-Dt8bLgZK.mjs").then(t=>t.C));function Lm({className:t,style:e,renderers:n,collapseControls:o,onContentStateChange:r,children:s,...i}){var m;const a=ae("Body");Mc(a.clover,r);const c=xs(),l=bt(()=>lf(c),[c]),d=uf(n??a.renderers,{canvases:c,bodies:l}),u=d==null?void 0:d.component,p=((m=c.find(({type:g})=>g==="Scene"||g==="Timeline"))==null?void 0:m.type)??"Canvas",h=st(g=>g.status==="loading");return f("div",{"aria-busy":h,className:It("clover-body",t),"data-renderer":u?"custom":p.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...e},children:[u?f(u,{canvases:c,bodies:l,children:s}):p==="Scene"?f(St,{fallback:f(En,{overlay:true}),children:f(Im,{...i,children:s})}):p==="Timeline"?f(St,{fallback:f(En,{overlay:true}),children:f(Tm,{...i,children:s})}):f(mp,{...i,collapseControls:o,surface:Mm,children:s}),h&&f(En,{overlay:true})]})}const Pm={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function Dn(t){return t.replace(/<br\s*\/?>/gi,`
24
24
  `).replace(/<[^>]*>/g,"").replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){const o=n[1]==="x"||n[1]==="X"?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return o>0&&o<=1114111?String.fromCodePoint(o):e}return Pm[n.toLowerCase()]??e})}const Am=t=>/<[a-z!/]|&(#x?[0-9a-f]+|[a-z]+);/i.test(t);function Om(t,e=""){const n=t==null?void 0:t.split(";")[0].trim().toLowerCase();if(n)return n==="text/html"?"html":n==="text/markdown"?"markdown":"plain";const o=e.trim();return o.startsWith("<")&&o.endsWith(">")?"html":"plain"}function Nm(t){return t.replace(/\r\n?/g,`
25
25
  `).replace(/^\[\^[^\]]+\]:[ \t]*/gm,"").replace(/\[\^[^\]]+\]/g,"").replace(/^#{1,6}[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/gm,"$1").replace(/^[ \t]*(?:[-*+]|\d+[.)])[ \t]+/gm,"").replace(/\[([^\]]+)\]\((?:https?:\/\/|mailto:)[^\s)]+\)/g,"$1").replace(/\*\*([^*]+)\*\*|__([^_]+)__/g,(e,n,o)=>n??o).replace(/\*([^*\s][^*]*)\*|_([^_\s][^_]*)_/g,(e,n,o)=>n??o).replace(/\\\n/g,`
26
26
  `).replace(/\n\s*\n/g,`
27
- `).trim()}const Oo=(t,e)=>e==="canvas"?Ve(t.manifest,t.canvasId):t.manifest,el=he(null),Ss=()=>jt(el),sn=ie(function({of:e="manifest",label:n,as:o="span",className:r,...s},i){var p;const a=Rn(h=>{var m,g;return e==="canvas"?(m=Ve(h.manifest,h.canvasId))==null?void 0:m.label:(g=h.manifest)==null?void 0:g.label},void 0),c=Ss(),l=(p=Ne())==null?void 0:p.language,{text:d,lang:u}=wt(n??(c?c.label:a),l);return d?f(o,{ref:i,className:It("clover-label",r),...dt(u),...s,children:Dn(d)}):null});function Rm(t,e,n){const o=(d,u)=>Math.min(Math.max(Math.round(d),0),u),r=n?o(n.x*t.width,t.width-1):0,s=n?o(n.y*t.height,t.height-1):0,i={x:r,y:s,width:n?Math.max(1,o(n.width*t.width,t.width-r)):t.width,height:n?Math.max(1,o(n.height*t.height,t.height-s)):t.height},a=i.width===t.width&&i.height===t.height;if(!a&&!t.regionByPx)return null;if(t.sizeByW){let d=Math.min(1,e/Math.max(i.width,i.height));return t.maxWidth&&(d=Math.min(d,t.maxWidth/i.width)),t.maxHeight&&(d=Math.min(d,t.maxHeight/i.height)),t.maxArea&&(d=Math.min(d,Math.sqrt(t.maxArea/(i.width*i.height)))),po(t,i,Math.max(1,Math.floor(i.width*d)),Math.max(1,Math.floor(i.height*d)))}if(!a)return null;const c=[...t.sizes].sort((d,u)=>d.width-u.width),l=c.find(d=>Math.max(d.width,d.height)>=e)??c.at(-1)??{width:t.width,height:t.height};return po(t,i,l.width,l.height)}function an(t){var e;return(e=ps(t).find(({body:n})=>n.type==="Image"||n.id&&!n.type))==null?void 0:e.body}function Bm(t,{width:e,height:n}){if(t==="full")return{x:0,y:0,width:1,height:1};const o=/^(pct:)?([\d.]+),([\d.]+),([\d.]+),([\d.]+)$/.exec(t);if(!o)return null;const[r,s,i,a]=o.slice(2).map(Number),[c,l]=o[1]?[100,100]:[e,n];return{x:r/c,y:s/l,width:i/c,height:a/l}}function _e(t,e="full",n=false){if(!t)return null;const o=Io(t.service);if(o){if(e!=="full")return{service:o,region:e,fallback:t.id};const{width:r,height:s}=t;return n&&t.id&&r>0&&s>0?{service:o,fallback:t.id,fallbackSize:{width:r,height:s}}:{service:o,fallback:t.id}}return t.id?{src:t.id}:null}function ks(t){const e=t;return e?_e(W(e.thumbnail)[0],"full",true)??_e(an(e))??_e(an(e.placeholderContainer))??_e(an(e.accompanyingContainer)):null}function $m(t){const e=t;return e?_e(an(e))??_e(an(e.placeholderContainer))??_e(an(e.accompanyingContainer))??_e(W(e.thumbnail)[0],"full",true):null}async function Cs(t,e=200,n){if(t.src)return t.src;if(!t.service)return t.fallback;const o=t.fallbackSize;if(o&&t.fallback&&t.region===void 0){const r=Math.max(o.width,o.height);if(r>=e&&r<=e*2)return t.fallback}try{const r=await ys(t.service,{request:n}),s=typeof t.region=="string"?Bm(t.region,r):t.region;return s===null?t.fallback:Rm(r,e,s)??t.fallback}catch{return t.fallback}}const Fm=Object.freeze(Object.defineProperty({__proto__:null,imageSource:_e,resolveThumbnail:Cs,stillSource:$m,thumbnailSource:ks},Symbol.toStringTag,{value:"Module"})),ga='.clover-items-item[role="option"], .clover-items-link',rn=new Map;let $t=null,re=null,Hr=0;function Es(t){const e=rn.get(t);if(!e)return;const n=t.clientHeight>0&&t.scrollHeight>t.clientHeight+1;n!==e.cut&&(e.cut=n,e.change(n))}function Wr(){cancelAnimationFrame(Hr),Hr=requestAnimationFrame(()=>rn.forEach((t,e)=>Es(e)))}function nl(t){var r,s;if(t.key!=="Escape")return;const e=new Set,n=(s=(r=document.activeElement)==null?void 0:r.closest)==null?void 0:s.call(r,ga);n&&e.add(n);try{document.querySelectorAll(`:is(${ga}):hover`).forEach(i=>e.add(i))}catch{}const o=[...e].filter(i=>i.dataset.fullHidden===void 0&&i.querySelector(".clover-items-label-full"));o.length&&(t.preventDefault(),t.stopPropagation(),o.forEach(i=>Ic(i,"fullHidden",["pointerenter",i===n?"blur":"focus"])))}function Dm(){var t,e;$t=typeof ResizeObserver>"u"?null:new ResizeObserver(n=>n.forEach(o=>Es(o.target))),re=typeof MutationObserver>"u"?null:new MutationObserver(Wr),re==null||re.observe(document.head,{childList:true,subtree:true,characterData:true}),re==null||re.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),(e=(t=document.fonts)==null?void 0:t.addEventListener)==null||e.call(t,"loadingdone",Wr),document.addEventListener("keydown",nl,true)}function zm(){var t,e,n;cancelAnimationFrame(Hr),(t=$t==null?void 0:$t.disconnect)==null||t.call($t),re==null||re.disconnect(),$t=re=null,(n=(e=document.fonts)==null?void 0:e.removeEventListener)==null||n.call(e,"loadingdone",Wr),document.removeEventListener("keydown",nl,true)}function Hm(t,e){var n;return rn.size||Dm(),rn.set(t,{change:e}),(n=$t==null?void 0:$t.observe)==null||n.call($t,t),Es(t),()=>{var o;rn.delete(t),(o=$t==null?void 0:$t.unobserve)==null||o.call($t,t),rn.size||zm()}}const Wm=/^(-?\d{4,})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?)?/;function ol(t,e){if(typeof t!="string")return null;const n=Wm.exec(t.trim());if(!n)return null;const[o,r,s,i=0,a=0,c=0]=n.slice(1,7).map(u=>u===void 0?void 0:Number(u)),l=new Date(Date.UTC(2e3,r-1,s,i,a,c));if(l.setUTCFullYear(o),l.getUTCMonth()!==r-1||l.getUTCDate()!==s)return null;const d=!i&&!a&&!c&&!Number(n[7]??0);return{at:l,precision:e??(d?s!==1?"day":r!==1?"month":"year":"time")}}const Um=vt(()=>import("./NavDate-B32M8WGG.mjs").then(t=>t.a).then(({NavDate:t})=>({default:t})));function jm(t,e,n,o){const r=t.source!==void 0?t.source:ks(t.resource),[s,i]=H(r==null?void 0:r.src),a=(r==null?void 0:r.src)??(r==null?void 0:r.service)??(r==null?void 0:r.fallback);return F(()=>{if(!r)return i(void 0);if(r.src)return i(r.src);if(!o)return;let c=true;return Cs(r,e,n).then(l=>{c&&i(l)}),()=>{c=false}},[a,e,o]),{src:s,none:!r}}const Vm=()=>f("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",children:[f("path",{d:"M232 416a24 24 0 01-14.9-5.2L125.8 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.8l91.3-74.8A24 24 0 01256 120v272a24 24 0 01-24 24z"}),f("path",{d:"M336 176a112 112 0 010 160M384 128a176 176 0 010 256",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"32"})]});function qm({part:t,size:e,request:n,alt:o,altLang:r}){const[s,i]=H(null),a=Hc(s,zc,s==null?void 0:s.closest('[data-layout="slider"] .clover-items-viewport')),{src:c,none:l}=jm(t,e,n,a),[d,u]=H(false),{width:p,height:h}=t.resource??{},m=p&&h?p/h:1;return f("span",{ref:i,className:"clover-items-picture","data-loaded":d,"data-empty":c?void 0:true,style:c&&!(p&&h)?void 0:{"--clover-items-ratio":m},children:[!c&&l&&Bn(t.media)&&f(Vm,{}),c&&f("img",{src:c,alt:o,...dt(o?r:void 0),width:e,height:Math.round(e/m),loading:"lazy",decoding:"async",draggable:false,onLoad:()=>u(true),onError:()=>u(true)}),t.duration?f("span",{className:"clover-items-duration",children:ch(t.duration)}):null]})}function Km({text:t,lang:e,first:n}){const o=R(null),[r,s]=H(false);return F(()=>{const i=o.current;if(!(!i||!t))return Hm(i,s)},[t]),f("span",{className:"clover-items-label","data-clamped":r||void 0,children:[!n&&" ",f("span",{ref:o,className:"clover-items-label-text",...dt(t?e:void 0),children:t}),r&&f("span",{className:"clover-items-label-full",...dt(e),"aria-hidden":"true",hidden:true,children:t})]})}function Zm({item:t,size:e,language:n,request:o,showSummary:r=false,secondary:s="summary",labels:i=true}){var u,p;const a=t.parts.map(h=>wt(t.parts.length===1?t.label:h.label,n)),c=r&&s==="summary"?wt(t.summary,n):null,l=r&&s==="navDate"?ol(t.navDate):null,d=a.some(h=>h.text);return f("figure",{role:"none",className:"clover-items-figure","data-parts":t.parts.length,"data-media":(p=(u=t.parts[0])==null?void 0:u.media)==null?void 0:p.toLowerCase(),style:{"--parts":t.parts.length},children:[f("span",{className:"clover-items-pictures",children:t.parts.map((h,m)=>{const g=a[m].text?{text:""}:wt(h.label,n);return f(qm,{part:h,size:e,request:o,alt:g.text,altLang:g.lang},h.id)})}),(d||l||(c==null?void 0:c.text))&&f("figcaption",{className:"clover-items-caption",style:i?void 0:Ue,children:[a.map((h,m)=>f(Km,{text:h.text,lang:h.lang,first:m===0},t.parts[m].id)),l&&f(St,{fallback:null,children:f(Um,{value:t.navDate,className:"clover-items-date"})}),(c==null?void 0:c.text)&&f("span",{className:"clover-items-summary",...dt(c.lang),children:c.text.replace(/<[^>]*>/g,"")})]})]})}function Gm(t){var e;return(e=ps(t).find(({body:n})=>n.type))==null?void 0:e.body.type}function rl(t){const e=Gm(t)??(t.type==="Timeline"?"Sound":void 0);return{id:t.id,type:t.type,label:t.label,resource:t,duration:Number(t.duration)||void 0,media:e}}const va=new WeakMap;function sl(t){if(!t)return[];let e=va.get(t);if(!e){const{canvases:n,views:o}=Bt(t);e=o.map(r=>{const s=r.map(i=>rl(n[i]));return{id:s[0].id,parts:s,label:s.length===1?s[0].label:{none:[s.map(i=>wt(i.label).text).filter(Boolean).join(" \u2013 ")]}}}),va.set(t,e)}return e}const ya=new WeakMap;function bo(t){if(!t)return[];let e=ya.get(t);return e||(e=W(t.items).filter(n=>n==null?void 0:n.id).map(n=>{var o;return{id:n.id,parts:[rl(n)],label:n.label,summary:n.summary,...typeof n.navDate=="string"?{navDate:n.navDate}:{},href:((o=W(n.homepage)[0])==null?void 0:o.id)??n.id,...Ln(W(n.homepage)[0])?{hrefLang:Ln(W(n.homepage)[0])}:{}}}),ya.set(t,e)),e}function ky(t){return t?Array.isArray(t)?bo({items:t}):t.type==="Collection"?bo(t):sl(t):[]}function il(t){const e=Math.max(1,Math.round(t));return e<=6?`h${e}`:null}const Ms=(t,e="p")=>il(t)??e;function al(t,e,n="p"){const o=il(t);return o?{as:o,title:{},group:{}}:{as:n,title:{id:e},group:{role:"group","aria-labelledby":e}}}function Xm(t,e,{orientation:n="both",rtl:o=false,onActivate:r,onMove:s}={}){const[i,a]=H(Math.max(0,e)),c=R([]),l=R(r);l.current=r;const d=R(s);d.current=s,F(()=>{e>=0&&a(e)},[e]);const u=Math.min(i,Math.max(0,t-1)),p=ut(g=>{var _;a(g),(_=c.current[g])==null||_.focus()},[]),h=ut((g,_)=>{var k,N;const w=o?"ArrowLeft":"ArrowRight",S=o?"ArrowRight":"ArrowLeft",v=n!=="vertical",y=n!=="horizontal";let x=null;if(v&&g.key===w||y&&g.key==="ArrowDown")x=Math.min(t-1,_+1);else if(v&&g.key===S||y&&g.key==="ArrowUp")x=Math.max(0,_-1);else if(g.key==="Home")x=0;else if(g.key==="End")x=t-1;else if(g.key==="Enter"||g.key===" "){(k=l.current)==null||k.call(l,_,g),g.preventDefault();return}x!==null&&(g.preventDefault(),p(x),x!==_&&((N=d.current)==null||N.call(d,x,g)))},[t,n,o,p]);return{focused:u,itemProps:g=>({ref:_=>{c.current[g]=_},tabIndex:g===u?0:-1,onKeyDown:_=>h(_,g),onFocus:()=>a(g)})}}const Ym=5,Jm=()=>{var t;return typeof window<"u"&&!!((t=window.matchMedia)!=null&&t.call(window,"(prefers-reduced-motion: reduce)").matches)};function cl({align:t="start",dragFree:e=false,itemCount:n=0,axis:o="x"}={}){const r=o==="y",[s,i]=H(null),[a,c]=H(false),[l,d]=H(false),u=R(t);u.current=t;const p=e?"none":`${o} mandatory`,h=ut(()=>{if(!s)return;const v=Math.abs(r?s.scrollTop:s.scrollLeft),y=r?s.scrollHeight-s.clientHeight:s.scrollWidth-s.clientWidth;c(v>1),d(v<y-1)},[s,r]);F(()=>{if(!s)return;const v=s.style;v.overflowX=r?"hidden":"auto",v.overflowY=r?"auto":"hidden",v.scrollSnapType=p,v.setProperty("--clover-track-align",t),r?v.overscrollBehaviorY="contain":v.overscrollBehaviorX="contain"},[s,p,t,r]),F(()=>{if(!s)return;let v=0;const y=()=>{cancelAnimationFrame(v),v=requestAnimationFrame(h)};h(),s.addEventListener("scroll",y,{passive:true});const x=typeof ResizeObserver<"u"?new ResizeObserver(y):null;return x==null||x.observe(s),s.firstElementChild&&(x==null||x.observe(s.firstElementChild)),()=>{cancelAnimationFrame(v),s.removeEventListener("scroll",y),x==null||x.disconnect()}},[s,h,n]);const m=ut((v,y=false)=>{if(!s||!v)return;const x=y||Jm()?"auto":"smooth";s.scrollBy({[r?"top":"left"]:v,behavior:x})},[s,r]),g=ut((v,{instant:y=false}={})=>{const x=s==null?void 0:s.querySelector(`[data-track-index="${v}"]`);if(!s||!x)return false;const k=s.getBoundingClientRect(),N=x.getBoundingClientRect(),D=getComputedStyle(s).direction==="rtl";return r?(m(u.current==="center"?N.top+N.height/2-(k.top+k.height/2):N.top-k.top,y),true):(m(u.current==="center"?N.left+N.width/2-(k.left+k.width/2):D?N.right-k.right:N.left-k.left,y),true)},[s,m,r]),_=ut(v=>{if(!s)return;const y=!r&&getComputedStyle(s).direction==="rtl",x=r?s.clientHeight:s.clientWidth;m(v*x*.9*(y?-1:1))},[s,m,r]),w=ut(()=>_(1),[_]),S=ut(()=>_(-1),[_]);return F(()=>{if(!s)return;let v=null,y=false;const x=j=>{j.pointerType!=="mouse"||j.button!==0||(v={x:r?j.clientY:j.clientX,scroll:r?s.scrollTop:s.scrollLeft},y=false)},k=j=>{var V;if(!v)return;const et=(r?j.clientY:j.clientX)-v.x;!y&&Math.abs(et)<Ym||(y||(y=true,(V=s.setPointerCapture)==null||V.call(s,j.pointerId),s.style.scrollSnapType="none",s.dataset.dragging="true"),r?s.scrollTop=v.scroll-et:s.scrollLeft=v.scroll-et)},N=j=>{var et;v&&(v=null,y&&((et=s.releasePointerCapture)==null||et.call(s,j.pointerId),delete s.dataset.dragging,s.style.scrollSnapType=p))},D=j=>{y&&(y=false,j.preventDefault(),j.stopPropagation())};return s.addEventListener("pointerdown",x),s.addEventListener("pointermove",k),s.addEventListener("pointerup",N),s.addEventListener("pointercancel",N),s.addEventListener("click",D,true),()=>{s.removeEventListener("pointerdown",x),s.removeEventListener("pointermove",k),s.removeEventListener("pointerup",N),s.removeEventListener("pointercancel",N),s.removeEventListener("click",D,true)}},[s,p,r]),{ref:i,canScrollPrev:a,canScrollNext:l,scrollPrev:S,scrollNext:w,scrollToIndex:g,measure:h}}const _o=ie(function(e,n){return!Ne()||e.iiifContent!==void 0||e.items!==void 0?f(St,{fallback:null,children:f(Qm,{...e,forwardedRef:n})}):f(tg,{...e,forwardedRef:n})}),Qm=vt(()=>import("./StandaloneItems-DYrbonjJ.mjs"));function tg({of:t="views",...e}){return t==="targets"?f(ng,{...e}):t==="annotations"?f(rg,{...e}):t==="members"?f(ll,{...e}):f(sg,{...e})}const eg=vt(()=>import("./TargetItems-l-tLGkfE.mjs"));function ng(t){return st(n=>{var o;return(((o=n.targets)==null?void 0:o.items.length)??0)>1})?f(St,{fallback:null,children:f(eg,{...t})}):null}const og=vt(()=>import("./AnnotationItems-OHw3CidZ.mjs"));function rg(t){return st(n=>!!pc(n.manifest,n.addedSets))?f(St,{fallback:null,children:f(og,{...t})}):null}function ll({onSelect:t,forwardedRef:e,...n}){const{clover:o,language:r}=Ne(),s=st(d=>d.collection),i=st(d=>{var u;return((u=d.manifest)==null?void 0:u.id)??null}),a=bo(s),c=ss(s==null?void 0:s.viewingDirection);if(!a.length)return null;const l=(d,u)=>{t==null||t(d,u),o.goToManifest(d.id)};if(n.layout==="pager"){const d=a.findIndex(u=>u.id===i);return f(dl,{...n,forwardedRef:e,steps:ul(a,d,c,l),nameKey:"informationPanelTabsCollection",position:f(ag,{position:d,total:a.length,list:u=>f(ll,{layout:"list",forwardedRef:null,onSelect:u})})})}return f(fl,{...n,forwardedRef:e,items:a,selected:a.findIndex(d=>d.id===i),navigation:"id",rtl:c==="right-to-left",language:r,request:o.request,showSummary:true,onActivate:l})}function sg({onSelect:t,forwardedRef:e,singleItem:n=false,...o}){const{clover:r,language:s}=Ne(),i=st(u=>u.manifest),a=st(u=>$n(u.manifest,u.canvasId)),c=st(u=>Bt(u.manifest).direction),l=sl(i);if(l.length<(n?1:2))return null;const d=u=>r.goTo(u.id);return o.layout==="pager"?f(dl,{...o,forwardedRef:e,steps:ul(l,a,c,d)}):f(fl,{...o,forwardedRef:e,items:l,selected:a,navigation:"id",rtl:c==="right-to-left",language:s,request:r.request,onActivate:(u,p)=>{t==null||t(u,p),r.goTo(u.id)},followFocus:d})}function ul(t,e,n,o){return{position:e,total:t.length,direction:n,step:(r,s)=>{const i=t[e+r];i&&o(i,s)}}}const ig=vt(()=>import("./PagerLayout-BgvyIDpY.mjs")),ag=vt(()=>import("./PagerLayout-BgvyIDpY.mjs").then(({CountMenu:t})=>({default:t})));function dl(t){return f(St,{fallback:null,children:f(ig,{...t})})}function fl({forwardedRef:t,items:e,selected:n,navigation:o,rtl:r=false,layout:s="slider",orientation:i="horizontal",thumbnailSize:a=200,request:c,language:l,showSummary:d=false,secondary:u="summary",labels:p=true,heading:h,headingLevel:m=2,renderItem:g,onActivate:_,followFocus:w,as:S="section",className:v,"aria-label":y,size:x,singleItem:k,highContrast:N,...D}){var gt;const{t:j}=Et(),et=pe(),V=Co(t,D.lang),{langOf:nt}=V,Y=Jr(N),J=s==="slider",M=J&&i==="vertical",T=o==="id",O=R(null),U=s==="masonry";F(()=>{const q=O.current;if(!U||!q)return;let ot,_t=true;return import("../masonry-BZCdA3bV.mjs").then(({attachMasonry:Ft})=>{_t&&(ot=Ft(q))}),()=>{_t=false,ot==null||ot()}},[U]);const Q=cl({align:T?"center":"start",itemCount:e.length,axis:M?"y":"x"}),at=R(void 0);F(()=>()=>window.clearTimeout(at.current),[]);const ct=Xm(e.length,n,{orientation:M?"vertical":s==="slider"?"horizontal":s==="list"?"vertical":"both",rtl:r,onActivate:(q,ot)=>_(e[q],ot),onMove:w?(q,ot)=>{window.clearTimeout(at.current);const _t=()=>w(e[q]);ot.repeat?at.current=window.setTimeout(_t,150):_t()}:void 0}),mt=R(null),b=R(false);b.current=!!((gt=mt.current)!=null&&gt.contains(mt.current.ownerDocument.activeElement)),F(()=>{var Ft;const q=mt.current;if(!q||!b.current)return;const{activeElement:ot,body:_t}=q.ownerDocument;ot&&ot!==_t||(Ft=q.querySelector(`[data-track-index="${Math.max(0,n)}"]`))==null||Ft.focus()},[e]);const I=R(false);F(()=>{var _t;if(n<0)return;const q=!I.current;if(J){Q.scrollToIndex(n,{instant:q})&&(I.current=true);return}I.current=true;const ot=(_t=mt.current)==null?void 0:_t.querySelector(`[data-track-index="${n}"]`);ot&&cg(ot,q)},[J,n,Q.scrollToIndex]);const P=Ms(m),A=h?wt(h.label,l):null,B=h?wt(h.summary,l):null,Z=y===void 0&&!!(A!=null&&A.text),E=Lo(j("itemsLabel"),nt("itemsLabel"),y!==void 0||Z,V.hostLanguage),z=Z?{"aria-labelledby":`${et}-title`}:y!==void 0?{"aria-label":y}:E.props,K=(q,ot)=>g?g(q,{selected:ot}):f(Zm,{item:q,size:a,language:l,request:c,showSummary:d,secondary:u,labels:p}),G=q=>!(g||wt(q.label,l).text||d&&u==="summary"&&wt(q.summary,l).text),ht=(q,ot)=>G(q)?j("canvasPosition",{index:ot+1,total:e.length}):void 0,ft=q=>G(q)?nt("canvasPosition"):void 0,Rt=J?{display:"flex",flexDirection:M?"column":void 0,margin:0,padding:0,listStyle:"none"}:void 0,At=J?{flex:"0 0 auto",scrollSnapAlign:T?"center":"start"}:void 0,zt=T&&n>=0,Ht=q=>{const ot=n+(q==="prev"?-1:1),_t=zt?ot>=0&&ot<e.length:q==="prev"?Q.canScrollPrev:Q.canScrollNext,Ft=zt?q==="prev"?"commonPrevious":"commonNext":q==="prev"?"itemsScrollBack":"itemsScrollForward",$=j(Ft),lt=Ot=>{if(!_t)return;if(!zt)return(q==="prev"?Q.scrollPrev:Q.scrollNext)();const Ke=e[ot];w?w(Ke):_(Ke,Ot)};return f("button",{type:"button",className:`clover-items-scroll-${q}`,"aria-controls":zt?void 0:`${et}-viewport`,...dt(nt(Ft)),"aria-disabled":!_t||void 0,tabIndex:_t?void 0:-1,onClick:lt,children:[f("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:f("path",{d:M?q==="next"?"M3 6l5 5 5-5":"M3 10l5-5 5 5":q==="next"!==r?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),f("span",{style:Ue,children:$}),f(qe,{label:$})]})};return f(Nn.Provider,{value:V.hostLanguage,children:f(S,{ref:V.ref,className:It("clover-items",v),"data-layout":s,"data-orientation":M?"vertical":void 0,"data-navigation":o,...Qr(Y),...D,children:[h&&((A==null?void 0:A.text)||(B==null?void 0:B.text))&&f("header",{className:"clover-items-header",children:[(A==null?void 0:A.text)&&f(P,{className:"clover-items-title clover-title",id:`${et}-title`,...dt(A.lang),children:A.text}),(B==null?void 0:B.text)&&f("p",{className:"clover-items-description",...dt(B.lang),children:B.text.replace(/<[^>]*>/g,"")}),h.homepage&&f("a",{className:"clover-items-homepage",href:h.homepage,hrefLang:h.homepageLang,...dt(nt("commonViewAll")),children:j("commonViewAll")})]}),f("div",{className:"clover-items-frame",style:{position:"relative"},dir:r?"rtl":void 0,children:[J&&Ht("prev"),f("div",{id:`${et}-viewport`,className:"clover-items-viewport",ref:J?Q.ref:O,children:T?f("div",{ref:mt,role:"listbox",...z,"aria-orientation":M?"vertical":J?"horizontal":s==="list"?"vertical":void 0,className:"clover-items-track",style:Rt,children:e.map((q,ot)=>{const _t=ot===n;return f("div",{id:`${et}-${ot}`,role:"option","aria-selected":_t,"aria-label":ht(q,ot),...dt(ft(q)),className:"clover-items-item","data-track-index":ot,style:At,...ct.itemProps(ot),onClick:Ft=>_(q,Ft),children:K(q,_t)},q.id)})}):f("ul",{...z,className:"clover-items-track",style:Rt,children:e.map((q,ot)=>f("li",{className:"clover-items-item","data-track-index":ot,style:At,children:f("a",{className:"clover-items-link",href:q.href,hrefLang:q.hrefLang,"aria-label":ht(q,ot),...dt(ft(q)),draggable:false,onClick:_t=>_(q,_t),children:K(q,false)})},q.id))})}),J&&Ht("next")]}),E.node]})})}function cg(t,e){var i,a;let n=t.parentElement;for(;n&&n!==document.body;){const{overflowY:c}=getComputedStyle(n);if(/(auto|scroll)/.test(c)&&n.scrollHeight>n.clientHeight)break;n=n.parentElement}if(!n||n===document.body)return;const o=n.getBoundingClientRect(),r=t.getBoundingClientRect(),s=r.top<o.top?r.top-o.top:r.bottom>o.bottom?r.bottom-o.bottom:0;if(s){const c=(i=window.matchMedia)==null?void 0:i.call(window,"(prefers-reduced-motion: reduce)").matches;(a=n.scrollBy)==null||a.call(n,{top:s,behavior:e||c?"auto":"smooth"})}}function lg(t,e){const{clover:n}=ae(e),o=hp(),{direction:r}=Kc(),s=st(l=>l.collection),i=st(l=>{var d;return((d=l.manifest)==null?void 0:d.id)??null}),a=st(l=>{var d;return((d=l.targets)==null?void 0:d.items.length)??0}),c=st(l=>wd(l.targets,l.targetIndex,l.manifest,l.canvasId));if(t==="targets")return{position:c,total:a,direction:"left-to-right",step:l=>{const d=c+l;d>=0&&d<a&&n.goToTarget(d)}};if(t==="members"){const l=bo(s),d=l.findIndex(u=>u.id===i);return{position:d,total:l.length,direction:"left-to-right",step:u=>{const p=l[d+u];p&&n.goToManifest(p.id)}}}return{position:o.position,total:o.total,direction:r,step:l=>l<0?o.previous():o.next()}}const ug=ie(function({steps:e,as:n="span",className:o,...r},s){const{t:i,langOf:a}=Et(),{position:c,total:l}=e;if(l<2||c<0)return null;const d=c+1;return f(n,{ref:s,className:It("clover-pager-position",o),...r,children:[f("span",{"aria-hidden":"true",children:[d," / ",l]}),f("span",{className:"clover-pager-room","aria-hidden":"true",hidden:true,children:[l," / ",l]}),f("span",{style:Ue,...dt(a("canvasPosition")),children:i("canvasPosition",{index:d,total:l})})]})}),dg=ie(function({of:e="views",...n},o){const r=lg(e,"Position");return f(ug,{ref:o,...n,steps:r})});function fg({className:t,loading:e,error:n}){const{t:o,langOf:r}=Et(),{status:s,error:i}=up(),a=s==="loading",c=e!==void 0&&e!==false;return f(Ct,{children:[f("p",{className:It("clover-status",t),"data-status":a?s:void 0,role:"status",style:a&&e!==false?void 0:Ue,children:[a&&(c?e:e===void 0&&f(En,{})),a&&!c&&f("span",{style:Ue,...dt(r("statusLoading")),children:o("statusLoading")})]}),s==="error"&&i&&f("div",{className:It("clover-status",t),"data-status":s,role:"alert",children:n?n(i):f(Ct,{children:[f("p",{...dt(r("statusError")),children:o("statusError")}),f("p",{className:"clover-status-detail",lang:"en",children:i.message})]})})]})}function hg(t,e=false,n=3){const o=e||Am(t),r=e?`${n}
28
- ${t}`:t,[s,i]=H(null);return F(()=>{if(!o)return;let a=true;return Promise.all([import("./sanitize-DETRcc_c.mjs"),e?import("../markdown-CCYJwzFn.mjs"):null]).then(([{sanitizeHTML:c,trusted:l},d])=>{const u=d?d.markdownToHtml(t,{headingLevel:n}):t,p=c(u,{markdown:!!d});a&&i({for:r,html:p,inner:l(p)})}),()=>{a=false}},[t,r,o,e,n]),o&&(s==null?void 0:s.for)===r?s:null}const pg=new Set(["p","span","h1","h2","h3","h4","h5","h6","a","b","i","em","strong","small","sub","sup","label"]),hl=ie(function({as:e="span",markup:n,language:o,format:r,headingLevel:s,...i},a){const{text:c,lang:l}=wt(n,o),d=dt(l),u=Om(r,c),p=u==="markdown",h=hg(u==="plain"?"":c,p,s),m=(h==null?void 0:h.html)??null;if(!c)return null;if(u==="plain")return f(e,{ref:a,...i,...d,children:c.split(/\r?\n/).map((_,w)=>f(ue.Fragment,{children:[w>0&&f("br",{}),_]},w))});const g=typeof e=="string"&&pg.has(e)&&m&&/<(p|ul|ol|div)[\s>]/i.test(m)?"div":e;return h?f(g,{ref:a,...i,...d,dangerouslySetInnerHTML:{__html:h.inner}}):f(e,{ref:a,...i,...d,children:p?Nm(c):Dn(c)})}),pl=({metadata:t,language:e,renderValue:n,...o})=>t!=null&&t.length?f("dl",{...o,children:t.map((r,s)=>{const i=wt(r.label,e),a=n==null?void 0:n(r);return f("div",{"data-label":wt(r.label,"none").text.replace(/\s+/g,"-").toLowerCase(),children:[f("dt",{...dt(i.lang),children:i.text}),a!==void 0?f("dd",{children:a}):f(hl,{as:"dd",markup:r.value,language:e})]},s)})}):null,mg=typeof window>"u"?F:Ut;function gg({children:t}){const{t:e}=Et(),n=Co(),o=R(null),r=pe(),s=ue.Children.only(t),i=s.props.id??r,{open:a,cut:c,toggle:l}=vg(o);return f("div",{className:"clover-read-more",children:[ue.cloneElement(s,{ref:o,id:i,"data-read-more":a?"open":""}),(c||a)&&f("button",{type:"button",className:"clover-read-more-button","aria-expanded":a,"aria-controls":i,onClick:l,ref:n.ref,...dt(n.langOf(a?"readLess":"readMore")),children:e(a?"readLess":"readMore")})]})}function vg(t){const[e,n]=H(false),[o,r]=H(false),s=()=>{const i=t.current;i&&!e&&r(i.scrollHeight>i.clientHeight+1)};return mg(s),F(()=>{var u,p;const i=t.current;if(!i)return;let a=0;const c=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(s)},l=typeof ResizeObserver>"u"?null:new ResizeObserver(c);l==null||l.observe(i);const d=typeof MutationObserver>"u"?null:new MutationObserver(c);return d==null||d.observe(document.head,{childList:true,subtree:true,characterData:true}),d==null||d.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),d==null||d.observe(i,{attributes:true,attributeFilter:["style"]}),(p=(u=document.fonts)==null?void 0:u.addEventListener)==null||p.call(u,"loadingdone",c),()=>{var h,m;cancelAnimationFrame(a),l==null||l.disconnect(),d==null||d.disconnect(),(m=(h=document.fonts)==null?void 0:h.removeEventListener)==null||m.call(h,"loadingdone",c)}},[e,t.current]),{open:e,cut:o,toggle:()=>n(i=>!i)}}function pn(t,e,n){const o=Ss(),r=Rn(s=>{var i;return(i=Oo(s,t))==null?void 0:i[e]},void 0);return n!==void 0?n:o?o[e]:r}const zn=()=>{var t;return(t=Ne())==null?void 0:t.language};function ba({of:t="manifest",as:e="p",value:n,className:o,...r}){const s=pn(t,"summary",n),i=zn();return wt(s,i).text?f(gg,{children:f(hl,{as:e,markup:s,language:i,className:It("clover-summary",o),...r})}):null}function yg({of:t="manifest",value:e,className:n,renderValue:o,...r}){const s=pn(t,"metadata",e),i=zn();return f(pl,{metadata:s,language:i,renderValue:o,className:It("clover-metadata",n),...r})}function bg({of:t="manifest",value:e,className:n,...o}){const r=pn(t,"requiredStatement",e),s=zn();return f(pl,{metadata:r?[r]:null,language:s,className:It("clover-required-statement",n),...o})}function _g({of:t="manifest",value:e,className:n,...o}){const r=pn(t,"rights",e);return r?f("a",{href:r,className:It("clover-rights",n),...o,children:r}):null}function wg({of:t="manifest",value:e,className:n,...o}){const r=pn(t,"id",e);return r?f("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:It("clover-id",n),...o,children:r}):null}function ml({property:t,className:e,of:n="manifest",value:o,...r}){const s=W(pn(n,t,o)),i=zn(),a=s.filter(c=>c==null?void 0:c.id);return a.length?f("ul",{className:e,...r,children:a.map(c=>{const l=wt(c.label,i);return f("li",{children:[f("a",{href:c.id,target:"_blank",rel:"noopener noreferrer",hrefLang:Ln(c),...dt(l.text?l.lang:void 0),children:l.text?Dn(l.text):c.id}),c.format&&f("span",{className:"clover-link-format",children:[" (",c.format,")"]})]},c.id)})}):null}const xg=({className:t,...e})=>f(ml,{property:"homepage",className:It("clover-homepage",t),...e}),Sg=({className:t,...e})=>f(ml,{property:"seeAlso",className:It("clover-see-also",t),...e});function kg({of:t="manifest",value:e,size:n=400,className:o,...r}){var m;const s=Rn(g=>Oo(g,t),null),i=e??s,a=zn(),c=i?ks(i):null,l=(c==null?void 0:c.src)??(c==null?void 0:c.service)??(c==null?void 0:c.fallback),[d,u]=H(c==null?void 0:c.src),p=(m=Ne())==null?void 0:m.clover.request;if(F(()=>{if(!c)return u(void 0);if(c.src)return u(c.src);let g=true;return Cs(c,n,p).then(_=>g&&u(_)),()=>{g=false}},[l,n]),!d)return null;const h=wt(i==null?void 0:i.label,a);return f("img",{src:d,alt:Dn(h.text),...dt(r.alt===void 0&&h.text?h.lang:void 0),width:n,loading:"lazy",decoding:"async",className:It("clover-thumbnail",o),...r})}const Cg=typeof window>"u"?F:Ut,gl=he(null),Eg=t=>{var e;return!!((e=t.textContent)!=null&&e.trim())||t.querySelector("img, svg, picture, video, canvas, object")!==null},Mg=t=>!!t&&typeof t=="object"&&["label","logo","homepage"].some(e=>W(t[e]).length>0),Ur=t=>!!t&&typeof t.id=="string",Tg=t=>{const e=W(t.homepage).find(Ur);return e?{id:e.id,hrefLang:Ln(e)}:void 0},Ig=(t,e)=>{var n;if(!t)return null;for(const o of[t.label,(n=W(t.homepage).find(r=>r==null?void 0:r.label))==null?void 0:n.label]){const r=wt(o,e);if(r.text)return{text:Dn(r.text),lang:r.lang}}return null};function vl({of:t="manifest",value:e,link:n=true,children:o,className:r,...s}){var l;const i=Rn(d=>{var u;return(u=Oo(d,t))==null?void 0:u.provider},void 0),a=(l=Ne())==null?void 0:l.language,c=W(e!==void 0?e:i).filter(Mg);return c.length?f("ul",{className:It("clover-provider",r),...s,children:c.map((d,u)=>{const p=n?Tg(d):void 0,h=!!wt(d.label,a).text;return f(Lg,{agent:d,homepage:p,children:o??f(Ct,{children:[f(yl,{alt:h?"":void 0}),f(sn,{className:"clover-provider-label"})]})},d.id??u)})}):null}function Lg({agent:t,homepage:e,children:n}){const o=R(null),[r,s]=H(null),i=ut(()=>{o.current&&!Eg(o.current)&&s(t)},[t]);return r===t?null:f("li",{className:"clover-provider-agent",children:f(el.Provider,{value:t,children:f(gl.Provider,{value:i,children:e?f("a",{ref:o,href:e.id,target:"_blank",rel:"noopener noreferrer",hrefLang:e.hrefLang,className:"clover-provider-link",children:n}):f("span",{ref:o,className:"clover-provider-content",children:n})})})})}function yl({of:t="manifest",value:e,alt:n,className:o,...r}){var p;const{t:s,langOf:i}=Et(),a=Ss(),c=Rn(h=>{var m;return(m=Oo(h,t))==null?void 0:m.provider},void 0),l=(p=Ne())==null?void 0:p.language,u=(e!==void 0?W(e):a?[a]:W(c)).flatMap(h=>{if(!h||typeof h!="object")return[];const m=h;if(m.type!=="Agent"&&Ur(m)&&!m.logo)return[{image:m,agent:null}];const g=W(m.logo).find(Ur);return g?[{image:g,agent:m}]:[]});return u.length?f(Ct,{children:u.map(({image:h,agent:m},g)=>{const _=Ig(m,l);return f(Pg,{src:h.id,alt:n??(_==null?void 0:_.text)??s("logo"),...dt(n!==void 0?void 0:_?_.lang:i("logo")),width:h.width,height:h.height,loading:"lazy",decoding:"async",className:It("clover-logo",o),...r},`${h.id}-${g}`)})}):null}function Pg({alt:t,onError:e,...n}){const o=jt(gl),[r,s]=H(false),i=ut(()=>s(true),[]);Cg(()=>{r&&(o==null||o())},[r,o]);const a=ut(c=>{var l;c!=null&&c.complete&&!c.naturalWidth&&((l=c.decode)==null||l.call(c).catch(i))},[i]);return r?null:f("img",{ref:a,alt:t,onError:c=>{e==null||e(c),i()},...n})}const Ag=t=>t&&typeof t=="object"&&!Array.isArray(t)?Object.keys(t).filter(e=>e!=="none"&&e!=="@none"&&wt({[e]:t[e]}).text):[];function Og(t){if(!t)return[];const e=[...Array.isArray(t.metadata)?t.metadata:[],t.requiredStatement].filter(Boolean),o=[t.label,t.summary,...e.flatMap(r=>[r==null?void 0:r.label,r==null?void 0:r.value])].map(Ag).filter(r=>r.length>1);return[...new Set(o.flat())]}function Ng(){const{language:t,chooseLanguage:e,toggleDrawn:n}=ae("About"),o=st(i=>i.manifest),r=bt(()=>Og(o),[o]),s=rc(r,t);return s&&e?{languages:r,chosen:s,onChange:e,drawn:n??false}:null}function Cy(t,e){return t!=null&&t.drawn?e.every(n=>!!n&&n!=="none"&&t.languages.some(o=>es(o,n))):false}const Rg=vt(()=>import("./LanguageChoice-BC4raDCD.mjs").then(t=>t.b).then(t=>({default:t.LanguageChoice}))),Bg=t=>{var o;const e=t.closest(".clover-sections-actions"),n=(o=e==null?void 0:e.closest(".clover-sections-item"))==null?void 0:o.querySelector(".clover-sections-heading .clover-sections-label");return e&&n?{box:e,label:n}:null},$g=t=>void Tt.chooseInterfaceLanguage(t);function Fg(){Et();const{languages:t,chosen:e}=Tt.interfaceLanguages();return t.length>1?{languages:t,chosen:e}:null}function bl({values:t=true,interfaceLanguages:e=true}={}){const n=Ng(),o=Fg(),r=t?(n==null?void 0:n.languages)??[]:[],s=u=>r.some(p=>p===u||Tt.stringsFor(p)===u),i=[...r,...(e?(o==null?void 0:o.languages)??[]:[]).filter(u=>!s(u))];if(i.length<2)return null;const a=Tt.chosenLanguage,c=a&&Tt.stringsFor(a),l=c&&i.includes(c)&&!s(c)?c:t&&n?n.chosen:(o==null?void 0:o.chosen)??i[0];return{languages:i,chosen:l,onChange:u=>r.includes(u)&&n?n.onChange(u):$g(u)}}function _l({values:t,interfaceLanguages:e}){const n=bl({values:t,interfaceLanguages:e}),{drawsToggle:o}=ae("About"),r=!!n;return F(()=>r?o==null?void 0:o():void 0,[r,o]),n?f(St,{fallback:null,children:f(Rg,{...n,nameKey:"readingLanguage",part:"clover-about",fit:Bg})}):null}const wl=he(false);function _a(t,e){const n=new Set,o=[];for(const r of t)for(const s of W(r==null?void 0:r.rendering)){const i=(s==null?void 0:s.id)??(s==null?void 0:s["@id"]);if(typeof i!="string"||n.has(i))continue;n.add(i);const a=wt(s.label,e);o.push({id:i,label:a.text||s.format||i,lang:a.text?a.lang:void 0,format:s.format,hrefLang:Ln(s)})}return o}function xl(){const{language:t}=ae("Download"),e=st(o=>o.manifest),n=st(o=>We(o.manifest,o.canvasId));return{page:_a(n,t),all:_a([e],t)}}const Dg=vt(()=>import("./Download-D-aGRZnK.mjs").then(({DownloadGroups:t})=>({default:t}))),zg=vt(()=>import("./NavDate-B32M8WGG.mjs").then(t=>t.a).then(({NavDate:t})=>({default:t}))),Hg=vt(()=>import("./PartOfManifest-B9RWDleM.mjs"));function Wg({languages:t=true,interfaceLanguages:e=true,...n}){const o=jt(wl);return f(Ug,{...n,download:!o&&n.download!==false,choice:o?null:f(_l,{values:t,interfaceLanguages:e})})}function Ug({choice:t,canvasSummary:e=false,headingLevel:n=3,download:o=true,thumbnail:r=true,label:s=true,className:i,...a}){const{t:c,langOf:l}=Et(),d=xl(),u=st(w=>w.manifest,Object.is,"About"),p=R(null);F(()=>{const w=p.current,S=w==null?void 0:w.querySelector(".clover-about-head");if(!w||!S||typeof ResizeObserver>"u")return;const v=new Set,y=()=>{const N=S.querySelector(".clover-about-thumbnail"),D=S.querySelector(".clover-about-label");for(const nt of[N,D])nt&&!v.has(nt)&&(v.add(nt),k.observe(nt));const j=w.style;if(!N){j.removeProperty("--clover-about-label-height"),j.removeProperty("--clover-about-thumbnail-width");return}const et=`${(D==null?void 0:D.offsetHeight)??0}px`,V=`${N.offsetWidth}px`;j.getPropertyValue("--clover-about-label-height")!==et&&j.setProperty("--clover-about-label-height",et),j.getPropertyValue("--clover-about-thumbnail-width")!==V&&j.setProperty("--clover-about-thumbnail-width",V)};let x=0;const k=new ResizeObserver(()=>{cancelAnimationFrame(x),x=requestAnimationFrame(y)});return k.observe(S),y(),()=>{cancelAnimationFrame(x),k.disconnect(),w.style.removeProperty("--clover-about-label-height"),w.style.removeProperty("--clover-about-thumbnail-width")}},[s,r,u]);const h=pe(),m=()=>{var v,y;const w=p.current;(y=((v=w==null?void 0:w.closest(".clover-sections-item"))==null?void 0:v.querySelector(".clover-sections-button"))??w)==null||y.focus({preventScroll:true})};if(!u)return null;const g=(w,S,v)=>{if(!S)return null;const{as:y,title:x,group:k}=al(n,`${h}-${w}`);return f("section",{className:"clover-about-section",...k,children:[f(y,{className:"clover-about-heading",...dt(l(w)),...x,children:c(w)}),v]})},_=w=>Array.isArray(u[w])?u[w].length>0:!!u[w];return f("div",{ref:p,className:It("clover-about",i),tabIndex:-1,...a,children:[t,(r||s)&&f("div",{className:"clover-about-head",children:[r&&f(kg,{className:"clover-about-thumbnail",size:256,alt:s?"":void 0}),s&&f(sn,{as:Ms(n),className:"clover-about-label clover-title"})]}),e&&f(ba,{of:"canvas",className:"clover-about-summary"}),Bi(u)&&u.partOf&&f(St,{fallback:null,children:f(Hg,{manifest:u,headingLevel:n,onOpened:m})}),f(ba,{className:"clover-about-summary"}),f(yg,{className:"clover-about-metadata"}),f(bg,{className:"clover-about-metadata"}),g("aboutDate",ol(u.navDate),f(St,{fallback:null,children:f(zg,{value:u.navDate,className:"clover-about-date"})})),g("aboutProvider",_("provider"),f(vl,{})),g("aboutRights",u.rights,f(_g,{})),g("aboutHomepage",_("homepage"),f(xg,{})),g("aboutSeeAlso",_("seeAlso"),f(Sg,{})),g("download",o&&d.page.length+d.all.length>0,f(St,{fallback:null,children:f(Dg,{page:d.page,all:d.all,headingLevel:n+1})})),g(Bi(u)?"aboutCanvas":"aboutManifest",!wc(u)&&u.id,f(wg,{}))]})}const jg=vt(()=>import("./ControlMenu-jv4lvjpj.mjs")),Vg=vt(()=>import("./Download-D-aGRZnK.mjs").then(({DownloadGroups:t})=>({default:t})));function qg({languages:t=true,interfaceLanguages:e=true,download:n=true}){const o=bl({values:t,interfaceLanguages:e}),{page:r,all:s}=xl(),i=n&&r.length+s.length>0;return!o&&!i?null:f("div",{className:"clover-about-actions",children:[i&&f(Kg,{page:r,all:s}),o&&f(_l,{values:t,interfaceLanguages:e})]})}function Kg({page:t,all:e}){const{t:n,langOf:o}=Et(),[r,s]=H(false),a=`${pe()}-download`,c=ut(l=>{var d;s(false),l&&((d=document.getElementById(a))==null||d.focus())},[a]);return f("span",{className:"clover-about-download",onBlur:l=>{const d=l.relatedTarget;r&&d&&!l.currentTarget.contains(d)&&s(false)},children:[f("button",{type:"button",id:a,className:"clover-about-download-button","aria-label":n("download"),...dt(o("download")),"aria-expanded":r,"aria-controls":r?`${a}-menu`:void 0,onClick:()=>s(l=>!l),children:[f(Zg,{}),f(qe,{label:n("download")})]}),r&&f(St,{fallback:null,children:f(jg,{id:`${a}-menu`,triggerId:a,onClose:c,className:"clover-about-download-menu",children:f(Vg,{page:t,all:e,inPopover:true})})})]})}function Zg(){return f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512","aria-hidden":"true",focusable:"false",fill:"none",stroke:"currentColor",strokeWidth:"56",strokeLinecap:"round",strokeLinejoin:"round",children:f("path",{d:"M256 64v272M160 240l96 96 96-96M80 352v48a48 48 0 0 0 48 48h256a48 48 0 0 0 48-48v-48"})})}function Gg(t,e=null){if(!t)return false;if(e!=null&&e.navPlace||t.navPlace)return true;for(const n of Bt(t).canvases){if(n.navPlace)return true;for(const o of W(n.annotations))for(const r of W(o==null?void 0:o.items))if(r!=null&&r.navPlace||W(r==null?void 0:r.motivation).includes("georeferencing")||W(r==null?void 0:r.body).some(i=>(i==null?void 0:i.type)==="Feature"||(i==null?void 0:i.type)==="FeatureCollection"))return true}return false}const Xg=["about","targets","collection","contents","search","map","transcript","annotations"],Ie={about:t=>{var e,n;return!wc(t.manifest)||!!((e=t.manifest)!=null&&e.rights||(n=t.manifest)!=null&&n.requiredStatement)},targets:t=>{var e;return(((e=t.targets)==null?void 0:e.items.length)??0)>1},collection:t=>{var e,n;return(((n=(e=t.collection)==null?void 0:e.items)==null?void 0:n.length)??0)>0||!!_d(t.manifest)},contents:t=>cp(t.manifest).length>0,search:t=>!!hs(t.manifest),map:t=>Gg(t.manifest,t.collection),transcript:t=>We(t.manifest,t.canvasId).some(e=>Fc(e).length>0||wh(e).length>0),annotations:t=>Bd(t.manifest,t.addedSets).length>0},Yg=(t,e)=>{const n=Array.isArray(e)?new Set(e):void 0;return Xg.filter(o=>t[o]&&(!n||n.has(o)))};function Ts(t){const e={about:st(Ie.about),targets:st(Ie.targets),collection:st(Ie.collection),contents:st(Ie.contents),search:st(Ie.search),map:st(Ie.map),transcript:st(Ie.transcript),annotations:st(Ie.annotations)};return Yg(e,t)}function Jg({open:t=false,className:e}){return f("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",className:It("clover-chevron",e),"data-open":t||void 0,children:f("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Sl=typeof window>"u"?F:Ut,kl=he(null);function Ey(){return jt(kl)}const Cl=he(0);function My(){return jt(Cl)}function Qg({items:t,layout:e="tabs",value:n,onValueChange:o,label:r,labelLang:s,headingLevel:i=3}){var Y,J;const a=pe(),c=Lo(r??"",s,r===void 0),l=R([]),d=e==="tabs",{t:u,langOf:p}=Et(),h=cl({dragFree:true,itemCount:t.length}),m=t.some(M=>M.value===n)?n:((Y=t[0])==null?void 0:Y.value)??null,g=R(new Set);m&&g.current.add(m);const _=R(null),[w,S]=H({value:null,count:0});F(()=>{var at;if(d||!m||_.current!==m)return;_.current=null;const M=t.findIndex(ct=>ct.value===m),T=document.getElementById(`${a}-panel-${M}`),O=(at=l.current[M])==null?void 0:at.parentElement;if(!T||!O)return;const U=O.getBoundingClientRect().bottom-T.getBoundingClientRect().top;if(U<=0)return;const Q=gr(T);Q&&(Q.scrollTop-=U)},[m,d,t,a]);const v=M=>{var I,P,A,B;const T=t.findIndex(Z=>Z.value===m),O=document.getElementById(`${a}-panel-${T}`),U=M.target;if(!O||U===O||!O.contains(U)||!ev(U))return;const Q=(P=(I=l.current[T])==null?void 0:I.parentElement)==null?void 0:P.getBoundingClientRect(),at=T+1<t.length?(B=(A=l.current[T+1])==null?void 0:A.parentElement)==null?void 0:B.getBoundingClientRect():void 0;if(!Q)return;const ct=U.getBoundingClientRect(),mt=ct.top<Q.bottom?Math.floor(ct.top-Q.bottom):at&&ct.bottom>at.top?Math.ceil(Math.min(ct.bottom-at.top,ct.top-Q.bottom)):0,b=mt?gr(O):null;b&&(b.scrollTop+=mt)},y=R(null),x=t.map(M=>M.value).join(`
29
- `),k=R(false);k.current=!!((J=y.current)!=null&&J.contains(y.current.ownerDocument.activeElement)),F(()=>{var Q;const M=y.current;if(!M||!k.current)return;const{activeElement:T,body:O}=M.ownerDocument;if(T&&T!==O)return;const U=t.findIndex(at=>at.value===m);(Q=l.current[U])==null||Q.focus()},[x]),Sl(()=>{const M=y.current;if(d||!M||typeof ResizeObserver>"u")return;const T=[...M.querySelectorAll(":scope > .clover-sections-item")],O=T.map(E=>E.firstElementChild),U=O[0],Q=O[O.length-1],at=new Map,ct=E=>(E&&at.get(E))??0,mt=document.scrollingElement;let b=null,I=0;const P=()=>{const E=O.reduce((Rt,At)=>Rt+ct(At),0);let z=0;T.forEach((Rt,At)=>{Rt.style.setProperty("--clover-sections-before",`${z}px`),z+=ct(O[At]),Rt.style.setProperty("--clover-sections-after",`${E-z}px`)}),M.style.setProperty("--clover-sections-total",`${E}px`);const K=U&&getComputedStyle(U);(K==null?void 0:K.position)==="sticky"&&Q&&(I=parseFloat(K.top)+parseFloat(getComputedStyle(Q).bottom)||0);const G=getComputedStyle(M),ht=parseFloat(G.lineHeight)||1.2*parseFloat(G.fontSize),ft=(b==null?void 0:b.clientHeight)??0;ft>0&&ft-I-E<2*ht?M.dataset.stacks="off":delete M.dataset.stacks},A=new ResizeObserver(E=>{var z,K;for(const G of E)O.includes(G.target)&&at.set(G.target,((K=(z=G.borderBoxSize)==null?void 0:z[0])==null?void 0:K.blockSize)??G.target.getBoundingClientRect().height);P()}),B=()=>{const E=gr(M);E!==b&&(b&&b!==mt&&A.unobserve(b),E&&E!==mt&&A.observe(E),b=E)},Z=()=>{B(),P()};B();for(const E of O)E&&A.observe(E,{box:"border-box"});return window.addEventListener("resize",Z),()=>{A.disconnect(),window.removeEventListener("resize",Z);for(const E of T)E.style.removeProperty("--clover-sections-before"),E.style.removeProperty("--clover-sections-after");M.style.removeProperty("--clover-sections-total"),delete M.dataset.stacks}},[d,x,i]),F(()=>{if(d)return;const M=l.current.map(O=>O==null?void 0:O.parentElement).filter(O=>!!O),T=O=>{var ct;if(O.ctrlKey)return;const U=O.currentTarget,Q=wa(U);if(!Q||Q===document.scrollingElement)return;O.preventDefault();const at=O.deltaMode===1?parseFloat(getComputedStyle(U).lineHeight)||16:O.deltaMode===2?Q.clientHeight:1;(ct=wa(Q)??document.scrollingElement)==null||ct.scrollBy({left:O.deltaX*at,top:O.deltaY*at,behavior:"instant"})};for(const O of M)O.addEventListener("wheel",T,{passive:false});return()=>{for(const O of M)O.removeEventListener("wheel",T)}},[d,x]);const N=M=>{M!==m&&(_.current=M,d||S(T=>({value:M,count:T.count+1})),o==null||o(M))},D=(M,T)=>{var ct;const O=t.length-1,[U,Q]=d?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"],at=M.key===Q?(T+1)%t.length:M.key===U?(T-1+t.length)%t.length:M.key==="Home"?0:M.key==="End"?O:null;at!==null&&(M.preventDefault(),(ct=l.current[at])==null||ct.focus(),d&&N(t[at].value))},j=R(false);F(()=>{if(!d)return;const M=t.findIndex(b=>b.value===m),T=l.current[M],O=T==null?void 0:T.parentElement;if(!T||!O)return;const U=getComputedStyle(O),Q=O.getBoundingClientRect(),at=T.getBoundingClientRect(),ct=Q.left+(parseFloat(U.scrollPaddingLeft)||0),mt=Q.right-(parseFloat(U.scrollPaddingRight)||0);(at.left<ct-1||at.right>mt+1)&&h.scrollToIndex(M,{instant:!j.current}),j.current=true},[m,d,t.length,h.scrollToIndex]);const et=M=>{const T=M==="prev"?h.canScrollPrev:h.canScrollNext,O=M==="prev"?"sectionsScrollBack":"sectionsScrollForward";return f("button",{type:"button",className:`clover-steps-step clover-sections-scroll-${M}`,"aria-hidden":"true",tabIndex:-1,hidden:!T,...dt(p(O)),onMouseDown:U=>U.preventDefault(),onClick:M==="prev"?h.scrollPrev:h.scrollNext,children:[f("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:f("path",{d:M==="next"?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),f(qe,{label:u(O)})]})},V=Ms(i,"div"),nt=(M,T)=>{const O=M.value===m;return f("button",{ref:U=>{l.current[T]=U},type:"button",id:`${a}-button-${T}`,className:"clover-sections-button","data-value":M.value,"data-track-index":d?T:void 0,"aria-controls":`${a}-panel-${T}`,...d?{role:"tab","aria-selected":O,tabIndex:O?0:-1}:{"aria-expanded":O,"aria-disabled":O||void 0},onClick:()=>N(M.value),onKeyDown:U=>D(U,T),children:[f("span",{className:"clover-sections-label",children:M.label}),!d&&f(Jg,{open:O,className:"clover-sections-chevron"})]},M.value)};return f("div",{ref:y,className:"clover-sections","data-layout":e,onFocus:d?void 0:v,style:d?void 0:{"--clover-sections-count":t.length},children:[d&&f("div",{className:"clover-sections-tabs","data-more":[h.canScrollPrev&&"start",h.canScrollNext&&"end"].filter(Boolean).join(" ")||void 0,children:f("div",{className:"clover-sections-row",children:[f("div",{role:"tablist",ref:h.ref,...c.props,className:"clover-sections-list",children:t.map(nt)}),et("prev"),et("next")]})}),d&&c.node,t.map((M,T)=>{const O=M.value===m;return f("section",{className:"clover-sections-item","data-value":M.value,"data-open":O,style:d?void 0:{"--clover-sections-index":T},children:[!d&&f(V,{className:"clover-sections-heading",children:[nt(M,T),f("span",{className:"clover-sections-reach","aria-hidden":"true"})]}),f(Cl.Provider,{value:w.value===M.value?w.count:0,children:f(tv,{id:`${a}-panel-${T}`,tabs:d,labelledBy:`${a}-button-${T}`,hidden:!O,actions:M.actions,children:g.current.has(M.value)?M.content:null})})]},M.value)})]})}function tv({id:t,tabs:e,labelledBy:n,hidden:o,actions:r,children:s}){const[i,a]=H(null),c=!o||!!r;return Sl(()=>{const l=i==null?void 0:i.parentElement;if(!c||!i||!l||typeof ResizeObserver>"u")return;const d=new ResizeObserver(()=>{const u=i.offsetWidth;u?(l.style.setProperty("--clover-sections-actions",`${u}px`),l.setAttribute("data-actions","")):(l.style.removeProperty("--clover-sections-actions"),l.removeAttribute("data-actions"))});return d.observe(i),()=>{d.disconnect(),l.style.removeProperty("--clover-sections-actions"),l.removeAttribute("data-actions")}},[i,c]),f(Ct,{children:[!e&&f("div",{ref:a,className:"clover-sections-actions",hidden:!c,children:r}),f("div",{id:t,role:e?"tabpanel":"region","aria-labelledby":n,tabIndex:e?0:void 0,className:"clover-sections-panel",hidden:o,children:f(kl.Provider,{value:e?null:i,children:[e&&r,s]})})]})}function gr(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll|hidden/.test(getComputedStyle(e).overflowY))return e;return document.scrollingElement}function wa(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll/.test(getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight)return e;return document.scrollingElement}function ev(t){try{return t.matches(":focus-visible")}catch{return true}}const nv=vt(()=>import("./MapView-Z1P-A5bs.mjs").then(t=>({default:t.RootMap}))),ov=vt(()=>import("./Collection-BccJjqj8.mjs").then(t=>({default:t.Collection}))),rv=vt(()=>import("./TargetItems-l-tLGkfE.mjs").then(t=>({default:t.TargetsSection}))),sv=vt(()=>import("./Contents-drpA8FtX.mjs").then(t=>({default:t.Contents}))),iv=vt(()=>import("./Search-DQ6z5C9S.mjs").then(t=>({default:t.Search}))),av=vt(()=>import("./Transcript-CuHNI7e_.mjs").then(t=>({default:t.Transcript}))),cv=vt(()=>import("./Annotations-C0uuxF0R.mjs").then(t=>({default:t.Annotations}))),De=t=>f(St,{fallback:null,children:t}),lv=()=>null,uv=ie(function({layout:e="tabs",value:n,defaultValue:o,onValueChange:r,onClose:s,closeOnEscape:i=false,headingLevel:a=3,as:c="aside",download:l=true,languages:d=true,interfaceLanguages:u=true,sections:p,labels:h,className:m,children:g,onKeyDown:_,...w},S){var Z;const{clover:v}=ae("Panel"),y=R(null),{t:x,langOf:k,hostLanguage:N,i18n:D}=Et(),j=Lo(x("informationPanelTabs"),k("informationPanelTabs"),!!(w["aria-label"]||w["aria-labelledby"])||!(["aside","section","nav"].includes(c)||w.role)),et=E=>{const z=k(E);return z?f("span",{...dt(z),children:x(E)}):x(E)},V=(E,z)=>{const K=h==null?void 0:h[E];if(K===void 0)return et(z);if(typeof K=="string")return K;const G=Object.keys(K),ht=ns(G,D.language);if(!ht)return et(z);const ft=ko(ht,N);return ft?f("span",{...dt(ft),children:K[ht]}):K[ht]},nt=Ts(p),Y=E=>nt.includes(E),J=ue.Children.toArray(g).filter(E=>ue.isValidElement(E)&&E.type===lv),M=e==="accordion"?a+1:a,T=d||u||l?f(qg,{languages:d,interfaceLanguages:u,download:l}):void 0,O=J.length?J.map(({props:E})=>({value:E.value,label:E.label,content:E.children,...E.value==="about"&&{actions:T}})):[...Y("about")?[{value:"about",label:V("about","informationPanelTabsAbout"),content:f(Wg,{headingLevel:M,download:l}),actions:T}]:[],...Y("targets")?[{value:"targets",label:V("targets","informationPanelTabsTargets"),content:De(f(rv,{headingLevel:M}))}]:[],...Y("collection")?[{value:"collection",label:V("collection","informationPanelTabsCollection"),content:De(f(ov,{headingLevel:M}))}]:[],...Y("contents")?[{value:"contents",label:V("contents","informationPanelTabsContents"),content:De(f(sv,{}))}]:[],...Y("search")?[{value:"search",label:V("search","informationPanelTabsSearch"),content:De(f(iv,{headingLevel:M,sticky:true,size:"small"}))}]:[],...Y("map")?[{value:"map",label:V("map","informationPanelTabsMap"),content:De(f(nv,{}))}]:[],...Y("transcript")?[{value:"transcript",label:V("transcript","transcriptLabel"),content:De(f(av,{sticky:true,size:"small"}))}]:[],...Y("annotations")?[{value:"annotations",label:V("annotations","informationPanelTabsAnnotations"),content:De(f(cv,{headingLevel:M}))}]:[]],U=st(E=>E.search.query),Q=O.some(E=>E.value==="search"),[at,ct]=H(()=>U&&Q?"search":o??null),mt=R(U&&Q?U:"");F(()=>{Q&&(U&&U!==mt.current&&n===void 0&&ct("search"),mt.current=U)},[U,Q,n]);const b=st(E=>{var z;return E.annotationId&&((z=E.regions)!=null&&z.entries.some(K=>K.id===E.annotationId))?E.annotationId:null}),I=O.some(E=>E.value==="contents");F(()=>{b&&I&&n===void 0&&ct("contents")},[b,I,n]);const P=n!==void 0?n:at,A=(O.some(E=>E.value===P)?P:(Z=O[0])==null?void 0:Z.value)==="search";if(F(()=>{Q&&v.setSetVisible(as,A)},[v,Q,A]),!O.length)return null;const B=()=>{var z;const E=y.current;E!=null&&E.contains(document.activeElement)&&((z=dv(E))==null||z.focus()),s==null||s()};return f(c,{ref:E=>{y.current=E,typeof S=="function"?S(E):S&&(S.current=E)},className:It("clover-panel",m),"data-layout":e,"data-closable":s?"":void 0,"data-floating":i?"":void 0,...j.props,onKeyDown:E=>{_==null||_(E),i&&s&&E.key==="Escape"&&!E.defaultPrevented&&(E.preventDefault(),B())},...w,children:[j.node,s&&f("button",{type:"button",className:"clover-panel-close","aria-label":x("informationPanelClose"),...dt(k("informationPanelClose")),onClick:B,children:[f("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",fill:"none",stroke:"currentColor",children:f(Tc,{})}),f(qe,{label:x("informationPanelClose")})]}),f(wl.Provider,{value:O.some(E=>E.value==="about"),children:f(Qg,{items:O,layout:e,value:n!==void 0?n:at,onValueChange:E=>{n===void 0&&ct(E),r==null||r(E)},label:x("informationPanelTabs"),labelLang:k("informationPanelTabs"),headingLevel:a})})]})});function dv(t){for(let e=t;e&&e!==document.body;e=e.parentElement){if(!e.id)continue;const n=document.querySelector(`[aria-controls~="${e.id.replace(/["\\]/g,"\\$&")}"]`);if(n)return n}return null}const fv=1,hv=4,pv=8,mv=500,gv=4,xa=["pointerdown","mousedown","pointerup","mouseup","click","dblclick"],El=()=>typeof document>"u"?16:parseFloat(getComputedStyle(document.documentElement).fontSize)||16;function ao(t,e){if(t===void 0)return;if(typeof t=="number")return t;const n=parseFloat(t);if(!Number.isNaN(n))return t.endsWith("rem")?n*El():t.endsWith("%")?n/100*e:n}const vr=t=>typeof t=="number"?`${t}px`:t,vv=t=>{if(!t||typeof localStorage>"u")return{};try{const e=JSON.parse(localStorage.getItem(t)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}},yv=(t,e)=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},bv=t=>t?Array.from(t.children).filter(e=>e.classList.contains("clover-split-pane")):[];function _v(t){const e=i=>{let a=t[i];for(;a&&!a.classList.contains("clover-split-pane");)a=a[i];return a},n=e("previousElementSibling"),o=e("nextElementSibling"),r=o!=null&&o.hasAttribute("data-sized")?o:n!=null&&n.hasAttribute("data-sized")?n:null;return{sized:r,other:r===o?n:o}}function wv(t,e,n){const{sized:o,other:r}=_v(t);if(!o)return null;const s=e.clientWidth,i=o.dataset.splitKey??"",a=n[i]??{},c=n[(r==null?void 0:r.dataset.splitKey)??""]??{},l=ao(a.min,s)??0,u=o.getBoundingClientRect().width+((r==null?void 0:r.getBoundingClientRect().width)??0)-(ao(c.min,s)??0),p=Math.max(l,Math.min(ao(a.max,s)??u,u)),h=o.getBoundingClientRect().left>=t.getBoundingClientRect().left-1;return{sized:o,key:i,min:l,max:p,after:h}}function xv(t,e,n){const o=e!==void 0&&e>t.min+1&&e<t.max-1?[t.min,e,t.max]:[t.min,t.max],r=n??e??t.sized.getBoundingClientRect().width,s=o.find(i=>i>r+1)??o[0];return{to:s,own:e!==void 0&&Math.abs(s-e)<=1}}function Sv(t,e){const n=e.sized.getBoundingClientRect().width,o=fv*El()*(t.shiftKey?4:1),r=e.after?"ArrowLeft":"ArrowRight",s=e.after?"ArrowRight":"ArrowLeft";if(t.key===r)return n+o;if(t.key===s)return n-o;if(t.key==="Home")return e.min;if(t.key==="End")return e.max}function Sa(t){var n,o,r;const e=(o=(n=t.target)==null?void 0:n.closest)==null?void 0:o.call(n,".clover-tip");return!!(e&&((r=t.currentTarget)!=null&&r.contains(e)))}function kv(t,e){let n=null,o=false,r=null,s=null;const i=a=>{s==null||s();const c=t(),l=c==null?void 0:c.ownerDocument.defaultView;if(!c||!l)return;const d=g=>Math.hypot(g.clientX-a.x,g.clientY-a.y)>a.reach,u=()=>{xa.forEach(g=>l.removeEventListener(g,p,true)),l.removeEventListener("pointermove",h,true),clearTimeout(m),s=null},p=g=>{if(!c.contains(g.target)){if(g.type==="pointerdown"&&d(g))return u();g.preventDefault(),g.stopPropagation()}},h=g=>d(g)&&u();xa.forEach(g=>l.addEventListener(g,p,true)),l.addEventListener("pointermove",h,true);const m=setTimeout(u,mv);s=u};return{down(a){var d;if(o=false,r=null,a.defaultPrevented||a.button!==0||Sa(a))return;const c=e().limits();if(!c)return;a.preventDefault(),n={found:c,x:a.clientX,from:c.sized.getBoundingClientRect().width,slop:a.pointerType==="touch"?pv:hv,moved:false};const l=a.currentTarget;l.dataset.dragging="",(d=l.setPointerCapture)==null||d.call(l,a.pointerId)},move(a){const c=n;if(!c)return;const l=a.clientX-c.x;!c.moved&&Math.abs(l)<c.slop||(c.moved=true,e().resize(c.from+(c.found.after?-l:l)))},up(a){const c=n;o=(c==null?void 0:c.moved)??false,r=c&&!c.moved&&a.type==="pointerup"?{x:a.clientX,y:a.clientY,reach:c.slop*gv}:null,n=null,delete a.currentTarget.dataset.dragging},click(a){const c=o,l=r;o=false,r=null,!(a.defaultPrevented||c||Sa(a))&&(e().step(),l&&i(l))},key(a){if(a.defaultPrevented)return;const c=e().limits();if(!c)return;const l=Sv(a,c);l!==void 0&&(e().resize(l),a.preventDefault())},dispose(){s==null||s()}}}const Is=he(null);function Ls(t,e){typeof t=="function"?t(e):t&&(t.current=e)}const Cv=ie(function({as:e="div",storageKey:n,className:o,style:r,children:s,...i},a){const c=R(null),l=R({}),[d,u]=H({});F(()=>u(vv(n)),[n]);const p=ut((m,g)=>u(_=>{const w={..._};return g===void 0?delete w[m]:w[m]=Math.round(g),yv(n,w),w}),[n]),h=bt(()=>({sizes:d,setSize:p,specs:l,element:c}),[d,p]);return f(Is.Provider,{value:h,children:f(e,{ref:m=>{c.current=m,Ls(a,m)},className:["clover-split",o].filter(Boolean).join(" "),style:{display:"flex",...r},...i,children:s})})}),Ml=ie(function({as:e="div",size:n,min:o,max:r,name:s,className:i,style:a,children:c,...l},d){const u=jt(Is),p=R(null),[h,m]=H(s??"");F(()=>{if(s)return m(s);const _=bv(u==null?void 0:u.element.current);m(String(_.indexOf(p.current)))},[s,u]),u&&h&&(u.specs.current[h]={min:o,max:r,size:n});const g=u&&h?u.sizes[h]:void 0;return f(e,{ref:_=>{p.current=_,Ls(d,_)},className:["clover-split-pane",i].filter(Boolean).join(" "),"data-split-key":h||void 0,"data-sized":n!==void 0?"":void 0,style:{minWidth:vr(o)??0,"--clover-split-size":g!==void 0?`${g}px`:vr(n),"--clover-split-max":vr(r),...a},...l,children:c})}),Ev=ie(function({className:e,children:n,onPointerDown:o,onClick:r,onKeyDown:s,...i},a){const c=jt(Is),{t:l,langOf:d}=Et(),u=R(null),[p,h]=H(),m=ut(()=>{const k=u.current,N=c==null?void 0:c.element.current;return!k||!N||!c?null:wv(k,N,c.specs.current)},[c]),g=ut(k=>{const N=m();if(!N||!c)return;const D=Math.min(N.max,Math.max(N.min,k));c.setSize(N.key,D),h({now:D,min:N.min,max:N.max})},[m,c]),_=ut(()=>{const k=m();k&&h({now:k.sized.getBoundingClientRect().width,min:k.min,max:k.max})},[m]);F(()=>{const k=c==null?void 0:c.element.current;if(_(),!k||typeof ResizeObserver>"u")return;let N=0;const D=new ResizeObserver(()=>{cancelAnimationFrame(N),N=requestAnimationFrame(_)});return D.observe(k),()=>{cancelAnimationFrame(N),D.disconnect()}},[_,c,c==null?void 0:c.sizes]);const w=k=>{var N;return Math.round(k/(((N=c==null?void 0:c.element.current)==null?void 0:N.clientWidth)||1)*100)},S=()=>{var et,V;const k=m();if(!k||!c)return;const N=((et=c.element.current)==null?void 0:et.clientWidth)??0,D=ao((V=c.specs.current[k.key])==null?void 0:V.size,N),j=xv(k,D,c.sizes[k.key]);if(!j.own)return g(j.to);c.setSize(k.key,void 0),h({now:D,min:k.min,max:k.max})},v=R({limits:m,resize:g,step:S});v.current={limits:m,resize:g,step:S};const[y]=H(()=>kv(()=>u.current,()=>v.current));F(()=>()=>y.dispose(),[y]);const x=i["aria-label"]??l("splitHandle");return f("div",{ref:k=>{u.current=k,Ls(a,k)},role:"separator","aria-orientation":"vertical","aria-label":x,...dt(i["aria-label"]===void 0?d("splitHandle"):void 0),"aria-valuenow":p?w(p.now):void 0,"aria-valuemin":p?w(p.min):void 0,"aria-valuemax":p?w(p.max):void 0,tabIndex:0,className:["clover-split-handle",e].filter(Boolean).join(" "),onPointerDown:k=>{o==null||o(k),y.down(k)},onPointerMove:k=>y.move(k),onPointerUp:k=>y.up(k),onPointerCancel:k=>y.up(k),onClick:k=>{r==null||r(k),y.click(k)},onKeyDown:k=>{s==null||s(k),y.key(k)},...i,children:[n,f(qe,{label:x})]})});let Tl;function Mv(t){Tl=t}function Ty(){return Tl}function Tv({open:t,onOpenChange:e,controls:n,side:o}){const{t:r,langOf:s}=Et(),i=pe().replace(/:/g,"");return f(He,{id:`panel-${i}`,label:r("informationPanelToggle"),lang:s("informationPanelToggle"),expanded:t,controls:n,side:o==="start"?o:void 0,onClick:()=>e(!t),children:f(Ct,{children:[f("rect",{x:"64",y:"96",width:"384",height:"320",rx:"40",fill:"none",strokeWidth:"36"}),f("path",{d:"M320 96v320",fill:"none",strokeWidth:"36"}),t&&f("path",{d:"M320 96h88a40 40 0 0 1 40 40v240a40 40 0 0 1-40 40h-88z"})]})})}let Iv,co;const Il=()=>Iv??(Iv=import("./dragToClose-aTN7qXF5.mjs").then(t=>co=t));function Lv(){Il()}function Pv(t,{enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i=false}){const a=R({enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i});a.current={enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i},F(()=>{const c=t.current;if(!c||(co==null||co.reset(c,a),!e))return;let l=true,d;return Il().then(u=>{l&&(d=u.attach(c,a))}),()=>{l=false,d==null||d()}},[t,e])}const Av=240,Ov="16rem",Nv="14rem",Rv=31;function Bv(t){const[e,n]=H(t),[o,r]=H(t);return F(()=>{if(t){n(true);const i=requestAnimationFrame(()=>requestAnimationFrame(()=>r(true)));return()=>cancelAnimationFrame(i)}r(false);const s=setTimeout(()=>n(false),Av);return()=>clearTimeout(s)},[t]),{mounted:e,open:t&&o}}function $v(t){const e=n=>t.querySelector(n);return e('[role="tab"][aria-selected="true"]')??e('.clover-sections-button[aria-expanded="true"]')??e(".clover-sections-button")}const Fv=typeof window>"u"?F:Ut;function Dv(t,e){const[n,o]=H();return Fv(()=>{const r=t.current;if(!r)return;const s=()=>{const a=r.clientWidth;if(!a)return;const c=parseFloat(getComputedStyle(document.documentElement).fontSize);o(a>=e*(c||16))};if(s(),typeof ResizeObserver>"u")return;const i=new ResizeObserver(s);return i.observe(r),()=>i.disconnect()},[t,e]),n}const ka=typeof window>"u"?F:Ut;function zv({id:t,beside:e,defaultOpen:n,side:o,focus:r=$v,slides:s=true,alongside:i,followFocus:a}){var J,M;const c=R(null),l=R(null),d=R(null),u=e===false,[p,h]=H(n),[m,g]=H(false),_=u?m:p,w=()=>document.querySelector(`button[aria-controls~="${t}"]`),S=()=>a(w),v=()=>{var T,O,U;(T=c.current)!=null&&T.contains(document.activeElement)&&((O=d.current)==null||O.removeAttribute("inert"),(U=w())==null||U.focus(),S())},y=R(0),x=T=>{y.current=u&&T?3:0,y.current||S(),u&&g(T),h(T)},k=()=>{v(),x(false)},N=R(e),D=R(false);if(N.current===true&&e===false){const T=document.activeElement;D.current=!!(T&&((J=c.current)!=null&&J.contains(T)||(M=w())!=null&&M.contains(T)))}ka(()=>{var T;D.current&&(D.current=false,(T=w())==null||T.focus(),S()),e===true&&g(false),N.current=e},[e]);const j=Bv(s&&u&&_),et=s&&u,V=et?j.mounted:_,nt=et?j.open:_,Y=u&&nt;return ka(()=>{const T=d.current;if(T)return Y?T.setAttribute("inert",""):T.removeAttribute("inert"),()=>T.removeAttribute("inert")},[Y]),F(()=>{if(!y.current||!c.current)return;y.current-=1;const T=r(c.current);T==null||T.focus({preventScroll:true}),T&&document.activeElement===T&&(y.current=0)}),Pv(c,{enabled:u&&nt,side:o,onClose:k,scrim:l,alongside:i,exits:!s}),{pane:c,main:d,over:u,open:_,shown:V,opened:nt,setOpen:x,close:k,onKeyDown:T=>{u&&_&&T.key==="Escape"&&!T.defaultPrevented&&(T.preventDefault(),k())},scrim:u&&V&&{ref:l,"data-open":nt,"aria-hidden":true,onMouseDown:T=>T.preventDefault(),onClick:k}}}const Hv=typeof window>"u"?F:Ut;function Wv(t,e,n){Hv(()=>{const o=t.current,r=o==null?void 0:o.parentElement;if(!n||!o||!r)return;const s=()=>{const c=e();o.style.setProperty("--clover-template-spine-top",`${c?c.getBoundingClientRect().top-r.getBoundingClientRect().top:0}px`)};s();const i=new ResizeObserver(s);for(const c of Array.from(r.children))i.observe(c);const a=e();return a&&i.observe(a),()=>i.disconnect()},[t,n])}const Uv=()=>import("./PanelPart-7C8kqYXz.mjs");function jv({id:t,beside:e,defaultOpen:n,side:o="end",followFocus:r,body:s,sections:i,panel:a}){const c=zv({id:t,beside:e,defaultOpen:n,side:o,followFocus:r}),l=!c.over&&c.open,d=R(null),[u,p]=H(),h=a??u,m=()=>Uv().then(w=>p(()=>w.default));F(()=>{c.open&&!h&&m()},[c.open]),Wv(d,()=>s==null?void 0:s(),l&&!!s);const g=w=>{var S,v;(v=(S=w.target).closest)!=null&&v.call(S,`[aria-controls~="${t}"]`)&&(h||m(),c.over&&Lv())},_=f(Vv,{sections:i,open:c.open,onOpenChange:w=>w&&!h?m().then(()=>c.setOpen(true)):c.setOpen(w),controls:t,side:o});return{...c,id:t,side:o,docked:l,spine:d,toggle:_,Part:h,splitProps:{"data-panel":c.over?"over":"beside",onKeyDown:c.onKeyDown,onPointerOver:g,onFocus:g}}}function Vv({sections:t,...e}){return Ts(t).length?f(Tv,{...e}):null}function qv({pane:t,className:e,...n}){const{id:o,over:r,docked:s,side:i,Part:a}=t,c=Ts(n.sections);if(!c.length)return null;const l=s&&f(Ct,{children:[f(Ev,{className:"clover-template-panel-handle","aria-controls":o}),f("div",{ref:t.spine,className:"clover-template-spine",children:t.toggle})]});return f(Ct,{children:[i==="end"&&l,f(Ml,{ref:t.pane,id:o,"data-spine":r||void 0,"data-side":i,name:"panel","data-about":c.includes("about")||void 0,className:["clover-template-panel clover-template-drawer",e].filter(Boolean).join(" "),size:"24rem",min:r?void 0:Nv,"data-open":t.opened,hidden:!t.shown,children:a&&f(a,{...n,onClose:r?t.close:void 0,closeOnEscape:r})}),i==="start"&&l,t.scrim&&f("div",{className:"clover-template-scrim",...t.scrim})]})}const Kv=30;function Zv(){const t=R(0);return F(()=>()=>cancelAnimationFrame(t.current),[]),e=>{cancelAnimationFrame(t.current);let n=0;const o=()=>{const r=e();r&&Gv()?r.focus():++n<Kv&&(t.current=requestAnimationFrame(o))};t.current=requestAnimationFrame(o)}}function Gv(){const t=document.activeElement;return!t||t===document.body||!t.isConnected||t.closest("[hidden], [inert]")!==null}function Xv({className:t,header:e=true,headingLevel:n=2,panel:o=true,defaultPanelOpen:r,panelLayout:s="accordion",panelSections:i,panelLabels:a,download:c=true,languages:l=true,interfaceLanguages:d=true,items:u="slider",singleItem:p=false,storageKey:h="clover-template-default",fill:m=false,collapseControls:g,canvasOptions:_,...w}){const S=R(null),v=pe().replace(/:/g,""),y=`${v}-panel`,x=al(n,`${v}-title`),k=jv({id:y,beside:Dv(S,Rv),defaultOpen:r??true,followFocus:Zv(),sections:i,body:()=>{var j;return(j=S.current)==null?void 0:j.querySelector(".clover-template-default-body")},panel:uv}),N=k.over,D=o&&k.docked;return f(gf,{className:["clover-template-default",t].filter(Boolean).join(" "),"data-fill":m||void 0,...e?x.group:null,...w,children:f(Cv,{ref:S,className:"clover-template-default-panes clover-template-panes",storageKey:h||void 0,...o?k.splitProps:{"data-panel":"beside"},children:[f(Ml,{ref:k.main,className:"clover-template-default-main",min:N?void 0:Ov,children:[e&&f("header",{className:"clover-template-default-header",children:[f(Yv,{title:x}),f(_o,{of:"targets",layout:"pager",size:"small",className:"clover-template-default-pager"}),f(vl,{className:"clover-template-default-provider",children:f(yl,{})})]}),f(fg,{loading:false}),f(Lm,{className:"clover-template-default-body",collapseControls:g,options:_,children:o&&!D&&k.toggle}),f("div",{className:"clover-template-default-rail",children:[f("div",{className:"clover-template-default-rail-header",children:[f(ty,{}),f(dg,{})]}),u&&f(_o,{layout:u,singleItem:p})]})]}),o&&f(qv,{pane:k,className:"clover-template-default-panel",layout:s,sections:i,labels:a,download:c,languages:l,interfaceLanguages:d,headingLevel:e?Qv(n):n})]})})}function Yv({title:t}){const e=st(o=>{var r;return o.throughCollection?(r=o.collection)==null?void 0:r.label:void 0}),n=pp();return Jv(n==null?void 0:n.entries[0]),f(Ct,{children:[f(sn,{as:t.as,className:"clover-template-default-title clover-template-title clover-title",...t.title}),e&&f("div",{className:"clover-template-default-collection-row",children:[f(sn,{as:"p",label:e,className:"clover-template-default-collection"}),f(_o,{of:"members",layout:"pager",size:"small",className:"clover-template-default-pager"})]}),n&&f("div",{className:"clover-template-default-collection-row",children:[n.label&&f(sn,{as:"p",label:n.label,className:"clover-template-default-collection"}),f(_o,{of:"annotations",layout:"pager",size:"small",className:"clover-template-default-pager"})]})]})}function Jv(t){const{clover:e}=ae(),n=st(r=>{var s;return(s=r.manifest)==null?void 0:s.id}),o=R(null);F(()=>{if(!t||!n||o.current===n)return;o.current=n;const{annotationId:r,canvasId:s}=e.store.get();!r&&s===t.canvasId&&e.selectAnnotation(t.id)},[e,t,n])}const Qv=t=>t+1;function ty(){const t=xs();return f("p",{className:"clover-template-default-titles",children:t.map((e,n)=>f(ue.Fragment,{children:[n>0&&f("span",{className:"clover-template-default-titles-dot","aria-hidden":"true",children:"\xB7"}),f(sn,{label:e.label})]},e.id))})}const ey=()=>import("./renderers-CKX3o8vY.mjs"),ny=vt(()=>import("./Document-7CrcC3Cu.mjs").then(t=>({default:t.Document}))),oy=vt(()=>import("./Gallery-Dmmh85gM.mjs").then(t=>({default:t.Gallery}))),Ca={default:Xv,document:ny,gallery:oy},ry={header:["default"],panel:["default","gallery"],items:["default","gallery"],singleItem:["default","document"],fill:["default"],defaultPanelOpen:["default","document","gallery"],panelLayout:["default","document","gallery"],panelSections:["default","document","gallery"],panelLabels:["default","document","gallery"],download:["default","document","gallery"],languages:["default","document","gallery"],storageKey:["default","document","gallery"],defaultSidebarOpen:["document"],size:["gallery"],height:["gallery"],gap:["gallery"],secondary:["gallery"],summary:["gallery"],lightboxItems:["gallery"]};function sy({props:t}){const e=typeof t.template=="string"&&t.template in Ca?t.template:"default",n=Object.fromEntries(Object.entries(t).filter(([i])=>{var a;return i!=="template"&&(((a=ry[i])==null?void 0:a.includes(e))??true)})),o=on(ey,!!t.renderers),r=bt(()=>o==null?void 0:o.toRenderers(t.renderers),[o,t.renderers]);if(t.renderers&&!o)return null;n.renderers=r,typeof n.storageKey=="string"&&(n.storageKey=n.storageKey.trim().toLowerCase()==="false"?false:n.storageKey);const s=Ca[e];return f(St,{fallback:null,children:f(s,{...n,iiifContent:t.iiifContent})})}const iy=""+new URL("../assets/maplibre-gl-worker-kTz9OPxr.js",import.meta.url).href,ay={mapWorkerUrl:iy},cy={tag:"clover-viewer",kind:"alone",attributes:{template:{prop:"template",type:["default","document","gallery"]},"iiif-content":{prop:"iiifContent",type:"string"},"canvas-id":{prop:"defaultCanvasId",type:"string"},"manifest-id":{prop:"defaultManifestId",type:"string"},language:{prop:"language",type:"string"},"high-contrast":{prop:"highContrast",type:"boolean"},"search-query":{prop:"searchQuery",type:"string"},annotations:{prop:"annotations",type:"data"},"heading-level":{prop:"headingLevel",type:"number",min:2},items:{prop:"items",type:["slider","list","grid","masonry","false"]},"single-item":{prop:"singleItem",type:"boolean"},header:{prop:"header",type:"boolean"},panel:{prop:"panel",type:"boolean"},download:{prop:"download",type:"boolean"},languages:{prop:"languages",type:"boolean"},"interface-languages":{prop:"interfaceLanguages",type:"boolean"},"panel-open":{prop:"defaultPanelOpen",type:"boolean"},"panel-layout":{prop:"panelLayout",type:["accordion","tabs"]},"panel-sections":{prop:"panelSections",type:"data"},"panel-labels":{prop:"panelLabels",type:"data"},"sidebar-open":{prop:"defaultSidebarOpen",type:"boolean"},"storage-key":{prop:"storageKey",type:"string"},fill:{prop:"fill",type:"boolean"},"collapse-controls":{prop:"collapseControls",type:["auto","always"]},size:{prop:"size",type:"string"},height:{prop:"height",type:"string"},gap:{prop:"gap",type:"string"},secondary:{prop:"secondary",type:["summary","navDate","none"]},summary:{prop:"summary",type:"boolean"},"lightbox-items":{prop:"lightboxItems",type:["slider","pager"]}},properties:["iiifContent","annotations","request","renderers","canvasOptions"],events:{"clover-canvas-change":{prop:"onCanvasChange",detail:["canvasId"]},"clover-manifest-change":{prop:"onManifestChange",detail:["manifestId"]},"clover-status-change":{prop:"onStatusChange",detail:["status","error"]},"clover-content-state-change":{prop:"onContentStateChange",detail:"first"}}};Mv(ay.mapWorkerUrl);cu(cy,()=>Promise.resolve(sy));export{Cu as $,R as A,Lm as B,ee as C,Cv as D,Ml as E,_o as F,Ev as G,Ov as H,Cf as I,qv as J,Lv as K,sn as L,bu as M,st as N,pp as O,dg as P,wy as Q,gf as R,fg as S,bt as T,dp as U,St as V,vt as W,ba as X,he as Y,jt as Z,Ut as _,ae as a,Oc as a$,uv as a0,Qd as a1,ky as a2,ss as a3,ul as a4,dl as a5,Ln as a6,fl as a7,wd as a8,wt as a9,ue as aA,Wf as aB,Th as aC,Ec as aD,yc as aE,Eh as aF,Mh as aG,Vf as aH,Hc as aI,Wd as aJ,gs as aK,vp as aL,Qi as aM,If as aN,Lc as aO,te as aP,Rf as aQ,Ch as aR,Uf as aS,He as aT,bf as aU,Ph as aV,En as aW,Lf as aX,kf as aY,Pf as aZ,Af as a_,Ms as aa,dt as ab,Bt as ac,pc as ad,Fd as ae,Ve as af,Et as ag,Lo as ah,It as ai,ug as aj,ie as ak,lg as al,Co as am,Jr as an,Qr as ao,Nn as ap,Pp as aq,sa as ar,ra as as,Xc as at,xs as au,mp as av,ia as aw,is as ax,Eo as ay,W as az,Wu as b,po as b$,Nf as b0,Of as b1,_d as b2,wg as b3,xg as b4,cp as b5,_e as b6,Jg as b7,_y as b8,vy as b9,Id as bA,Vc as bB,lh as bC,uc as bD,un as bE,as as bF,or as bG,ef as bH,Ad as bI,Dn as bJ,Om as bK,Nm as bL,ns as bM,Lp as bN,Ne as bO,Rn as bP,Ty as bQ,ol as bR,Tt as bS,Cd as bT,Hd as bU,ch as bV,ds as bW,hl as bX,Ef as bY,nh as bZ,je as b_,dy as ba,hs as bb,My as bc,We as bd,Fc as be,wh as bf,Ng as bg,rc as bh,es as bi,Ey as bj,Cy as bk,Bd as bl,ls as bm,fy as bn,nr as bo,bs as bp,ko as bq,on as br,ip as bs,fc as bt,Io as bu,hn as bv,xc as bw,Av as bx,xl as by,Bi as bz,Kc as c,ks as c0,yy as c1,dh as c2,lr as c3,md as c4,kh as c5,cc as c6,kp as c7,Td as c8,dn as c9,Bn as ca,Rr as cb,Vi as cc,Tc as cd,hy as ce,py as cf,my as cg,Cp as ch,gm as ci,ea as cj,yp as ck,bp as cl,by as cm,fe as cn,se as co,gg as cp,pl as cq,gy as cr,ys as cs,Rm as ct,Ic as cu,eu as cv,Fm as cw,hp as d,H as e,pe as f,xy as g,Sy as h,Zv as i,zv as j,Ct as k,Dv as l,jv as m,Pu as n,Rv as o,qe as p,ut as q,Cs as r,$m as s,al as t,f as u,Ue as v,vl as w,le as x,F as y,yl as z};
27
+ `).trim()}const Oo=(t,e)=>e==="canvas"?Ve(t.manifest,t.canvasId):t.manifest,el=he(null),Ss=()=>jt(el),sn=ie(function({of:e="manifest",label:n,as:o="span",className:r,...s},i){var p;const a=Rn(h=>{var m,g;return e==="canvas"?(m=Ve(h.manifest,h.canvasId))==null?void 0:m.label:(g=h.manifest)==null?void 0:g.label},void 0),c=Ss(),l=(p=Ne())==null?void 0:p.language,{text:d,lang:u}=wt(n??(c?c.label:a),l);return d?f(o,{ref:i,className:It("clover-label",r),...dt(u),...s,children:Dn(d)}):null});function Rm(t,e,n){const o=(d,u)=>Math.min(Math.max(Math.round(d),0),u),r=n?o(n.x*t.width,t.width-1):0,s=n?o(n.y*t.height,t.height-1):0,i={x:r,y:s,width:n?Math.max(1,o(n.width*t.width,t.width-r)):t.width,height:n?Math.max(1,o(n.height*t.height,t.height-s)):t.height},a=i.width===t.width&&i.height===t.height;if(!a&&!t.regionByPx)return null;if(t.sizeByW){let d=Math.min(1,e/Math.max(i.width,i.height));return t.maxWidth&&(d=Math.min(d,t.maxWidth/i.width)),t.maxHeight&&(d=Math.min(d,t.maxHeight/i.height)),t.maxArea&&(d=Math.min(d,Math.sqrt(t.maxArea/(i.width*i.height)))),po(t,i,Math.max(1,Math.floor(i.width*d)),Math.max(1,Math.floor(i.height*d)))}if(!a)return null;const c=[...t.sizes].sort((d,u)=>d.width-u.width),l=c.find(d=>Math.max(d.width,d.height)>=e)??c.at(-1)??{width:t.width,height:t.height};return po(t,i,l.width,l.height)}function an(t){var e;return(e=ps(t).find(({body:n})=>n.type==="Image"||n.id&&!n.type))==null?void 0:e.body}function Bm(t,{width:e,height:n}){if(t==="full")return{x:0,y:0,width:1,height:1};const o=/^(pct:)?([\d.]+),([\d.]+),([\d.]+),([\d.]+)$/.exec(t);if(!o)return null;const[r,s,i,a]=o.slice(2).map(Number),[c,l]=o[1]?[100,100]:[e,n];return{x:r/c,y:s/l,width:i/c,height:a/l}}function _e(t,e="full",n=false){if(!t)return null;const o=Io(t.service);if(o){if(e!=="full")return{service:o,region:e,fallback:t.id};const{width:r,height:s}=t;return n&&t.id&&r>0&&s>0?{service:o,fallback:t.id,fallbackSize:{width:r,height:s}}:{service:o,fallback:t.id}}return t.id?{src:t.id}:null}function ks(t){const e=t;return e?_e(W(e.thumbnail)[0],"full",true)??_e(an(e))??_e(an(e.placeholderContainer))??_e(an(e.accompanyingContainer)):null}function $m(t){const e=t;return e?_e(an(e))??_e(an(e.placeholderContainer))??_e(an(e.accompanyingContainer))??_e(W(e.thumbnail)[0],"full",true):null}async function Cs(t,e=200,n){if(t.src)return t.src;if(!t.service)return t.fallback;const o=t.fallbackSize;if(o&&t.fallback&&t.region===void 0){const r=Math.max(o.width,o.height);if(r>=e&&r<=e*2)return t.fallback}try{const r=await ys(t.service,{request:n}),s=typeof t.region=="string"?Bm(t.region,r):t.region;return s===null?t.fallback:Rm(r,e,s)??t.fallback}catch{return t.fallback}}const Fm=Object.freeze(Object.defineProperty({__proto__:null,imageSource:_e,resolveThumbnail:Cs,stillSource:$m,thumbnailSource:ks},Symbol.toStringTag,{value:"Module"})),ga='.clover-items-item[role="option"], .clover-items-link',rn=new Map;let $t=null,re=null,Hr=0;function Es(t){const e=rn.get(t);if(!e)return;const n=t.clientHeight>0&&t.scrollHeight>t.clientHeight+1;n!==e.cut&&(e.cut=n,e.change(n))}function Wr(){cancelAnimationFrame(Hr),Hr=requestAnimationFrame(()=>rn.forEach((t,e)=>Es(e)))}function nl(t){var r,s;if(t.key!=="Escape")return;const e=new Set,n=(s=(r=document.activeElement)==null?void 0:r.closest)==null?void 0:s.call(r,ga);n&&e.add(n);try{document.querySelectorAll(`:is(${ga}):hover`).forEach(i=>e.add(i))}catch{}const o=[...e].filter(i=>i.dataset.fullHidden===void 0&&i.querySelector(".clover-items-label-full"));o.length&&(t.preventDefault(),t.stopPropagation(),o.forEach(i=>Ic(i,"fullHidden",["pointerenter",i===n?"blur":"focus"])))}function Dm(){var t,e;$t=typeof ResizeObserver>"u"?null:new ResizeObserver(n=>n.forEach(o=>Es(o.target))),re=typeof MutationObserver>"u"?null:new MutationObserver(Wr),re==null||re.observe(document.head,{childList:true,subtree:true,characterData:true}),re==null||re.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),(e=(t=document.fonts)==null?void 0:t.addEventListener)==null||e.call(t,"loadingdone",Wr),document.addEventListener("keydown",nl,true)}function zm(){var t,e,n;cancelAnimationFrame(Hr),(t=$t==null?void 0:$t.disconnect)==null||t.call($t),re==null||re.disconnect(),$t=re=null,(n=(e=document.fonts)==null?void 0:e.removeEventListener)==null||n.call(e,"loadingdone",Wr),document.removeEventListener("keydown",nl,true)}function Hm(t,e){var n;return rn.size||Dm(),rn.set(t,{change:e}),(n=$t==null?void 0:$t.observe)==null||n.call($t,t),Es(t),()=>{var o;rn.delete(t),(o=$t==null?void 0:$t.unobserve)==null||o.call($t,t),rn.size||zm()}}const Wm=/^(-?\d{4,})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?)?/;function ol(t,e){if(typeof t!="string")return null;const n=Wm.exec(t.trim());if(!n)return null;const[o,r,s,i=0,a=0,c=0]=n.slice(1,7).map(u=>u===void 0?void 0:Number(u)),l=new Date(Date.UTC(2e3,r-1,s,i,a,c));if(l.setUTCFullYear(o),l.getUTCMonth()!==r-1||l.getUTCDate()!==s)return null;const d=!i&&!a&&!c&&!Number(n[7]??0);return{at:l,precision:e??(d?s!==1?"day":r!==1?"month":"year":"time")}}const Um=vt(()=>import("./NavDate-C5fftA6E.mjs").then(t=>t.a).then(({NavDate:t})=>({default:t})));function jm(t,e,n,o){const r=t.source!==void 0?t.source:ks(t.resource),[s,i]=H(r==null?void 0:r.src),a=(r==null?void 0:r.src)??(r==null?void 0:r.service)??(r==null?void 0:r.fallback);return F(()=>{if(!r)return i(void 0);if(r.src)return i(r.src);if(!o)return;let c=true;return Cs(r,e,n).then(l=>{c&&i(l)}),()=>{c=false}},[a,e,o]),{src:s,none:!r}}const Vm=()=>f("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",children:[f("path",{d:"M232 416a24 24 0 01-14.9-5.2L125.8 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.8l91.3-74.8A24 24 0 01256 120v272a24 24 0 01-24 24z"}),f("path",{d:"M336 176a112 112 0 010 160M384 128a176 176 0 010 256",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"32"})]});function qm({part:t,size:e,request:n,alt:o,altLang:r}){const[s,i]=H(null),a=Hc(s,zc,s==null?void 0:s.closest('[data-layout="slider"] .clover-items-viewport')),{src:c,none:l}=jm(t,e,n,a),[d,u]=H(false),{width:p,height:h}=t.resource??{},m=p&&h?p/h:1;return f("span",{ref:i,className:"clover-items-picture","data-loaded":d,"data-empty":c?void 0:true,style:c&&!(p&&h)?void 0:{"--clover-items-ratio":m},children:[!c&&l&&Bn(t.media)&&f(Vm,{}),c&&f("img",{src:c,alt:o,...dt(o?r:void 0),width:e,height:Math.round(e/m),loading:"lazy",decoding:"async",draggable:false,onLoad:()=>u(true),onError:()=>u(true)}),t.duration?f("span",{className:"clover-items-duration",children:ch(t.duration)}):null]})}function Km({text:t,lang:e,first:n}){const o=R(null),[r,s]=H(false);return F(()=>{const i=o.current;if(!(!i||!t))return Hm(i,s)},[t]),f("span",{className:"clover-items-label","data-clamped":r||void 0,children:[!n&&" ",f("span",{ref:o,className:"clover-items-label-text",...dt(t?e:void 0),children:t}),r&&f("span",{className:"clover-items-label-full",...dt(e),"aria-hidden":"true",hidden:true,children:t})]})}function Zm({item:t,size:e,language:n,request:o,showSummary:r=false,secondary:s="summary",labels:i=true}){var u,p;const a=t.parts.map(h=>wt(t.parts.length===1?t.label:h.label,n)),c=r&&s==="summary"?wt(t.summary,n):null,l=r&&s==="navDate"?ol(t.navDate):null,d=a.some(h=>h.text);return f("figure",{role:"none",className:"clover-items-figure","data-parts":t.parts.length,"data-media":(p=(u=t.parts[0])==null?void 0:u.media)==null?void 0:p.toLowerCase(),style:{"--parts":t.parts.length},children:[f("span",{className:"clover-items-pictures",children:t.parts.map((h,m)=>{const g=a[m].text?{text:""}:wt(h.label,n);return f(qm,{part:h,size:e,request:o,alt:g.text,altLang:g.lang},h.id)})}),(d||l||(c==null?void 0:c.text))&&f("figcaption",{className:"clover-items-caption",style:i?void 0:Ue,children:[a.map((h,m)=>f(Km,{text:h.text,lang:h.lang,first:m===0},t.parts[m].id)),l&&f(St,{fallback:null,children:f(Um,{value:t.navDate,className:"clover-items-date"})}),(c==null?void 0:c.text)&&f("span",{className:"clover-items-summary",...dt(c.lang),children:c.text.replace(/<[^>]*>/g,"")})]})]})}function Gm(t){var e;return(e=ps(t).find(({body:n})=>n.type))==null?void 0:e.body.type}function rl(t){const e=Gm(t)??(t.type==="Timeline"?"Sound":void 0);return{id:t.id,type:t.type,label:t.label,resource:t,duration:Number(t.duration)||void 0,media:e}}const va=new WeakMap;function sl(t){if(!t)return[];let e=va.get(t);if(!e){const{canvases:n,views:o}=Bt(t);e=o.map(r=>{const s=r.map(i=>rl(n[i]));return{id:s[0].id,parts:s,label:s.length===1?s[0].label:{none:[s.map(i=>wt(i.label).text).filter(Boolean).join(" \u2013 ")]}}}),va.set(t,e)}return e}const ya=new WeakMap;function bo(t){if(!t)return[];let e=ya.get(t);return e||(e=W(t.items).filter(n=>n==null?void 0:n.id).map(n=>{var o;return{id:n.id,parts:[rl(n)],label:n.label,summary:n.summary,...typeof n.navDate=="string"?{navDate:n.navDate}:{},href:((o=W(n.homepage)[0])==null?void 0:o.id)??n.id,...Ln(W(n.homepage)[0])?{hrefLang:Ln(W(n.homepage)[0])}:{}}}),ya.set(t,e)),e}function ky(t){return t?Array.isArray(t)?bo({items:t}):t.type==="Collection"?bo(t):sl(t):[]}function il(t){const e=Math.max(1,Math.round(t));return e<=6?`h${e}`:null}const Ms=(t,e="p")=>il(t)??e;function al(t,e,n="p"){const o=il(t);return o?{as:o,title:{},group:{}}:{as:n,title:{id:e},group:{role:"group","aria-labelledby":e}}}function Xm(t,e,{orientation:n="both",rtl:o=false,onActivate:r,onMove:s}={}){const[i,a]=H(Math.max(0,e)),c=R([]),l=R(r);l.current=r;const d=R(s);d.current=s,F(()=>{e>=0&&a(e)},[e]);const u=Math.min(i,Math.max(0,t-1)),p=ut(g=>{var _;a(g),(_=c.current[g])==null||_.focus()},[]),h=ut((g,_)=>{var k,N;const w=o?"ArrowLeft":"ArrowRight",S=o?"ArrowRight":"ArrowLeft",v=n!=="vertical",y=n!=="horizontal";let x=null;if(v&&g.key===w||y&&g.key==="ArrowDown")x=Math.min(t-1,_+1);else if(v&&g.key===S||y&&g.key==="ArrowUp")x=Math.max(0,_-1);else if(g.key==="Home")x=0;else if(g.key==="End")x=t-1;else if(g.key==="Enter"||g.key===" "){(k=l.current)==null||k.call(l,_,g),g.preventDefault();return}x!==null&&(g.preventDefault(),p(x),x!==_&&((N=d.current)==null||N.call(d,x,g)))},[t,n,o,p]);return{focused:u,itemProps:g=>({ref:_=>{c.current[g]=_},tabIndex:g===u?0:-1,onKeyDown:_=>h(_,g),onFocus:()=>a(g)})}}const Ym=5,Jm=()=>{var t;return typeof window<"u"&&!!((t=window.matchMedia)!=null&&t.call(window,"(prefers-reduced-motion: reduce)").matches)};function cl({align:t="start",dragFree:e=false,itemCount:n=0,axis:o="x"}={}){const r=o==="y",[s,i]=H(null),[a,c]=H(false),[l,d]=H(false),u=R(t);u.current=t;const p=e?"none":`${o} mandatory`,h=ut(()=>{if(!s)return;const v=Math.abs(r?s.scrollTop:s.scrollLeft),y=r?s.scrollHeight-s.clientHeight:s.scrollWidth-s.clientWidth;c(v>1),d(v<y-1)},[s,r]);F(()=>{if(!s)return;const v=s.style;v.overflowX=r?"hidden":"auto",v.overflowY=r?"auto":"hidden",v.scrollSnapType=p,v.setProperty("--clover-track-align",t),r?v.overscrollBehaviorY="contain":v.overscrollBehaviorX="contain"},[s,p,t,r]),F(()=>{if(!s)return;let v=0;const y=()=>{cancelAnimationFrame(v),v=requestAnimationFrame(h)};h(),s.addEventListener("scroll",y,{passive:true});const x=typeof ResizeObserver<"u"?new ResizeObserver(y):null;return x==null||x.observe(s),s.firstElementChild&&(x==null||x.observe(s.firstElementChild)),()=>{cancelAnimationFrame(v),s.removeEventListener("scroll",y),x==null||x.disconnect()}},[s,h,n]);const m=ut((v,y=false)=>{if(!s||!v)return;const x=y||Jm()?"auto":"smooth";s.scrollBy({[r?"top":"left"]:v,behavior:x})},[s,r]),g=ut((v,{instant:y=false}={})=>{const x=s==null?void 0:s.querySelector(`[data-track-index="${v}"]`);if(!s||!x)return false;const k=s.getBoundingClientRect(),N=x.getBoundingClientRect(),D=getComputedStyle(s).direction==="rtl";return r?(m(u.current==="center"?N.top+N.height/2-(k.top+k.height/2):N.top-k.top,y),true):(m(u.current==="center"?N.left+N.width/2-(k.left+k.width/2):D?N.right-k.right:N.left-k.left,y),true)},[s,m,r]),_=ut(v=>{if(!s)return;const y=!r&&getComputedStyle(s).direction==="rtl",x=r?s.clientHeight:s.clientWidth;m(v*x*.9*(y?-1:1))},[s,m,r]),w=ut(()=>_(1),[_]),S=ut(()=>_(-1),[_]);return F(()=>{if(!s)return;let v=null,y=false;const x=j=>{j.pointerType!=="mouse"||j.button!==0||(v={x:r?j.clientY:j.clientX,scroll:r?s.scrollTop:s.scrollLeft},y=false)},k=j=>{var V;if(!v)return;const et=(r?j.clientY:j.clientX)-v.x;!y&&Math.abs(et)<Ym||(y||(y=true,(V=s.setPointerCapture)==null||V.call(s,j.pointerId),s.style.scrollSnapType="none",s.dataset.dragging="true"),r?s.scrollTop=v.scroll-et:s.scrollLeft=v.scroll-et)},N=j=>{var et;v&&(v=null,y&&((et=s.releasePointerCapture)==null||et.call(s,j.pointerId),delete s.dataset.dragging,s.style.scrollSnapType=p))},D=j=>{y&&(y=false,j.preventDefault(),j.stopPropagation())};return s.addEventListener("pointerdown",x),s.addEventListener("pointermove",k),s.addEventListener("pointerup",N),s.addEventListener("pointercancel",N),s.addEventListener("click",D,true),()=>{s.removeEventListener("pointerdown",x),s.removeEventListener("pointermove",k),s.removeEventListener("pointerup",N),s.removeEventListener("pointercancel",N),s.removeEventListener("click",D,true)}},[s,p,r]),{ref:i,canScrollPrev:a,canScrollNext:l,scrollPrev:S,scrollNext:w,scrollToIndex:g,measure:h}}const _o=ie(function(e,n){return!Ne()||e.iiifContent!==void 0||e.items!==void 0?f(St,{fallback:null,children:f(Qm,{...e,forwardedRef:n})}):f(tg,{...e,forwardedRef:n})}),Qm=vt(()=>import("./StandaloneItems-87W1Mih3.mjs"));function tg({of:t="views",...e}){return t==="targets"?f(ng,{...e}):t==="annotations"?f(rg,{...e}):t==="members"?f(ll,{...e}):f(sg,{...e})}const eg=vt(()=>import("./TargetItems-Bms6M3cB.mjs"));function ng(t){return st(n=>{var o;return(((o=n.targets)==null?void 0:o.items.length)??0)>1})?f(St,{fallback:null,children:f(eg,{...t})}):null}const og=vt(()=>import("./AnnotationItems-DJVaxdsI.mjs"));function rg(t){return st(n=>!!pc(n.manifest,n.addedSets))?f(St,{fallback:null,children:f(og,{...t})}):null}function ll({onSelect:t,forwardedRef:e,...n}){const{clover:o,language:r}=Ne(),s=st(d=>d.collection),i=st(d=>{var u;return((u=d.manifest)==null?void 0:u.id)??null}),a=bo(s),c=ss(s==null?void 0:s.viewingDirection);if(!a.length)return null;const l=(d,u)=>{t==null||t(d,u),o.goToManifest(d.id)};if(n.layout==="pager"){const d=a.findIndex(u=>u.id===i);return f(dl,{...n,forwardedRef:e,steps:ul(a,d,c,l),nameKey:"informationPanelTabsCollection",position:f(ag,{position:d,total:a.length,list:u=>f(ll,{layout:"list",forwardedRef:null,onSelect:u})})})}return f(fl,{...n,forwardedRef:e,items:a,selected:a.findIndex(d=>d.id===i),navigation:"id",rtl:c==="right-to-left",language:r,request:o.request,showSummary:true,onActivate:l})}function sg({onSelect:t,forwardedRef:e,singleItem:n=false,...o}){const{clover:r,language:s}=Ne(),i=st(u=>u.manifest),a=st(u=>$n(u.manifest,u.canvasId)),c=st(u=>Bt(u.manifest).direction),l=sl(i);if(l.length<(n?1:2))return null;const d=u=>r.goTo(u.id);return o.layout==="pager"?f(dl,{...o,forwardedRef:e,steps:ul(l,a,c,d)}):f(fl,{...o,forwardedRef:e,items:l,selected:a,navigation:"id",rtl:c==="right-to-left",language:s,request:r.request,onActivate:(u,p)=>{t==null||t(u,p),r.goTo(u.id)},followFocus:d})}function ul(t,e,n,o){return{position:e,total:t.length,direction:n,step:(r,s)=>{const i=t[e+r];i&&o(i,s)}}}const ig=vt(()=>import("./PagerLayout-CKN0Llkn.mjs")),ag=vt(()=>import("./PagerLayout-CKN0Llkn.mjs").then(({CountMenu:t})=>({default:t})));function dl(t){return f(St,{fallback:null,children:f(ig,{...t})})}function fl({forwardedRef:t,items:e,selected:n,navigation:o,rtl:r=false,layout:s="slider",orientation:i="horizontal",thumbnailSize:a=200,request:c,language:l,showSummary:d=false,secondary:u="summary",labels:p=true,heading:h,headingLevel:m=2,renderItem:g,onActivate:_,followFocus:w,as:S="section",className:v,"aria-label":y,size:x,singleItem:k,highContrast:N,...D}){var gt;const{t:j}=Et(),et=pe(),V=Co(t,D.lang),{langOf:nt}=V,Y=Jr(N),J=s==="slider",M=J&&i==="vertical",T=o==="id",O=R(null),U=s==="masonry";F(()=>{const q=O.current;if(!U||!q)return;let ot,_t=true;return import("../masonry-BZCdA3bV.mjs").then(({attachMasonry:Ft})=>{_t&&(ot=Ft(q))}),()=>{_t=false,ot==null||ot()}},[U]);const Q=cl({align:T?"center":"start",itemCount:e.length,axis:M?"y":"x"}),at=R(void 0);F(()=>()=>window.clearTimeout(at.current),[]);const ct=Xm(e.length,n,{orientation:M?"vertical":s==="slider"?"horizontal":s==="list"?"vertical":"both",rtl:r,onActivate:(q,ot)=>_(e[q],ot),onMove:w?(q,ot)=>{window.clearTimeout(at.current);const _t=()=>w(e[q]);ot.repeat?at.current=window.setTimeout(_t,150):_t()}:void 0}),mt=R(null),b=R(false);b.current=!!((gt=mt.current)!=null&&gt.contains(mt.current.ownerDocument.activeElement)),F(()=>{var Ft;const q=mt.current;if(!q||!b.current)return;const{activeElement:ot,body:_t}=q.ownerDocument;ot&&ot!==_t||(Ft=q.querySelector(`[data-track-index="${Math.max(0,n)}"]`))==null||Ft.focus()},[e]);const I=R(false);F(()=>{var _t;if(n<0)return;const q=!I.current;if(J){Q.scrollToIndex(n,{instant:q})&&(I.current=true);return}I.current=true;const ot=(_t=mt.current)==null?void 0:_t.querySelector(`[data-track-index="${n}"]`);ot&&cg(ot,q)},[J,n,Q.scrollToIndex]);const P=Ms(m),A=h?wt(h.label,l):null,B=h?wt(h.summary,l):null,Z=y===void 0&&!!(A!=null&&A.text),E=Lo(j("itemsLabel"),nt("itemsLabel"),y!==void 0||Z,V.hostLanguage),z=Z?{"aria-labelledby":`${et}-title`}:y!==void 0?{"aria-label":y}:E.props,K=(q,ot)=>g?g(q,{selected:ot}):f(Zm,{item:q,size:a,language:l,request:c,showSummary:d,secondary:u,labels:p}),G=q=>!(g||wt(q.label,l).text||d&&u==="summary"&&wt(q.summary,l).text),ht=(q,ot)=>G(q)?j("canvasPosition",{index:ot+1,total:e.length}):void 0,ft=q=>G(q)?nt("canvasPosition"):void 0,Rt=J?{display:"flex",flexDirection:M?"column":void 0,margin:0,padding:0,listStyle:"none"}:void 0,At=J?{flex:"0 0 auto",scrollSnapAlign:T?"center":"start"}:void 0,zt=T&&n>=0,Ht=q=>{const ot=n+(q==="prev"?-1:1),_t=zt?ot>=0&&ot<e.length:q==="prev"?Q.canScrollPrev:Q.canScrollNext,Ft=zt?q==="prev"?"commonPrevious":"commonNext":q==="prev"?"itemsScrollBack":"itemsScrollForward",$=j(Ft),lt=Ot=>{if(!_t)return;if(!zt)return(q==="prev"?Q.scrollPrev:Q.scrollNext)();const Ke=e[ot];w?w(Ke):_(Ke,Ot)};return f("button",{type:"button",className:`clover-items-scroll-${q}`,"aria-controls":zt?void 0:`${et}-viewport`,...dt(nt(Ft)),"aria-disabled":!_t||void 0,tabIndex:_t?void 0:-1,onClick:lt,children:[f("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:f("path",{d:M?q==="next"?"M3 6l5 5 5-5":"M3 10l5-5 5 5":q==="next"!==r?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),f("span",{style:Ue,children:$}),f(qe,{label:$})]})};return f(Nn.Provider,{value:V.hostLanguage,children:f(S,{ref:V.ref,className:It("clover-items",v),"data-layout":s,"data-orientation":M?"vertical":void 0,"data-navigation":o,...Qr(Y),...D,children:[h&&((A==null?void 0:A.text)||(B==null?void 0:B.text))&&f("header",{className:"clover-items-header",children:[(A==null?void 0:A.text)&&f(P,{className:"clover-items-title clover-title",id:`${et}-title`,...dt(A.lang),children:A.text}),(B==null?void 0:B.text)&&f("p",{className:"clover-items-description",...dt(B.lang),children:B.text.replace(/<[^>]*>/g,"")}),h.homepage&&f("a",{className:"clover-items-homepage",href:h.homepage,hrefLang:h.homepageLang,...dt(nt("commonViewAll")),children:j("commonViewAll")})]}),f("div",{className:"clover-items-frame",style:{position:"relative"},dir:r?"rtl":void 0,children:[J&&Ht("prev"),f("div",{id:`${et}-viewport`,className:"clover-items-viewport",ref:J?Q.ref:O,children:T?f("div",{ref:mt,role:"listbox",...z,"aria-orientation":M?"vertical":J?"horizontal":s==="list"?"vertical":void 0,className:"clover-items-track",style:Rt,children:e.map((q,ot)=>{const _t=ot===n;return f("div",{id:`${et}-${ot}`,role:"option","aria-selected":_t,"aria-label":ht(q,ot),...dt(ft(q)),className:"clover-items-item","data-track-index":ot,style:At,...ct.itemProps(ot),onClick:Ft=>_(q,Ft),children:K(q,_t)},q.id)})}):f("ul",{...z,className:"clover-items-track",style:Rt,children:e.map((q,ot)=>f("li",{className:"clover-items-item","data-track-index":ot,style:At,children:f("a",{className:"clover-items-link",href:q.href,hrefLang:q.hrefLang,"aria-label":ht(q,ot),...dt(ft(q)),draggable:false,onClick:_t=>_(q,_t),children:K(q,false)})},q.id))})}),J&&Ht("next")]}),E.node]})})}function cg(t,e){var i,a;let n=t.parentElement;for(;n&&n!==document.body;){const{overflowY:c}=getComputedStyle(n);if(/(auto|scroll)/.test(c)&&n.scrollHeight>n.clientHeight)break;n=n.parentElement}if(!n||n===document.body)return;const o=n.getBoundingClientRect(),r=t.getBoundingClientRect(),s=r.top<o.top?r.top-o.top:r.bottom>o.bottom?r.bottom-o.bottom:0;if(s){const c=(i=window.matchMedia)==null?void 0:i.call(window,"(prefers-reduced-motion: reduce)").matches;(a=n.scrollBy)==null||a.call(n,{top:s,behavior:e||c?"auto":"smooth"})}}function lg(t,e){const{clover:n}=ae(e),o=hp(),{direction:r}=Kc(),s=st(l=>l.collection),i=st(l=>{var d;return((d=l.manifest)==null?void 0:d.id)??null}),a=st(l=>{var d;return((d=l.targets)==null?void 0:d.items.length)??0}),c=st(l=>wd(l.targets,l.targetIndex,l.manifest,l.canvasId));if(t==="targets")return{position:c,total:a,direction:"left-to-right",step:l=>{const d=c+l;d>=0&&d<a&&n.goToTarget(d)}};if(t==="members"){const l=bo(s),d=l.findIndex(u=>u.id===i);return{position:d,total:l.length,direction:"left-to-right",step:u=>{const p=l[d+u];p&&n.goToManifest(p.id)}}}return{position:o.position,total:o.total,direction:r,step:l=>l<0?o.previous():o.next()}}const ug=ie(function({steps:e,as:n="span",className:o,...r},s){const{t:i,langOf:a}=Et(),{position:c,total:l}=e;if(l<2||c<0)return null;const d=c+1;return f(n,{ref:s,className:It("clover-pager-position",o),...r,children:[f("span",{"aria-hidden":"true",children:[d," / ",l]}),f("span",{className:"clover-pager-room","aria-hidden":"true",hidden:true,children:[l," / ",l]}),f("span",{style:Ue,...dt(a("canvasPosition")),children:i("canvasPosition",{index:d,total:l})})]})}),dg=ie(function({of:e="views",...n},o){const r=lg(e,"Position");return f(ug,{ref:o,...n,steps:r})});function fg({className:t,loading:e,error:n}){const{t:o,langOf:r}=Et(),{status:s,error:i}=up(),a=s==="loading",c=e!==void 0&&e!==false;return f(Ct,{children:[f("p",{className:It("clover-status",t),"data-status":a?s:void 0,role:"status",style:a&&e!==false?void 0:Ue,children:[a&&(c?e:e===void 0&&f(En,{})),a&&!c&&f("span",{style:Ue,...dt(r("statusLoading")),children:o("statusLoading")})]}),s==="error"&&i&&f("div",{className:It("clover-status",t),"data-status":s,role:"alert",children:n?n(i):f(Ct,{children:[f("p",{...dt(r("statusError")),children:o("statusError")}),f("p",{className:"clover-status-detail",lang:"en",children:i.message})]})})]})}function hg(t,e=false,n=3){const o=e||Am(t),r=e?`${n}
28
+ ${t}`:t,[s,i]=H(null);return F(()=>{if(!o)return;let a=true;return Promise.all([import("./sanitize-DETRcc_c.mjs"),e?import("../markdown-CCYJwzFn.mjs"):null]).then(([{sanitizeHTML:c,trusted:l},d])=>{const u=d?d.markdownToHtml(t,{headingLevel:n}):t,p=c(u,{markdown:!!d});a&&i({for:r,html:p,inner:l(p)})}),()=>{a=false}},[t,r,o,e,n]),o&&(s==null?void 0:s.for)===r?s:null}const pg=new Set(["p","span","h1","h2","h3","h4","h5","h6","a","b","i","em","strong","small","sub","sup","label"]),hl=ie(function({as:e="span",markup:n,language:o,format:r,headingLevel:s,...i},a){const{text:c,lang:l}=wt(n,o),d=dt(l),u=Om(r,c),p=u==="markdown",h=hg(u==="plain"?"":c,p,s),m=(h==null?void 0:h.html)??null;if(!c)return null;if(u==="plain")return f(e,{ref:a,...i,...d,children:c.split(/\r?\n/).map((_,w)=>f(ue.Fragment,{children:[w>0&&f("br",{}),_]},w))});const g=typeof e=="string"&&pg.has(e)&&m&&/<(p|ul|ol|div)[\s>]/i.test(m)?"div":e;return h?f(g,{ref:a,...i,...d,dangerouslySetInnerHTML:{__html:h.inner}}):f(e,{ref:a,...i,...d,children:p?Nm(c):Dn(c)})}),pl=({metadata:t,language:e,renderValue:n,...o})=>t!=null&&t.length?f("dl",{...o,children:t.map((r,s)=>{const i=wt(r.label,e),a=n==null?void 0:n(r);return f("div",{"data-label":wt(r.label,"none").text.replace(/\s+/g,"-").toLowerCase(),children:[f("dt",{...dt(i.lang),children:i.text}),a!==void 0?f("dd",{children:a}):f(hl,{as:"dd",markup:r.value,language:e})]},s)})}):null,mg=typeof window>"u"?F:Ut;function gg({children:t}){const{t:e}=Et(),n=Co(),o=R(null),r=pe(),s=ue.Children.only(t),i=s.props.id??r,{open:a,cut:c,toggle:l}=vg(o);return f("div",{className:"clover-read-more",children:[ue.cloneElement(s,{ref:o,id:i,"data-read-more":a?"open":""}),(c||a)&&f("button",{type:"button",className:"clover-read-more-button","aria-expanded":a,"aria-controls":i,onClick:l,ref:n.ref,...dt(n.langOf(a?"readLess":"readMore")),children:e(a?"readLess":"readMore")})]})}function vg(t){const[e,n]=H(false),[o,r]=H(false),s=()=>{const i=t.current;i&&!e&&r(i.scrollHeight>i.clientHeight+1)};return mg(s),F(()=>{var u,p;const i=t.current;if(!i)return;let a=0;const c=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(s)},l=typeof ResizeObserver>"u"?null:new ResizeObserver(c);l==null||l.observe(i);const d=typeof MutationObserver>"u"?null:new MutationObserver(c);return d==null||d.observe(document.head,{childList:true,subtree:true,characterData:true}),d==null||d.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),d==null||d.observe(i,{attributes:true,attributeFilter:["style"]}),(p=(u=document.fonts)==null?void 0:u.addEventListener)==null||p.call(u,"loadingdone",c),()=>{var h,m;cancelAnimationFrame(a),l==null||l.disconnect(),d==null||d.disconnect(),(m=(h=document.fonts)==null?void 0:h.removeEventListener)==null||m.call(h,"loadingdone",c)}},[e,t.current]),{open:e,cut:o,toggle:()=>n(i=>!i)}}function pn(t,e,n){const o=Ss(),r=Rn(s=>{var i;return(i=Oo(s,t))==null?void 0:i[e]},void 0);return n!==void 0?n:o?o[e]:r}const zn=()=>{var t;return(t=Ne())==null?void 0:t.language};function ba({of:t="manifest",as:e="p",value:n,className:o,...r}){const s=pn(t,"summary",n),i=zn();return wt(s,i).text?f(gg,{children:f(hl,{as:e,markup:s,language:i,className:It("clover-summary",o),...r})}):null}function yg({of:t="manifest",value:e,className:n,renderValue:o,...r}){const s=pn(t,"metadata",e),i=zn();return f(pl,{metadata:s,language:i,renderValue:o,className:It("clover-metadata",n),...r})}function bg({of:t="manifest",value:e,className:n,...o}){const r=pn(t,"requiredStatement",e),s=zn();return f(pl,{metadata:r?[r]:null,language:s,className:It("clover-required-statement",n),...o})}function _g({of:t="manifest",value:e,className:n,...o}){const r=pn(t,"rights",e);return r?f("a",{href:r,className:It("clover-rights",n),...o,children:r}):null}function wg({of:t="manifest",value:e,className:n,...o}){const r=pn(t,"id",e);return r?f("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:It("clover-id",n),...o,children:r}):null}function ml({property:t,className:e,of:n="manifest",value:o,...r}){const s=W(pn(n,t,o)),i=zn(),a=s.filter(c=>c==null?void 0:c.id);return a.length?f("ul",{className:e,...r,children:a.map(c=>{const l=wt(c.label,i);return f("li",{children:[f("a",{href:c.id,target:"_blank",rel:"noopener noreferrer",hrefLang:Ln(c),...dt(l.text?l.lang:void 0),children:l.text?Dn(l.text):c.id}),c.format&&f("span",{className:"clover-link-format",children:[" (",c.format,")"]})]},c.id)})}):null}const xg=({className:t,...e})=>f(ml,{property:"homepage",className:It("clover-homepage",t),...e}),Sg=({className:t,...e})=>f(ml,{property:"seeAlso",className:It("clover-see-also",t),...e});function kg({of:t="manifest",value:e,size:n=400,className:o,...r}){var m;const s=Rn(g=>Oo(g,t),null),i=e??s,a=zn(),c=i?ks(i):null,l=(c==null?void 0:c.src)??(c==null?void 0:c.service)??(c==null?void 0:c.fallback),[d,u]=H(c==null?void 0:c.src),p=(m=Ne())==null?void 0:m.clover.request;if(F(()=>{if(!c)return u(void 0);if(c.src)return u(c.src);let g=true;return Cs(c,n,p).then(_=>g&&u(_)),()=>{g=false}},[l,n]),!d)return null;const h=wt(i==null?void 0:i.label,a);return f("img",{src:d,alt:Dn(h.text),...dt(r.alt===void 0&&h.text?h.lang:void 0),width:n,loading:"lazy",decoding:"async",className:It("clover-thumbnail",o),...r})}const Cg=typeof window>"u"?F:Ut,gl=he(null),Eg=t=>{var e;return!!((e=t.textContent)!=null&&e.trim())||t.querySelector("img, svg, picture, video, canvas, object")!==null},Mg=t=>!!t&&typeof t=="object"&&["label","logo","homepage"].some(e=>W(t[e]).length>0),Ur=t=>!!t&&typeof t.id=="string",Tg=t=>{const e=W(t.homepage).find(Ur);return e?{id:e.id,hrefLang:Ln(e)}:void 0},Ig=(t,e)=>{var n;if(!t)return null;for(const o of[t.label,(n=W(t.homepage).find(r=>r==null?void 0:r.label))==null?void 0:n.label]){const r=wt(o,e);if(r.text)return{text:Dn(r.text),lang:r.lang}}return null};function vl({of:t="manifest",value:e,link:n=true,children:o,className:r,...s}){var l;const i=Rn(d=>{var u;return(u=Oo(d,t))==null?void 0:u.provider},void 0),a=(l=Ne())==null?void 0:l.language,c=W(e!==void 0?e:i).filter(Mg);return c.length?f("ul",{className:It("clover-provider",r),...s,children:c.map((d,u)=>{const p=n?Tg(d):void 0,h=!!wt(d.label,a).text;return f(Lg,{agent:d,homepage:p,children:o??f(Ct,{children:[f(yl,{alt:h?"":void 0}),f(sn,{className:"clover-provider-label"})]})},d.id??u)})}):null}function Lg({agent:t,homepage:e,children:n}){const o=R(null),[r,s]=H(null),i=ut(()=>{o.current&&!Eg(o.current)&&s(t)},[t]);return r===t?null:f("li",{className:"clover-provider-agent",children:f(el.Provider,{value:t,children:f(gl.Provider,{value:i,children:e?f("a",{ref:o,href:e.id,target:"_blank",rel:"noopener noreferrer",hrefLang:e.hrefLang,className:"clover-provider-link",children:n}):f("span",{ref:o,className:"clover-provider-content",children:n})})})})}function yl({of:t="manifest",value:e,alt:n,className:o,...r}){var p;const{t:s,langOf:i}=Et(),a=Ss(),c=Rn(h=>{var m;return(m=Oo(h,t))==null?void 0:m.provider},void 0),l=(p=Ne())==null?void 0:p.language,u=(e!==void 0?W(e):a?[a]:W(c)).flatMap(h=>{if(!h||typeof h!="object")return[];const m=h;if(m.type!=="Agent"&&Ur(m)&&!m.logo)return[{image:m,agent:null}];const g=W(m.logo).find(Ur);return g?[{image:g,agent:m}]:[]});return u.length?f(Ct,{children:u.map(({image:h,agent:m},g)=>{const _=Ig(m,l);return f(Pg,{src:h.id,alt:n??(_==null?void 0:_.text)??s("logo"),...dt(n!==void 0?void 0:_?_.lang:i("logo")),width:h.width,height:h.height,loading:"lazy",decoding:"async",className:It("clover-logo",o),...r},`${h.id}-${g}`)})}):null}function Pg({alt:t,onError:e,...n}){const o=jt(gl),[r,s]=H(false),i=ut(()=>s(true),[]);Cg(()=>{r&&(o==null||o())},[r,o]);const a=ut(c=>{var l;c!=null&&c.complete&&!c.naturalWidth&&((l=c.decode)==null||l.call(c).catch(i))},[i]);return r?null:f("img",{ref:a,alt:t,onError:c=>{e==null||e(c),i()},...n})}const Ag=t=>t&&typeof t=="object"&&!Array.isArray(t)?Object.keys(t).filter(e=>e!=="none"&&e!=="@none"&&wt({[e]:t[e]}).text):[];function Og(t){if(!t)return[];const e=[...Array.isArray(t.metadata)?t.metadata:[],t.requiredStatement].filter(Boolean),o=[t.label,t.summary,...e.flatMap(r=>[r==null?void 0:r.label,r==null?void 0:r.value])].map(Ag).filter(r=>r.length>1);return[...new Set(o.flat())]}function Ng(){const{language:t,chooseLanguage:e,toggleDrawn:n}=ae("About"),o=st(i=>i.manifest),r=bt(()=>Og(o),[o]),s=rc(r,t);return s&&e?{languages:r,chosen:s,onChange:e,drawn:n??false}:null}function Cy(t,e){return t!=null&&t.drawn?e.every(n=>!!n&&n!=="none"&&t.languages.some(o=>es(o,n))):false}const Rg=vt(()=>import("./LanguageChoice-Bel5VdoV.mjs").then(t=>t.b).then(t=>({default:t.LanguageChoice}))),Bg=t=>{var o;const e=t.closest(".clover-sections-actions"),n=(o=e==null?void 0:e.closest(".clover-sections-item"))==null?void 0:o.querySelector(".clover-sections-heading .clover-sections-label");return e&&n?{box:e,label:n}:null},$g=t=>void Tt.chooseInterfaceLanguage(t);function Fg(){Et();const{languages:t,chosen:e}=Tt.interfaceLanguages();return t.length>1?{languages:t,chosen:e}:null}function bl({values:t=true,interfaceLanguages:e=true}={}){const n=Ng(),o=Fg(),r=t?(n==null?void 0:n.languages)??[]:[],s=u=>r.some(p=>p===u||Tt.stringsFor(p)===u),i=[...r,...(e?(o==null?void 0:o.languages)??[]:[]).filter(u=>!s(u))];if(i.length<2)return null;const a=Tt.chosenLanguage,c=a&&Tt.stringsFor(a),l=c&&i.includes(c)&&!s(c)?c:t&&n?n.chosen:(o==null?void 0:o.chosen)??i[0];return{languages:i,chosen:l,onChange:u=>r.includes(u)&&n?n.onChange(u):$g(u)}}function _l({values:t,interfaceLanguages:e}){const n=bl({values:t,interfaceLanguages:e}),{drawsToggle:o}=ae("About"),r=!!n;return F(()=>r?o==null?void 0:o():void 0,[r,o]),n?f(St,{fallback:null,children:f(Rg,{...n,nameKey:"readingLanguage",part:"clover-about",fit:Bg})}):null}const wl=he(false);function _a(t,e){const n=new Set,o=[];for(const r of t)for(const s of W(r==null?void 0:r.rendering)){const i=(s==null?void 0:s.id)??(s==null?void 0:s["@id"]);if(typeof i!="string"||n.has(i))continue;n.add(i);const a=wt(s.label,e);o.push({id:i,label:a.text||s.format||i,lang:a.text?a.lang:void 0,format:s.format,hrefLang:Ln(s)})}return o}function xl(){const{language:t}=ae("Download"),e=st(o=>o.manifest),n=st(o=>We(o.manifest,o.canvasId));return{page:_a(n,t),all:_a([e],t)}}const Dg=vt(()=>import("./Download-HDlM1brf.mjs").then(({DownloadGroups:t})=>({default:t}))),zg=vt(()=>import("./NavDate-C5fftA6E.mjs").then(t=>t.a).then(({NavDate:t})=>({default:t}))),Hg=vt(()=>import("./PartOfManifest-Brc4z7df.mjs"));function Wg({languages:t=true,interfaceLanguages:e=true,...n}){const o=jt(wl);return f(Ug,{...n,download:!o&&n.download!==false,choice:o?null:f(_l,{values:t,interfaceLanguages:e})})}function Ug({choice:t,canvasSummary:e=false,headingLevel:n=3,download:o=true,thumbnail:r=true,label:s=true,className:i,...a}){const{t:c,langOf:l}=Et(),d=xl(),u=st(w=>w.manifest,Object.is,"About"),p=R(null);F(()=>{const w=p.current,S=w==null?void 0:w.querySelector(".clover-about-head");if(!w||!S||typeof ResizeObserver>"u")return;const v=new Set,y=()=>{const N=S.querySelector(".clover-about-thumbnail"),D=S.querySelector(".clover-about-label");for(const nt of[N,D])nt&&!v.has(nt)&&(v.add(nt),k.observe(nt));const j=w.style;if(!N){j.removeProperty("--clover-about-label-height"),j.removeProperty("--clover-about-thumbnail-width");return}const et=`${(D==null?void 0:D.offsetHeight)??0}px`,V=`${N.offsetWidth}px`;j.getPropertyValue("--clover-about-label-height")!==et&&j.setProperty("--clover-about-label-height",et),j.getPropertyValue("--clover-about-thumbnail-width")!==V&&j.setProperty("--clover-about-thumbnail-width",V)};let x=0;const k=new ResizeObserver(()=>{cancelAnimationFrame(x),x=requestAnimationFrame(y)});return k.observe(S),y(),()=>{cancelAnimationFrame(x),k.disconnect(),w.style.removeProperty("--clover-about-label-height"),w.style.removeProperty("--clover-about-thumbnail-width")}},[s,r,u]);const h=pe(),m=()=>{var v,y;const w=p.current;(y=((v=w==null?void 0:w.closest(".clover-sections-item"))==null?void 0:v.querySelector(".clover-sections-button"))??w)==null||y.focus({preventScroll:true})};if(!u)return null;const g=(w,S,v)=>{if(!S)return null;const{as:y,title:x,group:k}=al(n,`${h}-${w}`);return f("section",{className:"clover-about-section",...k,children:[f(y,{className:"clover-about-heading",...dt(l(w)),...x,children:c(w)}),v]})},_=w=>Array.isArray(u[w])?u[w].length>0:!!u[w];return f("div",{ref:p,className:It("clover-about",i),tabIndex:-1,...a,children:[t,(r||s)&&f("div",{className:"clover-about-head",children:[r&&f(kg,{className:"clover-about-thumbnail",size:256,alt:s?"":void 0}),s&&f(sn,{as:Ms(n),className:"clover-about-label clover-title"})]}),e&&f(ba,{of:"canvas",className:"clover-about-summary"}),Bi(u)&&u.partOf&&f(St,{fallback:null,children:f(Hg,{manifest:u,headingLevel:n,onOpened:m})}),f(ba,{className:"clover-about-summary"}),f(yg,{className:"clover-about-metadata"}),f(bg,{className:"clover-about-metadata"}),g("aboutDate",ol(u.navDate),f(St,{fallback:null,children:f(zg,{value:u.navDate,className:"clover-about-date"})})),g("aboutProvider",_("provider"),f(vl,{})),g("aboutRights",u.rights,f(_g,{})),g("aboutHomepage",_("homepage"),f(xg,{})),g("aboutSeeAlso",_("seeAlso"),f(Sg,{})),g("download",o&&d.page.length+d.all.length>0,f(St,{fallback:null,children:f(Dg,{page:d.page,all:d.all,headingLevel:n+1})})),g(Bi(u)?"aboutCanvas":"aboutManifest",!wc(u)&&u.id,f(wg,{}))]})}const jg=vt(()=>import("./ControlMenu-l4F81Jg8.mjs")),Vg=vt(()=>import("./Download-HDlM1brf.mjs").then(({DownloadGroups:t})=>({default:t})));function qg({languages:t=true,interfaceLanguages:e=true,download:n=true}){const o=bl({values:t,interfaceLanguages:e}),{page:r,all:s}=xl(),i=n&&r.length+s.length>0;return!o&&!i?null:f("div",{className:"clover-about-actions",children:[i&&f(Kg,{page:r,all:s}),o&&f(_l,{values:t,interfaceLanguages:e})]})}function Kg({page:t,all:e}){const{t:n,langOf:o}=Et(),[r,s]=H(false),a=`${pe()}-download`,c=ut(l=>{var d;s(false),l&&((d=document.getElementById(a))==null||d.focus())},[a]);return f("span",{className:"clover-about-download",onBlur:l=>{const d=l.relatedTarget;r&&d&&!l.currentTarget.contains(d)&&s(false)},children:[f("button",{type:"button",id:a,className:"clover-about-download-button","aria-label":n("download"),...dt(o("download")),"aria-expanded":r,"aria-controls":r?`${a}-menu`:void 0,onClick:()=>s(l=>!l),children:[f(Zg,{}),f(qe,{label:n("download")})]}),r&&f(St,{fallback:null,children:f(jg,{id:`${a}-menu`,triggerId:a,onClose:c,className:"clover-about-download-menu",children:f(Vg,{page:t,all:e,inPopover:true})})})]})}function Zg(){return f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512","aria-hidden":"true",focusable:"false",fill:"none",stroke:"currentColor",strokeWidth:"56",strokeLinecap:"round",strokeLinejoin:"round",children:f("path",{d:"M256 64v272M160 240l96 96 96-96M80 352v48a48 48 0 0 0 48 48h256a48 48 0 0 0 48-48v-48"})})}function Gg(t,e=null){if(!t)return false;if(e!=null&&e.navPlace||t.navPlace)return true;for(const n of Bt(t).canvases){if(n.navPlace)return true;for(const o of W(n.annotations))for(const r of W(o==null?void 0:o.items))if(r!=null&&r.navPlace||W(r==null?void 0:r.motivation).includes("georeferencing")||W(r==null?void 0:r.body).some(i=>(i==null?void 0:i.type)==="Feature"||(i==null?void 0:i.type)==="FeatureCollection"))return true}return false}const Xg=["about","targets","collection","contents","search","map","transcript","annotations"],Ie={about:t=>{var e,n;return!wc(t.manifest)||!!((e=t.manifest)!=null&&e.rights||(n=t.manifest)!=null&&n.requiredStatement)},targets:t=>{var e;return(((e=t.targets)==null?void 0:e.items.length)??0)>1},collection:t=>{var e,n;return(((n=(e=t.collection)==null?void 0:e.items)==null?void 0:n.length)??0)>0||!!_d(t.manifest)},contents:t=>cp(t.manifest).length>0,search:t=>!!hs(t.manifest),map:t=>Gg(t.manifest,t.collection),transcript:t=>We(t.manifest,t.canvasId).some(e=>Fc(e).length>0||wh(e).length>0),annotations:t=>Bd(t.manifest,t.addedSets).length>0},Yg=(t,e)=>{const n=Array.isArray(e)?new Set(e):void 0;return Xg.filter(o=>t[o]&&(!n||n.has(o)))};function Ts(t){const e={about:st(Ie.about),targets:st(Ie.targets),collection:st(Ie.collection),contents:st(Ie.contents),search:st(Ie.search),map:st(Ie.map),transcript:st(Ie.transcript),annotations:st(Ie.annotations)};return Yg(e,t)}function Jg({open:t=false,className:e}){return f("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",className:It("clover-chevron",e),"data-open":t||void 0,children:f("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Sl=typeof window>"u"?F:Ut,kl=he(null);function Ey(){return jt(kl)}const Cl=he(0);function My(){return jt(Cl)}function Qg({items:t,layout:e="tabs",value:n,onValueChange:o,label:r,labelLang:s,headingLevel:i=3}){var Y,J;const a=pe(),c=Lo(r??"",s,r===void 0),l=R([]),d=e==="tabs",{t:u,langOf:p}=Et(),h=cl({dragFree:true,itemCount:t.length}),m=t.some(M=>M.value===n)?n:((Y=t[0])==null?void 0:Y.value)??null,g=R(new Set);m&&g.current.add(m);const _=R(null),[w,S]=H({value:null,count:0});F(()=>{var at;if(d||!m||_.current!==m)return;_.current=null;const M=t.findIndex(ct=>ct.value===m),T=document.getElementById(`${a}-panel-${M}`),O=(at=l.current[M])==null?void 0:at.parentElement;if(!T||!O)return;const U=O.getBoundingClientRect().bottom-T.getBoundingClientRect().top;if(U<=0)return;const Q=gr(T);Q&&(Q.scrollTop-=U)},[m,d,t,a]);const v=M=>{var I,P,A,B;const T=t.findIndex(Z=>Z.value===m),O=document.getElementById(`${a}-panel-${T}`),U=M.target;if(!O||U===O||!O.contains(U)||!ev(U))return;const Q=(P=(I=l.current[T])==null?void 0:I.parentElement)==null?void 0:P.getBoundingClientRect(),at=T+1<t.length?(B=(A=l.current[T+1])==null?void 0:A.parentElement)==null?void 0:B.getBoundingClientRect():void 0;if(!Q)return;const ct=U.getBoundingClientRect(),mt=ct.top<Q.bottom?Math.floor(ct.top-Q.bottom):at&&ct.bottom>at.top?Math.ceil(Math.min(ct.bottom-at.top,ct.top-Q.bottom)):0,b=mt?gr(O):null;b&&(b.scrollTop+=mt)},y=R(null),x=t.map(M=>M.value).join(`
29
+ `),k=R(false);k.current=!!((J=y.current)!=null&&J.contains(y.current.ownerDocument.activeElement)),F(()=>{var Q;const M=y.current;if(!M||!k.current)return;const{activeElement:T,body:O}=M.ownerDocument;if(T&&T!==O)return;const U=t.findIndex(at=>at.value===m);(Q=l.current[U])==null||Q.focus()},[x]),Sl(()=>{const M=y.current;if(d||!M||typeof ResizeObserver>"u")return;const T=[...M.querySelectorAll(":scope > .clover-sections-item")],O=T.map(E=>E.firstElementChild),U=O[0],Q=O[O.length-1],at=new Map,ct=E=>(E&&at.get(E))??0,mt=document.scrollingElement;let b=null,I=0;const P=()=>{const E=O.reduce((Rt,At)=>Rt+ct(At),0);let z=0;T.forEach((Rt,At)=>{Rt.style.setProperty("--clover-sections-before",`${z}px`),z+=ct(O[At]),Rt.style.setProperty("--clover-sections-after",`${E-z}px`)}),M.style.setProperty("--clover-sections-total",`${E}px`);const K=U&&getComputedStyle(U);(K==null?void 0:K.position)==="sticky"&&Q&&(I=parseFloat(K.top)+parseFloat(getComputedStyle(Q).bottom)||0);const G=getComputedStyle(M),ht=parseFloat(G.lineHeight)||1.2*parseFloat(G.fontSize),ft=(b==null?void 0:b.clientHeight)??0;ft>0&&ft-I-E<2*ht?M.dataset.stacks="off":delete M.dataset.stacks},A=new ResizeObserver(E=>{var z,K;for(const G of E)O.includes(G.target)&&at.set(G.target,((K=(z=G.borderBoxSize)==null?void 0:z[0])==null?void 0:K.blockSize)??G.target.getBoundingClientRect().height);P()}),B=()=>{const E=gr(M);E!==b&&(b&&b!==mt&&A.unobserve(b),E&&E!==mt&&A.observe(E),b=E)},Z=()=>{B(),P()};B();for(const E of O)E&&A.observe(E,{box:"border-box"});return window.addEventListener("resize",Z),()=>{A.disconnect(),window.removeEventListener("resize",Z);for(const E of T)E.style.removeProperty("--clover-sections-before"),E.style.removeProperty("--clover-sections-after");M.style.removeProperty("--clover-sections-total"),delete M.dataset.stacks}},[d,x,i]),F(()=>{if(d)return;const M=l.current.map(O=>O==null?void 0:O.parentElement).filter(O=>!!O),T=O=>{var ct;if(O.ctrlKey)return;const U=O.currentTarget,Q=wa(U);if(!Q||Q===document.scrollingElement)return;O.preventDefault();const at=O.deltaMode===1?parseFloat(getComputedStyle(U).lineHeight)||16:O.deltaMode===2?Q.clientHeight:1;(ct=wa(Q)??document.scrollingElement)==null||ct.scrollBy({left:O.deltaX*at,top:O.deltaY*at,behavior:"instant"})};for(const O of M)O.addEventListener("wheel",T,{passive:false});return()=>{for(const O of M)O.removeEventListener("wheel",T)}},[d,x]);const N=M=>{M!==m&&(_.current=M,d||S(T=>({value:M,count:T.count+1})),o==null||o(M))},D=(M,T)=>{var ct;const O=t.length-1,[U,Q]=d?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"],at=M.key===Q?(T+1)%t.length:M.key===U?(T-1+t.length)%t.length:M.key==="Home"?0:M.key==="End"?O:null;at!==null&&(M.preventDefault(),(ct=l.current[at])==null||ct.focus(),d&&N(t[at].value))},j=R(false);F(()=>{if(!d)return;const M=t.findIndex(b=>b.value===m),T=l.current[M],O=T==null?void 0:T.parentElement;if(!T||!O)return;const U=getComputedStyle(O),Q=O.getBoundingClientRect(),at=T.getBoundingClientRect(),ct=Q.left+(parseFloat(U.scrollPaddingLeft)||0),mt=Q.right-(parseFloat(U.scrollPaddingRight)||0);(at.left<ct-1||at.right>mt+1)&&h.scrollToIndex(M,{instant:!j.current}),j.current=true},[m,d,t.length,h.scrollToIndex]);const et=M=>{const T=M==="prev"?h.canScrollPrev:h.canScrollNext,O=M==="prev"?"sectionsScrollBack":"sectionsScrollForward";return f("button",{type:"button",className:`clover-steps-step clover-sections-scroll-${M}`,"aria-hidden":"true",tabIndex:-1,hidden:!T,...dt(p(O)),onMouseDown:U=>U.preventDefault(),onClick:M==="prev"?h.scrollPrev:h.scrollNext,children:[f("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:f("path",{d:M==="next"?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),f(qe,{label:u(O)})]})},V=Ms(i,"div"),nt=(M,T)=>{const O=M.value===m;return f("button",{ref:U=>{l.current[T]=U},type:"button",id:`${a}-button-${T}`,className:"clover-sections-button","data-value":M.value,"data-track-index":d?T:void 0,"aria-controls":`${a}-panel-${T}`,...d?{role:"tab","aria-selected":O,tabIndex:O?0:-1}:{"aria-expanded":O,"aria-disabled":O||void 0},onClick:()=>N(M.value),onKeyDown:U=>D(U,T),children:[f("span",{className:"clover-sections-label",children:M.label}),!d&&f(Jg,{open:O,className:"clover-sections-chevron"})]},M.value)};return f("div",{ref:y,className:"clover-sections","data-layout":e,onFocus:d?void 0:v,style:d?void 0:{"--clover-sections-count":t.length},children:[d&&f("div",{className:"clover-sections-tabs","data-more":[h.canScrollPrev&&"start",h.canScrollNext&&"end"].filter(Boolean).join(" ")||void 0,children:f("div",{className:"clover-sections-row",children:[f("div",{role:"tablist",ref:h.ref,...c.props,className:"clover-sections-list",children:t.map(nt)}),et("prev"),et("next")]})}),d&&c.node,t.map((M,T)=>{const O=M.value===m;return f("section",{className:"clover-sections-item","data-value":M.value,"data-open":O,style:d?void 0:{"--clover-sections-index":T},children:[!d&&f(V,{className:"clover-sections-heading",children:[nt(M,T),f("span",{className:"clover-sections-reach","aria-hidden":"true"})]}),f(Cl.Provider,{value:w.value===M.value?w.count:0,children:f(tv,{id:`${a}-panel-${T}`,tabs:d,labelledBy:`${a}-button-${T}`,hidden:!O,actions:M.actions,children:g.current.has(M.value)?M.content:null})})]},M.value)})]})}function tv({id:t,tabs:e,labelledBy:n,hidden:o,actions:r,children:s}){const[i,a]=H(null),c=!o||!!r;return Sl(()=>{const l=i==null?void 0:i.parentElement;if(!c||!i||!l||typeof ResizeObserver>"u")return;const d=new ResizeObserver(()=>{const u=i.offsetWidth;u?(l.style.setProperty("--clover-sections-actions",`${u}px`),l.setAttribute("data-actions","")):(l.style.removeProperty("--clover-sections-actions"),l.removeAttribute("data-actions"))});return d.observe(i),()=>{d.disconnect(),l.style.removeProperty("--clover-sections-actions"),l.removeAttribute("data-actions")}},[i,c]),f(Ct,{children:[!e&&f("div",{ref:a,className:"clover-sections-actions",hidden:!c,children:r}),f("div",{id:t,role:e?"tabpanel":"region","aria-labelledby":n,tabIndex:e?0:void 0,className:"clover-sections-panel",hidden:o,children:f(kl.Provider,{value:e?null:i,children:[e&&r,s]})})]})}function gr(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll|hidden/.test(getComputedStyle(e).overflowY))return e;return document.scrollingElement}function wa(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll/.test(getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight)return e;return document.scrollingElement}function ev(t){try{return t.matches(":focus-visible")}catch{return true}}const nv=vt(()=>import("./MapView-ahuj5gKJ.mjs").then(t=>({default:t.RootMap}))),ov=vt(()=>import("./Collection-Bz89v2FT.mjs").then(t=>({default:t.Collection}))),rv=vt(()=>import("./TargetItems-Bms6M3cB.mjs").then(t=>({default:t.TargetsSection}))),sv=vt(()=>import("./Contents-jBpCiUSe.mjs").then(t=>({default:t.Contents}))),iv=vt(()=>import("./Search-COUo-BuO.mjs").then(t=>({default:t.Search}))),av=vt(()=>import("./Transcript-DigEuuAR.mjs").then(t=>({default:t.Transcript}))),cv=vt(()=>import("./Annotations-WWqn_FbM.mjs").then(t=>({default:t.Annotations}))),De=t=>f(St,{fallback:null,children:t}),lv=()=>null,uv=ie(function({layout:e="tabs",value:n,defaultValue:o,onValueChange:r,onClose:s,closeOnEscape:i=false,headingLevel:a=3,as:c="aside",download:l=true,languages:d=true,interfaceLanguages:u=true,sections:p,labels:h,className:m,children:g,onKeyDown:_,...w},S){var Z;const{clover:v}=ae("Panel"),y=R(null),{t:x,langOf:k,hostLanguage:N,i18n:D}=Et(),j=Lo(x("informationPanelTabs"),k("informationPanelTabs"),!!(w["aria-label"]||w["aria-labelledby"])||!(["aside","section","nav"].includes(c)||w.role)),et=E=>{const z=k(E);return z?f("span",{...dt(z),children:x(E)}):x(E)},V=(E,z)=>{const K=h==null?void 0:h[E];if(K===void 0)return et(z);if(typeof K=="string")return K;const G=Object.keys(K),ht=ns(G,D.language);if(!ht)return et(z);const ft=ko(ht,N);return ft?f("span",{...dt(ft),children:K[ht]}):K[ht]},nt=Ts(p),Y=E=>nt.includes(E),J=ue.Children.toArray(g).filter(E=>ue.isValidElement(E)&&E.type===lv),M=e==="accordion"?a+1:a,T=d||u||l?f(qg,{languages:d,interfaceLanguages:u,download:l}):void 0,O=J.length?J.map(({props:E})=>({value:E.value,label:E.label,content:E.children,...E.value==="about"&&{actions:T}})):[...Y("about")?[{value:"about",label:V("about","informationPanelTabsAbout"),content:f(Wg,{headingLevel:M,download:l}),actions:T}]:[],...Y("targets")?[{value:"targets",label:V("targets","informationPanelTabsTargets"),content:De(f(rv,{headingLevel:M}))}]:[],...Y("collection")?[{value:"collection",label:V("collection","informationPanelTabsCollection"),content:De(f(ov,{headingLevel:M}))}]:[],...Y("contents")?[{value:"contents",label:V("contents","informationPanelTabsContents"),content:De(f(sv,{}))}]:[],...Y("search")?[{value:"search",label:V("search","informationPanelTabsSearch"),content:De(f(iv,{headingLevel:M,sticky:true,size:"small"}))}]:[],...Y("map")?[{value:"map",label:V("map","informationPanelTabsMap"),content:De(f(nv,{}))}]:[],...Y("transcript")?[{value:"transcript",label:V("transcript","transcriptLabel"),content:De(f(av,{sticky:true,size:"small"}))}]:[],...Y("annotations")?[{value:"annotations",label:V("annotations","informationPanelTabsAnnotations"),content:De(f(cv,{headingLevel:M}))}]:[]],U=st(E=>E.search.query),Q=O.some(E=>E.value==="search"),[at,ct]=H(()=>U&&Q?"search":o??null),mt=R(U&&Q?U:"");F(()=>{Q&&(U&&U!==mt.current&&n===void 0&&ct("search"),mt.current=U)},[U,Q,n]);const b=st(E=>{var z;return E.annotationId&&((z=E.regions)!=null&&z.entries.some(K=>K.id===E.annotationId))?E.annotationId:null}),I=O.some(E=>E.value==="contents");F(()=>{b&&I&&n===void 0&&ct("contents")},[b,I,n]);const P=n!==void 0?n:at,A=(O.some(E=>E.value===P)?P:(Z=O[0])==null?void 0:Z.value)==="search";if(F(()=>{Q&&v.setSetVisible(as,A)},[v,Q,A]),!O.length)return null;const B=()=>{var z;const E=y.current;E!=null&&E.contains(document.activeElement)&&((z=dv(E))==null||z.focus()),s==null||s()};return f(c,{ref:E=>{y.current=E,typeof S=="function"?S(E):S&&(S.current=E)},className:It("clover-panel",m),"data-layout":e,"data-closable":s?"":void 0,"data-floating":i?"":void 0,...j.props,onKeyDown:E=>{_==null||_(E),i&&s&&E.key==="Escape"&&!E.defaultPrevented&&(E.preventDefault(),B())},...w,children:[j.node,s&&f("button",{type:"button",className:"clover-panel-close","aria-label":x("informationPanelClose"),...dt(k("informationPanelClose")),onClick:B,children:[f("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",fill:"none",stroke:"currentColor",children:f(Tc,{})}),f(qe,{label:x("informationPanelClose")})]}),f(wl.Provider,{value:O.some(E=>E.value==="about"),children:f(Qg,{items:O,layout:e,value:n!==void 0?n:at,onValueChange:E=>{n===void 0&&ct(E),r==null||r(E)},label:x("informationPanelTabs"),labelLang:k("informationPanelTabs"),headingLevel:a})})]})});function dv(t){for(let e=t;e&&e!==document.body;e=e.parentElement){if(!e.id)continue;const n=document.querySelector(`[aria-controls~="${e.id.replace(/["\\]/g,"\\$&")}"]`);if(n)return n}return null}const fv=1,hv=4,pv=8,mv=500,gv=4,xa=["pointerdown","mousedown","pointerup","mouseup","click","dblclick"],El=()=>typeof document>"u"?16:parseFloat(getComputedStyle(document.documentElement).fontSize)||16;function ao(t,e){if(t===void 0)return;if(typeof t=="number")return t;const n=parseFloat(t);if(!Number.isNaN(n))return t.endsWith("rem")?n*El():t.endsWith("%")?n/100*e:n}const vr=t=>typeof t=="number"?`${t}px`:t,vv=t=>{if(!t||typeof localStorage>"u")return{};try{const e=JSON.parse(localStorage.getItem(t)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}},yv=(t,e)=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},bv=t=>t?Array.from(t.children).filter(e=>e.classList.contains("clover-split-pane")):[];function _v(t){const e=i=>{let a=t[i];for(;a&&!a.classList.contains("clover-split-pane");)a=a[i];return a},n=e("previousElementSibling"),o=e("nextElementSibling"),r=o!=null&&o.hasAttribute("data-sized")?o:n!=null&&n.hasAttribute("data-sized")?n:null;return{sized:r,other:r===o?n:o}}function wv(t,e,n){const{sized:o,other:r}=_v(t);if(!o)return null;const s=e.clientWidth,i=o.dataset.splitKey??"",a=n[i]??{},c=n[(r==null?void 0:r.dataset.splitKey)??""]??{},l=ao(a.min,s)??0,u=o.getBoundingClientRect().width+((r==null?void 0:r.getBoundingClientRect().width)??0)-(ao(c.min,s)??0),p=Math.max(l,Math.min(ao(a.max,s)??u,u)),h=o.getBoundingClientRect().left>=t.getBoundingClientRect().left-1;return{sized:o,key:i,min:l,max:p,after:h}}function xv(t,e,n){const o=e!==void 0&&e>t.min+1&&e<t.max-1?[t.min,e,t.max]:[t.min,t.max],r=n??e??t.sized.getBoundingClientRect().width,s=o.find(i=>i>r+1)??o[0];return{to:s,own:e!==void 0&&Math.abs(s-e)<=1}}function Sv(t,e){const n=e.sized.getBoundingClientRect().width,o=fv*El()*(t.shiftKey?4:1),r=e.after?"ArrowLeft":"ArrowRight",s=e.after?"ArrowRight":"ArrowLeft";if(t.key===r)return n+o;if(t.key===s)return n-o;if(t.key==="Home")return e.min;if(t.key==="End")return e.max}function Sa(t){var n,o,r;const e=(o=(n=t.target)==null?void 0:n.closest)==null?void 0:o.call(n,".clover-tip");return!!(e&&((r=t.currentTarget)!=null&&r.contains(e)))}function kv(t,e){let n=null,o=false,r=null,s=null;const i=a=>{s==null||s();const c=t(),l=c==null?void 0:c.ownerDocument.defaultView;if(!c||!l)return;const d=g=>Math.hypot(g.clientX-a.x,g.clientY-a.y)>a.reach,u=()=>{xa.forEach(g=>l.removeEventListener(g,p,true)),l.removeEventListener("pointermove",h,true),clearTimeout(m),s=null},p=g=>{if(!c.contains(g.target)){if(g.type==="pointerdown"&&d(g))return u();g.preventDefault(),g.stopPropagation()}},h=g=>d(g)&&u();xa.forEach(g=>l.addEventListener(g,p,true)),l.addEventListener("pointermove",h,true);const m=setTimeout(u,mv);s=u};return{down(a){var d;if(o=false,r=null,a.defaultPrevented||a.button!==0||Sa(a))return;const c=e().limits();if(!c)return;a.preventDefault(),n={found:c,x:a.clientX,from:c.sized.getBoundingClientRect().width,slop:a.pointerType==="touch"?pv:hv,moved:false};const l=a.currentTarget;l.dataset.dragging="",(d=l.setPointerCapture)==null||d.call(l,a.pointerId)},move(a){const c=n;if(!c)return;const l=a.clientX-c.x;!c.moved&&Math.abs(l)<c.slop||(c.moved=true,e().resize(c.from+(c.found.after?-l:l)))},up(a){const c=n;o=(c==null?void 0:c.moved)??false,r=c&&!c.moved&&a.type==="pointerup"?{x:a.clientX,y:a.clientY,reach:c.slop*gv}:null,n=null,delete a.currentTarget.dataset.dragging},click(a){const c=o,l=r;o=false,r=null,!(a.defaultPrevented||c||Sa(a))&&(e().step(),l&&i(l))},key(a){if(a.defaultPrevented)return;const c=e().limits();if(!c)return;const l=Sv(a,c);l!==void 0&&(e().resize(l),a.preventDefault())},dispose(){s==null||s()}}}const Is=he(null);function Ls(t,e){typeof t=="function"?t(e):t&&(t.current=e)}const Cv=ie(function({as:e="div",storageKey:n,className:o,style:r,children:s,...i},a){const c=R(null),l=R({}),[d,u]=H({});F(()=>u(vv(n)),[n]);const p=ut((m,g)=>u(_=>{const w={..._};return g===void 0?delete w[m]:w[m]=Math.round(g),yv(n,w),w}),[n]),h=bt(()=>({sizes:d,setSize:p,specs:l,element:c}),[d,p]);return f(Is.Provider,{value:h,children:f(e,{ref:m=>{c.current=m,Ls(a,m)},className:["clover-split",o].filter(Boolean).join(" "),style:{display:"flex",...r},...i,children:s})})}),Ml=ie(function({as:e="div",size:n,min:o,max:r,name:s,className:i,style:a,children:c,...l},d){const u=jt(Is),p=R(null),[h,m]=H(s??"");F(()=>{if(s)return m(s);const _=bv(u==null?void 0:u.element.current);m(String(_.indexOf(p.current)))},[s,u]),u&&h&&(u.specs.current[h]={min:o,max:r,size:n});const g=u&&h?u.sizes[h]:void 0;return f(e,{ref:_=>{p.current=_,Ls(d,_)},className:["clover-split-pane",i].filter(Boolean).join(" "),"data-split-key":h||void 0,"data-sized":n!==void 0?"":void 0,style:{minWidth:vr(o)??0,"--clover-split-size":g!==void 0?`${g}px`:vr(n),"--clover-split-max":vr(r),...a},...l,children:c})}),Ev=ie(function({className:e,children:n,onPointerDown:o,onClick:r,onKeyDown:s,...i},a){const c=jt(Is),{t:l,langOf:d}=Et(),u=R(null),[p,h]=H(),m=ut(()=>{const k=u.current,N=c==null?void 0:c.element.current;return!k||!N||!c?null:wv(k,N,c.specs.current)},[c]),g=ut(k=>{const N=m();if(!N||!c)return;const D=Math.min(N.max,Math.max(N.min,k));c.setSize(N.key,D),h({now:D,min:N.min,max:N.max})},[m,c]),_=ut(()=>{const k=m();k&&h({now:k.sized.getBoundingClientRect().width,min:k.min,max:k.max})},[m]);F(()=>{const k=c==null?void 0:c.element.current;if(_(),!k||typeof ResizeObserver>"u")return;let N=0;const D=new ResizeObserver(()=>{cancelAnimationFrame(N),N=requestAnimationFrame(_)});return D.observe(k),()=>{cancelAnimationFrame(N),D.disconnect()}},[_,c,c==null?void 0:c.sizes]);const w=k=>{var N;return Math.round(k/(((N=c==null?void 0:c.element.current)==null?void 0:N.clientWidth)||1)*100)},S=()=>{var et,V;const k=m();if(!k||!c)return;const N=((et=c.element.current)==null?void 0:et.clientWidth)??0,D=ao((V=c.specs.current[k.key])==null?void 0:V.size,N),j=xv(k,D,c.sizes[k.key]);if(!j.own)return g(j.to);c.setSize(k.key,void 0),h({now:D,min:k.min,max:k.max})},v=R({limits:m,resize:g,step:S});v.current={limits:m,resize:g,step:S};const[y]=H(()=>kv(()=>u.current,()=>v.current));F(()=>()=>y.dispose(),[y]);const x=i["aria-label"]??l("splitHandle");return f("div",{ref:k=>{u.current=k,Ls(a,k)},role:"separator","aria-orientation":"vertical","aria-label":x,...dt(i["aria-label"]===void 0?d("splitHandle"):void 0),"aria-valuenow":p?w(p.now):void 0,"aria-valuemin":p?w(p.min):void 0,"aria-valuemax":p?w(p.max):void 0,tabIndex:0,className:["clover-split-handle",e].filter(Boolean).join(" "),onPointerDown:k=>{o==null||o(k),y.down(k)},onPointerMove:k=>y.move(k),onPointerUp:k=>y.up(k),onPointerCancel:k=>y.up(k),onClick:k=>{r==null||r(k),y.click(k)},onKeyDown:k=>{s==null||s(k),y.key(k)},...i,children:[n,f(qe,{label:x})]})});let Tl;function Mv(t){Tl=t}function Ty(){return Tl}function Tv({open:t,onOpenChange:e,controls:n,side:o}){const{t:r,langOf:s}=Et(),i=pe().replace(/:/g,"");return f(He,{id:`panel-${i}`,label:r("informationPanelToggle"),lang:s("informationPanelToggle"),expanded:t,controls:n,side:o==="start"?o:void 0,onClick:()=>e(!t),children:f(Ct,{children:[f("rect",{x:"64",y:"96",width:"384",height:"320",rx:"40",fill:"none",strokeWidth:"36"}),f("path",{d:"M320 96v320",fill:"none",strokeWidth:"36"}),t&&f("path",{d:"M320 96h88a40 40 0 0 1 40 40v240a40 40 0 0 1-40 40h-88z"})]})})}let Iv,co;const Il=()=>Iv??(Iv=import("./dragToClose-C995dPad.mjs").then(t=>co=t));function Lv(){Il()}function Pv(t,{enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i=false}){const a=R({enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i});a.current={enabled:e,side:n,onClose:o,scrim:r,alongside:s,exits:i},F(()=>{const c=t.current;if(!c||(co==null||co.reset(c,a),!e))return;let l=true,d;return Il().then(u=>{l&&(d=u.attach(c,a))}),()=>{l=false,d==null||d()}},[t,e])}const Av=240,Ov="16rem",Nv="14rem",Rv=31;function Bv(t){const[e,n]=H(t),[o,r]=H(t);return F(()=>{if(t){n(true);const i=requestAnimationFrame(()=>requestAnimationFrame(()=>r(true)));return()=>cancelAnimationFrame(i)}r(false);const s=setTimeout(()=>n(false),Av);return()=>clearTimeout(s)},[t]),{mounted:e,open:t&&o}}function $v(t){const e=n=>t.querySelector(n);return e('[role="tab"][aria-selected="true"]')??e('.clover-sections-button[aria-expanded="true"]')??e(".clover-sections-button")}const Fv=typeof window>"u"?F:Ut;function Dv(t,e){const[n,o]=H();return Fv(()=>{const r=t.current;if(!r)return;const s=()=>{const a=r.clientWidth;if(!a)return;const c=parseFloat(getComputedStyle(document.documentElement).fontSize);o(a>=e*(c||16))};if(s(),typeof ResizeObserver>"u")return;const i=new ResizeObserver(s);return i.observe(r),()=>i.disconnect()},[t,e]),n}const ka=typeof window>"u"?F:Ut;function zv({id:t,beside:e,defaultOpen:n,side:o,focus:r=$v,slides:s=true,alongside:i,followFocus:a}){var J,M;const c=R(null),l=R(null),d=R(null),u=e===false,[p,h]=H(n),[m,g]=H(false),_=u?m:p,w=()=>document.querySelector(`button[aria-controls~="${t}"]`),S=()=>a(w),v=()=>{var T,O,U;(T=c.current)!=null&&T.contains(document.activeElement)&&((O=d.current)==null||O.removeAttribute("inert"),(U=w())==null||U.focus(),S())},y=R(0),x=T=>{y.current=u&&T?3:0,y.current||S(),u&&g(T),h(T)},k=()=>{v(),x(false)},N=R(e),D=R(false);if(N.current===true&&e===false){const T=document.activeElement;D.current=!!(T&&((J=c.current)!=null&&J.contains(T)||(M=w())!=null&&M.contains(T)))}ka(()=>{var T;D.current&&(D.current=false,(T=w())==null||T.focus(),S()),e===true&&g(false),N.current=e},[e]);const j=Bv(s&&u&&_),et=s&&u,V=et?j.mounted:_,nt=et?j.open:_,Y=u&&nt;return ka(()=>{const T=d.current;if(T)return Y?T.setAttribute("inert",""):T.removeAttribute("inert"),()=>T.removeAttribute("inert")},[Y]),F(()=>{if(!y.current||!c.current)return;y.current-=1;const T=r(c.current);T==null||T.focus({preventScroll:true}),T&&document.activeElement===T&&(y.current=0)}),Pv(c,{enabled:u&&nt,side:o,onClose:k,scrim:l,alongside:i,exits:!s}),{pane:c,main:d,over:u,open:_,shown:V,opened:nt,setOpen:x,close:k,onKeyDown:T=>{u&&_&&T.key==="Escape"&&!T.defaultPrevented&&(T.preventDefault(),k())},scrim:u&&V&&{ref:l,"data-open":nt,"aria-hidden":true,onMouseDown:T=>T.preventDefault(),onClick:k}}}const Hv=typeof window>"u"?F:Ut;function Wv(t,e,n){Hv(()=>{const o=t.current,r=o==null?void 0:o.parentElement;if(!n||!o||!r)return;const s=()=>{const c=e();o.style.setProperty("--clover-template-spine-top",`${c?c.getBoundingClientRect().top-r.getBoundingClientRect().top:0}px`)};s();const i=new ResizeObserver(s);for(const c of Array.from(r.children))i.observe(c);const a=e();return a&&i.observe(a),()=>i.disconnect()},[t,n])}const Uv=()=>import("./PanelPart-Z12fMdZh.mjs");function jv({id:t,beside:e,defaultOpen:n,side:o="end",followFocus:r,body:s,sections:i,panel:a}){const c=zv({id:t,beside:e,defaultOpen:n,side:o,followFocus:r}),l=!c.over&&c.open,d=R(null),[u,p]=H(),h=a??u,m=()=>Uv().then(w=>p(()=>w.default));F(()=>{c.open&&!h&&m()},[c.open]),Wv(d,()=>s==null?void 0:s(),l&&!!s);const g=w=>{var S,v;(v=(S=w.target).closest)!=null&&v.call(S,`[aria-controls~="${t}"]`)&&(h||m(),c.over&&Lv())},_=f(Vv,{sections:i,open:c.open,onOpenChange:w=>w&&!h?m().then(()=>c.setOpen(true)):c.setOpen(w),controls:t,side:o});return{...c,id:t,side:o,docked:l,spine:d,toggle:_,Part:h,splitProps:{"data-panel":c.over?"over":"beside",onKeyDown:c.onKeyDown,onPointerOver:g,onFocus:g}}}function Vv({sections:t,...e}){return Ts(t).length?f(Tv,{...e}):null}function qv({pane:t,className:e,...n}){const{id:o,over:r,docked:s,side:i,Part:a}=t,c=Ts(n.sections);if(!c.length)return null;const l=s&&f(Ct,{children:[f(Ev,{className:"clover-template-panel-handle","aria-controls":o}),f("div",{ref:t.spine,className:"clover-template-spine",children:t.toggle})]});return f(Ct,{children:[i==="end"&&l,f(Ml,{ref:t.pane,id:o,"data-spine":r||void 0,"data-side":i,name:"panel","data-about":c.includes("about")||void 0,className:["clover-template-panel clover-template-drawer",e].filter(Boolean).join(" "),size:"24rem",min:r?void 0:Nv,"data-open":t.opened,hidden:!t.shown,children:a&&f(a,{...n,onClose:r?t.close:void 0,closeOnEscape:r})}),i==="start"&&l,t.scrim&&f("div",{className:"clover-template-scrim",...t.scrim})]})}const Kv=30;function Zv(){const t=R(0);return F(()=>()=>cancelAnimationFrame(t.current),[]),e=>{cancelAnimationFrame(t.current);let n=0;const o=()=>{const r=e();r&&Gv()?r.focus():++n<Kv&&(t.current=requestAnimationFrame(o))};t.current=requestAnimationFrame(o)}}function Gv(){const t=document.activeElement;return!t||t===document.body||!t.isConnected||t.closest("[hidden], [inert]")!==null}function Xv({className:t,header:e=true,headingLevel:n=2,panel:o=true,defaultPanelOpen:r,panelLayout:s="accordion",panelSections:i,panelLabels:a,download:c=true,languages:l=true,interfaceLanguages:d=true,items:u="slider",singleItem:p=false,storageKey:h="clover-template-default",fill:m=false,collapseControls:g,canvasOptions:_,...w}){const S=R(null),v=pe().replace(/:/g,""),y=`${v}-panel`,x=al(n,`${v}-title`),k=jv({id:y,beside:Dv(S,Rv),defaultOpen:r??true,followFocus:Zv(),sections:i,body:()=>{var j;return(j=S.current)==null?void 0:j.querySelector(".clover-template-default-body")},panel:uv}),N=k.over,D=o&&k.docked;return f(gf,{className:["clover-template-default",t].filter(Boolean).join(" "),"data-fill":m||void 0,...e?x.group:null,...w,children:f(Cv,{ref:S,className:"clover-template-default-panes clover-template-panes",storageKey:h||void 0,...o?k.splitProps:{"data-panel":"beside"},children:[f(Ml,{ref:k.main,className:"clover-template-default-main",min:N?void 0:Ov,children:[e&&f("header",{className:"clover-template-default-header",children:[f(Yv,{title:x}),f(_o,{of:"targets",layout:"pager",size:"small",className:"clover-template-default-pager"}),f(vl,{className:"clover-template-default-provider",children:f(yl,{})})]}),f(fg,{loading:false}),f(Lm,{className:"clover-template-default-body",collapseControls:g,options:_,children:o&&!D&&k.toggle}),f("div",{className:"clover-template-default-rail",children:[f("div",{className:"clover-template-default-rail-header",children:[f(ty,{}),f(dg,{})]}),u&&f(_o,{layout:u,singleItem:p})]})]}),o&&f(qv,{pane:k,className:"clover-template-default-panel",layout:s,sections:i,labels:a,download:c,languages:l,interfaceLanguages:d,headingLevel:e?Qv(n):n})]})})}function Yv({title:t}){const e=st(o=>{var r;return o.throughCollection?(r=o.collection)==null?void 0:r.label:void 0}),n=pp();return Jv(n==null?void 0:n.entries[0]),f(Ct,{children:[f(sn,{as:t.as,className:"clover-template-default-title clover-template-title clover-title",...t.title}),e&&f("div",{className:"clover-template-default-collection-row",children:[f(sn,{as:"p",label:e,className:"clover-template-default-collection"}),f(_o,{of:"members",layout:"pager",size:"small",className:"clover-template-default-pager"})]}),n&&f("div",{className:"clover-template-default-collection-row",children:[n.label&&f(sn,{as:"p",label:n.label,className:"clover-template-default-collection"}),f(_o,{of:"annotations",layout:"pager",size:"small",className:"clover-template-default-pager"})]})]})}function Jv(t){const{clover:e}=ae(),n=st(r=>{var s;return(s=r.manifest)==null?void 0:s.id}),o=R(null);F(()=>{if(!t||!n||o.current===n)return;o.current=n;const{annotationId:r,canvasId:s}=e.store.get();!r&&s===t.canvasId&&e.selectAnnotation(t.id)},[e,t,n])}const Qv=t=>t+1;function ty(){const t=xs();return f("p",{className:"clover-template-default-titles",children:t.map((e,n)=>f(ue.Fragment,{children:[n>0&&f("span",{className:"clover-template-default-titles-dot","aria-hidden":"true",children:"\xB7"}),f(sn,{label:e.label})]},e.id))})}const ey=()=>import("./renderers-BsrSfP28.mjs"),ny=vt(()=>import("./Document-BldAeNoK.mjs").then(t=>({default:t.Document}))),oy=vt(()=>import("./Gallery-BR4uUPRO.mjs").then(t=>({default:t.Gallery}))),Ca={default:Xv,document:ny,gallery:oy},ry={header:["default"],panel:["default","gallery"],items:["default","gallery"],singleItem:["default","document"],fill:["default"],defaultPanelOpen:["default","document","gallery"],panelLayout:["default","document","gallery"],panelSections:["default","document","gallery"],panelLabels:["default","document","gallery"],download:["default","document","gallery"],languages:["default","document","gallery"],storageKey:["default","document","gallery"],defaultSidebarOpen:["document"],size:["gallery"],height:["gallery"],gap:["gallery"],secondary:["gallery"],summary:["gallery"],lightboxItems:["gallery"]};function sy({props:t}){const e=typeof t.template=="string"&&t.template in Ca?t.template:"default",n=Object.fromEntries(Object.entries(t).filter(([i])=>{var a;return i!=="template"&&(((a=ry[i])==null?void 0:a.includes(e))??true)})),o=on(ey,!!t.renderers),r=bt(()=>o==null?void 0:o.toRenderers(t.renderers),[o,t.renderers]);if(t.renderers&&!o)return null;n.renderers=r,typeof n.storageKey=="string"&&(n.storageKey=n.storageKey.trim().toLowerCase()==="false"?false:n.storageKey);const s=Ca[e];return f(St,{fallback:null,children:f(s,{...n,iiifContent:t.iiifContent})})}const iy=""+new URL("../assets/maplibre-gl-worker-kTz9OPxr.js",import.meta.url).href,ay={mapWorkerUrl:iy},cy={tag:"clover-viewer",kind:"alone",attributes:{template:{prop:"template",type:["default","document","gallery"]},"iiif-content":{prop:"iiifContent",type:"string"},"canvas-id":{prop:"defaultCanvasId",type:"string"},"manifest-id":{prop:"defaultManifestId",type:"string"},language:{prop:"language",type:"string"},"high-contrast":{prop:"highContrast",type:"boolean"},"search-query":{prop:"searchQuery",type:"string"},annotations:{prop:"annotations",type:"data"},"heading-level":{prop:"headingLevel",type:"number",min:2},items:{prop:"items",type:["slider","list","grid","masonry","false"]},"single-item":{prop:"singleItem",type:"boolean"},header:{prop:"header",type:"boolean"},panel:{prop:"panel",type:"boolean"},download:{prop:"download",type:"boolean"},languages:{prop:"languages",type:"boolean"},"interface-languages":{prop:"interfaceLanguages",type:"boolean"},"panel-open":{prop:"defaultPanelOpen",type:"boolean"},"panel-layout":{prop:"panelLayout",type:["accordion","tabs"]},"panel-sections":{prop:"panelSections",type:"data"},"panel-labels":{prop:"panelLabels",type:"data"},"sidebar-open":{prop:"defaultSidebarOpen",type:"boolean"},"storage-key":{prop:"storageKey",type:"string"},fill:{prop:"fill",type:"boolean"},"collapse-controls":{prop:"collapseControls",type:["auto","always"]},size:{prop:"size",type:"string"},height:{prop:"height",type:"string"},gap:{prop:"gap",type:"string"},secondary:{prop:"secondary",type:["summary","navDate","none"]},summary:{prop:"summary",type:"boolean"},"lightbox-items":{prop:"lightboxItems",type:["slider","pager"]}},properties:["iiifContent","annotations","request","renderers","canvasOptions"],events:{"clover-canvas-change":{prop:"onCanvasChange",detail:["canvasId"]},"clover-manifest-change":{prop:"onManifestChange",detail:["manifestId"]},"clover-status-change":{prop:"onStatusChange",detail:["status","error"]},"clover-content-state-change":{prop:"onContentStateChange",detail:"first"}}};Mv(ay.mapWorkerUrl);cu(cy,()=>Promise.resolve(sy));export{Cu as $,R as A,Lm as B,ee as C,Cv as D,Ml as E,_o as F,Ev as G,Ov as H,Cf as I,qv as J,Lv as K,sn as L,bu as M,st as N,pp as O,dg as P,wy as Q,gf as R,fg as S,bt as T,dp as U,St as V,vt as W,ba as X,he as Y,jt as Z,Ut as _,ae as a,Oc as a$,uv as a0,Qd as a1,ky as a2,ss as a3,ul as a4,dl as a5,Ln as a6,fl as a7,wd as a8,wt as a9,ue as aA,Wf as aB,Th as aC,Ec as aD,yc as aE,Eh as aF,Mh as aG,Vf as aH,Hc as aI,Wd as aJ,gs as aK,vp as aL,Qi as aM,If as aN,Lc as aO,te as aP,Rf as aQ,Ch as aR,Uf as aS,He as aT,bf as aU,Ph as aV,En as aW,Lf as aX,kf as aY,Pf as aZ,Af as a_,Ms as aa,dt as ab,Bt as ac,pc as ad,Fd as ae,Ve as af,Et as ag,Lo as ah,It as ai,ug as aj,ie as ak,lg as al,Co as am,Jr as an,Qr as ao,Nn as ap,Pp as aq,sa as ar,ra as as,Xc as at,xs as au,mp as av,ia as aw,is as ax,Eo as ay,W as az,Wu as b,po as b$,Nf as b0,Of as b1,_d as b2,wg as b3,xg as b4,cp as b5,_e as b6,Jg as b7,_y as b8,vy as b9,Id as bA,Vc as bB,lh as bC,uc as bD,un as bE,as as bF,or as bG,ef as bH,Ad as bI,Dn as bJ,Om as bK,Nm as bL,ns as bM,Lp as bN,Ne as bO,Rn as bP,Ty as bQ,ol as bR,Tt as bS,Cd as bT,Hd as bU,ch as bV,ds as bW,hl as bX,Ef as bY,nh as bZ,je as b_,dy as ba,hs as bb,My as bc,We as bd,Fc as be,wh as bf,Ng as bg,rc as bh,es as bi,Ey as bj,Cy as bk,Bd as bl,ls as bm,fy as bn,nr as bo,bs as bp,ko as bq,on as br,ip as bs,fc as bt,Io as bu,hn as bv,xc as bw,Av as bx,xl as by,Bi as bz,Kc as c,ks as c0,yy as c1,dh as c2,lr as c3,md as c4,kh as c5,cc as c6,kp as c7,Td as c8,dn as c9,Bn as ca,Rr as cb,Vi as cc,Tc as cd,hy as ce,py as cf,my as cg,Cp as ch,gm as ci,ea as cj,yp as ck,bp as cl,by as cm,fe as cn,se as co,gg as cp,pl as cq,gy as cr,ys as cs,Rm as ct,Ic as cu,eu as cv,Fm as cw,hp as d,H as e,pe as f,xy as g,Sy as h,Zv as i,zv as j,Ct as k,Dv as l,jv as m,Pu as n,Rv as o,qe as p,ut as q,Cs as r,$m as s,al as t,f as u,Ue as v,vl as w,le as x,F as y,yl as z};