@internetarchive/bookreader 5.0.0-11 → 5.0.0-111

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 (381) hide show
  1. package/BookReader/474.js +2 -0
  2. package/BookReader/474.js.map +1 -0
  3. package/BookReader/BookReader.css +649 -1225
  4. package/BookReader/BookReader.js +1 -1
  5. package/BookReader/BookReader.js.LICENSE.txt +20 -20
  6. package/BookReader/BookReader.js.map +1 -1
  7. package/BookReader/bergamot-translator-worker.js +2966 -0
  8. package/BookReader/bergamot-translator-worker.wasm +0 -0
  9. package/BookReader/hypothesis/LICENSE +50 -0
  10. package/BookReader/hypothesis/README.md +55 -0
  11. package/BookReader/hypothesis/build/boot.js +1 -0
  12. package/BookReader/hypothesis/build/manifest.json +20 -0
  13. package/BookReader/hypothesis/build/scripts/annotator.bundle.js +184 -0
  14. package/BookReader/hypothesis/build/scripts/annotator.bundle.js.map +1 -0
  15. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js +798 -0
  16. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js.map +1 -0
  17. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js +711 -0
  18. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js.map +1 -0
  19. package/BookReader/hypothesis/build/styles/annotator.css +2235 -0
  20. package/BookReader/hypothesis/build/styles/annotator.css.map +1 -0
  21. package/BookReader/hypothesis/build/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  22. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  23. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  24. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  25. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  26. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
  27. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  28. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
  29. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
  30. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  31. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
  32. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  33. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  34. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  35. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
  36. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  37. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  38. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  39. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  40. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  41. package/BookReader/hypothesis/build/styles/highlights.css +2 -0
  42. package/BookReader/hypothesis/build/styles/highlights.css.map +1 -0
  43. package/BookReader/hypothesis/build/styles/katex.min.css +2 -0
  44. package/BookReader/hypothesis/build/styles/katex.min.css.map +1 -0
  45. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css +2 -0
  46. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css.map +1 -0
  47. package/BookReader/hypothesis/build/styles/sidebar.css +2731 -0
  48. package/BookReader/hypothesis/build/styles/sidebar.css.map +1 -0
  49. package/BookReader/hypothesis/build/styles/ui-playground.css +2659 -0
  50. package/BookReader/hypothesis/build/styles/ui-playground.css.map +1 -0
  51. package/BookReader/hypothesis/package.json +126 -0
  52. package/BookReader/ia-bookreader-bundle.js +1904 -0
  53. package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +19 -0
  54. package/BookReader/ia-bookreader-bundle.js.map +1 -0
  55. package/BookReader/icons/1up.svg +1 -1
  56. package/BookReader/icons/2up.svg +1 -1
  57. package/BookReader/icons/advance.svg +1 -1
  58. package/BookReader/icons/chevron-right.svg +1 -1
  59. package/BookReader/icons/close-circle-dark.svg +1 -1
  60. package/BookReader/icons/close-circle.svg +1 -1
  61. package/BookReader/icons/fullscreen.svg +1 -1
  62. package/BookReader/icons/fullscreen_exit.svg +1 -1
  63. package/BookReader/icons/hamburger.svg +1 -1
  64. package/BookReader/icons/left-arrow.svg +1 -1
  65. package/BookReader/icons/magnify-minus.svg +1 -1
  66. package/BookReader/icons/magnify-plus.svg +1 -1
  67. package/BookReader/icons/magnify.svg +1 -1
  68. package/BookReader/icons/pause.svg +1 -1
  69. package/BookReader/icons/play.svg +1 -1
  70. package/BookReader/icons/playback-speed.svg +1 -1
  71. package/BookReader/icons/read-aloud.svg +1 -1
  72. package/BookReader/icons/review.svg +1 -1
  73. package/BookReader/icons/slider-toggle.svg +1 -0
  74. package/BookReader/icons/thumbnails.svg +1 -1
  75. package/BookReader/icons/voice.svg +1 -0
  76. package/BookReader/icons/volume-full.svg +1 -1
  77. package/BookReader/images/BRicons.svg +3 -3
  78. package/BookReader/images/books_graphic.svg +1 -1
  79. package/BookReader/images/hypothesis.ico +0 -0
  80. package/BookReader/images/icon_book.svg +1 -1
  81. package/BookReader/images/icon_bookmark.svg +1 -1
  82. package/BookReader/images/icon_experiment.svg +1 -0
  83. package/BookReader/images/icon_gear.svg +1 -1
  84. package/BookReader/images/icon_hamburger.svg +1 -1
  85. package/BookReader/images/icon_home.svg +1 -1
  86. package/BookReader/images/icon_info.svg +1 -1
  87. package/BookReader/images/icon_one_page.svg +1 -1
  88. package/BookReader/images/icon_pause.svg +1 -1
  89. package/BookReader/images/icon_play.svg +1 -1
  90. package/BookReader/images/icon_playback-rate.svg +1 -1
  91. package/BookReader/images/icon_search_button.svg +1 -1
  92. package/BookReader/images/icon_share.svg +1 -1
  93. package/BookReader/images/icon_skip-ahead.svg +1 -1
  94. package/BookReader/images/icon_skip-back.svg +1 -1
  95. package/BookReader/images/icon_speaker.svg +1 -1
  96. package/BookReader/images/icon_speaker_open.svg +1 -1
  97. package/BookReader/images/icon_thumbnails.svg +1 -1
  98. package/BookReader/images/icon_toc.svg +1 -1
  99. package/BookReader/images/icon_two_pages.svg +1 -1
  100. package/BookReader/images/marker_chap-off.svg +1 -1
  101. package/BookReader/images/marker_chap-on.svg +1 -1
  102. package/BookReader/images/marker_srch-on.svg +1 -1
  103. package/BookReader/images/translate.svg +1 -0
  104. package/BookReader/images/unviewable_page.png +0 -0
  105. package/BookReader/jquery-3.js +2 -0
  106. package/BookReader/jquery-3.js.LICENSE.txt +24 -0
  107. package/BookReader/plugins/plugin.archive_analytics.js +1 -1
  108. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  109. package/BookReader/plugins/plugin.autoplay.js +1 -1
  110. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  111. package/BookReader/plugins/plugin.chapters.js +22 -1
  112. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  113. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  114. package/BookReader/plugins/plugin.experiments.js +3 -0
  115. package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
  116. package/BookReader/plugins/plugin.experiments.js.map +1 -0
  117. package/BookReader/plugins/plugin.iframe.js +1 -1
  118. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  119. package/BookReader/plugins/plugin.iiif.js +2 -0
  120. package/BookReader/plugins/plugin.iiif.js.map +1 -0
  121. package/BookReader/plugins/plugin.resume.js +1 -1
  122. package/BookReader/plugins/plugin.resume.js.map +1 -1
  123. package/BookReader/plugins/plugin.search.js +2 -1
  124. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  125. package/BookReader/plugins/plugin.search.js.map +1 -1
  126. package/BookReader/plugins/plugin.text_selection.js +24 -1
  127. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  128. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  129. package/BookReader/plugins/plugin.translate.js +159 -0
  130. package/BookReader/plugins/plugin.translate.js.LICENSE.txt +1 -0
  131. package/BookReader/plugins/plugin.translate.js.map +1 -0
  132. package/BookReader/plugins/plugin.tts.js +1 -1
  133. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
  134. package/BookReader/plugins/plugin.tts.js.map +1 -1
  135. package/BookReader/plugins/plugin.url.js +2 -1
  136. package/BookReader/plugins/plugin.url.js.LICENSE.txt +1 -0
  137. package/BookReader/plugins/plugin.url.js.map +1 -1
  138. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
  139. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  140. package/BookReader/plugins/translator-worker.js +2 -0
  141. package/BookReader/plugins/translator-worker.js.map +1 -0
  142. package/BookReader/silence.mp3 +0 -0
  143. package/BookReader/translator-worker.js +475 -0
  144. package/BookReader/webcomponents-bundle.js +3 -0
  145. package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
  146. package/BookReader/webcomponents-bundle.js.map +1 -0
  147. package/README.md +14 -3
  148. package/jsconfig.json +19 -0
  149. package/package.json +93 -70
  150. package/src/BookReader/BookModel.js +92 -46
  151. package/src/BookReader/DragScrollable.js +233 -0
  152. package/src/BookReader/ImageCache.js +49 -16
  153. package/src/BookReader/Mode1Up.js +66 -365
  154. package/src/BookReader/Mode1UpLit.js +392 -0
  155. package/src/BookReader/Mode2Up.js +87 -1315
  156. package/src/BookReader/Mode2UpLit.js +786 -0
  157. package/src/BookReader/ModeAbstract.js +43 -0
  158. package/src/BookReader/ModeCoordinateSpace.js +29 -0
  159. package/src/BookReader/ModeSmoothZoom.js +312 -0
  160. package/src/BookReader/ModeThumb.js +29 -15
  161. package/src/BookReader/Navbar/Navbar.js +201 -76
  162. package/src/BookReader/PageContainer.js +120 -23
  163. package/src/BookReader/ReduceSet.js +2 -2
  164. package/src/BookReader/Toolbar/Toolbar.js +18 -40
  165. package/src/BookReader/events.js +3 -3
  166. package/src/BookReader/options.js +94 -17
  167. package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
  168. package/src/BookReader/utils/ScrollClassAdder.js +31 -0
  169. package/src/BookReader/utils/SelectionObserver.js +53 -0
  170. package/src/BookReader/utils/classes.js +1 -1
  171. package/src/BookReader/utils.js +136 -12
  172. package/src/BookReader.js +695 -1228
  173. package/src/BookReaderPlugin.js +52 -0
  174. package/src/assets/icons/magnify-minus.svg +3 -7
  175. package/src/assets/icons/magnify-plus.svg +3 -7
  176. package/src/assets/icons/slider-toggle.svg +1 -0
  177. package/src/assets/icons/voice.svg +1 -0
  178. package/src/assets/images/hypothesis.ico +0 -0
  179. package/src/assets/images/icon_experiment.svg +1 -0
  180. package/src/assets/images/translate.svg +1 -0
  181. package/src/assets/images/unviewable_page.png +0 -0
  182. package/src/assets/silence.mp3 +0 -0
  183. package/src/css/BookReader.scss +1 -5
  184. package/src/css/_BRBookmarks.scss +1 -1
  185. package/src/css/_BRComponent.scss +1 -1
  186. package/src/css/_BRicon.scss +8 -2
  187. package/src/css/_BRmain.scss +16 -3
  188. package/src/css/_BRnav.scss +74 -70
  189. package/src/css/_BRpages.scss +171 -42
  190. package/src/css/_BRsearch.scss +69 -30
  191. package/src/css/_BRtoolbar.scss +5 -5
  192. package/src/css/_TextSelection.scss +188 -24
  193. package/src/css/_colorbox.scss +2 -2
  194. package/src/css/_controls.scss +24 -7
  195. package/src/css/_icons.scss +8 -1
  196. package/src/{BookNavigator/assets → css}/button-base.js +2 -2
  197. package/src/css/icon_checkmark.js +9 -0
  198. package/src/css/sharedStyles.js +15 -0
  199. package/src/ia-bookreader/downloads/downloads-provider.js +81 -0
  200. package/src/{BookNavigator → ia-bookreader}/downloads/downloads.js +25 -5
  201. package/src/ia-bookreader/ia-bookreader.js +666 -0
  202. package/src/ia-bookreader/sharing.js +27 -0
  203. package/src/ia-bookreader/viewable-files.js +98 -0
  204. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments-provider.js +17 -17
  205. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments.js +75 -67
  206. package/src/{BookNavigator → plugins}/bookmarks/bookmark-button.js +4 -3
  207. package/src/{BookNavigator/assets → plugins/bookmarks}/bookmark-colors.js +1 -1
  208. package/src/{BookNavigator → plugins}/bookmarks/bookmark-edit.js +43 -31
  209. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-list.js +48 -49
  210. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-loginCTA.js +3 -3
  211. package/src/plugins/bookmarks/bookmarks-provider.js +63 -0
  212. package/src/{BookNavigator → plugins/bookmarks}/delete-modal-actions.js +1 -1
  213. package/src/{BookNavigator → plugins}/bookmarks/ia-bookmarks.js +117 -68
  214. package/src/plugins/plugin.archive_analytics.js +84 -78
  215. package/src/plugins/plugin.autoplay.js +99 -104
  216. package/src/plugins/plugin.chapters.js +319 -205
  217. package/src/plugins/plugin.experiments.js +339 -0
  218. package/src/plugins/plugin.iframe.js +1 -1
  219. package/src/plugins/plugin.iiif.js +141 -0
  220. package/src/plugins/plugin.resume.js +54 -51
  221. package/src/plugins/plugin.text_selection.js +539 -219
  222. package/src/plugins/plugin.vendor-fullscreen.js +5 -5
  223. package/src/plugins/search/plugin.search.js +374 -392
  224. package/src/{BookNavigator → plugins}/search/search-provider.js +59 -27
  225. package/src/{BookNavigator → plugins}/search/search-results.js +105 -76
  226. package/src/plugins/search/utils.js +50 -0
  227. package/src/plugins/search/view.js +50 -68
  228. package/src/plugins/translate/TranslationManager.js +164 -0
  229. package/src/plugins/translate/plugin.translate.js +512 -0
  230. package/src/plugins/tts/AbstractTTSEngine.js +78 -49
  231. package/src/plugins/tts/FestivalTTSEngine.js +20 -30
  232. package/src/plugins/tts/PageChunk.js +33 -21
  233. package/src/plugins/tts/PageChunkIterator.js +11 -17
  234. package/src/plugins/tts/WebTTSEngine.js +131 -91
  235. package/src/plugins/tts/plugin.tts.js +345 -350
  236. package/src/plugins/tts/utils.js +77 -49
  237. package/src/plugins/url/UrlPlugin.js +211 -0
  238. package/src/plugins/{plugin.url.js → url/plugin.url.js} +105 -20
  239. package/src/util/TextSelectionManager.js +532 -0
  240. package/src/util/browserSniffing.js +33 -1
  241. package/src/util/cache.js +20 -0
  242. package/src/util/docCookies.js +21 -2
  243. package/src/util/lit.js +15 -0
  244. package/src/util/strings.js +1 -0
  245. package/.babelrc +0 -12
  246. package/.dependabot/config.yml +0 -6
  247. package/.eslintrc.js +0 -50
  248. package/.gitattributes +0 -2
  249. package/.github/ISSUE_TEMPLATE/bug.md +0 -32
  250. package/.github/ISSUE_TEMPLATE/feature-request.md +0 -30
  251. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -15
  252. package/.github/workflows/node.js.yml +0 -37
  253. package/.github/workflows/npm-publish.yml +0 -47
  254. package/.testcaferc.json +0 -5
  255. package/BookReader/bookreader-component-bundle.js +0 -1450
  256. package/BookReader/bookreader-component-bundle.js.LICENSE.txt +0 -38
  257. package/BookReader/bookreader-component-bundle.js.map +0 -1
  258. package/BookReader/jquery-1.10.1.js +0 -2
  259. package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
  260. package/BookReader/plugins/plugin.menu_toggle.js +0 -2
  261. package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
  262. package/BookReader/plugins/plugin.mobile_nav.js +0 -2
  263. package/BookReader/plugins/plugin.mobile_nav.js.map +0 -1
  264. package/BookReaderDemo/BookReaderDemo.css +0 -41
  265. package/BookReaderDemo/BookReaderJSAdvanced.js +0 -115
  266. package/BookReaderDemo/BookReaderJSAutoplay.js +0 -56
  267. package/BookReaderDemo/BookReaderJSSimple.js +0 -55
  268. package/BookReaderDemo/IIIFBookReader.js +0 -207
  269. package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +0 -1
  270. package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +0 -1
  271. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-cool-grad.png +0 -0
  272. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-flat.png +0 -0
  273. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.png +0 -0
  274. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.svg +0 -1
  275. package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +0 -1
  276. package/BookReaderDemo/assets/v5/bookreader-logo-renders@1x.png +0 -0
  277. package/BookReaderDemo/assets/v5/bookreader-logo-renders@2x.png +0 -0
  278. package/BookReaderDemo/assets/v5/bookreader-v5-screenshot.png +0 -0
  279. package/BookReaderDemo/bookreader-template-bundle.js +0 -7178
  280. package/BookReaderDemo/demo-advanced.html +0 -33
  281. package/BookReaderDemo/demo-autoplay.html +0 -38
  282. package/BookReaderDemo/demo-embed-iframe-src.html +0 -84
  283. package/BookReaderDemo/demo-embed.html +0 -26
  284. package/BookReaderDemo/demo-fullscreen-mobile.html +0 -36
  285. package/BookReaderDemo/demo-fullscreen.html +0 -33
  286. package/BookReaderDemo/demo-iiif.html +0 -34
  287. package/BookReaderDemo/demo-iiif.js +0 -26
  288. package/BookReaderDemo/demo-internetarchive.html +0 -74
  289. package/BookReaderDemo/demo-multiple.html +0 -43
  290. package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
  291. package/BookReaderDemo/demo-preview-pages.html +0 -1092
  292. package/BookReaderDemo/demo-simple.html +0 -34
  293. package/BookReaderDemo/demo-vendor-fullscreen.html +0 -36
  294. package/BookReaderDemo/immersion-1up.html +0 -64
  295. package/BookReaderDemo/immersion-mode.html +0 -35
  296. package/BookReaderDemo/toggle_controls.html +0 -53
  297. package/BookReaderDemo/view_mode.html +0 -39
  298. package/BookReaderDemo/viewmode-cycle.html +0 -41
  299. package/CHANGELOG.md +0 -495
  300. package/CONTRIBUTING.md +0 -7
  301. package/codecov.yml +0 -17
  302. package/index.html +0 -31
  303. package/karma.conf.js +0 -23
  304. package/screenshot.png +0 -0
  305. package/scripts/postversion.js +0 -10
  306. package/scripts/preversion.js +0 -14
  307. package/scripts/version.js +0 -26
  308. package/src/BookNavigator/BookModel.js +0 -14
  309. package/src/BookNavigator/BookNavigator.js +0 -446
  310. package/src/BookNavigator/assets/book-loader.js +0 -27
  311. package/src/BookNavigator/assets/icon_checkmark.js +0 -6
  312. package/src/BookNavigator/assets/icon_close.js +0 -3
  313. package/src/BookNavigator/bookmarks/bookmarks-provider.js +0 -53
  314. package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
  315. package/src/BookNavigator/downloads/downloads-provider.js +0 -66
  316. package/src/BookNavigator/search/a-search-result.js +0 -55
  317. package/src/BookReader/DebugConsole.js +0 -54
  318. package/src/BookReaderComponent/BookReaderComponent.js +0 -112
  319. package/src/ItemNavigator/ItemNavigator.js +0 -376
  320. package/src/ItemNavigator/providers/sharing.js +0 -29
  321. package/src/css/_MobileNav.scss +0 -194
  322. package/src/dragscrollable-br.js +0 -261
  323. package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
  324. package/src/plugins/plugin.mobile_nav.js +0 -287
  325. package/tests/BookReader/BookModel.test.js +0 -312
  326. package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
  327. package/tests/BookReader/DebugConsole.test.js +0 -25
  328. package/tests/BookReader/ImageCache.test.js +0 -150
  329. package/tests/BookReader/Mode1Up.test.js +0 -164
  330. package/tests/BookReader/Mode2Up.test.js +0 -247
  331. package/tests/BookReader/Navbar/Navbar.test.js +0 -169
  332. package/tests/BookReader/PageContainer.test.js +0 -115
  333. package/tests/BookReader/ReduceSet.test.js +0 -38
  334. package/tests/BookReader/Toolbar/Toolbar.test.js +0 -26
  335. package/tests/BookReader/utils/classes.test.js +0 -88
  336. package/tests/BookReader/utils.test.js +0 -109
  337. package/tests/BookReader.options.test.js +0 -39
  338. package/tests/BookReader.test.js +0 -301
  339. package/tests/e2e/README.md +0 -75
  340. package/tests/e2e/autoplay.test.js +0 -13
  341. package/tests/e2e/base.test.js +0 -35
  342. package/tests/e2e/helpers/base.js +0 -263
  343. package/tests/e2e/helpers/debug.js +0 -13
  344. package/tests/e2e/helpers/desktopSearch.js +0 -72
  345. package/tests/e2e/helpers/mobileSearch.js +0 -85
  346. package/tests/e2e/helpers/mockSearch.js +0 -93
  347. package/tests/e2e/helpers/rightToLeft.js +0 -29
  348. package/tests/e2e/ia-production/ia-prod-base.js +0 -17
  349. package/tests/e2e/models/BookReader.js +0 -11
  350. package/tests/e2e/models/Navigation.js +0 -56
  351. package/tests/e2e/rightToLeft.test.js +0 -20
  352. package/tests/e2e/viewmode.test.js +0 -37
  353. package/tests/karma/BookNavigator/book-navigator.test.js +0 -132
  354. package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +0 -133
  355. package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +0 -222
  356. package/tests/karma/BookNavigator/search/search-provider.test.js +0 -23
  357. package/tests/karma/BookNavigator/search/search-results.test.js +0 -240
  358. package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -201
  359. package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
  360. package/tests/plugins/plugin.archive_analytics.test.js +0 -23
  361. package/tests/plugins/plugin.autoplay.test.js +0 -52
  362. package/tests/plugins/plugin.chapters.test.js +0 -130
  363. package/tests/plugins/plugin.iframe.test.js +0 -42
  364. package/tests/plugins/plugin.mobile_nav.test.js +0 -66
  365. package/tests/plugins/plugin.resume.test.js +0 -98
  366. package/tests/plugins/plugin.text_selection.test.js +0 -203
  367. package/tests/plugins/plugin.url.test.js +0 -129
  368. package/tests/plugins/plugin.vendor-fullscreen.test.js +0 -65
  369. package/tests/plugins/search/plugin.search.test.js +0 -173
  370. package/tests/plugins/search/plugin.search.view.test.js +0 -106
  371. package/tests/plugins/tts/AbstractTTSEngine.test.js +0 -153
  372. package/tests/plugins/tts/FestivalTTSEngine.test.js +0 -59
  373. package/tests/plugins/tts/PageChunk.test.js +0 -57
  374. package/tests/plugins/tts/PageChunkIterator.test.js +0 -179
  375. package/tests/plugins/tts/WebTTSEngine.test.js +0 -126
  376. package/tests/plugins/tts/utils.test.js +0 -133
  377. package/tests/util/browserSniffing.test.js +0 -56
  378. package/tests/util/docCookies.test.js +0 -15
  379. package/tests/util/strings.test.js +0 -63
  380. package/tests/utils.js +0 -42
  381. package/webpack.config.js +0 -86
@@ -0,0 +1,1904 @@
1
+ /*! For license information please see ia-bookreader-bundle.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[68],{8248:function(e,t,n){var r,o=n(5215),i=n(420),a=n(9696);!function(e){e.processing="processing",e.complete="complete"}(r||(r={}));let s=class extends i.WF{constructor(){super(...arguments),this.mode="processing"}render(){return i.qy`
3
+ <div class="${this.mode}">
4
+ <svg
5
+ viewBox="0 0 120 120"
6
+ preserveAspectRatio="none"
7
+ version="1.1"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlns:xlink="http://www.w3.org/1999/xlink"
10
+ aria-labelledby="indicatorTitle indicatorDescription"
11
+ >
12
+ <title id="indicatorTitle">Activity Indicator</title>
13
+ <desc id="indicatorDescription">
14
+ A rotating activity indicator with three dots in the middle.
15
+ </desc>
16
+ <g
17
+ id="icons/check-ring---squared"
18
+ stroke="none"
19
+ stroke-width="1"
20
+ fill="none"
21
+ fill-rule="evenodd"
22
+ >
23
+ <path
24
+ id="completed-ring"
25
+ class="loaded-indicator"
26
+ d="M60,10 C70.5816709,10 80.3955961,13.2871104 88.4763646,18.8959201 L78.3502633,29.0214223 C72.9767592,25.8315427 66.7022695,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 L95.995,59.46 L108.327675,47.128668 C109.350926,50.9806166 109.925886,55.015198 109.993301,59.1731586 L110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"
27
+ ></path>
28
+ <polygon
29
+ id="check"
30
+ class="loaded-indicator"
31
+ transform="translate(75.000000, 41.500000) rotate(44.000000) translate(-75.000000, -41.500000) "
32
+ points="96 85 54 85 54 65 76 64.999 76 -2 96 -2"
33
+ ></polygon>
34
+ <path
35
+ id="activity-ring"
36
+ class="activity-indicator"
37
+ d="M60,10 C69.8019971,10 78.9452178,12.8205573 86.6623125,17.6943223 L76.4086287,27.9484118 C71.4880919,25.4243078 65.9103784,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 C96,53.3014663 94.1704984,47.0302355 90.9839104,41.6587228 L101.110332,31.5326452 C106.715332,39.6116982 110,49.4222615 110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"
38
+ ></path>
39
+ <g
40
+ id="activity-dots"
41
+ class="activity-indicator"
42
+ transform="translate(40.000000, 55.000000)"
43
+ >
44
+ <circle id="left-dot" cx="5" cy="5" r="5"></circle>
45
+ <circle id="middle-dot" cx="20" cy="5" r="5"></circle>
46
+ <circle id="right-dot" cx="35" cy="5" r="5"></circle>
47
+ </g>
48
+ </g>
49
+ </svg>
50
+ </div>
51
+ `}static get styles(){const e=i.AH`var(--activityIndicatorCheckmarkColor, #31A481)`,t=i.AH`var(--activityIndicatorCompletedRingColor, #31A481)`,n=i.AH`var(--activityIndicatorLoadingRingColor, #333333)`,r=i.AH`var(--activityIndicatorLoadingDotColor, #333333)`;return i.AH`
52
+ #completed-ring {
53
+ fill: ${t};
54
+ }
55
+
56
+ #check {
57
+ fill: ${e};
58
+ }
59
+
60
+ #activity-ring {
61
+ fill: ${n};
62
+ }
63
+
64
+ #activity-dots {
65
+ fill: ${r};
66
+ }
67
+
68
+ .activity-indicator {
69
+ opacity: 0;
70
+ transition: opacity 0.25s ease-out;
71
+ }
72
+
73
+ .processing .activity-indicator {
74
+ opacity: 1;
75
+ }
76
+
77
+ .loaded-indicator {
78
+ opacity: 1;
79
+ transition: opacity 0.25s ease-out;
80
+ }
81
+
82
+ .processing .loaded-indicator {
83
+ opacity: 0;
84
+ }
85
+
86
+ .image {
87
+ border: 1px solid red;
88
+ display: inline-block;
89
+ }
90
+
91
+ .processing #activity-ring {
92
+ animation: rotate 1.3s infinite linear;
93
+ transform-origin: 50px 50px;
94
+ transform-box: fill-box;
95
+ }
96
+
97
+ .processing #left-dot {
98
+ opacity: 0;
99
+ animation: dot 1.3s infinite;
100
+ animation-delay: 0.2s;
101
+ }
102
+
103
+ .processing #middle-dot {
104
+ opacity: 0;
105
+ animation: dot 1.3s infinite;
106
+ animation-delay: 0.4s;
107
+ }
108
+
109
+ .processing #right-dot {
110
+ opacity: 0;
111
+ animation: dot 1.3s infinite;
112
+ animation-delay: 0.6s;
113
+ }
114
+
115
+ @keyframes rotate {
116
+ 0% {
117
+ transform: rotate(-360deg);
118
+ }
119
+ 100% {
120
+ /* This frame is supposed to be inferred, but Safari doesn't rotate it unless we're explicit */
121
+ transform: rotate(0deg);
122
+ }
123
+ }
124
+
125
+ @keyframes dot {
126
+ 0% {
127
+ opacity: 0;
128
+ }
129
+ 25% {
130
+ opacity: 1;
131
+ }
132
+ 100% {
133
+ opacity: 0;
134
+ }
135
+ }
136
+ `}};(0,o.Cg)([(0,a.MZ)({type:String})],s.prototype,"mode",void 0),s=(0,o.Cg)([(0,a.EM)("ia-activity-indicator")],s)},90:function(e,t,n){var r=n(420),o=r.qy`
137
+ <svg
138
+ viewBox="0 0 100 100"
139
+ xmlns="http://www.w3.org/2000/svg"
140
+ >
141
+ <g class="fill-color">
142
+ <path d="M70.6784759,10 L70.6784759,21.3240186 C64.5020053,21.66334 58.9104278,22.5826126 53.9037433,24.0818363 C48.8970588,25.5810601 44.8495989,27.4085163 41.7613636,29.5642049 C38.6731283,31.7198935 35.9982175,34.0552229 33.736631,36.5701929 C31.4750446,39.085163 29.8217469,41.5657574 28.776738,44.011976 C27.7317291,46.4581947 26.9173351,48.6848525 26.3335561,50.6919494 C25.7497772,52.6990464 25.4088681,54.3324462 25.3108289,55.592149 L25.2372995,57.4085163 C29.0296346,54.1661122 33.1751337,51.5524507 37.6737968,49.5675316 C42.1724599,47.5826126 46.2934492,46.3118208 50.0367647,45.7551564 C53.7800802,45.1984919 57.2571301,44.8713684 60.4679144,44.7737858 C63.6786988,44.6762031 66.1831551,44.7726769 67.9812834,45.0632069 L70.6784759,45.499002 L70.6784759,57.4051896 L100,33.3765802 L70.6784759,10 Z M76.4438503,62.4883566 L82.8609626,57.1157685 C82.9099822,57.0669772 82.9946524,57.0303837 83.1149733,57.005988 C83.2352941,56.9815924 83.4536542,56.9571967 83.7700535,56.9328011 C84.0864528,56.9084054 84.3905971,56.9449989 84.6824866,57.0425815 C84.9743761,57.1401641 85.217246,57.2854291 85.4110963,57.4783766 C85.6049465,57.671324 85.7263815,57.8409847 85.7754011,57.9873586 L85.8489305,58.2035928 L85.8489305,90 L0,90 L0,17.910845 L43.1784759,17.910845 C43.2765152,17.9596363 43.410205,18.0317143 43.5795455,18.1270792 C43.7488859,18.222444 43.9438503,18.4519849 44.1644385,18.8157019 C44.3850267,19.1794189 44.469697,19.5542249 44.4184492,19.9401198 C44.4184492,20.2794411 44.3092692,20.582169 44.0909091,20.8483034 C43.872549,21.1144378 43.6664439,21.3206919 43.4725936,21.4670659 L43.1818182,21.6134398 C40.557041,23.06609 38.2954545,24.396762 36.3970588,25.6054558 L30.7820856,29.8170326 L11.5274064,29.8170326 L11.5274064,78.1669993 L74.1811497,78.1669993 L74.1811497,65.5355955 C74.1811497,65.1009093 74.3995098,64.6407186 74.8362299,64.1550233 L76.4438503,62.4883566 Z" id="Shape"></path>
143
+ </g>
144
+ </svg>
145
+ `;class i extends r.WF{static get styles(){return r.AH`
146
+ :host {
147
+ width: var(--iconWidth, 'auto');
148
+ height: var(--iconHeight, 'auto');
149
+ }
150
+
151
+ .fill-color {
152
+ fill: var(--iconFillColor);
153
+ }
154
+
155
+ .stroke-color {
156
+ stroke: var(--iconStrokeColor);
157
+ }
158
+ `}render(){return o}}customElements.define("ia-icon-share",i)},5215:function(e,t,n){function r(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}n.d(t,{Cg:function(){return r}}),Object.create,Object.create},4535:function(e,t,n){n.d(t,{J:function(){return o}});var r=n(6681),o=function(e){return null!=e?e:r.s6}},2250:function(e,t,n){n(2675),n(9463),n(2259),n(5700),n(3418),n(3792),n(4782),n(9572),n(2010),n(8130),n(2811),n(3851),n(1278),n(875),n(825),n(888),n(8781),n(7764),n(3500),n(2953),n(8706),n(2008),n(113),n(2062),n(9085),n(5506),n(9432),n(6099),n(7495),n(1761),n(5746);var r=n(420),o=n(5215),i=n(9696),a=(n(8598),n(1415),n(744),n(6681)),s=n(1091);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function d(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var m=(0,s.u$)(function(e){function t(e){var n,r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t,n){return t=p(t),function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}(this,t,[e]),e.type!==s.OA.ATTRIBUTE||"class"!==e.name||(null===(r=e.strings)||void 0===r?void 0:r.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),function(e,t){return t&&u(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(e){return" "+Object.keys(e).filter(function(t){return e[t]}).join(" ")+" "}},{key:"update",value:function(e,t){var n,r,o=this,i=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,1)[0];if(void 0===this.it){for(var s in this.it=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(function(e){return""!==e}))),i)i[s]&&!(null===(n=this.nt)||void 0===n?void 0:n.has(s))&&this.it.add(s);return this.render(i)}var l=e.element.classList;for(var u in this.it.forEach(function(e){e in i||(l.remove(e),o.it.delete(e))}),i){var d=!!i[u];d===this.it.has(u)||(null===(r=this.nt)||void 0===r?void 0:r.has(u))||(d?(l.add(u),this.it.add(u)):(l.remove(u),this.it.delete(u)))}return a.c0}}])}(s.WL));function v(e){let t,n,r;return"object"==typeof e?(t=e.hashFunction,n=e.expiring,r=e.tags):t=e,(e,o,i)=>{if(null!=i.value)i.value=y(i.value,t,n,r);else{if(null==i.get)throw"Only put a Memoize() decorator on a method or get accessor.";i.get=y(i.get,t,n,r)}}}const b=new Map;function y(e,t,n=0,r){const o=Symbol("__memoized_map__");return function(...i){let a;this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let s=this[o];if(Array.isArray(r))for(const e of r)b.has(e)?b.get(e).push(s):b.set(e,[s]);if(t||i.length>0||n>0){let r;r=!0===t?i.map(e=>e.toString()).join("!"):t?t.apply(this,i):i[0];const o=`${r}__timestamp`;let l=!1;if(n>0)if(s.has(o)){let e=s.get(o);l=Date.now()-e>n}else l=!0;s.has(r)&&!l?a=s.get(r):(a=e.apply(this,i),s.set(r,a),n>0&&s.set(o,Date.now()))}else{const t=this;s.has(t)?a=s.get(t):(a=e.apply(this,i),s.set(t,a))}return a}}class g{parseValue(e){return("string"!=typeof e||"false"!==e&&"0"!==e)&&Boolean(e)}}g.shared=new g;class k{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=parseFloat(e);return Number.isNaN(t)?void 0:t}}k.shared=new k;class w{parseValue(e){return k.shared.parseValue(e)}}w.shared=new w;class C{parseValue(e){return this.parseJSDate(e)||this.parseBracketDate(e)}parseBracketDate(e){if("string"!=typeof e)return;const t=e.match(/\[([0-9]{4})\]/);return!t||t.length<2?void 0:this.parseJSDate(t[1])}parseJSDate(e){if("string"!=typeof e)return;let t=e;t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s{1}[0-9]{2}:[0-9]{2}:[0-9]{2}$/)&&(t=t.replace(" ","T"));const n=Date.parse(t);if(Number.isNaN(n))return;let r=new Date(t);return(t.match(/^[0-9]{4}$/)||t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/))&&(r=new Date(r.getTime()+1e3*r.getTimezoneOffset()*60)),r}}C.shared=new C;class x{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=e.split(":");let n;return n=1===t.length?this.parseNumberFormat(t[0]):this.parseColonSeparatedFormat(t),n}parseNumberFormat(e){let t=parseFloat(e);return Number.isNaN(t)&&(t=void 0),t}parseColonSeparatedFormat(e){let t=!1;const n=e.map((n,r)=>{const o=parseFloat(n);if(Number.isNaN(o))return t=!0,0;const i=60**(e.length-1-r);return o*Math.floor(i)}).reduce((e,t)=>e+t,0);return t?void 0:n}}x.shared=new x;class S{parseValue(e){if("string"==typeof e)return e}}S.shared=new S;class O{constructor(e,t){this.separators=[";",","],this.parser=e,t&&t.separators&&(this.separators=t.separators)}parseValue(e){const t=String(e);let n=[];for(const e of this.separators)if(n=t.split(e),n.length>1)break;return this.parseListValues(n)}parseListValues(e){const t=e.map(e=>e.trim()),n=t.map(e=>this.parser.parseValue(e)),r=[];return n.forEach(e=>{void 0!==e&&r.push(e)}),r}}class M{parseValue(e){if("string"==typeof e)return e}}M.shared=new M;class B{parseValue(e){return String(e)}}B.shared=new B;class j{get name(){return this.rawValue.name}get source(){return this.rawValue.source}get btih(){return this.rawValue.btih}get md5(){return this.rawValue.md5}get format(){return this.rawValue.format}get mtime(){if(null==this.rawValue.mtime)return;const e=k.shared.parseValue(this.rawValue.mtime);return e?new Date(1e3*e):void 0}get crc32(){return this.rawValue.crc32}get sha1(){return this.rawValue.sha1}get original(){return this.rawValue.original}get size(){return null!=this.rawValue.size?w.shared.parseValue(this.rawValue.size):void 0}get title(){return this.rawValue.title}get length(){return null!=this.rawValue.length?x.shared.parseValue(this.rawValue.length):void 0}get height(){return null!=this.rawValue.height?k.shared.parseValue(this.rawValue.height):void 0}get width(){return null!=this.rawValue.width?k.shared.parseValue(this.rawValue.width):void 0}get track(){return null!=this.rawValue.track?k.shared.parseValue(this.rawValue.track):void 0}get external_identifier(){return this.rawValue.external_identifier}get creator(){return this.rawValue.creator}get album(){return this.rawValue.album}constructor(e={}){this.rawValue=e}}(0,o.Cg)([v()],j.prototype,"mtime",null),(0,o.Cg)([v()],j.prototype,"size",null),(0,o.Cg)([v()],j.prototype,"length",null),(0,o.Cg)([v()],j.prototype,"height",null),(0,o.Cg)([v()],j.prototype,"width",null),(0,o.Cg)([v()],j.prototype,"track",null);class P{get values(){return this.parseRawValue()}get value(){return this.values[0]}constructor(e,t){this.parser=e,this.rawValue=t}parseRawValue(){const e=Array.isArray(this.rawValue)?this.rawValue:[this.rawValue],t=[];return e.forEach(e=>{const n=this.parser.parseValue(e);Array.isArray(n)?t.push(...n):void 0!==n&&t.push(n)}),t}}(0,o.Cg)([v()],P.prototype,"values",null),(0,o.Cg)([v()],P.prototype,"value",null);class E extends P{constructor(e){super(g.shared,e)}}class L extends P{constructor(e){super(C.shared,e)}}class A extends P{constructor(e){super(x.shared,e)}}class _ extends P{constructor(e){super(k.shared,e)}}class T extends P{constructor(e){super(B.shared,e)}}class z extends P{constructor(e){super(M.shared,e)}}class I extends P{constructor(e){super(w.shared,e)}}class $ extends P{constructor(e){super(S.shared,e)}}class H extends P{constructor(e,t){super(t,e)}}class q extends H{constructor(e){super(e,new O(B.shared))}}class D{get identifier(){return this.rawMetadata.identifier}get addeddate(){return null!=this.rawMetadata.addeddate?new L(this.rawMetadata.addeddate):void 0}get audio_codec(){return null!=this.rawMetadata.audio_codec?new T(this.rawMetadata.audio_codec):void 0}get audio_sample_rate(){return null!=this.rawMetadata.audio_sample_rate?new _(this.rawMetadata.audio_sample_rate):void 0}get avg_rating(){return null!=this.rawMetadata.avg_rating?new _(this.rawMetadata.avg_rating):void 0}get collection(){return null!=this.rawMetadata.collection?new T(this.rawMetadata.collection):void 0}get collections_raw(){return null!=this.rawMetadata.collections_raw?new T(this.rawMetadata.collections_raw):void 0}get collection_size(){return null!=this.rawMetadata.collection_size?new I(this.rawMetadata.collection_size):void 0}get contact(){return null!=this.rawMetadata.contact?new T(this.rawMetadata.contact):void 0}get contributor(){return null!=this.rawMetadata.contributor?new T(this.rawMetadata.contributor):void 0}get coverage(){return null!=this.rawMetadata.coverage?new T(this.rawMetadata.coverage):void 0}get creator(){return null!=this.rawMetadata.creator?new T(this.rawMetadata.creator):void 0}get creator_alt_script(){return null!=this.rawMetadata["creator-alt-script"]?new T(this.rawMetadata["creator-alt-script"]):void 0}get credits(){return null!=this.rawMetadata.credits?new T(this.rawMetadata.credits):void 0}get collection_layout(){return null!=this.rawMetadata.collection_layout?new T(this.rawMetadata.collection_layout):void 0}get date(){return null!=this.rawMetadata.date?new L(this.rawMetadata.date):void 0}get description(){return null!=this.rawMetadata.description?new T(this.rawMetadata.description):void 0}get downloads(){return null!=this.rawMetadata.downloads?new _(this.rawMetadata.downloads):void 0}get duration(){return null!=this.rawMetadata.duration?new A(this.rawMetadata.duration):void 0}get external_identifier(){return null!=this.rawMetadata["external-identifier"]?new T(this.rawMetadata["external-identifier"]):void 0}get external_link(){return null!=this.rawMetadata["external-link"]?new T(this.rawMetadata["external-link"]):void 0}get files_count(){return null!=this.rawMetadata.files_count?new _(this.rawMetadata.files_count):void 0}get indexdate(){return null!=this.rawMetadata.indexdate?new L(this.rawMetadata.indexdate):void 0}get isbn(){return null!=this.rawMetadata.isbn?new T(this.rawMetadata.isbn):void 0}get issue(){return null!=this.rawMetadata.issue?new T(this.rawMetadata.issue):void 0}get item_count(){return null!=this.rawMetadata.item_count?new _(this.rawMetadata.item_count):void 0}get item_size(){return null!=this.rawMetadata.item_size?new I(this.rawMetadata.item_size):void 0}get language(){return null!=this.rawMetadata.language?new T(this.rawMetadata.language):void 0}get length(){return null!=this.rawMetadata.length?new A(this.rawMetadata.length):void 0}get licenseurl(){return null!=this.rawMetadata.licenseurl?new T(this.rawMetadata.licenseurl):void 0}get lineage(){return null!=this.rawMetadata.lineage?new T(this.rawMetadata.lineage):void 0}get month(){return null!=this.rawMetadata.month?new _(this.rawMetadata.month):void 0}get mediatype(){return null!=this.rawMetadata.mediatype?new $(this.rawMetadata.mediatype):void 0}get noindex(){return null!=this.rawMetadata.noindex?new E(this.rawMetadata.noindex):void 0}get notes(){return null!=this.rawMetadata.notes?new T(this.rawMetadata.notes):void 0}get num_favorites(){return null!=this.rawMetadata.num_favorites?new _(this.rawMetadata.num_favorites):void 0}get num_reviews(){return null!=this.rawMetadata.num_reviews?new _(this.rawMetadata.num_reviews):void 0}get openlibrary_edition(){return null!=this.rawMetadata.openlibrary_edition?new T(this.rawMetadata.openlibrary_edition):void 0}get openlibrary_work(){return null!=this.rawMetadata.openlibrary_work?new T(this.rawMetadata.openlibrary_work):void 0}get page_progression(){return null!=this.rawMetadata.page_progression?new z(this.rawMetadata.page_progression):void 0}get paginated(){return null!=this.rawMetadata.paginated?new E(this.rawMetadata.paginated):void 0}get partner(){return null!=this.rawMetadata.partner?new T(this.rawMetadata.partner):void 0}get post_text(){return null!=this.rawMetadata.post_text?new T(this.rawMetadata.post_text):void 0}get ppi(){return null!=this.rawMetadata.ppi?new _(this.rawMetadata.ppi):void 0}get publicdate(){return null!=this.rawMetadata.publicdate?new L(this.rawMetadata.publicdate):void 0}get publisher(){return null!=this.rawMetadata.publisher?new T(this.rawMetadata.publisher):void 0}get reviewdate(){return null!=this.rawMetadata.reviewdate?new L(this.rawMetadata.reviewdate):void 0}get rights(){return null!=this.rawMetadata.rights?new T(this.rawMetadata.rights):void 0}get rights_holder(){var e;const t=null!==(e=this.rawMetadata["rights-holder"])&&void 0!==e?e:this.rawMetadata.rights_holder;return null!=t?new T(t):void 0}get runtime(){return null!=this.rawMetadata.runtime?new A(this.rawMetadata.runtime):void 0}get scanner(){return null!=this.rawMetadata.scanner?new T(this.rawMetadata.scanner):void 0}get segments(){return null!=this.rawMetadata.segments?new T(this.rawMetadata.segments):void 0}get shotlist(){return null!=this.rawMetadata.shotlist?new T(this.rawMetadata.shotlist):void 0}get source(){return null!=this.rawMetadata.source?new T(this.rawMetadata.source):void 0}get sponsor(){return null!=this.rawMetadata.sponsor?new T(this.rawMetadata.sponsor):void 0}get start_localtime(){return null!=this.rawMetadata.start_localtime?new L(this.rawMetadata.start_localtime):void 0}get start_time(){return null!=this.rawMetadata.start_time?new L(this.rawMetadata.start_time):void 0}get stop_time(){return null!=this.rawMetadata.stop_time?new L(this.rawMetadata.stop_time):void 0}get subject(){return null!=this.rawMetadata.subject?new q(this.rawMetadata.subject):void 0}get taper(){return null!=this.rawMetadata.taper?new T(this.rawMetadata.taper):void 0}get title(){return null!=this.rawMetadata.title?new T(this.rawMetadata.title):void 0}get title_alt_script(){return null!=this.rawMetadata["title-alt-script"]?new T(this.rawMetadata["title-alt-script"]):void 0}get transferer(){return null!=this.rawMetadata.transferer?new T(this.rawMetadata.transferer):void 0}get track(){return null!=this.rawMetadata.track?new _(this.rawMetadata.track):void 0}get type(){return null!=this.rawMetadata.type?new T(this.rawMetadata.type):void 0}get uploader(){return null!=this.rawMetadata.uploader?new T(this.rawMetadata.uploader):void 0}get utc_offset(){return null!=this.rawMetadata.utc_offset?new _(this.rawMetadata.utc_offset):void 0}get venue(){return null!=this.rawMetadata.venue?new T(this.rawMetadata.venue):void 0}get volume(){return null!=this.rawMetadata.volume?new T(this.rawMetadata.volume):void 0}get week(){return null!=this.rawMetadata.week?new _(this.rawMetadata.week):void 0}get year(){return null!=this.rawMetadata.year?new _(this.rawMetadata.year):void 0}constructor(e={}){this.rawMetadata=e}}(0,o.Cg)([v()],D.prototype,"addeddate",null),(0,o.Cg)([v()],D.prototype,"audio_codec",null),(0,o.Cg)([v()],D.prototype,"audio_sample_rate",null),(0,o.Cg)([v()],D.prototype,"avg_rating",null),(0,o.Cg)([v()],D.prototype,"collection",null),(0,o.Cg)([v()],D.prototype,"collections_raw",null),(0,o.Cg)([v()],D.prototype,"collection_size",null),(0,o.Cg)([v()],D.prototype,"contact",null),(0,o.Cg)([v()],D.prototype,"contributor",null),(0,o.Cg)([v()],D.prototype,"coverage",null),(0,o.Cg)([v()],D.prototype,"creator",null),(0,o.Cg)([v()],D.prototype,"creator_alt_script",null),(0,o.Cg)([v()],D.prototype,"credits",null),(0,o.Cg)([v()],D.prototype,"collection_layout",null),(0,o.Cg)([v()],D.prototype,"date",null),(0,o.Cg)([v()],D.prototype,"description",null),(0,o.Cg)([v()],D.prototype,"downloads",null),(0,o.Cg)([v()],D.prototype,"duration",null),(0,o.Cg)([v()],D.prototype,"external_identifier",null),(0,o.Cg)([v()],D.prototype,"external_link",null),(0,o.Cg)([v()],D.prototype,"files_count",null),(0,o.Cg)([v()],D.prototype,"indexdate",null),(0,o.Cg)([v()],D.prototype,"isbn",null),(0,o.Cg)([v()],D.prototype,"issue",null),(0,o.Cg)([v()],D.prototype,"item_count",null),(0,o.Cg)([v()],D.prototype,"item_size",null),(0,o.Cg)([v()],D.prototype,"language",null),(0,o.Cg)([v()],D.prototype,"length",null),(0,o.Cg)([v()],D.prototype,"licenseurl",null),(0,o.Cg)([v()],D.prototype,"lineage",null),(0,o.Cg)([v()],D.prototype,"month",null),(0,o.Cg)([v()],D.prototype,"mediatype",null),(0,o.Cg)([v()],D.prototype,"noindex",null),(0,o.Cg)([v()],D.prototype,"notes",null),(0,o.Cg)([v()],D.prototype,"num_favorites",null),(0,o.Cg)([v()],D.prototype,"num_reviews",null),(0,o.Cg)([v()],D.prototype,"openlibrary_edition",null),(0,o.Cg)([v()],D.prototype,"openlibrary_work",null),(0,o.Cg)([v()],D.prototype,"page_progression",null),(0,o.Cg)([v()],D.prototype,"paginated",null),(0,o.Cg)([v()],D.prototype,"partner",null),(0,o.Cg)([v()],D.prototype,"post_text",null),(0,o.Cg)([v()],D.prototype,"ppi",null),(0,o.Cg)([v()],D.prototype,"publicdate",null),(0,o.Cg)([v()],D.prototype,"publisher",null),(0,o.Cg)([v()],D.prototype,"reviewdate",null),(0,o.Cg)([v()],D.prototype,"rights",null),(0,o.Cg)([v()],D.prototype,"rights_holder",null),(0,o.Cg)([v()],D.prototype,"runtime",null),(0,o.Cg)([v()],D.prototype,"scanner",null),(0,o.Cg)([v()],D.prototype,"segments",null),(0,o.Cg)([v()],D.prototype,"shotlist",null),(0,o.Cg)([v()],D.prototype,"source",null),(0,o.Cg)([v()],D.prototype,"sponsor",null),(0,o.Cg)([v()],D.prototype,"start_localtime",null),(0,o.Cg)([v()],D.prototype,"start_time",null),(0,o.Cg)([v()],D.prototype,"stop_time",null),(0,o.Cg)([v()],D.prototype,"subject",null),(0,o.Cg)([v()],D.prototype,"taper",null),(0,o.Cg)([v()],D.prototype,"title",null),(0,o.Cg)([v()],D.prototype,"title_alt_script",null),(0,o.Cg)([v()],D.prototype,"transferer",null),(0,o.Cg)([v()],D.prototype,"track",null),(0,o.Cg)([v()],D.prototype,"type",null),(0,o.Cg)([v()],D.prototype,"uploader",null),(0,o.Cg)([v()],D.prototype,"utc_offset",null),(0,o.Cg)([v()],D.prototype,"venue",null),(0,o.Cg)([v()],D.prototype,"volume",null),(0,o.Cg)([v()],D.prototype,"week",null),(0,o.Cg)([v()],D.prototype,"year",null);class R{get reviewbody(){return this.rawValue.reviewbody}get reviewtitle(){return this.rawValue.reviewtitle}get reviewer(){return this.rawValue.reviewer}get reviewer_itemname(){return this.rawValue.reviewer_itemname}get reviewdate(){return null!=this.rawValue.reviewdate?C.shared.parseValue(this.rawValue.reviewdate):void 0}get createdate(){return null!=this.rawValue.createdate?C.shared.parseValue(this.rawValue.createdate):void 0}get stars(){return null!=this.rawValue.stars?k.shared.parseValue(this.rawValue.stars):void 0}constructor(e={}){this.rawValue=e}}(0,o.Cg)([v()],R.prototype,"reviewdate",null),(0,o.Cg)([v()],R.prototype,"createdate",null),(0,o.Cg)([v()],R.prototype,"stars",null);class F{constructor(e){var t,n;this.rawResponse=e,this.created=e.created,this.d1=e.d1,this.d2=e.d2,this.dir=e.dir,this.files=null===(t=e.files)||void 0===t?void 0:t.map(e=>new j(e)),this.files_count=e.files_count,this.item_last_updated=e.item_last_updated,this.item_size=e.item_size,this.metadata=new D(e.metadata),this.server=e.server,this.uniq=e.uniq,this.workable_servers=e.workable_servers,this.speech_vs_music_asr=e.speech_vs_music_asr,this.reviews=null===(n=e.reviews)||void 0===n?void 0:n.map(e=>new R(e))}}var W;!function(e){e.networkError="MetadataService.NetworkError",e.itemNotFound="MetadataService.ItemNotFound",e.decodingError="MetadataService.DecodingError",e.searchEngineError="MetadataService.SearchEngineError"}(W||(W={}));class V extends Error{constructor(e,t,n){super(t),this.name=e,this.type=e,this.details=n}}class N{constructor(e){this.backend=e}async fetchMetadata(e){var t;const n=await this.backend.fetchMetadata(e);return n.error?n:void 0===(null===(t=n.success)||void 0===t?void 0:t.metadata)?{error:new V(W.itemNotFound)}:{success:new F(n.success)}}async fetchMetadataValue(e,t){var n;const r=await this.backend.fetchMetadata(e,t);return r.error?r:void 0===(null===(n=r.success)||void 0===n?void 0:n.result)?{error:new V(W.itemNotFound)}:{success:r.success.result}}}N.default=new N(new class{constructor(e){var t;if(this.baseUrl=null!==(t=null==e?void 0:e.baseUrl)&&void 0!==t?t:"archive.org",void 0!==(null==e?void 0:e.includeCredentials)?this.includeCredentials=e.includeCredentials:this.includeCredentials=null!==window.location.href.match(/^https?:\/\/.*archive\.org(:[0-9]+)?/),void 0!==(null==e?void 0:e.scope))this.requestScope=e.scope;else{const e=new URL(window.location.href).searchParams.get("scope");e&&(this.requestScope=e)}}async fetchMetadata(e,t){const n=t?`/${t}`:"",r=`https://${this.baseUrl}/metadata/${e}${n}`;return this.fetchUrl(r,{requestOptions:{credentials:"omit"}})}async fetchUrl(e,t){var n;const r=new URL(e);let o;this.requestScope&&r.searchParams.set("scope",this.requestScope);try{const e=null!==(n=null==t?void 0:t.requestOptions)&&void 0!==n?n:{credentials:this.includeCredentials?"include":"same-origin"};o=await fetch(r.href,e)}catch(e){const t=e instanceof Error?e.message:"string"==typeof e?e:"Unknown error";return this.getErrorResult(W.networkError,t)}try{const e=await o.json(),t=e.error;if(t){const n=e.forensics;return this.getErrorResult(W.searchEngineError,t,n)}return{success:e}}catch(e){const t=e instanceof Error?e.message:"string"==typeof e?e:"Unknown error";return this.getErrorResult(W.decodingError,t)}}getErrorResult(e,t,n){return{error:new V(e,t,n)}}});var Z=r.qy`
159
+ <svg
160
+ viewBox="0 0 40 40"
161
+ xmlns="http://www.w3.org/2000/svg"
162
+ aria-labelledby="ellipsesTitleID ellipsesDescID"
163
+ >
164
+ <title id="ellipsesTitleID">Ellipses icon</title>
165
+ <desc id="ellipsesDescID">An illustration of text ellipses.</desc>
166
+ <path class="fill-color" d="m10.5 17.5c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5c-1.38071187 0-2.5-1.1192881-2.5-2.5s1.11928813-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5z" fill-rule="evenodd"/>
167
+ </svg>
168
+ `;class U extends r.WF{static get styles(){return r.AH`
169
+ :host {
170
+ width: var(--iconWidth, 'auto');
171
+ height: var(--iconHeight, 'auto');
172
+ }
173
+
174
+ .fill-color {
175
+ fill: var(--iconFillColor);
176
+ }
177
+
178
+ .stroke-color {
179
+ stroke: var(--iconStrokeColor);
180
+ }
181
+ `}render(){return Z}}customElements.define("ia-icon-ellipses",U);const G=r.AH`42px`,J=r.AH`var(--menuWidth, 320px)`,X=r.AH`var(--animationTiming, 200ms)`;var K=r.AH`
182
+ .main {
183
+ overflow: hidden;
184
+ width: 100%;
185
+ height: 100%;
186
+ }
187
+
188
+ .animate {
189
+ transition: transform ${X} ease-out;
190
+ }
191
+
192
+ .menu {
193
+ position: absolute;
194
+ top: 0;
195
+ left: 0;
196
+ bottom: 0;
197
+ width: ${J};
198
+ padding: 0.5rem 0.5rem 0 0;
199
+ box-sizing: border-box;
200
+ font-size: 1.4rem;
201
+ color: var(--primaryTextColor);
202
+ background: var(--menuSliderBg);
203
+ transform: translateX(calc(${J} * -1));
204
+ }
205
+
206
+ button {
207
+ cursor: pointer;
208
+ }
209
+
210
+ header {
211
+ margin: 0 0 0.5rem 0;
212
+ }
213
+
214
+ header * {
215
+ margin: 0;
216
+ display: inline-block;
217
+ }
218
+ header button {
219
+ cursor: pointer;
220
+ }
221
+
222
+ header.with-secondary-action .details {
223
+ width: 80%;
224
+ }
225
+
226
+ header .details {
227
+ font-weight: bold;
228
+ width: 88%;
229
+ }
230
+
231
+ header .custom-action > *,
232
+ button.close {
233
+ padding: 0;
234
+ background-color: transparent;
235
+ border: 0;
236
+ --iconWidth: var(--menuSliderHeaderIconWidth);
237
+ --iconHeight: var(--menuSliderHeaderIconHeight);
238
+ }
239
+
240
+ header .custom-action,
241
+ button.close {
242
+ position: absolute;
243
+ }
244
+ button.close {
245
+ min-width: 38px;
246
+ min-height: 38px;
247
+ display: flex;
248
+ justify-content: center;
249
+ align-items: center;
250
+ right: 0;
251
+ top: 0;
252
+ }
253
+
254
+ .content {
255
+ position: absolute;
256
+ top: 0;
257
+ right: 0;
258
+ bottom: 0;
259
+ left: ${G};
260
+ z-index: 1;
261
+ transform: translateX(calc(${J} * -1));
262
+ transition: transform ${X} ease-out;
263
+ background: var(--activeButtonBg);
264
+ border-right: 0.2rem solid;
265
+ border-color: var(--subpanelRightBorderColor);
266
+ padding: 0.5rem 0 0 0.5rem;
267
+ display: flex;
268
+ flex-direction: column;
269
+ }
270
+
271
+ .open {
272
+ transform: translateX(0);
273
+ }
274
+
275
+ .menu-list {
276
+ padding: 0;
277
+ margin: 0;
278
+ list-style: none;
279
+ background: var(--menuSliderBg);
280
+ }
281
+ .menu-list li {
282
+ margin-bottom: 0.2rem;
283
+ }
284
+
285
+ .content > section {
286
+ overflow: auto;
287
+ overscroll-behavior: contain;
288
+ }
289
+ `,Q=r.qy`
290
+ <svg
291
+ viewBox="0 0 18 18"
292
+ xmlns="http://www.w3.org/2000/svg"
293
+ aria-labelledby="collapseSidebarTitleID collapseSidebarDescID"
294
+ >
295
+ <title id="collapseSidebarTitleID">Collapse sidebar</title>
296
+ <desc id="collapseSidebarDescID">A circle with a left pointing chevron</desc>
297
+ <path d="m9 0c4.9705627 0 9 4.02943725 9 9 0 4.9705627-4.0294373 9-9 9-4.97056275 0-9-4.0294373-9-9 0-4.97056275 4.02943725-9 9-9zm1.6976167 5.28352881c-.365258-.3556459-.9328083-.37581056-1.32099801-.06558269l-.09308988.0844372-3 3.08108108-.08194436.09533317c-.27484337.36339327-.26799482.87009349.01656959 1.22592581l.084491.09308363 3 2.91891889.09533796.0818904c.3633964.2746544.8699472.2677153 1.2256839-.0167901l.093059-.0844712.0818904-.095338c.2746544-.3633964.2677153-.8699472-.0167901-1.2256839l-.0844712-.093059-2.283355-2.2222741 2.3024712-2.36338332.0819252-.09530804c.2997677-.39632298.2644782-.96313393-.1007797-1.31877983z" fill-rule="evenodd" class="fill-color" />
298
+ </svg>
299
+ `;class Y extends r.WF{static get styles(){return r.AH`
300
+ :host {
301
+ width: var(--iconWidth, 'auto');
302
+ height: var(--iconHeight, 'auto');
303
+ }
304
+
305
+ .fill-color {
306
+ fill: var(--iconFillColor);
307
+ }
308
+
309
+ .stroke-color {
310
+ stroke: var(--iconStrokeColor);
311
+ }
312
+ `}render(){return Q}}customElements.define("ia-icon-collapse-sidebar",Y);var ee=r.AH`
313
+ a {
314
+ display: inline-block;
315
+ text-decoration: none;
316
+ }
317
+
318
+ button.menu-item {
319
+ -webkit-appearance: none;
320
+ appearance: none;
321
+ }
322
+
323
+ .menu-item {
324
+ display: inline-flex;
325
+ width: 100%;
326
+ padding: 0;
327
+ font-size: 1.6rem;
328
+ text-align: left;
329
+ background: transparent;
330
+ -webkit-box-align: center;
331
+ -ms-flex-align: center;
332
+ align-items: center;
333
+ border: none;
334
+ cursor: pointer;
335
+ transition: background-color 0.2s;
336
+ border-radius: 6px;
337
+ }
338
+
339
+ .menu-item:hover {
340
+ background-color: rgba(255, 255, 255, 0.1);
341
+ }
342
+
343
+ .label {
344
+ display: var(--menuButtonLabelDisplay, none);
345
+ padding: 0;
346
+ font-weight: 400;
347
+ color: var(--primaryTextColor);
348
+ text-align: left;
349
+ vertical-align: middle;
350
+ margin-left: 1rem;
351
+ }
352
+
353
+ .menu-details {
354
+ color: var(--primaryTextColor);
355
+ display: inline-block;
356
+ margin-left: 0.5rem;
357
+ font-style: italic;
358
+ font-size: 1.5rem;
359
+ }
360
+
361
+ .menu-item > .icon {
362
+ position: relative;
363
+ display: inline-flex;
364
+ z-index: 2;
365
+ min-width: 4.2rem;
366
+ max-width: 4.2rem;
367
+ height: 4.2rem;
368
+ vertical-align: middle;
369
+ -webkit-box-align: center;
370
+ -ms-flex-align: center;
371
+ align-items: center;
372
+ -webkit-box-pack: center;
373
+ -ms-flex-pack: center;
374
+ justify-content: center;
375
+ }
376
+
377
+ .menu-item > .icon > * {
378
+ /* Prevent tooltip containing icon literal description */
379
+ pointer-events: none;
380
+ }
381
+
382
+ .menu-item[aria-expanded='true'] .icon {
383
+ background-color: var(--activeButtonBg);
384
+ border-radius: 1rem 0 0 1rem;
385
+ }
386
+
387
+ .icon .fill-color {
388
+ fill: #999;
389
+ }
390
+
391
+ .icon.active .fill-color {
392
+ fill: #fff;
393
+ }
394
+ `;let te=class extends r.WF{constructor(){super(...arguments),this.icon="",this.href="",this.label="",this.menuDetails="",this.buttonId="",this.selected=!1,this.followable=!1}static get styles(){return ee}onClick(e){e.preventDefault(),this.dispatchMenuTypeSelectedEvent()}dispatchMenuTypeSelectedEvent(){this.dispatchEvent(new CustomEvent("menuTypeSelected",{bubbles:!0,composed:!0,detail:{id:this.buttonId}}))}get iconClass(){return this.selected?"active":""}get menuItem(){return r.qy`
395
+ <span
396
+ class="icon ${this.iconClass}"
397
+ aria-hidden="true"
398
+ title="${this.label}"
399
+ >${this.icon}</span
400
+ >
401
+ <span class="label">${this.label}</span>
402
+ <span class="menu-details">${this.menuDetails}</span>
403
+ `}get linkButton(){return r.qy`
404
+ <a
405
+ href="${this.href}"
406
+ class="menu-item"
407
+ aria-expanded="${this.selected}"
408
+ @click=${this.followable?void 0:this.onClick}
409
+ >${this.menuItem}</a
410
+ >
411
+ `}get clickButton(){return r.qy`
412
+ <button
413
+ class="menu-item"
414
+ aria-expanded="${this.selected}"
415
+ @click=${this.onClick}
416
+ >
417
+ ${this.menuItem}
418
+ </button>
419
+ `}render(){return this.href?this.linkButton:this.clickButton}};te.shadowRootOptions={...r.WF.shadowRootOptions,delegatesFocus:!0},(0,o.Cg)([(0,i.MZ)({type:Object})],te.prototype,"icon",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],te.prototype,"href",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],te.prototype,"label",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],te.prototype,"menuDetails",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],te.prototype,"buttonId",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],te.prototype,"selected",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],te.prototype,"followable",void 0),te=(0,o.Cg)([(0,i.EM)("menu-button")],te);const ne={closeDrawer:"menuSliderClosed"};let re=class extends r.WF{constructor(){super(...arguments),this.menus=[],this.open=!1,this.manuallyHandleClose=!1,this.selectedMenu="",this.selectedMenuAction=r.s6,this.animateMenuOpen=!1}static get styles(){return K}updated(){var e;const t=(null===(e=this.selectedMenuDetails)||void 0===e?void 0:e.actionButton)||r.s6;t!==this.selectedMenuAction&&(this.selectedMenuAction=t)}setSelectedMenu({detail:e}){var t;const{id:n}=e;this.selectedMenu=this.selectedMenu===n?"":n,this.selectedMenuAction=(null===(t=this.selectedMenuDetails)||void 0===t?void 0:t.actionButton)||r.s6,this.updateComplete.then(()=>{var e;null===(e=this.contentCloseButton)||void 0===e||e.focus()})}closeMenu(){this.manuallyHandleClose||(this.open=!1);const{closeDrawer:e}=ne,t=new CustomEvent(e,{detail:this.selectedMenuDetails});this.dispatchEvent(t)}closePanel(){const e=this.selectedMenu;this.selectedMenu="",this.selectedMenuAction=r.s6,e&&this.updateComplete.then(()=>{const t=this.menus.findIndex(t=>t.id===e);if(-1!==t){const e=this.menuList.querySelector(`li:nth-child(${t+1}) menu-button`);null==e||e.focus()}})}handleKeyDown(e){"Escape"===e.key&&(e.preventDefault(),this.selectedMenu?this.closePanel():this.closeMenu())}get selectedMenuDetails(){return this.menus.find(e=>e.id===this.selectedMenu)}get sliderDetailsClass(){return`${this.animateMenuOpen?"animate":""} ${this.open?"open":""}`}get selectedMenuClass(){return this.selectedMenu?"open":""}get menuItems(){return this.menus.map(e=>r.qy`
420
+ <li>
421
+ <menu-button
422
+ @menuTypeSelected=${this.setSelectedMenu}
423
+ .icon=${e.icon}
424
+ .label=${e.label}
425
+ .menuDetails=${e.menuDetails||""}
426
+ .buttonId=${e.id}
427
+ .selected=${e.id===this.selectedMenu}
428
+ .followable=${e.followable||!1}
429
+ .href=${e.href||""}
430
+ ></menu-button>
431
+ </li>
432
+ `)}get renderMenuHeader(){const{label:e="",menuDetails:t=""}=this.selectedMenuDetails||{},n=this.selectedMenuAction?"with-secondary-action":"",o=this.selectedMenuAction?r.qy`<span class="custom-action">${this.selectedMenuAction}</span>`:r.s6;return r.qy`
433
+ <header class="${n}">
434
+ <div class="details">
435
+ <h3>${e}</h3>
436
+ <span class="extra-details">${t}</span>
437
+ </div>
438
+ ${o}
439
+ <button
440
+ class="close"
441
+ aria-label="Close this menu"
442
+ title="Close this menu"
443
+ @click=${this.closePanel}
444
+ >
445
+ <ia-icon-collapse-sidebar></ia-icon-collapse-sidebar>
446
+ </button>
447
+ </header>
448
+ `}get closeButton(){return r.qy`
449
+ <button
450
+ class="close"
451
+ aria-label="Close this menu"
452
+ title="Close this menu"
453
+ @click=${this.closeMenu}
454
+ >
455
+ <ia-icon-collapse-sidebar></ia-icon-collapse-sidebar>
456
+ </button>
457
+ `}render(){var e;return r.qy`
458
+ <div class="main" @keydown=${this.handleKeyDown}>
459
+ <div class="menu ${this.sliderDetailsClass}">
460
+ ${this.closeButton}
461
+ <ul class="menu-list">
462
+ ${this.menuItems}
463
+ </ul>
464
+ <div
465
+ class="content ${this.selectedMenuClass}"
466
+ @menuTypeSelected=${this.setSelectedMenu}
467
+ >
468
+ ${this.renderMenuHeader}
469
+ <section>
470
+ <div class="selected-menu">
471
+ ${(null===(e=this.selectedMenuDetails)||void 0===e?void 0:e.component)||r.s6}
472
+ </div>
473
+ </section>
474
+ </div>
475
+ </div>
476
+ </div>
477
+ `}};(0,o.Cg)([(0,i.MZ)({type:Array})],re.prototype,"menus",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],re.prototype,"open",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],re.prototype,"manuallyHandleClose",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],re.prototype,"selectedMenu",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],re.prototype,"selectedMenuAction",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],re.prototype,"animateMenuOpen",void 0),(0,o.Cg)([(0,i.P)(".content.open button.close")],re.prototype,"contentCloseButton",void 0),(0,o.Cg)([(0,i.P)(".menu-list")],re.prototype,"menuList",void 0),re=(0,o.Cg)([(0,i.EM)("ia-menu-slider")],re);let oe=class extends r.WF{constructor(){super(...arguments),this.loaderMessage=""}get bookIconSvg(){return r.JW`
478
+ <g class="bookIcon" transform="matrix(1 0 0 -1 28 67.362264)">
479
+ <path d="m44.71698 31.6981124v-29.99320678s-18.0956599.30735848-18.6322637-.7171698c-.0633962-.12226414-1.890566-.59207545-2.9745282-.59207545-1.3228302 0-3.5122641 0-4.1286791.74547168-.9707547 1.17452827-18.82811278.71660375-18.82811278.71660375v30.040754l1.83849052.7867924.29094339-28.48188608s15.94981097.15339622 17.09094297-1.10716978c.8145283-.90056602 4.997547-.91641507 5.3450942-.3526415.9611321 1.55716977 14.7101883 1.31716978 17.6077354 1.45981128l.3266038 28.22830118z"/>
480
+ <path d="m40.1129424 33.5957539h-12.8337733c-1.8690565 0-3.1098112-.7545283-3.9299999-1.6279245v-26.70452764l1.2362264-.00792453c.4584906.72962262 3.0922641 1.39415091 3.0922641 1.39415091h10.1298111s1.0381131.01754717 1.5141509.47377357c.5643396.54056602.7913207 1.36981129.7913207 1.36981129z"/>
481
+ <path d="m17.3354713 33.5957539h-12.8337733v-25.37660316s0-.75283017.49358489-1.14113205c.52867924-.41433961 1.3415094-.42849055 1.3415094-.42849055h10.59905631s2.2075471-.52698112 3.0928301-1.39415091l1.2.00792453v26.74245214c-.8201886.8581132-2.0530188 1.59-3.8932074 1.59"/>
482
+ </g>
483
+ `}get icon(){return this.bookIconSvg}get loader(){return r.JW`
484
+ <svg
485
+ height="100"
486
+ viewBox="0 0 100 100"
487
+ width="100"
488
+ xmlns="http://www.w3.org/2000/svg"
489
+ aria-labelledby="item-loading"
490
+ >
491
+ <title id="item-loading">Currently loading viewer.</title>
492
+ <desc>Please wait while we load theater.</desc>
493
+ <g fill="#333" fill-rule="evenodd" class="book-icon">
494
+ ${this.icon}
495
+ <path
496
+ class="ring"
497
+ d="m17.8618849 11.6970233c18.5864635-15.59603144 45.6875867-15.59603102 64.2740497.000001 1.9271446 1.6170806 2.1785128 4.4902567.5614466 6.4174186-1.6170661 1.9271618-4.4902166 2.1785323-6.4173612.5614517-15.1996922-12.75416882-37.3625282-12.75416916-52.5622206-.000001-15.19969387 12.7541707-19.04823077 34.5805019-9.1273354 51.7641499 9.9208955 17.183646 30.7471499 24.7638499 49.3923323 17.9774983 18.6451823-6.7863521 29.7266014-25.9801026 26.2811129-45.5206248-.436848-2.4775114 1.2174186-4.8400696 3.6949079-5.2769215 2.4774893-.4368518 4.8400264 1.2174296 5.2768744 3.694941 4.2132065 23.8945096-9.3373563 47.3649806-32.137028 55.6634567-22.799672 8.2984758-48.2663986-.9707372-60.39785211-21.9832155-12.1314534-21.012481-7.42539173-47.7021198 11.16107351-63.2981544z"
498
+ fill-rule="nonzero"
499
+ />
500
+ </g>
501
+ </svg>
502
+ `}render(){const e=this.loaderMessage?r.qy`<h2>${this.loaderMessage}</h2>`:r.s6;return r.qy`
503
+ <div class="place-holder">
504
+ ${e} ${this.loader}
505
+ <h3>Loading viewer</h3>
506
+ </div>
507
+ `}static get styles(){return r.AH`
508
+ .place-holder {
509
+ width: 30%;
510
+ margin: auto;
511
+ text-align: center;
512
+ color: var(--primaryTextColor);
513
+ }
514
+
515
+ .place-holder {
516
+ position: relative;
517
+ }
518
+
519
+ .place-holder svg {
520
+ display: block;
521
+ width: 60%;
522
+ max-width: 100px;
523
+ height: auto;
524
+ margin: auto;
525
+ }
526
+
527
+ svg * {
528
+ fill: var(--primaryTextColor);
529
+ }
530
+
531
+ svg .ring {
532
+ animation: rotate 1.3s infinite linear;
533
+ transform-origin: 50px 50px;
534
+ transform-box: fill-box;
535
+ display: block; // transform won't work on inline style
536
+ }
537
+
538
+ @keyframes rotate {
539
+ 0% {
540
+ -moz-transform: rotate(-360deg);
541
+ -webkit-transform: rotate(-360deg);
542
+ transform: rotate(-360deg);
543
+ }
544
+ }
545
+ `}};(0,o.Cg)([(0,i.MZ)({type:String})],oe.prototype,"loaderMessage",void 0),oe=(0,o.Cg)([(0,i.EM)("ia-itemnav-loader")],oe);let ie=class extends r.WF{constructor(){super(...arguments),this.identifier=""}emitLoaded(){this.dispatchEvent(new CustomEvent("loadingStateUpdated",{detail:{loaded:!0}}))}updated(e){e.has("identifier")&&this.emitLoaded()}get downloadUrl(){return`/download/${this.identifier}`}render(){return r.qy`
546
+ <section>
547
+ <h2>THERE IS NO PREVIEW AVAILABLE FOR THIS ITEM</h2>
548
+ <p>
549
+ This item does not appear to have any files that can be experienced on
550
+ Archive.org. <br />
551
+ Please download files in this item to interact with them on your
552
+ computer.
553
+ </p>
554
+ <a href=${this.downloadUrl}>Show all files</a>
555
+ </section>
556
+ `}static get styles(){return r.AH`
557
+ :host {
558
+ color: var(--primaryTextColor, #fff);
559
+ text-align: center;
560
+ }
561
+ section {
562
+ width: 100%;
563
+ margin: 5%;
564
+ padding: 0 5%;
565
+ }
566
+ p {
567
+ font-size: 1.4rem;
568
+ }
569
+ a {
570
+ color: var(--primaryTextColor, #fff);
571
+ background-color: rgb(25, 72, 128);
572
+ min-height: 35px;
573
+ cursor: pointer;
574
+ line-height: normal;
575
+ border-radius: 0.4rem;
576
+ text-align: center;
577
+ vertical-align: middle;
578
+ font-size: 1.4rem;
579
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
580
+ display: inline-block;
581
+ padding: 0.85rem 1.2rem;
582
+ border: 1px solid rgb(197, 209, 223);
583
+ white-space: nowrap;
584
+ appearance: auto;
585
+ box-sizing: border-box;
586
+ user-select: none;
587
+ text-decoration: none;
588
+ }
589
+ `}};(0,o.Cg)([(0,i.MZ)({type:String})],ie.prototype,"identifier",void 0),ie=(0,o.Cg)([(0,i.EM)("ia-no-theater-available")],ie);let ae=class extends r.WF{constructor(){super(...arguments),this.viewAvailable=!0,this.baseHost="archive.org",this.signedIn=!1,this.menuContents=[],this.menuShortcuts=[],this.viewportInFullscreen=null,this.menuOpened=!1,this.loaded=!1,this.openMenuState="shift"}disconnectedCallback(){super.disconnectedCallback(),this.removeResizeObserver()}updated(e){if(e.has("sharedObserver")){const t=e.get("sharedObserver");null==t||t.removeObserver(this.resizeObserverConfig),this.setResizeObserver()}}handleResize(e){const{width:t}=e.contentRect;this.openMenuState=t<=600?"overlay":"shift"}setResizeObserver(){var e,t;null===(e=this.sharedObserver)||void 0===e||e.addObserver(this.resizeObserverConfig),null===(t=this.sharedObserver)||void 0===t||t.addObserver({target:this.headerSlot,handler:{handleResize:({contentRect:e})=>{e.height&&this.requestUpdate()}}})}removeResizeObserver(){var e;null===(e=this.sharedObserver)||void 0===e||e.removeObserver(this.resizeObserverConfig)}get resizeObserverConfig(){return{handler:this,target:this.frame}}get loaderTitle(){return this.viewportInFullscreen?"Internet Archive":""}get loadingArea(){return r.qy`
590
+ <div class="loading-area">
591
+ <div class="loading-view">
592
+ <ia-itemnav-loader
593
+ .loaderMessage=${this.loaderTitle}
594
+ ></ia-itemnav-loader>
595
+ </div>
596
+ </div>
597
+ `}slotChange(e,t){var n;const r=null===(n=e.target.assignedNodes())||void 0===n?void 0:n[0];this.dispatchEvent(new CustomEvent("slotChange",{detail:{slot:r,type:t}})),this.requestUpdate()}render(){var e,t;const n=this.loaded?"":"hidden",o=(null===(t=null===(e=this.headerSlot)||void 0===e?void 0:e.assignedNodes()[0])||void 0===t?void 0:t.offsetHeight)||0;return r.qy`
598
+ <div id="frame" class=${this.menuClass}>
599
+ <slot
600
+ name="header"
601
+ style=${`height: ${o}px`}
602
+ @slotchange=${e=>this.slotChange(e,"header")}
603
+ ></slot>
604
+ <div class="menu-and-reader">
605
+ ${this.shouldRenderMenu?this.renderSideMenu:r.s6}
606
+ <div id="reader" class=${n}>
607
+ ${this.renderViewport}
608
+ </div>
609
+ ${this.loaded?r.s6:this.loadingArea}
610
+ </div>
611
+ </div>
612
+ `}get noTheaterView(){var e,t;return r.qy`<ia-no-theater-available
613
+ .identifier=${null===(t=null===(e=this.item)||void 0===e?void 0:e.metadata)||void 0===t?void 0:t.identifier}
614
+ @loadingStateUpdated=${this.loadingStateUpdated}
615
+ ></ia-no-theater-available>`}get renderViewport(){if(!this.viewAvailable)return this.noTheaterView;const e=this.loaded?"opacity: 1;":"opacity: 0;";return r.qy`
616
+ <div slot="main" style=${e}>
617
+ <slot
618
+ name="main"
619
+ @slotchange=${e=>this.slotChange(e,"main")}
620
+ ></slot>
621
+ </div>
622
+ `}loadingStateUpdated(e){const{loaded:t}=e.detail;this.loaded=null!=t&&t}manageViewportFullscreen(e){const t=!!e.detail.isFullScreen;this.viewportInFullscreen=t||null;const n=new CustomEvent("fullscreenToggled",{detail:e.detail});this.dispatchEvent(n)}get shouldRenderMenu(){var e;return!!(null===(e=this.menuContents)||void 0===e?void 0:e.length)}toggleMenu(e=void 0){this.menuOpened=void 0!==e?e:!this.menuOpened,this.menuOpened?this.updateComplete.then(()=>{var e,t;const n=null===(t=null===(e=this.menuSlider)||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("button.close");null==n||n.focus()}):this.updateComplete.then(()=>{var e;null===(e=this.toggleMenuButton)||void 0===e||e.focus()})}closeMenu(){this.toggleMenu(!1)}setOpenMenu(e){const{id:t}=e.detail;this.openMenu=t!==this.openMenu?t:void 0}setMenuContents(e){const t=[...e.detail];this.menuContents=t}setMenuShortcuts(e){this.menuShortcuts=[...e.detail]}manageSideMenuEvents(e){const{menuId:t,action:n}=e.detail;t&&("open"===n?this.openShortcut(t):"toggle"===n&&(this.openMenu=t,this.toggleMenu()))}get menuToggleButton(){return r.qy`
623
+ <button
624
+ class="toggle-menu"
625
+ @click=${this.toggleMenu}
626
+ title="Open side panel"
627
+ aria-label="Open side panel"
628
+ aria-expanded="false"
629
+ >
630
+ <ia-icon-ellipses aria-hidden="true"></ia-icon-ellipses>
631
+ </button>
632
+ `}get selectedMenuId(){return this.openMenu||""}get renderSideMenu(){return r.qy`
633
+ <nav>
634
+ <div class="minimized ${m({hidden:this.menuOpened})}">
635
+ ${this.shortcuts} ${this.menuToggleButton}
636
+ </div>
637
+ <div id="menu" class=${m({hidden:!this.menuOpened})}>
638
+ <ia-menu-slider
639
+ .menus=${this.menuContents}
640
+ .selectedMenu=${this.selectedMenuId}
641
+ @menuTypeSelected=${this.setOpenMenu}
642
+ @menuSliderClosed=${this.closeMenu}
643
+ manuallyHandleClose
644
+ open
645
+ ></ia-menu-slider>
646
+ </div>
647
+ </nav>
648
+ `}openShortcut(e=""){this.openMenu=e,this.menuOpened=!0}get shortcuts(){const e=this.menuShortcuts.map(({icon:e,id:t,label:n})=>"fullscreen"===t?r.qy`${e}`:r.qy`
649
+ <button
650
+ class="shortcut ${t}"
651
+ @click="${()=>this.openShortcut(t)}"
652
+ title=${n}
653
+ aria-label=${n}
654
+ aria-expanded="false"
655
+ >
656
+ ${e}
657
+ </button>
658
+ `);return r.qy`<div class="shortcuts">${e}</div>`}get menuClass(){var e,t;const n=(null===(e=this.menuContents)||void 0===e?void 0:e.length)||(null===(t=this.menuShortcuts)||void 0===t?void 0:t.length);return`${this.menuOpened&&n?"open":""} ${this.viewportInFullscreen?"fullscreen":""} ${this.openMenuState}`}static get styles(){const e=r.AH`var(--menuWidth, 320px)`,t=r.AH`var(--animationTiming, 200ms)`,n=r.AH`transform ${t} ease-out`,o=r.AH`var(--theaterMenuMargin, 42px)`,i=r.AH`var(--theaterBgColor, #000)`;return r.AH`
659
+ :host,
660
+ #frame,
661
+ .menu-and-reader {
662
+ position: relative;
663
+ overflow: hidden;
664
+ display: block;
665
+ }
666
+
667
+ :host,
668
+ #frame,
669
+ .loading-area,
670
+ .loading-view {
671
+ min-height: inherit;
672
+ height: inherit;
673
+ }
674
+
675
+ slot {
676
+ display: block;
677
+ width: 100%;
678
+ }
679
+
680
+ slot * {
681
+ display: block;
682
+ height: inherit;
683
+ }
684
+
685
+ #frame {
686
+ background-color: ${i};
687
+ color-scheme: dark;
688
+ display: flex;
689
+ flex-direction: column;
690
+ }
691
+
692
+ #frame.fullscreen {
693
+ position: fixed;
694
+ top: 0;
695
+ bottom: 0;
696
+ left: 0;
697
+ right: 0;
698
+ z-index: 9;
699
+ }
700
+
701
+ .loading-view {
702
+ height: 100%;
703
+ display: flex;
704
+ align-items: center;
705
+ justify-content: center;
706
+ }
707
+
708
+ .loading-area {
709
+ width: 100%;
710
+ }
711
+
712
+ ia-itemnav-loader {
713
+ display: block;
714
+ width: 100%;
715
+ }
716
+
717
+ .hidden {
718
+ display: none !important;
719
+ }
720
+
721
+ button {
722
+ cursor: pointer;
723
+ padding: 0;
724
+ border: 0;
725
+ }
726
+
727
+ .menu-and-reader {
728
+ position: relative;
729
+ display: flex;
730
+ flex: 1;
731
+ }
732
+
733
+ nav button {
734
+ background: none;
735
+ }
736
+
737
+ nav .minimized {
738
+ background: rgba(0, 0, 0, 0.7);
739
+ padding-top: 6px;
740
+ position: absolute;
741
+ width: ${o};
742
+ z-index: 2;
743
+ left: 0;
744
+ border-bottom-right-radius: 5%;
745
+ }
746
+
747
+ nav .minimized button {
748
+ width: var(--iconWidth);
749
+ height: var(--iconHeight);
750
+ margin-bottom: 0.2rem;
751
+ margin: auto;
752
+ display: inline-flex;
753
+ vertical-align: middle;
754
+ -webkit-box-align: center;
755
+ align-items: center;
756
+ -webkit-box-pack: center;
757
+ justify-content: center;
758
+ width: ${o};
759
+ height: ${o};
760
+ }
761
+
762
+ nav .minimized button > * {
763
+ /** Prevent the icon's SVG description from stealing tooltip message */
764
+ pointer-events: none;
765
+ }
766
+
767
+ nav .minimized button.toggle-menu > * {
768
+ border: 2px solid var(--iconStrokeColor);
769
+ border-radius: var(--iconWidth);
770
+ width: var(--iconWidth);
771
+ height: var(--iconHeight);
772
+ margin: auto;
773
+ }
774
+
775
+ ia-icon-ellipses {
776
+ width: var(--iconWidth);
777
+ height: var(--iconHeight);
778
+ }
779
+
780
+ #menu {
781
+ position: absolute;
782
+ top: 0;
783
+ bottom: 0;
784
+ left: 0;
785
+ z-index: 3;
786
+ overflow: hidden;
787
+ transform: translateX(-${e});
788
+ width: ${e};
789
+ transform: translateX(calc(${e} * -1));
790
+ transition: ${n};
791
+ }
792
+
793
+ #reader {
794
+ position: relative;
795
+ z-index: 1;
796
+ transform: translateX(0);
797
+ width: 100%;
798
+ display: flex;
799
+ }
800
+
801
+ #reader > * {
802
+ width: 100%;
803
+ display: flex;
804
+ flex: 1;
805
+ }
806
+
807
+ .open.overlay #reader {
808
+ transition: none;
809
+ }
810
+
811
+ .open #menu {
812
+ width: ${e};
813
+ transform: translateX(0);
814
+ transition: ${n};
815
+ }
816
+
817
+ .open.shift #reader {
818
+ width: calc(100% - ${e});
819
+ margin-left: ${e};
820
+ transition: ${n};
821
+ }
822
+ `}};(0,o.Cg)([(0,i.MZ)({type:Object,converter:e=>e&&"string"==typeof e?new F(JSON.parse(atob(e))):e})],ae.prototype,"item",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"viewAvailable",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],ae.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],ae.prototype,"signedIn",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],ae.prototype,"menuContents",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],ae.prototype,"menuShortcuts",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"viewportInFullscreen",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"menuOpened",void 0),(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],ae.prototype,"openMenu",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],ae.prototype,"modal",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],ae.prototype,"sharedObserver",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"loaded",void 0),(0,o.Cg)([(0,i.wk)()],ae.prototype,"openMenuState",void 0),(0,o.Cg)([(0,i.P)("#frame")],ae.prototype,"frame",void 0),(0,o.Cg)([(0,i.P)('slot[name="header"]')],ae.prototype,"headerSlot",void 0),(0,o.Cg)([(0,i.P)('slot[name="main"]')],ae.prototype,"mainSlot",void 0),(0,o.Cg)([(0,i.P)("ia-menu-slider")],ae.prototype,"menuSlider",void 0),(0,o.Cg)([(0,i.P)("button.toggle-menu")],ae.prototype,"toggleMenuButton",void 0),ae=(0,o.Cg)([(0,i.EM)("iaux-item-navigator")],ae),n(90);var se=r.qy`
823
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="twitterTitleID twitterDescID">
824
+ <title id="twitterTitleID">Twitter icon</title>
825
+ <desc id="twitterDescID">The Twitter logo, a cartoon bird</desc>
826
+ <path d="m31.5297453 8.76273313c-.3135031.40766104-.7447036.83083673-1.2936015 1.26952707-.5488979.4386904-.9169698.7837578-1.1042157 1.0352022.1562166 2.319709-.1417719 4.5297454-.8939653 6.6301092-.7521935 2.1003638-1.8023754 3.9182538-3.1505457 5.45367-1.3481704 1.5354162-2.9627648 2.8284828-4.8437835 3.8791996-1.8810186 1.0507169-3.8321207 1.7483416-5.8533062 2.092874s-4.1215493.2894286-6.30109136-.1653114c-2.17954205-.45474-4.2092874-1.3401455-6.08923604-2.6562165 2.72737.4697196 5.67408517-.2514445 8.8401455-2.1634924-3.0719024-.7521935-4.88979241-2.2881447-5.45367-4.6078537 1.12882516.0631287 1.86550396.0631287 2.21003638 0-2.91568586-1.2850417-4.38904344-3.3693558-4.42007276-6.2529424.21934517.0310293.53284828.1487267.94050931.3530922s.78375775.3060133 1.12829017.3049433c-.81532206-.7211641-1.41076396-1.9045581-1.7863257-3.5501819-.37556173-1.64562376-.17173122-3.17355015.61149155-4.58377912 1.81789001 1.88101862 3.6908838 3.36989086 5.61898138 4.46661672 1.92809757 1.0967259 4.22426707 1.7547614 6.88850847 1.9741066-.2503745-1.1908838-.1722662-2.32719882.2343248-3.40894502.4065911-1.0817462 1.0416221-1.93612241 1.9050931-2.56312861.863471-.62700621 1.8114702-1.0817462 2.8439975-1.36421999 1.0325272-.28247378 2.0827091-.27444896 3.1505456.02407447s1.9767815.87042585 2.726835 1.71570726c1.3791997-.37663172 2.6802911-.87845068 3.9032742-1.50545688-.0310293.37663171-.1407019.74470361-.3290178 1.1042157-.1883158.35951209-.3530922.62593623-.4943291.79927242s-.3841216.4317355-.728654.77519795c-.3445324.34346244-.5638776.57832227-.6580355.70457949.2193452-.09415792.6895998-.23539482 1.410764-.42371067.7211641-.18831586 1.2069334-.39214638 1.4573079-.61149155 0 .44350524-.1567516.86668093-.4702547 1.27434196z" class="fill-color" />
827
+ </svg>
828
+ `;class le extends r.WF{static get styles(){return r.AH`
829
+ :host {
830
+ width: var(--iconWidth, 'auto');
831
+ height: var(--iconHeight, 'auto');
832
+ }
833
+
834
+ .fill-color {
835
+ fill: var(--iconFillColor);
836
+ }
837
+
838
+ .stroke-color {
839
+ stroke: var(--iconStrokeColor);
840
+ }
841
+ `}render(){return se}}customElements.define("ia-icon-twitter",le);var ce=r.qy`
842
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="facebookTitleID facebookDescID">
843
+ <title id="facebookTitleID">Facebook icon</title>
844
+ <desc id="facebookDescID">A lowercase f</desc>
845
+ <path d="m30.91057 19.2442068.2670004-5.3339402h-5.7329237c-.0890001-3.4962895.25183-5.42243459 1.0224903-5.77843514.3560005-.17800028.8004955-.28925046 1.333485-.33375053s1.0442346-.0520853 1.5337353-.02275571c.4895008.02932959 1.045246.01466479 1.6672356-.04399439.0890001-1.59997977.1335002-3.24445961.1335002-4.93343953-2.1633102-.20732987-3.6742898-.28115953-4.5329389-.22148898-2.8146294.17800028-4.7847688 1.25965538-5.9104183 3.2449653-.1780003.3256596-.3261653.68873971-.444495 1.08924034-.1183298.40050062-.2144095.76358074-.2882391 1.08924034-.0738297.32565959-.125915.7848194-.1562559 1.37747942-.030341.59266002-.052591 1.04474028-.0667501 1.35624078-.0141592.3115005-.0217444.8449956-.0227558 1.6004854v1.5777298h-3.8229605v5.3339401h3.8669549v14.622824h5.8224296c0-.3560006-.0146648-1.6819003-.0439944-3.9776994-.0293296-2.295799-.0515796-4.2957737-.0667501-5.9999241s-.0075853-3.2525506.0227557-4.6452005h5.4219289z" class="fill-color" />
846
+ </svg>
847
+ `;class ue extends r.WF{static get styles(){return r.AH`
848
+ :host {
849
+ width: var(--iconWidth, 'auto');
850
+ height: var(--iconHeight, 'auto');
851
+ }
852
+
853
+ .fill-color {
854
+ fill: var(--iconFillColor);
855
+ }
856
+
857
+ .stroke-color {
858
+ stroke: var(--iconStrokeColor);
859
+ }
860
+ `}render(){return ce}}customElements.define("ia-icon-facebook",ue);var de=r.qy`
861
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="tumblrTitleID tumblrDescID">
862
+ <title id="tumblrTitleID">Tumblr icon</title>
863
+ <desc id="tumblrDescID">A lowercase letter t</desc>
864
+ <path d="m8.50321407 8.54544475v5.32088575c.15641786.0310693.6819176.0310693 1.57649923 0 .8945816-.0310693 1.3574071.0160703 1.3884764.1414189.0942792 1.5695354.1333837 3.2253149.1173133 4.9673385-.0160703 1.7420236-.0316049 3.3426283-.0466039 4.8018141s.2046288 2.824628.6588835 4.0963267c.4542546 1.2716986 1.1999178 2.2209194 2.2369897 2.8476622 1.2556283.784232 2.9896167 1.207953 5.2019653 1.271163 2.2123485.0632099 4.1659648-.2506972 5.8608487-.9417213-.0310693-.3449764-.0230341-1.4045467.0241055-3.1787109.0471397-1.7741643-.0080351-2.75499-.1655244-2.9424772-3.5472571 1.0360005-5.697467.6904885-6.4506298-1.0365361-.7220934-1.6638147-.8635123-4.9909084-.4242566-9.981281v-.046604h6.7318605v-5.32088568h-6.7318605v-6.54383772h-4.0497228c-.2828378 1.28669763-.6122795 2.35376743-.9883252 3.20120941-.3760457.84744199-.98029 1.60060471-1.812733 2.25948817-.832443.65888347-1.87594303 1.01993018-3.1305 1.08314014z" class="fill-color" />
865
+ </svg>
866
+ `;class he extends r.WF{static get styles(){return r.AH`
867
+ :host {
868
+ width: var(--iconWidth, 'auto');
869
+ height: var(--iconHeight, 'auto');
870
+ }
871
+
872
+ .fill-color {
873
+ fill: var(--iconFillColor);
874
+ }
875
+
876
+ .stroke-color {
877
+ stroke: var(--iconStrokeColor);
878
+ }
879
+ `}render(){return de}}customElements.define("ia-icon-tumblr",he);var pe=r.qy`
880
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="pinterestTitleID pinterestDescID">
881
+ <title id="pinterestTitleID">Pinterest icon</title>
882
+ <desc id="pinterestDescID">A stylized letter p</desc>
883
+ <path d="m11.9051049 30.5873434.653491-1.0742755.4207845-.839975c.2805229-.591861.5371377-1.2533214.7698443-1.9843813.2327065-.7310599.4659444-1.6029125.6997135-2.6155579.2337692-1.0126455.4128151-1.752206.5371377-2.2186817.0308151.030815.0775689.0855382.1402615.1641697.0626927.0786314.1094465.1333547.1402615.1641697.1243227.1870153.2178304.311338.280523.372968 1.1210293.964829 2.3817888 1.4631823 3.7822785 1.4950599 1.4939973 0 2.8790795-.3426843 4.1552465-1.0280529 2.1166733-1.1826593 3.6733633-3.1128487 4.6700699-5.7905679.4048457-1.1518444.6848374-2.5996192.8399751-4.3433245.1243226-1.587505-.0781002-3.0974411-.6072685-4.5298084-.903199-2.36638128-2.5528653-4.20306294-4.948999-5.51004497-1.276167-.65349101-2.5990879-1.05833667-3.9687625-1.21453696-1.525875-.21783034-3.1293188-.17107651-4.8103315.14026149-2.7701643.52916833-5.02709913 1.743174-6.77080442 3.64201699-1.99235065 2.14748836-2.98852598 4.62225355-2.98852598 7.42429545 0 2.9571797.9494215 5.0584455 2.84826449 6.3037975l.83997504.4207845c.12432268 0 .22526845.0154075.3028373.0462225s.1551377.0074381.23270656-.0701308c.07756885-.0775688.13229208-.1243226.16416969-.1402614s.07066204-.0860696.11635328-.2103923c.04569124-.1243226.07703756-.2098609.09403895-.2566147.01700139-.0467539.04834771-.1476996.09403895-.3028373s.06906816-.2486454.07013074-.280523l.14026149-.5132295c.06269263-.311338.09403895-.5291684.09403895-.653491-.03081502-.1243227-.12432268-.2799917-.28052297-.467007-.15620029-.1870154-.23376915-.2959305-.23270656-.3267455-.62267599-.8096914-.9494215-1.7904592-.98023652-2.9423035-.03081502-1.55669.28052297-2.9731185.93401399-4.24928547 1.18265932-2.45882635 3.17501002-3.93741618 5.97705192-4.43576949 1.6183201-.311338 3.1356943-.25661476 4.5521228.16416969 1.4164285.42078446 2.5135496 1.09765239 3.2913633 2.03060379.8405063 1.02752164 1.3229208 2.28828114 1.4472435 3.78227848.1243227 1.4004897-.0313463 2.9725872-.467007 4.7162925-.3740306 1.3696746-.9186065 2.5528653-1.6337275 3.5495719-.9967066 1.245352-2.0863896 1.8834355-3.269049 1.9142505-1.7118277.0626926-2.7547568-.6375522-3.1287874-2.1007345-.0935077-.4664757 0-1.2134744.2805229-2.240996.7469987-2.5842117 1.1359055-3.9384788 1.1667206-4.0628015.1870153-1.0275216.2024228-1.7904591.0462225-2.2888124-.1870153-.65349104-.5759222-1.15928246-1.1667205-1.51737429-.5907984-.35809182-1.2756357-.39687625-2.054512-.11635327-1.1826594.43566067-1.9610044 1.40048968-2.335035 2.89448706-.311338 1.306982-.2491767 2.6299028.186484 3.9687625 0 .0626926.0313463.1402615.094039.2327065.0626926.0924451.0940389.1700139.0940389.2327066 0 .0935076-.0313463.2491766-.0940389.467007-.0626927.2178303-.094039.3580918-.094039.4207844-.0935076.4356607-.3038999 1.3308903-.6311767 2.6856887-.3272768 1.3547985-.5838915 2.3897582-.7698443 3.1048793-.7778136 3.2068876-1.12049796 5.5881451-1.02805289 7.1437725l.37296809 2.7558194c.653491-.591861 1.2294131-1.2299445 1.7277664-1.9142505z" class="fill-color" />
884
+ </svg>
885
+ `;class fe extends r.WF{static get styles(){return r.AH`
886
+ :host {
887
+ width: var(--iconWidth, 'auto');
888
+ height: var(--iconHeight, 'auto');
889
+ }
890
+
891
+ .fill-color {
892
+ fill: var(--iconFillColor);
893
+ }
894
+
895
+ .stroke-color {
896
+ stroke: var(--iconStrokeColor);
897
+ }
898
+ `}render(){return pe}}customElements.define("ia-icon-pinterest",fe);var me=r.qy`
899
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="emailTitleID emailDescID">
900
+ <title id="emailTitleID">Email icon</title>
901
+ <desc id="emailDescID">An illustration of an envelope</desc>
902
+ <path d="m32 7.04156803v19.91686397c0 .5752421-.4763773 1.041568-1.0640184 1.041568h-27.87196316c-.58764116 0-1.06401844-.4663259-1.06401844-1.041568v-19.91686397c0-.57524214.47637728-1.04156803 1.06401844-1.04156803h27.87196316c.5876411 0 1.0640184.46632589 1.0640184 1.04156803zm-26.25039901 1.19676167 10.04327011 10.1323738c.5135662.4194048.8817166.6291071 1.1044511.6291071.1198794 0 .2695514-.0503424.4490158-.1510273.1794644-.100685.3291364-.2013699.4490158-.3020548l.1798191-.1510273 10.1198794-10.15841306zm16.77212271 9.7303286 6.8831353 6.7889404v-13.5778809zm-17.92871075-6.6379131v13.350819l6.78098955-6.6629107zm22.09008685 14.2059464-5.9074304-5.8588202-.9757049.9551179-.3594018.3295984c-.0342324.0304241-.0665646.0587822-.0969964.0850743l-.1597867.1329606c-.0684912.0540844-.1198794.0895749-.1541644.1064714-.6674943.3687151-1.3523675.5530727-2.0546196.5530727-.65047 0-1.3782586-.218035-2.1833659-.6541048l-.6682036-.4520405-1.0278418-1.0311524-5.95850326 5.832781z" class="fill-color" />
903
+ </svg>
904
+ `;class ve extends r.WF{static get styles(){return r.AH`
905
+ :host {
906
+ width: var(--iconWidth, 'auto');
907
+ height: var(--iconHeight, 'auto');
908
+ }
909
+
910
+ .fill-color {
911
+ fill: var(--iconFillColor);
912
+ }
913
+
914
+ .stroke-color {
915
+ stroke: var(--iconStrokeColor);
916
+ }
917
+ `}render(){return me}}customElements.define("ia-icon-email",ve);var be=r.qy`
918
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="linkTitleID linkDescID">
919
+ <title id="linkTitleID">Link icon</title>
920
+ <desc id="linkDescID">Two chain links linked together</desc>
921
+ <path d="m7.80511706 12.3659763c1.2669254-2.2579539 4.09819784-2.9949938 6.41200864-1.7733458l.2295791.12871 1.6067188.9559859 3.5467013-6.31849361c1.2682451-2.26030597 4.104098-2.99652769 6.4192376-1.76952182l.2223501.12488594 3.2168204 1.91103915c2.2770002 1.3527136 3.1866331 4.21502324 2.0564431 6.51290984l-.1198433.2278304-5.2002499 9.2680474c-1.2669254 2.2579539-4.0981978 2.9949938-6.4120086 1.7733458l-.2295791-.12871-1.6096554-.9558482-3.5437647 6.3183559c-1.2682451 2.260306-4.104098 2.9965277-6.41923761 1.7695218l-.22235013-.1248859-3.21682032-1.9110392c-2.27700024-1.3527136-3.18663314-4.2150232-2.05644312-6.5129098l.11984332-.2278304zm13.93955474-5.73311741-3.563271 6.35055051c1.889633 1.4530595 2.5776248 4.0429866 1.5410255 6.156875l-.1223014.2328355-.4183304.7430134 1.6096554.9558483c1.1431442.6791157 2.5155496.3977368 3.1667361-.5628389l.0921501-.1491451 5.2002498-9.2680474c.5752467-1.0252226.2110342-2.4011579-.8559335-3.14755806l-.1742742-.11247814-3.2168203-1.91103915c-1.1402863-.67741793-2.5086889-.39913772-3.1618387.55564729zm-11.79500786 7.00714351-5.20024982 9.2680474c-.57524673 1.0252226-.21103426 2.4011579.85593348 3.1475581l.17427416.1124781 3.21682032 1.9110392c1.14028632.6774179 2.50868892.3991377 3.16183872-.5556473l.0970474-.1563368 3.5622708-6.3513198c-1.8888875-1.4532134-2.5764504-4.042623-1.5400057-6.1561456l.1222818-.2327956.4153938-.7428758-1.6067188-.9559859c-1.1431442-.6791157-2.5155496-.3977368-3.1667361.5628389zm6.97653866 1.5796652-.3817806.6812386c-.5117123.9119895-.2800268 2.1014993.528439 2.8785267l.382717-.6803391c.5119098-.9123415.2798478-2.1024176-.5293754-2.8794262z" class="fill-color" />
922
+ </svg>
923
+ `;class ye extends r.WF{static get styles(){return r.AH`
924
+ :host {
925
+ width: var(--iconWidth, 'auto');
926
+ height: var(--iconHeight, 'auto');
927
+ }
928
+
929
+ .fill-color {
930
+ fill: var(--iconFillColor);
931
+ }
932
+
933
+ .stroke-color {
934
+ stroke: var(--iconStrokeColor);
935
+ }
936
+ `}render(){return be}}customElements.define("ia-icon-link",ye);const ge=e=>{const t=e.currentTarget,n=t.querySelector("textarea"),r=t.querySelector("small");n.select(),document.execCommand("copy"),n.blur(),r.classList.add("visible"),clearTimeout(r.timeout),r.timeout=setTimeout(()=>r.classList.remove("visible"),4e3)},ke=r.qy`<ia-icon-share
937
+ style="width: var(--iconWidth); height: var(--iconHeight);"
938
+ ></ia-icon-share>`;let we=class extends r.WF{constructor(){super(...arguments),this.baseHost="archive.org",this.creator="",this.description="",this.embedOptionsVisible=!1,this.identifier="",this.sharingOptions=[],this.type="",this.renderHeader=!1,this.fileSubPrefix=""}updated(e){e.has("sharingOptions")&&!this.sharingOptions.length&&this.loadProviders()}loadProviders(){let e=`https://${this.baseHost}/details/${this.identifier}`;this.fileSubPrefix&&(e+=`/${this.fileSubPrefix}`);const t=[this.description,this.creator,"Free Download, Borrow, and Streaming","Internet Archive"].filter(Boolean).join(" : ");this.sharingOptions=[{name:"Twitter",icon:r.qy`<ia-icon-twitter aria-hidden="true"></ia-icon-twitter>`,url:`https://twitter.com/intent/tweet?${new URLSearchParams({url:e,text:t,via:"internetarchive"})}`},{name:"Facebook",icon:r.qy`<ia-icon-facebook aria-hidden="true"></ia-icon-facebook>`,url:`https://www.facebook.com/sharer/sharer.php?${new URLSearchParams({u:e})}`},{name:"Tumblr",icon:r.qy`<ia-icon-tumblr aria-hidden="true"></ia-icon-tumblr>`,url:`https://www.tumblr.com/widgets/share/tool/preview?${new URLSearchParams({posttype:"link",canonicalUrl:e,title:t})}`},{name:"Pinterest",icon:r.qy`<ia-icon-pinterest aria-hidden="true"></ia-icon-pinterest>`,url:`http://www.pinterest.com/pin/create/button/?${new URLSearchParams({url:e,description:t})}`},{name:"Email",icon:r.qy`<ia-icon-email aria-hidden="true"></ia-icon-email>`,url:`mailto:?${new URLSearchParams({subject:t,body:e})}`}]}get iframeEmbed(){return`<iframe\n src="https://${this.baseHost}/embed/${this.identifier}"\n width="560" height="384" frameborder="0"\n webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen\n ></iframe>`}get bbcodeEmbed(){return`[archiveorg ${this.identifier} width=560 height=384 frameborder=0 webkitallowfullscreen=true mozallowfullscreen=true]`}get helpURL(){return`https://${this.baseHost}/help/audio.php?identifier=${this.identifier}`}get header(){const e=r.qy`<header><h3>Share this ${this.type}</h3></header>`;return this.renderHeader?e:r.s6}render(){return r.qy`
939
+ ${this.header}
940
+ <div>
941
+ ${this.sharingOptions.map(e=>r.qy` <a class="share-option" href="${e.url}" target="_blank">
942
+ ${e.icon} ${e.name}
943
+ </a>`)}
944
+ <details>
945
+ <summary class="share-option">
946
+ <ia-icon-link aria-hidden="true"></ia-icon-link>
947
+ Get an embeddable link
948
+ </summary>
949
+ <div class="embed">
950
+ <h4>Embed</h4>
951
+ <div class="code" @click=${ge}>
952
+ <textarea readonly>${this.iframeEmbed}</textarea>
953
+ <small>Copied to clipboard</small>
954
+ </div>
955
+ <h4>
956
+ Embed for wordpress.com hosted blogs and archive.org item
957
+ &lt;description&gt; tags
958
+ </h4>
959
+ <div class="code" @click=${ge}>
960
+ <textarea readonly>${this.bbcodeEmbed}</textarea>
961
+ <small>Copied to clipboard</small>
962
+ </div>
963
+ <p>
964
+ Want more?
965
+ <a href=${this.helpURL}
966
+ >Advanced embedding details, examples, and help</a
967
+ >!
968
+ </p>
969
+ </div>
970
+ </details>
971
+ </div>
972
+ `}get providerIcon(){return r.qy`<ia-icon-share
973
+ style="width: var(--iconWidth); height: var(--iconHeight);"
974
+ ></ia-icon-share>`}static get styles(){return r.AH`
975
+ :host {
976
+ display: block;
977
+ height: 100%;
978
+ overflow-y: auto;
979
+ font-size: 1.4rem;
980
+ box-sizing: border-box;
981
+ }
982
+
983
+ header {
984
+ display: flex;
985
+ align-items: baseline;
986
+ }
987
+
988
+ h3 {
989
+ padding: 0;
990
+ margin: 0 1rem 0 0;
991
+ font-size: 1.6rem;
992
+ }
993
+
994
+ h4 {
995
+ font-size: 1.4rem;
996
+ }
997
+
998
+ :host > div {
999
+ padding: 1rem 0;
1000
+ }
1001
+
1002
+ .share-option {
1003
+ display: block;
1004
+ padding: 0.5rem 0;
1005
+ font-size: 1.6rem;
1006
+ text-decoration: none;
1007
+ color: var(--shareLinkColor);
1008
+ cursor: pointer;
1009
+ transition: background-color 0.2s;
1010
+ border-radius: 6px;
1011
+ }
1012
+
1013
+ .share-option:hover {
1014
+ background-color: rgba(255, 255, 255, 0.05);
1015
+ }
1016
+
1017
+ .share-option > * {
1018
+ display: inline-block;
1019
+ padding: 0.2rem;
1020
+ margin-right: 1rem;
1021
+ vertical-align: middle;
1022
+ border: 1px solid var(--shareIconBorder);
1023
+ border-radius: 7px;
1024
+ background: var(--shareIconBg);
1025
+ }
1026
+
1027
+ /* Hide the triangle that appears on details tags */
1028
+ summary::marker {
1029
+ content: '';
1030
+ }
1031
+
1032
+ summary::-webkit-details-marker {
1033
+ display: none;
1034
+ }
1035
+
1036
+ .embed {
1037
+ padding-right: 5px;
1038
+ }
1039
+
1040
+ .embed a {
1041
+ color: var(--shareLinkColor);
1042
+ }
1043
+
1044
+ .code {
1045
+ position: relative;
1046
+ }
1047
+
1048
+ textarea {
1049
+ display: block;
1050
+ width: 100%;
1051
+ height: 120px;
1052
+ padding: 0.8rem 1rem;
1053
+ box-sizing: border-box;
1054
+ resize: none;
1055
+ cursor: pointer;
1056
+ font:
1057
+ normal 1.4rem 'Helvetica Neue',
1058
+ Helvetica,
1059
+ Arial,
1060
+ sans-serif;
1061
+ color: var(--textareaColor, #fff);
1062
+ background: var(--textareaBg, #151515);
1063
+ }
1064
+
1065
+ small {
1066
+ position: absolute;
1067
+ bottom: 0;
1068
+ left: 0;
1069
+ height: 3rem;
1070
+ padding: 0.5rem 1rem;
1071
+ box-sizing: border-box;
1072
+ font:
1073
+ normal 1.2rem/2rem 'Helvetica Neue',
1074
+ Helvetica,
1075
+ Arial,
1076
+ sans-serif;
1077
+ color: var(--textareaBg, #151515);
1078
+ background: var(--textareaColor, #fff);
1079
+ opacity: 0;
1080
+ transition: opacity 300ms linear;
1081
+ }
1082
+ small.visible {
1083
+ opacity: 1;
1084
+ }
1085
+ `}};(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"creator",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"description",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],we.prototype,"embedOptionsVisible",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"identifier",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],we.prototype,"sharingOptions",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"type",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],we.prototype,"renderHeader",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"fileSubPrefix",void 0),we=(0,o.Cg)([(0,i.EM)("iaux-in-share-panel")],we),n(6033);var Ce=a.ge.I,xe=function(){return document.createComment("")},Se=function(e,t,n){var r,o=e._$AA.parentNode,i=void 0===t?e._$AB:t._$AA;if(void 0===n){var a=o.insertBefore(xe(),i),s=o.insertBefore(xe(),i);n=new Ce(a,s,e,e.options)}else{var l,c=n._$AB.nextSibling,u=n._$AM,d=u!==e;if(d&&(null===(r=n._$AQ)||void 0===r||r.call(n,e),n._$AM=e,void 0!==n._$AP&&(l=e._$AU)!==u._$AU&&n._$AP(l)),c!==i||d)for(var h=n._$AA;h!==c;){var p=h.nextSibling;o.insertBefore(h,i),h=p}}return n},Oe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return e._$AI(t,n),e},Me={},Be=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Me;return e._$AH=t},je=function(e){var t;null===(t=e._$AP)||void 0===t||t.call(e,!1,!0);for(var n=e._$AA,r=e._$AB.nextSibling;n!==r;){var o=n.nextSibling;n.remove(),n=o}};function Pe(e){return Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pe(e)}function Ee(e,t){if(e){if("string"==typeof e)return Le(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Le(e,t):void 0}}function Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_e(r.key),r)}}function _e(e){var t=function(e){if("object"!=Pe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pe(t)?t:t+""}function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Te=function(){return!!e})()}function ze(e){return ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ze(e)}function Ie(e,t){return Ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ie(e,t)}var $e=function(e,t,n){for(var r=new Map,o=t;o<=n;o++)r.set(e[o],o);return r},He=(0,s.u$)(function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t,n){return t=ze(t),function(e,t){if(t&&("object"==Pe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Te()?Reflect.construct(t,n||[],ze(e).constructor):t.apply(e,n))}(this,t,[e]),e.type!==s.OA.CHILD)throw Error("repeat() can only be used in text expressions");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ie(e,t)}(t,e),function(e,t){return t&&Ae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"ct",value:function(e,t,n){var r;void 0===n?n=t:void 0!==t&&(r=t);var o,i=[],a=[],s=0,l=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ee(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}(e);try{for(l.s();!(o=l.n()).done;){var c=o.value;i[s]=r?r(c,s):s,a[s]=n(c,s),s++}}catch(e){l.e(e)}finally{l.f()}return{values:a,keys:i}}},{key:"render",value:function(e,t,n){return this.ct(e,t,n).values}},{key:"update",value:function(e,t){var n,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||Ee(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,3),o=r[0],i=r[1],s=r[2],l=function(e){return e._$AH}(e),c=this.ct(o,i,s),u=c.values,d=c.keys;if(!Array.isArray(l))return this.ut=d,u;for(var h,p,f=null!==(n=this.ut)&&void 0!==n?n:this.ut=[],m=[],v=0,b=l.length-1,y=0,g=u.length-1;v<=b&&y<=g;)if(null===l[v])v++;else if(null===l[b])b--;else if(f[v]===d[y])m[y]=Oe(l[v],u[y]),v++,y++;else if(f[b]===d[g])m[g]=Oe(l[b],u[g]),b--,g--;else if(f[v]===d[g])m[g]=Oe(l[v],u[g]),Se(e,m[g+1],l[v]),v++,g--;else if(f[b]===d[y])m[y]=Oe(l[b],u[y]),Se(e,l[v],l[b]),b--,y++;else if(void 0===h&&(h=$e(d,y,g),p=$e(f,v,b)),h.has(f[v]))if(h.has(f[b])){var k=p.get(d[y]),w=void 0!==k?l[k]:null;if(null===w){var C=Se(e,l[v]);Oe(C,u[y]),m[y]=C}else m[y]=Oe(w,u[y]),Se(e,l[v],w),l[k]=null;y++}else je(l[b]),b--;else je(l[v]),v++;for(;y<=g;){var x=Se(e,m[g+1]);Oe(x,u[y]),m[y++]=x}for(;v<=b;){var S=l[v++];null!==S&&je(S)}return this.ut=d,Be(e,m),a.c0}}])}(s.WL));const qe=r.qy`
1086
+ <svg
1087
+ name="sort-asc"
1088
+ height="18"
1089
+ viewBox="0 0 18 18"
1090
+ width="18"
1091
+ xmlns="http://www.w3.org/2000/svg"
1092
+ >
1093
+ <g fill="none" fill-rule="evenodd">
1094
+ <path
1095
+ d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z"
1096
+ fill="#fff"
1097
+ fill-rule="nonzero"
1098
+ />
1099
+ <path
1100
+ d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z"
1101
+ fill="#fff"
1102
+ fill-rule="nonzero"
1103
+ />
1104
+ <path
1105
+ d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612"
1106
+ stroke="#fff"
1107
+ stroke-linecap="round"
1108
+ stroke-linejoin="round"
1109
+ stroke-width="1.661538"
1110
+ transform="matrix(1 0 0 -1 0 18.692308)"
1111
+ />
1112
+ </g>
1113
+ </svg>
1114
+ `,De=r.qy`
1115
+ <svg
1116
+ name="sort-desc"
1117
+ height="18"
1118
+ viewBox="0 0 18 18"
1119
+ width="18"
1120
+ xmlns="http://www.w3.org/2000/svg"
1121
+ >
1122
+ <g fill="none" fill-rule="evenodd">
1123
+ <path
1124
+ d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z"
1125
+ fill="#fff"
1126
+ fill-rule="nonzero"
1127
+ />
1128
+ <path
1129
+ d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z"
1130
+ fill="#fff"
1131
+ fill-rule="nonzero"
1132
+ />
1133
+ <path
1134
+ d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612"
1135
+ stroke="#fff"
1136
+ stroke-linecap="round"
1137
+ stroke-linejoin="round"
1138
+ stroke-width="1.661538"
1139
+ />
1140
+ </g>
1141
+ </svg>
1142
+ `,Re=r.qy`
1143
+ <svg
1144
+ name="sort-neutral"
1145
+ height="18"
1146
+ viewBox="0 0 18 18"
1147
+ width="18"
1148
+ xmlns="http://www.w3.org/2000/svg"
1149
+ >
1150
+ <g fill="#fff" fill-rule="evenodd">
1151
+ <path
1152
+ d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z"
1153
+ fill-rule="nonzero"
1154
+ />
1155
+ <path
1156
+ d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z"
1157
+ fill-rule="nonzero"
1158
+ />
1159
+ <circle cx="13" cy="9" r="2" />
1160
+ </g>
1161
+ </svg>
1162
+ `,Fe=r.qy`
1163
+ <svg
1164
+ height="24"
1165
+ viewBox="0 0 24 24"
1166
+ width="24"
1167
+ xmlns="http://www.w3.org/2000/svg"
1168
+ aria-labelledby="volumesTitleID volumesDescID"
1169
+ >
1170
+ <title id="volumesTitleID">Viewable Files</title>
1171
+ <g fill="#ffffff">
1172
+ <path
1173
+ fill="#ffffff"
1174
+ d="m9.83536396 0h10.07241114c.1725502.47117517.3378411.76385809.4958725.87804878.1295523.11419069.3199719.1998337.5712586.25692905.2512868.05709534.4704647.08564301.6575337.08564301h.2806036v15.24362526h-4.3355343v3.8106985h-4.44275v3.7250554h-12.01318261c-.27306495 0-.50313194-.085643-.69020098-.256929-.18706903-.1712861-.30936193-.3425721-.36687867-.5138581l-.06449694-.2785477v-14.2159091c0-.32815965.08627512-.5922949.25882537-.79240577.17255024-.20011086.34510049-.32150776.51765073-.36419068l.25882537-.0640244h3.36472977v-2.54767184c0-.31374722.08627513-.57067627.25882537-.77078714.17255025-.20011086.34510049-.32150776.51765074-.36419068l.25882536-.06402439h3.36472978v-2.56929047c0-.32815964.08627512-.5922949.25882537-.79240576.17255024-.20011087.34510049-.31430156.51765073-.34257207zm10.78355264 15.6294346v-13.53076498c-.2730649-.08536585-.4456152-.16380266-.5176507-.23531042-.1725502-.1424612-.2730649-.27078714-.3015441-.38497783v13.36031043h-9.87808272c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144124-.08962561.006929-.13988296.0640244-.05025735.0570953-.07538603.1427383-.07538603.256929s.02149898.210643.06449694.289357c.04299795.078714.08599591.1322062.12899387.1604767l.06449693.0216187h10.71905571zm-10.2449613-2.4412417h7.98003v-11.60421286h-7.98003zm1.6827837-9.41990022h4.6153002c.1725502 0 .3199718.05349224.4422647.16047672s.1834393.23891353.1834393.39578714c0 .15687362-.0611464.28519956-.1834393.38497783s-.2697145.1496674-.4422647.1496674h-4.6153002c-.1725503 0-.3199719-.04988913-.4422647-.1496674-.1222929-.09977827-.1834394-.22810421-.1834394-.38497783 0-.15687361.0611465-.28880266.1834394-.39578714.1222928-.10698448.2697144-.16047672.4422647-.16047672zm-6.08197737 13.50997782h7.72120467v-.8131929h-3.79610541c-.27306495 0-.49950224-.085643-.67931188-.256929-.17980964-.1712861-.29847284-.3425721-.35598958-.5138581l-.06449694-.2785477v-10.02023282h-2.82530086zm6.77217827-11.36890243h3.2139578c.1295522 0 .240956.05709534.3342113.17128603.0932554.11419069.139883.24972284.139883.40659645 0 .15687362-.0466276.28880267-.139883.39578714-.0932553.10698448-.2046591.16047672-.3342113.16047672h-3.2139578c-.1295523 0-.2373264-.05349224-.3233223-.16047672-.0859959-.10698447-.1289938-.23891352-.1289938-.39578714 0-.15687361.0429979-.29240576.1289938-.40659645s.19377-.17128603.3233223-.17128603zm-11.15043132 15.11557653h7.69942646v-.7491685h-3.79610539c-.25854616 0-.48135376-.0892462-.66842279-.2677384-.18706904-.1784922-.30936193-.3605876-.36687868-.546286l-.06449694-.2569291v-10.04101994h-2.80352266zm14.62237682-4.5606985h-.8191949v2.1410754h-9.89986085s-.04299796.0285477-.12899387.085643c-.08599592.0570954-.12201369.1427384-.10805331.2569291 0 .1141907.01786928.210643.05360784.289357.03573856.0787139.07538603.125.1189424.138858l.06449694.0432373h10.71905575v-2.9542683zm-4.3991936 3.8106985h-.8191949v2.077051h-9.8563045c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144125-.08962561.0105321-.13988296.0748337-.05025735.0643015-.07538603.1607538-.07538603.289357 0 .1141906.02149898.2070399.06449694.2785476.04299795.0715078.08599591.1141907.12899387.1280488l.06449693.0216186h10.69811519v-2.8686252z"
1175
+ />
1176
+ </g>
1177
+ </svg>
1178
+ `;let We=class extends r.WF{constructor(){super(...arguments),this.fileListRaw=[],this.fileListSorted=[],this.sortOrderBy="default"}render(){return r.qy`<div class="sort-multi-file-list">${this.sortButton}</div>`}get sortButton(){return{default:r.qy`
1179
+ <button
1180
+ class="sort-by neutral-icon"
1181
+ aria-label="Sort volumes in initial order"
1182
+ @click=${()=>this.sortVolumes("title_asc")}
1183
+ >
1184
+ ${Re}
1185
+ </button>
1186
+ `,title_asc:r.qy`
1187
+ <button
1188
+ class="sort-by asc-icon"
1189
+ aria-label="Sort volumes in ascending order"
1190
+ @click=${()=>this.sortVolumes("title_desc")}
1191
+ >
1192
+ ${qe}
1193
+ </button>
1194
+ `,title_desc:r.qy`
1195
+ <button
1196
+ class="sort-by desc-icon"
1197
+ aria-label="Sort volumes in descending order"
1198
+ @click=${()=>this.sortVolumes("default")}
1199
+ >
1200
+ ${De}
1201
+ </button>
1202
+ `}[this.sortOrderBy]}sortVolumes(e){this.sortOrderBy=e;let t=[];t=this.fileListRaw.sort((t,n)=>"title_asc"===e?t.title.localeCompare(n.title):"title_desc"===e?n.title.localeCompare(t.title):t.orig_sort-n.orig_sort),this.dispatchEvent(new CustomEvent("fileListSorted",{detail:{sortType:e,sortedFiles:t},bubbles:!0,composed:!0})),this.fileListSorted=t}static get styles(){return r.AH`
1203
+ button.sort-by {
1204
+ padding: 0px;
1205
+ background-color: transparent;
1206
+ border: 0px;
1207
+ --iconWidth: var(--menuSliderHeaderIconWidth);
1208
+ --iconHeight: var(--menuSliderHeaderIconHeight);
1209
+ }
1210
+ `}};(0,o.Cg)([(0,i.MZ)({type:Array})],We.prototype,"fileListRaw",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],We.prototype,"fileListSorted",void 0),(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],We.prototype,"sortOrderBy",void 0),We=(0,o.Cg)([(0,i.EM)("iaux-in-sort-files-button")],We);let Ve=class extends r.WF{constructor(){super(...arguments),this.baseHost="archive.org",this.sortOrderBy="default",this.subPrefix="",this.fileList=[],this.addSortToUrl=!1}firstUpdated(){const e=this.shadowRoot.querySelector(".content.active");setTimeout(()=>{(null==e?void 0:e.scrollIntoViewIfNeeded)?null==e||e.scrollIntoViewIfNeeded(!0):null==e||e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},350)}volumeItemWithImageTitle(e){const t=this.fileUrl(e);return r.qy`
1211
+ <li class="content active">
1212
+ <div class="separator"></div>
1213
+ <a class="container" href="${t}">
1214
+ <div class="image">
1215
+ <img src="${e.image}" alt="preview" />
1216
+ </div>
1217
+ <div class="text">
1218
+ <p class="item-title">${e.title}</p>
1219
+ <small>by: ${e.author}</small>
1220
+ </div>
1221
+ </a>
1222
+ </li>
1223
+ `}fileUrl(e){const t=`//${this.baseHost}${e.url_path}`;let n=t;return this.addSortToUrl&&(n="default"===this.sortOrderBy?`${t}`:`${t}?sort=${this.sortOrderBy}`),n}get pdfLabel(){return r.qy`<span class="pdf-label"
1224
+ ><span class="sr-only">view this</span> PDF</span
1225
+ >`}fileLi(e){var t;const n=this.subPrefix===e.file_subprefix?" active":"",o=this.fileUrl(e),i=(null!==(t=e.file_source)&&void 0!==t?t:"").match(/^[^+]+\.pdf$/i);return r.qy`
1226
+ <li>
1227
+ <div class="separator"></div>
1228
+ <div class="content${n}">
1229
+ <a href=${o}>
1230
+ <p class="item-title">
1231
+ ${e.title}${i?this.pdfLabel:r.s6}
1232
+ </p>
1233
+ </a>
1234
+ </div>
1235
+ </li>
1236
+ `}get fileListTemplate(){const e=He(this.fileList,e=>null==e?void 0:e.file_prefix,this.fileLi.bind(this));return r.qy`
1237
+ <ul>
1238
+ ${e}
1239
+ <div class="separator"></div>
1240
+ </ul>
1241
+ `}render(){return r.qy` ${this.fileList.length?this.fileListTemplate:r.s6} `}static get styles(){return r.AH`
1242
+ :host {
1243
+ display: block;
1244
+ overflow-y: auto;
1245
+ box-sizing: border-box;
1246
+ color: var(--primaryTextColor);
1247
+ margin-top: 14px;
1248
+ margin-bottom: 2rem;
1249
+ --activeBorderWidth: 2px;
1250
+ }
1251
+
1252
+ a {
1253
+ color: #ffffff;
1254
+ text-decoration: none;
1255
+ }
1256
+
1257
+ img {
1258
+ width: 35px;
1259
+ height: 45px;
1260
+ }
1261
+
1262
+ ul {
1263
+ padding: 0;
1264
+ list-style: none;
1265
+ margin: var(--activeBorderWidth) 0.5rem 1rem 0;
1266
+ }
1267
+
1268
+ ul > li:first-child .separator {
1269
+ display: none;
1270
+ }
1271
+
1272
+ li {
1273
+ cursor: pointer;
1274
+ position: relative;
1275
+ }
1276
+
1277
+ li .content {
1278
+ padding: 2px 0 4px 2px;
1279
+ border: var(--activeBorderWidth) solid transparent;
1280
+ padding: 0.2rem 0 0.4rem 0.2rem;
1281
+ }
1282
+
1283
+ li .content.active {
1284
+ border: var(--activeBorderWidth) solid #538bc5;
1285
+ }
1286
+
1287
+ li.content a {
1288
+ display: flex;
1289
+ }
1290
+
1291
+ small {
1292
+ font-style: italic;
1293
+ white-space: initial;
1294
+ }
1295
+
1296
+ .container {
1297
+ display: flex;
1298
+ align-items: center;
1299
+ justify-content: center;
1300
+ }
1301
+
1302
+ .item-title {
1303
+ margin-block-start: 0em;
1304
+ margin-block-end: 0em;
1305
+ font-size: 14px;
1306
+ font-weight: bold;
1307
+ word-wrap: break-word;
1308
+ padding-left: 5px;
1309
+ }
1310
+
1311
+ .separator {
1312
+ background-color: var(--secondaryBGColor);
1313
+ width: 98%;
1314
+ margin: 1px auto;
1315
+ height: 1px;
1316
+ }
1317
+
1318
+ .text {
1319
+ padding-left: 10px;
1320
+ }
1321
+
1322
+ .icon {
1323
+ display: inline-block;
1324
+ width: 14px;
1325
+ height: 14px;
1326
+ margin-left: 0.7rem;
1327
+ border: 1px solid var(--primaryTextColor);
1328
+ border-radius: 2px;
1329
+ background: var(--activeButtonBg) 50% 50% no-repeat;
1330
+ }
1331
+
1332
+ .pdf-label {
1333
+ border: 1px solid;
1334
+ padding: 2px 5px;
1335
+ border-radius: 20px;
1336
+ display: inline-block;
1337
+ margin-left: 5px;
1338
+ font-size: 0.9rem;
1339
+ }
1340
+
1341
+ .pdf-label .sr-only {
1342
+ position: absolute;
1343
+ clip: rect(1px, 1px, 1px, 1px);
1344
+ padding: 0;
1345
+ border: 0;
1346
+ height: 1px;
1347
+ width: 1px;
1348
+ overflow: hidden;
1349
+ }
1350
+ `}};(0,o.Cg)([(0,i.MZ)({type:String})],Ve.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],Ve.prototype,"sortOrderBy",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],Ve.prototype,"subPrefix",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],Ve.prototype,"fileList",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],Ve.prototype,"addSortToUrl",void 0),Ve=(0,o.Cg)([(0,i.EM)("iaux-in-viewable-files-panel")],Ve);class Ne{constructor(e){this.title=e?.title,this.subtitle=e?.subtitle,this.headline=e?.headline,this.message=e?.message,this.headerColor=e?.headerColor??"#55A183",this.bodyColor=e?.bodyColor??"#fbfbfd",this.showProcessingIndicator=e?.showProcessingIndicator??!1,this.processingImageMode=e?.processingImageMode??"complete",this.showCloseButton=e?.showCloseButton??!0,this.showLeftNavButton=e?.showLeftNavButton??!1,this.leftNavButtonText=e?.leftNavButtonText??"",this.showHeaderLogo=e?.showHeaderLogo??!0,this.closeOnBackdropClick=e?.closeOnBackdropClick??!0}}function*Ze(e=document.activeElement){null!=e&&(yield e,"shadowRoot"in e&&e.shadowRoot&&"closed"!==e.shadowRoot.mode&&(yield*Ze(e.shadowRoot.activeElement)))}function Ue(){return[...Ze()].pop()}const Ge=new WeakMap;function Je(e){let t=Ge.get(e);return t||(t=window.getComputedStyle(e,null),Ge.set(e,t)),t}function Xe(e){const t=new WeakMap,n=[];return function r(o){if(o instanceof Element){if(o.hasAttribute("inert")||o.closest("[inert]"))return;if(t.has(o))return;t.set(o,!0),!n.includes(o)&&function(e){const t=e.tagName.toLowerCase(),n=Number(e.getAttribute("tabindex"));return(!e.hasAttribute("tabindex")||!(isNaN(n)||n<=-1))&&!e.hasAttribute("disabled")&&!e.closest("[inert]")&&!("input"===t&&"radio"===e.getAttribute("type")&&!e.hasAttribute("checked"))&&!!function(e){if("checkVisibility"in e&&"function"==typeof e.checkVisibility)return e.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});const t=Je(e);return"hidden"!==t.visibility&&"none"!==t.display}(e)&&(!("audio"!==t&&"video"!==t||!e.hasAttribute("controls"))||!!e.hasAttribute("tabindex")||!(!e.hasAttribute("contenteditable")||"false"===e.getAttribute("contenteditable"))||!!["button","input","select","textarea","a","audio","video","summary","iframe"].includes(t)||function(e){const t=Je(e),{overflowY:n,overflowX:r}=t;return"scroll"===n||"scroll"===r||"auto"===n&&"auto"===r&&(e.scrollHeight>e.clientHeight&&"auto"===n||!(!(e.scrollWidth>e.clientWidth)||"auto"!==r))}(e))}(o)&&n.push(o),o instanceof HTMLSlotElement&&function(e,t){return e.getRootNode({composed:!0})?.host!==t}(o,e)&&o.assignedElements({flatten:!0}).forEach(e=>{r(e)}),null!==o.shadowRoot&&"open"===o.shadowRoot.mode&&r(o.shadowRoot)}for(const e of Array.from(o.children))r(e)}(e),n.sort((e,t)=>{const n=Number(e.getAttribute("tabindex"))||0;return(Number(t.getAttribute("tabindex"))||0)-n})}let Ke=[];class Qe{constructor(e){this.isExternalActivated=!1,this.tabDirection="forward",this.currentFocus=null,this.previousFocus=null,this.handleFocusIn=()=>{this.isActive()&&this.checkFocus()},this.handleKeyDown=e=>{if("Tab"!==e.key||this.isExternalActivated)return;if(!this.isActive())return;const t=Ue();if(this.previousFocus=t,this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;e.shiftKey?this.tabDirection="backward":this.tabDirection="forward";const n=Xe(this.element);let r=n.findIndex(e=>e===t);this.previousFocus=this.currentFocus;const o="forward"===this.tabDirection?1:-1;for(;;){r+o>=n.length?r=0:r+o<0?r=n.length-1:r+=o,this.previousFocus=this.currentFocus;const t=n[r];if("backward"===this.tabDirection&&this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;if(t&&this.possiblyHasTabbableChildren(t))return;e.preventDefault(),this.currentFocus=t,this.currentFocus?.focus({preventScroll:!1});const i=[...Ze()];if(i.includes(this.currentFocus)||!i.includes(this.previousFocus))break}setTimeout(()=>this.checkFocus())},this.handleKeyUp=()=>{this.tabDirection="forward"},this.element=e,this.elementsWithTabbableControls=["iframe"]}activate(){Ke.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){Ke=Ke.filter(e=>e!==this.element),this.currentFocus=null,document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return Ke[Ke.length-1]===this.element}activateExternal(){this.isExternalActivated=!0}deactivateExternal(){this.isExternalActivated=!1}checkFocus(){if(this.isActive()&&!this.isExternalActivated){const e=Xe(this.element);if(!this.element.matches(":focus-within")){const t=e[0],n=e[e.length-1],r="forward"===this.tabDirection?t:n;"function"==typeof r?.focus&&(this.currentFocus=r,r.focus({preventScroll:!1}))}}}possiblyHasTabbableChildren(e){return this.elementsWithTabbableControls.includes(e.tagName.toLowerCase())||e.hasAttribute("controls")}}n(8248);var Ye=r.qy`
1351
+ <svg
1352
+ viewBox="0 0 40 40"
1353
+ version="1.1"
1354
+ xmlns="http://www.w3.org/2000/svg"
1355
+ >
1356
+ <path d="m29.1923882 10.8076118c.5857864.5857865.5857864 1.535534 0 2.1213204l-7.0711162 7.0703398 7.0711162 7.0717958c.5857864.5857864.5857864 1.5355339 0 2.1213204-.5857865.5857864-1.535534.5857864-2.1213204 0l-7.0717958-7.0711162-7.0703398 7.0711162c-.5857864.5857864-1.5355339.5857864-2.1213204 0-.5857864-.5857865-.5857864-1.535534 0-2.1213204l7.0706602-7.0717958-7.0706602-7.0703398c-.5857864-.5857864-.5857864-1.5355339 0-2.1213204.5857865-.5857864 1.535534-.5857864 2.1213204 0l7.0703398 7.0706602 7.0717958-7.0706602c.5857864-.5857864 1.5355339-.5857864 2.1213204 0z" class="fill-color" fill-rule="evenodd"/>
1357
+ </svg>
1358
+ `;class et extends r.WF{static get styles(){return r.AH`
1359
+ :host {
1360
+ width: var(--iconWidth, 'auto');
1361
+ height: var(--iconHeight, 'auto');
1362
+ }
1363
+
1364
+ .fill-color {
1365
+ fill: var(--iconFillColor);
1366
+ }
1367
+
1368
+ .stroke-color {
1369
+ stroke: var(--iconStrokeColor);
1370
+ }
1371
+ `}render(){return Ye}}customElements.define("ia-icon-close",et);var tt=r.qy`
1372
+ <svg
1373
+ class="ia-logo"
1374
+ viewBox="0 0 27 30"
1375
+ xmlns="http://www.w3.org/2000/svg"
1376
+ aria-labelledby="logoTitleID logoDescID"
1377
+ >
1378
+ <title id="logoTitleID">Internet Archive logo</title>
1379
+ <desc id="logoDescID">
1380
+ A line drawing of the Internet Archive headquarters building façade.
1381
+ </desc>
1382
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
1383
+ <mask id="mask-2" class="fill-color">
1384
+ <path
1385
+ d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z"
1386
+ id="path-1"
1387
+ ></path>
1388
+ </mask>
1389
+ <use class="fill-color" xlink:href="#path-1"></use>
1390
+ <g mask="url(#mask-2)" class="fill-color">
1391
+ <path
1392
+ d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z"
1393
+ id="swatch"
1394
+ ></path>
1395
+ </g>
1396
+ </g>
1397
+ </svg>
1398
+ `,nt=r.qy`
1399
+ <svg
1400
+ viewBox="0 0 100 100"
1401
+ xmlns="http://www.w3.org/2000/svg"
1402
+ fill="#fff"
1403
+ title="Left arrow icon"
1404
+ alt="Left arrow icon"
1405
+ >
1406
+ <path
1407
+ d="m20.1116715 50.0035012-.1116715-.1085359 43.1159942-46.61088155c2.401537-2.18938917 4.6902018-3.28408375 6.8659943-3.28408375s4.1642651.63837733 5.9654178 1.91513199c1.8011528 1.27675467 3.1520173 2.97248092 4.0525937 5.08717877l-39.4020173 42.99768924 39.4020173 42.9976892c-.9005764 2.1146979-2.2514409 3.8104241-4.0525937 5.0871788-1.8011527 1.2767547-3.7896253 1.915132-5.9654178 1.915132-2.1013449 0-4.3900096-1.0573489-6.8659943-3.1720468l-43.1159942-46.7194174z"
1408
+ />
1409
+ </svg>
1410
+ `;let rt=class extends r.WF{constructor(){super(...arguments),this.config=new Ne}render(){return r.qy`
1411
+ <div class="modal-wrapper">
1412
+ <div class="modal-container">
1413
+ <header style="background-color: ${this.config.headerColor}">
1414
+ ${this.config.showLeftNavButton?this.leftNavButtonTemplate:r.s6}
1415
+ ${this.config.showCloseButton?this.closeButtonTemplate:""}
1416
+ ${this.config.showHeaderLogo?r.qy`<div class="logo-icon">${tt}</div>`:r.s6}
1417
+ ${this.config.title?r.qy`<h1 class="title">${this.config.title}</h1>`:""}
1418
+ ${this.config.subtitle?r.qy`<h2 class="subtitle">${this.config.subtitle}</h2>`:""}
1419
+ </header>
1420
+ <section
1421
+ class="modal-body"
1422
+ style="background-color: ${this.config.bodyColor}"
1423
+ >
1424
+ <div class="content">
1425
+ <div
1426
+ class="processing-logo ${this.config.showProcessingIndicator?"":"hidden"}"
1427
+ >
1428
+ <ia-activity-indicator
1429
+ .mode=${this.config.processingImageMode}
1430
+ ></ia-activity-indicator>
1431
+ </div>
1432
+ ${this.config.headline?r.qy` <h1 class="headline">${this.config.headline}</h1> `:""}
1433
+ ${this.config.message?r.qy` <p class="message">${this.config.message}</p> `:""}
1434
+
1435
+ <div class="slot-container">
1436
+ <slot> </slot>
1437
+ </div>
1438
+ </div>
1439
+ </section>
1440
+ </div>
1441
+ </div>
1442
+ `}handleCloseButton(e){if(e.preventDefault(),"keydown"===e.type&&" "!==e.key&&"Enter"!==e.key)return;const t=new Event("closeButtonPressed");this.dispatchEvent(t)}handleLeftNavButtonPressed(e){if(e.preventDefault(),"keydown"===e.type&&" "!==e.key&&"Enter"!==e.key)return;const t=new Event("leftNavButtonPressed");this.dispatchEvent(t)}get closeButtonTemplate(){return r.qy`
1443
+ <button
1444
+ type="button"
1445
+ class="close-button"
1446
+ @click=${this.handleCloseButton}
1447
+ @keydown=${this.handleCloseButton}
1448
+ >
1449
+ <ia-icon-close></ia-icon-close>
1450
+ </button>
1451
+ `}get leftNavButtonTemplate(){return r.qy`<button
1452
+ type="button"
1453
+ class="back-button"
1454
+ @click=${this.handleLeftNavButtonPressed}
1455
+ @keydown=${this.handleLeftNavButtonPressed}
1456
+ >
1457
+ ${nt} ${this.config.leftNavButtonText??""}
1458
+ </button> `}static get styles(){const e=r.AH`var(--modalLogoSize, 6.5rem)`,t=r.AH`var(--processingImageSize, 7.5rem)`,n=r.AH`var(--modalCornerRadius, 1rem)`,o=r.AH`var(--modalBorder, 2px solid black)`,i=r.AH`var(--modalBottomMargin, 2.5rem)`,a=r.AH`var(--modalTopMargin, 5rem)`,s=r.AH`var(--modalHeaderBottomPadding, 0.5em)`,l=r.AH`var(--modalBottomPadding, 2rem)`,c=r.AH`var(--modalScrollOffset, 5px)`,u=r.AH`var(--modalTitleFontSize, 1.8rem)`,d=r.AH`var(--modalSubtitleFontSize, 1.4rem)`,h=r.AH`var(--modalHeadlineFontSize, 1.6rem)`,p=r.AH`var(--modalMessageFontSize, 1.4rem)`,f=r.AH`var(--modalTitleLineHeight, normal)`,m=r.AH`var(--modalSubtitleLineHeight, normal)`,v=r.AH`var(--modalHeadlineLineHeight, normal)`,b=r.AH`var(--modalMessageLineHeight, normal)`;return r.AH`
1459
+ .processing-logo {
1460
+ margin: auto;
1461
+ width: ${t};
1462
+ height: ${t};
1463
+ }
1464
+
1465
+ .processing-logo.hidden {
1466
+ height: 1rem;
1467
+ }
1468
+
1469
+ .processing-logo.hidden ia-activity-indicator {
1470
+ display: none;
1471
+ }
1472
+
1473
+ .modal-wrapper {
1474
+ outline: none;
1475
+ }
1476
+
1477
+ .modal-container {
1478
+ border-radius: ${n};
1479
+ width: 100%;
1480
+ margin-top: ${a};
1481
+ }
1482
+
1483
+ header {
1484
+ position: relative;
1485
+ background-color: #36a483;
1486
+ color: white;
1487
+ border-radius: calc(${n}) calc(${n}) 0 0;
1488
+ border: ${o};
1489
+ border-bottom: 0;
1490
+ text-align: center;
1491
+ padding-bottom: ${s};
1492
+ }
1493
+
1494
+ .title {
1495
+ margin: 0;
1496
+ padding: 0;
1497
+ font-size: ${u};
1498
+ font-weight: bold;
1499
+ line-height: ${f};
1500
+ }
1501
+
1502
+ .subtitle {
1503
+ margin: 0;
1504
+ padding: 0;
1505
+ font-weight: normal;
1506
+ padding-top: 0;
1507
+ font-size: ${d};
1508
+ line-height: ${m};
1509
+ }
1510
+
1511
+ .modal-body {
1512
+ background-color: #fbfbfd;
1513
+ border-radius: 0 0 calc(${n}) calc(${n});
1514
+ border: ${o};
1515
+ border-top: 0;
1516
+ padding: 0 1rem calc(${l} - ${c}) 1rem;
1517
+ color: #333;
1518
+ margin-bottom: 2.5rem;
1519
+ min-height: 5rem;
1520
+ }
1521
+
1522
+ .content {
1523
+ overflow-y: auto;
1524
+ max-height: calc(100vh - (16.5rem + ${i}));
1525
+ min-height: 5rem;
1526
+ padding: 0 0 calc(${c}) 0;
1527
+ }
1528
+
1529
+ .headline {
1530
+ font-size: ${h};
1531
+ font-weight: bold;
1532
+ text-align: center;
1533
+ line-height: ${v};
1534
+ margin: 0;
1535
+ padding: 0;
1536
+ }
1537
+
1538
+ .message {
1539
+ margin: 1rem 0 0 0;
1540
+ text-align: center;
1541
+ font-size: ${p};
1542
+ line-height: ${b};
1543
+ }
1544
+
1545
+ .logo-icon {
1546
+ border-radius: 100%;
1547
+ border: 3px solid #fff;
1548
+ box-shadow:
1549
+ 0 0 0 1px rgba(0, 0, 0, 0.18),
1550
+ 0 2px 2px 0 rgba(0, 0, 0, 0.08);
1551
+ width: ${e};
1552
+ height: ${e};
1553
+ margin: -2.9rem auto 0.5rem auto;
1554
+ background-color: black;
1555
+ display: flex;
1556
+ justify-content: center;
1557
+ align-items: center;
1558
+ }
1559
+
1560
+ .logo-icon svg {
1561
+ width: calc(${e} * 0.65);
1562
+ height: calc(${e} * 0.65);
1563
+ }
1564
+
1565
+ .logo-icon svg .fill-color {
1566
+ fill: white;
1567
+ }
1568
+
1569
+ .logo-icon svg .stroke-color {
1570
+ stroke: red;
1571
+ }
1572
+
1573
+ .close-button {
1574
+ position: absolute;
1575
+ right: 1.2rem;
1576
+ top: 1.2rem;
1577
+ width: 2rem;
1578
+ height: 2rem;
1579
+ border-radius: 100%;
1580
+ border: 0;
1581
+ padding: 0;
1582
+ cursor: pointer;
1583
+ background-color: white;
1584
+ box-shadow:
1585
+ 0 0 0 1px rgba(0, 0, 0, 0.18),
1586
+ 0 4px 4px 0 rgba(0, 0, 0, 0.08);
1587
+ }
1588
+
1589
+ .back-button {
1590
+ position: absolute;
1591
+ left: 1.2rem;
1592
+ top: 1.2rem;
1593
+ height: 2rem;
1594
+ background-color: transparent;
1595
+ outline: none;
1596
+ border: none;
1597
+ padding: 0;
1598
+ cursor: pointer;
1599
+ color: white;
1600
+ font-family: inherit;
1601
+ display: flex;
1602
+ flex-direction: row;
1603
+ align-items: center;
1604
+ gap: 0.5rem;
1605
+ }
1606
+
1607
+ .back-button svg {
1608
+ height: 1.5rem;
1609
+ }
1610
+
1611
+ .sr-only {
1612
+ position: absolute;
1613
+ width: 1px;
1614
+ height: 1px;
1615
+ padding: 0;
1616
+ margin: -1px;
1617
+ overflow: hidden;
1618
+ clip: rect(0, 0, 0, 0);
1619
+ border: 0;
1620
+ }
1621
+
1622
+ slot::slotted(.sr-only) {
1623
+ position: absolute;
1624
+ width: 1px;
1625
+ height: 1px;
1626
+ padding: 0;
1627
+ margin: -1px;
1628
+ overflow: hidden;
1629
+ clip: rect(0, 0, 0, 0);
1630
+ border: 0;
1631
+ }
1632
+ `}};var ot;(0,o.Cg)([(0,i.MZ)({type:Object})],rt.prototype,"config",void 0),rt=(0,o.Cg)([(0,i.EM)("modal-template")],rt),function(e){e.Open="open",e.Closed="closed"}(ot||(ot={}));class it{constructor(e){this.windowResizeThrottler=function(e,t,n){var r,o=n||{},i=o.noTrailing,a=void 0!==i&&i,s=o.noLeading,l=void 0!==s&&s,c=o.debounceMode,u=void 0===c?void 0:c,d=!1,h=0;function p(){r&&clearTimeout(r)}function f(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var s=this,c=Date.now()-h;function f(){h=Date.now(),t.apply(s,o)}function m(){r=void 0}d||(l||!u||r||f(),p(),void 0===u&&c>e?l?(h=Date.now(),a||(r=setTimeout(u?m:f,e))):f():!0!==a&&(r=setTimeout(u?m:f,void 0===u?e-c:e)))}return f.cancel=function(e){var t=(e||{}).upcomingOnly,n=void 0!==t&&t;p(),d=!n},f}(100,this.updateModalContainerHeight,{noLeading:!1,noTrailing:!1}).bind(this),this.modalManager=e}handleModeChange(e){switch(e){case ot.Open:this.startResizeListener(),this.stopDocumentScroll();break;case ot.Closed:this.stopResizeListener(),this.resumeDocumentScroll()}}updateModalContainerHeight(){this.modalManager.style.setProperty("--containerHeight",`${window.innerHeight}px`)}stopDocumentScroll(){document.body.classList.add("modal-manager-open")}resumeDocumentScroll(){document.body.classList.remove("modal-manager-open")}startResizeListener(){window.addEventListener("resize",this.windowResizeThrottler)}stopResizeListener(){window.removeEventListener("resize",this.windowResizeThrottler)}}let at=class extends r.WF{constructor(){super(...arguments),this.mode=ot.Closed,this.hostBridge=new it(this),this.modal=new Qe(this),this.closeOnBackdropClick=!0}async firstUpdated(){await new Promise(e=>setTimeout(e,0)),this.closeOnBackdropClick&&this.addEventListener("keydown",e=>{"Escape"===e.key&&this.backdropClicked()})}disconnectedCallback(){super.disconnectedCallback(),this.modal.deactivate()}render(){return r.qy`
1633
+ <div class="container">
1634
+ <div class="backdrop" @click=${this.backdropClicked}></div>
1635
+ <modal-template
1636
+ @closeButtonPressed=${this.closeButtonPressed}
1637
+ @leftNavButtonPressed=${this.callUserPressedLeftNavButtonCallback}
1638
+ tabindex="-1"
1639
+ >
1640
+ ${this.customModalContent}
1641
+ </modal-template>
1642
+ </div>
1643
+ `}getMode(){return this.mode}closeModal(){this.mode=ot.Closed,this.customModalContent=void 0,this.modalTemplate&&(this.modalTemplate.config=new Ne),this.modal.deactivate(),this.triggeringElement?.focus?.(),this.triggeringElement=void 0}callUserClosedModalCallback(){const e=this.userClosedModalCallback;this.userClosedModalCallback=void 0,e&&e()}callUserPressedLeftNavButtonCallback(){const e=this.userPressedLeftNavButtonCallback;this.userPressedLeftNavButtonCallback=void 0,e&&e()}async showModal(e){this.mode===ot.Closed&&this.captureFocusedElement(),this.closeOnBackdropClick=e.config.closeOnBackdropClick,this.userClosedModalCallback=e.userClosedModalCallback,this.userPressedLeftNavButtonCallback=e.userPressedLeftNavButtonCallback,this.customModalContent=e.customModalContent,this.mode=ot.Open,this.modalTemplate&&(this.modalTemplate.config=e.config,await this.modalTemplate.updateComplete,this.modalTemplate.focus()),this.modal.activate()}captureFocusedElement(){this.triggeringElement=Ue()}updated(e){e.has("mode")&&this.handleModeChange()}backdropClicked(){this.closeOnBackdropClick&&(this.closeModal(),this.callUserClosedModalCallback())}handleModeChange(){this.hostBridge.handleModeChange(this.mode),this.emitModeChangeEvent()}emitModeChangeEvent(){const e=new CustomEvent("modeChanged",{detail:{mode:this.mode}});this.dispatchEvent(e)}closeButtonPressed(){this.closeModal(),this.callUserClosedModalCallback()}static get styles(){const e=r.AH`var(--modalBackdropColor, rgba(10, 10, 10, 0.9))`,t=r.AH`var(--modalBackdropZindex, 1000)`,n=r.AH`var(--modalWidth, 32rem)`,o=r.AH`var(--modalMaxWidth, 95%)`,i=r.AH`var(--modalZindex, 2000)`;return r.AH`
1644
+ .container {
1645
+ width: 100%;
1646
+ height: 100%;
1647
+ }
1648
+
1649
+ .backdrop {
1650
+ position: fixed;
1651
+ top: 0;
1652
+ left: 0;
1653
+ background-color: ${e};
1654
+ width: 100%;
1655
+ height: 100%;
1656
+ z-index: ${t};
1657
+ }
1658
+
1659
+ modal-template {
1660
+ outline: 0;
1661
+ position: fixed;
1662
+ top: 0;
1663
+ left: 50%;
1664
+ transform: translate(-50%, 0);
1665
+ z-index: ${i};
1666
+ width: ${n};
1667
+ max-width: ${o};
1668
+ }
1669
+ `}};(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],at.prototype,"mode",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],at.prototype,"customModalContent",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],at.prototype,"hostBridge",void 0),(0,o.Cg)([(0,i.P)("modal-template")],at.prototype,"modalTemplate",void 0),at=(0,o.Cg)([(0,i.EM)("modal-manager")],at);class st{constructor(){this.resizeObserver=new ResizeObserver(e=>{window.requestAnimationFrame(()=>{for(const t of e){const e=this.resizeHandlers.get(t.target);null==e||e.forEach(e=>{e.handleResize(t)})}})}),this.resizeHandlers=new Map}shutdown(){this.resizeHandlers.forEach((e,t)=>{this.resizeObserver.unobserve(t)}),this.resizeHandlers.clear()}addObserver(e){var t;const n=null!==(t=this.resizeHandlers.get(e.target))&&void 0!==t?t:new Set;n.add(e.handler),this.resizeHandlers.set(e.target,n),this.resizeObserver.observe(e.target,e.options)}removeObserver(e){const t=this.resizeHandlers.get(e.target);t&&(t.delete(e.handler),0===t.size&&(this.resizeObserver.unobserve(e.target),this.resizeHandlers.delete(e.target)))}}var lt=r.qy`
1670
+ <svg
1671
+ class="ia-logo"
1672
+ viewBox="0 0 27 30"
1673
+ xmlns="http://www.w3.org/2000/svg"
1674
+ >
1675
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
1676
+ <mask id="mask-2" class="fill-color">
1677
+ <path d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z" id="path-1"></path>
1678
+ </mask>
1679
+ <use class="fill-color" xlink:href="#path-1"></use>
1680
+ <g mask="url(#mask-2)" class="fill-color">
1681
+ <path d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z" id="swatch"></path>
1682
+ </g>
1683
+ </g>
1684
+ </svg>
1685
+ `;class ct extends r.WF{static get styles(){return r.AH`
1686
+ :host {
1687
+ width: var(--iconWidth, 'auto');
1688
+ height: var(--iconHeight, 'auto');
1689
+ }
1690
+
1691
+ .fill-color {
1692
+ fill: var(--iconFillColor);
1693
+ }
1694
+
1695
+ .stroke-color {
1696
+ stroke: var(--iconStrokeColor);
1697
+ }
1698
+ `}render(){return lt}}customElements.define("ia-icon-ia-logo",ct);var ut=r.qy`
1699
+ <svg
1700
+ viewBox="0 0 100 100"
1701
+ xmlns="http://www.w3.org/2000/svg"
1702
+ >
1703
+ <path
1704
+ class="fill-color"
1705
+ fill="none"
1706
+ d="m17.0555551 41.3194459c0-12.7430552 10.3541664-23.1027772 23.0847216-23.1027772 12.7166664 0 23.0777773 10.359722 23.0777773 23.1027772 0 12.7361108-10.3611109 23.0986106-23.0777773 23.0986106-12.7305552 0-23.0847216-10.3624998-23.0847216-23.0986106zm-17.24305512 0c0 22.2916661 18.04583292 40.3472213 40.32777672 40.3472213 8.9208332 0 17.145833-2.9319449 23.8194439-7.8527776l24.1513883 24.0777771c1.2125 1.1402778 2.8430555 1.8430556 4.6374999 1.8430556 3.7444443 0 6.7805554-3.0361111 6.7805554-6.7791665 0-2.0652778-.9222222-3.9069444-2.3736111-5.1499999l-23.718055-23.7458328c4.4152777-6.4791665 7.0152776-14.3055552 7.0152776-22.7402772 0-22.2791661-18.0458328-40.34861006-40.312499-40.34861006-22.2819438 0-40.32777672 18.06944396-40.32777672 40.34861006z" />
1707
+ </svg>
1708
+ `;class dt extends r.WF{static get styles(){return r.AH`
1709
+ :host {
1710
+ width: var(--iconWidth, 'auto');
1711
+ height: var(--iconHeight, 'auto');
1712
+ }
1713
+
1714
+ .fill-color {
1715
+ fill: var(--iconFillColor);
1716
+ }
1717
+
1718
+ .stroke-color {
1719
+ stroke: var(--iconStrokeColor);
1720
+ }
1721
+ `}render(){return ut}}function ht(e){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ht(e)}function pt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ft(r.key),r)}}function ft(e){var t=function(e){if("object"!=ht(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ht(t)?t:t+""}function mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(mt=function(){return!!e})()}function vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vt(e)}function bt(e,t){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bt(e,t)}customElements.define("ia-icon-search",dt);var yt=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=vt(t),function(e,t){if(t&&("object"==ht(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mt()?Reflect.construct(t,n||[],vt(e).constructor):t.apply(e,n))}(this,t,[e])).et=a.s6,e.type!==s.OA.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bt(e,t)}(t,e),function(e,t){return t&&pt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(e){if(e===a.s6||null==e)return this.ft=void 0,this.et=e;if(e===a.c0)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;var t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}])}(s.WL);yt.directiveName="unsafeHTML",yt.resultType=1;var gt,kt,wt,Ct,xt,St,Ot,Mt,Bt,jt,Pt,Et,Lt,At,_t,Tt,zt,It,$t=(0,s.u$)(yt),Ht=(0,r.qy)(gt||(wt=['\n<svg height="10" viewBox="0 0 13 10" width="13" xmlns="http://www.w3.org/2000/svg">\n <path\n d="m4.33333333 10-4.33333333-4.16666667 1.73333333-1.66666666 2.6 2.5 6.93333337-6.66666667 1.7333333 1.66666667z"\n fill="#fff" fill-rule="evenodd" />\n</svg>\n'],Ct||(Ct=wt.slice(0)),gt=Object.freeze(Object.defineProperties(wt,{raw:{value:Object.freeze(Ct)}})))),qt=(0,r.AH)(kt||(kt=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .ia-button {\n min-height: 3rem;\n border: none;\n cursor: pointer;\n color: var(--primaryTextColor);\n line-height: normal;\n border-radius: .4rem;\n text-align: center;\n vertical-align: middle;\n font-size: 1.4rem;\n font-family: inherit;\n display: inline-block;\n padding: .6rem 1.2rem;\n border: 1px solid transparent;\n\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n }\n\n .ia-button.link,\n .ia-button.external {\n min-height: unset;\n text-decoration: none;\n }\n\n .ia-button:disabled,\n .ia-button.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .ia-button.transparent {\n background-color: transparent;\n }\n \n .ia-button.slim {\n padding: 0;\n }\n\n .ia-button.primary {\n background-color: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n .ia-button.cancel {\n background-color: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .ia-button.external {\n background: var(--secondaryCTAFill);\n border-color: var(--secondaryCTABorder);\n }\n"]))),Dt=n(4535),Rt=(0,r.AH)(xt||(xt=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0 0 0 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n }\n"])));function Ft(e){e.prototype&&(e=e.prototype.render());var t=e.strings[0];return(0,r.AH)(["data:image/svg+xml;base64,".concat(btoa(t.replace(/\n/g," ")))])}function Wt(e){return Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wt(e)}function Vt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Nt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zt(r.key),r)}}function Zt(e){var t=function(e){if("object"!=Wt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wt(t)?t:t+""}function Ut(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ut=function(){return!!e})()}function Gt(e){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gt(e)}function Jt(e,t){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jt(e,t)}n(5440);var Xt,Kt,Qt,Yt,en=Ft(Ht),tn=Ft(Ye),nn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Gt(t),function(e,t){if(t&&("object"==Wt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ut()?Reflect.construct(t,n||[],Gt(e).constructor):t.apply(e,n))}(this,t)).results=[],e.query="",e.queryInProgress=!1,e.renderHeader=!1,e.renderSearchAllFiles=!1,e.errorMessage="",e.bindBookReaderListeners(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jt(e,t)}(t,e),function(e,t,n){return t&&Nt(e.prototype,t),n&&Nt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(){this.focusOnInputIfNecessary()}},{key:"bindBookReaderListeners",value:function(){document.addEventListener("BookReader:SearchCallback",this.setResults.bind(this))}},{key:"focusOnInputIfNecessary",value:function(){this.results.length||this.shadowRoot.querySelector("input[type='search']").focus()}},{key:"setResults",value:function(e){var t=e.detail;this.results=t.results}},{key:"setQuery",value:function(e){this.query=e.currentTarget.value,this.query||this.cancelSearch()}},{key:"performSearch",value:function(e){e.preventDefault();var t=e.currentTarget.querySelector('input[type="search"]');t&&t.value&&this.dispatchEvent(new CustomEvent("bookSearchInitiated",{bubbles:!0,composed:!0,detail:{query:this.query}}))}},{key:"selectResult",value:function(e){this.dispatchEvent(new CustomEvent("resultSelected",{bubbles:!0,composed:!0,detail:{match:e}})),this.dispatchEvent(new CustomEvent("closeMenu",{bubbles:!0,composed:!0}))}},{key:"cancelSearch",value:function(){this.queryInProgress=!1,this.dispatchSearchCanceled()}},{key:"dispatchSearchCanceled",value:function(){this.dispatchEvent(new Event("bookSearchCanceled"))}},{key:"resultsCount",get:function(){var e=this.results.length;return e?"".concat(e," result").concat(e>1?"s":""):r.s6}},{key:"headerSection",get:function(){var e=(0,r.qy)(St||(St=Vt(["<header>\n <h3>Search inside</h3>\n ","\n </header>"])),this.resultsCount?(0,r.qy)(Ot||(Ot=Vt(["(",")"])),this.resultsCount):r.s6);return this.renderHeader?e:r.s6}},{key:"searchMultipleControls",get:function(){var e=(0,r.qy)(Mt||(Mt=Vt(['\n <input name="all_files" id="all_files" type="checkbox" />\n <label class="checkbox" for="all_files">Search all files</label>\n '])));return this.renderSearchAllFiles?e:r.s6}},{key:"loadingIndicator",get:function(){return(0,r.qy)(Bt||(Bt=Vt(['\n <div class="loading">\n <ia-activity-indicator mode="processing" aria-hidden="true" role="presentation"></ia-activity-indicator>\n <p>Searching</p>\n <button class="ia-button external cancel-search" @click=',">Cancel</button>\n </div>\n "])),this.cancelSearch)}},{key:"resultsSet",get:function(){var e=this;return(0,r.qy)(jt||(jt=Vt(['\n <nav aria-label="Search results">\n <div>\n ','\n <a\n href="#"\n class="skip-link"\n @click=','\n >Skip to last result</a>\n </div>\n <ul class="results">\n ','\n </ul>\n <a\n href="#"\n class="skip-link"\n @click=',"\n >Skip to first result</a>\n </nav>\n "])),this.resultsCount,function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:last-child .result-item").focus()},this.results.map(function(t){return(0,r.qy)(Pt||(Pt=Vt(['\n <li>\n <button class="result-item" @click=','>\n <span class="page-num">Page ',"</span> — <span lang=",">","</span>\n </button>\n </li>\n "])),e.selectResult.bind(e,t),t.displayPageNumber,(0,Dt.J)(t.lang),$t(t.html))}),function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:first-child .result-item").focus()})}},{key:"setErrorMessage",get:function(){return(0,r.qy)(Et||(Et=Vt(['\n <p class="error-message">',"</p>\n "])),this.errorMessage)}},{key:"render",value:function(){var e=!(this.queryInProgress||this.errorMessage||this.queryInProgress||this.results.length);return(0,r.qy)(Lt||(Lt=Vt(["\n ",'\n <form action="" method="get" @submit=',">\n ",'\n <input\n type="search"\n name="query"\n id="br-search-input"\n @keyup=',"\n @search=","\n .value=",'\n />\n <label class="search-cta ','" for="br-search-input">\n Please enter text to search for\n </label>\n </form>\n <div class="results-container" aria-live="polite">\n ',"\n ","\n ","\n </div>\n "])),this.headerSection,this.performSearch,this.searchMultipleControls,this.setQuery,this.setQuery,this.query,e?"":"sr-only",this.queryInProgress?this.loadingIndicator:r.s6,this.errorMessage?this.setErrorMessage:r.s6,this.results.length?this.resultsSet:r.s6)}}],[{key:"properties",get:function(){return{results:{type:Array},query:{type:String},queryInProgress:{type:Boolean},renderHeader:{type:Boolean},renderSearchAllFiles:{type:Boolean},errorMessage:{type:String}}}},{key:"styles",get:function(){var e=(0,r.AH)(At||(At=Vt(["var(--searchResultText, #adaedc)"]))),t=(0,r.AH)(_t||(_t=Vt(["var(--searchResultBg, #272958)"]))),n=(0,r.AH)(Tt||(Tt=Vt(["var(--searchResultBorder, #adaedc)"]))),o=(0,r.AH)(zt||(zt=Vt(["(--tertiaryBGColor, #333)"]))),i=(0,r.AH)(It||(It=Vt(["\n :host {\n display: block;\n height: 100%;\n padding: 1.5rem 1rem 2rem 0;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n }\n\n .skip-link {\n position: absolute;\n left: -9999px;\n }\n .skip-link:focus {\n position: static;\n left: auto;\n }\n\n mark {\n padding: 0 .2rem;\n color: ",";\n background: ",";\n border: 1px solid ",';\n border-radius: 2px;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 2rem;\n }\n\n header {\n display: flex;\n align-items: center;\n padding: 0 2rem 0 0;\n }\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n\n form {\n padding: 0 0 1rem 0;\n }\n\n [type="checkbox"] {\n display: none;\n }\n\n label {\n display: block;\n text-align: center;\n }\n\n label.checkbox {\n padding-bottom: .5rem;\n font-size: 1.6rem;\n line-height: 150%;\n vertical-align: middle;\n }\n\n label.checkbox:after {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: .7rem;\n content: "";\n border-radius: 2px;\n }\n :checked + label.checkbox:after {\n background-image: url(\'','\');\n }\n\n label.checkbox[for="all_files"]:after {\n background: ',' 50% 50% no-repeat;\n border: 1px solid var(--primaryTextColor);\n }\n\n [type="search"] {\n color: var(--primaryTextColor);\n border: 1px solid var(--primaryTextColor);\n -webkit-appearance: textfield;\n width: 100%;\n height: 3rem;\n padding: 0 10px;\n box-sizing: border-box;\n font: normal 1.6rem "Helvetica qNeue", Helvetica, Arial, sans-serif;\n border-radius: 1.5rem;\n background: transparent;\n }\n [type="search"]:focus {\n outline: none;\n }\n [type="search"]::-webkit-search-cancel-button {\n width: 18px;\n height: 18px;\n margin-right: -5px;\n -webkit-appearance: none;\n appearance: none;\n -webkit-mask: url(\'',"') 0 0 no-repeat;\n mask: url('","') 0 0 no-repeat;\n -webkit-mask-size: 100%;\n mask-size: 100%;\n background: #fff;\n }\n\n .page-num {\n font-weight: bold;\n padding-bottom: 0;\n }\n\n .search-cta {\n padding: 10px 0;\n text-align: center;\n font-style: italic;\n }\n\n .results-container {\n padding-bottom: 2rem;\n }\n\n ul {\n padding: 0 0 2rem 0;\n margin: 0;\n list-style: none;\n }\n\n .result-item {\n cursor: pointer;\n margin-top: 8px;\n font-size: 12px;\n padding: 5px;\n border-radius: 4px;\n display: block;\n width: 100%;\n /* Reset button styles */\n background: none;\n border: none;\n text-align: left;\n font-family: inherit;\n transition: background-color 0.2s;\n }\n\n .result-item:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n .loading {\n text-align: center;\n }\n\n .loading p {\n padding: 0 0 1rem 0;\n margin: 0;\n font-size: 1.2rem;\n }\n\n ia-activity-indicator {\n display: block;\n width: 40px;\n height: 40px;\n margin: 0 auto;\n }\n "])),e,t,n,en,o,tn,tn);return[Rt,qt,i]}}])}(r.WF);function rn(e){return rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rn(e)}function on(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function an(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sn(r.key),r)}}function sn(e){var t=function(e){if("object"!=rn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rn(t)?t:t+""}customElements.define("ia-book-search-results",nn);var ln,cn,un,dn,hn,pn,fn,mn,vn,bn,yn,gn={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},kn=function(){return function(e,t){return t&&an(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=t.onProviderChange,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onBookSearchInitiated=this.onBookSearchInitiated.bind(this),this.onSearchStarted=this.onSearchStarted.bind(this),this.onSearchRequestError=this.onSearchRequestError.bind(this),this.onSearchResultsClicked=this.onSearchResultsClicked.bind(this),this.onSearchResultsChange=this.onSearchResultsChange.bind(this),this.onSearchResultsCleared=this.onSearchResultsCleared.bind(this),this.searchCanceledInMenu=this.searchCanceledInMenu.bind(this),this.bindEventListeners=this.bindEventListeners.bind(this),this.getMenuDetails=this.getMenuDetails.bind(this),this.getComponent=this.getComponent.bind(this),this.updateMenu=this.updateMenu.bind(this),this.onProviderChange=n,this.bookreader=o,this.icon=(0,r.qy)(Xt||(Xt=on(['\n <ia-icon-search\n aria-hidden="true" role="presentation"\n style="width: var(--iconWidth); height: var(--iconHeight);"\n ></ia-icon-search>']))),this.label="Search inside",this.menuDetails=this.getMenuDetails(),this.id="search",this.component=this.getComponent(),this.bindEventListeners()},[{key:"getMenuDetails",value:function(){var e=gn,t=e.resultsCount,n=e.query;if(e.queryInProgress||!n)return r.s6;var o=1===t?"result":"results";return(0,r.qy)(Kt||(Kt=on(["("," ",")"])),t,o)}},{key:"bindEventListeners",value:function(){var e=this;window.addEventListener("BookReader:SearchStarted",this.onSearchStarted),window.addEventListener("BookReader:SearchCallback",this.onSearchResultsChange),window.addEventListener("BookReader:SearchCallbackEmpty",function(t){e.onSearchRequestError(t,"noResults")}),window.addEventListener("BookReader:SearchCallbackNotIndexed",function(t){e.onSearchRequestError(t,"notIndexed")}),window.addEventListener("BookReader:SearchCallbackError",function(t){e.onSearchRequestError(t)}),window.addEventListener("BookReader:SearchResultsCleared",function(){e.onSearchResultsCleared()}),window.addEventListener("BookReader:SearchCanceled",function(t){e.onSearchCanceled(t)})}},{key:"onSearchCanceled",value:function(){gn={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({searchCanceled:!0}),this.bookreader.urlPlugin&&this.updateSearchInUrl()}},{key:"onSearchStarted",value:function(e){var t=e.detail.props,n=t.term,r=void 0===n?"":n,o=t.instance;o&&(this.bookreader=o),gn.query=r,gn.results=[],gn.resultsCount=0,gn.queryInProgress=!0,gn.errorMessage="",this.updateMenu()}},{key:"onBookSearchInitiated",value:function(e){var t=e.detail;gn.query=t.query,this.bookreader.search(gn.query)}},{key:"onSearchRequestError",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=e.detail.props,i=o.instance,a=o.results;i&&(this.bookreader=i);var s={noResults:"0 results",notIndexed:"This book hasn't been indexed for searching yet. We've just started indexing it,\n so search should be available soon. Please try again later. Thanks!",default:"Sorry, there was an error with your search. Please try again."},l=null!==(t=s[n])&&void 0!==t?t:s.default;gn.query=(null==a?void 0:a.q)||"",gn.results=[],gn.resultsCount=0,gn.queryInProgress=!1,gn.errorMessage=(0,r.qy)(Qt||(Qt=on(['<p class="error">',"</p>"])),l),this.updateMenu()}},{key:"onSearchResultsChange",value:function(e){var t=e.detail.props,n=void 0===t?{}:t,r=n.instance,o=void 0===r?null:r,i=n.results,a=void 0===i?[]:i;o&&(this.bookreader=o);var s=a.matches||[],l=s.length,c=a.q;gn={results:s,resultsCount:l,query:c,queryInProgress:!1,errorMessage:""},this.updateMenu()}},{key:"searchCanceledInMenu",value:function(){this.bookreader.plugins.search.cancelSearchRequest()}},{key:"onSearchResultsCleared",value:function(){gn={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({openMenu:!1}),this.bookreader.plugins.search.searchView.clearSearchFieldAndResults(!1),this.bookreader.urlPlugin&&this.updateSearchInUrl()}},{key:"updateSearchInUrl",value:function(){this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),gn.query?this.bookreader.urlPlugin.setUrlParam("q",gn.query):this.bookreader.urlPlugin.removeUrlParam("q"))}},{key:"updateMenu",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.menuDetails=this.getMenuDetails(),this.component=this.getComponent(),this.onProviderChange(this.bookreader,e)}},{key:"getComponent",value:function(){var e=gn,t=e.query,n=e.results,o=e.queryInProgress,i=e.errorMessage;return(0,r.qy)(Yt||(Yt=on(["\n <ia-book-search-results\n .query=","\n .results=","\n .errorMessage=","\n ?queryInProgress=","\n ?renderSearchAllFiles=","\n @resultSelected=","\n @bookSearchInitiated=","\n @bookSearchResultsCleared=","\n @bookSearchCanceled=","\n ></ia-book-search-results>\n "])),t,n,i,o,!1,this.onSearchResultsClicked,this.onBookSearchInitiated,this.onSearchResultsCleared,this.searchCanceledInMenu)}},{key:"onSearchResultsClicked",value:function(e){var t=e.detail;this.bookreader.plugins.search.jumpToMatch(t.match.matchIndex)}}])}(),wn=(n(2712),r.qy`
1722
+ <svg
1723
+ viewBox="0 0 100 100"
1724
+ xmlns="http://www.w3.org/2000/svg"
1725
+ >
1726
+ <g class="fill-color">
1727
+
1728
+ <path d="m50 80 33.3333333-43.3333333h-20v-36.6666667h-26.6666666v36.6666667h-20zm50 20v-13.3333333h-100v13.3333333z"/>
1729
+ </g>
1730
+ </svg>
1731
+ `);class Cn extends r.WF{static get styles(){return r.AH`
1732
+ :host {
1733
+ width: var(--iconWidth, 'auto');
1734
+ height: var(--iconHeight, 'auto');
1735
+ }
1736
+
1737
+ .fill-color {
1738
+ fill: var(--iconFillColor);
1739
+ }
1740
+
1741
+ .stroke-color {
1742
+ stroke: var(--iconStrokeColor);
1743
+ }
1744
+ `}render(){return wn}}function xn(e){return xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xn(e)}function Sn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function On(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mn(r.key),r)}}function Mn(e){var t=function(e){if("object"!=xn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xn(t)?t:t+""}function Bn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Bn=function(){return!!e})()}function jn(e){return jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jn(e)}function Pn(e,t){return Pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pn(e,t)}customElements.define("ia-icon-dl",Cn);var En,Ln,An=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=jn(t),function(e,t){if(t&&("object"==xn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Bn()?Reflect.construct(t,n||[],jn(e).constructor):t.apply(e,n))}(this,t)).downloads=[],e.expiration=0,e.renderHeader=!1,e.isBookProtected=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pn(e,t)}(t,e),function(e,t,n){return t&&On(e.prototype,t),n&&On(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"formatsCount",get:function(){var e=this.downloads.length;return e?(0,r.qy)(ln||(ln=Sn(["<p>"," format","</p>"])),e,e>1?"s":""):(0,r.qy)(cn||(cn=Sn([""])))}},{key:"loanExpiryMessage",get:function(){return this.expiration?(0,r.qy)(un||(un=Sn(["<h2>These files will expire in "," days.</h2>"])),this.expiration):(0,r.qy)(dn||(dn=Sn([""])))}},{key:"renderDownloadOptions",value:function(){return this.downloads.map(function(e){return(0,r.qy)(hn||(hn=Sn(['\n <li>\n <a class="ia-button link primary" href="','">Get ',"</a>\n ","\n </li>\n "])),e.url,e.type,e.note?(0,r.qy)(pn||(pn=Sn(["<p>","</p>"])),e.note):(0,r.qy)(fn||(fn=Sn([""]))))})}},{key:"hasLCPOption",get:function(){var e=/^(LCP)/g;return this.downloads.some(function(t){var n;return null===(n=t.type)||void 0===n?void 0:n.match(e)})}},{key:"header",get:function(){return this.renderHeader?(0,r.qy)(mn||(mn=Sn(["\n <header>\n <h3>Downloadable files</h3>\n ","\n </header>\n "])),this.formatsCount):r.s6}},{key:"installLCPSoftwareMsg",get:function(){return(0,r.qy)(vn||(vn=Sn(['\n <p>For LCP downloads, make sure you have LCP software such as <a href="https://thorium.edrlab.org/" rel="noopener noreferrer nofollow" target="_blank">Thorium (desktop)</a>, <a href="https://apps.apple.com/us/app/cantook-by-aldiko/id1476410111" rel="noopener noreferrer nofollow" target="_blank">Cantook (iOS)</a> or <a href="https://play.google.com/store/apps/details?id=com.aldiko.android" rel="noopener noreferrer nofollow" target="_blank">Cantook (Android)</a> installed on your device.</p>\n '])))}},{key:"render",value:function(){return(0,r.qy)(bn||(bn=Sn(["\n ","\n ","\n <ul>","</ul>\n ","\n "])),this.header,this.loanExpiryMessage,this.renderDownloadOptions(),this.hasLCPOption?this.installLCPSoftwareMsg:r.s6)}}],[{key:"properties",get:function(){return{downloads:{type:Array},expiration:{type:Number},renderHeader:{type:Boolean},isBookProtected:{type:Boolean}}}},{key:"styles",get:function(){var e=(0,r.AH)(yn||(yn=Sn(["\n :host {\n display: block;\n height: 100%;\n padding: 1.5rem 0;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n }\n\n a.close ia-icon {\n --iconWidth: 18px;\n --iconHeight: 18px;\n }\n a.close {\n justify-self: end;\n }\n\n header {\n display: flex;\n align-items: center;\n padding: 0 2rem;\n }\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n header div {\n display: flex;\n align-items: baseline;\n } \n\n h2 {\n font-size: 1.6rem;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 1.4rem;\n }\n\n ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n p {\n margin: .3rem 0 0 0;\n }\n\n li,\n ul + p {\n padding-bottom: 1.2rem;\n font-size: 1.2rem;\n line-height: 140%;\n }\n "])));return[qt,e]}}])}(r.WF);function _n(e){return _n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_n(e)}function Tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function In(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,$n(r.key),r)}}function $n(e){var t=function(e){if("object"!=_n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_n(t)?t:t+""}customElements.define("ia-book-downloads",An);var Hn={pdf:{type:"Encrypted Adobe PDF",url:"#",note:"PDF files contain high quality images of pages."},lcppdf:{type:"Get LCP PDF",url:"#",note:"PDF files contain high quality images of pages."},lcpepub:{type:"Get LCP ePub",url:"#",note:"ePub files are smaller in size, but may contain errors."},epub:{type:"Encrypted Adobe ePub",url:"#",note:"ePub files are smaller in size, but may contain errors."}},qn={pdf:"PDF",epub:"ePub",lcppdf:"LCP PDF",lcpepub:"LCP ePub"},Dn=function(){return function(e,t){return t&&In(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.icon=(0,r.qy)(En||(En=zn(['<ia-icon-dl aria-hidden="true" role="presentation" style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-dl>']))),this.label="Downloadable files",this.menuDetails="",this.downloads=[],this.id="downloads",this.component="",this.isBookProtected=(null==o||null===(n=o.options)||void 0===n?void 0:n.isProtected)||!1},[{key:"update",value:function(e){this.computeAvailableTypes(e),this.component=this.menu,this.component.isBookProtected=this.isBookProtected;var t=1===this.downloads.length?"":"s";this.menuDetails="(".concat(this.downloads.length," format").concat(t,")")}},{key:"computeAvailableTypes",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(function(t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Tn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),r=n[0],o=void 0===r?"":r,i=n[1],a=void 0===i?"":i,s=o.toLowerCase(),l=Hn[s]||null;if(l){var c=e.isBookProtected?Hn[s].type:qn[s],u=Object.assign({},l,{url:a,type:c});t.push(u)}return t},[]);this.downloads=t}},{key:"menu",get:function(){return(0,r.qy)(Ln||(Ln=zn(["<ia-book-downloads .downloads=","></ia-book-downloads>"])),this.downloads)}}])}(),Rn=r.qy`
1745
+ <svg
1746
+ viewBox="0 0 24 24"
1747
+ xmlns="http://www.w3.org/2000/svg"
1748
+ >
1749
+ <path class="fill-color" d="m12 0c6.627417 0 12 5.372583 12 12s-5.372583 12-12 12-12-5.372583-12-12 5.372583-12 12-12zm0 2v20l.2664041-.0034797c5.399703-.1412166 9.7335959-4.562751 9.7335959-9.9965203 0-5.5228475-4.4771525-10-10-10z" fill-rule="evenodd" />
1750
+ </svg>
1751
+ `;class Fn extends r.WF{static get styles(){return r.AH`
1752
+ :host {
1753
+ width: var(--iconWidth, 'auto');
1754
+ height: var(--iconHeight, 'auto');
1755
+ }
1756
+
1757
+ .fill-color {
1758
+ fill: var(--iconFillColor);
1759
+ }
1760
+
1761
+ .stroke-color {
1762
+ stroke: var(--iconStrokeColor);
1763
+ }
1764
+ `}render(){return Rn}}customElements.define("ia-icon-visual-adjustment",Fn);var Wn=r.qy`
1765
+ <svg
1766
+ viewBox="0 0 100 100"
1767
+ xmlns="http://www.w3.org/2000/svg"
1768
+ >
1769
+ <g
1770
+ class="fill-color"
1771
+ fill="none"
1772
+ fill-rule="nonzero"
1773
+ >
1774
+ <path d="m2.3239824 87.3815869 25.8938394-23.8143095c-4.5929593-6.6937643-6.889439-14.1059452-6.889439-22.2365428 0-7.1360431 1.7567382-13.7186647 5.2702146-19.7478649 3.5134763-6.0292002 8.2852035-10.8003118 14.3151815-14.31333499 6.029978-3.51302314 12.6134488-5.26953471 19.7504125-5.26953471s13.7204346 1.75651157 19.7504126 5.26953471c6.029978 3.51302319 10.8017051 8.28413479 14.3151815 14.31333499 3.5134763 6.0292002 5.2702145 12.6118218 5.2702145 19.7478649s-1.7567382 13.7324143-5.2702145 19.7891137c-3.5134764 6.0566994-8.2852035 10.8415607-14.3151815 14.3545838-6.029978 3.5130232-12.6134489 5.2695347-19.7504126 5.2695347-8.5762743 0-16.3217363-2.5723212-23.2363861-7.7169637l-26.3063807 24.2302349c-1.27200216 1.1618413-2.76631826 1.742762-4.48294825 1.742762-1.826641 0-3.38971397-.6496687-4.68921892-1.949006s-1.94925743-2.8622087-1.94925743-4.688614c0-1.9364022.7746608-3.5955208 2.3239824-4.9773557zm58.3436469-19.9162976c7.1919692 0 13.3331041-2.5585716 18.4234048-7.6757149s7.635451-11.2712357 7.635451-18.4622772-2.5451503-13.3313843-7.635451-18.4210284-11.2314356-7.6344661-18.4234048-7.6344661-13.3331042 2.544822-18.4234049 7.6344661-7.635451 11.2299869-7.635451 18.4210284 2.5451503 13.3451339 7.635451 18.4622772 11.2314357 7.6757149 18.4234049 7.6757149zm-14.9374313-21.3256316h31.2878163v-9.5422233h-31.2878163z"/>
1775
+ </g>
1776
+ </svg>
1777
+ `;class Vn extends r.WF{static get styles(){return r.AH`
1778
+ :host {
1779
+ width: var(--iconWidth, 'auto');
1780
+ height: var(--iconHeight, 'auto');
1781
+ }
1782
+
1783
+ .fill-color {
1784
+ fill: var(--iconFillColor);
1785
+ }
1786
+
1787
+ .stroke-color {
1788
+ stroke: var(--iconStrokeColor);
1789
+ }
1790
+ `}render(){return Wn}}customElements.define("ia-icon-magnify-minus",Vn);var Nn,Zn,Un,Gn,Jn,Xn,Kn,Qn=r.qy`
1791
+ <svg
1792
+ viewBox="0 0 100 100"
1793
+ xmlns="http://www.w3.org/2000/svg"
1794
+ >
1795
+ <g
1796
+ class="fill-color"
1797
+ fill="none"
1798
+ fill-rule="nonzero"
1799
+ >
1800
+ <path d="m2.40305276 87.4017263 25.81133064-23.7730295c-4.5356618-6.5723551-6.8034928-14.000283-6.8034928-22.2837838 0-7.1236734 1.7429868-13.6948847 5.2289603-19.7136338 3.4859736-6.0187491 8.2577006-10.7953163 14.3151813-14.32970144 6.0574806-3.53438517 12.6547027-5.30157776 19.7916662-5.30157776 10.8429591 0 20.0964884 3.85236545 27.760588 11.5570964 7.6640996 7.7047309 11.4950036 16.9684802 11.4927136 27.791248 0 10.8799585-3.8309059 20.1574336-11.4927136 27.8324254-7.6618077 7.6749917-16.915337 11.5124876-27.760588 11.5124876-8.6312796 0-16.431747-2.5678624-23.4014021-7.7035871l-26.1413636 24.188234c-1.21699671 1.2147305-2.73881553 1.8220957-4.56545649 1.8220957s-3.3897139-.6485425-4.68921882-1.9456276c-1.29950493-1.297085-1.94925739-2.8572473-1.94925739-4.6804867 0-1.8781426.80216353-3.5343852 2.4064906-4.9687279zm58.34020784-19.878343c7.1369635 0 13.264347-2.5678623 18.3821503-7.7035871 5.1178034-5.1357247 7.676705-11.2928753 7.676705-18.4714518s-2.5589016-13.3082755-7.676705-18.3890972c-5.1178033-5.0808217-11.2451868-7.6212325-18.3821503-7.6212325-7.2469746 0-13.4156121 2.5404108-18.5059127 7.6212325s-7.6354509 11.2105207-7.6354509 18.3890972 2.5589016 13.3357271 7.676705 18.4714518c5.1178033 5.1357248 11.2726895 7.7035871 18.4646586 7.7035871zm-13.3594607-21.8685793h10.206958v10.1879511h7.2194718v-10.1879511h10.206958v-7.206028h-10.206958v-10.187951h-7.2194718v10.187951h-10.206958z"/>
1801
+ </g>
1802
+ </svg>
1803
+ `;class Yn extends r.WF{static get styles(){return r.AH`
1804
+ :host {
1805
+ width: var(--iconWidth, 'auto');
1806
+ height: var(--iconHeight, 'auto');
1807
+ }
1808
+
1809
+ .fill-color {
1810
+ fill: var(--iconFillColor);
1811
+ }
1812
+
1813
+ .stroke-color {
1814
+ stroke: var(--iconStrokeColor);
1815
+ }
1816
+ `}render(){return Qn}}function er(e){return er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},er(e)}function tr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function nr(e){return function(e){if(Array.isArray(e))return rr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return rr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rr(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ir(r.key),r)}}function ir(e){var t=function(e){if("object"!=er(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==er(t)?t:t+""}function ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ar=function(){return!!e})()}function sr(e){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sr(e)}function lr(e,t){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lr(e,t)}customElements.define("ia-icon-magnify-plus",Yn);var cr,ur,dr=function(e){return"visualAdjustment".concat(e)},hr={optionChange:dr("OptionChanged"),zoomIn:dr("ZoomIn"),zoomOut:dr("ZoomOut")},pr=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=sr(t),function(e,t){if(t&&("object"==er(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ar()?Reflect.construct(t,n||[],sr(e).constructor):t.apply(e,n))}(this,t)).activeCount=0,e.options=[],e.renderHeader=!1,e.showZoomControls=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lr(e,t)}(t,e),function(e,t,n){return t&&or(e.prototype,t),n&&or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"firstUpdated",value:function(){this.activeCount=this.activeOptions.length,this.emitOptionChangedEvent()}},{key:"activeOptions",get:function(){return this.options.reduce(function(e,t){return t.active?[].concat(nr(e),[t.id]):e},[])}},{key:"prepareEventDetails",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{options:this.options,activeCount:this.activeCount,changedOptionId:e}}},{key:"emitOptionChangedEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.prepareEventDetails(e);this.dispatchEvent(new CustomEvent(hr.optionChange,{bubbles:!0,composed:!0,detail:t}))}},{key:"emitZoomIn",value:function(){this.dispatchEvent(new CustomEvent(hr.zoomIn))}},{key:"emitZoomOut",value:function(){this.dispatchEvent(new CustomEvent(hr.zoomOut))}},{key:"changeActiveStateFor",value:function(e){var t=nr(this.options),n=t.find(function(t){return t.id===e});if(n.active=!n.active,this.options=t,this.activeCount=this.activeOptions.length,this.emitOptionChangedEvent(n.id),n.active&&void 0!==n.value){var r=this.shadowRoot.querySelector('input[name="'.concat(n.id,'_range"]'));requestAnimationFrame(function(){null==r||r.focus()})}}},{key:"setRangeValue",value:function(e,t){var n=nr(this.options);n.find(function(t){return t.id===e}).value=t,this.options=nr(n)}},{key:"rangeSlider",value:function(e){var t=this;return(0,r.qy)(Nn||(Nn=tr(["\n <label class=",'>\n <span class="sr-only">','</span>\n <input\n type="range"\n name="','_range"\n min=',"\n max=","\n step=","\n .value=","\n aria-valuetext=","\n @input=","\n @change=",'\n />\n <span aria-hidden="true">',"%</span>\n </label>\n "])),"range".concat(e.active?" visible":""),e.name,e.id,e.min||0,e.max||100,e.step||1,e.value,"".concat(e.value,"%"),function(n){return t.setRangeValue(e.id,n.target.value)},function(){return t.emitOptionChangedEvent()},e.value)}},{key:"adjustmentCheckbox",value:function(e){var t=this;return(0,r.qy)(Zn||(Zn=tr(['\n <div\n class="adjustment-option ','">\n <label class="checkbox-label">\n ','\n <input\n type="checkbox"\n @change=',"\n ?checked=","\n />\n </label>\n ","\n </div>\n "])),m({active:e.active,"has-range":void 0!==e.value}),e.name,function(){return t.changeActiveStateFor(e.id)},e.active,void 0!==e.value?this.rangeSlider(e):r.s6)}},{key:"headerSection",get:function(){var e=this.activeCount?(0,r.qy)(Un||(Un=tr(["<p>("," active)</p>"])),this.activeCount):r.s6,t=(0,r.qy)(Gn||(Gn=tr(["<header>\n <h3>Visual adjustments</h3>\n ","\n </header>"])),e);return this.renderHeader?t:r.s6}},{key:"zoomControls",get:function(){return(0,r.qy)(Jn||(Jn=tr(['\n <h4>Adjust zoom</h4>\n <button class="zoom_out" @click=',' title="Zoom out" aria-label="Zoom out">\n <ia-icon-magnify-minus aria-hidden="true" role="presentation"></ia-icon-magnify-minus>\n </button>\n <button class="zoom_in" @click=',' title="Zoom in" aria-label="Zoom in">\n <ia-icon-magnify-plus aria-hidden="true" role="presentation"></ia-icon-magnify-plus>\n </button>\n '])),this.emitZoomOut,this.emitZoomIn)}},{key:"render",value:function(){return(0,r.qy)(Xn||(Xn=tr(["\n ","\n ","\n ","\n "])),this.headerSection,He(this.options,function(e){return e.id},this.adjustmentCheckbox.bind(this)),this.showZoomControls?this.zoomControls:r.s6)}}],[{key:"properties",get:function(){return{activeCount:{type:Number},options:{type:Array},renderHeader:{type:Boolean},showZoomControls:{type:Boolean}}}},{key:"styles",get:function(){var e=(0,r.AH)(Kn||(Kn=tr(['\n :host {\n display: block;\n height: 100%;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n padding: 10px 10px 0 0;\n }\n\n header {\n display: flex;\n align-items: baseline;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 1.6rem;\n }\n\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n\n .adjustment-option {\n border: 2px solid transparent;\n border-radius: 4px;\n margin-bottom: 4px;\n }\n .adjustment-option.has-range.active {\n border: 2px solid rgba(255, 255, 255, 0.2);\n }\n\n .checkbox-label {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n padding: 6px 8px;\n transition: background-color 0.2s;\n border-radius: inherit;\n }\n .checkbox-label:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n .adjustment-option.has-range.active > .checkbox-label {\n border-radius: 4px 4px 0 0;\n }\n\n [type="checkbox"] {\n transform: scale(1.5);\n }\n\n .range {\n display: none;\n padding: 10px;\n align-items: center;\n gap: 10px;\n }\n .range.visible {\n display: flex;\n }\n .range input[type="range"] {\n flex: 1;\n }\n\n h4 {\n padding: 1rem 0;\n margin: 0;\n font-size: 1.4rem;\n }\n\n button {\n -webkit-appearance: none;\n appearance: none;\n border: none;\n background: transparent;\n cursor: pointer;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n height: 4rem;\n width: 4rem;\n transition: background-color 0.2s;\n border-radius: 4px;\n }\n\n button:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n '])));return[Rt,e]}}])}(r.WF);function fr(e){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fr(e)}function mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function br(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,yr(r.key),r)}}function yr(e){var t=function(e){if("object"!=fr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fr(t)?t:t+""}customElements.define("ia-book-visual-adjustments",pr);var gr,kr,wr=[{id:"brightness",name:"Adjust brightness",active:!1,min:0,max:200,step:1,value:120},{id:"contrast",name:"Adjust contrast",active:!1,min:0,max:200,step:1,value:120},{id:"invert",name:"Invert colors (dark mode)",active:!1},{id:"grayscale",name:"Convert to grayscale",active:!1}],Cr=function(){return function(e,t){return t&&br(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=t.onProviderChange,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onProviderChange=n,this.bookContainer=o.refs.$brContainer,this.bookreader=o,this.onAdjustmentChange=this.onAdjustmentChange.bind(this),this.optionUpdateComplete=this.optionUpdateComplete.bind(this),this.updateOptionsCount=this.updateOptionsCount.bind(this),this.onZoomIn=this.onZoomIn.bind(this),this.onZoomOut=this.onZoomOut.bind(this),this.activeCount=0,this.icon=(0,r.qy)(cr||(cr=vr(['<ia-icon-visual-adjustment aria-hidden="true" role="presentation" style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-visual-adjustment>']))),this.label="Visual Adjustments",this.menuDetails=this.updateOptionsCount(),this.id="visualAdjustments",this.component=(0,r.qy)(ur||(ur=vr(["\n <ia-book-visual-adjustments\n .options=","\n @visualAdjustmentOptionChanged=","\n @visualAdjustmentZoomIn=","\n @visualAdjustmentZoomOut=","\n ></ia-book-visual-adjustments>\n "])),wr,this.onAdjustmentChange,this.onZoomIn,this.onZoomOut)},[{key:"onZoomIn",value:function(){this.bookreader.zoom(1)}},{key:"onZoomOut",value:function(){this.bookreader.zoom(-1)}},{key:"onAdjustmentChange",value:function(e){var t=e.detail,n={brightness:function(e){return"brightness(".concat(e,"%)")},contrast:function(e){return"contrast(".concat(e,"%)")},grayscale:function(){return"grayscale(100%)"},invert:function(){return"invert(100%)"}},r=t.options.reduce(function(e,t){var r="".concat(t.active?n[t.id](t.value):"");return r?[].concat(function(e){return function(e){if(Array.isArray(e))return mr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return mr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mr(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),[r]):e},[]).join(" ");this.bookContainer.css("filter",r),this.optionUpdateComplete(e)}},{key:"optionUpdateComplete",value:function(e){this.activeCount=e.detail.activeCount,this.updateOptionsCount(e),this.onProviderChange()}},{key:"updateOptionsCount",value:function(){this.menuDetails="(".concat(this.activeCount," active)")}}])}();function xr(e){return xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xr(e)}function Sr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mr(r.key),r)}}function Mr(e){var t=function(e){if("object"!=xr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xr(t)?t:t+""}function Br(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Br=function(){return!!e})()}function jr(e){return jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jr(e)}function Pr(e,t){return Pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pr(e,t)}var Er,Lr,Ar=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=jr(t),function(e,t){if(t&&("object"==xr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Br()?Reflect.construct(t,n||[],jr(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pr(e,t)}(t,e),function(e,t,n){return t&&Or(e.prototype,t),n&&Or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){var e=this;return(0,r.qy)(gr||(gr=Sr(['\n <div>\n <button class="delete" @click=',">Delete</button>\n <button @click=",">Cancel</button>\n </div>\n "])),function(){return e.deleteAction({detail:{id:"".concat(e.pageID)}})},function(){return e.cancelAction()})}}],[{key:"styles",get:function(){return(0,r.AH)(kr||(kr=Sr(['\n div {\n display: flex;\n justify-content: center;\n padding-top: 2rem;\n }\n\n button {\n appearance: none;\n padding: 0.5rem 1rem;\n margin: 0 .5rem;\n box-sizing: border-box;\n font: 1.3rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n background: var(--primaryCTAFill);\n }\n\n .delete {\n background: var(--primaryErrorCTAFill);\n }\n '])))}},{key:"properties",get:function(){return{cancelAction:{type:Function},deleteAction:{type:Function},pageID:{type:String}}}}])}(r.WF);function _r(e){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_r(e)}function Tr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function zr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ir(r.key),r)}}function Ir(e){var t=function(e){if("object"!=_r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_r(t)?t:t+""}function $r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($r=function(){return!!e})()}function Hr(e){return Hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hr(e)}function qr(e,t){return qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qr(e,t)}customElements.define("delete-modal-actions",Ar);var Dr,Rr=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Hr(t),function(e,t){if(t&&("object"==_r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$r()?Reflect.construct(t,n||[],Hr(e).constructor):t.apply(e,n))}(this,t)).state="hollow",e.side=void 0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qr(e,t)}(t,e),function(e,t,n){return t&&zr(e.prototype,t),n&&zr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"handleClick",value:function(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("bookmarkButtonClicked"))}},{key:"title",get:function(){return"".concat("hollow"===this.state?"Add":"Remove"," bookmark")}},{key:"render",value:function(){var e=this.side||"right";return(0,r.qy)(Er||(Er=Tr(["\n <button title="," @click="," class=",">\n <icon-bookmark state=",' aria-hidden="true"></icon-bookmark>\n </button>\n '])),this.title,this.handleClick,e,this.state)}}],[{key:"styles",get:function(){return(0,r.AH)(Lr||(Lr=Tr(["\n button {\n -webkit-appearance: none;\n appearance: none;\n outline: 0;\n border: none;\n padding: 0;\n height: 4rem;\n width: 4rem;\n background: transparent;\n cursor: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 16 24' width='16'%3E%3Cg fill='%23333' fill-rule='evenodd'%3E%3Cpath d='m15 0c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1zm-2 2h-10c-.51283584 0-.93550716.38604019-.99327227.88337887l-.00672773.11662113v18l6-4.3181818 6 4.3181818v-18c0-.51283584-.3860402-.93550716-.8833789-.99327227z'/%3E%3Cpath d='m8.75 6v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25v-2.25z' fill-rule='nonzero'/%3E%3C/g%3E%3C/svg%3E\"), pointer;\n position: relative;\n }\n button > * {\n display: block;\n position: absolute;\n top: 0.2rem;\n }\n button.left > * {\n left: 0.2rem;\n }\n\n button.right > * {\n right: 0.2rem;\n }\n "])))}},{key:"properties",get:function(){return{side:{type:String},state:{type:String}}}}])}(r.WF);function Fr(e){return Fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fr(e)}function Wr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Vr(r.key),r)}}function Vr(e){var t=function(e){if("object"!=Fr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fr(t)?t:t+""}function Nr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Nr=function(){return!!e})()}function Zr(e){return Zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zr(e)}function Ur(e,t){return Ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ur(e,t)}customElements.define("bookmark-button",Rr),n(4423),n(739),n(8940),n(3362),n(1699);var Gr,Jr,Xr,Kr,Qr,Yr,eo,to,no,ro=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Zr(t),function(e,t){if(t&&("object"==Fr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Nr()?Reflect.construct(t,n||[],Zr(e).constructor):t.apply(e,n))}(this,t)).url="https://archive.org/account/login",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ur(e,t)}(t,e),function(e,t,n){return t&&Wr(e.prototype,t),n&&Wr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){return(0,r.qy)(Dr||(Dr=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <p>A free account is required to save and access bookmarks.</p>\n <a class="ia-button link primary" href="','">Log in</a>\n '])),this.url)}}],[{key:"properties",get:function(){return{url:{type:String}}}},{key:"styles",get:function(){return qt}}])}(r.WF);function oo(e){return oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oo(e)}function io(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function so(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ao(Object(n),!0).forEach(function(t){lo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ao(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lo(e,t,n){return(t=mo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function co(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return uo(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,s=0,l=e,h.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],p=h.p,f=i[2];n>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==a)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(uo(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,uo(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,uo(d,"constructor",c),uo(c,"constructor",l),l.displayName="GeneratorFunction",uo(c,o,"GeneratorFunction"),uo(d),uo(d,o,"Generator"),uo(d,r,function(){return this}),uo(d,"toString",function(){return"[object Generator]"}),(co=function(){return{w:i,m:h}})()}function uo(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}uo=function(e,t,n,r){function i(t,n){uo(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},uo(e,t,n,r)}function ho(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function po(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ho(i,r,o,a,s,"next",e)}function s(e){ho(i,r,o,a,s,"throw",e)}a(void 0)})}}function fo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mo(r.key),r)}}function mo(e){var t=function(e){if("object"!=oo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=oo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oo(t)?t:t+""}function vo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(vo=function(){return!!e})()}function bo(e){return bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bo(e)}function yo(e,t){return yo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yo(e,t)}customElements.define("bookmarks-login",ro);var go,ko={endpoint:"/services/bookmarks.php",headers:{"Content-Type":"application/json"},delete:function(e){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e),{credentials:"same-origin",method:"DELETE",headers:this.headers})},get:function(e){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e),{credentials:"same-origin",method:"GET",headers:this.headers})},getAll:function(){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier),{credentials:"same-origin",method:"GET",headers:this.headers})},post:function(e){return this.sendBookmarkData(e,"POST")},put:function(e){return this.sendBookmarkData(e,"POST")},sendBookmarkData:function(e,t){var n={note:e.note,color:e.color};return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e.id),{credentials:"same-origin",method:t,headers:this.headers,body:JSON.stringify({notes:n})})}},wo=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=bo(t),function(e,t){if(t&&("object"==oo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,vo()?Reflect.construct(t,n||[],bo(e).constructor):t.apply(e,n))}(this,t)).bookmarks=[],e.bookreader={},e.editedBookmark={},e.modal=void 0,e.loginOptions={loginClicked:function(){},loginUrl:""},e.displayMode="bookmarks",e.bookmarkColors=[{id:0,className:"red"},{id:1,className:"blue"},{id:2,className:"green"}],e.defaultColor=e.bookmarkColors[0],e.api=ko,e.deleteModalConfig=new Ne({title:"Delete Bookmark",headline:"This bookmark contains a note. Deleting it will permanently delete the note. Are you sure?",headerColor:"#194880"}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yo(e,t)}(t,e),function(e,t,n){return t&&fo(e.prototype,t),n&&fo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(e){e.has("displayMode")&&this.updateDisplay(),this.emitBookmarksChanged()}},{key:"setup",value:function(){this.api.identifier=this.getIdentifier(),"login"!==this.displayMode&&(this.fetchUserBookmarks(),this.setBREventListeners())}},{key:"getIdentifier",value:function(){return this.bookreader.bookId!==this.bookreader.subPrefix?"".concat(this.bookreader.bookId,"/").concat(this.bookreader.subPrefix):this.bookreader.bookId}},{key:"updateDisplay",value:function(){"bookmarks"===this.displayMode&&this.fetchUserBookmarks()}},{key:"fetchUserBookmarks",value:(o=po(co().m(function e(){return co().w(function(e){for(;;)switch(e.n){case 0:if(this.api.identifier){e.n=1;break}return e.a(2);case 1:return e.n=2,this.fetchBookmarks();case 2:this.initializeBookmarks();case 3:return e.a(2)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"setBREventListeners",value:function(){var e=this;["3PageViewSelected"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(t){setTimeout(function(){e.renderBookmarkButtons()},100)})}),["pageChanged","1PageViewSelected","2PageViewSelected"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(t){setTimeout(function(){e.renderBookmarkButtons(),e.markActiveBookmark()},100)})}),["zoomOut","zoomIn","resize"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(){e.renderBookmarkButtons()})})}},{key:"initializeBookmarks",value:function(){this.renderBookmarkButtons(),this.markActiveBookmark(!0),this.emitBookmarksChanged()}},{key:"formatBookmark",value:function(e){var n=e.leafNum,r=void 0===n?"":n,o=e.notes,i=void 0===o?{}:o,a=i.note,s=void 0===a?"":a,l=i.color,c={note:s,color:this.getBookmarkColor(l)?l:this.defaultColor.id},u=t.formatPage(this.bookreader.book.getPageNum(r)),d=this.bookreader.book.getPageURI("".concat(r).replace(/\D/g,""),32);return so(so({},c),{},{id:r,leafNum:r,page:u,thumbnail:d})}},{key:"fetchBookmarks",value:(n=po(co().m(function e(){var t,n,r,o,i,a,s,l,c,u,d=this;return co().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.api.getAll().then(function(e){return e.text()});case 1:t=e.v;try{n=JSON.parse(t)}catch(e){n={error:e.message}}return o=(r=n).success,i=r.error,a=void 0===i?"Something happened while fetching bookmarks.":i,s=r.value,l=void 0===s?[]:s,o||null===(c=console)||void 0===c||c.warn("Error fetching bookmarks",a),u={},Object.keys(l).forEach(function(e){var t=l[e],n=parseInt(e,10),r=d.formatBookmark(so(so({},t),{},{leafNum:n}));u[e]=r}),this.bookmarks=u,e.a(2,u)}},e,this)})),function(){return n.apply(this,arguments)})},{key:"emitBookmarksChanged",value:function(){this.dispatchEvent(new CustomEvent("bookmarksChanged",{bubbles:!0,composed:!0,detail:{bookmarks:this.bookmarks}}))}},{key:"emitBookmarkButtonClicked",value:function(){this.dispatchEvent(new CustomEvent("bookmarkButtonClicked",{bubbles:!0,composed:!0,detail:{editedBookmark:this.editedBookmark}}))}},{key:"bookmarkButtonClicked",value:function(e){this.getBookmark(e)?this.confirmDeletion(e):this.createBookmark(e)}},{key:"renderBookmarkButtons",value:function(){var e=this;this.bookreader.$(".BRpagecontainer").not(".BRemptypage").get().forEach(function(t){var n=t.querySelector(".bookmark-button");n&&n.remove();var o=+t.classList.value.match(/pagediv\d+/)[0].replace(/\D/g,""),i=e.getBookmark(o),a=i?"filled":"hollow";if(e.bookreader.book.getPage(o).isViewable){var s=document.createElement("div");["mousedown","mouseup"].forEach(function(e){s.addEventListener(e,function(e){return e.stopPropagation()})}),s.classList.add("bookmark-button",a),i&&s.classList.add(e.getBookmarkColor(i.color));var l="L"===t.getAttribute("data-side")&&e.bookreader.mode===e.bookreader.constMode2up?"left":"right";(0,r.XX)((0,r.qy)(Gr||(Gr=io(["\n <bookmark-button\n @bookmarkButtonClicked=","\n state=","\n side=","\n ></bookmark-button>"])),function(){return e.bookmarkButtonClicked(o)},a,l),s),t.appendChild(s)}})}},{key:"markActiveBookmark",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.bookreader,n=t.mode,r=t.constMode2up,o=t.constModeThumb,i=this.bookreader.currentIndex();if(n!==o){if(n===r&&this.bookreader.displayedIndices.includes(+this.activeBookmarkID))return;this.bookmarks[i]?this.activeBookmarkID=i:this.activeBookmarkID=""}else{var a=this.bookmarks[i];e&&a&&(this.activeBookmarkID=i)}}},{key:"bookmarkEdited",value:function(e){var t=e.detail,n=t.bookmark.id===this.editedBookmark.id;this.editedBookmark=n?{}:t.bookmark}},{key:"getBookmark",value:function(e){return this.bookmarks[e]}},{key:"getBookmarkColor",value:function(e){var t;return null===(t=this.bookmarkColors.find(function(t){return t.id===e}))||void 0===t?void 0:t.className}},{key:"addBookmark",value:function(){var e=this.bookreader.currentIndex();if(this.bookreader.mode===this.bookreader.constMode2up){var t=this.bookreader.displayedIndices;e=t[t.length-1]}this.createBookmark(e)}},{key:"createBookmark",value:function(e){var t=this.getBookmark(e);if(t)return this.bookmarkEdited({detail:{bookmark:t}}),void this.emitBookmarkButtonClicked();this.editedBookmark=this.formatBookmark({leafNum:e}),this.api.post(this.editedBookmark),this.bookmarks[e]=this.editedBookmark,this.activeBookmarkID=e,this.disableAddBookmarkButton=!0,this.renderBookmarkButtons(),this.emitBookmarkButtonClicked()}},{key:"bookmarkSelected",value:function(e){var t=e.detail.bookmark.leafNum;this.bookreader.jumpToPage("".concat(this.bookreader.book.getPageNum("".concat(t).replace(/\D/g,"")))),this.activeBookmarkID=t}},{key:"saveBookmark",value:function(e){var t=e.detail,n=this.bookmarks[t.bookmark.id];Object.assign(n,t.bookmark),this.api.put(n),this.editedBookmark={},this.renderBookmarkButtons()}},{key:"confirmDeletion",value:function(e){this.getBookmark(e).note?this.displayDeletionModal(e):this.deleteBookmark({detail:{id:"".concat(e)}})}},{key:"displayDeletionModal",value:function(e){var t=this,n=(0,r.qy)(Jr||(Jr=io(["\n <delete-modal-actions\n .deleteAction=","\n .cancelAction=","\n .pageID=","\n ></delete-modal-actions>\n "])),function(){return t.deleteBookmark({detail:{id:"".concat(e)}})},function(){return t.modal.closeModal()},e);this.modal.showModal({config:this.deleteModalConfig,customModalContent:n})}},{key:"deleteBookmark",value:function(e){var t=e.detail,n=t.id,r=this.bookmarks;delete r[n],this.bookmarks=so({},r),this.api.delete(t.id),this.editedBookmark={},this.modal.closeModal(),this.renderBookmarkButtons()}},{key:"shouldEnableAddBookmarkButton",get:function(){var e=this.bookreader.mode===this.bookreader.constMode2up?this.bookreader.displayedIndices[this.bookreader.displayedIndices.length-1]:this.bookreader.currentIndex();return!!this.getBookmark(e)}},{key:"allowAddingBookmark",get:function(){return this.bookreader.mode!==this.bookreader.constModeThumb}},{key:"addBookmarkButton",get:function(){return(0,r.qy)(Xr||(Xr=io(['\n <button\n class="ia-button primary"\n ?disabled=',"\n @click=",">\n Add bookmark\n </button>\n "])),this.shouldEnableAddBookmarkButton,this.addBookmark)}},{key:"bookmarksList",get:function(){return(0,r.qy)(Kr||(Kr=io(["\n <ia-bookmarks-list\n @bookmarkEdited=","\n @bookmarkSelected=","\n @saveBookmark=","\n @deleteBookmark=","\n .editedBookmark=","\n .bookmarks=","\n .activeBookmarkID=","\n .bookmarkColors=","\n .defaultBookmarkColor=",">\n </ia-bookmarks-list>\n "])),this.bookmarkEdited,this.bookmarkSelected,this.saveBookmark,this.deleteBookmark,this.editedBookmark,so({},this.bookmarks),this.activeBookmarkID,this.bookmarkColors,this.defaultColor)}},{key:"bookmarkHelperMessage",get:function(){return(0,r.qy)(Qr||(Qr=io(["<p>Please use 1up or 2up view modes to add bookmark.</p>"])))}},{key:"render",value:function(){var e=this,t=(0,r.qy)(Yr||(Yr=io(["\n ","\n ","\n "])),this.bookmarksList,this.allowAddingBookmark?this.addBookmarkButton:this.bookmarkHelperMessage);return(0,r.qy)(eo||(eo=io(['\n <section class="bookmarks">\n ',"\n </section>\n "])),"login"===this.displayMode?(0,r.qy)(to||(to=io(["<bookmarks-login\n @click=","\n .url=","></bookmarks-login>"])),function(){return e.loginOptions.loginClicked()},this.loginOptions.loginUrl):t)}}],[{key:"properties",get:function(){return{activeBookmarkID:{type:String},bookmarks:{type:Array},bookreader:{type:Object},displayMode:{type:String},editedBookmark:{type:Object},deleteModalConfig:{type:Object},modal:{attribute:!1},loginOptions:{type:Object,attribute:!1}}}},{key:"styles",get:function(){var e=(0,r.AH)(no||(no=io(["\n .bookmarks {\n height: 100%;\n overflow: hidden;\n padding-bottom: 20px;\n }\n\n .list ia-bookmark-edit {\n display: none;\n }\n\n .edit ia-bookmarks-list {\n display: none;\n }\n "])));return[qt,e]}},{key:"formatPage",value:function(e){return isNaN(+e)?"(".concat(e.replace(/\D/g,""),")"):e}}]);var n,o}(r.WF);customElements.define("ia-bookmarks",wo);var Co,xo,So,Oo,Mo,Bo=(0,r.AH)(go||(go=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .blue {\n --iconFillColor: var(--blueBookmarkColor, #0023f5);\n }\n\n .red {\n --iconFillColor: var(--redBookmarkColor, #eb3223);\n }\n\n .green {\n --iconFillColor: var(--greenBookmarkColor, #75ef4c);\n }\n"])));function jo(e){return jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jo(e)}function Po(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Eo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Lo(r.key),r)}}function Lo(e){var t=function(e){if("object"!=jo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jo(t)?t:t+""}function Ao(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ao=function(){return!!e})()}function _o(e){return _o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_o(e)}function To(e,t){return To=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},To(e,t)}var zo=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=_o(t),function(e,t){if(t&&("object"==jo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ao()?Reflect.construct(t,n||[],_o(e).constructor):t.apply(e,n))}(this,t)).bookmark={},e.bookmarkColors=[],e.renderHeader=!1,e.showBookmark=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&To(e,t)}(t,e),function(e,t,n){return t&&Eo(e.prototype,t),n&&Eo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"emitSaveEvent",value:function(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("saveBookmark",{detail:{bookmark:this.bookmark}}))}},{key:"emitDeleteEvent",value:function(){this.dispatchEvent(new CustomEvent("deleteBookmark",{detail:{id:this.bookmark.id}}))}},{key:"emitColorChangedEvent",value:function(e){this.dispatchEvent(new CustomEvent("bookmarkColorChanged",{detail:{bookmarkId:this.bookmark.id,colorId:e}}))}},{key:"changeColorTo",value:function(e){this.bookmark.color=e,this.emitColorChangedEvent(e)}},{key:"updateNote",value:function(e){this.bookmark.note=e.currentTarget.value}},{key:"bookmarkColor",value:function(e){var t=this;return(0,r.qy)(Co||(Co=Po(['\n <div class="color-option">\n <input type="radio" name="color" id="color_','" .value='," @change="," ?checked=",'>\n <label for="color_','" title=',">\n <icon-bookmark class=",' aria-hidden="true"></icon-bookmark>\n </label>\n </div>\n '])),e.id,e.id,function(){return t.changeColorTo(e.id)},this.bookmark.color===e.id,e.id,e.className,e.className)}},{key:"bookmarkTemplate",get:function(){return(0,r.qy)(xo||(xo=Po(['\n <div class="bookmark">\n <img src='," />\n <h4>Page ","</h4>\n </div>\n "])),this.bookmark.thumbnail,this.bookmark.page)}},{key:"render",value:function(){return(0,r.qy)(So||(So=Po(["\n ","\n ",'\n <form action="" method="put" @submit=','>\n <label for="note">Note <small>(optional)</small></label>\n <textarea rows="4" cols="80" name="note" id="note" @change=',">",'</textarea>\n <fieldset>\n <legend>Bookmark color</legend>\n <div class="color-options">\n ','\n </div>\n </fieldset>\n <div class="actions">\n <button type="button" class="ia-button cancel" @click=','>Delete</button>\n <input class="ia-button" type="submit" value="Save">\n </div>\n </form>\n '])),this.renderHeader?t.headerSection:r.s6,this.showBookmark?this.bookmarkTemplate:r.s6,this.emitSaveEvent,this.updateNote,this.bookmark.note,He(this.bookmarkColors,function(e){return e.id},this.bookmarkColor.bind(this)),this.emitDeleteEvent)}}],[{key:"properties",get:function(){return{bookmark:{type:Object},bookmarkColors:{type:Array},renderHeader:{type:Boolean},showBookmark:{type:Boolean}}}},{key:"headerSection",get:function(){return(0,r.qy)(Oo||(Oo=Po(["<header>\n <h3>Edit Bookmark</h3>\n </header>"])))}},{key:"styles",get:function(){var e=(0,r.AH)(Mo||(Mo=Po(['\n :host {\n display: block;\n padding: 0 1rem 2rem 1rem;\n color: var(--primaryTextColor);\n }\n\n small {\n font-style: italic;\n }\n\n .bookmark {\n display: grid;\n grid-template-columns: 37px 1fr;\n grid-gap: 0 1rem;\n align-items: center;\n }\n\n h4 {\n margin: 0;\n font-size: 1.4rem;\n }\n\n fieldset {\n padding: 0;\n border: none;\n }\n\n label, legend {\n display: block;\n font-weight: bold;\n }\n\n p {\n padding: 0;\n margin: .5rem 0;\n font-size: 1.2rem;\n line-height: 120%;\n }\n\n textarea {\n width: 100%;\n margin-bottom: 2rem;\n box-sizing: border-box;\n font: normal 1.4rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n resize: vertical;\n }\n\n .color-options {\n display: flex;\n gap: 10px;\n }\n\n .color-option {\n position: relative;\n }\n\n .color-option input {\n position: absolute;\n opacity: 0;\n width: 0;\n height: 0;\n pointer-events: none;\n }\n\n .color-option label {\n display: block;\n min-width: 50px;\n padding-top: .4rem;\n text-align: center;\n border: 1px solid transparent;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .color-option input:checked + label {\n border-color: var(--primaryTextColor);\n }\n\n .color-option input:focus + label {\n outline: 2px solid currentColor;\n outline-offset: 2px;\n }\n\n .color-option input:focus:not(:focus-visible) + label {\n outline: none;\n }\n\n input[type="submit"] {\n background: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n button {\n background: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .button {\n -webkit-appearance: none;\n appearance: none;\n padding: .5rem 1rem;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .actions {\n margin-top: 20px;\n display: grid;\n grid-template-columns: auto auto;\n grid-gap: 0 1rem;\n justify-items: stretch;\n }\n '])));return[qt,Bo,e]}}])}(r.WF);customElements.define("ia-bookmark-edit",zo),n(6910);var Io,$o,Ho,qo,Do,Ro,Fo,Wo,Vo=r.qy`
1817
+ <svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg">
1818
+ <path
1819
+ class="fill-color"
1820
+ d="m15.6111048 9.3708338-9.52237183 9.5222966-5.14363353 1.0897111c-.42296707.0896082-.83849202-.1806298-.92810097-.6035935-.02266463-.1069795-.02266463-.2175207 0-.3245001l1.08971974-5.1435929 9.52237189-9.52229656zm-10.89310224 5.9110366-2.78094924-.5403869-.67567462 3.166657.83033407.8303275 3.16668096-.6756703zm14.82724244-12.05935921c.6114418.61143705.6055516 1.6086709-.0131615 2.22737904l-2.2405581 2.24054036-4.9820147-4.98197536 2.2405581-2.24054036c.618713-.61870814 1.6159506-.62460252 2.2273925-.01316547z"
1821
+ fill-rule="evenodd" />
1822
+ </svg>
1823
+ `;class No extends r.WF{static get styles(){return r.AH`
1824
+ :host {
1825
+ width: var(--iconWidth, 'auto');
1826
+ height: var(--iconHeight, 'auto');
1827
+ }
1828
+
1829
+ .fill-color {
1830
+ fill: var(--iconFillColor);
1831
+ }
1832
+
1833
+ .stroke-color {
1834
+ stroke: var(--iconStrokeColor);
1835
+ }
1836
+ `}render(){return Vo}}function Zo(e){return Zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zo(e)}function Uo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Go(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Jo(r.key),r)}}function Jo(e){var t=function(e){if("object"!=Zo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Zo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zo(t)?t:t+""}function Xo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Xo=function(){return!!e})()}function Ko(e){return Ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ko(e)}function Qo(e,t){return Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qo(e,t)}customElements.define("ia-icon-edit-pencil",No);var Yo,ei=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Ko(t),function(e,t){if(t&&("object"==Zo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Xo()?Reflect.construct(t,n||[],Ko(e).constructor):t.apply(e,n))}(this,t)).activeBookmarkID=void 0,e.bookmarkColors=[],e.defaultBookmarkColor={},e.bookmarks={},e.editedBookmark={},e.renderHeader=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qo(e,t)}(t,e),function(e,t,n){return t&&Go(e.prototype,t),n&&Go(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"emitEditEvent",value:function(e,t){this.dispatchEvent(new CustomEvent("bookmarkEdited",{detail:{bookmark:t}}))}},{key:"emitSelectedEvent",value:function(e){this.activeBookmarkID=e.id,this.dispatchEvent(new CustomEvent("bookmarkSelected",{detail:{bookmark:e}}))}},{key:"emitSaveBookmark",value:function(e){this.dispatchEvent(new CustomEvent("saveBookmark",{detail:{bookmark:e}}))}},{key:"emitDeleteBookmark",value:function(e){this.dispatchEvent(new CustomEvent("deleteBookmark",{detail:{id:e}}))}},{key:"emitBookmarkColorChanged",value:function(e){var t=e.detail,n=t.bookmarkId,r=t.colorId;this.dispatchEvent(new CustomEvent("bookmarkColorChanged",{detail:{bookmarkId:n,colorId:r}}))}},{key:"emitAddBookmark",value:function(){this.dispatchEvent(new CustomEvent("addBookmark"))}},{key:"editBookmark",value:function(e,t){this.emitEditEvent(e,t),this.editedBookmark=this.editedBookmark===t?{}:t}},{key:"saveBookmark",value:function(e){var t=e.detail.bookmark;this.editedBookmark={},this.emitSaveBookmark(t)}},{key:"deleteBookmark",value:function(e){var t=e.detail.id;this.editedBookmark={},this.emitDeleteBookmark(t)}},{key:"bookmarkColorInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.bookmarkColors.find(function(t){return(null==t?void 0:t.id)===e})}},{key:"bookmarkItem",value:function(e){var t=this,n=this.editedBookmark.id===e.id,o=this.bookmarkColorInfo(e.color).className,i=e.id===this.activeBookmarkID?"active":"";return(0,r.qy)(Io||(Io=Uo(["\n <li data-pageIndex=",'>\n <div class="separator"></div>\n <div class="bookmark-card ','">\n <div class="bookmark-header" @click=',">\n <button>\n <icon-bookmark class=",' aria-label="',' bookmark"></icon-bookmark>\n <span> Page ','</span>\n </button>\n <button\n class="edit"\n @click=','\n title="Edit this bookmark"\n aria-expanded=','\n >\n <ia-icon-edit-pencil aria-hidden="true"></ia-icon-edit-pencil>\n </button>\n </div>\n ',"\n ","\n </div>\n </li>\n "])),e.id,i,function(){return t.emitSelectedEvent(e)},o,o,e.page,function(n){return t.editBookmark(n,e)},n?"true":"false",!n&&e.note?(0,r.qy)($o||($o=Uo(["<p>","</p>"])),e.note):r.s6,n?this.editBookmarkComponent:r.s6)}},{key:"editBookmarkComponent",get:function(){return(0,r.qy)(Ho||(Ho=Uo(["\n <ia-bookmark-edit\n .bookmark=","\n .bookmarkColors=","\n .defaultBookmarkColor=","\n .showBookmark=","\n @saveBookmark=","\n @deleteBookmark=","\n @bookmarkColorChanged=","\n ></ia-bookmark-edit>\n "])),this.editedBookmark,this.bookmarkColors,this.defaultBookmarkColor,!1,this.saveBookmark,this.deleteBookmark,this.emitBookmarkColorChanged)}},{key:"sortBookmarks",value:function(){var e=this;return Object.keys(this.bookmarks).sort(function(e,t){return+e>+t?1:+e<+t?-1:0}).map(function(t){return e.bookmarks[t]})}},{key:"bookmarksCount",get:function(){var e=this.bookmarks.length;return(0,r.qy)(qo||(qo=Uo(["<small>(",")</small>"])),e)}},{key:"headerSection",get:function(){return(0,r.qy)(Do||(Do=Uo(["<header>\n <h3>\n Bookmarks\n ","\n </h3>\n </header>"])),this.bookmarks.length?this.bookmarksCount:r.s6)}},{key:"bookmarkslist",get:function(){var e=this.sortBookmarks(),t=He(e,function(e){return null==e?void 0:e.id},this.bookmarkItem.bind(this));return(0,r.qy)(Ro||(Ro=Uo(["\n <ul>\n ",'\n <div class="separator"></div>\n </ul>\n '])),t)}},{key:"render",value:function(){return(0,r.qy)(Fo||(Fo=Uo(["\n ","\n ","\n "])),this.renderHeader?this.headerSection:r.s6,Object.keys(this.bookmarks).length?this.bookmarkslist:r.s6)}}],[{key:"properties",get:function(){return{activeBookmarkID:{type:Number},bookmarkColors:{type:Array},defaultBookmarkColor:{type:Object},bookmarks:{type:Object},editedBookmark:{type:Object},renderHeader:{type:Boolean}}}},{key:"styles",get:function(){return[(0,r.AH)(Wo||(Wo=Uo(["\n :host {\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n margin-bottom: 2rem;\n --activeBorderWidth: 2px;\n }\n\n icon-bookmark {\n width: 16px;\n height: 24px;\n }\n\n .separator {\n background-color: var(--secondaryBGColor);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n small {\n font-style: italic;\n }\n\n .bookmark-header {\n display: flex;\n align-items: center;\n margin: 0;\n font-size: 1.4rem;\n font-weight: bold;\n }\n\n .bookmark-header > button:first-child {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px;\n }\n\n ia-icon-edit-pencil {\n pointer-events: none;\n }\n\n p {\n padding: 0;\n margin: 5px 0 0 0;\n width: 98%;\n overflow-wrap: break-word;\n }\n\n ia-bookmark-edit {\n margin: 5px 5px 3px 6px;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--activeBorderWidth) 0.5rem 1rem 0;\n }\n ul > li:first-child .separator {\n display: none;\n }\n li {\n position: relative;\n }\n\n li .bookmark-card {\n border: var(--activeBorderWidth) solid transparent;\n border-radius: 4px;\n }\n\n li .bookmark-card.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n\n .bookmark-header button {\n background: transparent;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n box-sizing: border-box;\n border: none;\n padding: 0;\n text-align: left;\n }\n\n li button.edit {\n height: 34px;\n width: 34px;\n flex-shrink: 0;\n text-align: center;\n }\n "]))),Bo]}}])}(r.WF);customElements.define("ia-bookmarks-list",ei);class ti extends r.WF{static get styles(){return r.AH`
1837
+ :host {
1838
+ width: var(--iconWidth, 'auto');
1839
+ height: var(--iconHeight, 'auto');
1840
+ }
1841
+
1842
+ #hollow,
1843
+ #plus,
1844
+ #minus {
1845
+ display: none;
1846
+ }
1847
+
1848
+ .hollow #filled,
1849
+ .plus #filled,
1850
+ .minus #filled {
1851
+ display: none;
1852
+ }
1853
+
1854
+ .hollow #hollow,
1855
+ .plus #hollow,
1856
+ .minus #hollow {
1857
+ display: block;
1858
+ }
1859
+
1860
+ .plus #plus {
1861
+ display: block;
1862
+ }
1863
+
1864
+ .minus #minus {
1865
+ display: block;
1866
+ }
1867
+
1868
+ .fill-color {
1869
+ fill: var(--iconFillColor);
1870
+ }
1871
+
1872
+ .stroke-color {
1873
+ stroke: var(--iconStrokeColor);
1874
+ }
1875
+ `}static get properties(){return{state:{type:String}}}render(){return r.qy`
1876
+ <div class=${this.state}>
1877
+ <svg
1878
+ height="24"
1879
+ viewBox="0 0 16 24"
1880
+ width="16"
1881
+ xmlns="http://www.w3.org/2000/svg"
1882
+ >
1883
+ <path
1884
+ id="filled"
1885
+ d="m1 0h14c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1z"
1886
+ class="fill-color"
1887
+ fill-rule="evenodd"
1888
+ />
1889
+ <g class="fill-color" fill-rule="evenodd">
1890
+ <path
1891
+ id="hollow"
1892
+ d="m15 0c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1zm-2 2h-10c-.51283584 0-.93550716.38604019-.99327227.88337887l-.00672773.11662113v18l6-4.3181818 6 4.3181818v-18c0-.51283584-.3860402-.93550716-.8833789-.99327227z"
1893
+ />
1894
+ <path
1895
+ id="plus"
1896
+ d="m8.75 6v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25v-2.25z"
1897
+ fill-rule="nonzero"
1898
+ />
1899
+ <path id="minus" d="m11 8.25v1.5h-6v-1.5z" fill-rule="nonzero" />
1900
+ </g>
1901
+ </svg>
1902
+ </div>
1903
+ `}}function ni(e){return ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ni(e)}function ri(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oi(r.key),r)}}function oi(e){var t=function(e){if("object"!=ni(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ni(t)?t:t+""}window.customElements.define("icon-bookmark",ti);var ii,ai,si=function(){return function(e,t){return t&&ri(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.baseHost,o=t.signedIn,i=t.bookreader,a=t.modal,s=t.onProviderChange,l="referer=".concat(encodeURIComponent(location.href)),c="https://".concat(n,"/account/login?").concat(l);this.component=document.createElement("ia-bookmarks"),this.component.bookreader=i,this.component.displayMode=o?"bookmarks":"login",this.component.modal=a,this.component.loginOptions={loginClicked:this.bookmarksLoginClicked,loginUrl:c},this.bindEvents(),this.icon=(0,r.qy)(Yo||(Yo=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['<icon-bookmark aria-hidden="true" role="presentation" state="hollow" style="--iconWidth: 16px; --iconHeight: 24px;"></icon-bookmark>']))),this.label="Bookmarks",this.id="bookmarks",this.onProviderChange=s,this.component.setup(),this.updateMenu(this.component.bookmarks.length)},[{key:"updateMenu",value:function(e){this.menuDetails="(".concat(e,")")}},{key:"bindEvents",value:function(){this.component.addEventListener("bookmarksChanged",this.bookmarksChanged.bind(this))}},{key:"bookmarksChanged",value:function(e){var t=e.detail,n=Object.keys(t.bookmarks).length;this.updateMenu(n),this.onProviderChange(t.bookmarks,t.showSidePanel)}},{key:"bookmarksLoginClicked",value:function(){var e;null===(e=window.archive_analytics)||void 0===e||e.send_event_no_sampling("BookReader","BookmarksLogin",window.location.path)}}])}();function li(e){return li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},li(e)}function ci(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ui(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hi(r.key),r)}}function di(e,t,n){return t&&ui(e.prototype,t),n&&ui(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hi(e){var t=function(e){if("object"!=li(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=li(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==li(t)?t:t+""}var pi,fi=di(function e(t){var n=t.item,o=t.baseHost,i=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a=null==n?void 0:n.metadata,s=a.identifier,l=a.creator,c=a.title,u=Array.isArray(l)?l[0]:l,d=i.subPrefix||"";this.icon=(0,r.qy)(ii||(ii=ci(["",""])),ke),this.label="Share this book",this.id="share",this.component=(0,r.qy)(ai||(ai=ci(["<iaux-in-share-panel\n .identifier=","\n .type=","\n .creator=","\n .description=","\n .baseHost=","\n .fileSubPrefix=","\n ></iaux-in-share-panel>"])),s,"book",u,c,o,d)});function mi(e){return mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mi(e)}function vi(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return bi(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,s=0,l=e,h.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],p=h.p,f=i[2];n>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==a)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(bi(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,bi(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,bi(d,"constructor",c),bi(c,"constructor",l),l.displayName="GeneratorFunction",bi(c,o,"GeneratorFunction"),bi(d),bi(d,o,"Generator"),bi(d,r,function(){return this}),bi(d,"toString",function(){return"[object Generator]"}),(vi=function(){return{w:i,m:h}})()}function bi(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}bi=function(e,t,n,r){function i(t,n){bi(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},bi(e,t,n,r)}function yi(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function gi(e){return function(e){if(Array.isArray(e))return ki(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ki(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ki(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ki(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ci(r.key),r)}}function Ci(e){var t=function(e){if("object"!=mi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mi(t)?t:t+""}var xi,Si,Oi,Mi,Bi,ji,Pi,Ei="default",Li=function(){return function(e,t){return t&&wi(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=this,o=t.baseHost,i=t.bookreader,a=t.onProviderChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bookreader=i,this.onProviderChange=a,this.baseHost=o;var s=i.options.multipleBooksList.by_subprefix;if(this.viewableFiles=Object.keys(s).map(function(e){return s[e]}),this.volumeCount=Object.keys(s).length,this.id="volumes",this.label="Viewable files (".concat(this.volumeCount,")"),this.icon=(0,r.qy)(pi||(pi=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["",""])),Fe),this.sortOrderBy=Ei,this.component=document.createElement("iaux-in-viewable-files-panel"),this.component.addSortToUrl=!0,this.component.subPrefix=i.options.subPrefix||"",this.component.baseHost=o,this.component.fileList=gi(this.viewableFiles),this.sortFilesComponent=document.createElement("iaux-in-sort-files-button"),this.sortFilesComponent.fileListRaw=this.viewableFiles,this.sortFilesComponent.addEventListener("fileListSorted",function(e){return n.handleFileListSorted(e)}),this.actionButton=this.sortFilesComponent,this.bookreader.urlPlugin){this.bookreader.urlPlugin.pullFromAddressBar();var l=this.bookreader.urlPlugin.getUrlParam("sort");"title_asc"!==l&&"title_desc"!==l||(this.sortOrderBy=l)}this.sortFilesComponent.sortVolumes(this.sortOrderBy),this.onProviderChange(this.bookreader)},[{key:"handleFileListSorted",value:(e=vi().m(function e(t){var n,r,o;return vi().w(function(e){for(;;)switch(e.n){case 0:return n=t.detail,r=n.sortType,o=n.sortedFiles,this.viewableFiles=o,this.sortOrderBy=r,this.component.fileList=gi(this.viewableFiles),e.n=1,this.component.updateComplete;case 1:this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),this.sortOrderBy!==Ei?this.bookreader.urlPlugin.setUrlParam("sort",this.sortOrderBy):this.bookreader.urlPlugin.removeUrlParam("sort")),this.onProviderChange(this.bookreader),this.multipleFilesClicked(this.sortOrderBy);case 2:return e.a(2)}},e,this)}),t=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){yi(i,r,o,a,s,"next",e)}function s(e){yi(i,r,o,a,s,"throw",e)}a(void 0)})},function(e){return t.apply(this,arguments)})},{key:"multipleFilesClicked",value:function(e){var t;null===(t=window.archive_analytics)||void 0===t||t.send_event("BookReader","VolumesSort|".concat(e),window.location.path)}}]);var e,t}(),Ai=n(8004);function _i(e){return _i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_i(e)}function Ti(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return zi(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ii(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ii(Object(n),!0).forEach(function(t){Hi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Hi(e,t,n){return(t=Ri(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Di(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ri(r.key),r)}}function Ri(e){var t=function(e){if("object"!=_i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_i(t)?t:t+""}function Fi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Fi=function(){return!!e})()}function Wi(){return Wi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Vi(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Wi.apply(null,arguments)}function Vi(e){return Vi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vi(e)}function Ni(e,t){return Ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ni(e,t)}var Zi=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Vi(t),function(e,t){if(t&&("object"==_i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fi()?Reflect.construct(t,n||[],Vi(e).constructor):t.apply(e,n))}(this,t)).item=void 0,e.bookreader=void 0,e.baseHost="archive.org",e.fullscreen=!1,e.signedIn=!1,e.modal=void 0,e.sharedObserver=void 0,e.loaded=!1,e.menuShortcuts=[],e.menuContents=[],e.openMenuName="",e.bookReaderCannotLoad=!1,e.bookReaderLoaded=!1,e.bookIsRestricted=!1,e.downloadableTypes=[],e.isAdmin=!1,e.lendingInitialized=!1,e.lendingStatus={},e.menuProviders={bookmarks:null,search:null,downloads:null,visualAdjustments:null,share:null,volumes:null},e.signedIn=!1,e.fullscreenBranding=(0,r.qy)(xi||(xi=qi(['<ia-icon-ia-logo aria-hidden="true"></ia-icon-ia-logo>']))),e._sharedObserverHandler={handleResize:e.handleResize.bind(e)},e._brWidth=0,e._brHeight=0,e.shortcutOrder=["fullscreen","volumes","chapters","search","translate","bookmarks","downloads","visualAdjustments","share","experiments"],e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ni(e,t)}(t,e),function(e,t,n){return t&&Di(e.prototype,t),n&&Di(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"itemNav",get:function(){return this.shadowRoot.querySelector("iaux-item-navigator")}},{key:"disconnectedCallback",value:function(){!function(e,t,n){var r=Wi(Vi(e.prototype),"disconnectedCallback",n);return"function"==typeof r?function(e){return r.apply(n,e)}:r}(t,0,this)([]),this.unloadSharedObserver()}},{key:"firstUpdated",value:function(){this.modal||this.setModalManager(),this.sharedObserver||(this.sharedObserver=new st),this._bindEventListeners(),this.loaded=!0}},{key:"updated",value:function(e){this.bookreader&&this.item&&this.bookReaderLoaded&&((e.has("loaded")&&this.loaded||e.has("item")||e.has("bookreader")||e.has("signedIn")||e.has("isAdmin")||e.has("modal"))&&this.initializeBookSubmenus(),e.has("sharedObserver")&&this.bookreader&&(this.loadSharedObserver(),this.initializeBookSubmenus()),e.has("downloadableTypes")&&this.initializeBookSubmenus())}},{key:"loadSharedObserver",value:function(){var e;this.unloadSharedObserver(),null===(e=this.sharedObserver)||void 0===e||e.addObserver({target:this.mainBRContainer,handler:this._sharedObserverHandler})}},{key:"unloadSharedObserver",value:function(){var e;null===(e=this.sharedObserver)||void 0===e||e.removeObserver({target:this.mainBRContainer,handler:this._sharedObserverHandler})}},{key:"handleResize",value:function(e){var t=e.contentRect,n=e.target,r=this._brWidth,o=this._brHeight,i=this.bookreader.animating;n===this.mainBRContainer&&(this._brWidth=t.width,this._brHeight=t.height),!r&&this._brWidth&&this.initializeBookSubmenus();var a,s=r!==this._brWidth,l=o!==this._brHeight;i||!s&&!l||null===(a=this.bookreader)||void 0===a||a.resize()}},{key:"manageFullScreenBehavior",value:function(){this.bookreader.options.enableFSLogoShortcut&&(this.fullscreen=this.bookreader.isFullscreen(),this.dispatchEvent(new CustomEvent("fullscreenStateUpdated",{detail:{fullscreen:this.fullscreen}})),this.fullscreen?this.addFullscreenShortcut():this.deleteFullscreenShortcut())}},{key:"setModalManager",value:function(){var e=document.querySelector("modal-manager");e||(e=document.createElement("modal-manager"),document.body.appendChild(e)),this.modal=e}},{key:"initializeBookSubmenus",value:function(){var e,t=this,n={visualAdjustments:new Cr($i($i({},this.baseProviderConfig),{},{onProviderChange:function(){t.updateMenuContents()}}))};this.baseProviderConfig.item&&(n.share=new fi(this.baseProviderConfig)),this.shouldShowDownloadsMenu()&&(n.downloads=new Dn(this.baseProviderConfig)),null!==(e=this.bookreader.options.plugins)&&void 0!==e&&null!==(e=e.search)&&void 0!==e&&e.enabled&&(n.search=new kn($i($i({},this.baseProviderConfig),{},{onProviderChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&(t.bookreader=e),t.updateMenuContents(),!1!==n.openMenu&&(!t.isWideEnoughToOpenMenu||null!=n&&n.searchCanceled||setTimeout(function(){t.updateSideMenu("search","open")},0))}}))),this.bookreader.options.enableBookmarks&&(n.bookmarks=new si($i($i({},this.baseProviderConfig),{},{onProviderChange:function(e){var n=Object.keys(e).length?"add":"remove";t["".concat(n,"MenuShortcut")]("bookmarks"),t.updateMenuContents()}}))),this.bookreader.options.enableMultipleBooks&&(n.volumes=new Li($i($i({},this.baseProviderConfig),{},{onProviderChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&(t.bookreader=e),t.updateMenuContents(),t.isWideEnoughToOpenMenu&&setTimeout(function(){t.updateSideMenu("volumes","open")})}}))),Object.assign(this.menuProviders,n),this.addMenuShortcut("search"),this.addMenuShortcut("volumes"),this.updateMenuContents()}},{key:"mainBRContainer",get:function(){var e;return document.querySelector(null===(e=this.bookreader)||void 0===e?void 0:e.el)}},{key:"baseProviderConfig",get:function(){return{baseHost:this.baseHost,modal:this.modal,sharedObserver:this.sharedObserver,bookreader:this.bookreader,item:this.item,signedIn:this.signedIn,isAdmin:this.isAdmin,onProviderChange:function(){}}}},{key:"isWideEnoughToOpenMenu",get:function(){return this._brWidth>=640}},{key:"updateSideMenu",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open";if(t)if(this.openMenuName=t,"open"===n)null===(e=this.itemNav)||void 0===e||e.openShortcut(t);else if("toggle"===n){var r;null===(r=this.itemNav)||void 0===r||r.toggleMenu()}}},{key:"addFullscreenShortcut",value:function(){this.menuShortcuts.push({icon:this.fullscreenShortcut,id:"fullscreen"}),this._sortMenuShortcuts()}},{key:"deleteFullscreenShortcut",value:function(){this.menuShortcuts=this.menuShortcuts.filter(function(e){return"fullscreen"!==e.id}),this._sortMenuShortcuts()}},{key:"fullscreenShortcut",get:function(){var e=this;return(0,r.qy)(Si||(Si=qi(["\n <button\n @click=",'\n title="Exit fullscreen view"\n >',"</button>\n "])),function(){return e.bookreader.exitFullScreen()},this.fullscreenBranding)}},{key:"updateMenuContents",value:function(){var e,t=this,n=(0,Ai.sortBy)(Object.entries(this.menuProviders).filter(function(e){var t=Ti(e,2);return t[0],!!t[1]}).filter(function(e){var n=Ti(e,2),r=n[0];return n[1],"downloads"!==r||t.shouldShowDownloadsMenu()}),function(e){var n=Ti(e,2),r=n[0],o=(n[1],t.shortcutOrder.indexOf(r));return-1===o?t.shortcutOrder.length:o}).map(function(e){var t=Ti(e,2);return t[0],t[1]});this.shouldShowDownloadsMenu()&&(null===(e=this.menuProviders.downloads)||void 0===e||e.update(this.downloadableTypes)),this.menuContents=n}},{key:"shouldShowDownloadsMenu",value:function(){if(!this.downloadableTypes.length)return!1;if(!1===this.bookIsRestricted)return!0;if(this.isAdmin)return!0;var e=this.lendingStatus.user_loan_record,t=void 0===e?{}:e;return!Array.isArray(t)&&t.type&&"SESSION_LOAN"!==t.type}},{key:"addMenuShortcut",value:function(e){this.menuShortcuts.find(function(t){return t.id===e})||this.menuProviders[e]&&(this.menuShortcuts.push(this.menuProviders[e]),this._sortMenuShortcuts())}},{key:"_sortMenuShortcuts",value:function(){var e=this;this.menuShortcuts=(0,Ai.sortBy)(this.menuShortcuts,function(t){var n=e.shortcutOrder.indexOf(t.id);return-1===n?e.shortcutOrder.length:n})}},{key:"_bindEventListeners",value:function(){var e=this;window.addEventListener("BookReader:PostInit",function(t){e.bookreader=t.detail.props,e.bookreader.shell=e,e.bookReaderLoaded=!0,e.bookReaderCannotLoad=!1,e.loaded=!0,e.loadSharedObserver(),setTimeout(function(){return e.bookreader.resize()},0)}),window.addEventListener("BookReader:fullscreenToggled",function(t){var n=t.detail.props;n&&(e.bookreader=n),e.manageFullScreenBehavior()},{passive:!0}),window.addEventListener("BookReader:ToggleSearchMenu",function(t){e.updateSideMenu("search","toggle")}),window.addEventListener("LendingFlow:PostInit",function(t){var n=t.detail,r=n.downloadTypesAvailable,o=n.lendingStatus,i=n.isAdmin,a=n.previewType;e.lendingInitialized=!0,e.downloadableTypes=r,e.lendingStatus=o,e.isAdmin=i,e.bookReaderCannotLoad="singlePagePreview"===a,e.loaded=!0}),window.addEventListener("BRJSIA:PostInit",function(t){var n=t.detail,r=n.isRestricted,o=n.downloadURLs;e.bookReaderLoaded=!0,e.downloadableTypes=o,e.bookIsRestricted=r}),window.addEventListener("contextmenu",function(t){return e._manageContextMenuVisibility(t)},{capture:!0})}},{key:"_manageContextMenuVisibility",value:function(e){var t,n,r=e.target;if(null===(t=window.archive_analytics)||void 0===t||t.send_event("BookReader","contextmenu-".concat(this.bookIsRestricted?"restricted":"unrestricted"),null==r||null===(n=r.classList)||void 0===n?void 0:n.value),this.bookIsRestricted&&r.classList.value.match(/BRscreen|BRpageimage/g))return e.preventDefault(),!1}},{key:"itemImage",get:function(){var e,t=null===(e=this.item)||void 0===e?void 0:e.metadata.identifier,n="https://".concat(this.baseHost,"/services/img/").concat(t);return(0,r.qy)(Oi||(Oi=qi(['<img class="cover-img" src=',' alt="cover image for ','">'])),n,t)}},{key:"placeholder",get:function(){return(0,r.qy)(Mi||(Mi=qi(['<div class="placeholder">',"</div>"])),this.itemImage)}},{key:"render",value:function(){return(0,r.qy)(Bi||(Bi=qi(["\n <iaux-item-navigator\n ?viewportInFullscreen=","\n .basehost=","\n .item=","\n .modal=","\n .loaded=","\n .sharedObserver=","\n ?signedIn=","\n .menuShortcuts=","\n .menuContents=","\n .openMenu=",'\n >\n <div slot="header">\n <slot name="header"></slot>\n </div>\n <div slot="main">\n ',"\n </div>\n </iaux-item-navigator>\n "])),this.fullscreen,this.baseHost,this.item,this.modal,this.loaded,this.sharedObserver,this.signedIn,this.menuShortcuts,this.menuContents,this.openMenuName,this.bookReaderCannotLoad?this.placeholder:(0,r.qy)(ji||(ji=qi(['<slot name="main"></slot>']))))}}],[{key:"properties",get:function(){return{item:{type:Object},baseHost:{type:String},signedIn:{type:Boolean},fullscreen:{type:Boolean,reflect:!0,attribute:!0},sharedObserver:{type:Object,attribute:!1},modal:{type:Object,attribute:!1},loaded:{type:Boolean},menuShortcuts:{type:Array},menuContents:{type:Array},bookReaderLoaded:{type:Boolean},bookreader:{type:Object},bookIsRestricted:{type:Boolean},downloadableTypes:{type:Array},isAdmin:{type:Boolean},lendingInitialized:{type:Boolean},lendingStatus:{type:Object},menuProviders:{type:Object},fullscreenBranding:{type:Object}}}},{key:"styles",get:function(){return(0,r.AH)(Pi||(Pi=qi(['\n :host {\n display: block;\n --primaryBGColor: var(--black, #000);\n --secondaryBGColor: #222;\n --tertiaryBGColor: #333;\n --primaryTextColor: var(--white, #fff);\n --primaryCTAFill: #194880;\n --primaryCTABorder: #c5d1df;\n --secondaryCTAFill: #333;\n --secondaryCTABorder: #999;\n --primaryErrorCTAFill: #e51c26;\n --primaryErrorCTABorder: #f8c6c8;\n background-color: var(--primaryBGColor);\n position: relative;\n }\n\n :host([fullscreen]),\n iaux-item-navigator[viewportinfullscreen] {\n position: fixed;\n inset: 0;\n height: 100%;\n min-height: unset;\n }\n\n div[slot="header"],\n div[slot="main"] {\n display: flex;\n width: 100%;\n }\n\n slot {\n display: block;\n flex: 1;\n }\n\n slot,\n slot > * {\n display: block;\n height: inherit;\n width: inherit;\n }\n .placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin: 5%;\n }\n .cover-img {\n max-height: 300px;\n }\n\n iaux-item-navigator {\n display: block;\n width: 100%;\n min-height: var(--br-height, inherit);\n height: var(--br-height, 100%);\n color: var(--primaryTextColor);\n --menuButtonLabelDisplay: block;\n --menuWidth: 320px;\n --menuSliderBg: var(--secondaryBGColor);\n --activeButtonBg: var(--tertiaryBGColor);\n --subpanelRightBorderColor: var(--secondaryCTABorder);\n --animationTiming: 100ms;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n --menuSliderHeaderIconHeight: 2rem;\n --menuSliderHeaderIconWidth: 2rem;\n --iconWidth: 2.4rem;\n --iconHeight: 2.4rem;\n --shareLinkColor: var(--primaryTextColor);\n --shareIconBorder: var(--primaryTextColor);\n --shareIconBg: var(--secondaryBGColor);\n --activityIndicatorLoadingDotColor: var(--primaryTextColor);\n --activityIndicatorLoadingRingColor: var(--primaryTextColor);\n }\n '])))}}])}(r.WF);window.customElements.define("ia-bookreader",Zi)}},function(e){e(e.s=2250)}]);
1904
+ //# sourceMappingURL=ia-bookreader-bundle.js.map