hypothesis 1.1303.0 → 1.1304.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?4e3679","styles/annotator.css":"styles/annotator.css?1734ab","styles/annotator.css.map":"styles/annotator.css.map?458477","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?185199","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?2c677f","styles/sidebar.css.map":"styles/sidebar.css.map?45f140","styles/ui-playground.css":"styles/ui-playground.css?da8268","styles/ui-playground.css.map":"styles/ui-playground.css.map?be2735","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?8dab7f","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?f4115f","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?77ed7d","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?ac89a6","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?cc4c96"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var n=s.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,t(n),s.head.appendChild(n)}function n(s,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,o=void 0===r||r,i=n.forceReload,a=void 0!==i&&i,l=s.createElement("script");o&&(l.type="module"),a&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function r(s,e,n,r){var o=s.createElement("link");o.rel=e,o.href=r,o.type="application/annotator+".concat(n),t(o),s.head.appendChild(o)}function o(s,e,n){var r=s.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),t(r),s.head.appendChild(r)}function i(s,t){return s.assetRoot+"build/"+s.manifest[t]}function a(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=function(){var s,t,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return e?(s=e.src,(t=s.match(/(https?):\/\/([^:/]+)/))?{protocol:t[1],hostname:t[2]}:null):null}(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 l=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),c=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1303.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)n(s,i(t,a[r]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)e(s,i(t,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=function(){var s,t;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(t=s.runtime)||void 0===t?void 0:t.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var u=l,d=a(u.notebookAppUrl||"https://hypothes.is/notebook"),h=a(u.profileAppUrl||"https://hypothes.is/user-profile"),y=a(u.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",t.sidebarAppUrl),r(s,"notebook","html",t.notebookAppUrl),r(s,"profile","html",t.profileAppUrl),o(s,"style",i(t,"styles/annotator.css")),r(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)n(s,i(t,l[a]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,u=c;p<u.length;p++)e(s,i(t,u[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:d,profileAppUrl:h,sidebarAppUrl:y})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
1
+ !function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?b4a53a","styles/annotator.css":"styles/annotator.css?1734ab","styles/annotator.css.map":"styles/annotator.css.map?458477","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?0b5991","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?2c677f","styles/sidebar.css.map":"styles/sidebar.css.map?45f140","styles/ui-playground.css":"styles/ui-playground.css?da8268","styles/ui-playground.css.map":"styles/ui-playground.css.map?be2735","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?77ed7d","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?91f644","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?f4115f","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?ac89a6","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?dfcd35"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var n=s.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,t(n),s.head.appendChild(n)}function n(s,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,o=void 0===r||r,i=n.forceReload,a=void 0!==i&&i,l=s.createElement("script");o&&(l.type="module"),a&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function r(s,e,n,r){var o=s.createElement("link");o.rel=e,o.href=r,o.type="application/annotator+".concat(n),t(o),s.head.appendChild(o)}function o(s,e,n){var r=s.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),t(r),s.head.appendChild(r)}function i(s,t){return s.assetRoot+"build/"+s.manifest[t]}function a(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=function(){var s,t,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return e?(s=e.src,(t=s.match(/(https?):\/\/([^:/]+)/))?{protocol:t[1],hostname:t[2]}:null):null}(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 l=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),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1304.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)n(s,i(t,a[r]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)e(s,i(t,p[l]))}(document,{assetRoot:p,manifest:s,apiUrl:l.apiUrl})}else{var c=function(){var s,t;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(t=s.runtime)||void 0===t?void 0:t.id}();if(c&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(c))throw new Error("Could not start Hypothesis extension as configuration is missing");var u=l,d=a(u.notebookAppUrl||"https://hypothes.is/notebook"),h=a(u.profileAppUrl||"https://hypothes.is/user-profile"),y=a(u.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",t.sidebarAppUrl),r(s,"notebook","html",t.notebookAppUrl),r(s,"profile","html",t.profileAppUrl),o(s,"style",i(t,"styles/annotator.css")),r(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)n(s,i(t,l[a]),{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,i(t,u[c]))}}(document,{assetRoot:p,manifest:s,notebookAppUrl:d,profileAppUrl:h,sidebarAppUrl:y})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
@@ -1,10 +1,10 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?4e3679",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?b4a53a",
3
3
  "styles/annotator.css": "styles/annotator.css?1734ab",
4
4
  "styles/annotator.css.map": "styles/annotator.css.map?458477",
5
5
  "styles/highlights.css": "styles/highlights.css?6b4ebd",
6
6
  "styles/highlights.css.map": "styles/highlights.css.map?241350",
7
- "styles/katex.min.css": "styles/katex.min.css?185199",
7
+ "styles/katex.min.css": "styles/katex.min.css?0b5991",
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",
@@ -12,9 +12,9 @@
12
12
  "styles/sidebar.css.map": "styles/sidebar.css.map?45f140",
13
13
  "styles/ui-playground.css": "styles/ui-playground.css?da8268",
14
14
  "styles/ui-playground.css.map": "styles/ui-playground.css.map?be2735",
15
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?8dab7f",
16
- "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?f4115f",
17
15
  "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?77ed7d",
16
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?91f644",
17
+ "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?f4115f",
18
18
  "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?ac89a6",
19
- "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?cc4c96"
19
+ "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?dfcd35"
20
20
  }
@@ -122,7 +122,7 @@ this._sidebarRPC.on("deleteAnnotation",(t=>this.detach(t))),this._sidebarRPC.on(
122
122
  ;const i=an(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)&&hn(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=Xe.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&&cn(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){var n
123
123
  ;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,o=(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:o,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+r(8)};return this._sidebarRPC.call("createAnnotation",s),this.anchor(s),Mo(),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);hn(e.highlights,n)}this._sidebarRPC.call("hoverAnnotations",t)}_onSelection(t){const e=this._integration.getAnnotatableRange(t);if(!e)return void this._onClearSelection();const n=document.getSelection(),i=tn(n),o=on(n);o?(this.selectedRanges=[e],
124
124
  this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=To(),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){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),this.element.classList.toggle("hypothesis-sidebyside-active",this._sideBySideActive)}get sideBySideActive(){return this._sideBySideActive}
125
- get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){Vt(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function Do(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function Fo(t,e){var n;const i={};for(const[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.1303.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];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 Bo({config:t,groupId:e}){return $t("iframe",{title:"Hypothesis annotation notebook",
125
+ get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){Vt(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function Do(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function Fo(t,e){var n;const i={};for(const[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.1304.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];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 Bo({config:t,groupId:e}){return $t("iframe",{title:"Hypothesis annotation notebook",
126
126
  className:"h-full w-full border-0",allowFullScreen:!0,src:Do(t.notebookAppUrl,{...Fo(t.notebookAppUrl,t),group:e})})}function Ho({eventBus:t,config:e}){const[n,i]=At(0),[o,r]=At(!0),[s,a]=At(null),l=kt(""),c=kt(null);Rt((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),Rt((()=>{document.body.style.overflow=o?l.current:"hidden"}),[o]),Rt((()=>{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:$t("div",{className:be("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:o}),"data-testid":"notebook-outer",children:$t("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[$t("div",{className:"absolute right-0 m-3",children:$t(Ae,{title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")},variant:"dark",classes:be("!bg-transparent enabled:hover:!bg-grey-3"),children:$t(Yt,{
127
127
  className:"w-4 h-4"})})}),$t(Bo,{config:e,groupId:s},n)]})})}class Vo{constructor(t,e,i){n(this,"_outerContainer",void 0),n(this,"_shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this._shadowRoot=Ie(this._outerContainer),dt($t(Ho,{eventBus:e,config:i}),this._shadowRoot)}destroy(){dt(null,this._shadowRoot),this._outerContainer.remove()}}function Uo({eventBus:t,config:e}){const[n,i]=At(!0),o=kt(null);Rt((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{i(!1)})),o.current=e,()=>{e.destroy()}}),[t]);return n?null:$t("div",{className:"fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50","data-testid":"profile-outer",children:$t("div",{className:"relative w-full h-full","data-testid":"profile-inner",children:[$t("div",{className:"absolute right-0 m-3",children:$t(Ae,{title:"Close the Profile",onClick:()=>{var t;i(!0),null===(t=o.current)||void 0===t||t.publish("closeProfile")},variant:"dark",
128
128
  classes:be("!bg-transparent enabled:hover:!bg-grey-3"),children:$t(Yt,{className:"w-4 h-4"})})}),$t("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:e.profileAppUrl})]})})}class qo{constructor(t,e,i){n(this,"_outerContainer",void 0),n(this,"shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-profile"),t.appendChild(this._outerContainer),this.shadowRoot=Ie(this._outerContainer),dt($t(Uo,{eventBus:e,config:i}),this.shadowRoot)}destroy(){dt(null,this.shadowRoot),this._outerContainer.remove()}}var Wo={exports:{}};!function(t){!function(e,n,i,o){var r,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",c=Math.round,h=Math.abs,u=Date.now;function d(t,e,n){return setTimeout(b(t,n),e)}function f(t,e,n){return!!Array.isArray(t)&&(p(t,n[e],n),!0)}function p(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 m(t,n,i){
@@ -152,14 +152,15 @@ if(!(Be(e)&&(H.tagNameCheck instanceof RegExp&&es(H.tagNameCheck,e)||H.tagNameCh
152
152
  Oe("uponSanitizeAttribute",e,s),r=s.attrValue,s.forceKeepAttr)continue;if(Ie(l,e),!s.keepAttr)continue;if(!V&&es(/\/>/i,r)){Ie(l,e);continue}Y&&(r=Za(r,A," "),r=Za(r,C," "),r=Za(r,M," "));const u=ye(e.nodeName);if(Pe(u,o,r)){if(!te||"id"!==o&&"name"!==o||(Ie(l,e),r="user-content-"+r),y&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(c);else switch(p.getAttributeType(u,o)){case"TrustedHTML":r=y.createHTML(r);break;case"TrustedScriptURL":r=y.createScriptURL(r)}try{c?e.setAttributeNS(c,l,r):e.setAttribute(l,r),Va(n.removed)}catch(e){}}}Oe("afterSanitizeAttributes",e,null)},He=function e(t){let n;const r=Re(t);for(Oe("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Oe("uponSanitizeShadowNode",n,null),De(n)||(n.content instanceof a&&e(n.content),Fe(n));Oe("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t,o,i,s,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(fe=!e,fe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Le(e)){
153
153
  if("function"!=typeof e.toString)throw ts("toString is not a function");if("string"!=typeof(e=e.toString()))throw ts("dirty is not a string, aborting")}if(!n.isSupported)return e;if(K||Se(c),n.removed=[],"string"==typeof e&&(re=!1),re){if(e.nodeName){const t=ye(e.nodeName);if(!D[t]||U[t])throw ts("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)t=ze("\x3c!----\x3e"),o=t.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?t=o:t.appendChild(o);else{if(!Z&&!Y&&!W&&-1===e.indexOf("<"))return y&&J?y.createHTML(e):e;if(t=ze(e),!t)return Z?null:J?w:""}t&&X&&Me(t.firstChild);const u=Re(re?e:t);for(;i=u.nextNode();)De(i)||(i.content instanceof a&&He(i.content),Fe(i));if(re)return e;if(Z){if(Q)for(s=S.call(t.ownerDocument);t.firstChild;)s.appendChild(t.firstChild);else s=t;return(B.shadowroot||B.shadowrootmod)&&(s=E.call(r,s,!0)),s}let d=W?t.outerHTML:t.innerHTML
154
154
  ;return W&&D["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&es(Es,t.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+t.ownerDocument.doctype.name+">\n"+d),Y&&(d=Za(d,A," "),d=Za(d,C," "),d=Za(d,M," ")),y&&J?y.createHTML(d):d},n.setConfig=function(e){Se(e),K=!0},n.clearConfig=function(){we=null,K=!1},n.isValidAttribute=function(e,t,n){we||Se({});const r=ye(e),o=ye(t);return Pe(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(T[e]=T[e]||[],Ya(T[e],t))},n.removeHook=function(e){if(T[e])return Va(T[e])},n.removeHooks=function(e){T[e]&&(T[e]=[])},n.removeAllHooks=function(){T={}},n}(),Ms=/["'&<>]/,Is=function(e){var t,n=""+e,r=Ms.exec(n);if(!r)return n;var o="",i=0,a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#39;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}a!==i&&(o+=n.substring(a,i)),a=i+1,o+=t}return a!==i?o+n.substring(a,i):o};var zs=t(Is);class Rs{constructor(e,t,n){
155
- this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Rs(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Ls{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Ls(t,Rs.range(this,e))}}class Os{constructor(e,t){this.position=void 0;var n,r="KaTeX parse error: "+e,o=t&&t.loc;if(o&&o.start<=o.end){var i=o.lexer.input;n=o.start;var a=o.end;n===i.length?r+=" at end of input: ":r+=" at position "+(n+1)+": ";var s=i.slice(n,a).replace(/[^]/g,"$&̲");r+=(n>15?"…"+i.slice(n-15,n):i.slice(0,n))+s+(a+15<i.length?i.slice(a,a+15)+"…":i.slice(a))}var l=new Error(r);return l.name="ParseError",l.__proto__=Os.prototype,l.position=n,l}}Os.prototype.__proto__=Error.prototype;var Ds=/([A-Z])/g,Ps={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},Bs=/[&><"']/g;var Fs=function e(t){
156
- return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},Hs={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(Bs,(e=>Ps[e]))},hyphenate:function(e){return e.replace(Ds,"-$1").toLowerCase()},getBaseElem:Fs,isCharacterBox:function(e){var t=Fs(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},Us={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."
157
- },fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",
158
- processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,
159
- description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function js(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class qs{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Us)if(Us.hasOwnProperty(t)){var n=Us[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:js(n)}}
160
- reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new Os("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){e.url&&!e.protocol&&(e.protocol=Hs.protocolFromUrl(e.url))
161
- ;var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class $s{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Gs[Vs[this.id]]}sub(){return Gs[Ys[this.id]]}fracNum(){return Gs[Ws[this.id]]}fracDen(){return Gs[Ks[this.id]]}cramp(){return Gs[Xs[this.id]]}text(){return Gs[Zs[this.id]]}isTight(){return this.size>=2}}var Gs=[new $s(0,0,!1),new $s(1,0,!0),new $s(2,1,!1),new $s(3,1,!0),new $s(4,2,!1),new $s(5,2,!0),new $s(6,3,!1),new $s(7,3,!0)],Vs=[4,5,4,5,6,7,6,7],Ys=[5,5,5,5,7,7,7,7],Ws=[2,3,4,5,6,7,6,7],Ks=[3,3,5,5,7,7,7,7],Xs=[1,1,3,3,5,5,7,7],Zs=[0,1,2,3,2,3,2,3],Qs={DISPLAY:Gs[0],TEXT:Gs[2],SCRIPT:Gs[4],SCRIPTSCRIPT:Gs[6]},Js=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",
162
- blocks:[[44032,55215]]}];var el=[];function tl(e){for(var t=0;t<el.length;t+=2)if(e>=el[t]&&e<=el[t+1])return!0;return!1}Js.forEach((e=>e.blocks.forEach((e=>el.push(...e)))));var nl=80,rl={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",
155
+ this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Rs(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Ls{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Ls(t,Rs.range(this,e))}}class Os{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,r,o="KaTeX parse error: "+e,i=t&&t.loc;if(i&&i.start<=i.end){var a=i.lexer.input;n=i.start,r=i.end,n===a.length?o+=" at end of input: ":o+=" at position "+(n+1)+": ";var s=a.slice(n,r).replace(/[^]/g,"$&̲");o+=(n>15?"…"+a.slice(n-15,n):a.slice(0,n))+s+(r+15<a.length?a.slice(r,r+15)+"…":a.slice(r))}var l=new Error(o);return l.name="ParseError",l.__proto__=Os.prototype,l.position=n,null!=n&&null!=r&&(l.length=r-n),l.rawMessage=e,l}}Os.prototype.__proto__=Error.prototype;var Ds=/([A-Z])/g,Ps={"&":"&amp;",">":"&gt;",
156
+ "<":"&lt;",'"':"&quot;","'":"&#x27;"},Bs=/[&><"']/g;var Fs=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},Hs={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(Bs,(e=>Ps[e]))},hyphenate:function(e){return e.replace(Ds,"-$1").toLowerCase()},getBaseElem:Fs,isCharacterBox:function(e){var t=Fs(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},Us={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{
157
+ type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",
158
+ description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,
159
+ description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function js(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class qs{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,
160
+ this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Us)if(Us.hasOwnProperty(t)){var n=Us[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:js(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new Os("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}
161
+ return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){e.url&&!e.protocol&&(e.protocol=Hs.protocolFromUrl(e.url));var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class $s{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Gs[Vs[this.id]]}sub(){return Gs[Ys[this.id]]}fracNum(){return Gs[Ws[this.id]]}fracDen(){return Gs[Ks[this.id]]}cramp(){return Gs[Xs[this.id]]}text(){return Gs[Zs[this.id]]}isTight(){return this.size>=2}}
162
+ var Gs=[new $s(0,0,!1),new $s(1,0,!0),new $s(2,1,!1),new $s(3,1,!0),new $s(4,2,!1),new $s(5,2,!0),new $s(6,3,!1),new $s(7,3,!0)],Vs=[4,5,4,5,6,7,6,7],Ys=[5,5,5,5,7,7,7,7],Ws=[2,3,4,5,6,7,6,7],Ks=[3,3,5,5,7,7,7,7],Xs=[1,1,3,3,5,5,7,7],Zs=[0,1,2,3,2,3,2,3],Qs={DISPLAY:Gs[0],TEXT:Gs[2],SCRIPT:Gs[4],SCRIPTSCRIPT:Gs[6]},Js=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var el=[];function tl(e){for(var t=0;t<el.length;t+=2)if(e>=el[t]&&e<=el[t+1])return!0;return!1}Js.forEach((e=>e.blocks.forEach((e=>el.push(...e)))));var nl=80,rl={
163
+ doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",
163
164
  doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",
164
165
  leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",
165
166
  leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",
@@ -419,7 +420,7 @@ mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){
419
420
  text:o+o}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Os("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}xh.hasOwnProperty(t[0])&&!Ll[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=xh[t[0]]+t.slice(1));var o,i=ah.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),Ll[this.mode][t]){this.settings.strict&&"math"===this.mode&&hc.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a,s=Ll[this.mode][t].group,l=Rs.range(e);if(zl.hasOwnProperty(s)){var c=s;a={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else a={
420
421
  type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(tl(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:Rs.range(e),text:t}}if(this.consume(),i)for(var u=0;u<i[0].length;u++){var d=i[0][u];if(!wh[d])throw new Os("Unknown accent ' "+d+"'",e);var h=wh[d][this.mode]||wh[d].text;if(!h)throw new Os("Accent "+d+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Rs.range(e),label:h,isStretchy:!1,isShifty:!0,base:o}}return o}}kh.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var Sh=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new kh(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse()
421
422
  ;if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Os("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new Ls("\\df@tag")])}]}return r},Nh=function(e,t,n){t.textContent="";var r=Th(e,n).toNode();t.appendChild(r)};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Nh=function(){throw new Os("KaTeX doesn't work in quirks mode.")});var Eh=function(e,t,n){if(n.throwOnError||!(e instanceof Os))throw e;var r=Tc.makeSpan(["katex-error"],[new Tl(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},Th=function(e,t){var n=new qs(t);try{return function(e,t,n){var r,o=du(n);if("mathml"===n.output)return uu(e,t,o,n.displayMode,!0);if("html"===n.output){var i=Jc(e,o)
422
- ;r=Tc.makeSpan(["katex"],[i])}else{var a=uu(e,t,o,n.displayMode,!1),s=Jc(e,o);r=Tc.makeSpan(["katex"],[a,s])}return hu(r,n)}(Sh(e,n),e,n)}catch(t){return Eh(t,e,n)}},Ah={version:"0.16.7",render:Nh,renderToString:function(e,t){return Th(e,t).toMarkup()},ParseError:Os,SETTINGS_SCHEMA:Us,__parse:function(e,t){var n=new qs(t);return Sh(e,n)},__renderToDomTree:Th,__renderToHTMLTree:function(e,t){var n=new qs(t);try{return function(e,t,n){var r=Jc(e,du(n)),o=Tc.makeSpan(["katex"],[r]);return hu(o,n)}(Sh(e,n),0,n)}catch(t){return Eh(t,e,n)}},__setFontMetrics:function(e,t){il[e]=t},__defineSymbol:Ol,__defineFunction:Dc,__defineMacro:fd,__domTree:{Span:kl,Anchor:Sl,SymbolNode:Tl,SvgNode:Al,PathNode:Cl,LineNode:Ml}},Ch={exports:{}};!function(t){(function(){function e(e){var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,
423
+ ;r=Tc.makeSpan(["katex"],[i])}else{var a=uu(e,t,o,n.displayMode,!1),s=Jc(e,o);r=Tc.makeSpan(["katex"],[a,s])}return hu(r,n)}(Sh(e,n),e,n)}catch(t){return Eh(t,e,n)}},Ah={version:"0.16.8",render:Nh,renderToString:function(e,t){return Th(e,t).toMarkup()},ParseError:Os,SETTINGS_SCHEMA:Us,__parse:function(e,t){var n=new qs(t);return Sh(e,n)},__renderToDomTree:Th,__renderToHTMLTree:function(e,t){var n=new qs(t);try{return function(e,t,n){var r=Jc(e,du(n)),o=Tc.makeSpan(["katex"],[r]);return hu(o,n)}(Sh(e,n),0,n)}catch(t){return Eh(t,e,n)}},__setFontMetrics:function(e,t){il[e]=t},__defineSymbol:Ol,__defineFunction:Dc,__defineMacro:fd,__domTree:{Span:kl,Anchor:Sl,SymbolNode:Tl,SvgNode:Al,PathNode:Cl,LineNode:Ml}},Ch={exports:{}};!function(t){(function(){function e(e){var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,
423
424
  describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{
424
425
  defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},
425
426
  smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,
@@ -535,7 +536,7 @@ for(let n=0;n<Math.min(e.length,t.length);n++)if(e[n]!==t[n]){if(typeof e[n]!=ty
535
536
  ;function pp(e){return function(e){return e.replace(mp,"")}((t=e,t.normalize("NFKD"))).toLowerCase();var t}class fp{constructor(e,t){H(this,"term",void 0),H(this,"matcher",void 0),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 gp{constructor(e,t){H(this,"operator",void 0),H(this,"filters",void 0),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 vp(e){return{fieldValues:e,matches:(e,t)=>e.includes(t),normalize:pp}}const _p={quote:vp((e=>{var t;return[null!==(t=oo(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:vp((e=>e.tags)),text:vp((e=>[e.text])),uri:vp((e=>[e.uri])),user:vp((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 bp=function(e){
536
537
  if(1!==e.length)throw new Error("Memoize input must be a function of one argument");let t,n;return function(r){return r===t||(t=r,n=e(r)),n}}((function(e){const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:hp[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=Km(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"
537
538
  },text:{terms:a,operator:"and"},uri:{terms:s,operator:"or"},user:{terms:l,operator:"or"}}}(t.filterQuery||"",t.filters);n.filterFn=t=>function(e,t){const n=(e,t)=>new fp(t,_p[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 gp("or",e.map((e=>n(e,t))))))}else r=t.terms.map((t=>n(e,t)));return new gp(t.operator,r)})),o=new gp("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,!Xr(n)&&sp(n)===r);var n,r}),ap(e.annotations,n)}));function yp(){const e=Oi(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a=de((()=>({annotations:t,route:r,selection:{...o,filterQuery:n,filters:i}})),[t,n,r,o,i]);return bp(a)}var wp=lr((function({loadAnnotationsService:e,onLogin:t}){var n
538
- ;const r=Oi(),o=null!==(n=r.routeParams().id)&&void 0!==n?n:"",i=yp(),a=r.profile().userid,[s,l]=ae(!1);return le((()=>{l(!1),r.clearAnnotations(),e.loadThread(o).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&r.setExpanded(e.id,!0))),t.id!==o&&r.highlightAnnotations([o]))})).catch((()=>{l(!0)}))}),[o,a,e,r]),Ee(v,{children:[s&&Ee(Di,{errorType:"annotation",onLoginRequest:t}),Ee(Vm,{threads:i.children})]})}),["loadAnnotationsService"]);class xp{constructor(e,t,n=window){var r,o,i,a;H(this,"version",void 0),H(this,"userAgent",void 0),H(this,"urls",void 0),H(this,"fingerprint",void 0),H(this,"account",void 0),H(this,"timestamp",void 0),H(this,"segment",void 0);const s="N/A";let l=s;e.userid&&(l=e.userid,e.displayName&&(l=`${e.displayName} (${l})`)),this.version="1.1303.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||s,
539
+ ;const r=Oi(),o=null!==(n=r.routeParams().id)&&void 0!==n?n:"",i=yp(),a=r.profile().userid,[s,l]=ae(!1);return le((()=>{l(!1),r.clearAnnotations(),e.loadThread(o).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&r.setExpanded(e.id,!0))),t.id!==o&&r.highlightAnnotations([o]))})).catch((()=>{l(!0)}))}),[o,a,e,r]),Ee(v,{children:[s&&Ee(Di,{errorType:"annotation",onLoginRequest:t}),Ee(Vm,{threads:i.children})]})}),["loadAnnotationsService"]);class xp{constructor(e,t,n=window){var r,o,i,a;H(this,"version",void 0),H(this,"userAgent",void 0),H(this,"urls",void 0),H(this,"fingerprint",void 0),H(this,"account",void 0),H(this,"timestamp",void 0),H(this,"segment",void 0);const s="N/A";let l=s;e.userid&&(l=e.userid,e.displayName&&(l=`${e.displayName} (${l})`)),this.version="1.1304.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||s,
539
540
  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(){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())}}var kp="complete",Sp="canceled";function Np(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function Ep(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){
540
541
  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),_=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=_+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 Np(e,r.x,r.y),
541
542
  e._scrollSettings=null,t.end(kp);var a=1-t.ease(i);if(Np(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Ep(t.scrollAncestor),void Ep(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Ep.bind(null,e))}}function Tp(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 Cp(){return!0}function Mp(e){if(e.assignedSlot)return Mp(e.assignedSlot);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 Ip=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||{}
@@ -583,7 +584,7 @@ message:"Method not found"}};e.params?t(...e.params):t();return{jsonrpc:"2.0",re
583
584
  this._activity=e,this._api=t,this._store=n}_applyDraftChanges(e){const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?ma(e.user):pa(e.user,e.group)),{...e,...t}}_initialize(e,t){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:"+Df(8),l=Object.assign({created:t.toISOString(),group:r,permissions:fa(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Qr(l)&&(l.permissions=ma(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Qr(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Wr(n)}),eo(n)?this._store.selectTab("note"):to(n)&&this._store.selectTab("annotation"),
584
585
  (n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._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:Wr(e)?pa(t,e.group):ma(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;Vr(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)}
585
586
  for(const[t,n]of Object.entries(e))if(t.startsWith("$")){o[t]=n}return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}Qf.$inject=["annotationActivity","api","store"];class Jf extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),H(this,"url",void 0),H(this,"response",void 0),H(this,"reason",void 0),this.url=e,this.response=t,this.reason=n}}async function eg(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Jf(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new Jf(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Jf(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function tg(e){const t={};for(const[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}class ng{constructor(e,t,n){H(this,"_clientId",void 0),H(this,"search",void 0),H(this,"annotation",void 0),H(this,"group",void 0),H(this,"groups",void 0),H(this,"profile",void 0),this._clientId=null
586
- ;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,i]=await Promise.all([e,n()]),l=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!l)throw new Error(`Missing API route: ${t}`);const c={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1303.0"};i&&(c.Authorization="Bearer "+i);const u=r();u&&(c["X-Client-Id"]=u);const{url:d,unusedParams:h}=si(l.url,a),m=new URL(d);for(const[e,t]of Object.entries(h)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&m.searchParams.append(e,t.toString())}return await eg(m.toString(),{body:s?JSON.stringify(tg(s)):null,headers:c,method:l.method})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),
587
+ ;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,i]=await Promise.all([e,n()]),l=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!l)throw new Error(`Missing API route: ${t}`);const c={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1304.0"};i&&(c.Authorization="Bearer "+i);const u=r();u&&(c["X-Client-Id"]=u);const{url:d,unusedParams:h}=si(l.url,a),m=new URL(d);for(const[e,t]of Object.entries(h)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&m.searchParams.append(e,t.toString())}return await eg(m.toString(),{body:s?JSON.stringify(tg(s)):null,headers:c,method:l.method})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),
587
588
  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}}ng.$inject=["apiRoutes","auth","store"];var rg={};function og(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 ig=og;og.prototype.reset=function(){this._attempts=1,
588
589
  this._timeouts=this._originalTimeouts.slice(0)},og.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},og.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout((function(){r._operationTimeoutCb(r._attempts)}),r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)}),n),this._options.unref&&this._timer.unref(),!0},og.prototype.attempt=function(e,t){this._fn=e,
589
590
  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)},og.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},og.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},og.prototype.start=og.prototype.try,og.prototype.errors=function(){return this._errors},og.prototype.attempts=function(){return this._attempts},og.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=ig;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})},
@@ -650,16 +651,16 @@ this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}co
650
651
  return Kg.__SENTRY__=Kg.__SENTRY__||{extensions:{},hub:void 0},Kg}function H_(e){const t=F_(),n=j_(t);return q_(t,e),n}function U_(){const e=F_();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=F_()){t=e,t&&t.__SENTRY__&&t.__SENTRY__.hub&&!j_(e).isOlderThan(D_)||q_(e,new B_);var t;return j_(e)}(e)}function j_(e){return Zg("hub",(()=>new B_),e)}function q_(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}function $_(e,t){return U_().captureException(e,{captureContext:t})}function G_(e,t){U_().setExtra(e,t)}const V_="7";function Y_(e,t){return n={sentry_key:e.publicKey,sentry_version:V_,...t&&{sentry_client:`${t.name}/${t.version}`}},Object.keys(n).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`)).join("&");var n}function W_(e,t,n,r){const o=T_(n),i=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,
651
652
  e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const a=function(e,t,n,r){const o=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:sv(r)},...o&&{trace:kv({...o})}}}(e,o,r,t);delete e.sdkProcessingMetadata;return b_(a,[[{type:i},e]])}const K_=[];function X_(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach((e=>{e.isDefaultInstance=!0})),r=Array.isArray(n)?[...t,...n]:"function"==typeof n?n_(n(t)):t;const o=function(e){const t={};return e.forEach((e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.keys(t).map((e=>t[e]))}(r),i=function(e,t){for(let n=0;n<e.length;n++)if(!0===t(e[n]))return n;return-1}(o,(e=>"Debug"===e.name));if(-1!==i){const[e]=o.splice(i,1);o.push(e)}return o}function Z_(e,t){t[e.name]=e,-1===K_.indexOf(e.name)&&(e.setupOnce(O_,U_),
652
653
  K_.push(e.name),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.log(`Integration installed: ${e.name}`))}function Q_(e,t,n,r){const{normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=e,a={...t,event_id:t.event_id||n.event_id||Xv(),timestamp:t.timestamp||v_()},s=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:o,maxValueLength:i=250}=t;"environment"in e||(e.environment="environment"in t?n:M_);void 0===e.release&&void 0!==r&&(e.release=r);void 0===e.dist&&void 0!==o&&(e.dist=o);e.message&&(e.message=dv(e.message,i));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=dv(a.value,i));const s=e.request;s&&s.url&&(s.url=dv(s.url,i))}(a,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(a,s),void 0===t.type&&function(e,t){const n=Kg._sentryDebugIds;if(!n)return;let r;const o=J_.get(t);o?r=o:(r=new Map,J_.set(t,r));const i=Object.keys(n).reduce(((e,o)=>{let i;const a=r.get(o)
653
- ;a?i=a:(i=t(o),r.set(o,i));for(let t=i.length-1;t>=0;t--){const r=i[t];if(r.filename){e[r.filename]=n[o];break}}return e}),{}),a=new Set;try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&a.add(e.filename)}))}))}catch(e){}e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const s=e.debug_meta.images;a.forEach((e=>{i[e]&&s.push({type:"sourcemap",code_file:e,debug_id:i[e]})}))}(a,e.stackParser);let l=r;n.captureContext&&(l=R_.clone(l).update(n.captureContext));let c=s_(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:r_(e.data,t,n)}})))},...e.user&&{user:r_(e.user,t,n)},...e.contexts&&{contexts:r_(e.contexts,t,n)},...e.extra&&{extra:r_(e.extra,t,n)}}
654
- ;e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=r_(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=r_(e.data,t,n)),e))));return r}(e,o,i):e))}const J_=new WeakMap;const eb="Not capturing exception because it's already been captured.";class tb{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(tb.prototype.__init.call(this),tb.prototype.__init2.call(this),tb.prototype.__init3.call(this),tb.prototype.__init4.call(this),tb.prototype.__init5.call(this),this._options=e,e.dsn?this._dsn=cv(e.dsn):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn("No DSN provided, client will not do anything."),this._dsn){const t=function(e,t={}){const n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){
655
- const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${Y_(e,r)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(t_(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.log(eb));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=qg(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){if(t&&t.originalException&&t_(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.log(eb));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{r=e}))),r}captureSession(e){
656
- this._isEnabled()?"string"!=typeof e.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),z_(e,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.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)))):s_(!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={};return e.forEach((e=>{e&&Z_(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){
657
- return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Z_(e,this._integrations)}sendEvent(e,t={}){if(this._dsn){let n=W_(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=y_(n,S_(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}}sendSession(e){if(this._dsn){const t=function(e,t,n,r){const o=T_(n);return b_({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&{dsn:sv(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(e,t){
658
- this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach((e=>e(...t)))}_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)&&(z_(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new c_((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),Q_(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;"log"===t.logLevel?iv.log(t.message):iv.warn(t)}
659
- }))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:o}=r;if(!this._isEnabled())return l_(new uv("SDK not enabled, will not capture event.","log"));const i=rb(e),a=nb(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),l_(new uv(`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 uv("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(nb(t)&&r)return r(t,n);if(rb(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(Vg(e))return e.then((e=>{if(!$g(e)&&null!==e)throw new uv(n);return e}),(e=>{
660
- throw new uv(`${t} rejected with ${e}`)}));if(!$g(e)&&null!==e)throw new uv(n);return e}(o,l)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",c,e),new uv(`${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 uv)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new uv(`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){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,(e=>{
661
- ("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.error("Error while sending event:",e)}));("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.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 nb(e){return void 0===e.type}function rb(e){return"transaction"===e.type}const ob=30;function ib(e,t,n=u_(e.bufferSize||ob)){let r={};function o(o){const i=[];if(w_(o,((t,n)=>{const o=E_(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=ab(t,n);e.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(t)})),0===i.length)return s_();const a=b_(o[0],i),s=t=>{w_(a,((n,r)=>{const o=ab(n,r);e.recordDroppedEvent(t,E_(r),o)}))};return n.add((()=>t({body:k_(a,e.textEncoder)
662
- }).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=C_(r,e),e)),(e=>{throw s("network_error"),e})))).then((e=>e),(e=>{if(e instanceof uv)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.error("Skipped sending event because buffer is full."),s("queue_overflow"),s_();throw e}))}return o.__sentry__baseTransport__=!0,{send:o,flush:e=>n.drain(e)}}function ab(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const sb="7.55.2";let lb;class cb{constructor(){cb.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=cb.id}setupOnce(){lb=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=_v(this)||this;return lb.apply(t,e)}}catch(e){}}}cb.__initStatic()
654
+ ;a?i=a:(i=t(o),r.set(o,i));for(let t=i.length-1;t>=0;t--){const r=i[t];if(r.filename){e[r.filename]=n[o];break}}return e}),{});try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&(e.debug_id=i[e.filename])}))}))}catch(e){}}(a,e.stackParser);let l=r;n.captureContext&&(l=R_.clone(l).update(n.captureContext));let c=s_(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=>(e&&function(e){const t={};try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))}))}catch(e){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach((e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})}))}(e),"number"==typeof o&&o>0?function(e,t,n){if(!e)return null;const r={...e,
655
+ ...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:r_(e.data,t,n)}})))},...e.user&&{user:r_(e.user,t,n)},...e.contexts&&{contexts:r_(e.contexts,t,n)},...e.extra&&{extra:r_(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=r_(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=r_(e.data,t,n)),e))));return r}(e,o,i):e)))}const J_=new WeakMap;const eb="Not capturing exception because it's already been captured.";class tb{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(tb.prototype.__init.call(this),tb.prototype.__init2.call(this),tb.prototype.__init3.call(this),tb.prototype.__init4.call(this),tb.prototype.__init5.call(this),this._options=e,
656
+ e.dsn?this._dsn=cv(e.dsn):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn("No DSN provided, client will not do anything."),this._dsn){const t=function(e,t={}){const n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${Y_(e,r)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(t_(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.log(eb));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=qg(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n)
657
+ ;return this._process(i.then((e=>this._captureEvent(e,n,r))).then((e=>{o=e}))),o}captureEvent(e,t,n){if(t&&t.originalException&&t_(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.log(eb));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__)&&iv.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),z_(e,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.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)))):s_(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,e)))}setupIntegrations(){
658
+ this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const t={};return e.forEach((e=>{e&&Z_(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__)&&iv.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Z_(e,this._integrations)}sendEvent(e,t={}){if(this._dsn){let n=W_(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=y_(n,S_(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}}sendSession(e){if(this._dsn){const t=function(e,t,n,r){const o=T_(n);return b_({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&{dsn:sv(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])
659
+ }(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach((e=>e(...t)))}_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)&&(z_(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new c_((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){
660
+ const r=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),Q_(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;"log"===t.logLevel?iv.log(t.message):iv.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:o}=r;if(!this._isEnabled())return l_(new uv("SDK not enabled, will not capture event.","log"));const i=rb(e),a=nb(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),l_(new uv(`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 uv("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n
661
+ ;const o=function(e,t,n){const{beforeSend:r,beforeSendTransaction:o}=e;if(nb(t)&&r)return r(t,n);if(rb(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(Vg(e))return e.then((e=>{if(!$g(e)&&null!==e)throw new uv(n);return e}),(e=>{throw new uv(`${t} rejected with ${e}`)}));if(!$g(e)&&null!==e)throw new uv(n);return e}(o,l)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",c,e),new uv(`${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 uv)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new uv(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){
662
+ this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.error("Error while sending event:",e)}));("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.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 nb(e){return void 0===e.type}function rb(e){return"transaction"===e.type}const ob=30;function ib(e,t,n=u_(e.bufferSize||ob)){let r={};function o(o){const i=[];if(w_(o,((t,n)=>{const o=E_(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=ab(t,n);e.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(t)})),0===i.length)return s_();const a=b_(o[0],i),s=t=>{w_(a,((n,r)=>{const o=ab(n,r)
663
+ ;e.recordDroppedEvent(t,E_(r),o)}))};return n.add((()=>t({body:k_(a,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=C_(r,e),e)),(e=>{throw s("network_error"),e})))).then((e=>e),(e=>{if(e instanceof uv)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.error("Skipped sending event because buffer is full."),s("queue_overflow"),s_();throw e}))}return o.__sentry__baseTransport__=!0,{send:o,flush:e=>n.drain(e)}}function ab(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const sb="7.56.0";let lb;class cb{constructor(){cb.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=cb.id}setupOnce(){lb=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=_v(this)||this;return lb.apply(t,e)}}catch(e){}}}cb.__initStatic()
663
664
  ;const ub=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],db=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class hb{static __initStatic(){this.id="InboundFilters"}__init(){this.name=hb.id}constructor(e={}){this._options=e,hb.prototype.__init.call(this)}setupOnce(e,t){const n=e=>{const n=t();if(n){const t=n.getIntegration(hb);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||[],...e.disableErrorDefaults?[]:ub],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:db],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
664
665
  }(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Qv(e)}`),!0;if(function(e,t){if(e.type||!t||!t.length)return!1;return function(e){if(e.message)return[e.message];if(e.exception){const{values:t}=e.exception;try{const{type:e="",value:n=""}=t&&t[t.length-1]||{};return[`${n}`,`${e}: ${n}`]}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.error(`Cannot extract message for event ${Qv(e)}`),[]}}return[]}(e).some((e=>pv(e,t)))}(e,t.ignoreErrors))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Qv(e)}`),!0;if(function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&pv(n,t)}(e,t.ignoreTransactions))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Qv(e)}`),!0
665
666
  ;if(function(e,t){if(!t||!t.length)return!1;const n=mb(e);return!!n&&pv(n,t)}(e,t.denyUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Qv(e)}.\nUrl: ${mb(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=mb(e);return!n||pv(n,t)}(e,t.allowUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Qv(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=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&iv.error(`Cannot extract url for event ${Qv(e)}`),null}}hb.__initStatic();const pb=Kg;let fb=0;function gb(){
@@ -690,8 +691,8 @@ H(this,"_socket",void 0),H(this,"_reconnectSetUp",void 0),H(this,"_updateImmedia
690
691
  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 wy(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)}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,
691
692
  kg(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}xy.$inject=["store","apiRoutes","auth","groups","session"];const ky="hypothesis.user.tags.list",Sy="hypothesis.user.tags.map";class Ny{constructor(e){H(this,"_storage",void 0),this._storage=e}filter(e,t=null){const n=this._storage.getObject(ky)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${Gf(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject(Sy)||{};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(Sy,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(ky,n)}}Ny.$inject=["localStorage"];class Ey{constructor(e){H(this,"_store",void 0),this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),
692
693
  e.visible||this._store.setForcedVisible(e.id,!0)}}Ey.$inject=["store"];class Ty extends $p{constructor(e,t){super(),H(this,"_store",void 0),H(this,"_window",void 0),H(this,"_delayedMessageQueue",void 0),this._store=e,this._window=t,this._delayedMessageQueue=[],this._window.addEventListener("focus",(()=>{this._delayedMessageQueue.forEach((({type:e,messageText:t,options:n})=>this._addMessage(e,t,n))),this._delayedMessageQueue=[]}))}dismiss(e){const t=this._store.getToastMessage(e);t&&!t.isDismissed&&(this._store.updateToastMessage({...t,isDismissed:!0}),this.emit("toastMessageDismissed",e),setTimeout((()=>{this._store.removeToastMessage(e)}),500))}_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r="",visuallyHidden:o=!1,delayed:i=!1}={}){if(this._store.hasToastMessage(e,t))return;if(i&&!this._window.document.hasFocus()){const i={autoDismiss:n,moreInfoURL:r,visuallyHidden:o};return void this._delayedMessageQueue.push({type:e,messageText:t,options:i})}const a=Df(10),s={type:e,id:a,message:t,moreInfoURL:r,
693
- visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...s}),this.emit("toastMessageAdded",s),n&&setTimeout((()=>{this.dismiss(a)}),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)}}Ty.$inject=["store","$window"];const Ay=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),Cy=function(e){const{version:t,origin:n}=Bf(e.location.href);return"1.1303.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1303.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."),
694
- !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 My(e,t){e.setClientId(t.clientId)}function Iy(e,t,n){e.load(),t.load(),n.sync()}function zy(e,t,n){e.init(),t.init(),n.init()}function Ry(e,t){"sidebar"===t.route()&&e.connect()}Ay.sentry&&Cy&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;fy({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1303.0",beforeSend:(e,t)=>{if(vy>=5)return $f("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++vy;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{G_("host_config",Bf(window.location.href))}catch(e){}
694
+ visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...s}),this.emit("toastMessageAdded",s),n&&setTimeout((()=>{this.dismiss(a)}),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)}}Ty.$inject=["store","$window"];const Ay=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),Cy=function(e){const{version:t,origin:n}=Bf(e.location.href);return"1.1304.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1304.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."),
695
+ !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 My(e,t){e.setClientId(t.clientId)}function Iy(e,t,n){e.load(),t.load(),n.sync()}function zy(e,t,n){e.init(),t.init(),n.init()}function Ry(e,t){"sidebar"===t.route()&&e.connect()}Ay.sentry&&Cy&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;fy({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1304.0",beforeSend:(e,t)=>{if(vy>=5)return $f("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++vy;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{G_("host_config",Bf(window.location.href))}catch(e){}
695
696
  G_("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),vg(((e,t)=>{$_(e,{tags:{context:t}})}))}(Ay.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")}))}(document.body),My.$inject=["api","streamer"],Iy.$inject=["groups","session","router"],zy.$inject=["autosaveService","persistedDefaults","serviceURL"],Ry.$inject=["frameSync","store"];const Ly=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",Xf)}(),async function(e,t=window){const n=function(e){const t=Bf(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:Ff,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{
696
697
  origin:Uf(t.origin),ancestorLevel:Hf(t.ancestorLevel)}}},o={};for(const[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i);return o}(window),r=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null;if("number"!=typeof n.ancestorLevel||"string"!=typeof n.origin)throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified");return{targetFrame:jf(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await Pf(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=Pf(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=or(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl
697
698
  ;throw new Error("Service should contain an apiUrl value.")}(i),i}(Ay).then((e=>{!function(e,t){const n=new $;n.register("annotationsService",Qf).register("annotationActivity",Zf).register("api",ng).register("apiRoutes",cg).register("auth",hg).register("autosaveService",mg).register("frameSync",Eg).register("groups",Cg).register("loadAnnotationsService",Mg).register("localStorage",zg).register("persistedDefaults",Lg).register("router",Og).register("serviceURL",Dg).register("session",by).register("streamer",xy).register("streamFilter",yy).register("tags",Ny).register("threadsService",Ey).register("toastMessenger",Ty).register("store",{factory:Li}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(zy),n.run(My),n.run(Iy),n.run(Kf),n.run(Ry),B(Ee(sr.Provider,{value:n,children:Ee(Rf,{})}),t)}(e,Ly)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),B(Ee(Lf,{error:e}),t)}(e,Ly)));