hypothesis 1.1220.0 → 1.1222.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";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?45ac8f","styles/annotator.css":"styles/annotator.css?69e764","styles/annotator.css.map":"styles/annotator.css.map?1d8583","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?e9b69c","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?cf58f7","styles/sidebar.css.map":"styles/sidebar.css.map?983dec","styles/ui-playground.css":"styles/ui-playground.css?909a7a","styles/ui-playground.css.map":"styles/ui-playground.css.map?cab7bf","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?4c3daa","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?174ed0","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?827940","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?abb946","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?925ef0"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,t(r),s.head.appendChild(r)}function r(s,e){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&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function n(s,e,r,n){var o=s.createElement("link");o.rel=e,o.href=n,o.type="application/annotator+".concat(r),t(o),s.head.appendChild(o)}function o(s,e,r){var n=s.createElement("link");n.rel="preload",n.as=e,n.href=r,"fetch"===e&&(n.crossOrigin="anonymous"),t(n),s.head.appendChild(n)}function a(s,t){return s.assetRoot+"build/"+s.manifest[t]}function i(s){var t=s.match(/(https?):\/\/([^:/]+)/);return t?{protocol:t[1],hostname:t[2]}:null}function l(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=s.currentScript;return t?i(t.src):null}function p(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=l(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)}if(function(){var s=[function(){return Object.fromEntries([])},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 c=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<e.length;r++){var n=void 0;try{n=JSON.parse(e[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),n={}}Object.assign(t,n)}return t}(document),u=p(c.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1220.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var n=0,i=["scripts/sidebar.bundle.js"];n<i.length;n++)r(s,a(t,i[n]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)e(s,a(t,p[l]))}(document,{assetRoot:u,manifest:s,apiUrl:c.apiUrl})}else{var d=c,h=p(d.notebookAppUrl||"https://hypothes.is/notebook"),y=p(d.profileAppUrl||"https://hypothes.is/user-profile"),f=p(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",t.sidebarAppUrl),n(s,"notebook","html",t.notebookAppUrl),n(s,"profile","html",t.profileAppUrl),o(s,"style",a(t,"styles/annotator.css")),n(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var i=0,l=["scripts/annotator.bundle.js"];i<l.length;i++)r(s,a(t,l[i]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,u=p;c<u.length;c++)e(s,a(t,u[c]))}}(document,{assetRoot:u,manifest:s,notebookAppUrl:h,profileAppUrl:y,sidebarAppUrl:f})}}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?88615f","styles/annotator.css":"styles/annotator.css?6349d0","styles/annotator.css.map":"styles/annotator.css.map?002248","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?e9b69c","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?ac17ec","styles/sidebar.css.map":"styles/sidebar.css.map?e9b730","styles/ui-playground.css":"styles/ui-playground.css?3efd1d","styles/ui-playground.css.map":"styles/ui-playground.css.map?febf32","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?4c3daa","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?9b43d3","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?827940","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?abb946","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?9c1805"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,t(r),s.head.appendChild(r)}function r(s,e){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&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function n(s,e,r,n){var o=s.createElement("link");o.rel=e,o.href=n,o.type="application/annotator+".concat(r),t(o),s.head.appendChild(o)}function o(s,e,r){var n=s.createElement("link");n.rel="preload",n.as=e,n.href=r,"fetch"===e&&(n.crossOrigin="anonymous"),t(n),s.head.appendChild(n)}function a(s,t){return s.assetRoot+"build/"+s.manifest[t]}function i(s){var t=s.match(/(https?):\/\/([^:/]+)/);return t?{protocol:t[1],hostname:t[2]}:null}function l(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=s.currentScript;return t?i(t.src):null}function p(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=l(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)}if(function(){var s=[function(){return Object.fromEntries([])},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 c=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<e.length;r++){var n=void 0;try{n=JSON.parse(e[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),n={}}Object.assign(t,n)}return t}(document),u=p(c.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1222.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var n=0,i=["scripts/sidebar.bundle.js"];n<i.length;n++)r(s,a(t,i[n]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)e(s,a(t,p[l]))}(document,{assetRoot:u,manifest:s,apiUrl:c.apiUrl})}else{var d=c,h=p(d.notebookAppUrl||"https://hypothes.is/notebook"),y=p(d.profileAppUrl||"https://hypothes.is/user-profile"),f=p(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",t.sidebarAppUrl),n(s,"notebook","html",t.notebookAppUrl),n(s,"profile","html",t.profileAppUrl),o(s,"style",a(t,"styles/annotator.css")),n(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var i=0,l=["scripts/annotator.bundle.js"];i<l.length;i++)r(s,a(t,l[i]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,u=p;c<u.length;c++)e(s,a(t,u[c]))}}(document,{assetRoot:u,manifest:s,notebookAppUrl:h,profileAppUrl:y,sidebarAppUrl:f})}}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,20 +1,20 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?45ac8f",
3
- "styles/annotator.css": "styles/annotator.css?69e764",
4
- "styles/annotator.css.map": "styles/annotator.css.map?1d8583",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?88615f",
3
+ "styles/annotator.css": "styles/annotator.css?6349d0",
4
+ "styles/annotator.css.map": "styles/annotator.css.map?002248",
5
5
  "styles/highlights.css": "styles/highlights.css?6b4ebd",
6
6
  "styles/highlights.css.map": "styles/highlights.css.map?241350",
7
7
  "styles/katex.min.css": "styles/katex.min.css?e9b69c",
8
8
  "styles/katex.min.css.map": "styles/katex.min.css.map?42d80c",
9
9
  "styles/pdfjs-overrides.css": "styles/pdfjs-overrides.css?c95edf",
10
10
  "styles/pdfjs-overrides.css.map": "styles/pdfjs-overrides.css.map?1d8ac6",
11
- "styles/sidebar.css": "styles/sidebar.css?cf58f7",
12
- "styles/sidebar.css.map": "styles/sidebar.css.map?983dec",
13
- "styles/ui-playground.css": "styles/ui-playground.css?909a7a",
14
- "styles/ui-playground.css.map": "styles/ui-playground.css.map?cab7bf",
11
+ "styles/sidebar.css": "styles/sidebar.css?ac17ec",
12
+ "styles/sidebar.css.map": "styles/sidebar.css.map?e9b730",
13
+ "styles/ui-playground.css": "styles/ui-playground.css?3efd1d",
14
+ "styles/ui-playground.css.map": "styles/ui-playground.css.map?febf32",
15
15
  "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?4c3daa",
16
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?174ed0",
16
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?9b43d3",
17
17
  "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?827940",
18
18
  "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?abb946",
19
- "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?925ef0"
19
+ "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?9c1805"
20
20
  }
@@ -119,7 +119,7 @@ this._sidebarRPC.on("setHighlightsVisible",(t=>{this.setHighlightsVisible(t,!1)}
119
119
  ;const n=So(t);if(!n)return;const i=en(n,null===(e=t.annotation)||void 0===e?void 0:e.$cluster);i.forEach((e=>{e._annotation=t.annotation})),t.highlights=i,this._hoveredAnnotations.has(t.annotation.$tag)&&rn(i,!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=$e.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(const t of n)e(t);return t.$orphan=n.length>0&&n.every((t=>t.target.selector&&!t.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[];for(const e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&on(e.highlights);this._updateAnchors(n,e)}
120
120
  _updateAnchors(t,e){var n;this.anchors=t,null===(n=this._clusterToolbar)||void 0===n||n.scheduleClusterUpdates(),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,r=(await Promise.all(e.map((t=>this._integration.describe(i,t))))).map((t=>({source:n.uri,selector:t}))),s={uri:n.uri,document:n.metadata,target:r,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+o(8)};return this._sidebarRPC.call("createAnnotation",s),this.anchor(s),Eo(),s}_hoverAnnotations(t){this._hoveredAnnotations.clear(),t.forEach((t=>this._hoveredAnnotations.add(t)));for(const e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);rn(e.highlights,n)}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
121
121
  ;const t=sn(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){const e=this._integration.getAnnotatableRange(t);if(!e)return void this._onClearSelection();const n=document.getSelection(),i=Ze(n),o=Qe(n);o?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=xo(),this._isAdderVisible=!0,this._adder.show(o,i)):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){!function(t,e){
122
- 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){Ht(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function Ao(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function To(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.1220.0";const o=new URL(window.location.href);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]
122
+ 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){Ht(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function Ao(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function To(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.1222.0";const o=new URL(window.location.href);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]
123
123
  ;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 Ro({config:t,groupId:e}){return Wt("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:Ao(t.notebookAppUrl,{...To(t.notebookAppUrl,t),group:e})})}function ko({eventBus:t,config:e}){const[n,i]=At(0),[o,r]=At(!0),[s,a]=At(null),l=Rt(""),c=Rt(null);Tt((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),Tt((()=>{document.body.style.overflow=o?l.current:"hidden"}),[o]),Tt((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),i((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);return null===s?null:Wt("div",{className:_e("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:o}),"data-testid":"notebook-outer",
124
124
  children:Wt("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[Wt("div",{className:"absolute right-0 m-3",children:Wt(Ee,{title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")},variant:"dark",classes:_e("!bg-transparent enabled:hover:!bg-grey-3"),children:Wt(Xt,{className:"w-4 h-4"})})}),Wt(Ro,{config:e,groupId:s},n)]})})}class Po{constructor(t,e,n){this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this.shadowRoot=Me(this._outerContainer),dt(Wt(ko,{eventBus:e,config:n}),this.shadowRoot)}destroy(){dt(null,this.shadowRoot),this._outerContainer.remove()}}function Oo({eventBus:t,config:e}){const[n,i]=At(!0),o=Rt(null),[r,s]=At(!1);Tt((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{i(!1),s(!0)})),o.current=e,()=>{e.destroy()}}),[t]);return r?Wt("div",{className:_e("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:n}),
125
125
  "data-testid":"profile-outer",children:Wt("div",{className:"relative w-full h-full","data-testid":"profile-inner",children:[Wt("div",{className:"absolute right-0 m-3",children:Wt(Ee,{title:"Close the Profile",onClick:()=>{var t;i(!0),null===(t=o.current)||void 0===t||t.publish("closeProfile")},variant:"dark",classes:_e("!bg-transparent enabled:hover:!bg-grey-3"),children:Wt(Xt,{className:"w-4 h-4"})})}),Wt("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:e.profileAppUrl})]})}):null}class Lo{constructor(t,n,i){e(this,"_outerContainer",void 0),e(this,"shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-profile"),t.appendChild(this._outerContainer),this.shadowRoot=Me(this._outerContainer),dt(Wt(Oo,{eventBus:n,config:i}),this.shadowRoot)}destroy(){dt(null,this.shadowRoot),this._outerContainer.remove()}}var Mo={},Io={get exports(){return Mo},set exports(t){Mo=t}};!function(t){!function(e,n,i,o){
@@ -528,7 +528,7 @@ n.push(t[e]));return{...zm,id:"root",children:n}}(e);return n&&(o.children=o.chi
528
528
  ;function Wm(e){return function(e){return e.replace(Ym,"")}((t=e,t.normalize("NFKD"))).toLowerCase();var t}class Km{constructor(e,t){this.term=t.normalize(e),this.matcher=t}matches(e){const t=this.matcher;return t.fieldValues(e).some((e=>t.matches(t.normalize(e),this.term)))}}class Xm{constructor(e,t){this.operator=e,this.filters=t}matches(e){return"and"===this.operator?this.filters.every((t=>t.matches(e))):this.filters.some((t=>t.matches(e)))}}function Zm(e){return{fieldValues:e,matches:(e,t)=>e.includes(t),normalize:Wm}}const Jm={quote:Zm((e=>{var t;return[null!==(t=Gr(e))&&void 0!==t?t:""]})),since:{fieldValues:e=>[new Date(e.updated).valueOf()],matches:(e,t)=>(Date.now()-e)/1e3<=t,normalize:e=>e},tag:Zm((e=>e.tags)),text:Zm((e=>[e.text])),uri:Zm((e=>[e.uri])),user:Zm((e=>{var t,n;return[e.user,null!==(t=null===(n=e.user_info)||void 0===n?void 0:n.display_name)&&void 0!==t?t:""]}))};const Qm=function(e){if(1!==e.length)throw new Error("Memoize input must be a function of one argument");let t,n
529
529
  ;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:Vm[t.sortKey]},r=!!t.filterQuery||Object.keys(t.filters).length>0;if(r){const e=function(e,t={}){const n=[],r=[],o=[],i=[],a=[],s=[],l=t.user?[t.user]:[],c=Cm(e);for(const e of c){const t=e.slice(0,e.indexOf(":")),c=e.slice(t.length+1);switch(t){case"quote":r.push(c);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";o.push(e*n[t])}}break;case"tag":i.push(c);break;case"text":a.push(c);break;case"uri":s.push(c);break;case"user":l.push(c);break;default:n.push(e)}}return{any:{terms:n,operator:"and"},quote:{terms:r,operator:"and"},since:{terms:o,operator:"and"},tag:{terms:i,operator:"and"},text:{terms:a,operator:"and"},uri:{terms:s,operator:"or"},user:{terms:l,operator:"or"}}
530
530
  }(t.filterQuery||"",t.filters);n.filterFn=t=>function(e,t){const n=(e,t)=>new Km(t,Jm[e]),r=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{let r;if("any"===e){const e=["quote","text","tag","user"];r=t.terms.map((t=>new Xm("or",e.map((e=>n(e,t))))))}else r=t.terms.map((t=>n(e,t)));return new Xm(t.operator,r)})),o=new Xm("and",r);return e.filter((e=>e.id&&o.matches(e))).map((e=>e.id))}([t],e).length>0}return!r&&"sidebar"===e.route&&(n.threadFilterFn=e=>{return!!e.annotation&&(n=e.annotation,r=t.selectedTab,!Pr(n)&&Hm(n)===r);var n,r}),jm(e.annotations,n)}));function ep(){const e=xi(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a=le((()=>({annotations:t,route:r,selection:{...o,filterQuery:n,filters:i}})),[t,n,r,o,i]);return Qm(a)}var tp=Kn((function({loadAnnotationsService:e,onLogin:t}){const n=xi(),r=n.routeParams().id,o=ep(),i=n.profile().userid,[a,s]=re(!1);return ie((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{
531
- const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),we(g,{children:[a&&we(ki,{errorType:"annotation",onLoginRequest:t}),we(Em,{threads:o.children})]})}),["loadAnnotationsService"]);class np{constructor(e,t,n=window){var r,o,i,a;const s="N/A";let l=s;e.userid&&(l=e.userid,e.displayName&&(l=`${e.displayName} (${l})`)),this.version="1.1220.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||s,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:s,this.account=l,this.timestamp=(new Date).toString();const c=null===(a=t[0])||void 0===a?void 0:a.segment;if(c){const e=[];c.cfi&&e.push(["CFI",c.cfi]),c.url&&e.push(["URL",c.url]),this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}asFormattedString(){
531
+ const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),we(g,{children:[a&&we(ki,{errorType:"annotation",onLoginRequest:t}),we(Em,{threads:o.children})]})}),["loadAnnotationsService"]);class np{constructor(e,t,n=window){var r,o,i,a;const s="N/A";let l=s;e.userid&&(l=e.userid,e.displayName&&(l=`${e.displayName} (${l})`)),this.version="1.1222.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||s,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:s,this.account=l,this.timestamp=(new Date).toString();const c=null===(a=t[0])||void 0===a?void 0:a.segment;if(c){const e=[];c.cfi&&e.push(["CFI",c.cfi]),c.url&&e.push(["URL",c.url]),this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}asFormattedString(){
532
532
  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 rp(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function op(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=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,m=c&&null!=c.leftOffset?c.leftOffset:0,p=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-=m,o-=p,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)
533
533
  ;r=v+s*f-t.clientWidth*f,o=b+l*g-t.clientHeight*g,r-=m,o-=p,r=Math.max(Math.min(r,t.scrollWidth-t.clientWidth),0),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}}(t,e),o=Date.now()-t.startTime,i=Math.min(1/t.time*o,1);if(t.endIterations>=n)return rp(e,r.x,r.y),e._scrollSettings=null,t.end("complete");var a=1-t.ease(i);if(rp(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&op(t.scrollAncestor),void op(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(op.bind(null,e))}}function ip(e){return e.self===e}function ap(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function sp(){return!0}function lp(e){if(e.assignedSlot)return lp(e.assignedSlot)
534
534
  ;if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}var cp=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{};var r=lp(e),o=1,i=t.validTarget||sp,a=t.isScrollable;t.debug&&(console.log("About to scroll to",e),r||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var s=[];r;)if(t.debug&&console.log("Scrolling parent node",r),i(r,o)&&(a?a(r,ap):ap(r))&&(o++,s.push(r)),!(r=lp(r))){l("complete");break}return s.reduce(((n,r,o)=>function(e,t,n,r,o){var i,a=!t._scrollSettings,s=t._scrollSettings,l=Date.now(),c={passive:!0};function u(e){t._scrollSettings=null,t.parentElement&&t.parentElement._scrollSettings&&t.parentElement._scrollSettings.end(e),
@@ -574,7 +574,7 @@ n.addEventListener("message",o)}function kf(e){wf.push(e)}xf.$inject=["store","s
574
574
  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 a=o.user_info,s="s:"+uf(8),l=Object.assign({created:t.toISOString(),group:r,permissions:ea(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Fr(l)&&(l.permissions=Ji(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Fr(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Or(n)}),Hr(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:[],uri:e.uri
575
575
  };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:Or(e)?Qi(t,e.group):Ji(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;Lr(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}return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}Nf.$inject=["annotationActivity","api","store"];class Ef extends Error{constructor(e,t,n=""){
576
576
  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 Af(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Ef(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new Ef(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Ef(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Tf(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}class Cf{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(let[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",
577
- "Hypothesis-Client-Version":"1.1220.0"};l&&(u.Authorization="Bearer "+l);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:m}=Wo(c.url,a),p=new URL(h);for(let[e,t]of Object.entries(m)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&p.searchParams.append(e,n.toString())}return await Af(p.toString(),{body:s?JSON.stringify(Tf(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={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}}
577
+ "Hypothesis-Client-Version":"1.1222.0"};l&&(u.Authorization="Bearer "+l);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:m}=Wo(c.url,a),p=new URL(h);for(let[e,t]of Object.entries(m)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&p.searchParams.append(e,n.toString())}return await Af(p.toString(),{body:s?JSON.stringify(Tf(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={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}}
578
578
  Cf.$inject=["apiRoutes","auth","store"];var Mf={},zf={get exports(){return Mf},set exports(e){Mf=e}},Rf={};function Lf(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var If=Lf;Lf.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Lf.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Lf.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),
579
579
  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},Lf.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)},Lf.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Lf.prototype.start=function(e){
580
580
  console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Lf.prototype.start=Lf.prototype.try,Lf.prototype.errors=function(){return this._errors},Lf.prototype.attempts=function(){return this._attempts},Lf.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},function(e){var t=If;e.operation=function(n){var r=e.timeouts(n);return new t(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,t)),r.sort((function(e,t){return e-t})),r},
@@ -641,11 +641,11 @@ const t=ob().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.dom
641
641
  t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(a,s);let l=r;n.captureContext&&(l=Qv.clone(l).update(n.captureContext));let c=Cv(a);if(l){if(l.getAttachments){const e=[...n.attachments||[],...l.getAttachments()];e.length&&(n.attachments=e)}c=l.applyToEvent(a,n)}return c.then((e=>"number"==typeof o&&o>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:Nv(e.data,t,n)}})))},...e.user&&{user:Nv(e.user,t,n)},...e.contexts&&{contexts:Nv(e.contexts,t,n)},...e.extra&&{extra:Nv(e.extra,t,n)}};e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Nv(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=Nv(e.data,t,n)),e))));return r}(e,o,i):e))}const yb="Not capturing exception because it's already been captured.";class wb{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){
642
642
  this._numProcessing=0}__init4(){this._outcomes={}}constructor(e){if(wb.prototype.__init.call(this),wb.prototype.__init2.call(this),wb.prototype.__init3.call(this),wb.prototype.__init4.call(this),this._options=e,e.dsn){this._dsn=Rg(e.dsn);const t=pb(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn("No DSN provided, client will not do anything.")}captureException(e,t,n){if(xv(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.log(yb));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}captureMessage(e,t,n,r){let o=n&&n.event_id;const i=gg(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(i.then((e=>this._captureEvent(e,n,r))).then((e=>{o=e}))),o}captureEvent(e,t,n){
643
643
  if(t&&t.originalException&&xv(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.log(yb));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{r=e}))),r}captureSession(e){this._isEnabled()?"string"!=typeof e.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Jv(e,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e)))):Cv(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,e)))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const t={}
644
- ;return e.forEach((e=>{bb(e,t)})),t}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){bb(e,this._integrations)}sendEvent(e,t={}){if(this._dsn){let n=fb(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Uv(n,Vv(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));this._sendEnvelope(n)}}sendSession(e){if(this._dsn){const t=function(e,t,n,r){const o=Kv(n);return Hv({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&{dsn:Mg(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`
644
+ ;return e.forEach((e=>{e&&bb(e,t)})),t}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){bb(e,this._integrations)}sendEvent(e,t={}){if(this._dsn){let n=fb(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Uv(n,Vv(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));this._sendEnvelope(n)}}sendSession(e){if(this._dsn){const t=function(e,t,n,r){const o=Kv(n);return Hv({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&{dsn:Mg(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`
645
645
  ;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}_updateSessionFromEvent(e,t){let n=!1,r=!1;const o=t.exception&&t.exception.values;if(o){r=!0;for(const e of o){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(Jv(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new zv((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const r=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),_b(r,e,t,n)}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__){const t=e
646
646
  ;"log"===t.logLevel?Dg.log(t.message):Dg.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:o}=r;if(!this._isEnabled())return Mv(new Tg("SDK not enabled, will not capture event.","log"));const i=kb(e),a=xb(e),s=e.type||"error",l=`before send for type \`${s}\``;if(a&&"number"==typeof o&&Math.random()>o)return this.recordDroppedEvent("sample_rate","error",e),Mv(new Tg(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const c="replay_event"===s?"replay":s;return this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",c,e),new Tg("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const o=function(e,t,n){const{beforeSend:r,beforeSendTransaction:o}=e;if(xb(t)&&r)return r(t,n);if(kb(t)&&o)return o(t,n);return t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(_g(e))return e.then((e=>{
647
- if(!vg(e)&&null!==e)throw new Tg(n);return e}),(e=>{throw new Tg(`${t} rejected with ${e}`)}));if(!vg(e)&&null!==e)throw new Tg(n);return e}(o,l)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",c,e),new Tg(`${l} returned \`null\`, will not send event.`,"log");const o=n&&n.getSession();!i&&o&&this._updateSessionFromEvent(o,r);const a=r.transaction_info;if(i&&a&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...a,source:e,changes:[...a.changes,{source:e,timestamp:r.timestamp,propagations:a.propagations}]}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof Tg)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Tg(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){
648
- this._transport&&this._dsn?this._transport.send(e).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.error("Error while sending event:",e)})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}function xb(e){return void 0===e.type}function kb(e){return"transaction"===e.type}function Sb(e,t,n=Rv(e.bufferSize||30)){let r={};return{send:function(o){const i=[];if(qv(o,((t,n)=>{const o=Wv(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)){const r=Nb(t,n);e.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(t)})),0===i.length)return Cv();const a=Hv(o[0],i),s=t=>{qv(a,((n,r)=>{const o=Nb(n,r);e.recordDroppedEvent(t,Wv(r),o)}))};return n.add((()=>t({body:Gv(a,e.textEncoder)
647
+ if(!vg(e)&&null!==e)throw new Tg(n);return e}),(e=>{throw new Tg(`${t} rejected with ${e}`)}));if(!vg(e)&&null!==e)throw new Tg(n);return e}(o,l)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",c,e),new Tg(`${l} returned \`null\`, will not send event.`,"log");const o=n&&n.getSession();!i&&o&&this._updateSessionFromEvent(o,r);const a=r.transaction_info;if(i&&a&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...a,source:e}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof Tg)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Tg(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,(e=>{
648
+ ("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.error("Error while sending event:",e)})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}function xb(e){return void 0===e.type}function kb(e){return"transaction"===e.type}function Sb(e,t,n=Rv(e.bufferSize||30)){let r={};return{send:function(o){const i=[];if(qv(o,((t,n)=>{const o=Wv(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)){const r=Nb(t,n);e.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(t)})),0===i.length)return Cv();const a=Hv(o[0],i),s=t=>{qv(a,((n,r)=>{const o=Nb(n,r);e.recordDroppedEvent(t,Wv(r),o)}))};return n.add((()=>t({body:Gv(a,e.textEncoder)
649
649
  }).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Xv(r,e),e)),(e=>{throw s("network_error"),e})))).then((e=>e),(e=>{if(e instanceof Tg)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.error("Skipped sending event because buffer is full."),s("queue_overflow"),Cv();throw e}))},flush:e=>n.drain(e)}}function Nb(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}let Eb;class Ab{constructor(){Ab.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Ab.id}setupOnce(){Eb=Function.prototype.toString,Function.prototype.toString=function(...e){const t=$g(this)||this;return Eb.apply(t,e)}}}Ab.__initStatic();const Tb=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class Cb{static __initStatic(){this.id="InboundFilters"}__init(){this.name=Cb.id}
650
650
  constructor(e={}){this._options=e,Cb.prototype.__init.call(this)}setupOnce(e,t){const n=e=>{const n=t();if(n){const t=n.getIntegration(Cb);if(t){const r=n.getClient(),o=r?r.getOptions():{},i=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...Tb],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(t._options,o);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${_v(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;return function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:n=""}=e.exception.values&&e.exception.values[0]||{};return[`${n}`,`${t}: ${n}`]}catch(t){
651
651
  return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.error(`Cannot extract message for event ${_v(e)}`),[]}return[]}(e).some((e=>jg(e,t)))}(e,t.ignoreErrors))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${_v(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=Mb(e);return!!n&&jg(n,t)}(e,t.denyUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${_v(e)}.\nUrl: ${Mb(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=Mb(e);return!n||jg(n,t)}(e,t.allowUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${_v(e)}.\nUrl: ${Mb(e)}`),!0;return!1}(e,i)?null:e}}return e};n.id=this.name,e(n)}}function Mb(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){
@@ -654,18 +654,18 @@ Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,
654
654
  "DOMException.code":`${o.code}`}),i}if(dg(t))return Pb(e,t);if(vg(t)||bg(t)){return i=function(e,t,n,r){const o=ab().getClient(),i=o&&o.getOptions().normalizeDepth,a={exception:{values:[{type:bg(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${Wg(t)}`}]},extra:{__serialized__:Ev(t,i)}};if(n){const t=Bb(e,n);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,n,o),wv(i,{synthetic:!0}),i}return i=Ub(e,t,n,r),yv(i,`${t}`,void 0),wv(i,{synthetic:!0}),i}function Ub(e,t,n,r){const o={message:t};if(r&&n){const r=Bb(e,n);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]})}return o}class qb{static __initStatic(){this.id="Breadcrumbs"}__init(){this.name=qb.id}constructor(e){qb.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&sv("console",$b),this.options.dom&&sv("dom",function(e){function t(t){
655
655
  let n,r="object"==typeof e?e.serializeAttribute:void 0,o="object"==typeof e&&"number"==typeof e.maxStringLength?e.maxStringLength:void 0;o&&o>1024&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof r&&(r=[r]);try{n=t.event.target?Eg(t.event.target,{keyAttrs:r,maxStringLength:o}):Eg(t.event,{keyAttrs:r,maxStringLength:o})}catch(e){n="<unknown>"}0!==n.length&&ab().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&sv("xhr",Gb),this.options.fetch&&sv("fetch",Vb),this.options.history&&sv("history",Yb)}addSentryBreadcrumb(e){this.options.sentry&&ab().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:_v(e)},{event:e})}}function $b(e){for(let t=0;t<e.args.length;t++)if("ref=Ref<"===e.args[t]){
656
656
  e.args[t+1]="viewRef";break}const t={category:"console",data:{arguments:e.args,logger:"console"},level:(n=e.level,"warn"===n?"warning":Iv.includes(n)?n:"log"),message:Bg(e.args," ")};var n;if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${Bg(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}ab().addBreadcrumb(t,{input:e.args,level:e.level})}function Gb(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;const{method:t,url:n,status_code:r,body:o}=e.xhr.__sentry_xhr__||{};ab().addBreadcrumb({category:"xhr",data:{method:t,url:n,status_code:r},type:"http"},{xhr:e.xhr,input:o})}else;}function Vb(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?ab().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):ab().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response})))}function Yb(e){
657
- let t=e.from,n=e.to;const r=Lv(zb.location.href);let o=Lv(t);const i=Lv(n);o.path||(o=r),r.protocol===i.protocol&&r.host===i.host&&(n=i.relative),r.protocol===o.protocol&&r.host===o.host&&(t=o.relative),ab().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}qb.__initStatic();class Wb extends wb{constructor(e){const t=zb.SENTRY_SDK_SOURCE||"npm";e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:"7.37.1"}],version:"7.37.1"},super(e),e.sendClientReports&&zb.document&&zb.document.addEventListener("visibilitychange",(()=>{"hidden"===zb.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const o=Hb(e,t,n&&n.syntheticException||void 0,r);return wv(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),Cv(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){
657
+ let t=e.from,n=e.to;const r=Lv(zb.location.href);let o=Lv(t);const i=Lv(n);o.path||(o=r),r.protocol===i.protocol&&r.host===i.host&&(n=i.relative),r.protocol===o.protocol&&r.host===o.host&&(t=o.relative),ab().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}qb.__initStatic();class Wb extends wb{constructor(e){const t=zb.SENTRY_SDK_SOURCE||"npm";e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:"7.38.0"}],version:"7.38.0"},super(e),e.sendClientReports&&zb.document&&zb.document.addEventListener("visibilitychange",(()=>{"hidden"===zb.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const o=Hb(e,t,n&&n.syntheticException||void 0,r);return wv(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),Cv(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){
658
658
  const i=Ub(e,t,r&&r.syntheticException||void 0,o);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),Cv(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){const n=this.getIntegrationById("Breadcrumbs");n&&n.addSentryBreadcrumb&&n.addSentryBreadcrumb(e),super.sendEvent(e,t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.log("No outcomes to send"));if(!this._dsn)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.log("No dsn provided, will not send outcomes"));("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.log("Sending outcomes:",e);const t=pb(this._dsn,this._options),n=(r=e,Hv((o=this._options.tunnel&&Mg(this._dsn))?{dsn:o}:{},[[{type:"client_report"},{timestamp:i||Fv(),discarded_events:r}]]));var r,o,i;try{
659
659
  const e="[object Navigator]"===Object.prototype.toString.call(zb&&zb.navigator);if(e&&"function"==typeof zb.navigator.sendBeacon&&!this._options.transportOptions){zb.navigator.sendBeacon.bind(zb.navigator)(t,Gv(n))}else this._sendEnvelope(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.error(e)}}}let Kb;function Xb(e,t=function(){if(Kb)return Kb;if(nv(zb.fetch))return Kb=zb.fetch.bind(zb);const e=zb.document;let t=zb.fetch;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Kb=t.bind(zb)}()){return Sb(e,(function(n){const r={body:n.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n.body.length<=65536,...e.fetchOptions};try{return t(e.url,r).then((e=>({
660
- statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(e){return Kb=void 0,Mv(e)}}))}function Zb(e){return Sb(e,(function(t){return new zv(((n,r)=>{const o=new XMLHttpRequest;o.onerror=r,o.onreadystatechange=()=>{4===o.readyState&&n({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&o.setRequestHeader(t,e.headers[t]);o.send(t.body)}))}))}function Jb(e,t,n,r){const o={filename:e,function:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}const Qb=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?(?:async )?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,e_=/\((\S*)(?::(\d+))(?::(\d+))\)/,t_=[30,e=>{const t=Qb.exec(e);if(t){
661
- if(t[2]&&0===t[2].indexOf("eval")){const e=e_.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=s_(t[1]||"?",t[2]);return Jb(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],n_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,r_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,o_=[50,e=>{const t=n_.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=r_.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"?";return[n,e]=s_(n,e),Jb(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],i_=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,a_=Jg(...[t_,o_,[40,e=>{const t=i_.exec(e);return t?Jb(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0}]]),s_=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension")
660
+ statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(e){return Kb=void 0,Mv(e)}}))}function Zb(e){return Sb(e,(function(t){return new zv(((n,r)=>{const o=new XMLHttpRequest;o.onerror=r,o.onreadystatechange=()=>{4===o.readyState&&n({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&o.setRequestHeader(t,e.headers[t]);o.send(t.body)}))}))}function Jb(e,t,n,r){const o={filename:e,abs_path:e,function:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}const Qb=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?(?:async )?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,e_=/\((\S*)(?::(\d+))(?::(\d+))\)/,t_=[30,e=>{const t=Qb.exec(e)
661
+ ;if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=e_.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=s_(t[1]||"?",t[2]);return Jb(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],n_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,r_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,o_=[50,e=>{const t=n_.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=r_.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"?";return[n,e]=s_(n,e),Jb(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],i_=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,a_=Jg(...[t_,o_,[40,e=>{const t=i_.exec(e);return t?Jb(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0}]]),s_=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension")
662
662
  ;return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};class l_{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=l_.id}__init2(){this._installFunc={onerror:c_,onunhandledrejection:u_}}constructor(e){l_.prototype.__init.call(this),l_.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const n in e){const r=this._installFunc[n];r&&e[n]&&(t=n,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.log(`Global Handler attached: ${t}`),r(),this._installFunc[n]=void 0)}var t}}function c_(){sv("error",(e=>{const[t,n,r]=m_();if(!t.getIntegration(l_))return;const{msg:o,url:i,line:a,column:s,error:l}=e;if(Lb()||l&&l.__sentry_own_request__)return;const c=void 0===l&&fg(o)?function(e,t,n,r){const o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let i=mg(e)?e.message:e,a="Error"
663
663
  ;const s=i.match(o);s&&(a=s[1],i=s[2]);return d_({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):d_(Hb(n,l||o,void 0,r,!1),i,a,s);c.level="error",h_(t,l,c,"onerror")}))}function u_(){sv("unhandledrejection",(e=>{const[t,n,r]=m_();if(!t.getIntegration(l_))return;let o=e;try{"reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(Lb()||o&&o.__sentry_own_request__)return!0;const i=gg(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Hb(n,o,void 0,r,!0);i.level="error",h_(t,o,i,"onunhandledrejection")}))}function d_(e,t,n,r){const o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=fg(t)&&t.length>0?t:function(){try{return Ng.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}
664
664
  function h_(e,t,n,r){wv(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function m_(){const e=ab(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}l_.__initStatic();const p_=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class f_{static __initStatic(){this.id="TryCatch"}__init(){this.name=f_.id}constructor(e){f_.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&Hg(zb,"setTimeout",g_),
665
665
  this._options.setInterval&&Hg(zb,"setInterval",g_),this._options.requestAnimationFrame&&Hg(zb,"requestAnimationFrame",v_),this._options.XMLHttpRequest&&"XMLHttpRequest"in zb&&Hg(XMLHttpRequest.prototype,"send",b_);const e=this._options.eventTarget;if(e){(Array.isArray(e)?e:p_).forEach(__)}}}function g_(e){return function(...t){const n=t[0];return t[0]=Ob(n,{mechanism:{data:{function:Qg(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function v_(e){return function(t){return e.apply(this,[Ob(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Qg(e)},handled:!0,type:"instrument"}})])}}function b_(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&Hg(n,e,(function(t){const n={mechanism:{data:{function:e,handler:Qg(t)},handled:!0,type:"instrument"}},r=$g(t);return r&&(n.mechanism.data.handler=Qg(r)),Ob(t,n)}))})),e.apply(this,t)}}function __(e){const t=zb,n=t[e]&&t[e].prototype
666
666
  ;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Hg(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=Ob(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Qg(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.apply(this,[n,Ob(r,{mechanism:{data:{function:"addEventListener",handler:Qg(r),target:e},handled:!0,type:"instrument"}}),o])}})),Hg(n,"removeEventListener",(function(e){return function(t,n,r){const o=n;try{const n=o&&o.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(e){}return e.call(this,t,o,r)}})))}f_.__initStatic();class y_{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=y_.id}constructor(e={}){y_.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){const e=ab().getClient();e&&tb(((t,n)=>{const r=ab().getIntegration(y_);return r?function(e,t,n,r,o){if(!(r.exception&&r.exception.values&&o&&yg(o.originalException,Error)))return r
667
- ;const i=w_(e,n,o.originalException,t);return r.exception.values=[...i,...r.exception.values],r}(e.getOptions().stackParser,r._key,r._limit,t,n):t}))}}function w_(e,t,n,r,o=[]){if(!yg(n[r],Error)||o.length+1>=t)return o;const i=Db(e,n[r]);return w_(e,t,n[r],r,[i,...o])}y_.__initStatic();class x_{constructor(){x_.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=x_.id}setupOnce(){tb((e=>{if(ab().getIntegration(x_)){if(!zb.navigator&&!zb.location&&!zb.document)return e;const t=e.request&&e.request.url||zb.location&&zb.location.href,{referrer:n}=zb.document||{},{userAgent:r}=zb.navigator||{},o={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...e.request,...t&&{url:t},headers:o};return{...e,request:i}}return e}))}}x_.__initStatic();class k_{constructor(){k_.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=k_.id}setupOnce(e,t){const n=e=>{const n=t().getIntegration(k_);if(n){try{if(function(e,t){
668
- if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!N_(e,t))return!1;if(!S_(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=E_(t),r=E_(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!N_(e,t))return!1;if(!S_(e,t))return!1;return!0}(e,t))return!0;return!1}(e,n._previousEvent))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function S_(e,t){let n=A_(e),r=A_(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],o=n[e];if(t.filename!==o.filename||t.lineno!==o.lineno||t.colno!==o.colno||t.function!==o.function)return!1}return!0}function N_(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{
667
+ ;const i=w_(e,n,o.originalException,t);return r.exception.values=[...i,...r.exception.values],r}(e.getOptions().stackParser,r._key,r._limit,t,n):t}))}}function w_(e,t,n,r,o=[]){if(!yg(n[r],Error)||o.length+1>=t)return o;const i=Db(e,n[r]);return w_(e,t,n[r],r,[i,...o])}y_.__initStatic();class x_{constructor(){x_.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=x_.id}setupOnce(){tb((e=>{if(ab().getIntegration(x_)){if(!zb.navigator&&!zb.location&&!zb.document)return e;const t=e.request&&e.request.url||zb.location&&zb.location.href,{referrer:n}=zb.document||{},{userAgent:r}=zb.navigator||{},o={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...e.request,...t&&{url:t},headers:o};return{...e,request:i}}return e}))}}x_.__initStatic();class k_{constructor(){k_.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=k_.id}setupOnce(e,t){const n=e=>{if(e.type)return e;const n=t().getIntegration(k_);if(n){try{
668
+ if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!N_(e,t))return!1;if(!S_(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=E_(t),r=E_(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!N_(e,t))return!1;if(!S_(e,t))return!1;return!0}(e,t))return!0;return!1}(e,n._previousEvent))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function S_(e,t){let n=A_(e),r=A_(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],o=n[e];if(t.filename!==o.filename||t.lineno!==o.lineno||t.colno!==o.colno||t.function!==o.function)return!1}return!0}function N_(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{
669
669
  return!(n.join("")!==r.join(""))}catch(e){return!1}}function E_(e){return e.exception&&e.exception.values&&e.exception.values[0]}function A_(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}}k_.__initStatic();const T_=[new Cb,new Ab,new f_,new qb,new l_,new y_,new k_,new x_];function C_(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=T_),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),zb.SENTRY_RELEASE&&zb.SENTRY_RELEASE.id&&(e.release=zb.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:(n=e.stackParser||a_,Array.isArray(n)?Jg(...n):n),integrations:vb(e),transport:e.transport||(tv()?Xb:Zb)};var n;!function(e,t){!0===t.debug&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Dg.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const n=ab(),r=n.getScope()
670
670
  ;r&&r.update(t.initialScope);const o=new e(t);n.bindClient(o)}(Wb,t),e.autoSessionTracking&&function(){if(void 0===zb.document)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Dg.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));const e=ab();if(!e.captureSession)return;M_(e),sv("history",(({from:e,to:t})=>{void 0!==e&&e!==t&&M_(ab())}))}()}function M_(e){e.startSession({ignoreDuration:!0}),e.captureSession()}let z_=0;function R_(e){!function(e){ab().setUser(e)}(e)}class L_{constructor(e,t,n,r,o){var i,a;this._api=t,this._auth=n,this._store=e,this._toastMessenger=o,this._authority=null!==(i=null===(a=Gn(r))||void 0===a?void 0:a.authority)&&void 0!==i?i:null,this._lastLoad=null,this._lastLoadTime=null,n.on("oauthTokensChanged",(()=>this.reload()))}load(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=Df((()=>{const e=this._authority?{authority:this._authority}:{}
671
671
  ;return this._api.profile.read(e)})).then((e=>(this.update(e),this._lastLoadTime=Date.now(),e))).catch((e=>{throw this._lastLoadTime=null,e}))),this._lastLoad}async dismissSidebarTutorial(){const e=await this._api.profile.update({},{preferences:{show_sidebar_tutorial:!1}});this.update(e)}update(e){const t=this._store.profile(),n=e.userid!==t.userid;return this._store.updateProfile(e),this._lastLoad=Promise.resolve(e),this._lastLoadTime=Date.now(),n&&(e.userid?R_({id:e.userid}):R_(null)),e}async logout(){try{return await this._auth.logout(),this.reload()}catch(e){throw this._toastMessenger.error("Log out failed"),new Error(e)}}reload(){return this._lastLoad=null,this._lastLoadTime=null,this.load()}}L_.$inject=["store","api","auth","settings","toastMessenger"];class I_{constructor(){this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}}}addClause(e,t,n,r=!1){return this._filter.clauses.push({field:e,operator:t,value:n,case_sensitive:r}),this}getFilter(){return this._filter}
@@ -674,8 +674,8 @@ const e=Object.values(this._store.pendingUpdates());e.length&&this._store.addAnn
674
674
  ;t.userid!==e&&console.warn('WebSocket user ID "%s" does not match logged-in ID "%s"',t.userid,e)}else bf("Received unsupported notification",t.type)}_sendClientConfig(e){Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){var n;this._configMessages[e]=t,null!==(n=this._socket)&&void 0!==n&&n.isConnected()&&this._socket.send(t)}async _reconnect(){var e;const t=await this._websocketURL;if(!t)return;let n,r;null===(e=this._socket)||void 0===e||e.close();try{n=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(n){const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new O_(r);o.on("open",(()=>{this._reconnectionAttempts=0,this._sendClientConfig(o)})),o.on("disconnect",(()=>{if(++this._reconnectionAttempts,this._reconnectionAttempts<10){const e=1e3*2**this._reconnectionAttempts;setTimeout((()=>this._reconnect()),e)
675
675
  }else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),this._socket=o,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,Xf(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}D_.$inject=["store","apiRoutes","auth","groups","session"];class P_{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(`^${_f(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){
676
676
  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)}}P_.$inject=["localStorage"];class B_{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}B_.$inject=["store"];class F_{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=uf(10),a={type:e,id:i,message:t,moreInfoURL:r,visuallyHidden:o};this._store.addToastMessage({
677
- isDismissed:!1,...a}),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)}}F_.$inject=["store"];const j_=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){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),H_=function(e){const{version:t,origin:n}=hf(e.location.href);return"1.1220.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1220.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 U_(e,t){e.setClientId(t.clientId)}
678
- function q_(e,t,n){e.load(),t.load(),n.sync()}function $_(e,t,n){e.init(),t.init(),n.init()}function G_(e,t){"sidebar"===t.route()&&e.connect()}j_.sentry&&H_&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;C_({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1220.0",beforeSend:(e,t)=>{if(z_>=5)return bf("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++z_;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{db("host_config",hf(window.location.href))}catch(e){}db("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Vf(((e,t)=>{ub(e,{tags:{context:t}})}))}(j_.sentry),function(e){e.addEventListener("click",(e=>{
677
+ isDismissed:!1,...a}),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)}}F_.$inject=["store"];const j_=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){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),H_=function(e){const{version:t,origin:n}=hf(e.location.href);return"1.1222.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1222.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 U_(e,t){e.setClientId(t.clientId)}
678
+ function q_(e,t,n){e.load(),t.load(),n.sync()}function $_(e,t,n){e.init(),t.init(),n.init()}function G_(e,t){"sidebar"===t.route()&&e.connect()}j_.sentry&&H_&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;C_({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1222.0",beforeSend:(e,t)=>{if(z_>=5)return bf("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++z_;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{db("host_config",hf(window.location.href))}catch(e){}db("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Vf(((e,t)=>{ub(e,{tags:{context:t}})}))}(j_.sentry),function(e){e.addEventListener("click",(e=>{
679
679
  const t=e.target;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),U_.$inject=["api","streamer"],q_.$inject=["groups","session","router"],$_.$inject=["autosaveService","persistedDefaults","serviceURL"],G_.$inject=["frameSync","store"];const V_=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",kf)}(),async function(e,t=window){const n=function(e){const t=hf(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:mf,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:ff(t.origin),ancestorLevel:pf(t.ancestorLevel)}}},o={};for(let[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i);return o}(window),r=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null
680
680
  ;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:gf(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await df(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=df(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=Gn(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(i),i}(j_).then((e=>{!function(e,t){const n=new j
681
681
  ;n.register("annotationsService",Nf).register("annotationActivity",Sf).register("api",Cf).register("apiRoutes",Bf).register("auth",Hf).register("autosaveService",Uf).register("frameSync",Qf).register("groups",ng).register("loadAnnotationsService",rg).register("localStorage",ig).register("persistedDefaults",sg).register("router",lg).register("serviceURL",cg).register("session",L_).register("streamer",D_).register("streamFilter",I_).register("tags",P_).register("threadsService",B_).register("toastMessenger",F_).register("store",{factory:wi}),n.register("$window",{value:window}).register("settings",{value:e}),n.run($_),n.run(U_),n.run(q_),n.run(xf),n.run(G_),B(we(Wn.Provider,{value:n,children:we(sf,{})}),t)}(e,V_)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),B(we(lf,{error:e}),t)}(e,V_)));