@internetarchive/bookreader 5.0.0-38 → 5.0.0-39

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. package/BookReader/BookReader.css +8 -0
  2. package/BookReader/BookReader.js +1 -1
  3. package/BookReader/BookReader.js.map +1 -1
  4. package/BookReader/ia-bookreader-bundle.js +99 -75
  5. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  6. package/BookReader/icons/magnify-minus.svg +1 -1
  7. package/BookReader/icons/magnify-plus.svg +1 -1
  8. package/BookReader/plugins/plugin.autoplay.js +1 -1
  9. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  10. package/BookReader/plugins/plugin.chapters.js +1 -1
  11. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  12. package/BookReader/plugins/plugin.mobile_nav.js +1 -1
  13. package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
  14. package/BookReader/plugins/plugin.resume.js +1 -1
  15. package/BookReader/plugins/plugin.resume.js.map +1 -1
  16. package/BookReader/plugins/plugin.search.js +1 -1
  17. package/BookReader/plugins/plugin.search.js.map +1 -1
  18. package/BookReader/plugins/plugin.text_selection.js +1 -1
  19. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  20. package/BookReader/plugins/plugin.tts.js +1 -1
  21. package/BookReader/plugins/plugin.tts.js.map +1 -1
  22. package/BookReader/plugins/plugin.url.js +1 -1
  23. package/BookReader/plugins/plugin.url.js.map +1 -1
  24. package/CHANGELOG.md +5 -0
  25. package/README.md +13 -0
  26. package/package.json +14 -14
  27. package/renovate.json +1 -1
  28. package/src/BookReader/Mode1UpLit.js +7 -1
  29. package/src/BookReader/Mode2Up.js +11 -0
  30. package/src/BookReader/ModeSmoothZoom.js +2 -0
  31. package/src/BookReader/PageContainer.js +10 -4
  32. package/src/BookReader/utils/ScrollClassAdder.js +31 -0
  33. package/src/assets/icons/magnify-minus.svg +3 -7
  34. package/src/assets/icons/magnify-plus.svg +3 -7
  35. package/src/css/_TextSelection.scss +13 -0
  36. package/tests/jest/BookReader/PageContainer.test.js +5 -4
  37. package/tests/jest/BookReader/utils/ScrollClassAdder.test.js +49 -0
  38. package/.husky/_/husky.sh +0 -30
  39. package/stat/BookNavigator/BookModel.js +0 -14
  40. package/stat/BookNavigator/BookNavigator.js +0 -524
  41. package/stat/BookNavigator/assets/bookmark-colors.js +0 -15
  42. package/stat/BookNavigator/assets/button-base.js +0 -61
  43. package/stat/BookNavigator/assets/ia-logo.js +0 -17
  44. package/stat/BookNavigator/assets/icon_checkmark.js +0 -6
  45. package/stat/BookNavigator/assets/icon_close.js +0 -3
  46. package/stat/BookNavigator/assets/icon_sort_asc.js +0 -5
  47. package/stat/BookNavigator/assets/icon_sort_desc.js +0 -5
  48. package/stat/BookNavigator/assets/icon_sort_neutral.js +0 -5
  49. package/stat/BookNavigator/assets/icon_volumes.js +0 -11
  50. package/stat/BookNavigator/bookmarks/bookmark-button.js +0 -64
  51. package/stat/BookNavigator/bookmarks/bookmark-edit.js +0 -215
  52. package/stat/BookNavigator/bookmarks/bookmarks-list.js +0 -285
  53. package/stat/BookNavigator/bookmarks/bookmarks-loginCTA.js +0 -28
  54. package/stat/BookNavigator/bookmarks/bookmarks-provider.js +0 -56
  55. package/stat/BookNavigator/bookmarks/ia-bookmarks.js +0 -523
  56. package/stat/BookNavigator/br-fullscreen-mgr.js +0 -82
  57. package/stat/BookNavigator/delete-modal-actions.js +0 -49
  58. package/stat/BookNavigator/downloads/downloads-provider.js +0 -72
  59. package/stat/BookNavigator/downloads/downloads.js +0 -139
  60. package/stat/BookNavigator/provider-config.js +0 -0
  61. package/stat/BookNavigator/search/a-search-result.js +0 -55
  62. package/stat/BookNavigator/search/search-provider.js +0 -180
  63. package/stat/BookNavigator/search/search-results.js +0 -360
  64. package/stat/BookNavigator/sharing.js +0 -31
  65. package/stat/BookNavigator/visual-adjustments/visual-adjustments-provider.js +0 -94
  66. package/stat/BookNavigator/visual-adjustments/visual-adjustments.js +0 -280
  67. package/stat/BookNavigator/volumes/volumes-provider.js +0 -83
  68. package/stat/BookNavigator/volumes/volumes.js +0 -178
  69. package/stat/BookReader/BookModel.js +0 -518
  70. package/stat/BookReader/DebugConsole.js +0 -54
  71. package/stat/BookReader/DragScrollable.js +0 -233
  72. package/stat/BookReader/ImageCache.js +0 -116
  73. package/stat/BookReader/Mode1Up.js +0 -102
  74. package/stat/BookReader/Mode1UpLit.js +0 -434
  75. package/stat/BookReader/Mode2Up.js +0 -1372
  76. package/stat/BookReader/ModeSmoothZoom.js +0 -177
  77. package/stat/BookReader/ModeThumb.js +0 -344
  78. package/stat/BookReader/Navbar/Navbar.js +0 -310
  79. package/stat/BookReader/PageContainer.js +0 -120
  80. package/stat/BookReader/ReduceSet.js +0 -26
  81. package/stat/BookReader/Toolbar/Toolbar.js +0 -384
  82. package/stat/BookReader/events.js +0 -20
  83. package/stat/BookReader/options.js +0 -324
  84. package/stat/BookReader/utils/HTMLDimensionsCacher.js +0 -44
  85. package/stat/BookReader/utils/classes.js +0 -36
  86. package/stat/BookReader/utils.js +0 -240
  87. package/stat/BookReader.js +0 -2550
  88. package/stat/BookReaderComponent/BookReaderComponent.js +0 -117
  89. package/stat/assets/icons/1up.svg +0 -12
  90. package/stat/assets/icons/2up.svg +0 -15
  91. package/stat/assets/icons/advance.svg +0 -26
  92. package/stat/assets/icons/chevron-right.svg +0 -1
  93. package/stat/assets/icons/close-circle-dark.svg +0 -1
  94. package/stat/assets/icons/close-circle.svg +0 -1
  95. package/stat/assets/icons/fullscreen.svg +0 -17
  96. package/stat/assets/icons/fullscreen_exit.svg +0 -17
  97. package/stat/assets/icons/hamburger.svg +0 -15
  98. package/stat/assets/icons/left-arrow.svg +0 -12
  99. package/stat/assets/icons/magnify-minus.svg +0 -16
  100. package/stat/assets/icons/magnify-plus.svg +0 -17
  101. package/stat/assets/icons/magnify.svg +0 -15
  102. package/stat/assets/icons/pause.svg +0 -23
  103. package/stat/assets/icons/play.svg +0 -22
  104. package/stat/assets/icons/playback-speed.svg +0 -34
  105. package/stat/assets/icons/read-aloud.svg +0 -22
  106. package/stat/assets/icons/review.svg +0 -22
  107. package/stat/assets/icons/thumbnails.svg +0 -17
  108. package/stat/assets/icons/voice.svg +0 -1
  109. package/stat/assets/icons/volume-full.svg +0 -22
  110. package/stat/assets/images/BRicons.png +0 -0
  111. package/stat/assets/images/BRicons.svg +0 -94
  112. package/stat/assets/images/BRicons_ia.png +0 -0
  113. package/stat/assets/images/back_pages.png +0 -0
  114. package/stat/assets/images/book_bottom_icon.png +0 -0
  115. package/stat/assets/images/book_down_icon.png +0 -0
  116. package/stat/assets/images/book_left_icon.png +0 -0
  117. package/stat/assets/images/book_leftmost_icon.png +0 -0
  118. package/stat/assets/images/book_right_icon.png +0 -0
  119. package/stat/assets/images/book_rightmost_icon.png +0 -0
  120. package/stat/assets/images/book_top_icon.png +0 -0
  121. package/stat/assets/images/book_up_icon.png +0 -0
  122. package/stat/assets/images/books_graphic.svg +0 -177
  123. package/stat/assets/images/booksplit.png +0 -0
  124. package/stat/assets/images/control_pause_icon.png +0 -0
  125. package/stat/assets/images/control_play_icon.png +0 -0
  126. package/stat/assets/images/embed_icon.png +0 -0
  127. package/stat/assets/images/icon-home-ia.png +0 -0
  128. package/stat/assets/images/icon_OL-logo-xs.png +0 -0
  129. package/stat/assets/images/icon_alert-xs.png +0 -0
  130. package/stat/assets/images/icon_book.svg +0 -12
  131. package/stat/assets/images/icon_bookmark.svg +0 -12
  132. package/stat/assets/images/icon_close-pop.png +0 -0
  133. package/stat/assets/images/icon_download.png +0 -0
  134. package/stat/assets/images/icon_gear.svg +0 -14
  135. package/stat/assets/images/icon_hamburger.svg +0 -20
  136. package/stat/assets/images/icon_home.png +0 -0
  137. package/stat/assets/images/icon_home.svg +0 -21
  138. package/stat/assets/images/icon_home_ia.png +0 -0
  139. package/stat/assets/images/icon_indicator.png +0 -0
  140. package/stat/assets/images/icon_info.svg +0 -11
  141. package/stat/assets/images/icon_one_page.svg +0 -8
  142. package/stat/assets/images/icon_pause.svg +0 -1
  143. package/stat/assets/images/icon_play.svg +0 -1
  144. package/stat/assets/images/icon_playback-rate.svg +0 -15
  145. package/stat/assets/images/icon_return.png +0 -0
  146. package/stat/assets/images/icon_search_button.svg +0 -8
  147. package/stat/assets/images/icon_share.svg +0 -9
  148. package/stat/assets/images/icon_skip-ahead.svg +0 -6
  149. package/stat/assets/images/icon_skip-back.svg +0 -13
  150. package/stat/assets/images/icon_speaker.svg +0 -18
  151. package/stat/assets/images/icon_speaker_open.svg +0 -10
  152. package/stat/assets/images/icon_thumbnails.svg +0 -12
  153. package/stat/assets/images/icon_toc.svg +0 -5
  154. package/stat/assets/images/icon_two_pages.svg +0 -9
  155. package/stat/assets/images/icon_zoomer.png +0 -0
  156. package/stat/assets/images/loading.gif +0 -0
  157. package/stat/assets/images/logo_icon.png +0 -0
  158. package/stat/assets/images/marker_chap-off.png +0 -0
  159. package/stat/assets/images/marker_chap-off.svg +0 -11
  160. package/stat/assets/images/marker_chap-off_ia.png +0 -0
  161. package/stat/assets/images/marker_chap-on.png +0 -0
  162. package/stat/assets/images/marker_chap-on.svg +0 -11
  163. package/stat/assets/images/marker_srch-on.svg +0 -11
  164. package/stat/assets/images/marker_srchchap-off.png +0 -0
  165. package/stat/assets/images/marker_srchchap-on.png +0 -0
  166. package/stat/assets/images/nav_control-dn.png +0 -0
  167. package/stat/assets/images/nav_control-dn_ia.png +0 -0
  168. package/stat/assets/images/nav_control-up.png +0 -0
  169. package/stat/assets/images/nav_control-up_ia.png +0 -0
  170. package/stat/assets/images/nav_control.png +0 -0
  171. package/stat/assets/images/one_page_mode_icon.png +0 -0
  172. package/stat/assets/images/paper-badge.png +0 -0
  173. package/stat/assets/images/print_icon.png +0 -0
  174. package/stat/assets/images/progressbar.gif +0 -0
  175. package/stat/assets/images/right_edges.png +0 -0
  176. package/stat/assets/images/slider.png +0 -0
  177. package/stat/assets/images/slider_ia.png +0 -0
  178. package/stat/assets/images/thumbnail_mode_icon.png +0 -0
  179. package/stat/assets/images/transparent.png +0 -0
  180. package/stat/assets/images/two_page_mode_icon.png +0 -0
  181. package/stat/assets/images/zoom_in_icon.png +0 -0
  182. package/stat/assets/images/zoom_out_icon.png +0 -0
  183. package/stat/css/BookReader.scss +0 -89
  184. package/stat/css/_BRBookmarks.scss +0 -29
  185. package/stat/css/_BRComponent.scss +0 -13
  186. package/stat/css/_BRfloat.scss +0 -197
  187. package/stat/css/_BRicon.scss +0 -48
  188. package/stat/css/_BRmain.scss +0 -251
  189. package/stat/css/_BRnav.scss +0 -359
  190. package/stat/css/_BRpages.scss +0 -139
  191. package/stat/css/_BRsearch.scss +0 -226
  192. package/stat/css/_BRtoolbar.scss +0 -84
  193. package/stat/css/_BRvendor.scss +0 -5
  194. package/stat/css/_MobileNav.scss +0 -194
  195. package/stat/css/_TextSelection.scss +0 -32
  196. package/stat/css/_colorbox.scss +0 -52
  197. package/stat/css/_controls.scss +0 -253
  198. package/stat/css/_icons.scss +0 -121
  199. package/stat/jquery-wrapper.js +0 -4
  200. package/stat/plugins/plugin.archive_analytics.js +0 -86
  201. package/stat/plugins/plugin.autoplay.js +0 -129
  202. package/stat/plugins/plugin.chapters.js +0 -248
  203. package/stat/plugins/plugin.iframe.js +0 -48
  204. package/stat/plugins/plugin.mobile_nav.js +0 -288
  205. package/stat/plugins/plugin.resume.js +0 -68
  206. package/stat/plugins/plugin.text_selection.js +0 -291
  207. package/stat/plugins/plugin.url.js +0 -198
  208. package/stat/plugins/plugin.vendor-fullscreen.js +0 -247
  209. package/stat/plugins/search/plugin.search.js +0 -439
  210. package/stat/plugins/search/view.js +0 -439
  211. package/stat/plugins/tts/AbstractTTSEngine.js +0 -249
  212. package/stat/plugins/tts/FestivalTTSEngine.js +0 -169
  213. package/stat/plugins/tts/PageChunk.js +0 -107
  214. package/stat/plugins/tts/PageChunkIterator.js +0 -163
  215. package/stat/plugins/tts/WebTTSEngine.js +0 -357
  216. package/stat/plugins/tts/plugin.tts.js +0 -357
  217. package/stat/plugins/tts/tooltip_dict.js +0 -15
  218. package/stat/plugins/tts/utils.js +0 -91
  219. package/stat/util/browserSniffing.js +0 -30
  220. package/stat/util/debouncer.js +0 -26
  221. package/stat/util/docCookies.js +0 -67
  222. package/stat/util/strings.js +0 -34
@@ -1 +1 @@
1
- <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg" aria-labelledby="magnify-minusTitleID magnify-minusDescID"><g fill="none" fill-rule="evenodd"><circle cx="7" cy="7" r="6" stroke="#fff" stroke-width="2"/><path d="m12 12 4.335 4.335" stroke="#fff" stroke-linecap="round" stroke-width="2"/><path d="M10 7.75v-1.5H4v1.5z" fill="#fff" fill-rule="nonzero"/></g></svg>
1
+ <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" aria-labelledby="magnify-minusTitleID magnify-minusDescID"><path d="m2.324 87.382 25.894-23.815c-4.593-6.693-6.89-14.106-6.89-22.236 0-7.136 1.757-13.719 5.27-19.748 3.514-6.03 8.286-10.8 14.316-14.313C46.944 3.757 53.527 2 60.664 2s13.72 1.757 19.75 5.27c6.03 3.513 10.802 8.284 14.316 14.313 3.513 6.03 5.27 12.612 5.27 19.748s-1.757 13.732-5.27 19.789c-3.514 6.057-8.285 10.841-14.315 14.354-6.03 3.513-12.614 5.27-19.75 5.27-8.577 0-16.323-2.572-23.237-7.717L11.12 97.257C9.85 98.42 8.355 99 6.638 99c-1.826 0-3.39-.65-4.689-1.949S0 94.189 0 92.362c0-1.936.775-3.595 2.324-4.977zm58.344-19.917c7.192 0 13.333-2.558 18.423-7.675s7.635-11.272 7.635-18.463-2.545-13.331-7.635-18.42-11.231-7.635-18.423-7.635-13.333 2.545-18.424 7.634-7.635 11.23-7.635 18.421 2.545 13.345 7.635 18.463 11.232 7.675 18.424 7.675zM45.73 46.14h31.288v-9.543H45.73z" fill="#fff" fill-rule="evenodd"/></svg>
@@ -1 +1 @@
1
- <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg" aria-labelledby="magnify-plusTitleID magnify-plusDescID"><g fill="none" fill-rule="evenodd"><circle cx="7" cy="7" r="6" stroke="#fff" stroke-width="2"/><path d="m12 12 4.335 4.335" stroke="#fff" stroke-linecap="round" stroke-width="2"/><path d="M7.75 4v2.25H10v1.5H7.75V10h-1.5V7.75H4v-1.5h2.25V4z" fill="#fff" fill-rule="nonzero"/></g></svg>
1
+ <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" aria-labelledby="magnify-plusTitleID magnify-plusDescID"><path d="m2.403 87.402 25.811-23.773c-4.535-6.573-6.803-14-6.803-22.284 0-7.124 1.743-13.695 5.229-19.714 3.486-6.018 8.258-10.795 14.315-14.33C47.013 3.768 53.61 2 60.747 2c10.843 0 20.096 3.852 27.76 11.557 7.664 7.705 11.495 16.969 11.493 27.791 0 10.88-3.83 20.158-11.493 27.833-7.662 7.675-16.915 11.512-27.76 11.512-8.632 0-16.432-2.568-23.402-7.703L11.204 97.178C9.987 98.393 8.465 99 6.638 99s-3.39-.649-4.689-1.946C.65 95.757 0 94.197 0 92.374c0-1.878.802-3.534 2.406-4.969zm58.34-19.879c7.137 0 13.265-2.567 18.382-7.703 5.118-5.136 7.677-11.293 7.677-18.472S84.243 28.04 79.125 22.96c-5.117-5.08-11.245-7.621-18.382-7.621-7.247 0-13.415 2.54-18.506 7.621s-7.635 11.21-7.635 18.39 2.559 13.335 7.677 18.47c5.117 5.137 11.272 7.704 18.464 7.704zm-13.36-21.868h10.208v10.188h7.22V45.655h10.206v-7.206H64.81V28.26h-7.22v10.188H47.385z" fill="#fff" fill-rule="evenodd"/></svg>
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[320],{2024:function(e,t,i){i(7327),i(5827);var o,a=i(3609),n=i(3609);a.extend(BookReader.defaultOptions,{enableAutoPlayPlugin:!0}),BookReader.prototype.setup=(o=BookReader.prototype.setup,function(e){o.call(this,e),this.auto=!1,this.autoTimer=null,this.flipDelay=5e3}),BookReader.prototype.init=function(e){return function(t){var i=this;e.call(this,t),this.options.enableAutoPlayPlugin&&this.bind(BookReader.eventNames.stop,(function(){return i.autoStop()}))}}(BookReader.prototype.init),BookReader.prototype.bindNavigationHandlers=function(e){return function(){var t=this;if(e.call(this),this.options.enableAutoPlayPlugin){var i=this.$(".BRicon").add(".BRmobileMenu .BRicon");i.filter(".play").click((function(){return t.autoToggle(),!1})),i.filter(".pause").click((function(){return t.autoToggle(),!1}))}}}(BookReader.prototype.bindNavigationHandlers),BookReader.prototype.autoToggle=function(e){var t=this;if(this.options.enableAutoPlayPlugin){var i=n.extend({flipSpeed:this.flipSpeed,flipDelay:this.flipDelay},e);this.flipSpeed="number"==typeof i.flipSpeed?i.flipSpeed:this.flipSpeed,this.flipDelay="number"==typeof i.flipDelay?i.flipDelay:this.flipDelay,this.trigger(BookReader.eventNames.stop);var o=!1;this.constMode2up!=this.mode&&(o=!0,this.switchMode(this.constMode2up)),this.reduce<this.twoPageGetAutofitReduce()&&this.zoom("auto"),null==this.autoTimer?("rl"==this.pageProgression&&o||this.flipFwdToIndex(),this.$(".play").hide(),this.$(".pause").show(),this.autoTimer=setInterval((function(){t.animating||(Math.max(t.twoPage.currentIndexL,t.twoPage.currentIndexR)>=t.lastDisplayableIndex()?t.flipBackToIndex(1):t.flipFwdToIndex())}),this.flipDelay)):this.autoStop()}},BookReader.prototype.autoStop=function(){this.options.enableAutoPlayPlugin&&null!=this.autoTimer&&(clearInterval(this.autoTimer),this.flipSpeed="fast",this.$(".pause").hide(),this.$(".play").show(),this.autoTimer=null)}}},function(e){e(e.s=2024)}]);
1
+ "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[320],{2024:function(e,t,i){i(7327),i(1539),i(5827);var o,a=i(3609),n=i(3609);a.extend(BookReader.defaultOptions,{enableAutoPlayPlugin:!0}),BookReader.prototype.setup=(o=BookReader.prototype.setup,function(e){o.call(this,e),this.auto=!1,this.autoTimer=null,this.flipDelay=5e3}),BookReader.prototype.init=function(e){return function(t){var i=this;e.call(this,t),this.options.enableAutoPlayPlugin&&this.bind(BookReader.eventNames.stop,(function(){return i.autoStop()}))}}(BookReader.prototype.init),BookReader.prototype.bindNavigationHandlers=function(e){return function(){var t=this;if(e.call(this),this.options.enableAutoPlayPlugin){var i=this.$(".BRicon").add(".BRmobileMenu .BRicon");i.filter(".play").click((function(){return t.autoToggle(),!1})),i.filter(".pause").click((function(){return t.autoToggle(),!1}))}}}(BookReader.prototype.bindNavigationHandlers),BookReader.prototype.autoToggle=function(e){var t=this;if(this.options.enableAutoPlayPlugin){var i=n.extend({flipSpeed:this.flipSpeed,flipDelay:this.flipDelay},e);this.flipSpeed="number"==typeof i.flipSpeed?i.flipSpeed:this.flipSpeed,this.flipDelay="number"==typeof i.flipDelay?i.flipDelay:this.flipDelay,this.trigger(BookReader.eventNames.stop);var o=!1;this.constMode2up!=this.mode&&(o=!0,this.switchMode(this.constMode2up)),this.reduce<this.twoPageGetAutofitReduce()&&this.zoom("auto"),null==this.autoTimer?("rl"==this.pageProgression&&o||this.flipFwdToIndex(),this.$(".play").hide(),this.$(".pause").show(),this.autoTimer=setInterval((function(){t.animating||(Math.max(t.twoPage.currentIndexL,t.twoPage.currentIndexR)>=t.lastDisplayableIndex()?t.flipBackToIndex(1):t.flipFwdToIndex())}),this.flipDelay)):this.autoStop()}},BookReader.prototype.autoStop=function(){this.options.enableAutoPlayPlugin&&null!=this.autoTimer&&(clearInterval(this.autoTimer),this.flipSpeed="fast",this.$(".pause").hide(),this.$(".play").show(),this.autoTimer=null)}}},function(e){e(e.s=2024)}]);
2
2
  //# sourceMappingURL=plugin.autoplay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins/plugin.autoplay.js","mappings":"mKAYuCA,E,oBAPvCC,EAAOC,OAAOC,WAAWC,eAAgB,CACvCC,sBAAsB,IAMxBF,WAAWG,UAAUC,OAAkBP,EAQpCG,WAAWG,UAAUC,MAPf,SAAUC,GACfR,EAAOS,KAAKC,KAAMF,GAElBE,KAAKC,MAAY,EACjBD,KAAKE,UAAY,KACjBF,KAAKG,UAAY,MAOrBV,WAAWG,UAAUQ,KAAQ,SAASd,GACpC,OAAO,SAAUQ,GAAS,WACxBR,EAAOS,KAAKC,KAAMF,GAEbE,KAAKF,QAAQH,sBAClBK,KAAKK,KAAKZ,WAAWa,WAAWC,MAAM,kBAAM,EAAKC,eALxB,CAO1Bf,WAAWG,UAAUQ,MAKxBX,WAAWG,UAAUa,uBAA0B,SAASnB,GACtD,OAAO,WAAW,WAGhB,GAFAA,EAAOS,KAAKC,MAEPA,KAAKF,QAAQH,qBAAlB,CAGA,IAAMe,EAASV,KAAKW,EAAE,WAAWC,IAAI,yBAErCF,EAAOG,OAAO,SAASC,OAAM,WAE3B,OADA,EAAKC,cACE,KAGTL,EAAOG,OAAO,UAAUC,OAAM,WAE5B,OADA,EAAKC,cACE,OAhBkC,CAmB5CtB,WAAWG,UAAUa,wBAQxBhB,WAAWG,UAAUmB,WAAa,SAASC,GAAW,WACpD,GAAKhB,KAAKF,QAAQH,qBAAlB,CAEA,IAAMG,EAAUa,EAAEnB,OAAO,CACvByB,UAAWjB,KAAKiB,UAChBd,UAAWH,KAAKG,WACfa,GAEHhB,KAAKiB,UAAyC,iBAAtBnB,EAAQmB,UAAyBnB,EAAQmB,UAAYjB,KAAKiB,UAClFjB,KAAKG,UAAyC,iBAAtBL,EAAQK,UAAyBL,EAAQK,UAAYH,KAAKG,UAClFH,KAAKkB,QAAQzB,WAAWa,WAAWC,MAEnC,IAAIY,GAAiB,EACjBnB,KAAKoB,cAAgBpB,KAAKqB,OAC5BF,GAAiB,EACjBnB,KAAKsB,WAAWtB,KAAKoB,eAInBpB,KAAKuB,OAASvB,KAAKwB,2BACrBxB,KAAKyB,KAAK,QAGR,MAAQzB,KAAKE,WAKV,MAAQF,KAAK0B,iBAAoBP,GAIpCnB,KAAK2B,iBAGP3B,KAAKW,EAAE,SAASiB,OAChB5B,KAAKW,EAAE,UAAUkB,OACjB7B,KAAKE,UAAY4B,aAAY,WACvB,EAAKC,YAELC,KAAKC,IAAI,EAAKC,QAAQC,cAAe,EAAKD,QAAQE,gBAAkB,EAAKC,uBAC3E,EAAKC,gBAAgB,GAErB,EAAKX,oBAEN3B,KAAKG,YAERH,KAAKQ,aAOTf,WAAWG,UAAUY,SAAW,WACzBR,KAAKF,QAAQH,sBAEd,MAAQK,KAAKE,YACfqC,cAAcvC,KAAKE,WACnBF,KAAKiB,UAAY,OACjBjB,KAAKW,EAAE,UAAUiB,OACjB5B,KAAKW,EAAE,SAASkB,OAChB7B,KAAKE,UAAY,S","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.autoplay.js"],"sourcesContent":["/*global BookReader */\n\n/**\n * Plugin which adds an autoplay feature. Useful for kiosk situations.\n */\njQuery.extend(BookReader.defaultOptions, {\n enableAutoPlayPlugin: true\n});\n\n/**\n * @override BookReader.setup\n */\nBookReader.prototype.setup = (function(super_) {\n return function (options) {\n super_.call(this, options);\n\n this.auto = false;\n this.autoTimer = null;\n this.flipDelay = 5000;\n };\n})(BookReader.prototype.setup);\n\n/**\n * @override BookReader.init\n */\nBookReader.prototype.init = (function(super_) {\n return function (options) {\n super_.call(this, options);\n\n if (!this.options.enableAutoPlayPlugin) return;\n this.bind(BookReader.eventNames.stop, () => this.autoStop());\n };\n})(BookReader.prototype.init);\n\n/**\n * @override BookReader.bindNavigationHandlers\n */\nBookReader.prototype.bindNavigationHandlers = (function(super_) {\n return function() {\n super_.call(this);\n\n if (!this.options.enableAutoPlayPlugin) return;\n\n // Note the mobile plugin attaches itself to body, so we need to select outside\n const jIcons = this.$('.BRicon').add('.BRmobileMenu .BRicon');\n\n jIcons.filter('.play').click(() => {\n this.autoToggle();\n return false;\n });\n\n jIcons.filter('.pause').click(() => {\n this.autoToggle();\n return false;\n });\n };\n})(BookReader.prototype.bindNavigationHandlers);\n\n/**\n * Starts autoplay mode\n * @param {object} overrides\n * @param {number} overrides.flipSpeed\n * @param {number} overrides.flipDelay\n */\nBookReader.prototype.autoToggle = function(overrides) {\n if (!this.options.enableAutoPlayPlugin) return;\n\n const options = $.extend({\n flipSpeed: this.flipSpeed,\n flipDelay: this.flipDelay\n }, overrides);\n\n this.flipSpeed = typeof options.flipSpeed === \"number\" ? options.flipSpeed : this.flipSpeed;\n this.flipDelay = typeof options.flipDelay === \"number\" ? options.flipDelay : this.flipDelay;\n this.trigger(BookReader.eventNames.stop);\n\n let bComingFrom1up = false;\n if (this.constMode2up != this.mode) {\n bComingFrom1up = true;\n this.switchMode(this.constMode2up);\n }\n\n // Change to autofit if book is too large\n if (this.reduce < this.twoPageGetAutofitReduce()) {\n this.zoom('auto');\n }\n\n if (null == this.autoTimer) {\n // $$$ Draw events currently cause layout problems when they occur during animation.\n // There is a specific problem when changing from 1-up immediately to autoplay in RTL so\n // we workaround for now by not triggering immediate animation in that case.\n // See https://bugs.launchpad.net/gnubook/+bug/328327\n if (('rl' == this.pageProgression) && bComingFrom1up) {\n // don't flip immediately -- wait until timer fires\n } else {\n // flip immediately\n this.flipFwdToIndex();\n }\n\n this.$('.play').hide();\n this.$('.pause').show();\n this.autoTimer = setInterval(() => {\n if (this.animating) return;\n\n if (Math.max(this.twoPage.currentIndexL, this.twoPage.currentIndexR) >= this.lastDisplayableIndex()) {\n this.flipBackToIndex(1); // $$$ really what we want?\n } else {\n this.flipFwdToIndex();\n }\n }, this.flipDelay);\n } else {\n this.autoStop();\n }\n};\n\n/**\n * Stop autoplay mode, allowing animations to finish\n */\nBookReader.prototype.autoStop = function() {\n if (!this.options.enableAutoPlayPlugin) return;\n\n if (null != this.autoTimer) {\n clearInterval(this.autoTimer);\n this.flipSpeed = 'fast';\n this.$('.pause').hide();\n this.$('.play').show();\n this.autoTimer = null;\n }\n};\n"],"names":["super_","jQuery","extend","BookReader","defaultOptions","enableAutoPlayPlugin","prototype","setup","options","call","this","auto","autoTimer","flipDelay","init","bind","eventNames","stop","autoStop","bindNavigationHandlers","jIcons","$","add","filter","click","autoToggle","overrides","flipSpeed","trigger","bComingFrom1up","constMode2up","mode","switchMode","reduce","twoPageGetAutofitReduce","zoom","pageProgression","flipFwdToIndex","hide","show","setInterval","animating","Math","max","twoPage","currentIndexL","currentIndexR","lastDisplayableIndex","flipBackToIndex","clearInterval"],"sourceRoot":""}
1
+ {"version":3,"file":"plugins/plugin.autoplay.js","mappings":"2KAYuCA,E,oBAPvCC,EAAOC,OAAOC,WAAWC,eAAgB,CACvCC,sBAAsB,IAMxBF,WAAWG,UAAUC,OAAkBP,EAQpCG,WAAWG,UAAUC,MAPf,SAAUC,GACfR,EAAOS,KAAKC,KAAMF,GAElBE,KAAKC,MAAY,EACjBD,KAAKE,UAAY,KACjBF,KAAKG,UAAY,MAOrBV,WAAWG,UAAUQ,KAAQ,SAASd,GACpC,OAAO,SAAUQ,GAAS,WACxBR,EAAOS,KAAKC,KAAMF,GAEbE,KAAKF,QAAQH,sBAClBK,KAAKK,KAAKZ,WAAWa,WAAWC,MAAM,kBAAM,EAAKC,eALxB,CAO1Bf,WAAWG,UAAUQ,MAKxBX,WAAWG,UAAUa,uBAA0B,SAASnB,GACtD,OAAO,WAAW,WAGhB,GAFAA,EAAOS,KAAKC,MAEPA,KAAKF,QAAQH,qBAAlB,CAGA,IAAMe,EAASV,KAAKW,EAAE,WAAWC,IAAI,yBAErCF,EAAOG,OAAO,SAASC,OAAM,WAE3B,OADA,EAAKC,cACE,KAGTL,EAAOG,OAAO,UAAUC,OAAM,WAE5B,OADA,EAAKC,cACE,OAhBkC,CAmB5CtB,WAAWG,UAAUa,wBAQxBhB,WAAWG,UAAUmB,WAAa,SAASC,GAAW,WACpD,GAAKhB,KAAKF,QAAQH,qBAAlB,CAEA,IAAMG,EAAUa,EAAEnB,OAAO,CACvByB,UAAWjB,KAAKiB,UAChBd,UAAWH,KAAKG,WACfa,GAEHhB,KAAKiB,UAAyC,iBAAtBnB,EAAQmB,UAAyBnB,EAAQmB,UAAYjB,KAAKiB,UAClFjB,KAAKG,UAAyC,iBAAtBL,EAAQK,UAAyBL,EAAQK,UAAYH,KAAKG,UAClFH,KAAKkB,QAAQzB,WAAWa,WAAWC,MAEnC,IAAIY,GAAiB,EACjBnB,KAAKoB,cAAgBpB,KAAKqB,OAC5BF,GAAiB,EACjBnB,KAAKsB,WAAWtB,KAAKoB,eAInBpB,KAAKuB,OAASvB,KAAKwB,2BACrBxB,KAAKyB,KAAK,QAGR,MAAQzB,KAAKE,WAKV,MAAQF,KAAK0B,iBAAoBP,GAIpCnB,KAAK2B,iBAGP3B,KAAKW,EAAE,SAASiB,OAChB5B,KAAKW,EAAE,UAAUkB,OACjB7B,KAAKE,UAAY4B,aAAY,WACvB,EAAKC,YAELC,KAAKC,IAAI,EAAKC,QAAQC,cAAe,EAAKD,QAAQE,gBAAkB,EAAKC,uBAC3E,EAAKC,gBAAgB,GAErB,EAAKX,oBAEN3B,KAAKG,YAERH,KAAKQ,aAOTf,WAAWG,UAAUY,SAAW,WACzBR,KAAKF,QAAQH,sBAEd,MAAQK,KAAKE,YACfqC,cAAcvC,KAAKE,WACnBF,KAAKiB,UAAY,OACjBjB,KAAKW,EAAE,UAAUiB,OACjB5B,KAAKW,EAAE,SAASkB,OAChB7B,KAAKE,UAAY,S","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.autoplay.js"],"sourcesContent":["/*global BookReader */\n\n/**\n * Plugin which adds an autoplay feature. Useful for kiosk situations.\n */\njQuery.extend(BookReader.defaultOptions, {\n enableAutoPlayPlugin: true\n});\n\n/**\n * @override BookReader.setup\n */\nBookReader.prototype.setup = (function(super_) {\n return function (options) {\n super_.call(this, options);\n\n this.auto = false;\n this.autoTimer = null;\n this.flipDelay = 5000;\n };\n})(BookReader.prototype.setup);\n\n/**\n * @override BookReader.init\n */\nBookReader.prototype.init = (function(super_) {\n return function (options) {\n super_.call(this, options);\n\n if (!this.options.enableAutoPlayPlugin) return;\n this.bind(BookReader.eventNames.stop, () => this.autoStop());\n };\n})(BookReader.prototype.init);\n\n/**\n * @override BookReader.bindNavigationHandlers\n */\nBookReader.prototype.bindNavigationHandlers = (function(super_) {\n return function() {\n super_.call(this);\n\n if (!this.options.enableAutoPlayPlugin) return;\n\n // Note the mobile plugin attaches itself to body, so we need to select outside\n const jIcons = this.$('.BRicon').add('.BRmobileMenu .BRicon');\n\n jIcons.filter('.play').click(() => {\n this.autoToggle();\n return false;\n });\n\n jIcons.filter('.pause').click(() => {\n this.autoToggle();\n return false;\n });\n };\n})(BookReader.prototype.bindNavigationHandlers);\n\n/**\n * Starts autoplay mode\n * @param {object} overrides\n * @param {number} overrides.flipSpeed\n * @param {number} overrides.flipDelay\n */\nBookReader.prototype.autoToggle = function(overrides) {\n if (!this.options.enableAutoPlayPlugin) return;\n\n const options = $.extend({\n flipSpeed: this.flipSpeed,\n flipDelay: this.flipDelay\n }, overrides);\n\n this.flipSpeed = typeof options.flipSpeed === \"number\" ? options.flipSpeed : this.flipSpeed;\n this.flipDelay = typeof options.flipDelay === \"number\" ? options.flipDelay : this.flipDelay;\n this.trigger(BookReader.eventNames.stop);\n\n let bComingFrom1up = false;\n if (this.constMode2up != this.mode) {\n bComingFrom1up = true;\n this.switchMode(this.constMode2up);\n }\n\n // Change to autofit if book is too large\n if (this.reduce < this.twoPageGetAutofitReduce()) {\n this.zoom('auto');\n }\n\n if (null == this.autoTimer) {\n // $$$ Draw events currently cause layout problems when they occur during animation.\n // There is a specific problem when changing from 1-up immediately to autoplay in RTL so\n // we workaround for now by not triggering immediate animation in that case.\n // See https://bugs.launchpad.net/gnubook/+bug/328327\n if (('rl' == this.pageProgression) && bComingFrom1up) {\n // don't flip immediately -- wait until timer fires\n } else {\n // flip immediately\n this.flipFwdToIndex();\n }\n\n this.$('.play').hide();\n this.$('.pause').show();\n this.autoTimer = setInterval(() => {\n if (this.animating) return;\n\n if (Math.max(this.twoPage.currentIndexL, this.twoPage.currentIndexR) >= this.lastDisplayableIndex()) {\n this.flipBackToIndex(1); // $$$ really what we want?\n } else {\n this.flipFwdToIndex();\n }\n }, this.flipDelay);\n } else {\n this.autoStop();\n }\n};\n\n/**\n * Stop autoplay mode, allowing animations to finish\n */\nBookReader.prototype.autoStop = function() {\n if (!this.options.enableAutoPlayPlugin) return;\n\n if (null != this.autoTimer) {\n clearInterval(this.autoTimer);\n this.flipSpeed = 'fast';\n this.$('.pause').hide();\n this.$('.play').show();\n this.autoTimer = null;\n }\n};\n"],"names":["super_","jQuery","extend","BookReader","defaultOptions","enableAutoPlayPlugin","prototype","setup","options","call","this","auto","autoTimer","flipDelay","init","bind","eventNames","stop","autoStop","bindNavigationHandlers","jIcons","$","add","filter","click","autoToggle","overrides","flipSpeed","trigger","bComingFrom1up","constMode2up","mode","switchMode","reduce","twoPageGetAutofitReduce","zoom","pageProgression","flipFwdToIndex","hide","show","setInterval","animating","Math","max","twoPage","currentIndexL","currentIndexR","lastDisplayableIndex","flipBackToIndex","clearInterval"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[529],{8586:function(e,t,n){n(5666),n(9600),n(7327),n(2222),n(9826),n(5069),n(4553),n(1539),n(8674);var a,o=n(3609),r=n(3609);function s(e,t,n,a,o,r,s){try{var i=e[r](s),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(a,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(a,o){var r=e.apply(t,n);function i(e){s(r,a,o,i,c,"next",e)}function c(e){s(r,a,o,i,c,"throw",e)}i(void 0)}))}}o.extend(BookReader.defaultOptions,{olHost:"https://openlibrary.org",enableChaptersPlugin:!0,bookId:""}),BookReader.prototype.setup=(a=BookReader.prototype.setup,function(e){a.call(this,e),this.olHost=e.olHost,this.enableChaptersPlugin=e.enableChaptersPlugin,this.bookId=e.bookId}),BookReader.prototype.init=function(e){return function(){var t=this;e.call(this),this.enableChaptersPlugin&&"embed"!==this.ui&&this.getOpenLibraryRecord(),this.enableMobileNav&&(this.bind(BookReader.eventNames.mobileNavOpen,(function(){t.updateTOCState(t.firstIndex,t._tocEntries),r("table-contents-list").parent().hasClass("mm-opened")&&t.updateTOCState(t.firstIndex,t._tocEntries)})),r(".BRmobileMenu__tableContents").on("click",(function(){t.updateTOCState(t.firstIndex,t._tocEntries)})))}}(BookReader.prototype.init),BookReader.prototype.addChapter=function(e,t,n){var a=this,o=BookReader.util.cssPercentage(n,this.getNumLeafs()-1),s=function(e){a.jumpToIndex(r(e.delegateTarget).data("pageIndex")),r(".current-chapter").removeClass("current-chapter"),r(e.delegateTarget).addClass("current-chapter")},i="".concat(e," | "),c="".concat("Page"," ").concat(t),l=r("<li></li>").append(r("<span class='BRTOCElementTitle'></span>").text(i)).append(r("<span class='BRTOCElementPage'></span>").text(c));l.addClass("BRtable-contents-el").appendTo(this.$(".table-contents-list")).data({pageIndex:n}),null!=n&&(r("<div></div>").append(r("<div />").text(i+c)).addClass("BRchapter").css({left:o}).appendTo(this.$(".BRnavline")).data({pageIndex:n}).on("mouseenter",(function(e){var t=e.currentTarget,n=t.querySelector("div"),o=n.getBoundingClientRect(),s=t.getBoundingClientRect(),i=2*parseInt(getComputedStyle(n).paddingLeft);o.x-i<0&&n.style.setProperty("transform","translateX(-".concat(s.left-i,"px)")),a.$(".BRsearch,.BRchapter").removeClass("front"),r(e.target).addClass("front")})).on("mouseleave",(function(e){return r(e.target).removeClass("front")})).on("click",s),l.bind("click",s).addClass("chapter-clickable").attr("data-event-click-tracking","BRTOCPanel|GoToChapter"))},BookReader.prototype.removeChapters=function(){this.$(".BRnavpos .BRchapter").remove()},BookReader.prototype.updateTOC=function(e){this.removeChapters(),this.enableMobileNav&&e.length>0&&this.$(".BRmobileMenu__tableContents").show();for(var t=0;t<e.length;t++)this.addChapterFromEntry(e[t]);this._tocEntries=e,r(".table-contents-list").children().each((function(t,n){e[t].mobileHTML=n}))},BookReader.prototype.addChapterFromEntry=function(e){e.pageIndex=this.getPageIndex(e.pagenum);var t=[e.label,e.title].filter((function(e){return e})).join(" ");this.addChapter(t,e.pagenum,e.pageIndex),this.$(".BRchapter, .BRsearch").each((function(e,t){var n=r(t);n.on("mouseenter",(function(){return n.addClass("front")})).on("mouseleave",(function(){return n.removeClass("front")}))}))},BookReader.prototype.getOpenLibraryRecord=i(regeneratorRuntime.mark((function e(){var t,n,a,o,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(this.olHost,"/query.json?type=/type/edition&*="),n="".concat(t,"&ocaid=").concat(this.bookId),a=function(e){e&&e.table_of_contents&&s.updateTOC(e.table_of_contents)},e.next=5,r.ajax({url:n,dataType:"jsonp"});case 5:if((o=e.sent)&&o.length){e.next=10;break}return e.next=9,r.ajax({url:"".concat(t,"&source_records=ia:").concat(this.bookId),dataType:"jsonp"});case 9:o=e.sent;case 10:o&&o.length>0&&a(o[0]);case 11:case"end":return e.stop()}}),e,this)}))),BookReader.prototype.buildMobileDrawerElement=function(e){return function(){var t=e.call(this);return this.enableMobileNav&&this.options.enableChaptersPlugin&&t.find(".BRmobileMenu__moreInfoRow").after(r('\n <li class="BRmobileMenu__tableContents" data-event-click-tracking="BRSidebar|TOCPanel">\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_toc.svg" alt="toc-icon"/>\n </span>\n Table of Contents\n </span>\n <div>\n <ol class="table-contents-list">\n </ol>\n </div>\n </li>')).hide()),t}}(BookReader.prototype.buildMobileDrawerElement),BookReader.prototype.updateTOCState=function(e,t){if(t){r(".current-chapter").removeClass("current-chapter");var n=t.filter((function(e){return null!=e.pageIndex})).reverse(),a=n[n.findIndex((function(t){return t.pageIndex<=e}))];null!=a&&r(a.mobileHTML).addClass("current-chapter")}}}},function(e){e(e.s=8586)}]);
1
+ "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[529],{8586:function(e,t,n){n(5666),n(1058),n(9600),n(7327),n(1539),n(2222),n(9826),n(5069),n(4553),n(8674);var a,o=n(3609),r=n(3609);function s(e,t,n,a,o,r,s){try{var i=e[r](s),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(a,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(a,o){var r=e.apply(t,n);function i(e){s(r,a,o,i,c,"next",e)}function c(e){s(r,a,o,i,c,"throw",e)}i(void 0)}))}}o.extend(BookReader.defaultOptions,{olHost:"https://openlibrary.org",enableChaptersPlugin:!0,bookId:""}),BookReader.prototype.setup=(a=BookReader.prototype.setup,function(e){a.call(this,e),this.olHost=e.olHost,this.enableChaptersPlugin=e.enableChaptersPlugin,this.bookId=e.bookId}),BookReader.prototype.init=function(e){return function(){var t=this;e.call(this),this.enableChaptersPlugin&&"embed"!==this.ui&&this.getOpenLibraryRecord(),this.enableMobileNav&&(this.bind(BookReader.eventNames.mobileNavOpen,(function(){t.updateTOCState(t.firstIndex,t._tocEntries),r("table-contents-list").parent().hasClass("mm-opened")&&t.updateTOCState(t.firstIndex,t._tocEntries)})),r(".BRmobileMenu__tableContents").on("click",(function(){t.updateTOCState(t.firstIndex,t._tocEntries)})))}}(BookReader.prototype.init),BookReader.prototype.addChapter=function(e,t,n){var a=this,o=BookReader.util.cssPercentage(n,this.getNumLeafs()-1),s=function(e){a.jumpToIndex(r(e.delegateTarget).data("pageIndex")),r(".current-chapter").removeClass("current-chapter"),r(e.delegateTarget).addClass("current-chapter")},i="".concat(e," | "),c="".concat("Page"," ").concat(t),l=r("<li></li>").append(r("<span class='BRTOCElementTitle'></span>").text(i)).append(r("<span class='BRTOCElementPage'></span>").text(c));l.addClass("BRtable-contents-el").appendTo(this.$(".table-contents-list")).data({pageIndex:n}),null!=n&&(r("<div></div>").append(r("<div />").text(i+c)).addClass("BRchapter").css({left:o}).appendTo(this.$(".BRnavline")).data({pageIndex:n}).on("mouseenter",(function(e){var t=e.currentTarget,n=t.querySelector("div"),o=n.getBoundingClientRect(),s=t.getBoundingClientRect(),i=2*parseInt(getComputedStyle(n).paddingLeft);o.x-i<0&&n.style.setProperty("transform","translateX(-".concat(s.left-i,"px)")),a.$(".BRsearch,.BRchapter").removeClass("front"),r(e.target).addClass("front")})).on("mouseleave",(function(e){return r(e.target).removeClass("front")})).on("click",s),l.bind("click",s).addClass("chapter-clickable").attr("data-event-click-tracking","BRTOCPanel|GoToChapter"))},BookReader.prototype.removeChapters=function(){this.$(".BRnavpos .BRchapter").remove()},BookReader.prototype.updateTOC=function(e){this.removeChapters(),this.enableMobileNav&&e.length>0&&this.$(".BRmobileMenu__tableContents").show();for(var t=0;t<e.length;t++)this.addChapterFromEntry(e[t]);this._tocEntries=e,r(".table-contents-list").children().each((function(t,n){e[t].mobileHTML=n}))},BookReader.prototype.addChapterFromEntry=function(e){e.pageIndex=this.getPageIndex(e.pagenum);var t=[e.label,e.title].filter((function(e){return e})).join(" ");this.addChapter(t,e.pagenum,e.pageIndex),this.$(".BRchapter, .BRsearch").each((function(e,t){var n=r(t);n.on("mouseenter",(function(){return n.addClass("front")})).on("mouseleave",(function(){return n.removeClass("front")}))}))},BookReader.prototype.getOpenLibraryRecord=i(regeneratorRuntime.mark((function e(){var t,n,a,o,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(this.olHost,"/query.json?type=/type/edition&*="),n="".concat(t,"&ocaid=").concat(this.bookId),a=function(e){e&&e.table_of_contents&&s.updateTOC(e.table_of_contents)},e.next=5,r.ajax({url:n,dataType:"jsonp"});case 5:if((o=e.sent)&&o.length){e.next=10;break}return e.next=9,r.ajax({url:"".concat(t,"&source_records=ia:").concat(this.bookId),dataType:"jsonp"});case 9:o=e.sent;case 10:o&&o.length>0&&a(o[0]);case 11:case"end":return e.stop()}}),e,this)}))),BookReader.prototype.buildMobileDrawerElement=function(e){return function(){var t=e.call(this);return this.enableMobileNav&&this.options.enableChaptersPlugin&&t.find(".BRmobileMenu__moreInfoRow").after(r('\n <li class="BRmobileMenu__tableContents" data-event-click-tracking="BRSidebar|TOCPanel">\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_toc.svg" alt="toc-icon"/>\n </span>\n Table of Contents\n </span>\n <div>\n <ol class="table-contents-list">\n </ol>\n </div>\n </li>')).hide()),t}}(BookReader.prototype.buildMobileDrawerElement),BookReader.prototype.updateTOCState=function(e,t){if(t){r(".current-chapter").removeClass("current-chapter");var n=t.filter((function(e){return null!=e.pageIndex})).reverse(),a=n[n.findIndex((function(t){return t.pageIndex<=e}))];null!=a&&r(a.mobileHTML).addClass("current-chapter")}}}},function(e){e(e.s=8586)}]);
2
2
  //# sourceMappingURL=plugin.chapters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins/plugin.chapters.js","mappings":"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","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.chapters.js"],"sourcesContent":["/* global BookReader */\n/**\n * Plugin for chapter markers in BookReader. Fetches from openlibrary.org\n * Could be forked, or extended to alter behavior\n */\n\njQuery.extend(BookReader.defaultOptions, {\n olHost: 'https://openlibrary.org',\n enableChaptersPlugin: true,\n bookId: '',\n});\n\n/** @override Extend the constructor to add search properties */\nBookReader.prototype.setup = (function (super_) {\n return function (options) {\n super_.call(this, options);\n\n this.olHost = options.olHost;\n this.enableChaptersPlugin = options.enableChaptersPlugin;\n this.bookId = options.bookId;\n };\n})(BookReader.prototype.setup);\n\n/** @override Extend to call Open Library for TOC */\nBookReader.prototype.init = (function(super_) {\n return function() {\n super_.call(this);\n if (this.enableChaptersPlugin && this.ui !== 'embed') {\n this.getOpenLibraryRecord();\n }\n if (this.enableMobileNav) {\n this.bind(BookReader.eventNames.mobileNavOpen,\n () => {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n if ($('table-contents-list').parent().hasClass('mm-opened')) {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n }\n }\n );\n $(\".BRmobileMenu__tableContents\").on(\"click\", () => {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n });\n }\n };\n})(BookReader.prototype.init);\n\n/**\n * Adds chapter marker to navigation scrubber\n *\n * @param {string} chapterTitle\n * @param {string} pageNumber\n * @param {number} pageIndex\n */\nBookReader.prototype.addChapter = function(chapterTitle, pageNumber, pageIndex) {\n const uiStringPage = 'Page'; // i18n\n const percentThrough = BookReader.util.cssPercentage(pageIndex, this.getNumLeafs() - 1);\n const jumpToChapter = (event) => {\n this.jumpToIndex($(event.delegateTarget).data('pageIndex'));\n $('.current-chapter').removeClass('current-chapter');\n $(event.delegateTarget).addClass('current-chapter');\n };\n const title = `${chapterTitle} | `;\n const pageStr = `${uiStringPage} ${pageNumber}`;\n\n //adding items to mobile table of contents\n const mobileChapter = $(`<li></li>`).append($(`<span class='BRTOCElementTitle'></span>`).text(title))\n .append($(`<span class='BRTOCElementPage'></span>`).text(pageStr));\n mobileChapter.addClass('BRtable-contents-el')\n .appendTo(this.$('.table-contents-list'))\n .data({ pageIndex });\n\n //adds .BRchapters to the slider only if pageIndex exists\n if (pageIndex != undefined) {\n $(`<div></div>`)\n .append($('<div />').text(title + pageStr))\n .addClass('BRchapter')\n .css({ left: percentThrough })\n .appendTo(this.$('.BRnavline'))\n .data({ pageIndex })\n .on(\"mouseenter\", event => {\n // remove hover effect from other markers then turn on just for this\n const marker = event.currentTarget;\n const tooltip = marker.querySelector('div');\n const tooltipOffset = tooltip.getBoundingClientRect();\n const targetOffset = marker.getBoundingClientRect();\n const boxSizeAdjust = parseInt(getComputedStyle(tooltip).paddingLeft) * 2;\n if (tooltipOffset.x - boxSizeAdjust < 0) {\n tooltip.style.setProperty('transform', `translateX(-${targetOffset.left - boxSizeAdjust}px)`);\n }\n this.$('.BRsearch,.BRchapter').removeClass('front');\n $(event.target).addClass('front');\n })\n .on(\"mouseleave\", event => $(event.target).removeClass('front'))\n .on('click', jumpToChapter);\n\n //adding clickable properties to mobile chapters\n mobileChapter.bind('click', jumpToChapter)\n .addClass('chapter-clickable')\n .attr(\"data-event-click-tracking\",\"BRTOCPanel|GoToChapter\");\n }\n\n};\n\n/*\n * Remove all chapters.\n */\nBookReader.prototype.removeChapters = function() {\n this.$('.BRnavpos .BRchapter').remove();\n};\n\n/**\n * Update the table of contents based on array of TOC entries.\n * @param {TocEntry[]} tocEntries\n */\nBookReader.prototype.updateTOC = function(tocEntries) {\n this.removeChapters();\n if (this.enableMobileNav && tocEntries.length > 0) {\n this.$(\".BRmobileMenu__tableContents\").show();\n }\n for (let i = 0; i < tocEntries.length; i++) {\n this.addChapterFromEntry(tocEntries[i]);\n }\n this._tocEntries = tocEntries;\n $('.table-contents-list').children().each((i, el) => {\n tocEntries[i].mobileHTML = el;\n });\n};\n\n/**\n * @typedef {Object} TocEntry\n * Table of contents entry as defined -- format is defined by Open Library\n * @property {string} pagenum\n * @property {number} level\n * @property {string} label\n * @property {{type: '/type/toc_item'}} type\n * @property {string} title\n * @property {HTMLElement} mobileHTML\n * @property {number} pageIndex\n\n *\n * @example {\n * \"pagenum\": \"17\",\n * \"level\": 1,\n * \"label\": \"CHAPTER I\",\n * \"type\": {\"key\": \"/type/toc_item\"},\n * \"title\": \"THE COUNTRY AND THE MISSION\"\n * }\n */\n\n/**\n * @param {TocEntry} tocEntryObject\n */\nBookReader.prototype.addChapterFromEntry = function(tocEntryObject) {\n tocEntryObject.pageIndex = this.getPageIndex(tocEntryObject['pagenum']);\n //creates a string with non-void tocEntryObject.label and tocEntryObject.title\n const chapterStr = [tocEntryObject.label, tocEntryObject.title]\n .filter(x => x)\n .join(' ');\n this.addChapter(chapterStr, tocEntryObject['pagenum'], tocEntryObject.pageIndex);\n this.$('.BRchapter, .BRsearch').each((i, el) => {\n const $el = $(el);\n $el\n .on(\"mouseenter\", () => $el.addClass('front'))\n .on(\"mouseleave\", () => $el.removeClass('front'));\n });\n};\n\n/**\n * getOpenLibraryRecord\n *\n * The bookreader is designed to call openlibrary API and constructs the\n * \"Return book\" button using the response.\n *\n * This makes a call to OL API and calls the given callback function with the\n * response from the API.\n */\nBookReader.prototype.getOpenLibraryRecord = async function () {\n // Try looking up by ocaid first, then by source_record\n const baseURL = `${this.olHost}/query.json?type=/type/edition&*=`;\n const fetchUrlByBookId = `${baseURL}&ocaid=${this.bookId}`;\n\n /*\n * Update Chapter markers based on received record from Open Library.\n * Notes that Open Library record is used for extra metadata, and also for lending\n */\n const setUpChapterMarkers = (olObject) => {\n if (olObject && olObject.table_of_contents) {\n // XXX check here that TOC is valid\n this.updateTOC(olObject.table_of_contents);\n }\n };\n\n let data = await $.ajax({ url: fetchUrlByBookId, dataType: 'jsonp' });\n\n if (!data || !data.length) {\n // try sourceid\n data = await $.ajax({ url: `${baseURL}&source_records=ia:${this.bookId}`, dataType: 'jsonp' });\n }\n\n if (data && data.length > 0) {\n setUpChapterMarkers(data[0]);\n }\n};\n\n// Extend buildMobileDrawerElement with table of contents list\nBookReader.prototype.buildMobileDrawerElement = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.enableMobileNav && this.options.enableChaptersPlugin) {\n $el.find('.BRmobileMenu__moreInfoRow').after($(`\n <li class=\"BRmobileMenu__tableContents\" data-event-click-tracking=\"BRSidebar|TOCPanel\">\n <span>\n <span class=\"DrawerIconWrapper\">\n <img class=\"DrawerIcon\" src=\"${this.imagesBaseURL}icon_toc.svg\" alt=\"toc-icon\"/>\n </span>\n Table of Contents\n </span>\n <div>\n <ol class=\"table-contents-list\">\n </ol>\n </div>\n </li>`).hide());\n }\n return $el;\n };\n})(BookReader.prototype.buildMobileDrawerElement);\n\n/**\n * highlights the current chapter based on current page\n * @private\n * @param {TocEntry[]} tocEntries\n * @param {number} tocEntries\n */\nBookReader.prototype.updateTOCState = function(currIndex, tocEntries) {\n //this function won't have any effects if called before OpenLibrary request is finished\n if (!tocEntries) {return;}\n $('.current-chapter').removeClass('current-chapter');\n const tocEntriesIndexed = tocEntries.filter((el) => el.pageIndex != undefined).reverse();\n const currChapter = tocEntriesIndexed[tocEntriesIndexed.findIndex(\n (el) => el.pageIndex <= currIndex)];\n if (currChapter != undefined) {\n $(currChapter.mobileHTML).addClass('current-chapter');\n }\n};\n"],"names":["super_","jQuery","extend","BookReader","defaultOptions","olHost","enableChaptersPlugin","bookId","prototype","setup","options","call","this","init","ui","getOpenLibraryRecord","enableMobileNav","bind","eventNames","mobileNavOpen","updateTOCState","firstIndex","_tocEntries","$","parent","hasClass","on","addChapter","chapterTitle","pageNumber","pageIndex","percentThrough","util","cssPercentage","getNumLeafs","jumpToChapter","event","jumpToIndex","delegateTarget","data","removeClass","addClass","title","pageStr","mobileChapter","append","text","appendTo","undefined","css","left","marker","currentTarget","tooltip","querySelector","tooltipOffset","getBoundingClientRect","targetOffset","boxSizeAdjust","parseInt","getComputedStyle","paddingLeft","x","style","setProperty","target","attr","removeChapters","remove","updateTOC","tocEntries","length","show","i","addChapterFromEntry","children","each","el","mobileHTML","tocEntryObject","getPageIndex","chapterStr","label","filter","join","$el","baseURL","fetchUrlByBookId","setUpChapterMarkers","olObject","table_of_contents","ajax","url","dataType","buildMobileDrawerElement","find","after","imagesBaseURL","hide","currIndex","tocEntriesIndexed","reverse","currChapter","findIndex"],"sourceRoot":""}
1
+ {"version":3,"file":"plugins/plugin.chapters.js","mappings":"mOAawCA,E,gVAPxCC,EAAOC,OAAOC,WAAWC,eAAgB,CACvCC,OAAQ,0BACRC,sBAAsB,EACtBC,OAAQ,KAIVJ,WAAWK,UAAUC,OAAmBT,EAQrCG,WAAWK,UAAUC,MAPf,SAAUC,GACfV,EAAOW,KAAKC,KAAMF,GAElBE,KAAKP,OAASK,EAAQL,OACtBO,KAAKN,qBAAuBI,EAAQJ,qBACpCM,KAAKL,OAASG,EAAQH,SAK1BJ,WAAWK,UAAUK,KAAQ,SAASb,GACpC,OAAO,WAAW,WAChBA,EAAOW,KAAKC,MACRA,KAAKN,sBAAoC,UAAZM,KAAKE,IACpCF,KAAKG,uBAEHH,KAAKI,kBACPJ,KAAKK,KAAKd,WAAWe,WAAWC,eAC9B,WACE,EAAKC,eAAe,EAAKC,WAAY,EAAKC,aACtCC,EAAE,uBAAuBC,SAASC,SAAS,cAC7C,EAAKL,eAAe,EAAKC,WAAY,EAAKC,gBAIhDC,EAAE,gCAAgCG,GAAG,SAAS,WAC5C,EAAKN,eAAe,EAAKC,WAAY,EAAKC,kBAhBrB,CAoB1BnB,WAAWK,UAAUK,MASxBV,WAAWK,UAAUmB,WAAa,SAASC,EAAcC,EAAYC,GAAW,WAExEC,EAAiB5B,WAAW6B,KAAKC,cAAcH,EAAWlB,KAAKsB,cAAgB,GAC/EC,EAAgB,SAACC,GACrB,EAAKC,YAAYd,EAAEa,EAAME,gBAAgBC,KAAK,cAC9ChB,EAAE,oBAAoBiB,YAAY,mBAClCjB,EAAEa,EAAME,gBAAgBG,SAAS,oBAE7BC,EAAQ,GAAH,OAAMd,EAAN,OACLe,EAAU,GAAH,OARQ,OAQR,YAAsBd,GAG7Be,EAAgBrB,EAAE,aAAasB,OAAOtB,EAAE,2CAA2CuB,KAAKJ,IAC3FG,OAAOtB,EAAE,0CAA0CuB,KAAKH,IAC3DC,EAAcH,SAAS,uBACpBM,SAASnC,KAAKW,EAAE,yBAChBgB,KAAK,CAAET,UAAAA,IAGOkB,MAAblB,IACFP,EAAE,eACCsB,OAAOtB,EAAE,WAAWuB,KAAKJ,EAAQC,IACjCF,SAAS,aACTQ,IAAI,CAAEC,KAAMnB,IACZgB,SAASnC,KAAKW,EAAE,eAChBgB,KAAK,CAAET,UAAAA,IACPJ,GAAG,cAAc,SAAAU,GAEhB,IAAMe,EAASf,EAAMgB,cACfC,EAAUF,EAAOG,cAAc,OAC/BC,EAAgBF,EAAQG,wBACxBC,EAAeN,EAAOK,wBACtBE,EAAkE,EAAlDC,SAASC,iBAAiBP,GAASQ,aACrDN,EAAcO,EAAIJ,EAAgB,GACpCL,EAAQU,MAAMC,YAAY,YAA1B,sBAAsDP,EAAaP,KAAOQ,EAA1E,QAEF,EAAKnC,EAAE,wBAAwBiB,YAAY,SAC3CjB,EAAEa,EAAM6B,QAAQxB,SAAS,YAE1Bf,GAAG,cAAc,SAAAU,GAAK,OAAIb,EAAEa,EAAM6B,QAAQzB,YAAY,YACtDd,GAAG,QAASS,GAGfS,EAAc3B,KAAK,QAASkB,GACzBM,SAAS,qBACTyB,KAAK,4BAA4B,4BAQxC/D,WAAWK,UAAU2D,eAAiB,WACpCvD,KAAKW,EAAE,wBAAwB6C,UAOjCjE,WAAWK,UAAU6D,UAAY,SAASC,GACxC1D,KAAKuD,iBACDvD,KAAKI,iBAAmBsD,EAAWC,OAAS,GAC9C3D,KAAKW,EAAE,gCAAgCiD,OAEzC,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAWC,OAAQE,IACrC7D,KAAK8D,oBAAoBJ,EAAWG,IAEtC7D,KAAKU,YAAcgD,EACnB/C,EAAE,wBAAwBoD,WAAWC,MAAK,SAACH,EAAGI,GAC5CP,EAAWG,GAAGK,WAAaD,MA4B/B1E,WAAWK,UAAUkE,oBAAsB,SAASK,GAClDA,EAAejD,UAAYlB,KAAKoE,aAAaD,EAAc,SAE3D,IAAME,EAAa,CAACF,EAAeG,MAAOH,EAAerC,OACtDyC,QAAO,SAAArB,GAAC,OAAIA,KACZsB,KAAK,KACRxE,KAAKe,WAAWsD,EAAYF,EAAc,QAAaA,EAAejD,WACtElB,KAAKW,EAAE,yBAAyBqD,MAAK,SAACH,EAAGI,GACvC,IAAMQ,EAAM9D,EAAEsD,GACdQ,EACG3D,GAAG,cAAc,kBAAM2D,EAAI5C,SAAS,YACpCf,GAAG,cAAc,kBAAM2D,EAAI7C,YAAY,gBAa9CrC,WAAWK,UAAUO,qBAArB,2BAA4C,uHAEpCuE,EAFoC,UAEvB1E,KAAKP,OAFkB,qCAGpCkF,EAHoC,UAGdD,EAHc,kBAGG1E,KAAKL,QAM5CiF,EAAsB,SAACC,GACvBA,GAAYA,EAASC,mBAEvB,EAAKrB,UAAUoB,EAASC,oBAZc,SAgBzBnE,EAAEoE,KAAK,CAAEC,IAAKL,EAAkBM,SAAU,UAhBjB,WAgBtCtD,EAhBsC,SAkB5BA,EAAKgC,OAlBuB,iCAoB3BhD,EAAEoE,KAAK,CAAEC,IAAK,GAAF,OAAKN,EAAL,8BAAkC1E,KAAKL,QAAUsF,SAAU,UApB5C,OAoBxCtD,EApBwC,eAuBtCA,GAAQA,EAAKgC,OAAS,GACxBiB,EAAoBjD,EAAK,IAxBe,iDA6B5CpC,WAAWK,UAAUsF,yBAA4B,SAAU9F,GACzD,OAAO,WACL,IAAMqF,EAAMrF,EAAOW,KAAKC,MAgBxB,OAfIA,KAAKI,iBAAmBJ,KAAKF,QAAQJ,sBACvC+E,EAAIU,KAAK,8BAA8BC,MAAMzE,EAAE,2NAAD,OAIHX,KAAKqF,cAJF,mPAYpCC,QAELb,GAlBsC,CAoB9ClF,WAAWK,UAAUsF,0BAQxB3F,WAAWK,UAAUY,eAAiB,SAAS+E,EAAW7B,GAExD,GAAKA,EAAL,CACA/C,EAAE,oBAAoBiB,YAAY,mBAClC,IAAM4D,EAAoB9B,EAAWa,QAAO,SAACN,GAAD,OAAwB7B,MAAhB6B,EAAG/C,aAAwBuE,UACzEC,EAAcF,EAAkBA,EAAkBG,WACtD,SAAC1B,GAAD,OAAQA,EAAG/C,WAAaqE,MACPnD,MAAfsD,GACF/E,EAAE+E,EAAYxB,YAAYrC,SAAS,uB","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.chapters.js"],"sourcesContent":["/* global BookReader */\n/**\n * Plugin for chapter markers in BookReader. Fetches from openlibrary.org\n * Could be forked, or extended to alter behavior\n */\n\njQuery.extend(BookReader.defaultOptions, {\n olHost: 'https://openlibrary.org',\n enableChaptersPlugin: true,\n bookId: '',\n});\n\n/** @override Extend the constructor to add search properties */\nBookReader.prototype.setup = (function (super_) {\n return function (options) {\n super_.call(this, options);\n\n this.olHost = options.olHost;\n this.enableChaptersPlugin = options.enableChaptersPlugin;\n this.bookId = options.bookId;\n };\n})(BookReader.prototype.setup);\n\n/** @override Extend to call Open Library for TOC */\nBookReader.prototype.init = (function(super_) {\n return function() {\n super_.call(this);\n if (this.enableChaptersPlugin && this.ui !== 'embed') {\n this.getOpenLibraryRecord();\n }\n if (this.enableMobileNav) {\n this.bind(BookReader.eventNames.mobileNavOpen,\n () => {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n if ($('table-contents-list').parent().hasClass('mm-opened')) {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n }\n }\n );\n $(\".BRmobileMenu__tableContents\").on(\"click\", () => {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n });\n }\n };\n})(BookReader.prototype.init);\n\n/**\n * Adds chapter marker to navigation scrubber\n *\n * @param {string} chapterTitle\n * @param {string} pageNumber\n * @param {number} pageIndex\n */\nBookReader.prototype.addChapter = function(chapterTitle, pageNumber, pageIndex) {\n const uiStringPage = 'Page'; // i18n\n const percentThrough = BookReader.util.cssPercentage(pageIndex, this.getNumLeafs() - 1);\n const jumpToChapter = (event) => {\n this.jumpToIndex($(event.delegateTarget).data('pageIndex'));\n $('.current-chapter').removeClass('current-chapter');\n $(event.delegateTarget).addClass('current-chapter');\n };\n const title = `${chapterTitle} | `;\n const pageStr = `${uiStringPage} ${pageNumber}`;\n\n //adding items to mobile table of contents\n const mobileChapter = $(`<li></li>`).append($(`<span class='BRTOCElementTitle'></span>`).text(title))\n .append($(`<span class='BRTOCElementPage'></span>`).text(pageStr));\n mobileChapter.addClass('BRtable-contents-el')\n .appendTo(this.$('.table-contents-list'))\n .data({ pageIndex });\n\n //adds .BRchapters to the slider only if pageIndex exists\n if (pageIndex != undefined) {\n $(`<div></div>`)\n .append($('<div />').text(title + pageStr))\n .addClass('BRchapter')\n .css({ left: percentThrough })\n .appendTo(this.$('.BRnavline'))\n .data({ pageIndex })\n .on(\"mouseenter\", event => {\n // remove hover effect from other markers then turn on just for this\n const marker = event.currentTarget;\n const tooltip = marker.querySelector('div');\n const tooltipOffset = tooltip.getBoundingClientRect();\n const targetOffset = marker.getBoundingClientRect();\n const boxSizeAdjust = parseInt(getComputedStyle(tooltip).paddingLeft) * 2;\n if (tooltipOffset.x - boxSizeAdjust < 0) {\n tooltip.style.setProperty('transform', `translateX(-${targetOffset.left - boxSizeAdjust}px)`);\n }\n this.$('.BRsearch,.BRchapter').removeClass('front');\n $(event.target).addClass('front');\n })\n .on(\"mouseleave\", event => $(event.target).removeClass('front'))\n .on('click', jumpToChapter);\n\n //adding clickable properties to mobile chapters\n mobileChapter.bind('click', jumpToChapter)\n .addClass('chapter-clickable')\n .attr(\"data-event-click-tracking\",\"BRTOCPanel|GoToChapter\");\n }\n\n};\n\n/*\n * Remove all chapters.\n */\nBookReader.prototype.removeChapters = function() {\n this.$('.BRnavpos .BRchapter').remove();\n};\n\n/**\n * Update the table of contents based on array of TOC entries.\n * @param {TocEntry[]} tocEntries\n */\nBookReader.prototype.updateTOC = function(tocEntries) {\n this.removeChapters();\n if (this.enableMobileNav && tocEntries.length > 0) {\n this.$(\".BRmobileMenu__tableContents\").show();\n }\n for (let i = 0; i < tocEntries.length; i++) {\n this.addChapterFromEntry(tocEntries[i]);\n }\n this._tocEntries = tocEntries;\n $('.table-contents-list').children().each((i, el) => {\n tocEntries[i].mobileHTML = el;\n });\n};\n\n/**\n * @typedef {Object} TocEntry\n * Table of contents entry as defined -- format is defined by Open Library\n * @property {string} pagenum\n * @property {number} level\n * @property {string} label\n * @property {{type: '/type/toc_item'}} type\n * @property {string} title\n * @property {HTMLElement} mobileHTML\n * @property {number} pageIndex\n\n *\n * @example {\n * \"pagenum\": \"17\",\n * \"level\": 1,\n * \"label\": \"CHAPTER I\",\n * \"type\": {\"key\": \"/type/toc_item\"},\n * \"title\": \"THE COUNTRY AND THE MISSION\"\n * }\n */\n\n/**\n * @param {TocEntry} tocEntryObject\n */\nBookReader.prototype.addChapterFromEntry = function(tocEntryObject) {\n tocEntryObject.pageIndex = this.getPageIndex(tocEntryObject['pagenum']);\n //creates a string with non-void tocEntryObject.label and tocEntryObject.title\n const chapterStr = [tocEntryObject.label, tocEntryObject.title]\n .filter(x => x)\n .join(' ');\n this.addChapter(chapterStr, tocEntryObject['pagenum'], tocEntryObject.pageIndex);\n this.$('.BRchapter, .BRsearch').each((i, el) => {\n const $el = $(el);\n $el\n .on(\"mouseenter\", () => $el.addClass('front'))\n .on(\"mouseleave\", () => $el.removeClass('front'));\n });\n};\n\n/**\n * getOpenLibraryRecord\n *\n * The bookreader is designed to call openlibrary API and constructs the\n * \"Return book\" button using the response.\n *\n * This makes a call to OL API and calls the given callback function with the\n * response from the API.\n */\nBookReader.prototype.getOpenLibraryRecord = async function () {\n // Try looking up by ocaid first, then by source_record\n const baseURL = `${this.olHost}/query.json?type=/type/edition&*=`;\n const fetchUrlByBookId = `${baseURL}&ocaid=${this.bookId}`;\n\n /*\n * Update Chapter markers based on received record from Open Library.\n * Notes that Open Library record is used for extra metadata, and also for lending\n */\n const setUpChapterMarkers = (olObject) => {\n if (olObject && olObject.table_of_contents) {\n // XXX check here that TOC is valid\n this.updateTOC(olObject.table_of_contents);\n }\n };\n\n let data = await $.ajax({ url: fetchUrlByBookId, dataType: 'jsonp' });\n\n if (!data || !data.length) {\n // try sourceid\n data = await $.ajax({ url: `${baseURL}&source_records=ia:${this.bookId}`, dataType: 'jsonp' });\n }\n\n if (data && data.length > 0) {\n setUpChapterMarkers(data[0]);\n }\n};\n\n// Extend buildMobileDrawerElement with table of contents list\nBookReader.prototype.buildMobileDrawerElement = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.enableMobileNav && this.options.enableChaptersPlugin) {\n $el.find('.BRmobileMenu__moreInfoRow').after($(`\n <li class=\"BRmobileMenu__tableContents\" data-event-click-tracking=\"BRSidebar|TOCPanel\">\n <span>\n <span class=\"DrawerIconWrapper\">\n <img class=\"DrawerIcon\" src=\"${this.imagesBaseURL}icon_toc.svg\" alt=\"toc-icon\"/>\n </span>\n Table of Contents\n </span>\n <div>\n <ol class=\"table-contents-list\">\n </ol>\n </div>\n </li>`).hide());\n }\n return $el;\n };\n})(BookReader.prototype.buildMobileDrawerElement);\n\n/**\n * highlights the current chapter based on current page\n * @private\n * @param {TocEntry[]} tocEntries\n * @param {number} tocEntries\n */\nBookReader.prototype.updateTOCState = function(currIndex, tocEntries) {\n //this function won't have any effects if called before OpenLibrary request is finished\n if (!tocEntries) {return;}\n $('.current-chapter').removeClass('current-chapter');\n const tocEntriesIndexed = tocEntries.filter((el) => el.pageIndex != undefined).reverse();\n const currChapter = tocEntriesIndexed[tocEntriesIndexed.findIndex(\n (el) => el.pageIndex <= currIndex)];\n if (currChapter != undefined) {\n $(currChapter.mobileHTML).addClass('current-chapter');\n }\n};\n"],"names":["super_","jQuery","extend","BookReader","defaultOptions","olHost","enableChaptersPlugin","bookId","prototype","setup","options","call","this","init","ui","getOpenLibraryRecord","enableMobileNav","bind","eventNames","mobileNavOpen","updateTOCState","firstIndex","_tocEntries","$","parent","hasClass","on","addChapter","chapterTitle","pageNumber","pageIndex","percentThrough","util","cssPercentage","getNumLeafs","jumpToChapter","event","jumpToIndex","delegateTarget","data","removeClass","addClass","title","pageStr","mobileChapter","append","text","appendTo","undefined","css","left","marker","currentTarget","tooltip","querySelector","tooltipOffset","getBoundingClientRect","targetOffset","boxSizeAdjust","parseInt","getComputedStyle","paddingLeft","x","style","setProperty","target","attr","removeChapters","remove","updateTOC","tocEntries","length","show","i","addChapterFromEntry","children","each","el","mobileHTML","tocEntryObject","getPageIndex","chapterStr","label","filter","join","$el","baseURL","fetchUrlByBookId","setUpChapterMarkers","olObject","table_of_contents","ajax","url","dataType","buildMobileDrawerElement","find","after","imagesBaseURL","hide","currIndex","tocEntriesIndexed","reverse","currChapter","findIndex"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[111],{2878:function(e,n,t){"use strict";t(9826),t(2222),t(7327);var s,a=t(5685),i=(t(866),t(2026),t(3609)),o=t(3609),r=[{filter:"grayscale(100%)",label:"Grayscale"},{filter:"brightness(120%)",label:"High brightness"},{filter:"invert(100%)",label:"Inverted (dark mode)"},{filter:"contrast(120%)",label:"High contrast"}];i.extend(BookReader.defaultOptions,{enableMobileNav:!0,mobileNavTitle:"Internet Archive",mobileNavFullscreenOnly:!1}),BookReader.prototype.setup=(s=BookReader.prototype.setup,function(e){s.call(this,e),this.enableMobileNav=e.enableMobileNav,this.mobileNavTitle=e.mobileNavTitle,this.mobileNavFullscreenOnly=e.mobileNavFullscreenOnly,this.refs.$mmenu=null}),BookReader.prototype.initToolbar=function(e){return function(n,t){var s,i=this;if(this.enableMobileNav){var r=this.buildMobileDrawerElement();this.refs.$br.append(r),this.buildInfoDiv(this.$(".BRmobileInfo")),this.buildShareDiv(this.$(".BRmobileShare")),(s=r).mmenu({navbars:[{position:"top"}],navbar:{add:!0,title:this.mobileNavTitle,titleLink:"panel"},extensions:["panelshadow"]},{offCanvas:{wrapPageIfNeeded:!1,zposition:"next",pageSelector:this.el}});var c=s.find(".BRpageviewValue");s.data("mmenu").bind("opened",(function(){c.length&&c.val(window.location.href)})),r.find(".BRcheckbox-filters").on("click",(function(){return l(r,i)})),r.find(".DrawerLayoutButton.one_page_mode").on("click",(function(){return i.switchMode(i.constMode1up)})),r.find(".DrawerLayoutButton.two_page_mode").on("click",(function(){return i.switchMode(i.constMode2up)})),r.find(".DrawerLayoutButton.thumbnail_mode").on("click",(function(){return i.switchMode(i.constModeThumb)})),this.mobileNavFullscreenOnly?o(document.body).addClass("BRbodyMobileNavEnabledFullscreen"):o(document.body).addClass("BRbodyMobileNavEnabled"),this.refs.$mmenu=s}if(e.apply(this,arguments),this.enableMobileNav){this.$(".BRmobileHamburger").click((function(){s.data("mmenu").getInstance().vars.opened?s.data("mmenu").close():(s.data("mmenu").open(),i.trigger("mobileNavOpen"))}));var d=function(e){var n=o(window).width();s.data("mmenu").getInstance().vars.opened&&n>=800&&s.data("mmenu").close()};window.addEventListener("resize",a.debounce(d,900))}}}(BookReader.prototype.initToolbar),BookReader.prototype.buildToolbarElement=function(e){return function(){var n=e.call(this);if(this.enableMobileNav){var t=BookReader.util.escapeHTML(this.bookTitle),s='\n <span class="BRmobileHamburgerWrapper">\n <button class="BRmobileHamburger"></button>\n <span class="BRtoolbarMobileTitle" title="'.concat(t,'">').concat(t,"</span>\n </span>\n ");n.addClass("responsive").prepend(o(s))}return n}}(BookReader.prototype.buildToolbarElement),BookReader.prototype.buildMobileDrawerElement=function(){var e="";this.enableExperimentalControls&&(e='\n <p class="DrawerSettingsTitle">Visual Adjustment</p>\n <div class="BRcheckbox-group-filters">\n ',r.forEach((function(n,t){var s='\n <input type="checkbox" class="BRcheckbox-filters" id="filter'.concat(t,'">\n <label for="filter').concat(t,'" class="BRcheckbox-label-filters">').concat(n.label,"</label><br>\n \n ");e=e.concat(s)})),e=e.concat("</div>"));var n='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat("".concat(this.imagesBaseURL,"icon_gear.svg"),'" alt="settings-icon"/>\n </span>\n Settings\n </span>\n <div class=DrawerSettingsWrapper>\n <div class="DrawerSettingsLayoutWrapper">\n <button class="DrawerLayoutButton one_page_mode">\n <img src="',this.imagesBaseURL,'icon_one_page.svg" alt="Single Page"/>\n <br>\n One Page\n </button>\n <button class="DrawerLayoutButton two_page_mode TwoPagesButton">\n <img src="').concat(this.imagesBaseURL,'icon_two_pages.svg" alt="Two Pages"/>\n <br>\n Two Pages\n </button>\n <button class="DrawerLayoutButton thumbnail_mode">\n <img src="').concat(this.imagesBaseURL,'icon_thumbnails.svg" alt="Thumbnails"/>\n <br>\n Thumbnails\n </button>\n </div>\n <br>\n <div class="DrawerSettingsTitle">Zoom</div>\n <button class=\'BRicon zoom_out\'></button>\n <button class=\'BRicon zoom_in\'></button>\n <br style="clear:both"><br><br>\n ').concat(e,"\n </div>\n "),t='\n <span>\n <span class="DrawerIconWrapper ">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_info.svg" alt="info-icon"/>\n </span>\n About This Book\n </span>\n <div class="BRmobileInfo"></div>\n '),s='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_share.svg" alt="info-share"/>\n </span>\n Share This Book\n </span>\n <div class="BRmobileShare"></div>\n '),a='\n <nav id="BRmobileMenu" class="BRmobileMenu">\n <ul>\n <li class="BRmobileMenu__settings">'.concat(n,'</li>\n <li class="BRmobileMenu__moreInfoRow">').concat(t,'</li>\n <li class="BRmobileMenu__share">').concat(s,"</li>\n </ul>\n </nav>\n ");return o(a)},BookReader.prototype.$=function(e){return function(n){var t=e.call(this,n);return this.refs.$mmenu&&(t=t.add(this.refs.$mmenu.find(n))),t}}(BookReader.prototype.$);var l=function(e,n){var t="";o(".BRcheckbox-filters").each((function(e,s){n.refs.$br.removeClass("filter-applied"),o(s).is(":checked")&&(n.refs.$br.addClass(o(s).attr("filter-applied")),t+=r[e].filter)}));var s=o("#filtersStyle")[0]||document.createElement("style");s.id="filtersStyle",s.innerHTML=".BRpagecontainer img {\n filter: ".concat(t,";\n -webkit-filter: ").concat(t,";}"),document.body.appendChild(s)}},2026:function(e,n,t){var s,a,i,o,r=t(3609);o="navbars",(s=r)[i="mmenu"].addons[o]={setup:function(){var e=this,n=this.opts[o],t=this.conf[o];if(s[i].glbl,void 0!==n){n instanceof Array||(n=[n]);var r={};for(var l in s.each(n,(function(l){var c=n[l];"boolean"==typeof c&&c&&(c={}),"object"!=typeof c&&(c={}),void 0===c.content&&(c.content=["prev","title"]),c.content instanceof Array||(c.content=[c.content]);var d=(c=s.extend(!0,{},e.opts.navbar,c)).position,p=c.height;"number"!=typeof p&&(p=1),p=Math.min(4,Math.max(1,p)),"bottom"!=d&&(d="top"),r[d]||(r[d]=0),r[d]++;var h=s("<div />").addClass(a.navbar+" "+a.navbar+"-"+d+" "+a.navbar+"-"+d+"-"+r[d]+" "+a.navbar+"-size-"+p);r[d]+=p-1;for(var u=0,f=0,v=c.content.length;v>f;f++){var m=s[i].addons[o][c.content[f]]||!1;m?u+=m.call(e,h,c,t):((m=c.content[f])instanceof s||(m=s(c.content[f])),h.append(m))}(u+=Math.ceil(h.children().not("."+a.btn).length/p))>1&&h.addClass(a.navbar+"-content-"+u),h.children("."+a.btn).length&&h.addClass(a.hasbtns),h.prependTo(e.$menu)})),r)e.$menu.addClass(a.hasnavbar+"-"+l+"-"+r[l])}},add:function(){a=s[i]._c,s[i]._d,s[i]._e,a.add("close hasbtns")},clickAnchor:function(e,n){}},s[i].configuration[o]={breadcrumbSeparator:"/"},s[i].configuration.classNames[o]={},function(e){var n="mmenu";e[n].addons.navbars.breadcrumbs=function(t,s,a){var i=e[n]._c,o=e[n]._d;i.add("breadcrumbs separator");var r=e('<span class="'+i.breadcrumbs+'" />').appendTo(t);this.bind("init",(function(n){n.removeClass(i.hasnavbar).each((function(){for(var n=[],t=e(this),s=e('<span class="'+i.breadcrumbs+'"></span>'),r=e(this).children().first(),l=!0;r&&r.length;){r.is("."+i.panel)||(r=r.closest("."+i.panel));var c=r.children("."+i.navbar).children("."+i.title).text();n.unshift(l?"<span>"+c+"</span>":'<a href="#'+r.attr("id")+'">'+c+"</a>"),l=!1,r=r.data(o.parent)}s.append(n.join('<span class="'+i.separator+'">'+a.breadcrumbSeparator+"</span>")).appendTo(t.children("."+i.navbar))}))}));var l=function(){r.html(this.$pnls.children("."+i.current).children("."+i.navbar).children("."+i.breadcrumbs).html())};return this.bind("openPanel",l),this.bind("init",l),0}}(r),function(e){var n="mmenu";e[n].addons.navbars.close=function(t,s){var a=e[n]._c,i=e[n].glbl,o=e('<a class="'+a.close+" "+a.btn+'" href="#" />').appendTo(t),r=function(e){o.attr("href","#"+e.attr("id"))};return r.call(this,i.$page),this.bind("setPage",r),-1}}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].next=function(s,a){var i,o,r=e[n]._c,l=e('<a class="'+r.next+" "+r.btn+'" href="#" />').appendTo(s),c=function(e){var n=(e=e||this.$pnls.children("."+r.current)).find("."+this.conf.classNames[t].panelNext);i=n.attr("href"),o=n.html(),l[i?"attr":"removeAttr"]("href",i),l[i||o?"removeClass":"addClass"](r.hidden),l.html(o)};return this.bind("openPanel",c),this.bind("init",(function(){c.call(this)})),-1},e[n].configuration.classNames[t].panelNext="Next"}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].prev=function(s,a){var i=e[n]._c,o=e('<a class="'+i.prev+" "+i.btn+'" href="#" />').appendTo(s);this.bind("init",(function(e){e.removeClass(i.hasnavbar).children("."+i.navbar).addClass(i.hidden)}));var r,l,c=function(e){if(!(e=e||this.$pnls.children("."+i.current)).hasClass(i.vertical)){var n=e.find("."+this.conf.classNames[t].panelPrev);n.length||(n=e.children("."+i.navbar).children("."+i.prev)),r=n.attr("href"),l=n.html(),o[r?"attr":"removeAttr"]("href",r),o[r||l?"removeClass":"addClass"](i.hidden),o.html(l)}};return this.bind("openPanel",c),this.bind("init",(function(){c.call(this)})),-1},e[n].configuration.classNames[t].panelPrev="Prev"}(r),function(e){var n="mmenu";e[n].addons.navbars.searchfield=function(t,s){var a=e[n]._c,i=e('<div class="'+a.search+'" />').appendTo(t);return"object"!=typeof this.opts.searchfield&&(this.opts.searchfield={}),this.opts.searchfield.add=!0,this.opts.searchfield.addTo=i,0}}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].title=function(s,a){var i,o,r=e[n]._c,l=e('<a class="'+r.title+'" />').appendTo(s),c=function(e){if(!(e=e||this.$pnls.children("."+r.current)).hasClass(r.vertical)){var n=e.find("."+this.conf.classNames[t].panelTitle);n.length||(n=e.children("."+r.navbar).children("."+r.title)),i=n.attr("href"),o=n.html()||a.title,l[i?"attr":"removeAttr"]("href",i),l[i||o?"removeClass":"addClass"](r.hidden),l.html(o)}};return this.bind("openPanel",c),this.bind("init",(function(e){c.call(this)})),0},e[n].configuration.classNames[t].panelTitle="Title"}(r)},866:function(e,n,t){var s,a,i,o,r,l,c,d=t(3609);!function(e){function n(){e[o].glbl||(i={$wndw:e(window),$docu:e(document),$html:e("html"),$body:e("body")},t={},s={},a={},e.each([t,s,a],(function(e,n){n.add=function(e){for(var t=0,s=(e=e.split(" ")).length;s>t;t++)n[e[t]]=n.mm(e[t])}})),t.mm=function(e){return"mm-"+e},t.add("wrapper menu panels panel nopanel current highest opened subopened navbar hasnavbar title btn prev next listview nolistview inset vertical selected divider spacer hidden fullsubopen"),t.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},s.mm=function(e){return"mm-"+e},s.add("parent sub"),a.mm=function(e){return e+".mm"},a.add("transitionend webkitTransitionEnd click scroll keydown mousedown mouseup touchstart touchmove touchend orientationchange"),e[o]._c=t,e[o]._d=s,e[o]._e=a,e[o].glbl=i)}var t,s,a,i,o="mmenu",r="5.6.4";e[o]&&e[o].version>r||(e[o]=function(e,n,t){this.$menu=e,this._api=["bind","init","update","setSelected","getInstance","openPanel","closePanel","closeAllPanels"],this.opts=n,this.conf=t,this.vars={},this.cbck={},"function"==typeof this.___deprecated&&this.___deprecated(),this._initMenu(),this._initAnchors();var s=this.$pnls.children();return this._initAddons(),this.init(s),"function"==typeof this.___debug&&this.___debug(),this},e[o].version=r,e[o].addons={},e[o].uniqueId=0,e[o].defaults={extensions:[],navbar:{add:!0,title:"Menu",titleLink:"panel"},onClick:{setSelected:!0},slidingSubmenus:!0},e[o].configuration={classNames:{divider:"Divider",inset:"Inset",panel:"Panel",selected:"Selected",spacer:"Spacer",vertical:"Vertical"},clone:!1,openingInterval:25,panelNodetype:"ul, ol, div",transitionDuration:400},e[o].prototype={init:function(e){e=e.not("."+t.nopanel),e=this._initPanels(e),this.trigger("init",e),this.trigger("update")},update:function(){this.trigger("update")},setSelected:function(e){this.$menu.find("."+t.listview).children().removeClass(t.selected),e.addClass(t.selected),this.trigger("setSelected",e)},openPanel:function(n){var s=n.parent(),a=this;if(s.hasClass(t.vertical)){var i=s.parents("."+t.subopened);if(i.length)return void this.openPanel(i.first());s.addClass(t.opened),this.trigger("openPanel",n),this.trigger("openingPanel",n),this.trigger("openedPanel",n)}else{if(n.hasClass(t.current))return;var r=this.$pnls.children("."+t.panel),l=r.filter("."+t.current);r.removeClass(t.highest).removeClass(t.current).not(n).not(l).not("."+t.vertical).addClass(t.hidden),e[o].support.csstransitions||l.addClass(t.hidden),n.hasClass(t.opened)?n.nextAll("."+t.opened).addClass(t.highest).removeClass(t.opened).removeClass(t.subopened):(n.addClass(t.highest),l.addClass(t.subopened)),n.removeClass(t.hidden).addClass(t.current),a.trigger("openPanel",n),setTimeout((function(){n.removeClass(t.subopened).addClass(t.opened),a.trigger("openingPanel",n),a.__transitionend(n,(function(){a.trigger("openedPanel",n)}),a.conf.transitionDuration)}),this.conf.openingInterval)}},closePanel:function(e){var n=e.parent();n.hasClass(t.vertical)&&(n.removeClass(t.opened),this.trigger("closePanel",e),this.trigger("closingPanel",e),this.trigger("closedPanel",e))},closeAllPanels:function(){this.$menu.find("."+t.listview).children().removeClass(t.selected).filter("."+t.vertical).removeClass(t.opened);var e=this.$pnls.children("."+t.panel).first();this.$pnls.children("."+t.panel).not(e).removeClass(t.subopened).removeClass(t.opened).removeClass(t.current).removeClass(t.highest).addClass(t.hidden),this.openPanel(e)},togglePanel:function(e){var n=e.parent();n.hasClass(t.vertical)&&this[n.hasClass(t.opened)?"closePanel":"openPanel"](e)},getInstance:function(){return this},bind:function(e,n){this.cbck[e]=this.cbck[e]||[],this.cbck[e].push(n)},trigger:function(){var e=this,n=Array.prototype.slice.call(arguments),t=n.shift();if(this.cbck[t])for(var s=0,a=this.cbck[t].length;a>s;s++)this.cbck[t][s].apply(e,n)},_initMenu:function(){this.$menu.attr("id",this.$menu.attr("id")||this.__getUniqueId()),this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("[id]")).filter("[id]").each((function(){e(this).attr("id",t.mm(e(this).attr("id")))}))),this.$menu.contents().each((function(){3==e(this)[0].nodeType&&e(this).remove()})),this.$pnls=e('<div class="'+t.panels+'" />').append(this.$menu.children(this.conf.panelNodetype)).prependTo(this.$menu),this.$menu.parent().addClass(t.wrapper);var n=[t.menu];this.opts.slidingSubmenus||n.push(t.vertical),this.opts.extensions=this.opts.extensions.length?"mm-"+this.opts.extensions.join(" mm-"):"",this.opts.extensions&&n.push(this.opts.extensions),this.$menu.addClass(n.join(" "))},_initPanels:function(n){var a=this,i=this.__findAddBack(n,"ul, ol");this.__refactorClass(i,this.conf.classNames.inset,"inset").addClass(t.nolistview+" "+t.nopanel),i.not("."+t.nolistview).addClass(t.listview);var o=this.__findAddBack(n,"."+t.listview).children();this.__refactorClass(o,this.conf.classNames.selected,"selected"),this.__refactorClass(o,this.conf.classNames.divider,"divider"),this.__refactorClass(o,this.conf.classNames.spacer,"spacer"),this.__refactorClass(this.__findAddBack(n,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel");var r=e(),l=n.add(n.find("."+t.panel)).add(this.__findAddBack(n,"."+t.listview).children().children(this.conf.panelNodetype)).not("."+t.nopanel);this.__refactorClass(l,this.conf.classNames.vertical,"vertical"),this.opts.slidingSubmenus||l.addClass(t.vertical),l.each((function(){var n=e(this),s=n;n.is("ul, ol")?(n.wrap('<div class="'+t.panel+'" />'),s=n.parent()):s.addClass(t.panel);var i=n.attr("id");n.removeAttr("id"),s.attr("id",i||a.__getUniqueId()),n.hasClass(t.vertical)&&(n.removeClass(a.conf.classNames.vertical),s.add(s.parent()).addClass(t.vertical)),r=r.add(s)}));var c=e("."+t.panel,this.$menu);r.each((function(n){var i,o,r=e(this),l=r.parent(),c=l.children("a, span").first();if(l.is("."+t.panels)||(l.data(s.sub,r),r.data(s.parent,l)),l.children("."+t.next).length||l.parent().is("."+t.listview)&&(i=r.attr("id"),o=e('<a class="'+t.next+'" href="#'+i+'" data-target="#'+i+'" />').insertBefore(c),c.is("span")&&o.addClass(t.fullsubopen)),!r.children("."+t.navbar).length&&!l.hasClass(t.vertical)){l.parent().is("."+t.listview)?l=l.closest("."+t.panel):(c=l.closest("."+t.panel).find('a[href="#'+r.attr("id")+'"]').first(),l=c.closest("."+t.panel));var d=!1,p=e('<div class="'+t.navbar+'" />');if(a.opts.navbar.add&&r.addClass(t.hasnavbar),l.length){switch(i=l.attr("id"),a.opts.navbar.titleLink){case"anchor":d=c.attr("href");break;case"panel":case"parent":d="#"+i;break;default:d=!1}p.append('<a class="'+t.btn+" "+t.prev+'" href="#'+i+'" data-target="#'+i+'" />').append(e('<a class="'+t.title+'"'+(d?' href="'+d+'"':"")+" />").text(c.text())).prependTo(r)}else a.opts.navbar.title&&p.append('<a class="'+t.title+'">'+a.opts.navbar.title+"</a>").prependTo(r)}}));var d=this.__findAddBack(n,"."+t.listview).children("."+t.selected).removeClass(t.selected).last().addClass(t.selected);d.add(d.parentsUntil("."+t.menu,"li")).filter("."+t.vertical).addClass(t.opened).end().each((function(){e(this).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).addClass(t.subopened)})),d.children("."+t.panel).not("."+t.vertical).addClass(t.opened).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).addClass(t.subopened);var p=c.filter("."+t.opened);return p.length||(p=r.first()),p.addClass(t.opened).last().addClass(t.current),r.not("."+t.vertical).not(p.last()).addClass(t.hidden).end().filter((function(){return!e(this).parent().hasClass(t.panels)})).appendTo(this.$pnls),r},_initAnchors:function(){var n=this;i.$body.on(a.click+"-oncanvas","a[href]",(function(s){var a=e(this),i=!1,r=n.$menu.find(a).length;for(var l in e[o].addons)if(e[o].addons[l].clickAnchor.call(n,a,r)){i=!0;break}var c=a.attr("href");if(!i&&r&&c.length>1&&"#"==c.slice(0,1))try{var d=e(c,n.$menu);d.is("."+t.panel)&&(i=!0,n[a.parent().hasClass(t.vertical)?"togglePanel":"openPanel"](d))}catch(e){}if(i&&s.preventDefault(),!i&&r&&a.is("."+t.listview+" > li > a")&&!a.is('[rel="external"]')&&!a.is('[target="_blank"]')){n.__valueOrFn(n.opts.onClick.setSelected,a)&&n.setSelected(e(s.target).parent());var p=n.__valueOrFn(n.opts.onClick.preventDefault,a,"#"==c.slice(0,1));p&&s.preventDefault(),n.__valueOrFn(n.opts.onClick.close,a,p)&&n.close()}}))},_initAddons:function(){var n;for(n in e[o].addons)e[o].addons[n].add.call(this),e[o].addons[n].add=function(){};for(n in e[o].addons)e[o].addons[n].setup.call(this)},_getOriginalMenuId:function(){var e=this.$menu.attr("id");return e&&e.length&&this.conf.clone&&(e=t.umm(e)),e},__api:function(){var n=this,t={};return e.each(this._api,(function(e){var s=this;t[s]=function(){var e=n[s].apply(n,arguments);return void 0===e?t:e}})),t},__valueOrFn:function(e,n,t){return"function"==typeof e?e.call(n[0]):void 0===e&&void 0!==t?t:e},__refactorClass:function(e,n,s){return e.filter("."+n).removeClass(n).addClass(t[s])},__findAddBack:function(e,n){return e.find(n).add(e.filter(n))},__filterListItems:function(e){return e.not("."+t.divider).not("."+t.hidden)},__transitionend:function(e,n,t){var s=!1,i=function(){s||n.call(e[0]),s=!0};e.one(a.transitionend,i),e.one(a.webkitTransitionEnd,i),setTimeout(i,1.1*t)},__getUniqueId:function(){return t.mm(e[o].uniqueId++)}},e.fn[o]=function(t,s){return n(),t=e.extend(!0,{},e[o].defaults,t),s=e.extend(!0,{},e[o].configuration,s),this.each((function(){var n=e(this);if(!n.data(o)){var a=new e[o](n,t,s);a.$menu.data(o,a.__api())}}))},e[o].support={touch:"ontouchstart"in window||navigator.msMaxTouchPoints||!1,csstransitions:function(){if("undefined"!=typeof Modernizr&&void 0!==Modernizr.csstransitions)return Modernizr.csstransitions;var e=(document.body||document.documentElement).style,n="transition";if("string"==typeof e[n])return!0;var t=["Moz","webkit","Webkit","Khtml","O","ms"];n=n.charAt(0).toUpperCase()+n.substr(1);for(var s=0;s<t.length;s++)if("string"==typeof e[t[s]+n])return!0;return!1}()})}(d),c="offCanvas",(s=d)[l="mmenu"].addons[c]={setup:function(){if(this.opts[c]){var e=this.opts[c],n=this.conf[c];r=s[l].glbl,this._api=s.merge(this._api,["open","close","setPage"]),("top"==e.position||"bottom"==e.position)&&(e.zposition="front"),"string"!=typeof n.pageSelector&&(n.pageSelector="> "+n.pageNodetype),r.$allMenus=(r.$allMenus||s()).add(this.$menu),this.vars.opened=!1;var t=[a.offcanvas];"left"!=e.position&&t.push(a.mm(e.position)),"back"!=e.zposition&&t.push(a.mm(e.zposition)),this.$menu.addClass(t.join(" ")).parent().removeClass(a.wrapper),this.setPage(r.$page),this._initBlocker(),this["_initWindow_"+c](),this.$menu[n.menuInjectMethod+"To"](n.menuWrapperSelector);var i=window.location.hash;if(i){var o=this._getOriginalMenuId();o&&o==i.slice(1)&&this.open()}}},add:function(){a=s[l]._c,i=s[l]._d,o=s[l]._e,a.add("offcanvas slideout blocking modal background opening blocker page"),i.add("style"),o.add("resize")},clickAnchor:function(e,n){if(!this.opts[c])return!1;var t=this._getOriginalMenuId();return t&&e.is('[href="#'+t+'"]')?(this.open(),!0):r.$page?!(!(t=r.$page.first().attr("id"))||!e.is('[href="#'+t+'"]')||(this.close(),0)):void 0}},s[l].defaults[c]={position:"left",zposition:"back",blockUI:!0,moveBackground:!0},s[l].configuration[c]={pageNodetype:"div",pageSelector:null,noPageSelector:[],wrapPageIfNeeded:!0,menuWrapperSelector:"body",menuInjectMethod:"prepend"},s[l].prototype.open=function(){if(!this.vars.opened){var e=this;this._openSetup(),setTimeout((function(){e._openFinish()}),this.conf.openingInterval),this.trigger("open")}},s[l].prototype._openSetup=function(){var e=this,n=this.opts[c];this.closeAllOthers(),r.$page.each((function(){s(this).data(i.style,s(this).attr("style")||"")})),r.$wndw.trigger(o.resize+"-"+c,[!0]);var t=[a.opened];n.blockUI&&t.push(a.blocking),"modal"==n.blockUI&&t.push(a.modal),n.moveBackground&&t.push(a.background),"left"!=n.position&&t.push(a.mm(this.opts[c].position)),"back"!=n.zposition&&t.push(a.mm(this.opts[c].zposition)),this.opts.extensions&&t.push(this.opts.extensions),r.$html.addClass(t.join(" ")),setTimeout((function(){e.vars.opened=!0}),this.conf.openingInterval),this.$menu.addClass(a.current+" "+a.opened)},s[l].prototype._openFinish=function(){var e=this;this.__transitionend(r.$page.first(),(function(){e.trigger("opened")}),this.conf.transitionDuration),r.$html.addClass(a.opening),this.trigger("opening")},s[l].prototype.close=function(){if(this.vars.opened){var e=this;this.__transitionend(r.$page.first(),(function(){e.$menu.removeClass(a.current).removeClass(a.opened),r.$html.removeClass(a.opened).removeClass(a.blocking).removeClass(a.modal).removeClass(a.background).removeClass(a.mm(e.opts[c].position)).removeClass(a.mm(e.opts[c].zposition)),e.opts.extensions&&r.$html.removeClass(e.opts.extensions),r.$page.each((function(){s(this).attr("style",s(this).data(i.style))})),e.vars.opened=!1,e.trigger("closed")}),this.conf.transitionDuration),r.$html.removeClass(a.opening),this.trigger("close"),this.trigger("closing")}},s[l].prototype.closeAllOthers=function(){r.$allMenus.not(this.$menu).each((function(){var e=s(this).data(l);e&&e.close&&e.close()}))},s[l].prototype.setPage=function(e){var n=this,t=this.conf[c];e&&e.length||(e=r.$body.find(t.pageSelector),t.noPageSelector.length&&(e=e.not(t.noPageSelector.join(", "))),e.length>1&&t.wrapPageIfNeeded&&(e=e.wrapAll("<"+this.conf[c].pageNodetype+" />").parent())),e.each((function(){s(this).attr("id",s(this).attr("id")||n.__getUniqueId())})),e.addClass(a.page+" "+a.slideout),r.$page=e,this.trigger("setPage",e)},s[l].prototype["_initWindow_"+c]=function(){r.$wndw.off(o.keydown+"-"+c).on(o.keydown+"-"+c,(function(e){return r.$html.hasClass(a.opened)&&9==e.keyCode?(e.preventDefault(),!1):void 0}));var e=0;r.$wndw.off(o.resize+"-"+c).on(o.resize+"-"+c,(function(n,t){if(1==r.$page.length&&(t||r.$html.hasClass(a.opened))){var s=r.$wndw.height();(t||s!=e)&&(e=s,r.$page.css("minHeight",s))}}))},s[l].prototype._initBlocker=function(){var e=this;this.opts[c].blockUI&&(r.$blck||(r.$blck=s('<div id="'+a.blocker+'" class="'+a.slideout+'" />')),r.$blck.appendTo(r.$body).off(o.touchstart+"-"+c+" "+o.touchmove+"-"+c).on(o.touchstart+"-"+c+" "+o.touchmove+"-"+c,(function(e){e.preventDefault(),e.stopPropagation(),r.$blck.trigger(o.mousedown+"-"+c)})).off(o.mousedown+"-"+c).on(o.mousedown+"-"+c,(function(n){n.preventDefault(),r.$html.hasClass(a.modal)||(e.closeAllOthers(),e.close())})))},function(e){var n,t,s,a="mmenu",i="scrollBugFix";e[a].addons[i]={setup:function(){var o=this,r=this.opts[i];if(this.conf[i],s=e[a].glbl,e[a].support.touch&&this.opts.offCanvas&&this.opts.offCanvas.blockUI&&("boolean"==typeof r&&(r={fix:r}),"object"!=typeof r&&(r={}),(r=this.opts[i]=e.extend(!0,{},e[a].defaults[i],r)).fix)){var l=this.$menu.attr("id"),c=!1;this.bind("opening",(function(){this.$pnls.children("."+n.current).scrollTop(0)})),s.$docu.on(t.touchmove,(function(e){o.vars.opened&&e.preventDefault()})),s.$body.on(t.touchstart,"#"+l+"> ."+n.panels+"> ."+n.current,(function(e){o.vars.opened&&(c||(c=!0,0===e.currentTarget.scrollTop?e.currentTarget.scrollTop=1:e.currentTarget.scrollHeight===e.currentTarget.scrollTop+e.currentTarget.offsetHeight&&(e.currentTarget.scrollTop-=1),c=!1))})).on(t.touchmove,"#"+l+"> ."+n.panels+"> ."+n.current,(function(n){o.vars.opened&&e(this)[0].scrollHeight>e(this).innerHeight()&&n.stopPropagation()})),s.$wndw.on(t.orientationchange,(function(){o.$pnls.children("."+n.current).scrollTop(0).css({"-webkit-overflow-scrolling":"auto"}).css({"-webkit-overflow-scrolling":"touch"})}))}},add:function(){n=e[a]._c,e[a]._d,t=e[a]._e},clickAnchor:function(e,n){}},e[a].defaults[i]={fix:!0}}(d)}},function(e){e(e.s=2878)}]);
1
+ (self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[111],{2878:function(e,n,t){"use strict";t(9826),t(1539),t(2222),t(7327);var s,a=t(5685),i=(t(866),t(2026),t(3609)),o=t(3609),r=[{filter:"grayscale(100%)",label:"Grayscale"},{filter:"brightness(120%)",label:"High brightness"},{filter:"invert(100%)",label:"Inverted (dark mode)"},{filter:"contrast(120%)",label:"High contrast"}];i.extend(BookReader.defaultOptions,{enableMobileNav:!0,mobileNavTitle:"Internet Archive",mobileNavFullscreenOnly:!1}),BookReader.prototype.setup=(s=BookReader.prototype.setup,function(e){s.call(this,e),this.enableMobileNav=e.enableMobileNav,this.mobileNavTitle=e.mobileNavTitle,this.mobileNavFullscreenOnly=e.mobileNavFullscreenOnly,this.refs.$mmenu=null}),BookReader.prototype.initToolbar=function(e){return function(n,t){var s,i=this;if(this.enableMobileNav){var r=this.buildMobileDrawerElement();this.refs.$br.append(r),this.buildInfoDiv(this.$(".BRmobileInfo")),this.buildShareDiv(this.$(".BRmobileShare")),(s=r).mmenu({navbars:[{position:"top"}],navbar:{add:!0,title:this.mobileNavTitle,titleLink:"panel"},extensions:["panelshadow"]},{offCanvas:{wrapPageIfNeeded:!1,zposition:"next",pageSelector:this.el}});var c=s.find(".BRpageviewValue");s.data("mmenu").bind("opened",(function(){c.length&&c.val(window.location.href)})),r.find(".BRcheckbox-filters").on("click",(function(){return l(r,i)})),r.find(".DrawerLayoutButton.one_page_mode").on("click",(function(){return i.switchMode(i.constMode1up)})),r.find(".DrawerLayoutButton.two_page_mode").on("click",(function(){return i.switchMode(i.constMode2up)})),r.find(".DrawerLayoutButton.thumbnail_mode").on("click",(function(){return i.switchMode(i.constModeThumb)})),this.mobileNavFullscreenOnly?o(document.body).addClass("BRbodyMobileNavEnabledFullscreen"):o(document.body).addClass("BRbodyMobileNavEnabled"),this.refs.$mmenu=s}if(e.apply(this,arguments),this.enableMobileNav){this.$(".BRmobileHamburger").click((function(){s.data("mmenu").getInstance().vars.opened?s.data("mmenu").close():(s.data("mmenu").open(),i.trigger("mobileNavOpen"))}));var d=function(e){var n=o(window).width();s.data("mmenu").getInstance().vars.opened&&n>=800&&s.data("mmenu").close()};window.addEventListener("resize",a.debounce(d,900))}}}(BookReader.prototype.initToolbar),BookReader.prototype.buildToolbarElement=function(e){return function(){var n=e.call(this);if(this.enableMobileNav){var t=BookReader.util.escapeHTML(this.bookTitle),s='\n <span class="BRmobileHamburgerWrapper">\n <button class="BRmobileHamburger"></button>\n <span class="BRtoolbarMobileTitle" title="'.concat(t,'">').concat(t,"</span>\n </span>\n ");n.addClass("responsive").prepend(o(s))}return n}}(BookReader.prototype.buildToolbarElement),BookReader.prototype.buildMobileDrawerElement=function(){var e="";this.enableExperimentalControls&&(e='\n <p class="DrawerSettingsTitle">Visual Adjustment</p>\n <div class="BRcheckbox-group-filters">\n ',r.forEach((function(n,t){var s='\n <input type="checkbox" class="BRcheckbox-filters" id="filter'.concat(t,'">\n <label for="filter').concat(t,'" class="BRcheckbox-label-filters">').concat(n.label,"</label><br>\n \n ");e=e.concat(s)})),e=e.concat("</div>"));var n='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat("".concat(this.imagesBaseURL,"icon_gear.svg"),'" alt="settings-icon"/>\n </span>\n Settings\n </span>\n <div class=DrawerSettingsWrapper>\n <div class="DrawerSettingsLayoutWrapper">\n <button class="DrawerLayoutButton one_page_mode">\n <img src="',this.imagesBaseURL,'icon_one_page.svg" alt="Single Page"/>\n <br>\n One Page\n </button>\n <button class="DrawerLayoutButton two_page_mode TwoPagesButton">\n <img src="').concat(this.imagesBaseURL,'icon_two_pages.svg" alt="Two Pages"/>\n <br>\n Two Pages\n </button>\n <button class="DrawerLayoutButton thumbnail_mode">\n <img src="').concat(this.imagesBaseURL,'icon_thumbnails.svg" alt="Thumbnails"/>\n <br>\n Thumbnails\n </button>\n </div>\n <br>\n <div class="DrawerSettingsTitle">Zoom</div>\n <button class=\'BRicon zoom_out\'></button>\n <button class=\'BRicon zoom_in\'></button>\n <br style="clear:both"><br><br>\n ').concat(e,"\n </div>\n "),t='\n <span>\n <span class="DrawerIconWrapper ">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_info.svg" alt="info-icon"/>\n </span>\n About This Book\n </span>\n <div class="BRmobileInfo"></div>\n '),s='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_share.svg" alt="info-share"/>\n </span>\n Share This Book\n </span>\n <div class="BRmobileShare"></div>\n '),a='\n <nav id="BRmobileMenu" class="BRmobileMenu">\n <ul>\n <li class="BRmobileMenu__settings">'.concat(n,'</li>\n <li class="BRmobileMenu__moreInfoRow">').concat(t,'</li>\n <li class="BRmobileMenu__share">').concat(s,"</li>\n </ul>\n </nav>\n ");return o(a)},BookReader.prototype.$=function(e){return function(n){var t=e.call(this,n);return this.refs.$mmenu&&(t=t.add(this.refs.$mmenu.find(n))),t}}(BookReader.prototype.$);var l=function(e,n){var t="";o(".BRcheckbox-filters").each((function(e,s){n.refs.$br.removeClass("filter-applied"),o(s).is(":checked")&&(n.refs.$br.addClass(o(s).attr("filter-applied")),t+=r[e].filter)}));var s=o("#filtersStyle")[0]||document.createElement("style");s.id="filtersStyle",s.innerHTML=".BRpagecontainer img {\n filter: ".concat(t,";\n -webkit-filter: ").concat(t,";}"),document.body.appendChild(s)}},2026:function(e,n,t){var s,a,i,o,r=t(3609);o="navbars",(s=r)[i="mmenu"].addons[o]={setup:function(){var e=this,n=this.opts[o],t=this.conf[o];if(s[i].glbl,void 0!==n){n instanceof Array||(n=[n]);var r={};for(var l in s.each(n,(function(l){var c=n[l];"boolean"==typeof c&&c&&(c={}),"object"!=typeof c&&(c={}),void 0===c.content&&(c.content=["prev","title"]),c.content instanceof Array||(c.content=[c.content]);var d=(c=s.extend(!0,{},e.opts.navbar,c)).position,p=c.height;"number"!=typeof p&&(p=1),p=Math.min(4,Math.max(1,p)),"bottom"!=d&&(d="top"),r[d]||(r[d]=0),r[d]++;var h=s("<div />").addClass(a.navbar+" "+a.navbar+"-"+d+" "+a.navbar+"-"+d+"-"+r[d]+" "+a.navbar+"-size-"+p);r[d]+=p-1;for(var u=0,f=0,v=c.content.length;v>f;f++){var m=s[i].addons[o][c.content[f]]||!1;m?u+=m.call(e,h,c,t):((m=c.content[f])instanceof s||(m=s(c.content[f])),h.append(m))}(u+=Math.ceil(h.children().not("."+a.btn).length/p))>1&&h.addClass(a.navbar+"-content-"+u),h.children("."+a.btn).length&&h.addClass(a.hasbtns),h.prependTo(e.$menu)})),r)e.$menu.addClass(a.hasnavbar+"-"+l+"-"+r[l])}},add:function(){a=s[i]._c,s[i]._d,s[i]._e,a.add("close hasbtns")},clickAnchor:function(e,n){}},s[i].configuration[o]={breadcrumbSeparator:"/"},s[i].configuration.classNames[o]={},function(e){var n="mmenu";e[n].addons.navbars.breadcrumbs=function(t,s,a){var i=e[n]._c,o=e[n]._d;i.add("breadcrumbs separator");var r=e('<span class="'+i.breadcrumbs+'" />').appendTo(t);this.bind("init",(function(n){n.removeClass(i.hasnavbar).each((function(){for(var n=[],t=e(this),s=e('<span class="'+i.breadcrumbs+'"></span>'),r=e(this).children().first(),l=!0;r&&r.length;){r.is("."+i.panel)||(r=r.closest("."+i.panel));var c=r.children("."+i.navbar).children("."+i.title).text();n.unshift(l?"<span>"+c+"</span>":'<a href="#'+r.attr("id")+'">'+c+"</a>"),l=!1,r=r.data(o.parent)}s.append(n.join('<span class="'+i.separator+'">'+a.breadcrumbSeparator+"</span>")).appendTo(t.children("."+i.navbar))}))}));var l=function(){r.html(this.$pnls.children("."+i.current).children("."+i.navbar).children("."+i.breadcrumbs).html())};return this.bind("openPanel",l),this.bind("init",l),0}}(r),function(e){var n="mmenu";e[n].addons.navbars.close=function(t,s){var a=e[n]._c,i=e[n].glbl,o=e('<a class="'+a.close+" "+a.btn+'" href="#" />').appendTo(t),r=function(e){o.attr("href","#"+e.attr("id"))};return r.call(this,i.$page),this.bind("setPage",r),-1}}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].next=function(s,a){var i,o,r=e[n]._c,l=e('<a class="'+r.next+" "+r.btn+'" href="#" />').appendTo(s),c=function(e){var n=(e=e||this.$pnls.children("."+r.current)).find("."+this.conf.classNames[t].panelNext);i=n.attr("href"),o=n.html(),l[i?"attr":"removeAttr"]("href",i),l[i||o?"removeClass":"addClass"](r.hidden),l.html(o)};return this.bind("openPanel",c),this.bind("init",(function(){c.call(this)})),-1},e[n].configuration.classNames[t].panelNext="Next"}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].prev=function(s,a){var i=e[n]._c,o=e('<a class="'+i.prev+" "+i.btn+'" href="#" />').appendTo(s);this.bind("init",(function(e){e.removeClass(i.hasnavbar).children("."+i.navbar).addClass(i.hidden)}));var r,l,c=function(e){if(!(e=e||this.$pnls.children("."+i.current)).hasClass(i.vertical)){var n=e.find("."+this.conf.classNames[t].panelPrev);n.length||(n=e.children("."+i.navbar).children("."+i.prev)),r=n.attr("href"),l=n.html(),o[r?"attr":"removeAttr"]("href",r),o[r||l?"removeClass":"addClass"](i.hidden),o.html(l)}};return this.bind("openPanel",c),this.bind("init",(function(){c.call(this)})),-1},e[n].configuration.classNames[t].panelPrev="Prev"}(r),function(e){var n="mmenu";e[n].addons.navbars.searchfield=function(t,s){var a=e[n]._c,i=e('<div class="'+a.search+'" />').appendTo(t);return"object"!=typeof this.opts.searchfield&&(this.opts.searchfield={}),this.opts.searchfield.add=!0,this.opts.searchfield.addTo=i,0}}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].title=function(s,a){var i,o,r=e[n]._c,l=e('<a class="'+r.title+'" />').appendTo(s),c=function(e){if(!(e=e||this.$pnls.children("."+r.current)).hasClass(r.vertical)){var n=e.find("."+this.conf.classNames[t].panelTitle);n.length||(n=e.children("."+r.navbar).children("."+r.title)),i=n.attr("href"),o=n.html()||a.title,l[i?"attr":"removeAttr"]("href",i),l[i||o?"removeClass":"addClass"](r.hidden),l.html(o)}};return this.bind("openPanel",c),this.bind("init",(function(e){c.call(this)})),0},e[n].configuration.classNames[t].panelTitle="Title"}(r)},866:function(e,n,t){var s,a,i,o,r,l,c,d=t(3609);!function(e){function n(){e[o].glbl||(i={$wndw:e(window),$docu:e(document),$html:e("html"),$body:e("body")},t={},s={},a={},e.each([t,s,a],(function(e,n){n.add=function(e){for(var t=0,s=(e=e.split(" ")).length;s>t;t++)n[e[t]]=n.mm(e[t])}})),t.mm=function(e){return"mm-"+e},t.add("wrapper menu panels panel nopanel current highest opened subopened navbar hasnavbar title btn prev next listview nolistview inset vertical selected divider spacer hidden fullsubopen"),t.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},s.mm=function(e){return"mm-"+e},s.add("parent sub"),a.mm=function(e){return e+".mm"},a.add("transitionend webkitTransitionEnd click scroll keydown mousedown mouseup touchstart touchmove touchend orientationchange"),e[o]._c=t,e[o]._d=s,e[o]._e=a,e[o].glbl=i)}var t,s,a,i,o="mmenu",r="5.6.4";e[o]&&e[o].version>r||(e[o]=function(e,n,t){this.$menu=e,this._api=["bind","init","update","setSelected","getInstance","openPanel","closePanel","closeAllPanels"],this.opts=n,this.conf=t,this.vars={},this.cbck={},"function"==typeof this.___deprecated&&this.___deprecated(),this._initMenu(),this._initAnchors();var s=this.$pnls.children();return this._initAddons(),this.init(s),"function"==typeof this.___debug&&this.___debug(),this},e[o].version=r,e[o].addons={},e[o].uniqueId=0,e[o].defaults={extensions:[],navbar:{add:!0,title:"Menu",titleLink:"panel"},onClick:{setSelected:!0},slidingSubmenus:!0},e[o].configuration={classNames:{divider:"Divider",inset:"Inset",panel:"Panel",selected:"Selected",spacer:"Spacer",vertical:"Vertical"},clone:!1,openingInterval:25,panelNodetype:"ul, ol, div",transitionDuration:400},e[o].prototype={init:function(e){e=e.not("."+t.nopanel),e=this._initPanels(e),this.trigger("init",e),this.trigger("update")},update:function(){this.trigger("update")},setSelected:function(e){this.$menu.find("."+t.listview).children().removeClass(t.selected),e.addClass(t.selected),this.trigger("setSelected",e)},openPanel:function(n){var s=n.parent(),a=this;if(s.hasClass(t.vertical)){var i=s.parents("."+t.subopened);if(i.length)return void this.openPanel(i.first());s.addClass(t.opened),this.trigger("openPanel",n),this.trigger("openingPanel",n),this.trigger("openedPanel",n)}else{if(n.hasClass(t.current))return;var r=this.$pnls.children("."+t.panel),l=r.filter("."+t.current);r.removeClass(t.highest).removeClass(t.current).not(n).not(l).not("."+t.vertical).addClass(t.hidden),e[o].support.csstransitions||l.addClass(t.hidden),n.hasClass(t.opened)?n.nextAll("."+t.opened).addClass(t.highest).removeClass(t.opened).removeClass(t.subopened):(n.addClass(t.highest),l.addClass(t.subopened)),n.removeClass(t.hidden).addClass(t.current),a.trigger("openPanel",n),setTimeout((function(){n.removeClass(t.subopened).addClass(t.opened),a.trigger("openingPanel",n),a.__transitionend(n,(function(){a.trigger("openedPanel",n)}),a.conf.transitionDuration)}),this.conf.openingInterval)}},closePanel:function(e){var n=e.parent();n.hasClass(t.vertical)&&(n.removeClass(t.opened),this.trigger("closePanel",e),this.trigger("closingPanel",e),this.trigger("closedPanel",e))},closeAllPanels:function(){this.$menu.find("."+t.listview).children().removeClass(t.selected).filter("."+t.vertical).removeClass(t.opened);var e=this.$pnls.children("."+t.panel).first();this.$pnls.children("."+t.panel).not(e).removeClass(t.subopened).removeClass(t.opened).removeClass(t.current).removeClass(t.highest).addClass(t.hidden),this.openPanel(e)},togglePanel:function(e){var n=e.parent();n.hasClass(t.vertical)&&this[n.hasClass(t.opened)?"closePanel":"openPanel"](e)},getInstance:function(){return this},bind:function(e,n){this.cbck[e]=this.cbck[e]||[],this.cbck[e].push(n)},trigger:function(){var e=this,n=Array.prototype.slice.call(arguments),t=n.shift();if(this.cbck[t])for(var s=0,a=this.cbck[t].length;a>s;s++)this.cbck[t][s].apply(e,n)},_initMenu:function(){this.$menu.attr("id",this.$menu.attr("id")||this.__getUniqueId()),this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("[id]")).filter("[id]").each((function(){e(this).attr("id",t.mm(e(this).attr("id")))}))),this.$menu.contents().each((function(){3==e(this)[0].nodeType&&e(this).remove()})),this.$pnls=e('<div class="'+t.panels+'" />').append(this.$menu.children(this.conf.panelNodetype)).prependTo(this.$menu),this.$menu.parent().addClass(t.wrapper);var n=[t.menu];this.opts.slidingSubmenus||n.push(t.vertical),this.opts.extensions=this.opts.extensions.length?"mm-"+this.opts.extensions.join(" mm-"):"",this.opts.extensions&&n.push(this.opts.extensions),this.$menu.addClass(n.join(" "))},_initPanels:function(n){var a=this,i=this.__findAddBack(n,"ul, ol");this.__refactorClass(i,this.conf.classNames.inset,"inset").addClass(t.nolistview+" "+t.nopanel),i.not("."+t.nolistview).addClass(t.listview);var o=this.__findAddBack(n,"."+t.listview).children();this.__refactorClass(o,this.conf.classNames.selected,"selected"),this.__refactorClass(o,this.conf.classNames.divider,"divider"),this.__refactorClass(o,this.conf.classNames.spacer,"spacer"),this.__refactorClass(this.__findAddBack(n,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel");var r=e(),l=n.add(n.find("."+t.panel)).add(this.__findAddBack(n,"."+t.listview).children().children(this.conf.panelNodetype)).not("."+t.nopanel);this.__refactorClass(l,this.conf.classNames.vertical,"vertical"),this.opts.slidingSubmenus||l.addClass(t.vertical),l.each((function(){var n=e(this),s=n;n.is("ul, ol")?(n.wrap('<div class="'+t.panel+'" />'),s=n.parent()):s.addClass(t.panel);var i=n.attr("id");n.removeAttr("id"),s.attr("id",i||a.__getUniqueId()),n.hasClass(t.vertical)&&(n.removeClass(a.conf.classNames.vertical),s.add(s.parent()).addClass(t.vertical)),r=r.add(s)}));var c=e("."+t.panel,this.$menu);r.each((function(n){var i,o,r=e(this),l=r.parent(),c=l.children("a, span").first();if(l.is("."+t.panels)||(l.data(s.sub,r),r.data(s.parent,l)),l.children("."+t.next).length||l.parent().is("."+t.listview)&&(i=r.attr("id"),o=e('<a class="'+t.next+'" href="#'+i+'" data-target="#'+i+'" />').insertBefore(c),c.is("span")&&o.addClass(t.fullsubopen)),!r.children("."+t.navbar).length&&!l.hasClass(t.vertical)){l.parent().is("."+t.listview)?l=l.closest("."+t.panel):(c=l.closest("."+t.panel).find('a[href="#'+r.attr("id")+'"]').first(),l=c.closest("."+t.panel));var d=!1,p=e('<div class="'+t.navbar+'" />');if(a.opts.navbar.add&&r.addClass(t.hasnavbar),l.length){switch(i=l.attr("id"),a.opts.navbar.titleLink){case"anchor":d=c.attr("href");break;case"panel":case"parent":d="#"+i;break;default:d=!1}p.append('<a class="'+t.btn+" "+t.prev+'" href="#'+i+'" data-target="#'+i+'" />').append(e('<a class="'+t.title+'"'+(d?' href="'+d+'"':"")+" />").text(c.text())).prependTo(r)}else a.opts.navbar.title&&p.append('<a class="'+t.title+'">'+a.opts.navbar.title+"</a>").prependTo(r)}}));var d=this.__findAddBack(n,"."+t.listview).children("."+t.selected).removeClass(t.selected).last().addClass(t.selected);d.add(d.parentsUntil("."+t.menu,"li")).filter("."+t.vertical).addClass(t.opened).end().each((function(){e(this).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).addClass(t.subopened)})),d.children("."+t.panel).not("."+t.vertical).addClass(t.opened).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).addClass(t.subopened);var p=c.filter("."+t.opened);return p.length||(p=r.first()),p.addClass(t.opened).last().addClass(t.current),r.not("."+t.vertical).not(p.last()).addClass(t.hidden).end().filter((function(){return!e(this).parent().hasClass(t.panels)})).appendTo(this.$pnls),r},_initAnchors:function(){var n=this;i.$body.on(a.click+"-oncanvas","a[href]",(function(s){var a=e(this),i=!1,r=n.$menu.find(a).length;for(var l in e[o].addons)if(e[o].addons[l].clickAnchor.call(n,a,r)){i=!0;break}var c=a.attr("href");if(!i&&r&&c.length>1&&"#"==c.slice(0,1))try{var d=e(c,n.$menu);d.is("."+t.panel)&&(i=!0,n[a.parent().hasClass(t.vertical)?"togglePanel":"openPanel"](d))}catch(e){}if(i&&s.preventDefault(),!i&&r&&a.is("."+t.listview+" > li > a")&&!a.is('[rel="external"]')&&!a.is('[target="_blank"]')){n.__valueOrFn(n.opts.onClick.setSelected,a)&&n.setSelected(e(s.target).parent());var p=n.__valueOrFn(n.opts.onClick.preventDefault,a,"#"==c.slice(0,1));p&&s.preventDefault(),n.__valueOrFn(n.opts.onClick.close,a,p)&&n.close()}}))},_initAddons:function(){var n;for(n in e[o].addons)e[o].addons[n].add.call(this),e[o].addons[n].add=function(){};for(n in e[o].addons)e[o].addons[n].setup.call(this)},_getOriginalMenuId:function(){var e=this.$menu.attr("id");return e&&e.length&&this.conf.clone&&(e=t.umm(e)),e},__api:function(){var n=this,t={};return e.each(this._api,(function(e){var s=this;t[s]=function(){var e=n[s].apply(n,arguments);return void 0===e?t:e}})),t},__valueOrFn:function(e,n,t){return"function"==typeof e?e.call(n[0]):void 0===e&&void 0!==t?t:e},__refactorClass:function(e,n,s){return e.filter("."+n).removeClass(n).addClass(t[s])},__findAddBack:function(e,n){return e.find(n).add(e.filter(n))},__filterListItems:function(e){return e.not("."+t.divider).not("."+t.hidden)},__transitionend:function(e,n,t){var s=!1,i=function(){s||n.call(e[0]),s=!0};e.one(a.transitionend,i),e.one(a.webkitTransitionEnd,i),setTimeout(i,1.1*t)},__getUniqueId:function(){return t.mm(e[o].uniqueId++)}},e.fn[o]=function(t,s){return n(),t=e.extend(!0,{},e[o].defaults,t),s=e.extend(!0,{},e[o].configuration,s),this.each((function(){var n=e(this);if(!n.data(o)){var a=new e[o](n,t,s);a.$menu.data(o,a.__api())}}))},e[o].support={touch:"ontouchstart"in window||navigator.msMaxTouchPoints||!1,csstransitions:function(){if("undefined"!=typeof Modernizr&&void 0!==Modernizr.csstransitions)return Modernizr.csstransitions;var e=(document.body||document.documentElement).style,n="transition";if("string"==typeof e[n])return!0;var t=["Moz","webkit","Webkit","Khtml","O","ms"];n=n.charAt(0).toUpperCase()+n.substr(1);for(var s=0;s<t.length;s++)if("string"==typeof e[t[s]+n])return!0;return!1}()})}(d),c="offCanvas",(s=d)[l="mmenu"].addons[c]={setup:function(){if(this.opts[c]){var e=this.opts[c],n=this.conf[c];r=s[l].glbl,this._api=s.merge(this._api,["open","close","setPage"]),("top"==e.position||"bottom"==e.position)&&(e.zposition="front"),"string"!=typeof n.pageSelector&&(n.pageSelector="> "+n.pageNodetype),r.$allMenus=(r.$allMenus||s()).add(this.$menu),this.vars.opened=!1;var t=[a.offcanvas];"left"!=e.position&&t.push(a.mm(e.position)),"back"!=e.zposition&&t.push(a.mm(e.zposition)),this.$menu.addClass(t.join(" ")).parent().removeClass(a.wrapper),this.setPage(r.$page),this._initBlocker(),this["_initWindow_"+c](),this.$menu[n.menuInjectMethod+"To"](n.menuWrapperSelector);var i=window.location.hash;if(i){var o=this._getOriginalMenuId();o&&o==i.slice(1)&&this.open()}}},add:function(){a=s[l]._c,i=s[l]._d,o=s[l]._e,a.add("offcanvas slideout blocking modal background opening blocker page"),i.add("style"),o.add("resize")},clickAnchor:function(e,n){if(!this.opts[c])return!1;var t=this._getOriginalMenuId();return t&&e.is('[href="#'+t+'"]')?(this.open(),!0):r.$page?!(!(t=r.$page.first().attr("id"))||!e.is('[href="#'+t+'"]')||(this.close(),0)):void 0}},s[l].defaults[c]={position:"left",zposition:"back",blockUI:!0,moveBackground:!0},s[l].configuration[c]={pageNodetype:"div",pageSelector:null,noPageSelector:[],wrapPageIfNeeded:!0,menuWrapperSelector:"body",menuInjectMethod:"prepend"},s[l].prototype.open=function(){if(!this.vars.opened){var e=this;this._openSetup(),setTimeout((function(){e._openFinish()}),this.conf.openingInterval),this.trigger("open")}},s[l].prototype._openSetup=function(){var e=this,n=this.opts[c];this.closeAllOthers(),r.$page.each((function(){s(this).data(i.style,s(this).attr("style")||"")})),r.$wndw.trigger(o.resize+"-"+c,[!0]);var t=[a.opened];n.blockUI&&t.push(a.blocking),"modal"==n.blockUI&&t.push(a.modal),n.moveBackground&&t.push(a.background),"left"!=n.position&&t.push(a.mm(this.opts[c].position)),"back"!=n.zposition&&t.push(a.mm(this.opts[c].zposition)),this.opts.extensions&&t.push(this.opts.extensions),r.$html.addClass(t.join(" ")),setTimeout((function(){e.vars.opened=!0}),this.conf.openingInterval),this.$menu.addClass(a.current+" "+a.opened)},s[l].prototype._openFinish=function(){var e=this;this.__transitionend(r.$page.first(),(function(){e.trigger("opened")}),this.conf.transitionDuration),r.$html.addClass(a.opening),this.trigger("opening")},s[l].prototype.close=function(){if(this.vars.opened){var e=this;this.__transitionend(r.$page.first(),(function(){e.$menu.removeClass(a.current).removeClass(a.opened),r.$html.removeClass(a.opened).removeClass(a.blocking).removeClass(a.modal).removeClass(a.background).removeClass(a.mm(e.opts[c].position)).removeClass(a.mm(e.opts[c].zposition)),e.opts.extensions&&r.$html.removeClass(e.opts.extensions),r.$page.each((function(){s(this).attr("style",s(this).data(i.style))})),e.vars.opened=!1,e.trigger("closed")}),this.conf.transitionDuration),r.$html.removeClass(a.opening),this.trigger("close"),this.trigger("closing")}},s[l].prototype.closeAllOthers=function(){r.$allMenus.not(this.$menu).each((function(){var e=s(this).data(l);e&&e.close&&e.close()}))},s[l].prototype.setPage=function(e){var n=this,t=this.conf[c];e&&e.length||(e=r.$body.find(t.pageSelector),t.noPageSelector.length&&(e=e.not(t.noPageSelector.join(", "))),e.length>1&&t.wrapPageIfNeeded&&(e=e.wrapAll("<"+this.conf[c].pageNodetype+" />").parent())),e.each((function(){s(this).attr("id",s(this).attr("id")||n.__getUniqueId())})),e.addClass(a.page+" "+a.slideout),r.$page=e,this.trigger("setPage",e)},s[l].prototype["_initWindow_"+c]=function(){r.$wndw.off(o.keydown+"-"+c).on(o.keydown+"-"+c,(function(e){return r.$html.hasClass(a.opened)&&9==e.keyCode?(e.preventDefault(),!1):void 0}));var e=0;r.$wndw.off(o.resize+"-"+c).on(o.resize+"-"+c,(function(n,t){if(1==r.$page.length&&(t||r.$html.hasClass(a.opened))){var s=r.$wndw.height();(t||s!=e)&&(e=s,r.$page.css("minHeight",s))}}))},s[l].prototype._initBlocker=function(){var e=this;this.opts[c].blockUI&&(r.$blck||(r.$blck=s('<div id="'+a.blocker+'" class="'+a.slideout+'" />')),r.$blck.appendTo(r.$body).off(o.touchstart+"-"+c+" "+o.touchmove+"-"+c).on(o.touchstart+"-"+c+" "+o.touchmove+"-"+c,(function(e){e.preventDefault(),e.stopPropagation(),r.$blck.trigger(o.mousedown+"-"+c)})).off(o.mousedown+"-"+c).on(o.mousedown+"-"+c,(function(n){n.preventDefault(),r.$html.hasClass(a.modal)||(e.closeAllOthers(),e.close())})))},function(e){var n,t,s,a="mmenu",i="scrollBugFix";e[a].addons[i]={setup:function(){var o=this,r=this.opts[i];if(this.conf[i],s=e[a].glbl,e[a].support.touch&&this.opts.offCanvas&&this.opts.offCanvas.blockUI&&("boolean"==typeof r&&(r={fix:r}),"object"!=typeof r&&(r={}),(r=this.opts[i]=e.extend(!0,{},e[a].defaults[i],r)).fix)){var l=this.$menu.attr("id"),c=!1;this.bind("opening",(function(){this.$pnls.children("."+n.current).scrollTop(0)})),s.$docu.on(t.touchmove,(function(e){o.vars.opened&&e.preventDefault()})),s.$body.on(t.touchstart,"#"+l+"> ."+n.panels+"> ."+n.current,(function(e){o.vars.opened&&(c||(c=!0,0===e.currentTarget.scrollTop?e.currentTarget.scrollTop=1:e.currentTarget.scrollHeight===e.currentTarget.scrollTop+e.currentTarget.offsetHeight&&(e.currentTarget.scrollTop-=1),c=!1))})).on(t.touchmove,"#"+l+"> ."+n.panels+"> ."+n.current,(function(n){o.vars.opened&&e(this)[0].scrollHeight>e(this).innerHeight()&&n.stopPropagation()})),s.$wndw.on(t.orientationchange,(function(){o.$pnls.children("."+n.current).scrollTop(0).css({"-webkit-overflow-scrolling":"auto"}).css({"-webkit-overflow-scrolling":"touch"})}))}},add:function(){n=e[a]._c,e[a]._d,t=e[a]._e},clickAnchor:function(e,n){}},e[a].defaults[i]={fix:!0}}(d)}},function(e){e(e.s=2878)}]);
2
2
  //# sourceMappingURL=plugin.mobile_nav.js.map