hypothesis 1.948.0 → 1.949.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/boot.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";function t(t,e){for(var s in e)e.hasOwnProperty(s)&&(t[s]=e[s]);return t}function e(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return s.every((function(e){return"function"==typeof t[e]}))}var s={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function n(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)return Array.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return r(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,n=new Array(e);s<e;s++)n[s]=t[s];return n}var o=["es2017","es2018"];function a(t){t.setAttribute("data-hypothesis-asset","")}function i(t,e){var s=t.createElement("link");s.rel="stylesheet",s.type="text/css",s.href=e,a(s),t.head.appendChild(s)}function c(t,e){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.createElement("script");n.type="module",s&&(e+="#ts=".concat(Date.now())),n.src=e,n.async=!1,a(n),t.head.appendChild(n)}function l(t,e,s,n){var r=t.createElement("link");r.rel=e,r.href=n,r.type="application/annotator+".concat(s),a(r),t.head.appendChild(r)}function u(t,e,s){var n=t.createElement("link");n.rel="preload",n.as=e,n.href=s,"fetch"===e&&(n.crossOrigin="anonymous"),a(n),t.head.appendChild(n)}function p(t,e){return t.assetRoot+"build/"+t.manifest[e]}function d(t,e,s){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n.forceModuleReload;s.forEach((function(s){var n=p(e,s);n.match(/\.css/)?i(t,n):c(t,n,r)}))}function f(t){return function(t){return t.filter((function(t){var e=s[t];if(!e)throw new Error('Unknown polyfill set "'.concat(t,'"'));return e()}))}(t).map((function(t){return"scripts/polyfills-".concat(t,".bundle.js")}))}function h(t){var e=t.match(/(https?):\/\/([^:/]+)/);return e?{protocol:e[1],hostname:e[2]}:null}function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=t.currentScript;return e?h(e.src):null}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===t.indexOf("{"))return t;var s=y(e);if(!s)throw new Error("Could not process URL template because script origin is unknown");return t=(t=t.replace("{current_host}",s.hostname)).replace("{current_scheme}",s.protocol)}var b={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?f33c07","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?31366a","styles/annotator.css":"styles/annotator.css?c5bbcc","styles/annotator.css.map":"styles/annotator.css.map?26c09c","styles/highlights.css":"styles/highlights.css?c308d0","styles/highlights.css.map":"styles/highlights.css.map?5be890","styles/katex.min.css":"styles/katex.min.css?123be2","styles/katex.min.css.map":"styles/katex.min.css.map?4daef7","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?dd8179","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?bf5f6c","styles/sidebar.css":"styles/sidebar.css?21ecfe","styles/sidebar.css.map":"styles/sidebar.css.map?52d821","styles/ui-playground.css.map":"styles/ui-playground.css.map?c9b68e","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?ee2fe0","styles/ui-playground.css":"styles/ui-playground.css?3fe805","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?74be97","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?6af4e1","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?58da67"};if(function(){var t=[function(){return Promise.resolve()},function(){return new Map},function(){return new URL(document.location.href)},function(){return new Request("https://hypothes.is")},function(){return Element.prototype.attachShadow},function(){return CSS.supports("display: grid")},function(){return document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0}];try{return t.every((function(t){return t()}))}catch(t){return!1}}()){var v=function(e){for(var s={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(t){console.warn("Could not parse settings from js-hypothesis-config tags",t),o={}}t(s,o)}return s}(document),g=m(v.assetRoot||"https://cdn.hypothes.is/hypothesis/1.948.0/");if(document.querySelector("hypothesis-app"))!function(t,e){u(t,"fetch",e.apiUrl),u(t,"fetch",e.apiUrl+"links");var s=f(o);d(t,e,[].concat(n(s),["scripts/sidebar.bundle.js","styles/katex.min.css","styles/sidebar.css"]))}(document,{assetRoot:g,manifest:b,apiUrl:v.apiUrl});else{var j=m(v.notebookAppUrl||"https://hypothes.is/notebook"),w=m(v.sidebarAppUrl||"https://hypothes.is/app.html");!function(t,e){if(!t.querySelector('link[type="application/annotator+html"]')){l(t,"sidebar","html",e.sidebarAppUrl),l(t,"notebook","html",e.notebookAppUrl),u(t,"style",p(e,"styles/annotator.css")),l(t,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");var s=f(o);d(t,e,[].concat(n(s),["scripts/annotator.bundle.js","styles/highlights.css","styles/pdfjs-overrides.css"]),{forceModuleReload:!0})}}(document,{assetRoot:g,manifest:b,notebookAppUrl:j,sidebarAppUrl:w})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
1
+ !function(){"use strict";function t(t,e){for(var s in e)e.hasOwnProperty(s)&&(t[s]=e[s]);return t}function e(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return s.every((function(e){return"function"==typeof t[e]}))}var s={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function n(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)return Array.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return r(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,n=new Array(e);s<e;s++)n[s]=t[s];return n}var o=["es2017","es2018"];function a(t){t.setAttribute("data-hypothesis-asset","")}function i(t,e){var s=t.createElement("link");s.rel="stylesheet",s.type="text/css",s.href=e,a(s),t.head.appendChild(s)}function c(t,e){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.createElement("script");n.type="module",s&&(e+="#ts=".concat(Date.now())),n.src=e,n.async=!1,a(n),t.head.appendChild(n)}function l(t,e,s,n){var r=t.createElement("link");r.rel=e,r.href=n,r.type="application/annotator+".concat(s),a(r),t.head.appendChild(r)}function u(t,e,s){var n=t.createElement("link");n.rel="preload",n.as=e,n.href=s,"fetch"===e&&(n.crossOrigin="anonymous"),a(n),t.head.appendChild(n)}function p(t,e){return t.assetRoot+"build/"+t.manifest[e]}function d(t,e,s){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n.forceModuleReload;s.forEach((function(s){var n=p(e,s);n.match(/\.css/)?i(t,n):c(t,n,r)}))}function h(t){return function(t){return t.filter((function(t){var e=s[t];if(!e)throw new Error('Unknown polyfill set "'.concat(t,'"'));return e()}))}(t).map((function(t){return"scripts/polyfills-".concat(t,".bundle.js")}))}function f(t){var e=t.match(/(https?):\/\/([^:/]+)/);return e?{protocol:e[1],hostname:e[2]}:null}function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=t.currentScript;return e?f(e.src):null}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===t.indexOf("{"))return t;var s=y(e);if(!s)throw new Error("Could not process URL template because script origin is unknown");return t=(t=t.replace("{current_host}",s.hostname)).replace("{current_scheme}",s.protocol)}var b={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?818cd6","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?31366a","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?ee2fe0","styles/annotator.css":"styles/annotator.css?c5bbcc","styles/annotator.css.map":"styles/annotator.css.map?26c09c","styles/highlights.css":"styles/highlights.css?c308d0","styles/highlights.css.map":"styles/highlights.css.map?5be890","styles/katex.min.css":"styles/katex.min.css?123be2","styles/katex.min.css.map":"styles/katex.min.css.map?4daef7","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?dd8179","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?bf5f6c","styles/sidebar.css":"styles/sidebar.css?21ecfe","styles/sidebar.css.map":"styles/sidebar.css.map?52d821","styles/ui-playground.css":"styles/ui-playground.css?3fe805","styles/ui-playground.css.map":"styles/ui-playground.css.map?c9b68e","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?74be97","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?f69073","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?58da67"};if(function(){var t=[function(){return Promise.resolve()},function(){return new Map},function(){return new URL(document.location.href)},function(){return new Request("https://hypothes.is")},function(){return Element.prototype.attachShadow},function(){return CSS.supports("display: grid")},function(){return document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0}];try{return t.every((function(t){return t()}))}catch(t){return!1}}()){var v=function(e){for(var s={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(t){console.warn("Could not parse settings from js-hypothesis-config tags",t),o={}}t(s,o)}return s}(document),g=m(v.assetRoot||"https://cdn.hypothes.is/hypothesis/1.949.0/");if(document.querySelector("hypothesis-app"))!function(t,e){u(t,"fetch",e.apiUrl),u(t,"fetch",e.apiUrl+"links");var s=h(o);d(t,e,[].concat(n(s),["scripts/sidebar.bundle.js","styles/katex.min.css","styles/sidebar.css"]))}(document,{assetRoot:g,manifest:b,apiUrl:v.apiUrl});else{var j=m(v.notebookAppUrl||"https://hypothes.is/notebook"),w=m(v.sidebarAppUrl||"https://hypothes.is/app.html");!function(t,e){if(!t.querySelector('link[type="application/annotator+html"]')){l(t,"sidebar","html",e.sidebarAppUrl),l(t,"notebook","html",e.notebookAppUrl),u(t,"style",p(e,"styles/annotator.css")),l(t,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");var s=h(o);d(t,e,[].concat(n(s),["scripts/annotator.bundle.js","styles/highlights.css","styles/pdfjs-overrides.css"]),{forceModuleReload:!0})}}(document,{assetRoot:g,manifest:b,notebookAppUrl:j,sidebarAppUrl:w})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
@@ -1,6 +1,7 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?f33c07",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?818cd6",
3
3
  "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?31366a",
4
+ "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?ee2fe0",
4
5
  "styles/annotator.css": "styles/annotator.css?c5bbcc",
5
6
  "styles/annotator.css.map": "styles/annotator.css.map?26c09c",
6
7
  "styles/highlights.css": "styles/highlights.css?c308d0",
@@ -11,10 +12,9 @@
11
12
  "styles/pdfjs-overrides.css.map": "styles/pdfjs-overrides.css.map?bf5f6c",
12
13
  "styles/sidebar.css": "styles/sidebar.css?21ecfe",
13
14
  "styles/sidebar.css.map": "styles/sidebar.css.map?52d821",
14
- "styles/ui-playground.css.map": "styles/ui-playground.css.map?c9b68e",
15
- "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?ee2fe0",
16
15
  "styles/ui-playground.css": "styles/ui-playground.css?3fe805",
16
+ "styles/ui-playground.css.map": "styles/ui-playground.css.map?c9b68e",
17
17
  "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?74be97",
18
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?6af4e1",
18
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?f69073",
19
19
  "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?58da67"
20
20
  }
@@ -93,7 +93,7 @@ this._frameIdentifier!==t&&(this._informHostOnNextSelectionClear=!1,Kn())})),thi
93
93
  this._sidebarRPC.on("deleteAnnotation",(t=>this.detach(t))),this._sidebarRPC.on("loadAnnotations",(t=>t.forEach((t=>this.anchor(t)))));const t=await this._portFinder.discover("sidebar");this._sidebarRPC.createChannel(t)}destroy(){this._portFinder.destroy(),this._notifyGuestUnload(),this._hypothesisInjector.destroy(),this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.destroy(),function(t){ve(Array.from(t.querySelectorAll("hypothesis-highlight")))}(this.element),this._integration.destroy(),this._sidebarRPC.destroy()}_notifyGuestUnload(){const t={type:"hypothesisGuestUnloaded",frameIdentifier:this._frameIdentifier};this._hostFrame.postMessage(t,"*")}async anchor(t){const e=t=>{const e=Zn(t);if(!e)return;const n=ge(e);n.forEach((e=>{e._annotation=t.annotation})),t.highlights=n,this._focusedAnnotations.has(t.annotation.$tag)&&ye(n,!0)};this.detach(t.$tag,!1),this._annotations.add(t.$tag),t.target||(t.target=[]);const n=await Promise.all(t.target.map((async e=>{
94
94
  if(!e.selector||!e.selector.some((t=>"TextQuoteSelector"===t.type)))return{annotation:t,target:e};let n;try{const o=await this._integration.anchor(this.element,e.selector),i=he.fromRange(o);n={annotation:t,target:e,range:i}}catch(o){n={annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(let t of n)e(t);return t.$orphan=n.length>0&&n.every((t=>t.target.selector&&!t.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[];for(let e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&ve(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){this.anchors=t,e&&null===this._frameIdentifier&&this._hostRPC.call("anchorsChanged")}async createAnnotation({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(e.map((t=>this._integration.describe(o,t))))).map((t=>({source:n.uri,selector:t
95
95
  }))),r={uri:n.uri,document:n.metadata,target:i,$highlight:t,$tag:"a:"+Zt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Kn(),r}_focusAnnotations(t){const e=t.map((t=>t.$tag));this._sidebarRPC.call("focusAnnotations",e)}_onSelection(t){if(!this._integration.canAnnotate(t))return void this._onClearSelection();const e=document.getSelection(),n=de(e),o=me(e);o?(this.selectedRanges=[t],this._hostRPC.call("textSelectedIn",this._frameIdentifier),this._adder.annotationsForSelection=Yn(),this._isAdderVisible=!0,this._adder.show(o,n)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselectedIn",this._frameIdentifier),this._informHostOnNextSelectionClear=!0}selectAnnotations(t,e=!1){const n=t.map((t=>t.$tag));e?this._sidebarRPC.call("toggleAnnotationSelection",n):this._sidebarRPC.call("showAnnotations",n),this._sidebarRPC.call("openSidebar")}scrollToAnchor(t){
96
- return this._integration.scrollToAnchor(t)}setHighlightsVisible(t){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t}contentContainer(){return this._integration.contentContainer()}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function Qn(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function to(t){var e;const n={};for(let[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.version="1.948.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),(null===(e=n.services)||void 0===e?void 0:e.length)>0){const t=n.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),
96
+ return this._integration.scrollToAnchor(t)}setHighlightsVisible(t){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t}contentContainer(){return this._integration.contentContainer()}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function Qn(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function to(t){var e;const n={};for(let[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.version="1.949.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),(null===(e=n.services)||void 0===e?void 0:e.length)>0){const t=n.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),
97
97
  t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return n}function eo({config:t,groupId:e}){return gt("iframe",{title:"Hypothesis annotation notebook",className:"NotebookIframe",allowFullScreen:!0,src:Qn(t.notebookAppUrl,{...to(t),group:e})})}function no({eventBus:t,config:e}){const[n,o]=rt(0),[i,r]=rt(!0),[s,a]=rt(null),l=lt(""),c=lt(null);st((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),st((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),st((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),o((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);return null===s?null:gt("div",{className:Z("NotebookModal__outer",{"is-hidden":i}),children:gt("div",{className:"NotebookModal__inner",children:[gt("div",{className:"NotebookModal__close-button-container",children:gt(Ct,{icon:"cancel",title:"Close the Notebook",onClick:()=>{var t;r(!0),
98
98
  null===(t=c.current)||void 0===t||t.publish("closeNotebook")},variant:"dark"})}),gt(eo,{config:e,groupId:s},n)]})})}class oo{constructor(t,e,n={}){this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this.shadowRoot=oe(this._outerContainer),P(gt(no,{eventBus:e,config:n}),this.shadowRoot)}destroy(){P(null,this.shadowRoot),this._outerContainer.remove()}}var io={exports:{}};!function(t){!function(e,n,o,i){var r,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,h=Date.now;function u(t,e,n){return setTimeout(v(t,n),e)}function d(t,e,n){return!!Array.isArray(t)&&(f(t,n[e],n),!0)}function f(t,e,n){var o;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==i)for(o=0;o<t.length;)e.call(n,t[o],o,t),o++;else for(o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)}function p(t,n,o){var i="DEPRECATED METHOD: "+n+"\n"+o+" AT \n";return function(){
99
99
  var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=e.console&&(e.console.warn||e.console.log);return r&&r.call(e.console,i,o),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(t){if(t===i||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var o=arguments[n];if(o!==i&&null!==o)for(var r in o)o.hasOwnProperty(r)&&(e[r]=o[r])}return e}:Object.assign;var m=p((function(t,e,n){for(var o=Object.keys(e),r=0;r<o.length;)(!n||n&&t[o[r]]===i)&&(t[o[r]]=e[o[r]]),r++;return t}),"extend","Use `assign`."),g=p((function(t,e){return m(t,e,!0)}),"merge","Use `assign`.");function _(t,e,n){var o,i=e.prototype;(o=t.prototype=Object.create(i)).constructor=t,o._super=i,n&&r(o,n)}function v(t,e){return function(){return t.apply(e,arguments)}}function y(t,e){
@@ -564,7 +564,7 @@ t.addEventListener("touchstart",i,c),t.addEventListener("wheel",i,c)),a&&Qd(t),i
564
564
  },s=t>0?`${o} (${t} available)`:o;return Rr(Ur,{classes:hr("u-color-text","SelectionTab",{"is-selected":r}),onClick:a,onMouseDown:a,pressed:!!r,role:"tab",tabIndex:0,title:s,children:Rr(m,{children:[e,t>0&&!n&&Rr("span",{className:"u-font--xsmall",style:"position:relative;bottom:3px;left:2px",children:t})]})})}var lp=Eo((function({annotationsService:e,isLoading:t,settings:n}){const r=To(),o=r.selectedTab(),i=r.noteCount(),a=r.annotationCount(),s=r.orphanCount(),l=r.isWaitingToAnchorAnnotations(),c=e=>{r.clearSelection(),r.selectTab(e)},u="annotation"===o&&0===a&&!l,h="note"===o&&0===i;return Rr("div",{className:"hyp-u-vertical-spacing--4 SelectionTabs__container",children:[Rr("div",{className:"hyp-u-layout-row hyp-u-horizontal-spacing--6 SelectionTabs",role:"tablist",children:[Rr(sp,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),Rr(sp,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),
565
565
  children:"Page Notes"}),s>0&&Rr(sp,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&Rr("div",{className:"hyp-u-layout-row--justify-right",children:Rr(Ur,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:So(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&Rr(Gr,{classes:"u-text--centered",children:Rr("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&Rr(Gr,{classes:"u-text--centered",children:Rr("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",Rr("br",{}),"Create one by selecting some text and clicking the"," ",Rr(Qr,{classes:"hyp-u-margin--1 u-inline",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"])
566
566
  ;var cp=Eo((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){const i=yi(),a=To(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),h=a.directLinkedAnnotationId(),d=h?a.findAnnotationByID(h):void 0,p=d?ci(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,y=!(c||!h)&&!d,_=a.directLinkedGroupFetchFailed(),b=y||_,w=!b,x=!b&&!l,k=h&&!u&&!y&&!c,S=Sr(s);xr((()=>{if(!S.current||S.current!==s){if(S.current){let e=a.focusState().active;a.clearSelection(),e&&a.toggleFocusMode(!0)}S.current=s}s&&m.length&&r.load({groupId:s,uris:m})}),[a,r,s,g,m]),xr((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return xr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),Rr("div",{children:[Rr("h2",{className:"u-screen-reader-only",children:"Annotations"}),w&&Rr(Xd,{}),Rr(ap,{onLogin:t,
567
- onSignUp:n}),y&&Rr($d,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),_&&Rr($d,{errorType:"group",onLoginRequest:t}),x&&Rr(lp,{isLoading:c}),Rr(qd,{threads:i.children}),k&&Rr(Zd,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var up=Eo((function({api:e,toastMessenger:t}){const n=To(),r=n.routeParams().q,o=Er((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Ho(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return xr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),Rr(qd,{threads:yi().children})}),["api","toastMessenger"]);class hp{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.948.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
567
+ onSignUp:n}),y&&Rr($d,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),_&&Rr($d,{errorType:"group",onLoginRequest:t}),x&&Rr(lp,{isLoading:c}),Rr(qd,{threads:i.children}),k&&Rr(Zd,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var up=Eo((function({api:e,toastMessenger:t}){const n=To(),r=n.routeParams().q,o=Er((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Ho(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return xr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),Rr(qd,{threads:yi().children})}),["api","toastMessenger"]);class hp{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.949.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
568
568
  this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}function dp(e){const t=F(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function pp({commandName:e,iconName:t}){return Rr("span",{className:"Tutorial__instruction",children:[Rr(Qr,{name:t,classes:"hyp-u-margin--right--1 hyp-u-color--grey-6 u-inline Tutorial__icon"}),Rr("em",{children:e})]})}var mp=Eo((function({settings:e}){const t=!dp(e);return Rr("ol",{className:"Tutorial__list",children:[Rr("li",{className:"Tutorial__item",children:["To create an annotation, select text and then select the"," ",Rr(pp,{iconName:"annotate",commandName:"Annotate"
569
569
  })," ","button."]}),Rr("li",{className:"Tutorial__item",children:["To create a highlight (",Rr("a",{href:"https://web.hypothes.is/help/why-are-highlights-private-by-default/",target:"_blank",rel:"noopener noreferrer",children:"visible only to you"}),"), select text and then select the"," ",Rr(pp,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&Rr("li",{className:"Tutorial__item",children:["To annotate in a private group, select the group from the groups dropdown. Don't see your group? Ask the group creator to send a"," ",Rr("a",{href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",rel:"noopener noreferrer",children:"join link"}),")."]}),Rr("li",{className:"Tutorial__item",children:["To reply to an annotation, select the"," ",Rr(pp,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);var fp=Eo((function({toastMessenger:e,versionData:t}){return Rr("div",{className:"hyp-u-vertical-spacing",children:[Rr("dl",{className:"VersionInfo",
570
570
  children:[Rr("dt",{className:"VersionInfo__key",children:"Version"}),Rr("dd",{className:"VersionInfo__value",children:t.version}),Rr("dt",{className:"VersionInfo__key",children:"User Agent"}),Rr("dd",{className:"VersionInfo__value",children:t.userAgent}),Rr("dt",{className:"VersionInfo__key",children:"URL"}),Rr("dd",{className:"VersionInfo__value",children:t.urls}),Rr("dt",{className:"VersionInfo__key",children:"Fingerprint"}),Rr("dd",{className:"VersionInfo__value",children:t.fingerprint}),Rr("dt",{className:"VersionInfo__key",children:"Account"}),Rr("dd",{className:"VersionInfo__value",children:t.account}),Rr("dt",{className:"VersionInfo__key",children:"Date"}),Rr("dd",{className:"VersionInfo__value",children:t.timestamp})]}),Rr("div",{className:"hyp-u-layout-row--justify-center",children:Rr(Ur,{onClick:()=>{try{qi(t.asFormattedString()),e.success("Copied version info to clipboard")}catch(t){e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"])
@@ -592,7 +592,7 @@ await e.login(),i.closeSidebarPanel("loginPrompt"),i.clearGroups(),r.reload()}ca
592
592
  children:["annotation"===l&&Rr(Gd,{onLogin:p}),"notebook"===l&&Rr(Np,{}),"stream"===l&&Rr(up,{}),"sidebar"===l&&Rr(cp,{onLogin:p,onSignUp:m})]})]})]})}),["auth","frameSync","session","settings","toastMessenger"]);function Vp({error:e}){return Rr("div",{className:"LaunchErrorPanel",children:Rr(co,{title:"Unable to start Hypothesis",children:e.message})})}class Wp{constructor(e,t){this._api=e,this._store=t}_applyDraftChanges(e){const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?Bi(e.user):Fi(e.user,e.group)),{...e,...t}}_initialize(e,t=new Date){const n=this._store.getDefault("annotationPrivacy"),r=this._store.focusedGroupId(),o=this._store.profile();if(!r)throw new Error("Cannot create annotation without a group");const i=o.userid,a=o.user_info,s="s:"+Z(8),l=Object.assign({created:t.toISOString(),group:r,permissions:ji(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e)
593
593
  ;return Jo(l)&&(l.permissions=Bi(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Jo(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Yo(n)}),ei(n)?this._store.selectTab("note"):ti(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:Yo(e)?Fi(t,e.group):Bi(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t;const n=this._applyDraftChanges(e);let r
594
594
  ;t=Wo(e)?this._api.annotation.create({},n):this._api.annotation.update({id:e.id},n),this._store.annotationSaveStarted(e);try{r=await t}finally{this._store.annotationSaveFinished(e)}return Object.keys(e).forEach((t=>{"$"===t[0]&&(r[t]=e[t])})),this._store.removeDraft(e),this._store.addAnnotations([r]),r}}Wp.$inject=["api","store"];class Yp extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),this.url=e,this.response=t,this.reason=n}}async function Kp(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Yp(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new Yp(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Yp(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Xp(e,t){const n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],i=":"+r;-1!==e.indexOf(i)?e=e.replace(i,encodeURIComponent(String(o))):n[r]=o}return{url:e,unusedParams:n}}function Zp(e){const t={}
595
- ;for(const n in e)e.hasOwnProperty(n)&&"$"!==n[0]&&(t[n]=e[n]);return t}class Jp{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;return t.split(".").forEach((e=>{n=n[e]})),n}(o,t),u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.948.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Xp(c.url,a),m=new URL(d);for(let[e,t]of Object.entries(p)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&m.searchParams.append(e,n.toString())}return await Kp(m.toString(),{body:s?JSON.stringify(Zp(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={
595
+ ;for(const n in e)e.hasOwnProperty(n)&&"$"!==n[0]&&(t[n]=e[n]);return t}class Jp{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;return t.split(".").forEach((e=>{n=n[e]})),n}(o,t),u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.949.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Xp(c.url,a),m=new URL(d);for(let[e,t]of Object.entries(p)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&m.searchParams.append(e,n.toString())}return await Kp(m.toString(),{body:s?JSON.stringify(Zp(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={
596
596
  create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},read:i("group.read")},this.groups={list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},read:i("profile.read"),update:i("profile.update")}}setClientId(e){this._clientId=e}}Jp.$inject=["apiRoutes","auth","store"];var Qp={};function em(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var tm=em;em.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},
597
597
  em.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},em.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout((function(){r._operationTimeoutCb(r._attempts)}),r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)}),n),this._options.unref&&this._timer.unref(),!0},em.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb))
598
598
  ;var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){n._operationTimeoutCb()}),n._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},em.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},em.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},em.prototype.start=em.prototype.try,em.prototype.errors=function(){return this._errors},em.prototype.attempts=function(){return this._attempts},em.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},function(e){var t=tm;e.operation=function(n){var r=e.timeouts(n);return new t(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,
@@ -656,7 +656,7 @@ const t=["Newest","Oldest"];return"note"!==e&&t.push("Location"),t}));var Dg=Qm(
656
656
  activePanelName:t.panelName}},CLOSE_SIDEBAR_PANEL:function(e,t){let n=e.activePanelName;return t.panelName===n&&(n=null),{activePanelName:n}},TOGGLE_SIDEBAR_PANEL:function(e,t){let n;const r=e.activePanelName===t.panelName,o=void 0!==t.panelState?t.panelState:!r;return n=o?t.panelName:r&&!o?null:e.activePanelName,{activePanelName:n}}},Fg=_m(Bg);var jg=Qm({activePanelName:null},{namespace:"sidebarPanels",reducers:Bg,actionCreators:{openSidebarPanel:function(e){return{type:Fg.OPEN_SIDEBAR_PANEL,panelName:e}},closeSidebarPanel:function(e){return{type:Fg.CLOSE_SIDEBAR_PANEL,panelName:e}},toggleSidebarPanel:function(e,t){return{type:Fg.TOGGLE_SIDEBAR_PANEL,panelName:e,panelState:t}}},selectors:{isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}});const Hg={ADD_MESSAGE:function(e,t){return{messages:e.messages.concat({...t.message})}},REMOVE_MESSAGE:function(e,t){return{messages:e.messages.filter((e=>e.id!==t.id))}},UPDATE_MESSAGE:function(e,t){return{
657
657
  messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))}}},Ug=_m(Hg);var qg=Qm({messages:[]},{namespace:"toastMessages",reducers:Hg,actionCreators:{addToastMessage:function(e){return{type:Ug.ADD_MESSAGE,message:e}},removeToastMessage:function(e){return{type:Ug.REMOVE_MESSAGE,id:e}},updateToastMessage:function(e){return{type:Ug.UPDATE_MESSAGE,message:e}}},selectors:{getToastMessage:function(e,t){return e.messages.find((e=>e.id===t))},getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}});const $g={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}},Gg=_m($g);var Vg=Qm({sidebarHasOpened:!1},{namespace:"viewer",reducers:$g,actionCreators:{setSidebarOpened:function(e){return{type:Gg.SET_SIDEBAR_OPENED,opened:e}}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});function Wg(e){return Jm([rf,Lf,zf,Pf,$f,Jf,rg,_g,gg,kg,ff,Dg,sg,jg,qg,Vg],[e],[ef])}Wg.$inject=["settings"];class Yg{
658
658
  constructor(){this._providers=new Map,this._instances=new Map,this._constructing=new Set}get(e){if(this._instances.has(e))return this._instances.get(e);const t=this._providers.get(e);if(!t)throw new Error(`"${e}" is not registered`);if("value"in t)return this._instances.set(e,t.value),t.value;if(this._constructing.has(e))throw new Error(`Encountered a circular dependency when constructing "${e}"`);this._constructing.add(e);try{const n=[],r="class"in t&&t.class.$inject||"factory"in t&&t.factory.$inject||[];for(const t of r)try{n.push(this.get(t))}catch(n){const r=new Error(`Failed to construct dependency "${t}" of "${e}": ${n.message}`);throw r.cause=n,r}let o;if(t.class)o=new t.class(...n);else{o=(0,t.factory)(...n)}return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)
659
- }(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const Kg=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document);function Xg(e,t){e.setClientId(t.clientId)}function Zg(e,t,n){e.load(),t.load(),n.sync()}function Jg(e,t,n,r){e.init(),t.init(),n.init(),r.init()}function Qg(e,t){"sidebar"===t.route()&&e.connect()}Kg.sentry&&function(e){const t=function(){try{const e=document.currentScript;return new URL(e.src).origin}catch(e){return null}}(),n=t?[t]:void 0;Gn({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.948.0",beforeSend:(e,t)=>{
659
+ }(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const Kg=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document);function Xg(e,t){e.setClientId(t.clientId)}function Zg(e,t,n){e.load(),t.load(),n.sync()}function Jg(e,t,n,r){e.init(),t.init(),n.init(),r.init()}function Qg(e,t){"sidebar"===t.route()&&e.connect()}Kg.sentry&&function(e){const t=function(){try{const e=document.currentScript;return new URL(e.src).origin}catch(e){return null}}(),n=t?[t]:void 0;Gn({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.949.0",beforeSend:(e,t)=>{
660
660
  if(Wn>=5)return P("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Wn;try{const n=t&&t.originalException;n instanceof Event&&Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted})}catch(e){}return e}});try{jt("host_config",G(window.location.href))}catch(e){}jt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Vn(((e,t)=>{Ft(e,{tags:{context:t}})}))}(Kg.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),function(e=n){let t=!1;try{document.createElement("div").dir="auto"}catch(e){t=!0}if(t){const t=e.vnode;e.vnode=e=>{"string"==typeof e.type&&"dir"in e.props&&"auto"===e.props.dir&&(e.props.dir=""),t&&t(e)}}}(),Xg.$inject=["api","streamer"],Zg.$inject=["groups","session","router"],Jg.$inject=["autosaveService","features","persistedDefaults","serviceURL"],
661
661
  Qg.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&Pr.clear();for(let[t,n]of Object.entries(e))Pr.set(t,n)}(yo);const ev=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",q)}(),async function(e,t=window){const n=K(window),r=n.requestConfigFromFrame;if(!r)return ee(e,n);if("string"==typeof r)return await Q(e,t);if("number"==typeof r.ancestorLevel&&"string"==typeof r.origin){const o=function(e,t=window){let n=t;for(let t=0;t<e;t++){if(n===n.top)throw new Error("The target parent frame has exceeded the ancestor tree. Try reducing the `requestConfigFromFrame.ancestorLevel` value in the `hypothesisConfig`");n=n.parent}return n}(r.ancestorLevel,t);return{...await te(e,o,r.origin),...n.group?{group:n.group}:{}}}throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified")}(Kg).then((e=>{!function(e,t){const n=new Yg
662
662
  ;n.register("annotationsService",Wp).register("api",Jp).register("apiRoutes",im).register("auth",lm).register("autosaveService",cm).register("features",dm).register("frameSync",ym).register("groups",xm).register("loadAnnotationsService",km).register("localStorage",Cm).register("persistedDefaults",Am).register("router",Tm).register("serviceURL",Nm).register("session",Lm).register("streamer",zm).register("streamFilter",Mm).register("tags",Im).register("threadsService",Rm).register("toastMessenger",Pm).register("store",{factory:Wg}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Jg),n.run(Xg),n.run(Zg),n.run(U),n.run(Qg),I(Rr(Co.Provider,{value:n,children:Rr(Gp,{})}),t)}(e,ev)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),I(Rr(Vp,{error:e}),t)}(e,ev)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypothesis",
3
- "version": "1.948.0",
3
+ "version": "1.949.0",
4
4
  "description": "Annotate with anyone, anywhere.",
5
5
  "license": "BSD-2-Clause",
6
6
  "homepage": "https://hypothes.is",