hypothesis 1.1675.0 → 1.1676.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.
@@ -1 +1 @@
1
- !function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?d3ccc4","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?e1a758","styles/annotator.css":"styles/annotator.css?2f44d4","styles/annotator.css.map":"styles/annotator.css.map?c171a0","styles/highlights.css":"styles/highlights.css?470b72","styles/highlights.css.map":"styles/highlights.css.map?d94fe5","styles/katex.min.css":"styles/katex.min.css?921c28","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?f9af40","styles/sidebar.css.map":"styles/sidebar.css.map?119194","styles/ui-playground.css":"styles/ui-playground.css?a31de8","styles/ui-playground.css.map":"styles/ui-playground.css.map?d00658","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?bb8b68","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?9c5a4b","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?5e3fcb","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?1ad403"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=t,e(r),s.head.appendChild(r)}function r(s,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.esModule,o=void 0===n||n,a=r.forceReload,i=void 0!==a&&a,l=s.createElement("script");o&&(l.type="module"),i&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function n(s,t,r,n){var o=s.createElement("link");o.rel=t,o.href=n,o.type="application/annotator+".concat(r),e(o),s.head.appendChild(o)}function o(s,t,r){var n=s.createElement("link");n.rel="preload",n.as=t,n.href=r,"fetch"===t&&(n.crossOrigin="anonymous"),e(n),s.head.appendChild(n)}function a(s,e){return s.assetRoot+"build/"+s.manifest[e]}function i(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<t.length;r++){var n=void 0;try{n=JSON.parse(t[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),n={}}Object.assign(e,n)}return e}(document),c=i(l.assetRoot||"__ASSET_ROOT__");if(document.querySelector("hypothesis-app")){!function(s,e){o(s,"fetch",e.apiUrl),o(s,"fetch",e.apiUrl+"links");for(var n=0,i=["scripts/sidebar.bundle.js"];n<i.length;n++)r(s,a(e,i[n]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,a(e,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=i(d.notebookAppUrl||"__NOTEBOOK_APP_URL__"),h=i(d.profileAppUrl||"__PROFILE_APP_URL__"),y=i(d.sidebarAppUrl||"__SIDEBAR_APP_URL__");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",e.sidebarAppUrl),n(s,"notebook","html",e.notebookAppUrl),n(s,"profile","html",e.profileAppUrl),o(s,"style",a(e,"styles/annotator.css")),n(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var i=0,l=["scripts/annotator.bundle.js"];i<l.length;i++)r(s,a(e,l[i]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)t(s,a(e,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,sidebarAppUrl:y})}}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";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?4739b0","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?e1a758","styles/annotator.css":"styles/annotator.css?2f44d4","styles/annotator.css.map":"styles/annotator.css.map?c171a0","styles/highlights.css":"styles/highlights.css?470b72","styles/highlights.css.map":"styles/highlights.css.map?d94fe5","styles/katex.min.css":"styles/katex.min.css?921c28","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?f9af40","styles/sidebar.css.map":"styles/sidebar.css.map?119194","styles/ui-playground.css":"styles/ui-playground.css?a31de8","styles/ui-playground.css.map":"styles/ui-playground.css.map?d00658","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?2f40d8","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?bb8b68","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?5e3fcb","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?2692c7"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=t,e(r),s.head.appendChild(r)}function r(s,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.esModule,o=void 0===n||n,i=r.forceReload,a=void 0!==i&&i,l=s.createElement("script");o&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function n(s,t,r,n){var o=s.createElement("link");o.rel=t,o.href=n,o.type="application/annotator+".concat(r),e(o),s.head.appendChild(o)}function o(s,t,r){var n=s.createElement("link");n.rel="preload",n.as=t,n.href=r,"fetch"===t&&(n.crossOrigin="anonymous"),e(n),s.head.appendChild(n)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<t.length;r++){var n=void 0;try{n=JSON.parse(t[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),n={}}Object.assign(e,n)}return e}(document),c=a(l.assetRoot||"__ASSET_ROOT__");if(document.querySelector("hypothesis-app")){!function(s,e){o(s,"fetch",e.apiUrl),o(s,"fetch",e.apiUrl+"links");for(var n=0,a=["scripts/sidebar.bundle.js"];n<a.length;n++)r(s,i(e,a[n]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,i(e,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=a(d.notebookAppUrl||"__NOTEBOOK_APP_URL__"),h=a(d.profileAppUrl||"__PROFILE_APP_URL__"),y=a(d.sidebarAppUrl||"__SIDEBAR_APP_URL__");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",e.sidebarAppUrl),n(s,"notebook","html",e.notebookAppUrl),n(s,"profile","html",e.profileAppUrl),o(s,"style",i(e,"styles/annotator.css")),n(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)r(s,i(e,l[a]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)t(s,i(e,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,sidebarAppUrl:y})}}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/.")}();
package/build/boot.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?d3ccc4","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?e1a758","styles/annotator.css":"styles/annotator.css?2f44d4","styles/annotator.css.map":"styles/annotator.css.map?c171a0","styles/highlights.css":"styles/highlights.css?470b72","styles/highlights.css.map":"styles/highlights.css.map?d94fe5","styles/katex.min.css":"styles/katex.min.css?921c28","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?f9af40","styles/sidebar.css.map":"styles/sidebar.css.map?119194","styles/ui-playground.css":"styles/ui-playground.css?a31de8","styles/ui-playground.css.map":"styles/ui-playground.css.map?d00658","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?bb8b68","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?9c5a4b","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?5e3fcb","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?1ad403"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=t,e(r),s.head.appendChild(r)}function r(s,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.esModule,o=void 0===n||n,a=r.forceReload,i=void 0!==a&&a,l=s.createElement("script");o&&(l.type="module"),i&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function n(s,t,r,n){var o=s.createElement("link");o.rel=t,o.href=n,o.type="application/annotator+".concat(r),e(o),s.head.appendChild(o)}function o(s,t,r){var n=s.createElement("link");n.rel="preload",n.as=t,n.href=r,"fetch"===t&&(n.crossOrigin="anonymous"),e(n),s.head.appendChild(n)}function a(s,e){return s.assetRoot+"build/"+s.manifest[e]}function i(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<t.length;r++){var n=void 0;try{n=JSON.parse(t[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),n={}}Object.assign(e,n)}return e}(document),c=i(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1675.0/");if(document.querySelector("hypothesis-app")){!function(s,e){o(s,"fetch",e.apiUrl),o(s,"fetch",e.apiUrl+"links");for(var n=0,i=["scripts/sidebar.bundle.js"];n<i.length;n++)r(s,a(e,i[n]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,a(e,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=i(d.notebookAppUrl||"https://hypothes.is/notebook"),h=i(d.profileAppUrl||"https://hypothes.is/user-profile"),y=i(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",e.sidebarAppUrl),n(s,"notebook","html",e.notebookAppUrl),n(s,"profile","html",e.profileAppUrl),o(s,"style",a(e,"styles/annotator.css")),n(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var i=0,l=["scripts/annotator.bundle.js"];i<l.length;i++)r(s,a(e,l[i]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)t(s,a(e,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,sidebarAppUrl:y})}}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";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?4739b0","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?e1a758","styles/annotator.css":"styles/annotator.css?2f44d4","styles/annotator.css.map":"styles/annotator.css.map?c171a0","styles/highlights.css":"styles/highlights.css?470b72","styles/highlights.css.map":"styles/highlights.css.map?d94fe5","styles/katex.min.css":"styles/katex.min.css?921c28","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?f9af40","styles/sidebar.css.map":"styles/sidebar.css.map?119194","styles/ui-playground.css":"styles/ui-playground.css?a31de8","styles/ui-playground.css.map":"styles/ui-playground.css.map?d00658","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?2f40d8","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?bb8b68","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?5e3fcb","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?2692c7"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=t,e(r),s.head.appendChild(r)}function r(s,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.esModule,o=void 0===n||n,i=r.forceReload,a=void 0!==i&&i,l=s.createElement("script");o&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function n(s,t,r,n){var o=s.createElement("link");o.rel=t,o.href=n,o.type="application/annotator+".concat(r),e(o),s.head.appendChild(o)}function o(s,t,r){var n=s.createElement("link");n.rel="preload",n.as=t,n.href=r,"fetch"===t&&(n.crossOrigin="anonymous"),e(n),s.head.appendChild(n)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<t.length;r++){var n=void 0;try{n=JSON.parse(t[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),n={}}Object.assign(e,n)}return e}(document),c=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1676.0/");if(document.querySelector("hypothesis-app")){!function(s,e){o(s,"fetch",e.apiUrl),o(s,"fetch",e.apiUrl+"links");for(var n=0,a=["scripts/sidebar.bundle.js"];n<a.length;n++)r(s,i(e,a[n]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,i(e,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=a(d.notebookAppUrl||"https://hypothes.is/notebook"),h=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",e.sidebarAppUrl),n(s,"notebook","html",e.notebookAppUrl),n(s,"profile","html",e.profileAppUrl),o(s,"style",i(e,"styles/annotator.css")),n(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)r(s,i(e,l[a]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)t(s,i(e,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,sidebarAppUrl:y})}}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,5 +1,5 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?d3ccc4",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?4739b0",
3
3
  "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?e1a758",
4
4
  "styles/annotator.css": "styles/annotator.css?2f44d4",
5
5
  "styles/annotator.css.map": "styles/annotator.css.map?c171a0",
@@ -13,8 +13,8 @@
13
13
  "styles/sidebar.css.map": "styles/sidebar.css.map?119194",
14
14
  "styles/ui-playground.css": "styles/ui-playground.css?a31de8",
15
15
  "styles/ui-playground.css.map": "styles/ui-playground.css.map?d00658",
16
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?2f40d8",
16
17
  "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?bb8b68",
17
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?9c5a4b",
18
18
  "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?5e3fcb",
19
- "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?1ad403"
19
+ "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?2692c7"
20
20
  }
@@ -148,7 +148,7 @@ this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.des
148
148
  ;if(o instanceof Range){const i=Mn.fromRange(o);n={annotation:t,target:e,region:i}}else n={annotation:t,target:e,region:o}}catch{n={annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(const t of n)e(t);return t.$orphan=n.length>0&&n.every((t=>t.target.selector&&!t.region)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[];for(const e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&this._highlighter.removeHighlights(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){this.anchors=t,this._clusterToolbar?.scheduleClusterUpdates(),e&&this._bucketBarClient.update(this.anchors)}async createAnnotation(t){if("selection"===t)return this.createAnnotationFromSelection();if(!["rect","point"].includes(t))throw new Error("Unsupported annotation tool");{let e=!1;try{this._hostRPC.call("activeToolChanged",t)
149
149
  ;const e=await this._drawTool.draw(t),n=await this.getDocumentInfo(),o=[{source:n.uri,selector:await this._integration.describe(this.element,e)}],i={uri:n.uri,document:n.metadata,target:o,$tag:"a:"+Ce(8)};return this._sidebarRPC.call("createAnnotation",i),this.anchor(i),i}catch(t){if(t instanceof no&&["canceled","restarted"].includes(t.kind))return e="restarted"===t.kind,null;throw t}finally{e||this._hostRPC.call("activeToolChanged",null)}}}async createAnnotationFromSelection({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}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+Ce(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),or(),r}_hoverAnnotations(t){this._hoveredAnnotations.clear(),t.forEach((t=>this._hoveredAnnotations.add(t)))
150
150
  ;for(const e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);this._highlighter.setHighlightsFocused(e.highlights,n)}this._sidebarRPC.call("hoverAnnotations",t)}_onSelection(t){const e=this._integration.getAnnotatableRange(t);if(!e)return void this._onClearSelection();const n=document.getSelection(),o=Fn(n),i=Vn(n);i?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=tr(),this._isAdderVisible=!0,this._adder.show(i,o)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}selectAnnotations(t,{toggle:e=!1,focusInSidebar:n=!1}={}){e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(t,e=!0){this._highlighter.setHighlightsVisible(t),this._highlightsVisible=t,
151
- e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){dn(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(t){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new Qi(this.element)),this._outsideAssignmentNotice.setVisible(t)}}function sr(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function ar(t,e){const n={};for(const[t,o]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=o&&(n[t]=o);n.origin=new URL(t).origin,n.version="1.1675.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const t=n.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),
151
+ e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){dn(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(t){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new Qi(this.element)),this._outsideAssignmentNotice.setVisible(t)}}function sr(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function ar(t,e){const n={};for(const[t,o]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=o&&(n[t]=o);n.origin=new URL(t).origin,n.version="1.1676.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const t=n.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),
152
152
  t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return n}function lr({closed:t,onClose:e,children:n,"data-testid":o,"aria-label":i}){const r=it(null);return nt((()=>{t?r.current?.close():r.current?.showModal()}),[t]),nt((()=>{const t=r.current;return t?.addEventListener("cancel",e),()=>{t?.removeEventListener("cancel",e)}}),[e]),St("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":o,"aria-label":i,children:n})}function cr({closed:t,children:e,...n}){return St("div",{...n,className:Nt("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:t}),children:St("div",{className:"relative w-full h-full",children:e})})}function hr({document_:t=document,...e}){return St(rt((()=>function(t){return"function"==typeof t.createElement("dialog").showModal}(t)?lr:cr),[t]),{...e})}function dr({config:t,groupId:e}){
153
153
  return St("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:sr(t.notebookAppUrl,{...ar(t.notebookAppUrl,t),group:e})})}function ur({eventBus:t,config:e}){const[n,o]=et(0),[i,r]=et(!0),[s,a]=et(null),l=it(""),c=it(null);nt((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),nt((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),nt((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),o((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);const h=st((()=>{r(!0),c.current?.publish("closeNotebook")}),[]);return null===s?null:St(hr,{closed:i,onClose:h,"data-testid":"notebook-outer","aria-label":"Hypothesis notebook",children:[St("div",{className:"absolute right-0 m-3",children:St(oe,{title:"Close notebook",onClick:h,variant:"dark",classes:Nt("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:St(Lt,{className:"w-4 h-4"})})}),St(dr,{
154
154
  config:e,groupId:s},n)]})}class fr{constructor(t,e,n){this._container=new yn("notebook",(()=>St(ur,{eventBus:e,config:n}))),t.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function pr({eventBus:t,config:e}){const[n,o]=et(!0),i=it(null);nt((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{o(!1)})),i.current=e,()=>{e.destroy()}}),[t]);const r=()=>{o(!0),i.current?.publish("closeProfile")};return n?null:St(hr,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[St("div",{className:"absolute right-0 m-3",children:St(oe,{title:"Close profile dialog",onClick:r,variant:"dark",classes:Nt("!bg-transparent enabled:hover:!bg-grey-3"),children:St(Lt,{className:"w-4 h-4"})})}),St("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:e.profileAppUrl})]})}class gr{constructor(t,e,n){this._container=new yn("profile",(()=>St(pr,{eventBus:e,config:n}))),t.append(this._container.element),
@@ -580,7 +580,7 @@ className:"text-md text-grey-7 font-bold pt-3 pb-2",children:p.get(e)}),Ve(Om,{t
580
580
  return e.annotation||t.annotation?e.annotation?1:-1:0}(e,t);const n=Vr(e.annotation),r=Vr(t.annotation);if(n.cfi||r.cfi){const e="/0",t=Qm(n.cfi??e,r.cfi??e);if(0!==t)return Math.sign(t)}const o=_f(n.pageIndex,r.pageIndex);if(0!==o)return o;const i=_f(n.top,r.top);if(0!==i)return i;const a=_f(n.charOffset,r.charOffset);if(0!==a)return a;return wf(e.annotation.created,t.annotation.created)}(e,t);default:return 0}}const kf=function(e){if(1!==e.length)throw new Error("Memoize input must be a function of one argument");let t,n;return function(r){return r===t||(t=r,n=e(r)),n}}((function(e){const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:(e,n)=>xf(e,n,{sortBy:t.sortKey})};if(!!t.filterQuery||Object.keys(t.filters).length>0){const e=function(e,t={}){const n=e=>{const n=t[e];return"string"==typeof n?[n]:[]},r=n("cfi"),o=n("page"),i=n("quote"),a=n("tag"),s=n("text"),l=n("uri"),c=n("user"),u=[],d=[],h=ff(e,df);for(const e of h){
581
581
  const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"cfi":r.push(n);break;case"quote":i.push(n);break;case"page":o.push(n);break;case"since":{const t=86400,n={sec:1,min:60,hour:3600,day:t,week:7*t,month:30*t,year:365*t},r=e.slice(6).toLowerCase().match(/^(\d+)(sec|min|hour|day|week|month|year)?$/);if(r){const e=parseFloat(r[1]),t=r[2]||"sec";d.push(e*n[t])}}break;case"tag":a.push(n);break;case"text":s.push(n);break;case"uri":l.push(n);break;case"user":c.push(n);break;default:u.push(e)}}return{any:{terms:u,operator:"and",filterReplies:!0},cfi:{terms:r,operator:"or",filterReplies:!1},quote:{terms:i,operator:"and",filterReplies:!1},page:{terms:o,operator:"or",filterReplies:!1},since:{terms:d,operator:"and",filterReplies:!0},tag:{terms:a,operator:"and",filterReplies:!0},text:{terms:s,operator:"and",filterReplies:!0},uri:{terms:l,operator:"or",filterReplies:!1},user:{terms:c,operator:"or",filterReplies:!0}}}(t.filterQuery||"",t.filters),r={},o={}
582
582
  ;for(const[t,n]of Object.entries(e))n.filterReplies?r[t]=n:o[t]=n;n.filterFn=e=>uf([e],r).length>0,Object.values(o).some((e=>e.terms.length>0))&&(n.threadFilterFn=e=>!!e.annotation&&uf([e.annotation],o).length>0)}const r=Ym(e.annotations,n),o={annotation:0,note:0,orphan:0};return e.showTabs&&(r.children=r.children.filter((e=>{if(!e.annotation)return!1;if(Fr(e.annotation))return!1;const n=vf(e.annotation);return o[n]+=1,n===t.selectedTab}))),{tabCounts:o,rootThread:r}}));function Sf(){const e=Hi(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a="sidebar"===r,s=ue((()=>{const e={...o,filterQuery:n,filters:i};return{annotations:t,selection:e,showTabs:a}}),[t,n,o,i,a]);return kf(s)}var Af,Tf,Ef=Jn((function({loadAnnotationsService:e,onLogin:t}){const n=Hi(),r=n.routeParams().id??"",{rootThread:o}=Sf(),i=n.profile().userid,[a,s]=ie(!1);return se((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0]
583
- ;t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),Ve(y,{children:[a&&Ve(Fi,{errorType:"annotation",onLoginRequest:t}),Ve(Fm,{threads:o.children})]})}),["loadAnnotationsService"]);class Cf{constructor(e,t,n=window){const r="N/A";let o=r;e.userid&&(o=e.userid,e.displayName&&(o=`${e.displayName} (${o})`)),this.version="1.1675.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||r,this.fingerprint=t[0]?.metadata?.documentFingerprint??r,this.account=o,this.timestamp=(new Date).toString();const i=t[0]?.segment;if(i){const e=[];if(i.cfi&&e.push(["CFI",i.cfi]),i.pages){const t=`${i.pages.start}-${i.pages.end}`;e.push(["Pages",t])}i.url&&e.push(["URL",i.url]),this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}
583
+ ;t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),Ve(y,{children:[a&&Ve(Fi,{errorType:"annotation",onLoginRequest:t}),Ve(Fm,{threads:o.children})]})}),["loadAnnotationsService"]);class Cf{constructor(e,t,n=window){const r="N/A";let o=r;e.userid&&(o=e.userid,e.displayName&&(o=`${e.displayName} (${o})`)),this.version="1.1676.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||r,this.fingerprint=t[0]?.metadata?.documentFingerprint??r,this.account=o,this.timestamp=(new Date).toString();const i=t[0]?.segment;if(i){const e=[];if(i.cfi&&e.push(["CFI",i.cfi]),i.pages){const t=`${i.pages.start}-${i.pages.end}`;e.push(["Pages",t])}i.url&&e.push(["URL",i.url]),this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}
584
584
  asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}var Mf=function(){if(Tf)return Af;Tf=1;var e="complete",t="canceled";function n(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function r(t){var o=t._scrollSettings;if(o){var i=o.maxSynchronousAlignments,a=function(e,t){var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),d=c&&null!=c.left?c.left:.5,h=c&&null!=c.top?c.top:.5,p=c&&null!=c.leftOffset?c.leftOffset:0,m=c&&null!=c.topOffset?c.topOffset:0,f=d,g=h;if(e.isWindow(t))s=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),r=u.left+t.pageXOffset-t.innerWidth*f+s*f,o=u.top+t.pageYOffset-t.innerHeight*g+l*g,r-=p,o-=m,r=e.align.lockX?t.pageXOffset:r,o=e.align.lockY?t.pageYOffset:o,i=r-t.pageXOffset,a=o-t.pageYOffset;else{s=u.width,l=u.height,n=t.getBoundingClientRect();var v=u.left-(n.left-t.scrollLeft),b=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=b+l*g-t.clientHeight*g,r-=p,o-=m,r=Math.max(Math.min(r,t.scrollWidth-t.clientWidth),0),
585
585
  o=Math.max(Math.min(o,t.scrollHeight-t.clientHeight),0),r=e.align.lockX?t.scrollLeft:r,o=e.align.lockY?t.scrollTop:o,i=r-t.scrollLeft,a=o-t.scrollTop}return{x:r,y:o,differenceX:i,differenceY:a}}(o,t),s=Date.now()-o.startTime,l=Math.min(1/o.time*s,1);if(o.endIterations>=i)return n(t,a.x,a.y),t._scrollSettings=null,o.end(e);var c=1-o.ease(l);if(n(t,a.x-a.differenceX*c,a.y-a.differenceY*c),s>=o.time)return o.endIterations++,o.scrollAncestor&&r(o.scrollAncestor),void r(t);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(r.bind(null,t))}}function o(e){return e.self===e}function i(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function a(){return!0}function s(e){if(e.assignedSlot)return s(e.assignedSlot);if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement
586
586
  ;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}return Af=function(n,l,c){if(n){"function"==typeof l&&(c=l,l=null),l||(l={}),l.time=isNaN(l.time)?1e3:l.time,l.ease=l.ease||function(e){return 1-Math.pow(1-e,e/2)},l.align=l.align||{};var u=s(n),d=1,h=l.validTarget||a,p=l.isScrollable;l.debug&&(console.log("About to scroll to",n),u||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var m=[];u;)if(l.debug&&console.log("Scrolling parent node",u),h(u,d)&&(p?p(u,i):i(u))&&(d++,m.push(u)),!(u=s(u))){f(e);break}return m.reduce(((e,i,a)=>function(e,n,i,a,s){var l,c=!n._scrollSettings,u=n._scrollSettings,d=Date.now(),h={passive:!0};function p(e){n._scrollSettings=null,n.parentElement&&n.parentElement._scrollSettings&&n.parentElement._scrollSettings.end(e),i.debug&&console.log("Scrolling ended with type",e,"for",n),s(e),l&&(n.removeEventListener("touchstart",l,h),n.removeEventListener("wheel",l,h))}u&&u.end(t);var m=i.maxSynchronousAlignments;return null==m&&(m=3),
@@ -639,9 +639,9 @@ return t.filter((t=>e.includes(t.id)||t.groupid&&e.includes(t.groupid)))}(e,t).m
639
639
  this._api.analytics.events.create({},{event:e}).catch((t=>console.warn(`Could not track event "${e}"`,t)))}}yv.$inject=["api"];class _v{constructor(e){this._rpc=e.rpc,this._reportConfig=e.reportActivity}reportActivity(e,t){if(!this._rpc||!this._reportConfig)return;let n;switch(e){case"create":n=new Date(t.created).toISOString();break;case"update":n=new Date(t.updated).toISOString();break;default:n=(new Date).toISOString()}const r={date:n,annotation:{id:t.id,isShared:kp(t.permissions)}};this._reportConfig.events.includes(e)&&this.notify(this._reportConfig.method,[e,r])}notifyUnsavedChanges(e){this.notify("reportUnsavedChanges",[{unsaved:e}])}notify(e,t){this._rpc&&function(e,t,n,r=[]){const o={jsonrpc:"2.0",method:n,params:r};e.postMessage(o,t)}(this._rpc.targetFrame,this._rpc.origin,e,t)}}_v.$inject=["settings"];class wv{constructor(e,t,n,r){this._activity=e,this._api=t,this._settings=n,this._store=r}_applyDraftChanges(e,t){
640
640
  const n={},r=this._store.getDraft(e),o=zr(this._store.profile().userid)?.provider??this._store.defaultAuthority(),i=this._store.isFeatureEnabled("at_mentions");if(!r)return{...e};i?"username"===t.mentionMode?n.text=function(e,t){return e.replace(Rp,((e,n,r)=>`${n}${Fp(function(e,t){return`acct:${e}@${t}`}(r,t),`@${r}`)}`))}(r.text,o):n.text=function(e,t){return e.replace(Hp,((e,n,r)=>{const o=t.get(r);return o?`${n}${Fp(o.userid,`@${r}`)}`:`${n}${Bp(r)}`}))}(r.text,t.usersMap):n.text=r.text,n.tags=r.tags,n.permissions=r.isPrivate?_p(e.user):wp(e.user,e.group);const a=e.target;if(a[0]&&a[0].description!==r.description){const e=structuredClone(a);e[0].description=r.description,n.target=e}return{...e,...n}}annotationFromData(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;if(!i)throw new Error("Cannot create annotation when logged out")
641
641
  ;const a=o.user_info,s=`s:${ev(8)}`,l=Object.assign({created:t.toISOString(),group:r,permissions:xp(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return $r(l)&&(l.permissions=_p(i)),this._settings.annotationMetadata&&(l.metadata={...this._settings.annotationMetadata}),l}create(e,t=new Date){const n=this.annotationFromData(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),$r(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:Sp(n.permissions),description:n.target[0]?.description}),qr(n)?this._store.selectTab("note"):Ur(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:[{source:e.uri}],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),
642
- this._activity.reportActivity("delete",e),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._activity.reportActivity("flag",e),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:Sp(e.permissions)?_p(t):wp(t,e.group),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e,t={mentionMode:"username"}){let n,r;const o=this._applyDraftChanges(e,t);let i;Rr(e)?(n=this._api.annotation.update({id:e.id},o),r="update"):(n=this._api.annotation.create({},o),r="create"),this._store.annotationSaveStarted(e);try{i=await n,this._activity.reportActivity(r,i)}finally{this._store.annotationSaveFinished(e)}for(const[t,n]of Object.entries(e))if(t.startsWith("$")){i[t]=n}return this._store.removeDraft(e),this._store.addAnnotations([i]),i}async moderate(e,t){const n=await this._api.annotation.moderate({id:e.id},{moderation_status:t,annotation_updated:e.updated})
643
- ;return this._store.addAnnotations([n]),n}async loadAnnotation(e){const t=await this._api.annotation.read({id:e});return this._store.addAnnotations([t]),t}}if(wv.$inject=["annotationActivity","api","settings","store"],"function"!=typeof Symbol){var xv=0;Symbol=function(e){return"@@"+e+ ++xv},Symbol.for=function(e){return"@@"+e}}var kv=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,Sv=/[\s\n\\/='"\0<>]/,Av=/^(xlink|xmlns|xml)([A-Z])/,Tv=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,Ev=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,Cv=/["&<]/;function Mv(e){if(0===e.length||!1===Cv.test(e))return e;for(var t=0,n=0,r="",o="";n<e.length;n++){
644
- switch(e.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 60:o="&lt;";break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=o,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var Nv=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},Iv=function(e,t,n){return String(e).length>40||-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},zv={},Ov=new Set(["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","fill-opacity","flex","flex-grow","flex-negative","flex-order","flex-positive","flex-shrink","flood-opacity","font-weight","grid-column","grid-row","line-clamp","line-height","opacity","order","orphans","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","widows","z-index","zoom"]),Lv=/[A-Z]/g;function Pv(e){var t="";for(var n in e){var r=e[n];if(null!=r&&""!==r){
642
+ this._activity.reportActivity("delete",e),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._activity.reportActivity("flag",e),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:Sp(e.permissions)?_p(t):wp(t,e.group),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e,t={mentionMode:"username"}){let n,r;const o=this._applyDraftChanges(e,t);let i;Rr(e)?(n=this._api.annotation.update({id:e.id},o),r="update"):(n=this._api.annotation.create({},o),r="create"),this._store.annotationSaveStarted(e);try{i=await n,this._activity.reportActivity(r,i)}finally{this._store.annotationSaveFinished(e)}for(const[t,n]of Object.entries(e))if(t.startsWith("$")){i[t]=n}return this._store.removeDraft(e),this._store.addAnnotations([i]),i}async moderate(e,t){const n=await this._api.annotation.moderate({id:e.id},{moderation_status:t,current_moderation_status:e.moderation_status,
643
+ annotation_updated:e.updated});return this._store.addAnnotations([n]),n}async loadAnnotation(e){const t=await this._api.annotation.read({id:e});return this._store.addAnnotations([t]),t}}if(wv.$inject=["annotationActivity","api","settings","store"],"function"!=typeof Symbol){var xv=0;Symbol=function(e){return"@@"+e+ ++xv},Symbol.for=function(e){return"@@"+e}}var kv=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,Sv=/[\s\n\\/='"\0<>]/,Av=/^(xlink|xmlns|xml)([A-Z])/,Tv=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,Ev=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,Cv=/["&<]/;function Mv(e){if(0===e.length||!1===Cv.test(e))return e
644
+ ;for(var t=0,n=0,r="",o="";n<e.length;n++){switch(e.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 60:o="&lt;";break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=o,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var Nv=function(e,t){return String(e).replace(/(\n+)/g,"$1"+(t||"\t"))},Iv=function(e,t,n){return String(e).length>40||-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},zv={},Ov=new Set(["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","fill-opacity","flex","flex-grow","flex-negative","flex-order","flex-positive","flex-shrink","flood-opacity","font-weight","grid-column","grid-row","line-clamp","line-height","opacity","order","orphans","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","widows","z-index","zoom"]),Lv=/[A-Z]/g;function Pv(e){var t="";for(var n in e){var r=e[n];if(null!=r&&""!==r){
645
645
  var o="-"==n[0]?n:zv[n]||(zv[n]=n.replace(Lv,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||Ov.has(o)||(i="px;"),t=t+o+":"+r+i}}return t||void 0}function Rv(e,t){return Array.isArray(t)?t.reduce(Rv,e):null!=t&&!1!==t&&e.push(t),e}function Dv(){this.__d=!0}function Hv(e,t){return{__v:e,context:t,props:e.props,setState:Dv,forceUpdate:Dv,__d:!0,__h:new Array(0)}}function Fv(e,t){var n=e.contextType,r=n&&t[n.__c];return null!=n?r?r.props.value:n.__:t}var jv=[],$v=[];function Bv(e,n,r,o){var i=t.__s;t.__s=!0;try{return qv(e,n||{},r,o)}finally{t.__c&&t.__c(e,$v),t.__s=i,$v.length=0}}function qv(e,n,r,o,i,a){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":Mv(e+"");var s=r.pretty,l=s&&"string"==typeof s?s:"\t";if(Array.isArray(e)){for(var c="",u=0;u<e.length;u++)s&&u>0&&(c+="\n"),c+=qv(e[u],n,r,o,i,a);return c}if(void 0!==e.constructor)return"";t.__b&&t.__b(e);var d,h=e.type,p=e.props,m=!1;if("function"==typeof h){if(m=!0,
646
646
  !r.shallow||!o&&!1!==r.renderRootComponent||h===y){if(h===y){var f=[];return Rv(f,e.props.children),qv(f,n,r,!1!==r.shallowHighOrder,i,a)}var g,v=e.__c=Hv(e,n),b=t.__r;if(h.prototype&&"function"==typeof h.prototype.render){var _=Fv(h,n);(v=e.__c=new h(p,_)).__v=e,v._dirty=v.__d=!0,v.props=p,null==v.state&&(v.state={}),null==v._nextState&&null==v.__s&&(v._nextState=v.__s=v.state),v.context=_,h.getDerivedStateFromProps?v.state=Object.assign({},v.state,h.getDerivedStateFromProps(v.props,v.state)):v.componentWillMount&&(v.componentWillMount(),v.state=v._nextState!==v.state?v._nextState:v.__s!==v.state?v.__s:v.state),b&&b(e),g=v.render(v.props,v.state,v.context)}else for(var w=Fv(h,n),x=0;v.__d&&x++<25;)v.__d=!1,b&&b(e),g=h.call(e.__c,p,w);v.getChildContext&&(n=Object.assign({},n,v.getChildContext()));var k=qv(g,n,r,!1!==r.shallowHighOrder,i,a);return t.diffed&&t.diffed(e),k}h=(d=h).displayName||d!==Function&&d.name||Uv(d)}var S,A,T="<"+h;if(p){var E=Object.keys(p);r&&!0===r.sortAttributes&&E.sort()
647
647
  ;for(var C=0;C<E.length;C++){var M=E[C],N=p[M];if("children"!==M){if(!Sv.test(M)&&(r&&r.allAttributes||"key"!==M&&"ref"!==M&&"__self"!==M&&"__source"!==M)){if("defaultValue"===M)M="value";else if("defaultChecked"===M)M="checked";else if("defaultSelected"===M)M="selected";else if("className"===M){if(void 0!==p.class)continue;M="class"}else"acceptCharset"===M?M="accept-charset":"httpEquiv"===M?M="http-equiv":Av.test(M)?M=M.replace(Av,"$1:$2").toLowerCase():i?Ev.test(M)&&(M="panose1"===M?"panose-1":M.replace(/([A-Z])/g,"-$1").toLowerCase()):Tv.test(M)&&(M=M.toLowerCase());if("htmlFor"===M){if(p.for)continue;M="for"}"style"===M&&N&&"object"==typeof N&&(N=Pv(N)),"a"===M[0]&&"r"===M[1]&&"boolean"==typeof N&&(N=String(N));var I=r.attributeHook&&r.attributeHook(M,N,n,r,m);if(I||""===I)T+=I;else if("dangerouslySetInnerHTML"===M)A=N&&N.__html;else if("textarea"===h&&"value"===M)S=N;else if((N||0===N||""===N)&&"function"!=typeof N){if(!(!0!==N&&""!==N||(N=M,r&&r.xml))){T=T+" "+M;continue}if("value"===M){
@@ -667,7 +667,7 @@ buildTextExportContent(e,{groupName:t="",displayNamesEnabled:n=!1,defaultAuthori
667
667
  ${u.join("\n\n")}`}buildCSVExportContent(e,{groupName:t="",defaultAuthority:n="",displayNamesEnabled:r=!1,separator:o=","}={}){const{uri:i,extractUsername:a}=this._exportCommon(e,{displayNamesEnabled:r,defaultAuthority:n}),s=e=>[yb(new Date(e.created)),a(e),Qr(e)??"",i,t,Gr(e),Kr(e)??Yr(e)??"",e.text,e.tags.join(",")].map((e=>function(e,t){return new RegExp(`["\n\r${t}]`).test(e)?`"${e.replace(/"/g,'""')}"`:e}(e,o))).join(o);return`${["Created at","Author","Page","URL","Group","Type","Quote/description","Comment","Tags"].join(o)}\n${e.map((e=>s(e))).join("\n")}`}buildHTMLExportContent(e,{groupName:t="",displayNamesEnabled:n=!1,defaultAuthority:r="",now:o=new Date}={}){const{uri:i,title:a,uniqueUsers:s,replies:l,extractUsername:c}=this._exportCommon(e,{displayNamesEnabled:n,defaultAuthority:r});return function(e,t,n){var r=Object.assign({},fb,n||{});return r.jsx||(r.attributeHook=null),Bv(e,t,r)}(Ve("html",{lang:"en",children:[Ve("head",{children:[Ve("title",{children:`Annotations on "${a}"`
668
668
  }),Ve("meta",{charSet:"UTF-8"})]}),Ve("body",{children:[Ve("section",{children:[Ve("h1",{children:"Summary"}),Ve("p",{children:Ve("time",{dateTime:o.toISOString(),children:yb(o)})}),Ve("p",{children:Ve("strong",{children:a})}),Ve("p",{children:Ve("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})}),Ve("table",{children:Ve("tbody",{style:{verticalAlign:"top"},children:[Ve("tr",{children:[Ve("td",{children:"Group:"}),Ve("td",{children:t})]}),Ve("tr",{children:[Ve("td",{children:"Total users:"}),Ve("td",{children:s.length})]}),Ve("tr",{children:[Ve("td",{children:"Users:"}),Ve("td",{children:s.join(", ")})]}),Ve("tr",{children:[Ve("td",{children:"Total annotations:"}),Ve("td",{children:e.length})]}),Ve("tr",{children:[Ve("td",{children:"Total replies:"}),Ve("td",{children:l.length})]})]})})]}),Ve("hr",{}),Ve("section",{children:[Ve("h1",{children:"Annotations"}),e.map(((e,t)=>{const n=Qr(e),r=Kr(e),o=Yr(e),i=Qh(e.text),a=i===`<p>${e.text}</p>`?e.text:i;return Ve("article",{children:[Ve("h2",{
669
669
  children:["Annotation ",t+1,":"]}),Ve("table",{children:Ve("tbody",{style:{verticalAlign:"top"},children:[Ve("tr",{children:[Ve("td",{children:"Created at:"}),Ve("td",{children:Ve("time",{dateTime:e.created,children:yb(new Date(e.created))})})]}),Ve("tr",{children:[Ve("td",{children:"Author:"}),Ve("td",{children:c(e)})]}),n&&Ve("tr",{children:[Ve("td",{children:"Page:"}),Ve("td",{children:n})]}),Ve("tr",{children:[Ve("td",{children:"Type:"}),Ve("td",{children:Gr(e)})]}),r&&Ve("tr",{children:[Ve("td",{children:"Quote:"}),Ve("td",{children:Ve("blockquote",{style:{margin:0},children:r})})]}),o&&Ve("tr",{children:[Ve("td",{children:"Description:"}),Ve("td",{children:o})]}),Ve("tr",{children:[Ve("td",{children:"Comment:"}),Ve("td",{dangerouslySetInnerHTML:{__html:a}})]}),e.tags.length>0&&Ve("tr",{children:[Ve("td",{children:"Tags:"}),Ve("td",{children:e.tags.join(", ")})]})]})})]},e.id)}))]})]})]}),{},{pretty:!0}).replace(/\t/g," ")}_exportCommon(e,{displayNamesEnabled:t,defaultAuthority:n}){const[r]=e
670
- ;if(!r)throw new Error("No annotations to export");const o=e=>Xi(e,n,t),{uri:i,title:a}=Zi(r);return{uri:i,title:a,uniqueUsers:[...new Set(e.map((e=>o(e))).filter(Boolean))],replies:e.filter((e=>Pr(e))),extractUsername:o}}}_b.$inject=[];class wb{constructor(e,t,n){this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s,l)=>{o();try{const[o,i]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1675.0"};i&&(u.Authorization="Bearer "+i);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:p}=ci(c.url,a),m=new URL(h);for(const[e,t]of Object.entries(p)){const n=Array.isArray(t)?t:[t]
670
+ ;if(!r)throw new Error("No annotations to export");const o=e=>Xi(e,n,t),{uri:i,title:a}=Zi(r);return{uri:i,title:a,uniqueUsers:[...new Set(e.map((e=>o(e))).filter(Boolean))],replies:e.filter((e=>Pr(e))),extractUsername:o}}}_b.$inject=[];class wb{constructor(e,t,n){this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s,l)=>{o();try{const[o,i]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1676.0"};i&&(u.Authorization="Bearer "+i);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:p}=ci(c.url,a),m=new URL(h);for(const[e,t]of Object.entries(p)){const n=Array.isArray(t)?t:[t]
671
671
  ;for(const t of n)null!=t&&m.searchParams.append(e,t.toString())}return await vp(m.toString(),{body:s?JSON.stringify(bb(s)):null,headers:u,method:c.method,signal:l})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={read:i("annotation.read"),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"),moderate:i("annotation.moderate")},this.group={member:{delete:i("group.member.delete")},members:{read:i("group.members.read")},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")},this.analytics={events:{create:i("analytics.events.create")}}}setClientId(e){this._clientId=e}}wb.$inject=["apiRoutes","auth","store"]
672
672
  ;var xb,kb,Sb,Ab,Tb,Eb={};function Cb(){return Sb||(Sb=1,e=Eb,t=function(){if(kb)return xb;function e(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))}return kb=1,xb=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.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),
673
673
  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},e.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){n._operationTimeoutCb()}),n._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},e.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},e.prototype.start=function(e){
@@ -783,8 +783,8 @@ this._socket?.isConnected()&&this._socket.send(t)}async _reconnect(){const e=awa
783
783
  this._reconnectSetUp||(this._reconnectSetUp=!0,Kb(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}yS.$inject=["store","apiRoutes","auth","groups","session","$window"];const _S="hypothesis.user.tags.list",wS="hypothesis.user.tags.map";class xS{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject(_S)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${dv(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject(wS)||{};e.forEach((e=>{t[e]?(t[e].count+=1,t[e].updated=Date.now()):t[e]={text:e,count:1,updated:Date.now()}})),this._storage.setObject(wS,t);const n=Object.keys(t).sort(((e,n)=>t[e].count!==t[n].count?t[n].count-t[e].count:e.localeCompare(n)));this._storage.setObject(_S,n)}}xS.$inject=["localStorage"];class kS{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),
784
784
  e.visible||this._store.setForcedVisible(e.id,!0)}}kS.$inject=["store"];class SS{#t=new Map;#n=30;#r;constructor(e){this.#r=e}get cacheSize(){return this.#n}set cacheSize(e){this.#n=e,this.#o()}#o(){for(const e of this.#t.keys()){const t=this.#t.get(e);if(t&&URL.revokeObjectURL(t.url),this.#t.delete(e),this.#t.size<=this.cacheSize)break}}async fetch(e,t={}){const n=this.get(e);if(n)return n;const r=await this.#r.requestThumbnail(e,t),o=await async function(e){const t=new OffscreenCanvas(e.width,e.height);t.getContext("2d").drawImage(e,0,0,e.width,e.height);const n=await t.convertToBlob();return URL.createObjectURL(n)}(r),i={url:o,width:r.width,height:r.height};return this.#t.set(e,i),this.#t.size>this.cacheSize&&this.#o(),i}get(e){const t=this.#t.get(e);return t?(this.#t.delete(e),this.#t.set(e,t),t):null}cachedThumbnailTags(){return[...this.#t.keys()]}}SS.$inject=["frameSync"];class AS extends $f{constructor(e,t){super(),this._store=e,this._window=t,this._delayedMessageQueue=[],
785
785
  this._window.addEventListener("focus",(()=>{this._delayedMessageQueue.forEach((({type:e,messageText:t,options:n})=>this._addMessage(e,t,n))),this._delayedMessageQueue=[]}))}dismiss(e){this._store.getToastMessage(e)&&(this._store.removeToastMessage(e),this.emit("toastMessageDismissed",e))}_addMessage(e,t,{autoDismiss:n=!0,visuallyHidden:r=!1,delayed:o=!1}={}){if(this._store.hasToastMessage(e,t))return;if(o&&!this._window.document.hasFocus()){const o={autoDismiss:n,visuallyHidden:r};return void this._delayedMessageQueue.push({type:e,messageText:t,options:o})}const i={type:e,id:ev(10),message:t,visuallyHidden:r,autoDismiss:n};this._store.addToastMessage(i),this.emit("toastMessageAdded",i)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}AS.$inject=["store","$window"];const TS=function(e){for(var t={},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(e){
786
- console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),ES=function(e){const{version:t,origin:n}=nv(e.location.href);return"1.1675.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1675.0) than the host page (${t}). It may not work.`),!1):"null"===e.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):e.origin===n||(console.warn(`The Hypothesis sidebar is running in a different origin (${e.origin}) than expected (${n}). It may not work.`),!1)}(window);function CS(e,t){e.setClientId(t.clientId)}function MS(e){e.sync()}function NS(e,t){e.load(),t.load()}function IS(e,t,n){e.init(),t.init(),n.init()}function zS(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{autoDismiss:!1})}))}TS.sentry&&ES&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null
787
- }(),n=t?[t]:void 0;!function(e={}){const t=!e.skipBrowserExtensionCheck&&oS(),n={...e,enabled:!t&&e.enabled,stackParser:(r=e.stackParser||Bk,Array.isArray(r)?yy(...r):r),integrations:tx({integrations:e.integrations,defaultIntegrations:null==e.defaultIntegrations?[Lx(),Ix(),Kk(),Vk(),Jk(),rS(),qx(),nS(),Qk()]:e.defaultIntegrations}),transport:e.transport||Ok};var r;bx(vk,n)}({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1675.0",beforeSend:(e,t)=>{if(iS>=5)return lv("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++iS;try{const n=t&&t.originalException;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch{}return e}});try{Ww("host_config",nv(window.location.href))}catch{}Ww("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),
786
+ console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),ES=function(e){const{version:t,origin:n}=nv(e.location.href);return"1.1676.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1676.0) than the host page (${t}). It may not work.`),!1):"null"===e.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):e.origin===n||(console.warn(`The Hypothesis sidebar is running in a different origin (${e.origin}) than expected (${n}). It may not work.`),!1)}(window);function CS(e,t){e.setClientId(t.clientId)}function MS(e){e.sync()}function NS(e,t){e.load(),t.load()}function IS(e,t,n){e.init(),t.init(),n.init()}function zS(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{autoDismiss:!1})}))}TS.sentry&&ES&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null
787
+ }(),n=t?[t]:void 0;!function(e={}){const t=!e.skipBrowserExtensionCheck&&oS(),n={...e,enabled:!t&&e.enabled,stackParser:(r=e.stackParser||Bk,Array.isArray(r)?yy(...r):r),integrations:tx({integrations:e.integrations,defaultIntegrations:null==e.defaultIntegrations?[Lx(),Ix(),Kk(),Vk(),Jk(),rS(),qx(),nS(),Qk()]:e.defaultIntegrations}),transport:e.transport||Ok};var r;bx(vk,n)}({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1676.0",beforeSend:(e,t)=>{if(iS>=5)return lv("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++iS;try{const n=t&&t.originalException;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch{}return e}});try{Ww("host_config",nv(window.location.href))}catch{}Ww("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),
788
788
  $b(((e,t)=>{aS(e,t)}))}(TS.sentry),document.body.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")})),CS.$inject=["api","streamer"],MS.$inject=["router"],NS.$inject=["groups","session"],IS.$inject=["autosaveService","persistedDefaults","serviceURL"],zS.$inject=["frameSync","store","toastMessenger"];const OS=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",bv)}(),async function(e,t=window){const n=function(e){const t=nv(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:rv,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:iv(t.origin),ancestorLevel:ov(t.ancestorLevel)}}},o={};for(const[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i)
789
789
  ;return o}(window),r=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null;if("number"!=typeof n.ancestorLevel||"string"!=typeof n.origin)throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified");return{targetFrame:av(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await tv(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(n,r);o=function(e,t){const n=e.services;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=tv(t.targetFrame,t.origin,"requestGroups",[n],0).catch((()=>{throw new Error("Unable to fetch groups")})))})),e):e}(e,r)}else o=n;const i={...e,...o};return r&&(i.rpc=r),i.apiUrl=function(e){const t=Kn(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}(i),i}(TS).then((e=>{!function(e,t){const n=new U
790
790
  ;n.register("analytics",yv).register("annotationsExporter",_b).register("annotationsService",wv).register("annotationActivity",_v).register("api",wb).register("apiRoutes",zb).register("auth",Pb).register("autosaveService",Rb).register("dashboard",Db).register("frameSync",Zb).register("groups",ey).register("importAnnotationsService",lS).register("loadAnnotationsService",cS).register("localStorage",dS).register("persistedDefaults",pS).register("router",mS).register("serviceURL",fS).register("session",gS).register("streamer",yS).register("streamFilter",vS).register("tags",xS).register("threadsService",kS).register("thumbnailService",SS).register("toastMessenger",AS).register("store",{factory:Di}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(MS),n.run(IS),n.run(CS),n.run(NS),n.run(vv),n.run(zS),F(Ve(Qn.Provider,{value:n,children:Ve(Zg,{})}),t)}(e,OS)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),F(Ve(Qg,{error:e}),t)}(e,OS)));