@nulib/clover 4.5.6 → 4.5.7

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 (228) hide show
  1. package/dist/ui/useScrollTrack.mjs +1 -2
  2. package/dist/web-components/{About-C-o1MARK.mjs → About-VyQRiIMu.mjs} +1 -1
  3. package/dist/web-components/{AnnotationItems-BtX1-AkD.mjs → AnnotationItems-BlTIHa-e.mjs} +1 -1
  4. package/dist/web-components/{AnnotationMenu-eXo5QJ9p.mjs → AnnotationMenu-BwikEMPh.mjs} +1 -1
  5. package/dist/web-components/{AnnotationState-B4-vsjYK.mjs → AnnotationState-aXi45WGy.mjs} +1 -1
  6. package/dist/web-components/{Annotations-BMMp4TzW.mjs → Annotations-61qamybS.mjs} +1 -1
  7. package/dist/web-components/{Annotations-KJI1g3JX.mjs → Annotations-DBqyfHcF.mjs} +1 -1
  8. package/dist/web-components/{Body-Bx9aZhz_.mjs → Body-DNMPENDm.mjs} +1 -1
  9. package/dist/web-components/{BodyAlert-01XtjU91.mjs → BodyAlert-BiM1lAoB.mjs} +1 -1
  10. package/dist/web-components/{Button-DmqdooHe.mjs → Button-BLs5Picj.mjs} +1 -1
  11. package/dist/web-components/{Camera-ZgGejDUV.mjs → Camera-CUmqAh54.mjs} +1 -1
  12. package/dist/web-components/{Canvas2DBackend-B1YLZdY_.mjs → Canvas2DBackend-D5Mgo0QW.mjs} +1 -1
  13. package/dist/web-components/{CanvasView-BRtiqo9o.mjs → CanvasView-BfOvex16.mjs} +2 -2
  14. package/dist/web-components/{CaptionDetails-JtN_s8Vd.mjs → CaptionDetails-jNqdn9Mt.mjs} +1 -1
  15. package/dist/web-components/{ChaptersMenu-nW6su_V2.mjs → ChaptersMenu-CNgG4zwW.mjs} +1 -1
  16. package/dist/web-components/{Chevron-C6B1ERz3.mjs → Chevron-BdgGQvNa.mjs} +1 -1
  17. package/dist/web-components/{ChoiceMenu-Ep3PVmNU.mjs → ChoiceMenu-CvS8F3X_.mjs} +1 -1
  18. package/dist/web-components/{Collection-IHIeRtAZ.mjs → Collection-lzc7WD9g.mjs} +1 -1
  19. package/dist/web-components/{CollectionSelect-CFak4aY5.mjs → CollectionSelect-CzgYKMt5.mjs} +1 -1
  20. package/dist/web-components/{Connected-DBFLtGSX.mjs → Connected-B_5LeFpt.mjs} +1 -1
  21. package/dist/web-components/{Connected-CVQI5ppY.mjs → Connected-CdeTNEkW.mjs} +1 -1
  22. package/dist/web-components/{Connected-CNWHy7Nf.mjs → Connected-Dss8dX9u.mjs} +1 -1
  23. package/dist/web-components/{Contents-H1p0ziCX.mjs → Contents-CtyHkeUB.mjs} +1 -1
  24. package/dist/web-components/{ControlMenu-Dzc3r70f.mjs → ControlMenu-CaZbfh-v.mjs} +1 -1
  25. package/dist/web-components/ControlsFade-BrZ4_xJu.mjs +1 -0
  26. package/dist/web-components/{CountMenu-CVXxogQn.mjs → CountMenu-DzEKtcUs.mjs} +1 -1
  27. package/dist/web-components/Cue-DgSWaxt6.mjs +1 -0
  28. package/dist/web-components/{Document-Bq69tdp9.mjs → Document-D8BNUyN_.mjs} +1 -1
  29. package/dist/web-components/{DomLayers-BNFCWPIf.mjs → DomLayers-CyfXsLu_.mjs} +1 -1
  30. package/dist/web-components/{Download-8s_1j0hn.mjs → Download-CVW5MabM.mjs} +1 -1
  31. package/dist/web-components/{EntryBodies-CuH57Wdm.mjs → EntryBodies-DZpB82X3.mjs} +1 -1
  32. package/dist/web-components/{EntryThumbnail-BBn3c02-.mjs → EntryThumbnail-C9TitZhS.mjs} +1 -1
  33. package/dist/web-components/{FieldPill-CDDBQn83.mjs → FieldPill-DQQzm8hG.mjs} +1 -1
  34. package/dist/web-components/{FrameAnimation-OBaRI-rP.mjs → FrameAnimation-C1a4L8pR.mjs} +1 -1
  35. package/dist/web-components/{Gallery-BY4cH76P.mjs → Gallery-D8PPijA-.mjs} +1 -1
  36. package/dist/web-components/{GlobeGlyph-DgNI--BA.mjs → GlobeGlyph-CRfMG161.mjs} +1 -1
  37. package/dist/web-components/{HideToggle-CQcp5w_t.mjs → HideToggle-DAb6JxDB.mjs} +1 -1
  38. package/dist/web-components/{ImageControls-DREK-1SC.mjs → ImageControls-BYNIBF8X.mjs} +1 -1
  39. package/dist/web-components/{Items-eaCz7ufI.mjs → Items-DZ2rblNa.mjs} +1 -1
  40. package/dist/web-components/{Label-Cur5KZAJ.mjs → Label-BsqpZ2iR.mjs} +1 -1
  41. package/dist/web-components/{LanguageChoice-BWmkORxS.mjs → LanguageChoice-BAici6Li.mjs} +1 -1
  42. package/dist/web-components/{LanguageMenu-CW1_hI1x.mjs → LanguageMenu-BTvnQxFI.mjs} +1 -1
  43. package/dist/web-components/{LightboxView-Cd92FAYV.mjs → LightboxView-C-eD7J97.mjs} +1 -1
  44. package/dist/web-components/{ListEnd-CefIIerg.mjs → ListEnd-C-Ml1EYs.mjs} +1 -1
  45. package/dist/web-components/{Loaded-DtzpCxju.mjs → Loaded-B8vl-G-V.mjs} +1 -1
  46. package/dist/web-components/{LoadedCanvas-CUrQv2k_.mjs → LoadedCanvas-DGqbVGS7.mjs} +1 -1
  47. package/dist/web-components/LoadedMap-C-0BE0wY.mjs +1 -0
  48. package/dist/web-components/{Loading-DhTFaFBg.mjs → Loading-UuKuHE79.mjs} +1 -1
  49. package/dist/web-components/{Map-eb1aK0Z9.mjs → Map-CT5D-pfb.mjs} +1 -1
  50. package/dist/web-components/{MapView-3j8gkLYi.mjs → MapView-Bsg_Olm7.mjs} +2 -2
  51. package/dist/web-components/{Markup-Dy6leTBV.mjs → Markup-CeeOSehy.mjs} +1 -1
  52. package/dist/web-components/{MediaBody-Dg0-LWYL.mjs → MediaBody-Q6rhew4q.mjs} +1 -1
  53. package/dist/web-components/{MediaBody-DMrJQG34.mjs → MediaBody-fQE-A-yD.mjs} +1 -1
  54. package/dist/web-components/{NavDate-Ck30M1Ve.mjs → NavDate-DdU75wtq.mjs} +1 -1
  55. package/dist/web-components/{Navigator-B9rs7wKo.mjs → Navigator-D8S66GNd.mjs} +1 -1
  56. package/dist/web-components/{Pager-BV2GC__-.mjs → Pager-B0QqGXp3.mjs} +1 -1
  57. package/dist/web-components/{PagerLayout-Cd08Alpt.mjs → PagerLayout-s15H568t.mjs} +1 -1
  58. package/dist/web-components/{Panel-DR6ycHyX.mjs → Panel-ByrpMdLY.mjs} +1 -1
  59. package/dist/web-components/PanelPart-3w0sWqmU.mjs +1 -0
  60. package/dist/web-components/{PanelToggle-gAffLvlc.mjs → PanelToggle-B1QENm1I.mjs} +1 -1
  61. package/dist/web-components/{PartOfManifest-nziNto_q.mjs → PartOfManifest-CUOEJX-B.mjs} +1 -1
  62. package/dist/web-components/{Pending-D1rYOP_R.mjs → Pending-DYgjpYcj.mjs} +1 -1
  63. package/dist/web-components/{PlaceBox-C2JMFQV0.mjs → PlaceBox-Bqr3fEt1.mjs} +1 -1
  64. package/dist/web-components/{Placeholder-BDMLULRp.mjs → Placeholder-DGPTR3uA.mjs} +1 -1
  65. package/dist/web-components/{Position-IRJVIQdA.mjs → Position-D8fef2x7.mjs} +1 -1
  66. package/dist/web-components/{Primitives-DqRNtE60.mjs → Primitives-DuP39vJE.mjs} +1 -1
  67. package/dist/web-components/{Provider-DPSj538n.mjs → Provider-DIANDsur.mjs} +1 -1
  68. package/dist/web-components/{ReadMore-B2DB6MuP.mjs → ReadMore-R-glAXeL.mjs} +1 -1
  69. package/dist/web-components/{Root-DCA1d0D7.mjs → Root-ChyZ9HKB.mjs} +1 -1
  70. package/dist/web-components/Scene-CUydm2WU.mjs +1 -0
  71. package/dist/web-components/{SceneView-YtkAJ2zP.mjs → SceneView-BOE20DQY.mjs} +1 -1
  72. package/dist/web-components/{Search-FWPa5UNO.mjs → Search-B2H5S0R-.mjs} +1 -1
  73. package/dist/web-components/{Sections-73lsQFnt.mjs → Sections-d0uuX5tK.mjs} +1 -1
  74. package/dist/web-components/{SeekMarks-DLT93mL0.mjs → SeekMarks-TGu3Bbws.mjs} +1 -1
  75. package/dist/web-components/{StandaloneItems-5d_3l6hK.mjs → StandaloneItems-vJqJhY6P.mjs} +1 -1
  76. package/dist/web-components/{Status-6tfWoLV_.mjs → Status-DCVccIz7.mjs} +1 -1
  77. package/dist/web-components/{Steps-DINk164Y.mjs → Steps-VCHVkAOu.mjs} +1 -1
  78. package/dist/web-components/{TargetItems-CouPOIsE.mjs → TargetItems-krRcBfvc.mjs} +1 -1
  79. package/dist/web-components/Timeline-9S5GW0HA.mjs +1 -0
  80. package/dist/web-components/{Tip-CmrY2ZoP.mjs → Tip-B0TpGspf.mjs} +1 -1
  81. package/dist/web-components/{Transcript-D-J5T_7K.mjs → Transcript-DdoG3nZQ.mjs} +1 -1
  82. package/dist/web-components/{Transport-Cy7wwjA5.mjs → Transport-BW0laFuy.mjs} +1 -1
  83. package/dist/web-components/{Transport-BBGTe9TR.mjs → Transport-DixOWHie.mjs} +1 -1
  84. package/dist/web-components/{annotation-collection-OX2RwxfU.mjs → annotation-collection-B7P4xVWB.mjs} +1 -1
  85. package/dist/web-components/{annotation-name-Cqw8uzpW.mjs → annotation-name-BEuD2SqF.mjs} +1 -1
  86. package/dist/web-components/{annotations-content-D8U3ZjMP.mjs → annotations-content-BiEkS0ze.mjs} +1 -1
  87. package/dist/web-components/{body-B7mRbGgu.mjs → body-VhEQIZz1.mjs} +1 -1
  88. package/dist/web-components/{canvas-BNnp_JHf.mjs → canvas-BANXin9O.mjs} +1 -1
  89. package/dist/web-components/{cloverEngine-9q7PRtb-.mjs → cloverEngine-pxuhoj7w.mjs} +1 -1
  90. package/dist/web-components/{content-state-reader-DKXoVOui.mjs → content-state-reader-DVti_UNh.mjs} +1 -1
  91. package/dist/web-components/{controlGlyphs-Bsm42pMw.mjs → controlGlyphs-DkQh1wkH.mjs} +1 -1
  92. package/dist/web-components/{controls-DO27swab.mjs → controls-DG9o_1Ms.mjs} +1 -1
  93. package/dist/web-components/{downloads-BTKk4gk-.mjs → downloads-Ct1IVm1N.mjs} +1 -1
  94. package/dist/web-components/{dragToClose-Dno8cLqV.mjs → dragToClose-B2D5gjIv.mjs} +1 -1
  95. package/dist/web-components/{engine-yxhv49UX.mjs → engine-DheXoWuS.mjs} +1 -1
  96. package/dist/web-components/{engines-BT170pvZ.mjs → engines-D3Nl9FJa.mjs} +1 -1
  97. package/dist/web-components/{fetchManifest-CV61siyX.mjs → fetchManifest-CZUkPEJT.mjs} +1 -1
  98. package/dist/web-components/{follow-content-1bNP_6Yi.mjs → follow-content-DV7lsgAv.mjs} +1 -1
  99. package/dist/web-components/{fromManifest-ypX5N9bQ.mjs → fromManifest-CaESsRH1.mjs} +1 -1
  100. package/dist/web-components/{glyphs-1YNgPYCb.mjs → glyphs-_fryeQK1.mjs} +1 -1
  101. package/dist/web-components/{hooks-Bj5sYuBM.mjs → hooks-2wlZJ5Vj.mjs} +1 -1
  102. package/dist/web-components/{image-layers-CdogbVZE.mjs → image-layers-BMG1Vq4O.mjs} +1 -1
  103. package/dist/web-components/{image-service-content-j8IL6mb0.mjs → image-service-content-BHIDyYR5.mjs} +1 -1
  104. package/dist/web-components/{imageService-D4p3HE1q.mjs → imageService-Dr2yUnHN.mjs} +1 -1
  105. package/dist/web-components/{index-D13DzX3i.mjs → index-B2-GJaXD.mjs} +1 -1
  106. package/dist/web-components/index.mjs +1 -1
  107. package/dist/web-components/items-BCo1O5UF.mjs +1 -0
  108. package/dist/web-components/{items-XHM03spJ.mjs → items-DIK2DCYN.mjs} +1 -1
  109. package/dist/web-components/label-nN3wAmWa.mjs +1 -0
  110. package/dist/web-components/{layout-D6H3uuwu.mjs → layout-zLeHeNSF.mjs} +1 -1
  111. package/dist/web-components/{link-D9hsGxQp.mjs → link-gSAPkIaj.mjs} +1 -1
  112. package/dist/web-components/logo-C_MdkvAQ.mjs +1 -0
  113. package/dist/web-components/{models-DaDtM_UM.mjs → models-Cl3PryAF.mjs} +1 -1
  114. package/dist/web-components/{nodes-B-e9mbx0.mjs → nodes-DxdzLXSF.mjs} +1 -1
  115. package/dist/web-components/{overlayImage-CSW7jSWt.mjs → overlayImage-mqkzG-e1.mjs} +1 -1
  116. package/dist/web-components/{panel-C5jcVkr6.mjs → panel-zafZqMud.mjs} +1 -1
  117. package/dist/web-components/part-Cybq62qY.mjs +1 -0
  118. package/dist/web-components/{playerSurface-pHccePJd.mjs → playerSurface-BEZ_dDs6.mjs} +1 -1
  119. package/dist/web-components/{pointer-rqjpl5E4.mjs → pointer-RBOOjlWj.mjs} +1 -1
  120. package/dist/web-components/{provider-B9QvZ_Y9.mjs → provider-L0fhpZmV.mjs} +1 -1
  121. package/dist/web-components/{range-regions-BQ8bqNTs.mjs → range-regions-T_73-NWY.mjs} +1 -1
  122. package/dist/web-components/{read-more-BT_3kkHZ.mjs → read-more-CU3jFqSi.mjs} +1 -1
  123. package/dist/web-components/{readingLanguages-B_k-QfX6.mjs → readingLanguages-DZsqrAWq.mjs} +1 -1
  124. package/dist/web-components/{rendererSurface-CLbNE-t_.mjs → rendererSurface-FBwf4yii.mjs} +2 -2
  125. package/dist/web-components/{renderers-DHgTVdtM.mjs → renderers-DCZW9zLC.mjs} +1 -1
  126. package/dist/web-components/{resource-xQiWQSb9.mjs → resource-C2zc8K9v.mjs} +1 -1
  127. package/dist/web-components/{save-file-Dp3LOhHi.mjs → save-file-Dp4Yp3CX.mjs} +1 -1
  128. package/dist/web-components/{search-DRZzJ0qo.mjs → search-96l87qSf.mjs} +1 -1
  129. package/dist/web-components/{shared-BTZk52xk.mjs → shared-9sToDP5G.mjs} +1 -1
  130. package/dist/web-components/{show-link-CljTxYbA.mjs → show-link-23miLn_l.mjs} +1 -1
  131. package/dist/web-components/{sizedImage-Cv3QSASL.mjs → sizedImage-B_ze_WS6.mjs} +1 -1
  132. package/dist/web-components/{split-CrTZjLVF.mjs → split-CkWbkgmc.mjs} +1 -1
  133. package/dist/web-components/{status-DCmJGFlF.mjs → status-DZj0V4nZ.mjs} +1 -1
  134. package/dist/web-components/{styles-BdBFz9SS.mjs → styles-Di6TZHyP.mjs} +1 -1
  135. package/dist/web-components/three.mjs +1 -1
  136. package/dist/web-components/{thumbnail-BezXZOSj.mjs → thumbnail-22tHjWEh.mjs} +1 -1
  137. package/dist/web-components/{tip-3wRL05_i.mjs → tip-Skhs56Gk.mjs} +1 -1
  138. package/dist/web-components/{toggle-CyRtVTRf.mjs → toggle-DatEYCUk.mjs} +1 -1
  139. package/dist/web-components/{useContainerName-Dcg9-lIU.mjs → useContainerName-B2qSONvC.mjs} +1 -1
  140. package/dist/web-components/{useControlsVisibility-DJGzcs6D.mjs → useControlsVisibility-DYj5p1m8.mjs} +1 -1
  141. package/dist/web-components/{useNearViewport-C8lmKYws.mjs → useNearViewport-CeEAjxcM.mjs} +1 -1
  142. package/dist/web-components/useScrollTrack-SUztbI1C.mjs +1 -0
  143. package/dist/web-components/viewer/{AnnotationItems-DJVaxdsI.mjs → AnnotationItems-CUVQu0sj.mjs} +1 -1
  144. package/dist/web-components/viewer/{AnnotationMenu-C0d0lTcC.mjs → AnnotationMenu-DUywRsH9.mjs} +1 -1
  145. package/dist/web-components/viewer/{AnnotationState-B4T0TkvH.mjs → AnnotationState-Rp1bRCk0.mjs} +1 -1
  146. package/dist/web-components/viewer/{Annotations-CcvLU7jz.mjs → Annotations-C-XbGzkf.mjs} +1 -1
  147. package/dist/web-components/viewer/{Annotations-WWqn_FbM.mjs → Annotations-D6XBVx_r.mjs} +1 -1
  148. package/dist/web-components/viewer/{Canvas2DBackend-B5QR4dhT.mjs → Canvas2DBackend-DfeyF4Sn.mjs} +1 -1
  149. package/dist/web-components/viewer/{CaptionDetails-B_fCdkw6.mjs → CaptionDetails-Dm9OED9q.mjs} +1 -1
  150. package/dist/web-components/viewer/{ChaptersMenu-BB97eRTx.mjs → ChaptersMenu-CbUWVDlA.mjs} +1 -1
  151. package/dist/web-components/viewer/{ChoiceMenu-BtDTvEbQ.mjs → ChoiceMenu-Dg3CMJC3.mjs} +1 -1
  152. package/dist/web-components/viewer/{Collection-Bz89v2FT.mjs → Collection-GlPUR_Wq.mjs} +1 -1
  153. package/dist/web-components/viewer/{Connected-Dt8bLgZK.mjs → Connected-D73s7-vD.mjs} +1 -1
  154. package/dist/web-components/viewer/{Connected-CjKNxIxy.mjs → Connected-D_hC2NKq.mjs} +1 -1
  155. package/dist/web-components/viewer/{Contents-jBpCiUSe.mjs → Contents-DZDz1id8.mjs} +1 -1
  156. package/dist/web-components/viewer/{ControlMenu-l4F81Jg8.mjs → ControlMenu-IKgzjoAC.mjs} +1 -1
  157. package/dist/web-components/viewer/ControlsFade-N_UBYfTb.mjs +1 -0
  158. package/dist/web-components/viewer/{CountMenu-DU_EJGFs.mjs → CountMenu-CF-yZuq6.mjs} +1 -1
  159. package/dist/web-components/viewer/{Cue-D4-as926.mjs → Cue-CQXpS1cD.mjs} +1 -1
  160. package/dist/web-components/viewer/{Document-BldAeNoK.mjs → Document-C5bJQXa7.mjs} +1 -1
  161. package/dist/web-components/viewer/{DomLayers-Bo7DQUIZ.mjs → DomLayers-DM-5MV__.mjs} +1 -1
  162. package/dist/web-components/viewer/{Download-HDlM1brf.mjs → Download-BcWqJ6gp.mjs} +1 -1
  163. package/dist/web-components/viewer/{EntryBodies-k9Kf71ll.mjs → EntryBodies-CtnEnRhl.mjs} +1 -1
  164. package/dist/web-components/viewer/{EntryThumbnail-DEXlu64w.mjs → EntryThumbnail-CI6XobsH.mjs} +1 -1
  165. package/dist/web-components/viewer/{FieldPill-BTuiYb55.mjs → FieldPill-DpVrScl7.mjs} +1 -1
  166. package/dist/web-components/viewer/{FrameAnimation-DXJvvX_O.mjs → FrameAnimation-B8lgrSfp.mjs} +1 -1
  167. package/dist/web-components/viewer/{Gallery-BR4uUPRO.mjs → Gallery-BQnLyWZI.mjs} +1 -1
  168. package/dist/web-components/viewer/{GlobeGlyph-BFChlnAW.mjs → GlobeGlyph-5YeAnzZS.mjs} +1 -1
  169. package/dist/web-components/viewer/{HideToggle-Cl2mlgJh.mjs → HideToggle-C8FqKQpl.mjs} +1 -1
  170. package/dist/web-components/viewer/{ImageControls-rNkvWCA9.mjs → ImageControls-C2TSU7YV.mjs} +1 -1
  171. package/dist/web-components/viewer/{LanguageChoice-Bel5VdoV.mjs → LanguageChoice-CMRKNT1s.mjs} +1 -1
  172. package/dist/web-components/viewer/{LanguageMenu-Bj0g79QR.mjs → LanguageMenu-DDysz3dn.mjs} +1 -1
  173. package/dist/web-components/viewer/{LightboxView-DO8edg2H.mjs → LightboxView-CMhIYI9F.mjs} +1 -1
  174. package/dist/web-components/viewer/{ListEnd-D63rV7LR.mjs → ListEnd-7_wAsufl.mjs} +1 -1
  175. package/dist/web-components/viewer/{MapView-ahuj5gKJ.mjs → MapView-CTJeP19U.mjs} +2 -2
  176. package/dist/web-components/viewer/{MediaBody-DhSdnEui.mjs → MediaBody-D7gFPWmU.mjs} +1 -1
  177. package/dist/web-components/viewer/{NavDate-C5fftA6E.mjs → NavDate-B6GJyAZz.mjs} +1 -1
  178. package/dist/web-components/viewer/{Navigator-BVkHzfLs.mjs → Navigator-BP2BG8Za.mjs} +1 -1
  179. package/dist/web-components/viewer/{PagerLayout-CKN0Llkn.mjs → PagerLayout-D_lbzpje.mjs} +1 -1
  180. package/dist/web-components/viewer/PanelPart-BOXT_SZv.mjs +1 -0
  181. package/dist/web-components/viewer/{PartOfManifest-Brc4z7df.mjs → PartOfManifest-B1m_edb8.mjs} +1 -1
  182. package/dist/web-components/viewer/{PlaceBox-ByWy7e9J.mjs → PlaceBox-CIX6eZX1.mjs} +1 -1
  183. package/dist/web-components/viewer/{Placeholder-CmKEgeqP.mjs → Placeholder-CqJ2MsHM.mjs} +1 -1
  184. package/dist/web-components/viewer/{Search-COUo-BuO.mjs → Search-DPmrOEIr.mjs} +1 -1
  185. package/dist/web-components/viewer/{SeekMarks-BWHqY1g-.mjs → SeekMarks-DXU1o9YQ.mjs} +1 -1
  186. package/dist/web-components/viewer/{StandaloneItems-87W1Mih3.mjs → StandaloneItems-iRdk8VYf.mjs} +1 -1
  187. package/dist/web-components/viewer/{Steps-CUzjymlQ.mjs → Steps-CuNUFA3I.mjs} +1 -1
  188. package/dist/web-components/viewer/{TargetItems-Bms6M3cB.mjs → TargetItems-QBE9CxwV.mjs} +1 -1
  189. package/dist/web-components/viewer/{Transcript-DigEuuAR.mjs → Transcript-DlptB46U.mjs} +1 -1
  190. package/dist/web-components/viewer/{Transport-DFpiEGiY.mjs → Transport-C9EFEDJu.mjs} +1 -1
  191. package/dist/web-components/viewer/{Transport-BZcrgDpa.mjs → Transport-iHzfi7uP.mjs} +1 -1
  192. package/dist/web-components/viewer/{annotation-collection-JyxEZk8B.mjs → annotation-collection-DTVrE-QZ.mjs} +1 -1
  193. package/dist/web-components/viewer/{annotation-name-BJTap0Us.mjs → annotation-name-DKTofYnE.mjs} +1 -1
  194. package/dist/web-components/viewer/{annotations-content-yT8J4zoX.mjs → annotations-content-BlwlbeVP.mjs} +1 -1
  195. package/dist/web-components/viewer/{cloverEngine-DZDKElxt.mjs → cloverEngine-Dlh-z8EL.mjs} +1 -1
  196. package/dist/web-components/viewer/{content-state-reader-RmqJu8gE.mjs → content-state-reader-CnnpSFlK.mjs} +1 -1
  197. package/dist/web-components/viewer/{dragToClose-C995dPad.mjs → dragToClose-CzrwaZo1.mjs} +1 -1
  198. package/dist/web-components/viewer/{fetchManifest-CS577eE5.mjs → fetchManifest-BhVzHzo2.mjs} +1 -1
  199. package/dist/web-components/viewer/{follow-content-DLMLz7-u.mjs → follow-content-BH2iMwBp.mjs} +1 -1
  200. package/dist/web-components/viewer/{host-C79mYkpB.mjs → host-B2sqIwnE.mjs} +1 -1
  201. package/dist/web-components/viewer/{image-layers-zMvi4pmw.mjs → image-layers-Cd8Puz_E.mjs} +1 -1
  202. package/dist/web-components/viewer/{image-service-content-CjRd-2iP.mjs → image-service-content-CJo34Kw3.mjs} +1 -1
  203. package/dist/web-components/viewer/index.mjs +1 -1
  204. package/dist/web-components/viewer/{link-DaJErMnE.mjs → link-Bf7oTjh2.mjs} +1 -1
  205. package/dist/web-components/viewer/{overlayImage-DCBpb4lw.mjs → overlayImage-D6ckInbH.mjs} +1 -1
  206. package/dist/web-components/viewer/{range-regions-BY9UB0kS.mjs → range-regions-CfXsCFU1.mjs} +1 -1
  207. package/dist/web-components/viewer/{renderers-BsrSfP28.mjs → renderers-C1iEbiXw.mjs} +1 -1
  208. package/dist/web-components/viewer/{save-file-CwXaCAyi.mjs → save-file-C6SVTxwd.mjs} +1 -1
  209. package/dist/web-components/viewer/{search-CmWgigDq.mjs → search-B6_Ctp53.mjs} +1 -1
  210. package/dist/web-components/viewer/{useControlsVisibility-DbCeSjAK.mjs → useControlsVisibility-D-TA6qZW.mjs} +1 -1
  211. package/dist/web-components/viewer/{viewer-Ds1v3IFN.mjs → viewer-DAIgpvoG.mjs} +5 -5
  212. package/dist/web-components/viewer/{vtt-CkDv-L8Y.mjs → vtt-fmAkEE-g.mjs} +1 -1
  213. package/dist/web-components/{viewer-B2HVSNC2.mjs → viewer-BYyFRkAV.mjs} +1 -1
  214. package/dist/web-components/{vtt-CylghmBS.mjs → vtt-CJkd32sA.mjs} +1 -1
  215. package/package.json +1 -1
  216. package/dist/web-components/ControlsFade-COi8-AZI.mjs +0 -1
  217. package/dist/web-components/Cue-CQFnHV1R.mjs +0 -1
  218. package/dist/web-components/LoadedMap-BVkNlBeH.mjs +0 -1
  219. package/dist/web-components/PanelPart-BJwA1Z3f.mjs +0 -1
  220. package/dist/web-components/Scene-CS2xqRNL.mjs +0 -1
  221. package/dist/web-components/Timeline-j4BWRpk4.mjs +0 -1
  222. package/dist/web-components/items-CLwd-kOq.mjs +0 -1
  223. package/dist/web-components/label-DOqlHvhq.mjs +0 -1
  224. package/dist/web-components/logo-DpAvbwvh.mjs +0 -1
  225. package/dist/web-components/part-Du5hBwFZ.mjs +0 -1
  226. package/dist/web-components/useScrollTrack-D6TRdz7f.mjs +0 -1
  227. package/dist/web-components/viewer/ControlsFade-BPFSCV0a.mjs +0 -1
  228. package/dist/web-components/viewer/PanelPart-Z12fMdZh.mjs +0 -1
@@ -1,4 +1,4 @@
1
- var Et=Object.defineProperty;var kt=(n,t,e)=>t in n?Et(n,t,{enumerable:true,configurable:true,writable:true,value:e}):n[t]=e;var h=(n,t,e)=>kt(n,typeof t!="symbol"?t+"":t,e);import{c as Lt,r as $}from"./contexts-ByL3eA_T.mjs";import{c as k,s as L,t as _,a as _t,u as mt,i as Pt,b as pt,d as gt,e as It,r as At,f as A,g as St}from"./CanvasView-BRtiqo9o.mjs";import{a as S,w as Rt,v as N,f as Bt,s as Q,b as j,c as Ot}from"./Camera-ZgGejDUV.mjs";import{i as J,a as Ct,T as zt,b as tt,c as et,D as Ut,s as Dt}from"./pointer-rqjpl5E4.mjs";import{a3 as Wt,a4 as Ft}from"./shared-BTZk52xk.mjs";import{a as Ht,i as it,f as Nt}from"./imageService-D4p3HE1q.mjs";function Zt(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement?n.complete&&n.naturalWidth>0:true}function Gt(n,t){if(!n.bleed)return{x:0,y:0};const e=n.transform,i=Math.hypot(e.a,e.b)*t,s=Math.hypot(e.c,e.d)*t;return{x:n.bleed.right&&i>0?1/i:0,y:n.bleed.bottom&&s>0?1/s:0}}const Xt=`#version 300 es
1
+ var Et=Object.defineProperty;var kt=(n,t,e)=>t in n?Et(n,t,{enumerable:true,configurable:true,writable:true,value:e}):n[t]=e;var h=(n,t,e)=>kt(n,typeof t!="symbol"?t+"":t,e);import{c as Lt,r as $}from"./contexts-ByL3eA_T.mjs";import{c as k,s as L,t as _,a as _t,u as mt,i as Pt,b as pt,d as gt,e as It,r as At,f as A,g as St}from"./CanvasView-BfOvex16.mjs";import{a as S,w as Rt,v as N,f as Bt,s as Q,b as j,c as Ot}from"./Camera-CUmqAh54.mjs";import{i as J,a as Ct,T as zt,b as tt,c as et,D as Ut,s as Dt}from"./pointer-RBOOjlWj.mjs";import{a3 as Wt,a4 as Ft}from"./shared-9sToDP5G.mjs";import{a as Ht,i as it,f as Nt}from"./imageService-Dr2yUnHN.mjs";function Zt(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement?n.complete&&n.naturalWidth>0:true}function Gt(n,t){if(!n.bleed)return{x:0,y:0};const e=n.transform,i=Math.hypot(e.a,e.b)*t,s=Math.hypot(e.c,e.d)*t;return{x:n.bleed.right&&i>0?1/i:0,y:n.bleed.bottom&&s>0?1/s:0}}const Xt=`#version 300 es
2
2
  in vec2 a_position;
3
3
  uniform mat3 u_matrix;
4
4
  uniform vec4 u_crop;
@@ -19,4 +19,4 @@ out vec4 outColor;
19
19
  void main() {
20
20
  outColor = texture(u_texture, v_uv) * u_opacity;
21
21
  }
22
- `;class R{constructor(t,e,i){h(this,"kind","webgl2");h(this,"canvas");h(this,"maxTextureSize");h(this,"gl");h(this,"program",null);h(this,"vao",null);h(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});h(this,"textures",new Map);h(this,"cssWidth",1);h(this,"cssHeight",1);h(this,"pixelRatio",1);h(this,"matrixScratch",new Float32Array(9));h(this,"isLost",false);h(this,"callbacks");h(this,"handleLost",()=>{var t2,e2;this.isLost=true,this.textures.clear(),(e2=(t2=this.callbacks).onLost)==null||e2.call(t2)});this.canvas=t,this.gl=e,this.callbacks=i,this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)||4096;const s=Vt(e,Xt,Kt);this.program=s,this.uniforms={matrix:e.getUniformLocation(s,"u_matrix"),crop:e.getUniformLocation(s,"u_crop"),opacity:e.getUniformLocation(s,"u_opacity"),texture:e.getUniformLocation(s,"u_texture")};const o=e.createVertexArray();e.bindVertexArray(o);const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),e.STATIC_DRAW);const a=e.getAttribLocation(s,"a_position");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,false,0,0),e.bindVertexArray(null),this.vao=o,e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),t.addEventListener("webglcontextlost",this.handleLost)}static create(t,e={}){let i=null;try{i=t.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{i=null}if(!i||typeof i.createShader!="function")return null;try{return new R(t,i,e)}catch{return null}}resize(t,e,i){this.cssWidth=Math.max(1,t),this.cssHeight=Math.max(1,e),this.pixelRatio=i;const s=Math.max(1,Math.round(t*i)),o=Math.max(1,Math.round(e*i));this.canvas.width!==s&&(this.canvas.width=s),this.canvas.height!==o&&(this.canvas.height=o)}begin(){if(this.isLost)return;const t=this.gl;t.viewport(0,0,this.canvas.width,this.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(this.program),t.bindVertexArray(this.vao),t.activeTexture(t.TEXTURE0),t.uniform1i(this.uniforms.texture,0)}draw(t){if(this.isLost||!Zt(t.source))return"skipped";const e=this.gl,i=this.upload(t);if(i==="tainted")return"tainted";if(!i)return"skipped";const s=t.crop??{x:0,y:0,width:t.width,height:t.height},o=Gt(t,this.pixelRatio),r=k(t.transform,_(s.x,s.y),L(s.width+o.x,s.height+o.y));return e.uniformMatrix3fv(this.uniforms.matrix,false,_t(r,this.cssWidth,this.cssHeight,this.matrixScratch)),e.uniform4f(this.uniforms.crop,s.x/t.width,s.y/t.height,s.width/t.width,s.height/t.height),e.uniform1f(this.uniforms.opacity,t.opacity),e.bindTexture(e.TEXTURE_2D,i.texture),e.drawArrays(e.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(t){return!this.isLost&&this.textures.has(t)}release(t){const e=this.textures.get(t);e&&(this.isLost||this.gl.deleteTexture(e.texture),this.textures.delete(t))}dispose(){var t;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const e of[...this.textures.keys()])this.release(e);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(t=this.gl.getExtension("WEBGL_lose_context"))==null||t.loseContext(),this.isLost=true}upload(t){const e=this.gl,i=this.textures.get(t.key);if(i&&i.width===t.width&&i.height===t.height)return i;const s=(i==null?void 0:i.texture)??e.createTexture();if(!s)return null;e.bindTexture(e.TEXTURE_2D,s);try{e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source)}catch(r){if(i||e.deleteTexture(s),qt(r))return"tainted";throw r}e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const o={texture:s,width:t.width,height:t.height};return this.textures.set(t.key,o),o}}function Vt(n,t,e){const i=st(n,n.VERTEX_SHADER,t),s=st(n,n.FRAGMENT_SHADER,e),o=n.createProgram();if(!o)throw new Error("Could not create WebGL program");if(n.attachShader(o,i),n.attachShader(o,s),n.linkProgram(o),n.deleteShader(i),n.deleteShader(s),!n.getProgramParameter(o,n.LINK_STATUS)){const r=n.getProgramInfoLog(o);throw n.deleteProgram(o),new Error(`Could not link WebGL program: ${r}`)}return o}function st(n,t,e){const i=n.createShader(t);if(!i)throw new Error("Could not create WebGL shader");if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){const s=n.getShaderInfoLog(i);throw n.deleteShader(i),new Error(`Could not compile WebGL shader: ${s}`)}return i}function qt(n){return typeof n=="object"&&n!==null&&n.name==="SecurityError"}const Yt=.09,$t=1e-4,nt=.05,Qt=1e-4;class jt{constructor(t,e=Yt,i){h(this,"current");h(this,"target",null);h(this,"timeConstant");h(this,"spring");h(this,"start");h(this,"elapsed",0);this.current={...t},this.start={...t},this.timeConstant=e,this.spring=i}get destination(){return this.target?{...this.target.state}:{...this.current}}set(t){this.current={...t},this.target=null}animateTo(t,e,i=false){const s=this.spring?this.spring.duration<=0:this.timeConstant===0;if(i||s){this.set(t.state);return}let o=t.anchor;if(o){const r=S(o.world,o.screen,t.state.zoom,t.state.rotation,e);Math.hypot(r.x-t.state.x,r.y-t.state.y)*t.state.zoom>nt&&(o=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...t.state},anchor:o}}stop(){this.target=null}step(t,e){const i=this.target;if(!i)return false;const s=i.state;let o,r;if(this.spring){this.elapsed+=Math.max(t,0);const m=this.elapsed/this.spring.duration;if(m>=1)return this.current={...s},this.target=null,false;const c=this.spring.stiffness;o=this.start,r=(1-Math.exp(-c*m))/(1-Math.exp(-c))}else o=this.current,r=1-Math.exp(-Math.max(t,0)/this.timeConstant);const a=Math.exp(Math.log(o.zoom)+(Math.log(s.zoom)-Math.log(o.zoom))*r),d=o.rotation+(s.rotation-o.rotation)*r,l=i.anchor?S(i.anchor.world,i.anchor.screen,a,d,e):{x:o.x+(s.x-o.x)*r,y:o.y+(s.y-o.y)*r};return this.current={x:l.x,y:l.y,zoom:a,rotation:d},this.spring?true:Math.abs(Math.log(s.zoom/a))<$t&&Math.abs(s.rotation-d)<Qt&&Math.hypot(s.x-l.x,s.y-l.y)*a<nt?(this.current={...s},this.target=null,false):true}}const Z={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},z=2,ot=1.5,rt=.1,Jt=100,te=.002,ee=.01;class ie{constructor(t,e,i=Z){h(this,"pointers",new Map);h(this,"samples",[]);h(this,"down",null);h(this,"pinch",null);h(this,"lastTap",null);h(this,"lastPointerType","");h(this,"penHovers",false);h(this,"onPointerDown",t2=>{var i2,s;if(this.lastPointerType=t2.pointerType,t2.pointerType==="mouse"&&t2.button!==0||J(t2.target,this.element))return;(s=(i2=this.element).setPointerCapture)==null||s.call(i2,t2.pointerId);const e2=this.local(t2);this.pointers.set(t2.pointerId,e2),this.pointers.size===1?(this.down={x:e2.x,y:e2.y,t:t2.timeStamp,moved:false},this.samples=[{x:e2.x,y:e2.y,t:t2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});h(this,"onPointerMove",t2=>{var s;Ct(t2)&&(this.penHovers=true);const e2=this.pointers.get(t2.pointerId);if(!e2)return;const i2=this.local(t2);if(this.pointers.set(t2.pointerId,i2),this.pointers.size===1){const o=i2.x-e2.x,r=i2.y-e2.y;this.down&&Math.hypot(i2.x-this.down.x,i2.y-this.down.y)>zt&&(this.down.moved=true),(s=this.down)!=null&&s.moved&&this.options.navigable&&this.target.panBy(o,r,!this.tracksPointer(t2.pointerType)),this.samples.push({x:i2.x,y:i2.y,t:t2.timeStamp});const a=t2.timeStamp-Jt;for(;this.samples.length>2&&this.samples[0].t<a;)this.samples.shift()}else if(this.pointers.size===2&&this.pinch&&this.options.navigable){const o=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(o.distance/this.pinch.distance,o.mid,false),this.target.panBy(o.mid.x-this.pinch.mid.x,o.mid.y-this.pinch.mid.y,false),this.pinch=o}});h(this,"onPointerUp",t2=>{var d,l,f,m,c,u;if(!this.pointers.has(t2.pointerId))return;if(this.pointers.delete(t2.pointerId),(l=(d=this.element).releasePointerCapture)==null||l.call(d,t2.pointerId),this.pointers.size===1){this.pinch=null;const[p]=this.pointers.values();this.samples=[{...p,t:t2.timeStamp}];return}if(this.pointers.size>0)return;const e2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!e2)return;const i2=this.local(t2);if(!e2.moved&&t2.type==="pointerup"&&t2.timeStamp-e2.t<tt){if((m=(f=this.target).dismiss)!=null&&m.call(f)){this.lastTap=null;return}if(et(t2.pointerType,this.penHovers)){const p=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&p&&t2.timeStamp-p.t<tt&&Math.hypot(i2.x-p.x,i2.y-p.y)<Ut?(this.lastTap=null,this.zoomIn(i2)):this.lastTap={x:i2.x,y:i2.y,t:t2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?t2.shiftKey?this.target.zoomBy(1/z,i2,true):this.zoomIn(i2):(u=(c=this.target).tap)==null||u.call(c,i2);return}if(!this.options.navigable||!this.tracksPointer(t2.pointerType))return;const o=this.samples[0],r=this.samples[this.samples.length-1],a=((r==null?void 0:r.t)??0)-((o==null?void 0:o.t)??0);if(o&&r&&a>0&&t2.timeStamp-r.t<50){const p=(r.x-o.x)/a*1e3,y=(r.y-o.y)/a*1e3,g=this.options.flickMomentum;g>0&&Math.hypot(p,y)>this.options.flickMinSpeed&&this.target.panBy(p*g,y*g,true)}});h(this,"onDoubleClick",t2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||et(this.lastPointerType,this.penHovers)||J(t2.target,this.element)||(t2.shiftKey?this.target.zoomBy(1/z,this.local(t2),true):this.zoomIn(this.local(t2))))});h(this,"onWheel",t2=>{const e2=t2.ctrlKey;if(!this.options.navigable||!e2&&!this.options.scrollToZoom||!e2&&Dt(t2.target,this.element,t2.deltaY))return;t2.preventDefault();const i2=se(t2),s=e2?ee:te;this.target.zoomBy(Math.exp(-i2*s),this.local(t2),!e2)});h(this,"onKeyDown",t2=>{if(t2.target!==this.element||!this.options.navigable||t2.altKey||t2.metaKey||t2.ctrlKey)return;const e2=this.element.getBoundingClientRect(),i2=e2.width*rt*(t2.shiftKey?3:1),s=e2.height*rt*(t2.shiftKey?3:1);switch(t2.key){case"ArrowLeft":this.target.panBy(i2,0,true);break;case"ArrowRight":this.target.panBy(-i2,0,true);break;case"ArrowUp":this.target.panBy(0,s,true);break;case"ArrowDown":this.target.panBy(0,-s,true);break;case"+":case"=":this.target.zoomBy(ot,void 0,true);break;case"-":case"_":this.target.zoomBy(1/ot,void 0,true);break;case"0":this.target.home();break;case"r":this.target.rotateBy(90);break;case"R":this.target.rotateBy(-90);break;default:return}t2.preventDefault()});this.element=t,this.target=e,this.options=i,t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointermove",this.onPointerMove),t.addEventListener("pointerup",this.onPointerUp),t.addEventListener("pointercancel",this.onPointerUp),t.addEventListener("dblclick",this.onDoubleClick),t.addEventListener("wheel",this.onWheel,{passive:false}),t.addEventListener("keydown",this.onKeyDown)}setOptions(t){this.options=t}dispose(){const t=this.element;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("pointercancel",this.onPointerUp),t.removeEventListener("dblclick",this.onDoubleClick),t.removeEventListener("wheel",this.onWheel),t.removeEventListener("keydown",this.onKeyDown)}local(t){const e=this.element.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}zoomIn(t){var e,i;(i=(e=this.target).atMaxZoom)!=null&&i.call(e)?this.target.home():this.target.zoomBy(z,t,true)}tracksPointer(t){return t==="touch"||this.options.flickEnabled}pinchState(){const[t,e]=[...this.pointers.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),mid:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}}function se(n){return n.deltaMode===1?n.deltaY*16:n.deltaMode===2?n.deltaY*400:n.deltaY}class wt extends Error{constructor(t,e,i){super(t),this.url=e,this.status=i,this.name="ImageLoadError"}}const at=new Set;async function ne(n,t={}){const{signal:e,maxTextureSize:i,request:s}=t,o=Wt(s),r=re(n);if(typeof createImageBitmap!="function"||typeof fetch!="function")return U(n,{signal:e,cors:true,withCredentials:o});if(r&&at.has(r))return U(n,{signal:e,cors:false,withCredentials:o});let a;try{a=await Ft(s,n,{mode:"cors",signal:e})}catch(c){if(ae(c,e))throw c;const u=await U(n,{signal:e,cors:false,withCredentials:o});return r&&at.add(r),u}if(!a.ok)throw new wt(`Image request failed with ${a.status}`,n,a.status);const d=await a.blob();let l=await oe(d);const f=l.width,m=l.height;if(i&&(l.width>i||l.height>i)){const c=i/Math.max(l.width,l.height),u=await createImageBitmap(l,{resizeWidth:Math.max(1,Math.floor(l.width*c)),resizeHeight:Math.max(1,Math.floor(l.height*c)),resizeQuality:"high"});l.close(),l=u}if(e!=null&&e.aborted)throw l.close(),G();return{kind:"bitmap",source:l,width:l.width,height:l.height,naturalWidth:f,naturalHeight:m,opaque:false}}async function oe(n){const t={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(n,t)}catch(e){if(e instanceof TypeError)return createImageBitmap(n);throw e}}function U(n,{signal:t,cors:e,withCredentials:i}){return new Promise((s,o)=>{if(t!=null&&t.aborted){o(G());return}const r=new Image;r.decoding="async",e&&(r.crossOrigin=i?"use-credentials":"anonymous");const a=()=>{r.onload=null,r.onerror=null,t==null||t.removeEventListener("abort",d)},d=()=>{a(),r.src="",o(G())};t==null||t.addEventListener("abort",d),r.onload=()=>{a();const l=()=>s({kind:"element",source:r,width:r.naturalWidth,height:r.naturalHeight,naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,opaque:!e});typeof r.decode=="function"?r.decode().then(l,l):l()},r.onerror=()=>{a(),o(new wt("Image failed to load",n))},r.src=n})}function re(n){var t;try{return new URL(n,(t=globalThis.location)==null?void 0:t.href).origin}catch{return null}}function ae(n,t){return!!(t!=null&&t.aborted)||typeof n=="object"&&n!==null&&n.name==="AbortError"}function G(){const n=new Error("Aborted");return n.name="AbortError",n}function ht(n){n.kind==="bitmap"&&n.source.close()}const he=192*1024*1024,ce=6,le=2;class de{constructor(t){h(this,"entries",new Map);h(this,"inFlight",0);h(this,"frame",0);h(this,"bytes",0);h(this,"wanted",[]);h(this,"disposed",false);h(this,"budget");h(this,"maxInFlight");this.options=t,this.budget=t.byteBudget??he,this.maxInFlight=t.maxInFlight??ce}get(t){const e=this.entries.get(t);if((e==null?void 0:e.state)==="ready")return e.lastUsed=this.frame,e.image}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="ready"}failed(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(t,e){var s;const i=this.entries.get(t);(i==null?void 0:i.state)!=="ready"&&((s=i==null?void 0:i.controller)==null||s.abort(),this.entries.set(t,{url:t,state:"ready",image:e,bytes:D(e),lastUsed:this.frame,attempts:0,pinned:false,waiters:(i==null?void 0:i.waiters)??[]}),this.bytes+=D(e),this.flushWaiters(t))}prefetch(t){return Promise.all(t.map(e=>new Promise(i=>{const s=this.entries.get(e.url);if(s&&s.state!=="loading")return i();if(s){s.waiters.push(i);return}this.start({...e,priority:-1},i)}))).then(()=>{})}update(t){if(this.disposed)return;this.frame++;const e=new Set(t.map(i=>i.url));this.wanted=[...t].sort((i,s)=>i.priority-s.priority);for(const i of this.entries.values())i.state==="loading"&&!i.pinned&&!e.has(i.url)&&i.controller&&(i.controller.abort(),this.entries.delete(i.url),this.inFlight--);for(const i of this.wanted){const s=this.entries.get(i.url);s&&(s.lastUsed=this.frame)}this.pump(),this.evict(e)}dispose(){var t;this.disposed=true;for(const e of this.entries.values())(t=e.controller)==null||t.abort(),this.flushWaiters(e.url);this.entries.clear(),this.bytes=0}forEachReady(t){for(const e of this.entries.values())e.state==="ready"&&e.image&&t(e.url,e.image)}pump(){for(const t of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(t.url)||this.start(t)}}start(t,e){const i=new AbortController,s={url:t.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:i,pinned:!!e,waiters:e?[e]:[]};this.entries.set(t.url,s),this.inFlight++,this.attempt(s,t,i,t.url)}attempt(t,e,i,s){t.attempts++,this.options.load(s,i.signal).then(o=>{if(this.disposed||this.entries.get(t.url)!==t){ht(o);return}t.state="ready",t.image=o,t.bytes=D(o),t.controller=void 0,t.pinned=false,this.bytes+=t.bytes,this.settle(t)},o=>{if(!(i.signal.aborted||this.disposed)&&this.entries.get(t.url)===t){if(t.attempts<le&&!ue(o,e)){this.attempt(t,e,i,e.fallbackUrl??e.url);return}t.state="failed",t.controller=void 0,t.pinned=false,this.settle(t)}})}settle(t){this.inFlight--,this.flushWaiters(t.url),this.options.onSettled(),this.pump()}flushWaiters(t){const e=this.entries.get(t);if(!e)return;const i=e.waiters;e.waiters=[],i.forEach(s=>s())}evict(t){if(this.bytes<=this.budget)return;const e=[...this.entries.values()].filter(i=>i.state==="ready"&&!t.has(i.url)).sort((i,s)=>i.lastUsed-s.lastUsed);for(const i of e){if(this.bytes<=this.budget)break;this.entries.delete(i.url),this.bytes-=i.bytes,i.image&&ht(i.image),this.options.onEvict(i.url)}}}function D(n){return n.width*n.height*4}function ue(n,t){if(t.fallbackUrl)return false;const e=n==null?void 0:n.status;return typeof e=="number"&&e>=400&&e<500&&e!==408&&e!==429}const fe=.1;class me{constructor(t,e=s=>requestAnimationFrame(s),i=s=>cancelAnimationFrame(s)){h(this,"handle",0);h(this,"last",0);h(this,"disposed",false);h(this,"frame",t2=>{if(this.handle=0,this.disposed)return;const e2=this.last?Math.min((t2-this.last)/1e3,fe):1/60;this.last=t2,this.tick(e2,t2)?this.invalidate():this.last=0});this.tick=t,this.raf=e,this.caf=i}invalidate(){this.disposed||this.handle||(this.handle=this.raf(this.frame))}drawNow(){this.disposed||(this.handle&&this.caf(this.handle),this.frame(performance.now()))}dispose(){this.disposed=true,this.handle&&this.caf(this.handle),this.handle=0}}const pe=2*1024*1024;function ge(n,t,e=pe){const i=new Set;let s=e,o=false;return{get deferred(){return o},getTile(r){const a=n(r);if(!a||a.kind==="media"||a.opaque||i.has(r)||t(r))return a;const d=a.width*a.height*4;if(i.size>0&&d>s){o=true;return}return s-=d,i.add(r),a}}}function we(n){const t=/^(!)?(\d+(?:\.\d+)?)$/.exec((n==null?void 0:n.trim())??"");if(!t)return null;const e=Number(t[2]);if(e>360)return null;const i=e%360,s=!!t[1];return i||s?{degrees:i,mirror:s}:null}function ye(n,t,e){if(!n)return null;let i=n.trim().replace(/^xywh=/,""),s=false;i.startsWith("pct:")?(s=true,i=i.slice(4)):i.startsWith("pixel:")&&(i=i.slice(6));const o=i.split(",").map(Number);if(o.length!==4||o.some(p=>!Number.isFinite(p)))return null;let[r,a,d,l]=o;s&&(r=r/100*t,a=a/100*e,d=d/100*t,l=l/100*e);const f=Math.max(0,r),m=Math.max(0,a),c=Math.min(t,r+d),u=Math.min(e,a+l);return c<=f||u<=m?null:{x:f,y:m,width:c-f,height:u-m}}const W=512,xe=16e6;function yt(n,t,e){return{width:t,height:e,levels:[{scaleFactor:1,width:t,height:e,tileWidth:t,tileHeight:e,cols:1,rows:1}],tile:s=>({...s,url:n,region:{x:0,y:0,width:t,height:e}})}}function ve(n){const{width:t,height:e}=n,i=[],s=n.regionByPx&&n.sizeByW,o=(c,u,p)=>{const y=Math.ceil(t/c),g=Math.ceil(e/c);return{scaleFactor:c,width:y,height:g,tileWidth:u,tileHeight:p,cols:Math.ceil(y/u),rows:Math.ceil(g/p)}},r=(c,u)=>({scaleFactor:t/c,width:c,height:u,tileWidth:c,tileHeight:u,cols:1,rows:1,whole:true}),a=n.tiles[0];if(a)for(const c of a.scaleFactors)i.push(o(c,a.width,a.height));else if(s)for(let c=1;;c*=2){const u=o(c,W,W);if(i.push(u),u.cols===1&&u.rows===1)break}const d=Math.max(0,...i.map(c=>c.scaleFactor));for(const c of n.sizes){const u=t/c.width;be(n,c.width,c.height)&&u>d+1e-9&&i.push(r(c.width,c.height))}const l=i.reduce((c,u)=>!c||u.scaleFactor>c.scaleFactor?u:c,null);if(l&&l.cols*l.rows>1&&n.sizeByW){const c=Math.max(t,e)/W;i.push(r(Math.ceil(t/c),Math.ceil(e/c)))}(!i.length||!a&&!s&&t*e<=xe)&&(i.some(c=>c.scaleFactor===1)||i.push(r(t,e)));const f=Te(i).sort((c,u)=>u.scaleFactor-c.scaleFactor),m=Ht(n);return{width:t,height:e,levels:f,tile(c){const u=f[c.level],p=u.scaleFactor,y=u.cols===1&&u.rows===1;let g,v,b;if(y)g={x:0,y:0,width:t,height:e},v=u.width,b=u.height;else{const I=Math.round(c.col*u.tileWidth*p),M=Math.round(c.row*u.tileHeight*p);g={x:I,y:M,width:Math.min(Math.round(u.tileWidth*p),t-I),height:Math.min(Math.round(u.tileHeight*p),e-M)},v=Math.ceil(g.width/p),b=Math.ceil(g.height/p)}return{...c,region:g,url:it(n,g,v,b),fallbackUrl:m?it(n,g,v,b,m):void 0}}}}function be(n,t,e){return!(n.maxWidth&&t>n.maxWidth||n.maxHeight&&e>n.maxHeight||n.maxArea&&t*e>n.maxArea)}function Te(n){const t=new Map;for(const e of n){const i=`${e.width}x${e.height}`,s=t.get(i);(!s||s.cols*s.rows<e.cols*e.rows)&&t.set(i,e)}return[...t.values()]}function Me(n,t){const e=n.levels;for(let i=0;i<e.length;i++)if(e[i].scaleFactor<=t*(1+1e-6))return i;return e.length-1}function T(n,t,e){const i=n.levels[t],s=i.tileWidth*i.scaleFactor,o=i.tileHeight*i.scaleFactor,r=Math.max(0,e.x),a=Math.max(0,e.y),d=Math.min(n.width,e.x+e.width),l=Math.min(n.height,e.y+e.height);if(d<=r||l<=a)return[];const f=Math.max(0,Math.floor(r/s)),m=Math.min(i.cols-1,Math.floor((d-1e-9)/s)),c=Math.max(0,Math.floor(a/o)),u=Math.min(i.rows-1,Math.floor((l-1e-9)/o)),p=[];for(let y=c;y<=u;y++)for(let g=f;g<=m;g++)p.push({level:t,col:g,row:y});return p}async function Ee(n,t){if(n.media)return ke(n,n.media);let e=null,i=null;if(n.service)try{e=ve(await Nt(n.service,t.infoOptions))}catch(c){i=c}if(!e){if(!n.url)throw i??new Error("Image has no source");const c=await t.loadStatic(n.url);t.cache.seed(n.url,c),e=yt(n.url,c.naturalWidth,c.naturalHeight)}const s=n.width&&n.height&&n.width>0&&n.height>0?{width:n.width,height:n.height}:{width:e.width,height:e.height},o=ye(n.region,s.width,s.height)??{x:0,y:0,width:s.width,height:s.height},r=e.width/s.width,a=e.height/s.height,d={x:o.x*r,y:o.y*a,width:o.width*r,height:o.height*a},l=we(n.rotation),f=l?Le(d,l):void 0,m={id:n.id,spec:n,pyramid:e,size:s,clip:d,contentClip:o,rect:{x:0,y:0,width:o.width,height:o.height},...f?{turn:f}:{}};return await t.cache.prefetch(T(e,0,d).map(c=>{const u=e.tile(c);return{url:u.url,fallbackUrl:u.fallbackUrl}})),m}const xt="media:";function ke(n,t){var a,d;const e=n.width||((a=n.placement)==null?void 0:a.width)||t.element.videoWidth||1600,i=n.height||((d=n.placement)==null?void 0:d.height)||t.element.videoHeight||900,s=`${xt}${n.id}`,o={width:e,height:i},r={x:0,y:0,width:e,height:i};return{id:n.id,spec:n,pyramid:yt(s,e,i),media:{kind:"media",source:t.element,width:e,height:i,naturalWidth:e,naturalHeight:i},size:o,clip:r,contentClip:r,rect:{...r}}}function Le(n,{degrees:t,mirror:e}){const i=t*Math.PI/180,s=f=>Math.abs(f)<1e-12?0:f,o=s(Math.cos(i)),r=s(Math.sin(i)),a=Math.abs(n.width*o)+Math.abs(n.height*r),d=Math.abs(n.width*r)+Math.abs(n.height*o),l=k(_(a/2,d/2),{a:o,b:r,c:-r,d:o,e:0,f:0},L(e?-1:1,1),_(-(n.x+n.width/2),-(n.y+n.height/2)));return{orient:l,unorient:Pt(l),width:a,height:d}}function vt(n){var t;return((t=n.turn)==null?void 0:t.orient)??_(-n.clip.x,-n.clip.y)}function _e(n,t){const{turn:e,clip:i}=n;if(!e)return{...t,x:i.x+t.x,y:i.y+t.y};const s=gt(e.unorient,t),o=Math.max(s.x,i.x),r=Math.max(s.y,i.y);return{x:o,y:r,width:Math.max(0,Math.min(s.x+s.width,i.x+i.width)-o),height:Math.max(0,Math.min(s.y+s.height,i.y+i.height)-r)}}function Pe(n,t){const{turn:e,clip:i}=n;return e?pt(e.unorient,t):{x:i.x+t.x,y:i.y+t.y}}function ct(n){const{turn:t,clip:e,contentClip:i}=n;return t?{width:t.width*i.width/e.width,height:t.height*i.height/e.height}:i}function Ie(n){if(!n.length)return null;if(n.every(i=>i.spec.placement)){for(const i of n)i.rect={...i.spec.placement};return mt(n.map(i=>i.rect))}const t=ct(n[0]).height;let e=0;for(const i of n){const s=ct(i),o=s.width*t/s.height;i.rect={x:e,y:0,width:o,height:t},e+=o}return{x:0,y:0,width:e,height:t}}function B(n){const t=n.turn??n.clip;return{x:n.rect.width/t.width,y:n.rect.height/t.height}}function Ae(n){const t=B(n);return k(_(n.rect.x,n.rect.y),L(t.x,t.y),vt(n))}function Se(n,t){var e,i;return n.service===t.service&&n.url===t.url&&n.width===t.width&&n.height===t.height&&n.region===t.region&&n.rotation===t.rotation&&((e=n.media)==null?void 0:e.element)===((i=t.media)==null?void 0:i.element)&&JSON.stringify(n.placement)===JSON.stringify(t.placement)}const Re=1e7,Be=15e6,Oe=2e7,Ce=2;function ze(n){const{items:t,camera:e,viewport:i,pixelRatio:s,getTile:o,destination:r}=n,a=Rt(e,i),d=[],l=[],f=[],m=(c,u,p)=>{const y=c.tile(u);l.push({url:y.url,fallbackUrl:y.fallbackUrl,priority:p})};for(const c of t){const{pyramid:u,clip:p,rect:y}=c,g=B(c);if(n.wantOverview)for(const w of T(u,0,p))m(u,w,Oe);const v=lt(c,e,i,s),b=r?lt(c,r,i,s):v;if(f.push((v==null?void 0:v.target)??-1),!v&&!b)continue;const I=w=>x=>{const P=u.tile(x).region;return Math.hypot(P.x+P.width/2-w.x,P.y+P.height/2-w.y)};if(b){const w=I(b.center);for(const x of T(u,0,b.area))m(u,x,w(x)/1e3);if(b.target>0)for(const x of T(u,b.target,b.area))m(u,x,Re+w(x))}if(!v)continue;const{area:M,target:E}=v,K=I(v.center),O=T(u,0,M),V=E===0?[]:T(u,E,M);if(b!==v){for(const x of O)m(u,x,K(x)/1e3);const w=E-Ce;if(w>0)for(const x of T(u,w,M))m(u,x,Be+K(x))}if(c.spec.hidden)continue;const bt=(E===0?O:V).every(w=>o(u.tile(w).url)!==void 0)?[E]:Array.from({length:E+1},(w,x)=>x),Tt=k(a,_(y.x,y.y),L(g.x,g.y),vt(c));for(const w of bt){const x=w===0?O:w===E?V:T(u,w,M),P=u.levels[w].cols*u.levels[w].rows>1;for(const Mt of x){const C=u.tile(Mt),q=o(C.url);if(!q)continue;const Y=Ue(c,C.region,q,Tt,P);Y&&d.push({...Y,url:C.url})}}}return l.sort((c,u)=>c.priority-u.priority),{draws:d,wants:De(l),levels:f}}function lt(n,t,e,i){const{pyramid:s,rect:o}=n,r=N(t,e);if(!It(r,o))return null;const a=B(n),d=Math.max(r.x,o.x),l=Math.max(r.y,o.y),f=Math.min(r.x+r.width,o.x+o.width),m=Math.min(r.y+r.height,o.y+o.height),c=1/(a.x*t.zoom*i);return{area:_e(n,{x:(d-o.x)/a.x,y:(l-o.y)/a.y,width:(f-d)/a.x,height:(m-l)/a.y}),center:Pe(n,{x:(t.x-o.x)/a.x,y:(t.y-o.y)/a.y}),target:Me(s,c)}}function Ue(n,t,e,i,s){const{clip:o}=n,r=Math.max(t.x,o.x),a=Math.max(t.y,o.y),d=Math.min(t.x+t.width,o.x+o.width),l=Math.min(t.y+t.height,o.y+o.height);if(d<=r||l<=a)return null;const f=e.width/t.width,m=e.height/t.height,c=1e-6;return{item:n,image:e,transform:k(i,_(t.x,t.y),L(1/f,1/m)),crop:{x:(r-t.x)*f,y:(a-t.y)*m,width:(d-r)*f,height:(l-a)*m},bleed:{right:s&&d<o.x+o.width-c,bottom:s&&l<o.y+o.height-c}}}function De(n){const t=new Set;return n.filter(e=>t.has(e.url)?false:(t.add(e.url),true))}const We={maxZoomPixelRatio:1.1,minZoomImageRatio:.9,upscale:true,animationTime:.09,animationDuration:void 0,springStiffness:6.5,constrainDuringPan:true,request:void 0,byteBudget:192*1024*1024,maxInFlight:6,releaseAfterMs:2e3},Fe=2,He=3,Ne=.1,F=1e-6,X={top:0,right:0,bottom:0,left:0};function dt(n,t="padding"){if(!n||typeof getComputedStyle!="function")return X;const e=getComputedStyle(n),i=s=>parseFloat(e.getPropertyValue(`${t}-${s}`))||0;return{top:i("top"),right:i("right"),bottom:i("bottom"),left:i("left")}}const Ze=(n,t)=>n.top===t.top&&n.right===t.right&&n.bottom===t.bottom&&n.left===t.left;let Ge;class Xe{constructor(t,e={}){h(this,"host");h(this,"overlays",null);h(this,"options");h(this,"backend",null);h(this,"backendPreference");h(this,"contextLosses",0);h(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});h(this,"visible",true);h(this,"dom",null);h(this,"domAsked",false);h(this,"pending",null);h(this,"camera");h(this,"loop");h(this,"gestures");h(this,"gestureOptions",{});h(this,"cache");h(this,"navigator",null);h(this,"navigatorAsked",0);h(this,"viewport",{width:1,height:1});h(this,"inset",X);h(this,"pixelRatio",1);h(this,"items",[]);h(this,"worldBounds",null);h(this,"contentVersion",0);h(this,"opaqueUrls",new Set);h(this,"mediaByKey",new Map);h(this,"detachMedia",[]);h(this,"opened",false);h(this,"atHome",true);h(this,"interacting",false);h(this,"lastEmitted",null);h(this,"generation",0);h(this,"listeners",new Map);h(this,"unloadable",false);h(this,"resizeObserver",null);h(this,"intersectionObserver",null);h(this,"releaseTimer",null);h(this,"dprQuery",null);h(this,"disposed",false);h(this,"dismisser",null);h(this,"tick",t2=>{var d,l;if(this.disposed)return false;const e2=this.camera.step(t2,this.viewport),i2=this.camera.current,s2=this.backend,o=ge(this.getTile,f=>s2?s2.has(f):true),r=ze({items:this.items,camera:i2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:o.getTile,wantOverview:!!this.navigator,destination:e2?this.camera.destination:void 0}),a=r.wants.filter(f=>!f.url.startsWith(xt));return this.cache.update(a),r.draws.length?this.setUnloadable(false):a.length&&a.every(f=>this.cache.failed(f.url))&&this.setUnloadable(true),this.paint(r.draws),(d=this.overlays)==null||d.position(i2,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(f=>!f.spec.hidden),this.worldBounds,N(i2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!j(this.lastEmitted,i2))&&(this.lastEmitted={...i2},this.opened&&this.emit("viewport")),e2||o.deferred});h(this,"getTile",t2=>this.mediaByKey.get(t2)??this.cache.get(t2));h(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});h(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=t,this.backendPreference=e.backend??"auto",this.options={...We,...H(e)},ft()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:i,springStiffness:s}=this.options;this.camera=new jt({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,i===void 0?void 0:{duration:i,stiffness:s}),this.loop=new me(this.tick),this.gestureOptions=H(e.gestures??{}),ft()&&(this.gestureOptions.flickMomentum=0),this.gestures=new ie(t,this,{...Z,...this.gestureOptions}),this.cache=new de({load:(o,r)=>this.loadTile(o,r),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:o=>{var r;return(r=this.backend)==null?void 0:r.release(o)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=Ke(t),this.visible?this.acquireBackend():this.holder.hiddenSince=ut(),this.measure(),this.observe()}get backendKind(){var t;return((t=this.backend)==null?void 0:t.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>i==null?void 0:i.delete(e)}async setImages(t,{world:e,fit:i=false}={}){const s=++this.generation,o=new Map(this.items.map(f=>[f.id,f])),r=await Promise.allSettled(t.map(f=>{const m=o.get(f.id);return m&&Se(m.spec,f)?(m.spec=f,Promise.resolve(m)):Ee(f,{cache:this.cache,loadStatic:c=>this.loadTile(c),infoOptions:{request:this.options.request}})}));if(s!==this.generation||this.disposed)return;const a=r.filter(f=>f.status==="fulfilled").map(f=>f.value),d=r.filter(f=>f.status==="rejected").map(f=>f.reason);this.items=a,this.watchMedia(a);const l=Ie(a);if(this.worldBounds=e?l?mt([e,l]):e:l,this.contentVersion++,d.length&&this.emit("error",d),this.setUnloadable(t.length>0&&!a.length&&d.length>0),!this.worldBounds){this.invalidate();return}this.opened?i?(this.home(true),this.emit("change")):(this.camera.set(this.constrain(this.camera.current)),this.emit("change")):(this.opened=true,this.home(true),this.emit("open")),this.invalidate()}clear(){this.setUnloadable(false),this.generation++,this.items=[],this.watchMedia([]),this.worldBounds=null,this.contentVersion++,this.invalidate()}setHidden(t){const e=new Set(t);let i=false;for(const s of this.items){const o=e.has(s.id);!!s.spec.hidden!==o&&(s.spec={...s.spec,hidden:o},i=true)}i&&this.invalidate()}isReady(t){const e=this.items.find(s=>s.id===t);if(!e)return false;if(e.spec.media)return true;const i=e.pyramid.levels[0];if(!i)return false;for(let s=0;s<i.rows;s++)for(let o=0;o<i.cols;o++)if(!this.getTile(e.pyramid.tile({level:0,col:o,row:s}).url))return false;return true}fitBounds(t,e=false,i=X){const s=this.fit(t,this.camera.destination.rotation,i);this.atHome=false,this.animateTo(this.constrain(s,{allowBeyondLimits:true}),e)}fit(t,e,{top:i,right:s,bottom:o,left:r},a=1/0){const{width:d,height:l}=this.viewport,f=Bt(t,{width:Math.max(1,d-r-s),height:Math.max(1,l-i-o)},e),m=Math.min(f.zoom,a);return{...S(At(t),{x:(d+r-s)/2,y:(l+i-o)/2},m,e,this.viewport),zoom:m,rotation:e}}fitItemRect(t,e,i=false){const s=this.itemRectToWorld(t,e);s&&this.fitAnnotation(s,i)}fitAnnotation(t,e=false){var o;const i=this.items[0];if(!i)return;const s=i.rect.width*Ne;this.fitBounds({x:t.x-s,y:t.y-s,width:t.width+s*2,height:t.height+s*2},e,dt((o=this.overlays)==null?void 0:o.container,"scroll-padding"))}getBounds(){return N(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var e;const t=((e=this.homeCamera())==null?void 0:e.zoom)??1;return{home:t,min:t*this.options.minZoomImageRatio,max:Math.max(t,this.closestZoom())}}closestZoom(){const t=this.items.length?Math.min(...this.items.map(e=>B(e).x)):1;return this.options.maxZoomPixelRatio/t}home(t=false){const e=this.homeCamera();if(!e)return;const i=this.atHome;this.atHome=true,this.animateTo(e,t),!i&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-F)}viewLimits(){const{zoom:t,x:e,y:i,rotation:s}=this.camera.destination,{min:o,max:r}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:t>=r*(1-F),atMin:t<=o*(1+F),atHome:this.atHome&&(!a||Math.abs(t/a.zoom-1)<.001&&Math.hypot(e-a.x,i-a.y)*t<.5&&Math.abs(s-a.rotation)<.001)}}zoomBy(t,e,i=true){const s=i?this.camera.destination:this.camera.current,o=e??{x:this.viewport.width/2,y:this.viewport.height/2},r=Q(s,this.viewport,o),{min:a,max:d}=this.getZoomLimits(),l=A(s.zoom*t,a,d),f=S(r,o,l,s.rotation,this.viewport),m=this.constrain({...s,...f,zoom:l});this.atHome=false,i?this.camera.animateTo({state:m,anchor:{world:r,screen:o}},this.viewport):this.camera.set(m),this.invalidate()}panBy(t,e,i=false){const s=i?this.camera.destination:this.camera.current,o=pt(k(L(1/s.zoom),St(-s.rotation)),{x:t,y:e}),r=this.constrain({...s,x:s.x-o.x,y:s.y-o.y});this.atHome=false,i?this.camera.animateTo({state:r},this.viewport):this.camera.set(r),this.invalidate()}panTo(t,e=false){const i=e?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...i,...t}),e)}rotateBy(t){const e=this.camera.destination;this.setRotation(e.rotation*180/Math.PI+t)}setRotation(t,e=false){const i=this.camera.destination,s=t*Math.PI/180;this.animateTo(this.constrain({...i,rotation:s}),e)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(t){this.emit("tap",t)}setDismiss(t){this.dismisser=t}dismiss(){var t;return((t=this.dismisser)==null?void 0:t.call(this))??false}setGestures(t){this.gestures.setOptions({...Z,...this.gestureOptions,...H(t)})}setInteracting(t){if(this.interacting=t,t){this.camera.stop();return}if(this.options.constrainDuringPan)return;const e=this.camera.destination,i=this.constrain(e);j(e,i)||this.animateTo(i,false)}worldToScreenPoint(t){return Ot(this.camera.current,this.viewport,t)}screenToWorldPoint(t){return Q(this.camera.current,this.viewport,t)}itemRectToWorld(t,e){const i=this.items[t];if(!i)return null;const{contentClip:s,clip:o}=i;if(i.turn)return gt(k(Ae(i),L(o.width/s.width,o.height/s.height)),e);const r=i.rect.width/s.width,a=i.rect.height/s.height;return{x:i.rect.x+(e.x-s.x)*r,y:i.rect.y+(e.y-s.y)*a,width:e.width*r,height:e.height*a}}attachNavigator(t){var o;(o=this.navigator)==null||o.dispose(),this.navigator=null;const e=++this.navigatorAsked;let i=null,s=false;return import("./Navigator-B9rs7wKo.mjs").then(r=>{s||this.disposed||e!==this.navigatorAsked||(i=new r.Navigator(t,(a,d)=>this.panTo(a,d)),this.navigator=i,this.invalidate())}),()=>{s=true,i==null||i.dispose(),i&&this.navigator===i&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var t,e,i,s,o,r,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(t=this.resizeObserver)==null||t.disconnect(),(e=this.intersectionObserver)==null||e.disconnect(),(s=(i=this.dprQuery)==null?void 0:i.removeEventListener)==null||s.call(i,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(o=this.navigator)==null||o.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(r=this.dom)==null||r.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(d=>d()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}watchMedia(t){this.detachMedia.forEach(e=>e()),this.detachMedia=[],this.mediaByKey.clear();for(const e of t){if(!e.media||e.media.kind!=="media")continue;const i=e.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(i,e.media);const s=e.media.source,o=()=>this.invalidate(),r=["play","seeked","loadeddata","resize"];r.forEach(a=>s.addEventListener(a,o)),this.detachMedia.push(()=>r.forEach(a=>s.removeEventListener(a,o)))}}paint(t){const e=this.backend,i=[],s=(e==null?void 0:e.kind)==="webgl2";e==null||e.begin();for(const o of t){const{image:r}=o;if(!(r.kind==="media"||r.kind==="element"&&s&&(r.opaque||this.opaqueUrls.has(o.url)))&&e){if(e.draw({key:o.url,source:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1,bleed:o.bleed})!=="tainted"||r.kind==="bitmap")continue;this.opaqueUrls.add(o.url)}(r.kind==="element"||r.kind==="media")&&i.push({key:`${o.item.id}|${o.url}`,element:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1})}e==null||e.end(),this.dom?this.dom.sync(i):i.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-BNFCWPIf.mjs").then(({DomLayers:o})=>{if(this.disposed)return;const r=new o(this.host);this.overlays&&this.host.insertBefore(r.container,this.overlays.container),this.dom=r,this.invalidate()}))}loadTile(t,e){return ne(t,{signal:e,request:this.options.request,maxTextureSize:this.backend instanceof R?this.backend.maxTextureSize:void 0})}animateTo(t,e){this.camera.animateTo({state:t},this.viewport,e),this.invalidate()}homeCamera(){if(!this.worldBounds)return null;const t=2*Math.PI,e=Math.round(this.camera.destination.rotation/t)*t||0;return this.fit(this.worldBounds,e,this.inset,this.options.upscale?1/0:this.closestZoom())}constrain(t,{allowBeyondLimits:e=false}={}){const i=this.worldBounds;if(!i)return t;const{min:s,max:o}=this.getZoomLimits(),r=e?A(t.zoom,s,Math.max(o,t.zoom)):A(t.zoom,s,o);return this.interacting&&!this.options.constrainDuringPan?{...t,zoom:r}:{...t,zoom:r,x:A(t.x,i.x,i.x+i.width),y:A(t.y,i.y,i.y+i.height)}}acquireBackend(t=true){var o,r;if(this.backend||this.pending||this.disposed)return;const e=document.createElement("canvas");e.className="clover-canvas-surface",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(e,((o=this.dom)==null?void 0:o.container)??((r=this.overlays)==null?void 0:r.container)??null);const i=t&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<He);let s=null;i&&(Lt(this.holder)||this.backendPreference==="webgl2")&&(s=R.create(e,{onLost:this.onContextLost}),s||$(this.holder)),s?this.install(s):this.backendPreference==="webgl2"?this.none(e):(this.pending=e,(Ge??(Ge=import("./Canvas2DBackend-B1YLZdY_.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==e)return;this.pending=null;const d=a.create(e);d?this.install(d):this.none(e)}))}none(t){t.remove(),this.host.dataset.backend="none"}install(t){this.backend=t,this.host.dataset.backend=t.kind,t.resize(this.viewport.width,this.viewport.height,this.pixelRatio),t.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",t.kind),this.invalidate()}releaseBackend(){var e;if($(this.holder),(e=this.pending)==null||e.remove(),this.pending=null,!this.backend)return;const t=this.backend.canvas;this.backend.dispose(),t.remove(),this.backend=null}giveBack(){this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.releaseBackend(),this.host.dataset.backend="released"}observe(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>this.measure(true)),this.resizeObserver.observe(this.host)),typeof IntersectionObserver<"u"&&(this.intersectionObserver=new IntersectionObserver(t=>{const e=t.some(i=>i.isIntersecting);this.setVisible(e)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(t){var e;if(this.visible=t,t){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(e=this.holder).hiddenSince??(e.hiddenSince=ut()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(t=false){var d;const e=this.host.getBoundingClientRect(),i=Math.max(1,e.width),s=Math.max(1,e.height),o=dt(this.host),r=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Fe);if(i===this.viewport.width&&s===this.viewport.height&&r===this.pixelRatio&&Ze(o,this.inset))return;const a=this.viewport;if(this.viewport={width:i,height:s},this.inset=o,this.pixelRatio=r,(d=this.backend)==null||d.resize(i,s,r),this.opened){if(this.atHome)this.home(true);else{const l=this.camera.current,f=i/Math.max(a.width,1);this.camera.set(this.constrain({...l,zoom:l.zoom*f}))}this.emit("viewport")}t?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var t,e,i,s;typeof window>"u"||typeof window.matchMedia!="function"||((e=(t=this.dprQuery)==null?void 0:t.removeEventListener)==null||e.call(t,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(s=(i=this.dprQuery).addEventListener)==null||s.call(i,"change",this.onPixelRatioChange))}setUnloadable(t){t!==this.unloadable&&(this.unloadable=t,this.emit("unloadable",t))}emit(t,e){var i;(i=this.listeners.get(t))==null||i.forEach(s=>s(e))}}const ut=()=>typeof performance<"u"?performance.now():Date.now();function Ke(n){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:t,left:e,width:i,height:s}=n.getBoundingClientRect();return t+s>=0&&e+i>=0&&t<=window.innerHeight&&e<=window.innerWidth}function ft(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function H(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}const ii=(n,t)=>new Xe(n,t);export{Gt as b,Zt as h,ze as p,ii as r};
22
+ `;class R{constructor(t,e,i){h(this,"kind","webgl2");h(this,"canvas");h(this,"maxTextureSize");h(this,"gl");h(this,"program",null);h(this,"vao",null);h(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});h(this,"textures",new Map);h(this,"cssWidth",1);h(this,"cssHeight",1);h(this,"pixelRatio",1);h(this,"matrixScratch",new Float32Array(9));h(this,"isLost",false);h(this,"callbacks");h(this,"handleLost",()=>{var t2,e2;this.isLost=true,this.textures.clear(),(e2=(t2=this.callbacks).onLost)==null||e2.call(t2)});this.canvas=t,this.gl=e,this.callbacks=i,this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)||4096;const s=Vt(e,Xt,Kt);this.program=s,this.uniforms={matrix:e.getUniformLocation(s,"u_matrix"),crop:e.getUniformLocation(s,"u_crop"),opacity:e.getUniformLocation(s,"u_opacity"),texture:e.getUniformLocation(s,"u_texture")};const o=e.createVertexArray();e.bindVertexArray(o);const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),e.STATIC_DRAW);const a=e.getAttribLocation(s,"a_position");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,false,0,0),e.bindVertexArray(null),this.vao=o,e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.BROWSER_DEFAULT_WEBGL),t.addEventListener("webglcontextlost",this.handleLost)}static create(t,e={}){let i=null;try{i=t.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{i=null}if(!i||typeof i.createShader!="function")return null;try{return new R(t,i,e)}catch{return null}}resize(t,e,i){this.cssWidth=Math.max(1,t),this.cssHeight=Math.max(1,e),this.pixelRatio=i;const s=Math.max(1,Math.round(t*i)),o=Math.max(1,Math.round(e*i));this.canvas.width!==s&&(this.canvas.width=s),this.canvas.height!==o&&(this.canvas.height=o)}begin(){if(this.isLost)return;const t=this.gl;t.viewport(0,0,this.canvas.width,this.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(this.program),t.bindVertexArray(this.vao),t.activeTexture(t.TEXTURE0),t.uniform1i(this.uniforms.texture,0)}draw(t){if(this.isLost||!Zt(t.source))return"skipped";const e=this.gl,i=this.upload(t);if(i==="tainted")return"tainted";if(!i)return"skipped";const s=t.crop??{x:0,y:0,width:t.width,height:t.height},o=Gt(t,this.pixelRatio),r=k(t.transform,_(s.x,s.y),L(s.width+o.x,s.height+o.y));return e.uniformMatrix3fv(this.uniforms.matrix,false,_t(r,this.cssWidth,this.cssHeight,this.matrixScratch)),e.uniform4f(this.uniforms.crop,s.x/t.width,s.y/t.height,s.width/t.width,s.height/t.height),e.uniform1f(this.uniforms.opacity,t.opacity),e.bindTexture(e.TEXTURE_2D,i.texture),e.drawArrays(e.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(t){return!this.isLost&&this.textures.has(t)}release(t){const e=this.textures.get(t);e&&(this.isLost||this.gl.deleteTexture(e.texture),this.textures.delete(t))}dispose(){var t;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const e of[...this.textures.keys()])this.release(e);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(t=this.gl.getExtension("WEBGL_lose_context"))==null||t.loseContext(),this.isLost=true}upload(t){const e=this.gl,i=this.textures.get(t.key);if(i&&i.width===t.width&&i.height===t.height)return i;const s=(i==null?void 0:i.texture)??e.createTexture();if(!s)return null;e.bindTexture(e.TEXTURE_2D,s);try{e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source)}catch(r){if(i||e.deleteTexture(s),qt(r))return"tainted";throw r}e.generateMipmap(e.TEXTURE_2D),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const o={texture:s,width:t.width,height:t.height};return this.textures.set(t.key,o),o}}function Vt(n,t,e){const i=st(n,n.VERTEX_SHADER,t),s=st(n,n.FRAGMENT_SHADER,e),o=n.createProgram();if(!o)throw new Error("Could not create WebGL program");if(n.attachShader(o,i),n.attachShader(o,s),n.linkProgram(o),n.deleteShader(i),n.deleteShader(s),!n.getProgramParameter(o,n.LINK_STATUS)){const r=n.getProgramInfoLog(o);throw n.deleteProgram(o),new Error(`Could not link WebGL program: ${r}`)}return o}function st(n,t,e){const i=n.createShader(t);if(!i)throw new Error("Could not create WebGL shader");if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){const s=n.getShaderInfoLog(i);throw n.deleteShader(i),new Error(`Could not compile WebGL shader: ${s}`)}return i}function qt(n){return typeof n=="object"&&n!==null&&n.name==="SecurityError"}const Yt=.09,$t=1e-4,nt=.05,Qt=1e-4;class jt{constructor(t,e=Yt,i){h(this,"current");h(this,"target",null);h(this,"timeConstant");h(this,"spring");h(this,"start");h(this,"elapsed",0);this.current={...t},this.start={...t},this.timeConstant=e,this.spring=i}get destination(){return this.target?{...this.target.state}:{...this.current}}set(t){this.current={...t},this.target=null}animateTo(t,e,i=false){const s=this.spring?this.spring.duration<=0:this.timeConstant===0;if(i||s){this.set(t.state);return}let o=t.anchor;if(o){const r=S(o.world,o.screen,t.state.zoom,t.state.rotation,e);Math.hypot(r.x-t.state.x,r.y-t.state.y)*t.state.zoom>nt&&(o=void 0)}this.start={...this.current},this.elapsed=0,this.target={state:{...t.state},anchor:o}}stop(){this.target=null}step(t,e){const i=this.target;if(!i)return false;const s=i.state;let o,r;if(this.spring){this.elapsed+=Math.max(t,0);const m=this.elapsed/this.spring.duration;if(m>=1)return this.current={...s},this.target=null,false;const c=this.spring.stiffness;o=this.start,r=(1-Math.exp(-c*m))/(1-Math.exp(-c))}else o=this.current,r=1-Math.exp(-Math.max(t,0)/this.timeConstant);const a=Math.exp(Math.log(o.zoom)+(Math.log(s.zoom)-Math.log(o.zoom))*r),d=o.rotation+(s.rotation-o.rotation)*r,l=i.anchor?S(i.anchor.world,i.anchor.screen,a,d,e):{x:o.x+(s.x-o.x)*r,y:o.y+(s.y-o.y)*r};return this.current={x:l.x,y:l.y,zoom:a,rotation:d},this.spring?true:Math.abs(Math.log(s.zoom/a))<$t&&Math.abs(s.rotation-d)<Qt&&Math.hypot(s.x-l.x,s.y-l.y)*a<nt?(this.current={...s},this.target=null,false):true}}const Z={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true,flickEnabled:true,flickMinSpeed:200,flickMomentum:.25},z=2,ot=1.5,rt=.1,Jt=100,te=.002,ee=.01;class ie{constructor(t,e,i=Z){h(this,"pointers",new Map);h(this,"samples",[]);h(this,"down",null);h(this,"pinch",null);h(this,"lastTap",null);h(this,"lastPointerType","");h(this,"penHovers",false);h(this,"onPointerDown",t2=>{var i2,s;if(this.lastPointerType=t2.pointerType,t2.pointerType==="mouse"&&t2.button!==0||J(t2.target,this.element))return;(s=(i2=this.element).setPointerCapture)==null||s.call(i2,t2.pointerId);const e2=this.local(t2);this.pointers.set(t2.pointerId,e2),this.pointers.size===1?(this.down={x:e2.x,y:e2.y,t:t2.timeStamp,moved:false},this.samples=[{x:e2.x,y:e2.y,t:t2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});h(this,"onPointerMove",t2=>{var s;Ct(t2)&&(this.penHovers=true);const e2=this.pointers.get(t2.pointerId);if(!e2)return;const i2=this.local(t2);if(this.pointers.set(t2.pointerId,i2),this.pointers.size===1){const o=i2.x-e2.x,r=i2.y-e2.y;this.down&&Math.hypot(i2.x-this.down.x,i2.y-this.down.y)>zt&&(this.down.moved=true),(s=this.down)!=null&&s.moved&&this.options.navigable&&this.target.panBy(o,r,!this.tracksPointer(t2.pointerType)),this.samples.push({x:i2.x,y:i2.y,t:t2.timeStamp});const a=t2.timeStamp-Jt;for(;this.samples.length>2&&this.samples[0].t<a;)this.samples.shift()}else if(this.pointers.size===2&&this.pinch&&this.options.navigable){const o=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(o.distance/this.pinch.distance,o.mid,false),this.target.panBy(o.mid.x-this.pinch.mid.x,o.mid.y-this.pinch.mid.y,false),this.pinch=o}});h(this,"onPointerUp",t2=>{var d,l,f,m,c,u;if(!this.pointers.has(t2.pointerId))return;if(this.pointers.delete(t2.pointerId),(l=(d=this.element).releasePointerCapture)==null||l.call(d,t2.pointerId),this.pointers.size===1){this.pinch=null;const[p]=this.pointers.values();this.samples=[{...p,t:t2.timeStamp}];return}if(this.pointers.size>0)return;const e2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!e2)return;const i2=this.local(t2);if(!e2.moved&&t2.type==="pointerup"&&t2.timeStamp-e2.t<tt){if((m=(f=this.target).dismiss)!=null&&m.call(f)){this.lastTap=null;return}if(et(t2.pointerType,this.penHovers)){const p=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&p&&t2.timeStamp-p.t<tt&&Math.hypot(i2.x-p.x,i2.y-p.y)<Ut?(this.lastTap=null,this.zoomIn(i2)):this.lastTap={x:i2.x,y:i2.y,t:t2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?t2.shiftKey?this.target.zoomBy(1/z,i2,true):this.zoomIn(i2):(u=(c=this.target).tap)==null||u.call(c,i2);return}if(!this.options.navigable||!this.tracksPointer(t2.pointerType))return;const o=this.samples[0],r=this.samples[this.samples.length-1],a=((r==null?void 0:r.t)??0)-((o==null?void 0:o.t)??0);if(o&&r&&a>0&&t2.timeStamp-r.t<50){const p=(r.x-o.x)/a*1e3,y=(r.y-o.y)/a*1e3,g=this.options.flickMomentum;g>0&&Math.hypot(p,y)>this.options.flickMinSpeed&&this.target.panBy(p*g,y*g,true)}});h(this,"onDoubleClick",t2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||et(this.lastPointerType,this.penHovers)||J(t2.target,this.element)||(t2.shiftKey?this.target.zoomBy(1/z,this.local(t2),true):this.zoomIn(this.local(t2))))});h(this,"onWheel",t2=>{const e2=t2.ctrlKey;if(!this.options.navigable||!e2&&!this.options.scrollToZoom||!e2&&Dt(t2.target,this.element,t2.deltaY))return;t2.preventDefault();const i2=se(t2),s=e2?ee:te;this.target.zoomBy(Math.exp(-i2*s),this.local(t2),!e2)});h(this,"onKeyDown",t2=>{if(t2.target!==this.element||!this.options.navigable||t2.altKey||t2.metaKey||t2.ctrlKey)return;const e2=this.element.getBoundingClientRect(),i2=e2.width*rt*(t2.shiftKey?3:1),s=e2.height*rt*(t2.shiftKey?3:1);switch(t2.key){case"ArrowLeft":this.target.panBy(i2,0,true);break;case"ArrowRight":this.target.panBy(-i2,0,true);break;case"ArrowUp":this.target.panBy(0,s,true);break;case"ArrowDown":this.target.panBy(0,-s,true);break;case"+":case"=":this.target.zoomBy(ot,void 0,true);break;case"-":case"_":this.target.zoomBy(1/ot,void 0,true);break;case"0":this.target.home();break;case"r":this.target.rotateBy(90);break;case"R":this.target.rotateBy(-90);break;default:return}t2.preventDefault()});this.element=t,this.target=e,this.options=i,t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointermove",this.onPointerMove),t.addEventListener("pointerup",this.onPointerUp),t.addEventListener("pointercancel",this.onPointerUp),t.addEventListener("dblclick",this.onDoubleClick),t.addEventListener("wheel",this.onWheel,{passive:false}),t.addEventListener("keydown",this.onKeyDown)}setOptions(t){this.options=t}dispose(){const t=this.element;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("pointercancel",this.onPointerUp),t.removeEventListener("dblclick",this.onDoubleClick),t.removeEventListener("wheel",this.onWheel),t.removeEventListener("keydown",this.onKeyDown)}local(t){const e=this.element.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}zoomIn(t){var e,i;(i=(e=this.target).atMaxZoom)!=null&&i.call(e)?this.target.home():this.target.zoomBy(z,t,true)}tracksPointer(t){return t==="touch"||this.options.flickEnabled}pinchState(){const[t,e]=[...this.pointers.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),mid:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}}function se(n){return n.deltaMode===1?n.deltaY*16:n.deltaMode===2?n.deltaY*400:n.deltaY}class wt extends Error{constructor(t,e,i){super(t),this.url=e,this.status=i,this.name="ImageLoadError"}}const at=new Set;async function ne(n,t={}){const{signal:e,maxTextureSize:i,request:s}=t,o=Wt(s),r=re(n);if(typeof createImageBitmap!="function"||typeof fetch!="function")return U(n,{signal:e,cors:true,withCredentials:o});if(r&&at.has(r))return U(n,{signal:e,cors:false,withCredentials:o});let a;try{a=await Ft(s,n,{mode:"cors",signal:e})}catch(c){if(ae(c,e))throw c;const u=await U(n,{signal:e,cors:false,withCredentials:o});return r&&at.add(r),u}if(!a.ok)throw new wt(`Image request failed with ${a.status}`,n,a.status);const d=await a.blob();let l=await oe(d);const f=l.width,m=l.height;if(i&&(l.width>i||l.height>i)){const c=i/Math.max(l.width,l.height),u=await createImageBitmap(l,{resizeWidth:Math.max(1,Math.floor(l.width*c)),resizeHeight:Math.max(1,Math.floor(l.height*c)),resizeQuality:"high"});l.close(),l=u}if(e!=null&&e.aborted)throw l.close(),G();return{kind:"bitmap",source:l,width:l.width,height:l.height,naturalWidth:f,naturalHeight:m,opaque:false}}async function oe(n){const t={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(n,t)}catch(e){if(e instanceof TypeError)return createImageBitmap(n);throw e}}function U(n,{signal:t,cors:e,withCredentials:i}){return new Promise((s,o)=>{if(t!=null&&t.aborted){o(G());return}const r=new Image;r.decoding="async",e&&(r.crossOrigin=i?"use-credentials":"anonymous");const a=()=>{r.onload=null,r.onerror=null,t==null||t.removeEventListener("abort",d)},d=()=>{a(),r.src="",o(G())};t==null||t.addEventListener("abort",d),r.onload=()=>{a();const l=()=>s({kind:"element",source:r,width:r.naturalWidth,height:r.naturalHeight,naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,opaque:!e});typeof r.decode=="function"?r.decode().then(l,l):l()},r.onerror=()=>{a(),o(new wt("Image failed to load",n))},r.src=n})}function re(n){var t;try{return new URL(n,(t=globalThis.location)==null?void 0:t.href).origin}catch{return null}}function ae(n,t){return!!(t!=null&&t.aborted)||typeof n=="object"&&n!==null&&n.name==="AbortError"}function G(){const n=new Error("Aborted");return n.name="AbortError",n}function ht(n){n.kind==="bitmap"&&n.source.close()}const he=192*1024*1024,ce=6,le=2;class de{constructor(t){h(this,"entries",new Map);h(this,"inFlight",0);h(this,"frame",0);h(this,"bytes",0);h(this,"wanted",[]);h(this,"disposed",false);h(this,"budget");h(this,"maxInFlight");this.options=t,this.budget=t.byteBudget??he,this.maxInFlight=t.maxInFlight??ce}get(t){const e=this.entries.get(t);if((e==null?void 0:e.state)==="ready")return e.lastUsed=this.frame,e.image}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="ready"}failed(t){var e;return((e=this.entries.get(t))==null?void 0:e.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(t,e){var s;const i=this.entries.get(t);(i==null?void 0:i.state)!=="ready"&&((s=i==null?void 0:i.controller)==null||s.abort(),this.entries.set(t,{url:t,state:"ready",image:e,bytes:D(e),lastUsed:this.frame,attempts:0,pinned:false,waiters:(i==null?void 0:i.waiters)??[]}),this.bytes+=D(e),this.flushWaiters(t))}prefetch(t){return Promise.all(t.map(e=>new Promise(i=>{const s=this.entries.get(e.url);if(s&&s.state!=="loading")return i();if(s){s.waiters.push(i);return}this.start({...e,priority:-1},i)}))).then(()=>{})}update(t){if(this.disposed)return;this.frame++;const e=new Set(t.map(i=>i.url));this.wanted=[...t].sort((i,s)=>i.priority-s.priority);for(const i of this.entries.values())i.state==="loading"&&!i.pinned&&!e.has(i.url)&&i.controller&&(i.controller.abort(),this.entries.delete(i.url),this.inFlight--);for(const i of this.wanted){const s=this.entries.get(i.url);s&&(s.lastUsed=this.frame)}this.pump(),this.evict(e)}dispose(){var t;this.disposed=true;for(const e of this.entries.values())(t=e.controller)==null||t.abort(),this.flushWaiters(e.url);this.entries.clear(),this.bytes=0}forEachReady(t){for(const e of this.entries.values())e.state==="ready"&&e.image&&t(e.url,e.image)}pump(){for(const t of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(t.url)||this.start(t)}}start(t,e){const i=new AbortController,s={url:t.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:i,pinned:!!e,waiters:e?[e]:[]};this.entries.set(t.url,s),this.inFlight++,this.attempt(s,t,i,t.url)}attempt(t,e,i,s){t.attempts++,this.options.load(s,i.signal).then(o=>{if(this.disposed||this.entries.get(t.url)!==t){ht(o);return}t.state="ready",t.image=o,t.bytes=D(o),t.controller=void 0,t.pinned=false,this.bytes+=t.bytes,this.settle(t)},o=>{if(!(i.signal.aborted||this.disposed)&&this.entries.get(t.url)===t){if(t.attempts<le&&!ue(o,e)){this.attempt(t,e,i,e.fallbackUrl??e.url);return}t.state="failed",t.controller=void 0,t.pinned=false,this.settle(t)}})}settle(t){this.inFlight--,this.flushWaiters(t.url),this.options.onSettled(),this.pump()}flushWaiters(t){const e=this.entries.get(t);if(!e)return;const i=e.waiters;e.waiters=[],i.forEach(s=>s())}evict(t){if(this.bytes<=this.budget)return;const e=[...this.entries.values()].filter(i=>i.state==="ready"&&!t.has(i.url)).sort((i,s)=>i.lastUsed-s.lastUsed);for(const i of e){if(this.bytes<=this.budget)break;this.entries.delete(i.url),this.bytes-=i.bytes,i.image&&ht(i.image),this.options.onEvict(i.url)}}}function D(n){return n.width*n.height*4}function ue(n,t){if(t.fallbackUrl)return false;const e=n==null?void 0:n.status;return typeof e=="number"&&e>=400&&e<500&&e!==408&&e!==429}const fe=.1;class me{constructor(t,e=s=>requestAnimationFrame(s),i=s=>cancelAnimationFrame(s)){h(this,"handle",0);h(this,"last",0);h(this,"disposed",false);h(this,"frame",t2=>{if(this.handle=0,this.disposed)return;const e2=this.last?Math.min((t2-this.last)/1e3,fe):1/60;this.last=t2,this.tick(e2,t2)?this.invalidate():this.last=0});this.tick=t,this.raf=e,this.caf=i}invalidate(){this.disposed||this.handle||(this.handle=this.raf(this.frame))}drawNow(){this.disposed||(this.handle&&this.caf(this.handle),this.frame(performance.now()))}dispose(){this.disposed=true,this.handle&&this.caf(this.handle),this.handle=0}}const pe=2*1024*1024;function ge(n,t,e=pe){const i=new Set;let s=e,o=false;return{get deferred(){return o},getTile(r){const a=n(r);if(!a||a.kind==="media"||a.opaque||i.has(r)||t(r))return a;const d=a.width*a.height*4;if(i.size>0&&d>s){o=true;return}return s-=d,i.add(r),a}}}function we(n){const t=/^(!)?(\d+(?:\.\d+)?)$/.exec((n==null?void 0:n.trim())??"");if(!t)return null;const e=Number(t[2]);if(e>360)return null;const i=e%360,s=!!t[1];return i||s?{degrees:i,mirror:s}:null}function ye(n,t,e){if(!n)return null;let i=n.trim().replace(/^xywh=/,""),s=false;i.startsWith("pct:")?(s=true,i=i.slice(4)):i.startsWith("pixel:")&&(i=i.slice(6));const o=i.split(",").map(Number);if(o.length!==4||o.some(p=>!Number.isFinite(p)))return null;let[r,a,d,l]=o;s&&(r=r/100*t,a=a/100*e,d=d/100*t,l=l/100*e);const f=Math.max(0,r),m=Math.max(0,a),c=Math.min(t,r+d),u=Math.min(e,a+l);return c<=f||u<=m?null:{x:f,y:m,width:c-f,height:u-m}}const W=512,xe=16e6;function yt(n,t,e){return{width:t,height:e,levels:[{scaleFactor:1,width:t,height:e,tileWidth:t,tileHeight:e,cols:1,rows:1}],tile:s=>({...s,url:n,region:{x:0,y:0,width:t,height:e}})}}function ve(n){const{width:t,height:e}=n,i=[],s=n.regionByPx&&n.sizeByW,o=(c,u,p)=>{const y=Math.ceil(t/c),g=Math.ceil(e/c);return{scaleFactor:c,width:y,height:g,tileWidth:u,tileHeight:p,cols:Math.ceil(y/u),rows:Math.ceil(g/p)}},r=(c,u)=>({scaleFactor:t/c,width:c,height:u,tileWidth:c,tileHeight:u,cols:1,rows:1,whole:true}),a=n.tiles[0];if(a)for(const c of a.scaleFactors)i.push(o(c,a.width,a.height));else if(s)for(let c=1;;c*=2){const u=o(c,W,W);if(i.push(u),u.cols===1&&u.rows===1)break}const d=Math.max(0,...i.map(c=>c.scaleFactor));for(const c of n.sizes){const u=t/c.width;be(n,c.width,c.height)&&u>d+1e-9&&i.push(r(c.width,c.height))}const l=i.reduce((c,u)=>!c||u.scaleFactor>c.scaleFactor?u:c,null);if(l&&l.cols*l.rows>1&&n.sizeByW){const c=Math.max(t,e)/W;i.push(r(Math.ceil(t/c),Math.ceil(e/c)))}(!i.length||!a&&!s&&t*e<=xe)&&(i.some(c=>c.scaleFactor===1)||i.push(r(t,e)));const f=Te(i).sort((c,u)=>u.scaleFactor-c.scaleFactor),m=Ht(n);return{width:t,height:e,levels:f,tile(c){const u=f[c.level],p=u.scaleFactor,y=u.cols===1&&u.rows===1;let g,v,b;if(y)g={x:0,y:0,width:t,height:e},v=u.width,b=u.height;else{const I=Math.round(c.col*u.tileWidth*p),M=Math.round(c.row*u.tileHeight*p);g={x:I,y:M,width:Math.min(Math.round(u.tileWidth*p),t-I),height:Math.min(Math.round(u.tileHeight*p),e-M)},v=Math.ceil(g.width/p),b=Math.ceil(g.height/p)}return{...c,region:g,url:it(n,g,v,b),fallbackUrl:m?it(n,g,v,b,m):void 0}}}}function be(n,t,e){return!(n.maxWidth&&t>n.maxWidth||n.maxHeight&&e>n.maxHeight||n.maxArea&&t*e>n.maxArea)}function Te(n){const t=new Map;for(const e of n){const i=`${e.width}x${e.height}`,s=t.get(i);(!s||s.cols*s.rows<e.cols*e.rows)&&t.set(i,e)}return[...t.values()]}function Me(n,t){const e=n.levels;for(let i=0;i<e.length;i++)if(e[i].scaleFactor<=t*(1+1e-6))return i;return e.length-1}function T(n,t,e){const i=n.levels[t],s=i.tileWidth*i.scaleFactor,o=i.tileHeight*i.scaleFactor,r=Math.max(0,e.x),a=Math.max(0,e.y),d=Math.min(n.width,e.x+e.width),l=Math.min(n.height,e.y+e.height);if(d<=r||l<=a)return[];const f=Math.max(0,Math.floor(r/s)),m=Math.min(i.cols-1,Math.floor((d-1e-9)/s)),c=Math.max(0,Math.floor(a/o)),u=Math.min(i.rows-1,Math.floor((l-1e-9)/o)),p=[];for(let y=c;y<=u;y++)for(let g=f;g<=m;g++)p.push({level:t,col:g,row:y});return p}async function Ee(n,t){if(n.media)return ke(n,n.media);let e=null,i=null;if(n.service)try{e=ve(await Nt(n.service,t.infoOptions))}catch(c){i=c}if(!e){if(!n.url)throw i??new Error("Image has no source");const c=await t.loadStatic(n.url);t.cache.seed(n.url,c),e=yt(n.url,c.naturalWidth,c.naturalHeight)}const s=n.width&&n.height&&n.width>0&&n.height>0?{width:n.width,height:n.height}:{width:e.width,height:e.height},o=ye(n.region,s.width,s.height)??{x:0,y:0,width:s.width,height:s.height},r=e.width/s.width,a=e.height/s.height,d={x:o.x*r,y:o.y*a,width:o.width*r,height:o.height*a},l=we(n.rotation),f=l?Le(d,l):void 0,m={id:n.id,spec:n,pyramid:e,size:s,clip:d,contentClip:o,rect:{x:0,y:0,width:o.width,height:o.height},...f?{turn:f}:{}};return await t.cache.prefetch(T(e,0,d).map(c=>{const u=e.tile(c);return{url:u.url,fallbackUrl:u.fallbackUrl}})),m}const xt="media:";function ke(n,t){var a,d;const e=n.width||((a=n.placement)==null?void 0:a.width)||t.element.videoWidth||1600,i=n.height||((d=n.placement)==null?void 0:d.height)||t.element.videoHeight||900,s=`${xt}${n.id}`,o={width:e,height:i},r={x:0,y:0,width:e,height:i};return{id:n.id,spec:n,pyramid:yt(s,e,i),media:{kind:"media",source:t.element,width:e,height:i,naturalWidth:e,naturalHeight:i},size:o,clip:r,contentClip:r,rect:{...r}}}function Le(n,{degrees:t,mirror:e}){const i=t*Math.PI/180,s=f=>Math.abs(f)<1e-12?0:f,o=s(Math.cos(i)),r=s(Math.sin(i)),a=Math.abs(n.width*o)+Math.abs(n.height*r),d=Math.abs(n.width*r)+Math.abs(n.height*o),l=k(_(a/2,d/2),{a:o,b:r,c:-r,d:o,e:0,f:0},L(e?-1:1,1),_(-(n.x+n.width/2),-(n.y+n.height/2)));return{orient:l,unorient:Pt(l),width:a,height:d}}function vt(n){var t;return((t=n.turn)==null?void 0:t.orient)??_(-n.clip.x,-n.clip.y)}function _e(n,t){const{turn:e,clip:i}=n;if(!e)return{...t,x:i.x+t.x,y:i.y+t.y};const s=gt(e.unorient,t),o=Math.max(s.x,i.x),r=Math.max(s.y,i.y);return{x:o,y:r,width:Math.max(0,Math.min(s.x+s.width,i.x+i.width)-o),height:Math.max(0,Math.min(s.y+s.height,i.y+i.height)-r)}}function Pe(n,t){const{turn:e,clip:i}=n;return e?pt(e.unorient,t):{x:i.x+t.x,y:i.y+t.y}}function ct(n){const{turn:t,clip:e,contentClip:i}=n;return t?{width:t.width*i.width/e.width,height:t.height*i.height/e.height}:i}function Ie(n){if(!n.length)return null;if(n.every(i=>i.spec.placement)){for(const i of n)i.rect={...i.spec.placement};return mt(n.map(i=>i.rect))}const t=ct(n[0]).height;let e=0;for(const i of n){const s=ct(i),o=s.width*t/s.height;i.rect={x:e,y:0,width:o,height:t},e+=o}return{x:0,y:0,width:e,height:t}}function B(n){const t=n.turn??n.clip;return{x:n.rect.width/t.width,y:n.rect.height/t.height}}function Ae(n){const t=B(n);return k(_(n.rect.x,n.rect.y),L(t.x,t.y),vt(n))}function Se(n,t){var e,i;return n.service===t.service&&n.url===t.url&&n.width===t.width&&n.height===t.height&&n.region===t.region&&n.rotation===t.rotation&&((e=n.media)==null?void 0:e.element)===((i=t.media)==null?void 0:i.element)&&JSON.stringify(n.placement)===JSON.stringify(t.placement)}const Re=1e7,Be=15e6,Oe=2e7,Ce=2;function ze(n){const{items:t,camera:e,viewport:i,pixelRatio:s,getTile:o,destination:r}=n,a=Rt(e,i),d=[],l=[],f=[],m=(c,u,p)=>{const y=c.tile(u);l.push({url:y.url,fallbackUrl:y.fallbackUrl,priority:p})};for(const c of t){const{pyramid:u,clip:p,rect:y}=c,g=B(c);if(n.wantOverview)for(const w of T(u,0,p))m(u,w,Oe);const v=lt(c,e,i,s),b=r?lt(c,r,i,s):v;if(f.push((v==null?void 0:v.target)??-1),!v&&!b)continue;const I=w=>x=>{const P=u.tile(x).region;return Math.hypot(P.x+P.width/2-w.x,P.y+P.height/2-w.y)};if(b){const w=I(b.center);for(const x of T(u,0,b.area))m(u,x,w(x)/1e3);if(b.target>0)for(const x of T(u,b.target,b.area))m(u,x,Re+w(x))}if(!v)continue;const{area:M,target:E}=v,K=I(v.center),O=T(u,0,M),V=E===0?[]:T(u,E,M);if(b!==v){for(const x of O)m(u,x,K(x)/1e3);const w=E-Ce;if(w>0)for(const x of T(u,w,M))m(u,x,Be+K(x))}if(c.spec.hidden)continue;const bt=(E===0?O:V).every(w=>o(u.tile(w).url)!==void 0)?[E]:Array.from({length:E+1},(w,x)=>x),Tt=k(a,_(y.x,y.y),L(g.x,g.y),vt(c));for(const w of bt){const x=w===0?O:w===E?V:T(u,w,M),P=u.levels[w].cols*u.levels[w].rows>1;for(const Mt of x){const C=u.tile(Mt),q=o(C.url);if(!q)continue;const Y=Ue(c,C.region,q,Tt,P);Y&&d.push({...Y,url:C.url})}}}return l.sort((c,u)=>c.priority-u.priority),{draws:d,wants:De(l),levels:f}}function lt(n,t,e,i){const{pyramid:s,rect:o}=n,r=N(t,e);if(!It(r,o))return null;const a=B(n),d=Math.max(r.x,o.x),l=Math.max(r.y,o.y),f=Math.min(r.x+r.width,o.x+o.width),m=Math.min(r.y+r.height,o.y+o.height),c=1/(a.x*t.zoom*i);return{area:_e(n,{x:(d-o.x)/a.x,y:(l-o.y)/a.y,width:(f-d)/a.x,height:(m-l)/a.y}),center:Pe(n,{x:(t.x-o.x)/a.x,y:(t.y-o.y)/a.y}),target:Me(s,c)}}function Ue(n,t,e,i,s){const{clip:o}=n,r=Math.max(t.x,o.x),a=Math.max(t.y,o.y),d=Math.min(t.x+t.width,o.x+o.width),l=Math.min(t.y+t.height,o.y+o.height);if(d<=r||l<=a)return null;const f=e.width/t.width,m=e.height/t.height,c=1e-6;return{item:n,image:e,transform:k(i,_(t.x,t.y),L(1/f,1/m)),crop:{x:(r-t.x)*f,y:(a-t.y)*m,width:(d-r)*f,height:(l-a)*m},bleed:{right:s&&d<o.x+o.width-c,bottom:s&&l<o.y+o.height-c}}}function De(n){const t=new Set;return n.filter(e=>t.has(e.url)?false:(t.add(e.url),true))}const We={maxZoomPixelRatio:1.1,minZoomImageRatio:.9,upscale:true,animationTime:.09,animationDuration:void 0,springStiffness:6.5,constrainDuringPan:true,request:void 0,byteBudget:192*1024*1024,maxInFlight:6,releaseAfterMs:2e3},Fe=2,He=3,Ne=.1,F=1e-6,X={top:0,right:0,bottom:0,left:0};function dt(n,t="padding"){if(!n||typeof getComputedStyle!="function")return X;const e=getComputedStyle(n),i=s=>parseFloat(e.getPropertyValue(`${t}-${s}`))||0;return{top:i("top"),right:i("right"),bottom:i("bottom"),left:i("left")}}const Ze=(n,t)=>n.top===t.top&&n.right===t.right&&n.bottom===t.bottom&&n.left===t.left;let Ge;class Xe{constructor(t,e={}){h(this,"host");h(this,"overlays",null);h(this,"options");h(this,"backend",null);h(this,"backendPreference");h(this,"contextLosses",0);h(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});h(this,"visible",true);h(this,"dom",null);h(this,"domAsked",false);h(this,"pending",null);h(this,"camera");h(this,"loop");h(this,"gestures");h(this,"gestureOptions",{});h(this,"cache");h(this,"navigator",null);h(this,"navigatorAsked",0);h(this,"viewport",{width:1,height:1});h(this,"inset",X);h(this,"pixelRatio",1);h(this,"items",[]);h(this,"worldBounds",null);h(this,"contentVersion",0);h(this,"opaqueUrls",new Set);h(this,"mediaByKey",new Map);h(this,"detachMedia",[]);h(this,"opened",false);h(this,"atHome",true);h(this,"interacting",false);h(this,"lastEmitted",null);h(this,"generation",0);h(this,"listeners",new Map);h(this,"unloadable",false);h(this,"resizeObserver",null);h(this,"intersectionObserver",null);h(this,"releaseTimer",null);h(this,"dprQuery",null);h(this,"disposed",false);h(this,"dismisser",null);h(this,"tick",t2=>{var d,l;if(this.disposed)return false;const e2=this.camera.step(t2,this.viewport),i2=this.camera.current,s2=this.backend,o=ge(this.getTile,f=>s2?s2.has(f):true),r=ze({items:this.items,camera:i2,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:o.getTile,wantOverview:!!this.navigator,destination:e2?this.camera.destination:void 0}),a=r.wants.filter(f=>!f.url.startsWith(xt));return this.cache.update(a),r.draws.length?this.setUnloadable(false):a.length&&a.every(f=>this.cache.failed(f.url))&&this.setUnloadable(true),this.paint(r.draws),(d=this.overlays)==null||d.position(i2,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(f=>!f.spec.hidden),this.worldBounds,N(i2,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!j(this.lastEmitted,i2))&&(this.lastEmitted={...i2},this.opened&&this.emit("viewport")),e2||o.deferred});h(this,"getTile",t2=>this.mediaByKey.get(t2)??this.cache.get(t2));h(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});h(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=t,this.backendPreference=e.backend??"auto",this.options={...We,...H(e)},ft()&&(this.options.animationTime=0,this.options.animationDuration!==void 0&&(this.options.animationDuration=0));const{animationDuration:i,springStiffness:s}=this.options;this.camera=new jt({x:0,y:0,zoom:1,rotation:0},this.options.animationTime,i===void 0?void 0:{duration:i,stiffness:s}),this.loop=new me(this.tick),this.gestureOptions=H(e.gestures??{}),ft()&&(this.gestureOptions.flickMomentum=0),this.gestures=new ie(t,this,{...Z,...this.gestureOptions}),this.cache=new de({load:(o,r)=>this.loadTile(o,r),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:o=>{var r;return(r=this.backend)==null?void 0:r.release(o)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=Ke(t),this.visible?this.acquireBackend():this.holder.hiddenSince=ut(),this.measure(),this.observe()}get backendKind(){var t;return((t=this.backend)==null?void 0:t.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(t,e){let i=this.listeners.get(t);return i||(i=new Set,this.listeners.set(t,i)),i.add(e),()=>i==null?void 0:i.delete(e)}async setImages(t,{world:e,fit:i=false}={}){const s=++this.generation,o=new Map(this.items.map(f=>[f.id,f])),r=await Promise.allSettled(t.map(f=>{const m=o.get(f.id);return m&&Se(m.spec,f)?(m.spec=f,Promise.resolve(m)):Ee(f,{cache:this.cache,loadStatic:c=>this.loadTile(c),infoOptions:{request:this.options.request}})}));if(s!==this.generation||this.disposed)return;const a=r.filter(f=>f.status==="fulfilled").map(f=>f.value),d=r.filter(f=>f.status==="rejected").map(f=>f.reason);this.items=a,this.watchMedia(a);const l=Ie(a);if(this.worldBounds=e?l?mt([e,l]):e:l,this.contentVersion++,d.length&&this.emit("error",d),this.setUnloadable(t.length>0&&!a.length&&d.length>0),!this.worldBounds){this.invalidate();return}this.opened?i?(this.home(true),this.emit("change")):(this.camera.set(this.constrain(this.camera.current)),this.emit("change")):(this.opened=true,this.home(true),this.emit("open")),this.invalidate()}clear(){this.setUnloadable(false),this.generation++,this.items=[],this.watchMedia([]),this.worldBounds=null,this.contentVersion++,this.invalidate()}setHidden(t){const e=new Set(t);let i=false;for(const s of this.items){const o=e.has(s.id);!!s.spec.hidden!==o&&(s.spec={...s.spec,hidden:o},i=true)}i&&this.invalidate()}isReady(t){const e=this.items.find(s=>s.id===t);if(!e)return false;if(e.spec.media)return true;const i=e.pyramid.levels[0];if(!i)return false;for(let s=0;s<i.rows;s++)for(let o=0;o<i.cols;o++)if(!this.getTile(e.pyramid.tile({level:0,col:o,row:s}).url))return false;return true}fitBounds(t,e=false,i=X){const s=this.fit(t,this.camera.destination.rotation,i);this.atHome=false,this.animateTo(this.constrain(s,{allowBeyondLimits:true}),e)}fit(t,e,{top:i,right:s,bottom:o,left:r},a=1/0){const{width:d,height:l}=this.viewport,f=Bt(t,{width:Math.max(1,d-r-s),height:Math.max(1,l-i-o)},e),m=Math.min(f.zoom,a);return{...S(At(t),{x:(d+r-s)/2,y:(l+i-o)/2},m,e,this.viewport),zoom:m,rotation:e}}fitItemRect(t,e,i=false){const s=this.itemRectToWorld(t,e);s&&this.fitAnnotation(s,i)}fitAnnotation(t,e=false){var o;const i=this.items[0];if(!i)return;const s=i.rect.width*Ne;this.fitBounds({x:t.x-s,y:t.y-s,width:t.width+s*2,height:t.height+s*2},e,dt((o=this.overlays)==null?void 0:o.container,"scroll-padding"))}getBounds(){return N(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var e;const t=((e=this.homeCamera())==null?void 0:e.zoom)??1;return{home:t,min:t*this.options.minZoomImageRatio,max:Math.max(t,this.closestZoom())}}closestZoom(){const t=this.items.length?Math.min(...this.items.map(e=>B(e).x)):1;return this.options.maxZoomPixelRatio/t}home(t=false){const e=this.homeCamera();if(!e)return;const i=this.atHome;this.atHome=true,this.animateTo(e,t),!i&&this.opened&&this.emit("viewport")}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-F)}viewLimits(){const{zoom:t,x:e,y:i,rotation:s}=this.camera.destination,{min:o,max:r}=this.getZoomLimits(),a=this.atHome?this.homeCamera():null;return{atMax:t>=r*(1-F),atMin:t<=o*(1+F),atHome:this.atHome&&(!a||Math.abs(t/a.zoom-1)<.001&&Math.hypot(e-a.x,i-a.y)*t<.5&&Math.abs(s-a.rotation)<.001)}}zoomBy(t,e,i=true){const s=i?this.camera.destination:this.camera.current,o=e??{x:this.viewport.width/2,y:this.viewport.height/2},r=Q(s,this.viewport,o),{min:a,max:d}=this.getZoomLimits(),l=A(s.zoom*t,a,d),f=S(r,o,l,s.rotation,this.viewport),m=this.constrain({...s,...f,zoom:l});this.atHome=false,i?this.camera.animateTo({state:m,anchor:{world:r,screen:o}},this.viewport):this.camera.set(m),this.invalidate()}panBy(t,e,i=false){const s=i?this.camera.destination:this.camera.current,o=pt(k(L(1/s.zoom),St(-s.rotation)),{x:t,y:e}),r=this.constrain({...s,x:s.x-o.x,y:s.y-o.y});this.atHome=false,i?this.camera.animateTo({state:r},this.viewport):this.camera.set(r),this.invalidate()}panTo(t,e=false){const i=e?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...i,...t}),e)}rotateBy(t){const e=this.camera.destination;this.setRotation(e.rotation*180/Math.PI+t)}setRotation(t,e=false){const i=this.camera.destination,s=t*Math.PI/180;this.animateTo(this.constrain({...i,rotation:s}),e)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(t){this.emit("tap",t)}setDismiss(t){this.dismisser=t}dismiss(){var t;return((t=this.dismisser)==null?void 0:t.call(this))??false}setGestures(t){this.gestures.setOptions({...Z,...this.gestureOptions,...H(t)})}setInteracting(t){if(this.interacting=t,t){this.camera.stop();return}if(this.options.constrainDuringPan)return;const e=this.camera.destination,i=this.constrain(e);j(e,i)||this.animateTo(i,false)}worldToScreenPoint(t){return Ot(this.camera.current,this.viewport,t)}screenToWorldPoint(t){return Q(this.camera.current,this.viewport,t)}itemRectToWorld(t,e){const i=this.items[t];if(!i)return null;const{contentClip:s,clip:o}=i;if(i.turn)return gt(k(Ae(i),L(o.width/s.width,o.height/s.height)),e);const r=i.rect.width/s.width,a=i.rect.height/s.height;return{x:i.rect.x+(e.x-s.x)*r,y:i.rect.y+(e.y-s.y)*a,width:e.width*r,height:e.height*a}}attachNavigator(t){var o;(o=this.navigator)==null||o.dispose(),this.navigator=null;const e=++this.navigatorAsked;let i=null,s=false;return import("./Navigator-D8S66GNd.mjs").then(r=>{s||this.disposed||e!==this.navigatorAsked||(i=new r.Navigator(t,(a,d)=>this.panTo(a,d)),this.navigator=i,this.invalidate())}),()=>{s=true,i==null||i.dispose(),i&&this.navigator===i&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var t,e,i,s,o,r,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(t=this.resizeObserver)==null||t.disconnect(),(e=this.intersectionObserver)==null||e.disconnect(),(s=(i=this.dprQuery)==null?void 0:i.removeEventListener)==null||s.call(i,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(o=this.navigator)==null||o.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(r=this.dom)==null||r.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(d=>d()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}watchMedia(t){this.detachMedia.forEach(e=>e()),this.detachMedia=[],this.mediaByKey.clear();for(const e of t){if(!e.media||e.media.kind!=="media")continue;const i=e.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(i,e.media);const s=e.media.source,o=()=>this.invalidate(),r=["play","seeked","loadeddata","resize"];r.forEach(a=>s.addEventListener(a,o)),this.detachMedia.push(()=>r.forEach(a=>s.removeEventListener(a,o)))}}paint(t){const e=this.backend,i=[],s=(e==null?void 0:e.kind)==="webgl2";e==null||e.begin();for(const o of t){const{image:r}=o;if(!(r.kind==="media"||r.kind==="element"&&s&&(r.opaque||this.opaqueUrls.has(o.url)))&&e){if(e.draw({key:o.url,source:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1,bleed:o.bleed})!=="tainted"||r.kind==="bitmap")continue;this.opaqueUrls.add(o.url)}(r.kind==="element"||r.kind==="media")&&i.push({key:`${o.item.id}|${o.url}`,element:r.source,width:r.width,height:r.height,transform:o.transform,crop:o.crop,opacity:1})}e==null||e.end(),this.dom?this.dom.sync(i):i.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-CyfXsLu_.mjs").then(({DomLayers:o})=>{if(this.disposed)return;const r=new o(this.host);this.overlays&&this.host.insertBefore(r.container,this.overlays.container),this.dom=r,this.invalidate()}))}loadTile(t,e){return ne(t,{signal:e,request:this.options.request,maxTextureSize:this.backend instanceof R?this.backend.maxTextureSize:void 0})}animateTo(t,e){this.camera.animateTo({state:t},this.viewport,e),this.invalidate()}homeCamera(){if(!this.worldBounds)return null;const t=2*Math.PI,e=Math.round(this.camera.destination.rotation/t)*t||0;return this.fit(this.worldBounds,e,this.inset,this.options.upscale?1/0:this.closestZoom())}constrain(t,{allowBeyondLimits:e=false}={}){const i=this.worldBounds;if(!i)return t;const{min:s,max:o}=this.getZoomLimits(),r=e?A(t.zoom,s,Math.max(o,t.zoom)):A(t.zoom,s,o);return this.interacting&&!this.options.constrainDuringPan?{...t,zoom:r}:{...t,zoom:r,x:A(t.x,i.x,i.x+i.width),y:A(t.y,i.y,i.y+i.height)}}acquireBackend(t=true){var o,r;if(this.backend||this.pending||this.disposed)return;const e=document.createElement("canvas");e.className="clover-canvas-surface",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(e,((o=this.dom)==null?void 0:o.container)??((r=this.overlays)==null?void 0:r.container)??null);const i=t&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<He);let s=null;i&&(Lt(this.holder)||this.backendPreference==="webgl2")&&(s=R.create(e,{onLost:this.onContextLost}),s||$(this.holder)),s?this.install(s):this.backendPreference==="webgl2"?this.none(e):(this.pending=e,(Ge??(Ge=import("./Canvas2DBackend-D5Mgo0QW.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==e)return;this.pending=null;const d=a.create(e);d?this.install(d):this.none(e)}))}none(t){t.remove(),this.host.dataset.backend="none"}install(t){this.backend=t,this.host.dataset.backend=t.kind,t.resize(this.viewport.width,this.viewport.height,this.pixelRatio),t.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",t.kind),this.invalidate()}releaseBackend(){var e;if($(this.holder),(e=this.pending)==null||e.remove(),this.pending=null,!this.backend)return;const t=this.backend.canvas;this.backend.dispose(),t.remove(),this.backend=null}giveBack(){this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.releaseBackend(),this.host.dataset.backend="released"}observe(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>this.measure(true)),this.resizeObserver.observe(this.host)),typeof IntersectionObserver<"u"&&(this.intersectionObserver=new IntersectionObserver(t=>{const e=t.some(i=>i.isIntersecting);this.setVisible(e)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(t){var e;if(this.visible=t,t){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(e=this.holder).hiddenSince??(e.hiddenSince=ut()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(t=false){var d;const e=this.host.getBoundingClientRect(),i=Math.max(1,e.width),s=Math.max(1,e.height),o=dt(this.host),r=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Fe);if(i===this.viewport.width&&s===this.viewport.height&&r===this.pixelRatio&&Ze(o,this.inset))return;const a=this.viewport;if(this.viewport={width:i,height:s},this.inset=o,this.pixelRatio=r,(d=this.backend)==null||d.resize(i,s,r),this.opened){if(this.atHome)this.home(true);else{const l=this.camera.current,f=i/Math.max(a.width,1);this.camera.set(this.constrain({...l,zoom:l.zoom*f}))}this.emit("viewport")}t?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var t,e,i,s;typeof window>"u"||typeof window.matchMedia!="function"||((e=(t=this.dprQuery)==null?void 0:t.removeEventListener)==null||e.call(t,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(s=(i=this.dprQuery).addEventListener)==null||s.call(i,"change",this.onPixelRatioChange))}setUnloadable(t){t!==this.unloadable&&(this.unloadable=t,this.emit("unloadable",t))}emit(t,e){var i;(i=this.listeners.get(t))==null||i.forEach(s=>s(e))}}const ut=()=>typeof performance<"u"?performance.now():Date.now();function Ke(n){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:t,left:e,width:i,height:s}=n.getBoundingClientRect();return t+s>=0&&e+i>=0&&t<=window.innerHeight&&e<=window.innerWidth}function ft(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function H(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}const ii=(n,t)=>new Xe(n,t);export{Gt as b,Zt as h,ze as p,ii as r};
@@ -1 +1 @@
1
- import{u as c,A as l,x as u,aH as p,_ as d,k as m}from"./shared-BTZk52xk.mjs";import"./styles-BdBFz9SS.mjs";const f=new WeakMap;function v(t){let n=f.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:r=>c(y,{...r,render:o})},f.set(t,n)}return n}function b(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(v)}function y({render:t,canvases:n,bodies:o,children:r}){const a=l(null),i=u(p);return d(()=>{const e=a.current;if(!e)return;const s=t(e,{canvases:n,bodies:o,clover:i});return()=>{typeof s=="function"&&s(),e.replaceChildren()}},[t,n,o,i]),c(m,{children:[c("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),r&&c("div",{className:"clover-canvas-controls",children:r})]})}export{b as toRenderers};
1
+ import{u as c,A as l,x as u,aH as p,_ as d,k as m}from"./shared-9sToDP5G.mjs";import"./styles-Di6TZHyP.mjs";const f=new WeakMap;function v(t){let n=f.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:r=>c(y,{...r,render:o})},f.set(t,n)}return n}function b(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(v)}function y({render:t,canvases:n,bodies:o,children:r}){const a=l(null),i=u(p);return d(()=>{const e=a.current;if(!e)return;const s=t(e,{canvases:n,bodies:o,clover:i});return()=>{typeof s=="function"&&s(),e.replaceChildren()}},[t,n,o,i]),c(m,{children:[c("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),r&&c("div",{className:"clover-canvas-controls",children:r})]})}export{b as toRenderers};
@@ -1 +1 @@
1
- import{x as n,a2 as o,Q as r}from"./shared-BTZk52xk.mjs";const t=(s,a)=>a==="canvas"?o(s.manifest,s.canvasId):s.manifest,e=r(null),i=()=>n(e);export{e as P,t as r,i as u};
1
+ import{x as n,a2 as o,Q as r}from"./shared-9sToDP5G.mjs";const t=(s,a)=>a==="canvas"?o(s.manifest,s.canvasId):s.manifest,e=r(null),i=()=>n(e);export{e as P,t as r,i as u};
@@ -1 +1 @@
1
- import{a4 as a}from"./shared-BTZk52xk.mjs";function c(t){try{const o=new URL(t).pathname.split("/").filter(Boolean).pop();return o?decodeURIComponent(o):"download"}catch{return"download"}}async function i(t,o){try{const r=await a(o,t,{referrerPolicy:"no-referrer"});if(!r.ok)return false;const n=URL.createObjectURL(await r.blob()),e=document.createElement("a");return e.href=n,e.download=c(t),document.body.append(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4),true}catch{return false}}export{c as fileName,i as saveFile};
1
+ import{a4 as a}from"./shared-9sToDP5G.mjs";function c(t){try{const o=new URL(t).pathname.split("/").filter(Boolean).pop();return o?decodeURIComponent(o):"download"}catch{return"download"}}async function i(t,o){try{const r=await a(o,t,{referrerPolicy:"no-referrer"});if(!r.ok)return false;const n=URL.createObjectURL(await r.blob()),e=document.createElement("a");return e.href=n,e.download=c(t),document.body.append(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4),true}catch{return false}}export{c as fileName,i as saveFile};
@@ -1 +1 @@
1
- import{aC as w,U as f,ad as x,W as S}from"./shared-BTZk52xk.mjs";const A=10;async function R(r,t,s,o,e){var n,d;const i=(n=r.get().manifest)==null?void 0:n.id;try{const{hits:c,set:u}=await b(t,s,{request:o,signal:e});if(e.aborted||((d=r.get().manifest)==null?void 0:d.id)!==i)return;r.set({search:{query:s,status:"ready",hits:c,set:u}})}catch{if(e.aborted)return;r.set({search:{query:s,status:"error",hits:[],set:null}})}}async function b(r,t,{request:s,signal:o}={}){const e=new URL(r.id);e.searchParams.set("q",t);const i=[];let n=e.toString();const d=new Set;for(;n&&i.length<A&&!d.has(n);){d.add(n);const c=await w(s,n,o);i.push(c),n=$(c)}return E(i,t)}function T(r){var e;const t=f(r)[0];if(typeof t=="string"||!t)return t;const s=t.full??t["@id"],o=(e=f(t.selector)[0])==null?void 0:e.value;return typeof o=="string"&&typeof s=="string"?`${s}#${o}`:s}function $(r){var o;const t=r.next??((o=r.within)==null?void 0:o.next),s=typeof t=="string"?t:(t==null?void 0:t.id)??(t==null?void 0:t["@id"]);return typeof s=="string"?s:null}function E(r,t){var e,i;const s=[],o=[];for(const n of r){const d=Array.isArray(n.resources),c=d?n.resources:f(n.items),u=new Map;for(const a of c){const p=a.id??a["@id"],m=d?T(a.on):f(a.target)[0],v=x(m);if(!p||!v.id)continue;const y=d?(e=a.resource)==null?void 0:e.chars:f(a.body).map(l=>l==null?void 0:l.value).find(l=>typeof l=="string"),I={id:p,setId:S,canvasId:v.id,target:v,motivation:["highlighting"],bodies:[{value:String(y??t)}],annotation:{id:p,type:"Annotation",motivation:["highlighting"],body:{type:"TextualBody",value:String(y??t)},target:m}};u.set(p,I),s.push(I)}const g=d?H(n,u):M(n,u),h=new Set(g.flatMap(a=>a.entryIds));o.push(...g);for(const a of u.values())h.has(a.id)||o.push({id:a.id,canvasId:a.canvasId,entryIds:[a.id],match:((i=a.bodies[0])==null?void 0:i.value)??t})}return{query:t,hits:o,set:{id:S,label:{none:[t]},source:"search",entries:s}}}function H(r,t){var o;const s=[];for(const e of f(r.hits)){const i=f(e.annotations).filter(n=>t.has(n));i.length&&s.push({id:i.join(" "),canvasId:t.get(i[0]).canvasId,entryIds:i,before:e.before,match:String(e.match??((o=t.get(i[0]).bodies[0])==null?void 0:o.value)??""),after:e.after})}return s}function M(r,t){var o,e;const s=[];for(const i of f(r.annotations))for(const n of f(i==null?void 0:i.items))if(f(n==null?void 0:n.motivation).includes("contextualizing"))for(const c of f(n.target)){const u=typeof(c==null?void 0:c.source)=="string"?c.source:(o=c==null?void 0:c.source)==null?void 0:o.id,g=u?t.get(u):void 0;if(!g)continue;const h=f(c.selector).find(a=>(a==null?void 0:a.type)==="TextQuoteSelector");s.push({id:`${n.id??u}#${u}`,canvasId:g.canvasId,entryIds:[g.id],before:h==null?void 0:h.prefix,match:String((h==null?void 0:h.exact)??((e=g.bodies[0])==null?void 0:e.value)??""),after:h==null?void 0:h.suffix})}return s}export{E as readResults,b as search,R as searchInto};
1
+ import{aC as w,U as f,ad as x,W as S}from"./shared-9sToDP5G.mjs";const A=10;async function R(r,t,s,o,e){var n,d;const i=(n=r.get().manifest)==null?void 0:n.id;try{const{hits:c,set:u}=await b(t,s,{request:o,signal:e});if(e.aborted||((d=r.get().manifest)==null?void 0:d.id)!==i)return;r.set({search:{query:s,status:"ready",hits:c,set:u}})}catch{if(e.aborted)return;r.set({search:{query:s,status:"error",hits:[],set:null}})}}async function b(r,t,{request:s,signal:o}={}){const e=new URL(r.id);e.searchParams.set("q",t);const i=[];let n=e.toString();const d=new Set;for(;n&&i.length<A&&!d.has(n);){d.add(n);const c=await w(s,n,o);i.push(c),n=$(c)}return E(i,t)}function T(r){var e;const t=f(r)[0];if(typeof t=="string"||!t)return t;const s=t.full??t["@id"],o=(e=f(t.selector)[0])==null?void 0:e.value;return typeof o=="string"&&typeof s=="string"?`${s}#${o}`:s}function $(r){var o;const t=r.next??((o=r.within)==null?void 0:o.next),s=typeof t=="string"?t:(t==null?void 0:t.id)??(t==null?void 0:t["@id"]);return typeof s=="string"?s:null}function E(r,t){var e,i;const s=[],o=[];for(const n of r){const d=Array.isArray(n.resources),c=d?n.resources:f(n.items),u=new Map;for(const a of c){const p=a.id??a["@id"],m=d?T(a.on):f(a.target)[0],v=x(m);if(!p||!v.id)continue;const y=d?(e=a.resource)==null?void 0:e.chars:f(a.body).map(l=>l==null?void 0:l.value).find(l=>typeof l=="string"),I={id:p,setId:S,canvasId:v.id,target:v,motivation:["highlighting"],bodies:[{value:String(y??t)}],annotation:{id:p,type:"Annotation",motivation:["highlighting"],body:{type:"TextualBody",value:String(y??t)},target:m}};u.set(p,I),s.push(I)}const g=d?H(n,u):M(n,u),h=new Set(g.flatMap(a=>a.entryIds));o.push(...g);for(const a of u.values())h.has(a.id)||o.push({id:a.id,canvasId:a.canvasId,entryIds:[a.id],match:((i=a.bodies[0])==null?void 0:i.value)??t})}return{query:t,hits:o,set:{id:S,label:{none:[t]},source:"search",entries:s}}}function H(r,t){var o;const s=[];for(const e of f(r.hits)){const i=f(e.annotations).filter(n=>t.has(n));i.length&&s.push({id:i.join(" "),canvasId:t.get(i[0]).canvasId,entryIds:i,before:e.before,match:String(e.match??((o=t.get(i[0]).bodies[0])==null?void 0:o.value)??""),after:e.after})}return s}function M(r,t){var o,e;const s=[];for(const i of f(r.annotations))for(const n of f(i==null?void 0:i.items))if(f(n==null?void 0:n.motivation).includes("contextualizing"))for(const c of f(n.target)){const u=typeof(c==null?void 0:c.source)=="string"?c.source:(o=c==null?void 0:c.source)==null?void 0:o.id,g=u?t.get(u):void 0;if(!g)continue;const h=f(c.selector).find(a=>(a==null?void 0:a.type)==="TextQuoteSelector");s.push({id:`${n.id??u}#${u}`,canvasId:g.canvasId,entryIds:[g.id],before:h==null?void 0:h.prefix,match:String((h==null?void 0:h.exact)??((e=g.bodies[0])==null?void 0:e.value)??""),after:h==null?void 0:h.suffix})}return s}export{E as readResults,b as search,R as searchInto};