hypothesis 1.1453.0 → 1.1455.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 +1 -1
- package/build/manifest.json +6 -6
- package/build/scripts/annotator.bundle.js +1 -1
- package/build/scripts/sidebar.bundle.js +13 -13
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js +676 -675
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/package.json +2 -2
package/build/boot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?
|
|
1
|
+
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?da9373","styles/annotator.css":"styles/annotator.css?ec72d0","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/annotator.css.map":"styles/annotator.css.map?de3818","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?e179ab","styles/katex.min.css.map":"styles/katex.min.css.map?cd8c0e","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?13d728","styles/sidebar.css.map":"styles/sidebar.css.map?1984a9","styles/ui-playground.css":"styles/ui-playground.css?db6174","styles/ui-playground.css.map":"styles/ui-playground.css.map?ec0173","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?604be7","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?fa1683","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?feaedf","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?ca4986","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?278aef"};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.1455.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;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var 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/.")}();
|
package/build/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?da9373",
|
|
3
3
|
"styles/annotator.css": "styles/annotator.css?ec72d0",
|
|
4
|
-
"styles/annotator.css.map": "styles/annotator.css.map?de3818",
|
|
5
4
|
"styles/highlights.css": "styles/highlights.css?6b4ebd",
|
|
5
|
+
"styles/annotator.css.map": "styles/annotator.css.map?de3818",
|
|
6
6
|
"styles/highlights.css.map": "styles/highlights.css.map?241350",
|
|
7
7
|
"styles/katex.min.css": "styles/katex.min.css?e179ab",
|
|
8
8
|
"styles/katex.min.css.map": "styles/katex.min.css.map?cd8c0e",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"styles/sidebar.css.map": "styles/sidebar.css.map?1984a9",
|
|
13
13
|
"styles/ui-playground.css": "styles/ui-playground.css?db6174",
|
|
14
14
|
"styles/ui-playground.css.map": "styles/ui-playground.css.map?ec0173",
|
|
15
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?604be7",
|
|
16
|
+
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?fa1683",
|
|
15
17
|
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?feaedf",
|
|
16
|
-
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?
|
|
17
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?
|
|
18
|
-
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?d15e01",
|
|
19
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?e43938"
|
|
18
|
+
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?ca4986",
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?278aef"
|
|
20
20
|
}
|
|
@@ -140,7 +140,7 @@ this._portFinder.discover("sidebar").then((t=>{this._sidebarRPC.connect(t)})),th
|
|
|
140
140
|
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=Fn.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&&Zn(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){var n;this.anchors=t,null===(n=this._clusterToolbar)||void 0===n||n.scheduleClusterUpdates(),e&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[]
|
|
141
141
|
;const n=await this.getDocumentInfo(),i=this.element,o=(await Promise.all(e.map((t=>this._integration.describe(i,t))))).map((t=>({source:n.uri,selector:t}))),r={uri:n.uri,document:n.metadata,target:o,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+s(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),gr(),r}_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);Qn(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=Wn(n),o=jn(n);o?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=fr(),this._isAdderVisible=!0,this._adder.show(o,i)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],
|
|
142
142
|
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._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){re(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(t){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new hr(this.element)),this._outsideAssignmentNotice.setVisible(t)}}function br(t,e){const n=new URL(t),i=new URLSearchParams
|
|
143
|
-
;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function yr(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.
|
|
143
|
+
;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function yr(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.1455.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 wr({config:t,groupId:e}){return ve("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:br(t.notebookAppUrl,{...yr(t.notebookAppUrl,t),group:e})})}const xr=({isHidden:t,children:e,onClose:n})=>{const i=Xt(null);return $t((()=>{var e,n
|
|
144
144
|
;t?null===(e=i.current)||void 0===e||e.close():null===(n=i.current)||void 0===n||n.showModal()}),[t]),$t((()=>{const t=i.current;return null==t||t.addEventListener("cancel",n),()=>{null==t||t.removeEventListener("cancel",n)}}),[n]),ve("dialog",{ref:i,className:"relative w-full h-full backdrop:bg-black/50","data-testid":"notebook-outer",children:e})},Cr=({isHidden:t,children:e})=>ve("div",{className:ge("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:t}),"data-testid":"notebook-outer",children:ve("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:e})});function Sr({eventBus:t,config:e,document_:n=document}){const[i,o]=zt(0),[r,s]=zt(!0),[a,l]=zt(null),c=Xt(""),h=Xt(null),u=Yt((()=>function(t){return"function"==typeof t.createElement("dialog").showModal}(n)?xr:Cr),[n]);$t((()=>(c.current=document.body.style.overflow,()=>{document.body.style.overflow=c.current})),[]),$t((()=>{document.body.style.overflow=r?c.current:"hidden"}),[r]),$t((()=>{
|
|
145
145
|
const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{s(!1),o((t=>t+1)),l(t)})),h.current=e,()=>{e.destroy()}}),[t]);const d=Gt((()=>{var t;s(!0),null===(t=h.current)||void 0===t||t.publish("closeNotebook")}),[]);return null===a?null:ve(u,{isHidden:r,onClose:d,children:[ve("div",{className:"absolute right-0 m-3",children:ve(on,{title:"Close the Notebook",onClick:d,variant:"dark",classes:ge("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:ve(Ee,{className:"w-4 h-4"})})}),ve(wr,{config:e,groupId:a},i)]})}class Nr{constructor(t,e,n){i(this,"_container",void 0),this._container=new En("notebook",(()=>ve(Sr,{eventBus:e,config:n}))),t.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Er({eventBus:t,config:e}){const[n,i]=zt(!0),o=Xt(null);$t((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{i(!1)})),o.current=e,()=>{e.destroy()}}),[t]);return n?null:ve("div",{
|
|
146
146
|
className:"fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50","data-testid":"profile-outer",children:ve("div",{className:"relative w-full h-full","data-testid":"profile-inner",children:[ve("div",{className:"absolute right-0 m-3",children:ve(on,{title:"Close the Profile",onClick:()=>{var t;i(!0),null===(t=o.current)||void 0===t||t.publish("closeProfile")},variant:"dark",classes:ge("!bg-transparent enabled:hover:!bg-grey-3"),children:ve(Ee,{className:"w-4 h-4"})})}),ve("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:e.profileAppUrl})]})})}class Ar{constructor(t,e,n){i(this,"_container",void 0),this._container=new En("profile",(()=>ve(Er,{eventBus:e,config:n}))),t.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}var Tr={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)}
|
|
@@ -90,8 +90,8 @@ var cr="/home/runner/work/frontend-shared/frontend-shared/src/components/feedbac
|
|
|
90
90
|
status:e.type,onClick:()=>t(e.id),variant:"raised",children:[Oe("strong",{children:n},void 0,0,{fileName:vr,lineNumber:70,columnNumber:7},this),e.message]},void 0,0,{fileName:vr,lineNumber:62,columnNumber:5},this)}const _r=({direction:e,onTransitionEnd:t,children:n,transitionClasses:r={}})=>{const o="out"===e,i=ue(null),a=de((()=>{const{transitionIn:e="animate-fade-in",transitionOut:t="animate-fade-out"}=r;return{[e]:!o,[t]:o}}),[o,r]);return Oe("div",{"data-testid":"animation-container",onAnimationEnd:n=>{n.target===i.current&&(null==t||t(null!=e?e:"in"))},ref:i,className:X("relative w-full container",a),children:n},void 0,0,{fileName:vr,lineNumber:111,columnNumber:5},void 0)};function yr({messages:e,onMessageDismiss:t,transitionClasses:n,setTimeout_:r=setTimeout}){const[o,i]=ae([]),a=ue(new Map),s=he((e=>i((t=>[...t,e]))),[]),l=he((e=>{const t=r((()=>{s(e),a.current.delete(e)}),5e3);a.current.set(e,t)}),[s,r]),c=he(((e,n)=>{var r;const o=null===(r=n.autoDismiss)||void 0===r||r;"in"===e&&o&&l(n.id),
|
|
91
91
|
"out"===e&&(t(n.id),i((e=>e.filter((e=>e!==n.id)))))}),[l,t]);return ce((()=>{const e=a.current;return()=>{e.forEach((e=>clearTimeout(e)))}}),[]),Oe("ul",{"aria-live":"polite","aria-relevant":"additions",className:"w-full space-y-2","data-component":"ToastMessages",children:e.map((e=>{const t=o.includes(e.id);return Oe("li",{className:X({"mb-2":!e.visuallyHidden}),children:Oe(_r,{direction:t?"out":"in",onTransitionEnd:t=>c(t,e),transitionClasses:n,children:Oe(br,{message:e,onDismiss:s},void 0,0,{fileName:vr,lineNumber:214,columnNumber:15},this)},void 0,0,{fileName:vr,lineNumber:209,columnNumber:13},this)},e.id,0,{fileName:vr,lineNumber:197,columnNumber:11},this)}))},void 0,0,{fileName:vr,lineNumber:188,columnNumber:5},this)}var wr="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Checkbox.tsx";function xr({children:e,elementRef:t,checked:n,defaultChecked:r=!1,icon:o=gt,checkedIcon:i=pt,disabled:a,onChange:s,id:l,...c}){const u="boolean"==typeof n,[d,h]=ae(r),m=u?n:d;const p=m?i:o
|
|
92
92
|
;return Oe("label",{className:X("relative flex items-center gap-x-1.5",{"cursor-pointer":!a,"opacity-70":a}),htmlFor:l,"data-composite-component":"Checkbox",children:[Oe("input",{...c,type:"checkbox",ref:t,className:X("peer","absolute w-em h-em","opacity-[.00001]",{"cursor-pointer":!a}),checked:m,disabled:a,id:l,onChange:function(e){null==s||s.call(this,e),u||h(e.target.checked)}},void 0,0,{fileName:wr,lineNumber:77,columnNumber:7},this),Oe(p,{className:X("peer-focus-visible:ring","w-em h-em")},void 0,0,{fileName:wr,lineNumber:99,columnNumber:7},this),e]},void 0,0,{fileName:wr,lineNumber:69,columnNumber:5},this)}var kr="/home/runner/work/frontend-shared/frontend-shared/src/components/input/Input.tsx";function Nr({classes:e,feedback:t}){return X("focus-visible-ring ring-inset border rounded w-full p-2","bg-grey-0 focus:bg-white disabled:bg-grey-1","placeholder:text-color-grey-5 disabled:placeholder:color-grey-6",{"ring-2":!!t,"ring-red-error":"error"===t,"ring-yellow-notice":"warning"===t},Jn,e)}
|
|
93
|
-
function Sr({elementRef:e,type:t="text",classes:n,feedback:r,...o}){return o.id||o["aria-label"]||console.warn("`Input` component should have either an `id` or an `aria-label` attribute"),Oe("input",{"data-component":"Input",...o,ref:e,type:t,className:Nr({classes:n,feedback:r})},void 0,0,{fileName:kr,lineNumber:56,columnNumber:5},this)}const Ar=D(null);var Er="/home/runner/work/frontend-shared/frontend-shared/src/components/input/SelectNext.tsx";function Tr(e,t){return"function"==typeof e?e(t):e}function Cr({value:e,children:t,disabled:n=!1,classes:r}){const o=me(Ar);if(!o)throw new Error("Select.Option can only be used as Select child");const{selectValue:i,value:a}=o,s=!n&&a===e;return Oe("li",{className:X("w-full ring-inset outline-none rounded-none","border-t first:border-t-0 transition-colors whitespace-nowrap",{"text-grey-4":n,"cursor-pointer focus:ring hover:bg-grey-1":!n},r),onClick:()=>{n||i(e)},onKeyPress:t=>{!n&&["Enter","Space"].includes(t.code)&&(t.preventDefault(),
|
|
94
|
-
"aria-disabled":n,"aria-selected":s,tabIndex:-1,children:Oe("div",{className:X("flex w-full p-1.5 border-l-4",{"border-l-transparent":!s,"border-l-brand font-medium":s}),children:Tr(t,{selected:s,disabled:n})},void 0,0,{fileName:Er,lineNumber:92,columnNumber:7},this)},void 0,0,{fileName:Er,lineNumber:65,columnNumber:5},this)}function Mr({buttonContent:e,value:t,onChange:n,children:r,disabled:o,elementRef:i,buttonId:a,buttonClasses:s,listboxClasses:l,containerClasses:c,right:u=!1,"aria-label":d,"aria-labelledby":h}){const[m,p]=ae(!1),f=he((()=>p(!1)),[]),g=ue(null),v=ue(null),b=pe(),_=Ie(i),y=pe(),w=function(e,t,n){const[r,o]=ae(!1);return ce((()=>{if(!e.current||!t.current||!n)return void o(!1);const r=window.innerHeight,{top:i,bottom:a}=e.current.getBoundingClientRect(),s=r-a,{bottom:l}=t.current.getBoundingClientRect();o(r-l<0&&i>s)}),[e,t,n]),r}(_,v,m),x=he((e=>{n(e),f()}),[f,n]);return Ae(g,f),Ee(g,f),Te(["Escape"],f),Se(v,{horizontal:!1,loop:!1,autofocus:!0,containerVisible:m,
|
|
93
|
+
function Sr({elementRef:e,type:t="text",classes:n,feedback:r,...o}){return o.id||o["aria-label"]||console.warn("`Input` component should have either an `id` or an `aria-label` attribute"),Oe("input",{"data-component":"Input",...o,ref:e,type:t,className:Nr({classes:n,feedback:r}),"aria-invalid":"error"===r},void 0,0,{fileName:kr,lineNumber:56,columnNumber:5},this)}const Ar=D(null);var Er="/home/runner/work/frontend-shared/frontend-shared/src/components/input/SelectNext.tsx";function Tr(e,t){return"function"==typeof e?e(t):e}function Cr({value:e,children:t,disabled:n=!1,classes:r}){const o=me(Ar);if(!o)throw new Error("Select.Option can only be used as Select child");const{selectValue:i,value:a}=o,s=!n&&a===e;return Oe("li",{className:X("w-full ring-inset outline-none rounded-none","border-t first:border-t-0 transition-colors whitespace-nowrap",{"text-grey-4":n,"cursor-pointer focus:ring hover:bg-grey-1":!n},r),onClick:()=>{n||i(e)},onKeyPress:t=>{!n&&["Enter","Space"].includes(t.code)&&(t.preventDefault(),
|
|
94
|
+
i(e))},role:"option","aria-disabled":n,"aria-selected":s,tabIndex:-1,children:Oe("div",{className:X("flex w-full p-1.5 border-l-4",{"border-l-transparent":!s,"border-l-brand font-medium":s}),children:Tr(t,{selected:s,disabled:n})},void 0,0,{fileName:Er,lineNumber:92,columnNumber:7},this)},void 0,0,{fileName:Er,lineNumber:65,columnNumber:5},this)}function Mr({buttonContent:e,value:t,onChange:n,children:r,disabled:o,elementRef:i,buttonId:a,buttonClasses:s,listboxClasses:l,containerClasses:c,right:u=!1,"aria-label":d,"aria-labelledby":h}){const[m,p]=ae(!1),f=he((()=>p(!1)),[]),g=ue(null),v=ue(null),b=pe(),_=Ie(i),y=pe(),w=function(e,t,n){const[r,o]=ae(!1);return ce((()=>{if(!e.current||!t.current||!n)return void o(!1);const r=window.innerHeight,{top:i,bottom:a}=e.current.getBoundingClientRect(),s=r-a,{bottom:l}=t.current.getBoundingClientRect();o(r-l<0&&i>s)}),[e,t,n]),r}(_,v,m),x=he((e=>{n(e),f()}),[f,n]);return Ae(g,f),Ee(g,f),Te(["Escape"],f),Se(v,{horizontal:!1,loop:!1,autofocus:!0,containerVisible:m,
|
|
95
95
|
selector:'[role="option"]:not([aria-disabled="true"])'}),ce((()=>{!m&&v.current.contains(document.activeElement)&&_.current.focus()}),[_,m]),Oe("div",{className:X("relative w-full border rounded",Jn,c),ref:g,children:[Oe("button",{id:null!=a?a:y,className:X("focus-visible-ring transition-colors whitespace-nowrap","w-full flex items-center justify-between gap-x-2 p-2","bg-grey-0 disabled:bg-grey-1 disabled:text-grey-6","rounded-[inherit]",s),type:"button",role:"combobox",disabled:o,"aria-expanded":m,"aria-haspopup":"listbox","aria-controls":b,"aria-label":d,"aria-labelledby":h,ref:_,onClick:()=>p((e=>!e)),onKeyDown:e=>{"ArrowDown"!==e.key||m||(e.preventDefault(),p(!0))},"data-testid":"select-toggle-button",children:[Oe("div",{className:"truncate",children:e},void 0,0,{fileName:Er,lineNumber:269,columnNumber:9},this),Oe("div",{className:"text-grey-6",children:m?Oe(fn,{},void 0,0,{fileName:Er,lineNumber:271,columnNumber:26},this):Oe(vn,{},void 0,0,{fileName:Er,lineNumber:271,columnNumber:49},this)},void 0,0,{
|
|
96
96
|
fileName:Er,lineNumber:270,columnNumber:9},this)]},void 0,0,{fileName:Er,lineNumber:238,columnNumber:7},this),Oe(Ar.Provider,{value:{selectValue:x,value:t},children:Oe("ul",{className:X("absolute z-5 min-w-full max-h-80 overflow-y-auto","rounded border bg-white shadow hover:shadow-md focus-within:shadow-md",{"top-full mt-1":!w,"bottom-full mb-1":w,"right-0":u,hidden:!m},l),role:"listbox",ref:v,id:b,"aria-labelledby":null!=a?a:y,"aria-orientation":"vertical","data-testid":"select-listbox",children:r},void 0,0,{fileName:Er,lineNumber:275,columnNumber:9},this)},void 0,0,{fileName:Er,lineNumber:274,columnNumber:7},this)]},void 0,0,{fileName:Er,lineNumber:230,columnNumber:5},this)}Cr.displayName="SelectNext.Option",Mr.displayName="SelectNext";const Ir=Object.assign(Mr,{Option:Cr});var zr="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/Link.tsx";function Lr({children:e,classes:t,elementRef:n,underline:r="none",unstyled:o=!1,variant:i="brand",...a}){const s=!o;return Oe("a",{
|
|
97
97
|
"data-component":"Link",rel:"noopener noreferrer",...a,className:X(s&&{"focus-visible-ring rounded":!0,"no-underline hover:no-underline":"none"===r,"underline hover:underline":"always"===r,"no-underline hover:underline":"hover"===r},s&&"custom"!==i&&{"text-brand hover:text-brand-dark":"brand"===i,"text-color-text-light hover:text-brand":"text-light"===i,"text-color-text hover:text-brand-dark":"text"===i},t),ref:n,children:e},void 0,0,{fileName:zr,lineNumber:37,columnNumber:5},this)}var Or="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/LinkButton.tsx";function Rr({children:e,classes:t,elementRef:n,inline:r=!1,underline:o="none",variant:i="brand",unstyled:a=!1,...s}){const l=!a;return Oe(Kn,{"data-component":"LinkButton",...s,elementRef:n,classes:X(l&&{"focus-visible-ring transition-colors whitespace-nowrap rounded":!0,inline:r,"flex items-center":!r},l&&{"no-underline hover:no-underline":"none"===o,"underline enabled:hover:underline":"always"===o,
|
|
@@ -552,7 +552,7 @@ const of=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5
|
|
|
552
552
|
;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:yf[t.sortKey]};if(!!t.filterQuery||Object.keys(t.filters).length>0){const e=function(e,t={}){const n=e=>{const n=t[e];return"string"==typeof n?[n]:[]},r=n("cfi"),o=n("page"),i=n("quote"),a=n("tag"),s=n("text"),l=n("uri"),c=n("user"),u=[],d=[],h=ff(e,df);for(const e of h){const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"cfi":r.push(n);break;case"quote":i.push(n);break;case"page":o.push(n);break;case"since":{const t=86400,n={sec:1,min:60,hour:3600,day:t,week:7*t,month:30*t,year:365*t},r=e.slice(6).toLowerCase().match(/^(\d+)(sec|min|hour|day|week|month|year)?$/);if(r){const e=parseFloat(r[1]),t=r[2]||"sec";d.push(e*n[t])}}break;case"tag":a.push(n);break;case"text":s.push(n);break;case"uri":l.push(n);break;case"user":c.push(n);break;default:u.push(e)}}return{any:{terms:u,operator:"and"},cfi:{terms:r,operator:"or"},quote:{
|
|
553
553
|
terms:i,operator:"and"},page:{terms:o,operator:"or"},since:{terms:d,operator:"and"},tag:{terms:a,operator:"and"},text:{terms:s,operator:"and"},uri:{terms:l,operator:"or"},user:{terms:c,operator:"or"}}}(t.filterQuery||"",t.filters);n.filterFn=t=>function(e,t){const n=(e,t)=>new sf(t,uf[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 lf("or",e.map((e=>n(e,t))))))}else r=t.terms.map((t=>n(e,t)));return new lf(t.operator,r)})),o=new lf("and",r);return e.filter((e=>e.id&&o.matches(e))).map((e=>e.id))}([t],e).length>0}const r=Xp(e.annotations,n),o={annotation:0,note:0,orphan:0};return e.showTabs&&(r.children=r.children.filter((e=>{if(!e.annotation)return!1;if(Do(e.annotation))return!1;const n=vf(e.annotation);return o[n]+=1,n===t.selectedTab}))),{tabCounts:o,rootThread:r}}));function xf(){
|
|
554
554
|
const e=Ea(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a="sidebar"===r,s=de((()=>{const e={...o,filterQuery:n,filters:i};return{annotations:t,selection:e,showTabs:a}}),[t,n,o,i,a]);return wf(s)}var kf=Kr((function({loadAnnotationsService:e,onLogin:t}){var n;const r=Ea(),o=null!==(n=r.routeParams().id)&&void 0!==n?n:"",{rootThread:i}=xf(),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]),Oe(v,{children:[s&&Oe(Ta,{errorType:"annotation",onLoginRequest:t}),Oe(Hp,{threads:i.children})]})}),["loadAnnotationsService"]);class Nf{constructor(e,t,n=window){var r,o,i;B(this,"version",void 0),B(this,"userAgent",void 0),B(this,"urls",void 0),B(this,"fingerprint",void 0),B(this,"account",void 0),B(this,"timestamp",void 0),
|
|
555
|
-
B(this,"segment",void 0);const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.
|
|
555
|
+
B(this,"segment",void 0);const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1455.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(o=o.metadata)||void 0===o?void 0:o.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString();const l=null===(i=t[0])||void 0===i?void 0:i.segment;if(l){const e=[];if(l.cfi&&e.push(["CFI",l.cfi]),l.pages){const t=`${l.pages.start}-${l.pages.end}`;e.push(["Pages",t])}l.url&&e.push(["URL",l.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 Sf="complete",Af="canceled";function Ef(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,
|
|
556
556
|
e.scrollTop=n)}function Tf(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),d=c&&null!=c.left?c.left:.5,h=c&&null!=c.top?c.top:.5,m=c&&null!=c.leftOffset?c.leftOffset:0,p=c&&null!=c.topOffset?c.topOffset:0,f=d,g=h;if(e.isWindow(t))s=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),r=u.left+t.pageXOffset-t.innerWidth*f+s*f,o=u.top+t.pageYOffset-t.innerHeight*g+l*g,r-=m,o-=p,r=e.align.lockX?t.pageXOffset:r,o=e.align.lockY?t.pageYOffset:o,i=r-t.pageXOffset,a=o-t.pageYOffset;else{s=u.width,l=u.height,n=t.getBoundingClientRect();var v=u.left-(n.left-t.scrollLeft),b=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=b+l*g-t.clientHeight*g,r-=m,o-=p,r=Math.max(Math.min(r,t.scrollWidth-t.clientWidth),0),o=Math.max(Math.min(o,t.scrollHeight-t.clientHeight),0),r=e.align.lockX?t.scrollLeft:r,o=e.align.lockY?t.scrollTop:o,i=r-t.scrollLeft,a=o-t.scrollTop}return{x:r,y:o,differenceX:i,differenceY:a}
|
|
557
557
|
}(t,e),o=Date.now()-t.startTime,i=Math.min(1/t.time*o,1);if(t.endIterations>=n)return Ef(e,r.x,r.y),e._scrollSettings=null,t.end(Sf);var a=1-t.ease(i);if(Ef(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Tf(t.scrollAncestor),void Tf(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Tf.bind(null,e))}}function Cf(e){return e.self===e}function Mf(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function If(){return!0}function zf(e){if(e.assignedSlot)return zf(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 Lf=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),t.time=isNaN(t.time)?1e3:t.time,
|
|
558
558
|
t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{};var r=zf(e),o=1,i=t.validTarget||If,a=t.isScrollable;t.debug&&(console.log("About to scroll to",e),r||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var s=[];r;)if(t.debug&&console.log("Scrolling parent node",r),i(r,o)&&(a?a(r,Mf):Mf(r))&&(o++,s.push(r)),!(r=zf(r))){l(Sf);break}return s.reduce(((n,r,o)=>function(e,t,n,r,o){var i,a=!t._scrollSettings,s=t._scrollSettings,l=Date.now(),c={passive:!0};function u(e){t._scrollSettings=null,t.parentElement&&t.parentElement._scrollSettings&&t.parentElement._scrollSettings.end(e),n.debug&&console.log("Scrolling ended with type",e,"for",t),o(e),i&&(t.removeEventListener("touchstart",i,c),t.removeEventListener("wheel",i,c))}s&&s.end(Af);var d=n.maxSynchronousAlignments;return null==d&&(d=3),t._scrollSettings={startTime:l,endIterations:0,target:e,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||Cf,maxSynchronousAlignments:d,end:u,scrollAncestor:r},
|
|
@@ -639,7 +639,7 @@ const n=Wo(e),r=Go(e),o=[`Created at: ${xp(new Date(e.created))}`,`Author: ${c(e
|
|
|
639
639
|
}(Oe("html",{lang:"en",children:[Oe("head",{children:[Oe("title",{children:`Annotations on "${a}"`}),Oe("meta",{charSet:"UTF-8"})]}),Oe("body",{children:[Oe("section",{children:[Oe("h1",{children:"Summary"}),Oe("p",{children:Oe("time",{dateTime:o.toISOString(),children:xp(o)})}),Oe("p",{children:Oe("strong",{children:a})}),Oe("p",{children:Oe("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})}),Oe("table",{children:Oe("tbody",{style:{verticalAlign:"top"},children:[Oe("tr",{children:[Oe("td",{children:"Group:"}),Oe("td",{children:t})]}),Oe("tr",{children:[Oe("td",{children:"Total users:"}),Oe("td",{children:s.length})]}),Oe("tr",{children:[Oe("td",{children:"Users:"}),Oe("td",{children:s.join(", ")})]}),Oe("tr",{children:[Oe("td",{children:"Total annotations:"}),Oe("td",{children:e.length})]}),Oe("tr",{children:[Oe("td",{children:"Total replies:"}),Oe("td",{children:l.length})]})]})})]}),Oe("hr",{}),Oe("section",{children:[Oe("h1",{children:"Annotations"}),e.map(((e,t)=>{
|
|
640
640
|
const n=Wo(e),r=Go(e),o=Tm(e.text),i=o===`<p>${e.text}</p>`?e.text:o;return Oe("article",{children:[Oe("h2",{children:["Annotation ",t+1,":"]}),Oe("table",{children:Oe("tbody",{style:{verticalAlign:"top"},children:[Oe("tr",{children:[Oe("td",{children:"Created at:"}),Oe("td",{children:Oe("time",{dateTime:e.created,children:xp(new Date(e.created))})})]}),Oe("tr",{children:[Oe("td",{children:"Author:"}),Oe("td",{children:c(e)})]}),n&&Oe("tr",{children:[Oe("td",{children:"Page:"}),Oe("td",{children:n})]}),Oe("tr",{children:[Oe("td",{children:"Type:"}),Oe("td",{children:Uo(e)})]}),r&&Oe("tr",{children:[Oe("td",{children:"Quote:"}),Oe("td",{children:Oe("blockquote",{style:{margin:0},children:r})})]}),Oe("tr",{children:[Oe("td",{children:"Comment:"}),Oe("td",{dangerouslySetInnerHTML:{__html:i}})]}),e.tags.length>0&&Oe("tr",{children:[Oe("td",{children:"Tags:"}),Oe("td",{children:e.tags.join(", ")})]})]})})]},e.id)}))]})]})]}),{},{pretty:!0}).replace(/\t/g," ")}
|
|
641
641
|
_exportCommon(e,{displayNamesEnabled:t,defaultAuthority:n}){const[r]=e;if(!r)throw new Error("No annotations to export");const o=e=>rs(e,n,t),{uri:i,title:a}=To(r);return{uri:i,title:a,uniqueUsers:[...new Set(e.map((e=>o(e))).filter(Boolean))],replies:e.filter((e=>zo(e))),extractUsername:o}}}pb.$inject=[];class fb extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),B(this,"url",void 0),B(this,"response",void 0),B(this,"reason",void 0),this.url=e,this.response=t,this.reason=n}}async function gb(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new fb(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new fb(e,n,"Failed to parse response")}var o;if(!n.ok)throw new fb(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}class vb{constructor(e,t,n){B(this,"_clientId",void 0),B(this,"search",void 0),B(this,"annotation",void 0),B(this,"group",void 0),B(this,"groups",void 0),B(this,"profile",void 0),
|
|
642
|
-
this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{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.
|
|
642
|
+
this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{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.1455.0"};i&&(c.Authorization="Bearer "+i);const u=r();u&&(c["X-Client-Id"]=u);const{url:d,unusedParams:h}=Qi(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 gb(m.toString(),{body:s?JSON.stringify(ub(s)):null,headers:c,method:l.method})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished})
|
|
643
643
|
;this.search=i("search"),this.annotation={create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},read:i("group.read")},this.groups={list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},read:i("profile.read"),update:i("profile.update")}}setClientId(e){this._clientId=e}}vb.$inject=["apiRoutes","auth","store"];var bb={};function _b(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 yb=_b;_b.prototype.reset=function(){this._attempts=1,
|
|
644
644
|
this._timeouts=this._originalTimeouts.slice(0)},_b.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},_b.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},_b.prototype.attempt=function(e,t){this._fn=e,
|
|
645
645
|
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)},_b.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},_b.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},_b.prototype.start=_b.prototype.try,_b.prototype.errors=function(){return this._errors},_b.prototype.attempts=function(){return this._attempts},_b.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=yb;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,7 +650,7 @@ return this._getAccessToken({client_id:this.clientId,grant_type:"authorization_c
|
|
|
650
650
|
this._apiRoutes=t,this._localStorage=n,this._settings=r,this._toastMessenger=o,this._window=e,this._listenForTokenStorageEvents()}_listenForTokenStorageEvents(){this._window.addEventListener("storage",(({key:e})=>{e===this._storageKey()&&(this._tokenInfoPromise=null,this.emit("oauthTokensChanged"))}))}_loadToken(){const e=this._localStorage.getObject(this._storageKey());return(e=>!!e&&"object"==typeof e&&"accessToken"in e&&"string"==typeof e.accessToken&&"refreshToken"in e&&"string"==typeof e.refreshToken&&"expiresAt"in e&&"number"==typeof e.expiresAt)(e)?{accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:e.expiresAt}:null}async _oauthClient(){if(this._client)return this._client;const e=await this._apiRoutes.links();var t,n;return this._client=new Ab({clientId:this._settings.oauthClientId,authorizationEndpoint:e["oauth.authorize"],revokeEndpoint:e["oauth.revoke"],tokenEndpoint:(t="token",n=this._settings.apiUrl,new URL(t,n).href)}),this._client}async _exchangeAuthCodeForToken(e){
|
|
651
651
|
const t=await this._oauthClient(),n=await t.exchangeAuthCode(e);return this._saveToken(n),n}async _exchangeGrantToken(e){const t=await this._oauthClient();try{return await t.exchangeGrantToken(e)}catch(e){throw this._toastMessenger.error("Hypothesis login lost: You must reload the page to annotate.",{autoDismiss:!1}),e}}_getGrantToken(){var e;return null===(e=qr(this._settings))||void 0===e?void 0:e.grantToken}_storageKey(){let e=new URL(this._settings.apiUrl).hostname;return e=e.replace(/\./g,"%2E"),`hypothesis.oauth.${e}.token`}_saveToken(e){this._localStorage.setObject(this._storageKey(),e)}async _refreshAccessToken(e,t){const n=await this._oauthClient();let r;try{if(r=await n.refreshToken(e),Date.now()>r.expiresAt)throw new Error("Refreshed token expired in the past")}catch{return null}return t.persist&&this._saveToken(r),r}async getAccessToken(){if(!this._tokenInfoPromise){const e=this._getGrantToken()
|
|
652
652
|
;void 0!==e?this._tokenInfoPromise=e?this._exchangeGrantToken(e):Promise.resolve(null):this._authCode?(this._tokenInfoPromise=this._exchangeAuthCodeForToken(this._authCode),this._authCode=null):this._tokenInfoPromise=Promise.resolve(this._loadToken())}const e=this._tokenInfoPromise,t=await this._tokenInfoPromise;if(!t)return null;if(e!==this._tokenInfoPromise)return this.getAccessToken();if(Date.now()>t.expiresAt){const e=this._getGrantToken();return this._tokenInfoPromise=this._refreshAccessToken(t.refreshToken,{persist:void 0===e}),this.getAccessToken()}return t.accessToken}async login(){const e=await this._oauthClient(),t=await e.authorize(this._window);this._authCode=t,this._tokenInfoPromise=null}async logout(){const[e,t]=await Promise.all([this._tokenInfoPromise,this._oauthClient()]);e&&await t.revokeToken(e.accessToken),this._tokenInfoPromise=null,this._localStorage.removeItem(this._storageKey())}}Eb.$inject=["$window","apiRoutes","localStorage","settings","toastMessenger"];class Tb{constructor(e,t,n){
|
|
653
|
-
B(this,"_annotationsService",void 0),B(this,"_toastMessenger",void 0),B(this,"_store",void 0),B(this,"_saving",void 0),B(this,"_failed",void 0),this._annotationsService=e,this._toastMessenger=t,this._store=n,this._saving=new Set,this._failed=new Set}init(){const e=e=>!this._saving.has(e)&&!this._failed.has(e);this._store.subscribe((()=>{this._store.newHighlights().forEach((t=>{const n=t.$tag;e(n)&&(this._saving.add(n),xb((()=>this._annotationsService.save(t))).then((()=>{this._toastMessenger.success(
|
|
653
|
+
B(this,"_annotationsService",void 0),B(this,"_toastMessenger",void 0),B(this,"_store",void 0),B(this,"_saving",void 0),B(this,"_failed",void 0),this._annotationsService=e,this._toastMessenger=t,this._store=n,this._saving=new Set,this._failed=new Set}init(){const e=e=>!this._saving.has(e)&&!this._failed.has(e);this._store.subscribe((()=>{this._store.newHighlights().forEach((t=>{const n=t.$tag;e(n)&&(this._saving.add(n),xb((()=>this._annotationsService.save(t))).then((()=>{this._toastMessenger.success(`Highlighted "${Go(t)}"`,{visuallyHidden:!0})})).catch((()=>{this._failed.add(n)})).finally((()=>{this._saving.delete(n)})))}))}))}isSaving(){return this._saving.size>0}}function Cb(e){if(null===e||"object"!=typeof e)return!1;for(const t of["frame1","frame2","type","requestId"])if("string"!=typeof e[t])return!1;return!0}Tb.$inject=["annotationsService","toastMessenger","store"];class Mb extends Error{constructor(e){super(e)}}class Ib{constructor({hostFrame:e,source:t,sourceId:n}){B(this,"_hostFrame",void 0),
|
|
654
654
|
B(this,"_listeners",void 0),B(this,"_source",void 0),B(this,"_sourceId",void 0),this._hostFrame=e,this._source=t,this._sourceId=n,this._listeners=new Wa}destroy(){this._listeners.removeAll()}async discover(e){const t=Zg(6);return new Promise(((n,r)=>{const o=()=>{this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request",requestId:t,sourceId:this._sourceId},"*")},i=setInterval(o,250),a=setTimeout((()=>{clearInterval(i),r(new Mb(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),s=this._listeners.add(window,"message",(o=>{const{data:l,ports:c}=o;Cb(l)&&l.requestId===t&&"request"!==l.type&&(clearInterval(i),clearTimeout(a),this._listeners.remove(s),"string"==typeof l.error?r(new Mb(l.error)):c.length>0?n(c[0]):r(new Mb(`${this._source}-${e} port request failed`)))}));o()}))}}function zb(e){const t=t=>{const{data:n}=t;if(n&&"hypothesis-error"===(null==n?void 0:n.type)){const{context:t,error:r}=n;e(r instanceof Error?r:function(e){const t=new Error(e.message)
|
|
655
655
|
;return t.stack=e.stack,t}(r),t)}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}const Lb="1.0.0",Ob="frame-rpc";function Rb(e,t=[],n=-1){return{protocol:Ob,version:Lb,arguments:t,method:e,sequence:n}}function Pb(e,t,n=[],r=-1){e.postMessage(Rb(t,n,r))}class Db{constructor({userAgent:e=navigator.userAgent,currentWindow:t=window,forceUnloadListener:n=!1}={}){B(this,"_callbacks",void 0),B(this,"_destroyed",void 0),B(this,"_listeners",void 0),B(this,"_methods",void 0),B(this,"_port",void 0),B(this,"_sequence",void 0),B(this,"_pendingCalls",void 0),B(this,"_receivedCloseEvent",void 0),this._port=null,this._methods=new Map,this._sequence=1,this._callbacks=new Map,this._listeners=new Wa,"onclose"in MessagePort.prototype&&!n||this._listeners.add(t,"unload",(()=>{this._port&&(Pb(this._port,"close"),t!==t.parent&&function(e){const t=e.match(/\bAppleWebKit\/([0-9]+)\b/);return!!t&&!(parseInt(t[1])<=537)}(e)&&t.parent.postMessage({type:"hypothesisPortClosed"},"*",[this._port]))
|
|
656
656
|
})),this._pendingCalls=[],this._destroyed=!1,this._receivedCloseEvent=!1}on(e,t){if(this._port)throw new Error("Cannot add a method handler after a port is connected");this._methods.set(e,t)}connect(e){this._port=e,this._listeners.add(e,"message",(e=>this._handle(e))),this._listeners.add(e,"close",(()=>{e.dispatchEvent(new MessageEvent("message",{data:Rb("close")}))})),e.start(),Pb(e,"connect");for(const[e,t]of this._pendingCalls)this.call(e,...t);this._pendingCalls=[]}destroy(){this._port&&(Pb(this._port,"close"),this._port.close()),this._destroyed=!0,this._listeners.removeAll()}call(e,...t){if(this._port||this._pendingCalls.push([e,t]),!this._port||this._destroyed)return;const n=this._sequence++,r=t[t.length-1];"function"==typeof r&&(this._callbacks.set(n,r),t=t.slice(0,-1)),Pb(this._port,e,t,n)}_parseMessage({data:e}){return e&&"object"==typeof e?e.protocol!==Ob||e.version!==Lb?null:Array.isArray(e.arguments)?e:null:null}_handle(e){const t=this._parseMessage(e),n=this._port;if(t&&n)if("method"in t){
|
|
@@ -702,7 +702,7 @@ this._session&&sw(this._session,{user:e}),this._notifyScopeListeners(),this}getU
|
|
|
702
702
|
const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){const t=e(this);return t instanceof Lw?t:this}return e instanceof Lw?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):e_(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),
|
|
703
703
|
e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Ow(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:$y(),...e},o=this._breadcrumbs;return o.push(r),this._breadcrumbs=o.length>n?o.slice(-n):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){
|
|
704
704
|
const{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:r,_extra:o,_user:i,_level:a,_fingerprint:s,_eventProcessors:l,_propagationContext:c,_sdkProcessingMetadata:u,_transactionName:d,_span:h}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:r,extra:o,user:i,level:a,fingerprint:s||[],eventProcessors:l,propagationContext:c,sdkProcessingMetadata:u,transactionName:d,span:h}}applyToEvent(e,t={},n=[]){Cw(e,this.getScopeData());return iw([...n,...rw(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:Z_();if(!this._client)return S_.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}
|
|
705
|
-
captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:Z_();if(!this._client)return S_.warn("No client configured on scope - will not capture message!"),r;const o=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Z_();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(S_.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function Ow(){return{traceId:Z_(),spanId:Z_().substring(16)}}const Rw="7.
|
|
705
|
+
captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:Z_();if(!this._client)return S_.warn("No client configured on scope - will not capture message!"),r;const o=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Z_();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(S_.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function Ow(){return{traceId:Z_(),spanId:Z_().substring(16)}}const Rw="7.100.1",Pw=parseFloat(Rw),Dw=100;class Fw{constructor(e,t,n,r=Pw){let o,i;this._version=r,t?o=t:(o=new Lw,o.setClient(e)),n?i=n:(i=new Lw,i.setClient(e)),this._stack=[{scope:o}],e&&this.bindClient(e),this._isolationScope=i}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,
|
|
706
706
|
t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();let n;try{n=e(t)}catch(e){throw this.popScope(),e}return n_(n)?n.then((e=>(this.popScope(),e)),(e=>{throw this.popScope(),e})):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:Z_(),r=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:n}),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:Z_(),o=new Error(e);return this.getScope().captureMessage(e,t,{
|
|
707
707
|
originalException:e,syntheticException:o,...n,event_id:r}),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Z_();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Dw}=r.getOptions&&r.getOptions()||{};if(i<=0)return;const a={timestamp:$y(),...e},s=o?N_((()=>o(a,t))):a;null!==s&&(r.emit&&r.emit("beforeAddBreadcrumb",s,t),n.addBreadcrumb(s,i))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}
|
|
708
708
|
configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=Hw(this);try{e(this)}finally{Hw(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return tw&&S_.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(tw&&!n){this.getClient()?S_.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):S_.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&lw(t),this._sendSessionUpdate(),e.setSession()}startSession(e){
|
|
@@ -711,14 +711,14 @@ return function(e=Bw()){t=e,t&&t.__SENTRY__&&t.__SENTRY__.hub&&!Uw(e).isOlderTha
|
|
|
711
711
|
sentry_client:`${t.name}/${t.version}`}},Object.keys(n).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`)).join("&");var n}const Yw=[];function Kw(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?oy(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 Xw(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Jw(e,t,n){if(n[t.name])tw&&S_.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===Yw.indexOf(t.name)&&(t.setupOnce(ow,jw),Yw.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),e.on&&"function"==typeof t.preprocessEvent){
|
|
712
712
|
const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,r)=>n(t,r,e)))}if(e.addEventProcessor&&"function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign(((t,r)=>n(t,r,e)),{id:t.name});e.addEventProcessor(r)}tw&&S_.log(`Integration installed: ${t.name}`)}}function Zw(e,t){return Object.assign((function(...e){return t(...e)}),{id:e})}function Qw(e,t,n,r){const o={sent_at:(new Date).toISOString()};n&&n.sdk&&(o.sdk={name:n.sdk.name,version:n.sdk.version}),r&&t&&(o.dsn=E_(t));const i=function(e){const t=function(e){let t="";for(const n of e){const e=Object.entries(n.tags),r=e.length>0?`|#${e.map((([e,t])=>`${e}:${t}`)).join(",")}`:"";t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${r}|T${n.timestamp}\n`}return t}(e);return[{type:"statsd",length:t.length},t]}(e);return qy(o,[i])}const ex="Not capturing exception because it's already been captured.";class tx{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,
|
|
713
713
|
this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=C_(e.dsn):tw&&S_.warn("No DSN provided, client will not send events."),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)}?${Ww(e,r)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(ry(e))return void(tw&&S_.log(ex));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=Zb(e)?e:String(e),a=Qb(e)?this.eventFromMessage(i,t,n):this.eventFromException(e,n);return this._process(a.then((e=>this._captureEvent(e,n,r))).then((e=>{o=e}))),o}
|
|
714
|
-
captureEvent(e,t,n){if(t&&t.originalException&&ry(t.originalException))return void(tw&&S_.log(ex));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{r=e}))),r}captureSession(e){"string"!=typeof e.release?tw&&S_.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),sw(e,{init:!1}))}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.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e))))):Oy(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){
|
|
714
|
+
captureEvent(e,t,n){if(t&&t.originalException&&ry(t.originalException))return void(tw&&S_.log(ex));let r=t&&t.event_id;const o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,o||n).then((e=>{r=e}))),r}captureSession(e){"string"!=typeof e.release?tw&&S_.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),sw(e,{init:!1}))}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.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e))))):Oy(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){
|
|
715
715
|
(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return tw&&S_.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];Jw(this,e,this._integrations),t||Xw(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=Gw(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Gy(n,Ky(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){const t=function(e,t,n,r){const o=Zy(n);return qy({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:E_(t)}},["aggregates"in e?[{
|
|
716
716
|
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}`;tw&&S_.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}captureAggregateMetrics(e){tw&&S_.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=Qw(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}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)))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach((t=>{t&&Jw(e,t,n)})),n}(this,e),Xw(this,e),this._integrationsInitialized=!0}_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
|
|
717
717
|
;(i&&0===e.errors||i&&n)&&(sw(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Py((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._transport}_prepareEvent(e,t,n,r=$w()){const o=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i.length>0&&(t.integrations=i),this.emit("preprocessEvent",e,t),hw(o,e,t,n,this,r).then((e=>{if(null===e)return e;const t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if(!(e.contexts&&e.contexts.trace)&&t){const{traceId:r,spanId:o,parentSpanId:i,dsc:a}=t;e.contexts={trace:{trace_id:r,span_id:o,parent_span_id:i},...e.contexts};const s=a||Ew(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e}))}_captureEvent(e,t={},n){
|
|
718
|
-
return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if(tw){const t=e;"log"===t.logLevel?S_.log(t.message):S_.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:o}=r,i=rx(e),a=nx(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),Ry(new M_(`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 M_("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(nx(t)&&r)return r(t,n);if(rx(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
|
|
719
|
-
throw new M_(`${t} rejected with ${e}`)}));if(!e_(e)&&null!==e)throw new M_(n);return e}(o,l)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",c,e),new M_(`${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 M_)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new M_(`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.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,(e=>{
|
|
720
|
-
_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 nx(e){return void 0===e.type}function rx(e){return"transaction"===e.type}function ox(e,t){!0===t.debug&&(tw?S_.enable():N_((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));ww().update(t.initialScope);const n=new e(t);!function(e){const t=jw().getStackTop();t.client=e,t.scope.setClient(e)}(n),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(n)}const ix=30;function ax(e,t,n=Dy(e.bufferSize||ix)){let r={};function o(o){const i=[];if(Vy(o,((t,n)=>{const o=Jy(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=sx(t,n);e.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(t)})),0===i.length)return Oy();const a=qy(o[0],i),s=t=>{Vy(a,((n,r)=>{
|
|
721
|
-
body:Yy(a,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&tw&&S_.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=ew(r,e),e)),(e=>{throw s("network_error"),e})))).then((e=>e),(e=>{if(e instanceof M_)return tw&&S_.error("Skipped sending event because buffer is full."),s("queue_overflow"),Oy();throw e}))}return o.__sentry__baseTransport__=!0,{send:o,flush:e=>n.drain(e)}}function sx(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const lx=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],cx=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],ux="InboundFilters",dx=(e={})=>({name:ux,setupOnce(){},processEvent(t,n,r){const o=r.getOptions(),i=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],
|
|
718
|
+
return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if(tw){const t=e;"log"===t.logLevel?S_.log(t.message):S_.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:o}=r,i=rx(e),a=nx(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),Ry(new M_(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const c="replay_event"===s?"replay":s,u=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,u).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",c,e),new M_("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(nx(t)&&r)return r(t,n);if(rx(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.`
|
|
719
|
+
;if(n_(e))return e.then((e=>{if(!e_(e)&&null!==e)throw new M_(n);return e}),(e=>{throw new M_(`${t} rejected with ${e}`)}));if(!e_(e)&&null!==e)throw new M_(n);return e}(o,l)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",c,e),new M_(`${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 M_)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new M_(`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.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,(e=>{
|
|
720
|
+
tw&&S_.error("Error while sending event:",e)}));tw&&S_.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 nx(e){return void 0===e.type}function rx(e){return"transaction"===e.type}function ox(e,t){!0===t.debug&&(tw?S_.enable():N_((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));ww().update(t.initialScope);const n=new e(t);!function(e){const t=jw().getStackTop();t.client=e,t.scope.setClient(e)}(n),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(n)}const ix=30;function ax(e,t,n=Dy(e.bufferSize||ix)){let r={};function o(o){const i=[];if(Vy(o,((t,n)=>{const o=Jy(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=sx(t,n);e.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(t)})),0===i.length)return Oy();const a=qy(o[0],i),s=t=>{Vy(a,((n,r)=>{
|
|
721
|
+
const o=sx(n,r);e.recordDroppedEvent(t,Jy(r),o)}))};return n.add((()=>t({body:Yy(a,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&tw&&S_.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=ew(r,e),e)),(e=>{throw s("network_error"),e})))).then((e=>e),(e=>{if(e instanceof M_)return tw&&S_.error("Skipped sending event because buffer is full."),s("queue_overflow"),Oy();throw e}))}return o.__sentry__baseTransport__=!0,{send:o,flush:e=>n.drain(e)}}function sx(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const lx=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],cx=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],ux="InboundFilters",dx=(e={})=>({name:ux,setupOnce(){},processEvent(t,n,r){const o=r.getOptions(),i=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],
|
|
722
722
|
ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:lx],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:cx],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,o);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return tw&&S_.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${ey(e)}`),!0;if(function(e,t){if(e.type||!t||!t.length)return!1;return function(e){const t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch(e){}n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`));tw&&0===t.length&&S_.error(`Could not extract message for event ${ey(e)}`);return t}(e).some((e=>l_(e,t)))}(e,t.ignoreErrors))return tw&&S_.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${ey(e)}`),!0;if(function(e,t){
|
|
723
723
|
if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&l_(n,t)}(e,t.ignoreTransactions))return tw&&S_.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${ey(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=hx(e);return!!n&&l_(n,t)}(e,t.denyUrls))return tw&&S_.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${ey(e)}.\nUrl: ${hx(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=hx(e);return!n||l_(n,t)}(e,t.allowUrls))return tw&&S_.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${ey(e)}.\nUrl: ${hx(e)}`),!0;return!1}(t,i)?null:t}});function hx(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 tw&&S_.error(`Cannot extract url for event ${ey(e)}`),null}}let mx;Zw(ux,dx)
|
|
724
724
|
;const px="FunctionToString",fx=new WeakMap,gx=()=>({name:px,setupOnce(){mx=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=O_(this),n=fx.has(yw())&&void 0!==t?t:this;return mx.apply(n,e)}}catch(e){}},setup(e){fx.set(e,!0)}});Zw(px,gx);const vx=p_;let bx=0;function _x(){return bx>0}function yx(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(O_(e))return e}catch(t){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const o=r.map((e=>yx(e,t)));return e.apply(this,o)}catch(e){throw bx++,setTimeout((()=>{bx--})),function(...e){const t=jw();if(2===e.length){const[n,r]=e;return n?t.withScope((()=>(t.getStackTop().scope=n,r(n)))):t.withScope(r)}t.withScope(e[0])}((n=>{n.addEventProcessor((e=>(t.mechanism&&(ty(e,void 0,void 0),ny(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),gw(e)})),e}};try{
|
|
@@ -754,8 +754,8 @@ case"update":case"past":this._store.receiveRealTimeUpdates({updatedAnnotations:e
|
|
|
754
754
|
const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new zk(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,Bb(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}Lk.$inject=["store","apiRoutes","auth","groups","session"]
|
|
755
755
|
;const Ok="hypothesis.user.tags.list",Rk="hypothesis.user.tags.map";class Pk{constructor(e){B(this,"_storage",void 0),this._storage=e}filter(e,t=null){const n=this._storage.getObject(Ok)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${sv(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject(Rk)||{};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(Rk,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(Ok,n)}}Pk.$inject=["localStorage"];class Dk{constructor(e){B(this,"_store",void 0),this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}Dk.$inject=["store"];class Fk extends Vf{constructor(e,t){super(),B(this,"_store",void 0),B(this,"_window",void 0),
|
|
756
756
|
B(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){this._store.getToastMessage(e)&&(this._store.removeToastMessage(e),this.emit("toastMessageDismissed",e))}_addMessage(e,t,{autoDismiss:n=!0,visuallyHidden:r=!1,delayed:o=!1}={}){if(this._store.hasToastMessage(e,t))return;if(o&&!this._window.document.hasFocus()){const o={autoDismiss:n,visuallyHidden:r};return void this._delayedMessageQueue.push({type:e,messageText:t,options:o})}const i={type:e,id:Zg(10),message:t,visuallyHidden:r,autoDismiss:n};this._store.addToastMessage(i),this.emit("toastMessageAdded",i)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}Fk.$inject=["store","$window"];const Bk=function(e){
|
|
757
|
-
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),Hk=function(e){const{version:t,origin:n}=ev(e.location.href);return"1.
|
|
758
|
-
autoDismiss:!1})}))}Bk.sentry&&Hk&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;bk({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.
|
|
757
|
+
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),Hk=function(e){const{version:t,origin:n}=ev(e.location.href);return"1.1455.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1455.0) than the host page (${t}). It may not work.`),!1):"null"===e.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):e.origin===n||(console.warn(`The Hypothesis sidebar is running in a different origin (${e.origin}) than expected (${n}). It may not work.`),!1)}(window);function jk(e,t){e.setClientId(t.clientId)}function $k(e,t,n){e.load(),t.load(),n.sync()}function Uk(e,t,n){e.init(),t.init(),n.init()}function qk(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{
|
|
758
|
+
autoDismiss:!1})}))}Bk.sentry&&Hk&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;bk({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1455.0",beforeSend:(e,t)=>{if(_k>=5)return av("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++_k;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{_w("host_config",ev(window.location.href))}catch(e){}_w("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),zb(((e,t)=>{yk(e,t)}))}(Bk.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")}))}(document.body),jk.$inject=["api","streamer"],
|
|
759
759
|
$k.$inject=["groups","session","router"],Uk.$inject=["autosaveService","persistedDefaults","serviceURL"],qk.$inject=["frameSync","store","toastMessenger"];const Gk=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",hv)}(),async function(e,t=window){const n=function(e){const t=ev(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:tv,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:rv(t.origin),ancestorLevel:nv(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
|
|
760
760
|
;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:ov(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await Qg(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=Qg(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=qr(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}(i),i}(Bk).then((e=>{!function(e,t){const n=new U
|
|
761
761
|
;n.register("annotationsExporter",pb).register("annotationsService",pv).register("annotationActivity",mv).register("api",vb).register("apiRoutes",Nb).register("auth",Eb).register("autosaveService",Tb).register("frameSync",$b).register("groups",Gb).register("importAnnotationsService",xk).register("loadAnnotationsService",kk).register("localStorage",Sk).register("persistedDefaults",Ek).register("router",Tk).register("serviceURL",Ck).register("session",Mk).register("streamer",Lk).register("streamFilter",Ik).register("tags",Pk).register("threadsService",Dk).register("toastMessenger",Fk).register("store",{factory:Aa}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Uk),n.run(jk),n.run($k),n.run(dv),n.run(qk),P(Oe(Yr.Provider,{value:n,children:Oe(Kg,{})}),t)}(e,Gk)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),P(Oe(Xg,{error:e}),t)}(e,Gk)));
|