@internetarchive/bookreader 5.0.0-24-sortingstate → 5.0.0-25-02

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. package/BookReader/BookReader.css +4 -0
  2. package/BookReader/BookReader.js +2 -32148
  3. package/BookReader/BookReader.js.map +1 -1
  4. package/BookReader/bookreader-component-bundle.js +1286 -11261
  5. package/BookReader/bookreader-component-bundle.js.map +1 -1
  6. package/BookReader/icons/1up.svg +1 -12
  7. package/BookReader/icons/2up.svg +1 -15
  8. package/BookReader/icons/advance.svg +3 -26
  9. package/BookReader/icons/chevron-right.svg +1 -1
  10. package/BookReader/icons/close-circle-dark.svg +1 -1
  11. package/BookReader/icons/close-circle.svg +1 -1
  12. package/BookReader/icons/fullscreen.svg +1 -17
  13. package/BookReader/icons/fullscreen_exit.svg +1 -17
  14. package/BookReader/icons/hamburger.svg +1 -15
  15. package/BookReader/icons/left-arrow.svg +1 -12
  16. package/BookReader/icons/magnify-minus.svg +1 -16
  17. package/BookReader/icons/magnify-plus.svg +1 -17
  18. package/BookReader/icons/magnify.svg +1 -15
  19. package/BookReader/icons/pause.svg +1 -23
  20. package/BookReader/icons/play.svg +1 -22
  21. package/BookReader/icons/playback-speed.svg +1 -34
  22. package/BookReader/icons/read-aloud.svg +1 -22
  23. package/BookReader/icons/review.svg +3 -22
  24. package/BookReader/icons/thumbnails.svg +1 -17
  25. package/BookReader/icons/voice.svg +1 -1
  26. package/BookReader/icons/volume-full.svg +1 -22
  27. package/BookReader/images/BRicons.svg +5 -94
  28. package/BookReader/images/books_graphic.svg +1 -177
  29. package/BookReader/images/icon_book.svg +1 -12
  30. package/BookReader/images/icon_bookmark.svg +1 -12
  31. package/BookReader/images/icon_gear.svg +1 -14
  32. package/BookReader/images/icon_hamburger.svg +1 -20
  33. package/BookReader/images/icon_home.svg +1 -21
  34. package/BookReader/images/icon_info.svg +1 -11
  35. package/BookReader/images/icon_one_page.svg +1 -8
  36. package/BookReader/images/icon_pause.svg +1 -1
  37. package/BookReader/images/icon_play.svg +1 -1
  38. package/BookReader/images/icon_playback-rate.svg +1 -15
  39. package/BookReader/images/icon_search_button.svg +1 -8
  40. package/BookReader/images/icon_share.svg +1 -9
  41. package/BookReader/images/icon_skip-ahead.svg +1 -6
  42. package/BookReader/images/icon_skip-back.svg +2 -13
  43. package/BookReader/images/icon_speaker.svg +1 -18
  44. package/BookReader/images/icon_speaker_open.svg +1 -10
  45. package/BookReader/images/icon_thumbnails.svg +1 -12
  46. package/BookReader/images/icon_toc.svg +1 -5
  47. package/BookReader/images/icon_two_pages.svg +1 -9
  48. package/BookReader/images/marker_chap-off.svg +1 -11
  49. package/BookReader/images/marker_chap-on.svg +1 -11
  50. package/BookReader/images/marker_srch-on.svg +1 -11
  51. package/BookReader/jquery-1.10.1.js +2 -108
  52. package/BookReader/plugins/plugin.archive_analytics.js +1 -170
  53. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  54. package/BookReader/plugins/plugin.autoplay.js +1 -163
  55. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  56. package/BookReader/plugins/plugin.chapters.js +1 -333
  57. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  58. package/BookReader/plugins/plugin.iframe.js +1 -72
  59. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  60. package/BookReader/plugins/plugin.mobile_nav.js +1 -332
  61. package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
  62. package/BookReader/plugins/plugin.resume.js +1 -241
  63. package/BookReader/plugins/plugin.resume.js.map +1 -1
  64. package/BookReader/plugins/plugin.search.js +1 -1263
  65. package/BookReader/plugins/plugin.search.js.map +1 -1
  66. package/BookReader/plugins/plugin.text_selection.js +1 -839
  67. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  68. package/BookReader/plugins/plugin.tts.js +2 -9114
  69. package/BookReader/plugins/plugin.tts.js.map +1 -1
  70. package/BookReader/plugins/plugin.url.js +1 -750
  71. package/BookReader/plugins/plugin.url.js.map +1 -1
  72. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -326
  73. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  74. package/BookReader/webcomponents-bundle.js +2 -411
  75. package/BookReader/webcomponents-bundle.js.map +1 -1
  76. package/package.json +1 -1
  77. package/src/BookNavigator/volumes/volumes-provider.js +9 -39
  78. package/src/BookReader.js +0 -4
  79. package/src/css/_controls.scss +4 -0
  80. package/src/plugins/plugin.url.js +2 -209
  81. package/tests/jest/plugins/plugin.url.test.js +1 -160
  82. package/tests/karma/BookNavigator/volumes/volumes-provider.test.js +6 -6
  83. package/.nvmrc +0 -1
@@ -1,751 +1,2 @@
1
- (self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.url.js"],{
2
-
3
- /***/ "./src/plugins/plugin.url.js":
4
- /*!***********************************!*\
5
- !*** ./src/plugins/plugin.url.js ***!
6
- \***********************************/
7
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8
-
9
- "use strict";
10
- __webpack_require__.r(__webpack_exports__);
11
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12
- /* harmony export */ "UrlPlugin": function() { return /* binding */ UrlPlugin; },
13
- /* harmony export */ "BookreaderUrlPlugin": function() { return /* binding */ BookreaderUrlPlugin; }
14
- /* harmony export */ });
15
- /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "./node_modules/core-js/modules/es.array.reduce.js");
16
- /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_0__);
17
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js");
18
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__);
19
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js");
20
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2__);
21
- /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js");
22
- /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3__);
23
- /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js");
24
- /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__);
25
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");
26
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__);
27
- /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js");
28
- /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__);
29
- /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
30
- /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7__);
31
- /* harmony import */ var core_js_modules_web_url_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.url.js */ "./node_modules/core-js/modules/web.url.js");
32
- /* harmony import */ var core_js_modules_web_url_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url_js__WEBPACK_IMPORTED_MODULE_8__);
33
- /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
34
- /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_9__);
35
- /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js");
36
- /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_10__);
37
- /* harmony import */ var core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.array.find.js */ "./node_modules/core-js/modules/es.array.find.js");
38
- /* harmony import */ var core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_11__);
39
- /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
40
- /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__);
41
- /* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js");
42
- /* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_13__);
43
- /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js");
44
- /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_14__);
45
- /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js");
46
- /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_15__);
47
- /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js");
48
- /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_16__);
49
- /* harmony import */ var core_js_modules_es_object_from_entries_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.object.from-entries.js */ "./node_modules/core-js/modules/es.object.from-entries.js");
50
- /* harmony import */ var core_js_modules_es_object_from_entries_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_from_entries_js__WEBPACK_IMPORTED_MODULE_17__);
51
- /* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.string.match.js */ "./node_modules/core-js/modules/es.string.match.js");
52
- /* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_18__);
53
- /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.string.split.js */ "./node_modules/core-js/modules/es.string.split.js");
54
- /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_19__);
55
- /* harmony import */ var core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.object.entries.js */ "./node_modules/core-js/modules/es.object.entries.js");
56
- /* harmony import */ var core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_20__);
57
- /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js");
58
- /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_21__);
59
- /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js");
60
- /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_22__);
61
- /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js");
62
- /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_23__);
63
- /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js");
64
- /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_24__);
65
- /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js");
66
- /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_25__);
67
- /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
68
- /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_26__);
69
- /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js");
70
- /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_27__);
71
- /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js");
72
- /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_28__);
73
- /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");
74
- /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_29__);
75
- /* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery");
76
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
77
-
78
- function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
79
-
80
- function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
81
-
82
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
83
-
84
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
85
-
86
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
87
-
88
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
89
-
90
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
91
-
92
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
93
-
94
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
95
-
96
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
97
-
98
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
99
-
100
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
101
-
102
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
103
-
104
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
105
-
106
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
107
-
108
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
109
-
110
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
111
-
112
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
- /* global BookReader */
146
-
147
- /**
148
- * Plugin for URL management in BookReader
149
- * Note read more about the url "fragment" here:
150
- * https://openlibrary.org/dev/docs/bookurls
151
- */
152
- jQuery.extend(BookReader.defaultOptions, {
153
- enableUrlPlugin: true,
154
- bookId: '',
155
-
156
- /** @type {string} Defaults can be a urlFragment string */
157
- defaults: null,
158
- updateWindowTitle: false,
159
-
160
- /** @type {'history' | 'hash'} */
161
- urlMode: 'hash',
162
-
163
- /**
164
- * When using 'history' mode, this part of the URL is kept constant
165
- * @example /details/plato/
166
- */
167
- urlHistoryBasePath: '/',
168
-
169
- /** Only these params will be reflected onto the URL */
170
- urlTrackedParams: ['page', 'search', 'mode', 'region', 'highlight', 'view'],
171
-
172
- /** If true, don't update the URL when `page == n0 (eg "/page/n0")` */
173
- urlTrackIndex0: false
174
- });
175
- /** @override */
176
-
177
- BookReader.prototype.setup = function (super_) {
178
- return function (options) {
179
- super_.call(this, options);
180
- this.bookId = options.bookId;
181
- this.defaults = options.defaults;
182
- this.locationPollId = null;
183
- this.oldLocationHash = null;
184
- this.oldUserHash = null;
185
- };
186
- }(BookReader.prototype.setup);
187
- /** @override */
188
-
189
-
190
- BookReader.prototype.init = function (super_) {
191
- return function () {
192
- var _this = this;
193
-
194
- if (this.options.enableUrlPlugin) {
195
- this.bind(BookReader.eventNames.PostInit, function () {
196
- var _this$options = _this.options,
197
- updateWindowTitle = _this$options.updateWindowTitle,
198
- urlMode = _this$options.urlMode;
199
-
200
- if (updateWindowTitle) {
201
- document.title = _this.shortTitle(_this.bookTitle, 50);
202
- }
203
-
204
- if (urlMode === 'hash') {
205
- _this.urlStartLocationPolling();
206
- }
207
- });
208
- this.bind(BookReader.eventNames.fragmentChange, this.urlUpdateFragment.bind(this));
209
- }
210
-
211
- super_.call(this);
212
- };
213
- }(BookReader.prototype.init);
214
- /**
215
- * Returns a shortened version of the title with the maximum number of characters
216
- * @param {number} maximumCharacters
217
- * @return {string}
218
- */
219
-
220
-
221
- BookReader.prototype.shortTitle = function (maximumCharacters) {
222
- if (this.bookTitle.length < maximumCharacters) {
223
- return this.bookTitle;
224
- }
225
-
226
- var title = "".concat(this.bookTitle.substr(0, maximumCharacters - 3), "...");
227
- return title;
228
- };
229
- /**
230
- * Starts polling of window.location to see hash fragment changes
231
- */
232
-
233
-
234
- BookReader.prototype.urlStartLocationPolling = function () {
235
- var _this2 = this;
236
-
237
- this.oldLocationHash = this.urlReadFragment();
238
-
239
- if (this.locationPollId) {
240
- clearInterval(this.locationPollId);
241
- this.locationPollId = null;
242
- }
243
-
244
- var updateHash = function updateHash() {
245
- var newFragment = _this2.urlReadFragment();
246
-
247
- var hasFragmentChange = newFragment != _this2.oldLocationHash && newFragment != _this2.oldUserHash;
248
-
249
- if (!hasFragmentChange) {
250
- return;
251
- }
252
-
253
- var params = _this2.paramsFromFragment(newFragment);
254
-
255
- var updateParams = function updateParams() {
256
- return _this2.updateFromParams(params);
257
- };
258
-
259
- _this2.trigger(BookReader.eventNames.stop);
260
-
261
- if (_this2.animating) {
262
- // Queue change if animating
263
- if (_this2.autoStop) _this2.autoStop();
264
- _this2.animationFinishedCallback = updateParams;
265
- } else {
266
- // update immediately
267
- updateParams();
268
- }
269
-
270
- _this2.oldUserHash = newFragment;
271
- };
272
-
273
- this.locationPollId = setInterval(updateHash, 500);
274
- };
275
- /**
276
- * Update URL from the current parameters.
277
- * Call this instead of manually using window.location.replace
278
- */
279
-
280
-
281
- BookReader.prototype.urlUpdateFragment = function () {
282
- var allParams = this.paramsFromCurrent();
283
- var _this$options2 = this.options,
284
- urlMode = _this$options2.urlMode,
285
- urlTrackIndex0 = _this$options2.urlTrackIndex0,
286
- urlTrackedParams = _this$options2.urlTrackedParams;
287
-
288
- if (!urlTrackIndex0 && typeof allParams.index !== 'undefined' && allParams.index === 0) {
289
- delete allParams.index;
290
- delete allParams.page;
291
- }
292
-
293
- var params = urlTrackedParams.reduce(function (validParams, paramName) {
294
- if (paramName in allParams) {
295
- validParams[paramName] = allParams[paramName];
296
- }
297
-
298
- return validParams;
299
- }, {});
300
- var newFragment = this.fragmentFromParams(params, urlMode);
301
- var currFragment = this.urlReadFragment();
302
- var currQueryString = this.getLocationSearch();
303
- var newQueryString = this.queryStringFromParams(params, currQueryString, urlMode);
304
-
305
- if (currFragment === newFragment && currQueryString === newQueryString) {
306
- return;
307
- }
308
-
309
- if (urlMode === 'history') {
310
- if (window.history && window.history.replaceState) {
311
- var baseWithoutSlash = this.options.urlHistoryBasePath.replace(/\/+$/, '');
312
- var newFragmentWithSlash = newFragment === '' ? '' : "/".concat(newFragment);
313
- var newUrlPath = "".concat(baseWithoutSlash).concat(newFragmentWithSlash).concat(newQueryString);
314
- window.history.replaceState({}, null, newUrlPath);
315
- this.oldLocationHash = newFragment + newQueryString;
316
- }
317
- } else {
318
- var newQueryStringSearch = this.urlParamsFiltersOnlySearch(this.readQueryString());
319
- window.location.replace('#' + newFragment + newQueryStringSearch);
320
- this.oldLocationHash = newFragment + newQueryStringSearch;
321
- }
322
- };
323
- /**
324
- * @private
325
- * Filtering query parameters to select only book search param (?q=foo)
326
- This needs to be updated/URL system modified if future query params are to be added
327
- * @param {string} url
328
- * @return {string}
329
- * */
330
-
331
-
332
- BookReader.prototype.urlParamsFiltersOnlySearch = function (url) {
333
- var params = new URLSearchParams(url);
334
- return params.has('q') ? "?".concat(new URLSearchParams({
335
- q: params.get('q')
336
- })) : '';
337
- };
338
- /**
339
- * Will read either the hash or URL and return the bookreader fragment
340
- * @return {string}
341
- */
342
-
343
-
344
- BookReader.prototype.urlReadFragment = function () {
345
- var _this$options3 = this.options,
346
- urlMode = _this$options3.urlMode,
347
- urlHistoryBasePath = _this$options3.urlHistoryBasePath;
348
-
349
- if (urlMode === 'history') {
350
- return window.location.pathname.substr(urlHistoryBasePath.length);
351
- } else {
352
- return window.location.hash.substr(1);
353
- }
354
- };
355
- /**
356
- * Will read the hash return the bookreader fragment
357
- * @return {string}
358
- */
359
-
360
-
361
- BookReader.prototype.urlReadHashFragment = function () {
362
- return window.location.hash.substr(1);
363
- };
364
-
365
- var UrlPlugin = /*#__PURE__*/function () {
366
- function UrlPlugin() {
367
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
368
-
369
- _classCallCheck(this, UrlPlugin);
370
-
371
- this.bookReaderOptions = options;
372
- this.urlSchema = [{
373
- name: 'page',
374
- position: 'path',
375
- default: 'n0'
376
- }, {
377
- name: 'mode',
378
- position: 'path',
379
- default: '2up'
380
- }, {
381
- name: 'search',
382
- position: 'path',
383
- deprecated_for: 'q'
384
- }, {
385
- name: 'q',
386
- position: 'query_param'
387
- }, {
388
- name: 'sort',
389
- position: 'query_param'
390
- }, {
391
- name: 'view',
392
- position: 'query_param'
393
- }, {
394
- name: 'admin',
395
- position: 'query_param'
396
- }];
397
- this.urlState = {};
398
- this.urlMode = 'hash';
399
- this.urlHistoryBasePath = '/';
400
- this.urlLocationPollId = null;
401
- this.oldLocationHash = null;
402
- this.oldUserHash = null;
403
- }
404
- /**
405
- * Parse JSON object URL state to string format
406
- * Arrange path names in an order that it is positioned on the urlSchema
407
- * @param {object} urlState
408
- * @returns {string}
409
- */
410
-
411
-
412
- _createClass(UrlPlugin, [{
413
- key: "urlStateToUrlString",
414
- value: function urlStateToUrlString(urlSchema, urlState) {
415
- var searchParams = new URLSearchParams();
416
- var pathParams = {};
417
- Object.keys(urlState).forEach(function (key) {
418
- var _schema, _schema2;
419
-
420
- var schema = urlSchema.find(function (schema) {
421
- return schema.name === key;
422
- });
423
-
424
- if ((_schema = schema) !== null && _schema !== void 0 && _schema.deprecated_for) {
425
- schema = urlSchema.find(function (schemaKey) {
426
- return schemaKey.name === schema.deprecated_for;
427
- });
428
- }
429
-
430
- if (((_schema2 = schema) === null || _schema2 === void 0 ? void 0 : _schema2.position) == 'path') {
431
- var _schema3;
432
-
433
- pathParams[(_schema3 = schema) === null || _schema3 === void 0 ? void 0 : _schema3.name] = urlState[key];
434
- } else {
435
- var _schema4;
436
-
437
- searchParams.append(((_schema4 = schema) === null || _schema4 === void 0 ? void 0 : _schema4.name) || key, urlState[key]);
438
- }
439
- });
440
- var strPathParams = urlSchema.filter(function (s) {
441
- return s.position == 'path';
442
- }).map(function (schema) {
443
- return pathParams[schema.name] ? "".concat(schema.name, "/").concat(pathParams[schema.name]) : '';
444
- }).join('/');
445
- var strStrippedTrailingSlash = "".concat(strPathParams.replace(/\/$/, ''));
446
- var concatenatedPath = "/".concat(strStrippedTrailingSlash, "?").concat(searchParams.toString());
447
- return searchParams.toString() ? concatenatedPath : "/".concat(strStrippedTrailingSlash);
448
- }
449
- /**
450
- * Parse string URL and add it in the current urlState
451
- * Example:
452
- * /page/n7/mode/2up => {page: 'n7', mode: '2up'}
453
- * /page/n7/mode/2up/search/hello => {page: 'n7', mode: '2up', q: 'hello'}
454
- * @param {array} urlSchema
455
- * @param {string} str
456
- * @returns {object}
457
- */
458
-
459
- }, {
460
- key: "urlStringToUrlState",
461
- value: function urlStringToUrlState(urlSchema, str) {
462
- var urlState = {}; // Fetch searchParams from given {str}
463
- // Note: whole URL path is needed for URLSearchParams
464
-
465
- var urlPath = new URL(str, 'http://example.com');
466
- var urlSearchParamsObj = Object.fromEntries(urlPath.searchParams.entries());
467
- var urlStrSplitSlashObj = Object.fromEntries(urlPath.pathname.match(/[^\\/]+\/[^\\/]+/g).map(function (x) {
468
- return x.split('/');
469
- }));
470
-
471
- var doesKeyExists = function doesKeyExists(_object, _key) {
472
- return Object.keys(_object).some(function (value) {
473
- return value == _key;
474
- });
475
- };
476
-
477
- urlSchema.filter(function (schema) {
478
- return schema.position == 'path';
479
- }).forEach(function (schema) {
480
- if (!urlStrSplitSlashObj[schema.name] && schema.default) {
481
- return urlState[schema.name] = schema.default;
482
- }
483
-
484
- var hasPropertyKey = doesKeyExists(urlStrSplitSlashObj, schema.name);
485
- var hasDeprecatedKey = doesKeyExists(schema, 'deprecated_for') && hasPropertyKey;
486
- if (hasDeprecatedKey) return urlState[schema.deprecated_for] = urlStrSplitSlashObj[schema.name];
487
- if (hasPropertyKey) return urlState[schema.name] = urlStrSplitSlashObj[schema.name];
488
- }); // Add searchParams to urlState
489
- // Check if Object value is a Boolean and convert value to Boolean
490
- // Otherwise, return Object value
491
-
492
- var isBoolean = function isBoolean(value) {
493
- return value === 'true' || (value === 'false' ? false : value);
494
- };
495
-
496
- Object.entries(urlSearchParamsObj).forEach(function (_ref) {
497
- var _ref2 = _slicedToArray(_ref, 2),
498
- key = _ref2[0],
499
- value = _ref2[1];
500
-
501
- urlState[key] = isBoolean(value);
502
- });
503
- return urlState;
504
- }
505
- /**
506
- * Add or update key-value to the urlState
507
- * @param {string} key
508
- * @param {string} val
509
- */
510
-
511
- }, {
512
- key: "setUrlParam",
513
- value: function setUrlParam(key, value) {
514
- this.urlState[key] = value;
515
- this.pushToAddressBar();
516
- }
517
- /**
518
- * Delete key-value to the urlState
519
- * @param {string} key
520
- */
521
-
522
- }, {
523
- key: "removeUrlParam",
524
- value: function removeUrlParam(key) {
525
- delete this.urlState[key];
526
- this.pushToAddressBar();
527
- }
528
- /**
529
- * Get key-value from the urlState
530
- * @param {string} key
531
- * @return {string}
532
- */
533
-
534
- }, {
535
- key: "getUrlParam",
536
- value: function getUrlParam(key) {
537
- return this.urlState[key];
538
- }
539
- /**
540
- * Push URL params to addressbar
541
- */
542
-
543
- }, {
544
- key: "pushToAddressBar",
545
- value: function pushToAddressBar() {
546
- var urlStrPath = this.urlStateToUrlString(this.urlSchema, this.urlState);
547
-
548
- if (this.urlMode == 'history') {
549
- if (window.history && window.history.replaceState) {
550
- var newUrlPath = "".concat(this.urlHistoryBasePath).concat(urlStrPath);
551
- window.history.replaceState({}, null, newUrlPath);
552
- }
553
- } else {
554
- window.location.replace('#' + urlStrPath);
555
- }
556
-
557
- this.oldLocationHash = urlStrPath;
558
- }
559
- /**
560
- * Get the url and check if it has changed
561
- * If it was changeed, update the urlState
562
- */
563
-
564
- }, {
565
- key: "listenForHashChanges",
566
- value: function listenForHashChanges() {
567
- var _this3 = this;
568
-
569
- this.oldLocationHash = window.location.hash.substr(1);
570
-
571
- if (this.urlLocationPollId) {
572
- clearInterval(this.urlLocationPollId);
573
- this.urlLocationPollId = null;
574
- } // check if the URL changes
575
-
576
-
577
- var updateHash = function updateHash() {
578
- var newFragment = window.location.hash.substr(1);
579
- var hasFragmentChange = newFragment != _this3.oldLocationHash;
580
-
581
- if (!hasFragmentChange) {
582
- return;
583
- }
584
-
585
- _this3.urlState = _this3.urlStringToUrlState(newFragment);
586
- };
587
-
588
- this.urlLocationPollId = setInterval(updateHash, 500);
589
- }
590
- /**
591
- * Will read either the hash or URL and return the bookreader fragment
592
- * @param {string} location
593
- * @return {string}
594
- */
595
-
596
- }, {
597
- key: "pullFromAddressBar",
598
- value: function pullFromAddressBar(location) {
599
- var path = this.urlMode === 'history' ? location.substr(this.urlHistoryBasePath.length) : location.substr(1);
600
- this.urlState = this.urlStringToUrlState(this.urlSchema, path);
601
- }
602
- }]);
603
-
604
- return UrlPlugin;
605
- }();
606
- var BookreaderUrlPlugin = /*#__PURE__*/function (_BookReader) {
607
- _inherits(BookreaderUrlPlugin, _BookReader);
608
-
609
- var _super = _createSuper(BookreaderUrlPlugin);
610
-
611
- function BookreaderUrlPlugin() {
612
- _classCallCheck(this, BookreaderUrlPlugin);
613
-
614
- return _super.apply(this, arguments);
615
- }
616
-
617
- _createClass(BookreaderUrlPlugin, [{
618
- key: "init",
619
- value: function init() {
620
- var _this4 = this;
621
-
622
- if (this.options.enableUrlPlugin) {
623
- this.urlPlugin = new UrlPlugin(this.options);
624
- this.bind(BookReader.eventNames.PostInit, function () {
625
- var urlMode = _this4.options.urlMode;
626
-
627
- if (urlMode === 'hash') {
628
- _this4.urlPlugin.listenForHashChanges();
629
- }
630
- });
631
- }
632
-
633
- _get(_getPrototypeOf(BookreaderUrlPlugin.prototype), "init", this).call(this);
634
- }
635
- }]);
636
-
637
- return BookreaderUrlPlugin;
638
- }(BookReader);
639
- window.BookReader = BookreaderUrlPlugin;
640
- /* harmony default export */ __webpack_exports__["default"] = (BookreaderUrlPlugin);
641
-
642
- /***/ }),
643
-
644
- /***/ "./node_modules/core-js/modules/es.object.entries.js":
645
- /*!***********************************************************!*\
646
- !*** ./node_modules/core-js/modules/es.object.entries.js ***!
647
- \***********************************************************/
648
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
649
-
650
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
651
- var $entries = __webpack_require__(/*! ../internals/object-to-array */ "./node_modules/core-js/internals/object-to-array.js").entries;
652
-
653
- // `Object.entries` method
654
- // https://tc39.es/ecma262/#sec-object.entries
655
- $({ target: 'Object', stat: true }, {
656
- entries: function entries(O) {
657
- return $entries(O);
658
- }
659
- });
660
-
661
-
662
- /***/ }),
663
-
664
- /***/ "./node_modules/core-js/modules/es.object.from-entries.js":
665
- /*!****************************************************************!*\
666
- !*** ./node_modules/core-js/modules/es.object.from-entries.js ***!
667
- \****************************************************************/
668
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
669
-
670
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
671
- var iterate = __webpack_require__(/*! ../internals/iterate */ "./node_modules/core-js/internals/iterate.js");
672
- var createProperty = __webpack_require__(/*! ../internals/create-property */ "./node_modules/core-js/internals/create-property.js");
673
-
674
- // `Object.fromEntries` method
675
- // https://github.com/tc39/proposal-object-from-entries
676
- $({ target: 'Object', stat: true }, {
677
- fromEntries: function fromEntries(iterable) {
678
- var obj = {};
679
- iterate(iterable, function (k, v) {
680
- createProperty(obj, k, v);
681
- }, { AS_ENTRIES: true });
682
- return obj;
683
- }
684
- });
685
-
686
-
687
- /***/ }),
688
-
689
- /***/ "./node_modules/core-js/modules/es.string.match.js":
690
- /*!*********************************************************!*\
691
- !*** ./node_modules/core-js/modules/es.string.match.js ***!
692
- \*********************************************************/
693
- /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
694
-
695
- "use strict";
696
-
697
- var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
698
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
699
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
700
- var toString = __webpack_require__(/*! ../internals/to-string */ "./node_modules/core-js/internals/to-string.js");
701
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
702
- var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js");
703
- var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js");
704
-
705
- // @@match logic
706
- fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
707
- return [
708
- // `String.prototype.match` method
709
- // https://tc39.es/ecma262/#sec-string.prototype.match
710
- function match(regexp) {
711
- var O = requireObjectCoercible(this);
712
- var matcher = regexp == undefined ? undefined : regexp[MATCH];
713
- return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](toString(O));
714
- },
715
- // `RegExp.prototype[@@match]` method
716
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
717
- function (string) {
718
- var rx = anObject(this);
719
- var S = toString(string);
720
- var res = maybeCallNative(nativeMatch, rx, S);
721
-
722
- if (res.done) return res.value;
723
-
724
- if (!rx.global) return regExpExec(rx, S);
725
-
726
- var fullUnicode = rx.unicode;
727
- rx.lastIndex = 0;
728
- var A = [];
729
- var n = 0;
730
- var result;
731
- while ((result = regExpExec(rx, S)) !== null) {
732
- var matchStr = toString(result[0]);
733
- A[n] = matchStr;
734
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
735
- n++;
736
- }
737
- return n === 0 ? null : A;
738
- }
739
- ];
740
- });
741
-
742
-
743
- /***/ })
744
-
745
- },
746
- /******/ function(__webpack_require__) { // webpackRuntimeModules
747
- /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
748
- /******/ var __webpack_exports__ = (__webpack_exec__("./src/plugins/plugin.url.js"));
749
- /******/ }
750
- ]);
1
+ "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[336],{8837:function(t,o,e){var a;e(5827),e(4916),e(5306),e(2222),e(6992),e(1539),e(8783),e(3948),e(285),e(3609).extend(BookReader.defaultOptions,{enableUrlPlugin:!0,bookId:"",defaults:null,updateWindowTitle:!1,urlMode:"hash",urlHistoryBasePath:"/",urlTrackedParams:["page","search","mode","region","highlight","view"],urlTrackIndex0:!1}),BookReader.prototype.setup=(a=BookReader.prototype.setup,function(t){a.call(this,t),this.bookId=t.bookId,this.defaults=t.defaults,this.locationPollId=null,this.oldLocationHash=null,this.oldUserHash=null}),BookReader.prototype.init=function(t){return function(){var o=this;this.options.enableUrlPlugin&&(this.bind(BookReader.eventNames.PostInit,(function(){var t=o.options,e=t.updateWindowTitle,a=t.urlMode;e&&(document.title=o.shortTitle(50)),"hash"===a&&o.urlStartLocationPolling()})),this.bind(BookReader.eventNames.fragmentChange,this.urlUpdateFragment.bind(this))),t.call(this)}}(BookReader.prototype.init),BookReader.prototype.shortTitle=function(t){return this.bookTitle.length<t?this.bookTitle:"".concat(this.bookTitle.substr(0,t-3),"...")},BookReader.prototype.urlStartLocationPolling=function(){var t=this;this.oldLocationHash=this.urlReadFragment(),this.locationPollId&&(clearInterval(this.locationPollID),this.locationPollId=null),this.locationPollId=setInterval((function(){var o=t.urlReadFragment();if(o!=t.oldLocationHash&&o!=t.oldUserHash){var e=t.paramsFromFragment(o),a=function(){return t.updateFromParams(e)};t.trigger(BookReader.eventNames.stop),t.animating?(t.autoStop&&t.autoStop(),t.animationFinishedCallback=a):a(),t.oldUserHash=o}}),500)},BookReader.prototype.urlUpdateFragment=function(){var t=this.paramsFromCurrent(),o=this.options,e=o.urlMode,a=o.urlTrackIndex0,r=o.urlTrackedParams;a||void 0===t.index||0!==t.index||(delete t.index,delete t.page);var i=r.reduce((function(o,e){return e in t&&(o[e]=t[e]),o}),{}),n=this.fragmentFromParams(i,e),s=this.urlReadFragment(),l=this.getLocationSearch(),h=this.queryStringFromParams(i,l,e);if(s!==n||l!==h)if("history"===e){if(window.history&&window.history.replaceState){var d=this.options.urlHistoryBasePath.replace(/\/+$/,""),u=""===n?"":"/".concat(n),c="".concat(d).concat(u).concat(h);window.history.replaceState({},null,c),this.oldLocationHash=n+h}}else{var p=this.urlParamsFiltersOnlySearch(this.readQueryString());window.location.replace("#"+n+p),this.oldLocationHash=n+p}},BookReader.prototype.urlParamsFiltersOnlySearch=function(t){var o=new URLSearchParams(t);return o.has("q")?"?".concat(new URLSearchParams({q:o.get("q")})):""},BookReader.prototype.urlReadFragment=function(){var t=this.options,o=t.urlMode,e=t.urlHistoryBasePath;return"history"===o?window.location.pathname.substr(e.length):window.location.hash.substr(1)},BookReader.prototype.urlReadHashFragment=function(){return window.location.hash.substr(1)}}},function(t){t(t.s=8837)}]);
751
2
  //# sourceMappingURL=plugin.url.js.map