hypothesis 1.1120.0 → 1.1121.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 s(s){s.setAttribute("data-hypothesis-asset","")}function t(t,e){var n=t.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,s(n),t.head.appendChild(n)}function e(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,o=void 0===r||r,a=n.forceReload,i=void 0!==a&&a,l=t.createElement("script");o&&(l.type="module"),i&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,s(l),t.head.appendChild(l)}function n(t,e,n,r){var o=t.createElement("link");o.rel=e,o.href=r,o.type="application/annotator+".concat(n),s(o),t.head.appendChild(o)}function r(t,e,n){var r=t.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),s(r),t.head.appendChild(r)}function o(s,t){return s.assetRoot+"build/"+s.manifest[t]}function a(s){var t=s.match(/(https?):\/\/([^:/]+)/);return t?{protocol:t[1],hostname:t[2]}:null}function i(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=s.currentScript;return t?a(t.src):null}function l(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=i(t);if(!e)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",e.hostname)).replace("{current_scheme}",e.protocol)}var c={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?31e697","styles/annotator.css":"styles/annotator.css?ee3462","styles/annotator.css.map":"styles/annotator.css.map?82cd76","styles/highlights.css":"styles/highlights.css?5dd56a","styles/highlights.css.map":"styles/highlights.css.map?5d963f","styles/katex.min.css":"styles/katex.min.css?817f75","styles/katex.min.css.map":"styles/katex.min.css.map?42d80c","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?297c7c","styles/sidebar.css.map":"styles/sidebar.css.map?11431f","styles/ui-playground.css":"styles/ui-playground.css?199a35","styles/ui-playground.css.map":"styles/ui-playground.css.map?d40b2f","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?ca1dd8","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?271819","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?62b899","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?4b63a1","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?97b937"};if(function(){var s=[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 s.every((function(s){return s()}))}catch(s){return!1}}()){var p=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),n=0;n<e.length;n++){var r=void 0;try{r=JSON.parse(e[n].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(t,r)}return t}(document),u=l(p.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1120.0/");if(document.querySelector("hypothesis-app")){!function(s,n){r(s,"fetch",n.apiUrl),r(s,"fetch",n.apiUrl+"links");for(var a=0,i=["scripts/sidebar.bundle.js"];a<i.length;a++)e(s,o(n,i[a]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,o(n,c[l]))}(document,{assetRoot:u,manifest:c,apiUrl:p.apiUrl})}else{var d=p,h=l(d.notebookAppUrl||"https://hypothes.is/notebook"),y=l(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,a){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",a.sidebarAppUrl),n(s,"notebook","html",a.notebookAppUrl),r(s,"style",o(a,"styles/annotator.css")),n(s,"hypothesis-client","javascript",a.assetRoot+"build/boot.js");for(var i=0,l=["scripts/annotator.bundle.js"];i<l.length;i++)e(s,o(a,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,u=c;p<u.length;p++)t(s,o(a,u[p]))}}(document,{assetRoot:u,manifest:c,notebookAppUrl: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";function s(s){s.setAttribute("data-hypothesis-asset","")}function t(t,e){var n=t.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,s(n),t.head.appendChild(n)}function e(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,o=void 0===r||r,a=n.forceReload,i=void 0!==a&&a,l=t.createElement("script");o&&(l.type="module"),i&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,s(l),t.head.appendChild(l)}function n(t,e,n,r){var o=t.createElement("link");o.rel=e,o.href=r,o.type="application/annotator+".concat(n),s(o),t.head.appendChild(o)}function r(t,e,n){var r=t.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),s(r),t.head.appendChild(r)}function o(s,t){return s.assetRoot+"build/"+s.manifest[t]}function a(s){var t=s.match(/(https?):\/\/([^:/]+)/);return t?{protocol:t[1],hostname:t[2]}:null}function i(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=s.currentScript;return t?a(t.src):null}function l(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=i(t);if(!e)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",e.hostname)).replace("{current_scheme}",e.protocol)}var c={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?887a4b","styles/annotator.css":"styles/annotator.css?ee3462","styles/annotator.css.map":"styles/annotator.css.map?82cd76","styles/highlights.css":"styles/highlights.css?5dd56a","styles/highlights.css.map":"styles/highlights.css.map?5d963f","styles/katex.min.css":"styles/katex.min.css?817f75","styles/katex.min.css.map":"styles/katex.min.css.map?42d80c","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?297c7c","styles/sidebar.css.map":"styles/sidebar.css.map?11431f","styles/ui-playground.css":"styles/ui-playground.css?199a35","styles/ui-playground.css.map":"styles/ui-playground.css.map?d40b2f","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?ca1dd8","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?34a212","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?271819","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?62b899","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?97b937"};if(function(){var s=[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 s.every((function(s){return s()}))}catch(s){return!1}}()){var p=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),n=0;n<e.length;n++){var r=void 0;try{r=JSON.parse(e[n].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(t,r)}return t}(document),u=l(p.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1121.0/");if(document.querySelector("hypothesis-app")){!function(s,n){r(s,"fetch",n.apiUrl),r(s,"fetch",n.apiUrl+"links");for(var a=0,i=["scripts/sidebar.bundle.js"];a<i.length;a++)e(s,o(n,i[a]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,o(n,c[l]))}(document,{assetRoot:u,manifest:c,apiUrl:p.apiUrl})}else{var d=p,h=l(d.notebookAppUrl||"https://hypothes.is/notebook"),y=l(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,a){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",a.sidebarAppUrl),n(s,"notebook","html",a.notebookAppUrl),r(s,"style",o(a,"styles/annotator.css")),n(s,"hypothesis-client","javascript",a.assetRoot+"build/boot.js");for(var i=0,l=["scripts/annotator.bundle.js"];i<l.length;i++)e(s,o(a,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,u=c;p<u.length;p++)t(s,o(a,u[p]))}}(document,{assetRoot:u,manifest:c,notebookAppUrl: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?31e697",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?887a4b",
3
3
  "styles/annotator.css": "styles/annotator.css?ee3462",
4
4
  "styles/annotator.css.map": "styles/annotator.css.map?82cd76",
5
5
  "styles/highlights.css": "styles/highlights.css?5dd56a",
@@ -13,8 +13,8 @@
13
13
  "styles/ui-playground.css": "styles/ui-playground.css?199a35",
14
14
  "styles/ui-playground.css.map": "styles/ui-playground.css.map?d40b2f",
15
15
  "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?ca1dd8",
16
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?34a212",
16
17
  "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?271819",
17
18
  "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?62b899",
18
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?4b63a1",
19
19
  "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?97b937"
20
20
  }
@@ -108,7 +108,7 @@ const[t,e]=await Promise.all([this._integration.uri(),this._integration.getMetad
108
108
  destroy(){this._portFinder.destroy(),this._hostRPC.destroy(),this._sidebarRPC.destroy(),this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.destroy(),this._bucketBarClient.destroy(),function(t){Ie(Array.from(t.querySelectorAll("hypothesis-highlight")))}(this.element),this._integration.destroy()}async anchor(t){const e=t=>{const e=ji(t);if(!e)return;const n=Me(e);n.forEach((e=>{e._annotation=t.annotation})),t.highlights=n,this._hoveredAnnotations.has(t.annotation.$tag)&&Be(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=>{if(!e.selector||!e.selector.some((t=>"TextQuoteSelector"===t.type)))return{annotation:t,target:e};let n;try{const i=await this._integration.anchor(this.element,e.selector),o=Ee.fromRange(i);n={annotation:t,target:e,range:o}}catch(i){n={annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(let t of n)e(t)
109
109
  ;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&&Ie(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){this.anchors=t,e&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),i=this.element,o=(await Promise.all(e.map((t=>this._integration.describe(i,t))))).map((t=>({source:n.uri,selector:t}))),r={uri:n.uri,document:n.metadata,target:o,$highlight:t,$tag:"a:"+Ct(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Xi(),r}_hoverAnnotations(t){this._hoveredAnnotations.clear(),t.forEach((t=>this._hoveredAnnotations.add(t)));for(let e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);Be(e.highlights,n)}
110
110
  this._sidebarRPC.call("hoverAnnotations",t)}_scrollToClosestOffScreenAnchor(t,e){const n=function(t,e){let n=null,i=0;for(let r of t){var o;if(null===(o=r.highlights)||void 0===o||!o.length)continue;const t=He(r.highlights).top;"up"===e&&t>=137||"down"===e&&t<=window.innerHeight-22||(!n||"up"===e&&t>i||"down"===e&&t<i)&&(n=r,i=t)}return n}(this.anchors.filter((({annotation:e})=>t.includes(e.$tag))),e);n&&this._integration.scrollToAnchor(n)}_onSelection(t){if(!this._integration.canAnnotate(t))return void this._onClearSelection();const e=document.getSelection(),n=Ne(e),i=Le(e);i?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=Wi(),this._isAdderVisible=!0,this._adder.show(i,n)):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}={}){
111
- e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(t,e=!0){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){Zt(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function Zi(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function Gi(t,e){var n;const i={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.1120.0";const o=new URL(window.location.href)
111
+ e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(t,e=!0){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){Zt(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function Zi(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function Gi(t,e){var n;const i={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.1121.0";const o=new URL(window.location.href)
112
112
  ;if(o.hash="",i.hostURL=o.toString(),Array.isArray(i.services)&&(null===(n=i.services)||void 0===n?void 0:n.length)>0){const t=i.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return i}function Ki({config:t,groupId:e}){return lt("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:Zi(t.notebookAppUrl,{...Gi(t.notebookAppUrl,t),group:e})})}function Qi({eventBus:t,config:e}){const[n,i]=G(0),[o,r]=G(!0),[s,a]=G(null),l=J(""),h=J(null);K((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),K((()=>{document.body.style.overflow=o?l.current:"hidden"}),[o]),K((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),i((t=>t+1)),a(t)})),h.current=e,()=>{e.destroy()}}),[t])
113
113
  ;return null===s?null:lt("div",{className:c("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:o}),"data-testid":"notebook-outer",children:lt("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[lt("div",{className:"absolute right-0 text-xl m-3",children:lt(pt,{icon:"cancel",title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=h.current)||void 0===t||t.publish("closeNotebook")},variant:"dark"})}),lt(Ki,{config:e,groupId:s},n)]})})}class Ji{constructor(t,e,n){this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this.shadowRoot=ve(this._outerContainer),I(lt(Qi,{eventBus:e,config:n}),this.shadowRoot)}destroy(){I(null,this.shadowRoot),this._outerContainer.remove()}}var to={exports:{}};!function(t){!function(e,n,i,o){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){
114
114
  return!!Array.isArray(t)&&(f(t,n[e],n),!0)}function f(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==o)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function p(t,n,i){var o="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=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,o,i),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(t){if(t===o||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==o&&null!==i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign;var g=p((function(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&t[i[r]]===o)&&(t[i[r]]=e[i[r]]),r++;return t
@@ -588,7 +588,7 @@ function ng({onLogin:e,onSignUp:t}){return ls().isLoggedIn()?null:Yr(tg,{icon:"r
588
588
  r.selectTab(e)},u="annotation"===o&&0===a&&!l,d="note"===o&&0===i;return Yr("div",{className:qn("space-y-3 pb-[9px]"),children:[Yr("div",{className:"flex gap-x-6 theme-clean:ml-[15px]",role:"tablist",children:[Yr(rg,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),Yr(rg,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&Yr(rg,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&Yr("div",{className:"flex justify-end",children:Yr(eo,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:Do(["ctaBackgroundColor"],n),children:"New note"})}),!t&&d&&Yr(ro,{classes:"text-center",children:Yr("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&Yr(ro,{
589
589
  classes:"text-center",children:Yr("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",Yr("br",{}),"Create one by selecting some text and clicking the"," ",Yr(po,{classes:"inline m-0.5 -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"]);var ig=Bo((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){const i=Ps(),a=ls(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),d=a.directLinkedAnnotationId(),h=d?a.findAnnotationByID(d):void 0,p=h?Ts(h):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=h&&!1===h.$orphan?h.$tag:null,_=!(c||!d)&&!h,b=a.directLinkedGroupFetchFailed(),y=_||b,w=!y,x=!y&&!l,k=d&&!u&&!_&&!c,S=Ir(s);Rr((()=>{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})
590
590
  }),[a,r,s,g,m]),Rr((()=>{v?(e.hoverAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):h&&a.selectTab(p)}),[p,e,h,v,a]);const C=a.hasFetchedProfile();return Rr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),Yr("div",{children:[Yr("h2",{className:"sr-only",children:"Annotations"}),w&&Yr(Vf,{}),Yr(ng,{onLogin:t,onSignUp:n}),_&&Yr(qf,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),b&&Yr(qf,{errorType:"group",onLoginRequest:t}),x&&Yr(og,{isLoading:c}),Yr(Uf,{threads:i.children}),k&&Yr(Yf,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var ag=Bo((function({api:e,toastMessenger:t}){const n=ls(),r=n.routeParams().q,o=Pr((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...ws(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Rr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{
591
- t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),Yr(Uf,{threads:Ps().children})}),["api","toastMessenger"]);class sg{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.1120.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,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 lg(e){const n=t(e);return!(null==n||!n.authority)&&n.authority!==e.authDomain}function cg({commandName:e,iconName:t}){return Yr("span",{className:"whitespace-nowrap",children:[Yr(po,{name:t,
591
+ t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),Yr(Uf,{threads:Ps().children})}),["api","toastMessenger"]);class sg{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.1121.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,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 lg(e){const n=t(e);return!(null==n||!n.authority)&&n.authority!==e.authDomain}function cg({commandName:e,iconName:t}){return Yr("span",{className:"whitespace-nowrap",children:[Yr(po,{name:t,
592
592
  classes:qn("mx-1 -mt-1","text-color-text-light inline")}),Yr("em",{children:e})]})}var ug=Bo((function({settings:e}){const t=!lg(e);return Yr("ol",{className:"list-decimal pl-10 space-y-2",children:[Yr("li",{children:["To create an annotation, select text and then select the"," ",Yr(cg,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),Yr("li",{children:["To create a highlight (",Yr(mo,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/why-are-highlights-private-by-default/",target:"_blank",children:"visible only to you"}),"), select text and then select the"," ",Yr(cg,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&Yr("li",{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"," ",Yr(mo,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),Yr("li",{
593
593
  children:["To reply to an annotation, select the"," ",Yr(cg,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);function dg({label:e,children:t,classes:n}){return Yr(Xn,{children:[Yr("dt",{className:"col-span-1 sm:text-right font-medium",children:e}),Yr("dd",{className:qn("col-span-1 sm:col-span-3 text-color-text-light break-words",n),children:t})]})}var hg=Bo((function({toastMessenger:e,versionData:t}){return Yr("div",{className:"space-y-4",children:[Yr("dl",{className:"grid grid-cols-1 sm:grid-cols-4 sm:gap-x-2",children:[Yr(dg,{label:"Version",children:t.version}),Yr(dg,{label:"User Agent",children:t.userAgent}),Yr(dg,{classes:qn("break-all"),label:"URL",children:t.urls}),Yr(dg,{label:"Fingerprint",children:t.fingerprint}),Yr(dg,{label:"Account",children:t.account}),Yr(dg,{label:"Date",children:t.timestamp})]}),Yr("div",{className:"flex items-center justify-center",children:Yr(eo,{onClick:()=>{try{cl(t.asFormattedString()),e.success("Copied version info to clipboard")}catch(t){
594
594
  e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"]);function pg({children:e,onClick:t}){return Yr(Cl,{color:"brand",onClick:t,underline:"hover",children:Yr("div",{className:"flex items-center gap-x-1",children:[e,Yr(hl,{className:"w-em h-em"})]})})}function mg({linkText:e,url:t}){return Yr("div",{className:"flex-1 flex items-center justify-center border-r last-of-type:border-r-0 text-lg font-medium",children:Yr(Sl,{color:"text-light",href:t,target:"_blank",children:Yr("div",{className:"flex items-center gap-x-2",children:[Yr("span",{children:e})," ",Yr(ml,{className:"w-3 h-3"})]})})})}var fg=Bo((function({auth:e,session:t}){const n=ls(),r=n.frames(),o=n.mainFrame(),i=!!n.profile().preferences.show_sidebar_tutorial,[a,s]=Lr("tutorial"),l=Dr((()=>{const t=e||{status:"logged-out"},n=[...r].sort(((e,t)=>e===o?-1:t===o?1:0));return new sg(t,n)}),[e,r,o]),c=`https://web.hypothes.is/get-help/?sys_info=${l.asEncodedURLString()}`,u=(e,t)=>{
@@ -618,7 +618,7 @@ const c=!lg(s),u=Do(["accentColor"],s),d=ls(),h=d.filterQuery(),p=d.pendingUpdat
618
618
  ;return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?ol(e.user):il(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;if(!i)throw new Error("Cannot create annotation when logged out");const s=o.user_info,l="s:"+a(8),c=Object.assign({created:t.toISOString(),group:r,permissions:al(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:s,$tag:l,hidden:!1,links:{},document:{title:""}},e);return Ei(c)&&(c.permissions=ol(i)),c}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Ei(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!xi(n)}),Ti(n)?this._store.selectTab("note"):Ni(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){
619
619
  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._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:xi(e)?il(t,e.group):ol(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t,n;const r=this._applyDraftChanges(e);let o;yi(e)?(t=this._api.annotation.update({id:e.id},r),n="update"):(t=this._api.annotation.create({},r),n="create"),this._store.annotationSaveStarted(e);try{o=await t,this._activity.reportActivity(n,o)}finally{this._store.annotationSaveFinished(e)}for(let[t,n]of Object.entries(e))if(t.startsWith("$")){o[t]=n}
620
620
  return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}Wg.$inject=["annotationActivity","api","store"];class Kg{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:sl(t.permissions)}};this._reportConfig.events.includes(e)&&function(e,t,n,r=[]){const o={jsonrpc:"2.0",method:n,params:r};e.postMessage(o,t)}(this._rpc.targetFrame,this._rpc.origin,this._reportConfig.method,[e,r])}}Kg.$inject=["settings"];class Xg 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 Zg(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Xg(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){
621
- throw new Xg(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Xg(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Jg(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}function Qg(e){return"url"in e}function ev(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;const r=t.split(".");for(let[e,t]of r.entries()){const o=n[t];if(!o||Qg(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.1120.0"};l&&(u.Authorization="Bearer "+l);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:p}=Oa(c.url,a),m=new URL(h);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 Zg(m.toString(),{body:s?JSON.stringify(Jg(s)):null,headers:u,
621
+ throw new Xg(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Xg(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Jg(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}function Qg(e){return"url"in e}function ev(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;const r=t.split(".");for(let[e,t]of r.entries()){const o=n[t];if(!o||Qg(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.1121.0"};l&&(u.Authorization="Bearer "+l);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:p}=Oa(c.url,a),m=new URL(h);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 Zg(m.toString(),{body:s?JSON.stringify(Jg(s)):null,headers:u,
622
622
  method:c.method})}finally{i()}}}class tv{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>ev(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={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}}tv.$inject=["apiRoutes","auth","store"];var nv={exports:{}},rv={};function ov(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,
623
623
  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 iv=ov;ov.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},ov.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},ov.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++,
624
624
  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},ov.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)},ov.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},ov.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},ov.prototype.start=ov.prototype.try,ov.prototype.errors=function(){return this._errors},ov.prototype.attempts=function(){return this._attempts},ov.prototype.mainError=function(){if(0===this._errors.length)return null
@@ -652,8 +652,8 @@ n=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetc
652
652
  _v(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}Iv.$inject=["store","apiRoutes","auth","groups","session"];class Dv{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject("hypothesis.user.tags.list")||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${p(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject("hypothesis.user.tags.map")||{};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("hypothesis.user.tags.map",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("hypothesis.user.tags.list",n)}}Dv.$inject=["localStorage"];class Pv{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),
653
653
  e.visible||this._store.setForcedVisible(e.id,!0)}}Pv.$inject=["store"];class Bv{constructor(e){this._store=e}dismiss(e){const t=this._store.getToastMessage(e);t&&!t.isDismissed&&(this._store.updateToastMessage({...t,isDismissed:!0}),setTimeout((()=>{this._store.removeToastMessage(e)}),500))}_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r="",visuallyHidden:o=!1}={}){if(this._store.hasToastMessage(e,t))return;const i=a(10),s={type:e,id:i,message:t,moreInfoURL:r,visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...s}),n&&setTimeout((()=>{this.dismiss(i)}),5e3)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}Bv.$inject=["store"];class Fv{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),
654
654
  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)}(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 Hv=function(e){
655
- 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){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),jv=function(t){const{version:n,origin:r}=e(t.location.href);return"1.1120.0"!==n?(console.warn(`The Hypothesis sidebar is using a different version (1.1120.0) than the host page (${n}). It may not work.`),!1):"null"===t.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):t.origin===r||(console.warn(`The Hypothesis sidebar is running in a different origin (${t.origin}) than expected (${r}). It may not work.`),!1)}(window);function Uv(e,t){e.setClientId(t.clientId)}function qv(e,t,n){e.load(),t.load(),n.sync()}function $v(e,t,n){e.init(),t.init(),n.init()}function Gv(e,t){"sidebar"===t.route()&&e.connect()}Hv.sentry&&jv&&function(t){const n=function(){let e=import.meta.url;return e?new URL(e).origin:null
656
- }(),r=n?[n]:void 0;Ln({dsn:t.dsn,environment:t.environment,allowUrls:r,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1120.0",beforeSend:(e,t)=>{if(On>=5)return u("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++On;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(e){}return e}});try{mt("host_config",e(window.location.href))}catch(e){}mt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Rn(((e,t)=>{pt(e,{tags:{context:t}})}))}(Hv.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),Uv.$inject=["api","streamer"],qv.$inject=["groups","session","router"],$v.$inject=["autosaveService","persistedDefaults","serviceURL"],
655
+ 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){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),jv=function(t){const{version:n,origin:r}=e(t.location.href);return"1.1121.0"!==n?(console.warn(`The Hypothesis sidebar is using a different version (1.1121.0) than the host page (${n}). It may not work.`),!1):"null"===t.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):t.origin===r||(console.warn(`The Hypothesis sidebar is running in a different origin (${t.origin}) than expected (${r}). It may not work.`),!1)}(window);function Uv(e,t){e.setClientId(t.clientId)}function qv(e,t,n){e.load(),t.load(),n.sync()}function $v(e,t,n){e.init(),t.init(),n.init()}function Gv(e,t){"sidebar"===t.route()&&e.connect()}Hv.sentry&&jv&&function(t){const n=function(){let e=import.meta.url;return e?new URL(e).origin:null
656
+ }(),r=n?[n]:void 0;Ln({dsn:t.dsn,environment:t.environment,allowUrls:r,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1121.0",beforeSend:(e,t)=>{if(On>=5)return u("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++On;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(e){}return e}});try{mt("host_config",e(window.location.href))}catch(e){}mt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Rn(((e,t)=>{pt(e,{tags:{context:t}})}))}(Hv.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),Uv.$inject=["api","streamer"],qv.$inject=["groups","session","router"],$v.$inject=["autosaveService","persistedDefaults","serviceURL"],
657
657
  Gv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&Wr.clear();for(let[t,n]of Object.entries(e))Wr.set(t,n)}(Mo);const Vv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",v)}(),async function(i,a=window){const c=function(t){const i=e(t.location.href),a=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],s={openSidebar:n,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:o(t.origin),ancestorLevel:r(t.ancestorLevel)}}},l={};for(let[e,t]of Object.entries(i))a.includes(e)&&null!==t&&(s[e]?l[e]=s[e](t):l[e]=t);return l}(window),u=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null
658
658
  ;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:l(n.ancestorLevel,t),origin:n.origin}}(c,a);let d;if(u){const e=await async function(e,t){return{...await s(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(c,u);d=function(e,t){const n=e.services;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=s(t.targetFrame,t.origin,"requestGroups",[n],0).catch((()=>{throw new Error("Unable to fetch groups")})))})),e):e}(e,u)}else d=c;const h={...i,...d};return u&&(h.rpc=u),h.apiUrl=function(e){const n=t(e);if(n){if(n.apiUrl)return n.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(h),h}(Hv).then((e=>{!function(e,t){const n=new Fv
659
659
  ;n.register("annotationsService",Wg).register("annotationActivity",Kg).register("api",tv).register("apiRoutes",cv).register("auth",hv).register("autosaveService",pv).register("frameSync",wv).register("groups",Sv).register("loadAnnotationsService",Cv).register("localStorage",Av).register("persistedDefaults",Nv).register("router",Mv).register("serviceURL",Lv).register("session",zv).register("streamer",Iv).register("streamFilter",Rv).register("tags",Dv).register("threadsService",Pv).register("toastMessenger",Bv).register("store",{factory:ss}),n.register("$window",{value:window}).register("settings",{value:e}),n.run($v),n.run(Uv),n.run(qv),n.run(g),n.run(Gv),gr(Yr(Po.Provider,{value:n,children:Yr(Vg,{})}),t)}(e,Vv)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),gr(Yr(Yg,{error:e}),t)}(e,Vv)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypothesis",
3
- "version": "1.1120.0",
3
+ "version": "1.1121.0",
4
4
  "description": "Annotate with anyone, anywhere.",
5
5
  "license": "BSD-2-Clause",
6
6
  "homepage": "https://hypothes.is",
@@ -13,6 +13,7 @@
13
13
  "@babel/preset-typescript": "^7.16.7",
14
14
  "@hypothesis/frontend-build": "1.2.0",
15
15
  "@hypothesis/frontend-shared": "5.4.2",
16
+ "@npmcli/arborist": "^5.6.2",
16
17
  "@octokit/rest": "^19.0.3",
17
18
  "@rollup/plugin-babel": "^6.0.0",
18
19
  "@rollup/plugin-commonjs": "^23.0.0",
@@ -78,7 +79,7 @@
78
79
  "mocha": "10.0.0",
79
80
  "mustache": "^4.0.1",
80
81
  "mustache-express": "^1.3.0",
81
- "npm-packlist": "^6.0.0",
82
+ "npm-packlist": "^7.0.1",
82
83
  "postcss": "^8.0.3",
83
84
  "preact": "^10.4.0",
84
85
  "prettier": "2.7.1",